diff --git a/.gitignore b/.gitignore index 13fb138245..016b59ea14 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,24 @@ -.idea -_site -coverage -node_modules +# build output +dist/ + +# generated types +.astro/ + +# dependencies +node_modules/ + +# logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# environment variables +.env +.env.production + +# macOS-specific files +.DS_Store + +# jetbrains setting folder +.idea/ diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index ae92fb3ac4..0000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "mathjs-src"] - path = mathjs-src - url = git@github.com:josdejong/mathjs.git diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..22a15055d6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,4 @@ +{ + "recommendations": ["astro-build.astro-vscode"], + "unwantedRecommendations": [] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..d642209762 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "command": "./node_modules/.bin/astro dev", + "name": "Development server", + "request": "launch", + "type": "node-terminal" + } + ] +} diff --git a/CNAME b/CNAME deleted file mode 100644 index d06970773b..0000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -mathjs.org \ No newline at end of file diff --git a/README.md b/README.md index 24569b2897..ff19a3e7ec 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,48 @@ -# math.js website +# Astro Starter Kit: Basics -This project contains the website of math.js, available at https://mathjs.org. -The website is static, and is hosted on [github pages](https://pages.github.com/). +```sh +npm create astro@latest -- --template basics +``` +[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics) +[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics) +[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json) -# Update +> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! -To update the website with the latest version of math.js: + -- Update the version number of math.js in package.json. +## 🚀 Project Structure -- Install the dependencies via npm: +Inside of your Astro project, you'll see the following folders and files: - npm install +```text +/ +├── public/ +│ └── favicon.svg +├── src/ +│ ├── layouts/ +│ │ └── Layout.astro +│ └── pages/ +│ └── index.astro +└── package.json +``` -- Update the docs, examples, and version number via the build tool: +To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/). - npm run build +## 🧞 Commands - Note that this script will update a git submodule `./mathjs-src` which checks - out the `master` branch and generates the docs and examples fresh from the - source code. +All commands are run from the root of the project, from a terminal: -- Ensure any new pages are added to git. +| Command | Action | +| :------------------------ | :----------------------------------------------- | +| `npm install` | Installs dependencies | +| `npm run dev` | Starts local dev server at `localhost:4321` | +| `npm run build` | Build your production site to `./dist/` | +| `npm run preview` | Preview your build locally, before deploying | +| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | +| `npm run astro -- --help` | Get help using the Astro CLI | -- To generate the website locally using [Jekyll](https://jekyllrb.com/): +## 👀 Want to learn more? - jekyll - - This will generate the static website in the folder `_site`. - -- To test the website locally, use Jekyll as server: - - jekyll --server 4000 - - The website is than available in the browser at http://localhost:4000. - - -# Deploy - -To deploy the website, all that is needed is to commit the changes via git, -and push the changes to the `gh-pages` branch of math.js on github. +Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat). diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 5447fa6fde..0000000000 --- a/_config.yml +++ /dev/null @@ -1,3 +0,0 @@ -exclude: [node_modules, coverage] - -markdown: kramdown diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index f9dc2426ec..0000000000 --- a/_layouts/default.html +++ /dev/null @@ -1,129 +0,0 @@ - - -
-
-
-☎ is not supported by default. It can be enabled
-by replacing the `isAlpha` function:
-
-```js
-const isAlphaOriginal = math.parse.isAlpha
-math.parse.isAlpha = function (c, cPrev, cNext) {
- return isAlphaOriginal(c, cPrev, cNext) || (c === '\u260E')
-}
-
-// now we can use the \u260E (phone) character in expressions
-const result = math.evaluate('\u260Efoo', {'\u260Efoo': 42}) // returns 42
-console.log(result)
-```
diff --git a/docs/expressions/expression_trees.md b/docs/expressions/expression_trees.md
deleted file mode 100644
index c322e8a983..0000000000
--- a/docs/expressions/expression_trees.md
+++ /dev/null
@@ -1,715 +0,0 @@
----
-layout: default
----
-
-<br />)
\ No newline at end of file
diff --git a/docs/expressions/index.md b/docs/expressions/index.md
deleted file mode 100644
index d89793dc42..0000000000
--- a/docs/expressions/index.md
+++ /dev/null
@@ -1,25 +0,0 @@
----
-layout: default
----
-
-| | Bitwise or | x | y | Left to right | 5 | 3 | `7`
-^| | Bitwise xor | x ^| y | Left to right | 5 ^| 2 | `7`
-`<<` | Left shift | `x << y` | Left to right | `4 << 1` | `8`
-`>>` | Right arithmetic shift | `x >> y` | Left to right | `8 >> 1` | `4`
-`>>>` | Right logical shift | `x >>> y` | Left to right | `-8 >>> 1` | `2147483644`
-`and` | Logical and | `x and y` | Left to right | `true and false` | `false`
-`not` | Logical not | `not y` | Right to left | `not true` | `false`
-`or` | Logical or | `x or y` | Left to right | `true or false` | `true`
-`xor` | Logical xor | `x xor y` | Left to right | `true xor true` | `false`
-`=` | Assignment | `x = y` | Right to left | `a = 5` | `5`
-`?` `:` | Conditional expression | `x ? y : z` | Right to left | `15 > 100 ? 1 : -1` | `-1`
-`:` | Range | `x : y` | Right to left | `1:4` | `[1,2,3,4]`
-`to`, `in` | Unit conversion | `x to y` | Left to right | `2 inch to cm` | `5.08 cm`
-`==` | Equal | `x == y` | Left to right | `2 == 4 - 2` | `true`
-`!=` | Unequal | `x != y` | Left to right | `2 != 3` | `true`
-`<` | Smaller | `x < y` | Left to right | `2 < 3` | `true`
-`>` | Larger | `x > y` | Left to right | `2 > 3` | `false`
-`<=` | Smallereq | `x <= y` | Left to right | `4 <= 3` | `false`
-`>=` | Largereq | `x >= y` | Left to right | `2 + 4 >= 6` | `true`
-
-
-^| | Bitwise xor
-| | Bitwise or (lazily evaluated)
-`and` | Logical and (lazily evaluated)
-`xor` | Logical xor
-`or` | Logical or (lazily evaluated)
-`?`, `:` | Conditional expression
-`=` | Assignment
-`,` | Parameter and column separator
-`;` | Row separator
-`\n`, `;` | Statement separators
-
-Lazy evaluation is used where logically possible for bitwise and logical
-operators. In the following example, the value of `x` will not even be
-evaluated because it cannot effect the final result:
-```js
-math.evaluate('false and x') // false, no matter what x equals
-```
-
-
-string
- * [.datatype()](#DenseMatrix+datatype) ⇒ string
- * [.create(data, [datatype])](#DenseMatrix+create)
- * [.subset(index, [replacement], [defaultValue])](#DenseMatrix+subset)
- * [.get(index)](#DenseMatrix+get) ⇒ \*
- * [.set(index, value, [defaultValue])](#DenseMatrix+set) ⇒ DenseMatrix
- * [.resize(size, [defaultValue], [copy])](#DenseMatrix+resize) ⇒ Matrix
- * [.clone()](#DenseMatrix+clone) ⇒ DenseMatrix
- * [.size()](#DenseMatrix+size) ⇒ Array.<number>
- * [.map(callback)](#DenseMatrix+map) ⇒ DenseMatrix
- * [.forEach(callback)](#DenseMatrix+forEach)
- * [.toArray()](#DenseMatrix+toArray) ⇒ Array
- * [.valueOf()](#DenseMatrix+valueOf) ⇒ Array
- * [.format([options])](#DenseMatrix+format) ⇒ string
- * [.toString()](#DenseMatrix+toString) ⇒ string
- * [.toJSON()](#DenseMatrix+toJSON) ⇒ Object
- * [.diagonal([k])](#DenseMatrix+diagonal) ⇒ Array
- * [.swapRows(i, j)](#DenseMatrix+swapRows) ⇒ Matrix
-* _static_
- * [.diagonal(size, value, [k], [defaultValue])](#DenseMatrix.diagonal) ⇒ DenseMatrix
- * [.fromJSON(json)](#DenseMatrix.fromJSON) ⇒ DenseMatrix
- * [.preprocess(data)](#DenseMatrix.preprocess) ⇒ Array
-
-
-string #DenseMatrix
-**Returns**: string - The storage format.
-
-string #DenseMatrix
-**Returns**: string - The datatype.
-
-DenseMatrix
-
-| Param | Type |
-| --- | --- |
-| data | Array |
-| [datatype] | string |
-
-
-DenseMatrix
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| index | Index | | |
-| [replacement] | Array | DenseMatrix| \* | | |
-| [defaultValue] | \* | 0 | Default value, filled in on new entries when the matrix is resized. If not provided, new matrix elements will be filled with zeros. |
-
-
-\* #DenseMatrix
-**Returns**: \* - value
-
-| Param | Type | Description |
-| --- | --- | --- |
-| index | Array.<number> | Zero-based index |
-
-
-DenseMatrix #DenseMatrix
-**Returns**: DenseMatrix- self
-
-| Param | Type | Description |
-| --- | --- | --- |
-| index | Array.<number> | Zero-based index |
-| value | \* | |
-| [defaultValue] | \* | Default value, filled in on new entries when the matrix is resized. If not provided, new matrix elements will be left undefined. |
-
-
-Matrix #DenseMatrix
-**Returns**: Matrix - The resized matrix
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| size | Array.<number> | | The new size the matrix should have. |
-| [defaultValue] | \* | 0 | Default value, filled in on new entries. If not provided, the matrix elements will be filled with zeros. |
-| [copy] | boolean | | Return a resized copy of the matrix |
-
-
-DenseMatrix #DenseMatrix
-**Returns**: DenseMatrix- clone
-
-Array.<number> #DenseMatrix
-**Returns**: Array.<number> - size
-
-DenseMatrix #DenseMatrix
-**Returns**: DenseMatrix- matrix
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
-
-
-DenseMatrix
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
-
-
-Array #DenseMatrix
-**Returns**: Array - array
-
-Array #DenseMatrix
-**Returns**: Array - array
-
-string #DenseMatrix
-**Returns**: string - str
-
-| Param | Type | Description |
-| --- | --- | --- |
-| [options] | Object | number | function | Formatting options. See lib/utils/number:format for a description of the available options. |
-
-
-string #DenseMatrix
-**Returns**: string - str
-
-Object #DenseMatrix
-
-Array #DenseMatrix
-**Returns**: Array - The array vector with the diagonal values.
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| [k] | number | BigNumber | 0 | The kth diagonal where the vector will retrieved. |
-
-
-Matrix #DenseMatrix
-**Returns**: Matrix - The matrix reference
-
-| Param | Type | Description |
-| --- | --- | --- |
-| i | number | Matrix row index 1 |
-| j | number | Matrix row index 2 |
-
-
-DenseMatrix #DenseMatrix
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| size | Array | | The matrix size. |
-| value | number | Array | | The values for the diagonal. |
-| [k] | number | BigNumber | 0 | The kth diagonal where the vector will be filled in. |
-| [defaultValue] | number | | The default value for non-diagonal |
-
-
-DenseMatrix #DenseMatrix
-
-| Param | Type | Description |
-| --- | --- | --- |
-| json | Object | An object structured like `{"mathjs": "DenseMatrix", data: [], size: []}`, where mathjs is optional |
-
-
-Array #DenseMatrix
-**Returns**: Array - data
-
-| Param | Type |
-| --- | --- |
-| data | Array |
-
diff --git a/docs/reference/classes/fibonacciheap.md b/docs/reference/classes/fibonacciheap.md
deleted file mode 100644
index 5fc24c007b..0000000000
--- a/docs/reference/classes/fibonacciheap.md
+++ /dev/null
@@ -1,74 +0,0 @@
----
-layout: default
----
-
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
-
-[FibonacciHeap](#FibonacciHeap)
diff --git a/docs/reference/classes/matrixindex.md b/docs/reference/classes/matrixindex.md
deleted file mode 100644
index cf503c5e0e..0000000000
--- a/docs/reference/classes/matrixindex.md
+++ /dev/null
@@ -1,137 +0,0 @@
----
-layout: default
----
-
-
-Array
- * [.clone()](#Index+clone) ⇒ [Index](#Index)
- * [.size()](#Index+size) ⇒ Array.<number>
- * [.max()](#Index+max) ⇒ Array.<number>
- * [.min()](#Index+min) ⇒ Array.<number>
- * [.forEach(callback)](#Index+forEach)
- * [.dimension(dim)](#Index+dimension) ⇒ Range | null
- * [.isScalar()](#Index+isScalar) ⇒ boolean
- * [.toArray()](#Index+toArray) ⇒ Array
- * [.toString()](#Index+toString) ⇒ String
- * [.toJSON()](#Index+toJSON) ⇒ Object
-* _static_
- * [.fromJSON(json)](#Index.fromJSON) ⇒ [Index](#Index)
-
-
-\* |
-
-
-Array #[Index](#Index)
-**Returns**: Array - array
-
-[Index](#Index) #[Index](#Index)
-**Returns**: [Index](#Index) - clone
-
-Array.<number> #[Index](#Index)
-**Returns**: Array.<number> - size
-
-Array.<number> #[Index](#Index)
-**Returns**: Array.<number> - max
-
-Array.<number> #[Index](#Index)
-**Returns**: Array.<number> - min
-
-[Index](#Index)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | Called for each range with a Range as first argument, the dimension as second, and the index object as third. |
-
-
-Range | null #[Index](#Index)
-**Returns**: Range | null - range
-
-| Param | Type | Description |
-| --- | --- | --- |
-| dim | Number | Number of the dimension |
-
-
-boolean #[Index](#Index)
-**Returns**: boolean - isScalar
-
-Array #[Index](#Index)
-**Returns**: Array - array
-
-String #[Index](#Index)
-**Returns**: String - str
-
-Object #[Index](#Index)
-**Returns**: Object - Returns a JSON object structured as:
- `{"mathjs": "Index", "ranges": [{"mathjs": "Range", start: 0, end: 10, step:1}, ...]}`
-
-[Index](#Index) #[Index](#Index)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| json | Object | A JSON object structured as: `{"mathjs": "Index", "dimensions": [{"mathjs": "Range", start: 0, end: 10, step:1}, ...]}` |
-
diff --git a/docs/reference/classes/matrixrange.md b/docs/reference/classes/matrixrange.md
deleted file mode 100644
index 64ee234f06..0000000000
--- a/docs/reference/classes/matrixrange.md
+++ /dev/null
@@ -1,162 +0,0 @@
----
-layout: default
----
-
-
-Array.<number>
- * [.min()](#Range+min) ⇒ number | undefined
- * [.max()](#Range+max) ⇒ number | undefined
- * [.forEach(callback)](#Range+forEach)
- * [.map(callback)](#Range+map) ⇒ Array
- * [.toArray()](#Range+toArray) ⇒ Array
- * [.valueOf()](#Range+valueOf) ⇒ Array
- * [.format([options])](#Range+format) ⇒ string
- * [.toString()](#Range+toString) ⇒ string
- * [.toJSON()](#Range+toJSON) ⇒ Object
-* _static_
- * [.parse(str)](#Range.parse) ⇒ [Range](#Range) | null
- * [.fromJSON(json)](#Range.fromJSON) ⇒ [Range](#Range)
-
-
-number | included lower bound |
-| end | number | excluded upper bound |
-| [step] | number | step size, default value is 1 |
-
-
-Array.<number> #[Range](#Range)
-**Returns**: Array.<number> - size
-
-number | undefined #[Range](#Range)
-**Returns**: number | undefined - min
-
-number | undefined #[Range](#Range)
-**Returns**: number | undefined - max
-
-[Range](#Range)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | The callback method is invoked with three parameters: the value of the element, the index of the element, and the Range being traversed. |
-
-
-Array #[Range](#Range)
-**Returns**: Array - array
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | The callback method is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
-
-
-Array #[Range](#Range)
-**Returns**: Array - array
-
-Array #[Range](#Range)
-**Returns**: Array - array
-
-string #[Range](#Range)
-**Returns**: string - str
-
-| Param | Type | Description |
-| --- | --- | --- |
-| [options] | Object | number | function | Formatting options. See lib/utils/number:format for a description of the available options. |
-
-
-string #[Range](#Range)
-
-Object #[Range](#Range)
-**Returns**: Object - Returns a JSON object structured as:
- `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}`
-
-[Range](#Range) | null #[Range](#Range)
-**Returns**: [Range](#Range) | null - range
-
-| Param | Type |
-| --- | --- |
-| str | string |
-
-
-[Range](#Range) #[Range](#Range)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| json | Object | A JSON object structured as: `{"mathjs": "Range", "start": 2, "end": 4, "step": 1}` |
-
diff --git a/docs/reference/classes/resultset.md b/docs/reference/classes/resultset.md
deleted file mode 100644
index 6a66283f5b..0000000000
--- a/docs/reference/classes/resultset.md
+++ /dev/null
@@ -1,51 +0,0 @@
----
-layout: default
----
-
-
-Array
- * [.toString()](#ResultSet+toString) ⇒ string
- * [.toJSON()](#ResultSet+toJSON) ⇒ Object
-* _static_
- * [.fromJSON(json)](#ResultSet.fromJSON) ⇒ [ResultSet](#ResultSet)
-
-
-Array |
-
-
-Array #[ResultSet](#ResultSet)
-**Returns**: Array - entries
-
-string #[ResultSet](#ResultSet)
-**Returns**: string - string
-
-Object #[ResultSet](#ResultSet)
-**Returns**: Object - Returns a JSON object structured as:
`{"mathjs": "ResultSet", "entries": [...]}`
-
-[ResultSet](#ResultSet) #[ResultSet](#ResultSet)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| json | Object | A JSON object structured as: `{"mathjs": "ResultSet", "entries": [...]}` |
-
diff --git a/docs/reference/classes/sparsematrix.md b/docs/reference/classes/sparsematrix.md
deleted file mode 100644
index fed2fa9fc3..0000000000
--- a/docs/reference/classes/sparsematrix.md
+++ /dev/null
@@ -1,249 +0,0 @@
----
-layout: default
----
-
-
-string
- * [.datatype()](#SparseMatrix+datatype) ⇒ string
- * [.create(data, [datatype])](#SparseMatrix+create)
- * [.density()](#SparseMatrix+density) ⇒ number
- * [.subset(index, [replacement], [defaultValue])](#SparseMatrix+subset)
- * [.get(index)](#SparseMatrix+get) ⇒ \*
- * [.set(index, value, [defaultValue])](#SparseMatrix+set) ⇒ [SparseMatrix](#SparseMatrix)
- * [.resize(size, [defaultValue], [copy])](#SparseMatrix+resize) ⇒ Matrix
- * [.clone()](#SparseMatrix+clone) ⇒ [SparseMatrix](#SparseMatrix)
- * [.size()](#SparseMatrix+size) ⇒ Array.<number>
- * [.map(callback, [skipZeros])](#SparseMatrix+map) ⇒ [SparseMatrix](#SparseMatrix)
- * [.forEach(callback, [skipZeros])](#SparseMatrix+forEach)
- * [.toArray()](#SparseMatrix+toArray) ⇒ Array
- * [.valueOf()](#SparseMatrix+valueOf) ⇒ Array
- * [.format([options])](#SparseMatrix+format) ⇒ string
- * [.toString()](#SparseMatrix+toString) ⇒ string
- * [.toJSON()](#SparseMatrix+toJSON) ⇒ Object
- * [.diagonal([k])](#SparseMatrix+diagonal) ⇒ Matrix
- * [.swapRows(i, j)](#SparseMatrix+swapRows) ⇒ Matrix
-* _static_
- * [.fromJSON(json)](#SparseMatrix.fromJSON) ⇒ [SparseMatrix](#SparseMatrix)
- * [.diagonal(size, value, [k], [datatype])](#SparseMatrix.diagonal) ⇒ [SparseMatrix](#SparseMatrix)
-
-
-string #[SparseMatrix](#SparseMatrix)
-**Returns**: string - The storage format.
-
-string #[SparseMatrix](#SparseMatrix)
-**Returns**: string - The datatype.
-
-[SparseMatrix](#SparseMatrix)
-
-| Param | Type |
-| --- | --- |
-| data | Array |
-| [datatype] | string |
-
-
-number #[SparseMatrix](#SparseMatrix)
-**Returns**: number - The matrix density.
-
-[SparseMatrix](#SparseMatrix)
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| index | Index | | |
-| [replacement] | Array | Maytrix | \* | | |
-| [defaultValue] | \* | 0 | Default value, filled in on new entries when the matrix is resized. If not provided, new matrix elements will be filled with zeros. |
-
-
-\* #[SparseMatrix](#SparseMatrix)
-**Returns**: \* - value
-
-| Param | Type | Description |
-| --- | --- | --- |
-| index | Array.<number> | Zero-based index |
-
-
-[SparseMatrix](#SparseMatrix) #[SparseMatrix](#SparseMatrix)
-**Returns**: [SparseMatrix](#SparseMatrix) - self
-
-| Param | Type | Description |
-| --- | --- | --- |
-| index | Array.<number> | Zero-based index |
-| value | \* | |
-| [defaultValue] | \* | Default value, filled in on new entries when the matrix is resized. If not provided, new matrix elements will be set to zero. |
-
-
-Matrix #[SparseMatrix](#SparseMatrix)
-**Returns**: Matrix - The resized matrix
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| size | Array.<number> | | The new size the matrix should have. |
-| [defaultValue] | \* | 0 | Default value, filled in on new entries. If not provided, the matrix elements will be filled with zeros. |
-| [copy] | boolean | | Return a resized copy of the matrix |
-
-
-[SparseMatrix](#SparseMatrix) #[SparseMatrix](#SparseMatrix)
-**Returns**: [SparseMatrix](#SparseMatrix) - clone
-
-Array.<number> #[SparseMatrix](#SparseMatrix)
-**Returns**: Array.<number> - size
-
-[SparseMatrix](#SparseMatrix) #[SparseMatrix](#SparseMatrix)
-**Returns**: [SparseMatrix](#SparseMatrix) - matrix
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
-| [skipZeros] | boolean | Invoke callback function for non-zero values only. |
-
-
-[SparseMatrix](#SparseMatrix)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| callback | function | The callback function is invoked with three parameters: the value of the element, the index of the element, and the Matrix being traversed. |
-| [skipZeros] | boolean | Invoke callback function for non-zero values only. |
-
-
-Array #[SparseMatrix](#SparseMatrix)
-**Returns**: Array - array
-
-Array #[SparseMatrix](#SparseMatrix)
-**Returns**: Array - array
-
-string #[SparseMatrix](#SparseMatrix)
-**Returns**: string - str
-
-| Param | Type | Description |
-| --- | --- | --- |
-| [options] | Object | number | function | Formatting options. See lib/utils/number:format for a description of the available options. |
-
-
-string #[SparseMatrix](#SparseMatrix)
-**Returns**: string - str
-
-Object #[SparseMatrix](#SparseMatrix)
-
-Matrix #[SparseMatrix](#SparseMatrix)
-**Returns**: Matrix - The matrix vector with the diagonal values.
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| [k] | number | BigNumber | 0 | The kth diagonal where the vector will retrieved. |
-
-
-Matrix #[SparseMatrix](#SparseMatrix)
-**Returns**: Matrix - The matrix reference
-
-| Param | Type | Description |
-| --- | --- | --- |
-| i | number | Matrix row index 1 |
-| j | number | Matrix row index 2 |
-
-
-[SparseMatrix](#SparseMatrix) #[SparseMatrix](#SparseMatrix)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| json | Object | An object structured like `{"mathjs": "SparseMatrix", "values": [], "index": [], "ptr": [], "size": []}`, where mathjs is optional |
-
-
-[SparseMatrix](#SparseMatrix) #[SparseMatrix](#SparseMatrix)
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| size | Array | | The matrix size. |
-| value | number | Array | Matrix | | The values for the diagonal. |
-| [k] | number | BigNumber | 0 | The kth diagonal where the vector will be filled in. |
-| [datatype] | string | | The Matrix datatype, values must be of this datatype. |
-
diff --git a/docs/reference/classes/unit.md b/docs/reference/classes/unit.md
deleted file mode 100644
index cb6cdb13dc..0000000000
--- a/docs/reference/classes/unit.md
+++ /dev/null
@@ -1,246 +0,0 @@
----
-layout: default
----
-
-
-string
- * [.clone()](#Unit+clone) ⇒ Unit
- * [._isDerived()](#Unit+_isDerived) ⇒ boolean
- * [.hasBase(base)](#Unit+hasBase)
- * [.equalBase(other)](#Unit+equalBase) ⇒ boolean
- * [.equals(other)](#Unit+equals) ⇒ boolean
- * [.multiply(other)](#Unit+multiply) ⇒ Unit
- * [.divide(other)](#Unit+divide) ⇒ Unit
- * [.pow(p)](#Unit+pow) ⇒ Unit
- * [.abs(x)](#Unit+abs) ⇒ Unit
- * [.to(valuelessUnit)](#Unit+to) ⇒ Unit
- * [.toNumber(valuelessUnit)](#Unit+toNumber) ⇒ number
- * [.toNumeric(valuelessUnit)](#Unit+toNumeric) ⇒ number | BigNumber | Fraction
- * [.toString()](#Unit+toString) ⇒ string
- * [.toJSON()](#Unit+toJSON) ⇒ Object
- * [.formatUnits()](#Unit+formatUnits) ⇒ string
- * [.format([options])](#Unit+format) ⇒ string
-* _static_
- * [.parse(str)](#Unit.parse) ⇒ Unit
- * [.isValuelessUnit(name)](#Unit.isValuelessUnit) ⇒ boolean
- * [.fromJSON(json)](#Unit.fromJSON) ⇒ Unit
-
-
-number | BigNumber | Fraction | Complex | boolean | A value like 5.2 |
-| [name] | string | A unit name like "cm" or "inch", or a derived unit of the form: "u1[^ex1] [u2[^ex2] ...] [/ u3[^ex3] [u4[^ex4]]]", such as "kg m^2/s^2", where each unit appearing after the forward slash is taken to be in the denominator. "kg m^2 s^-2" is a synonym and is also acceptable. Any of the units can include a prefix. |
-
-
-string #Unit
-
-Unit #Unit
-**Returns**: Unit - Returns a cloned version of the unit
-
-boolean #Unit
-**Returns**: boolean - True if the unit is derived
-
-Unit
-
-| Param | Type |
-| --- | --- |
-| base | BASE_UNITS | STRING | undefined |
-
-
-boolean #Unit
-**Returns**: boolean - true if equal base
-
-| Param | Type |
-| --- | --- |
-| other | Unit |
-
-
-boolean #Unit
-**Returns**: boolean - true if both units are equal
-
-| Param | Type |
-| --- | --- |
-| other | Unit |
-
-
-Unit #Unit
-**Returns**: Unit - product of this unit and the other unit
-
-| Param | Type |
-| --- | --- |
-| other | Unit |
-
-
-Unit #Unit
-**Returns**: Unit - result of dividing this unit by the other unit
-
-| Param | Type |
-| --- | --- |
-| other | Unit |
-
-
-Unit #Unit
-**Returns**: Unit - The result: this^p
-
-| Param | Type |
-| --- | --- |
-| p | number | Fraction | BigNumber |
-
-
-Unit #Unit
-**Returns**: Unit - The result: |x|, absolute value of x
-
-| Param | Type |
-| --- | --- |
-| x | number | Fraction | BigNumber |
-
-
-Unit #Unit
-**Returns**: Unit - Returns a clone of the unit with a fixed prefix and unit.
-
-| Param | Type | Description |
-| --- | --- | --- |
-| valuelessUnit | string | Unit | A unit without value. Can have prefix, like "cm" |
-
-
-number #Unit
-**Returns**: number - Returns the unit value as number.
-
-| Param | Type | Description |
-| --- | --- | --- |
-| valuelessUnit | string | Unit | For example 'cm' or 'inch' |
-
-
-number | BigNumber | Fraction #Unit
-**Returns**: number | BigNumber | Fraction - Returns the unit value
-
-| Param | Type | Description |
-| --- | --- | --- |
-| valuelessUnit | string | Unit | For example 'cm' or 'inch' |
-
-
-string #Unit
-
-Object #Unit
-**Returns**: Object - Returns a JSON object structured as:
- `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}`
-
-string #Unit
-
-string #Unit
-
-| Param | Type | Description |
-| --- | --- | --- |
-| [options] | Object | number | function | Formatting options. See lib/utils/number:format for a description of the available options. |
-
-
-Unit #Unit
-**Returns**: Unit - unit
-
-| Param | Type | Description |
-| --- | --- | --- |
-| str | string | A string like "5.2 inch", "4e2 cm/s^2" |
-
-
-boolean #Unit
-**Returns**: boolean - true if the given string is a unit
-
-| Param | Type | Description |
-| --- | --- | --- |
-| name | string | A string to be tested whether it is a value less unit. The unit can have prefix, like "cm" |
-
-
-Unit #Unit
-
-| Param | Type | Description |
-| --- | --- | --- |
-| json | Object | A JSON object structured as: `{"mathjs": "Unit", "value": 2, "unit": "cm", "fixPrefix": false}` |
-
diff --git a/docs/reference/constants.md b/docs/reference/constants.md
deleted file mode 100644
index 5ee5e97a65..0000000000
--- a/docs/reference/constants.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-layout: default
----
-
-| CDN | -Url | -
|---|---|
| unpkg | -https://unpkg.com/mathjs@14.5.2/ | -
| cdnjs | -https://cdnjs.com/libraries/mathjs | -
| jsDelivr | -https://www.jsdelivr.com/package/npm/mathjs | -
| PageCDN | -https://pagecdn.com/lib/mathjs | -
- math.js (version 14.5.2, 186 kB, minified and gzipped) - and if needed the source map -
- -Too large for you? Create your own [custom bundle](docs/custom_bundling.html). - - -- This code example extends the trigonometric functions of math.js with configurable angles: degrees, radians, or gradians. -
- -| Angles | -- - | -
|---|---|
| Expression | -- - - | -
| Result | -- |
- This code example extends the trigonometric functions of math.js with configurable angles: degrees, radians, or gradians. -
- -| Angles | -- - | -
|---|---|
| Expression | -- - - | -
| Result | -- |
- This example demonstrates how you can fetch actual currencies from fixer.io and use them in math.js. -
- -- Create a (free) account at fixer.io and fill in your API access key below: -
- - - --
- - - - - \ No newline at end of file diff --git a/examples/browser/currency_conversion.html.md b/examples/browser/currency_conversion.html.md deleted file mode 100644 index 0b42d483a3..0000000000 --- a/examples/browser/currency_conversion.html.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -layout: default ---- - -# Currency conversion - -File: [currency_conversion.html](currency_conversion.html) (click for a live demo) - -```html - - - - -- This example demonstrates how you can fetch actual currencies from fixer.io and use them in math.js. -
- -- Create a (free) account at fixer.io and fill in your API access key below: -
- - - --
- - - - - -``` - - - diff --git a/examples/browser/custom_separators.html b/examples/browser/custom_separators.html deleted file mode 100644 index c69f637c2f..0000000000 --- a/examples/browser/custom_separators.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - -- This code example shows how to apply custom separators for function arguments and decimal separator. -
- -| Argument separator | -- - | -
|---|---|
| Decimal separator | -- - | -
| Expression | -- - - | -
| Result | -- |
- This code example shows how to apply custom separators for function arguments and decimal separator. -
- -| Argument separator | -- - | -
|---|---|
| Decimal separator | -- - | -
| Expression | -- - - | -
| Result | -- |
- Used plot library: Plotly -
- - - - - diff --git a/examples/browser/plot.html.md b/examples/browser/plot.html.md deleted file mode 100644 index bfd47eb20e..0000000000 --- a/examples/browser/plot.html.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -layout: default ---- - -# Plot - -File: [plot.html](plot.html) (click for a live demo) - -```html - - - - -- Used plot library: Plotly -
- - - - - - -``` - - - diff --git a/examples/browser/pretty_printing_with_mathjax.html b/examples/browser/pretty_printing_with_mathjax.html deleted file mode 100644 index 1198c5df4c..0000000000 --- a/examples/browser/pretty_printing_with_mathjax.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - -| Expression | -- |
|---|---|
| Pretty print | -- |
| Result | -- |
| Expression | -- |
|---|---|
| Pretty print | -- |
| Result | -- |
| Expression | -- |
|---|---|
| Result | -- |
| HTML output | -$$$$ |
-
| HTML code | -$$$$ |
-
| Expression | -- |
|---|---|
| Result | -- |
| HTML output | -$$$$ |
-
| HTML code | -$$$$ |
-
- This example simulates the launch of a SpaceX Falcon 9 modeled using a system of ordinary differential equations. -
- - - - - - - - diff --git a/examples/browser/rocket_trajectory_optimization.html.md b/examples/browser/rocket_trajectory_optimization.html.md deleted file mode 100644 index 1a78795358..0000000000 --- a/examples/browser/rocket_trajectory_optimization.html.md +++ /dev/null @@ -1,318 +0,0 @@ ---- -layout: default ---- - -# Rocket trajectory optimization - -File: [rocket_trajectory_optimization.html](rocket_trajectory_optimization.html) (click for a live demo) - -```html - - - - - -- This example simulates the launch of a SpaceX Falcon 9 modeled using a system of ordinary differential equations. -
- - - - - - - - - -``` - - - diff --git a/examples/browser/webworkers/index.md b/examples/browser/webworkers/index.md deleted file mode 100644 index 7580f6c67c..0000000000 --- a/examples/browser/webworkers/index.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -layout: default ---- - -# Webworkers - -File: [webworkers.html](webworkers.html) (click for a live demo) - -```html - - - - -- In this example, a math.js parser is running in a separate - web worker, - preventing the user interface from freezing during heavy calculations. -
- - - - - - - -``` - -File: [worker.js](worker.js) - -```js -importScripts('https://unpkg.com/mathjs@14.5.2/lib/browser/math.js') - -// create a parser -const parser = self.math.parser() - -self.addEventListener('message', function (event) { - const request = JSON.parse(event.data) - let result = null - let err = null - - try { - // evaluate the expression - result = parser.evaluate(request.expr) - } catch (e) { - // return the error - err = e - } - - // build a response - const response = { - id: request.id, - result: self.math.format(result), - err: err - } - - // send the response back - self.postMessage(JSON.stringify(response)) -}, false) - -``` - - - diff --git a/examples/browser/webworkers/webworkers.html b/examples/browser/webworkers/webworkers.html deleted file mode 100644 index 26a230c7f3..0000000000 --- a/examples/browser/webworkers/webworkers.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - -- In this example, a math.js parser is running in a separate - web worker, - preventing the user interface from freezing during heavy calculations. -
- - - - - - - \ No newline at end of file diff --git a/examples/browser/webworkers/worker.js b/examples/browser/webworkers/worker.js deleted file mode 100644 index 452c9b678e..0000000000 --- a/examples/browser/webworkers/worker.js +++ /dev/null @@ -1,28 +0,0 @@ -importScripts('https://unpkg.com/mathjs@14.5.2/lib/browser/math.js') - -// create a parser -const parser = self.math.parser() - -self.addEventListener('message', function (event) { - const request = JSON.parse(event.data) - let result = null - let err = null - - try { - // evaluate the expression - result = parser.evaluate(request.expr) - } catch (e) { - // return the error - err = e - } - - // build a response - const response = { - id: request.id, - result: self.math.format(result), - err: err - } - - // send the response back - self.postMessage(JSON.stringify(response)) -}, false) diff --git a/examples/chaining.js b/examples/chaining.js deleted file mode 100644 index 950aa70585..0000000000 --- a/examples/chaining.js +++ /dev/null @@ -1,54 +0,0 @@ -// chaining -import { chain, format, index, pi } from 'mathjs' - -// create a chained operation using the function `chain(value)` -// end a chain using done(). Let's calculate (3 + 4) * 2 -const a = chain(3) - .add(4) - .multiply(2) - .done() -print(a) // 14 - -// Another example, calculate square(sin(pi / 4)) -const b = chain(pi) - .divide(4) - .sin() - .square() - .done() -print(b) // 0.5 - -// A chain has a few special methods: done, toString, valueOf, get, and set. -// these are demonstrated in the following examples - -// toString will return a string representation of the chain's value -const myChain = chain(2).divide(3) -const str = myChain.toString() -print(str) // "0.6666666666666666" - -// a chain has a function .valueOf(), which returns the value hold by the chain. -// This allows using it in regular operations. The function valueOf() acts the -// same as function done(). -print(myChain.valueOf()) // 0.66666666666667 -print(myChain + 2) // 2.6666666666667 - -// the function subset can be used to get or replace sub matrices -const array = [[1, 2], [3, 4]] -const v = chain(array) - .subset(index(1, 0)) - .done() -print(v) // 3 - -const m = chain(array) - .subset(index(0, 0), 8) - .multiply(3) - .done() -print(m) // [[24, 6], [9, 12]] - -/** - * Helper function to output a value in the console. Value will be formatted. - * @param {*} value - */ -function print (value) { - const precision = 14 - console.log(format(value, precision)) -} diff --git a/examples/chaining.js.md b/examples/chaining.js.md deleted file mode 100644 index 82f9753bb5..0000000000 --- a/examples/chaining.js.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -layout: default ---- - -# Chaining - -File: [chaining.js](chaining.js) - -```js -// chaining -import { chain, format, index, pi } from 'mathjs' - -// create a chained operation using the function `chain(value)` -// end a chain using done(). Let's calculate (3 + 4) * 2 -const a = chain(3) - .add(4) - .multiply(2) - .done() -print(a) // 14 - -// Another example, calculate square(sin(pi / 4)) -const b = chain(pi) - .divide(4) - .sin() - .square() - .done() -print(b) // 0.5 - -// A chain has a few special methods: done, toString, valueOf, get, and set. -// these are demonstrated in the following examples - -// toString will return a string representation of the chain's value -const myChain = chain(2).divide(3) -const str = myChain.toString() -print(str) // "0.6666666666666666" - -// a chain has a function .valueOf(), which returns the value hold by the chain. -// This allows using it in regular operations. The function valueOf() acts the -// same as function done(). -print(myChain.valueOf()) // 0.66666666666667 -print(myChain + 2) // 2.6666666666667 - -// the function subset can be used to get or replace sub matrices -const array = [[1, 2], [3, 4]] -const v = chain(array) - .subset(index(1, 0)) - .done() -print(v) // 3 - -const m = chain(array) - .subset(index(0, 0), 8) - .multiply(3) - .done() -print(m) // [[24, 6], [9, 12]] - -/** - * Helper function to output a value in the console. Value will be formatted. - * @param {*} value - */ -function print (value) { - const precision = 14 - console.log(format(value, precision)) -} - -``` - - - diff --git a/examples/code editor/README.md b/examples/code editor/README.md deleted file mode 100644 index 9be41f658a..0000000000 --- a/examples/code editor/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Code Editor Example - -This is an example for using [mathjs](https://mathjs.org) with a code editor. - -To run your own you need to install the dependancies with. -``` -npm install -``` - -You can start development mode with: -``` -npm run dev -``` - -Or build the project with: -``` -npm run build -``` \ No newline at end of file diff --git a/examples/code editor/getExpressions.js b/examples/code editor/getExpressions.js deleted file mode 100644 index e61ed19d50..0000000000 --- a/examples/code editor/getExpressions.js +++ /dev/null @@ -1,59 +0,0 @@ -import { parse } from 'mathjs' - -/** - * Extracts parsable expressions from a multiline string. - * - * @param {string} str - The multiline string containing expressions. - * @returns {Array<{from: number, to: number, source: string}>} An array of objects, - * where each object represents a parsable expression and contains: - * - from: The starting line number of the expression within the original string. - * - to: The ending line number of the expression within the original string. - * - source: The actual string content of the expression. - */ -export default function getExpressions(str) { - const lines = str.split('\n'); - let nextLineToParse = 0; - const result = []; - - for (let lineID = 0; lineID < lines.length; lineID++) { - const linesToTest = lines.slice(nextLineToParse, lineID + 1).join('\n'); - if (canBeParsed(linesToTest)) { - if (!isEmptyString(linesToTest)) { - result.push({ from: nextLineToParse, to: lineID, source: linesToTest }); - } - // Start the next parsing attempt from the line after the successfully parsed expression. - nextLineToParse = lineID + 1; - } - } - // Handle any remaining lines that couldn't be parsed as expressions. - const linesToTest = lines.slice(nextLineToParse).join('\n'); - if (!isEmptyString(linesToTest)) { - result.push({ from: nextLineToParse, to: lines.length - 1, source: linesToTest }); - } - return result; -} - -/** - * Determines whether a given expression can be successfully parsed. - * - * @param {string} expression - The expression to parse. - * @returns {boolean} True if the expression can be parsed, false otherwise. - */ -function canBeParsed(expression) { - try { - parse(expression) - return true - } catch (error) { - return false - } -} - -/** - * Checks if a given string is empty or only contains whitespace characters. - * - * @param {string} str - The string to check. - * @returns {boolean} True if the string is empty or only contains whitespace, false otherwise. - */ -function isEmptyString(str) { - return str.trim() === "" -} \ No newline at end of file diff --git a/examples/code editor/index.html b/examples/code editor/index.html deleted file mode 100644 index d8f86f276c..0000000000 --- a/examples/code editor/index.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - -${result}`,
- 'Help': result => `${math.format(result)}`,
- 'any': math.typed.referTo(
- 'number',
- fnumber => result => katex.renderToString(math.parse(fnumber(result)).toTex())
- )
-})
-
-/**
- * Processes an array of expressions by evaluating them, formatting the results,
- * and determining their visibility.
- *
- * @param {Array<{from: number, to: number, source: string}>} expressions - An array of objects representing expressions,
- * where each object has `from`, `to`, and `source` properties.
- * @returns {Array<{from: number, to: number, source: string, outputs: any, visible: boolean}>} An array of processed expressions,
- * where each object has additional `outputs` and `visible` properties.
- */
-function processExpressions(expressions) {
- parser.clear()
- return expressions.map(expression => {
- const result = calc(expression.source)
- const outputs = formatResult(result)
- // Determine visibility based on the result type:
- // - Undefined results are hidden.
- // - Results with an `isResultSet` property are hidden when empty.
- // - All other results are visible.
- const visible = result === undefined ? false : (result.isResultSet && result.entries.length === 0) ? false : true
- return ({
- ...expression,
- outputs,
- visible
- })
- })
-}
-
-/**
- * Updates the displayed results based on the editor's current content.
- *
- * @function updateResults
- * @requires getExpressions, processExpressions, resultsToHTML
- *
- * @description
- * 1. Extracts expressions from the editor's content.
- * 2. Evaluates and analyzes the expressions.
- * 3. Generates HTML to display the processed results.
- * 4. Renders the generated HTML in the designated results container.
- */
-function updateResults() {
- // Extract expressions from the editor's content.
- const expressions = getExpressions(editor.state.doc.toString());
-
- // Evaluate and analyze the expressions.
- processedExpressions = processExpressions(expressions);
-
- // Generate HTML to display the results.
- const resultsHtml = resultsToHTML(processedExpressions);
-
- // Render the generated HTML in the results container.
- resultsDOM.innerHTML = resultsHtml;
-}
-
-/**
-* Updates the visual highlighting of results based on the current line selection in the editor.
-*
-* @function updateSelection
-* @requires editor, processedExpressions
-*
-* @description
-* 1. Determines the current line number in the editor's selection.
-* 2. Finds the corresponding result (processed expression) that matches the current line.
-* 3. If a different result is selected than before:
-* - Removes highlighting from the previously selected result.
-* - Highlights the newly selected result.
-* - Scrolls the newly selected result into view.
-*/
-function updateSelection() {
- const selectedLine = editor.state.doc.lineAt(
- editor.state.selection.ranges[editor.state.selection.mainIndex].from
- ).number - 1;
-
- let selectedExpressionIndex;
-
- processedExpressions.forEach((result, index) => {
- if ((selectedLine >= result.from) && (selectedLine <= result.to)) {
- selectedExpressionIndex = index;
- }
- });
-
- if (selectedExpressionIndex !== previousSelectedExpressionIndex) {
- const previouslyHighlightedResult = document.querySelector('#result').children[previousSelectedExpressionIndex];
- if (previouslyHighlightedResult !== undefined) {
- previouslyHighlightedResult.className = null;
- }
-
- const currentlySelectedResult = document.querySelector('#result').children[selectedExpressionIndex];
- if (currentlySelectedResult !== undefined) {
- currentlySelectedResult.className = 'highlighted';
- currentlySelectedResult.scrollIntoView({ block: 'nearest', inline: 'start' });
- }
-
- previousSelectedExpressionIndex = selectedExpressionIndex;
- }
-}
-
-/**
-* Converts an array of processed results into HTML elements for display.
-*
-* @function resultsToHTML
-* @param {Array<{from: number, to: number, source: string, outputs: any, visible: boolean}>} results - An array of processed results, where each object has:
-* - from: The starting line number of the expression.
-* - to: The ending line number of the expression.
-* - source: The original expression string.
-* - outputs: The formatted result of evaluating the expression.
-* - visible: A boolean indicating whether the result should be displayed or hidden.
-* @returns {string} A string of HTML elements representing the results, where each result is enclosed in a tag with appropriate styling based on its visibility.
-*/
-function resultsToHTML(results) {
- return results.map(el => {
- const elementStyle = el.visible ? '' : 'style="display:none"'
- return `${el.outputs}`
- }
- ).join('')
-}
-
-updateResults()
diff --git a/examples/code editor/mathjs-lang.js b/examples/code editor/mathjs-lang.js
deleted file mode 100644
index 137086ea3b..0000000000
--- a/examples/code editor/mathjs-lang.js
+++ /dev/null
@@ -1,244 +0,0 @@
-/**
- * Create mathjs syntax highlighting for CodeMirror
- *
- * TODO: this is using CodeMirror v5 functionality, upgrade this to v6
- *
- * @param {Object} math A mathjs instance
- */
-export function mathjsLang(math) {
- function wordRegexp(words) {
- return new RegExp('^((' + words.join(')|(') + '))\\b')
- }
-
- const singleOperators = new RegExp("^[-+*/&|^~<>!%']")
- const singleDelimiters = new RegExp('^[([{},:=;.?]')
- const doubleOperators = new RegExp('^((==)|(!=)|(<=)|(>=)|(<<)|(>>)|(\\.[-+*/^]))')
- const doubleDelimiters = new RegExp('^((!=)|(^\\|))')
- const tripleDelimiters = new RegExp('^((>>>)|(<<<))')
- const expressionEnd = new RegExp('^[\\])]')
- const identifiers = new RegExp('^[_A-Za-z\xa1-\uffff][_A-Za-z0-9\xa1-\uffff]*')
-
- const mathFunctions = []
- const mathPhysicalConstants = []
- const mathIgnore = ['expr', 'type']
- const numberLiterals = [
- 'e',
- 'E',
- 'i',
- 'Infinity',
- 'LN2',
- 'LN10',
- 'LOG2E',
- 'LOG10E',
- 'NaN',
- 'null',
- 'phi',
- 'pi',
- 'PI',
- 'SQRT1_2',
- 'SQRT2',
- 'tau',
- 'undefined',
- 'version'
- ]
-
- // based on https://github.com/josdejong/mathjs/blob/develop/bin/cli.js
- for (const expr in math.expression.mathWithTransform) {
- if (!mathIgnore.includes(expr)) {
- if (typeof math[expr] === 'function') {
- mathFunctions.push(expr)
- } else if (!numberLiterals.includes(expr)) {
- mathPhysicalConstants.push(expr)
- }
- }
- }
-
- // generates a list of all valid units in mathjs
- const listOfUnits = []
- for (const unit in math.Unit.UNITS) {
- for (const prefix in math.Unit.UNITS[unit].prefixes) {
- listOfUnits.push(prefix + unit)
- }
- }
-
- const builtins = wordRegexp(mathFunctions)
-
- const keywords = wordRegexp(['to', 'in', 'and', 'not', 'or', 'xor', 'mod'])
-
- const units = wordRegexp(Array.from(new Set(listOfUnits)))
- const physicalConstants = wordRegexp(mathPhysicalConstants)
-
- // tokenizers
- function tokenTranspose(stream, state) {
- if (!stream.sol() && stream.peek() === "'") {
- stream.next()
- state.tokenize = tokenBase
- return 'operator'
- }
- state.tokenize = tokenBase
- return tokenBase(stream, state)
- }
-
- function tokenComment(stream, state) {
- if (stream.match(/^.*#}/)) {
- state.tokenize = tokenBase
- return 'comment'
- }
- stream.skipToEnd()
- return 'comment'
- }
-
- function tokenBase(stream, state) {
- // whitespaces
- if (stream.eatSpace()) return null
-
- // Handle one line Comments
- if (stream.match('#{')) {
- state.tokenize = tokenComment
- stream.skipToEnd()
- return 'comment'
- }
-
- if (stream.match(/^#/)) {
- stream.skipToEnd()
- return 'comment'
- }
-
- // Handle Number Literals
- if (stream.match(/^[0-9.+-]/, false)) {
- if (stream.match(/^[+-]?0x[0-9a-fA-F]+[ij]?/)) {
- stream.tokenize = tokenBase
- return 'number'
- }
- if (stream.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?[ij]?/)) {
- return 'number'
- }
- if (stream.match(/^[+-]?\d+([EeDd][+-]?\d+)?[ij]?/)) {
- return 'number'
- }
- }
- if (stream.match(wordRegexp(numberLiterals))) {
- return 'number'
- }
-
- // Handle Strings
- let m = stream.match(/^"(?:[^"]|"")*("|$)/) || stream.match(/^'(?:[^']|'')*('|$)/)
- if (m) {
- return m[1] ? 'string' : 'string error'
- }
-
- // Handle words
- if (stream.match(keywords)) {
- return 'keyword'
- }
- if (stream.match(builtins)) {
- return 'builtin'
- }
- if (stream.match(physicalConstants)) {
- return 'tag'
- }
- if (stream.match(units)) {
- return 'attribute'
- }
- if (stream.match(identifiers)) {
- return 'variable'
- }
- if (stream.match(singleOperators) || stream.match(doubleOperators)) {
- return 'operator'
- }
- if (
- stream.match(singleDelimiters) ||
- stream.match(doubleDelimiters) ||
- stream.match(tripleDelimiters)
- ) {
- return null
- }
- if (stream.match(expressionEnd)) {
- state.tokenize = tokenTranspose
- return null
- }
- // Handle non-detected items
- stream.next()
- return 'error'
- }
-
- return {
- name: 'mathjs',
-
- startState: function () {
- return {
- tokenize: tokenBase
- }
- },
-
- token: function (stream, state) {
- const style = state.tokenize(stream, state)
- if (style === 'number' || style === 'variable') {
- state.tokenize = tokenTranspose
- }
- return style
- },
-
- languageData: {
- commentTokens: { line: '#' },
- autocomplete: myCompletions
- }
- }
-
- function myCompletions(context) {
- let word = context.matchBefore(/\w*/)
- if (word.from == word.to && !context.explicit) return null
- let options = []
- mathFunctions.forEach((func) => options.push({ label: func, type: 'function' }))
-
- mathPhysicalConstants.forEach((constant) => options.push({ label: constant, type: 'constant' }))
-
- numberLiterals.forEach((number) => options.push({ label: number, type: 'variable' }))
-
- // units as enum
- for (const name in math.Unit.UNITS) {
- if (hasOwnPropertySafe(math.Unit.UNITS, name)) {
- if (name.startsWith(word.text)) {
- options.push({ label: name, type: 'enum' })
- }
- }
- }
- for (const name in math.Unit.PREFIXES) {
- if (hasOwnPropertySafe(math.Unit.PREFIXES, name)) {
- const prefixes = math.Unit.PREFIXES[name]
- for (const prefix in prefixes) {
- if (hasOwnPropertySafe(prefixes, prefix)) {
- if (prefix.startsWith(word.text)) {
- options.push({ label: prefix, type: 'enum' })
- } else if (word.text.startsWith(prefix)) {
- const unitKeyword = word.text.substring(prefix.length)
- for (const n in math.Unit.UNITS) {
- const fullUnit = prefix + n
- if (hasOwnPropertySafe(math.Unit.UNITS, n)) {
- if (
- !options.includes(fullUnit) &&
- n.startsWith(unitKeyword) &&
- math.Unit.isValuelessUnit(fullUnit)
- ) {
- options.push({ label: fullUnit, type: 'enum' })
- }
- }
- }
- }
- }
- }
- }
- }
-
- return {
- from: word.from,
- options
- }
- }
-}
-
-// helper function to safely check whether an object has a property
-// copy from the function in object.js which is ES6
-function hasOwnPropertySafe(object, property) {
- return object && Object.hasOwnProperty.call(object, property)
-}
\ No newline at end of file
diff --git a/examples/code editor/package-lock.json b/examples/code editor/package-lock.json
deleted file mode 100644
index b6614b9b2d..0000000000
--- a/examples/code editor/package-lock.json
+++ /dev/null
@@ -1,1120 +0,0 @@
-{
- "name": "code-editor",
- "version": "1.0.0",
- "lockfileVersion": 3,
- "requires": true,
- "packages": {
- "": {
- "name": "code-editor",
- "version": "1.0.0",
- "dependencies": {
- "@codemirror/language": "6.10.2",
- "@codemirror/state": "6.4.1",
- "codemirror": "6.0.1",
- "github-markdown-css": "5.6.1",
- "katex": "0.16.11",
- "mathjs": "13.0.2"
- },
- "devDependencies": {
- "vite": "5.3.3"
- }
- },
- "node_modules/@babel/runtime": {
- "version": "7.24.7",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.7.tgz",
- "integrity": "sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==",
- "license": "MIT",
- "dependencies": {
- "regenerator-runtime": "^0.14.0"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
- "node_modules/@codemirror/autocomplete": {
- "version": "6.10.2",
- "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.10.2.tgz",
- "integrity": "sha512-3dCL7b0j2GdtZzWN5j7HDpRAJ26ip07R4NGYz7QYthIYMiX8I4E4TNrYcdTayPJGeVQtd/xe7lWU4XL7THFb/w==",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.17.0",
- "@lezer/common": "^1.0.0"
- },
- "peerDependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/common": "^1.0.0"
- }
- },
- "node_modules/@codemirror/commands": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.3.0.tgz",
- "integrity": "sha512-tFfcxRIlOWiQDFhjBSWJ10MxcvbCIsRr6V64SgrcaY0MwNk32cUOcCuNlWo8VjV4qRQCgNgUAnIeo0svkk4R5Q==",
- "dependencies": {
- "@codemirror/language": "^6.0.0",
- "@codemirror/state": "^6.2.0",
- "@codemirror/view": "^6.0.0",
- "@lezer/common": "^1.1.0"
- }
- },
- "node_modules/@codemirror/language": {
- "version": "6.10.2",
- "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.10.2.tgz",
- "integrity": "sha512-kgbTYTo0Au6dCSc/TFy7fK3fpJmgHDv1sG1KNQKJXVi+xBTEeBPY/M30YXiU6mMXeH+YIDLsbrT4ZwNRdtF+SA==",
- "license": "MIT",
- "dependencies": {
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.23.0",
- "@lezer/common": "^1.1.0",
- "@lezer/highlight": "^1.0.0",
- "@lezer/lr": "^1.0.0",
- "style-mod": "^4.0.0"
- }
- },
- "node_modules/@codemirror/lint": {
- "version": "6.4.2",
- "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz",
- "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==",
- "dependencies": {
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "crelt": "^1.0.5"
- }
- },
- "node_modules/@codemirror/search": {
- "version": "6.5.4",
- "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.4.tgz",
- "integrity": "sha512-YoTrvjv9e8EbPs58opjZKyJ3ewFrVSUzQ/4WXlULQLSDDr1nGPJ67mMXFNNVYwdFhybzhrzrtqgHmtpJwIF+8g==",
- "dependencies": {
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0",
- "crelt": "^1.0.5"
- }
- },
- "node_modules/@codemirror/state": {
- "version": "6.4.1",
- "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.4.1.tgz",
- "integrity": "sha512-QkEyUiLhsJoZkbumGZlswmAhA7CBU02Wrz7zvH4SrcifbsqwlXShVXg65f3v/ts57W3dqyamEriMhij1Z3Zz4A==",
- "license": "MIT"
- },
- "node_modules/@codemirror/view": {
- "version": "6.23.0",
- "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.23.0.tgz",
- "integrity": "sha512-/51px9N4uW8NpuWkyUX+iam5+PM6io2fm+QmRnzwqBy5v/pwGg9T0kILFtYeum8hjuvENtgsGNKluOfqIICmeQ==",
- "dependencies": {
- "@codemirror/state": "^6.4.0",
- "style-mod": "^4.1.0",
- "w3c-keyname": "^2.2.4"
- }
- },
- "node_modules/@esbuild/aix-ppc64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
- "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "aix"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/android-arm": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
- "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/android-arm64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
- "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/android-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
- "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/darwin-arm64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
- "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/darwin-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
- "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/freebsd-arm64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
- "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/freebsd-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
- "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "freebsd"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-arm": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
- "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-arm64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
- "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-ia32": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
- "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-loong64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
- "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
- "cpu": [
- "loong64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-mips64el": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
- "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
- "cpu": [
- "mips64el"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-ppc64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
- "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-riscv64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
- "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-s390x": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
- "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/linux-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
- "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/netbsd-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
- "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "netbsd"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/openbsd-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
- "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "openbsd"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/sunos-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
- "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "sunos"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/win32-arm64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
- "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/win32-ia32": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
- "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@esbuild/win32-x64": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
- "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ],
- "engines": {
- "node": ">=12"
- }
- },
- "node_modules/@lezer/common": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz",
- "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw=="
- },
- "node_modules/@lezer/highlight": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz",
- "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==",
- "dependencies": {
- "@lezer/common": "^1.0.0"
- }
- },
- "node_modules/@lezer/lr": {
- "version": "1.3.13",
- "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.13.tgz",
- "integrity": "sha512-RLAbau/4uSzKgIKj96mI5WUtG1qtiR0Frn0Ei9zhPj8YOkHM+1Bb8SgdVvmR/aWJCFIzjo2KFnDiRZ75Xf5NdQ==",
- "dependencies": {
- "@lezer/common": "^1.0.0"
- }
- },
- "node_modules/@rollup/rollup-android-arm-eabi": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz",
- "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ]
- },
- "node_modules/@rollup/rollup-android-arm64": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz",
- "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "android"
- ]
- },
- "node_modules/@rollup/rollup-darwin-arm64": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz",
- "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@rollup/rollup-darwin-x64": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz",
- "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz",
- "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm-musleabihf": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz",
- "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==",
- "cpu": [
- "arm"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm64-gnu": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz",
- "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-arm64-musl": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz",
- "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz",
- "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==",
- "cpu": [
- "ppc64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-riscv64-gnu": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz",
- "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==",
- "cpu": [
- "riscv64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-s390x-gnu": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz",
- "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==",
- "cpu": [
- "s390x"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-x64-gnu": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz",
- "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-linux-x64-musl": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz",
- "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "linux"
- ]
- },
- "node_modules/@rollup/rollup-win32-arm64-msvc": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz",
- "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==",
- "cpu": [
- "arm64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@rollup/rollup-win32-ia32-msvc": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz",
- "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==",
- "cpu": [
- "ia32"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@rollup/rollup-win32-x64-msvc": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz",
- "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==",
- "cpu": [
- "x64"
- ],
- "dev": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "win32"
- ]
- },
- "node_modules/@types/estree": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz",
- "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==",
- "dev": true,
- "license": "MIT"
- },
- "node_modules/codemirror": {
- "version": "6.0.1",
- "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz",
- "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==",
- "dependencies": {
- "@codemirror/autocomplete": "^6.0.0",
- "@codemirror/commands": "^6.0.0",
- "@codemirror/language": "^6.0.0",
- "@codemirror/lint": "^6.0.0",
- "@codemirror/search": "^6.0.0",
- "@codemirror/state": "^6.0.0",
- "@codemirror/view": "^6.0.0"
- }
- },
- "node_modules/commander": {
- "version": "8.3.0",
- "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
- "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
- "engines": {
- "node": ">= 12"
- }
- },
- "node_modules/complex.js": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/complex.js/-/complex.js-2.1.1.tgz",
- "integrity": "sha512-8njCHOTtFFLtegk6zQo0kkVX1rngygb/KQI6z1qZxlFI3scluC+LVTCFbrkWjBv4vvLlbQ9t88IPMC6k95VTTg==",
- "engines": {
- "node": "*"
- },
- "funding": {
- "type": "patreon",
- "url": "https://www.patreon.com/infusion"
- }
- },
- "node_modules/crelt": {
- "version": "1.0.6",
- "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz",
- "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="
- },
- "node_modules/decimal.js": {
- "version": "10.4.3",
- "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
- "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA=="
- },
- "node_modules/esbuild": {
- "version": "0.21.5",
- "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz",
- "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "bin": {
- "esbuild": "bin/esbuild"
- },
- "engines": {
- "node": ">=12"
- },
- "optionalDependencies": {
- "@esbuild/aix-ppc64": "0.21.5",
- "@esbuild/android-arm": "0.21.5",
- "@esbuild/android-arm64": "0.21.5",
- "@esbuild/android-x64": "0.21.5",
- "@esbuild/darwin-arm64": "0.21.5",
- "@esbuild/darwin-x64": "0.21.5",
- "@esbuild/freebsd-arm64": "0.21.5",
- "@esbuild/freebsd-x64": "0.21.5",
- "@esbuild/linux-arm": "0.21.5",
- "@esbuild/linux-arm64": "0.21.5",
- "@esbuild/linux-ia32": "0.21.5",
- "@esbuild/linux-loong64": "0.21.5",
- "@esbuild/linux-mips64el": "0.21.5",
- "@esbuild/linux-ppc64": "0.21.5",
- "@esbuild/linux-riscv64": "0.21.5",
- "@esbuild/linux-s390x": "0.21.5",
- "@esbuild/linux-x64": "0.21.5",
- "@esbuild/netbsd-x64": "0.21.5",
- "@esbuild/openbsd-x64": "0.21.5",
- "@esbuild/sunos-x64": "0.21.5",
- "@esbuild/win32-arm64": "0.21.5",
- "@esbuild/win32-ia32": "0.21.5",
- "@esbuild/win32-x64": "0.21.5"
- }
- },
- "node_modules/escape-latex": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/escape-latex/-/escape-latex-1.2.0.tgz",
- "integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw=="
- },
- "node_modules/fraction.js": {
- "version": "4.3.7",
- "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz",
- "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==",
- "license": "MIT",
- "engines": {
- "node": "*"
- },
- "funding": {
- "type": "patreon",
- "url": "https://github.com/sponsors/rawify"
- }
- },
- "node_modules/fsevents": {
- "version": "2.3.3",
- "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
- "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
- "dev": true,
- "hasInstallScript": true,
- "license": "MIT",
- "optional": true,
- "os": [
- "darwin"
- ],
- "engines": {
- "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
- }
- },
- "node_modules/github-markdown-css": {
- "version": "5.6.1",
- "resolved": "https://registry.npmjs.org/github-markdown-css/-/github-markdown-css-5.6.1.tgz",
- "integrity": "sha512-DItLFgHd+s7HQmk63YN4/TdvLeRqk1QP7pPKTTPrDTYoI5x7f/luJWSOZxesmuxBI2srHp8RDyoZd+9WF+WK8Q==",
- "license": "MIT",
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
- "node_modules/javascript-natural-sort": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
- "integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw=="
- },
- "node_modules/katex": {
- "version": "0.16.11",
- "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.11.tgz",
- "integrity": "sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==",
- "funding": [
- "https://opencollective.com/katex",
- "https://github.com/sponsors/katex"
- ],
- "license": "MIT",
- "dependencies": {
- "commander": "^8.3.0"
- },
- "bin": {
- "katex": "cli.js"
- }
- },
- "node_modules/mathjs": {
- "version": "13.0.2",
- "resolved": "https://registry.npmjs.org/mathjs/-/mathjs-13.0.2.tgz",
- "integrity": "sha512-8vK/+InU4FTphRTWsrnvRsgSjbyNupRQYDDIXLuEGDZtJsGdbA9dVV4HZ0amBQb+RXplRjVJNGZZfB0WoHWFWA==",
- "license": "Apache-2.0",
- "dependencies": {
- "@babel/runtime": "^7.24.7",
- "complex.js": "^2.1.1",
- "decimal.js": "^10.4.3",
- "escape-latex": "^1.2.0",
- "fraction.js": "^4.3.7",
- "javascript-natural-sort": "^0.7.1",
- "seedrandom": "^3.0.5",
- "tiny-emitter": "^2.1.0",
- "typed-function": "^4.2.1"
- },
- "bin": {
- "mathjs": "bin/cli.js"
- },
- "engines": {
- "node": ">= 18"
- }
- },
- "node_modules/nanoid": {
- "version": "3.3.7",
- "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
- "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
- "dev": true,
- "funding": [
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "license": "MIT",
- "bin": {
- "nanoid": "bin/nanoid.cjs"
- },
- "engines": {
- "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
- }
- },
- "node_modules/picocolors": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",
- "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
- "dev": true,
- "license": "ISC"
- },
- "node_modules/postcss": {
- "version": "8.4.39",
- "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz",
- "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==",
- "dev": true,
- "funding": [
- {
- "type": "opencollective",
- "url": "https://opencollective.com/postcss/"
- },
- {
- "type": "tidelift",
- "url": "https://tidelift.com/funding/github/npm/postcss"
- },
- {
- "type": "github",
- "url": "https://github.com/sponsors/ai"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "nanoid": "^3.3.7",
- "picocolors": "^1.0.1",
- "source-map-js": "^1.2.0"
- },
- "engines": {
- "node": "^10 || ^12 || >=14"
- }
- },
- "node_modules/regenerator-runtime": {
- "version": "0.14.1",
- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
- "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
- "license": "MIT"
- },
- "node_modules/rollup": {
- "version": "4.18.0",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz",
- "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "@types/estree": "1.0.5"
- },
- "bin": {
- "rollup": "dist/bin/rollup"
- },
- "engines": {
- "node": ">=18.0.0",
- "npm": ">=8.0.0"
- },
- "optionalDependencies": {
- "@rollup/rollup-android-arm-eabi": "4.18.0",
- "@rollup/rollup-android-arm64": "4.18.0",
- "@rollup/rollup-darwin-arm64": "4.18.0",
- "@rollup/rollup-darwin-x64": "4.18.0",
- "@rollup/rollup-linux-arm-gnueabihf": "4.18.0",
- "@rollup/rollup-linux-arm-musleabihf": "4.18.0",
- "@rollup/rollup-linux-arm64-gnu": "4.18.0",
- "@rollup/rollup-linux-arm64-musl": "4.18.0",
- "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0",
- "@rollup/rollup-linux-riscv64-gnu": "4.18.0",
- "@rollup/rollup-linux-s390x-gnu": "4.18.0",
- "@rollup/rollup-linux-x64-gnu": "4.18.0",
- "@rollup/rollup-linux-x64-musl": "4.18.0",
- "@rollup/rollup-win32-arm64-msvc": "4.18.0",
- "@rollup/rollup-win32-ia32-msvc": "4.18.0",
- "@rollup/rollup-win32-x64-msvc": "4.18.0",
- "fsevents": "~2.3.2"
- }
- },
- "node_modules/seedrandom": {
- "version": "3.0.5",
- "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz",
- "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg=="
- },
- "node_modules/source-map-js": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz",
- "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
- "dev": true,
- "license": "BSD-3-Clause",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/style-mod": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.0.tgz",
- "integrity": "sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA=="
- },
- "node_modules/tiny-emitter": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
- "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
- },
- "node_modules/typed-function": {
- "version": "4.2.1",
- "resolved": "https://registry.npmjs.org/typed-function/-/typed-function-4.2.1.tgz",
- "integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==",
- "license": "MIT",
- "engines": {
- "node": ">= 18"
- }
- },
- "node_modules/vite": {
- "version": "5.3.3",
- "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.3.tgz",
- "integrity": "sha512-NPQdeCU0Dv2z5fu+ULotpuq5yfCS1BzKUIPhNbP3YBfAMGJXbt2nS+sbTFu+qchaqWTD+H3JK++nRwr6XIcp6A==",
- "dev": true,
- "license": "MIT",
- "dependencies": {
- "esbuild": "^0.21.3",
- "postcss": "^8.4.39",
- "rollup": "^4.13.0"
- },
- "bin": {
- "vite": "bin/vite.js"
- },
- "engines": {
- "node": "^18.0.0 || >=20.0.0"
- },
- "funding": {
- "url": "https://github.com/vitejs/vite?sponsor=1"
- },
- "optionalDependencies": {
- "fsevents": "~2.3.3"
- },
- "peerDependencies": {
- "@types/node": "^18.0.0 || >=20.0.0",
- "less": "*",
- "lightningcss": "^1.21.0",
- "sass": "*",
- "stylus": "*",
- "sugarss": "*",
- "terser": "^5.4.0"
- },
- "peerDependenciesMeta": {
- "@types/node": {
- "optional": true
- },
- "less": {
- "optional": true
- },
- "lightningcss": {
- "optional": true
- },
- "sass": {
- "optional": true
- },
- "stylus": {
- "optional": true
- },
- "sugarss": {
- "optional": true
- },
- "terser": {
- "optional": true
- }
- }
- },
- "node_modules/w3c-keyname": {
- "version": "2.2.8",
- "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
- "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="
- }
- }
-}
diff --git a/examples/code editor/package.json b/examples/code editor/package.json
deleted file mode 100644
index 6a732ec62d..0000000000
--- a/examples/code editor/package.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "name": "code-editor",
- "private": true,
- "version": "1.0.0",
- "type": "module",
- "scripts": {
- "dev": "vite",
- "build": "vite build",
- "preview": "vite preview"
- },
- "devDependencies": {
- "vite": "5.3.3"
- },
- "dependencies": {
- "@codemirror/language": "6.10.2",
- "@codemirror/state": "6.4.1",
- "codemirror": "6.0.1",
- "github-markdown-css": "5.6.1",
- "katex": "0.16.11",
- "mathjs": "13.0.2"
- }
-}
diff --git a/examples/code editor/style.css b/examples/code editor/style.css
deleted file mode 100644
index bc4a5d2dbf..0000000000
--- a/examples/code editor/style.css
+++ /dev/null
@@ -1,60 +0,0 @@
-html,
-body {
- margin: 0;
- padding: 0;
- height: 100vh;
- overflow: hidden;
-}
-
-body {
- display: flex;
- flex-direction: column;
-}
-
-#app {
- display: flex;
- overflow: hidden;
- flex: 1;
- flex-direction: row;
-}
-
-#editor {
- flex: 1;
- height: auto;
- display: flex;
- overflow: auto;
-}
-
-#editor>.cm-editor {
- flex: 1;
- overflow: scroll;
-}
-
-#app>article {
- flex: 1;
- overflow: auto;
- box-sizing: border-box;
-}
-
-article.markdown-body .results {
- padding: 0.5em;
- margin: 0.5em;
-}
-
-article.markdown-body > .highlighted {
- background-color: rgba(0, 150, 255, 0.2);
-}
-
-article.markdown-body {
- box-sizing: border-box;
- min-width: 200px;
- max-width: 980px;
- margin: 0 auto;
- padding: 1em;
-}
-
-@media (max-width: 767px) {
- .markdown-body {
- padding: 15px;
- }
-}
\ No newline at end of file
diff --git a/examples/complex_numbers.js b/examples/complex_numbers.js
deleted file mode 100644
index 0d44041548..0000000000
--- a/examples/complex_numbers.js
+++ /dev/null
@@ -1,65 +0,0 @@
-// complex numbers
-import { complex, add, multiply, sin, sqrt, pi, equal, sort, format } from 'mathjs'
-
-// create a complex number with a numeric real and complex part
-console.log('create and manipulate complex numbers')
-const a = complex(2, 3)
-print(a) // 2 + 3i
-
-// read the real and complex parts of the complex number
-print(a.re) // 2
-print(a.im) // 3
-
-// clone a complex value
-const clone = a.clone()
-print(clone) // 2 + 3i
-
-// adjust the complex value
-a.re = 5
-print(a) // 5 + 3i
-
-// create a complex number by providing a string with real and complex parts
-const b = complex('3-7i')
-print(b) // 3 - 7i
-console.log()
-
-// perform operations with complex numbers
-console.log('perform operations')
-print(add(a, b)) // 8 - 4i
-print(multiply(a, b)) // 36 - 26i
-print(sin(a)) // -9.6541254768548 + 2.8416922956064i
-
-// some operations will return a complex number depending on the arguments
-print(sqrt(4)) // 2
-print(sqrt(-4)) // 2i
-console.log()
-
-// create a complex number from polar coordinates
-console.log('create complex numbers with polar coordinates')
-const c = complex({ r: sqrt(2), phi: pi / 4 })
-print(c) // 1 + i
-
-// get polar coordinates of a complex number
-const d = complex(3, 4)
-console.log(d.abs(), d.arg()) // radius = 5, phi = 0.9272952180016122
-console.log()
-
-// comparision operations
-// note that there is no mathematical ordering defined for complex numbers
-// we can only check equality. To sort a list with complex numbers,
-// the natural sorting can be used
-console.log('\ncomparision and sorting operations')
-console.log('equal', equal(a, b)) // returns false
-const values = [a, b, c]
-console.log('values:', format(values, 14)) // [5 + 3i, 3 - 7i, 1 + i]
-sort(values, 'natural')
-console.log('sorted:', format(values, 14)) // [1 + i, 3 - 7i, 5 + 3i]
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
diff --git a/examples/complex_numbers.js.md b/examples/complex_numbers.js.md
deleted file mode 100644
index df7de481ae..0000000000
--- a/examples/complex_numbers.js.md
+++ /dev/null
@@ -1,79 +0,0 @@
----
-layout: default
----
-
-# Complex numbers
-
-File: [complex_numbers.js](complex_numbers.js)
-
-```js
-// complex numbers
-import { complex, add, multiply, sin, sqrt, pi, equal, sort, format } from 'mathjs'
-
-// create a complex number with a numeric real and complex part
-console.log('create and manipulate complex numbers')
-const a = complex(2, 3)
-print(a) // 2 + 3i
-
-// read the real and complex parts of the complex number
-print(a.re) // 2
-print(a.im) // 3
-
-// clone a complex value
-const clone = a.clone()
-print(clone) // 2 + 3i
-
-// adjust the complex value
-a.re = 5
-print(a) // 5 + 3i
-
-// create a complex number by providing a string with real and complex parts
-const b = complex('3-7i')
-print(b) // 3 - 7i
-console.log()
-
-// perform operations with complex numbers
-console.log('perform operations')
-print(add(a, b)) // 8 - 4i
-print(multiply(a, b)) // 36 - 26i
-print(sin(a)) // -9.6541254768548 + 2.8416922956064i
-
-// some operations will return a complex number depending on the arguments
-print(sqrt(4)) // 2
-print(sqrt(-4)) // 2i
-console.log()
-
-// create a complex number from polar coordinates
-console.log('create complex numbers with polar coordinates')
-const c = complex({ r: sqrt(2), phi: pi / 4 })
-print(c) // 1 + i
-
-// get polar coordinates of a complex number
-const d = complex(3, 4)
-console.log(d.abs(), d.arg()) // radius = 5, phi = 0.9272952180016122
-console.log()
-
-// comparision operations
-// note that there is no mathematical ordering defined for complex numbers
-// we can only check equality. To sort a list with complex numbers,
-// the natural sorting can be used
-console.log('\ncomparision and sorting operations')
-console.log('equal', equal(a, b)) // returns false
-const values = [a, b, c]
-console.log('values:', format(values, 14)) // [5 + 3i, 3 - 7i, 1 + i]
-sort(values, 'natural')
-console.log('sorted:', format(values, 14)) // [1 + i, 3 - 7i, 5 + 3i]
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
-
-```
-
-
-
diff --git a/examples/expressions.js b/examples/expressions.js
deleted file mode 100644
index 68067d4281..0000000000
--- a/examples/expressions.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * Expressions can be evaluated in various ways:
- *
- * 1. using the function evaluate
- * 2. using the function parse
- * 3. using a parser. A parser contains functions evaluate and parse,
- * and keeps a scope with assigned variables in memory
- */
-import { compile, evaluate, format, parse, parser } from 'mathjs'
-
-// 1. using the function evaluate
-//
-// Function `evaluate` accepts a single expression or an array with
-// expressions as first argument, and has an optional second argument
-// containing a scope with variables and functions. The scope is a regular
-// JavaScript Object. The scope will be used to resolve symbols, and to write
-// assigned variables or function.
-console.log('1. USING FUNCTION MATH.EVAL')
-
-// evaluate expressions
-console.log('\nevaluate expressions')
-print(evaluate('sqrt(3^2 + 4^2)')) // 5
-print(evaluate('sqrt(-4)')) // 2i
-print(evaluate('2 inch to cm')) // 5.08 cm
-print(evaluate('cos(45 deg)')) // 0.70711
-
-// evaluate multiple expressions at once
-console.log('\nevaluate multiple expressions at once')
-print(evaluate([
- 'f = 3',
- 'g = 4',
- 'f * g'
-])) // [3, 4, 12]
-
-// provide a scope (just a regular JavaScript Object)
-console.log('\nevaluate expressions providing a scope with variables and functions')
-const scope = {
- a: 3,
- b: 4
-}
-
-// variables can be read from the scope
-print(evaluate('a * b', scope)) // 12
-
-// variable assignments are written to the scope
-print(evaluate('c = 2.3 + 4.5', scope)) // 6.8
-print(scope.c) // 6.8
-
-// scope can contain both variables and functions
-scope.hello = function (name) {
- return 'hello, ' + name + '!'
-}
-print(evaluate('hello("hero")', scope)) // "hello, hero!"
-
-// define a function as an expression
-const f = evaluate('f(x) = x ^ a', scope)
-print(f(2)) // 8
-print(scope.f(2)) // 8
-
-// 2. using function parse
-//
-// Function `parse` parses expressions into a node tree. The syntax is
-// similar to function `evaluate`.
-// Function `parse` accepts a single expression or an array with
-// expressions as first argument. The function returns a node tree, which
-// then can be compiled against math, and then evaluated against an (optional
-// scope. This scope is a regular JavaScript Object. The scope will be used
-// to resolve symbols, and to write assigned variables or function.
-console.log('\n2. USING FUNCTION MATH.PARSE')
-
-// parse an expression
-console.log('\nparse an expression into a node tree')
-const node1 = parse('sqrt(3^2 + 4^2)')
-print(node1.toString()) // "sqrt((3 ^ 2) + (4 ^ 2))"
-
-// compile and evaluate the compiled code
-// you could also do this in two steps: node1.compile().evaluate()
-print(node1.evaluate()) // 5
-
-// provide a scope
-console.log('\nprovide a scope')
-const node2 = parse('x^a')
-const code2 = node2.compile()
-print(node2.toString()) // "x ^ a"
-const scope2 = {
- x: 3,
- a: 2
-}
-print(code2.evaluate(scope2)) // 9
-
-// change a value in the scope and re-evaluate the node
-scope2.a = 3
-print(code2.evaluate(scope2)) // 27
-
-// 3. using function compile
-//
-// Function `compile` compiles expressions into a node tree. The syntax is
-// similar to function `evaluate`.
-// Function `compile` accepts a single expression or an array with
-// expressions as first argument, and returns an object with a function evaluate
-// to evaluate the compiled expression. On evaluation, an optional scope can
-// be provided. This scope will be used to resolve symbols, and to write
-// assigned variables or function.
-console.log('\n3. USING FUNCTION MATH.COMPILE')
-
-// parse an expression
-console.log('\ncompile an expression')
-const code3 = compile('sqrt(3^2 + 4^2)')
-
-// evaluate the compiled code
-print(code3.evaluate()) // 5
-
-// provide a scope for the variable assignment
-console.log('\nprovide a scope')
-const code4 = compile('a = a + 3')
-const scope3 = {
- a: 7
-}
-code4.evaluate(scope3)
-print(scope3.a) // 10
-
-// 4. using a parser
-//
-// In addition to the static functions `evaluate` and `parse`, js
-// contains a parser with functions `evaluate` and `parse`, which automatically
-// keeps a scope with assigned variables in memory. The parser also contains
-// some convenience methods to get, set, and remove variables from memory.
-console.log('\n4. USING A PARSER')
-const myParser = parser()
-
-// evaluate with parser
-console.log('\nevaluate expressions')
-print(myParser.evaluate('sqrt(3^2 + 4^2)')) // 5
-print(myParser.evaluate('sqrt(-4)')) // 2i
-print(myParser.evaluate('2 inch to cm')) // 5.08 cm
-print(myParser.evaluate('cos(45 deg)')) // 0.70710678118655
-
-// define variables and functions
-console.log('\ndefine variables and functions')
-print(myParser.evaluate('x = 7 / 2')) // 3.5
-print(myParser.evaluate('x + 3')) // 6.5
-print(myParser.evaluate('f2(x, y) = x^y')) // f2(x, y)
-print(myParser.evaluate('f2(2, 3)')) // 8
-
-// manipulate matrices
-// Note that matrix indexes in the expression parser are one-based with the
-// upper-bound included. On a JavaScript level however, js uses zero-based
-// indexes with an excluded upper-bound.
-console.log('\nmanipulate matrices')
-print(myParser.evaluate('k = [1, 2; 3, 4]')) // [[1, 2], [3, 4]]
-print(myParser.evaluate('l = zeros(2, 2)')) // [[0, 0], [0, 0]]
-print(myParser.evaluate('l[1, 1:2] = [5, 6]')) // [5, 6]
-print(myParser.evaluate('l')) // [[5, 6], [0, 0]]
-print(myParser.evaluate('l[2, :] = [7, 8]')) // [7, 8]
-print(myParser.evaluate('l')) // [[5, 6], [7, 8]]
-print(myParser.evaluate('m = k * l')) // [[19, 22], [43, 50]]
-print(myParser.evaluate('n = m[2, 1]')) // 43
-print(myParser.evaluate('n = m[:, 1]')) // [[19], [43]]
-
-// get and set variables and functions
-console.log('\nget and set variables and function in the scope of the parser')
-const x = myParser.get('x')
-console.log('x =', x) // x = 3.5
-const f2 = myParser.get('f2')
-console.log('f2 =', format(f2)) // f2 = f2(x, y)
-const h = f2(3, 3)
-console.log('h =', h) // h = 27
-
-myParser.set('i', 500)
-print(myParser.evaluate('i / 2')) // 250
-myParser.set('hello', function (name) {
- return 'hello, ' + name + '!'
-})
-print(myParser.evaluate('hello("hero")')) // "hello, hero!"
-
-// clear defined functions and variables
-myParser.clear()
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
diff --git a/examples/expressions.js.md b/examples/expressions.js.md
deleted file mode 100644
index d123e776ab..0000000000
--- a/examples/expressions.js.md
+++ /dev/null
@@ -1,200 +0,0 @@
----
-layout: default
----
-
-# Expressions
-
-File: [expressions.js](expressions.js)
-
-```js
-/**
- * Expressions can be evaluated in various ways:
- *
- * 1. using the function evaluate
- * 2. using the function parse
- * 3. using a parser. A parser contains functions evaluate and parse,
- * and keeps a scope with assigned variables in memory
- */
-import { compile, evaluate, format, parse, parser } from 'mathjs'
-
-// 1. using the function evaluate
-//
-// Function `evaluate` accepts a single expression or an array with
-// expressions as first argument, and has an optional second argument
-// containing a scope with variables and functions. The scope is a regular
-// JavaScript Object. The scope will be used to resolve symbols, and to write
-// assigned variables or function.
-console.log('1. USING FUNCTION MATH.EVAL')
-
-// evaluate expressions
-console.log('\nevaluate expressions')
-print(evaluate('sqrt(3^2 + 4^2)')) // 5
-print(evaluate('sqrt(-4)')) // 2i
-print(evaluate('2 inch to cm')) // 5.08 cm
-print(evaluate('cos(45 deg)')) // 0.70711
-
-// evaluate multiple expressions at once
-console.log('\nevaluate multiple expressions at once')
-print(evaluate([
- 'f = 3',
- 'g = 4',
- 'f * g'
-])) // [3, 4, 12]
-
-// provide a scope (just a regular JavaScript Object)
-console.log('\nevaluate expressions providing a scope with variables and functions')
-const scope = {
- a: 3,
- b: 4
-}
-
-// variables can be read from the scope
-print(evaluate('a * b', scope)) // 12
-
-// variable assignments are written to the scope
-print(evaluate('c = 2.3 + 4.5', scope)) // 6.8
-print(scope.c) // 6.8
-
-// scope can contain both variables and functions
-scope.hello = function (name) {
- return 'hello, ' + name + '!'
-}
-print(evaluate('hello("hero")', scope)) // "hello, hero!"
-
-// define a function as an expression
-const f = evaluate('f(x) = x ^ a', scope)
-print(f(2)) // 8
-print(scope.f(2)) // 8
-
-// 2. using function parse
-//
-// Function `parse` parses expressions into a node tree. The syntax is
-// similar to function `evaluate`.
-// Function `parse` accepts a single expression or an array with
-// expressions as first argument. The function returns a node tree, which
-// then can be compiled against math, and then evaluated against an (optional
-// scope. This scope is a regular JavaScript Object. The scope will be used
-// to resolve symbols, and to write assigned variables or function.
-console.log('\n2. USING FUNCTION MATH.PARSE')
-
-// parse an expression
-console.log('\nparse an expression into a node tree')
-const node1 = parse('sqrt(3^2 + 4^2)')
-print(node1.toString()) // "sqrt((3 ^ 2) + (4 ^ 2))"
-
-// compile and evaluate the compiled code
-// you could also do this in two steps: node1.compile().evaluate()
-print(node1.evaluate()) // 5
-
-// provide a scope
-console.log('\nprovide a scope')
-const node2 = parse('x^a')
-const code2 = node2.compile()
-print(node2.toString()) // "x ^ a"
-const scope2 = {
- x: 3,
- a: 2
-}
-print(code2.evaluate(scope2)) // 9
-
-// change a value in the scope and re-evaluate the node
-scope2.a = 3
-print(code2.evaluate(scope2)) // 27
-
-// 3. using function compile
-//
-// Function `compile` compiles expressions into a node tree. The syntax is
-// similar to function `evaluate`.
-// Function `compile` accepts a single expression or an array with
-// expressions as first argument, and returns an object with a function evaluate
-// to evaluate the compiled expression. On evaluation, an optional scope can
-// be provided. This scope will be used to resolve symbols, and to write
-// assigned variables or function.
-console.log('\n3. USING FUNCTION MATH.COMPILE')
-
-// parse an expression
-console.log('\ncompile an expression')
-const code3 = compile('sqrt(3^2 + 4^2)')
-
-// evaluate the compiled code
-print(code3.evaluate()) // 5
-
-// provide a scope for the variable assignment
-console.log('\nprovide a scope')
-const code4 = compile('a = a + 3')
-const scope3 = {
- a: 7
-}
-code4.evaluate(scope3)
-print(scope3.a) // 10
-
-// 4. using a parser
-//
-// In addition to the static functions `evaluate` and `parse`, js
-// contains a parser with functions `evaluate` and `parse`, which automatically
-// keeps a scope with assigned variables in memory. The parser also contains
-// some convenience methods to get, set, and remove variables from memory.
-console.log('\n4. USING A PARSER')
-const myParser = parser()
-
-// evaluate with parser
-console.log('\nevaluate expressions')
-print(myParser.evaluate('sqrt(3^2 + 4^2)')) // 5
-print(myParser.evaluate('sqrt(-4)')) // 2i
-print(myParser.evaluate('2 inch to cm')) // 5.08 cm
-print(myParser.evaluate('cos(45 deg)')) // 0.70710678118655
-
-// define variables and functions
-console.log('\ndefine variables and functions')
-print(myParser.evaluate('x = 7 / 2')) // 3.5
-print(myParser.evaluate('x + 3')) // 6.5
-print(myParser.evaluate('f2(x, y) = x^y')) // f2(x, y)
-print(myParser.evaluate('f2(2, 3)')) // 8
-
-// manipulate matrices
-// Note that matrix indexes in the expression parser are one-based with the
-// upper-bound included. On a JavaScript level however, js uses zero-based
-// indexes with an excluded upper-bound.
-console.log('\nmanipulate matrices')
-print(myParser.evaluate('k = [1, 2; 3, 4]')) // [[1, 2], [3, 4]]
-print(myParser.evaluate('l = zeros(2, 2)')) // [[0, 0], [0, 0]]
-print(myParser.evaluate('l[1, 1:2] = [5, 6]')) // [5, 6]
-print(myParser.evaluate('l')) // [[5, 6], [0, 0]]
-print(myParser.evaluate('l[2, :] = [7, 8]')) // [7, 8]
-print(myParser.evaluate('l')) // [[5, 6], [7, 8]]
-print(myParser.evaluate('m = k * l')) // [[19, 22], [43, 50]]
-print(myParser.evaluate('n = m[2, 1]')) // 43
-print(myParser.evaluate('n = m[:, 1]')) // [[19], [43]]
-
-// get and set variables and functions
-console.log('\nget and set variables and function in the scope of the parser')
-const x = myParser.get('x')
-console.log('x =', x) // x = 3.5
-const f2 = myParser.get('f2')
-console.log('f2 =', format(f2)) // f2 = f2(x, y)
-const h = f2(3, 3)
-console.log('h =', h) // h = 27
-
-myParser.set('i', 500)
-print(myParser.evaluate('i / 2')) // 250
-myParser.set('hello', function (name) {
- return 'hello, ' + name + '!'
-})
-print(myParser.evaluate('hello("hero")')) // "hello, hero!"
-
-// clear defined functions and variables
-myParser.clear()
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
-
-```
-
-
-
diff --git a/examples/fractions.js b/examples/fractions.js
deleted file mode 100644
index d1239b0fdd..0000000000
--- a/examples/fractions.js
+++ /dev/null
@@ -1,72 +0,0 @@
-// Fractions
-import { create, all } from 'mathjs'
-
-// configure the default type of numbers as Fractions
-const config = {
- // Default type of number
- // Available options: 'number' (default), 'BigNumber', or 'Fraction'
- number: 'Fraction'
-}
-
-// create a mathjs instance with everything included
-const math = create(all, config)
-
-console.log('basic usage')
-printRatio(math.fraction(0.125)) // Fraction, 1/8
-printRatio(math.fraction(0.32)) // Fraction, 8/25
-printRatio(math.fraction('1/3')) // Fraction, 1/3
-printRatio(math.fraction('0.(3)')) // Fraction, 1/3
-printRatio(math.fraction(2, 3)) // Fraction, 2/3
-printRatio(math.fraction('0.(285714)')) // Fraction, 2/7
-console.log()
-
-console.log('round-off errors with numbers')
-print(math.add(0.1, 0.2)) // number, 0.30000000000000004
-print(math.divide(0.3, 0.2)) // number, 1.4999999999999998
-console.log()
-
-console.log('no round-off errors with fractions :)')
-print(math.add(math.fraction(0.1), math.fraction(0.2))) // Fraction, 0.3
-print(math.divide(math.fraction(0.3), math.fraction(0.2))) // Fraction, 1.5
-console.log()
-
-console.log('represent an infinite number of repeating digits')
-print(math.fraction('1/3')) // Fraction, 0.(3)
-print(math.fraction('2/7')) // Fraction, 0.(285714)
-print(math.fraction('23/11')) // Fraction, 2.(09)
-console.log()
-
-// one can work conveniently with fractions using the expression parser.
-// note though that Fractions are only supported by basic arithmetic functions
-console.log('use fractions in the expression parser')
-printRatio(math.evaluate('0.1 + 0.2')) // Fraction, 3/10
-printRatio(math.evaluate('0.3 / 0.2')) // Fraction, 3/2
-printRatio(math.evaluate('23 / 11')) // Fraction, 23/11
-console.log()
-
-// output formatting
-console.log('output formatting of fractions')
-const a = math.fraction('2/3')
-console.log(math.format(a)) // Fraction, 2/3
-console.log(math.format(a, { fraction: 'ratio' })) // Fraction, 2/3
-console.log(math.format(a, { fraction: 'decimal' })) // Fraction, 0.(6)
-console.log(a.toString()) // Fraction, 0.(6)
-console.log()
-
-/**
- * Helper function to output a value in the console.
- * Fractions will be formatted as ratio, like '1/3'.
- * @param {*} value
- */
-function printRatio (value) {
- console.log(math.format(value, { fraction: 'ratio' }))
-}
-
-/**
- * Helper function to output a value in the console.
- * Fractions will be formatted as decimal, like '0.(3)'.
- * @param {*} value
- */
-function print (value) {
- console.log(math.format(value, { fraction: 'decimal' }))
-}
diff --git a/examples/fractions.js.md b/examples/fractions.js.md
deleted file mode 100644
index 536383b97f..0000000000
--- a/examples/fractions.js.md
+++ /dev/null
@@ -1,86 +0,0 @@
----
-layout: default
----
-
-# Fractions
-
-File: [fractions.js](fractions.js)
-
-```js
-// Fractions
-import { create, all } from 'mathjs'
-
-// configure the default type of numbers as Fractions
-const config = {
- // Default type of number
- // Available options: 'number' (default), 'BigNumber', or 'Fraction'
- number: 'Fraction'
-}
-
-// create a mathjs instance with everything included
-const math = create(all, config)
-
-console.log('basic usage')
-printRatio(math.fraction(0.125)) // Fraction, 1/8
-printRatio(math.fraction(0.32)) // Fraction, 8/25
-printRatio(math.fraction('1/3')) // Fraction, 1/3
-printRatio(math.fraction('0.(3)')) // Fraction, 1/3
-printRatio(math.fraction(2, 3)) // Fraction, 2/3
-printRatio(math.fraction('0.(285714)')) // Fraction, 2/7
-console.log()
-
-console.log('round-off errors with numbers')
-print(math.add(0.1, 0.2)) // number, 0.30000000000000004
-print(math.divide(0.3, 0.2)) // number, 1.4999999999999998
-console.log()
-
-console.log('no round-off errors with fractions :)')
-print(math.add(math.fraction(0.1), math.fraction(0.2))) // Fraction, 0.3
-print(math.divide(math.fraction(0.3), math.fraction(0.2))) // Fraction, 1.5
-console.log()
-
-console.log('represent an infinite number of repeating digits')
-print(math.fraction('1/3')) // Fraction, 0.(3)
-print(math.fraction('2/7')) // Fraction, 0.(285714)
-print(math.fraction('23/11')) // Fraction, 2.(09)
-console.log()
-
-// one can work conveniently with fractions using the expression parser.
-// note though that Fractions are only supported by basic arithmetic functions
-console.log('use fractions in the expression parser')
-printRatio(math.evaluate('0.1 + 0.2')) // Fraction, 3/10
-printRatio(math.evaluate('0.3 / 0.2')) // Fraction, 3/2
-printRatio(math.evaluate('23 / 11')) // Fraction, 23/11
-console.log()
-
-// output formatting
-console.log('output formatting of fractions')
-const a = math.fraction('2/3')
-console.log(math.format(a)) // Fraction, 2/3
-console.log(math.format(a, { fraction: 'ratio' })) // Fraction, 2/3
-console.log(math.format(a, { fraction: 'decimal' })) // Fraction, 0.(6)
-console.log(a.toString()) // Fraction, 0.(6)
-console.log()
-
-/**
- * Helper function to output a value in the console.
- * Fractions will be formatted as ratio, like '1/3'.
- * @param {*} value
- */
-function printRatio (value) {
- console.log(math.format(value, { fraction: 'ratio' }))
-}
-
-/**
- * Helper function to output a value in the console.
- * Fractions will be formatted as decimal, like '0.(3)'.
- * @param {*} value
- */
-function print (value) {
- console.log(math.format(value, { fraction: 'decimal' }))
-}
-
-```
-
-
-
diff --git a/examples/import.js b/examples/import.js
deleted file mode 100644
index 0b941d3dc7..0000000000
--- a/examples/import.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Math.js can easily be extended with functions and variables using the
- * `import` function. The function `import` accepts a module name or an object
- * containing functions and variables.
- */
-import { create, all } from 'mathjs'
-const math = create(all)
-
-/**
- * Define new functions and variables
- */
-math.import({
- myConstant: 42,
- hello: function (name) {
- return 'hello, ' + name + '!'
- }
-})
-
-// defined methods can be used in both JavaScript as well as the parser
-print(math.myConstant * 2) // 84
-print(math.hello('user')) // 'hello, user!'
-
-print(math.evaluate('myConstant + 10')) // 52
-print(math.evaluate('hello("user")')) // 'hello, user!'
-
-/**
- * Import the math library numbers.js, https://github.com/sjkaliski/numbers.js
- * The library must be installed first using npm:
- * npm install numbers
- */
-try {
- // load the numbers.js library
- const numbers = require('numbers')
-
- // import the numbers.js library into math.js
- math.import(numbers, { wrap: true, silent: true })
-
- if (math.fibonacci) {
- // calculate fibonacci
- print(math.fibonacci(7)) // 13
- print(math.evaluate('fibonacci(7)')) // 13
- }
-} catch (err) {
- console.log('Warning: To use numbers.js, the library must ' +
- 'be installed first via `npm install numbers`.')
-}
-
-/**
- * Import the math library numeric.js, https://github.com/sloisel/numeric
- * The library must be installed first using npm:
- * npm install numeric
- */
-try {
- // load the numeric.js library
- const numeric = require('numeric')
-
- // import the numeric.js library into math.js
- math.import(numeric, { wrap: true, silent: true })
-
- if (math.eig) {
- // calculate eigenvalues of a matrix
- print(math.evaluate('eig([1, 2; 4, 3])').lambda.x) // [5, -1]
-
- // solve AX = b
- const A = math.evaluate('[1, 2, 3; 2, -1, 1; 3, 0, -1]')
- const b = [9, 8, 3]
- print(math.solve(A, b)) // [2, -1, 3]
- }
-} catch (err) {
- console.log('Warning: To use numeric.js, the library must ' +
- 'be installed first via `npm install numeric`.')
-}
-
-/**
- * By default, the function import does not allow overriding existing functions.
- * Existing functions can be overridden by specifying option `override: true`
- */
-math.import({
- pi: 3.14
-}, {
- override: true
-})
-
-print(math.pi) // returns 3.14 instead of 3.141592653589793
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(math.format(value, precision))
-}
diff --git a/examples/import.js.md b/examples/import.js.md
deleted file mode 100644
index 7a1a0e218a..0000000000
--- a/examples/import.js.md
+++ /dev/null
@@ -1,107 +0,0 @@
----
-layout: default
----
-
-# Import
-
-File: [import.js](import.js)
-
-```js
-/**
- * Math.js can easily be extended with functions and variables using the
- * `import` function. The function `import` accepts a module name or an object
- * containing functions and variables.
- */
-import { create, all } from 'mathjs'
-const math = create(all)
-
-/**
- * Define new functions and variables
- */
-math.import({
- myConstant: 42,
- hello: function (name) {
- return 'hello, ' + name + '!'
- }
-})
-
-// defined methods can be used in both JavaScript as well as the parser
-print(math.myConstant * 2) // 84
-print(math.hello('user')) // 'hello, user!'
-
-print(math.evaluate('myConstant + 10')) // 52
-print(math.evaluate('hello("user")')) // 'hello, user!'
-
-/**
- * Import the math library numbers.js, https://github.com/sjkaliski/numbers.js
- * The library must be installed first using npm:
- * npm install numbers
- */
-try {
- // load the numbers.js library
- const numbers = require('numbers')
-
- // import the numbers.js library into math.js
- math.import(numbers, { wrap: true, silent: true })
-
- if (math.fibonacci) {
- // calculate fibonacci
- print(math.fibonacci(7)) // 13
- print(math.evaluate('fibonacci(7)')) // 13
- }
-} catch (err) {
- console.log('Warning: To use numbers.js, the library must ' +
- 'be installed first via `npm install numbers`.')
-}
-
-/**
- * Import the math library numeric.js, https://github.com/sloisel/numeric
- * The library must be installed first using npm:
- * npm install numeric
- */
-try {
- // load the numeric.js library
- const numeric = require('numeric')
-
- // import the numeric.js library into math.js
- math.import(numeric, { wrap: true, silent: true })
-
- if (math.eig) {
- // calculate eigenvalues of a matrix
- print(math.evaluate('eig([1, 2; 4, 3])').lambda.x) // [5, -1]
-
- // solve AX = b
- const A = math.evaluate('[1, 2, 3; 2, -1, 1; 3, 0, -1]')
- const b = [9, 8, 3]
- print(math.solve(A, b)) // [2, -1, 3]
- }
-} catch (err) {
- console.log('Warning: To use numeric.js, the library must ' +
- 'be installed first via `npm install numeric`.')
-}
-
-/**
- * By default, the function import does not allow overriding existing functions.
- * Existing functions can be overridden by specifying option `override: true`
- */
-math.import({
- pi: 3.14
-}, {
- override: true
-})
-
-print(math.pi) // returns 3.14 instead of 3.141592653589793
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(math.format(value, precision))
-}
-
-```
-
-
-
diff --git a/examples/index.md b/examples/index.md
deleted file mode 100644
index b20393389b..0000000000
--- a/examples/index.md
+++ /dev/null
@@ -1,52 +0,0 @@
----
-layout: default
----
-
-# Examples
-
-- [Algebra](algebra.js.html)
-- [Basic usage](basic_usage.js.html)
-- [Bignumbers](bignumbers.js.html)
-- [Chaining](chaining.js.html)
-- [Complex numbers](complex_numbers.js.html)
-- [Expressions](expressions.js.html)
-- [Fractions](fractions.js.html)
-- [Import](import.js.html)
-- [Matrices](matrices.js.html)
-- [Objects](objects.js.html)
-- [Serialization](serialization.js.html)
-- [Sparse matrices](sparse_matrices.js.html)
-- [Units](units.js.html)
-
-# Browser examples
-
-- [Angle configuration](browser\angle_configuration.html.html)
-- [Basic usage](browser\basic_usage.html.html)
-- [Currency conversion](browser\currency_conversion.html.html)
-- [Custom separators](browser\custom_separators.html.html)
-- [Lorenz](browser\lorenz.html.html)
-- [Lorenz interactive](browser\lorenz_interactive.html.html)
-- [Plot](browser\plot.html.html)
-- [Pretty printing with mathjax](browser\pretty_printing_with_mathjax.html.html)
-- [Printing html](browser\printing_html.html.html)
-- [Requirejs loading](browser\requirejs_loading.html.html)
-- [Rocket trajectory optimization](browser\rocket_trajectory_optimization.html.html)
-- [Webworkers](browser\webworkers\index.html)
-
-# Advanced examples
-
-- [Convert fraction to bignumber](advanced\convert_fraction_to_bignumber.js.html)
-- [Custom argument parsing](advanced\custom_argument_parsing.js.html)
-- [Custom datatype](advanced\custom_datatype.js.html)
-- [Custom evaluate using factories](advanced\custom_evaluate_using_factories.js.html)
-- [Custom evaluate using import](advanced\custom_evaluate_using_import.js.html)
-- [Custom loading](advanced\custom_loading.js.html)
-- [Custom relational functions](advanced\custom_relational_functions.js.html)
-- [Custom scope objects](advanced\custom_scope_objects.js.html)
-- [Expression trees](advanced\expression_trees.js.html)
-- [Function transform](advanced\function_transform.js.html)
-- [More secure eval](advanced\more_secure_eval.js.html)
-- [Web server](advanced\web_server\index.html)
-
-
-
diff --git a/examples/matrices.js b/examples/matrices.js
deleted file mode 100644
index 760a553743..0000000000
--- a/examples/matrices.js
+++ /dev/null
@@ -1,109 +0,0 @@
-// matrices
-import { diag, factorial, format, index, map, matrix, multiply, ones, range, sqrt } from 'mathjs'
-
-// create matrices and arrays. a matrix is just a wrapper around an Array,
-// providing some handy utilities.
-console.log('create a matrix')
-const a = matrix([1, 4, 9, 16, 25])
-print(a) // [1, 4, 9, 16, 25]
-const b = matrix(ones([2, 3]))
-print(b) // [[1, 1, 1], [1, 1, 1]]
-print(b.size()) // [2, 3]
-
-// the Array data of a Matrix can be retrieved using valueOf()
-const array = a.valueOf()
-print(array) // [1, 4, 9, 16, 25]
-
-// Matrices can be cloned
-const clone = a.clone()
-print(clone) // [1, 4, 9, 16, 25]
-console.log()
-
-// perform operations with matrices
-console.log('perform operations')
-print(map(a, sqrt)) // [1, 2, 3, 4, 5]
-const c = [1, 2, 3, 4, 5]
-print(factorial(c)) // [1, 2, 6, 24, 120]
-console.log()
-
-// create and manipulate matrices. Arrays and Matrices can be used mixed.
-console.log('manipulate matrices')
-const d = [[1, 2], [3, 4]]
-print(d) // [[1, 2], [3, 4]]
-const e = matrix([[5, 6], [1, 1]])
-print(e) // [[5, 6], [1, 1]]
-
-// set a submatrix
-// Matrix indexes are zero-based.
-e.subset(index(1, [0, 1]), [[7, 8]])
-print(e) // [[5, 6], [7, 8]]
-const f = multiply(d, e)
-print(f) // [[19, 22], [43, 50]]
-const g = f.subset(index(1, 0))
-print(g) // 43
-console.log()
-
-// get a sub matrix
-// Matrix indexes are zero-based.
-console.log('get a sub matrix')
-const h = diag(range(1, 4))
-print(h) // [[1, 0, 0], [0, 2, 0], [0, 0, 3]]
-print(h.subset(index([1, 2], [1, 2]))) // [[2, 0], [0, 3]]
-const i = range(1, 6)
-print(i) // [1, 2, 3, 4, 5]
-print(i.subset(index(range(1, 4)))) // [2, 3, 4]
-console.log()
-
-// replace a single value in a matrix
-// this will mutate the matrix
-console.log('set and get a value')
-const p = matrix([[1, 2], [3, 4]])
-p.set([0, 1], 5)
-print(p) // [[1, 5], [3, 4]]
-const p21 = p.get([1, 0])
-print(p21) // 3
-console.log()
-
-// resize a multi dimensional matrix
-console.log('resizing a matrix')
-const j = matrix()
-let defaultValue = 0
-j.resize([2, 2, 2], defaultValue)
-print(j) // [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]
-print(j.size()) // [2, 2, 2]
-j.resize([2, 2])
-print(j) // [[0, 0], [0, 0]]
-print(j.size()) // [2, 2]
-console.log()
-
-// setting a value outside the matrices range will resize the matrix.
-// new elements will be initialized with zero.
-console.log('set a value outside a matrices range')
-const k = matrix()
-k.subset(index(2), 6)
-print(k) // [0, 0, 6]
-console.log()
-
-console.log('set a value outside a matrices range, setting other new entries to null')
-const m = matrix()
-defaultValue = null
-m.subset(index(2), 6, defaultValue)
-print(m) // [null, null, 6]
-console.log()
-
-// create ranges
-console.log('create ranges')
-print(range(1, 6)) // [1, 2, 3, 4, 5]
-print(range(0, 18, 3)) // [0, 3, 6, 9, 12, 15]
-print(range('2:-1:-3')) // [2, 1, 0, -1, -2]
-print(factorial(range('1:6'))) // [1, 2, 6, 24, 120]
-console.log()
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
diff --git a/examples/matrices.js.md b/examples/matrices.js.md
deleted file mode 100644
index 0ae1b0e72c..0000000000
--- a/examples/matrices.js.md
+++ /dev/null
@@ -1,123 +0,0 @@
----
-layout: default
----
-
-# Matrices
-
-File: [matrices.js](matrices.js)
-
-```js
-// matrices
-import { diag, factorial, format, index, map, matrix, multiply, ones, range, sqrt } from 'mathjs'
-
-// create matrices and arrays. a matrix is just a wrapper around an Array,
-// providing some handy utilities.
-console.log('create a matrix')
-const a = matrix([1, 4, 9, 16, 25])
-print(a) // [1, 4, 9, 16, 25]
-const b = matrix(ones([2, 3]))
-print(b) // [[1, 1, 1], [1, 1, 1]]
-print(b.size()) // [2, 3]
-
-// the Array data of a Matrix can be retrieved using valueOf()
-const array = a.valueOf()
-print(array) // [1, 4, 9, 16, 25]
-
-// Matrices can be cloned
-const clone = a.clone()
-print(clone) // [1, 4, 9, 16, 25]
-console.log()
-
-// perform operations with matrices
-console.log('perform operations')
-print(map(a, sqrt)) // [1, 2, 3, 4, 5]
-const c = [1, 2, 3, 4, 5]
-print(factorial(c)) // [1, 2, 6, 24, 120]
-console.log()
-
-// create and manipulate matrices. Arrays and Matrices can be used mixed.
-console.log('manipulate matrices')
-const d = [[1, 2], [3, 4]]
-print(d) // [[1, 2], [3, 4]]
-const e = matrix([[5, 6], [1, 1]])
-print(e) // [[5, 6], [1, 1]]
-
-// set a submatrix
-// Matrix indexes are zero-based.
-e.subset(index(1, [0, 1]), [[7, 8]])
-print(e) // [[5, 6], [7, 8]]
-const f = multiply(d, e)
-print(f) // [[19, 22], [43, 50]]
-const g = f.subset(index(1, 0))
-print(g) // 43
-console.log()
-
-// get a sub matrix
-// Matrix indexes are zero-based.
-console.log('get a sub matrix')
-const h = diag(range(1, 4))
-print(h) // [[1, 0, 0], [0, 2, 0], [0, 0, 3]]
-print(h.subset(index([1, 2], [1, 2]))) // [[2, 0], [0, 3]]
-const i = range(1, 6)
-print(i) // [1, 2, 3, 4, 5]
-print(i.subset(index(range(1, 4)))) // [2, 3, 4]
-console.log()
-
-// replace a single value in a matrix
-// this will mutate the matrix
-console.log('set and get a value')
-const p = matrix([[1, 2], [3, 4]])
-p.set([0, 1], 5)
-print(p) // [[1, 5], [3, 4]]
-const p21 = p.get([1, 0])
-print(p21) // 3
-console.log()
-
-// resize a multi dimensional matrix
-console.log('resizing a matrix')
-const j = matrix()
-let defaultValue = 0
-j.resize([2, 2, 2], defaultValue)
-print(j) // [[[0, 0], [0, 0]], [[0, 0], [0, 0]]]
-print(j.size()) // [2, 2, 2]
-j.resize([2, 2])
-print(j) // [[0, 0], [0, 0]]
-print(j.size()) // [2, 2]
-console.log()
-
-// setting a value outside the matrices range will resize the matrix.
-// new elements will be initialized with zero.
-console.log('set a value outside a matrices range')
-const k = matrix()
-k.subset(index(2), 6)
-print(k) // [0, 0, 6]
-console.log()
-
-console.log('set a value outside a matrices range, setting other new entries to null')
-const m = matrix()
-defaultValue = null
-m.subset(index(2), 6, defaultValue)
-print(m) // [null, null, 6]
-console.log()
-
-// create ranges
-console.log('create ranges')
-print(range(1, 6)) // [1, 2, 3, 4, 5]
-print(range(0, 18, 3)) // [0, 3, 6, 9, 12, 15]
-print(range('2:-1:-3')) // [2, 1, 0, -1, -2]
-print(factorial(range('1:6'))) // [1, 2, 6, 24, 120]
-console.log()
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
-
-```
-
-
-
diff --git a/examples/objects.js b/examples/objects.js
deleted file mode 100644
index 57f73ad4c0..0000000000
--- a/examples/objects.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// objects
-import { evaluate, format } from 'mathjs'
-
-// create an object. Keys can be symbols or strings
-print(evaluate('{x: 2 + 1, y: 4}')) // {"x": 3, "y": 4}
-print(evaluate('{"name": "John"}')) // {"name": "John"}
-
-// create an object containing an object
-print(evaluate('{a: 2, b: {c: 3, d: 4}}')) // {"a": 2, "b": {"c": 3, "d": 4}}
-
-const scope = {
- obj: {
- prop: 42
- }
-}
-
-// retrieve properties using dot notation or bracket notation
-print(evaluate('obj.prop', scope)) // 42
-print(evaluate('obj["prop"]', scope)) // 42
-
-// set properties (returns the whole object, not the property value!)
-print(evaluate('obj.prop = 43', scope)) // 43
-print(evaluate('obj["prop"] = 43', scope)) // 43
-print(scope.obj) // {"prop": 43}
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
diff --git a/examples/objects.js.md b/examples/objects.js.md
deleted file mode 100644
index 0b6d6b2d6d..0000000000
--- a/examples/objects.js.md
+++ /dev/null
@@ -1,47 +0,0 @@
----
-layout: default
----
-
-# Objects
-
-File: [objects.js](objects.js)
-
-```js
-// objects
-import { evaluate, format } from 'mathjs'
-
-// create an object. Keys can be symbols or strings
-print(evaluate('{x: 2 + 1, y: 4}')) // {"x": 3, "y": 4}
-print(evaluate('{"name": "John"}')) // {"name": "John"}
-
-// create an object containing an object
-print(evaluate('{a: 2, b: {c: 3, d: 4}}')) // {"a": 2, "b": {"c": 3, "d": 4}}
-
-const scope = {
- obj: {
- prop: 42
- }
-}
-
-// retrieve properties using dot notation or bracket notation
-print(evaluate('obj.prop', scope)) // 42
-print(evaluate('obj["prop"]', scope)) // 42
-
-// set properties (returns the whole object, not the property value!)
-print(evaluate('obj.prop = 43', scope)) // 43
-print(evaluate('obj["prop"] = 43', scope)) // 43
-print(scope.obj) // {"prop": 43}
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- const precision = 14
- console.log(format(value, precision))
-}
-
-```
-
-
-
diff --git a/examples/serialization.js b/examples/serialization.js
deleted file mode 100644
index eb0cf4ab4f..0000000000
--- a/examples/serialization.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// serialization
-import { complex, replacer, reviver, typeOf } from 'mathjs'
-
-// serialize a math.js data type into a JSON string
-// the replacer function is needed to correctly stringify a value like Infinity
-const x = complex('2+3i')
-const str1 = JSON.stringify(x, replacer)
-console.log(str1)
-// outputs {"mathjs":"Complex","re":2,"im":3}
-
-// deserialize a JSON string into a math.js data type
-// note that the reviver of math.js is needed for this:
-const str2 = '{"mathjs":"Unit","value":5,"unit":"cm"}'
-const y = JSON.parse(str2, reviver)
-console.log(typeOf(y)) // 'Unit'
-console.log(y.toString()) // 5 cm
diff --git a/examples/serialization.js.md b/examples/serialization.js.md
deleted file mode 100644
index e600c5e722..0000000000
--- a/examples/serialization.js.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-layout: default
----
-
-# Serialization
-
-File: [serialization.js](serialization.js)
-
-```js
-// serialization
-import { complex, replacer, reviver, typeOf } from 'mathjs'
-
-// serialize a math.js data type into a JSON string
-// the replacer function is needed to correctly stringify a value like Infinity
-const x = complex('2+3i')
-const str1 = JSON.stringify(x, replacer)
-console.log(str1)
-// outputs {"mathjs":"Complex","re":2,"im":3}
-
-// deserialize a JSON string into a math.js data type
-// note that the reviver of math.js is needed for this:
-const str2 = '{"mathjs":"Unit","value":5,"unit":"cm"}'
-const y = JSON.parse(str2, reviver)
-console.log(typeOf(y)) // 'Unit'
-console.log(y.toString()) // 5 cm
-
-```
-
-
-
diff --git a/examples/sparse_matrices.js b/examples/sparse_matrices.js
deleted file mode 100644
index f65d415154..0000000000
--- a/examples/sparse_matrices.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// Sparse matrices
-import { identity, multiply, transpose, complex } from 'mathjs'
-
-// create a sparse matrix
-console.log('creating a 1000x1000 sparse matrix...')
-const a = identity(1000, 1000, 'sparse')
-
-// do operations with a sparse matrix
-console.log('doing some operations on the sparse matrix...')
-const b = multiply(a, a)
-const c = multiply(b, complex(2, 2))
-const d = transpose(c)
-const e = multiply(d, a)
-console.log('size(e)=', e.size())
-
-// we will not print the output, but doing the same operations
-// with a dense matrix are very slow, try it for yourself.
-console.log('already done')
-console.log('now try this with a dense matrix :)')
diff --git a/examples/sparse_matrices.js.md b/examples/sparse_matrices.js.md
deleted file mode 100644
index fccea2b554..0000000000
--- a/examples/sparse_matrices.js.md
+++ /dev/null
@@ -1,33 +0,0 @@
----
-layout: default
----
-
-# Sparse matrices
-
-File: [sparse_matrices.js](sparse_matrices.js)
-
-```js
-// Sparse matrices
-import { identity, multiply, transpose, complex } from 'mathjs'
-
-// create a sparse matrix
-console.log('creating a 1000x1000 sparse matrix...')
-const a = identity(1000, 1000, 'sparse')
-
-// do operations with a sparse matrix
-console.log('doing some operations on the sparse matrix...')
-const b = multiply(a, a)
-const c = multiply(b, complex(2, 2))
-const d = transpose(c)
-const e = multiply(d, a)
-console.log('size(e)=', e.size())
-
-// we will not print the output, but doing the same operations
-// with a dense matrix are very slow, try it for yourself.
-console.log('already done')
-console.log('now try this with a dense matrix :)')
-
-```
-
-
-
diff --git a/examples/units.js b/examples/units.js
deleted file mode 100644
index 6f7e9c0f73..0000000000
--- a/examples/units.js
+++ /dev/null
@@ -1,106 +0,0 @@
-// units
-import { add, cross, divide, evaluate, format as _format, multiply, number, pow, to, unit } from 'mathjs'
-
-// units can be created by providing a value and unit name, or by providing
-// a string with a valued unit.
-console.log('create units')
-const a = unit(45, 'cm')
-const b = unit('0.1m')
-print(a) // 45 cm
-print(b) // 0.1 m
-console.log()
-
-// units can be added, subtracted, and multiplied or divided by numbers and by other units
-console.log('perform operations')
-print(add(a, b)) // 55 cm
-print(multiply(b, 2)) // 0.2 m
-print(divide(unit('1 m'), unit('1 s'))) // 1 m / s
-print(pow(unit('12 in'), 3)) // 1728 in^3
-console.log()
-
-// units can be converted to a specific type, or to a number
-console.log('convert to another type or to a number')
-print(b.to('cm')) // 10 cm Alternatively: to(b, 'cm')
-print(to(b, 'inch')) // 3.9370078740157 inch
-print(b.toNumber('cm')) // 10
-print(number(b, 'cm')) // 10
-console.log()
-
-// the expression parser supports units too
-console.log('parse expressions')
-print(evaluate('2 inch to cm')) // 5.08 cm
-print(evaluate('cos(45 deg)')) // 0.70710678118655
-print(evaluate('90 km/h to m/s')) // 25 m / s
-console.log()
-
-// convert a unit to a number
-// A second parameter with the unit for the exported number must be provided
-print(evaluate('number(5 cm, mm)')) // number, 50
-console.log()
-
-// simplify units
-console.log('simplify units')
-print(evaluate('100000 N / m^2')) // 100 kPa
-print(evaluate('9.81 m/s^2 * 100 kg * 40 m')) // 39.24 kJ
-console.log()
-
-// example engineering calculations
-console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol')
-const Rg = unit('8.314 N m / (mol K)')
-const T = unit('65 degF')
-const P = unit('14.7 psi')
-const v = divide(multiply(Rg, T), P)
-console.log('gas constant (Rg) = ', format(Rg))
-console.log('P = ' + format(P))
-console.log('T = ' + format(T))
-console.log('v = Rg * T / P = ' + format(to(v, 'L/mol')))
-// 23.910432393453 L / mol
-console.log()
-
-console.log('compute speed of fluid flowing out of hole in a container')
-const g = unit('9.81 m / s^2')
-const h = unit('1 m')
-const v2 = pow(multiply(2, multiply(g, h)), 0.5) // Can also use sqrt
-console.log('g = ' + format(g))
-console.log('h = ' + format(h))
-console.log('v = (2 g h) ^ 0.5 = ' + format(v2))
-// 4.42944691807 m / s
-console.log()
-
-console.log('electrical power consumption:')
-const expr1 = '460 V * 20 A * 30 days to kWh'
-console.log(expr1 + ' = ' + evaluate(expr1)) // 6624 kWh
-console.log()
-
-console.log('circuit design:')
-const expr2 = '24 V / (6 mA)'
-console.log(expr2 + ' = ' + evaluate(expr2)) // 4 kohm
-console.log()
-
-console.log('operations on arrays:')
-const B = evaluate('[1, 0, 0] T')
-const v3 = evaluate('[0, 1, 0] m/s')
-const q = evaluate('1 C')
-const F = multiply(q, cross(v3, B))
-console.log('B (magnetic field strength) = ' + format(B)) // [1 T, 0 T, 0 T]
-console.log('v (particle velocity) = ' + format(v3)) // [0 m / s, 1 m / s, 0 m / s]
-console.log('q (particle charge) = ' + format(q)) // 1 C
-console.log('F (force) = q (v cross B) = ' + format(F)) // [0 N, 0 N, -1 N]
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- console.log(format(value))
-}
-
-/**
- * Helper function to format an output a value.
- * @param {*} value
- * @return {string} Returns the formatted value
- */
-function format (value) {
- const precision = 14
- return _format(value, precision)
-}
diff --git a/examples/units.js.md b/examples/units.js.md
deleted file mode 100644
index 5b127e2990..0000000000
--- a/examples/units.js.md
+++ /dev/null
@@ -1,120 +0,0 @@
----
-layout: default
----
-
-# Units
-
-File: [units.js](units.js)
-
-```js
-// units
-import { add, cross, divide, evaluate, format as _format, multiply, number, pow, to, unit } from 'mathjs'
-
-// units can be created by providing a value and unit name, or by providing
-// a string with a valued unit.
-console.log('create units')
-const a = unit(45, 'cm')
-const b = unit('0.1m')
-print(a) // 45 cm
-print(b) // 0.1 m
-console.log()
-
-// units can be added, subtracted, and multiplied or divided by numbers and by other units
-console.log('perform operations')
-print(add(a, b)) // 55 cm
-print(multiply(b, 2)) // 0.2 m
-print(divide(unit('1 m'), unit('1 s'))) // 1 m / s
-print(pow(unit('12 in'), 3)) // 1728 in^3
-console.log()
-
-// units can be converted to a specific type, or to a number
-console.log('convert to another type or to a number')
-print(b.to('cm')) // 10 cm Alternatively: to(b, 'cm')
-print(to(b, 'inch')) // 3.9370078740157 inch
-print(b.toNumber('cm')) // 10
-print(number(b, 'cm')) // 10
-console.log()
-
-// the expression parser supports units too
-console.log('parse expressions')
-print(evaluate('2 inch to cm')) // 5.08 cm
-print(evaluate('cos(45 deg)')) // 0.70710678118655
-print(evaluate('90 km/h to m/s')) // 25 m / s
-console.log()
-
-// convert a unit to a number
-// A second parameter with the unit for the exported number must be provided
-print(evaluate('number(5 cm, mm)')) // number, 50
-console.log()
-
-// simplify units
-console.log('simplify units')
-print(evaluate('100000 N / m^2')) // 100 kPa
-print(evaluate('9.81 m/s^2 * 100 kg * 40 m')) // 39.24 kJ
-console.log()
-
-// example engineering calculations
-console.log('compute molar volume of ideal gas at 65 Fahrenheit, 14.7 psi in L/mol')
-const Rg = unit('8.314 N m / (mol K)')
-const T = unit('65 degF')
-const P = unit('14.7 psi')
-const v = divide(multiply(Rg, T), P)
-console.log('gas constant (Rg) = ', format(Rg))
-console.log('P = ' + format(P))
-console.log('T = ' + format(T))
-console.log('v = Rg * T / P = ' + format(to(v, 'L/mol')))
-// 23.910432393453 L / mol
-console.log()
-
-console.log('compute speed of fluid flowing out of hole in a container')
-const g = unit('9.81 m / s^2')
-const h = unit('1 m')
-const v2 = pow(multiply(2, multiply(g, h)), 0.5) // Can also use sqrt
-console.log('g = ' + format(g))
-console.log('h = ' + format(h))
-console.log('v = (2 g h) ^ 0.5 = ' + format(v2))
-// 4.42944691807 m / s
-console.log()
-
-console.log('electrical power consumption:')
-const expr1 = '460 V * 20 A * 30 days to kWh'
-console.log(expr1 + ' = ' + evaluate(expr1)) // 6624 kWh
-console.log()
-
-console.log('circuit design:')
-const expr2 = '24 V / (6 mA)'
-console.log(expr2 + ' = ' + evaluate(expr2)) // 4 kohm
-console.log()
-
-console.log('operations on arrays:')
-const B = evaluate('[1, 0, 0] T')
-const v3 = evaluate('[0, 1, 0] m/s')
-const q = evaluate('1 C')
-const F = multiply(q, cross(v3, B))
-console.log('B (magnetic field strength) = ' + format(B)) // [1 T, 0 T, 0 T]
-console.log('v (particle velocity) = ' + format(v3)) // [0 m / s, 1 m / s, 0 m / s]
-console.log('q (particle charge) = ' + format(q)) // 1 C
-console.log('F (force) = q (v cross B) = ' + format(F)) // [0 N, 0 N, -1 N]
-
-/**
- * Helper function to output a value in the console. Value will be formatted.
- * @param {*} value
- */
-function print (value) {
- console.log(format(value))
-}
-
-/**
- * Helper function to format an output a value.
- * @param {*} value
- * @return {string} Returns the formatted value
- */
-function format (value) {
- const precision = 14
- return _format(value, precision)
-}
-
-```
-
-
-
diff --git a/googlea47c4a0b36d11021.html b/googlea47c4a0b36d11021.html
deleted file mode 100644
index 9ac6df3dd9..0000000000
--- a/googlea47c4a0b36d11021.html
+++ /dev/null
@@ -1 +0,0 @@
-google-site-verification: googlea47c4a0b36d11021.html
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
deleted file mode 100644
index afb2dcc8f0..0000000000
--- a/gulpfile.js
+++ /dev/null
@@ -1,335 +0,0 @@
-var fs = require('fs');
-var path = require('path');
-var zlib = require('zlib');
-var { globSync } = require('glob');
-var { rimraf } = require('rimraf');
-var gulp = require('gulp');
-var log = require('fancy-log');
-var replace = require('gulp-replace');
-var rename = require('gulp-rename');
-var header = require('gulp-header');
-var handlebars = require('handlebars');
-
-var DEP_MATHJS = './node_modules/mathjs'
-var DEP_MATHJS_SRC = './mathjs-src'
-var LIB_SRC = DEP_MATHJS + '/lib/browser/*';
-var LIB_DEST = './js/lib';
-var DOCS_SRC = DEP_MATHJS_SRC + '/docs/**/*.md';
-var DOCS_DEST = './docs';
-var EXAMPLES_SRC = DEP_MATHJS_SRC + '/examples/**/*';
-var EXAMPLES_DEST = './examples';
-var HISTORY_SRC = DEP_MATHJS_SRC + '/HISTORY.md';
-var HISTORY_DEST = '.';
-var MATHJS = LIB_DEST + '/math.js';
-var DOWNLOAD = './download.md';
-
-var MD_HEADER =
- '---\n' +
- 'layout: default\n' +
- '---\n' +
- '\n';
-
-var EXAMPLE_TEMPLATE = MD_HEADER +
- '# {{title}}\n\n' +
- '{{#each files}}' +
- 'File: [{{url}}]({{url}}){{#if_eq type "html"}} (click for a live demo){{/if_eq}}\n\n' +
- '```{{type}}\n' +
- '{{{code}}}' +
- '\n```\n\n' +
- '{{/each}}' +
- '\n\n';
-
-var INDEX_TEMPLATE = MD_HEADER +
- '# Examples\n\n' +
- '{{#each files}}' +
- '- [{{title}}]({{url}})\n' +
- '{{/each}}' +
- '\n' +
- '\n' +
- '# Browser examples\n\n' +
- '{{#each browserFiles}}' +
- '- [{{title}}]({{url}})\n' +
- '{{/each}}' +
- '\n' +
- '\n' +
- '# Advanced examples\n\n' +
- '{{#each advancedFiles}}' +
- '- [{{title}}]({{url}})\n' +
- '{{/each}}' +
- '\n' +
- '\n' +
- '\n\n';
-
-// source: https://stackoverflow.com/questions/15088215/handlebars-js-if-block-helper
-handlebars.registerHelper('if_eq', function(a, b, opts) {
- if(a === b)
- return opts.fn(this);
- else
- return opts.inverse(this);
-});
-
-// get version of math.js
-function version() {
- return require('mathjs/package.json').version;
-}
-
-// inject permalinks in markdown files in a gulp pipe
-var fn = function (header, level, title) {
- // for example:
- // header is '## My Header',
- // level is '##',
- // title is 'My Header'
- var tag = 'h' + level.length; // for example 'h2'
- var id = title.toLowerCase() // for example 'my-header'
- .replace(/[^\w\s]/g, '')
- .replace(/\s/g, '-');
- var link = '#'; // clickable link to header
-
- // returns for example 'My Header #
'
- return '<' + tag + ' id="' + id + '">' + title + ' ' + link + '' + tag + '>';
-};
-var injectPermalinks = replace(/^(#+) (.*)$/mg, fn);
-var injectPermalinks2 = replace(/^(#+) (.*)$/mg, fn);
-var injectClickableIssueTags = replace(/([ (])(#(\d+))/mg, function (match, pre, tag, number) {
- return pre + '' + tag + ''
-});
-var injectClickableUserTags = replace(/ (@([0-9a-zA-Z_-]+))/mg, function (match, tag, username) {
- return ' ' + tag + ''
-});
-
-/**
- * Verify whether we have the same version numbers in both mathjs and mathjs-src
- *
- * The mathjs library itself is purely used to validate whether the library
- * is published and whether we've an up-to-date version of the master branch
- * with the source code.
- */
-gulp.task('verify', function (cb) {
- const mathjsVersion = require(DEP_MATHJS + '/package.json').version;
- const mathjsSrcVersion = require(DEP_MATHJS_SRC + '/package.json').version;
-
- if (mathjsVersion !== mathjsSrcVersion) {
- throw new Error('Version numbers of mathjs and mathjs-src do not correspond'+
- `(mathjs: ${mathjsVersion}, mathjs-src: ${mathjsSrcVersion})`);
- }
-
- cb();
-});
-
-/**
- * copy math.js
- */
-gulp.task('copy', function () {
- return gulp.src(LIB_SRC)
- .pipe(gulp.dest(LIB_DEST));
-});
-
-/**
- * Clean all examples and docs
- */
-gulp.task('clean', async function () {
- await rimraf(DOCS_DEST);
- await rimraf(EXAMPLES_DEST);
-});
-
-/**
- * Import docs and preprocess them for the static HTML web page:
- * - Add a markdown header containing the layout page
- * - Replace internal links to other markdown documents with *.html
- */
-gulp.task('docs', function () {
- return gulp.src(DOCS_SRC)
- .pipe(replace(/HISTORY.md/g, 'history.html')) // change links to history.md to lowercase
- .pipe(replace(/(\([\w\./]*).md([)#])/g, '$1.html$2')) // replace urls to *.md with *.html
- .pipe(injectPermalinks) // create headers with an id
- .pipe(header(MD_HEADER)) // add banner with markdown layout
- .pipe(gulp.dest(DOCS_DEST));
-});
-
-/**
- * Copy all examples
- */
-gulp.task('copyExamples', function () {
- // TODO: make these script replacements more robust
- var script = 'https://unpkg.com/mathjs@' + version() + '/lib/browser/math.js';
- console.log('copy examples', version(), { url: script })
- return gulp.src(EXAMPLES_SRC)
- .pipe(replace(/src=".*lib\/browser\/math.js"/, 'src="' + script + '"'))
- .pipe(replace(/'.*lib\/browser\/math.js'/, "'" + script + "'"))
- .pipe(replace("from '../lib/esm/index.js'", "from 'mathjs'"))
- .pipe(replace("from '../../lib/esm/index.js'", "from 'mathjs'"))
- .pipe(replace("from '../../lib/esm/number.js'", "from 'mathjs/number'"))
- .pipe(gulp.dest(EXAMPLES_DEST));
-});
-
-/**
- * Create markdown pages for every example
- */
-gulp.task('markdownExamples', function (cb) {
- var template = handlebars.compile(EXAMPLE_TEMPLATE);
-
- function createPage (files, title, url) {
- if (!Array.isArray(files)) {
- files = [files];
- }
-
- var page = template({
- title: title, // for example 'Basic usage'
- files: files
- .sort(function (a, b) {
- if (path.basename(a) == 'index.js' || path.basename(a) == 'index.html') return -1;
- if (path.basename(b) == 'index.js' || path.basename(b) == 'index.html') return 1;
- return 0;
- })
- .map(function (file) {
- return {
- url: path.basename(file), // for example 'basic_usage.js'
- type: path.extname(file).substring(1), // for example 'js'
- code: fs.readFileSync(file) // the actual code contents
- };
- })
- });
-
- // TODO: inject permalinks
-
- fs.writeFileSync(url, page);
- }
-
- function generate(pattern, callback) {
- const files = globSync(EXAMPLES_DEST + '/' + pattern)
-
- files.sort();
-
- var results = files.map(function (file) {
- var isDir = fs.statSync(file).isDirectory();
- var extension = path.extname(file);
- var title = path.basename(file, extension) // filename without extension
- .replace(/^\w/g, function (c) { // replace first character with upper case letter
- return c.toUpperCase();
- })
- .replace(/_/g, ' '); // replace underscores with spaces
-
- if (isDir) {
- var files = fs.readdirSync(file).map(function (f) {
- return file + '/' + f;
- });
- file = file + '/index';
- createPage(files, title, file + '.md');
- }
- else {
- createPage(file, title, file + '.md');
- }
-
- return {
- title: title, // for example 'Basic usage'
- url: path.relative(EXAMPLES_DEST, file + '.html') // for example 'basic_usage.js.html'
- };
- });
-
- callback(results);
- }
-
- // TODO: write a more generic script for this
- generate('*.js', function (files) {
- generate('browser/*', function (browserFiles) {
- generate('advanced/*', function (advancedFiles) {
- // create an index page
- var template = handlebars.compile(INDEX_TEMPLATE);
- var page = template({
- files: files,
- browserFiles: browserFiles,
- advancedFiles: advancedFiles
- });
- // TODO: inject permalinks
-
- fs.writeFileSync(EXAMPLES_DEST + '/index.md', page);
-
- cb();
- });
- });
- });
-});
-
-/**
- * Copy and preprocess the history file
- */
-gulp.task('history', function () {
- return gulp.src(HISTORY_SRC)
- .pipe(header(MD_HEADER)) // add header with markdown layout
- .pipe(injectClickableIssueTags) // must be done before injectPermalinks
- .pipe(injectClickableUserTags) // must be done before injectPermalinks
- .pipe(injectPermalinks2)
- .pipe(rename('history.md')) // rename to lower case
- .pipe(gulp.dest(HISTORY_DEST));
-});
-
-/**
- * Update size and version number on the downloads page
- */
-gulp.task('version', function (cb) {
- // get (gzipped) bundle size
- function productionSize(callback) {
- fs.readFile(MATHJS, function (err, data) {
- if (!err) {
- zlib.gzip(data, function (err, data) {
- if (!err) {
- var size = Math.round(data.length / 1024) + ' kB';
- callback(null, size)
- }
- else {
- callback(err);
- }
- });
- }
- else {
- callback(err);
- }
- });
- }
-
- // update version and library sizes in index.md
- function updateVersion(productionSize, callback) {
- log('bundle size: ' + productionSize);
- log('version: ' + version());
-
- fs.readFile(DOWNLOAD, function (err, data) {
- if (!err) {
- data = String(data);
-
- // replace version
- data = data.replace(/\(version [0-9]+\.[0-9]+\.[0-9]+(-SNAPSHOT)?,/g, '(version ' + version() + ',');
- data = data.replace(/\/[0-9]+\.[0-9]+\.[0-9]+?(-SNAPSHOT)?\//g, '/' + version() + '/');
- data = data.replace(/\/mathjs@[0-9]+\.[0-9]+\.[0-9]+?(-SNAPSHOT)?\//g, '/mathjs@' + version() + '/');
-
- // replace bundle size
- data = data.replace(/([\w\s]*)<\/span>/g,
- '' + productionSize + '');
-
- fs.writeFile(DOWNLOAD, data, callback);
- }
- else {
- callback(err);
- }
- });
- }
-
- productionSize(function (err, prodSize) {
- if (prodSize) {
- updateVersion(prodSize, cb);
- }
- else {
- cb(new Error('Failed to calculate development size or production size'));
- }
- });
-});
-
-gulp.task('default', gulp.series(
- 'verify',
- 'clean',
- 'copy',
- 'docs',
- 'copyExamples',
- 'markdownExamples',
- 'history',
- 'version'
-));
diff --git a/history.md b/history.md
deleted file mode 100644
index 8e2236ae23..0000000000
--- a/history.md
+++ /dev/null
@@ -1,3090 +0,0 @@
----
-layout: default
----
-
-History #
-
-2025-05-30, 14.5.2 #
-
-- Fix: add embedded docs for the deprecated physical constant `coulomb`,
- see #3472.
-- Fix: #3469 add `ResultSet` interface and improve `isResultSet` typing
- (#3481). Thanks @ranidam.
-
-2025-05-28, 14.5.1 #
-
-- Fix: #3482 mathjs throwing an error related to `BigInt` when loading in
- specific environments.
-- Fix: syntax section of function `numeric` (see #3448).
-- Fix: #3472 rename physical constant `coulomb` to `coulombConstant`. The old
- name is still available for backward compatibility.
-- Fix: support multiplication of arrays with units (#3456). Thanks @Delaney.
-
-2025-05-21, 14.5.0 #
-
-- Feat: improve the performance of the `map` and `forEach` methods of
- `DenseMatrix` (#3446). Thanks @dvd101x.
-- Feat: improve the performance of `subset` (#3467). Thanks @dvd101x.
-- Feat: define embedded docs for `compile`, `evaluate`, `parse`, and `parser`,
- and add tests for the examples in embedded docs (#3413). Thanks @dvd101x.
-- Fix: #3450 support multiplication of valueless units by arbitrary types
- (#3454).
-- Fix: #3474 correctly parse `(lbf in)` (#3476). Thanks @costerwi.
-
-2025-03-28, 14.4.0 #
-
-- Feat: improve the performance of function `flatten` (#3400). Thanks @dvd101x.
-- Feat: improve the performance of `map` and `forEach` (#3409).
- Thanks @dvd101x.
-- Feat: add LaTeX representation for fractions (#3434, #3419). Thanks @orelbn.
-- Fix: #3422 allow dot operators after symbol E (#3425).
-- Fix: issue in the `nthRoots` latex function template string (#3427).
- Thanks @aitee.
-- Fix: upgrade to the latest version of `@babel/runtime`.
-
-2025-03-06, 14.3.1 #
-
-- Fix: #3350 cannot import a constant that is a complex number.
-
-2025-02-28, 14.3.0 #
-
-- Feat: improved performance of function `flatten` (#3354). Thanks @dvd101x.
-- Feat: improved performance of `DenseMatrix` Symbol.iterator (#3395).
- Thanks @dvd101x.
-- Feat: improved performance of functions `map` and `forEach` (#3399).
- Thanks @dvd101x.
-- Fix: #3390 issue in callback optimization and add error handling for invalid
- argument types (#3394). Thanks @dvd101x.
-- Fix: #3356 add missing eigsDependencies export to TypeScript definitions
- (#3397). Thanks @porst17.
-- Fix: #3406 infer the correct type for multi-dimensional arrays in function
- `multiply` (#3408). Thanks @orelbn.
-- Fix: #3387 use utility `math.isNaN` for consistent `max` and `min` results
- (#3389). Thanks @orelbn.
-
-2025-02-05, 14.2.1 #
-
-- Fix: #3377 remove redundant dependency `@lambdatest/node-tunnel`.
-
-2025-01-30, 14.2.0 #
-
-- Feat: #3041, #3340 rename `apply` to `mapSlices` (#3357). Function
- `apply` is still available but is now marked deprecated. Thanks @gwhitney.
-- Fix: #3247 don't override type-native floor/ceil within tolerance of value
- (#3369). Thanks @gwhitney.
-- Fix: #3360 add bigint support to matrix indices and ranges (#3361).
- Thanks @gwhitney.
-- Fix: #3115 type definitions for matrixFrom* (#3371). Thanks @Hudsxn
- and @gwhitney.
-
-2025-01-24, 14.1.0 #
-
-- Feat: implement `bigint` support in functions `log`, `log2`, `log10`,
- `larger`, `smaller`, `max`, `min` (#3345). Thanks @gwhitney.
-- Fix: #3342 hexadecimal input not turned into a `bigint` (#3348).
-- Fix `randomInt()` not working (#3345).
-- Docs: fixed description of `sign` in the embedded docs (#3338).
- Thanks @witer33.
-
-2024-12-11, 14.0.1 #
-
-- Fix: make derivative much faster (#3322). Thanks @paulftw.
-- Fix: #3317 export `Fraction` type from the `fraction.js` library instead of
- using a custom interface (#3330). Thanks @fchu.
-
-2024-11-20, 14.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES !!!
-
-- Feat: Upgrade to `fraction.js@5`, using `bigint` under the hood (#3283).
-- Feat: Implement support for `Unit` in functions `ceil`, `floor`, and `fix`.
- Possible breaking changes in the type definitions of arrays and matrices
- due to the introduction of generics (#3269). Thanks @orelbn.
-- Feat: Implement support for `log(x: Fraction, base: Fraction)`.
-- Fix: #3301 precedence of `%` (mod) being higher than `*` and `/` (#3311).
- Thanks @nkumawat34.
-- Fix: #3222 prevent `math.import(...)` from overriding units unless you
- specify `{ override: true }` (#3225).
-- Fix: #3219 let functions `dotDivide`, `dotPow`, `bitXor`, `xor`, `equal`,
- `larger`, `largerEq`, `smaller`, `smallerEq`, and `unequal` return a sparse
- matrix when the input is two sparse matrices (#3307). Thanks @Aakash-Rana.
-- Fix: Improve type definitions of arrays (#3306). Thanks @orelbn.
-
-2024-11-20, 13.2.3 #
-
-- Fix: #3260 improve type definitions and documentation on the callback
- indices of `map`, `filter`, and `forEach`.
-- Fix: #3323 support functions in function `clone`.
-- Docs: fix a broken link in the documentation (#3316).
- Thanks @emmanuel-ferdman.
-
-2024-11-13, 13.2.2 #
-
-- Fix: #1455 implicit multiplication of a fraction with unit `in` is incorrect
- (#3315). Thanks @nkumawat34.
-
-2024-11-06, 13.2.1 #
-
-- Update to the latest version of `complex.js`.
-- Fix `Index.dimension(dim)` accepting non-numeric input.
-- Fix: #3290 should validate variables names in method `Parser.set` (#3308).
- Thanks @nkumawat34.
-
-2024-10-02, 13.2.0 #
-
-- Feat: improve performance of functions `map`, `filter` and `forEach` (#3256).
- Thanks @dvd101x.
-- Feat: improve performance of the methods `map()` and `forEach()`
- of `DenseMatrix` (#3251). Thanks @Galm007.
-- Fix: #3253 cannot use identifiers containing special characters in function
- `derivative`.
-- Fix: improve the type definitions of `ConstantNode` to support all data
- types (#3257). Thanks @smith120bh.
-- Fix: #3259 function `symbolicEqual` missing in the TypeScript definitions.
-- Fix: #3246 function `leafCount` missing in the TypeScript definitions.
-- Fix: #3267 implicit multiplication with a negative number and unit `in`.
-- Docs: fix broken links on the Configuration page. Thanks @vassudanagunta.
-- Docs: document the syntax of `map` and `forEach` in the expression parser
- (#3272). Thanks @dvd101x.
-
-2024-08-27, 13.1.1 #
-
-- Fix security vulnerability in the CLI and web API allowing to call functions
- `import`, `createUnit` and `reviver`, allowing to get access to the internal
- math namespace and allowing arbitrary code execution. Thanks @StarlightPWN.
-- Fix security vulnerability: when overwriting a `rawArgs` function with a
- non-`rawArgs` function, it was still called with raw arguments. This was both
- a functional issue and a security issue. Thanks @StarlightPWN.
-- Fix security vulnerability: ensure that `ObjectWrappingMap` cannot delete
- unsafe properties. Thanks @StarlightPWN.
-- Fix: not being able to use methods and properties on arrays inside the
- expression parser.
-
-2024-08-26, 13.1.0 #
-
-- Feat: support multiple inputs in function `map` (#3228, #3196).
- Thanks @dvd101x.
-- Feat: add matrix datatypes in more cases (#3235). Thanks @dvd101x.
-- Feat: export util functions `isMap`, `isPartitionedMap`, and
- `isObjectWrappingMap`.
-- Fix: #3241 function `map` not always working with matrices (#3242).
- Thanks @dvd101x.
-- Fix: #3244 fix broken link to `ResultSet` in the docs about classes.
-- Docs: add a link to the documentation page about the syntax expression
- from the function `evaluate` (see #3238).
-- Docs: improve the documentation of `scope` and fix the example
- `custom_scope_objects.js` (#3150)
-- Docs: spelling fixes in the embedded docs (#3252). Thanks @dvd101x.
-
-2024-07-19, 13.0.3 #
-
-- Fix: #3232 fix type definitions of function `format` to support notations
- `hex`, `bin`, and `oct`.
-- Fix: use more precise definitions for US liquid volume units (#3229).
- Thanks @Vistinum.
-- Fix: #2286 types static methods and members for Unit class (#3230).
- Thanks @orelbn.
-
-2024-07-04, 13.0.2 #
-
-- Fix an error in the type definitions of `quantileSeq` (#3223).
- Thanks @domdomegg.
-
-2024-06-28, 13.0.1 #
-
-- Fix: #3227 generated bundle containing `catch` blocks without parameters.
-- Fix: #2348 update type definitions of the `Parser` methods (#3226).
- Thanks @orelbn.
-
-2024-05-31, 13.0.0 #
-
-Breaking changes:
-
-- Change `isZero`, `isPositive`, and `isNegative` to respect `config.epsilon`
- (#3139, #2838). Thanks @dvd101x.
-- Change the behavior of the internal `nearlyEqual` to align with Python and
- Julia (#3152, #2838). Thanks @dvd101x.
-- Upgrade to `fraction.js@4.3.7`,
- see .
-- Dropped support for JavaScript engines that do not fully support ES6 or
- `bigint`, or are not actively maintained. ES2020 is now the minimum required
- EcmaScript version.
-
-Non-breaking changes:
-
-- Implemented support for `bigint` (#3207, #3207)
-- Implemented a new config option `config.numberFallback` needed for `bigint`
- (#3207).
-- Internal: refactored tooling to ES modules and upgraded all devDependencies.
-
-2024-05-31, 12.4.3 #
-
-- Fix: serialization of Units without a value, see #1240.
-- Fix: outdated, incorrect documentation about the order of precedence for
- operator modulus `%`. See #3189.
-- Fix: #3197 improve `quantileSeq` type definitions (#3198). Thanks @domdomegg.
-
-2024-04-24, 12.4.2 #
-
-- Fix #3192: function `isNaN` returns `false` for `NaN` units in a matrix or
- array (#3193). Thanks @lgerin.
-- Fix: #3180 fix type definitions of functions `add` and `multiply` to allow
- more than two arguments.
-- Docs: correct the docs about `traverse` returning void (#3177).
- Thanks @rohildshah.
-
-2024-03-13, 12.4.1 #
-
-- Docs: implement an interactive version of the Lorenz example, and show the
- chart full screen (#3151). Thanks @dvd101x.
-- Fix #3172: simplify `"true and true"`.
-- Fix #3163: `toTex` wrongly returning `Infinity` for large BigNumbers.
-- Fix #3162: add license information about CSParse (#3164).
-- Fix #3175: cannot delete units using `math.Unit.deleteUnit`.
-- Fix: faster startup time of the CLI and REPL by loading the bundle.
-- Fix: remove using polyfill.io inside the example
- `pretty_printing_with_mathjax.html` (#3167). Thanks @SukkaW.
-
-2024-02-22, 12.4.0 #
-
-- Feat: implement support for trailing commas in matrices (#3154, #2968).
- Thanks @dvd101x.
-- Feat: improve the performance of `multiply` a lot by adding matrix type
- inferencing (#3149). Thanks @RandomGamingDev.
-- Fix: #3100 function `round` not handling round-off errors (#3136).
- Thanks @BrianFugate.
-- Fix: `PartitionedMap` and `ObjectWrappingMap` missing a property
- `Symbol.iterator`, causing problems when trying `new Map(scope)` (#3156).
-- Fix: type definitions of function `mode` (#3153). Thanks @rich-martinez.
-- Docs: describe method `getAllAsMap` in the Parser docs (#3158, #3157).
- Thanks @dvd101x.
-
-2024-02-08, 12.3.2 #
-
-- Improved the performance of custom defined functions in the expression
- parser (#3150).
-- Fix: #3143 cannot use `and` and `or` inside a function definition.
- Regression since `v12.1.0` (#3150).
-
-2024-02-01, 12.3.1 #
-
-- Improved the typings of the arguments of `ArrayNode`, `FunctionNode`,
- `IndexNode`, `OperatorNode`, and `RelationalNode` (#3123). Thanks @sylee957.
-- Added a fully featured code editor example with CodeMirror and Katex (#3027).
- Thanks @dvd101x.
-- Fix: #3114 build warnings related to a number of wrong `/* #__PURE__ */`
- annotations.
-- Fix: #3142 support BigNumber values for the options of function `format`:
- `precision`, `wordSize`, `lowerExp`, `upperExp`. Support BigNumber values
- for the option `wordSize` in the functions `hex`, `bin`, and `oct`.
-- Fix: #3125 type definitions of function `hypot` (#3144).
- Thanks @silentmissile.
-- Fix: #3141 `help(config)` altering the actual `config` when evaluating the
- examples.
-- Docs: #3145 fix documentation about REPL, it does require a build step
- nowadays.
-
-2024-01-12, 12.3.0 #
-
-- Implement support new metric prefixes: `ronna` (`R`), `quetta` (`Q`),
- `ronto` (`r`), and `quecto` (`q`) (#3113, #3112). Thanks @AlexEdgcomb.
-- Fix a bug converting a unitless unit (#3117). Thanks @costerwi.
-- Fix: #3097 `toSI()` wrongly converting `degC` (#3118). Thanks @costerwi.
-
-2023-12-20, 12.2.1 #
-
-- Fix #3109: method `Node.toHTML` not accepting a custom `handler`.
-
-2023-12-08, 12.2.0 #
-
-- Feat: lazy evaluation of operators `and`, `or`, `&`, `|` (#3090, #3101,
- #2766). Thanks @smith120bh.
-- Fix: passing a 4th argument with a scope to raw functions.
-- Fix: #3096 embedded docs of eigs throwing an error.
-
-2023-11-17, 12.1.0 #
-
-- Feat: Extend function `round` with support for units (#2761, #3095).
-- Feat: Extend function `mod` with support for negative divisors in when
- using `BigNumber` or `Fraction` (#3087).
-- Fix: #3092 a typo in an error message when converting a string into a number.
-- Fix: #3094 function `derivative` mutates the input expression when it fails.
-
-2023-10-26, 12.0.0 #
-
-Breaking changes:
-
-- Fix #2879, #2927, #3014: change the confusing interface of `eigs` (#3037),
- thanks @gwhitney.
- Before, functions `eigs` returned an object:
-
- ```
- { values: MathCollection; vectors: MathCollection }
- ```
-
- where `vectors` was a 2d matrix of which the columns contained the vectors.
- This is changed to `eigs` returning an object:
-
- ```
- {
- values: MathCollection
- eigenvectors: Array<{
- value: number | BigNumber
- vector: MathCollection
- }>
- }
- ```
-
- Where `eigenvectors` is an array containing an object with the corresponding
- eigenvalue and vector.
-- Refactored the TypeScript type definitions to make them work with a `NodeNext`
- module resolution (#3079, #2919).
- - Type `MathJsStatic` is renamed to `MathJsInstance`.
- - Type `FactoryDependencies` is deprecated, use `MathJsFactory` instead, and
- import dependency maps directly from the library.
-- Change the assignment operator of `.toTex()` output from `:=` to `=` (see
- #2980, #2987).
-- Drop official support for Node.js 14 and 16.
-
-Features:
-
-- Function `eigs` now has an option to turn off calculation of eigenvectors
- (#3057, #2180). Thanks @gwhitney.
-
-Fixes:
-
-- Find eigenvectors of defective matrices (#3037). Thanks @gwhitney.
-
-2023-10-26, 11.12.0 #
-
-- Implemented function `subtractScalar` (#3081, #2643), thanks @vrushaket.
-- Fix #3073: function format not escaping control characters and double
- quotes (#3082).
-- Fix: function `clone` not throwing an error when passing an unsupported
- type like a function.
-- Fix: #2960 add type definition of function `symbolicEqual` (#3035),
- thanks @juancodeaudio.
-
-2023-10-11, 11.11.2 #
-
-- Fix #3025: improve handling of matrices and error handling
- in function `corr` (#3030). Thanks @vrushaket.
-- Fix #3074: improve error message when using function `max` in `derivative`.
-- Fix #3073: fix parsing quotes inside a string.
-- Fix #2027: cannot use named operators like `to` or `mod` as property name.
-
-2023-09-20, 11.11.1 #
-
-- Fix #2989: use one-based indices in `print` in the parser (#3009).
- Thanks @dvd101x.
-- Fix #2936: `mod` sometimes giving wrong results due to internal round-off
- errors (#3011). Thanks @praisennamonu1.
-- Internal refactor of `quantileSeq`, and fixed the embedded help (#3003).
- Thanks @dvd101x.
-- Updated dependencies and devDependencies.
-
-2023-09-05, 11.11.0 #
-
-- Implement function `corr` to calculate the correlation between two matrices
- (#3015, #2624). Thanks @vrushaket.
-- Lock `fraction.js` at version `4.3.4` for now, see #3024, 3022,
- .
-
-2023-08-31, 11.10.1 #
-
-- Upgrade to `fraction.js@4.3.4`, see #3022.
-- Fix #3020: `lruQueue` using the global `hasOwnProperty` which may be
- polluted.
-- Add support for prefixes for the unit `erg`, and restrict prefixes of the
- unit `joule` to only long prefixes like `kilo` and no short prefixes
- like `k` (#3019). Thanks @costerwi.
-- Add a new browser example `examples/browser/lorenz.html` that uses `solveODE`
- and plots the result in a chart (#3018). Thanks @dvd101x.
-
-2023-08-23, 11.10.0 #
-
-- Extend function `quantileSeq` with support for a `dimension` (#3002).
- Thanks @dvd101x.
-- Implement #2735: Support indexing with an array of booleans, for
- example `a[[true, false, true]]` and `a[a > 2]` (#2994). Thanks @dvd101x.
-- Implement function `zeta` (#2950, #2975, #2904). Thanks @Bobingstern.
-- Fix #2990: `DenseMatrix` can mutate input arrays (#2991).
-
-2023-07-24, 11.9.1 #
-
-- Fix a security vulnerability in `FunctionNode` and `SymbolNode` allowing
- arbitrary code execution via `math.evaluate`. Thanks Harry Chen.
-- Fix #3001: mathjs bundle containing `new Function(...)` (CSP issue).
-
-2023-07-19, 11.9.0 #
-
-- Implement function `solveODE` (#2958). Thanks @dvd101x.
-- Implement functions `zpk2tf` and `freqz` (#2988, #2969). Thanks @alykhaled.
-- Implement support for units in function `range` (#2997). Thanks @dvd101x.
-- Fix #2974: `simplify` puts plus and minus signs next to each other (#2981).
- Thanks @MaybePixem.
-- Fix #2973: fixes and improvements in the embedded docs (#2976).
- Thanks @dvd101x.
-- Fix #2996: two errors in the examples in the documentation about Expression
- trees.
-- Fix round-off errors near zero when converting temperatures (#2962).
- Thanks @costerwi.
-- Refactored function `range`, reducing the amount of code (#2995).
- Thanks @dvd101x.
-
-2023-06-20, 11.8.2 #
-
-- Fix #2971: improve typings of statistics functions `min`, `max`, `mean`,
- `median`, `mode`, `std`, `sum`, `prod`, `variance`. Fixes a regression
- introduced in v11.8.1.
-- Fix #2972: type definitions of `Unit.divide(Unit)` have a wrong return type.
-
-2023-06-13, 11.8.1 #
-
-- Fix #2964: issue in function `distance` when calculate the distance from
- a point to a line (#2965). Thanks @Kiku-CN.
-- Fix `math.format` not working correctly for `engineering` notation when using
- BigNumbers and for `fixed` notation with `precision: 0` configured (#2956).
- Thanks @mgreminger.
-- Fix #2880: not possible to map cube root `cbrt`.
-- Fix #2938: make the syntax description of all functions consistent in the
- docs (#2941). Thanks @dvd101x.
-- Fix #2954: improve the TypeScript definitions the return type of functions
- `min` and `max` (#2955). Thanks @Maxim-Mazurok.
-- Fix #2959: typo in an example in the docs. Thanks @kunalagrwl.
-- Drop official support for Node.js 14, has reached end of life.
-
-2023-04-03, 11.8.0 #
-
-- Extended functions `fraction`, `bignumber`, and `number` with support for
- units, see #2918 (#2926).
-- Implemented aliases `amp` and `amps` for unit `ampere` (#2917).
- Thanks @veggiesaurus.
-- Improve TypeScript definitions of function `gcd` (#2922). Thanks @brunoSnoww.
-- Fix #2923: improve docs of the function `distance` (#2924). Thanks @tmtron.
-
-2023-03-15, 11.7.0 #
-
-- Implement #2567: accept array as parameter for function `gcd` (#2878).
- Thanks @jakubriegel.
-- Fix #2908: improvements in the docs and examples of functions
- `partitionSelect`, `diff`, `expm1`, `round`, `nthRoots`, `sign`,
- `rigthArithShift`, `setIsSubset`, `setSize`, and the docs about units.
- Thanks @tmtron.
-- Fix #2907: determinant of empty matrix should be 1.
-- Refactor index.d.ts by writing function declarations using a generic,
- reducing a lot of repetition (#2913). Thanks @brunoSnoww.
-
-2023-02-24, 11.6.0 #
-
-- Implement broadcasting for the following functions and their corresponding
- operator: `add`, `dotDivide`, `dotMultiply`, `dotPow`, `gcd`, `lcm`, `mod`,
- `nthRoot`, `subtract`, `bitAnd`, `bitOr`, `bitXor`, `leftShift`,
- `rightArithShift`, `rightLogShift`, `and`, `or`, `xor`, `compare`,
- `compareText`, `equal`, `larger`, `largerEq`, `smaller`, `smallerEq`,
- `unequal`, `atan2` and `to` (#2895, #2753). Thanks @dvd101x.
-- Implement support for non-power-of-2 fft (#2900, #2577). Thanks @cyavictor88.
-- Fix #2888: update type definitions of function `unit` to allow creating a
- unit from a fraction or complex number.
-- Fix #2892: an error in the examples of the embedded help of function `sort`.
-- Fix #2891: functions `column` and `row` sometimes returning a scalar number.
-- Fix #2896: define the fourth argument of function `intersect` as optional
- in the TypeScript definitions. Thanks @wodndb.
-- Fix: quantileSeq not accepting a matrix as second argument `prob` (see #2902).
-- Fix broken examples in functions `to`, `distance`, `getMatrixDataType`,
- `subset`, and `max` (see #2902).
-
-2023-01-31, 11.5.1 #
-
-- Add type definitions for function `rotationMatrix` (#2860).
- Thanks @brunoSnoww.
-- Add type signature for `lusolve(LUDecomposition, ...)` (#2864).
- Thanks @evanmiller.
-- Fix #2873: the rocket_trajectory_optimization.html example being partly
- broken. Thanks @dvd101x.
-- Fix #2871: coverage report broken (#2877). Thanks @bornova.
-- Fix #2883: update documentation for stat functions, describe missing syntax.
-- Fix #2884: fix examples in the embedded docs of function `pow` and some other
- functions.
-- Fix type definition of function `complex` for one numeric input (#2886),
- thanks @ariymarkowitz.
-- Fix type definitions of `map()` and `forEach()` (#2887), thanks @xiaohk.
-- Fix #2606: improve type definitions of `dotMultiply`, `dotPow` and
- `dotDivide` (#2890). Thanks @brunoSnoww.
-
-2022-12-05, 11.5.0 #
-
-- Improve `simplify` rule matches in non-commutative contexts (#2841).
- Thanks @samueltlg.
-- Simplify: add rules and restructure tests for non-commutative contexts
- (#2847). Thanks @samueltlg.
-- Fix function `reshape` mutating the input in case of a matrix (see #2854).
-- Fix TypeScript types for `multiply()` with `number[]` and `number[][]`
- (#2852). Thanks @hfhchan.
-
-2022-11-18, 11.4.0 #
-
-- Implemented more wildcards to describe rules for `simplify`, making it easier
- for example to describe unary minus (#1915). Thanks @thatcomputerguy0101.
-- Implemented functions `schur`, `sylvester`, and `lyap` (#2646).
- Thanks @egidioln.
-- Implemented function `polynomialRoot`, and use it in a benchmark (#2839).
- Thanks @gwhitney.
-- Fix #2825 partly: improve simplifying operations on constants in
- non-commutative contexts (#2827). Thanks @samueltlg.
-- Fix #2840: a bug in the docs and type definitions of `Node.traverse` and
- `Node.forEach`, they do return `void`.
-
-2022-11-07, 11.3.3 #
-
-- Fix #2830: Prevent inserting zero values when creating a `SparseMatrix` from a
- `DenseMatrix` (#2836). Thanks @AlexandreAlvesDB.
-- Fix #2835: a regression in the type definitions of `FunctionNode`, introduced
- in `v11.3.2`. See #2733. Thanks @dsteve.
-
-2022-10-25, 11.3.2 #
-
-- Add generics to remaining Node type definitions (#2733). Thanks @mattvague.
-- Allow unit prefixes for (absolute) temperatures `kelvin`, `rankine`,
- `celsius`, and `fahrenheit` (#2824). Thanks @jfeist
-
-2022-10-19, 11.3.1 #
-
-- Fix #2809: code completion issues in some IDE's (#2812).
-- Fix #2818: throw an error when a function assignment has duplicate
- parameter names (#2819).
-- Update `decimal.js` to version `10.4.2`.
-
-2022-10-11, 11.3.0 #
-
-- Allow creating new subclasses of `Node` in TypeScript (#2772).
- Note that this disables being able to narrow MathNodes by using the `.type`
- property. Use typeguards like `isOperatorNode(...)` instead (see #2810).
- Thanks @mattvague.
-- Fix #2793: `flatten()` cloning entries of array/Matrix (#2799).
-- Fix #2627: TypeScript definitions of `pinv` missing (#2804).
- Thanks @HanchaiN.
-- Update dependencies to `decimal.js@10.4.1`.
-
-2022-09-13, 11.2.1 #
-
-- Fix doc generator being broken, not generating a function reference.
-
-2022-09-12, 11.2.0 #
-
-- Implement function `isRelationalNode` (#2731). Thanks @isaacbyr.
-- Added missing types `'largerEq'` and `'or'` in `OperatorNodeMap` in the
- TypeScript definitions. Thanks @ajinkyac03.
-- Fixed typos in min func type defs (#2768). Thanks @mabdullahadeel.
-- Improved the TypeScript definitions for `pickRandom`. Thanks @mattvague.
-- Fixed documentation of unit `min` which means `minutes`, not `minim` (#2773).
- Thanks @jasonhornsby.
-
-2022-08-23, 11.1.0 #
-
-- Add Unit constructor from value and pure (valueless) Unit (#2628).
- Thanks @costerwi
-- Fix #2144: `examples/advanced/custom_loading.js` was broken.
-- Fix JSON `replacer` function missing in the TypeScript definitions.
- Thanks @mattvague.
-- Update dependencies to `typed-function@4.1.0` and `decimal.js@10.4.0`.
-
-2022-07-25, version 11.0.1 #
-
-- Fix #2632: TypeScript issue of `simplifyConstant` and `simplifyCore`
- not having a return type defined.
-
-2022-07-23, version 11.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES !!!
-
-Breaking changes:
-
-- Dropped official support for IE11.
-- Upgraded to `typed-function@3`, see [josdejong/typed-function/HISTORY.md](https://github.com/josdejong/typed-function/blob/develop/HISTORY.md#2022-05-12-version-300). Thanks @gwhitney. Most importantly:
- - Conversions now have preference over `any`.
- - The `this` variable is no longer bound to the typed function itself.
- - The properties `typed.types`, `typed.conversions`, and `typed.ignore`
- have been removed.
- - There are new static functions available like `typed.referTo`,
- `typed.referToSelf`, `typed.addTypes`, `typed.addConversions`.
-- Implement amended "Rule 2" for implicit multiplication (#2370, #2460):
- when having a division followed by an implicit multiplication, the division
- gets higher precedence over the implicit multiplication when (a) the
- numerator is a constant with optionally a prefix operator (`-`, `+`, `~`),
- and (b) the denominator is a constant. For example: formerly `-1 / 2 x` was
- interpreted as `-1 / (2 * x)` and now it is interpreted as `(-1 / 2) * x`.
- Thanks @gwhitney.
-- Drop elementwise matrix support for trigonometric functions, exp, log, gamma,
- square, sqrt, cube, and cbrt to prevent confusion with standard matrix
- functions (#2440, #2465). Instead, use `math.map(matrix, fn)`.
- Thanks @gwhitney.
-- Simplify: convert equivalent function calls into operators, for example,
- `add(2, x)` will now be simplified into `2 + x` (#2415, #2466).
- Thanks @gwhitney.
-- Removed the automatic conversion from `number` to `string` (#2482).
- Thanks @gwhitney.
-- Fix #2412: let function `diff` return an empty matrix when the input contains
- only one element (#2422).
-- Internal refactoring in the `simplifyCore` logic (#2490, #2484, #2459).
- The function `simplifyCore` will no longer (partially) merge constants, that
- behavior has been moved to `simplifyConstant`. The combination of
- `simplifyConstant` and `simplifyCore` is still close to the old behavior
- of `simplifyCore`, but there are some differences. To reproduce the same
- behavior as the old `simplifyCore`, you can use
- `math.simplify(expr, [math.simplifyCore, math.simplifyConstant])`.
- Thanks to the refactoring, `simplify` is more thorough in reducing constants.
- Thanks @gwhitney.
-- Disable support for splitting rest parameters in chained calculations
- (#2485, #2474). For example: `math.chain(3).max(4, 2).done()` will now throw
- an error rather than return `4`, because the rest parameter of
- `math.max(...number)` has been split between the contents of the chain and
- the arguments to the max call. Thanks @gwhitney.
-- Function `typeOf` now returns `function` (lowercase) for a function instead
- of `Function` (#2560). Thanks @gwhitney.
-
-Non-breaking changes:
-
-- Fix #2600: improve the TypeScript definitions of `simplify`.
- Thanks @laureen-m and @mattvague.
-- Fix #2607: improve type definition of `createUnit`. Thanks @egziko.
-- Fix #2608: clarify the docs on the need to configure a smaller `epsilon`
- when using BigNumbers.
-- Fix #2613: describe matrix methods `get` and `set` in the docs.
-- Fix link to `math.rationalize` in the docs (#2616). Thanks @nukisman.
-- Fix #2621: add TypeScript definitions for `count` (#2622). Thanks @Hansuku.
-- Improved TypeScript definitions of `multiply` (#2623). Thanks @Windrill.
-
-2022-06-28, version 10.6.4 #
-
-- Improve TypeScript definitions of the `factory` function, thanks @mattvague.
-
-2022-06-24, version 10.6.3 #
-
-- Revert the TypeScript definition fixes for `factory` applied in `v10.6.2`,
- they give some complications.
-
-2022-06-24, version 10.6.2 #
-
-- Improve TypeScript definitions of `ParenthesisNode`. Thanks @mattvague.
-- Change the TypeScript definition of `MathNodeCommon['type']` into a less
- strict string, so it is possible to extend with new Node classes.
- Thanks @mattvague.
-- Improve TypeScript definitions of the `factory` function, thanks @mattvague.
-
-2022-05-31, version 10.6.1 #
-
-- Improve the TypeScript types For `OperatorNode`: you can now define generic
- types like `OperatorNode<'+', 'add'>`. Thanks @mattvague.
-
-2022-05-24, version 10.6.0 #
-
-- Implementation of Fourier transform functions `fft` and `ifft` (#2540).
- Thanks @HanchaiN.
-- Fix TypeScript types not being listed in the exported fields (#2569).
- Thanks @mattvague.
-- Large improvements in TypeScript definitions for chained expressions (#2537).
- Thanks @mattvague.
-- Fix #2571: improve TypeScript definition of functions `clone` and `cloneDeep`
- (#2572). Thanks @mattvague.
-- Fix the first argument of `derivative` holding the expression not correctly
- being converted when using `.toTex()` (#2564). Thanks @mattvague.
-
-2022-05-11, version 10.5.3 #
-
-- Fix #2337: npm package containing examples and docs to solve security
- vulnerabilities being reported on the examples and their dependencies.
-- Fix core, construction, and some other functions missing in docs.
-- Drop official support for Node.js 12 which has reached its end of life.
-
-2022-05-09, version 10.5.2 #
-
-- Fix #2553: `@types/mocha` defined in `dependencies` instead of
- `devDependencies`, causing problems in projects that use a different version
- of this dependency. Thanks @Kolahzary.
-- Fix #2550: remove `examples/node_modules` folder from the npm package.
-- Fix #2528: improve contribution guidelines (#2548).
-- Document `SymbolNode.onUndefinedSymbol` and
- `FunctionNode.onUndefinedFunction`.
-
-2022-05-02, version 10.5.1 #
-
-- Fix #2526, #2529: improve TypeScript definitions of function `round`, `fix`,
- `floor`, `ceil`, and `nthRoot`, and improved the number only implementations
- of those functions (#2531, #2539). Thanks @simlaticak and @gwhitney.
-- Fix #2532: matrix index symbol `end` not working when used inside
- a sub-expression.
-- Fix #2524: In generating AUTHORS list, ignore a list of specific commits
- (e.g., to avoid spurious duplicates in list). (#2543)
-- Add type definitions of function `resolve` (#2536). Thanks @mattvague.
-
-2022-04-19, version 10.5.0 #
-
-- Implement #1563: function `pinv`, Moore–Penrose inverse (#2521).
- Thanks @HanchaiN.
-- Optimize function `det` for integers by switching to the Bareiss algorithm:
- no more round-off errors for integer input (#2516). Thanks @HanchaiN.
-- Implement #2463: allow negative integer powers of invertible square matrices
- (#2517). Thanks @HanchaiN.
-- Implement the `lgamma` function (defined as log(gamma(z))) for number and
- Complex types. Supersedes #320. (#2417). Thanks @yifanwww.
-- Fix #2523: update to the latest complex.js to improve `sin(z)` for small
- `im(z)` (#2525). Thanks @gwhitney.
-- Fix #2526: update TypeScript definition of `ceil` (#2531). Thanks @simlaticak
-- Change mocha reporter to 'dot' to avoid excessively long log files. (#2520)
-
-2022-04-08, version 10.4.3 #
-
-- Fix #2508: improve the precision of stirlingS2 (#2509). Thanks @gwhitney.
-- Fix #2514: implement optional argument `base` in the number implementation
- of function `log` (#2515). Thanks @gwhitney.
-- Improve the documentation on operator `;` (#2512). Thanks @gwhitney.
-
-2022-03-29, version 10.4.2 #
-
-- Fix #2499: different behavior for unit conversion "degC" and "K" (#2501).
- Also disables getting the sign for units with an offset, which is ambiguous.
- Thanks @gwhitney.
-- Fix #2503: fix an issue in `log()` for complex numbers in which the imaginary
- part is much larger in absolute value than the real part, fixed in
- `complex.js@2.1.0` (#2505), thanks @gwhitney, @infusion.
-- Fix #2493: unclear error message when an entity that is not a function
- is being called as a function (#2494). Thanks @gwhitney.
-- Some fixes in the docs on units (#2498). Thanks @dvd101x.
-- Add `forEach` example in embedded docs (#2507). Thanks @dvd101x.
-- Correct approx.deepEqual() to accept an epsilon argument giving the
- comparison tolerance. It was already being called this way, but was
- silently ignoring the tolerance. Thanks @yifanwww.
-
-2022-03-23, version 10.4.1 #
-
-- Improve TypeScript definitions for function `unit` (#2479).
- Thanks @SinanAkkoyun.
-- Add tests for type declarations (#2448). Thanks @samestep.
-- Further improvement to TypeScript definitions of `std` and `variance`
- (make dimension parameter optional, #2474). Thanks @NattapongSiri.
-- Next step (as per #2431) for full publication of "is" functions like
- `isMatrix` etc: Provide TypeScript definitions of "is" functions and
- make them type guards. (#2432). Thanks @ChristopherChudzicki.
-- Fix #2491: Multi line object expressions don't work with comments (#2492).
- Thanks @gwhitney.
-- Fix #2478: a bug in calculating the eigenvectors when dealing with complex
- numbers (#2496). Thanks @gwhitney.
-- Update project dependencies and devDependencies.
-
-2022-03-07, version 10.4.0 #
-
-- Fix #2461: make sure `simplifyCore` recurses over all binary nodes (#2462).
- Thanks @gwhitney.
-- Fix #2429: fix the TypeScript definitions of functions `std` and `variance`
- (#2455). Thanks @NattapongSiri.
-- Fix #1633: implement a `cumsum` function generating cumulative sums of a list
- of values or a matrix. (#1870). Thanks @hjonasson.
-- Upgrade to the latest version of `Fraction.js`, having more strict input,
- only accepting an integer numerator and denominator. See #2427.
-- Fix typo in documentation example for `format`. (#2468) Thanks @abranhe.
-- Write unit tests for all jsdoc examples. See #2452. Thanks @gwhitney.
-
-2021-03-02, version 10.3.0 #
-
-- Fix #1260: implement function `symbolicEqual` (#2424). Thanks @gwhitney.
-- Fix #2441, #2442: support passing a function as argument to functions created
- in the expression parser (#2443). Thanks @gwhitney.
-- Fix #2325: improve documentation of subset indices (#2446). Thanks @gwhitney.
-- Fix #2439: fix a bug in `complexEigs` in which real-valued norms were
- inadvertently being typed as complex numbers (#2445). Thanks @gwhitney.
-- Fix #2436: improve documentation and error message of function `map` (#2457).
- Thanks @gwhitney.
-
-2022-03-01, version 10.2.0 #
-
-- Implemented context options to control simplifications allowed in `simplify`,
- see #2399, #2391. Thanks @gwhitney.
-- Implemented function `leafCount` as a first simple measure of the complexity
- of an expression, see #2411, #2389. Thanks @gwhitney.
-- Fix #2413: improve `combinations` to return an integer result without rounding
- errors for larger values, see #2414. Thanks @gwhitney.
-- Fix #2385: function `rotate` missing in TypeScript definitions.
- Thanks @DIVYA-19.
-- Fix #2450: Add BigNumber to parameter type in `math.unit` and add TypeScript
- types for `Unit.simplify` and `Unit.units` (#2353). Thanks @joshhansen.
-- Fix #2383: detect infinite loops in `simplify` (#2405). Thanks @gwhitney.
-- Fix #1423: collect like factors and cancel like terms in sums (#2388).
- Thanks @gwhitney.
-
-2022-02-02, version 10.1.1 #
-
-- Improvements and fixes in function `simplify`, thanks @gwhitney:
- - Fix #2393: regression bug in `simplify('2-(x+1)')`.
- - Ad option `consoleDebug` to `simplify` to see what is going on.
-- Fix TypeScript definition of `ConfigOptions`, which was missing option
- `predictable`.
-
-2022-01-15, version 10.1.0 #
-
-- Implemented function `invmod`, see #2368, #1744. Thanks @thetazero.
-- Improvements and fixes in function `simplify`, thanks @gwhitney:
- - Fix #1179, #1290: improve collection of non-constant like terms (#2384).
- - Fix #2152: do not transform strings into numbers (#2372).
- - Fix #1913: implement support for array and object simplification (#2382).
-- Fix #2379: add embedded documentation for function `print`.
-- Remove broken example from the embedded documentation of function `forEach`.
-
-2021-12-29, version 10.0.2 #
-
-- Fix #2156: simplify expressions like `-1 / (-x)` to `1/x`. Thanks @ony3000.
-- Fix #2363: remove a redundant part of the regex to split a number.
-- Fix #2291: add support for fractions in function `intersect`.
- Thanks @thetazero.
-- Fix #2358: bug in `SparseMatrix` when replacing a subset of a matrix with
- a non-consecutive index. Thanks @Al-0.
-
-2021-12-22, version 10.0.1 #
-
-- Fix #1681: function `gamma` giving inaccurate complex results in some cases.
- Thanks @kmdrGroch.
-- Fixed a typo in an example, see #2366. Thanks @blackwindforce.
-
-2021-11-03, version 10.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES IN THE TYPESCRIPT DEFINITIONS !!!
-
-- Improvements to the Typescript typings (commit fc5c202e).
- Thanks @joshhansen. First introduced in v9.5.1, but reverted because
- it contains breaking changes.
-
- Breaking changes: interface `MathNode` is now renamed to `MathNodeCommon`
- and the related interfaces are structured in a different way.
-
-- Fixed a typo in the TypeScript definition of toHTML. Thanks @TheToto.
-
-2021-11-03, version 9.5.2` #
-
-- Revert the improvements to the Typescript typings because they contain
- breaking changes. The improvements will be published in v10.0.0. See #2339.
-
-2021-10-13, version 9.5.1 #
-
-- Various improvements to the Typescript typings.
- Thanks @joshhansen and @DianaTdr.
-
-2021-09-22, version 9.5.0 #
-
-- Implemented support for calculations with percentage, see #2303.
- Thanks @rvramesh.
-- Fix #2319: make the API of `Parser.evaluate` consistent with `math.evaluate`:
- support a list with expressions as input.
-- Improved documentation of function `setCartesian`. Thanks @fieldfoxWim.
-
-2021-09-15, version 9.4.5 #
-
-- Improved the performance of `Node.equals` by improving the internal
- function `deepStrictEqual`. Thanks @tomlarkworthy.
-- Fixes in the TypeScript definitions:
- - Define `hasNumericValue`. Thanks @write2kcl.
- - Define `MathNode.isRelationalNode`. Thanks @m93a.
- - Fix typo in `MathNode.isConditionalNode`. Thanks @m93a.
-
-2021-07-07, version 9.4.4 #
-
-- Fixed `ArrayNode.toTex()`: remove the row delimiter on the last row,
- see #2267. Thanks @davidtranhq.
-- Fix #2269: `intersect` not returning `null` for matrix input. Thanks @m93a.
-- Fix #2245: mathjs not working in IE11 anymore due to a missing polyfill for
- `Symbol`. The browser bundle now includes the necessary polyfills (it is
- larger now because of that, see also #2266). Thanks @m93a.
-- Update dependencies (`complex.js@2.0.15`, `decimal.js@10.3.1`)
-- Drop official support for node.js 10, which has reached end of life.
- See #2258.
-
-2021-06-23, version 9.4.3 #
-
-- Fix #2222: mathjs polluting the `Decimal` prototype. Thanks @m93a.
-- Fix #2253: expression parser throwing an error when accessing nested object
- properties named `e`.
-- Fixes in the TypeScript definitions:
- - function `floor`, #2159, #2246. Thanks @write2kcl.
- - function `simplify`, see #2252. Thanks @nitroin.
-- Upgraded to `decimal.js@10.3.0`
-
-2021-06-05, version 9.4.2 #
-
-- Implemented iterative eigenvalue finder for `eigs`, making it much more
- robust. See #2179, #2237. Thanks @m93a.
-- Improved TypeScript definitions of function `parse`. Thanks @OpportunityLiu.
-
-2021-05-24, version 9.4.1 #
-
-- Fix #2100: add TypeScript declaration for `eigs`. Thanks @andrebianchessi.
-- Fix #2220: add TypeScript files to published npm package. Thanks @dhritzkiv.
-- Update readme regarding TypeScript definition files. Thanks @dhritzkiv.
-- Update to `fraction.js@4.1.1`
-
-2021-05-16, version 9.4.0 #
-
-- Implemented support to use objects with a `Map` interface as scope,
- see #2143, #2166. Thanks @jhugman.
-- Extend `eigs` to support general complex matrices, see #1741. Thanks @m93a.
-- DenseMatrix and SparseMatrix are now iterable, see #1184. Thanks @m93a.
-- Implemented utility functions `matrixFromRows`, `matrixFromColumns`, and
- `matrixFromFunction`, see #2155, #2153. Thanks @m93a.
-- Added TypeScript definitions to the project, making it redundant to install
- `@types/mathjs`, and making it easier to improve the definitions. See #2187,
- #2192. Thanks @CatsMiaow.
-- Upgraded dependencies
- - `complex.js@2.0.13` (fixing #2211). Thanks @infusion
- - `fraction.js@4.1.0` (`pow` now supporting rational exponents).
-- Fix #2174: function `pickRandom` having no name. Thanks @HK-SHAO.
-- Fix #2019: VSCode auto import keeps adding import { null } from 'mathjs'.
-- Fix #2185: Fix TypeScript definition of unit division, which can also return
- a number.
-- Fix #2123: add type definitions for functions `row` and `column`.
-- Fix some files not exposed in the package, see #2213. Thanks @javiermarinros.
-
-2021-04-12, version 9.3.2 #
-
-- Fix #2169: mathjs requesting `@babel/runtime` dependency.
- Regression introduced in `v9.3.1`.
-
-2021-04-10, version 9.3.1 #
-
-- Fix #2133: strongly improved the performance of `isPrime`, see #2139.
- Thanks @Yaffle.
-- Fix #2150: give a clear error "Error: Undefined function ..." instead when
- evaluating a non-existing function.
-- Fix #660: expose internal functions `FunctionNode.onUndefinedFunction(name)`
- and `SymbolNode.onUndefinedSymbol(name)`, allowing to override the behavior.
- By default, an Error is thrown.
-
-2021-03-10, version 9.3.0 #
-
-- Implemented support for parsing non decimal numbers with radix point,
- see #2122, #2121. Thanks @clnhlzmn.
-- Fix #2128: typo in docs of `luSolveAll` and `usolveAll`.
-
-2021-02-03, version 9.2.0 #
-
-- Implemented function `count` to count the total elements in a matrix,
- see #2085. Thanks @Josef37.
-- Fix #2096: cleanup old reference to external dependency `crypto`.
-- Some refactoring in the code to remove duplications, see #2093.
- Thanks @Josef37.
-
-2021-01-27, version 9.1.0 #
-
-- Extended function `reshape` with support for a wildcard `-1` to automatically
- calculate the remaining size, like `reshape([1, 2, 3, 4, 5, 6], [-1, 2])`
- which will output `[[0, 1], [2, 3], [4, 5]]`. See #2075. Thanks @Josef37.
-- Fix #2087: function `simplify` ignores second argument of `log`, for example
- in `simplify('log(e, 9)')` . Thanks @quentintruong.
-
-2021-01-16, version 9.0.0 #
-
-- Improved support for bin, hex, and oct literals. See #1996. Thanks @clnhlzmn.
- - **Breaking change**: parse literals with prefixes `0b`, `0c`, and `0x` are
- now unsigned by default. To parse them as signed, you have to specify a
- suffix specifying the word size such as `i16` or `i32`.
- - Function `format` now supports more notations: `bin`, 'hex', and `oct`,
- for example `format(255, {notation: "hex"})`.
- - The functions `format`, `bin`, `hex`, `oct` now allow specifying a wordSize,
- like `bin(10, 32)` and `format(10, {notation: "bin", wordSize: 32})`.
- - BigNumber support for the bin, hex, and oct literals.
-- Extended and improved the example rocket_trajectory_optimization.html.
- Thanks @Josef37.
-
-2020-12-30, version 8.1.1 #
-
-- Improved the performance of parsing and evaluating units a lot, see #2065.
- Thanks @flaviut.
-- Upgraded dependency `fraction.js` to `v4.0.13`.
-- Moved continuous integration testing from Travis CI to Github Workflow,
- see #2024, #2041. Thanks @harrysarson.
-
-2020-12-04, version 8.1.0 #
-
-- Implemented units `kilogramforce` (`kgf`). Thanks @rnd-debug.
-- Fix #2026: Implement a new option `fractionsLimit` for function `simplify`,
- defaulting to `Infinity`.
-- Improved the documentation of function `clone`. Thanks @redbar0n.
-
-2020-11-09, version 8.0.1 #
-
-- Fix #1979: missing "subset" dependency when using "mathjs/number" entry point.
-- Fix #2022: update pretty printing with MathJax example to the latest version
- of MathJax. Thanks @pkra.
-
-2020-11-06, version 8.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES !!!
-
-- You can now use mathjs directly in node.js using ES modules without need for
- a transpiler (see #1928, #1941, #1962).
- Automatically loading either commonjs code or ES modules code is improved.
- All generated code is moved under `/lib`: the browser bundle is moved from
- `/dist` to `/lib/browser`, ES module files are moved to `/lib/esm`,
- and commonjs files are moved to `/lib/cjs`. Thanks @GreenImp.
-- Non-minified bundle `dist/math.js` is no longer provided. Either use the
- minified bundle, or create a bundle yourself.
-- Replaced random library `seed-random` with `seedrandom`, see #1955.
- Thanks @poppinlp.
-- Breaking changes in `pickRandom`, see #1990, #1976.
- - Will no longer return the input matrix when the given number is greater
- than the length of the provided possibles. Instead, the function always
- returns results with the requested number of picks.
- - Will now return a `Matrix` as output when input was a `Matrix`.
- - Introduced a new syntax:
-
- ```
- math.pickRandom(array, { weights, number, elementWise })
- ```
-
- - Introduced a new option `elementWise`, which is `true` by default.
- When setting `elementWise` to false, an array containing arrays will return
- random pick of arrays instead of the elements inside of the nested arrays.
-
-2020-11-02, version 7.6.0 #
-
-- Implemented function `rotate(w, theta)`. See #1992, #1160. Thanks @rnd-debug.
-- Implemented support for custom characters in Units via `Unit.isValidAlpha`.
- See #1663, #2000. Thanks @rnd-debug.
-
-2020-10-10, version 7.5.1 #
-
-- Fix object pollution vulnerability in `math.config`. Thanks Snyk.
-
-2020-10-07, version 7.5.0 #
-
-- Function `pickRandom` now allows randomly picking elements from matrices
- with 2 or more dimensions instead of only from a vector, see #1974.
- Thanks @KonradLinkowski.
-
-2020-10-07, version 7.4.0 #
-
-- Implemented support for passing a precision in functions `ceil`, `floor`,
- and `fix`, similar to `round`, see #1967, #1901. Thanks @rnd-debug.
-- Implemented function `rotationMatrix`, see #1160, #1984. Thanks @rnd-debug.
-- Implement a clear error message when using `sqrtm` with a matrix having
- more than two dimensions. Thanks @KonradLinkowski.
-- Update dependency `decimal.js` to `10.2.1`.
-
-2020-09-26, version 7.3.0 #
-
-- Implemented functions `usolveAll` and `lsolveAll`, see #1916. Thanks @m93a.
-- Implemented support for units in functions `std` and `variance`, see #1950.
- Thanks @rnd-debug.
-- Implemented support for binary, octal, and hexadecimal notation in the
- expression parser, and implemented functions `bin`, `oct`, and `hex` for
- formatting. Thanks @clnhlzmn.
-- Fix #1964: inconsistent calculation of negative dividend modulo for
- `BigNumber` and `Fraction`. Thanks @ovk.
-
-2020-08-24, version 7.2.0 #
-
-- Implemented new function `diff`, see #1634, #1920. Thanks @Veeloxfire.
-- Implemented support for norm 2 for matrices in function `norm`.
- Thanks @rnd-debug.
-
-2020-07-13, version 7.1.0 #
-
-- Implement support for recursion (self-referencing) of typed-functions,
- new in `typed-function@2.0.0`. This fixes #1885: functions which where
- extended with a new data type did not always work. Thanks @nickewing.
-- Fix #1899: documentation on expression trees still using old namespace
- `math.expression.node.*` instead of `math.*`.
-
-2020-06-24, version 7.0.2 #
-
-- Fix #1882: have `DenseMatrix.resize` and `SparseMatrix.resize` accept
- `DenseMatrix` and `SparseMatrix` as inputs too, not only `Array`.
-- Fix functions `sum`, `prod`, `min`, and `max` not throwing a conversion error
- when passing a single string, like `sum("abc")`.
-
-2020-05-30, version 7.0.1 #
-
-- Fix #1844: clarify the documentation of function `eigs`. Thanks @Lazersmoke.
-- Fix #1855: Fix error in the documentation for `math.nthRoots(x)`.
-- Fix #1856: make the library robust against Object prototype pollution.
-
-2020-05-07, version 7.0.0 #
-
-Breaking changes:
-
-- Improvements in calculation of the `dot` product of complex values.
- The first argument is now conjugated. See #1761. Thanks @m93a.
-- Dropped official support for Node.js v8 which has reached end of life.
-- Removed all deprecation warnings introduced in v6.
- To upgrade smoothly from v5 to v7 or higher, upgrade to v6 first
- and resolve all deprecation warnings.
-
-2020-05-04, version 6.6.5 #
-
-- Fix #1834: value `Infinity` cannot be serialized and deserialized.
- This is solved now with a new `math.replacer` function used as
- `JSON.stringify(value, math.replacer)`.
-- Fix #1842: value `Infinity` not turned into the latex symbol `\\infty`.
-
-2020-04-15, version 6.6.4 #
-
-- Fix published files containing Windows line endings (CRLF instead of LF).
-
-2020-04-10, version 6.6.3 #
-
-- Fix #1813: bug in engineering notation for numbers of function `format`,
- sometimes resulting in needless trailing zeros.
-- Fix #1808: methods `.toNumber()` and `.toNumeric()` not working on a
- unitless unit.
-- Fix #1645: not being able to use named operators `mod`, `and`, `not`, `or`,
- `xor`, `to`, `in` as object keys. Thanks @Veeloxfire.
-- Fix `eigs` not using `config.epsilon`.
-
-2020-03-29, version 6.6.2 #
-
-- Fix #1789: Function `eigs` not calculating with BigNumber precision
- when input contains BigNumbers.
-- Run the build script during npm `prepare`, so you can use the library
- directly when installing directly from git. See #1751. Thanks @cinderblock.
-
-2020-02-26, version 6.6.1 #
-
-- Fix #1725: simplify `a/(b/c)`. Thanks @dbramwell.
-- Fix examples in documentation of `row` and `column`.
-
-2020-02-01, version 6.6.0 #
-
-- Implemented function `eigs`, see #1705, #542 #1175. Thanks @arkajitmandal.
-- Fixed #1727: validate matrix size when creating a `DenseMatrix` using
- `fromJSON`.
-- Fixed `DenseMatrix.map` copying the size and datatype from the original
- matrix instead of checking the returned dimensions and type of the callback.
-- Add a caret to dependencies (like) `^1.2.3`) to allow downstream updates
- without having to await a new release of mathjs.
-
-2020-01-08, version 6.5.0 #
-
-- Implemented `baseName` option for `createUnit`, see #1707.
- Thanks @ericman314.
-
-2020-01-06, version 6.4.0 #
-
-- Extended function `dimension` with support for n-dimensional points.
- Thanks @Veeloxfire.
-
-2019-12-31, version 6.3.0 #
-
-- Improved performance of `factorial` for `BigNumber` up to a factor two,
- see #1687. Thanks @kmdrGroch.
-
-2019-11-20, version 6.2.5 #
-
-- Fixed `IndexNode` using a hardcoded, one-based implementation of `index`,
- making it impossible to instantiate a zero-based version of the expression
- parser. See #782.
-
-2019-11-20, version 6.2.4 #
-
-- Fixed #1669: function 'qr' threw an error if the pivot was zero,
- thanks @kevinkelleher12 and @harrysarson.
-- Resolves #942: remove misleading assert in 'qr'. Thanks @harrysarson.
-- Work around a bug in complex.js where `sign(0)` returns complex NaN.
- Thanks @harrysarson.
-
-2019-10-06, version 6.2.3 #
-
-- Fixed #1640: function `mean` not working for units. Thanks @clintonc.
-- Fixed #1639: function `min` listed twice in the "See also" section of the
- embedded docs of function `std`.
-- Improved performance of `isPrime`, see #1641. Thanks @arguiot.
-
-2019-09-23, version 6.2.2 #
-
-- Fixed methods `map` and `clone` not copying the `dotNotation` property of
- `IndexNode`. Thanks @rianmcguire.
-- Fixed a typo in the documentation of `toHTML`. Thanks @maytanthegeek.
-- Fixed #1615: error in the docs of `isNumeric`.
-- Fixed #1628: Cannot call methods on empty strings or numbers with value `0`.
-
-2019-08-31, version 6.2.1 #
-
-- Fixed #1606: function `format` not working for expressions.
-
-2019-08-28, version 6.2.0 #
-
-- Improved performance of `combinationsWithRep`. Thanks @waseemyusuf.
-- Add unit aliases `bit` and `byte`.
-- Fix docs referring to `bit` and `byte` instead of `bits` and `bytes`.
-- Updated dependency `typed-function@1.1.1`.
-
-2019-08-17, version 6.1.0 #
-
-- Implemented function `combinationsWithRep` (see #1329). Thanks @waseemyusuf.
-
-2019-08-05, version 6.0.4 #
-
-- Fixed #1554, #1565: ES Modules where not transpiled to ES5, giving issues on
- old browsers. Thanks @mockdeep for helping to find a solution.
-
-2019-07-07, version 6.0.3 #
-
-- Add `unpkg` and `jsdelivr` fields in package.json pointing to UMD build.
- Thanks @tmcw.
-- Fix #1550: nested user defined function not receiving variables of an
- outer user defined function.
-
-2019-06-11, version 6.0.2 #
-
-- Fix not being able to set configuration after disabling function `import`
- (regression since v6.0.0).
-
-2019-06-09, version 6.0.1 #
-
-- Fix function reference not published in npm library.
-- Fix function `evaluate` and `parse` missing in generated docs.
-
-2019-06-08, version 6.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES !!!
-
-Most notable changes #
-
-1. Full support for **ES modules**. Support for tree-shaking out of the box.
-
- Load all functions:
-
- ```js
- import * as math from 'mathjs'
- ```
-
- Use a few functions:
-
- ```js
- import { add, multiply } from 'mathjs'
- ```
-
- Load all functions with custom configuration:
-
- ```js
- import { create, all } from 'mathjs'
- const config = { number: 'BigNumber' }
- const math = create(all, config)
- ```
-
- Load a few functions with custom configuration:
-
- ```js
- import { create, addDependencies, multiplyDependencies } from 'mathjs'
- const config = { number: 'BigNumber' }
- const { add, multiply } = create({
- addDependencies,
- multiplyDependencies
- }, config)
- ```
-
-2. Support for **lightweight, number-only** implementations of all functions:
-
- ```
- import { add, multiply } from 'mathjs/number'
- ```
-
-3. New **dependency injection** solution used under the hood.
-
-Breaking changes #
-
-- Node 6 is no longer supported.
-
-- Functions `config` and `import` are not available anymore in the global
- context:
-
- ```js
- // v5
- import * as mathjs from 'mathjs'
- mathjs.config(...) // error in v6.0.0
- mathjs.import(...) // error in v6.0.0
- ```
-
- Instead, create your own mathjs instance and pass config and imports
- there:
-
- ```js
- // v6
- import { create, all } from 'mathjs'
- const config = { number: 'BigNumber' }
- const mathjs = create(all, config)
- mathjs.import(...)
- ```
-
-- Renamed function `typeof` to `typeOf`, `var` to `variance`,
- and `eval` to `evaluate`. (the old function names are reserved keywords
- which can not be used as a variable name).
-- Deprecated the `Matrix.storage` function. Use `math.matrix` instead to create
- a matrix.
-- Deprecated function `math.expression.parse`, use `math.parse` instead.
- Was used before for example to customize supported characters by replacing
- `math.parse.isAlpha`.
-- Moved all classes like `math.type.Unit` and `math.expression.Parser` to
- `math.Unit` and `math.Parser` respectively.
-- Fixed #1428: transform iterating over replaced nodes. New behavior
- is that it stops iterating when a node is replaced.
-- Dropped support for renaming factory functions when importing them.
-- Dropped fake BigNumber support of function `erf`.
-- Removed all index.js files used to load specific functions instead of all, like:
-
- ```
- // v5
- // ... set up empty instance of mathjs, then load a set of functions:
- math.import(require('mathjs/lib/function/arithmetic'))
- ```
-
- Individual functions are now loaded simply like:
-
- ```js
- // v6
- import { add, multiply } from 'mathjs'
- ```
-
- To set a specific configuration on the functions:
-
- ```js
- // v6
- import { create, addDependencies, multiplyDependencies } from 'mathjs'
- const config = { number: 'BigNumber' }
- const math = create({ addDependencies, multiplyDependencies }, config)
- ```
-
- See example `advanced/custom_loading.js`.
-
-- Updated the values of all physical units to their latest official values.
- See #1529. Thanks @ericman314.
-
-Non breaking changes #
-
-- Implemented units `t`, `tonne`, `bel`, `decibel`, `dB`, and prefixes
- for `candela`. Thanks @mcvladthegoat.
-- Fixed `epsilon` setting being applied globally to Complex numbers.
-- Fix `math.simplify('add(2, 3)')` throwing an error.
-- Fix #1530: number formatting first applied `lowerExp` and `upperExp`
- and after that rounded the value instead of the other way around.
-- Fix #1473: remove `'use strict'` in every file, not needed anymore.
-
-2019-05-18, version 5.10.3 #
-
-- Fixed dependency `del` being a dependency instead of devDependency.
-
-2019-05-18, version 5.10.2 #
-
-- Fix #1515, #1516, #1517: broken package due to a naming conflict in
- the build folder of a util file `typeOf.js` and `typeof.js`.
- Solved by properly cleaning all build folders before building.
-
-2019-05-17, version 5.10.1 #
-
-- Fix #1512: format using notation `engineering` can give wrong results
- when the value has less significant digits than the number of digits in
- the output.
-
-2019-05-08, version 5.10.0 #
-
-- Fix `lib/header.js` not having filled in date and version. Thanks @kevjin.
-- Upgraded dependency `decimal.js@10.2.0`, fixing an issue on node.js 12.
-
-2019-04-08, version 5.9.0 #
-
-- Implemented functions `row` and `column` (see #1413). Thanks @SzechuanSage.
-- Fixed #1459: `engineering` notation of function `format` not available
- for `BigNumber`.
-- Fixed #1465: `node.toHTML()` not correct for unary operators like
- `factorial`.
-
-2019-03-20, version 5.8.0 #
-
-- Implemented new function `apply`. Thanks @bnlcas.
-- Implemented passing an optional `dimension` argument to `std` and `var`.
- Thanks @bnlcas.
-
-2019-03-10, version 5.7.0 #
-
-- Implemented support for `pow()` in `derivative`. Thanks @sam-19.
-- Gracefully handle round-off errors in fix, ceil, floor, and range
- (Fixes #1429, see also #1434, #1432). Thanks @ericman314.
-
-2019-03-02, version 5.6.0 #
-
-- Upgrade decimal.js to v10.1.1 (#1421).
-- Fixed #1418: missing whitespace when stringifying an expression
- containing "not".
-
-2019-02-20, version 5.5.0 #
-
-- Fixed #1401: methods `map` and `forEach` of `SparseMatrix` not working
- correctly when indexes are unordered.
-- Fixed #1404: inconsistent rounding of negative numbers.
-- Upgrade tiny-emitter to v2.1.0 (#1397).
-
-2019-01-25, version 5.4.2 #
-
-- Fixed `math.format` not working for BigNumbers with a precision above
- 1025 digits (see #1385). Thanks @ericman314.
-- Fixed incorrect LaTeX output of `RelationalNode`. Thanks @rianmcguire.
-- Fixed a bug the methods `map`, `forEach`, `traverse`, and `transform`
- of `FunctionNode`.
-
-2019-01-10, version 5.4.1 #
-
-- Fix #1378: negative bignumbers not formatted correctly.
-- Upgrade fraction.js to version 4.0.12 (#1369).
-
-2018-12-09, version 5.4.0 #
-
-- Extended sum.js to accept a dimension input to calculate the sum over a
- specific axis. Thanks @bnlcas.
-- Fix #1328: objects can't be written multi-line. Thanks @GHolk.
-- Remove side effects caused by `Unit.format` and `Unit.toString`,
- making changes to the unit on execution. Thanks @ericman314.
-
-2018-12-03, version 5.3.1 #
-
-- Fixed #1336: Unit.toSI() returning units with prefix like `mm` instead
- of `m`. Thanks @ericman314.
-
-2018-11-29, version 5.3.0 #
-
-- Implemented function `hasNumericValue`. Thanks @Sathish-kumar-Subramani.
-- Fix #1326: non-ascii character in print.js.
-- Fix #1337: `math.format` not working correctly with `{ precision: 0 }`.
- Thanks @dkenul.
-
-2018-10-30, version 5.2.3 #
-
-- Fixed #1293: non-unicode characters in `escape-latex` giving issues in some
- specific cases. Thanks @dangmai.
-- Fixed incorrect LaTeX output of function `bitNot`, see #1299. Thanks @FSMaxB.
-- Fixed #1304: function `pow` not supporting inputs `pow(Unit, BigNumber)`.
-- Upgraded dependencies (`escape-latex@1.2.0`)
-
-2018-10-23, version 5.2.2 #
-
-- Fixed #1286: Fixed unit base recognition and formatting for
- user-defined units. Thanks @ericman314.
-
-2018-10-18, version 5.2.1 #
-
-- Fixed unit `rod` being defined as `5.02921` instead of `5.0292`.
- Thanks @ericman314.
-- Upgraded dependencies (`fraction.js@4.0.10`)
-- Upgraded devDependencies (`@babel/core@7.1.2`, `nyc@13.1.0`,
- `webpack@4.21.0`).
-
-2018-10-05, version 5.2.0 #
-
-- Implemented support for chained conditionals like `10 < x <= 50`.
- Thanks @ericman314.
-- Add an example showing a proof of concept of using `BigInt` in mathjs.
-- Fixed #1269: Bugfix for BigNumber divided by unit. Thanks @ericman314.
-- Fixed #1240: allow units having just a value and no unit.
- Thanks @ericman314.
-
-2018-09-09, version 5.1.2 #
-
-- Fixed a typo in the docs of `parse`. Thanks @mathiasvr.
-- Fixed #1222: a typo in the docs of `subset`.
-- Fixed #1236: `quantileSeq` has inconsistent return.
-- Fixed #1237: norm sometimes returning a complex number instead of
- number.
-- Upgraded dependencies (`fraction.js@4.0.9`)
-- Upgraded devDependencies (`babel@7`, `karma-webpack@3.0.4`,
- `nyc@13.0.1`, `standard@12.0.0`, `uglify-js@3.4.9`, `webpack@4.17.2`)
-
-2018-08-21, version 5.1.1 #
-
-- Function `isNumeric` now recognizes more types.
-- Fixed #1214: functions `sqrt`, `max`, `min`, `var`, `std`, `mode`, `mad`,
- `median`, and `partitionSelect` not neatly handling `NaN` inputs. In some
- cases (`median`, `mad`, and `partitionSelect`) this resulted in an infinite
- loop.
-- Upgraded dependencies (`escape-latex@1.1.1`)
-- Upgraded devDependencies (`webpack@4.17.0`)
-
-2018-08-12, version 5.1.0 #
-
-- Implemented support for strings enclosed in single quotes.
- Thanks @jean-emmanuel.
-- Implemented function `getMatrixDataType`. Thanks @JasonShin.
-- Implemented new `options` argument in `simplify`. Thanks @paulobuchsbaum.
-- Bug fixes in `rationalize`, see #1173. Thanks @paulobuchsbaum.
-
-2018-07-22, version 5.0.4 #
-
-- Strongly improved the performance of functions `factorial` for numbers.
- This improves performance of functions `gamma`, `permutation`, and
- `combination` too. See #1170. Thanks @honeybar.
-- Strongly improved the performance of function `reshape`, thanks to a
- friend of @honeybar.
-
-2018-07-14, version 5.0.3 #
-
-- Fixed many functions (for example `add` and `subtract`) not working
- with matrices having a `datatype` defined.
-- Fixed #1147: bug in `format` with `engineering` notation in outputting
- the correct number of significant figures. Thanks @ericman314.
-- Fixed #1162: transform functions not being cleaned up when overriding
- it by importing a factory function with the same name.
-- Fixed broken links in the documentation. Thanks @stropitek.
-- Refactored the code of `parse` into a functional approach.
- Thanks @harrysarson.
-- Changed `decimal.js` import to ES6. Thanks @weinshel.
-
-2018-07-07, version 5.0.2 #
-
-- Fixed #1136: rocket trajectory example broken (since v4.0.0).
-- Fixed #1137: `simplify` unnecessarily replacing implicit multiplication with
- explicit multiplication.
-- Fixed #1146: `rationalize` throwing exceptions for some input with decimals.
- Thanks @maruta.
-- Fixed #1088: function arguments not being passed to `rawArgs` functions.
-- Fixed advanced example `add_new_datatypes`.
-- Fixed mathjs core constants not working without complex numbers.
- Thanks @ChristopherChudzicki.
-- Fixed a broken link in the documentation on units. Thanks @stropitek.
-- Upgraded dependencies (`typed-function@1.0.4`, `complex.js@2.0.11`).
-- Upgraded devDependencies (`babel-loader@7.1.5`, `uglify-js@3.4.3`,
- `expr-eval@1.2.2`, `webpack@4.15.1`).
-
-2018-07-01, version 5.0.1 #
-
-- Improved error messaging when converting units. Thanks @gap777.
-- Upgraded devDependencies (`kerma`, `uglify-js`, `webpack`).
-
-2018-06-16, version 5.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES !!!
-
-- Implemented complex conjugate transpose `math.ctranspose`. See #1097.
- Thanks @jackschmidt.
-- Changed the behavior of `A'` (transpose) in the expression parser to
- calculate the complex conjugate transpose. See #1097. Thanks @jackschmidt.
-- Added support for `complex({abs: 1, arg: 1})`, and improved the docs on
- complex numbers. Thanks @ssaket.
-- Renamed `eye` to `identity`, see #1054.
-- Math.js code can now contain ES6. The ES6 source code is moved from `lib`
- to `src`, and `lib` now contains the compiled ES5 code.
-- Upgraded dependencies:
- - `decimal.js` from `9.0.1` to `10.0.1`
- - Upgraded dev dependencies
-- Changed code style to , run linter on `npm test`.
- See #1110.
-- Dropped support for bower. Use npm or an other package manages instead.
-- Dropped support for (non-primitive) instances of `Number`, `Boolean`, and
- `String` from functions `clone` and `typeof`.
-- Dropped official support for IE9 (probably still works, but it's not tested).
-- Fixed #851: More consistent behavior of sqrt, nthRoot, and pow.
- Thanks @dakotablair.
-- Fixed #1103: Calling `toTex` on node that contains `derivative` causing
- an exception. Thanks @joelhoover.
-
-2018-06-02, version 4.4.2 #
-
-- Drastically improved the performance of `det`. Thanks @ericman314.
-- Fixed #1065, #1121: Fixed wrong documentation of function
- `compareNatural` and clarified the behavior for strings.
-- Fixed #1122 a regression in function `inv` (since `v4.4.1`).
- Thanks @ericman314.
-
-2018-05-29, version 4.4.1 #
-
-- Fixed #1109: a bug in `inv` when dealing with values close to zero.
- Thanks @ericman314.
-
-2018-05-28, version 4.4.0 #
-
-- Implemented functions `equalText` and `compareText`. See #1085.
-
-2018-05-21, version 4.3.0 #
-
-- Implemented matrix exponential `math.expm`. Thanks @ericman314.
-- Fixed #1101: math.js bundle not working when loading in a WebWorker.
-- Upgraded dependencies
- - `complex.js` from `v2.0.2` to `v2.0.10`.
- - `fraction.js` from `v4.0.4` to `v4.0.8`.
-- Upgraded devDependencies (`mocha`, `uglify-js`, `webpack`).
-
-2018-05-05, version 4.2.2 #
-
-- Fixed calculating the Frobenius norm of complex matrices correctly,
- see #1098. Thanks @jackschmidt.
-- Fixed #1076: cannot use mathjs in React VR by updating to
- `escape-latex@1.0.3`.
-
-2018-05-02, version 4.2.1 #
-
-- Fixed `dist/math.js` being minified.
-
-2018-05-02, version 4.2.0 #
-
-- Implemented function `math.sqrtm`. Thanks @ferrolho.
-- Implemented functions `math.log2`, `math.log1p`, and `math.expm1`.
- Thanks @BigFav and @harrysarson.
-- Fixed some unit tests broken on nodejs v10.
-- Upgraded development dependencies.
-- Dropped integration testing on nodejs v4.
-
-2018-04-18, version 4.1.2 #
-
-- Fixed #1082: implemented support for unit plurals `decades`, `centuries`,
- and `millennia`.
-- Fixed #1083: units `decade` and `watt` having a wrong name when stringifying.
- Thanks @ericman314.
-
-2018-04-11, version 4.1.1 #
-
-- Fixed #1063: derivative not working when resolving a variable with unary
- minus like `math.derivative('-x', 'x')`.
-
-2018-04-08, version 4.1.0 #
-
-- Extended function `math.print` with support for arrays and matrices.
- Thanks @jean-emmanuel.
-- Fixed #1077: Serialization/deserialization to JSON with reviver not being
- supported by nodes.
-- Fixed #1016: Extended `math.typeof` with support for `ResultSet` and nodes
- like `SymbolNode`.
-- Fixed #1072: Added support for long and short prefixes for the unit `bar`
- (i.e. `millibar` and `mbar`).
-
-2018-03-17, version 4.0.1 #
-
-- Fixed #1062: mathjs not working on ES5 browsers like IE11 and Safari 9.3.
-- Fixed #1061: `math.unit` not accepting input like `1/s`.
-
-2018-02-25, version 4.0.0 #
-
-!!! BE CAREFUL: BREAKING CHANGES !!!
-
-Breaking changes (see also #682):
-
-- **New expression compiler**
-
- The compiler of the expression parser is replaced with one that doesn't use
- `eval` internally. See #1019. This means:
-
- - a slightly improved performance on most browsers.
- - less risk of security exploits.
- - the code of the new compiler is easier to understand, maintain, and debug.
-
- Breaking change here: When using custom nodes in the expression parser,
- the syntax of `_compile` has changed. This is an undocumented feature though.
-
-- **Parsed expressions**
-
- - The class `ConstantNode` is changed such that it just holds a value
- instead of holding a stringified value and it's type.
- `ConstantNode(valueStr, valueType`) is now `ConstantNode(value)`
- Stringification uses `math.format`, which may result in differently
- formatted numeric output.
-
- - The constants `true`, `false`, `null`, `undefined`, `NaN`, `Infinity`,
- and `uninitialized` are now parsed as ConstantNodes instead of
- SymbolNodes in the expression parser. See #833.
-
-- **Implicit multiplication**
-
- - Changed the behavior of implicit multiplication to have higher
- precedence than explicit multiplication and division, except in
- a number of specific cases. This gives a more natural behavior
- for implicit multiplications. For example `24h / 6h` now returns `4`,
- whilst `1/2 kg` evaluates to `0.5 kg`. Thanks @ericman314. See: #792.
- Detailed documentation: .
-
- - Immediately invoking a function returned by a function like `partialAdd(2)(3)`
- is no longer supported, instead these expressions are evaluated as
- an implicit multiplication `partialAdd(2) * (3)`. See #1035.
-
-- **String formatting**
-
- - In function `math.format`, the options `{exponential: {lower: number, upper: number}}`
- (where `lower` and `upper` are values) are replaced with `{lowerExp: number, upperExp: number}`
- (where `lowerExp` and `upperExp` are exponents). See #676. For example:
-
- ```js
- math.format(2000, {exponential: {lower: 1e-2, upper: 1e2}})
- ```
-
- is now:
-
- ```js
- math.format(2000, {lowerExp: -2, upperExp: 2})
- ```
-
- - In function `math.format`, the option `notation: 'fixed'` no longer rounds to
- zero digits when no precision is specified: it leaves the digits as is.
- See #676.
-
-- **String comparison**
-
- Changed the behavior of relational functions (`compare`, `equal`,
- `equalScalar`, `larger`, `largerEq`, `smaller`, `smallerEq`, `unequal`)
- to compare strings by their numeric value they contain instead of
- alphabetically. This also impacts functions `deepEqual`, `sort`, `min`,
- `max`, `median`, and `partitionSelect`. Use `compareNatural` if you
- need to sort an array with text. See #680.
-
-- **Angle units**
-
- Changed `rad`, `deg`, and `grad` to have short prefixes,
- and introduced `radian`, `degree`, and `gradian` and their plurals
- having long prefixes. See #749.
-
-- **Null**
-
- - `null` is no longer implicitly casted to a number `0`, so input like
- `math.add(2, null)` is no longer supported. See #830, #353.
-
- - Dropped constant `uninitialized`, which was used to initialize
- leave new entries undefined when resizing a matrix is removed.
- Use `undefined` instead to indicate entries that are not explicitly
- set. See #833.
-
-- **New typed-function library**
-
- - The `typed-function` library used to check the input types
- of functions is completely rewritten and doesn't use `eval` under
- the hood anymore. This means a reduced security risk, and easier
- to debug code. The API is the same, but error messages may differ
- a bit. Performance is comparable but may differ in specific
- use cases and browsers.
-
-Non breaking changes:
-
-- Thanks to the new expression compiler and `typed-function` implementation,
- mathjs doesn't use JavaScript's `eval` anymore under the hood.
- This allows using mathjs in environments with security restrictions.
- See #401.
-- Implemented additional methods `isUnary()` and `isBinary()` on
- `OperatorNode`. See #1025.
-- Improved error messages for statistical functions.
-- Upgraded devDependencies.
-- Fixed #1014: `derivative` silently dropping additional arguments
- from operator nodes with more than two arguments.
-
-2018-02-07, version 3.20.2 #
-
-- Upgraded to `typed-function@0.10.7` (bug-fix release).
-- Fixed option `implicit` not being copied from an `OperatorNode`
- when applying function `map`. Thanks @HarrySarson.
-- Fixed #995: spaces and underscores not property being escaped
- in `toTex()`. Thanks @FSMaxB.
-
-2018-01-17, version 3.20.1 #
-
-- Fixed #1018: `simplifyCore` failing in some cases with parentheses.
- Thanks @firepick1.
-
-2018-01-14, version 3.20.0 #
-
-- Implement support for 3 or more arguments for operators `+` and `*` in
- `derivative`. Thanks @HarrySarson. See #1002.
-- Fixed `simplify` evalution of `simplify` of functions with more than two
- arguments wrongly: `simplify('f(x, y, z)') evaluated to`f(f(x, y), z)`
- instead of `f(x, y, z)`. Thanks @joelhoover.
-- Fixed `simplify` throwing an error in some cases when simplifying unknown
- functions, for example `simplify('f(4)')`. Thanks @joelhoover.
-- Fixed #1013: `simplify` wrongly simplifing some expressions containing unary
- minus, like `0 - -x`. Thanks @joelhoover.
-- Fixed an error in an example in the documentation of `xor`. Thanks @denisx.
-
-2018-01-06, version 3.19.0 #
-
-- Extended functions `distance` and `intersect` with support for BigNumbers.
- Thanks @ovk.
-- Improvements in function `simplify`: added a rule that allows combining
- of like terms in embedded quantities. Thanks @joelhoover.
-
-2017-12-28, version 3.18.1 #
-
-- Fixed #998: An issue with simplifying an expression containing a subtraction.
- Thanks @firepick1.
-
-2017-12-16, version 3.18.0 #
-
-- Implemented function `rationalize`. Thanks @paulobuchsbaum.
-- Upgraded dependencies:
-
- ```
- decimal.js 7.2.3 → 9.0.1 (no breaking changes affecting mathjs)
- fraction.js 4.0.2 → 4.0.4
- tiny-emitter 2.0.0 → 2.0.2
- ```
-
-- Upgraded dev dependencies.
-- Fixed #975: a wrong example in the docs of lusolve.
-- Fixed #983: `pickRandom` returning an array instead of single value
- when input was an array with just one value. Clarified docs.
-- Fixed #969: preven issues with yarn autoclean by renaming an
- interally used folder "docs" to "embeddedDocs".
-
-2017-11-18, version 3.17.0 #
-
-- Improved `simplify` for nested exponentiations. Thanks @IvanVergiliev.
-- Fixed a security issue in `typed-function` allowing arbitrary code execution
- in the JavaScript engine by creating a typed function with JavaScript code
- in the name. Thanks Masato Kinugawa.
-- Fixed a security issue where forbidden properties like constructor could be
- replaced by using unicode characters when creating an object. No known exploit,
- but could possibly allow arbitrary code execution. Thanks Masato Kinugawa.
-
-2017-10-18, version 3.16.5 #
-
-- Fixed #954: Functions `add` and `multiply` not working when
- passing three or more arrays or matrices.
-
-2017-10-01, version 3.16.4 #
-
-- Fixed #948, #949: function `simplify` returning wrong results or
- running into an infinite recursive loop. Thanks @ericman314.
-- Fixed many small issues in the embedded docs. Thanks @Schnark.
-
-2017-08-28, version 3.16.3 #
-
-- Fixed #934: Wrong simplification of unary minus. Thanks @firepick1.
-- Fixed #933: function `simplify` reordering operations. Thanks @firepick1.
-- Fixed #930: function `isNaN` returning wrong result for complex
- numbers having just one of their parts (re/im) being `NaN`.
-- Fixed #929: `FibonacciHeap.isEmpty` returning wrong result.
-
-2017-08-20, version 3.16.2 #
-
-- Fixed #924: a regression in `simplify` not accepting the signature
- `simplify(expr, rules, scope)` anymore. Thanks @firepick1.
-- Fixed missing parenthesis when stringifying expressions containing
- implicit multiplications (see #922). Thanks @FSMaxB.
-
-2017-08-12, version 3.16.1 #
-
-- For security reasons, type checking is now done in a more strict
- way using functions like `isComplex(x)` instead of duck type checking
- like `x && x.isComplex === true`.
-- Fixed #915: No access to property "name".
-- Fixed #901: Simplify units when calling `unit.toNumeric()`.
- Thanks @AlexanderBeyn.
-- Fixed `toString` of a parsed expression tree containing an
- immediately invoked function assignment not being wrapped in
- parenthesis (for example `(f(x) = x^2)(4)`).
-
-2017-08-06, version 3.16.0 #
-
-- Significant performance improvements in `math.simplify`.
- Thanks @firepick1.
-- Improved API for `math.simplify`, optionally pass a scope with
- variables which are resolved, see #907. Thanks @firepick1.
-- Fixed #912: math.js didn't work on IE10 anymore (regression
- since 3.15.0).
-
-2017-07-29, version 3.15.0 #
-
-- Added support for the dollar character `$` in symbol names (see #895).
-- Allow objects with prototypes as scope again in the expression parser,
- this was disabled for security reasons some time ago. See #888, #899.
- Thanks @ThomasBrierley.
-- Fixed #846: Issues in the functions `map`, `forEach`, and `filter`
- when used in the expression parser:
- - Not being able to use a function assignment as inline expression
- for the callback function.
- - Not being able to pass an inline expression as callback for `map`
- and `forEach`.
- - Index and original array/matrix not passed in `map` and `filter`.
-
-2017-07-05, version 3.14.2 #
-
-- Upgraded to `fraction.js@4.0.2`
-- Fixed #891 using BigNumbers not working in browser environments.
-
-2017-06-30, version 3.14.1 #
-
-- Reverted to `fraction.js@4.0.0`, there is an issue with `4.0.1`
- in the browser.
-
-2017-06-30, version 3.14.0 #
-
-- Implemented set methods `setCartesian`, `setDifference`,
- `setDistinct`, `setIntersect`, `setIsSubset`, `setPowerset`,
- `setSize`. Thanks @Nekomajin42.
-- Implemented method `toHTML` on nodes. Thanks @Nekomajin42.
-- Implemented `compareNatural` and `sort([...], 'natural')`.
-- Upgraded dependencies to the latest versions:
- - `complex.js@2.0.4`
- - `decimal.js@7.2.3`
- - `fraction.js@4.0.1`
- - `tiny-emitter@2.0.0`
- - And all devDependencies.
-- Fixed #865: `splitUnit` can now deal with round-off errors.
- Thanks @ericman314.
-- Fixed #876: incorrect definition for unit `erg`. Thanks @pjhampton.
-- More informative error message when using single quotes instead of
- double quotes around a string. Thanks @HarrySarson.
-
-2017-05-27, version 3.13.3 #
-
-- Fixed a bug in function `intersection` of line and plane.
- Thanks @viclai.
-- Fixed security vulnerabilities.
-
-2017-05-26, version 3.13.2 #
-
-- Disabled function `chain` inside the expression parser for security
- reasons (it's not needed there anyway).
-- Fixed #856: function `subset` not returning non-primitive scalars
- from Arrays correctly. (like `math.eval('arr[1]', {arr: [math.bignumber(2)]})`.
-- Fixed #861: physical constants not available in the expression parser.
-
-2017-05-12, version 3.13.1 #
-
-- Fixed creating units with an alias not working within the expression
- parser.
-- Fixed security vulnerabilities. Thanks Sam.
-
-2017-05-12, version 3.13.0 #
-
-- Command line application can now evaluate inline expressions
- like `mathjs 1+2`. Thanks @slavaGanzin.
-- Function `derivative` now supports `abs`. Thanks @tetslee.
-- Function `simplify` now supports BigNumbers. Thanks @tetslee.
-- Prevent against endless loops in `simplify`. Thanks @tetslee.
-- Fixed #813: function `simplify` converting small numbers to inexact
- Fractions. Thanks @tetslee.
-- Fixed #838: Function `simplify` now supports constants like `e`.
- Thanks @tetslee.
-
-2017-05-05, version 3.12.3 #
-
-- Fixed security vulnerabilities. Thanks Dan and Sam.
-
-2017-04-30, version 3.12.2 #
-
-- Added a rocket trajectory optimization example.
-
-2017-04-24, version 3.12.1 #
-
-- Fixed #804
- - Improved handling of powers of `Infinity`. Thanks @HarrySarson.
- - Fixed wrong formatting of complex NaN.
-- Fixed security vulnerabilities in the expression parser.
- Thanks Sam and Dan.
-
-2017-04-17, version 3.12.0 #
-
-- Implemented QR decomposition, function `math.qr`. Thanks @HarrySarson.
-- Fixed #824: Calling `math.random()` freezes IE and node.js.
-
-2017-04-08, version 3.11.5 #
-
-- More security measures in the expression parser.
- WARNING: the behavior of the expression parser is now more strict,
- some undocumented features may not work any longer.
- - Accessing and assigning properties is now only allowed on plain
- objects, not on classes, arrays, and functions anymore.
- - Accessing methods is restricted to a set of known, safe methods.
-
-2017-04-03, version 3.11.4 #
-
-- Fixed a security vulnerability in the expression parser. Thanks @xfix.
-
-2017-04-03, version 3.11.3 #
-
-- Fixed a security vulnerability in the expression parser. Thanks @xfix.
-
-2017-04-03, version 3.11.2 #
-
-- Fixed a security vulnerability in the expression parser. Thanks @xfix.
-
-2017-04-02, version 3.11.1 #
-
-- Fixed security vulnerabilities in the expression parser.
- Thanks Joe Vennix and @xfix.
-
-2017-04-02, version 3.11.0 #
-
-- Implemented method Unit.toSI() to convert a unit to base SI units.
- Thanks @ericman314.
-- Fixed #821, #822: security vulnerabilities in the expression parser.
- Thanks @comex and @xfix.
-
-2017-03-31, version 3.10.3 #
-
-- More security fixes related to the ones fixed in `v3.10.2`.
-
-2017-03-31, version 3.10.2 #
-
-- Fixed a security vulnerability in the expression parser allowing
- execution of arbitrary JavaScript. Thanks @CapacitorSet and @denvit.
-
-2017-03-26, version 3.10.1 #
-
-- Fixed `xgcd` for negative values. Thanks @litmit.
-- Fixed #807: function transform of existing functions not being removed when
- overriding such a function.
-
-2017-03-05, version 3.10.0 #
-
-- Implemented function `reshape`. Thanks @patgrasso and @ericman314.
-- Implemented configuration option `seedRandom` for deterministic random
- numbers. Thanks @morsecodist.
-- Small fixes in the docs. Thanks @HarrySarson.
-- Dropped support for component package manager (which became deprecated about
- one and a half year ago).
-
-2017-02-22, version 3.9.3 #
-
-- Fixed #797: issue with production builds of React Native projects.
-- Fixed `math.round` not accepting inputs `NaN`, `Infinity`, `-Infinity`.
-- Upgraded all dependencies.
-
-2017-02-16, version 3.9.2 #
-
-- Fixed #795: Parse error in case of a multi-line expression with just comments.
-
-2017-02-06, version 3.9.1 #
-
-- Fixed #789: Math.js not supporting conversion of `string` to `BigNumber`,
- `Fraction`, or `Complex` number.
-- Fixed #790: Expression parser did not pass function arguments of enclosing
- functions via `scope` to functions having `rawArgs = true`.
-- Small fixes in the docs. Thanks @HarrySarson.
-
-2017-01-23, version 3.9.0 #
-
-- Implemented support for algebra: powerful new functions `simplify` and
- `derivative`. Thanks @ericman314, @tetslee, and @BigFav.
-- Implemented Kronecker Product `kron`. Thanks @adamisntdead.
-- Reverted `FunctionNode` not accepting a string as function name anymore.
-- Fixed #765: `FunctionAssignmentNode.toString()` returning a string
- incompatible with the function assignment syntax.
-
-2016-12-15, version 3.8.1 #
-
-- Implemented function `mad` (median absolute deviation). Thanks @ruhleder.
-- Fixed #762: expression parser failing to invoke a function returned
- by a function.
-
-2016-11-18, version 3.8.0 #
-
-- Functions `add` and `multiply` now accept more than two arguments. See #739.
-- `OperatorNode` now supports more than two arguments. See #739. Thanks @FSMaxB.
-- Implemented a method `Node.cloneDeep` for the expression nodes. See #745.
-- Fixed a bug in `Node.clone()` not cloning implicit multiplication correctly.
- Thanks @FSMaxB.
-- Fixed #737: Improved algorithm determining the best prefix for units.
- It will now retain the original unit like `1 cm` when close enough,
- instead of returning `10 mm`. Thanks @ericman314.
-- Fixed #732: Allow letter-like unicode characters like Ohm `\u2126`.
-- Fixed #749: Units `rad`, `deg`, and `grad` can now have prefixes like `millirad`.
-- Some fixes in the docs and comments of examples. Thanks @HarrySarson.
-
-2016-11-05, version 3.7.0 #
-
-- Implemented method `Node.equals(other)` for all nodes of the expression parser.
-- Implemented BigNumber support in function `arg()`.
-- Command Line Interface loads faster.
-- Implicit conversions between Fractions and BigNumbers throw a neat error now
- (See #710).
-
-2016-10-21, version 3.6.0 #
-
-- Implemented function `erf()`. THanks @patgrasso.
-- Extended function `cross()` to support n-d vectors. Thanks @patgrasso.
-- Extended function `pickRandom` with the option to pick multiple values from
- an array and give the values weights: `pickRandom(possibles, number, weights)`.
- Thanks @woylie.
-- Parser now exposes test functions like `isAlpha` which can be replaced in
- order to adjust the allowed characters in variables names (See #715).
-- Fixed #727: Parser not throwing an error for invalid implicit multiplications
- like `-2 2` and `2^3 4` (right after the second value of an operator).
-- Fixed #688: Describe allowed variable names in the docs.
-
-2016-09-21, version 3.5.3 #
-
-- Some more fixes regarding numbers ending with a decimal mark (like `2.`).
-
-2016-09-20, version 3.5.2 #
-
-- Fixed numbers ending with a decimal mark (like `2.`) not being supported by
- the parser, solved the underlying ambiguity in the parser. See #707, #711.
-
-2016-09-12, version 3.5.1 #
-
-- Removed a left over console.log statement. Thanks @eknkc.
-
-2016-09-07, version 3.5.0 #
-
-- Comments of expressions are are now stored in the parsed nodes. See #690.
-- Fixed function `print` not accepting an Object with formatting options as
- third parameter Thanks @ThomasBrierley.
-- Fixed #707: The expression parser no longer accepts numbers ending with a dot
- like `2.`.
-
-2016-08-08, version 3.4.1 #
-
-- Fixed broken bundle files (`dist/math.js`, `dist/math.min.js`).
-- Fixed some layout issues in the function reference docs.
-
-2016-08-07, version 3.4.0 #
-
-- Implemented support for custom units using `createUnit`. Thanks @ericman314.
-- Implemented function `splitUnits`. Thanks @ericman314.
-- Implemented function `isPrime`. Thanks @MathBunny.
-
-2016-07-05, version 3.3.0 #
-
-- Implemented function `isNaN`.
-- Function `math.filter` now passes three arguments to the callback function:
- value, index, and array.
-- Removed the check on the number of arguments from functions defined in the
- expression parser (see #665).
-- Fixed #665: functions `map`, `forEach`, and `filter` now invoke callbacks
- which are a typed-function with the correct number of arguments.
-
-2016-04-26, version 3.2.1 #
-
-- Fixed #651: unable to perform calculations on "Unit-less" units.
-- Fixed matrix.subset mutating the replacement matrix when unsqueezing it.
-
-2016-04-16, version 3.2.0 #
-
-- Implemented #644: method `Parser.getAll()` to retrieve all defined variables.
-- Upgraded dependencies (decimal.js@5.0.8, fraction.js@3.3.1,
- typed-function@0.10.4).
-- Fixed #601: Issue with unnamed typed-functions by upgrading to
- typed-function v0.10.4.
-- Fixed #636: More strict `toTex` templates, reckon with number of arguments.
-- Fixed #641: Bug in expression parser parsing implicit multiplication with
- wrong precedence in specific cases.
-- Fixed #645: Added documentation about `engineering` notation of function
- `math.format`.
-
-2016-04-03, version 3.1.4 #
-
-- Using ES6 Math functions like `Math.sinh`, `Math.cbrt`, `Math.sign`, etc when
- available.
-- Fixed #631: unit aliases `weeks`, `months`, and `years` where missing.
-- Fixed #632: problem with escaped backslashes at the end of strings.
-- Fixed #635: `Node.toString` options where not passed to function arguments.
-- Fixed #629: expression parser throws an error when passing a number with
- decimal exponent instead of parsing them as implicit multiplication.
-- Fixed #484, #555: inaccuracy of `math.sinh` for values between -1 and 1.
-- Fixed #625: Unit `in` (`inch`) not always working due to ambiguity with
- the operator `a in b` (alias of `a to b`).
-
-2016-03-24, version 3.1.3 #
-
-- Fix broken bundle.
-
-2016-03-24, version 3.1.2 #
-
-- Fix broken npm release.
-
-2016-03-24, version 3.1.1 #
-
-- Fixed #621: a bug in parsing implicit multiplications like `(2)(3)+4`.
-- Fixed #623: `nthRoot` of zero with a negative root returned `0` instead of
- `Infinity`.
-- Throw an error when functions `min`, `max`, `mean`, or `median` are invoked
- with multiple matrices as arguments (see #598).
-
-2016-03-19, version 3.1.0 #
-
-- Hide multiplication operator by default when outputting `toTex` and `toString`
- for implicit multiplications. Implemented and option to output the operator.
-- Implemented unit `kip` and alias `kips`. Thanks @hgupta9.
-- Added support for prefixes for units `mol` and `mole`. Thanks @stu-blair.
-- Restored support for implicit multiplications like `2(3+4)` and `(2+3)(4+5)`.
-- Some improvements in the docs.
-- Added automatic conversions from `boolean` and `null` to `Fraction`,
- and conversions from `Fraction` to `Complex`.
-
-2016-03-04, version 3.0.0 #
-
-breaking changes #
-
-- More restricted support for implicit multiplication in the expression
- parser: `(...)(...)` is now evaluated as a function invocation,
- and `[...][...]` as a matrix subset.
-- Matrix multiplication no longer squeezes scalar outputs to a scalar value,
- but leaves them as they are: a vector or matrix containing a single value.
- See #529.
-- Assignments in the expression parser now return the assigned value rather
- than the created or updated object (see #533). Example:
-
- ```
- A = eye(3)
- A[1,1] = 2 # this assignment now returns 2 instead of A
- ```
-
-- Expression parser now supports objects. This involves a refactoring and
- extension in expression nodes:
- - Implemented new node `ObjectNode`.
- - Refactored `AssignmentNode`, `UpdateNode`, and `IndexNode` are refactored
- into `AccessorNode`, `AssignmentNode`, and `IndexNode` having a different API.
-- Upgraded the used BigNumber library `decimal.js` to v5. Replaced the
- trigonometric functions of math.js with those provided in decimal.js v5.
- This can give slightly different behavior qua round-off errors.
-- Replaced the internal `Complex.js` class with the `complex.js` library
- created by @infusion.
-- Entries in a matrix (typically numbers, BigNumbers, Units, etc) are now
- considered immutable, they are no longer copied when performing operations on
- the entries, improving performance.
-- Implemented nearly equal comparison for relational functions (`equal`,
- `larger`, `smaller`, etc.) when using BigNumbers.
-- Changed the casing of the configuration options `matrix` (`Array` or `Matrix`)
- and `number` (`number`, `BigNumber`, `Fraction`) such that they now match
- the type returned by `math.typeof`. Wrong casing gives a console warning but
- will still work.
-- Changed the default config value for `epsilon` from `1e-14` to `1e-12`,
- see #561.
-
-non-breaking changes #
-
-- Extended function `pow` to return the real root for cubic roots of negative
- numbers. See #525, #482, #567.
-- Implemented support for JSON objects in the expression parser and the
- function `math.format`.
-- Function `math.fraction` now supports `BigNumber`, and function
- `math.bignumber` now supports `Fraction`.
-- Expression parser now allows function and/or variable assignments inside
- accessors and conditionals, like `A[x=2]` or `a > 2 ? b="ok" : b="fail"`.
-- Command line interface:
- - Outputs the variable name of assignments.
- - Fixed not rounding BigNumbers to 14 digits like numbers.
- - Fixed non-working autocompletion of user defined variables.
-- Reorganized and extended docs, added docs on classes and more. Thanks @hgupta9.
-- Added new units `acre`, `hectare`, `torr`, `bar`, `mmHg`, `mmH2O`, `cmH2O`,
- and added new aliases `acres`, `hectares`, `sqfeet`, `sqyard`, `sqmile`,
- `sqmiles`, `mmhg`, `mmh2o`, `cmh2o`. Thanks @hgupta9.
-- Fixed a bug in the toString method of an IndexNode.
-- Fixed angle units `deg`, `rad`, `grad`, `cycle`, `arcsec`, and `arcmin` not
- being defined as BigNumbers when configuring to use BigNumbers.
-
-2016-02-03, version 2.7.0 #
-
-- Added more unit aliases for time: `secs`, `mins`, `hr`, `hrs`. See #551.
-- Added support for doing operations with mixed `Fractions` and `BigNumbers`.
-- Fixed #540: `math.intersect()` returning null in some cases. Thanks @void42.
-- Fixed #546: Cannot import BigNumber, Fraction, Matrix, Array.
- Thanks @brettjurgens.
-
-2016-01-08, version 2.6.0 #
-
-- Implemented (complex) units `VA` and `VAR`.
-- Implemented time units for weeks, months, years, decades, centuries, and
- millennia. Thanks @owenversteeg.
-- Implemented new notation `engineering` in function `math.format`.
- Thanks @johnmarinelli.
-- Fixed #523: In some circumstances, matrix subset returned a scalar instead
- of the correct subset.
-- Fixed #536: A bug in an internal method used for sparse matrices.
-
-2015-12-05, version 2.5.0 #
-
-- Implemented support for numeric types `Fraction` and `BigNumber` in units.
-- Implemented new method `toNumeric` for units.
-- Implemented new units `arcsec`, `arcsecond`, `arcmin`, `arcminute`.
- Thanks @devdevdata222.
-- Implemented new unit `Herts` (`Hz`). Thanks @SwamWithTurtles.
-- Fixed #485: Scoping issue with variables both used globally as well as in a
- function definition.
-- Fixed: Function `number` didn't support `Fraction` as input.
-
-2015-11-14, version 2.4.2 #
-
-- Fixed #502: Issue with `format` in some JavaScript engines.
-- Fixed #503: Removed trailing commas and the use of keyword `import` as
- property, as this gives issues with old JavaScript engines.
-
-2015-10-29, version 2.4.1 #
-
-- Fixed #480: `nthRoot` not working on Internet Explorer (up to IE11).
-- Fixed #490: `nthRoot` returning an error for negative values like
- `nthRoot(-2, 3)`.
-- Fixed #489: an issue with initializing a sparse matrix without data.
- Thanks @Retsam.
-- Fixed: #493: function `combinations` did not throw an exception for
- non-integer values of `k`.
-- Fixed: function `import` did not override typed functions when the option
- override was set true.
-- Fixed: added functions `math.sparse` and `math.index` to the reference docs,
- they where missing.
-- Fixed: removed memoization from `gamma` and `factorial` functions, this
- could blow up memory.
-
-2015-10-09, version 2.4.0 #
-
-- Added support in the expression parser for mathematical alphanumeric symbols
- in the expression parser: unicode range \u{1D400} to \u{1D7FF} excluding
- invalid code points.
-- Extended function `distance` with more signatures. Thanks @kv-kunalvyas.
-- Fixed a bug in functions `sin` and `cos`, which gave wrong results for
- BigNumber integer values around multiples of tau (i.e. `sin(bignumber(7))`).
-- Fixed value of unit `stone`. Thanks @Esvandiary for finding the error.
-
-2015-09-19, version 2.3.0 #
-
-- Implemented function `distance`. Thanks @devanp92.
-- Implemented support for Fractions in function `lcm`. Thanks @infusion.
-- Implemented function `cbrt` for numbers, complex numbers, BigNumbers, Units.
-- Implemented function `hypot`.
-- Upgraded to fraction.js v3.0.0.
-- Fixed #450: issue with non sorted index in sparse matrices.
-- Fixed #463, #322: inconsistent handling of implicit multiplication.
-- Fixed #444: factorial of infinity not returning infinity.
-
-2015-08-30, version 2.2.0 #
-
-- Units with powers (like `m^2` and `s^-1`) now output with the best prefix.
-- Implemented support for units to `abs`, `cube`, `sign`, `sqrt`, `square`.
- Thanks @ericman314.
-- Implemented function `catalan` (Combinatorics). Thanks @devanp92.
-- Improved the `canDefineProperty` check to return false in case of IE8, which
- has a broken implementation of `defineProperty`. Thanks @golmansax.
-- Fixed function `to` not working in case of a simplified unit.
-- Fixed #437: an issue with row swapping in `lup`, also affecting `lusolve`.
-
-2015-08-12, version 2.1.1 #
-
-- Fixed wrong values of the physical constants `speedOfLight`, `molarMassC12`,
- and `magneticFluxQuantum`. Thanks @ericman314 for finding two of them.
-
-2015-08-11, version 2.1.0 #
-
-- Implemented derived units (like `110 km/h in m/s`). Thanks @ericman314.
-- Implemented support for electric units. Thanks @ericman314.
-- Implemented about 50 physical constants like `speedOfLight`, `gravity`, etc.
-- Implemented function `kldivergence` (Kullback-Leibler divergence).
- Thanks @saromanov.
-- Implemented function `mode`. Thanks @kv-kunalvyas.
-- Added support for unicode characters in the expression parser: greek letters
- and latin letters with accents. See #265.
-- Internal functions `Unit.parse` and `Complex.parse` now throw an Error
- instead of returning null when passing invalid input.
-
-2015-07-29, version 2.0.1 #
-
-- Fixed operations with mixed fractions and numbers be converted to numbers
- instead of fractions.
-
-2015-07-28, version 2.0.0 #
-
-- Large internal refactoring:
- - performance improvements.
- - allows to create custom bundles
- - functions are composed using `typed-function` and are extensible
-- Implemented support for fractions, powered by the library `fraction.js`.
-- Implemented matrix LU decomposition with partial pivoting and a LU based
- linear equations solver (functions `lup` and `lusolve`). Thanks @rjbaucells.
-- Implemented a new configuration option `predictable`, which can be set to
- true in order to ensure predictable function output types.
-- Implemented function `intersect`. Thanks @kv-kunalvyas.
-- Implemented support for adding `toTex` properties to custom functions.
- Thanks @FSMaxB.
-- Implemented support for complex values to `nthRoot`. Thanks @gangachris.
-- Implemented util functions `isInteger`, `isNegative`, `isNumeric`,
- `isPositive`, and `isZero`.
-
-breaking changes #
-
-- String input is now converted to numbers by default for all functions.
-- Adding two strings will no longer concatenate them, but will convert the
- strings to numbers and add them.
-- Function `index` does no longer accept an array `[start, end, step]`, but
- instead accepts an array with arbitrary index values. It also accepts
- a `Range` object as input.
-- Function `typeof` no longer returns lower case names, but now returns lower
- case names for primitives (like `number`, `boolean`, `string`), and
- upper-camel-case for non-primitives (like `Array`, `Complex`, `Function`).
-- Function `import` no longer supports a module name as argument. Instead,
- modules can be loaded using require: `math.import(require('module-name'))`.
-- Function `import` has a new option `silent` to ignore errors, and throws
- errors on duplicates by default.
-- Method `Node.compile()` no longer needs `math` to be passed as argument.
-- Reintroduced method `Node.eval([scope])`.
-- Function `sum` now returns zero when input is an empty array. Thanks @FSMAxB.
-- The size of Arrays is no longer validated. Matrices will validate this on
- creation.
-
-2015-07-12, version 1.7.1 #
-
-- Fixed #397: Inaccuracies in nthRoot for very large values, and wrong results
- for very small values. (backported from v2)
-- Fixed #405: Parser throws error when defining a function in a multiline
- expression.
-
-2015-05-31, version 1.7.0 #
-
-- Implemented function `quantileSeq` and `partitionSelect`. Thanks @BigFav.
-- Implemented functions `stirlingS2`, `bellNumbers`, `composition`, and
- `multinomial`. Thanks @devanp92.
-- Improved the performance of `median` (see #373). Thanks @BigFav.
-- Extended the command line interface with a `mode` option to output either
- the expressions result, string representation, or tex representation.
- Thanks @FSMaxB.
-- Fixed #309: Function median mutating the input matrix. Thanks @FSMaxB.
-- Fixed `Node.transform` not recursing over replaced parts of the
- node tree (see #349).
-- Fixed #381: issue in docs of `randomInt`.
-
-2015-04-22, version 1.6.0 #
-
-- Improvements in `toTex`. Thanks @FSMaxB.
-- Fixed #328: `abs(0 + 0i)` evaluated to `NaN`.
-- Fixed not being able to override lazy loaded constants.
-
-2015-04-09, version 1.5.2 #
-
-- Fixed #313: parsed functions did not handle recursive calls correctly.
-- Fixed #251: binary prefix and SI prefix incorrectly used for byte. Now
- following SI standards (`1 KiB == 1024 B`, `1 kB == 1000 B`).
-- Performance improvements in parsed functions.
-
-2015-04-08, version 1.5.1 #
-
-- Fixed #316: a bug in rounding values when formatting.
-- Fixed #317, #319: a bug in formatting negative values.
-
-2015-03-28, version 1.5.0 #
-
-- Added unit `stone` (6.35 kg).
-- Implemented support for sparse matrices. Thanks @rjbaucells.
-- Implemented BigNumber support for function `atan2`. Thanks @BigFav.
-- Implemented support for custom LaTeX representations. Thanks @FSMaxB.
-- Improvements and bug fixes in outputting parentheses in `Node.toString` and
- `Node.toTex` functions. Thanks @FSMaxB.
-- Fixed #291: function `format` sometimes returning exponential notation when
- it should return a fixed notation.
-
-2015-02-28, version 1.4.0 #
-
-- Implemented trigonometric functions:
- `acosh`, `acoth`, `acsch`, `asech`, `asinh`, `atanh`, `acot`, `acsc`, `asec`.
- Thanks @BigFav.
-- Added BigNumber support for functions: `cot`, `csc`, `sec`, `coth`,
- `csch`, `sech`. Thanks @BigFav.
-- Implemented support for serialization and deserialization of math.js data
- types.
-- Fixed the calculation of `norm()` and `abs()` for large complex numbers.
- Thanks @rjbaucells.
-- Fixed #281: improved formatting complex numbers. Round the real or imaginary
- part to zero when the difference is larger than the configured precision.
-
-2015-02-09, version 1.3.0 #
-
-- Implemented BigNumber implementations of most trigonometric functions: `sin`,
- `cos`, `tan`, `asin`, `acos`, `atan`, `cosh`, `sinh`, `tanh`. Thanks @BigFav.
-- Implemented function `trace`. Thanks @pcorey.
-- Faster loading of BigNumber configuration with a high precision by lazy
- loading constants like `pi` and `e`.
-- Fixed constants `NaN` and `Infinity` not being BigNumber objects when
- BigNumbers are configured.
-- Fixed missing parentheses in the `toTex` representation of function
- `permutations`.
-- Some minor fixes in the docs. Thanks @KenanY.
-
-2014-12-25, version 1.2.0 #
-
-- Support for bitwise operations `bitAnd`, `bitNot`, `bitOr`, `bitXor`,
- `leftShift`, `rightArithShift`, and `rightLogShift`. Thanks @BigFav.
-- Support for boolean operations `and`, `not`, `or`, `xor`. Thanks @BigFav.
-- Support for `gamma` function. Thanks @BigFav.
-- Converting a unit without value will now result in a unit *with* value,
- i.e. `inch in cm` will return `2.54 cm` instead of `cm`.
-- Improved accuracy of `sinh` and complex `cos` and `sin`. Thanks @pavpanchekha.
-- Renamed function `select` to `chain`. The old function `select` will remain
- functional until math.js v2.0.
-- Upgraded to decimal.js v4.0.1 (BigNumber library).
-
-2014-11-22, version 1.1.1 #
-
-- Fixed Unit divided by Number returning zero.
-- Fixed BigNumber downgrading to Number for a negative base in `pow`.
-- Fixed some typos in error messaging (thanks @andy0130tw) and docs.
-
-2014-11-15, version 1.1.0 #
-
-- Implemented functions `dot` (dot product), `cross` (cross product), and
- `nthRoot`.
-- Officially opened up the API of expression trees:
- - Documented the API.
- - Implemented recursive functions `clone`, `map`, `forEach`, `traverse`,
- `transform`, and `filter` for expression trees.
- - Parameter `index` in the callbacks of `map` and `forEach` are now cloned
- for every callback.
- - Some internal refactoring inside nodes to make the API consistent:
- - Renamed `params` to `args` and vice versa to make things consistent.
- - Renamed `Block.nodes` to `Block.blocks`.
- - `FunctionNode` now has a `name: string` instead of a `symbol: SymbolNode`.
- - Changed constructor of `RangeNode` to
- `new RangeNode(start: Node, end: Node [, step: Node])`.
- - Nodes for a `BlockNode` must now be passed via the constructor instead
- of via a function `add`.
-- Fixed `2e` giving a syntax error instead of being parsed as `2 * e`.
-
-2014-09-12, version 1.0.1 #
-
-- Disabled array notation for ranges in a matrix index in the expression parser
- (it is confusing and redundant there).
-- Fixed a regression in the build of function subset not being able to return
- a scalar.
-- Fixed some missing docs and broken links in the docs.
-
-2014-09-04, version 1.0.0 #
-
-- Implemented a function `filter(x, test)`.
-- Removed `math.distribution` for now, needs some rethinking.
-- `math.number` can convert units to numbers (requires a second argument)
-- Fixed some precedence issues with the range and conversion operators.
-- Fixed an zero-based issue when getting a matrix subset using an index
- containing a matrix.
-
-2014-08-21, version 0.27.0 #
-
-- Implemented functions `sort(x [, compare])` and `flatten(x)`.
-- Implemented support for `null` in all functions.
-- Implemented support for "rawArgs" functions in the expression parser. Raw
- functions are invoked with unevaluated parameters (nodes).
-- Expressions in the expression parser can now be spread over multiple lines,
- like '2 +\n3'.
-- Changed default value of the option `wrap` of function `math.import` to false.
-- Changed the default value for new entries in a resized matrix when to zero.
- To leave new entries uninitialized, use the new constant `math.uninitialized`
- as default value.
-- Renamed transform property from `__transform__` to `transform`, and documented
- the transform feature.
-- Fixed a bug in `math.import` not applying options when passing a module name.
-- A returned matrix subset is now only squeezed when the `index` consists of
- scalar values, and no longer for ranges resolving into a single value.
-
-2014-08-03, version 0.26.0 #
-
-- A new instance of math.js can no longer be created like `math([options])`,
- to prevent side effects from math being a function instead of an object.
- Instead, use the function `math.create([options])` to create a new instance.
-- Implemented `BigNumber` support for all constants: `pi`, `tau`, `e`, `phi`,
- `E`, `LN2`, `LN10`, `LOG2E`, `LOG10E`, `PI`, `SQRT1_2`, and `SQRT2`.
-- Implemented `BigNumber` support for functions `gcd`, `xgcd`, and `lcm`.
-- Fixed function `gxcd` returning an Array when math.js was configured
- as `{matrix: 'matrix'}`.
-- Multi-line expressions now return a `ResultSet` instead of an `Array`.
-- Implemented transforms (used right now to transform one-based indices to
- zero-based for expressions).
-- When used inside the expression parser, functions `concat`, `min`, `max`,
- and `mean` expect an one-based dimension number.
-- Functions `map` and `forEach` invoke the callback with one-based indices
- when used from within the expression parser.
-- When adding or removing dimensions when resizing a matrix, the dimensions
- are added/removed from the inner side (right) instead of outer side (left).
-- Improved index out of range errors.
-- Fixed function `concat` not accepting a `BigNumber` for parameter `dim`.
-- Function `squeeze` now squeezes both inner and outer singleton dimensions.
-- Output of getting a matrix subset is not automatically squeezed anymore
- except for scalar output.
-- Renamed `FunctionNode` to `FunctionAssignmentNode`, and renamed `ParamsNode`
- to `FunctionNode` for more clarity.
-- Fixed broken auto completion in CLI.
-- Some minor fixes.
-
-2014-07-01, version 0.25.0 #
-
-- The library now immediately returns a default instance of mathjs, there is
- no need to instantiate math.js in a separate step unless one ones to set
- configuration options:
-
- // instead of:
- var mathjs = require('mathjs'), // load math.js
- math = mathjs(); // create an instance
-
- // just do:
- var math = require('mathjs');
-- Implemented support for implicit multiplication, like `math.eval('2a', {a:3})`
- and `math.eval('(2+3)(1-3)')`. This changes behavior of matrix indexes as
- well: an expression like `[...][...]` is not evaluated as taking a subset of
- the first matrix, but as an implicit multiplication of two matrices.
-- Removed utility function `ifElse`. This function is redundant now the
- expression parser has a conditional operator `a ? b : c`.
-- Fixed a bug with multiplying a number with a temperature,
- like `math.eval('10 * celsius')`.
-- Fixed a bug with symbols having value `undefined` not being evaluated.
-
-2014-06-20, version 0.24.1 #
-
-- Something went wrong with publishing on npm.
-
-2014-06-20, version 0.24.0 #
-
-- Added constant `null`.
-- Functions `equal` and `unequal` support `null` and `undefined` now.
-- Function `typeof` now recognizes regular expressions as well.
-- Objects `Complex`, `Unit`, and `Help` now return their string representation
- when calling `.valueOf()`.
-- Changed the default number of significant digits for BigNumbers from 20 to 64.
-- Changed the behavior of the conditional operator (a ? b : c) to lazy
- evaluating.
-- Fixed imported, wrapped functions not accepting `null` and `undefined` as
- function arguments.
-
-2014-06-10, version 0.23.0 #
-
-- Renamed some functions (everything now has a logical, camel case name):
- - Renamed functions `edivide`, `emultiply`, and `epow` to `dotDivide`,
- `dotMultiply`, and `dotPow` respectively.
- - Renamed functions `smallereq` and `largereq` to `smallerEq` and `largerEq`.
- - Renamed function `unary` to `unaryMinus` and added support for strings.
-- `end` is now a reserved keyword which cannot be used as function or symbol
- name in the expression parser, and is not allowed in the scope against which
- an expression is evaluated.
-- Implemented function `unaryPlus` and unary plus operator.
-- Implemented function `deepEqual` for matrix comparisons.
-- Added constant `phi`, the golden ratio (`phi = 1.618...`).
-- Added constant `version`, returning the version number of math.js as string.
-- Added unit `drop` (`gtt`).
-- Fixed not being able to load math.js using AMD/require.js.
-- Changed signature of `math.parse(expr, nodes)` to `math.parse(expr, options)`
- where `options: {nodes: Object.}`
-- Removed matrix support from conditional function `ifElse`.
-- Removed automatic assignment of expression results to variable `ans`.
- This functionality can be restored by pre- or postprocessing every evaluation,
- something like:
-
- function evalWithAns (expr, scope) {
- var ans = math.eval(expr, scope);
- if (scope) {
- scope.ans = ans;
- }
- return ans;
- }
-
-2014-05-22, version 0.22.0 #
-
-- Implemented support to export expressions to LaTeX. Thanks Niels Heisterkamp
- (@nheisterkamp).
-- Output of matrix multiplication is now consistently squeezed.
-- Added reference documentation in the section /docs/reference.
-- Fixed a bug in multiplying units without value with a number (like `5 * cm`).
-- Fixed a bug in multiplying two matrices containing vectors (worked fine for
- arrays).
-- Fixed random functions not accepting Matrix as input, and always returning
- a Matrix as output.
-
-2014-05-13, version 0.21.1 #
-
-- Removed `crypto` library from the bundle.
-- Deprecated functions `Parser.parse` and `Parser.compile`. Use
- `math.parse` and `math.compile` instead.
-- Fixed function `add` not adding strings and matrices element wise.
-- Fixed parser not being able to evaluate an exponent followed by a unary minus
- like `2^-3`, and a transpose followed by an index like `[3]'[1]`.
-
-2014-04-24, version 0.21.0 #
-
-- Implemented trigonometric hyperbolic functions `cosh`, `coth`, `csch`,
- `sech`, `sinh`, `tanh`. Thanks Rogelio J. Baucells (@rjbaucells).
-- Added property `type` to all expression nodes in an expression tree.
-- Fixed functions `log`, `log10`, `pow`, and `sqrt` not supporting complex
- results from BigNumber input (like `sqrt(bignumber(-4))`).
-
-2014-04-16, version 0.20.0 #
-
-- Switched to module `decimal.js` for BigNumber support, instead of
- `bignumber.js`.
-- Implemented support for polar coordinates to the `Complex` datatype.
- Thanks Finn Pauls (@finnp).
-- Implemented BigNumber support for functions `exp`, `log`, and `log10`.
-- Implemented conditional operator `a ? b : c` in expression parser.
-- Improved floating point comparison: the functions now check whether values
- are nearly equal, against a configured maximum relative difference `epsilon`.
- Thanks Rogelio J. Baucells (@rjbaucells).
-- Implemented function `norm`. Thanks Rogelio J. Baucells (@rjbaucells).
-- Improved function `ifElse`, is now specified for special data types too.
-- Improved function `det`. Thanks Bryan Cuccioli (@bcuccioli).
-- Implemented `BigNumber` support for functions `det` and `diag`.
-- Added unit alias `lbs` (pound mass).
-- Changed configuration option `decimals` to `precision` (applies to BigNumbers
- only).
-- Fixed support for element-wise comparisons between a string and a matrix.
-- Fixed: expression parser now trows IndexErrors with one-based indices instead
- of zero-based.
-- Minor bug fixes.
-
-2014-03-30, version 0.19.0 #
-
-- Implemented functions `compare`, `sum`, `prod`, `var`, `std`, `median`.
-- Implemented function `ifElse` Thanks @mtraynham.
-- Minor bug fixes.
-
-2014-02-15, version 0.18.1 #
-
-- Added unit `feet`.
-- Implemented function `compile` (shortcut for parsing and then compiling).
-- Improved performance of function `pow` for matrices. Thanks @hamadu.
-- Fixed broken auto completion in the command line interface.
-- Fixed an error in function `combinations` for large numbers, and
- improved performance of both functions `combinations` and `permutations`.
-
-2014-01-18, version 0.18.0 #
-
-- Changed matrix index notation of expression parser from round brackets to
- square brackets, for example `A[1, 1:3]` instead of `A(1, 1:3)`.
-- Removed need to use the `function` keyword for function assignments in the
- expression parser, you can define a function now like `f(x) = x^2`.
-- Implemented a compilation step in the expression parser: expressions are
- compiled into JavaScript, giving much better performance (easily 10x as fast).
-- Renamed unit conversion function and operator `in` to `to`. Operator `in` is
- still available in the expression parser as an alias for `to`. Added unit
- `in`, an abbreviation for `inch`. Thanks Elijah Insua (@tmpvar).
-- Added plurals and aliases for units.
-- Implemented an argument `includeEnd` for function `range` (false by default).
-- Ranges in the expression parser now support big numbers.
-- Implemented functions `permutations` and `combinations`.
- Thanks Daniel Levin (@daniel-levin).
-- Added lower case abbreviation `l` for unit litre.
-
-2013-12-19, version 0.17.1 #
-
-- Fixed a bug with negative temperatures.
-- Fixed a bug with prefixes of units squared meter `m2` and cubic meter `m3`.
-
-2013-12-12, version 0.17.0 #
-
-- Renamed and flattened configuration settings:
- - `number.defaultType` is now `number`.
- - `number.precision` is now `decimals`.
- - `matrix.defaultType` is now `matrix`.
-- Function `multiply` now consistently outputs a complex number on complex input.
-- Fixed `mod` and `in` not working as function (only as operator).
-- Fixed support for old browsers (IE8 and older), compatible when using es5-shim.
-- Fixed support for Java's ScriptEngine.
-
-2013-11-28, version 0.16.0 #
-
-- Implemented BigNumber support for arbitrary precision calculations.
- Added settings `number.defaultType` and `number.precision` to configure
- big numbers.
-- Documentation is extended.
-- Removed utility functions `isScalar`, `toScalar`, `isVector`, `toVector`
- from `Matrix` and `Range`. Use `math.squeeze` and `math.size` instead.
-- Implemented functions `get` and `set` on `Matrix`, for easier and faster
- retrieval/replacement of elements in a matrix.
-- Implemented function `resize`, handling matrices, scalars, and strings.
-- Functions `ones` and `zeros` now return an empty matrix instead of a
- number 1 or 0 when no arguments are provided.
-- Implemented functions `min` and `max` for `Range` and `Index`.
-- Resizing matrices now leaves new elements undefined by default instead of
- filling them with zeros. Function `resize` now has an extra optional
- parameter `defaultValue`.
-- Range operator `:` in expression parser has been given a higher precedence.
-- Functions don't allow arguments of unknown type anymore.
-- Options be set when constructing a math.js instance or using the new function
- `config(options`. Options are no longer accessible via `math.options`.
-- Renamed `scientific` notation to `exponential` in function `format`.
-- Function `format` outputs exponential notation with positive exponents now
- always with `+` sign, so outputs `2.1e+3` instead of `2.1e3`.
-- Fixed function `squeeze` not being able squeeze into a scalar.
-- Some fixes and performance improvements in the `resize` and `subset`
- functions.
-- Function `size` now adheres to the option `matrix.defaultType` for scalar
- input.
-- Minor bug fixes.
-
-2013-10-26, version 0.15.0 #
-
-- Math.js must be instantiated now, static calls are no longer supported. Usage:
- - node.js: `var math = require('mathjs')();`
- - browser: `var math = mathjs();`
-- Implemented support for multiplying vectors with matrices.
-- Improved number formatting:
- - Function `format` now support various options: precision, different
- notations (`fixed`, `scientific`, `auto`), and more.
- - Numbers are no longer rounded to 5 digits by default when formatted.
- - Implemented a function `format` for `Matrix`, `Complex`, `Unit`, `Range`,
- and `Selector` to format using options.
- - Function `format` does only stringify values now, and has a new parameter
- `precision` to round to a specific number of digits.
- - Removed option `math.options.precision`,
- use `math.format(value [, precision])` instead.
- - Fixed formatting numbers as scientific notation in some cases returning
- a zero digit left from the decimal point. (like "0.33333e8" rather than
- "3.3333e7"). Thanks @husayt.
-- Implemented a function `print` to interpolate values in a template string,
- this functionality was moved from the function `format`.
-- Implemented statistics function `mean`. Thanks Guillermo Indalecio Fernandez
- (@guillermobox).
-- Extended and changed `max` and `min` for multi dimensional matrices: they now
- return the maximum and minimum of the flattened array. An optional second
- argument `dim` allows to calculate the `max` or `min` for specified dimension.
-- Renamed option `math.options.matrix.default` to
- `math.options.matrix.defaultType`.
-- Removed support for comparing complex numbers in functions `smaller`,
- `smallereq`, `larger`, `largereq`. Complex numbers cannot be ordered.
-
-2013-10-08, version 0.14.0 #
-
-- Introduced an option `math.options.matrix.default` which can have values
- `matrix` (default) or `array`. This option is used by the functions `eye`,
- `ones`, `range`, and `zeros`, to determine the type of matrix output.
-- Getting a subset of a matrix will automatically squeeze the resulting subset,
- setting a subset of a matrix will automatically unsqueeze the given subset.
-- Removed concatenation of nested arrays in the expression parser.
- You can now input nested arrays like in JavaScript. Matrices can be
- concatenated using the function `concat`.
-- The matrix syntax `[...]` in the expression parser now creates 1 dimensional
- matrices by default. `math.eval('[1,2,3,4]')` returns a matrix with
- size `[4]`, `math.eval('[1,2;3,4]')` returns a matrix with size `[2,2]`.
-- Documentation is restructured and extended.
-- Fixed non working operator `mod` (modulus operator).
-
-2013-09-03, version 0.13.0 #
-
-- Implemented support for booleans in all relevant functions.
-- Implemented functions `map` and `forEach`. Thanks Sebastien Piquemal (@sebpic).
-- All construction functions can be used to convert the type of variables,
- also element-wise for all elements in an Array or Matrix.
-- Changed matrix indexes of the expression parser to one-based with the
- upper-bound included, similar to most math applications. Note that on a
- JavaScript level, math.js uses zero-based indexes with excluded upper-bound.
-- Removed support for scalars in the function `subset`, it now only supports
- Array, Matrix, and String.
-- Removed the functions `get` and `set` from a selector, they are a duplicate
- of the function `subset`.
-- Replaced functions `get` and `set` of `Matrix` with a single function
- `subset`.
-- Some moving around with code and namespaces:
- - Renamed namespace `math.expr` to `math.expression` (contains Scope, Parser,
- node objects).
- - Renamed namespace `math.docs` to `math.expression.docs`.
- - Moved `math.expr.Selector` to `math.chaining.Selector`.
-- Fixed some edge cases in functions `lcm` and `xgcd`.
-
-2013-08-22, version 0.12.1 #
-
-- Fixed outdated version of README.md.
-- Fixed a broken unit test.
-
-2013-08-22, version 0.12.0 #
-
-- Implemented functions `random([min, max])`, `randomInt([min, max])`,
- `pickRandom(array)`. Thanks Sebastien Piquemal (@sebpic).
-- Implemented function `distribution(name)`, generating a distribution object
- with functions `random`, `randomInt`, `pickRandom` for different
- distributions. Currently supporting `uniform` and `normal`.
-- Changed the behavior of `range` to exclude the upper bound, so `range(1, 4)`
- now returns `[1, 2, 3]` instead of `[1, 2, 3, 4]`.
-- Changed the syntax of `range`, which is now `range(start, end [, step])`
- instead of `range(start, [step, ] end)`.
-- Changed the behavior of `ones` and `zeros` to geometric dimensions, for
- example `ones(3)` returns a vector with length 3, filled with ones, and
- `ones(3,3)` returns a 2D array with size [3, 3].
-- Changed the return type of `ones` and `zeros`: they now return an Array when
- arguments are Numbers or an Array, and returns a Matrix when the argument
- is a Matrix.
-- Change matrix index notation in parser from round brackets to square brackets,
- for example `A[0, 0:3]`.
-- Removed the feature introduced in v0.10.0 to automatically convert a complex
- value with an imaginary part equal to zero to a number.
-- Fixed zeros being formatted as null. Thanks @TimKraft.
-
-2013-07-23, version 0.11.1 #
-
-- Fixed missing development dependency
-
-2013-07-23, version 0.11.0 #
-
-- Changed math.js from one-based to zero-based indexes.
- - Getting and setting matrix subset is now zero-based.
- - The dimension argument in function `concat` is now zero-based.
-- Improvements in the string output of function help.
-- Added constants `true` and `false`.
-- Added constructor function `boolean`.
-- Fixed function `select` not accepting `0` as input.
- Thanks Elijah Manor (@elijahmanor).
-- Parser now supports multiple unary minus operators after each other.
-- Fixed not accepting empty matrices like `[[], []]`.
-- Some fixes in the end user documentation.
-
-2013-07-08, version 0.10.0 #
-
-- For complex calculations, all functions now automatically replace results
- having an imaginary part of zero with a Number. (`2i * 2i` now returns a
- Number `-4` instead of a Complex `-4 + 0i`).
-- Implemented support for injecting custom node handlers in the parser. Can be
- used for example to implement a node handler for plotting a graph.
-- Implemented end user documentation and a new `help` function.
-- Functions `size` and `squeeze` now return a Matrix instead of an Array as
- output on Matrix input.
-- Added a constant tau (2 * pi). Thanks Zak Zibrat (@palimpsests).
-- Renamed function `unaryminus` to `unary`.
-- Fixed a bug in determining node dependencies in function assignments.
-
-2013-06-14, version 0.9.1 #
-
-- Implemented element-wise functions and operators: `emultiply` (`x .* y`),
- `edivide` (`x ./ y`), `epow` (`x .^ y`).
-- Added constants `Infinity` and `NaN`.
-- Removed support for Workspace to keep the library focused on its core task.
-- Fixed a bug in the Complex constructor, not accepting NaN values.
-- Fixed division by zero in case of pure complex values.
-- Fixed a bug in function multiply multiplying a pure complex value with
- Infinity.
-
-2013-05-29, version 0.9.0 #
-
-- Implemented function `math.parse(expr [,scope])`. Optional parameter scope can
- be a plain JavaScript Object containing variables.
-- Extended function `math.expr(expr [, scope])` with an additional parameter
- `scope`, similar to `parse`. Example: `math.eval('x^a', {x:3, a:2});`.
-- Implemented function `subset`, to get or set a subset from a matrix, string,
- or other data types.
-- Implemented construction functions number and string (mainly useful inside
- the parser).
-- Improved function `det`. Thanks Bryan Cuccioli (@bcuccioli).
-- Moved the parse code from prototype math.expr.Parser to function math.parse,
- simplified Parser a little bit.
-- Strongly simplified the code of Scope and Workspace.
-- Fixed function mod for negative numerators, and added error messages in case
- of wrong input.
-
-2013-05-18, version 0.8.2 #
-
-- Extended the import function and some other minor improvements.
-- Fixed a bug in merging one dimensional vectors into a matrix.
-- Fixed a bug in function subtract, when subtracting a complex number from a
- real number.
-
-2013-05-10, version 0.8.1 #
-
-- Fixed an npm warning when installing mathjs globally.
-
-2013-05-10, version 0.8.0 #
-
-- Implemented a command line interface. When math.js is installed globally via
- npm, the application is available on your system as 'mathjs'.
-- Implemented `end` keyword for index operator, and added support for implicit
- start and end (expressions like `a(2,:)` and `b(2:end,3:end-1)` are supported
- now).
-- Function math.eval is more flexible now: it supports variables and multi-line
- expressions.
-- Removed the read-only option from Parser and Scope.
-- Fixed non-working unequal operator != in the parser.
-- Fixed a bug in resizing matrices when replacing a subset.
-- Fixed a bug in updating a subset of a non-existing variable.
-- Minor bug fixes.
-
-2013-05-04, version 0.7.2 #
-
-- Fixed method unequal, which was checking for equality instead of inequality.
- Thanks @FJS2.
-
-2013-04-27, version 0.7.1 #
-
-- Improvements in the parser:
- - Added support for chained arguments.
- - Added support for chained variable assignments.
- - Added a function remove(name) to remove a variable from the parsers scope.
- - Renamed nodes for more consistency and to resolve naming conflicts.
- - Improved stringification of an expression tree.
- - Some simplifications in the code.
- - Minor bug fixes.
-- Fixed a bug in the parser, returning NaN instead of throwing an error for a
- number with multiple decimal separators like `2.3.4`.
-- Fixed a bug in Workspace.insertAfter.
-- Fixed: math.js now works on IE 6-8 too.
-
-2013-04-20, version 0.7.0 #
-
-- Implemented method `math.eval`, which uses a readonly parser to evaluate
- expressions.
-- Implemented method `xgcd` (extended eucledian algorithm). Thanks Bart Kiers
- (@bkiers).
-- Improved math.format, which now rounds values to a maximum number of digits
- instead of decimals (default is 5 digits, for example `math.format(math.pi)`
- returns `3.1416`).
-- Added examples.
-- Changed methods square and cube to evaluate matrices element wise (consistent
- with all other methods).
-- Changed second parameter of method import to an object with options.
-- Fixed method math.typeof on IE.
-- Minor bug fixes and improvements.
-
-2013-04-13, version 0.6.0 #
-
-- Implemented chained operations via method math.select(). For example
- `math.select(3).add(4).subtract(2).done()` will return `5`.
-- Implemented methods gcd and lcm.
-- Implemented method `Unit.in(unit)`, which creates a clone of the unit with a
- fixed representation. For example `math.unit('5.08 cm').in('inch')` will
- return a unit which string representation always is in inch, thus `2 inch`.
- `Unit.in(unit)` is the same as method `math.in(x, unit)`.
-- Implemented `Unit.toNumber(unit)`, which returns the value of the unit when
- represented with given unit. For example
- `math.unit('5.08 cm').toNumber('inch')` returns the number `2`, as the
- representation of the unit in inches has 2 as value.
-- Improved: method `math.in(x, unit)` now supports a string as second parameter,
- for example `math.in(math.unit('5.08 cm'), 'inch')`.
-- Split the end user documentation of the parser functions from the source
- files.
-- Removed function help and the built-in documentation from the core library.
-- Fixed constant i being defined as -1i instead of 1i.
-- Minor bug fixes.
-
-2013-04-06, version 0.5.0 #
-
-- Implemented data types Matrix and Range.
-- Implemented matrix methods clone, concat, det, diag, eye, inv, ones, size,
- squeeze, transpose, zeros.
-- Implemented range operator `:`, and transpose operator `'` in parser.
-- Changed: created construction methods for easy object creation for all data
- types and for the parser. For example, a complex value is now created
- with `math.complex(2, 3)` instead of `new math.Complex(2, 3)`, and a parser
- is now created with `math.parser()` instead of `new math.parser.Parser()`.
-- Changed: moved all data types under the namespace math.type, and moved the
- Parser, Workspace, etc. under the namespace math.expr.
-- Changed: changed operator precedence of the power operator:
- - it is now right associative instead of left associative like most scripting
- languages. So `2^3^4` is now calculated as `2^(3^4)`.
- - it has now higher precedence than unary minus most languages, thus `-3^2` is
- now calculated as `-(3^2)`.
-- Changed: renamed the parsers method 'put' into 'set'.
-- Fixed: method 'in' did not check for units to have the same base.
-
-2013-03-16, version 0.4.0 #
-
-- Implemented Array support for all methods.
-- Implemented Array support in the Parser.
-- Implemented method format.
-- Implemented parser for units, math.Unit.parse(str).
-- Improved parser for complex values math.Complex.parse(str);
-- Improved method help: it now evaluates the examples.
-- Fixed: a scoping issue with the Parser when defining functions.
-- Fixed: method 'typeof' was not working well with minified and mangled code.
-- Fixed: errors in determining the best prefix for a unit.
-
-2013-03-09, version 0.3.0 #
-
-- Implemented Workspace
-- Implemented methods cot, csc, sec.
-- Implemented Array support for methods with one parameter.
-
-2013-02-25, version 0.2.0 #
-
-- Parser, Scope, and expression tree with Nodes implemented.
-- Implemented method import which makes it easy to extend math.js.
-- Implemented methods arg, conj, cube, equal, factorial, im, largereq,
- log(x, base), log10, mod, re, sign, smallereq, square, unequal.
-
-2013-02-18, version 0.1.0 #
-
-- Reached full compatibility with Javascripts built-in Math library.
-- More functions implemented.
-- Some bugfixes.
-
-2013-02-16, version 0.0.2 #
-
-- All constants of Math implemented, plus the imaginary unit i.
-- Data types Complex and Unit implemented.
-- First set of functions implemented.
-
-2013-02-15, version 0.0.1 #
-
-- First publish of the mathjs package. (package is still empty)
diff --git a/index.md b/index.md
deleted file mode 100644
index bc22c23548..0000000000
--- a/index.md
+++ /dev/null
@@ -1,121 +0,0 @@
----
-layout: default
-title: Home
----
-
-An extensive math library for JavaScript and Node.js #
-
-Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with different data types like numbers, big numbers, complex numbers, fractions, units, and matrices. Powerful and easy to use.
-
-Features #
-
-- Supports numbers, big numbers, bigint, complex numbers, fractions, units, strings, arrays, and matrices.
-- Is compatible with JavaScript's built-in Math library.
-- Contains a flexible expression parser.
-- Does symbolic computation.
-- Comes with a large set of built-in functions and constants.
-- Can be used as a command line application as well.
-- Runs on any JavaScript engine.
-- Is easily extensible.
-- Open source.
-
-
-
- Example #
-
- Here some example code demonstrating how to use the library.
- Click here to fiddle around.
-
-
-// functions and constants
-math.round(math.e, 3) // 2.718
-math.atan2(3, -3) / math.pi // 0.75
-math.log(10000, 10) // 4
-math.sqrt(-4) // 2i
-math.derivative('x^2 + x', 'x') // 2*x+1
-math.pow([[-1, 2], [3, 1]], 2)
- // [[7, 0], [0, 7]]
-
-// expressions
-math.evaluate('1.2 * (2 + 4.5)') // 7.8
-math.evaluate('12.7 cm to inch') // 5 inch
-math.evaluate('sin(45 deg) ^ 2') // 0.5
-math.evaluate('9 / 3 + 2i') // 3 + 2i
-math.evaluate('det([-1, 2; 3, 1])') // -7
-
-// chaining
-math.chain(3)
- .add(4)
- .multiply(2)
- .done() // 14
-
-
-
- Demo #
-
- Try the expression parser below.
- See Math Notepad for a full application.
-
- loading...
-
- Shortcut keys:
-
- - Press S to set focus to the input field
- - Press Ctrl+F11 to toggle full screen
- - Press Tab to autocomplete (repeat to cycle choices)
- - Enter "clear" to clear history
-
-
-
-
-
-
-
-
-
- Sponsor
-
-
-
-
-
-
-
-
-
-
-
- Tweet
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sponsored by
-
-
-
-
-
-
diff --git a/js/commandline.js b/js/commandline.js
deleted file mode 100644
index 5475bbce43..0000000000
--- a/js/commandline.js
+++ /dev/null
@@ -1,619 +0,0 @@
-/**
- * A small command line editor to demonstrate the math.js parser.
- * @param {Object} params Configuration parameter. Available:
- * {HTMLElement} container DOM Element to contain
- * the editor
- * {Object} [math] An instance of math.js
- * {String} [id] Optional id for the editor,
- * used to persist data.
- * "default" by default.
- */
-function CommandLineEditor (params) {
- // get instance of math.js from params, or create one
- var math = params.math || mathjs();
-
- // object with utility methods
- var util = {};
-
- /**
- * Returns the version of Internet Explorer or a -1
- * (indicating the use of another browser).
- * Source: https://msdn.microsoft.com/en-us/library/ms537509(v=vs.85).aspx
- * @return {Number} Internet Explorer version, or -1 in case of an other browser
- */
- util.getInternetExplorerVersion = function getInternetExplorerVersion () {
- var rv = -1; // Return value assumes failure.
- if (navigator.appName == 'Microsoft Internet Explorer')
- {
- var ua = navigator.userAgent;
- var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
- if (re.exec(ua) != null) {
- rv = parseFloat( RegExp.$1 );
- }
- }
- return rv;
- };
-
- /**
- * Add and event listener
- * @param {Element} element An html element
- * @param {string} action The action, for example "click",
- * without the prefix "on"
- * @param {function} listener The callback function to be executed
- */
- util.addEventListener = function addEventListener(element, action, listener) {
- if (element.addEventListener) {
- element.addEventListener(action, listener, false);
- } else {
- element.attachEvent('on' + action, listener); // IE browsers
- }
- };
-
- /**
- * Remove an event listener from an element
- * @param {Element} element An html dom element
- * @param {string} action The name of the event, for example "mousedown"
- * @param {function} listener The listener function
- */
- util.removeEventListener = function removeEventListener (element, action, listener) {
- if (element.removeEventListener) {
- element.removeEventListener(action, listener, false);
- } else {
- element.detachEvent('on' + action, listener); // IE browsers
- }
- };
-
- /**
- * Stop event propagation
- */
- util.stopPropagation = function stopPropagation (event) {
- if (event.stopPropagation) {
- event.stopPropagation(); // non-IE browsers
- }
- else {
- event.cancelBubble = true; // IE browsers
- }
- };
-
- /**
- * Cancels the event if it is cancelable, without stopping further propagation of the event.
- */
- util.preventDefault = function preventDefault (event) {
- if (event.preventDefault) {
- event.preventDefault(); // non-IE browsers
- }
- else {
- event.returnValue = false; // IE browsers
- }
- };
-
- /**
- * Clear all DOM childs from an element
- * @param {HTMLElement} element
- */
- util.clearDOM = function clearDOM (element) {
- while (element.firstChild) {
- element.removeChild(element.firstChild);
- }
- };
-
- // read the parameters
- var container = (params && params.container) ? params.container : undefined;
- if (!container) {
- throw new Error('Required parameter "container" missing in configuration parameters');
- }
- var id = (params && params.id) ? String(params.id) : 'default';
-
- // clear the container
- util.clearDOM(container);
-
- // validate if math.js is loaded.
- var error;
- if (typeof math === 'undefined' || !math.parser) {
- error = document.createElement('div');
- error.appendChild(document.createTextNode(
- 'Cannot create parser, math.js not loaded.'));
- error.style.color = 'red';
- container.appendChild(error);
- return;
- }
-
- // validate browser
- // the editor does not work well on IE7
- // TODO: make the demo working on IE7
- var ieVersion = util.getInternetExplorerVersion();
- if (ieVersion == 6 || ieVersion == 7) {
- error = document.createElement('div');
- error.appendChild(document.createTextNode(
- 'Sorry, this demo is not available on IE7 and older. The math.js ' +
- 'library itself works fine on every version of IE though.'));
- error.style.color = 'red';
- container.appendChild(error);
- return;
- }
-
- // define parameters
- var dom = {},
- fullscreen = false,
- history = [],
- historyIndex = -1,
- parser = math.parser();
-
- function resize() {
- // position the full screen button in the top right
- var top = 8;
- var right = (dom.topPanel.clientWidth - dom.results.clientWidth) + 6;
- dom.fullscreen.style.top = top + 'px';
- dom.fullscreen.style.right = right + 'px';
- }
-
- function toggleFullscreen() {
- if (fullscreen) {
- exitFullscreen();
- }
- else {
- showFullscreen()
- }
- }
-
- function showFullscreen() {
- dom.frame.className = 'cle fullscreen';
- document.body.style.overflow = 'hidden'; // (works only if body.style.height is defined)
- fullscreen = true;
- resize();
- scrollDown();
- dom.input.focus();
- }
-
- function exitFullscreen() {
- dom.frame.className = 'cle';
- document.body.style.overflow = '';
- fullscreen = false;
- resize();
- scrollDown();
- }
-
- function scrollDown() {
- dom.results.scrollTop = dom.results.scrollHeight;
- }
-
- var completionMatches = []
- var completionIndex = -1
-
- // Auto complete current input
- function autoComplete () {
- var name;
- var text = dom.input.value;
- var end = /[a-zA-Z_0-9]+$/.exec(text);
- if (end) {
- var keyword = end[0];
-
- if (completionIndex >= 0
- && completionIndex < completionMatches.length
- && keyword === completionMatches[completionIndex]) {
- // keyword is exactly what we last filled in; cycle through the matches
- ++completionIndex;
- if (completionIndex === completionMatches.length) completionIndex = 0
- } else {
- completionMatches = [];
- completionIndex = 0
- // Look in various places in turn to find completions:
- // scope variables
- for (const def in parser.getAll()) {
- if (def.indexOf(keyword) == 0) {
- completionMatches.push(def);
- }
- }
-
- // commandline keywords
- if ('clear'.indexOf(keyword) == 0
- && !completionMatches.includes('clear')) {
- completionMatches.push('clear');
- }
-
- // math functions and constants
- for (var func in math) {
- if (math.expression.mathWithTransform.hasOwnProperty(func)) {
- if (func.indexOf(keyword) == 0
- && !completionMatches.includes(func)) {
- completionMatches.push(func);
- }
- }
- }
-
- // units
- var Unit = math.Unit;
- for (name in Unit.UNITS) {
- if (Unit.UNITS.hasOwnProperty(name)) {
- if (name.indexOf(keyword) == 0
- && !completionMatches.includes(name)) {
- completionMatches.push(name);
- }
- }
- }
- for (name in Unit.PREFIXES) {
- if (Unit.PREFIXES.hasOwnProperty(name)) {
- var prefixes = Unit.PREFIXES[name];
- for (var prefix in prefixes) {
- if (prefixes.hasOwnProperty(prefix)) {
- if (prefix.indexOf(keyword) == 0
- && !completionMatches.includes(prefix)) {
- completionMatches.push(prefix);
- }
- else if (keyword.indexOf(prefix) == 0) {
- var unitKeyword = keyword.substring(prefix.length);
-
- for (var n in Unit.UNITS) {
- if (Unit.UNITS.hasOwnProperty(n)) {
- if (n.indexOf(unitKeyword) == 0
- && Unit.isValuelessUnit(prefix + n)
- && !completionMatches.includes(prefix + n)) {
- completionMatches.push(prefix + n);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- // TODO: in case of multiple matches, show a drop-down box to select one
- // but for now, just cycle through them
- const match = completionMatches[completionIndex];
- if (match) {
- text = text.substring(0, text.length - keyword.length) + match;
- dom.input.value = text;
- }
- }
- }
-
- /**
- * KeyDown event handler to catch global key presses in the window
- * @param {Event} event
- */
- function onWindowKeyDown (event) {
- if (dom.frame.parentNode != container) {
- destroy();
- }
-
- event = event || window.event;
- var target = event.target || event.srcElement;
- var keynum = event.which || event.keyCode;
- if (keynum == 83) { // s
- if (target.nodeName.toUpperCase() != 'INPUT') {
- dom.input.focus();
- util.preventDefault(event);
- util.stopPropagation(event);
- }
- }
- else if (keynum == 71) { // g
- if (target.nodeName.toUpperCase() != 'INPUT') {
- var search = document.getElementById('gsc-i-id1');
- if (search) search.focus();
- util.preventDefault(event);
- util.stopPropagation(event);
- }
- }
- else if (keynum == 27) { // ESC
- if (fullscreen) {
- exitFullscreen();
- util.preventDefault(event);
- util.stopPropagation(event);
- }
- }
- else if (event.ctrlKey && keynum == 122) { // Ctrl+F11
- toggleFullscreen();
- if (fullscreen) {
- dom.input.focus();
- }
- util.preventDefault(event);
- util.stopPropagation(event);
- }
- }
-
- /**
- * Resize event handler
- */
- function onWindowResize () {
- if (dom.frame.parentNode != container) {
- destroy();
- }
-
- resize();
- }
-
- /**
- * KeyDown handler for the input field
- * @param event
- * @returns {boolean}
- */
- function onKeyDown (event) {
- event = event || window.event;
-
- var keynum = event.which || event.keyCode;
- switch (keynum) {
- case 9: // Tab
- autoComplete();
- util.preventDefault(event);
- util.stopPropagation(event);
- return false;
- break;
-
- case 13: // Enter
- evalInput();
- util.preventDefault(event);
- util.stopPropagation(event);
- return false;
- break;
-
- case 38: // Arrow up
- if (historyIndex > 0) {
- historyIndex--;
- dom.input.value = history[historyIndex] || '';
- util.preventDefault(event);
- util.stopPropagation(event);
- }
- return false;
- break;
-
- case 40: // Arrow down
- if (historyIndex < history.length) {
- historyIndex++;
- dom.input.value = history[historyIndex] || '';
- util.preventDefault(event);
- util.stopPropagation(event);
- }
- return false;
- break;
-
- default:
- historyIndex = history.length;
- break;
- }
-
- return true;
- }
-
- /**
- * Destroy the editor: cleanup HTML DOM and global event listeners
- */
- function create() {
- // create main frame for the editor
- dom.frame = document.createElement('div');
- dom.frame.className = 'cle';
- container.appendChild(dom.frame);
-
- // create two panels for the layout
- dom.topPanel = document.createElement('div');
- dom.topPanel.className = 'top-panel';
- dom.frame.appendChild(dom.topPanel);
- dom.bottomPanel = document.createElement('div');
- dom.bottomPanel.className = 'bottom-panel';
- dom.frame.appendChild(dom.bottomPanel);
-
- // create div to hold the results
- dom.results = document.createElement('div');
- dom.results.className = 'results';
- dom.topPanel.appendChild(dom.results);
-
- // create fullscreen button
- dom.fullscreen = document.createElement('button');
- dom.fullscreen.className = 'fullscreen';
- dom.fullscreen.title = 'Toggle full screen display (Ctrl+F11)';
- dom.fullscreen.onclick = toggleFullscreen;
- dom.topPanel.appendChild(dom.fullscreen);
-
- // panels for the input field and button
- dom.inputLeft = document.createElement('div');
- dom.inputLeft.className = 'input-left';
- dom.bottomPanel.appendChild(dom.inputLeft);
- dom.inputRight = document.createElement('div');
- dom.inputRight.className = 'input-right';
- dom.bottomPanel.appendChild(dom.inputRight);
-
- dom.input = document.createElement('input');
- dom.input.className = 'input';
- dom.input.title = 'Enter an expression';
- dom.input.onkeydown = onKeyDown;
- dom.inputLeft.appendChild(dom.input);
-
- // create an eval button
- dom.btnEval = document.createElement('button');
- dom.btnEval.appendChild(document.createTextNode('Evaluate'));
- dom.btnEval.className = 'eval';
- dom.btnEval.title = 'Evaluate the expression (Enter)';
- dom.btnEval.onclick = evalInput;
- dom.inputRight.appendChild(dom.btnEval);
-
- // create global event listeners
- util.addEventListener(window, 'keydown', onWindowKeyDown);
- util.addEventListener(window, 'resize', onWindowResize);
- }
-
- /**
- * Destroy the editor: cleanup HTML DOM and global event listeners
- */
- function destroy() {
- // destroy DOM
- if (dom.frame.parentNode) {
- dom.frame.parentNode.removeChild(dom.frame);
- }
-
- // destroy event listeners
- util.removeEventListener(window, 'keydown', onWindowKeyDown);
- util.removeEventListener(window, 'resize', onWindowResize);
- }
-
- /**
- * Trim a string
- * https://stackoverflow.com/a/498995/1262753
- * @param str
- * @return {*|void}
- */
- function trim(str) {
- return str.replace(/^\s+|\s+$/g, '');
- }
-
- /**
- * Load saved expressions or example expressions
- */
- function load() {
- var expressions;
- if (localStorage) {
- // load expressions from local storage
- var data = localStorage[id];
- if (data) {
- expressions = JSON.parse(data);
- }
- }
- if (!expressions || !(expressions instanceof Array)) {
- // load some example expressions
- expressions = [
- '1.2 / (3.3 + 1.7)',
- 'a = 5.08 cm + 2 inch',
- 'a to inch',
- 'sin(90 deg)',
- 'f(x, y) = x ^ y',
- 'f(2, 3)'
- ];
- }
-
- // evaluate all expressions
- expressions.forEach(function (expr) {
- eval(expr);
- });
- }
-
- /**
- * Save executed expressions
- */
- function save() {
- if (localStorage) {
- localStorage[id] = JSON.stringify(history);
- }
- }
-
- function clear() {
- history = [];
- historyIndex = -1;
- parser.clear();
-
- util.clearDOM(dom.results);
- dom.input.value = '';
- resize();
- // save(); // TODO: save expressions (first we need a method to restore the examples)
- }
-
- function eval (expr) {
- expr = trim(expr);
-
- if (expr == 'clear') {
- clear();
- return;
- }
-
- if (expr) {
- history.push(expr);
- historyIndex = history.length;
-
- var res, resStr, info;
- try {
- res = parser.evaluate(expr);
- resStr = math.format(res, { precision: 14 });
- var unRoundedStr = math.format(res);
- if (unRoundedStr.length - resStr.length > 4) {
- info = [
- createDiv('This result contains a round-off error which is hidden from the output. The unrounded result is:'),
- createDiv(unRoundedStr),
- createA('read more...', 'docs/datatypes/numbers.html#roundoff-errors', '_blank')
- ];
- }
- }
- catch (err) {
- resStr = err.toString();
- }
-
- var preExpr = document.createElement('pre');
- preExpr.className = 'expr';
- preExpr.appendChild(document.createTextNode(expr));
- dom.results.appendChild(preExpr);
-
- var preRes = document.createElement('pre');
- preRes.className = 'res';
- preRes.appendChild(document.createTextNode(resStr));
- if (info) {
- var divInfo = document.createElement('div');
- info.forEach(function (elem) {
- divInfo.appendChild(elem);
- });
- divInfo.style.display = 'none';
-
- var divInfoIcon = document.createElement('span');
- divInfoIcon.appendChild(document.createTextNode('round-off error'));
- divInfoIcon.className = 'result-info-icon';
- divInfoIcon.title = 'Click to see more info';
- divInfoIcon.onclick = function () {
- // toggle display
- divInfo.style.display = (divInfo.style.display == '') ? 'none' : '';
- resize();
- };
-
- preRes.appendChild(divInfoIcon);
- preRes.appendChild(divInfo);
- }
- dom.results.appendChild(preRes);
-
- scrollDown();
- dom.input.value = '';
-
- resize();
- // save(); // TODO: save expressions (first we need a method to restore the examples)
- }
- }
-
- function evalInput() {
- eval(dom.input.value);
- }
-
- create();
- load();
-}
-
-var container = document.getElementById('commandline');
-if (container) {
- var editor = new CommandLineEditor({
- container: container,
- math: math
- });
-}
-
-
-/**
- * Test whether the child rect fits completely inside the parent rect.
- * @param {ClientRect} parent
- * @param {ClientRect} child
- * @param {number} margin
- */
-function insideRect (parent, child, margin) {
- var _margin = margin !== undefined ? margin : 0;
- return child.left - _margin >= parent.left
- && child.right + _margin <= parent.right
- && child.top - _margin >= parent.top
- && child.bottom + _margin <= parent.bottom;
-}
-
-function createDiv (text) {
- var div = document.createElement('div');
- div.appendChild(document.createTextNode(text));
- return div;
-}
-
-function createA (text, href, target) {
- var a = document.createElement('a');
- a.href = href;
- a.target = target || '';
- a.appendChild(document.createTextNode(text));
-
- return a;
-}
diff --git a/js/lib/math.js b/js/lib/math.js
deleted file mode 100644
index a6eb5a3b82..0000000000
--- a/js/lib/math.js
+++ /dev/null
@@ -1,3 +0,0 @@
-/*! For license information please see math.js.LICENSE.txt */
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.math=t():e.math=t()}(this,(()=>(()=>{var e={34:(e,t,n)=>{"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},81:(e,t,n)=>{"use strict";var r=n(9565),i=n(9306),o=n(8551),a=n(6823),s=n(851),u=TypeError;e.exports=function(e,t){var n=arguments.length<2?s(e):t;if(i(n))return o(r(n,e));throw new u(a(e)+" is not iterable")}},116:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(2652),a=n(9306),s=n(8551),u=n(1767),c=n(9539),l=n(4549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:l},{find:function(e){s(this);try{a(e)}catch(e){c(this,"throw",e)}if(l)return i(l,this,e);var t=u(this),n=0;return o(t,(function(t,r){if(e(t,n++))return r(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},280:(e,t,n)=>{"use strict";var r=n(6518),i=n(7751),o=n(6395),a=n(550),s=n(916).CONSTRUCTOR,u=n(3438),c=i("Promise"),l=o&&!s;r({target:"Promise",stat:!0,forced:o||s},{resolve:function(e){return u(l&&this===c?a:this,e)}})},283:(e,t,n)=>{"use strict";var r=n(9504),i=n(9039),o=n(4901),a=n(9297),s=n(3724),u=n(350).CONFIGURABLE,c=n(3706),l=n(1181),f=l.enforce,p=l.get,m=String,h=Object.defineProperty,d=r("".slice),g=r("".replace),y=r([].join),x=s&&!i((function(){return 8!==h((function(){}),"length",{value:8}).length})),b=String(String).split("String"),v=e.exports=function(e,t,n){"Symbol("===d(m(t),0,7)&&(t="["+g(m(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(s?h(e,"name",{value:t,configurable:!0}):e.name=t),x&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=f(e);return a(r,"source")||(r.source=y(b,"string"==typeof t?t:"")),e};Function.prototype.toString=v((function(){return o(this)&&p(this).source||c(this)}),"toString")},350:(e,t,n)=>{"use strict";var r=n(3724),i=n(9297),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,c=s&&(!r||r&&a(o,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},397:(e,t,n)=>{"use strict";var r=n(7751);e.exports=r("document","documentElement")},421:e=>{"use strict";e.exports={}},436:(e,t,n)=>{"use strict";var r,i,o,a=n(6518),s=n(6395),u=n(6193),c=n(4576),l=n(9565),f=n(6840),p=n(2967),m=n(687),h=n(7633),d=n(9306),g=n(4901),y=n(34),x=n(679),b=n(2293),v=n(9225).set,w=n(1955),N=n(3138),E=n(1103),A=n(8265),S=n(1181),M=n(550),C=n(916),T=n(6043),B="Promise",D=C.CONSTRUCTOR,F=C.REJECTION_EVENT,O=C.SUBCLASSING,_=S.getterFor(B),I=S.set,z=M&&M.prototype,k=M,R=z,q=c.TypeError,P=c.document,j=c.process,U=T.f,L=U,$=!!(P&&P.createEvent&&c.dispatchEvent),H="unhandledrejection",G=function(e){var t;return!(!y(e)||!g(t=e.then))&&t},V=function(e,t){var n,r,i,o=t.value,a=1===t.state,s=a?e.ok:e.fail,u=e.resolve,c=e.reject,f=e.domain;try{s?(a||(2===t.rejection&&X(t),t.rejection=1),!0===s?n=o:(f&&f.enter(),n=s(o),f&&(f.exit(),i=!0)),n===e.promise?c(new q("Promise-chain cycle")):(r=G(n))?l(r,n,u,c):u(n)):c(o)}catch(e){f&&!i&&f.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,w((function(){for(var n,r=e.reactions;n=r.get();)V(n,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},W=function(e,t,n){var r,i;$?((r=P.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),c.dispatchEvent(r)):r={promise:t,reason:n},!F&&(i=c["on"+e])?i(r):e===H&&N("Unhandled promise rejection",n)},Y=function(e){l(v,c,(function(){var t,n=e.facade,r=e.value;if(J(e)&&(t=E((function(){u?j.emit("unhandledRejection",r,n):W(H,n,r)})),e.rejection=u||J(e)?2:1,t.error))throw t.value}))},J=function(e){return 1!==e.rejection&&!e.parent},X=function(e){l(v,c,(function(){var t=e.facade;u?j.emit("rejectionHandled",t):W("rejectionhandled",t,e.value)}))},Q=function(e,t,n){return function(r){e(t,r,n)}},K=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Z(e,!0))},ee=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new q("Promise can't be resolved itself");var r=G(t);r?w((function(){var n={done:!1};try{l(r,t,Q(ee,n,e),Q(K,n,e))}catch(t){K(n,t,e)}})):(e.value=t,e.state=1,Z(e,!1))}catch(t){K({done:!1},t,e)}}};if(D&&(R=(k=function(e){x(this,R),d(e),l(r,this);var t=_(this);try{e(Q(ee,t),Q(K,t))}catch(e){K(t,e)}}).prototype,(r=function(e){I(this,{type:B,done:!1,notified:!1,parent:!1,reactions:new A,rejection:!1,state:0,value:null})}).prototype=f(R,"then",(function(e,t){var n=_(this),r=U(b(this,k));return n.parent=!0,r.ok=!g(e)||e,r.fail=g(t)&&t,r.domain=u?j.domain:void 0,0===n.state?n.reactions.add(r):w((function(){V(r,n)})),r.promise})),i=function(){var e=new r,t=_(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(K,t)},T.f=U=function(e){return e===k||void 0===e?new i(e):L(e)},!s&&g(M)&&z!==Object.prototype)){o=z.then,O||f(z,"then",(function(e,t){var n=this;return new k((function(e,t){l(o,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete z.constructor}catch(e){}p&&p(z,R)}a({global:!0,constructor:!0,wrap:!0,forced:D},{Promise:k}),m(k,B,!1,!0),h(B)},537:(e,t,n)=>{"use strict";var r=n(550),i=n(4428),o=n(916).CONSTRUCTOR;e.exports=o||!i((function(e){r.all(e).then(void 0,(function(){}))}))},550:(e,t,n)=>{"use strict";var r=n(4576);e.exports=r.Promise},616:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},655:(e,t,n)=>{"use strict";var r=n(6955),i=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},679:(e,t,n)=>{"use strict";var r=n(1625),i=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new i("Incorrect invocation")}},687:(e,t,n)=>{"use strict";var r=n(4913).f,i=n(9297),o=n(8227)("toStringTag");e.exports=function(e,t,n){e&&!n&&(e=e.prototype),e&&!i(e,o)&&r(e,o,{configurable:!0,value:t})}},741:e=>{"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},757:(e,t,n)=>{"use strict";var r=n(7751),i=n(4901),o=n(1625),a=n(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&o(t.prototype,s(e))}},788:(e,t,n)=>{"use strict";var r=n(34),i=n(2195),o=n(8227)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[o])?!!t:"RegExp"===i(e))}},851:(e,t,n)=>{"use strict";var r=n(6955),i=n(5966),o=n(4117),a=n(6269),s=n(8227)("iterator");e.exports=function(e){if(!o(e))return i(e,s)||i(e,"@@iterator")||a[r(e)]}},916:(e,t,n)=>{"use strict";var r=n(4576),i=n(550),o=n(4901),a=n(2796),s=n(3706),u=n(8227),c=n(4215),l=n(6395),f=n(9519),p=i&&i.prototype,m=u("species"),h=!1,d=o(r.PromiseRejectionEvent),g=a("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===f)return!0;if(l&&(!p.catch||!p.finally))return!0;if(!f||f<51||!/native code/.test(e)){var n=new i((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[m]=r,!(h=n.then((function(){}))instanceof r))return!0}return!(t||"BROWSER"!==c&&"DENO"!==c||d)}));e.exports={CONSTRUCTOR:g,REJECTION_EVENT:d,SUBCLASSING:h}},926:(e,t,n)=>{"use strict";var r=n(9306),i=n(8981),o=n(7055),a=n(6198),s=TypeError,u="Reduce of empty array with no initial value",c=function(e){return function(t,n,c,l){var f=i(t),p=o(f),m=a(f);if(r(n),0===m&&c<2)throw new s(u);var h=e?m-1:0,d=e?-1:1;if(c<2)for(;;){if(h in p){l=p[h],h+=d;break}if(h+=d,e?h<0:m<=h)throw new s(u)}for(;e?h>=0:m>h;h+=d)h in p&&(l=n(l,p[h],h,f));return l}};e.exports={left:c(!1),right:c(!0)}},1034:(e,t,n)=>{"use strict";var r=n(9565),i=n(9297),o=n(1625),a=n(7979),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||i(e,"flags")||!o(s,e)?t:r(a,e)}},1056:(e,t,n)=>{"use strict";var r=n(4913).f;e.exports=function(e,t,n){n in e||r(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})}},1072:(e,t,n)=>{"use strict";var r=n(1828),i=n(8727);e.exports=Object.keys||function(e){return r(e,i)}},1103:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},1148:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(2652),a=n(9306),s=n(8551),u=n(1767),c=n(9539),l=n(4549)("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:l},{every:function(e){s(this);try{a(e)}catch(e){c(this,"throw",e)}if(l)return i(l,this,e);var t=u(this),n=0;return!o(t,(function(t,r){if(!e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1181:(e,t,n)=>{"use strict";var r,i,o,a=n(8622),s=n(4576),u=n(34),c=n(6699),l=n(9297),f=n(7629),p=n(6119),m=n(421),h="Object already initialized",d=s.TypeError,g=s.WeakMap;if(a||f.state){var y=f.state||(f.state=new g);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new d(h);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},o=function(e){return y.has(e)}}else{var x=p("state");m[x]=!0,r=function(e,t){if(l(e,x))throw new d(h);return t.facade=e,c(e,x,t),t},i=function(e){return l(e,x)?e[x]:{}},o=function(e){return l(e,x)}}e.exports={set:r,get:i,has:o,enforce:function(e){return o(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!u(t)||(n=i(t)).type!==e)throw new d("Incompatible receiver, "+e+" required");return n}}}},1234:()=>{},1291:(e,t,n)=>{"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},1454:(e,t,n)=>{"use strict";n(1701)},1481:(e,t,n)=>{"use strict";var r=n(6518),i=n(6043);r({target:"Promise",stat:!0,forced:n(916).CONSTRUCTOR},{reject:function(e){var t=i.f(this);return(0,t.reject)(e),t.promise}})},1504:e=>{function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r{"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1701:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(9306),a=n(8551),s=n(1767),u=n(9462),c=n(6319),l=n(9539),f=n(4549),p=n(6395),m=!p&&f("map",TypeError),h=u((function(){var e=this.iterator,t=a(i(this.next,e));if(!(this.done=!!t.done))return c(e,this.mapper,[t.value,this.counter++],!0)}));r({target:"Iterator",proto:!0,real:!0,forced:p||m},{map:function(e){a(this);try{o(e)}catch(e){l(this,"throw",e)}return m?i(m,this,e):new h(s(this),{mapper:e})}})},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1795:(e,t,n)=>{"use strict";n(1806)},1806:(e,t,n)=>{"use strict";var r=n(6518),i=n(8551),o=n(2652),a=n(1767),s=[].push;r({target:"Iterator",proto:!0,real:!0},{toArray:function(){var e=[];return o(a(i(this)),s,{that:e,IS_RECORD:!0}),e}})},1828:(e,t,n)=>{"use strict";var r=n(9504),i=n(9297),o=n(5397),a=n(9617).indexOf,s=n(421),u=r([].push);e.exports=function(e,t){var n,r=o(e),c=0,l=[];for(n in r)!i(s,n)&&i(r,n)&&u(l,n);for(;t.length>c;)i(r,n=t[c++])&&(~a(l,n)||u(l,n));return l}},1880:e=>{e.exports=function e(t,n){"use strict";var r,i,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},f=l(t).replace(a,"")||"",p=l(n).replace(a,"")||"",m=f.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=parseInt(f.match(u),16)||1!==m.length&&f.match(s)&&Date.parse(f),g=parseInt(p.match(u),16)||d&&p.match(s)&&Date.parse(p)||null;if(g){if(dg)return 1}for(var y=0,x=Math.max(m.length,h.length);yi)return 1}return 0}},1955:(e,t,n)=>{"use strict";var r,i,o,a,s,u=n(4576),c=n(3389),l=n(6080),f=n(9225).set,p=n(8265),m=n(9544),h=n(4265),d=n(7860),g=n(6193),y=u.MutationObserver||u.WebKitMutationObserver,x=u.document,b=u.process,v=u.Promise,w=c("queueMicrotask");if(!w){var N=new p,E=function(){var e,t;for(g&&(e=b.domain)&&e.exit();t=N.get();)try{t()}catch(e){throw N.head&&r(),e}e&&e.enter()};m||g||d||!y||!x?!h&&v&&v.resolve?((a=v.resolve(void 0)).constructor=v,s=l(a.then,a),r=function(){s(E)}):g?r=function(){b.nextTick(E)}:(f=l(f,u),r=function(){f(E)}):(i=!0,o=x.createTextNode(""),new y(E).observe(o,{characterData:!0}),r=function(){o.data=i=!i}),w=function(e){N.head||r(),N.add(e)}}e.exports=w},2003:(e,t,n)=>{"use strict";var r=n(6518),i=n(6395),o=n(916).CONSTRUCTOR,a=n(550),s=n(7751),u=n(4901),c=n(6840),l=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&u(a)){var f=s("Promise").prototype.catch;l.catch!==f&&c(l,"catch",f,{unsafe:!0})}},2106:(e,t,n)=>{"use strict";var r=n(283),i=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}},2140:(e,t,n)=>{"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},2195:(e,t,n)=>{"use strict";var r=n(9504),i=r({}.toString),o=r("".slice);e.exports=function(e){return o(i(e),8,-1)}},2211:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2293:(e,t,n)=>{"use strict";var r=n(8551),i=n(5548),o=n(4117),a=n(8227)("species");e.exports=function(e,t){var n,s=r(e).constructor;return void 0===s||o(n=r(s)[a])?t:i(n)}},2360:(e,t,n)=>{"use strict";var r,i=n(8551),o=n(6801),a=n(8727),s=n(421),u=n(397),c=n(4055),l=n(6119),f="prototype",p="script",m=l("IE_PROTO"),h=function(){},d=function(e){return"<"+p+">"+e+""+p+">"},g=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?g(r):(t=c("iframe"),n="java"+p+":",t.style.display="none",u.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):g(r);for(var i=a.length;i--;)delete y[f][a[i]];return y()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[f]=i(e),n=new h,h[f]=null,n[m]=e):n=y(),void 0===t?n:o.f(n,t)}},2369:function(e){e.exports=function(){"use strict";function e(){return!0}function t(){return!1}function n(){}const r="Argument is not a typed-function.";return function i(){function o(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const a=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:o},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],s={name:"any",test:e,isAny:!0};let u,c,l=0,f={createCount:0};function p(e){const t=u.get(e);if(t)return t;let n='Unknown type "'+e+'"';const r=e.toLowerCase();let i;for(i of c)if(i.toLowerCase()===r){n+='. Did you mean "'+i+'" ?';break}throw new TypeError(n)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const n=t?p(t).index:c.length,r=[];for(let t=0;t{const n=u.get(t);return!n.isAny&&n.test(e)}));return t.length?t:["any"]}function g(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function y(e,t,n){if(!g(e))throw new TypeError(r);const i=n&&n.exact,o=N(Array.isArray(t)?t.join(","):t),a=x(o);if(!i||a in e.signatures){const t=e._typedFunctionData.signatureMap.get(a);if(t)return t}const s=o.length;let u,c;if(i){let t;for(t in u=[],e.signatures)u.push(e._typedFunctionData.signatureMap.get(t))}else u=e._typedFunctionData.signatures;for(let e=0;e!e.has(t.name))))continue}n.push(r)}}if(u=n,0===u.length)break}for(c of u)if(c.params.length<=s)return c;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+x(o,", ")+"))")}function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function b(e){const t=0===e.indexOf("..."),n=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>p(e.trim())));let r=!1,i=t?"...":"";return{types:n.map((function(e){return r=e.isAny||r,i+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function v(e){const t=function(e){if(0===e.length)return[];const t=e.map(p);e.length>1&&t.sort(((e,t)=>e.index-t.index));let n=t[0].conversionsTo;if(1===e.length)return n;n=n.concat([]);const r=new Set(e);for(let e=1;ee.name)));let n=e.hasAny,r=e.name;const i=t.map((function(e){const t=p(e.from);return n=t.isAny||n,r+="|"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}}));return{types:e.types.concat(i),name:r,hasAny:n,hasConversion:i.length>0,restParam:e.restParam}}function w(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function N(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const n=e.trim();if(""===n)return t;const r=n.split(",");for(let e=0;e=n+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=A(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=A(e[0]),r=A(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(A),function(e){for(let n=0;n{const r=C(e.params,t);let i;for(i of r)n.add(i)})),n.has("any")?["any"]:Array.from(n)}function D(e,t,n){let r,i;const o=e||"unnamed";let a,s=n;for(a=0;a{const r=A(M(n.params,a));(a0){const e=d(t[a]);return r=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+a+")"),r.data={category:"wrongType",fn:o,index:a,actual:e,expected:i},r}}else s=e}const u=s.map((function(e){return E(e.params)?1/0:e.params.length}));if(t.lengthc)return r=new TypeError("Too many arguments in function "+o+" (expected: "+c+", actual: "+t.length+")"),r.data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:c},r;const l=[];for(let e=0;e0)return 1;const r=O(e)-O(t);return r<0?-1:r>0?1:0}function I(e,t){const n=e.params,r=t.params,i=H(n),o=H(r),a=E(n),s=E(r);if(a&&i.hasAny){if(!s||!o.hasAny)return 1}else if(s&&o.hasAny)return-1;let u,c=0,l=0;for(u of n)u.hasAny&&++c,u.hasConversion&&++l;let f=0,p=0;for(u of r)u.hasAny&&++f,u.hasConversion&&++p;if(c!==f)return c-f;if(a&&i.hasConversion){if(!s||!o.hasConversion)return 1}else if(s&&o.hasConversion)return-1;if(l!==p)return l-p;if(a){if(!s)return 1}else if(s)return-1;const m=(n.length-r.length)*(a?-1:1);if(0!==m)return m;const h=[];let d,g=0;for(let e=0;ee.hasConversion))){const r=E(e),i=e.map(k);n=function(){const e=[],n=r?arguments.length-1:arguments.length;for(let t=0;te.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),s.push(a)}else s=a.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return i=s,o=function(i){return e(t,n+1,r.concat([i]))},Array.prototype.concat.apply([],i.map(o))}var i,o;return[r]}(e,0,[])}function q(e,t){const n=Math.max(e.length,t.length);for(let r=0;r=r:a?r>=i:r===i}function P(e,t,n){const r=[];let i;for(i of e){let e=n[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;r.push(e)}return r}function j(e,t,n){const r=function(e){return e.map((e=>Y(e)?Z(e.referToSelf.callback):W(e)?V(e.referTo.references,e.referTo.callback):e))}(e),i=new Array(r.length).fill(!1);let o=!0;for(;o;){o=!1;let e=!0;for(let a=0;a{const r=e[n];if(t.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}(r);const i=[],o=[],a={},s=[];let u;for(u in r){if(!Object.prototype.hasOwnProperty.call(r,u))continue;const e=N(u);if(!e)continue;i.forEach((function(t){if(q(t,e))throw new TypeError('Conflicting signatures "'+x(t)+'" and "'+x(e)+'".')})),i.push(e);const t=o.length;o.push(r[u]);const n=e.map(v);let c;for(c of R(n)){const e=x(c);s.push({params:c,name:e,fn:t}),c.every((e=>!e.hasConversion))&&(a[e]=t)}}s.sort(I);const c=j(o,a,se);let l;for(l in a)Object.prototype.hasOwnProperty.call(a,l)&&(a[l]=c[a[l]]);const p=[],m=new Map;for(l of s)m.has(l.name)||(l.fn=c[l.fn],p.push(l),m.set(l.name,l));const h=p[0]&&p[0].params.length<=2&&!E(p[0].params),d=p[1]&&p[1].params.length<=2&&!E(p[1].params),g=p[2]&&p[2].params.length<=2&&!E(p[2].params),y=p[3]&&p[3].params.length<=2&&!E(p[3].params),b=p[4]&&p[4].params.length<=2&&!E(p[4].params),w=p[5]&&p[5].params.length<=2&&!E(p[5].params),M=h&&d&&g&&y&&b&&w;for(let e=0;ee.test)),oe=p.map((e=>e.implementation)),ae=function(){for(let e=ne;ex(N(e)))),t=H(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return V(e,t)},f.referToSelf=Z,f.convert=function(e,t){const n=p(t);if(n.test(e))return e;const r=n.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+t+" defined.");for(let t=0;t1&&void 0!==arguments[1]?arguments[1]:{override:!1};ee(e);const n=p(e.to),r=n.conversionsTo.find((t=>t.from===e.from));if(r){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+n.name+'"');f.removeConversion({from:r.from,to:e.to,convert:r.convert})}n.conversionsTo.push({from:e.from,convert:e.convert,index:l++})},f.addConversions=function(e,t){e.forEach((e=>f.addConversion(e,t)))},f.removeConversion=function(e){ee(e);const t=p(e.to),n=function(e,t){for(let n=0;nt.from===e.from));if(!n)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(n.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},f.resolve=function(e,t){if(!g(e))throw new TypeError(r);const n=e._typedFunctionData.signatures;for(let e=0;e{"use strict";var r=n(9504),i=n(8981),o=Math.floor,a=r("".charAt),s=r("".replace),u=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,n,r,f,p){var m=n+e.length,h=r.length,d=l;return void 0!==f&&(f=i(f),d=c),s(p,d,(function(i,s){var c;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return u(t,0,n);case"'":return u(t,m);case"<":c=f[u(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>h){var p=o(l/10);return 0===p?i:p<=h?void 0===r[p-1]?a(s,1):r[p-1]+a(s,1):i}c=r[l-1]}return void 0===c?"":c}))}},2489:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(9306),a=n(8551),s=n(1767),u=n(9462),c=n(6319),l=n(6395),f=n(9539),p=n(4549),m=!l&&p("filter",TypeError),h=u((function(){for(var e,t,n=this.iterator,r=this.predicate,o=this.next;;){if(e=a(i(o,n)),this.done=!!e.done)return;if(t=e.value,c(n,r,[t,this.counter++],!0))return t}}));r({target:"Iterator",proto:!0,real:!0,forced:l||m},{filter:function(e){a(this);try{o(e)}catch(e){f(this,"throw",e)}return m?i(m,this,e):new h(s(this),{predicate:e})}})},2529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},2577:(e,t,n)=>{"use strict";n(116)},2652:(e,t,n)=>{"use strict";var r=n(6080),i=n(9565),o=n(8551),a=n(6823),s=n(4209),u=n(6198),c=n(1625),l=n(81),f=n(851),p=n(9539),m=TypeError,h=function(e,t){this.stopped=e,this.result=t},d=h.prototype;e.exports=function(e,t,n){var g,y,x,b,v,w,N,E=n&&n.that,A=!(!n||!n.AS_ENTRIES),S=!(!n||!n.IS_RECORD),M=!(!n||!n.IS_ITERATOR),C=!(!n||!n.INTERRUPTED),T=r(t,E),B=function(e){return g&&p(g,"normal",e),new h(!0,e)},D=function(e){return A?(o(e),C?T(e[0],e[1],B):T(e[0],e[1])):C?T(e,B):T(e)};if(S)g=e.iterator;else if(M)g=e;else{if(!(y=f(e)))throw new m(a(e)+" is not iterable");if(s(y)){for(x=0,b=u(e);b>x;x++)if((v=D(e[x]))&&c(d,v))return v;return new h(!1)}g=l(e,y)}for(w=S?e.next:g.next;!(N=i(w,g)).done;){try{v=D(N.value)}catch(e){p(g,"throw",e)}if("object"==typeof v&&v&&c(d,v))return v}return new h(!1)}},2712:(e,t,n)=>{"use strict";var r=n(6518),i=n(926).left,o=n(4598),a=n(9519);r({target:"Array",proto:!0,forced:!n(6193)&&a>79&&a<83||!o("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},2777:(e,t,n)=>{"use strict";var r=n(9565),i=n(34),o=n(757),a=n(5966),s=n(4270),u=n(8227),c=TypeError,l=u("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var n,u=a(e,l);if(u){if(void 0===t&&(t="default"),n=r(u,e,t),!i(n)||o(n))return n;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},2787:(e,t,n)=>{"use strict";var r=n(9297),i=n(4901),o=n(8981),a=n(6119),s=n(2211),u=a("IE_PROTO"),c=Object,l=c.prototype;e.exports=s?c.getPrototypeOf:function(e){var t=o(e);if(r(t,u))return t[u];var n=t.constructor;return i(n)&&t instanceof n?n.prototype:t instanceof c?l:null}},2796:(e,t,n)=>{"use strict";var r=n(9039),i=n(4901),o=/#|\.prototype\./,a=function(e,t){var n=u[s(e)];return n===l||n!==c&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(o,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},2812:e=>{"use strict";var t=TypeError;e.exports=function(e,n){if(e{"use strict";var r=n(4576).navigator,i=r&&r.userAgent;e.exports=i?String(i):""},2967:(e,t,n)=>{"use strict";var r=n(6706),i=n(34),o=n(7750),a=n(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return o(n),a(r),i(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},3031:function(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xorwow=s}(0,e=n.nmd(e),n.amdD)},3110:(e,t,n)=>{"use strict";var r=n(6518),i=n(7751),o=n(8745),a=n(9565),s=n(9504),u=n(9039),c=n(4901),l=n(757),f=n(7680),p=n(6933),m=n(4495),h=String,d=i("JSON","stringify"),g=s(/./.exec),y=s("".charAt),x=s("".charCodeAt),b=s("".replace),v=s(1..toString),w=/[\uD800-\uDFFF]/g,N=/^[\uD800-\uDBFF]$/,E=/^[\uDC00-\uDFFF]$/,A=!m||u((function(){var e=i("Symbol")("stringify detection");return"[null]"!==d([e])||"{}"!==d({a:e})||"{}"!==d(Object(e))})),S=u((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")})),M=function(e,t){var n=f(arguments),r=p(t);if(c(r)||void 0!==e&&!l(e))return n[1]=function(e,t){if(c(r)&&(t=a(r,this,h(e),t)),!l(t))return t},o(d,null,n)},C=function(e,t,n){var r=y(n,t-1),i=y(n,t+1);return g(N,e)&&!g(E,i)||g(E,e)&&!g(N,r)?"\\u"+v(x(e,0),16):e};d&&r({target:"JSON",stat:!0,arity:3,forced:A||S},{stringify:function(e,t,n){var r=f(arguments),i=o(A?M:d,null,r);return S&&"string"==typeof i?b(i,w,C):i}})},3138:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},3144:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},a=o.preserveFormatting,s=void 0!==a&&a,u=o.escapeMapFn,c=void 0===u?i:u,l=String(e),f="",p=c(t({},n),s?t({},r):{}),m=Object.keys(p),h=function(){var e=!1;m.forEach((function(t,n){e||l.length>=t.length&&l.slice(0,t.length)===t&&(f+=p[m[n]],l=l.slice(t.length,l.length),e=!0)})),e||(f+=l.slice(0,1),l=l.slice(1,l.length))};l;)h();return f}},3167:(e,t,n)=>{"use strict";var r=n(4901),i=n(34),o=n(2967);e.exports=function(e,t,n){var a,s;return o&&r(a=t.constructor)&&a!==n&&i(s=a.prototype)&&s!==n.prototype&&o(e,s),e}},3181:function(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xor128=s}(0,e=n.nmd(e),n.amdD)},3215:(e,t,n)=>{"use strict";n(1148)},3362:(e,t,n)=>{"use strict";n(436),n(6499),n(2003),n(7743),n(1481),n(280)},3389:(e,t,n)=>{"use strict";var r=n(4576),i=n(3724),o=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!i)return r[e];var t=o(r,e);return t&&t.value}},3392:(e,t,n)=>{"use strict";var r=n(9504),i=0,o=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+o,36)}},3438:(e,t,n)=>{"use strict";var r=n(8551),i=n(34),o=n(6043);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},3506:(e,t,n)=>{"use strict";var r=n(3925),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},3517:(e,t,n)=>{"use strict";var r=n(9504),i=n(9039),o=n(4901),a=n(6955),s=n(7751),u=n(3706),c=function(){},l=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,p=r(f.exec),m=!f.test(c),h=function(e){if(!o(e))return!1;try{return l(c,[],e),!0}catch(e){return!1}},d=function(e){if(!o(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return m||!!p(f,u(e))}catch(e){return!0}};d.sham=!0,e.exports=!l||i((function(){var e;return h(h.call)||!h(Object)||!h((function(){e=!0}))||e}))?d:h},3579:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(2652),a=n(9306),s=n(8551),u=n(1767),c=n(9539),l=n(4549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:l},{some:function(e){s(this);try{a(e)}catch(e){c(this,"throw",e)}if(l)return i(l,this,e);var t=u(this),n=0;return o(t,(function(t,r){if(e(t,n++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3607:(e,t,n)=>{"use strict";var r=n(2839).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},3635:(e,t,n)=>{"use strict";var r=n(9039),i=n(4576).RegExp;e.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},3706:(e,t,n)=>{"use strict";var r=n(9504),i=n(4901),o=n(7629),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return a(e)}),e.exports=o.inspectSource},3709:(e,t,n)=>{"use strict";var r=n(2839).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},3724:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3763:(e,t,n)=>{"use strict";var r=n(2839);e.exports=/MSIE|Trident/.test(r)},3921:(e,t,n)=>{"use strict";var r=n(6518),i=n(2652),o=n(4659);r({target:"Object",stat:!0},{fromEntries:function(e){var t={};return i(e,(function(e,n){o(t,e,n)}),{AS_ENTRIES:!0}),t}})},3925:(e,t,n)=>{"use strict";var r=n(34);e.exports=function(e){return r(e)||null===e}},3949:(e,t,n)=>{"use strict";n(7588)},4055:(e,t,n)=>{"use strict";var r=n(4576),i=n(34),o=r.document,a=i(o)&&i(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},4117:e=>{"use strict";e.exports=function(e){return null==e}},4209:(e,t,n)=>{"use strict";var r=n(8227),i=n(6269),o=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||a[o]===e)}},4215:(e,t,n)=>{"use strict";var r=n(4576),i=n(2839),o=n(2195),a=function(e){return i.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===o(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"},4265:(e,t,n)=>{"use strict";var r=n(2839);e.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},4270:(e,t,n)=>{"use strict";var r=n(9565),i=n(4901),o=n(34),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&i(n=e.toString)&&!o(s=r(n,e)))return s;if(i(n=e.valueOf)&&!o(s=r(n,e)))return s;if("string"!==t&&i(n=e.toString)&&!o(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},4376:(e,t,n)=>{"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4423:(e,t,n)=>{"use strict";var r=n(6518),i=n(9617).includes,o=n(9039),a=n(6469);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},4428:(e,t,n)=>{"use strict";var r=n(8227)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(e){}return n}},4488:(e,t,n)=>{"use strict";var r=n(7680),i=Math.floor,o=function(e,t){var n=e.length;if(n<8)for(var a,s,u=1;u0;)e[s]=e[--s];s!==u++&&(e[s]=a)}else for(var c=i(n/2),l=o(r(e,0,c),t),f=o(r(e,c),t),p=l.length,m=f.length,h=0,d=0;h{"use strict";var r=n(9519),i=n(9039),o=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},4520:(e,t,n)=>{"use strict";n(2489)},4549:(e,t,n)=>{"use strict";var r=n(4576);e.exports=function(e,t){var n=r.Iterator,i=n&&n.prototype,o=i&&i[e],a=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(e){e instanceof t||(a=!1)}if(!a)return o}},4576:function(e){"use strict";var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:(e,t,n)=>{"use strict";var r=n(9039);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){return 1},1)}))}},4606:(e,t,n)=>{"use strict";var r=n(6823),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+r(t)+" of "+r(e))}},4659:(e,t,n)=>{"use strict";var r=n(3724),i=n(4913),o=n(6980);e.exports=function(e,t,n){r?i.f(e,t,o(0,n)):e[t]=n}},4801:function(e,t,n){var r;!function(i,o,a){var s,u=256,c=a.pow(u,6),l=a.pow(2,52),f=2*l,p=255;function m(e,t,n){var r=[],p=y(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,x(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(u):(e=new Uint8Array(u),(i.crypto||i.msCrypto).getRandomValues(e)),x(e)}catch(e){var t=i.navigator,n=t&&t.plugins;return[+new Date,i,n,i.screen,x(o)]}}():e,3),r),m=new h(r),b=function(){for(var e=m.g(6),t=c,n=0;e=f;)e/=2,t/=2,n>>>=1;return(e+n)/t};return b.int32=function(){return 0|m.g(4)},b.quick=function(){return m.g(4)/4294967296},b.double=b,y(x(m.S),o),(t.pass||n||function(e,t,n,r){return r&&(r.S&&d(r,m),e.state=function(){return d(m,{})}),n?(a.random=e,t):e})(b,p,"global"in t?t.global:this==a,t.state)}function h(e){var t,n=e.length,r=this,i=0,o=r.i=r.j=0,a=r.S=[];for(n||(e=[n++]);i{"use strict";var r=n(3724),i=n(4576),o=n(9504),a=n(2796),s=n(3167),u=n(6699),c=n(2360),l=n(8480).f,f=n(1625),p=n(788),m=n(655),h=n(1034),d=n(8429),g=n(1056),y=n(6840),x=n(9039),b=n(9297),v=n(1181).enforce,w=n(7633),N=n(8227),E=n(3635),A=n(8814),S=N("match"),M=i.RegExp,C=M.prototype,T=i.SyntaxError,B=o(C.exec),D=o("".charAt),F=o("".replace),O=o("".indexOf),_=o("".slice),I=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,z=/a/g,k=/a/g,R=new M(z)!==z,q=d.MISSED_STICKY,P=d.UNSUPPORTED_Y;if(a("RegExp",r&&(!R||q||E||A||x((function(){return k[S]=!1,M(z)!==z||M(k)===k||"/a/i"!==String(M(z,"i"))}))))){for(var j=function(e,t){var n,r,i,o,a,l,d=f(C,this),g=p(e),y=void 0===t,x=[],w=e;if(!d&&g&&y&&e.constructor===j)return e;if((g||f(C,e))&&(e=e.source,y&&(t=h(w))),e=void 0===e?"":m(e),t=void 0===t?"":m(t),w=e,E&&"dotAll"in z&&(r=!!t&&O(t,"s")>-1)&&(t=F(t,/s/g,"")),n=t,q&&"sticky"in z&&(i=!!t&&O(t,"y")>-1)&&P&&(t=F(t,/y/g,"")),A&&(o=function(e){for(var t,n=e.length,r=0,i="",o=[],a=c(null),s=!1,u=!1,l=0,f="";r<=n;r++){if("\\"===(t=D(e,r)))t+=D(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(i+=t,"?:"===_(e,r+1,r+3))continue;B(I,_(e,r+1))&&(r+=2,u=!0),l++;continue;case">"===t&&u:if(""===f||b(a,f))throw new T("Invalid capture group name");a[f]=!0,o[o.length]=[f,l],u=!1,f="";continue}u?f+=t:i+=t}return[i,o]}(e),e=o[0],x=o[1]),a=s(M(e,t),d?this:C,j),(r||i||x.length)&&(l=v(a),r&&(l.dotAll=!0,l.raw=j(function(e){for(var t,n=e.length,r=0,i="",o=!1;r<=n;r++)"\\"!==(t=D(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+D(e,++r);return i}(e),n)),i&&(l.sticky=!0),x.length&&(l.groups=x)),e!==w)try{u(a,"source",""===w?"(?:)":w)}catch(e){}return a},U=l(M),L=0;U.length>L;)g(j,M,U[L++]);C.constructor=j,j.prototype=C,y(i,"RegExp",j,{constructor:!0})}w("RegExp")},4901:e=>{"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4913:(e,t,n)=>{"use strict";var r=n(3724),i=n(5917),o=n(8686),a=n(8551),s=n(6969),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,f="enumerable",p="configurable",m="writable";t.f=r?o?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&m in n&&!n[m]){var r=l(e,t);r&&r[m]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:f in n?n[f]:r[f],writable:!1})}return c(e,t,n)}:c:function(e,t,n){if(a(e),t=s(t),a(n),i)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new u("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},5031:(e,t,n)=>{"use strict";var r=n(7751),i=n(9504),o=n(8480),a=n(3717),s=n(8551),u=i([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(s(e)),n=a.f;return n?u(t,n(e)):t}},5397:(e,t,n)=>{"use strict";var r=n(7055),i=n(7750);e.exports=function(e){return r(i(e))}},5440:(e,t,n)=>{"use strict";var r=n(8745),i=n(9565),o=n(9504),a=n(9228),s=n(9039),u=n(8551),c=n(4901),l=n(34),f=n(1291),p=n(8014),m=n(655),h=n(7750),d=n(7829),g=n(5966),y=n(2478),x=n(6682),b=n(8227)("replace"),v=Math.max,w=Math.min,N=o([].concat),E=o([].push),A=o("".indexOf),S=o("".slice),M="$0"==="a".replace(/./,"$0"),C=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(e,t,n){var o=C?"$":"$0";return[function(e,n){var r=h(this),o=l(e)?g(e,b):void 0;return o?i(o,e,r,n):i(t,m(r),e,n)},function(e,i){var a=u(this),s=m(e);if("string"==typeof i&&-1===A(i,o)&&-1===A(i,"$<")){var l=n(t,a,s,i);if(l.done)return l.value}var h=c(i);h||(i=m(i));var g,b=a.global;b&&(g=a.unicode,a.lastIndex=0);for(var M,C=[];null!==(M=x(a,s))&&(E(C,M),b);)""===m(M[0])&&(a.lastIndex=d(s,p(a.lastIndex),g));for(var T,B="",D=0,F=0;F=D&&(B+=S(s,D,I)+O,D=I+_.length)}return B+S(s,D)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}))||!M||C)},5548:(e,t,n)=>{"use strict";var r=n(3517),i=n(6823),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not a constructor")}},5610:(e,t,n)=>{"use strict";var r=n(1291),i=Math.max,o=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):o(n,t)}},5745:(e,t,n)=>{"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},5917:(e,t,n)=>{"use strict";var r=n(3724),i=n(9039),o=n(4055);e.exports=!r&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},5966:(e,t,n)=>{"use strict";var r=n(9306),i=n(4117);e.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}},6043:(e,t,n)=>{"use strict";var r=n(9306),i=TypeError,o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},6080:(e,t,n)=>{"use strict";var r=n(7476),i=n(9306),o=n(616),a=r(r.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?a(e,t):function(){return e.apply(t,arguments)}}},6098:function(e,t,n){var r;!function(e,i){function o(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,i=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.tychei=s}(0,e=n.nmd(e),n.amdD)},6119:(e,t,n)=>{"use strict";var r=n(5745),i=n(3392),o=r("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},6193:(e,t,n)=>{"use strict";var r=n(4215);e.exports="NODE"===r},6198:(e,t,n)=>{"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},6269:e=>{"use strict";e.exports={}},6279:(e,t,n)=>{"use strict";var r=n(6840);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},6319:(e,t,n)=>{"use strict";var r=n(8551),i=n(9539);e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(t){i(e,"throw",t)}}},6395:e=>{"use strict";e.exports=!1},6469:(e,t,n)=>{"use strict";var r=n(8227),i=n(2360),o=n(4913).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:i(null)}),e.exports=function(e){s[a][e]=!0}},6499:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(9306),a=n(6043),s=n(1103),u=n(2652);r({target:"Promise",stat:!0,forced:n(537)},{all:function(e){var t=this,n=a.f(t),r=n.resolve,c=n.reject,l=s((function(){var n=o(t.resolve),a=[],s=0,l=1;u(e,(function(e){var o=s++,u=!1;l++,i(n,t,e).then((function(e){u||(u=!0,a[o]=e,--l||r(a))}),c)})),--l||r(a)}));return l.error&&c(l.value),n.promise}})},6518:(e,t,n)=>{"use strict";var r=n(4576),i=n(7347).f,o=n(6699),a=n(6840),s=n(9433),u=n(7740),c=n(2796);e.exports=function(e,t){var n,l,f,p,m,h=e.target,d=e.global,g=e.stat;if(n=d?r:g?r[h]||s(h,{}):r[h]&&r[h].prototype)for(l in t){if(p=t[l],f=e.dontCallGetSet?(m=i(n,l))&&m.value:n[l],!c(d?l:h+(g?".":"#")+l,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;u(p,f)}(e.sham||f&&f.sham)&&o(p,"sham",!0),a(n,l,p,e)}}},6682:(e,t,n)=>{"use strict";var r=n(9565),i=n(8551),o=n(4901),a=n(2195),s=n(7323),u=TypeError;e.exports=function(e,t){var n=e.exec;if(o(n)){var c=r(n,e,t);return null!==c&&i(c),c}if("RegExp"===a(e))return r(s,e,t);throw new u("RegExp#exec called on incompatible receiver")}},6699:(e,t,n)=>{"use strict";var r=n(3724),i=n(4913),o=n(6980);e.exports=r?function(e,t,n){return i.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},6706:(e,t,n)=>{"use strict";var r=n(9504),i=n(9306);e.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},6801:(e,t,n)=>{"use strict";var r=n(3724),i=n(8686),o=n(4913),a=n(8551),s=n(5397),u=n(1072);t.f=r&&!i?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),i=u(t),c=i.length,l=0;c>l;)o.f(e,n=i[l++],r[n]);return e}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6833:function(e,t,n){var r;!function(e,i){function o(e){var t=this;t.next=function(){var e,n,r=t.w,i=t.X,o=t.i;return t.w=r=r+1640531527|0,n=i[o+34&127],e=i[o=o+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=i[o]=n^e,t.i=o,n+(r^r>>>16)|0},function(e,t){var n,r,i,o,a,s=[],u=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,u=Math.max(u,t.length)),i=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,o>=0&&(a=a+1640531527|0,i=0==(n=s[127&o]^=r+a)?i+1:0);for(i>=128&&(s[127&(t&&t.length||0)]=-1),i=127,o=512;o>0;--o)r=s[i+34&127],n=s[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,s[i]=r^n;e.w=a,e.X=s,e.i=i}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&(r.X&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xor4096=s}(0,e=n.nmd(e),n.amdD)},6840:(e,t,n)=>{"use strict";var r=n(4901),i=n(4913),o=n(283),a=n(9433);e.exports=function(e,t,n,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:t;if(r(n)&&o(n,c,s),s.global)u?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(u=!0):delete e[t]}catch(e){}u?e[t]=n:i.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},6910:(e,t,n)=>{"use strict";var r=n(6518),i=n(9504),o=n(9306),a=n(8981),s=n(6198),u=n(4606),c=n(655),l=n(9039),f=n(4488),p=n(4598),m=n(3709),h=n(3763),d=n(9519),g=n(3607),y=[],x=i(y.sort),b=i(y.push),v=l((function(){y.sort(void 0)})),w=l((function(){y.sort(null)})),N=p("sort"),E=!l((function(){if(d)return d<70;if(!(m&&m>3)){if(h)return!0;if(g)return g<603;var e,t,n,r,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)y.push({k:t+r,v:n})}for(y.sort((function(e,t){return t.v-e.v})),r=0;rc(n)?1:-1}}(e)),n=s(i),r=0;r{"use strict";var r=n(9504),i=n(4376),o=n(4901),a=n(2195),s=n(655),u=r([].push);e.exports=function(e){if(o(e))return e;if(i(e)){for(var t=e.length,n=[],r=0;r{"use strict";var r=n(2140),i=n(4901),o=n(2195),a=n(8227)("toStringTag"),s=Object,u="Arguments"===o(function(){return arguments}());e.exports=r?o:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?n:u?o(t):"Object"===(r=o(t))&&i(t.callee)?"Arguments":r}},6969:(e,t,n)=>{"use strict";var r=n(2777),i=n(757);e.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(e,t,n)=>{"use strict";var r=n(9504),i=n(9039),o=n(2195),a=Object,s=r("".split);e.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):a(e)}:a},7180:function(e,t,n){var r;!function(e,i){function o(e){var t,n=this,r=(t=4022871197,function(e){e=String(e);for(var n=0;n>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var n=new o(e),r=t&&t.state,i=n.next;return i.int32=function(){return 4294967296*n.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,r&&("object"==typeof r&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.alea=s}(0,e=n.nmd(e),n.amdD)},7323:(e,t,n)=>{"use strict";var r,i,o=n(9565),a=n(9504),s=n(655),u=n(7979),c=n(8429),l=n(5745),f=n(2360),p=n(1181).get,m=n(3635),h=n(8814),d=l("native-string-replace",String.prototype.replace),g=RegExp.prototype.exec,y=g,x=a("".charAt),b=a("".indexOf),v=a("".replace),w=a("".slice),N=(i=/b*/g,o(g,r=/a/,"a"),o(g,i,"a"),0!==r.lastIndex||0!==i.lastIndex),E=c.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(N||A||E||m||h)&&(y=function(e){var t,n,r,i,a,c,l,m=this,h=p(m),S=s(e),M=h.raw;if(M)return M.lastIndex=m.lastIndex,t=o(y,M,S),m.lastIndex=M.lastIndex,t;var C=h.groups,T=E&&m.sticky,B=o(u,m),D=m.source,F=0,O=S;if(T&&(B=v(B,"y",""),-1===b(B,"g")&&(B+="g"),O=w(S,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==x(S,m.lastIndex-1))&&(D="(?: "+D+")",O=" "+O,F++),n=new RegExp("^(?:"+D+")",B)),A&&(n=new RegExp("^"+D+"$(?!\\s)",B)),N&&(r=m.lastIndex),i=o(g,T?n:m,O),T?i?(i.input=w(i.input,F),i[0]=w(i[0],F),i.index=m.lastIndex,m.lastIndex+=i[0].length):m.lastIndex=0:N&&i&&(m.lastIndex=m.global?i.index+i[0].length:r),A&&i&&i.length>1&&o(d,i[0],n,(function(){for(a=1;a{"use strict";var r=n(3724),i=n(9565),o=n(8773),a=n(6980),s=n(5397),u=n(6969),c=n(9297),l=n(5917),f=Object.getOwnPropertyDescriptor;t.f=r?f:function(e,t){if(e=s(e),t=u(t),l)try{return f(e,t)}catch(e){}if(c(e,t))return a(!i(o.f,e,t),e[t])}},7391:(e,t,n)=>{var r=n(7180),i=n(3181),o=n(3031),a=n(9067),s=n(6833),u=n(6098),c=n(4801);c.alea=r,c.xor128=i,c.xorwow=o,c.xorshift7=a,c.xor4096=s,c.tychei=u,e.exports=c},7465:(e,t,n)=>{"use strict";var r=n(3724),i=n(3635),o=n(2195),a=n(2106),s=n(1181).get,u=RegExp.prototype,c=TypeError;r&&i&&a(u,"dotAll",{configurable:!0,get:function(){if(this!==u){if("RegExp"===o(this))return!!s(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},7476:(e,t,n)=>{"use strict";var r=n(2195),i=n(9504);e.exports=function(e){if("Function"===r(e))return i(e)}},7495:(e,t,n)=>{"use strict";var r=n(6518),i=n(7323);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},7550:(e,t,n)=>{"use strict";n(3579)},7588:(e,t,n)=>{"use strict";var r=n(6518),i=n(9565),o=n(2652),a=n(9306),s=n(8551),u=n(1767),c=n(9539),l=n(4549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:l},{forEach:function(e){s(this);try{a(e)}catch(e){c(this,"throw",e)}if(l)return i(l,this,e);var t=u(this),n=0;o(t,(function(t){e(t,n++)}),{IS_RECORD:!0})}})},7629:(e,t,n)=>{"use strict";var r=n(6395),i=n(4576),o=n(9433),a="__core-js_shared__",s=e.exports=i[a]||o(a,{});(s.versions||(s.versions=[])).push({version:"3.42.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7633:(e,t,n)=>{"use strict";var r=n(7751),i=n(2106),o=n(8227),a=n(3724),s=o("species");e.exports=function(e){var t=r(e);a&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}},7657:(e,t,n)=>{"use strict";var r,i,o,a=n(9039),s=n(4901),u=n(34),c=n(2360),l=n(2787),f=n(6840),p=n(8227),m=n(6395),h=p("iterator"),d=!1;[].keys&&("next"in(o=[].keys())?(i=l(l(o)))!==Object.prototype&&(r=i):d=!0),!u(r)||a((function(){var e={};return r[h].call(e)!==e}))?r={}:m&&(r=c(r)),s(r[h])||f(r,h,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},7680:(e,t,n)=>{"use strict";var r=n(9504);e.exports=r([].slice)},7740:(e,t,n)=>{"use strict";var r=n(9297),i=n(5031),o=n(7347),a=n(4913);e.exports=function(e,t,n){for(var s=i(t),u=a.f,c=o.f,l=0;l{"use strict";var r=n(6518),i=n(9565),o=n(9306),a=n(6043),s=n(1103),u=n(2652);r({target:"Promise",stat:!0,forced:n(537)},{race:function(e){var t=this,n=a.f(t),r=n.reject,c=s((function(){var a=o(t.resolve);u(e,(function(e){i(a,t,e).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},7750:(e,t,n)=>{"use strict";var r=n(4117),i=TypeError;e.exports=function(e){if(r(e))throw new i("Can't call method on "+e);return e}},7751:(e,t,n)=>{"use strict";var r=n(4576),i=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],i(n)?n:void 0):r[e]&&r[e][t];var n}},7829:(e,t,n)=>{"use strict";var r=n(8183).charAt;e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},7860:(e,t,n)=>{"use strict";var r=n(2839);e.exports=/web0s(?!.*chrome)/i.test(r)},7979:(e,t,n)=>{"use strict";var r=n(8551);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},8014:(e,t,n)=>{"use strict";var r=n(1291),i=Math.min;e.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}},8111:(e,t,n)=>{"use strict";var r=n(6518),i=n(4576),o=n(679),a=n(8551),s=n(4901),u=n(2787),c=n(2106),l=n(4659),f=n(9039),p=n(9297),m=n(8227),h=n(7657).IteratorPrototype,d=n(3724),g=n(6395),y="constructor",x="Iterator",b=m("toStringTag"),v=TypeError,w=i[x],N=g||!s(w)||w.prototype!==h||!f((function(){w({})})),E=function(){if(o(this,h),u(this)===h)throw new v("Abstract class Iterator not directly constructable")},A=function(e,t){d?c(h,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===h)throw new v("You can't redefine this property");p(this,e)?this[e]=t:l(this,e,t)}}):h[e]=t};p(h,b)||A(b,x),!N&&p(h,y)&&h[y]!==Object||A(y,E),E.prototype=h,r({global:!0,constructor:!0,forced:N},{Iterator:E})},8183:(e,t,n)=>{"use strict";var r=n(9504),i=n(1291),o=n(655),a=n(7750),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),l=function(e){return function(t,n){var r,l,f=o(a(t)),p=i(n),m=f.length;return p<0||p>=m?e?"":void 0:(r=u(f,p))<55296||r>56319||p+1===m||(l=u(f,p+1))<56320||l>57343?e?s(f,p):r:e?c(f,p,p+2):l-56320+(r-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},8227:(e,t,n)=>{"use strict";var r=n(4576),i=n(5745),o=n(9297),a=n(3392),s=n(4495),u=n(7040),c=r.Symbol,l=i("wks"),f=u?c.for||c:c&&c.withoutSetter||a;e.exports=function(e){return o(l,e)||(l[e]=s&&o(c,e)?c[e]:f("Symbol."+e)),l[e]}},8237:(e,t,n)=>{"use strict";var r=n(6518),i=n(2652),o=n(9306),a=n(8551),s=n(1767),u=n(9539),c=n(4549),l=n(8745),f=n(9039),p=TypeError,m=f((function(){[].keys().reduce((function(){}),void 0)})),h=!m&&c("reduce",p);r({target:"Iterator",proto:!0,real:!0,forced:m||h},{reduce:function(e){a(this);try{o(e)}catch(e){u(this,"throw",e)}var t=arguments.length<2,n=t?void 0:arguments[1];if(h)return l(h,this,t?[e]:[e,n]);var r=s(this),c=0;if(i(r,(function(r){t?(t=!1,n=r):n=e(n,r,c),c++}),{IS_RECORD:!0}),t)throw new p("Reduce of empty iterator with no initial value");return n}})},8265:e=>{"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},8429:(e,t,n)=>{"use strict";var r=n(9039),i=n(4576).RegExp,o=r((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=o||r((function(){return!i("a","y").sticky})),s=o||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},8480:(e,t,n)=>{"use strict";var r=n(1828),i=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},8551:(e,t,n)=>{"use strict";var r=n(34),i=String,o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not an object")}},8622:(e,t,n)=>{"use strict";var r=n(4576),i=n(4901),o=r.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},8686:(e,t,n)=>{"use strict";var r=n(3724),i=n(9039);e.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(e,t,n)=>{"use strict";var r=n(616),i=Function.prototype,o=i.apply,a=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},8773:(e,t)=>{"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},8814:(e,t,n)=>{"use strict";var r=n(9039),i=n(4576).RegExp;e.exports=r((function(){var e=i("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")}))},8872:(e,t,n)=>{"use strict";n(8237)},8981:(e,t,n)=>{"use strict";var r=n(7750),i=Object;e.exports=function(e){return i(r(e))}},8992:(e,t,n)=>{"use strict";n(8111)},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9067:function(e,t,n){var r;!function(e,i){function o(e){var t=this;t.next=function(){var e,n,r=t.x,i=t.i;return e=r[i],n=(e^=e>>>7)^e<<24,n^=(e=r[i+1&7])^e>>>10,n^=(e=r[i+3&7])^e>>>3,n^=(e=r[i+4&7])^e<<7,e=r[i+7&7],n^=(e^=e<<13)^e<<9,r[i]=n,t.i=i+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n0;--n)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var n=new o(e),r=t&&t.state,i=function(){return(n.next()>>>0)/4294967296};return i.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=n.next,i.quick=i,r&&(r.x&&a(r,n),i.state=function(){return a(n,{})}),i}i&&i.exports?i.exports=s:n.amdD&&n.amdO?void 0===(r=function(){return s}.call(t,n,t,i))||(i.exports=r):this.xorshift7=s}(0,e=n.nmd(e),n.amdD)},9225:(e,t,n)=>{"use strict";var r,i,o,a,s=n(4576),u=n(8745),c=n(6080),l=n(4901),f=n(9297),p=n(9039),m=n(397),h=n(7680),d=n(4055),g=n(2812),y=n(9544),x=n(6193),b=s.setImmediate,v=s.clearImmediate,w=s.process,N=s.Dispatch,E=s.Function,A=s.MessageChannel,S=s.String,M=0,C={},T="onreadystatechange";p((function(){r=s.location}));var B=function(e){if(f(C,e)){var t=C[e];delete C[e],t()}},D=function(e){return function(){B(e)}},F=function(e){B(e.data)},O=function(e){s.postMessage(S(e),r.protocol+"//"+r.host)};b&&v||(b=function(e){g(arguments.length,1);var t=l(e)?e:E(e),n=h(arguments,1);return C[++M]=function(){u(t,void 0,n)},i(M),M},v=function(e){delete C[e]},x?i=function(e){w.nextTick(D(e))}:N&&N.now?i=function(e){N.now(D(e))}:A&&!y?(a=(o=new A).port2,o.port1.onmessage=F,i=c(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!p(O)?(i=O,s.addEventListener("message",F,!1)):i=T in d("script")?function(e){m.appendChild(d("script"))[T]=function(){m.removeChild(this),B(e)}}:function(e){setTimeout(D(e),0)}),e.exports={set:b,clear:v}},9228:(e,t,n)=>{"use strict";n(7495);var r=n(9565),i=n(6840),o=n(7323),a=n(9039),s=n(8227),u=n(6699),c=s("species"),l=RegExp.prototype;e.exports=function(e,t,n,f){var p=s(e),m=!a((function(){var t={};return t[p]=function(){return 7},7!==""[e](t)})),h=m&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[p]=/./[p]),n.exec=function(){return t=!0,null},n[p](""),!t}));if(!m||!h||n){var d=/./[p],g=t(p,""[e],(function(e,t,n,i,a){var s=t.exec;return s===o||s===l.exec?m&&!a?{done:!0,value:r(d,t,n,i)}:{done:!0,value:r(e,n,t,i)}:{done:!1}}));i(String.prototype,e,g[0]),i(l,p,g[1])}f&&u(l[p],"sham",!0)}},9297:(e,t,n)=>{"use strict";var r=n(9504),i=n(8981),o=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},9306:(e,t,n)=>{"use strict";var r=n(4901),i=n(6823),o=TypeError;e.exports=function(e){if(r(e))return e;throw new o(i(e)+" is not a function")}},9433:(e,t,n)=>{"use strict";var r=n(4576),i=Object.defineProperty;e.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},9462:(e,t,n)=>{"use strict";var r=n(9565),i=n(2360),o=n(6699),a=n(6279),s=n(8227),u=n(1181),c=n(5966),l=n(7657).IteratorPrototype,f=n(2529),p=n(9539),m=s("toStringTag"),h="IteratorHelper",d="WrapForValidIterator",g=u.set,y=function(e){var t=u.getterFor(e?d:h);return a(i(l),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return f(void 0,!0);try{var r=n.nextHandler();return n.returnHandlerResult?r:f(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),i=n.iterator;if(n.done=!0,e){var o=c(i,"return");return o?r(o,i):f(void 0,!0)}if(n.inner)try{p(n.inner.iterator,"normal")}catch(e){return p(i,"throw",e)}return i&&p(i,"normal"),f(void 0,!0)}})},x=y(!0),b=y(!1);o(b,m,"Iterator Helper"),e.exports=function(e,t,n){var r=function(r,i){i?(i.iterator=r.iterator,i.next=r.next):i=r,i.type=t?d:h,i.returnHandlerResult=!!n,i.nextHandler=e,i.counter=0,i.done=!1,g(this,i)};return r.prototype=t?x:b,r}},9463:(e,t,n)=>{"use strict";var r=n(6518),i=n(3724),o=n(4576),a=n(9504),s=n(9297),u=n(4901),c=n(1625),l=n(655),f=n(2106),p=n(7740),m=o.Symbol,h=m&&m.prototype;if(i&&u(m)&&(!("description"in h)||void 0!==m().description)){var d={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=c(h,this)?new m(e):void 0===e?m():m(e);return""===e&&(d[t]=!0),t};p(g,m),g.prototype=h,h.constructor=g;var y="Symbol(description detection)"===String(m("description detection")),x=a(h.valueOf),b=a(h.toString),v=/^Symbol\((.*)\)[^)]+$/,w=a("".replace),N=a("".slice);f(h,"description",{configurable:!0,get:function(){var e=x(this);if(s(d,e))return"";var t=b(e),n=y?N(t,7,-1):w(t,v,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:g})}},9504:(e,t,n)=>{"use strict";var r=n(616),i=Function.prototype,o=i.call,a=r&&i.bind.bind(o,o);e.exports=r?a:function(e){return function(){return o.apply(e,arguments)}}},9519:(e,t,n)=>{"use strict";var r,i,o=n(4576),a=n(2839),s=o.process,u=o.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),e.exports=i},9539:(e,t,n)=>{"use strict";var r=n(9565),i=n(8551),o=n(5966);e.exports=function(e,t,n){var a,s;i(e);try{if(!(a=o(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return i(a),n}},9544:(e,t,n)=>{"use strict";var r=n(2839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},9565:(e,t,n)=>{"use strict";var r=n(616),i=Function.prototype.call;e.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},9617:(e,t,n)=>{"use strict";var r=n(5397),i=n(5610),o=n(6198),a=function(e){return function(t,n,a){var s=r(t),u=o(s);if(0===u)return!e&&-1;var c,l=i(a,u);if(e&&n!=n){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r={};return(()=>{"use strict";n.d(r,{default:()=>cx});var e={};n.r(e),n.d(e,{createAbs:()=>To,createAccessorNode:()=>Rp,createAcos:()=>Jl,createAcosh:()=>gf,createAcot:()=>xf,createAcoth:()=>vf,createAcsc:()=>Nf,createAcsch:()=>Af,createAdd:()=>wp,createAddScalar:()=>_o,createAnd:()=>Vc,createAndTransform:()=>Ky,createArg:()=>vs,createArrayNode:()=>Pp,createAsec:()=>Mf,createAsech:()=>Tf,createAsin:()=>Df,createAsinh:()=>Ff,createAssignmentNode:()=>Vp,createAtan:()=>Of,createAtan2:()=>If,createAtanh:()=>kf,createAtomicMass:()=>ty,createAvogadro:()=>ny,createBellNumbers:()=>Bd,createBigNumberClass:()=>On,createBigint:()=>Ri,createBignumber:()=>Li,createBin:()=>tc,createBitAnd:()=>ps,createBitAndTransform:()=>tx,createBitNot:()=>hs,createBitOr:()=>gs,createBitOrTransform:()=>nx,createBitXor:()=>bs,createBlockNode:()=>Wp,createBohrMagneton:()=>zg,createBohrRadius:()=>Ug,createBoltzmann:()=>ry,createBoolean:()=>Ui,createCatalan:()=>Fd,createCbrt:()=>Ro,createCeil:()=>Go,createChain:()=>sh,createChainClass:()=>eh,createClassicalElectronRadius:()=>Lg,createClone:()=>ri,createColumn:()=>ks,createColumnTransform:()=>Sy,createCombinations:()=>Vh,createCombinationsWithRep:()=>Yh,createCompare:()=>Wc,createCompareNatural:()=>Qc,createCompareText:()=>tl,createCompile:()=>Cm,createComplex:()=>$i,createComplexClass:()=>Un,createComposition:()=>_d,createConcat:()=>Is,createConcatTransform:()=>Uy,createConditionalNode:()=>Jp,createConductanceQuantum:()=>kg,createConj:()=>Ns,createConstantNode:()=>om,createCorr:()=>Lh,createCos:()=>qf,createCosh:()=>jf,createCot:()=>Uf,createCoth:()=>$f,createCoulomb:()=>Og,createCoulombConstant:()=>_g,createCount:()=>qs,createCreateUnit:()=>Wl,createCross:()=>js,createCsc:()=>Hf,createCsch:()=>Vf,createCtranspose:()=>_u,createCube:()=>Zo,createCumSum:()=>Bh,createCumSumTransform:()=>Wy,createDeepEqual:()=>vl,createDenseMatrixClass:()=>ti,createDerivative:()=>Zd,createDet:()=>uh,createDeuteronMass:()=>Wg,createDiag:()=>Ls,createDiff:()=>ou,createDiffTransform:()=>$y,createDistance:()=>Sh,createDivide:()=>Eh,createDivideScalar:()=>mc,createDot:()=>Mp,createDotDivide:()=>Tc,createDotMultiply:()=>Wa,createDotPow:()=>Mc,createE:()=>pg,createEfimovFactor:()=>ey,createEigs:()=>ph,createElectricConstant:()=>Dg,createElectronMass:()=>$g,createElementaryCharge:()=>Ig,createEqual:()=>rl,createEqualScalar:()=>Ii,createEqualText:()=>al,createErf:()=>ju,createEvaluate:()=>Bm,createExp:()=>Wo,createExpm:()=>hh,createExpm1:()=>Jo,createFactorial:()=>ud,createFalse:()=>ag,createFaraday:()=>iy,createFermiCoupling:()=>Hg,createFft:()=>ku,createFibonacciHeapClass:()=>_l,createFilter:()=>$s,createFilterTransform:()=>Dy,createFineStructure:()=>Gg,createFirstRadiation:()=>oy,createFix:()=>ea,createFlatten:()=>Vs,createFloor:()=>oa,createForEach:()=>Ws,createForEachTransform:()=>Fy,createFormat:()=>ec,createFraction:()=>Hi,createFractionClass:()=>ir,createFreqz:()=>Kd,createFunctionAssignmentNode:()=>sm,createFunctionNode:()=>Em,createGamma:()=>id,createGasConstant:()=>sy,createGcd:()=>va,createGetMatrixDataType:()=>Xs,createGravitationConstant:()=>Mg,createGravity:()=>gy,createHartreeEnergy:()=>Vg,createHasNumericValue:()=>Ei,createHelp:()=>oh,createHelpClass:()=>Km,createHex:()=>rc,createHypot:()=>Ep,createI:()=>vg,createIdentity:()=>Ks,createIfft:()=>qu,createIm:()=>Es,createImmutableDenseMatrixClass:()=>Dl,createIndex:()=>Bp,createIndexClass:()=>Fl,createIndexNode:()=>cm,createIndexTransform:()=>Oy,createInfinity:()=>ug,createIntersect:()=>Mh,createInv:()=>ch,createInverseConductanceQuantum:()=>Rg,createInvmod:()=>Ga,createIsInteger:()=>pi,createIsNaN:()=>Bi,createIsNegative:()=>bi,createIsNumeric:()=>wi,createIsPositive:()=>Si,createIsPrime:()=>lc,createIsZero:()=>Ci,createKldivergence:()=>ld,createKlitzing:()=>jg,createKron:()=>tu,createLN10:()=>dg,createLN2:()=>hg,createLOG10E:()=>yg,createLOG2E:()=>gg,createLarger:()=>hl,createLargerEq:()=>yl,createLcm:()=>Na,createLeafCount:()=>zd,createLeftShift:()=>Uc,createLgamma:()=>ad,createLog:()=>vc,createLog10:()=>Ca,createLog1p:()=>Nc,createLog2:()=>Ba,createLoschmidt:()=>ay,createLsolve:()=>Fc,createLsolveAll:()=>zc,createLup:()=>_m,createLusolve:()=>Jm,createLyap:()=>Nh,createMad:()=>Ih,createMagneticConstant:()=>Bg,createMagneticFluxQuantum:()=>qg,createMap:()=>ru,createMapSlices:()=>Do,createMapSlicesTransform:()=>Ay,createMapTransform:()=>_y,createMatrix:()=>Vi,createMatrixClass:()=>ar,createMatrixFromColumns:()=>Qi,createMatrixFromFunction:()=>Wi,createMatrixFromRows:()=>Ji,createMax:()=>Tl,createMaxTransform:()=>zy,createMean:()=>Fh,createMeanTransform:()=>ky,createMedian:()=>_h,createMin:()=>Bl,createMinTransform:()=>Ry,createMod:()=>pa,createMode:()=>Yu,createMolarMass:()=>hy,createMolarMassC12:()=>dy,createMolarPlanckConstant:()=>uy,createMolarVolume:()=>cy,createMultinomial:()=>pd,createMultiply:()=>Oa,createMultiplyScalar:()=>Da,createNaN:()=>cg,createNeutronMass:()=>Yg,createNode:()=>Fp,createNorm:()=>Sp,createNot:()=>Ds,createNthRoot:()=>Ia,createNthRoots:()=>Ac,createNuclearMagneton:()=>Pg,createNull:()=>sg,createNumber:()=>ki,createNumeric:()=>fc,createObjectNode:()=>fm,createOct:()=>nc,createOnes:()=>au,createOperatorNode:()=>hm,createOr:()=>Fs,createOrTransform:()=>ex,createParenthesisNode:()=>gm,createParse:()=>Sm,createParser:()=>Om,createParserClass:()=>Dm,createPartitionSelect:()=>Sl,createPermutations:()=>hd,createPhi:()=>mg,createPi:()=>lg,createPickRandom:()=>vd,createPinv:()=>fh,createPlanckCharge:()=>vy,createPlanckConstant:()=>Cg,createPlanckLength:()=>yy,createPlanckMass:()=>xy,createPlanckTemperature:()=>wy,createPlanckTime:()=>by,createPolynomialRoot:()=>Qm,createPow:()=>hc,createPrint:()=>ac,createPrintTransform:()=>Qy,createProd:()=>Qu,createProtonMass:()=>Zg,createQr:()=>Im,createQuantileSeq:()=>Ph,createQuantileSeqTransform:()=>Vy,createQuantumOfCirculation:()=>Jg,createRandom:()=>Ed,createRandomInt:()=>Sd,createRange:()=>fu,createRangeClass:()=>or,createRangeNode:()=>xm,createRangeTransform:()=>qy,createRationalize:()=>Yd,createRe:()=>As,createReducedPlanckConstant:()=>Tg,createRelationalNode:()=>vm,createReplacer:()=>tg,createReshape:()=>mu,createResize:()=>hu,createResolve:()=>$d,createResultSet:()=>Ze,createReviver:()=>eg,createRightArithShift:()=>$c,createRightLogShift:()=>Gc,createRotate:()=>gu,createRotationMatrix:()=>xu,createRound:()=>yc,createRow:()=>bu,createRowTransform:()=>Py,createRydberg:()=>Xg,createSQRT1_2:()=>xg,createSQRT2:()=>bg,createSackurTetrode:()=>ly,createSchur:()=>vh,createSec:()=>Zf,createSech:()=>Yf,createSecondRadiation:()=>fy,createSetCartesian:()=>np,createSetDifference:()=>ip,createSetDistinct:()=>ap,createSetIntersect:()=>up,createSetIsSubset:()=>lp,createSetMultiplicity:()=>pp,createSetPowerset:()=>hp,createSetSize:()=>gp,createSetSymDifference:()=>xp,createSetUnion:()=>vp,createSign:()=>ka,createSimplify:()=>Pd,createSimplifyConstant:()=>jd,createSimplifyCore:()=>Ld,createSin:()=>Jf,createSinh:()=>Qf,createSize:()=>wu,createSlu:()=>Zm,createSmaller:()=>ul,createSmallerEq:()=>fl,createSolveODE:()=>Pu,createSort:()=>Cl,createSpaClass:()=>Il,createSparse:()=>Vl,createSparseMatrixClass:()=>zi,createSpeedOfLight:()=>Sg,createSplitUnit:()=>eo,createSqrt:()=>Ra,createSqrtm:()=>gh,createSquare:()=>Pa,createSqueeze:()=>Eu,createStd:()=>jh,createStdTransform:()=>Hy,createStefanBoltzmann:()=>py,createStirlingS2:()=>Cd,createString:()=>Pi,createSubset:()=>Su,createSubsetTransform:()=>jy,createSubtract:()=>Ua,createSubtractScalar:()=>zo,createSum:()=>Ch,createSumTransform:()=>Gy,createSylvester:()=>xh,createSymbolNode:()=>wm,createSymbolicEqual:()=>Gd,createTan:()=>Kf,createTanh:()=>ep,createTau:()=>fg,createThomsonCrossSection:()=>Qg,createTo:()=>uc,createTrace:()=>Cp,createTranspose:()=>Fu,createTrue:()=>og,createTypeOf:()=>Fi,createTyped:()=>$e,createUnaryMinus:()=>So,createUnaryPlus:()=>Co,createUnequal:()=>Nl,createUnitClass:()=>Ll,createUnitFunction:()=>Hl,createUppercaseE:()=>Ng,createUppercasePi:()=>wg,createUsolve:()=>_c,createUsolveAll:()=>Rc,createVacuumImpedance:()=>Fg,createVariance:()=>Rh,createVarianceTransform:()=>Jy,createVersion:()=>Eg,createWeakMixingAngle:()=>Kg,createWienDisplacement:()=>my,createXgcd:()=>$a,createXor:()=>Os,createZeros:()=>zu,createZeta:()=>Zu,createZpk2tf:()=>Xd}),n(4423),n(7495),n(8992),n(7550);var t=n(2369);function i(e,t){if(a(e,t))return e[t];if("function"==typeof e[t]&&s(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function o(e,t,n){if(a(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function a(e,t){return!(!function(e){return"object"==typeof e&&e&&e.constructor===Object}(e)&&!Array.isArray(e)||!me(u,t)&&(t in Object.prototype||t in Function.prototype))}function s(e,t){return!(null==e||"function"!=typeof e[t]||me(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!me(c,t)&&(t in Object.prototype||t in Function.prototype))}n(6910),n(3215),n(4520),n(3949),n(1454),n(4864),n(7465);const u={length:!0,name:!0},c={toString:!0,valueOf:!0,toLocaleString:!0};class l{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter((e=>this.has(e))).values()}get(e){return i(this.wrappedObject,e)}set(e,t){return o(this.wrappedObject,e,t),this}has(e){return a(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return p(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){a(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(const e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class f{constructor(e,t,n){this.a=e,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,t){return this.bKeys.has(e)?this.b.set(e,t):this.a.set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return p(this.keys(),(e=>[e,this.get(e)]))}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function p(e,t){return{next:()=>{const n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function m(){return new Map}function h(e){if(!e)return m();if(k(e))return e;if(z(e))return new l(e);throw new Error("createMap can create maps from objects or Maps")}function d(e){return"number"==typeof e}function g(e){return!(!e||"object"!=typeof e||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function y(e){return"bigint"==typeof e}function x(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function b(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function v(e){return e&&!0===e.constructor.prototype.isUnit||!1}function w(e){return"string"==typeof e}const N=Array.isArray;function E(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function A(e){return Array.isArray(e)||E(e)}function S(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function M(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function C(e){return e&&!0===e.constructor.prototype.isRange||!1}function T(e){return e&&!0===e.constructor.prototype.isIndex||!1}function B(e){return"boolean"==typeof e}function D(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function F(e){return e&&!0===e.constructor.prototype.isHelp||!1}function O(e){return"function"==typeof e}function _(e){return e instanceof Date}function I(e){return e instanceof RegExp}function z(e){return!(!e||"object"!=typeof e||e.constructor!==Object||x(e)||b(e))}function k(e){return!!e&&(e instanceof Map||e instanceof l||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function R(e){return k(e)&&k(e.a)&&k(e.b)}function q(e){return k(e)&&z(e.wrappedObject)}function P(e){return null===e}function j(e){return void 0===e}function U(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function H(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function G(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function V(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function Z(e){return V(e)||K(e)&&1===e.args.length&&V(e.args[0])&&"-+~".includes(e.op)}function W(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function Y(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function J(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function X(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function Q(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function K(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function ee(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function te(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function ne(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function re(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function ie(e){return e&&!0===e.constructor.prototype.isChain||!1}function oe(e){const t=typeof e;return"object"===t?null===e?"null":g(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function ae(e){const t=typeof e;if("number"===t||"bigint"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return ae(e)}));if(e instanceof Date)return new Date(e.valueOf());if(g(e))return e;if(z(e))return function(e,t){const n={};for(const r in e)me(e,r)&&(n[r]=t(e[r]));return n}(e,ae);if("function"===t)return e;throw new TypeError(`Cannot clone: unknown type of value (value: ${e})`)}function se(e,t){for(const n in t)me(t,n)&&(e[n]=t[n]);return e}function ue(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(const n in t)if(me(t,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(t[n]&&t[n].constructor===Object)void 0===e[n]&&(e[n]={}),e[n]&&e[n].constructor===Object?ue(e[n],t[n]):e[n]=t[n];else{if(Array.isArray(t[n]))throw new TypeError("Arrays are not supported by deepExtend");e[n]=t[n]}return e}function ce(e,t){let n,r,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,i=e.length;r!function(e){return e&&"?"===e[0]}(e))).every((e=>void 0!==n[e]))){const r=t.filter((e=>void 0===n[e]));throw new Error(`Cannot create function "${e}", some dependencies are missing: ${r.map((e=>`"${e}"`)).join(", ")}.`)}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function de(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function ge(e){return e&&"?"===e[0]?e.slice(1):e}function ye(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}function xe(e,t){if("bigint"===t.number)try{BigInt(e)}catch(e){return t.numberFallback}return t.number}n(5440);const be=Math.sign||function(e){return e>0?1:e<0?-1:0},ve=Math.log2||function(e){return Math.log(e)/Math.LN2},we=Math.log10||function(e){return Math.log(e)/Math.LN10},Ne=Math.log1p||function(e){return Math.log(e+1)},Ee=Math.cbrt||function(e){if(0===e)return e;const t=e<0;let n;return t&&(e=-e),isFinite(e)?(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3):n=e,t?-n:n},Ae=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function Se(e,t,n){const r={2:"0b",8:"0o",16:"0x"}[t];let i="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!ye(n))throw new Error("size must be an integer");if(e>2**(n-1)-1||e<-(2**(n-1)))throw new Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!ye(e))throw new Error("Value must be an integer");e<0&&(e+=2**n),i=`i${n}`}let o="";return e<0&&(e=-e,o="-"),`${o}${r}${e.toString(t)}${i}`}function Me(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";const{notation:n,precision:r,wordSize:i}=Ce(t);switch(n){case"fixed":return Be(e,r);case"exponential":return De(e,r);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);const n=Fe(Te(e),t),r=n.exponent,i=n.coefficients,o=r%3==0?r:r<0?r-3-r%3:r-r%3;if(d(t))for(;t>i.length||r-o+1>i.length;)i.push(0);else{const e=Math.abs(r-o)-(i.length-1);for(let t=0;t0;)s++,a--;const u=i.slice(s).join(""),c=d(t)&&u.length||u.match(/[1-9]/)?"."+u:"",l=i.slice(0,s).join("")+c+"e"+(r>=0?"+":"")+o.toString();return n.sign+l}(e,r);case"bin":return Se(e,2,i);case"oct":return Se(e,8,i);case"hex":return Se(e,16,i);case"auto":return function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);const r=Ue(null==n?void 0:n.lowerExp,-3),i=Ue(null==n?void 0:n.upperExp,5),o=Te(e),a=t?Fe(o,t):o;if(a.exponent=i)return De(e,t);{let e=a.coefficients;const n=a.exponent;e.length0?n:0;return r{throw new Error('Option "precision" must be a number or BigNumber')}))),void 0!==e.wordSize&&(n=je(e.wordSize,(()=>{throw new Error('Option "wordSize" must be a number or BigNumber')}))),e.notation&&(r=e.notation)}return{notation:r,precision:t,wordSize:n}}function Te(e){const t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);const n=t[1],r=t[2];let i=parseFloat(t[4]||"0");const o=r.indexOf(".");i+=-1!==o?o-1:r.length-1;const a=r.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===a.length&&(a.push(0),i++),{sign:n,coefficients:a,exponent:i}}function Be(e,t){if(isNaN(e)||!isFinite(e))return String(e);const n=Te(e),r="number"==typeof t?Fe(n,n.exponent+1+t):n;let i=r.coefficients,o=r.exponent+1;const a=o+(t||0);return i.length0?"."+i.join(""):"")+"e"+(o>=0?"+":"")+o}function Fe(e,t){const n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;for(;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){let e=t-1;for(r[e]++;10===r[e];)r.pop(),0===e&&(r.unshift(0),n.exponent++,e++),e--,r[e]++}return n}function Oe(e){const t=[];for(let n=0;n2&&void 0!==arguments[2]?arguments[2]:1e-8,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return!isNaN(e)&&!isNaN(t)&&(isFinite(e)&&isFinite(t)?e===t||Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r):e===t)}const Ie=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},ze=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},ke=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},Re=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},qe=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},Pe=Math.tanh||function(e){const t=Math.exp(2*e);return(t-1)/(t+1)};function je(e,t){return d(e)?e:g(e)?e.toNumber():void t()}function Ue(e,t){return d(e)?e:g(e)?e.toNumber():t}let Le=function(){return Le=t.create,t};const $e=he("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){let{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e;const o=Le();return o.clear(),o.addTypes([{name:"number",test:d},{name:"Complex",test:x},{name:"BigNumber",test:g},{name:"bigint",test:y},{name:"Fraction",test:b},{name:"Unit",test:v},{name:"identifier",test:e=>w&&/^[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E5D0}-\u{1E5ED}\u{1E5F0}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}][0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E5D0}-\u{1E5ED}\u{1E5F0}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]*$/u.test(e)},{name:"string",test:w},{name:"Chain",test:ie},{name:"Array",test:N},{name:"Matrix",test:E},{name:"DenseMatrix",test:S},{name:"SparseMatrix",test:M},{name:"Range",test:C},{name:"Index",test:T},{name:"boolean",test:B},{name:"ResultSet",test:D},{name:"Help",test:F},{name:"function",test:O},{name:"Date",test:_},{name:"RegExp",test:I},{name:"null",test:P},{name:"undefined",test:j},{name:"AccessorNode",test:U},{name:"ArrayNode",test:L},{name:"AssignmentNode",test:$},{name:"BlockNode",test:H},{name:"ConditionalNode",test:G},{name:"ConstantNode",test:V},{name:"FunctionNode",test:Y},{name:"FunctionAssignmentNode",test:W},{name:"IndexNode",test:J},{name:"Node",test:X},{name:"ObjectNode",test:Q},{name:"OperatorNode",test:K},{name:"ParenthesisNode",test:ee},{name:"RangeNode",test:te},{name:"RelationalNode",test:ne},{name:"SymbolNode",test:re},{name:"Map",test:k},{name:"Object",test:z}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||He(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||Ge(e),new n(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return n||Ge(e),new n(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e+")");return Number(e)}},{from:"bigint",to:"BigNumber",convert:function(e){return t||He(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return i||Ve(e),new i(e)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return n||Ge(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||Ve(e);const t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){const t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||He(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){i||Ve(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||Ge(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||He(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||Ve(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),o.onMismatch=(e,t,n)=>{const r=o.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&A(t[0])&&n.some((e=>!e.params.includes(",")))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=r.data,t}throw r},o.onMismatch=(e,t,n)=>{const r=o.createError(e,t,n);if(["wrongType","mismatch"].includes(r.data.category)&&1===t.length&&A(t[0])&&n.some((e=>!e.params.includes(",")))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=r.data,t}throw r},o}));function He(e){throw new Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function Ge(e){throw new Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function Ve(e){throw new Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}const Ze=he("ResultSet",[],(()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0});var We,Ye,Je=9e15,Xe=1e9,Qe="0123456789abcdef",Ke="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",et="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",tt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Je,maxE:Je,crypto:!1},nt=!0,rt="[DecimalError] ",it=rt+"Invalid argument: ",ot=rt+"Precision limit exceeded",at=rt+"crypto unavailable",st="[object Decimal]",ut=Math.floor,ct=Math.pow,lt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ft=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,pt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,mt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ht=1e7,dt=Ke.length-1,gt=et.length-1,yt={toStringTag:st};function xt(e){var t,n,r,i=e.length-1,o="",a=e[0];if(i>0){for(o+=a,t=1;tn)throw Error(it+e)}function vt(e,t,n,r){var i,o,a,s;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),o=ct(10,7-t),s=e[i]%o|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),a=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):a=(n<4&&s+1==o||n>3&&s+1==o/2)&&(e[i+1]/o/100|0)==ct(10,t-2)-1||(s==o/2||0==s)&&!(e[i+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),a=(r||n<4)&&9999==s||!r&&n>3&&4999==s):a=((r||n<4)&&s+1==o||!r&&n>3&&s+1==o/2)&&(e[i+1]/o/1e3|0)==ct(10,t-3)-1,a}function wt(e,t,n){for(var r,i,o=[0],a=0,s=e.length;an-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}yt.absoluteValue=yt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Et(e)},yt.ceil=function(){return Et(new this.constructor(this),this.e+1,2)},yt.clampedTo=yt.clamp=function(e,t){var n=this,r=n.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(it+t);return n.cmp(e)<0?e:n.cmp(t)>0?t:new r(n)},yt.comparedTo=yt.cmp=function(e){var t,n,r,i,o=this,a=o.d,s=(e=new o.constructor(e)).d,u=o.s,c=e.s;if(!a||!s)return u&&c?u!==c?u:a===s?0:!a^u<0?1:-1:NaN;if(!a[0]||!s[0])return a[0]?u:s[0]?-c:0;if(u!==c)return u;if(o.e!==e.e)return o.e>e.e^u<0?1:-1;for(t=0,n=(r=a.length)<(i=s.length)?r:i;ts[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},yt.cosine=yt.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i;if(t.isZero())return t;(r=t.d.length)<32?i=(1/Pt(4,n=Math.ceil(r/3))).toString():(n=16,i="2.3283064365386962890625e-10"),e.precision+=n,t=qt(e,1,t.times(i),new e(1));for(var o=n;o--;){var a=t.times(t);t=a.times(a).minus(a).times(8).plus(1)}return e.precision-=n,t}(r,jt(r,n)),r.precision=e,r.rounding=t,Et(2==Ye||3==Ye?n.neg():n,e,t,!0)):new r(1):new r(NaN)},yt.cubeRoot=yt.cbrt=function(){var e,t,n,r,i,o,a,s,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(nt=!1,(o=l.s*ct(l.s*l,1/3))&&Math.abs(o)!=1/0?r=new f(o.toString()):(n=xt(l.d),(o=((e=l.e)-n.length+1)%3)&&(n+=1==o||-2==o?"0":"00"),o=ct(n,1/3),e=ut((e+1)/3)-(e%3==(e<0?-1:2)),(r=new f(n=o==1/0?"5e"+e:(n=o.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=l.s),a=(e=f.precision)+3;;)if(c=(u=(s=r).times(s).times(s)).plus(l),r=Nt(c.plus(l).times(s),c.plus(u),a+2,1),xt(s.d).slice(0,a)===(n=xt(r.d)).slice(0,a)){if("9999"!=(n=n.slice(a-3,a+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Et(r,e+1,1),t=!r.times(r).times(r).eq(l));break}if(!i&&(Et(s,e+1,0),s.times(s).times(s).eq(l))){r=s;break}a+=4,i=1}return nt=!0,Et(r,e,f.rounding,t)},yt.decimalPlaces=yt.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-ut(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},yt.dividedBy=yt.div=function(e){return Nt(this,new this.constructor(e))},yt.dividedToIntegerBy=yt.divToInt=function(e){var t=this.constructor;return Et(Nt(this,new t(e),0,1,1),t.precision,t.rounding)},yt.equals=yt.eq=function(e){return 0===this.cmp(e)},yt.floor=function(){return Et(new this.constructor(this),this.e+1,3)},yt.greaterThan=yt.gt=function(e){return this.cmp(e)>0},yt.greaterThanOrEqualTo=yt.gte=function(e){var t=this.cmp(e);return 1==t||0===t},yt.hyperbolicCosine=yt.cosh=function(){var e,t,n,r,i,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;n=a.precision,r=a.rounding,a.precision=n+Math.max(o.e,o.sd())+4,a.rounding=1,(i=o.d.length)<32?t=(1/Pt(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),o=qt(a,1,o.times(t),new a(1),!0);for(var u,c=e,l=new a(8);c--;)u=o.times(o),o=s.minus(u.times(l.minus(u.times(l))));return Et(o,a.precision=n,a.rounding=r,!0)},yt.hyperbolicSine=yt.sinh=function(){var e,t,n,r,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,(r=i.d.length)<3)i=qt(o,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=qt(o,2,i=i.times(1/Pt(5,e)),i,!0);for(var a,s=new o(5),u=new o(16),c=new o(20);e--;)a=i.times(i),i=i.times(s.plus(a.times(u.times(a).plus(c))))}return o.precision=t,o.rounding=n,Et(i,t,n,!0)},yt.hyperbolicTangent=yt.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,Nt(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},yt.inverseCosine=yt.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return-1!==n?0===n?e.isNeg()?Ct(t,r,i):new t(0):new t(NaN):e.isZero()?Ct(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2))},yt.inverseHyperbolicCosine=yt.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,nt=!1,n=n.times(n).minus(1).sqrt().plus(n),nt=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},yt.inverseHyperbolicSine=yt.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,nt=!1,n=n.times(n).plus(1).sqrt().plus(n),nt=!0,r.precision=e,r.rounding=t,n.ln())},yt.inverseHyperbolicTangent=yt.atanh=function(){var e,t,n,r,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?Et(new o(i),e,t,!0):(o.precision=n=r-i.e,i=Nt(i.plus(1),new o(1).minus(i),n+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)},yt.inverseSine=yt.asin=function(){var e,t,n,r,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),n=o.precision,r=o.rounding,-1!==t?0===t?((e=Ct(o,n+4,r).times(.5)).s=i.s,e):new o(NaN):(o.precision=n+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=n,o.rounding=r,i.times(2)))},yt.inverseTangent=yt.atan=function(){var e,t,n,r,i,o,a,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=gt)return(a=Ct(l,f+4,p).times(.25)).s=c.s,a}else{if(!c.s)return new l(NaN);if(f+4<=gt)return(a=Ct(l,f+4,p).times(.5)).s=c.s,a}for(l.precision=s=f+10,l.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(nt=!1,t=Math.ceil(s/7),r=1,u=c.times(c),a=new l(c),i=c;-1!==e;)if(i=i.times(u),o=a.minus(i.div(r+=2)),i=i.times(u),void 0!==(a=o.plus(i.div(r+=2))).d[t])for(e=t;a.d[e]===o.d[e]&&e--;);return n&&(a=a.times(2<this.d.length-2},yt.isNaN=function(){return!this.s},yt.isNegative=yt.isNeg=function(){return this.s<0},yt.isPositive=yt.isPos=function(){return this.s>0},yt.isZero=function(){return!!this.d&&0===this.d[0]},yt.lessThan=yt.lt=function(e){return this.cmp(e)<0},yt.lessThanOrEqualTo=yt.lte=function(e){return this.cmp(e)<1},yt.logarithm=yt.log=function(e){var t,n,r,i,o,a,s,u,c=this,l=c.constructor,f=l.precision,p=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:1!=c.s?NaN:n?0:1/0);if(t)if(n.length>1)o=!0;else{for(i=n[0];i%10==0;)i/=10;o=1!==i}if(nt=!1,a=It(c,s=f+5),r=t?Mt(l,s+10):It(e,s),vt((u=Nt(a,r,s,1)).d,i=f,p))do{if(a=It(c,s+=10),r=t?Mt(l,s+10):It(e,s),u=Nt(a,r,s,1),!o){+xt(u.d).slice(i+1,i+15)+1==1e14&&(u=Et(u,f+1,0));break}}while(vt(u.d,i+=10,p));return nt=!0,Et(u,f,p)},yt.minus=yt.sub=function(e){var t,n,r,i,o,a,s,u,c,l,f,p,m=this,h=m.constructor;if(e=new h(e),!m.d||!e.d)return m.s&&e.s?m.d?e.s=-e.s:e=new h(e.d||m.s!==e.s?m:NaN):e=new h(NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,s=h.precision,u=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===u?-0:0);e=new h(m)}return nt?Et(e,s,u):e}if(n=ut(e.e/7),l=ut(m.e/7),c=c.slice(),o=l-n){for((f=o<0)?(t=c,o=-o,a=p.length):(t=p,n=l,a=c.length),o>(r=Math.max(Math.ceil(s/7),a)+2)&&(o=r,t.length=1),t.reverse(),r=o;r--;)t.push(0);t.reverse()}else{for((f=(r=c.length)<(a=p.length))&&(a=r),r=0;r0;--r)c[a++]=0;for(r=p.length;r>o;){if(c[--r](a=(o=Math.ceil(s/7))>a?o+1:a+1)&&(i=a,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((a=c.length)-(i=l.length)<0&&(i=a,n=l,l=c,c=n),t=0;i;)t=(c[--i]=c[i]+l[i]+t)/ht|0,c[i]%=ht;for(t&&(c.unshift(t),++r),a=c.length;0==c[--a];)c.pop();return e.d=c,e.e=St(c,r),nt?Et(e,s,u):e},yt.precision=yt.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(it+e);return n.d?(t=Tt(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},yt.round=function(){var e=this,t=e.constructor;return Et(new t(e),e.e+1,t.rounding)},yt.sine=yt.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:qt(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=qt(e,2,t=t.times(1/Pt(5,n)),t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,jt(r,n)),r.precision=e,r.rounding=t,Et(Ye>2?n.neg():n,e,t,!0)):new r(NaN)},yt.squareRoot=yt.sqrt=function(){var e,t,n,r,i,o,a=this,s=a.d,u=a.e,c=a.s,l=a.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?a:1/0);for(nt=!1,0==(c=Math.sqrt(+a))||c==1/0?(((t=xt(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=ut((u+1)/2)-(u<0||u%2),r=new l(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new l(c.toString()),n=(u=l.precision)+3;;)if(r=(o=r).plus(Nt(a,o,n+2,1)).times(.5),xt(o.d).slice(0,n)===(t=xt(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Et(r,u+1,1),e=!r.times(r).eq(a));break}if(!i&&(Et(o,u+1,0),o.times(o).eq(a))){r=o;break}n+=4,i=1}return nt=!0,Et(r,u,l.rounding,e)},yt.tangent=yt.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=Nt(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,Et(2==Ye||4==Ye?n.neg():n,e,t,!0)):new r(NaN)},yt.times=yt.mul=function(e){var t,n,r,i,o,a,s,u,c,l=this,f=l.constructor,p=l.d,m=(e=new f(e)).d;if(e.s*=l.s,!(p&&p[0]&&m&&m[0]))return new f(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*e.s:e.s/0);for(n=ut(l.e/7)+ut(e.e/7),(u=p.length)<(c=m.length)&&(o=p,p=m,m=o,a=u,u=c,c=a),o=[],r=a=u+c;r--;)o.push(0);for(r=c;--r>=0;){for(t=0,i=u+r;i>r;)s=o[i]+m[r]*p[i-r-1]+t,o[i--]=s%ht|0,t=s/ht|0;o[i]=(o[i]+t)%ht|0}for(;!o[--a];)o.pop();return t?++n:o.shift(),e.d=o,e.e=St(o,n),nt?Et(e,f.precision,f.rounding):e},yt.toBinary=function(e,t){return Ut(this,2,e,t)},yt.toDecimalPlaces=yt.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(bt(e,0,Xe),void 0===t?t=r.rounding:bt(t,0,8),Et(n,e+n.e+1,t))},yt.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=At(r,!0):(bt(e,0,Xe),void 0===t?t=i.rounding:bt(t,0,8),n=At(r=Et(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},yt.toFixed=function(e,t){var n,r,i=this,o=i.constructor;return void 0===e?n=At(i):(bt(e,0,Xe),void 0===t?t=o.rounding:bt(t,0,8),n=At(r=Et(new o(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},yt.toFraction=function(e){var t,n,r,i,o,a,s,u,c,l,f,p,m=this,h=m.d,d=m.constructor;if(!h)return new d(m);if(c=n=new d(1),r=u=new d(0),a=(o=(t=new d(r)).e=Tt(h)-m.e-1)%7,t.d[0]=ct(10,a<0?7+a:a),null==e)e=o>0?t:c;else{if(!(s=new d(e)).isInt()||s.lt(c))throw Error(it+s);e=s.gt(t)?o>0?t:c:s}for(nt=!1,s=new d(xt(h)),l=d.precision,d.precision=o=7*h.length*2;f=Nt(s,t,0,1,1),1!=(i=n.plus(f.times(r))).cmp(e);)n=r,r=i,i=c,c=u.plus(f.times(i)),u=i,i=t,t=s.minus(f.times(i)),s=i;return i=Nt(e.minus(n),r,0,1,1),u=u.plus(i.times(c)),n=n.plus(i.times(r)),u.s=c.s=m.s,p=Nt(c,r,o,1).minus(m).abs().cmp(Nt(u,n,o,1).minus(m).abs())<1?[c,r]:[u,n],d.precision=l,nt=!0,p},yt.toHexadecimal=yt.toHex=function(e,t){return Ut(this,16,e,t)},yt.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:bt(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(nt=!1,n=Nt(n,e,0,t,1).times(e),nt=!0,Et(n)):(e.s=n.s,n=e),n},yt.toNumber=function(){return+this},yt.toOctal=function(e,t){return Ut(this,8,e,t)},yt.toPower=yt.pow=function(e){var t,n,r,i,o,a,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(ct(+s,c));if((s=new u(s)).eq(1))return s;if(r=u.precision,o=u.rounding,e.eq(1))return Et(s,r,o);if((t=ut(e.e/7))>=e.d.length-1&&(n=c<0?-c:c)<=9007199254740991)return i=Dt(u,s,n,r),e.s<0?new u(1).div(i):Et(i,r,o);if((a=s.s)<0){if(tu.maxE+1||t0?a/0:0):(nt=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=_t(e.times(It(s,r+n)),r)).d&&vt((i=Et(i,r+5,1)).d,r,o)&&(t=r+10,+xt((i=Et(_t(e.times(It(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Et(i,r+1,0))),i.s=a,nt=!0,u.rounding=o,Et(i,r,o))},yt.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=At(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(bt(e,1,Xe),void 0===t?t=i.rounding:bt(t,0,8),n=At(r=Et(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},yt.toSignificantDigits=yt.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(bt(e,1,Xe),void 0===t?t=n.rounding:bt(t,0,8)),Et(new n(this),e,t)},yt.toString=function(){var e=this,t=e.constructor,n=At(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},yt.truncated=yt.trunc=function(){return Et(new this.constructor(this),this.e+1,1)},yt.valueOf=yt.toJSON=function(){var e=this,t=e.constructor,n=At(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var Nt=function(){function e(e,t,n){var r,i=0,o=e.length;for(e=e.slice();o--;)r=e[o]*t+i,e[o]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]1;)e.shift()}return function(r,i,o,a,s,u){var c,l,f,p,m,h,d,g,y,x,b,v,w,N,E,A,S,M,C,T,B=r.constructor,D=r.s==i.s?1:-1,F=r.d,O=i.d;if(!(F&&F[0]&&O&&O[0]))return new B(r.s&&i.s&&(F?!O||F[0]!=O[0]:O)?F&&0==F[0]||!O?0*D:D/0:NaN);for(u?(m=1,l=r.e-i.e):(u=ht,m=7,l=ut(r.e/m)-ut(i.e/m)),C=O.length,S=F.length,x=(y=new B(D)).d=[],f=0;O[f]==(F[f]||0);f++);if(O[f]>(F[f]||0)&&l--,null==o?(N=o=B.precision,a=B.rounding):N=s?o+(r.e-i.e)+1:o,N<0)x.push(1),h=!0;else{if(N=N/m+2|0,f=0,1==C){for(p=0,O=O[0],N++;(f1&&(O=e(O,p,u),F=e(F,p,u),C=O.length,S=F.length),A=C,v=(b=F.slice(0,C)).length;v=u/2&&++M;do{p=0,(c=t(O,b,C,v))<0?(w=b[0],C!=v&&(w=w*u+(b[1]||0)),(p=w/M|0)>1?(p>=u&&(p=u-1),1==(c=t(d=e(O,p,u),b,g=d.length,v=b.length))&&(p--,n(d,C=10;p/=10)f++;y.e=f+l*m-1,Et(y,s?o+y.e+1:o,a,h)}return y}}();function Et(e,t,n,r){var i,o,a,s,u,c,l,f,p,m=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((o=t-i)<0)o+=7,a=t,u=(l=f[p=0])/ct(10,i-a-1)%10|0;else if((p=Math.ceil((o+1)/7))>=(s=f.length)){if(!r)break e;for(;s++<=p;)f.push(0);l=u=0,i=1,a=(o%=7)-7+1}else{for(l=s=f[p],i=1;s>=10;s/=10)i++;u=(a=(o%=7)-7+i)<0?0:l/ct(10,i-a-1)%10|0}if(r=r||t<0||void 0!==f[p+1]||(a<0?l:l%ct(10,i-a-1)),c=n<4?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(o>0?a>0?l/ct(10,i-a):0:f[p-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=ct(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=p,s=1,p--):(f.length=p+1,s=ct(10,7-o),f[p]=a>0?(l/ct(10,i-a)%ct(10,a)|0)*s:0),c)for(;;){if(0==p){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(e.e++,f[0]==ht&&(f[0]=1));break}if(f[p]+=s,f[p]!=ht)break;f[p--]=0,s=1}for(o=f.length;0===f[--o];)f.pop()}return nt&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e0?o=o.charAt(0)+"."+o.slice(1)+Bt(r):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+Bt(-i-1)+o,n&&(r=n-a)>0&&(o+=Bt(r))):i>=a?(o+=Bt(i+1-a),n&&(r=n-i-1)>0&&(o=o+"."+Bt(r))):((r=i+1)0&&(i+1===a&&(o+="."),o+=Bt(r))),o}function St(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function Mt(e,t,n){if(t>dt)throw nt=!0,n&&(e.precision=n),Error(ot);return Et(new e(Ke),t,1,!0)}function Ct(e,t,n){if(t>gt)throw Error(ot);return Et(new e(et),t,n,!0)}function Tt(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Bt(e){for(var t="";e--;)t+="0";return t}function Dt(e,t,n,r){var i,o=new e(1),a=Math.ceil(r/7+4);for(nt=!1;;){if(n%2&&Lt((o=o.times(t)).d,a)&&(i=!0),0===(n=ut(n/2))){n=o.d.length-1,i&&0===o.d[n]&&++o.d[n];break}Lt((t=t.times(t)).d,a)}return nt=!0,o}function Ft(e){return 1&e.d[e.d.length-1]}function Ot(e,t,n){for(var r,i,o=new e(t[0]),a=0;++a17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(nt=!1,u=h):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=r=Math.log(ct(2,f))/Math.LN10*2+5|0,n=o=a=new p(1),p.precision=u;;){if(o=Et(o.times(e),u,1),n=n.times(++l),xt((s=a.plus(Nt(o,n,u,1))).d).slice(0,u)===xt(a.d).slice(0,u)){for(i=f;i--;)a=Et(a.times(a),u,1);if(null!=t)return p.precision=h,a;if(!(c<3&&vt(a.d,u-r,m,c)))return Et(a,p.precision=h,m,nt=!0);p.precision=u+=10,n=o=s=new p(1),l=0,c++}a=s}}function It(e,t){var n,r,i,o,a,s,u,c,l,f,p,m=1,h=e,d=h.d,g=h.constructor,y=g.rounding,x=g.precision;if(h.s<0||!d||!d[0]||!h.e&&1==d[0]&&1==d.length)return new g(d&&!d[0]?-1/0:1!=h.s?NaN:d?0:h);if(null==t?(nt=!1,l=x):l=t,g.precision=l+=10,r=(n=xt(d)).charAt(0),!(Math.abs(o=h.e)<15e14))return c=Mt(g,l+2,x).times(o+""),h=It(new g(r+"."+n.slice(1)),l-10).plus(c),g.precision=x,null==t?Et(h,x,y,nt=!0):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=xt((h=h.times(e)).d)).charAt(0),m++;for(o=h.e,r>1?(h=new g("0."+n),o++):h=new g(r+"."+n.slice(1)),f=h,u=a=h=Nt(h.minus(1),h.plus(1),l,1),p=Et(h.times(h),l,1),i=3;;){if(a=Et(a.times(p),l,1),xt((c=u.plus(Nt(a,new g(i),l,1))).d).slice(0,l)===xt(u.d).slice(0,l)){if(u=u.times(2),0!==o&&(u=u.plus(Mt(g,l+2,x).times(o+""))),u=Nt(u,new g(m),l,1),null!=t)return g.precision=x,u;if(!vt(u.d,l-10,y,s))return Et(u,g.precision=x,y,nt=!0);g.precision=l+=10,c=a=h=Nt(f.minus(1),f.plus(1),l,1),p=Et(h.times(h),l,1),i=s=1}u=c,i+=2}}function zt(e){return String(e.s*e.s/0)}function kt(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),re.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),mt.test(t))return kt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(ft.test(t))n=16,t=t.toLowerCase();else if(lt.test(t))n=2;else{if(!pt.test(t))throw Error(it+t);n=8}for((o=t.search(/p/i))>0?(u=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),a=(o=t.indexOf("."))>=0,r=e.constructor,a&&(o=(s=(t=t.replace(".","")).length)-o,i=Dt(r,new r(n),o,2*o)),o=l=(c=wt(t,n,ht)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=St(c,l),e.d=c,nt=!1,a&&(e=Nt(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?ct(2,u):Dn.pow(2,u))),nt=!0,e)}function qt(e,t,n,r,i){var o,a,s,u,c=e.precision,l=Math.ceil(c/7);for(nt=!1,u=n.times(n),s=new e(r);;){if(a=Nt(s.times(u),new e(t++*t++),c,1),s=i?r.plus(a):r.minus(a),r=Nt(a.times(u),new e(t++*t++),c,1),void 0!==(a=s.plus(r)).d[l]){for(o=l;a.d[o]===s.d[o]&&o--;);if(-1==o)break}o=s,s=r,r=a,a=o}return nt=!0,a.d.length=l+1,a}function Pt(e,t){for(var n=e;--t;)n*=e;return n}function jt(e,t){var n,r=t.s<0,i=Ct(e,e.precision,1),o=i.times(.5);if((t=t.abs()).lte(o))return Ye=r?4:1,t;if((n=t.divToInt(i)).isZero())Ye=r?3:2;else{if((t=t.minus(n.times(i))).lte(o))return Ye=Ft(n)?r?2:3:r?4:1,t;Ye=Ft(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Ut(e,t,n,r){var i,o,a,s,u,c,l,f,p,m=e.constructor,h=void 0!==n;if(h?(bt(n,1,Xe),void 0===r?r=m.rounding:bt(r,0,8)):(n=m.precision,r=m.rounding),e.isFinite()){for(h?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(a=(l=At(e)).indexOf("."))>=0&&(l=l.replace(".",""),(p=new m(1)).e=l.length-a,p.d=wt(At(p),10,i),p.e=p.d.length),o=u=(f=wt(l,10,i)).length;0==f[--u];)f.pop();if(f[0]){if(a<0?o--:((e=new m(e)).d=f,e.e=o,f=(e=Nt(e,p,n,r,0,i)).d,o=e.e,c=We),a=f[n],s=i/2,c=c||void 0!==f[n+1],c=r<4?(void 0!==a||c)&&(0===r||r===(e.s<0?3:2)):a>s||a===s&&(4===r||c||6===r&&1&f[n-1]||r===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>i-1;)f[n]=0,n||(++o,f.unshift(1));for(u=f.length;!f[u-1];--u);for(a=0,l="";a1)if(16==t||8==t){for(a=16==t?4:3,--u;u%a;u++)l+="0";for(u=(f=wt(l,i,t)).length;!f[u-1];--u);for(a=1,l="1.";au)for(o-=u;o--;)l+="0";else ot)return e.length=t,!0}function $t(e){return new this(e).abs()}function Ht(e){return new this(e).acos()}function Gt(e){return new this(e).acosh()}function Vt(e,t){return new this(e).plus(t)}function Zt(e){return new this(e).asin()}function Wt(e){return new this(e).asinh()}function Yt(e){return new this(e).atan()}function Jt(e){return new this(e).atanh()}function Xt(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?Ct(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=Ct(this,o,1).times(.5)).s=e.s:t.s<0?(this.precision=o,this.rounding=1,n=this.atan(Nt(e,t,o,1)),t=Ct(this,o,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(Nt(e,t,o,1)):(n=Ct(this,o,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function Qt(e){return new this(e).cbrt()}function Kt(e){return Et(e=new this(e),e.e+1,2)}function en(e,t,n){return new this(e).clamp(t,n)}function tn(e){if(!e||"object"!=typeof e)throw Error(rt+"Object expected");var t,n,r,i=!0===e.defaults,o=["precision",1,Xe,"rounding",0,8,"toExpNeg",-Je,0,"toExpPos",0,Je,"maxE",0,Je,"minE",-Je,0,"modulo",0,9];for(t=0;t=o[t+1]&&r<=o[t+2]))throw Error(it+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=tt[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(it+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(at);this[n]=!0}else this[n]=!1}return this}function nn(e){return new this(e).cos()}function rn(e){return new this(e).cosh()}function on(e,t){return new this(e).div(t)}function an(e){return new this(e).exp()}function sn(e){return Et(e=new this(e),e.e+1,3)}function un(){var e,t,n=new this(0);for(nt=!1,e=0;e=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=i%1e7;else{if(!crypto.randomBytes)throw Error(at);for(t=crypto.randomBytes(r*=4);o=214e7?crypto.randomBytes(4).copy(t,o):(s.push(i%1e7),o+=4);o=r/4}else for(;o=10;i/=10)r++;r<7&&(n-=7-r)}return a.e=n,a.d=s,a}function vn(e){return Et(e=new this(e),e.e+1,this.rounding)}function wn(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Nn(e){return new this(e).sin()}function En(e){return new this(e).sinh()}function An(e){return new this(e).sqrt()}function Sn(e,t){return new this(e).sub(t)}function Mn(){var e=0,t=arguments,n=new this(t[e]);for(nt=!1;n.s&&++eo.maxE?(i.e=NaN,i.d=null):e.e=10;n/=10)t++;return void(nt?t>o.maxE?(i.e=NaN,i.d=null):t{let{on:t,config:n}=e;const r=Fn.clone({precision:n.precision,modulo:Fn.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})})),r}),{isClass:!0}),_n=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},In=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},zn=function(e,t){return(e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},kn=function(){throw SyntaxError("Invalid Param")};function Rn(e,t){const n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const qn={re:0,im:0},Pn=function(e,t){const n=qn;if(null==e)n.re=n.im=0;else if(void 0!==t)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return jn.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return jn.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else 2===e.length?(n.re=e[0],n.im=e[1]):kn();break;case"string":n.im=n.re=0;const t=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let r=1,i=0;null===t&&kn();for(let e=0;e0&&kn();break;case"number":n.im=0,n.re=e;break;default:kn()}return isNaN(n.re)||isNaN(n.im),n};function jn(e,t){if(!(this instanceof jn))return new jn(e,t);const n=Pn(e,t);this.re=n.re,this.im=n.im}jn.prototype={re:0,im:0,sign:function(){const e=zn(this.re,this.im);return new jn(this.re/e,this.im/e)},add:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?jn.NAN:jn.INFINITY:new jn(this.re+n.re,this.im+n.im)},sub:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?jn.NAN:jn.INFINITY:new jn(this.re-n.re,this.im-n.im)},mul:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;return r&&a||i&&o?jn.NAN:r||i?jn.INFINITY:0===n.im&&0===this.im?new jn(this.re*n.re,0):new jn(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){const n=Pn(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),o=0===this.re&&0===this.im,a=0===n.re&&0===n.im;if(o&&a||r&&i)return jn.NAN;if(a||r)return jn.INFINITY;if(o||i)return jn.ZERO;if(0===n.im)return new jn(this.re/n.re,this.im/n.re);if(Math.abs(n.re)0)return new jn(Math.pow(this.re,n.re),0);if(0===this.re)switch((n.re%4+4)%4){case 0:return new jn(Math.pow(this.im,n.re),0);case 1:return new jn(0,Math.pow(this.im,n.re));case 2:return new jn(-Math.pow(this.im,n.re),0);case 3:return new jn(0,-Math.pow(this.im,n.re))}}if(r&&n.re>0)return jn.ZERO;const i=Math.atan2(this.im,this.re),o=Rn(this.re,this.im);let a=Math.exp(n.re*o-n.im*i),s=n.im*o+n.re*i;return new jn(a*Math.cos(s),a*Math.sin(s))},sqrt:function(){const e=this.re,t=this.im;if(0===t)return e>=0?new jn(Math.sqrt(e),0):new jn(0,Math.sqrt(-e));const n=zn(e,t);let r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new jn(r,t<0?-i:i):new jn(i,t<0?-r:r)},exp:function(){const e=Math.exp(this.re);return 0===this.im?new jn(e,0):new jn(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new jn(Math.expm1(e)*Math.cos(t)+function(e){const t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;const n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return 0===t&&e>0?new jn(Math.log(e),0):new jn(Rn(e,t),Math.atan2(t,e))},abs:function(){return zn(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new jn(Math.sin(e)*_n(t),Math.cos(e)*In(t))},cos:function(){const e=this.re,t=this.im;return new jn(Math.cos(e)*_n(t),-Math.sin(e)*In(t))},tan:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)+_n(t);return new jn(Math.sin(e)/n,In(t)/n)},cot:function(){const e=2*this.re,t=2*this.im,n=Math.cos(e)-_n(t);return new jn(-Math.sin(e)/n,In(t)/n)},sec:function(){const e=this.re,t=this.im,n=.5*_n(2*t)+.5*Math.cos(2*e);return new jn(Math.cos(e)*_n(t)/n,Math.sin(e)*In(t)/n)},csc:function(){const e=this.re,t=this.im,n=.5*_n(2*t)-.5*Math.cos(2*e);return new jn(Math.sin(e)*_n(t)/n,-Math.cos(e)*In(t)/n)},asin:function(){const e=this.re,t=this.im,n=new jn(t*t-e*e+1,-2*e*t).sqrt(),r=new jn(n.re-t,n.im+e).log();return new jn(r.im,-r.re)},acos:function(){const e=this.re,t=this.im,n=new jn(t*t-e*e+1,-2*e*t).sqrt(),r=new jn(n.re-t,n.im+e).log();return new jn(Math.PI/2-r.im,r.re)},atan:function(){const e=this.re,t=this.im;if(0===e){if(1===t)return new jn(0,1/0);if(-1===t)return new jn(0,-1/0)}const n=e*e+(1-t)*(1-t),r=new jn((1-t*t-e*e)/n,-2*e/n).log();return new jn(-.5*r.im,.5*r.re)},acot:function(){const e=this.re,t=this.im;if(0===t)return new jn(Math.atan2(1,e),0);const n=e*e+t*t;return 0!==n?new jn(e/n,-t/n).atan():new jn(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new jn(0,1/0);const n=e*e+t*t;return 0!==n?new jn(e/n,-t/n).acos():new jn(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new jn(Math.PI/2,1/0);const n=e*e+t*t;return 0!==n?new jn(e/n,-t/n).asin():new jn(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new jn(In(e)*Math.cos(t),_n(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new jn(_n(e)*Math.cos(t),In(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,n=_n(e)+Math.cos(t);return new jn(In(e)/n,Math.sin(t)/n)},coth:function(){const e=2*this.re,t=2*this.im,n=_n(e)-Math.cos(t);return new jn(In(e)/n,-Math.sin(t)/n)},csch:function(){const e=this.re,t=this.im,n=Math.cos(2*t)-_n(2*e);return new jn(-2*In(e)*Math.cos(t)/n,2*_n(e)*Math.sin(t)/n)},sech:function(){const e=this.re,t=this.im,n=Math.cos(2*t)+_n(2*e);return new jn(2*_n(e)*Math.cos(t)/n,-2*In(e)*Math.sin(t)/n)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){const e=this.acos();if(e.im<=0){const t=e.re;e.re=-e.im,e.im=t}else{const t=e.im;e.im=-e.re,e.re=t}return e},atanh:function(){const e=this.re,t=this.im,n=e>1&&0===t,r=1-e,i=1+e,o=r*r+t*t,a=0!==o?new jn((i*r-t*t)/o,(t*r+i*t)/o):new jn(-1!==e?e/0:0,0!==t?t/0:0),s=a.re;return a.re=Rn(a.re,a.im)/2,a.im=Math.atan2(a.im,s)/2,n&&(a.im=-a.im),a},acoth:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new jn(0,Math.PI/2);const n=e*e+t*t;return 0!==n?new jn(e/n,-t/n).atanh():new jn(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(0===t)return new jn(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const n=e*e+t*t;return 0!==n?new jn(e/n,-t/n).asinh():new jn(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return jn.INFINITY;const n=e*e+t*t;return 0!==n?new jn(e/n,-t/n).acosh():new jn(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return jn.INFINITY;if(this.isInfinite())return jn.ZERO;const e=this.re,t=this.im,n=e*e+t*t;return new jn(e/n,-t/n)},conjugate:function(){return new jn(this.re,-this.im)},neg:function(){return new jn(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new jn(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new jn(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new jn(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const n=Pn(e,t);return Math.abs(n.re-this.re)<=jn.EPSILON&&Math.abs(n.im-this.im)<=jn.EPSILON},clone:function(){return new jn(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)(Object.defineProperty(jn,"name",{value:"Complex"}),jn.prototype.constructor=jn,jn.prototype.type="Complex",jn.prototype.isComplex=!0,jn.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},jn.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},jn.prototype.format=function(e){let t="",n=this.im,r=this.re;const i=Me(this.re,e),o=Me(this.im,e),a=d(e)?e:e?e.precision:null;if(null!==a){const e=Math.pow(10,-a);Math.abs(r/n)t.re?1:e.ret.im?1:e.im1&&(t[n]=(t[n]||Ln)+$n):t[e]=(t[e]||Ln)+$n,t}const Qn=function(e,t){let n=Ln,r=$n,i=$n;if(null==e);else if(void 0!==t){if("bigint"==typeof e)n=e;else{if(isNaN(e))throw nr();if(e%1!=0)throw rr();n=BigInt(e)}if("bigint"==typeof t)r=t;else{if(isNaN(t))throw nr();if(t%1!=0)throw rr();r=BigInt(t)}i=n*r}else if("object"==typeof e){if("d"in e&&"n"in e)n=BigInt(e.n),r=BigInt(e.d),"s"in e&&(n*=BigInt(e.s));else if(0 in e)n=BigInt(e[0]),1 in e&&(r=BigInt(e[1]));else{if("bigint"!=typeof e)throw nr();n=e}i=n*r}else if("number"==typeof e){if(isNaN(e))throw nr();if(e<0&&(i=-$n,e=-e),e%1==0)n=BigInt(e);else{let t=1,i=0,o=1,a=1,s=1,u=1e7;for(e>=1&&(t=10**Math.floor(1+Math.log10(e)),e/=t);o<=u&&s<=u;){let t=(i+a)/(o+s);if(e===t){o+s<=u?(n=i+a,r=o+s):s>o?(n=a,r=s):(n=i,r=o);break}e>t?(i+=a,o+=s):(a+=i,s+=o),o>u?(n=a,r=s):(n=i,r=o)}n=BigInt(n)*BigInt(t),r=BigInt(r)}}else if("string"==typeof e){let t=0,o=Ln,a=Ln,s=Ln,u=$n,c=$n,l=e.replace(/_/g,"").match(/\d+|./g);if(null===l)throw nr();if("-"===l[t]?(i=-$n,t++):"+"===l[t]&&t++,l.length===t+1?a=Wn(l[t++],i):"."===l[t+1]||"."===l[t]?("."!==l[t]&&(o=Wn(l[t++],i)),t++,(t+1===l.length||"("===l[t+1]&&")"===l[t+3]||"'"===l[t+1]&&"'"===l[t+3])&&(a=Wn(l[t],i),u=Vn**BigInt(l[t].length),t++),("("===l[t]&&")"===l[t+2]||"'"===l[t]&&"'"===l[t+2])&&(s=Wn(l[t+1],i),c=Vn**BigInt(l[t+1].length)-$n,t+=3)):"/"===l[t+1]||":"===l[t+1]?(a=Wn(l[t],i),u=Wn(l[t+2],$n),t+=3):"/"===l[t+3]&&" "===l[t+1]&&(o=Wn(l[t],i),a=Wn(l[t+2],i),u=Wn(l[t+4],$n),t+=5),!(l.length<=t))throw nr();r=u*c,i=n=s+r*o+c*a}else{if("bigint"!=typeof e)throw nr();n=e,i=e,r=$n}if(r===Ln)throw tr();Zn.s=iZn.s*Zn.n*this.d},gte:function(e,t){return Qn(e,t),this.s*this.n*Zn.d>=Zn.s*Zn.n*this.d},compare:function(e,t){Qn(e,t);let n=this.s*this.n*Zn.d-Zn.s*Zn.n*this.d;return(LnLn&&this.s>=Ln?$n:Ln),e)},floor:function(e){return e=Vn**BigInt(e||0),Jn(Yn(this.s*e*this.n/this.d)-(e*this.n%this.d>Ln&&this.s=Ln?$n:Ln)+Hn*(e*this.n%this.d)>this.d?$n:Ln),e)},roundTo:function(e,t){Qn(e,t);const n=this.n*Zn.d,r=this.d*Zn.n,i=n%r;let o=Yn(n/r);return i+i>=r&&o++,Jn(this.s*o*Zn.n,Zn.d)},divisible:function(e,t){return Qn(e,t),!(!(Zn.n*this.d)||this.n*Zn.d%(Zn.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e){let t=this.n,n=this.d;e=e||15;let r=function(e,t){for(;t%Hn===Ln;t/=Hn);for(;t%Gn===Ln;t/=Gn);if(t===$n)return Ln;let n=Vn%t,r=1;for(;n!==$n;r++)if(n=n*Vn%t,r>2e3)return Ln;return BigInt(r)}(0,n),i=function(e,t,n){let r=$n,i=function(e,t,n){let r=$n;for(;t>Ln;e=e*e%n,t>>=$n)t&$n&&(r=r*e%n);return r}(Vn,n,t);for(let e=0;e<300;e++){if(r===i)return BigInt(e);r=r*Vn%t,i=i*Vn%t}return 0}(0,n,r),o=this.sLn&&(r+=i,r+=" ",t%=n),r+=t,r+="/",r+=n}return r},toLatex:function(e){let t=this.n,n=this.d,r=this.sLn&&(r+=i,t%=n),r+="\\frac{",r+=t,r+="}{",r+=n,r+="}"}return r},toContinued:function(){let e=this.n,t=this.d,n=[];do{n.push(Yn(e/t));let r=e%t;e=t,t=r}while(e!==$n);return n},simplify:function(e){const t=BigInt(1/(e||.001)|0),n=this.abs(),r=n.toContinued();for(let e=1;e=0;t--)i=i.inverse().add(r[t]);let o=i.sub(n);if(o.n*t(Object.defineProperty(er,"name",{value:"Fraction"}),er.prototype.constructor=er,er.prototype.type="Fraction",er.prototype.isFraction=!0,er.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},er.fromJSON=function(e){return new er(e)},er)),{isClass:!0});n(3362),n(1795);const or=he("Range",[],(()=>{function e(t,n,r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");const i=null!=t,o=null!=n,a=null!=r;if(i)if(g(t))t=t.toNumber();else if("number"!=typeof t&&!y(t))throw new TypeError("Parameter start must be a number or bigint");if(o)if(g(n))n=n.toNumber();else if("number"!=typeof n&&!y(n))throw new TypeError("Parameter end must be a number or bigint");if(a)if(g(r))r=r.toNumber();else if("number"!=typeof r&&!y(r))throw new TypeError("Parameter step must be a number or bigint");this.start=i?parseFloat(t):0,this.end=o?parseFloat(n):0,this.step=a?parseFloat(r):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;const n=t.split(":").map((function(e){return parseFloat(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){let e=0;const t=this.start,n=this.step,r=this.end-t;return be(n)===be(r)?e=Math.ceil(r/n):0===r&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){const e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){const e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){let t=this.start;const n=this.step,r=this.end;let i=0;if(n>0)for(;tr;)e(t,[i],this),t+=n,i++},e.prototype.map=function(e){const t=[];return this.forEach((function(n,r,i){t[r[0]]=e(n,r,i)})),t},e.prototype.toArray=function(){const e=[];return this.forEach((function(t,n){e[n[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){let t=Me(this.start,e);return 1!==this.step&&(t+=":"+Me(this.step,e)),t+=":"+Me(this.end,e),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(t){return new e(t.start,t.end,t.step)},e}),{isClass:!0}),ar=he("Matrix",[],(()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0});function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0?"+":"")+r.toString()}(e,r);case"bin":return ur(e,2,i);case"oct":return ur(e,8,i);case"hex":return ur(e,16,i);case"auto":{const n=lr(null==t?void 0:t.lowerExp,-3),i=lr(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";let o;const a=e.toSignificantDigits(r),s=a.e;return o=s>=n&&smr(n)+": "+pr(e[n],t))).join(", ")+"}":String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+"...":n}function mr(e){const t=String(e);let n="",r=0;for(;r/g,">"),t}function gr(e,t){if(Array.isArray(e)){let n="[";const r=e.length;for(let i=0;it?1:-1}function xr(e,t,n){if(!(this instanceof xr))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function br(e,t,n){if(!(this instanceof br))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function vr(e){const t=[];for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function wr(e,t,n){let r;const i=e.length;if(i!==t[n])throw new xr(i,t[n]);if(n")}function Nr(e,t){if(0===t.length){if(Array.isArray(e))throw new xr(e.length,0)}else wr(e,t,0)}function Er(e,t){const n=e.isMatrix?e._size:vr(e);t._sourceSize.forEach(((e,t)=>{if(null!==e&&e!==n[t])throw new xr(e,n[t])}))}function Ar(e,t){if(void 0!==e){if(!d(e)||!ye(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new br(e,t)}}function Sr(e){for(let t=0;t0;e--){const i=t[e];n=[];const o=r.length/i;for(let e=0;e=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(t%n!=0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-n);r[i]=-t/n}return r}function Dr(e){return e.reduce(((e,t)=>e*t),1)}function Fr(e,t){const n=t||vr(e);for(;Array.isArray(e)&&1===e.length;)e=e[0],n.shift();let r=n.length;for(;1===n[r-1];)r--;return r1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;if("boolean"!=typeof t)throw new TypeError("Boolean expected for second argument of flatten");const n=[];return t?function e(t){if(Array.isArray(t[0]))for(let n=0;nt.test(e)))}function jr(e,t){return Array.prototype.join.call(e,t)}function Ur(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;const t=[];let n=0;t[0]={value:e[0],identifier:0};for(let r=1;r1)return e.slice(1).reduce((function(e,n){return Hr(e,n,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function Vr(){for(var e=arguments.length,t=new Array(e),n=0;ne.length)),i=Math.max(...r),o=new Array(i).fill(null);for(let e=0;eo[t]&&(o[t]=n[e])}}for(let e=0;e1||e[i]>t[o])throw new Error(`shape mismatch: mismatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[o]}`)}}function Wr(e,t){let n=vr(e);if(ce(n,t))return e;Zr(n,t);const r=Vr(n,t),i=r.length,o=[...Array(i-n.length).fill(1),...n];let a=function(e){return sr([],e)}(e);n.lengthe[t]),e)}function Jr(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return[];if(n)return function e(n){if(Array.isArray(n)){const t=n.length,r=Array(t);for(let i=0;i2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return;if(n)return void function e(n){if(Array.isArray(n)){const t=n.length;for(let r=0;r3&&void 0!==arguments[3]&&arguments[3];if(t.isTypedFunction(e)){let o,a;if(i)o=1;else{const r=(n.isMatrix?n.size():vr(n)).map((()=>0)),i=n.isMatrix?n.get(r):Yr(n,r);o=function(e,n,r,i){const o=[n,r,i];for(let n=3;n>0;n--){const r=o.slice(0,n);if(null!==t.resolve(e,r))return n}}(e,i,r,n)}if(n.isMatrix&&"mixed"!==n.dataType&&void 0!==n.dataType){const t=function(e,t){const n=[];if(Object.entries(e.signatures).forEach((e=>{let[r,i]=e;r.split(",").length===t&&n.push(i)})),1===n.length)return n[0]}(e,o);a=void 0!==t?t:e}else a=e;return o>=1&&o<=3?{isUnary:1===o,fn:function(){for(var t=arguments.length,n=new Array(t),i=0;i=2&&e.push(`index: ${oe(t[1])}`),t.length>=3&&e.push(`array: ${oe(t[2])}`),new TypeError(`Function ${n} cannot apply callback arguments ${r}(${e.join(", ")}) at index ${JSON.stringify(t[1])}`)}throw new TypeError(`Function ${n} cannot apply callback arguments to function ${r}: ${e.message}`)}(e,t,n,r)}}xr.prototype=new RangeError,xr.prototype.constructor=RangeError,xr.prototype.name="DimensionError",xr.prototype.isDimensionError=!0,br.prototype=new RangeError,br.prototype.constructor=RangeError,br.prototype.name="IndexError",br.prototype.isIndexError=!0,n(3110);const ti=he("DenseMatrix",["Matrix"],(e=>{let{Matrix:t}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(E(e))"DenseMatrix"===e.type?(this._data=ae(e._data),this._size=ae(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&N(e.data)&&N(e.size))this._data=e.data,this._size=e.size,Nr(this._data,this._size),this._datatype=t||e.datatype;else if(N(e))this._data=o(e),this._size=vr(this._data),Nr(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+oe(e)+")");this._data=[],this._size=[0],this._datatype=t}}function r(e,t,n){if(0===t.length){let t=e._data;for(;N(t);)t=t[0];return t}return e._size=t.slice(0),e._data=Mr(e._data,e._size,n),e}function i(e,t,n){const i=e._size.slice(0);let o=!1;for(;i.lengthi[e]&&(i[e]=t[e],o=!0);o&&r(e,i,n)}function o(e){return E(e)?o(e.valueOf()):N(e)?e.map(o):e}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return $r(this._data,oe)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,r){switch(arguments.length){case 1:return function(e,t){if(!T(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());{const r=t.size();if(r.length!==e._size.length)throw new xr(r.length,e._size.length);const i=t.min(),o=t.max();for(let t=0,n=e._size.length;t1&&void 0!==arguments[1]?arguments[1]:0;const a=t.dimension(o);return r[o]=a.size()[0],o(Ar(t,i.length),e(i[t],o+1)))).valueOf():a.map((e=>(Ar(e,i.length),i[e]))).valueOf()}(e),size:r}}(e._data,t);return a._size=s.size,a._datatype=e._datatype,a._data=s.data,a}}(this,e);case 2:case 3:return function(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");const o=t.size(),a=t.isScalar();let s;if(E(n)?(s=n.size(),n=n.valueOf()):s=vr(n),a){if(0!==s.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(!ce(s,o))try{s=vr(n=0===s.length?Wr([n],o):Wr(n,o))}catch(e){}if(o.length");i(e,t.max().map((function(e){return e+1})),r),function(e,t,n){const r=t.size().length-1;!function e(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const a=t.dimension(o);o{Ar(t,n.length),e(n[t],i[r[0]],o+1)})):a.forEach(((e,t)=>{Ar(e,n.length),n[e]=i[t[0]]}))}(e,n)}(e._data,t,n)}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){return Yr(this._data,e)},n.prototype.set=function(e,t,n){if(!N(e))throw new TypeError("Array expected");if(e.lengthArray.isArray(e)&&1===e.length?e[0]:e));return r(n?this.clone():this,i,t)},n.prototype.reshape=function(e,t){const n=t?this.clone():this;n._data=Tr(n._data,e);const r=n._size.reduce(((e,t)=>e*t));return n._size=Br(e,r),n},n.prototype.clone=function(){return new n({data:ae(this._data),size:ae(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=this,r=n._size.length-1;if(r<0)return n.clone();const i=Qr(e,n,"map",t),o=i.fn,a=n.create(void 0,n._datatype);if(a._size=n._size,t||i.isUnary)return a._data=function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=Array(t.length);if(n1&&void 0!==arguments[1]?arguments[1]:0;const a=Array(t.length);if(i2&&void 0!==arguments[2]&&arguments[2];const n=this,r=n._size.length-1;if(r<0)return;const i=Qr(e,n,"map",t),o=i.fn;if(t||i.isUnary)return void function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(n1&&void 0!==arguments[1]?arguments[1]:0;if(i[e[i]]));e.push(new n(t,this._datatype))}return e},n.prototype.toArray=function(){return ae(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return pr(this._data,e)},n.prototype.toString=function(){return pr(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(g(e)&&(e=e.toNumber()),!d(e)||!ye(e))throw new TypeError("The parameter k must be an integer number")}else e=0;const t=e>0?e:0,r=e<0?-e:0,i=this._size[0],o=this._size[1],a=Math.min(i-r,o-t),s=[];for(let e=0;e0?r:0,a=r<0?-r:0,s=e[0],u=e[1],c=Math.min(s-a,u-o);let l;if(N(t)){if(t.length!==c)throw new Error("Invalid value array length");l=function(e){return t[e]}}else if(E(t)){const e=t.size();if(1!==e.length||e[0]!==c)throw new Error("Invalid matrix length");l=function(e){return t.get([e])}}else l=function(){return t};i||(i=g(l(0))?l(0).mul(0):0);let f=[];if(e.length>0){f=Mr(f,e,i);for(let e=0;e{let{typed:t}=e;return t(ni,{any:ae})}));function ii(e){const t=e.length,n=e[0].length;let r,i;const o=[];for(i=0;it(e)),!1,!0):Xr(e,t,!0)}function si(e,t,n){if(!n)return E(e)?e.map((e=>t(e)),!1,!0):Jr(e,t,!0);const r=e=>0===e?e:t(e);return E(e)?e.map((e=>r(e)),!1,!0):Jr(e,r,!0)}function ui(e,t,n){const r=Array.isArray(e)?vr(e):e.size();if(t<0||t>=r.length)throw new br(t,r.length);return E(e)?e.create(ci(e.valueOf(),t,n),e.datatype()):ci(e,t,n)}function ci(e,t,n){let r,i,o,a;if(t<=0){if(Array.isArray(e[0])){for(a=ii(e),i=[],r=0;r{let{typed:t}=e;return t(fi,{number:ye,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1n===e.d},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})}));n(2577);const mi="number";function hi(e){return e<0}function di(e){return e>0}function gi(e){return Number.isNaN(e)}function yi(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(n<=0)throw new Error("Relative tolerance must be greater than 0");if(r<0)throw new Error("Absolute tolerance must be at least 0");return!e.isNaN()&&!t.isNaN()&&(e.isFinite()&&t.isFinite()?!!e.eq(t)||e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(n),r)):e.eq(t))}hi.signature=mi,di.signature=mi,gi.signature=mi;const xi="isNegative",bi=he(xi,["typed","config"],(e=>{let{typed:t,config:n}=e;return t(xi,{number:e=>!_e(e,0,n.relTol,n.absTol)&&hi(e),BigNumber:e=>!yi(e,new e.constructor(0),n.relTol,n.absTol)&&e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e<0n,Fraction:e=>e.s<0n,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),vi="isNumeric",wi=he(vi,["typed"],(e=>{let{typed:t}=e;return t(vi,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Ni="hasNumericValue",Ei=he(Ni,["typed","isNumeric"],(e=>{let{typed:t,isNumeric:n}=e;return t(Ni,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})})),Ai="isPositive",Si=he(Ai,["typed","config"],(e=>{let{typed:t,config:n}=e;return t(Ai,{number:e=>!_e(e,0,n.relTol,n.absTol)&&di(e),BigNumber:e=>!(yi(e,new e.constructor(0),n.relTol,n.absTol)||e.isNeg()||e.isZero()||e.isNaN()),bigint:e=>e>0n,Fraction:e=>e.s>0n&&e.n>0n,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Mi="isZero",Ci=he(Mi,["typed","equalScalar"],(e=>{let{typed:t,equalScalar:n}=e;return t(Mi,{"number | BigNumber | Complex | Fraction":e=>n(e,0),bigint:e=>0n===e,Unit:t.referToSelf((e=>n=>t.find(e,n.valueType())(n.value))),"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Ti="isNaN",Bi=he(Ti,["typed"],(e=>{let{typed:t}=e;return t(Ti,{number:gi,BigNumber:function(e){return e.isNaN()},bigint:function(e){return!1},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Di="typeOf",Fi=he(Di,["typed"],(e=>{let{typed:t}=e;return t(Di,{any:oe})})),Oi=he("compareUnits",["typed"],(e=>{let{typed:t}=e;return{"Unit, Unit":t.referToSelf((e=>(n,r)=>{if(!n.equalBase(r))throw new Error("Cannot compare units with different base");return t.find(e,[n.valueType(),r.valueType()])(n.value,r.value)}))}})),_i="equalScalar",Ii=he(_i,["typed","config"],(e=>{let{typed:t,config:n}=e;const r=Oi({typed:t});return t(_i,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return _e(e,t,n.relTol,n.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||yi(e,t,n.relTol,n.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,n,r){return _e(e.re,t.re,n,r)&&_e(e.im,t.im,n,r)}(e,t,n.relTol,n.absTol)}},r)})),zi=(he(_i,["typed","config"],(e=>{let{typed:t,config:n}=e;return t(_i,{"number, number":function(e,t){return _e(e,t,n.relTol,n.absTol)}})})),he("SparseMatrix",["typed","equalScalar","Matrix"],(e=>{let{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(E(e))!function(e,t,n){"SparseMatrix"===t.type?(e._values=t._values?ae(t._values):void 0,e._index=ae(t._index),e._ptr=ae(t._ptr),e._size=ae(t._size),e._datatype=n||t._datatype):o(e,t.valueOf(),n||t._datatype)}(this,e,t);else if(e&&N(e.index)&&N(e.ptr)&&N(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(N(e))o(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+oe(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function o(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;const o=r.length;let a=0,s=n,u=0;if(w(i)&&(s=t.find(n,[i,i])||n,u=t.convert(0,i)),o>0){let t=0;do{e._ptr.push(e._index.length);for(let n=0;nh){for(p=h;pl){if(c){let t=0;for(p=0;pr-1&&(e._values.splice(m,1),e._index.splice(m,1),t++)}e._ptr[p]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function c(e,t,n,r,i){const o=r[0],a=r[1],s=[];let u,c;for(u=0;u");if(1===i.length)t.dimension(0).forEach((function(t,i){Ar(t),e.set([t,0],n[i[0]],r)}));else{const i=t.dimension(0),o=t.dimension(1);i.forEach((function(t,i){Ar(t),o.forEach((function(o,a){Ar(o),e.set([t,o],n[i[0]][a[0]],r)}))}))}}return e}(this,e,t,n);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!N(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new xr(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");const t=e[0],n=e[1];Ar(t,this._size[0]),Ar(n,this._size[1]);const r=a(t,this._ptr[n],this._ptr[n+1],this._index);return rl-1||c>f-1)&&(u(this,Math.max(o+1,l),Math.max(c+1,f),i),l=this._size[0],f=this._size[1]),Ar(o,l),Ar(c,f);const h=a(o,this._ptr[c],this._ptr[c+1],this._index);return hArray.isArray(e)&&1===e.length?e[0]:e));if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(e){if(!d(e)||!ye(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+pr(r)+")")})),u(n?this.clone():this,r[0],r[1],t)},i.prototype.reshape=function(e,t){if(!N(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!d(t)||!ye(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+pr(e)+")")}));const n=this._size[0]*this._size[1];if(n!==(e=Br(e,n))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");const r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;const i=[];for(let e=0;e=0&&n<=a&&y(e._values[i],n-0,t-0)}else{const i={};for(let t=n;t "+(this._values?pr(this._values[o],e):"X")}return i},i.prototype.toString=function(){return pr(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(g(e)&&(e=e.toNumber()),!d(e)||!ye(e))throw new TypeError("The parameter k must be an integer number")}else e=0;const t=e>0?e:0,n=e<0?-e:0,r=this._size[0],o=this._size[1],a=Math.min(r-n,o-t),s=[],u=[],c=[];c[0]=0;for(let e=t;e0?o:0,f=o<0?-o:0,p=e[0],m=e[1],h=Math.min(p-f,m-l);let y;if(N(r)){if(r.length!==h)throw new Error("Invalid value array length");y=function(e){return r[e]}}else if(E(r)){const e=r.size();if(1!==e.length||e[0]!==h)throw new Error("Invalid matrix length");y=function(e){return r.get([e])}}else y=function(){return r};const x=[],b=[],v=[];for(let e=0;e=0&&t=u||i[l]!==t)){const e=r?r[c]:void 0;i.splice(l,0,t),r&&r.splice(l,0,e),i.splice(l<=c?c+1:c,1),r&&r.splice(l<=c?c+1:c,1)}else if(l=u||i[c]!==e)){const t=r?r[l]:void 0;i.splice(c,0,e),r&&r.splice(c,0,t),i.splice(c<=l?l+1:l,1),r&&r.splice(c<=l?l+1:l,1)}}},i}),{isClass:!0})),ki=he("number",["typed"],(e=>{let{typed:t}=e;const n=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;const t=function(e){const t=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);return t?{input:e,radix:{"0b":2,"0o":8,"0x":16}[t[1]],integerPart:t[2],fractionalPart:t[3]}:null}(e);if(t)return function(e){const t=parseInt(e.integerPart,e.radix);let n=0;for(let t=0;t2**n-1)throw new SyntaxError(`String "${e}" is out of range`);i>=2**(n-1)&&(i-=2**n)}return i},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((e=>t=>{const n=t.clone();return n.value=e(t.value),n})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))});return n.fromJSON=function(e){return parseFloat(e.value)},n})),Ri=he("bigint",["typed"],(e=>{let{typed:t}=e;const n=t("bigint",{"":function(){return 0n},bigint:function(e){return e},number:function(e){return BigInt(e.toFixed())},BigNumber:function(e){return BigInt(e.round().toString())},Fraction:function(e){return BigInt(e.valueOf().toFixed())},"string | boolean":function(e){return BigInt(e)},null:function(e){return 0n},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))});return n.fromJSON=function(e){return BigInt(e.value)},n})),qi="string",Pi=he(qi,["typed"],(e=>{let{typed:t}=e;return t(qi,{"":function(){return""},number:Me,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((e=>t=>si(t,e))),any:function(e){return String(e)}})})),ji="boolean",Ui=he(ji,["typed"],(e=>{let{typed:t}=e;return t(ji,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){const t=e.toLowerCase();if("true"===t)return!0;if("false"===t)return!1;const n=Number(e);if(""!==e&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Li=he("bignumber",["typed","BigNumber"],(e=>{let{typed:t,BigNumber:n}=e;return t("bignumber",{"":function(){return new n(0)},number:function(e){return new n(e+"")},string:function(e){const t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){const r=t[2],i=n(t[1]),o=new n(2).pow(Number(r));if(i.gt(o.sub(1)))throw new SyntaxError(`String "${e}" is out of range`);const a=new n(2).pow(Number(r)-1);return i.gte(a)?i.sub(o):i}return new n(e)},BigNumber:function(e){return e},bigint:function(e){return new n(e.toString())},Unit:t.referToSelf((e=>t=>{const n=t.clone();return n.value=e(t.value),n})),Fraction:function(e){return new n(String(e.n)).div(String(e.d)).times(String(e.s))},null:function(e){return new n(0)},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),$i=he("complex",["typed","Complex"],(e=>{let{typed:t,Complex:n}=e;return t("complex",{"":function(){return n.ZERO},number:function(e){return new n(e,0)},"number, number":function(e,t){return new n(e,t)},"BigNumber, BigNumber":function(e,t){return new n(e.toNumber(),t.toNumber())},Fraction:function(e){return new n(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return n(e)},null:function(e){return n(0)},Object:function(e){if("re"in e&&"im"in e)return new n(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new n(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Hi=he("fraction",["typed","Fraction"],(e=>{let{typed:t,Fraction:n}=e;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new n(e)},string:function(e){return new n(e)},"number, number":function(e,t){return new n(e,t)},"bigint, bigint":function(e,t){return new n(e,t)},null:function(e){return new n(0)},BigNumber:function(e){return new n(e.toString())},bigint:function(e){return new n(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((e=>t=>{const n=t.clone();return n.value=e(t.value),n})),Object:function(e){return new n(e)},"Array | Matrix":t.referToSelf((e=>t=>si(t,e)))})})),Gi="matrix",Vi=he(Gi,["typed","Matrix","DenseMatrix","SparseMatrix"],(e=>{let{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Gi,{"":function(){return o([])},string:function(e){return o([],e)},"string, string":function(e,t){return o([],e,t)},Array:function(e){return o(e)},Matrix:function(e){return o(e,e.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(e,t,n){if("dense"===t||"default"===t||void 0===t)return new r(e,n);if("sparse"===t)return new i(e,n);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Zi="matrixFromFunction",Wi=he(Zi,["typed","matrix","isZero"],(e=>{let{typed:t,matrix:n,isZero:r}=e;return t(Zi,{"Array | Matrix, function, string, string":function(e,t,n,r){return i(e,t,n,r)},"Array | Matrix, function, string":function(e,t,n){return i(e,t,n)},"Matrix, function":function(e,t){return i(e,t,"dense")},"Array, function":function(e,t){return i(e,t,"dense").toArray()},"Array | Matrix, string, function":function(e,t,n){return i(e,n,t)},"Array | Matrix, string, string, function":function(e,t,n,r){return i(e,r,t,n)}});function i(e,t,i,o){let a;return a=void 0!==o?n(i,o):n(i),a.resize(e),a.forEach((function(e,n){const i=t(n);r(i)||a.set(n,i)})),a}})),Yi="matrixFromRows",Ji=he(Yi,["typed","matrix","flatten","size"],(e=>{let{typed:t,matrix:n,flatten:r,size:i}=e;return t(Yi,{"...Array":function(e){return o(e)},"...Matrix":function(e){return n(o(e.map((e=>e.toArray()))))}});function o(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");const t=a(e[0]),n=[];for(const i of e){const e=a(i);if(e!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|e));n.push(r(i))}return n}function a(e){const t=i(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),Xi="matrixFromColumns",Qi=he(Xi,["typed","matrix","flatten","size"],(e=>{let{typed:t,matrix:n,flatten:r,size:i}=e;return t(Xi,{"...Array":function(e){return o(e)},"...Matrix":function(e){return n(o(e.map((e=>e.toArray()))))}});function o(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");const t=a(e[0]),n=[];for(let e=0;e{let{typed:t}=e;return t(Ki,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),to="number",no="number, number";function ro(e){return Math.abs(e)}function io(e,t){return e+t}function oo(e,t){return e-t}function ao(e,t){return e*t}function so(e){return-e}function uo(e){return e}function co(e){return Ee(e)}function lo(e){return e*e*e}function fo(e){return Math.exp(e)}function po(e){return Ae(e)}function mo(e,t){if(!ye(e)||!ye(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;let n;const r=e*t;for(;0!==t;)n=t,t=e%n,e=n;return Math.abs(r/e)}function ho(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function go(e){return we(e)}function yo(e){return ve(e)}function xo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;const n=t<0;if(n&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return n?1/0:0;if(!isFinite(e))return n?0:e;let r=Math.pow(Math.abs(e),1/t);return r=e<0?-r:r,n?1/r:r}function bo(e){return be(e)}function vo(e){return e*e}function wo(e,t){let n,r,i,o,a=0,s=1,u=1,c=0;if(!ye(e)||!ye(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)r=Math.floor(e/t),i=e-r*t,n=a,a=s-r*a,s=n,n=u,u=c-r*u,c=n,e=t,t=i;return o=e<0?[-e,-s,-c]:[e,e?s:0,c],o}function No(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function Eo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!ye(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Be(e,t))}ro.signature=to,io.signature=no,oo.signature=no,ao.signature=no,so.signature=to,uo.signature=to,co.signature=to,lo.signature=to,fo.signature=to,po.signature=to,mo.signature=no,go.signature=to,yo.signature=to,bo.signature=to,vo.signature=to,wo.signature=no,No.signature=no;const Ao="unaryMinus",So=he(Ao,["typed"],(e=>{let{typed:t}=e;return t(Ao,{number:so,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf((e=>n=>{const r=n.clone();return r.value=t.find(e,r.valueType())(n.value),r})),"Array | Matrix":t.referToSelf((e=>t=>si(t,e,!0)))})})),Mo="unaryPlus",Co=he(Mo,["typed","config","numeric"],(e=>{let{typed:t,config:n,numeric:r}=e;return t(Mo,{number:uo,Complex:function(e){return e},BigNumber:function(e){return e},bigint:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":t.referToSelf((e=>t=>si(t,e,!0))),boolean:function(e){return r(e?1:0,n.number)},string:function(e){return r(e,xe(e,n))}})})),To=he("abs",["typed"],(e=>{let{typed:t}=e;return t("abs",{number:ro,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf((e=>t=>si(t,e,!0)))})})),Bo="mapSlices",Do=he(Bo,["typed","isInteger"],(e=>{let{typed:t,isInteger:n}=e;return t(Bo,{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw new TypeError("Integer number expected for dimension");const i=Array.isArray(e)?vr(e):e.size();if(t<0||t>=i.length)throw new br(t,i.length);return E(e)?e.create(Fo(e.valueOf(),t,r),e.datatype()):Fo(e,t,r)}})}),{formerly:"apply"});function Fo(e,t,n){let r,i,o;if(t<=0){if(Array.isArray(e[0])){for(o=function(e){const t=e.length,n=e[0].length;let r,i;const o=[];for(i=0;i{let{typed:t}=e;return t(Oo,{"number, number":io,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"bigint, bigint":function(e,t){return e+t},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf((e=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");const i=n.clone();return i.value=t.find(e,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i}))})})),Io="subtractScalar",zo=he(Io,["typed"],(e=>{let{typed:t}=e;return t(Io,{"number, number":oo,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"bigint, bigint":function(e,t){return e-t},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf((e=>(n,r)=>{if(null===n.value||void 0===n.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(r))throw new Error("Units do not match");const i=n.clone();return i.value=t.find(e,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i}))})})),ko="cbrt",Ro=he(ko,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(e=>{let{config:t,typed:n,isNegative:r,unaryMinus:i,matrix:o,Complex:a,BigNumber:s,Fraction:u}=e;return n(ko,{number:co,Complex:c,"Complex, boolean":c,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&x(e.value)){let t=e.clone();return t.value=1,t=t.pow(1/3),t.value=c(e.value),t}{const t=r(e.value);let n;t&&(e.value=i(e.value)),n=g(e.value)?new s(1).div(3):b(e.value)?new u(1,3):1/3;const o=e.pow(n);return t&&(o.value=i(o.value)),o}}});function c(e,n){const r=e.arg()/3,i=e.abs(),s=new a(co(i),0).mul(new a(0,r).exp());if(n){const e=[s,new a(co(i),0).mul(new a(0,r+2*Math.PI/3).exp()),new a(co(i),0).mul(new a(0,r-2*Math.PI/3).exp())];return"Array"===t.matrix?e:o(e)}return s}})),qo=he("matAlgo11xS0s",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:n}=e;return function(e,r,i,o){const a=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const f=c[0],p=c[1];let m,h=n,d=0,g=i;"string"==typeof l&&(m=l,h=t.find(n,[m,m]),d=t.convert(0,m),r=t.convert(r,m),g=t.find(i,[m,m]));const y=[],x=[],b=[];for(let e=0;e{let{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){const a=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const f=c[0],p=c[1];let m,h=i;"string"==typeof l&&(m=l,r=t.convert(r,m),h=t.find(i,[m,m]));const d=[],g=[],y=[];for(let e=0;e
{let{typed:t}=e;return function(e,r,i,o){const a=e._data,s=e._size,u=e._datatype;let c,l=i;"string"==typeof u&&(c=u,r=t.convert(r,c),l=t.find(i,[c,c]));const f=s.length>0?n(l,0,s,s[0],a,r,o):[];return e.createDenseMatrix({data:f,size:ae(s),datatype:c})};function n(e,t,r,i,o,a,s){const u=[];if(t===r.length-1)for(let t=0;t{let{typed:t,config:n,round:r}=e;function i(e){const t=Math.ceil(e),i=r(e);return t===i?t:_e(e,i,n.relTol,n.absTol)&&!_e(e,t,n.relTol,n.absTol)?i:t}return t(Uo,{number:i,"number, number":function(e,t){if(!ye(t))throw new RangeError("number of decimals in function ceil must be an integer");if(t<0||t>15)throw new RangeError("number of decimals in ceil number must be in range 0-15");const n=10**t;return i(e*n)/n}})})),Go=he(Uo,Lo,(e=>{let{typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=e;const u=qo({typed:t,equalScalar:o}),c=Po({typed:t,DenseMatrix:s}),l=jo({typed:t}),f=Ho({typed:t,config:n,round:r});function p(e){const t=(e,t)=>yi(e,t,n.relTol,n.absTol),i=e.ceil(),o=r(e);return i.eq(o)?i:t(e,o)&&!t(e,i)?o:i}return t("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:p,"BigNumber, BigNumber":function(e,t){const n=$o.pow(t);return p(e.mul(n)).div(n)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Unit, number, Unit":t.referToSelf((e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Array | Matrix, number | BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>si(t,(t=>e(t,n,r)),!0))),"Array | Matrix | Unit, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix":t.referToSelf((e=>t=>si(t,e,!0))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>si(t,(t=>e(t,n)),!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>l(t,n,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>l(i(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):"dense"===n.storage()?l(n,t,e,!0):c(n,t,e,!0)))})})),Vo="cube",Zo=he(Vo,["typed"],(e=>{let{typed:t}=e;return t(Vo,{number:lo,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},bigint:function(e){return e*e*e},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})})),Wo=he("exp",["typed"],(e=>{let{typed:t}=e;return t("exp",{number:fo,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),Yo="expm1",Jo=he(Yo,["typed","Complex"],(e=>{let{typed:t,Complex:n}=e;return t(Yo,{number:po,Complex:function(e){const t=Math.exp(e.re);return new n(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})})),Xo="fix",Qo=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],Ko=he(Xo,["typed","ceil","floor"],(e=>{let{typed:t,ceil:n,floor:r}=e;return t(Xo,{number:function(e){return e>0?r(e):n(e)},"number, number":function(e,t){return e>0?r(e,t):n(e,t)}})})),ea=he(Xo,Qo,(e=>{let{typed:t,Complex:n,matrix:r,ceil:i,floor:o,equalScalar:a,zeros:s,DenseMatrix:u}=e;const c=Po({typed:t,DenseMatrix:u}),l=jo({typed:t}),f=Ko({typed:t,ceil:i,floor:o});return t("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(e){return new n(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new n(e.re>0?o(e.re,t):i(e.re,t),e.im>0?o(e.im,t):i(e.im,t))},"Complex, BigNumber":function(e,t){const r=t.toNumber();return new n(e.re>0?o(e.re,r):i(e.re,r),e.im>0?o(e.im,r):i(e.im,r))},BigNumber:function(e){return e.isNegative()?i(e):o(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):o(e,t)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.s<0n?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0n?i(e,t):o(e,t)},"Unit, number, Unit":t.referToSelf((e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Array | Matrix, number | BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>si(t,(t=>e(t,n,r)),!0))),"Array | Matrix | Unit, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix":t.referToSelf((e=>t=>si(t,e,!0))),"Array | Matrix, number | BigNumber":t.referToSelf((e=>(t,n)=>si(t,(t=>e(t,n)),!0))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>l(r(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>a(t,0)?s(n.size(),n.storage()):"dense"===n.storage()?l(n,t,e,!0):c(n,t,e,!0)))})})),ta="floor",na=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],ra=new Fn(10),ia=he(ta,["typed","config","round"],(e=>{let{typed:t,config:n,round:r}=e;function i(e){const t=Math.floor(e),i=r(e);return t===i?t:_e(e,i,n.relTol,n.absTol)&&!_e(e,t,n.relTol,n.absTol)?i:t}return t(ta,{number:i,"number, number":function(e,t){if(!ye(t))throw new RangeError("number of decimals in function floor must be an integer");if(t<0||t>15)throw new RangeError("number of decimals in floor number must be in range 0 - 15");const n=10**t;return i(e*n)/n}})})),oa=he(ta,na,(e=>{let{typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}=e;const u=qo({typed:t,equalScalar:o}),c=Po({typed:t,DenseMatrix:s}),l=jo({typed:t}),f=ia({typed:t,config:n,round:r});function p(e){const t=(e,t)=>yi(e,t,n.relTol,n.absTol),i=e.floor(),o=r(e);return i.eq(o)?i:t(e,o)&&!t(e,i)?o:i}return t("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:p,"BigNumber, BigNumber":function(e,t){const n=ra.pow(t);return p(e.mul(n)).div(n)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Unit, number, Unit":t.referToSelf((e=>function(t,n,r){const i=t.toNumeric(r);return r.multiply(e(i,n))})),"Unit, BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>e(t,n.toNumber(),r))),"Array | Matrix, number | BigNumber, Unit":t.referToSelf((e=>(t,n,r)=>si(t,(t=>e(t,n,r)),!0))),"Array | Matrix | Unit, Unit":t.referToSelf((e=>(t,n)=>e(t,0,n))),"Array | Matrix":t.referToSelf((e=>t=>si(t,e,!0))),"Array, number | BigNumber":t.referToSelf((e=>(t,n)=>si(t,(t=>e(t,n)),!0))),"SparseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>u(t,n,e,!1))),"DenseMatrix, number | BigNumber":t.referToSelf((e=>(t,n)=>l(t,n,e,!1))),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((e=>(t,n)=>l(i(n),t,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((e=>(t,n)=>o(t,0)?a(n.size(),n.storage()):"dense"===n.storage()?l(n,t,e,!0):c(n,t,e,!0)))})})),aa=he("matAlgo02xDS0",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:n}=e;return function(e,r,i,o){const a=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._values,l=r._index,f=r._ptr,p=r._size,m=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(s.length!==p.length)throw new xr(s.length,p.length);if(s[0]!==p[0]||s[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const h=s[0],d=s[1];let g,y=n,x=0,b=i;"string"==typeof u&&u===m&&"mixed"!==u&&(g=u,y=t.find(n,[g,g]),x=t.convert(0,g),b=t.find(i,[g,g]));const v=[],w=[],N=[];for(let e=0;e{let{typed:t}=e;return function(e,n,r,i){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=n._values,c=n._index,l=n._ptr,f=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(a.length!==f.length)throw new xr(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const m=a[0],h=a[1];let d,g=0,y=r;"string"==typeof s&&s===p&&"mixed"!==s&&(d=s,g=t.convert(0,d),y=t.find(r,[d,d]));const x=[];for(let e=0;e{let{typed:t,equalScalar:n}=e;return function(e,r,i){const o=e._values,a=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=r._values,f=r._index,p=r._ptr,m=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==m.length)throw new xr(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");const d=u[0],g=u[1];let y,x=n,b=0,v=i;"string"==typeof c&&c===h&&"mixed"!==c&&(y=c,x=t.find(n,[y,y]),b=t.convert(0,y),v=t.find(i,[y,y]));const w=o&&l?[]:void 0,N=[],E=[],A=w?[]:void 0,S=w?[]:void 0,M=[],C=[];let T,B,D,F;for(B=0;B{let{typed:t}=e;return function(e,r,i){const o=e._data,a=e._size,s=e._datatype,u=r._data,c=r._size,l=r._datatype,f=[];if(a.length!==c.length)throw new xr(a.length,c.length);for(let e=0;e0?n(m,0,f,f[0],o,u):[];return e.createDenseMatrix({data:h,size:f,datatype:p})};function n(e,t,r,i,o,a){const s=[];if(t===r.length-1)for(let t=0;tfunction(e,t){return ce(e.size(),t)?e:e.create(Wr(e.valueOf(),t),e.datatype())}(e,n)))}const fa=he("matrixAlgorithmSuite",["typed","matrix"],(e=>{let{typed:t,matrix:n}=e;const r=ca({typed:t}),i=jo({typed:t});return function(e){const o=e.elop,a=e.SD||e.DS;let s;o?(s={"DenseMatrix, DenseMatrix":(e,t)=>r(...la(e,t),o),"Array, Array":(e,t)=>r(...la(n(e),n(t)),o).valueOf(),"Array, DenseMatrix":(e,t)=>r(...la(n(e),t),o),"DenseMatrix, Array":(e,t)=>r(...la(e,n(t)),o)},e.SS&&(s["SparseMatrix, SparseMatrix"]=(t,n)=>e.SS(...la(t,n),o,!1)),e.DS&&(s["DenseMatrix, SparseMatrix"]=(t,n)=>e.DS(...la(t,n),o,!1),s["Array, SparseMatrix"]=(t,r)=>e.DS(...la(n(t),r),o,!1)),a&&(s["SparseMatrix, DenseMatrix"]=(e,t)=>a(...la(t,e),o,!0),s["SparseMatrix, Array"]=(e,t)=>a(...la(n(t),e),o,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf((e=>(t,n)=>r(...la(t,n),e))),"Array, Array":t.referToSelf((e=>(t,i)=>r(...la(n(t),n(i)),e).valueOf())),"Array, DenseMatrix":t.referToSelf((e=>(t,i)=>r(...la(n(t),i),e))),"DenseMatrix, Array":t.referToSelf((e=>(t,i)=>r(...la(t,n(i)),e)))},e.SS&&(s["SparseMatrix, SparseMatrix"]=t.referToSelf((t=>(n,r)=>e.SS(...la(n,r),t,!1)))),e.DS&&(s["DenseMatrix, SparseMatrix"]=t.referToSelf((t=>(n,r)=>e.DS(...la(n,r),t,!1))),s["Array, SparseMatrix"]=t.referToSelf((t=>(r,i)=>e.DS(...la(n(r),i),t,!1)))),a&&(s["SparseMatrix, DenseMatrix"]=t.referToSelf((e=>(t,n)=>a(...la(n,t),e,!0))),s["SparseMatrix, Array"]=t.referToSelf((e=>(t,r)=>a(...la(n(r),t),e,!0)))));const u=e.scalar||"any";(e.Ds||e.Ss)&&(o?(s["DenseMatrix,"+u]=(e,t)=>i(e,t,o,!1),s[u+", DenseMatrix"]=(e,t)=>i(t,e,o,!0),s["Array,"+u]=(e,t)=>i(n(e),t,o,!1).valueOf(),s[u+", Array"]=(e,t)=>i(n(t),e,o,!0).valueOf()):(s["DenseMatrix,"+u]=t.referToSelf((e=>(t,n)=>i(t,n,e,!1))),s[u+", DenseMatrix"]=t.referToSelf((e=>(t,n)=>i(n,t,e,!0))),s["Array,"+u]=t.referToSelf((e=>(t,r)=>i(n(t),r,e,!1).valueOf())),s[u+", Array"]=t.referToSelf((e=>(t,r)=>i(n(r),t,e,!0).valueOf()))));const c=void 0!==e.sS?e.sS:e.Ss;return o?(e.Ss&&(s["SparseMatrix,"+u]=(t,n)=>e.Ss(t,n,o,!1)),c&&(s[u+", SparseMatrix"]=(e,t)=>c(t,e,o,!0))):(e.Ss&&(s["SparseMatrix,"+u]=t.referToSelf((t=>(n,r)=>e.Ss(n,r,t,!1)))),c&&(s[u+", SparseMatrix"]=t.referToSelf((e=>(t,n)=>c(n,t,e,!0))))),o&&o.signatures&&se(s,o.signatures),s}})),pa=he("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{let{typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s,concat:u}=e;const c=oa({typed:t,config:n,round:r,matrix:i,equalScalar:o,zeros:a,DenseMatrix:s}),l=aa({typed:t,equalScalar:o}),f=sa({typed:t}),p=ua({typed:t,equalScalar:o}),m=qo({typed:t,equalScalar:o}),h=Po({typed:t,DenseMatrix:s});return t("mod",{"number, number":function(e,t){return 0===t?e:e-t*c(e/t)},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(c(e.div(t))))},"bigint, bigint":function(e,t){if(0n===t)return e;if(e<0){const n=e%t;return 0n===n?n:n+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},fa({typed:t,matrix:i,concat:u})({SS:p,DS:f,SD:l,Ss:m,sS:h}))})),ma=he("matAlgo01xDSid",["typed"],(e=>{let{typed:t}=e;return function(e,n,r,i){const o=e._data,a=e._size,s=e._datatype||e.getDataType(),u=n._values,c=n._index,l=n._ptr,f=n._size,p=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(a.length!==f.length)throw new xr(a.length,f.length);if(a[0]!==f[0]||a[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");const m=a[0],h=a[1],d="string"==typeof s&&"mixed"!==s&&s===p?s:void 0,g=d?t.find(r,[d,d]):r;let y,x;const b=[];for(y=0;y{let{typed:t,equalScalar:n}=e;return function(e,r,i){const o=e._values,a=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),l=r._values,f=r._index,p=r._ptr,m=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(u.length!==m.length)throw new xr(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");const d=u[0],g=u[1];let y,x=n,b=0,v=i;"string"==typeof c&&c===h&&"mixed"!==c&&(y=c,x=t.find(n,[y,y]),b=t.convert(0,y),v=t.find(i,[y,y]));const w=o&&l?[]:void 0,N=[],E=[],A=o&&l?[]:void 0,S=o&&l?[]:void 0,M=[],C=[];let T,B,D,F,O;for(B=0;B{let{typed:t,DenseMatrix:n}=e;return function(e,r,i,o){const a=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!a)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");const f=c[0],p=c[1];let m,h=i;"string"==typeof l&&(m=l,r=t.convert(r,m),h=t.find(i,[m,m]));const d=[],g=[],y=[];for(let e=0;eArray.isArray(e)))}const va=he("gcd",["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],(e=>{let{typed:t,matrix:n,config:r,round:i,equalScalar:o,zeros:a,BigNumber:s,DenseMatrix:u,concat:c}=e;const l=pa({typed:t,config:r,round:i,matrix:n,equalScalar:o,zeros:a,DenseMatrix:u,concat:c}),f=ma({typed:t}),p=ha({typed:t,equalScalar:o}),m=da({typed:t,DenseMatrix:u});return t("gcd",{"number, number":function(e,t){if(!ye(e)||!ye(t))throw new Error("Parameters in function gcd must be integer numbers");let n;for(;0!==t;)n=l(e,t),e=t,t=n;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");const n=new s(0);for(;!t.isZero();){const n=l(e,t);e=t,t=n}return e.lt(n)?e.neg():e},"Fraction, Fraction":(e,t)=>e.gcd(t)},fa({typed:t,matrix:n,concat:c})({SS:p,DS:f,Ss:m}),{[xa]:t.referToSelf((e=>(t,n,r)=>{let i=e(t,n);for(let t=0;tt=>{if(1===t.length&&Array.isArray(t[0])&&ba(t[0]))return e(...t[0]);if(ba(t))return e(...t);throw new ga("gcd() supports only 1d matrices!")})),Matrix:t.referToSelf((e=>t=>e(t.toArray())))})})),wa=he("matAlgo06xS0S0",["typed","equalScalar"],(e=>{let{typed:t,equalScalar:n}=e;return function(e,r,i){const o=e._values,a=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=r._values,c=r._size,l=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(a.length!==c.length)throw new xr(a.length,c.length);if(a[0]!==c[0]||a[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+a+") must match Matrix B ("+c+")");const f=a[0],p=a[1];let m,h=n,d=0,g=i;"string"==typeof s&&s===l&&"mixed"!==s&&(m=s,h=t.find(n,[m,m]),d=t.convert(0,m),g=t.find(i,[m,m]));const y=o&&u?[]:void 0,x=[],b=[],v=y?[]:void 0,w=[],N=[];for(let t=0;t
'+this.items.map((function(t){return t.toHTML(e)})).join(',')+']'}_toTex(e){return function t(n,r){const i=n.some(L)&&!n.every(L),o=r||i,a=o?"&":"\\\\",s=n.map((function(n){return n.items?t(n.items,!r):n.toTex(e)})).join(a);return i||!o||o&&!r?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}(this.items,!1)}}return _p(n,"name",qp),n}),{isClass:!0,isNode:!0}),jp=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Up(e,t){if(!t||"auto"!==t)return e;let n=e;for(;ee(n);)n=n.content;return n}function Lp(e,t,n,r){let i=e;"keep"!==t&&(i=e.getContent());const o=i.getIdentifier();let a=null;for(let e=0;e{let{subset:t,matrix:n,Node:r}=e;const a=zp({subset:t}),s=function(e){let{subset:t,matrix:n}=e;return function(e,r,i){try{if(Array.isArray(e))return n(e).subset(r,i).valueOf().forEach(((t,n)=>{e[n]=t})),e;if(e&&"function"==typeof e.subset)return e.subset(r,i);if("string"==typeof e)return t(e,r,i);if("object"==typeof e){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return o(e,r.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw Ip(e)}}}({subset:t,matrix:n});function u(e,t,n){t||(t="keep");const r=Lp(e,t,n),i=Lp(e.value,t,n);return"all"===t||null!==i&&i<=r}class c extends r{constructor(e,t,n){if(super(),this.object=e,this.index=n?t:null,this.value=n||t,!re(e)&&!U(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(re(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!J(this.index))throw new TypeError('IndexNode expected as "index"');if(!X(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Gp}get isAssignmentNode(){return!0}_compile(e,t){const n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,u=this.value._compile(e,t),c=this.object.name;if(this.index){if(this.index.isObjectProperty()){const e=this.index.getObjectProperty();return function(t,r,i){const a=n(t,r,i),s=u(t,r,i);return o(a,e,s),s}}if(re(this.object))return function(e,t,i){const o=n(e,t,i),a=u(e,t,i),l=r(e,t,o);return e.set(c,s(o,l,a)),a};{const n=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){const e=this.object.index.getObjectProperty();return function(t,a,c){const l=n(t,a,c),f=i(l,e),p=r(t,a,f),m=u(t,a,c);return o(l,e,s(f,p,m)),m}}{const i=this.object.index._compile(e,t);return function(e,t,o){const c=n(e,t,o),l=i(e,t,c),f=a(c,l),p=r(e,t,f),m=u(e,t,o);return s(c,l,s(f,p,m)),m}}}}if(!re(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){const r=u(e,t,n);return e.set(c,r),r}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){const t=this._ifNode(e(this.object,"object",this)),n=this.index?this._ifNode(e(this.index,"index",this)):null,r=this._ifNode(e(this.value,"value",this));return new c(t,n,r)}clone(){return new c(this.object,this.index,this.value)}_toString(e){const t=this.object.toString(e),n=this.index?this.index.toString(e):"";let r=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(r="("+r+")"),t+n+" = "+r}toJSON(){return{mathjs:Gp,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new c(e.object,e.index,e.value)}_toHTML(e){const t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"";let r=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(r='('+r+')'),t+n+'='+r}_toTex(e){const t=this.object.toTex(e),n=this.index?this.index.toTex(e):"";let r=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(r=`\\left(${r}\\right)`),t+n+"="+r}}return _p(c,"name",Gp),c}),{isClass:!0,isNode:!0}),Zp="BlockNode",Wp=he(Zp,["ResultSet","Node"],(e=>{let{ResultSet:t,Node:n}=e;class r extends n{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){const t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!X(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}get type(){return Zp}get isBlockNode(){return!0}_compile(e,n){const r=kr(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,i){const o=[];return Rr(r,(function(t){const r=t.evaluate(e,n,i);t.visible&&o.push(r)})),new t(o)}}forEach(e){for(let t=0;t; {let{abs:t,divideScalar:n,multiply:r,subtract:i,larger:o,largerEq:a,SparseMatrix:s}=e;const u=Gm({divideScalar:n,multiply:r,subtract:i});return function(e,i,c){if(!e)return null;const l=e._size[1];let f,p=100,m=100;i&&(f=i.q,p=i.lnz||p,m=i.unz||m);const h=[],d=[],g=[],y=new s({values:h,index:d,ptr:g,size:[l,l]}),x=[],b=[],v=[],w=new s({values:x,index:b,ptr:v,size:[l,l]}),N=[];let E,A;const S=[],M=[];for(E=0;E {let{typed:t,abs:n,add:r,multiply:i,map:o,sqrt:a,subtract:s,inv:u,size:c,max:l,identity:f}=e;const p=1e-6;function m(e){let t,o=0,a=e,m=f(c(e));do{const e=a;if(a=i(.5,r(e,u(m))),m=i(.5,r(m,u(e))),t=l(n(s(a,e))),t>p&&++o>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>p);return a}return t(dh,{"Array | Matrix":function(e){const t=E(e)?e.size():vr(e);switch(t.length){case 1:if(1===t[0])return o(e,a);throw new RangeError("Matrix must be square (size: "+pr(t)+")");case 2:if(t[0]===t[1])return m(e);throw new RangeError("Matrix must be square (size: "+pr(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+pr(t)+")")}}})})),yh="sylvester",xh=he(yh,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],(e=>{let{typed:t,schur:n,matrixFromColumns:r,matrix:i,multiply:o,range:a,concat:s,transpose:u,index:c,subset:l,add:f,subtract:p,identity:m,lusolve:h,abs:d}=e;return t(yh,{"Matrix, Matrix, Matrix":g,"Array, Matrix, Matrix":function(e,t,n){return g(i(e),t,n)},"Array, Array, Matrix":function(e,t,n){return g(i(e),i(t),n)},"Array, Matrix, Array":function(e,t,n){return g(i(e),t,i(n))},"Matrix, Array, Matrix":function(e,t,n){return g(e,i(t),n)},"Matrix, Array, Array":function(e,t,n){return g(e,i(t),i(n))},"Matrix, Matrix, Array":function(e,t,n){return g(e,t,i(n))},"Array, Array, Array":function(e,t,n){return g(i(e),i(t),i(n)).toArray()}});function g(e,t,g){const y=t.size()[0],x=e.size()[0],b=n(e),v=b.T,w=b.U,N=n(o(-1,t)),E=N.T,A=N.U,S=o(o(u(w),g),A),M=a(0,x),C=[],T=(e,t)=>s(e,t,1),B=(e,t)=>s(e,t,0);for(let e=0;e
')\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n return this.blocks.map(function (param) {\n return param.node.toTex(options) + (param.visible ? '' : ';')\n }).join('\\\\;\\\\;\\n')\n }\n }\n\n return BlockNode\n}, { isClass: true, isNode: true })\n","import { isBigNumber, isComplex, isNode, isUnit, typeOf } from '../../utils/is.js'\nimport { factory } from '../../utils/factory.js'\nimport { getPrecedence } from '../operators.js'\n\nconst name = 'ConditionalNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createConditionalNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n /**\n * Test whether a condition is met\n * @param {*} condition\n * @returns {boolean} true if condition is true or non-zero, else false\n */\n function testCondition (condition) {\n if (typeof condition === 'number' ||\n typeof condition === 'boolean' ||\n typeof condition === 'string') {\n return !!condition\n }\n\n if (condition) {\n if (isBigNumber(condition)) {\n return !condition.isZero()\n }\n\n if (isComplex(condition)) {\n return !!((condition.re || condition.im))\n }\n\n if (isUnit(condition)) {\n return !!condition.value\n }\n }\n\n if (condition === null || condition === undefined) {\n return false\n }\n\n throw new TypeError('Unsupported type of condition \"' + typeOf(condition) + '\"')\n }\n\n class ConditionalNode extends Node {\n /**\n * A lazy evaluating conditional operator: 'condition ? trueExpr : falseExpr'\n *\n * @param {Node} condition Condition, must result in a boolean\n * @param {Node} trueExpr Expression evaluated when condition is true\n * @param {Node} falseExpr Expression evaluated when condition is true\n *\n * @constructor ConditionalNode\n * @extends {Node}\n */\n constructor (condition, trueExpr, falseExpr) {\n super()\n if (!isNode(condition)) { throw new TypeError('Parameter condition must be a Node') }\n if (!isNode(trueExpr)) { throw new TypeError('Parameter trueExpr must be a Node') }\n if (!isNode(falseExpr)) { throw new TypeError('Parameter falseExpr must be a Node') }\n\n this.condition = condition\n this.trueExpr = trueExpr\n this.falseExpr = falseExpr\n }\n\n static name = name\n get type () { return name }\n get isConditionalNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const evalCondition = this.condition._compile(math, argNames)\n const evalTrueExpr = this.trueExpr._compile(math, argNames)\n const evalFalseExpr = this.falseExpr._compile(math, argNames)\n\n return function evalConditionalNode (scope, args, context) {\n return testCondition(evalCondition(scope, args, context))\n ? evalTrueExpr(scope, args, context)\n : evalFalseExpr(scope, args, context)\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.condition, 'condition', this)\n callback(this.trueExpr, 'trueExpr', this)\n callback(this.falseExpr, 'falseExpr', this)\n }\n\n /**\n * Create a new ConditionalNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {ConditionalNode} Returns a transformed copy of the node\n */\n map (callback) {\n return new ConditionalNode(\n this._ifNode(callback(this.condition, 'condition', this)),\n this._ifNode(callback(this.trueExpr, 'trueExpr', this)),\n this._ifNode(callback(this.falseExpr, 'falseExpr', this))\n )\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConditionalNode}\n */\n clone () {\n return new ConditionalNode(this.condition, this.trueExpr, this.falseExpr)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n let condition = this.condition.toString(options)\n const conditionPrecedence =\n getPrecedence(this.condition, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.condition.type === 'OperatorNode') ||\n ((conditionPrecedence !== null) &&\n (conditionPrecedence <= precedence))) {\n condition = '(' + condition + ')'\n }\n\n let trueExpr = this.trueExpr.toString(options)\n const truePrecedence =\n getPrecedence(this.trueExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.trueExpr.type === 'OperatorNode') ||\n ((truePrecedence !== null) && (truePrecedence <= precedence))) {\n trueExpr = '(' + trueExpr + ')'\n }\n\n let falseExpr = this.falseExpr.toString(options)\n const falsePrecedence =\n getPrecedence(this.falseExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.falseExpr.type === 'OperatorNode') ||\n ((falsePrecedence !== null) && (falsePrecedence <= precedence))) {\n falseExpr = '(' + falseExpr + ')'\n }\n return condition + ' ? ' + trueExpr + ' : ' + falseExpr\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n condition: this.condition,\n trueExpr: this.trueExpr,\n falseExpr: this.falseExpr\n }\n }\n\n /**\n * Instantiate an ConditionalNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"ConditionalNode\",\n * \"condition\": ...,\n * \"trueExpr\": ...,\n * \"falseExpr\": ...}\n * ```\n * where mathjs is optional\n * @returns {ConditionalNode}\n */\n static fromJSON (json) {\n return new ConditionalNode(json.condition, json.trueExpr, json.falseExpr)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n const precedence =\n getPrecedence(this, parenthesis, options && options.implicit)\n\n // Enclose Arguments in parentheses if they are an OperatorNode\n // or have lower or equal precedence\n // NOTE: enclosing all OperatorNodes in parentheses is a decision\n // purely based on aesthetics and readability\n let condition = this.condition.toHTML(options)\n const conditionPrecedence =\n getPrecedence(this.condition, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.condition.type === 'OperatorNode') ||\n ((conditionPrecedence !== null) &&\n (conditionPrecedence <= precedence))) {\n condition =\n '(' +\n condition +\n ')'\n }\n\n let trueExpr = this.trueExpr.toHTML(options)\n const truePrecedence =\n getPrecedence(this.trueExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.trueExpr.type === 'OperatorNode') ||\n ((truePrecedence !== null) && (truePrecedence <= precedence))) {\n trueExpr =\n '(' +\n trueExpr +\n ')'\n }\n\n let falseExpr = this.falseExpr.toHTML(options)\n const falsePrecedence =\n getPrecedence(this.falseExpr, parenthesis, options && options.implicit)\n if ((parenthesis === 'all') ||\n (this.falseExpr.type === 'OperatorNode') ||\n ((falsePrecedence !== null) && (falsePrecedence <= precedence))) {\n falseExpr =\n '(' +\n falseExpr +\n ')'\n }\n return condition +\n '?' +\n trueExpr +\n ':' +\n falseExpr\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n return '\\\\begin{cases} {' +\n this.trueExpr.toTex(options) + '}, &\\\\quad{\\\\text{if }\\\\;' +\n this.condition.toTex(options) +\n '}\\\\\\\\{' + this.falseExpr.toTex(options) +\n '}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}'\n }\n }\n\n return ConditionalNode\n}, { isClass: true, isNode: true })\n","/* eslint no-template-curly-in-string: \"off\" */\n\nimport escapeLatexLib from 'escape-latex'\nimport { hasOwnProperty } from './object.js'\n\nexport const latexSymbols = {\n // GREEK LETTERS\n Alpha: 'A',\n alpha: '\\\\alpha',\n Beta: 'B',\n beta: '\\\\beta',\n Gamma: '\\\\Gamma',\n gamma: '\\\\gamma',\n Delta: '\\\\Delta',\n delta: '\\\\delta',\n Epsilon: 'E',\n epsilon: '\\\\epsilon',\n varepsilon: '\\\\varepsilon',\n Zeta: 'Z',\n zeta: '\\\\zeta',\n Eta: 'H',\n eta: '\\\\eta',\n Theta: '\\\\Theta',\n theta: '\\\\theta',\n vartheta: '\\\\vartheta',\n Iota: 'I',\n iota: '\\\\iota',\n Kappa: 'K',\n kappa: '\\\\kappa',\n varkappa: '\\\\varkappa',\n Lambda: '\\\\Lambda',\n lambda: '\\\\lambda',\n Mu: 'M',\n mu: '\\\\mu',\n Nu: 'N',\n nu: '\\\\nu',\n Xi: '\\\\Xi',\n xi: '\\\\xi',\n Omicron: 'O',\n omicron: 'o',\n Pi: '\\\\Pi',\n pi: '\\\\pi',\n varpi: '\\\\varpi',\n Rho: 'P',\n rho: '\\\\rho',\n varrho: '\\\\varrho',\n Sigma: '\\\\Sigma',\n sigma: '\\\\sigma',\n varsigma: '\\\\varsigma',\n Tau: 'T',\n tau: '\\\\tau',\n Upsilon: '\\\\Upsilon',\n upsilon: '\\\\upsilon',\n Phi: '\\\\Phi',\n phi: '\\\\phi',\n varphi: '\\\\varphi',\n Chi: 'X',\n chi: '\\\\chi',\n Psi: '\\\\Psi',\n psi: '\\\\psi',\n Omega: '\\\\Omega',\n omega: '\\\\omega',\n // logic\n true: '\\\\mathrm{True}',\n false: '\\\\mathrm{False}',\n // other\n i: 'i', // TODO use \\i ??\n inf: '\\\\infty',\n Inf: '\\\\infty',\n infinity: '\\\\infty',\n Infinity: '\\\\infty',\n oo: '\\\\infty',\n lim: '\\\\lim',\n undefined: '\\\\mathbf{?}'\n}\n\nexport const latexOperators = {\n transpose: '^\\\\top',\n ctranspose: '^H',\n factorial: '!',\n pow: '^',\n dotPow: '.^\\\\wedge', // TODO find ideal solution\n unaryPlus: '+',\n unaryMinus: '-',\n bitNot: '\\\\~', // TODO find ideal solution\n not: '\\\\neg',\n multiply: '\\\\cdot',\n divide: '\\\\frac', // TODO how to handle that properly?\n dotMultiply: '.\\\\cdot', // TODO find ideal solution\n dotDivide: '.:', // TODO find ideal solution\n mod: '\\\\mod',\n add: '+',\n subtract: '-',\n to: '\\\\rightarrow',\n leftShift: '<<',\n rightArithShift: '>>',\n rightLogShift: '>>>',\n equal: '=',\n unequal: '\\\\neq',\n smaller: '<',\n larger: '>',\n smallerEq: '\\\\leq',\n largerEq: '\\\\geq',\n bitAnd: '\\\\&',\n bitXor: '\\\\underline{|}',\n bitOr: '|',\n and: '\\\\wedge',\n xor: '\\\\veebar',\n or: '\\\\vee'\n}\n\nexport const latexFunctions = {\n // arithmetic\n abs: { 1: '\\\\left|${args[0]}\\\\right|' },\n add: { 2: `\\\\left(\\${args[0]}${latexOperators.add}\\${args[1]}\\\\right)` },\n cbrt: { 1: '\\\\sqrt[3]{${args[0]}}' },\n ceil: { 1: '\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil' },\n cube: { 1: '\\\\left(${args[0]}\\\\right)^3' },\n divide: { 2: '\\\\frac{${args[0]}}{${args[1]}}' },\n dotDivide: { 2: `\\\\left(\\${args[0]}${latexOperators.dotDivide}\\${args[1]}\\\\right)` },\n dotMultiply: { 2: `\\\\left(\\${args[0]}${latexOperators.dotMultiply}\\${args[1]}\\\\right)` },\n dotPow: { 2: `\\\\left(\\${args[0]}${latexOperators.dotPow}\\${args[1]}\\\\right)` },\n exp: { 1: '\\\\exp\\\\left(${args[0]}\\\\right)' },\n expm1: `\\\\left(e${latexOperators.pow}{\\${args[0]}}-1\\\\right)`,\n fix: { 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)' },\n floor: { 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor' },\n fraction: { 2: '\\\\frac{${args[0]}}{${args[1]}}' },\n gcd: '\\\\gcd\\\\left(${args}\\\\right)',\n hypot: '\\\\hypot\\\\left(${args}\\\\right)',\n log: {\n 1: '\\\\ln\\\\left(${args[0]}\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)'\n },\n log10: { 1: '\\\\log_{10}\\\\left(${args[0]}\\\\right)' },\n log1p: {\n 1: '\\\\ln\\\\left(${args[0]}+1\\\\right)',\n 2: '\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)'\n },\n log2: '\\\\log_{2}\\\\left(${args[0]}\\\\right)',\n mod: { 2: `\\\\left(\\${args[0]}${latexOperators.mod}\\${args[1]}\\\\right)` },\n multiply: { 2: `\\\\left(\\${args[0]}${latexOperators.multiply}\\${args[1]}\\\\right)` },\n norm: {\n 1: '\\\\left\\\\|${args[0]}\\\\right\\\\|',\n 2: undefined // use default template\n },\n nthRoot: { 2: '\\\\sqrt[${args[1]}]{${args[0]}}' },\n nthRoots: { 2: '\\\\{y : y^${args[1]} = {${args[0]}}\\\\}' },\n pow: { 2: `\\\\left(\\${args[0]}\\\\right)${latexOperators.pow}{\\${args[1]}}` },\n round: {\n 1: '\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil',\n 2: undefined // use default template\n },\n sign: { 1: '\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)' },\n sqrt: { 1: '\\\\sqrt{${args[0]}}' },\n square: { 1: '\\\\left(${args[0]}\\\\right)^2' },\n subtract: { 2: `\\\\left(\\${args[0]}${latexOperators.subtract}\\${args[1]}\\\\right)` },\n unaryMinus: { 1: `${latexOperators.unaryMinus}\\\\left(\\${args[0]}\\\\right)` },\n unaryPlus: { 1: `${latexOperators.unaryPlus}\\\\left(\\${args[0]}\\\\right)` },\n\n // bitwise\n bitAnd: { 2: `\\\\left(\\${args[0]}${latexOperators.bitAnd}\\${args[1]}\\\\right)` },\n bitNot: { 1: latexOperators.bitNot + '\\\\left(${args[0]}\\\\right)' },\n bitOr: { 2: `\\\\left(\\${args[0]}${latexOperators.bitOr}\\${args[1]}\\\\right)` },\n bitXor: { 2: `\\\\left(\\${args[0]}${latexOperators.bitXor}\\${args[1]}\\\\right)` },\n leftShift: { 2: `\\\\left(\\${args[0]}${latexOperators.leftShift}\\${args[1]}\\\\right)` },\n rightArithShift: { 2: `\\\\left(\\${args[0]}${latexOperators.rightArithShift}\\${args[1]}\\\\right)` },\n rightLogShift: { 2: `\\\\left(\\${args[0]}${latexOperators.rightLogShift}\\${args[1]}\\\\right)` },\n\n // combinatorics\n bellNumbers: { 1: '\\\\mathrm{B}_{${args[0]}}' },\n catalan: { 1: '\\\\mathrm{C}_{${args[0]}}' },\n stirlingS2: { 2: '\\\\mathrm{S}\\\\left(${args}\\\\right)' },\n\n // complex\n arg: { 1: '\\\\arg\\\\left(${args[0]}\\\\right)' },\n conj: { 1: '\\\\left(${args[0]}\\\\right)^*' },\n im: { 1: '\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace' },\n re: { 1: '\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace' },\n\n // logical\n and: { 2: `\\\\left(\\${args[0]}${latexOperators.and}\\${args[1]}\\\\right)` },\n not: { 1: latexOperators.not + '\\\\left(${args[0]}\\\\right)' },\n or: { 2: `\\\\left(\\${args[0]}${latexOperators.or}\\${args[1]}\\\\right)` },\n xor: { 2: `\\\\left(\\${args[0]}${latexOperators.xor}\\${args[1]}\\\\right)` },\n\n // matrix\n cross: { 2: '\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)' },\n ctranspose: { 1: `\\\\left(\\${args[0]}\\\\right)${latexOperators.ctranspose}` },\n det: { 1: '\\\\det\\\\left(${args[0]}\\\\right)' },\n dot: { 2: '\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)' },\n expm: { 1: '\\\\exp\\\\left(${args[0]}\\\\right)' },\n inv: { 1: '\\\\left(${args[0]}\\\\right)^{-1}' },\n pinv: { 1: '\\\\left(${args[0]}\\\\right)^{+}' },\n sqrtm: { 1: `{\\${args[0]}}${latexOperators.pow}{\\\\frac{1}{2}}` },\n trace: { 1: '\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)' },\n transpose: { 1: `\\\\left(\\${args[0]}\\\\right)${latexOperators.transpose}` },\n\n // probability\n combinations: { 2: '\\\\binom{${args[0]}}{${args[1]}}' },\n combinationsWithRep: { 2: '\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)' },\n factorial: { 1: `\\\\left(\\${args[0]}\\\\right)${latexOperators.factorial}` },\n gamma: { 1: '\\\\Gamma\\\\left(${args[0]}\\\\right)' },\n lgamma: { 1: '\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)' },\n\n // relational\n equal: { 2: `\\\\left(\\${args[0]}${latexOperators.equal}\\${args[1]}\\\\right)` },\n larger: { 2: `\\\\left(\\${args[0]}${latexOperators.larger}\\${args[1]}\\\\right)` },\n largerEq: { 2: `\\\\left(\\${args[0]}${latexOperators.largerEq}\\${args[1]}\\\\right)` },\n smaller: { 2: `\\\\left(\\${args[0]}${latexOperators.smaller}\\${args[1]}\\\\right)` },\n smallerEq: { 2: `\\\\left(\\${args[0]}${latexOperators.smallerEq}\\${args[1]}\\\\right)` },\n unequal: { 2: `\\\\left(\\${args[0]}${latexOperators.unequal}\\${args[1]}\\\\right)` },\n\n // special\n erf: { 1: 'erf\\\\left(${args[0]}\\\\right)' },\n\n // statistics\n max: '\\\\max\\\\left(${args}\\\\right)',\n min: '\\\\min\\\\left(${args}\\\\right)',\n variance: '\\\\mathrm{Var}\\\\left(${args}\\\\right)',\n\n // trigonometry\n acos: { 1: '\\\\cos^{-1}\\\\left(${args[0]}\\\\right)' },\n acosh: { 1: '\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)' },\n acot: { 1: '\\\\cot^{-1}\\\\left(${args[0]}\\\\right)' },\n acoth: { 1: '\\\\coth^{-1}\\\\left(${args[0]}\\\\right)' },\n acsc: { 1: '\\\\csc^{-1}\\\\left(${args[0]}\\\\right)' },\n acsch: { 1: '\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)' },\n asec: { 1: '\\\\sec^{-1}\\\\left(${args[0]}\\\\right)' },\n asech: { 1: '\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)' },\n asin: { 1: '\\\\sin^{-1}\\\\left(${args[0]}\\\\right)' },\n asinh: { 1: '\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)' },\n atan: { 1: '\\\\tan^{-1}\\\\left(${args[0]}\\\\right)' },\n atan2: { 2: '\\\\mathrm{atan2}\\\\left(${args}\\\\right)' },\n atanh: { 1: '\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)' },\n cos: { 1: '\\\\cos\\\\left(${args[0]}\\\\right)' },\n cosh: { 1: '\\\\cosh\\\\left(${args[0]}\\\\right)' },\n cot: { 1: '\\\\cot\\\\left(${args[0]}\\\\right)' },\n coth: { 1: '\\\\coth\\\\left(${args[0]}\\\\right)' },\n csc: { 1: '\\\\csc\\\\left(${args[0]}\\\\right)' },\n csch: { 1: '\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)' },\n sec: { 1: '\\\\sec\\\\left(${args[0]}\\\\right)' },\n sech: { 1: '\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)' },\n sin: { 1: '\\\\sin\\\\left(${args[0]}\\\\right)' },\n sinh: { 1: '\\\\sinh\\\\left(${args[0]}\\\\right)' },\n tan: { 1: '\\\\tan\\\\left(${args[0]}\\\\right)' },\n tanh: { 1: '\\\\tanh\\\\left(${args[0]}\\\\right)' },\n\n // unit\n to: { 2: `\\\\left(\\${args[0]}${latexOperators.to}\\${args[1]}\\\\right)` },\n\n // utils\n numeric: function (node, options) {\n // Not sure if this is strictly right but should work correctly for the vast majority of use cases.\n return node.args[0].toTex()\n },\n\n // type\n number: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n },\n string: {\n 0: '\\\\mathtt{\"\"}',\n 1: '\\\\mathrm{string}\\\\left(${args[0]}\\\\right)'\n },\n bignumber: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n bigint: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n complex: {\n 0: '0',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: `\\\\left(\\\\left(\\${args[0]}\\\\right)+${latexSymbols.i}\\\\cdot\\\\left(\\${args[1]}\\\\right)\\\\right)`\n },\n matrix: {\n 0: '\\\\begin{bmatrix}\\\\end{bmatrix}',\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(${args[0]}\\\\right)'\n },\n sparse: {\n 0: '\\\\begin{bsparse}\\\\end{bsparse}',\n 1: '\\\\left(${args[0]}\\\\right)'\n },\n unit: {\n 1: '\\\\left(${args[0]}\\\\right)',\n 2: '\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)'\n }\n\n}\n\nexport const defaultTemplate = '\\\\mathrm{${name}}\\\\left(${args}\\\\right)'\n\nconst latexUnits = {\n deg: '^\\\\circ'\n}\n\nexport function escapeLatex (string) {\n return escapeLatexLib(string, { preserveFormatting: true })\n}\n\n// @param {string} name\n// @param {boolean} isUnit\nexport function toSymbol (name, isUnit) {\n isUnit = typeof isUnit === 'undefined' ? false : isUnit\n if (isUnit) {\n if (hasOwnProperty(latexUnits, name)) {\n return latexUnits[name]\n }\n\n return '\\\\mathrm{' + escapeLatex(name) + '}'\n }\n\n if (hasOwnProperty(latexSymbols, name)) {\n return latexSymbols[name]\n }\n\n return escapeLatex(name)\n}\n","import { format } from '../../utils/string.js'\nimport { typeOf } from '../../utils/is.js'\nimport { escapeLatex } from '../../utils/latex.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'ConstantNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createConstantNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n class ConstantNode extends Node {\n /**\n * A ConstantNode holds a constant value like a number or string.\n *\n * Usage:\n *\n * new ConstantNode(2.3)\n * new ConstantNode('hello')\n *\n * @param {*} value Value can be any type (number, BigNumber, bigint, string, ...)\n * @constructor ConstantNode\n * @extends {Node}\n */\n constructor (value) {\n super()\n this.value = value\n }\n\n static name = name\n get type () { return name }\n get isConstantNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const value = this.value\n\n return function evalConstantNode () {\n return value\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n // nothing to do, we don't have any children\n }\n\n /**\n * Create a new ConstantNode with children produced by the given callback.\n * Trivial because there are no children.\n * @param {function(child: Node, path: string, parent: Node) : Node} callback\n * @returns {ConstantNode} Returns a clone of the node\n */\n map (callback) {\n return this.clone()\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {ConstantNode}\n */\n clone () {\n return new ConstantNode(this.value)\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n return format(this.value, options)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const value = this._toString(options)\n\n switch (typeOf(this.value)) {\n case 'number':\n case 'bigint':\n case 'BigNumber':\n case 'Fraction':\n return '' + value + ''\n case 'string':\n return '' + value + ''\n case 'boolean':\n return '' + value + ''\n case 'null':\n return '' + value + ''\n case 'undefined':\n return '' + value + ''\n\n default:\n return '' + value + ''\n }\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return { mathjs: name, value: this.value }\n }\n\n /**\n * Instantiate a ConstantNode from its JSON representation\n * @param {Object} json An object structured like\n * `{\"mathjs\": \"SymbolNode\", value: 2.3}`,\n * where mathjs is optional\n * @returns {ConstantNode}\n */\n static fromJSON (json) {\n return new ConstantNode(json.value)\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const value = this._toString(options)\n const type = typeOf(this.value)\n\n switch (type) {\n case 'string':\n return '\\\\mathtt{' + escapeLatex(value) + '}'\n\n case 'number':\n case 'BigNumber': {\n const finite = type === 'BigNumber' ? this.value.isFinite() : isFinite(this.value)\n if (!finite) {\n return (this.value.valueOf() < 0)\n ? '-\\\\infty'\n : '\\\\infty'\n }\n\n const index = value.toLowerCase().indexOf('e')\n if (index !== -1) {\n return value.substring(0, index) + '\\\\cdot10^{' +\n value.substring(index + 1) + '}'\n }\n\n return value\n }\n\n case 'bigint': {\n return value.toString()\n }\n\n case 'Fraction':\n return this.value.toLatex()\n\n default:\n return value\n }\n }\n }\n\n return ConstantNode\n}, { isClass: true, isNode: true })\n","import { isNode } from '../../utils/is.js'\n\nimport { keywords } from '../keywords.js'\nimport { escape } from '../../utils/string.js'\nimport { forEach, join } from '../../utils/array.js'\nimport { toSymbol } from '../../utils/latex.js'\nimport { getPrecedence } from '../operators.js'\nimport { factory } from '../../utils/factory.js'\n\nconst name = 'FunctionAssignmentNode'\nconst dependencies = [\n 'typed',\n 'Node'\n]\n\nexport const createFunctionAssignmentNode = /* #__PURE__ */ factory(name, dependencies, ({ typed, Node }) => {\n /**\n * Is parenthesis needed?\n * @param {Node} node\n * @param {Object} parenthesis\n * @param {string} implicit\n * @private\n */\n function needParenthesis (node, parenthesis, implicit) {\n const precedence = getPrecedence(node, parenthesis, implicit)\n const exprPrecedence = getPrecedence(node.expr, parenthesis, implicit)\n\n return (parenthesis === 'all') ||\n ((exprPrecedence !== null) && (exprPrecedence <= precedence))\n }\n\n class FunctionAssignmentNode extends Node {\n /**\n * @constructor FunctionAssignmentNode\n * @extends {Node}\n * Function assignment\n *\n * @param {string} name Function name\n * @param {string[] | Array.<{name: string, type: string}>} params\n * Array with function parameter names, or an\n * array with objects containing the name\n * and type of the parameter\n * @param {Node} expr The function expression\n */\n constructor (name, params, expr) {\n super()\n // validate input\n if (typeof name !== 'string') { throw new TypeError('String expected for parameter \"name\"') }\n if (!Array.isArray(params)) {\n throw new TypeError(\n 'Array containing strings or objects expected for parameter \"params\"')\n }\n if (!isNode(expr)) { throw new TypeError('Node expected for parameter \"expr\"') }\n if (keywords.has(name)) { throw new Error('Illegal function name, \"' + name + '\" is a reserved keyword') }\n\n const paramNames = new Set()\n for (const param of params) {\n const name = typeof param === 'string' ? param : param.name\n if (paramNames.has(name)) {\n throw new Error(`Duplicate parameter name \"${name}\"`)\n } else {\n paramNames.add(name)\n }\n }\n\n this.name = name\n this.params = params.map(function (param) {\n return (param && param.name) || param\n })\n this.types = params.map(function (param) {\n return (param && param.type) || 'any'\n })\n this.expr = expr\n }\n\n static name = name\n get type () { return name }\n get isFunctionAssignmentNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n const childArgNames = Object.create(argNames)\n forEach(this.params, function (param) {\n childArgNames[param] = true\n })\n\n // compile the function expression with the child args\n const evalExpr = this.expr._compile(math, childArgNames)\n const name = this.name\n const params = this.params\n const signature = join(this.types, ',')\n const syntax = name + '(' + join(this.params, ', ') + ')'\n\n return function evalFunctionAssignmentNode (scope, args, context) {\n const signatures = {}\n signatures[signature] = function () {\n const childArgs = Object.create(args)\n\n for (let i = 0; i < params.length; i++) {\n childArgs[params[i]] = arguments[i]\n }\n\n return evalExpr(scope, childArgs, context)\n }\n const fn = typed(name, signatures)\n fn.syntax = syntax\n\n scope.set(name, fn)\n\n return fn\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n callback(this.expr, 'expr', this)\n }\n\n /**\n * Create a new FunctionAssignmentNode whose children are the results of\n * calling the provided callback function for each child of the original\n * node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {FunctionAssignmentNode} Returns a transformed copy of the node\n */\n map (callback) {\n const expr = this._ifNode(callback(this.expr, 'expr', this))\n\n return new FunctionAssignmentNode(this.name, this.params.slice(0), expr)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {FunctionAssignmentNode}\n */\n clone () {\n return new FunctionAssignmentNode(\n this.name, this.params.slice(0), this.expr)\n }\n\n /**\n * get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n let expr = this.expr.toString(options)\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' + expr + ')'\n }\n return this.name + '(' + this.params.join(', ') + ') = ' + expr\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n const types = this.types\n\n return {\n mathjs: name,\n name: this.name,\n params: this.params.map(function (param, index) {\n return {\n name: param,\n type: types[index]\n }\n }),\n expr: this.expr\n }\n }\n\n /**\n * Instantiate an FunctionAssignmentNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * ```\n * {\"mathjs\": \"FunctionAssignmentNode\",\n * name: ..., params: ..., expr: ...}\n * ```\n * where mathjs is optional\n * @returns {FunctionAssignmentNode}\n */\n static fromJSON (json) {\n return new FunctionAssignmentNode(json.name, json.params, json.expr)\n }\n\n /**\n * get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n const parenthesis = (options && options.parenthesis) ? options.parenthesis : 'keep'\n const params = []\n for (let i = 0; i < this.params.length; i++) {\n params.push('' +\n escape(this.params[i]) + '')\n }\n let expr = this.expr.toHTML(options)\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = '(' +\n expr +\n ')'\n }\n return '' +\n escape(this.name) + '' +\n '(' +\n params.join(',') +\n ')' +\n '=' +\n expr\n }\n\n /**\n * get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const parenthesis =\n (options && options.parenthesis) ? options.parenthesis : 'keep'\n let expr = this.expr.toTex(options)\n if (needParenthesis(this, parenthesis, options && options.implicit)) {\n expr = `\\\\left(${expr}\\\\right)`\n }\n\n return '\\\\mathrm{' + this.name +\n '}\\\\left(' + this.params.map(toSymbol).join(',') + '\\\\right)=' + expr\n }\n }\n\n return FunctionAssignmentNode\n}, { isClass: true, isNode: true })\n","import { map } from '../../utils/array.js'\nimport { getSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { isArray, isConstantNode, isMatrix, isNode, isString, typeOf } from '../../utils/is.js'\nimport { escape } from '../../utils/string.js'\n\nconst name = 'IndexNode'\nconst dependencies = [\n 'Node',\n 'size'\n]\n\nexport const createIndexNode = /* #__PURE__ */ factory(name, dependencies, ({ Node, size }) => {\n class IndexNode extends Node {\n /**\n * @constructor IndexNode\n * @extends Node\n *\n * Describes a subset of a matrix or an object property.\n * Cannot be used on its own, needs to be used within an AccessorNode or\n * AssignmentNode.\n *\n * @param {Node[]} dimensions\n * @param {boolean} [dotNotation=false]\n * Optional property describing whether this index was written using dot\n * notation like `a.b`, or using bracket notation like `a[\"b\"]`\n * (which is the default). This property is used for string conversion.\n */\n constructor (dimensions, dotNotation) {\n super()\n this.dimensions = dimensions\n this.dotNotation = dotNotation || false\n\n // validate input\n if (!Array.isArray(dimensions) || !dimensions.every(isNode)) {\n throw new TypeError(\n 'Array containing Nodes expected for parameter \"dimensions\"')\n }\n if (this.dotNotation && !this.isObjectProperty()) {\n throw new Error('dotNotation only applicable for object properties')\n }\n }\n\n static name = name\n get type () { return name }\n get isIndexNode () { return true }\n\n /**\n * Compile a node into a JavaScript function.\n * This basically pre-calculates as much as possible and only leaves open\n * calculations which depend on a dynamic scope with variables.\n * @param {Object} math Math.js namespace with functions and constants.\n * @param {Object} argNames An object with argument names as key and `true`\n * as value. Used in the SymbolNode to optimize\n * for arguments from user assigned functions\n * (see FunctionAssignmentNode) or special symbols\n * like `end` (see IndexNode).\n * @return {function} Returns a function which can be called like:\n * evalNode(scope: Object, args: Object, context: *)\n */\n _compile (math, argNames) {\n // TODO: implement support for bignumber (currently bignumbers are silently\n // reduced to numbers when changing the value to zero-based)\n\n // TODO: Optimization: when the range values are ConstantNodes,\n // we can beforehand resolve the zero-based value\n\n // optimization for a simple object property\n const evalDimensions = map(this.dimensions, function (dimension, i) {\n const needsEnd = dimension\n .filter(node => node.isSymbolNode && node.name === 'end')\n .length > 0\n\n if (needsEnd) {\n // SymbolNode 'end' is used inside the index,\n // like in `A[end]` or `A[end - 2]`\n const childArgNames = Object.create(argNames)\n childArgNames.end = true\n\n const _evalDimension = dimension._compile(math, childArgNames)\n\n return function evalDimension (scope, args, context) {\n if (!isMatrix(context) && !isArray(context) && !isString(context)) {\n throw new TypeError(\n 'Cannot resolve \"end\": ' +\n 'context must be a Matrix, Array, or string but is ' +\n typeOf(context))\n }\n\n const s = size(context).valueOf()\n const childArgs = Object.create(args)\n childArgs.end = s[i]\n\n return _evalDimension(scope, childArgs, context)\n }\n } else {\n // SymbolNode `end` not used\n return dimension._compile(math, argNames)\n }\n })\n\n const index = getSafeProperty(math, 'index')\n\n return function evalIndexNode (scope, args, context) {\n const dimensions = map(evalDimensions, function (evalDimension) {\n return evalDimension(scope, args, context)\n })\n\n return index(...dimensions)\n }\n }\n\n /**\n * Execute a callback for each of the child nodes of this node\n * @param {function(child: Node, path: string, parent: Node)} callback\n */\n forEach (callback) {\n for (let i = 0; i < this.dimensions.length; i++) {\n callback(this.dimensions[i], 'dimensions[' + i + ']', this)\n }\n }\n\n /**\n * Create a new IndexNode whose children are the results of calling\n * the provided callback function for each child of the original node.\n * @param {function(child: Node, path: string, parent: Node): Node} callback\n * @returns {IndexNode} Returns a transformed copy of the node\n */\n map (callback) {\n const dimensions = []\n for (let i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this._ifNode(\n callback(this.dimensions[i], 'dimensions[' + i + ']', this))\n }\n\n return new IndexNode(dimensions, this.dotNotation)\n }\n\n /**\n * Create a clone of this node, a shallow copy\n * @return {IndexNode}\n */\n clone () {\n return new IndexNode(this.dimensions.slice(0), this.dotNotation)\n }\n\n /**\n * Test whether this IndexNode contains a single property name\n * @return {boolean}\n */\n isObjectProperty () {\n return this.dimensions.length === 1 &&\n isConstantNode(this.dimensions[0]) &&\n typeof this.dimensions[0].value === 'string'\n }\n\n /**\n * Returns the property name if IndexNode contains a property.\n * If not, returns null.\n * @return {string | null}\n */\n getObjectProperty () {\n return this.isObjectProperty() ? this.dimensions[0].value : null\n }\n\n /**\n * Get string representation\n * @param {Object} options\n * @return {string} str\n */\n _toString (options) {\n // format the parameters like \"[1, 0:5]\"\n return this.dotNotation\n ? ('.' + this.getObjectProperty())\n : ('[' + this.dimensions.join(', ') + ']')\n }\n\n /**\n * Get a JSON representation of the node\n * @returns {Object}\n */\n toJSON () {\n return {\n mathjs: name,\n dimensions: this.dimensions,\n dotNotation: this.dotNotation\n }\n }\n\n /**\n * Instantiate an IndexNode from its JSON representation\n * @param {Object} json\n * An object structured like\n * `{\"mathjs\": \"IndexNode\", dimensions: [...], dotNotation: false}`,\n * where mathjs is optional\n * @returns {IndexNode}\n */\n static fromJSON (json) {\n return new IndexNode(json.dimensions, json.dotNotation)\n }\n\n /**\n * Get HTML representation\n * @param {Object} options\n * @return {string} str\n */\n _toHTML (options) {\n // format the parameters like \"[1, 0:5]\"\n const dimensions = []\n for (let i = 0; i < this.dimensions.length; i++) {\n dimensions[i] = this.dimensions[i].toHTML()\n }\n if (this.dotNotation) {\n return '.' +\n '' +\n escape(this.getObjectProperty()) + ''\n } else {\n return '[' +\n dimensions.join(',') +\n ']'\n }\n }\n\n /**\n * Get LaTeX representation\n * @param {Object} options\n * @return {string} str\n */\n _toTex (options) {\n const dimensions = this.dimensions.map(function (range) {\n return range.toTex(options)\n })\n\n return this.dotNotation\n ? ('.' + this.getObjectProperty() + '')\n : ('_{' + dimensions.join(',') + '}')\n }\n }\n\n return IndexNode\n}, { isClass: true, isNode: true })\n","import { getSafeProperty } from '../../utils/customs.js'\nimport { factory } from '../../utils/factory.js'\nimport { isNode } from '../../utils/is.js'\nimport { hasOwnProperty } from '../../utils/object.js'\nimport { escape, stringify } from '../../utils/string.js'\n\nconst name = 'ObjectNode'\nconst dependencies = [\n 'Node'\n]\n\nexport const createObjectNode = /* #__PURE__ */ factory(name, dependencies, ({ Node }) => {\n class ObjectNode extends Node {\n /**\n * @constructor ObjectNode\n * @extends {Node}\n * Holds an object with keys/values\n * @param {Object.