libre-webui 0.19.2 → 0.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/dist/index.d.ts.map +1 -1
- package/backend/dist/index.js +61 -2
- package/backend/dist/index.js.map +1 -1
- package/backend/dist/routes/artifacts.d.ts +3 -0
- package/backend/dist/routes/artifacts.d.ts.map +1 -0
- package/backend/dist/routes/artifacts.js +167 -0
- package/backend/dist/routes/artifacts.js.map +1 -0
- package/backend/dist/routes/ollama.d.ts.map +1 -1
- package/backend/dist/routes/ollama.js +25 -0
- package/backend/dist/routes/ollama.js.map +1 -1
- package/backend/dist/routes/preferences.d.ts.map +1 -1
- package/backend/dist/routes/preferences.js +44 -0
- package/backend/dist/routes/preferences.js.map +1 -1
- package/backend/dist/services/chatGenerationService.d.ts +11 -0
- package/backend/dist/services/chatGenerationService.d.ts.map +1 -1
- package/backend/dist/services/chatGenerationService.js +20 -1
- package/backend/dist/services/chatGenerationService.js.map +1 -1
- package/backend/dist/services/ollamaService.d.ts +9 -0
- package/backend/dist/services/ollamaService.d.ts.map +1 -1
- package/backend/dist/services/ollamaService.js +27 -0
- package/backend/dist/services/ollamaService.js.map +1 -1
- package/backend/dist/services/preferencesService.d.ts +7 -0
- package/backend/dist/services/preferencesService.d.ts.map +1 -1
- package/backend/dist/services/preferencesService.js +22 -0
- package/backend/dist/services/preferencesService.js.map +1 -1
- package/backend/dist/types/index.d.ts +5 -0
- package/backend/dist/types/index.d.ts.map +1 -1
- package/backend/dist/types/index.js.map +1 -1
- package/backend/dist/utils/ollamaModelDefaults.d.ts +39 -0
- package/backend/dist/utils/ollamaModelDefaults.d.ts.map +1 -0
- package/backend/dist/utils/ollamaModelDefaults.js +157 -0
- package/backend/dist/utils/ollamaModelDefaults.js.map +1 -0
- package/backend/package.json +1 -1
- package/frontend/dist/apple-touch-icon.png +0 -0
- package/frontend/dist/artifact-runtime/.build-fingerprint +1 -0
- package/frontend/dist/artifact-runtime/babel.js +613 -0
- package/frontend/dist/artifact-runtime/chart.js +3 -0
- package/frontend/dist/artifact-runtime/d3.js +5 -0
- package/frontend/dist/artifact-runtime/fonts.js +255 -0
- package/frontend/dist/artifact-runtime/framer-motion.js +10 -0
- package/frontend/dist/artifact-runtime/lodash.js +20 -0
- package/frontend/dist/artifact-runtime/lucide-react.js +1 -0
- package/frontend/dist/artifact-runtime/mathjs.js +54 -0
- package/frontend/dist/artifact-runtime/mermaid.js +3535 -0
- package/frontend/dist/artifact-runtime/papaparse.js +10 -0
- package/frontend/dist/artifact-runtime/plotly.js +3790 -0
- package/frontend/dist/artifact-runtime/react.js +9 -0
- package/frontend/dist/artifact-runtime/recharts.js +69 -0
- package/frontend/dist/artifact-runtime/runtime.js +1 -0
- package/frontend/dist/artifact-runtime/tailwind.js +952 -0
- package/frontend/dist/artifact-runtime/three.js +5271 -0
- package/frontend/dist/artifact-runtime/tone.js +210 -0
- package/frontend/dist/assets/index-DrcHGnwk.js +64 -0
- package/frontend/dist/assets/index-DtkGuqvC.css +1 -0
- package/frontend/dist/favicon-dark.png +0 -0
- package/frontend/dist/favicon-light.png +0 -0
- package/frontend/dist/favicon.svg +1 -0
- package/frontend/dist/fonts/inter.css +254 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa0ZL7W0Q5n-wU.woff2 +0 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1ZL7W0Q5nw.woff2 +0 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa1pL7W0Q5n-wU.woff2 +0 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa25L7W0Q5n-wU.woff2 +0 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2JL7W0Q5n-wU.woff2 +0 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2ZL7W0Q5n-wU.woff2 +0 -0
- package/frontend/dist/fonts/v20-UcC73FwrK3iLTeHuS_nVMrMxCp50SjIa2pL7W0Q5n-wU.woff2 +0 -0
- package/frontend/dist/icon-192.png +0 -0
- package/frontend/dist/icon-512.png +0 -0
- package/frontend/dist/index.html +16 -11
- package/frontend/dist/js/ArtifactContainer-CEBbQqtg.js +1 -0
- package/frontend/dist/js/{ArtifactDemoPage-BlVBMy6a.js → ArtifactDemoPage-BDTtUPjk.js} +58 -2
- package/frontend/dist/js/ArtifactSandboxFrame-DOQWmEAm.js +151 -0
- package/frontend/dist/js/ArtifactSlideOutPanel-BMhWWM3P.js +1 -0
- package/frontend/dist/js/ChatPage-B64xgIPZ.js +16 -0
- package/frontend/dist/js/FirstTimeSetup-1IqkWCsV.js +1 -0
- package/frontend/dist/js/{GalleryPage-BnaFZERr.js → GalleryPage-CKgQAYmH.js} +1 -1
- package/frontend/dist/js/{HomePage-BvpoUzGG.js → HomePage-aNO615Go.js} +1 -1
- package/frontend/dist/js/{LibreClawPage-B-6rO5Jl.js → LibreClawPage-DZqgIOgT.js} +1 -1
- package/frontend/dist/js/ModelSelector-DhmVTh2d.js +1 -0
- package/frontend/dist/js/{ModelsPage-D5H70fs3.js → ModelsPage-tzXaut3l.js} +1 -1
- package/frontend/dist/js/{NotesPage-D9b3JxCx.js → NotesPage-Ciwrazz9.js} +1 -1
- package/frontend/dist/js/{PersonasPage-CJOGnyQV.js → PersonasPage-C9Pkl4yH.js} +2 -2
- package/frontend/dist/js/{PluginUsagePage-DHNMWquK.js → PluginUsagePage-DPfyos1y.js} +1 -1
- package/frontend/dist/js/{RichMessageContent-C7NG7gs-.js → RichMessageContent-CUcmvdXW.js} +1 -1
- package/frontend/dist/js/SettingsModal-DhrjNMcd.js +1 -0
- package/frontend/dist/js/{SystemPage-BsPen2Qb.js → SystemPage-CkUsJ-UR.js} +1 -1
- package/frontend/dist/js/{UserManagementPage-I9i5r0V3.js → UserManagementPage-DClRsCeA.js} +1 -1
- package/frontend/dist/js/WorkPage-cJEe9LZ_.js +5 -0
- package/frontend/dist/js/api-iDBo7I0x.js +19 -0
- package/frontend/dist/js/{appStore-CLIS0fvz.js → appStore-BAFz_6aP.js} +2 -2
- package/frontend/dist/js/{ar-B_uYj5Gv.js → ar-D3PgKaYD.js} +1 -1
- package/frontend/dist/js/{authStore-CsCkBmaG.js → authStore-2665PsVB.js} +2 -2
- package/frontend/dist/js/{bn-Pd4HHYsG.js → bn-DJiNo5j1.js} +1 -1
- package/frontend/dist/js/chatStore-fX9gMb9B.js +2 -0
- package/frontend/dist/js/config-CmH3hRFc.js +1 -0
- package/frontend/dist/js/{cs-CgVXogHE.js → cs-BJ7pToPB.js} +1 -1
- package/frontend/dist/js/{da-DTUIrClO.js → da-Cqw35YeI.js} +1 -1
- package/frontend/dist/js/{de-CKITtmnY.js → de-DLw7O2DX.js} +1 -1
- package/frontend/dist/js/{es-DKDhsL9J.js → es-CLg6Zl_p.js} +1 -1
- package/frontend/dist/js/{estree-CrfVSazx.js → estree-63s2XfPj.js} +1 -1
- package/frontend/dist/js/{fr-CUvNp0pc.js → fr-BUmG4BWs.js} +1 -1
- package/frontend/dist/js/{hi-Bwdmc__g.js → hi-CGktbsaL.js} +1 -1
- package/frontend/dist/js/{html-BbJLJMaV.js → html-CRbptZf3.js} +1 -1
- package/frontend/dist/js/{i18n-ZJQSoIuM.js → i18n-DFbHZ75-.js} +2 -2
- package/frontend/dist/js/{id-CWTPw3NJ.js → id-C7FnPtw9.js} +1 -1
- package/frontend/dist/js/{is-4dV6F4Bo.js → is-_FSS24Pj.js} +1 -1
- package/frontend/dist/js/{it-8uw2-j2s.js → it-DWTgF8my.js} +1 -1
- package/frontend/dist/js/{ja-Bl7gd3kp.js → ja-jYrlZiIs.js} +1 -1
- package/frontend/dist/js/{ko-C_CYwJnL.js → ko-3PZ87sc7.js} +1 -1
- package/frontend/dist/js/{markdown-DiMg1QLf.js → markdown-C23cybKA.js} +1 -1
- package/frontend/dist/js/{messageCodeStyles-CfzjQF-R.js → messageCodeStyles-BJVb4sK7.js} +1 -1
- package/frontend/dist/js/{ms-Dznw3AkA.js → ms-BfySq07T.js} +1 -1
- package/frontend/dist/js/{nl-fW-4lPWK.js → nl-DupdNsDK.js} +1 -1
- package/frontend/dist/js/{pl-CanprK04.js → pl-DYoPcTNe.js} +1 -1
- package/frontend/dist/js/{pt-JhTaVvKa.js → pt-p_-S_r1k.js} +1 -1
- package/frontend/dist/js/{ru-uPtHQATq.js → ru-CuJFlVPc.js} +1 -1
- package/frontend/dist/js/{standalone-Vs6LnjM6.js → standalone-BwzoPJoZ.js} +1 -1
- package/frontend/dist/js/{sv-yr6iqxR-.js → sv-DyZJcYOQ.js} +1 -1
- package/frontend/dist/js/{th-Bx4U5yKy.js → th-Cd6fTxUn.js} +1 -1
- package/frontend/dist/js/{tr-C7tCwYuZ.js → tr-BB1gefYF.js} +1 -1
- package/frontend/dist/js/{typescript-BhVG1zGU.js → typescript-CS-sPC9m.js} +1 -1
- package/frontend/dist/js/{ui-Dj9IFugT.js → ui-B-C2BCTb.js} +2 -2
- package/frontend/dist/js/{uk-C4SbiAUn.js → uk-DFURilqa.js} +1 -1
- package/frontend/dist/js/{vi-C3-TmuzC.js → vi-BXclLwGp.js} +1 -1
- package/frontend/dist/js/{zh-CRfqIC_I.js → zh-BS8f68w1.js} +1 -1
- package/frontend/dist/logo-dark.png +0 -0
- package/frontend/dist/logo-dark.svg +1 -0
- package/frontend/dist/logo-light.png +0 -0
- package/frontend/dist/logo-light.svg +1 -0
- package/frontend/dist/logo.svg +1 -6
- package/frontend/dist/maskable-512.png +0 -0
- package/package.json +3 -3
- package/frontend/dist/assets/index-B9H3vQ-n.css +0 -1
- package/frontend/dist/assets/index-D4LhtFTX.js +0 -38
- package/frontend/dist/js/ArtifactContainer-DvuGeXXu.js +0 -1
- package/frontend/dist/js/ArtifactSlideOutPanel-CaPMk1Qj.js +0 -1
- package/frontend/dist/js/ChatPage-D4UBhGLk.js +0 -16
- package/frontend/dist/js/FirstTimeSetup-DJiDNTXY.js +0 -1
- package/frontend/dist/js/ModelSelector-BV1kuaVg.js +0 -1
- package/frontend/dist/js/SettingsModal-DEBxDPne.js +0 -1
- package/frontend/dist/js/WorkPage-e30yqvJe.js +0 -5
- package/frontend/dist/js/api-jwjnjqx6.js +0 -19
- package/frontend/dist/js/artifactHtml-C0Hu9I1u.js +0 -41
- package/frontend/dist/js/chatStore-DRY8C0J1.js +0 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
(function(){var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(null,arguments)}var d={relTol:1e-12,absTol:1e-15,matrix:`Matrix`,number:`number`,numberFallback:`number`,precision:64,predictable:!1,randomSeed:null,legacySubset:!1};function f(e,t){if(m(e,t)||h(e,t))return e[t];throw v(e,t)?Error(`Cannot access method "${t}" as a property`):e==null?TypeError(`Cannot access property "${t}": object is ${e}`):Error(`No access to property "`+t+`"`)}function p(e,t,n){if(m(e,t)||h(e,t))return e[t]=n,n;throw Error(`No access to property "${t}"`)}function m(e,t){return y(e)?!(t in Object.prototype):!1}function h(e,t){return Array.isArray(e)?typeof t==`number`||typeof t==`string`&&g(t)||t===`length`:!1}function g(e){return/^\d+$/.test(e)}function _(e,t){if(!v(e,t))throw Error(`No access to method "`+t+`"`);return e[t]}function v(e,t){return e==null||typeof e[t]!=`function`||z(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:b.has(t)?!0:!(t in Object.prototype||t in Function.prototype)}function y(e){return typeof e==`object`&&e&&e.constructor===Object}var b=new Set([`toString`,`valueOf`,`toLocaleString`]),x=class{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 f(this.wrappedObject,e)}set(e,t){return p(this.wrappedObject,e,t),this}has(e){return m(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return C(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){m(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}},S=class{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 C(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var 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 C(e,t){return{next:()=>{var n=e.next();return n.done?n:{value:t(n.value),done:!1}}}}function w(){return new Map}function T(e){if(!e)return w();if(le(e))return e;if(R(e))return new x(e);throw Error(`createMap can create maps from objects or Maps`)}function E(e){if(e instanceof x)return e.wrappedObject;var t={};for(var n of e.keys())p(t,n,e.get(n));return t}function D(e){return typeof e==`number`}function O(e){return!e||typeof e!=`object`||typeof e.constructor!=`function`?!1:e.isBigNumber===!0&&typeof e.constructor.prototype==`object`&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal==`function`&&e.constructor.isDecimal(e)===!0}function k(e){return typeof e==`bigint`}function A(e){return e&&typeof e==`object`&&Object.getPrototypeOf(e).isComplex===!0||!1}function j(e){return e&&typeof e==`object`&&Object.getPrototypeOf(e).isFraction===!0||!1}function M(e){return e&&e.constructor.prototype.isUnit===!0||!1}function N(e){return typeof e==`string`}var P=Array.isArray;function F(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function ee(e){return Array.isArray(e)||F(e)}function te(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function ne(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function re(e){return e&&e.constructor.prototype.isRange===!0||!1}function ie(e){return e&&e.constructor.prototype.isIndex===!0||!1}function ae(e){return typeof e==`boolean`}function I(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function oe(e){return e&&e.constructor.prototype.isHelp===!0||!1}function L(e){return typeof e==`function`}function se(e){return e instanceof Date}function ce(e){return e instanceof RegExp}function R(e){return!!(e&&typeof e==`object`&&e.constructor===Object&&!A(e)&&!j(e))}function le(e){return e?e instanceof Map||e instanceof x||typeof e.set==`function`&&typeof e.get==`function`&&typeof e.keys==`function`&&typeof e.has==`function`:!1}function ue(e){return le(e)&&le(e.a)&&le(e.b)}function de(e){return le(e)&&R(e.wrappedObject)}function fe(e){return e===null}function pe(e){return e===void 0}function me(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function he(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function ge(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function _e(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function ve(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function ye(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function be(e){return ye(e)||Ee(e)&&e.args.length===1&&ye(e.args[0])&&`-+~`.includes(e.op)}function xe(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Se(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ce(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function we(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Te(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ee(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function De(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Oe(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function ke(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ae(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function je(e){return e&&e.constructor.prototype.isChain===!0||!1}function Me(e){var t=typeof e;return t===`object`?e===null?`null`:O(e)?`BigNumber`:e.constructor&&e.constructor.name?e.constructor.name:`Object`:t}function Ne(e){var t=typeof e;if(t===`number`||t===`bigint`||t===`string`||t===`boolean`||e==null)return e;if(typeof e.clone==`function`)return e.clone();if(Array.isArray(e))return e.map(function(e){return Ne(e)});if(e instanceof Date)return new Date(e.valueOf());if(O(e))return e;if(R(e))return Pe(e,Ne);if(t===`function`)return e;throw TypeError(`Cannot clone: unknown type of value (value: ${e})`)}function Pe(e,t){var n={};for(var r in e)z(e,r)&&(n[r]=t(e[r]));return n}function Fe(e,t){for(var n in t)z(t,n)&&(e[n]=t[n]);return e}function Ie(e,t){if(Array.isArray(t))throw TypeError(`Arrays are not supported by deepExtend`);for(var n in t)if(z(t,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(t[n]&&t[n].constructor===Object)e[n]===void 0&&(e[n]={}),e[n]&&e[n].constructor===Object?Ie(e[n],t[n]):e[n]=t[n];else if(Array.isArray(t[n]))throw TypeError(`Arrays are not supported by deepExtend`);else e[n]=t[n];return e}function Le(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Le(e[r],t[r]))return!1;return!0}if(typeof e==`function`)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(n in e)if(!(n in t)||!Le(e[n],t[n]))return!1;for(n in t)if(!(n in e))return!1;return!0}return e===t}function Re(e){var t={};return ze(e,t),t}function ze(e,t){for(var n in e)if(z(e,n)){var r=e[n];typeof r==`object`&&r?ze(r,t):t[n]=r}}function Be(e,t,n){var r=!0,i;Object.defineProperty(e,t,{get:function(){return r&&=(i=n(),!1),i},set:function(e){i=e,r=!1},configurable:!0,enumerable:!0})}function z(e,t){return e&&Object.hasOwnProperty.call(e,t)}function Ve(e){return e&&typeof e.factory==`function`}function He(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],a=e[i];a!==void 0&&(n[i]=a)}return n}var Ue=[`Matrix`,`Array`],We=[`number`,`BigNumber`,`bigint`,`Fraction`];function Ge(e,t){function n(r){if(r){if(r.epsilon!==void 0){console.warn(`Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.`);var i=Ne(r);return i.relTol=r.epsilon,i.absTol=r.epsilon*.001,delete i.epsilon,n(i)}r.legacySubset===!0&&console.warn(`Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated in the future.`);var a=Ne(e);Ke(r,`matrix`,Ue),Ke(r,`number`,We),Ie(e,r);var o=Ne(e);return t(`config`,o,a,Ne(r)),o}return Ne(e)}return n.MATRIX_OPTIONS=Ue,n.NUMBER_OPTIONS=We,Object.keys(d).forEach(t=>{Object.defineProperty(n,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),n}function Ke(e,t,n){e[t]!==void 0&&!n.includes(e[t])&&console.warn(`Warning: Unknown value "`+e[t]+`" for configuration option "`+t+`". Available options: `+n.map(e=>JSON.stringify(e)).join(`, `)+`.`)}var B=function(e){if(e)throw Error(`The global config is readonly.
|
|
2
|
+
Please create a mathjs instance if you want to change the default configuration.
|
|
3
|
+
Example:
|
|
4
|
+
|
|
5
|
+
import { create, all } from 'mathjs';
|
|
6
|
+
const mathjs = create(all);
|
|
7
|
+
mathjs.config({ number: 'BigNumber' });
|
|
8
|
+
`);return Object.freeze(d)};u(B,d,{MATRIX_OPTIONS:Ue,NUMBER_OPTIONS:We});var qe=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.typed=r())})(e,(function(){"use strict";function e(){return!0}function t(){return!1}function n(){}let r=`Argument is not a typed-function.`;function i(){function a(e){return typeof e==`object`&&!!e&&e.constructor===Object}let o=[{name:`number`,test:function(e){return typeof e==`number`}},{name:`string`,test:function(e){return typeof e==`string`}},{name:`boolean`,test:function(e){return typeof e==`boolean`}},{name:`Function`,test:function(e){return typeof e==`function`}},{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:a},{name:`null`,test:function(e){return e===null}},{name:`undefined`,test:function(e){return e===void 0}}],s={name:`any`,test:e,isAny:!0},c,l,u=0,d={createCount:0};function f(e){let t=c.get(e);if(t)return t;let n=`Unknown type "`+e+`"`,r=e.toLowerCase(),i;for(i of l)if(i.toLowerCase()===r){n+=`. Did you mean "`+i+`" ?`;break}throw TypeError(n)}function p(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`any`,n=t?f(t).index:l.length,r=[];for(let t=0;t<e.length;++t){if(!e[t]||typeof e[t].name!=`string`||typeof e[t].test!=`function`)throw TypeError(`Object with properties {name: string, test: function} expected`);let i=e[t].name;if(c.has(i))throw TypeError(`Duplicate type name "`+i+`"`);r.push(i),c.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:n+t,conversionsTo:[]})}let i=l.slice(n);l=l.slice(0,n).concat(r).concat(i);for(let e=n+r.length;e<l.length;++e)c.get(l[e]).index=e}function m(){c=new Map,l=[],u=0,p([s],!1)}m(),p(o);function h(){let e;for(e of l)c.get(e).conversionsTo=[];u=0}function g(e){let t=l.filter(t=>{let n=c.get(t);return!n.isAny&&n.test(e)});return t.length?t:[`any`]}function _(e){return e&&typeof e==`function`&&`_typedFunctionData`in e}function v(e,t,n){if(!_(e))throw TypeError(r);let i=n&&n.exact,a=T(Array.isArray(t)?t.join(`,`):t),o=x(a);if(!i||o in e.signatures){let t=e._typedFunctionData.signatureMap.get(o);if(t)return t}let s=a.length,c;if(i){c=[];let t;for(t in e.signatures)c.push(e._typedFunctionData.signatureMap.get(t))}else c=e._typedFunctionData.signatures;for(let e=0;e<s;++e){let t=a[e],n=[],r;for(r of c){let i=k(r.params,e);if(!(!i||t.restParam&&!i.restParam)){if(!i.hasAny){let e=w(i);if(t.types.some(t=>!e.has(t.name)))continue}n.push(r)}}if(c=n,c.length===0)break}let l;for(l of c)if(l.params.length<=s)return l;throw TypeError(`Signature not found (signature: `+(e.name||`unnamed`)+`(`+x(a,`, `)+`))`)}function y(e,t,n){return v(e,t,n).implementation}function b(e,t){let n=f(t);if(n.test(e))return e;let r=n.conversionsTo;if(r.length===0)throw Error(`There are no conversions to `+t+` defined.`);for(let t=0;t<r.length;t++)if(f(r[t].from).test(e))return r[t].convert(e);throw Error(`Cannot convert `+e+` to `+t)}function x(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`,`;return e.map(e=>e.name).join(t)}function S(e){let t=e.indexOf(`...`)===0,n=(t?e.length>3?e.slice(3):`any`:e).split(`|`).map(e=>f(e.trim())),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 C(e){let t=ne(e.types.map(e=>e.name)),n=e.hasAny,r=e.name,i=t.map(function(e){let t=f(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 T(e){let t=[];if(typeof e!=`string`)throw TypeError(`Signatures must be strings`);let n=e.trim();if(n===``)return t;let r=n.split(`,`);for(let e=0;e<r.length;++e){let n=S(r[e].trim());if(n.restParam&&e!==r.length-1)throw SyntaxError(`Unexpected rest parameter "`+r[e]+`": only allowed for the last parameter`);if(n.types.length===0)return null;t.push(n)}return t}function E(e){let t=de(e);return t?t.restParam:!1}function D(t){if(!t||t.types.length===0)return e;if(t.types.length===1)return f(t.types[0].name).test;if(t.types.length===2){let e=f(t.types[0].name).test,n=f(t.types[1].name).test;return function(t){return e(t)||n(t)}}{let e=t.types.map(function(e){return f(e.name).test});return function(t){for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}}function O(e){let t,n,r;if(E(e)){t=ue(e).map(D);let n=t.length,r=D(de(e)),i=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return i(e)&&e.length>=n+1}}return e.length===0?function(e){return e.length===0}:e.length===1?(n=D(e[0]),function(e){return n(e[0])&&e.length===1}):e.length===2?(n=D(e[0]),r=D(e[1]),function(e){return n(e[0])&&r(e[1])&&e.length===2}):(t=e.map(D),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}function k(e,t){return t<e.length?e[t]:E(e)?de(e):null}function A(e,t){let n=k(e,t);return n?w(n):new Set}function j(e){return e.conversion===null||e.conversion===void 0}function M(e,t){let n=new Set;return e.forEach(e=>{let r=A(e.params,t),i;for(i of r)n.add(i)}),n.has(`any`)?[`any`]:Array.from(n)}function N(e,t,n){let r,i,a=e||`unnamed`,o=n,s;for(s=0;s<t.length;s++){let e=[];if(o.forEach(n=>{let r=D(k(n.params,s));(s<n.params.length||E(n.params))&&r(t[s])&&e.push(n)}),e.length===0){if(i=M(o,s),i.length>0){let e=g(t[s]);return r=TypeError(`Unexpected type of argument in function `+a+` (expected: `+i.join(` or `)+`, actual: `+e.join(` | `)+`, index: `+s+`)`),r.data={category:`wrongType`,fn:a,index:s,actual:e,expected:i},r}}else o=e}let c=o.map(function(e){return E(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return i=M(o,s),r=TypeError(`Too few arguments in function `+a+` (expected: `+i.join(` or `)+`, index: `+t.length+`)`),r.data={category:`tooFewArgs`,fn:a,index:t.length,expected:i},r;let l=Math.max.apply(null,c);if(t.length>l)return r=TypeError(`Too many arguments in function `+a+` (expected: `+l+`, actual: `+t.length+`)`),r.data={category:`tooManyArgs`,fn:a,index:t.length,expectedLength:l},r;let u=[];for(let e=0;e<t.length;++e)u.push(g(t[e]).join(`|`));return r=TypeError(`Arguments of type "`+u.join(`, `)+`" do not match any of the defined signatures of function `+a+`.`),r.data={category:`mismatch`,actual:u},r}function P(e){let t=l.length+1;for(let n=0;n<e.types.length;n++)t=Math.min(t,e.types[n].typeIndex);return t}function F(e){let t=u+1;for(let n=0;n<e.types.length;n++)j(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function ee(e,t){if(e.hasAny){if(!t.hasAny)return .1}else if(t.hasAny)return-.1;if(e.restParam){if(!t.restParam)return .01}else if(t.restParam)return-.01;let n=P(e)-P(t);if(n<0)return-.001;if(n>0)return .001;let r=F(e),i=F(t);if(e.hasConversion){if(!t.hasConversion)return(1+r)*1e-6}else if(t.hasConversion)return-(1+i)*1e-6;let a=r-i;return a<0?-1e-7:a>0?1e-7:0}function te(e,t){let n=e.params,r=t.params,i=de(n),a=de(r),o=E(n),s=E(r);if(o&&i.hasAny){if(!s||!a.hasAny)return 1e7}else if(s&&a.hasAny)return-1e7;let c=0,l=0,u;for(u of n)u.hasAny&&++c,u.hasConversion&&++l;let d=0,f=0;for(u of r)u.hasAny&&++d,u.hasConversion&&++f;if(c!==d)return(c-d)*1e6;if(o&&i.hasConversion){if(!s||!a.hasConversion)return 1e5}else if(s&&a.hasConversion)return-1e5;if(l!==f)return(l-f)*1e4;if(o){if(!s)return 1e3}else if(s)return-1e3;let p=(n.length-r.length)*(o?-100:100);if(p!==0)return p;let m=[],h=0;for(let e=0;e<n.length;++e){let t=ee(n[e],r[e]);m.push(t),h+=t}if(h!==0)return(h<0?-10:10)+h;let g,_=9,v=_/(m.length+1);for(g of m){if(g!==0)return(g<0?-_:_)+g;_-=v}return 0}function ne(e){if(e.length===0)return[];let t=e.map(f);if(e.length===1)return t[0].conversionsTo;let n=new Set(e),r=new Set;for(let e=0;e<t.length;++e)for(let i of t[e].conversionsTo)n.has(i.from)||r.add(i.from);let i=[];for(let e of r){let n=u+1,r=null;for(let i=0;i<t.length;++i)for(let a of t[i].conversionsTo)a.from===e&&a.index<n&&(n=a.index,r=a);i.push(r)}return i}function re(e,t){let n=t,r=``;if(e.some(e=>e.hasConversion)){let i=E(e),a=e.map(ie);r=a.map(e=>e.name).join(`;`),n=function(){let e=[],n=i?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=a[t](arguments[t]);return i&&(e[n]=arguments[n].map(a[n])),t.apply(this,e)}}let i=n;if(E(e)){let t=e.length-1;i=function(){return n.apply(this,fe(arguments,0,t).concat([fe(arguments,t)]))}}return r&&Object.defineProperty(i,"name",{value:r}),i}function ie(e){let t,n,r,i,a=[],o=[],s=``;e.types.forEach(function(e){e.conversion&&(s+=e.conversion.from+`~>`+e.conversion.to+`,`,a.push(f(e.conversion.from).test),o.push(e.conversion.convert))}),s=s?s.slice(0,-1):`pass`;let c=e=>e;switch(o.length){case 0:break;case 1:t=a[0],r=o[0],c=function(e){return t(e)?r(e):e};break;case 2:t=a[0],n=a[1],r=o[0],i=o[1],c=function(e){return t(e)?r(e):n(e)?i(e):e};break;default:c=function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}return Object.defineProperty(c,"name",{value:s}),c}function ae(e){function t(e,n,r){if(n<e.length){let i=e[n],a=[];if(i.restParam){let e=i.types.filter(j);e.length<i.types.length&&a.push({types:e,name:`...`+e.map(e=>e.name).join(`|`),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),a.push(i)}else a=i.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return me(a,function(i){return t(e,n+1,r.concat([i]))})}return[r]}return t(e,0,[])}function I(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=A(e,r),i=A(t,r),a=!1,o;for(o of i)if(n.has(o)){a=!0;break}if(!a)return!1}let r=e.length,i=t.length,a=E(e),o=E(t);return a?o?r===i:i>=r:o?r>=i:r===i}function oe(e){return e.map(e=>ye(e)?_e(e.referToSelf.callback):ve(e)?ge(e.referTo.references,e.referTo.callback):e)}function L(e,t,n){let r=[],i;for(i of e){let e=n[i];if(typeof e!=`number`)throw TypeError(`No definition for referenced signature "`+i+`"`);if(e=t[e],typeof e!=`function`)return!1;r.push(e)}return r}function se(e,t,n){let r=oe(e),i=Array(r.length).fill(!1),a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<r.length;++o){if(i[o])continue;let s=r[o];if(ye(s))r[o]=s.referToSelf.callback(n),r[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(ve(s)){let n=L(s.referTo.references,r,t);n?(r[o]=s.referTo.callback.apply(this,n),r[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw SyntaxError(`Circular reference detected in resolving typed.referTo`)}return r}function ce(e){let t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach(n=>{let r=e[n];if(t.test(r.toString()))throw SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function R(e,r){if(d.createCount++,Object.keys(r).length===0)throw SyntaxError(`No signatures provided`);d.warnAgainstDeprecatedThis&&ce(r);let i=[],a=[],o={},s=[],c;for(c in r){if(!Object.prototype.hasOwnProperty.call(r,c))continue;let e=T(c);if(!e)continue;i.forEach(function(t){if(I(t,e))throw TypeError(`Conflicting signatures "`+x(t)+`" and "`+x(e)+`".`)}),i.push(e);let t=a.length;a.push(r[c]);let n=e.map(C),l;for(l of ae(n)){let e=x(l);s.push({params:l,name:e,fn:t}),l.every(e=>!e.hasConversion)&&(o[e]=t)}}s.sort(te);let l=se(a,o,Ce),u;for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=l[o[u]]);let f=[],p=new Map;for(u of s)p.has(u.name)||(u.fn=l[u.fn],f.push(u),p.set(u.name,u));let m=f[0]&&f[0].params.length<=2&&!E(f[0].params),h=f[1]&&f[1].params.length<=2&&!E(f[1].params),g=f[2]&&f[2].params.length<=2&&!E(f[2].params),_=f[3]&&f[3].params.length<=2&&!E(f[3].params),v=f[4]&&f[4].params.length<=2&&!E(f[4].params),y=f[5]&&f[5].params.length<=2&&!E(f[5].params),b=m&&h&&g&&_&&v&&y;for(let e=0;e<f.length;++e)f[e].test=O(f[e].params);let S=m?D(f[0].params[0]):t,w=h?D(f[1].params[0]):t,k=g?D(f[2].params[0]):t,A=_?D(f[3].params[0]):t,j=v?D(f[4].params[0]):t,M=y?D(f[5].params[0]):t,N=m?D(f[0].params[1]):t,P=h?D(f[1].params[1]):t,F=g?D(f[2].params[1]):t,ee=_?D(f[3].params[1]):t,ne=v?D(f[4].params[1]):t,ie=y?D(f[5].params[1]):t;for(let e=0;e<f.length;++e)f[e].implementation=re(f[e].params,f[e].fn);let oe=m?f[0].implementation:n,L=h?f[1].implementation:n,R=g?f[2].implementation:n,le=_?f[3].implementation:n,ue=v?f[4].implementation:n,de=y?f[5].implementation:n,fe=m?f[0].params.length:-1,pe=h?f[1].params.length:-1,me=g?f[2].params.length:-1,he=_?f[3].params.length:-1,ge=v?f[4].params.length:-1,_e=y?f[5].params.length:-1,ve=b?6:0,ye=f.length,be=f.map(e=>e.test),xe=f.map(e=>e.implementation),Se=function(){for(let e=ve;e<ye;e++)if(be[e](arguments))return xe[e].apply(this,arguments);return d.onMismatch(e,arguments,f)};function Ce(e,t){return arguments.length===fe&&S(e)&&N(t)?oe.apply(this,arguments):arguments.length===pe&&w(e)&&P(t)?L.apply(this,arguments):arguments.length===me&&k(e)&&F(t)?R.apply(this,arguments):arguments.length===he&&A(e)&&ee(t)?le.apply(this,arguments):arguments.length===ge&&j(e)&&ne(t)?ue.apply(this,arguments):arguments.length===_e&&M(e)&&ie(t)?de.apply(this,arguments):Se.apply(this,arguments)}try{Object.defineProperty(Ce,"name",{value:e})}catch{}return Ce.signatures=o,Ce._typedFunctionData={signatures:f,signatureMap:p},Ce}function le(e,t,n){throw N(e,t,n)}function ue(e){return fe(e,0,e.length-1)}function de(e){return e[e.length-1]}function fe(e,t,n){return Array.prototype.slice.call(e,t,n)}function pe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}function me(e,t){return Array.prototype.concat.apply([],e.map(t))}function he(){let e=ue(arguments).map(e=>x(T(e))),t=de(arguments);if(typeof t!=`function`)throw TypeError(`Callback function expected as last argument`);return ge(e,t)}function ge(e,t){return{referTo:{references:e,callback:t}}}function _e(e){if(typeof e!=`function`)throw TypeError(`Callback function expected as first argument`);return{referToSelf:{callback:e}}}function ve(e){return e&&typeof e.referTo==`object`&&Array.isArray(e.referTo.references)&&typeof e.referTo.callback==`function`}function ye(e){return e&&typeof e.referToSelf==`object`&&typeof e.referToSelf.callback==`function`}function be(e,t){if(!e)return t;if(t&&t!==e){let n=Error(`Function names do not match (expected: `+e+`, actual: `+t+`)`);throw n.data={actual:t,expected:e},n}return e}function xe(e){let t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_(e[n])||typeof e[n].signature==`string`)&&(t=be(t,e[n].name));return t}function Se(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){let r=Error(`Signature "`+n+`" is defined twice`);throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}let Ce=d;d=function(e){let t=typeof e==`string`,n=+!!t,r=t?e:``,i={};for(let e=n;e<arguments.length;++e){let n=arguments[e],o={},s;if(typeof n==`function`?(s=n.name,typeof n.signature==`string`?o[n.signature]=n:_(n)&&(o=n.signatures)):a(n)&&(o=n,t||(s=xe(n))),Object.keys(o).length===0){let t=TypeError(`Argument to 'typed' at index `+e+` is not a (typed) function, nor an object with signatures as keys and functions as values.`);throw t.data={index:e,argument:n},t}t||(r=be(r,s)),Se(i,o)}return R(r||``,i)},d.create=i,d.createCount=Ce.createCount,d.onMismatch=le,d.throwMismatchError=le,d.createError=N,d.clear=m,d.clearConversions=h,d.addTypes=p,d._findType=f,d.referTo=he,d.referToSelf=_e,d.convert=b,d.findSignature=v,d.find=y,d.isTypedFunction=_,d.warnAgainstDeprecatedThis=!0,d.addType=function(e,t){let n=`any`;t!==!1&&c.has(`Object`)&&(n=`Object`),d.addTypes([e],n)};function we(e){if(!e||typeof e.from!=`string`||typeof e.to!=`string`||typeof e.convert!=`function`)throw TypeError(`Object with properties {from: string, to: string, convert: function} expected`);if(e.to===e.from)throw SyntaxError(`Illegal to define conversion from "`+e.from+`" to itself.`)}return d.addConversion=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};we(e);let n=f(e.to),r=n.conversionsTo.find(t=>t.from===e.from);if(r)if(t&&t.override)d.removeConversion({from:r.from,to:e.to,convert:r.convert});else throw Error(`There is already a conversion from "`+e.from+`" to "`+n.name+`"`);n.conversionsTo.push({from:e.from,to:n.name,convert:e.convert,index:u++})},d.addConversions=function(e,t){e.forEach(e=>d.addConversion(e,t))},d.removeConversion=function(e){we(e);let t=f(e.to),n=pe(t.conversionsTo,t=>t.from===e.from);if(!n)throw Error(`Attempt to remove nonexistent conversion from `+e.from+` to `+e.to);if(n.convert!==e.convert)throw Error(`Conversion to remove does not match existing conversion`);let r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},d.resolve=function(e,t){if(!_(e))throw TypeError(r);let n=e._typedFunctionData.signatures;for(let e=0;e<n.length;++e)if(n[e].test(t))return n[e];return null},d}return i()}))}));function V(e,t,n,r){function i(r){var i=He(r,t.map(Ze));return Ye(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function Je(e){return typeof e==`function`&&typeof e.fn==`string`&&Array.isArray(e.dependencies)}function Ye(e,t,n){if(!t.filter(e=>!Xe(e)).every(e=>n[e]!==void 0)){var r=t.filter(e=>n[e]===void 0);throw Error(`Cannot create function "${e}", some dependencies are missing: ${r.map(e=>`"${e}"`).join(`, `)}.`)}}function Xe(e){return e&&e[0]===`?`}function Ze(e){return e&&e[0]===`?`?e.slice(1):e}function H(e){return typeof e==`boolean`?!0:Number.isFinite(e)?e===Math.round(e):!1}function Qe(e,t){if(t.number===`bigint`)try{BigInt(e)}catch{return t.numberFallback}return t.number}var $e=Math.sign||function(e){return e>0?1:e<0?-1:0},et=Math.log2||function(e){return Math.log(e)/Math.LN2},tt=Math.log10||function(e){return Math.log(e)/Math.LN10},nt=Math.log1p||function(e){return Math.log(e+1)},rt=Math.cbrt||function(e){if(e===0)return e;var t=e<0,n;return t&&(e=-e),Number.isFinite(e)?(n=Math.exp(Math.log(e)/3),n=(e/(n*n)+2*n)/3):n=e,t?-n:n},it=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function at(e,t,n){var r={2:`0b`,8:`0o`,16:`0x`}[t],i=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!H(n))throw Error(`size must be an integer`);if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!H(e))throw Error(`Value must be an integer`);e<0&&(e+=2**n),i=`i${n}`}var a=``;return e<0&&(e=-e,a=`-`),`${a}${r}${e.toString(t)}${i}`}function ot(e,t){if(typeof t==`function`)return t(e);if(e===1/0)return`Infinity`;if(e===-1/0)return`-Infinity`;if(isNaN(e))return`NaN`;var{notation:n,precision:r,wordSize:i}=st(t);switch(n){case`fixed`:return ut(e,r);case`exponential`:return dt(e,r);case`engineering`:return lt(e,r);case`bin`:return at(e,2,i);case`oct`:return at(e,8,i);case`hex`:return at(e,16,i);case`auto`:return ft(e,r,t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function st(e){var t=`auto`,n,r;if(e!==void 0)if(D(e))n=e;else if(O(e))n=e.toNumber();else if(R(e))e.precision!==void 0&&(n=wt(e.precision,()=>{throw Error(`Option "precision" must be a number or BigNumber`)})),e.wordSize!==void 0&&(r=wt(e.wordSize,()=>{throw Error(`Option "wordSize" must be a number or BigNumber`)})),e.notation&&(t=e.notation);else throw Error(`Unsupported type of options, number, BigNumber, or object expected`);return{notation:t,precision:n,wordSize:r}}function ct(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError(`Invalid number `+e);var n=t[1],r=t[2],i=parseFloat(t[4]||`0`),a=r.indexOf(`.`);i+=a===-1?r.length-1:a-1;var o=r.replace(`.`,``).replace(/^0*/,function(e){return i-=e.length,``}).replace(/0*$/,``).split(``).map(function(e){return parseInt(e)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function lt(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);var n=pt(ct(e),t),r=n.exponent,i=n.coefficients,a=r%3==0?r:r<0?r-3-r%3:r-r%3;if(D(t))for(;t>i.length||r-a+1>i.length;)i.push(0);else for(var o=Math.abs(r-a)-(i.length-1),s=0;s<o;s++)i.push(0);for(var c=Math.abs(r-a),l=1;c>0;)l++,c--;var u=i.slice(l).join(``),d=D(t)&&u.length||u.match(/[1-9]/)?`.`+u:``,f=i.slice(0,l).join(``)+d+`e`+(r>=0?`+`:``)+a.toString();return n.sign+f}function ut(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);var n=ct(e),r=typeof t==`number`?pt(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(mt(o-i.length))),a<0&&(i=mt(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?`0.`:`.`),r.sign+i.join(``)}function dt(e,t){if(isNaN(e)||!Number.isFinite(Number(e)))return String(e);var n=ct(e),r=t?pt(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(mt(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?`.`+i.join(``):``)+`e`+(a>=0?`+`:``)+a}function ft(e,t,n){if(isNaN(e)||!Number.isFinite(e))return String(e);var r=Tt(n?.lowerExp,-3),i=Tt(n?.upperExp,5),a=ct(e),o=t?pt(a,t):a;if(o.exponent<r||o.exponent>=i)return dt(e,t);var s=o.coefficients,c=o.exponent;s.length<t&&(s=s.concat(mt(t-s.length))),s=s.concat(mt(c-s.length+1+(s.length<t?t-s.length:0))),s=mt(-c).concat(s);var l=c>0?c:0;return l<s.length-1&&s.splice(l+1,0,`.`),o.sign+s.join(``)}function pt(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function mt(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function ht(e){return e.toExponential().replace(/e.*$/,``).replace(/^0\.?0*|\./,``).length}function gt(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw Error(`Relative tolerance must be greater than 0`);if(r<0)throw Error(`Absolute tolerance must be at least 0`);return isNaN(e)||isNaN(t)?!1:!Number.isFinite(e)||!Number.isFinite(t)?e===t:e===t||Math.abs(e-t)<=Math.max(n*Math.max(Math.abs(e),Math.abs(t)),r)}var _t=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},vt=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},yt=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},bt=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},xt=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},St=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function Ct(e,t){return(e>0?!0:e<0?!1:1/e==1/0)^(t>0?!0:t<0?!1:1/t==1/0)?-e:e}function wt(e,t){if(D(e))return e;if(O(e))return e.toNumber();t()}function Tt(e,t){return D(e)?e:O(e)?e.toNumber():t}var Et=l(qe(),1),Dt=function(){return Dt=Et.default.create,Et.default},Ot=V(`typed`,[`?BigNumber`,`?Complex`,`?DenseMatrix`,`?Fraction`],function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,a=Dt();return a.clear(),a.addTypes([{name:`number`,test:D},{name:`Complex`,test:A},{name:`BigNumber`,test:O},{name:`bigint`,test:k},{name:`Fraction`,test:j},{name:`Unit`,test:M},{name:`identifier`,test:e=>N&&/^(?:[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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\uA7DC\uA7F1-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])(?:[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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\uA7DC\uA7F1-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*$/.test(e)},{name:`string`,test:N},{name:`Chain`,test:je},{name:`Array`,test:P},{name:`Matrix`,test:F},{name:`DenseMatrix`,test:te},{name:`SparseMatrix`,test:ne},{name:`Range`,test:re},{name:`Index`,test:ie},{name:`boolean`,test:ae},{name:`ResultSet`,test:I},{name:`Help`,test:oe},{name:`function`,test:L},{name:`Date`,test:se},{name:`RegExp`,test:ce},{name:`null`,test:fe},{name:`undefined`,test:pe},{name:`AccessorNode`,test:me},{name:`ArrayNode`,test:he},{name:`AssignmentNode`,test:ge},{name:`BlockNode`,test:_e},{name:`ConditionalNode`,test:ve},{name:`ConstantNode`,test:ye},{name:`FunctionNode`,test:Se},{name:`FunctionAssignmentNode`,test:xe},{name:`IndexNode`,test:Ce},{name:`Node`,test:we},{name:`ObjectNode`,test:Te},{name:`OperatorNode`,test:Ee},{name:`ParenthesisNode`,test:De},{name:`RangeNode`,test:Oe},{name:`RelationalNode`,test:ke},{name:`SymbolNode`,test:Ae},{name:`Map`,test:le},{name:`Object`,test:R}]),a.addConversions([{from:`number`,to:`BigNumber`,convert:function(e){if(t||kt(e),ht(e)>15)throw 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||At(e),new n(e,0)}},{from:`BigNumber`,to:`Complex`,convert:function(e){return n||At(e),new n(e.toNumber(),0)}},{from:`bigint`,to:`number`,convert:function(e){if(e>2**53-1)throw 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||kt(e),new t(e.toString())}},{from:`bigint`,to:`Fraction`,convert:function(e){return i||Mt(e),new i(e)}},{from:`Fraction`,to:`BigNumber`,convert:function(e){throw 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||At(e),new n(e.valueOf(),0)}},{from:`number`,to:`Fraction`,convert:function(e){i||Mt(e);var t=new i(e);if(t.valueOf()!==e)throw 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){var t=Number(e);if(isNaN(t))throw Error(`Cannot convert "`+e+`" to a number`);return t}},{from:`string`,to:`BigNumber`,convert:function(e){t||kt(e);try{return new t(e)}catch{throw Error(`Cannot convert "`+e+`" to BigNumber`)}}},{from:`string`,to:`bigint`,convert:function(e){try{return BigInt(e)}catch{throw Error(`Cannot convert "`+e+`" to BigInt`)}}},{from:`string`,to:`Fraction`,convert:function(e){i||Mt(e);try{return new i(e)}catch{throw Error(`Cannot convert "`+e+`" to Fraction`)}}},{from:`string`,to:`Complex`,convert:function(e){n||At(e);try{return new n(e)}catch{throw Error(`Cannot convert "`+e+`" to Complex`)}}},{from:`boolean`,to:`number`,convert:function(e){return+e}},{from:`boolean`,to:`BigNumber`,convert:function(e){return t||kt(e),new t(+e)}},{from:`boolean`,to:`bigint`,convert:function(e){return BigInt(+e)}},{from:`boolean`,to:`Fraction`,convert:function(e){return i||Mt(e),new i(+e)}},{from:`boolean`,to:`string`,convert:function(e){return String(e)}},{from:`Array`,to:`Matrix`,convert:function(e){return r||jt(),new r(e)}},{from:`Matrix`,to:`Array`,convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&ee(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&ee(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a});function kt(e){throw Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function At(e){throw Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function jt(){throw Error(`Cannot convert array into a Matrix: no class 'DenseMatrix' provided`)}function Mt(e){throw Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}var Nt=V(`ResultSet`,[],()=>{function e(t){if(!(this instanceof e))throw 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}),Pt=9e15,Ft=1e9,It=`0123456789abcdef`,Lt=`2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058`,Rt=`3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789`,zt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Pt,maxE:Pt,crypto:!1},Bt,Vt,Ht=!0,Ut=`[DecimalError] `,Wt=Ut+`Invalid argument: `,Gt=Ut+`Precision limit exceeded`,Kt=Ut+`crypto unavailable`,qt=`[object Decimal]`,Jt=Math.floor,Yt=Math.pow,Xt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Zt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Qt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,$t=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,en=1e7,tn=7,nn=9007199254740991,rn=Lt.length-1,an=Rt.length-1,U={toStringTag:qt};U.absoluteValue=U.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),W(e)},U.ceil=function(){return W(new this.constructor(this),this.e+1,2)},U.clampedTo=U.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Wt+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},U.comparedTo=U.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!s)return!c||!l?NaN:c===l?o===s?0:!o^c<0?1:-1:c;if(!o[0]||!s[0])return o[0]?c:s[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(r=o.length,i=s.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},U.cosine=U.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())+tn,r.rounding=1,n=un(r,kn(r,n)),r.precision=e,r.rounding=t,W(Vt==2||Vt==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},U.cubeRoot=U.cbrt=function(){var e,t,n,r,i,a,o,s,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(Ht=!1,a=u.s*Yt(u.s*u,1/3),!a||Math.abs(a)==1/0?(n=on(u.d),e=u.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?`0`:`00`),a=Yt(n,1/3),e=Jt((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n=`5e`+e:(n=a.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+e),r=new d(n),r.s=u.s):r=new d(a.toString()),o=(e=d.precision)+3;;)if(s=r,c=s.times(s).times(s),l=c.plus(u),r=dn(l.plus(u).times(s),l.plus(c),o+2,1),on(s.d).slice(0,o)===(n=on(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n==`9999`||!i&&n==`4999`){if(!i&&(W(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(W(r,e+1,1),t=!r.times(r).times(r).eq(u));break}return Ht=!0,W(r,e,d.rounding,t)},U.decimalPlaces=U.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-Jt(this.e/tn))*tn,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},U.dividedBy=U.div=function(e){return dn(this,new this.constructor(e))},U.dividedToIntegerBy=U.divToInt=function(e){var t=this,n=t.constructor;return W(dn(t,new n(e),0,1,1),n.precision,n.rounding)},U.equals=U.eq=function(e){return this.cmp(e)===0},U.floor=function(){return W(new this.constructor(this),this.e+1,3)},U.greaterThan=U.gt=function(e){return this.cmp(e)>0},U.greaterThanOrEqualTo=U.gte=function(e){var t=this.cmp(e);return t==1||t===0},U.hyperbolicCosine=U.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/On(4,e)).toString()):(e=16,t=`2.3283064365386962890625e-10`),a=Dn(o,1,a.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=a.times(a),a=s.minus(c.times(u.minus(c.times(u))));return W(a,o.precision=n,o.rounding=r,!0)},U.hyperbolicSine=U.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=Dn(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/On(5,e)),i=Dn(a,2,i,i,!0);for(var o,s=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=n,W(i,t,n,!0)},U.hyperbolicTangent=U.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,dn(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},U.inverseCosine=U.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n===-1?e.isZero()?hn(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)):n===0?e.isNeg()?hn(t,r,i):new t(0):new t(NaN)},U.inverseHyperbolicCosine=U.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,Ht=!1,n=n.times(n).minus(1).sqrt().plus(n),Ht=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},U.inverseHyperbolicSine=U.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,Ht=!1,n=n.times(n).plus(1).sqrt().plus(n),Ht=!0,r.precision=e,r.rounding=t,n.ln())},U.inverseHyperbolicTangent=U.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?W(new a(i),e,t,!0):(a.precision=n=r-i.e,i=dn(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},U.inverseSine=U.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t===-1?(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)):t===0?(e=hn(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN))},U.inverseTangent=U.atan=function(){var e,t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding;if(!l.isFinite()){if(!l.s)return new u(NaN);if(d+4<=an)return o=hn(u,d+4,f).times(.5),o.s=l.s,o}else if(l.isZero())return new u(l);else if(l.abs().eq(1)&&d+4<=an)return o=hn(u,d+4,f).times(.25),o.s=l.s,o;for(u.precision=s=d+10,u.rounding=1,n=Math.min(28,s/tn+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(Ht=!1,t=Math.ceil(s/tn),r=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(r+=2)),i=i.times(c),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),Ht=!0,W(o,u.precision=d,u.rounding=f,!0)},U.isFinite=function(){return!!this.d},U.isInteger=U.isInt=function(){return!!this.d&&Jt(this.e/tn)>this.d.length-2},U.isNaN=function(){return!this.s},U.isNegative=U.isNeg=function(){return this.s<0},U.isPositive=U.isPos=function(){return this.s>0},U.isZero=function(){return!!this.d&&this.d[0]===0},U.lessThan=U.lt=function(e){return this.cmp(e)<0},U.lessThanOrEqualTo=U.lte=function(e){return this.cmp(e)<1},U.logarithm=U.log=function(e){var t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding,p=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:l.s==1?n?0:1/0:NaN);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10==0;)i/=10;a=i!==1}if(Ht=!1,s=d+p,o=Sn(l,s),r=t?mn(u,s+10):Sn(e,s),c=dn(o,r,s,1),cn(c.d,i=d,f))do if(s+=10,o=Sn(l,s),r=t?mn(u,s+10):Sn(e,s),c=dn(o,r,s,1),!a){+on(c.d).slice(i+1,i+15)+1==0x5af3107a4000&&(c=W(c,d+1,0));break}while(cn(c.d,i+=10,f));return Ht=!0,W(c,d,f)},U.minus=U.sub=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.constructor;if(e=new m(e),!p.d||!e.d)return!p.s||!e.s?e=new m(NaN):p.d?e.s=-e.s:e=new m(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,f=e.d,s=m.precision,c=m.rounding,!l[0]||!f[0]){if(f[0])e.s=-e.s;else if(l[0])e=new m(p);else return new m(c===3?-0:0);return Ht?W(e,s,c):e}if(n=Jt(e.e/tn),u=Jt(p.e/tn),l=l.slice(),a=u-n,a){for(d=a<0,d?(t=l,a=-a,o=f.length):(t=f,n=u,o=l.length),r=Math.max(Math.ceil(s/tn),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=l.length,o=f.length,d=r<o,d&&(o=r),r=0;r<o;r++)if(l[r]!=f[r]){d=l[r]<f[r];break}a=0}for(d&&(t=l,l=f,f=t,e.s=-e.s),o=l.length,r=f.length-o;r>0;--r)l[o++]=0;for(r=f.length;r>a;){if(l[--r]<f[r]){for(i=r;i&&l[--i]===0;)l[i]=en-1;--l[i],l[r]+=en}l[r]-=f[r]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=pn(l,n),Ht?W(e,s,c):e):new m(c===3?-0:0)},U.modulo=U.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?W(new r(n),r.precision,r.rounding):(Ht=!1,r.modulo==9?(t=dn(n,e.abs(),0,3,1),t.s*=e.s):t=dn(n,e,0,r.modulo,1),t=t.times(e),Ht=!0,n.minus(t))},U.naturalExponential=U.exp=function(){return xn(this)},U.naturalLogarithm=U.ln=function(){return Sn(this)},U.negated=U.neg=function(){var e=new this.constructor(this);return e.s=-e.s,W(e)},U.plus=U.add=function(e){var t,n,r,i,a,o,s,c,l,u,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,s=f.precision,c=f.rounding,!l[0]||!u[0])return u[0]||(e=new f(d)),Ht?W(e,s,c):e;if(a=Jt(d.e/tn),r=Jt(e.e/tn),l=l.slice(),i=a-r,i){for(i<0?(n=l,i=-i,o=u.length):(n=u,r=a,o=l.length),a=Math.ceil(s/tn),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,n=u,u=l,l=n),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/en|0,l[i]%=en;for(t&&(l.unshift(t),++r),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=pn(l,r),Ht?W(e,s,c):e},U.precision=U.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Wt+e);return n.d?(t=gn(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},U.round=function(){var e=this,t=e.constructor;return W(new t(e),e.e+1,t.rounding)},U.sine=U.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())+tn,r.rounding=1,n=En(r,kn(r,n)),r.precision=e,r.rounding=t,W(Vt>2?n.neg():n,e,t,!0)):new r(NaN)},U.squareRoot=U.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);for(Ht=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=on(s),(t.length+c)%2==0&&(t+=`0`),l=Math.sqrt(t),c=Jt((c+1)/2)-(c<0||c%2),l==1/0?t=`5e`+c:(t=l.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),r=new u(t)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(a=r,r=a.plus(dn(o,a,n+2,1)).times(.5),on(a.d).slice(0,n)===(t=on(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t==`9999`||!i&&t==`4999`){if(!i&&(W(a,c+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(W(r,c+1,1),e=!r.times(r).eq(o));break}return Ht=!0,W(r,c,u.rounding,e)},U.tangent=U.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(),n.s=1,n=dn(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,W(Vt==2||Vt==4?n.neg():n,e,t,!0)):new r(NaN)},U.times=U.mul=function(e){var t,n,r,i,a,o,s,c,l,u=this,d=u.constructor,f=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(n=Jt(u.e/tn)+Jt(e.e/tn),c=f.length,l=p.length,c<l&&(a=f,f=p,p=a,o=c,c=l,l=o),a=[],o=c+l,r=o;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+p[r]*f[i-r-1]+t,a[i--]=s%en|0,t=s/en|0;a[i]=(a[i]+t)%en|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=pn(a,n),Ht?W(e,d.precision,d.rounding):e},U.toBinary=function(e,t){return An(this,2,e,t)},U.toDecimalPlaces=U.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(sn(e,0,Ft),t===void 0?t=r.rounding:sn(t,0,8),W(n,e+n.e+1,t))},U.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=fn(r,!0):(sn(e,0,Ft),t===void 0?t=i.rounding:sn(t,0,8),r=W(new i(r),e+1,t),n=fn(r,!0,e+1)),r.isNeg()&&!r.isZero()?`-`+n:n},U.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=fn(i):(sn(e,0,Ft),t===void 0?t=a.rounding:sn(t,0,8),r=W(new a(i),e+i.e+1,t),n=fn(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?`-`+n:n},U.toFraction=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.d,h=p.constructor;if(!m)return new h(p);if(l=n=new h(1),r=c=new h(0),t=new h(r),a=t.e=gn(m)-p.e-1,o=a%tn,t.d[0]=Yt(10,o<0?tn+o:o),e==null)e=a>0?t:l;else{if(s=new h(e),!s.isInt()||s.lt(l))throw Error(Wt+s);e=s.gt(t)?a>0?t:l:s}for(Ht=!1,s=new h(on(m)),u=h.precision,h.precision=a=m.length*tn*2;d=dn(s,t,0,1,1),i=n.plus(d.times(r)),i.cmp(e)!=1;)n=r,r=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=s.minus(d.times(i)),s=i;return i=dn(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=p.s,f=dn(l,r,a,1).minus(p).abs().cmp(dn(c,n,a,1).minus(p).abs())<1?[l,r]:[c,n],h.precision=u,Ht=!0,f},U.toHexadecimal=U.toHex=function(e,t){return An(this,16,e,t)},U.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:sn(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]?(Ht=!1,n=dn(n,e,0,t,1).times(e),Ht=!0,W(n)):(e.s=n.s,n=e),n},U.toNumber=function(){return+this},U.toOctal=function(e,t){return An(this,8,e,t)},U.toPower=U.pow=function(e){var t,n,r,i,a,o,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(Yt(+s,l));if(s=new c(s),s.eq(1))return s;if(r=c.precision,a=c.rounding,e.eq(1))return W(s,r,a);if(t=Jt(e.e/tn),t>=e.d.length-1&&(n=l<0?-l:l)<=nn)return i=vn(c,s,n,r),e.s<0?new c(1).div(i):W(i,r,a);if(o=s.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=Yt(+s,l),t=n==0||!isFinite(n)?Jt(l*(Math.log(`0.`+on(s.d))/Math.LN10+s.e+1)):new c(n+``).e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(Ht=!1,c.rounding=s.s=1,n=Math.min(12,(t+``).length),i=xn(e.times(Sn(s,r+n)),r),i.d&&(i=W(i,r+5,1),cn(i.d,r,a)&&(t=r+10,i=W(xn(e.times(Sn(s,t+n)),t),t+5,1),+on(i.d).slice(r+1,r+15)+1==0x5af3107a4000&&(i=W(i,r+1,0)))),i.s=o,Ht=!0,c.rounding=a,W(i,r,a))},U.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=fn(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(sn(e,1,Ft),t===void 0?t=i.rounding:sn(t,0,8),r=W(new i(r),e,t),n=fn(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?`-`+n:n},U.toSignificantDigits=U.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(sn(e,1,Ft),t===void 0?t=r.rounding:sn(t,0,8)),W(new r(n),e,t)},U.toString=function(){var e=this,t=e.constructor,n=fn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?`-`+n:n},U.truncated=U.trunc=function(){return W(new this.constructor(this),this.e+1,1)},U.valueOf=U.toJSON=function(){var e=this,t=e.constructor,n=fn(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?`-`+n:n};function on(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=tn-r.length,n&&(a+=_n(n)),a+=r;o=e[t],r=o+``,n=tn-r.length,n&&(a+=_n(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}function sn(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Wt+e)}function cn(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=tn,i=0):(i=Math.ceil((t+1)/tn),t%=tn),a=Yt(10,tn-t),s=e[i]%a|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==Yt(10,t-2)-1||(s==a/2||s==0)&&!(e[i+1]/a/100|0):t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==Yt(10,t-3)-1,o}function ln(e,t,n){for(var r,i=[0],a,o=0,s=e.length;o<s;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=It.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function un(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/On(4,n)).toString()):(n=16,i=`2.3283064365386962890625e-10`),e.precision+=n,t=Dn(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var dn=(function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=+(e[n]<t[n]),e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k=r.constructor,A=r.s==i.s?1:-1,j=r.d,M=i.d;if(!j||!j[0]||!M||!M[0])return new k(!r.s||!i.s||(j?M&&j[0]==M[0]:!M)?NaN:j&&j[0]==0||!M?A*0:A/0);for(c?(p=1,u=r.e-i.e):(c=en,p=tn,u=Jt(r.e/p)-Jt(i.e/p)),D=M.length,T=j.length,_=new k(A),v=_.d=[],d=0;M[d]==(j[d]||0);d++);if(M[d]>(j[d]||0)&&u--,a==null?(S=a=k.precision,o=k.rounding):S=s?a+(r.e-i.e)+1:a,S<0)v.push(1),m=!0;else{if(S=S/p+2|0,d=0,D==1){for(f=0,M=M[0],S++;(d<T||f)&&S--;d++)C=f*c+(j[d]||0),v[d]=C/M|0,f=C%M|0;m=f||d<T}else{for(f=c/(M[0]+1)|0,f>1&&(M=e(M,f,c),j=e(j,f,c),D=M.length,T=j.length),w=D,y=j.slice(0,D),b=y.length;b<D;)y[b++]=0;O=M.slice(),O.unshift(0),E=M[0],M[1]>=c/2&&++E;do f=0,l=t(M,y,D,b),l<0?(x=y[0],D!=b&&(x=x*c+(y[1]||0)),f=x/E|0,f>1?(f>=c&&(f=c-1),h=e(M,f,c),g=h.length,b=y.length,l=t(h,y,g,b),l==1&&(f--,n(h,D<g?O:M,g,c))):(f==0&&(l=f=1),h=M.slice()),g=h.length,g<b&&h.unshift(0),n(y,h,b,c),l==-1&&(b=y.length,l=t(M,y,D,b),l<1&&(f++,n(y,D<b?O:M,b,c))),b=y.length):l===0&&(f++,y=[0]),v[d++]=f,l&&y[0]?y[b++]=j[w]||0:(y=[j[w]],b=1);while((w++<T||y[0]!==void 0)&&S--);m=y[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=u,Bt=m;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+u*p-1,W(_,s?a+_.e+1:a,o,m)}return _}})();function W(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor;out:if(t!=null){if(d=e.d,!d)return e;for(i=1,s=d[0];s>=10;s/=10)i++;if(a=t-i,a<0)a+=tn,o=t,u=d[f=0],c=u/Yt(10,i-o-1)%10|0;else if(f=Math.ceil((a+1)/tn),s=d.length,f>=s)if(r){for(;s++<=f;)d.push(0);u=c=0,i=1,a%=tn,o=a-tn+1}else break out;else{for(u=s=d[f],i=1;s>=10;s/=10)i++;a%=tn,o=a-tn+i,c=o<0?0:u/Yt(10,i-o-1)%10|0}if(r=r||t<0||d[f+1]!==void 0||(o<0?u:u%Yt(10,i-o-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(a>0?o>0?u/Yt(10,i-o):0:d[f-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=Yt(10,(tn-t%tn)%tn),e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=f,s=1,f--):(d.length=f+1,s=Yt(10,tn-a),d[f]=o>0?(u/Yt(10,i-o)%Yt(10,o)|0)*s:0),l)for(;;)if(f==0){for(a=1,o=d[0];o>=10;o/=10)a++;for(o=d[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,d[0]==en&&(d[0]=1));break}else{if(d[f]+=s,d[f]!=en)break;d[f--]=0,s=1}for(a=d.length;d[--a]===0;)d.pop()}return Ht&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function fn(e,t,n){if(!e.isFinite())return Cn(e);var r,i=e.e,a=on(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+_n(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(e.e<0?`e`:`e+`)+e.e):i<0?(a=`0.`+_n(-i-1)+a,n&&(r=n-o)>0&&(a+=_n(r))):i>=o?(a+=_n(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+_n(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=_n(r))),a}function pn(e,t){var n=e[0];for(t*=tn;n>=10;n/=10)t++;return t}function mn(e,t,n){if(t>rn)throw Ht=!0,n&&(e.precision=n),Error(Gt);return W(new e(Lt),t,1,!0)}function hn(e,t,n){if(t>an)throw Error(Gt);return W(new e(Rt),t,n,!0)}function gn(e){var t=e.length-1,n=t*tn+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function _n(e){for(var t=``;e--;)t+=`0`;return t}function vn(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/tn+4);for(Ht=!1;;){if(n%2&&(a=a.times(t),jn(a.d,o)&&(i=!0)),n=Jt(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),jn(t.d,o)}return Ht=!0,a}function yn(e){return e.d[e.d.length-1]&1}function bn(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function xn(e,t){var n,r,i,a,o,s,c,l=0,u=0,d=0,f=e.constructor,p=f.rounding,m=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(Ht=!1,c=m):c=t,s=new f(.03125);e.e>-2;)e=e.times(s),d+=5;for(r=Math.log(Yt(2,d))/Math.LN10*2+5|0,c+=r,n=a=o=new f(1),f.precision=c;;){if(a=W(a.times(e),c,1),n=n.times(++u),s=o.plus(dn(a,n,c,1)),on(s.d).slice(0,c)===on(o.d).slice(0,c)){for(i=d;i--;)o=W(o.times(o),c,1);if(t==null)if(l<3&&cn(o.d,c-r,p,l))f.precision=c+=10,n=a=s=new f(1),u=0,l++;else return W(o,f.precision=m,p,Ht=!0);else return f.precision=m,o}o=s}}function Sn(e,t){var n,r,i,a,o,s,c,l,u,d,f,p=1,m=10,h=e,g=h.d,_=h.constructor,v=_.rounding,y=_.precision;if(h.s<0||!g||!g[0]||!h.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:h.s==1?g?0:h:NaN);if(t==null?(Ht=!1,u=y):u=t,_.precision=u+=m,n=on(g),r=n.charAt(0),Math.abs(a=h.e)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=on(h.d),r=n.charAt(0),p++;a=h.e,r>1?(h=new _(`0.`+n),a++):h=new _(r+`.`+n.slice(1))}else return l=mn(_,u+2,y).times(a+``),h=Sn(new _(r+`.`+n.slice(1)),u-m).plus(l),_.precision=y,t==null?W(h,y,v,Ht=!0):h;for(d=h,c=o=h=dn(h.minus(1),h.plus(1),u,1),f=W(h.times(h),u,1),i=3;;){if(o=W(o.times(f),u,1),l=c.plus(dn(o,new _(i),u,1)),on(l.d).slice(0,u)===on(c.d).slice(0,u))if(c=c.times(2),a!==0&&(c=c.plus(mn(_,u+2,y).times(a+``))),c=dn(c,new _(p),u,1),t==null)if(cn(c.d,u-m,v,s))_.precision=u+=m,l=o=h=dn(d.minus(1),d.plus(1),u,1),f=W(h.times(h),u,1),i=s=1;else return W(c,_.precision=y,v,Ht=!0);else return _.precision=y,c;c=l,i+=2}}function Cn(e){return String(e.s*e.s/0)}function wn(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;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%tn,n<0&&(r+=tn),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=tn;r<i;)e.d.push(+t.slice(r,r+=tn));t=t.slice(r),r=tn-t.length}else r-=i;for(;r--;)t+=`0`;e.d.push(+t),Ht&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Tn(e,t){var n,r,i,a,o,s,c,l,u;if(t.indexOf(`_`)>-1){if(t=t.replace(/(\d)_(?=\d)/g,`$1`),$t.test(t))return wn(e,t)}else if(t===`Infinity`||t===`NaN`)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Zt.test(t))n=16,t=t.toLowerCase();else if(Xt.test(t))n=2;else if(Qt.test(t))n=8;else throw Error(Wt+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf(`.`),o=a>=0,r=e.constructor,o&&(t=t.replace(`.`,``),s=t.length,a=s-a,i=vn(r,new r(n),a,a*2)),l=ln(t,n,en),u=l.length-1,a=u;l[a]===0;--a)l.pop();return a<0?new r(e.s*0):(e.e=pn(l,u),e.d=l,Ht=!1,o&&(e=dn(e,i,s*4)),c&&(e=e.times(Math.abs(c)<54?Yt(2,c):yr.pow(2,c))),Ht=!0,e)}function En(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Dn(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/On(5,n)),t=Dn(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}function Dn(e,t,n,r,i){var a,o,s,c,l=1,u=e.precision,d=Math.ceil(u/tn);for(Ht=!1,c=n.times(n),s=new e(r);;){if(o=dn(s.times(c),new e(t++*t++),u,1),s=i?r.plus(o):r.minus(o),r=dn(o.times(c),new e(t++*t++),u,1),o=s.plus(r),o.d[d]!==void 0){for(a=d;o.d[a]===s.d[a]&&a--;);if(a==-1)break}a=s,s=r,r=o,o=a,l++}return Ht=!0,o.d.length=d+1,o}function On(e,t){for(var n=e;--t;)n*=e;return n}function kn(e,t){var n,r=t.s<0,i=hn(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return Vt=r?4:1,t;if(n=t.divToInt(i),n.isZero())Vt=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return Vt=yn(n)?r?2:3:r?4:1,t;Vt=yn(n)?r?1:4:r?3:2}return t.minus(i).abs()}function An(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor,m=n!==void 0;if(m?(sn(n,1,Ft),r===void 0?r=p.rounding:sn(r,0,8)):(n=p.precision,r=p.rounding),!e.isFinite())u=Cn(e);else{for(u=fn(e),o=u.indexOf(`.`),m?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(u=u.replace(`.`,``),f=new p(1),f.e=u.length-o,f.d=ln(fn(f),10,i),f.e=f.d.length),d=ln(u,10,i),a=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=m?`0p+0`:`0`;else{if(o<0?a--:(e=new p(e),e.d=d,e.e=a,e=dn(e,f,n,r,0,i),d=e.d,a=e.e,l=Bt),o=d[n],s=i/2,l||=d[n+1]!==void 0,l=r<4?(o!==void 0||l)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||l||r===6&&d[n-1]&1||r===(e.s<0?8:7)),d.length=n,l)for(;++d[--n]>i-1;)d[n]=0,n||(++a,d.unshift(1));for(c=d.length;!d[c-1];--c);for(o=0,u=``;o<c;o++)u+=It.charAt(d[o]);if(m){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+=`0`;for(d=ln(u,i,t),c=d.length;!d[c-1];--c);for(o=1,u=`1.`;o<c;o++)u+=It.charAt(d[o])}else u=u.charAt(0)+`.`+u.slice(1);u=u+(a<0?`p`:`p+`)+a}else if(a<0){for(;++a;)u=`0`+u;u=`0.`+u}else if(++a>c)for(a-=c;a--;)u+=`0`;else a<c&&(u=u.slice(0,a)+`.`+u.slice(a))}u=(t==16?`0x`:t==2?`0b`:t==8?`0o`:``)+u}return e.s<0?`-`+u:u}function jn(e,t){if(e.length>t)return e.length=t,!0}function Mn(e){return new this(e).abs()}function Nn(e){return new this(e).acos()}function Pn(e){return new this(e).acosh()}function Fn(e,t){return new this(e).plus(t)}function In(e){return new this(e).asin()}function Ln(e){return new this(e).asinh()}function Rn(e){return new this(e).atan()}function zn(e){return new this(e).atanh()}function Bn(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=hn(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?hn(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=hn(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(dn(e,t,a,1)),t=hn(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(dn(e,t,a,1)),n}function Vn(e){return new this(e).cbrt()}function Hn(e){return W(e=new this(e),e.e+1,2)}function Un(e,t,n){return new this(e).clamp(t,n)}function Wn(e){if(!e||typeof e!=`object`)throw Error(Ut+`Object expected`);var t,n,r,i=e.defaults===!0,a=[`precision`,1,Ft,`rounding`,0,8,`toExpNeg`,-Pt,0,`toExpPos`,0,Pt,`maxE`,0,Pt,`minE`,-Pt,0,`modulo`,0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=zt[n]),(r=e[n])!==void 0)if(Jt(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Wt+n+`: `+r);if(n=`crypto`,i&&(this[n]=zt[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(Kt);else this[n]=!1;else throw Error(Wt+n+`: `+r);return this}function Gn(e){return new this(e).cos()}function Kn(e){return new this(e).cosh()}function qn(e){var t,n,r;function i(e){var t,n,r,a=this;if(!(a instanceof i))return new i(e);if(a.constructor=i,Qn(e)){a.s=e.s,Ht?!e.d||e.e>i.maxE?(a.e=NaN,a.d=null):e.e<i.minE?(a.e=0,a.d=[0]):(a.e=e.e,a.d=e.d.slice()):(a.e=e.e,a.d=e.d?e.d.slice():e.d);return}if(r=typeof e,r===`number`){if(e===0){a.s=1/e<0?-1:1,a.e=0,a.d=[0];return}if(e<0?(e=-e,a.s=-1):a.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;Ht?t>i.maxE?(a.e=NaN,a.d=null):t<i.minE?(a.e=0,a.d=[0]):(a.e=t,a.d=[e]):(a.e=t,a.d=[e]);return}if(e*0!=0){e||(a.s=NaN),a.e=NaN,a.d=null;return}return wn(a,e.toString())}if(r===`string`)return(n=e.charCodeAt(0))===45?(e=e.slice(1),a.s=-1):(n===43&&(e=e.slice(1)),a.s=1),$t.test(e)?wn(a,e):Tn(a,e);if(r===`bigint`)return e<0?(e=-e,a.s=-1):a.s=1,wn(a,e.toString());throw Error(Wt+e)}if(i.prototype=U,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Wn,i.clone=qn,i.isDecimal=Qn,i.abs=Mn,i.acos=Nn,i.acosh=Pn,i.add=Fn,i.asin=In,i.asinh=Ln,i.atan=Rn,i.atanh=zn,i.atan2=Bn,i.cbrt=Vn,i.ceil=Hn,i.clamp=Un,i.cos=Gn,i.cosh=Kn,i.div=Jn,i.exp=Yn,i.floor=Xn,i.hypot=Zn,i.ln=$n,i.log=er,i.log10=nr,i.log2=tr,i.max=rr,i.min=ir,i.mod=ar,i.mul=or,i.pow=sr,i.random=cr,i.round=lr,i.sign=ur,i.sin=dr,i.sinh=fr,i.sqrt=pr,i.sub=mr,i.sum=hr,i.tan=gr,i.tanh=_r,i.trunc=vr,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`maxE`,`minE`,`modulo`,`crypto`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function Jn(e,t){return new this(e).div(t)}function Yn(e){return new this(e).exp()}function Xn(e){return W(e=new this(e),e.e+1,3)}function Zn(){var e,t,n=new this(0);for(Ht=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return Ht=!0,new this(1/0);n=t}return Ht=!0,n.sqrt()}function Qn(e){return e instanceof yr||e&&e.toStringTag===qt||!1}function $n(e){return new this(e).ln()}function er(e,t){return new this(e).log(t)}function tr(e){return new this(e).log(2)}function nr(e){return new this(e).log(10)}function rr(){return bn(this,arguments,-1)}function ir(){return bn(this,arguments,1)}function ar(e,t){return new this(e).mod(t)}function or(e,t){return new this(e).mul(t)}function sr(e,t){return new this(e).pow(t)}function cr(e){var t,n,r,i,a=0,o=new this(1),s=[];if(e===void 0?e=this.precision:sn(e,1,Ft),r=Math.ceil(e/tn),!this.crypto)for(;a<r;)s[a++]=Math.random()*1e7|0;else if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else throw Error(Kt);for(r=s[--a],e%=tn,r&&e&&(i=Yt(10,tn-e),s[a]=(r/i|0)*i);s[a]===0;a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=tn)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<tn&&(n-=tn-r)}return o.e=n,o.d=s,o}function lr(e){return W(e=new this(e),e.e+1,this.rounding)}function ur(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function dr(e){return new this(e).sin()}function fr(e){return new this(e).sinh()}function pr(e){return new this(e).sqrt()}function mr(e,t){return new this(e).sub(t)}function hr(){var e=0,t=arguments,n=new this(t[e]);for(Ht=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return Ht=!0,W(n,this.precision,this.rounding)}function gr(e){return new this(e).tan()}function _r(e){return new this(e).tanh()}function vr(e){return W(e=new this(e),e.e+1,1)}U[Symbol.for(`nodejs.util.inspect.custom`)]=U.toString,U[Symbol.toStringTag]=`Decimal`;var yr=U.constructor=qn(zt);Lt=new yr(Lt),Rt=new yr(Rt);var br=V(`BigNumber`,[`?on`,`config`],e=>{var{on:t,config:n}=e,r=yr.clone({precision:n.precision,modulo:yr.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}),xr=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Sr=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},Cr=e=>{let t=Math.sin(.5*e);return-2*t*t},wr=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},Tr=function(){throw SyntaxError(`Invalid Param`)};function Er(e,t){let n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}var Dr={re:0,im:0},Or=function(e,t){let n=Dr;if(e==null)n.re=n.im=0;else if(t!==void 0)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 G.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 G.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):Tr();break;case`string`:n.im=n.re=0;let t=e.replace(/_/g,``).match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;t===null&&Tr();for(let e=0;e<t.length;e++){let a=t[e];a===` `||a===` `||a===`
|
|
9
|
+
`||(a===`+`?r++:a===`-`?i++:a===`i`||a===`I`?(r+i===0&&Tr(),t[e+1]!==` `&&!isNaN(t[e+1])?(n.im+=parseFloat((i%2?`-`:``)+t[e+1]),e++):n.im+=parseFloat((i%2?`-`:``)+`1`),r=i=0):((r+i===0||isNaN(a))&&Tr(),t[e+1]===`i`||t[e+1]===`I`?(n.im+=parseFloat((i%2?`-`:``)+a),e++):n.re+=parseFloat((i%2?`-`:``)+a),r=i=0))}r+i>0&&Tr();break;case`number`:n.im=0,n.re=e;break;default:Tr()}return isNaN(n.re)||isNaN(n.im),n};function G(e,t){if(!(this instanceof G))return new G(e,t);let n=Or(e,t);this.re=n.re,this.im=n.im}G.prototype={re:0,im:0,sign:function(){let e=wr(this.re,this.im);return new G(this.re/e,this.im/e)},add:function(e,t){let n=Or(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?G.NAN:G.INFINITY:new G(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=Or(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?G.NAN:G.INFINITY:new G(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=Or(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?G.NAN:r||i?G.INFINITY:n.im===0&&this.im===0?new G(this.re*n.re,0):new G(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=Or(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return G.NAN;if(o||r)return G.INFINITY;if(a||i)return G.ZERO;if(n.im===0)return new G(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new G((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{let e=n.im/n.re,t=n.im*e+n.re;return new G((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=Or(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return G.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new G(this.re**+n.re,0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new G(this.im**+n.re,0);case 1:return new G(0,this.im**+n.re);case 2:return new G(-(this.im**+n.re),0);case 3:return new G(0,-(this.im**+n.re))}}if(r&&n.re>0)return G.ZERO;let i=Math.atan2(this.im,this.re),a=Er(this.re,this.im),o=Math.exp(n.re*a-n.im*i),s=n.im*a+n.re*i;return new G(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(t===0)return e>=0?new G(Math.sqrt(e),0):new G(0,Math.sqrt(-e));let n=wr(e,t),r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new G(r,t<0?-i:i):new G(i,t<0?-r:r)},exp:function(){let e=Math.exp(this.re);return this.im===0?new G(e,0):new G(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,t=this.im;return new G(Math.expm1(e)*Math.cos(t)+Cr(t),Math.exp(e)*Math.sin(t))},log:function(){let e=this.re,t=this.im;return t===0&&e>0?new G(Math.log(e),0):new G(Er(e,t),Math.atan2(t,e))},abs:function(){return wr(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new G(Math.sin(e)*xr(t),Math.cos(e)*Sr(t))},cos:function(){let e=this.re,t=this.im;return new G(Math.cos(e)*xr(t),-Math.sin(e)*Sr(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+xr(t);return new G(Math.sin(e)/n,Sr(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-xr(t);return new G(-Math.sin(e)/n,Sr(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*xr(2*t)+.5*Math.cos(2*e);return new G(Math.cos(e)*xr(t)/n,Math.sin(e)*Sr(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*xr(2*t)-.5*Math.cos(2*e);return new G(Math.sin(e)*xr(t)/n,-Math.cos(e)*Sr(t)/n)},asin:function(){let e=this.re,t=this.im,n=new G(t*t-e*e+1,-2*e*t).sqrt(),r=new G(n.re-t,n.im+e).log();return new G(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new G(t*t-e*e+1,-2*e*t).sqrt(),r=new G(n.re-t,n.im+e).log();return new G(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(e===0){if(t===1)return new G(0,1/0);if(t===-1)return new G(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new G((1-t*t-e*e)/n,-2*e/n).log();return new G(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(t===0)return new G(Math.atan2(1,e),0);let n=e*e+t*t;return n===0?new G(e===0?0:e/0,t===0?0:-t/0).atan():new G(e/n,-t/n).atan()},asec:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new G(0,1/0);let n=e*e+t*t;return n===0?new G(e===0?0:e/0,t===0?0:-t/0).acos():new G(e/n,-t/n).acos()},acsc:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new G(Math.PI/2,1/0);let n=e*e+t*t;return n===0?new G(e===0?0:e/0,t===0?0:-t/0).asin():new G(e/n,-t/n).asin()},sinh:function(){let e=this.re,t=this.im;return new G(Sr(e)*Math.cos(t),xr(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new G(xr(e)*Math.cos(t),Sr(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=xr(e)+Math.cos(t);return new G(Sr(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=xr(e)-Math.cos(t);return new G(Sr(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-xr(2*e);return new G(-2*Sr(e)*Math.cos(t)/n,2*xr(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+xr(2*e);return new G(2*xr(e)*Math.cos(t)/n,-2*Sr(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new G(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new G(e<0?-n:n,0)}let n=new G(e*e-t*t+1,2*e*t).sqrt();return new G(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(t===0){if(e>1)return new G(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new G(Math.log(-e+t),Math.PI)}return new G(0,Math.acos(e))}let n=new G(e-1,t).sqrt(),r=new G(e+1,t).sqrt();return new G(e+n.re*r.re-n.im*r.im,t+n.re*r.im+n.im*r.re).log()},atanh:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new G(0,0);if(e===1)return new G(1/0,0);if(e===-1)return new G(-1/0,0);if(-1<e&&e<1)return new G(.5*Math.log((1+e)/(1-e)),0);if(e>1){let t=(e+1)/(e-1);return new G(.5*Math.log(t),-Math.PI/2)}let t=(1+e)/(1-e);return new G(.5*Math.log(-t),Math.PI/2)}let n=1-e,r=1+e,i=n*n+t*t;if(i===0)return new G(e===-1?0:e/0,t===0?0:t/0);let a=(r*n-t*t)/i,o=(t*n+r*t)/i;return new G(Er(a,o)/2,Math.atan2(o,a)/2)},acoth:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new G(0,Math.PI/2);let n=e*e+t*t;return n===0?new G(e===0?0:e/0,t===0?0:-t/0).atanh():new G(e/n,-t/n).atanh()},acsch:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new G(1/0,0);let t=1/e;return new G(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return n===0?new G(e===0?0:e/0,t===0?0:-t/0).asinh():new G(e/n,-t/n).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return G.INFINITY;let n=e*e+t*t;return n===0?new G(e===0?0:e/0,t===0?0:-t/0).acosh():new G(e/n,-t/n).acosh()},inverse:function(){if(this.isZero())return G.INFINITY;if(this.isInfinite())return G.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new G(e/n,-t/n)},conjugate:function(){return new G(this.re,-this.im)},neg:function(){return new G(-this.re,-this.im)},ceil:function(e){return e=10**(e||0),new G(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=10**(e||0),new G(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=10**(e||0),new G(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=Or(e,t);return Math.abs(n.re-this.re)<=G.EPSILON&&Math.abs(n.im-this.im)<=G.EPSILON},clone:function(){return new G(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n=``;return this.isNaN()?`NaN`:this.isInfinite()?`Infinity`:(Math.abs(e)<G.EPSILON&&(e=0),Math.abs(t)<G.EPSILON&&(t=0),t===0?n+e:(e===0?t<0&&(t=-t,n+=`-`):(n+=e,n+=` `,t<0?(t=-t,n+=`-`):n+=`+`,n+=` `),t!==1&&(n+=t),n+`i`))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},G.ZERO=new G(0,0),G.ONE=new G(1,0),G.I=new G(0,1),G.PI=new G(Math.PI,0),G.E=new G(Math.E,0),G.INFINITY=new G(1/0,1/0),G.NAN=new G(NaN,NaN),G.EPSILON=1e-15;var kr=V(`Complex`,[],()=>(Object.defineProperty(G,"name",{value:`Complex`}),G.prototype.constructor=G,G.prototype.type=`Complex`,G.prototype.isComplex=!0,G.prototype.toJSON=function(){return{mathjs:`Complex`,re:this.re,im:this.im}},G.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},G.prototype.format=function(e){var t=``,n=this.im,r=this.re,i=ot(this.re,e),a=ot(this.im,e),o=D(e)?e:e?e.precision:null;if(o!==null){var s=10**-o;Math.abs(r/n)<s&&(r=0),Math.abs(n/r)<s&&(n=0)}return t=n===0?i:r===0?n===1?`i`:n===-1?`-i`:a+`i`:n<0?n===-1?i+` - i`:i+` - `+a.substring(1)+`i`:n===1?i+` + i`:i+` + `+a+`i`,t},G.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if(typeof t==`object`)return G(t);throw TypeError(`Input has to be an object with r and phi keys.`);case 2:var n=arguments[0],r=arguments[1];if(D(n)){if(M(r)&&r.hasBase(`ANGLE`)&&(r=r.toNumber(`rad`)),D(r))return new G({r:n,phi:r});throw TypeError(`Phi is not a number nor an angle unit.`)}throw TypeError(`Radius r is not a number.`);default:throw SyntaxError(`Wrong number of arguments in function fromPolar`)}},G.prototype.valueOf=G.prototype.toString,G.fromJSON=function(e){return new G(e)},G.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},G),{isClass:!0});typeof BigInt>`u`&&(BigInt=function(e){if(isNaN(e))throw Error(``);return e});var K=BigInt(0),Ar=BigInt(1),jr=BigInt(2),Mr=BigInt(3),Nr=BigInt(5),Pr=BigInt(10);BigInt(2**53-1);var Fr=2e3,q={s:Ar,n:K,d:Ar};function Ir(e,t){try{e=BigInt(e)}catch{throw Jr()}return e*t}function Lr(e){return typeof e==`bigint`?e:Math.floor(e)}function Rr(e,t){if(t===K)throw qr();let n=Object.create(Kr.prototype);n.s=e<K?-Ar:Ar,e=e<K?-e:e;let r=Gr(e,t);return n.n=e/r,n.d=t/r,n}var zr=[jr*jr,jr,jr*jr,jr,jr*jr,jr*Mr,jr,jr*Mr];function Br(e){let t=Object.create(null);if(e<=Ar)return t[e]=Ar,t;let n=e=>{t[e]=(t[e]||K)+Ar};for(;e%jr===K;)n(jr),e/=jr;for(;e%Mr===K;)n(Mr),e/=Mr;for(;e%Nr===K;)n(Nr),e/=Nr;for(let t=0,r=jr+Nr;r*r<=e;){for(;e%r===K;)n(r),e/=r;r+=zr[t],t=t+1&7}return e>Ar&&n(e),t}var Vr=function(e,t){let n=K,r=Ar,i=Ar;if(e!=null)if(t!==void 0){if(typeof e==`bigint`)n=e;else if(isNaN(e))throw Jr();else if(e%1!=0)throw Yr();else n=BigInt(e);if(typeof t==`bigint`)r=t;else if(isNaN(t))throw Jr();else if(t%1!=0)throw Yr();else r=BigInt(t);i=n*r}else if(typeof e==`object`){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(typeof e==`bigint`)n=e;else throw Jr();i=n*r}else if(typeof e==`number`){if(isNaN(e))throw Jr();if(e<0&&(i=-Ar,e=-e),e%1==0)n=BigInt(e);else{let t=1,i=0,a=1,o=1,s=1,c=1e7;for(e>=1&&(t=10**Math.floor(1+Math.log10(e)),e/=t);a<=c&&s<=c;){let t=(i+o)/(a+s);if(e===t){a+s<=c?(n=i+o,r=a+s):s>a?(n=o,r=s):(n=i,r=a);break}e>t?(i+=o,a+=s):(o+=i,s+=a),a>c?(n=o,r=s):(n=i,r=a)}n=BigInt(n)*BigInt(t),r=BigInt(r)}}else if(typeof e==`string`){let t=0,a=K,o=K,s=K,c=Ar,l=Ar,u=e.replace(/_/g,``).match(/\d+|./g);if(u===null)throw Jr();if(u[t]===`-`?(i=-Ar,t++):u[t]===`+`&&t++,u.length===t+1?o=Ir(u[t++],i):u[t+1]===`.`||u[t]===`.`?(u[t]!==`.`&&(a=Ir(u[t++],i)),t++,(t+1===u.length||u[t+1]===`(`&&u[t+3]===`)`||u[t+1]===`'`&&u[t+3]===`'`)&&(o=Ir(u[t],i),c=Pr**BigInt(u[t].length),t++),(u[t]===`(`&&u[t+2]===`)`||u[t]===`'`&&u[t+2]===`'`)&&(s=Ir(u[t+1],i),l=Pr**BigInt(u[t+1].length)-Ar,t+=3)):u[t+1]===`/`||u[t+1]===`:`?(o=Ir(u[t],i),c=Ir(u[t+2],Ar),t+=3):u[t+3]===`/`&&u[t+1]===` `&&(a=Ir(u[t],i),o=Ir(u[t+2],i),c=Ir(u[t+4],Ar),t+=5),u.length<=t)r=c*l,i=n=s+r*a+l*o;else throw Jr()}else if(typeof e==`bigint`)n=e,i=e,r=Ar;else throw Jr();if(r===K)throw qr();q.s=i<K?-Ar:Ar,q.n=n<K?-n:n,q.d=r<K?-r:r};function Hr(e,t,n){let r=Ar;for(;t>K;e=e*e%n,t>>=Ar)t&Ar&&(r=r*e%n);return r}function Ur(e,t){for(;t%jr===K;t/=jr);for(;t%Nr===K;t/=Nr);if(t===Ar)return K;let n=Pr%t,r=1;for(;n!==Ar;r++)if(n=n*Pr%t,r>Fr)return K;return BigInt(r)}function Wr(e,t,n){let r=Ar,i=Hr(Pr,n,t);for(let e=0;e<300;e++){if(r===i)return BigInt(e);r=r*Pr%t,i=i*Pr%t}return 0}function Gr(e,t){if(!e)return t;if(!t)return e;for(;;){if(e%=t,!e)return t;if(t%=e,!t)return e}}function Kr(e,t){if(Vr(e,t),this instanceof Kr)e=Gr(q.d,q.n),this.s=q.s,this.n=q.n/e,this.d=q.d/e;else return Rr(q.s*q.n,q.d)}var qr=function(){return Error(`Division by Zero`)},Jr=function(){return Error(`Invalid argument`)},Yr=function(){return Error(`Parameters must be integer`)};Kr.prototype={s:Ar,n:K,d:Ar,abs:function(){return Rr(this.n,this.d)},neg:function(){return Rr(-this.s*this.n,this.d)},add:function(e,t){return Vr(e,t),Rr(this.s*this.n*q.d+q.s*this.d*q.n,this.d*q.d)},sub:function(e,t){return Vr(e,t),Rr(this.s*this.n*q.d-q.s*this.d*q.n,this.d*q.d)},mul:function(e,t){return Vr(e,t),Rr(this.s*q.s*this.n*q.n,this.d*q.d)},div:function(e,t){return Vr(e,t),Rr(this.s*q.s*this.n*q.d,this.d*q.n)},clone:function(){return Rr(this.s*this.n,this.d)},mod:function(e,t){if(e===void 0)return Rr(this.s*this.n%this.d,Ar);if(Vr(e,t),K===q.n*this.d)throw qr();return Rr(this.s*(q.d*this.n)%(q.n*this.d),q.d*this.d)},gcd:function(e,t){return Vr(e,t),Rr(Gr(q.n,this.n)*Gr(q.d,this.d),q.d*this.d)},lcm:function(e,t){return Vr(e,t),q.n===K&&this.n===K?Rr(K,Ar):Rr(q.n*this.n,Gr(q.n,this.n)*Gr(q.d,this.d))},inverse:function(){return Rr(this.s*this.d,this.n)},pow:function(e,t){if(Vr(e,t),q.d===Ar)return q.s<K?Rr((this.s*this.d)**q.n,this.n**q.n):Rr((this.s*this.n)**q.n,this.d**q.n);if(this.s<K)return null;let n=Br(this.n),r=Br(this.d),i=Ar,a=Ar;for(let e in n)if(e!==`1`){if(e===`0`){i=K;break}if(n[e]*=q.n,n[e]%q.d===K)n[e]/=q.d;else return null;i*=BigInt(e)**n[e]}for(let e in r)if(e!==`1`){if(r[e]*=q.n,r[e]%q.d===K)r[e]/=q.d;else return null;a*=BigInt(e)**r[e]}return q.s<K?Rr(a,i):Rr(i,a)},log:function(e,t){if(Vr(e,t),this.s<=K||q.s<=K)return null;let n=Object.create(null),r=Br(q.n),i=Br(q.d),a=Br(this.n),o=Br(this.d);for(let e in i)r[e]=(r[e]||K)-i[e];for(let e in o)a[e]=(a[e]||K)-o[e];for(let e in r)e!==`1`&&(n[e]=!0);for(let e in a)e!==`1`&&(n[e]=!0);let s=null,c=null;for(let e in n){let t=r[e]||K,n=a[e]||K;if(t===K){if(n!==K)return null;continue}let i=n,o=t,l=Gr(i,o);if(i/=l,o/=l,s===null&&c===null)s=i,c=o;else if(i*c!==s*o)return null}return s!==null&&c!==null?Rr(s,c):null},equals:function(e,t){return Vr(e,t),this.s*this.n*q.d===q.s*q.n*this.d},lt:function(e,t){return Vr(e,t),this.s*this.n*q.d<q.s*q.n*this.d},lte:function(e,t){return Vr(e,t),this.s*this.n*q.d<=q.s*q.n*this.d},gt:function(e,t){return Vr(e,t),this.s*this.n*q.d>q.s*q.n*this.d},gte:function(e,t){return Vr(e,t),this.s*this.n*q.d>=q.s*q.n*this.d},compare:function(e,t){Vr(e,t);let n=this.s*this.n*q.d-q.s*q.n*this.d;return(K<n)-(n<K)},ceil:function(e){return e=Pr**BigInt(e||0),Rr(Lr(this.s*e*this.n/this.d)+(e*this.n%this.d>K&&this.s>=K?Ar:K),e)},floor:function(e){return e=Pr**BigInt(e||0),Rr(Lr(this.s*e*this.n/this.d)-(e*this.n%this.d>K&&this.s<K?Ar:K),e)},round:function(e){return e=Pr**BigInt(e||0),Rr(Lr(this.s*e*this.n/this.d)+this.s*((this.s>=K?Ar:K)+jr*(e*this.n%this.d)>this.d?Ar:K),e)},roundTo:function(e,t){Vr(e,t);let n=this.n*q.d,r=this.d*q.n,i=n%r,a=Lr(n/r);return i+i>=r&&a++,Rr(this.s*a*q.n,q.d)},divisible:function(e,t){return Vr(e,t),q.n!==K&&this.n*q.d%(q.n*this.d)===K},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,n=this.d,r=Ur(t,n),i=Wr(t,n,r),a=this.s<K?`-`:``;if(a+=Lr(t/n),t%=n,t*=Pr,t&&(a+=`.`),r){for(let e=i;e--;)a+=Lr(t/n),t%=n,t*=Pr;a+=`(`;for(let e=r;e--;)a+=Lr(t/n),t%=n,t*=Pr;a+=`)`}else for(let r=e;t&&r--;)a+=Lr(t/n),t%=n,t*=Pr;return a},toFraction:function(e=!1){let t=this.n,n=this.d,r=this.s<K?`-`:``;if(n===Ar)r+=t;else{let i=Lr(t/n);e&&i>K&&(r+=i,r+=` `,t%=n),r+=t,r+=`/`,r+=n}return r},toLatex:function(e=!1){let t=this.n,n=this.d,r=this.s<K?`-`:``;if(n===Ar)r+=t;else{let i=Lr(t/n);e&&i>K&&(r+=i,t%=n),r+=`\\frac{`,r+=t,r+=`}{`,r+=n,r+=`}`}return r},toContinued:function(){let e=this.n,t=this.d,n=[];for(;t;){n.push(Lr(e/t));let r=e%t;e=t,t=r}return n},simplify:function(e=.001){let t=BigInt(Math.ceil(1/e)),n=this.abs(),r=n.toContinued();for(let e=1;e<r.length;e++){let i=Rr(r[e-1],Ar);for(let t=e-2;t>=0;t--)i=i.inverse().add(r[t]);let a=i.sub(n);if(a.n*t<a.d)return i.mul(this.s)}return this}};var Xr=V(`Fraction`,[],()=>(Object.defineProperty(Kr,"name",{value:`Fraction`}),Kr.prototype.constructor=Kr,Kr.prototype.type=`Fraction`,Kr.prototype.isFraction=!0,Kr.prototype.toJSON=function(){return{mathjs:`Fraction`,n:String(this.s*this.n),d:String(this.d)}},Kr.fromJSON=function(e){return new Kr(e)},Kr),{isClass:!0}),Zr=V(`Range`,[],()=>{function e(t,n,r){if(!(this instanceof e))throw SyntaxError(`Constructor must be called with the new operator`);var i=t!=null,a=n!=null,o=r!=null;if(i){if(O(t))t=t.toNumber();else if(typeof t!=`number`&&!k(t))throw TypeError(`Parameter start must be a number or bigint`)}if(a){if(O(n))n=n.toNumber();else if(typeof n!=`number`&&!k(n))throw TypeError(`Parameter end must be a number or bigint`)}if(o){if(O(r))r=r.toNumber();else if(typeof r!=`number`&&!k(r))throw TypeError(`Parameter step must be a number or bigint`)}if(this.start=i?parseFloat(t):0,this.end=a?parseFloat(n):0,this.step=o?parseFloat(r):1,o&>(this.step,0))throw Error(`Step must not be zero`)}return e.prototype.type=`Range`,e.prototype.isRange=!0,e.parse=function(t){if(typeof t!=`string`)return null;var 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(){var e=0,t=this.start,n=this.step,r=this.end-t;return $e(n)===$e(r)?e=Math.ceil(r/n):r===0&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start:this.start+(e-1)*this.step},e.prototype.max=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start+(e-1)*this.step:this.start},e.prototype.forEach=function(e){var t=this.start,n=this.step,r=this.end,i=0;if(n>0)for(;t<r;)e(t,[i],this),t+=n,i++;else if(n<0)for(;t>r;)e(t,[i],this),t+=n,i++},e.prototype.map=function(e){var t=[];return this.forEach(function(n,r,i){t[r[0]]=e(n,r,i)}),t},e.prototype.toArray=function(){var e=[];return this.forEach(function(t,n){e[n[0]]=t}),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=ot(this.start,e);return this.step!==1&&(t+=`:`+ot(this.step,e)),t+=`:`+ot(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}),Qr=V(`Matrix`,[],()=>{function e(){if(!(this instanceof e))throw SyntaxError(`Constructor must be called with the new operator`)}return e.prototype.type=`Matrix`,e.prototype.isMatrix=!0,e.prototype.storage=function(){throw Error(`Cannot invoke storage on a Matrix interface`)},e.prototype.datatype=function(){throw Error(`Cannot invoke datatype on a Matrix interface`)},e.prototype.create=function(e,t){throw Error(`Cannot invoke create on a Matrix interface`)},e.prototype.subset=function(e,t,n){throw Error(`Cannot invoke subset on a Matrix interface`)},e.prototype.get=function(e){throw Error(`Cannot invoke get on a Matrix interface`)},e.prototype.set=function(e,t,n){throw Error(`Cannot invoke set on a Matrix interface`)},e.prototype.resize=function(e,t){throw Error(`Cannot invoke resize on a Matrix interface`)},e.prototype.reshape=function(e,t){throw Error(`Cannot invoke reshape on a Matrix interface`)},e.prototype.clone=function(){throw Error(`Cannot invoke clone on a Matrix interface`)},e.prototype.size=function(){throw Error(`Cannot invoke size on a Matrix interface`)},e.prototype.map=function(e,t){throw Error(`Cannot invoke map on a Matrix interface`)},e.prototype.forEach=function(e){throw Error(`Cannot invoke forEach on a Matrix interface`)},e.prototype[Symbol.iterator]=function(){throw Error(`Cannot iterate a Matrix interface`)},e.prototype.toArray=function(){throw Error(`Cannot invoke toArray on a Matrix interface`)},e.prototype.valueOf=function(){throw Error(`Cannot invoke valueOf on a Matrix interface`)},e.prototype.format=function(e){throw Error(`Cannot invoke format on a Matrix interface`)},e.prototype.toString=function(){throw Error(`Cannot invoke toString on a Matrix interface`)},e},{isClass:!0});function $r(e,t,n){var r=e.constructor,i=new r(2),a=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!H(n))throw Error(`size must be an integer`);if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!e.isInteger())throw Error(`Value must be an integer`);e.lessThan(0)&&(e=e.add(i.pow(n))),a=`i${n}`}switch(t){case 2:return`${e.toBinary()}${a}`;case 8:return`${e.toOctal()}${a}`;case 16:return`${e.toHexadecimal()}${a}`;default:throw Error(`Base ${t} not supported `)}}function ei(e,t){if(typeof t==`function`)return t(e);if(!e.isFinite())return e.isNaN()?`NaN`:e.gt(0)?`Infinity`:`-Infinity`;var{notation:n,precision:r,wordSize:i}=st(t);switch(n){case`fixed`:return ri(e,r);case`exponential`:return ni(e,r);case`engineering`:return ti(e,r);case`bin`:return $r(e,2,i);case`oct`:return $r(e,8,i);case`hex`:return $r(e,16,i);case`auto`:var a=ii(t?.lowerExp,-3),o=ii(t?.upperExp,5);if(e.isZero())return`0`;var s,c=e.toSignificantDigits(r),l=c.e;return s=l>=a&&l<o?c.toFixed():ni(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function ti(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,i=e.mul(10**-r).toPrecision(t);if(i.includes(`e`)){var a=e.constructor;i=new a(i).toFixed()}return i+`e`+(n>=0?`+`:``)+r.toString()}function ni(e,t){return t===void 0?e.toExponential():e.toExponential(t-1)}function ri(e,t){return e.toFixed(t)}function ii(e,t){return D(e)?e:O(e)?e.toNumber():t}function ai(e,t){var n=e.length-t.length,r=e.length;return e.substring(n,r)===t}function oi(e,t){var n=si(e,t);return t&&typeof t==`object`&&`truncate`in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+`...`:n}function si(e,t){return typeof e==`number`?ot(e,t):O(e)?ei(e,t):fi(e)?!t||t.fraction!==`decimal`?`${e.s*e.n}/${e.d}`:e.toString():Array.isArray(e)?di(e,t):N(e)?ci(e):typeof e==`function`?e.syntax?String(e.syntax):`function`:e&&typeof e==`object`?typeof e.format==`function`?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):`{`+Object.keys(e).map(n=>ci(n)+`: `+oi(e[n],t)).join(`, `)+`}`:String(e)}function ci(e){for(var t=String(e),n=``,r=0;r<t.length;){var i=t.charAt(r);n+=i in li?li[i]:i,r++}return`"`+n+`"`}var li={'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`};function ui(e){var t=String(e);return t=t.replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/</g,`<`).replace(/>/g,`>`),t}function di(e,t){if(Array.isArray(e)){for(var n=`[`,r=e.length,i=0;i<r;i++)i!==0&&(n+=`, `),n+=di(e[i],t);return n+=`]`,n}return oi(e,t)}function fi(e){return e&&typeof e==`object`&&typeof e.s==`bigint`&&typeof e.n==`bigint`&&typeof e.d==`bigint`||!1}function pi(e,t){if(!N(e))throw TypeError(`Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: `+Me(e)+`, index: 0)`);if(!N(t))throw TypeError(`Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: `+Me(t)+`, index: 1)`);return e===t?0:e>t?1:-1}function mi(e,t,n){if(!(this instanceof mi))throw 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=Error().stack}mi.prototype=RangeError(),mi.prototype.constructor=RangeError,mi.prototype.name=`DimensionError`,mi.prototype.isDimensionError=!0;function hi(e,t,n){if(!(this instanceof hi))throw 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),this.message=this.min!==void 0&&this.index<this.min?`Index out of range (`+this.index+` < `+this.min+`)`:this.max!==void 0&&this.index>=this.max?`Index out of range (`+this.index+` > `+(this.max-1)+`)`:`Index out of range (`+this.index+`)`,this.stack=Error().stack}hi.prototype=RangeError(),hi.prototype.constructor=RangeError,hi.prototype.name=`IndexError`,hi.prototype.isIndexError=!0;function gi(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function _i(e,t,n){var r,i=e.length;if(i!==t[n])throw new mi(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new mi(t.length-1,t.length,`<`);_i(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new mi(t.length+1,t.length,`>`)}function vi(e,t){if(t.length===0){if(Array.isArray(e))throw new mi(e.length,0)}else _i(e,t,0)}function yi(e,t){var n=e.isMatrix?e._size:gi(e);t._sourceSize.forEach((e,t)=>{if(e!==null&&e!==n[t])throw new mi(e,n[t])})}function bi(e,t){if(e!==void 0){if(!D(e)||!H(e))throw TypeError(`Index must be an integer (value: `+e+`)`);if(e<0||typeof t==`number`&&e>=t)throw new hi(e,t)}}function xi(e){for(var t=0;t<e._dimensions.length;++t){var n=e._dimensions[t];if(n._data&&P(n._data)){if(n._size[0]===0)return!0}else if(n.isRange){if(n.start===n.end)return!0}else if(N(n)&&n.length===0)return!0}return!1}function Si(e,t,n){if(!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw Error(`Resizing to scalar is not supported`);return t.forEach(function(e){if(!D(e)||!H(e)||e<0)throw TypeError(`Invalid size, must contain positive integers (size: `+oi(t)+`)`)}),(D(e)||O(e))&&(e=[e]),Ci(e,t,0,n===void 0?0:n),e}function Ci(e,t,n,r){var i,a,o=e.length,s=t[n],c=Math.min(o,s);if(e.length=s,n<t.length-1){var l=n+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Ci(a,t,l,r);for(i=c;i<s;i++)a=[],e[i]=a,Ci(a,t,l,r)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<s;i++)e[i]=r}}function wi(e,t){var n=Mi(e,!0),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw new mi(0,r,`!=`);t=Ti(t,r);var i=Ei(t);if(r!==i)throw new mi(i,r,`!=`);try{return Di(n,t)}catch(e){throw e instanceof mi?new mi(i,r,`!=`):e}}function Ti(e,t){var n=Ei(e),r=e.slice(),i=-1,a=e.indexOf(i);if(e.indexOf(i,a+1)>=0)throw Error(`More than one wildcard in sizes`);var o=a>=0,s=t%n===0;if(o)if(s)r[a]=-t/n;else throw Error(`Could not replace wildcard, since `+t+` is no multiple of `+-n);return r}function Ei(e){return e.reduce((e,t)=>e*t,1)}function Di(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,s=0;s<o;s++)r.push(n.slice(s*a,(s+1)*a));n=r}return n}function Oi(e,t){for(var n=t||gi(e);Array.isArray(e)&&e.length===1;)e=e[0],n.shift();for(var r=n.length;n[r-1]===1;)r--;return r<n.length&&(e=ki(e,r,0),n.length=r),e}function ki(e,t,n){var r,i;if(n<t){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=ki(e[r],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function Ai(e,t,n,r){var i=r||gi(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=ji(e,t,0);i.length<t;)i.push(1);return e}function ji(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=ji(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Mi(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(!Array.isArray(e))return e;if(typeof t!=`boolean`)throw TypeError(`Boolean expected for second argument of flatten`);var n=[];return t?i(e):r(e),n;function r(e){for(var t=0;t<e.length;t++){var i=e[t];Array.isArray(i)?r(i):n.push(i)}}function i(e){if(Array.isArray(e[0]))for(var t=0;t<e.length;t++)i(e[t]);else for(var r=0;r<e.length;r++)n.push(e[r])}}function Ni(e,t){return Array.prototype.map.call(e,t)}function Pi(e,t){Array.prototype.forEach.call(e,t)}function Fi(e,t){if(gi(e).length!==1)throw Error(`Only one dimensional matrices supported`);return Array.prototype.filter.call(e,t)}function Ii(e,t){if(gi(e).length!==1)throw Error(`Only one dimensional matrices supported`);return Array.prototype.filter.call(e,e=>t.test(e))}function Li(e,t){return Array.prototype.join.call(e,t)}function Ri(e){if(!Array.isArray(e))throw TypeError(`Array input expected`);if(e.length===0)return e;var t=[],n=0;t[0]={value:e[0],identifier:0};for(var r=1;r<e.length;r++)e[r]===e[r-1]?n++:n=0,t.push({value:e[r],identifier:n});return t}function zi(e){if(!Array.isArray(e))throw TypeError(`Array input expected`);if(e.length===0)return e;for(var t=[],n=0;n<e.length;n++)t.push(e[n].value);return t}function Bi(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var s=o?Bi(a,t):t(a);if(n===void 0)n=s;else if(n!==s)return`mixed`}return n}function Vi(e,t,n,r){if(r<n){if(e.length!==t.length)throw new mi(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=Vi(e[a],t[a],n,r+1);return i}return e.concat(t)}function Hi(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,n){return Vi(e,n,t,0)},e[0]);throw Error(`Wrong number of arguments in function concat`)}function Ui(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(e=>e.length),i=Math.max(...r),a=Array(i).fill(null),o=0;o<t.length;o++)for(var s=t[o],c=r[o],l=0;l<c;l++){var u=i-c+l;s[l]>a[u]&&(a[u]=s[l])}for(var d=0;d<t.length;d++)Wi(t[d],a);return a}function Wi(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw Error(`shape mismatch: mismatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[a]}`)}}function Gi(e,t){var n=gi(e);if(Le(n,t))return e;Wi(n,t);var r=Ui(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=Xi(e);n.length<i&&(o=wi(o,a),n=gi(o));for(var s=0;s<i;s++)n[s]<r[s]&&(o=Ki(o,r[s],s),n=gi(o));return o}function Ki(e,t,n){return Hi(...Array(t).fill(e),n)}function qi(e,t){if(!Array.isArray(e))throw Error(`Array expected`);if(!Array.isArray(t))throw Error(`Array expected for index`);var n=gi(e);if(t.length!==n.length)throw new mi(t.length,n.length);for(var r=0;r<t.length;r++)bi(t[r],n[r]);return t.reduce((e,t)=>e[t],e)}function Ji(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e.length===0)return[];if(n)return a(e);var r=[];return i(e,0);function i(n,a){if(Array.isArray(n)){for(var o=n.length,s=Array(o),c=0;c<o;c++)r[a]=c,s[c]=i(n[c],a+1);return s}return t(n,r.slice(0,a),e)}function a(e){if(Array.isArray(e)){for(var n=e.length,r=Array(n),i=0;i<n;i++)r[i]=a(e[i]);return r}return t(e)}}function Yi(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(e.length===0)return;if(n){a(e);return}var r=[];i(e,0);function i(n,a){if(Array.isArray(n))for(var o=n.length,s=0;s<o;s++)r[a]=s,i(n[s],a+1);else t(n,r.slice(0,a),e)}function a(e){if(Array.isArray(e))for(var n=e.length,r=0;r<n;r++)a(e[r]);else t(e)}}function Xi(e){return u([],e)}function Zi(e,t,n,r){if(Et.default.isTypedFunction(e)){var i;if(r)i=1;else{var a=t.isMatrix?t.size():gi(t);if(!a.length||a[a.length-1]===0)return{isUnary:r,fn:e};var o=a.map(()=>0);i=ea(e,t.isMatrix?t.get(o):qi(t,o),o,t)}var s;if(t.isMatrix&&t.dataType!==`mixed`&&t.dataType!==void 0){var c=Qi(e,i);s=c===void 0?e:c}else s=e;return i>=1&&i<=3?{isUnary:i===1,fn:function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];return ta(s,r.slice(0,i),n,e.name)}}:{isUnary:!1,fn:function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];return ta(s,r,n,e.name)}}}return r===void 0?{isUnary:$i(e),fn:e}:{isUnary:r,fn:e}}function Qi(e,t){var n=[];if(Object.entries(e.signatures).forEach(e=>{var[r,i]=e;r.split(`,`).length===t&&n.push(i)}),n.length===1)return n[0]}function $i(e){if(e.length!==1)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var n=t.match(/\(.*?\)/);return!/\.\.\./.test(n)}function ea(e,t,n,r){for(var i=[t,n,r],a=3;a>0;a--){var o=i.slice(0,a);if(Et.default.resolve(e,o)!==null)return a}}function ta(e,t,n,r){try{return e(...t)}catch(e){na(e,t,n,r)}}function na(e,t,n,r){if(e instanceof TypeError&&e.data?.category===`wrongType`){var i=[];throw i.push(`value: ${Me(t[0])}`),t.length>=2&&i.push(`index: ${Me(t[1])}`),t.length>=3&&i.push(`array: ${Me(t[2])}`),TypeError(`Function ${n} cannot apply callback arguments ${r}(${i.join(`, `)}) at index ${JSON.stringify(t[1])}`)}throw TypeError(`Function ${n} cannot apply callback arguments to function ${r}: ${e.message}`)}var ra=V(`DenseMatrix`,[`Matrix`,`config`],e=>{var{Matrix:t,config:n}=e;function r(e,t){if(!(this instanceof r))throw SyntaxError(`Constructor must be called with the new operator`);if(t&&!N(t))throw Error(`Invalid datatype: `+t);if(F(e))e.type===`DenseMatrix`?(this._data=Ne(e._data),this._size=Ne(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&P(e.data)&&P(e.size))this._data=e.data,this._size=e.size,vi(this._data,this._size),this._datatype=t||e.datatype;else if(P(e))this._data=u(e),this._size=gi(this._data),vi(this._data,this._size),this._datatype=t;else if(e)throw TypeError(`Unsupported type of data (`+Me(e)+`)`);else this._data=[],this._size=[0],this._datatype=t}r.prototype=new t,r.prototype.createDenseMatrix=function(e,t){return new r(e,t)},Object.defineProperty(r,"name",{value:`DenseMatrix`}),r.prototype.constructor=r,r.prototype.type=`DenseMatrix`,r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return Bi(this._data,Me)},r.prototype.storage=function(){return`dense`},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(e,t){return new r(e,t)},r.prototype.subset=function(e,t,n){switch(arguments.length){case 1:return i(this,e);case 2:case 3:return o(this,e,t,n);default:throw SyntaxError(`Wrong number of arguments`)}},r.prototype.get=function(e){return qi(this._data,e)},r.prototype.set=function(e,t,n){if(!P(e))throw TypeError(`Array expected`);if(e.length<this._size.length)throw new mi(e.length,this._size.length,`<`);var r,i,a,o=e.map(function(e){return e+1});l(this,o,n);var s=this._data;for(r=0,i=e.length-1;r<i;r++)a=e[r],bi(a,s.length),s=s[a];return a=e[e.length-1],bi(a,s.length),s[a]=t,this};function i(e,t){if(!ie(t))throw TypeError(`Invalid index`);if(n.legacySubset?t.size().every(e=>e===1):t.isScalar())return e.get(t.min());var i=t.size();if(i.length!==e._size.length)throw new mi(i.length,e._size.length);for(var o=t.min(),s=t.max(),c=0,l=e._size.length;c<l;c++)bi(o[c],e._size[c]),bi(s[c],e._size[c]);var u=new r,d=a(e._data,t);return u._size=d.size,u._datatype=e._datatype,u._data=d.data,n.legacySubset?u.reshape(t.size()):u}function a(e,t){var n=t.size().length-1,r=Array(n);return{data:i(e),size:r.filter(e=>e!==null)};function i(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=t.dimension(a);function s(e,t){return D(e)?t(e):e.map(t).valueOf()}return r[a]=D(o)?null:o.size()[0],a<n?s(o,t=>(bi(t,e.length),i(e[t],a+1))):s(o,t=>(bi(t,e.length),e[t]))}}function o(e,t,n,r){if(!t||t.isIndex!==!0)throw TypeError(`Invalid index`);var i=t.size(),a=t.isScalar(),o;if(F(n)?(o=n.size(),n=n.valueOf()):o=gi(n),a){if(o.length!==0)throw TypeError(`Scalar expected`);e.set(t.min(),n,r)}else{if(!Le(o,i)){if(o.length===0)n=Gi([n],i);else try{n=Gi(n,i)}catch{}o=gi(n)}if(i.length<e._size.length)throw new mi(i.length,e._size.length,`<`);if(o.length<i.length){for(var c=0,u=0;i[c]===1&&o[c]===1;)c++;for(;i[c]===1;)u++,c++;n=Ai(n,i.length,u,o)}if(!Le(i,o))throw new mi(i,o,`>`);l(e,t.max().map(function(e){return e+1}),r),s(e._data,t,n)}return e}function s(e,t,n){var r=t.size().length-1;i(e,n);function i(e,n){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=t.dimension(a),s=(t,r)=>{bi(t,e.length),i(e[t],n[r[0]],a+1)},c=(t,r)=>{bi(t,e.length),e[t]=n[r[0]]};a<r?D(o)?s(o,[0]):o.forEach(s):D(o)?c(o,[0]):o.forEach(c)}}r.prototype.resize=function(e,t,n){if(!ee(e))throw TypeError(`Array or Matrix expected`);var r=e.valueOf().map(e=>Array.isArray(e)&&e.length===1?e[0]:e);return c(n?this.clone():this,r,t)};function c(e,t,n){if(t.length===0){for(var r=e._data;P(r);)r=r[0];return r}return e._size=t.slice(0),e._data=Si(e._data,e._size,n),e}r.prototype.reshape=function(e,t){var n=t?this.clone():this;return n._data=wi(n._data,e),n._size=Ti(e,n._size.reduce((e,t)=>e*t)),n};function l(e,t,n){for(var r=e._size.slice(0),i=!1;r.length<t.length;)r.push(0),i=!0;for(var a=0,o=t.length;a<o;a++)t[a]>r[a]&&(r[a]=t[a],i=!0);i&&c(e,r,n)}r.prototype.clone=function(){return new r({data:Ne(this._data),size:Ne(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(e){arguments.length>1&&arguments[1]!==void 0&&arguments[1];var t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=this,r=n._size.length-1;if(r<0)return n.clone();var i=Zi(e,n,`map`,t),a=i.fn,o=n.create(void 0,n._datatype);if(o._size=n._size,t||i.isUnary)return o._data=f(n._data),o;if(r===0){for(var s=n.valueOf(),c=Array(s.length),l=0;l<s.length;l++)c[l]=a(s[l],[l],n);return o._data=c,o}var u=[];return o._data=d(n._data),o;function d(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Array(e.length);if(t<r)for(var o=0;o<e.length;o++)u[t]=o,i[o]=d(e[o],t+1);else for(var s=0;s<e.length;s++)u[t]=s,i[s]=a(e[s],u.slice(),n);return i}function f(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=Array(e.length);if(t<r)for(var i=0;i<e.length;i++)n[i]=f(e[i],t+1);else for(var o=0;o<e.length;o++)n[o]=a(e[o]);return n}},r.prototype.forEach=function(e){arguments.length>1&&arguments[1]!==void 0&&arguments[1];var t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=this,r=n._size.length-1;if(r<0)return;var i=Zi(e,n,`map`,t),a=i.fn;if(t||i.isUnary){l(n._data);return}if(r===0){for(var o=0;o<n._data.length;o++)a(n._data[o],[o],n);return}var s=[];c(n._data);function c(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(t<r)for(var i=0;i<e.length;i++)s[t]=i,c(e[i],t+1);else for(var o=0;o<e.length;o++)s[t]=o,a(e[o],s.slice(),n)}function l(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(t<r)for(var n=0;n<e.length;n++)l(e[n],t+1);else for(var i=0;i<e.length;i++)a(e[i])}},r.prototype[Symbol.iterator]=function*(){var e=this._size.length-1;if(!(e<0)){if(e===0){for(var t=0;t<this._data.length;t++)yield{value:this._data[t],index:[t]};return}for(var n=Array(e+1).fill(0),r=this._size.reduce((e,t)=>e*t,1),i=0;i<r;i++){for(var a=this._data,o=0;o<e;o++)a=a[n[o]];yield{value:a[n[e]],index:n.slice()};for(var s=e;s>=0&&(n[s]++,!(n[s]<this._size[s]));s--)n[s]=0}}},r.prototype.rows=function(){var e=[];if(this.size().length!==2)throw TypeError(`Rows can only be returned for a 2D matrix.`);for(var t of this._data)e.push(new r([t],this._datatype));return e},r.prototype.columns=function(){var e=this,t=[],n=this.size();if(n.length!==2)throw TypeError(`Rows can only be returned for a 2D matrix.`);for(var i=this._data,a=function(n){var a=i.map(e=>[e[n]]);t.push(new r(a,e._datatype))},o=0;o<n[1];o++)a(o);return t},r.prototype.toArray=function(){return Ne(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(e){return oi(this._data,e)},r.prototype.toString=function(){return oi(this._data)},r.prototype.toJSON=function(){return{mathjs:`DenseMatrix`,data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(e){if(e){if(O(e)&&(e=e.toNumber()),!D(e)||!H(e))throw TypeError(`The parameter k must be an integer number`)}else e=0;for(var t=e>0?e:0,n=e<0?-e:0,i=this._size[0],a=this._size[1],o=Math.min(i-n,a-t),s=[],c=0;c<o;c++)s[c]=this._data[c+n][c+t];return new r({data:s,size:[o],datatype:this._datatype})},r.diagonal=function(e,t,n,i){if(!P(e))throw TypeError(`Array expected, size parameter`);if(e.length!==2)throw Error(`Only two dimensions matrix are supported`);if(e=e.map(function(e){if(O(e)&&(e=e.toNumber()),!D(e)||!H(e)||e<1)throw Error(`Size values must be positive integers`);return e}),n){if(O(n)&&(n=n.toNumber()),!D(n)||!H(n))throw TypeError(`The parameter k must be an integer number`)}else n=0;var a=n>0?n:0,o=n<0?-n:0,s=e[0],c=e[1],l=Math.min(s-o,c-a),u;if(P(t)){if(t.length!==l)throw Error(`Invalid value array length`);u=function(e){return t[e]}}else if(F(t)){var d=t.size();if(d.length!==1||d[0]!==l)throw Error(`Invalid matrix length`);u=function(e){return t.get([e])}}else u=function(){return t};i||=O(u(0))?u(0).mul(0):0;var f=[];if(e.length>0){f=Si(f,e,i);for(var p=0;p<l;p++)f[p+o][p+a]=u(p)}return new r({data:f,size:[s,c]})},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(e,t){if(!D(e)||!H(e)||!D(t)||!H(t))throw Error(`Row index must be positive integers`);if(this._size.length!==2)throw Error(`Only two dimensional matrix is supported`);return bi(e,this._size[0]),bi(t,this._size[0]),r._swapRows(e,t,this._data),this},r._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r};function u(e){return F(e)?u(e.valueOf()):P(e)?e.map(u):e}return r},{isClass:!0}),ia=`clone`,aa=V(ia,[`typed`],e=>{var{typed:t}=e;return t(ia,{any:Ne})});function oa(e){var t=e.length,n=e[0].length,r,i,a=[];for(i=0;i<n;i++){var o=[];for(r=0;r<t;r++)o.push(e[r][i]);a.push(o)}return a}function sa(e){for(var t=0;t<e.length;t++)if(ee(e[t]))return!0;return!1}function ca(e,t){F(e)?e.forEach(e=>t(e),!1,!0):Yi(e,t,!0)}function la(e,t,n){if(!n)return F(e)?e.map(e=>t(e),!1,!0):Ji(e,t,!0);var r=e=>e===0?e:t(e);return F(e)?e.map(e=>r(e),!1,!0):Ji(e,r,!0)}function ua(e,t,n){var r=Array.isArray(e)?gi(e):e.size();if(t<0||t>=r.length)throw new hi(t,r.length);return F(e)?e.create(da(e.valueOf(),t,n),e.datatype()):da(e,t,n)}function da(e,t,n){var r,i,a,o;if(t<=0)if(Array.isArray(e[0])){for(o=oa(e),i=[],r=0;r<o.length;r++)i[r]=da(o[r],t-1,n);return i}else{for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}for(i=[],r=0;r<e.length;r++)i[r]=da(e[r],t-1,n);return i}function fa(e,t,n,r,i,a,o,s,c,l,u){var d=e._values,f=e._index,p=e._ptr,m,h,g,_;if(r)for(h=p[t],g=p[t+1],m=h;m<g;m++)_=f[m],n[_]===a?(r[_]=c?s(d[m],r[_]):s(r[_],d[m]),i[_]=a):(n[_]=a,o.push(_),l?(r[_]=c?s(d[m],u):s(u,d[m]),i[_]=a):r[_]=d[m]);else for(h=p[t],g=p[t+1],m=h;m<g;m++)_=f[m],n[_]===a?i[_]=a:(n[_]=a,o.push(_))}var pa=`isInteger`,ma=V(pa,[`typed`,`equal`],e=>{var{typed:t,equal:n}=e;return t(pa,{number:e=>Number.isFinite(e)?n(e,Math.round(e)):!1,BigNumber:e=>e.isFinite()?n(e.round(),e):!1,bigint:e=>!0,Fraction:e=>e.d===1n,"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),ha=`number`,ga=`number, number`;function _a(e){return Math.abs(e)}_a.signature=ha;function va(e,t){return e+t}va.signature=ga;function ya(e,t){return e-t}ya.signature=ga;function ba(e,t){return e*t}ba.signature=ga;function xa(e){return-e}xa.signature=ha;function Sa(e){return e}Sa.signature=ha;function Ca(e){return rt(e)}Ca.signature=ha;function wa(e){return e*e*e}wa.signature=ha;function Ta(e){return Math.exp(e)}Ta.signature=ha;function Ea(e){return it(e)}Ea.signature=ha;function Da(e,t){if(!H(e)||!H(t))throw Error(`Parameters in function lcm must be integer numbers`);if(e===0||t===0)return 0;for(var n,r=e*t;t!==0;)n=t,t=e%n,e=n;return Math.abs(r/e)}Da.signature=ga;function Oa(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function ka(e){return tt(e)}ka.signature=ha;function Aa(e){return et(e)}Aa.signature=ha;function ja(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n=t<0;if(n&&(t=-t),t===0)throw Error(`Root must be non-zero`);if(e<0&&Math.abs(t)%2!=1)throw Error(`Root must be odd when a is negative.`);if(e===0)return n?1/0:0;if(!isFinite(e))return n?0:e;var r=Math.abs(e)**(1/t);return r=e<0?-r:r,n?1/r:r}function Ma(e){return $e(e)}Ma.signature=ha;function Na(e){return e*e}Na.signature=ha;function Pa(e,t){var n,r,i,a=0,o=1,s=1,c=0;if(!H(e)||!H(t))throw Error(`Parameters in function xgcd must be integer numbers`);for(;t;)r=Math.floor(e/t),i=e-r*t,n=a,a=o-r*a,o=n,n=s,s=c-r*s,c=n,e=t,t=i;return e<0?[-e,-o,-c]:[e,e?o:0,c]}Pa.signature=ga;function Fa(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:e**+t}Fa.signature=ga;function Ia(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!H(t)||t<0||t>15)throw Error(`Number of decimals in function round must be an integer from 0 to 15 inclusive`);return parseFloat(ut(e,t))}var La=`number`,Ra=`number, number`;function za(e,t){if(!H(e)||!H(t))throw Error(`Integers expected in function bitAnd`);return e&t}za.signature=Ra;function Ba(e){if(!H(e))throw Error(`Integer expected in function bitNot`);return~e}Ba.signature=La;function Va(e,t){if(!H(e)||!H(t))throw Error(`Integers expected in function bitOr`);return e|t}Va.signature=Ra;function Ha(e,t){if(!H(e)||!H(t))throw Error(`Integers expected in function bitXor`);return e^t}Ha.signature=Ra;function Ua(e,t){if(!H(e)||!H(t))throw Error(`Integers expected in function leftShift`);return e<<t}Ua.signature=Ra;function Wa(e,t){if(!H(e)||!H(t))throw Error(`Integers expected in function rightArithShift`);return e>>t}Wa.signature=Ra;function Ga(e,t){if(!H(e)||!H(t))throw Error(`Integers expected in function rightLogShift`);return e>>>t}Ga.signature=Ra;function Ka(e,t){if(t<e)return 1;if(t===e)return t;var n=t+e>>1;return Ka(e,n)*Ka(n+1,t)}function qa(e,t){if(!H(e)||e<0||!H(t)||t<0)throw TypeError(`Positive integer value expected in function combinations`);if(t>e)throw TypeError(`k must be less than or equal to n`);for(var n=e-t,r=1,i=t<n?n+1:t+1,a=2,o=t<n?t:n,s=i;s<=e;++s)for(r*=s;a<=o&&r%a===0;)r/=a,++a;return a<=o&&(r/=Ka(a,o)),r}qa.signature=`number, number`;var Ja=Math.PI,Ya=2*Math.PI,Xa=Math.E,Za=1.618033988749895,Qa=`number`,$a=`number, number`;function eo(e){return!e}eo.signature=Qa;function to(e,t){return!!(e||t)}to.signature=$a;function no(e,t){return!!e!=!!t}no.signature=$a;function ro(e,t){return!!(e&&t)}ro.signature=$a;function io(e){var t;if(H(e))return e<=0?Number.isFinite(e)?1/0:NaN:e>171?1/0:Ka(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*io(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,i=r*e,a=i*e;return Math.sqrt(2*Math.PI/e)*(e/Math.E)**+e*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=oo[0];for(var o=1;o<oo.length;++o)t+=oo[o]/(e+o);var s=e+ao+.5;return Math.sqrt(2*Math.PI)*s**+(e+.5)*Math.exp(-s)*t}io.signature=`number`;var ao=4.7421875,oo=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],so=.9189385332046728,co=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function lo(e){if(e<0)return NaN;if(e===0)return 1/0;if(!Number.isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-lo(1-e);--e;for(var t=e+5+.5,n=co[0],r=6;r>=1;r--)n+=co[r]/(e+r);return so+(e+.5)*Math.log(t)-t+Math.log(n)}lo.signature=`number`;var uo=`number`;function fo(e){return _t(e)}fo.signature=uo;function po(e){return Math.atan(1/e)}po.signature=uo;function mo(e){return Number.isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}mo.signature=uo;function ho(e){return Math.asin(1/e)}ho.signature=uo;function go(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}go.signature=uo;function _o(e){return Math.acos(1/e)}_o.signature=uo;function vo(e){var t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}vo.signature=uo;function yo(e){return vt(e)}yo.signature=uo;function bo(e){return yt(e)}bo.signature=uo;function xo(e){return 1/Math.tan(e)}xo.signature=uo;function So(e){var t=Math.exp(2*e);return(t+1)/(t-1)}So.signature=uo;function Co(e){return 1/Math.sin(e)}Co.signature=uo;function wo(e){return e===0?1/0:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*$e(e)}wo.signature=uo;function To(e){return 1/Math.cos(e)}To.signature=uo;function Eo(e){return 2/(Math.exp(e)+Math.exp(-e))}Eo.signature=uo;function Do(e){return xt(e)}Do.signature=uo;var Oo=`number`;function ko(e){return e<0}ko.signature=Oo;function Ao(e){return e>0}Ao.signature=Oo;function jo(e){return Number.isNaN(e)}jo.signature=Oo;function Mo(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(n<=0)throw Error(`Relative tolerance must be greater than 0`);if(r<0)throw Error(`Absolute tolerance must be at least 0`);return e.isNaN()||t.isNaN()?!1:!e.isFinite()||!t.isFinite()?e.eq(t):e.eq(t)?!0:e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(n),r))}var No=`isNegative`,Po=V(No,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(No,{number:e=>!gt(e,0,n.relTol,n.absTol)&&ko(e),BigNumber:e=>!Mo(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=>la(t,e))})}),Fo=`isNumeric`,Io=V(Fo,[`typed`],e=>{var{typed:t}=e;return t(Fo,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),Lo=`hasNumericValue`,Ro=V(Lo,[`typed`,`isNumeric`],e=>{var{typed:t,isNumeric:n}=e;return t(Lo,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})}),zo=`isPositive`,Bo=V(zo,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(zo,{number:e=>!gt(e,0,n.relTol,n.absTol)&&Ao(e),BigNumber:e=>!Mo(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=>la(t,e))})}),Vo=`isZero`,Ho=V(Vo,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return t(Vo,{"number | BigNumber | Complex | Fraction":e=>n(e,0),bigint:e=>e===0n,Unit:t.referToSelf(e=>n=>t.find(e,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),Uo=`isNaN`,Wo=V(Uo,[`typed`],e=>{var{typed:t}=e;return t(Uo,{number:jo,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=>la(t,e))})}),Go=`isBounded`,Ko=V(Go,[`typed`],e=>{var{typed:t}=e;return t(Go,{number:e=>Number.isFinite(e),"BigNumber | Complex":e=>e.isFinite(),"bigint | Fraction":()=>!0,"null | undefined":()=>!1,Unit:t.referToSelf(e=>t=>e(t.value)),"Array | Matrix":t.referToSelf(e=>t=>(Array.isArray(t)||(t=t.valueOf()),t.every(t=>e(t))))})}),qo=`isFinite`,Jo=V(qo,[`typed`,`isBounded`,`map`],e=>{var{typed:t,isBounded:n,map:r}=e;return t(qo,{"Array | Matrix":e=>r(e,n),any:e=>n(e)})}),Yo=`typeOf`,Xo=V(Yo,[`typed`],e=>{var{typed:t}=e;return t(Yo,{any:Me})});function Zo(e,t,n,r){return gt(e.re,t.re,n,r)&>(e.im,t.im,n,r)}var Qo=V(`compareUnits`,[`typed`],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(e=>(n,r)=>{if(!n.equalBase(r))throw Error(`Cannot compare units with different base`);return t.find(e,[n.valueType(),r.valueType()])(n.value,r.value)})}}),$o=`equalScalar`,es=V($o,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t($o,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return gt(e,t,n.relTol,n.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||Mo(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 Zo(e,t,n.relTol,n.absTol)}},Qo({typed:t}))});V($o,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t($o,{"number, number":function(e,t){return gt(e,t,n.relTol,n.absTol)}})});var ts=V(`SparseMatrix`,[`typed`,`equalScalar`,`Matrix`],e=>{var{typed:t,equalScalar:n,Matrix:r}=e;function i(e,t){if(!(this instanceof i))throw SyntaxError(`Constructor must be called with the new operator`);if(t&&!N(t))throw Error(`Invalid datatype: `+t);if(F(e))a(this,e,t);else if(e&&P(e.index)&&P(e.ptr)&&P(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(P(e))o(this,e,t);else if(e)throw TypeError(`Unsupported type of data (`+Me(e)+`)`);else this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}function a(e,t,n){t.type===`SparseMatrix`?(e._values=t._values?Ne(t._values):void 0,e._index=Ne(t._index),e._ptr=Ne(t._ptr),e._size=Ne(t._size),e._datatype=n||t._datatype):o(e,t.valueOf(),n||t._datatype)}function o(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=r.length,o=0,s=n,c=0;if(N(i)&&(s=t.find(n,[i,i])||n,c=t.convert(0,i)),a>0){var l=0;do{e._ptr.push(e._index.length);for(var u=0;u<a;u++){var d=r[u];if(P(d)){if(l===0&&o<d.length&&(o=d.length),l<d.length){var f=d[l];s(f,c)||(e._values.push(f),e._index.push(u))}}else l===0&&o<1&&(o=1),s(d,c)||(e._values.push(d),e._index.push(u))}l++}while(l<o)}for(;e._ptr.length<=o;)e._ptr.push(e._index.length);e._size=[a,o]}i.prototype=new r,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},Object.defineProperty(i,"name",{value:`SparseMatrix`}),i.prototype.constructor=i,i.prototype.type=`SparseMatrix`,i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Bi(this._values,Me)},i.prototype.storage=function(){return`sparse`},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return e!==0&&t!==0?this._index.length/(e*t):0},i.prototype.subset=function(e,t,n){if(!this._values)throw Error(`Cannot invoke subset on a Pattern only matrix`);switch(arguments.length){case 1:return s(this,e);case 2:case 3:return c(this,e,t,n);default:throw SyntaxError(`Wrong number of arguments`)}};function s(e,t){if(!ie(t))throw TypeError(`Invalid index`);if(t.isScalar())return e.get(t.min());var n=t.size();if(n.length!==e._size.length)throw new mi(n.length,e._size.length);var r,a,o,s,c=t.min(),l=t.max();for(r=0,a=e._size.length;r<a;r++)bi(c[r],e._size[r]),bi(l[r],e._size[r]);var u=e._values,d=e._index,f=e._ptr,p=t.dimension(0),m=t.dimension(1),h=[],g=[];function _(e,t){g[e]=t[0],h[e]=!0}Number.isInteger(p)?_(p,[0]):p.forEach(_);var v=u?[]:void 0,y=[],b=[];function x(e){for(b.push(y.length),o=f[e],s=f[e+1];o<s;o++)r=d[o],h[r]===!0&&(y.push(g[r]),v&&v.push(u[o]))}return Number.isInteger(m)?x(m):m.forEach(x),b.push(y.length),new i({values:v,index:y,ptr:b,size:n,datatype:e._datatype})}function c(e,t,n,r){if(!t||t.isIndex!==!0)throw TypeError(`Invalid index`);var i=t.size(),a=t.isScalar(),o;if(F(n)?(o=n.size(),n=n.toArray()):o=gi(n),a){if(o.length!==0)throw TypeError(`Scalar expected`);e.set(t.min(),n,r)}else{if(i.length!==1&&i.length!==2)throw new mi(i.length,e._size.length,`<`);if(o.length<i.length){for(var s=0,c=0;i[s]===1&&o[s]===1;)s++;for(;i[s]===1;)c++,s++;n=Ai(n,i.length,c,o)}if(!Le(i,o))throw new mi(i,o,`>`);if(i.length===1)d(t.dimension(0),(t,i)=>{bi(t),e.set([t,0],n[i[0]],r)});else{var l=t.dimension(0),u=t.dimension(1);d(l,(t,i)=>{bi(t),d(u,(a,o)=>{bi(a),e.set([t,a],n[i[0]][o[0]],r)})})}}return e;function d(e,t){D(e)?t(e,[0]):e.forEach(t)}}i.prototype.get=function(e){if(!P(e))throw TypeError(`Array expected`);if(e.length!==this._size.length)throw new mi(e.length,this._size.length);if(!this._values)throw Error(`Cannot invoke get on a Pattern only matrix`);var t=e[0],n=e[1];bi(t,this._size[0]),bi(n,this._size[1]);var r=l(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},i.prototype.set=function(e,r,i){if(!P(e))throw TypeError(`Array expected`);if(e.length!==this._size.length)throw new mi(e.length,this._size.length);if(!this._values)throw Error(`Cannot invoke set on a Pattern only matrix`);var a=e[0],o=e[1],s=this._size[0],c=this._size[1],p=n,m=0;N(this._datatype)&&(p=t.find(n,[this._datatype,this._datatype])||n,m=t.convert(0,this._datatype)),(a>s-1||o>c-1)&&(f(this,Math.max(a+1,s),Math.max(o+1,c),i),s=this._size[0],c=this._size[1]),bi(a,s),bi(o,c);var h=l(a,this._ptr[o],this._ptr[o+1],this._index);return h<this._ptr[o+1]&&this._index[h]===a?p(r,m)?u(h,o,this._values,this._index,this._ptr):this._values[h]=r:p(r,m)||d(h,a,o,r,this._values,this._index,this._ptr),this};function l(e,t,n,r){if(n-t===0)return n;for(var i=t;i<n;i++)if(r[i]===e)return i;return t}function u(e,t,n,r,i){n.splice(e,1),r.splice(e,1);for(var a=t+1;a<i.length;a++)i[a]--}function d(e,t,n,r,i,a,o){i.splice(e,0,r),a.splice(e,0,t);for(var s=n+1;s<o.length;s++)o[s]++}i.prototype.resize=function(e,t,n){if(!ee(e))throw TypeError(`Array or Matrix expected`);var r=e.valueOf().map(e=>Array.isArray(e)&&e.length===1?e[0]:e);if(r.length!==2)throw Error(`Only two dimensions matrix are supported`);return r.forEach(function(e){if(!D(e)||!H(e)||e<0)throw TypeError(`Invalid size, must contain positive integers (size: `+oi(r)+`)`)}),f(n?this.clone():this,r[0],r[1],t)};function f(e,r,i,a){var o=a||0,s=n,c=0;N(e._datatype)&&(s=t.find(n,[e._datatype,e._datatype])||n,c=t.convert(0,e._datatype),o=t.convert(o,e._datatype));var l=!s(o,c),u=e._size[0],d=e._size[1],f,p,m;if(i>d){for(p=d;p<i;p++)if(e._ptr[p]=e._values.length,l)for(f=0;f<u;f++)e._values.push(o),e._index.push(f);e._ptr[i]=e._values.length}else i<d&&(e._ptr.splice(i+1,d-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(d=i,r>u){if(l){var h=0;for(p=0;p<d;p++){e._ptr[p]=e._ptr[p]+h,m=e._ptr[p+1]+h;var g=0;for(f=u;f<r;f++,g++)e._values.splice(m+g,0,o),e._index.splice(m+g,0,f),h++}e._ptr[d]=e._values.length}}else if(r<u){var _=0;for(p=0;p<d;p++){e._ptr[p]=e._ptr[p]-_;var v=e._ptr[p],y=e._ptr[p+1]-_;for(m=v;m<y;m++)f=e._index[m],f>r-1&&(e._values.splice(m,1),e._index.splice(m,1),_++)}e._ptr[p]=e._values.length}return e._size[0]=r,e._size[1]=i,e}i.prototype.reshape=function(e,t){if(!P(e))throw TypeError(`Array expected`);if(e.length!==2)throw Error(`Sparse matrices can only be reshaped in two dimensions`);e.forEach(function(t){if(!D(t)||!H(t)||t<=-2||t===0)throw TypeError(`Invalid size, must contain positive integers or -1 (size: `+oi(e)+`)`)});var n=this._size[0]*this._size[1];if(e=Ti(e,n),n!==e[0]*e[1])throw Error(`Reshaping sparse matrix will result in the wrong number of elements`);var r=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return r;for(var i=[],a=0;a<r._ptr.length;a++)for(var o=0;o<r._ptr[a+1]-r._ptr[a];o++)i.push(a);for(var s=r._values.slice(),c=r._index.slice(),u=0;u<r._index.length;u++){var f=c[u],p=i[u],m=f*r._size[1]+p;i[u]=m%e[1],c[u]=Math.floor(m/e[1])}r._values.length=0,r._index.length=0,r._ptr.length=e[1]+1,r._size=e.slice();for(var h=0;h<r._ptr.length;h++)r._ptr[h]=0;for(var g=0;g<s.length;g++){var _=c[g],v=i[g],y=s[g];d(l(_,r._ptr[v],r._ptr[v+1],r._index),_,v,y,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?Ne(this._values):void 0,index:Ne(this._index),ptr:Ne(this._ptr),size:Ne(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,t){if(!this._values)throw Error(`Cannot invoke map on a Pattern only matrix`);var n=this,r=this._size[0],i=this._size[1],a=Zi(e,n,`map`);return p(this,0,r-1,0,i-1,function(e,t,r){return a.fn(e,[t,r],n)},t)};function p(e,r,a,o,s,c,l){var u=[],d=[],f=[],p=n,m=0;N(e._datatype)&&(p=t.find(n,[e._datatype,e._datatype])||n,m=t.convert(0,e._datatype));for(var h=function(e,t,n){var r=c(e,t,n);p(r,m)||(u.push(r),d.push(t))},g=o;g<=s;g++){f.push(u.length);var _=e._ptr[g],v=e._ptr[g+1];if(l)for(var y=_;y<v;y++){var b=e._index[y];b>=r&&b<=a&&h(e._values[y],b-r,g-o)}else{for(var x={},S=_;S<v;S++){var C=e._index[S];x[C]=e._values[S]}for(var w=r;w<=a;w++)h(w in x?x[w]:0,w-r,g-o)}}return f.push(u.length),new i({values:u,index:d,ptr:f,size:[a-r+1,s-o+1]})}i.prototype.forEach=function(e,t){if(!this._values)throw Error(`Cannot invoke forEach on a Pattern only matrix`);for(var n=this,r=this._size[0],i=this._size[1],a=Zi(e,n,`forEach`),o=0;o<i;o++){var s=this._ptr[o],c=this._ptr[o+1];if(t)for(var l=s;l<c;l++){var u=this._index[l];a.fn(this._values[l],[u,o],n)}else{for(var d={},f=s;f<c;f++){var p=this._index[f];d[p]=this._values[f]}for(var m=0;m<r;m++){var h=m in d?d[m]:0;a.fn(h,[m,o],n)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw Error(`Cannot iterate a Pattern only matrix`);for(var e=this._size[1],t=0;t<e;t++)for(var n=this._ptr[t],r=this._ptr[t+1],i=n;i<r;i++){var a=this._index[i];yield{value:this._values[i],index:[a,t]}}},i.prototype.toArray=function(){return m(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return m(this._values,this._index,this._ptr,this._size,!1)};function m(e,t,n,r,i){var a=r[0],o=r[1],s=[],c,l;for(c=0;c<a;c++)for(s[c]=[],l=0;l<o;l++)s[c][l]=0;for(l=0;l<o;l++)for(var u=n[l],d=n[l+1],f=u;f<d;f++)c=t[f],s[c][l]=e?i?Ne(e[f]):e[f]:1;return s}return i.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),i=`Sparse Matrix [`+oi(t,e)+` x `+oi(n,e)+`] density: `+oi(r,e)+`
|
|
10
|
+
`,a=0;a<n;a++)for(var o=this._ptr[a],s=this._ptr[a+1],c=o;c<s;c++){var l=this._index[c];i+=`
|
|
11
|
+
(`+oi(l,e)+`, `+oi(a,e)+`) ==> `+(this._values?oi(this._values[c],e):`X`)}return i},i.prototype.toString=function(){return oi(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(O(e)&&(e=e.toNumber()),!D(e)||!H(e))throw TypeError(`The parameter k must be an integer number`)}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],a=this._size[1],o=Math.min(r-n,a-t),s=[],c=[],l=[];l[0]=0;for(var u=t;u<a&&s.length<o;u++)for(var d=this._ptr[u],f=this._ptr[u+1],p=d;p<f;p++){var m=this._index[p];if(m===u-t+n){s.push(this._values[p]),c[s.length-1]=m-n;break}}return l.push(s.length),new i({values:s,index:c,ptr:l,size:[o,1]})},i.fromJSON=function(e){return new i(e)},i.diagonal=function(e,r,a,o,s){if(!P(e))throw TypeError(`Array expected, size parameter`);if(e.length!==2)throw Error(`Only two dimensions matrix are supported`);if(e=e.map(function(e){if(O(e)&&(e=e.toNumber()),!D(e)||!H(e)||e<1)throw Error(`Size values must be positive integers`);return e}),a){if(O(a)&&(a=a.toNumber()),!D(a)||!H(a))throw TypeError(`The parameter k must be an integer number`)}else a=0;var c=n,l=0;N(s)&&(c=t.find(n,[s,s])||n,l=t.convert(0,s));var u=a>0?a:0,d=a<0?-a:0,f=e[0],p=e[1],m=Math.min(f-d,p-u),h;if(P(r)){if(r.length!==m)throw Error(`Invalid value array length`);h=function(e){return r[e]}}else if(F(r)){var g=r.size();if(g.length!==1||g[0]!==m)throw Error(`Invalid matrix length`);h=function(e){return r.get([e])}}else h=function(){return r};for(var _=[],v=[],y=[],b=0;b<p;b++){y.push(_.length);var x=b-u;if(x>=0&&x<m){var S=h(x);c(S,l)||(v.push(x+d),_.push(S))}}return y.push(_.length),new i({values:_,index:v,ptr:y,size:[f,p]})},i.prototype.swapRows=function(e,t){if(!D(e)||!H(e)||!D(t)||!H(t))throw Error(`Row index must be positive integers`);if(this._size.length!==2)throw Error(`Only two dimensional matrix is supported`);return bi(e,this._size[0]),bi(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,n,r,i){for(var a=r[e],o=r[e+1],s=a;s<o;s++)i(n[s],t[s])},i._swapRows=function(e,t,n,r,i,a){for(var o=0;o<n;o++){var s=a[o],c=a[o+1],u=l(e,s,c,i),d=l(t,s,c,i);if(u<c&&d<c&&i[u]===e&&i[d]===t){if(r){var f=r[u];r[u]=r[d],r[d]=f}continue}if(u<c&&i[u]===e&&(d>=c||i[d]!==t)){var p=r?r[u]:void 0;i.splice(d,0,t),r&&r.splice(d,0,p),i.splice(d<=u?u+1:u,1),r&&r.splice(d<=u?u+1:u,1);continue}if(d<c&&i[d]===t&&(u>=c||i[u]!==e)){var m=r?r[d]:void 0;i.splice(u,0,e),r&&r.splice(u,0,m),i.splice(u<=d?d+1:d,1),r&&r.splice(u<=d?d+1:d,1)}}},i},{isClass:!0}),ns=`number`,rs=[`typed`];function is(e){var 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}function as(e){for(var t=parseInt(e.integerPart,e.radix),n=0,r=0;r<e.fractionalPart.length;r++){var i=parseInt(e.fractionalPart[r],e.radix);n+=i/e.radix**+(r+1)}var a=t+n;if(isNaN(a))throw SyntaxError(`String "`+e.input+`" is not a valid number`);return a}var os=V(ns,rs,e=>{var{typed:t}=e,n=t(`number`,{"":function(){return 0},number:function(e){return e},string:function(e){if(e===`NaN`)return NaN;var t=is(e);if(t)return as(t);var n=0,r=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);r&&(n=Number(r[2]),e=r[1]);var i=Number(e);if(isNaN(i))throw SyntaxError(`String "`+e+`" is not a valid number`);if(r){if(i>2**n-1)throw 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=>{var 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=>la(t,e))});return n.fromJSON=function(e){return parseFloat(e.value)},n}),ss=V(`bigint`,[`typed`],e=>{var{typed:t}=e,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=>la(t,e))});return n.fromJSON=function(e){return BigInt(e.value)},n}),cs=`string`,ls=V(cs,[`typed`],e=>{var{typed:t}=e;return t(cs,{"":function(){return``},number:ot,null:function(e){return`null`},boolean:function(e){return e+``},string:function(e){return e},"Array | Matrix":t.referToSelf(e=>t=>la(t,e)),any:function(e){return String(e)}})}),us=`boolean`,ds=V(us,[`typed`],e=>{var{typed:t}=e;return t(us,{"":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){var t=e.toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1;var n=Number(e);if(e!==``&&!isNaN(n))return!!n;throw Error(`Cannot convert "`+e+`" to a boolean`)},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),fs=V(`bignumber`,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e;return t(`bignumber`,{"":function(){return new n(0)},number:function(e){return new n(e+``)},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var r=t[2],i=n(t[1]),a=new n(2).pow(Number(r));if(i.gt(a.sub(1)))throw SyntaxError(`String "${e}" is out of range`);var o=new n(2).pow(Number(r)-1);return i.gte(o)?i.sub(a):i}return new n(e)},BigNumber:function(e){return e},bigint:function(e){return new n(e.toString())},Unit:t.referToSelf(e=>t=>{var 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=>la(t,e))})}),ps=V(`complex`,[`typed`,`Complex`],e=>{var{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 Error(`Expected object with properties (re and im) or (r and phi) or (abs and arg)`)},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),ms=V(`fraction`,[`typed`,`Fraction`],e=>{var{typed:t,Fraction:n}=e;return t(`fraction`,{number:function(e){if(!Number.isFinite(e)||isNaN(e))throw 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=>{var n=t.clone();return n.value=e(t.value),n}),Object:function(e){return new n(e)},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),hs=`matrix`,gs=V(hs,[`typed`,`Matrix`,`DenseMatrix`,`SparseMatrix`],e=>{var{typed:t,Matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(hs,{"":function(){return a([])},string:function(e){return a([],e)},"string, string":function(e,t){return a([],e,t)},Array:function(e){return a(e)},Matrix:function(e){return a(e,e.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(e,t,n){if(t===`dense`||t==="default"||t===void 0)return new r(e,n);if(t===`sparse`)return new i(e,n);throw TypeError(`Unknown matrix type `+JSON.stringify(t)+`.`)}}),_s=`matrixFromFunction`,vs=V(_s,[`typed`,`matrix`,`isZero`],e=>{var{typed:t,matrix:n,isZero:r}=e;return t(_s,{"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,a){var o=a===void 0?n(i):n(i,a);return o.resize(e),o.forEach(function(e,n){var i=t(n);r(i)||o.set(n,i)}),o}}),ys=`matrixFromRows`,bs=V(ys,[`typed`,`matrix`,`flatten`,`size`],e=>{var{typed:t,matrix:n,flatten:r,size:i}=e;return t(ys,{"...Array":function(e){return a(e)},"...Matrix":function(e){return n(a(e.map(e=>e.toArray())))}});function a(e){if(e.length===0)throw TypeError(`At least one row is needed to construct a matrix.`);var t=o(e[0]),n=[];for(var i of e){var a=o(i);if(a!==t)throw TypeError(`The vectors had different length: `+(t|0)+` ≠ `+(a|0));n.push(r(i))}return n}function o(e){var t=i(e);if(t.length===1)return t[0];if(t.length===2){if(t[0]===1)return t[1];if(t[1]===1)return t[0];throw TypeError(`At least one of the arguments is not a vector.`)}throw TypeError(`Only one- or two-dimensional vectors are supported.`)}}),xs=`matrixFromColumns`,Ss=V(xs,[`typed`,`matrix`,`flatten`,`size`],e=>{var{typed:t,matrix:n,flatten:r,size:i}=e;return t(xs,{"...Array":function(e){return a(e)},"...Matrix":function(e){return n(a(e.map(e=>e.toArray())))}});function a(e){if(e.length===0)throw TypeError(`At least one column is needed to construct a matrix.`);for(var t=o(e[0]),n=[],i=0;i<t;i++)n[i]=[];for(var a of e){var s=o(a);if(s!==t)throw TypeError(`The vectors had different length: `+(t|0)+` ≠ `+(s|0));for(var c=r(a),l=0;l<t;l++)n[l].push(c[l])}return n}function o(e){var t=i(e);if(t.length===1)return t[0];if(t.length===2){if(t[0]===1)return t[1];if(t[1]===1)return t[0];throw TypeError(`At least one of the arguments is not a vector.`)}throw TypeError(`Only one- or two-dimensional vectors are supported.`)}}),Cs=`splitUnit`,ws=V(Cs,[`typed`],e=>{var{typed:t}=e;return t(Cs,{"Unit, Array":function(e,t){return e.splitUnit(t)}})}),Ts=`unaryMinus`,Es=V(Ts,[`typed`],e=>{var{typed:t}=e;return t(Ts,{number:xa,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf(e=>n=>{var r=n.clone();return r.value=t.find(e,r.valueType())(n.value),r}),"Array | Matrix":t.referToSelf(e=>t=>la(t,e,!0))})}),Ds=`unaryPlus`,Os=V(Ds,[`typed`,`config`,`numeric`],e=>{var{typed:t,config:n,numeric:r}=e;return t(Ds,{number:Sa,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=>la(t,e,!0)),boolean:function(e){return r(+!!e,n.number)},string:function(e){return r(e,Qe(e,n))}})}),ks=`abs`,As=V(ks,[`typed`],e=>{var{typed:t}=e;return t(ks,{number:_a,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<0n?-e:e,"Array | Matrix":t.referToSelf(e=>t=>la(t,e,!0))})}),js=`mapSlices`,Ms=V(js,[`typed`,`isInteger`],e=>{var{typed:t,isInteger:n}=e;return t(js,{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw TypeError(`Integer number expected for dimension`);var i=Array.isArray(e)?gi(e):e.size();if(t<0||t>=i.length)throw new hi(t,i.length);return F(e)?e.create(Ns(e.valueOf(),t,r),e.datatype()):Ns(e,t,r)}})},{formerly:`apply`});function Ns(e,t,n){var r,i,a;if(t<=0)if(Array.isArray(e[0])){for(a=Ps(e),i=[],r=0;r<a.length;r++)i[r]=Ns(a[r],t-1,n);return i}else return n(e);for(i=[],r=0;r<e.length;r++)i[r]=Ns(e[r],t-1,n);return i}function Ps(e){var t=e.length,n=e[0].length,r,i,a=[];for(i=0;i<n;i++){var o=[];for(r=0;r<t;r++)o.push(e[r][i]);a.push(o)}return a}var Fs=`addScalar`,Is=V(Fs,[`typed`],e=>{var{typed:t}=e;return t(Fs,{"number, number":va,"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(n.value===null||n.value===void 0)throw Error(`Parameter x contains a unit with undefined value`);if(r.value===null||r.value===void 0)throw Error(`Parameter y contains a unit with undefined value`);if(!n.equalBase(r))throw Error(`Units do not match`);var i=n.clone();return i.value=t.find(e,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})}),Ls=`subtractScalar`,Rs=V(Ls,[`typed`],e=>{var{typed:t}=e;return t(Ls,{"number, number":ya,"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(n.value===null||n.value===void 0)throw Error(`Parameter x contains a unit with undefined value`);if(r.value===null||r.value===void 0)throw Error(`Parameter y contains a unit with undefined value`);if(!n.equalBase(r))throw Error(`Units do not match`);var i=n.clone();return i.value=t.find(e,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})}),zs=`cbrt`,Bs=V(zs,[`config`,`typed`,`isNegative`,`unaryMinus`,`matrix`,`Complex`,`BigNumber`,`Fraction`],e=>{var{config:t,typed:n,isNegative:r,unaryMinus:i,matrix:a,Complex:o,BigNumber:s,Fraction:c}=e;return n(zs,{number:Ca,Complex:l,"Complex, boolean":l,BigNumber:function(e){return e.cbrt()},Unit:u});function l(e,n){var r=e.arg()/3,i=e.abs(),s=new o(Ca(i),0).mul(new o(0,r).exp());if(n){var c=[s,new o(Ca(i),0).mul(new o(0,r+Math.PI*2/3).exp()),new o(Ca(i),0).mul(new o(0,r-Math.PI*2/3).exp())];return t.matrix===`Array`?c:a(c)}return s}function u(e){if(e.value&&A(e.value)){var t=e.clone();return t.value=1,t=t.pow(1/3),t.value=l(e.value),t}var n=r(e.value);n&&(e.value=i(e.value));var a=O(e.value)?new s(1).div(3):j(e.value)?new c(1,3):1/3,o=e.pow(a);return n&&(o.value=i(o.value)),o}}),Vs=V(`matAlgo11xS0s`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i,a){var o=e._values,s=e._index,c=e._ptr,l=e._size,u=e._datatype;if(!o)throw Error(`Cannot perform operation on Pattern Sparse Matrix and Scalar value`);var d=l[0],f=l[1],p,m=n,h=0,g=i;typeof u==`string`&&(p=u,m=t.find(n,[p,p]),h=t.convert(0,p),r=t.convert(r,p),g=t.find(i,[p,p]));for(var _=[],v=[],y=[],b=0;b<f;b++){y[b]=v.length;for(var x=c[b],S=c[b+1],C=x;C<S;C++){var w=s[C],T=a?g(r,o[C]):g(o[C],r);m(T,h)||(v.push(w),_.push(T))}}return y[f]=v.length,e.createSparseMatrix({values:_,index:v,ptr:y,size:[d,f],datatype:p})}}),Hs=V(`matAlgo12xSfs`,[`typed`,`DenseMatrix`],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,a){var o=e._values,s=e._index,c=e._ptr,l=e._size,u=e._datatype;if(!o)throw Error(`Cannot perform operation on Pattern Sparse Matrix and Scalar value`);var d=l[0],f=l[1],p,m=i;typeof u==`string`&&(p=u,r=t.convert(r,p),m=t.find(i,[p,p]));for(var h=[],g=[],_=[],v=0;v<f;v++){for(var y=v+1,b=c[v],x=c[v+1],S=b;S<x;S++){var C=s[S];g[C]=o[S],_[C]=y}for(var w=0;w<d;w++)v===0&&(h[w]=[]),_[w]===y?h[w][v]=a?m(r,g[w]):m(g[w],r):h[w][v]=a?m(r,0):m(0,r)}return new n({data:h,size:[d,f],datatype:p})}}),Us=V(`matAlgo14xDs`,[`typed`],e=>{var{typed:t}=e;return function(e,r,i,a){var o=e._data,s=e._size,c=e._datatype,l,u=i;typeof c==`string`&&(l=c,r=t.convert(r,l),u=t.find(i,[l,l]));var d=s.length>0?n(u,0,s,s[0],o,r,a):[];return e.createDenseMatrix({data:d,size:Ne(s),datatype:l})};function n(e,t,r,i,a,o,s){var c=[];if(t===r.length-1)for(var l=0;l<i;l++)c[l]=s?e(o,a[l]):e(a[l],o);else for(var u=0;u<i;u++)c[u]=n(e,t+1,r,r[t+1],a[u],o,s);return c}}),Ws=`ceil`,Gs=[`typed`,`config`,`round`,`matrix`,`equalScalar`,`zeros`,`DenseMatrix`],Ks=new yr(10),qs=V(Ws,[`typed`,`config`,`round`],e=>{var{typed:t,config:n,round:r}=e;function i(e){var t=Math.ceil(e),i=r(e);return t===i?t:gt(e,i,n.relTol,n.absTol)&&!gt(e,t,n.relTol,n.absTol)?i:t}return t(Ws,{number:i,"number, number":function(e,t){if(!H(t))throw RangeError(`number of decimals in function ceil must be an integer`);if(t<0||t>15)throw RangeError(`number of decimals in ceil number must be in range 0-15`);var n=10**t;return i(e*n)/n}})}),Js=V(Ws,Gs,e=>{var{typed:t,config:n,round:r,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,c=Vs({typed:t,equalScalar:a}),l=Hs({typed:t,DenseMatrix:s}),u=Us({typed:t}),d=qs({typed:t,config:n,round:r});function f(e){var t=(e,t)=>Mo(e,t,n.relTol,n.absTol),i=e.ceil(),a=r(e);return i.eq(a)?i:t(e,a)&&!t(e,i)?a:i}return t(`ceil`,{number:d.signatures.number,"number,number":d.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:f,"BigNumber, BigNumber":function(e,t){var n=Ks.pow(t);return f(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){var 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)=>la(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=>la(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,n)=>la(t,t=>e(t,n),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>c(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>u(t,n,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,n)=>u(i(n),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,n)=>a(t,0)?o(n.size(),n.storage()):n.storage()===`dense`?u(n,t,e,!0):l(n,t,e,!0))})}),Ys=`cube`,Xs=V(Ys,[`typed`],e=>{var{typed:t}=e;return t(Ys,{number:wa,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)}})}),Zs=`exp`,Qs=V(Zs,[`typed`],e=>{var{typed:t}=e;return t(Zs,{number:Ta,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})}),$s=`expm1`,ec=V($s,[`typed`,`Complex`],e=>{var{typed:t,Complex:n}=e;return t($s,{number:Ea,Complex:function(e){var 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)}})}),tc=`fix`,nc=[`typed`,`Complex`,`matrix`,`ceil`,`floor`,`equalScalar`,`zeros`,`DenseMatrix`],rc=V(tc,[`typed`,`ceil`,`floor`],e=>{var{typed:t,ceil:n,floor:r}=e;return t(tc,{number:function(e){return e>0?r(e):n(e)},"number, number":function(e,t){return e>0?r(e,t):n(e,t)}})}),ic=V(tc,nc,e=>{var{typed:t,Complex:n,matrix:r,ceil:i,floor:a,equalScalar:o,zeros:s,DenseMatrix:c}=e,l=Hs({typed:t,DenseMatrix:c}),u=Us({typed:t}),d=rc({typed:t,ceil:i,floor:a});return t(`fix`,{number:d.signatures.number,"number, number | BigNumber":d.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?a(e.re,t):i(e.re,t),e.im>0?a(e.im,t):i(e.im,t))},"Complex, BigNumber":function(e,t){var r=t.toNumber();return new n(e.re>0?a(e.re,r):i(e.re,r),e.im>0?a(e.im,r):i(e.im,r))},BigNumber:function(e){return e.isNegative()?i(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):a(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):a(e,t)},"Unit, number, Unit":t.referToSelf(e=>function(t,n,r){var 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)=>la(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=>la(t,e,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(e=>(t,n)=>la(t,t=>e(t,n),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,n)=>u(r(n),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,n)=>o(t,0)?s(n.size(),n.storage()):n.storage()===`dense`?u(n,t,e,!0):l(n,t,e,!0))})}),ac=`floor`,oc=[`typed`,`config`,`round`,`matrix`,`equalScalar`,`zeros`,`DenseMatrix`],sc=new yr(10),cc=V(ac,[`typed`,`config`,`round`],e=>{var{typed:t,config:n,round:r}=e;function i(e){var t=Math.floor(e),i=r(e);return t===i?t:gt(e,i,n.relTol,n.absTol)&&!gt(e,t,n.relTol,n.absTol)?i:t}return t(ac,{number:i,"number, number":function(e,t){if(!H(t))throw RangeError(`number of decimals in function floor must be an integer`);if(t<0||t>15)throw RangeError(`number of decimals in floor number must be in range 0 - 15`);var n=10**t;return i(e*n)/n}})}),lc=V(ac,oc,e=>{var{typed:t,config:n,round:r,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,c=Vs({typed:t,equalScalar:a}),l=Hs({typed:t,DenseMatrix:s}),u=Us({typed:t}),d=cc({typed:t,config:n,round:r});function f(e){var t=(e,t)=>Mo(e,t,n.relTol,n.absTol),i=e.floor(),a=r(e);return i.eq(a)?i:t(e,a)&&!t(e,i)?a:i}return t(`floor`,{number:d.signatures.number,"number,number":d.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:f,"BigNumber, BigNumber":function(e,t){var n=sc.pow(t);return f(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){var 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)=>la(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=>la(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,n)=>la(t,t=>e(t,n),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>c(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>u(t,n,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,n)=>u(i(n),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,n)=>a(t,0)?o(n.size(),n.storage()):n.storage()===`dense`?u(n,t,e,!0):l(n,t,e,!0))})}),uc=V(`matAlgo02xDS0`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i,a){var o=e._data,s=e._size,c=e._datatype||e.getDataType(),l=r._values,u=r._index,d=r._ptr,f=r._size,p=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(s.length!==f.length)throw new mi(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw RangeError(`Dimension mismatch. Matrix A (`+s+`) must match Matrix B (`+f+`)`);if(!l)throw Error(`Cannot perform operation on Dense Matrix and Pattern Sparse Matrix`);var m=s[0],h=s[1],g,_=n,v=0,y=i;typeof c==`string`&&c===p&&c!==`mixed`&&(g=c,_=t.find(n,[g,g]),v=t.convert(0,g),y=t.find(i,[g,g]));for(var b=[],x=[],S=[],C=0;C<h;C++){S[C]=x.length;for(var w=d[C],T=d[C+1],E=w;E<T;E++){var D=u[E],O=a?y(l[E],o[D][C]):y(o[D][C],l[E]);_(O,v)||(x.push(D),b.push(O))}}return S[h]=x.length,r.createSparseMatrix({values:b,index:x,ptr:S,size:[m,h],datatype:c===e._datatype&&p===r._datatype?g:void 0})}}),dc=V(`matAlgo03xDSf`,[`typed`],e=>{var{typed:t}=e;return function(e,n,r,i){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),c=n._values,l=n._index,u=n._ptr,d=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(o.length!==d.length)throw new mi(o.length,d.length);if(o[0]!==d[0]||o[1]!==d[1])throw RangeError(`Dimension mismatch. Matrix A (`+o+`) must match Matrix B (`+d+`)`);if(!c)throw Error(`Cannot perform operation on Dense Matrix and Pattern Sparse Matrix`);var p=o[0],m=o[1],h,g=0,_=r;typeof s==`string`&&s===f&&s!==`mixed`&&(h=s,g=t.convert(0,h),_=t.find(r,[h,h]));for(var v=[],y=0;y<p;y++)v[y]=[];for(var b=[],x=[],S=0;S<m;S++){for(var C=S+1,w=u[S],T=u[S+1],E=w;E<T;E++){var D=l[E];b[D]=i?_(c[E],a[D][S]):_(a[D][S],c[E]),x[D]=C}for(var O=0;O<p;O++)x[O]===C?v[O][S]=b[O]:v[O][S]=i?_(g,a[O][S]):_(a[O][S],g)}return e.createDenseMatrix({data:v,size:[p,m],datatype:s===e._datatype&&f===n._datatype?h:void 0})}}),fc=V(`matAlgo05xSfSf`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,c=e._size,l=e._datatype||e._data===void 0?e._datatype:e.getDataType(),u=r._values,d=r._index,f=r._ptr,p=r._size,m=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(c.length!==p.length)throw new mi(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw RangeError(`Dimension mismatch. Matrix A (`+c+`) must match Matrix B (`+p+`)`);var h=c[0],g=c[1],_,v=n,y=0,b=i;typeof l==`string`&&l===m&&l!==`mixed`&&(_=l,v=t.find(n,[_,_]),y=t.convert(0,_),b=t.find(i,[_,_]));var x=a&&u?[]:void 0,S=[],C=[],w=x?[]:void 0,T=x?[]:void 0,E=[],D=[],O,k,A,j;for(k=0;k<g;k++){C[k]=S.length;var M=k+1;for(A=s[k],j=s[k+1];A<j;A++)O=o[A],S.push(O),E[O]=M,w&&(w[O]=a[A]);for(A=f[k],j=f[k+1];A<j;A++)O=d[A],E[O]!==M&&S.push(O),D[O]=M,T&&(T[O]=u[A]);if(x)for(A=C[k];A<S.length;){O=S[A];var N=E[O],P=D[O];if(N===M||P===M){var F=N===M?w[O]:y,ee=P===M?T[O]:y,te=b(F,ee);v(te,y)?S.splice(A,1):(x.push(te),A++)}}}return C[g]=S.length,e.createSparseMatrix({values:x,index:S,ptr:C,size:[h,g],datatype:l===e._datatype&&m===r._datatype?_:void 0})}}),pc=V(`matAlgo13xDD`,[`typed`],e=>{var{typed:t}=e;return function(e,r,i){var a=e._data,o=e._size,s=e._datatype,c=r._data,l=r._size,u=r._datatype,d=[];if(o.length!==l.length)throw new mi(o.length,l.length);for(var f=0;f<o.length;f++){if(o[f]!==l[f])throw RangeError(`Dimension mismatch. Matrix A (`+o+`) must match Matrix B (`+l+`)`);d[f]=o[f]}var p,m=i;typeof s==`string`&&s===u&&(p=s,m=t.find(i,[p,p]));var h=d.length>0?n(m,0,d,d[0],a,c):[];return e.createDenseMatrix({data:h,size:d,datatype:p})};function n(e,t,r,i,a,o){var s=[];if(t===r.length-1)for(var c=0;c<i;c++)s[c]=e(a[c],o[c]);else for(var l=0;l<i;l++)s[l]=n(e,t+1,r,r[t+1],a[l],o[l]);return s}});function mc(e,t){if(Le(e.size(),t.size()))return[e,t];var n=Ui(e.size(),t.size());return[e,t].map(e=>hc(e,n))}function hc(e,t){return Le(e.size(),t)?e:e.create(Gi(e.valueOf(),t),e.datatype())}var gc=V(`matrixAlgorithmSuite`,[`typed`,`matrix`],e=>{var{typed:t,matrix:n}=e,r=pc({typed:t}),i=Us({typed:t});return function(e){var a=e.elop,o=e.SD||e.DS,s;a?(s={"DenseMatrix, DenseMatrix":(e,t)=>r(...mc(e,t),a),"Array, Array":(e,t)=>r(...mc(n(e),n(t)),a).valueOf(),"Array, DenseMatrix":(e,t)=>r(...mc(n(e),t),a),"DenseMatrix, Array":(e,t)=>r(...mc(e,n(t)),a)},e.SS&&(s[`SparseMatrix, SparseMatrix`]=(t,n)=>e.SS(...mc(t,n),a,!1)),e.DS&&(s[`DenseMatrix, SparseMatrix`]=(t,n)=>e.DS(...mc(t,n),a,!1),s[`Array, SparseMatrix`]=(t,r)=>e.DS(...mc(n(t),r),a,!1)),o&&(s[`SparseMatrix, DenseMatrix`]=(e,t)=>o(...mc(t,e),a,!0),s[`SparseMatrix, Array`]=(e,t)=>o(...mc(n(t),e),a,!0))):(s={"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,n)=>r(...mc(t,n),e)),"Array, Array":t.referToSelf(e=>(t,i)=>r(...mc(n(t),n(i)),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,i)=>r(...mc(n(t),i),e)),"DenseMatrix, Array":t.referToSelf(e=>(t,i)=>r(...mc(t,n(i)),e))},e.SS&&(s[`SparseMatrix, SparseMatrix`]=t.referToSelf(t=>(n,r)=>e.SS(...mc(n,r),t,!1))),e.DS&&(s[`DenseMatrix, SparseMatrix`]=t.referToSelf(t=>(n,r)=>e.DS(...mc(n,r),t,!1)),s[`Array, SparseMatrix`]=t.referToSelf(t=>(r,i)=>e.DS(...mc(n(r),i),t,!1))),o&&(s[`SparseMatrix, DenseMatrix`]=t.referToSelf(e=>(t,n)=>o(...mc(n,t),e,!0)),s[`SparseMatrix, Array`]=t.referToSelf(e=>(t,r)=>o(...mc(n(r),t),e,!0))));var c=e.scalar||`any`;(e.Ds||e.Ss)&&(a?(s[`DenseMatrix,`+c]=(e,t)=>i(e,t,a,!1),s[c+`, DenseMatrix`]=(e,t)=>i(t,e,a,!0),s[`Array,`+c]=(e,t)=>i(n(e),t,a,!1).valueOf(),s[c+`, Array`]=(e,t)=>i(n(t),e,a,!0).valueOf()):(s[`DenseMatrix,`+c]=t.referToSelf(e=>(t,n)=>i(t,n,e,!1)),s[c+`, DenseMatrix`]=t.referToSelf(e=>(t,n)=>i(n,t,e,!0)),s[`Array,`+c]=t.referToSelf(e=>(t,r)=>i(n(t),r,e,!1).valueOf()),s[c+`, Array`]=t.referToSelf(e=>(t,r)=>i(n(r),t,e,!0).valueOf())));var l=e.sS===void 0?e.Ss:e.sS;return a?(e.Ss&&(s[`SparseMatrix,`+c]=(t,n)=>e.Ss(t,n,a,!1)),l&&(s[c+`, SparseMatrix`]=(e,t)=>l(t,e,a,!0))):(e.Ss&&(s[`SparseMatrix,`+c]=t.referToSelf(t=>(n,r)=>e.Ss(n,r,t,!1))),l&&(s[c+`, SparseMatrix`]=t.referToSelf(e=>(t,n)=>l(n,t,e,!0)))),a&&a.signatures&&Fe(s,a.signatures),s}}),_c=`mod`,vc=V(_c,[`typed`,`config`,`round`,`matrix`,`equalScalar`,`zeros`,`DenseMatrix`,`concat`],e=>{var{typed:t,config:n,round:r,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s,concat:c}=e,l=lc({typed:t,config:n,round:r,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}),u=uc({typed:t,equalScalar:a}),d=dc({typed:t}),f=fc({typed:t,equalScalar:a}),p=Vs({typed:t,equalScalar:a}),m=Hs({typed:t,DenseMatrix:s}),h=gc({typed:t,matrix:i,concat:c});return t(_c,{"number, number":g,"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(l(e.div(t))))},"bigint, bigint":function(e,t){if(t===0n)return e;if(e<0){var n=e%t;return n===0n?n:n+t}return e%t},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(l(e.div(t))))}},h({SS:f,DS:d,SD:u,Ss:p,sS:m}));function g(e,t){return t===0?e:e-t*l(e/t)}}),yc=V(`matAlgo01xDSid`,[`typed`],e=>{var{typed:t}=e;return function(e,n,r,i){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),c=n._values,l=n._index,u=n._ptr,d=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(o.length!==d.length)throw new mi(o.length,d.length);if(o[0]!==d[0]||o[1]!==d[1])throw RangeError(`Dimension mismatch. Matrix A (`+o+`) must match Matrix B (`+d+`)`);if(!c)throw Error(`Cannot perform operation on Dense Matrix and Pattern Sparse Matrix`);var p=o[0],m=o[1],h=typeof s==`string`&&s!==`mixed`&&s===f?s:void 0,g=h?t.find(r,[h,h]):r,_,v,y=[];for(_=0;_<p;_++)y[_]=[];var b=[],x=[];for(v=0;v<m;v++){for(var S=v+1,C=u[v],w=u[v+1],T=C;T<w;T++)_=l[T],b[_]=i?g(c[T],a[_][v]):g(a[_][v],c[T]),x[_]=S;for(_=0;_<p;_++)x[_]===S?y[_][v]=b[_]:y[_][v]=a[_][v]}return e.createDenseMatrix({data:y,size:[p,m],datatype:s===e._datatype&&f===n._datatype?h:void 0})}}),bc=V(`matAlgo04xSidSid`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,c=e._size,l=e._datatype||e._data===void 0?e._datatype:e.getDataType(),u=r._values,d=r._index,f=r._ptr,p=r._size,m=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(c.length!==p.length)throw new mi(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw RangeError(`Dimension mismatch. Matrix A (`+c+`) must match Matrix B (`+p+`)`);var h=c[0],g=c[1],_,v=n,y=0,b=i;typeof l==`string`&&l===m&&l!==`mixed`&&(_=l,v=t.find(n,[_,_]),y=t.convert(0,_),b=t.find(i,[_,_]));var x=a&&u?[]:void 0,S=[],C=[],w=a&&u?[]:void 0,T=a&&u?[]:void 0,E=[],D=[],O,k,A,j,M;for(k=0;k<g;k++){C[k]=S.length;var N=k+1;for(j=s[k],M=s[k+1],A=j;A<M;A++)O=o[A],S.push(O),E[O]=N,w&&(w[O]=a[A]);for(j=f[k],M=f[k+1],A=j;A<M;A++)if(O=d[A],E[O]===N){if(w){var P=b(w[O],u[A]);v(P,y)?E[O]=null:w[O]=P}}else S.push(O),D[O]=N,T&&(T[O]=u[A]);if(w&&T)for(A=C[k];A<S.length;)O=S[A],E[O]===N?(x[A]=w[O],A++):D[O]===N?(x[A]=T[O],A++):S.splice(A,1)}return C[g]=S.length,e.createSparseMatrix({values:x,index:S,ptr:C,size:[h,g],datatype:l===e._datatype&&m===r._datatype?_:void 0})}}),xc=V(`matAlgo10xSids`,[`typed`,`DenseMatrix`],e=>{var{typed:t,DenseMatrix:n}=e;return function(e,r,i,a){var o=e._values,s=e._index,c=e._ptr,l=e._size,u=e._datatype;if(!o)throw Error(`Cannot perform operation on Pattern Sparse Matrix and Scalar value`);var d=l[0],f=l[1],p,m=i;typeof u==`string`&&(p=u,r=t.convert(r,p),m=t.find(i,[p,p]));for(var h=[],g=[],_=[],v=0;v<f;v++){for(var y=v+1,b=c[v],x=c[v+1],S=b;S<x;S++){var C=s[S];g[C]=o[S],_[C]=y}for(var w=0;w<d;w++)v===0&&(h[w]=[]),_[w]===y?h[w][v]=a?m(r,g[w]):m(g[w],r):h[w][v]=r}return new n({data:h,size:[d,f],datatype:p})}});function Sc(e,t,n,r){if(!(this instanceof Sc))throw SyntaxError(`Constructor must be called with the new operator`);this.fn=e,this.count=t,this.min=n,this.max=r,this.message=`Wrong number of arguments in function `+e+` (`+t+` provided, `+n+(r==null?``:`-`+r)+` expected)`,this.stack=Error().stack}Sc.prototype=Error(),Sc.prototype.constructor=Error,Sc.prototype.name=`ArgumentsError`,Sc.prototype.isArgumentsError=!0;var Cc=`gcd`,wc=[`typed`,`config`,`round`,`matrix`,`equalScalar`,`zeros`,`BigNumber`,`DenseMatrix`,`concat`],Tc=`number | BigNumber | Fraction | Matrix | Array`,Ec=`${Tc}, ${Tc}, ...${Tc}`;function Dc(e){return!e.some(e=>Array.isArray(e))}var Oc=V(Cc,wc,e=>{var{typed:t,matrix:n,config:r,round:i,equalScalar:a,zeros:o,BigNumber:s,DenseMatrix:c,concat:l}=e,u=vc({typed:t,config:r,round:i,matrix:n,equalScalar:a,zeros:o,DenseMatrix:c,concat:l}),d=yc({typed:t}),f=bc({typed:t,equalScalar:a}),p=xc({typed:t,DenseMatrix:c}),m=gc({typed:t,matrix:n,concat:l});return t(Cc,{"number, number":h,"BigNumber, BigNumber":g,"Fraction, Fraction":(e,t)=>e.gcd(t)},m({SS:f,DS:d,Ss:p}),{[Ec]:t.referToSelf(e=>(t,n,r)=>{for(var i=e(t,n),a=0;a<r.length;a++)i=e(i,r[a]);return i}),Array:t.referToSelf(e=>t=>{if(t.length===1&&Array.isArray(t[0])&&Dc(t[0]))return e(...t[0]);if(Dc(t))return e(...t);throw new Sc(`gcd() supports only 1d matrices!`)}),Matrix:t.referToSelf(e=>t=>e(t.toArray()))});function h(e,t){if(!H(e)||!H(t))throw Error(`Parameters in function gcd must be integer numbers`);for(var n;t!==0;)n=u(e,t),e=t,t=n;return e<0?-e:e}function g(e,t){if(!e.isInt()||!t.isInt())throw Error(`Parameters in function gcd must be integer numbers`);for(var n=new s(0);!t.isZero();){var r=u(e,t);e=t,t=r}return e.lt(n)?e.neg():e}}),kc=V(`matAlgo06xS0S0`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._size,s=e._datatype||e._data===void 0?e._datatype:e.getDataType(),c=r._values,l=r._size,u=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(o.length!==l.length)throw new mi(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw RangeError(`Dimension mismatch. Matrix A (`+o+`) must match Matrix B (`+l+`)`);var d=o[0],f=o[1],p,m=n,h=0,g=i;typeof s==`string`&&s===u&&s!==`mixed`&&(p=s,m=t.find(n,[p,p]),h=t.convert(0,p),g=t.find(i,[p,p]));for(var _=a&&c?[]:void 0,v=[],y=[],b=_?[]:void 0,x=[],S=[],C=0;C<f;C++){y[C]=v.length;var w=C+1;if(fa(e,C,x,b,S,w,v,g),fa(r,C,x,b,S,w,v,g),b)for(var T=y[C];T<v.length;){var E=v[T];if(S[E]===w){var D=b[E];m(D,h)?v.splice(T,1):(_.push(D),T++)}else v.splice(T,1)}else for(var O=y[C];O<v.length;)S[v[O]]===w?O++:v.splice(O,1)}return y[f]=v.length,e.createSparseMatrix({values:_,index:v,ptr:y,size:[d,f],datatype:s===e._datatype&&u===r._datatype?p:void 0})}}),Ac=`lcm`,jc=V(Ac,[`typed`,`matrix`,`equalScalar`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,concat:i}=e,a=uc({typed:t,equalScalar:r}),o=kc({typed:t,equalScalar:r}),s=Vs({typed:t,equalScalar:r}),c=gc({typed:t,matrix:n,concat:i}),l=`number | BigNumber | Fraction | Matrix | Array`,u={};return u[`${l}, ${l}, ...${l}`]=t.referToSelf(e=>(t,n,r)=>{for(var i=e(t,n),a=0;a<r.length;a++)i=e(i,r[a]);return i}),t(Ac,{"number, number":Da,"BigNumber, BigNumber":d,"Fraction, Fraction":(e,t)=>e.lcm(t)},c({SS:o,DS:a,Ss:s}),u);function d(e,t){if(!e.isInt()||!t.isInt())throw Error(`Parameters in function lcm must be integer numbers`);if(e.isZero())return e;if(t.isZero())return t;for(var n=e.times(t);!t.isZero();){var r=t;t=e.mod(r),e=r}return n.div(e).abs()}});function Mc(e,t,n,r){return function(i){if(i>0||n.predictable){if(i<=0)return NaN;var a=i.toString(16),o=a.substring(0,15);return e*(a.length-o.length)+t(Number(`0x`+o))}return r(i.toNumber())}}var Nc=`log10`,Pc=[`typed`,`config`,`Complex`],Fc=ka(16),Ic=V(Nc,Pc,e=>{var{typed:t,config:n,Complex:r}=e;function i(e){return e.log().div(Math.LN10)}function a(e){return i(new r(e,0))}return t(Nc,{number:function(e){return e>=0||n.predictable?ka(e):a(e)},bigint:Mc(Fc,ka,n,a),Complex:i,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log():a(e.toNumber())},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),Lc=`log2`,Rc=V(Lc,[`typed`,`config`,`Complex`],e=>{var{typed:t,config:n,Complex:r}=e;function i(e){return a(new r(e,0))}return t(Lc,{number:function(e){return e>=0||n.predictable?Aa(e):i(e)},bigint:Mc(4,Aa,n,i),Complex:a,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log(2):i(e.toNumber())},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))});function a(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}),zc=V(`multiplyScalar`,[`typed`],e=>{var{typed:t}=e;return t(`multiplyScalar`,{"number, number":ba,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"bigint, bigint":function(e,t){return e*t},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":(e,t)=>t.multiply(e),"Unit, number | Fraction | BigNumber | Complex | Unit":(e,t)=>e.multiply(t)})}),Bc=`multiply`,Vc=V(Bc,[`typed`,`matrix`,`addScalar`,`multiplyScalar`,`equalScalar`,`dot`],e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:i,equalScalar:a,dot:o}=e,s=Vs({typed:t,equalScalar:a}),c=Us({typed:t});function l(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw RangeError(`Dimension mismatch in multiplication. Vectors must have the same length`);break;case 2:if(e[0]!==t[0])throw RangeError(`Dimension mismatch in multiplication. Vector length (`+e[0]+`) must match Matrix rows (`+t[0]+`)`);break;default:throw Error(`Can only multiply a 1 or 2 dimensional matrix (Matrix B has `+t.length+` dimensions)`)}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw RangeError(`Dimension mismatch in multiplication. Matrix columns (`+e[1]+`) must match Vector length (`+t[0]+`)`);break;case 2:if(e[1]!==t[0])throw RangeError(`Dimension mismatch in multiplication. Matrix A columns (`+e[1]+`) must match Matrix B rows (`+t[0]+`)`);break;default:throw Error(`Can only multiply a 1 or 2 dimensional matrix (Matrix B has `+t.length+` dimensions)`)}break;default:throw Error(`Can only multiply a 1 or 2 dimensional matrix (Matrix A has `+e.length+` dimensions)`)}}function u(e,t,n){if(n===0)throw Error(`Cannot multiply two empty vectors`);return o(e,t)}function d(e,t){if(t.storage()!==`dense`)throw Error(`Support for SparseMatrix not implemented`);return f(e,t)}function f(e,n){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),c=n._data,l=n._size,u=n._datatype||n.getDataType(),d=o[0],f=l[1],p,m=r,h=i;s&&u&&s===u&&typeof s==`string`&&s!==`mixed`&&(p=s,m=t.find(r,[p,p]),h=t.find(i,[p,p]));for(var g=[],_=0;_<f;_++){for(var v=h(a[0],c[0][_]),y=1;y<d;y++)v=m(v,h(a[y],c[y][_]));g[_]=v}return e.createDenseMatrix({data:g,size:[f],datatype:s===e._datatype&&u===n._datatype?p:void 0})}var p=t(`_multiplyMatrixVector`,{"DenseMatrix, any":h,"SparseMatrix, any":v}),m=t(`_multiplyMatrixMatrix`,{"DenseMatrix, DenseMatrix":g,"DenseMatrix, SparseMatrix":_,"SparseMatrix, DenseMatrix":y,"SparseMatrix, SparseMatrix":b});function h(e,n){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),c=n._data,l=n._datatype||n.getDataType(),u=o[0],d=o[1],f,p=r,m=i;s&&l&&s===l&&typeof s==`string`&&s!==`mixed`&&(f=s,p=t.find(r,[f,f]),m=t.find(i,[f,f]));for(var h=[],g=0;g<u;g++){for(var _=a[g],v=m(_[0],c[0]),y=1;y<d;y++)v=p(v,m(_[y],c[y]));h[g]=v}return e.createDenseMatrix({data:h,size:[u],datatype:s===e._datatype&&l===n._datatype?f:void 0})}function g(e,n){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),c=n._data,l=n._size,u=n._datatype||n.getDataType(),d=o[0],f=o[1],p=l[1],m,h=r,g=i;s&&u&&s===u&&typeof s==`string`&&s!==`mixed`&&s!==`mixed`&&(m=s,h=t.find(r,[m,m]),g=t.find(i,[m,m]));for(var _=[],v=0;v<d;v++){var y=a[v];_[v]=[];for(var b=0;b<p;b++){for(var x=g(y[0],c[0][b]),S=1;S<f;S++)x=h(x,g(y[S],c[S][b]));_[v][b]=x}}return e.createDenseMatrix({data:_,size:[d,p],datatype:s===e._datatype&&u===n._datatype?m:void 0})}function _(e,n){var o=e._data,s=e._size,c=e._datatype||e.getDataType(),l=n._values,u=n._index,d=n._ptr,f=n._size,p=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(!l)throw Error(`Cannot multiply Dense Matrix times Pattern only Matrix`);var m=s[0],h=f[1],g,_=r,v=i,y=a,b=0;c&&p&&c===p&&typeof c==`string`&&c!==`mixed`&&(g=c,_=t.find(r,[g,g]),v=t.find(i,[g,g]),y=t.find(a,[g,g]),b=t.convert(0,g));for(var x=[],S=[],C=[],w=n.createSparseMatrix({values:x,index:S,ptr:C,size:[m,h],datatype:c===e._datatype&&p===n._datatype?g:void 0}),T=0;T<h;T++){C[T]=S.length;var E=d[T],D=d[T+1];if(D>E)for(var O=0,k=0;k<m;k++){for(var A=k+1,j=void 0,M=E;M<D;M++){var N=u[M];O===A?j=_(j,v(o[k][N],l[M])):(j=v(o[k][N],l[M]),O=A)}O===A&&!y(j,b)&&(S.push(k),x.push(j))}}return C[h]=S.length,w}function v(e,n){var o=e._values,s=e._index,c=e._ptr,l=e._datatype||e._data===void 0?e._datatype:e.getDataType();if(!o)throw Error(`Cannot multiply Pattern only Matrix times Dense Matrix`);var u=n._data,d=n._datatype||n.getDataType(),f=e._size[0],p=n._size[0],m=[],h=[],g=[],_,v=r,y=i,b=a,x=0;l&&d&&l===d&&typeof l==`string`&&l!==`mixed`&&(_=l,v=t.find(r,[_,_]),y=t.find(i,[_,_]),b=t.find(a,[_,_]),x=t.convert(0,_));var S=[],C=[];g[0]=0;for(var w=0;w<p;w++){var T=u[w];if(!b(T,x))for(var E=c[w],D=c[w+1],O=E;O<D;O++){var k=s[O];C[k]?S[k]=v(S[k],y(T,o[O])):(C[k]=!0,h.push(k),S[k]=y(T,o[O]))}}for(var A=h.length,j=0;j<A;j++){var M=h[j];m[j]=S[M]}return g[1]=h.length,e.createSparseMatrix({values:m,index:h,ptr:g,size:[f,1],datatype:l===e._datatype&&d===n._datatype?_:void 0})}function y(e,n){var o=e._values,s=e._index,c=e._ptr,l=e._datatype||e._data===void 0?e._datatype:e.getDataType();if(!o)throw Error(`Cannot multiply Pattern only Matrix times Dense Matrix`);var u=n._data,d=n._datatype||n.getDataType(),f=e._size[0],p=n._size[0],m=n._size[1],h,g=r,_=i,v=a,y=0;l&&d&&l===d&&typeof l==`string`&&l!==`mixed`&&(h=l,g=t.find(r,[h,h]),_=t.find(i,[h,h]),v=t.find(a,[h,h]),y=t.convert(0,h));for(var b=[],x=[],S=[],C=e.createSparseMatrix({values:b,index:x,ptr:S,size:[f,m],datatype:l===e._datatype&&d===n._datatype?h:void 0}),w=[],T=[],E=0;E<m;E++){S[E]=x.length;for(var D=E+1,O=0;O<p;O++){var k=u[O][E];if(!v(k,y))for(var A=c[O],j=c[O+1],M=A;M<j;M++){var N=s[M];T[N]===D?w[N]=g(w[N],_(k,o[M])):(T[N]=D,x.push(N),w[N]=_(k,o[M]))}}for(var P=S[E],F=x.length,ee=P;ee<F;ee++){var te=x[ee];b[ee]=w[te]}}return S[m]=x.length,C}function b(e,n){var a=e._values,o=e._index,s=e._ptr,c=e._datatype||e._data===void 0?e._datatype:e.getDataType(),l=n._values,u=n._index,d=n._ptr,f=n._datatype||n._data===void 0?n._datatype:n.getDataType(),p=e._size[0],m=n._size[1],h=a&&l,g,_=r,v=i;c&&f&&c===f&&typeof c==`string`&&c!==`mixed`&&(g=c,_=t.find(r,[g,g]),v=t.find(i,[g,g]));for(var y=h?[]:void 0,b=[],x=[],S=e.createSparseMatrix({values:y,index:b,ptr:x,size:[p,m],datatype:c===e._datatype&&f===n._datatype?g:void 0}),C=h?[]:void 0,w=[],T,E,D,O,k,A,j,M,N=0;N<m;N++){x[N]=b.length;var P=N+1;for(k=d[N],A=d[N+1],O=k;O<A;O++)if(M=u[O],h)for(E=s[M],D=s[M+1],T=E;T<D;T++)j=o[T],w[j]===P?C[j]=_(C[j],v(l[O],a[T])):(w[j]=P,b.push(j),C[j]=v(l[O],a[T]));else for(E=s[M],D=s[M+1],T=E;T<D;T++)j=o[T],w[j]!==P&&(w[j]=P,b.push(j));if(h)for(var F=x[N],ee=b.length,te=F;te<ee;te++){var ne=b[te];y[te]=C[ne]}}return x[m]=b.length,S}return t(Bc,i,{"Array, Array":t.referTo(`Matrix, Matrix`,e=>(t,r)=>{l(gi(t),gi(r));var i=e(n(t),n(r));return F(i)?i.valueOf():i}),"Matrix, Matrix":function(e,t){var n=e.size(),r=t.size();return l(n,r),n.length===1?r.length===1?u(e,t,n[0]):d(e,t):r.length===1?p(e,t):m(e,t)},"Matrix, Array":t.referTo(`Matrix,Matrix`,e=>(t,r)=>e(t,n(r))),"Array, Matrix":t.referToSelf(e=>(t,r)=>e(n(t,r.storage()),r)),"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return c(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return c(t,e,i,!0)},"Array, any":function(e,t){return c(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(e=>(t,n,r)=>{for(var i=e(t,n),a=0;a<r.length;a++)i=e(i,r[a]);return i})})}),Hc=`nthRoot`,Uc=V(Hc,[`typed`,`matrix`,`equalScalar`,`BigNumber`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,concat:a}=e,o=yc({typed:t}),s=uc({typed:t,equalScalar:r}),c=kc({typed:t,equalScalar:r}),l=Vs({typed:t,equalScalar:r}),u=gc({typed:t,matrix:n,concat:a});function d(){throw Error(`Complex number not supported in function nthRoot. Use nthRoots instead.`)}return t(Hc,{number:ja,"number, number":ja,BigNumber:e=>f(e,new i(2)),"BigNumber, BigNumber":f,Complex:d,"Complex, number":d,Array:t.referTo(`DenseMatrix,number`,e=>t=>e(n(t),2).valueOf()),DenseMatrix:t.referTo(`DenseMatrix,number`,e=>t=>e(t,2)),SparseMatrix:t.referTo(`SparseMatrix,number`,e=>t=>e(t,2)),"SparseMatrix, SparseMatrix":t.referToSelf(e=>(t,n)=>{if(n.density()===1)return c(t,n,e);throw Error(`Root must be non-zero`)}),"DenseMatrix, SparseMatrix":t.referToSelf(e=>(t,n)=>{if(n.density()===1)return o(t,n,e,!1);throw Error(`Root must be non-zero`)}),"Array, SparseMatrix":t.referTo(`DenseMatrix,SparseMatrix`,e=>(t,r)=>e(n(t),r)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>{if(n.density()===1)return l(n,t,e,!0);throw Error(`Root must be non-zero`)})},u({scalar:`number | BigNumber`,SD:s,Ss:l,sS:!1}));function f(e,t){var n=i.precision,r=i.clone({precision:n+2}),a=new i(0),o=new r(1),s=t.isNegative();if(s&&(t=t.neg()),t.isZero())throw Error(`Root must be non-zero`);if(e.isNegative()&&!t.abs().mod(2).equals(1))throw Error(`Root must be odd when a is negative.`);if(e.isZero())return s?new r(1/0):0;if(!e.isFinite())return s?a:e;var c=e.abs().pow(o.div(t));return c=e.isNeg()?c.neg():c,new i((s?o.div(c):c).toPrecision(n))}}),Wc=`sign`,Gc=V(Wc,[`typed`,`BigNumber`,`Fraction`,`complex`],e=>{var{typed:t,BigNumber:n,complex:r,Fraction:i}=e;return t(Wc,{number:Ma,Complex:function(e){return e.im===0?r(Ma(e.re)):e.sign()},BigNumber:function(e){return new n(e.cmp(0))},bigint:function(e){return e>0n?1n:e<0n?-1n:0n},Fraction:function(e){return e.n===0n?new i(0):new i(e.s)},"Array | Matrix":t.referToSelf(e=>t=>la(t,e,!0)),Unit:t.referToSelf(e=>n=>{if(!n._isDerived()&&n.units[0].unit.offset!==0)throw TypeError(`sign is ambiguous for units with offset`);return t.find(e,n.valueType())(n.value)})})}),Kc=V(`sqrt`,[`config`,`typed`,`Complex`],e=>{var{config:t,typed:n,Complex:r}=e;return n(`sqrt`,{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new r(e,0).sqrt()}}),qc=`square`,Jc=V(qc,[`typed`],e=>{var{typed:t}=e;return t(qc,{number:Na,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},bigint:function(e){return e*e},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})}),Yc=`subtract`,Xc=V(Yc,[`typed`,`matrix`,`equalScalar`,`subtractScalar`,`unaryMinus`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,subtractScalar:i,unaryMinus:a,DenseMatrix:o,concat:s}=e,c=yc({typed:t}),l=dc({typed:t}),u=fc({typed:t,equalScalar:r}),d=xc({typed:t,DenseMatrix:o}),f=Hs({typed:t,DenseMatrix:o}),p=gc({typed:t,matrix:n,concat:s});return t(Yc,{"any, any":i},p({elop:i,SS:u,DS:c,SD:l,Ss:f,sS:d}))}),Zc=`xgcd`,Qc=V(Zc,[`typed`,`config`,`matrix`,`BigNumber`],e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(Zc,{"number, number":function(e,t){var i=Pa(e,t);return n.matrix===`Array`?i:r(i)},"BigNumber, BigNumber":a});function a(e,t){var a,o,s,c=new i(0),l=new i(1),u=c,d=l,f=l,p=c;if(!e.isInt()||!t.isInt())throw Error(`Parameters in function xgcd must be integer numbers`);for(;!t.isZero();)o=e.div(t).floor(),s=e.mod(t),a=u,u=d.minus(o.times(u)),d=a,a=f,f=p.minus(o.times(f)),p=a,e=t,t=s;var m=e.lt(c)?[e.neg(),d.neg(),p.neg()]:[e,e.isZero()?0:d,p];return n.matrix===`Array`?m:r(m)}}),$c=`invmod`,el=V($c,[`typed`,`config`,`BigNumber`,`xgcd`,`equal`,`smaller`,`mod`,`add`,`isInteger`],e=>{var{typed:t,config:n,BigNumber:r,xgcd:i,equal:a,smaller:o,mod:s,add:c,isInteger:l}=e;return t($c,{"number, number":u,"BigNumber, BigNumber":u});function u(e,t){if(!l(e)||!l(t))throw Error(`Parameters in function invmod must be integer numbers`);if(e=s(e,t),a(t,0))throw Error(`Divisor must be non zero`);var n=i(e,t);n=n.valueOf();var[u,d]=n;return a(u,r(1))?(d=s(d,t),o(d,r(0))&&(d=c(d,t)),d):NaN}}),tl=V(`matAlgo09xS0Sf`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,c=e._size,l=e._datatype||e._data===void 0?e._datatype:e.getDataType(),u=r._values,d=r._index,f=r._ptr,p=r._size,m=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(c.length!==p.length)throw new mi(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw RangeError(`Dimension mismatch. Matrix A (`+c+`) must match Matrix B (`+p+`)`);var h=c[0],g=c[1],_,v=n,y=0,b=i;typeof l==`string`&&l===m&&l!==`mixed`&&(_=l,v=t.find(n,[_,_]),y=t.convert(0,_),b=t.find(i,[_,_]));var x=a&&u?[]:void 0,S=[],C=[],w=x?[]:void 0,T=[],E,D,O,k,A;for(D=0;D<g;D++){C[D]=S.length;var j=D+1;if(w)for(k=f[D],A=f[D+1],O=k;O<A;O++)E=d[O],T[E]=j,w[E]=u[O];for(k=s[D],A=s[D+1],O=k;O<A;O++)if(E=o[O],w){var M=T[E]===j?w[E]:y,N=b(a[O],M);v(N,y)||(S.push(E),x.push(N))}else S.push(E)}return C[g]=S.length,e.createSparseMatrix({values:x,index:S,ptr:C,size:[h,g],datatype:l===e._datatype&&m===r._datatype?_:void 0})}}),nl=`dotMultiply`,rl=V(nl,[`typed`,`matrix`,`equalScalar`,`multiplyScalar`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,multiplyScalar:i,concat:a}=e,o=uc({typed:t,equalScalar:r}),s=tl({typed:t,equalScalar:r}),c=Vs({typed:t,equalScalar:r});return t(nl,gc({typed:t,matrix:n,concat:a})({elop:i,SS:s,DS:o,Ss:c}))});function il(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error(`Integers expected in function bitAnd`);var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return sl(e,t,function(e,t){return e&t})}function al(e){if(e.isFinite()&&!e.isInteger())throw Error(`Integer expected in function bitNot`);var t=e.constructor,n=t.precision;t.config({precision:1e9});var r=e.plus(new t(1));return r.s=-r.s||null,t.config({precision:n}),r}function ol(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error(`Integers expected in function bitOr`);var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);var r=new n(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:!e.isFinite()||!t.isFinite()?!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e:sl(e,t,function(e,t){return e|t})}function sl(e,t,n){var r=e.constructor,i,a,o=+(e.s<0),s=+(t.s<0);if(o){i=cl(al(e));for(var c=0;c<i.length;++c)i[c]^=1}else i=cl(e);if(s){a=cl(al(t));for(var l=0;l<a.length;++l)a[l]^=1}else a=cl(t);var u,d,f;i.length<=a.length?(u=i,d=a,f=o):(u=a,d=i,f=s);var p=u.length,m=d.length,h=n(o,s)^1,g=new r(h^1),_=new r(1),v=new r(2),y=r.precision;for(r.config({precision:1e9});p>0;)n(u[--p],d[--m])===h&&(g=g.plus(_)),_=_.times(v);for(;m>0;)n(f,d[--m])===h&&(g=g.plus(_)),_=_.times(v);return r.config({precision:y}),h===0&&(g.s=-g.s),g}function cl(e){for(var t=e.d,n=t[0]+``,r=1;r<t.length;++r){for(var i=t[r]+``,a=7-i.length;a--;)i=`0`+i;n+=i}for(var o=n.length;n.charAt(o)===`0`;)o--;var s=e.e,c=n.slice(0,o+1||1),l=c.length;if(s>0)if(++s>l)for(s-=l;s--;)c+=`0`;else s<l&&(c=c.slice(0,s)+`.`+c.slice(s));for(var u=[0],d=0;d<c.length;){for(var f=u.length;f--;)u[f]*=10;u[0]+=parseInt(c.charAt(d++));for(var p=0;p<u.length;++p)u[p]>1&&((u[p+1]===null||u[p+1]===void 0)&&(u[p+1]=0),u[p+1]+=u[p]>>1,u[p]&=1)}return u.reverse()}function ll(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error(`Integers expected in function bitXor`);var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new n(0);var r=new n(-1);return e.eq(r)?al(t):t.eq(r)?al(e):!e.isFinite()||!t.isFinite()?!e.isFinite()&&!t.isFinite()?r:new n(e.isNegative()===t.isNegative()?1/0:-1/0):sl(e,t,function(e,t){return e^t})}function ul(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error(`Integers expected in function leftShift`);var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:!e.isFinite()&&!t.isFinite()?new n(NaN):t.lt(55)?e.times(2**t.toNumber()+``):e.times(new n(2).pow(t))}function dl(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw Error(`Integers expected in function rightArithShift`);var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(2**t.toNumber()+``).floor():e.div(new n(2).pow(t)).floor():e.isNegative()?new n(-1):e.isFinite()?new n(0):new n(NaN)}var fl=`bitAnd`,pl=V(fl,[`typed`,`matrix`,`equalScalar`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,concat:i}=e,a=uc({typed:t,equalScalar:r}),o=kc({typed:t,equalScalar:r}),s=Vs({typed:t,equalScalar:r}),c=gc({typed:t,matrix:n,concat:i});return t(fl,{"number, number":za,"BigNumber, BigNumber":il,"bigint, bigint":(e,t)=>e&t},c({SS:o,DS:a,Ss:s}))}),ml=`bitNot`,hl=V(ml,[`typed`],e=>{var{typed:t}=e;return t(ml,{number:Ba,BigNumber:al,bigint:e=>~e,"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),gl=`bitOr`,_l=V(gl,[`typed`,`matrix`,`equalScalar`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a}=e,o=yc({typed:t}),s=bc({typed:t,equalScalar:r}),c=xc({typed:t,DenseMatrix:i}),l=gc({typed:t,matrix:n,concat:a});return t(gl,{"number, number":Va,"BigNumber, BigNumber":ol,"bigint, bigint":(e,t)=>e|t},l({SS:s,DS:o,Ss:c}))}),vl=V(`matAlgo07xSSf`,[`typed`,`SparseMatrix`],e=>{var{typed:t,SparseMatrix:n}=e;return function(e,i,a){var o=e._size,s=e._datatype||e._data===void 0?e._datatype:e.getDataType(),c=i._size,l=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(o.length!==c.length)throw new mi(o.length,c.length);if(o[0]!==c[0]||o[1]!==c[1])throw RangeError(`Dimension mismatch. Matrix A (`+o+`) must match Matrix B (`+c+`)`);var u=o[0],d=o[1],f,p=0,m=a;typeof s==`string`&&s===l&&s!==`mixed`&&(f=s,p=t.convert(0,f),m=t.find(a,[f,f]));for(var h=[],g=[],_=Array(d+1).fill(0),v=[],y=[],b=[],x=[],S=0;S<d;S++){var C=S+1,w=0;r(e,S,b,v,C),r(i,S,x,y,C);for(var T=0;T<u;T++){var E=b[T]===C?v[T]:p,D=x[T]===C?y[T]:p,O=m(E,D);O!==0&&O!==!1&&(g.push(T),h.push(O),w++)}_[S+1]=_[S]+w}return new n({values:h,index:g,ptr:_,size:[u,d],datatype:s===e._datatype&&l===i._datatype?f:void 0})};function r(e,t,n,r,i){for(var a=e._values,o=e._index,s=e._ptr,c=s[t],l=s[t+1];c<l;c++){var u=o[c];n[u]=i,r[u]=a[c]}}}),yl=`bitXor`,bl=V(yl,[`typed`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,matrix:n,DenseMatrix:r,concat:i,SparseMatrix:a}=e,o=dc({typed:t}),s=vl({typed:t,SparseMatrix:a}),c=Hs({typed:t,DenseMatrix:r}),l=gc({typed:t,matrix:n,concat:i});return t(yl,{"number, number":Ha,"BigNumber, BigNumber":ll,"bigint, bigint":(e,t)=>e^t},l({SS:s,DS:o,Ss:c}))}),xl=`arg`,Sl=V(xl,[`typed`],e=>{var{typed:t}=e;return t(xl,{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),Cl=`conj`,wl=V(Cl,[`typed`],e=>{var{typed:t}=e;return t(Cl,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),Unit:t.referToSelf(e=>t=>new t.constructor(e(t.toNumeric()),t.formatUnits())),"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),Tl=`im`,El=V(Tl,[`typed`],e=>{var{typed:t}=e;return t(Tl,{number:()=>0,"BigNumber | Fraction":e=>e.mul(0),Complex:e=>e.im,"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),Dl=`re`,Ol=V(Dl,[`typed`],e=>{var{typed:t}=e;return t(Dl,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.re,"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),kl=`not`,Al=V(kl,[`typed`],e=>{var{typed:t}=e;return t(kl,{"null | undefined":()=>!0,number:eo,Complex:function(e){return e.re===0&&e.im===0},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:t.referToSelf(e=>n=>t.find(e,n.valueType())(n.value)),"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),jl=`nullish`,Ml=V(jl,[`typed`,`matrix`,`size`,`flatten`,`deepEqual`],e=>{var{typed:t,matrix:n,size:r,flatten:i,deepEqual:a}=e,o=dc({typed:t}),s=Us({typed:t}),c=pc({typed:t});return t(jl,{"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any":(e,t)=>e,"null, any":(e,t)=>t,"undefined, any":(e,t)=>t,"SparseMatrix, Array | Matrix":(e,t)=>{var n=r(e),i=r(t);if(a(n,i))return e;throw new mi(n,i)},"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,n)=>c(t,n,e)),"DenseMatrix, SparseMatrix":t.referToSelf(e=>(t,n)=>o(t,n,e,!1)),"DenseMatrix, Array":t.referToSelf(e=>(t,r)=>c(t,n(r),e)),"DenseMatrix, any":t.referToSelf(e=>(t,n)=>s(t,n,e,!1)),"Array, Array":t.referToSelf(e=>(t,r)=>c(n(t),n(r),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,r)=>c(n(t),r,e)),"Array, SparseMatrix":t.referToSelf(e=>(t,r)=>o(n(t),r,e,!1)),"Array, any":t.referToSelf(e=>(t,r)=>s(n(t),r,e,!1).valueOf())})}),Nl=`or`,Pl=V(Nl,[`typed`,`matrix`,`equalScalar`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a}=e,o=dc({typed:t}),s=fc({typed:t,equalScalar:r}),c=Hs({typed:t,DenseMatrix:i}),l=gc({typed:t,matrix:n,concat:a});return t(Nl,{"number, number":to,"Complex, Complex":function(e,t){return e.re!==0||e.im!==0||t.re!==0||t.im!==0},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"bigint, bigint":to,"Unit, Unit":t.referToSelf(e=>(t,n)=>e(t.value||0,n.value||0))},l({SS:s,DS:o,Ss:c}))}),Fl=`xor`,Il=V(Fl,[`typed`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,matrix:n,DenseMatrix:r,concat:i,SparseMatrix:a}=e,o=dc({typed:t}),s=vl({typed:t,SparseMatrix:a}),c=Hs({typed:t,DenseMatrix:r}),l=gc({typed:t,matrix:n,concat:i});return t(Fl,{"number, number":no,"Complex, Complex":function(e,t){return(e.re!==0||e.im!==0)!=(t.re!==0||t.im!==0)},"bigint, bigint":no,"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf(e=>(t,n)=>e(t.value||0,n.value||0))},l({SS:s,DS:o,Ss:c}))}),Ll=`concat`,Rl=V(Ll,[`typed`,`matrix`,`isInteger`],e=>{var{typed:t,matrix:n,isInteger:r}=e;return t(Ll,{"...Array | Matrix | number | BigNumber":function(e){var t,i=e.length,a=-1,o,s=!1,c=[];for(t=0;t<i;t++){var l=e[t];if(F(l)&&(s=!0),D(l)||O(l)){if(t!==i-1)throw Error(`Dimension must be specified as last argument`);if(o=a,a=l.valueOf(),!r(a))throw TypeError(`Integer number expected for dimension`);if(a<0||t>0&&a>o)throw new hi(a,o+1)}else{var u=Ne(l).valueOf(),d=gi(u);if(c[t]=u,o=a,a=d.length-1,t>0&&a!==o)throw new mi(o+1,a+1)}}if(c.length===0)throw SyntaxError(`At least one matrix expected`);for(var f=c.shift();c.length;)f=Hi(f,c.shift(),a);return s?n(f):f},"...string":function(e){return e.join(``)}})}),zl=`column`,Bl=V(zl,[`typed`,`Index`,`matrix`,`range`],e=>{var{typed:t,Index:n,matrix:r,range:i}=e;return t(zl,{"Matrix, number":a,"Array, number":function(e,t){return a(r(Ne(e)),t).valueOf()}});function a(e,t){if(e.size().length!==2)throw Error(`Only two dimensional matrix is supported`);bi(t,e.size()[1]);var a=new n(i(0,e.size()[0]),[t]),o=e.subset(a);return F(o)?o:r([[o]])}}),Vl=`count`,Hl=V(Vl,[`typed`,`size`,`prod`],e=>{var{typed:t,size:n,prod:r}=e;return t(Vl,{string:function(e){return e.length},"Matrix | Array":function(e){return r(n(e))}})}),Ul=`cross`,Wl=V(Ul,[`typed`,`matrix`,`subtract`,`multiply`],e=>{var{typed:t,matrix:n,subtract:r,multiply:i}=e;return t(Ul,{"Matrix, Matrix":function(e,t){return n(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(a(e.toArray(),t))},"Array, Matrix":function(e,t){return n(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var n=Math.max(gi(e).length,gi(t).length);e=Oi(e),t=Oi(t);var a=gi(e),o=gi(t);if(a.length!==1||o.length!==1||a[0]!==3||o[0]!==3)throw RangeError(`Vectors with length 3 expected (Size A = [`+a.join(`, `)+`], B = [`+o.join(`, `)+`])`);var s=[r(i(e[1],t[2]),i(e[2],t[1])),r(i(e[2],t[0]),i(e[0],t[2])),r(i(e[0],t[1]),i(e[1],t[0]))];return n>1?[s]:s}}),Gl=`diag`,Kl=V(Gl,[`typed`,`matrix`,`DenseMatrix`,`SparseMatrix`],e=>{var{typed:t,matrix:n,DenseMatrix:r,SparseMatrix:i}=e;return t(Gl,{Array:function(e){return a(e,0,gi(e),null)},"Array, number":function(e,t){return a(e,t,gi(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),gi(e),null)},"Array, string":function(e,t){return a(e,0,gi(e),t)},"Array, number, string":function(e,t,n){return a(e,t,gi(e),n)},"Array, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),gi(e),n)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return a(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return a(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return a(e,0,e.size(),t)},"Matrix, number, string":function(e,t,n){return a(e,t,e.size(),n)},"Matrix, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),e.size(),n)}});function a(e,t,n,r){if(!H(t))throw TypeError(`Second parameter in function diag must be an integer`);var i=t>0?t:0,a=t<0?-t:0;switch(n.length){case 1:return o(e,t,r,n[0],a,i);case 2:return s(e,t,r,n,a,i)}throw RangeError(`Matrix for function diag must be 2 dimensional`)}function o(e,t,n,a,o,s){var c=[a+o,a+s];if(n&&n!==`sparse`&&n!==`dense`)throw TypeError(`Unknown matrix type ${n}"`);var l=n===`sparse`?i.diagonal(c,e,t):r.diagonal(c,e,t);return n===null?l.valueOf():l}function s(e,t,r,i,a,o){if(F(e)){var s=e.diagonal(t);return r===null?s.valueOf():r===s.storage()?s:n(s,r)}for(var c=Math.min(i[0]-a,i[1]-o),l=[],u=0;u<c;u++)l[u]=e[u+a][u+o];return r===null?l:n(l)}}),ql=V(`filter`,[`typed`],e=>{var{typed:t}=e;return t(`filter`,{"Array, function":Jl,"Matrix, function":function(e,t){return e.create(Jl(e.valueOf(),t),e.datatype())},"Array, RegExp":Ii,"Matrix, RegExp":function(e,t){return e.create(Ii(e.valueOf(),t),e.datatype())}})});function Jl(e,t){var n=Zi(t,e,`filter`);return n.isUnary?Fi(e,n.fn):Fi(e,function(e,t,r){return n.fn(e,[t],r)})}var Yl=`flatten`,Xl=V(Yl,[`typed`],e=>{var{typed:t}=e;return t(Yl,{Array:function(e){return Mi(e)},DenseMatrix:function(e){return e.create(Mi(e.valueOf(),!0),e.datatype())},SparseMatrix:function(e){throw TypeError(`SparseMatrix is not supported by function flatten because it does not support 1D vectors. Convert to a DenseMatrix or Array first. Example: flatten(x.toArray())`)}})}),Zl=`forEach`,Ql=V(Zl,[`typed`],e=>{var{typed:t}=e;return t(Zl,{"Array, function":$l,"Matrix, function":function(e,t){e.forEach(t)}})});function $l(e,t){var n=Zi(t,e,Zl);Yi(e,n.fn,n.isUnary)}var eu=`getMatrixDataType`,tu=V(eu,[`typed`],e=>{var{typed:t}=e;return t(eu,{Array:function(e){return Bi(e,Me)},Matrix:function(e){return e.getDataType()}})}),nu=`identity`,ru=V(nu,[`typed`,`config`,`matrix`,`BigNumber`,`DenseMatrix`,`SparseMatrix`],e=>{var{typed:t,config:n,matrix:r,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(nu,{"":function(){return n.matrix===`Matrix`?r([]):[]},string:function(e){return r(e)},"number | BigNumber":function(e){return c(e,e,n.matrix===`Matrix`?`dense`:void 0)},"number | BigNumber, string":function(e,t){return c(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return c(e,t,n.matrix===`Matrix`?`dense`:void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,n){return c(e,t,n)},Array:function(e){return s(e)},"Array, string":function(e,t){return s(e,t)},Matrix:function(e){return s(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return s(e.valueOf(),t)}});function s(e,t){switch(e.length){case 0:return t?r(t):[];case 1:return c(e[0],e[0],t);case 2:return c(e[0],e[1],t);default:throw Error(`Vector containing two values expected`)}}function c(e,t,n){var r=O(e)||O(t)?i:null;if(O(e)&&(e=e.toNumber()),O(t)&&(t=t.toNumber()),!H(e)||e<1||!H(t)||t<1)throw Error(`Parameters in function identity must be positive integers`);var s=r?new i(1):1,c=r?new r(0):0,l=[e,t];if(n){if(n===`sparse`)return o.diagonal(l,s,0,c);if(n===`dense`)return a.diagonal(l,s,0,c);throw TypeError(`Unknown matrix type "${n}"`)}for(var u=Si([],l,c),d=e<t?e:t,f=0;f<d;f++)u[f][f]=s;return u}}),iu=`kron`,au=V(iu,[`typed`,`matrix`,`multiplyScalar`],e=>{var{typed:t,matrix:n,multiplyScalar:r}=e;return t(iu,{"Matrix, Matrix":function(e,t){return n(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(a(e.toArray(),t))},"Array, Matrix":function(e,t){return n(a(e,t.toArray()))},"Array, Array":a});function i(e,t){return e.flatMap(e=>t.map(t=>r(e,t)))}function a(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1;if(n<0){var r=gi(e).length,o=gi(t).length;for(n=Math.max(r,o);r++<n;)e=[e];for(;o++<n;)t=[t]}return n===1?i(e,t):e.flatMap(e=>t.map(t=>a(e,t,n-1)))}}),ou=`map`,su=V(ou,[`typed`],e=>{var{typed:t}=e;return t(ou,{"Array, function":s,"Matrix, function":function(e,t){return e.map(t)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e,t,r)=>n([e,t,...r.slice(0,r.length-1)],r[r.length-1])});function n(e,n){if(typeof n!=`function`)throw Error(`Last argument must be a callback function`);var c=e[0].isMatrix,l=e.map(e=>e.isMatrix?e.size():gi(e)),u=Ui(...l),d=e.length,f=c?(e,t)=>e.get(t):qi,p=e.map((e,t)=>{var n=l[t].map(()=>0);return e.isMatrix?e.get(n):qi(e,n)}),m=t.isTypedFunction(n)?o(n,p,u.map(()=>0),e):a(n,d);if(m<2)return r(e,i(m,n,null));var h=c?e.map(t=>t.isMatrix?t.create(Gi(t.toArray(),u),t.datatype()):e[0].create(Gi(t.valueOf(),u))):e.map(e=>e.isMatrix?Gi(e.toArray(),u):Gi(e,u)),g=i(m,n,h),_=(e,t)=>g([e,...h.slice(1).map(e=>f(e,t))],t);return c?h[0].map(_):s(h[0],_)}function r(e,t){var n=e[0],r=e.map(e=>e.isMatrix?e.valueOf():e),i=e.map(e=>e.isMatrix?e.size():gi(e)),a=Ui(...i),o=i.map(e=>a.length-e.length),s=a.length-1,c=t.length>1?[]:null,l=d(r,0);if(n.isMatrix){var u=n.create();return u._data=l,u._size=a,u}return l;function d(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=a[n],i=Array(r);if(n<s)for(var l=function(t){c&&(c[n]=t),i[t]=d(e.map((e,r)=>o[r]>n?e:e.length===1?e[0]:e[t]),n+1)},u=0;u<r;u++)l(u);else for(var f=function(r){c&&(c[n]=r),i[r]=t(e.map(e=>e.length===1?e[0]:e[r]),c?c.slice():void 0)},p=0;p<r;p++)f(p);return i}}function i(e,t,n){switch(e){case 0:return e=>t(...e);case 1:return(e,n)=>t(...e,n);case 2:return(e,r)=>t(...e,r,...n)}}function a(e,t){var n=e.toString();if(/arguments/.test(n))return 2;var r=n.match(/\(.*?\)/);return/\.\.\./.test(r)||e.length>t+1?2:+(e.length===t+1)}function o(e,n,r,i){return t.resolve(e,[...n,r,...i])===null?t.resolve(e,[...n,r])===null?(t.resolve(e,n),0):1:2}function s(e,t){var n=Zi(t,e,ou);return Ji(e,n.fn,n.isUnary)}}),cu=`diff`,lu=V(cu,[`typed`,`matrix`,`subtract`,`number`],e=>{var{typed:t,matrix:n,subtract:r,number:i}=e;return t(cu,{"Array | Matrix":function(e){return F(e)?n(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(!H(t))throw RangeError(`Dimension must be a whole number`);return F(e)?n(a(e.toArray(),t)):a(e,t)},"Array, BigNumber":t.referTo(`Array,number`,e=>(t,n)=>e(t,i(n))),"Matrix, BigNumber":t.referTo(`Matrix,number`,e=>(t,n)=>e(t,i(n)))});function a(e,t){if(F(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError(`Array/Matrix does not have that many dimensions`);if(t>0){var n=[];return e.forEach(e=>{n.push(a(e,t-1))}),n}if(t===0)return o(e);throw RangeError(`Cannot have negative dimension`)}function o(e){for(var t=[],n=e.length,r=1;r<n;r++)t.push(s(e[r-1],e[r]));return t}function s(e,t){F(e)&&(e=e.toArray()),F(t)&&(t=t.toArray());var n=Array.isArray(e),i=Array.isArray(t);if(n&&i)return c(e,t);if(!n&&!i)return r(t,e);throw TypeError(`Cannot calculate difference between 1 array and 1 non-array`)}function c(e,t){if(e.length!==t.length)throw RangeError(`Not all sub-arrays have the same length`);for(var n=[],r=e.length,i=0;i<r;i++)n.push(s(e[i],t[i]));return n}}),uu=V(`ones`,[`typed`,`config`,`matrix`,`BigNumber`],e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(`ones`,{"":function(){return n.matrix===`Array`?a([]):a([],`default`)},"...number | BigNumber | string":function(e){return typeof e[e.length-1]==`string`?a(e,e.pop()):n.matrix===`Array`?a(e):a(e,`default`)},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var n=o(e)?new i(1):1;if(s(e),t){var a=r(t);return e.length>0?a.resize(e,n):a}var c=[];return e.length>0?Si(c,e,n):c}function o(e){var t=!1;return e.forEach(function(e,n,r){O(e)&&(t=!0,r[n]=e.toNumber())}),t}function s(e){e.forEach(function(e){if(typeof e!=`number`||!H(e)||e<0)throw Error(`Parameters in function ones must be positive integers`)})}});function du(){throw Error(`No "bignumber" implementation available`)}function fu(){throw Error(`No "fraction" implementation available`)}function pu(){throw Error(`No "matrix" implementation available`)}var mu=`range`,hu=V(mu,[`typed`,`config`,`?matrix`,`?bignumber`,`equal`,`smaller`,`smallerEq`,`larger`,`largerEq`,`add`,`isZero`,`isPositive`],e=>{var{typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:c,add:l,isZero:u,isPositive:d}=e;return t(mu,{string:p,"string, boolean":p,number:function(e){throw TypeError(`Too few arguments to function range(): ${e}`)},boolean:function(e){throw TypeError(`Unexpected type of argument 1 to function range(): ${e}, number|bigint|BigNumber|Fraction`)},"number, number":function(e,t){return f(m(e,t,1,!1))},"number, number, number":function(e,t,n){return f(m(e,t,n,!1))},"number, number, boolean":function(e,t,n){return f(m(e,t,1,n))},"number, number, number, boolean":function(e,t,n,r){return f(m(e,t,n,r))},"bigint, bigint|number":function(e,t){return f(m(e,t,1n,!1))},"number, bigint":function(e,t){return f(m(BigInt(e),t,1n,!1))},"bigint, bigint|number, bigint|number":function(e,t,n){return f(m(e,t,BigInt(n),!1))},"number, bigint, bigint|number":function(e,t,n){return f(m(BigInt(e),t,BigInt(n),!1))},"bigint, bigint|number, boolean":function(e,t,n){return f(m(e,t,1n,n))},"number, bigint, boolean":function(e,t,n){return f(m(BigInt(e),t,1n,n))},"bigint, bigint|number, bigint|number, boolean":function(e,t,n,r){return f(m(e,t,BigInt(n),r))},"number, bigint, bigint|number, boolean":function(e,t,n,r){return f(m(BigInt(e),t,BigInt(n),r))},"BigNumber, BigNumber":function(e,t){var n=e.constructor;return f(m(e,t,new n(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,n){return f(m(e,t,n,!1))},"BigNumber, BigNumber, boolean":function(e,t,n){var r=e.constructor;return f(m(e,t,new r(1),n))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,n,r){return f(m(e,t,n,r))},"Fraction, Fraction":function(e,t){return f(m(e,t,1,!1))},"Fraction, Fraction, Fraction":function(e,t,n){return f(m(e,t,n,!1))},"Fraction, Fraction, boolean":function(e,t,n){return f(m(e,t,1,n))},"Fraction, Fraction, Fraction, boolean":function(e,t,n,r){return f(m(e,t,n,r))},"Unit, Unit, Unit":function(e,t,n){return f(m(e,t,n,!1))},"Unit, Unit, Unit, boolean":function(e,t,n,r){return f(m(e,t,n,r))}});function f(e){return n.matrix===`Matrix`?r?r(e):pu():e}function p(e,t){var r=h(e);if(!r)throw SyntaxError(`String "`+e+`" is no valid range`);return n.number===`BigNumber`?(i===void 0&&du(),f(m(i(r.start),i(r.end),i(r.step)),t)):f(m(r.start,r.end,r.step,t))}function m(e,t,n,r){var i=[];if(u(n))throw Error(`Step must be non-zero`);for(var f=d(n)?r?o:a:r?c:s,p=e;f(p,t);)i.push(p),p=l(p,n);return i}function h(e){var t=e.split(`:`).map(function(e){return Number(e)});if(t.some(function(e){return isNaN(e)}))return null;switch(t.length){case 2:return{start:t[0],end:t[1],step:1};case 3:return{start:t[0],end:t[2],step:t[1]};default:return null}}}),gu=`reshape`,_u=V(gu,[`typed`,`isInteger`,`matrix`],e=>{var{typed:t,isInteger:n}=e;return t(gu,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach(function(e){if(!n(e))throw TypeError(`Invalid size for dimension: `+e)}),wi(e,t)}})}),vu=V(`resize`,[`config`,`matrix`],e=>{var{config:t,matrix:n}=e;return function(e,i,a){if(arguments.length!==2&&arguments.length!==3)throw new Sc(`resize`,arguments.length,2,3);if(F(i)&&(i=i.valueOf()),O(i[0])&&(i=i.map(function(e){return O(e)?e.toNumber():e})),F(e))return e.resize(i,a,!0);if(typeof e==`string`)return r(e,i,a);var o=!Array.isArray(e)&&t.matrix!==`Array`;if(i.length===0){for(;Array.isArray(e);)e=e[0];return Ne(e)}Array.isArray(e)||(e=[e]),e=Ne(e);var s=Si(e,i,a);return o?n(s):s};function r(e,t,n){if(n!==void 0){if(typeof n!=`string`||n.length!==1)throw TypeError(`Single character expected as defaultValue`)}else n=` `;if(t.length!==1)throw new mi(t.length,1);var r=t[0];if(typeof r!=`number`||!H(r))throw TypeError(`Invalid size, must contain positive integers (size: `+oi(t)+`)`);if(e.length>r)return e.substring(0,r);if(e.length<r){for(var i=e,a=0,o=r-e.length;a<o;a++)i+=n;return i}return e}}),yu=`rotate`,bu=V(yu,[`typed`,`multiply`,`rotationMatrix`],e=>{var{typed:t,multiply:n,rotationMatrix:r}=e;return t(yu,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),n(r(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),n(r(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),n(r(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),n(r(t,a),e)}});function i(e,t){var n=Array.isArray(e)?gi(e):e.size();if(n.length>2||n.length===2&&n[1]!==1||n[0]!==t)throw RangeError(`Vector must be of dimensions 1x${t}`)}}),xu=`rotationMatrix`,Su=V(xu,[`typed`,`config`,`multiplyScalar`,`addScalar`,`unaryMinus`,`norm`,`matrix`,`BigNumber`,`DenseMatrix`,`SparseMatrix`,`cos`,`sin`],e=>{var{typed:t,config:n,multiplyScalar:r,addScalar:i,unaryMinus:a,norm:o,BigNumber:s,matrix:c,DenseMatrix:l,SparseMatrix:u,cos:d,sin:f}=e;return t(xu,{"":function(){return n.matrix===`Matrix`?c([]):[]},string:function(e){return c(e)},"number | BigNumber | Complex | Unit":function(e){return p(e,n.matrix===`Matrix`?`dense`:void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return p(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var n=c(t);return m(n),_(e,n,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){return m(t),_(e,t,t.storage()||(n.matrix===`Matrix`?`dense`:void 0))},"number | BigNumber | Complex | Unit, Array, string":function(e,t,n){var r=c(t);return m(r),_(e,r,n)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,n){return m(t),_(e,t,n)}});function p(e,t){var n=O(e)?new s(-1):-1,i=d(e),a=f(e);return g([[i,r(n,a)],[a,i]],t)}function m(e){var t=e.size();if(t.length<1||t[0]!==3)throw RangeError(`Vector must be of dimensions 1x3`)}function h(e){return e.reduce((e,t)=>r(e,t))}function g(e,t){if(t){if(t===`sparse`)return new u(e);if(t===`dense`)return new l(e);throw TypeError(`Unknown matrix type "${t}"`)}return e}function _(e,t,n){var r=o(t);if(r===0)throw RangeError(`Rotation around zero vector`);var c=O(e)?s:null,l=c?new c(1):1,u=c?new c(-1):-1,p=c?new c(t.get([0])/r):t.get([0])/r,m=c?new c(t.get([1])/r):t.get([1])/r,_=c?new c(t.get([2])/r):t.get([2])/r,v=d(e),y=i(l,a(v)),b=f(e),x=i(v,h([p,p,y])),S=i(h([p,m,y]),h([u,_,b])),C=i(h([p,_,y]),h([m,b])),w=i(h([p,m,y]),h([_,b])),T=i(v,h([m,m,y])),E=i(h([m,_,y]),h([u,p,b])),D=i(h([p,_,y]),h([u,m,b])),k=i(h([m,_,y]),h([p,b])),A=i(v,h([_,_,y]));return g([[x,S,C],[w,T,E],[D,k,A]],n)}}),Cu=`row`,wu=V(Cu,[`typed`,`Index`,`matrix`,`range`],e=>{var{typed:t,Index:n,matrix:r,range:i}=e;return t(Cu,{"Matrix, number":a,"Array, number":function(e,t){return a(r(Ne(e)),t).valueOf()}});function a(e,t){if(e.size().length!==2)throw Error(`Only two dimensional matrix is supported`);bi(t,e.size()[0]);var a=i(0,e.size()[1]),o=new n([t],a),s=e.subset(o);return F(s)?s:r([[s]])}}),Tu=`size`,Eu=V(Tu,[`typed`],e=>{var{typed:t}=e;return t(Tu,{Matrix:e=>e.size(),Array:gi,string:e=>[e.length],"number | Complex | BigNumber | Unit | boolean | null":e=>[]})}),Du=`squeeze`,Ou=V(Du,[`typed`],e=>{var{typed:t}=e;return t(Du,{Array:function(e){return Oi(Ne(e))},Matrix:function(e){var t=Oi(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:function(e){return Ne(e)}})}),ku=`subset`,Au=V(ku,[`typed`,`matrix`,`zeros`,`add`],e=>{var{typed:t,matrix:n,zeros:r,add:i}=e;return t(ku,{"Matrix, Index":function(e,t){return xi(t)?n():(yi(e,t),e.subset(t))},"Array, Index":t.referTo(`Matrix, Index`,function(e){return function(t,r){var i=e(n(t),r);return r.isScalar()?i:i.valueOf()}}),"Object, Index":Nu,"string, Index":ju,"Matrix, Index, any, any":function(e,t,n,r){return xi(t)?e:(yi(e,t),e.clone().subset(t,a(n,t),r))},"Array, Index, any, any":t.referTo(`Matrix, Index, any, any`,function(e){return function(t,r,i,a){var o=e(n(t),r,i,a);return o.isMatrix?o.valueOf():o}}),"Array, Index, any":t.referTo(`Matrix, Index, any, any`,function(e){return function(t,r,i){return e(n(t),r,i,void 0).valueOf()}}),"Matrix, Index, any":t.referTo(`Matrix, Index, any, any`,function(e){return function(t,n,r){return e(t,n,r,void 0)}}),"string, Index, string":Mu,"string, Index, string, string":Mu,"Object, Index, any":Pu});function a(e,t){if(typeof e==`string`)throw Error(`can't boradcast a string`);if(t.isScalar())return e;var n=t.size();if(n.every(e=>e>0))try{return i(e,r(n))}catch{return e}return e}});function ju(e,t){if(!ie(t))throw TypeError(`Index expected`);if(xi(t))return``;if(yi(Array.from(e),t),t.size().length!==1)throw new mi(t.size().length,1);var n=e.length;bi(t.min()[0],n),bi(t.max()[0],n);var r=t.dimension(0),i=``;function a(t){i+=e.charAt(t)}return Number.isInteger(r)?a(r):r.forEach(a),i}function Mu(e,t,n,r){if(!t||t.isIndex!==!0)throw TypeError(`Index expected`);if(xi(t))return e;if(yi(Array.from(e),t),t.size().length!==1)throw new mi(t.size().length,1);if(r!==void 0){if(typeof r!=`string`||r.length!==1)throw TypeError(`Single character expected as defaultValue`)}else r=` `;var i=t.dimension(0);if((Number.isInteger(i)?1:i.size()[0])!==n.length)throw new mi(i.size()[0],n.length);var a=e.length;bi(t.min()[0]),bi(t.max()[0]);for(var o=[],s=0;s<a;s++)o[s]=e.charAt(s);function c(e,t){o[e]=n.charAt(t[0])}if(Number.isInteger(i)?c(i,[0]):i.forEach(c),o.length>a)for(var l=a-1,u=o.length;l<u;l++)o[l]||(o[l]=r);return o.join(``)}function Nu(e,t){if(!xi(t)){if(t.size().length!==1)throw new mi(t.size(),1);var n=t.dimension(0);if(typeof n!=`string`)throw TypeError(`String expected as index to retrieve an object property`);return f(e,n)}}function Pu(e,t,n){if(xi(t))return e;if(t.size().length!==1)throw new mi(t.size(),1);var r=t.dimension(0);if(typeof r!=`string`)throw TypeError(`String expected as index to retrieve an object property`);var i=Ne(e);return p(i,r,n),i}var Fu=`transpose`,Iu=V(Fu,[`typed`,`matrix`],e=>{var{typed:t,matrix:n}=e;return t(Fu,{Array:e=>r(n(e)).valueOf(),Matrix:r,any:Ne});function r(e){var t=e.size(),n;switch(t.length){case 1:n=e.clone();break;case 2:var r=t[0],o=t[1];if(o===0)throw RangeError(`Cannot transpose a 2D matrix with no columns (size: `+oi(t)+`)`);switch(e.storage()){case`dense`:n=i(e,r,o);break;case`sparse`:n=a(e,r,o)}break;default:throw RangeError(`Matrix must be a vector or two dimensional (size: `+oi(t)+`)`)}return n}function i(e,t,n){for(var r=e._data,i=[],a,o=0;o<n;o++){a=i[o]=[];for(var s=0;s<t;s++)a[s]=Ne(r[s][o])}return e.createDenseMatrix({data:i,size:[n,t],datatype:e._datatype})}function a(e,t,n){for(var r=e._values,i=e._index,a=e._ptr,o=r?[]:void 0,s=[],c=[],l=[],u=0;u<t;u++)l[u]=0;var d,f,p;for(d=0,f=i.length;d<f;d++)l[i[d]]++;for(var m=0,h=0;h<t;h++)c.push(m),m+=l[h],l[h]=c[h];for(c.push(m),p=0;p<n;p++)for(var g=a[p],_=a[p+1],v=g;v<_;v++){var y=l[i[v]]++;s[y]=p,r&&(o[y]=Ne(r[v]))}return e.createSparseMatrix({values:o,index:s,ptr:c,size:[n,t],datatype:e._datatype})}}),Lu=`ctranspose`,Ru=V(Lu,[`typed`,`transpose`,`conj`],e=>{var{typed:t,transpose:n,conj:r}=e;return t(Lu,{any:function(e){return r(n(e))}})}),zu=`zeros`,Bu=V(zu,[`typed`,`config`,`matrix`,`BigNumber`],e=>{var{typed:t,config:n,matrix:r,BigNumber:i}=e;return t(zu,{"":function(){return n.matrix===`Array`?a([]):a([],`default`)},"...number | BigNumber | string":function(e){return typeof e[e.length-1]==`string`?a(e,e.pop()):n.matrix===`Array`?a(e):a(e,`default`)},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var n=o(e)?new i(0):0;if(s(e),t){var a=r(t);return e.length>0?a.resize(e,n):a}var c=[];return e.length>0?Si(c,e,n):c}function o(e){var t=!1;return e.forEach(function(e,n,r){O(e)&&(t=!0,r[n]=e.toNumber())}),t}function s(e){e.forEach(function(e){if(typeof e!=`number`||!H(e)||e<0)throw Error(`Parameters in function zeros must be positive integers`)})}}),Vu=`fft`,Hu=V(Vu,[`typed`,`matrix`,`addScalar`,`multiplyScalar`,`divideScalar`,`exp`,`tau`,`i`,`dotDivide`,`conj`,`pow`,`ceil`,`log2`],e=>{var{typed:t,matrix:n,addScalar:r,multiplyScalar:i,divideScalar:a,exp:o,tau:s,i:c,dotDivide:l,conj:u,pow:d,ceil:f,log2:p}=e;return t(Vu,{Array:m,Matrix:function(e){return e.create(m(e.valueOf()),e.datatype())}});function m(e){var t=gi(e);return t.length===1?_(e,t[0]):h(e.map(e=>m(e,t.slice(1))),0)}function h(e,t){var n=gi(e);if(t!==0)return Array(n[0]).fill(0).map((n,r)=>h(e[r],t-1));if(n.length===1)return _(e);function r(e){var t=gi(e);return Array(t[1]).fill(0).map((n,r)=>Array(t[0]).fill(0).map((t,n)=>e[n][r]))}return r(h(r(e),1))}function g(e){for(var t=e.length,n=o(a(i(-1,i(c,s)),t)),r=[],h=1-t;h<t;h++)r.push(d(n,a(d(h,2),2)));for(var g=d(2,f(p(t+t-1))),v=[...Array(t).fill(0).map((n,a)=>i(e[a],r[t-1+a])),...Array(g-t).fill(0)],y=[...Array(t+t-1).fill(0).map((e,t)=>a(1,r[t])),...Array(g-(t+t-1)).fill(0)],b=_(v),x=_(y),S=l(u(m(u(Array(g).fill(0).map((e,t)=>i(b[t],x[t]))))),g),C=[],w=t-1;w<t+t-1;w++)C.push(i(S[w],r[w]));return C}function _(e){var t=e.length;if(t===1)return[e[0]];if(t%2==0){for(var n=[..._(e.filter((e,t)=>t%2==0),t/2),..._(e.filter((e,t)=>t%2==1),t/2)],l=0;l<t/2;l++){var u=n[l],d=i(n[l+t/2],o(i(i(s,c),a(-l,t))));n[l]=r(u,d),n[l+t/2]=r(u,i(-1,d))}return n}return g(e)}}),Uu=`ifft`,Wu=V(Uu,[`typed`,`fft`,`dotDivide`,`conj`],e=>{var{typed:t,fft:n,dotDivide:r,conj:i}=e;return t(Uu,{"Array | Matrix":function(e){var t=F(e)?e.size():gi(e);return r(i(n(i(e))),t.reduce((e,t)=>e*t,1))}})});function Gu(e){"@babel/helpers - typeof";return Gu=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Gu(e)}function Ku(e,t){if(Gu(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Gu(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qu(e){var t=Ku(e,`string`);return Gu(t)==`symbol`?t:t+``}function Ju(e,t,n){return(t=qu(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yu(Object(n),!0).forEach(function(t){Ju(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Zu=V(`solveODE`,[`typed`,`add`,`subtract`,`multiply`,`divide`,`max`,`map`,`abs`,`isPositive`,`isNegative`,`larger`,`smaller`,`matrix`,`bignumber`,`unaryMinus`],e=>{var{typed:t,add:n,subtract:r,multiply:i,divide:a,max:o,map:s,abs:c,isPositive:l,isNegative:u,larger:d,smaller:f,matrix:p,bignumber:m,unaryMinus:h}=e;function g(e){return function(t,p,g,_){if(!(p.length===2&&(p.every(S)||p.every(M))))throw Error(`"tspan" must be an Array of two numeric values or two units [tStart, tEnd]`);var v=p[0],y=p[1],C=d(y,v),w=_.firstStep;if(w!==void 0&&!l(w))throw Error(`"firstStep" must be positive`);var T=_.maxStep;if(T!==void 0&&!l(T))throw Error(`"maxStep" must be positive`);var E=_.minStep;if(E&&u(E))throw Error(`"minStep" must be positive or zero`);var D=[v,y,w,E,T].filter(e=>e!==void 0);if(!(D.every(S)||D.every(M)))throw Error(`Inconsistent type of "t" dependant variables`);for(var k=1,A=_.tol?_.tol:1e-4,j=_.minDelta?_.minDelta:.2,N=_.maxDelta?_.maxDelta:5,P=_.maxIter?_.maxIter:1e4,F=[v,y,...g,T,E].some(O),[ee,te,ne,re]=F?[m(e.a),m(e.c),m(e.b),m(e.bp)]:[e.a,e.c,e.b,e.bp],ie=w?C?w:h(w):a(r(y,v),k),ae=[v],I=[g],oe=r(ne,re),L=0,se=0,ce=b(C),R=x(C);ce(ae[L],y);){var le=[];ie=R(ae[L],y,ie),le.push(t(ae[L],I[L]));for(var ue=1;ue<te.length;++ue)le.push(t(n(ae[L],i(te[ue],ie)),n(I[L],i(ie,ee[ue],le))));var de=o(c(s(i(oe,le),e=>M(e)?e.value:e)));de<A&&A/de>1/4&&(ae.push(n(ae[L],ie)),I.push(n(I[L],i(ie,ne,le))),L++);var fe=.84*(A/de)**(1/5);if(f(fe,j)?fe=j:d(fe,N)&&(fe=N),fe=F?m(fe):fe,ie=i(ie,fe),T&&d(c(ie),T)?ie=C?T:h(T):E&&f(c(ie),E)&&(ie=C?E:h(E)),se++,se>P)throw Error(`Maximum number of iterations reached, try changing options`)}return{t:ae,y:I}}}function _(e,t,n,r){return g({a:[[],[1/2],[0,3/4],[2/9,1/3,4/9]],c:[null,1/2,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,t,n,r)}function v(e,t,n,r){return g({a:[[],[1/5],[3/40,9/40],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,1/5,3/10,4/5,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40]})(e,t,n,r)}function y(e,t,n,r){var i=r.method?r.method:`RK45`,a={RK23:_,RK45:v};if(i.toUpperCase()in a){var o=Xu({},r);return delete o.method,a[i.toUpperCase()](e,t,n,o)}var s=Object.keys(a).map(e=>`"${e}"`),c=`${s.slice(0,-1).join(`, `)} and ${s.slice(-1)}`;throw Error(`Unavailable method "${i}". Available methods are ${c}`)}function b(e){return e?f:d}function x(e){var t=e?d:f;return function(e,i,a){return t(n(e,a),i)?r(i,e):a}}function S(e){return O(e)||D(e)}function C(e,t,n,r){var i=y(e,t.toArray(),n.toArray(),r);return{t:p(i.t),y:p(i.y)}}return t(`solveODE`,{"function, Array, Array, Object":y,"function, Matrix, Matrix, Object":C,"function, Array, Array":(e,t,n)=>y(e,t,n,{}),"function, Matrix, Matrix":(e,t,n)=>C(e,t,n,{}),"function, Array, number | BigNumber | Unit":(e,t,n)=>{var r=y(e,t,[n],{});return{t:r.t,y:r.y.map(e=>e[0])}},"function, Matrix, number | BigNumber | Unit":(e,t,n)=>{var r=y(e,t.toArray(),[n],{});return{t:p(r.t),y:p(r.y.map(e=>e[0]))}},"function, Array, number | BigNumber | Unit, Object":(e,t,n,r)=>{var i=y(e,t,[n],r);return{t:i.t,y:i.y.map(e=>e[0])}},"function, Matrix, number | BigNumber | Unit, Object":(e,t,n,r)=>{var i=y(e,t.toArray(),[n],r);return{t:p(i.t),y:p(i.y.map(e=>e[0]))}}})}),Qu=V(`erf`,[`typed`],e=>{var{typed:t}=e;return t(`name`,{number:function(e){var t=Math.abs(e);return t>=rd?$e(e):t<=$u?$e(e)*n(t):t<=4?$e(e)*(1-r(t)):$e(e)*(1-i(t))},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))});function n(e){var t=e*e,n=td[0][4]*t,r=t,i;for(i=0;i<3;i+=1)n=(n+td[0][i])*t,r=(r+nd[0][i])*t;return e*(n+td[0][3])/(r+nd[0][3])}function r(e){var t=td[1][8]*e,n=e,r;for(r=0;r<7;r+=1)t=(t+td[1][r])*e,n=(n+nd[1][r])*e;var i=(t+td[1][7])/(n+nd[1][7]),a=parseInt(e*16)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}function i(e){var t=1/(e*e),n=td[2][5]*t,r=t,i;for(i=0;i<4;i+=1)n=(n+td[2][i])*t,r=(r+nd[2][i])*t;var a=t*(n+td[2][4])/(r+nd[2][4]);a=(ed-a)/e,t=parseInt(e*16)/16;var o=(e-t)*(e+t);return Math.exp(-t*t)*Math.exp(-o)*a}}),$u=.46875,ed=.5641895835477563,td=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],nd=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],rd=2**53,id=`zeta`,ad=V(id,[`typed`,`config`,`multiply`,`pow`,`divide`,`factorial`,`equal`,`smallerEq`,`isBounded`,`isNegative`,`gamma`,`sin`,`subtract`,`add`,`?Complex`,`?BigNumber`,`pi`],e=>{var{typed:t,config:n,multiply:r,pow:i,divide:a,factorial:o,equal:s,smallerEq:c,isBounded:l,isNegative:u,gamma:d,sin:f,subtract:p,add:m,Complex:h,BigNumber:g,pi:_}=e;return t(id,{number:e=>v(e,e=>e,()=>20),BigNumber:e=>v(e,e=>new g(e),()=>Math.abs(Math.log10(n.relTol))),Complex:y});function v(e,t,n){return s(e,0)?t(-.5):s(e,1)?t(NaN):l(e)?b(e,t,n,e=>e):u(e)?t(NaN):t(1)}function y(e){return e.re===0&&e.im===0?new h(-.5):e.re===1?new h(NaN,NaN):e.re===1/0&&e.im===0?new h(1):e.im===1/0||e.re===-1/0?new h(NaN,NaN):b(e,e=>e,e=>Math.round(19.5+.9*Math.abs(e.im)),e=>e.re)}function b(e,t,n,o){var s=n(e);if(o(e)>-(s-1)/2)return S(e,t(s),t);var c=r(i(2,e),i(t(_),p(e,1)));return c=r(c,f(r(a(t(_),2),e))),c=r(c,d(p(1,e))),r(c,b(p(1,e),t,n,o))}function x(e,t){for(var n=e,s=e;c(s,t);s=m(s,1)){var l=a(r(o(m(t,p(s,1))),i(4,s)),r(o(p(t,s)),o(r(2,s))));n=m(n,l)}return r(t,n)}function S(e,t,n){for(var o=a(1,r(x(n(0),t),p(1,i(2,p(1,e))))),s=n(0),l=n(1);c(l,t);l=m(l,1))s=m(s,a(r((-1)**(l-1),x(l,t)),i(l,e)));return r(o,s)}}),od=`mode`,sd=V(od,[`typed`,`isNaN`,`isNumeric`],e=>{var{typed:t,isNaN:n,isNumeric:r}=e;return t(od,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(e=Mi(e.valueOf()),e.length===0)throw Error(`Cannot calculate mode of an empty array`);for(var t={},i=[],a=0,o=0;o<e.length;o++){var s=e[o];if(r(s)&&n(s))throw Error(`Cannot calculate mode of an array containing NaN values`);s in t||(t[s]=0),t[s]++,t[s]===a?i.push(s):t[s]>a&&(a=t[s],i=[s])}return i}});function cd(e,t,n){var r;return String(e).includes(`Unexpected type`)?(r=arguments.length>2?` (type: `+Me(n)+`, value: `+JSON.stringify(n)+`)`:` (type: `+e.data.actual+`)`,TypeError(`Cannot calculate `+t+`, unexpected type of argument`+r)):String(e).includes(`complex numbers`)?(r=arguments.length>2?` (type: `+Me(n)+`, value: `+JSON.stringify(n)+`)`:``,TypeError(`Cannot calculate `+t+`, no ordering relation is defined for complex numbers`+r)):e}var ld=`prod`,ud=V(ld,[`typed`,`config`,`multiplyScalar`,`numeric`],e=>{var{typed:t,config:n,multiplyScalar:r,numeric:i}=e;return t(ld,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw Error(`prod(A, dim) is not yet supported`)},"...":function(e){return a(e)}});function a(e){var t;if(ca(e,function(e){try{t=t===void 0?e:r(t,e)}catch(t){throw cd(t,`prod`,e)}}),typeof t==`string`&&(t=i(t,Qe(t,n))),t===void 0)throw Error(`Cannot calculate prod of an empty array`);return t}}),dd=`format`,fd=V(dd,[`typed`],e=>{var{typed:t}=e;return t(dd,{any:oi,"any, Object | function | number | BigNumber":oi})}),pd=`bin`,md=V(pd,[`typed`,`format`],e=>{var{typed:t,format:n}=e;return t(pd,{"number | BigNumber":function(e){return n(e,{notation:`bin`})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:`bin`,wordSize:t})}})}),hd=`oct`,gd=V(hd,[`typed`,`format`],e=>{var{typed:t,format:n}=e;return t(hd,{"number | BigNumber":function(e){return n(e,{notation:`oct`})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:`oct`,wordSize:t})}})}),_d=`hex`,vd=V(_d,[`typed`,`format`],e=>{var{typed:t,format:n}=e;return t(_d,{"number | BigNumber":function(e){return n(e,{notation:`hex`})},"number | BigNumber, number | BigNumber":function(e,t){return n(e,{notation:`hex`,wordSize:t})}})}),yd=/\$([\w.]+)/g,bd=`print`,xd=V(bd,[`typed`],e=>{var{typed:t}=e;return t(bd,{"string, Object | Array":Sd,"string, Object | Array, number | Object":Sd})});function Sd(e,t,n){return e.replace(yd,function(e,r){var i=r.split(`.`),a=t[i.shift()];for(a!==void 0&&a.isMatrix&&(a=a.toArray());i.length&&a!==void 0;){var o=i.shift();a=o?a[o]:a+`.`}return a===void 0?e:N(a)?a:oi(a,n)})}var Cd=`to`,wd=V(Cd,[`typed`,`matrix`,`concat`],e=>{var{typed:t,matrix:n,concat:r}=e;return t(Cd,{"Unit, Unit | string":(e,t)=>e.to(t)},gc({typed:t,matrix:n,concat:r})({Ds:!0}))}),Td=`toBest`,Ed=V(Td,[`typed`],e=>{var{typed:t}=e;return t(Td,{Unit:e=>e.toBest(),"Unit, string":(e,t)=>e.toBest(t.split(`,`)),"Unit, string, Object":(e,t,n)=>e.toBest(t.split(`,`),n),"Unit, Array":(e,t)=>e.toBest(t),"Unit, Array, Object":(e,t,n)=>e.toBest(t,n)})}),Dd=`isPrime`,Od=V(Dd,[`typed`],e=>{var{typed:t}=e;return t(Dd,{number:function(e){if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var t=5;t*t<=e;t+=6)if(e%t===0||e%(t+2)===0)return!1;return!0},bigint:function(e){if(e<=3n)return e>1n;if(e%2n==0n||e%3n==0n)return!1;for(var t=5n;t*t<=e;t+=6n)if(e%t===0n||e%(t+2n)===0n)return!1;return!0},BigNumber:function(e){if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(2**32)){for(var t=e.toNumber(),n=5;n*n<=t;n+=6)if(t%n===0||t%(n+2)===0)return!1;return!0}function r(e,t,n){for(var r=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(n)):(t=t.sub(1),r=e.mul(r).mod(n));return r}e=new(e.constructor.clone({precision:e.toFixed(0).length*2}))(e);for(var i=0,a=e.sub(1);a.mod(2).eq(0);)a=a.div(2),i+=1;var o=null;if(e.lt(`3317044064679887385961981`))o=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(t=>t<e);else{var s=Math.min(e.toNumber()-2,Math.floor(2*(e.toFixed(0).length*Math.log(10))**2));o=[];for(var c=2;c<=s;c+=1)o.push(s)}for(var l=0;l<o.length;l+=1){var u=o[l],d=r(e.sub(e).add(u),a,e);if(!d.eq(1)){for(var f=0,p=d;!p.eq(e.sub(1));f+=1,p=p.mul(p).mod(e))if(f===i-1)return!1}}return!0},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),kd=V(`numeric`,[`number`,`?bignumber`,`?fraction`],e=>{var{number:t,bignumber:n,fraction:r}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:n?e=>n(e):du,bigint:e=>BigInt(e),Fraction:r?e=>r(e):fu};return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`number`;if((arguments.length>2?arguments[2]:void 0)!==void 0)throw SyntaxError(`numeric() takes one or two arguments`);var n=Me(e);if(!(n in i))throw TypeError(`Cannot convert `+e+` of type "`+n+`"; valid input types are `+Object.keys(i).join(`, `));if(!(t in a))throw TypeError(`Cannot convert `+e+` to type "`+t+`"; valid output types are `+Object.keys(a).join(`, `));return t===n?e:a[t](e)}}),Ad=`divideScalar`,jd=V(Ad,[`typed`,`numeric`],e=>{var{typed:t,numeric:n}=e;return t(Ad,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"bigint, bigint":function(e,t){return e/t},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e,t)=>e.divide(t),"number | Fraction | Complex | BigNumber, Unit":(e,t)=>t.divideInto(e)})}),Md=`pow`,Nd=V(Md,[`typed`,`config`,`identity`,`multiply`,`matrix`,`inv`,`fraction`,`number`,`Complex`],e=>{var{typed:t,config:n,identity:r,multiply:i,matrix:a,inv:o,number:s,fraction:c,Complex:l}=e;return t(Md,{"number, number":u,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||n.predictable?e.pow(t):new l(e.toNumber(),0).pow(t.toNumber(),0)},"bigint, bigint":(e,t)=>e**t,"Fraction, Fraction":function(e,t){var r=e.pow(t);if(r!=null)return r;if(n.predictable)throw Error(`Result of pow is non-rational and cannot be expressed as a fraction`);return u(e.valueOf(),t.valueOf())},"Array, number":d,"Array, BigNumber":function(e,t){return d(e,t.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(e,t){return f(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function u(e,t){if(n.predictable&&!H(t)&&e<0)try{var r=c(t),i=s(r);if((t===i||Math.abs((t-i)/t)<1e-14)&&r.d%2n==1n)return(r.n%2n==0n?1:-1)*(-e)**+t}catch{}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:H(t)||e>=0||n.predictable?Fa(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new l(e,0).pow(t,0)}function d(e,t){if(!H(t))throw TypeError(`For A^b, b must be an integer (value is `+t+`)`);var n=gi(e);if(n.length!==2)throw Error(`For A^b, A must be 2 dimensional (A has `+n.length+` dimensions)`);if(n[0]!==n[1])throw Error(`For A^b, A must be square (size is `+n[0]+`x`+n[1]+`)`);if(t<0)try{return d(o(e),-t)}catch(e){throw e.message===`Cannot calculate inverse, determinant is zero`?TypeError(`For A^b, when A is not invertible, b must be a positive integer (value is `+t+`)`):e}for(var a=r(n[0]).valueOf(),s=e;t>=1;)(t&1)==1&&(a=i(s,a)),t>>=1,s=i(s,s);return a}function f(e,t){return a(d(e.valueOf(),t))}}),Pd=`Number of decimals in function round must be an integer`,Fd=`round`,Id=V(Fd,[`typed`,`config`,`matrix`,`equalScalar`,`zeros`,`BigNumber`,`DenseMatrix`],e=>{var{typed:t,config:n,matrix:r,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:s}=e,c=Vs({typed:t,equalScalar:i}),l=Hs({typed:t,DenseMatrix:s}),u=Us({typed:t});function d(e){return Math.abs(ct(e).exponent)}return t(Fd,{number:function(e){var t=Ia(e,d(n.relTol));return Ia(gt(e,t,n.relTol,n.absTol)?t:e)},"number, number":function(e,t){var r=d(n.relTol);if(t>=r)return Ia(e,t);var i=Ia(e,r);return Ia(gt(e,i,n.relTol,n.absTol)?i:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(Pd);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw TypeError(Pd);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(Pd);var n=t.toNumber();return e.round(n)},BigNumber:function(e){var t=new o(e).toDecimalPlaces(d(n.relTol));return(Mo(e,t,n.relTol,n.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(Pd);var r=d(n.relTol);if(t>=r)return e.toDecimalPlaces(t.toNumber());var i=e.toDecimalPlaces(r);return(Mo(e,i,n.relTol,n.absTol)?i:e).toDecimalPlaces(t.toNumber())},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw TypeError(Pd);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw TypeError(Pd);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,n,r){var 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)=>la(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=>la(t,e,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>c(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>u(t,n,e,!1)),"Array, number | BigNumber":t.referToSelf(e=>(t,n)=>u(r(t),n,e,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(e=>(t,n)=>i(t,0)?a(n.size(),n.storage()):l(n,t,e,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(e=>(t,n)=>i(t,0)?a(n.size(),n.storage()):u(n,t,e,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(e=>(t,n)=>u(r(n),t,e,!0).valueOf())})}),Ld=`log`,Rd=[`config`,`typed`,`typeOf`,`divideScalar`,`Complex`],zd=Math.log(16),Bd=V(Ld,Rd,e=>{var{typed:t,typeOf:n,config:r,divideScalar:i,Complex:a}=e;function o(e){return e.log()}function s(e){return o(new a(e,0))}return t(Ld,{number:function(e){return e>=0||r.predictable?Oa(e):s(e)},bigint:Mc(zd,Oa,r,s),Complex:o,BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():s(e.toNumber())},"any, any":t.referToSelf(e=>(t,r)=>{if(n(t)===`Fraction`&&n(r)===`Fraction`){var a=t.log(r);if(a!==null)return a}return i(e(t),e(r))})})}),Vd=`log1p`,Hd=V(Vd,[`typed`,`config`,`divideScalar`,`log`,`Complex`],e=>{var{typed:t,config:n,divideScalar:r,log:i,Complex:a}=e;return t(Vd,{number:function(e){return e>=-1||n.predictable?nt(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":t.referToSelf(e=>t=>la(t,e)),"any, any":t.referToSelf(e=>(t,n)=>r(e(t),i(n)))});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}),Ud=`nthRoots`,Wd=V(Ud,[`config`,`typed`,`divideScalar`,`Complex`],e=>{var{typed:t,config:n,divideScalar:r,Complex:i}=e,a=[function(e){return new i(e,0)},function(e){return new i(0,e)},function(e){return new i(-e,0)},function(e){return new i(0,-e)}];function o(e,t){if(t<0)throw Error(`Root must be greater than zero`);if(t===0)throw Error(`Root must be non-zero`);if(t%1!=0)throw Error(`Root must be an integer`);if(e===0||e.abs()===0)return[new i(0,0)];var n=typeof e==`number`,r;(n||e.re===0||e.im===0)&&(r=n?2*(e<0):e.im===0?2*(e.re<0):2*(e.im<0)+1);for(var o=e.arg(),s=e.abs(),c=[],l=s**(1/t),u=0;u<t;u++){var d=(r+4*u)/t;if(d===Math.round(d)){c.push(a[d%4](l));continue}c.push(new i({r:l,phi:(o+2*Math.PI*u)/t}))}return c}return t(Ud,{Complex:function(e){return o(e,2)},"Complex, number":o})}),Gd=`dotPow`,Kd=V(Gd,[`typed`,`equalScalar`,`matrix`,`pow`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,equalScalar:n,matrix:r,pow:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,c=dc({typed:t}),l=vl({typed:t,SparseMatrix:s}),u=Vs({typed:t,equalScalar:n}),d=Hs({typed:t,DenseMatrix:a}),f=gc({typed:t,matrix:r,concat:o}),p={};for(var m in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,m)&&!m.includes(`Matrix`)&&!m.includes(`Array`)&&(p[m]=i.signatures[m]);return t(Gd,f({elop:t(p),SS:l,DS:c,Ss:u,sS:d}))}),qd=`dotDivide`,Jd=V(qd,[`typed`,`matrix`,`equalScalar`,`divideScalar`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,matrix:n,equalScalar:r,divideScalar:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,c=uc({typed:t,equalScalar:r}),l=dc({typed:t}),u=vl({typed:t,SparseMatrix:s}),d=Vs({typed:t,equalScalar:r}),f=Hs({typed:t,DenseMatrix:a});return t(qd,gc({typed:t,matrix:n,concat:o})({elop:i,SS:u,DS:l,SD:c,Ss:d,sS:f}))});function Yd(e){var{DenseMatrix:t}=e;return function(e,n,r){var i=e.size();if(i.length!==2)throw RangeError(`Matrix must be two dimensional (size: `+oi(i)+`)`);var a=i[0];if(a!==i[1])throw RangeError(`Matrix must be square (size: `+oi(i)+`)`);var o=[];if(F(n)){var s=n.size(),c=n._data;if(s.length===1){if(s[0]!==a)throw RangeError(`Dimension mismatch. Matrix columns must match vector length.`);for(var l=0;l<a;l++)o[l]=[c[l]];return new t({data:o,size:[a,1],datatype:n._datatype})}if(s.length===2){if(s[0]!==a||s[1]!==1)throw RangeError(`Dimension mismatch. Matrix columns must match vector length.`);if(te(n)){if(r){o=[];for(var u=0;u<a;u++)o[u]=[c[u][0]];return new t({data:o,size:[a,1],datatype:n._datatype})}return n}if(ne(n)){for(var d=0;d<a;d++)o[d]=[0];for(var f=n._values,p=n._index,m=n._ptr,h=m[1],g=m[0];g<h;g++){var _=p[g];o[_][0]=f[g]}return new t({data:o,size:[a,1],datatype:n._datatype})}}throw RangeError(`Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.`)}if(P(n)){var v=gi(n);if(v.length===1){if(v[0]!==a)throw RangeError(`Dimension mismatch. Matrix columns must match vector length.`);for(var y=0;y<a;y++)o[y]=[n[y]];return new t({data:o,size:[a,1]})}if(v.length===2){if(v[0]!==a||v[1]!==1)throw RangeError(`Dimension mismatch. Matrix columns must match vector length.`);for(var b=0;b<a;b++)o[b]=[n[b][0]];return new t({data:o,size:[a,1]})}throw RangeError(`Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.`)}}}var Xd=`lsolve`,Zd=V(Xd,[`typed`,`matrix`,`divideScalar`,`multiplyScalar`,`subtractScalar`,`equalScalar`,`DenseMatrix`],e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,c=Yd({DenseMatrix:s});return t(Xd,{"SparseMatrix, Array | Matrix":function(e,t){return u(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return l(e,t)},"Array, Array | Matrix":function(e,t){return l(n(e),t).valueOf()}});function l(e,t){t=c(e,t,!0);for(var n=t._data,l=e._size[0],u=e._size[1],d=[],f=e._data,p=0;p<u;p++){var m=n[p][0]||0,h=void 0;if(o(m,0))h=0;else{var g=f[p][p];if(o(g,0))throw Error(`Linear system cannot be solved since matrix is singular`);h=r(m,g);for(var _=p+1;_<l;_++)n[_]=[a(n[_][0]||0,i(h,f[_][p]))]}d[p]=[h]}return new s({data:d,size:[l,1]})}function u(e,t){t=c(e,t,!0);for(var n=t._data,l=e._size[0],u=e._size[1],d=e._values,f=e._index,p=e._ptr,m=[],h=0;h<u;h++){var g=n[h][0]||0;if(o(g,0))m[h]=[0];else{for(var _=0,v=[],y=[],b=p[h],x=p[h+1],S=b;S<x;S++){var C=f[S];C===h?_=d[S]:C>h&&(v.push(d[S]),y.push(C))}if(o(_,0))throw Error(`Linear system cannot be solved since matrix is singular`);for(var w=r(g,_),T=0,E=y.length;T<E;T++){var D=y[T];n[D]=[a(n[D][0]||0,i(w,v[T]))]}m[h]=[w]}}return new s({data:m,size:[l,1]})}}),Qd=`usolve`,$d=V(Qd,[`typed`,`matrix`,`divideScalar`,`multiplyScalar`,`subtractScalar`,`equalScalar`,`DenseMatrix`],e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,c=Yd({DenseMatrix:s});return t(Qd,{"SparseMatrix, Array | Matrix":function(e,t){return u(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return l(e,t)},"Array, Array | Matrix":function(e,t){return l(n(e),t).valueOf()}});function l(e,t){t=c(e,t,!0);for(var n=t._data,l=e._size[0],u=e._size[1],d=[],f=e._data,p=u-1;p>=0;p--){var m=n[p][0]||0,h=void 0;if(o(m,0))h=0;else{var g=f[p][p];if(o(g,0))throw Error(`Linear system cannot be solved since matrix is singular`);h=r(m,g);for(var _=p-1;_>=0;_--)n[_]=[a(n[_][0]||0,i(h,f[_][p]))]}d[p]=[h]}return new s({data:d,size:[l,1]})}function u(e,t){t=c(e,t,!0);for(var n=t._data,l=e._size[0],u=e._size[1],d=e._values,f=e._index,p=e._ptr,m=[],h=u-1;h>=0;h--){var g=n[h][0]||0;if(o(g,0))m[h]=[0];else{for(var _=0,v=[],y=[],b=p[h],x=p[h+1]-1;x>=b;x--){var S=f[x];S===h?_=d[x]:S<h&&(v.push(d[x]),y.push(S))}if(o(_,0))throw Error(`Linear system cannot be solved since matrix is singular`);for(var C=r(g,_),w=0,T=y.length;w<T;w++){var E=y[w];n[E]=[a(n[E][0],i(C,v[w]))]}m[h]=[C]}}return new s({data:m,size:[l,1]})}}),ef=`lsolveAll`,tf=V(ef,[`typed`,`matrix`,`divideScalar`,`multiplyScalar`,`subtractScalar`,`equalScalar`,`DenseMatrix`],e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,c=Yd({DenseMatrix:s});return t(ef,{"SparseMatrix, Array | Matrix":function(e,t){return u(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return l(e,t)},"Array, Array | Matrix":function(e,t){return l(n(e),t).map(e=>e.valueOf())}});function l(e,t){for(var n=[c(e,t,!0)._data.map(e=>e[0])],l=e._data,u=e._size[0],d=e._size[1],f=0;f<d;f++)for(var p=n.length,m=0;m<p;m++){var h=n[m];if(!o(l[f][f],0)){h[f]=r(h[f],l[f][f]);for(var g=f+1;g<d;g++)h[g]=a(h[g],i(h[f],l[g][f]))}else if(!o(h[f],0)){if(m===0)return[];n.splice(m,1),--m,--p}else if(m===0){var _=[...h];_[f]=1;for(var v=f+1;v<d;v++)_[v]=a(_[v],l[v][f]);n.push(_)}}return n.map(e=>new s({data:e.map(e=>[e]),size:[u,1]}))}function u(e,t){for(var n=[c(e,t,!0)._data.map(e=>e[0])],l=e._size[0],u=e._size[1],d=e._values,f=e._index,p=e._ptr,m=0;m<u;m++)for(var h=n.length,g=0;g<h;g++){for(var _=n[g],v=[],y=[],b=p[m],x=p[m+1],S=0,C=b;C<x;C++){var w=f[C];w===m?S=d[C]:w>m&&(v.push(d[C]),y.push(w))}if(!o(S,0)){_[m]=r(_[m],S);for(var T=0,E=y.length;T<E;T++){var D=y[T];_[D]=a(_[D],i(_[m],v[T]))}}else if(!o(_[m],0)){if(g===0)return[];n.splice(g,1),--g,--h}else if(g===0){var O=[..._];O[m]=1;for(var k=0,A=y.length;k<A;k++){var j=y[k];O[j]=a(O[j],v[k])}n.push(O)}}return n.map(e=>new s({data:e.map(e=>[e]),size:[l,1]}))}}),nf=`usolveAll`,rf=V(nf,[`typed`,`matrix`,`divideScalar`,`multiplyScalar`,`subtractScalar`,`equalScalar`,`DenseMatrix`],e=>{var{typed:t,matrix:n,divideScalar:r,multiplyScalar:i,subtractScalar:a,equalScalar:o,DenseMatrix:s}=e,c=Yd({DenseMatrix:s});return t(nf,{"SparseMatrix, Array | Matrix":function(e,t){return u(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return l(e,t)},"Array, Array | Matrix":function(e,t){return l(n(e),t).map(e=>e.valueOf())}});function l(e,t){for(var n=[c(e,t,!0)._data.map(e=>e[0])],l=e._data,u=e._size[0],d=e._size[1]-1;d>=0;d--)for(var f=n.length,p=0;p<f;p++){var m=n[p];if(!o(l[d][d],0)){m[d]=r(m[d],l[d][d]);for(var h=d-1;h>=0;h--)m[h]=a(m[h],i(m[d],l[h][d]))}else if(!o(m[d],0)){if(p===0)return[];n.splice(p,1),--p,--f}else if(p===0){var g=[...m];g[d]=1;for(var _=d-1;_>=0;_--)g[_]=a(g[_],l[_][d]);n.push(g)}}return n.map(e=>new s({data:e.map(e=>[e]),size:[u,1]}))}function u(e,t){for(var n=[c(e,t,!0)._data.map(e=>e[0])],l=e._size[0],u=e._size[1],d=e._values,f=e._index,p=e._ptr,m=u-1;m>=0;m--)for(var h=n.length,g=0;g<h;g++){for(var _=n[g],v=[],y=[],b=p[m],x=p[m+1],S=0,C=x-1;C>=b;C--){var w=f[C];w===m?S=d[C]:w<m&&(v.push(d[C]),y.push(w))}if(!o(S,0)){_[m]=r(_[m],S);for(var T=0,E=y.length;T<E;T++){var D=y[T];_[D]=a(_[D],i(_[m],v[T]))}}else if(!o(_[m],0)){if(g===0)return[];n.splice(g,1),--g,--h}else if(g===0){var O=[..._];O[m]=1;for(var k=0,A=y.length;k<A;k++){var j=y[k];O[j]=a(O[j],v[k])}n.push(O)}}return n.map(e=>new s({data:e.map(e=>[e]),size:[l,1]}))}}),af=V(`matAlgo08xS0Sid`,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,c=e._size,l=e._datatype||e._data===void 0?e._datatype:e.getDataType(),u=r._values,d=r._index,f=r._ptr,p=r._size,m=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(c.length!==p.length)throw new mi(c.length,p.length);if(c[0]!==p[0]||c[1]!==p[1])throw RangeError(`Dimension mismatch. Matrix A (`+c+`) must match Matrix B (`+p+`)`);if(!a||!u)throw Error(`Cannot perform operation on Pattern Sparse Matrices`);var h=c[0],g=c[1],_,v=n,y=0,b=i;typeof l==`string`&&l===m&&l!==`mixed`&&(_=l,v=t.find(n,[_,_]),y=t.convert(0,_),b=t.find(i,[_,_]));for(var x=[],S=[],C=[],w=[],T=[],E,D,O,k,A=0;A<g;A++){C[A]=S.length;var j=A+1;for(D=s[A],O=s[A+1],E=D;E<O;E++)k=o[E],T[k]=j,w[k]=a[E],S.push(k);for(D=f[A],O=f[A+1],E=D;E<O;E++)k=d[E],T[k]===j&&(w[k]=b(w[k],u[E]));for(E=C[A];E<S.length;){k=S[E];var M=w[k];v(M,y)?S.splice(E,1):(x.push(M),E++)}}return C[g]=S.length,e.createSparseMatrix({values:x,index:S,ptr:C,size:[h,g],datatype:l===e._datatype&&m===r._datatype?_:void 0})}}),of=V(`useMatrixForArrayScalar`,[`typed`,`matrix`],e=>{var{typed:t,matrix:n}=e;return{"Array, number":t.referTo(`DenseMatrix, number`,e=>(t,r)=>e(n(t),r).valueOf()),"Array, BigNumber":t.referTo(`DenseMatrix, BigNumber`,e=>(t,r)=>e(n(t),r).valueOf()),"number, Array":t.referTo(`number, DenseMatrix`,e=>(t,r)=>e(t,n(r)).valueOf()),"BigNumber, Array":t.referTo(`BigNumber, DenseMatrix`,e=>(t,r)=>e(t,n(r)).valueOf())}}),sf=`leftShift`,cf=V(sf,[`typed`,`matrix`,`equalScalar`,`zeros`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:a,concat:o}=e,s=yc({typed:t}),c=uc({typed:t,equalScalar:r}),l=af({typed:t,equalScalar:r}),u=xc({typed:t,DenseMatrix:a}),d=Vs({typed:t,equalScalar:r}),f=Us({typed:t}),p=gc({typed:t,matrix:n,concat:o}),m=of({typed:t,matrix:n});return t(sf,{"number, number":Ua,"BigNumber, BigNumber":ul,"bigint, bigint":(e,t)=>e<<t,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():f(t,n,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):u(n,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):f(n,t,e,!0))},m,p({SS:l,DS:s,SD:c}))}),lf=`rightArithShift`,uf=V(lf,[`typed`,`matrix`,`equalScalar`,`zeros`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:a,concat:o}=e,s=yc({typed:t}),c=uc({typed:t,equalScalar:r}),l=af({typed:t,equalScalar:r}),u=xc({typed:t,DenseMatrix:a}),d=Vs({typed:t,equalScalar:r}),f=Us({typed:t}),p=gc({typed:t,matrix:n,concat:o}),m=of({typed:t,matrix:n});return t(lf,{"number, number":Wa,"BigNumber, BigNumber":dl,"bigint, bigint":(e,t)=>e>>t,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():f(t,n,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):u(n,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):f(n,t,e,!0))},m,p({SS:l,DS:s,SD:c}))}),df=`rightLogShift`,ff=V(df,[`typed`,`matrix`,`equalScalar`,`zeros`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,DenseMatrix:a,concat:o}=e,s=yc({typed:t}),c=uc({typed:t,equalScalar:r}),l=af({typed:t,equalScalar:r}),u=xc({typed:t,DenseMatrix:a}),d=Vs({typed:t,equalScalar:r}),f=Us({typed:t}),p=gc({typed:t,matrix:n,concat:o}),m=of({typed:t,matrix:n});return t(df,{"number, number":Ga,"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():d(t,n,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,n)=>r(n,0)?t.clone():f(t,n,e,!1)),"number | BigNumber, SparseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):u(n,t,e,!0)),"number | BigNumber, DenseMatrix":t.referToSelf(e=>(t,n)=>r(t,0)?i(n.size(),n.storage()):f(n,t,e,!0))},m,p({SS:l,DS:s,SD:c}))}),pf=`and`,mf=V(pf,[`typed`,`matrix`,`equalScalar`,`zeros`,`not`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o}=e,s=uc({typed:t,equalScalar:r}),c=kc({typed:t,equalScalar:r}),l=Vs({typed:t,equalScalar:r}),u=Us({typed:t}),d=gc({typed:t,matrix:n,concat:o});return t(pf,{"number, number":ro,"Complex, Complex":function(e,t){return(e.re!==0||e.im!==0)&&(t.re!==0||t.im!==0)},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!t.isZero()&&!e.isNaN()&&!t.isNaN()},"bigint, bigint":ro,"Unit, Unit":t.referToSelf(e=>(t,n)=>e(t.value||0,n.value||0)),"SparseMatrix, any":t.referToSelf(e=>(t,n)=>a(n)?i(t.size(),t.storage()):l(t,n,e,!1)),"DenseMatrix, any":t.referToSelf(e=>(t,n)=>a(n)?i(t.size(),t.storage()):u(t,n,e,!1)),"any, SparseMatrix":t.referToSelf(e=>(t,n)=>a(t)?i(t.size(),t.storage()):l(n,t,e,!0)),"any, DenseMatrix":t.referToSelf(e=>(t,n)=>a(t)?i(t.size(),t.storage()):u(n,t,e,!0)),"Array, any":t.referToSelf(e=>(t,r)=>e(n(t),r).valueOf()),"any, Array":t.referToSelf(e=>(t,r)=>e(t,n(r)).valueOf())},d({SS:c,DS:s}))}),hf=`compare`,gf=V(hf,[`typed`,`config`,`matrix`,`equalScalar`,`BigNumber`,`Fraction`,`DenseMatrix`,`concat`],e=>{var{typed:t,config:n,equalScalar:r,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:s,concat:c}=e,l=dc({typed:t}),u=fc({typed:t,equalScalar:r}),d=Hs({typed:t,DenseMatrix:s}),f=gc({typed:t,matrix:i,concat:c}),p=Qo({typed:t});return t(hf,_f({typed:t,config:n}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return Mo(e,t,n.relTol,n.absTol)?new a(0):new a(e.cmp(t))},"bigint, bigint":function(e,t){return e===t?0n:e>t?1n:-1n},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw TypeError(`No ordering relation is defined for complex numbers`)}},p,f({SS:u,DS:l,Ss:d}))}),_f=V(hf,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(hf,{"number, number":function(e,t){return gt(e,t,n.relTol,n.absTol)?0:e>t?1:-1}})}),vf=l(o(((e,t)=>{t.exports=function e(t,n){"use strict";var r=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,i=/(^[ ]*|[ ]*$)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,o=/^0x[0-9a-f]+$/i,s=/^0/,c=function(t){return e.insensitive&&(``+t).toLowerCase()||``+t},l=c(t).replace(i,``)||``,u=c(n).replace(i,``)||``,d=l.replace(r,`\0$1\0`).replace(/\0$/,``).replace(/^\0/,``).split(`\0`),f=u.replace(r,`\0$1\0`).replace(/\0$/,``).replace(/^\0/,``).split(`\0`),p=parseInt(l.match(o),16)||d.length!==1&&l.match(a)&&Date.parse(l),m=parseInt(u.match(o),16)||p&&u.match(a)&&Date.parse(u)||null,h,g;if(m){if(p<m)return-1;if(p>m)return 1}for(var _=0,v=Math.max(d.length,f.length);_<v;_++){if(h=!(d[_]||``).match(s)&&parseFloat(d[_])||d[_]||0,g=!(f[_]||``).match(s)&&parseFloat(f[_])||f[_]||0,isNaN(h)!==isNaN(g))return isNaN(h)?1:-1;if(typeof h!=typeof g&&(h+=``,g+=``),h<g)return-1;if(h>g)return 1}return 0}}))(),1),yf=`compareNatural`,bf=V(yf,[`typed`,`compare`],e=>{var{typed:t,compare:n}=e,r=n.signatures[`boolean,boolean`];return t(yf,{"any, any":i});function i(e,t){var c=Me(e),l=Me(t),u;if((c===`number`||c===`BigNumber`||c===`Fraction`||c===`bigint`)&&(l===`number`||l===`BigNumber`||l===`Fraction`||l===`bigint`))return u=n(e,t),u.toString()===`0`?(0,vf.default)(c,l):u>0?1:-1;var d=[`Array`,`DenseMatrix`,`SparseMatrix`];if(d.includes(c)||d.includes(l))return u=a(i,e,t),u===0?(0,vf.default)(c,l):u;if(c!==l)return(0,vf.default)(c,l);if(c===`Complex`)return xf(e,t);if(c===`Unit`)return e.equalBase(t)?i(e.value,t.value):o(i,e.formatUnits(),t.formatUnits());if(c===`boolean`)return r(e,t);if(c===`string`)return(0,vf.default)(e,t);if(c===`Object`)return s(i,e,t);if(c===`null`||c===`undefined`)return 0;throw TypeError(`Unsupported type of value "`+c+`"`)}function a(e,t,n){return ne(t)&&ne(n)?o(e,t.toJSON().values,n.toJSON().values):ne(t)?a(e,t.toArray(),n):ne(n)?a(e,t,n.toArray()):te(t)?a(e,t.toJSON().data,n):te(n)?a(e,t,n.toJSON().data):Array.isArray(t)?Array.isArray(n)?o(e,t,n):a(e,t,[n]):a(e,[t],n)}function o(e,t,n){for(var r=0,i=Math.min(t.length,n.length);r<i;r++){var a=e(t[r],n[r]);if(a!==0)return a}return t.length>n.length?1:t.length<n.length?-1:0}function s(e,t,n){var r=Object.keys(t),i=Object.keys(n);r.sort(vf.default),i.sort(vf.default);var a=o(e,r,i);if(a!==0)return a;for(var s=0;s<r.length;s++){var c=e(t[r[s]],n[i[s]]);if(c!==0)return c}return 0}});function xf(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0}var Sf=`compareText`,Cf=[`typed`,`matrix`,`concat`];pi.signature=`any, any`;var wf=V(Sf,Cf,e=>{var{typed:t,matrix:n,concat:r}=e;return t(Sf,pi,gc({typed:t,matrix:n,concat:r})({elop:pi,Ds:!0}))}),Tf=`equal`,Ef=V(Tf,[`typed`,`matrix`,`equalScalar`,`DenseMatrix`,`SparseMatrix`],e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=dc({typed:t}),c=vl({typed:t,SparseMatrix:o}),l=Hs({typed:t,DenseMatrix:i}),u=gc({typed:t,matrix:n});return t(Tf,Df({typed:t,equalScalar:r}),u({elop:r,SS:c,DS:s,Ss:l}))}),Df=V(Tf,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return t(Tf,{"any, any":function(e,t){return e===null?t===null:t===null?e===null:e===void 0?t===void 0:t===void 0?e===void 0:n(e,t)}})}),Of=`equalText`,kf=V(Of,[`typed`,`compareText`,`isZero`],e=>{var{typed:t,compareText:n,isZero:r}=e;return t(Of,{"any, any":function(e,t){return r(n(e,t))}})}),Af=`smaller`,jf=V(Af,[`typed`,`config`,`bignumber`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,c=dc({typed:t}),l=vl({typed:t,SparseMatrix:s}),u=Hs({typed:t,DenseMatrix:a}),d=gc({typed:t,matrix:i,concat:o}),f=Qo({typed:t});function p(e,t){return e.lt(t)&&!Mo(e,t,n.relTol,n.absTol)}return t(Af,Mf({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<t,"BigNumber, BigNumber":p,"bigint, bigint":(e,t)=>e<t,"Fraction, Fraction":(e,t)=>e.compare(t)===-1,"Fraction, BigNumber":function(e,t){return p(r(e),t)},"BigNumber, Fraction":function(e,t){return p(e,r(t))},"Complex, Complex":function(e,t){throw TypeError(`No ordering relation is defined for complex numbers`)}},f,d({SS:l,DS:c,Ss:u}))}),Mf=V(Af,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(Af,{"number, number":function(e,t){return e<t&&!gt(e,t,n.relTol,n.absTol)}})}),Nf=`smallerEq`,Pf=V(Nf,[`typed`,`config`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=dc({typed:t}),c=vl({typed:t,SparseMatrix:o}),l=Hs({typed:t,DenseMatrix:i}),u=gc({typed:t,matrix:r,concat:a}),d=Qo({typed:t});return t(Nf,Ff({typed:t,config:n}),{"boolean, boolean":(e,t)=>e<=t,"BigNumber, BigNumber":function(e,t){return e.lte(t)||Mo(e,t,n.relTol,n.absTol)},"bigint, bigint":(e,t)=>e<=t,"Fraction, Fraction":(e,t)=>e.compare(t)!==1,"Complex, Complex":function(){throw TypeError(`No ordering relation is defined for complex numbers`)}},d,u({SS:c,DS:s,Ss:l}))}),Ff=V(Nf,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(Nf,{"number, number":function(e,t){return e<=t||gt(e,t,n.relTol,n.absTol)}})}),If=`larger`,Lf=V(If,[`typed`,`config`,`bignumber`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,config:n,bignumber:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,c=dc({typed:t}),l=vl({typed:t,SparseMatrix:s}),u=Hs({typed:t,DenseMatrix:a}),d=gc({typed:t,matrix:i,concat:o}),f=Qo({typed:t});function p(e,t){return e.gt(t)&&!Mo(e,t,n.relTol,n.absTol)}return t(If,Rf({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>t,"BigNumber, BigNumber":p,"bigint, bigint":(e,t)=>e>t,"Fraction, Fraction":(e,t)=>e.compare(t)===1,"Fraction, BigNumber":function(e,t){return p(r(e),t)},"BigNumber, Fraction":function(e,t){return p(e,r(t))},"Complex, Complex":function(){throw TypeError(`No ordering relation is defined for complex numbers`)}},f,d({SS:l,DS:c,Ss:u}))}),Rf=V(If,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(If,{"number, number":function(e,t){return e>t&&!gt(e,t,n.relTol,n.absTol)}})}),zf=`largerEq`,Bf=V(zf,[`typed`,`config`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,config:n,matrix:r,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=dc({typed:t}),c=vl({typed:t,SparseMatrix:o}),l=Hs({typed:t,DenseMatrix:i}),u=gc({typed:t,matrix:r,concat:a}),d=Qo({typed:t});return t(zf,Vf({typed:t,config:n}),{"boolean, boolean":(e,t)=>e>=t,"BigNumber, BigNumber":function(e,t){return e.gte(t)||Mo(e,t,n.relTol,n.absTol)},"bigint, bigint":function(e,t){return e>=t},"Fraction, Fraction":(e,t)=>e.compare(t)!==-1,"Complex, Complex":function(){throw TypeError(`No ordering relation is defined for complex numbers`)}},d,u({SS:c,DS:s,Ss:l}))}),Vf=V(zf,[`typed`,`config`],e=>{var{typed:t,config:n}=e;return t(zf,{"number, number":function(e,t){return e>=t||gt(e,t,n.relTol,n.absTol)}})}),Hf=`deepEqual`,Uf=V(Hf,[`typed`,`equal`],e=>{var{typed:t,equal:n}=e;return t(Hf,{"any, any":function(e,t){return r(e.valueOf(),t.valueOf())}});function r(e,t){if(Array.isArray(e))if(Array.isArray(t)){var i=e.length;if(i!==t.length)return!1;for(var a=0;a<i;a++)if(!r(e[a],t[a]))return!1;return!0}else return!1;return!Array.isArray(t)&&n(e,t)}}),Wf=`unequal`,Gf=V(Wf,[`typed`,`config`,`equalScalar`,`matrix`,`DenseMatrix`,`concat`,`SparseMatrix`],e=>{var{typed:t,config:n,equalScalar:r,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e,c=dc({typed:t}),l=vl({typed:t,SparseMatrix:s}),u=Hs({typed:t,DenseMatrix:a}),d=gc({typed:t,matrix:i,concat:o});return t(Wf,Kf({typed:t,equalScalar:r}),d({elop:f,SS:l,DS:c,Ss:u}));function f(e,t){return!r(e,t)}}),Kf=V(Wf,[`typed`,`equalScalar`],e=>{var{typed:t,equalScalar:n}=e;return t(Wf,{"any, any":function(e,t){return e===null?t!==null:t===null?e!==null:e===void 0?t!==void 0:t===void 0?e!==void 0:!n(e,t)}})}),qf=`partitionSelect`,Jf=V(qf,[`typed`,`isNumeric`,`isNaN`,`compare`],e=>{var{typed:t,isNumeric:n,isNaN:r,compare:i}=e,a=i,o=(e,t)=>-i(e,t);return t(qf,{"Array | Matrix, number":function(e,t){return s(e,t,a)},"Array | Matrix, number, string":function(e,t,n){if(n===`asc`)return s(e,t,a);if(n===`desc`)return s(e,t,o);throw Error(`Compare string must be "asc" or "desc"`)},"Array | Matrix, number, function":s});function s(e,t,n){if(!H(t)||t<0)throw Error(`k must be a non-negative integer`);if(F(e)){if(e.size().length>1)throw Error(`Only one dimensional matrices supported`);return c(e.valueOf(),t,n)}if(Array.isArray(e))return c(e,t,n)}function c(e,t,i){if(t>=e.length)throw Error(`k out of bounds`);for(var a=0;a<e.length;a++)if(n(e[a])&&r(e[a]))return e[a];for(var o=0,s=e.length-1;o<s;){for(var c=o,l=s,u=e[Math.floor(Math.random()*(s-o+1))+o];c<l;)if(i(e[c],u)>=0){var d=e[l];e[l]=e[c],e[c]=d,--l}else++c;i(e[c],u)>0&&--c,t<=c?s=c:o=c+1}return e[t]}}),Yf=`sort`,Xf=V(Yf,[`typed`,`matrix`,`compare`,`compareNatural`],e=>{var{typed:t,matrix:n,compare:r,compareNatural:i}=e,a=r,o=(e,t)=>-r(e,t);return t(Yf,{Array:function(e){return c(e),e.sort(a)},Matrix:function(e){return l(e),n(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return c(e),e.sort(t)},"Matrix, function":function(e,t){return l(e),n(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return c(e),e.sort(s(t))},"Matrix, string":function(e,t){return l(e),n(e.toArray().sort(s(t)),e.storage())}});function s(e){if(e===`asc`)return a;if(e===`desc`)return o;if(e===`natural`)return i;throw Error(`String "asc", "desc", or "natural" expected`)}function c(e){if(gi(e).length!==1)throw Error(`One dimensional array expected`)}function l(e){if(e.size().length!==1)throw Error(`One dimensional matrix expected`)}}),Zf=`max`,Qf=V(Zf,[`typed`,`config`,`numeric`,`larger`,`isNaN`],e=>{var{typed:t,config:n,numeric:r,larger:i,isNaN:a}=e;return t(Zf,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){return ua(e,t.valueOf(),o)},"...":function(e){if(sa(e))throw TypeError(`Scalar values expected in function max`);return s(e)}});function o(e,t){try{return i(e,t)?e:t}catch(e){throw cd(e,`max`,t)}}function s(e){var t;if(ca(e,function(e){try{(a(e)||t===void 0||i(e,t))&&(t=e)}catch(t){throw cd(t,`max`,e)}}),t===void 0)throw Error(`Cannot calculate max of an empty array`);return typeof t==`string`&&(t=r(t,Qe(t,n))),t}}),$f=`min`,ep=V($f,[`typed`,`config`,`numeric`,`smaller`,`isNaN`],e=>{var{typed:t,config:n,numeric:r,smaller:i,isNaN:a}=e;return t($f,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(e,t){return ua(e,t.valueOf(),o)},"...":function(e){if(sa(e))throw TypeError(`Scalar values expected in function min`);return s(e)}});function o(e,t){try{return i(e,t)?e:t}catch(e){throw cd(e,`min`,t)}}function s(e){var t;if(ca(e,function(e){try{(a(e)||t===void 0||i(e,t))&&(t=e)}catch(t){throw cd(t,`min`,e)}}),t===void 0)throw Error(`Cannot calculate min of an empty array`);return typeof t==`string`&&(t=r(t,Qe(t,n))),t}}),tp=V(`ImmutableDenseMatrix`,[`smaller`,`DenseMatrix`],e=>{var{smaller:t,DenseMatrix:n}=e;function r(e,t){if(!(this instanceof r))throw SyntaxError(`Constructor must be called with the new operator`);if(t&&!N(t))throw Error(`Invalid datatype: `+t);if(F(e)||P(e)){var i=new n(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&P(e.data)&&P(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=e.min===void 0?null:e.min,this._max=e.max===void 0?null:e.max;else if(e)throw TypeError(`Unsupported type of data (`+Me(e)+`)`);else this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}return r.prototype=new n,r.prototype.type=`ImmutableDenseMatrix`,r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return F(t)?new r({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw Error(`Cannot invoke set subset on an Immutable Matrix instance`);default:throw SyntaxError(`Wrong number of arguments`)}},r.prototype.set=function(){throw Error(`Cannot invoke set on an Immutable Matrix instance`)},r.prototype.resize=function(){throw Error(`Cannot invoke resize on an Immutable Matrix instance`)},r.prototype.reshape=function(){throw Error(`Cannot invoke reshape on an Immutable Matrix instance`)},r.prototype.clone=function(){return new r({data:Ne(this._data),size:Ne(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:`ImmutableDenseMatrix`,data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(){throw Error(`Cannot invoke swapRows on an Immutable Matrix instance`)},r.prototype.min=function(){if(this._min===null){var e=null;this.forEach(function(n){(e===null||t(n,e))&&(e=n)}),this._min=e===null?void 0:e}return this._min},r.prototype.max=function(){if(this._max===null){var e=null;this.forEach(function(n){(e===null||t(e,n))&&(e=n)}),this._max=e===null?void 0:e}return this._max},r},{isClass:!0}),np=V(`Index`,[`ImmutableDenseMatrix`,`getMatrixDataType`],e=>{var{ImmutableDenseMatrix:t,getMatrixDataType:n}=e;function r(){if(!(this instanceof r))throw SyntaxError(`Constructor must be called with the new operator`);this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var e=0,t=arguments.length;e<t;e++){var a=e<0||arguments.length<=e?void 0:arguments[e],o=P(a),s=F(a),c=typeof a,l=null;if(re(a))this._dimensions.push(a),this._isScalar=!1;else if(o||s){var u=void 0;this._isScalar=!1,n(a)===`boolean`?(o&&(u=i(rp(a).valueOf())),s&&(u=i(rp(a._data).valueOf())),l=a.valueOf().length):u=i(a.valueOf()),this._dimensions.push(u)}else if(c===`number`)this._dimensions.push(a);else if(c===`bigint`)this._dimensions.push(Number(a));else if(c===`string`)this._dimensions.push(a);else throw TypeError(`Dimension must be an Array, Matrix, number, bigint, string, or Range`);this._sourceSize.push(l)}}r.prototype.type=`Index`,r.prototype.isIndex=!0;function i(e){for(var n=0,r=e.length;n<r;n++)if(!D(e[n])||!H(e[n]))throw TypeError(`Index parameters must be positive integer numbers`);var i=new t;return i._data=e,i._size=[e.length],i}return r.prototype.clone=function(){var e=new r;return e._dimensions=Ne(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},r.create=function(e){var t=new r;return r.apply(t,e),t},r.prototype.size=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]=N(r)||D(r)?1:r.size()[0]}return e},r.prototype.max=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]=N(r)||D(r)?r:r.max()}return e},r.prototype.min=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]=N(r)||D(r)?r:r.min()}return e},r.prototype.forEach=function(e){for(var t=0,n=this._dimensions.length;t<n;t++)e(this._dimensions[t],t,this)},r.prototype.dimension=function(e){return D(e)?this._dimensions[e]??null:null},r.prototype.isObjectProperty=function(){return this._dimensions.length===1&&N(this._dimensions[0])},r.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},r.prototype.isScalar=function(){return this._isScalar},r.prototype.toArray=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e.push(N(r)||D(r)?r:r.toArray())}return e},r.prototype.valueOf=r.prototype.toArray,r.prototype.toString=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];N(r)?e.push(JSON.stringify(r)):e.push(r.toString())}return`[`+e.join(`, `)+`]`},r.prototype.toJSON=function(){return{mathjs:`Index`,dimensions:this._dimensions}},r.fromJSON=function(e){return r.create(e.dimensions)},r},{isClass:!0});function rp(e){var t=[];return e.forEach((e,n)=>{e&&t.push(n)}),t}var ip=V(`FibonacciHeap`,[`smaller`,`larger`],e=>{var{smaller:t,larger:n}=e,r=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw SyntaxError(`Constructor must be called with the new operator`);this._minimum=null,this._size=0}i.prototype.type=`FibonacciHeap`,i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,n){var r={key:e,value:n,degree:0};if(this._minimum){var i=this._minimum;r.left=i,r.right=i.right,i.right=r,r.right.left=r,t(e,i.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return this._size===0},i.prototype.extractMinimum=function(){var e=this._minimum;if(e===null)return e;for(var t=this._minimum,n=e.degree,r=e.child;n>0;){var i=r.right;r.left.right=r.right,r.right.left=r.left,r.left=t,r.right=t.right,t.right=r,r.right.left=r,r.parent=null,r=i,n--}return e.left.right=e.right,e.right.left=e.left,e===e.right?t=null:(t=e.right,t=l(t,this._size)),this._size--,this._minimum=t,e},i.prototype.remove=function(e){this._minimum=a(this._minimum,e,-1),this.extractMinimum()};function a(e,n,r){n.key=r;var i=n.parent;return i&&t(n.key,i.key)&&(o(e,n,i),s(e,i)),t(n.key,e.key)&&(e=n),e}function o(e,t,n){t.left.right=t.right,t.right.left=t.left,n.degree--,n.child===t&&(n.child=t.right),n.degree===0&&(n.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function s(e,t){var n=t.parent;n&&(t.mark?(o(e,t,n),s(n)):t.mark=!0)}var c=function(e,t){e.left.right=e.right,e.right.left=e.left,e.parent=t,t.child?(e.left=t.child,e.right=t.child.right,t.child.right=e,e.right.left=e):(t.child=e,e.right=e,e.left=e),t.degree++,e.mark=!1};function l(e,i){var a=Math.floor(Math.log(i)*r)+1,o=Array(a),s=0,l=e;if(l)for(s++,l=l.right;l!==e;)s++,l=l.right;for(var u;s>0;){for(var d=l.degree,f=l.right;u=o[d],u;){if(n(l.key,u.key)){var p=u;u=l,l=p}c(u,l),o[d]=null,d++}o[d]=l,l=f,s--}e=null;for(var m=0;m<a;m++)u=o[m],u&&(e?(u.left.right=u.right,u.right.left=u.left,u.left=e,u.right=e.right,e.right=u,u.right.left=u,t(u.key,e.key)&&(e=u)):e=u);return e}return i},{isClass:!0}),ap=V(`Spa`,[`addScalar`,`equalScalar`,`FibonacciHeap`],e=>{var{addScalar:t,equalScalar:n,FibonacciHeap:r}=e;function i(){if(!(this instanceof i))throw SyntaxError(`Constructor must be called with the new operator`);this._values=[],this._heap=new r}return i.prototype.type=`Spa`,i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var n=this._heap.insert(e,t);this._values[e]=n}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,n){var r=this._values[e];r?r.value=t(r.value,n):(r=this._heap.insert(e,n),this._values[e]=r)},i.prototype.forEach=function(e,t,r){var i=this._heap,a=this._values,o=[],s=i.extractMinimum();for(s&&o.push(s);s&&s.key<=t;)s.key>=e&&(n(s.value,0)||r(s.key,s.value,this)),s=i.extractMinimum(),s&&o.push(s);for(var c=0;c<o.length;c++){var l=o[c];s=i.insert(l.key,l.value),a[s.key]=s}},i.prototype.swap=function(e,t){var n=this._values[e],r=this._values[t];if(!n&&r)n=this._heap.insert(e,r.value),this._heap.remove(r),this._values[e]=n,this._values[t]=void 0;else if(n&&!r)r=this._heap.insert(t,n.value),this._heap.remove(n),this._values[t]=r,this._values[e]=void 0;else if(n&&r){var i=n.value;n.value=r.value,r.value=i}},i},{isClass:!0});function op(e){var t=0,n=1,r=Object.create(null),i=Object.create(null),a=0,o=function(e){var o=i[e];if(o&&(delete r[o],delete i[e],--t,n===o)){if(!t){a=0,n=1;return}for(;!Object.prototype.hasOwnProperty.call(r,++n););}};return e=Math.abs(e),{hit:function(s){var c=i[s],l=++a;if(r[l]=s,i[s]=l,!c)return++t,t<=e?void 0:(s=r[n],o(s),s);if(delete r[c],n===c)for(;!Object.prototype.hasOwnProperty.call(r,++n););},delete:o,clear:function(){t=a=0,n=1,r=Object.create(null),i=Object.create(null)}}}function sp(e){var{hasher:t,limit:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n??=1/0,t??=JSON.stringify,function r(){typeof r.cache!=`object`&&(r.cache={values:new Map,lru:op(n||1/0)});for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t(i);if(r.cache.values.has(o))return r.cache.lru.hit(o),r.cache.values.get(o);var s=e.apply(e,i);return r.cache.values.set(o,s),r.cache.values.delete(r.cache.lru.hit(o)),s}}var cp=sp(function(e){return new e(1).exp()},{hasher:fp}),lp=sp(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:fp}),up=sp(function(e){return e.acos(-1)},{hasher:fp}),dp=sp(function(e){return up(e).times(2)},{hasher:fp});function fp(e){return e[0].precision}function pp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?pp(Object(n),!0).forEach(function(t){Ju(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pp(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var hp=V(`Unit`,[`?on`,`config`,`addScalar`,`subtractScalar`,`multiplyScalar`,`divideScalar`,`pow`,`abs`,`fix`,`round`,`equal`,`isNumeric`,`format`,`number`,`Complex`,`BigNumber`,`Fraction`],e=>{var{on:t,config:n,addScalar:r,subtractScalar:i,multiplyScalar:a,divideScalar:o,pow:s,abs:c,fix:l,round:d,equal:f,isNumeric:p,format:m,number:h,Complex:g,BigNumber:_,Fraction:v}=e,y=h,b=!1,x=!0;function S(e,t){if(!(this instanceof S))throw Error(`Constructor must be called with the new operator`);if(!(e==null||p(e)||A(e)))throw TypeError(`First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined`);if(this.fixPrefix=b,this.skipAutomaticSimplification=x,t===void 0)this.units=[],this.dimensions=oe.map(e=>0);else if(typeof t==`string`){var n=S.parse(t);this.units=n.units,this.dimensions=n.dimensions}else if(M(t)&&t.value===null)this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map(e=>u({},e));else throw TypeError(`Second parameter in Unit constructor must be a string or valueless Unit`);this.value=this._normalize(e)}Object.defineProperty(S,"name",{value:`Unit`}),S.prototype.constructor=S,S.prototype.type=`Unit`,S.prototype.isUnit=!0;var C,w,T;function E(){for(;T===` `||T===` `;)k()}function D(e){return e>=`0`&&e<=`9`||e===`.`}function O(e){return e>=`0`&&e<=`9`}function k(){w++,T=C.charAt(w)}function j(e){w=e,T=C.charAt(w)}function N(){var e=``,t=w;if(T===`+`?k():T===`-`&&(e+=T,k()),!D(T))return j(t),null;if(T===`.`){if(e+=T,k(),!O(T))return j(t),null}else{for(;O(T);)e+=T,k();T===`.`&&(e+=T,k())}for(;O(T);)e+=T,k();if(T===`E`||T===`e`){var n=``,r=w;if(n+=T,k(),(T===`+`||T===`-`)&&(n+=T,k()),!O(T))return j(r),e;for(e+=n;O(T);)e+=T,k()}return e}function P(){for(var e=``;O(T)||S.isValidAlpha(T);)e+=T,k();var t=e.charAt(0);return S.isValidAlpha(t)?e:null}function F(e){return T===e?(k(),e):null}S.parse=function(e,t){if(t||={},C=e,w=-1,T=``,typeof C!=`string`)throw TypeError(`Invalid argument in Unit.parse, string expected`);var r=new S;r.units=[];var i=1,a=!1;k(),E();var o=N(),s=null;if(o){if(n.number===`BigNumber`)s=new _(o);else if(n.number===`Fraction`)try{s=new v(o)}catch{s=parseFloat(o)}else s=parseFloat(o);E(),F(`*`)?(i=1,a=!0):F(`/`)&&(i=-1,a=!0)}for(var c=[],l=1;;){for(E();T===`(`;)c.push(i),l*=i,i=1,k(),E();var u=void 0;if(T){var d=T;if(u=P(),u===null)throw SyntaxError(`Unexpected "`+d+`" in "`+C+`" at index `+w.toString())}else break;var f=ee(u);if(f===null)throw SyntaxError(`Unit "`+u+`" not found.`);var p=i*l;if(E(),F(`^`)){E();var m=N();if(m===null)throw SyntaxError(`In "`+e+`", "^" must be followed by a floating-point number`);p*=m}r.units.push({unit:f.unit,prefix:f.prefix,power:p});for(var h=0;h<oe.length;h++)r.dimensions[h]+=(f.unit.dimensions[h]||0)*p;for(E();T===`)`;){if(c.length===0)throw SyntaxError(`Unmatched ")" in "`+C+`" at index `+w.toString());l/=c.pop(),k(),E()}if(a=!1,F(`*`)?(i=1,a=!0):F(`/`)?(i=-1,a=!0):i=1,f.unit.base){var g=f.unit.base.key;de.auto[g]={unit:f.unit,prefix:f.prefix}}}if(E(),T)throw SyntaxError(`Could not parse: "`+e+`"`);if(a)throw SyntaxError(`Trailing characters: "`+e+`"`);if(c.length!==0)throw SyntaxError(`Unmatched "(" in "`+C+`"`);if(r.units.length===0&&!t.allowNoUnits)throw SyntaxError(`"`+e+`" contains no units`);return r.value=s===void 0?null:r._normalize(s),r},S.prototype.clone=function(){var e=new S;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=Ne(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var n in e.units[t]={},this.units[t])z(this.units[t],n)&&(e.units[t][n]=this.units[t][n]);return e},S.prototype.valueType=function(){return Me(this.value)},S.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},S.prototype._normalize=function(e){if(e==null||this.units.length===0)return e;for(var t=e,n=S._getNumberConverter(Me(e)),r=0;r<this.units.length;r++){var i=n(this.units[r].unit.value),o=n(this.units[r].prefix.value),c=n(this.units[r].power);t=a(t,s(a(i,o),c))}return t},S.prototype._denormalize=function(e,t){if(e==null||this.units.length===0)return e;for(var n=e,r=S._getNumberConverter(Me(e)),i=0;i<this.units.length;i++){var c=r(this.units[i].unit.value),l=r(this.units[i].prefix.value),u=r(this.units[i].power);n=o(n,s(a(c,l),u))}return n};var ee=sp(e=>{if(z(R,e)){var t=R[e];return{unit:t,prefix:t.prefixes[``]}}for(var n in R)if(z(R,n)&&ai(e,n)){var r=R[n],i=e.length-n.length,a=e.substring(0,i),o=z(r.prefixes,a)?r.prefixes[a]:void 0;if(o!==void 0)return{unit:r,prefix:o}}return null},{hasher:e=>e[0],limit:100});S.isValuelessUnit=function(e){return ee(e)!==null},S.prototype.hasBase=function(e){if(typeof e==`string`&&(e=L[e]),!e)return!1;for(var t=0;t<oe.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},S.prototype.equalBase=function(e){for(var t=0;t<oe.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},S.prototype.equals=function(e){return this.equalBase(e)&&f(this.value,e.value)},S.prototype.multiply=function(e){for(var t=this.clone(),n=M(e)?e:new S(e),r=0;r<oe.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(n.dimensions[r]||0);for(var i=0;i<n.units.length;i++){var o=mp({},n.units[i]);t.units.push(o)}return t.value=this.value!==null||n.value!==null?a(this.value===null?this._normalize(ne(n.value)):this.value,n.value===null?n._normalize(ne(this.value)):n.value):null,M(e)&&(t.skipAutomaticSimplification=!1),te(t)},S.prototype.divideInto=function(e){return new S(e).divide(this)},S.prototype.divide=function(e){for(var t=this.clone(),n=M(e)?e:new S(e),r=0;r<oe.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(n.dimensions[r]||0);for(var i=0;i<n.units.length;i++){var a=mp(mp({},n.units[i]),{},{power:-n.units[i].power});t.units.push(a)}return t.value=this.value!==null||n.value!==null?o(this.value===null?this._normalize(ne(n.value)):this.value,n.value===null?n._normalize(ne(this.value)):n.value):null,M(e)&&(t.skipAutomaticSimplification=!1),te(t)},S.prototype.pow=function(e){for(var t=this.clone(),n=0;n<oe.length;n++)t.dimensions[n]=(this.dimensions[n]||0)*e;for(var r=0;r<t.units.length;r++)t.units[r].power*=e;return t.value=t.value===null?null:s(t.value,e),t.skipAutomaticSimplification=!1,te(t)};function te(e){return e.equalBase(L.NONE)&&e.value!==null&&!n.predictable?e.value:e}function ne(e){return S._getNumberConverter(Me(e))(1)}S.prototype.abs=function(){var e=this.clone();if(e.value!==null)if(e._isDerived()||e.units.length===0||e.units[0].unit.offset===0)e.value=c(e.value);else{var t=e._numberConverter(),n=a(t(e.units[0].unit.value),t(e.units[0].unit.offset));e.value=i(c(r(e.value,n)),n)}for(var o in e.units)(e.units[o].unit.name===`VA`||e.units[o].unit.name===`VAR`)&&(e.units[o].unit=R.W);return e},S.prototype.to=function(e){var t=this.value===null?this._normalize(1):this.value,n;if(typeof e==`string`)n=S.parse(e);else if(M(e))n=e.clone();else throw Error(`String or Unit expected as parameter`);if(!this.equalBase(n))throw Error(`Units do not match ('${n.toString()}' != '${this.toString()}')`);if(n.value!==null)throw Error(`Cannot convert to a unit with a value`);if(this.value===null||this._isDerived()||this.units.length===0||n.units.length===0||this.units[0].unit.offset===n.units[0].unit.offset)n.value=Ne(t);else{var o=S._getNumberConverter(Me(t)),s=this.units[0].unit.value,c=this.units[0].unit.offset,l=a(s,c),u=n.units[0].unit.value,d=n.units[0].unit.offset,f=a(u,d);n.value=r(t,o(i(l,f)))}return n.fixPrefix=!0,n.skipAutomaticSimplification=!0,n},S.prototype.toNumber=function(e){return y(this.toNumeric(e))},S.prototype.toNumeric=function(e){var t=e?this.to(e):this.clone();return t._isDerived()||t.units.length===0?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},S.prototype.toString=function(){return this.format()},S.prototype.toJSON=function(){return{mathjs:`Unit`,value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix,skipSimp:this.skipAutomaticSimplification}},S.fromJSON=function(e){var t=new S(e.value,e.unit??void 0);return t.fixPrefix=e.fixPrefix??b,t.skipAutomaticSimplification=e.skipSimp??x,t},S.prototype.valueOf=S.prototype.toString,S.prototype.simplify=function(){var e=this.clone(),t=[],n;for(var r in fe)if(z(fe,r)&&e.hasBase(L[r])){n=r;break}if(n===`NONE`)e.units=[];else{var i;if(n&&z(fe,n)&&(i=fe[n]),i)e.units=[{unit:i.unit,prefix:i.prefix,power:1}];else{for(var a=!1,o=0;o<oe.length;o++){var s=oe[o];Math.abs(e.dimensions[o]||0)>1e-12&&(z(fe,s)?t.push({unit:fe[s].unit,prefix:fe[s].prefix,power:e.dimensions[o]||0}):a=!0)}t.length<e.units.length&&!a&&(e.units=t)}}return e},S.prototype.toSI=function(){for(var e=this.clone(),t=[],n=0;n<oe.length;n++){var r=oe[n];if(Math.abs(e.dimensions[n]||0)>1e-12)if(z(de.si,r))t.push({unit:de.si[r].unit,prefix:de.si[r].prefix,power:e.dimensions[n]||0});else throw Error(`Cannot express custom unit `+r+` in SI units`)}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,this.value===null?e:(e.value=null,this.to(e))},S.prototype.formatUnits=function(){for(var e=``,t=``,n=0,r=0,i=0;i<this.units.length;i++)this.units[i].power>0?(n++,e+=` `+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+=`^`+this.units[i].power)):this.units[i].power<0&&r++;if(r>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(n>0?(t+=` `+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+=`^`+-this.units[a].power)):(t+=` `+this.units[a].prefix.name+this.units[a].unit.name,t+=`^`+this.units[a].power));e=e.substr(1),t=t.substr(1),n>1&&r>0&&(e=`(`+e+`)`),r>1&&n>0&&(t=`(`+t+`)`);var o=e;return n>0&&r>0&&(o+=` / `),o+=t,o},S.prototype.toBest=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e&&!Array.isArray(e))throw Error(`Invalid unit type. Expected string or Unit.`);var n=this.units[0].unit.prefixes;if(e&&e.length>0){var r=e.map(e=>{var t=null;if(typeof e==`string`){if(t=S.parse(e),!t)throw Error(`Invalid unit type. Expected compatible string or Unit.`)}else if(!M(e))throw Error(`Invalid unit type. Expected compatible string or Unit.`);t===null&&(t=e.clone());try{return this.to(t.formatUnits()),t}catch{throw Error(`Invalid unit type. Expected compatible string or Unit.`)}}).map(e=>e.units[0].prefix);this.units[0].unit.prefixes=r.reduce((e,t)=>(e[t.name]=t,e),{}),this.units[0].prefix=r[0]}var i=re(this,t).simp;return this.units[0].unit.prefixes=n,i.fixPrefix=!0,i},S.prototype.format=function(e){var{simp:t,valueStr:n,unitStr:r}=re(this,e),i=n;return t.value&&A(t.value)&&(i=`(`+i+`)`),r.length>0&&i.length>0&&(i+=` `),i+=r,i};function re(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.skipAutomaticSimplification||e.value===null?e.clone():e.simplify();ie(n),ae(n,t.offset);var r=n._denormalize(n.value);return{simp:n,valueStr:n.value===null?``:m(r,t||{}),unitStr:n.formatUnits()}}function ie(e){var t=!1;for(var n in e.value!==void 0&&e.value!==null&&A(e.value)&&(t=Math.abs(e.value.re)<1e-14),e.units)z(e.units,n)&&e.units[n].unit&&(e.units[n].unit.name===`VA`&&t?e.units[n].unit=R.VAR:e.units[n].unit.name===`VAR`&&!t&&(e.units[n].unit=R.VA))}function ae(e,t){e.units.length===1&&!e.fixPrefix&&Math.abs(e.units[0].power-Math.round(e.units[0].power))<1e-14&&(e.units[0].prefix=e._bestPrefix(t))}S.prototype._bestPrefix=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1.2;if(this.units.length!==1||Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw Error(`Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!`);var t=this.value===null?0:c(this.value),n=c(this.units[0].unit.value),r=this.units[0].prefix;if(t===0)return r;var i=this.units[0].power,a=Math.log(t/(r.value*n)**+i)/Math.LN10-e;if(a>-2.200001&&a<1.800001)return r;a=Math.abs(a);var o=this.units[0].unit.prefixes;for(var s in o)if(z(o,s)){var l=o[s];if(l.scientific){var u=Math.abs(Math.log(t/(l.value*n)**+i)/Math.LN10-e);(u<a||u===a&&l.name.length<r.name.length)&&(r=l,a=u)}}return r},S.prototype.splitUnit=function(e){for(var t=this.clone(),n=[],a=0;a<e.length&&(t=t.to(e[a]),a!==e.length-1);a++){var o=t.toNumeric(),s=d(o),c=void 0;c=f(s,o)?s:l(t.toNumeric());var u=new S(c,e[a].toString());n.push(u),t=i(t,u)}for(var p=0,m=0;m<n.length;m++)p=r(p,n[m].value);return f(p,this.value)&&(t.value=0),n.push(t),n};var I={NONE:{"":{name:``,value:1,scientific:!0}},SHORT:{"":{name:``,value:1,scientific:!0},da:{name:`da`,value:10,scientific:!1},h:{name:`h`,value:100,scientific:!1},k:{name:`k`,value:1e3,scientific:!0},M:{name:`M`,value:1e6,scientific:!0},G:{name:`G`,value:1e9,scientific:!0},T:{name:`T`,value:0xe8d4a51000,scientific:!0},P:{name:`P`,value:0x38d7ea4c68000,scientific:!0},E:{name:`E`,value:0xde0b6b3a7640000,scientific:!0},Z:{name:`Z`,value:1e21,scientific:!0},Y:{name:`Y`,value:1e24,scientific:!0},R:{name:`R`,value:1e27,scientific:!0},Q:{name:`Q`,value:1e30,scientific:!0},d:{name:`d`,value:.1,scientific:!1},c:{name:`c`,value:.01,scientific:!1},m:{name:`m`,value:.001,scientific:!0},u:{name:`u`,value:1e-6,scientific:!0},n:{name:`n`,value:1e-9,scientific:!0},p:{name:`p`,value:1e-12,scientific:!0},f:{name:`f`,value:1e-15,scientific:!0},a:{name:`a`,value:1e-18,scientific:!0},z:{name:`z`,value:1e-21,scientific:!0},y:{name:`y`,value:1e-24,scientific:!0},r:{name:`r`,value:1e-27,scientific:!0},q:{name:`q`,value:1e-30,scientific:!0}},LONG:{"":{name:``,value:1,scientific:!0},deca:{name:`deca`,value:10,scientific:!1},hecto:{name:`hecto`,value:100,scientific:!1},kilo:{name:`kilo`,value:1e3,scientific:!0},mega:{name:`mega`,value:1e6,scientific:!0},giga:{name:`giga`,value:1e9,scientific:!0},tera:{name:`tera`,value:0xe8d4a51000,scientific:!0},peta:{name:`peta`,value:0x38d7ea4c68000,scientific:!0},exa:{name:`exa`,value:0xde0b6b3a7640000,scientific:!0},zetta:{name:`zetta`,value:1e21,scientific:!0},yotta:{name:`yotta`,value:1e24,scientific:!0},ronna:{name:`ronna`,value:1e27,scientific:!0},quetta:{name:`quetta`,value:1e30,scientific:!0},deci:{name:`deci`,value:.1,scientific:!1},centi:{name:`centi`,value:.01,scientific:!1},milli:{name:`milli`,value:.001,scientific:!0},micro:{name:`micro`,value:1e-6,scientific:!0},nano:{name:`nano`,value:1e-9,scientific:!0},pico:{name:`pico`,value:1e-12,scientific:!0},femto:{name:`femto`,value:1e-15,scientific:!0},atto:{name:`atto`,value:1e-18,scientific:!0},zepto:{name:`zepto`,value:1e-21,scientific:!0},yocto:{name:`yocto`,value:1e-24,scientific:!0},ronto:{name:`ronto`,value:1e-27,scientific:!0},quecto:{name:`quecto`,value:1e-30,scientific:!0}},SQUARED:{"":{name:``,value:1,scientific:!0},da:{name:`da`,value:100,scientific:!1},h:{name:`h`,value:1e4,scientific:!1},k:{name:`k`,value:1e6,scientific:!0},M:{name:`M`,value:0xe8d4a51000,scientific:!0},G:{name:`G`,value:0xde0b6b3a7640000,scientific:!0},T:{name:`T`,value:1e24,scientific:!0},P:{name:`P`,value:1e30,scientific:!0},E:{name:`E`,value:1e36,scientific:!0},Z:{name:`Z`,value:1e42,scientific:!0},Y:{name:`Y`,value:1e48,scientific:!0},R:{name:`R`,value:1e54,scientific:!0},Q:{name:`Q`,value:1e60,scientific:!0},d:{name:`d`,value:.01,scientific:!1},c:{name:`c`,value:1e-4,scientific:!1},m:{name:`m`,value:1e-6,scientific:!0},u:{name:`u`,value:1e-12,scientific:!0},n:{name:`n`,value:1e-18,scientific:!0},p:{name:`p`,value:1e-24,scientific:!0},f:{name:`f`,value:1e-30,scientific:!0},a:{name:`a`,value:1e-36,scientific:!0},z:{name:`z`,value:1e-42,scientific:!0},y:{name:`y`,value:1e-48,scientific:!0},r:{name:`r`,value:1e-54,scientific:!0},q:{name:`q`,value:1e-60,scientific:!0}},CUBIC:{"":{name:``,value:1,scientific:!0},da:{name:`da`,value:1e3,scientific:!1},h:{name:`h`,value:1e6,scientific:!1},k:{name:`k`,value:1e9,scientific:!0},M:{name:`M`,value:0xde0b6b3a7640000,scientific:!0},G:{name:`G`,value:1e27,scientific:!0},T:{name:`T`,value:1e36,scientific:!0},P:{name:`P`,value:1e45,scientific:!0},E:{name:`E`,value:1e54,scientific:!0},Z:{name:`Z`,value:1e63,scientific:!0},Y:{name:`Y`,value:1e72,scientific:!0},R:{name:`R`,value:1e81,scientific:!0},Q:{name:`Q`,value:1e90,scientific:!0},d:{name:`d`,value:.001,scientific:!1},c:{name:`c`,value:1e-6,scientific:!1},m:{name:`m`,value:1e-9,scientific:!0},u:{name:`u`,value:1e-18,scientific:!0},n:{name:`n`,value:1e-27,scientific:!0},p:{name:`p`,value:1e-36,scientific:!0},f:{name:`f`,value:1e-45,scientific:!0},a:{name:`a`,value:1e-54,scientific:!0},z:{name:`z`,value:1e-63,scientific:!0},y:{name:`y`,value:1e-72,scientific:!0},r:{name:`r`,value:1e-81,scientific:!0},q:{name:`q`,value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:``,value:1,scientific:!0},k:{name:`k`,value:1e3,scientific:!0},M:{name:`M`,value:1e6,scientific:!0},G:{name:`G`,value:1e9,scientific:!0},T:{name:`T`,value:0xe8d4a51000,scientific:!0},P:{name:`P`,value:0x38d7ea4c68000,scientific:!0},E:{name:`E`,value:0xde0b6b3a7640000,scientific:!0},Z:{name:`Z`,value:1e21,scientific:!0},Y:{name:`Y`,value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:``,value:1,scientific:!0},Ki:{name:`Ki`,value:1024,scientific:!0},Mi:{name:`Mi`,value:1024**2,scientific:!0},Gi:{name:`Gi`,value:1024**3,scientific:!0},Ti:{name:`Ti`,value:1024**4,scientific:!0},Pi:{name:`Pi`,value:1024**5,scientific:!0},Ei:{name:`Ei`,value:1024**6,scientific:!0},Zi:{name:`Zi`,value:1024**7,scientific:!0},Yi:{name:`Yi`,value:1024**8,scientific:!0}},BINARY_LONG_SI:{"":{name:``,value:1,scientific:!0},kilo:{name:`kilo`,value:1e3,scientific:!0},mega:{name:`mega`,value:1e6,scientific:!0},giga:{name:`giga`,value:1e9,scientific:!0},tera:{name:`tera`,value:0xe8d4a51000,scientific:!0},peta:{name:`peta`,value:0x38d7ea4c68000,scientific:!0},exa:{name:`exa`,value:0xde0b6b3a7640000,scientific:!0},zetta:{name:`zetta`,value:1e21,scientific:!0},yotta:{name:`yotta`,value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:``,value:1,scientific:!0},kibi:{name:`kibi`,value:1024,scientific:!0},mebi:{name:`mebi`,value:1024**2,scientific:!0},gibi:{name:`gibi`,value:1024**3,scientific:!0},tebi:{name:`tebi`,value:1024**4,scientific:!0},pebi:{name:`pebi`,value:1024**5,scientific:!0},exi:{name:`exi`,value:1024**6,scientific:!0},zebi:{name:`zebi`,value:1024**7,scientific:!0},yobi:{name:`yobi`,value:1024**8,scientific:!0}},BTU:{"":{name:``,value:1,scientific:!0},MM:{name:`MM`,value:1e6,scientific:!0}}};I.SHORTLONG=u({},I.SHORT,I.LONG),I.BINARY_SHORT=u({},I.BINARY_SHORT_SI,I.BINARY_SHORT_IEC),I.BINARY_LONG=u({},I.BINARY_LONG_SI,I.BINARY_LONG_IEC);var oe=[`MASS`,`LENGTH`,`TIME`,`CURRENT`,`TEMPERATURE`,`LUMINOUS_INTENSITY`,`AMOUNT_OF_SUBSTANCE`,`ANGLE`,`BIT`],L={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var se in L)z(L,se)&&(L[se].key=se);var ce={name:``,base:{},value:1,offset:0,dimensions:oe.map(e=>0)},R={meter:{name:`meter`,base:L.LENGTH,prefixes:I.LONG,value:1,offset:0},inch:{name:`inch`,base:L.LENGTH,prefixes:I.NONE,value:.0254,offset:0},foot:{name:`foot`,base:L.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yard:{name:`yard`,base:L.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mile:{name:`mile`,base:L.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},link:{name:`link`,base:L.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rod:{name:`rod`,base:L.LENGTH,prefixes:I.NONE,value:5.0292,offset:0},chain:{name:`chain`,base:L.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},angstrom:{name:`angstrom`,base:L.LENGTH,prefixes:I.NONE,value:1e-10,offset:0},m:{name:`m`,base:L.LENGTH,prefixes:I.SHORT,value:1,offset:0},in:{name:`in`,base:L.LENGTH,prefixes:I.NONE,value:.0254,offset:0},ft:{name:`ft`,base:L.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yd:{name:`yd`,base:L.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mi:{name:`mi`,base:L.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},li:{name:`li`,base:L.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rd:{name:`rd`,base:L.LENGTH,prefixes:I.NONE,value:5.02921,offset:0},ch:{name:`ch`,base:L.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},mil:{name:`mil`,base:L.LENGTH,prefixes:I.NONE,value:254e-7,offset:0},m2:{name:`m2`,base:L.SURFACE,prefixes:I.SQUARED,value:1,offset:0},sqin:{name:`sqin`,base:L.SURFACE,prefixes:I.NONE,value:64516e-8,offset:0},sqft:{name:`sqft`,base:L.SURFACE,prefixes:I.NONE,value:.09290304,offset:0},sqyd:{name:`sqyd`,base:L.SURFACE,prefixes:I.NONE,value:.83612736,offset:0},sqmi:{name:`sqmi`,base:L.SURFACE,prefixes:I.NONE,value:2589988.110336,offset:0},sqrd:{name:`sqrd`,base:L.SURFACE,prefixes:I.NONE,value:25.29295,offset:0},sqch:{name:`sqch`,base:L.SURFACE,prefixes:I.NONE,value:404.6873,offset:0},sqmil:{name:`sqmil`,base:L.SURFACE,prefixes:I.NONE,value:64516e-14,offset:0},acre:{name:`acre`,base:L.SURFACE,prefixes:I.NONE,value:4046.86,offset:0},hectare:{name:`hectare`,base:L.SURFACE,prefixes:I.NONE,value:1e4,offset:0},m3:{name:`m3`,base:L.VOLUME,prefixes:I.CUBIC,value:1,offset:0},L:{name:`L`,base:L.VOLUME,prefixes:I.SHORT,value:.001,offset:0},l:{name:`l`,base:L.VOLUME,prefixes:I.SHORT,value:.001,offset:0},litre:{name:`litre`,base:L.VOLUME,prefixes:I.LONG,value:.001,offset:0},cuin:{name:`cuin`,base:L.VOLUME,prefixes:I.NONE,value:16387064e-12,offset:0},cuft:{name:`cuft`,base:L.VOLUME,prefixes:I.NONE,value:.028316846592,offset:0},cuyd:{name:`cuyd`,base:L.VOLUME,prefixes:I.NONE,value:.764554857984,offset:0},teaspoon:{name:`teaspoon`,base:L.VOLUME,prefixes:I.NONE,value:5e-6,offset:0},tablespoon:{name:`tablespoon`,base:L.VOLUME,prefixes:I.NONE,value:15e-6,offset:0},drop:{name:`drop`,base:L.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},gtt:{name:`gtt`,base:L.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},minim:{name:`minim`,base:L.VOLUME,prefixes:I.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:`fluiddram`,base:L.VOLUME,prefixes:I.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:`fluidounce`,base:L.VOLUME,prefixes:I.NONE,value:295735295625e-16,offset:0},gill:{name:`gill`,base:L.VOLUME,prefixes:I.NONE,value:.00011829411825,offset:0},cc:{name:`cc`,base:L.VOLUME,prefixes:I.NONE,value:1e-6,offset:0},cup:{name:`cup`,base:L.VOLUME,prefixes:I.NONE,value:.0002365882365,offset:0},pint:{name:`pint`,base:L.VOLUME,prefixes:I.NONE,value:.000473176473,offset:0},quart:{name:`quart`,base:L.VOLUME,prefixes:I.NONE,value:.000946352946,offset:0},gallon:{name:`gallon`,base:L.VOLUME,prefixes:I.NONE,value:.003785411784,offset:0},beerbarrel:{name:`beerbarrel`,base:L.VOLUME,prefixes:I.NONE,value:.117347765304,offset:0},oilbarrel:{name:`oilbarrel`,base:L.VOLUME,prefixes:I.NONE,value:.158987294928,offset:0},hogshead:{name:`hogshead`,base:L.VOLUME,prefixes:I.NONE,value:.238480942392,offset:0},g:{name:`g`,base:L.MASS,prefixes:I.SHORT,value:.001,offset:0},gram:{name:`gram`,base:L.MASS,prefixes:I.LONG,value:.001,offset:0},ton:{name:`ton`,base:L.MASS,prefixes:I.SHORT,value:907.18474,offset:0},t:{name:`t`,base:L.MASS,prefixes:I.SHORT,value:1e3,offset:0},tonne:{name:`tonne`,base:L.MASS,prefixes:I.LONG,value:1e3,offset:0},grain:{name:`grain`,base:L.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dram:{name:`dram`,base:L.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},ounce:{name:`ounce`,base:L.MASS,prefixes:I.NONE,value:.028349523125,offset:0},poundmass:{name:`poundmass`,base:L.MASS,prefixes:I.NONE,value:.45359237,offset:0},hundredweight:{name:`hundredweight`,base:L.MASS,prefixes:I.NONE,value:45.359237,offset:0},stick:{name:`stick`,base:L.MASS,prefixes:I.NONE,value:.115,offset:0},stone:{name:`stone`,base:L.MASS,prefixes:I.NONE,value:6.35029318,offset:0},gr:{name:`gr`,base:L.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dr:{name:`dr`,base:L.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},oz:{name:`oz`,base:L.MASS,prefixes:I.NONE,value:.028349523125,offset:0},lbm:{name:`lbm`,base:L.MASS,prefixes:I.NONE,value:.45359237,offset:0},cwt:{name:`cwt`,base:L.MASS,prefixes:I.NONE,value:45.359237,offset:0},s:{name:`s`,base:L.TIME,prefixes:I.SHORT,value:1,offset:0},min:{name:`min`,base:L.TIME,prefixes:I.NONE,value:60,offset:0},h:{name:`h`,base:L.TIME,prefixes:I.NONE,value:3600,offset:0},second:{name:`second`,base:L.TIME,prefixes:I.LONG,value:1,offset:0},sec:{name:`sec`,base:L.TIME,prefixes:I.LONG,value:1,offset:0},minute:{name:`minute`,base:L.TIME,prefixes:I.NONE,value:60,offset:0},hour:{name:`hour`,base:L.TIME,prefixes:I.NONE,value:3600,offset:0},day:{name:`day`,base:L.TIME,prefixes:I.NONE,value:86400,offset:0},week:{name:`week`,base:L.TIME,prefixes:I.NONE,value:604800,offset:0},month:{name:`month`,base:L.TIME,prefixes:I.NONE,value:2629800,offset:0},year:{name:`year`,base:L.TIME,prefixes:I.NONE,value:31557600,offset:0},decade:{name:`decade`,base:L.TIME,prefixes:I.NONE,value:315576e3,offset:0},century:{name:`century`,base:L.TIME,prefixes:I.NONE,value:315576e4,offset:0},millennium:{name:`millennium`,base:L.TIME,prefixes:I.NONE,value:315576e5,offset:0},hertz:{name:`Hertz`,base:L.FREQUENCY,prefixes:I.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:`Hz`,base:L.FREQUENCY,prefixes:I.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:`rad`,base:L.ANGLE,prefixes:I.SHORT,value:1,offset:0},radian:{name:`radian`,base:L.ANGLE,prefixes:I.LONG,value:1,offset:0},deg:{name:`deg`,base:L.ANGLE,prefixes:I.SHORT,value:null,offset:0},degree:{name:`degree`,base:L.ANGLE,prefixes:I.LONG,value:null,offset:0},grad:{name:`grad`,base:L.ANGLE,prefixes:I.SHORT,value:null,offset:0},gradian:{name:`gradian`,base:L.ANGLE,prefixes:I.LONG,value:null,offset:0},cycle:{name:`cycle`,base:L.ANGLE,prefixes:I.NONE,value:null,offset:0},arcsec:{name:`arcsec`,base:L.ANGLE,prefixes:I.NONE,value:null,offset:0},arcmin:{name:`arcmin`,base:L.ANGLE,prefixes:I.NONE,value:null,offset:0},A:{name:`A`,base:L.CURRENT,prefixes:I.SHORT,value:1,offset:0},ampere:{name:`ampere`,base:L.CURRENT,prefixes:I.LONG,value:1,offset:0},K:{name:`K`,base:L.TEMPERATURE,prefixes:I.SHORT,value:1,offset:0},degC:{name:`degC`,base:L.TEMPERATURE,prefixes:I.SHORT,value:1,offset:273.15},degF:{name:`degF`,base:L.TEMPERATURE,prefixes:I.SHORT,value:new v(5,9),offset:459.67},degR:{name:`degR`,base:L.TEMPERATURE,prefixes:I.SHORT,value:new v(5,9),offset:0},kelvin:{name:`kelvin`,base:L.TEMPERATURE,prefixes:I.LONG,value:1,offset:0},celsius:{name:`celsius`,base:L.TEMPERATURE,prefixes:I.LONG,value:1,offset:273.15},fahrenheit:{name:`fahrenheit`,base:L.TEMPERATURE,prefixes:I.LONG,value:new v(5,9),offset:459.67},rankine:{name:`rankine`,base:L.TEMPERATURE,prefixes:I.LONG,value:new v(5,9),offset:0},mol:{name:`mol`,base:L.AMOUNT_OF_SUBSTANCE,prefixes:I.SHORT,value:1,offset:0},mole:{name:`mole`,base:L.AMOUNT_OF_SUBSTANCE,prefixes:I.LONG,value:1,offset:0},cd:{name:`cd`,base:L.LUMINOUS_INTENSITY,prefixes:I.SHORT,value:1,offset:0},candela:{name:`candela`,base:L.LUMINOUS_INTENSITY,prefixes:I.LONG,value:1,offset:0},N:{name:`N`,base:L.FORCE,prefixes:I.SHORT,value:1,offset:0},newton:{name:`newton`,base:L.FORCE,prefixes:I.LONG,value:1,offset:0},dyn:{name:`dyn`,base:L.FORCE,prefixes:I.SHORT,value:1e-5,offset:0},dyne:{name:`dyne`,base:L.FORCE,prefixes:I.LONG,value:1e-5,offset:0},lbf:{name:`lbf`,base:L.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},poundforce:{name:`poundforce`,base:L.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},kip:{name:`kip`,base:L.FORCE,prefixes:I.LONG,value:4448.2216,offset:0},kilogramforce:{name:`kilogramforce`,base:L.FORCE,prefixes:I.NONE,value:9.80665,offset:0},J:{name:`J`,base:L.ENERGY,prefixes:I.SHORT,value:1,offset:0},joule:{name:`joule`,base:L.ENERGY,prefixes:I.LONG,value:1,offset:0},erg:{name:`erg`,base:L.ENERGY,prefixes:I.SHORTLONG,value:1e-7,offset:0},Wh:{name:`Wh`,base:L.ENERGY,prefixes:I.SHORT,value:3600,offset:0},BTU:{name:`BTU`,base:L.ENERGY,prefixes:I.BTU,value:1055.05585262,offset:0},eV:{name:`eV`,base:L.ENERGY,prefixes:I.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:`electronvolt`,base:L.ENERGY,prefixes:I.LONG,value:1602176565e-28,offset:0},W:{name:`W`,base:L.POWER,prefixes:I.SHORT,value:1,offset:0},watt:{name:`watt`,base:L.POWER,prefixes:I.LONG,value:1,offset:0},hp:{name:`hp`,base:L.POWER,prefixes:I.NONE,value:745.6998715386,offset:0},VAR:{name:`VAR`,base:L.POWER,prefixes:I.SHORT,value:g.I,offset:0},VA:{name:`VA`,base:L.POWER,prefixes:I.SHORT,value:1,offset:0},Pa:{name:`Pa`,base:L.PRESSURE,prefixes:I.SHORT,value:1,offset:0},psi:{name:`psi`,base:L.PRESSURE,prefixes:I.NONE,value:6894.75729276459,offset:0},atm:{name:`atm`,base:L.PRESSURE,prefixes:I.NONE,value:101325,offset:0},bar:{name:`bar`,base:L.PRESSURE,prefixes:I.SHORTLONG,value:1e5,offset:0},torr:{name:`torr`,base:L.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmHg:{name:`mmHg`,base:L.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmH2O:{name:`mmH2O`,base:L.PRESSURE,prefixes:I.NONE,value:9.80665,offset:0},cmH2O:{name:`cmH2O`,base:L.PRESSURE,prefixes:I.NONE,value:98.0665,offset:0},coulomb:{name:`coulomb`,base:L.ELECTRIC_CHARGE,prefixes:I.LONG,value:1,offset:0},C:{name:`C`,base:L.ELECTRIC_CHARGE,prefixes:I.SHORT,value:1,offset:0},Ah:{name:`Ah`,base:L.ELECTRIC_CHARGE,prefixes:I.SHORT,value:3600,offset:0},farad:{name:`farad`,base:L.ELECTRIC_CAPACITANCE,prefixes:I.LONG,value:1,offset:0},F:{name:`F`,base:L.ELECTRIC_CAPACITANCE,prefixes:I.SHORT,value:1,offset:0},volt:{name:`volt`,base:L.ELECTRIC_POTENTIAL,prefixes:I.LONG,value:1,offset:0},V:{name:`V`,base:L.ELECTRIC_POTENTIAL,prefixes:I.SHORT,value:1,offset:0},ohm:{name:`ohm`,base:L.ELECTRIC_RESISTANCE,prefixes:I.SHORTLONG,value:1,offset:0},henry:{name:`henry`,base:L.ELECTRIC_INDUCTANCE,prefixes:I.LONG,value:1,offset:0},H:{name:`H`,base:L.ELECTRIC_INDUCTANCE,prefixes:I.SHORT,value:1,offset:0},siemens:{name:`siemens`,base:L.ELECTRIC_CONDUCTANCE,prefixes:I.LONG,value:1,offset:0},S:{name:`S`,base:L.ELECTRIC_CONDUCTANCE,prefixes:I.SHORT,value:1,offset:0},weber:{name:`weber`,base:L.MAGNETIC_FLUX,prefixes:I.LONG,value:1,offset:0},Wb:{name:`Wb`,base:L.MAGNETIC_FLUX,prefixes:I.SHORT,value:1,offset:0},tesla:{name:`tesla`,base:L.MAGNETIC_FLUX_DENSITY,prefixes:I.LONG,value:1,offset:0},T:{name:`T`,base:L.MAGNETIC_FLUX_DENSITY,prefixes:I.SHORT,value:1,offset:0},b:{name:`b`,base:L.BIT,prefixes:I.BINARY_SHORT,value:1,offset:0},bits:{name:`bits`,base:L.BIT,prefixes:I.BINARY_LONG,value:1,offset:0},B:{name:`B`,base:L.BIT,prefixes:I.BINARY_SHORT,value:8,offset:0},bytes:{name:`bytes`,base:L.BIT,prefixes:I.BINARY_LONG,value:8,offset:0}},le={meters:`meter`,inches:`inch`,feet:`foot`,yards:`yard`,miles:`mile`,links:`link`,rods:`rod`,chains:`chain`,angstroms:`angstrom`,lt:`l`,litres:`litre`,liter:`litre`,liters:`litre`,teaspoons:`teaspoon`,tablespoons:`tablespoon`,minims:`minim`,fldr:`fluiddram`,fluiddrams:`fluiddram`,floz:`fluidounce`,fluidounces:`fluidounce`,gi:`gill`,gills:`gill`,cp:`cup`,cups:`cup`,pt:`pint`,pints:`pint`,qt:`quart`,quarts:`quart`,gal:`gallon`,gallons:`gallon`,bbl:`beerbarrel`,beerbarrels:`beerbarrel`,obl:`oilbarrel`,oilbarrels:`oilbarrel`,hogsheads:`hogshead`,gtts:`gtt`,grams:`gram`,tons:`ton`,tonnes:`tonne`,grains:`grain`,drams:`dram`,ounces:`ounce`,poundmasses:`poundmass`,hundredweights:`hundredweight`,sticks:`stick`,lb:`lbm`,lbs:`lbm`,kips:`kip`,kgf:`kilogramforce`,acres:`acre`,hectares:`hectare`,sqfeet:`sqft`,sqyard:`sqyd`,sqmile:`sqmi`,sqmiles:`sqmi`,mmhg:`mmHg`,mmh2o:`mmH2O`,cmh2o:`cmH2O`,seconds:`second`,secs:`second`,minutes:`minute`,mins:`minute`,hours:`hour`,hr:`hour`,hrs:`hour`,days:`day`,weeks:`week`,months:`month`,years:`year`,decades:`decade`,centuries:`century`,millennia:`millennium`,hertz:`hertz`,radians:`radian`,degrees:`degree`,gradians:`gradian`,cycles:`cycle`,arcsecond:`arcsec`,arcseconds:`arcsec`,arcminute:`arcmin`,arcminutes:`arcmin`,BTUs:`BTU`,watts:`watt`,joules:`joule`,amperes:`ampere`,amps:`ampere`,amp:`ampere`,coulombs:`coulomb`,volts:`volt`,ohms:`ohm`,farads:`farad`,webers:`weber`,teslas:`tesla`,electronvolts:`electronvolt`,moles:`mole`,bit:`bits`,byte:`bytes`};function ue(e){if(e.number===`BigNumber`){var t=up(_);R.rad.value=new _(1),R.deg.value=t.div(180),R.grad.value=t.div(200),R.cycle.value=t.times(2),R.arcsec.value=t.div(648e3),R.arcmin.value=t.div(10800)}else R.rad.value=1,R.deg.value=Math.PI/180,R.grad.value=Math.PI/200,R.cycle.value=Math.PI*2,R.arcsec.value=Math.PI/648e3,R.arcmin.value=Math.PI/10800;R.radian.value=R.rad.value,R.degree.value=R.deg.value,R.gradian.value=R.grad.value}ue(n),t&&t(`config`,function(e,t){e.number!==t.number&&ue(e)});var de={si:{NONE:{unit:ce,prefix:I.NONE[``]},LENGTH:{unit:R.m,prefix:I.SHORT[``]},MASS:{unit:R.g,prefix:I.SHORT.k},TIME:{unit:R.s,prefix:I.SHORT[``]},CURRENT:{unit:R.A,prefix:I.SHORT[``]},TEMPERATURE:{unit:R.K,prefix:I.SHORT[``]},LUMINOUS_INTENSITY:{unit:R.cd,prefix:I.SHORT[``]},AMOUNT_OF_SUBSTANCE:{unit:R.mol,prefix:I.SHORT[``]},ANGLE:{unit:R.rad,prefix:I.SHORT[``]},BIT:{unit:R.bits,prefix:I.SHORT[``]},FORCE:{unit:R.N,prefix:I.SHORT[``]},ENERGY:{unit:R.J,prefix:I.SHORT[``]},POWER:{unit:R.W,prefix:I.SHORT[``]},PRESSURE:{unit:R.Pa,prefix:I.SHORT[``]},ELECTRIC_CHARGE:{unit:R.C,prefix:I.SHORT[``]},ELECTRIC_CAPACITANCE:{unit:R.F,prefix:I.SHORT[``]},ELECTRIC_POTENTIAL:{unit:R.V,prefix:I.SHORT[``]},ELECTRIC_RESISTANCE:{unit:R.ohm,prefix:I.SHORT[``]},ELECTRIC_INDUCTANCE:{unit:R.H,prefix:I.SHORT[``]},ELECTRIC_CONDUCTANCE:{unit:R.S,prefix:I.SHORT[``]},MAGNETIC_FLUX:{unit:R.Wb,prefix:I.SHORT[``]},MAGNETIC_FLUX_DENSITY:{unit:R.T,prefix:I.SHORT[``]},FREQUENCY:{unit:R.Hz,prefix:I.SHORT[``]}}};de.cgs=JSON.parse(JSON.stringify(de.si)),de.cgs.LENGTH={unit:R.m,prefix:I.SHORT.c},de.cgs.MASS={unit:R.g,prefix:I.SHORT[``]},de.cgs.FORCE={unit:R.dyn,prefix:I.SHORT[``]},de.cgs.ENERGY={unit:R.erg,prefix:I.NONE[``]},de.us=JSON.parse(JSON.stringify(de.si)),de.us.LENGTH={unit:R.ft,prefix:I.NONE[``]},de.us.MASS={unit:R.lbm,prefix:I.NONE[``]},de.us.TEMPERATURE={unit:R.degF,prefix:I.NONE[``]},de.us.FORCE={unit:R.lbf,prefix:I.NONE[``]},de.us.ENERGY={unit:R.BTU,prefix:I.BTU[``]},de.us.POWER={unit:R.hp,prefix:I.NONE[``]},de.us.PRESSURE={unit:R.psi,prefix:I.NONE[``]},de.auto=JSON.parse(JSON.stringify(de.si));var fe=de.auto;for(var pe in S.setUnitSystem=function(e){if(z(de,e))fe=de[e];else throw Error(`Unit system `+e+` does not exist. Choices are: `+Object.keys(de).join(`, `))},S.getUnitSystem=function(){for(var e in de)if(z(de,e)&&de[e]===fe)return e},S.typeConverters={BigNumber:function(e){return e!=null&&e.isFraction?new _(String(e.n)).div(String(e.d)).times(String(e.s)):new _(e+``)},Fraction:function(e){return new v(e)},Complex:function(e){return e},number:function(e){return e!=null&&e.isFraction?h(e):e}},S.prototype._numberConverter=function(){var e=S.typeConverters[this.valueType()];if(e)return e;throw TypeError(`Unsupported Unit value type "`+this.valueType()+`"`)},S._getNumberConverter=function(e){if(!S.typeConverters[e])throw TypeError(`Unsupported type "`+e+`"`);return S.typeConverters[e]},R)if(z(R,pe)){var me=R[pe];me.dimensions=me.base.dimensions}for(var he in le)if(z(le,he)){var ge=R[le[he]],_e={};for(var ve in ge)z(ge,ve)&&(_e[ve]=ge[ve]);_e.name=he,R[he]=_e}S.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)};function ye(e){for(var t=0;t<e.length;t++){if(T=e.charAt(t),t===0&&!S.isValidAlpha(T))throw Error(`Invalid unit name (must begin with alpha character): "`+e+`"`);if(t>0&&!(S.isValidAlpha(T)||O(T)))throw Error(`Invalid unit name (only alphanumeric characters are allowed): "`+e+`"`)}}return S.createUnit=function(e,t){if(typeof e!=`object`)throw TypeError(`createUnit expects first parameter to be of type 'Object'`);if(t&&t.override){for(var n in e)if(z(e,n)&&S.deleteUnit(n),e[n].aliases)for(var r=0;r<e[n].aliases.length;r++)S.deleteUnit(e[n].aliases[r])}var i;for(var a in e)z(e,a)&&(i=S.createUnitSingle(a,e[a]));return i},S.createUnitSingle=function(e,t){if(t??={},typeof e!=`string`)throw TypeError(`createUnitSingle expects first parameter to be of type 'string'`);if(z(R,e))throw Error(`Cannot create unit "`+e+`": a unit with that name already exists`);ye(e);var n=null,r=[],i=0,a,o,s;if(t&&t.type===`Unit`)n=t.clone();else if(typeof t==`string`)t!==``&&(a=t);else if(typeof t==`object`)a=t.definition,o=t.prefixes,i=t.offset,s=t.baseName,t.aliases&&(r=t.aliases.valueOf());else throw TypeError(`Cannot create unit "`+e+`" from "`+t.toString()+`": expecting "string" or "Unit" or "Object"`);if(r){for(var c=0;c<r.length;c++)if(z(R,r[c]))throw Error(`Cannot create alias "`+r[c]+`": a unit with that name already exists`)}if(a&&typeof a==`string`&&!n)try{n=S.parse(a,{allowNoUnits:!0})}catch(t){throw t.message=`Could not create unit "`+e+`" from "`+a+`": `+t.message,t}else a&&a.type===`Unit`&&(n=a.clone());r||=[],i||=0,o=o&&o.toUpperCase&&I[o.toUpperCase()]||I.NONE;var l={};if(n){l={name:e,value:n.value,dimensions:n.dimensions.slice(0),prefixes:o,offset:i};var u=!1;for(var d in L)if(z(L,d)){for(var f=!0,p=0;p<oe.length;p++)if(Math.abs((l.dimensions[p]||0)-(L[d].dimensions[p]||0))>1e-12){f=!1;break}if(f){u=!0,l.base=L[d];break}}if(!u){s||=e+`_STUFF`;var m={dimensions:n.dimensions.slice(0)};m.key=s,L[s]=m,fe[s]={unit:l,prefix:I.NONE[``]},l.base=L[s]}}else{if(s||=e+`_STUFF`,oe.indexOf(s)>=0)throw Error(`Cannot create new base unit "`+e+`": a base unit with that name already exists (and cannot be overridden)`);for(var h in oe.push(s),L)z(L,h)&&(L[h].dimensions[oe.length-1]=0);for(var g={dimensions:[]},_=0;_<oe.length;_++)g.dimensions[_]=0;g.dimensions[oe.length-1]=1,g.key=s,L[s]=g,l={name:e,value:1,dimensions:L[s].dimensions.slice(0),prefixes:o,offset:i,base:L[s]},fe[s]={unit:l,prefix:I.NONE[``]}}S.UNITS[e]=l;for(var v=0;v<r.length;v++){var y=r[v],b={};for(var x in l)z(l,x)&&(b[x]=l[x]);b.name=y,S.UNITS[y]=b}return delete ee.cache,new S(null,e)},S.deleteUnit=function(e){delete S.UNITS[e],delete ee.cache},S.PREFIXES=I,S.BASE_DIMENSIONS=oe,S.BASE_UNITS=L,S.UNIT_SYSTEMS=de,S.UNITS=R,S},{isClass:!0}),gp=`unit`,_p=V(gp,[`typed`,`Unit`],e=>{var{typed:t,Unit:n}=e;return t(gp,{Unit:function(e){return e.clone()},string:function(e){return n.isValuelessUnit(e)?new n(null,e):n.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new n(e,t)},"number | BigNumber | Fraction":function(e){return new n(e)},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),vp=`sparse`,yp=V(vp,[`typed`,`SparseMatrix`],e=>{var{typed:t,SparseMatrix:n}=e;return t(vp,{"":function(){return new n([])},string:function(e){return new n([],e)},"Array | Matrix":function(e){return new n(e)},"Array | Matrix, string":function(e,t){return new n(e,t)}})}),bp=`createUnit`,xp=V(bp,[`typed`,`Unit`],e=>{var{typed:t,Unit:n}=e;return t(bp,{"Object, Object":function(e,t){return n.createUnit(e,t)},Object:function(e){return n.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var i={};return i[e]=t,n.createUnit(i,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,n.createUnit(r,{})},string:function(e){var t={};return t[e]={},n.createUnit(t,{})}})}),Sp=`acos`,Cp=V(Sp,[`typed`,`config`,`Complex`],e=>{var{typed:t,config:n,Complex:r}=e;return t(Sp,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.acos(e):new r(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})}),wp=`acosh`,Tp=V(wp,[`typed`,`config`,`Complex`],e=>{var{typed:t,config:n,Complex:r}=e;return t(wp,{number:function(e){return e>=1||n.predictable?fo(e):e<=-1?new r(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})}),Ep=`acot`,Dp=V(Ep,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e;return t(Ep,{number:po,Complex:function(e){return e.acot()},BigNumber:function(e){return new n(1).div(e).atan()}})}),Op=`acoth`,kp=V(Op,[`typed`,`config`,`Complex`,`BigNumber`],e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Op,{number:function(e){return e>=1||e<=-1||n.predictable?mo(e):new r(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})}),Ap=`acsc`,jp=V(Ap,[`typed`,`config`,`Complex`,`BigNumber`],e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Ap,{number:function(e){return e<=-1||e>=1||n.predictable?ho(e):new r(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})}),Mp=`acsch`,Np=V(Mp,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e;return t(Mp,{number:go,Complex:function(e){return e.acsch()},BigNumber:function(e){return new n(1).div(e).asinh()}})}),Pp=`asec`,Fp=V(Pp,[`typed`,`config`,`Complex`,`BigNumber`],e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Pp,{number:function(e){return e<=-1||e>=1||n.predictable?_o(e):new r(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})}),Ip=`asech`,Lp=V(Ip,[`typed`,`config`,`Complex`,`BigNumber`],e=>{var{typed:t,config:n,Complex:r,BigNumber:i}=e;return t(Ip,{number:function(e){if(e<=1&&e>=-1||n.predictable){var t=1/e;if(t>0||n.predictable)return vo(e);var i=Math.sqrt(t*t-1);return new r(Math.log(i-t),Math.PI)}return new r(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})}),Rp=`asin`,zp=V(Rp,[`typed`,`config`,`Complex`],e=>{var{typed:t,config:n,Complex:r}=e;return t(Rp,{number:function(e){return e>=-1&&e<=1||n.predictable?Math.asin(e):new r(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})}),Bp=V(`asinh`,[`typed`],e=>{var{typed:t}=e;return t(`asinh`,{number:yo,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})}),Vp=V(`atan`,[`typed`],e=>{var{typed:t}=e;return t(`atan`,{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})}),Hp=`atan2`,Up=V(Hp,[`typed`,`matrix`,`equalScalar`,`BigNumber`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,BigNumber:i,DenseMatrix:a,concat:o}=e,s=uc({typed:t,equalScalar:r}),c=dc({typed:t}),l=tl({typed:t,equalScalar:r}),u=Vs({typed:t,equalScalar:r}),d=Hs({typed:t,DenseMatrix:a}),f=gc({typed:t,matrix:n,concat:o});return t(Hp,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,t)=>i.atan2(e,t)},f({scalar:`number | BigNumber`,SS:l,DS:c,SD:s,Ss:u,sS:d}))}),Wp=`atanh`,Gp=V(Wp,[`typed`,`config`,`Complex`],e=>{var{typed:t,config:n,Complex:r}=e;return t(Wp,{number:function(e){return e<=1&&e>=-1||n.predictable?bo(e):new r(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})}),Kp=V(`trigUnit`,[`typed`],e=>{var{typed:t}=e;return{Unit:t.referToSelf(e=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw TypeError(`Unit in function cot is no angle`);return t.find(e,n.valueType())(n.value)})}}),qp=`cos`,Jp=V(qp,[`typed`],e=>{var{typed:t}=e,n=Kp({typed:t});return t(qp,{number:Math.cos,"Complex | BigNumber":e=>e.cos()},n)}),Yp=`cosh`,Xp=V(Yp,[`typed`],e=>{var{typed:t}=e;return t(Yp,{number:bt,"Complex | BigNumber":e=>e.cosh()})}),Zp=`cot`,Qp=V(Zp,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e,r=Kp({typed:t});return t(Zp,{number:xo,Complex:e=>e.cot(),BigNumber:e=>new n(1).div(e.tan())},r)}),$p=`coth`,em=V($p,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e;return t($p,{number:So,Complex:e=>e.coth(),BigNumber:e=>new n(1).div(e.tanh())})}),tm=`csc`,nm=V(tm,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e,r=Kp({typed:t});return t(tm,{number:Co,Complex:e=>e.csc(),BigNumber:e=>new n(1).div(e.sin())},r)}),rm=`csch`,im=V(rm,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e;return t(rm,{number:wo,Complex:e=>e.csch(),BigNumber:e=>new n(1).div(e.sinh())})}),am=`sec`,om=V(am,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e,r=Kp({typed:t});return t(am,{number:To,Complex:e=>e.sec(),BigNumber:e=>new n(1).div(e.cos())},r)}),sm=`sech`,cm=V(sm,[`typed`,`BigNumber`],e=>{var{typed:t,BigNumber:n}=e;return t(sm,{number:Eo,Complex:e=>e.sech(),BigNumber:e=>new n(1).div(e.cosh())})}),lm=`sin`,um=V(lm,[`typed`],e=>{var{typed:t}=e,n=Kp({typed:t});return t(lm,{number:Math.sin,"Complex | BigNumber":e=>e.sin()},n)}),dm=`sinh`,fm=V(dm,[`typed`],e=>{var{typed:t}=e;return t(dm,{number:Do,"Complex | BigNumber":e=>e.sinh()})}),pm=`tan`,mm=V(pm,[`typed`],e=>{var{typed:t}=e,n=Kp({typed:t});return t(pm,{number:Math.tan,"Complex | BigNumber":e=>e.tan()},n)}),hm=V(`tanh`,[`typed`],e=>{var{typed:t}=e;return t(`tanh`,{number:St,"Complex | BigNumber":e=>e.tanh()})}),gm=`setCartesian`,_m=V(gm,[`typed`,`size`,`subset`,`compareNatural`,`Index`,`DenseMatrix`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(gm,{"Array | Matrix, Array | Matrix":function(e,t){var s=[];if(r(n(e),new a(0))!==0&&r(n(t),new a(0))!==0){var c=Mi(Array.isArray(e)?e:e.toArray()).sort(i),l=Mi(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(var u=0;u<c.length;u++)for(var d=0;d<l.length;d++)s.push([c[u],l[d]])}return Array.isArray(e)&&Array.isArray(t)?s:new o(s)}})}),vm=`setDifference`,ym=V(vm,[`typed`,`size`,`subset`,`compareNatural`,`Index`,`DenseMatrix`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(vm,{"Array | Matrix, Array | Matrix":function(e,t){var s;if(r(n(e),new a(0))===0)s=[];else if(r(n(t),new a(0))===0)return Mi(e.toArray());else{var c=Ri(Mi(Array.isArray(e)?e:e.toArray()).sort(i)),l=Ri(Mi(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var u,d=0;d<c.length;d++){u=!1;for(var f=0;f<l.length;f++)if(i(c[d].value,l[f].value)===0&&c[d].identifier===l[f].identifier){u=!0;break}u||s.push(c[d])}}return Array.isArray(e)&&Array.isArray(t)?zi(s):new o(zi(s))}})}),bm=`setDistinct`,xm=V(bm,[`typed`,`size`,`subset`,`compareNatural`,`Index`,`DenseMatrix`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(bm,{"Array | Matrix":function(e){var t;if(r(n(e),new a(0))===0)t=[];else{var s=Mi(Array.isArray(e)?e:e.toArray()).sort(i);t=[],t.push(s[0]);for(var c=1;c<s.length;c++)i(s[c],s[c-1])!==0&&t.push(s[c])}return Array.isArray(e)?t:new o(t)}})}),Sm=`setIntersect`,Cm=V(Sm,[`typed`,`size`,`subset`,`compareNatural`,`Index`,`DenseMatrix`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(Sm,{"Array | Matrix, Array | Matrix":function(e,t){var s;if(r(n(e),new a(0))===0||r(n(t),new a(0))===0)s=[];else{var c=Ri(Mi(Array.isArray(e)?e:e.toArray()).sort(i)),l=Ri(Mi(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var u=0;u<c.length;u++)for(var d=0;d<l.length;d++)if(i(c[u].value,l[d].value)===0&&c[u].identifier===l[d].identifier){s.push(c[u]);break}}return Array.isArray(e)&&Array.isArray(t)?zi(s):new o(zi(s))}})}),wm=`setIsSubset`,Tm=V(wm,[`typed`,`size`,`subset`,`compareNatural`,`Index`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a}=e;return t(wm,{"Array | Matrix, Array | Matrix":function(e,t){if(r(n(e),new a(0))===0)return!0;if(r(n(t),new a(0))===0)return!1;for(var o=Ri(Mi(Array.isArray(e)?e:e.toArray()).sort(i)),s=Ri(Mi(Array.isArray(t)?t:t.toArray()).sort(i)),c,l=0;l<o.length;l++){c=!1;for(var u=0;u<s.length;u++)if(i(o[l].value,s[u].value)===0&&o[l].identifier===s[u].identifier){c=!0;break}if(c===!1)return!1}return!0}})}),Em=`setMultiplicity`,Dm=V(Em,[`typed`,`size`,`subset`,`compareNatural`,`Index`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a}=e;return t(Em,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(r(n(t),new a(0))===0)return 0;for(var o=Mi(Array.isArray(t)?t:t.toArray()),s=0,c=0;c<o.length;c++)i(o[c],e)===0&&s++;return s}})}),Om=`setPowerset`,km=V(Om,[`typed`,`size`,`subset`,`compareNatural`,`Index`],e=>{var{typed:t,size:n,subset:r,compareNatural:i,Index:a}=e;return t(Om,{"Array | Matrix":function(e){if(r(n(e),new a(0))===0)return[];for(var t=Mi(Array.isArray(e)?e:e.toArray()).sort(i),c=[],l=0;l.toString(2).length<=t.length;)c.push(o(t,l.toString(2).split(``).reverse())),l++;return s(c)}});function o(e,t){for(var n=[],r=0;r<t.length;r++)t[r]===`1`&&n.push(e[r]);return n}function s(e){for(var t=[],n=e.length-1;n>0;n--)for(var r=0;r<n;r++)e[r].length>e[r+1].length&&(t=e[r],e[r]=e[r+1],e[r+1]=t);return e}}),Am=`setSize`,jm=V(Am,[`typed`,`compareNatural`],e=>{var{typed:t,compareNatural:n}=e;return t(Am,{"Array | Matrix":function(e){return Array.isArray(e)?Mi(e).length:Mi(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(t===!1||e.length===0)return Array.isArray(e)?Mi(e).length:Mi(e.toArray()).length;for(var r=Mi(Array.isArray(e)?e:e.toArray()).sort(n),i=1,a=1;a<r.length;a++)n(r[a],r[a-1])!==0&&i++;return i}})}),Mm=`setSymDifference`,Nm=V(Mm,[`typed`,`size`,`concat`,`subset`,`setDifference`,`Index`],e=>{var{typed:t,size:n,concat:r,subset:i,setDifference:a,Index:o}=e;return t(Mm,{"Array | Matrix, Array | Matrix":function(e,t){if(i(n(e),new o(0))===0)return Mi(t);if(i(n(t),new o(0))===0)return Mi(e);var s=Mi(e),c=Mi(t);return r(a(s,c),a(c,s))}})}),Pm=`setUnion`,Fm=V(Pm,[`typed`,`size`,`concat`,`subset`,`setIntersect`,`setSymDifference`,`Index`],e=>{var{typed:t,size:n,concat:r,subset:i,setIntersect:a,setSymDifference:o,Index:s}=e;return t(Pm,{"Array | Matrix, Array | Matrix":function(e,t){if(i(n(e),new s(0))===0)return Mi(t);if(i(n(t),new s(0))===0)return Mi(e);var c=Mi(e),l=Mi(t);return r(o(c,l),a(c,l))}})}),Im=`add`,Lm=V(Im,[`typed`,`matrix`,`addScalar`,`equalScalar`,`DenseMatrix`,`SparseMatrix`,`concat`],e=>{var{typed:t,matrix:n,addScalar:r,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:s}=e,c=yc({typed:t}),l=bc({typed:t,equalScalar:i}),u=xc({typed:t,DenseMatrix:a}),d=gc({typed:t,matrix:n,concat:s});return t(Im,{"any, any":r,"any, any, ...any":t.referToSelf(e=>(t,n,r)=>{for(var i=e(t,n),a=0;a<r.length;a++)i=e(i,r[a]);return i})},d({elop:r,DS:c,SS:l,Ss:u}))}),Rm=`hypot`,zm=V(Rm,[`typed`,`abs`,`addScalar`,`divideScalar`,`multiplyScalar`,`sqrt`,`smaller`,`isPositive`],e=>{var{typed:t,abs:n,addScalar:r,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:s,isPositive:c}=e;return t(Rm,{"... number | BigNumber":l,Array:l,Matrix:e=>l(Mi(e.toArray(),!0))});function l(e){for(var t=0,l=0,u=0;u<e.length;u++){if(A(e[u]))throw TypeError(`Unexpected type of argument to hypot`);var d=n(e[u]);s(l,d)?(t=a(t,a(i(l,d),i(l,d))),t=r(t,1),l=d):t=r(t,c(d)?a(i(d,l),i(d,l)):d)}return a(l,o(t))}}),Bm=`norm`,Vm=V(Bm,[`typed`,`abs`,`add`,`pow`,`conj`,`sqrt`,`multiply`,`equalScalar`,`larger`,`smaller`,`matrix`,`ctranspose`,`eigs`],e=>{var{typed:t,abs:n,add:r,pow:i,conj:a,sqrt:o,multiply:s,equalScalar:c,larger:l,smaller:u,matrix:d,ctranspose:f,eigs:p}=e;return t(Bm,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return S(d(e),2)},Matrix:function(e){return S(e,2)},"Array, number | BigNumber | string":function(e,t){return S(d(e),t)},"Matrix, number | BigNumber | string":function(e,t){return S(e,t)}});function m(e){var t=0;return e.forEach(function(e){var r=n(e);l(r,t)&&(t=r)},!0),t}function h(e){var t;return e.forEach(function(e){var r=n(e);(!t||u(r,t))&&(t=r)},!0),t||0}function g(e,t){if(t===1/0||t===`inf`)return m(e);if(t===-1/0||t===`-inf`)return h(e);if(t===`fro`)return S(e,2);if(typeof t==`number`&&!isNaN(t)){if(!c(t,0)){var a=0;return e.forEach(function(e){a=r(i(n(e),t),a)},!0),i(a,1/t)}return 1/0}throw Error(`Unsupported parameter value`)}function _(e){var t=0;return e.forEach(function(e,n){t=r(t,s(e,a(e)))}),n(o(t))}function v(e){var t=[],i=0;return e.forEach(function(e,a){var o=a[1],s=r(t[o]||0,n(e));l(s,i)&&(i=s),t[o]=s},!0),i}function y(e){var t=e.size();if(t[0]!==t[1])throw RangeError(`Invalid matrix dimensions`);var r=p(s(f(e),e)).values.toArray(),i=r[r.length-1];return n(o(i))}function b(e){var t=[],i=0;return e.forEach(function(e,a){var o=a[0],s=r(t[o]||0,n(e));l(s,i)&&(i=s),t[o]=s},!0),i}function x(e,t){if(t===1)return v(e);if(t===1/0||t===`inf`)return b(e);if(t===`fro`)return _(e);if(t===2)return y(e);throw Error(`Unsupported parameter value `+t)}function S(e,t){var n=e.size();if(n.length===1)return g(e,t);if(n.length===2){if(n[0]&&n[1])return x(e,t);throw RangeError(`Invalid matrix dimensions`)}}}),Hm=`dot`,Um=V(Hm,[`typed`,`addScalar`,`multiplyScalar`,`conj`,`size`],e=>{var{typed:t,addScalar:n,multiplyScalar:r,conj:i,size:a}=e;return t(Hm,{"Array | DenseMatrix, Array | DenseMatrix":s,"SparseMatrix, SparseMatrix":c});function o(e,t){var n=a(e),r=a(t),i,o;if(n.length===1)i=n[0];else if(n.length===2&&n[1]===1)i=n[0];else throw RangeError(`Expected a column vector, instead got a matrix of size (`+n.join(`, `)+`)`);if(r.length===1)o=r[0];else if(r.length===2&&r[1]===1)o=r[0];else throw RangeError(`Expected a column vector, instead got a matrix of size (`+r.join(`, `)+`)`);if(i!==o)throw RangeError(`Vectors must have equal length (`+i+` != `+o+`)`);if(i===0)throw RangeError(`Cannot calculate the dot product of empty vectors`);return i}function s(e,s){var c=o(e,s),l=F(e)?e._data:e,u=F(e)?e._datatype||e.getDataType():void 0,d=F(s)?s._data:s,f=F(s)?s._datatype||s.getDataType():void 0,p=a(e).length===2,m=a(s).length===2,h=n,g=r;if(u&&f&&u===f&&typeof u==`string`&&u!==`mixed`){var _=u;h=t.find(n,[_,_]),g=t.find(r,[_,_])}if(!p&&!m){for(var v=g(i(l[0]),d[0]),y=1;y<c;y++)v=h(v,g(i(l[y]),d[y]));return v}if(!p&&m){for(var b=g(i(l[0]),d[0][0]),x=1;x<c;x++)b=h(b,g(i(l[x]),d[x][0]));return b}if(p&&!m){for(var S=g(i(l[0][0]),d[0]),C=1;C<c;C++)S=h(S,g(i(l[C][0]),d[C]));return S}if(p&&m){for(var w=g(i(l[0][0]),d[0][0]),T=1;T<c;T++)w=h(w,g(i(l[T][0]),d[T][0]));return w}}function c(e,t){o(e,t);for(var i=e._index,a=e._values,s=t._index,c=t._values,l=0,u=n,d=r,f=0,p=0;f<i.length&&p<s.length;){var m=i[f],h=s[p];if(m<h){f++;continue}if(m>h){p++;continue}m===h&&(l=u(l,d(a[f],c[p])),f++,p++)}return l}}),Wm=V(`trace`,[`typed`,`matrix`,`add`],e=>{var{typed:t,matrix:n,add:r}=e;return t(`trace`,{Array:function(e){return i(n(e))},SparseMatrix:a,DenseMatrix:i,any:Ne});function i(e){var t=e._size,n=e._data;switch(t.length){case 1:if(t[0]===1)return Ne(n[0]);throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o<i;o++)a=r(a,n[o][o]);return a}throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);default:throw RangeError(`Matrix must be two dimensional (size: `+oi(t)+`)`)}}function a(e){var t=e._values,n=e._index,i=e._ptr,a=e._size,o=a[0],s=a[1];if(o===s){var c=0;if(t.length>0)for(var l=0;l<s;l++)for(var u=i[l],d=i[l+1],f=u;f<d;f++){var p=n[f];if(p===l){c=r(c,t[f]);break}if(p>l)break}return c}throw RangeError(`Matrix must be square (size: `+oi(a)+`)`)}}),Gm=`index`,Km=V(Gm,[`typed`,`Index`],e=>{var{typed:t,Index:n}=e;return t(Gm,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map(function(e){return O(e)?e.toNumber():P(e)||F(e)?e.map(function(e){return O(e)?e.toNumber():e}):e}),r=new n;return n.apply(r,t),r}})}),qm=new Set([`end`]),Jm=V(`Node`,[`mathWithTransform`],e=>{var{mathWithTransform:t}=e;function n(e){for(var t of[...qm])if(e.has(t))throw Error(`Scope contains an illegal symbol, "`+t+`" is a reserved keyword`)}class r{get type(){return`Node`}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){var e=this._compile(t,{}),r={},i=null;function a(t){var a=T(t);return n(a),e(a,r,i)}return{evaluate:a}}_compile(e,t){throw Error(`Method _compile must be implemented by type `+this.type)}forEach(e){throw Error(`Cannot run forEach on a Node interface`)}map(e){throw Error(`Cannot run map on a Node interface`)}_ifNode(e){if(!we(e))throw TypeError(`Callback function must return a Node`);return e}traverse(e){e(this,null,null);function t(e,n){e.forEach(function(e,r,i){n(e,r,i),t(e,n)})}t(this,e)}transform(e){function t(n,r,i){var a=e(n,r,i);return a===n?n.map(t):a}return t(this,null,null)}filter(e){var t=[];return this.traverse(function(n,r,i){e(n,r,i)&&t.push(n)}),t}clone(){throw Error(`Cannot clone a Node interface`)}cloneDeep(){return this.map(function(e){return e.cloneDeep()})}equals(e){return e?this.type===e.type&&Le(this,e):!1}toString(e){var t=this._getCustomString(e);return t===void 0?this._toString(e):t}_toString(){throw Error(`_toString not implemented for `+this.type)}toJSON(){throw Error(`Cannot serialize object: toJSON not implemented by `+this.type)}toHTML(e){var t=this._getCustomString(e);return t===void 0?this._toHTML(e):t}_toHTML(){throw Error(`_toHTML not implemented for `+this.type)}toTex(e){var t=this._getCustomString(e);return t===void 0?this._toTex(e):t}_toTex(e){throw Error(`_toTex not implemented for `+this.type)}_getCustomString(e){if(e&&typeof e==`object`)switch(typeof e.handler){case`object`:case`undefined`:return;case`function`:return e.handler(this,e);default:throw TypeError(`Object or function expected as callback`)}}getIdentifier(){return this.type}getContent(){return this}}return r},{isClass:!0,isNode:!0});function Ym(e){return e&&e.isIndexError?new hi(e.index+1,e.min+1,e.max===void 0?void 0:e.max+1):e}function Xm(e){var{subset:t}=e;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&typeof e.subset==`function`)return e.subset(n);if(typeof e==`string`)return t(e,n);if(typeof e==`object`){if(!n.isObjectProperty())throw TypeError(`Cannot apply a numeric index as object property`);return f(e,n.getObjectProperty())}throw TypeError(`Cannot apply index: unsupported type of object`)}catch(e){throw Ym(e)}}}var Zm=`AccessorNode`,Qm=V(Zm,[`subset`,`Node`],e=>{var{subset:t,Node:n}=e,r=Xm({subset:t});function i(e){return!(me(e)||he(e)||ye(e)||Se(e)||Te(e)||De(e)||Ae(e))}class a extends n{constructor(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(super(),!we(e))throw TypeError(`Node expected for parameter "object"`);if(!Ce(t))throw TypeError(`IndexNode expected for parameter "index"`);this.object=e,this.index=t,this.optionalChaining=n}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():``:this.object.name||``}get type(){return Zm}get isAccessorNode(){return!0}_compile(e,t){var n=this.object._compile(e,t),i=this.index._compile(e,t),a=this.optionalChaining,o=me(this.object)&&this.object.optionalChaining;if(this.index.isObjectProperty()){var s=this.index.getObjectProperty();return function(e,t,r){var i=r||{},c=n(e,t,i);if(a&&c==null){i.optionalShortCircuit=!0;return}if(!(o&&i!=null&&i.optionalShortCircuit))return f(c,s)}}return function(e,t,s){var c=s||{},l=n(e,t,c);if(a&&l==null){c.optionalShortCircuit=!0;return}if(!(o&&c!=null&&c.optionalShortCircuit))return r(l,i(e,t,l))}}forEach(e){e(this.object,`object`,this),e(this.index,`index`,this)}map(e){return new a(this._ifNode(e(this.object,`object`,this)),this._ifNode(e(this.index,`index`,this)),this.optionalChaining)}clone(){return new a(this.object,this.index,this.optionalChaining)}_toString(e){var t=this.object.toString(e);i(this.object)&&(t=`(`+t+`)`);var n=this.optionalChaining?this.index.dotNotation?`?`:`?.`:``;return t+n+this.index.toString(e)}_toHTML(e){var t=this.object.toHTML(e);return i(this.object)&&(t=`<span class="math-parenthesis math-round-parenthesis">(</span>`+t+`<span class="math-parenthesis math-round-parenthesis">)</span>`),t+this.index.toHTML(e)}_toTex(e){var t=this.object.toTex(e);return i(this.object)&&(t=`\\left(' + object + '\\right)`),t+this.index.toTex(e)}toJSON(){return{mathjs:Zm,object:this.object,index:this.index,optionalChaining:this.optionalChaining}}static fromJSON(e){return new a(e.object,e.index,e.optionalChaining)}}return Ju(a,`name`,Zm),a},{isClass:!0,isNode:!0}),$m=`ArrayNode`,eh=V($m,[`Node`],e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(we))throw TypeError(`Array containing Nodes expected`)}get type(){return $m}get isArrayNode(){return!0}_compile(e,t){var n=Ni(this.items,function(n){return n._compile(e,t)});if(e.config.matrix!==`Array`){var r=e.matrix;return function(e,t,i){return r(Ni(n,function(n){return n(e,t,i)}))}}return function(e,t,r){return Ni(n,function(n){return n(e,t,r)})}}forEach(e){for(var t=0;t<this.items.length;t++){var n=this.items[t];e(n,`items[`+t+`]`,this)}}map(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],`items[`+r+`]`,this));return new n(t)}clone(){return new n(this.items.slice(0))}_toString(e){return`[`+this.items.map(function(t){return t.toString(e)}).join(`, `)+`]`}toJSON(){return{mathjs:$m,items:this.items}}static fromJSON(e){return new n(e.items)}_toHTML(e){return`<span class="math-parenthesis math-square-parenthesis">[</span>`+this.items.map(function(t){return t.toHTML(e)}).join(`<span class="math-separator">,</span>`)+`<span class="math-parenthesis math-square-parenthesis">]</span>`}_toTex(e){function t(n,r){var i=n.some(he)&&!n.every(he),a=r||i,o=a?`&`:`\\\\`,s=n.map(function(n){return n.items?t(n.items,!r):n.toTex(e)}).join(o);return i||!a||a&&!r?`\\begin{bmatrix}`+s+`\\end{bmatrix}`:s}return t(this.items,!1)}}return Ju(n,`name`,$m),n},{isClass:!0,isNode:!0});function th(e){var{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&&typeof e.subset==`function`)return e.subset(r,i);if(typeof e==`string`)return t(e,r,i);if(typeof e==`object`){if(!r.isObjectProperty())throw TypeError(`Cannot apply a numeric index as object property`);return p(e,r.getObjectProperty(),i),e}throw TypeError(`Cannot apply index: unsupported type of object`)}catch(e){throw Ym(e)}}}var nh=[{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:nullish":{op:`??`,associativity:`left`,associativeWith:[]}},{"OperatorNode:factorial":{op:`!`,associativity:`left`}},{"OperatorNode:ctranspose":{op:`'`,associativity:`left`}}];function rh(e,t){if(!t||t!==`auto`)return e;for(var n=e;De(n);)n=n.content;return n}function ih(e,t,n,r){var i=e;t!==`keep`&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,s=0;s<nh.length;s++)if(a in nh[s]){o=s;break}if(a===`OperatorNode:multiply`&&i.implicit&&n!==`show`){var c=rh(i.args[0],t);!(ye(c)&&r&&r.getIdentifier()===`OperatorNode:divide`&&be(rh(r.args[0],t)))&&!(c.getIdentifier()===`OperatorNode:divide`&&be(rh(c.args[0],t))&&ye(rh(c.args[1])))&&(o+=1)}return o}function ah(e,t){var n=e;t!==`keep`&&(n=e.getContent());var r=n.getIdentifier(),i=ih(n,t);if(i===null)return null;var a=nh[i][r];if(z(a,`associativity`)){if(a.associativity===`left`)return`left`;if(a.associativity===`right`)return`right`;throw Error(`'`+r+`' has the invalid associativity '`+a.associativity+`'.`)}return null}function oh(e,t,n){var r=n===`keep`?e:e.getContent(),i=n===`keep`?t:e.getContent(),a=r.getIdentifier(),o=i.getIdentifier(),s=ih(r,n);if(s===null)return null;var c=nh[s][a];if(z(c,`associativeWith`)&&c.associativeWith instanceof Array){for(var l=0;l<c.associativeWith.length;l++)if(c.associativeWith[l]===o)return!0;return!1}return null}function sh(e){var t=`OperatorNode:`+e;for(var n of nh)if(t in n)return n[t].op;return null}var ch=`AssignmentNode`,lh=V(ch,[`subset`,`?matrix`,`Node`],e=>{var{subset:t,matrix:n,Node:r}=e,i=Xm({subset:t}),a=th({subset:t,matrix:n});function o(e,t,n){t||=`keep`;var r=ih(e,t,n),i=ih(e.value,t,n);return t===`all`||i!==null&&i<=r}class s extends r{constructor(e,t,n){if(super(),this.object=e,this.index=n?t:null,this.value=n||t,!Ae(e)&&!me(e))throw TypeError(`SymbolNode or AccessorNode expected as "object"`);if(Ae(e)&&e.name===`end`)throw Error(`Cannot assign to symbol "end"`);if(this.index&&!Ce(this.index))throw TypeError(`IndexNode expected as "index"`);if(!we(this.value))throw TypeError(`Node expected as "value"`)}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():``:this.object.name||``}get type(){return ch}get isAssignmentNode(){return!0}_compile(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,o=this.value._compile(e,t),s=this.object.name;if(!this.index){if(!Ae(this.object))throw TypeError(`SymbolNode expected as object`);return function(e,t,n){var r=o(e,t,n);return e.set(s,r),r}}if(this.index.isObjectProperty()){var c=this.index.getObjectProperty();return function(e,t,r){var i=n(e,t,r),a=o(e,t,r);return p(i,c,a),a}}if(Ae(this.object))return function(e,t,i){var c=n(e,t,i),l=o(e,t,i),u=r(e,t,c);return e.set(s,a(c,u,l)),l};var l=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var u=this.object.index.getObjectProperty();return function(e,t,n){var i=l(e,t,n),s=f(i,u),c=r(e,t,s),d=o(e,t,n);return p(i,u,a(s,c,d)),d}}var d=this.object.index._compile(e,t);return function(e,t,n){var s=l(e,t,n),c=d(e,t,s),u=i(s,c),f=r(e,t,u),p=o(e,t,n);return a(s,c,a(u,f,p)),p}}forEach(e){e(this.object,`object`,this),this.index&&e(this.index,`index`,this),e(this.value,`value`,this)}map(e){var 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 s(t,n,r)}clone(){return new s(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):``,r=this.value.toString(e);return o(this,e&&e.parenthesis,e&&e.implicit)&&(r=`(`+r+`)`),t+n+` = `+r}toJSON(){return{mathjs:ch,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new s(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):``,r=this.value.toHTML(e);return o(this,e&&e.parenthesis,e&&e.implicit)&&(r=`<span class="math-paranthesis math-round-parenthesis">(</span>`+r+`<span class="math-paranthesis math-round-parenthesis">)</span>`),t+n+`<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>`+r}_toTex(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):``,r=this.value.toTex(e);return o(this,e&&e.parenthesis,e&&e.implicit)&&(r=`\\left(${r}\\right)`),t+n+`=`+r}}return Ju(s,`name`,ch),s},{isClass:!0,isNode:!0}),uh=`BlockNode`,dh=V(uh,[`ResultSet`,`Node`],e=>{var{ResultSet:t,Node:n}=e;class r extends n{constructor(e){if(super(),!Array.isArray(e))throw Error(`Array expected`);this.blocks=e.map(function(e){var t=e&&e.node,n=e&&e.visible!==void 0?e.visible:!0;if(!we(t))throw TypeError(`Property "node" must be a Node`);if(typeof n!=`boolean`)throw TypeError(`Property "visible" must be a boolean`);return{node:t,visible:n}})}get type(){return uh}get isBlockNode(){return!0}_compile(e,n){var r=Ni(this.blocks,function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}});return function(e,n,i){var a=[];return Pi(r,function(t){var r=t.evaluate(e,n,i);t.visible&&a.push(r)}),new t(a)}}forEach(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,`blocks[`+t+`].node`,this)}map(e){for(var t=[],n=0;n<this.blocks.length;n++){var i=this.blocks[n],a=this._ifNode(e(i.node,`blocks[`+n+`].node`,this));t[n]={node:a,visible:i.visible}}return new r(t)}clone(){var e=this.blocks.map(function(e){return{node:e.node,visible:e.visible}});return new r(e)}_toString(e){return this.blocks.map(function(t){return t.node.toString(e)+(t.visible?``:`;`)}).join(`
|
|
12
|
+
`)}toJSON(){return{mathjs:uh,blocks:this.blocks}}static fromJSON(e){return new r(e.blocks)}_toHTML(e){return this.blocks.map(function(t){return t.node.toHTML(e)+(t.visible?``:`<span class="math-separator">;</span>`)}).join(`<span class="math-separator"><br /></span>`)}_toTex(e){return this.blocks.map(function(t){return t.node.toTex(e)+(t.visible?``:`;`)}).join(`\\;\\;
|
|
13
|
+
`)}}return Ju(r,`name`,uh),r},{isClass:!0,isNode:!0}),fh=`ConditionalNode`,ph=V(fh,[`Node`],e=>{var{Node:t}=e;function n(e){if(typeof e==`number`||typeof e==`boolean`||typeof e==`string`)return!!e;if(e){if(O(e))return!e.isZero();if(A(e))return!!(e.re||e.im);if(M(e))return!!e.value}if(e==null)return!1;throw TypeError(`Unsupported type of condition "`+Me(e)+`"`)}class r extends t{constructor(e,t,n){if(super(),!we(e))throw TypeError(`Parameter condition must be a Node`);if(!we(t))throw TypeError(`Parameter trueExpr must be a Node`);if(!we(n))throw TypeError(`Parameter falseExpr must be a Node`);this.condition=e,this.trueExpr=t,this.falseExpr=n}get type(){return fh}get isConditionalNode(){return!0}_compile(e,t){var r=this.condition._compile(e,t),i=this.trueExpr._compile(e,t),a=this.falseExpr._compile(e,t);return function(e,t,o){return n(r(e,t,o))?i(e,t,o):a(e,t,o)}}forEach(e){e(this.condition,`condition`,this),e(this.trueExpr,`trueExpr`,this),e(this.falseExpr,`falseExpr`,this)}map(e){return new r(this._ifNode(e(this.condition,`condition`,this)),this._ifNode(e(this.trueExpr,`trueExpr`,this)),this._ifNode(e(this.falseExpr,`falseExpr`,this)))}clone(){return new r(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=ih(this,t,e&&e.implicit),r=this.condition.toString(e),i=ih(this.condition,t,e&&e.implicit);(t===`all`||this.condition.type===`OperatorNode`||i!==null&&i<=n)&&(r=`(`+r+`)`);var a=this.trueExpr.toString(e),o=ih(this.trueExpr,t,e&&e.implicit);(t===`all`||this.trueExpr.type===`OperatorNode`||o!==null&&o<=n)&&(a=`(`+a+`)`);var s=this.falseExpr.toString(e),c=ih(this.falseExpr,t,e&&e.implicit);return(t===`all`||this.falseExpr.type===`OperatorNode`||c!==null&&c<=n)&&(s=`(`+s+`)`),r+` ? `+a+` : `+s}toJSON(){return{mathjs:fh,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new r(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=ih(this,t,e&&e.implicit),r=this.condition.toHTML(e),i=ih(this.condition,t,e&&e.implicit);(t===`all`||this.condition.type===`OperatorNode`||i!==null&&i<=n)&&(r=`<span class="math-parenthesis math-round-parenthesis">(</span>`+r+`<span class="math-parenthesis math-round-parenthesis">)</span>`);var a=this.trueExpr.toHTML(e),o=ih(this.trueExpr,t,e&&e.implicit);(t===`all`||this.trueExpr.type===`OperatorNode`||o!==null&&o<=n)&&(a=`<span class="math-parenthesis math-round-parenthesis">(</span>`+a+`<span class="math-parenthesis math-round-parenthesis">)</span>`);var s=this.falseExpr.toHTML(e),c=ih(this.falseExpr,t,e&&e.implicit);return(t===`all`||this.falseExpr.type===`OperatorNode`||c!==null&&c<=n)&&(s=`<span class="math-parenthesis math-round-parenthesis">(</span>`+s+`<span class="math-parenthesis math-round-parenthesis">)</span>`),r+`<span class="math-operator math-conditional-operator">?</span>`+a+`<span class="math-operator math-conditional-operator">:</span>`+s}_toTex(e){return`\\begin{cases} {`+this.trueExpr.toTex(e)+`}, &\\quad{\\text{if }\\;`+this.condition.toTex(e)+`}\\\\{`+this.falseExpr.toTex(e)+`}, &\\quad{\\text{otherwise}}\\end{cases}`}}return Ju(r,`name`,fh),r},{isClass:!0,isNode:!0}),mh=l(o(((e,t)=>{var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r={"{":`\\{`,"}":`\\}`,"\\":`\\textbackslash{}`,"#":`\\#`,$:`\\$`,"%":`\\%`,"&":`\\&`,"^":`\\textasciicircum{}`,_:`\\_`,"~":`\\textasciitilde{}`},i={"–":`\\--`,"—":`\\---`," ":`~`," ":`\\qquad{}`,"\r\n":`\\newline{}`,"\n":`\\newline{}`},a=function(e,t){return n({},e,t)};t.exports=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=t.preserveFormatting,s=o!==void 0&&o,c=t.escapeMapFn,l=c===void 0?a:c,u=String(e),d=``,f=l(n({},r),s?n({},i):{}),p=Object.keys(f),m=function(){var e=!1;p.forEach(function(t,n){e||u.length>=t.length&&u.slice(0,t.length)===t&&(d+=f[p[n]],u=u.slice(t.length,u.length),e=!0)}),e||(d+=u.slice(0,1),u=u.slice(1,u.length))};u;)m();return d}}))(),1),hh={Alpha:`A`,alpha:`\\alpha`,Beta:`B`,beta:`\\beta`,Gamma:`\\Gamma`,gamma:`\\gamma`,Delta:`\\Delta`,delta:`\\delta`,Epsilon:`E`,epsilon:`\\epsilon`,varepsilon:`\\varepsilon`,Zeta:`Z`,zeta:`\\zeta`,Eta:`H`,eta:`\\eta`,Theta:`\\Theta`,theta:`\\theta`,vartheta:`\\vartheta`,Iota:`I`,iota:`\\iota`,Kappa:`K`,kappa:`\\kappa`,varkappa:`\\varkappa`,Lambda:`\\Lambda`,lambda:`\\lambda`,Mu:`M`,mu:`\\mu`,Nu:`N`,nu:`\\nu`,Xi:`\\Xi`,xi:`\\xi`,Omicron:`O`,omicron:`o`,Pi:`\\Pi`,pi:`\\pi`,varpi:`\\varpi`,Rho:`P`,rho:`\\rho`,varrho:`\\varrho`,Sigma:`\\Sigma`,sigma:`\\sigma`,varsigma:`\\varsigma`,Tau:`T`,tau:`\\tau`,Upsilon:`\\Upsilon`,upsilon:`\\upsilon`,Phi:`\\Phi`,phi:`\\phi`,varphi:`\\varphi`,Chi:`X`,chi:`\\chi`,Psi:`\\Psi`,psi:`\\psi`,Omega:`\\Omega`,omega:`\\omega`,true:`\\mathrm{True}`,false:`\\mathrm{False}`,i:`i`,inf:`\\infty`,Inf:`\\infty`,infinity:`\\infty`,Infinity:`\\infty`,oo:`\\infty`,lim:`\\lim`,undefined:`\\mathbf{?}`},gh={transpose:`^\\top`,ctranspose:`^H`,factorial:`!`,pow:`^`,dotPow:`.^\\wedge`,unaryPlus:`+`,unaryMinus:`-`,bitNot:`\\~`,not:`\\neg`,multiply:`\\cdot`,divide:`\\frac`,dotMultiply:`.\\cdot`,dotDivide:`.:`,mod:`\\mod`,add:`+`,subtract:`-`,to:`\\rightarrow`,leftShift:`<<`,rightArithShift:`>>`,rightLogShift:`>>>`,equal:`=`,unequal:`\\neq`,smaller:`<`,larger:`>`,smallerEq:`\\leq`,largerEq:`\\geq`,bitAnd:`\\&`,bitXor:`\\underline{|}`,bitOr:`|`,and:`\\wedge`,xor:`\\veebar`,or:`\\vee`},_h={abs:{1:"\\left|${args[0]}\\right|"},add:{2:`\\left(\${args[0]}${gh.add}\${args[1]}\\right)`},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:`\\left(\${args[0]}${gh.dotDivide}\${args[1]}\\right)`},dotMultiply:{2:`\\left(\${args[0]}${gh.dotMultiply}\${args[1]}\\right)`},dotPow:{2:`\\left(\${args[0]}${gh.dotPow}\${args[1]}\\right)`},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:`\\left(e${gh.pow}{\${args[0]}}-1\\right)`,fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},fraction:{2:"\\frac{${args[0]}}{${args[1]}}"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:`\\left(\${args[0]}${gh.mod}\${args[1]}\\right)`},multiply:{2:`\\left(\${args[0]}${gh.multiply}\${args[1]}\\right)`},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : y^${args[1]} = {${args[0]}}\\}"},pow:{2:`\\left(\${args[0]}\\right)${gh.pow}{\${args[1]}}`},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:`\\left(\${args[0]}${gh.subtract}\${args[1]}\\right)`},unaryMinus:{1:`${gh.unaryMinus}\\left(\${args[0]}\\right)`},unaryPlus:{1:`${gh.unaryPlus}\\left(\${args[0]}\\right)`},bitAnd:{2:`\\left(\${args[0]}${gh.bitAnd}\${args[1]}\\right)`},bitNot:{1:gh.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:`\\left(\${args[0]}${gh.bitOr}\${args[1]}\\right)`},bitXor:{2:`\\left(\${args[0]}${gh.bitXor}\${args[1]}\\right)`},leftShift:{2:`\\left(\${args[0]}${gh.leftShift}\${args[1]}\\right)`},rightArithShift:{2:`\\left(\${args[0]}${gh.rightArithShift}\${args[1]}\\right)`},rightLogShift:{2:`\\left(\${args[0]}${gh.rightLogShift}\${args[1]}\\right)`},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:`\\left(\${args[0]}${gh.and}\${args[1]}\\right)`},not:{1:gh.not+"\\left(${args[0]}\\right)"},or:{2:`\\left(\${args[0]}${gh.or}\${args[1]}\\right)`},xor:{2:`\\left(\${args[0]}${gh.xor}\${args[1]}\\right)`},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:`\\left(\${args[0]}\\right)${gh.ctranspose}`},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:`{\${args[0]}}${gh.pow}{\\frac{1}{2}}`},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:`\\left(\${args[0]}\\right)${gh.transpose}`},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:`\\left(\${args[0]}\\right)${gh.factorial}`},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:`\\left(\${args[0]}${gh.equal}\${args[1]}\\right)`},larger:{2:`\\left(\${args[0]}${gh.larger}\${args[1]}\\right)`},largerEq:{2:`\\left(\${args[0]}${gh.largerEq}\${args[1]}\\right)`},smaller:{2:`\\left(\${args[0]}${gh.smaller}\${args[1]}\\right)`},smallerEq:{2:`\\left(\${args[0]}${gh.smallerEq}\${args[1]}\\right)`},unequal:{2:`\\left(\${args[0]}${gh.unequal}\${args[1]}\\right)`},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:`\\left(\${args[0]}${gh.to}\${args[1]}\\right)`},numeric:function(e,t){return e.args[0].toTex()},number:{0:`0`,1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:`\\mathtt{""}`,1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:`0`,1:"\\left(${args[0]}\\right)"},bigint:{0:`0`,1:"\\left(${args[0]}\\right)"},complex:{0:`0`,1:"\\left(${args[0]}\\right)",2:`\\left(\\left(\${args[0]}\\right)+${hh.i}\\cdot\\left(\${args[1]}\\right)\\right)`},matrix:{0:`\\begin{bmatrix}\\end{bmatrix}`,1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:`\\begin{bsparse}\\end{bsparse}`,1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},vh="\\mathrm{${name}}\\left(${args}\\right)",yh={deg:`^\\circ`};function bh(e){return(0,mh.default)(e,{preserveFormatting:!0})}function xh(e,t){return t=t!==void 0&&t,t?z(yh,e)?yh[e]:`\\mathrm{`+bh(e)+`}`:z(hh,e)?hh[e]:bh(e)}var Sh=`ConstantNode`,Ch=V(Sh,[`Node`,`isBounded`],e=>{var{Node:t,isBounded:n}=e;class r extends t{constructor(e){super(),this.value=e}get type(){return Sh}get isConstantNode(){return!0}_compile(e,t){var n=this.value;return function(){return n}}forEach(e){}map(e){return this.clone()}clone(){return new r(this.value)}_toString(e){return oi(this.value,e)}_toHTML(e){var t=this._toString(e);switch(Me(this.value)){case`number`:case`bigint`:case`BigNumber`:case`Fraction`:return`<span class="math-number">`+t+`</span>`;case`string`:return`<span class="math-string">`+t+`</span>`;case`boolean`:return`<span class="math-boolean">`+t+`</span>`;case`null`:return`<span class="math-null-symbol">`+t+`</span>`;case`undefined`:return`<span class="math-undefined">`+t+`</span>`;default:return`<span class="math-symbol">`+t+`</span>`}}toJSON(){return{mathjs:Sh,value:this.value}}static fromJSON(e){return new r(e.value)}_toTex(e){var t=this._toString(e);switch(Me(this.value)){case`string`:return`\\mathtt{`+bh(t)+`}`;case`number`:case`BigNumber`:if(!n(this.value))return this.value.valueOf()<0?`-\\infty`:`\\infty`;var r=t.toLowerCase().indexOf(`e`);return r===-1?t:t.substring(0,r)+`\\cdot10^{`+t.substring(r+1)+`}`;case`bigint`:return t.toString();case`Fraction`:return this.value.toLatex();default:return t}}}return Ju(r,`name`,Sh),r},{isClass:!0,isNode:!0}),wh=`FunctionAssignmentNode`,Th=V(wh,[`typed`,`Node`],e=>{var{typed:t,Node:n}=e;function r(e,t,n){var r=ih(e,t,n),i=ih(e.expr,t,n);return t===`all`||i!==null&&i<=r}class i extends n{constructor(e,t,n){if(super(),typeof e!=`string`)throw TypeError(`String expected for parameter "name"`);if(!Array.isArray(t))throw TypeError(`Array containing strings or objects expected for parameter "params"`);if(!we(n))throw TypeError(`Node expected for parameter "expr"`);if(qm.has(e))throw Error(`Illegal function name, "`+e+`" is a reserved keyword`);var r=new Set;for(var i of t){var a=typeof i==`string`?i:i.name;if(r.has(a))throw Error(`Duplicate parameter name "${a}"`);r.add(a)}this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||`any`}),this.expr=n}get type(){return wh}get isFunctionAssignmentNode(){return!0}_compile(e,n){var r=Object.create(n);Pi(this.params,function(e){r[e]=!0});var i=this.expr,a=i._compile(e,r),o=this.name,s=this.params,c=Li(this.types,`,`),l=o+`(`+Li(this.params,`, `)+`)`;return function(e,n,r){var u={};u[c]=function(){for(var t=Object.create(n),i=0;i<s.length;i++)t[s[i]]=arguments[i];return a(e,t,r)};var d=t(o,u);return d.syntax=l,d.expr=i.toString(),e.set(o,d),d}}forEach(e){e(this.expr,`expr`,this)}map(e){var t=this._ifNode(e(this.expr,`expr`,this));return new i(this.name,this.params.slice(0),t)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=this.expr.toString(e);return r(this,t,e&&e.implicit)&&(n=`(`+n+`)`),this.name+`(`+this.params.join(`, `)+`) = `+n}toJSON(){var e=this.types;return{mathjs:wh,name:this.name,params:this.params.map(function(t,n){return{name:t,type:e[n]}}),expr:this.expr}}static fromJSON(e){return new i(e.name,e.params,e.expr)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:`keep`,n=[],i=0;i<this.params.length;i++)n.push(`<span class="math-symbol math-parameter">`+ui(this.params[i])+`</span>`);var a=this.expr.toHTML(e);return r(this,t,e&&e.implicit)&&(a=`<span class="math-parenthesis math-round-parenthesis">(</span>`+a+`<span class="math-parenthesis math-round-parenthesis">)</span>`),`<span class="math-function">`+ui(this.name)+`</span><span class="math-parenthesis math-round-parenthesis">(</span>`+n.join(`<span class="math-separator">,</span>`)+`<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>`+a}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=this.expr.toTex(e);return r(this,t,e&&e.implicit)&&(n=`\\left(${n}\\right)`),`\\mathrm{`+this.name+`}\\left(`+this.params.map(xh).join(`,`)+`\\right)=`+n}}return Ju(i,`name`,wh),i},{isClass:!0,isNode:!0}),Eh=`IndexNode`,Dh=V(Eh,[`Node`,`size`],e=>{var{Node:t,size:n}=e;class r extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(we))throw TypeError(`Array containing Nodes expected for parameter "dimensions"`);if(this.dotNotation&&!this.isObjectProperty())throw Error(`dotNotation only applicable for object properties`)}get type(){return Eh}get isIndexNode(){return!0}_compile(e,t){var r=Ni(this.dimensions,function(r,i){if(r.filter(e=>e.isSymbolNode&&e.name===`end`).length>0){var a=Object.create(t);a.end=!0;var o=r._compile(e,a);return function(e,t,r){if(!F(r)&&!P(r)&&!N(r))throw TypeError(`Cannot resolve "end": context must be a Matrix, Array, or string but is `+Me(r));var a=n(r),s=Object.create(t);return s.end=a[i],o(e,s,r)}}return r._compile(e,t)}),i=f(e,`index`);return function(e,t,n){return i(...Ni(r,function(r){return r(e,t,n)}))}}forEach(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],`dimensions[`+t+`]`,this)}map(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this._ifNode(e(this.dimensions[n],`dimensions[`+n+`]`,this));return new r(t,this.dotNotation)}clone(){return new r(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&ye(this.dimensions[0])&&typeof this.dimensions[0].value==`string`}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(e){return this.dotNotation?`.`+this.getObjectProperty():`[`+this.dimensions.join(`, `)+`]`}toJSON(){return{mathjs:Eh,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(e){return new r(e.dimensions,e.dotNotation)}_toHTML(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this.dimensions[n].toHTML();return this.dotNotation?`<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">`+ui(this.getObjectProperty())+`</span>`:`<span class="math-parenthesis math-square-parenthesis">[</span>`+t.join(`<span class="math-separator">,</span>`)+`<span class="math-parenthesis math-square-parenthesis">]</span>`}_toTex(e){var t=this.dimensions.map(function(t){return t.toTex(e)});return this.dotNotation?`.`+this.getObjectProperty():`_{`+t.join(`,`)+`}`}}return Ju(r,`name`,Eh),r},{isClass:!0,isNode:!0}),Oh=`ObjectNode`,kh=V(Oh,[`Node`],e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),this.properties=e||{},e&&(typeof e!=`object`||!Object.keys(e).every(function(t){return we(e[t])})))throw TypeError(`Object containing Nodes expected`)}get type(){return Oh}get isObjectNode(){return!0}_compile(e,t){var n={};for(var r in this.properties)if(z(this.properties,r)){var i=ci(r),a=JSON.parse(i);n[a]=f(this.properties,r)._compile(e,t)}return function(e,t,r){var i={};for(var a in n)z(n,a)&&(i[a]=n[a](e,t,r));return i}}forEach(e){for(var t in this.properties)z(this.properties,t)&&e(this.properties[t],`properties[`+ci(t)+`]`,this)}map(e){var t={};for(var r in this.properties)z(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],`properties[`+ci(r)+`]`,this)));return new n(t)}clone(){var e={};for(var t in this.properties)z(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)}_toString(e){var t=[];for(var n in this.properties)z(this.properties,n)&&t.push(ci(n)+`: `+this.properties[n].toString(e));return`{`+t.join(`, `)+`}`}toJSON(){return{mathjs:Oh,properties:this.properties}}static fromJSON(e){return new n(e.properties)}_toHTML(e){var t=[];for(var n in this.properties)z(this.properties,n)&&t.push(`<span class="math-symbol math-property">`+ui(n)+`</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>`+this.properties[n].toHTML(e));return`<span class="math-parenthesis math-curly-parenthesis">{</span>`+t.join(`<span class="math-separator">,</span>`)+`<span class="math-parenthesis math-curly-parenthesis">}</span>`}_toTex(e){var t=[];for(var n in this.properties)z(this.properties,n)&&t.push(`\\mathbf{`+n+`:} & `+this.properties[n].toTex(e)+`\\\\`);return`\\left\\{\\begin{array}{ll}`+t.join(`
|
|
14
|
+
`)+`\\end{array}\\right\\}`}}return Ju(n,`name`,Oh),n},{isClass:!0,isNode:!0});function Ah(e,t){return new S(e,new x(t),new Set(Object.keys(t)))}var jh=`OperatorNode`,Mh=V(jh,[`Node`],e=>{var{Node:t}=e;function n(e,t){var r=e;if(t===`auto`)for(;De(r);)r=r.content;return ye(r)?!0:Ee(r)?n(r.args[0],t):!1}function r(e,t,r,i,a){var o=ih(e,t,r),s=ah(e,t);if(t===`all`||i.length>2&&e.getIdentifier()!==`OperatorNode:add`&&e.getIdentifier()!==`OperatorNode:multiply`)return i.map(function(e){switch(e.getContent().type){case`ArrayNode`:case`ConstantNode`:case`SymbolNode`:case`ParenthesisNode`:return!1;default:return!0}});var c;switch(i.length){case 0:c=[];break;case 1:var l=ih(i[0],t,r,e);if(a&&l!==null){var u,d;if(t===`keep`?(u=i[0].getIdentifier(),d=e.getIdentifier()):(u=i[0].getContent().getIdentifier(),d=e.getContent().getIdentifier()),nh[o][d].latexLeftParens===!1){c=[!1];break}if(nh[l][u].latexParens===!1){c=[!1];break}}if(l===null){c=[!1];break}if(l<=o){c=[!0];break}c=[!1];break;case 2:var f,p=ih(i[0],t,r,e),m=oh(e,i[0],t);f=p===null?!1:p===o&&s===`right`&&!m||p<o;var h,g=ih(i[1],t,r,e),_=oh(e,i[1],t);if(h=g===null?!1:g===o&&s===`left`&&!_||g<o,a){var v,y,b;t===`keep`?(v=e.getIdentifier(),y=e.args[0].getIdentifier(),b=e.args[1].getIdentifier()):(v=e.getContent().getIdentifier(),y=e.args[0].getContent().getIdentifier(),b=e.args[1].getContent().getIdentifier()),p!==null&&(nh[o][v].latexLeftParens===!1&&(f=!1),nh[p][y].latexParens===!1&&(f=!1)),g!==null&&(nh[o][v].latexRightParens===!1&&(h=!1),nh[g][b].latexParens===!1&&(h=!1))}c=[f,h];break;default:(e.getIdentifier()===`OperatorNode:add`||e.getIdentifier()===`OperatorNode:multiply`)&&(c=i.map(function(n){var i=ih(n,t,r,e),a=oh(e,n,t),c=ah(n,t);return i===null?!1:o===i&&s===c&&!a||i<o}))}if(i.length>=2&&e.getIdentifier()===`OperatorNode:multiply`&&e.implicit&&t!==`all`&&r===`hide`)for(var x=1;x<c.length;++x)n(i[x],t)&&!c[x-1]&&(t!==`keep`||!De(i[x-1]))&&(c[x]=!0);return c}class i extends t{constructor(e,t,n,r,i){if(super(),typeof e!=`string`)throw TypeError(`string expected for parameter "op"`);if(typeof t!=`string`)throw TypeError(`string expected for parameter "fn"`);if(!Array.isArray(n)||!n.every(we))throw TypeError(`Array containing Nodes expected for parameter "args"`);this.implicit=r===!0,this.isPercentage=i===!0,this.op=e,this.fn=t,this.args=n||[]}get type(){return jh}get isOperatorNode(){return!0}_compile(e,t){if(typeof this.fn!=`string`||!v(e,this.fn))throw e[this.fn]?Error(`No access to function "`+this.fn+`"`):Error(`Function `+this.fn+` missing in provided namespace "math"`);var n=f(e,this.fn),r=Ni(this.args,function(n){return n._compile(e,t)});if(typeof n==`function`&&n.rawArgs===!0){var i=this.args;return function(t,r,a){return n(i,e,Ah(t,r))}}if(r.length===1){var a=r[0];return function(e,t,r){return n(a(e,t,r))}}if(r.length===2){var o=r[0],s=r[1];return function(e,t,r){return n(o(e,t,r),s(e,t,r))}}return function(e,t,i){return n.apply(null,Ni(r,function(n){return n(e,t,i)}))}}forEach(e){for(var t=0;t<this.args.length;t++)e(this.args[t],`args[`+t+`]`,this)}map(e){for(var t=[],n=0;n<this.args.length;n++)t[n]=this._ifNode(e(this.args[n],`args[`+n+`]`,this));return new i(this.op,this.fn,t,this.implicit,this.isPercentage)}clone(){return new i(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return this.args.length===1}isBinary(){return this.args.length===2}_toString(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=e&&e.implicit?e.implicit:`hide`,i=this.args,a=r(this,t,n,i,!1);if(i.length===1){var o=ah(this,t),s=i[0].toString(e);a[0]&&(s=`(`+s+`)`);var c=/[a-zA-Z]+/.test(this.op);return o===`right`?this.op+(c?` `:``)+s:o===`left`?s+(c?` `:``)+this.op:s+this.op}if(i.length===2){var l=i[0].toString(e),u=i[1].toString(e);return a[0]&&(l=`(`+l+`)`),a[1]&&(u=`(`+u+`)`),this.implicit&&this.getIdentifier()===`OperatorNode:multiply`&&n===`hide`?l+` `+u:l+` `+this.op+` `+u}if(i.length>2&&(this.getIdentifier()===`OperatorNode:add`||this.getIdentifier()===`OperatorNode:multiply`)){var d=i.map(function(t,n){return t=t.toString(e),a[n]&&(t=`(`+t+`)`),t});return this.implicit&&this.getIdentifier()===`OperatorNode:multiply`&&n===`hide`?d.join(` `):d.join(` `+this.op+` `)}return this.fn+`(`+this.args.join(`, `)+`)`}toJSON(){return{mathjs:jh,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new i(e.op,e.fn,e.args,e.implicit,e.isPercentage)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=e&&e.implicit?e.implicit:`hide`,i=this.args,a=r(this,t,n,i,!1);if(i.length===1){var o=ah(this,t),s=i[0].toHTML(e);return a[0]&&(s=`<span class="math-parenthesis math-round-parenthesis">(</span>`+s+`<span class="math-parenthesis math-round-parenthesis">)</span>`),o===`right`?`<span class="math-operator math-unary-operator math-lefthand-unary-operator">`+ui(this.op)+`</span>`+s:s+`<span class="math-operator math-unary-operator math-righthand-unary-operator">`+ui(this.op)+`</span>`}if(i.length===2){var c=i[0].toHTML(e),l=i[1].toHTML(e);return a[0]&&(c=`<span class="math-parenthesis math-round-parenthesis">(</span>`+c+`<span class="math-parenthesis math-round-parenthesis">)</span>`),a[1]&&(l=`<span class="math-parenthesis math-round-parenthesis">(</span>`+l+`<span class="math-parenthesis math-round-parenthesis">)</span>`),this.implicit&&this.getIdentifier()===`OperatorNode:multiply`&&n===`hide`?c+`<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>`+l:c+`<span class="math-operator math-binary-operator math-explicit-binary-operator">`+ui(this.op)+`</span>`+l}var u=i.map(function(t,n){return t=t.toHTML(e),a[n]&&(t=`<span class="math-parenthesis math-round-parenthesis">(</span>`+t+`<span class="math-parenthesis math-round-parenthesis">)</span>`),t});return i.length>2&&(this.getIdentifier()===`OperatorNode:add`||this.getIdentifier()===`OperatorNode:multiply`)?this.implicit&&this.getIdentifier()===`OperatorNode:multiply`&&n===`hide`?u.join(`<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>`):u.join(`<span class="math-operator math-binary-operator math-explicit-binary-operator">`+ui(this.op)+`</span>`):`<span class="math-function">`+ui(this.fn)+`</span><span class="math-paranthesis math-round-parenthesis">(</span>`+u.join(`<span class="math-separator">,</span>`)+`<span class="math-paranthesis math-round-parenthesis">)</span>`}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,n=e&&e.implicit?e.implicit:`hide`,i=this.args,a=r(this,t,n,i,!0),o=gh[this.fn];if(o=o===void 0?this.op:o,i.length===1){var s=ah(this,t),c=i[0].toTex(e);return a[0]&&(c=`\\left(${c}\\right)`),s===`right`?o+c:c+o}if(i.length===2){var l=i[0],u=l.toTex(e);a[0]&&(u=`\\left(${u}\\right)`);var d=i[1].toTex(e);a[1]&&(d=`\\left(${d}\\right)`);var f=t===`keep`?l.getIdentifier():l.getContent().getIdentifier();switch(this.getIdentifier()){case`OperatorNode:divide`:return o+`{`+u+`}{`+d+`}`;case`OperatorNode:pow`:switch(u=`{`+u+`}`,d=`{`+d+`}`,f){case`ConditionalNode`:case`OperatorNode:divide`:u=`\\left(${u}\\right)`}break;case`OperatorNode:multiply`:if(this.implicit&&n===`hide`)return u+`~`+d}return u+o+d}if(i.length>2&&(this.getIdentifier()===`OperatorNode:add`||this.getIdentifier()===`OperatorNode:multiply`)){var p=i.map(function(t,n){return t=t.toTex(e),a[n]&&(t=`\\left(${t}\\right)`),t});return this.getIdentifier()===`OperatorNode:multiply`&&this.implicit&&n===`hide`?p.join(`~`):p.join(o)}return`\\mathrm{`+this.fn+`}\\left(`+i.map(function(t){return t.toTex(e)}).join(`,`)+`\\right)`}getIdentifier(){return this.type+`:`+this.fn}}return Ju(i,`name`,jh),i},{isClass:!0,isNode:!0}),Nh=`ParenthesisNode`,Ph=V(Nh,[`Node`],e=>{var{Node:t}=e;class n extends t{constructor(e){if(super(),!we(e))throw TypeError(`Node expected for parameter "content"`);this.content=e}get type(){return Nh}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,`content`,this)}map(e){var t=e(this.content,`content`,this);return new n(t)}clone(){return new n(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&e.parenthesis===`keep`?`(`+this.content.toString(e)+`)`:this.content.toString(e)}toJSON(){return{mathjs:Nh,content:this.content}}static fromJSON(e){return new n(e.content)}_toHTML(e){return!e||e&&!e.parenthesis||e&&e.parenthesis===`keep`?`<span class="math-parenthesis math-round-parenthesis">(</span>`+this.content.toHTML(e)+`<span class="math-parenthesis math-round-parenthesis">)</span>`:this.content.toHTML(e)}_toTex(e){return!e||e&&!e.parenthesis||e&&e.parenthesis===`keep`?`\\left(${this.content.toTex(e)}\\right)`:this.content.toTex(e)}}return Ju(n,`name`,Nh),n},{isClass:!0,isNode:!0}),Fh=`RangeNode`,Ih=V(Fh,[`Node`],e=>{var{Node:t}=e;function n(e,t,n){var r=ih(e,t,n),i={},a=ih(e.start,t,n);if(i.start=a!==null&&a<=r||t===`all`,e.step){var o=ih(e.step,t,n);i.step=o!==null&&o<=r||t===`all`}var s=ih(e.end,t,n);return i.end=s!==null&&s<=r||t===`all`,i}class r extends t{constructor(e,t,n){if(super(),!we(e)||!we(t)||n&&!we(n))throw TypeError(`Node expected`);if(arguments.length>3)throw Error(`Too many arguments`);this.start=e,this.end=t,this.step=n||null}get type(){return Fh}get isRangeNode(){return!0}needsEnd(){return this.filter(function(e){return Ae(e)&&e.name===`end`}).length>0}_compile(e,t){var n=e.range,r=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,o){return n(r(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return n(r(e,t,a),i(e,t,a))}}forEach(e){e(this.start,`start`,this),e(this.end,`end`,this),this.step&&e(this.step,`step`,this)}map(e){return new r(this._ifNode(e(this.start,`start`,this)),this._ifNode(e(this.end,`end`,this)),this.step&&this._ifNode(e(this.step,`step`,this)))}clone(){return new r(this.start,this.end,this.step&&this.step)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,r=n(this,t,e&&e.implicit),i,a=this.start.toString(e);if(r.start&&(a=`(`+a+`)`),i=a,this.step){var o=this.step.toString(e);r.step&&(o=`(`+o+`)`),i+=`:`+o}var s=this.end.toString(e);return r.end&&(s=`(`+s+`)`),i+=`:`+s,i}toJSON(){return{mathjs:Fh,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new r(e.start,e.end,e.step)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,r=n(this,t,e&&e.implicit),i,a=this.start.toHTML(e);if(r.start&&(a=`<span class="math-parenthesis math-round-parenthesis">(</span>`+a+`<span class="math-parenthesis math-round-parenthesis">)</span>`),i=a,this.step){var o=this.step.toHTML(e);r.step&&(o=`<span class="math-parenthesis math-round-parenthesis">(</span>`+o+`<span class="math-parenthesis math-round-parenthesis">)</span>`),i+=`<span class="math-operator math-range-operator">:</span>`+o}var s=this.end.toHTML(e);return r.end&&(s=`<span class="math-parenthesis math-round-parenthesis">(</span>`+s+`<span class="math-parenthesis math-round-parenthesis">)</span>`),i+=`<span class="math-operator math-range-operator">:</span>`+s,i}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:`keep`,r=n(this,t,e&&e.implicit),i=this.start.toTex(e);if(r.start&&(i=`\\left(${i}\\right)`),this.step){var a=this.step.toTex(e);r.step&&(a=`\\left(${a}\\right)`),i+=`:`+a}var o=this.end.toTex(e);return r.end&&(o=`\\left(${o}\\right)`),i+=`:`+o,i}}return Ju(r,`name`,Fh),r},{isClass:!0,isNode:!0}),Lh=`RelationalNode`,Rh=V(Lh,[`Node`],e=>{var{Node:t}=e,n={equal:`==`,unequal:`!=`,smaller:`<`,larger:`>`,smallerEq:`<=`,largerEq:`>=`};class r extends t{constructor(e,t){if(super(),!Array.isArray(e))throw TypeError(`Parameter conditionals must be an array`);if(!Array.isArray(t))throw TypeError(`Parameter params must be an array`);if(e.length!==t.length-1)throw TypeError(`Parameter params must contain exactly one more element than parameter conditionals`);this.conditionals=e,this.params=t}get type(){return Lh}get isRelationalNode(){return!0}_compile(e,t){var n=this,r=this.params.map(n=>n._compile(e,t));return function(t,i,a){for(var o,s=r[0](t,i,a),c=0;c<n.conditionals.length;c++)if(o=s,s=r[c+1](t,i,a),!f(e,n.conditionals[c])(o,s))return!1;return!0}}forEach(e){this.params.forEach((t,n)=>e(t,`params[`+n+`]`,this),this)}map(e){return new r(this.conditionals.slice(),this.params.map((t,n)=>this._ifNode(e(t,`params[`+n+`]`,this)),this))}clone(){return new r(this.conditionals,this.params)}_toString(e){for(var t=e&&e.parenthesis?e.parenthesis:`keep`,r=ih(this,t,e&&e.implicit),i=this.params.map(function(n,i){var a=ih(n,t,e&&e.implicit);return t===`all`||a!==null&&a<=r?`(`+n.toString(e)+`)`:n.toString(e)}),a=i[0],o=0;o<this.conditionals.length;o++)a+=` `+n[this.conditionals[o]],a+=` `+i[o+1];return a}toJSON(){return{mathjs:Lh,conditionals:this.conditionals,params:this.params}}static fromJSON(e){return new r(e.conditionals,e.params)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:`keep`,r=ih(this,t,e&&e.implicit),i=this.params.map(function(n,i){var a=ih(n,t,e&&e.implicit);return t===`all`||a!==null&&a<=r?`<span class="math-parenthesis math-round-parenthesis">(</span>`+n.toHTML(e)+`<span class="math-parenthesis math-round-parenthesis">)</span>`:n.toHTML(e)}),a=i[0],o=0;o<this.conditionals.length;o++)a+=`<span class="math-operator math-binary-operator math-explicit-binary-operator">`+ui(n[this.conditionals[o]])+`</span>`+i[o+1];return a}_toTex(e){for(var t=e&&e.parenthesis?e.parenthesis:`keep`,n=ih(this,t,e&&e.implicit),r=this.params.map(function(r,i){var a=ih(r,t,e&&e.implicit);return t===`all`||a!==null&&a<=n?`\\left(`+r.toTex(e)+`\right)`:r.toTex(e)}),i=r[0],a=0;a<this.conditionals.length;a++)i+=gh[this.conditionals[a]]+r[a+1];return i}}return Ju(r,`name`,Lh),r},{isClass:!0,isNode:!0}),zh=V(`SymbolNode`,[`math`,`?Unit`,`Node`],e=>{var{math:t,Unit:n,Node:r}=e;function i(e){return n?n.isValuelessUnit(e):!1}class a extends r{constructor(e){if(super(),typeof e!=`string`)throw TypeError(`String expected for parameter "name"`);this.name=e}get type(){return`SymbolNode`}get isSymbolNode(){return!0}_compile(e,t){var r=this.name;if(t[r]===!0)return function(e,t,n){return f(t,r)};if(r in e)return function(t,n,i){return t.has(r)?t.get(r):f(e,r)};var o=i(r);return function(e,t,i){return e.has(r)?e.get(r):o?new n(null,r):a.onUndefinedSymbol(r)}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw Error(`Undefined symbol `+e)}clone(){return new a(this.name)}_toString(e){return this.name}_toHTML(e){var t=ui(this.name);return t===`true`||t===`false`?`<span class="math-symbol math-boolean">`+t+`</span>`:t===`i`?`<span class="math-symbol math-imaginary-symbol">`+t+`</span>`:t===`Infinity`?`<span class="math-symbol math-infinity-symbol">`+t+`</span>`:t===`NaN`?`<span class="math-symbol math-nan-symbol">`+t+`</span>`:t===`null`?`<span class="math-symbol math-null-symbol">`+t+`</span>`:t===`undefined`?`<span class="math-symbol math-undefined-symbol">`+t+`</span>`:`<span class="math-symbol">`+t+`</span>`}toJSON(){return{mathjs:`SymbolNode`,name:this.name}}static fromJSON(e){return new a(e.name)}_toTex(e){var n=!1;t[this.name]===void 0&&i(this.name)&&(n=!0);var r=xh(this.name,n);return r[0]===`\\`?r:` `+r}}return a},{isClass:!0,isNode:!0}),Bh=`FunctionNode`,Vh=V(Bh,[`math`,`Node`,`SymbolNode`],e=>{var t,{math:n,Node:r,SymbolNode:i}=e,a=e=>oi(e,{truncate:78});function o(e,t,n){for(var r=``,i=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,a=0,o;(o=i.exec(e))!==null;)if(r+=e.substring(a,o.index),a=o.index,o[0]===`$$`)r+=`$`,a++;else{a+=o[0].length;var s=t[o[1]];if(!s)throw ReferenceError(`Template: Property `+o[1]+` does not exist.`);if(o[2]===void 0)switch(typeof s){case`string`:r+=s;break;case`object`:if(we(s))r+=s.toTex(n);else if(Array.isArray(s))r+=s.map(function(e,t){if(we(e))return e.toTex(n);throw TypeError(`Template: `+o[1]+`[`+t+`] is not a Node.`)}).join(`,`);else throw TypeError(`Template: `+o[1]+` has to be a Node, String or array of Nodes`);break;default:throw TypeError(`Template: `+o[1]+` has to be a Node, String or array of Nodes`)}else if(we(s[o[2]]&&s[o[2]]))r+=s[o[2]].toTex(n);else throw TypeError(`Template: `+o[1]+`[`+o[2]+`] is not a Node.`)}return r+=e.slice(a),r}class s extends r{constructor(e,t,n){if(super(),typeof e==`string`&&(e=new i(e)),!we(e))throw TypeError(`Node expected as parameter "fn"`);if(!Array.isArray(t)||!t.every(we))throw TypeError(`Array containing Nodes expected for parameter "args"`);var r=typeof n;if(r!==`undefined`&&r!==`boolean`)throw TypeError(`optional flag, if specified, must be boolean`);this.fn=e,this.args=t||[],this.optional=!!n}get name(){return this.fn.name||``}get type(){return Bh}get isFunctionNode(){return!0}_compile(e,t){var n=this.args.map(n=>n._compile(e,t)),r=this.optional||me(this.fn)&&this.fn.optionalChaining;if(Ae(this.fn)){var i=this.fn.name;if(t[i]){var o=this.args;return function(t,s,c){var l=f(s,i);if(!(r&&l===void 0)){if(typeof l!=`function`)throw TypeError(`Argument '${i}' was not a function; received: ${a(l)}`);if(l.rawArgs)return l(o,e,Ah(t,s));var u=n.map(e=>e(t,s,c));return l.apply(l,u)}}}var c=i in e?f(e,i):void 0,l=typeof c==`function`&&c.rawArgs===!0,u=t=>{var n;if(t.has(i))n=t.get(i);else if(i in e)n=f(e,i);else if(r)n=void 0;else return s.onUndefinedFunction(i);if(typeof n==`function`||r&&n===void 0)return n;throw TypeError(`'${i}' is not a function; its value is:
|
|
15
|
+
${a(n)}`)};if(l){var d=this.args;return function(t,r,i){var a=u(t);return a.rawArgs===!0?a(d,e,Ah(t,r)):a(...n.map(e=>e(t,r,i)))}}switch(n.length){case 0:return function(e,t,n){var i=u(e);if(!(r&&i===void 0))return i()};case 1:return function(e,t,i){var a=u(e);if(!(r&&a===void 0)){var o=n[0];return a(o(e,t,i))}};case 2:return function(e,t,i){var a=u(e);if(!(r&&a===void 0)){var o=n[0],s=n[1];return a(o(e,t,i),s(e,t,i))}};default:return function(e,t,i){var a=u(e);if(!(r&&a===void 0))return a(...n.map(n=>n(e,t,i)))}}}else if(me(this.fn)&&Ce(this.fn.index)&&this.fn.index.isObjectProperty()){var p=this.fn.object._compile(e,t),m=this.fn.index.getObjectProperty(),h=this.args;return function(t,i,a){var o=p(t,i,a);if(!(r&&(o==null||o[m]===void 0))){var s=_(o,m);if(s!=null&&s.rawArgs)return s(h,e,Ah(t,i));var c=n.map(e=>e(t,i,a));return s.apply(o,c)}}}else{var g=this.fn.toString(),v=this.fn._compile(e,t),y=this.args;return function(t,i,o){var s=v(t,i,o);if(!(r&&s===void 0)){if(typeof s!=`function`)throw TypeError(`Expression '${g}' did not evaluate to a function; value is:
|
|
16
|
+
${a(s)}`);if(s.rawArgs)return s(y,e,Ah(t,i));var c=n.map(e=>e(t,i,o));return s.apply(s,c)}}}}forEach(e){e(this.fn,`fn`,this);for(var t=0;t<this.args.length;t++)e(this.args[t],`args[`+t+`]`,this)}map(e){for(var t=this._ifNode(e(this.fn,`fn`,this)),n=[],r=0;r<this.args.length;r++)n[r]=this._ifNode(e(this.args[r],`args[`+r+`]`,this));return new s(t,n)}clone(){return new s(this.fn,this.args.slice(0))}toString(e){var t,n=this.fn.toString(e);return e&&typeof e.handler==`object`&&z(e.handler,n)&&(t=e.handler[n](this,e)),t===void 0?super.toString(e):t}_toString(e){var t=this.args.map(function(t){return t.toString(e)});return(xe(this.fn)?`(`+this.fn.toString(e)+`)`:this.fn.toString(e))+`(`+t.join(`, `)+`)`}toJSON(){return{mathjs:Bh,fn:this.fn,args:this.args}}_toHTML(e){var t=this.args.map(function(t){return t.toHTML(e)});return`<span class="math-function">`+ui(this.fn)+`</span><span class="math-paranthesis math-round-parenthesis">(</span>`+t.join(`<span class="math-separator">,</span>`)+`<span class="math-paranthesis math-round-parenthesis">)</span>`}toTex(e){var t;return e&&typeof e.handler==`object`&&z(e.handler,this.name)&&(t=e.handler[this.name](this,e)),t===void 0?super.toTex(e):t}_toTex(e){var t=this.args.map(function(t){return t.toTex(e)}),r;_h[this.name]&&(r=_h[this.name]),n[this.name]&&(typeof n[this.name].toTex==`function`||typeof n[this.name].toTex==`object`||typeof n[this.name].toTex==`string`)&&(r=n[this.name].toTex);var i;switch(typeof r){case`function`:i=r(this,e);break;case`string`:i=o(r,this,e);break;case`object`:switch(typeof r[t.length]){case`function`:i=r[t.length](this,e);break;case`string`:i=o(r[t.length],this,e)}}return i===void 0?o(vh,this,e):i}getIdentifier(){return this.type+`:`+this.name}}return t=s,Ju(s,`name`,Bh),Ju(s,`onUndefinedFunction`,function(e){throw Error(`Undefined function `+e)}),Ju(s,`fromJSON`,function(e){return new t(e.fn,e.args)}),s},{isClass:!0,isNode:!0}),Hh=`parse`,Uh=V(Hh,[`typed`,`numeric`,`config`,`AccessorNode`,`ArrayNode`,`AssignmentNode`,`BlockNode`,`ConditionalNode`,`ConstantNode`,`FunctionAssignmentNode`,`FunctionNode`,`IndexNode`,`ObjectNode`,`OperatorNode`,`ParenthesisNode`,`RangeNode`,`RelationalNode`,`SymbolNode`],e=>{var{typed:t,numeric:n,config:r,AccessorNode:i,ArrayNode:a,AssignmentNode:o,BlockNode:s,ConditionalNode:c,ConstantNode:l,FunctionAssignmentNode:d,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:h,ParenthesisNode:g,RangeNode:_,RelationalNode:v,SymbolNode:y}=e,b=t(Hh,{string:function(e){return ne(e,{})},"Array | Matrix":function(e){return x(e,{})},"string, Object":function(e,t){return ne(e,t.nodes===void 0?{}:t.nodes)},"Array | Matrix, Object":x});function x(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.nodes===void 0?{}:t.nodes;return la(e,function(e){if(typeof e!=`string`)throw TypeError(`String expected`);return ne(e,n)})}var S={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},C={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"?.":!0,"??":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},w={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},T={true:!0,false:!1,null:null,undefined:void 0},E=[`NaN`,`Infinity`],D={'"':`"`,"'":`'`,"\\":`\\`,"/":`/`,b:`\b`,f:`\f`,n:`
|
|
17
|
+
`,r:`\r`,t:` `};function O(){return{extraNodes:{},expression:``,comment:``,index:0,token:``,tokenType:S.NULL,nestingLevel:0,conditionalLevel:null}}function k(e,t){return e.expression.substr(e.index,t)}function A(e){return k(e,1)}function j(e){e.index++}function M(e){return e.expression.charAt(e.index-1)}function N(e){return e.expression.charAt(e.index+1)}function P(e){for(e.tokenType=S.NULL,e.token=``,e.comment=``;;){if(A(e)===`#`)for(;A(e)!==`
|
|
18
|
+
`&&A(e)!==``;)e.comment+=A(e),j(e);if(b.isWhitespace(A(e),e.nestingLevel))j(e);else break}if(A(e)===``){e.tokenType=S.DELIMITER;return}if(A(e)===`
|
|
19
|
+
`&&!e.nestingLevel){e.tokenType=S.DELIMITER,e.token=A(e),j(e);return}var t=A(e),n=k(e,2),r=k(e,3);if(r.length===3&&C[r]){e.tokenType=S.DELIMITER,e.token=r,j(e),j(e),j(e);return}if(n.length===2&&C[n]&&(n!==`?.`||!b.isDigit(e.expression.charAt(e.index+2)))){e.tokenType=S.DELIMITER,e.token=n,j(e),j(e);return}if(C[t]){e.tokenType=S.DELIMITER,e.token=t,j(e);return}if(b.isDigitDot(t)){e.tokenType=S.NUMBER;var i=k(e,2);if(i===`0b`||i===`0o`||i===`0x`){for(e.token+=A(e),j(e),e.token+=A(e),j(e);b.isAlpha(A(e),M(e),N(e))||b.isDigit(A(e));)e.token+=A(e),j(e);if(A(e)===`.`)for(e.token+=`.`,j(e);b.isAlpha(A(e),M(e),N(e))||b.isDigit(A(e));)e.token+=A(e),j(e);else if(A(e)===`i`)for(e.token+=`i`,j(e);b.isDigit(A(e));)e.token+=A(e),j(e);return}if(A(e)===`.`){if(e.token+=A(e),j(e),!b.isDigit(A(e))){e.tokenType=S.DELIMITER;return}}else{for(;b.isDigit(A(e));)e.token+=A(e),j(e);b.isDecimalMark(A(e),N(e))&&(e.token+=A(e),j(e))}for(;b.isDigit(A(e));)e.token+=A(e),j(e);if(A(e)===`E`||A(e)===`e`){if(b.isDigit(N(e))||N(e)===`-`||N(e)===`+`){if(e.token+=A(e),j(e),(A(e)===`+`||A(e)===`-`)&&(e.token+=A(e),j(e)),!b.isDigit(A(e)))throw Be(e,`Digit expected, got "`+A(e)+`"`);for(;b.isDigit(A(e));)e.token+=A(e),j(e);if(b.isDecimalMark(A(e),N(e)))throw Be(e,`Digit expected, got "`+A(e)+`"`)}else if(b.isDecimalMark(N(e),e.expression.charAt(e.index+2)))throw j(e),Be(e,`Digit expected, got "`+A(e)+`"`)}return}if(b.isAlpha(A(e),M(e),N(e))){for(;b.isAlpha(A(e),M(e),N(e))||b.isDigit(A(e));)e.token+=A(e),j(e);e.tokenType=z(w,e.token)?S.DELIMITER:S.SYMBOL;return}for(e.tokenType=S.UNKNOWN;A(e)!==``;)e.token+=A(e),j(e);throw Be(e,`Syntax error in part "`+e.token+`"`)}function F(e){do P(e);while(e.token===`
|
|
20
|
+
`)}function ee(e){e.nestingLevel++}function te(e){e.nestingLevel--}b.isAlpha=function(e,t,n){return b.isValidLatinOrGreek(e)||b.isValidMathSymbol(e,n)||b.isValidMathSymbol(t,e)},b.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},b.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},b.isWhitespace=function(e,t){return e===` `||e===` `||e===`\xA0`||e===`
|
|
21
|
+
`&&t>0},b.isDecimalMark=function(e,t){return e===`.`&&t!==`/`&&t!==`*`&&t!==`^`},b.isDigitDot=function(e){return e>=`0`&&e<=`9`||e===`.`},b.isDigit=function(e){return e>=`0`&&e<=`9`};function ne(e,t){var n=O();u(n,{expression:e,extraNodes:t}),P(n);var r=re(n);if(n.token!==``)throw n.tokenType===S.DELIMITER?Ve(n,`Unexpected operator `+n.token):Be(n,`Unexpected part "`+n.token+`"`);return r}function re(e){var t,n=[],r;for(e.token!==``&&e.token!==`
|
|
22
|
+
`&&e.token!==`;`&&(t=ie(e),e.comment&&(t.comment=e.comment));e.token===`
|
|
23
|
+
`||e.token===`;`;)n.length===0&&t&&(r=e.token!==`;`,n.push({node:t,visible:r})),P(e),e.token!==`
|
|
24
|
+
`&&e.token!==`;`&&e.token!==``&&(t=ie(e),e.comment&&(t.comment=e.comment),r=e.token!==`;`,n.push({node:t,visible:r}));return n.length>0?new s(n):(t||(t=new l(void 0),e.comment&&(t.comment=e.comment)),t)}function ie(e){var t,n,r,i,a=ae(e);if(e.token===`=`){if(Ae(a))return t=a.name,F(e),r=ie(e),new o(new y(t),r);if(me(a)){if(a.optionalChaining)throw Be(e,`Cannot assign to optional chain`);return F(e),r=ie(e),new o(a.object,a.index,r)}if(Se(a)&&Ae(a.fn)&&(i=!0,n=[],t=a.name,a.args.forEach(function(e,t){Ae(e)?n[t]=e.name:i=!1}),i))return F(e),r=ie(e),new d(t,n,r);throw Be(e,`Invalid left hand side of assignment operator =`)}return a}function ae(e){for(var t=I(e);e.token===`?`;){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,F(e);var r=t,i=ie(e);if(e.token!==`:`)throw Be(e,`False part of conditional expression expected`);e.conditionalLevel=null,F(e),t=new c(r,i,ie(e)),e.conditionalLevel=n}return t}function I(e){for(var t=oe(e);e.token===`or`;)F(e),t=new h(`or`,`or`,[t,oe(e)]);return t}function oe(e){for(var t=L(e);e.token===`xor`;)F(e),t=new h(`xor`,`xor`,[t,L(e)]);return t}function L(e){for(var t=se(e);e.token===`and`;)F(e),t=new h(`and`,`and`,[t,se(e)]);return t}function se(e){for(var t=ce(e);e.token===`|`;)F(e),t=new h(`|`,`bitOr`,[t,ce(e)]);return t}function ce(e){for(var t=R(e);e.token===`^|`;)F(e),t=new h(`^|`,`bitXor`,[t,R(e)]);return t}function R(e){for(var t=le(e);e.token===`&`;)F(e),t=new h(`&`,`bitAnd`,[t,le(e)]);return t}function le(e){for(var t=[ue(e)],n=[],r={"==":`equal`,"!=":`unequal`,"<":`smaller`,">":`larger`,"<=":`smallerEq`,">=":`largerEq`};z(r,e.token);){var i={name:e.token,fn:r[e.token]};n.push(i),F(e),t.push(ue(e))}return t.length===1?t[0]:t.length===2?new h(n[0].name,n[0].fn,t):new v(n.map(e=>e.fn),t)}function ue(e){for(var t=de(e),n,r,i,a={"<<":`leftShift`,">>":`rightArithShift`,">>>":`rightLogShift`};z(a,e.token);)n=e.token,r=a[n],F(e),i=[t,de(e)],t=new h(n,r,i);return t}function de(e){for(var t=fe(e),n,r,i,a={to:`to`,in:`to`};z(a,e.token);)n=e.token,r=a[n],F(e),n===`in`&&`])},;`.includes(e.token)?t=new h(`*`,`multiply`,[t,new y(`in`)],!0):(i=[t,fe(e)],t=new h(n,r,i));return t}function fe(e){var t,n=[];if(e.token===`:`){if(e.conditionalLevel===e.nestingLevel)throw Be(e,`The true-expression of a conditional operator may not be empty`);t=new l(1)}else t=pe(e);if(e.token===`:`&&e.conditionalLevel!==e.nestingLevel){for(n.push(t);e.token===`:`&&n.length<3;)F(e),e.token===`)`||e.token===`]`||e.token===`,`||e.token===``?n.push(new y(`end`)):n.push(pe(e));t=n.length===3?new _(n[0],n[2],n[1]):new _(n[0],n[1])}return t}function pe(e){for(var t=he(e),n,r,i,a={"+":`add`,"-":`subtract`};z(a,e.token);){n=e.token,r=a[n],F(e);var o=he(e);i=o.isPercentage?[t,new h(`*`,`multiply`,[t,o])]:[t,o],t=new h(n,r,i)}return t}function he(e){for(var t=ge(e),n=t,r,i,a={"*":`multiply`,".*":`dotMultiply`,"/":`divide`,"./":`dotDivide`,"%":`mod`,mod:`mod`};z(a,e.token);)r=e.token,i=a[r],F(e),n=ge(e),t=new h(r,i,[t,n]);return t}function ge(e){for(var t=_e(e),n=t;e.tokenType===S.SYMBOL||e.token===`in`&&ye(t)||e.token===`in`&&Ee(t)&&t.fn===`unaryMinus`&&ye(t.args[0])||e.tokenType===S.NUMBER&&!ye(n)&&(!Ee(n)||n.op===`!`)||e.token===`(`;)n=_e(e),t=new h(`*`,`multiply`,[t,n],!0);return t}function _e(e){for(var t=ve(e),n=t,r=[];e.token===`/`&&be(n);)if(r.push(u({},e)),F(e),e.tokenType===S.NUMBER)if(r.push(u({},e)),F(e),e.tokenType===S.SYMBOL||e.token===`(`||e.token===`in`)u(e,r.pop()),r.pop(),n=ve(e),t=new h(`/`,`divide`,[t,n]);else{r.pop(),u(e,r.pop());break}else{u(e,r.pop());break}return t}function ve(e){var t=xe(e);if(e.token===`%`){var n=u({},e);F(e);try{xe(e),u(e,n)}catch{t=new h(`/`,`divide`,[t,new l(100)],!1,!0)}}return t}function xe(e){var t,n,r,i={"-":`unaryMinus`,"+":`unaryPlus`,"~":`bitNot`,not:`not`};return z(i,e.token)?(r=i[e.token],t=e.token,F(e),n=[xe(e)],new h(t,r,n)):Ce(e)}function Ce(e){var t=we(e),n,r,i;return(e.token===`^`||e.token===`.^`)&&(n=e.token,r=n===`^`?`pow`:`dotPow`,F(e),i=[t,xe(e)],t=new h(n,r,i)),t}function we(e){for(var t=Te(e);e.token===`??`;)F(e),t=new h(`??`,`nullish`,[t,Te(e)]);return t}function Te(e){for(var t=De(e),n,r,i,a={"!":`factorial`,"'":`ctranspose`};z(a,e.token);)n=e.token,r=a[n],P(e),i=[t],t=new h(n,r,i),t=ke(e,t);return t}function De(e){var t=[];if(e.tokenType===S.SYMBOL&&z(e.extraNodes,e.token)){var n=e.extraNodes[e.token];if(P(e),e.token===`(`){if(t=[],ee(e),P(e),e.token!==`)`)for(t.push(ie(e));e.token===`,`;)P(e),t.push(ie(e));if(e.token!==`)`)throw Be(e,`Parenthesis ) expected`);te(e),P(e)}return new n(t)}return Oe(e)}function Oe(e){var t,r;return e.tokenType===S.SYMBOL||e.tokenType===S.DELIMITER&&e.token in w?(r=e.token,P(e),t=z(T,r)?new l(T[r]):E.includes(r)?new l(n(r,`number`)):new y(r),t=ke(e,t),t):je(e)}function ke(e,t,n){for(var r;;){var a=!1;e.token===`?.`&&(a=!0,P(e));var o=(e.token===`(`||e.token===`[`||e.token===`.`)&&(!n||n.includes(e.token));if(!(a||o))break;if(r=[],e.token===`(`)if(a||Ae(t)||me(t)){if(ee(e),P(e),e.token!==`)`)for(r.push(ie(e));e.token===`,`;)P(e),r.push(ie(e));if(e.token!==`)`)throw Be(e,`Parenthesis ) expected`);te(e),P(e),t=new f(t,r,a)}else return t;else if(e.token===`[`){if(ee(e),P(e),e.token!==`]`)for(r.push(ie(e));e.token===`,`;)P(e),r.push(ie(e));if(e.token!==`]`)throw Be(e,`Parenthesis ] expected`);te(e),P(e),t=new i(t,new p(r),a)}else{if(a||P(e),!(e.tokenType===S.SYMBOL||e.tokenType===S.DELIMITER&&e.token in w)){var s=`Property name expected after `;throw s+=a?`optional chain`:`dot`,Be(e,s)}r.push(new l(e.token)),P(e),t=new i(t,new p(r,!0),a)}}return t}function je(e){var t,n;return e.token===`"`||e.token===`'`?(n=Me(e,e.token),t=new l(n),t=ke(e,t),t):Ne(e)}function Me(e,t){for(var n=``;A(e)!==``&&A(e)!==t;)if(A(e)===`\\`){j(e);var r=A(e),i=D[r];if(i!==void 0)n+=i,e.index+=1;else if(r===`u`){var a=e.expression.slice(e.index+1,e.index+5);if(/^[0-9A-Fa-f]{4}$/.test(a))n+=String.fromCharCode(parseInt(a,16)),e.index+=5;else throw Be(e,`Invalid unicode character \\u${a}`)}else throw Be(e,`Bad escape character \\${r}`)}else n+=A(e),j(e);if(P(e),e.token!==t)throw Be(e,`End of string ${t} expected`);return P(e),n}function Ne(e){var t,n,r,i;if(e.token===`[`){if(ee(e),P(e),e.token!==`]`){var o=Pe(e);if(e.token===`;`){for(r=1,n=[o];e.token===`;`;)P(e),e.token!==`]`&&(n[r]=Pe(e),r++);if(e.token!==`]`)throw Be(e,`End of matrix ] expected`);te(e),P(e),i=n[0].items.length;for(var s=1;s<r;s++)if(n[s].items.length!==i)throw Ve(e,`Column dimensions mismatch (`+n[s].items.length+` !== `+i+`)`);t=new a(n)}else{if(e.token!==`]`)throw Be(e,`End of matrix ] expected`);te(e),P(e),t=o}}else te(e),P(e),t=new a([]);return ke(e,t)}return Fe(e)}function Pe(e){for(var t=[ie(e)],n=1;e.token===`,`;)P(e),e.token!==`]`&&e.token!==`;`&&(t[n]=ie(e),n++);return new a(t)}function Fe(e){if(e.token===`{`){ee(e);var t,n={};do if(P(e),e.token!==`}`){if(e.token===`"`||e.token===`'`)t=Me(e,e.token);else if(e.tokenType===S.SYMBOL||e.tokenType===S.DELIMITER&&e.token in w)t=e.token,P(e);else throw Be(e,`Symbol or string expected as object key`);if(e.token!==`:`)throw Be(e,`Colon : expected after object key`);P(e),n[t]=ie(e)}while(e.token===`,`);if(e.token!==`}`)throw Be(e,`Comma , or bracket } expected after object value`);te(e),P(e);var r=new m(n);return r=ke(e,r),r}return Ie(e)}function Ie(e){var t;if(e.tokenType===S.NUMBER){t=e.token,P(e);var i=Qe(t,r);return new l(n(t,i))}return Le(e)}function Le(e){var t;if(e.token===`(`){if(ee(e),P(e),t=ie(e),e.token!==`)`)throw Be(e,`Parenthesis ) expected`);return te(e),P(e),t=new g(t),t=ke(e,t),t}return Re(e)}function Re(e){throw e.token===``?Be(e,`Unexpected end of expression`):Be(e,`Value expected`)}function ze(e){return e.index-e.token.length+1}function Be(e,t){var n=ze(e),r=SyntaxError(t+` (char `+n+`)`);return r.char=n,r}function Ve(e,t){var n=ze(e),r=SyntaxError(t+` (char `+n+`)`);return r.char=n,r}return t.addConversion({from:`string`,to:`Node`,convert:b}),b}),Wh=`compile`,Gh=V(Wh,[`typed`,`parse`],e=>{var{typed:t,parse:n}=e;return t(Wh,{string:function(e){return n(e).compile()},"Array | Matrix":function(e){return la(e,function(e){return n(e).compile()})}})}),Kh=`evaluate`,qh=V(Kh,[`typed`,`parse`],e=>{var{typed:t,parse:n}=e;return t(Kh,{string:function(e){var t=w();return n(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=w();return la(e,function(e){return n(e).compile().evaluate(t)})},"Array | Matrix, Map | Object":function(e,t){return la(e,function(e){return n(e).compile().evaluate(t)})}})}),Jh=V(`Parser`,[`evaluate`,`parse`],e=>{var{evaluate:t,parse:n}=e;function r(){if(!(this instanceof r))throw SyntaxError(`Constructor must be called with the new operator`);Object.defineProperty(this,"scope",{value:w(),writable:!1})}r.prototype.type=`Parser`,r.prototype.isParser=!0,r.prototype.evaluate=function(e){return t(e,this.scope)},r.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},r.prototype.getAll=function(){return E(this.scope)},r.prototype.getAllAsMap=function(){return this.scope};function i(e){if(e.length===0)return!1;for(var t=0;t<e.length;t++){var r=e.charAt(t-1),i=e.charAt(t),a=e.charAt(t+1);if(!(n.isAlpha(i,r,a)||t>0&&n.isDigit(i)))return!1}return!0}return r.prototype.set=function(e,t){if(!i(e))throw Error(`Invalid variable name: '${e}'. Variable names must follow the specified rules.`);return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r.prototype.toJSON=function(){var e={mathjs:`Parser`,variables:{},functions:{}};for(var[t,n]of this.scope)if(L(n)){if(!Yh(n))throw Error(`Cannot serialize external function ${t}`);e.functions[t]=`${n.syntax} = ${n.expr}`}else e.variables[t]=n;return e},r.fromJSON=function(e){var t=new r;return Object.entries(e.variables).forEach(e=>{var[n,r]=e;return t.set(n,r)}),Object.entries(e.functions).forEach(e=>{var[n,r]=e;return t.evaluate(r)}),t},r},{isClass:!0});function Yh(e){return typeof e==`function`&&typeof e.syntax==`string`&&typeof e.expr==`string`}var Xh=`parser`,Zh=V(Xh,[`typed`,`Parser`],e=>{var{typed:t,Parser:n}=e;return t(Xh,{"":function(){return new n}})}),Qh=`lup`,$h=V(Qh,[`typed`,`matrix`,`abs`,`addScalar`,`divideScalar`,`multiplyScalar`,`subtractScalar`,`larger`,`equalScalar`,`unaryMinus`,`DenseMatrix`,`SparseMatrix`,`Spa`],e=>{var{typed:t,matrix:n,abs:r,addScalar:i,divideScalar:a,multiplyScalar:o,subtractScalar:s,larger:c,equalScalar:l,unaryMinus:u,DenseMatrix:d,SparseMatrix:f,Spa:p}=e;return t(Qh,{DenseMatrix:function(e){return m(e)},SparseMatrix:function(e){return h(e)},Array:function(e){var t=m(n(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function m(e){var t=e._size[0],n=e._size[1],u=Math.min(t,n),f=Ne(e._data),p=[],m=[t,u],h=[],g=[u,n],_,v,y,b=[];for(_=0;_<t;_++)b[_]=_;for(v=0;v<n;v++){if(v>0)for(_=0;_<t;_++){var x=Math.min(_,v),S=0;for(y=0;y<x;y++)S=i(S,o(f[_][y],f[y][v]));f[_][v]=s(f[_][v],S)}var C=v,w=0,T=0;for(_=v;_<t;_++){var E=f[_][v],D=r(E);c(D,w)&&(C=_,w=D,T=E)}if(v!==C&&(b[v]=[b[C],b[C]=b[v]][0],d._swapRows(v,C,f)),v<t)for(_=v+1;_<t;_++){var O=f[_][v];l(O,0)||(f[_][v]=a(f[_][v],T))}}for(v=0;v<n;v++)for(_=0;_<t;_++){if(v===0&&(_<n&&(h[_]=[]),p[_]=[]),_<v){_<n&&(h[_][v]=f[_][v]),v<t&&(p[_][v]=0);continue}if(_===v){_<n&&(h[_][v]=f[_][v]),v<t&&(p[_][v]=1);continue}_<n&&(h[_][v]=0),v<t&&(p[_][v]=f[_][v])}var k=new d({data:p,size:m}),A=new d({data:h,size:g}),j=[];for(_=0,u=b.length;_<u;_++)j[b[_]]=_;return{L:k,U:A,p:j,toString:function(){return`L: `+this.L.toString()+`
|
|
25
|
+
U: `+this.U.toString()+`
|
|
26
|
+
P: `+this.p}}}function h(e){var t=e._size[0],n=e._size[1],i=Math.min(t,n),s=e._values,d=e._index,m=e._ptr,h=[],g=[],_=[],v=[t,i],y=[],b=[],x=[],S=[i,n],C,w,T,E=[],D=[];for(C=0;C<t;C++)E[C]=C,D[C]=C;var O=function(e,t){var n=D[e],r=D[t];E[n]=t,E[r]=e,D[e]=r,D[t]=n},k=function(){var e=new p;w<t&&(_.push(h.length),h.push(1),g.push(w)),x.push(y.length);var n=m[w],i=m[w+1];for(T=n;T<i;T++)C=d[T],e.set(E[C],s[T]);w>0&&e.forEach(0,w-1,function(t,n){f._forEachRow(t,h,g,_,function(r,i){r>t&&e.accumulate(r,u(o(i,n)))})});var D=w,k=e.get(w),A=r(k);e.forEach(w+1,t-1,function(e,t){var n=r(t);c(n,A)&&(D=e,A=n,k=t)}),w!==D&&(f._swapRows(w,D,v[1],h,g,_),f._swapRows(w,D,S[1],y,b,x),e.swap(w,D),O(w,D)),e.forEach(0,t-1,function(e,t){e<=w?(y.push(t),b.push(e)):(t=a(t,k),l(t,0)||(h.push(t),g.push(e)))})};for(w=0;w<n;w++)k();return x.push(y.length),_.push(h.length),{L:new f({values:h,index:g,ptr:_,size:v}),U:new f({values:y,index:b,ptr:x,size:S}),p:E,toString:function(){return`L: `+this.L.toString()+`
|
|
27
|
+
U: `+this.U.toString()+`
|
|
28
|
+
P: `+this.p}}}}),eg=`qr`,tg=V(eg,[`typed`,`matrix`,`zeros`,`identity`,`isZero`,`equal`,`sign`,`sqrt`,`conj`,`unaryMinus`,`addScalar`,`divideScalar`,`multiplyScalar`,`subtractScalar`,`complex`],e=>{var{typed:t,matrix:n,zeros:r,identity:i,isZero:a,equal:o,sign:s,sqrt:c,conj:l,unaryMinus:d,addScalar:f,divideScalar:p,multiplyScalar:m,subtractScalar:h,complex:g}=e;return u(t(eg,{DenseMatrix:function(e){return v(e)},SparseMatrix:function(e){return y(e)},Array:function(e){var t=v(n(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:_});function _(e){var t=e._size[0],n=e._size[1],u=i([t],`dense`),g=u._data,_=e.clone(),v=_._data,y,b,x,S=r([t],``);for(x=0;x<Math.min(n,t);++x){var C=v[x][x],w=d(o(C,0)?1:s(C)),T=l(w),E=0;for(y=x;y<t;y++)E=f(E,m(v[y][x],l(v[y][x])));var D=m(w,c(E));if(!a(D)){var O=h(C,D);for(S[x]=1,y=x+1;y<t;y++)S[y]=p(v[y][x],O);var k=d(l(p(O,D))),A=void 0;for(b=x;b<n;b++){for(A=0,y=x;y<t;y++)A=f(A,m(l(S[y]),v[y][b]));for(A=m(A,k),y=x;y<t;y++)v[y][b]=m(h(v[y][b],m(S[y],A)),T)}for(y=0;y<t;y++){for(A=0,b=x;b<t;b++)A=f(A,m(g[y][b],S[b]));for(A=m(A,k),b=x;b<t;++b)g[y][b]=p(h(g[y][b],m(A,l(S[b]))),T)}}}return{Q:u,R:_,toString:function(){return`Q: `+this.Q.toString()+`
|
|
29
|
+
R: `+this.R.toString()}}}function v(e){var t=_(e),n=t.R._data;if(e._data.length>0)for(var r=n[0][0].type===`Complex`?g(0):0,i=0;i<n.length;++i)for(var a=0;a<i&&a<(n[0]||[]).length;++a)n[i][a]=r;return t}function y(e){throw Error(`qr not implemented for sparse matrices yet`)}});function ng(e,t,n,r){for(var i=e._values,a=e._index,o=e._ptr,s=e._size,c=e._datatype,l=s[0],u=s[1],d=r&&e._values?[]:null,f=[],p=[],m=0,h=0;h<u;h++){p[h]=m;for(var g=n?n[h]:h,_=o[g],v=o[g+1],y=_;y<v;y++){var b=t?t[a[y]]:a[y];f[m]=b,d&&(d[m]=i[y]),m++}}return p[u]=m,e.createSparseMatrix({values:d,index:f,ptr:p,size:[l,u],datatype:c})}function rg(e,t,n,r,i,a,o){var s=0;for(n[o]=e;s>=0;){var c=n[o+s],l=n[r+c];l===-1?(s--,a[t++]=c):(n[r+c]=n[i+l],++s,n[o+s]=l)}return t}function ig(e,t){if(!e)return null;var n=0,r,i=[],a=[],o=0,s=t,c=2*t;for(r=0;r<t;r++)a[o+r]=-1;for(r=t-1;r>=0;r--)e[r]!==-1&&(a[s+r]=a[o+e[r]],a[o+e[r]]=r);for(r=0;r<t;r++)e[r]===-1&&(n=rg(r,n,a,o,s,i,c));return i}function ag(e,t){if(!e)return null;var n=e._index,r=e._ptr,i=e._size,a=i[0],o=i[1],s=[],c=[],l=0,u=o,d,f;if(t)for(d=0;d<a;d++)c[u+d]=-1;for(var p=0;p<o;p++){s[p]=-1,c[l+p]=-1;for(var m=r[p],h=r[p+1],g=m;g<h;g++){var _=n[g];for(d=t?c[u+_]:_;d!==-1&&d<p;d=f)f=c[l+d],c[l+d]=p,f===-1&&(s[d]=p);t&&(c[u+_]=p)}}return s}function og(e,t,n){for(var r=e._values,i=e._index,a=e._ptr,o=e._size[1],s=0,c=0;c<o;c++){var l=a[c];for(a[c]=s;l<a[c+1];l++)t(i[l],c,r?r[l]:1,n)&&(i[s]=i[l],r&&(r[s]=r[l]),s++)}return a[o]=s,i.splice(s,i.length-s),r&&r.splice(s,r.length-s),s}function sg(e){return-e-2}var cg=V(`csAmd`,[`add`,`multiply`,`transpose`],e=>{var{add:t,multiply:n,transpose:r}=e;return function(e,t){if(!t||e<=0||e>3)return null;var n=t._size,r=n[0],l=n[1],u=0,d=Math.max(16,10*Math.sqrt(l));d=Math.min(l-2,d);var f=i(e,t,r,l,d);og(f,c,null);for(var p=f._index,m=f._ptr,h=m[l],g=[],_=[],v=0,y=l+1,b=2*(l+1),x=3*(l+1),S=4*(l+1),C=5*(l+1),w=6*(l+1),T=7*(l+1),E=g,D=a(l,m,_,v,x,E,b,T,y,w,S,C),O=o(l,m,_,C,S,w,d,y,x,E,b),k=0,A,j,M,N,P,F,ee,te,ne,re,ie,ae,I,oe,L,se;O<l;){for(M=-1;k<l&&(M=_[x+k])===-1;k++);_[b+M]!==-1&&(E[_[b+M]]=-1),_[x+k]=_[b+M];var ce=_[S+M],R=_[y+M];O+=R;var le=0;_[y+M]=-R;var ue=m[M],de=ce===0?ue:h,fe=de;for(N=1;N<=ce+1;N++){for(N>ce?(F=M,ee=ue,te=_[v+M]-ce):(F=p[ue++],ee=m[F],te=_[v+F]),P=1;P<=te;P++)A=p[ee++],!((ne=_[y+A])<=0)&&(le+=ne,_[y+A]=-ne,p[fe++]=A,_[b+A]!==-1&&(E[_[b+A]]=E[A]),E[A]===-1?_[x+_[C+A]]=_[b+A]:_[b+E[A]]=_[b+A]);F!==M&&(m[F]=sg(M),_[w+F]=0)}for(ce!==0&&(h=fe),_[C+M]=le,m[M]=de,_[v+M]=fe-de,_[S+M]=-2,D=s(D,u,_,w,l),re=de;re<fe;re++)if(A=p[re],!((ie=_[S+A])<=0)){ne=-_[y+A];var pe=D-ne;for(ue=m[A],ae=m[A]+ie-1;ue<=ae;ue++)F=p[ue],_[w+F]>=D?_[w+F]-=ne:_[w+F]!==0&&(_[w+F]=_[C+F]+pe)}for(re=de;re<fe;re++){for(A=p[re],ae=m[A],I=ae+_[S+A]-1,oe=ae,L=0,se=0,ue=ae;ue<=I;ue++)if(F=p[ue],_[w+F]!==0){var me=_[w+F]-D;me>0?(se+=me,p[oe++]=F,L+=F):(m[F]=sg(M),_[w+F]=0)}_[S+A]=oe-ae+1;var he=oe,ge=ae+_[v+A];for(ue=I+1;ue<ge;ue++){j=p[ue];var _e=_[y+j];_e<=0||(se+=_e,p[oe++]=j,L+=j)}se===0?(m[A]=sg(M),ne=-_[y+A],le-=ne,R+=ne,O+=ne,_[y+A]=0,_[S+A]=-1):(_[C+A]=Math.min(_[C+A],se),p[oe]=p[he],p[he]=p[ae],p[ae]=M,_[v+A]=oe-ae+1,L=(L<0?-L:L)%l,_[b+A]=_[T+L],_[T+L]=A,E[A]=L)}for(_[C+M]=le,u=Math.max(u,le),D=s(D+u,u,_,w,l),re=de;re<fe;re++)if(A=p[re],!(_[y+A]>=0))for(L=E[A],A=_[T+L],_[T+L]=-1;A!==-1&&_[b+A]!==-1;A=_[b+A],D++){for(te=_[v+A],ie=_[S+A],ue=m[A]+1;ue<=m[A]+te-1;ue++)_[w+p[ue]]=D;var ve=A;for(j=_[b+A];j!==-1;){var ye=_[v+j]===te&&_[S+j]===ie;for(ue=m[j]+1;ye&&ue<=m[j]+te-1;ue++)_[w+p[ue]]!==D&&(ye=0);ye?(m[j]=sg(A),_[y+A]+=_[y+j],_[y+j]=0,_[S+j]=-1,j=_[b+j],_[b+ve]=j):(ve=j,j=_[b+j])}}for(ue=de,re=de;re<fe;re++)A=p[re],!((ne=-_[y+A])<=0)&&(_[y+A]=ne,se=_[C+A]+le-ne,se=Math.min(se,l-O-ne),_[x+se]!==-1&&(E[_[x+se]]=A),_[b+A]=_[x+se],E[A]=-1,_[x+se]=A,k=Math.min(k,se),_[C+A]=se,p[ue++]=A);_[y+M]=R,(_[v+M]=ue-de)===0&&(m[M]=-1,_[w+M]=0),ce!==0&&(h=ue)}for(A=0;A<l;A++)m[A]=sg(m[A]);for(j=0;j<=l;j++)_[x+j]=-1;for(j=l;j>=0;j--)_[y+j]>0||(_[b+j]=_[x+m[j]],_[x+m[j]]=j);for(F=l;F>=0;F--)_[y+F]<=0||m[F]!==-1&&(_[b+F]=_[x+m[F]],_[x+m[F]]=F);for(M=0,A=0;A<=l;A++)m[A]===-1&&(M=rg(A,M,_,x,b,g,w));return g.splice(g.length-1,1),g};function i(e,i,a,o,s){var c=r(i);if(e===1&&o===a)return t(i,c);if(e===2){for(var l=c._index,u=c._ptr,d=0,f=0;f<a;f++){var p=u[f];if(u[f]=d,!(u[f+1]-p>s))for(var m=u[f+1];p<m;p++)l[d++]=l[p]}return u[a]=d,i=r(c),n(c,i)}return n(c,i)}function a(e,t,n,r,i,a,o,c,l,u,d,f){for(var p=0;p<e;p++)n[r+p]=t[p+1]-t[p];n[r+e]=0;for(var m=0;m<=e;m++)n[i+m]=-1,a[m]=-1,n[o+m]=-1,n[c+m]=-1,n[l+m]=1,n[u+m]=1,n[d+m]=0,n[f+m]=n[r+m];var h=s(0,0,n,u,e);return n[d+e]=-2,t[e]=-1,n[u+e]=0,h}function o(e,t,n,r,i,a,o,s,c,l,u){for(var d=0,f=0;f<e;f++){var p=n[r+f];if(p===0)n[i+f]=-2,d++,t[f]=-1,n[a+f]=0;else if(p>o)n[s+f]=0,n[i+f]=-1,d++,t[f]=sg(e),n[s+e]++;else{var m=n[c+p];m!==-1&&(l[m]=f),n[u+f]=n[c+p],n[c+p]=f}}return d}function s(e,t,n,r,i){if(e<2||e+t<0){for(var a=0;a<i;a++)n[r+a]!==0&&(n[r+a]=1);e=2}return e}function c(e,t){return e!==t}});function lg(e,t,n,r,i,a,o){var s,c,l=0,u;if(e<=t||n[r+t]<=n[i+e])return-1;n[i+e]=n[r+t];var d=n[a+e];if(n[a+e]=t,d===-1)l=1,u=e;else{for(l=2,u=d;u!==n[o+u];u=n[o+u]);for(s=d;s!==u;s=c)c=n[o+s],n[o+s]=u}return{jleaf:l,q:u}}var ug=V(`csCounts`,[`transpose`],e=>{var{transpose:t}=e;return function(e,n,r,i){if(!e||!n||!r)return null;var a=e._size,o=a[0],s=a[1],c,l,u,d,f,p,m,h=4*s+(i?s+o+1:0),g=[],_=0,v=s,y=2*s,b=3*s,x=4*s,S=5*s+1;for(u=0;u<h;u++)g[u]=-1;var C=[],w=t(e),T=w._index,E=w._ptr;for(u=0;u<s;u++)for(l=r[u],C[l]=+(g[b+l]===-1);l!==-1&&g[b+l]===-1;l=n[l])g[b+l]=u;if(i){for(u=0;u<s;u++)g[r[u]]=u;for(c=0;c<o;c++){for(u=s,p=E[c],m=E[c+1],f=p;f<m;f++)u=Math.min(u,g[T[f]]);g[S+c]=g[x+u],g[x+u]=c}}for(c=0;c<s;c++)g[_+c]=c;for(u=0;u<s;u++){for(l=r[u],n[l]!==-1&&C[n[l]]--,d=i?g[x+u]:l;d!==-1;d=i?g[S+d]:-1)for(f=E[d];f<E[d+1];f++){c=T[f];var D=lg(c,l,g,b,v,y,_);D.jleaf>=1&&C[l]++,D.jleaf===2&&C[D.q]--}n[l]!==-1&&(g[_+l]=n[l])}for(l=0;l<s;l++)n[l]!==-1&&(C[n[l]]+=C[l]);return C}}),dg=V(`csSqr`,[`add`,`multiply`,`transpose`],e=>{var{add:t,multiply:n,transpose:r}=e,i=cg({add:t,multiply:n,transpose:r}),a=ug({transpose:r});return function(e,t,n){var r=t._ptr,s=t._size[1],c,l={};if(l.q=i(e,t),e&&!l.q)return null;if(n){var u=e?ng(t,null,l.q,0):t;l.parent=ag(u,1);var d=ig(l.parent,s);if(l.cp=a(u,l.parent,d,1),u&&l.parent&&l.cp&&o(u,l))for(l.unz=0,c=0;c<s;c++)l.unz+=l.cp[c]}else l.unz=4*r[s]+s,l.lnz=l.unz;return l};function o(e,t){var n=e._ptr,r=e._index,i=e._size,a=i[0],o=i[1];t.pinv=[],t.leftmost=[];var s=t.parent,c=t.pinv,l=t.leftmost,u=[],d=0,f=a,p=a+o,m=a+2*o,h,g,_,v,y;for(g=0;g<o;g++)u[f+g]=-1,u[p+g]=-1,u[m+g]=0;for(h=0;h<a;h++)l[h]=-1;for(g=o-1;g>=0;g--)for(v=n[g],y=n[g+1],_=v;_<y;_++)l[r[_]]=g;for(h=a-1;h>=0;h--)c[h]=-1,g=l[h],g!==-1&&(u[m+g]++===0&&(u[p+g]=h),u[d+h]=u[f+g],u[f+g]=h);for(t.lnz=0,t.m2=a,g=0;g<o;g++)if(h=u[f+g],t.lnz++,h<0&&(h=t.m2++),c[h]=g,!(--m[g]<=0)){t.lnz+=u[m+g];var b=s[g];b!==-1&&(u[m+b]===0&&(u[p+b]=u[p+g]),u[d+u[p+g]]=u[f+b],u[f+b]=u[d+h],u[m+b]+=u[m+g])}for(h=0;h<a;h++)c[h]<0&&(c[h]=g++);return!0}});function fg(e,t){return e[t]<0}function pg(e,t){e[t]=sg(e[t])}function mg(e){return e<0?sg(e):e}function hg(e,t,n,r,i){var a=t._index,o=t._ptr,s=t._size[1],c,l,u,d=0;for(r[0]=e;d>=0;){e=r[d];var f=i?i[e]:e;fg(o,e)||(pg(o,e),r[s+d]=f<0?0:mg(o[f]));var p=1;for(l=r[s+d],u=f<0?0:mg(o[f+1]);l<u;l++)if(c=a[l],!fg(o,c)){r[s+d]=l,r[++d]=c,p=0;break}p&&(d--,r[--n]=e)}return n}function gg(e,t,n,r,i){var a=e._ptr,o=e._size,s=t._index,c=t._ptr,l=o[1],u,d,f,p=l;for(d=c[n],f=c[n+1],u=d;u<f;u++){var m=s[u];fg(a,m)||(p=hg(m,e,p,r,i))}for(u=p;u<l;u++)pg(a,r[u]);return p}var _g=V(`csSpsolve`,[`divideScalar`,`multiply`,`subtract`],e=>{var{divideScalar:t,multiply:n,subtract:r}=e;return function(e,i,a,o,s,c,l){var u=e._values,d=e._index,f=e._ptr,p=e._size[1],m=i._values,h=i._index,g=i._ptr,_,v,y,b,x=gg(e,i,a,o,c);for(_=x;_<p;_++)s[o[_]]=0;for(v=g[a],y=g[a+1],_=v;_<y;_++)s[h[_]]=m[_];for(var S=x;S<p;S++){var C=o[S],w=c?c[C]:C;if(!(w<0))for(v=f[w],y=f[w+1],s[C]=t(s[C],u[l?v:y-1]),_=l?v+1:v,b=l?y:y-1;_<b;_++){var T=d[_];s[T]=r(s[T],n(u[_],s[C]))}}return x}}),vg=V(`csLu`,[`abs`,`divideScalar`,`multiply`,`subtract`,`larger`,`largerEq`,`SparseMatrix`],e=>{var{abs:t,divideScalar:n,multiply:r,subtract:i,larger:a,largerEq:o,SparseMatrix:s}=e,c=_g({divideScalar:n,multiply:r,subtract:i});return function(e,i,l){if(!e)return null;var u=e._size[1],d,f=100,p=100;i&&(d=i.q,f=i.lnz||f,p=i.unz||p);var m=[],h=[],g=[],_=new s({values:m,index:h,ptr:g,size:[u,u]}),v=[],y=[],b=[],x=new s({values:v,index:y,ptr:b,size:[u,u]}),S=[],C,w,T=[],E=[];for(C=0;C<u;C++)T[C]=0,S[C]=-1,g[C+1]=0;f=0,p=0;for(var D=0;D<u;D++){g[D]=f,b[D]=p;var O=d?d[D]:D,k=c(_,e,O,E,T,S,1),A=-1,j=-1;for(w=k;w<u;w++)if(C=E[w],S[C]<0){var M=t(T[C]);a(M,j)&&(j=M,A=C)}else y[p]=S[C],v[p++]=T[C];if(A===-1||j<=0)return null;S[O]<0&&o(t(T[O]),r(j,l))&&(A=O);var N=T[A];for(y[p]=D,v[p++]=N,S[A]=D,h[f]=A,m[f++]=1,w=k;w<u;w++)C=E[w],S[C]<0&&(h[f]=C,m[f++]=n(T[C],N)),T[C]=0}for(g[u]=f,b[u]=p,w=0;w<f;w++)h[w]=S[h[w]];return m.splice(f,m.length-f),h.splice(f,h.length-f),v.splice(p,v.length-p),y.splice(p,y.length-p),{L:_,U:x,pinv:S}}}),yg=`slu`,bg=V(yg,[`typed`,`abs`,`add`,`multiply`,`transpose`,`divideScalar`,`subtract`,`larger`,`largerEq`,`SparseMatrix`],e=>{var{typed:t,abs:n,add:r,multiply:i,transpose:a,divideScalar:o,subtract:s,larger:c,largerEq:l,SparseMatrix:u}=e,d=dg({add:r,multiply:i,transpose:a}),f=vg({abs:n,divideScalar:o,multiply:i,subtract:s,larger:c,largerEq:l,SparseMatrix:u});return t(yg,{"SparseMatrix, number, number":function(e,t,n){if(!H(t)||t<0||t>3)throw Error(`Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]`);if(n<0||n>1)throw Error(`Partial pivoting threshold must be a number from 0 to 1`);var r=d(t,e,!1),i=f(e,r,n);return{L:i.L,U:i.U,p:i.pinv,q:r.q,toString:function(){return`L: `+this.L.toString()+`
|
|
30
|
+
U: `+this.U.toString()+`
|
|
31
|
+
p: `+this.p.toString()+(this.q?`
|
|
32
|
+
q: `+this.q.toString():``)+`
|
|
33
|
+
`}}}})});function xg(e,t){var n,r=t.length,i=[];if(e)for(n=0;n<r;n++)i[e[n]]=t[n];else for(n=0;n<r;n++)i[n]=t[n];return i}var Sg=`lusolve`,Cg=V(Sg,[`typed`,`matrix`,`lup`,`slu`,`usolve`,`lsolve`,`DenseMatrix`],e=>{var{typed:t,matrix:n,lup:r,slu:i,usolve:a,lsolve:o,DenseMatrix:s}=e,c=Yd({DenseMatrix:s});return t(Sg,{"Array, Array | Matrix":function(e,t){e=n(e);var i=r(e);return u(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var n=r(e);return u(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var n=r(e);return u(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,n,r){var a=i(e,n,r);return u(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return u(e.L,e.U,e.p,e.q,t)}});function l(e){if(F(e))return e;if(P(e))return n(e);throw TypeError(`Invalid Matrix LU decomposition`)}function u(e,t,n,r,i){e=l(e),t=l(t),n&&(i=c(e,i,!0),i._data=xg(n,i._data));var s=o(e,i),u=a(t,s);return r&&(u._data=xg(r,u._data)),u}}),wg=`polynomialRoot`,Tg=V(wg,[`typed`,`isZero`,`equalScalar`,`add`,`subtract`,`multiply`,`divide`,`sqrt`,`unaryMinus`,`cbrt`,`typeOf`,`im`,`re`],e=>{var{typed:t,isZero:n,equalScalar:r,add:i,subtract:a,multiply:o,divide:s,sqrt:c,unaryMinus:l,cbrt:u,typeOf:d,im:f,re:p}=e;return t(wg,{"number|Complex, ...number|Complex":(e,t)=>{for(var m=[e,...t];m.length>0&&n(m[m.length-1]);)m.pop();if(m.length<2)throw RangeError(`Polynomial [${e}, ${t}] must have a non-zero non-constant coefficient`);switch(m.length){case 2:return[l(s(m[0],m[1]))];case 3:var[h,g,_]=m,v=o(2,_),y=o(g,g),b=o(4,_,h);if(r(y,b))return[s(l(g),v)];var x=c(a(y,b));return[s(a(x,g),v),s(a(l(x),g),v)];case 4:var[S,C,w,T]=m,E=l(o(3,T)),D=o(w,w),O=o(3,T,C),k=i(o(2,w,w,w),o(27,T,T,S)),A=o(9,T,w,C);if(r(D,O)&&r(k,A))return[s(w,E)];var j=a(D,O),M=a(k,A);return r(i(o(18,T,w,C,S),o(w,w,C,C)),i(o(4,w,w,w,S),o(4,T,C,C,C),o(27,T,T,S,S)))?[s(a(o(4,T,w,C),i(o(9,T,T,S),o(w,w,w))),o(T,j)),s(a(o(9,T,S),o(w,C)),o(2,j))]:u(r(D,O)?M:s(i(M,c(a(o(M,M),o(4,j,j,j)))),2),!0).toArray().map(e=>s(i(w,e,s(j,e)),E)).map(e=>d(e)===`Complex`&&r(p(e),p(e)+f(e))?p(e):e);default:throw RangeError(`only implemented for cubic or lower-order polynomials, not ${m}`)}}})}),Eg=V(`Help`,[`evaluate`],e=>{var{evaluate:t}=e;function n(e){if(!(this instanceof n))throw SyntaxError(`Constructor must be called with the new operator`);if(!e)throw Error(`Argument "doc" missing`);this.doc=e}return n.prototype.type=`Help`,n.prototype.isHelp=!0,n.prototype.toString=function(){var e=this.doc||{},n=`
|
|
34
|
+
`;if(e.name&&(n+=`Name: `+e.name+`
|
|
35
|
+
|
|
36
|
+
`),e.category&&(n+=`Category: `+e.category+`
|
|
37
|
+
|
|
38
|
+
`),e.description&&(n+=`Description:
|
|
39
|
+
`+e.description+`
|
|
40
|
+
|
|
41
|
+
`),e.syntax&&(n+=`Syntax:
|
|
42
|
+
`+e.syntax.join(`
|
|
43
|
+
`)+`
|
|
44
|
+
|
|
45
|
+
`),e.examples){n+=`Examples:
|
|
46
|
+
`;for(var r=!1,i=t(`config()`),a={config:e=>(r=!0,t(`config(newConfig)`,{newConfig:e}))},o=0;o<e.examples.length;o++){var s=e.examples[o];n+=` `+s+`
|
|
47
|
+
`;var c=void 0;try{c=t(s,a)}catch(e){c=e}c!==void 0&&!oe(c)&&(n+=` `+oi(c,{precision:14})+`
|
|
48
|
+
`)}n+=`
|
|
49
|
+
`,r&&t(`config(originalConfig)`,{originalConfig:i})}return e.mayThrow&&e.mayThrow.length&&(n+=`Throws: `+e.mayThrow.join(`, `)+`
|
|
50
|
+
|
|
51
|
+
`),e.seealso&&e.seealso.length&&(n+=`See also: `+e.seealso.join(`, `)+`
|
|
52
|
+
`),n},n.prototype.toJSON=function(){var e=Ne(this.doc);return e.mathjs=`Help`,e},n.fromJSON=function(e){var t={};return Object.keys(e).filter(e=>e!==`mathjs`).forEach(n=>{t[n]=e[n]}),new n(t)},n.prototype.valueOf=n.prototype.toString,n},{isClass:!0}),Dg=V(`Chain`,[`?on`,`math`,`typed`],e=>{var{on:t,math:n,typed:r}=e;function i(e){if(!(this instanceof i))throw SyntaxError(`Constructor must be called with the new operator`);this.value=je(e)?e.value:e}i.prototype.type=`Chain`,i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return oi(this.value)},i.prototype.toJSON=function(){return{mathjs:`Chain`,value:this.value}},i.fromJSON=function(e){return new i(e.value)};function a(e,t){typeof t==`function`&&(i.prototype[e]=s(t))}function o(e,t){Be(i.prototype,e,function(){var e=t();if(typeof e==`function`)return s(e)})}function s(e){return function(){if(arguments.length===0)return new i(e(this.value));for(var t=[this.value],n=0;n<arguments.length;n++)t[n+1]=arguments[n];if(r.isTypedFunction(e)){var a=r.resolve(e,t);if(a.params.length===1)throw Error(`chain function `+e.name+` cannot match rest parameter between chain value and additional arguments.`);return new i(a.implementation.apply(e,t))}return new i(e.apply(e,t))}}i.createProxy=function(e,t){if(typeof e==`string`)a(e,t);else{var n=function(t){z(e,t)&&c[t]===void 0&&o(t,()=>e[t])};for(var r in e)n(r)}};var c={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(n),t&&t(`import`,function(e,t,n){n||o(e,t)}),i},{isClass:!0}),Og={name:`e`,category:`Constants`,syntax:[`e`],description:`Euler's number, the base of the natural logarithm. Approximately equal to 2.71828`,examples:[`e`,`e ^ 2`,`exp(2)`,`log(e)`],seealso:[`exp`]},kg={name:`false`,category:`Constants`,syntax:[`false`],description:`Boolean value false`,examples:[`false`],seealso:[`true`]},Ag={name:`i`,category:`Constants`,syntax:[`i`],description:`Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.`,examples:[`i`,`i * i`,`sqrt(-1)`],seealso:[]},jg={name:`Infinity`,category:`Constants`,syntax:[`Infinity`],description:`Infinity, a number which is larger than the maximum number that can be handled by a floating point number.`,examples:[`Infinity`,`1 / 0`],seealso:[]},Mg={name:`LN10`,category:`Constants`,syntax:[`LN10`],description:`Returns the natural logarithm of 10, approximately equal to 2.302`,examples:[`LN10`,`log(10)`],seealso:[]},Ng={name:`LN2`,category:`Constants`,syntax:[`LN2`],description:`Returns the natural logarithm of 2, approximately equal to 0.693`,examples:[`LN2`,`log(2)`],seealso:[]},Pg={name:`LOG10E`,category:`Constants`,syntax:[`LOG10E`],description:`Returns the base-10 logarithm of E, approximately equal to 0.434`,examples:[`LOG10E`,`log(e, 10)`],seealso:[]},Fg={name:`LOG2E`,category:`Constants`,syntax:[`LOG2E`],description:`Returns the base-2 logarithm of E, approximately equal to 1.442`,examples:[`LOG2E`,`log(e, 2)`],seealso:[]},Ig={name:`NaN`,category:`Constants`,syntax:[`NaN`],description:`Not a number`,examples:[`NaN`,`0 / 0`],seealso:[]},Lg={name:`null`,category:`Constants`,syntax:[`null`],description:`Value null`,examples:[`null`],seealso:[`true`,`false`]},Rg={name:`phi`,category:`Constants`,syntax:[`phi`],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:[`phi`],seealso:[]},zg={name:`pi`,category:`Constants`,syntax:[`pi`],description:`The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159`,examples:[`pi`,`sin(pi/2)`],seealso:[`tau`]},Bg={bignumber:{name:`bignumber`,category:`Construction`,syntax:[`bignumber(x)`],description:`Create a big number from a number or string.`,examples:[`0.1 + 0.2`,`bignumber(0.1) + bignumber(0.2)`,`bignumber("7.2")`,`bignumber("7.2e500")`,`bignumber([0.1, 0.2, 0.3])`],seealso:[`boolean`,`bigint`,`complex`,`fraction`,`index`,`matrix`,`string`,`unit`]},bigint:{name:`bigint`,category:`Construction`,syntax:[`bigint(x)`],description:`Create a bigint, an integer with an arbitrary number of digits, from a number or string.`,examples:[`123123123123123123 # a large number will lose digits`,`bigint("123123123123123123")`,`bignumber(["1", "3", "5"])`],seealso:[`boolean`,`bignumber`,`number`,`complex`,`fraction`,`index`,`matrix`,`string`,`unit`]},boolean:{name:`boolean`,category:`Construction`,syntax:[`x`,`boolean(x)`],description:`Convert a string or number into a boolean.`,examples:[`boolean(0)`,`boolean(1)`,`boolean(3)`,`boolean("true")`,`boolean("false")`,`boolean([1, 0, 1, 1])`],seealso:[`bignumber`,`complex`,`index`,`matrix`,`number`,`string`,`unit`]},complex:{name:`complex`,category:`Construction`,syntax:[`complex()`,`complex(re, im)`,`complex(string)`],description:`Create a complex number.`,examples:[`complex()`,`complex(2, 3)`,`complex("7 - 2i")`],seealso:[`bignumber`,`boolean`,`index`,`matrix`,`number`,`string`,`unit`]},createUnit:{name:`createUnit`,category:`Construction`,syntax:[`createUnit(definitions)`,`createUnit(name, definition)`],description:`Create a user-defined unit and register it with the Unit type.`,examples:[`createUnit("foo")`,`createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})`,`createUnit("mph", "1 mile/hour")`],seealso:[`unit`,`splitUnit`]},fraction:{name:`fraction`,category:`Construction`,syntax:[`fraction(num)`,`fraction(matrix)`,`fraction(num,den)`,`fraction({n: num, d: den})`],description:`Create a fraction from a number or from integer numerator and denominator.`,examples:[`fraction(0.125)`,`fraction(1, 3) + fraction(2, 5)`,`fraction({n: 333, d: 53})`,`fraction([sqrt(9), sqrt(10), sqrt(11)])`],seealso:[`bignumber`,`boolean`,`complex`,`index`,`matrix`,`string`,`unit`]},index:{name:`index`,category:`Construction`,syntax:[`[start]`,`[start:end]`,`[start:step:end]`,`[start1, start 2, ...]`,`[start1:end1, start2:end2, ...]`,`[start1:step1:end1, start2:step2:end2, ...]`],description:`Create an index to get or replace a subset of a matrix`,examples:[`A = [1, 2, 3; 4, 5, 6]`,`A[1, :]`,`A[1, 2] = 50`,`A[1:2, 1:2] = 1`,`B = [1, 2, 3]`,`B[B>1 and B<3]`],seealso:[`bignumber`,`boolean`,`complex`,`matrix`,`number`,`range`,`string`,`unit`]},matrix:{name:`matrix`,category:`Construction`,syntax:[`[]`,`[a1, b1, ...; a2, b2, ...]`,`matrix()`,`matrix("dense")`,`matrix([...])`],description:`Create a matrix.`,examples:[`[]`,`[1, 2, 3]`,`[1, 2, 3; 4, 5, 6]`,`matrix()`,`matrix([3, 4])`,`matrix([3, 4; 5, 6], "sparse")`,`matrix([3, 4; 5, 6], "sparse", "number")`],seealso:[`bignumber`,`boolean`,`complex`,`index`,`number`,`string`,`unit`,`sparse`]},number:{name:`number`,category:`Construction`,syntax:[`x`,`number(x)`,`number(unit, valuelessUnit)`],description:`Create a number or convert a string or boolean into a number.`,examples:[`2`,`2e3`,`4.05`,`number(2)`,`number("7.2")`,`number(true)`,`number([true, false, true, true])`,`number(unit("52cm"), "m")`],seealso:[`bignumber`,`bigint`,`boolean`,`complex`,`fraction`,`index`,`matrix`,`string`,`unit`]},sparse:{name:`sparse`,category:`Construction`,syntax:[`sparse()`,`sparse([a1, b1, ...; a1, b2, ...])`,`sparse([a1, b1, ...; a1, b2, ...], "number")`],description:`Create a sparse matrix.`,examples:[`sparse()`,`sparse([3, 4; 5, 6])`,`sparse([3, 0; 5, 0], "number")`],seealso:[`bignumber`,`boolean`,`complex`,`index`,`number`,`string`,`unit`,`matrix`]},splitUnit:{name:`splitUnit`,category:`Construction`,syntax:[`splitUnit(unit: Unit, parts: Unit[])`],description:`Split a unit in an array of units whose sum is equal to the original unit.`,examples:[`splitUnit(1 m, ["feet", "inch"])`],seealso:[`unit`,`createUnit`]},string:{name:`string`,category:`Construction`,syntax:[`"text"`,`string(x)`],description:`Create a string or convert a value to a string`,examples:[`"Hello World!"`,`string(4.2)`,`string(3 + 2i)`],seealso:[`bignumber`,`boolean`,`complex`,`index`,`matrix`,`number`,`unit`]},unit:{name:`unit`,category:`Construction`,syntax:[`value unit`,`unit(value, unit)`,`unit(string)`],description:`Create a unit.`,examples:[`5.5 mm`,`3 inch`,`unit(7.1, "kilogram")`,`unit("23 deg")`],seealso:[`bignumber`,`boolean`,`complex`,`index`,`matrix`,`number`,`string`]},e:Og,E:Og,false:kg,i:Ag,Infinity:jg,LN2:Ng,LN10:Mg,LOG2E:Fg,LOG10E:Pg,NaN:Ig,null:Lg,pi:zg,PI:zg,phi:Rg,SQRT1_2:{name:`SQRT1_2`,category:`Constants`,syntax:[`SQRT1_2`],description:`Returns the square root of 1/2, approximately equal to 0.707`,examples:[`SQRT1_2`,`sqrt(1/2)`],seealso:[]},SQRT2:{name:`SQRT2`,category:`Constants`,syntax:[`SQRT2`],description:`Returns the square root of 2, approximately equal to 1.414`,examples:[`SQRT2`,`sqrt(2)`],seealso:[]},tau:{name:`tau`,category:`Constants`,syntax:[`tau`],description:`Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.`,examples:[`tau`,`2 * pi`],seealso:[`pi`]},true:{name:`true`,category:`Constants`,syntax:[`true`],description:`Boolean value true`,examples:[`true`],seealso:[`false`]},version:{name:`version`,category:`Constants`,syntax:[`version`],description:`A string with the version number of math.js`,examples:[`version`],seealso:[]},speedOfLight:{description:`Speed of light in vacuum`,examples:[`speedOfLight`]},gravitationConstant:{description:`Newtonian constant of gravitation`,examples:[`gravitationConstant`]},planckConstant:{description:`Planck constant`,examples:[`planckConstant`]},reducedPlanckConstant:{description:`Reduced Planck constant`,examples:[`reducedPlanckConstant`]},magneticConstant:{description:`Magnetic constant (vacuum permeability)`,examples:[`magneticConstant`]},electricConstant:{description:`Electric constant (vacuum permeability)`,examples:[`electricConstant`]},vacuumImpedance:{description:`Characteristic impedance of vacuum`,examples:[`vacuumImpedance`]},coulomb:{description:`Coulomb's constant. Deprecated in favor of coulombConstant`,examples:[`coulombConstant`]},coulombConstant:{description:`Coulomb's constant`,examples:[`coulombConstant`]},elementaryCharge:{description:`Elementary charge`,examples:[`elementaryCharge`]},bohrMagneton:{description:`Bohr magneton`,examples:[`bohrMagneton`]},conductanceQuantum:{description:`Conductance quantum`,examples:[`conductanceQuantum`]},inverseConductanceQuantum:{description:`Inverse conductance quantum`,examples:[`inverseConductanceQuantum`]},magneticFluxQuantum:{description:`Magnetic flux quantum`,examples:[`magneticFluxQuantum`]},nuclearMagneton:{description:`Nuclear magneton`,examples:[`nuclearMagneton`]},klitzing:{description:`Von Klitzing constant`,examples:[`klitzing`]},bohrRadius:{description:`Bohr radius`,examples:[`bohrRadius`]},classicalElectronRadius:{description:`Classical electron radius`,examples:[`classicalElectronRadius`]},electronMass:{description:`Electron mass`,examples:[`electronMass`]},fermiCoupling:{description:`Fermi coupling constant`,examples:[`fermiCoupling`]},fineStructure:{description:`Fine-structure constant`,examples:[`fineStructure`]},hartreeEnergy:{description:`Hartree energy`,examples:[`hartreeEnergy`]},protonMass:{description:`Proton mass`,examples:[`protonMass`]},deuteronMass:{description:`Deuteron Mass`,examples:[`deuteronMass`]},neutronMass:{description:`Neutron mass`,examples:[`neutronMass`]},quantumOfCirculation:{description:`Quantum of circulation`,examples:[`quantumOfCirculation`]},rydberg:{description:`Rydberg constant`,examples:[`rydberg`]},thomsonCrossSection:{description:`Thomson cross section`,examples:[`thomsonCrossSection`]},weakMixingAngle:{description:`Weak mixing angle`,examples:[`weakMixingAngle`]},efimovFactor:{description:`Efimov factor`,examples:[`efimovFactor`]},atomicMass:{description:`Atomic mass constant`,examples:[`atomicMass`]},avogadro:{description:`Avogadro's number`,examples:[`avogadro`]},boltzmann:{description:`Boltzmann constant`,examples:[`boltzmann`]},faraday:{description:`Faraday constant`,examples:[`faraday`]},firstRadiation:{description:`First radiation constant`,examples:[`firstRadiation`]},loschmidt:{description:`Loschmidt constant at T=273.15 K and p=101.325 kPa`,examples:[`loschmidt`]},gasConstant:{description:`Gas constant`,examples:[`gasConstant`]},molarPlanckConstant:{description:`Molar Planck constant`,examples:[`molarPlanckConstant`]},molarVolume:{description:`Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa`,examples:[`molarVolume`]},sackurTetrode:{description:`Sackur-Tetrode constant at T=1 K and p=101.325 kPa`,examples:[`sackurTetrode`]},secondRadiation:{description:`Second radiation constant`,examples:[`secondRadiation`]},stefanBoltzmann:{description:`Stefan-Boltzmann constant`,examples:[`stefanBoltzmann`]},wienDisplacement:{description:`Wien displacement law constant`,examples:[`wienDisplacement`]},molarMass:{description:`Molar mass constant`,examples:[`molarMass`]},molarMassC12:{description:`Molar mass constant of carbon-12`,examples:[`molarMassC12`]},gravity:{description:`Standard acceleration of gravity (standard acceleration of free-fall on Earth)`,examples:[`gravity`]},planckLength:{description:`Planck length`,examples:[`planckLength`]},planckMass:{description:`Planck mass`,examples:[`planckMass`]},planckTime:{description:`Planck time`,examples:[`planckTime`]},planckCharge:{description:`Planck charge`,examples:[`planckCharge`]},planckTemperature:{description:`Planck temperature`,examples:[`planckTemperature`]},derivative:{name:`derivative`,category:`Algebra`,syntax:[`derivative(expr, variable)`,`derivative(expr, variable, {simplify: boolean})`],description:`Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.`,examples:[`derivative("2x^3", "x")`,`derivative("2x^3", "x", {simplify: false})`,`derivative("2x^2 + 3x + 4", "x")`,`derivative("sin(2x)", "x")`,`f = parse("x^2 + x")`,`x = parse("x")`,`df = derivative(f, x)`,`df.evaluate({x: 3})`],seealso:[`simplify`,`parse`,`evaluate`]},lsolve:{name:`lsolve`,category:`Algebra`,syntax:[`x=lsolve(L, b)`],description:`Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.`,examples:[`a = [-2, 3; 2, 1]`,`b = [11, 9]`,`x = lsolve(a, b)`],seealso:[`lsolveAll`,`lup`,`lusolve`,`usolve`,`matrix`,`sparse`]},lsolveAll:{name:`lsolveAll`,category:`Algebra`,syntax:[`x=lsolveAll(L, b)`],description:`Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.`,examples:[`a = [-2, 3; 2, 1]`,`b = [11, 9]`,`x = lsolve(a, b)`],seealso:[`lsolve`,`lup`,`lusolve`,`usolve`,`matrix`,`sparse`]},lup:{name:`lup`,category:`Algebra`,syntax:[`lup(m)`],description:`Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U`,examples:[`lup([[2, 1], [1, 4]])`,`lup(matrix([[2, 1], [1, 4]]))`,`lup(sparse([[2, 1], [1, 4]]))`],seealso:[`lusolve`,`lsolve`,`usolve`,`matrix`,`sparse`,`slu`,`qr`]},lusolve:{name:`lusolve`,category:`Algebra`,syntax:[`x=lusolve(A, b)`,`x=lusolve(lu, b)`],description:`Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.`,examples:[`a = [-2, 3; 2, 1]`,`b = [11, 9]`,`x = lusolve(a, b)`],seealso:[`lup`,`slu`,`lsolve`,`usolve`,`matrix`,`sparse`]},leafCount:{name:`leafCount`,category:`Algebra`,syntax:[`leafCount(expr)`],description:`Computes the number of leaves in the parse tree of the given expression`,examples:[`leafCount("e^(i*pi)-1")`,`leafCount(parse("{a: 22/7, b: 10^(1/2)}"))`],seealso:[`simplify`]},polynomialRoot:{name:`polynomialRoot`,category:`Algebra`,syntax:[`x=polynomialRoot(-6, 3)`,`x=polynomialRoot(4, -4, 1)`,`x=polynomialRoot(-8, 12, -6, 1)`],description:`Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.`,examples:[`a = polynomialRoot(-6, 11, -6, 1)`],seealso:[`cbrt`,`sqrt`]},resolve:{name:`resolve`,category:`Algebra`,syntax:[`resolve(node, scope)`],description:`Recursively substitute variables in an expression tree.`,examples:[`resolve(parse("1 + x"), { x: 7 })`,`resolve(parse("size(text)"), { text: "Hello World" })`,`resolve(parse("x + y"), { x: parse("3z") })`,`resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })`],seealso:[`simplify`,`evaluate`],mayThrow:[`ReferenceError`]},simplify:{name:`simplify`,category:`Algebra`,syntax:[`simplify(expr)`,`simplify(expr, rules)`],description:`Simplify an expression tree.`,examples:[`simplify("3 + 2 / 4")`,`simplify("2x + x")`,`f = parse("x * (x + 2 + x)")`,`simplified = simplify(f)`,`simplified.evaluate({x: 2})`],seealso:[`simplifyCore`,`derivative`,`evaluate`,`parse`,`rationalize`,`resolve`]},simplifyConstant:{name:`simplifyConstant`,category:`Algebra`,syntax:[`simplifyConstant(expr)`,`simplifyConstant(expr, options)`],description:`Replace constant subexpressions of node with their values.`,examples:[`simplifyConstant("(3-3)*x")`,`simplifyConstant(parse("z-cos(tau/8)"))`],seealso:[`simplify`,`simplifyCore`,`evaluate`]},simplifyCore:{name:`simplifyCore`,category:`Algebra`,syntax:[`simplifyCore(node)`],description:`Perform simple one-pass simplifications on an expression tree.`,examples:[`simplifyCore(parse("0*x"))`,`simplifyCore(parse("(x+0)*2"))`],seealso:[`simplify`,`simplifyConstant`,`evaluate`]},symbolicEqual:{name:`symbolicEqual`,category:`Algebra`,syntax:[`symbolicEqual(expr1, expr2)`,`symbolicEqual(expr1, expr2, options)`],description:`Returns true if the difference of the expressions simplifies to 0`,examples:[`symbolicEqual("x*y","y*x")`,`symbolicEqual("abs(x^2)", "x^2")`,`symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})`],seealso:[`simplify`,`evaluate`]},rationalize:{name:`rationalize`,category:`Algebra`,syntax:[`rationalize(expr)`,`rationalize(expr, scope)`,`rationalize(expr, scope, detailed)`],description:`Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.`,examples:[`rationalize("2x/y - y/(x+1)")`,`rationalize("2x/y - y/(x+1)", true)`],seealso:[`simplify`]},slu:{name:`slu`,category:`Algebra`,syntax:[`slu(A, order, threshold)`],description:`Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U`,examples:[`slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)`],seealso:[`lusolve`,`lsolve`,`usolve`,`matrix`,`sparse`,`lup`,`qr`]},usolve:{name:`usolve`,category:`Algebra`,syntax:[`x=usolve(U, b)`],description:`Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.`,examples:[`x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])`],seealso:[`usolveAll`,`lup`,`lusolve`,`lsolve`,`matrix`,`sparse`]},usolveAll:{name:`usolveAll`,category:`Algebra`,syntax:[`x=usolve(U, b)`],description:`Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.`,examples:[`x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])`],seealso:[`usolve`,`lup`,`lusolve`,`lsolve`,`matrix`,`sparse`]},qr:{name:`qr`,category:`Algebra`,syntax:[`qr(A)`],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:[`qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])`],seealso:[`lup`,`slu`,`matrix`]},abs:{name:`abs`,category:`Arithmetic`,syntax:[`abs(x)`],description:`Compute the absolute value.`,examples:[`abs(3.5)`,`abs(-4.2)`],seealso:[`sign`]},add:{name:`add`,category:`Operators`,syntax:[`x + y`,`add(x, y)`],description:`Add two values.`,examples:[`a = 2.1 + 3.6`,`a - 3.6`,`3 + 2i`,`3 cm + 2 inch`,`"2.3" + "4"`],seealso:[`subtract`]},cbrt:{name:`cbrt`,category:`Arithmetic`,syntax:[`cbrt(x)`,`cbrt(x, allRoots)`],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:[`cbrt(64)`,`cube(4)`,`cbrt(-8)`,`cbrt(2 + 3i)`,`cbrt(8i)`,`cbrt(8i, true)`,`cbrt(27 m^3)`],seealso:[`square`,`sqrt`,`cube`,`multiply`]},ceil:{name:`ceil`,category:`Arithmetic`,syntax:[`ceil(x)`,`ceil(x, n)`,`ceil(unit, valuelessUnit)`,`ceil(unit, n, valuelessUnit)`],description:`Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.`,examples:[`ceil(3.2)`,`ceil(3.8)`,`ceil(-4.2)`,`ceil(3.241cm, cm)`,`ceil(3.241cm, 2, cm)`],seealso:[`floor`,`fix`,`round`]},cube:{name:`cube`,category:`Arithmetic`,syntax:[`cube(x)`],description:`Compute the cube of a value. The cube of x is x * x * x.`,examples:[`cube(2)`,`2^3`,`2 * 2 * 2`],seealso:[`multiply`,`square`,`pow`]},divide:{name:`divide`,category:`Operators`,syntax:[`x / y`,`divide(x, y)`],description:`Divide two values.`,examples:[`a = 2 / 3`,`a * 3`,`4.5 / 2`,`3 + 4 / 2`,`(3 + 4) / 2`,`18 km / 4.5`],seealso:[`multiply`]},dotDivide:{name:`dotDivide`,category:`Operators`,syntax:[`x ./ y`,`dotDivide(x, y)`],description:`Divide two values element wise.`,examples:[`a = [1, 2, 3; 4, 5, 6]`,`b = [2, 1, 1; 3, 2, 5]`,`a ./ b`],seealso:[`multiply`,`dotMultiply`,`divide`]},dotMultiply:{name:`dotMultiply`,category:`Operators`,syntax:[`x .* y`,`dotMultiply(x, y)`],description:`Multiply two values element wise.`,examples:[`a = [1, 2, 3; 4, 5, 6]`,`b = [2, 1, 1; 3, 2, 5]`,`a .* b`],seealso:[`multiply`,`divide`,`dotDivide`]},dotPow:{name:`dotPow`,category:`Operators`,syntax:[`x .^ y`,`dotPow(x, y)`],description:`Calculates the power of x to y element wise.`,examples:[`a = [1, 2, 3; 4, 5, 6]`,`a .^ 2`],seealso:[`pow`]},exp:{name:`exp`,category:`Arithmetic`,syntax:[`exp(x)`],description:`Calculate the exponent of a value.`,examples:[`exp(1.3)`,`e ^ 1.3`,`log(exp(1.3))`,`x = 2.4`,`(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula`],seealso:[`expm`,`expm1`,`pow`,`log`]},expm:{name:`expm`,category:`Arithmetic`,syntax:[`exp(x)`],description:`Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.`,examples:[`expm([[0,2],[0,0]])`],seealso:[`exp`]},expm1:{name:`expm1`,category:`Arithmetic`,syntax:[`expm1(x)`],description:`Calculate the value of subtracting 1 from the exponential value.`,examples:[`expm1(2)`,`pow(e, 2) - 1`,`log(expm1(2) + 1)`],seealso:[`exp`,`pow`,`log`]},fix:{name:`fix`,category:`Arithmetic`,syntax:[`fix(x)`,`fix(x, n)`,`fix(unit, valuelessUnit)`,`fix(unit, n, valuelessUnit)`],description:`Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.`,examples:[`fix(3.2)`,`fix(3.8)`,`fix(-4.2)`,`fix(-4.8)`,`fix(3.241cm, cm)`,`fix(3.241cm, 2, cm)`],seealso:[`ceil`,`floor`,`round`]},floor:{name:`floor`,category:`Arithmetic`,syntax:[`floor(x)`,`floor(x, n)`,`floor(unit, valuelessUnit)`,`floor(unit, n, valuelessUnit)`],description:`Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.`,examples:[`floor(3.2)`,`floor(3.8)`,`floor(-4.2)`,`floor(3.241cm, cm)`,`floor(3.241cm, 2, cm)`],seealso:[`ceil`,`fix`,`round`]},gcd:{name:`gcd`,category:`Arithmetic`,syntax:[`gcd(a, b)`,`gcd(a, b, c, ...)`],description:`Compute the greatest common divisor.`,examples:[`gcd(8, 12)`,`gcd(-4, 6)`,`gcd(25, 15, -10)`],seealso:[`lcm`,`xgcd`]},hypot:{name:`hypot`,category:`Arithmetic`,syntax:[`hypot(a, b, c, ...)`,`hypot([a, b, c, ...])`],description:`Calculate the hypotenuse of a list with values.`,examples:[`hypot(3, 4)`,`sqrt(3^2 + 4^2)`,`hypot(-2)`,`hypot([3, 4, 5])`],seealso:[`abs`,`norm`]},lcm:{name:`lcm`,category:`Arithmetic`,syntax:[`lcm(x, y)`],description:`Compute the least common multiple.`,examples:[`lcm(4, 6)`,`lcm(6, 21)`,`lcm(6, 21, 5)`],seealso:[`gcd`]},log:{name:`log`,category:`Arithmetic`,syntax:[`log(x)`,`log(x, base)`],description:`Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).`,examples:[`log(3.5)`,`a = log(2.4)`,`exp(a)`,`10 ^ 4`,`log(10000, 10)`,`log(10000) / log(10)`,`b = log(1024, 2)`,`2 ^ b`],seealso:[`exp`,`log1p`,`log2`,`log10`]},log2:{name:`log2`,category:`Arithmetic`,syntax:[`log2(x)`],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:[`log2(0.03125)`,`log2(16)`,`log2(16) / log2(2)`,`pow(2, 4)`],seealso:[`exp`,`log1p`,`log`,`log10`]},log1p:{name:`log1p`,category:`Arithmetic`,syntax:[`log1p(x)`,`log1p(x, base)`],description:"Calculate the logarithm of a `value+1`",examples:[`log1p(2.5)`,`exp(log1p(1.4))`,`pow(10, 4)`,`log1p(9999, 10)`,`log1p(9999) / log(10)`],seealso:[`exp`,`log`,`log2`,`log10`]},log10:{name:`log10`,category:`Arithmetic`,syntax:[`log10(x)`],description:`Compute the 10-base logarithm of a value.`,examples:[`log10(0.00001)`,`log10(10000)`,`10 ^ 4`,`log(10000) / log(10)`,`log(10000, 10)`],seealso:[`exp`,`log`]},mod:{name:`mod`,category:`Operators`,syntax:[`x % y`,`x mod y`,`mod(x, y)`],description:`Calculates the modulus, the remainder of an integer division.`,examples:[`7 % 3`,`11 % 2`,`10 mod 4`,`isOdd(x) = x % 2`,`isOdd(2)`,`isOdd(3)`],seealso:[`divide`]},multiply:{name:`multiply`,category:`Operators`,syntax:[`x * y`,`multiply(x, y)`],description:`multiply two values.`,examples:[`a = 2.1 * 3.4`,`a / 3.4`,`2 * 3 + 4`,`2 * (3 + 4)`,`3 * 2.1 km`],seealso:[`divide`]},norm:{name:`norm`,category:`Arithmetic`,syntax:[`norm(x)`,`norm(x, p)`],description:`Calculate the norm of a number, vector or matrix.`,examples:[`abs(-3.5)`,`norm(-3.5)`,`norm(3 - 4i)`,`norm([1, 2, -3], Infinity)`,`norm([1, 2, -3], -Infinity)`,`norm([3, 4], 2)`,`norm([[1, 2], [3, 4]], 1)`,`norm([[1, 2], [3, 4]], "inf")`,`norm([[1, 2], [3, 4]], "fro")`]},nthRoot:{name:`nthRoot`,category:`Arithmetic`,syntax:[`nthRoot(a)`,`nthRoot(a, root)`],description:`Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".`,examples:[`4 ^ 3`,`nthRoot(64, 3)`,`nthRoot(9, 2)`,`sqrt(9)`],seealso:[`nthRoots`,`pow`,`sqrt`]},nthRoots:{name:`nthRoots`,category:`Arithmetic`,syntax:[`nthRoots(A)`,`nthRoots(A, root)`],description:`Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.`,examples:[`nthRoots(1)`,`nthRoots(1, 3)`],seealso:[`sqrt`,`pow`,`nthRoot`]},pow:{name:`pow`,category:`Operators`,syntax:[`x ^ y`,`pow(x, y)`],description:`Calculates the power of x to y, x^y.`,examples:[`2^3`,`2*2*2`,`1 + e ^ (pi * i)`,`pow([[1, 2], [4, 3]], 2)`,`pow([[1, 2], [4, 3]], -1)`],seealso:[`multiply`,`nthRoot`,`nthRoots`,`sqrt`]},round:{name:`round`,category:`Arithmetic`,syntax:[`round(x)`,`round(x, n)`,`round(unit, valuelessUnit)`,`round(unit, n, valuelessUnit)`],description:`round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.`,examples:[`round(3.2)`,`round(3.8)`,`round(-4.2)`,`round(-4.8)`,`round(pi, 3)`,`round(123.45678, 2)`,`round(3.241cm, 2, cm)`,`round([3.2, 3.8, -4.7])`],seealso:[`ceil`,`floor`,`fix`]},sign:{name:`sign`,category:`Arithmetic`,syntax:[`sign(x)`],description:`Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.`,examples:[`sign(3.5)`,`sign(-4.2)`,`sign(0)`],seealso:[`abs`]},sqrt:{name:`sqrt`,category:`Arithmetic`,syntax:[`sqrt(x)`],description:`Compute the square root value. If x = y * y, then y is the square root of x.`,examples:[`sqrt(25)`,`5 * 5`,`sqrt(-1)`],seealso:[`square`,`sqrtm`,`multiply`,`nthRoot`,`nthRoots`,`pow`]},sqrtm:{name:`sqrtm`,category:`Arithmetic`,syntax:[`sqrtm(x)`],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:[`sqrtm([[33, 24], [48, 57]])`],seealso:[`sqrt`,`abs`,`square`,`multiply`]},square:{name:`square`,category:`Arithmetic`,syntax:[`square(x)`],description:`Compute the square of a value. The square of x is x * x.`,examples:[`square(3)`,`sqrt(9)`,`3^2`,`3 * 3`],seealso:[`multiply`,`pow`,`sqrt`,`cube`]},subtract:{name:`subtract`,category:`Operators`,syntax:[`x - y`,`subtract(x, y)`],description:`subtract two values.`,examples:[`a = 5.3 - 2`,`a + 2`,`2/3 - 1/6`,`2 * 3 - 3`,`2.1 km - 500m`],seealso:[`add`]},unaryMinus:{name:`unaryMinus`,category:`Operators`,syntax:[`-x`,`unaryMinus(x)`],description:`Inverse the sign of a value. Converts booleans and strings to numbers.`,examples:[`-4.5`,`-(-5.6)`,`-"22"`],seealso:[`add`,`subtract`,`unaryPlus`]},unaryPlus:{name:`unaryPlus`,category:`Operators`,syntax:[`+x`,`unaryPlus(x)`],description:`Converts booleans and strings to numbers.`,examples:[`+true`,`+"2"`],seealso:[`add`,`subtract`,`unaryMinus`]},xgcd:{name:`xgcd`,category:`Arithmetic`,syntax:[`xgcd(a, b)`],description:`Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.`,examples:[`xgcd(8, 12)`,`gcd(8, 12)`,`xgcd(36163, 21199)`],seealso:[`gcd`,`lcm`]},invmod:{name:`invmod`,category:`Arithmetic`,syntax:[`invmod(a, b)`],description:`Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)`,examples:[`invmod(8, 12)`,`invmod(7, 13)`,`invmod(15151, 15122)`],seealso:[`gcd`,`xgcd`]},num:{name:`num`,category:`Fraction`,syntax:[`num(x)`],description:`Get the numerator of a fraction.`,examples:[`num(fraction(2, 3))`,`num(fraction(5, 8))`],seealso:[`den`,`fraction`]},den:{name:`den`,category:`Fraction`,syntax:[`den(x)`],description:`Get the denominator of a fraction.`,examples:[`den(fraction(2, 3))`,`den(fraction(5, 8))`],seealso:[`num`,`fraction`]},bitAnd:{name:`bitAnd`,category:`Bitwise`,syntax:[`x & y`,`bitAnd(x, y)`],description:`Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0`,examples:[`5 & 3`,`bitAnd(53, 131)`,`[1, 12, 31] & 42`],seealso:[`bitNot`,`bitOr`,`bitXor`,`leftShift`,`rightArithShift`,`rightLogShift`]},bitNot:{name:`bitNot`,category:`Bitwise`,syntax:[`~x`,`bitNot(x)`],description:`Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.`,examples:[`~1`,`~2`,`bitNot([2, -3, 4])`],seealso:[`bitAnd`,`bitOr`,`bitXor`,`leftShift`,`rightArithShift`,`rightLogShift`]},bitOr:{name:`bitOr`,category:`Bitwise`,syntax:[`x | y`,`bitOr(x, y)`],description:`Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.`,examples:[`5 | 3`,`bitOr([1, 2, 3], 4)`],seealso:[`bitAnd`,`bitNot`,`bitXor`,`leftShift`,`rightArithShift`,`rightLogShift`]},bitXor:{name:`bitXor`,category:`Bitwise`,syntax:[`bitXor(x, y)`],description:`Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.`,examples:[`bitOr(1, 2)`,`bitXor([2, 3, 4], 4)`],seealso:[`bitAnd`,`bitNot`,`bitOr`,`leftShift`,`rightArithShift`,`rightLogShift`]},leftShift:{name:`leftShift`,category:`Bitwise`,syntax:[`x << y`,`leftShift(x, y)`],description:`Bitwise left logical shift of a value x by y number of bits.`,examples:[`4 << 1`,`8 >> 1`],seealso:[`bitAnd`,`bitNot`,`bitOr`,`bitXor`,`rightArithShift`,`rightLogShift`]},rightArithShift:{name:`rightArithShift`,category:`Bitwise`,syntax:[`x >> y`,`rightArithShift(x, y)`],description:`Bitwise right arithmetic shift of a value x by y number of bits.`,examples:[`8 >> 1`,`4 << 1`,`-12 >> 2`],seealso:[`bitAnd`,`bitNot`,`bitOr`,`bitXor`,`leftShift`,`rightLogShift`]},rightLogShift:{name:`rightLogShift`,category:`Bitwise`,syntax:[`x >>> y`,`rightLogShift(x, y)`],description:`Bitwise right logical shift of a value x by y number of bits.`,examples:[`8 >>> 1`,`4 << 1`,`-12 >>> 2`],seealso:[`bitAnd`,`bitNot`,`bitOr`,`bitXor`,`leftShift`,`rightArithShift`]},bellNumbers:{name:`bellNumbers`,category:`Combinatorics`,syntax:[`bellNumbers(n)`],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:[`bellNumbers(3)`,`bellNumbers(8)`],seealso:[`stirlingS2`]},catalan:{name:`catalan`,category:`Combinatorics`,syntax:[`catalan(n)`],description:`The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.`,examples:[`catalan(3)`,`catalan(8)`],seealso:[`bellNumbers`]},composition:{name:`composition`,category:`Combinatorics`,syntax:[`composition(n, k)`],description:`The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.`,examples:[`composition(5, 3)`],seealso:[`combinations`]},stirlingS2:{name:`stirlingS2`,category:`Combinatorics`,syntax:[`stirlingS2(n, k)`],description:"The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:[`stirlingS2(5, 3)`],seealso:[`bellNumbers`,`bernoulli`]},config:{name:`config`,category:`Core`,syntax:[`config()`,`config(options)`],description:`Get configuration or change configuration.`,examples:[`config()`,`1/3 + 1/4`,`config({number: "Fraction"})`,`1/3 + 1/4`],seealso:[]},import:{name:`import`,category:`Core`,syntax:[`import(functions)`,`import(functions, options)`],description:`Import functions or constants from an object.`,examples:[`import({myFn: f(x)=x^2, myConstant: 32 })`,`myFn(2)`,`myConstant`],seealso:[]},typed:{name:`typed`,category:`Core`,syntax:[`typed(signatures)`,`typed(name, signatures)`],description:`Create a typed function.`,examples:[`double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })`,`double(2)`,`double("hello")`],seealso:[]},arg:{name:`arg`,category:`Complex`,syntax:[`arg(x)`],description:`Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).`,examples:[`arg(2 + 2i)`,`atan2(3, 2)`,`arg(2 + 3i)`],seealso:[`re`,`im`,`conj`,`abs`]},conj:{name:`conj`,category:`Complex`,syntax:[`conj(x)`],description:`Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.`,examples:[`conj(2 + 3i)`,`conj(2 - 3i)`,`conj(-5.2i)`],seealso:[`re`,`im`,`abs`,`arg`]},re:{name:`re`,category:`Complex`,syntax:[`re(x)`],description:`Get the real part of a complex number.`,examples:[`re(2 + 3i)`,`im(2 + 3i)`,`re(-5.2i)`,`re(2.4)`],seealso:[`im`,`conj`,`abs`,`arg`]},im:{name:`im`,category:`Complex`,syntax:[`im(x)`],description:`Get the imaginary part of a complex number.`,examples:[`im(2 + 3i)`,`re(2 + 3i)`,`im(-5.2i)`,`im(2.4)`],seealso:[`re`,`conj`,`abs`,`arg`]},evaluate:{name:`evaluate`,category:`Expression`,syntax:[`evaluate(expression)`,`evaluate(expression, scope)`,`evaluate([expr1, expr2, expr3, ...])`,`evaluate([expr1, expr2, expr3, ...], scope)`],description:`Evaluate an expression or an array with expressions.`,examples:[`evaluate("2 + 3")`,`evaluate("sqrt(16)")`,`evaluate("2 inch to cm")`,`evaluate("sin(x * pi)", { "x": 1/2 })`,`evaluate(["width=2", "height=4","width*height"])`],seealso:[`parser`,`parse`,`compile`]},help:{name:`help`,category:`Expression`,syntax:[`help(object)`,`help(string)`],description:`Display documentation on a function or data type.`,examples:[`help(sqrt)`,`help("complex")`],seealso:[]},parse:{name:`parse`,category:`Expression`,syntax:[`parse(expr)`,`parse(expr, options)`,`parse([expr1, expr2, expr3, ...])`,`parse([expr1, expr2, expr3, ...], options)`],description:`Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().`,examples:[`node1 = parse("sqrt(3^2 + 4^2)")`,`node1.evaluate()`,`code1 = node1.compile()`,`code1.evaluate()`,`scope = {a: 3, b: 4}`,`node2 = parse("a * b")`,`node2.evaluate(scope)`,`code2 = node2.compile()`,`code2.evaluate(scope)`],seealso:[`parser`,`evaluate`,`compile`]},parser:{name:`parser`,category:`Expression`,syntax:[`parser()`],description:`Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.`,examples:[`myParser = parser()`,`myParser.evaluate("sqrt(3^2 + 4^2)")`,`myParser.set("x", 3)`,`myParser.evaluate("y = x + 3")`,`myParser.evaluate(["y = x + 3", "y = y + 1"])`,`myParser.get("y")`],seealso:[`evaluate`,`parse`,`compile`]},compile:{name:`compile`,category:`Expression`,syntax:[`compile(expr) `,`compile([expr1, expr2, expr3, ...])`],description:`Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.`,examples:[`code1 = compile("sqrt(3^2 + 4^2)")`,`code1.evaluate() `,`code2 = compile("a * b")`,`code2.evaluate({a: 3, b: 4})`],seealso:[`parser`,`parse`,`evaluate`]},distance:{name:`distance`,category:`Geometry`,syntax:[`distance([x1, y1], [x2, y2])`,`distance([[x1, y1], [x2, y2]])`],description:`Calculates the Euclidean distance between two points.`,examples:[`distance([0,0], [4,4])`,`distance([[0,0], [4,4]])`],seealso:[]},intersect:{name:`intersect`,category:`Geometry`,syntax:[`intersect(expr1, expr2, expr3, expr4)`,`intersect(expr1, expr2, expr3)`],description:`Computes the intersection point of lines and/or planes.`,examples:[`intersect([0, 0], [10, 10], [10, 0], [0, 10])`,`intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])`],seealso:[]},and:{name:`and`,category:`Logical`,syntax:[`x and y`,`and(x, y)`],description:`Logical and. Test whether two values are both defined with a nonzero/nonempty value.`,examples:[`true and false`,`true and true`,`2 and 4`],seealso:[`not`,`or`,`xor`]},not:{name:`not`,category:`Logical`,syntax:[`not x`,`not(x)`],description:`Logical not. Flips the boolean value of given argument.`,examples:[`not true`,`not false`,`not 2`,`not 0`],seealso:[`and`,`or`,`xor`]},nullish:{name:`nullish`,category:`Logical`,syntax:[`x ?? y`,`nullish(x, y)`],description:`Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.`,examples:[`null ?? 42`,`undefined ?? 42`,`0 ?? 42`,`false ?? 42`,`null ?? undefined ?? 42`],seealso:[`and`,`or`,`not`]},or:{name:`or`,category:`Logical`,syntax:[`x or y`,`or(x, y)`],description:`Logical or. Test if at least one value is defined with a nonzero/nonempty value.`,examples:[`true or false`,`false or false`,`0 or 4`],seealso:[`not`,`and`,`xor`]},xor:{name:`xor`,category:`Logical`,syntax:[`x xor y`,`xor(x, y)`],description:`Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.`,examples:[`true xor false`,`false xor false`,`true xor true`,`0 xor 4`],seealso:[`not`,`and`,`or`]},mapSlices:{name:`mapSlices`,category:`Matrix`,syntax:[`mapSlices(A, dim, callback)`],description:`Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.`,examples:[`A = [[1, 2], [3, 4]]`,`mapSlices(A, 1, sum)`,`mapSlices(A, 2, prod)`],seealso:[`map`,`forEach`]},concat:{name:`concat`,category:`Matrix`,syntax:[`concat(A, B, C, ...)`,`concat(A, B, C, ..., dim)`],description:`Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.`,examples:[`A = [1, 2; 5, 6]`,`B = [3, 4; 7, 8]`,`concat(A, B)`,`concat(A, B, 1)`,`concat(A, B, 2)`],seealso:[`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},count:{name:`count`,category:`Matrix`,syntax:[`count(x)`],description:`Count the number of elements of a matrix, array or string.`,examples:[`a = [1, 2; 3, 4; 5, 6]`,`count(a)`,`size(a)`,`count("hello world")`],seealso:[`size`]},cross:{name:`cross`,category:`Matrix`,syntax:[`cross(A, B)`],description:`Calculate the cross product for two vectors in three dimensional space.`,examples:[`cross([1, 1, 0], [0, 1, 1])`,`cross([3, -3, 1], [4, 9, 2])`,`cross([2, 3, 4], [5, 6, 7])`],seealso:[`multiply`,`dot`]},column:{name:`column`,category:`Matrix`,syntax:[`column(x, index)`],description:`Return a column from a matrix or array.`,examples:[`A = [[1, 2], [3, 4]]`,`column(A, 1)`,`column(A, 2)`],seealso:[`row`,`matrixFromColumns`]},ctranspose:{name:`ctranspose`,category:`Matrix`,syntax:[`x'`,`ctranspose(x)`],description:`Complex Conjugate and Transpose a matrix`,examples:[`a = [1, 2, 3; 4, 5, 6]`,`a'`,`ctranspose(a)`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`zeros`]},det:{name:`det`,category:`Matrix`,syntax:[`det(x)`],description:`Calculate the determinant of a matrix`,examples:[`det([1, 2; 3, 4])`,`det([-2, 2, 3; -1, 1, 3; 2, 0, -1])`],seealso:[`concat`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},diag:{name:`diag`,category:`Matrix`,syntax:[`diag(x)`,`diag(x, k)`],description:`Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.`,examples:[`diag(1:3)`,`diag(1:3, 1)`,`a = [1, 2, 3; 4, 5, 6; 7, 8, 9]`,`diag(a)`],seealso:[`concat`,`det`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},diff:{name:`diff`,category:`Matrix`,syntax:[`diff(arr)`,`diff(arr, dim)`],description:[`Create a new matrix or array with the difference of the passed matrix or array.`,`Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference`,`If no dimension parameter is passed it is assumed as dimension 0`,`Dimension is zero-based in javascript and one-based in the parser`,`Arrays must be 'rectangular' meaning arrays like [1, 2]`,`If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays`],examples:[`A = [1, 2, 4, 7, 0]`,`diff(A)`,`diff(A, 1)`,`B = [[1, 2], [3, 4]]`,`diff(B)`,`diff(B, 1)`,`diff(B, 2)`,`diff(B, bignumber(2))`,`diff([[1, 2], matrix([3, 4])], 2)`],seealso:[`subtract`,`partitionSelect`]},dot:{name:`dot`,category:`Matrix`,syntax:[`dot(A, B)`,`A * B`],description:`Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn`,examples:[`dot([2, 4, 1], [2, 2, 3])`,`[2, 4, 1] * [2, 2, 3]`],seealso:[`multiply`,`cross`]},getMatrixDataType:{name:`getMatrixDataType`,category:`Matrix`,syntax:[`getMatrixDataType(x)`],description:`Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".`,examples:[`getMatrixDataType([1, 2, 3])`,`getMatrixDataType([[5 cm], [2 inch]])`,`getMatrixDataType([1, "text"])`,`getMatrixDataType([1, bignumber(4)])`],seealso:[`matrix`,`sparse`,`typeOf`]},identity:{name:`identity`,category:`Matrix`,syntax:[`identity(n)`,`identity(m, n)`,`identity([m, n])`],description:`Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.`,examples:[`identity(3)`,`identity(3, 5)`,`a = [1, 2, 3; 4, 5, 6]`,`identity(size(a))`],seealso:[`concat`,`det`,`diag`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},filter:{name:`filter`,category:`Matrix`,syntax:[`filter(x, test)`],description:`Filter items in a matrix.`,examples:[`isPositive(x) = x > 0`,`filter([6, -2, -1, 4, 3], isPositive)`,`filter([6, -2, 0, 1, 0], x != 0)`],seealso:[`sort`,`map`,`forEach`]},flatten:{name:`flatten`,category:`Matrix`,syntax:[`flatten(x)`],description:`Flatten a multi dimensional matrix into a single dimensional matrix.`,examples:[`a = [1, 2, 3; 4, 5, 6]`,`size(a)`,`b = flatten(a)`,`size(b)`],seealso:[`concat`,`resize`,`size`,`squeeze`]},forEach:{name:`forEach`,category:`Matrix`,syntax:[`forEach(x, callback)`],description:`Iterates over all elements of a matrix/array, and executes the given callback function.`,examples:[`numberOfPets = {}`,`addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;`,`forEach(["Dog","Cat","Cat"], addPet)`,`numberOfPets`],seealso:[`map`,`sort`,`filter`]},inv:{name:`inv`,category:`Matrix`,syntax:[`inv(x)`],description:`Calculate the inverse of a matrix`,examples:[`inv([1, 2; 3, 4])`,`inv(4)`,`1 / 4`],seealso:[`concat`,`det`,`diag`,`identity`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},pinv:{name:`pinv`,category:`Matrix`,syntax:[`pinv(x)`],description:`Calculate the Moore–Penrose inverse of a matrix`,examples:[`pinv([1, 2; 3, 4])`,`pinv([[1, 0], [0, 1], [0, 1]])`,`pinv(4)`],seealso:[`inv`]},eigs:{name:`eigs`,category:`Matrix`,syntax:[`eigs(x)`],description:`Calculate the eigenvalues and optionally eigenvectors of a square matrix`,examples:[`eigs([[5, 2.3], [2.3, 1]])`,`eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })`],seealso:[`inv`]},kron:{name:`kron`,category:`Matrix`,syntax:[`kron(x, y)`],description:`Calculates the Kronecker product of 2 matrices or vectors.`,examples:[`kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])`,`kron([1,1], [2,3,4])`],seealso:[`multiply`,`dot`,`cross`]},matrixFromFunction:{name:`matrixFromFunction`,category:`Matrix`,syntax:[`matrixFromFunction(size, fn)`,`matrixFromFunction(size, fn, format)`,`matrixFromFunction(size, fn, format, datatype)`,`matrixFromFunction(size, format, fn)`,`matrixFromFunction(size, format, datatype, fn)`],description:`Create a matrix by evaluating a generating function at each index.`,examples:[`f(I) = I[1] - I[2]`,`matrixFromFunction([3,3], f)`,`g(I) = I[1] - I[2] == 1 ? 4 : 0`,`matrixFromFunction([100, 100], "sparse", g)`,`matrixFromFunction([5], random)`],seealso:[`matrix`,`matrixFromRows`,`matrixFromColumns`,`zeros`]},matrixFromRows:{name:`matrixFromRows`,category:`Matrix`,syntax:[`matrixFromRows(...arr)`,`matrixFromRows(row1, row2)`,`matrixFromRows(row1, row2, row3)`],description:`Create a dense matrix from vectors as individual rows.`,examples:[`matrixFromRows([1, 2, 3], [[4],[5],[6]])`],seealso:[`matrix`,`matrixFromColumns`,`matrixFromFunction`,`zeros`]},matrixFromColumns:{name:`matrixFromColumns`,category:`Matrix`,syntax:[`matrixFromColumns(...arr)`,`matrixFromColumns(row1, row2)`,`matrixFromColumns(row1, row2, row3)`],description:`Create a dense matrix from vectors as individual columns.`,examples:[`matrixFromColumns([1, 2, 3], [[4],[5],[6]])`],seealso:[`matrix`,`matrixFromRows`,`matrixFromFunction`,`zeros`]},map:{name:`map`,category:`Matrix`,syntax:[`map(x, callback)`,`map(x, y, ..., callback)`],description:`Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.`,examples:[`map([1, 2, 3], square)`,`map([1, 2], [3, 4], f(a,b) = a + b)`],seealso:[`filter`,`forEach`]},ones:{name:`ones`,category:`Matrix`,syntax:[`ones(m)`,`ones(m, n)`,`ones(m, n, p, ...)`,`ones([m])`,`ones([m, n])`,`ones([m, n, p, ...])`],description:`Create a matrix containing ones.`,examples:[`ones(3)`,`ones(3, 5)`,`ones([2,3]) * 4.5`,`a = [1, 2, 3; 4, 5, 6]`,`ones(size(a))`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},partitionSelect:{name:`partitionSelect`,category:`Matrix`,syntax:[`partitionSelect(x, k)`,`partitionSelect(x, k, compare)`],description:`Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.`,examples:[`partitionSelect([5, 10, 1], 2)`,`partitionSelect(["C", "B", "A", "D"], 1, compareText)`,`arr = [5, 2, 1]`,`partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]`,`arr`,`partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]`,`arr`],seealso:[`sort`]},range:{name:`range`,category:`Type`,syntax:[`start:end`,`start:step:end`,`range(start, end)`,`range(start, end, step)`,`range(string)`],description:`Create a range. Lower bound of the range is included, upper bound is excluded.`,examples:[`1:5`,`3:-1:-3`,`range(3, 7)`,`range(0, 12, 2)`,`range("4:10")`,`range(1m, 1m, 3m)`,`a = [1, 2, 3, 4; 5, 6, 7, 8]`,`a[1:2, 1:2]`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`size`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},resize:{name:`resize`,category:`Matrix`,syntax:[`resize(x, size)`,`resize(x, size, defaultValue)`],description:`Resize a matrix.`,examples:[`resize([1,2,3,4,5], [3])`,`resize([1,2,3], [5])`,`resize([1,2,3], [5], -1)`,`resize(2, [2, 3])`,`resize("hello", [8], "!")`],seealso:[`size`,`subset`,`squeeze`,`reshape`]},reshape:{name:`reshape`,category:`Matrix`,syntax:[`reshape(x, sizes)`],description:`Reshape a multi dimensional array to fit the specified dimensions.`,examples:[`reshape([1, 2, 3, 4, 5, 6], [2, 3])`,`reshape([[1, 2], [3, 4]], [1, 4])`,`reshape([[1, 2], [3, 4]], [4])`,`reshape([1, 2, 3, 4], [-1, 2])`],seealso:[`size`,`squeeze`,`resize`]},rotate:{name:`rotate`,category:`Matrix`,syntax:[`rotate(w, theta)`,`rotate(w, theta, v)`],description:`Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.`,examples:[`rotate([1, 0], pi / 2)`,`rotate(matrix([1, 0]), unit("35deg"))`,`rotate([1, 0, 0], unit("90deg"), [0, 0, 1])`,`rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))`],seealso:[`matrix`,`rotationMatrix`]},rotationMatrix:{name:`rotationMatrix`,category:`Matrix`,syntax:[`rotationMatrix(theta)`,`rotationMatrix(theta, v)`,`rotationMatrix(theta, v, format)`],description:`Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.`,examples:[`rotationMatrix(pi / 2)`,`rotationMatrix(unit("45deg"), [0, 0, 1])`,`rotationMatrix(1, matrix([0, 0, 1]), "sparse")`],seealso:[`cos`,`sin`]},row:{name:`row`,category:`Matrix`,syntax:[`row(x, index)`],description:`Return a row from a matrix or array.`,examples:[`A = [[1, 2], [3, 4]]`,`row(A, 1)`,`row(A, 2)`],seealso:[`column`,`matrixFromRows`]},size:{name:`size`,category:`Matrix`,syntax:[`size(x)`],description:`Calculate the size of a matrix.`,examples:[`size(2.3)`,`size("hello world")`,`a = [1, 2; 3, 4; 5, 6]`,`size(a)`,`size(1:6)`],seealso:[`concat`,`count`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`squeeze`,`subset`,`trace`,`transpose`,`zeros`]},sort:{name:`sort`,category:`Matrix`,syntax:[`sort(x)`,`sort(x, compare)`],description:`Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.`,examples:[`sort([5, 10, 1])`,`sort(["C", "B", "A", "D"], "natural")`,`sortByLength(a, b) = size(a)[1] - size(b)[1]`,`sort(["Langdon", "Tom", "Sara"], sortByLength)`,`sort(["10", "1", "2"], "natural")`],seealso:[`map`,`filter`,`forEach`]},squeeze:{name:`squeeze`,category:`Matrix`,syntax:[`squeeze(x)`],description:`Remove inner and outer singleton dimensions from a matrix.`,examples:[`a = zeros(3,2,1)`,`size(squeeze(a))`,`b = zeros(1,1,3)`,`size(squeeze(b))`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`subset`,`trace`,`transpose`,`zeros`]},subset:{name:`subset`,category:`Matrix`,syntax:[`value(index)`,`value(index) = replacement`,`subset(value, [index])`,`subset(value, [index], replacement)`],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:[`d = [1, 2; 3, 4]`,`e = []`,`e[1, 1:2] = [5, 6]`,`e[2, :] = [7, 8]`,`f = d * e`,`f[2, 1]`,`f[:, 1]`,`f[[1,2], [1,3]] = [9, 10; 11, 12]`,`f`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`trace`,`transpose`,`zeros`]},trace:{name:`trace`,category:`Matrix`,syntax:[`trace(A)`],description:`Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.`,examples:[`A = [1, 2, 3; -1, 2, 3; 2, 0, 3]`,`trace(A)`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`transpose`,`zeros`]},transpose:{name:`transpose`,category:`Matrix`,syntax:[`x'`,`transpose(x)`],description:`Transpose a matrix`,examples:[`a = [1, 2, 3; 4, 5, 6]`,`a'`,`transpose(a)`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`zeros`]},zeros:{name:`zeros`,category:`Matrix`,syntax:[`zeros(m)`,`zeros(m, n)`,`zeros(m, n, p, ...)`,`zeros([m])`,`zeros([m, n])`,`zeros([m, n, p, ...])`],description:`Create a matrix containing zeros.`,examples:[`zeros(3)`,`zeros(3, 5)`,`a = [1, 2, 3; 4, 5, 6]`,`zeros(size(a))`],seealso:[`concat`,`det`,`diag`,`identity`,`inv`,`ones`,`range`,`size`,`squeeze`,`subset`,`trace`,`transpose`]},fft:{name:`fft`,category:`Matrix`,syntax:[`fft(x)`],description:`Calculate N-dimensional Fourier transform`,examples:[`fft([[1, 0], [1, 0]])`],seealso:[`ifft`]},ifft:{name:`ifft`,category:`Matrix`,syntax:[`ifft(x)`],description:`Calculate N-dimensional inverse Fourier transform`,examples:[`ifft([[2, 2], [0, 0]])`],seealso:[`fft`]},sylvester:{name:`sylvester`,category:`Algebra`,syntax:[`sylvester(A,B,C)`],description:`Solves the real-valued Sylvester equation AX+XB=C for X`,examples:[`sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])`,`A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]`,`sylvester(A, B, C)`],seealso:[`schur`,`lyap`]},schur:{name:`schur`,category:`Algebra`,syntax:[`schur(A)`],description:`Performs a real Schur decomposition of the real matrix A = UTU'`,examples:[`schur([[1, 0], [-4, 3]])`,`A = [[1, 0], [-4, 3]]`,`schur(A)`],seealso:[`lyap`,`sylvester`]},lyap:{name:`lyap`,category:`Algebra`,syntax:[`lyap(A,Q)`],description:`Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P`,examples:[`lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])`,`A = [[-2, 0], [1, -4]]`,`Q = [[3, 1], [1, 3]]`,`lyap(A,Q)`],seealso:[`schur`,`sylvester`]},solveODE:{name:`solveODE`,category:`Numeric`,syntax:[`solveODE(func, tspan, y0)`,`solveODE(func, tspan, y0, options)`],description:`Numerical Integration of Ordinary Differential Equations.`,examples:[`f(t,y) = y`,`tspan = [0, 4]`,`solveODE(f, tspan, 1)`,`solveODE(f, tspan, [1, 2])`,`solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })`],seealso:[`derivative`,`simplifyCore`]},bernoulli:{name:`bernoulli`,category:`Probability`,syntax:[`bernoulli(n)`],description:`The nth Bernoulli number`,examples:[`bernoulli(4)`,`bernoulli(fraction(12))`],seealso:[`combinations`,`gamma`,`stirlingS2`]},combinations:{name:`combinations`,category:`Probability`,syntax:[`combinations(n, k)`],description:`Compute the number of combinations of n items taken k at a time`,examples:[`combinations(7, 5)`],seealso:[`combinationsWithRep`,`permutations`,`factorial`]},combinationsWithRep:{name:`combinationsWithRep`,category:`Probability`,syntax:[`combinationsWithRep(n, k)`],description:`Compute the number of combinations of n items taken k at a time with replacements.`,examples:[`combinationsWithRep(7, 5)`],seealso:[`combinations`,`permutations`,`factorial`]},factorial:{name:`factorial`,category:`Probability`,syntax:[`n!`,`factorial(n)`],description:`Compute the factorial of a value`,examples:[`5!`,`5 * 4 * 3 * 2 * 1`,`3!`],seealso:[`combinations`,`combinationsWithRep`,`permutations`,`gamma`]},gamma:{name:`gamma`,category:`Probability`,syntax:[`gamma(n)`],description:`Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.`,examples:[`gamma(4)`,`3!`,`gamma(1/2)`,`sqrt(pi)`],seealso:[`factorial`]},kldivergence:{name:`kldivergence`,category:`Probability`,syntax:[`kldivergence(x, y)`],description:`Calculate the Kullback-Leibler (KL) divergence between two distributions.`,examples:[`kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])`],seealso:[]},lgamma:{name:`lgamma`,category:`Probability`,syntax:[`lgamma(n)`],description:`Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.`,examples:[`lgamma(4)`,`lgamma(1/2)`,`lgamma(i)`,`lgamma(complex(1.1, 2))`],seealso:[`gamma`]},multinomial:{name:`multinomial`,category:`Probability`,syntax:[`multinomial(A)`],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:[`multinomial([1, 2, 1])`],seealso:[`combinations`,`factorial`]},permutations:{name:`permutations`,category:`Probability`,syntax:[`permutations(n)`,`permutations(n, k)`],description:`Compute the number of permutations of n items taken k at a time`,examples:[`permutations(5)`,`permutations(5, 3)`],seealso:[`combinations`,`combinationsWithRep`,`factorial`]},pickRandom:{name:`pickRandom`,category:`Probability`,syntax:[`pickRandom(array)`,`pickRandom(array, number)`,`pickRandom(array, weights)`,`pickRandom(array, number, weights)`,`pickRandom(array, weights, number)`],description:`Pick a random entry from a given array.`,examples:[`pickRandom(0:10)`,`pickRandom([1, 3, 1, 6])`,`pickRandom([1, 3, 1, 6], 2)`,`pickRandom([1, 3, 1, 6], [2, 3, 2, 1])`,`pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])`,`pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)`],seealso:[`random`,`randomInt`]},random:{name:`random`,category:`Probability`,syntax:[`random()`,`random(max)`,`random(min, max)`,`random(size)`,`random(size, max)`,`random(size, min, max)`],description:`Return a random number.`,examples:[`random()`,`random(10, 20)`,`random([2, 3])`],seealso:[`pickRandom`,`randomInt`]},randomInt:{name:`randomInt`,category:`Probability`,syntax:[`randomInt(max)`,`randomInt(min, max)`,`randomInt(size)`,`randomInt(size, max)`,`randomInt(size, min, max)`],description:`Return a random integer number`,examples:[`randomInt(10, 20)`,`randomInt([2, 3], 10)`],seealso:[`pickRandom`,`random`]},compare:{name:`compare`,category:`Relational`,syntax:[`compare(x, y)`],description:`Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.`,examples:[`compare(2, 3)`,`compare(3, 2)`,`compare(2, 2)`,`compare(5cm, 40mm)`,`compare(2, [1, 2, 3])`],seealso:[`equal`,`unequal`,`smaller`,`smallerEq`,`largerEq`,`compareNatural`,`compareText`]},compareNatural:{name:`compareNatural`,category:`Relational`,syntax:[`compareNatural(x, y)`],description:`Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.`,examples:[`compareNatural(2, 3)`,`compareNatural(3, 2)`,`compareNatural(2, 2)`,`compareNatural(5cm, 40mm)`,`compareNatural("2", "10")`,`compareNatural(2 + 3i, 2 + 4i)`,`compareNatural([1, 2, 4], [1, 2, 3])`,`compareNatural([1, 5], [1, 2, 3])`,`compareNatural([1, 2], [1, 2])`,`compareNatural({a: 2}, {a: 4})`],seealso:[`equal`,`unequal`,`smaller`,`smallerEq`,`largerEq`,`compare`,`compareText`]},compareText:{name:`compareText`,category:`Relational`,syntax:[`compareText(x, y)`],description:`Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.`,examples:[`compareText("B", "A")`,`compareText("A", "B")`,`compareText("A", "A")`,`compareText("2", "10")`,`compare("2", "10")`,`compare(2, 10)`,`compareNatural("2", "10")`,`compareText("B", ["A", "B", "C"])`],seealso:[`compare`,`compareNatural`]},deepEqual:{name:`deepEqual`,category:`Relational`,syntax:[`deepEqual(x, y)`],description:`Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.`,examples:[`deepEqual([1,3,4], [1,3,4])`,`deepEqual([1,3,4], [1,3])`],seealso:[`equal`,`unequal`,`smaller`,`larger`,`smallerEq`,`largerEq`,`compare`]},equal:{name:`equal`,category:`Relational`,syntax:[`x == y`,`equal(x, y)`],description:`Check equality of two values. Returns true if the values are equal, and false if not.`,examples:[`2+2 == 3`,`2+2 == 4`,`a = 3.2`,`b = 6-2.8`,`a == b`,`50cm == 0.5m`],seealso:[`unequal`,`smaller`,`larger`,`smallerEq`,`largerEq`,`compare`,`deepEqual`,`equalText`]},equalText:{name:`equalText`,category:`Relational`,syntax:[`equalText(x, y)`],description:`Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.`,examples:[`equalText("Hello", "Hello")`,`equalText("a", "A")`,`equal("2e3", "2000")`,`equalText("2e3", "2000")`,`equalText("B", ["A", "B", "C"])`],seealso:[`compare`,`compareNatural`,`compareText`,`equal`]},larger:{name:`larger`,category:`Relational`,syntax:[`x > y`,`larger(x, y)`],description:`Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.`,examples:[`2 > 3`,`5 > 2*2`,`a = 3.3`,`b = 6-2.8`,`(a > b)`,`(b < a)`,`5 cm > 2 inch`],seealso:[`equal`,`unequal`,`smaller`,`smallerEq`,`largerEq`,`compare`]},largerEq:{name:`largerEq`,category:`Relational`,syntax:[`x >= y`,`largerEq(x, y)`],description:`Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.`,examples:[`2 >= 1+1`,`2 > 1+1`,`a = 3.2`,`b = 6-2.8`,`(a >= b)`],seealso:[`equal`,`unequal`,`smallerEq`,`smaller`,`compare`]},smaller:{name:`smaller`,category:`Relational`,syntax:[`x < y`,`smaller(x, y)`],description:`Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.`,examples:[`2 < 3`,`5 < 2*2`,`a = 3.3`,`b = 6-2.8`,`(a < b)`,`5 cm < 2 inch`],seealso:[`equal`,`unequal`,`larger`,`smallerEq`,`largerEq`,`compare`]},smallerEq:{name:`smallerEq`,category:`Relational`,syntax:[`x <= y`,`smallerEq(x, y)`],description:`Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.`,examples:[`2 <= 1+1`,`2 < 1+1`,`a = 3.2`,`b = 6-2.8`,`(a <= b)`],seealso:[`equal`,`unequal`,`larger`,`smaller`,`largerEq`,`compare`]},unequal:{name:`unequal`,category:`Relational`,syntax:[`x != y`,`unequal(x, y)`],description:`Check unequality of two values. Returns true if the values are unequal, and false if they are equal.`,examples:[`2+2 != 3`,`2+2 != 4`,`a = 3.2`,`b = 6-2.8`,`a != b`,`50cm != 0.5m`,`5 cm != 2 inch`],seealso:[`equal`,`smaller`,`larger`,`smallerEq`,`largerEq`,`compare`,`deepEqual`]},setCartesian:{name:`setCartesian`,category:`Set`,syntax:[`setCartesian(set1, set2)`],description:`Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.`,examples:[`setCartesian([1, 2], [3, 4])`],seealso:[`setUnion`,`setIntersect`,`setDifference`,`setPowerset`]},setDifference:{name:`setDifference`,category:`Set`,syntax:[`setDifference(set1, set2)`],description:`Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.`,examples:[`setDifference([1, 2, 3, 4], [3, 4, 5, 6])`,`setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])`],seealso:[`setUnion`,`setIntersect`,`setSymDifference`]},setDistinct:{name:`setDistinct`,category:`Set`,syntax:[`setDistinct(set)`],description:`Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.`,examples:[`setDistinct([1, 1, 1, 2, 2, 3])`],seealso:[`setMultiplicity`]},setIntersect:{name:`setIntersect`,category:`Set`,syntax:[`setIntersect(set1, set2)`],description:`Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.`,examples:[`setIntersect([1, 2, 3, 4], [3, 4, 5, 6])`,`setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])`],seealso:[`setUnion`,`setDifference`]},setIsSubset:{name:`setIsSubset`,category:`Set`,syntax:[`setIsSubset(set1, set2)`],description:`Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.`,examples:[`setIsSubset([1, 2], [3, 4, 5, 6])`,`setIsSubset([3, 4], [3, 4, 5, 6])`],seealso:[`setUnion`,`setIntersect`,`setDifference`]},setMultiplicity:{name:`setMultiplicity`,category:`Set`,syntax:[`setMultiplicity(element, set)`],description:`Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.`,examples:[`setMultiplicity(1, [1, 2, 2, 4])`,`setMultiplicity(2, [1, 2, 2, 4])`],seealso:[`setDistinct`,`setSize`]},setPowerset:{name:`setPowerset`,category:`Set`,syntax:[`setPowerset(set)`],description:`Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.`,examples:[`setPowerset([1, 2, 3])`],seealso:[`setCartesian`]},setSize:{name:`setSize`,category:`Set`,syntax:[`setSize(set)`,`setSize(set, unique)`],description:`Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.`,examples:[`setSize([1, 2, 2, 4])`,`setSize([1, 2, 2, 4], true)`],seealso:[`setUnion`,`setIntersect`,`setDifference`]},setSymDifference:{name:`setSymDifference`,category:`Set`,syntax:[`setSymDifference(set1, set2)`],description:`Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.`,examples:[`setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])`,`setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])`],seealso:[`setUnion`,`setIntersect`,`setDifference`]},setUnion:{name:`setUnion`,category:`Set`,syntax:[`setUnion(set1, set2)`],description:`Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.`,examples:[`setUnion([1, 2, 3, 4], [3, 4, 5, 6])`,`setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])`],seealso:[`setIntersect`,`setDifference`]},zpk2tf:{name:`zpk2tf`,category:`Signal`,syntax:[`zpk2tf(z, p, k)`],description:`Compute the transfer function of a zero-pole-gain model.`,examples:[`zpk2tf([1, 2], [-1, -2], 1)`,`zpk2tf([1, 2], [-1, -2])`,`zpk2tf([1 - 3i, 2 + 2i], [-1, -2])`],seealso:[]},freqz:{name:`freqz`,category:`Signal`,syntax:[`freqz(b, a)`,`freqz(b, a, w)`],description:`Calculates the frequency response of a filter given its numerator and denominator coefficients.`,examples:[`freqz([1, 2], [1, 2, 3])`,`freqz([1, 2], [1, 2, 3], [0, 1])`,`freqz([1, 2], [1, 2, 3], 512)`],seealso:[]},erf:{name:`erf`,category:`Special`,syntax:[`erf(x)`],description:`Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x`,examples:[`erf(0.2)`,`erf(-0.5)`,`erf(4)`],seealso:[]},zeta:{name:`zeta`,category:`Special`,syntax:[`zeta(s)`],description:`Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane`,examples:[`zeta(0.2)`,`zeta(-0.5)`,`zeta(4)`],seealso:[]},cumsum:{name:`cumsum`,category:`Statistics`,syntax:[`cumsum(a, b, c, ...)`,`cumsum(A)`],description:`Compute the cumulative sum of all values.`,examples:[`cumsum(2, 3, 4, 1)`,`cumsum([2, 3, 4, 1])`,`cumsum([1, 2; 3, 4])`,`cumsum([1, 2; 3, 4], 1)`,`cumsum([1, 2; 3, 4], 2)`],seealso:[`max`,`mean`,`median`,`min`,`prod`,`std`,`sum`,`variance`]},mad:{name:`mad`,category:`Statistics`,syntax:[`mad(a, b, c, ...)`,`mad(A)`],description:`Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.`,examples:[`mad(10, 20, 30)`,`mad([1, 2, 3])`],seealso:[`mean`,`median`,`std`,`abs`]},max:{name:`max`,category:`Statistics`,syntax:[`max(a, b, c, ...)`,`max(A)`,`max(A, dimension)`],description:`Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.`,examples:[`max(2, 3, 4, 1)`,`max([2, 3, 4, 1])`,`max([2, 5; 4, 3])`,`max([2, 5; 4, 3], 1)`,`max([2, 5; 4, 3], 2)`,`max(2.7, 7.1, -4.5, 2.0, 4.1)`,`min(2.7, 7.1, -4.5, 2.0, 4.1)`],seealso:[`mean`,`median`,`min`,`prod`,`std`,`sum`,`variance`]},mean:{name:`mean`,category:`Statistics`,syntax:[`mean(a, b, c, ...)`,`mean(A)`,`mean(A, dimension)`],description:`Compute the arithmetic mean of a list of values.`,examples:[`mean(2, 3, 4, 1)`,`mean([2, 3, 4, 1])`,`mean([2, 5; 4, 3])`,`mean([2, 5; 4, 3], 1)`,`mean([2, 5; 4, 3], 2)`,`mean([1.0, 2.7, 3.2, 4.0])`],seealso:[`max`,`median`,`min`,`prod`,`std`,`sum`,`variance`]},median:{name:`median`,category:`Statistics`,syntax:[`median(a, b, c, ...)`,`median(A)`],description:`Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.`,examples:[`median(5, 2, 7)`,`median([3, -1, 5, 7])`],seealso:[`max`,`mean`,`min`,`prod`,`std`,`sum`,`variance`,`quantileSeq`]},min:{name:`min`,category:`Statistics`,syntax:[`min(a, b, c, ...)`,`min(A)`,`min(A, dimension)`],description:`Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.`,examples:[`min(2, 3, 4, 1)`,`min([2, 3, 4, 1])`,`min([2, 5; 4, 3])`,`min([2, 5; 4, 3], 1)`,`min([2, 5; 4, 3], 2)`,`min(2.7, 7.1, -4.5, 2.0, 4.1)`,`max(2.7, 7.1, -4.5, 2.0, 4.1)`],seealso:[`max`,`mean`,`median`,`prod`,`std`,`sum`,`variance`]},mode:{name:`mode`,category:`Statistics`,syntax:[`mode(a, b, c, ...)`,`mode(A)`,`mode(A, a, b, B, c, ...)`],description:`Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.`,examples:[`mode(2, 1, 4, 3, 1)`,`mode([1, 2.7, 3.2, 4, 2.7])`,`mode(1, 4, 6, 1, 6)`],seealso:[`max`,`mean`,`min`,`median`,`prod`,`std`,`sum`,`variance`]},prod:{name:`prod`,category:`Statistics`,syntax:[`prod(a, b, c, ...)`,`prod(A)`],description:`Compute the product of all values.`,examples:[`prod(2, 3, 4)`,`prod([2, 3, 4])`,`prod([2, 5; 4, 3])`],seealso:[`max`,`mean`,`min`,`median`,`min`,`std`,`sum`,`variance`]},quantileSeq:{name:`quantileSeq`,category:`Statistics`,syntax:[`quantileSeq(A, prob[, sorted])`,`quantileSeq(A, [prob1, prob2, ...][, sorted])`,`quantileSeq(A, N[, sorted])`],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber.
|
|
53
|
+
|
|
54
|
+
In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:[`quantileSeq([3, -1, 5, 7], 0.5)`,`quantileSeq([3, -1, 5, 7], [1/3, 2/3])`,`quantileSeq([3, -1, 5, 7], 2)`,`quantileSeq([-1, 3, 5, 7], 0.5, true)`],seealso:[`mean`,`median`,`min`,`max`,`prod`,`std`,`sum`,`variance`]},std:{name:`std`,category:`Statistics`,syntax:[`std(a, b, c, ...)`,`std(A)`,`std(A, dimension)`,`std(A, normalization)`,`std(A, dimension, normalization)`],description:`Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".`,examples:[`std(2, 4, 6)`,`std([2, 4, 6, 8])`,`std([2, 4, 6, 8], "uncorrected")`,`std([2, 4, 6, 8], "biased")`,`std([1, 2, 3; 4, 5, 6])`],seealso:[`max`,`mean`,`min`,`median`,`prod`,`sum`,`variance`]},sum:{name:`sum`,category:`Statistics`,syntax:[`sum(a, b, c, ...)`,`sum(A)`,`sum(A, dimension)`],description:`Compute the sum of all values.`,examples:[`sum(2, 3, 4, 1)`,`sum([2, 3, 4, 1])`,`sum([2, 5; 4, 3])`],seealso:[`max`,`mean`,`median`,`min`,`prod`,`std`,`variance`]},variance:{name:`variance`,category:`Statistics`,syntax:[`variance(a, b, c, ...)`,`variance(A)`,`variance(A, dimension)`,`variance(A, normalization)`,`variance(A, dimension, normalization)`],description:`Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".`,examples:[`variance(2, 4, 6)`,`variance([2, 4, 6, 8])`,`variance([2, 4, 6, 8], "uncorrected")`,`variance([2, 4, 6, 8], "biased")`,`variance([1, 2, 3; 4, 5, 6])`],seealso:[`max`,`mean`,`min`,`median`,`min`,`prod`,`std`,`sum`]},corr:{name:`corr`,category:`Statistics`,syntax:[`corr(A,B)`],description:`Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.`,examples:[`corr([2, 4, 6, 8],[1, 2, 3, 6])`,`corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))`],seealso:[`max`,`mean`,`min`,`median`,`min`,`prod`,`std`,`sum`]},acos:{name:`acos`,category:`Trigonometry`,syntax:[`acos(x)`],description:`Compute the inverse cosine of a value in radians.`,examples:[`acos(0.5)`,`acos(cos(2.3))`],seealso:[`cos`,`atan`,`asin`]},acosh:{name:`acosh`,category:`Trigonometry`,syntax:[`acosh(x)`],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:[`acosh(1.5)`],seealso:[`cosh`,`asinh`,`atanh`]},acot:{name:`acot`,category:`Trigonometry`,syntax:[`acot(x)`],description:`Calculate the inverse cotangent of a value.`,examples:[`acot(0.5)`,`acot(cot(0.5))`,`acot(2)`],seealso:[`cot`,`atan`]},acoth:{name:`acoth`,category:`Trigonometry`,syntax:[`acoth(x)`],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:[`acoth(2)`,`acoth(0.5)`],seealso:[`acsch`,`asech`]},acsc:{name:`acsc`,category:`Trigonometry`,syntax:[`acsc(x)`],description:`Calculate the inverse cotangent of a value.`,examples:[`acsc(2)`,`acsc(csc(0.5))`,`acsc(0.5)`],seealso:[`csc`,`asin`,`asec`]},acsch:{name:`acsch`,category:`Trigonometry`,syntax:[`acsch(x)`],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:[`acsch(0.5)`],seealso:[`asech`,`acoth`]},asec:{name:`asec`,category:`Trigonometry`,syntax:[`asec(x)`],description:`Calculate the inverse secant of a value.`,examples:[`asec(0.5)`,`asec(sec(0.5))`,`asec(2)`],seealso:[`acos`,`acot`,`acsc`]},asech:{name:`asech`,category:`Trigonometry`,syntax:[`asech(x)`],description:`Calculate the inverse secant of a value.`,examples:[`asech(0.5)`],seealso:[`acsch`,`acoth`]},asin:{name:`asin`,category:`Trigonometry`,syntax:[`asin(x)`],description:`Compute the inverse sine of a value in radians.`,examples:[`asin(0.5)`,`asin(sin(0.5))`],seealso:[`sin`,`acos`,`atan`]},asinh:{name:`asinh`,category:`Trigonometry`,syntax:[`asinh(x)`],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:[`asinh(0.5)`],seealso:[`acosh`,`atanh`]},atan:{name:`atan`,category:`Trigonometry`,syntax:[`atan(x)`],description:`Compute the inverse tangent of a value in radians.`,examples:[`atan(0.5)`,`atan(tan(0.5))`],seealso:[`tan`,`acos`,`asin`]},atanh:{name:`atanh`,category:`Trigonometry`,syntax:[`atanh(x)`],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:[`atanh(0.5)`],seealso:[`acosh`,`asinh`]},atan2:{name:`atan2`,category:`Trigonometry`,syntax:[`atan2(y, x)`],description:`Computes the principal value of the arc tangent of y/x in radians.`,examples:[`atan2(2, 2) / pi`,`angle = 60 deg in rad`,`x = cos(angle)`,`y = sin(angle)`,`atan2(y, x)`],seealso:[`sin`,`cos`,`tan`]},cos:{name:`cos`,category:`Trigonometry`,syntax:[`cos(x)`],description:`Compute the cosine of x in radians.`,examples:[`cos(2)`,`cos(pi / 4) ^ 2`,`cos(180 deg)`,`cos(60 deg)`,`sin(0.2)^2 + cos(0.2)^2`],seealso:[`acos`,`sin`,`tan`]},cosh:{name:`cosh`,category:`Trigonometry`,syntax:[`cosh(x)`],description:`Compute the hyperbolic cosine of x in radians.`,examples:[`cosh(0.5)`],seealso:[`sinh`,`tanh`,`coth`]},cot:{name:`cot`,category:`Trigonometry`,syntax:[`cot(x)`],description:`Compute the cotangent of x in radians. Defined as 1/tan(x)`,examples:[`cot(2)`,`1 / tan(2)`],seealso:[`sec`,`csc`,`tan`]},coth:{name:`coth`,category:`Trigonometry`,syntax:[`coth(x)`],description:`Compute the hyperbolic cotangent of x in radians.`,examples:[`coth(2)`,`1 / tanh(2)`],seealso:[`sech`,`csch`,`tanh`]},csc:{name:`csc`,category:`Trigonometry`,syntax:[`csc(x)`],description:`Compute the cosecant of x in radians. Defined as 1/sin(x)`,examples:[`csc(2)`,`1 / sin(2)`],seealso:[`sec`,`cot`,`sin`]},csch:{name:`csch`,category:`Trigonometry`,syntax:[`csch(x)`],description:`Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)`,examples:[`csch(2)`,`1 / sinh(2)`],seealso:[`sech`,`coth`,`sinh`]},sec:{name:`sec`,category:`Trigonometry`,syntax:[`sec(x)`],description:`Compute the secant of x in radians. Defined as 1/cos(x)`,examples:[`sec(2)`,`1 / cos(2)`],seealso:[`cot`,`csc`,`cos`]},sech:{name:`sech`,category:`Trigonometry`,syntax:[`sech(x)`],description:`Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)`,examples:[`sech(2)`,`1 / cosh(2)`],seealso:[`coth`,`csch`,`cosh`]},sin:{name:`sin`,category:`Trigonometry`,syntax:[`sin(x)`],description:`Compute the sine of x in radians.`,examples:[`sin(2)`,`sin(pi / 4) ^ 2`,`sin(90 deg)`,`sin(30 deg)`,`sin(0.2)^2 + cos(0.2)^2`],seealso:[`asin`,`cos`,`tan`]},sinh:{name:`sinh`,category:`Trigonometry`,syntax:[`sinh(x)`],description:`Compute the hyperbolic sine of x in radians.`,examples:[`sinh(0.5)`],seealso:[`cosh`,`tanh`]},tan:{name:`tan`,category:`Trigonometry`,syntax:[`tan(x)`],description:`Compute the tangent of x in radians.`,examples:[`tan(0.5)`,`sin(0.5) / cos(0.5)`,`tan(pi / 4)`,`tan(45 deg)`],seealso:[`atan`,`sin`,`cos`]},tanh:{name:`tanh`,category:`Trigonometry`,syntax:[`tanh(x)`],description:`Compute the hyperbolic tangent of x in radians.`,examples:[`tanh(0.5)`,`sinh(0.5) / cosh(0.5)`],seealso:[`sinh`,`cosh`]},to:{name:`to`,category:`Units`,syntax:[`x to unit`,`to(x, unit)`],description:`Change the unit of a value.`,examples:[`5 inch to cm`,`3.2kg to g`,`16 bytes in bits`],seealso:[]},toBest:{name:`toBest`,category:`Units`,syntax:[`toBest(x)`,`toBest(x, unitList)`,`toBest(x, unitList, options)`],description:`Converts to the most appropriate display unit.`,examples:[`toBest(unit(5000, "m"))`,`toBest(unit(3500000, "W"))`,`toBest(unit(0.000000123, "A"))`,`toBest(unit(10, "m"), "cm")`,`toBest(unit(10, "m"), "mm,km", {offset: 1.5})`],seealso:[]},clone:{name:`clone`,category:`Utils`,syntax:[`clone(x)`],description:`Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices`,examples:[`clone(3.5)`,`clone(2 - 4i)`,`clone(45 deg)`,`clone([1, 2; 3, 4])`,`clone("hello world")`],seealso:[]},format:{name:`format`,category:`Utils`,syntax:[`format(value)`,`format(value, precision)`],description:`Format a value of any type as string.`,examples:[`format(2.3)`,`format(3 - 4i)`,`format([])`,`format(pi, 3)`],seealso:[`print`]},bin:{name:`bin`,category:`Utils`,syntax:[`bin(value)`],description:`Format a number as binary`,examples:[`bin(2)`],seealso:[`oct`,`hex`]},oct:{name:`oct`,category:`Utils`,syntax:[`oct(value)`],description:`Format a number as octal`,examples:[`oct(56)`],seealso:[`bin`,`hex`]},hex:{name:`hex`,category:`Utils`,syntax:[`hex(value)`],description:`Format a number as hexadecimal`,examples:[`hex(240)`],seealso:[`bin`,`oct`]},isNaN:{name:`isNaN`,category:`Utils`,syntax:[`isNaN(x)`],description:`Test whether a value is NaN (not a number)`,examples:[`isNaN(2)`,`isNaN(0 / 0)`,`isNaN(NaN)`,`isNaN(Infinity)`],seealso:[`isNegative`,`isNumeric`,`isPositive`,`isZero`,`isFinite`,`isBounded`]},isBounded:{name:`isBounded`,category:`Utils`,syntax:[`isBounded(x)`],description:`Test whether a value or its entries are bounded.`,examples:[`isBounded(Infinity)`,`isBounded(bigint(3))`,`isBounded([3, -Infinity, -3])`],seealso:[`isFinite`,`isNumeric`,`isNaN`,`isNegative`,`isPositive`]},isFinite:{name:`isFinite`,category:`Utils`,syntax:[`isFinite(x)`],description:`Test whether a value is finite, elementwise on collections.`,examples:[`isFinite(Infinity)`,`isFinite(bigint(3))`,`isFinite([3, -Infinity, -3])`],seealso:[`isBounded`,`isNumeric`,`isNaN`,`isNegative`,`isPositive`]},isInteger:{name:`isInteger`,category:`Utils`,syntax:[`isInteger(x)`],description:`Test whether a value is an integer number.`,examples:[`isInteger(2)`,`isInteger(3.5)`,`isInteger([3, 0.5, -2])`],seealso:[`isNegative`,`isNumeric`,`isPositive`,`isZero`]},isNegative:{name:`isNegative`,category:`Utils`,syntax:[`isNegative(x)`],description:`Test whether a value is negative: smaller than zero.`,examples:[`isNegative(2)`,`isNegative(0)`,`isNegative(-4)`,`isNegative([3, 0.5, -2])`],seealso:[`isInteger`,`isNumeric`,`isPositive`,`isZero`]},isNumeric:{name:`isNumeric`,category:`Utils`,syntax:[`isNumeric(x)`],description:`Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.`,examples:[`isNumeric(2)`,`isNumeric("2")`,`hasNumericValue("2")`,`isNumeric(0)`,`isNumeric(bignumber(500))`,`isNumeric(fraction(0.125))`,`isNumeric(2 + 3i)`,`isNumeric([2.3, "foo", false])`],seealso:[`isInteger`,`isZero`,`isNegative`,`isPositive`,`isNaN`,`hasNumericValue`,`isFinite`,`isBounded`]},hasNumericValue:{name:`hasNumericValue`,category:`Utils`,syntax:[`hasNumericValue(x)`],description:`Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.`,examples:[`hasNumericValue(2)`,`hasNumericValue("2")`,`isNumeric("2")`,`hasNumericValue(0)`,`hasNumericValue(bignumber(500))`,`hasNumericValue(fraction(0.125))`,`hasNumericValue(2 + 3i)`,`hasNumericValue([2.3, "foo", false])`],seealso:[`isInteger`,`isZero`,`isNegative`,`isPositive`,`isNaN`,`isNumeric`]},isPositive:{name:`isPositive`,category:`Utils`,syntax:[`isPositive(x)`],description:`Test whether a value is positive: larger than zero.`,examples:[`isPositive(2)`,`isPositive(0)`,`isPositive(-4)`,`isPositive([3, 0.5, -2])`],seealso:[`isInteger`,`isNumeric`,`isNegative`,`isZero`]},isPrime:{name:`isPrime`,category:`Utils`,syntax:[`isPrime(x)`],description:`Test whether a value is prime: has no divisors other than itself and one.`,examples:[`isPrime(3)`,`isPrime(-2)`,`isPrime([2, 17, 100])`],seealso:[`isInteger`,`isNumeric`,`isNegative`,`isZero`]},isZero:{name:`isZero`,category:`Utils`,syntax:[`isZero(x)`],description:`Test whether a value is zero.`,examples:[`isZero(2)`,`isZero(0)`,`isZero(-4)`,`isZero([3, 0, -2, 0])`],seealso:[`isInteger`,`isNumeric`,`isNegative`,`isPositive`]},print:{name:`print`,category:`Utils`,syntax:[`print(template, values)`,`print(template, values, precision)`],description:`Interpolate values into a string template.`,examples:[`print("Lucy is $age years old", {age: 5})`,`print("The value of pi is $pi", {pi: pi}, 3)`,`print("Hello, $user.name!", {user: {name: "John"}})`,`print("Values: $1, $2, $3", [6, 9, 4])`],seealso:[`format`]},typeOf:{name:`typeOf`,category:`Utils`,syntax:[`typeOf(x)`],description:`Get the type of a variable.`,examples:[`typeOf(3.5)`,`typeOf(2 - 4i)`,`typeOf(45 deg)`,`typeOf("hello world")`],seealso:[`getMatrixDataType`]},numeric:{name:`numeric`,category:`Utils`,syntax:[`numeric(x)`],description:`Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.`,examples:[`numeric("4")`,`numeric("4", "number")`,`numeric("4", "bigint")`,`numeric("4", "BigNumber")`,`numeric("4", "Fraction")`,`numeric(4, "Fraction")`,`numeric(fraction(2, 5), "number")`],seealso:[`number`,`bigint`,`fraction`,`bignumber`,`string`,`format`]}},Vg=`help`,Hg=V(Vg,[`typed`,`mathWithTransform`,`Help`],e=>{var{typed:t,mathWithTransform:n,Help:r}=e;return t(Vg,{any:function(e){var t,i=e;if(typeof e!=`string`){for(t in n)if(z(n,t)&&e===n[t]){i=t;break}}var a=f(Bg,i);if(!a){var o=typeof i==`function`?i.name:i;throw Error(`No documentation found on "`+o+`"`)}return new r(a)}})}),Ug=`chain`,Wg=V(Ug,[`typed`,`Chain`],e=>{var{typed:t,Chain:n}=e;return t(Ug,{"":function(){return new n},any:function(e){return new n(e)}})}),Gg=`det`,Kg=V(Gg,[`typed`,`matrix`,`subtractScalar`,`multiply`,`divideScalar`,`isZero`,`unaryMinus`],e=>{var{typed:t,matrix:n,subtractScalar:r,multiply:i,divideScalar:a,isZero:o,unaryMinus:s}=e;return t(Gg,{any:function(e){return Ne(e)},"Array | Matrix":function(e){var t;switch(F(e)?t=e.size():Array.isArray(e)?(e=n(e),t=e.size()):t=[],t.length){case 0:return Ne(e);case 1:if(t[0]===1)return Ne(e.valueOf()[0]);if(t[0]===0)return 1;throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);case 2:var r=t[0],i=t[1];if(r===i)return c(e.clone().valueOf(),r,i);if(i===0)return 1;throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);default:throw RangeError(`Matrix must be two dimensional (size: `+oi(t)+`)`)}}});function c(e,t,n){if(t===1)return Ne(e[0][0]);if(t===2)return r(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var c=!1,l=Array(t).fill(0).map((e,t)=>t),u=0;u<t;u++){var d=l[u];if(o(e[d][u])){var f=void 0;for(f=u+1;f<t;f++)if(!o(e[l[f]][u])){d=l[f],l[f]=l[u],l[u]=d,c=!c;break}if(f===t)return e[d][u]}for(var p=e[d][u],m=u===0?1:e[l[u-1]][u-1],h=u+1;h<t;h++)for(var g=l[h],_=u+1;_<t;_++)e[g][_]=a(r(i(e[g][_],p),i(e[g][u],e[d][_])),m)}var v=e[l[t-1]][t-1];return c?s(v):v}}),qg=`inv`,Jg=V(qg,[`typed`,`matrix`,`divideScalar`,`addScalar`,`multiply`,`unaryMinus`,`det`,`identity`,`abs`],e=>{var{typed:t,matrix:n,divideScalar:r,addScalar:i,multiply:a,unaryMinus:o,det:s,identity:c,abs:l}=e;return t(qg,{"Array | Matrix":function(e){var t=F(e)?e.size():gi(e);switch(t.length){case 1:if(t[0]===1)return F(e)?n([r(1,e.valueOf()[0])]):[r(1,e[0])];throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);case 2:var i=t[0],a=t[1];if(i===a)return F(e)?n(u(e.valueOf(),i,a),e.storage()):u(e,i,a);throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);default:throw RangeError(`Matrix must be two dimensional (size: `+oi(t)+`)`)}},any:function(e){return r(1,e)}});function u(e,t,n){var u,d,f,p,m;if(t===1){if(p=e[0][0],p===0)throw Error(`Cannot calculate inverse, determinant is zero`);return[[r(1,p)]]}if(t===2){var h=s(e);if(h===0)throw Error(`Cannot calculate inverse, determinant is zero`);return[[r(e[1][1],h),r(o(e[0][1]),h)],[r(o(e[1][0]),h),r(e[0][0],h)]]}var g=e.concat();for(u=0;u<t;u++)g[u]=g[u].concat();for(var _=c(t).valueOf(),v=0;v<n;v++){var y=l(g[v][v]),b=v;for(u=v+1;u<t;)l(g[u][v])>y&&(y=l(g[u][v]),b=u),u++;if(y===0)throw Error(`Cannot calculate inverse, determinant is zero`);u=b,u!==v&&(m=g[v],g[v]=g[u],g[u]=m,m=_[v],_[v]=_[u],_[u]=m);var x=g[v],S=_[v];for(u=0;u<t;u++){var C=g[u],w=_[u];if(u!==v){if(C[v]!==0){for(f=r(o(C[v]),x[v]),d=v;d<n;d++)C[d]=i(C[d],a(f,x[d]));for(d=0;d<n;d++)w[d]=i(w[d],a(f,S[d]))}}else{for(f=x[v],d=v;d<n;d++)C[d]=r(C[d],f);for(d=0;d<n;d++)w[d]=r(w[d],f)}}}return _}}),Yg=`pinv`,Xg=V(Yg,[`typed`,`matrix`,`inv`,`deepEqual`,`equal`,`dotDivide`,`dot`,`ctranspose`,`divideScalar`,`multiply`,`add`,`Complex`],e=>{var{typed:t,matrix:n,inv:r,deepEqual:i,equal:a,dotDivide:o,dot:s,ctranspose:c,divideScalar:l,multiply:u,add:d,Complex:f}=e;return t(Yg,{"Array | Matrix":function(e){var t=F(e)?e.size():gi(e);switch(t.length){case 1:return _(e)?c(e):t[0]===1?r(e):o(c(e),s(e,e));case 2:if(_(e))return c(e);var i=t[0],a=t[1];if(i===a)try{return r(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return F(e)?n(p(e.valueOf(),i,a),e.storage()):p(e,i,a);default:throw RangeError(`Matrix must be two dimensional (size: `+oi(t)+`)`)}},any:function(e){return a(e,0)?Ne(e):l(1,e)}});function p(e,t,n){var{C:i,F:a}=h(e,t,n),o=u(r(u(c(i),i)),c(i));return u(u(c(a),r(u(a,c(a)))),o)}function m(e,t,n){for(var r=Ne(e),i=0,a=0;a<t;a++){if(n<=i)return r;for(var s=a;g(r[s][i]);)if(s++,t===s&&(s=a,i++,n===i))return r;[r[s],r[a]]=[r[a],r[s]];for(var c=r[a][i],l=0;l<n;l++)r[a][l]=o(r[a][l],c);for(var f=0;f<t;f++)if(f!==a){c=r[f][i];for(var p=0;p<n;p++)r[f][p]=d(r[f][p],u(-1,u(c,r[a][p])))}i++}return r}function h(e,t,n){var r=m(e,t,n);return{C:e.map((e,n)=>e.filter((e,n)=>n<t&&!g(s(r[n],r[n])))),F:r.filter((e,t)=>!g(s(r[t],r[t])))}}function g(e){return a(d(e,f(1,1)),d(0,f(1,1)))}function _(e){return i(d(e,f(1,1)),d(u(e,0),f(1,1)))}});function Zg(e){var{addScalar:t,subtract:n,flatten:r,multiply:i,multiplyScalar:a,divideScalar:o,sqrt:s,abs:c,bignumber:l,diag:u,size:d,reshape:f,inv:p,qr:m,usolve:h,usolveAll:g,equal:_,complex:v,larger:y,smaller:b,matrixFromColumns:x,dot:S}=e;function C(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=w(e,t,n,r,i);T(e,t,n,r,i,a);var{values:o,C:s}=E(e,t,n,r,i);return i?{values:o,eigenvectors:D(e,t,s,a,o,n,r)}:{values:o}}function w(e,n,r,i,s){var d=i===`BigNumber`,f=i===`Complex`,p=d?l(0):0,m=d?l(1):f?v(1):1,h=d?l(1):1,g=d?l(10):2,x=a(g,g),S;s&&(S=Array(n).fill(m));for(var C=!1;!C;){C=!0;for(var w=0;w<n;w++){for(var T=p,E=p,D=0;D<n;D++)w!==D&&(T=t(T,c(e[D][w])),E=t(E,c(e[w][D])));if(!_(T,0)&&!_(E,0)){for(var O=h,k=T,A=o(E,g),j=a(E,g);b(k,A);)k=a(k,x),O=a(O,g);for(;y(k,j);)k=o(k,x),O=o(O,g);if(b(o(t(k,E),O),a(t(T,E),.95))){C=!1;for(var M=o(1,O),N=0;N<n;N++)w!==N&&(e[w][N]=a(e[w][N],M),e[N][w]=a(e[N][w],O));s&&(S[w]=a(S[w],M))}}}}return s?u(S):null}function T(e,r,i,s,u,d){var f=s===`BigNumber`,p=f?l(0):s===`Complex`?v(0):0;f&&(i=l(i));for(var m=0;m<r-2;m++){for(var h=0,g=p,_=m+1;_<r;_++){var y=e[_][m];b(c(g),c(y))&&(g=y,h=_)}if(!b(c(g),i)){if(h!==m+1){var x=e[h];e[h]=e[m+1],e[m+1]=x;for(var S=0;S<r;S++){var C=e[S][h];e[S][h]=e[S][m+1],e[S][m+1]=C}if(u){var w=d[h];d[h]=d[m+1],d[m+1]=w}}for(var T=m+2;T<r;T++){var E=o(e[T][m],g);if(E!==0){for(var D=0;D<r;D++)e[T][D]=n(e[T][D],a(E,e[m+1][D]));for(var O=0;O<r;O++)e[O][m+1]=t(e[O][m+1],a(E,e[O][T]));if(u)for(var k=0;k<r;k++)d[T][k]=n(d[T][k],a(E,d[m+1][k]))}}}}return d}function E(e,r,a,o,s){var d=o===`BigNumber`,f=d?l(1):o===`Complex`?v(1):1;d&&(a=l(a));for(var p=Ne(e),h=[],g=r,_=[],y=s?u(Array(r).fill(f)):void 0,x=s?u(Array(g).fill(f)):void 0,S=0;S<=100;){S+=1;for(var C=p[g-1][g-1],w=0;w<g;w++)p[w][w]=n(p[w][w],C);var{Q:T,R:E}=m(p);p=i(E,T);for(var D=0;D<g;D++)p[D][D]=t(p[D][D],C);if(s&&(x=i(x,T)),g===1||b(c(p[g-1][g-2]),a)){S=0,h.push(p[g-1][g-1]),s&&(_.unshift([[1]]),A(x,r),y=i(y,x),g>1&&(x=u(Array(g-1).fill(f)))),--g,p.pop();for(var M=0;M<g;M++)p[M].pop()}else if(g===2||b(c(p[g-2][g-3]),a)){S=0;var N=O(p[g-2][g-2],p[g-2][g-1],p[g-1][g-2],p[g-1][g-1]);h.push(...N),s&&(_.unshift(k(p[g-2][g-2],p[g-2][g-1],p[g-1][g-2],p[g-1][g-1],N[0],N[1],a,o)),A(x,r),y=i(y,x),g>2&&(x=u(Array(g-2).fill(f)))),g-=2,p.pop(),p.pop();for(var P=0;P<g;P++)p[P].pop(),p[P].pop()}if(g===0)break}if(h.sort((e,t)=>+n(c(e),c(t))),S>100){var F=Error(`The eigenvalues failed to converge. Only found these eigenvalues: `+h.join(`, `));throw F.values=h,F.vectors=[],F}return{values:h,C:s?i(y,j(_,r)):void 0}}function D(e,t,a,o,s,c,d){var f=i(p(a),e,a),m=d===`BigNumber`,h=d===`Complex`,y=m?l(0):h?v(0):0,b=m?l(1):h?v(1):1,x=[],S=[];for(var C of s){var w=M(x,C,_);w===-1?(x.push(C),S.push(1)):S[w]+=1}for(var T=[],E=x.length,D=Array(t).fill(y),O=u(Array(t).fill(b)),k=function(){var e=x[A],s=n(f,i(e,O)),l=g(s,D);for(l.shift();l.length<S[A];){var u=N(s,t,l,c,d);if(u===null)break;l.push(u)}var m=i(p(o),a);l=l.map(e=>i(m,e)),T.push(...l.map(t=>({value:e,vector:r(t)})))},A=0;A<E;A++)k();return T}function O(e,r,i,o){var c=t(e,o),l=n(a(e,o),a(r,i)),u=a(c,.5),d=a(s(n(a(c,c),a(4,l))),.5);return[t(u,d),n(u,d)]}function k(e,t,r,i,a,o,s,u){var d=u===`BigNumber`,f=u===`Complex`,p=d?l(0):f?v(0):0,m=d?l(1):f?v(1):1;if(b(c(r),s))return[[m,p],[p,m]];if(y(c(n(a,o)),s))return[[n(a,i),n(o,i)],[r,r]];var h=n(e,a),g=n(i,a);return b(c(t),s)&&b(c(g),s)?[[h,m],[r,p]]:[[t,p],[g,m]]}function A(e,t){for(var n=0;n<e.length;n++)e[n].push(...Array(t-e[n].length).fill(0));for(var r=e.length;r<t;r++)e.push(Array(t).fill(0)),e[r][r]=1;return e}function j(e,t){for(var n=[],r=0;r<t;r++)n[r]=Array(t).fill(0);var i=0;for(var a of e){for(var o=a.length,s=0;s<o;s++)for(var c=0;c<o;c++)n[i+s][i+c]=a[s][c];i+=o}return n}function M(e,t,n){for(var r=0;r<e.length;r++)if(n(e[r],t))return r;return-1}function N(e,t,n,r,i){for(var a=i===`BigNumber`?l(1e3):1e3,o,s=0;s<5;++s){o=P(t,n,i);try{o=h(e,o)}catch{continue}if(y(ee(o),a))break}if(s>=5)return null;for(s=0;;){var c=h(e,o);if(b(ee(F(o,[c])),r))break;if(++s>=10)return null;o=te(c)}return o}function P(e,t,n){var r=n===`BigNumber`,i=n===`Complex`,a=Array(e).fill(0).map(e=>2*Math.random()-1);return r&&(a=a.map(e=>l(e))),i&&(a=a.map(e=>v(e))),a=F(a,t),te(a,n)}function F(e,t){var r=d(e);for(var a of t)a=f(a,r),e=n(e,i(o(S(a,e),S(a,a)),a));return e}function ee(e){return c(s(S(e,e)))}function te(e,t){return i(o(t===`BigNumber`?l(1):t===`Complex`?v(1):1,ee(e)),e)}return C}function Qg(e){var{config:t,addScalar:n,subtract:r,abs:i,atan:a,cos:o,sin:s,multiplyScalar:c,inv:l,bignumber:u,multiply:d,add:f}=e;function p(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.relTol,i=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(i===`number`)return m(e,r,a);if(i===`BigNumber`)return h(e,r,a);throw TypeError(`Unsupported data type: `+i)}function m(e,t,n){var r=e.length,i=Math.abs(t/r),a,o;if(n){o=Array(r);for(var s=0;s<r;s++)o[s]=Array(r).fill(0),o[s][s]=1}for(var c=S(e);Math.abs(c[1])>=Math.abs(i);){var l=c[0][0],u=c[0][1];a=g(e[l][l],e[u][u],e[l][u]),e=x(e,a,l,u),n&&(o=v(o,a,l,u)),c=S(e)}for(var d=Array(r).fill(0),f=0;f<r;f++)d[f]=e[f][f];return w(Ne(d),o,n)}function h(e,t,n){var r=e.length,a=i(t/r),o,s;if(n){s=Array(r);for(var c=0;c<r;c++)s[c]=Array(r).fill(0),s[c][c]=1}for(var l=C(e);i(l[1])>=i(a);){var u=l[0][0],d=l[0][1];o=_(e[u][u],e[d][d],e[u][d]),e=b(e,o,u,d),n&&(s=y(s,o,u,d)),l=C(e)}for(var f=Array(r).fill(0),p=0;p<r;p++)f[p]=e[p][p];return w(Ne(f),s,n)}function g(e,n,r){var i=n-e;return Math.abs(i)<=t.relTol?Math.PI/4:.5*Math.atan(2*r/(n-e))}function _(e,n,o){var s=r(n,e);return i(s)<=t.relTol?u(-1).acos().div(4):c(.5,a(d(2,o,l(s))))}function v(e,t,n,r){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=Array(i).fill(0),c=Array(i).fill(0),l=0;l<i;l++)s[l]=a*e[l][n]-o*e[l][r],c[l]=o*e[l][n]+a*e[l][r];for(var u=0;u<i;u++)e[u][n]=s[u],e[u][r]=c[u];return e}function y(e,t,i,a){for(var l=e.length,d=o(t),f=s(t),p=Array(l).fill(u(0)),m=Array(l).fill(u(0)),h=0;h<l;h++)p[h]=r(c(d,e[h][i]),c(f,e[h][a])),m[h]=n(c(f,e[h][i]),c(d,e[h][a]));for(var g=0;g<l;g++)e[g][i]=p[g],e[g][a]=m[g];return e}function b(e,t,i,a){for(var l=e.length,p=u(o(t)),m=u(s(t)),h=c(p,p),g=c(m,m),_=Array(l).fill(u(0)),v=Array(l).fill(u(0)),y=d(u(2),p,m,e[i][a]),b=n(r(c(h,e[i][i]),y),c(g,e[a][a])),x=f(c(g,e[i][i]),y,c(h,e[a][a])),S=0;S<l;S++)_[S]=r(c(p,e[i][S]),c(m,e[a][S])),v[S]=n(c(m,e[i][S]),c(p,e[a][S]));e[i][i]=b,e[a][a]=x,e[i][a]=u(0),e[a][i]=u(0);for(var C=0;C<l;C++)C!==i&&C!==a&&(e[i][C]=_[C],e[C][i]=_[C],e[a][C]=v[C],e[C][a]=v[C]);return e}function x(e,t,n,r){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=a*a,c=o*o,l=Array(i).fill(0),u=Array(i).fill(0),d=s*e[n][n]-2*a*o*e[n][r]+c*e[r][r],f=c*e[n][n]+2*a*o*e[n][r]+s*e[r][r],p=0;p<i;p++)l[p]=a*e[n][p]-o*e[r][p],u[p]=o*e[n][p]+a*e[r][p];e[n][n]=d,e[r][r]=f,e[n][r]=0,e[r][n]=0;for(var m=0;m<i;m++)m!==n&&m!==r&&(e[n][m]=l[m],e[m][n]=l[m],e[r][m]=u[m],e[m][r]=u[m]);return e}function S(e){for(var t=e.length,n=0,r=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)Math.abs(n)<Math.abs(e[i][a])&&(n=Math.abs(e[i][a]),r=[i,a]);return[r,n]}function C(e){for(var t=e.length,n=0,r=[0,1],a=0;a<t;a++)for(var o=a+1;o<t;o++)i(n)<i(e[a][o])&&(n=i(e[a][o]),r=[a,o]);return[r,n]}function w(e,t,n){var r=e.length,a=Array(r),o;if(n){o=Array(r);for(var s=0;s<r;s++)o[s]=Array(r)}for(var c=0;c<r;c++){for(var l=0,u=e[0],d=0;d<e.length;d++)i(e[d])<i(u)&&(l=d,u=e[l]);if(a[c]=e.splice(l,1)[0],n)for(var f=0;f<r;f++)o[c][f]=t[f][l],t[f].splice(l,1)}return n?{values:a,eigenvectors:o.map((e,t)=>({value:a[t],vector:e}))}:{values:a}}return p}var $g=V(`eigs`,`config.typed.matrix.addScalar.equal.subtract.abs.atan.cos.sin.multiplyScalar.divideScalar.inv.bignumber.multiply.add.larger.column.flatten.number.complex.sqrt.diag.size.reshape.qr.usolve.usolveAll.im.re.smaller.matrixFromColumns.dot`.split(`.`),e=>{var{config:t,typed:n,matrix:r,addScalar:i,subtract:a,equal:o,abs:s,atan:c,cos:l,sin:d,multiplyScalar:f,divideScalar:p,inv:m,bignumber:h,multiply:g,add:_,larger:v,column:y,flatten:b,number:x,complex:S,sqrt:C,diag:w,size:T,reshape:E,qr:k,usolve:M,usolveAll:N,im:P,re:F,smaller:ee,matrixFromColumns:te,dot:ne}=e,re=Qg({config:t,addScalar:i,subtract:a,column:y,flatten:b,equal:o,abs:s,atan:c,cos:l,sin:d,multiplyScalar:f,inv:m,bignumber:h,complex:S,multiply:g,add:_}),ie=Zg({config:t,addScalar:i,subtract:a,multiply:g,multiplyScalar:f,flatten:b,divideScalar:p,sqrt:C,abs:s,bignumber:h,diag:w,size:T,reshape:E,qr:k,inv:m,usolve:M,usolveAll:N,equal:o,complex:S,larger:v,smaller:ee,matrixFromColumns:te,dot:ne});return n(`eigs`,{Array:function(e){return ae(r(e))},"Array, number|BigNumber":function(e,t){return ae(r(e),{precision:t})},"Array, Object"(e,t){return ae(r(e),t)},Matrix:function(e){return ae(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return ae(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){var n={matricize:!0};return u(n,t),ae(e,n)}});function ae(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=`eigenvectors`in n?n.eigenvectors:!0,a=I(e,n.precision??t.relTol,i);return n.matricize&&(a.values=r(a.values),i&&(a.eigenvectors=a.eigenvectors.map(e=>{var{value:t,vector:n}=e;return{value:t,vector:r(n)}}))),i&&Object.defineProperty(a,"vectors",{enumerable:!1,get:()=>{throw Error(`eigs(M).vectors replaced with eigs(M).eigenvectors`)}}),a}function I(e,t,n){var r=e.toArray(),i=e.size();if(i.length!==2||i[0]!==i[1])throw RangeError(`Matrix must be square (size: ${oi(i)})`);var a=i[0];return L(r,a,t)&&(se(r,a),oe(r,a,t))?re(r,a,t,ce(e,r,a),n):ie(r,a,t,ce(e,r,a),n)}function oe(e,t,n){for(var r=0;r<t;r++)for(var i=r;i<t;i++)if(v(h(s(a(e[r][i],e[i][r]))),n))return!1;return!0}function L(e,t,n){for(var r=0;r<t;r++)for(var i=0;i<t;i++)if(v(h(s(P(e[r][i]))),n))return!1;return!0}function se(e,t){for(var n=0;n<t;n++)for(var r=0;r<t;r++)e[n][r]=F(e[n][r])}function ce(e,t,n){var r=e.datatype();if(r===`number`||r===`BigNumber`||r===`Complex`)return r;for(var i=!1,a=!1,o=!1,s=0;s<n;s++)for(var c=0;c<n;c++){var l=t[s][c];if(D(l)||j(l))i=!0;else if(O(l))a=!0;else if(A(l))o=!0;else throw TypeError(`Unsupported type in Matrix: `+Me(l))}if(a&&o&&console.warn(`Complex BigNumbers not supported, this operation will lose precission.`),o){for(var u=0;u<n;u++)for(var d=0;d<n;d++)t[u][d]=S(t[u][d]);return`Complex`}if(a){for(var f=0;f<n;f++)for(var p=0;p<n;p++)t[f][p]=h(t[f][p]);return`BigNumber`}if(i){for(var m=0;m<n;m++)for(var g=0;g<n;g++)t[m][g]=x(t[m][g]);return`number`}throw TypeError(`Matrix contains unsupported types only.`)}}),e_=`expm`,t_=V(e_,[`typed`,`abs`,`add`,`identity`,`inv`,`multiply`],e=>{var{typed:t,abs:n,add:r,identity:i,inv:a,multiply:o}=e;return t(e_,{Matrix:function(e){var t=e.size();if(t.length!==2||t[0]!==t[1])throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);for(var n=t[0],l=c(s(e),1e-15),u=l.q,d=l.j,f=o(e,2**-d),p=i(n),m=i(n),h=1,g=f,_=-1,v=1;v<=u;v++)v>1&&(g=o(g,f),_=-_),h=h*(u-v+1)/((2*u-v+1)*v),p=r(p,o(h,g)),m=r(m,o(h*_,g));for(var y=o(a(m),p),b=0;b<d;b++)y=o(y,y);return ne(e)?e.createSparseMatrix(y):y}});function s(e){for(var t=e.size()[0],r=0,i=0;i<t;i++){for(var a=0,o=0;o<t;o++)a+=n(e.get([i,o]));r=Math.max(a,r)}return r}function c(e,t){for(var n=30,r=0;r<n;r++)for(var i=0;i<=r;i++){var a=r-i;if(l(e,i,a)<t)return{q:i,j:a}}throw Error(`Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)`)}function l(e,t,n){for(var r=1,i=2;i<=t;i++)r*=i;for(var a=r,o=t+1;o<=2*t;o++)a*=o;var s=a*(2*t+1);return 8*(e/2**n)**(2*t)*r*r/(a*s)}}),n_=`sqrtm`,r_=V(n_,[`typed`,`abs`,`add`,`multiply`,`map`,`sqrt`,`subtract`,`inv`,`size`,`max`,`identity`],e=>{var{typed:t,abs:n,add:r,multiply:i,map:a,sqrt:o,subtract:s,inv:c,size:l,max:u,identity:d}=e,f=1e3,p=1e-6;function m(e){var t,a=0,o=e,m=d(l(e));do{var h=o;if(o=i(.5,r(h,c(m))),m=i(.5,r(m,c(h))),t=u(n(s(o,h))),t>p&&++a>f)throw Error(`computing square root of matrix: iterative method could not converge`)}while(t>p);return o}return t(n_,{"Array | Matrix":function(e){var t=F(e)?e.size():gi(e);switch(t.length){case 1:if(t[0]===1)return a(e,o);throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);case 2:if(t[0]===t[1])return m(e);throw RangeError(`Matrix must be square (size: `+oi(t)+`)`);default:throw RangeError(`Matrix must be at most two dimensional (size: `+oi(t)+`)`)}}})}),i_=`sylvester`,a_=V(i_,[`typed`,`schur`,`matrixFromColumns`,`matrix`,`multiply`,`range`,`concat`,`transpose`,`index`,`subset`,`add`,`subtract`,`identity`,`lusolve`,`abs`],e=>{var{typed:t,schur:n,matrixFromColumns:r,matrix:i,multiply:a,range:o,concat:s,transpose:c,index:l,subset:u,add:d,subtract:f,identity:p,lusolve:m,abs:h,config:g}=e;return t(i_,{"Matrix, Matrix, Matrix":_,"Array, Matrix, Matrix":function(e,t,n){return _(i(e),t,n)},"Array, Array, Matrix":function(e,t,n){return _(i(e),i(t),n)},"Array, Matrix, Array":function(e,t,n){return _(i(e),t,i(n))},"Matrix, Array, Matrix":function(e,t,n){return _(e,i(t),n)},"Matrix, Array, Array":function(e,t,n){return _(e,i(t),i(n))},"Matrix, Matrix, Array":function(e,t,n){return _(e,t,i(n))},"Array, Array, Array":function(e,t,n){return _(i(e),i(t),i(n)).toArray()}});function _(e,t,g){for(var _=t.size()[0],v=e.size()[0],y=n(e),b=y.T,x=y.U,S=n(a(-1,t)),C=S.T,w=S.U,T=a(a(c(x),g),w),E=o(0,v),D=[],O=(e,t)=>s(e,t,1),k=(e,t)=>s(e,t,0),A=0;A<_;A++)if(A<_-1&&h(u(C,l(A+1,A)))>1e-5){for(var j=k(u(T,l(E,[A])),u(T,l(E,[A+1]))),M=0;M<A;M++)j=d(j,k(a(D[M],u(C,l(M,A))),a(D[M],u(C,l(M,A+1)))));var N=a(p(v),a(-1,u(C,l(A,A)))),P=a(p(v),a(-1,u(C,l(A+1,A)))),F=a(p(v),a(-1,u(C,l(A,A+1)))),ee=a(p(v),a(-1,u(C,l(A+1,A+1)))),te=m(k(O(d(b,N),P),O(F,d(b,ee))),j);D[A]=te.subset(l(o(0,v),[0])),D[A+1]=te.subset(l(o(v,2*v),[0])),A++}else{for(var ne=u(T,l(E,[A])),re=0;re<A;re++)ne=d(ne,a(D[re],u(C,l(re,A))));var ie=f(b,a(u(C,l(A,A)),p(v)));D[A]=m(ie,ne)}return a(x,a(i(r(...D)),c(w)))}}),o_=`schur`,s_=V(o_,[`typed`,`matrix`,`identity`,`multiply`,`qr`,`norm`,`subtract`],e=>{var{typed:t,matrix:n,identity:r,multiply:i,qr:a,norm:o,subtract:s}=e;return t(o_,{Array:function(e){var t=c(n(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return c(e)}});function c(e){var t=e.size()[0],n=e,c=r(t),l=0,u;do{u=n;var d=a(n),f=d.Q,p=d.R;if(n=i(p,f),c=i(c,f),l++>100)break}while(o(s(n,u))>1e-4);return{U:c,T:n}}}),c_=`lyap`,l_=V(c_,[`typed`,`matrix`,`sylvester`,`multiply`,`transpose`],e=>{var{typed:t,matrix:n,sylvester:r,multiply:i,transpose:a}=e;return t(c_,{"Matrix, Matrix":function(e,t){return r(e,a(e),i(-1,t))},"Array, Matrix":function(e,t){return r(n(e),a(n(e)),i(-1,t))},"Matrix, Array":function(e,t){return r(e,a(n(e)),n(i(-1,t)))},"Array, Array":function(e,t){return r(n(e),a(n(e)),n(i(-1,t))).toArray()}})}),u_=V(`divide`,[`typed`,`matrix`,`multiply`,`equalScalar`,`divideScalar`,`inv`],e=>{var{typed:t,matrix:n,multiply:r,equalScalar:i,divideScalar:a,inv:o}=e,s=Vs({typed:t,equalScalar:i}),c=Us({typed:t});return t(`divide`,Fe({"Array | Matrix, Array | Matrix":function(e,t){return r(e,o(t))},"DenseMatrix, any":function(e,t){return c(e,t,a,!1)},"SparseMatrix, any":function(e,t){return s(e,t,a,!1)},"Array, any":function(e,t){return c(n(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return r(e,o(t))}},a.signatures))}),d_=`distance`,f_=V(d_,[`typed`,`addScalar`,`subtractScalar`,`divideScalar`,`multiplyScalar`,`deepEqual`,`sqrt`,`abs`],e=>{var{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:s,abs:c}=e;return t(d_,{"Array, Array, Array":function(e,t,n){if(e.length===2&&t.length===2&&n.length===2){if(!u(e))throw TypeError(`Array with 2 numbers or BigNumbers expected for first argument`);if(!u(t))throw TypeError(`Array with 2 numbers or BigNumbers expected for second argument`);if(!u(n))throw TypeError(`Array with 2 numbers or BigNumbers expected for third argument`);if(o(t,n))throw TypeError(`LinePoint1 should not be same with LinePoint2`);var a=r(n[1],t[1]),s=r(t[0],n[0]),c=r(i(n[0],t[1]),i(t[0],n[1]));return g(e[0],e[1],a,s,c)}throw TypeError(`Invalid Arguments: Try again`)},"Object, Object, Object":function(e,t,n){if(Object.keys(e).length===2&&Object.keys(t).length===2&&Object.keys(n).length===2){if(!u(e))throw TypeError(`Values of pointX and pointY should be numbers or BigNumbers`);if(!u(t))throw TypeError(`Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers`);if(!u(n))throw TypeError(`Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers`);if(o(m(t),m(n)))throw TypeError(`LinePoint1 should not be same with LinePoint2`);if(`pointX`in e&&`pointY`in e&&`lineOnePtX`in t&&`lineOnePtY`in t&&`lineTwoPtX`in n&&`lineTwoPtY`in n){var a=r(n.lineTwoPtY,t.lineOnePtY),s=r(t.lineOnePtX,n.lineTwoPtX),c=r(i(n.lineTwoPtX,t.lineOnePtY),i(t.lineOnePtX,n.lineTwoPtY));return g(e.pointX,e.pointY,a,s,c)}throw TypeError(`Key names do not match`)}throw TypeError(`Invalid Arguments: Try again`)},"Array, Array":function(e,t){if(e.length===2&&t.length===3){if(!u(e))throw TypeError(`Array with 2 numbers or BigNumbers expected for first argument`);if(!d(t))throw TypeError(`Array with 3 numbers or BigNumbers expected for second argument`);return g(e[0],e[1],t[0],t[1],t[2])}if(e.length===3&&t.length===6){if(!d(e))throw TypeError(`Array with 3 numbers or BigNumbers expected for first argument`);if(!p(t))throw TypeError(`Array with 6 numbers or BigNumbers expected for second argument`);return _(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(e.length===t.length&&e.length>0){if(!f(e)||!f(t))throw TypeError(`All values of an array should be numbers or BigNumbers`);return v(e,t)}throw TypeError(`Invalid Arguments: Try again`)},"Object, Object":function(e,t){if(Object.keys(e).length===2&&Object.keys(t).length===3){if(!u(e))throw TypeError(`Values of pointX and pointY should be numbers or BigNumbers`);if(!d(t))throw TypeError(`Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers`);if(`pointX`in e&&`pointY`in e&&`xCoeffLine`in t&&`yCoeffLine`in t&&`constant`in t)return g(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw TypeError(`Key names do not match`)}if(Object.keys(e).length===3&&Object.keys(t).length===6){if(!d(e))throw TypeError(`Values of pointX, pointY and pointZ should be numbers or BigNumbers`);if(!p(t))throw TypeError(`Values of x0, y0, z0, a, b and c should be numbers or BigNumbers`);if(`pointX`in e&&`pointY`in e&&`x0`in t&&`y0`in t&&`z0`in t&&`a`in t&&`b`in t&&`c`in t)return _(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw TypeError(`Key names do not match`)}if(Object.keys(e).length===2&&Object.keys(t).length===2){if(!u(e))throw TypeError(`Values of pointOneX and pointOneY should be numbers or BigNumbers`);if(!u(t))throw TypeError(`Values of pointTwoX and pointTwoY should be numbers or BigNumbers`);if(`pointOneX`in e&&`pointOneY`in e&&`pointTwoX`in t&&`pointTwoY`in t)return v([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw TypeError(`Key names do not match`)}if(Object.keys(e).length===3&&Object.keys(t).length===3){if(!d(e))throw TypeError(`Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers`);if(!d(t))throw TypeError(`Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers`);if(`pointOneX`in e&&`pointOneY`in e&&`pointOneZ`in e&&`pointTwoX`in t&&`pointTwoY`in t&&`pointTwoZ`in t)return v([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw TypeError(`Key names do not match`)}throw TypeError(`Invalid Arguments: Try again`)},Array:function(e){if(!h(e))throw TypeError(`Incorrect array format entered for pairwise distance calculation`);return y(e)}});function l(e){return typeof e==`number`||O(e)}function u(e){return e.constructor!==Array&&(e=m(e)),l(e[0])&&l(e[1])}function d(e){return e.constructor!==Array&&(e=m(e)),l(e[0])&&l(e[1])&&l(e[2])}function f(e){return Array.isArray(e)||(e=m(e)),e.every(l)}function p(e){return e.constructor!==Array&&(e=m(e)),l(e[0])&&l(e[1])&&l(e[2])&&l(e[3])&&l(e[4])&&l(e[5])}function m(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++)n.push(e[t[r]]);return n}function h(e){if(e[0].length===2&&l(e[0][0])&&l(e[0][1])){if(e.some(e=>e.length!==2||!l(e[0])||!l(e[1])))return!1}else if(e[0].length===3&&l(e[0][0])&&l(e[0][1])&&l(e[0][2])){if(e.some(e=>e.length!==3||!l(e[0])||!l(e[1])||!l(e[2])))return!1}else return!1;return!0}function g(e,t,r,o,l){return a(c(n(n(i(r,e),i(o,t)),l)),s(n(i(r,r),i(o,o))))}function _(e,t,o,c,l,u,d,f,p){var m=[r(i(r(l,t),p),i(r(u,o),f)),r(i(r(u,o),d),i(r(c,e),p)),r(i(r(c,e),f),i(r(l,t),d))];m=s(n(n(i(m[0],m[0]),i(m[1],m[1])),i(m[2],m[2])));var h=s(n(n(i(d,d),i(f,f)),i(p,p)));return a(m,h)}function v(e,t){for(var a=e.length,o=0,c=0,l=0;l<a;l++)c=r(e[l],t[l]),o=n(i(c,c),o);return s(o)}function y(e){for(var t=[],n=[],r=[],i=0;i<e.length-1;i++)for(var a=i+1;a<e.length;a++)e[0].length===2?(n=[e[i][0],e[i][1]],r=[e[a][0],e[a][1]]):e[0].length===3&&(n=[e[i][0],e[i][1],e[i][2]],r=[e[a][0],e[a][1],e[a][2]]),t.push(v(n,r));return t}}),p_=V(`intersect`,[`typed`,`config`,`abs`,`add`,`addScalar`,`matrix`,`multiply`,`multiplyScalar`,`divideScalar`,`subtract`,`smaller`,`equalScalar`,`flatten`,`isZero`,`isNumeric`],e=>{var{typed:t,config:n,abs:r,add:i,addScalar:a,matrix:o,multiply:s,multiplyScalar:c,divideScalar:l,subtract:u,smaller:d,equalScalar:f,flatten:p,isZero:m,isNumeric:h}=e;return t(`intersect`,{"Array, Array, Array":g,"Array, Array, Array, Array":_,"Matrix, Matrix, Matrix":function(e,t,n){var r=g(e.valueOf(),t.valueOf(),n.valueOf());return r===null?null:o(r)},"Matrix, Matrix, Matrix, Matrix":function(e,t,n,r){var i=_(e.valueOf(),t.valueOf(),n.valueOf(),r.valueOf());return i===null?null:o(i)}});function g(e,t,n){if(e=v(e),t=v(t),n=v(n),!b(e))throw TypeError(`Array with 3 numbers or BigNumbers expected for first argument`);if(!b(t))throw TypeError(`Array with 3 numbers or BigNumbers expected for second argument`);if(!x(n))throw TypeError(`Array with 4 numbers expected as third argument`);return T(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3])}function _(e,t,n,r){if(e=v(e),t=v(t),n=v(n),r=v(r),e.length===2){if(!y(e))throw TypeError(`Array with 2 numbers or BigNumbers expected for first argument`);if(!y(t))throw TypeError(`Array with 2 numbers or BigNumbers expected for second argument`);if(!y(n))throw TypeError(`Array with 2 numbers or BigNumbers expected for third argument`);if(!y(r))throw TypeError(`Array with 2 numbers or BigNumbers expected for fourth argument`);return S(e,t,n,r)}if(e.length===3){if(!b(e))throw TypeError(`Array with 3 numbers or BigNumbers expected for first argument`);if(!b(t))throw TypeError(`Array with 3 numbers or BigNumbers expected for second argument`);if(!b(n))throw TypeError(`Array with 3 numbers or BigNumbers expected for third argument`);if(!b(r))throw TypeError(`Array with 3 numbers or BigNumbers expected for fourth argument`);return w(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],r[0],r[1],r[2])}throw TypeError(`Arrays with two or thee dimensional points expected`)}function v(e){return e.length===1?e[0]:e.length>1&&Array.isArray(e[0])&&e.every(e=>Array.isArray(e)&&e.length===1)?p(e):e}function y(e){return e.length===2&&h(e[0])&&h(e[1])}function b(e){return e.length===3&&h(e[0])&&h(e[1])&&h(e[2])}function x(e){return e.length===4&&h(e[0])&&h(e[1])&&h(e[2])&&h(e[3])}function S(e,t,o,f){var p=e,h=o,g=u(p,t),_=u(h,f),v=u(c(g[0],_[1]),c(_[0],g[1]));if(m(v)||d(r(v),n.relTol))return null;var y=c(_[0],p[1]),b=c(_[1],p[0]),x=c(_[0],h[1]),S=c(_[1],h[0]);return i(s(g,l(a(u(u(y,b),x),S),v)),p)}function C(e,t,n,r,i,o,s,l,d,f,p,m){var h=c(u(e,t),u(n,r)),g=c(u(i,o),u(s,l)),_=c(u(d,f),u(p,m));return a(a(h,g),_)}function w(e,t,n,r,i,o,s,d,p,h,g,_){var v=C(e,s,h,s,t,d,g,d,n,p,_,p),y=C(h,s,r,e,g,d,i,t,_,p,o,n),b=C(e,s,r,e,t,d,i,t,n,p,o,n),x=C(h,s,h,s,g,d,g,d,_,p,_,p),S=C(r,e,r,e,i,t,i,t,o,n,o,n),w=u(c(v,y),c(b,x)),T=u(c(S,x),c(y,y));if(m(T))return null;var E=l(w,T),D=l(a(v,c(E,y)),x),O=a(e,c(E,u(r,e))),k=a(t,c(E,u(i,t))),A=a(n,c(E,u(o,n))),j=a(s,c(D,u(h,s))),M=a(d,c(D,u(g,d))),N=a(p,c(D,u(_,p)));return f(O,j)&&f(k,M)&&f(A,N)?[O,k,A]:null}function T(e,t,n,r,i,o,s,d,f,p){var m=c(e,s),h=c(r,s),g=c(t,d),_=c(i,d),v=c(n,f),y=c(o,f),b=l(u(u(u(p,m),g),v),u(u(u(a(a(h,_),y),m),g),v));return[a(e,c(b,u(r,e))),a(t,c(b,u(i,t))),a(n,c(b,u(o,n)))]}}),m_=`sum`,h_=V(m_,[`typed`,`config`,`add`,`numeric`],e=>{var{typed:t,config:n,add:r,numeric:i}=e;return t(m_,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":o,"...":function(e){if(sa(e))throw TypeError(`Scalar values expected in function sum`);return a(e)}});function a(e){var t;return ca(e,function(e){try{t=t===void 0?e:r(t,e)}catch(t){throw cd(t,`sum`,e)}}),t===void 0&&(t=i(0,n.number)),typeof t==`string`&&(t=i(t,Qe(t,n))),t}function o(e,t){try{return ua(e,t,r)}catch(e){throw cd(e,`sum`)}}}),g_=`cumsum`,__=V(g_,[`typed`,`add`,`unaryPlus`],e=>{var{typed:t,add:n,unaryPlus:r}=e;return t(g_,{Array:i,Matrix:function(e){return e.create(i(e.valueOf(),e.datatype()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(e,t){return e.create(o(e.valueOf(),t),e.datatype())},"...":function(e){if(sa(e))throw TypeError(`All values expected to be scalar in function cumsum`);return i(e)}});function i(e){try{return a(e)}catch(e){throw cd(e,g_)}}function a(e){if(e.length===0)return[];for(var t=[r(e[0])],i=1;i<e.length;++i)t.push(n(t[i-1],e[i]));return t}function o(e,t){var n=gi(e);if(t<0||t>=n.length)throw new hi(t,n.length);try{return s(e,t)}catch(e){throw cd(e,g_)}}function s(e,t){var n,r,i;if(t<=0){var o=e[0][0];if(Array.isArray(o)){for(i=oa(e),r=[],n=0;n<i.length;n++)r[n]=s(i[n],t-1);return r}return a(e)}for(r=[],n=0;n<e.length;n++)r[n]=s(e[n],t-1);return r}}),v_=`mean`,y_=V(v_,[`typed`,`add`,`divide`],e=>{var{typed:t,add:n,divide:r}=e;return t(v_,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":i,"...":function(e){if(sa(e))throw TypeError(`Scalar values expected in function mean`);return a(e)}});function i(e,t){try{return r(ua(e,t,n),(Array.isArray(e)?gi(e):e.size())[t])}catch(e){throw cd(e,`mean`)}}function a(e){var t,i=0;if(ca(e,function(e){try{t=t===void 0?e:n(t,e),i++}catch(t){throw cd(t,`mean`,e)}}),i===0)throw Error(`Cannot calculate the mean of an empty array`);return r(t,i)}}),b_=`median`,x_=V(b_,[`typed`,`add`,`divide`,`compare`,`partitionSelect`],e=>{var{typed:t,add:n,divide:r,compare:i,partitionSelect:a}=e;function o(e){try{e=Mi(e.valueOf());var t=e.length;if(t===0)throw Error(`Cannot calculate median of an empty array`);if(t%2==0){for(var n=t/2-1,r=a(e,n+1),o=e[n],l=0;l<n;++l)i(e[l],o)>0&&(o=e[l]);return c(o,r)}return s(a(e,(t-1)/2))}catch(e){throw cd(e,`median`)}}var s=t({"number | BigNumber | Complex | Unit":function(e){return e}}),c=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return r(n(e,t),2)}});return t(b_,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw Error(`median(A, dim) is not yet supported`)},"...":function(e){if(sa(e))throw TypeError(`Scalar values expected in function median`);return o(e)}})}),S_=`mad`,C_=V(S_,[`typed`,`abs`,`map`,`median`,`subtract`],e=>{var{typed:t,abs:n,map:r,median:i,subtract:a}=e;return t(S_,{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(e=Mi(e.valueOf()),e.length===0)throw Error(`Cannot calculate median absolute deviation (mad) of an empty array`);try{var t=i(e);return i(r(e,function(e){return n(a(e,t))}))}catch(e){throw e instanceof TypeError&&e.message.includes(`median`)?TypeError(e.message.replace(`median`,`mad`)):cd(e,`mad`)}}}),w_=`unbiased`,T_=`variance`,E_=V(T_,[`typed`,`add`,`subtract`,`multiply`,`divide`,`mapSlices`,`isNaN`],e=>{var{typed:t,add:n,subtract:r,multiply:i,divide:a,mapSlices:o,isNaN:s}=e;return t(T_,{"Array | Matrix":function(e){return c(e,w_)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(e,t){return l(e,t,w_)},"Array | Matrix, number | BigNumber, string":l,"...":function(e){return c(e,w_)}});function c(e,t){var o,c=0;if(e.length===0)throw SyntaxError(`Function variance requires one or more parameters (0 provided)`);if(ca(e,function(e){try{o=o===void 0?e:n(o,e),c++}catch(t){throw cd(t,`variance`,e)}}),c===0)throw Error(`Cannot calculate variance of an empty array`);var l=a(o,c);if(o=void 0,ca(e,function(e){var t=r(e,l);o=o===void 0?i(t,t):n(o,i(t,t))}),s(o))return o;switch(t){case`uncorrected`:return a(o,c);case`biased`:return a(o,c+1);case`unbiased`:var u=O(o)?o.mul(0):0;return c===1?u:a(o,c-1);default:throw Error(`Unknown normalization "`+t+`". Choose "unbiased" (default), "uncorrected", or "biased".`)}}function l(e,t,n){try{if(e.length===0)throw SyntaxError(`Function variance requires one or more parameters (0 provided)`);return o(e,t,e=>c(e,n))}catch(e){throw cd(e,`variance`)}}}),D_=`quantileSeq`,O_=V(D_,[`typed`,`?bignumber`,`add`,`subtract`,`divide`,`multiply`,`partitionSelect`,`compare`,`isInteger`,`smaller`,`smallerEq`,`larger`,`mapSlices`],e=>{var{typed:t,bignumber:n,add:r,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:c,isInteger:l,smaller:u,smallerEq:d,larger:f,mapSlices:p}=e;return t(D_,{"Array | Matrix, number | BigNumber":(e,t)=>h(e,t,!1),"Array | Matrix, number | BigNumber, number":(e,t,n)=>m(e,t,!1,n,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>m(e,t,n,r,h),"Array | Matrix, Array | Matrix":(e,t)=>g(e,t,!1),"Array | Matrix, Array | Matrix, number":(e,t,n)=>m(e,t,!1,n,g),"Array | Matrix, Array | Matrix, boolean":g,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>m(e,t,n,r,g)});function m(e,t,n,r,i){return p(e,r,e=>i(e,t,n))}function h(e,t,i){var o,s=e.valueOf();if(u(t,0))throw Error(`N/prob must be non-negative`);if(d(t,1))return D(t)?_(s,t,i):n(_(s,t,i));if(f(t,1)){if(!l(t))throw Error(`N must be a positive integer`);if(f(t,4294967295))throw Error(`N must be less than or equal to 2^32-1, as that is the maximum length of an Array`);var c=r(t,1);o=[];for(var p=0;u(p,t);p++){var m=a(p+1,c);o.push(_(s,m,i))}return D(t)?o:n(o)}}function g(e,t,n){for(var r=e.valueOf(),i=t.valueOf(),a=[],o=0;o<i.length;++o)a.push(_(r,i[o],n));return a}function _(e,t,n){var a=Mi(e),u=a.length;if(u===0)throw Error(`Cannot calculate quantile of an empty sequence`);var d=D(t)?t*(u-1):t.times(u-1),f=D(t)?Math.floor(d):d.floor().toNumber(),p=D(t)?d%1:d.minus(f);if(l(d))return n?a[d]:s(a,D(t)?d:d.valueOf());var m,h;if(n)m=a[f],h=a[f+1];else{h=s(a,f+1),m=a[f];for(var g=0;g<f;++g)c(a[g],m)>0&&(m=a[g])}return r(o(m,i(1,p)),o(h,p))}}),k_=`std`,A_=V(k_,[`typed`,`map`,`sqrt`,`variance`],e=>{var{typed:t,map:n,sqrt:r,variance:i}=e;return t(k_,{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(e){return a(e)}});function a(e,t){if(e.length===0)throw SyntaxError(`Function std requires one or more parameters (0 provided)`);try{var a=i.apply(null,arguments);return ee(a)?n(a,r):r(a)}catch(e){throw e instanceof TypeError&&e.message.includes(` variance`)?TypeError(e.message.replace(` variance`,` std`)):e}}}),j_=`corr`,M_=V(j_,[`typed`,`matrix`,`mean`,`sqrt`,`sum`,`add`,`subtract`,`multiply`,`pow`,`divide`],e=>{var{typed:t,matrix:n,sqrt:r,sum:i,add:a,subtract:o,multiply:s,pow:c,divide:l}=e;return t(j_,{"Array, Array":function(e,t){return u(e,t)},"Matrix, Matrix":function(e,t){var r=u(e.toArray(),t.toArray());return Array.isArray(r)?n(r):r}});function u(e,t){var n=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw SyntaxError(`Dimension mismatch. Array A and B must have the same length.`);for(var r=0;r<e.length;r++){if(e[r].length!==t[r].length)throw SyntaxError(`Dimension mismatch. Array A and B must have the same number of elements.`);n.push(d(e[r],t[r]))}return n}if(e.length!==t.length)throw SyntaxError(`Dimension mismatch. Array A and B must have the same number of elements.`);return d(e,t)}function d(e,t){var n=e.length,u=i(e),d=i(t),f=e.reduce((e,n,r)=>a(e,s(n,t[r])),0),p=i(e.map(e=>c(e,2))),m=i(t.map(e=>c(e,2)));return l(o(s(n,f),s(u,d)),r(s(o(s(n,p),c(u,2)),o(s(n,m),c(d,2)))))}}),N_=`bernoulli`,P_=V(N_,[`typed`,`config`,`isInteger`,`number`,`?BigNumber`,`?Fraction`],e=>{var{typed:t,config:n,number:r,BigNumber:i,Fraction:a}=e,o=[void 0],s=[void 0],c=[void 0],l=50;return t(N_,{number:e=>F_(e,e=>e,o,(e,t)=>e+t,(e,t)=>e*t,(e,t)=>e/t),"bigint | Fraction":e=>F_(r(e),e=>new a(e),s,(e,t)=>e.add(t),(e,t)=>e.mul(t),(e,t)=>e.div(t)),BigNumber:e=>(n.precision!==l&&(c=[void 0],l=n.precision),F_(r(e),e=>new i(e),c,(e,t)=>e.add(t),(e,t)=>e.mul(t),(e,t)=>e.div(t)))})});function F_(e,t,n,r,i,a){if(e<0||!H(e))throw RangeError(`Bernoulli index must be nonnegative integer`);if(e===0)return t(1);if(e===1)return a(t(-1),t(2));if(e%2==1)return t(0);var o=t(1);n.length===1&&n.push([a(o,t(-3)),a(o,t(-2)),a(o,t(6))]);for(var s=e/2,c=t(0),l=t(2);n.length<=s;){for(var u=n.length,d=Math.floor((u+1)/2),f=c,p=1;p<d;++p)f=r(f,i(n[p][0],n[u-p][0]));f=i(f,l),u%2==0&&(f=r(f,i(n[d][0],n[d][0]))),f=a(f,t(-(2*u+1)));var m=a(i(n[u-1][1],t(-u*(2*u-1))),l);n.push([f,m,i(m,f)])}return n[s][2]}var I_=`combinations`,L_=V(I_,[`typed`],e=>{var{typed:t}=e;return t(I_,{"number, number":qa,"BigNumber, BigNumber":function(e,t){var n=e.constructor,r,i,a=e.minus(t),o=new n(1);if(!R_(e)||!R_(t))throw TypeError(`Positive integer value expected in function combinations`);if(t.gt(e))throw TypeError(`k must be less than n in function combinations`);if(r=o,t.lt(a))for(i=o;i.lte(a);i=i.plus(o))r=r.times(t.plus(i)).dividedBy(i);else for(i=o;i.lte(t);i=i.plus(o))r=r.times(a.plus(i)).dividedBy(i);return r}})});function R_(e){return e.isInteger()&&e.gte(0)}var z_=`combinationsWithRep`,B_=V(z_,[`typed`],e=>{var{typed:t}=e;return t(z_,{"number, number":function(e,t){if(!H(e)||e<0||!H(t)||t<0)throw TypeError(`Positive integer value expected in function combinationsWithRep`);if(e<1)throw TypeError(`k must be less than or equal to n + k - 1`);return t<e-1?Ka(e,e+t-1)/Ka(1,t):Ka(t+1,e+t-1)/Ka(1,e-1)},"BigNumber, BigNumber":function(e,t){var n=e.constructor,r,i,a=new n(1),o=e.minus(a);if(!V_(e)||!V_(t))throw TypeError(`Positive integer value expected in function combinationsWithRep`);if(e.lt(a))throw TypeError(`k must be less than or equal to n + k - 1 in function combinationsWithRep`);if(r=a,t.lt(o))for(i=a;i.lte(o);i=i.plus(a))r=r.times(t.plus(i)).dividedBy(i);else for(i=a;i.lte(t);i=i.plus(a))r=r.times(o.plus(i)).dividedBy(i);return r}})});function V_(e){return e.isInteger()&&e.gte(0)}var H_=`gamma`,U_=V(H_,[`typed`,`config`,`multiplyScalar`,`pow`,`BigNumber`,`Complex`],e=>{var{typed:t,config:n,multiplyScalar:r,pow:i,BigNumber:a,Complex:o}=e;function s(e){if(e.im===0)return io(e.re);if(e.re<.5){var t=new o(1-e.re,-e.im),n=new o(Math.PI*e.re,Math.PI*e.im);return new o(Math.PI).div(n.sin()).div(s(t))}e=new o(e.re-1,e.im);for(var r=new o(oo[0],0),i=1;i<oo.length;++i){var a=new o(oo[i],0);r=r.add(a.div(e.add(i)))}var c=new o(e.re+ao+.5,e.im),l=Math.sqrt(2*Math.PI),u=c.pow(e.add(.5)),d=c.neg().exp();return r.mul(l).mul(u).mul(d)}return t(H_,{number:io,Complex:s,BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new a(1/0):c(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw Error(`Integer BigNumber expected`)}});function c(e){if(e<8)return new a([1,1,2,6,24,120,720,5040][e]);var t=n.precision+(Math.log(e.toNumber())|0),r=a.clone({precision:t});if(e%2==1)return e.times(c(new a(e-1)));for(var i=e,o=new r(e),s=e.toNumber();i>2;)i-=2,s+=i,o=o.times(s);return new a(o.toPrecision(a.precision))}}),W_=`lgamma`,G_=V(W_,[`Complex`,`typed`],e=>{var{Complex:t,typed:n}=e,r=7,i=7,a=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return n(W_,{number:lo,Complex:o,BigNumber:function(){throw Error(`mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber`)}});function o(e){var n=6.283185307179586,a=1.1447298858494002,l=.1;if(e.isNaN())return new t(NaN,NaN);if(e.im===0)return new t(lo(e.re),0);if(e.re>=r||Math.abs(e.im)>=i)return s(e);if(e.re<=l){var u=Ct(n,e.im)*Math.floor(.5*e.re+.25),d=e.mul(Math.PI).sin().log(),f=o(new t(1-e.re,-e.im));return new t(a,u).sub(d).sub(f)}return e.im>=0?c(e):c(e.conjugate()).conjugate()}function s(e){for(var n=e.sub(.5).mul(e.log()).sub(e).add(so),r=new t(1,0).div(e),i=r.div(e),o=a[0],s=a[1],c=2*i.re,l=i.re*i.re+i.im*i.im,u=2;u<8;u++){var d=s;s=-l*o+a[u],o=c*o+d}var f=r.mul(i.mul(o).add(s));return n.add(f)}function c(e){var n=0,i=0,a=e;for(e=e.add(1);e.re<=r;){a=a.mul(e);var o=+(a.im<0);o!==0&&i===0&&n++,i=o,e=e.add(1)}return s(e).sub(a.log()).sub(new t(0,n*2*Math.PI*1))}}),K_=`factorial`,q_=V(K_,[`typed`,`gamma`],e=>{var{typed:t,gamma:n}=e;return t(K_,{number:function(e){if(e<0)throw Error(`Value must be non-negative`);return n(e+1)},BigNumber:function(e){if(e.isNegative())throw Error(`Value must be non-negative`);return n(e.plus(1))},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),J_=`kldivergence`,Y_=V(J_,[`typed`,`matrix`,`divide`,`sum`,`multiply`,`map`,`dotDivide`,`log`,`isNumeric`],e=>{var{typed:t,matrix:n,divide:r,sum:i,multiply:a,map:o,dotDivide:s,log:c,isNumeric:l}=e;return t(J_,{"Array, Array":function(e,t){return u(n(e),n(t))},"Matrix, Array":function(e,t){return u(e,n(t))},"Array, Matrix":function(e,t){return u(n(e),t)},"Matrix, Matrix":function(e,t){return u(e,t)}});function u(e,t){var n=t.size().length,u=e.size().length;if(n>1)throw Error(`first object must be one dimensional`);if(u>1)throw Error(`second object must be one dimensional`);if(n!==u)throw Error(`Length of two vectors must be equal`);if(i(e)===0)throw Error(`Sum of elements in first object must be non zero`);if(i(t)===0)throw Error(`Sum of elements in second object must be non zero`);var d=r(e,i(e)),f=i(a(d,o(s(d,r(t,i(t))),e=>c(e))));return l(f)?f:NaN}}),X_=`multinomial`,Z_=V(X_,[`typed`,`add`,`divide`,`multiply`,`factorial`,`isInteger`,`isPositive`],e=>{var{typed:t,add:n,divide:r,multiply:i,factorial:a,isInteger:o,isPositive:s}=e;return t(X_,{"Array | Matrix":function(e){var t=0,c=1;return ca(e,function(e){if(!o(e)||!s(e))throw TypeError(`Positive integer value expected in function multinomial`);t=n(t,e),c=i(c,a(e))}),r(a(t),c)}})}),Q_=`permutations`,$_=V(Q_,[`typed`,`factorial`],e=>{var{typed:t,factorial:n}=e;return t(Q_,{"number | BigNumber":n,"number, number":function(e,t){if(!H(e)||e<0||!H(t)||t<0)throw TypeError(`Positive integer value expected in function permutations`);if(t>e)throw TypeError(`second argument k must be less than or equal to first argument n`);return Ka(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var n,r;if(!ev(e)||!ev(t))throw TypeError(`Positive integer value expected in function permutations`);if(t.gt(e))throw TypeError(`second argument k must be less than or equal to first argument n`);for(n=e.mul(0).add(1),r=e.minus(t).plus(1);r.lte(e);r=r.plus(1))n=n.times(r);return n}})});function ev(e){return e.isInteger()&&e.gte(0)}var tv=o(((e,t)=>{(function(e,t,n){function r(e){var t=this,n=o();t.next=function(){var e=2091639*t.s0+t.c*23283064365386963e-26;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=e|0)},t.c=1,t.s0=n(` `),t.s1=n(` `),t.s2=n(` `),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function i(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function a(e,t){var n=new r(e),a=t&&t.state,o=n.next;return o.int32=function(){return n.next()*4294967296|0},o.double=function(){return o()+(o()*2097152|0)*11102230246251565e-32},o.quick=o,a&&(typeof a==`object`&&i(a,n),o.state=function(){return i(n,{})}),o}function o(){var e=4022871197;return function(t){t=String(t);for(var n=0;n<t.length;n++){e+=t.charCodeAt(n);var r=.02519603282416938*e;e=r>>>0,r-=e,r*=e,e=r>>>0,r-=e,e+=r*4294967296}return(e>>>0)*23283064365386963e-26}}t&&t.exports?t.exports=a:n&&n.amd?n(function(){return a}):this.alea=a})(e,typeof t==`object`&&t,typeof define==`function`&&define)})),nv=o(((e,t)=>{(function(e,t,n){function r(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===(e|0)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=n.charCodeAt(r)|0,t.next()}function i(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function a(e,t){var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21);while(e===0);return e},o.int32=n.next,o.quick=o,a&&(typeof a==`object`&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n(function(){return a}):this.xor128=a})(e,typeof t==`object`&&t,typeof define==`function`&&define)})),rv=o(((e,t)=>{(function(e,t,n){function r(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===(e|0)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=n.charCodeAt(r)|0,r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function i(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 a(e,t){var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21);while(e===0);return e},o.int32=n.next,o.quick=o,a&&(typeof a==`object`&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n(function(){return a}):this.xorwow=a})(e,typeof t==`object`&&t,typeof define==`function`&&define)})),iv=o(((e,t)=>{(function(e,t,n){function r(e){var t=this;t.next=function(){var e=t.x,n=t.i,r=e[n],i;return r^=r>>>7,i=r^r<<24,r=e[n+1&7],i^=r^r>>>10,r=e[n+3&7],i^=r^r>>>3,r=e[n+4&7],i^=r^r<<7,r=e[n+7&7],r^=r<<13,i^=r^r<<9,e[n]=i,t.i=n+1&7,i};function n(e,t){var n,r=[];if(t===(t|0))r[0]=t;else for(t=``+t,n=0;n<t.length;++n)r[n&7]=r[n&7]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&r[n]===0;++n);for(n==8?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}n(t,e)}function i(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){e??=+new Date;var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21);while(e===0);return e},o.int32=n.next,o.quick=o,a&&(a.x&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n(function(){return a}):this.xorshift7=a})(e,typeof t==`object`&&t,typeof define==`function`&&define)})),av=o(((e,t)=>{(function(e,t,n){function r(e){var t=this;t.next=function(){var e=t.w,n=t.X,r=t.i,i,a;return t.w=e=e+1640531527|0,a=n[r+34&127],i=n[r=r+1&127],a^=a<<13,i^=i<<17,a^=a>>>15,i^=i>>>12,a=n[r]=a^i,t.i=r,a+(e^e>>>16)|0};function n(e,t){var n,r,i,a,o,s=[],c=128;for(t===(t|0)?(r=t,t=null):(t+=`\0`,r=0,c=Math.max(c,t.length)),i=0,a=-32;a<c;++a)t&&(r^=t.charCodeAt((a+32)%t.length)),a===0&&(o=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,a>=0&&(o=o+1640531527|0,n=s[a&127]^=r+o,i=n==0?i+1:0);for(i>=128&&(s[(t&&t.length||0)&127]=-1),i=127,a=512;a>0;--a)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=o,e.X=s,e.i=i}n(t,e)}function i(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){e??=+new Date;var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21);while(e===0);return e},o.int32=n.next,o.quick=o,a&&(a.X&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n(function(){return a}):this.xor4096=a})(e,typeof t==`object`&&t,typeof define==`function`&&define)})),ov=o(((e,t)=>{(function(e,t,n){function r(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=e|0):n+=e;for(var r=0;r<n.length+20;r++)t.b^=n.charCodeAt(r)|0,t.next()}function i(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function a(e,t){var n=new r(e),a=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21);while(e===0);return e},o.int32=n.next,o.quick=o,a&&(typeof a==`object`&&i(a,n),o.state=function(){return i(n,{})}),o}t&&t.exports?t.exports=a:n&&n.amd?n(function(){return a}):this.tychei=a})(e,typeof t==`object`&&t,typeof define==`function`&&define)})),sv=o(((e,t)=>{t.exports={}})),cv=o(((e,t)=>{(function(e,n,r){var i=256,a=6,o=52,s=`random`,c=r.pow(i,a),l=r.pow(2,o),u=l*2,d=i-1,f;function p(e,t,o){var d=[];t=t==1?{entropy:!0}:t||{};var f=_(g(t.entropy?[e,y(n)]:e??v(),3),d),p=new m(d),b=function(){for(var e=p.g(a),t=c,n=0;e<l;)e=(e+n)*i,t*=i,n=p.g(1);for(;e>=u;)e/=2,t/=2,n>>>=1;return(e+n)/t};return b.int32=function(){return p.g(4)|0},b.quick=function(){return p.g(4)/4294967296},b.double=b,_(y(p.S),n),(t.pass||o||function(e,t,n,i){return i&&(i.S&&h(i,p),e.state=function(){return h(p,{})}),n?(r[s]=e,t):e})(b,f,`global`in t?t.global:this==r,t.state)}function m(e){var t,n=e.length,r=this,a=0,o=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);a<i;)s[a]=a++;for(a=0;a<i;a++)s[a]=s[o=d&o+e[a%n]+(t=s[a])],s[o]=t;(r.g=function(e){for(var t,n=0,a=r.i,o=r.j,s=r.S;e--;)t=s[a=d&a+1],n=n*i+s[d&(s[a]=s[o=d&o+t])+(s[o]=t)];return r.i=a,r.j=o,n})(i)}function h(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var n=[],r=typeof e,i;if(t&&r==`object`)for(i in e)try{n.push(g(e[i],t-1))}catch{}return n.length?n:r==`string`?e:e+`\0`}function _(e,t){for(var n=e+``,r,i=0;i<n.length;)t[d&i]=d&(r^=t[d&i]*19)+n.charCodeAt(i++);return y(t)}function v(){try{var t;return f&&(t=f.randomBytes)?t=t(i):(t=new Uint8Array(i),(e.crypto||e.msCrypto).getRandomValues(t)),y(t)}catch{var r=e.navigator,a=r&&r.plugins;return[+new Date,e,a,e.screen,y(n)]}}function y(e){return String.fromCharCode.apply(0,e)}if(_(r.random(),n),typeof t==`object`&&t.exports){t.exports=p;try{f=sv()}catch{}}else typeof define==`function`&&define.amd?define(function(){return p}):r[`seed`+s]=p})(typeof self<`u`?self:e,[],Math)})),lv=l(o(((e,t)=>{var n=tv(),r=nv(),i=rv(),a=iv(),o=av(),s=ov(),c=cv();c.alea=n,c.xor128=r,c.xorwow=i,c.xorshift7=a,c.xor4096=o,c.tychei=s,t.exports=c}))(),1),uv=(0,lv.default)(Date.now());function dv(e){var t;function n(e){t=e===null?uv:(0,lv.default)(String(e))}n(e);function r(){return t()}return r}var fv=`pickRandom`,pv=V(fv,[`typed`,`config`,`?on`],e=>{var{typed:t,config:n,on:r}=e,i=dv(n.randomSeed);return r&&r(`config`,function(e,t){e.randomSeed!==t.randomSeed&&(i=dv(e.randomSeed))}),t(fv,{"Array | Matrix":function(e){return a(e,{})},"Array | Matrix, Object":function(e,t){return a(e,t)},"Array | Matrix, number":function(e,t){return a(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return a(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,n){return a(e,{number:n,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,n){return a(e,{number:t,weights:n})}});function a(e,t){var{number:n,weights:r,elementWise:a=!0}=t,o=n===void 0;o&&(n=1);var s=F(e)?e.create:F(r)?r.create:null;e=e.valueOf(),r&&=r.valueOf(),a===!0&&(e=Mi(e),r=Mi(r));var c=0;if(r!==void 0){if(r.length!==e.length)throw Error(`Weights must have the same length as possibles`);for(var l=0,u=r.length;l<u;l++){if(!D(r[l])||r[l]<0)throw Error(`Weights must be an array of positive numbers`);c+=r[l]}}for(var d=e.length,f=[],p;f.length<n;){if(r===void 0)p=e[Math.floor(i()*d)];else for(var m=i()*c,h=0,g=e.length;h<g;h++)if(m-=r[h],m<0){p=e[h];break}f.push(p)}return o?f[0]:s?s(f):f}});function mv(e,t){var n=[];if(e=e.slice(0),e.length>1)for(var r=0,i=e.shift();r<i;r++)n.push(mv(e,t));else for(var a=0,o=e.shift();a<o;a++)n.push(t());return n}var hv=`random`,gv=V(hv,[`typed`,`config`,`?on`],e=>{var{typed:t,config:n,on:r}=e,i=dv(n.randomSeed);return r&&r(`config`,function(e,t){e.randomSeed!==t.randomSeed&&(i=dv(e.randomSeed))}),t(hv,{"":()=>o(0,1),number:e=>o(0,e),"number, number":(e,t)=>o(e,t),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,t)=>a(e,0,t),"Array | Matrix, number, number":(e,t,n)=>a(e,t,n)});function a(e,t,n){var r=mv(e.valueOf(),()=>o(t,n));return F(e)?e.create(r,`number`):r}function o(e,t){return e+i()*(t-e)}}),_v=`randomInt`,vv=V(_v,[`typed`,`config`,`log2`,`?on`],e=>{var{typed:t,config:n,log2:r,on:i}=e,a=dv(n.randomSeed);return i&&i(`config`,function(e,t){e.randomSeed!==t.randomSeed&&(a=dv(e.randomSeed))}),t(_v,{"":()=>s(0,2),number:e=>s(0,e),"number, number":(e,t)=>s(e,t),bigint:e=>c(0n,e),"bigint, bigint":c,"Array | Matrix":e=>o(e,0,1),"Array | Matrix, number":(e,t)=>o(e,0,t),"Array | Matrix, number, number":(e,t,n)=>o(e,t,n)});function o(e,t,n){var r=mv(e.valueOf(),()=>s(t,n));return F(e)?e.create(r,`number`):r}function s(e,t){return Math.floor(e+a()*(t-e))}function c(e,t){var n=2n**30n,i=t-e;if(i<=n)return e+BigInt(s(0,Number(i)));for(var o=r(i),c=i;c>=i;){c=0n;for(var l=0;l<o;++l)c=2n*c+(a()<.5?0n:1n)}return e+c}}),yv=`stirlingS2`,bv=V(yv,[`typed`,`addScalar`,`subtractScalar`,`multiplyScalar`,`divideScalar`,`pow`,`factorial`,`combinations`,`isNegative`,`isInteger`,`number`,`?bignumber`,`larger`],e=>{var{typed:t,addScalar:n,subtractScalar:r,multiplyScalar:i,divideScalar:a,pow:o,factorial:s,combinations:c,isNegative:l,isInteger:u,number:d,bignumber:f,larger:p}=e,m=[],h=[];return t(yv,{"number | BigNumber, number | BigNumber":function(e,t){if(!u(e)||l(e)||!u(t)||l(t))throw TypeError(`Non-negative integer value expected in function stirlingS2`);if(p(t,e))throw TypeError(`k must be less than or equal to n in function stirlingS2`);var r=!(D(e)&&D(t)),a=r?h:m,o=r?f:d,s=d(e),c=d(t);if(a[s]&&a[s].length>c)return a[s][c];for(var g=0;g<=s;++g)if(a[g]||(a[g]=[o(+(g===0))]),g!==0)for(var _=a[g],v=a[g-1],y=_.length;y<=g&&y<=c;++y)y===g?_[y]=1:_[y]=n(i(o(y),v[y]),v[y-1]);return a[s][c]}})}),xv=`bellNumbers`,Sv=V(xv,[`typed`,`addScalar`,`isNegative`,`isInteger`,`stirlingS2`],e=>{var{typed:t,addScalar:n,isNegative:r,isInteger:i,stirlingS2:a}=e;return t(xv,{"number | BigNumber":function(e){if(!i(e)||r(e))throw TypeError(`Non-negative integer value expected in function bellNumbers`);for(var t=0,o=0;o<=e;o++)t=n(t,a(e,o));return t}})}),Cv=`catalan`,wv=V(Cv,[`typed`,`addScalar`,`divideScalar`,`multiplyScalar`,`combinations`,`isNegative`,`isInteger`],e=>{var{typed:t,addScalar:n,divideScalar:r,multiplyScalar:i,combinations:a,isNegative:o,isInteger:s}=e;return t(Cv,{"number | BigNumber":function(e){if(!s(e)||o(e))throw TypeError(`Non-negative integer value expected in function catalan`);return r(a(i(e,2),e),n(e,1))}})}),Tv=`composition`,Ev=V(Tv,[`typed`,`addScalar`,`combinations`,`isNegative`,`isPositive`,`isInteger`,`larger`],e=>{var{typed:t,addScalar:n,combinations:r,isPositive:i,isNegative:a,isInteger:o,larger:s}=e;return t(Tv,{"number | BigNumber, number | BigNumber":function(e,t){if(!o(e)||!i(e)||!o(t)||!i(t))throw TypeError(`Positive integer value expected in function composition`);if(s(t,e))throw TypeError(`k must be less than or equal to n in function composition`);return r(n(e,-1),n(t,-1))}})}),Dv=`leafCount`,Ov=V(Dv,[`parse`,`typed`],e=>{var{parse:t,typed:n}=e;function r(e){var t=0;return e.forEach(e=>{t+=r(e)}),t||1}return n(Dv,{Node:function(e){return r(e)}})});function kv(e){return ye(e)||Ee(e)&&e.isUnary()&&ye(e.args[0])}function Av(e){return!!(ye(e)||(Se(e)||Ee(e))&&e.args.every(Av)||De(e)&&Av(e.content))}function jv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?jv(Object(n),!0).forEach(function(t){Ju(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Nv=V(`simplifyUtil`,[`FunctionNode`,`OperatorNode`,`SymbolNode`],e=>{var{FunctionNode:t,OperatorNode:n,SymbolNode:r}=e,i=!0,a=!1,o=`defaultF`,s={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}},c={divide:{total:a},log:{total:a}},l={subtract:{total:a},abs:{trivial:i},log:{total:i}};function u(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:s,r=o;if(typeof e==`string`?r=e:Ee(e)?r=e.fn.toString():Se(e)?r=e.name:De(e)&&(r=`paren`),z(n,r)){var i=n[r];if(z(i,t))return i[t];if(z(s,r))return s[r][t]}if(z(n,o)){var a=n[o];return z(a,t)?a[t]:s[o][t]}if(z(s,r)){var c=s[r];if(z(c,t))return c[t]}return s[o][t]}function d(e){return u(e,`commutative`,arguments.length>1&&arguments[1]!==void 0?arguments[1]:s)}function f(e){return u(e,`associative`,arguments.length>1&&arguments[1]!==void 0?arguments[1]:s)}function p(e,t){var n=Mv({},e);for(var r in t)n[r]=z(e,r)?Mv(Mv({},t[r]),e[r]):t[r];return n}function m(e,t){if(!e.args||e.args.length===0)return e;e.args=h(e,t);for(var n=0;n<e.args.length;n++)m(e.args[n],t)}function h(e,t){var n,r=[],i=function(e){for(var t=0;t<e.args.length;t++){var a=e.args[t];Ee(a)&&n===a.op?i(a):r.push(a)}};return f(e,t)?(n=e.op,i(e),r):e.args}function g(e,t){if(!(!e.args||e.args.length===0)){for(var n=v(e),r=e.args.length,i=0;i<r;i++)g(e.args[i],t);if(r>2&&f(e,t)){for(var a=e.args.pop();e.args.length>0;)a=n([e.args.pop(),a]);e.args=a.args}}}function _(e,t){if(!(!e.args||e.args.length===0)){for(var n=v(e),r=e.args.length,i=0;i<r;i++)_(e.args[i],t);if(r>2&&f(e,t)){for(var a=e.args.shift();e.args.length>0;)a=n([a,e.args.shift()]);e.args=a.args}}}function v(e){return Ee(e)?function(t){try{return new n(e.op,e.fn,t,e.implicit)}catch(e){return console.error(e),[]}}:function(n){return new t(new r(e.name),n)}}return{createMakeNodeFunction:v,hasProperty:u,isCommutative:d,isAssociative:f,mergeContext:p,flatten:m,allChildren:h,unflattenr:g,unflattenl:_,defaultContext:s,realContext:c,positiveContext:l}}),Pv=V(`simplify`,[`typed`,`parse`,`equal`,`resolve`,`simplifyConstant`,`simplifyCore`,`AccessorNode`,`ArrayNode`,`ConstantNode`,`FunctionNode`,`IndexNode`,`ObjectNode`,`OperatorNode`,`ParenthesisNode`,`SymbolNode`,`replacer`],e=>{var{typed:t,parse:n,equal:r,resolve:i,simplifyConstant:a,simplifyCore:o,AccessorNode:s,ArrayNode:c,ConstantNode:l,FunctionNode:u,IndexNode:d,ObjectNode:f,OperatorNode:p,ParenthesisNode:m,SymbolNode:h,replacer:g}=e,{hasProperty:_,isCommutative:v,isAssociative:y,mergeContext:b,flatten:x,unflattenr:S,unflattenl:C,createMakeNodeFunction:E,defaultContext:D,realContext:O,positiveContext:k}=Nv({FunctionNode:u,OperatorNode:p,SymbolNode:h});t.addConversion({from:`Object`,to:`Map`,convert:T});var A=t(`simplify`,{Node:te,"Node, Map":(e,t)=>te(e,!1,t),"Node, Map, Object":(e,t,n)=>te(e,!1,t,n),"Node, Array":te,"Node, Array, Map":te,"Node, Array, Map, Object":te});t.removeConversion({from:`Object`,to:`Map`,convert:T}),A.defaultContext=D,A.realContext=O,A.positiveContext=k;function j(e){return e.transform(function(e){return De(e)?j(e.content):e})}var M={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};A.rules=[o,{l:`log(e)`,r:`1`},{s:`n-n1 -> n+-n1`,assuming:{subtract:{total:!0}}},{s:`n-n -> 0`,assuming:{subtract:{total:!1}}},{s:`-(cl*v) -> v * (-cl)`,assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:`-(cl*v) -> (-cl) * v`,assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:`-(v*cl) -> v * (-cl)`,assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:`-(n1/n2)`,r:`-n1/n2`},{l:`-v`,r:`v * (-1)`},{l:`(n1 + n2)*(-1)`,r:`n1*(-1) + n2*(-1)`,repeat:!0},{l:`n/n1^n2`,r:`n*n1^-n2`},{l:`n/n1`,r:`n*n1^-1`},{s:`(n1*n2)^n3 -> n1^n3 * n2^n3`,assuming:{multiply:{commutative:!0}}},{s:`(n1*n2)^(-1) -> n2^(-1) * n1^(-1)`,assuming:{multiply:{commutative:!1}}},{s:`(n ^ n1) ^ n2 -> n ^ (n1 * n2)`,assuming:{divide:{total:!0}}},{l:` vd * ( vd * n1 + n2)`,r:`vd^2 * n1 + vd * n2`},{s:` vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2`,assuming:{divide:{total:!0}}},{s:`vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2`,assuming:{divide:{total:!0}}},{s:`vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2`,assuming:{divide:{total:!0}}},{l:`n*n`,r:`n^2`},{s:`n * n^n1 -> n^(n1+1)`,assuming:{divide:{total:!0}}},{s:`n^n1 * n^n2 -> n^(n1+n2)`,assuming:{divide:{total:!0}}},a,{s:`n+n -> 2*n`,assuming:{add:{total:!0}}},{l:`n+-n`,r:`0`},{l:`vd*n + vd`,r:`vd*(n+1)`},{l:`n3*n1 + n3*n2`,r:`n3*(n1+n2)`},{l:`n3^(-n4)*n1 + n3 * n2`,r:`n3^(-n4)*(n1 + n3^(n4+1) *n2)`},{l:`n3^(-n4)*n1 + n3^n5 * n2`,r:`n3^(-n4)*(n1 + n3^(n4+n5)*n2)`},{s:`n*vd + vd -> (n+1)*vd`,assuming:{multiply:{commutative:!1}}},{s:`vd + n*vd -> (1+n)*vd`,assuming:{multiply:{commutative:!1}}},{s:`n1*n3 + n2*n3 -> (n1+n2)*n3`,assuming:{multiply:{commutative:!1}}},{s:`n^n1 * n -> n^(n1+1)`,assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:`n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)`,assuming:{multiply:{commutative:!1}}},{s:`n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)`,assuming:{multiply:{commutative:!1}}},{l:`n*cd + cd`,r:`(n+1)*cd`},{s:`cd*n + cd -> cd*(n+1)`,assuming:{multiply:{commutative:!1}}},{s:`cd + cd*n -> cd*(1+n)`,assuming:{multiply:{commutative:!1}}},a,{s:`(-n)*n1 -> -(n*n1)`,assuming:{subtract:{total:!0}}},{s:`n1*(-n) -> -(n1*n)`,assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:`ce+ve -> ve+ce`,assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:`vd*cd -> cd*vd`,assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:`n+-n1`,r:`n-n1`},{l:`n+-(n1)`,r:`n-(n1)`},{s:`n*(n1^-1) -> n/n1`,assuming:{multiply:{commutative:!0}}},{s:`n*n1^-n2 -> n/n1^n2`,assuming:{multiply:{commutative:!0}}},{s:`n^-1 -> 1/n`,assuming:{multiply:{commutative:!0}}},{l:`n^1`,r:`n`},{s:`n*(n1/n2) -> (n*n1)/n2`,assuming:{multiply:{associative:!0}}},{s:`n-(n1+n2) -> n-n1-n2`,assuming:{addition:{associative:!0,commutative:!0}}},{l:`1*n`,r:`n`,imposeContext:{multiply:{commutative:!0}}},{s:`n1/(n2/n3) -> (n1*n3)/n2`,assuming:{multiply:{associative:!0}}},{l:`n1/(-n2)`,r:`-n1/n2`}];function N(e,t){var r={};if(e.s){var i=e.s.split(`->`);if(i.length===2)r.l=i[0],r.r=i[1];else throw SyntaxError(`Could not parse rule: `+e.s)}else r.l=e.l,r.r=e.r;r.l=j(n(r.l)),r.r=j(n(r.r));for(var a of[`imposeContext`,`repeat`,`assuming`])a in e&&(r[a]=e[a]);if(e.evaluate&&(r.evaluate=n(e.evaluate)),y(r.l,t)){var o=!v(r.l,t),s;o&&(s=ee());var c=E(r.l),l=ee();r.expanded={},r.expanded.l=c([r.l,l]),x(r.expanded.l,t),S(r.expanded.l,t),r.expanded.r=c([r.r,l]),o&&(r.expandedNC1={},r.expandedNC1.l=c([s,r.l]),r.expandedNC1.r=c([s,r.r]),r.expandedNC2={},r.expandedNC2.l=c([s,r.expanded.l]),r.expandedNC2.r=c([s,r.expanded.r]))}return r}function P(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=void 0,o=typeof i;switch(o){case`string`:i={s:i};case`object`:a=N(i,t);break;case`function`:a=i;break;default:throw TypeError(`Unsupported type of rule: `+o)}n.push(a)}return n}var F=0;function ee(){return new h(`_p`+F++)}function te(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:w(),r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=r.consoleDebug;t=P(t||A.rules,r.context);var o=i(e,n);o=j(o);for(var s={},c=o.toString({parenthesis:`all`});!s[c];){s[c]=!0,F=0;var l=c;a&&console.log(`Working on: `,c);for(var u=0;u<t.length;u++){var d=``;if(typeof t[u]==`function`?(o=t[u](o,r),a&&(d=t[u].name)):(x(o,r.context),o=re(o,t[u],r.context),a&&(d=`${t[u].l.toString()} -> ${t[u].r.toString()}`)),a){var f=o.toString({parenthesis:`all`});f!==l&&(console.log(`Applying`,d,`produced`,f),l=f)}C(o,r.context)}c=o.toString({parenthesis:`all`})}return o}function ne(e,t,n){var r=e;if(e)for(var i=0;i<e.length;++i){var a=re(e[i],t,n);a!==e[i]&&(r===e&&(r=e.slice()),r[i]=a)}return r}function re(e,t,n){if(t.assuming){for(var r in t.assuming)for(var i in t.assuming[r])if(_(r,i,n)!==t.assuming[r][i])return e}var a=b(t.imposeContext,n),o=e;if(o instanceof p||o instanceof u){var l=ne(o.args,t,n);l!==o.args&&(o=o.clone(),o.args=l)}else if(o instanceof m){if(o.content){var h=re(o.content,t,n);h!==o.content&&(o=new m(h))}}else if(o instanceof c){var g=ne(o.items,t,n);g!==o.items&&(o=new c(g))}else if(o instanceof s){var v=o.object;o.object&&(v=re(o.object,t,n));var y=o.index;o.index&&(y=re(o.index,t,n)),(v!==o.object||y!==o.index)&&(o=new s(v,y))}else if(o instanceof d){var x=ne(o.dimensions,t,n);x!==o.dimensions&&(o=new d(x))}else if(o instanceof f){var S=!1,C={};for(var w in o.properties)C[w]=re(o.properties[w],t,n),C[w]!==o.properties[w]&&(S=!0);S&&(o=new f(C))}var T=t.r,E=L(t.l,o,a)[0];if(!E&&t.expanded&&(T=t.expanded.r,E=L(t.expanded.l,o,a)[0]),!E&&t.expandedNC1&&(T=t.expandedNC1.r,E=L(t.expandedNC1.l,o,a)[0],E||=(T=t.expandedNC2.r,L(t.expandedNC2.l,o,a)[0])),E){var D=o.implicit;o=T.clone(),D&&`implicit`in T&&(o.implicit=!0),o=o.transform(function(e){return e.isSymbolNode&&z(E.placeholders,e.name)?E.placeholders[e.name].clone():e})}return t.repeat&&o!==e&&(o=re(o,t,n)),o}function ie(e,t){var n=[],r,i,a=E(e);if(v(e,t))for(var o=0;o<e.args.length;o++)i=e.args.slice(0),i.splice(o,1),r=i.length===1?i[0]:a(i),n.push(a([e.args[o],r]));else for(var s=1;s<e.args.length;s++){var c=e.args[0];s>1&&(c=a(e.args.slice(0,s))),i=e.args.slice(s),r=i.length===1?i[0]:a(i),n.push(a([c,r]))}return n}function ae(e,t){var n={placeholders:{}};if(!e.placeholders&&!t.placeholders)return n;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var r in e.placeholders)if(z(e.placeholders,r)&&(n.placeholders[r]=e.placeholders[r],z(t.placeholders,r)&&!se(e.placeholders[r],t.placeholders[r])))return null;for(var i in t.placeholders)z(t.placeholders,i)&&(n.placeholders[i]=t.placeholders[i]);return n}function I(e,t){var n=[];if(e.length===0||t.length===0)return n;for(var r,i=0;i<e.length;i++)for(var a=0;a<t.length;a++)r=ae(e[i],t[a]),r&&n.push(r);return n}function oe(e){if(e.length===0)return e;for(var t=e.reduce(I),n=[],r={},i=0;i<t.length;i++){var a=JSON.stringify(t[i],g);r[a]||(r[a]=!0,n.push(t[i]))}return n}function L(e,t,n,i){var a=[{placeholders:{}}];if(e instanceof p&&t instanceof p||e instanceof u&&t instanceof u){if(e instanceof p){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof u&&e.name!==t.name)return[];if(t.args.length===1&&e.args.length===1||!y(t,n)&&t.args.length===e.args.length||i){for(var o=[],s=0;s<e.args.length;s++){var c=L(e.args[s],t.args[s],n);if(c.length===0)break;o.push(c)}if(o.length!==e.args.length){if(!v(t,n)||e.args.length===1)return[];if(e.args.length>2)throw Error(`permuting >2 commutative non-associative rule arguments not yet implemented`);var d=L(e.args[0],t.args[1],n);if(d.length===0)return[];var f=L(e.args[1],t.args[0],n);if(f.length===0)return[];o=[d,f]}a=oe(o)}else if(t.args.length>=2&&e.args.length===2){for(var m=ie(t,n),g=[],_=0;_<m.length;_++){var b=L(e,m[_],n,!0);g=g.concat(b)}return g}else if(e.args.length>2)throw Error(`Unexpected non-binary associative function: `+e.toString());else return[]}else if(e instanceof h){if(e.name.length===0)throw Error(`Symbol in rule has 0 length...!?`);if(M[e.name]){if(e.name!==t.name)return[]}else switch(e.name[1]>=`a`&&e.name[1]<=`z`?e.name.substring(0,2):e.name[0]){case`n`:case`_p`:a[0].placeholders[e.name]=t;break;case`c`:case`cl`:if(ye(t))a[0].placeholders[e.name]=t;else return[];break;case`v`:if(!ye(t))a[0].placeholders[e.name]=t;else return[];break;case`vl`:if(Ae(t))a[0].placeholders[e.name]=t;else return[];break;case`cd`:if(kv(t))a[0].placeholders[e.name]=t;else return[];break;case`vd`:if(!kv(t))a[0].placeholders[e.name]=t;else return[];break;case`ce`:if(Av(t))a[0].placeholders[e.name]=t;else return[];break;case`ve`:if(!Av(t))a[0].placeholders[e.name]=t;else return[];break;default:throw Error(`Invalid symbol in rule: `+e.name)}}else if(e instanceof l){if(!r(e.value,t.value))return[]}else return[];return a}function se(e,t){if(e instanceof l&&t instanceof l){if(!r(e.value,t.value))return!1}else if(e instanceof h&&t instanceof h){if(e.name!==t.name)return!1}else if(e instanceof p&&t instanceof p||e instanceof u&&t instanceof u){if(e instanceof p){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof u&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var n=0;n<e.args.length;n++)if(!se(e.args[n],t.args[n]))return!1}else return!1;return!0}return A}),Fv=V(`simplifyConstant`,[`typed`,`config`,`mathWithTransform`,`matrix`,`isBounded`,`?fraction`,`?bignumber`,`AccessorNode`,`ArrayNode`,`ConstantNode`,`FunctionNode`,`IndexNode`,`ObjectNode`,`OperatorNode`,`SymbolNode`],e=>{var{typed:t,config:n,mathWithTransform:r,matrix:i,isBounded:a,fraction:o,bignumber:s,AccessorNode:c,ArrayNode:l,ConstantNode:u,FunctionNode:d,IndexNode:f,ObjectNode:p,OperatorNode:m,SymbolNode:h}=e,{isCommutative:g,isAssociative:_,allChildren:v,createMakeNodeFunction:y}=Nv({FunctionNode:d,OperatorNode:m,SymbolNode:h}),b=t(`simplifyConstant`,{Node:e=>w(M(e,{})),"Node, Object":function(e,t){return w(M(e,t))}});function x(e){return j(e)?e.valueOf():e instanceof Array?e.map(x):F(e)?i(x(e.valueOf())):e}function S(e,t,n){try{return r[e].apply(null,t)}catch{return t=t.map(x),E(r[e].apply(null,t),n)}}var C=t({Fraction:O,number:function(e){return e<0?D(new u(-e)):new u(e)},BigNumber:function(e){return e<0?D(new u(-e)):new u(e)},bigint:function(e){return e<0n?D(new u(-e)):new u(e)},Complex:function(e){throw Error(`Cannot convert Complex number to Node`)},string:function(e){return new u(e)},Matrix:function(e){return new l(e.valueOf().map(e=>C(e)))}});function w(e){return we(e)?e:C(e)}function T(e,t){if(t&&t.exactFractions!==!1&&a(e)&&o){var n=o(e),r=t&&typeof t.fractionsLimit==`number`?t.fractionsLimit:1/0;if(n.valueOf()===e&&n.n<r&&n.d<r)return n}return e}var E=t({"string, Object":function(e,t){var r=Qe(e,n);return r===`BigNumber`?(s===void 0&&du(),s(e)):r===`bigint`?BigInt(e):r===`Fraction`?(o===void 0&&fu(),o(e)):T(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return T(e,t)},"bigint, Object":function(e,t){return e},"Complex, Object":function(e,t){return e.im===0?T(e.re,t):e},"Matrix, Object":function(e,t){return i(T(e.valueOf()))},"Array, Object":function(e,t){return e.map(T)}});function D(e){return new m(`-`,`unaryMinus`,[e])}function O(e){var t=e=>n.number===`BigNumber`&&s?s(e):Number(e),r=e.s*e.n,i=r<0n?new m(`-`,`unaryMinus`,[new u(-t(r))]):new u(t(r));return e.d===1n?i:new m(`/`,`divide`,[i,new u(t(e.d))])}function k(e,t,n){if(!Ce(t))return new c(w(e),w(t));if(he(e)||F(e)){for(var r=Array.from(t.dimensions);r.length>0;)if(ye(r[0])&&typeof r[0].value!=`string`){var a=E(r.shift().value,n);he(e)?e=e.items[a-1]:(e=e.valueOf()[a-1],e instanceof Array&&(e=i(e)))}else if(r.length>1&&ye(r[1])&&typeof r[1].value!=`string`){var o=E(r[1].value,n),s=[],d=he(e)?e.items:e.valueOf();for(var p of d)if(he(p))s.push(p.items[o-1]);else if(F(e))s.push(p[o-1]);else break;if(s.length===d.length)e=he(e)?new l(s):i(s),r.splice(1,1);else break}else break;return r.length===t.dimensions.length?new c(w(e),t):r.length>0?(t=new f(r),new c(w(e),t)):e}if(Te(e)&&t.dimensions.length===1&&ye(t.dimensions[0])){var m=t.dimensions[0].value;return m in e.properties?e.properties[m]:new u}return new c(w(e),t)}function A(e,t,n,r){var i=t.shift(),a=t.reduce((t,i)=>{if(!we(i)){var a=t.pop();if(we(a))return[a,i];try{return t.push(S(e,[a,i],r)),t}catch{t.push(a)}}return t.push(w(t.pop())),[n([t.length===1?t[0]:n(t),w(i)])]},[i]);return a.length===1?a[0]:n([a[0],C(a[1])])}function M(e,t){switch(e.type){case`SymbolNode`:return e;case`ConstantNode`:switch(typeof e.value){case`number`:return E(e.value,t);case`bigint`:return E(e.value,t);case`string`:return e.value;default:if(!isNaN(e.value))return E(e.value,t)}return e;case`FunctionNode`:if(r[e.name]&&r[e.name].rawArgs)return e;if(![`add`,`multiply`].includes(e.name)){var n=e.args.map(e=>M(e,t));if(!n.some(we))try{return S(e.name,n,t)}catch{}if(e.name===`size`&&n.length===1&&he(n[0])){for(var a=[],o=n[0];he(o);)a.push(o.items.length),o=o.items[0];return i(a)}return new d(e.name,n.map(w))}case`OperatorNode`:var s=e.fn.toString(),c,u,m=y(e);if(Ee(e)&&e.isUnary())c=[M(e.args[0],t)],u=we(c[0])?m(c):S(s,c,t);else if(_(e,t.context))if(c=v(e,t.context),c=c.map(e=>M(e,t)),g(s,t.context)){for(var h=[],x=[],C=0;C<c.length;C++)we(c[C])?x.push(c[C]):h.push(c[C]);h.length>1?(u=A(s,h,m,t),x.unshift(u),u=A(s,x,m,t)):u=A(s,c,m,t)}else u=A(s,c,m,t);else c=e.args.map(e=>M(e,t)),u=A(s,c,m,t);return u;case`ParenthesisNode`:return M(e.content,t);case`AccessorNode`:return k(M(e.object,t),M(e.index,t),t);case`ArrayNode`:var T=e.items.map(e=>M(e,t));return T.some(we)?new l(T.map(w)):i(T);case`IndexNode`:return new f(e.dimensions.map(e=>b(e,t)));case`ObjectNode`:var D={};for(var O in e.properties)D[O]=b(e.properties[O],t);return new p(D);default:throw Error(`Unimplemented node type in simplifyConstant: ${e.type}`)}}return b}),Iv=`simplifyCore`,Lv=V(Iv,[`typed`,`parse`,`equal`,`isZero`,`add`,`subtract`,`multiply`,`divide`,`pow`,`AccessorNode`,`ArrayNode`,`ConstantNode`,`FunctionNode`,`IndexNode`,`ObjectNode`,`OperatorNode`,`ParenthesisNode`,`SymbolNode`],e=>{var{typed:t,parse:n,equal:r,isZero:i,add:a,subtract:o,multiply:s,divide:c,pow:l,AccessorNode:u,ArrayNode:d,ConstantNode:f,FunctionNode:p,IndexNode:m,ObjectNode:h,OperatorNode:g,ParenthesisNode:_,SymbolNode:v}=e,y=new f(0),b=new f(1),x=new f(!0),S=new f(!1);function C(e){return Ee(e)&&[`and`,`not`,`or`].includes(e.op)}var{hasProperty:w,isCommutative:T}=Nv({FunctionNode:p,OperatorNode:g,SymbolNode:v});function E(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t?t.context:void 0;if(w(e,`trivial`,n)){if(Se(e)&&e.args.length===1)return E(e.args[0],t);var a=!1,o=0;if(e.forEach(e=>{++o,o===1&&(a=E(e,t))}),o===1)return a}var s=e;if(Se(s)){var c=sh(s.name);if(c){if(s.args.length>2&&w(s,`associative`,n))for(;s.args.length>2;){var l=s.args.pop(),f=s.args.pop();s.args.push(new g(c,s.name,[l,f]))}s=new g(c,s.name,s.args)}else return new p(E(s.fn),s.args.map(e=>E(e,t)))}if(Ee(s)&&s.isUnary()){var _=E(s.args[0],t);if(s.op===`~`&&Ee(_)&&_.isUnary()&&_.op===`~`||s.op===`not`&&Ee(_)&&_.isUnary()&&_.op===`not`&&C(_.args[0]))return _.args[0];var v=!0;if(s.op===`-`&&Ee(_)&&(_.isBinary()&&_.fn===`subtract`&&(s=new g(`-`,`subtract`,[_.args[1],_.args[0]]),v=!1),_.isUnary()&&_.op===`-`))return _.args[0];if(v)return new g(s.op,s.fn,[_])}if(Ee(s)&&s.isBinary()){var D=E(s.args[0],t),O=E(s.args[1],t);if(s.op===`+`){if(ye(D)&&i(D.value))return O;if(ye(O)&&i(O.value))return D;Ee(O)&&O.isUnary()&&O.op===`-`&&(O=O.args[0],s=new g(`-`,`subtract`,[D,O]))}if(s.op===`-`)return Ee(O)&&O.isUnary()&&O.op===`-`?E(new g(`+`,`add`,[D,O.args[0]]),t):ye(D)&&i(D.value)?E(new g(`-`,`unaryMinus`,[O])):ye(O)&&i(O.value)?D:new g(s.op,s.fn,[D,O]);if(s.op===`*`){if(ye(D)){if(i(D.value))return y;if(r(D.value,1))return O}if(ye(O)){if(i(O.value))return y;if(r(O.value,1))return D;if(T(s,n))return new g(s.op,s.fn,[O,D],s.implicit)}return new g(s.op,s.fn,[D,O],s.implicit)}if(s.op===`/`)return ye(D)&&i(D.value)?y:ye(O)&&r(O.value,1)?D:new g(s.op,s.fn,[D,O]);if(s.op===`^`&&ye(O)){if(i(O.value))return b;if(r(O.value,1))return D}if(s.op===`and`){if(ye(D))if(D.value){if(C(O))return O;if(ye(O))return O.value?x:S}else return S;if(ye(O))if(O.value){if(C(D))return D}else return S}if(s.op===`or`){if(ye(D)){if(D.value)return x;if(C(O))return O}if(ye(O)){if(O.value)return x;if(C(D))return D}}return new g(s.op,s.fn,[D,O])}if(Ee(s))return new g(s.op,s.fn,s.args.map(e=>E(e,t)));if(he(s))return new d(s.items.map(e=>E(e,t)));if(me(s))return new u(E(s.object,t),E(s.index,t));if(Ce(s))return new m(s.dimensions.map(e=>E(e,t)));if(Te(s)){var k={};for(var A in s.properties)k[A]=E(s.properties[A],t);return new h(k)}return s}return t(Iv,{Node:E,"Node,Object":E})}),Rv=V(`resolve`,[`typed`,`parse`,`ConstantNode`,`FunctionNode`,`OperatorNode`,`ParenthesisNode`],e=>{var{typed:t,parse:n,ConstantNode:r,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function s(e,t){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!t)return e;if(Ae(e)){if(c.has(e.name)){var l=Array.from(c).join(`, `);throw ReferenceError(`recursive loop of variable definitions among {${l}}`)}var u=t.get(e.name);if(we(u)){var d=new Set(c);return d.add(e.name),s(u,t,d)}return typeof u==`number`?n(String(u)):u===void 0?e:new r(u)}if(Ee(e)){var f=e.args.map(function(e){return s(e,t,c)});return new a(e.op,e.fn,f,e.implicit)}if(De(e))return new o(s(e.content,t,c));if(Se(e)){var p=e.args.map(function(e){return s(e,t,c)});return new i(e.name,p)}return e.map(e=>s(e,t,c))}return t(`resolve`,{Node:s,"Node, Map | null | undefined":s,"Node, Object":(e,t)=>s(e,T(t)),"Array | Matrix":t.referToSelf(e=>t=>t.map(t=>e(t))),"Array | Matrix, null | undefined":t.referToSelf(e=>t=>t.map(t=>e(t))),"Array, Object":t.referTo(`Array,Map`,e=>(t,n)=>e(t,T(n))),"Matrix, Object":t.referTo(`Matrix,Map`,e=>(t,n)=>e(t,T(n))),"Array | Matrix, Map":t.referToSelf(e=>(t,n)=>t.map(t=>e(t,n)))})}),zv=`symbolicEqual`,Bv=V(zv,[`parse`,`simplify`,`typed`,`OperatorNode`],e=>{var{parse:t,simplify:n,typed:r,OperatorNode:i}=e;function a(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n(new i(`-`,`subtract`,[e,t]),{},r);return ye(a)&&!a.value}return r(zv,{"Node, Node":a,"Node, Node, Object":a})}),Vv=`derivative`,Hv=V(Vv,[`typed`,`config`,`parse`,`simplify`,`equal`,`isZero`,`numeric`,`ConstantNode`,`FunctionNode`,`OperatorNode`,`ParenthesisNode`,`SymbolNode`],e=>{var{typed:t,config:n,parse:r,simplify:i,equal:a,isZero:o,numeric:s,ConstantNode:c,FunctionNode:l,OperatorNode:u,ParenthesisNode:d,SymbolNode:f}=e;function p(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},r=new Map,a=t.name;function o(e){var t=r.get(e);if(t!==void 0)return t;var n=_(o,e,a);return r.set(e,n),n}var s=v(e,o);return n.simplify?i(s):s}function m(e){var t=r(e);if(!t.isSymbolNode)throw TypeError(`Invalid variable. Cannot parse ${JSON.stringify(e)} into a variable in function derivative`);return t}var h=t(Vv,{"Node, SymbolNode":p,"Node, SymbolNode, Object":p,"Node, string":(e,t)=>p(e,m(t)),"Node, string, Object":(e,t,n)=>p(e,m(t),n)});h._simplify=!0,h.toTex=function(e){return g.apply(null,e.args)};var g=t(`_derivTex`,{"Node, SymbolNode":function(e,t){return ye(e)&&Me(e.value)===`string`?g(r(e.value).toString(),t.toString(),1):g(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if(Me(t.value)===`string`)return g(e,r(t.value));throw Error(`The second parameter to 'derivative' is a non-string constant`)},"Node, SymbolNode, ConstantNode":function(e,t,n){return g(e.toString(),t.name,n.value)},"string, string, number":function(e,t,n){return(n===1?`{d\\over d`+t+`}`:`{d^{`+n+`}\\over d`+t+`^{`+n+`}}`)+`\\left[${e}\\right]`}}),_=t(`_isConst`,{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(e,t,n){return t.name!==n},"function, ParenthesisNode, string":function(e,t,n){return e(t.content,n)},"function, FunctionAssignmentNode, string":function(e,t,n){return!t.params.includes(n)||e(t.expr,n)},"function, FunctionNode | OperatorNode, string":function(e,t,n){return t.args.every(t=>e(t,n))}}),v=t(`_derivative`,{"ConstantNode, function":function(){return y(0)},"SymbolNode, function":function(e,t){return t(e)?y(0):y(1)},"ParenthesisNode, function":function(e,t){return new d(v(e.content,t))},"FunctionAssignmentNode, function":function(e,t){return t(e)?y(0):v(e.expr,t)},"FunctionNode, function":function(e,t){if(t(e))return y(0);var n=e.args[0],r,i=!1,a=!1,o;switch(e.name){case`cbrt`:i=!0,o=new u(`*`,`multiply`,[y(3),new u(`^`,`pow`,[n,new u(`/`,`divide`,[y(2),y(3)])])]);break;case`sqrt`:case`nthRoot`:if(e.args.length===1)i=!0,o=new u(`*`,`multiply`,[y(2),new l(`sqrt`,[n])]);else if(e.args.length===2)return r=new u(`/`,`divide`,[y(1),e.args[1]]),v(new u(`^`,`pow`,[n,r]),t);break;case`log10`:r=y(10);case`log`:if(!r&&e.args.length===1)o=n.clone(),i=!0;else if(e.args.length===1&&r||e.args.length===2&&t(e.args[1]))o=new u(`*`,`multiply`,[n.clone(),new l(`log`,[r||e.args[1]])]),i=!0;else if(e.args.length===2)return v(new u(`/`,`divide`,[new l(`log`,[n]),new l(`log`,[e.args[1]])]),t);break;case`pow`:if(e.args.length===2)return v(new u(`^`,`pow`,[n,e.args[1]]),t);break;case`exp`:o=new l(`exp`,[n.clone()]);break;case`sin`:o=new l(`cos`,[n.clone()]);break;case`cos`:o=new u(`-`,`unaryMinus`,[new l(`sin`,[n.clone()])]);break;case`tan`:o=new u(`^`,`pow`,[new l(`sec`,[n.clone()]),y(2)]);break;case`sec`:o=new u(`*`,`multiply`,[e,new l(`tan`,[n.clone()])]);break;case`csc`:a=!0,o=new u(`*`,`multiply`,[e,new l(`cot`,[n.clone()])]);break;case`cot`:a=!0,o=new u(`^`,`pow`,[new l(`csc`,[n.clone()]),y(2)]);break;case`asin`:i=!0,o=new l(`sqrt`,[new u(`-`,`subtract`,[y(1),new u(`^`,`pow`,[n.clone(),y(2)])])]);break;case`acos`:i=!0,a=!0,o=new l(`sqrt`,[new u(`-`,`subtract`,[y(1),new u(`^`,`pow`,[n.clone(),y(2)])])]);break;case`atan`:i=!0,o=new u(`+`,`add`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)]);break;case`asec`:i=!0,o=new u(`*`,`multiply`,[new l(`abs`,[n.clone()]),new l(`sqrt`,[new u(`-`,`subtract`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)])])]);break;case`acsc`:i=!0,a=!0,o=new u(`*`,`multiply`,[new l(`abs`,[n.clone()]),new l(`sqrt`,[new u(`-`,`subtract`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)])])]);break;case`acot`:i=!0,a=!0,o=new u(`+`,`add`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)]);break;case`sinh`:o=new l(`cosh`,[n.clone()]);break;case`cosh`:o=new l(`sinh`,[n.clone()]);break;case`tanh`:o=new u(`^`,`pow`,[new l(`sech`,[n.clone()]),y(2)]);break;case`sech`:a=!0,o=new u(`*`,`multiply`,[e,new l(`tanh`,[n.clone()])]);break;case`csch`:a=!0,o=new u(`*`,`multiply`,[e,new l(`coth`,[n.clone()])]);break;case`coth`:a=!0,o=new u(`^`,`pow`,[new l(`csch`,[n.clone()]),y(2)]);break;case`asinh`:i=!0,o=new l(`sqrt`,[new u(`+`,`add`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)])]);break;case`acosh`:i=!0,o=new l(`sqrt`,[new u(`-`,`subtract`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)])]);break;case`atanh`:i=!0,o=new u(`-`,`subtract`,[y(1),new u(`^`,`pow`,[n.clone(),y(2)])]);break;case`asech`:i=!0,a=!0,o=new u(`*`,`multiply`,[n.clone(),new l(`sqrt`,[new u(`-`,`subtract`,[y(1),new u(`^`,`pow`,[n.clone(),y(2)])])])]);break;case`acsch`:i=!0,a=!0,o=new u(`*`,`multiply`,[new l(`abs`,[n.clone()]),new l(`sqrt`,[new u(`+`,`add`,[new u(`^`,`pow`,[n.clone(),y(2)]),y(1)])])]);break;case`acoth`:i=!0,a=!0,o=new u(`-`,`subtract`,[y(1),new u(`^`,`pow`,[n.clone(),y(2)])]);break;case`abs`:o=new u(`/`,`divide`,[new l(new f(`abs`),[n.clone()]),n.clone()]);break;default:throw Error(`Cannot process function "`+e.name+`" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported`)}var s,c;i?(s=`/`,c=`divide`):(s=`*`,c=`multiply`);var d=v(n,t);return a&&(d=new u(`-`,`unaryMinus`,[d])),new u(s,c,[d,o])},"OperatorNode, function":function(e,t){if(t(e))return y(0);if(e.op===`+`)return new u(e.op,e.fn,e.args.map(function(e){return v(e,t)}));if(e.op===`-`){if(e.isUnary())return new u(e.op,e.fn,[v(e.args[0],t)]);if(e.isBinary())return new u(e.op,e.fn,[v(e.args[0],t),v(e.args[1],t)])}if(e.op===`*`){var n=e.args.filter(function(e){return t(e)});if(n.length>0){var r=e.args.filter(function(e){return!t(e)}),i=r.length===1?r[0]:new u(`*`,`multiply`,r);return new u(`*`,`multiply`,n.concat(v(i,t)))}return new u(`+`,`add`,e.args.map(function(n){return new u(`*`,`multiply`,e.args.map(function(e){return e===n?v(e,t):e.clone()}))}))}if(e.op===`/`&&e.isBinary()){var s=e.args[0],c=e.args[1];return t(c)?new u(`/`,`divide`,[v(s,t),c]):t(s)?new u(`*`,`multiply`,[new u(`-`,`unaryMinus`,[s]),new u(`/`,`divide`,[v(c,t),new u(`^`,`pow`,[c.clone(),y(2)])])]):new u(`/`,`divide`,[new u(`-`,`subtract`,[new u(`*`,`multiply`,[v(s,t),c.clone()]),new u(`*`,`multiply`,[s.clone(),v(c,t)])]),new u(`^`,`pow`,[c.clone(),y(2)])])}if(e.op===`^`&&e.isBinary()){var d=e.args[0],f=e.args[1];if(t(d))return ye(d)&&(o(d.value)||a(d.value,1))?y(0):new u(`*`,`multiply`,[e,new u(`*`,`multiply`,[new l(`log`,[d.clone()]),v(f.clone(),t)])]);if(t(f)){if(ye(f)){if(o(f.value))return y(0);if(a(f.value,1))return v(d,t)}var p=new u(`^`,`pow`,[d.clone(),new u(`-`,`subtract`,[f,y(1)])]);return new u(`*`,`multiply`,[f.clone(),new u(`*`,`multiply`,[v(d,t),p])])}return new u(`*`,`multiply`,[new u(`^`,`pow`,[d.clone(),f.clone()]),new u(`+`,`add`,[new u(`*`,`multiply`,[v(d,t),new u(`/`,`divide`,[f.clone(),d.clone()])]),new u(`*`,`multiply`,[v(f,t),new l(`log`,[d.clone()])])])])}throw Error(`Cannot process operator "`+e.op+`" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported`)}});function y(e,t){return new c(s(e,t||Qe(String(e),n)))}return h}),Uv=`rationalize`,Wv=V(Uv,`config.typed.equal.isZero.add.subtract.multiply.divide.pow.parse.simplifyConstant.simplifyCore.simplify.?bignumber.?fraction.mathWithTransform.matrix.AccessorNode.ArrayNode.ConstantNode.FunctionNode.IndexNode.ObjectNode.OperatorNode.SymbolNode.ParenthesisNode`.split(`.`),e=>{var{config:t,typed:n,equal:r,isZero:i,add:a,subtract:o,multiply:s,divide:c,pow:l,parse:u,simplifyConstant:d,simplifyCore:f,simplify:p,fraction:m,bignumber:h,mathWithTransform:g,matrix:_,AccessorNode:v,ArrayNode:y,ConstantNode:b,FunctionNode:x,IndexNode:S,ObjectNode:C,OperatorNode:w,SymbolNode:T,ParenthesisNode:E}=e;function D(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=k(),i=O(e,t,!0,r.firstRules),a=i.variables.length,o={exactFractions:!1},s={exactFractions:!0};if(e=i.expression,a>=1){e=A(e);var c,l,u=!0,d=!1;e=p(e,r.firstRules,{},o);for(var f;l=u?r.distrDivRules:r.sucDivRules,e=p(e,l,{},s),u=!u,f=e.toString(),f!==c;)d=!0,c=f;d&&(e=p(e,r.firstRulesAgain,{},o)),e=p(e,r.finalRules,{},o)}var m=[],h={};return e.type===`OperatorNode`&&e.isBinary()&&e.op===`/`?(a===1&&(e.args[0]=j(e.args[0],m),e.args[1]=j(e.args[1])),n&&(h.numerator=e.args[0],h.denominator=e.args[1])):(a===1&&(e=j(e,m)),n&&(h.numerator=e,h.denominator=null)),n?(h.coefficients=m,h.variables=i.variables,h.expression=e,h):e}return n(Uv,{Node:D,"Node, boolean":(e,t)=>D(e,{},t),"Node, Object":D,"Node, Object, boolean":D});function O(e,t,n,r){var i=[],a=p(e,r,t,{exactFractions:!1});n=!!n;var o=`+-*`+(n?`/`:``);c(a);var s={};return s.expression=a,s.variables=i,s;function c(e){var t=e.type;if(t===`FunctionNode`)throw Error(`There is an unsolved function call`);if(t===`OperatorNode`)if(e.op===`^`){if(e.args[1].type!==`ConstantNode`||!H(parseFloat(e.args[1].value)))throw Error(`There is a non-integer exponent`);c(e.args[0])}else{if(!o.includes(e.op))throw Error(`Operator `+e.op+` invalid in polynomial expression`);for(var n=0;n<e.args.length;n++)c(e.args[n])}else if(t===`SymbolNode`){var r=e.name;i.indexOf(r)===-1&&i.push(r)}else if(t===`ParenthesisNode`)c(e.content);else if(t!==`ConstantNode`)throw Error(`type `+t+` is not allowed in polynomial expression`)}}function k(){var e=[f,{l:`n+n`,r:`2*n`},{l:`n+-n`,r:`0`},d,{l:`n*(n1^-1)`,r:`n/n1`},{l:`n*n1^-n2`,r:`n/n1^n2`},{l:`n1^-1`,r:`1/n1`},{l:`n*(n1/n2)`,r:`(n*n1)/n2`},{l:`1*n`,r:`n`}],t=[{l:`(-n1)/(-n2)`,r:`n1/n2`},{l:`(-n1)*(-n2)`,r:`n1*n2`},{l:`n1--n2`,r:`n1+n2`},{l:`n1-n2`,r:`n1+(-n2)`},{l:`(n1+n2)*n3`,r:`(n1*n3 + n2*n3)`},{l:`n1*(n2+n3)`,r:`(n1*n2+n1*n3)`},{l:`c1*n + c2*n`,r:`(c1+c2)*n`},{l:`c1*n + n`,r:`(c1+1)*n`},{l:`c1*n - c2*n`,r:`(c1-c2)*n`},{l:`c1*n - n`,r:`(c1-1)*n`},{l:`v/c`,r:`(1/c)*v`},{l:`v/-c`,r:`-(1/c)*v`},{l:`-v*-c`,r:`c*v`},{l:`-v*c`,r:`-c*v`},{l:`v*-c`,r:`-c*v`},{l:`v*c`,r:`c*v`},{l:`-(-n1*n2)`,r:`(n1*n2)`},{l:`-(n1*n2)`,r:`(-n1*n2)`},{l:`-(-n1+n2)`,r:`(n1-n2)`},{l:`-(n1+n2)`,r:`(-n1-n2)`},{l:`(n1^n2)^n3`,r:`(n1^(n2*n3))`},{l:`-(-n1/n2)`,r:`(n1/n2)`},{l:`-(n1/n2)`,r:`(-n1/n2)`}],n=[{l:`(n1/n2 + n3/n4)`,r:`((n1*n4 + n3*n2)/(n2*n4))`},{l:`(n1/n2 + n3)`,r:`((n1 + n3*n2)/n2)`},{l:`(n1 + n2/n3)`,r:`((n1*n3 + n2)/n3)`}],r=[{l:`(n1/(n2/n3))`,r:`((n1*n3)/n2)`},{l:`(n1/n2/n3)`,r:`(n1/(n2*n3))`}],i={};return i.firstRules=e.concat(t,r),i.distrDivRules=n,i.sucDivRules=r,i.firstRulesAgain=e.concat(t),i.finalRules=[f,{l:`n*-n`,r:`-n^2`},{l:`n*n`,r:`n^2`},d,{l:`n*-n^n1`,r:`-n^(n1+1)`},{l:`n*n^n1`,r:`n^(n1+1)`},{l:`n^n1*-n^n2`,r:`-n^(n1+n2)`},{l:`n^n1*n^n2`,r:`n^(n1+n2)`},{l:`n^n1*-n`,r:`-n^(n1+1)`},{l:`n^n1*n`,r:`n^(n1+1)`},{l:`n^n1/-n`,r:`-n^(n1-1)`},{l:`n^n1/n`,r:`n^(n1-1)`},{l:`n/-n^n1`,r:`-n^(1-n1)`},{l:`n/n^n1`,r:`n^(1-n1)`},{l:`n^n1/-n^n2`,r:`n^(n1-n2)`},{l:`n^n1/n^n2`,r:`n^(n1-n2)`},{l:`n1+(-n2*n3)`,r:`n1-n2*n3`},{l:`v*(-c)`,r:`-c*v`},{l:`n1+-n2`,r:`n1-n2`},{l:`v*c`,r:`c*v`},{l:`(n1^n2)^n3`,r:`(n1^(n2*n3))`}],i}function A(e,t,n){var r=e.type,i=arguments.length>1;if(r===`OperatorNode`&&e.isBinary()){var a=!1,o;if(e.op===`^`&&(e.args[0].type===`ParenthesisNode`||e.args[0].type===`OperatorNode`)&&e.args[1].type===`ConstantNode`&&(o=parseFloat(e.args[1].value),a=o>=2&&H(o)),a){if(o>2){var s=e.args[0];e=new w(`*`,`multiply`,[s,new w(`^`,`pow`,[e.args[0].cloneDeep(),new b(o-1)])])}else e=new w(`*`,`multiply`,[e.args[0],e.args[0].cloneDeep()]);i&&(n===`content`?t.content=e:t.args[n]=e)}}if(r===`ParenthesisNode`)A(e.content,e,`content`);else if(r!==`ConstantNode`&&r!==`SymbolNode`)for(var c=0;c<e.args.length;c++)A(e.args[c],e,c);if(!i)return e}function j(e,t){t===void 0&&(t=[]),t[0]=0;var n={};n.cte=1,n.oper=`+`,n.fire=``;var r=0,i=``;f(e,null,n),r=t.length-1;for(var a=!0,o,s=r;s>=0;s--)if(t[s]!==0){var c=new b(a?t[s]:Math.abs(t[s])),l=t[s]<0?`-`:`+`;if(s>0){var u=new T(i);if(s>1){var d=new b(s);u=new w(`^`,`pow`,[u,d])}c=t[s]===-1&&a?new w(`-`,`unaryMinus`,[u]):Math.abs(t[s])===1?u:new w(`*`,`multiply`,[c,u])}o=a?c:l===`+`?new w(`+`,`add`,[o,c]):new w(`-`,`subtract`,[o,c]),a=!1}if(a)return new b(0);return o;function f(e,n,a){var o=e.type;if(o===`FunctionNode`)throw Error(`There is an unsolved function call`);if(o===`OperatorNode`){if(!`+-*^`.includes(e.op))throw Error(`Operator `+e.op+` invalid`);if(n!==null&&((e.fn===`unaryMinus`||e.fn===`pow`)&&n.fn!==`add`&&n.fn!==`subtract`&&n.fn!==`multiply`||(e.fn===`subtract`||e.fn===`add`||e.fn===`multiply`)&&n.fn!==`add`&&n.fn!==`subtract`||(e.fn===`subtract`||e.fn===`add`||e.fn===`unaryMinus`)&&a.noFil!==0))throw Error(`Invalid `+e.op+` placing`);(e.op===`^`||e.op===`*`)&&(a.fire=e.op);for(var s=0;s<e.args.length;s++)e.fn===`unaryMinus`&&(a.oper=`-`),(e.op===`+`||e.fn===`subtract`)&&(a.fire=``,a.cte=1,a.oper=s===0?`+`:e.op),a.noFil=s,f(e.args[s],e,a)}else if(o===`SymbolNode`){if(e.name!==i&&i!==``)throw Error(`There is more than one variable`);if(i=e.name,n===null){t[1]=1;return}if(n.op===`^`&&a.noFil!==0)throw Error(`In power the variable should be the first parameter`);if(n.op===`*`&&a.noFil!==1)throw Error(`In multiply the variable should be the second parameter`);(a.fire===``||a.fire===`*`)&&(r<1&&(t[1]=0),t[1]+=a.cte*(a.oper===`+`?1:-1),r=Math.max(1,r))}else if(o===`ConstantNode`){var c=parseFloat(e.value);if(n===null){t[0]=c;return}if(n.op===`^`){if(a.noFil!==1)throw Error(`Constant cannot be powered`);if(!H(c)||c<=0)throw Error(`Non-integer exponent is not allowed`);for(var l=r+1;l<c;l++)t[l]=0;c>r&&(t[c]=0),t[c]+=a.cte*(a.oper===`+`?1:-1),r=Math.max(c,r);return}a.cte=c,a.fire===``&&(t[0]+=a.cte*(a.oper===`+`?1:-1))}else throw Error(`Type `+o+` is not allowed`)}}}),Gv=`zpk2tf`,Kv=V(Gv,[`typed`,`add`,`multiply`,`Complex`,`number`],e=>{var{typed:t,add:n,multiply:r,Complex:i,number:a}=e;return t(Gv,{"Array,Array,number":function(e,t,n){return o(e,t,n)},"Array,Array":function(e,t){return o(e,t,1)},"Matrix,Matrix,number":function(e,t,n){return o(e.valueOf(),t.valueOf(),n)},"Matrix,Matrix":function(e,t){return o(e.valueOf(),t.valueOf(),1)}});function o(e,t,n){e.some(e=>e.type===`BigNumber`)&&(e=e.map(e=>a(e))),t.some(e=>e.type===`BigNumber`)&&(t=t.map(e=>a(e)));for(var o=[i(1,0)],c=[i(1,0)],l=0;l<e.length;l++){var u=e[l];typeof u==`number`&&(u=i(u,0)),o=s(o,[i(1,0),i(-u.re,-u.im)])}for(var d=0;d<t.length;d++){var f=t[d];typeof f==`number`&&(f=i(f,0)),c=s(c,[i(1,0),i(-f.re,-f.im)])}for(var p=0;p<o.length;p++)o[p]=r(o[p],n);return[o,c]}function s(e,t){for(var a=[],o=0;o<e.length+t.length-1;o++){a[o]=i(0,0);for(var s=0;s<e.length;s++)o-s>=0&&o-s<t.length&&(a[o]=n(a[o],r(e[s],t[o-s])))}return a}}),qv=`freqz`,Jv=V(qv,[`typed`,`add`,`multiply`,`Complex`,`divide`,`matrix`],e=>{var{typed:t,add:n,multiply:r,Complex:i,divide:a,matrix:o}=e;return t(qv,{"Array, Array":function(e,t){return s(e,t,c(512))},"Array, Array, Array":function(e,t,n){return s(e,t,n)},"Array, Array, number":function(e,t,n){if(n<0)throw Error(`w must be a positive number`);return s(e,t,c(n))},"Matrix, Matrix":function(e,t){var n=c(512),{w:r,h:i}=s(e.valueOf(),t.valueOf(),n);return{w:o(r),h:o(i)}},"Matrix, Matrix, Matrix":function(e,t,n){var{h:r}=s(e.valueOf(),t.valueOf(),n.valueOf());return{h:o(r),w:o(n)}},"Matrix, Matrix, number":function(e,t,n){if(n<0)throw Error(`w must be a positive number`);var r=c(n),{h:i}=s(e.valueOf(),t.valueOf(),r);return{h:o(i),w:o(r)}}});function s(e,t,o){for(var s=[],c=[],l=0;l<o.length;l++){for(var u=i(0,0),d=i(0,0),f=0;f<e.length;f++)u=n(u,r(e[f],i(Math.cos(-f*o[l]),Math.sin(-f*o[l]))));for(var p=0;p<t.length;p++)d=n(d,r(t[p],i(Math.cos(-p*o[l]),Math.sin(-p*o[l]))));s.push(u),c.push(d)}for(var m=[],h=0;h<s.length;h++)m.push(a(s[h],c[h]));return{h:m,w:o}}function c(e){for(var t=[],n=0;n<e;n++)t.push(n/e*Math.PI);return t}}),Yv=V(`reviver`,[`classes`],e=>{var{classes:t}=e;return function(e,n){var r=t[n&&n.mathjs];return r&&typeof r.fromJSON==`function`?r.fromJSON(n):n}}),Xv=V(`replacer`,[],()=>function(e,t){return typeof t==`number`&&(!Number.isFinite(t)||isNaN(t))?{mathjs:`number`,value:String(t)}:typeof t==`bigint`?{mathjs:`bigint`,value:String(t)}:t}),Zv=`15.2.0`,Qv=V(`true`,[],()=>!0),$v=V(`false`,[],()=>!1),ey=V(`null`,[],()=>null),ty=_y(`Infinity`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(1/0):1/0}),ny=_y(`NaN`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(NaN):NaN}),ry=_y(`pi`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?up(n):Ja}),iy=_y(`tau`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?dp(n):Ya}),ay=_y(`e`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?cp(n):Xa}),oy=_y(`phi`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?lp(n):Za}),sy=_y(`LN2`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(2).ln():Math.LN2}),cy=_y(`LN10`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(10).ln():Math.LN10}),ly=_y(`LOG2E`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(1).div(new n(2).ln()):Math.LOG2E}),uy=_y(`LOG10E`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(1).div(new n(10).ln()):Math.LOG10E}),dy=_y(`SQRT1_2`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(`0.5`).sqrt():Math.SQRT1_2}),fy=_y(`SQRT2`,[`config`,`?BigNumber`],e=>{var{config:t,BigNumber:n}=e;return t.number===`BigNumber`?new n(2).sqrt():Math.SQRT2}),py=_y(`i`,[`Complex`],e=>{var{Complex:t}=e;return t.I}),my=V(`PI`,[`pi`],e=>{var{pi:t}=e;return t}),hy=V(`E`,[`e`],e=>{var{e:t}=e;return t}),gy=V(`version`,[],()=>Zv);function _y(e,t,n){return V(e,t,n,{recreateOnConfigChange:!0})}var vy=hb(`speedOfLight`,`299792458`,`m s^-1`),yy=hb(`gravitationConstant`,`6.67430e-11`,`m^3 kg^-1 s^-2`),by=hb(`planckConstant`,`6.62607015e-34`,`J s`),xy=hb(`reducedPlanckConstant`,`1.0545718176461565e-34`,`J s`),Sy=hb(`magneticConstant`,`1.25663706212e-6`,`N A^-2`),Cy=hb(`electricConstant`,`8.8541878128e-12`,`F m^-1`),wy=hb(`vacuumImpedance`,`376.730313667`,`ohm`),Ty=hb(`coulomb`,`8.987551792261171e9`,`N m^2 C^-2`),Ey=hb(`coulombConstant`,`8.987551792261171e9`,`N m^2 C^-2`),Dy=hb(`elementaryCharge`,`1.602176634e-19`,`C`),Oy=hb(`bohrMagneton`,`9.2740100783e-24`,`J T^-1`),ky=hb(`conductanceQuantum`,`7.748091729863649e-5`,`S`),Ay=hb(`inverseConductanceQuantum`,`12906.403729652257`,`ohm`),jy=hb(`magneticFluxQuantum`,`2.0678338484619295e-15`,`Wb`),My=hb(`nuclearMagneton`,`5.0507837461e-27`,`J T^-1`),Ny=hb(`klitzing`,`25812.807459304513`,`ohm`),Py=hb(`bohrRadius`,`5.29177210903e-11`,`m`),Fy=hb(`classicalElectronRadius`,`2.8179403262e-15`,`m`),Iy=hb(`electronMass`,`9.1093837015e-31`,`kg`),Ly=hb(`fermiCoupling`,`1.1663787e-5`,`GeV^-2`),Ry=gb(`fineStructure`,.0072973525693),zy=hb(`hartreeEnergy`,`4.3597447222071e-18`,`J`),By=hb(`protonMass`,`1.67262192369e-27`,`kg`),Vy=hb(`deuteronMass`,`3.3435830926e-27`,`kg`),Hy=hb(`neutronMass`,`1.6749271613e-27`,`kg`),Uy=hb(`quantumOfCirculation`,`3.6369475516e-4`,`m^2 s^-1`),Wy=hb(`rydberg`,`10973731.568160`,`m^-1`),Gy=hb(`thomsonCrossSection`,`6.6524587321e-29`,`m^2`),Ky=gb(`weakMixingAngle`,.2229),qy=gb(`efimovFactor`,22.7),Jy=hb(`atomicMass`,`1.66053906660e-27`,`kg`),Yy=hb(`avogadro`,`6.02214076e23`,`mol^-1`),Xy=hb(`boltzmann`,`1.380649e-23`,`J K^-1`),Zy=hb(`faraday`,`96485.33212331001`,`C mol^-1`),Qy=hb(`firstRadiation`,`3.7417718521927573e-16`,`W m^2`),$y=hb(`loschmidt`,`2.686780111798444e25`,`m^-3`),eb=hb(`gasConstant`,`8.31446261815324`,`J K^-1 mol^-1`),tb=hb(`molarPlanckConstant`,`3.990312712893431e-10`,`J s mol^-1`),nb=hb(`molarVolume`,`0.022413969545014137`,`m^3 mol^-1`),rb=gb(`sackurTetrode`,-1.16487052358),ib=hb(`secondRadiation`,`0.014387768775039337`,`m K`),ab=hb(`stefanBoltzmann`,`5.67037441918443e-8`,`W m^-2 K^-4`),ob=hb(`wienDisplacement`,`2.897771955e-3`,`m K`),sb=hb(`molarMass`,`0.99999999965e-3`,`kg mol^-1`),cb=hb(`molarMassC12`,`11.9999999958e-3`,`kg mol^-1`),lb=hb(`gravity`,`9.80665`,`m s^-2`),ub=hb(`planckLength`,`1.616255e-35`,`m`),db=hb(`planckMass`,`2.176435e-8`,`kg`),fb=hb(`planckTime`,`5.391245e-44`,`s`),pb=hb(`planckCharge`,`1.87554603778e-18`,`C`),mb=hb(`planckTemperature`,`1.416785e+32`,`K`);function hb(e,t,n){return V(e,[`config`,`Unit`,`BigNumber`],e=>{var{config:r,Unit:i,BigNumber:a}=e,o=new i(r.number===`BigNumber`?new a(t):parseFloat(t),n);return o.fixPrefix=!0,o})}function gb(e,t){return V(e,[`config`,`BigNumber`],e=>{var{config:n,BigNumber:r}=e;return n.number===`BigNumber`?new r(t):t})}function _b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_b(Object(n),!0).forEach(function(t){Ju(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_b(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var yb=V(`mapSlices`,[`typed`,`isInteger`],e=>{var{typed:t,isInteger:n}=e,r=Ms({typed:t,isInteger:n});return t(`mapSlices`,{"...any":function(e){var t=e[1];D(t)?e[1]=t-1:O(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(e){throw Ym(e)}}})},vb({isTransformFunction:!0},Ms.meta)),bb=V(`column`,[`typed`,`Index`,`matrix`,`range`],e=>{var{typed:t,Index:n,matrix:r,range:i}=e,a=Bl({typed:t,Index:n,matrix:r,range:i});return t(`column`,{"...any":function(e){var t=e.length-1,n=e[t];D(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0});function xb(e,t,n){var r=e.filter(function(e){return Ae(e)&&!(e.name in t)&&!n.has(e.name)})[0];if(!r)throw Error(`No undefined variable found in inline expression "`+e+`"`);var i=r.name,a=new Map,o=new S(n,a,new Set([i])),s=e.compile();return function(e){return a.set(i,e),s.evaluate(o)}}var Sb=V(`transformCallback`,[`typed`],e=>{var{typed:t}=e;return function(e,r){return t.isTypedFunction(e)?n(e,r):Cb(e,e.length,r)};function n(e,r){var i=Object.fromEntries(Object.entries(e.signatures).map(e=>{var[i,a]=e,o=i.split(`,`).length;return t.isTypedFunction(a)?[i,n(a,r)]:[i,Cb(a,o,r)]}));return typeof e.name==`string`?t(e.name,i):t(i)}});function Cb(e,t,n){return t===n?e:t===n+1?function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var a=r.slice(0,n),o=wb(r[n]);return e(...a,o)}:t>n+1?function(){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];var a=r.slice(0,n),o=wb(r[n]),s=r.slice(n+1);return e(...a,o,...s)}:e}function wb(e){return e.map(e=>e+1)}var Tb=V(`filter`,[`typed`],e=>{var{typed:t}=e;function n(e,n,i){var a=ql({typed:t}),o=Sb({typed:t});if(e.length===0)return a();var s=e[0];if(e.length===1)return a(s);var c=e.length-1,l=e[c];return s&&=r(s,i),l&&=Ae(l)||xe(l)?r(l,i):xb(l,n,i),a(s,o(l,c))}n.rawArgs=!0;function r(e,t){return e.compile().evaluate(t)}return n},{isTransformFunction:!0}),Eb=V(`forEach`,[`typed`],e=>{var{typed:t}=e,n=Ql({typed:t}),r=Sb({typed:t});function i(e,t,i){if(e.length===0)return n();var o=e[0];if(e.length===1)return n(o);var s=e.length-1,c=e[s];return o&&=a(o,i),c&&=Ae(c)||xe(c)?a(c,i):xb(c,t,i),n(o,r(c,s))}i.rawArgs=!0;function a(e,t){return e.compile().evaluate(t)}return i},{isTransformFunction:!0}),Db=V(`index`,[`Index`,`getMatrixDataType`],e=>{var{Index:t,getMatrixDataType:n}=e;return function(){for(var e=[],r=0,i=arguments.length;r<i;r++){var a=arguments[r];if(re(a))a.start--,a.end-=a.step>0?0:2;else if(a&&a.isSet===!0)a=a.map(function(e){return e-1});else if(P(a)||F(a))n(a)!==`boolean`&&(a=a.map(function(e){return e-1}));else if(D(a)||k(a))a--;else if(O(a))a=a.toNumber()-1;else if(typeof a!=`string`)throw TypeError(`Dimension must be an Array, Matrix, number, bigint, string, or Range`);e[r]=a}var o=new t;return t.apply(o,e),o}},{isTransformFunction:!0}),Ob=V(`map`,[`typed`],e=>{var{typed:t}=e,n=su({typed:t}),r=Sb({typed:t});function i(e,t,i){if(e.length===0)return n();if(e.length===1)return n(e[0]);var a=e.length-1,o=e.slice(0,a),s=e[a];return o=o.map(e=>c(e,i)),s&&=Ae(s)||xe(s)?c(s,i):xb(s,t,i),n(...o,r(s,a));function c(e,t){return e.compile().evaluate(t)}}return i.rawArgs=!0,i},{isTransformFunction:!0});function kb(e){return D(e)?e-1:O(e)?e.minus(1):e}function Ab(e){return D(e)||O(e)}function jb(e){if(e.length===2&&ee(e[0])){e=e.slice();var t=e[1];Ab(t)&&(e[1]=kb(t))}return e}var Mb=V(`max`,[`typed`,`config`,`numeric`,`larger`,`isNaN`],e=>{var{typed:t,config:n,numeric:r,larger:i,isNaN:a}=e,o=Qf({typed:t,config:n,numeric:r,larger:i,isNaN:a});return t(`max`,{"...any":function(e){e=jb(e);try{return o.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Nb=V(`mean`,[`typed`,`add`,`divide`],e=>{var{typed:t,add:n,divide:r}=e,i=y_({typed:t,add:n,divide:r});return t(`mean`,{"...any":function(e){e=jb(e);try{return i.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Pb=V(`min`,[`typed`,`config`,`numeric`,`smaller`,`isNaN`],e=>{var{typed:t,config:n,numeric:r,smaller:i,isNaN:a}=e,o=ep({typed:t,config:n,numeric:r,smaller:i,isNaN:a});return t(`min`,{"...any":function(e){e=jb(e);try{return o.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Fb=V(`range`,[`typed`,`config`,`?matrix`,`?bignumber`,`equal`,`smaller`,`smallerEq`,`larger`,`largerEq`,`add`,`isZero`,`isPositive`],e=>{var{typed:t,config:n,matrix:r,bignumber:i,equal:a,smaller:o,smallerEq:s,larger:c,largerEq:l,add:u,isZero:d,isPositive:f}=e,p=hu({typed:t,config:n,matrix:r,bignumber:i,equal:a,smaller:o,smallerEq:s,larger:c,largerEq:l,add:u,isZero:d,isPositive:f});return t(`range`,{"...any":function(e){return typeof e[e.length-1]!=`boolean`&&e.push(!0),p.apply(null,e)}})},{isTransformFunction:!0}),Ib=V(`row`,[`typed`,`Index`,`matrix`,`range`],e=>{var{typed:t,Index:n,matrix:r,range:i}=e,a=wu({typed:t,Index:n,matrix:r,range:i});return t(`row`,{"...any":function(e){var t=e.length-1,n=e[t];D(n)&&(e[t]=n-1);try{return a.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Lb=V(`subset`,[`typed`,`matrix`,`zeros`,`add`],e=>{var{typed:t,matrix:n,zeros:r,add:i}=e,a=Au({typed:t,matrix:n,zeros:r,add:i});return t(`subset`,{"...any":function(e){try{return a.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Rb=V(`concat`,[`typed`,`matrix`,`isInteger`],e=>{var{typed:t,matrix:n,isInteger:r}=e,i=Rl({typed:t,matrix:n,isInteger:r});return t(`concat`,{"...any":function(e){var t=e.length-1,n=e[t];D(n)?e[t]=n-1:O(n)&&(e[t]=n.minus(1));try{return i.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),zb=`diff`,Bb=V(zb,[`typed`,`matrix`,`subtract`,`number`,`bignumber`],e=>{var{typed:t,matrix:n,subtract:r,number:i,bignumber:a}=e,o=lu({typed:t,matrix:n,subtract:r,number:i,bignumber:a});return t(zb,{"...any":function(e){e=jb(e);try{return o.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Vb=V(`std`,[`typed`,`map`,`sqrt`,`variance`],e=>{var{typed:t,map:n,sqrt:r,variance:i}=e,a=A_({typed:t,map:n,sqrt:r,variance:i});return t(`std`,{"...any":function(e){e=jb(e);try{return a.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Hb=`sum`,Ub=V(Hb,[`typed`,`config`,`add`,`numeric`],e=>{var{typed:t,config:n,add:r,numeric:i}=e,a=h_({typed:t,config:n,add:r,numeric:i});return t(Hb,{"...any":function(e){e=jb(e);try{return a.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Wb=V(`quantileSeq`,[`typed`,`bignumber`,`add`,`subtract`,`divide`,`multiply`,`partitionSelect`,`compare`,`isInteger`,`smaller`,`smallerEq`,`larger`,`mapSlices`],e=>{var{typed:t,bignumber:n,add:r,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:c,isInteger:l,smaller:u,smallerEq:d,larger:f,mapSlices:p}=e,m=O_({typed:t,bignumber:n,add:r,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:c,isInteger:l,smaller:u,smallerEq:d,larger:f,mapSlices:p});return t(`quantileSeq`,{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":(e,t,n)=>m(e,t,h(n)),"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":(e,t,n,r)=>m(e,t,n,h(r)),"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":(e,t,n)=>m(e,t,h(n)),"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":(e,t,n,r)=>m(e,t,n,h(r))});function h(e){return jb([[],e])[1]}},{isTransformFunction:!0}),Gb=`cumsum`,Kb=V(Gb,[`typed`,`add`,`unaryPlus`],e=>{var{typed:t,add:n,unaryPlus:r}=e,i=__({typed:t,add:n,unaryPlus:r});return t(Gb,{"...any":function(e){if(e.length===2&&ee(e[0])){var t=e[1];D(t)?e[1]=t-1:O(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),qb=`variance`,Jb=V(qb,[`typed`,`add`,`subtract`,`multiply`,`divide`,`mapSlices`,`isNaN`],e=>{var{typed:t,add:n,subtract:r,multiply:i,divide:a,mapSlices:o,isNaN:s}=e,c=E_({typed:t,add:n,subtract:r,multiply:i,divide:a,mapSlices:o,isNaN:s});return t(qb,{"...any":function(e){e=jb(e);try{return c.apply(null,e)}catch(e){throw Ym(e)}}})},{isTransformFunction:!0}),Yb=`print`,Xb=V(Yb,[`typed`,`matrix`,`zeros`,`add`],e=>{var{typed:t,matrix:n,zeros:r,add:i}=e,a=xd({typed:t,matrix:n,zeros:r,add:i});return t(Yb,{"string, Object | Array":function(e,t){return a(o(e),t)},"string, Object | Array, number | Object":function(e,t,n){return a(o(e),t,n)}});function o(e){return e.replace(yd,e=>`$`+e.slice(1).split(`.`).map(function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e}).join(`.`))}},{isTransformFunction:!0}),Zb=V(`and`,[`typed`,`matrix`,`zeros`,`add`,`equalScalar`,`not`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o}=e,s=mf({typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o});function c(e,t,n){var r=e[0].compile().evaluate(n);return!ee(r)&&!s(r,!0)?!1:s(r,e[1].compile().evaluate(n))}return c.rawArgs=!0,c},{isTransformFunction:!0}),Qb=V(`or`,[`typed`,`matrix`,`equalScalar`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a}=e,o=Pl({typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a});function s(e,t,n){var r=e[0].compile().evaluate(n);return!ee(r)&&o(r,!1)?!0:o(r,e[1].compile().evaluate(n))}return s.rawArgs=!0,s},{isTransformFunction:!0}),$b=V(`nullish`,[`typed`,`matrix`,`size`,`flatten`,`deepEqual`],e=>{var{typed:t,matrix:n,size:r,flatten:i,deepEqual:a}=e,o=Ml({typed:t,matrix:n,size:r,flatten:i,deepEqual:a});function s(e,t,n){var r=e[0].compile().evaluate(n);return!ee(r)&&r!=null&&r!==void 0?r:o(r,e[1].compile().evaluate(n))}return s.rawArgs=!0,s},{isTransformFunction:!0}),ex=V(`bitAnd`,[`typed`,`matrix`,`zeros`,`add`,`equalScalar`,`not`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o}=e,s=pl({typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o});function c(e,t,n){var r=e[0].compile().evaluate(n);if(!ee(r)){if(isNaN(r))return NaN;if(r===0||r===!1)return 0}return s(r,e[1].compile().evaluate(n))}return c.rawArgs=!0,c},{isTransformFunction:!0}),tx=V(`bitOr`,[`typed`,`matrix`,`equalScalar`,`DenseMatrix`,`concat`],e=>{var{typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a}=e,o=_l({typed:t,matrix:n,equalScalar:r,DenseMatrix:i,concat:a});function s(e,t,n){var r=e[0].compile().evaluate(n);if(!ee(r)){if(isNaN(r))return NaN;if(r===-1)return-1;if(r===!0)return 1}return o(r,e[1].compile().evaluate(n))}return s.rawArgs=!0,s},{isTransformFunction:!0}),nx=`num`,rx=V(nx,[`typed`,`fraction`],e=>{var{typed:t,fraction:n}=e;return t(nx,{Fraction:e=>e.s*e.n,BigNumber:e=>{var t=n(e);return t.s*t.n},"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),ix=`den`,ax=V(ix,[`typed`,`fraction`],e=>{var{typed:t,fraction:n}=e;return t(ix,{Fraction:e=>e.d,BigNumber:e=>n(e).d,"Array | Matrix":t.referToSelf(e=>t=>la(t,e))})}),ox=s({createAbs:()=>As,createAccessorNode:()=>Qm,createAcos:()=>Cp,createAcosh:()=>Tp,createAcot:()=>Dp,createAcoth:()=>kp,createAcsc:()=>jp,createAcsch:()=>Np,createAdd:()=>Lm,createAddScalar:()=>Is,createAnd:()=>mf,createAndTransform:()=>Zb,createArg:()=>Sl,createArrayNode:()=>eh,createAsec:()=>Fp,createAsech:()=>Lp,createAsin:()=>zp,createAsinh:()=>Bp,createAssignmentNode:()=>lh,createAtan:()=>Vp,createAtan2:()=>Up,createAtanh:()=>Gp,createAtomicMass:()=>Jy,createAvogadro:()=>Yy,createBellNumbers:()=>Sv,createBernoulli:()=>P_,createBigNumberClass:()=>br,createBigint:()=>ss,createBignumber:()=>fs,createBin:()=>md,createBitAnd:()=>pl,createBitAndTransform:()=>ex,createBitNot:()=>hl,createBitOr:()=>_l,createBitOrTransform:()=>tx,createBitXor:()=>bl,createBlockNode:()=>dh,createBohrMagneton:()=>Oy,createBohrRadius:()=>Py,createBoltzmann:()=>Xy,createBoolean:()=>ds,createCatalan:()=>wv,createCbrt:()=>Bs,createCeil:()=>Js,createChain:()=>Wg,createChainClass:()=>Dg,createClassicalElectronRadius:()=>Fy,createClone:()=>aa,createColumn:()=>Bl,createColumnTransform:()=>bb,createCombinations:()=>L_,createCombinationsWithRep:()=>B_,createCompare:()=>gf,createCompareNatural:()=>bf,createCompareText:()=>wf,createCompile:()=>Gh,createComplex:()=>ps,createComplexClass:()=>kr,createComposition:()=>Ev,createConcat:()=>Rl,createConcatTransform:()=>Rb,createConditionalNode:()=>ph,createConductanceQuantum:()=>ky,createConj:()=>wl,createConstantNode:()=>Ch,createCorr:()=>M_,createCos:()=>Jp,createCosh:()=>Xp,createCot:()=>Qp,createCoth:()=>em,createCoulomb:()=>Ty,createCoulombConstant:()=>Ey,createCount:()=>Hl,createCreateUnit:()=>xp,createCross:()=>Wl,createCsc:()=>nm,createCsch:()=>im,createCtranspose:()=>Ru,createCube:()=>Xs,createCumSum:()=>__,createCumSumTransform:()=>Kb,createDeepEqual:()=>Uf,createDen:()=>ax,createDenseMatrixClass:()=>ra,createDerivative:()=>Hv,createDet:()=>Kg,createDeuteronMass:()=>Vy,createDiag:()=>Kl,createDiff:()=>lu,createDiffTransform:()=>Bb,createDistance:()=>f_,createDivide:()=>u_,createDivideScalar:()=>jd,createDot:()=>Um,createDotDivide:()=>Jd,createDotMultiply:()=>rl,createDotPow:()=>Kd,createE:()=>ay,createEfimovFactor:()=>qy,createEigs:()=>$g,createElectricConstant:()=>Cy,createElectronMass:()=>Iy,createElementaryCharge:()=>Dy,createEqual:()=>Ef,createEqualScalar:()=>es,createEqualText:()=>kf,createErf:()=>Qu,createEvaluate:()=>qh,createExp:()=>Qs,createExpm:()=>t_,createExpm1:()=>ec,createFactorial:()=>q_,createFalse:()=>$v,createFaraday:()=>Zy,createFermiCoupling:()=>Ly,createFft:()=>Hu,createFibonacciHeapClass:()=>ip,createFilter:()=>ql,createFilterTransform:()=>Tb,createFineStructure:()=>Ry,createFirstRadiation:()=>Qy,createFix:()=>ic,createFlatten:()=>Xl,createFloor:()=>lc,createForEach:()=>Ql,createForEachTransform:()=>Eb,createFormat:()=>fd,createFraction:()=>ms,createFractionClass:()=>Xr,createFreqz:()=>Jv,createFunctionAssignmentNode:()=>Th,createFunctionNode:()=>Vh,createGamma:()=>U_,createGasConstant:()=>eb,createGcd:()=>Oc,createGetMatrixDataType:()=>tu,createGravitationConstant:()=>yy,createGravity:()=>lb,createHartreeEnergy:()=>zy,createHasNumericValue:()=>Ro,createHelp:()=>Hg,createHelpClass:()=>Eg,createHex:()=>vd,createHypot:()=>zm,createI:()=>py,createIdentity:()=>ru,createIfft:()=>Wu,createIm:()=>El,createImmutableDenseMatrixClass:()=>tp,createIndex:()=>Km,createIndexClass:()=>np,createIndexNode:()=>Dh,createIndexTransform:()=>Db,createInfinity:()=>ty,createIntersect:()=>p_,createInv:()=>Jg,createInverseConductanceQuantum:()=>Ay,createInvmod:()=>el,createIsBounded:()=>Ko,createIsFinite:()=>Jo,createIsInteger:()=>ma,createIsNaN:()=>Wo,createIsNegative:()=>Po,createIsNumeric:()=>Io,createIsPositive:()=>Bo,createIsPrime:()=>Od,createIsZero:()=>Ho,createKldivergence:()=>Y_,createKlitzing:()=>Ny,createKron:()=>au,createLN10:()=>cy,createLN2:()=>sy,createLOG10E:()=>uy,createLOG2E:()=>ly,createLarger:()=>Lf,createLargerEq:()=>Bf,createLcm:()=>jc,createLeafCount:()=>Ov,createLeftShift:()=>cf,createLgamma:()=>G_,createLog:()=>Bd,createLog10:()=>Ic,createLog1p:()=>Hd,createLog2:()=>Rc,createLoschmidt:()=>$y,createLsolve:()=>Zd,createLsolveAll:()=>tf,createLup:()=>$h,createLusolve:()=>Cg,createLyap:()=>l_,createMad:()=>C_,createMagneticConstant:()=>Sy,createMagneticFluxQuantum:()=>jy,createMap:()=>su,createMapSlices:()=>Ms,createMapSlicesTransform:()=>yb,createMapTransform:()=>Ob,createMatrix:()=>gs,createMatrixClass:()=>Qr,createMatrixFromColumns:()=>Ss,createMatrixFromFunction:()=>vs,createMatrixFromRows:()=>bs,createMax:()=>Qf,createMaxTransform:()=>Mb,createMean:()=>y_,createMeanTransform:()=>Nb,createMedian:()=>x_,createMin:()=>ep,createMinTransform:()=>Pb,createMod:()=>vc,createMode:()=>sd,createMolarMass:()=>sb,createMolarMassC12:()=>cb,createMolarPlanckConstant:()=>tb,createMolarVolume:()=>nb,createMultinomial:()=>Z_,createMultiply:()=>Vc,createMultiplyScalar:()=>zc,createNaN:()=>ny,createNeutronMass:()=>Hy,createNode:()=>Jm,createNorm:()=>Vm,createNot:()=>Al,createNthRoot:()=>Uc,createNthRoots:()=>Wd,createNuclearMagneton:()=>My,createNull:()=>ey,createNullish:()=>Ml,createNullishTransform:()=>$b,createNum:()=>rx,createNumber:()=>os,createNumeric:()=>kd,createObjectNode:()=>kh,createOct:()=>gd,createOnes:()=>uu,createOperatorNode:()=>Mh,createOr:()=>Pl,createOrTransform:()=>Qb,createParenthesisNode:()=>Ph,createParse:()=>Uh,createParser:()=>Zh,createParserClass:()=>Jh,createPartitionSelect:()=>Jf,createPermutations:()=>$_,createPhi:()=>oy,createPi:()=>ry,createPickRandom:()=>pv,createPinv:()=>Xg,createPlanckCharge:()=>pb,createPlanckConstant:()=>by,createPlanckLength:()=>ub,createPlanckMass:()=>db,createPlanckTemperature:()=>mb,createPlanckTime:()=>fb,createPolynomialRoot:()=>Tg,createPow:()=>Nd,createPrint:()=>xd,createPrintTransform:()=>Xb,createProd:()=>ud,createProtonMass:()=>By,createQr:()=>tg,createQuantileSeq:()=>O_,createQuantileSeqTransform:()=>Wb,createQuantumOfCirculation:()=>Uy,createRandom:()=>gv,createRandomInt:()=>vv,createRange:()=>hu,createRangeClass:()=>Zr,createRangeNode:()=>Ih,createRangeTransform:()=>Fb,createRationalize:()=>Wv,createRe:()=>Ol,createReducedPlanckConstant:()=>xy,createRelationalNode:()=>Rh,createReplacer:()=>Xv,createReshape:()=>_u,createResize:()=>vu,createResolve:()=>Rv,createResultSet:()=>Nt,createReviver:()=>Yv,createRightArithShift:()=>uf,createRightLogShift:()=>ff,createRotate:()=>bu,createRotationMatrix:()=>Su,createRound:()=>Id,createRow:()=>wu,createRowTransform:()=>Ib,createRydberg:()=>Wy,createSQRT1_2:()=>dy,createSQRT2:()=>fy,createSackurTetrode:()=>rb,createSchur:()=>s_,createSec:()=>om,createSech:()=>cm,createSecondRadiation:()=>ib,createSetCartesian:()=>_m,createSetDifference:()=>ym,createSetDistinct:()=>xm,createSetIntersect:()=>Cm,createSetIsSubset:()=>Tm,createSetMultiplicity:()=>Dm,createSetPowerset:()=>km,createSetSize:()=>jm,createSetSymDifference:()=>Nm,createSetUnion:()=>Fm,createSign:()=>Gc,createSimplify:()=>Pv,createSimplifyConstant:()=>Fv,createSimplifyCore:()=>Lv,createSin:()=>um,createSinh:()=>fm,createSize:()=>Eu,createSlu:()=>bg,createSmaller:()=>jf,createSmallerEq:()=>Pf,createSolveODE:()=>Zu,createSort:()=>Xf,createSpaClass:()=>ap,createSparse:()=>yp,createSparseMatrixClass:()=>ts,createSpeedOfLight:()=>vy,createSplitUnit:()=>ws,createSqrt:()=>Kc,createSqrtm:()=>r_,createSquare:()=>Jc,createSqueeze:()=>Ou,createStd:()=>A_,createStdTransform:()=>Vb,createStefanBoltzmann:()=>ab,createStirlingS2:()=>bv,createString:()=>ls,createSubset:()=>Au,createSubsetTransform:()=>Lb,createSubtract:()=>Xc,createSubtractScalar:()=>Rs,createSum:()=>h_,createSumTransform:()=>Ub,createSylvester:()=>a_,createSymbolNode:()=>zh,createSymbolicEqual:()=>Bv,createTan:()=>mm,createTanh:()=>hm,createTau:()=>iy,createThomsonCrossSection:()=>Gy,createTo:()=>wd,createToBest:()=>Ed,createTrace:()=>Wm,createTranspose:()=>Iu,createTrue:()=>Qv,createTypeOf:()=>Xo,createTyped:()=>Ot,createUnaryMinus:()=>Es,createUnaryPlus:()=>Os,createUnequal:()=>Gf,createUnitClass:()=>hp,createUnitFunction:()=>_p,createUppercaseE:()=>hy,createUppercasePi:()=>my,createUsolve:()=>$d,createUsolveAll:()=>rf,createVacuumImpedance:()=>wy,createVariance:()=>E_,createVarianceTransform:()=>Jb,createVersion:()=>gy,createWeakMixingAngle:()=>Ky,createWienDisplacement:()=>ob,createXgcd:()=>Qc,createXor:()=>Il,createZeros:()=>Bu,createZeta:()=>ad,createZpk2tf:()=>Kv}),J=br({config:B}),sx=kr({}),cx=ay({BigNumber:J,config:B}),lx=$v({}),ux=Ry({BigNumber:J,config:B}),dx=Xr({}),fx=py({Complex:sx}),px=ty({BigNumber:J,config:B}),mx=cy({BigNumber:J,config:B}),hx=uy({BigNumber:J,config:B}),gx=Qr({}),_x=ny({BigNumber:J,config:B}),vx=ey({}),yx=oy({BigNumber:J,config:B}),bx=Zr({}),xx=Nt({}),Sx=dy({BigNumber:J,config:B}),Cx=rb({BigNumber:J,config:B}),wx=iy({BigNumber:J,config:B}),Tx=Qv({}),Ex=gy({}),Dx=ra({Matrix:gx,config:B}),Ox=qy({BigNumber:J,config:B}),kx=sy({BigNumber:J,config:B}),Ax=ry({BigNumber:J,config:B}),jx=Xv({}),Mx=fy({BigNumber:J,config:B}),Y=Ot({BigNumber:J,Complex:sx,DenseMatrix:Dx,Fraction:dx}),Nx=Ky({BigNumber:J,config:B}),Px=As({typed:Y}),Fx=Cp({Complex:sx,config:B,typed:Y}),Ix=Dp({BigNumber:J,typed:Y}),Lx=jp({BigNumber:J,Complex:sx,config:B,typed:Y}),Rx=Is({typed:Y}),zx=Sl({typed:Y}),Bx=Lp({BigNumber:J,Complex:sx,config:B,typed:Y}),Vx=Bp({typed:Y}),Hx=Vp({typed:Y}),Ux=Gp({Complex:sx,config:B,typed:Y}),Wx=ss({typed:Y}),Gx=hl({typed:Y}),Kx=ds({typed:Y}),qx=aa({typed:Y}),Jx=L_({typed:Y}),Yx=ps({Complex:sx,typed:Y}),Xx=wl({typed:Y}),Zx=Jp({typed:Y}),Qx=Qp({BigNumber:J,typed:Y}),$x=nm({BigNumber:J,typed:Y}),eS=Xs({typed:Y}),tS=es({config:B,typed:Y}),nS=Qu({typed:Y}),rS=Qs({typed:Y}),iS=ec({Complex:sx,typed:Y}),aS=ql({typed:Y}),oS=Xl({typed:Y}),sS=Ql({typed:Y}),cS=fd({typed:Y}),lS=tu({typed:Y}),uS=vd({format:cS,typed:Y}),dS=El({typed:Y}),fS=Ko({typed:Y}),pS=Wo({typed:Y}),mS=Io({typed:Y}),hS=Od({typed:Y}),gS=ly({BigNumber:J,config:B}),_S=G_({Complex:sx,typed:Y}),vS=Ic({Complex:sx,config:B,typed:Y}),yS=Rc({Complex:sx,config:B,typed:Y}),bS=su({typed:Y}),xS=sd({isNaN:pS,isNumeric:mS,typed:Y}),SS=zc({typed:Y}),CS=Al({typed:Y}),wS=os({typed:Y}),TS=gd({format:cS,typed:Y}),ES=pv({config:B,typed:Y}),DS=xd({typed:Y}),OS=gv({config:B,typed:Y}),kS=Ol({typed:Y}),AS=om({BigNumber:J,typed:Y}),jS=Gc({BigNumber:J,Fraction:dx,complex:Yx,typed:Y}),MS=um({typed:Y}),NS=Eu({typed:Y}),PS=ts({Matrix:gx,equalScalar:tS,typed:Y}),FS=ws({typed:Y}),IS=Jc({typed:Y}),LS=ls({typed:Y}),RS=Rs({typed:Y}),zS=mm({typed:Y}),BS=Ed({typed:Y}),VS=Xo({typed:Y}),HS=Tp({Complex:sx,config:B,typed:Y}),US=Np({BigNumber:J,typed:Y}),WS=Fp({BigNumber:J,Complex:sx,config:B,typed:Y}),GS=fs({BigNumber:J,typed:Y}),KS=B_({typed:Y}),qS=Xp({typed:Y}),JS=im({BigNumber:J,typed:Y}),YS=Um({addScalar:Rx,conj:Xx,multiplyScalar:SS,size:NS,typed:Y}),XS=Ro({isNumeric:mS,typed:Y}),ZS=Jo({isBounded:fS,map:bS,typed:Y}),QS=Po({config:B,typed:Y}),$S=Ho({equalScalar:tS,typed:Y}),X=gs({DenseMatrix:Dx,Matrix:gx,SparseMatrix:PS,typed:Y}),eC=vs({isZero:$S,matrix:X,typed:Y}),tC=Vc({addScalar:Rx,dot:YS,equalScalar:tS,matrix:X,multiplyScalar:SS,typed:Y}),nC=uu({BigNumber:J,config:B,matrix:X,typed:Y}),rC=vv({config:B,log2:yS,typed:Y}),iC=vu({config:B,matrix:X}),aC=cm({BigNumber:J,typed:Y}),oC=fm({typed:Y}),sC=yp({SparseMatrix:PS,typed:Y}),cC=Kc({Complex:sx,config:B,typed:Y}),lC=Ou({typed:Y}),uC=hm({typed:Y}),dC=Iu({matrix:X,typed:Y}),fC=Qc({BigNumber:J,config:B,matrix:X,typed:Y}),pC=Bu({BigNumber:J,config:B,matrix:X,typed:Y}),mC=kp({BigNumber:J,Complex:sx,config:B,typed:Y}),hC=zp({Complex:sx,config:B,typed:Y}),gC=md({format:cS,typed:Y}),_C=em({BigNumber:J,typed:Y}),vC=Ru({conj:Xx,transpose:dC,typed:Y}),yC=Kl({DenseMatrix:Dx,SparseMatrix:PS,matrix:X,typed:Y}),bC=Ef({DenseMatrix:Dx,SparseMatrix:PS,equalScalar:tS,matrix:X,typed:Y}),xC=ms({Fraction:dx,typed:Y}),SC=ru({BigNumber:J,DenseMatrix:Dx,SparseMatrix:PS,config:B,matrix:X,typed:Y}),CC=ma({equal:bC,typed:Y}),wC=au({matrix:X,multiplyScalar:SS,typed:Y}),TC=Ms({isInteger:CC,typed:Y}),EC=TC,DC=Ss({flatten:oS,matrix:X,size:NS,typed:Y}),OC=rx({fraction:xC,typed:Y}),kC=_u({isInteger:CC,matrix:X,typed:Y}),AC=Id({BigNumber:J,DenseMatrix:Dx,config:B,equalScalar:tS,matrix:X,typed:Y,zeros:pC}),jC=Es({typed:Y}),MC=P_({BigNumber:J,Fraction:dx,config:B,isInteger:CC,number:wS,typed:Y}),NC=Bs({BigNumber:J,Complex:sx,Fraction:dx,config:B,isNegative:QS,matrix:X,typed:Y,unaryMinus:jC}),PC=Rl({isInteger:CC,matrix:X,typed:Y}),FC=Uf({equal:bC,typed:Y}),IC=rl({concat:PC,equalScalar:tS,matrix:X,multiplyScalar:SS,typed:Y}),LC=lc({DenseMatrix:Dx,config:B,equalScalar:tS,matrix:X,round:AC,typed:Y,zeros:pC}),RC=Oc({BigNumber:J,DenseMatrix:Dx,concat:PC,config:B,equalScalar:tS,matrix:X,round:AC,typed:Y,zeros:pC}),zC=Bo({config:B,typed:Y}),BC=Lf({DenseMatrix:Dx,SparseMatrix:PS,bignumber:GS,concat:PC,config:B,matrix:X,typed:Y}),VC=jc({concat:PC,equalScalar:tS,matrix:X,typed:Y}),HC=cf({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y,zeros:pC}),UC=vc({DenseMatrix:Dx,concat:PC,config:B,equalScalar:tS,matrix:X,round:AC,typed:Y,zeros:pC}),WC=Uc({BigNumber:J,concat:PC,equalScalar:tS,matrix:X,typed:Y}),GC=Ml({deepEqual:FC,flatten:oS,matrix:X,size:NS,typed:Y}),KC=kd({bignumber:GS,fraction:xC,number:wS}),qC=ud({config:B,multiplyScalar:SS,numeric:KC,typed:Y}),JC=uf({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y,zeros:pC}),YC=jf({DenseMatrix:Dx,SparseMatrix:PS,bignumber:GS,concat:PC,config:B,matrix:X,typed:Y}),XC=Xc({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,subtractScalar:RS,typed:Y,unaryMinus:jC}),ZC=wd({concat:PC,matrix:X,typed:Y}),QC=Os({config:B,numeric:KC,typed:Y}),$C=Il({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,matrix:X,typed:Y}),ew=Lm({DenseMatrix:Dx,SparseMatrix:PS,addScalar:Rx,concat:PC,equalScalar:tS,matrix:X,typed:Y}),tw=Up({BigNumber:J,DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y}),nw=pl({concat:PC,equalScalar:tS,matrix:X,typed:Y}),rw=_l({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y}),iw=bl({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,matrix:X,typed:Y}),aw=Js({DenseMatrix:Dx,config:B,equalScalar:tS,matrix:X,round:AC,typed:Y,zeros:pC}),ow=gf({BigNumber:J,DenseMatrix:Dx,Fraction:dx,concat:PC,config:B,equalScalar:tS,matrix:X,typed:Y}),sw=wf({concat:PC,matrix:X,typed:Y}),cw=Ev({addScalar:Rx,combinations:Jx,isInteger:CC,isNegative:QS,isPositive:zC,larger:BC,typed:Y}),lw=Hl({prod:qC,size:NS,typed:Y}),uw=Wl({matrix:X,multiply:tC,subtract:XC,typed:Y}),dw=lu({matrix:X,number:wS,subtract:XC,typed:Y}),fw=jd({numeric:KC,typed:Y}),pw=kf({compareText:sw,isZero:$S,typed:Y}),mw=ip({larger:BC,smaller:YC}),hw=ic({Complex:sx,DenseMatrix:Dx,ceil:aw,equalScalar:tS,floor:LC,matrix:X,typed:Y,zeros:pC}),gw=zm({abs:Px,addScalar:Rx,divideScalar:fw,isPositive:zC,multiplyScalar:SS,smaller:YC,sqrt:cC,typed:Y}),_w=tp({DenseMatrix:Dx,smaller:YC}),vw=np({ImmutableDenseMatrix:_w,getMatrixDataType:lS}),yw=p_({abs:Px,add:ew,addScalar:Rx,config:B,divideScalar:fw,equalScalar:tS,flatten:oS,isNumeric:mS,isZero:$S,matrix:X,multiply:tC,multiplyScalar:SS,smaller:YC,subtract:XC,typed:Y}),bw=el({BigNumber:J,add:ew,config:B,equal:bC,isInteger:CC,mod:UC,smaller:YC,typed:Y,xgcd:fC}),xw=Bf({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,config:B,matrix:X,typed:Y}),Sw=Bd({Complex:sx,config:B,divideScalar:fw,typeOf:VS,typed:Y}),Cw=Zd({DenseMatrix:Dx,divideScalar:fw,equalScalar:tS,matrix:X,multiplyScalar:SS,subtractScalar:RS,typed:Y}),ww=bs({flatten:oS,matrix:X,size:NS,typed:Y}),Tw=ep({config:B,isNaN:pS,numeric:KC,smaller:YC,typed:Y}),Ew=Wd({Complex:sx,config:B,divideScalar:fw,typed:Y}),Dw=Jf({compare:ow,isNaN:pS,isNumeric:mS,typed:Y}),Ow=tg({addScalar:Rx,complex:Yx,conj:Xx,divideScalar:fw,equal:bC,identity:SC,isZero:$S,matrix:X,multiplyScalar:SS,sign:jS,sqrt:cC,subtractScalar:RS,typed:Y,unaryMinus:jC,zeros:pC}),kw=ff({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y,zeros:pC}),Aw=bg({SparseMatrix:PS,abs:Px,add:ew,divideScalar:fw,larger:BC,largerEq:xw,multiply:tC,subtract:XC,transpose:dC,typed:Y}),jw=ap({FibonacciHeap:mw,addScalar:Rx,equalScalar:tS}),Mw=Au({add:ew,matrix:X,typed:Y,zeros:pC}),Nw=h_({add:ew,config:B,numeric:KC,typed:Y}),Pw=Wm({add:ew,matrix:X,typed:Y}),Fw=$d({DenseMatrix:Dx,divideScalar:fw,equalScalar:tS,matrix:X,multiplyScalar:SS,subtractScalar:RS,typed:Y}),Iw=Kv({Complex:sx,add:ew,multiply:tC,number:wS,typed:Y}),Lw=wv({addScalar:Rx,combinations:Jx,divideScalar:fw,isInteger:CC,isNegative:QS,multiplyScalar:SS,typed:Y}),Rw=bf({compare:ow,typed:Y}),zw=__({add:ew,typed:Y,unaryPlus:QC}),Bw=Kg({divideScalar:fw,isZero:$S,matrix:X,multiply:tC,subtractScalar:RS,typed:Y,unaryMinus:jC}),Vw=Jd({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,divideScalar:fw,equalScalar:tS,matrix:X,typed:Y}),Hw=Km({Index:vw,typed:Y}),Uw=Jg({abs:Px,addScalar:Rx,det:Bw,divideScalar:fw,identity:SC,matrix:X,multiply:tC,typed:Y,unaryMinus:jC}),Ww=Hd({Complex:sx,config:B,divideScalar:fw,log:Sw,typed:Y}),Gw=tf({DenseMatrix:Dx,divideScalar:fw,equalScalar:tS,matrix:X,multiplyScalar:SS,subtractScalar:RS,typed:Y}),Kw=Qf({config:B,isNaN:pS,larger:BC,numeric:KC,typed:Y}),qw=Pl({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y}),Jw=Xg({Complex:sx,add:ew,ctranspose:vC,deepEqual:FC,divideScalar:fw,dot:YS,dotDivide:Vw,equal:bC,inv:Uw,matrix:X,multiply:tC,typed:Y}),Yw=Nd({Complex:sx,config:B,fraction:xC,identity:SC,inv:Uw,matrix:X,multiply:tC,number:wS,typed:Y}),Xw=_m({DenseMatrix:Dx,Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),Zw=xm({DenseMatrix:Dx,Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),Qw=Tm({Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),$w=km({Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),eT=Pf({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,config:B,matrix:X,typed:Y}),tT=Xf({compare:ow,compareNatural:Rw,matrix:X,typed:Y}),nT=r_({abs:Px,add:ew,identity:SC,inv:Uw,map:bS,max:Kw,multiply:tC,size:NS,sqrt:cC,subtract:XC,typed:Y}),rT=Gf({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,config:B,equalScalar:tS,matrix:X,typed:Y}),iT=rf({DenseMatrix:Dx,divideScalar:fw,equalScalar:tS,matrix:X,multiplyScalar:SS,subtractScalar:RS,typed:Y}),aT=mf({concat:PC,equalScalar:tS,matrix:X,not:CS,typed:Y,zeros:pC}),oT=ax({fraction:xC,typed:Y}),sT=f_({abs:Px,addScalar:Rx,deepEqual:FC,divideScalar:fw,multiplyScalar:SS,sqrt:cC,subtractScalar:RS,typed:Y}),cT=Kd({DenseMatrix:Dx,SparseMatrix:PS,concat:PC,equalScalar:tS,matrix:X,pow:Yw,typed:Y}),lT=t_({abs:Px,add:ew,identity:SC,inv:Uw,multiply:tC,typed:Y}),uT=Hu({addScalar:Rx,ceil:aw,conj:Xx,divideScalar:fw,dotDivide:Vw,exp:rS,i:fx,log2:yS,matrix:X,multiplyScalar:SS,pow:Yw,tau:wx,typed:Y}),dT=U_({BigNumber:J,Complex:sx,config:B,multiplyScalar:SS,pow:Yw,typed:Y}),fT=Wu({conj:Xx,dotDivide:Vw,fft:uT,typed:Y}),pT=$h({DenseMatrix:Dx,Spa:jw,SparseMatrix:PS,abs:Px,addScalar:Rx,divideScalar:fw,equalScalar:tS,larger:BC,matrix:X,multiplyScalar:SS,subtractScalar:RS,typed:Y,unaryMinus:jC}),mT=hu({bignumber:GS,matrix:X,add:ew,config:B,equal:bC,isPositive:zC,isZero:$S,larger:BC,largerEq:xw,smaller:YC,smallerEq:eT,typed:Y}),hT=wu({Index:vw,matrix:X,range:mT,typed:Y}),gT=ym({DenseMatrix:Dx,Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),_T=Dm({Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),vT=Nm({Index:vw,concat:PC,setDifference:gT,size:NS,subset:Mw,typed:Y}),yT=hp({BigNumber:J,Complex:sx,Fraction:dx,abs:Px,addScalar:Rx,config:B,divideScalar:fw,equal:bC,fix:hw,format:cS,isNumeric:mS,multiplyScalar:SS,number:wS,pow:Yw,round:AC,subtractScalar:RS}),bT=wy({BigNumber:J,Unit:yT,config:B}),xT=ob({BigNumber:J,Unit:yT,config:B}),ST=Jy({BigNumber:J,Unit:yT,config:B}),CT=Oy({BigNumber:J,Unit:yT,config:B}),wT=Xy({BigNumber:J,Unit:yT,config:B}),TT=Bl({Index:vw,matrix:X,range:mT,typed:Y}),ET=ky({BigNumber:J,Unit:yT,config:B}),DT=Ty({BigNumber:J,Unit:yT,config:B}),OT=xp({Unit:yT,typed:Y}),kT=Vy({BigNumber:J,Unit:yT,config:B}),AT=$g({abs:Px,add:ew,addScalar:Rx,atan:Hx,bignumber:GS,column:TT,complex:Yx,config:B,cos:Zx,diag:yC,divideScalar:fw,dot:YS,equal:bC,flatten:oS,im:dS,inv:Uw,larger:BC,matrix:X,matrixFromColumns:DC,multiply:tC,multiplyScalar:SS,number:wS,qr:Ow,re:kS,reshape:kC,sin:MS,size:NS,smaller:YC,sqrt:cC,subtract:XC,typed:Y,usolve:Fw,usolveAll:iT}),jT=Iy({BigNumber:J,Unit:yT,config:B}),MT=q_({gamma:dT,typed:Y}),NT=Ly({BigNumber:J,Unit:yT,config:B}),PT=eb({BigNumber:J,Unit:yT,config:B}),FT=lb({BigNumber:J,Unit:yT,config:B}),IT=Ny({BigNumber:J,Unit:yT,config:B}),LT=$y({BigNumber:J,Unit:yT,config:B}),RT=Sy({BigNumber:J,Unit:yT,config:B}),zT=sb({BigNumber:J,Unit:yT,config:B}),BT=tb({BigNumber:J,Unit:yT,config:B}),VT=Hy({BigNumber:J,Unit:yT,config:B}),HT=My({BigNumber:J,Unit:yT,config:B}),UT=$_({factorial:MT,typed:Y}),WT=by({BigNumber:J,Unit:yT,config:B}),GT=db({BigNumber:J,Unit:yT,config:B}),KT=fb({BigNumber:J,Unit:yT,config:B}),qT=By({BigNumber:J,Unit:yT,config:B}),JT=Uy({BigNumber:J,Unit:yT,config:B}),YT=xy({BigNumber:J,Unit:yT,config:B}),XT=ib({BigNumber:J,Unit:yT,config:B}),ZT=jm({compareNatural:Rw,typed:Y}),QT=vy({BigNumber:J,Unit:yT,config:B}),$T=ab({BigNumber:J,Unit:yT,config:B}),eE=Gy({BigNumber:J,Unit:yT,config:B}),tE=Yy({BigNumber:J,Unit:yT,config:B}),nE=Py({BigNumber:J,Unit:yT,config:B}),rE=Ey({BigNumber:J,Unit:yT,config:B}),iE=u_({divideScalar:fw,equalScalar:tS,inv:Uw,matrix:X,multiply:tC,typed:Y}),aE=Dy({BigNumber:J,Unit:yT,config:B}),oE=Zy({BigNumber:J,Unit:yT,config:B}),sE=Jv({Complex:sx,add:ew,divide:iE,matrix:X,multiply:tC,typed:Y}),cE=yy({BigNumber:J,Unit:yT,config:B}),lE=Ay({BigNumber:J,Unit:yT,config:B}),uE=Cg({DenseMatrix:Dx,lsolve:Cw,lup:pT,matrix:X,slu:Aw,typed:Y,usolve:Fw}),dE=jy({BigNumber:J,Unit:yT,config:B}),fE=cb({BigNumber:J,Unit:yT,config:B}),pE=Z_({add:ew,divide:iE,factorial:MT,isInteger:CC,isPositive:zC,multiply:tC,typed:Y}),mE=pb({BigNumber:J,Unit:yT,config:B}),hE=mb({BigNumber:J,Unit:yT,config:B}),gE=O_({bignumber:GS,add:ew,compare:ow,divide:iE,isInteger:CC,larger:BC,mapSlices:TC,multiply:tC,partitionSelect:Dw,smaller:YC,smallerEq:eT,subtract:XC,typed:Y}),_E=Wy({BigNumber:J,Unit:yT,config:B}),vE=Cm({DenseMatrix:Dx,Index:vw,compareNatural:Rw,size:NS,subset:Mw,typed:Y}),yE=Zu({abs:Px,add:ew,bignumber:GS,divide:iE,isNegative:QS,isPositive:zC,larger:BC,map:bS,matrix:X,max:Kw,multiply:tC,smaller:YC,subtract:XC,typed:Y,unaryMinus:jC}),bE=bv({bignumber:GS,addScalar:Rx,combinations:Jx,divideScalar:fw,factorial:MT,isInteger:CC,isNegative:QS,larger:BC,multiplyScalar:SS,number:wS,pow:Yw,subtractScalar:RS,typed:Y}),xE=_p({Unit:yT,typed:Y}),SE=Sv({addScalar:Rx,isInteger:CC,isNegative:QS,stirlingS2:bE,typed:Y}),CE=Cy({BigNumber:J,Unit:yT,config:B}),wE=Qy({BigNumber:J,Unit:yT,config:B}),TE=zy({BigNumber:J,Unit:yT,config:B}),EE=Y_({divide:iE,dotDivide:Vw,isNumeric:mS,log:Sw,map:bS,matrix:X,multiply:tC,sum:Nw,typed:Y}),DE=y_({add:ew,divide:iE,typed:Y}),OE=nb({BigNumber:J,Unit:yT,config:B}),kE=ub({BigNumber:J,Unit:yT,config:B}),AE=Fm({Index:vw,concat:PC,setIntersect:vE,setSymDifference:vT,size:NS,subset:Mw,typed:Y}),jE=E_({add:ew,divide:iE,isNaN:pS,mapSlices:TC,multiply:tC,subtract:XC,typed:Y}),ME=Fy({BigNumber:J,Unit:yT,config:B}),NE=M_({add:ew,divide:iE,matrix:X,mean:DE,multiply:tC,pow:Yw,sqrt:cC,subtract:XC,sum:Nw,typed:Y}),PE=x_({add:ew,compare:ow,divide:iE,partitionSelect:Dw,typed:Y}),FE=Tg({add:ew,cbrt:NC,divide:iE,equalScalar:tS,im:dS,isZero:$S,multiply:tC,re:kS,sqrt:cC,subtract:XC,typeOf:VS,typed:Y,unaryMinus:jC}),IE=A_({map:bS,sqrt:cC,typed:Y,variance:jE}),LE=ad({BigNumber:J,Complex:sx,add:ew,config:B,divide:iE,equal:bC,factorial:MT,gamma:dT,isBounded:fS,isNegative:QS,multiply:tC,pi:Ax,pow:Yw,sin:MS,smallerEq:eT,subtract:XC,typed:Y}),RE=C_({abs:Px,map:bS,median:PE,subtract:XC,typed:Y}),zE=Vm({abs:Px,add:ew,conj:Xx,ctranspose:vC,eigs:AT,equalScalar:tS,larger:BC,matrix:X,multiply:tC,pow:Yw,smaller:YC,sqrt:cC,typed:Y}),BE=Su({BigNumber:J,DenseMatrix:Dx,SparseMatrix:PS,addScalar:Rx,config:B,cos:Zx,matrix:X,multiplyScalar:SS,norm:zE,sin:MS,typed:Y,unaryMinus:jC}),VE=bu({multiply:tC,rotationMatrix:BE,typed:Y}),HE=s_({identity:SC,matrix:X,multiply:tC,norm:zE,qr:Ow,subtract:XC,typed:Y}),UE=a_({abs:Px,add:ew,concat:PC,identity:SC,index:Hw,lusolve:uE,matrix:X,matrixFromColumns:DC,multiply:tC,range:mT,schur:HE,subset:Mw,subtract:XC,transpose:dC,typed:Y}),WE=l_({matrix:X,multiply:tC,sylvester:UE,transpose:dC,typed:Y}),GE={},KE={},qE={},JE=Jm({mathWithTransform:KE}),YE=kh({Node:JE}),XE=Mh({Node:JE}),ZE=Ph({Node:JE}),QE=Rh({Node:JE}),$E=eh({Node:JE}),eD=dh({Node:JE,ResultSet:xx}),tD=ph({Node:JE}),nD=Ih({Node:JE}),rD=Yv({classes:qE}),iD=Dg({math:GE,typed:Y}),aD=Th({Node:JE,typed:Y}),oD=Wg({Chain:iD,typed:Y}),sD=Ch({Node:JE,isBounded:fS}),cD=Dh({Node:JE,size:NS}),lD=Qm({Node:JE,subset:Mw}),uD=lh({matrix:X,Node:JE,subset:Mw}),dD=zh({Unit:yT,Node:JE,math:GE}),fD=Vh({Node:JE,SymbolNode:dD,math:GE}),pD=Uh({AccessorNode:lD,ArrayNode:$E,AssignmentNode:uD,BlockNode:eD,ConditionalNode:tD,ConstantNode:sD,FunctionAssignmentNode:aD,FunctionNode:fD,IndexNode:cD,ObjectNode:YE,OperatorNode:XE,ParenthesisNode:ZE,RangeNode:nD,RelationalNode:QE,SymbolNode:dD,config:B,numeric:KC,typed:Y}),mD=Rv({ConstantNode:sD,FunctionNode:fD,OperatorNode:XE,ParenthesisNode:ZE,parse:pD,typed:Y}),hD=Fv({bignumber:GS,fraction:xC,AccessorNode:lD,ArrayNode:$E,ConstantNode:sD,FunctionNode:fD,IndexNode:cD,ObjectNode:YE,OperatorNode:XE,SymbolNode:dD,config:B,isBounded:fS,mathWithTransform:KE,matrix:X,typed:Y}),gD=Gh({parse:pD,typed:Y}),_D=qh({parse:pD,typed:Y}),vD=Eg({evaluate:_D}),yD=Jh({evaluate:_D,parse:pD}),bD=Lv({AccessorNode:lD,ArrayNode:$E,ConstantNode:sD,FunctionNode:fD,IndexNode:cD,ObjectNode:YE,OperatorNode:XE,ParenthesisNode:ZE,SymbolNode:dD,add:ew,divide:iE,equal:bC,isZero:$S,multiply:tC,parse:pD,pow:Yw,subtract:XC,typed:Y}),xD=Hg({Help:vD,mathWithTransform:KE,typed:Y}),SD=Pv({AccessorNode:lD,ArrayNode:$E,ConstantNode:sD,FunctionNode:fD,IndexNode:cD,ObjectNode:YE,OperatorNode:XE,ParenthesisNode:ZE,SymbolNode:dD,equal:bC,parse:pD,replacer:jx,resolve:mD,simplifyConstant:hD,simplifyCore:bD,typed:Y}),CD=Bv({OperatorNode:XE,parse:pD,simplify:SD,typed:Y}),wD=Hv({ConstantNode:sD,FunctionNode:fD,OperatorNode:XE,ParenthesisNode:ZE,SymbolNode:dD,config:B,equal:bC,isZero:$S,numeric:KC,parse:pD,simplify:SD,typed:Y}),TD=Zh({Parser:yD,typed:Y}),ED=Ov({parse:pD,typed:Y}),DD=Wv({bignumber:GS,fraction:xC,AccessorNode:lD,ArrayNode:$E,ConstantNode:sD,FunctionNode:fD,IndexNode:cD,ObjectNode:YE,OperatorNode:XE,ParenthesisNode:ZE,SymbolNode:dD,add:ew,config:B,divide:iE,equal:bC,isZero:$S,mathWithTransform:KE,matrix:X,multiply:tC,parse:pD,pow:Yw,simplify:SD,simplifyConstant:hD,simplifyCore:bD,subtract:XC,typed:Y});u(GE,{e:cx,false:lx,fineStructure:ux,i:fx,Infinity:px,LN10:mx,LOG10E:hx,NaN:_x,null:vx,phi:yx,SQRT1_2:Sx,sackurTetrode:Cx,tau:wx,true:Tx,E:cx,version:Ex,efimovFactor:Ox,LN2:kx,pi:Ax,replacer:jx,reviver:rD,SQRT2:Mx,typed:Y,PI:Ax,weakMixingAngle:Nx,abs:Px,acos:Fx,acot:Ix,acsc:Lx,addScalar:Rx,arg:zx,asech:Bx,asinh:Vx,atan:Hx,atanh:Ux,bigint:Wx,bitNot:Gx,boolean:Kx,clone:qx,combinations:Jx,complex:Yx,conj:Xx,cos:Zx,cot:Qx,csc:$x,cube:eS,equalScalar:tS,erf:nS,exp:rS,expm1:iS,filter:aS,flatten:oS,forEach:sS,format:cS,getMatrixDataType:lS,hex:uS,im:dS,isBounded:fS,isNaN:pS,isNumeric:mS,isPrime:hS,LOG2E:gS,lgamma:_S,log10:vS,log2:yS,map:bS,mode:xS,multiplyScalar:SS,not:CS,number:wS,oct:TS,pickRandom:ES,print:DS,random:OS,re:kS,sec:AS,sign:jS,sin:MS,size:NS,splitUnit:FS,square:IS,string:LS,subtractScalar:RS,tan:zS,toBest:BS,typeOf:VS,acosh:HS,acsch:US,asec:WS,bignumber:GS,chain:oD,combinationsWithRep:KS,cosh:qS,csch:JS,dot:YS,hasNumericValue:XS,isFinite:ZS,isNegative:QS,isZero:$S,matrix:X,matrixFromFunction:eC,multiply:tC,ones:nC,randomInt:rC,resize:iC,sech:aC,sinh:oC,sparse:sC,sqrt:cC,squeeze:lC,tanh:uC,transpose:dC,xgcd:fC,zeros:pC,acoth:mC,asin:hC,bin:gC,coth:_C,ctranspose:vC,diag:yC,equal:bC,fraction:xC,identity:SC,isInteger:CC,kron:wC,mapSlices:TC,matrixFromColumns:DC,num:OC,reshape:kC,round:AC,unaryMinus:jC,bernoulli:MC,cbrt:NC,concat:PC,deepEqual:FC,dotMultiply:IC,floor:LC,gcd:RC,isPositive:zC,larger:BC,lcm:VC,leftShift:HC,mod:UC,nthRoot:WC,nullish:GC,numeric:KC,prod:qC,rightArithShift:JC,smaller:YC,subtract:XC,to:ZC,unaryPlus:QC,xor:$C,add:ew,atan2:tw,bitAnd:nw,bitOr:rw,bitXor:iw,ceil:aw,compare:ow,compareText:sw,composition:cw,count:lw,cross:uw,diff:dw,divideScalar:fw,equalText:pw,fix:hw,hypot:gw,intersect:yw,invmod:bw,largerEq:xw,log:Sw,lsolve:Cw,matrixFromRows:ww,min:Tw,nthRoots:Ew,partitionSelect:Dw,qr:Ow,rightLogShift:kw,slu:Aw,subset:Mw,sum:Nw,trace:Pw,usolve:Fw,zpk2tf:Iw,catalan:Lw,compareNatural:Rw,cumsum:zw,det:Bw,dotDivide:Vw,index:Hw,inv:Uw,log1p:Ww,lsolveAll:Gw,max:Kw,or:qw,pinv:Jw,pow:Yw,setCartesian:Xw,setDistinct:Zw,setIsSubset:Qw,setPowerset:$w,smallerEq:eT,sort:tT,sqrtm:nT,unequal:rT,usolveAll:iT,and:aT,den:oT,distance:sT,dotPow:cT,expm:lT,fft:uT,gamma:dT,ifft:fT,lup:pT,range:mT,row:hT,setDifference:gT,setMultiplicity:_T,setSymDifference:vT,vacuumImpedance:bT,wienDisplacement:xT,atomicMass:ST,bohrMagneton:CT,boltzmann:wT,column:TT,conductanceQuantum:ET,coulomb:DT,createUnit:OT,deuteronMass:kT,eigs:AT,electronMass:jT,factorial:MT,fermiCoupling:NT,gasConstant:PT,gravity:FT,klitzing:IT,loschmidt:LT,magneticConstant:RT,molarMass:zT,molarPlanckConstant:BT,neutronMass:VT,nuclearMagneton:HT,permutations:UT,planckConstant:WT,planckMass:GT,planckTime:KT,protonMass:qT,quantumOfCirculation:JT,reducedPlanckConstant:YT,secondRadiation:XT,setSize:ZT,speedOfLight:QT,stefanBoltzmann:$T,thomsonCrossSection:eE,avogadro:tE,bohrRadius:nE,coulombConstant:rE,divide:iE,elementaryCharge:aE,faraday:oE,freqz:sE,gravitationConstant:cE,inverseConductanceQuantum:lE,lusolve:uE,magneticFluxQuantum:dE,molarMassC12:fE,multinomial:pE,planckCharge:mE,planckTemperature:hE,quantileSeq:gE,rydberg:_E,setIntersect:vE,solveODE:yE,stirlingS2:bE,unit:xE,bellNumbers:SE,electricConstant:CE,firstRadiation:wE,hartreeEnergy:TE,kldivergence:EE,mean:DE,molarVolume:OE,planckLength:kE,setUnion:AE,variance:jE,classicalElectronRadius:ME,corr:NE,median:PE,parse:pD,polynomialRoot:FE,resolve:mD,simplifyConstant:hD,std:IE,zeta:LE,compile:gD,evaluate:_D,mad:RE,simplifyCore:bD,help:xD,norm:zE,rotationMatrix:BE,simplify:SD,symbolicEqual:CD,derivative:wD,parser:TD,rotate:VE,leafCount:ED,rationalize:DD,schur:HE,sylvester:UE,lyap:WE,config:B}),u(KE,GE,{map:Ob({typed:Y}),filter:Tb({typed:Y}),forEach:Eb({typed:Y}),mapSlices:yb({isInteger:CC,typed:Y}),or:Qb({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y}),and:Zb({add:ew,concat:PC,equalScalar:tS,matrix:X,not:CS,typed:Y,zeros:pC}),cumsum:Kb({add:ew,typed:Y,unaryPlus:QC}),max:Mb({config:B,isNaN:pS,larger:BC,numeric:KC,typed:Y}),nullish:$b({deepEqual:FC,flatten:oS,matrix:X,size:NS,typed:Y}),print:Xb({add:ew,matrix:X,typed:Y,zeros:pC}),bitAnd:ex({add:ew,concat:PC,equalScalar:tS,matrix:X,not:CS,typed:Y,zeros:pC}),concat:Rb({isInteger:CC,matrix:X,typed:Y}),diff:Bb({bignumber:GS,matrix:X,number:wS,subtract:XC,typed:Y}),min:Pb({config:B,isNaN:pS,numeric:KC,smaller:YC,typed:Y}),subset:Lb({add:ew,matrix:X,typed:Y,zeros:pC}),bitOr:tx({DenseMatrix:Dx,concat:PC,equalScalar:tS,matrix:X,typed:Y}),sum:Ub({add:ew,config:B,numeric:KC,typed:Y}),index:Db({Index:vw,getMatrixDataType:lS}),row:Ib({Index:vw,matrix:X,range:mT,typed:Y}),column:bb({Index:vw,matrix:X,range:mT,typed:Y}),mean:Nb({add:ew,divide:iE,typed:Y}),range:Fb({bignumber:GS,matrix:X,add:ew,config:B,equal:bC,isPositive:zC,isZero:$S,larger:BC,largerEq:xw,smaller:YC,smallerEq:eT,typed:Y}),variance:Jb({add:ew,divide:iE,isNaN:pS,mapSlices:TC,multiply:tC,subtract:XC,typed:Y}),quantileSeq:Wb({add:ew,bignumber:GS,compare:ow,divide:iE,isInteger:CC,larger:BC,mapSlices:TC,multiply:tC,partitionSelect:Dw,smaller:YC,smallerEq:eT,subtract:XC,typed:Y}),std:Vb({map:bS,sqrt:cC,typed:Y,variance:jE})}),u(qE,{BigNumber:J,Complex:sx,Fraction:dx,Matrix:gx,Node:JE,ObjectNode:YE,OperatorNode:XE,ParenthesisNode:ZE,Range:bx,RelationalNode:QE,ResultSet:xx,ArrayNode:$E,BlockNode:eD,ConditionalNode:tD,DenseMatrix:Dx,RangeNode:nD,Chain:iD,FunctionAssignmentNode:aD,SparseMatrix:PS,ConstantNode:sD,IndexNode:cD,FibonacciHeap:mw,ImmutableDenseMatrix:_w,Index:vw,Spa:jw,AccessorNode:lD,AssignmentNode:uD,Unit:yT,SymbolNode:dD,FunctionNode:fD,Help:vD,Parser:yD}),iD.createProxy(GE);var Z={createBigNumberClass:br},OD={createComplexClass:kr},kD={createMatrixClass:Qr},AD={MatrixDependencies:kD,createDenseMatrixClass:ra},jD={createFractionClass:Xr},Q={BigNumberDependencies:Z,ComplexDependencies:OD,DenseMatrixDependencies:AD,FractionDependencies:jD,createTyped:Ot},MD={typedDependencies:Q,createAbs:As},ND={createNode:Jm},PD={typedDependencies:Q,createEqualScalar:es},FD={MatrixDependencies:kD,equalScalarDependencies:PD,typedDependencies:Q,createSparseMatrixClass:ts},ID={typedDependencies:Q,createAddScalar:Is},$={DenseMatrixDependencies:AD,MatrixDependencies:kD,SparseMatrixDependencies:FD,typedDependencies:Q,createMatrix:gs},LD={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createEqual:Ef},RD={equalDependencies:LD,typedDependencies:Q,createIsInteger:ma},zD={isIntegerDependencies:RD,matrixDependencies:$,typedDependencies:Q,createConcat:Rl},BD={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,addScalarDependencies:ID,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createAdd:Lm},VD={BigNumberDependencies:Z,matrixDependencies:$,typedDependencies:Q,createZeros:Bu},HD={addDependencies:BD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createSubset:Au},UD={NodeDependencies:ND,subsetDependencies:HD,createAccessorNode:Qm},WD={ComplexDependencies:OD,typedDependencies:Q,createAcos:Cp},GD={ComplexDependencies:OD,typedDependencies:Q,createAcosh:Tp},KD={BigNumberDependencies:Z,typedDependencies:Q,createAcot:Dp},qD={BigNumberDependencies:Z,ComplexDependencies:OD,typedDependencies:Q,createAcoth:kp},JD={BigNumberDependencies:Z,ComplexDependencies:OD,typedDependencies:Q,createAcsc:jp},YD={BigNumberDependencies:Z,typedDependencies:Q,createAcsch:Np},XD={typedDependencies:Q,createNot:Al},ZD={concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,notDependencies:XD,typedDependencies:Q,zerosDependencies:VD,createAnd:mf},QD={addDependencies:BD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,notDependencies:XD,typedDependencies:Q,zerosDependencies:VD,createAndTransform:Zb},$D={typedDependencies:Q,createArg:Sl},eO={NodeDependencies:ND,createArrayNode:eh},tO={BigNumberDependencies:Z,ComplexDependencies:OD,typedDependencies:Q,createAsec:Fp},nO={BigNumberDependencies:Z,ComplexDependencies:OD,typedDependencies:Q,createAsech:Lp},rO={ComplexDependencies:OD,typedDependencies:Q,createAsin:zp},iO={typedDependencies:Q,createAsinh:Bp},aO={matrixDependencies:$,NodeDependencies:ND,subsetDependencies:HD,createAssignmentNode:lh},oO={typedDependencies:Q,createAtan:Vp},sO={BigNumberDependencies:Z,DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createAtan2:Up},cO={ComplexDependencies:OD,typedDependencies:Q,createAtanh:Gp},lO={BigNumberDependencies:Z,typedDependencies:Q,createBignumber:fs},uO={FractionDependencies:jD,typedDependencies:Q,createFraction:ms},dO={typedDependencies:Q,createNumber:os},fO={bignumberDependencies:lO,fractionDependencies:uO,numberDependencies:dO,createNumeric:kd},pO={numericDependencies:fO,typedDependencies:Q,createDivideScalar:jd},mO={BigNumberDependencies:Z,DenseMatrixDependencies:AD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createRound:Id},hO={DenseMatrixDependencies:AD,equalScalarDependencies:PD,matrixDependencies:$,roundDependencies:mO,typedDependencies:Q,zerosDependencies:VD,createCeil:Js},gO={DenseMatrixDependencies:AD,equalScalarDependencies:PD,matrixDependencies:$,roundDependencies:mO,typedDependencies:Q,zerosDependencies:VD,createFloor:lc},_O={ComplexDependencies:OD,DenseMatrixDependencies:AD,ceilDependencies:hO,equalScalarDependencies:PD,floorDependencies:gO,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createFix:ic},vO={typedDependencies:Q,createFormat:fd},yO={typedDependencies:Q,createIsNumeric:Io},bO={typedDependencies:Q,createMultiplyScalar:zc},xO={BigNumberDependencies:Z,DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,matrixDependencies:$,typedDependencies:Q,createIdentity:ru},SO={equalScalarDependencies:PD,typedDependencies:Q,createIsZero:Ho},CO={typedDependencies:Q,createConj:wl},wO={typedDependencies:Q,createSize:Eu},TO={addScalarDependencies:ID,conjDependencies:CO,multiplyScalarDependencies:bO,sizeDependencies:wO,typedDependencies:Q,createDot:Um},EO={addScalarDependencies:ID,dotDependencies:TO,equalScalarDependencies:PD,matrixDependencies:$,multiplyScalarDependencies:bO,typedDependencies:Q,createMultiply:Vc},DO={typedDependencies:Q,createSubtractScalar:Rs},OO={typedDependencies:Q,createUnaryMinus:Es},kO={divideScalarDependencies:pO,isZeroDependencies:SO,matrixDependencies:$,multiplyDependencies:EO,subtractScalarDependencies:DO,typedDependencies:Q,unaryMinusDependencies:OO,createDet:Kg},AO={absDependencies:MD,addScalarDependencies:ID,detDependencies:kO,divideScalarDependencies:pO,identityDependencies:xO,matrixDependencies:$,multiplyDependencies:EO,typedDependencies:Q,unaryMinusDependencies:OO,createInv:Jg},jO={ComplexDependencies:OD,fractionDependencies:uO,identityDependencies:xO,invDependencies:AO,matrixDependencies:$,multiplyDependencies:EO,numberDependencies:dO,typedDependencies:Q,createPow:Nd},MO={BigNumberDependencies:Z,ComplexDependencies:OD,FractionDependencies:jD,absDependencies:MD,addScalarDependencies:ID,divideScalarDependencies:pO,equalDependencies:LD,fixDependencies:_O,formatDependencies:vO,isNumericDependencies:yO,multiplyScalarDependencies:bO,numberDependencies:dO,powDependencies:jO,roundDependencies:mO,subtractScalarDependencies:DO,createUnitClass:hp},NO={BigNumberDependencies:Z,UnitDependencies:MO,createAtomicMass:Jy},PO={BigNumberDependencies:Z,UnitDependencies:MO,createAvogadro:Yy},FO={typedDependencies:Q,createIsNegative:Po},IO={typedDependencies:Q,createCombinations:L_},LO={BigNumberDependencies:Z,ComplexDependencies:OD,multiplyScalarDependencies:bO,powDependencies:jO,typedDependencies:Q,createGamma:U_},RO={gammaDependencies:LO,typedDependencies:Q,createFactorial:q_},zO={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,bignumberDependencies:lO,concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createLarger:Lf},BO={bignumberDependencies:lO,addScalarDependencies:ID,combinationsDependencies:IO,divideScalarDependencies:pO,factorialDependencies:RO,isIntegerDependencies:RD,isNegativeDependencies:FO,largerDependencies:zO,multiplyScalarDependencies:bO,numberDependencies:dO,powDependencies:jO,subtractScalarDependencies:DO,typedDependencies:Q,createStirlingS2:bv},VO={addScalarDependencies:ID,isIntegerDependencies:RD,isNegativeDependencies:FO,stirlingS2Dependencies:BO,typedDependencies:Q,createBellNumbers:Sv},HO={BigNumberDependencies:Z,FractionDependencies:jD,isIntegerDependencies:RD,numberDependencies:dO,typedDependencies:Q,createBernoulli:P_},UO={typedDependencies:Q,createBigint:ss},WO={formatDependencies:vO,typedDependencies:Q,createBin:md},GO={concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createBitAnd:pl},KO={addDependencies:BD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,notDependencies:XD,typedDependencies:Q,zerosDependencies:VD,createBitAndTransform:ex},qO={typedDependencies:Q,createBitNot:hl},JO={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createBitOr:_l},YO={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createBitOrTransform:tx},XO={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createBitXor:bl},ZO={createResultSet:Nt},QO={NodeDependencies:ND,ResultSetDependencies:ZO,createBlockNode:dh},$O={BigNumberDependencies:Z,UnitDependencies:MO,createBohrMagneton:Oy},ek={BigNumberDependencies:Z,UnitDependencies:MO,createBohrRadius:Py},tk={BigNumberDependencies:Z,UnitDependencies:MO,createBoltzmann:Xy},nk={typedDependencies:Q,createBoolean:ds},rk={addScalarDependencies:ID,combinationsDependencies:IO,divideScalarDependencies:pO,isIntegerDependencies:RD,isNegativeDependencies:FO,multiplyScalarDependencies:bO,typedDependencies:Q,createCatalan:wv},ik={BigNumberDependencies:Z,ComplexDependencies:OD,FractionDependencies:jD,isNegativeDependencies:FO,matrixDependencies:$,typedDependencies:Q,unaryMinusDependencies:OO,createCbrt:Bs},ak={typedDependencies:Q,createChainClass:Dg},ok={ChainDependencies:ak,typedDependencies:Q,createChain:Wg},sk={BigNumberDependencies:Z,UnitDependencies:MO,createClassicalElectronRadius:Fy},ck={typedDependencies:Q,createClone:aa},lk={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,bignumberDependencies:lO,concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createSmaller:jf},uk={DenseMatrixDependencies:AD,smallerDependencies:lk,createImmutableDenseMatrixClass:tp},dk={typedDependencies:Q,createGetMatrixDataType:tu},fk={ImmutableDenseMatrixDependencies:uk,getMatrixDataTypeDependencies:dk,createIndexClass:np},pk={typedDependencies:Q,createIsPositive:Bo},mk={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createLargerEq:Bf},hk={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createSmallerEq:Pf},gk={bignumberDependencies:lO,matrixDependencies:$,addDependencies:BD,equalDependencies:LD,isPositiveDependencies:pk,isZeroDependencies:SO,largerDependencies:zO,largerEqDependencies:mk,smallerDependencies:lk,smallerEqDependencies:hk,typedDependencies:Q,createRange:hu},_k={IndexDependencies:fk,matrixDependencies:$,rangeDependencies:gk,typedDependencies:Q,createColumn:Bl},vk={IndexDependencies:fk,matrixDependencies:$,rangeDependencies:gk,typedDependencies:Q,createColumnTransform:bb},yk={typedDependencies:Q,createCombinationsWithRep:B_},bk={BigNumberDependencies:Z,DenseMatrixDependencies:AD,FractionDependencies:jD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createCompare:gf},xk={compareDependencies:bk,typedDependencies:Q,createCompareNatural:bf},Sk={concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createCompareText:wf},Ck={NodeDependencies:ND,createConditionalNode:ph},wk={typedDependencies:Q,createIsBounded:Ko},Tk={NodeDependencies:ND,isBoundedDependencies:wk,createConstantNode:Ch},Ek={NodeDependencies:ND,typedDependencies:Q,createFunctionAssignmentNode:Th},Dk={UnitDependencies:MO,NodeDependencies:ND,createSymbolNode:zh},Ok={NodeDependencies:ND,SymbolNodeDependencies:Dk,createFunctionNode:Vh},kk={NodeDependencies:ND,sizeDependencies:wO,createIndexNode:Dh},Ak={NodeDependencies:ND,createObjectNode:kh},jk={NodeDependencies:ND,createOperatorNode:Mh},Mk={NodeDependencies:ND,createParenthesisNode:Ph},Nk={NodeDependencies:ND,createRangeNode:Ih},Pk={NodeDependencies:ND,createRelationalNode:Rh},Fk={AccessorNodeDependencies:UD,ArrayNodeDependencies:eO,AssignmentNodeDependencies:aO,BlockNodeDependencies:QO,ConditionalNodeDependencies:Ck,ConstantNodeDependencies:Tk,FunctionAssignmentNodeDependencies:Ek,FunctionNodeDependencies:Ok,IndexNodeDependencies:kk,ObjectNodeDependencies:Ak,OperatorNodeDependencies:jk,ParenthesisNodeDependencies:Mk,RangeNodeDependencies:Nk,RelationalNodeDependencies:Pk,SymbolNodeDependencies:Dk,numericDependencies:fO,typedDependencies:Q,createParse:Uh},Ik={parseDependencies:Fk,typedDependencies:Q,createCompile:Gh},Lk={ComplexDependencies:OD,typedDependencies:Q,createComplex:ps},Rk={addScalarDependencies:ID,combinationsDependencies:IO,isIntegerDependencies:RD,isNegativeDependencies:FO,isPositiveDependencies:pk,largerDependencies:zO,typedDependencies:Q,createComposition:Ev},zk={isIntegerDependencies:RD,matrixDependencies:$,typedDependencies:Q,createConcatTransform:Rb},Bk={BigNumberDependencies:Z,UnitDependencies:MO,createConductanceQuantum:ky},Vk={divideScalarDependencies:pO,equalScalarDependencies:PD,invDependencies:AO,matrixDependencies:$,multiplyDependencies:EO,typedDependencies:Q,createDivide:u_},Hk={addDependencies:BD,divideDependencies:Vk,typedDependencies:Q,createMean:y_},Uk={ComplexDependencies:OD,typedDependencies:Q,createSqrt:Kc},Wk={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,subtractScalarDependencies:DO,typedDependencies:Q,unaryMinusDependencies:OO,createSubtract:Xc},Gk={addDependencies:BD,numericDependencies:fO,typedDependencies:Q,createSum:h_},Kk={addDependencies:BD,divideDependencies:Vk,matrixDependencies:$,meanDependencies:Hk,multiplyDependencies:EO,powDependencies:jO,sqrtDependencies:Uk,subtractDependencies:Wk,sumDependencies:Gk,typedDependencies:Q,createCorr:M_},qk={typedDependencies:Q,createCos:Jp},Jk={typedDependencies:Q,createCosh:Xp},Yk={BigNumberDependencies:Z,typedDependencies:Q,createCot:Qp},Xk={BigNumberDependencies:Z,typedDependencies:Q,createCoth:em},Zk={BigNumberDependencies:Z,UnitDependencies:MO,createCoulomb:Ty},Qk={BigNumberDependencies:Z,UnitDependencies:MO,createCoulombConstant:Ey},$k={multiplyScalarDependencies:bO,numericDependencies:fO,typedDependencies:Q,createProd:ud},eA={prodDependencies:$k,sizeDependencies:wO,typedDependencies:Q,createCount:Hl},tA={UnitDependencies:MO,typedDependencies:Q,createCreateUnit:xp},nA={matrixDependencies:$,multiplyDependencies:EO,subtractDependencies:Wk,typedDependencies:Q,createCross:Wl},rA={BigNumberDependencies:Z,typedDependencies:Q,createCsc:nm},iA={BigNumberDependencies:Z,typedDependencies:Q,createCsch:im},aA={matrixDependencies:$,typedDependencies:Q,createTranspose:Iu},oA={conjDependencies:CO,transposeDependencies:aA,typedDependencies:Q,createCtranspose:Ru},sA={typedDependencies:Q,createCube:Xs},cA={numericDependencies:fO,typedDependencies:Q,createUnaryPlus:Os},lA={addDependencies:BD,typedDependencies:Q,unaryPlusDependencies:cA,createCumSum:__},uA={addDependencies:BD,typedDependencies:Q,unaryPlusDependencies:cA,createCumSumTransform:Kb},dA={equalDependencies:LD,typedDependencies:Q,createDeepEqual:Uf},fA={fractionDependencies:uO,typedDependencies:Q,createDen:ax},pA={createReplacer:Xv},mA={ConstantNodeDependencies:Tk,FunctionNodeDependencies:Ok,OperatorNodeDependencies:jk,ParenthesisNodeDependencies:Mk,parseDependencies:Fk,typedDependencies:Q,createResolve:Rv},hA={bignumberDependencies:lO,fractionDependencies:uO,AccessorNodeDependencies:UD,ArrayNodeDependencies:eO,ConstantNodeDependencies:Tk,FunctionNodeDependencies:Ok,IndexNodeDependencies:kk,ObjectNodeDependencies:Ak,OperatorNodeDependencies:jk,SymbolNodeDependencies:Dk,isBoundedDependencies:wk,matrixDependencies:$,typedDependencies:Q,createSimplifyConstant:Fv},gA={AccessorNodeDependencies:UD,ArrayNodeDependencies:eO,ConstantNodeDependencies:Tk,FunctionNodeDependencies:Ok,IndexNodeDependencies:kk,ObjectNodeDependencies:Ak,OperatorNodeDependencies:jk,ParenthesisNodeDependencies:Mk,SymbolNodeDependencies:Dk,addDependencies:BD,divideDependencies:Vk,equalDependencies:LD,isZeroDependencies:SO,multiplyDependencies:EO,parseDependencies:Fk,powDependencies:jO,subtractDependencies:Wk,typedDependencies:Q,createSimplifyCore:Lv},_A={AccessorNodeDependencies:UD,ArrayNodeDependencies:eO,ConstantNodeDependencies:Tk,FunctionNodeDependencies:Ok,IndexNodeDependencies:kk,ObjectNodeDependencies:Ak,OperatorNodeDependencies:jk,ParenthesisNodeDependencies:Mk,SymbolNodeDependencies:Dk,equalDependencies:LD,parseDependencies:Fk,replacerDependencies:pA,resolveDependencies:mA,simplifyConstantDependencies:hA,simplifyCoreDependencies:gA,typedDependencies:Q,createSimplify:Pv},vA={ConstantNodeDependencies:Tk,FunctionNodeDependencies:Ok,OperatorNodeDependencies:jk,ParenthesisNodeDependencies:Mk,SymbolNodeDependencies:Dk,equalDependencies:LD,isZeroDependencies:SO,numericDependencies:fO,parseDependencies:Fk,simplifyDependencies:_A,typedDependencies:Q,createDerivative:Hv},yA={BigNumberDependencies:Z,UnitDependencies:MO,createDeuteronMass:Vy},bA={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,matrixDependencies:$,typedDependencies:Q,createDiag:Kl},xA={matrixDependencies:$,numberDependencies:dO,subtractDependencies:Wk,typedDependencies:Q,createDiff:lu},SA={bignumberDependencies:lO,matrixDependencies:$,numberDependencies:dO,subtractDependencies:Wk,typedDependencies:Q,createDiffTransform:Bb},CA={absDependencies:MD,addScalarDependencies:ID,deepEqualDependencies:dA,divideScalarDependencies:pO,multiplyScalarDependencies:bO,sqrtDependencies:Uk,subtractScalarDependencies:DO,typedDependencies:Q,createDistance:f_},wA={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,divideScalarDependencies:pO,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createDotDivide:Jd},TA={concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,multiplyScalarDependencies:bO,typedDependencies:Q,createDotMultiply:rl},EA={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,powDependencies:jO,typedDependencies:Q,createDotPow:Kd},DA={BigNumberDependencies:Z,createE:ay},OA={BigNumberDependencies:Z,createEfimovFactor:qy},kA={typedDependencies:Q,createFlatten:Xl},AA={typedDependencies:Q,createIm:El},jA={flattenDependencies:kA,matrixDependencies:$,sizeDependencies:wO,typedDependencies:Q,createMatrixFromColumns:Ss},MA={BigNumberDependencies:Z,FractionDependencies:jD,complexDependencies:Lk,typedDependencies:Q,createSign:Gc},NA={addScalarDependencies:ID,complexDependencies:Lk,conjDependencies:CO,divideScalarDependencies:pO,equalDependencies:LD,identityDependencies:xO,isZeroDependencies:SO,matrixDependencies:$,multiplyScalarDependencies:bO,signDependencies:MA,sqrtDependencies:Uk,subtractScalarDependencies:DO,typedDependencies:Q,unaryMinusDependencies:OO,zerosDependencies:VD,createQr:tg},PA={typedDependencies:Q,createRe:Ol},FA={isIntegerDependencies:RD,matrixDependencies:$,typedDependencies:Q,createReshape:_u},IA={typedDependencies:Q,createSin:um},LA={DenseMatrixDependencies:AD,divideScalarDependencies:pO,equalScalarDependencies:PD,matrixDependencies:$,multiplyScalarDependencies:bO,subtractScalarDependencies:DO,typedDependencies:Q,createUsolve:$d},RA={DenseMatrixDependencies:AD,divideScalarDependencies:pO,equalScalarDependencies:PD,matrixDependencies:$,multiplyScalarDependencies:bO,subtractScalarDependencies:DO,typedDependencies:Q,createUsolveAll:rf},zA={absDependencies:MD,addDependencies:BD,addScalarDependencies:ID,atanDependencies:oO,bignumberDependencies:lO,columnDependencies:_k,complexDependencies:Lk,cosDependencies:qk,diagDependencies:bA,divideScalarDependencies:pO,dotDependencies:TO,equalDependencies:LD,flattenDependencies:kA,imDependencies:AA,invDependencies:AO,largerDependencies:zO,matrixDependencies:$,matrixFromColumnsDependencies:jA,multiplyDependencies:EO,multiplyScalarDependencies:bO,numberDependencies:dO,qrDependencies:NA,reDependencies:PA,reshapeDependencies:FA,sinDependencies:IA,sizeDependencies:wO,smallerDependencies:lk,sqrtDependencies:Uk,subtractDependencies:Wk,typedDependencies:Q,usolveDependencies:LA,usolveAllDependencies:RA,createEigs:$g},BA={BigNumberDependencies:Z,UnitDependencies:MO,createElectricConstant:Cy},VA={BigNumberDependencies:Z,UnitDependencies:MO,createElectronMass:Iy},HA={BigNumberDependencies:Z,UnitDependencies:MO,createElementaryCharge:Dy},UA={compareTextDependencies:Sk,isZeroDependencies:SO,typedDependencies:Q,createEqualText:kf},WA={typedDependencies:Q,createErf:Qu},GA={parseDependencies:Fk,typedDependencies:Q,createEvaluate:qh},KA={typedDependencies:Q,createExp:Qs},qA={absDependencies:MD,addDependencies:BD,identityDependencies:xO,invDependencies:AO,multiplyDependencies:EO,typedDependencies:Q,createExpm:t_},JA={ComplexDependencies:OD,typedDependencies:Q,createExpm1:ec},YA={createFalse:$v},XA={BigNumberDependencies:Z,UnitDependencies:MO,createFaraday:Zy},ZA={BigNumberDependencies:Z,UnitDependencies:MO,createFermiCoupling:Ly},QA={ComplexDependencies:OD,createI:py},$A={ComplexDependencies:OD,typedDependencies:Q,createLog2:Rc},ej={BigNumberDependencies:Z,createTau:iy},tj={addScalarDependencies:ID,ceilDependencies:hO,conjDependencies:CO,divideScalarDependencies:pO,dotDivideDependencies:wA,expDependencies:KA,iDependencies:QA,log2Dependencies:$A,matrixDependencies:$,multiplyScalarDependencies:bO,powDependencies:jO,tauDependencies:ej,typedDependencies:Q,createFft:Hu},nj={largerDependencies:zO,smallerDependencies:lk,createFibonacciHeapClass:ip},rj={typedDependencies:Q,createFilter:ql},ij={typedDependencies:Q,createFilterTransform:Tb},aj={BigNumberDependencies:Z,createFineStructure:Ry},oj={BigNumberDependencies:Z,UnitDependencies:MO,createFirstRadiation:Qy},sj={typedDependencies:Q,createForEach:Ql},cj={typedDependencies:Q,createForEachTransform:Eb},lj={ComplexDependencies:OD,addDependencies:BD,divideDependencies:Vk,matrixDependencies:$,multiplyDependencies:EO,typedDependencies:Q,createFreqz:Jv},uj={BigNumberDependencies:Z,UnitDependencies:MO,createGasConstant:eb},dj={BigNumberDependencies:Z,DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,roundDependencies:mO,typedDependencies:Q,zerosDependencies:VD,createGcd:Oc},fj={BigNumberDependencies:Z,UnitDependencies:MO,createGravitationConstant:yy},pj={BigNumberDependencies:Z,UnitDependencies:MO,createGravity:lb},mj={BigNumberDependencies:Z,UnitDependencies:MO,createHartreeEnergy:zy},hj={isNumericDependencies:yO,typedDependencies:Q,createHasNumericValue:Ro},gj={evaluateDependencies:GA,createHelpClass:Eg},_j={HelpDependencies:gj,typedDependencies:Q,createHelp:Hg},vj={formatDependencies:vO,typedDependencies:Q,createHex:vd},yj={absDependencies:MD,addScalarDependencies:ID,divideScalarDependencies:pO,isPositiveDependencies:pk,multiplyScalarDependencies:bO,smallerDependencies:lk,sqrtDependencies:Uk,typedDependencies:Q,createHypot:zm},bj={conjDependencies:CO,dotDivideDependencies:wA,fftDependencies:tj,typedDependencies:Q,createIfft:Wu},xj={IndexDependencies:fk,typedDependencies:Q,createIndex:Km},Sj={IndexDependencies:fk,getMatrixDataTypeDependencies:dk,createIndexTransform:Db},Cj={BigNumberDependencies:Z,createInfinity:ty},wj={absDependencies:MD,addDependencies:BD,addScalarDependencies:ID,divideScalarDependencies:pO,equalScalarDependencies:PD,flattenDependencies:kA,isNumericDependencies:yO,isZeroDependencies:SO,matrixDependencies:$,multiplyDependencies:EO,multiplyScalarDependencies:bO,smallerDependencies:lk,subtractDependencies:Wk,typedDependencies:Q,createIntersect:p_},Tj={BigNumberDependencies:Z,UnitDependencies:MO,createInverseConductanceQuantum:Ay},Ej={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,roundDependencies:mO,typedDependencies:Q,zerosDependencies:VD,createMod:vc},Dj={BigNumberDependencies:Z,matrixDependencies:$,typedDependencies:Q,createXgcd:Qc},Oj={BigNumberDependencies:Z,addDependencies:BD,equalDependencies:LD,isIntegerDependencies:RD,modDependencies:Ej,smallerDependencies:lk,typedDependencies:Q,xgcdDependencies:Dj,createInvmod:el},kj={typedDependencies:Q,createMap:su},Aj={isBoundedDependencies:wk,mapDependencies:kj,typedDependencies:Q,createIsFinite:Jo},jj={typedDependencies:Q,createIsNaN:Wo},Mj={typedDependencies:Q,createIsPrime:Od},Nj={typedDependencies:Q,createTypeOf:Xo},Pj={ComplexDependencies:OD,divideScalarDependencies:pO,typeOfDependencies:Nj,typedDependencies:Q,createLog:Bd},Fj={divideDependencies:Vk,dotDivideDependencies:wA,isNumericDependencies:yO,logDependencies:Pj,mapDependencies:kj,matrixDependencies:$,multiplyDependencies:EO,sumDependencies:Gk,typedDependencies:Q,createKldivergence:Y_},Ij={BigNumberDependencies:Z,UnitDependencies:MO,createKlitzing:Ny},Lj={matrixDependencies:$,multiplyScalarDependencies:bO,typedDependencies:Q,createKron:au},Rj={BigNumberDependencies:Z,createLN10:cy},zj={BigNumberDependencies:Z,createLN2:sy},Bj={BigNumberDependencies:Z,createLOG10E:uy},Vj={BigNumberDependencies:Z,createLOG2E:ly},Hj={concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createLcm:jc},Uj={parseDependencies:Fk,typedDependencies:Q,createLeafCount:Ov},Wj={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createLeftShift:cf},Gj={ComplexDependencies:OD,typedDependencies:Q,createLgamma:G_},Kj={ComplexDependencies:OD,typedDependencies:Q,createLog10:Ic},qj={ComplexDependencies:OD,divideScalarDependencies:pO,logDependencies:Pj,typedDependencies:Q,createLog1p:Hd},Jj={BigNumberDependencies:Z,UnitDependencies:MO,createLoschmidt:$y},Yj={DenseMatrixDependencies:AD,divideScalarDependencies:pO,equalScalarDependencies:PD,matrixDependencies:$,multiplyScalarDependencies:bO,subtractScalarDependencies:DO,typedDependencies:Q,createLsolve:Zd},Xj={DenseMatrixDependencies:AD,divideScalarDependencies:pO,equalScalarDependencies:PD,matrixDependencies:$,multiplyScalarDependencies:bO,subtractScalarDependencies:DO,typedDependencies:Q,createLsolveAll:tf},Zj={FibonacciHeapDependencies:nj,addScalarDependencies:ID,equalScalarDependencies:PD,createSpaClass:ap},Qj={DenseMatrixDependencies:AD,SpaDependencies:Zj,SparseMatrixDependencies:FD,absDependencies:MD,addScalarDependencies:ID,divideScalarDependencies:pO,equalScalarDependencies:PD,largerDependencies:zO,matrixDependencies:$,multiplyScalarDependencies:bO,subtractScalarDependencies:DO,typedDependencies:Q,unaryMinusDependencies:OO,createLup:$h},$j={SparseMatrixDependencies:FD,absDependencies:MD,addDependencies:BD,divideScalarDependencies:pO,largerDependencies:zO,largerEqDependencies:mk,multiplyDependencies:EO,subtractDependencies:Wk,transposeDependencies:aA,typedDependencies:Q,createSlu:bg},eM={DenseMatrixDependencies:AD,lsolveDependencies:Yj,lupDependencies:Qj,matrixDependencies:$,sluDependencies:$j,typedDependencies:Q,usolveDependencies:LA,createLusolve:Cg},tM={absDependencies:MD,addDependencies:BD,conjDependencies:CO,ctransposeDependencies:oA,eigsDependencies:zA,equalScalarDependencies:PD,largerDependencies:zO,matrixDependencies:$,multiplyDependencies:EO,powDependencies:jO,smallerDependencies:lk,sqrtDependencies:Uk,typedDependencies:Q,createNorm:Vm},nM={identityDependencies:xO,matrixDependencies:$,multiplyDependencies:EO,normDependencies:tM,qrDependencies:NA,subtractDependencies:Wk,typedDependencies:Q,createSchur:s_},rM={absDependencies:MD,addDependencies:BD,concatDependencies:zD,identityDependencies:xO,indexDependencies:xj,lusolveDependencies:eM,matrixDependencies:$,matrixFromColumnsDependencies:jA,multiplyDependencies:EO,rangeDependencies:gk,schurDependencies:nM,subsetDependencies:HD,subtractDependencies:Wk,transposeDependencies:aA,typedDependencies:Q,createSylvester:a_},iM={matrixDependencies:$,multiplyDependencies:EO,sylvesterDependencies:rM,transposeDependencies:aA,typedDependencies:Q,createLyap:l_},aM={compareDependencies:bk,isNaNDependencies:jj,isNumericDependencies:yO,typedDependencies:Q,createPartitionSelect:Jf},oM={addDependencies:BD,compareDependencies:bk,divideDependencies:Vk,partitionSelectDependencies:aM,typedDependencies:Q,createMedian:x_},sM={absDependencies:MD,mapDependencies:kj,medianDependencies:oM,subtractDependencies:Wk,typedDependencies:Q,createMad:C_},cM={BigNumberDependencies:Z,UnitDependencies:MO,createMagneticConstant:Sy},lM={BigNumberDependencies:Z,UnitDependencies:MO,createMagneticFluxQuantum:jy},uM={isIntegerDependencies:RD,typedDependencies:Q,createMapSlices:Ms},dM={isIntegerDependencies:RD,typedDependencies:Q,createMapSlicesTransform:yb},fM={typedDependencies:Q,createMapTransform:Ob},pM={isZeroDependencies:SO,matrixDependencies:$,typedDependencies:Q,createMatrixFromFunction:vs},mM={flattenDependencies:kA,matrixDependencies:$,sizeDependencies:wO,typedDependencies:Q,createMatrixFromRows:bs},hM={isNaNDependencies:jj,largerDependencies:zO,numericDependencies:fO,typedDependencies:Q,createMax:Qf},gM={isNaNDependencies:jj,largerDependencies:zO,numericDependencies:fO,typedDependencies:Q,createMaxTransform:Mb},_M={addDependencies:BD,divideDependencies:Vk,typedDependencies:Q,createMeanTransform:Nb},vM={isNaNDependencies:jj,numericDependencies:fO,smallerDependencies:lk,typedDependencies:Q,createMin:ep},yM={isNaNDependencies:jj,numericDependencies:fO,smallerDependencies:lk,typedDependencies:Q,createMinTransform:Pb},bM={isNaNDependencies:jj,isNumericDependencies:yO,typedDependencies:Q,createMode:sd},xM={BigNumberDependencies:Z,UnitDependencies:MO,createMolarMass:sb},SM={BigNumberDependencies:Z,UnitDependencies:MO,createMolarMassC12:cb},CM={BigNumberDependencies:Z,UnitDependencies:MO,createMolarPlanckConstant:tb},wM={BigNumberDependencies:Z,UnitDependencies:MO,createMolarVolume:nb},TM={addDependencies:BD,divideDependencies:Vk,factorialDependencies:RO,isIntegerDependencies:RD,isPositiveDependencies:pk,multiplyDependencies:EO,typedDependencies:Q,createMultinomial:Z_},EM={BigNumberDependencies:Z,createNaN:ny},DM={BigNumberDependencies:Z,UnitDependencies:MO,createNeutronMass:Hy},OM={BigNumberDependencies:Z,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createNthRoot:Uc},kM={ComplexDependencies:OD,divideScalarDependencies:pO,typedDependencies:Q,createNthRoots:Wd},AM={BigNumberDependencies:Z,UnitDependencies:MO,createNuclearMagneton:My},jM={createNull:ey},MM={deepEqualDependencies:dA,flattenDependencies:kA,matrixDependencies:$,sizeDependencies:wO,typedDependencies:Q,createNullish:Ml},NM={deepEqualDependencies:dA,flattenDependencies:kA,matrixDependencies:$,sizeDependencies:wO,typedDependencies:Q,createNullishTransform:$b},PM={fractionDependencies:uO,typedDependencies:Q,createNum:rx},FM={formatDependencies:vO,typedDependencies:Q,createOct:gd},IM={BigNumberDependencies:Z,matrixDependencies:$,typedDependencies:Q,createOnes:uu},LM={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createOr:Pl},RM={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createOrTransform:Qb},zM={evaluateDependencies:GA,parseDependencies:Fk,createParserClass:Jh},BM={ParserDependencies:zM,typedDependencies:Q,createParser:Zh},VM={factorialDependencies:RO,typedDependencies:Q,createPermutations:$_},HM={BigNumberDependencies:Z,createPhi:oy},UM={BigNumberDependencies:Z,createPi:ry},WM={typedDependencies:Q,createPickRandom:pv},GM={ComplexDependencies:OD,addDependencies:BD,ctransposeDependencies:oA,deepEqualDependencies:dA,divideScalarDependencies:pO,dotDependencies:TO,dotDivideDependencies:wA,equalDependencies:LD,invDependencies:AO,matrixDependencies:$,multiplyDependencies:EO,typedDependencies:Q,createPinv:Xg},KM={BigNumberDependencies:Z,UnitDependencies:MO,createPlanckCharge:pb},qM={BigNumberDependencies:Z,UnitDependencies:MO,createPlanckConstant:by},JM={BigNumberDependencies:Z,UnitDependencies:MO,createPlanckLength:ub},YM={BigNumberDependencies:Z,UnitDependencies:MO,createPlanckMass:db},XM={BigNumberDependencies:Z,UnitDependencies:MO,createPlanckTemperature:mb},ZM={BigNumberDependencies:Z,UnitDependencies:MO,createPlanckTime:fb},QM={addDependencies:BD,cbrtDependencies:ik,divideDependencies:Vk,equalScalarDependencies:PD,imDependencies:AA,isZeroDependencies:SO,multiplyDependencies:EO,reDependencies:PA,sqrtDependencies:Uk,subtractDependencies:Wk,typeOfDependencies:Nj,typedDependencies:Q,unaryMinusDependencies:OO,createPolynomialRoot:Tg},$M={typedDependencies:Q,createPrint:xd},eN={addDependencies:BD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createPrintTransform:Xb},tN={BigNumberDependencies:Z,UnitDependencies:MO,createProtonMass:By},nN={bignumberDependencies:lO,addDependencies:BD,compareDependencies:bk,divideDependencies:Vk,isIntegerDependencies:RD,largerDependencies:zO,mapSlicesDependencies:uM,multiplyDependencies:EO,partitionSelectDependencies:aM,smallerDependencies:lk,smallerEqDependencies:hk,subtractDependencies:Wk,typedDependencies:Q,createQuantileSeq:O_},rN={addDependencies:BD,bignumberDependencies:lO,compareDependencies:bk,divideDependencies:Vk,isIntegerDependencies:RD,largerDependencies:zO,mapSlicesDependencies:uM,multiplyDependencies:EO,partitionSelectDependencies:aM,smallerDependencies:lk,smallerEqDependencies:hk,subtractDependencies:Wk,typedDependencies:Q,createQuantileSeqTransform:Wb},iN={BigNumberDependencies:Z,UnitDependencies:MO,createQuantumOfCirculation:Uy},aN={typedDependencies:Q,createRandom:gv},oN={log2Dependencies:$A,typedDependencies:Q,createRandomInt:vv},sN={createRangeClass:Zr},cN={bignumberDependencies:lO,matrixDependencies:$,addDependencies:BD,equalDependencies:LD,isPositiveDependencies:pk,isZeroDependencies:SO,largerDependencies:zO,largerEqDependencies:mk,smallerDependencies:lk,smallerEqDependencies:hk,typedDependencies:Q,createRangeTransform:Fb},lN={bignumberDependencies:lO,fractionDependencies:uO,AccessorNodeDependencies:UD,ArrayNodeDependencies:eO,ConstantNodeDependencies:Tk,FunctionNodeDependencies:Ok,IndexNodeDependencies:kk,ObjectNodeDependencies:Ak,OperatorNodeDependencies:jk,ParenthesisNodeDependencies:Mk,SymbolNodeDependencies:Dk,addDependencies:BD,divideDependencies:Vk,equalDependencies:LD,isZeroDependencies:SO,matrixDependencies:$,multiplyDependencies:EO,parseDependencies:Fk,powDependencies:jO,simplifyDependencies:_A,simplifyConstantDependencies:hA,simplifyCoreDependencies:gA,subtractDependencies:Wk,typedDependencies:Q,createRationalize:Wv},uN={BigNumberDependencies:Z,UnitDependencies:MO,createReducedPlanckConstant:xy},dN={matrixDependencies:$,createResize:vu},fN={createReviver:Yv},pN={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createRightArithShift:uf},mN={DenseMatrixDependencies:AD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createRightLogShift:ff},hN={BigNumberDependencies:Z,DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,addScalarDependencies:ID,cosDependencies:qk,matrixDependencies:$,multiplyScalarDependencies:bO,normDependencies:tM,sinDependencies:IA,typedDependencies:Q,unaryMinusDependencies:OO,createRotationMatrix:Su},gN={multiplyDependencies:EO,rotationMatrixDependencies:hN,typedDependencies:Q,createRotate:bu},_N={IndexDependencies:fk,matrixDependencies:$,rangeDependencies:gk,typedDependencies:Q,createRow:wu},vN={IndexDependencies:fk,matrixDependencies:$,rangeDependencies:gk,typedDependencies:Q,createRowTransform:Ib},yN={BigNumberDependencies:Z,UnitDependencies:MO,createRydberg:Wy},bN={BigNumberDependencies:Z,createSQRT1_2:dy},xN={BigNumberDependencies:Z,createSQRT2:fy},SN={BigNumberDependencies:Z,createSackurTetrode:rb},CN={BigNumberDependencies:Z,typedDependencies:Q,createSec:om},wN={BigNumberDependencies:Z,typedDependencies:Q,createSech:cm},TN={BigNumberDependencies:Z,UnitDependencies:MO,createSecondRadiation:ib},EN={DenseMatrixDependencies:AD,IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetCartesian:_m},DN={DenseMatrixDependencies:AD,IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetDifference:ym},ON={DenseMatrixDependencies:AD,IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetDistinct:xm},kN={DenseMatrixDependencies:AD,IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetIntersect:Cm},AN={IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetIsSubset:Tm},jN={IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetMultiplicity:Dm},MN={IndexDependencies:fk,compareNaturalDependencies:xk,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetPowerset:km},NN={compareNaturalDependencies:xk,typedDependencies:Q,createSetSize:jm},PN={IndexDependencies:fk,concatDependencies:zD,setDifferenceDependencies:DN,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetSymDifference:Nm},FN={IndexDependencies:fk,concatDependencies:zD,setIntersectDependencies:kN,setSymDifferenceDependencies:PN,sizeDependencies:wO,subsetDependencies:HD,typedDependencies:Q,createSetUnion:Fm},IN={typedDependencies:Q,createSinh:fm},LN={absDependencies:MD,addDependencies:BD,bignumberDependencies:lO,divideDependencies:Vk,isNegativeDependencies:FO,isPositiveDependencies:pk,largerDependencies:zO,mapDependencies:kj,matrixDependencies:$,maxDependencies:hM,multiplyDependencies:EO,smallerDependencies:lk,subtractDependencies:Wk,typedDependencies:Q,unaryMinusDependencies:OO,createSolveODE:Zu},RN={compareDependencies:bk,compareNaturalDependencies:xk,matrixDependencies:$,typedDependencies:Q,createSort:Xf},zN={SparseMatrixDependencies:FD,typedDependencies:Q,createSparse:yp},BN={BigNumberDependencies:Z,UnitDependencies:MO,createSpeedOfLight:vy},VN={typedDependencies:Q,createSplitUnit:ws},HN={absDependencies:MD,addDependencies:BD,identityDependencies:xO,invDependencies:AO,mapDependencies:kj,maxDependencies:hM,multiplyDependencies:EO,sizeDependencies:wO,sqrtDependencies:Uk,subtractDependencies:Wk,typedDependencies:Q,createSqrtm:r_},UN={typedDependencies:Q,createSquare:Jc},WN={typedDependencies:Q,createSqueeze:Ou},GN={addDependencies:BD,divideDependencies:Vk,isNaNDependencies:jj,mapSlicesDependencies:uM,multiplyDependencies:EO,subtractDependencies:Wk,typedDependencies:Q,createVariance:E_},KN={mapDependencies:kj,sqrtDependencies:Uk,typedDependencies:Q,varianceDependencies:GN,createStd:A_},qN={mapDependencies:kj,sqrtDependencies:Uk,typedDependencies:Q,varianceDependencies:GN,createStdTransform:Vb},JN={BigNumberDependencies:Z,UnitDependencies:MO,createStefanBoltzmann:ab},YN={typedDependencies:Q,createString:ls},XN={addDependencies:BD,matrixDependencies:$,typedDependencies:Q,zerosDependencies:VD,createSubsetTransform:Lb},ZN={addDependencies:BD,numericDependencies:fO,typedDependencies:Q,createSumTransform:Ub},QN={OperatorNodeDependencies:jk,parseDependencies:Fk,simplifyDependencies:_A,typedDependencies:Q,createSymbolicEqual:Bv},$N={typedDependencies:Q,createTan:mm},eP={typedDependencies:Q,createTanh:hm},tP={BigNumberDependencies:Z,UnitDependencies:MO,createThomsonCrossSection:Gy},nP={concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createTo:wd},rP={typedDependencies:Q,createToBest:Ed},iP={addDependencies:BD,matrixDependencies:$,typedDependencies:Q,createTrace:Wm},aP={createTrue:Qv},oP={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,equalScalarDependencies:PD,matrixDependencies:$,typedDependencies:Q,createUnequal:Gf},sP={UnitDependencies:MO,typedDependencies:Q,createUnitFunction:_p},cP={eDependencies:DA,createUppercaseE:hy},lP={piDependencies:UM,createUppercasePi:my},uP={BigNumberDependencies:Z,UnitDependencies:MO,createVacuumImpedance:wy},dP={addDependencies:BD,divideDependencies:Vk,isNaNDependencies:jj,mapSlicesDependencies:uM,multiplyDependencies:EO,subtractDependencies:Wk,typedDependencies:Q,createVarianceTransform:Jb},fP={createVersion:gy},pP={BigNumberDependencies:Z,createWeakMixingAngle:Ky},mP={BigNumberDependencies:Z,UnitDependencies:MO,createWienDisplacement:ob},hP={DenseMatrixDependencies:AD,SparseMatrixDependencies:FD,concatDependencies:zD,matrixDependencies:$,typedDependencies:Q,createXor:Il},gP={BigNumberDependencies:Z,ComplexDependencies:OD,addDependencies:BD,divideDependencies:Vk,equalDependencies:LD,factorialDependencies:RO,gammaDependencies:LO,isBoundedDependencies:wk,isNegativeDependencies:FO,multiplyDependencies:EO,piDependencies:UM,powDependencies:jO,sinDependencies:IA,smallerEqDependencies:hk,subtractDependencies:Wk,typedDependencies:Q,createZeta:ad},_P={ComplexDependencies:OD,addDependencies:BD,multiplyDependencies:EO,numberDependencies:dO,typedDependencies:Q,createZpk2tf:Kv},vP=ox,yP=l(o(((e,t)=>{function n(){}n.prototype={on:function(e,t,n){var r=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||={})[e]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||={},r=n[e],i=[];if(r&&t)for(var a=0,o=r.length;a<o;a++)r[a].fn!==t&&r[a].fn._!==t&&i.push(r[a]);return i.length?n[e]=i:delete n[e],this}},t.exports=n,t.exports.TinyEmitter=n}))(),1);function bP(e){var t=new yP.default;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}function xP(e,t,n,r){function i(e,t){var n=arguments.length;if(n!==1&&n!==2)throw new Sc(`import`,n,1,2);t||={};function r(e,n,i){if(Array.isArray(n))n.forEach(t=>r(e,t));else if(R(n)||d(n))for(var a in n)z(n,a)&&r(e,n[a],a);else if(Je(n)||i!==void 0){var o=Je(n)?h(n)?n.fn+`.transform`:n.fn:i;if(z(e,o)&&e[o]!==n&&!t.silent)throw Error(`Cannot import "`+o+`" twice`);e[o]=n}else if(!t.silent)throw TypeError(`Factory, Object, or Array expected`)}var i={};for(var o in r(i,e),i)if(z(i,o)){var s=i[o];if(Je(s))l(s,t);else if(u(s))a(o,s,t);else if(!t.silent)throw TypeError(`Factory, Object, or Array expected`)}}function a(t,i,a){if(a.wrap&&typeof i==`function`&&(i=c(i)),f(i)&&(i=e(t,{[i.signature]:i})),e.isTypedFunction(n[t])&&e.isTypedFunction(i)){i=a.override?e(t,i.signatures):e(n[t],i),n[t]=i,delete r[t],o(t,i),n.emit(`import`,t,function(){return i});return}var s=n[t]!==void 0,l=n.Unit?.isValuelessUnit(t);if(!s&&!l||a.override){n[t]=i,delete r[t],o(t,i),n.emit(`import`,t,function(){return i});return}if(!a.silent)throw Error(`Cannot import "`+t+`": already exists`)}function o(e,t){t&&typeof t.transform==`function`?(n.expression.transform[e]=t.transform,p(e)&&(n.expression.mathWithTransform[e]=t.transform)):(delete n.expression.transform[e],p(e)&&(n.expression.mathWithTransform[e]=t))}function s(e){delete n.expression.transform[e],p(e)?n.expression.mathWithTransform[e]=n[e]:delete n.expression.mathWithTransform[e]}function c(e){var t=function(){for(var t=[],r=0,i=arguments.length;r<i;r++){var a=arguments[r];t[r]=a&&a.valueOf()}return e.apply(n,t)};return e.transform&&(t.transform=e.transform),t}function l(t,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t.fn;if(a.includes(`.`))throw Error(`Factory name should not contain a nested path. Name: `+JSON.stringify(a));var o=h(t)?n.expression.transform:n,c=a in n.expression.transform,l=z(o,a)?o[a]:void 0,u=function(){var r={};t.dependencies.map(Ze).forEach(e=>{if(e.includes(`.`))throw Error(`Factory dependency should not contain a nested path. Name: `+JSON.stringify(e));e===`math`?r.math=n:e===`mathWithTransform`?r.mathWithTransform=n.expression.mathWithTransform:e===`classes`?r.classes=n:r[e]=n[e]});var o=t(r);if(o&&typeof o.transform==`function`)throw Error(`Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"`);if(l===void 0||i.override)return o;if(e.isTypedFunction(l)&&e.isTypedFunction(o))return e(l,o);if(i.silent)return l;throw Error(`Cannot import "`+a+`": already exists`)},d=t.meta?.formerly??``,f=h(t)||m(t),p=n.expression.mathWithTransform;!t.meta||t.meta.lazy!==!1?(Be(o,a,u),d&&Be(o,d,u),l&&c?(s(a),d&&s(d)):f&&(Be(p,a,()=>o[a]),d&&Be(p,d,()=>o[a]))):(o[a]=u(),d&&(o[d]=o[a]),l&&c?(s(a),d&&s(d)):f&&(Be(p,a,()=>o[a]),d&&Be(p,d,()=>o[a]))),r[a]=t,n.emit(`import`,a,u)}function u(e){return typeof e==`function`||typeof e==`number`||typeof e==`string`||typeof e==`boolean`||e===null||M(e)||A(e)||O(e)||j(e)||F(e)||Array.isArray(e)}function d(e){return typeof e==`object`&&e[Symbol.toStringTag]===`Module`}function f(e){return typeof e==`function`&&typeof e.signature==`string`}function p(e){return!z(g,e)}function m(e){return!e.fn.includes(`.`)&&!z(g,e.fn)&&(!e.meta||!e.meta.isClass)}function h(e){return e!==void 0&&e.meta!==void 0&&e.meta.isTransformFunction===!0||!1}var g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return i}function SP(e,t){var n=u({},d,t);if(typeof Object.create!=`function`)throw Error(`ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.`);var r=bP({isNumber:D,isComplex:A,isBigNumber:O,isBigInt:k,isFraction:j,isUnit:M,isString:N,isArray:P,isMatrix:F,isCollection:ee,isDenseMatrix:te,isSparseMatrix:ne,isRange:re,isIndex:ie,isBoolean:ae,isResultSet:I,isHelp:oe,isFunction:L,isDate:se,isRegExp:ce,isObject:R,isMap:le,isPartitionedMap:ue,isObjectWrappingMap:de,isNull:fe,isUndefined:pe,isAccessorNode:me,isArrayNode:he,isAssignmentNode:ge,isBlockNode:_e,isConditionalNode:ve,isConstantNode:ye,isFunctionAssignmentNode:xe,isFunctionNode:Se,isIndexNode:Ce,isNode:we,isObjectNode:Te,isOperatorNode:Ee,isParenthesisNode:De,isRangeNode:Oe,isRelationalNode:ke,isSymbolNode:Ae,isChain:je});r.config=Ge(n,r.emit),r.expression={transform:{},mathWithTransform:{config:r.config}};var i=[],a=[];function o(e){if(Je(e))return e(r);var t=e[Object.keys(e)[0]];if(Je(t))return t(r);if(!Ve(e))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",e),Error("Factory object with properties `type`, `name`, and `factory` expected");var s=i.indexOf(e),c;return s===-1?(c=e.math===!0?e.factory(r.type,n,o,r.typed,r):e.factory(r.type,n,o,r.typed),i.push(e),a.push(c)):c=a[s],c}var s={};function c(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return r.typed.apply(r.typed,t)}c.isTypedFunction=Et.default.isTypedFunction;var l=xP(c,o,r,s);return r.import=l,r.on(`config`,()=>{Object.values(s).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&l(e,{override:!0})})}),r.create=SP.bind(null,e),r.factory=V,r.import(Object.values(Re(e))),r.ArgumentsError=Sc,r.DimensionError=mi,r.IndexError=hi,r}var CP=s({AccessorNode:()=>lD,AccessorNodeDependencies:()=>UD,ArgumentsError:()=>Sc,ArrayNode:()=>$E,ArrayNodeDependencies:()=>eO,AssignmentNode:()=>uD,AssignmentNodeDependencies:()=>aO,BigNumber:()=>J,BigNumberDependencies:()=>Z,BlockNode:()=>eD,BlockNodeDependencies:()=>QO,Chain:()=>iD,ChainDependencies:()=>ak,Complex:()=>sx,ComplexDependencies:()=>OD,ConditionalNode:()=>tD,ConditionalNodeDependencies:()=>Ck,ConstantNode:()=>sD,ConstantNodeDependencies:()=>Tk,DenseMatrix:()=>Dx,DenseMatrixDependencies:()=>AD,DimensionError:()=>mi,EDependencies:()=>cP,FibonacciHeap:()=>mw,FibonacciHeapDependencies:()=>nj,Fraction:()=>dx,FractionDependencies:()=>jD,FunctionAssignmentNode:()=>aD,FunctionAssignmentNodeDependencies:()=>Ek,FunctionNode:()=>fD,FunctionNodeDependencies:()=>Ok,Help:()=>vD,HelpDependencies:()=>gj,ImmutableDenseMatrix:()=>_w,ImmutableDenseMatrixDependencies:()=>uk,Index:()=>vw,IndexDependencies:()=>fk,IndexError:()=>hi,IndexNode:()=>cD,IndexNodeDependencies:()=>kk,InfinityDependencies:()=>Cj,LN10:()=>mx,LN10Dependencies:()=>Rj,LN2:()=>kx,LN2Dependencies:()=>zj,LOG10E:()=>hx,LOG10EDependencies:()=>Bj,LOG2E:()=>gS,LOG2EDependencies:()=>Vj,Matrix:()=>gx,MatrixDependencies:()=>kD,NaNDependencies:()=>EM,Node:()=>JE,NodeDependencies:()=>ND,ObjectNode:()=>YE,ObjectNodeDependencies:()=>Ak,OperatorNode:()=>XE,OperatorNodeDependencies:()=>jk,PIDependencies:()=>lP,ParenthesisNode:()=>ZE,ParenthesisNodeDependencies:()=>Mk,Parser:()=>yD,ParserDependencies:()=>zM,Range:()=>bx,RangeDependencies:()=>sN,RangeNode:()=>nD,RangeNodeDependencies:()=>Nk,RelationalNode:()=>QE,RelationalNodeDependencies:()=>Pk,ResultSet:()=>xx,ResultSetDependencies:()=>ZO,SQRT1_2:()=>Sx,SQRT1_2Dependencies:()=>bN,SQRT2:()=>Mx,SQRT2Dependencies:()=>xN,Spa:()=>jw,SpaDependencies:()=>Zj,SparseMatrix:()=>PS,SparseMatrixDependencies:()=>FD,SymbolNode:()=>dD,SymbolNodeDependencies:()=>Dk,Unit:()=>yT,UnitDependencies:()=>MO,_Infinity:()=>px,_NaN:()=>_x,_false:()=>lx,_null:()=>vx,_true:()=>Tx,abs:()=>Px,absDependencies:()=>MD,acos:()=>Fx,acosDependencies:()=>WD,acosh:()=>HS,acoshDependencies:()=>GD,acot:()=>Ix,acotDependencies:()=>KD,acoth:()=>mC,acothDependencies:()=>qD,acsc:()=>Lx,acscDependencies:()=>JD,acsch:()=>US,acschDependencies:()=>YD,add:()=>ew,addDependencies:()=>BD,addScalar:()=>Rx,addScalarDependencies:()=>ID,all:()=>vP,and:()=>aT,andDependencies:()=>ZD,andTransformDependencies:()=>QD,apply:()=>EC,arg:()=>zx,argDependencies:()=>$D,asec:()=>WS,asecDependencies:()=>tO,asech:()=>Bx,asechDependencies:()=>nO,asin:()=>hC,asinDependencies:()=>rO,asinh:()=>Vx,asinhDependencies:()=>iO,atan:()=>Hx,atan2:()=>tw,atan2Dependencies:()=>sO,atanDependencies:()=>oO,atanh:()=>Ux,atanhDependencies:()=>cO,atomicMass:()=>ST,atomicMassDependencies:()=>NO,avogadro:()=>tE,avogadroDependencies:()=>PO,bellNumbers:()=>SE,bellNumbersDependencies:()=>VO,bernoulli:()=>MC,bernoulliDependencies:()=>HO,bigint:()=>Wx,bigintDependencies:()=>UO,bignumber:()=>GS,bignumberDependencies:()=>lO,bin:()=>gC,binDependencies:()=>WO,bitAnd:()=>nw,bitAndDependencies:()=>GO,bitAndTransformDependencies:()=>KO,bitNot:()=>Gx,bitNotDependencies:()=>qO,bitOr:()=>rw,bitOrDependencies:()=>JO,bitOrTransformDependencies:()=>YO,bitXor:()=>iw,bitXorDependencies:()=>XO,bohrMagneton:()=>CT,bohrMagnetonDependencies:()=>$O,bohrRadius:()=>nE,bohrRadiusDependencies:()=>ek,boltzmann:()=>wT,boltzmannDependencies:()=>tk,boolean:()=>Kx,booleanDependencies:()=>nk,catalan:()=>Lw,catalanDependencies:()=>rk,cbrt:()=>NC,cbrtDependencies:()=>ik,ceil:()=>aw,ceilDependencies:()=>hO,chain:()=>oD,chainDependencies:()=>ok,classicalElectronRadius:()=>ME,classicalElectronRadiusDependencies:()=>sk,clone:()=>qx,cloneDependencies:()=>ck,column:()=>TT,columnDependencies:()=>_k,columnTransformDependencies:()=>vk,combinations:()=>Jx,combinationsDependencies:()=>IO,combinationsWithRep:()=>KS,combinationsWithRepDependencies:()=>yk,compare:()=>ow,compareDependencies:()=>bk,compareNatural:()=>Rw,compareNaturalDependencies:()=>xk,compareText:()=>sw,compareTextDependencies:()=>Sk,compile:()=>gD,compileDependencies:()=>Ik,complex:()=>Yx,complexDependencies:()=>Lk,composition:()=>cw,compositionDependencies:()=>Rk,concat:()=>PC,concatDependencies:()=>zD,concatTransformDependencies:()=>zk,conductanceQuantum:()=>ET,conductanceQuantumDependencies:()=>Bk,config:()=>B,conj:()=>Xx,conjDependencies:()=>CO,corr:()=>NE,corrDependencies:()=>Kk,cos:()=>Zx,cosDependencies:()=>qk,cosh:()=>qS,coshDependencies:()=>Jk,cot:()=>Qx,cotDependencies:()=>Yk,coth:()=>_C,cothDependencies:()=>Xk,coulomb:()=>DT,coulombConstant:()=>rE,coulombConstantDependencies:()=>Qk,coulombDependencies:()=>Zk,count:()=>lw,countDependencies:()=>eA,create:()=>SP,createAbs:()=>As,createAccessorNode:()=>Qm,createAcos:()=>Cp,createAcosh:()=>Tp,createAcot:()=>Dp,createAcoth:()=>kp,createAcsc:()=>jp,createAcsch:()=>Np,createAdd:()=>Lm,createAddScalar:()=>Is,createAnd:()=>mf,createAndTransform:()=>Zb,createArg:()=>Sl,createArrayNode:()=>eh,createAsec:()=>Fp,createAsech:()=>Lp,createAsin:()=>zp,createAsinh:()=>Bp,createAssignmentNode:()=>lh,createAtan:()=>Vp,createAtan2:()=>Up,createAtanh:()=>Gp,createAtomicMass:()=>Jy,createAvogadro:()=>Yy,createBellNumbers:()=>Sv,createBernoulli:()=>P_,createBigNumberClass:()=>br,createBigint:()=>ss,createBignumber:()=>fs,createBin:()=>md,createBitAnd:()=>pl,createBitAndTransform:()=>ex,createBitNot:()=>hl,createBitOr:()=>_l,createBitOrTransform:()=>tx,createBitXor:()=>bl,createBlockNode:()=>dh,createBohrMagneton:()=>Oy,createBohrRadius:()=>Py,createBoltzmann:()=>Xy,createBoolean:()=>ds,createCatalan:()=>wv,createCbrt:()=>Bs,createCeil:()=>Js,createChain:()=>Wg,createChainClass:()=>Dg,createClassicalElectronRadius:()=>Fy,createClone:()=>aa,createColumn:()=>Bl,createColumnTransform:()=>bb,createCombinations:()=>L_,createCombinationsWithRep:()=>B_,createCompare:()=>gf,createCompareNatural:()=>bf,createCompareText:()=>wf,createCompile:()=>Gh,createComplex:()=>ps,createComplexClass:()=>kr,createComposition:()=>Ev,createConcat:()=>Rl,createConcatTransform:()=>Rb,createConditionalNode:()=>ph,createConductanceQuantum:()=>ky,createConj:()=>wl,createConstantNode:()=>Ch,createCorr:()=>M_,createCos:()=>Jp,createCosh:()=>Xp,createCot:()=>Qp,createCoth:()=>em,createCoulomb:()=>Ty,createCoulombConstant:()=>Ey,createCount:()=>Hl,createCreateUnit:()=>xp,createCross:()=>Wl,createCsc:()=>nm,createCsch:()=>im,createCtranspose:()=>Ru,createCube:()=>Xs,createCumSum:()=>__,createCumSumTransform:()=>Kb,createDeepEqual:()=>Uf,createDen:()=>ax,createDenseMatrixClass:()=>ra,createDerivative:()=>Hv,createDet:()=>Kg,createDeuteronMass:()=>Vy,createDiag:()=>Kl,createDiff:()=>lu,createDiffTransform:()=>Bb,createDistance:()=>f_,createDivide:()=>u_,createDivideScalar:()=>jd,createDot:()=>Um,createDotDivide:()=>Jd,createDotMultiply:()=>rl,createDotPow:()=>Kd,createE:()=>ay,createEfimovFactor:()=>qy,createEigs:()=>$g,createElectricConstant:()=>Cy,createElectronMass:()=>Iy,createElementaryCharge:()=>Dy,createEqual:()=>Ef,createEqualScalar:()=>es,createEqualText:()=>kf,createErf:()=>Qu,createEvaluate:()=>qh,createExp:()=>Qs,createExpm:()=>t_,createExpm1:()=>ec,createFactorial:()=>q_,createFalse:()=>$v,createFaraday:()=>Zy,createFermiCoupling:()=>Ly,createFft:()=>Hu,createFibonacciHeapClass:()=>ip,createFilter:()=>ql,createFilterTransform:()=>Tb,createFineStructure:()=>Ry,createFirstRadiation:()=>Qy,createFix:()=>ic,createFlatten:()=>Xl,createFloor:()=>lc,createForEach:()=>Ql,createForEachTransform:()=>Eb,createFormat:()=>fd,createFraction:()=>ms,createFractionClass:()=>Xr,createFreqz:()=>Jv,createFunctionAssignmentNode:()=>Th,createFunctionNode:()=>Vh,createGamma:()=>U_,createGasConstant:()=>eb,createGcd:()=>Oc,createGetMatrixDataType:()=>tu,createGravitationConstant:()=>yy,createGravity:()=>lb,createHartreeEnergy:()=>zy,createHasNumericValue:()=>Ro,createHelp:()=>Hg,createHelpClass:()=>Eg,createHex:()=>vd,createHypot:()=>zm,createI:()=>py,createIdentity:()=>ru,createIfft:()=>Wu,createIm:()=>El,createImmutableDenseMatrixClass:()=>tp,createIndex:()=>Km,createIndexClass:()=>np,createIndexNode:()=>Dh,createIndexTransform:()=>Db,createInfinity:()=>ty,createIntersect:()=>p_,createInv:()=>Jg,createInverseConductanceQuantum:()=>Ay,createInvmod:()=>el,createIsBounded:()=>Ko,createIsFinite:()=>Jo,createIsInteger:()=>ma,createIsNaN:()=>Wo,createIsNegative:()=>Po,createIsNumeric:()=>Io,createIsPositive:()=>Bo,createIsPrime:()=>Od,createIsZero:()=>Ho,createKldivergence:()=>Y_,createKlitzing:()=>Ny,createKron:()=>au,createLN10:()=>cy,createLN2:()=>sy,createLOG10E:()=>uy,createLOG2E:()=>ly,createLarger:()=>Lf,createLargerEq:()=>Bf,createLcm:()=>jc,createLeafCount:()=>Ov,createLeftShift:()=>cf,createLgamma:()=>G_,createLog:()=>Bd,createLog10:()=>Ic,createLog1p:()=>Hd,createLog2:()=>Rc,createLoschmidt:()=>$y,createLsolve:()=>Zd,createLsolveAll:()=>tf,createLup:()=>$h,createLusolve:()=>Cg,createLyap:()=>l_,createMad:()=>C_,createMagneticConstant:()=>Sy,createMagneticFluxQuantum:()=>jy,createMap:()=>su,createMapSlices:()=>Ms,createMapSlicesTransform:()=>yb,createMapTransform:()=>Ob,createMatrix:()=>gs,createMatrixClass:()=>Qr,createMatrixFromColumns:()=>Ss,createMatrixFromFunction:()=>vs,createMatrixFromRows:()=>bs,createMax:()=>Qf,createMaxTransform:()=>Mb,createMean:()=>y_,createMeanTransform:()=>Nb,createMedian:()=>x_,createMin:()=>ep,createMinTransform:()=>Pb,createMod:()=>vc,createMode:()=>sd,createMolarMass:()=>sb,createMolarMassC12:()=>cb,createMolarPlanckConstant:()=>tb,createMolarVolume:()=>nb,createMultinomial:()=>Z_,createMultiply:()=>Vc,createMultiplyScalar:()=>zc,createNaN:()=>ny,createNeutronMass:()=>Hy,createNode:()=>Jm,createNorm:()=>Vm,createNot:()=>Al,createNthRoot:()=>Uc,createNthRoots:()=>Wd,createNuclearMagneton:()=>My,createNull:()=>ey,createNullish:()=>Ml,createNullishTransform:()=>$b,createNum:()=>rx,createNumber:()=>os,createNumeric:()=>kd,createObjectNode:()=>kh,createOct:()=>gd,createOnes:()=>uu,createOperatorNode:()=>Mh,createOr:()=>Pl,createOrTransform:()=>Qb,createParenthesisNode:()=>Ph,createParse:()=>Uh,createParser:()=>Zh,createParserClass:()=>Jh,createPartitionSelect:()=>Jf,createPermutations:()=>$_,createPhi:()=>oy,createPi:()=>ry,createPickRandom:()=>pv,createPinv:()=>Xg,createPlanckCharge:()=>pb,createPlanckConstant:()=>by,createPlanckLength:()=>ub,createPlanckMass:()=>db,createPlanckTemperature:()=>mb,createPlanckTime:()=>fb,createPolynomialRoot:()=>Tg,createPow:()=>Nd,createPrint:()=>xd,createPrintTransform:()=>Xb,createProd:()=>ud,createProtonMass:()=>By,createQr:()=>tg,createQuantileSeq:()=>O_,createQuantileSeqTransform:()=>Wb,createQuantumOfCirculation:()=>Uy,createRandom:()=>gv,createRandomInt:()=>vv,createRange:()=>hu,createRangeClass:()=>Zr,createRangeNode:()=>Ih,createRangeTransform:()=>Fb,createRationalize:()=>Wv,createRe:()=>Ol,createReducedPlanckConstant:()=>xy,createRelationalNode:()=>Rh,createReplacer:()=>Xv,createReshape:()=>_u,createResize:()=>vu,createResolve:()=>Rv,createResultSet:()=>Nt,createReviver:()=>Yv,createRightArithShift:()=>uf,createRightLogShift:()=>ff,createRotate:()=>bu,createRotationMatrix:()=>Su,createRound:()=>Id,createRow:()=>wu,createRowTransform:()=>Ib,createRydberg:()=>Wy,createSQRT1_2:()=>dy,createSQRT2:()=>fy,createSackurTetrode:()=>rb,createSchur:()=>s_,createSec:()=>om,createSech:()=>cm,createSecondRadiation:()=>ib,createSetCartesian:()=>_m,createSetDifference:()=>ym,createSetDistinct:()=>xm,createSetIntersect:()=>Cm,createSetIsSubset:()=>Tm,createSetMultiplicity:()=>Dm,createSetPowerset:()=>km,createSetSize:()=>jm,createSetSymDifference:()=>Nm,createSetUnion:()=>Fm,createSign:()=>Gc,createSimplify:()=>Pv,createSimplifyConstant:()=>Fv,createSimplifyCore:()=>Lv,createSin:()=>um,createSinh:()=>fm,createSize:()=>Eu,createSlu:()=>bg,createSmaller:()=>jf,createSmallerEq:()=>Pf,createSolveODE:()=>Zu,createSort:()=>Xf,createSpaClass:()=>ap,createSparse:()=>yp,createSparseMatrixClass:()=>ts,createSpeedOfLight:()=>vy,createSplitUnit:()=>ws,createSqrt:()=>Kc,createSqrtm:()=>r_,createSquare:()=>Jc,createSqueeze:()=>Ou,createStd:()=>A_,createStdTransform:()=>Vb,createStefanBoltzmann:()=>ab,createStirlingS2:()=>bv,createString:()=>ls,createSubset:()=>Au,createSubsetTransform:()=>Lb,createSubtract:()=>Xc,createSubtractScalar:()=>Rs,createSum:()=>h_,createSumTransform:()=>Ub,createSylvester:()=>a_,createSymbolNode:()=>zh,createSymbolicEqual:()=>Bv,createTan:()=>mm,createTanh:()=>hm,createTau:()=>iy,createThomsonCrossSection:()=>Gy,createTo:()=>wd,createToBest:()=>Ed,createTrace:()=>Wm,createTranspose:()=>Iu,createTrue:()=>Qv,createTypeOf:()=>Xo,createTyped:()=>Ot,createUnaryMinus:()=>Es,createUnaryPlus:()=>Os,createUnequal:()=>Gf,createUnit:()=>OT,createUnitClass:()=>hp,createUnitDependencies:()=>tA,createUnitFunction:()=>_p,createUppercaseE:()=>hy,createUppercasePi:()=>my,createUsolve:()=>$d,createUsolveAll:()=>rf,createVacuumImpedance:()=>wy,createVariance:()=>E_,createVarianceTransform:()=>Jb,createVersion:()=>gy,createWeakMixingAngle:()=>Ky,createWienDisplacement:()=>ob,createXgcd:()=>Qc,createXor:()=>Il,createZeros:()=>Bu,createZeta:()=>ad,createZpk2tf:()=>Kv,cross:()=>uw,crossDependencies:()=>nA,csc:()=>$x,cscDependencies:()=>rA,csch:()=>JS,cschDependencies:()=>iA,ctranspose:()=>vC,ctransposeDependencies:()=>oA,cube:()=>eS,cubeDependencies:()=>sA,cumsum:()=>zw,cumsumDependencies:()=>lA,cumsumTransformDependencies:()=>uA,deepEqual:()=>FC,deepEqualDependencies:()=>dA,den:()=>oT,denDependencies:()=>fA,derivative:()=>wD,derivativeDependencies:()=>vA,det:()=>Bw,detDependencies:()=>kO,deuteronMass:()=>kT,deuteronMassDependencies:()=>yA,diag:()=>yC,diagDependencies:()=>bA,diff:()=>dw,diffDependencies:()=>xA,diffTransformDependencies:()=>SA,distance:()=>sT,distanceDependencies:()=>CA,divide:()=>iE,divideDependencies:()=>Vk,divideScalar:()=>fw,divideScalarDependencies:()=>pO,docs:()=>Bg,dot:()=>YS,dotDependencies:()=>TO,dotDivide:()=>Vw,dotDivideDependencies:()=>wA,dotMultiply:()=>IC,dotMultiplyDependencies:()=>TA,dotPow:()=>cT,dotPowDependencies:()=>EA,e:()=>cx,eDependencies:()=>DA,efimovFactor:()=>Ox,efimovFactorDependencies:()=>OA,eigs:()=>AT,eigsDependencies:()=>zA,electricConstant:()=>CE,electricConstantDependencies:()=>BA,electronMass:()=>jT,electronMassDependencies:()=>VA,elementaryCharge:()=>aE,elementaryChargeDependencies:()=>HA,equal:()=>bC,equalDependencies:()=>LD,equalScalar:()=>tS,equalScalarDependencies:()=>PD,equalText:()=>pw,equalTextDependencies:()=>UA,erf:()=>nS,erfDependencies:()=>WA,evaluate:()=>_D,evaluateDependencies:()=>GA,exp:()=>rS,expDependencies:()=>KA,expm:()=>lT,expm1:()=>iS,expm1Dependencies:()=>JA,expmDependencies:()=>qA,factorial:()=>MT,factorialDependencies:()=>RO,factory:()=>V,falseDependencies:()=>YA,faraday:()=>oE,faradayDependencies:()=>XA,fermiCoupling:()=>NT,fermiCouplingDependencies:()=>ZA,fft:()=>uT,fftDependencies:()=>tj,filter:()=>aS,filterDependencies:()=>rj,filterTransformDependencies:()=>ij,fineStructure:()=>ux,fineStructureDependencies:()=>aj,firstRadiation:()=>wE,firstRadiationDependencies:()=>oj,fix:()=>hw,fixDependencies:()=>_O,flatten:()=>oS,flattenDependencies:()=>kA,floor:()=>LC,floorDependencies:()=>gO,forEach:()=>sS,forEachDependencies:()=>sj,forEachTransformDependencies:()=>cj,format:()=>cS,formatDependencies:()=>vO,fraction:()=>xC,fractionDependencies:()=>uO,freqz:()=>sE,freqzDependencies:()=>lj,gamma:()=>dT,gammaDependencies:()=>LO,gasConstant:()=>PT,gasConstantDependencies:()=>uj,gcd:()=>RC,gcdDependencies:()=>dj,getMatrixDataType:()=>lS,getMatrixDataTypeDependencies:()=>dk,gravitationConstant:()=>cE,gravitationConstantDependencies:()=>fj,gravity:()=>FT,gravityDependencies:()=>pj,hartreeEnergy:()=>TE,hartreeEnergyDependencies:()=>mj,hasNumericValue:()=>XS,hasNumericValueDependencies:()=>hj,help:()=>xD,helpDependencies:()=>_j,hex:()=>uS,hexDependencies:()=>vj,hypot:()=>gw,hypotDependencies:()=>yj,i:()=>fx,iDependencies:()=>QA,identity:()=>SC,identityDependencies:()=>xO,ifft:()=>fT,ifftDependencies:()=>bj,im:()=>dS,imDependencies:()=>AA,index:()=>Hw,indexDependencies:()=>xj,indexTransformDependencies:()=>Sj,intersect:()=>yw,intersectDependencies:()=>wj,inv:()=>Uw,invDependencies:()=>AO,inverseConductanceQuantum:()=>lE,inverseConductanceQuantumDependencies:()=>Tj,invmod:()=>bw,invmodDependencies:()=>Oj,isAccessorNode:()=>me,isArray:()=>P,isArrayNode:()=>he,isAssignmentNode:()=>ge,isBigInt:()=>k,isBigNumber:()=>O,isBlockNode:()=>_e,isBoolean:()=>ae,isBounded:()=>fS,isBoundedDependencies:()=>wk,isChain:()=>je,isCollection:()=>ee,isComplex:()=>A,isConditionalNode:()=>ve,isConstantNode:()=>ye,isDate:()=>se,isDenseMatrix:()=>te,isFinite:()=>ZS,isFiniteDependencies:()=>Aj,isFraction:()=>j,isFunction:()=>L,isFunctionAssignmentNode:()=>xe,isFunctionNode:()=>Se,isHelp:()=>oe,isIndex:()=>ie,isIndexNode:()=>Ce,isInteger:()=>CC,isIntegerDependencies:()=>RD,isMap:()=>le,isMatrix:()=>F,isNaN:()=>pS,isNaNDependencies:()=>jj,isNegative:()=>QS,isNegativeDependencies:()=>FO,isNode:()=>we,isNull:()=>fe,isNumber:()=>D,isNumeric:()=>mS,isNumericDependencies:()=>yO,isObject:()=>R,isObjectNode:()=>Te,isObjectWrappingMap:()=>de,isOperatorNode:()=>Ee,isParenthesisNode:()=>De,isPartitionedMap:()=>ue,isPositive:()=>zC,isPositiveDependencies:()=>pk,isPrime:()=>hS,isPrimeDependencies:()=>Mj,isRange:()=>re,isRangeNode:()=>Oe,isRegExp:()=>ce,isRelationalNode:()=>ke,isResultSet:()=>I,isSparseMatrix:()=>ne,isString:()=>N,isSymbolNode:()=>Ae,isUndefined:()=>pe,isUnit:()=>M,isZero:()=>$S,isZeroDependencies:()=>SO,kldivergence:()=>EE,kldivergenceDependencies:()=>Fj,klitzing:()=>IT,klitzingDependencies:()=>Ij,kron:()=>wC,kronDependencies:()=>Lj,larger:()=>BC,largerDependencies:()=>zO,largerEq:()=>xw,largerEqDependencies:()=>mk,lcm:()=>VC,lcmDependencies:()=>Hj,leafCount:()=>ED,leafCountDependencies:()=>Uj,leftShift:()=>HC,leftShiftDependencies:()=>Wj,lgamma:()=>_S,lgammaDependencies:()=>Gj,log:()=>Sw,log10:()=>vS,log10Dependencies:()=>Kj,log1p:()=>Ww,log1pDependencies:()=>qj,log2:()=>yS,log2Dependencies:()=>$A,logDependencies:()=>Pj,loschmidt:()=>LT,loschmidtDependencies:()=>Jj,lsolve:()=>Cw,lsolveAll:()=>Gw,lsolveAllDependencies:()=>Xj,lsolveDependencies:()=>Yj,lup:()=>pT,lupDependencies:()=>Qj,lusolve:()=>uE,lusolveDependencies:()=>eM,lyap:()=>WE,lyapDependencies:()=>iM,mad:()=>RE,madDependencies:()=>sM,magneticConstant:()=>RT,magneticConstantDependencies:()=>cM,magneticFluxQuantum:()=>dE,magneticFluxQuantumDependencies:()=>lM,map:()=>bS,mapDependencies:()=>kj,mapSlices:()=>TC,mapSlicesDependencies:()=>uM,mapSlicesTransformDependencies:()=>dM,mapTransformDependencies:()=>fM,matrix:()=>X,matrixDependencies:()=>$,matrixFromColumns:()=>DC,matrixFromColumnsDependencies:()=>jA,matrixFromFunction:()=>eC,matrixFromFunctionDependencies:()=>pM,matrixFromRows:()=>ww,matrixFromRowsDependencies:()=>mM,max:()=>Kw,maxDependencies:()=>hM,maxTransformDependencies:()=>gM,mean:()=>DE,meanDependencies:()=>Hk,meanTransformDependencies:()=>_M,median:()=>PE,medianDependencies:()=>oM,min:()=>Tw,minDependencies:()=>vM,minTransformDependencies:()=>yM,mod:()=>UC,modDependencies:()=>Ej,mode:()=>xS,modeDependencies:()=>bM,molarMass:()=>zT,molarMassC12:()=>fE,molarMassC12Dependencies:()=>SM,molarMassDependencies:()=>xM,molarPlanckConstant:()=>BT,molarPlanckConstantDependencies:()=>CM,molarVolume:()=>OE,molarVolumeDependencies:()=>wM,multinomial:()=>pE,multinomialDependencies:()=>TM,multiply:()=>tC,multiplyDependencies:()=>EO,multiplyScalar:()=>SS,multiplyScalarDependencies:()=>bO,neutronMass:()=>VT,neutronMassDependencies:()=>DM,norm:()=>zE,normDependencies:()=>tM,not:()=>CS,notDependencies:()=>XD,nthRoot:()=>WC,nthRootDependencies:()=>OM,nthRoots:()=>Ew,nthRootsDependencies:()=>kM,nuclearMagneton:()=>HT,nuclearMagnetonDependencies:()=>AM,nullDependencies:()=>jM,nullish:()=>GC,nullishDependencies:()=>MM,nullishTransformDependencies:()=>NM,num:()=>OC,numDependencies:()=>PM,number:()=>wS,numberDependencies:()=>dO,numeric:()=>KC,numericDependencies:()=>fO,oct:()=>TS,octDependencies:()=>FM,ones:()=>nC,onesDependencies:()=>IM,or:()=>qw,orDependencies:()=>LM,orTransformDependencies:()=>RM,parse:()=>pD,parseDependencies:()=>Fk,parser:()=>TD,parserDependencies:()=>BM,partitionSelect:()=>Dw,partitionSelectDependencies:()=>aM,permutations:()=>UT,permutationsDependencies:()=>VM,phi:()=>yx,phiDependencies:()=>HM,pi:()=>Ax,piDependencies:()=>UM,pickRandom:()=>ES,pickRandomDependencies:()=>WM,pinv:()=>Jw,pinvDependencies:()=>GM,planckCharge:()=>mE,planckChargeDependencies:()=>KM,planckConstant:()=>WT,planckConstantDependencies:()=>qM,planckLength:()=>kE,planckLengthDependencies:()=>JM,planckMass:()=>GT,planckMassDependencies:()=>YM,planckTemperature:()=>hE,planckTemperatureDependencies:()=>XM,planckTime:()=>KT,planckTimeDependencies:()=>ZM,polynomialRoot:()=>FE,polynomialRootDependencies:()=>QM,pow:()=>Yw,powDependencies:()=>jO,print:()=>DS,printDependencies:()=>$M,printTransformDependencies:()=>eN,prod:()=>qC,prodDependencies:()=>$k,protonMass:()=>qT,protonMassDependencies:()=>tN,qr:()=>Ow,qrDependencies:()=>NA,quantileSeq:()=>gE,quantileSeqDependencies:()=>nN,quantileSeqTransformDependencies:()=>rN,quantumOfCirculation:()=>JT,quantumOfCirculationDependencies:()=>iN,random:()=>OS,randomDependencies:()=>aN,randomInt:()=>rC,randomIntDependencies:()=>oN,range:()=>mT,rangeDependencies:()=>gk,rangeTransformDependencies:()=>cN,rationalize:()=>DD,rationalizeDependencies:()=>lN,re:()=>kS,reDependencies:()=>PA,reducedPlanckConstant:()=>YT,reducedPlanckConstantDependencies:()=>uN,replacer:()=>jx,replacerDependencies:()=>pA,reshape:()=>kC,reshapeDependencies:()=>FA,resize:()=>iC,resizeDependencies:()=>dN,resolve:()=>mD,resolveDependencies:()=>mA,reviver:()=>rD,reviverDependencies:()=>fN,rightArithShift:()=>JC,rightArithShiftDependencies:()=>pN,rightLogShift:()=>kw,rightLogShiftDependencies:()=>mN,rotate:()=>VE,rotateDependencies:()=>gN,rotationMatrix:()=>BE,rotationMatrixDependencies:()=>hN,round:()=>AC,roundDependencies:()=>mO,row:()=>hT,rowDependencies:()=>_N,rowTransformDependencies:()=>vN,rydberg:()=>_E,rydbergDependencies:()=>yN,sackurTetrode:()=>Cx,sackurTetrodeDependencies:()=>SN,schur:()=>HE,schurDependencies:()=>nM,sec:()=>AS,secDependencies:()=>CN,sech:()=>aC,sechDependencies:()=>wN,secondRadiation:()=>XT,secondRadiationDependencies:()=>TN,setCartesian:()=>Xw,setCartesianDependencies:()=>EN,setDifference:()=>gT,setDifferenceDependencies:()=>DN,setDistinct:()=>Zw,setDistinctDependencies:()=>ON,setIntersect:()=>vE,setIntersectDependencies:()=>kN,setIsSubset:()=>Qw,setIsSubsetDependencies:()=>AN,setMultiplicity:()=>_T,setMultiplicityDependencies:()=>jN,setPowerset:()=>$w,setPowersetDependencies:()=>MN,setSize:()=>ZT,setSizeDependencies:()=>NN,setSymDifference:()=>vT,setSymDifferenceDependencies:()=>PN,setUnion:()=>AE,setUnionDependencies:()=>FN,sign:()=>jS,signDependencies:()=>MA,simplify:()=>SD,simplifyConstant:()=>hD,simplifyConstantDependencies:()=>hA,simplifyCore:()=>bD,simplifyCoreDependencies:()=>gA,simplifyDependencies:()=>_A,sin:()=>MS,sinDependencies:()=>IA,sinh:()=>oC,sinhDependencies:()=>IN,size:()=>NS,sizeDependencies:()=>wO,slu:()=>Aw,sluDependencies:()=>$j,smaller:()=>YC,smallerDependencies:()=>lk,smallerEq:()=>eT,smallerEqDependencies:()=>hk,solveODE:()=>yE,solveODEDependencies:()=>LN,sort:()=>tT,sortDependencies:()=>RN,sparse:()=>sC,sparseDependencies:()=>zN,speedOfLight:()=>QT,speedOfLightDependencies:()=>BN,splitUnit:()=>FS,splitUnitDependencies:()=>VN,sqrt:()=>cC,sqrtDependencies:()=>Uk,sqrtm:()=>nT,sqrtmDependencies:()=>HN,square:()=>IS,squareDependencies:()=>UN,squeeze:()=>lC,squeezeDependencies:()=>WN,std:()=>IE,stdDependencies:()=>KN,stdTransformDependencies:()=>qN,stefanBoltzmann:()=>$T,stefanBoltzmannDependencies:()=>JN,stirlingS2:()=>bE,stirlingS2Dependencies:()=>BO,string:()=>LS,stringDependencies:()=>YN,subset:()=>Mw,subsetDependencies:()=>HD,subsetTransformDependencies:()=>XN,subtract:()=>XC,subtractDependencies:()=>Wk,subtractScalar:()=>RS,subtractScalarDependencies:()=>DO,sum:()=>Nw,sumDependencies:()=>Gk,sumTransformDependencies:()=>ZN,sylvester:()=>UE,sylvesterDependencies:()=>rM,symbolicEqual:()=>CD,symbolicEqualDependencies:()=>QN,tan:()=>zS,tanDependencies:()=>$N,tanh:()=>uC,tanhDependencies:()=>eP,tau:()=>wx,tauDependencies:()=>ej,thomsonCrossSection:()=>eE,thomsonCrossSectionDependencies:()=>tP,to:()=>ZC,toBest:()=>BS,toBestDependencies:()=>rP,toDependencies:()=>nP,trace:()=>Pw,traceDependencies:()=>iP,transpose:()=>dC,transposeDependencies:()=>aA,trueDependencies:()=>aP,typeOf:()=>VS,typeOfDependencies:()=>Nj,typed:()=>Y,typedDependencies:()=>Q,unaryMinus:()=>jC,unaryMinusDependencies:()=>OO,unaryPlus:()=>QC,unaryPlusDependencies:()=>cA,unequal:()=>rT,unequalDependencies:()=>oP,unit:()=>xE,unitDependencies:()=>sP,usolve:()=>Fw,usolveAll:()=>iT,usolveAllDependencies:()=>RA,usolveDependencies:()=>LA,vacuumImpedance:()=>bT,vacuumImpedanceDependencies:()=>uP,variance:()=>jE,varianceDependencies:()=>GN,varianceTransformDependencies:()=>dP,version:()=>Ex,versionDependencies:()=>fP,weakMixingAngle:()=>Nx,weakMixingAngleDependencies:()=>pP,wienDisplacement:()=>xT,wienDisplacementDependencies:()=>mP,xgcd:()=>fC,xgcdDependencies:()=>Dj,xor:()=>$C,xorDependencies:()=>hP,zeros:()=>pC,zerosDependencies:()=>VD,zeta:()=>LE,zetaDependencies:()=>gP,zpk2tf:()=>Iw,zpk2tfDependencies:()=>_P}),wP=window.__libreArtifactRuntime=window.__libreArtifactRuntime||{modules:{},register(e,t){for(let n of e)this.modules[n]=t},require(e){let t=this.modules[e];if(t===void 0)throw Error(`"`+e+`" is not one of the libraries available to artifacts.`);return t}},TP=CP;wP.register([`mathjs`],TP),window.math=TP})();
|