This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
math.js
3 lines (3 loc) · 717 KB
/
math.js
1
2
3
/*! For license information please see math.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.math=t():e.math=t()}(this,(()=>(()=>{var e={1977:function(e,t){var r;!function(n){"use strict";var i=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},a=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function u(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e/=2,t/=2,.5*Math.log(e*e+t*t)+Math.LN2)}function s(e,t){if(!(this instanceof s))return new s(e,t);var r=function(e,t){var r={re:0,im:0};if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return s.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return s.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):o();break;case"string":r.im=r.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===n&&o();for(var u=0;u<n.length;u++){var c=n[u];" "===c||"\t"===c||"\n"===c||("+"===c?i++:"-"===c?a++:"i"===c||"I"===c?(i+a===0&&o()," "===n[u+1]||isNaN(n[u+1])?r.im+=parseFloat((a%2?"-":"")+"1"):(r.im+=parseFloat((a%2?"-":"")+n[u+1]),u++),i=a=0):((i+a===0||isNaN(c))&&o(),"i"===n[u+1]||"I"===n[u+1]?(r.im+=parseFloat((a%2?"-":"")+c),u++):r.re+=parseFloat((a%2?"-":"")+c),i=a=0))}i+a>0&&o();break;case"number":r.im=0,r.re=e;break;default:o()}return isNaN(r.re)||isNaN(r.im),r}(e,t);this.re=r.re,this.im=r.im}s.prototype={re:0,im:0,sign:function(){var e=this.abs();return new s(this.re/e,this.im/e)},add:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:new s(this.re+r.re,this.im+r.im)},sub:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:new s(this.re-r.re,this.im-r.im)},mul:function(e,t){var r=new s(e,t);return this.isInfinite()&&r.isZero()||this.isZero()&&r.isInfinite()?s.NAN:this.isInfinite()||r.isInfinite()?s.INFINITY:0===r.im&&0===this.im?new s(this.re*r.re,0):new s(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){var r=new s(e,t);if(this.isZero()&&r.isZero()||this.isInfinite()&&r.isInfinite())return s.NAN;if(this.isInfinite()||r.isZero())return s.INFINITY;if(this.isZero()||r.isInfinite())return s.ZERO;e=this.re,t=this.im;var n,i,a=r.re,o=r.im;return 0===o?new s(e/a,t/a):Math.abs(a)<Math.abs(o)?new s((e*(i=a/o)+t)/(n=a*i+o),(t*i-e)/n):new s((e+t*(i=o/a))/(n=o*i+a),(t-e*i)/n)},pow:function(e,t){var r=new s(e,t);if(e=this.re,t=this.im,r.isZero())return s.ONE;if(0===r.im){if(0===t&&e>0)return new s(Math.pow(e,r.re),0);if(0===e)switch((r.re%4+4)%4){case 0:return new s(Math.pow(t,r.re),0);case 1:return new s(0,Math.pow(t,r.re));case 2:return new s(-Math.pow(t,r.re),0);case 3:return new s(0,-Math.pow(t,r.re))}}if(0===e&&0===t&&r.re>0&&r.im>=0)return s.ZERO;var n=Math.atan2(t,e),i=u(e,t);return e=Math.exp(r.re*i-r.im*n),t=r.im*i+r.re*n,new s(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,r=this.re,n=this.im,i=this.abs();if(r>=0){if(0===n)return new s(Math.sqrt(r),0);e=.5*Math.sqrt(2*(i+r))}else e=Math.abs(n)/Math.sqrt(2*(i-r));return t=r<=0?.5*Math.sqrt(2*(i-r)):Math.abs(n)/Math.sqrt(2*(i+r)),new s(e,n<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new s(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new s(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;var r=e*e;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new s(u(e,t),Math.atan2(t,e))},abs:function(){return e=this.re,t=this.im,r=Math.abs(e),n=Math.abs(t),r<3e3&&n<3e3?Math.sqrt(r*r+n*n):(r<n?(r=n,n=e/t):n=t/e,r*Math.sqrt(1+n*n));var e,t,r,n},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new s(Math.sin(e)*i(t),Math.cos(e)*a(t))},cos:function(){var e=this.re,t=this.im;return new s(Math.cos(e)*i(t),-Math.sin(e)*a(t))},tan:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)+i(t);return new s(Math.sin(e)/r,a(t)/r)},cot:function(){var e=2*this.re,t=2*this.im,r=Math.cos(e)-i(t);return new s(-Math.sin(e)/r,a(t)/r)},sec:function(){var e=this.re,t=this.im,r=.5*i(2*t)+.5*Math.cos(2*e);return new s(Math.cos(e)*i(t)/r,Math.sin(e)*a(t)/r)},csc:function(){var e=this.re,t=this.im,r=.5*i(2*t)-.5*Math.cos(2*e);return new s(Math.sin(e)*i(t)/r,-Math.cos(e)*a(t)/r)},asin:function(){var e=this.re,t=this.im,r=new s(t*t-e*e+1,-2*e*t).sqrt(),n=new s(r.re-t,r.im+e).log();return new s(n.im,-n.re)},acos:function(){var e=this.re,t=this.im,r=new s(t*t-e*e+1,-2*e*t).sqrt(),n=new s(r.re-t,r.im+e).log();return new s(Math.PI/2-n.im,n.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new s(0,1/0);if(-1===t)return new s(0,-1/0)}var r=e*e+(1-t)*(1-t),n=new s((1-t*t-e*e)/r,-2*e/r).log();return new s(-.5*n.im,.5*n.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new s(Math.atan2(1,e),0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).atan():new s(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(0,1/0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).acos():new s(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(Math.PI/2,1/0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).asin():new s(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new s(a(e)*Math.cos(t),i(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new s(i(e)*Math.cos(t),a(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,r=i(e)+Math.cos(t);return new s(a(e)/r,Math.sin(t)/r)},coth:function(){var e=2*this.re,t=2*this.im,r=i(e)-Math.cos(t);return new s(a(e)/r,-Math.sin(t)/r)},csch:function(){var e=this.re,t=this.im,r=Math.cos(2*t)-i(2*e);return new s(-2*a(e)*Math.cos(t)/r,2*i(e)*Math.sin(t)/r)},sech:function(){var e=this.re,t=this.im,r=Math.cos(2*t)+i(2*e);return new s(2*i(e)*Math.cos(t)/r,-2*a(e)*Math.sin(t)/r)},asinh:function(){var e=this.im;this.im=-this.re,this.re=e;var t=this.asin();return this.re=-this.im,this.im=e,e=t.re,t.re=-t.im,t.im=e,t},acosh:function(){var e=this.acos();if(e.im<=0){var t=e.re;e.re=-e.im,e.im=t}else t=e.im,e.im=-e.re,e.re=t;return e},atanh:function(){var e=this.re,t=this.im,r=e>1&&0===t,n=1-e,i=1+e,a=n*n+t*t,o=0!==a?new s((i*n-t*t)/a,(t*n+i*t)/a):new s(-1!==e?e/0:0,0!==t?t/0:0),c=o.re;return o.re=u(o.re,o.im)/2,o.im=Math.atan2(o.im,c)/2,r&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new s(0,Math.PI/2);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).atanh():new s(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){var e=this.re,t=this.im;if(0===t)return new s(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).asinh():new s(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return s.INFINITY;var r=e*e+t*t;return 0!==r?new s(e/r,-t/r).acosh():new s(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return s.INFINITY;if(this.isInfinite())return s.ZERO;var e=this.re,t=this.im,r=e*e+t*t;return new s(e/r,-t/r)},conjugate:function(){return new s(this.re,-this.im)},neg:function(){return new s(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new s(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new s(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new s(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var r=new s(e,t);return Math.abs(r.re-this.re)<=s.EPSILON&&Math.abs(r.im-this.im)<=s.EPSILON},clone:function(){return new s(this.re,this.im)},toString:function(){var e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<s.EPSILON&&(e=0),Math.abs(t)<s.EPSILON&&(t=0),0===t?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!(this.isNaN()||this.isFinite())}},s.ZERO=new s(0,0),s.ONE=new s(1,0),s.I=new s(0,1),s.PI=new s(Math.PI,0),s.E=new s(Math.E,0),s.INFINITY=new s(1/0,1/0),s.NAN=new s(NaN,NaN),s.EPSILON=1e-15,void 0===(r=function(){return s}.apply(t,[]))||(e.exports=r)}()},7928:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},r={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},n={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},i=function(e,r){return t({},e,r)};e.exports=function(e){for(var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.preserveFormatting,u=void 0!==o&&o,s=a.escapeMapFn,c=void 0===s?i:s,f=String(e),l="",p=c(t({},r),u?t({},n):{}),m=Object.keys(p),h=function(){var e=!1;m.forEach((function(t,r){e||f.length>=t.length&&f.slice(0,t.length)===t&&(l+=p[m[r]],f=f.slice(t.length,f.length),e=!0)})),e||(l+=f.slice(0,1),f=f.slice(1,f.length))};f;)h();return l}},5628:function(e){!function(t){"use strict";var r={s:1,n:0,d:1};function n(e,t){if(isNaN(e=parseInt(e,10)))throw f();return e*t}function i(e,t){if(0===t)throw c();var r=Object.create(s.prototype);r.s=e<0?-1:1;var n=u(e=e<0?-e:e,t);return r.n=e/n,r.d=t/n,r}function a(e){for(var t={},r=e,n=2,i=4;i<=r;){for(;r%n==0;)r/=n,t[n]=(t[n]||0)+1;i+=1+2*n++}return r!==e?r>1&&(t[r]=(t[r]||0)+1):t[e]=(t[e]||0)+1,t}var o=function(e,t){var i,a=0,o=1,u=1,s=0,p=0,m=0,h=1,d=1,v=0,y=1,g=1,x=1,b=1e7;if(null==e);else if(void 0!==t){if(u=(a=e)*(o=t),a%1!=0||o%1!=0)throw l()}else switch(typeof e){case"object":if("d"in e&&"n"in e)a=e.n,o=e.d,"s"in e&&(a*=e.s);else{if(!(0 in e))throw f();a=e[0],1 in e&&(o=e[1])}u=a*o;break;case"number":if(e<0&&(u=e,e=-e),e%1==0)a=e;else if(e>0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));y<=b&&x<=b;){if(e===(i=(v+g)/(y+x))){y+x<=b?(a=v+g,o=y+x):x>y?(a=g,o=x):(a=v,o=y);break}e>i?(v+=g,y+=x):(g+=v,x+=y),y>b?(a=g,o=x):(a=v,o=y)}a*=d}else(isNaN(e)||isNaN(t))&&(o=a=NaN);break;case"string":if(null===(y=e.match(/\d+|./g)))throw f();if("-"===y[v]?(u=-1,v++):"+"===y[v]&&v++,y.length===v+1?p=n(y[v++],u):"."===y[v+1]||"."===y[v]?("."!==y[v]&&(s=n(y[v++],u)),(1+ ++v===y.length||"("===y[v+1]&&")"===y[v+3]||"'"===y[v+1]&&"'"===y[v+3])&&(p=n(y[v],u),h=Math.pow(10,y[v].length),v++),("("===y[v]&&")"===y[v+2]||"'"===y[v]&&"'"===y[v+2])&&(m=n(y[v+1],u),d=Math.pow(10,y[v+1].length)-1,v+=3)):"/"===y[v+1]||":"===y[v+1]?(p=n(y[v],u),h=n(y[v+2],1),v+=3):"/"===y[v+3]&&" "===y[v+1]&&(s=n(y[v],u),p=n(y[v+2],u),h=n(y[v+4],1),v+=5),y.length<=v){u=a=m+(o=h*d)*s+d*p;break}default:throw f()}if(0===o)throw c();r.s=u<0?-1:1,r.n=Math.abs(a),r.d=Math.abs(o)};function u(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function s(e,t){if(o(e,t),!(this instanceof s))return i(r.s*r.n,r.d);e=u(r.d,r.n),this.s=r.s,this.n=r.n/e,this.d=r.d/e}var c=function(){return new Error("Division by Zero")},f=function(){return new Error("Invalid argument")},l=function(){return new Error("Parameters must be integer")};s.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(e,t){return o(e,t),i(this.s*this.n*r.d+r.s*this.d*r.n,this.d*r.d)},sub:function(e,t){return o(e,t),i(this.s*this.n*r.d-r.s*this.d*r.n,this.d*r.d)},mul:function(e,t){return o(e,t),i(this.s*r.s*this.n*r.n,this.d*r.d)},div:function(e,t){return o(e,t),i(this.s*r.s*this.n*r.d,this.d*r.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(e,t){if(isNaN(this.n)||isNaN(this.d))return new s(NaN);if(void 0===e)return i(this.s*this.n%this.d,1);if(o(e,t),0===r.n&&0===this.d)throw c();return i(this.s*(r.d*this.n)%(r.n*this.d),r.d*this.d)},gcd:function(e,t){return o(e,t),i(u(r.n,this.n)*u(r.d,this.d),r.d*this.d)},lcm:function(e,t){return o(e,t),0===r.n&&0===this.n?i(0,1):i(r.n*this.n,u(r.n,this.n)*u(r.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new s(NaN):i(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new s(NaN):i(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new s(NaN):i(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(e,t){if(o(e,t),1===r.d)return r.s<0?i(Math.pow(this.s*this.d,r.n),Math.pow(this.n,r.n)):i(Math.pow(this.s*this.n,r.n),Math.pow(this.d,r.n));if(this.s<0)return null;var n=a(this.n),u=a(this.d),s=1,c=1;for(var f in n)if("1"!==f){if("0"===f){s=0;break}if(n[f]*=r.n,n[f]%r.d!=0)return null;n[f]/=r.d,s*=Math.pow(f,n[f])}for(var f in u)if("1"!==f){if(u[f]*=r.n,u[f]%r.d!=0)return null;u[f]/=r.d,c*=Math.pow(f,u[f])}return r.s<0?i(c,s):i(s,c)},equals:function(e,t){return o(e,t),this.s*this.n*r.d==r.s*r.n*this.d},compare:function(e,t){o(e,t);var n=this.s*this.n*r.d-r.s*r.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;e=e||.001;for(var t=this.abs(),r=t.toContinued(),n=1;n<r.length;n++){for(var a=i(r[n-1],1),o=n-2;o>=0;o--)a=a.inverse().add(r[o]);if(Math.abs(a.sub(t).valueOf())<e)return a.mul(this.s)}return this},divisible:function(e,t){return o(e,t),!(!(r.n*this.d)||this.n*r.d%(r.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&(t=Math.floor(n/i))>0&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(t)||isNaN(r))return n;do{n.push(Math.floor(t/r)),e=t%r,t=r,r=e}while(1!==t);return n},toString:function(e){var t=this.n,r=this.d;if(isNaN(t)||isNaN(r))return"NaN";e=e||15;var n=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,n>2e3)return 0;return n}(0,r),i=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;t>0;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),a=0;a<300;a++){if(n===i)return a;n=10*n%t,i=10*i%t}return 0}(0,r,n),a=this.s<0?"-":"";if(a+=t/r|0,t%=r,(t*=10)&&(a+="."),n){for(var o=i;o--;)a+=t/r|0,t%=r,t*=10;for(a+="(",o=n;o--;)a+=t/r|0,t%=r,t*=10;a+=")"}else for(o=e;t&&o--;)a+=t/r|0,t%=r,t*=10;return a}},Object.defineProperty(s,"__esModule",{value:!0}),s.default=s,s.Fraction=s,e.exports=s}()},3228:e=>{e.exports=function e(t,r){"use strict";var n,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,s=/^0x[0-9a-f]+$/i,c=/^0/,f=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},l=f(t).replace(o,"")||"",p=f(r).replace(o,"")||"",m=l.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=parseInt(l.match(s),16)||1!==m.length&&l.match(u)&&Date.parse(l),v=parseInt(p.match(s),16)||d&&p.match(u)&&Date.parse(p)||null;if(v){if(d<v)return-1;if(d>v)return 1}for(var y=0,g=Math.max(m.length,h.length);y<g;y++){if(n=!(m[y]||"").match(c)&&parseFloat(m[y])||m[y]||0,i=!(h[y]||"").match(c)&&parseFloat(h[y])||h[y]||0,isNaN(n)!==isNaN(i))return isNaN(n)?1:-1;if(typeof n!=typeof i&&(n+="",i+=""),n<i)return-1;if(n>i)return 1}return 0}},6377:(e,t,r)=>{var n=r(4832),i=r(8652),a=r(801),o=r(2030),u=r(3618),s=r(9049),c=r(1971);c.alea=n,c.xor128=i,c.xorwow=a,c.xorshift7=o,c.xor4096=u,c.tychei=s,e.exports=c},4832:function(e,t,r){var n;!function(e,i,a){function o(e){var t,r=this,n=(t=4022871197,function(e){e=String(e);for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function u(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function s(e,t){var r=new o(e),n=t&&t.state,i=r.next;return i.int32=function(){return 4294967296*r.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.alea=s}(0,e=r.nmd(e),r.amdD)},9049:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this,r="";t.next=function(){var e=t.b,r=t.c,n=t.d,i=t.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^i,i=i-e|0,t.b=e=e<<20^e>>>12^r,t.c=r=r-n|0,t.d=n<<16^r>>>16^i,t.a=i-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)t.b^=0|r.charCodeAt(n),t.next()}function u(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.tychei=s}(0,e=r.nmd(e),r.amdD)},8652:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),t.next()}function u(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xor128=s}(0,e=r.nmd(e),r.amdD)},3618:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this;t.next=function(){var e,r,n=t.w,i=t.X,a=t.i;return t.w=n=n+1640531527|0,r=i[a+34&127],e=i[a=a+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=i[a]=r^e,t.i=a,r+(n^n>>>16)|0},function(e,t){var r,n,i,a,o,u=[],s=128;for(t===(0|t)?(n=t,t=null):(t+="\0",n=0,s=Math.max(s,t.length)),i=0,a=-32;a<s;++a)t&&(n^=t.charCodeAt((a+32)%t.length)),0===a&&(o=n),n^=n<<10,n^=n>>>15,n^=n<<4,n^=n>>>13,a>=0&&(o=o+1640531527|0,i=0==(r=u[127&a]^=n+o)?i+1:0);for(i>=128&&(u[127&(t&&t.length||0)]=-1),i=127,a=512;a>0;--a)n=u[i+34&127],r=u[i=i+1&127],n^=n<<13,r^=r<<17,n^=n>>>15,r^=r>>>12,u[i]=n^r;e.w=o,e.X=u,e.i=i}(t,e)}function u(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function s(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.X&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xor4096=s}(0,e=r.nmd(e),r.amdD)},2030:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this;t.next=function(){var e,r,n=t.x,i=t.i;return e=n[i],r=(e^=e>>>7)^e<<24,r^=(e=n[i+1&7])^e>>>10,r^=(e=n[i+3&7])^e>>>3,r^=(e=n[i+4&7])^e<<7,e=n[i+7&7],r^=(e^=e<<13)^e<<9,n[i]=r,t.i=i+1&7,r},function(e,t){var r,n=[];if(t===(0|t))n[0]=t;else for(t=""+t,r=0;r<t.length;++r)n[7&r]=n[7&r]<<15^t.charCodeAt(r)+n[r+1&7]<<13;for(;n.length<8;)n.push(0);for(r=0;r<8&&0===n[r];++r);for(8==r?n[7]=-1:n[r],e.x=n,e.i=0,r=256;r>0;--r)e.next()}(t,e)}function u(e,t){return t.x=e.x.slice(),t.i=e.i,t}function s(e,t){null==e&&(e=+new Date);var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&(n.x&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xorshift7=s}(0,e=r.nmd(e),r.amdD)},801:function(e,t,r){var n;!function(e,i,a){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:r+=e;for(var n=0;n<r.length+64;n++)t.x^=0|r.charCodeAt(n),n==r.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function u(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function s(e,t){var r=new o(e),n=t&&t.state,i=function(){return(r.next()>>>0)/4294967296};return i.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=r.next,i.quick=i,n&&("object"==typeof n&&u(n,r),i.state=function(){return u(r,{})}),i}i&&i.exports?i.exports=s:r.amdD&&r.amdO?void 0===(n=function(){return s}.call(t,r,t,i))||(i.exports=n):this.xorwow=s}(0,e=r.nmd(e),r.amdD)},1971:function(e,t,r){var n;!function(i,a,o){var u,s=256,c=o.pow(s,6),f=o.pow(2,52),l=2*f,p=s-1;function m(e,t,r){var n=[],p=y(v((t=1==t?{entropy:!0}:t||{}).entropy?[e,g(a)]:null==e?function(){try{var e;return u&&(e=u.randomBytes)?e=e(s):(e=new Uint8Array(s),(i.crypto||i.msCrypto).getRandomValues(e)),g(e)}catch(e){var t=i.navigator,r=t&&t.plugins;return[+new Date,i,r,i.screen,g(a)]}}():e,3),n),m=new h(n),x=function(){for(var e=m.g(6),t=c,r=0;e<f;)e=(e+r)*s,t*=s,r=m.g(1);for(;e>=l;)e/=2,t/=2,r>>>=1;return(e+r)/t};return x.int32=function(){return 0|m.g(4)},x.quick=function(){return m.g(4)/4294967296},x.double=x,y(g(m.S),a),(t.pass||r||function(e,t,r,n){return n&&(n.S&&d(n,m),e.state=function(){return d(m,{})}),r?(o.random=e,t):e})(x,p,"global"in t?t.global:this==o,t.state)}function h(e){var t,r=e.length,n=this,i=0,a=n.i=n.j=0,o=n.S=[];for(r||(e=[r++]);i<s;)o[i]=i++;for(i=0;i<s;i++)o[i]=o[a=p&a+e[i%r]+(t=o[i])],o[a]=t;(n.g=function(e){for(var t,r=0,i=n.i,a=n.j,o=n.S;e--;)t=o[i=p&i+1],r=r*s+o[p&(o[i]=o[a=p&a+t])+(o[a]=t)];return n.i=i,n.j=a,r})(s)}function d(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function v(e,t){var r,n=[],i=typeof e;if(t&&"object"==i)for(r in e)try{n.push(v(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function y(e,t){for(var r,n=e+"",i=0;i<n.length;)t[p&i]=p&(r^=19*t[p&i])+n.charCodeAt(i++);return g(t)}function g(e){return String.fromCharCode.apply(0,e)}if(y(o.random(),a),e.exports){e.exports=m;try{u=r(5042)}catch(e){}}else void 0===(n=function(){return m}.call(t,r,t,e))||(e.exports=n)}("undefined"!=typeof self?self:this,[],Math)},4279:e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var a=0,o=n.length;a<o;a++)n[a].fn!==t&&n[a].fn._!==t&&i.push(n[a]);return i.length?r[e]=i:delete r[e],this}},e.exports=t,e.exports.TinyEmitter=t},5042:()=>{},7061:(e,t,r)=>{var n=r(8698).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},a=Object.prototype,o=a.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",f=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,r){return e[t]=r}}function m(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),o=new _(n||[]);return u(a,"_invoke",{value:F(e,r,o)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=m;var d="suspendedStart",v="suspendedYield",y="executing",g="completed",x={};function b(){}function w(){}function N(){}var D={};p(D,c,(function(){return this}));var E=Object.getPrototypeOf,A=E&&E(E(k([])));A&&A!==a&&o.call(A,c)&&(D=A);var S=N.prototype=b.prototype=Object.create(D);function C(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function M(e,t){function r(i,a,u,s){var c=h(e[i],e,a);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==n(l)&&o.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(l).then((function(e){f.value=e,u(f)}),(function(e){return r("throw",e,u,s)}))}s(c.arg)}var i;u(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(a,a):a()}})}function F(e,r,n){var i=d;return function(a,o){if(i===y)throw new Error("Generator is already running");if(i===g){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var u=n.delegate;if(u){var s=O(u,n);if(s){if(s===x)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===d)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=y;var c=h(e,r,n);if("normal"===c.type){if(i=n.done?g:v,c.arg===x)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}function O(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),x;var a=h(i,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,x;var o=a.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,x):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,x)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function B(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function k(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(o.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(n(e)+" is not iterable")}return w.prototype=N,u(S,"constructor",{value:N,configurable:!0}),u(N,"constructor",{value:w,configurable:!0}),w.displayName=p(N,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,N):(e.__proto__=N,p(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},r.awrap=function(e){return{__await:e}},C(M.prototype),p(M.prototype,f,(function(){return this})),r.AsyncIterator=M,r.async=function(e,t,n,i,a){void 0===a&&(a=Promise);var o=new M(m(e,t,n,i),a);return r.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},C(S),p(S,l,"Generator"),p(S,c,(function(){return this})),p(S,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=k,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(B),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,i){return u.type="throw",u.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,x):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),x},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),B(r),x}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;B(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:k(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),x}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},8698:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},4687:(e,t,r)=>{var n=r(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},509:(e,t,r)=>{"use strict";var n=r(9985),i=r(3691),a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not a function")}},2655:(e,t,r)=>{"use strict";var n=r(9429),i=r(3691),a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not a constructor")}},3550:(e,t,r)=>{"use strict";var n=r(9985),i=String,a=TypeError;e.exports=function(e){if("object"==typeof e||n(e))return e;throw new a("Can't set "+i(e)+" as a prototype")}},7370:(e,t,r)=>{"use strict";var n=r(4201),i=r(5391),a=r(2560).f,o=n("unscopables"),u=Array.prototype;void 0===u[o]&&a(u,o,{configurable:!0,value:i(null)}),e.exports=function(e){u[o][e]=!0}},1514:(e,t,r)=>{"use strict";var n=r(730).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},767:(e,t,r)=>{"use strict";var n=r(3622),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},5027:(e,t,r)=>{"use strict";var n=r(8999),i=String,a=TypeError;e.exports=function(e){if(n(e))return e;throw new a(i(e)+" is not an object")}},1655:(e,t,r)=>{"use strict";var n=r(3689);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},2872:(e,t,r)=>{"use strict";var n=r(690),i=r(7578),a=r(6310);e.exports=function(e){for(var t=n(this),r=a(t),o=arguments.length,u=i(o>1?arguments[1]:void 0,r),s=o>2?arguments[2]:void 0,c=void 0===s?r:i(s,r);c>u;)t[u++]=e;return t}},7612:(e,t,r)=>{"use strict";var n=r(2960).forEach,i=r(6834)("forEach");e.exports=i?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},1055:(e,t,r)=>{"use strict";var n=r(4071),i=r(2615),a=r(690),o=r(1228),u=r(3292),s=r(9429),c=r(6310),f=r(6522),l=r(5185),p=r(1664),m=Array;e.exports=function(e){var t=a(e),r=s(this),h=arguments.length,d=h>1?arguments[1]:void 0,v=void 0!==d;v&&(d=n(d,h>2?arguments[2]:void 0));var y,g,x,b,w,N,D=p(t),E=0;if(!D||this===m&&u(D))for(y=c(t),g=r?new this(y):m(y);y>E;E++)N=v?d(t[E],E):t[E],f(g,E,N);else for(w=(b=l(t,D)).next,g=r?new this:[];!(x=i(w,b)).done;E++)N=v?o(b,d,[x.value,E],!0):x.value,f(g,E,N);return g.length=E,g}},4328:(e,t,r)=>{"use strict";var n=r(5290),i=r(7578),a=r(6310),o=function(e){return function(t,r,o){var u,s=n(t),c=a(s),f=i(o,c);if(e&&r!=r){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((e||f in s)&&s[f]===r)return e||f||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},2960:(e,t,r)=>{"use strict";var n=r(4071),i=r(8844),a=r(4413),o=r(690),u=r(6310),s=r(7120),c=i([].push),f=function(e){var t=1===e,r=2===e,i=3===e,f=4===e,l=6===e,p=7===e,m=5===e||l;return function(h,d,v,y){for(var g,x,b=o(h),w=a(b),N=n(d,v),D=u(w),E=0,A=y||s,S=t?A(h,D):r||p?A(h,0):void 0;D>E;E++)if((m||E in w)&&(x=N(g=w[E],E,b),e))if(t)S[E]=x;else if(x)switch(e){case 3:return!0;case 5:return g;case 6:return E;case 2:c(S,g)}else switch(e){case 4:return!1;case 7:c(S,g)}return l?-1:i||f?f:S}};e.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},9042:(e,t,r)=>{"use strict";var n=r(3689),i=r(4201),a=r(3615),o=i("species");e.exports=function(e){return a>=51||!n((function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},6834:(e,t,r)=>{"use strict";var n=r(3689);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},8820:(e,t,r)=>{"use strict";var n=r(509),i=r(690),a=r(4413),o=r(6310),u=TypeError,s=function(e){return function(t,r,s,c){n(r);var f=i(t),l=a(f),p=o(f),m=e?p-1:0,h=e?-1:1;if(s<2)for(;;){if(m in l){c=l[m],m+=h;break}if(m+=h,e?m<0:p<=m)throw new u("Reduce of empty array with no initial value")}for(;e?m>=0:p>m;m+=h)m in l&&(c=r(c,l[m],m,f));return c}};e.exports={left:s(!1),right:s(!0)}},5649:(e,t,r)=>{"use strict";var n=r(7697),i=r(2297),a=TypeError,o=Object.getOwnPropertyDescriptor,u=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=u?function(e,t){if(i(e)&&!o(e,"length").writable)throw new a("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},9015:(e,t,r)=>{"use strict";var n=r(7578),i=r(6310),a=r(6522),o=Array,u=Math.max;e.exports=function(e,t,r){for(var s=i(e),c=n(t,s),f=n(void 0===r?s:r,s),l=o(u(f-c,0)),p=0;c<f;c++,p++)a(l,p,e[c]);return l.length=p,l}},6004:(e,t,r)=>{"use strict";var n=r(8844);e.exports=n([].slice)},382:(e,t,r)=>{"use strict";var n=r(9015),i=Math.floor,a=function(e,t){var r=e.length,s=i(r/2);return r<8?o(e,t):u(e,a(n(e,0,s),t),a(n(e,s),t),t)},o=function(e,t){for(var r,n,i=e.length,a=1;a<i;){for(n=a,r=e[a];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==a++&&(e[n]=r)}return e},u=function(e,t,r,n){for(var i=t.length,a=r.length,o=0,u=0;o<i||u<a;)e[o+u]=o<i&&u<a?n(t[o],r[u])<=0?t[o++]:r[u++]:o<i?t[o++]:r[u++];return e};e.exports=a},5271:(e,t,r)=>{"use strict";var n=r(2297),i=r(9429),a=r(8999),o=r(4201)("species"),u=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(i(t)&&(t===u||n(t.prototype))||a(t)&&null===(t=t[o]))&&(t=void 0)),void 0===t?u:t}},7120:(e,t,r)=>{"use strict";var n=r(5271);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},1228:(e,t,r)=>{"use strict";var n=r(5027),i=r(2125);e.exports=function(e,t,r,a){try{return a?t(n(r)[0],r[1]):t(r)}catch(t){i(e,"throw",t)}}},6431:(e,t,r)=>{"use strict";var n=r(4201)("iterator"),i=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){i=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!i)return!1}catch(e){return!1}var r=!1;try{var a={};a[n]=function(){return{next:function(){return{done:r=!0}}}},e(a)}catch(e){}return r}},6648:(e,t,r)=>{"use strict";var n=r(8844),i=n({}.toString),a=n("".slice);e.exports=function(e){return a(i(e),8,-1)}},926:(e,t,r)=>{"use strict";var n=r(3043),i=r(9985),a=r(6648),o=r(4201)("toStringTag"),u=Object,s="Arguments"===a(function(){return arguments}());e.exports=n?a:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=u(e),o))?r:s?a(t):"Object"===(n=a(t))&&i(t.callee)?"Arguments":n}},800:(e,t,r)=>{"use strict";var n=r(5391),i=r(2148),a=r(6045),o=r(4071),u=r(767),s=r(981),c=r(8734),f=r(1934),l=r(7807),p=r(4241),m=r(7697),h=r(5375).fastKey,d=r(618),v=d.set,y=d.getterFor;e.exports={getConstructor:function(e,t,r,f){var l=e((function(e,i){u(e,p),v(e,{type:t,index:n(null),first:void 0,last:void 0,size:0}),m||(e.size=0),s(i)||c(i,e[f],{that:e,AS_ENTRIES:r})})),p=l.prototype,d=y(t),g=function(e,t,r){var n,i,a=d(e),o=x(e,t);return o?o.value=r:(a.last=o={index:i=h(t,!0),key:t,value:r,previous:n=a.last,next:void 0,removed:!1},a.first||(a.first=o),n&&(n.next=o),m?a.size++:e.size++,"F"!==i&&(a.index[i]=o)),e},x=function(e,t){var r,n=d(e),i=h(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key===t)return r};return a(p,{clear:function(){for(var e=d(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,m?e.size=0:this.size=0},delete:function(e){var t=this,r=d(t),n=x(t,e);if(n){var i=n.next,a=n.previous;delete r.index[n.index],n.removed=!0,a&&(a.next=i),i&&(i.previous=a),r.first===n&&(r.first=i),r.last===n&&(r.last=a),m?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=d(this),n=o(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!x(this,e)}}),a(p,r?{get:function(e){var t=x(this,e);return t&&t.value},set:function(e,t){return g(this,0===e?0:e,t)}}:{add:function(e){return g(this,e=0===e?0:e,e)}}),m&&i(p,"size",{configurable:!0,get:function(){return d(this).size}}),l},setStrong:function(e,t,r){var n=t+" Iterator",i=y(t),a=y(n);f(e,t,(function(e,t){v(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=a(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?l("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=void 0,l(void 0,!0))}),r?"entries":"values",!r,!0),p(t)}}},319:(e,t,r)=>{"use strict";var n=r(9989),i=r(9037),a=r(8844),o=r(5266),u=r(1880),s=r(5375),c=r(8734),f=r(767),l=r(9985),p=r(981),m=r(8999),h=r(3689),d=r(6431),v=r(5997),y=r(3457);e.exports=function(e,t,r){var g=-1!==e.indexOf("Map"),x=-1!==e.indexOf("Weak"),b=g?"set":"add",w=i[e],N=w&&w.prototype,D=w,E={},A=function(e){var t=a(N[e]);u(N,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(x&&!m(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return x&&!m(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(x&&!m(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(o(e,!l(w)||!(x||N.forEach&&!h((function(){(new w).entries().next()})))))D=r.getConstructor(t,e,g,b),s.enable();else if(o(e,!0)){var S=new D,C=S[b](x?{}:-0,1)!==S,M=h((function(){S.has(1)})),F=d((function(e){new w(e)})),O=!x&&h((function(){for(var e=new w,t=5;t--;)e[b](t,t);return!e.has(-0)}));F||((D=t((function(e,t){f(e,N);var r=y(new w,e,D);return p(t)||c(t,r[b],{that:r,AS_ENTRIES:g}),r}))).prototype=N,N.constructor=D),(M||O)&&(A("delete"),A("has"),g&&A("get")),(O||C)&&A(b),x&&N.clear&&delete N.clear}return E[e]=D,n({global:!0,constructor:!0,forced:D!==w},E),v(D,e),x||r.setStrong(D,e,g),D}},8758:(e,t,r)=>{"use strict";var n=r(6812),i=r(9152),a=r(2474),o=r(2560);e.exports=function(e,t,r){for(var u=i(t),s=o.f,c=a.f,f=0;f<u.length;f++){var l=u[f];n(e,l)||r&&n(r,l)||s(e,l,c(t,l))}}},7413:(e,t,r)=>{"use strict";var n=r(4201)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},1748:(e,t,r)=>{"use strict";var n=r(3689);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},1568:(e,t,r)=>{"use strict";var n=r(8844),i=r(4684),a=r(4327),o=/"/g,u=n("".replace);e.exports=function(e,t,r,n){var s=a(i(e)),c="<"+t;return""!==r&&(c+=" "+r+'="'+u(a(n),o,""")+'"'),c+">"+s+"</"+t+">"}},7807:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},5773:(e,t,r)=>{"use strict";var n=r(7697),i=r(2560),a=r(5684);e.exports=n?function(e,t,r){return i.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},5684:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6522:(e,t,r)=>{"use strict";var n=r(8360),i=r(2560),a=r(5684);e.exports=function(e,t,r){var o=n(t);o in e?i.f(e,o,a(0,r)):e[o]=r}},2148:(e,t,r)=>{"use strict";var n=r(8702),i=r(2560);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},1880:(e,t,r)=>{"use strict";var n=r(9985),i=r(2560),a=r(8702),o=r(5014);e.exports=function(e,t,r,u){u||(u={});var s=u.enumerable,c=void 0!==u.name?u.name:t;if(n(r)&&a(r,c,u),u.global)s?e[t]=r:o(t,r);else{try{u.unsafe?e[t]&&(s=!0):delete e[t]}catch(e){}s?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return e}},6045:(e,t,r)=>{"use strict";var n=r(1880);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},5014:(e,t,r)=>{"use strict";var n=r(9037),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},8494:(e,t,r)=>{"use strict";var n=r(3691),i=TypeError;e.exports=function(e,t){if(!delete e[t])throw new i("Cannot delete property "+n(t)+" of "+n(e))}},7697:(e,t,r)=>{"use strict";var n=r(3689);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},2659:e=>{"use strict";var t="object"==typeof document&&document.all,r=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:r}},6420:(e,t,r)=>{"use strict";var n=r(9037),i=r(8999),a=n.document,o=i(a)&&i(a.createElement);e.exports=function(e){return o?a.createElement(e):{}}},5565:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6338:e=>{"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},3265:(e,t,r)=>{"use strict";var n=r(6420)("span").classList,i=n&&n.constructor&&n.constructor.prototype;e.exports=i===Object.prototype?void 0:i},7365:(e,t,r)=>{"use strict";var n=r(71).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},2532:(e,t,r)=>{"use strict";var n=r(8563),i=r(806);e.exports=!n&&!i&&"object"==typeof window&&"object"==typeof document},8563:e=>{"use strict";e.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},7298:(e,t,r)=>{"use strict";var n=r(71);e.exports=/MSIE|Trident/.test(n)},3221:(e,t,r)=>{"use strict";var n=r(71);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},4764:(e,t,r)=>{"use strict";var n=r(71);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},806:(e,t,r)=>{"use strict";var n=r(9037),i=r(6648);e.exports="process"===i(n.process)},7486:(e,t,r)=>{"use strict";var n=r(71);e.exports=/web0s(?!.*chrome)/i.test(n)},71:e=>{"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3615:(e,t,r)=>{"use strict";var n,i,a=r(9037),o=r(71),u=a.process,s=a.Deno,c=u&&u.versions||s&&s.version,f=c&&c.v8;f&&(i=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(i=+n[1]),e.exports=i},7922:(e,t,r)=>{"use strict";var n=r(71).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},2739:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},9989:(e,t,r)=>{"use strict";var n=r(9037),i=r(2474).f,a=r(5773),o=r(1880),u=r(5014),s=r(8758),c=r(5266);e.exports=function(e,t){var r,f,l,p,m,h=e.target,d=e.global,v=e.stat;if(r=d?n:v?n[h]||u(h,{}):(n[h]||{}).prototype)for(f in t){if(p=t[f],l=e.dontCallGetSet?(m=i(r,f))&&m.value:r[f],!c(d?f:h+(v?".":"#")+f,e.forced)&&void 0!==l){if(typeof p==typeof l)continue;s(p,l)}(e.sham||l&&l.sham)&&a(p,"sham",!0),o(r,f,p,e)}}},3689:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},8678:(e,t,r)=>{"use strict";r(4043);var n=r(6576),i=r(1880),a=r(6308),o=r(3689),u=r(4201),s=r(5773),c=u("species"),f=RegExp.prototype;e.exports=function(e,t,r,l){var p=u(e),m=!o((function(){var t={};return t[p]=function(){return 7},7!==""[e](t)})),h=m&&!o((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[c]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!m||!h||r){var d=n(/./[p]),v=t(p,""[e],(function(e,t,r,i,o){var u=n(e),s=t.exec;return s===a||s===f.exec?m&&!o?{done:!0,value:d(t,r,i)}:{done:!0,value:u(r,t,i)}:{done:!1}}));i(String.prototype,e,v[0]),i(f,p,v[1])}l&&s(f[p],"sham",!0)}},1594:(e,t,r)=>{"use strict";var n=r(3689);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},1735:(e,t,r)=>{"use strict";var n=r(7215),i=Function.prototype,a=i.apply,o=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(a):function(){return o.apply(a,arguments)})},4071:(e,t,r)=>{"use strict";var n=r(6576),i=r(509),a=r(7215),o=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:a?o(e,t):function(){return e.apply(t,arguments)}}},7215:(e,t,r)=>{"use strict";var n=r(3689);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},6761:(e,t,r)=>{"use strict";var n=r(8844),i=r(509),a=r(8999),o=r(6812),u=r(6004),s=r(7215),c=Function,f=n([].concat),l=n([].join),p={};e.exports=s?c.bind:function(e){var t=i(this),r=t.prototype,n=u(arguments,1),s=function(){var r=f(n,u(arguments));return this instanceof s?function(e,t,r){if(!o(p,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";p[t]=c("C,a","return new C("+l(n,",")+")")}return p[t](e,r)}(t,r.length,r):t.apply(e,r)};return a(r)&&(s.prototype=r),s}},2615:(e,t,r)=>{"use strict";var n=r(7215),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},1236:(e,t,r)=>{"use strict";var n=r(7697),i=r(6812),a=Function.prototype,o=n&&Object.getOwnPropertyDescriptor,u=i(a,"name"),s=u&&"something"===function(){}.name,c=u&&(!n||n&&o(a,"name").configurable);e.exports={EXISTS:u,PROPER:s,CONFIGURABLE:c}},2743:(e,t,r)=>{"use strict";var n=r(8844),i=r(509);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},6576:(e,t,r)=>{"use strict";var n=r(6648),i=r(8844);e.exports=function(e){if("Function"===n(e))return i(e)}},8844:(e,t,r)=>{"use strict";var n=r(7215),i=Function.prototype,a=i.call,o=n&&i.bind.bind(a,a);e.exports=n?o:function(e){return function(){return a.apply(e,arguments)}}},6058:(e,t,r)=>{"use strict";var n=r(9037),i=r(9985);e.exports=function(e,t){return arguments.length<2?(r=n[e],i(r)?r:void 0):n[e]&&n[e][t];var r}},1664:(e,t,r)=>{"use strict";var n=r(926),i=r(4849),a=r(981),o=r(9478),u=r(4201)("iterator");e.exports=function(e){if(!a(e))return i(e,u)||i(e,"@@iterator")||o[n(e)]}},5185:(e,t,r)=>{"use strict";var n=r(2615),i=r(509),a=r(5027),o=r(3691),u=r(1664),s=TypeError;e.exports=function(e,t){var r=arguments.length<2?u(e):t;if(i(r))return a(n(r,e));throw new s(o(e)+" is not iterable")}},2643:(e,t,r)=>{"use strict";var n=r(8844),i=r(2297),a=r(9985),o=r(6648),u=r(4327),s=n([].push);e.exports=function(e){if(a(e))return e;if(i(e)){for(var t=e.length,r=[],n=0;n<t;n++){var c=e[n];"string"==typeof c?s(r,c):"number"!=typeof c&&"Number"!==o(c)&&"String"!==o(c)||s(r,u(c))}var f=r.length,l=!0;return function(e,t){if(l)return l=!1,t;if(i(this))return t;for(var n=0;n<f;n++)if(r[n]===e)return t}}}},4849:(e,t,r)=>{"use strict";var n=r(509),i=r(981);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},7017:(e,t,r)=>{"use strict";var n=r(8844),i=r(690),a=Math.floor,o=n("".charAt),u=n("".replace),s=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,f=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,r,n,l,p){var m=r+e.length,h=n.length,d=f;return void 0!==l&&(l=i(l),d=c),u(p,d,(function(i,u){var c;switch(o(u,0)){case"$":return"$";case"&":return e;case"`":return s(t,0,r);case"'":return s(t,m);case"<":c=l[s(u,1,-1)];break;default:var f=+u;if(0===f)return i;if(f>h){var p=a(f/10);return 0===p?i:p<=h?void 0===n[p-1]?o(u,1):n[p-1]+o(u,1):i}c=n[f-1]}return void 0===c?"":c}))}},9037:function(e){"use strict";var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof global&&global)||function(){return this}()||this||Function("return this")()},6812:(e,t,r)=>{"use strict";var n=r(8844),i=r(690),a=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return a(i(e),t)}},7248:e=>{"use strict";e.exports={}},920:e=>{"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},2688:(e,t,r)=>{"use strict";var n=r(6058);e.exports=n("document","documentElement")},8506:(e,t,r)=>{"use strict";var n=r(7697),i=r(3689),a=r(6420);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},4413:(e,t,r)=>{"use strict";var n=r(8844),i=r(3689),a=r(6648),o=Object,u=n("".split);e.exports=i((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"===a(e)?u(e,""):o(e)}:o},3457:(e,t,r)=>{"use strict";var n=r(9985),i=r(8999),a=r(9385);e.exports=function(e,t,r){var o,u;return a&&n(o=t.constructor)&&o!==r&&i(u=o.prototype)&&u!==r.prototype&&a(e,u),e}},6738:(e,t,r)=>{"use strict";var n=r(8844),i=r(9985),a=r(4091),o=n(Function.toString);i(a.inspectSource)||(a.inspectSource=function(e){return o(e)}),e.exports=a.inspectSource},5375:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(7248),o=r(8999),u=r(6812),s=r(2560).f,c=r(2741),f=r(6062),l=r(7049),p=r(4630),m=r(1594),h=!1,d=p("meta"),v=0,y=function(e){s(e,d,{value:{objectID:"O"+v++,weakData:{}}})},g=e.exports={enable:function(){g.enable=function(){},h=!0;var e=c.f,t=i([].splice),r={};r[d]=1,e(r).length&&(c.f=function(r){for(var n=e(r),i=0,a=n.length;i<a;i++)if(n[i]===d){t(n,i,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:f.f}))},fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!u(e,d)){if(!l(e))return"F";if(!t)return"E";y(e)}return e[d].objectID},getWeakData:function(e,t){if(!u(e,d)){if(!l(e))return!0;if(!t)return!1;y(e)}return e[d].weakData},onFreeze:function(e){return m&&h&&l(e)&&!u(e,d)&&y(e),e}};a[d]=!0},618:(e,t,r)=>{"use strict";var n,i,a,o=r(9834),u=r(9037),s=r(8999),c=r(5773),f=r(6812),l=r(4091),p=r(2713),m=r(7248),h="Object already initialized",d=u.TypeError,v=u.WeakMap;if(o||l.state){var y=l.state||(l.state=new v);y.get=y.get,y.has=y.has,y.set=y.set,n=function(e,t){if(y.has(e))throw new d(h);return t.facade=e,y.set(e,t),t},i=function(e){return y.get(e)||{}},a=function(e){return y.has(e)}}else{var g=p("state");m[g]=!0,n=function(e,t){if(f(e,g))throw new d(h);return t.facade=e,c(e,g,t),t},i=function(e){return f(e,g)?e[g]:{}},a=function(e){return f(e,g)}}e.exports={set:n,get:i,has:a,enforce:function(e){return a(e)?i(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!s(t)||(r=i(t)).type!==e)throw new d("Incompatible receiver, "+e+" required");return r}}}},3292:(e,t,r)=>{"use strict";var n=r(4201),i=r(9478),a=n("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},2297:(e,t,r)=>{"use strict";var n=r(6648);e.exports=Array.isArray||function(e){return"Array"===n(e)}},9985:(e,t,r)=>{"use strict";var n=r(2659),i=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===i}:function(e){return"function"==typeof e}},9429:(e,t,r)=>{"use strict";var n=r(8844),i=r(3689),a=r(9985),o=r(926),u=r(6058),s=r(6738),c=function(){},f=[],l=u("Reflect","construct"),p=/^\s*(?:class|function)\b/,m=n(p.exec),h=!p.test(c),d=function(e){if(!a(e))return!1;try{return l(c,f,e),!0}catch(e){return!1}},v=function(e){if(!a(e))return!1;switch(o(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!m(p,s(e))}catch(e){return!0}};v.sham=!0,e.exports=!l||i((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?v:d},5266:(e,t,r)=>{"use strict";var n=r(3689),i=r(9985),a=/#|\.prototype\./,o=function(e,t){var r=s[u(e)];return r===f||r!==c&&(i(t)?n(t):!!t)},u=o.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=o.data={},c=o.NATIVE="N",f=o.POLYFILL="P";e.exports=o},981:e=>{"use strict";e.exports=function(e){return null==e}},8999:(e,t,r)=>{"use strict";var n=r(9985),i=r(2659),a=i.all;e.exports=i.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===a}:function(e){return"object"==typeof e?null!==e:n(e)}},3931:e=>{"use strict";e.exports=!1},1245:(e,t,r)=>{"use strict";var n=r(8999),i=r(6648),a=r(4201)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[a])?!!t:"RegExp"===i(e))}},734:(e,t,r)=>{"use strict";var n=r(6058),i=r(9985),a=r(3622),o=r(9525),u=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&a(t.prototype,u(e))}},8734:(e,t,r)=>{"use strict";var n=r(4071),i=r(2615),a=r(5027),o=r(3691),u=r(3292),s=r(6310),c=r(3622),f=r(5185),l=r(1664),p=r(2125),m=TypeError,h=function(e,t){this.stopped=e,this.result=t},d=h.prototype;e.exports=function(e,t,r){var v,y,g,x,b,w,N,D=r&&r.that,E=!(!r||!r.AS_ENTRIES),A=!(!r||!r.IS_RECORD),S=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),M=n(t,D),F=function(e){return v&&p(v,"normal",e),new h(!0,e)},O=function(e){return E?(a(e),C?M(e[0],e[1],F):M(e[0],e[1])):C?M(e,F):M(e)};if(A)v=e.iterator;else if(S)v=e;else{if(!(y=l(e)))throw new m(o(e)+" is not iterable");if(u(y)){for(g=0,x=s(e);x>g;g++)if((b=O(e[g]))&&c(d,b))return b;return new h(!1)}v=f(e,y)}for(w=A?e.next:v.next;!(N=i(w,v)).done;){try{b=O(N.value)}catch(e){p(v,"throw",e)}if("object"==typeof b&&b&&c(d,b))return b}return new h(!1)}},2125:(e,t,r)=>{"use strict";var n=r(2615),i=r(5027),a=r(4849);e.exports=function(e,t,r){var o,u;i(e);try{if(!(o=a(e,"return"))){if("throw"===t)throw r;return r}o=n(o,e)}catch(e){u=!0,o=e}if("throw"===t)throw r;if(u)throw o;return i(o),r}},974:(e,t,r)=>{"use strict";var n=r(2013).IteratorPrototype,i=r(5391),a=r(5684),o=r(5997),u=r(9478),s=function(){return this};e.exports=function(e,t,r,c){var f=t+" Iterator";return e.prototype=i(n,{next:a(+!c,r)}),o(e,f,!1,!0),u[f]=s,e}},1934:(e,t,r)=>{"use strict";var n=r(9989),i=r(2615),a=r(3931),o=r(1236),u=r(9985),s=r(974),c=r(1868),f=r(9385),l=r(5997),p=r(5773),m=r(1880),h=r(4201),d=r(9478),v=r(2013),y=o.PROPER,g=o.CONFIGURABLE,x=v.IteratorPrototype,b=v.BUGGY_SAFARI_ITERATORS,w=h("iterator"),N="keys",D="values",E="entries",A=function(){return this};e.exports=function(e,t,r,o,h,v,S){s(r,t,o);var C,M,F,O=function(e){if(e===h&&I)return I;if(!b&&e&&e in _)return _[e];switch(e){case N:case D:case E:return function(){return new r(this,e)}}return function(){return new r(this)}},T=t+" Iterator",B=!1,_=e.prototype,k=_[w]||_["@@iterator"]||h&&_[h],I=!b&&k||O(h),R="Array"===t&&_.entries||k;if(R&&(C=c(R.call(new e)))!==Object.prototype&&C.next&&(a||c(C)===x||(f?f(C,x):u(C[w])||m(C,w,A)),l(C,T,!0,!0),a&&(d[T]=A)),y&&h===D&&k&&k.name!==D&&(!a&&g?p(_,"name",D):(B=!0,I=function(){return i(k,this)})),h)if(M={values:O(D),keys:v?I:O(N),entries:O(E)},S)for(F in M)(b||B||!(F in _))&&m(_,F,M[F]);else n({target:t,proto:!0,forced:b||B},M);return a&&!S||_[w]===I||m(_,w,I,{name:h}),d[t]=I,M}},2013:(e,t,r)=>{"use strict";var n,i,a,o=r(3689),u=r(9985),s=r(8999),c=r(5391),f=r(1868),l=r(1880),p=r(4201),m=r(3931),h=p("iterator"),d=!1;[].keys&&("next"in(a=[].keys())?(i=f(f(a)))!==Object.prototype&&(n=i):d=!0),!s(n)||o((function(){var e={};return n[h].call(e)!==e}))?n={}:m&&(n=c(n)),u(n[h])||l(n,h,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:d}},9478:e=>{"use strict";e.exports={}},6310:(e,t,r)=>{"use strict";var n=r(3126);e.exports=function(e){return n(e.length)}},8702:(e,t,r)=>{"use strict";var n=r(8844),i=r(3689),a=r(9985),o=r(6812),u=r(7697),s=r(1236).CONFIGURABLE,c=r(6738),f=r(618),l=f.enforce,p=f.get,m=String,h=Object.defineProperty,d=n("".slice),v=n("".replace),y=n([].join),g=u&&!i((function(){return 8!==h((function(){}),"length",{value:8}).length})),x=String(String).split("String"),b=e.exports=function(e,t,r){"Symbol("===d(m(t),0,7)&&(t="["+v(m(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!o(e,"name")||s&&e.name!==t)&&(u?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&r&&o(r,"arity")&&e.length!==r.arity&&h(e,"length",{value:r.arity});try{r&&o(r,"constructor")&&r.constructor?u&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=l(e);return o(n,"source")||(n.source=y(x,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return a(this)&&p(this).source||c(this)}),"toString")},1745:e=>{"use strict";var t=Math.expm1,r=Math.exp;e.exports=!t||t(10)>22025.465794806718||t(10)<22025.465794806718||-2e-17!==t(-2e-17)?function(e){var t=+e;return 0===t?t:t>-1e-6&&t<1e-6?t+t*t/2:r(t)-1}:t},4736:e=>{"use strict";var t=Math.log,r=Math.LOG10E;e.exports=Math.log10||function(e){return t(e)*r}},3956:e=>{"use strict";var t=Math.log;e.exports=Math.log1p||function(e){var r=+e;return r>-1e-8&&r<1e-8?r-r*r/2:t(1+r)}},5680:e=>{"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},8828:e=>{"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},231:(e,t,r)=>{"use strict";var n,i,a,o,u,s=r(9037),c=r(4071),f=r(2474).f,l=r(9886).set,p=r(4410),m=r(4764),h=r(3221),d=r(7486),v=r(806),y=s.MutationObserver||s.WebKitMutationObserver,g=s.document,x=s.process,b=s.Promise,w=f(s,"queueMicrotask"),N=w&&w.value;if(!N){var D=new p,E=function(){var e,t;for(v&&(e=x.domain)&&e.exit();t=D.get();)try{t()}catch(e){throw D.head&&n(),e}e&&e.enter()};m||v||d||!y||!g?!h&&b&&b.resolve?((o=b.resolve(void 0)).constructor=b,u=c(o.then,o),n=function(){u(E)}):v?n=function(){x.nextTick(E)}:(l=c(l,s),n=function(){l(E)}):(i=!0,a=g.createTextNode(""),new y(E).observe(a,{characterData:!0}),n=function(){a.data=i=!i}),N=function(e){D.head||n(),D.add(e)}}e.exports=N},2582:(e,t,r)=>{"use strict";var n=r(509),i=TypeError,a=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new i("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new a(e)}},2124:(e,t,r)=>{"use strict";var n=r(1245),i=TypeError;e.exports=function(e){if(n(e))throw new i("The method doesn't accept regular expressions");return e}},4818:(e,t,r)=>{"use strict";var n=r(9037),i=r(3689),a=r(8844),o=r(4327),u=r(1435).trim,s=r(6350),c=a("".charAt),f=n.parseFloat,l=n.Symbol,p=l&&l.iterator,m=1/f(s+"-0")!=-1/0||p&&!i((function(){f(Object(p))}));e.exports=m?function(e){var t=u(o(e)),r=f(t);return 0===r&&"-"===c(t,0)?-0:r}:f},7897:(e,t,r)=>{"use strict";var n=r(9037),i=r(3689),a=r(8844),o=r(4327),u=r(1435).trim,s=r(6350),c=n.parseInt,f=n.Symbol,l=f&&f.iterator,p=/^[+-]?0x/i,m=a(p.exec),h=8!==c(s+"08")||22!==c(s+"0x16")||l&&!i((function(){c(Object(l))}));e.exports=h?function(e,t){var r=u(o(e));return c(r,t>>>0||(m(p,r)?16:10))}:c},5391:(e,t,r)=>{"use strict";var n,i=r(5027),a=r(8920),o=r(2739),u=r(7248),s=r(2688),c=r(6420),f=r(2713),l="prototype",p="script",m=f("IE_PROTO"),h=function(){},d=function(e){return"<"+p+">"+e+"</"+p+">"},v=function(e){e.write(d("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;y="undefined"!=typeof document?document.domain&&n?v(n):(t=c("iframe"),r="java"+p+":",t.style.display="none",s.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(d("document.F=Object")),e.close(),e.F):v(n);for(var i=o.length;i--;)delete y[l][o[i]];return y()};u[m]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(h[l]=i(e),r=new h,h[l]=null,r[m]=e):r=y(),void 0===t?r:a.f(r,t)}},8920:(e,t,r)=>{"use strict";var n=r(7697),i=r(5648),a=r(2560),o=r(5027),u=r(5290),s=r(300);t.f=n&&!i?Object.defineProperties:function(e,t){o(e);for(var r,n=u(t),i=s(t),c=i.length,f=0;c>f;)a.f(e,r=i[f++],n[r]);return e}},2560:(e,t,r)=>{"use strict";var n=r(7697),i=r(8506),a=r(5648),o=r(5027),u=r(8360),s=TypeError,c=Object.defineProperty,f=Object.getOwnPropertyDescriptor,l="enumerable",p="configurable",m="writable";t.f=n?a?function(e,t,r){if(o(e),t=u(t),o(r),"function"==typeof e&&"prototype"===t&&"value"in r&&m in r&&!r[m]){var n=f(e,t);n&&n[m]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:l in r?r[l]:n[l],writable:!1})}return c(e,t,r)}:c:function(e,t,r){if(o(e),t=u(t),o(r),i)try{return c(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new s("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},2474:(e,t,r)=>{"use strict";var n=r(7697),i=r(2615),a=r(9556),o=r(5684),u=r(5290),s=r(8360),c=r(6812),f=r(8506),l=Object.getOwnPropertyDescriptor;t.f=n?l:function(e,t){if(e=u(e),t=s(t),f)try{return l(e,t)}catch(e){}if(c(e,t))return o(!i(a.f,e,t),e[t])}},6062:(e,t,r)=>{"use strict";var n=r(6648),i=r(5290),a=r(2741).f,o=r(9015),u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return u&&"Window"===n(e)?function(e){try{return a(e)}catch(e){return o(u)}}(e):a(i(e))}},2741:(e,t,r)=>{"use strict";var n=r(4948),i=r(2739).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,i)}},7518:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},1868:(e,t,r)=>{"use strict";var n=r(6812),i=r(9985),a=r(690),o=r(2713),u=r(1748),s=o("IE_PROTO"),c=Object,f=c.prototype;e.exports=u?c.getPrototypeOf:function(e){var t=a(e);if(n(t,s))return t[s];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof c?f:null}},7049:(e,t,r)=>{"use strict";var n=r(3689),i=r(8999),a=r(6648),o=r(1655),u=Object.isExtensible,s=n((function(){u(1)}));e.exports=s||o?function(e){return!!i(e)&&(!o||"ArrayBuffer"!==a(e))&&(!u||u(e))}:u},3622:(e,t,r)=>{"use strict";var n=r(8844);e.exports=n({}.isPrototypeOf)},4948:(e,t,r)=>{"use strict";var n=r(8844),i=r(6812),a=r(5290),o=r(4328).indexOf,u=r(7248),s=n([].push);e.exports=function(e,t){var r,n=a(e),c=0,f=[];for(r in n)!i(u,r)&&i(n,r)&&s(f,r);for(;t.length>c;)i(n,r=t[c++])&&(~o(f,r)||s(f,r));return f}},300:(e,t,r)=>{"use strict";var n=r(4948),i=r(2739);e.exports=Object.keys||function(e){return n(e,i)}},9556:(e,t)=>{"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,i=n&&!r.call({1:2},1);t.f=i?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},9385:(e,t,r)=>{"use strict";var n=r(2743),i=r(5027),a=r(3550);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i(r),a(n),t?e(r,n):r.__proto__=n,r}}():void 0)},5073:(e,t,r)=>{"use strict";var n=r(3043),i=r(926);e.exports=n?{}.toString:function(){return"[object "+i(this)+"]"}},5899:(e,t,r)=>{"use strict";var n=r(2615),i=r(9985),a=r(8999),o=TypeError;e.exports=function(e,t){var r,u;if("string"===t&&i(r=e.toString)&&!a(u=n(r,e)))return u;if(i(r=e.valueOf)&&!a(u=n(r,e)))return u;if("string"!==t&&i(r=e.toString)&&!a(u=n(r,e)))return u;throw new o("Can't convert object to primitive value")}},9152:(e,t,r)=>{"use strict";var n=r(6058),i=r(8844),a=r(2741),o=r(7518),u=r(5027),s=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=a.f(u(e)),r=o.f;return r?s(t,r(e)):t}},496:(e,t,r)=>{"use strict";var n=r(9037);e.exports=n},9302:e=>{"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},7073:(e,t,r)=>{"use strict";var n=r(9037),i=r(7919),a=r(9985),o=r(5266),u=r(6738),s=r(4201),c=r(2532),f=r(8563),l=r(3931),p=r(3615),m=i&&i.prototype,h=s("species"),d=!1,v=a(n.PromiseRejectionEvent),y=o("Promise",(function(){var e=u(i),t=e!==String(i);if(!t&&66===p)return!0;if(l&&(!m.catch||!m.finally))return!0;if(!p||p<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[h]=n,!(d=r.then((function(){}))instanceof n))return!0}return!t&&(c||f)&&!v}));e.exports={CONSTRUCTOR:y,REJECTION_EVENT:v,SUBCLASSING:d}},7919:(e,t,r)=>{"use strict";var n=r(9037);e.exports=n.Promise},2945:(e,t,r)=>{"use strict";var n=r(5027),i=r(8999),a=r(2582);e.exports=function(e,t){if(n(e),i(t)&&t.constructor===e)return t;var r=a.f(e);return(0,r.resolve)(t),r.promise}},562:(e,t,r)=>{"use strict";var n=r(7919),i=r(6431),a=r(7073).CONSTRUCTOR;e.exports=a||!i((function(e){n.all(e).then(void 0,(function(){}))}))},8055:(e,t,r)=>{"use strict";var n=r(2560).f;e.exports=function(e,t,r){r in e||n(e,r,{configurable:!0,get:function(){return t[r]},set:function(e){t[r]=e}})}},4410:e=>{"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},6100:(e,t,r)=>{"use strict";var n=r(2615),i=r(5027),a=r(9985),o=r(6648),u=r(6308),s=TypeError;e.exports=function(e,t){var r=e.exec;if(a(r)){var c=n(r,e,t);return null!==c&&i(c),c}if("RegExp"===o(e))return n(u,e,t);throw new s("RegExp#exec called on incompatible receiver")}},6308:(e,t,r)=>{"use strict";var n,i,a=r(2615),o=r(8844),u=r(4327),s=r(9633),c=r(7901),f=r(3430),l=r(5391),p=r(618).get,m=r(2100),h=r(6422),d=f("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,y=v,g=o("".charAt),x=o("".indexOf),b=o("".replace),w=o("".slice),N=(i=/b*/g,a(v,n=/a/,"a"),a(v,i,"a"),0!==n.lastIndex||0!==i.lastIndex),D=c.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];(N||E||D||m||h)&&(y=function(e){var t,r,n,i,o,c,f,m=this,h=p(m),A=u(e),S=h.raw;if(S)return S.lastIndex=m.lastIndex,t=a(y,S,A),m.lastIndex=S.lastIndex,t;var C=h.groups,M=D&&m.sticky,F=a(s,m),O=m.source,T=0,B=A;if(M&&(F=b(F,"y",""),-1===x(F,"g")&&(F+="g"),B=w(A,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==g(A,m.lastIndex-1))&&(O="(?: "+O+")",B=" "+B,T++),r=new RegExp("^(?:"+O+")",F)),E&&(r=new RegExp("^"+O+"$(?!\\s)",F)),N&&(n=m.lastIndex),i=a(v,M?r:m,B),M?i?(i.input=w(i.input,T),i[0]=w(i[0],T),i.index=m.lastIndex,m.lastIndex+=i[0].length):m.lastIndex=0:N&&i&&(m.lastIndex=m.global?i.index+i[0].length:n),E&&i&&i.length>1&&a(d,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&C)for(i.groups=c=l(null),o=0;o<C.length;o++)c[(f=C[o])[0]]=i[f[1]];return i}),e.exports=y},9633:(e,t,r)=>{"use strict";var n=r(5027);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},3477:(e,t,r)=>{"use strict";var n=r(2615),i=r(6812),a=r(3622),o=r(9633),u=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in u||i(e,"flags")||!a(u,e)?t:n(o,e)}},7901:(e,t,r)=>{"use strict";var n=r(3689),i=r(9037).RegExp,a=n((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),o=a||n((function(){return!i("a","y").sticky})),u=a||n((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:u,MISSED_STICKY:o,UNSUPPORTED_Y:a}},2100:(e,t,r)=>{"use strict";var n=r(3689),i=r(9037).RegExp;e.exports=n((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},6422:(e,t,r)=>{"use strict";var n=r(3689),i=r(9037).RegExp;e.exports=n((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},4684:(e,t,r)=>{"use strict";var n=r(981),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},4241:(e,t,r)=>{"use strict";var n=r(6058),i=r(2148),a=r(4201),o=r(7697),u=a("species");e.exports=function(e){var t=n(e);o&&t&&!t[u]&&i(t,u,{configurable:!0,get:function(){return this}})}},5997:(e,t,r)=>{"use strict";var n=r(2560).f,i=r(6812),a=r(4201)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i(e,a)&&n(e,a,{configurable:!0,value:t})}},2713:(e,t,r)=>{"use strict";var n=r(3430),i=r(4630),a=n("keys");e.exports=function(e){return a[e]||(a[e]=i(e))}},4091:(e,t,r)=>{"use strict";var n=r(9037),i=r(5014),a="__core-js_shared__",o=n[a]||i(a,{});e.exports=o},3430:(e,t,r)=>{"use strict";var n=r(3931),i=r(4091);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.33.2",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"})},6373:(e,t,r)=>{"use strict";var n=r(5027),i=r(2655),a=r(981),o=r(4201)("species");e.exports=function(e,t){var r,u=n(e).constructor;return void 0===u||a(r=n(u)[o])?t:i(r)}},4580:(e,t,r)=>{"use strict";var n=r(3689);e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},730:(e,t,r)=>{"use strict";var n=r(8844),i=r(8700),a=r(4327),o=r(4684),u=n("".charAt),s=n("".charCodeAt),c=n("".slice),f=function(e){return function(t,r){var n,f,l=a(o(t)),p=i(r),m=l.length;return p<0||p>=m?e?"":void 0:(n=s(l,p))<55296||n>56319||p+1===m||(f=s(l,p+1))<56320||f>57343?e?u(l,p):n:e?c(l,p,p+2):f-56320+(n-55296<<10)+65536}};e.exports={codeAt:f(!1),charAt:f(!0)}},534:(e,t,r)=>{"use strict";var n=r(8700),i=r(4327),a=r(4684),o=RangeError;e.exports=function(e){var t=i(a(this)),r="",u=n(e);if(u<0||u===1/0)throw new o("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(t+=t))1&u&&(r+=t);return r}},5984:(e,t,r)=>{"use strict";var n=r(1236).PROPER,i=r(3689),a=r(6350);e.exports=function(e){return i((function(){return!!a[e]()||"
"!=="
"[e]()||n&&a[e].name!==e}))}},1435:(e,t,r)=>{"use strict";var n=r(8844),i=r(4684),a=r(4327),o=r(6350),u=n("".replace),s=RegExp("^["+o+"]+"),c=RegExp("(^|[^"+o+"])["+o+"]+$"),f=function(e){return function(t){var r=a(i(t));return 1&e&&(r=u(r,s,"")),2&e&&(r=u(r,c,"$1")),r}};e.exports={start:f(1),end:f(2),trim:f(3)}},146:(e,t,r)=>{"use strict";var n=r(3615),i=r(3689),a=r(9037).String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!a(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},3032:(e,t,r)=>{"use strict";var n=r(2615),i=r(6058),a=r(4201),o=r(1880);e.exports=function(){var e=i("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,u=a("toPrimitive");t&&!t[u]&&o(t,u,(function(e){return n(r,this)}),{arity:1})}},6549:(e,t,r)=>{"use strict";var n=r(146);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},9886:(e,t,r)=>{"use strict";var n,i,a,o,u=r(9037),s=r(1735),c=r(4071),f=r(9985),l=r(6812),p=r(3689),m=r(2688),h=r(6004),d=r(6420),v=r(1500),y=r(4764),g=r(806),x=u.setImmediate,b=u.clearImmediate,w=u.process,N=u.Dispatch,D=u.Function,E=u.MessageChannel,A=u.String,S=0,C={},M="onreadystatechange";p((function(){n=u.location}));var F=function(e){if(l(C,e)){var t=C[e];delete C[e],t()}},O=function(e){return function(){F(e)}},T=function(e){F(e.data)},B=function(e){u.postMessage(A(e),n.protocol+"//"+n.host)};x&&b||(x=function(e){v(arguments.length,1);var t=f(e)?e:D(e),r=h(arguments,1);return C[++S]=function(){s(t,void 0,r)},i(S),S},b=function(e){delete C[e]},g?i=function(e){w.nextTick(O(e))}:N&&N.now?i=function(e){N.now(O(e))}:E&&!y?(o=(a=new E).port2,a.port1.onmessage=T,i=c(o.postMessage,o)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&"file:"!==n.protocol&&!p(B)?(i=B,u.addEventListener("message",T,!1)):i=M in d("script")?function(e){m.appendChild(d("script"))[M]=function(){m.removeChild(this),F(e)}}:function(e){setTimeout(O(e),0)}),e.exports={set:x,clear:b}},3648:(e,t,r)=>{"use strict";var n=r(8844);e.exports=n(1..valueOf)},7578:(e,t,r)=>{"use strict";var n=r(8700),i=Math.max,a=Math.min;e.exports=function(e,t){var r=n(e);return r<0?i(r+t,0):a(r,t)}},5290:(e,t,r)=>{"use strict";var n=r(4413),i=r(4684);e.exports=function(e){return n(i(e))}},8700:(e,t,r)=>{"use strict";var n=r(8828);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},3126:(e,t,r)=>{"use strict";var n=r(8700),i=Math.min;e.exports=function(e){return e>0?i(n(e),9007199254740991):0}},690:(e,t,r)=>{"use strict";var n=r(4684),i=Object;e.exports=function(e){return i(n(e))}},8732:(e,t,r)=>{"use strict";var n=r(2615),i=r(8999),a=r(734),o=r(4849),u=r(5899),s=r(4201),c=TypeError,f=s("toPrimitive");e.exports=function(e,t){if(!i(e)||a(e))return e;var r,s=o(e,f);if(s){if(void 0===t&&(t="default"),r=n(s,e,t),!i(r)||a(r))return r;throw new c("Can't convert object to primitive value")}return void 0===t&&(t="number"),u(e,t)}},8360:(e,t,r)=>{"use strict";var n=r(8732),i=r(734);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},3043:(e,t,r)=>{"use strict";var n={};n[r(4201)("toStringTag")]="z",e.exports="[object z]"===String(n)},4327:(e,t,r)=>{"use strict";var n=r(926),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},3691:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},4630:(e,t,r)=>{"use strict";var n=r(8844),i=0,a=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++i+a,36)}},9525:(e,t,r)=>{"use strict";var n=r(146);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},5648:(e,t,r)=>{"use strict";var n=r(7697),i=r(3689);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},1500:e=>{"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},9834:(e,t,r)=>{"use strict";var n=r(9037),i=r(9985),a=n.WeakMap;e.exports=i(a)&&/native code/.test(String(a))},5405:(e,t,r)=>{"use strict";var n=r(496),i=r(6812),a=r(6145),o=r(2560).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});i(t,e)||o(t,e,{value:a.f(e)})}},6145:(e,t,r)=>{"use strict";var n=r(4201);t.f=n},4201:(e,t,r)=>{"use strict";var n=r(9037),i=r(3430),a=r(6812),o=r(4630),u=r(146),s=r(9525),c=n.Symbol,f=i("wks"),l=s?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return a(f,e)||(f[e]=u&&a(c,e)?c[e]:l("Symbol."+e)),f[e]}},6350:e=>{"use strict";e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},4338:(e,t,r)=>{"use strict";var n=r(9989),i=r(3689),a=r(2297),o=r(8999),u=r(690),s=r(6310),c=r(5565),f=r(6522),l=r(7120),p=r(9042),m=r(4201),h=r(3615),d=m("isConcatSpreadable"),v=h>=51||!i((function(){var e=[];return e[d]=!1,e.concat()[0]!==e})),y=function(e){if(!o(e))return!1;var t=e[d];return void 0!==t?!!t:a(e)};n({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(e){var t,r,n,i,a,o=u(this),p=l(o,0),m=0;for(t=-1,n=arguments.length;t<n;t++)if(y(a=-1===t?o:arguments[t]))for(i=s(a),c(m+i),r=0;r<i;r++,m++)r in a&&f(p,m,a[r]);else c(m+1),f(p,m++,a);return p.length=m,p}})},5791:(e,t,r)=>{"use strict";var n=r(9989),i=r(2960).every;n({target:"Array",proto:!0,forced:!r(6834)("every")},{every:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},7895:(e,t,r)=>{"use strict";var n=r(9989),i=r(2872),a=r(7370);n({target:"Array",proto:!0},{fill:i}),a("fill")},8077:(e,t,r)=>{"use strict";var n=r(9989),i=r(2960).filter;n({target:"Array",proto:!0,forced:!r(9042)("filter")},{filter:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5728:(e,t,r)=>{"use strict";var n=r(9989),i=r(2960).find,a=r(7370),o="find",u=!0;o in[]&&Array(1)[o]((function(){u=!1})),n({target:"Array",proto:!0,forced:u},{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),a(o)},9693:(e,t,r)=>{"use strict";var n=r(9989),i=r(7612);n({target:"Array",proto:!0,forced:[].forEach!==i},{forEach:i})},7722:(e,t,r)=>{"use strict";var n=r(9989),i=r(1055);n({target:"Array",stat:!0,forced:!r(6431)((function(e){Array.from(e)}))},{from:i})},6801:(e,t,r)=>{"use strict";var n=r(9989),i=r(4328).includes,a=r(3689),o=r(7370);n({target:"Array",proto:!0,forced:a((function(){return!Array(1).includes()}))},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},7195:(e,t,r)=>{"use strict";var n=r(9989),i=r(6576),a=r(4328).indexOf,o=r(6834),u=i([].indexOf),s=!!u&&1/u([1],1,-0)<0;n({target:"Array",proto:!0,forced:s||!o("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return s?u(this,e,t)||0:a(this,e,t)}})},3975:(e,t,r)=>{"use strict";r(9989)({target:"Array",stat:!0},{isArray:r(2297)})},752:(e,t,r)=>{"use strict";var n=r(5290),i=r(7370),a=r(9478),o=r(618),u=r(2560).f,s=r(1934),c=r(7807),f=r(3931),l=r(7697),p="Array Iterator",m=o.set,h=o.getterFor(p);e.exports=s(Array,"Array",(function(e,t){m(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=h(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,c(void 0,!0);switch(e.kind){case"keys":return c(r,!1);case"values":return c(t[r],!1)}return c([r,t[r]],!1)}),"values");var d=a.Arguments=a.Array;if(i("keys"),i("values"),i("entries"),!f&&l&&"values"!==d.name)try{u(d,"name",{value:"values"})}catch(e){}},6203:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(4413),o=r(5290),u=r(6834),s=i([].join);n({target:"Array",proto:!0,forced:a!==Object||!u("join",",")},{join:function(e){return s(o(this),void 0===e?",":e)}})},886:(e,t,r)=>{"use strict";var n=r(9989),i=r(2960).map;n({target:"Array",proto:!0,forced:!r(9042)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},278:(e,t,r)=>{"use strict";var n=r(9989),i=r(8820).left,a=r(6834),o=r(3615);n({target:"Array",proto:!0,forced:!r(806)&&o>79&&o<83||!a("reduce")},{reduce:function(e){var t=arguments.length;return i(this,e,t,t>1?arguments[1]:void 0)}})},3374:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(2297),o=i([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function(){return a(this)&&(this.length=this.length),o(this)}})},9730:(e,t,r)=>{"use strict";var n=r(9989),i=r(2297),a=r(9429),o=r(8999),u=r(7578),s=r(6310),c=r(5290),f=r(6522),l=r(4201),p=r(9042),m=r(6004),h=p("slice"),d=l("species"),v=Array,y=Math.max;n({target:"Array",proto:!0,forced:!h},{slice:function(e,t){var r,n,l,p=c(this),h=s(p),g=u(e,h),x=u(void 0===t?h:t,h);if(i(p)&&(r=p.constructor,(a(r)&&(r===v||i(r.prototype))||o(r)&&null===(r=r[d]))&&(r=void 0),r===v||void 0===r))return m(p,g,x);for(n=new(void 0===r?v:r)(y(x-g,0)),l=0;g<x;g++,l++)g in p&&f(n,l,p[g]);return n.length=l,n}})},8742:(e,t,r)=>{"use strict";var n=r(9989),i=r(2960).some;n({target:"Array",proto:!0,forced:!r(6834)("some")},{some:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},5137:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(509),o=r(690),u=r(6310),s=r(8494),c=r(4327),f=r(3689),l=r(382),p=r(6834),m=r(7365),h=r(7298),d=r(3615),v=r(7922),y=[],g=i(y.sort),x=i(y.push),b=f((function(){y.sort(void 0)})),w=f((function(){y.sort(null)})),N=p("sort"),D=!f((function(){if(d)return d<70;if(!(m&&m>3)){if(h)return!0;if(v)return v<603;var e,t,r,n,i="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)y.push({k:t+n,v:r})}for(y.sort((function(e,t){return t.v-e.v})),n=0;n<y.length;n++)t=y[n].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));n({target:"Array",proto:!0,forced:b||!w||!N||!D},{sort:function(e){void 0!==e&&a(e);var t=o(this);if(D)return void 0===e?g(t):g(t,e);var r,n,i=[],f=u(t);for(n=0;n<f;n++)n in t&&x(i,t[n]);for(l(i,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:c(t)>c(r)?1:-1}}(e)),r=u(i),n=0;n<r;)t[n]=i[n++];for(;n<f;)s(t,n++);return t}})},2506:(e,t,r)=>{"use strict";var n=r(9989),i=r(690),a=r(7578),o=r(8700),u=r(6310),s=r(5649),c=r(5565),f=r(7120),l=r(6522),p=r(8494),m=r(9042)("splice"),h=Math.max,d=Math.min;n({target:"Array",proto:!0,forced:!m},{splice:function(e,t){var r,n,m,v,y,g,x=i(this),b=u(x),w=a(e,b),N=arguments.length;for(0===N?r=n=0:1===N?(r=0,n=b-w):(r=N-2,n=d(h(o(t),0),b-w)),c(b+r-n),m=f(x,n),v=0;v<n;v++)(y=w+v)in x&&l(m,v,x[y]);if(m.length=n,r<n){for(v=w;v<b-n;v++)g=v+r,(y=v+n)in x?x[g]=x[y]:p(x,g);for(v=b;v>b-n+r;v--)p(x,v-1)}else if(r>n)for(v=b-n;v>w;v--)g=v+r-1,(y=v+n-1)in x?x[g]=x[y]:p(x,g);for(v=0;v<r;v++)x[v+w]=arguments[v+2];return s(x,b-n+r),m}})},2227:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=Date,o=i(a.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return o(new a)}})},8150:(e,t,r)=>{"use strict";var n=r(9989),i=r(3689),a=r(690),o=r(8732);n({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=a(this),r=o(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},24:(e,t,r)=>{"use strict";var n=r(8844),i=r(1880),a=Date.prototype,o="Invalid Date",u="toString",s=n(a[u]),c=n(a.getTime);String(new Date(NaN))!==o&&i(a,u,(function(){var e=c(this);return e==e?s(this):o}))},1517:(e,t,r)=>{"use strict";var n=r(9989),i=r(6761);n({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},4284:(e,t,r)=>{"use strict";var n=r(7697),i=r(1236).EXISTS,a=r(8844),o=r(2148),u=Function.prototype,s=a(u.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,f=a(c.exec);n&&!i&&o(u,"name",{configurable:!0,get:function(){try{return f(c,s(this))[1]}catch(e){return""}}})},8324:(e,t,r)=>{"use strict";var n=r(9989),i=r(6058),a=r(1735),o=r(2615),u=r(8844),s=r(3689),c=r(9985),f=r(734),l=r(6004),p=r(2643),m=r(146),h=String,d=i("JSON","stringify"),v=u(/./.exec),y=u("".charAt),g=u("".charCodeAt),x=u("".replace),b=u(1..toString),w=/[\uD800-\uDFFF]/g,N=/^[\uD800-\uDBFF]$/,D=/^[\uDC00-\uDFFF]$/,E=!m||s((function(){var e=i("Symbol")("stringify detection");return"[null]"!==d([e])||"{}"!==d({a:e})||"{}"!==d(Object(e))})),A=s((function(){return'"\\udf06\\ud834"'!==d("\udf06\ud834")||'"\\udead"'!==d("\udead")})),S=function(e,t){var r=l(arguments),n=p(t);if(c(n)||void 0!==e&&!f(e))return r[1]=function(e,t){if(c(n)&&(t=o(n,this,h(e),t)),!f(t))return t},a(d,null,r)},C=function(e,t,r){var n=y(r,t-1),i=y(r,t+1);return v(N,e)&&!v(D,i)||v(D,e)&&!v(N,n)?"\\u"+b(g(e,0),16):e};d&&n({target:"JSON",stat:!0,arity:3,forced:E||A},{stringify:function(e,t,r){var n=l(arguments),i=a(E?S:d,null,n);return A&&"string"==typeof i?x(i,w,C):i}})},9322:(e,t,r)=>{"use strict";r(319)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(800))},6646:(e,t,r)=>{"use strict";r(9322)},6557:(e,t,r)=>{"use strict";var n=r(9989),i=r(3956),a=Math.acosh,o=Math.log,u=Math.sqrt,s=Math.LN2;n({target:"Math",stat:!0,forced:!a||710!==Math.floor(a(Number.MAX_VALUE))||a(1/0)!==1/0},{acosh:function(e){var t=+e;return t<1?NaN:t>94906265.62425156?o(t)+s:i(t-1+u(t-1)*u(t+1))}})},2428:(e,t,r)=>{"use strict";var n=r(9989),i=Math.asinh,a=Math.log,o=Math.sqrt;n({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function e(t){var r=+t;return isFinite(r)&&0!==r?r<0?-e(-r):a(r+o(r*r+1)):r}})},5263:(e,t,r)=>{"use strict";var n=r(9989),i=Math.atanh,a=Math.log;n({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(e){var t=+e;return 0===t?t:a((1+t)/(1-t))/2}})},4712:(e,t,r)=>{"use strict";var n=r(9989),i=r(5680),a=Math.abs,o=Math.pow;n({target:"Math",stat:!0},{cbrt:function(e){var t=+e;return i(t)*o(a(t),1/3)}})},7221:(e,t,r)=>{"use strict";var n=r(9989),i=r(1745),a=Math.cosh,o=Math.abs,u=Math.E;n({target:"Math",stat:!0,forced:!a||a(710)===1/0},{cosh:function(e){var t=i(o(e)-1)+1;return(t+1/(t*u*u))*(u/2)}})},4992:(e,t,r)=>{"use strict";var n=r(9989),i=r(1745);n({target:"Math",stat:!0,forced:i!==Math.expm1},{expm1:i})},5239:(e,t,r)=>{"use strict";r(9989)({target:"Math",stat:!0},{log10:r(4736)})},2076:(e,t,r)=>{"use strict";r(9989)({target:"Math",stat:!0},{log1p:r(3956)})},8813:(e,t,r)=>{"use strict";var n=r(9989),i=Math.log,a=Math.LN2;n({target:"Math",stat:!0},{log2:function(e){return i(e)/a}})},6976:(e,t,r)=>{"use strict";r(9989)({target:"Math",stat:!0},{sign:r(5680)})},2700:(e,t,r)=>{"use strict";var n=r(9989),i=r(3689),a=r(1745),o=Math.abs,u=Math.exp,s=Math.E;n({target:"Math",stat:!0,forced:i((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(e){var t=+e;return o(t)<1?(a(t)-a(-t))/2:(u(t-1)-u(-t-1))*(s/2)}})},1554:(e,t,r)=>{"use strict";var n=r(9989),i=r(1745),a=Math.exp;n({target:"Math",stat:!0},{tanh:function(e){var t=+e,r=i(t),n=i(-t);return r===1/0?1:n===1/0?-1:(r-n)/(a(t)+a(-t))}})},9288:(e,t,r)=>{"use strict";var n=r(9989),i=r(3931),a=r(7697),o=r(9037),u=r(496),s=r(8844),c=r(5266),f=r(6812),l=r(3457),p=r(3622),m=r(734),h=r(8732),d=r(3689),v=r(2741).f,y=r(2474).f,g=r(2560).f,x=r(3648),b=r(1435).trim,w="Number",N=o[w],D=u[w],E=N.prototype,A=o.TypeError,S=s("".slice),C=s("".charCodeAt),M=c(w,!N(" 0o1")||!N("0b1")||N("+0x1")),F=function(e){var t,r=arguments.length<1?0:N(function(e){var t=h(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,i,a,o,u,s,c=h(e,"number");if(m(c))throw new A("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=b(c),43===(t=C(c,0))||45===t){if(88===(r=C(c,2))||120===r)return NaN}else if(48===t){switch(C(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(o=(a=S(c,2)).length,u=0;u<o;u++)if((s=C(a,u))<48||s>i)return NaN;return parseInt(a,n)}return+c}(t)}(e));return p(E,t=this)&&d((function(){x(t)}))?l(Object(r),this,F):r};F.prototype=E,M&&!i&&(E.constructor=F),n({global:!0,constructor:!0,wrap:!0,forced:M},{Number:F});var O=function(e,t){for(var r,n=a?v(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;n.length>i;i++)f(t,r=n[i])&&!f(e,r)&&g(e,r,y(t,r))};i&&D&&O(u[w],D),(M||i)&&O(u[w],N)},3584:(e,t,r)=>{"use strict";r(9989)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},5993:(e,t,r)=>{"use strict";r(9989)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},7389:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(8700),o=r(3648),u=r(534),s=r(3689),c=RangeError,f=String,l=Math.floor,p=i(u),m=i("".slice),h=i(1..toFixed),d=function(e,t,r){return 0===t?r:t%2==1?d(e,t-1,r*e):d(e*e,t/2,r)},v=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=l(i/1e7)},y=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=l(n/t),n=n%t*1e7},g=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=f(e[t]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:s((function(){return"0.000"!==h(8e-5,3)||"1"!==h(.9,0)||"1.25"!==h(1.255,2)||"1000000000000000128"!==h(0xde0b6b3a7640080,0)}))||!s((function(){h({})}))},{toFixed:function(e){var t,r,n,i,u=o(this),s=a(e),l=[0,0,0,0,0,0],h="",x="0";if(s<0||s>20)throw new c("Incorrect fraction digits");if(u!=u)return"NaN";if(u<=-1e21||u>=1e21)return f(u);if(u<0&&(h="-",u=-u),u>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(u*d(2,69,1))-69)<0?u*d(2,-t,1):u/d(2,t,1),r*=4503599627370496,(t=52-t)>0){for(v(l,0,r),n=s;n>=7;)v(l,1e7,0),n-=7;for(v(l,d(10,n,1),0),n=t-1;n>=23;)y(l,1<<23),n-=23;y(l,1<<n),v(l,1,1),y(l,2),x=g(l)}else v(l,0,r),v(l,1<<-t,0),x=g(l)+p("0",s);return s>0?h+((i=x.length)<=s?"0."+p("0",s-i)+x:m(x,0,i-s)+"."+m(x,i-s)):h+x}})},5284:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(3689),o=r(3648),u=i(1..toPrecision);n({target:"Number",proto:!0,forced:a((function(){return"1"!==u(1,void 0)}))||!a((function(){u({})}))},{toPrecision:function(e){return void 0===e?u(o(this)):u(o(this),e)}})},1013:(e,t,r)=>{"use strict";r(9989)({target:"Object",stat:!0,sham:!r(7697)},{create:r(5391)})},5082:(e,t,r)=>{"use strict";var n=r(9989),i=r(7697),a=r(8920).f;n({target:"Object",stat:!0,forced:Object.defineProperties!==a,sham:!i},{defineProperties:a})},739:(e,t,r)=>{"use strict";var n=r(9989),i=r(7697),a=r(2560).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==a,sham:!i},{defineProperty:a})},1919:(e,t,r)=>{"use strict";var n=r(9989),i=r(3689),a=r(5290),o=r(2474).f,u=r(7697);n({target:"Object",stat:!0,forced:!u||i((function(){o(1)})),sham:!u},{getOwnPropertyDescriptor:function(e,t){return o(a(e),t)}})},9474:(e,t,r)=>{"use strict";var n=r(9989),i=r(7697),a=r(9152),o=r(5290),u=r(2474),s=r(6522);n({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(e){for(var t,r,n=o(e),i=u.f,c=a(n),f={},l=0;c.length>l;)void 0!==(r=i(n,t=c[l++]))&&s(f,t,r);return f}})},9434:(e,t,r)=>{"use strict";var n=r(9989),i=r(146),a=r(3689),o=r(7518),u=r(690);n({target:"Object",stat:!0,forced:!i||a((function(){o.f(1)}))},{getOwnPropertySymbols:function(e){var t=o.f;return t?t(u(e)):[]}})},8052:(e,t,r)=>{"use strict";var n=r(9989),i=r(3689),a=r(690),o=r(1868),u=r(1748);n({target:"Object",stat:!0,forced:i((function(){o(1)})),sham:!u},{getPrototypeOf:function(e){return o(a(e))}})},9358:(e,t,r)=>{"use strict";var n=r(9989),i=r(690),a=r(300);n({target:"Object",stat:!0,forced:r(3689)((function(){a(1)}))},{keys:function(e){return a(i(e))}})},228:(e,t,r)=>{"use strict";var n=r(3043),i=r(1880),a=r(5073);n||i(Object.prototype,"toString",a,{unsafe:!0})},939:(e,t,r)=>{"use strict";var n=r(9989),i=r(4818);n({global:!0,forced:parseFloat!==i},{parseFloat:i})},2320:(e,t,r)=>{"use strict";var n=r(9989),i=r(7897);n({global:!0,forced:parseInt!==i},{parseInt:i})},1692:(e,t,r)=>{"use strict";var n=r(9989),i=r(2615),a=r(509),o=r(2582),u=r(9302),s=r(8734);n({target:"Promise",stat:!0,forced:r(562)},{all:function(e){var t=this,r=o.f(t),n=r.resolve,c=r.reject,f=u((function(){var r=a(t.resolve),o=[],u=0,f=1;s(e,(function(e){var a=u++,s=!1;f++,i(r,t,e).then((function(e){s||(s=!0,o[a]=e,--f||n(o))}),c)})),--f||n(o)}));return f.error&&c(f.value),r.promise}})},5089:(e,t,r)=>{"use strict";var n=r(9989),i=r(3931),a=r(7073).CONSTRUCTOR,o=r(7919),u=r(6058),s=r(9985),c=r(1880),f=o&&o.prototype;if(n({target:"Promise",proto:!0,forced:a,real:!0},{catch:function(e){return this.then(void 0,e)}}),!i&&s(o)){var l=u("Promise").prototype.catch;f.catch!==l&&c(f,"catch",l,{unsafe:!0})}},6697:(e,t,r)=>{"use strict";var n,i,a,o=r(9989),u=r(3931),s=r(806),c=r(9037),f=r(2615),l=r(1880),p=r(9385),m=r(5997),h=r(4241),d=r(509),v=r(9985),y=r(8999),g=r(767),x=r(6373),b=r(9886).set,w=r(231),N=r(920),D=r(9302),E=r(4410),A=r(618),S=r(7919),C=r(7073),M=r(2582),F="Promise",O=C.CONSTRUCTOR,T=C.REJECTION_EVENT,B=C.SUBCLASSING,_=A.getterFor(F),k=A.set,I=S&&S.prototype,R=S,z=I,q=c.TypeError,j=c.document,P=c.process,L=M.f,U=L,$=!!(j&&j.createEvent&&c.dispatchEvent),H="unhandledrejection",G=function(e){var t;return!(!y(e)||!v(t=e.then))&&t},V=function(e,t){var r,n,i,a=t.value,o=1===t.state,u=o?e.ok:e.fail,s=e.resolve,c=e.reject,l=e.domain;try{u?(o||(2===t.rejection&&X(t),t.rejection=1),!0===u?r=a:(l&&l.enter(),r=u(a),l&&(l.exit(),i=!0)),r===e.promise?c(new q("Promise-chain cycle")):(n=G(r))?f(n,r,s,c):s(r)):c(a)}catch(e){l&&!i&&l.exit(),c(e)}},Z=function(e,t){e.notified||(e.notified=!0,w((function(){for(var r,n=e.reactions;r=n.get();)V(r,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},W=function(e,t,r){var n,i;$?((n=j.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),c.dispatchEvent(n)):n={promise:t,reason:r},!T&&(i=c["on"+e])?i(n):e===H&&N("Unhandled promise rejection",r)},Y=function(e){f(b,c,(function(){var t,r=e.facade,n=e.value;if(J(e)&&(t=D((function(){s?P.emit("unhandledRejection",n,r):W(H,r,n)})),e.rejection=s||J(e)?2:1,t.error))throw t.value}))},J=function(e){return 1!==e.rejection&&!e.parent},X=function(e){f(b,c,(function(){var t=e.facade;s?P.emit("rejectionHandled",t):W("rejectionhandled",t,e.value)}))},Q=function(e,t,r){return function(n){e(t,n,r)}},K=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Z(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new q("Promise can't be resolved itself");var n=G(t);n?w((function(){var r={done:!1};try{f(n,t,Q(ee,r,e),Q(K,r,e))}catch(t){K(r,t,e)}})):(e.value=t,e.state=1,Z(e,!1))}catch(t){K({done:!1},t,e)}}};if(O&&(z=(R=function(e){g(this,z),d(e),f(n,this);var t=_(this);try{e(Q(ee,t),Q(K,t))}catch(e){K(t,e)}}).prototype,(n=function(e){k(this,{type:F,done:!1,notified:!1,parent:!1,reactions:new E,rejection:!1,state:0,value:void 0})}).prototype=l(z,"then",(function(e,t){var r=_(this),n=L(x(this,R));return r.parent=!0,n.ok=!v(e)||e,n.fail=v(t)&&t,n.domain=s?P.domain:void 0,0===r.state?r.reactions.add(n):w((function(){V(n,r)})),n.promise})),i=function(){var e=new n,t=_(e);this.promise=e,this.resolve=Q(ee,t),this.reject=Q(K,t)},M.f=L=function(e){return e===R||void 0===e?new i(e):U(e)},!u&&v(S)&&I!==Object.prototype)){a=I.then,B||l(I,"then",(function(e,t){var r=this;return new R((function(e,t){f(a,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete I.constructor}catch(e){}p&&p(I,z)}o({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:R}),m(R,F,!1,!0),h(F)},3964:(e,t,r)=>{"use strict";r(6697),r(1692),r(5089),r(8829),r(2092),r(7905)},8829:(e,t,r)=>{"use strict";var n=r(9989),i=r(2615),a=r(509),o=r(2582),u=r(9302),s=r(8734);n({target:"Promise",stat:!0,forced:r(562)},{race:function(e){var t=this,r=o.f(t),n=r.reject,c=u((function(){var o=a(t.resolve);s(e,(function(e){i(o,t,e).then(r.resolve,n)}))}));return c.error&&n(c.value),r.promise}})},2092:(e,t,r)=>{"use strict";var n=r(9989),i=r(2615),a=r(2582);n({target:"Promise",stat:!0,forced:r(7073).CONSTRUCTOR},{reject:function(e){var t=a.f(this);return i(t.reject,void 0,e),t.promise}})},7905:(e,t,r)=>{"use strict";var n=r(9989),i=r(6058),a=r(3931),o=r(7919),u=r(7073).CONSTRUCTOR,s=r(2945),c=i("Promise"),f=a&&!u;n({target:"Promise",stat:!0,forced:a||u},{resolve:function(e){return s(f&&this===c?o:this,e)}})},50:(e,t,r)=>{"use strict";var n=r(9989),i=r(6058),a=r(1735),o=r(6761),u=r(2655),s=r(5027),c=r(8999),f=r(5391),l=r(3689),p=i("Reflect","construct"),m=Object.prototype,h=[].push,d=l((function(){function e(){}return!(p((function(){}),[],e)instanceof e)})),v=!l((function(){p((function(){}))})),y=d||v;n({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){u(e),s(t);var r=arguments.length<3?e:u(arguments[2]);if(v&&!d)return p(e,t,r);if(e===r){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var n=[null];return a(h,n,t),new(a(o,e,n))}var i=r.prototype,l=f(c(i)?i:m),y=a(e,l,t);return c(y)?y:l}})},6034:(e,t,r)=>{"use strict";var n=r(9989),i=r(9037),a=r(5997);n({global:!0},{Reflect:{}}),a(i.Reflect,"Reflect",!0)},2003:(e,t,r)=>{"use strict";var n=r(7697),i=r(9037),a=r(8844),o=r(5266),u=r(3457),s=r(5773),c=r(2741).f,f=r(3622),l=r(1245),p=r(4327),m=r(3477),h=r(7901),d=r(8055),v=r(1880),y=r(3689),g=r(6812),x=r(618).enforce,b=r(4241),w=r(4201),N=r(2100),D=r(6422),E=w("match"),A=i.RegExp,S=A.prototype,C=i.SyntaxError,M=a(S.exec),F=a("".charAt),O=a("".replace),T=a("".indexOf),B=a("".slice),_=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,k=/a/g,I=/a/g,R=new A(k)!==k,z=h.MISSED_STICKY,q=h.UNSUPPORTED_Y;if(o("RegExp",n&&(!R||z||N||D||y((function(){return I[E]=!1,A(k)!==k||A(I)===I||"/a/i"!==String(A(k,"i"))}))))){for(var j=function(e,t){var r,n,i,a,o,c,h=f(S,this),d=l(e),v=void 0===t,y=[],b=e;if(!h&&d&&v&&e.constructor===j)return e;if((d||f(S,e))&&(e=e.source,v&&(t=m(b))),e=void 0===e?"":p(e),t=void 0===t?"":p(t),b=e,N&&"dotAll"in k&&(n=!!t&&T(t,"s")>-1)&&(t=O(t,/s/g,"")),r=t,z&&"sticky"in k&&(i=!!t&&T(t,"y")>-1)&&q&&(t=O(t,/y/g,"")),D&&(a=function(e){for(var t,r=e.length,n=0,i="",a=[],o={},u=!1,s=!1,c=0,f="";n<=r;n++){if("\\"===(t=F(e,n)))t+=F(e,++n);else if("]"===t)u=!1;else if(!u)switch(!0){case"["===t:u=!0;break;case"("===t:M(_,B(e,n+1))&&(n+=2,s=!0),i+=t,c++;continue;case">"===t&&s:if(""===f||g(o,f))throw new C("Invalid capture group name");o[f]=!0,a[a.length]=[f,c],s=!1,f="";continue}s?f+=t:i+=t}return[i,a]}(e),e=a[0],y=a[1]),o=u(A(e,t),h?this:S,j),(n||i||y.length)&&(c=x(o),n&&(c.dotAll=!0,c.raw=j(function(e){for(var t,r=e.length,n=0,i="",a=!1;n<=r;n++)"\\"!==(t=F(e,n))?a||"."!==t?("["===t?a=!0:"]"===t&&(a=!1),i+=t):i+="[\\s\\S]":i+=t+F(e,++n);return i}(e),r)),i&&(c.sticky=!0),y.length&&(c.groups=y)),e!==b)try{s(o,"source",""===b?"(?:)":b)}catch(e){}return o},P=c(A),L=0;P.length>L;)d(j,A,P[L++]);S.constructor=j,j.prototype=S,v(i,"RegExp",j,{constructor:!0})}b("RegExp")},8518:(e,t,r)=>{"use strict";var n=r(7697),i=r(2100),a=r(6648),o=r(2148),u=r(618).get,s=RegExp.prototype,c=TypeError;n&&i&&o(s,"dotAll",{configurable:!0,get:function(){if(this!==s){if("RegExp"===a(this))return!!u(this).dotAll;throw new c("Incompatible receiver, RegExp required")}}})},4043:(e,t,r)=>{"use strict";var n=r(9989),i=r(6308);n({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},3440:(e,t,r)=>{"use strict";var n=r(7697),i=r(7901).MISSED_STICKY,a=r(6648),o=r(2148),u=r(618).get,s=RegExp.prototype,c=TypeError;n&&i&&o(s,"sticky",{configurable:!0,get:function(){if(this!==s){if("RegExp"===a(this))return!!u(this).sticky;throw new c("Incompatible receiver, RegExp required")}}})},7409:(e,t,r)=>{"use strict";r(4043);var n,i,a=r(9989),o=r(2615),u=r(9985),s=r(5027),c=r(4327),f=(n=!1,(i=/[ac]/).exec=function(){return n=!0,/./.exec.apply(this,arguments)},!0===i.test("abc")&&n),l=/./.test;a({target:"RegExp",proto:!0,forced:!f},{test:function(e){var t=s(this),r=c(e),n=t.exec;if(!u(n))return o(l,t,r);var i=o(n,t,r);return null!==i&&(s(i),!0)}})},2826:(e,t,r)=>{"use strict";var n=r(1236).PROPER,i=r(1880),a=r(5027),o=r(4327),u=r(3689),s=r(3477),c="toString",f=RegExp.prototype[c],l=u((function(){return"/a/b"!==f.call({source:"a",flags:"b"})})),p=n&&f.name!==c;(l||p)&&i(RegExp.prototype,c,(function(){var e=a(this);return"/"+o(e.source)+"/"+o(s(e))}),{unsafe:!0})},7985:(e,t,r)=>{"use strict";r(319)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(800))},9649:(e,t,r)=>{"use strict";r(7985)},3843:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(2124),o=r(4684),u=r(4327),s=r(7413),c=i("".indexOf);n({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~c(u(o(this)),u(a(e)),arguments.length>1?arguments[1]:void 0)}})},1694:(e,t,r)=>{"use strict";var n=r(730).charAt,i=r(4327),a=r(618),o=r(1934),u=r(7807),s="String Iterator",c=a.set,f=a.getterFor(s);o(String,"String",(function(e){c(this,{type:s,string:i(e),index:0})}),(function(){var e,t=f(this),r=t.string,i=t.index;return i>=r.length?u(void 0,!0):(e=n(r,i),t.index+=e.length,u(e,!1))}))},2462:(e,t,r)=>{"use strict";var n=r(2615),i=r(8678),a=r(5027),o=r(981),u=r(3126),s=r(4327),c=r(4684),f=r(4849),l=r(1514),p=r(6100);i("match",(function(e,t,r){return[function(t){var r=c(this),i=o(t)?void 0:f(t,e);return i?n(i,t,r):new RegExp(t)[e](s(r))},function(e){var n=a(this),i=s(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return p(n,i);var c=n.unicode;n.lastIndex=0;for(var f,m=[],h=0;null!==(f=p(n,i));){var d=s(f[0]);m[h]=d,""===d&&(n.lastIndex=l(i,u(n.lastIndex),c)),h++}return 0===h?null:m}]}))},9588:(e,t,r)=>{"use strict";r(9989)({target:"String",proto:!0},{repeat:r(534)})},7267:(e,t,r)=>{"use strict";var n=r(1735),i=r(2615),a=r(8844),o=r(8678),u=r(3689),s=r(5027),c=r(9985),f=r(981),l=r(8700),p=r(3126),m=r(4327),h=r(4684),d=r(1514),v=r(4849),y=r(7017),g=r(6100),x=r(4201)("replace"),b=Math.max,w=Math.min,N=a([].concat),D=a([].push),E=a("".indexOf),A=a("".slice),S="$0"==="a".replace(/./,"$0"),C=!!/./[x]&&""===/./[x]("a","$0");o("replace",(function(e,t,r){var a=C?"$":"$0";return[function(e,r){var n=h(this),a=f(e)?void 0:v(e,x);return a?i(a,e,n,r):i(t,m(n),e,r)},function(e,i){var o=s(this),u=m(e);if("string"==typeof i&&-1===E(i,a)&&-1===E(i,"$<")){var f=r(t,o,u,i);if(f.done)return f.value}var h=c(i);h||(i=m(i));var v,x=o.global;x&&(v=o.unicode,o.lastIndex=0);for(var S,C=[];null!==(S=g(o,u))&&(D(C,S),x);)""===m(S[0])&&(o.lastIndex=d(u,p(o.lastIndex),v));for(var M,F="",O=0,T=0;T<C.length;T++){for(var B,_=m((S=C[T])[0]),k=b(w(l(S.index),u.length),0),I=[],R=1;R<S.length;R++)D(I,void 0===(M=S[R])?M:String(M));var z=S.groups;if(h){var q=N([_],I,k,u);void 0!==z&&D(q,z),B=m(n(i,void 0,q))}else B=y(_,u,k,I,z,i);k>=O&&(F+=A(u,O,k)+B,O=k+_.length)}return F+A(u,O)}]}),!!u((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!S||C)},7729:(e,t,r)=>{"use strict";var n=r(9989),i=r(1568);n({target:"String",proto:!0,forced:r(4580)("sub")},{sub:function(){return i(this,"sub","","")}})},372:(e,t,r)=>{"use strict";var n=r(9989),i=r(8844),a=r(4684),o=r(8700),u=r(4327),s=i("".slice),c=Math.max,f=Math.min;n({target:"String",proto:!0,forced:!"".substr||"b"!=="ab".substr(-1)},{substr:function(e,t){var r,n,i=u(a(this)),l=i.length,p=o(e);return p===1/0&&(p=0),p<0&&(p=c(l+p,0)),(r=void 0===t?l:o(t))<=0||r===1/0||p>=(n=f(p+r,l))?"":s(i,p,n)}})},8436:(e,t,r)=>{"use strict";var n=r(9989),i=r(1435).trim;n({target:"String",proto:!0,forced:r(5984)("trim")},{trim:function(){return i(this)}})},7855:(e,t,r)=>{"use strict";var n=r(9989),i=r(9037),a=r(2615),o=r(8844),u=r(3931),s=r(7697),c=r(146),f=r(3689),l=r(6812),p=r(3622),m=r(5027),h=r(5290),d=r(8360),v=r(4327),y=r(5684),g=r(5391),x=r(300),b=r(2741),w=r(6062),N=r(7518),D=r(2474),E=r(2560),A=r(8920),S=r(9556),C=r(1880),M=r(2148),F=r(3430),O=r(2713),T=r(7248),B=r(4630),_=r(4201),k=r(6145),I=r(5405),R=r(3032),z=r(5997),q=r(618),j=r(2960).forEach,P=O("hidden"),L="Symbol",U="prototype",$=q.set,H=q.getterFor(L),G=Object[U],V=i.Symbol,Z=V&&V[U],W=i.RangeError,Y=i.TypeError,J=i.QObject,X=D.f,Q=E.f,K=w.f,ee=S.f,te=o([].push),re=F("symbols"),ne=F("op-symbols"),ie=F("wks"),ae=!J||!J[U]||!J[U].findChild,oe=function(e,t,r){var n=X(G,t);n&&delete G[t],Q(e,t,r),n&&e!==G&&Q(G,t,n)},ue=s&&f((function(){return 7!==g(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a}))?oe:Q,se=function(e,t){var r=re[e]=g(Z);return $(r,{type:L,tag:e,description:t}),s||(r.description=t),r},ce=function(e,t,r){e===G&&ce(ne,t,r),m(e);var n=d(t);return m(r),l(re,n)?(r.enumerable?(l(e,P)&&e[P][n]&&(e[P][n]=!1),r=g(r,{enumerable:y(0,!1)})):(l(e,P)||Q(e,P,y(1,{})),e[P][n]=!0),ue(e,n,r)):Q(e,n,r)},fe=function(e,t){m(e);var r=h(t),n=x(r).concat(he(r));return j(n,(function(t){s&&!a(le,r,t)||ce(e,t,r[t])})),e},le=function(e){var t=d(e),r=a(ee,this,t);return!(this===G&&l(re,t)&&!l(ne,t))&&(!(r||!l(this,t)||!l(re,t)||l(this,P)&&this[P][t])||r)},pe=function(e,t){var r=h(e),n=d(t);if(r!==G||!l(re,n)||l(ne,n)){var i=X(r,n);return!i||!l(re,n)||l(r,P)&&r[P][n]||(i.enumerable=!0),i}},me=function(e){var t=K(h(e)),r=[];return j(t,(function(e){l(re,e)||l(T,e)||te(r,e)})),r},he=function(e){var t=e===G,r=K(t?ne:h(e)),n=[];return j(r,(function(e){!l(re,e)||t&&!l(G,e)||te(n,re[e])})),n};c||(C(Z=(V=function(){if(p(Z,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=B(e),r=function(e){var n=void 0===this?i:this;n===G&&a(r,ne,e),l(n,P)&&l(n[P],t)&&(n[P][t]=!1);var o=y(1,e);try{ue(n,t,o)}catch(e){if(!(e instanceof W))throw e;oe(n,t,o)}};return s&&ae&&ue(G,t,{configurable:!0,set:r}),se(t,e)})[U],"toString",(function(){return H(this).tag})),C(V,"withoutSetter",(function(e){return se(B(e),e)})),S.f=le,E.f=ce,A.f=fe,D.f=pe,b.f=w.f=me,N.f=he,k.f=function(e){return se(_(e),e)},s&&(M(Z,"description",{configurable:!0,get:function(){return H(this).description}}),u||C(G,"propertyIsEnumerable",le,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:V}),j(x(ie),(function(e){I(e)})),n({target:L,stat:!0,forced:!c},{useSetter:function(){ae=!0},useSimple:function(){ae=!1}}),n({target:"Object",stat:!0,forced:!c,sham:!s},{create:function(e,t){return void 0===t?g(e):fe(g(e),t)},defineProperty:ce,defineProperties:fe,getOwnPropertyDescriptor:pe}),n({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:me}),R(),z(V,L),T[P]=!0},6544:(e,t,r)=>{"use strict";var n=r(9989),i=r(7697),a=r(9037),o=r(8844),u=r(6812),s=r(9985),c=r(3622),f=r(4327),l=r(2148),p=r(8758),m=a.Symbol,h=m&&m.prototype;if(i&&s(m)&&(!("description"in h)||void 0!==m().description)){var d={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),t=c(h,this)?new m(e):void 0===e?m():m(e);return""===e&&(d[t]=!0),t};p(v,m),v.prototype=h,h.constructor=v;var y="Symbol(description detection)"===String(m("description detection")),g=o(h.valueOf),x=o(h.toString),b=/^Symbol\((.*)\)[^)]+$/,w=o("".replace),N=o("".slice);l(h,"description",{configurable:!0,get:function(){var e=g(this);if(u(d,e))return"";var t=x(e),r=y?N(t,7,-1):w(t,b,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},8074:(e,t,r)=>{"use strict";var n=r(9989),i=r(6058),a=r(6812),o=r(4327),u=r(3430),s=r(6549),c=u("string-to-symbol-registry"),f=u("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!s},{for:function(e){var t=o(e);if(a(c,t))return c[t];var r=i("Symbol")(t);return c[t]=r,f[r]=t,r}})},4254:(e,t,r)=>{"use strict";r(5405)("iterator")},9749:(e,t,r)=>{"use strict";r(7855),r(8074),r(1445),r(8324),r(9434)},1445:(e,t,r)=>{"use strict";var n=r(9989),i=r(6812),a=r(734),o=r(3691),u=r(3430),s=r(6549),c=u("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!s},{keyFor:function(e){if(!a(e))throw new TypeError(o(e)+" is not a symbol");if(i(c,e))return c[e]}})},7522:(e,t,r)=>{"use strict";var n=r(9037),i=r(6338),a=r(3265),o=r(7612),u=r(5773),s=function(e){if(e&&e.forEach!==o)try{u(e,"forEach",o)}catch(t){e.forEach=o}};for(var c in i)i[c]&&s(n[c]&&n[c].prototype);s(a)},6265:(e,t,r)=>{"use strict";var n=r(9037),i=r(6338),a=r(3265),o=r(752),u=r(5773),s=r(4201),c=s("iterator"),f=s("toStringTag"),l=o.values,p=function(e,t){if(e){if(e[c]!==l)try{u(e,c,l)}catch(t){e[c]=l}if(e[f]||u(e,f,t),i[t])for(var r in o)if(e[r]!==o[r])try{u(e,r,o[r])}catch(t){e[r]=o[r]}}};for(var m in i)p(n[m]&&n[m].prototype,m);p(a,"DOMTokenList")},9979:(e,t,r)=>{"use strict";var n=r(9989),i=r(2615);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},4814:function(e){e.exports=function(){"use strict";function e(){return!0}function t(){return!1}function r(){}const n="Argument is not a typed-function.";return function i(){function a(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const o=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e){return e instanceof Date}},{name:"RegExp",test:function(e){return e instanceof RegExp}},{name:"Object",test:a},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],u={name:"any",test:e,isAny:!0};let s,c,f=0,l={createCount:0};function p(e){const t=s.get(e);if(t)return t;let r='Unknown type "'+e+'"';const n=e.toLowerCase();let i;for(i of c)if(i.toLowerCase()===n){r+='. Did you mean "'+i+'" ?';break}throw new TypeError(r)}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const r=t?p(t).index:c.length,n=[];for(let t=0;t<e.length;++t){if(!e[t]||"string"!=typeof e[t].name||"function"!=typeof e[t].test)throw new TypeError("Object with properties {name: string, test: function} expected");const i=e[t].name;if(s.has(i))throw new TypeError('Duplicate type name "'+i+'"');n.push(i),s.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:r+t,conversionsTo:[]})}const i=c.slice(r);c=c.slice(0,r).concat(n).concat(i);for(let e=r+n.length;e<c.length;++e)s.get(c[e]).index=e}function h(){s=new Map,c=[],f=0,m([u],!1)}function d(e){const t=c.filter((t=>{const r=s.get(t);return!r.isAny&&r.test(e)}));return t.length?t:["any"]}function v(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function y(e,t,r){if(!v(e))throw new TypeError(n);const i=r&&r.exact,a=N(Array.isArray(t)?t.join(","):t),o=g(a);if(!i||o in e.signatures){const t=e._typedFunctionData.signatureMap.get(o);if(t)return t}const u=a.length;let s,c;if(i){let t;for(t in s=[],e.signatures)s.push(e._typedFunctionData.signatureMap.get(t))}else s=e._typedFunctionData.signatures;for(let e=0;e<u;++e){const t=a[e],r=[];let n;for(n of s){const i=S(n.params,e);if(i&&(!t.restParam||i.restParam)){if(!i.hasAny){const e=w(i);if(t.types.some((t=>!e.has(t.name))))continue}r.push(n)}}if(s=r,0===s.length)break}for(c of s)if(c.params.length<=u)return c;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+g(a,", ")+"))")}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map((e=>e.name)).join(t)}function x(e){const t=0===e.indexOf("..."),r=(t?e.length>3?e.slice(3):"any":e).split("|").map((e=>p(e.trim())));let n=!1,i=t?"...":"";return{types:r.map((function(e){return n=e.isAny||n,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:n,hasConversion:!1,restParam:t}}function b(e){const t=function(e){if(0===e.length)return[];const t=e.map(p);e.length>1&&t.sort(((e,t)=>e.index-t.index));let r=t[0].conversionsTo;if(1===e.length)return r;r=r.concat([]);const n=new Set(e);for(let e=1;e<t.length;++e){let i;for(i of t[e].conversionsTo)n.has(i.from)||(r.push(i),n.add(i.from))}return r}(e.types.map((e=>e.name)));let r=e.hasAny,n=e.name;const i=t.map((function(e){const t=p(e.from);return r=t.isAny||r,n+="|"+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:n,hasAny:r,hasConversion:i.length>0,restParam:e.restParam}}function w(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((t=>e.typeSet.add(t.name)))),e.typeSet}function N(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const r=e.trim();if(""===r)return t;const n=r.split(",");for(let e=0;e<n.length;++e){const r=x(n[e].trim());if(r.restParam&&e!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+n[e]+'": only allowed for the last parameter');if(0===r.types.length)return null;t.push(r)}return t}function D(e){const t=H(e);return!!t&&t.restParam}function E(t){if(t&&0!==t.types.length){if(1===t.types.length)return p(t.types[0].name).test;if(2===t.types.length){const e=p(t.types[0].name).test,r=p(t.types[1].name).test;return function(t){return e(t)||r(t)}}{const e=t.types.map((function(e){return p(e.name).test}));return function(t){for(let r=0;r<e.length;r++)if(e[r](t))return!0;return!1}}}return e}function A(e){let t,r,n;if(D(e)){t=$(e).map(E);const r=t.length,n=E(H(e)),i=function(e){for(let t=r;t<e.length;t++)if(!n(e[t]))return!1;return!0};return function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return i(e)&&e.length>=r+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=E(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=E(e[0]),n=E(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(E),function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return e.length===t.length})}function S(e,t){return t<e.length?e[t]:D(e)?H(e):null}function C(e,t){const r=S(e,t);return r?w(r):new Set}function M(e){return null===e.conversion||void 0===e.conversion}function F(e,t){const r=new Set;return e.forEach((e=>{const n=C(e.params,t);let i;for(i of n)r.add(i)})),r.has("any")?["any"]:Array.from(r)}function O(e,t,r){let n,i;const a=e||"unnamed";let o,u=r;for(o=0;o<t.length;o++){const e=[];if(u.forEach((r=>{const n=E(S(r.params,o));(o<r.params.length||D(r.params))&&n(t[o])&&e.push(r)})),0===e.length){if(i=F(u,o),i.length>0){const e=d(t[o]);return n=new TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+o+")"),n.data={category:"wrongType",fn:a,index:o,actual:e,expected:i},n}}else u=e}const s=u.map((function(e){return D(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,s))return i=F(u,o),n=new TypeError("Too few arguments in function "+a+" (expected: "+i.join(" or ")+", index: "+t.length+")"),n.data={category:"tooFewArgs",fn:a,index:t.length,expected:i},n;const c=Math.max.apply(null,s);if(t.length>c)return n=new TypeError("Too many arguments in function "+a+" (expected: "+c+", actual: "+t.length+")"),n.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:c},n;const f=[];for(let e=0;e<t.length;++e)f.push(d(t[e]).join("|"));return n=new TypeError('Arguments of type "'+f.join(", ")+'" do not match any of the defined signatures of function '+a+"."),n.data={category:"mismatch",actual:f},n}function T(e){let t=c.length+1;for(let r=0;r<e.types.length;r++)M(e.types[r])&&(t=Math.min(t,e.types[r].typeIndex));return t}function B(e){let t=f+1;for(let r=0;r<e.types.length;r++)M(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function _(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;const r=T(e)-T(t);if(r<0)return-1;if(r>0)return 1;const n=B(e)-B(t);return n<0?-1:n>0?1:0}function k(e,t){const r=e.params,n=t.params,i=H(r),a=H(n),o=D(r),u=D(n);if(o&&i.hasAny){if(!u||!a.hasAny)return 1}else if(u&&a.hasAny)return-1;let s,c=0,f=0;for(s of r)s.hasAny&&++c,s.hasConversion&&++f;let l=0,p=0;for(s of n)s.hasAny&&++l,s.hasConversion&&++p;if(c!==l)return c-l;if(o&&i.hasConversion){if(!u||!a.hasConversion)return 1}else if(u&&a.hasConversion)return-1;if(f!==p)return f-p;if(o){if(!u)return 1}else if(u)return-1;const m=(r.length-n.length)*(o?-1:1);if(0!==m)return m;const h=[];let d,v=0;for(let e=0;e<r.length;++e){const t=_(r[e],n[e]);h.push(t),v+=t}if(0!==v)return v;for(d of h)if(0!==d)return d;return 0}function I(e,t){let r=t;if(e.some((e=>e.hasConversion))){const n=D(e),i=e.map(R);r=function(){const e=[],r=n?arguments.length-1:arguments.length;for(let t=0;t<r;t++)e[t]=i[t](arguments[t]);return n&&(e[r]=arguments[r].map(i[r])),t.apply(this,e)}}let n=r;if(D(e)){const t=e.length-1;n=function(){return r.apply(this,G(arguments,0,t).concat([G(arguments,t)]))}}return n}function R(e){let t,r,n,i;const a=[],o=[];switch(e.types.forEach((function(e){e.conversion&&(a.push(p(e.conversion.from).test),o.push(e.conversion.convert))})),o.length){case 0:return function(e){return e};case 1:return t=a[0],n=o[0],function(e){return t(e)?n(e):e};case 2:return t=a[0],r=a[1],n=o[0],i=o[1],function(e){return t(e)?n(e):r(e)?i(e):e};default:return function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}}function z(e){return function e(t,r,n){if(r<t.length){const o=t[r];let u=[];if(o.restParam){const e=o.types.filter(M);e.length<o.types.length&&u.push({types:e,name:"..."+e.map((e=>e.name)).join("|"),hasAny:e.some((e=>e.isAny)),hasConversion:!1,restParam:!0}),u.push(o)}else u=o.types.map((function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}}));return i=u,a=function(i){return e(t,r+1,n.concat([i]))},Array.prototype.concat.apply([],i.map(a))}var i,a;return[n]}(e,0,[])}function q(e,t){const r=Math.max(e.length,t.length);for(let n=0;n<r;n++){const r=C(e,n),i=C(t,n);let a,o=!1;for(a of i)if(r.has(a)){o=!0;break}if(!o)return!1}const n=e.length,i=t.length,a=D(e),o=D(t);return a?o?n===i:i>=n:o?n>=i:n===i}function j(e,t,r){const n=[];let i;for(i of e){let e=r[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;n.push(e)}return n}function P(e,t,r){const n=function(e){return e.map((e=>Y(e)?Z(e.referToSelf.callback):W(e)?V(e.referTo.references,e.referTo.callback):e))}(e),i=new Array(n.length).fill(!1);let a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<n.length;++o){if(i[o])continue;const u=n[o];if(Y(u))n[o]=u.referToSelf.callback(r),n[o].referToSelf=u.referToSelf,i[o]=!0,e=!1;else if(W(u)){const r=j(u.referTo.references,n,t);r?(n[o]=u.referTo.callback.apply(this,r),n[o].referTo=u.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return n}function L(e,n){if(l.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");l.warnAgainstDeprecatedThis&&function(e){const t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach((r=>{const n=e[r];if(t.test(n.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")}))}(n);const i=[],a=[],o={},u=[];let s;for(s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;const e=N(s);if(!e)continue;i.forEach((function(t){if(q(t,e))throw new TypeError('Conflicting signatures "'+g(t)+'" and "'+g(e)+'".')})),i.push(e);const t=a.length;a.push(n[s]);const r=e.map(b);let c;for(c of z(r)){const e=g(c);u.push({params:c,name:e,fn:t}),c.every((e=>!e.hasConversion))&&(o[e]=t)}}u.sort(k);const c=P(a,o,ue);let f;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(o[f]=c[o[f]]);const p=[],m=new Map;for(f of u)m.has(f.name)||(f.fn=c[f.fn],p.push(f),m.set(f.name,f));const h=p[0]&&p[0].params.length<=2&&!D(p[0].params),d=p[1]&&p[1].params.length<=2&&!D(p[1].params),v=p[2]&&p[2].params.length<=2&&!D(p[2].params),y=p[3]&&p[3].params.length<=2&&!D(p[3].params),x=p[4]&&p[4].params.length<=2&&!D(p[4].params),w=p[5]&&p[5].params.length<=2&&!D(p[5].params),S=h&&d&&v&&y&&x&&w;for(let e=0;e<p.length;++e)p[e].test=A(p[e].params);const C=h?E(p[0].params[0]):t,M=d?E(p[1].params[0]):t,F=v?E(p[2].params[0]):t,O=y?E(p[3].params[0]):t,T=x?E(p[4].params[0]):t,B=w?E(p[5].params[0]):t,_=h?E(p[0].params[1]):t,R=d?E(p[1].params[1]):t,j=v?E(p[2].params[1]):t,L=y?E(p[3].params[1]):t,U=x?E(p[4].params[1]):t,$=w?E(p[5].params[1]):t;for(let e=0;e<p.length;++e)p[e].implementation=I(p[e].params,p[e].fn);const H=h?p[0].implementation:r,G=d?p[1].implementation:r,V=v?p[2].implementation:r,Z=y?p[3].implementation:r,W=x?p[4].implementation:r,Y=w?p[5].implementation:r,J=h?p[0].params.length:-1,X=d?p[1].params.length:-1,Q=v?p[2].params.length:-1,K=y?p[3].params.length:-1,ee=x?p[4].params.length:-1,te=w?p[5].params.length:-1,re=S?6:0,ne=p.length,ie=p.map((e=>e.test)),ae=p.map((e=>e.implementation)),oe=function(){for(let e=re;e<ne;e++)if(ie[e](arguments))return ae[e].apply(this,arguments);return l.onMismatch(e,arguments,p)};function ue(e,t){return arguments.length===J&&C(e)&&_(t)?H.apply(this,arguments):arguments.length===X&&M(e)&&R(t)?G.apply(this,arguments):arguments.length===Q&&F(e)&&j(t)?V.apply(this,arguments):arguments.length===K&&O(e)&&L(t)?Z.apply(this,arguments):arguments.length===ee&&T(e)&&U(t)?W.apply(this,arguments):arguments.length===te&&B(e)&&$(t)?Y.apply(this,arguments):oe.apply(this,arguments)}try{Object.defineProperty(ue,"name",{value:e})}catch(e){}return ue.signatures=o,ue._typedFunctionData={signatures:p,signatureMap:m},ue}function U(e,t,r){throw O(e,t,r)}function $(e){return G(e,0,e.length-1)}function H(e){return e[e.length-1]}function G(e,t,r){return Array.prototype.slice.call(e,t,r)}function V(e,t){return{referTo:{references:e,callback:t}}}function Z(e){if("function"!=typeof e)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function W(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function Y(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function J(e,t){if(!e)return t;if(t&&t!==e){const r=new Error("Function names do not match (expected: "+e+", actual: "+t+")");throw r.data={actual:t,expected:e},r}return e}function X(e){let t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(v(e[r])||"string"==typeof e[r].signature)&&(t=J(t,e[r].name));return t}function Q(e,t){let r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r in e&&t[r]!==e[r]){const n=new Error('Signature "'+r+'" is defined twice');throw n.data={signature:r,sourceFunction:t[r],destFunction:e[r]},n}e[r]=t[r]}}h(),m(o);const K=l;function ee(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw new SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return l=function(e){const t="string"==typeof e;let r=t?e:"";const n={};for(let e=t?1:0;e<arguments.length;++e){const i=arguments[e];let o,u={};if("function"==typeof i?(o=i.name,"string"==typeof i.signature?u[i.signature]=i:v(i)&&(u=i.signatures)):a(i)&&(u=i,t||(o=X(i))),0===Object.keys(u).length){const t=new 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:i},t}t||(r=J(r,o)),Q(n,u)}return L(r||"",n)},l.create=i,l.createCount=K.createCount,l.onMismatch=U,l.throwMismatchError=U,l.createError=O,l.clear=h,l.clearConversions=function(){let e;for(e of c)s.get(e).conversionsTo=[];f=0},l.addTypes=m,l._findType=p,l.referTo=function(){const e=$(arguments).map((e=>g(N(e)))),t=H(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return V(e,t)},l.referToSelf=Z,l.convert=function(e,t){const r=p(t);if(r.test(e))return e;const n=r.conversionsTo;if(0===n.length)throw new Error("There are no conversions to "+t+" defined.");for(let t=0;t<n.length;t++)if(p(n[t].from).test(e))return n[t].convert(e);throw new Error("Cannot convert "+e+" to "+t)},l.findSignature=y,l.find=function(e,t,r){return y(e,t,r).implementation},l.isTypedFunction=v,l.warnAgainstDeprecatedThis=!0,l.addType=function(e,t){let r="any";!1!==t&&s.has("Object")&&(r="Object"),l.addTypes([e],r)},l.addConversion=function(e){ee(e);const t=p(e.to);if(!t.conversionsTo.every((function(t){return t.from!==e.from})))throw new Error('There is already a conversion from "'+e.from+'" to "'+t.name+'"');t.conversionsTo.push({from:e.from,convert:e.convert,index:f++})},l.addConversions=function(e){e.forEach(l.addConversion)},l.removeConversion=function(e){ee(e);const t=p(e.to),r=function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r]}(t.conversionsTo,(t=>t.from===e.from));if(!r)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(r.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const n=t.conversionsTo.indexOf(r);t.conversionsTo.splice(n,1)},l.resolve=function(e,t){if(!v(e))throw new TypeError(n);const r=e._typedFunctionData.signatures;for(let e=0;e<r.length;++e)if(r[e].test(t))return r[e];return null},l}()}()}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};return(()=>{"use strict";r.d(n,{default:()=>Jy});var e={};function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function i(e){return"number"==typeof e}function a(e){return!(!e||"object"!==t(e)||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"===t(e.constructor.prototype)&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function o(e){return e&&"object"===t(e)&&!0===Object.getPrototypeOf(e).isComplex||!1}function u(e){return e&&"object"===t(e)&&!0===Object.getPrototypeOf(e).isFraction||!1}function s(e){return e&&!0===e.constructor.prototype.isUnit||!1}function c(e){return"string"==typeof e}r.r(e),r.d(e,{createAbs:()=>la,createAccessorNode:()=>wp,createAcos:()=>_f,createAcosh:()=>Qf,createAcot:()=>el,createAcoth:()=>rl,createAcsc:()=>il,createAcsch:()=>ol,createAdd:()=>np,createAddScalar:()=>va,createAnd:()=>Mc,createApply:()=>ma,createApplyTransform:()=>vy,createArg:()=>ru,createArrayNode:()=>Dp,createAsec:()=>sl,createAsech:()=>fl,createAsin:()=>pl,createAsinh:()=>ml,createAssignmentNode:()=>Tp,createAtan:()=>hl,createAtan2:()=>vl,createAtanh:()=>gl,createAtomicMass:()=>Zv,createAvogadro:()=>Wv,createBellNumbers:()=>gd,createBigNumberClass:()=>Ir,createBignumber:()=>Ai,createBin:()=>js,createBitAnd:()=>Wo,createBitNot:()=>Jo,createBitOr:()=>Qo,createBitXor:()=>tu,createBlockNode:()=>_p,createBohrMagneton:()=>Cv,createBohrRadius:()=>_v,createBoltzmann:()=>Yv,createBoolean:()=>Ei,createCatalan:()=>bd,createCbrt:()=>ba,createCeil:()=>Ma,createChain:()=>Wm,createChainClass:()=>Lm,createClassicalElectronRadius:()=>kv,createClone:()=>Pn,createColumn:()=>gu,createColumnTransform:()=>yy,createCombinations:()=>Ih,createCombinationsWithRep:()=>qh,createCompare:()=>Oc,createCompareNatural:()=>kc,createCompareText:()=>zc,createCompile:()=>hm,createComplex:()=>Si,createComplexClass:()=>zr,createComposition:()=>Nd,createConcat:()=>vu,createConcatTransform:()=>By,createConditionalNode:()=>Ip,createConductanceQuantum:()=>Mv,createConj:()=>iu,createConstantNode:()=>Hp,createCorr:()=>Th,createCos:()=>bl,createCosh:()=>Nl,createCot:()=>Dl,createCoth:()=>Al,createCoulomb:()=>Av,createCount:()=>bu,createCreateUnit:()=>Tf,createCross:()=>Nu,createCsc:()=>Sl,createCsch:()=>Ml,createCtranspose:()=>vs,createCube:()=>Oa,createCumSum:()=>gh,createCumSumTransform:()=>jy,createDeepEqual:()=>rf,createDenseMatrixClass:()=>qn,createDerivative:()=>Pd,createDet:()=>Ym,createDeuteronMass:()=>Pv,createDiag:()=>Eu,createDiff:()=>Uu,createDiffTransform:()=>ky,createDistance:()=>hh,createDivide:()=>ph,createDivideScalar:()=>Xs,createDot:()=>sp,createDotDivide:()=>fc,createDotMultiply:()=>Oo,createDotPow:()=>sc,createE:()=>av,createEfimovFactor:()=>Vv,createEigs:()=>th,createElectricConstant:()=>Dv,createElectronMass:()=>Iv,createElementaryCharge:()=>Sv,createEqual:()=>jc,createEqualScalar:()=>gi,createEqualText:()=>Uc,createErf:()=>Es,createEvaluate:()=>vm,createExp:()=>Ta,createExpm:()=>nh,createExpm1:()=>_a,createFactorial:()=>Xh,createFalse:()=>Kd,createFaraday:()=>Jv,createFermiCoupling:()=>Rv,createFft:()=>xs,createFibonacciHeapClass:()=>vf,createFilter:()=>Su,createFilterTransform:()=>xy,createFineStructure:()=>zv,createFirstRadiation:()=>Xv,createFix:()=>za,createFlatten:()=>Fu,createFloor:()=>La,createForEach:()=>Tu,createForEachTransform:()=>wy,createFormat:()=>qs,createFraction:()=>Ci,createFractionClass:()=>jr,createFreqz:()=>Vd,createFunctionAssignmentNode:()=>Zp,createFunctionNode:()=>fm,createGamma:()=>Zh,createGasConstant:()=>Kv,createGcd:()=>io,createGetMatrixDataType:()=>ku,createGravitationConstant:()=>xv,createGravity:()=>sy,createHartreeEnergy:()=>qv,createHasNumericValue:()=>oi,createHelp:()=>Vm,createHelpClass:()=>Pm,createHex:()=>Ls,createHypot:()=>ap,createI:()=>mv,createIdentity:()=>Ru,createIfft:()=>ws,createIm:()=>au,createImmutableDenseMatrixClass:()=>mf,createIndex:()=>lp,createIndexClass:()=>hf,createIndexNode:()=>Yp,createIndexTransform:()=>Ny,createInfinity:()=>tv,createIntersect:()=>dh,createInv:()=>Jm,createInverseConductanceQuantum:()=>Fv,createInvmod:()=>Co,createIsInteger:()=>Yn,createIsNaN:()=>pi,createIsNegative:()=>ri,createIsNumeric:()=>ii,createIsPositive:()=>si,createIsPrime:()=>Ws,createIsZero:()=>fi,createKldivergence:()=>Kh,createKlitzing:()=>Bv,createKron:()=>qu,createLN10:()=>sv,createLN2:()=>uv,createLOG10E:()=>fv,createLOG2E:()=>cv,createLarger:()=>Jc,createLargerEq:()=>Kc,createLcm:()=>oo,createLeafCount:()=>Ed,createLeftShift:()=>Dc,createLgamma:()=>Yh,createLog:()=>rc,createLog10:()=>so,createLog1p:()=>ic,createLog2:()=>fo,createLoschmidt:()=>Qv,createLsolve:()=>mc,createLsolveAll:()=>yc,createLup:()=>bm,createLusolve:()=>zm,createLyap:()=>lh,createMad:()=>Dh,createMagneticConstant:()=>Nv,createMagneticFluxQuantum:()=>Ov,createMap:()=>ju,createMapTransform:()=>Dy,createMatrix:()=>Fi,createMatrixClass:()=>Lr,createMatrixFromColumns:()=>zi,createMatrixFromFunction:()=>Ti,createMatrixFromRows:()=>ki,createMax:()=>lf,createMaxTransform:()=>Sy,createMean:()=>bh,createMeanTransform:()=>Cy,createMedian:()=>Nh,createMin:()=>pf,createMinTransform:()=>My,createMod:()=>Ya,createMode:()=>_s,createMolarMass:()=>oy,createMolarMassC12:()=>uy,createMolarPlanckConstant:()=>ey,createMolarVolume:()=>ty,createMultinomial:()=>td,createMultiply:()=>mo,createMultiplyScalar:()=>lo,createNaN:()=>rv,createNeutronMass:()=>Lv,createNode:()=>mp,createNorm:()=>up,createNot:()=>pu,createNthRoot:()=>vo,createNthRoots:()=>oc,createNuclearMagneton:()=>Tv,createNull:()=>ev,createNumber:()=>bi,createNumeric:()=>Ys,createObjectNode:()=>Xp,createOct:()=>Ps,createOnes:()=>$u,createOperatorNode:()=>Kp,createOr:()=>mu,createParenthesisNode:()=>tm,createParse:()=>pm,createParser:()=>xm,createParserClass:()=>ym,createPartitionSelect:()=>sf,createPermutations:()=>nd,createPhi:()=>ov,createPi:()=>nv,createPickRandom:()=>cd,createPinv:()=>Qm,createPlanckCharge:()=>py,createPlanckConstant:()=>bv,createPlanckLength:()=>cy,createPlanckMass:()=>fy,createPlanckTemperature:()=>my,createPlanckTime:()=>ly,createPolynomialRoot:()=>jm,createPow:()=>Qs,createPrint:()=>Hs,createPrintTransform:()=>$y,createProd:()=>Rs,createProtonMass:()=>jv,createQr:()=>wm,createQuantileSeq:()=>Mh,createQuantileSeqTransform:()=>zy,createQuantumOfCirculation:()=>Uv,createRandom:()=>pd,createRandomInt:()=>hd,createRange:()=>Wu,createRangeClass:()=>Pr,createRangeNode:()=>nm,createRangeTransform:()=>Fy,createRationalize:()=>Ud,createRe:()=>ou,createReducedPlanckConstant:()=>wv,createRelationalNode:()=>am,createReplacer:()=>Wd,createReshape:()=>Ju,createResize:()=>Xu,createResolve:()=>Rd,createResultSet:()=>Qe,createReviver:()=>Zd,createRightArithShift:()=>Ac,createRightLogShift:()=>Cc,createRotate:()=>Ku,createRotationMatrix:()=>ts,createRound:()=>tc,createRow:()=>rs,createRowTransform:()=>Oy,createRydberg:()=>$v,createSQRT1_2:()=>lv,createSQRT2:()=>pv,createSackurTetrode:()=>ry,createSchur:()=>ch,createSec:()=>Fl,createSech:()=>Tl,createSecondRadiation:()=>ny,createSetCartesian:()=>ql,createSetDifference:()=>Pl,createSetDistinct:()=>Ul,createSetIntersect:()=>Hl,createSetIsSubset:()=>Vl,createSetMultiplicity:()=>Wl,createSetPowerset:()=>Jl,createSetSize:()=>Ql,createSetSymDifference:()=>ep,createSetUnion:()=>rp,createSign:()=>go,createSimplify:()=>Od,createSimplifyConstant:()=>_d,createSimplifyCore:()=>Id,createSin:()=>Bl,createSinh:()=>kl,createSize:()=>is,createSlu:()=>km,createSmaller:()=>Hc,createSmallerEq:()=>Zc,createSolveODE:()=>Ds,createSort:()=>ff,createSpaClass:()=>yf,createSparse:()=>Ff,createSparseMatrixClass:()=>xi,createSpeedOfLight:()=>gv,createSplitUnit:()=>ji,createSqrt:()=>xo,createSqrtm:()=>ah,createSquare:()=>wo,createSqueeze:()=>os,createStd:()=>Fh,createStdTransform:()=>Iy,createStefanBoltzmann:()=>iy,createStirlingS2:()=>vd,createString:()=>Ni,createSubset:()=>ss,createSubsetTransform:()=>Ty,createSubtract:()=>Do,createSubtractScalar:()=>ga,createSum:()=>vh,createSumTransform:()=>Ry,createSylvester:()=>uh,createSymbolNode:()=>om,createSymbolicEqual:()=>qd,createTan:()=>Il,createTanh:()=>Rl,createTau:()=>iv,createThomsonCrossSection:()=>Hv,createTo:()=>Vs,createTrace:()=>cp,createTranspose:()=>hs,createTrue:()=>Qd,createTypeOf:()=>hi,createTyped:()=>Ve,createUnaryMinus:()=>sa,createUnaryPlus:()=>fa,createUnequal:()=>af,createUnitClass:()=>Af,createUnitFunction:()=>Cf,createUppercaseE:()=>dv,createUppercasePi:()=>hv,createUsolve:()=>dc,createUsolveAll:()=>xc,createVacuumImpedance:()=>Ev,createVariance:()=>Sh,createVarianceTransform:()=>Ly,createVersion:()=>vv,createWeakMixingAngle:()=>Gv,createWienDisplacement:()=>ay,createXgcd:()=>Ao,createXor:()=>hu,createZeros:()=>gs,createZeta:()=>Ts,createZpk2tf:()=>Hd}),r(4043),r(7409),r(9288),r(6801),r(8742),r(228),r(3843),r(8052),r(3975),r(24),r(2003),r(8518),r(3440),r(2826),r(4284);var f=Array.isArray;function l(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function p(e){return Array.isArray(e)||l(e)}function m(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function h(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function d(e){return e&&!0===e.constructor.prototype.isRange||!1}function v(e){return e&&!0===e.constructor.prototype.isIndex||!1}function y(e){return"boolean"==typeof e}function g(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function x(e){return e&&!0===e.constructor.prototype.isHelp||!1}function b(e){return"function"==typeof e}function w(e){return e instanceof Date}function N(e){return e instanceof RegExp}function D(e){return!(!e||"object"!==t(e)||e.constructor!==Object||o(e)||u(e))}function E(e){return null===e}function A(e){return void 0===e}function S(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function C(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function M(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function F(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function O(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function T(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function B(e){return T(e)||q(e)&&1===e.args.length&&T(e.args[0])&&"-+~".includes(e.op)}function _(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function k(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function I(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function R(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function z(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function q(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function j(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function P(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function U(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.constructor.prototype.isChain||!1}function H(e){var r=t(e);return"object"===r?null===e?"null":a(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":r}var G=r(4814);function V(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}r(6976),r(8813),r(5239),r(2076),r(4712),r(4992),r(4338),r(7267),r(2462),r(939),r(7195),r(886),r(2320),r(6203),r(9730),r(2506),r(3584),r(6557),r(2428),r(5263),r(7221),r(2700),r(1554);var Z=Math.sign||function(e){return e>0?1:e<0?-1:0},W=Math.log2||function(e){return Math.log(e)/Math.LN2},Y=Math.log10||function(e){return Math.log(e)/Math.LN10},J=Math.log1p||function(e){return Math.log(e+1)},X=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t},Q=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function K(e,t,r){var n={2:"0b",8:"0o",16:"0x"}[t],i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!V(r))throw new Error("size must be an integer");if(e>Math.pow(2,r-1)-1||e<-Math.pow(2,r-1))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!V(e))throw new Error("Value must be an integer");e<0&&(e+=Math.pow(2,r)),i="i".concat(r)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(n).concat(e.toString(t)).concat(i)}function ee(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var r,n,a="auto";if(t&&(t.notation&&(a=t.notation),i(t)?r=t:i(t.precision)&&(r=t.precision),t.wordSize&&"number"!=typeof(n=t.wordSize)))throw new Error('Option "wordSize" must be a number');switch(a){case"fixed":return re(e,r);case"exponential":return ne(e,r);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=ie(te(e),t),n=r.exponent,a=r.coefficients,o=n%3==0?n:n<0?n-3-n%3:n-n%3;if(i(t))for(;t>a.length||n-o+1>a.length;)a.push(0);else for(var u=Math.abs(n-o)-(a.length-1),s=0;s<u;s++)a.push(0);for(var c=Math.abs(n-o),f=1;c>0;)f++,c--;var l=a.slice(f).join(""),p=i(t)&&l.length||l.match(/[1-9]/)?"."+l:"",m=a.slice(0,f).join("")+p+"e"+(n>=0?"+":"")+o.toString();return r.sign+m}(e,r);case"bin":return K(e,2,n);case"oct":return K(e,8,n);case"hex":return K(e,16,n);case"auto":return function(e,t,r){if(isNaN(e)||!isFinite(e))return String(e);var n=r&&void 0!==r.lowerExp?r.lowerExp:-3,i=r&&void 0!==r.upperExp?r.upperExp:5,a=te(e),o=t?ie(a,t):a;if(o.exponent<n||o.exponent>=i)return ne(e,t);var u=o.coefficients,s=o.exponent;u.length<t&&(u=u.concat(ae(t-u.length))),u=u.concat(ae(s-u.length+1+(u.length<t?t-u.length:0)));var c=s>0?s:0;return c<(u=ae(-s).concat(u)).length-1&&u.splice(c+1,0,"."),o.sign+u.join("")}(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+a+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function te(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=-1!==a?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function re(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=te(e),n="number"==typeof t?ie(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(ae(o-i.length))),a<0&&(i=ae(1-a).concat(i),a=1),a<i.length&&i.splice(a,0,0===a?"0.":"."),n.sign+i.join("")}function ne(e,t){if(isNaN(e)||!isFinite(e))return String(e);var r=te(e),n=t?ie(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(ae(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function ie(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),n[--i]++}return r}function ae(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}var oe=Number.EPSILON||2220446049250313e-31;function ue(e,t,r){if(null==r)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var n=Math.abs(e-t);return n<=oe||n<=Math.max(Math.abs(e),Math.abs(t))*r}return!1}var se=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},ce=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},fe=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},le=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},pe=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},me=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function he(e){var r=t(e);if("number"===r||"string"===r||"boolean"===r||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return he(e)}));if(e instanceof Date)return new Date(e.valueOf());if(a(e))return e;if(D(e))return de(e,he);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function de(e,t){var r={};for(var n in e)Ne(e,n)&&(r[n]=t(e[n]));return r}function ve(e,t){for(var r in t)Ne(t,r)&&(e[r]=t[r]);return e}function ye(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var r in t)if(Ne(t,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(t[r]&&t[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r]&&e[r].constructor===Object?ye(e[r],t[r]):e[r]=t[r];else{if(Array.isArray(t[r]))throw new TypeError("Arrays are not supported by deepExtend");e[r]=t[r]}return e}function ge(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!ge(e[n],t[n]))return!1;return!0}if("function"==typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!ge(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}return e===t}function xe(e){var t={};return be(e,t),t}function be(e,r){for(var n in e)if(Ne(e,n)){var i=e[n];"object"===t(i)&&null!==i?be(i,r):r[n]=i}}function we(e,t,r){var n,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(n=r(),i=!1),n},set:function(e){n=e,i=!1},configurable:!0,enumerable:!0})}function Ne(e,t){return e&&Object.hasOwnProperty.call(e,t)}function De(e){return Object.keys(e).map((function(t){return e[t]}))}function Ee(e,t,r,n){function i(n){var i=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];void 0!==a&&(r[i]=a)}return r}(n,t.map(Se));return function(e,t,r){if(!t.filter((function(e){return!function(e){return e&&"?"===e[0]}(e)})).every((function(e){return void 0!==r[e]}))){var n=t.filter((function(e){return void 0===r[e]}));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(n.map((function(e){return'"'.concat(e,'"')})).join(", "),"."))}}(e,t,n),r(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function Ae(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function Se(e){return e&&"?"===e[0]?e.slice(1):e}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Me(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}function Fe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Me(n.key),n)}}function Oe(e,t,r){return t&&Fe(e.prototype,t),r&&Fe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Te(e,t){if(Ie(e)&&_e(e,t))return e[t];if("function"==typeof e[t]&&ke(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function Be(e,t,r){if(Ie(e)&&_e(e,t))return e[t]=r,r;throw new Error('No access to property "'+t+'"')}function _e(e,r){return!(!e||"object"!==t(e)||!Ne(Re,r)&&(r in Object.prototype||r in Function.prototype))}function ke(e,t){return!(null==e||"function"!=typeof e[t]||Ne(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!Ne(ze,t)&&(t in Object.prototype||t in Function.prototype))}function Ie(e){return"object"===t(e)&&e&&e.constructor===Object}r(5137),r(9693),r(7522),r(8077),r(5791),r(739),r(9358),r(752),r(6646),r(1694),r(6265),r(7722),r(9749),r(6544),r(4254);var Re={length:!0,name:!0},ze={toString:!0,valueOf:!0,toLocaleString:!0};function qe(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return je(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?je(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Pe=function(){function e(t){Ce(this,e),this.wrappedObject=t}return Oe(e,[{key:"keys",value:function(){return Object.keys(this.wrappedObject)}},{key:"get",value:function(e){return Te(this.wrappedObject,e)}},{key:"set",value:function(e,t){return Be(this.wrappedObject,e,t),this}},{key:"has",value:function(e){return e in this.wrappedObject}}]),e}();function Le(){return new Map}function Ue(e){if(!e)return Le();if($e(e))return e;if(D(e))return new Pe(e);throw new Error("createMap can create maps from objects or Maps")}function $e(e){return!!e&&(e instanceof Map||e instanceof Pe||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function He(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=0,a=r;i<a.length;i++){var o=a[i];if(o)if($e(o)){var u,s=qe(o.keys());try{for(s.s();!(u=s.n()).done;){var c=u.value;e.set(c,o.get(c))}}catch(e){s.e(e)}finally{s.f()}}else if(D(o))for(var f=0,l=Object.keys(o);f<l.length;f++){var p=l[f];e.set(p,o[p])}}return e}var Ge=function(){return Ge=G.create,G},Ve=Ee("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){var t=e.BigNumber,r=e.Complex,n=e.DenseMatrix,B=e.Fraction,H=Ge();return H.clear(),H.addTypes([{name:"number",test:i},{name:"Complex",test:o},{name:"BigNumber",test:a},{name:"Fraction",test:u},{name:"Unit",test:s},{name:"identifier",test:function(e){return c&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\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\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\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\uDE80-\uDEA9\uDEB0\uDEB1\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]|\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]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\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\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]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\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\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\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\uDE80-\uDEA9\uDEB0\uDEB1\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]|\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]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\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\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]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)}},{name:"string",test:c},{name:"Chain",test:$},{name:"Array",test:f},{name:"Matrix",test:l},{name:"DenseMatrix",test:m},{name:"SparseMatrix",test:h},{name:"Range",test:d},{name:"Index",test:v},{name:"boolean",test:y},{name:"ResultSet",test:g},{name:"Help",test:x},{name:"function",test:b},{name:"Date",test:w},{name:"RegExp",test:N},{name:"null",test:E},{name:"undefined",test:A},{name:"AccessorNode",test:S},{name:"ArrayNode",test:C},{name:"AssignmentNode",test:M},{name:"BlockNode",test:F},{name:"ConditionalNode",test:O},{name:"ConstantNode",test:T},{name:"FunctionNode",test:k},{name:"FunctionAssignmentNode",test:_},{name:"IndexNode",test:I},{name:"Node",test:R},{name:"ObjectNode",test:z},{name:"OperatorNode",test:q},{name:"ParenthesisNode",test:j},{name:"RangeNode",test:P},{name:"RelationalNode",test:L},{name:"SymbolNode",test:U},{name:"Map",test:$e},{name:"Object",test:D}]),H.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||Ze(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return r||We(e),new r(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return r||We(e),new r(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e){return r||We(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){B||Ye(e);var t=new B(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||Ze(e);try{return new t(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){B||Ye(e);try{return new B(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||We(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||Ze(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return B||Ye(e),new B(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),H.onMismatch=function(e,t,r){var n=H.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&p(t[0])&&r.some((function(e){return!e.params.includes(",")}))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},H.onMismatch=function(e,t,r){var n=H.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&p(t[0])&&r.some((function(e){return!e.params.includes(",")}))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},H}));function Ze(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function We(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Ye(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}r(8150),r(9979);var Je,Xe,Qe=Ee("ResultSet",[],(function(){function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e}),{isClass:!0}),Ke=(r(1013),9e15),et=1e9,tt="0123456789abcdef",rt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",nt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",it={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ke,maxE:Ke,crypto:!1},at=!0,ot="[DecimalError] ",ut=ot+"Invalid argument: ",st=ot+"Precision limit exceeded",ct=ot+"crypto unavailable",ft="[object Decimal]",lt=Math.floor,pt=Math.pow,mt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ht=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,dt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,vt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,yt=1e7,gt=7,xt=rt.length-1,bt=nt.length-1,wt={toStringTag:ft};function Nt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)n=e[t]+"",(r=gt-n.length)&&(a+=_t(r)),a+=n;o=e[t],(r=gt-(n=o+"").length)&&(a+=_t(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return a+o}function Dt(e,t,r){if(e!==~~e||e<t||e>r)throw Error(ut+e)}function Et(e,t,r,n){var i,a,o,u;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=gt,i=0):(i=Math.ceil((t+1)/gt),t%=gt),a=pt(10,gt-t),u=e[i]%a|0,null==n?t<3?(0==t?u=u/100|0:1==t&&(u=u/10|0),o=r<4&&99999==u||r>3&&49999==u||5e4==u||0==u):o=(r<4&&u+1==a||r>3&&u+1==a/2)&&(e[i+1]/a/100|0)==pt(10,t-2)-1||(u==a/2||0==u)&&0==(e[i+1]/a/100|0):t<4?(0==t?u=u/1e3|0:1==t?u=u/100|0:2==t&&(u=u/10|0),o=(n||r<4)&&9999==u||!n&&r>3&&4999==u):o=((n||r<4)&&u+1==a||!n&&r>3&&u+1==a/2)&&(e[i+1]/a/1e3|0)==pt(10,t-3)-1,o}function At(e,t,r){for(var n,i,a=[0],o=0,u=e.length;o<u;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=tt.indexOf(e.charAt(o++)),n=0;n<a.length;n++)a[n]>r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}wt.absoluteValue=wt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Ct(e)},wt.ceil=function(){return Ct(new this.constructor(this),this.e+1,2)},wt.clampedTo=wt.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(ut+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},wt.comparedTo=wt.cmp=function(e){var t,r,n,i,a=this,o=a.d,u=(e=new a.constructor(e)).d,s=a.s,c=e.s;if(!o||!u)return s&&c?s!==c?s:o===u?0:!o^s<0?1:-1:NaN;if(!o[0]||!u[0])return o[0]?s:u[0]?-c:0;if(s!==c)return s;if(a.e!==e.e)return a.e>e.e^s<0?1:-1;for(t=0,r=(n=o.length)<(i=u.length)?n:i;t<r;++t)if(o[t]!==u[t])return o[t]>u[t]^s<0?1:-1;return n===i?0:n>i^s<0?1:-1},wt.cosine=wt.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+gt,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;(n=t.d.length)<32?i=(1/$t(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=Ut(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,Ht(n,r)),n.precision=e,n.rounding=t,Ct(2==Xe||3==Xe?r.neg():r,e,t,!0)):new n(1):new n(NaN)},wt.cubeRoot=wt.cbrt=function(){var e,t,r,n,i,a,o,u,s,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(at=!1,(a=f.s*pt(f.s*f,1/3))&&Math.abs(a)!=1/0?n=new l(a.toString()):(r=Nt(f.d),(a=((e=f.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=pt(r,1/3),e=lt((e+1)/3)-(e%3==(e<0?-1:2)),(n=new l(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=f.s),o=(e=l.precision)+3;;)if(c=(s=(u=n).times(u).times(u)).plus(f),n=St(c.plus(f).times(u),c.plus(s),o+2,1),Nt(u.d).slice(0,o)===(r=Nt(n.d)).slice(0,o)){if("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(Ct(n,e+1,1),t=!n.times(n).times(n).eq(f));break}if(!i&&(Ct(u,e+1,0),u.times(u).times(u).eq(f))){n=u;break}o+=4,i=1}return at=!0,Ct(n,e,l.rounding,t)},wt.decimalPlaces=wt.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=((e=t.length-1)-lt(this.e/gt))*gt,e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},wt.dividedBy=wt.div=function(e){return St(this,new this.constructor(e))},wt.dividedToIntegerBy=wt.divToInt=function(e){var t=this.constructor;return Ct(St(this,new t(e),0,1,1),t.precision,t.rounding)},wt.equals=wt.eq=function(e){return 0===this.cmp(e)},wt.floor=function(){return Ct(new this.constructor(this),this.e+1,3)},wt.greaterThan=wt.gt=function(e){return this.cmp(e)>0},wt.greaterThanOrEqualTo=wt.gte=function(e){var t=this.cmp(e);return 1==t||0===t},wt.hyperbolicCosine=wt.cosh=function(){var e,t,r,n,i,a=this,o=a.constructor,u=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return u;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/$t(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=Ut(o,1,a.times(t),new o(1),!0);for(var s,c=e,f=new o(8);c--;)s=a.times(a),a=u.minus(s.times(f.minus(s.times(f))));return Ct(a,o.precision=r,o.rounding=n,!0)},wt.hyperbolicSine=wt.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(n=i.d.length)<3)i=Ut(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=Ut(a,2,i=i.times(1/$t(5,e)),i,!0);for(var o,u=new a(5),s=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(u.plus(o.times(s.times(o).plus(c))))}return a.precision=t,a.rounding=r,Ct(i,t,r,!0)},wt.hyperbolicTangent=wt.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,St(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},wt.inverseCosine=wt.acos=function(){var e,t=this,r=t.constructor,n=t.abs().cmp(1),i=r.precision,a=r.rounding;return-1!==n?0===n?t.isNeg()?Tt(r,i,a):new r(0):new r(NaN):t.isZero()?Tt(r,i+4,a).times(.5):(r.precision=i+6,r.rounding=1,t=t.asin(),e=Tt(r,i+4,a).times(.5),r.precision=i,r.rounding=a,e.minus(t))},wt.inverseHyperbolicCosine=wt.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,at=!1,r=r.times(r).minus(1).sqrt().plus(r),at=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},wt.inverseHyperbolicSine=wt.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,at=!1,r=r.times(r).plus(1).sqrt().plus(r),at=!0,n.precision=e,n.rounding=t,r.ln())},wt.inverseHyperbolicTangent=wt.atanh=function(){var e,t,r,n,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,n=i.sd(),Math.max(n,e)<2*-i.e-1?Ct(new a(i),e,t,!0):(a.precision=r=n-i.e,i=St(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},wt.inverseSine=wt.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,-1!==t?0===t?((e=Tt(a,r+4,n).times(.5)).s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))},wt.inverseTangent=wt.atan=function(){var e,t,r,n,i,a,o,u,s,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=bt)return(o=Tt(f,l+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=bt)return(o=Tt(f,l+4,p).times(.5)).s=c.s,o}for(f.precision=u=l+10,f.rounding=1,e=r=Math.min(28,u/gt+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(at=!1,t=Math.ceil(u/gt),n=1,s=c.times(c),o=new f(c),i=c;-1!==e;)if(i=i.times(s),a=o.minus(i.div(n+=2)),i=i.times(s),void 0!==(o=a.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),at=!0,Ct(o,f.precision=l,f.rounding=p,!0)},wt.isFinite=function(){return!!this.d},wt.isInteger=wt.isInt=function(){return!!this.d&<(this.e/gt)>this.d.length-2},wt.isNaN=function(){return!this.s},wt.isNegative=wt.isNeg=function(){return this.s<0},wt.isPositive=wt.isPos=function(){return this.s>0},wt.isZero=function(){return!!this.d&&0===this.d[0]},wt.lessThan=wt.lt=function(e){return this.cmp(e)<0},wt.lessThanOrEqualTo=wt.lte=function(e){return this.cmp(e)<1},wt.logarithm=wt.log=function(e){var t,r,n,i,a,o,u,s,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(null==e)e=new f(10),t=!0;else{if(r=(e=new f(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new f(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10==0;)i/=10;a=1!==i}if(at=!1,o=qt(c,u=l+5),n=t?Ot(f,u+10):qt(e,u),Et((s=St(o,n,u,1)).d,i=l,p))do{if(o=qt(c,u+=10),n=t?Ot(f,u+10):qt(e,u),s=St(o,n,u,1),!a){+Nt(s.d).slice(i+1,i+15)+1==1e14&&(s=Ct(s,l+1,0));break}}while(Et(s.d,i+=10,p));return at=!0,Ct(s,l,p)},wt.minus=wt.sub=function(e){var t,r,n,i,a,o,u,s,c,f,l,p,m=this,h=m.constructor;if(e=new h(e),!m.d||!e.d)return m.s&&e.s?m.d?e.s=-e.s:e=new h(e.d||m.s!==e.s?m:NaN):e=new h(NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,p=e.d,u=h.precision,s=h.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new h(3===s?-0:0);e=new h(m)}return at?Ct(e,u,s):e}if(r=lt(e.e/gt),f=lt(m.e/gt),c=c.slice(),a=f-r){for((l=a<0)?(t=c,a=-a,o=p.length):(t=p,r=f,o=c.length),a>(n=Math.max(Math.ceil(u/gt),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((l=(n=c.length)<(o=p.length))&&(o=n),n=0;n<o;n++)if(c[n]!=p[n]){l=c[n]<p[n];break}a=0}for(l&&(t=c,c=p,p=t,e.s=-e.s),o=c.length,n=p.length-o;n>0;--n)c[o++]=0;for(n=p.length;n>a;){if(c[--n]<p[n]){for(i=n;i&&0===c[--i];)c[i]=yt-1;--c[i],c[n]+=yt}c[n]-=p[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=Ft(c,r),at?Ct(e,u,s):e):new h(3===s?-0:0)},wt.modulo=wt.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?Ct(new n(r),n.precision,n.rounding):(at=!1,9==n.modulo?(t=St(r,e.abs(),0,3,1)).s*=e.s:t=St(r,e,0,n.modulo,1),t=t.times(e),at=!0,r.minus(t))},wt.naturalExponential=wt.exp=function(){return zt(this)},wt.naturalLogarithm=wt.ln=function(){return qt(this)},wt.negated=wt.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Ct(e)},wt.plus=wt.add=function(e){var t,r,n,i,a,o,u,s,c,f,l=this,p=l.constructor;if(e=new p(e),!l.d||!e.d)return l.s&&e.s?l.d||(e=new p(e.d||l.s===e.s?l:NaN)):e=new p(NaN),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(c=l.d,f=e.d,u=p.precision,s=p.rounding,!c[0]||!f[0])return f[0]||(e=new p(l)),at?Ct(e,u,s):e;if(a=lt(l.e/gt),n=lt(e.e/gt),c=c.slice(),i=a-n){for(i<0?(r=c,i=-i,o=f.length):(r=f,n=a,o=c.length),i>(o=(a=Math.ceil(u/gt))>o?a+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=f.length)<0&&(i=o,r=f,f=c,c=r),t=0;i;)t=(c[--i]=c[i]+f[i]+t)/yt|0,c[i]%=yt;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=Ft(c,n),at?Ct(e,u,s):e},wt.precision=wt.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ut+e);return r.d?(t=Bt(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},wt.round=function(){var e=this,t=e.constructor;return Ct(new t(e),e.e+1,t.rounding)},wt.sine=wt.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+gt,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Ut(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=Ut(e,2,t=t.times(1/$t(5,r)),t);for(var i,a=new e(5),o=new e(16),u=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(u))));return t}(n,Ht(n,r)),n.precision=e,n.rounding=t,Ct(Xe>2?r.neg():r,e,t,!0)):new n(NaN)},wt.squareRoot=wt.sqrt=function(){var e,t,r,n,i,a,o=this,u=o.d,s=o.e,c=o.s,f=o.constructor;if(1!==c||!u||!u[0])return new f(!c||c<0&&(!u||u[0])?NaN:u?o:1/0);for(at=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=Nt(u)).length+s)%2==0&&(t+="0"),c=Math.sqrt(t),s=lt((s+1)/2)-(s<0||s%2),n=new f(t=c==1/0?"5e"+s:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+s)):n=new f(c.toString()),r=(s=f.precision)+3;;)if(n=(a=n).plus(St(o,a,r+2,1)).times(.5),Nt(a.d).slice(0,r)===(t=Nt(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Ct(n,s+1,1),e=!n.times(n).eq(o));break}if(!i&&(Ct(a,s+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}return at=!0,Ct(n,s,f.rounding,e)},wt.tangent=wt.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=St(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Ct(2==Xe||4==Xe?r.neg():r,e,t,!0)):new n(NaN)},wt.times=wt.mul=function(e){var t,r,n,i,a,o,u,s,c,f=this,l=f.constructor,p=f.d,m=(e=new l(e)).d;if(e.s*=f.s,!(p&&p[0]&&m&&m[0]))return new l(!e.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*e.s:e.s/0);for(r=lt(f.e/gt)+lt(e.e/gt),(s=p.length)<(c=m.length)&&(a=p,p=m,m=a,o=s,s=c,c=o),a=[],n=o=s+c;n--;)a.push(0);for(n=c;--n>=0;){for(t=0,i=s+n;i>n;)u=a[i]+m[n]*p[i-n-1]+t,a[i--]=u%yt|0,t=u/yt|0;a[i]=(a[i]+t)%yt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=Ft(a,r),at?Ct(e,l.precision,l.rounding):e},wt.toBinary=function(e,t){return Gt(this,2,e,t)},wt.toDecimalPlaces=wt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(Dt(e,0,et),void 0===t?t=n.rounding:Dt(t,0,8),Ct(r,e+r.e+1,t))},wt.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=Mt(n,!0):(Dt(e,0,et),void 0===t?t=i.rounding:Dt(t,0,8),r=Mt(n=Ct(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},wt.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return void 0===e?r=Mt(i):(Dt(e,0,et),void 0===t?t=a.rounding:Dt(t,0,8),r=Mt(n=Ct(new a(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},wt.toFraction=function(e){var t,r,n,i,a,o,u,s,c,f,l,p,m=this,h=m.d,d=m.constructor;if(!h)return new d(m);if(c=r=new d(1),n=s=new d(0),o=(a=(t=new d(n)).e=Bt(h)-m.e-1)%gt,t.d[0]=pt(10,o<0?gt+o:o),null==e)e=a>0?t:c;else{if(!(u=new d(e)).isInt()||u.lt(c))throw Error(ut+u);e=u.gt(t)?a>0?t:c:u}for(at=!1,u=new d(Nt(h)),f=d.precision,d.precision=a=h.length*gt*2;l=St(u,t,0,1,1),1!=(i=r.plus(l.times(n))).cmp(e);)r=n,n=i,i=c,c=s.plus(l.times(i)),s=i,i=t,t=u.minus(l.times(i)),u=i;return i=St(e.minus(r),n,0,1,1),s=s.plus(i.times(c)),r=r.plus(i.times(n)),s.s=c.s=m.s,p=St(c,n,a,1).minus(m).abs().cmp(St(s,r,a,1).minus(m).abs())<1?[c,n]:[s,r],d.precision=f,at=!0,p},wt.toHexadecimal=wt.toHex=function(e,t){return Gt(this,16,e,t)},wt.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:Dt(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(at=!1,r=St(r,e,0,t,1).times(e),at=!0,Ct(r)):(e.s=r.s,r=e),r},wt.toNumber=function(){return+this},wt.toOctal=function(e,t){return Gt(this,8,e,t)},wt.toPower=wt.pow=function(e){var t,r,n,i,a,o,u=this,s=u.constructor,c=+(e=new s(e));if(!(u.d&&e.d&&u.d[0]&&e.d[0]))return new s(pt(+u,c));if((u=new s(u)).eq(1))return u;if(n=s.precision,a=s.rounding,e.eq(1))return Ct(u,n,a);if((t=lt(e.e/gt))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=kt(s,u,r,n),e.s<0?new s(1).div(i):Ct(i,n,a);if((o=u.s)<0){if(t<e.d.length-1)return new s(NaN);if(0==(1&e.d[t])&&(o=1),0==u.e&&1==u.d[0]&&1==u.d.length)return u.s=o,u}return(t=0!=(r=pt(+u,c))&&isFinite(r)?new s(r+"").e:lt(c*(Math.log("0."+Nt(u.d))/Math.LN10+u.e+1)))>s.maxE+1||t<s.minE-1?new s(t>0?o/0:0):(at=!1,s.rounding=u.s=1,r=Math.min(12,(t+"").length),(i=zt(e.times(qt(u,n+r)),n)).d&&Et((i=Ct(i,n+5,1)).d,n,a)&&(t=n+10,+Nt((i=Ct(zt(e.times(qt(u,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=Ct(i,n+1,0))),i.s=o,at=!0,s.rounding=a,Ct(i,n,a))},wt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=Mt(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(Dt(e,1,et),void 0===t?t=i.rounding:Dt(t,0,8),r=Mt(n=Ct(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},wt.toSignificantDigits=wt.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(Dt(e,1,et),void 0===t?t=r.rounding:Dt(t,0,8)),Ct(new r(this),e,t)},wt.toString=function(){var e=this,t=e.constructor,r=Mt(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},wt.truncated=wt.trunc=function(){return Ct(new this.constructor(this),this.e+1,1)},wt.valueOf=wt.toJSON=function(){var e=this,t=e.constructor,r=Mt(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var St=function(){function e(e,t,r){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+i,e[a]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,a,o,u,s){var c,f,l,p,m,h,d,v,y,g,x,b,w,N,D,E,A,S,C,M,F=n.constructor,O=n.s==i.s?1:-1,T=n.d,B=i.d;if(!(T&&T[0]&&B&&B[0]))return new F(n.s&&i.s&&(T?!B||T[0]!=B[0]:B)?T&&0==T[0]||!B?0*O:O/0:NaN);for(s?(m=1,f=n.e-i.e):(s=yt,m=gt,f=lt(n.e/m)-lt(i.e/m)),C=B.length,A=T.length,g=(y=new F(O)).d=[],l=0;B[l]==(T[l]||0);l++);if(B[l]>(T[l]||0)&&f--,null==a?(N=a=F.precision,o=F.rounding):N=u?a+(n.e-i.e)+1:a,N<0)g.push(1),h=!0;else{if(N=N/m+2|0,l=0,1==C){for(p=0,B=B[0],N++;(l<A||p)&&N--;l++)D=p*s+(T[l]||0),g[l]=D/B|0,p=D%B|0;h=p||l<A}else{for((p=s/(B[0]+1)|0)>1&&(B=e(B,p,s),T=e(T,p,s),C=B.length,A=T.length),E=C,b=(x=T.slice(0,C)).length;b<C;)x[b++]=0;(M=B.slice()).unshift(0),S=B[0],B[1]>=s/2&&++S;do{p=0,(c=t(B,x,C,b))<0?(w=x[0],C!=b&&(w=w*s+(x[1]||0)),(p=w/S|0)>1?(p>=s&&(p=s-1),1==(c=t(d=e(B,p,s),x,v=d.length,b=x.length))&&(p--,r(d,C<v?M:B,v,s))):(0==p&&(c=p=1),d=B.slice()),(v=d.length)<b&&d.unshift(0),r(x,d,b,s),-1==c&&(c=t(B,x,C,b=x.length))<1&&(p++,r(x,C<b?M:B,b,s)),b=x.length):0===c&&(p++,x=[0]),g[l++]=p,c&&x[0]?x[b++]=T[E]||0:(x=[T[E]],b=1)}while((E++<A||void 0!==x[0])&&N--);h=void 0!==x[0]}g[0]||g.shift()}if(1==m)y.e=f,Je=h;else{for(l=1,p=g[0];p>=10;p/=10)l++;y.e=l+f*m-1,Ct(y,u?a+y.e+1:a,o,h)}return y}}();function Ct(e,t,r,n){var i,a,o,u,s,c,f,l,p,m=e.constructor;e:if(null!=t){if(!(l=e.d))return e;for(i=1,u=l[0];u>=10;u/=10)i++;if((a=t-i)<0)a+=gt,o=t,s=(f=l[p=0])/pt(10,i-o-1)%10|0;else if((p=Math.ceil((a+1)/gt))>=(u=l.length)){if(!n)break e;for(;u++<=p;)l.push(0);f=s=0,i=1,o=(a%=gt)-gt+1}else{for(f=u=l[p],i=1;u>=10;u/=10)i++;s=(o=(a%=gt)-gt+i)<0?0:f/pt(10,i-o-1)%10|0}if(n=n||t<0||void 0!==l[p+1]||(o<0?f:f%pt(10,i-o-1)),c=r<4?(s||n)&&(0==r||r==(e.s<0?3:2)):s>5||5==s&&(4==r||n||6==r&&(a>0?o>0?f/pt(10,i-o):0:l[p-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,c?(t-=e.e+1,l[0]=pt(10,(gt-t%gt)%gt),e.e=-t||0):l[0]=e.e=0,e;if(0==a?(l.length=p,u=1,p--):(l.length=p+1,u=pt(10,gt-a),l[p]=o>0?(f/pt(10,i-o)%pt(10,o)|0)*u:0),c)for(;;){if(0==p){for(a=1,o=l[0];o>=10;o/=10)a++;for(o=l[0]+=u,u=1;o>=10;o/=10)u++;a!=u&&(e.e++,l[0]==yt&&(l[0]=1));break}if(l[p]+=u,l[p]!=yt)break;l[p--]=0,u=1}for(a=l.length;0===l[--a];)l.pop()}return at&&(e.e>m.maxE?(e.d=null,e.e=NaN):e.e<m.minE&&(e.e=0,e.d=[0])),e}function Mt(e,t,r){if(!e.isFinite())return jt(e);var n,i=e.e,a=Nt(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+_t(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+_t(-i-1)+a,r&&(n=r-o)>0&&(a+=_t(n))):i>=o?(a+=_t(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+_t(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=_t(n))),a}function Ft(e,t){var r=e[0];for(t*=gt;r>=10;r/=10)t++;return t}function Ot(e,t,r){if(t>xt)throw at=!0,r&&(e.precision=r),Error(st);return Ct(new e(rt),t,1,!0)}function Tt(e,t,r){if(t>bt)throw Error(st);return Ct(new e(nt),t,r,!0)}function Bt(e){var t=e.length-1,r=t*gt+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function _t(e){for(var t="";e--;)t+="0";return t}function kt(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/gt+4);for(at=!1;;){if(r%2&&Vt((a=a.times(t)).d,o)&&(i=!0),0===(r=lt(r/2))){r=a.d.length-1,i&&0===a.d[r]&&++a.d[r];break}Vt((t=t.times(t)).d,o)}return at=!0,a}function It(e){return 1&e.d[e.d.length-1]}function Rt(e,t,r){for(var n,i=new e(t[0]),a=0;++a<t.length;){if(!(n=new e(t[a])).s){i=n;break}i[r](n)&&(i=n)}return i}function zt(e,t){var r,n,i,a,o,u,s,c=0,f=0,l=0,p=e.constructor,m=p.rounding,h=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(at=!1,s=h):s=t,u=new p(.03125);e.e>-2;)e=e.times(u),l+=5;for(s+=n=Math.log(pt(2,l))/Math.LN10*2+5|0,r=a=o=new p(1),p.precision=s;;){if(a=Ct(a.times(e),s,1),r=r.times(++f),Nt((u=o.plus(St(a,r,s,1))).d).slice(0,s)===Nt(o.d).slice(0,s)){for(i=l;i--;)o=Ct(o.times(o),s,1);if(null!=t)return p.precision=h,o;if(!(c<3&&Et(o.d,s-n,m,c)))return Ct(o,p.precision=h,m,at=!0);p.precision=s+=10,r=a=u=new p(1),f=0,c++}o=u}}function qt(e,t){var r,n,i,a,o,u,s,c,f,l,p,m=1,h=e,d=h.d,v=h.constructor,y=v.rounding,g=v.precision;if(h.s<0||!d||!d[0]||!h.e&&1==d[0]&&1==d.length)return new v(d&&!d[0]?-1/0:1!=h.s?NaN:d?0:h);if(null==t?(at=!1,f=g):f=t,v.precision=f+=10,n=(r=Nt(d)).charAt(0),!(Math.abs(a=h.e)<15e14))return c=Ot(v,f+2,g).times(a+""),h=qt(new v(n+"."+r.slice(1)),f-10).plus(c),v.precision=g,null==t?Ct(h,g,y,at=!0):h;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=Nt((h=h.times(e)).d)).charAt(0),m++;for(a=h.e,n>1?(h=new v("0."+r),a++):h=new v(n+"."+r.slice(1)),l=h,s=o=h=St(h.minus(1),h.plus(1),f,1),p=Ct(h.times(h),f,1),i=3;;){if(o=Ct(o.times(p),f,1),Nt((c=s.plus(St(o,new v(i),f,1))).d).slice(0,f)===Nt(s.d).slice(0,f)){if(s=s.times(2),0!==a&&(s=s.plus(Ot(v,f+2,g).times(a+""))),s=St(s,new v(m),f,1),null!=t)return v.precision=g,s;if(!Et(s.d,f-10,y,u))return Ct(s,v.precision=g,y,at=!0);v.precision=f+=10,c=o=h=St(l.minus(1),l.plus(1),f,1),p=Ct(h.times(h),f,1),i=u=1}s=c,i+=2}}function jt(e){return String(e.s*e.s/0)}function Pt(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%gt,r<0&&(n+=gt),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=gt;n<i;)e.d.push(+t.slice(n,n+=gt));t=t.slice(n),n=gt-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),at&&(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 Lt(e,t){var r,n,i,a,o,u,s,c,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),vt.test(t))return Pt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(ht.test(t))r=16,t=t.toLowerCase();else if(mt.test(t))r=2;else{if(!dt.test(t))throw Error(ut+t);r=8}for((a=t.search(/p/i))>0?(s=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),o=(a=t.indexOf("."))>=0,n=e.constructor,o&&(a=(u=(t=t.replace(".","")).length)-a,i=kt(n,new n(r),a,2*a)),a=f=(c=At(t,r,yt)).length-1;0===c[a];--a)c.pop();return a<0?new n(0*e.s):(e.e=Ft(c,f),e.d=c,at=!1,o&&(e=St(e,i,4*u)),s&&(e=e.times(Math.abs(s)<54?pt(2,s):_r.pow(2,s))),at=!0,e)}function Ut(e,t,r,n,i){var a,o,u,s,c=e.precision,f=Math.ceil(c/gt);for(at=!1,s=r.times(r),u=new e(n);;){if(o=St(u.times(s),new e(t++*t++),c,1),u=i?n.plus(o):n.minus(o),n=St(o.times(s),new e(t++*t++),c,1),void 0!==(o=u.plus(n)).d[f]){for(a=f;o.d[a]===u.d[a]&&a--;);if(-1==a)break}a=u,u=n,n=o,o=a}return at=!0,o.d.length=f+1,o}function $t(e,t){for(var r=e;--t;)r*=e;return r}function Ht(e,t){var r,n=t.s<0,i=Tt(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return Xe=n?4:1,t;if((r=t.divToInt(i)).isZero())Xe=n?3:2;else{if((t=t.minus(r.times(i))).lte(a))return Xe=It(r)?n?2:3:n?4:1,t;Xe=It(r)?n?1:4:n?3:2}return t.minus(i).abs()}function Gt(e,t,r,n){var i,a,o,u,s,c,f,l,p,m=e.constructor,h=void 0!==r;if(h?(Dt(r,1,et),void 0===n?n=m.rounding:Dt(n,0,8)):(r=m.precision,n=m.rounding),e.isFinite()){for(h?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(o=(f=Mt(e)).indexOf("."))>=0&&(f=f.replace(".",""),(p=new m(1)).e=f.length-o,p.d=At(Mt(p),10,i),p.e=p.d.length),a=s=(l=At(f,10,i)).length;0==l[--s];)l.pop();if(l[0]){if(o<0?a--:((e=new m(e)).d=l,e.e=a,l=(e=St(e,p,r,n,0,i)).d,a=e.e,c=Je),o=l[r],u=i/2,c=c||void 0!==l[r+1],c=n<4?(void 0!==o||c)&&(0===n||n===(e.s<0?3:2)):o>u||o===u&&(4===n||c||6===n&&1&l[r-1]||n===(e.s<0?8:7)),l.length=r,c)for(;++l[--r]>i-1;)l[r]=0,r||(++a,l.unshift(1));for(s=l.length;!l[s-1];--s);for(o=0,f="";o<s;o++)f+=tt.charAt(l[o]);if(h){if(s>1)if(16==t||8==t){for(o=16==t?4:3,--s;s%o;s++)f+="0";for(s=(l=At(f,i,t)).length;!l[s-1];--s);for(o=1,f="1.";o<s;o++)f+=tt.charAt(l[o])}else f=f.charAt(0)+"."+f.slice(1);f=f+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)f="0"+f;f="0."+f}else if(++a>s)for(a-=s;a--;)f+="0";else a<s&&(f=f.slice(0,a)+"."+f.slice(a))}else f=h?"0p+0":"0";f=(16==t?"0x":2==t?"0b":8==t?"0o":"")+f}else f=jt(e);return e.s<0?"-"+f:f}function Vt(e,t){if(e.length>t)return e.length=t,!0}function Zt(e){return new this(e).abs()}function Wt(e){return new this(e).acos()}function Yt(e){return new this(e).acosh()}function Jt(e,t){return new this(e).plus(t)}function Xt(e){return new this(e).asin()}function Qt(e){return new this(e).asinh()}function Kt(e){return new this(e).atan()}function er(e){return new this(e).atanh()}function tr(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?Tt(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=Tt(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,r=this.atan(St(e,t,a,1)),t=Tt(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(St(e,t,a,1)):(r=Tt(this,a,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function rr(e){return new this(e).cbrt()}function nr(e){return Ct(e=new this(e),e.e+1,2)}function ir(e,t,r){return new this(e).clamp(t,r)}function ar(e){if(!e||"object"!=typeof e)throw Error(ot+"Object expected");var t,r,n,i=!0===e.defaults,a=["precision",1,et,"rounding",0,8,"toExpNeg",-Ke,0,"toExpPos",0,Ke,"maxE",0,Ke,"minE",-Ke,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=it[r]),void 0!==(n=e[r])){if(!(lt(n)===n&&n>=a[t+1]&&n<=a[t+2]))throw Error(ut+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=it[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(ut+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(ct);this[r]=!0}else this[r]=!1}return this}function or(e){return new this(e).cos()}function ur(e){return new this(e).cosh()}function sr(e,t){return new this(e).div(t)}function cr(e){return new this(e).exp()}function fr(e){return Ct(e=new this(e),e.e+1,3)}function lr(){var e,t,r=new this(0);for(at=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return at=!0,new this(1/0);r=t}return at=!0,r.sqrt()}function pr(e){return e instanceof _r||e&&e.toStringTag===ft||!1}function mr(e){return new this(e).ln()}function hr(e,t){return new this(e).log(t)}function dr(e){return new this(e).log(2)}function vr(e){return new this(e).log(10)}function yr(){return Rt(this,arguments,"lt")}function gr(){return Rt(this,arguments,"gt")}function xr(e,t){return new this(e).mod(t)}function br(e,t){return new this(e).mul(t)}function wr(e,t){return new this(e).pow(t)}function Nr(e){var t,r,n,i,a=0,o=new this(1),u=[];if(void 0===e?e=this.precision:Dt(e,1,et),n=Math.ceil(e/gt),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)(i=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:u[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error(ct);for(t=crypto.randomBytes(n*=4);a<n;)(i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(u.push(i%1e7),a+=4);a=n/4}else for(;a<n;)u[a++]=1e7*Math.random()|0;for(n=u[--a],e%=gt,n&&e&&(i=pt(10,gt-e),u[a]=(n/i|0)*i);0===u[a];a--)u.pop();if(a<0)r=0,u=[0];else{for(r=-1;0===u[0];r-=gt)u.shift();for(n=1,i=u[0];i>=10;i/=10)n++;n<gt&&(r-=gt-n)}return o.e=r,o.d=u,o}function Dr(e){return Ct(e=new this(e),e.e+1,this.rounding)}function Er(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ar(e){return new this(e).sin()}function Sr(e){return new this(e).sinh()}function Cr(e){return new this(e).sqrt()}function Mr(e,t){return new this(e).sub(t)}function Fr(){var e=0,t=arguments,r=new this(t[e]);for(at=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return at=!0,Ct(r,this.precision,this.rounding)}function Or(e){return new this(e).tan()}function Tr(e){return new this(e).tanh()}function Br(e){return Ct(e=new this(e),e.e+1,1)}wt[Symbol.for("nodejs.util.inspect.custom")]=wt.toString,wt[Symbol.toStringTag]="Decimal";var _r=wt.constructor=function e(t){var r,n,i;function a(e){var t,r,n,i=this;if(!(i instanceof a))return new a(e);if(i.constructor=a,pr(e))return i.s=e.s,void(at?!e.d||e.e>a.maxE?(i.e=NaN,i.d=null):e.e<a.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"==(n=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;return void(at?t>a.maxE?(i.e=NaN,i.d=null):t<a.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):Pt(i,e.toString())}if("string"!==n)throw Error(ut+e);return 45===(r=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===r&&(e=e.slice(1)),i.s=1),vt.test(e)?Pt(i,e):Lt(i,e)}if(a.prototype=wt,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=ar,a.clone=e,a.isDecimal=pr,a.abs=Zt,a.acos=Wt,a.acosh=Yt,a.add=Jt,a.asin=Xt,a.asinh=Qt,a.atan=Kt,a.atanh=er,a.atan2=tr,a.cbrt=rr,a.ceil=nr,a.clamp=ir,a.cos=or,a.cosh=ur,a.div=sr,a.exp=cr,a.floor=fr,a.hypot=lr,a.ln=mr,a.log=hr,a.log10=vr,a.log2=dr,a.max=yr,a.min=gr,a.mod=xr,a.mul=br,a.pow=wr,a.random=Nr,a.round=Dr,a.sign=Er,a.sin=Ar,a.sinh=Sr,a.sqrt=Cr,a.sub=Mr,a.sum=Fr,a.tan=Or,a.tanh=Tr,a.trunc=Br,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return a.config(t),a}(it);rt=new _r(rt),nt=new _r(nt);const kr=_r;var Ir=Ee("BigNumber",["?on","config"],(function(e){var t=e.on,r=e.config,n=kr.clone({precision:r.precision,modulo:kr.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})})),n}),{isClass:!0}),Rr=r(1977),zr=Ee("Complex",[],(function(){return Object.defineProperty(Rr,"name",{value:"Complex"}),Rr.prototype.constructor=Rr,Rr.prototype.type="Complex",Rr.prototype.isComplex=!0,Rr.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Rr.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Rr.prototype.format=function(e){var t=this.im,r=this.re,n=ee(this.re,e),a=ee(this.im,e),o=i(e)?e:e?e.precision:null;if(null!==o){var u=Math.pow(10,-o);Math.abs(r/t)<u&&(r=0),Math.abs(t/r)<u&&(t=0)}return 0===t?n:0===r?1===t?"i":-1===t?"-i":a+"i":t<0?-1===t?n+" - i":n+" - "+a.substring(1)+"i":1===t?n+" + i":n+" + "+a+"i"},Rr.fromPolar=function(e){switch(arguments.length){case 1:var r=arguments[0];if("object"===t(r))return Rr(r);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],a=arguments[1];if(i(n)){if(s(a)&&a.hasBase("ANGLE")&&(a=a.toNumber("rad")),i(a))return new Rr({r:n,phi:a});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Rr.prototype.valueOf=Rr.prototype.toString,Rr.fromJSON=function(e){return new Rr(e)},Rr.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},Rr}),{isClass:!0}),qr=r(5628),jr=Ee("Fraction",[],(function(){return Object.defineProperty(qr,"name",{value:"Fraction"}),qr.prototype.constructor=qr,qr.prototype.type="Fraction",qr.prototype.isFraction=!0,qr.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},qr.fromJSON=function(e){return new qr(e)},qr}),{isClass:!0}),Pr=(r(3964),Ee("Range",[],(function(){function e(t,r,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=null!=t,o=null!=r,u=null!=n;if(i)if(a(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter start must be a number");if(o)if(a(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter end must be a number");if(u)if(a(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(t):0,this.end=o?parseFloat(r):0,this.step=u?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!=typeof t)return null;var r=t.split(":").map((function(e){return parseFloat(e)}));if(r.some((function(e){return isNaN(e)})))return null;switch(r.length){case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[2],r[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,r=this.step,n=this.end-t;return Z(r)===Z(n)?e=Math.ceil(n/r):0===n&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var t=this.start,r=this.step,n=this.end,i=0;if(r>0)for(;t<n;)e(t,[i],this),t+=r,i++;else if(r<0)for(;t>n;)e(t,[i],this),t+=r,i++},e.prototype.map=function(e){var t=[];return this.forEach((function(r,n,i){t[n[0]]=e(r,n,i)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,r){e[r[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=ee(this.start,e);return 1!==this.step&&(t+=":"+ee(this.step,e)),t+":"+ee(this.end,e)},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})),Lr=Ee("Matrix",[],(function(){function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0}),Ur=r(4687);function $r(){return $r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$r.apply(this,arguments)}function Hr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Gr(e,t){if(e){if("string"==typeof e)return Hr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hr(e,t):void 0}}function Vr(e){return function(e){if(Array.isArray(e))return Hr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Gr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zr(e,t,r){var n=new(0,e.constructor)(2),i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!V(r))throw new Error("size must be an integer");if(e.greaterThan(n.pow(r-1).sub(1))||e.lessThan(n.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(n.pow(r))),i="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function Wr(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function Yr(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function Jr(e,r){var n=function(e,r){return"number"==typeof e?ee(e,r):a(e)?function(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var r,n,i="auto";if(void 0!==t&&(t.notation&&(i=t.notation),"number"==typeof t?r=t:void 0!==t.precision&&(r=t.precision),t.wordSize&&"number"!=typeof(n=t.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return function(e,t){return e.toFixed(t)}(e,r);case"exponential":return Wr(e,r);case"engineering":return function(e,t){var r=e.e,n=r%3==0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)).toPrecision(t);return-1!==i.indexOf("e")&&(i=new(0,e.constructor)(i).toFixed()),i+"e"+(r>=0?"+":"")+n.toString()}(e,r);case"bin":return Zr(e,2,n);case"oct":return Zr(e,8,n);case"hex":return Zr(e,16,n);case"auto":var a=t&&void 0!==t.lowerExp?t.lowerExp:-3,o=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var u=e.toSignificantDigits(r),s=u.e;return(s>=a&&s<o?u.toFixed():Wr(e,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}(e,r):function(e){return e&&"object"===t(e)&&"number"==typeof e.s&&"number"==typeof e.n&&"number"==typeof e.d||!1}(e)?r&&"decimal"===r.fraction?e.toString():e.s*e.n+"/"+e.d:Array.isArray(e)?en(e,r):c(e)?Xr(e):"function"==typeof e?e.syntax?String(e.syntax):"function":e&&"object"===t(e)?"function"==typeof e.format?e.format(r):e&&e.toString(r)!=={}.toString()?e.toString(r):"{"+Object.keys(e).map((function(t){return Xr(t)+": "+Jr(e[t],r)})).join(", ")+"}":String(e)}(e,r);return r&&"object"===t(r)&&"truncate"in r&&n.length>r.truncate?n.substring(0,r.truncate-3)+"...":n}function Xr(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in Qr?Qr[i]:i,n++}return'"'+r+'"'}r(278),r(7895),r(7729),r(7389),r(5284);var Qr={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function Kr(e){var t=String(e);return t.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function en(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)0!==i&&(r+=", "),r+=en(e[i],t);return r+"]"}return Jr(e,t)}function tn(e,t){if(!c(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+H(e)+", index: 0)");if(!c(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+H(t)+", index: 1)");return e===t?0:e>t?1:-1}function rn(e,t,r){if(!(this instanceof rn))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function nn(e,t,r){if(!(this instanceof nn))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=r),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function an(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function on(e,t,r){var n,i=e.length;if(i!==t[r])throw new rn(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new rn(t.length-1,t.length,"<");on(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new rn(t.length+1,t.length,">")}function un(e,t){if(0===t.length){if(Array.isArray(e))throw new rn(e.length,0)}else on(e,t,0)}function sn(e,t){var r=e.isMatrix?e._size:an(e);t._sourceSize.forEach((function(e,t){if(null!==e&&e!==r[t])throw new rn(e,r[t])}))}function cn(e,t){if(void 0!==e){if(!i(e)||!V(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new nn(e,t)}}function fn(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];if(r._data&&f(r._data)){if(0===r._size[0])return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(c(r)&&0===r.length)return!0}return!1}function ln(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach((function(e){if(!i(e)||!V(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Jr(t)+")")})),(i(e)||a(e))&&(e=[e]),pn(e,t,0,void 0!==r?r:0),e}function pn(e,t,r,n){var i,a,o=e.length,u=t[r],s=Math.min(o,u);if(e.length=u,r<t.length-1){var c=r+1;for(i=0;i<s;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),pn(a,t,c,n);for(i=s;i<u;i++)a=[],e[i]=a,pn(a,t,c,n)}else{for(i=0;i<s;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=s;i<u;i++)e[i]=n}}function mn(e,t){var r=bn(e),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new rn(0,n,"!=");var i=dn(t=hn(t,n));if(n!==i)throw new rn(i,n,"!=");try{return function(e,t){for(var r,n=e,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,u=0;u<o;u++)r.push(n.slice(u*a,(u+1)*a));n=r}return n}(r,t)}catch(e){if(e instanceof rn)throw new rn(i,n,"!=");throw e}}function hn(e,t){var r=dn(e),n=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(t%r!=0)throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[i]=-t/r}return n}function dn(e){return e.reduce((function(e,t){return e*t}),1)}function vn(e,t){for(var r=t||an(e);Array.isArray(e)&&1===e.length;)e=e[0],r.shift();for(var n=r.length;1===r[n-1];)n--;return n<r.length&&(e=yn(e,n,0),r.length=n),e}function yn(e,t,r){var n,i;if(r<t){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=yn(e[n],t,a)}else for(;Array.isArray(e);)e=e[0];return e}function gn(e,t,r,n){var i=n||an(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=xn(e,t,0);i.length<t;)i.push(1);return e}function xn(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=xn(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function bn(e){if(!Array.isArray(e))return e;var t=[];return e.forEach((function e(r){Array.isArray(r)?r.forEach(e):t.push(r)})),t}function wn(e,t){return Array.prototype.map.call(e,t)}function Nn(e,t){Array.prototype.forEach.call(e,t)}function Dn(e,t){if(1!==an(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function En(e,t){if(1!==an(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(function(e){return t.test(e)}))}function An(e,t){return Array.prototype.join.call(e,t)}function Sn(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],r=0;t[0]={value:e[0],identifier:0};for(var n=1;n<e.length;n++)e[n]===e[n-1]?r++:r=0,t.push({value:e[n],identifier:r});return t}function Cn(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],r=0;r<e.length;r++)t.push(e[r].value);return t}function Mn(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(0===i&&o&&(n=a.length),o&&a.length!==n)return;var u=o?Mn(a,t):t(a);if(void 0===r)r=u;else if(r!==u)return"mixed"}return r}function Fn(e,t){return-1!==e.indexOf(t)}function On(e,t,r,n){if(n<r){if(e.length!==t.length)throw new rn(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=On(e[a],t[a],r,n+1);return i}return e.concat(t)}function Tn(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(1===e.length)return e[0];if(e.length>1)return e.slice(1).reduce((function(e,r){return On(e,r,t,0)}),e[0]);throw new Error("Wrong number of arguments in function concat")}function Bn(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function _n(e,t){var r=an(e);if(ge(r,t))return e;Bn(r,t);var n,i,a,o=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map((function(e){return e.length})),i=Math.max.apply(Math,Vr(n)),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var u=t[o],s=n[o],c=0;c<s;c++){var f=i-s+c;u[c]>a[f]&&(a[f]=u[c])}for(var l=0;l<t.length;l++)Bn(t[l],a);return a}(r,t),u=o.length,s=[].concat(Vr(Array(u-r.length).fill(1)),Vr(r)),c=function(e){return $r([],e)}(e);r.length<u&&(r=an(c=mn(c,s)));for(var f=0;f<u;f++)r[f]<o[f]&&(n=c,i=o[f],a=f,r=an(c=Tn.apply(void 0,Vr(Array(i).fill(n)).concat([a]))));return c}function kn(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(e){var o=i[e];if(o&&(delete n[o],delete i[e],--t,r===o)){if(!t)return a=0,void(r=1);for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(u){var s=i[u],c=++a;if(n[c]=u,i[u]=c,!s){if(++t<=e)return;return u=n[r],o(u),u}if(delete n[s],r===s)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function In(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.hasher,i=r.limit;return i=null==i?Number.POSITIVE_INFINITY:i,n=null==n?JSON.stringify:n,function r(){"object"!==t(r.cache)&&(r.cache={values:new Map,lru:kn(i||Number.POSITIVE_INFINITY)});for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var u=n(a);if(r.cache.values.has(u))return r.cache.lru.hit(u),r.cache.values.get(u);var s=e.apply(e,a);return r.cache.values.set(u,s),r.cache.values.delete(r.cache.lru.hit(u)),s}}function Rn(e){return Object.keys(e.signatures||{}).reduce((function(e,t){var r=(t.match(/,/g)||[]).length+1;return Math.max(e,r)}),-1)}function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}rn.prototype=new RangeError,rn.prototype.constructor=RangeError,rn.prototype.name="DimensionError",rn.prototype.isDimensionError=!0,nn.prototype=new RangeError,nn.prototype.constructor=RangeError,nn.prototype.name="IndexError",nn.prototype.isIndexError=!0,r(8324);var qn=Ee("DenseMatrix",["Matrix"],(function(e){var t=e.Matrix;function r(e,t){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(l(e))"DenseMatrix"===e.type?(this._data=he(e._data),this._size=he(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,un(this._data,this._size),this._datatype=t||e.datatype;else if(f(e))this._data=m(e),this._size=an(this._data),un(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+H(e)+")");this._data=[],this._size=[0],this._datatype=t}}function n(e,t,r,i){var a=i===r-1,o=t.dimension(i);return a?o.map((function(t){return cn(t,e.length),e[t]})).valueOf():o.map((function(a){return cn(a,e.length),n(e[a],t,r,i+1)})).valueOf()}function o(e,t,r,n,i){var a=i===n-1,u=t.dimension(i);a?u.forEach((function(t,n){cn(t),e[t]=r[n[0]]})):u.forEach((function(a,u){cn(a),o(e[a],t,r[u[0]],n,i+1)}))}function u(e,t,r){if(0===t.length){for(var n=e._data;f(n);)n=n[0];return n}return e._size=t.slice(0),e._data=ln(e._data,e._size,r),e}function s(e,t,r){for(var n=e._size.slice(0),i=!1;n.length<t.length;)n.push(0),i=!0;for(var a=0,o=t.length;a<o;a++)t[a]>n[a]&&(n[a]=t[a],i=!0);i&&u(e,n,r)}function m(e){return l(e)?m(e.valueOf()):f(e)?e.map(m):e}return 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 Mn(this._data,H)},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,i){switch(arguments.length){case 1:return function(e,t){if(!v(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var i=t.size();if(i.length!==e._size.length)throw new rn(i.length,e._size.length);for(var a=t.min(),o=t.max(),u=0,s=e._size.length;u<s;u++)cn(a[u],e._size[u]),cn(o[u],e._size[u]);return new r(n(e._data,t,i.length,0),e._datatype)}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),u=t.isScalar();if(l(r)?(i=r.size(),r=r.valueOf()):i=an(r),u){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(!ge(i,a))try{i=an(r=0===i.length?_n([r],a):_n(r,a))}catch(e){}if(a.length<e._size.length)throw new rn(a.length,e._size.length,"<");if(i.length<a.length){for(var c=0,f=0;1===a[c]&&1===i[c];)c++;for(;1===a[c];)f++,c++;r=gn(r,a.length,f,i)}if(!ge(a,i))throw new rn(a,i,">");var p=t.max().map((function(e){return e+1}));s(e,p,n);var m=a.length;o(e._data,t,r,m,0)}return e}(this,e,t,i);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new rn(e.length,this._size.length);for(var t=0;t<e.length;t++)cn(e[t],this._size[t]);for(var r=this._data,n=0,i=e.length;n<i;n++){var a=e[n];cn(a,r.length),r=r[a]}return r},r.prototype.set=function(e,t,r){if(!f(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new rn(e.length,this._size.length,"<");var n,i,a,o=e.map((function(e){return e+1}));s(this,o,r);var u=this._data;for(n=0,i=e.length-1;n<i;n++)cn(a=e[n],u.length),u=u[a];return cn(a=e[e.length-1],u.length),u[a]=t,this},r.prototype.resize=function(e,t,r){if(!p(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));return u(r?this.clone():this,n,t)},r.prototype.reshape=function(e,t){var r=t?this.clone():this;r._data=mn(r._data,e);var n=r._size.reduce((function(e,t){return e*t}));return r._size=hn(e,n),r},r.prototype.clone=function(){return new r({data:he(this._data),size:he(this._size),datatype:this._datatype})},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(e){var t=this,n=Rn(e),i=function r(i,a){return f(i)?i.map((function(e,t){return r(e,a.concat(t))})):1===n?e(i):2===n?e(i,a):e(i,a,t)}(this._data,[]);return new r(i,void 0!==this._datatype?Mn(i,H):void 0)},r.prototype.forEach=function(e){var t=this;!function r(n,i){f(n)?n.forEach((function(e,t){r(e,i.concat(t))})):e(n,i,t)}(this._data,[])},r.prototype[Symbol.iterator]=Ur.mark((function e(){var t;return Ur.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Ur.mark((function e(t,r){var n;return Ur.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!f(t)){i.next=9;break}n=0;case 2:if(!(n<t.length)){i.next=7;break}return i.delegateYield(e(t[n],r.concat(n)),"t0",4);case 4:n++,i.next=2;break;case 7:i.next=11;break;case 9:return i.next=11,{value:t,index:r};case 11:case"end":return i.stop()}}),e)})),e.delegateYield(t(this._data,[]),"t0",2);case 2:case"end":return e.stop()}}),e,this)})),r.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return zn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(this._data);try{for(n.s();!(t=n.n()).done;){var i=t.value;e.push(new r([i],this._datatype))}}catch(e){n.e(e)}finally{n.f()}return e},r.prototype.columns=function(){var e=this,t=[],n=this.size();if(2!==n.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,a=function(n){var a=i.map((function(e){return[e[n]]}));t.push(new r(a,e._datatype))},o=0;o<n[1];o++)a(o);return t},r.prototype.toArray=function(){return he(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(e){return Jr(this._data,e)},r.prototype.toString=function(){return Jr(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(a(e)&&(e=e.toNumber()),!i(e)||!V(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,n=e<0?-e:0,o=this._size[0],u=this._size[1],s=Math.min(o-n,u-t),c=[],f=0;f<s;f++)c[f]=this._data[f+n][f+t];return new r({data:c,size:[s],datatype:this._datatype})},r.diagonal=function(e,t,n,o){if(!f(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e)||e<1)throw new Error("Size values must be positive integers");return e})),n){if(a(n)&&(n=n.toNumber()),!i(n)||!V(n))throw new TypeError("The parameter k must be an integer number")}else n=0;var u,s=n>0?n:0,c=n<0?-n:0,p=e[0],m=e[1],h=Math.min(p-c,m-s);if(f(t)){if(t.length!==h)throw new Error("Invalid value array length");u=function(e){return t[e]}}else if(l(t)){var d=t.size();if(1!==d.length||d[0]!==h)throw new Error("Invalid matrix length");u=function(e){return t.get([e])}}else u=function(){return t};o||(o=a(u(0))?u(0).mul(0):0);var v=[];if(e.length>0){v=ln(v,e,o);for(var y=0;y<h;y++)v[y+c][y+s]=u(y)}return new r({data:v,size:[p,m]})},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(e,t){if(!(i(e)&&V(e)&&i(t)&&V(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return cn(e,this._size[0]),cn(t,this._size[0]),r._swapRows(e,t,this._data),this},r._swapRows=function(e,t,r){var n=r[e];r[e]=r[t],r[t]=n},r}),{isClass:!0}),jn="clone",Pn=Ee(jn,["typed"],(function(e){return(0,e.typed)(jn,{any:he})}));function Ln(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r<i;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);a.push(o)}return a}function Un(e){for(var t=0;t<e.length;t++)if(p(e[t]))return!0;return!1}function $n(e,t){l(e)&&(e=e.valueOf());for(var r=0,n=e.length;r<n;r++){var i=e[r];Array.isArray(i)?$n(i,t):t(i)}}function Hn(e,t,r){return e&&"function"==typeof e.map?e.map((function(e){return Hn(e,t,r)})):t(e)}function Gn(e,t,r){var n=Array.isArray(e)?an(e):e.size();if(t<0||t>=n.length)throw new nn(t,n.length);return l(e)?e.create(Vn(e.valueOf(),t,r)):Vn(e,t,r)}function Vn(e,t,r){var n,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=Ln(e),i=[],n=0;n<o.length;n++)i[n]=Vn(o[n],t-1,r);return i}for(a=e[0],n=1;n<e.length;n++)a=r(a,e[n]);return a}for(i=[],n=0;n<e.length;n++)i[n]=Vn(e[n],t-1,r);return i}function Zn(e,t,r,n,i,a,o,u,s,c,f){var l,p,m,h,d=e._values,v=e._index,y=e._ptr;if(n)for(p=y[t],m=y[t+1],l=p;l<m;l++)r[h=v[l]]!==a?(r[h]=a,o.push(h),c?(n[h]=s?u(d[l],f):u(f,d[l]),i[h]=a):n[h]=d[l]):(n[h]=s?u(d[l],n[h]):u(n[h],d[l]),i[h]=a);else for(p=y[t],m=y[t+1],l=p;l<m;l++)r[h=v[l]]!==a?(r[h]=a,o.push(h)):i[h]=a}var Wn="isInteger",Yn=Ee(Wn,["typed"],(function(e){var t=e.typed;return t(Wn,{number:V,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Jn=(r(5728),r(5993),"number");function Xn(e){return e<0}function Qn(e){return e>0}function Kn(e){return 0===e}function ei(e){return Number.isNaN(e)}Xn.signature=Jn,Qn.signature=Jn,Kn.signature=Jn,ei.signature=Jn;var ti="isNegative",ri=Ee(ti,["typed"],(function(e){var t=e.typed;return t(ti,{number:Xn,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),ni="isNumeric",ii=Ee(ni,["typed"],(function(e){var t=e.typed;return t(ni,{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),ai=(r(8436),"hasNumericValue"),oi=Ee(ai,["typed","isNumeric"],(function(e){var t=e.typed,r=e.isNumeric;return t(ai,{boolean:function(){return!0},string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return r(e)}})})),ui="isPositive",si=Ee(ui,["typed"],(function(e){var t=e.typed;return t(ui,{number:Qn,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),ci="isZero",fi=Ee(ci,["typed"],(function(e){var t=e.typed;return t(ci,{number:Kn,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),li="isNaN",pi=Ee(li,["typed"],(function(e){return(0,e.typed)(li,{number:ei,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return Hn(e,Number.isNaN)}})})),mi="typeOf",hi=Ee(mi,["typed"],(function(e){return(0,e.typed)(mi,{any:H})}));function di(e,t,r){if(null==r)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var n=e.minus(t).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return n.lte(i.times(r))}return!1}var vi=Ee("compareUnits",["typed"],(function(e){var t=e.typed;return{"Unit, Unit":t.referToSelf((function(e){return function(r,n){if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return t.find(e,[r.valueType(),n.valueType()])(r.value,n.value)}}))}})),yi="equalScalar",gi=Ee(yi,["typed","config"],(function(e){var t=e.typed,r=e.config,n=vi({typed:t});return t(yi,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return ue(e,t,r.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||di(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,r){return ue(e.re,t.re,r)&&ue(e.im,t.im,r)}(e,t,r.epsilon)}},n)})),xi=(Ee(yi,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(yi,{"number, number":function(e,t){return ue(e,t,r.epsilon)}})})),Ee("SparseMatrix",["typed","equalScalar","Matrix"],(function(e){var t=e.typed,r=e.equalScalar,n=e.Matrix;function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(l(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?he(t._values):void 0,e._index=he(t._index),e._ptr=he(t._ptr),e._size=he(t._size),e._datatype=r||t._datatype):u(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&f(e.index)&&f(e.ptr)&&f(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(f(e))u(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+H(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function u(e,n,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=n.length,o=0,u=r,s=0;if(c(i)&&(u=t.find(r,[i,i])||r,s=t.convert(0,i)),a>0){var l=0;do{e._ptr.push(e._index.length);for(var p=0;p<a;p++){var m=n[p];if(f(m)){if(0===l&&o<m.length&&(o=m.length),l<m.length){var h=m[l];u(h,s)||(e._values.push(h),e._index.push(p))}}else 0===l&&o<1&&(o=1),u(m,s)||(e._values.push(m),e._index.push(p))}l++}while(l<o)}e._ptr.push(e._index.length),e._size=[a,o]}function s(e,t,r,n){if(r-t==0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function m(e,t,r,n,i,a,o){i.splice(e,0,n),a.splice(e,0,t);for(var u=r+1;u<o.length;u++)o[u]++}function h(e,n,i,a){var o=a||0,u=r,s=0;c(e._datatype)&&(u=t.find(r,[e._datatype,e._datatype])||r,s=t.convert(0,e._datatype),o=t.convert(o,e._datatype));var f,l,p,m=!u(o,s),h=e._size[0],d=e._size[1];if(i>d){for(l=d;l<i;l++)if(e._ptr[l]=e._values.length,m)for(f=0;f<h;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,n>h){if(m){var v=0;for(l=0;l<d;l++){e._ptr[l]=e._ptr[l]+v,p=e._ptr[l+1]+v;var y=0;for(f=h;f<n;f++,y++)e._values.splice(p+y,0,o),e._index.splice(p+y,0,f),v++}e._ptr[d]=e._values.length}}else if(n<h){var g=0;for(l=0;l<d;l++){e._ptr[l]=e._ptr[l]-g;var x=e._ptr[l],b=e._ptr[l+1]-g;for(p=x;p<b;p++)(f=e._index[p])>n-1&&(e._values.splice(p,1),e._index.splice(p,1),g++)}e._ptr[l]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function d(e,t,r,n,i){var a,o,u=n[0],s=n[1],c=[];for(a=0;a<u;a++)for(c[a]=[],o=0;o<s;o++)c[a][o]=0;for(o=0;o<s;o++)for(var f=r[o],l=r[o+1],p=f;p<l;p++)c[a=t[p]][o]=e?i?he(e[p]):e[p]:1;return c}return o.prototype=new n,o.prototype.createSparseMatrix=function(e,t){return new o(e,t)},Object.defineProperty(o,"name",{value:"SparseMatrix"}),o.prototype.constructor=o,o.prototype.type="SparseMatrix",o.prototype.isSparseMatrix=!0,o.prototype.getDataType=function(){return Mn(this._values,H)},o.prototype.storage=function(){return"sparse"},o.prototype.datatype=function(){return this._datatype},o.prototype.create=function(e,t){return new o(e,t)},o.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},o.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!v(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,i,a,u=t.size();if(u.length!==e._size.length)throw new rn(u.length,e._size.length);var s=t.min(),c=t.max();for(r=0,n=e._size.length;r<n;r++)cn(s[r],e._size[r]),cn(c[r],e._size[r]);var f=e._values,l=e._index,p=e._ptr,m=t.dimension(0),h=t.dimension(1),d=[],y=[];m.forEach((function(e,t){y[e]=t[0],d[e]=!0}));var g=f?[]:void 0,x=[],b=[];return h.forEach((function(e){for(b.push(x.length),i=p[e],a=p[e+1];i<a;i++)r=l[i],!0===d[r]&&(x.push(y[r]),g&&g.push(f[i]))})),b.push(x.length),new o({values:g,index:x,ptr:b,size:u,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),o=t.isScalar();if(l(r)?(i=r.size(),r=r.toArray()):i=an(r),o){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==a.length&&2!==a.length)throw new rn(a.length,e._size.length,"<");if(i.length<a.length){for(var u=0,s=0;1===a[u]&&1===i[u];)u++;for(;1===a[u];)s++,u++;r=gn(r,a.length,s,i)}if(!ge(a,i))throw new rn(a,i,">");if(1===a.length)t.dimension(0).forEach((function(t,i){cn(t),e.set([t,0],r[i[0]],n)}));else{var c=t.dimension(0),f=t.dimension(1);c.forEach((function(t,i){cn(t),f.forEach((function(a,o){cn(a),e.set([t,a],r[i[0]][o[0]],n)}))}))}}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new rn(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];cn(t,this._size[0]),cn(r,this._size[1]);var n=s(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},o.prototype.set=function(e,n,i){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new rn(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var a=e[0],o=e[1],u=this._size[0],l=this._size[1],p=r,d=0;c(this._datatype)&&(p=t.find(r,[this._datatype,this._datatype])||r,d=t.convert(0,this._datatype)),(a>u-1||o>l-1)&&(h(this,Math.max(a+1,u),Math.max(o+1,l),i),u=this._size[0],l=this._size[1]),cn(a,u),cn(o,l);var v=s(a,this._ptr[o],this._ptr[o+1],this._index);return v<this._ptr[o+1]&&this._index[v]===a?p(n,d)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(var a=t+1;a<i.length;a++)i[a]--}(v,o,this._values,this._index,this._ptr):this._values[v]=n:p(n,d)||m(v,a,o,n,this._values,this._index,this._ptr),this},o.prototype.resize=function(e,t,r){if(!p(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));if(2!==n.length)throw new Error("Only two dimensions matrix are supported");return n.forEach((function(e){if(!i(e)||!V(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Jr(n)+")")})),h(r?this.clone():this,n[0],n[1],t)},o.prototype.reshape=function(e,t){if(!f(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(t){if(!i(t)||!V(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Jr(e)+")")}));var r=this._size[0]*this._size[1];if(r!==(e=hn(e,r))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;for(var a=[],o=0;o<n._ptr.length;o++)for(var u=0;u<n._ptr[o+1]-n._ptr[o];u++)a.push(o);for(var c=n._values.slice(),l=n._index.slice(),p=0;p<n._index.length;p++){var h=l[p],d=a[p],v=h*n._size[1]+d;a[p]=v%e[1],l[p]=Math.floor(v/e[1])}n._values.length=0,n._index.length=0,n._ptr.length=e[1]+1,n._size=e.slice();for(var y=0;y<n._ptr.length;y++)n._ptr[y]=0;for(var g=0;g<c.length;g++){var x=l[g],b=a[g],w=c[g];m(s(x,n._ptr[b],n._ptr[b+1],n._index),x,b,w,n._values,n._index,n._ptr)}return n},o.prototype.clone=function(){return new o({values:this._values?he(this._values):void 0,index:he(this._index),ptr:he(this._ptr),size:he(this._size),datatype:this._datatype})},o.prototype.size=function(){return this._size.slice(0)},o.prototype.map=function(e,n){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var i=this,a=this._size[0],u=this._size[1],s=Rn(e);return function(e,n,i,a,u,s,f){var l=[],p=[],m=[],h=r,d=0;c(e._datatype)&&(h=t.find(r,[e._datatype,e._datatype])||r,d=t.convert(0,e._datatype));for(var v=function(e,t,r){e=s(e,t,r),h(e,d)||(l.push(e),p.push(t))},y=0;y<=u;y++){m.push(l.length);var g=e._ptr[y],x=e._ptr[y+1];if(f)for(var b=g;b<x;b++){var w=e._index[b];w>=0&&w<=i&&v(e._values[b],w-0,y-0)}else{for(var N={},D=g;D<x;D++)N[e._index[D]]=e._values[D];for(var E=0;E<=i;E++)v(E in N?N[E]:0,E-0,y-0)}}return m.push(l.length),new o({values:l,index:p,ptr:m,size:[i-0+1,u-0+1]})}(this,0,a-1,0,u-1,(function(t,r,n){return 1===s?e(t):2===s?e(t,[r,n]):e(t,[r,n],i)}),n)},o.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],i=0;i<n;i++){var a=this._ptr[i],o=this._ptr[i+1];if(t)for(var u=a;u<o;u++){var s=this._index[u];e(this._values[u],[s,i],this)}else{for(var c={},f=a;f<o;f++)c[this._index[f]]=this._values[f];for(var l=0;l<r;l++)e(l in c?c[l]:0,[l,i],this)}}},o.prototype[Symbol.iterator]=Ur.mark((function e(){var t,r,n,i,a,o;return Ur.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._values){e.next=2;break}throw new Error("Cannot iterate a Pattern only matrix");case 2:t=this._size[1],r=0;case 4:if(!(r<t)){e.next=18;break}n=this._ptr[r],i=this._ptr[r+1],a=n;case 8:if(!(a<i)){e.next=15;break}return o=this._index[a],e.next=12,{value:this._values[a],index:[o,r]};case 12:a++,e.next=8;break;case 15:r++,e.next=4;break;case 18:case"end":return e.stop()}}),e,this)})),o.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},o.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)},o.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+Jr(t,e)+" x "+Jr(r,e)+"] density: "+Jr(n,e)+"\n",a=0;a<r;a++)for(var o=this._ptr[a],u=this._ptr[a+1],s=o;s<u;s++)i+="\n ("+Jr(this._index[s],e)+", "+Jr(a,e)+") ==> "+(this._values?Jr(this._values[s],e):"X");return i},o.prototype.toString=function(){return Jr(this.toArray())},o.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},o.prototype.diagonal=function(e){if(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,r=e<0?-e:0,n=this._size[0],u=this._size[1],s=Math.min(n-r,u-t),c=[],f=[],l=[];l[0]=0;for(var p=t;p<u&&c.length<s;p++)for(var m=this._ptr[p],h=this._ptr[p+1],d=m;d<h;d++){var v=this._index[d];if(v===p-t+r){c.push(this._values[d]),f[c.length-1]=v-r;break}}return l.push(c.length),new o({values:c,index:f,ptr:l,size:[s,1]})},o.fromJSON=function(e){return new o(e)},o.diagonal=function(e,n,u,s,p){if(!f(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map((function(e){if(a(e)&&(e=e.toNumber()),!i(e)||!V(e)||e<1)throw new Error("Size values must be positive integers");return e})),u){if(a(u)&&(u=u.toNumber()),!i(u)||!V(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var m=r,h=0;c(p)&&(m=t.find(r,[p,p])||r,h=t.convert(0,p));var d,v=u>0?u:0,y=u<0?-u:0,g=e[0],x=e[1],b=Math.min(g-y,x-v);if(f(n)){if(n.length!==b)throw new Error("Invalid value array length");d=function(e){return n[e]}}else if(l(n)){var w=n.size();if(1!==w.length||w[0]!==b)throw new Error("Invalid matrix length");d=function(e){return n.get([e])}}else d=function(){return n};for(var N=[],D=[],E=[],A=0;A<x;A++){E.push(N.length);var S=A-v;if(S>=0&&S<b){var C=d(S);m(C,h)||(D.push(S+y),N.push(C))}}return E.push(N.length),new o({values:N,index:D,ptr:E,size:[g,x]})},o.prototype.swapRows=function(e,t){if(!(i(e)&&V(e)&&i(t)&&V(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return cn(e,this._size[0]),cn(t,this._size[0]),o._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},o._forEachRow=function(e,t,r,n,i){for(var a=n[e],o=n[e+1],u=a;u<o;u++)i(r[u],t[u])},o._swapRows=function(e,t,r,n,i,a){for(var o=0;o<r;o++){var u=a[o],c=a[o+1],f=s(e,u,c,i),l=s(t,u,c,i);if(f<c&&l<c&&i[f]===e&&i[l]===t){if(n){var p=n[f];n[f]=n[l],n[l]=p}}else if(f<c&&i[f]===e&&(l>=c||i[l]!==t)){var m=n?n[f]:void 0;i.splice(l,0,t),n&&n.splice(l,0,m),i.splice(l<=f?f+1:f,1),n&&n.splice(l<=f?f+1:f,1)}else if(l<c&&i[l]===t&&(f>=c||i[f]!==e)){var h=n?n[l]:void 0;i.splice(f,0,e),n&&n.splice(f,0,h),i.splice(f<=l?l+1:l,1),n&&n.splice(f<=l?l+1:l,1)}}},o}),{isClass:!0})),bi=Ee("number",["typed"],(function(e){var t=e.typed,r=t("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t,r,n=(r=(t=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:t,radix:{"0b":2,"0o":8,"0x":16}[r[1]],integerPart:r[2],fractionalPart:r[3]}:null;if(n)return function(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++)r+=parseInt(e.fractionalPart[n],e.radix)/Math.pow(e.radix,n+1);var i=t+r;if(isNaN(i))throw new SyntaxError('String "'+e.input+'" is not a valid number');return i}(n);var i=0,a=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);a&&(i=Number(a[2]),e=a[1]);var o=Number(e);if(isNaN(o))throw new SyntaxError('String "'+e+'" is not a valid number');if(a){if(o>Math.pow(2,i)-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=Math.pow(2,i-1)&&(o-=Math.pow(2,i))}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf((function(e){return function(t){var r=t.clone();return r.value=e(t.value),r}})),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))});return r.fromJSON=function(e){return parseFloat(e.value)},r})),wi="string",Ni=Ee(wi,["typed"],(function(e){var t=e.typed;return t(wi,{"":function(){return""},number:ee,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}})),any:function(e){return String(e)}})})),Di="boolean",Ei=Ee(Di,["typed"],(function(e){var t=e.typed;return t(Di,{"":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("true"===t)return!0;if("false"===t)return!1;var r=Number(e);if(""!==e&&!isNaN(r))return!!r;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Ai=Ee("bignumber",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var n=t[2],i=r(t[1]),a=new r(2).pow(Number(n));if(i.gt(a.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var o=new r(2).pow(Number(n)-1);return i.gte(o)?i.sub(a):i}return new r(e)},BigNumber:function(e){return e},Unit:t.referToSelf((function(e){return function(t){var r=t.clone();return r.value=e(t.value),r}})),Fraction:function(e){return new r(e.n).div(e.d).times(e.s)},null:function(e){return new r(0)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Si=Ee("complex",["typed","Complex"],(function(e){var t=e.typed,r=e.Complex;return t("complex",{"":function(){return r.ZERO},number:function(e){return new r(e,0)},"number, number":function(e,t){return new r(e,t)},"BigNumber, BigNumber":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if("re"in e&&"im"in e)return new r(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new r(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Ci=Ee("fraction",["typed","Fraction"],(function(e){var t=e.typed,r=e.Fraction;return t("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf((function(e){return function(t){var r=t.clone();return r.value=e(t.value),r}})),Object:function(e){return new r(e)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Mi="matrix",Fi=Ee(Mi,["typed","Matrix","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,r=(e.Matrix,e.DenseMatrix),n=e.SparseMatrix;return t(Mi,{"":function(){return i([])},string:function(e){return i([],e)},"string, string":function(e,t){return i([],e,t)},Array:function(e){return i(e)},Matrix:function(e){return i(e,e.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(e,t,i){if("dense"===t||"default"===t||void 0===t)return new r(e,i);if("sparse"===t)return new n(e,i);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Oi="matrixFromFunction",Ti=Ee(Oi,["typed","matrix","isZero"],(function(e){var t=e.typed,r=e.matrix,n=e.isZero;return t(Oi,{"Array | Matrix, function, string, string":function(e,t,r,n){return i(e,t,r,n)},"Array | Matrix, function, string":function(e,t,r){return i(e,t,r)},"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,r){return i(e,r,t)},"Array | Matrix, string, string, function":function(e,t,r,n){return i(e,n,t,r)}});function i(e,t,i,a){var o;return(o=void 0!==a?r(i,a):r(i)).resize(e),o.forEach((function(e,r){var i=t(r);n(i)||o.set(r,i)})),o}}));function Bi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var _i="matrixFromRows",ki=Ee(_i,["typed","matrix","flatten","size"],(function(e){var t=e.typed,r=e.matrix,n=e.flatten,i=e.size;return t(_i,{"...Array":function(e){return a(e)},"...Matrix":function(e){return r(a(e.map((function(e){return e.toArray()}))))}});function a(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var t,r=o(e[0]),i=[],a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Bi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bi(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(a.s();!(t=a.n()).done;){var u=t.value,s=o(u);if(s!==r)throw new TypeError("The vectors had different length: "+(0|r)+" ≠ "+(0|s));i.push(n(u))}}catch(e){a.e(e)}finally{a.f()}return i}function o(e){var t=i(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}}));function Ii(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ri="matrixFromColumns",zi=Ee(Ri,["typed","matrix","flatten","size"],(function(e){var t=e.typed,r=e.matrix,n=e.flatten,i=e.size;return t(Ri,{"...Array":function(e){return a(e)},"...Matrix":function(e){return r(a(e.map((function(e){return e.toArray()}))))}});function a(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var t=o(e[0]),r=[],i=0;i<t;i++)r[i]=[];var a,u=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ii(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ii(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(e);try{for(u.s();!(a=u.n()).done;){var s=a.value,c=o(s);if(c!==t)throw new TypeError("The vectors had different length: "+(0|t)+" ≠ "+(0|c));for(var f=n(s),l=0;l<t;l++)r[l].push(f[l])}}catch(e){u.e(e)}finally{u.f()}return r}function o(e){var t=i(e);if(1===t.length)return t[0];if(2===t.length){if(1===t[0])return t[1];if(1===t[1])return t[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),qi="splitUnit",ji=Ee(qi,["typed"],(function(e){return(0,e.typed)(qi,{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),Pi="number",Li="number, number";function Ui(e){return Math.abs(e)}function $i(e,t){return e+t}function Hi(e,t){return e-t}function Gi(e,t){return e*t}function Vi(e){return-e}function Zi(e){return e}function Wi(e){return X(e)}function Yi(e){return e*e*e}function Ji(e){return Math.exp(e)}function Xi(e){return Q(e)}function Qi(e,t){if(!V(e)||!V(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}function Ki(e){return Y(e)}function ea(e){return W(e)}function ta(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}function ra(e){return Z(e)}function na(e){return e*e}function ia(e,t){var r,n,i,a=0,o=1,u=1,s=0;if(!V(e)||!V(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=e-(n=Math.floor(e/t))*t,r=a,a=o-n*a,o=r,r=u,u=s-n*u,s=r,e=t,t=i;return e<0?[-e,-o,-s]:[e,e?o:0,s]}function aa(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function oa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!V(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(re(e,t))}Ui.signature=Pi,$i.signature=Li,Hi.signature=Li,Gi.signature=Li,Vi.signature=Pi,Zi.signature=Pi,Wi.signature=Pi,Yi.signature=Pi,Ji.signature=Pi,Xi.signature=Pi,Qi.signature=Li,Ki.signature=Pi,ea.signature=Pi,ra.signature=Pi,na.signature=Pi,ia.signature=Li,aa.signature=Li;var ua="unaryMinus",sa=Ee(ua,["typed"],(function(e){var t=e.typed;return t(ua,{number:Vi,"Complex | BigNumber | Fraction":function(e){return e.neg()},Unit:t.referToSelf((function(e){return function(r){var n=r.clone();return n.value=t.find(e,n.valueType())(r.value),n}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}}))})})),ca="unaryPlus",fa=Ee(ca,["typed","config","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.BigNumber;return t(ca,{number:Zi,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}})),"boolean | string":function(e){return"BigNumber"===r.number?new n(+e):+e}})})),la=Ee("abs",["typed"],(function(e){var t=e.typed;return t("abs",{number:Ui,"Complex | BigNumber | Fraction | Unit":function(e){return e.abs()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}}))})})),pa="apply",ma=Ee(pa,["typed","isInteger"],(function(e){var t=e.typed,r=e.isInteger;return t(pa,{"Array | Matrix, number | BigNumber, function":function(e,t,n){if(!r(t))throw new TypeError("Integer number expected for dimension");var i=Array.isArray(e)?an(e):e.size();if(t<0||t>=i.length)throw new nn(t,i.length);return l(e)?e.create(ha(e.valueOf(),t,n)):ha(e,t,n)}})}));function ha(e,t,r){var n,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,r,n=e.length,i=e[0].length,a=[];for(r=0;r<i;r++){var o=[];for(t=0;t<n;t++)o.push(e[t][r]);a.push(o)}return a}(e),i=[],n=0;n<a.length;n++)i[n]=ha(a[n],t-1,r);return i}return r(e)}for(i=[],n=0;n<e.length;n++)i[n]=ha(e[n],t-1,r);return i}var da="addScalar",va=Ee(da,["typed"],(function(e){var t=e.typed;return t(da,{"number, number":$i,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf((function(e){return function(r,n){if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}}))})})),ya="subtractScalar",ga=Ee(ya,["typed"],(function(e){var t=e.typed;return t(ya,{"number, number":Hi,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf((function(e){return function(r,n){if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}}))})})),xa="cbrt",ba=Ee(xa,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(function(e){var t=e.config,r=e.typed,n=e.isNegative,i=e.unaryMinus,s=e.matrix,c=e.Complex,f=e.BigNumber,l=e.Fraction;return r(xa,{number:Wi,Complex:p,"Complex, boolean":p,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&o(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=p(e.value),t}var r,s=n(e.value);s&&(e.value=i(e.value)),r=a(e.value)?new f(1).div(3):u(e.value)?new l(1,3):1/3;var c=e.pow(r);return s&&(c.value=i(c.value)),c}});function p(e,r){var n=e.arg()/3,i=e.abs(),a=new c(Wi(i),0).mul(new c(0,n).exp());if(r){var o=[a,new c(Wi(i),0).mul(new c(0,n+2*Math.PI/3).exp()),new c(Wi(i),0).mul(new c(0,n-2*Math.PI/3).exp())];return"Array"===t.matrix?o:s(o)}return a}}));function wa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,u=[],s=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(u.push(n.value),u.length!==t);s=!0);}catch(e){c=!0,i=e}finally{try{if(!s&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return u}}(e,t)||Gr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Na=Ee("matAlgo11xS0s",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i,a){var o=e._values,u=e._index,s=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],m=c[1],h=r,d=0,v=i;"string"==typeof f&&(l=f,h=t.find(r,[l,l]),d=t.convert(0,l),n=t.convert(n,l),v=t.find(i,[l,l]));for(var y=[],g=[],x=[],b=0;b<m;b++){x[b]=g.length;for(var w=s[b],N=s[b+1],D=w;D<N;D++){var E=u[D],A=a?v(n,o[D]):v(o[D],n);h(A,d)||(g.push(E),y.push(A))}}return x[m]=g.length,e.createSparseMatrix({values:y,index:g,ptr:x,size:[p,m],datatype:l})}})),Da=Ee("matAlgo12xSfs",["typed","DenseMatrix"],(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,n,i,a){var o=e._values,u=e._index,s=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],m=c[1],h=i;"string"==typeof f&&(l=f,n=t.convert(n,l),h=t.find(i,[l,l]));for(var d=[],v=[],y=[],g=0;g<m;g++){for(var x=g+1,b=s[g],w=s[g+1],N=b;N<w;N++){var D=u[N];v[D]=o[N],y[D]=x}for(var E=0;E<p;E++)0===g&&(d[E]=[]),y[E]===x?d[E][g]=a?h(n,v[E]):h(v[E],n):d[E][g]=a?h(n,0):h(0,n)}return new r({data:d,size:[p,m],datatype:l})}})),Ea=Ee("matAlgo14xDs",["typed"],(function(e){var t=e.typed;return function(e,n,i,a){var o,u=e._data,s=e._size,c=e._datatype,f=i;"string"==typeof c&&(o=c,n=t.convert(n,o),f=t.find(i,[o,o]));var l=s.length>0?r(f,0,s,s[0],u,n,a):[];return e.createDenseMatrix({data:l,size:he(s),datatype:o})};function r(e,t,n,i,a,o,u){var s=[];if(t===n.length-1)for(var c=0;c<i;c++)s[c]=u?e(o,a[c]):e(a[c],o);else for(var f=0;f<i;f++)s[f]=r(e,t+1,n,n[t+1],a[f],o,u);return s}})),Aa="ceil",Sa=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],Ca=Ee(Aa,["typed","config","round"],(function(e){var t=e.typed,r=e.config,n=e.round;return t(Aa,{number:function(e){return ue(e,n(e),r.epsilon)?n(e):Math.ceil(e)},"number, number":function(e,t){if(ue(e,n(e,t),r.epsilon))return n(e,t);var i=wa("".concat(e,"e").split("e"),2),a=i[0],o=i[1],u=Math.ceil(Number("".concat(a,"e").concat(Number(o)+t))),s=wa("".concat(u,"e").split("e"),2);return a=s[0],o=s[1],Number("".concat(a,"e").concat(Number(o)-t))}})})),Ma=Ee(Aa,Sa,(function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,u=e.DenseMatrix,s=Na({typed:t,equalScalar:a}),c=Da({typed:t,DenseMatrix:u}),f=Ea({typed:t}),l=Ca({typed:t,config:r,round:n});return t("ceil",{number:l.signatures.number,"number,number":l.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:function(e){return di(e,n(e),r.epsilon)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,t){return di(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),kr.ROUND_CEIL)},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())},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}})),"Array, number | BigNumber":t.referToSelf((function(e){return function(t,r){return Hn(t,(function(t){return e(t,r)}),!0)}})),"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return s(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return f(t,r,e,!1)}})),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((function(e){return function(t,r){return f(i(r),t,e,!0).valueOf()}})),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((function(e){return function(t,r){return a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0)}}))})})),Fa="cube",Oa=Ee(Fa,["typed"],(function(e){return(0,e.typed)(Fa,{number:Yi,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})})),Ta=Ee("exp",["typed"],(function(e){return(0,e.typed)("exp",{number:Ji,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),Ba="expm1",_a=Ee(Ba,["typed","Complex"],(function(e){var t=e.typed,r=e.Complex;return t(Ba,{number:Xi,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})})),ka="fix",Ia=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],Ra=Ee(ka,["typed","ceil","floor"],(function(e){var t=e.typed,r=e.ceil,n=e.floor;return t(ka,{number:function(e){return e>0?n(e):r(e)},"number, number":function(e,t){return e>0?n(e,t):r(e,t)}})})),za=Ee(ka,Ia,(function(e){var t=e.typed,r=e.Complex,n=e.matrix,i=e.ceil,a=e.floor,o=e.equalScalar,u=e.zeros,s=e.DenseMatrix,c=Da({typed:t,DenseMatrix:s}),f=Ea({typed:t}),l=Ra({typed:t,ceil:i,floor:a});return t("fix",{number:l.signatures.number,"number, number | BigNumber":l.signatures["number,number"],Complex:function(e){return new r(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 r(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 n=t.toNumber();return new r(e.re>0?a(e.re,n):i(e.re,n),e.im>0?a(e.im,n):i(e.im,n))},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)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<0?i(e,t):a(e,t)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}})),"Array | Matrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return Hn(t,(function(t){return e(t,r)}),!0)}})),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((function(e){return function(t,r){return f(n(r),t,e,!0).valueOf()}})),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((function(e){return function(t,r){return o(t,0)?u(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0)}}))})})),qa="floor",ja=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],Pa=Ee(qa,["typed","config","round"],(function(e){var t=e.typed,r=e.config,n=e.round;return t(qa,{number:function(e){return ue(e,n(e),r.epsilon)?n(e):Math.floor(e)},"number, number":function(e,t){if(ue(e,n(e,t),r.epsilon))return n(e,t);var i=wa("".concat(e,"e").split("e"),2),a=i[0],o=i[1],u=Math.floor(Number("".concat(a,"e").concat(Number(o)+t))),s=wa("".concat(u,"e").split("e"),2);return a=s[0],o=s[1],Number("".concat(a,"e").concat(Number(o)-t))}})})),La=Ee(qa,ja,(function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,u=e.DenseMatrix,s=Na({typed:t,equalScalar:a}),c=Da({typed:t,DenseMatrix:u}),f=Ea({typed:t}),l=Pa({typed:t,config:r,round:n});return t("floor",{number:l.signatures.number,"number,number":l.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:function(e){return di(e,n(e),r.epsilon)?n(e):e.floor()},"BigNumber, BigNumber":function(e,t){return di(e,n(e,t),r.epsilon)?n(e,t):e.toDecimalPlaces(t.toNumber(),kr.ROUND_FLOOR)},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())},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}})),"Array, number | BigNumber":t.referToSelf((function(e){return function(t,r){return Hn(t,(function(t){return e(t,r)}),!0)}})),"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return s(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return f(t,r,e,!1)}})),"number | Complex | Fraction | BigNumber, Array":t.referToSelf((function(e){return function(t,r){return f(i(r),t,e,!0).valueOf()}})),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf((function(e){return function(t,r){return a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0)}}))})}));function Ua(e,t,r){return(t=Me(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $a=Ee("matAlgo02xDS0",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i,a){var o=e._data,u=e._size,s=e._datatype,c=n._values,f=n._index,l=n._ptr,p=n._size,m=n._datatype;if(u.length!==p.length)throw new rn(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,d=u[0],v=u[1],y=r,g=0,x=i;"string"==typeof s&&s===m&&(h=s,y=t.find(r,[h,h]),g=t.convert(0,h),x=t.find(i,[h,h]));for(var b=[],w=[],N=[],D=0;D<v;D++){N[D]=w.length;for(var E=l[D],A=l[D+1],S=E;S<A;S++){var C=f[S],M=a?x(c[S],o[C][D]):x(o[C][D],c[S]);y(M,g)||(w.push(C),b.push(M))}}return N[v]=w.length,n.createSparseMatrix({values:b,index:w,ptr:N,size:[d,v],datatype:h})}})),Ha=Ee("matAlgo03xDSf",["typed"],(function(e){var t=e.typed;return function(e,r,n,i){var a=e._data,o=e._size,u=e._datatype,s=r._values,c=r._index,f=r._ptr,l=r._size,p=r._datatype;if(o.length!==l.length)throw new rn(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,h=o[0],d=o[1],v=0,y=n;"string"==typeof u&&u===p&&(m=u,v=t.convert(0,m),y=t.find(n,[m,m]));for(var g=[],x=0;x<h;x++)g[x]=[];for(var b=[],w=[],N=0;N<d;N++){for(var D=N+1,E=f[N],A=f[N+1],S=E;S<A;S++){var C=c[S];b[C]=i?y(s[S],a[C][N]):y(a[C][N],s[S]),w[C]=D}for(var M=0;M<h;M++)w[M]===D?g[M][N]=b[M]:g[M][N]=i?y(v,a[M][N]):y(a[M][N],v)}return e.createDenseMatrix({data:g,size:[h,d],datatype:m})}})),Ga=Ee("matAlgo05xSfSf",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype,f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype;if(s.length!==m.length)throw new rn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));var w,N,D,E,A=a&&f?[]:void 0,S=[],C=[],M=A?[]:void 0,F=A?[]:void 0,O=[],T=[];for(N=0;N<y;N++){C[N]=S.length;var B=N+1;for(D=u[N],E=u[N+1];D<E;D++)w=o[D],S.push(w),O[w]=B,M&&(M[w]=a[D]);for(D=p[N],E=p[N+1];D<E;D++)O[w=l[D]]!==B&&S.push(w),T[w]=B,F&&(F[w]=f[D]);if(A)for(D=C[N];D<S.length;){var _=O[w=S[D]],k=T[w];if(_===B||k===B){var I=b(_===B?M[w]:x,k===B?F[w]:x);g(I,x)?S.splice(D,1):(A.push(I),D++)}}}return C[y]=S.length,e.createSparseMatrix({values:A,index:S,ptr:C,size:[v,y],datatype:d})}})),Va=Ee("matAlgo13xDD",["typed"],(function(e){var t=e.typed;return function(e,n,i){var a,o=e._data,u=e._size,s=e._datatype,c=n._data,f=n._size,l=n._datatype,p=[];if(u.length!==f.length)throw new rn(u.length,f.length);for(var m=0;m<u.length;m++){if(u[m]!==f[m])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+f+")");p[m]=u[m]}var h=i;"string"==typeof s&&s===l&&(a=s,h=t.find(i,[a,a]));var d=p.length>0?r(h,0,p,p[0],o,c):[];return e.createDenseMatrix({data:d,size:p,datatype:a})};function r(e,t,n,i,a,o){var u=[];if(t===n.length-1)for(var s=0;s<i;s++)u[s]=e(a[s],o[s]);else for(var c=0;c<i;c++)u[c]=r(e,t+1,n,n[t+1],a[c],o[c]);return u}})),Za=Ee("broadcast",["concat"],(function(e){var t=e.concat;return function(e,t){var i=Math.max(e._size.length,t._size.length);if(e._size.length===t._size.length&&e._size.every((function(e,r){return e===t._size[r]})))return[e,t];for(var a=r(e._size,i,0),o=r(t._size,i,0),u=[],s=0;s<i;s++)u[s]=Math.max(a[s],o[s]);Bn(a,u),Bn(o,u);var c=e.clone(),f=t.clone();c._size.length<i?c.reshape(r(c._size,i,1)):f._size.length<i&&f.reshape(r(f._size,i,1));for(var l=0;l<i;l++)c._size[l]<u[l]&&(c=n(c,u[l],l)),f._size[l]<u[l]&&(f=n(f,u[l],l));return[c,f]};function r(e,t,r){return[].concat(Vr(Array(t-e.length).fill(r)),Vr(e))}function n(e,r,n){return t.apply(void 0,Vr(Array(r).fill(e)).concat([n]))}})),Wa=Ee("matrixAlgorithmSuite",["typed","matrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.concat,i=Va({typed:t}),a=Ea({typed:t}),o=Za({concat:n});return function(e){var n,u=e.elop,s=e.SD||e.DS;u?(n={"DenseMatrix, DenseMatrix":function(e,t){return i.apply(void 0,Vr(o(e,t)).concat([u]))},"Array, Array":function(e,t){return i.apply(void 0,Vr(o(r(e),r(t))).concat([u])).valueOf()},"Array, DenseMatrix":function(e,t){return i.apply(void 0,Vr(o(r(e),t)).concat([u]))},"DenseMatrix, Array":function(e,t){return i.apply(void 0,Vr(o(e,r(t))).concat([u]))}},e.SS&&(n["SparseMatrix, SparseMatrix"]=function(t,r){return e.SS.apply(e,Vr(o(t,r)).concat([u,!1]))}),e.DS&&(n["DenseMatrix, SparseMatrix"]=function(t,r){return e.DS.apply(e,Vr(o(t,r)).concat([u,!1]))},n["Array, SparseMatrix"]=function(t,n){return e.DS.apply(e,Vr(o(r(t),n)).concat([u,!1]))}),s&&(n["SparseMatrix, DenseMatrix"]=function(e,t){return s.apply(void 0,Vr(o(t,e)).concat([u,!0]))},n["SparseMatrix, Array"]=function(e,t){return s.apply(void 0,Vr(o(r(t),e)).concat([u,!0]))})):(n={"DenseMatrix, DenseMatrix":t.referToSelf((function(e){return function(t,r){return i.apply(void 0,Vr(o(t,r)).concat([e]))}})),"Array, Array":t.referToSelf((function(e){return function(t,n){return i.apply(void 0,Vr(o(r(t),r(n))).concat([e])).valueOf()}})),"Array, DenseMatrix":t.referToSelf((function(e){return function(t,n){return i.apply(void 0,Vr(o(r(t),n)).concat([e]))}})),"DenseMatrix, Array":t.referToSelf((function(e){return function(t,n){return i.apply(void 0,Vr(o(t,r(n))).concat([e]))}}))},e.SS&&(n["SparseMatrix, SparseMatrix"]=t.referToSelf((function(t){return function(r,n){return e.SS.apply(e,Vr(o(r,n)).concat([t,!1]))}}))),e.DS&&(n["DenseMatrix, SparseMatrix"]=t.referToSelf((function(t){return function(r,n){return e.DS.apply(e,Vr(o(r,n)).concat([t,!1]))}})),n["Array, SparseMatrix"]=t.referToSelf((function(t){return function(n,i){return e.DS.apply(e,Vr(o(r(n),i)).concat([t,!1]))}}))),s&&(n["SparseMatrix, DenseMatrix"]=t.referToSelf((function(e){return function(t,r){return s.apply(void 0,Vr(o(r,t)).concat([e,!0]))}})),n["SparseMatrix, Array"]=t.referToSelf((function(e){return function(t,n){return s.apply(void 0,Vr(o(r(n),t)).concat([e,!0]))}}))));var c=e.scalar||"any";(e.Ds||e.Ss)&&(u?(n["DenseMatrix,"+c]=function(e,t){return a(e,t,u,!1)},n[c+", DenseMatrix"]=function(e,t){return a(t,e,u,!0)},n["Array,"+c]=function(e,t){return a(r(e),t,u,!1).valueOf()},n[c+", Array"]=function(e,t){return a(r(t),e,u,!0).valueOf()}):(n["DenseMatrix,"+c]=t.referToSelf((function(e){return function(t,r){return a(t,r,e,!1)}})),n[c+", DenseMatrix"]=t.referToSelf((function(e){return function(t,r){return a(r,t,e,!0)}})),n["Array,"+c]=t.referToSelf((function(e){return function(t,n){return a(r(t),n,e,!1).valueOf()}})),n[c+", Array"]=t.referToSelf((function(e){return function(t,n){return a(r(n),t,e,!0).valueOf()}}))));var f=void 0!==e.sS?e.sS:e.Ss;return u?(e.Ss&&(n["SparseMatrix,"+c]=function(t,r){return e.Ss(t,r,u,!1)}),f&&(n[c+", SparseMatrix"]=function(e,t){return f(t,e,u,!0)})):(e.Ss&&(n["SparseMatrix,"+c]=t.referToSelf((function(t){return function(r,n){return e.Ss(r,n,t,!1)}}))),f&&(n[c+", SparseMatrix"]=t.referToSelf((function(e){return function(t,r){return f(r,t,e,!0)}})))),u&&u.signatures&&ve(n,u.signatures),n}})),Ya=Ee("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.round,i=e.matrix,a=e.equalScalar,o=e.zeros,u=e.DenseMatrix,s=e.concat,c=La({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:u}),f=$a({typed:t,equalScalar:a}),l=Ha({typed:t}),p=Ga({typed:t,equalScalar:a}),m=Na({typed:t,equalScalar:a}),h=Da({typed:t,DenseMatrix:u});return t("mod",{"number, number":function(e,t){return 0===t?e:e-t*c(e/t)},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.sub(t.mul(c(e.div(t))))},"Fraction, Fraction":function(e,t){return t.equals(0)?e:e.sub(t.mul(c(e.div(t))))}},Wa({typed:t,matrix:i,concat:s})({SS:p,DS:l,SD:f,Ss:m,sS:h}))})),Ja=Ee("matAlgo01xDSid",["typed"],(function(e){var t=e.typed;return function(e,r,n,i){var a=e._data,o=e._size,u=e._datatype,s=r._values,c=r._index,f=r._ptr,l=r._size,p=r._datatype;if(o.length!==l.length)throw new rn(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!s)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,h,d=o[0],v=o[1],y="string"==typeof u&&u===p?u:void 0,g=y?t.find(n,[y,y]):n,x=[];for(m=0;m<d;m++)x[m]=[];var b=[],w=[];for(h=0;h<v;h++){for(var N=h+1,D=f[h],E=f[h+1],A=D;A<E;A++)b[m=c[A]]=i?g(s[A],a[m][h]):g(a[m][h],s[A]),w[m]=N;for(m=0;m<d;m++)w[m]===N?x[m][h]=b[m]:x[m][h]=a[m][h]}return e.createDenseMatrix({data:x,size:[d,v],datatype:y})}})),Xa=Ee("matAlgo04xSidSid",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype,f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype;if(s.length!==m.length)throw new rn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));var w,N,D,E,A,S=a&&f?[]:void 0,C=[],M=[],F=a&&f?[]:void 0,O=a&&f?[]:void 0,T=[],B=[];for(N=0;N<y;N++){M[N]=C.length;var _=N+1;for(E=u[N],A=u[N+1],D=E;D<A;D++)w=o[D],C.push(w),T[w]=_,F&&(F[w]=a[D]);for(E=p[N],A=p[N+1],D=E;D<A;D++)if(T[w=l[D]]===_){if(F){var k=b(F[w],f[D]);g(k,x)?T[w]=null:F[w]=k}}else C.push(w),B[w]=_,O&&(O[w]=f[D]);if(F&&O)for(D=M[N];D<C.length;)T[w=C[D]]===_?(S[D]=F[w],D++):B[w]===_?(S[D]=O[w],D++):C.splice(D,1)}return M[y]=C.length,e.createSparseMatrix({values:S,index:C,ptr:M,size:[v,y],datatype:d})}})),Qa=Ee("matAlgo10xSids",["typed","DenseMatrix"],(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,n,i,a){var o=e._values,u=e._index,s=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],m=c[1],h=i;"string"==typeof f&&(l=f,n=t.convert(n,l),h=t.find(i,[l,l]));for(var d=[],v=[],y=[],g=0;g<m;g++){for(var x=g+1,b=s[g],w=s[g+1],N=b;N<w;N++){var D=u[N];v[D]=o[N],y[D]=x}for(var E=0;E<p;E++)0===g&&(d[E]=[]),y[E]===x?d[E][g]=a?h(n,v[E]):h(v[E],n):d[E][g]=n}return new r({data:d,size:[p,m],datatype:l})}}));function Ka(e,t,r,n){if(!(this instanceof Ka))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(null!=n?"-"+n:"")+" expected)",this.stack=(new Error).stack}Ka.prototype=new Error,Ka.prototype.constructor=Error,Ka.prototype.name="ArgumentsError",Ka.prototype.isArgumentsError=!0;var eo=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],to="number | BigNumber | Fraction | Matrix | Array",ro="".concat(to,", ").concat(to,", ...").concat(to);function no(e){return!e.some((function(e){return Array.isArray(e)}))}var io=Ee("gcd",eo,(function(e){var t=e.typed,r=e.matrix,n=e.config,i=e.round,a=e.equalScalar,o=e.zeros,u=e.BigNumber,s=e.DenseMatrix,c=e.concat,f=Ya({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:s,concat:c}),l=Ja({typed:t}),p=Xa({typed:t,equalScalar:a}),m=Qa({typed:t,DenseMatrix:s});return t("gcd",{"number, number":function(e,t){if(!V(e)||!V(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;0!==t;)r=f(e,t),e=t,t=r;return e<0?-e:e},"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var r=new u(0);!t.isZero();){var n=f(e,t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)}},Wa({typed:t,matrix:r,concat:c})({SS:p,DS:l,Ss:m}),Ua(Ua(Ua({},ro,t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}}))),"Array",t.referToSelf((function(e){return function(t){if(1===t.length&&Array.isArray(t[0])&&no(t[0]))return e.apply(void 0,Vr(t[0]));if(no(t))return e.apply(void 0,Vr(t));throw new Ka("gcd() supports only 1d matrices!")}}))),"Matrix",t.referToSelf((function(e){return function(t){return e(t.toArray())}}))))})),ao=Ee("matAlgo06xS0S0",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._size,u=e._datatype,s=n._values,c=n._size,f=n._datatype;if(o.length!==c.length)throw new rn(o.length,c.length);if(o[0]!==c[0]||o[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+c+")");var l,p=o[0],m=o[1],h=r,d=0,v=i;"string"==typeof u&&u===f&&(l=u,h=t.find(r,[l,l]),d=t.convert(0,l),v=t.find(i,[l,l]));for(var y=a&&s?[]:void 0,g=[],x=[],b=y?[]:void 0,w=[],N=[],D=0;D<m;D++){x[D]=g.length;var E=D+1;if(Zn(e,D,w,b,N,E,g,v),Zn(n,D,w,b,N,E,g,v),b)for(var A=x[D];A<g.length;){var S=g[A];if(N[S]===E){var C=b[S];h(C,d)?g.splice(A,1):(y.push(C),A++)}else g.splice(A,1)}else for(var M=x[D];M<g.length;)N[g[M]]!==E?g.splice(M,1):M++}return x[m]=g.length,e.createSparseMatrix({values:y,index:g,ptr:x,size:[p,m],datatype:l})}})),oo=Ee("lcm",["typed","matrix","equalScalar","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.concat,a=$a({typed:t,equalScalar:n}),o=ao({typed:t,equalScalar:n}),u=Na({typed:t,equalScalar:n}),s=Wa({typed:t,matrix:r,concat:i}),c="number | BigNumber | Fraction | Matrix | Array",f={};return f["".concat(c,", ").concat(c,", ...").concat(c)]=t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}})),t("lcm",{"number, number":Qi,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero())return e;if(t.isZero())return t;for(var r=e.times(t);!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)}},s({SS:o,DS:a,Ss:u}),f)})),uo="log10",so=Ee(uo,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(uo,{number:function(e){return e>=0||r.predictable?Ki(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),co="log2",fo=Ee(co,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(co,{number:function(e){return e>=0||r.predictable?ea(e):i(new n(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(new n(e.toNumber(),0))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))});function i(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),lo=Ee("multiplyScalar",["typed"],(function(e){return(0,e.typed)("multiplyScalar",{"number, number":Gi,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":function(e,t){return t.multiply(e)},"Unit, number | Fraction | BigNumber | Complex | Unit":function(e,t){return e.multiply(t)}})})),po="multiply",mo=Ee(po,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(function(e){var t=e.typed,r=e.matrix,n=e.addScalar,i=e.multiplyScalar,a=e.equalScalar,o=e.dot,u=Na({typed:t,equalScalar:a}),s=Ea({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new 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 new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}var f=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){var a,o=e._data,u=e._size,s=e._datatype,c=r._data,f=r._datatype,l=u[0],p=u[1],m=n,h=i;s&&f&&s===f&&"string"==typeof s&&(a=s,m=t.find(n,[a,a]),h=t.find(i,[a,a]));for(var d=[],v=0;v<l;v++){for(var y=o[v],g=h(y[0],c[0]),x=1;x<p;x++)g=m(g,h(y[x],c[x]));d[v]=g}return e.createDenseMatrix({data:d,size:[l],datatype:a})},"SparseMatrix, any":function(e,r){var o=e._values,u=e._index,s=e._ptr,c=e._datatype;if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var f,l=r._data,p=r._datatype,m=e._size[0],h=r._size[0],d=[],v=[],y=[],g=n,x=i,b=a,w=0;c&&p&&c===p&&"string"==typeof c&&(f=c,g=t.find(n,[f,f]),x=t.find(i,[f,f]),b=t.find(a,[f,f]),w=t.convert(0,f));var N=[],D=[];y[0]=0;for(var E=0;E<h;E++){var A=l[E];if(!b(A,w))for(var S=s[E],C=s[E+1],M=S;M<C;M++){var F=u[M];D[F]?N[F]=g(N[F],x(A,o[M])):(D[F]=!0,v.push(F),N[F]=x(A,o[M]))}}for(var O=v.length,T=0;T<O;T++){var B=v[T];d[T]=N[B]}return y[1]=v.length,e.createSparseMatrix({values:d,index:v,ptr:y,size:[m,1],datatype:f})}}),p=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,r){var a,o=e._data,u=e._size,s=e._datatype,c=r._data,f=r._size,l=r._datatype,p=u[0],m=u[1],h=f[1],d=n,v=i;s&&l&&s===l&&"string"==typeof s&&(a=s,d=t.find(n,[a,a]),v=t.find(i,[a,a]));for(var y=[],g=0;g<p;g++){var x=o[g];y[g]=[];for(var b=0;b<h;b++){for(var w=v(x[0],c[0][b]),N=1;N<m;N++)w=d(w,v(x[N],c[N][b]));y[g][b]=w}}return e.createDenseMatrix({data:y,size:[p,h],datatype:a})},"DenseMatrix, SparseMatrix":function(e,r){var o=e._data,u=e._size,s=e._datatype,c=r._values,f=r._index,l=r._ptr,p=r._size,m=r._datatype;if(!c)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var h,d=u[0],v=p[1],y=n,g=i,x=a,b=0;s&&m&&s===m&&"string"==typeof s&&(h=s,y=t.find(n,[h,h]),g=t.find(i,[h,h]),x=t.find(a,[h,h]),b=t.convert(0,h));for(var w=[],N=[],D=[],E=r.createSparseMatrix({values:w,index:N,ptr:D,size:[d,v],datatype:h}),A=0;A<v;A++){D[A]=N.length;var S=l[A],C=l[A+1];if(C>S)for(var M=0,F=0;F<d;F++){for(var O=F+1,T=void 0,B=S;B<C;B++){var _=f[B];M!==O?(T=g(o[F][_],c[B]),M=O):T=y(T,g(o[F][_],c[B]))}M!==O||x(T,b)||(N.push(F),w.push(T))}}return D[v]=N.length,E},"SparseMatrix, DenseMatrix":function(e,r){var o=e._values,u=e._index,s=e._ptr,c=e._datatype;if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var f,l=r._data,p=r._datatype,m=e._size[0],h=r._size[0],d=r._size[1],v=n,y=i,g=a,x=0;c&&p&&c===p&&"string"==typeof c&&(f=c,v=t.find(n,[f,f]),y=t.find(i,[f,f]),g=t.find(a,[f,f]),x=t.convert(0,f));for(var b=[],w=[],N=[],D=e.createSparseMatrix({values:b,index:w,ptr:N,size:[m,d],datatype:f}),E=[],A=[],S=0;S<d;S++){N[S]=w.length;for(var C=S+1,M=0;M<h;M++){var F=l[M][S];if(!g(F,x))for(var O=s[M],T=s[M+1],B=O;B<T;B++){var _=u[B];A[_]!==C?(A[_]=C,w.push(_),E[_]=y(F,o[B])):E[_]=v(E[_],y(F,o[B]))}}for(var k=N[S],I=w.length,R=k;R<I;R++){var z=w[R];b[R]=E[z]}}return N[d]=w.length,D},"SparseMatrix, SparseMatrix":function(e,r){var a,o=e._values,u=e._index,s=e._ptr,c=e._datatype,f=r._values,l=r._index,p=r._ptr,m=r._datatype,h=e._size[0],d=r._size[1],v=o&&f,y=n,g=i;c&&m&&c===m&&"string"==typeof c&&(a=c,y=t.find(n,[a,a]),g=t.find(i,[a,a]));for(var x,b,w,N,D,E,A,S,C=v?[]:void 0,M=[],F=[],O=e.createSparseMatrix({values:C,index:M,ptr:F,size:[h,d],datatype:a}),T=v?[]:void 0,B=[],_=0;_<d;_++){F[_]=M.length;var k=_+1;for(D=p[_],E=p[_+1],N=D;N<E;N++)if(S=l[N],v)for(b=s[S],w=s[S+1],x=b;x<w;x++)B[A=u[x]]!==k?(B[A]=k,M.push(A),T[A]=g(f[N],o[x])):T[A]=y(T[A],g(f[N],o[x]));else for(b=s[S],w=s[S+1],x=b;x<w;x++)B[A=u[x]]!==k&&(B[A]=k,M.push(A));if(v)for(var I=F[_],R=M.length,z=I;z<R;z++){var q=M[z];C[z]=T[q]}}return F[d]=M.length,O}});return t(po,i,{"Array, Array":t.referTo("Matrix, Matrix",(function(e){return function(t,n){c(an(t),an(n));var i=e(r(t),r(n));return l(i)?i.valueOf():i}})),"Matrix, Matrix":function(e,r){var a=e.size(),u=r.size();return c(a,u),1===a.length?1===u.length?function(e,t,r){if(0===r)throw new Error("Cannot multiply two empty vectors");return o(e,t)}(e,r,a[0]):function(e,r){if("dense"!==r.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,r){var a,o=e._data,u=e._size,s=e._datatype,c=r._data,f=r._size,l=r._datatype,p=u[0],m=f[1],h=n,d=i;s&&l&&s===l&&"string"==typeof s&&(a=s,h=t.find(n,[a,a]),d=t.find(i,[a,a]));for(var v=[],y=0;y<m;y++){for(var g=d(o[0],c[0][y]),x=1;x<p;x++)g=h(g,d(o[x],c[x][y]));v[y]=g}return e.createDenseMatrix({data:v,size:[m],datatype:a})}(e,r)}(e,r):1===u.length?f(e,r):p(e,r)},"Matrix, Array":t.referTo("Matrix,Matrix",(function(e){return function(t,n){return e(t,r(n))}})),"Array, Matrix":t.referToSelf((function(e){return function(t,n){return e(r(t,n.storage()),n)}})),"SparseMatrix, any":function(e,t){return u(e,t,i,!1)},"DenseMatrix, any":function(e,t){return s(e,t,i,!1)},"any, SparseMatrix":function(e,t){return u(t,e,i,!0)},"any, DenseMatrix":function(e,t){return s(t,e,i,!0)},"Array, any":function(e,t){return s(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return s(r(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}}))})})),ho="nthRoot",vo=Ee(ho,["typed","matrix","equalScalar","BigNumber","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,a=e.concat,o=Ja({typed:t}),u=$a({typed:t,equalScalar:n}),s=ao({typed:t,equalScalar:n}),c=Na({typed:t,equalScalar:n}),f=Wa({typed:t,matrix:r,concat:a});function l(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t(ho,{number:ta,"number, number":ta,BigNumber:function(e){return p(e,new i(2))},"BigNumber, BigNumber":p,Complex:l,"Complex, number":l,Array:t.referTo("DenseMatrix,number",(function(e){return function(t){return e(r(t),2).valueOf()}})),DenseMatrix:t.referTo("DenseMatrix,number",(function(e){return function(t){return e(t,2)}})),SparseMatrix:t.referTo("SparseMatrix,number",(function(e){return function(t){return e(t,2)}})),"SparseMatrix, SparseMatrix":t.referToSelf((function(e){return function(t,r){if(1===r.density())return s(t,r,e);throw new Error("Root must be non-zero")}})),"DenseMatrix, SparseMatrix":t.referToSelf((function(e){return function(t,r){if(1===r.density())return o(t,r,e,!1);throw new Error("Root must be non-zero")}})),"Array, SparseMatrix":t.referTo("DenseMatrix,SparseMatrix",(function(e){return function(t,n){return e(r(t),n)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){if(1===r.density())return c(r,t,e,!0);throw new Error("Root must be non-zero")}}))},f({scalar:"number | BigNumber",SD:u,Ss:c,sS:!1}));function p(e,t){var r=i.precision,n=i.clone({precision:r+2}),a=new i(0),o=new n(1),u=t.isNegative();if(u&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return u?new n(1/0):0;if(!e.isFinite())return u?a:e;var s=e.abs().pow(o.div(t));return s=e.isNeg()?s.neg():s,new i((u?o.div(s):s).toPrecision(r))}})),yo="sign",go=Ee(yo,["typed","BigNumber","Fraction","complex"],(function(e){var t=e.typed,r=e.BigNumber,n=e.complex,i=e.Fraction;return t(yo,{number:ra,Complex:function(e){return 0===e.im?n(ra(e.re)):e.sign()},BigNumber:function(e){return new r(e.cmp(0))},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}})),Unit:t.referToSelf((function(e){return function(r){if(!r._isDerived()&&0!==r.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return t.find(e,r.valueType())(r.value)}}))})})),xo=Ee("sqrt",["config","typed","Complex"],(function(e){var t=e.config,r=e.typed,n=e.Complex;return r("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 n(e,0).sqrt()}})),bo="square",wo=Ee(bo,["typed"],(function(e){return(0,e.typed)(bo,{number:na,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})})),No="subtract",Do=Ee(No,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.subtractScalar,a=(e.unaryMinus,e.DenseMatrix),o=e.concat,u=Ja({typed:t}),s=Ha({typed:t}),c=Ga({typed:t,equalScalar:n}),f=Qa({typed:t,DenseMatrix:a}),l=Da({typed:t,DenseMatrix:a}),p=Wa({typed:t,matrix:r,concat:o});return t(No,{"any, any":i},p({elop:i,SS:c,DS:u,SD:s,Ss:l,sS:f}))})),Eo="xgcd",Ao=Ee(Eo,["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t(Eo,{"number, number":function(e,t){var i=ia(e,t);return"Array"===r.matrix?i:n(i)},"BigNumber, BigNumber":function(e,t){var a,o,u,s,c=new i(0),f=new i(1),l=c,p=f,m=f,h=c;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=e.div(t).floor(),u=e.mod(t),a=l,l=p.minus(o.times(l)),p=a,a=m,m=h.minus(o.times(m)),h=a,e=t,t=u;return s=e.lt(c)?[e.neg(),p.neg(),h.neg()]:[e,e.isZero()?0:p,h],"Array"===r.matrix?s:n(s)}})})),So="invmod",Co=Ee(So,["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],(function(e){var t=e.typed,r=(e.config,e.BigNumber),n=e.xgcd,i=e.equal,a=e.smaller,o=e.mod,u=e.add,s=e.isInteger;return t(So,{"number, number":c,"BigNumber, BigNumber":c});function c(e,t){if(!s(e)||!s(t))throw new Error("Parameters in function invmod must be integer numbers");if(e=o(e,t),i(t,0))throw new Error("Divisor must be non zero");var c=n(e,t),f=wa(c=c.valueOf(),2),l=f[0],p=f[1];return i(l,r(1))?(p=o(p,t),a(p,r(0))&&(p=u(p,t)),p):NaN}})),Mo=Ee("matAlgo09xS0Sf",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype,f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype;if(s.length!==m.length)throw new rn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));var w,N,D,E,A,S=a&&f?[]:void 0,C=[],M=[],F=S?[]:void 0,O=[];for(N=0;N<y;N++){M[N]=C.length;var T=N+1;if(F)for(E=p[N],A=p[N+1],D=E;D<A;D++)O[w=l[D]]=T,F[w]=f[D];for(E=u[N],A=u[N+1],D=E;D<A;D++)if(w=o[D],F){var B=O[w]===T?F[w]:x,_=b(a[D],B);g(_,x)||(C.push(w),S.push(_))}else C.push(w)}return M[y]=C.length,e.createSparseMatrix({values:S,index:C,ptr:M,size:[v,y],datatype:d})}})),Fo="dotMultiply",Oo=Ee(Fo,["typed","matrix","equalScalar","multiplyScalar","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.multiplyScalar,a=e.concat,o=$a({typed:t,equalScalar:n}),u=Mo({typed:t,equalScalar:n}),s=Na({typed:t,equalScalar:n}),c=Wa({typed:t,matrix:r,concat:a});return t(Fo,c({elop:i,SS:u,DS:o,Ss:s}))}));function To(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(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 r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return ko(e,t,(function(e,t){return e&t}))}function Bo(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,r=t.precision;t.config({precision:1e9});var n=e.plus(new t(1));return n.s=-n.s||null,t.config({precision:r}),n}function _o(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?ko(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function ko(e,t,r){var n,i,a,o,u,s=e.constructor,c=+(e.s<0),f=+(t.s<0);if(c){n=Io(Bo(e));for(var l=0;l<n.length;++l)n[l]^=1}else n=Io(e);if(f){i=Io(Bo(t));for(var p=0;p<i.length;++p)i[p]^=1}else i=Io(t);n.length<=i.length?(a=n,o=i,u=c):(a=i,o=n,u=f);var m=a.length,h=o.length,d=1^r(c,f),v=new s(1^d),y=new s(1),g=new s(2),x=s.precision;for(s.config({precision:1e9});m>0;)r(a[--m],o[--h])===d&&(v=v.plus(y)),y=y.times(g);for(;h>0;)r(u,o[--h])===d&&(v=v.plus(y)),y=y.times(g);return s.config({precision:x}),0===d&&(v.s=-v.s),v}function Io(e){for(var t=e.d,r=t[0]+"",n=1;n<t.length;++n){for(var i=t[n]+"",a=7-i.length;a--;)i="0"+i;r+=i}for(var o=r.length;"0"===r.charAt(o);)o--;var u=e.e,s=r.slice(0,o+1||1),c=s.length;if(u>0)if(++u>c)for(u-=c;u--;)s+="0";else u<c&&(s=s.slice(0,u)+"."+s.slice(u));for(var f=[0],l=0;l<s.length;){for(var p=f.length;p--;)f[p]*=10;f[0]+=parseInt(s.charAt(l++));for(var m=0;m<f.length;++m)f[m]>1&&(null!==f[m+1]&&void 0!==f[m+1]||(f[m+1]=0),f[m+1]+=f[m]>>1,f[m]&=1)}return f.reverse()}function Ro(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?Bo(t):t.eq(n)?Bo(e):e.isFinite()&&t.isFinite()?ko(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function zo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}function qo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}r(3374);var jo="number, number";function Po(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function bitAnd");return e&t}function Lo(e){if(!V(e))throw new Error("Integer expected in function bitNot");return~e}function Uo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function bitOr");return e|t}function $o(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function bitXor");return e^t}function Ho(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function leftShift");return e<<t}function Go(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function Vo(e,t){if(!V(e)||!V(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}Po.signature=jo,Lo.signature="number",Uo.signature=jo,$o.signature=jo,Ho.signature=jo,Go.signature=jo,Vo.signature=jo;var Zo="bitAnd",Wo=Ee(Zo,["typed","matrix","equalScalar","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.concat,a=$a({typed:t,equalScalar:n}),o=ao({typed:t,equalScalar:n}),u=Na({typed:t,equalScalar:n}),s=Wa({typed:t,matrix:r,concat:i});return t(Zo,{"number, number":Po,"BigNumber, BigNumber":To},s({SS:o,DS:a,Ss:u}))})),Yo="bitNot",Jo=Ee(Yo,["typed"],(function(e){var t=e.typed;return t(Yo,{number:Lo,BigNumber:Bo,"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Xo="bitOr",Qo=Ee(Xo,["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=Ja({typed:t}),u=Xa({typed:t,equalScalar:n}),s=Qa({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:r,concat:a});return t(Xo,{"number, number":Uo,"BigNumber, BigNumber":_o},c({SS:u,DS:o,Ss:s}))})),Ko=Ee("matAlgo07xSSf",["typed","DenseMatrix"],(function(e){var t=e.typed,r=e.DenseMatrix;return function(e,i,a){var o=e._size,u=e._datatype,s=i._size,c=i._datatype;if(o.length!==s.length)throw new rn(o.length,s.length);if(o[0]!==s[0]||o[1]!==s[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+s+")");var f,l,p,m=o[0],h=o[1],d=0,v=a;"string"==typeof u&&u===c&&(f=u,d=t.convert(0,f),v=t.find(a,[f,f]));var y=[];for(l=0;l<m;l++)y[l]=[];var g=[],x=[],b=[],w=[];for(p=0;p<h;p++){var N=p+1;for(n(e,p,b,g,N),n(i,p,w,x,N),l=0;l<m;l++){var D=b[l]===N?g[l]:d,E=w[l]===N?x[l]:d;y[l][p]=v(D,E)}}return new r({data:y,size:[m,h],datatype:f})};function n(e,t,r,n,i){for(var a=e._values,o=e._index,u=e._ptr,s=u[t],c=u[t+1];s<c;s++){var f=o[s];r[f]=i,n[f]=a[s]}}})),eu="bitXor",tu=Ee(eu,["typed","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.concat,a=Ha({typed:t}),o=Ko({typed:t,DenseMatrix:n}),u=Da({typed:t,DenseMatrix:n}),s=Wa({typed:t,matrix:r,concat:i});return t(eu,{"number, number":$o,"BigNumber, BigNumber":Ro},s({SS:o,DS:a,Ss:u}))})),ru=Ee("arg",["typed"],(function(e){var t=e.typed;return t("arg",{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((function(e){return function(t){return Hn(t,e)}}))})})),nu="conj",iu=Ee(nu,["typed"],(function(e){var t=e.typed;return t(nu,{"number | BigNumber | Fraction":function(e){return e},Complex:function(e){return e.conjugate()},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),au=Ee("im",["typed"],(function(e){var t=e.typed;return t("im",{number:function(){return 0},"BigNumber | Fraction":function(e){return e.mul(0)},Complex:function(e){return e.im},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),ou=Ee("re",["typed"],(function(e){var t=e.typed;return t("re",{"number | BigNumber | Fraction":function(e){return e},Complex:function(e){return e.re},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),uu="number, number";function su(e){return!e}function cu(e,t){return!(!e&&!t)}function fu(e,t){return!!e!=!!t}function lu(e,t){return!(!e||!t)}su.signature="number",cu.signature=uu,fu.signature=uu,lu.signature=uu;var pu=Ee("not",["typed"],(function(e){var t=e.typed;return t("not",{"null | undefined":function(){return!0},number:su,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:t.referToSelf((function(e){return function(r){return t.find(e,r.valueType())(r.value)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),mu=Ee("or",["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ga({typed:t,equalScalar:n}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:r,concat:a});return t("or",{"number, number":cu,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t.value||0,r.value||0)}}))},c({SS:u,DS:o,Ss:s}))})),hu=Ee("xor",["typed","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.concat,a=Ha({typed:t}),o=Ko({typed:t,DenseMatrix:n}),u=Da({typed:t,DenseMatrix:n}),s=Wa({typed:t,matrix:r,concat:i});return t("xor",{"number, number":fu,"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t.value||0,r.value||0)}}))},s({SS:o,DS:a,Ss:u}))})),du="concat",vu=Ee(du,["typed","matrix","isInteger"],(function(e){var t=e.typed,r=e.matrix,n=e.isInteger;return t(du,{"...Array | Matrix | number | BigNumber":function(e){var t,o,u=e.length,s=-1,c=!1,f=[];for(t=0;t<u;t++){var p=e[t];if(l(p)&&(c=!0),i(p)||a(p)){if(t!==u-1)throw new Error("Dimension must be specified as last argument");if(o=s,s=p.valueOf(),!n(s))throw new TypeError("Integer number expected for dimension");if(s<0||t>0&&s>o)throw new nn(s,o+1)}else{var m=he(p).valueOf(),h=an(m);if(f[t]=m,o=s,s=h.length-1,t>0&&s!==o)throw new rn(o+1,s+1)}}if(0===f.length)throw new SyntaxError("At least one matrix expected");for(var d=f.shift();f.length;)d=Tn(d,f.shift(),s);return c?r(d):d},"...string":function(e){return e.join("")}})})),yu="column",gu=Ee(yu,["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,i=e.range;return t(yu,{"Matrix, number":a,"Array, number":function(e,t){return a(n(he(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");cn(t,e.size()[1]);var a=i(0,e.size()[0]),o=new r(a,t),u=e.subset(o);return l(u)?u:n([[u]])}})),xu="count",bu=Ee(xu,["typed","size","prod"],(function(e){var t=e.typed,r=e.size,n=e.prod;return t(xu,{string:function(e){return e.length},"Matrix | Array":function(e){return n(r(e))}})})),wu="cross",Nu=Ee(wu,["typed","matrix","subtract","multiply"],(function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.multiply;return t(wu,{"Matrix, Matrix":function(e,t){return r(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(a(e.toArray(),t))},"Array, Matrix":function(e,t){return r(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var r=Math.max(an(e).length,an(t).length);e=vn(e),t=vn(t);var a=an(e),o=an(t);if(1!==a.length||1!==o.length||3!==a[0]||3!==o[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+o.join(", ")+"])");var u=[n(i(e[1],t[2]),i(e[2],t[1])),n(i(e[2],t[0]),i(e[0],t[2])),n(i(e[0],t[1]),i(e[1],t[0]))];return r>1?[u]:u}})),Du="diag",Eu=Ee(Du,["typed","matrix","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.DenseMatrix,i=e.SparseMatrix;return t(Du,{Array:function(e){return a(e,0,an(e),null)},"Array, number":function(e,t){return a(e,t,an(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),an(e),null)},"Array, string":function(e,t){return a(e,0,an(e),t)},"Array, number, string":function(e,t,r){return a(e,t,an(e),r)},"Array, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),an(e),r)},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,r){return a(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return a(e,t.toNumber(),e.size(),r)}});function a(e,t,a,o){if(!V(t))throw new TypeError("Second parameter in function diag must be an integer");var u=t>0?t:0,s=t<0?-t:0;switch(a.length){case 1:return function(e,t,r,a,o,u){var s=[a+o,a+u];if(r&&"sparse"!==r&&"dense"!==r)throw new TypeError("Unknown matrix type ".concat(r,'"'));var c="sparse"===r?i.diagonal(s,e,t):n.diagonal(s,e,t);return null!==r?c:c.valueOf()}(e,t,o,a[0],s,u);case 2:return function(e,t,n,i,a,o){if(l(e)){var u=e.diagonal(t);return null!==n?n!==u.storage()?r(u,n):u:u.valueOf()}for(var s=Math.min(i[0]-a,i[1]-o),c=[],f=0;f<s;f++)c[f]=e[f+a][f+o];return null!==n?r(c):c}(e,t,o,a,s,u)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}));function Au(e,t,r,n,i){if(G.isTypedFunction(e)){var a=[t,r,n],o=G.resolve(e,a);if(o)return l(o.implementation,a);var u=[t,r],s=G.resolve(e,u);if(s)return l(s.implementation,u);var c=[t],f=G.resolve(e,c);return f?l(f.implementation,c):l(e,a)}return e(t,r,n);function l(a,o){try{return a.apply(a,o)}catch(a){var u;if(a instanceof TypeError&&"wrongType"===(null===(u=a.data)||void 0===u?void 0:u.category)){var s=[];throw s.push("value: ".concat(H(t))),o.length>=2&&s.push("index: ".concat(H(r))),o.length>=3&&s.push("array: ".concat(H(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(s.join(", "),") at index ").concat(JSON.stringify(r)))}throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(a.message))}}}var Su=Ee("filter",["typed"],(function(e){return(0,e.typed)("filter",{"Array, function":Cu,"Matrix, function":function(e,t){return e.create(Cu(e.toArray(),t))},"Array, RegExp":En,"Matrix, RegExp":function(e,t){return e.create(En(e.toArray(),t))}})}));function Cu(e,t){return Dn(e,(function(e,r,n){return Au(t,e,[r],n,"filter")}))}var Mu="flatten",Fu=Ee(Mu,["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return t(Mu,{Array:function(e){return bn(e)},Matrix:function(e){var t=bn(e.toArray());return r(t)}})})),Ou="forEach",Tu=Ee(Ou,["typed"],(function(e){return(0,e.typed)(Ou,{"Array, function":Bu,"Matrix, function":function(e,t){e.forEach(t)}})}));function Bu(e,t){!function r(n,i){if(!Array.isArray(n))return Au(t,n,i,e,"forEach");Nn(n,(function(e,t){r(e,i.concat(t))}))}(e,[])}var _u="getMatrixDataType",ku=Ee(_u,["typed"],(function(e){return(0,e.typed)(_u,{Array:function(e){return Mn(e,H)},Matrix:function(e){return e.getDataType()}})})),Iu="identity",Ru=Ee(Iu,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber,o=e.DenseMatrix,u=e.SparseMatrix;return t(Iu,{"":function(){return"Matrix"===r.matrix?n([]):[]},string:function(e){return n(e)},"number | BigNumber":function(e){return c(e,e,"Matrix"===r.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,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return c(e,t,r)},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?n(t):[];case 1:return c(e[0],e[0],t);case 2:return c(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function c(e,t,r){var n=a(e)||a(t)?i:null;if(a(e)&&(e=e.toNumber()),a(t)&&(t=t.toNumber()),!V(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!V(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var s=n?new i(1):1,c=n?new n(0):0,f=[e,t];if(r){if("sparse"===r)return u.diagonal(f,s,0,c);if("dense"===r)return o.diagonal(f,s,0,c);throw new TypeError('Unknown matrix type "'.concat(r,'"'))}for(var l=ln([],f,c),p=e<t?e:t,m=0;m<p;m++)l[m][m]=s;return l}})),zu="kron",qu=Ee(zu,["typed","matrix","multiplyScalar"],(function(e){var t=e.typed,r=e.matrix,n=e.multiplyScalar;return t(zu,{"Matrix, Matrix":function(e,t){return r(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return r(i(e.toArray(),t))},"Array, Matrix":function(e,t){return r(i(e,t.toArray()))},"Array, Array":i});function i(e,t){if(1===an(e).length&&(e=[e]),1===an(t).length&&(t=[t]),an(e).length>2||an(t).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(t.length)+")");var r=[],i=[];return e.map((function(e){return t.map((function(t){return i=[],r.push(i),e.map((function(e){return t.map((function(t){return i.push(n(e,t))}))}))}))}))&&r}})),ju=Ee("map",["typed"],(function(e){return(0,e.typed)("map",{"Array, function":Pu,"Matrix, function":function(e,t){return e.map(t)}})}));function Pu(e,t){return function r(n,i){return Array.isArray(n)?n.map((function(e,t){return r(e,i.concat(t))})):Au(t,n,i,e,"map")}(e,[])}var Lu="diff",Uu=Ee(Lu,["typed","matrix","subtract","number"],(function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.number;return t(Lu,{"Array | Matrix":function(e){return l(e)?r(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(!V(t))throw new RangeError("Dimension must be a whole number");return l(e)?r(a(e.toArray(),t)):a(e,t)},"Array, BigNumber":t.referTo("Array,number",(function(e){return function(t,r){return e(t,i(r))}})),"Matrix, BigNumber":t.referTo("Matrix,number",(function(e){return function(t,r){return e(t,i(r))}}))});function a(e,t){if(l(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var r=[];return e.forEach((function(e){r.push(a(e,t-1))})),r}if(0===t)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){for(var t=[],r=e.length,n=1;n<r;n++)t.push(u(e[n-1],e[n]));return t}function u(e,t){l(e)&&(e=e.toArray()),l(t)&&(t=t.toArray());var r=Array.isArray(e),i=Array.isArray(t);if(r&&i)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var r=[],n=e.length,i=0;i<n;i++)r.push(u(e[i],t[i]));return r}(e,t);if(!r&&!i)return n(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}})),$u=Ee("ones",["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t("ones",{"":function(){return"Array"===r.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===r.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var r=function(e){var t=!1;return e.forEach((function(e,r,n){a(e)&&(t=!0,n[r]=e.toNumber())})),t}(e),o=r?new i(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!V(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var u=n(t);return e.length>0?u.resize(e,o):u}var s=[];return e.length>0?ln(s,e,o):s}}));function Hu(){throw new Error('No "bignumber" implementation available')}function Gu(){throw new Error('No "fraction" implementation available')}function Vu(){throw new Error('No "matrix" implementation available')}var Zu="range",Wu=Ee(Zu,["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,u=e.larger,s=e.largerEq,c=e.add,f=e.isPositive;return t(Zu,{string:p,"string, boolean":p,"number, number":function(e,t){return l(m(e,t,1,!1))},"number, number, number":function(e,t,r){return l(m(e,t,r,!1))},"number, number, boolean":function(e,t,r){return l(m(e,t,1,r))},"number, number, number, boolean":function(e,t,r,n){return l(m(e,t,r,n))},"BigNumber, BigNumber":function(e,t){return l(m(e,t,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,t,r){return l(m(e,t,r,!1))},"BigNumber, BigNumber, boolean":function(e,t,r){return l(m(e,t,new(0,e.constructor)(1),r))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,r,n){return l(m(e,t,r,n))},"Unit, Unit, Unit":function(e,t,r){return l(m(e,t,r,!1))},"Unit, Unit, Unit, boolean":function(e,t,r,n){return l(m(e,t,r,n))}});function l(e){return"Matrix"===r.matrix?n?n(e):Vu():e}function p(e,t){var n=function(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}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===r.number?(void 0===i&&Hu(),l(m(i(n.start),i(n.end),i(n.step)))):l(m(n.start,n.end,n.step,t))}function m(e,t,r,n){for(var i=[],l=f(r)?n?o:a:n?s:u,p=e;l(p,t);)i.push(p),p=c(p,r);return i}})),Yu="reshape",Ju=Ee(Yu,["typed","isInteger","matrix"],(function(e){var t=e.typed,r=e.isInteger;return t(Yu,{"Matrix, Array":function(e,t){return e.reshape(t,!0)},"Array, Array":function(e,t){return t.forEach((function(e){if(!r(e))throw new TypeError("Invalid size for dimension: "+e)})),mn(e,t)}})})),Xu=Ee("resize",["config","matrix"],(function(e){var t=e.config,r=e.matrix;return function(e,n,i){if(2!==arguments.length&&3!==arguments.length)throw new Ka("resize",arguments.length,2,3);if(l(n)&&(n=n.valueOf()),a(n[0])&&(n=n.map((function(e){return a(e)?e.toNumber():e}))),l(e))return e.resize(n,i,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new rn(t.length,1);var n=t[0];if("number"!=typeof n||!V(n))throw new TypeError("Invalid size, must contain positive integers (size: "+Jr(t)+")");if(e.length>n)return e.substring(0,n);if(e.length<n){for(var i=e,a=0,o=n-e.length;a<o;a++)i+=r;return i}return e}(e,n,i);var o=!Array.isArray(e)&&"Array"!==t.matrix;if(0===n.length){for(;Array.isArray(e);)e=e[0];return he(e)}Array.isArray(e)||(e=[e]);var u=ln(e=he(e),n,i);return o?r(u):u}})),Qu="rotate",Ku=Ee(Qu,["typed","multiply","rotationMatrix"],(function(e){var t=e.typed,r=e.multiply,n=e.rotationMatrix;return t(Qu,{"Array , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,t){return i(e,2),r(n(t),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),r(n(t,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,t,a){return i(e,3),r(n(t,a),e)}});function i(e,t){var r=Array.isArray(e)?an(e):e.size();if(r.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(t));if(2===r.length&&1!==r[1])throw new RangeError("Vector must be of dimensions 1x".concat(t));if(r[0]!==t)throw new RangeError("Vector must be of dimensions 1x".concat(t))}})),es="rotationMatrix",ts=Ee(es,["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],(function(e){var t=e.typed,r=e.config,n=e.multiplyScalar,i=e.addScalar,o=e.unaryMinus,u=e.norm,s=e.BigNumber,c=e.matrix,f=e.DenseMatrix,l=e.SparseMatrix,p=e.cos,m=e.sin;return t(es,{"":function(){return"Matrix"===r.matrix?c([]):[]},string:function(e){return c(e)},"number | BigNumber | Complex | Unit":function(e){return h(e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,t){return h(e,t)},"number | BigNumber | Complex | Unit, Array":function(e,t){var r=c(t);return d(r),g(e,r,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,t){d(t);var n=t.storage()||("Matrix"===r.matrix?"dense":void 0);return g(e,t,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,t,r){var n=c(t);return d(n),g(e,n,r)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,t,r){return d(t),g(e,t,r)}});function h(e,t){var r=a(e)?new s(-1):-1,i=p(e),o=m(e);return y([[i,n(r,o)],[o,i]],t)}function d(e){var t=e.size();if(t.length<1||3!==t[0])throw new RangeError("Vector must be of dimensions 1x3")}function v(e){return e.reduce((function(e,t){return n(e,t)}))}function y(e,t){if(t){if("sparse"===t)return new l(e);if("dense"===t)return new f(e);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}return e}function g(e,t,r){var n=u(t);if(0===n)throw new RangeError("Rotation around zero vector");var c=a(e)?s:null,f=c?new c(1):1,l=c?new c(-1):-1,h=c?new c(t.get([0])/n):t.get([0])/n,d=c?new c(t.get([1])/n):t.get([1])/n,g=c?new c(t.get([2])/n):t.get([2])/n,x=p(e),b=i(f,o(x)),w=m(e);return y([[i(x,v([h,h,b])),i(v([h,d,b]),v([l,g,w])),i(v([h,g,b]),v([d,w]))],[i(v([h,d,b]),v([g,w])),i(x,v([d,d,b])),i(v([d,g,b]),v([l,h,w]))],[i(v([h,g,b]),v([l,d,w])),i(v([d,g,b]),v([h,w])),i(x,v([g,g,b]))]],r)}})),rs=Ee("row",["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,i=e.range;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(n(he(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");cn(t,e.size()[0]);var a=i(0,e.size()[1]),o=new r(t,a),u=e.subset(o);return l(u)?u:n([[u]])}})),ns="size",is=Ee(ns,["typed","config","?matrix"],(function(e){var t=e.typed,r=e.config,n=e.matrix;return t(ns,{Matrix:function(e){return e.create(e.size())},Array:an,string:function(e){return"Array"===r.matrix?[e.length]:n([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===r.matrix?[]:n?n([]):Vu()}})})),as="squeeze",os=Ee(as,["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return t(as,{Array:function(e){return vn(he(e))},Matrix:function(e){var t=vn(e.toArray());return Array.isArray(t)?r(t):t},any:function(e){return he(e)}})})),us="subset",ss=Ee(us,["typed","matrix","zeros","add"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.add;return t(us,{"Matrix, Index":function(e,t){return fn(t)?r():(sn(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",(function(e){return function(t,n){var i=e(r(t),n);return n.isScalar()?i:i.valueOf()}})),"Object, Index":ls,"string, Index":cs,"Matrix, Index, any, any":function(e,t,r,a){return fn(t)?e:(sn(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t._isScalar)return e;var r=t.size();if(!r.every((function(e){return e>0})))return e;try{return i(e,n(r))}catch(t){return e}}(r,t),a))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i,a){var o=e(r(t),n,i,a);return o.isMatrix?o.valueOf():o}})),"Array, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,n,i){return e(r(t),n,i,void 0).valueOf()}})),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",(function(e){return function(t,r,n){return e(t,r,n,void 0)}})),"string, Index, string":fs,"string, Index, string, string":fs,"Object, Index, any":ps})}));function cs(e,t){if(!v(t))throw new TypeError("Index expected");if(fn(t))return"";if(sn(Array.from(e),t),1!==t.size().length)throw new rn(t.size().length,1);var r=e.length;cn(t.min()[0],r),cn(t.max()[0],r);var n=t.dimension(0),i="";return n.forEach((function(t){i+=e.charAt(t)})),i}function fs(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(fn(t))return e;if(sn(Array.from(e),t),1!==t.size().length)throw new rn(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0);if(i.size()[0]!==r.length)throw new rn(i.size()[0],r.length);var a=e.length;cn(t.min()[0]),cn(t.max()[0]);for(var o=[],u=0;u<a;u++)o[u]=e.charAt(u);if(i.forEach((function(e,t){o[e]=r.charAt(t[0])})),o.length>a)for(var s=a-1,c=o.length;s<c;s++)o[s]||(o[s]=n);return o.join("")}function ls(e,t){if(!fn(t)){if(1!==t.size().length)throw new rn(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");return Te(e,r)}}function ps(e,t,r){if(fn(t))return e;if(1!==t.size().length)throw new rn(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");var i=he(e);return Be(i,n,r),i}var ms="transpose",hs=Ee(ms,["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return t(ms,{Array:function(e){return n(r(e)).valueOf()},Matrix:n,any:he});function n(e){var t,r=e.size();switch(r.length){case 1:t=e.clone();break;case 2:var n=r[0],i=r[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Jr(r)+")");switch(e.storage()){case"dense":t=function(e,t,r){for(var n,i=e._data,a=[],o=0;o<r;o++){n=a[o]=[];for(var u=0;u<t;u++)n[u]=he(i[u][o])}return e.createDenseMatrix({data:a,size:[r,t],datatype:e._datatype})}(e,n,i);break;case"sparse":t=function(e,t,r){for(var n,i,a,o=e._values,u=e._index,s=e._ptr,c=o?[]:void 0,f=[],l=[],p=[],m=0;m<t;m++)p[m]=0;for(n=0,i=u.length;n<i;n++)p[u[n]]++;for(var h=0,d=0;d<t;d++)l.push(h),h+=p[d],p[d]=l[d];for(l.push(h),a=0;a<r;a++)for(var v=s[a],y=s[a+1],g=v;g<y;g++){var x=p[u[g]]++;f[x]=a,o&&(c[x]=he(o[g]))}return e.createSparseMatrix({values:c,index:f,ptr:l,size:[r,t],datatype:e._datatype})}(e,n,i)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Jr(r)+")")}return t}})),ds="ctranspose",vs=Ee(ds,["typed","transpose","conj"],(function(e){var t=e.typed,r=e.transpose,n=e.conj;return t(ds,{any:function(e){return n(r(e))}})})),ys="zeros",gs=Ee(ys,["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.BigNumber;return t(ys,{"":function(){return"Array"===r.matrix?o([]):o([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return o(e,t)}return"Array"===r.matrix?o(e):o(e,"default")},Array:o,Matrix:function(e){var t=e.storage();return o(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return o(e.valueOf(),t)}});function o(e,t){var r=function(e){var t=!1;return e.forEach((function(e,r,n){a(e)&&(t=!0,n[r]=e.toNumber())})),t}(e),o=r?new i(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!V(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var u=n(t);return e.length>0?u.resize(e,o):u}var s=[];return e.length>0?ln(s,e,o):s}})),xs=Ee("fft",["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],(function(e){var t=e.typed,r=(e.matrix,e.addScalar),n=e.multiplyScalar,i=e.divideScalar,a=e.exp,o=e.tau,u=e.i,s=e.dotDivide,c=e.conj,f=e.pow,l=e.ceil,p=e.log2;return t("fft",{Array:m,Matrix:function(e){return e.create(m(e.toArray()))}});function m(e){var t=an(e);return 1===t.length?d(e,t[0]):h(e.map((function(e){return m(e,t.slice(1))})),0)}function h(e,t){var r=an(e);if(0!==t)return new Array(r[0]).fill(0).map((function(r,n){return h(e[n],t-1)}));if(1===r.length)return d(e);function n(e){var t=an(e);return new Array(t[1]).fill(0).map((function(r,n){return new Array(t[0]).fill(0).map((function(t,r){return e[r][n]}))}))}return n(h(n(e),1))}function d(e){var t=e.length;if(1===t)return[e[0]];if(t%2==0){for(var h=[].concat(Vr(d(e.filter((function(e,t){return t%2==0})))),Vr(d(e.filter((function(e,t){return t%2==1}))))),v=0;v<t/2;v++){var y=h[v],g=n(h[v+t/2],a(n(n(o,u),i(-v,t))));h[v]=r(y,g),h[v+t/2]=r(y,n(-1,g))}return h}return function(e){for(var t=e.length,r=a(i(n(-1,n(u,o)),t)),h=[],v=1-t;v<t;v++)h.push(f(r,i(f(v,2),2)));for(var y=f(2,l(p(t+t-1))),g=[].concat(Vr(new Array(t).fill(0).map((function(r,i){return n(e[i],h[t-1+i])}))),Vr(new Array(y-t).fill(0))),x=[].concat(Vr(new Array(t+t-1).fill(0).map((function(e,t){return i(1,h[t])}))),Vr(new Array(y-(t+t-1)).fill(0))),b=d(g),w=d(x),N=new Array(y).fill(0).map((function(e,t){return n(b[t],w[t])})),D=s(c(m(c(N))),y),E=[],A=t-1;A<t+t-1;A++)E.push(n(D[A],h[A]));return E}(e)}})),bs="ifft",ws=Ee(bs,["typed","fft","dotDivide","conj"],(function(e){var t=e.typed,r=e.fft,n=e.dotDivide,i=e.conj;return t(bs,{"Array | Matrix":function(e){var t=l(e)?e.size():an(e);return n(i(r(i(e))),t.reduce((function(e,t){return e*t}),1))}})}));function Ns(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}r(1919),r(9474),r(5082);var Ds=Ee("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],(function(e){var t=e.typed,r=e.add,n=e.subtract,o=e.multiply,u=e.divide,c=e.max,f=e.map,l=e.abs,p=e.isPositive,m=e.isNegative,h=e.larger,d=e.smaller,v=e.matrix,y=e.bignumber,g=e.unaryMinus;function x(e){return function(t,i,v,x){if(2!==i.length||!i.every(D)&&!i.every(s))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var b=i[0],w=i[1],N=h(w,b),E=x.firstStep;if(void 0!==E&&!p(E))throw new Error('"firstStep" must be positive');var A=x.maxStep;if(void 0!==A&&!p(A))throw new Error('"maxStep" must be positive');var S=x.minStep;if(S&&m(S))throw new Error('"minStep" must be positive or zero');var C=[b,w,E,S,A].filter((function(e){return void 0!==e}));if(!C.every(D)&&!C.every(s))throw new Error('Inconsistent type of "t" dependant variables');for(var M=x.tol?x.tol:1e-4,F=x.minDelta?x.minDelta:.2,O=x.maxDelta?x.maxDelta:5,T=x.maxIter?x.maxIter:1e4,B=[b,w].concat(Vr(v),[A,S]).some(a),_=wa(B?[y(e.a),y(e.c),y(e.b),y(e.bp)]:[e.a,e.c,e.b,e.bp],4),k=_[0],I=_[1],R=_[2],z=_[3],q=E?N?E:g(E):u(n(w,b),1),j=[b],P=[v],L=n(R,z),U=0,$=0,H=function(e){return e?d:h}(N),G=function(e){var t=e?h:d;return function(e,i,a){var o=r(e,a);return t(o,i)?n(i,e):a}}(N);H(j[U],w);){var V=[];q=G(j[U],w,q),V.push(t(j[U],P[U]));for(var Z=1;Z<I.length;++Z)V.push(t(r(j[U],o(I[Z],q)),r(P[U],o(q,k[Z],V))));var W=c(l(f(o(L,V),(function(e){return s(e)?e.value:e}))));W<M&&M/W>1/4&&(j.push(r(j[U],q)),P.push(r(P[U],o(q,R,V))),U++);var Y=.84*Math.pow(M/W,.2);if(d(Y,F)?Y=F:h(Y,O)&&(Y=O),Y=B?y(Y):Y,q=o(q,Y),A&&h(l(q),A)?q=N?A:g(A):S&&d(l(q),S)&&(q=N?S:g(S)),++$>T)throw new Error("Maximum number of iterations reached, try changing options")}return{t:j,y:P}}}function b(e,t,r,n){return x({a:[[],[.5],[0,3/4],[2/9,1/3,4/9]],c:[null,.5,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,t,r,n)}function w(e,t,r,n){return x({a:[[],[.2],[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,.2,.3,.8,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,r,n)}function N(e,t,r,n){var i=n.method?n.method:"RK45",a={RK23:b,RK45:w};if(i.toUpperCase()in a){var o=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ns(Object(r),!0).forEach((function(t){Ua(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ns(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},n);return delete o.method,a[i.toUpperCase()](e,t,r,o)}var u=Object.keys(a).map((function(e){return'"'.concat(e,'"')})),s="".concat(u.slice(0,-1).join(", ")," and ").concat(u.slice(-1));throw new Error('Unavailable method "'.concat(i,'". Available methods are ').concat(s))}function D(e){return a(e)||i(e)}function E(e,t,r,n){var i=N(e,t.toArray(),r.toArray(),n);return{t:v(i.t),y:v(i.y)}}return t("solveODE",{"function, Array, Array, Object":N,"function, Matrix, Matrix, Object":E,"function, Array, Array":function(e,t,r){return N(e,t,r,{})},"function, Matrix, Matrix":function(e,t,r){return E(e,t,r,{})},"function, Array, number | BigNumber | Unit":function(e,t,r){var n=N(e,t,[r],{});return{t:n.t,y:n.y.map((function(e){return e[0]}))}},"function, Matrix, number | BigNumber | Unit":function(e,t,r){var n=N(e,t.toArray(),[r],{});return{t:v(n.t),y:v(n.y.map((function(e){return e[0]})))}},"function, Array, number | BigNumber | Unit, Object":function(e,t,r,n){var i=N(e,t,[r],n);return{t:i.t,y:i.y.map((function(e){return e[0]}))}},"function, Matrix, number | BigNumber | Unit, Object":function(e,t,r,n){var i=N(e,t.toArray(),[r],n);return{t:v(i.t),y:v(i.y.map((function(e){return e[0]})))}}})})),Es=Ee("erf",["typed"],(function(e){var t=e.typed;return t("name",{number:function(e){var t=Math.abs(e);return t>=Fs?Z(e):t<=As?Z(e)*function(e){var t,r=e*e,n=Cs[0][4]*r,i=r;for(t=0;t<3;t+=1)n=(n+Cs[0][t])*r,i=(i+Ms[0][t])*r;return e*(n+Cs[0][3])/(i+Ms[0][3])}(t):t<=4?Z(e)*(1-function(e){var t,r=Cs[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+Cs[1][t])*e,n=(n+Ms[1][t])*e;var i=(r+Cs[1][7])/(n+Ms[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):Z(e)*(1-function(e){var t,r=1/(e*e),n=Cs[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+Cs[2][t])*r,i=(i+Ms[2][t])*r;var a=r*(n+Cs[2][4])/(i+Ms[2][4]);a=(Ss-a)/e;var o=(e-(r=parseInt(16*e)/16))*(e+r);return Math.exp(-r*r)*Math.exp(-o)*a}(t))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),As=.46875,Ss=.5641895835477563,Cs=[[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]],Ms=[[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]],Fs=Math.pow(2,53),Os="zeta",Ts=Ee(Os,["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],(function(e){var t=e.typed,r=e.config,n=e.multiply,i=e.pow,a=e.divide,o=e.factorial,u=e.equal,s=e.smallerEq,c=e.isNegative,f=e.gamma,l=e.sin,p=e.subtract,m=e.add,h=e.Complex,d=e.BigNumber,v=e.pi;return t(Os,{number:function(e){return y(e,(function(e){return e}),(function(){return 20}))},BigNumber:function(e){return y(e,(function(e){return new d(e)}),(function(){return Math.abs(Math.log10(r.epsilon))}))},Complex:function(e){return 0===e.re&&0===e.im?new h(-.5):1===e.re?new h(NaN,NaN):e.re===1/0&&0===e.im?new h(1):e.im===1/0||e.re===-1/0?new h(NaN,NaN):g(e,(function(e){return e}),(function(e){return Math.round(19.5+.9*Math.abs(e.im))}),(function(e){return e.re}))}});function y(e,t,r){return u(e,0)?t(-.5):u(e,1)?t(NaN):isFinite(e)?g(e,t,r,(function(e){return e})):c(e)?t(NaN):t(1)}function g(e,t,r,o){var u=r(e);if(o(e)>-(u-1)/2)return function(e,t,r){for(var o=a(1,n(x(r(0),t),p(1,i(2,p(1,e))))),u=r(0),c=r(1);s(c,t);c=m(c,1))u=m(u,a(n(Math.pow(-1,c-1),x(c,t)),i(c,e)));return n(o,u)}(e,t(u),t);var c=n(i(2,e),i(t(v),p(e,1)));return c=n(c,l(n(a(t(v),2),e))),c=n(c,f(p(1,e))),n(c,g(p(1,e),t,r,o))}function x(e,t){for(var r=e,u=e;s(u,t);u=m(u,1)){var c=a(n(o(m(t,p(u,1))),i(4,u)),n(o(p(t,u)),o(n(2,u))));r=m(r,c)}return n(t,r)}})),Bs="mode",_s=Ee(Bs,["typed","isNaN","isNumeric"],(function(e){var t=e.typed,r=e.isNaN,n=e.isNumeric;return t(Bs,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=bn(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},i=[],a=0,o=0;o<e.length;o++){var u=e[o];if(n(u)&&r(u))throw new Error("Cannot calculate mode of an array containing NaN values");u in t||(t[u]=0),t[u]++,t[u]===a?i.push(u):t[u]>a&&(a=t[u],i=[u])}return i}}));function ks(e,t,r){var n;return-1!==String(e).indexOf("Unexpected type")?(n=arguments.length>2?" (type: "+H(r)+", value: "+JSON.stringify(r)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+n)):-1!==String(e).indexOf("complex numbers")?(n=arguments.length>2?" (type: "+H(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+n)):e}var Is="prod",Rs=Ee(Is,["typed","config","multiplyScalar","numeric"],(function(e){var t=e.typed,r=e.config,n=e.multiplyScalar,i=e.numeric;return t(Is,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var t;if($n(e,(function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw ks(t,"prod",e)}})),"string"==typeof t&&(t=i(t,r.number)),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),zs="format",qs=Ee(zs,["typed"],(function(e){return(0,e.typed)(zs,{any:Jr,"any, Object | function | number":Jr})})),js=Ee("bin",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("bin",{"number | BigNumber":function(e){return r(e,{notation:"bin"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"bin",wordSize:t})}})})),Ps=Ee("oct",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("oct",{"number | BigNumber":function(e){return r(e,{notation:"oct"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"oct",wordSize:t})}})})),Ls=Ee("hex",["typed","format"],(function(e){var t=e.typed,r=e.format;return t("hex",{"number | BigNumber":function(e){return r(e,{notation:"hex"})},"number | BigNumber, number":function(e,t){return r(e,{notation:"hex",wordSize:t})}})})),Us=/\$([\w.]+)/g,$s="print",Hs=Ee($s,["typed"],(function(e){return(0,e.typed)($s,{"string, Object | Array":Gs,"string, Object | Array, number | Object":Gs})}));function Gs(e,t,r){return e.replace(Us,(function(e,n){var i=n.split("."),a=t[i.shift()];for(void 0!==a&&a.isMatrix&&(a=a.toArray());i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}return void 0!==a?c(a)?a:Jr(a,r):e}))}var Vs=Ee("to",["typed","matrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.concat;return t("to",{"Unit, Unit | string":function(e,t){return e.to(t)}},Wa({typed:t,matrix:r,concat:n})({Ds:!0}))})),Zs="isPrime",Ws=Ee(Zs,["typed"],(function(e){var t=e.typed;return t(Zs,{number:function(e){if(0*e!=0)return!1;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},BigNumber:function(e){if(0*e.toNumber()!=0)return!1;if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(Math.pow(2,32))){for(var t=e.toNumber(),r=5;r*r<=t;r+=6)if(t%r==0||t%(r+2)==0)return!1;return!0}function n(e,t,r){for(var n=1;!t.eq(0);)t.mod(2).eq(0)?(t=t.div(2),e=e.mul(e).mod(r)):(t=t.sub(1),n=e.mul(n).mod(r));return n}for(var i=e.constructor.clone({precision:2*e.toFixed(0).length}),a=0,o=(e=new i(e)).sub(1);o.mod(2).eq(0);)o=o.div(2),a+=1;var u=null;if(e.lt("3317044064679887385961981"))u=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((function(t){return t<e}));else{var s=Math.min(e.toNumber()-2,Math.floor(2*Math.pow(e.toFixed(0).length*Math.log(10),2)));u=[];for(var c=2;c<=s;c+=1)u.push(s)}for(var f=0;f<u.length;f+=1){var l=u[f],p=n(e.sub(e).add(l),o,e);if(!p.eq(1))for(var m=0,h=p;!h.eq(e.sub(1));m+=1,h=h.mul(h).mod(e))if(m===a-1)return!1}return!0},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Ys=Ee("numeric",["number","?bignumber","?fraction"],(function(e){var t=e.number,r=e.bignumber,n=e.fraction,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:function(e){return t(e)},BigNumber:r?function(e){return r(e)}:Hu,Fraction:n?function(e){return n(e)}:Gu};return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");var r=H(e);if(!(r in i))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===r?e:a[t](e)}})),Js="divideScalar",Xs=Ee(Js,["typed","numeric"],(function(e){var t=e.typed;return e.numeric,t(Js,{"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)},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":function(e,t){return e.divide(t)},"number | Fraction | Complex | BigNumber, Unit":function(e,t){return t.divideInto(e)}})})),Qs=Ee("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],(function(e){var t=e.typed,r=e.config,n=e.identity,i=e.multiply,a=e.matrix,o=e.inv,u=e.number,s=e.fraction,c=e.Complex;return t("pow",{"number, number":f,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||r.predictable?e.pow(t):new c(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){var n=e.pow(t);if(null!=n)return n;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return f(e.valueOf(),t.valueOf())},"Array, number":l,"Array, BigNumber":function(e,t){return l(e,t.toNumber())},"Matrix, number":p,"Matrix, BigNumber":function(e,t){return p(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function f(e,t){if(r.predictable&&!V(t)&&e<0)try{var n=s(t),i=u(n);if((t===i||Math.abs((t-i)/t)<1e-14)&&n.d%2==1)return(n.n%2==0?1:-1)*Math.pow(-e,t)}catch(e){}return r.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:V(t)||e>=0||r.predictable?aa(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new c(e,0).pow(t,0)}function l(e,t){if(!V(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");var r=an(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return l(o(e),-t)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw e}for(var a=n(r[0]).valueOf(),u=e;t>=1;)1==(1&t)&&(a=i(u,a)),t>>=1,u=i(u,u);return a}function p(e,t){return a(l(e.valueOf(),t))}})),Ks="Number of decimals in function round must be an integer",ec="round",tc=Ee(ec,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.BigNumber,o=e.DenseMatrix,u=Na({typed:t,equalScalar:n}),s=Da({typed:t,DenseMatrix:o}),c=Ea({typed:t});return t(ec,{number:oa,"number, number":oa,"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ks);return new a(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(Ks);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ks);var r=t.toNumber();return e.round(r)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ks);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(Ks);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ks);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf((function(e){return function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}})),"Unit, BigNumber, Unit":t.referToSelf((function(e){return function(t,r,n){return e(t,r.toNumber(),n)}})),"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t,0,r)}})),"Array | Matrix, number, Unit":t.referToSelf((function(e){return function(t,r,n){return Hn(t,(function(t){return e(t,r,n)}),!0)}})),"Array | Matrix, BigNumber, Unit":t.referToSelf((function(e){return function(t,r,n){return e(t,r.toNumber(),n)}})),"Array | Matrix, Unit":t.referToSelf((function(e){return function(t,r){return e(t,0,r)}})),"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e,!0)}})),"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return u(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return c(t,r,e,!1)}})),"Array, number | BigNumber":t.referToSelf((function(e){return function(t,n){return c(r(t),n,e,!1).valueOf()}})),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):s(r,t,e,!0)}})),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):c(r,t,e,!0)}})),"number | Complex | BigNumber | Fraction, Array":t.referToSelf((function(e){return function(t,n){return c(r(n),t,e,!0).valueOf()}}))})})),rc=Ee("log",["config","typed","divideScalar","Complex"],(function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.Complex;return t("log",{number:function(e){return e>=0||r.predictable?function(e,t){return Math.log(e)}(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():new i(e.toNumber(),0).log()},"any, any":t.referToSelf((function(e){return function(t,r){return n(e(t),e(r))}}))})})),nc="log1p",ic=Ee(nc,["typed","config","divideScalar","log","Complex"],(function(e){var t=e.typed,r=e.config,n=e.divideScalar,i=e.log,a=e.Complex;return t(nc,{number:function(e){return e>=-1||r.predictable?J(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}})),"any, any":t.referToSelf((function(e){return function(t,r){return n(e(t),i(r))}}))});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))}})),ac="nthRoots",oc=Ee(ac,["config","typed","divideScalar","Complex"],(function(e){var t=e.typed,r=(e.config,e.divideScalar,e.Complex),n=[function(e){return new r(e,0)},function(e){return new r(0,e)},function(e){return new r(-e,0)},function(e){return new r(0,-e)}];function i(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new r(0,0)];var i,a="number"==typeof e;(a||0===e.re||0===e.im)&&(i=a?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var o=e.arg(),u=e.abs(),s=[],c=Math.pow(u,1/t),f=0;f<t;f++){var l=(i+4*f)/t;l!==Math.round(l)?s.push(new r({r:c,phi:(o+2*Math.PI*f)/t})):s.push(n[l%4](c))}return s}return t(ac,{Complex:function(e){return i(e,2)},"Complex, number":i})})),uc="dotPow",sc=Ee(uc,["typed","equalScalar","matrix","pow","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.equalScalar,n=e.matrix,i=e.pow,a=e.DenseMatrix,o=e.concat,u=Ha({typed:t}),s=Ko({typed:t,DenseMatrix:a}),c=Na({typed:t,equalScalar:r}),f=Da({typed:t,DenseMatrix:a}),l=Wa({typed:t,matrix:n,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]));var h=t(p);return t(uc,l({elop:h,SS:s,DS:u,Ss:c,sS:f}))})),cc="dotDivide",fc=Ee(cc,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.divideScalar,a=e.DenseMatrix,o=e.concat,u=$a({typed:t,equalScalar:n}),s=Ha({typed:t}),c=Ko({typed:t,DenseMatrix:a}),f=Na({typed:t,equalScalar:n}),l=Da({typed:t,DenseMatrix:a}),p=Wa({typed:t,matrix:r,concat:o});return t(cc,p({elop:i,SS:c,DS:s,SD:u,Ss:f,sS:l}))}));function lc(e){var t=e.DenseMatrix;return function(e,r,n){var i=e.size();if(2!==i.length)throw new RangeError("Matrix must be two dimensional (size: "+Jr(i)+")");var a=i[0];if(a!==i[1])throw new RangeError("Matrix must be square (size: "+Jr(i)+")");var o=[];if(l(r)){var u=r.size(),s=r._data;if(1===u.length){if(u[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c<a;c++)o[c]=[s[c]];return new t({data:o,size:[a,1],datatype:r._datatype})}if(2===u.length){if(u[0]!==a||1!==u[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(m(r)){if(n){o=[];for(var p=0;p<a;p++)o[p]=[s[p][0]];return new t({data:o,size:[a,1],datatype:r._datatype})}return r}if(h(r)){for(var d=0;d<a;d++)o[d]=[0];for(var v=r._values,y=r._index,g=r._ptr,x=g[1],b=g[0];b<x;b++)o[y[b]][0]=v[b];return new t({data:o,size:[a,1],datatype:r._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(f(r)){var w=an(r);if(1===w.length){if(w[0]!==a)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var N=0;N<a;N++)o[N]=[r[N]];return new t({data:o,size:[a,1]})}if(2===w.length){if(w[0]!==a||1!==w[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var D=0;D<a;D++)o[D]=[r[D][0]];return new t({data:o,size:[a,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var pc="lsolve",mc=Ee(pc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=lc({DenseMatrix:u});return t(pc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=[],d=0;d<f;d++){var v=r[d][0]||0;if(o(v,0))h[d]=[0];else{for(var y=0,g=[],x=[],b=m[d],w=m[d+1],N=b;N<w;N++){var D=p[N];D===d?y=l[N]:D>d&&(g.push(l[N]),x.push(D))}if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var E=n(v,y),A=0,S=x.length;A<S;A++){var C=x[A];r[C]=[a(r[C][0]||0,i(E,g[A]))]}h[d]=[E]}}return new u({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).valueOf()}});function c(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=[],p=e._data,m=0;m<f;m++){var h=r[m][0]||0,d=void 0;if(o(h,0))d=0;else{var v=p[m][m];if(o(v,0))throw new Error("Linear system cannot be solved since matrix is singular");d=n(h,v);for(var y=m+1;y<c;y++)r[y]=[a(r[y][0]||0,i(d,p[y][m]))]}l[m]=[d]}return new u({data:l,size:[c,1]})}})),hc="usolve",dc=Ee(hc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=lc({DenseMatrix:u});return t(hc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=[],d=f-1;d>=0;d--){var v=r[d][0]||0;if(o(v,0))h[d]=[0];else{for(var y=0,g=[],x=[],b=m[d],w=m[d+1]-1;w>=b;w--){var N=p[w];N===d?y=l[w]:N<d&&(g.push(l[w]),x.push(N))}if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var D=n(v,y),E=0,A=x.length;E<A;E++){var S=x[E];r[S]=[a(r[S][0],i(D,g[E]))]}h[d]=[D]}}return new u({data:h,size:[c,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).valueOf()}});function c(e,t){for(var r=(t=s(e,t,!0))._data,c=e._size[0],f=e._size[1],l=[],p=e._data,m=f-1;m>=0;m--){var h=r[m][0]||0,d=void 0;if(o(h,0))d=0;else{var v=p[m][m];if(o(v,0))throw new Error("Linear system cannot be solved since matrix is singular");d=n(h,v);for(var y=m-1;y>=0;y--)r[y]=[a(r[y][0]||0,i(d,p[y][m]))]}l[m]=[d]}return new u({data:l,size:[c,1]})}})),vc="lsolveAll",yc=Ee(vc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=lc({DenseMatrix:u});return t(vc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=0;h<f;h++)for(var d=r.length,v=0;v<d;v++){for(var y=r[v],g=[],x=[],b=m[h],w=m[h+1],N=0,D=b;D<w;D++){var E=p[D];E===h?N=l[D]:E>h&&(g.push(l[D]),x.push(E))}if(o(N,0))if(o(y[h],0)){if(0===v){var A=Vr(y);A[h]=1;for(var S=0,C=x.length;S<C;S++){var M=x[S];A[M]=a(A[M],g[S])}r.push(A)}}else{if(0===v)return[];r.splice(v,1),v-=1,d-=1}else{y[h]=n(y[h],N);for(var F=0,O=x.length;F<O;F++){var T=x[F];y[T]=a(y[T],i(y[h],g[F]))}}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[c,1]})}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map((function(e){return e.valueOf()}))}});function c(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._data,f=e._size[0],l=e._size[1],p=0;p<l;p++)for(var m=r.length,h=0;h<m;h++){var d=r[h];if(o(c[p][p],0))if(o(d[p],0)){if(0===h){var v=Vr(d);v[p]=1;for(var y=p+1;y<l;y++)v[y]=a(v[y],c[y][p]);r.push(v)}}else{if(0===h)return[];r.splice(h,1),h-=1,m-=1}else{d[p]=n(d[p],c[p][p]);for(var g=p+1;g<l;g++)d[g]=a(d[g],i(d[p],c[g][p]))}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[f,1]})}))}})),gc="usolveAll",xc=Ee(gc,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.multiplyScalar,a=e.subtractScalar,o=e.equalScalar,u=e.DenseMatrix,s=lc({DenseMatrix:u});return t(gc,{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._size[0],f=e._size[1],l=e._values,p=e._index,m=e._ptr,h=f-1;h>=0;h--)for(var d=r.length,v=0;v<d;v++){for(var y=r[v],g=[],x=[],b=m[h],w=0,N=m[h+1]-1;N>=b;N--){var D=p[N];D===h?w=l[N]:D<h&&(g.push(l[N]),x.push(D))}if(o(w,0))if(o(y[h],0)){if(0===v){var E=Vr(y);E[h]=1;for(var A=0,S=x.length;A<S;A++){var C=x[A];E[C]=a(E[C],g[A])}r.push(E)}}else{if(0===v)return[];r.splice(v,1),v-=1,d-=1}else{y[h]=n(y[h],w);for(var M=0,F=x.length;M<F;M++){var O=x[M];y[O]=a(y[O],i(y[h],g[M]))}}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[c,1]})}))}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return c(e,t)},"Array, Array | Matrix":function(e,t){return c(r(e),t).map((function(e){return e.valueOf()}))}});function c(e,t){for(var r=[s(e,t,!0)._data.map((function(e){return e[0]}))],c=e._data,f=e._size[0],l=e._size[1]-1;l>=0;l--)for(var p=r.length,m=0;m<p;m++){var h=r[m];if(o(c[l][l],0))if(o(h[l],0)){if(0===m){var d=Vr(h);d[l]=1;for(var v=l-1;v>=0;v--)d[v]=a(d[v],c[v][l]);r.push(d)}}else{if(0===m)return[];r.splice(m,1),m-=1,p-=1}else{h[l]=n(h[l],c[l][l]);for(var y=l-1;y>=0;y--)h[y]=a(h[y],i(h[l],c[y][l]))}}return r.map((function(e){return new u({data:e.map((function(e){return[e]})),size:[f,1]})}))}})),bc=Ee("matAlgo08xS0Sid",["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return function(e,n,i){var a=e._values,o=e._index,u=e._ptr,s=e._size,c=e._datatype,f=n._values,l=n._index,p=n._ptr,m=n._size,h=n._datatype;if(s.length!==m.length)throw new rn(s.length,m.length);if(s[0]!==m[0]||s[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+m+")");if(!a||!f)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var d,v=s[0],y=s[1],g=r,x=0,b=i;"string"==typeof c&&c===h&&(d=c,g=t.find(r,[d,d]),x=t.convert(0,d),b=t.find(i,[d,d]));for(var w,N,D,E,A=[],S=[],C=[],M=[],F=[],O=0;O<y;O++){C[O]=S.length;var T=O+1;for(N=u[O],D=u[O+1],w=N;w<D;w++)F[E=o[w]]=T,M[E]=a[w],S.push(E);for(N=p[O],D=p[O+1],w=N;w<D;w++)F[E=l[w]]===T&&(M[E]=b(M[E],f[w]));for(w=C[O];w<S.length;){var B=M[E=S[w]];g(B,x)?S.splice(w,1):(A.push(B),w++)}}return C[y]=S.length,e.createSparseMatrix({values:A,index:S,ptr:C,size:[v,y],datatype:d})}})),wc=Ee("useMatrixForArrayScalar",["typed","matrix"],(function(e){var t=e.typed,r=e.matrix;return{"Array, number":t.referTo("DenseMatrix, number",(function(e){return function(t,n){return e(r(t),n).valueOf()}})),"Array, BigNumber":t.referTo("DenseMatrix, BigNumber",(function(e){return function(t,n){return e(r(t),n).valueOf()}})),"number, Array":t.referTo("number, DenseMatrix",(function(e){return function(t,n){return e(t,r(n)).valueOf()}})),"BigNumber, Array":t.referTo("BigNumber, DenseMatrix",(function(e){return function(t,n){return e(t,r(n)).valueOf()}}))}})),Nc="leftShift",Dc=Ee(Nc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=e.concat,u=Ja({typed:t}),s=$a({typed:t,equalScalar:n}),c=bc({typed:t,equalScalar:n}),f=Qa({typed:t,DenseMatrix:a}),l=Na({typed:t,equalScalar:n}),p=Ea({typed:t}),m=Wa({typed:t,matrix:r,concat:o}),h=wc({typed:t,matrix:r});return t(Nc,{"number, number":Ho,"BigNumber, BigNumber":zo,"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():l(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():p(t,r,e,!1)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0)}})),"number | BigNumber, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)}}))},h,m({SS:c,DS:u,SD:s}))})),Ec="rightArithShift",Ac=Ee(Ec,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=e.concat,u=Ja({typed:t}),s=$a({typed:t,equalScalar:n}),c=bc({typed:t,equalScalar:n}),f=Qa({typed:t,DenseMatrix:a}),l=Na({typed:t,equalScalar:n}),p=Ea({typed:t}),m=Wa({typed:t,matrix:r,concat:o}),h=wc({typed:t,matrix:r});return t(Ec,{"number, number":Go,"BigNumber, BigNumber":qo,"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():l(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():p(t,r,e,!1)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0)}})),"number | BigNumber, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)}}))},h,m({SS:c,DS:u,SD:s}))})),Sc="rightLogShift",Cc=Ee(Sc,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=e.concat,u=Ja({typed:t}),s=$a({typed:t,equalScalar:n}),c=bc({typed:t,equalScalar:n}),f=Qa({typed:t,DenseMatrix:a}),l=Na({typed:t,equalScalar:n}),p=Ea({typed:t}),m=Wa({typed:t,matrix:r,concat:o}),h=wc({typed:t,matrix:r});return t(Sc,{"number, number":Vo,"SparseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():l(t,r,e,!1)}})),"DenseMatrix, number | BigNumber":t.referToSelf((function(e){return function(t,r){return n(r,0)?t.clone():p(t,r,e,!1)}})),"number | BigNumber, SparseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):f(r,t,e,!0)}})),"number | BigNumber, DenseMatrix":t.referToSelf((function(e){return function(t,r){return n(t,0)?i(r.size(),r.storage()):p(r,t,e,!0)}}))},h,m({SS:c,DS:u,SD:s}))})),Mc=Ee("and",["typed","matrix","equalScalar","zeros","not","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.zeros,a=e.not,o=e.concat,u=$a({typed:t,equalScalar:n}),s=ao({typed:t,equalScalar:n}),c=Na({typed:t,equalScalar:n}),f=Ea({typed:t}),l=Wa({typed:t,matrix:r,concat:o});return t("and",{"number, number":lu,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":t.referToSelf((function(e){return function(t,r){return e(t.value||0,r.value||0)}})),"SparseMatrix, any":t.referToSelf((function(e){return function(t,r){return a(r)?i(t.size(),t.storage()):c(t,r,e,!1)}})),"DenseMatrix, any":t.referToSelf((function(e){return function(t,r){return a(r)?i(t.size(),t.storage()):f(t,r,e,!1)}})),"any, SparseMatrix":t.referToSelf((function(e){return function(t,r){return a(t)?i(t.size(),t.storage()):c(r,t,e,!0)}})),"any, DenseMatrix":t.referToSelf((function(e){return function(t,r){return a(t)?i(t.size(),t.storage()):f(r,t,e,!0)}})),"Array, any":t.referToSelf((function(e){return function(t,n){return e(r(t),n).valueOf()}})),"any, Array":t.referToSelf((function(e){return function(t,n){return e(t,r(n)).valueOf()}}))},l({SS:s,DS:u}))})),Fc="compare",Oc=Ee(Fc,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.equalScalar,i=e.matrix,a=e.BigNumber,o=e.Fraction,u=e.DenseMatrix,s=e.concat,c=Ha({typed:t}),f=Ga({typed:t,equalScalar:n}),l=Da({typed:t,DenseMatrix:u}),p=Wa({typed:t,matrix:i,concat:s}),m=vi({typed:t});return t(Fc,Tc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return di(e,t,r.epsilon)?new a(0):new a(e.cmp(t))},"Fraction, Fraction":function(e,t){return new o(e.compare(t))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,p({SS:f,DS:c,Ss:l}))})),Tc=Ee(Fc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Fc,{"number, number":function(e,t){return ue(e,t,r.epsilon)?0:e>t?1:-1}})})),Bc=r(3228),_c="compareNatural",kc=Ee(_c,["typed","compare"],(function(e){var t=e.typed,r=e.compare,n=r.signatures["boolean,boolean"];return t(_c,{"any, any":function e(t,o){var u,s=H(t),c=H(o);if(!("number"!==s&&"BigNumber"!==s&&"Fraction"!==s||"number"!==c&&"BigNumber"!==c&&"Fraction"!==c))return"0"!==(u=r(t,o)).toString()?u>0?1:-1:Bc(s,c);var f=["Array","DenseMatrix","SparseMatrix"];if(f.includes(s)||f.includes(c))return 0!==(u=i(e,t,o))?u:Bc(s,c);if(s!==c)return Bc(s,c);if("Complex"===s)return 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}(t,o);if("Unit"===s)return t.equalBase(o)?e(t.value,o.value):a(e,t.formatUnits(),o.formatUnits());if("boolean"===s)return n(t,o);if("string"===s)return Bc(t,o);if("Object"===s)return function(e,t,r){var n=Object.keys(t),i=Object.keys(r);n.sort(Bc),i.sort(Bc);var o=a(e,n,i);if(0!==o)return o;for(var u=0;u<n.length;u++){var s=e(t[n[u]],r[i[u]]);if(0!==s)return s}return 0}(e,t,o);if("null"===s)return 0;if("undefined"===s)return 0;throw new TypeError('Unsupported type of value "'+s+'"')}});function i(e,t,r){return h(t)&&h(r)?a(e,t.toJSON().values,r.toJSON().values):h(t)?i(e,t.toArray(),r):h(r)?i(e,t,r.toArray()):m(t)?i(e,t.toJSON().data,r):m(r)?i(e,t,r.toJSON().data):Array.isArray(t)?Array.isArray(r)?a(e,t,r):i(e,t,[r]):i(e,[t],r)}function a(e,t,r){for(var n=0,i=Math.min(t.length,r.length);n<i;n++){var a=e(t[n],r[n]);if(0!==a)return a}return t.length>r.length?1:t.length<r.length?-1:0}})),Ic="compareText",Rc=["typed","matrix","concat"];tn.signature="any, any";var zc=Ee(Ic,Rc,(function(e){var t=e.typed,r=e.matrix,n=e.concat,i=Wa({typed:t,matrix:r,concat:n});return t(Ic,tn,i({elop:tn,Ds:!0}))})),qc="equal",jc=Ee(qc,["typed","matrix","equalScalar","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ko({typed:t,DenseMatrix:i}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:r,concat:a});return t(qc,Pc({typed:t,equalScalar:n}),c({elop:n,SS:u,DS:o,Ss:s}))})),Pc=Ee(qc,["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return t(qc,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})})),Lc="equalText",Uc=Ee(Lc,["typed","compareText","isZero"],(function(e){var t=e.typed,r=e.compareText,n=e.isZero;return t(Lc,{"any, any":function(e,t){return n(r(e,t))}})})),$c="smaller",Hc=Ee($c,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ko({typed:t,DenseMatrix:i}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:n,concat:a}),f=vi({typed:t});return t($c,Gc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e<t},"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!di(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1===e.compare(t)},"Complex, Complex":function(e,t){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),Gc=Ee($c,["typed","config"],(function(e){var t=e.typed,r=e.config;return t($c,{"number, number":function(e,t){return e<t&&!ue(e,t,r.epsilon)}})})),Vc="smallerEq",Zc=Ee(Vc,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ko({typed:t,DenseMatrix:i}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:n,concat:a}),f=vi({typed:t});return t(Vc,Wc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e<=t},"BigNumber, BigNumber":function(e,t){return e.lte(t)||di(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),Wc=Ee(Vc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Vc,{"number, number":function(e,t){return e<=t||ue(e,t,r.epsilon)}})})),Yc="larger",Jc=Ee(Yc,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ko({typed:t,DenseMatrix:i}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:n,concat:a}),f=vi({typed:t});return t(Yc,Xc({typed:t,config:r}),{"boolean, boolean":function(e,t){return e>t},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!di(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return 1===e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),Xc=Ee(Yc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Yc,{"number, number":function(e,t){return e>t&&!ue(e,t,r.epsilon)}})})),Qc="largerEq",Kc=Ee(Qc,["typed","config","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ko({typed:t,DenseMatrix:i}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:n,concat:a}),f=vi({typed:t});return t(Qc,ef({typed:t,config:r}),{"boolean, boolean":function(e,t){return e>=t},"BigNumber, BigNumber":function(e,t){return e.gte(t)||di(e,t,r.epsilon)},"Fraction, Fraction":function(e,t){return-1!==e.compare(t)},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:u,DS:o,Ss:s}))})),ef=Ee(Qc,["typed","config"],(function(e){var t=e.typed,r=e.config;return t(Qc,{"number, number":function(e,t){return e>=t||ue(e,t,r.epsilon)}})})),tf="deepEqual",rf=Ee(tf,["typed","equal"],(function(e){var t=e.typed,r=e.equal;return t(tf,{"any, any":function(e,t){return n(e.valueOf(),t.valueOf())}});function n(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(!n(e[a],t[a]))return!1;return!0}return!1}return!Array.isArray(t)&&r(e,t)}})),nf="unequal",af=Ee(nf,["typed","config","equalScalar","matrix","DenseMatrix","concat"],(function(e){var t=e.typed,r=(e.config,e.equalScalar),n=e.matrix,i=e.DenseMatrix,a=e.concat,o=Ha({typed:t}),u=Ko({typed:t,DenseMatrix:i}),s=Da({typed:t,DenseMatrix:i}),c=Wa({typed:t,matrix:n,concat:a});return t(nf,of({typed:t,equalScalar:r}),c({elop:function(e,t){return!r(e,t)},SS:u,DS:o,Ss:s}))})),of=Ee(nf,["typed","equalScalar"],(function(e){var t=e.typed,r=e.equalScalar;return t(nf,{"any, any":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})})),uf="partitionSelect",sf=Ee(uf,["typed","isNumeric","isNaN","compare"],(function(e){var t=e.typed,r=e.isNumeric,n=e.isNaN,i=e.compare,a=i,o=function(e,t){return-i(e,t)};return t(uf,{"Array | Matrix, number":function(e,t){return u(e,t,a)},"Array | Matrix, number, string":function(e,t,r){if("asc"===r)return u(e,t,a);if("desc"===r)return u(e,t,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":u});function u(e,t,r){if(!V(t)||t<0)throw new Error("k must be a non-negative integer");if(l(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return s(e.valueOf(),t,r)}if(Array.isArray(e))return s(e,t,r)}function s(e,t,i){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a<e.length;a++)if(r(e[a])&&n(e[a]))return e[a];for(var o=0,u=e.length-1;o<u;){for(var s=o,c=u,f=e[Math.floor(Math.random()*(u-o+1))+o];s<c;)if(i(e[s],f)>=0){var l=e[c];e[c]=e[s],e[s]=l,--c}else++s;i(e[s],f)>0&&--s,t<=s?u=s:o=s+1}return e[t]}})),cf="sort",ff=Ee(cf,["typed","matrix","compare","compareNatural"],(function(e){var t=e.typed,r=e.matrix,n=e.compare,i=e.compareNatural,a=n,o=function(e,t){return-n(e,t)};return t(cf,{Array:function(e){return s(e),e.sort(a)},Matrix:function(e){return c(e),r(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return s(e),e.sort(t)},"Matrix, function":function(e,t){return c(e),r(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return s(e),e.sort(u(t))},"Matrix, string":function(e,t){return c(e),r(e.toArray().sort(u(t)),e.storage())}});function u(e){if("asc"===e)return a;if("desc"===e)return o;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function s(e){if(1!==an(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),lf=Ee("max",["typed","config","numeric","larger"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.larger;return t("max",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Gn(e,t.valueOf(),a)},"...":function(e){if(Un(e))throw new TypeError("Scalar values expected in function max");return o(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw ks(e,"max",t)}}function o(e){var t;if($n(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw ks(t,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"==typeof t&&(t=n(t,r.number)),t}})),pf=Ee("min",["typed","config","numeric","smaller"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.smaller;return t("min",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Gn(e,t.valueOf(),a)},"...":function(e){if(Un(e))throw new TypeError("Scalar values expected in function min");return o(e)}});function a(e,t){try{return i(e,t)?e:t}catch(e){throw ks(e,"min",t)}}function o(e){var t;if($n(e,(function(e){try{isNaN(e)&&"number"==typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(t){throw ks(t,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"==typeof t&&(t=n(t,r.number)),t}})),mf=Ee("ImmutableDenseMatrix",["smaller","DenseMatrix"],(function(e){var t=e.smaller,r=e.DenseMatrix;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(l(e)||f(e)){var i=new r(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+H(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return n.prototype=new r,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(e){switch(arguments.length){case 1:var t=r.prototype.subset.call(this,e);return l(t)?new n({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:he(this._data),size:he(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(r){(null===e||t(r,e))&&(e=r)})),this._min=null!==e?e:void 0}return this._min},n.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(r){(null===e||t(e,r))&&(e=r)})),this._max=null!==e?e:void 0}return this._max},n}),{isClass:!0}),hf=Ee("Index",["ImmutableDenseMatrix","getMatrixDataType"],(function(e){var t=e.ImmutableDenseMatrix,r=e.getMatrixDataType;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var t=0,a=arguments.length;t<a;t++){var o=arguments[t],u=f(o),s=l(o),c=null;if(d(o))this._dimensions.push(o),this._isScalar=!1;else if(u||s){var p=void 0;"boolean"===r(o)?(u&&(p=i(df(o).valueOf())),s&&(p=i(df(o._data).valueOf())),c=o.valueOf().length):p=i(o.valueOf()),this._dimensions.push(p);var m=p.size();1===m.length&&1===m[0]&&null===c||(this._isScalar=!1)}else if("number"==typeof o)this._dimensions.push(i([o]));else{if("string"!=typeof o)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(o)}this._sourceSize.push(c)}}function i(e){for(var r=0,n=e.length;r<n;r++)if("number"!=typeof e[r]||!V(e[r]))throw new TypeError("Index parameters must be positive integer numbers");return new t(e)}return n.prototype.type="Index",n.prototype.isIndex=!0,n.prototype.clone=function(){var e=new n;return e._dimensions=he(this._dimensions),e._isScalar=this._isScalar,e._sourceSize=this._sourceSize,e},n.create=function(e){var t=new n;return n.apply(t,e),t},n.prototype.size=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?1:n.size()[0]}return e},n.prototype.max=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.max()}return e},n.prototype.min=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e[t]="string"==typeof n?n:n.min()}return e},n.prototype.forEach=function(e){for(var t=0,r=this._dimensions.length;t<r;t++)e(this._dimensions[t],t,this)},n.prototype.dimension=function(e){return this._dimensions[e]||null},n.prototype.isObjectProperty=function(){return 1===this._dimensions.length&&"string"==typeof this._dimensions[0]},n.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},n.prototype.isScalar=function(){return this._isScalar},n.prototype.toArray=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];e.push("string"==typeof n?n:n.toArray())}return e},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var e=[],t=0,r=this._dimensions.length;t<r;t++){var n=this._dimensions[t];"string"==typeof n?e.push(JSON.stringify(n)):e.push(n.toString())}return"["+e.join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},n.fromJSON=function(e){return n.create(e.dimensions)},n}),{isClass:!0});function df(e){var t=[];return e.forEach((function(e,r){e&&t.push(r)})),t}var vf=Ee("FibonacciHeap",["smaller","larger"],(function(e){var t=e.smaller,r=e.larger,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}function o(e,t){var r=t.parent;r&&(t.mark?(a(e,t,r),o(r)):t.mark=!0)}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,r){var n={key:e,value:r,degree:0};if(this._minimum){var i=this._minimum;n.left=i,n.right=i.right,i.right=n,n.right.left=n,t(e,i.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var i=this._minimum,a=e.degree,o=e.child;a>0;){var s=o.right;o.left.right=o.right,o.right.left=o.left,o.left=i,o.right=i.right,i.right=o,o.right.left=o,o.parent=null,o=s,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,o=Math.floor(Math.log(i)*n)+1,s=new Array(o),c=0,f=e;if(f)for(c++,f=f.right;f!==e;)c++,f=f.right;for(;c>0;){for(var l=f.degree,p=f.right;a=s[l];){if(r(f.key,a.key)){var m=a;a=f,f=m}u(a,f),s[l]=null,l++}s[l]=f,f=p,c--}e=null;for(var h=0;h<o;h++)(a=s[h])&&(e?(a.left.right=a.right,a.right.left=a.left,a.left=e,a.right=e.right,e.right=a,a.right.left=a,t(a.key,e.key)&&(e=a)):e=a);return e}(i=e.right,this._size),this._size--,this._minimum=i,e},i.prototype.remove=function(e){this._minimum=function(e,r,n){r.key=-1;var i=r.parent;return i&&t(r.key,i.key)&&(a(e,r,i),o(e,i)),t(r.key,e.key)&&(e=r),e}(this._minimum,e),this.extractMinimum()};var u=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};return i}),{isClass:!0}),yf=Ee("Spa",["addScalar","equalScalar","FibonacciHeap"],(function(e){var t=e.addScalar,r=e.equalScalar,n=e.FibonacciHeap;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}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 r=this._heap.insert(e,t);this._values[e]=r}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,r){var n=this._values[e];n?n.value=t(n.value,r):(n=this._heap.insert(e,r),this._values[e]=n)},i.prototype.forEach=function(e,t,n){var i=this._heap,a=this._values,o=[],u=i.extractMinimum();for(u&&o.push(u);u&&u.key<=t;)u.key>=e&&(r(u.value,0)||n(u.key,u.value,this)),(u=i.extractMinimum())&&o.push(u);for(var s=0;s<o.length;s++){var c=o[s];a[(u=i.insert(c.key,c.value)).key]=u}},i.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){var i=r.value;r.value=n.value,n.value=i}},i}),{isClass:!0}),gf=(r(372),In((function(e){return new e(1).exp()}),{hasher:Nf})),xf=In((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),{hasher:Nf}),bf=In((function(e){return e.acos(-1)}),{hasher:Nf}),wf=In((function(e){return bf(e).times(2)}),{hasher:Nf});function Nf(e){return e[0].precision}function Df(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ef(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Df(Object(r),!0).forEach((function(t){Ua(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Df(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Af=Ee("Unit",["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],(function(e){var r,n,i,a=e.on,u=e.config,c=e.addScalar,f=e.subtractScalar,l=e.multiplyScalar,p=e.divideScalar,m=e.pow,h=e.abs,d=e.fix,v=e.round,y=e.equal,g=e.isNumeric,x=e.format,b=e.number,w=e.Complex,N=e.BigNumber,D=e.Fraction,E=b;function A(e,t){if(!(this instanceof A))throw new Error("Constructor must be called with the new operator");if(null!=e&&!g(e)&&!o(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=R.map((function(e){return 0}));else if("string"==typeof t){var r=A.parse(t);this.units=r.units,this.dimensions=r.dimensions}else{if(!s(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map((function(e){return $r({},e)}))}this.value=this._normalize(e)}function S(){for(;" "===i||"\t"===i;)M()}function C(e){return e>="0"&&e<="9"}function M(){n++,i=r.charAt(n)}function F(e){n=e,i=r.charAt(n)}function O(){var e="",t=n;if("+"===i?M():"-"===i&&(e+=i,M()),!function(e){return e>="0"&&e<="9"||"."===e}(i))return F(t),null;if("."===i){if(e+=i,M(),!C(i))return F(t),null}else{for(;C(i);)e+=i,M();"."===i&&(e+=i,M())}for(;C(i);)e+=i,M();if("E"===i||"e"===i){var r="",a=n;if(r+=i,M(),"+"!==i&&"-"!==i||(r+=i,M()),!C(i))return F(a),e;for(e+=r;C(i);)e+=i,M()}return e}function T(){for(var e="";C(i)||A.isValidAlpha(i);)e+=i,M();var t=e.charAt(0);return A.isValidAlpha(t)?e:null}function B(e){return i===e?(M(),e):null}Object.defineProperty(A,"name",{value:"Unit"}),A.prototype.constructor=A,A.prototype.type="Unit",A.prototype.isUnit=!0,A.parse=function(e,t){if(t=t||{},n=-1,i="","string"!=typeof(r=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new A;a.units=[];var o=1,s=!1;M(),S();var c=O(),f=null;if(c){if("BigNumber"===u.number)f=new N(c);else if("Fraction"===u.number)try{f=new D(c)}catch(e){f=parseFloat(c)}else f=parseFloat(c);S(),B("*")?(o=1,s=!0):B("/")&&(o=-1,s=!0)}for(var l=[],p=1;;){for(S();"("===i;)l.push(o),p*=o,o=1,M(),S();var m;if(!i)break;var h=i;if(null===(m=T()))throw new SyntaxError('Unexpected "'+h+'" in "'+r+'" at index '+n.toString());var d=_(m);if(null===d)throw new SyntaxError('Unit "'+m+'" not found.');var v=o*p;if(S(),B("^")){S();var y=O();if(null===y)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');v*=y}a.units.push({unit:d.unit,prefix:d.prefix,power:v});for(var g=0;g<R.length;g++)a.dimensions[g]+=(d.unit.dimensions[g]||0)*v;for(S();")"===i;){if(0===l.length)throw new SyntaxError('Unmatched ")" in "'+r+'" at index '+n.toString());p/=l.pop(),M(),S()}if(s=!1,B("*")?(o=1,s=!0):B("/")?(o=-1,s=!0):o=1,d.unit.base){var x=d.unit.base.key;$.auto[x]={unit:d.unit,prefix:d.prefix}}}if(S(),i)throw new SyntaxError('Could not parse: "'+e+'"');if(s)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==l.length)throw new SyntaxError('Unmatched "(" in "'+r+'"');if(0===a.units.length&&!t.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return a.value=void 0!==f?a._normalize(f):null,a},A.prototype.clone=function(){var e=new A;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=he(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])Ne(this.units[t],r)&&(e.units[t][r]=this.units[t][r]);return e},A.prototype.valueType=function(){return H(this.value)},A.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},A.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,r=A._getNumberConverter(H(e)),n=0;n<this.units.length;n++){var i=r(this.units[n].unit.value),a=r(this.units[n].prefix.value),o=r(this.units[n].power);t=l(t,m(l(i,a),o))}return t},A.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var r=e,n=A._getNumberConverter(H(e)),i=0;i<this.units.length;i++){var a=n(this.units[i].unit.value),o=n(this.units[i].prefix.value),u=n(this.units[i].power);r=p(r,m(l(a,o),u))}return r};var _=In((function(e){if(Ne(P,e)){var t=P[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in P)if(Ne(P,r)&&Yr(e,r)){var n=P[r],i=e.length-r.length,a=e.substring(0,i),o=Ne(n.prefixes,a)?n.prefixes[a]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null}),{hasher:function(e){return e[0]},limit:100});function k(e){return e.equalBase(z.NONE)&&null!==e.value&&!u.predictable?e.value:e}A.isValuelessUnit=function(e){return null!==_(e)},A.prototype.hasBase=function(e){if("string"==typeof e&&(e=z[e]),!e)return!1;for(var t=0;t<R.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},A.prototype.equalBase=function(e){for(var t=0;t<R.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},A.prototype.equals=function(e){return this.equalBase(e)&&y(this.value,e.value)},A.prototype.multiply=function(e){for(var t=this.clone(),r=s(e)?e:new A(e),n=0;n<R.length;n++)t.dimensions[n]=(this.dimensions[n]||0)+(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=Ef({},r.units[i]);t.units.push(a)}if(null!==this.value||null!==r.value){var o=null===this.value?this._normalize(1):this.value,u=null===r.value?r._normalize(1):r.value;t.value=l(o,u)}else t.value=null;return s(e)&&(t.skipAutomaticSimplification=!1),k(t)},A.prototype.divideInto=function(e){return new A(e).divide(this)},A.prototype.divide=function(e){for(var t=this.clone(),r=s(e)?e:new A(e),n=0;n<R.length;n++)t.dimensions[n]=(this.dimensions[n]||0)-(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=Ef(Ef({},r.units[i]),{},{power:-r.units[i].power});t.units.push(a)}if(null!==this.value||null!==r.value){var o=null===this.value?this._normalize(1):this.value,u=null===r.value?r._normalize(1):r.value;t.value=p(o,u)}else t.value=null;return s(e)&&(t.skipAutomaticSimplification=!1),k(t)},A.prototype.pow=function(e){for(var t=this.clone(),r=0;r<R.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=m(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,k(t)},A.prototype.abs=function(){var e=this.clone();if(null!==e.value)if(e._isDerived()||0===e.units[0].unit.offset)e.value=h(e.value);else{var t=e._numberConverter(),r=t(e.units[0].unit.value),n=t(e.units[0].unit.offset),i=l(r,n);e.value=f(h(c(e.value,i)),i)}for(var a in e.units)"VA"!==e.units[a].unit.name&&"VAR"!==e.units[a].unit.name||(e.units[a].unit=P.W);return e},A.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=A.parse(e);else{if(!s(e))throw new Error("String or Unit expected as parameter");t=e.clone()}if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");if(null===this.value||this._isDerived()||this.units[0].unit.offset===t.units[0].unit.offset)t.value=he(r);else{var n=A._getNumberConverter(H(r)),i=this.units[0].unit.value,a=this.units[0].unit.offset,o=l(i,a),u=t.units[0].unit.value,p=t.units[0].unit.offset,m=l(u,p);t.value=c(r,n(f(o,m)))}return t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},A.prototype.toNumber=function(e){return E(this.toNumeric(e))},A.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()||0===t.units.length?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},A.prototype.toString=function(){return this.format()},A.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},A.fromJSON=function(e){var t=new A(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},A.prototype.valueOf=A.prototype.toString,A.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var i in G)if(Ne(G,i)&&r.hasBase(z[i])){e=i;break}if("NONE"===e)r.units=[];else if(e&&Ne(G,e)&&(t=G[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,o=0;o<R.length;o++){var u=R[o];Math.abs(r.dimensions[o]||0)>1e-12&&(Ne(G,u)?n.push({unit:G[u].unit,prefix:G[u].prefix,power:r.dimensions[o]||0}):a=!0)}n.length<r.units.length&&!a&&(r.units=n)}return r},A.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<R.length;r++){var n=R[r];if(Math.abs(e.dimensions[r]||0)>1e-12){if(!Ne($.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:$.si[n].unit,prefix:$.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},A.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)this.units[i].power>0?(r++,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&&n++;if(n>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(r>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),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");var o=e;return r>0&&n>0&&(o+=" / "),o+t},A.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),r=!1;for(var n in void 0!==t.value&&null!==t.value&&o(t.value)&&(r=Math.abs(t.value.re)<1e-14),t.units)Ne(t.units,n)&&t.units[n].unit&&("VA"===t.units[n].unit.name&&r?t.units[n].unit=P.VAR:"VAR"!==t.units[n].unit.name||r||(t.units[n].unit=P.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var i=t._denormalize(t.value),a=null!==t.value?x(i,e||{}):"",u=t.formatUnits();return t.value&&o(t.value)&&(a="("+a+")"),u.length>0&&a.length>0&&(a+=" "),a+u},A.prototype._bestPrefix=function(){if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var e=null!==this.value?h(this.value):0,t=h(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power,i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return r;i=Math.abs(i);var a=this.units[0].unit.prefixes;for(var o in a)if(Ne(a,o)){var u=a[o];if(u.scientific){var s=Math.abs(Math.log(e/Math.pow(u.value*t,n))/Math.LN10-1.2);(s<i||s===i&&u.name.length<r.name.length)&&(r=u,i=s)}}return r},A.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),a=v(i),o=new A(y(a,i)?a:d(t.toNumeric()),e[n].toString());r.push(o),t=f(t,o)}for(var u=0,s=0;s<r.length;s++)u=c(u,r[s].value);return y(u,this.value)&&(t.value=0),r.push(t),r};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:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,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}},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:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,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}},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:1e12,scientific:!0},G:{name:"G",value:1e18,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},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}},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:1e18,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},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}},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:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,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:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(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:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,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:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};I.SHORTLONG=$r({},I.SHORT,I.LONG),I.BINARY_SHORT=$r({},I.BINARY_SHORT_SI,I.BINARY_SHORT_IEC),I.BINARY_LONG=$r({},I.BINARY_LONG_SI,I.BINARY_LONG_IEC);var R=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],z={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 q in z)Ne(z,q)&&(z[q].key=q);var j={name:"",base:{},value:1,offset:0,dimensions:R.map((function(e){return 0}))},P={meter:{name:"meter",base:z.LENGTH,prefixes:I.LONG,value:1,offset:0},inch:{name:"inch",base:z.LENGTH,prefixes:I.NONE,value:.0254,offset:0},foot:{name:"foot",base:z.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yard:{name:"yard",base:z.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mile:{name:"mile",base:z.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},link:{name:"link",base:z.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rod:{name:"rod",base:z.LENGTH,prefixes:I.NONE,value:5.0292,offset:0},chain:{name:"chain",base:z.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:z.LENGTH,prefixes:I.NONE,value:1e-10,offset:0},m:{name:"m",base:z.LENGTH,prefixes:I.SHORT,value:1,offset:0},in:{name:"in",base:z.LENGTH,prefixes:I.NONE,value:.0254,offset:0},ft:{name:"ft",base:z.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yd:{name:"yd",base:z.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mi:{name:"mi",base:z.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},li:{name:"li",base:z.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rd:{name:"rd",base:z.LENGTH,prefixes:I.NONE,value:5.02921,offset:0},ch:{name:"ch",base:z.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},mil:{name:"mil",base:z.LENGTH,prefixes:I.NONE,value:254e-7,offset:0},m2:{name:"m2",base:z.SURFACE,prefixes:I.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:z.SURFACE,prefixes:I.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:z.SURFACE,prefixes:I.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:z.SURFACE,prefixes:I.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:z.SURFACE,prefixes:I.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:z.SURFACE,prefixes:I.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:z.SURFACE,prefixes:I.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:z.SURFACE,prefixes:I.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:z.SURFACE,prefixes:I.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:z.SURFACE,prefixes:I.NONE,value:1e4,offset:0},m3:{name:"m3",base:z.VOLUME,prefixes:I.CUBIC,value:1,offset:0},L:{name:"L",base:z.VOLUME,prefixes:I.SHORT,value:.001,offset:0},l:{name:"l",base:z.VOLUME,prefixes:I.SHORT,value:.001,offset:0},litre:{name:"litre",base:z.VOLUME,prefixes:I.LONG,value:.001,offset:0},cuin:{name:"cuin",base:z.VOLUME,prefixes:I.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:z.VOLUME,prefixes:I.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:z.VOLUME,prefixes:I.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:z.VOLUME,prefixes:I.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:z.VOLUME,prefixes:I.NONE,value:15e-6,offset:0},drop:{name:"drop",base:z.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:z.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},minim:{name:"minim",base:z.VOLUME,prefixes:I.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:z.VOLUME,prefixes:I.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:z.VOLUME,prefixes:I.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:z.VOLUME,prefixes:I.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:z.VOLUME,prefixes:I.NONE,value:1e-6,offset:0},cup:{name:"cup",base:z.VOLUME,prefixes:I.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:z.VOLUME,prefixes:I.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:z.VOLUME,prefixes:I.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:z.VOLUME,prefixes:I.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:z.VOLUME,prefixes:I.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:z.VOLUME,prefixes:I.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:z.VOLUME,prefixes:I.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:z.VOLUME,prefixes:I.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:z.VOLUME,prefixes:I.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:z.VOLUME,prefixes:I.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:z.VOLUME,prefixes:I.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:z.VOLUME,prefixes:I.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:z.VOLUME,prefixes:I.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:z.VOLUME,prefixes:I.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:z.VOLUME,prefixes:I.NONE,value:.1173478,offset:0},obl:{name:"obl",base:z.VOLUME,prefixes:I.NONE,value:.1589873,offset:0},g:{name:"g",base:z.MASS,prefixes:I.SHORT,value:.001,offset:0},gram:{name:"gram",base:z.MASS,prefixes:I.LONG,value:.001,offset:0},ton:{name:"ton",base:z.MASS,prefixes:I.SHORT,value:907.18474,offset:0},t:{name:"t",base:z.MASS,prefixes:I.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:z.MASS,prefixes:I.LONG,value:1e3,offset:0},grain:{name:"grain",base:z.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:z.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:z.MASS,prefixes:I.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:z.MASS,prefixes:I.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:z.MASS,prefixes:I.NONE,value:45.359237,offset:0},stick:{name:"stick",base:z.MASS,prefixes:I.NONE,value:.115,offset:0},stone:{name:"stone",base:z.MASS,prefixes:I.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:z.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:z.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:z.MASS,prefixes:I.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:z.MASS,prefixes:I.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:z.MASS,prefixes:I.NONE,value:45.359237,offset:0},s:{name:"s",base:z.TIME,prefixes:I.SHORT,value:1,offset:0},min:{name:"min",base:z.TIME,prefixes:I.NONE,value:60,offset:0},h:{name:"h",base:z.TIME,prefixes:I.NONE,value:3600,offset:0},second:{name:"second",base:z.TIME,prefixes:I.LONG,value:1,offset:0},sec:{name:"sec",base:z.TIME,prefixes:I.LONG,value:1,offset:0},minute:{name:"minute",base:z.TIME,prefixes:I.NONE,value:60,offset:0},hour:{name:"hour",base:z.TIME,prefixes:I.NONE,value:3600,offset:0},day:{name:"day",base:z.TIME,prefixes:I.NONE,value:86400,offset:0},week:{name:"week",base:z.TIME,prefixes:I.NONE,value:604800,offset:0},month:{name:"month",base:z.TIME,prefixes:I.NONE,value:2629800,offset:0},year:{name:"year",base:z.TIME,prefixes:I.NONE,value:31557600,offset:0},decade:{name:"decade",base:z.TIME,prefixes:I.NONE,value:315576e3,offset:0},century:{name:"century",base:z.TIME,prefixes:I.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:z.TIME,prefixes:I.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:z.FREQUENCY,prefixes:I.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:z.FREQUENCY,prefixes:I.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:z.ANGLE,prefixes:I.SHORT,value:1,offset:0},radian:{name:"radian",base:z.ANGLE,prefixes:I.LONG,value:1,offset:0},deg:{name:"deg",base:z.ANGLE,prefixes:I.SHORT,value:null,offset:0},degree:{name:"degree",base:z.ANGLE,prefixes:I.LONG,value:null,offset:0},grad:{name:"grad",base:z.ANGLE,prefixes:I.SHORT,value:null,offset:0},gradian:{name:"gradian",base:z.ANGLE,prefixes:I.LONG,value:null,offset:0},cycle:{name:"cycle",base:z.ANGLE,prefixes:I.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:z.ANGLE,prefixes:I.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:z.ANGLE,prefixes:I.NONE,value:null,offset:0},A:{name:"A",base:z.CURRENT,prefixes:I.SHORT,value:1,offset:0},ampere:{name:"ampere",base:z.CURRENT,prefixes:I.LONG,value:1,offset:0},K:{name:"K",base:z.TEMPERATURE,prefixes:I.SHORT,value:1,offset:0},degC:{name:"degC",base:z.TEMPERATURE,prefixes:I.SHORT,value:1,offset:273.15},degF:{name:"degF",base:z.TEMPERATURE,prefixes:I.SHORT,value:new D(5,9),offset:459.67},degR:{name:"degR",base:z.TEMPERATURE,prefixes:I.SHORT,value:new D(5,9),offset:0},kelvin:{name:"kelvin",base:z.TEMPERATURE,prefixes:I.LONG,value:1,offset:0},celsius:{name:"celsius",base:z.TEMPERATURE,prefixes:I.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:z.TEMPERATURE,prefixes:I.LONG,value:new D(5,9),offset:459.67},rankine:{name:"rankine",base:z.TEMPERATURE,prefixes:I.LONG,value:new D(5,9),offset:0},mol:{name:"mol",base:z.AMOUNT_OF_SUBSTANCE,prefixes:I.SHORT,value:1,offset:0},mole:{name:"mole",base:z.AMOUNT_OF_SUBSTANCE,prefixes:I.LONG,value:1,offset:0},cd:{name:"cd",base:z.LUMINOUS_INTENSITY,prefixes:I.SHORT,value:1,offset:0},candela:{name:"candela",base:z.LUMINOUS_INTENSITY,prefixes:I.LONG,value:1,offset:0},N:{name:"N",base:z.FORCE,prefixes:I.SHORT,value:1,offset:0},newton:{name:"newton",base:z.FORCE,prefixes:I.LONG,value:1,offset:0},dyn:{name:"dyn",base:z.FORCE,prefixes:I.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:z.FORCE,prefixes:I.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:z.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:z.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:z.FORCE,prefixes:I.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:z.FORCE,prefixes:I.NONE,value:9.80665,offset:0},J:{name:"J",base:z.ENERGY,prefixes:I.SHORT,value:1,offset:0},joule:{name:"joule",base:z.ENERGY,prefixes:I.LONG,value:1,offset:0},erg:{name:"erg",base:z.ENERGY,prefixes:I.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:z.ENERGY,prefixes:I.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:z.ENERGY,prefixes:I.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:z.ENERGY,prefixes:I.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:z.ENERGY,prefixes:I.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:z.POWER,prefixes:I.SHORT,value:1,offset:0},watt:{name:"watt",base:z.POWER,prefixes:I.LONG,value:1,offset:0},hp:{name:"hp",base:z.POWER,prefixes:I.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:z.POWER,prefixes:I.SHORT,value:w.I,offset:0},VA:{name:"VA",base:z.POWER,prefixes:I.SHORT,value:1,offset:0},Pa:{name:"Pa",base:z.PRESSURE,prefixes:I.SHORT,value:1,offset:0},psi:{name:"psi",base:z.PRESSURE,prefixes:I.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:z.PRESSURE,prefixes:I.NONE,value:101325,offset:0},bar:{name:"bar",base:z.PRESSURE,prefixes:I.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:z.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:z.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:z.PRESSURE,prefixes:I.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:z.PRESSURE,prefixes:I.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:z.ELECTRIC_CHARGE,prefixes:I.LONG,value:1,offset:0},C:{name:"C",base:z.ELECTRIC_CHARGE,prefixes:I.SHORT,value:1,offset:0},farad:{name:"farad",base:z.ELECTRIC_CAPACITANCE,prefixes:I.LONG,value:1,offset:0},F:{name:"F",base:z.ELECTRIC_CAPACITANCE,prefixes:I.SHORT,value:1,offset:0},volt:{name:"volt",base:z.ELECTRIC_POTENTIAL,prefixes:I.LONG,value:1,offset:0},V:{name:"V",base:z.ELECTRIC_POTENTIAL,prefixes:I.SHORT,value:1,offset:0},ohm:{name:"ohm",base:z.ELECTRIC_RESISTANCE,prefixes:I.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:z.ELECTRIC_INDUCTANCE,prefixes:I.LONG,value:1,offset:0},H:{name:"H",base:z.ELECTRIC_INDUCTANCE,prefixes:I.SHORT,value:1,offset:0},siemens:{name:"siemens",base:z.ELECTRIC_CONDUCTANCE,prefixes:I.LONG,value:1,offset:0},S:{name:"S",base:z.ELECTRIC_CONDUCTANCE,prefixes:I.SHORT,value:1,offset:0},weber:{name:"weber",base:z.MAGNETIC_FLUX,prefixes:I.LONG,value:1,offset:0},Wb:{name:"Wb",base:z.MAGNETIC_FLUX,prefixes:I.SHORT,value:1,offset:0},tesla:{name:"tesla",base:z.MAGNETIC_FLUX_DENSITY,prefixes:I.LONG,value:1,offset:0},T:{name:"T",base:z.MAGNETIC_FLUX_DENSITY,prefixes:I.SHORT,value:1,offset:0},b:{name:"b",base:z.BIT,prefixes:I.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:z.BIT,prefixes:I.BINARY_LONG,value:1,offset:0},B:{name:"B",base:z.BIT,prefixes:I.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:z.BIT,prefixes:I.BINARY_LONG,value:8,offset:0}},L={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",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",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 U(e){if("BigNumber"===e.number){var t=bf(N);P.rad.value=new N(1),P.deg.value=t.div(180),P.grad.value=t.div(200),P.cycle.value=t.times(2),P.arcsec.value=t.div(648e3),P.arcmin.value=t.div(10800)}else P.rad.value=1,P.deg.value=Math.PI/180,P.grad.value=Math.PI/200,P.cycle.value=2*Math.PI,P.arcsec.value=Math.PI/648e3,P.arcmin.value=Math.PI/10800;P.radian.value=P.rad.value,P.degree.value=P.deg.value,P.gradian.value=P.grad.value}U(u),a&&a("config",(function(e,t){e.number!==t.number&&U(e)}));var $={si:{NONE:{unit:j,prefix:I.NONE[""]},LENGTH:{unit:P.m,prefix:I.SHORT[""]},MASS:{unit:P.g,prefix:I.SHORT.k},TIME:{unit:P.s,prefix:I.SHORT[""]},CURRENT:{unit:P.A,prefix:I.SHORT[""]},TEMPERATURE:{unit:P.K,prefix:I.SHORT[""]},LUMINOUS_INTENSITY:{unit:P.cd,prefix:I.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:P.mol,prefix:I.SHORT[""]},ANGLE:{unit:P.rad,prefix:I.SHORT[""]},BIT:{unit:P.bits,prefix:I.SHORT[""]},FORCE:{unit:P.N,prefix:I.SHORT[""]},ENERGY:{unit:P.J,prefix:I.SHORT[""]},POWER:{unit:P.W,prefix:I.SHORT[""]},PRESSURE:{unit:P.Pa,prefix:I.SHORT[""]},ELECTRIC_CHARGE:{unit:P.C,prefix:I.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:P.F,prefix:I.SHORT[""]},ELECTRIC_POTENTIAL:{unit:P.V,prefix:I.SHORT[""]},ELECTRIC_RESISTANCE:{unit:P.ohm,prefix:I.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:P.H,prefix:I.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:P.S,prefix:I.SHORT[""]},MAGNETIC_FLUX:{unit:P.Wb,prefix:I.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:P.T,prefix:I.SHORT[""]},FREQUENCY:{unit:P.Hz,prefix:I.SHORT[""]}}};$.cgs=JSON.parse(JSON.stringify($.si)),$.cgs.LENGTH={unit:P.m,prefix:I.SHORT.c},$.cgs.MASS={unit:P.g,prefix:I.SHORT[""]},$.cgs.FORCE={unit:P.dyn,prefix:I.SHORT[""]},$.cgs.ENERGY={unit:P.erg,prefix:I.NONE[""]},$.us=JSON.parse(JSON.stringify($.si)),$.us.LENGTH={unit:P.ft,prefix:I.NONE[""]},$.us.MASS={unit:P.lbm,prefix:I.NONE[""]},$.us.TEMPERATURE={unit:P.degF,prefix:I.NONE[""]},$.us.FORCE={unit:P.lbf,prefix:I.NONE[""]},$.us.ENERGY={unit:P.BTU,prefix:I.BTU[""]},$.us.POWER={unit:P.hp,prefix:I.NONE[""]},$.us.PRESSURE={unit:P.psi,prefix:I.NONE[""]},$.auto=JSON.parse(JSON.stringify($.si));var G=$.auto;for(var V in A.setUnitSystem=function(e){if(!Ne($,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys($).join(", "));G=$[e]},A.getUnitSystem=function(){for(var e in $)if(Ne($,e)&&$[e]===G)return e},A.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new N(e.n).div(e.d).times(e.s):new N(e+"")},Fraction:function(e){return new D(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?b(e):e}},A.prototype._numberConverter=function(){var e=A.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},A._getNumberConverter=function(e){if(!A.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return A.typeConverters[e]},P)if(Ne(P,V)){var Z=P[V];Z.dimensions=Z.base.dimensions}for(var W in L)if(Ne(L,W)){var Y=P[L[W]],J={};for(var X in Y)Ne(Y,X)&&(J[X]=Y[X]);J.name=W,P[W]=J}return A.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},A.createUnit=function(e,r){if("object"!==t(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(r&&r.override)for(var n in e)if(Ne(e,n)&&A.deleteUnit(n),e[n].aliases)for(var i=0;i<e[n].aliases.length;i++)A.deleteUnit(e[n].aliases[i]);var a;for(var o in e)Ne(e,o)&&(a=A.createUnitSingle(o,e[o]));return a},A.createUnitSingle=function(e,r){if(null==r&&(r={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Ne(P,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){if(i=e.charAt(t),0===t&&!A.isValidAlpha(i))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!A.isValidAlpha(i)&&!C(i))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var n,a,o,u=null,s=[],c=0;if(r&&"Unit"===r.type)u=r.clone();else if("string"==typeof r)""!==r&&(n=r);else{if("object"!==t(r))throw new TypeError('Cannot create unit "'+e+'" from "'+r.toString()+'": expecting "string" or "Unit" or "Object"');n=r.definition,a=r.prefixes,c=r.offset,o=r.baseName,r.aliases&&(s=r.aliases.valueOf())}if(s)for(var f=0;f<s.length;f++)if(Ne(P,s[f]))throw new Error('Cannot create alias "'+s[f]+'": a unit with that name already exists');if(n&&"string"==typeof n&&!u)try{u=A.parse(n,{allowNoUnits:!0})}catch(t){throw t.message='Could not create unit "'+e+'" from "'+n+'": '+t.message,t}else n&&"Unit"===n.type&&(u=n.clone());s=s||[],c=c||0,a=a&&a.toUpperCase&&I[a.toUpperCase()]||I.NONE;var l={};if(u){l={name:e,value:u.value,dimensions:u.dimensions.slice(0),prefixes:a,offset:c};var p=!1;for(var m in z)if(Ne(z,m)){for(var h=!0,d=0;d<R.length;d++)if(Math.abs((l.dimensions[d]||0)-(z[m].dimensions[d]||0))>1e-12){h=!1;break}if(h){p=!0,l.base=z[m];break}}if(!p){o=o||e+"_STUFF";var v={dimensions:u.dimensions.slice(0)};v.key=o,z[o]=v,G[o]={unit:l,prefix:I.NONE[""]},l.base=z[o]}}else{if(o=o||e+"_STUFF",R.indexOf(o)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var y in R.push(o),z)Ne(z,y)&&(z[y].dimensions[R.length-1]=0);for(var g={dimensions:[]},x=0;x<R.length;x++)g.dimensions[x]=0;g.dimensions[R.length-1]=1,g.key=o,z[o]=g,l={name:e,value:1,dimensions:z[o].dimensions.slice(0),prefixes:a,offset:c,base:z[o]},G[o]={unit:l,prefix:I.NONE[""]}}A.UNITS[e]=l;for(var b=0;b<s.length;b++){var w=s[b],N={};for(var D in l)Ne(l,D)&&(N[D]=l[D]);N.name=w,A.UNITS[w]=N}return delete _.cache,new A(null,e)},A.deleteUnit=function(e){delete A.UNITS[e]},A.PREFIXES=I,A.BASE_DIMENSIONS=R,A.BASE_UNITS=z,A.UNIT_SYSTEMS=$,A.UNITS=P,A}),{isClass:!0}),Sf="unit",Cf=Ee(Sf,["typed","Unit"],(function(e){var t=e.typed,r=e.Unit;return t(Sf,{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,t){return new r(e,t)},"number | BigNumber | Fraction":function(e){return new r(e)},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Mf="sparse",Ff=Ee(Mf,["typed","SparseMatrix"],(function(e){var t=e.typed,r=e.SparseMatrix;return t(Mf,{"":function(){return new r([])},string:function(e){return new r([],e)},"Array | Matrix":function(e){return new r(e)},"Array | Matrix, string":function(e,t){return new r(e,t)}})})),Of="createUnit",Tf=Ee(Of,["typed","Unit"],(function(e){var t=e.typed,r=e.Unit;return t(Of,{"Object, Object":function(e,t){return r.createUnit(e,t)},Object:function(e){return r.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,n){var i={};return i[e]=t,r.createUnit(i,n)},"string, Unit | string | Object":function(e,t){var n={};return n[e]=t,r.createUnit(n,{})},string:function(e){var t={};return t[e]={},r.createUnit(t,{})}})})),Bf="acos",_f=Ee(Bf,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(Bf,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})})),kf="number";function If(e){return se(e)}function Rf(e){return Math.atan(1/e)}function zf(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function qf(e){return Math.asin(1/e)}function jf(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function Pf(e){return Math.acos(1/e)}function Lf(e){var t=1/e,r=Math.sqrt(t*t-1);return Math.log(r+t)}function Uf(e){return ce(e)}function $f(e){return fe(e)}function Hf(e){return 1/Math.tan(e)}function Gf(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function Vf(e){return 1/Math.sin(e)}function Zf(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Z(e)}function Wf(e){return 1/Math.cos(e)}function Yf(e){return 2/(Math.exp(e)+Math.exp(-e))}function Jf(e){return pe(e)}If.signature=kf,Rf.signature=kf,zf.signature=kf,qf.signature=kf,jf.signature=kf,Pf.signature=kf,Lf.signature=kf,Uf.signature=kf,$f.signature=kf,Hf.signature=kf,Gf.signature=kf,Vf.signature=kf,Zf.signature=kf,Wf.signature=kf,Yf.signature=kf,Jf.signature=kf;var Xf="acosh",Qf=Ee(Xf,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(Xf,{number:function(e){return e>=1||r.predictable?If(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})})),Kf="acot",el=Ee(Kf,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(Kf,{number:Rf,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})})),tl="acoth",rl=Ee(tl,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(tl,{number:function(e){return e>=1||e<=-1||r.predictable?zf(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})})),nl="acsc",il=Ee(nl,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(nl,{number:function(e){return e<=-1||e>=1||r.predictable?qf(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})})),al="acsch",ol=Ee(al,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(al,{number:jf,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})})),ul="asec",sl=Ee(ul,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(ul,{number:function(e){return e<=-1||e>=1||r.predictable?Pf(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})})),cl="asech",fl=Ee(cl,["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,r=e.config,n=e.Complex,i=e.BigNumber;return t(cl,{number:function(e){if(e<=1&&e>=-1||r.predictable){var t=1/e;if(t>0||r.predictable)return Lf(e);var i=Math.sqrt(t*t-1);return new n(Math.log(i-t),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})})),ll="asin",pl=Ee(ll,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(ll,{number:function(e){return e>=-1&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})})),ml=Ee("asinh",["typed"],(function(e){return(0,e.typed)("asinh",{number:Uf,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})})),hl=Ee("atan",["typed"],(function(e){return(0,e.typed)("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})})),dl="atan2",vl=Ee(dl,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.equalScalar,i=e.BigNumber,a=e.DenseMatrix,o=e.concat,u=$a({typed:t,equalScalar:n}),s=Ha({typed:t}),c=Mo({typed:t,equalScalar:n}),f=Na({typed:t,equalScalar:n}),l=Da({typed:t,DenseMatrix:a}),p=Wa({typed:t,matrix:r,concat:o});return t(dl,{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return i.atan2(e,t)}},p({scalar:"number | BigNumber",SS:c,DS:s,SD:u,Ss:f,sS:l}))})),yl="atanh",gl=Ee(yl,["typed","config","Complex"],(function(e){var t=e.typed,r=e.config,n=e.Complex;return t(yl,{number:function(e){return e<=1&&e>=-1||r.predictable?$f(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})})),xl=Ee("trigUnit",["typed"],(function(e){var t=e.typed;return{Unit:t.referToSelf((function(e){return function(r){if(!r.hasBase(r.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return t.find(e,r.valueType())(r.value)}}))}})),bl=Ee("cos",["typed"],(function(e){var t=e.typed,r=xl({typed:t});return t("cos",{number:Math.cos,"Complex | BigNumber":function(e){return e.cos()}},r)})),wl="cosh",Nl=Ee(wl,["typed"],(function(e){return(0,e.typed)(wl,{number:le,"Complex | BigNumber":function(e){return e.cosh()}})})),Dl=Ee("cot",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("cot",{number:Hf,Complex:function(e){return e.cot()},BigNumber:function(e){return new r(1).div(e.tan())}},xl({typed:t}))})),El="coth",Al=Ee(El,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(El,{number:Gf,Complex:function(e){return e.coth()},BigNumber:function(e){return new r(1).div(e.tanh())}})})),Sl=Ee("csc",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("csc",{number:Vf,Complex:function(e){return e.csc()},BigNumber:function(e){return new r(1).div(e.sin())}},xl({typed:t}))})),Cl="csch",Ml=Ee(Cl,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(Cl,{number:Zf,Complex:function(e){return e.csch()},BigNumber:function(e){return new r(1).div(e.sinh())}})})),Fl=Ee("sec",["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t("sec",{number:Wf,Complex:function(e){return e.sec()},BigNumber:function(e){return new r(1).div(e.cos())}},xl({typed:t}))})),Ol="sech",Tl=Ee(Ol,["typed","BigNumber"],(function(e){var t=e.typed,r=e.BigNumber;return t(Ol,{number:Yf,Complex:function(e){return e.sech()},BigNumber:function(e){return new r(1).div(e.cosh())}})})),Bl=Ee("sin",["typed"],(function(e){var t=e.typed,r=xl({typed:t});return t("sin",{number:Math.sin,"Complex | BigNumber":function(e){return e.sin()}},r)})),_l="sinh",kl=Ee(_l,["typed"],(function(e){return(0,e.typed)(_l,{number:Jf,"Complex | BigNumber":function(e){return e.sinh()}})})),Il=Ee("tan",["typed"],(function(e){var t=e.typed,r=xl({typed:t});return t("tan",{number:Math.tan,"Complex | BigNumber":function(e){return e.tan()}},r)})),Rl=Ee("tanh",["typed"],(function(e){return(0,e.typed)("tanh",{number:me,"Complex | BigNumber":function(e){return e.tanh()}})})),zl="setCartesian",ql=Ee(zl,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(zl,{"Array | Matrix, Array | Matrix":function(e,t){var u=[];if(0!==n(r(e),new a(0))&&0!==n(r(t),new a(0))){var s=bn(Array.isArray(e)?e:e.toArray()).sort(i),c=bn(Array.isArray(t)?t:t.toArray()).sort(i);u=[];for(var f=0;f<s.length;f++)for(var l=0;l<c.length;l++)u.push([s[f],c[l]])}return Array.isArray(e)&&Array.isArray(t)?u:new o(u)}})})),jl="setDifference",Pl=Ee(jl,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(jl,{"Array | Matrix, Array | Matrix":function(e,t){var u;if(0===n(r(e),new a(0)))u=[];else{if(0===n(r(t),new a(0)))return bn(e.toArray());var s,c=Sn(bn(Array.isArray(e)?e:e.toArray()).sort(i)),f=Sn(bn(Array.isArray(t)?t:t.toArray()).sort(i));u=[];for(var l=0;l<c.length;l++){s=!1;for(var p=0;p<f.length;p++)if(0===i(c[l].value,f[p].value)&&c[l].identifier===f[p].identifier){s=!0;break}s||u.push(c[l])}}return Array.isArray(e)&&Array.isArray(t)?Cn(u):new o(Cn(u))}})})),Ll="setDistinct",Ul=Ee(Ll,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t(Ll,{"Array | Matrix":function(e){var t;if(0===n(r(e),new a(0)))t=[];else{var u=bn(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(u[0]);for(var s=1;s<u.length;s++)0!==i(u[s],u[s-1])&&t.push(u[s])}return Array.isArray(e)?t:new o(t)}})})),$l="setIntersect",Hl=Ee($l,["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t($l,{"Array | Matrix, Array | Matrix":function(e,t){var u;if(0===n(r(e),new a(0))||0===n(r(t),new a(0)))u=[];else{var s=Sn(bn(Array.isArray(e)?e:e.toArray()).sort(i)),c=Sn(bn(Array.isArray(t)?t:t.toArray()).sort(i));u=[];for(var f=0;f<s.length;f++)for(var l=0;l<c.length;l++)if(0===i(s[f].value,c[l].value)&&s[f].identifier===c[l].identifier){u.push(s[f]);break}}return Array.isArray(e)&&Array.isArray(t)?Cn(u):new o(Cn(u))}})})),Gl="setIsSubset",Vl=Ee(Gl,["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index;return t(Gl,{"Array | Matrix, Array | Matrix":function(e,t){if(0===n(r(e),new a(0)))return!0;if(0===n(r(t),new a(0)))return!1;for(var o,u=Sn(bn(Array.isArray(e)?e:e.toArray()).sort(i)),s=Sn(bn(Array.isArray(t)?t:t.toArray()).sort(i)),c=0;c<u.length;c++){o=!1;for(var f=0;f<s.length;f++)if(0===i(u[c].value,s[f].value)&&u[c].identifier===s[f].identifier){o=!0;break}if(!1===o)return!1}return!0}})})),Zl="setMultiplicity",Wl=Ee(Zl,["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index;return t(Zl,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===n(r(t),new a(0)))return 0;for(var o=bn(Array.isArray(t)?t:t.toArray()),u=0,s=0;s<o.length;s++)0===i(o[s],e)&&u++;return u}})})),Yl="setPowerset",Jl=Ee(Yl,["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,r=e.size,n=e.subset,i=e.compareNatural,a=e.Index;return t(Yl,{"Array | Matrix":function(e){if(0===n(r(e),new a(0)))return[];for(var t=bn(Array.isArray(e)?e:e.toArray()).sort(i),u=[],s=0;s.toString(2).length<=t.length;)u.push(o(t,s.toString(2).split("").reverse())),s++;return function(e){for(var t=[],r=e.length-1;r>0;r--)for(var n=0;n<r;n++)e[n].length>e[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(u)}});function o(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}})),Xl="setSize",Ql=Ee(Xl,["typed","compareNatural"],(function(e){var t=e.typed,r=e.compareNatural;return t(Xl,{"Array | Matrix":function(e){return Array.isArray(e)?bn(e).length:bn(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?bn(e).length:bn(e.toArray()).length;for(var n=bn(Array.isArray(e)?e:e.toArray()).sort(r),i=1,a=1;a<n.length;a++)0!==r(n[a],n[a-1])&&i++;return i}})})),Kl="setSymDifference",ep=Ee(Kl,["typed","size","concat","subset","setDifference","Index"],(function(e){var t=e.typed,r=e.size,n=e.concat,i=e.subset,a=e.setDifference,o=e.Index;return t(Kl,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new o(0)))return bn(t);if(0===i(r(t),new o(0)))return bn(e);var u=bn(e),s=bn(t);return n(a(u,s),a(s,u))}})})),tp="setUnion",rp=Ee(tp,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(function(e){var t=e.typed,r=e.size,n=e.concat,i=e.subset,a=e.setIntersect,o=e.setSymDifference,u=e.Index;return t(tp,{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(r(e),new u(0)))return bn(t);if(0===i(r(t),new u(0)))return bn(e);var s=bn(e),c=bn(t);return n(o(s,c),a(s,c))}})})),np=Ee("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],(function(e){var t=e.typed,r=e.matrix,n=e.addScalar,i=e.equalScalar,a=e.DenseMatrix,o=(e.SparseMatrix,e.concat),u=Ja({typed:t}),s=Xa({typed:t,equalScalar:i}),c=Qa({typed:t,DenseMatrix:a}),f=Wa({typed:t,matrix:r,concat:o});return t("add",{"any, any":n,"any, any, ...any":t.referToSelf((function(e){return function(t,r,n){for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i}}))},f({elop:n,DS:u,SS:s,Ss:c}))})),ip="hypot",ap=Ee(ip,["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],(function(e){var t=e.typed,r=e.abs,n=e.addScalar,i=e.divideScalar,a=e.multiplyScalar,u=e.sqrt,s=e.smaller,c=e.isPositive;return t(ip,{"... number | BigNumber":f,Array:f,Matrix:function(e){return f(bn(e.toArray()))}});function f(e){for(var t=0,f=0,l=0;l<e.length;l++){if(o(e[l]))throw new TypeError("Unexpected type of argument to hypot");var p=r(e[l]);s(f,p)?(t=a(t,a(i(f,p),i(f,p))),t=n(t,1),f=p):t=n(t,c(p)?a(i(p,f),i(p,f)):p)}return a(f,u(t))}})),op="norm",up=Ee(op,["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.pow,a=e.conj,o=e.sqrt,u=e.multiply,s=e.equalScalar,c=e.larger,f=e.smaller,l=e.matrix,p=e.ctranspose,m=e.eigs;return t(op,{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 h(l(e),2)},Matrix:function(e){return h(e,2)},"Array, number | BigNumber | string":function(e,t){return h(l(e),t)},"Matrix, number | BigNumber | string":function(e,t){return h(e,t)}});function h(e,t){var l=e.size();if(1===l.length)return function(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var n=r(e);c(n,t)&&(t=n)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var n=r(e);t&&!f(n,t)||(t=n)}),!0),t||0}(e);if("fro"===t)return h(e,2);if("number"==typeof t&&!isNaN(t)){if(!s(t,0)){var a=0;return e.forEach((function(e){a=n(i(r(e),t),a)}),!0),i(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}(e,t);if(2===l.length){if(l[0]&&l[1])return function(e,t){if(1===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[1],u=n(t[o]||0,r(e));c(u,i)&&(i=u),t[o]=u}),!0),i}(e);if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[0],u=n(t[o]||0,r(e));c(u,i)&&(i=u),t[o]=u}),!0),i}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,r){t=n(t,u(e,a(e)))})),r(o(t))}(e);if(2===t)return function(e){var t=e.size();if(t[0]!==t[1])throw new RangeError("Invalid matrix dimensions");var n=p(e),i=u(n,e),a=m(i).values.toArray(),s=a[a.length-1];return r(o(s))}(e);throw new Error("Unsupported parameter value "+t)}(e,t);throw new RangeError("Invalid matrix dimensions")}}})),sp=Ee("dot",["typed","addScalar","multiplyScalar","conj","size"],(function(e){var t=e.typed,r=e.addScalar,n=e.multiplyScalar,i=e.conj,a=e.size;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var s=o(e,a),c=l(e)?e._data:e,f=l(e)?e._datatype:void 0,p=l(a)?a._data:a,m=l(a)?a._datatype:void 0,h=2===u(e).length,d=2===u(a).length,v=r,y=n;if(f&&m&&f===m&&"string"==typeof f){var g=f;v=t.find(r,[g,g]),y=t.find(n,[g,g])}if(!h&&!d){for(var x=y(i(c[0]),p[0]),b=1;b<s;b++)x=v(x,y(i(c[b]),p[b]));return x}if(!h&&d){for(var w=y(i(c[0]),p[0][0]),N=1;N<s;N++)w=v(w,y(i(c[N]),p[N][0]));return w}if(h&&!d){for(var D=y(i(c[0][0]),p[0]),E=1;E<s;E++)D=v(D,y(i(c[E][0]),p[E]));return D}if(h&&d){for(var A=y(i(c[0][0]),p[0][0]),S=1;S<s;S++)A=v(A,y(i(c[S][0]),p[S][0]));return A}},"SparseMatrix, SparseMatrix":function(e,t){o(e,t);for(var i=e._index,a=e._values,u=t._index,s=t._values,c=0,f=r,l=n,p=0,m=0;p<i.length&&m<u.length;){var h=i[p],d=u[m];h<d?p++:h>d?m++:h===d&&(c=f(c,l(a[p],s[m])),p++,m++)}return c}});function o(e,t){var r,n,i=u(e),a=u(t);if(1===i.length)r=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");r=i[0]}if(1===a.length)n=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");n=a[0]}if(r!==n)throw new RangeError("Vectors must have equal length ("+r+" != "+n+")");if(0===r)throw new RangeError("Cannot calculate the dot product of empty vectors");return r}function u(e){return l(e)?e.size():a(e)}})),cp=Ee("trace",["typed","matrix","add"],(function(e){var t=e.typed,r=e.matrix,n=e.add;return t("trace",{Array:function(e){return i(r(e))},SparseMatrix:function(e){var t=e._values,r=e._index,i=e._ptr,a=e._size,o=a[0],u=a[1];if(o===u){var s=0;if(t.length>0)for(var c=0;c<u;c++)for(var f=i[c],l=i[c+1],p=f;p<l;p++){var m=r[p];if(m===c){s=n(s,t[p]);break}if(m>c)break}return s}throw new RangeError("Matrix must be square (size: "+Jr(a)+")")},DenseMatrix:i,any:he});function i(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return he(r[0]);throw new RangeError("Matrix must be square (size: "+Jr(t)+")");case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o<i;o++)a=n(a,r[o][o]);return a}throw new RangeError("Matrix must be square (size: "+Jr(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+Jr(t)+")")}}})),fp="index",lp=Ee(fp,["typed","Index"],(function(e){var t=e.typed,r=e.Index;return t(fp,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return a(e)?e.toNumber():f(e)||l(e)?e.map((function(e){return a(e)?e.toNumber():e})):e})),n=new r;return r.apply(n,t),n}})})),pp=(r(9649),new Set(["end"])),mp=Ee("Node",["mathWithTransform"],(function(e){var r=e.mathWithTransform;return function(){function e(){Ce(this,e)}return Oe(e,[{key:"type",get:function(){return"Node"}},{key:"isNode",get:function(){return!0}},{key:"evaluate",value:function(e){return this.compile().evaluate(e)}},{key:"compile",value:function(){var e=this._compile(r,{}),t={};return{evaluate:function(r){var n=Ue(r);return function(e){for(var t=0,r=Vr(pp);t<r.length;t++){var n=r[t];if(e.has(n))throw new Error('Scope contains an illegal symbol, "'+n+'" is a reserved keyword')}}(n),e(n,t,null)}}}},{key:"_compile",value:function(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}},{key:"forEach",value:function(e){throw new Error("Cannot run forEach on a Node interface")}},{key:"map",value:function(e){throw new Error("Cannot run map on a Node interface")}},{key:"_ifNode",value:function(e){if(!R(e))throw new TypeError("Callback function must return a Node");return e}},{key:"traverse",value:function(e){e(this,null,null),function e(t,r){t.forEach((function(t,n,i){r(t,n,i),e(t,r)}))}(this,e)}},{key:"transform",value:function(e){return function t(r,n,i){var a=e(r,n,i);return a!==r?a:r.map(t)}(this,null,null)}},{key:"filter",value:function(e){var t=[];return this.traverse((function(r,n,i){e(r,n,i)&&t.push(r)})),t}},{key:"clone",value:function(){throw new Error("Cannot clone a Node interface")}},{key:"cloneDeep",value:function(){return this.map((function(e){return e.cloneDeep()}))}},{key:"equals",value:function(e){return!!e&&this.type===e.type&&ge(this,e)}},{key:"toString",value:function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}},{key:"toJSON",value:function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}},{key:"toHTML",value:function(e){var t=this._getCustomString(e);return void 0!==t?t:this.toHTML(e)}},{key:"_toString",value:function(){throw new Error("_toString not implemented for "+this.type)}},{key:"toTex",value:function(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}},{key:"_toTex",value:function(e){throw new Error("_toTex not implemented for "+this.type)}},{key:"_getCustomString",value:function(e){if(e&&"object"===t(e))switch(t(e.handler)){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}}},{key:"getIdentifier",value:function(){return this.type}},{key:"getContent",value:function(){return this}}]),e}()}),{isClass:!0,isNode:!0});function hp(e,t){return hp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hp(e,t)}function dp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hp(e,t)}function vp(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function yp(e){return yp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yp(e)}function gp(e){return e&&e.isIndexError?new nn(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function xp(e){var r=e.subset;return function(e,n){try{if(Array.isArray(e))return r(e,n);if(e&&"function"==typeof e.subset)return e.subset(n);if("string"==typeof e)return r(e,n);if("object"===t(e)){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return Te(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw gp(e)}}}r(6034),r(50);var bp="AccessorNode",wp=Ee(bp,["subset","Node"],(function(e){var t=e.subset,r=e.Node,n=xp({subset:t});function i(e){return!(S(e)||C(e)||T(e)||k(e)||z(e)||j(e)||U(e))}var a=function(e){dp(o,e);var t,r,a=(t=o,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=yp(t);if(r){var i=yp(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return vp(this,e)});function o(e,t){var r;if(Ce(this,o),r=a.call(this),!R(e))throw new TypeError('Node expected for parameter "object"');if(!I(t))throw new TypeError('IndexNode expected for parameter "index"');return r.object=e,r.index=t,r}return Oe(o,[{key:"name",get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}},{key:"type",get:function(){return bp}},{key:"isAccessorNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.object._compile(e,t),i=this.index._compile(e,t);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,t,n){return Te(r(e,t,n),a)}}return function(e,t,a){var o=r(e,t,a),u=i(e,t,o);return n(o,u)}}},{key:"forEach",value:function(e){e(this.object,"object",this),e(this.index,"index",this)}},{key:"map",value:function(e){return new o(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))}},{key:"clone",value:function(){return new o(this.object,this.index)}},{key:"_toString",value:function(e){var t=this.object.toString(e);return i(this.object)&&(t="("+t+")"),t+this.index.toString(e)}},{key:"toHTML",value:function(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)}},{key:"_toTex",value:function(e){var t=this.object.toTex(e);return i(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}},{key:"toJSON",value:function(){return{mathjs:bp,object:this.object,index:this.index}}}],[{key:"fromJSON",value:function(e){return new o(e.object,e.index)}}]),o}(r);return Ua(a,"name",bp),a}),{isClass:!0,isNode:!0});var Np="ArrayNode",Dp=Ee(Np,["Node"],(function(e){var t=function(e){dp(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=yp(t);if(r){var i=yp(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return vp(this,e)});function i(e){var t;if(Ce(this,i),(t=n.call(this)).items=e||[],!Array.isArray(t.items)||!t.items.every(R))throw new TypeError("Array containing Nodes expected");return t}return Oe(i,[{key:"type",get:function(){return Np}},{key:"isArrayNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=wn(this.items,(function(r){return r._compile(e,t)}));if("Array"!==e.config.matrix){var n=e.matrix;return function(e,t,i){return n(wn(r,(function(r){return r(e,t,i)})))}}return function(e,t,n){return wn(r,(function(r){return r(e,t,n)}))}}},{key:"forEach",value:function(e){for(var t=0;t<this.items.length;t++)e(this.items[t],"items["+t+"]",this)}},{key:"map",value:function(e){for(var t=[],r=0;r<this.items.length;r++)t[r]=this._ifNode(e(this.items[r],"items["+r+"]",this));return new i(t)}},{key:"clone",value:function(){return new i(this.items.slice(0))}},{key:"_toString",value:function(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"}},{key:"toJSON",value:function(){return{mathjs:Np,items:this.items}}},{key:"toHTML",value:function(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>'}},{key:"_toTex",value:function(e){return function t(r,n){var i=r.some(C)&&!r.every(C),a=n||i,o=a?"&":"\\\\",u=r.map((function(r){return r.items?t(r.items,!n):r.toTex(e)})).join(o);return i||!a||a&&!n?"\\begin{bmatrix}"+u+"\\end{bmatrix}":u}(this.items,!1)}}],[{key:"fromJSON",value:function(e){return new i(e.items)}}]),i}(e.Node);return Ua(t,"name",Np),t}),{isClass:!0,isNode:!0});function Ep(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ap=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Sp(e,t){if(!t||"auto"!==t)return e;for(var r=e;j(r);)r=r.content;return r}function Cp(e,t,r,n){var i=e;"keep"!==t&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,u=0;u<Ap.length;u++)if(a in Ap[u]){o=u;break}if("OperatorNode:multiply"===a&&i.implicit&&"show"!==r){var s=Sp(i.args[0],t);T(s)&&n&&"OperatorNode:divide"===n.getIdentifier()&&B(Sp(n.args[0],t))||"OperatorNode:divide"===s.getIdentifier()&&B(Sp(s.args[0],t))&&T(Sp(s.args[1]))||(o+=1)}return o}function Mp(e,t){var r=e;"keep"!==t&&(r=e.getContent());var n=r.getIdentifier(),i=Cp(r,t);if(null===i)return null;var a=Ap[i][n];if(Ne(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function Fp(e,t,r){var n="keep"!==r?e.getContent():e,i="keep"!==r?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),u=Cp(n,r);if(null===u)return null;var s=Ap[u][a];if(Ne(s,"associativeWith")&&s.associativeWith instanceof Array){for(var c=0;c<s.associativeWith.length;c++)if(s.associativeWith[c]===o)return!0;return!1}return null}var Op="AssignmentNode",Tp=Ee(Op,["subset","?matrix","Node"],(function(e){var r=e.subset,n=e.matrix,i=e.Node,a=xp({subset:r}),o=function(e){var r=e.subset,n=e.matrix;return function(e,i,a){try{if(Array.isArray(e))return n(e).subset(i,a).valueOf().forEach((function(t,r){e[r]=t})),e;if(e&&"function"==typeof e.subset)return e.subset(i,a);if("string"==typeof e)return r(e,i,a);if("object"===t(e)){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Be(e,i.getObjectProperty(),a),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw gp(e)}}}({subset:r,matrix:n});function u(e,t,r){t||(t="keep");var n=Cp(e,t,r),i=Cp(e.value,t,r);return"all"===t||null!==i&&i<=n}var s=function(e){dp(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=yp(t);if(r){var i=yp(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return vp(this,e)});function i(e,t,r){var a;if(Ce(this,i),(a=n.call(this)).object=e,a.index=r?t:null,a.value=r||t,!U(e)&&!S(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(U(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(a.index&&!I(a.index))throw new TypeError('IndexNode expected as "index"');if(!R(a.value))throw new TypeError('Node expected as "value"');return a}return Oe(i,[{key:"name",get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}},{key:"type",get:function(){return Op}},{key:"isAssignmentNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.object._compile(e,t),n=this.index?this.index._compile(e,t):null,i=this.value._compile(e,t),u=this.object.name;if(this.index){if(this.index.isObjectProperty()){var s=this.index.getObjectProperty();return function(e,t,n){var a=r(e,t,n),o=i(e,t,n);return Be(a,s,o),o}}if(U(this.object))return function(e,t,a){var s=r(e,t,a),c=i(e,t,a),f=n(e,t,s);return e.set(u,o(s,f,c)),c};var c=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var f=this.object.index.getObjectProperty();return function(e,t,r){var a=c(e,t,r),u=Te(a,f),s=n(e,t,u),l=i(e,t,r);return Be(a,f,o(u,s,l)),l}}var l=this.object.index._compile(e,t);return function(e,t,r){var u=c(e,t,r),s=l(e,t,u),f=a(u,s),p=n(e,t,f),m=i(e,t,r);return o(u,s,o(f,p,m)),m}}if(!U(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,r){var n=i(e,t,r);return e.set(u,n),n}}},{key:"forEach",value:function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}},{key:"map",value:function(e){return new i(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))}},{key:"clone",value:function(){return new i(this.object,this.index,this.value)}},{key:"_toString",value:function(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):"",n=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),t+r+" = "+n}},{key:"toJSON",value:function(){return{mathjs:Op,object:this.object,index:this.index,value:this.value}}},{key:"toHTML",value:function(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n='<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n}},{key:"_toTex",value:function(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),t+r+"="+n}}],[{key:"fromJSON",value:function(e){return new i(e.object,e.index,e.value)}}]),i}(i);return Ua(s,"name",Op),s}),{isClass:!0,isNode:!0});var Bp="BlockNode",_p=Ee(Bp,["ResultSet","Node"],(function(e){var t=e.ResultSet,r=function(e){dp(a,e);var r,n,i=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yp(r);if(n){var i=yp(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return vp(this,e)});function a(e){var t;if(Ce(this,a),t=i.call(this),!Array.isArray(e))throw new Error("Array expected");return t.blocks=e.map((function(e){var t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!R(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}})),t}return Oe(a,[{key:"type",get:function(){return Bp}},{key:"isBlockNode",get:function(){return!0}},{key:"_compile",value:function(e,r){var n=wn(this.blocks,(function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}}));return function(e,r,i){var a=[];return Nn(n,(function(t){var n=t.evaluate(e,r,i);t.visible&&a.push(n)})),new t(a)}}},{key:"forEach",value:function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)}},{key:"map",value:function(e){for(var t=[],r=0;r<this.blocks.length;r++){var n=this.blocks[r],i=this._ifNode(e(n.node,"blocks["+r+"].node",this));t[r]={node:i,visible:n.visible}}return new a(t)}},{key:"clone",value:function(){return new a(this.blocks.map((function(e){return{node:e.node,visible:e.visible}})))}},{key:"_toString",value:function(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")}},{key:"toJSON",value:function(){return{mathjs:Bp,blocks:this.blocks}}},{key:"toHTML",value:function(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>')}},{key:"_toTex",value:function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")}}],[{key:"fromJSON",value:function(e){return new a(e.blocks)}}]),a}(e.Node);return Ua(r,"name",Bp),r}),{isClass:!0,isNode:!0});var kp="ConditionalNode",Ip=Ee(kp,["Node"],(function(e){var t=function(e){dp(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=yp(t);if(r){var i=yp(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return vp(this,e)});function i(e,t,r){var a;if(Ce(this,i),a=n.call(this),!R(e))throw new TypeError("Parameter condition must be a Node");if(!R(t))throw new TypeError("Parameter trueExpr must be a Node");if(!R(r))throw new TypeError("Parameter falseExpr must be a Node");return a.condition=e,a.trueExpr=t,a.falseExpr=r,a}return Oe(i,[{key:"type",get:function(){return kp}},{key:"isConditionalNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,u){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(a(e))return!e.isZero();if(o(e))return!(!e.re&&!e.im);if(s(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+H(e)+'"')}(r(e,t,u))?n(e,t,u):i(e,t,u)}}},{key:"forEach",value:function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}},{key:"map",value:function(e){return new i(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}},{key:"clone",value:function(){return new i(this.condition,this.trueExpr,this.falseExpr)}},{key:"_toString",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=Cp(this,t,e&&e.implicit),n=this.condition.toString(e),i=Cp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");var a=this.trueExpr.toString(e),o=Cp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a="("+a+")");var u=this.falseExpr.toString(e),s=Cp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=r)&&(u="("+u+")"),n+" ? "+a+" : "+u}},{key:"toJSON",value:function(){return{mathjs:kp,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}},{key:"toHTML",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=Cp(this,t,e&&e.implicit),n=this.condition.toHTML(e),i=Cp(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),o=Cp(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var u=this.falseExpr.toHTML(e),s=Cp(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==s&&s<=r)&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+u}},{key:"_toTex",value:function(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}],[{key:"fromJSON",value:function(e){return new i(e.condition,e.trueExpr,e.falseExpr)}}]),i}(e.Node);return Ua(t,"name",kp),t}),{isClass:!0,isNode:!0}),Rp=r(7928),zp={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{?}"},qp={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"},jp={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(qp.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]}".concat(qp.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(qp.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(qp.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(qp.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},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]}".concat(qp.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(qp.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)".concat(qp.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]}".concat(qp.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(qp.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(qp.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(qp.bitAnd,"${args[1]}\\right)")},bitNot:{1:qp.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(qp.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(qp.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(qp.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(qp.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(qp.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]}".concat(qp.and,"${args[1]}\\right)")},not:{1:qp.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(qp.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(qp.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(qp.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]}}".concat(qp.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(qp.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(qp.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(qp.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(qp.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(qp.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(qp.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(qp.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(qp.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]}".concat(qp.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)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(zp.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)"}},Pp={deg:"^\\circ"};function Lp(e){return Rp(e,{preserveFormatting:!0})}function Up(e,t){return(t=void 0!==t&&t)?Ne(Pp,e)?Pp[e]:"\\mathrm{"+Lp(e)+"}":Ne(zp,e)?zp[e]:Lp(e)}var $p="ConstantNode",Hp=Ee($p,["Node"],(function(e){var t=function(e){dp(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=yp(t);if(r){var i=yp(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return vp(this,e)});function i(e){var t;return Ce(this,i),(t=n.call(this)).value=e,t}return Oe(i,[{key:"type",get:function(){return $p}},{key:"isConstantNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.value;return function(){return r}}},{key:"forEach",value:function(e){}},{key:"map",value:function(e){return this.clone()}},{key:"clone",value:function(){return new i(this.value)}},{key:"_toString",value:function(e){return Jr(this.value,e)}},{key:"toHTML",value:function(e){var t=this._toString(e);switch(H(this.value)){case"number":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>"}}},{key:"toJSON",value:function(){return{mathjs:$p,value:this.value}}},{key:"_toTex",value:function(e){var t=this._toString(e);switch(H(this.value)){case"string":return"\\mathtt{"+Lp(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var r=t.toLowerCase().indexOf("e");return-1!==r?t.substring(0,r)+"\\cdot10^{"+t.substring(r+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}}}],[{key:"fromJSON",value:function(e){return new i(e.value)}}]),i}(e.Node);return Ua(t,"name",$p),t}),{isClass:!0,isNode:!0});function Gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Vp="FunctionAssignmentNode",Zp=Ee(Vp,["typed","Node"],(function(e){var t=e.typed;function r(e,t,r){var n=Cp(e,t,r),i=Cp(e.expr,t,r);return"all"===t||null!==i&&i<=n}var n=function(e){dp(o,e);var n,i,a=(n=o,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yp(n);if(i){var r=yp(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return vp(this,e)});function o(e,t,r){var n;if(Ce(this,o),n=a.call(this),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!R(r))throw new TypeError('Node expected for parameter "expr"');if(pp.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');var i,u=new Set,s=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Gp(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Gp(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(t);try{for(s.s();!(i=s.n()).done;){var c=i.value,f="string"==typeof c?c:c.name;if(u.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));u.add(f)}}catch(e){s.e(e)}finally{s.f()}return n.name=e,n.params=t.map((function(e){return e&&e.name||e})),n.types=t.map((function(e){return e&&e.type||"any"})),n.expr=r,n}return Oe(o,[{key:"type",get:function(){return Vp}},{key:"isFunctionAssignmentNode",get:function(){return!0}},{key:"_compile",value:function(e,r){var n=Object.create(r);Nn(this.params,(function(e){n[e]=!0}));var i=this.expr._compile(e,n),a=this.name,o=this.params,u=An(this.types,","),s=a+"("+An(this.params,", ")+")";return function(e,r,n){var c={};c[u]=function(){for(var t=Object.create(r),a=0;a<o.length;a++)t[o[a]]=arguments[a];return i(e,t,n)};var f=t(a,c);return f.syntax=s,e.set(a,f),f}}},{key:"forEach",value:function(e){e(this.expr,"expr",this)}},{key:"map",value:function(e){var t=this._ifNode(e(this.expr,"expr",this));return new o(this.name,this.params.slice(0),t)}},{key:"clone",value:function(){return new o(this.name,this.params.slice(0),this.expr)}},{key:"_toString",value:function(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}},{key:"toJSON",value:function(){var e=this.types;return{mathjs:Vp,name:this.name,params:this.params.map((function(t,r){return{name:t,type:e[r]}})),expr:this.expr}}},{key:"toHTML",value:function(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">'+Kr(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">'+Kr(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}},{key:"_toTex",value:function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toTex(e);return r(this,t,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Up).join(",")+"\\right)="+n}}],[{key:"fromJSON",value:function(e){return new o(e.name,e.params,e.expr)}}]),o}(e.Node);return Ua(n,"name",Vp),n}),{isClass:!0,isNode:!0});var Wp="IndexNode",Yp=Ee(Wp,["Node","size"],(function(e){var t=e.Node,r=e.size,n=function(e){dp(a,e);var t,n,i=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=yp(t);if(n){var i=yp(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return vp(this,e)});function a(e,t){var r;if(Ce(this,a),(r=i.call(this)).dimensions=e,r.dotNotation=t||!1,!Array.isArray(e)||!e.every(R))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(r.dotNotation&&!r.isObjectProperty())throw new Error("dotNotation only applicable for object properties");return r}return Oe(a,[{key:"type",get:function(){return Wp}},{key:"isIndexNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var n=wn(this.dimensions,(function(n,i){if(n.filter((function(e){return e.isSymbolNode&&"end"===e.name})).length>0){var a=Object.create(t);a.end=!0;var o=n._compile(e,a);return function(e,t,n){if(!l(n)&&!f(n)&&!c(n))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+H(n));var a=r(n).valueOf(),u=Object.create(t);return u.end=a[i],o(e,u,n)}}return n._compile(e,t)})),i=Te(e,"index");return function(e,t,r){var a=wn(n,(function(n){return n(e,t,r)}));return i.apply(void 0,Vr(a))}}},{key:"forEach",value:function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}},{key:"map",value:function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this._ifNode(e(this.dimensions[r],"dimensions["+r+"]",this));return new a(t,this.dotNotation)}},{key:"clone",value:function(){return new a(this.dimensions.slice(0),this.dotNotation)}},{key:"isObjectProperty",value:function(){return 1===this.dimensions.length&&T(this.dimensions[0])&&"string"==typeof this.dimensions[0].value}},{key:"getObjectProperty",value:function(){return this.isObjectProperty()?this.dimensions[0].value:null}},{key:"_toString",value:function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}},{key:"toJSON",value:function(){return{mathjs:Wp,dimensions:this.dimensions,dotNotation:this.dotNotation}}},{key:"toHTML",value:function(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this.dimensions[r].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Kr(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>'}},{key:"_toTex",value:function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"}}],[{key:"fromJSON",value:function(e){return new a(e.dimensions,e.dotNotation)}}]),a}(t);return Ua(n,"name",Wp),n}),{isClass:!0,isNode:!0});var Jp="ObjectNode",Xp=Ee(Jp,["Node"],(function(e){var r=function(e){dp(a,e);var r,n,i=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yp(r);if(n){var i=yp(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return vp(this,e)});function a(e){var r;if(Ce(this,a),(r=i.call(this)).properties=e||{},e&&("object"!==t(e)||!Object.keys(e).every((function(t){return R(e[t])}))))throw new TypeError("Object containing Nodes expected");return r}return Oe(a,[{key:"type",get:function(){return Jp}},{key:"isObjectNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r={};for(var n in this.properties)if(Ne(this.properties,n)){var i=Xr(n),a=JSON.parse(i),o=Te(this.properties,n);r[a]=o._compile(e,t)}return function(e,t,n){var i={};for(var a in r)Ne(r,a)&&(i[a]=r[a](e,t,n));return i}}},{key:"forEach",value:function(e){for(var t in this.properties)Ne(this.properties,t)&&e(this.properties[t],"properties["+Xr(t)+"]",this)}},{key:"map",value:function(e){var t={};for(var r in this.properties)Ne(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+Xr(r)+"]",this)));return new a(t)}},{key:"clone",value:function(){var e={};for(var t in this.properties)Ne(this.properties,t)&&(e[t]=this.properties[t]);return new a(e)}},{key:"_toString",value:function(e){var t=[];for(var r in this.properties)Ne(this.properties,r)&&t.push(Xr(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"}},{key:"toJSON",value:function(){return{mathjs:Jp,properties:this.properties}}},{key:"toHTML",value:function(e){var t=[];for(var r in this.properties)Ne(this.properties,r)&&t.push('<span class="math-symbol math-property">'+Kr(r)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[r].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>'}},{key:"_toTex",value:function(e){var t=[];for(var r in this.properties)Ne(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}],[{key:"fromJSON",value:function(e){return new a(e.properties)}}]),a}(e.Node);return Ua(r,"name",Jp),r}),{isClass:!0,isNode:!0});var Qp="OperatorNode",Kp=Ee(Qp,["Node"],(function(e){function t(e,r){var n=e;if("auto"===r)for(;j(n);)n=n.content;return!!T(n)||!!q(n)&&t(n.args[0],r)}function r(e,r,n,i,a){var o,u=Cp(e,r,n),s=Mp(e,r);if("all"===r||i.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return i.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(i.length){case 0:o=[];break;case 1:var c=Cp(i[0],r,n,e);if(a&&null!==c){var f,l;if("keep"===r?(f=i[0].getIdentifier(),l=e.getIdentifier()):(f=i[0].getContent().getIdentifier(),l=e.getContent().getIdentifier()),!1===Ap[u][l].latexLeftParens){o=[!1];break}if(!1===Ap[c][f].latexParens){o=[!1];break}}if(null===c){o=[!1];break}if(c<=u){o=[!0];break}o=[!1];break;case 2:var p,m,h=Cp(i[0],r,n,e),d=Fp(e,i[0],r);p=null!==h&&(h===u&&"right"===s&&!d||h<u);var v,y,g,x=Cp(i[1],r,n,e),b=Fp(e,i[1],r);m=null!==x&&(x===u&&"left"===s&&!b||x<u),a&&("keep"===r?(v=e.getIdentifier(),y=e.args[0].getIdentifier(),g=e.args[1].getIdentifier()):(v=e.getContent().getIdentifier(),y=e.args[0].getContent().getIdentifier(),g=e.args[1].getContent().getIdentifier()),null!==h&&(!1===Ap[u][v].latexLeftParens&&(p=!1),!1===Ap[h][y].latexParens&&(p=!1)),null!==x&&(!1===Ap[u][v].latexRightParens&&(m=!1),!1===Ap[x][g].latexParens&&(m=!1))),o=[p,m];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(o=i.map((function(t){var i=Cp(t,r,n,e),a=Fp(e,t,r),o=Mp(t,r);return null!==i&&(u===i&&s===o&&!a||i<u)})))}if(i.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==r&&"hide"===n)for(var w=1;w<o.length;++w)!t(i[w],r)||o[w-1]||"keep"===r&&j(i[w-1])||(o[w]=!0);return o}var n=function(e){dp(a,e);var t,n,i=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=yp(t);if(n){var i=yp(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return vp(this,e)});function a(e,t,r,n,o){var u;if(Ce(this,a),u=i.call(this),"string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(R))throw new TypeError('Array containing Nodes expected for parameter "args"');return u.implicit=!0===n,u.isPercentage=!0===o,u.op=e,u.fn=t,u.args=r||[],u}return Oe(a,[{key:"type",get:function(){return Qp}},{key:"isOperatorNode",get:function(){return!0}},{key:"_compile",value:function(e,t){if("string"!=typeof this.fn||!ke(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var r=Te(e,this.fn),n=wn(this.args,(function(r){return r._compile(e,t)}));if(1===n.length){var i=n[0];return function(e,t,n){return r(i(e,t,n))}}if(2===n.length){var a=n[0],o=n[1];return function(e,t,n){return r(a(e,t,n),o(e,t,n))}}return function(e,t,i){return r.apply(null,wn(n,(function(r){return r(e,t,i)})))}}},{key:"forEach",value:function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}},{key:"map",value:function(e){for(var t=[],r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new a(this.op,this.fn,t,this.implicit,this.isPercentage)}},{key:"clone",value:function(){return new a(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}},{key:"isUnary",value:function(){return 1===this.args.length}},{key:"isBinary",value:function(){return 2===this.args.length}},{key:"_toString",value:function(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(1===i.length){var o=Mp(this,t),u=i[0].toString(e);a[0]&&(u="("+u+")");var s=/[a-zA-Z]+/.test(this.op);return"right"===o?this.op+(s?" ":"")+u:"left"===o?u+(s?" ":"")+this.op:u+this.op}if(2===i.length){var c=i[0].toString(e),f=i[1].toString(e);return a[0]&&(c="("+c+")"),a[1]&&(f="("+f+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c+" "+f:c+" "+this.op+" "+f}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var l=i.map((function(t,r){return t=t.toString(e),a[r]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l.join(" "):l.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}},{key:"toJSON",value:function(){return{mathjs:Qp,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}},{key:"toHTML",value:function(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(1===i.length){var o=Mp(this,t),u=i[0].toHTML(e);return a[0]&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===o?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Kr(this.op)+"</span>"+u:u+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Kr(this.op)+"</span>"}if(2===i.length){var s=i[0].toHTML(e),c=i[1].toHTML(e);return a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?s+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:s+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Kr(this.op)+"</span>"+c}var f=i.map((function(t,r){return t=t.toHTML(e),a[r]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?f.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):f.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Kr(this.op)+"</span>"):'<span class="math-function">'+Kr(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+f.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}},{key:"_toTex",value:function(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=qp[this.fn];if(o=void 0===o?this.op:o,1===i.length){var u=Mp(this,t),s=i[0].toTex(e);return a[0]&&(s="\\left(".concat(s,"\\right)")),"right"===u?o+s:s+o}if(2===i.length){var c=i[0],f=c.toTex(e);a[0]&&(f="\\left(".concat(f,"\\right)"));var l,p=i[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),l="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+f+"}{"+p+"}";case"OperatorNode:pow":switch(f="{"+f+"}",p="{"+p+"}",l){case"ConditionalNode":case"OperatorNode:divide":f="\\left(".concat(f,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return f+"~"+p}return f+o+p}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=i.map((function(t,r){return t=t.toTex(e),a[r]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===n?m.join("~"):m.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(t){return t.toTex(e)})).join(",")+"\\right)"}},{key:"getIdentifier",value:function(){return this.type+":"+this.fn}}],[{key:"fromJSON",value:function(e){return new a(e.op,e.fn,e.args,e.implicit,e.isPercentage)}}]),a}(e.Node);return Ua(n,"name",Qp),n}),{isClass:!0,isNode:!0});var em="ParenthesisNode",tm=Ee(em,["Node"],(function(e){var t=function(e){dp(i,e);var t,r,n=(t=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=yp(t);if(r){var i=yp(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return vp(this,e)});function i(e){var t;if(Ce(this,i),t=n.call(this),!R(e))throw new TypeError('Node expected for parameter "content"');return t.content=e,t}return Oe(i,[{key:"type",get:function(){return em}},{key:"isParenthesisNode",get:function(){return!0}},{key:"_compile",value:function(e,t){return this.content._compile(e,t)}},{key:"getContent",value:function(){return this.content.getContent()}},{key:"forEach",value:function(e){e(this.content,"content",this)}},{key:"map",value:function(e){return new i(e(this.content,"content",this))}},{key:"clone",value:function(){return new i(this.content)}},{key:"_toString",value:function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}},{key:"toJSON",value:function(){return{mathjs:em,content:this.content}}},{key:"toHTML",value:function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)}},{key:"_toTex",value:function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)}}],[{key:"fromJSON",value:function(e){return new i(e.content)}}]),i}(e.Node);return Ua(t,"name",em),t}),{isClass:!0,isNode:!0});var rm="RangeNode",nm=Ee(rm,["Node"],(function(e){function t(e,t,r){var n=Cp(e,t,r),i={},a=Cp(e.start,t,r);if(i.start=null!==a&&a<=n||"all"===t,e.step){var o=Cp(e.step,t,r);i.step=null!==o&&o<=n||"all"===t}var u=Cp(e.end,t,r);return i.end=null!==u&&u<=n||"all"===t,i}var r=function(e){dp(a,e);var r,n,i=(r=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yp(r);if(n){var i=yp(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return vp(this,e)});function a(e,t,r){var n;if(Ce(this,a),n=i.call(this),!R(e))throw new TypeError("Node expected");if(!R(t))throw new TypeError("Node expected");if(r&&!R(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");return n.start=e,n.end=t,n.step=r||null,n}return Oe(a,[{key:"type",get:function(){return rm}},{key:"isRangeNode",get:function(){return!0}},{key:"needsEnd",value:function(){return this.filter((function(e){return U(e)&&"end"===e.name})).length>0}},{key:"_compile",value:function(e,t){var r=e.range,n=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 r(n(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return r(n(e,t,a),i(e,t,a))}}},{key:"forEach",value:function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}},{key:"map",value:function(e){return new a(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}},{key:"clone",value:function(){return new a(this.start,this.end,this.step&&this.step)}},{key:"_toString",value:function(e){var r,n=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toString(e);if(n.start&&(i="("+i+")"),r=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),r+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),r+":"+o}},{key:"toJSON",value:function(){return{mathjs:rm,start:this.start,end:this.end,step:this.step}}},{key:"toHTML",value:function(e){var r,n=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toHTML(e);if(n.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r=i,this.step){var a=this.step.toHTML(e);n.step&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+='<span class="math-operator math-range-operator">:</span>'+a}var o=this.end.toHTML(e);return n.end&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-range-operator">:</span>'+o}},{key:"_toTex",value:function(e){var r=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),n=this.start.toTex(e);if(r.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);r.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return r.end&&(a="\\left(".concat(a,"\\right)")),n+":"+a}}],[{key:"fromJSON",value:function(e){return new a(e.start,e.end,e.step)}}]),a}(e.Node);return Ua(r,"name",rm),r}),{isClass:!0,isNode:!0});var im="RelationalNode",am=Ee(im,["Node"],(function(e){var t=e.Node,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},n=function(e){dp(a,e);var t,n,i=(t=a,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=yp(t);if(n){var i=yp(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return vp(this,e)});function a(e,t){var r;if(Ce(this,a),r=i.call(this),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");return r.conditionals=e,r.params=t,r}return Oe(a,[{key:"type",get:function(){return im}},{key:"isRelationalNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this,n=this.params.map((function(r){return r._compile(e,t)}));return function(t,i,a){for(var o,u=n[0](t,i,a),s=0;s<r.conditionals.length;s++)if(o=u,u=n[s+1](t,i,a),!Te(e,r.conditionals[s])(o,u))return!1;return!0}}},{key:"forEach",value:function(e){var t=this;this.params.forEach((function(r,n){return e(r,"params["+n+"]",t)}),this)}},{key:"map",value:function(e){var t=this;return new a(this.conditionals.slice(),this.params.map((function(r,n){return t._ifNode(e(r,"params["+n+"]",t))}),this))}},{key:"clone",value:function(){return new a(this.conditionals,this.params)}},{key:"_toString",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Cp(this,t,e&&e.implicit),i=this.params.map((function(r,i){var a=Cp(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?"("+r.toString(e)+")":r.toString(e)})),a=i[0],o=0;o<this.conditionals.length;o++)a+=" "+r[this.conditionals[o]],a+=" "+i[o+1];return a}},{key:"toJSON",value:function(){return{mathjs:im,conditionals:this.conditionals,params:this.params}}},{key:"toHTML",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=Cp(this,t,e&&e.implicit),i=this.params.map((function(r,i){var a=Cp(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)})),a=i[0],o=0;o<this.conditionals.length;o++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Kr(r[this.conditionals[o]])+"</span>"+i[o+1];return a}},{key:"_toTex",value:function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=Cp(this,t,e&&e.implicit),n=this.params.map((function(n,i){var a=Cp(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)})),i=n[0],a=0;a<this.conditionals.length;a++)i+=qp[this.conditionals[a]]+n[a+1];return i}}],[{key:"fromJSON",value:function(e){return new a(e.conditionals,e.params)}}]),a}(t);return Ua(n,"name",im),n}),{isClass:!0,isNode:!0});var om=Ee("SymbolNode",["math","?Unit","Node"],(function(e){var t=e.math,r=e.Unit;function n(e){return!!r&&r.isValuelessUnit(e)}var i=function(e){dp(u,e);var i,a,o=(i=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yp(i);if(a){var r=yp(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return vp(this,e)});function u(e){var t;if(Ce(this,u),t=o.call(this),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');return t.name=e,t}return Oe(u,[{key:"type",get:function(){return"SymbolNode"}},{key:"isSymbolNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var i=this.name;if(!0===t[i])return function(e,t,r){return Te(t,i)};if(i in e)return function(t,r,n){return t.has(i)?t.get(i):Te(e,i)};var a=n(i);return function(e,t,n){return e.has(i)?e.get(i):a?new r(null,i):u.onUndefinedSymbol(i)}}},{key:"forEach",value:function(e){}},{key:"map",value:function(e){return this.clone()}},{key:"clone",value:function(){return new u(this.name)}},{key:"_toString",value:function(e){return this.name}},{key:"toHTML",value:function(e){var t=Kr(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"}},{key:"toJSON",value:function(){return{mathjs:"SymbolNode",name:this.name}}},{key:"_toTex",value:function(e){var r=!1;void 0===t[this.name]&&n(this.name)&&(r=!0);var i=Up(this.name,r);return"\\"===i[0]?i:" "+i}}],[{key:"onUndefinedSymbol",value:function(e){throw new Error("Undefined symbol "+e)}},{key:"fromJSON",value:function(e){return new u(e.name)}}]),u}(e.Node);return i}),{isClass:!0,isNode:!0});function um(){return um="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=yp(e)););return e}(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},um.apply(this,arguments)}function sm(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return"function"==typeof e.createSubScope?He.apply(void 0,[e.createSubScope()].concat(r)):He.apply(void 0,[Le(),e].concat(r))}var cm="FunctionNode",fm=Ee(cm,["math","Node","SymbolNode"],(function(e){var r,n=e.math,i=e.Node,a=e.SymbolNode,o=function(e){return Jr(e,{truncate:78})};function u(e,r,n){for(var i,a="",o=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,u=0;null!==(i=o.exec(e));)if(a+=e.substring(u,i.index),u=i.index,"$$"===i[0])a+="$",u++;else{u+=i[0].length;var s=r[i[1]];if(!s)throw new ReferenceError("Template: Property "+i[1]+" does not exist.");if(void 0===i[2])switch(t(s)){case"string":a+=s;break;case"object":if(R(s))a+=s.toTex(n);else{if(!Array.isArray(s))throw new TypeError("Template: "+i[1]+" has to be a Node, String or array of Nodes");a+=s.map((function(e,t){if(R(e))return e.toTex(n);throw new TypeError("Template: "+i[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+i[1]+" has to be a Node, String or array of Nodes")}else{if(!R(s[i[2]]&&s[i[2]]))throw new TypeError("Template: "+i[1]+"["+i[2]+"] is not a Node.");a+=s[i[2]].toTex(n)}}return a+e.slice(u)}var s=function(e){dp(c,e);var r,i,s=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yp(r);if(i){var n=yp(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vp(this,e)});function c(e,t){var r;if(Ce(this,c),r=s.call(this),"string"==typeof e&&(e=new a(e)),!R(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(R))throw new TypeError('Array containing Nodes expected for parameter "args"');return r.fn=e,r.args=t||[],r}return Oe(c,[{key:"name",get:function(){return this.fn.name||""}},{key:"type",get:function(){return cm}},{key:"isFunctionNode",get:function(){return!0}},{key:"_compile",value:function(e,t){var r=this.args.map((function(r){return r._compile(e,t)}));if(!U(this.fn)){if(S(this.fn)&&I(this.fn.index)&&this.fn.index.isObjectProperty()){var n=this.fn.object._compile(e,t),i=this.fn.index.getObjectProperty(),a=this.args;return function(t,o,u){var s=n(t,o,u),c=function(e,t){if(!ke(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(s,i);if(null!=c&&c.rawArgs)return c(a,e,sm(t,o),t);var f=r.map((function(e){return e(t,o,u)}));return c.apply(s,f)}}var u=this.fn.toString(),s=this.fn._compile(e,t),f=this.args;return function(t,n,i){var a=s(t,n,i);if("function"!=typeof a)throw new TypeError("Expression '".concat(u,"' did not evaluate to a function; value is:")+"\n ".concat(o(a)));if(a.rawArgs)return a(f,e,sm(t,n),t);var c=r.map((function(e){return e(t,n,i)}));return a.apply(a,c)}}var l=this.fn.name;if(t[l]){var p=this.args;return function(t,n,i){var a=Te(n,l);if("function"!=typeof a)throw new TypeError("Argument '".concat(l,"' was not a function; received: ").concat(o(a)));if(a.rawArgs)return a(p,e,sm(t,n),t);var u=r.map((function(e){return e(t,n,i)}));return a.apply(a,u)}}var m=l in e?Te(e,l):void 0,h="function"==typeof m&&!0===m.rawArgs,d=function(t){var r;if(t.has(l))r=t.get(l);else{if(!(l in e))return c.onUndefinedFunction(l);r=Te(e,l)}if("function"==typeof r)return r;throw new TypeError("'".concat(l,"' is not a function; its value is:\n ").concat(o(r)))};if(h){var v=this.args;return function(t,r,n){return d(t)(v,e,sm(t,r),t)}}switch(r.length){case 0:return function(e,t,r){return d(e)()};case 1:return function(e,t,n){return d(e)((0,r[0])(e,t,n))};case 2:return function(e,t,n){var i=d(e),a=r[0],o=r[1];return i(a(e,t,n),o(e,t,n))};default:return function(e,t,n){var i=d(e),a=r.map((function(r){return r(e,t,n)}));return i.apply(void 0,Vr(a))}}}},{key:"forEach",value:function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}},{key:"map",value:function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new c(t,r)}},{key:"clone",value:function(){return new c(this.fn,this.args.slice(0))}},{key:"toString",value:function(e){var r,n=this.fn.toString(e);return e&&"object"===t(e.handler)&&Ne(e.handler,n)&&(r=e.handler[n](this,e)),void 0!==r?r:um(yp(c.prototype),"toString",this).call(this,e)}},{key:"_toString",value:function(e){var t=this.args.map((function(t){return t.toString(e)}));return(_(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}},{key:"toJSON",value:function(){return{mathjs:cm,fn:this.fn,args:this.args}}},{key:"toHTML",value:function(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+Kr(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>'}},{key:"toTex",value:function(e){var r;return e&&"object"===t(e.handler)&&Ne(e.handler,this.name)&&(r=e.handler[this.name](this,e)),void 0!==r?r:um(yp(c.prototype),"toTex",this).call(this,e)}},{key:"_toTex",value:function(e){var r,i,a=this.args.map((function(t){return t.toTex(e)}));switch(jp[this.name]&&(r=jp[this.name]),!n[this.name]||"function"!=typeof n[this.name].toTex&&"object"!==t(n[this.name].toTex)&&"string"!=typeof n[this.name].toTex||(r=n[this.name].toTex),t(r)){case"function":i=r(this,e);break;case"string":i=u(r,this,e);break;case"object":switch(t(r[a.length])){case"function":i=r[a.length](this,e);break;case"string":i=u(r[a.length],this,e)}}return void 0!==i?i:u("\\mathrm{${name}}\\left(${args}\\right)",this,e)}},{key:"getIdentifier",value:function(){return this.type+":"+this.name}}]),c}(i);return r=s,Ua(s,"name",cm),Ua(s,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),Ua(s,"fromJSON",(function(e){return new r(e.fn,e.args)})),s}),{isClass:!0,isNode:!0}),lm="parse",pm=Ee(lm,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(function(e){var t=e.typed,r=e.numeric,n=e.config,i=e.AccessorNode,a=e.ArrayNode,o=e.AssignmentNode,u=e.BlockNode,s=e.ConditionalNode,c=e.ConstantNode,f=e.FunctionAssignmentNode,l=e.FunctionNode,p=e.IndexNode,m=e.ObjectNode,h=e.OperatorNode,d=e.ParenthesisNode,v=e.RangeNode,y=e.RelationalNode,g=e.SymbolNode,x=t(lm,{string:function(e){return L(e,{})},"Array | Matrix":function(e){return b(e,{})},"string, Object":function(e,t){return L(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":b});function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return Hn(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return L(e,r)}))}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!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},D={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},E={true:!0,false:!1,null:null,undefined:void 0},A=["NaN","Infinity"],C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function M(e,t){return e.expression.substr(e.index,t)}function F(e){return M(e,1)}function O(e){e.index++}function _(e){return e.expression.charAt(e.index-1)}function I(e){return e.expression.charAt(e.index+1)}function R(e){for(e.tokenType=w.NULL,e.token="",e.comment="";;){if("#"===F(e))for(;"\n"!==F(e)&&""!==F(e);)e.comment+=F(e),O(e);if(!x.isWhitespace(F(e),e.nestingLevel))break;O(e)}if(""!==F(e)){if("\n"===F(e)&&!e.nestingLevel)return e.tokenType=w.DELIMITER,e.token=F(e),void O(e);var t=F(e),r=M(e,2),n=M(e,3);if(3===n.length&&N[n])return e.tokenType=w.DELIMITER,e.token=n,O(e),O(e),void O(e);if(2===r.length&&N[r])return e.tokenType=w.DELIMITER,e.token=r,O(e),void O(e);if(N[t])return e.tokenType=w.DELIMITER,e.token=t,void O(e);if(x.isDigitDot(t)){e.tokenType=w.NUMBER;var i=M(e,2);if("0b"===i||"0o"===i||"0x"===i){for(e.token+=F(e),O(e),e.token+=F(e),O(e);x.isHexDigit(F(e));)e.token+=F(e),O(e);if("."===F(e))for(e.token+=".",O(e);x.isHexDigit(F(e));)e.token+=F(e),O(e);else if("i"===F(e))for(e.token+="i",O(e);x.isDigit(F(e));)e.token+=F(e),O(e);return}if("."===F(e)){if(e.token+=F(e),O(e),!x.isDigit(F(e)))return void(e.tokenType=w.DELIMITER)}else{for(;x.isDigit(F(e));)e.token+=F(e),O(e);x.isDecimalMark(F(e),I(e))&&(e.token+=F(e),O(e))}for(;x.isDigit(F(e));)e.token+=F(e),O(e);if("E"===F(e)||"e"===F(e))if(x.isDigit(I(e))||"-"===I(e)||"+"===I(e)){if(e.token+=F(e),O(e),"+"!==F(e)&&"-"!==F(e)||(e.token+=F(e),O(e)),!x.isDigit(F(e)))throw ce(e,'Digit expected, got "'+F(e)+'"');for(;x.isDigit(F(e));)e.token+=F(e),O(e);if(x.isDecimalMark(F(e),I(e)))throw ce(e,'Digit expected, got "'+F(e)+'"')}else if("."===I(e))throw O(e),ce(e,'Digit expected, got "'+F(e)+'"')}else{if(!x.isAlpha(F(e),_(e),I(e))){for(e.tokenType=w.UNKNOWN;""!==F(e);)e.token+=F(e),O(e);throw ce(e,'Syntax error in part "'+e.token+'"')}for(;x.isAlpha(F(e),_(e),I(e))||x.isDigit(F(e));)e.token+=F(e),O(e);Ne(D,e.token)?e.tokenType=w.DELIMITER:e.tokenType=w.SYMBOL}}else e.tokenType=w.DELIMITER}function z(e){do{R(e)}while("\n"===e.token)}function j(e){e.nestingLevel++}function P(e){e.nestingLevel--}function L(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null};$r(r,{expression:e,extraNodes:t}),R(r);var n=function(e){var t,r,n=[];for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=$(e),e.comment&&(t.comment=e.comment));"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),R(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=$(e),e.comment&&(t.comment=e.comment),r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new u(n):(t||(t=new c(void 0),e.comment&&(t.comment=e.comment)),t)}(r);if(""!==r.token)throw r.tokenType===w.DELIMITER?fe(r,"Unexpected operator "+r.token):ce(r,'Unexpected part "'+r.token+'"');return n}function $(e){var t,r,n,i,a=function(e){for(var t=function(e){for(var t=H(e);"or"===e.token;)z(e),t=new h("or","or",[t,H(e)]);return t}(e);"?"===e.token;){var r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,z(e);var n=t,i=$(e);if(":"!==e.token)throw ce(e,"False part of conditional expression expected");e.conditionalLevel=null,z(e);var a=$(e);t=new s(n,i,a),e.conditionalLevel=r}return t}(e);if("="===e.token){if(U(a))return t=a.name,z(e),n=$(e),new o(new g(t),n);if(S(a))return z(e),n=$(e),new o(a.object,a.index,n);if(k(a)&&U(a.fn)&&(i=!0,r=[],t=a.name,a.args.forEach((function(e,t){U(e)?r[t]=e.name:i=!1})),i))return z(e),n=$(e),new f(t,r,n);throw ce(e,"Invalid left hand side of assignment operator =")}return a}function H(e){for(var t=G(e);"xor"===e.token;)z(e),t=new h("xor","xor",[t,G(e)]);return t}function G(e){for(var t=V(e);"and"===e.token;)z(e),t=new h("and","and",[t,V(e)]);return t}function V(e){for(var t=Z(e);"|"===e.token;)z(e),t=new h("|","bitOr",[t,Z(e)]);return t}function Z(e){for(var t=W(e);"^|"===e.token;)z(e),t=new h("^|","bitXor",[t,W(e)]);return t}function W(e){for(var t=Y(e);"&"===e.token;)z(e),t=new h("&","bitAnd",[t,Y(e)]);return t}function Y(e){for(var t=[J(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Ne(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),z(e),t.push(J(e))}return 1===t.length?t[0]:2===t.length?new h(r[0].name,r[0].fn,t):new y(r.map((function(e){return e.fn})),t)}function J(e){var t,r,n,i;t=X(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Ne(a,e.token);)n=a[r=e.token],z(e),i=[t,X(e)],t=new h(r,n,i);return t}function X(e){var t,r,n,i;t=Q(e);for(var a={to:"to",in:"to"};Ne(a,e.token);)n=a[r=e.token],z(e),"in"===r&&""===e.token?t=new h("*","multiply",[t,new g("in")],!0):(i=[t,Q(e)],t=new h(r,n,i));return t}function Q(e){var t,r=[];if(t=":"===e.token?new c(1):K(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)z(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new g("end")):r.push(K(e));t=3===r.length?new v(r[0],r[2],r[1]):new v(r[0],r[1])}return t}function K(e){var t,r,n,i;t=ee(e);for(var a={"+":"add","-":"subtract"};Ne(a,e.token);){n=a[r=e.token],z(e);var o=ee(e);i=o.isPercentage?[t,new h("*","multiply",[t,o])]:[t,o],t=new h(r,n,i)}return t}function ee(e){var t,r,n,i;r=t=te(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};Ne(a,e.token);)i=a[n=e.token],z(e),r=te(e),t=new h(n,i,[t,r]);return t}function te(e){var t,r;for(r=t=re(e);e.tokenType===w.SYMBOL||"in"===e.token&&T(t)||!(e.tokenType!==w.NUMBER||T(r)||q(r)&&"!"!==r.op)||"("===e.token;)r=re(e),t=new h("*","multiply",[t,r],!0);return t}function re(e){for(var t=ne(e),r=t,n=[];"/"===e.token&&B(r);){if(n.push($r({},e)),z(e),e.tokenType!==w.NUMBER){$r(e,n.pop());break}if(n.push($r({},e)),z(e),e.tokenType!==w.SYMBOL&&"("!==e.token){n.pop(),$r(e,n.pop());break}$r(e,n.pop()),n.pop(),r=ne(e),t=new h("/","divide",[t,r])}return t}function ne(e){var t,r,n,i;t=ie(e);for(var a={"%":"mod",mod:"mod"};Ne(a,e.token);)n=a[r=e.token],z(e),"%"===r&&e.tokenType===w.DELIMITER&&"("!==e.token?t=new h("/","divide",[t,new c(100)],!1,!0):(i=[t,ie(e)],t=new h(r,n,i));return t}function ie(e){var t,i,o,u={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Ne(u,e.token)?(o=u[e.token],t=e.token,z(e),i=[ie(e)],new h(t,o,i)):function(e){var t,i,o,u;return t=function(e){var t,i,o;t=function(e){var t=[];if(e.tokenType===w.SYMBOL&&Ne(e.extraNodes,e.token)){var i=e.extraNodes[e.token];if(R(e),"("===e.token){if(t=[],j(e),R(e),")"!==e.token)for(t.push($(e));","===e.token;)R(e),t.push($(e));if(")"!==e.token)throw ce(e,"Parenthesis ) expected");P(e),R(e)}return new i(t)}return function(e){var t;return e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in D?(t=e.token,R(e),ae(e,Ne(E,t)?new c(E[t]):-1!==A.indexOf(t)?new c(r(t,"number")):new g(t))):function(e){var t;return'"'===e.token||"'"===e.token?(t=oe(e,e.token),ae(e,new c(t))):function(e){var t,i,o,u;if("["===e.token){if(j(e),R(e),"]"!==e.token){var s=ue(e);if(";"===e.token){for(o=1,i=[s];";"===e.token;)R(e),i[o]=ue(e),o++;if("]"!==e.token)throw ce(e,"End of matrix ] expected");P(e),R(e),u=i[0].items.length;for(var f=1;f<o;f++)if(i[f].items.length!==u)throw fe(e,"Column dimensions mismatch ("+i[f].items.length+" !== "+u+")");t=new a(i)}else{if("]"!==e.token)throw ce(e,"End of matrix ] expected");P(e),R(e),t=s}}else P(e),R(e),t=new a([]);return ae(e,t)}return function(e){if("{"===e.token){var t;j(e);var i={};do{if(R(e),"}"!==e.token){if('"'===e.token||"'"===e.token)t=oe(e,e.token);else{if(!(e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in D))throw ce(e,"Symbol or string expected as object key");t=e.token,R(e)}if(":"!==e.token)throw ce(e,"Colon : expected after object key");R(e),i[t]=$(e)}}while(","===e.token);if("}"!==e.token)throw ce(e,"Comma , or bracket } expected after object value");P(e),R(e);var a=new m(i);return ae(e,a)}return function(e){var t;return e.tokenType===w.NUMBER?(t=e.token,R(e),new c(r(t,n.number))):function(e){var t;if("("===e.token){if(j(e),R(e),t=$(e),")"!==e.token)throw ce(e,"Parenthesis ) expected");return P(e),R(e),ae(e,t=new d(t))}return function(e){throw""===e.token?ce(e,"Unexpected end of expression"):ce(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);for(var u={"!":"factorial","'":"ctranspose"};Ne(u,e.token);)o=u[i=e.token],R(e),t=ae(e,t=new h(i,o,[t]));return t}(e),("^"===e.token||".^"===e.token)&&(o="^"===(i=e.token)?"pow":"dotPow",z(e),u=[t,ie(e)],t=new h(i,o,u)),t}(e)}function ae(e,t,r){for(var n;!("("!==e.token&&"["!==e.token&&"."!==e.token||r&&-1===r.indexOf(e.token));)if(n=[],"("===e.token){if(!U(t)&&!S(t))return t;if(j(e),R(e),")"!==e.token)for(n.push($(e));","===e.token;)R(e),n.push($(e));if(")"!==e.token)throw ce(e,"Parenthesis ) expected");P(e),R(e),t=new l(t,n)}else if("["===e.token){if(j(e),R(e),"]"!==e.token)for(n.push($(e));","===e.token;)R(e),n.push($(e));if("]"!==e.token)throw ce(e,"Parenthesis ] expected");P(e),R(e),t=new i(t,new p(n))}else{if(R(e),!(e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in D))throw ce(e,"Property name expected after dot");n.push(new c(e.token)),R(e),t=new i(t,new p(n,!0))}return t}function oe(e,t){for(var r="";""!==F(e)&&F(e)!==t;)if("\\"===F(e)){O(e);var n=F(e),i=C[n];if(void 0!==i)r+=i,e.index+=1;else{if("u"!==n)throw ce(e,"Bad escape character \\".concat(n));var a=e.expression.slice(e.index+1,e.index+5);if(!/^[0-9A-Fa-f]{4}$/.test(a))throw ce(e,"Invalid unicode character \\u".concat(a));r+=String.fromCharCode(parseInt(a,16)),e.index+=5}}else r+=F(e),O(e);if(R(e),e.token!==t)throw ce(e,"End of string ".concat(t," expected"));return R(e),r}function ue(e){for(var t=[$(e)],r=1;","===e.token;)R(e),t[r]=$(e),r++;return new a(t)}function se(e){return e.index-e.token.length+1}function ce(e,t){var r=se(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}function fe(e,t){var r=se(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}return x.isAlpha=function(e,t,r){return x.isValidLatinOrGreek(e)||x.isValidMathSymbol(e,r)||x.isValidMathSymbol(t,e)},x.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},x.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)},x.isWhitespace=function(e,t){return" "===e||"\t"===e||"\n"===e&&t>0},x.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},x.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},x.isDigit=function(e){return e>="0"&&e<="9"},x.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},t.addConversion({from:"string",to:"Node",convert:x}),x})),mm="compile",hm=Ee(mm,["typed","parse"],(function(e){var t=e.typed,r=e.parse;return t(mm,{string:function(e){return r(e).compile()},"Array | Matrix":function(e){return Hn(e,(function(e){return r(e).compile()}))}})})),dm="evaluate",vm=Ee(dm,["typed","parse"],(function(e){var t=e.typed,r=e.parse;return t(dm,{string:function(e){var t=Le();return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=Le();return Hn(e,(function(e){return r(e).compile().evaluate(t)}))},"Array | Matrix, Map | Object":function(e,t){return Hn(e,(function(e){return r(e).compile().evaluate(t)}))}})})),ym=Ee("Parser",["evaluate"],(function(e){var t=e.evaluate;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Le(),writable:!1})}return 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 function(e){if(e instanceof Pe)return e.wrappedObject;var t,r={},n=qe(e.keys());try{for(n.s();!(t=n.n()).done;){var i=t.value;Be(r,i,e.get(i))}}catch(e){n.e(e)}finally{n.f()}return r}(this.scope)},r.prototype.getAllAsMap=function(){return this.scope},r.prototype.set=function(e,t){return this.scope.set(e,t),t},r.prototype.remove=function(e){this.scope.delete(e)},r.prototype.clear=function(){this.scope.clear()},r}),{isClass:!0}),gm="parser",xm=Ee(gm,["typed","Parser"],(function(e){var t=e.typed,r=e.Parser;return t(gm,{"":function(){return new r}})})),bm=Ee("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(function(e){var t=e.typed,r=e.matrix,n=e.abs,i=e.addScalar,a=e.divideScalar,o=e.multiplyScalar,u=e.subtractScalar,s=e.larger,c=e.equalScalar,f=e.unaryMinus,l=e.DenseMatrix,p=e.SparseMatrix,m=e.Spa;return t("lup",{DenseMatrix:function(e){return h(e)},SparseMatrix:function(e){return function(e){var t,r,i,u=e._size[0],l=e._size[1],h=Math.min(u,l),d=e._values,v=e._index,y=e._ptr,g=[],x=[],b=[],w=[u,h],N=[],D=[],E=[],A=[h,l],S=[],C=[];for(t=0;t<u;t++)S[t]=t,C[t]=t;var M=function(){var e=new m;r<u&&(b.push(g.length),g.push(1),x.push(r)),E.push(N.length);var l=y[r],h=y[r+1];for(i=l;i<h;i++)t=v[i],e.set(S[t],d[i]);r>0&&e.forEach(0,r-1,(function(t,r){p._forEachRow(t,g,x,b,(function(n,i){n>t&&e.accumulate(n,f(o(i,r)))}))}));var M,F,O,T,B=r,_=e.get(r),k=n(_);e.forEach(r+1,u-1,(function(e,t){var r=n(t);s(r,k)&&(B=e,k=r,_=t)})),r!==B&&(p._swapRows(r,B,w[1],g,x,b),p._swapRows(r,B,A[1],N,D,E),e.swap(r,B),F=B,O=C[M=r],T=C[F],S[O]=F,S[T]=M,C[M]=T,C[F]=O),e.forEach(0,u-1,(function(e,t){e<=r?(N.push(t),D.push(e)):(t=a(t,_),c(t,0)||(g.push(t),x.push(e)))}))};for(r=0;r<l;r++)M();return E.push(N.length),b.push(g.length),{L:new p({values:g,index:x,ptr:b,size:w}),U:new p({values:N,index:D,ptr:E,size:A}),p:S,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}(e)},Array:function(e){var t=h(r(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function h(e){var t,r,f,p=e._size[0],m=e._size[1],h=Math.min(p,m),d=he(e._data),v=[],y=[p,h],g=[],x=[h,m],b=[];for(t=0;t<p;t++)b[t]=t;for(r=0;r<m;r++){if(r>0)for(t=0;t<p;t++){var w=Math.min(t,r),N=0;for(f=0;f<w;f++)N=i(N,o(d[t][f],d[f][r]));d[t][r]=u(d[t][r],N)}var D=r,E=0,A=0;for(t=r;t<p;t++){var S=d[t][r],C=n(S);s(C,E)&&(D=t,E=C,A=S)}if(r!==D&&(b[r]=[b[D],b[D]=b[r]][0],l._swapRows(r,D,d)),r<p)for(t=r+1;t<p;t++){var M=d[t][r];c(M,0)||(d[t][r]=a(d[t][r],A))}}for(r=0;r<m;r++)for(t=0;t<p;t++)0===r&&(t<m&&(g[t]=[]),v[t]=[]),t<r?(t<m&&(g[t][r]=d[t][r]),r<p&&(v[t][r]=0)):t!==r?(t<m&&(g[t][r]=0),r<p&&(v[t][r]=d[t][r])):(t<m&&(g[t][r]=d[t][r]),r<p&&(v[t][r]=1));var F=new l({data:v,size:y}),O=new l({data:g,size:x}),T=[];for(t=0,h=b.length;t<h;t++)T[b[t]]=t;return{L:F,U:O,p:T,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}})),wm=Ee("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.identity,a=e.isZero,o=e.equal,u=e.sign,s=e.sqrt,c=e.conj,f=e.unaryMinus,l=e.addScalar,p=e.divideScalar,m=e.multiplyScalar,h=e.subtractScalar,d=e.complex;return $r(t("qr",{DenseMatrix:function(e){return y(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=y(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:v});function v(e){var t,r,d,v=e._size[0],y=e._size[1],g=i([v],"dense"),x=g._data,b=e.clone(),w=b._data,N=n([v],"");for(d=0;d<Math.min(y,v);++d){var D=w[d][d],E=f(o(D,0)?1:u(D)),A=c(E),S=0;for(t=d;t<v;t++)S=l(S,m(w[t][d],c(w[t][d])));var C=m(E,s(S));if(!a(C)){var M=h(D,C);for(N[d]=1,t=d+1;t<v;t++)N[t]=p(w[t][d],M);var F=f(c(p(M,C))),O=void 0;for(r=d;r<y;r++){for(O=0,t=d;t<v;t++)O=l(O,m(c(N[t]),w[t][r]));for(O=m(O,F),t=d;t<v;t++)w[t][r]=m(h(w[t][r],m(N[t],O)),A)}for(t=0;t<v;t++){for(O=0,r=d;r<v;r++)O=l(O,m(x[t][r],N[r]));for(O=m(O,F),r=d;r<v;++r)x[t][r]=p(h(x[t][r],m(O,c(N[r]))),A)}}}return{Q:g,R:b,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function y(e){var t=v(e),r=t.R._data;if(e._data.length>0)for(var n="Complex"===r[0][0].type?d(0):0,i=0;i<r.length;++i)for(var a=0;a<i&&a<(r[0]||[]).length;++a)r[i][a]=n;return t}}));function Nm(e,t,r,n,i,a,o){var u=0;for(r[o]=e;u>=0;){var s=r[o+u],c=r[n+s];-1===c?(u--,a[t++]=s):(r[n+s]=r[i+c],r[o+ ++u]=c)}return t}function Dm(e){return-e-2}var Em=Ee("csAmd",["add","multiply","transpose"],(function(e){var t=e.add,r=e.multiply,n=e.transpose;return function(e,o){if(!o||e<=0||e>3)return null;var u=o._size,s=u[0],c=u[1],f=0,l=Math.max(16,10*Math.sqrt(c)),p=function(e,i,a,o,u){var s=n(i);if(1===e&&o===a)return t(i,s);if(2===e){for(var c=s._index,f=s._ptr,l=0,p=0;p<a;p++){var m=f[p];if(f[p]=l,!(f[p+1]-m>u))for(var h=f[p+1];m<h;m++)c[l++]=c[m]}return f[a]=l,i=n(s),r(s,i)}return r(s,i)}(e,o,s,c,l=Math.min(c-2,l));!function(e,t,r){for(var n=e._values,i=e._index,a=e._ptr,o=e._size[1],u=0,s=0;s<o;s++){var c=a[s];for(a[s]=u;c<a[s+1];c++)t(i[c],s,n?n[c]:1,null)&&(i[u]=i[c],n&&(n[u]=n[c]),u++)}a[o]=u,i.splice(u,i.length-u),n&&n.splice(u,n.length-u)}(p,a);for(var m,h,d,v,y,g,x,b,w,N,D,E,A,S,C,M,F=p._index,O=p._ptr,T=O[c],B=[],_=[],k=c+1,I=2*(c+1),R=3*(c+1),z=4*(c+1),q=5*(c+1),j=6*(c+1),P=7*(c+1),L=B,U=function(e,t,r,n,a,o,u,s,c,f,l,p){for(var m=0;m<e;m++)r[0+m]=t[m+1]-t[m];r[0+e]=0;for(var h=0;h<=e;h++)r[a+h]=-1,o[h]=-1,r[u+h]=-1,r[s+h]=-1,r[c+h]=1,r[f+h]=1,r[l+h]=0,r[p+h]=r[0+h];var d=i(0,0,r,f,e);return r[l+e]=-2,t[e]=-1,r[f+e]=0,d}(c,O,_,0,R,L,I,P,k,j,z,q),$=function(e,t,r,n,i,a,o,u,s,c,f){for(var l=0,p=0;p<e;p++){var m=r[n+p];if(0===m)r[i+p]=-2,l++,t[p]=-1,r[a+p]=0;else if(m>o)r[u+p]=0,r[i+p]=-1,l++,t[p]=Dm(e),r[u+e]++;else{var h=r[s+m];-1!==h&&(c[h]=p),r[f+p]=r[s+m],r[s+m]=p}}return l}(c,O,_,q,z,j,l,k,R,L,I),H=0;$<c;){for(d=-1;H<c&&-1===(d=_[R+H]);H++);-1!==_[I+d]&&(L[_[I+d]]=-1),_[R+H]=_[I+d];var G=_[z+d],V=_[k+d];$+=V;var Z=0;_[k+d]=-V;var W=O[d],Y=0===G?W:T,J=Y;for(v=1;v<=G+1;v++){for(v>G?(g=d,x=W,b=_[0+d]-G):(x=O[g=F[W++]],b=_[0+g]),y=1;y<=b;y++)(w=_[k+(m=F[x++])])<=0||(Z+=w,_[k+m]=-w,F[J++]=m,-1!==_[I+m]&&(L[_[I+m]]=L[m]),-1!==L[m]?_[I+L[m]]=_[I+m]:_[R+_[q+m]]=_[I+m]);g!==d&&(O[g]=Dm(d),_[j+g]=0)}for(0!==G&&(T=J),_[q+d]=Z,O[d]=Y,_[0+d]=J-Y,_[z+d]=-2,U=i(U,f,_,j,c),N=Y;N<J;N++)if(!((D=_[z+(m=F[N])])<=0)){var X=U-(w=-_[k+m]);for(W=O[m],E=O[m]+D-1;W<=E;W++)_[j+(g=F[W])]>=U?_[j+g]-=w:0!==_[j+g]&&(_[j+g]=_[q+g]+X)}for(N=Y;N<J;N++){for(A=(E=O[m=F[N]])+_[z+m]-1,S=E,C=0,M=0,W=E;W<=A;W++)if(0!==_[j+(g=F[W])]){var Q=_[j+g]-U;Q>0?(M+=Q,F[S++]=g,C+=g):(O[g]=Dm(d),_[j+g]=0)}_[z+m]=S-E+1;var K=S,ee=E+_[0+m];for(W=A+1;W<ee;W++){var te=_[k+(h=F[W])];te<=0||(M+=te,F[S++]=h,C+=h)}0===M?(O[m]=Dm(d),Z-=w=-_[k+m],V+=w,$+=w,_[k+m]=0,_[z+m]=-1):(_[q+m]=Math.min(_[q+m],M),F[S]=F[K],F[K]=F[E],F[E]=d,_[0+m]=S-E+1,C=(C<0?-C:C)%c,_[I+m]=_[P+C],_[P+C]=m,L[m]=C)}for(_[q+d]=Z,U=i(U+(f=Math.max(f,Z)),f,_,j,c),N=Y;N<J;N++)if(!(_[k+(m=F[N])]>=0))for(m=_[P+(C=L[m])],_[P+C]=-1;-1!==m&&-1!==_[I+m];m=_[I+m],U++){for(b=_[0+m],D=_[z+m],W=O[m]+1;W<=O[m]+b-1;W++)_[j+F[W]]=U;var re=m;for(h=_[I+m];-1!==h;){var ne=_[0+h]===b&&_[z+h]===D;for(W=O[h]+1;ne&&W<=O[h]+b-1;W++)_[j+F[W]]!==U&&(ne=0);ne?(O[h]=Dm(m),_[k+m]+=_[k+h],_[k+h]=0,_[z+h]=-1,h=_[I+h],_[I+re]=h):(re=h,h=_[I+h])}}for(W=Y,N=Y;N<J;N++)(w=-_[k+(m=F[N])])<=0||(_[k+m]=w,M=_[q+m]+Z-w,-1!==_[R+(M=Math.min(M,c-$-w))]&&(L[_[R+M]]=m),_[I+m]=_[R+M],L[m]=-1,_[R+M]=m,H=Math.min(H,M),_[q+m]=M,F[W++]=m);_[k+d]=V,0==(_[0+d]=W-Y)&&(O[d]=-1,_[j+d]=0),0!==G&&(T=W)}for(m=0;m<c;m++)O[m]=Dm(O[m]);for(h=0;h<=c;h++)_[R+h]=-1;for(h=c;h>=0;h--)_[k+h]>0||(_[I+h]=_[R+O[h]],_[R+O[h]]=h);for(g=c;g>=0;g--)_[k+g]<=0||-1!==O[g]&&(_[I+g]=_[R+O[g]],_[R+O[g]]=g);for(d=0,m=0;m<=c;m++)-1===O[m]&&(d=Nm(m,d,_,R,I,B,j));return B.splice(B.length-1,1),B};function i(e,t,r,n,i){if(e<2||e+t<0){for(var a=0;a<i;a++)0!==r[n+a]&&(r[n+a]=1);e=2}return e}function a(e,t){return e!==t}}));function Am(e,t,r,n,i,a,o){var u,s,c,f=0;if(e<=t||r[n+t]<=r[i+e])return-1;r[i+e]=r[n+t];var l=r[a+e];if(r[a+e]=t,-1===l)f=1,c=e;else{for(f=2,c=l;c!==r[o+c];c=r[o+c]);for(u=l;u!==c;u=s)s=r[o+u],r[o+u]=c}return{jleaf:f,q:c}}var Sm=Ee("csCounts",["transpose"],(function(e){var t=e.transpose;return function(e,r,n,i){if(!e||!r||!n)return null;var a,o,u,s,c,f,l,p=e._size,m=p[0],h=p[1],d=4*h+(i?h+m+1:0),v=[],y=h,g=2*h,x=3*h,b=4*h,w=5*h+1;for(u=0;u<d;u++)v[u]=-1;var N=[],D=t(e),E=D._index,A=D._ptr;for(u=0;u<h;u++)for(N[o=n[u]]=-1===v[x+o]?1:0;-1!==o&&-1===v[x+o];o=r[o])v[x+o]=u;if(i){for(u=0;u<h;u++)v[n[u]]=u;for(a=0;a<m;a++){for(u=h,f=A[a],l=A[a+1],c=f;c<l;c++)u=Math.min(u,v[E[c]]);v[w+a]=v[b+u],v[b+u]=a}}for(a=0;a<h;a++)v[0+a]=a;for(u=0;u<h;u++){for(-1!==r[o=n[u]]&&N[r[o]]--,s=i?v[b+u]:o;-1!==s;s=i?v[w+s]:-1)for(c=A[s];c<A[s+1];c++){var S=Am(a=E[c],o,v,x,y,g,0);S.jleaf>=1&&N[o]++,2===S.jleaf&&N[S.q]--}-1!==r[o]&&(v[0+o]=r[o])}for(o=0;o<h;o++)-1!==r[o]&&(N[r[o]]+=N[o]);return N}})),Cm=Ee("csSqr",["add","multiply","transpose"],(function(e){var t=e.add,r=e.multiply,n=e.transpose,i=Em({add:t,multiply:r,transpose:n}),a=Sm({transpose:n});return function(e,t,r){var n,o=t._ptr,u=t._size[1],s={};if(s.q=i(e,t),e&&!s.q)return null;if(r){var c=e?function(e,t,r,n){for(var i=e._values,a=e._index,o=e._ptr,u=e._size,s=e._datatype,c=u[0],f=u[1],l=null,p=[],m=[],h=0,d=0;d<f;d++){m[d]=h;for(var v=r?r[d]:d,y=o[v],g=o[v+1],x=y;x<g;x++){var b=a[x];p[h]=b,l&&(l[h]=i[x]),h++}}return m[f]=h,e.createSparseMatrix({values:l,index:p,ptr:m,size:[c,f],datatype:s})}(t,0,s.q):t;s.parent=function(e,t){if(!e)return null;var r,n,i=e._index,a=e._ptr,o=e._size,u=o[0],s=o[1],c=[],f=[],l=s;for(r=0;r<u;r++)f[l+r]=-1;for(var p=0;p<s;p++){c[p]=-1,f[0+p]=-1;for(var m=a[p],h=a[p+1],d=m;d<h;d++){var v=i[d];for(r=f[l+v];-1!==r&&r<p;r=n)n=f[0+r],f[0+r]=p,-1===n&&(c[r]=p);f[l+v]=p}}return c}(c);var f=function(e,t){if(!e)return null;var r,n=0,i=[],a=[],o=t,u=2*t;for(r=0;r<t;r++)a[0+r]=-1;for(r=t-1;r>=0;r--)-1!==e[r]&&(a[o+r]=a[0+e[r]],a[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(n=Nm(r,n,a,0,o,i,u));return i}(s.parent,u);if(s.cp=a(c,s.parent,f,1),c&&s.parent&&s.cp&&function(e,t){var r=e._ptr,n=e._index,i=e._size,a=i[0],o=i[1];t.pinv=[],t.leftmost=[];var u,s,c,f,l,p=t.parent,m=t.pinv,h=t.leftmost,d=[],v=a,y=a+o,g=a+2*o;for(s=0;s<o;s++)d[v+s]=-1,d[y+s]=-1,d[g+s]=0;for(u=0;u<a;u++)h[u]=-1;for(s=o-1;s>=0;s--)for(f=r[s],l=r[s+1],c=f;c<l;c++)h[n[c]]=s;for(u=a-1;u>=0;u--)m[u]=-1,-1!==(s=h[u])&&(0==d[g+s]++&&(d[y+s]=u),d[0+u]=d[v+s],d[v+s]=u);for(t.lnz=0,t.m2=a,s=0;s<o;s++)if(u=d[v+s],t.lnz++,u<0&&(u=t.m2++),m[u]=s,!(--g[s]<=0)){t.lnz+=d[g+s];var x=p[s];-1!==x&&(0===d[g+x]&&(d[y+x]=d[y+s]),d[0+d[y+s]]=d[v+x],d[v+x]=d[0+u],d[g+x]+=d[g+s])}for(u=0;u<a;u++)m[u]<0&&(m[u]=s++);return!0}(c,s))for(s.unz=0,n=0;n<u;n++)s.unz+=s.cp[n]}else s.unz=4*o[u]+u,s.lnz=s.unz;return s}}));function Mm(e,t){return e[t]<0}function Fm(e,t){e[t]=Dm(e[t])}function Om(e){return e<0?Dm(e):e}function Tm(e,t,r,n,i){var a,o,u,s=t._index,c=t._ptr,f=t._size[1],l=0;for(n[0]=e;l>=0;){e=n[l];var p=i?i[e]:e;Mm(c,e)||(Fm(c,e),n[f+l]=p<0?0:Om(c[p]));var m=1;for(o=n[f+l],u=p<0?0:Om(c[p+1]);o<u;o++)if(!Mm(c,a=s[o])){n[f+l]=o,n[++l]=a,m=0;break}m&&(l--,n[--r]=e)}return r}var Bm=Ee("csSpsolve",["divideScalar","multiply","subtract"],(function(e){var t=e.divideScalar,r=e.multiply,n=e.subtract;return function(e,i,a,o,u,s,c){var f,l,p,m,h=e._values,d=e._index,v=e._ptr,y=e._size[1],g=i._values,x=i._index,b=i._ptr,w=function(e,t,r,n,i){var a,o,u,s=e._ptr,c=e._size,f=t._index,l=t._ptr,p=c[1],m=p;for(o=l[r],u=l[r+1],a=o;a<u;a++){var h=f[a];Mm(s,h)||(m=Tm(h,e,m,n,i))}for(a=m;a<p;a++)Fm(s,n[a]);return m}(e,i,a,o,s);for(f=w;f<y;f++)u[o[f]]=0;for(l=b[a],p=b[a+1],f=l;f<p;f++)u[x[f]]=g[f];for(var N=w;N<y;N++){var D=o[N],E=s?s[D]:D;if(!(E<0))for(l=v[E],p=v[E+1],u[D]=t(u[D],h[c?l:p-1]),f=c?l+1:l,m=c?p:p-1;f<m;f++){var A=d[f];u[A]=n(u[A],r(h[f],u[D]))}}return w}})),_m=Ee("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],(function(e){var t=e.abs,r=e.divideScalar,n=e.multiply,i=e.subtract,a=e.larger,o=e.largerEq,u=e.SparseMatrix,s=Bm({divideScalar:r,multiply:n,subtract:i});return function(e,i,c){if(!e)return null;var f,l=e._size[1],p=100,m=100;i&&(f=i.q,p=i.lnz||p,m=i.unz||m);var h,d,v=[],y=[],g=[],x=new u({values:v,index:y,ptr:g,size:[l,l]}),b=[],w=[],N=[],D=new u({values:b,index:w,ptr:N,size:[l,l]}),E=[],A=[],S=[];for(h=0;h<l;h++)A[h]=0,E[h]=-1,g[h+1]=0;p=0,m=0;for(var C=0;C<l;C++){g[C]=p,N[C]=m;var M=f?f[C]:C,F=s(x,e,M,S,A,E,1),O=-1,T=-1;for(d=F;d<l;d++)if(E[h=S[d]]<0){var B=t(A[h]);a(B,T)&&(T=B,O=h)}else w[m]=E[h],b[m++]=A[h];if(-1===O||T<=0)return null;E[M]<0&&o(t(A[M]),n(T,c))&&(O=M);var _=A[O];for(w[m]=C,b[m++]=_,E[O]=C,y[p]=O,v[p++]=1,d=F;d<l;d++)E[h=S[d]]<0&&(y[p]=h,v[p++]=r(A[h],_)),A[h]=0}for(g[l]=p,N[l]=m,d=0;d<p;d++)y[d]=E[y[d]];return v.splice(p,v.length-p),y.splice(p,y.length-p),b.splice(m,b.length-m),w.splice(m,w.length-m),{L:x,U:D,pinv:E}}})),km=Ee("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.multiply,a=e.transpose,o=e.divideScalar,u=e.subtract,s=e.larger,c=e.largerEq,f=e.SparseMatrix,l=Cm({add:n,multiply:i,transpose:a}),p=_m({abs:r,divideScalar:o,multiply:i,subtract:u,larger:s,largerEq:c,SparseMatrix:f});return t("slu",{"SparseMatrix, number, number":function(e,t,r){if(!V(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(r<0||r>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var n=l(t,e,!1),i=p(e,n,r);return{L:i.L,U:i.U,p:i.pinv,q:n.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})}));function Im(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}var Rm="lusolve",zm=Ee(Rm,["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],(function(e){var t=e.typed,r=e.matrix,n=e.lup,i=e.slu,a=e.usolve,o=e.lsolve,u=lc({DenseMatrix:e.DenseMatrix});return t(Rm,{"Array, Array | Matrix":function(e,t){e=r(e);var i=n(e);return c(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var r=n(e);return c(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var r=n(e);return c(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){var a=i(e,r,n);return c(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return c(e.L,e.U,e.p,e.q,t)}});function s(e){if(l(e))return e;if(f(e))return r(e);throw new TypeError("Invalid Matrix LU decomposition")}function c(e,t,r,n,i){e=s(e),t=s(t),r&&((i=u(e,i,!0))._data=Im(r,i._data));var c=o(e,i),f=a(t,c);return n&&(f._data=Im(n,f._data)),f}})),qm="polynomialRoot",jm=Ee(qm,["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],(function(e){var t=e.typed,r=e.isZero,n=e.equalScalar,i=e.add,a=e.subtract,o=e.multiply,u=e.divide,s=e.sqrt,c=e.unaryMinus,f=e.cbrt,l=e.typeOf,p=e.im,m=e.re;return t(qm,{"number|Complex, ...number|Complex":function(e,t){for(var h=[e].concat(Vr(t));h.length>0&&r(h[h.length-1]);)h.pop();if(h.length<2)throw new RangeError("Polynomial [".concat(e,", ").concat(t,"] must have a non-zero non-constant coefficient"));switch(h.length){case 2:return[c(u(h[0],h[1]))];case 3:var d=wa(h,3),v=d[0],y=d[1],g=d[2],x=o(2,g),b=o(y,y),w=o(4,g,v);if(n(b,w))return[u(c(y),x)];var N=s(a(b,w));return[u(a(N,y),x),u(a(c(N),y),x)];case 4:var D=wa(h,4),E=D[0],A=D[1],S=D[2],C=D[3],M=c(o(3,C)),F=o(S,S),O=o(3,C,A),T=i(o(2,S,S,S),o(27,C,C,E)),B=o(9,C,S,A);if(n(F,O)&&n(T,B))return[u(S,M)];var _,k=a(F,O),I=a(T,B),R=i(o(18,C,S,A,E),o(S,S,A,A)),z=i(o(4,S,S,S,E),o(4,C,A,A,A),o(27,C,C,E,E));return n(R,z)?[u(a(o(4,C,S,A),i(o(9,C,C,E),o(S,S,S))),o(C,k)),u(a(o(9,C,E),o(S,A)),o(2,k))]:(_=n(F,O)?I:u(i(I,s(a(o(I,I),o(4,k,k,k)))),2),f(_,!0).toArray().map((function(e){return u(i(S,e,u(k,e)),M)})).map((function(e){return"Complex"===l(e)&&n(m(e),m(e)+p(e))?m(e):e})));default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(h))}}})})),Pm=Ee("Help",["parse"],(function(e){var t=e.parse;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var e=this.doc||{},r="\n";if(e.name&&(r+="Name: "+e.name+"\n\n"),e.category&&(r+="Category: "+e.category+"\n\n"),e.description&&(r+="Description:\n "+e.description+"\n\n"),e.syntax&&(r+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){r+="Examples:\n";for(var n={},i=0;i<e.examples.length;i++){var a=e.examples[i];r+=" "+a+"\n";var o=void 0;try{o=t(a).compile().evaluate(n)}catch(e){o=e}void 0===o||x(o)||(r+=" "+Jr(o,{precision:14})+"\n")}r+="\n"}return e.mayThrow&&e.mayThrow.length&&(r+="Throws: "+e.mayThrow.join(", ")+"\n\n"),e.seealso&&e.seealso.length&&(r+="See also: "+e.seealso.join(", ")+"\n"),r},r.prototype.toJSON=function(){var e=he(this.doc);return e.mathjs="Help",e},r.fromJSON=function(e){var t={};return Object.keys(e).filter((function(e){return"mathjs"!==e})).forEach((function(r){t[r]=e[r]})),new r(t)},r.prototype.valueOf=r.prototype.toString,r}),{isClass:!0}),Lm=Ee("Chain",["?on","math","typed"],(function(e){var t=e.on,r=e.math,n=e.typed;function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");$(e)?this.value=e.value:this.value=e}function a(e,t){we(i.prototype,e,(function(){var e=t();if("function"==typeof e)return o(e)}))}function o(e){return function(){if(0===arguments.length)return new i(e(this.value));for(var t=[this.value],r=0;r<arguments.length;r++)t[r+1]=arguments[r];if(n.isTypedFunction(e)){var a=n.resolve(e,t);if(1===a.params.length)throw new 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.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 Jr(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(e){return new i(e.value)},i.createProxy=function(e,t){if("string"==typeof e)s=e,"function"==typeof(c=t)&&(i.prototype[s]=o(c));else{var r=function(t){Ne(e,t)&&void 0===u[t]&&a(t,(function(){return e[t]}))};for(var n in e)r(n)}var s,c};var u={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(r),t&&t("import",(function(e,t,r){r||a(e,t)})),i}),{isClass:!0}),Um={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"]},$m={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"]},Hm={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","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","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:Um,E:Um,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{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:[]},Infinity:{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:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{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:[]},LOG10E:{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:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:$m,PI:$m,phi:{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:[]},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",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh 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:"Borh 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)"],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)"],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)"],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)"],seealso:["ceil","floor","round"]},floor:{name:"floor",category:"Arithmetic",syntax:["floor(x)"],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)"],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 hypotenusa 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>1, -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"]},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:"he 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"]},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:[]},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:[]},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"]},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"]},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 indicant 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)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],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"]},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.",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.",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 Riemanns 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.",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.",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 probablity are: Number, BigNumber. \n\nIn 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","sum","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 hyperbolic arccotangent 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 hyperbolic arccosecant 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:[]},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"]},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"]},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, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]}},Gm="help",Vm=Ee(Gm,["typed","mathWithTransform","Help"],(function(e){var t=e.typed,r=e.mathWithTransform,n=e.Help;return t(Gm,{any:function(e){var t,i=e;if("string"!=typeof e)for(t in r)if(Ne(r,t)&&e===r[t]){i=t;break}var a=Te(Hm,i);if(!a){var o="function"==typeof i?i.name:i;throw new Error('No documentation found on "'+o+'"')}return new n(a)}})})),Zm="chain",Wm=Ee(Zm,["typed","Chain"],(function(e){var t=e.typed,r=e.Chain;return t(Zm,{"":function(){return new r},any:function(e){return new r(e)}})})),Ym=Ee("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],(function(e){var t=e.typed,r=e.matrix,n=e.subtractScalar,i=e.multiply,a=e.divideScalar,o=e.isZero,u=e.unaryMinus;return t("det",{any:function(e){return he(e)},"Array | Matrix":function(e){var t;switch((t=l(e)?e.size():Array.isArray(e)?(e=r(e)).size():[]).length){case 0:return he(e);case 1:if(1===t[0])return he(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+Jr(t)+")");case 2:var s=t[0],c=t[1];if(s===c)return function(e,t,r){if(1===t)return he(e[0][0]);if(2===t)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var s=!1,c=new Array(t).fill(0).map((function(e,t){return t})),f=0;f<t;f++){var l=c[f];if(o(e[l][f])){var p=void 0;for(p=f+1;p<t;p++)if(!o(e[c[p]][f])){l=c[p],c[p]=c[f],c[f]=l,s=!s;break}if(p===t)return e[l][f]}for(var m=e[l][f],h=0===f?1:e[c[f-1]][f-1],d=f+1;d<t;d++)for(var v=c[d],y=f+1;y<t;y++)e[v][y]=a(n(i(e[v][y],m),i(e[v][f],e[l][y])),h)}var g=e[c[t-1]][t-1];return s?u(g):g}(e.clone().valueOf(),s);if(0===c)return 1;throw new RangeError("Matrix must be square (size: "+Jr(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+Jr(t)+")")}}})})),Jm=Ee("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],(function(e){var t=e.typed,r=e.matrix,n=e.divideScalar,i=e.addScalar,a=e.multiply,o=e.unaryMinus,u=e.det,s=e.identity,c=e.abs;return t("inv",{"Array | Matrix":function(e){var t=l(e)?e.size():an(e);switch(t.length){case 1:if(1===t[0])return l(e)?r([n(1,e.valueOf()[0])]):[n(1,e[0])];throw new RangeError("Matrix must be square (size: "+Jr(t)+")");case 2:var i=t[0],a=t[1];if(i===a)return l(e)?r(f(e.valueOf(),i,a),e.storage()):f(e,i,a);throw new RangeError("Matrix must be square (size: "+Jr(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+Jr(t)+")")}},any:function(e){return n(1,e)}});function f(e,t,r){var f,l,p,m,h;if(1===t){if(0===(m=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,m)]]}if(2===t){var d=u(e);if(0===d)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],d),n(o(e[0][1]),d)],[n(o(e[1][0]),d),n(e[0][0],d)]]}var v=e.concat();for(f=0;f<t;f++)v[f]=v[f].concat();for(var y=s(t).valueOf(),g=0;g<r;g++){var x=c(v[g][g]),b=g;for(f=g+1;f<t;)c(v[f][g])>x&&(x=c(v[f][g]),b=f),f++;if(0===x)throw Error("Cannot calculate inverse, determinant is zero");(f=b)!==g&&(h=v[g],v[g]=v[f],v[f]=h,h=y[g],y[g]=y[f],y[f]=h);var w=v[g],N=y[g];for(f=0;f<t;f++){var D=v[f],E=y[f];if(f!==g){if(0!==D[g]){for(p=n(o(D[g]),w[g]),l=g;l<r;l++)D[l]=i(D[l],a(p,w[l]));for(l=0;l<r;l++)E[l]=i(E[l],a(p,N[l]))}}else{for(p=w[g],l=g;l<r;l++)D[l]=n(D[l],p);for(l=0;l<r;l++)E[l]=n(E[l],p)}}}return y}})),Xm="pinv",Qm=Ee(Xm,["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],(function(e){var t=e.typed,r=e.matrix,n=e.inv,i=e.deepEqual,a=e.equal,o=e.dotDivide,u=e.dot,s=e.ctranspose,c=e.divideScalar,f=e.multiply,p=e.add,m=e.Complex;return t(Xm,{"Array | Matrix":function(e){var t=l(e)?e.size():an(e);switch(t.length){case 1:return v(e)?s(e):1===t[0]?n(e):o(s(e),u(e,e));case 2:if(v(e))return s(e);var i=t[0],a=t[1];if(i===a)try{return n(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return l(e)?r(h(e.valueOf(),i,a),e.storage()):h(e,i,a);default:throw new RangeError("Matrix must be two dimensional (size: "+Jr(t)+")")}},any:function(e){return a(e,0)?he(e):c(1,e)}});function h(e,t,r){var i=function(e,t,r){var n=function(e,t,r){for(var n=he(e),i=0,a=0;a<t;a++){if(r<=i)return n;for(var u=a;d(n[u][i]);)if(t===++u&&(u=a,r===++i))return n;var s=[n[a],n[u]];n[u]=s[0],n[a]=s[1];for(var c=n[a][i],l=0;l<r;l++)n[a][l]=o(n[a][l],c);for(var m=0;m<t;m++)if(m!==a){c=n[m][i];for(var h=0;h<r;h++)n[m][h]=p(n[m][h],f(-1,f(c,n[a][h])))}i++}return n}(e,t,r);return{C:e.map((function(e,r){return e.filter((function(e,r){return r<t&&!d(u(n[r],n[r]))}))})),F:n.filter((function(e,t){return!d(u(n[t],n[t]))}))}}(e,t,r),a=i.C,c=i.F,l=f(n(f(s(a),a)),s(a)),m=f(s(c),n(f(c,s(c))));return f(m,l)}function d(e){return a(p(e,m(1,1)),p(0,m(1,1)))}function v(e){return i(p(e,m(1,1)),p(f(e,0),m(1,1)))}}));function Km(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return eh(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eh(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function eh(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var th=Ee("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"],(function(e){var t=e.config,r=e.typed,n=e.matrix,s=e.addScalar,c=e.subtract,f=e.equal,l=e.abs,p=e.atan,m=e.cos,h=e.sin,d=e.multiplyScalar,v=e.divideScalar,y=e.inv,g=e.bignumber,x=e.multiply,b=e.add,w=e.larger,N=e.column,D=e.flatten,E=e.number,A=e.complex,S=e.sqrt,C=e.diag,M=e.size,F=e.reshape,O=e.qr,T=e.usolve,B=e.usolveAll,_=e.im,k=e.re,I=e.smaller,R=e.matrixFromColumns,z=e.dot,q=function(e){var t=e.config,r=e.addScalar,n=e.subtract,i=e.abs,a=e.atan,o=e.cos,u=e.sin,s=e.multiplyScalar,c=e.inv,f=e.bignumber,l=e.multiply,p=e.add;function m(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),u=Array(i).fill(0),s=Array(i).fill(0),c=0;c<i;c++)u[c]=a*e[c][r]-o*e[c][n],s[c]=o*e[c][r]+a*e[c][n];for(var f=0;f<i;f++)e[f][r]=u[f],e[f][n]=s[f];return e}function h(e,t,i,a){for(var c=e.length,l=o(t),p=u(t),m=Array(c).fill(f(0)),h=Array(c).fill(f(0)),d=0;d<c;d++)m[d]=n(s(l,e[d][i]),s(p,e[d][a])),h[d]=r(s(p,e[d][i]),s(l,e[d][a]));for(var v=0;v<c;v++)e[v][i]=m[v],e[v][a]=h[v];return e}function d(e,t,i,a){for(var c=e.length,m=f(o(t)),h=f(u(t)),d=s(m,m),v=s(h,h),y=Array(c).fill(f(0)),g=Array(c).fill(f(0)),x=l(f(2),m,h,e[i][a]),b=r(n(s(d,e[i][i]),x),s(v,e[a][a])),w=p(s(v,e[i][i]),x,s(d,e[a][a])),N=0;N<c;N++)y[N]=n(s(m,e[i][N]),s(h,e[a][N])),g[N]=r(s(h,e[i][N]),s(m,e[a][N]));e[i][i]=b,e[a][a]=w,e[i][a]=f(0),e[a][i]=f(0);for(var D=0;D<c;D++)D!==i&&D!==a&&(e[i][D]=y[D],e[D][i]=y[D],e[a][D]=g[D],e[D][a]=g[D]);return e}function v(e,t,r,n){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),u=a*a,s=o*o,c=Array(i).fill(0),f=Array(i).fill(0),l=u*e[r][r]-2*a*o*e[r][n]+s*e[n][n],p=s*e[r][r]+2*a*o*e[r][n]+u*e[n][n],m=0;m<i;m++)c[m]=a*e[r][m]-o*e[n][m],f[m]=o*e[r][m]+a*e[n][m];e[r][r]=l,e[n][n]=p,e[r][n]=0,e[n][r]=0;for(var h=0;h<i;h++)h!==r&&h!==n&&(e[r][h]=c[h],e[h][r]=c[h],e[n][h]=f[h],e[h][n]=f[h]);return e}function y(e){for(var t=e.length,r=0,n=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)Math.abs(r)<Math.abs(e[i][a])&&(r=Math.abs(e[i][a]),n=[i,a]);return[n,r]}function g(e){for(var t=e.length,r=0,n=[0,1],a=0;a<t;a++)for(var o=a+1;o<t;o++)i(r)<i(e[a][o])&&(r=i(e[a][o]),n=[a,o]);return[n,r]}function x(e,t,r){var n,a=e.length,o=Array(a);if(r){n=Array(a);for(var u=0;u<a;u++)n[u]=Array(a)}for(var s=0;s<a;s++){for(var c=0,f=e[0],l=0;l<e.length;l++)i(e[l])<i(f)&&(f=e[c=l]);if(o[s]=e.splice(c,1)[0],r)for(var p=0;p<a;p++)n[s][p]=t[p][c],t[p].splice(c,1)}if(!r)return{values:o};var m=n.map((function(e,t){return{value:o[t],vector:e}}));return{values:o,eigenvectors:m}}return function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.epsilon,u=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0;if("number"===u)return function(e,r,n){var i,a,o=e.length,u=Math.abs(r/o);if(n){a=new Array(o);for(var s=0;s<o;s++)a[s]=Array(o).fill(0),a[s][s]=1}for(var c,f,l,p,h=y(e);Math.abs(h[1])>=Math.abs(u);){var d=h[0][0],g=h[0][1];e=v(e,(c=e[d][d],f=e[g][g],l=e[d][g],p=void 0,p=f-c,i=Math.abs(p)<=t.epsilon?Math.PI/4:.5*Math.atan(2*l/(f-c))),d,g),n&&(a=m(a,i,d,g)),h=y(e)}for(var b=Array(o).fill(0),w=0;w<o;w++)b[w]=e[w][w];return x(he(b),a,n)}(e,o,p);if("BigNumber"===u)return function(e,r,o){var u,p,m=e.length,v=i(r/m);if(o){p=new Array(m);for(var y=0;y<m;y++)p[y]=Array(m).fill(0),p[y][y]=1}for(var b,w,N,D,E=g(e);i(E[1])>=i(v);){var A=E[0][0],S=E[0][1];e=d(e,(b=e[A][A],w=e[S][S],N=e[A][S],D=void 0,D=n(w,b),u=i(D)<=t.epsilon?f(-1).acos().div(4):s(.5,a(l(2,N,c(D))))),A,S),o&&(p=h(p,u,A,S)),E=g(e)}for(var C=Array(m).fill(0),M=0;M<m;M++)C[M]=e[M][M];return x(he(C),p,o)}(e,o,p);throw TypeError("Unsupported data type: "+u)}}({config:t,addScalar:s,subtract:c,column:N,flatten:D,equal:f,abs:l,atan:p,cos:m,sin:h,multiplyScalar:d,inv:y,bignumber:g,complex:A,multiply:x,add:b}),j=function(e){var t=e.addScalar,r=e.subtract,n=e.flatten,i=e.multiply,a=e.multiplyScalar,o=e.divideScalar,u=e.sqrt,s=e.abs,c=e.bignumber,f=e.diag,l=e.size,p=e.reshape,m=e.inv,h=e.qr,d=e.usolve,v=e.usolveAll,y=e.equal,g=e.complex,x=e.larger,b=e.smaller,w=(e.matrixFromColumns,e.dot);function N(e,t,n,i,a,o,u,f){var l="BigNumber"===f,p="Complex"===f,m=l?c(0):p?g(0):0,h=l?c(1):p?g(1):1;if(b(s(n),u))return[[h,m],[m,h]];if(x(s(r(a,o)),u))return[[r(a,i),r(o,i)],[n,n]];var d=r(e,a),v=r(i,a);return b(s(t),u)&&b(s(v),u)?[[d,h],[n,m]]:[[t,m],[v,h]]}function D(e,t){for(var r=0;r<e.length;r++){var n;(n=e[r]).push.apply(n,Vr(Array(t-e[r].length).fill(0)))}for(var i=e.length;i<t;i++)e.push(Array(t).fill(0)),e[i][i]=1;return e}function E(e,t,r){for(var n=0;n<e.length;n++)if(r(e[n],t))return n;return-1}function A(e,t,r,n,i){for(var a,o="BigNumber"===i?c(1e3):1e3,u=0;u<5;++u){a=S(t,r,i);try{a=d(e,a)}catch(e){continue}if(x(M(a),o))break}if(u>=5)return null;for(u=0;;){var s=d(e,a);if(b(M(C(a,[s])),n))break;if(++u>=10)return null;a=F(s)}return a}function S(e,t,r){var n="BigNumber"===r,i="Complex"===r,a=Array(e).fill(0).map((function(e){return 2*Math.random()-1}));return n&&(a=a.map((function(e){return c(e)}))),i&&(a=a.map((function(e){return g(e)}))),F(a=C(a,t),r)}function C(e,t){var n,a=l(e),u=Km(t);try{for(u.s();!(n=u.n()).done;){var s=n.value;s=p(s,a),e=r(e,i(o(w(s,e),w(s,s)),s))}}catch(e){u.e(e)}finally{u.f()}return e}function M(e){return s(u(w(e,e)))}function F(e,t){var r="Complex"===t,n="BigNumber"===t?c(1):r?g(1):1;return i(o(n,M(e)),e)}return function(e,l,p,d){var w=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],S=function(e,r,n,i,u){var l,p="BigNumber"===i,m="Complex"===i,h=p?c(0):0,d=p?c(1):m?g(1):1,v=p?c(1):1,w=p?c(10):2,N=a(w,w);u&&(l=Array(r).fill(d));for(var D=!1;!D;){D=!0;for(var E=0;E<r;E++){for(var A=h,S=h,C=0;C<r;C++)E!==C&&(A=t(A,s(e[C][E])),S=t(S,s(e[E][C])));if(!y(A,0)&&!y(S,0)){for(var M=v,F=A,O=o(S,w),T=a(S,w);b(F,O);)F=a(F,N),M=a(M,w);for(;x(F,T);)F=o(F,N),M=o(M,w);if(b(o(t(F,S),M),a(t(A,S),.95))){D=!1;for(var B=o(1,M),_=0;_<r;_++)E!==_&&(e[E][_]=a(e[E][_],B),e[_][E]=a(e[_][E],M));u&&(l[E]=a(l[E],B))}}}}return u?f(l):null}(e,l,0,d,w);!function(e,n,i,u,f,l){var p="BigNumber"===u,m="Complex"===u,h=p?c(0):m?g(0):0;p&&(i=c(i));for(var d=0;d<n-2;d++){for(var v=0,y=h,x=d+1;x<n;x++){var w=e[x][d];b(s(y),s(w))&&(y=w,v=x)}if(!b(s(y),i)){if(v!==d+1){var N=e[v];e[v]=e[d+1],e[d+1]=N;for(var D=0;D<n;D++){var E=e[D][v];e[D][v]=e[D][d+1],e[D][d+1]=E}if(f){var A=l[v];l[v]=l[d+1],l[d+1]=A}}for(var S=d+2;S<n;S++){var C=o(e[S][d],y);if(0!==C){for(var M=0;M<n;M++)e[S][M]=r(e[S][M],a(C,e[d+1][M]));for(var F=0;F<n;F++)e[F][d+1]=t(e[F][d+1],a(C,e[F][S]));if(f)for(var O=0;O<n;O++)l[S][O]=r(l[S][O],a(C,l[d+1][O]))}}}}}(e,l,p,d,w,S);var C=function(e,n,o,l,p){var m="BigNumber"===l,d="Complex"===l,v=m?c(1):d?g(1):1;m&&(o=c(o));for(var y,x,w,E,A,S,C,M,F=he(e),O=[],T=n,B=[],_=p?f(Array(n).fill(v)):void 0,k=p?f(Array(T).fill(v)):void 0,I=0;I<=100;){I+=1;for(var R=F[T-1][T-1],z=0;z<T;z++)F[z][z]=r(F[z][z],R);var q=h(F),j=q.Q,P=q.R;F=i(P,j);for(var L=0;L<T;L++)F[L][L]=t(F[L][L],R);if(p&&(k=i(k,j)),1===T||b(s(F[T-1][T-2]),o)){I=0,O.push(F[T-1][T-1]),p&&(B.unshift([[1]]),D(k,n),_=i(_,k),T>1&&(k=f(Array(T-1).fill(v)))),T-=1,F.pop();for(var U=0;U<T;U++)F[U].pop()}else if(2===T||b(s(F[T-2][T-3]),o)){I=0;var $=(y=F[T-2][T-2],x=F[T-2][T-1],w=F[T-1][T-2],E=F[T-1][T-1],A=void 0,S=void 0,C=void 0,M=void 0,A=t(y,E),S=r(a(y,E),a(x,w)),C=a(A,.5),M=a(u(r(a(A,A),a(4,S))),.5),[t(C,M),r(C,M)]);O.push.apply(O,Vr($)),p&&(B.unshift(N(F[T-2][T-2],F[T-2][T-1],F[T-1][T-2],F[T-1][T-1],$[0],$[1],o,l)),D(k,n),_=i(_,k),T>2&&(k=f(Array(T-2).fill(v)))),T-=2,F.pop(),F.pop();for(var H=0;H<T;H++)F[H].pop(),F[H].pop()}if(0===T)break}if(O.sort((function(e,t){return+r(s(e),s(t))})),I>100){var G=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+O.join(", "));throw G.values=O,G.vectors=[],G}var V=p?i(_,function(e,t){for(var r=[],n=0;n<t;n++)r[n]=Array(t).fill(0);var i,a=0,o=Km(e);try{for(o.s();!(i=o.n()).done;){for(var u=i.value,s=u.length,c=0;c<s;c++)for(var f=0;f<s;f++)r[a+c][a+f]=u[c][f];a+=s}}catch(e){o.e(e)}finally{o.f()}return r}(B,n)):void 0;return{values:O,C:V}}(e,l,p,d,w),M=C.values,F=C.C;if(w){var O=function(e,t,a,o,u,s,l){var p,h=m(a),d=i(h,e,a),x="BigNumber"===l,b="Complex"===l,w=x?c(0):b?g(0):0,N=x?c(1):b?g(1):1,D=[],S=[],C=Km(u);try{for(C.s();!(p=C.n()).done;){var M=p.value,F=E(D,M,y);-1===F?(D.push(M),S.push(1)):S[F]+=1}}catch(e){C.e(e)}finally{C.f()}for(var O=[],T=D.length,B=Array(t).fill(w),_=f(Array(t).fill(N)),k=function(){var e=D[I],u=r(d,i(e,_)),c=v(u,B);for(c.shift();c.length<S[I];){var f=A(u,t,c,s,l);if(null===f)break;c.push(f)}var p=i(m(o),a);c=c.map((function(e){return i(p,e)})),O.push.apply(O,Vr(c.map((function(t){return{value:e,vector:n(t)}}))))},I=0;I<T;I++)k();return O}(e,l,F,S,M,p,d);return{values:M,eigenvectors:O}}return{values:M}}}({config:t,addScalar:s,subtract:c,multiply:x,multiplyScalar:d,flatten:D,divideScalar:v,sqrt:S,abs:l,bignumber:g,diag:C,size:M,reshape:F,qr:O,inv:y,usolve:T,usolveAll:B,equal:f,complex:A,larger:w,smaller:I,matrixFromColumns:R,dot:z});return r("eigs",{Array:function(e){return P(n(e))},"Array, number|BigNumber":function(e,t){return P(n(e),{precision:t})},"Array, Object":function(e,t){return P(n(e),t)},Matrix:function(e){return P(e,{matricize:!0})},"Matrix, number|BigNumber":function(e,t){return P(e,{precision:t,matricize:!0})},"Matrix, Object":function(e,t){var r={matricize:!0};return $r(r,t),P(e,r)}});function P(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=!("eigenvectors"in i)||i.eigenvectors,o=function(e,t,r){var n=e.toArray(),i=e.size();if(2!==i.length||i[0]!==i[1])throw new RangeError("Matrix must be square (size: ".concat(Jr(i),")"));var a=i[0];if(function(e,t,r){for(var n=0;n<t;n++)for(var i=0;i<t;i++)if(w(g(l(_(e[n][i]))),r))return!1;return!0}(n,a,t)&&(function(e,t){for(var r=0;r<t;r++)for(var n=0;n<t;n++)e[r][n]=k(e[r][n])}(n,a),function(e,t,r){for(var n=0;n<t;n++)for(var i=n;i<t;i++)if(w(g(l(c(e[n][i],e[i][n]))),r))return!1;return!0}(n,a,t))){var o=L(e,n,a);return q(n,a,t,o,r)}var u=L(e,n,a);return j(n,a,t,u,r)}(e,null!==(r=i.precision)&&void 0!==r?r:t.epsilon,a);return i.matricize&&(o.values=n(o.values),a&&(o.eigenvectors=o.eigenvectors.map((function(e){var t=e.value,r=e.vector;return{value:t,vector:n(r)}})))),a&&Object.defineProperty(o,"vectors",{enumerable:!1,get:function(){throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),o}function L(e,t,r){var n=e.datatype();if("number"===n||"BigNumber"===n||"Complex"===n)return n;for(var s=!1,c=!1,f=!1,l=0;l<r;l++)for(var p=0;p<r;p++){var m=t[l][p];if(i(m)||u(m))s=!0;else if(a(m))c=!0;else{if(!o(m))throw TypeError("Unsupported type in Matrix: "+H(m));f=!0}}if(c&&f&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),f){for(var h=0;h<r;h++)for(var d=0;d<r;d++)t[h][d]=A(t[h][d]);return"Complex"}if(c){for(var v=0;v<r;v++)for(var y=0;y<r;y++)t[v][y]=g(t[v][y]);return"BigNumber"}if(s){for(var x=0;x<r;x++)for(var b=0;b<r;b++)t[x][b]=E(t[x][b]);return"number"}throw TypeError("Matrix contains unsupported types only.")}})),rh="expm",nh=Ee(rh,["typed","abs","add","identity","inv","multiply"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.identity,a=e.inv,o=e.multiply;return t(rh,{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+Jr(t)+")");for(var s=t[0],c=function(e){for(var t=e.size()[0],n=0,i=0;i<t;i++){for(var a=0,o=0;o<t;o++)a+=r(e.get([i,o]));n=Math.max(a,n)}return n}(e),f=function(e,t){for(var r=0;r<30;r++)for(var n=0;n<=r;n++){var i=r-n;if(u(e,n,i)<1e-15)return{q:n,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(c),l=f.q,p=f.j,m=o(e,Math.pow(2,-p)),d=i(s),v=i(s),y=1,g=m,x=-1,b=1;b<=l;b++)b>1&&(g=o(g,m),x=-x),d=n(d,o(y=y*(l-b+1)/((2*l-b+1)*b),g)),v=n(v,o(y*x,g));for(var w=o(a(v),d),N=0;N<p;N++)w=o(w,w);return h(e)?e.createSparseMatrix(w):w}});function u(e,t,r){for(var n=1,i=2;i<=t;i++)n*=i;for(var a=n,o=t+1;o<=2*t;o++)a*=o;var u=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(a*u)}})),ih="sqrtm",ah=Ee(ih,["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],(function(e){var t=e.typed,r=e.abs,n=e.add,i=e.multiply,a=e.map,o=e.sqrt,u=e.subtract,s=e.inv,c=e.size,f=e.max,p=e.identity,m=1e-6;function h(e){var t,a=0,o=e,l=p(c(e));do{var h=o;if(o=i(.5,n(h,s(l))),l=i(.5,n(l,s(h))),(t=f(r(u(o,h))))>m&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>m);return o}return t(ih,{"Array | Matrix":function(e){var t=l(e)?e.size():an(e);switch(t.length){case 1:if(1===t[0])return a(e,o);throw new RangeError("Matrix must be square (size: "+Jr(t)+")");case 2:if(t[0]===t[1])return h(e);throw new RangeError("Matrix must be square (size: "+Jr(t)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+Jr(t)+")")}}})})),oh="sylvester",uh=Ee(oh,["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],(function(e){var t=e.typed,r=e.schur,n=e.matrixFromColumns,i=e.matrix,a=e.multiply,o=e.range,u=e.concat,s=e.transpose,c=e.index,f=e.subset,l=e.add,p=e.subtract,m=e.identity,h=e.lusolve,d=e.abs;return t(oh,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(e,t,r){return v(i(e),t,r)},"Array, Array, Matrix":function(e,t,r){return v(i(e),i(t),r)},"Array, Matrix, Array":function(e,t,r){return v(i(e),t,i(r))},"Matrix, Array, Matrix":function(e,t,r){return v(e,i(t),r)},"Matrix, Array, Array":function(e,t,r){return v(e,i(t),i(r))},"Matrix, Matrix, Array":function(e,t,r){return v(e,t,i(r))},"Array, Array, Array":function(e,t,r){return v(i(e),i(t),i(r)).toArray()}});function v(e,t,v){for(var y=t.size()[0],g=e.size()[0],x=r(e),b=x.T,w=x.U,N=r(a(-1,t)),D=N.T,E=N.U,A=a(a(s(w),v),E),S=o(0,g),C=[],M=function(e,t){return u(e,t,1)},F=function(e,t){return u(e,t,0)},O=0;O<y;O++)if(O<y-1&&d(f(D,c(O+1,O)))>1e-5){for(var T=F(f(A,c(S,O)),f(A,c(S,O+1))),B=0;B<O;B++)T=l(T,F(a(C[B],f(D,c(B,O))),a(C[B],f(D,c(B,O+1)))));var _=a(m(g),a(-1,f(D,c(O,O)))),k=a(m(g),a(-1,f(D,c(O+1,O)))),I=a(m(g),a(-1,f(D,c(O,O+1)))),R=a(m(g),a(-1,f(D,c(O+1,O+1)))),z=F(M(l(b,_),k),M(I,l(b,R))),q=h(z,T);C[O]=q.subset(c(o(0,g),0)),C[O+1]=q.subset(c(o(g,2*g),0)),O++}else{for(var j=f(A,c(S,O)),P=0;P<O;P++)j=l(j,a(C[P],f(D,c(P,O))));var L=f(D,c(O,O)),U=p(b,a(L,m(g)));C[O]=h(U,j)}var $=i(n.apply(void 0,C));return a(w,a($,s(E)))}})),sh="schur",ch=Ee(sh,["typed","matrix","identity","multiply","qr","norm","subtract"],(function(e){var t=e.typed,r=e.matrix,n=e.identity,i=e.multiply,a=e.qr,o=e.norm,u=e.subtract;return t(sh,{Array:function(e){var t=s(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:function(e){return s(e)}});function s(e){var t,r=e.size()[0],s=e,c=n(r),f=0;do{t=s;var l=a(s),p=l.Q,m=l.R;if(s=i(m,p),c=i(c,p),f++>100)break}while(o(u(s,t))>1e-4);return{U:c,T:s}}})),fh="lyap",lh=Ee(fh,["typed","matrix","sylvester","multiply","transpose"],(function(e){var t=e.typed,r=e.matrix,n=e.sylvester,i=e.multiply,a=e.transpose;return t(fh,{"Matrix, Matrix":function(e,t){return n(e,a(e),i(-1,t))},"Array, Matrix":function(e,t){return n(r(e),a(r(e)),i(-1,t))},"Matrix, Array":function(e,t){return n(e,a(r(e)),r(i(-1,t)))},"Array, Array":function(e,t){return n(r(e),a(r(e)),r(i(-1,t))).toArray()}})})),ph=Ee("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(function(e){var t=e.typed,r=e.matrix,n=e.multiply,i=e.equalScalar,a=e.divideScalar,o=e.inv,u=Na({typed:t,equalScalar:i}),s=Ea({typed:t});return t("divide",ve({"Array | Matrix, Array | Matrix":function(e,t){return n(e,o(t))},"DenseMatrix, any":function(e,t){return s(e,t,a,!1)},"SparseMatrix, any":function(e,t){return u(e,t,a,!1)},"Array, any":function(e,t){return s(r(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return n(e,o(t))}},a.signatures))})),mh="distance",hh=Ee(mh,["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],(function(e){var t=e.typed,r=e.addScalar,n=e.subtractScalar,i=e.multiplyScalar,o=e.divideScalar,u=e.deepEqual,s=e.sqrt,c=e.abs;return t(mh,{"Array, Array, Array":function(e,t,r){if(2===e.length&&2===t.length&&2===r.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(u(t,r))throw new TypeError("LinePoint1 should not be same with LinePoint2");var a=n(r[1],t[1]),o=n(t[0],r[0]),s=n(i(r[0],t[1]),i(t[0],r[1]));return v(e[0],e[1],a,o,s)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,r){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(r).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(u(d(t),d(r)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in r&&"lineTwoPtY"in r){var a=n(r.lineTwoPtY,t.lineOnePtY),o=n(t.lineOnePtX,r.lineTwoPtX),s=n(i(r.lineTwoPtX,t.lineOnePtY),i(t.lineOnePtX,r.lineTwoPtY));return v(e.pointX,e.pointY,a,o,s)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!l(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return v(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!p(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!h(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(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(!m(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(t))throw new TypeError("All values of an array should be numbers or BigNumbers");return g(e,t)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(t))throw new 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 v(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!h(t))throw new 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 y(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!l(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(t))throw new 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 g([e.pointOneX,e.pointOneY],[t.pointTwoX,t.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!p(t))throw new 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 g([e.pointOneX,e.pointOneY,e.pointOneZ],[t.pointTwoX,t.pointTwoY,t.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&f(e[0][0])&&f(e[0][1])){if(e.some((function(e){return 2!==e.length||!f(e[0])||!f(e[1])})))return!1}else{if(!(3===e[0].length&&f(e[0][0])&&f(e[0][1])&&f(e[0][2])))return!1;if(e.some((function(e){return 3!==e.length||!f(e[0])||!f(e[1])||!f(e[2])})))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=[],n=[],i=0;i<e.length-1;i++)for(var a=i+1;a<e.length;a++)2===e[0].length?(r=[e[i][0],e[i][1]],n=[e[a][0],e[a][1]]):3===e[0].length&&(r=[e[i][0],e[i][1],e[i][2]],n=[e[a][0],e[a][1],e[a][2]]),t.push(g(r,n));return t}(e)}});function f(e){return"number"==typeof e||a(e)}function l(e){return e.constructor!==Array&&(e=d(e)),f(e[0])&&f(e[1])}function p(e){return e.constructor!==Array&&(e=d(e)),f(e[0])&&f(e[1])&&f(e[2])}function m(e){return Array.isArray(e)||(e=d(e)),e.every(f)}function h(e){return e.constructor!==Array&&(e=d(e)),f(e[0])&&f(e[1])&&f(e[2])&&f(e[3])&&f(e[4])&&f(e[5])}function d(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function v(e,t,n,a,u){var f=c(r(r(i(n,e),i(a,t)),u)),l=s(r(i(n,n),i(a,a)));return o(f,l)}function y(e,t,a,u,c,f,l,p,m){var h=[n(i(n(c,t),m),i(n(f,a),p)),n(i(n(f,a),l),i(n(u,e),m)),n(i(n(u,e),p),i(n(c,t),l))];h=s(r(r(i(h[0],h[0]),i(h[1],h[1])),i(h[2],h[2])));var d=s(r(r(i(l,l),i(p,p)),i(m,m)));return o(h,d)}function g(e,t){for(var a=e.length,o=0,u=0,c=0;c<a;c++)u=n(e[c],t[c]),o=r(i(u,u),o);return s(o)}})),dh=Ee("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],(function(e){var t=e.typed,r=e.config,n=e.abs,i=e.add,a=e.addScalar,o=e.matrix,u=e.multiply,s=e.multiplyScalar,c=e.divideScalar,f=e.subtract,l=e.smaller,p=e.equalScalar,m=e.flatten,h=e.isZero,d=e.isNumeric;return t("intersect",{"Array, Array, Array":v,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(e,t,r){var n=v(e.valueOf(),t.valueOf(),r.valueOf());return null===n?null:o(n)},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){var i=y(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===i?null:o(i)}});function v(e,t,r){if(e=g(e),t=g(t),r=g(r),!b(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&d(e[0])&&d(e[1])&&d(e[2])&&d(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,i,o,u,l,p,m){var h=s(e,u),d=s(n,u),v=s(t,l),y=s(i,l),g=s(r,p),x=s(o,p),b=f(f(f(m,h),v),g),w=f(f(f(a(a(d,y),x),h),v),g),N=c(b,w);return[a(e,s(N,f(n,e))),a(t,s(N,f(i,t))),a(r,s(N,f(o,r)))]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])}function y(e,t,o,m){if(e=g(e),t=g(t),o=g(o),m=g(m),2===e.length){if(!x(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!x(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!x(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!x(m))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,o,p){var m=e,d=o,v=f(m,t),y=f(d,p),g=f(s(v[0],y[1]),s(y[0],v[1]));if(h(g))return null;if(l(n(g),r.epsilon))return null;var x=s(y[0],m[1]),b=s(y[1],m[0]),w=s(y[0],d[1]),N=s(y[1],d[0]),D=c(a(f(f(x,b),w),N),g);return i(u(v,D),m)}(e,t,o,m)}if(3===e.length){if(!b(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!b(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!b(m))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,o,u,l,m,d,v,y){var g=w(e,u,d,u,t,l,v,l,r,m,y,m),x=w(d,u,n,e,v,l,i,t,y,m,o,r),b=w(e,u,n,e,t,l,i,t,r,m,o,r),N=w(d,u,d,u,v,l,v,l,y,m,y,m),D=w(n,e,n,e,i,t,i,t,o,r,o,r),E=f(s(g,x),s(b,N)),A=f(s(D,N),s(x,x));if(h(A))return null;var S=c(E,A),C=c(a(g,s(S,x)),N),M=a(e,s(S,f(n,e))),F=a(t,s(S,f(i,t))),O=a(r,s(S,f(o,r))),T=a(u,s(C,f(d,u))),B=a(l,s(C,f(v,l))),_=a(m,s(C,f(y,m)));return p(M,T)&&p(F,B)&&p(O,_)?[M,F,O]:null}(e[0],e[1],e[2],t[0],t[1],t[2],o[0],o[1],o[2],m[0],m[1],m[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function g(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((function(e){return Array.isArray(e)&&1===e.length}))?m(e):e}function x(e){return 2===e.length&&d(e[0])&&d(e[1])}function b(e){return 3===e.length&&d(e[0])&&d(e[1])&&d(e[2])}function w(e,t,r,n,i,o,u,c,l,p,m,h){var d=s(f(e,t),f(r,n)),v=s(f(i,o),f(u,c)),y=s(f(l,p),f(m,h));return a(a(d,v),y)}})),vh=Ee("sum",["typed","config","add","numeric"],(function(e){var t=e.typed,r=e.config,n=e.add,i=e.numeric;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return Gn(e,t,n)}catch(e){throw ks(e,"sum")}},"...":function(e){if(Un(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return $n(e,(function(e){try{t=void 0===t?e:n(t,e)}catch(t){throw ks(t,"sum",e)}})),void 0===t&&(t=i(0,r.number)),"string"==typeof t&&(t=i(t,r.number)),t}})),yh="cumsum",gh=Ee(yh,["typed","add","unaryPlus"],(function(e){var t=e.typed,r=e.add,n=e.unaryPlus;return t(yh,{Array:i,Matrix:function(e){return e.create(i(e.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(e,t){return e.create(o(e.valueOf(),t))},"...":function(e){if(Un(e))throw new TypeError("All values expected to be scalar in function cumsum");return i(e)}});function i(e){try{return a(e)}catch(e){throw ks(e,yh)}}function a(e){if(0===e.length)return[];for(var t=[n(e[0])],i=1;i<e.length;++i)t.push(r(t[i-1],e[i]));return t}function o(e,t){var r=an(e);if(t<0||t>=r.length)throw new nn(t,r.length);try{return u(e,t)}catch(e){throw ks(e,yh)}}function u(e,t){var r,n,i;if(t<=0){var o=e[0][0];if(Array.isArray(o)){for(i=Ln(e),n=[],r=0;r<i.length;r++)n[r]=u(i[r],t-1);return n}return a(e)}for(n=[],r=0;r<e.length;r++)n[r]=u(e[r],t-1);return n}})),xh="mean",bh=Ee(xh,["typed","add","divide"],(function(e){var t=e.typed,r=e.add,n=e.divide;return t(xh,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{var i=Gn(e,t,r),a=Array.isArray(e)?an(e):e.size();return n(i,a[t])}catch(e){throw ks(e,"mean")}},"...":function(e){if(Un(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){var t,i=0;if($n(e,(function(e){try{t=void 0===t?e:r(t,e),i++}catch(t){throw ks(t,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return n(t,i)}})),wh="median",Nh=Ee(wh,["typed","add","divide","compare","partitionSelect"],(function(e){var t=e.typed,r=e.add,n=e.divide,i=e.compare,a=e.partitionSelect;function o(e){try{var t=(e=bn(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2==0){for(var r=t/2-1,n=a(e,r+1),o=e[r],c=0;c<r;++c)i(e[c],o)>0&&(o=e[c]);return s(o,n)}var f=a(e,(t-1)/2);return u(f)}catch(e){throw ks(e,"median")}}var u=t({"number | BigNumber | Complex | Unit":function(e){return e}}),s=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return n(r(e,t),2)}});return t(wh,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(Un(e))throw new TypeError("Scalar values expected in function median");return o(e)}})})),Dh=Ee("mad",["typed","abs","map","median","subtract"],(function(e){var t=e.typed,r=e.abs,n=e.map,i=e.median,a=e.subtract;return t("mad",{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=bn(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(n(e,(function(e){return r(a(e,t))})))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):ks(e,"mad")}}})),Eh="unbiased",Ah="variance",Sh=Ee(Ah,["typed","add","subtract","multiply","divide","apply","isNaN"],(function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,o=e.divide,u=e.apply,s=e.isNaN;return t(Ah,{"Array | Matrix":function(e){return c(e,Eh)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(e,t){return f(e,t,Eh)},"Array | Matrix, number | BigNumber, string":f,"...":function(e){return c(e,Eh)}});function c(e,t){var u,c=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if($n(e,(function(e){try{u=void 0===u?e:r(u,e),c++}catch(t){throw ks(t,"variance",e)}})),0===c)throw new Error("Cannot calculate variance of an empty array");var f=o(u,c);if(u=void 0,$n(e,(function(e){var t=n(e,f);u=void 0===u?i(t,t):r(u,i(t,t))})),s(u))return u;switch(t){case"uncorrected":return o(u,c);case"biased":return o(u,c+1);case"unbiased":var l=a(u)?u.mul(0):0;return 1===c?l:o(u,c-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function f(e,t,r){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return u(e,t,(function(e){return c(e,r)}))}catch(e){throw ks(e,"variance")}}})),Ch="quantileSeq",Mh=Ee(Ch,["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(function(e){var t=e.typed,r=e.bignumber,n=e.add,a=e.subtract,o=e.divide,u=e.multiply,s=e.partitionSelect,c=e.compare,f=e.isInteger,l=e.smaller,p=e.smallerEq,m=e.larger,h=ma({typed:t,isInteger:f});return t(Ch,{"Array | Matrix, number | BigNumber":function(e,t){return v(e,t,!1)},"Array | Matrix, number | BigNumber, number":function(e,t,r){return d(e,t,!1,r,v)},"Array | Matrix, number | BigNumber, boolean":v,"Array | Matrix, number | BigNumber, boolean, number":function(e,t,r,n){return d(e,t,r,n,v)},"Array | Matrix, Array | Matrix":function(e,t){return y(e,t,!1)},"Array | Matrix, Array | Matrix, number":function(e,t,r){return d(e,t,!1,r,y)},"Array | Matrix, Array | Matrix, boolean":y,"Array | Matrix, Array | Matrix, boolean, number":function(e,t,r,n){return d(e,t,r,n,y)}});function d(e,t,r,n,i){return h(e,n,(function(e){return i(e,t,r)}))}function v(e,t,a){var u,s=e.valueOf();if(l(t,0))throw new Error("N/prob must be non-negative");if(p(t,1))return i(t)?g(s,t,a):r(g(s,t,a));if(m(t,1)){if(!f(t))throw new Error("N must be a positive integer");if(m(t,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var c=n(t,1);u=[];for(var h=0;l(h,t);h++){var d=o(h+1,c);u.push(g(s,d,a))}return i(t)?u:r(u)}}function y(e,t,r){for(var n=e.valueOf(),i=t.valueOf(),a=[],o=0;o<i.length;++o)a.push(g(n,i[o],r));return a}function g(e,t,r){var o=bn(e),l=o.length;if(0===l)throw new Error("Cannot calculate quantile of an empty sequence");var p,m,h=i(t)?t*(l-1):t.times(l-1),d=i(t)?Math.floor(h):h.floor().toNumber(),v=i(t)?h%1:h.minus(d);if(f(h))return r?o[h]:s(o,i(t)?h:h.valueOf());if(r)p=o[d],m=o[d+1];else{m=s(o,d+1),p=o[d];for(var y=0;y<d;++y)c(o[y],p)>0&&(p=o[y])}return n(u(p,a(1,v)),u(m,v))}})),Fh=Ee("std",["typed","map","sqrt","variance"],(function(e){var t=e.typed,r=e.map,n=e.sqrt,i=e.variance;return t("std",{"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(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return p(a)?r(a,n):n(a)}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}})),Oh="corr",Th=Ee(Oh,["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],(function(e){var t=e.typed,r=e.matrix,n=e.sqrt,i=e.sum,a=e.add,o=e.subtract,u=e.multiply,s=e.pow,c=e.divide;return t(Oh,{"Array, Array":function(e,t){return f(e,t)},"Matrix, Matrix":function(e,t){var n=f(e.toArray(),t.toArray());return Array.isArray(n)?r(n):n}});function f(e,t){var r=[];if(Array.isArray(e[0])&&Array.isArray(t[0])){if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var n=0;n<e.length;n++){if(e[n].length!==t[n].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");r.push(l(e[n],t[n]))}return r}if(e.length!==t.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return l(e,t)}function l(e,t){var r=e.length,f=i(e),l=i(t),p=e.reduce((function(e,r,n){return a(e,u(r,t[n]))}),0),m=i(e.map((function(e){return s(e,2)}))),h=i(t.map((function(e){return s(e,2)}))),d=o(u(r,p),u(f,l)),v=n(u(o(u(r,m),s(f,2)),o(u(r,h),s(l,2))));return c(d,v)}}));function Bh(e,t){if(t<e)return 1;if(t===e)return t;var r=t+e>>1;return Bh(e,r)*Bh(r+1,t)}function _h(e,t){if(!V(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!V(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(t>e)throw new TypeError("k must be less than or equal to n");for(var r=e-t,n=1,i=2,a=t<r?t:r,o=t<r?r+1:t+1;o<=e;++o)for(n*=o;i<=a&&n%i==0;)n/=i,++i;return i<=a&&(n/=Bh(i,a)),n}_h.signature="number, number";var kh="combinations",Ih=Ee(kh,["typed"],(function(e){return(0,e.typed)(kh,{"number, number":_h,"BigNumber, BigNumber":function(e,t){var r,n,i=e.constructor,a=e.minus(t),o=new i(1);if(!Rh(e)||!Rh(t))throw new TypeError("Positive integer value expected in function combinations");if(t.gt(e))throw new TypeError("k must be less than n in function combinations");if(r=o,t.lt(a))for(n=o;n.lte(a);n=n.plus(o))r=r.times(t.plus(n)).dividedBy(n);else for(n=o;n.lte(t);n=n.plus(o))r=r.times(a.plus(n)).dividedBy(n);return r}})}));function Rh(e){return e.isInteger()&&e.gte(0)}var zh="combinationsWithRep",qh=Ee(zh,["typed"],(function(e){return(0,e.typed)(zh,{"number, number":function(e,t){if(!V(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!V(t)||t<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return t<e-1?Bh(e,e+t-1)/Bh(1,t):Bh(t+1,e+t-1)/Bh(1,e-1)},"BigNumber, BigNumber":function(e,t){var r,n,i=new(0,e.constructor)(1),a=e.minus(i);if(!jh(e)||!jh(t))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e.lt(i))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(r=i,t.lt(a))for(n=i;n.lte(a);n=n.plus(i))r=r.times(t.plus(n)).dividedBy(n);else for(n=i;n.lte(t);n=n.plus(i))r=r.times(a.plus(n)).dividedBy(n);return r}})}));function jh(e){return e.isInteger()&&e.gte(0)}function Ph(e){var t;if(V(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:Bh(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*Ph(1-e));if(e>=171.35)return 1/0;if(e>85){var r=e*e,n=r*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*r)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=Uh[0];for(var o=1;o<Uh.length;++o)t+=Uh[o]/(e+o);var u=e+Lh+.5;return Math.sqrt(2*Math.PI)*Math.pow(u,e+.5)*Math.exp(-u)*t}Ph.signature="number";var Lh=4.7421875,Uh=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],$h=.9189385332046728,Hh=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function Gh(e){if(e<0)return NaN;if(0===e)return 1/0;if(!isFinite(e))return e;if(e<.5)return Math.log(Math.PI/Math.sin(Math.PI*e))-Gh(1-e);for(var t=5+(e-=1)+.5,r=Hh[0],n=6;n>=1;n--)r+=Hh[n]/(e+n);return $h+(e+.5)*Math.log(t)-t+Math.log(r)}Gh.signature="number";var Vh="gamma",Zh=Ee(Vh,["typed","config","multiplyScalar","pow","BigNumber","Complex"],(function(e){var t=e.typed,r=e.config,n=(e.multiplyScalar,e.pow,e.BigNumber),i=e.Complex;return t(Vh,{number:Ph,Complex:function e(t){if(0===t.im)return Ph(t.re);if(t.re<.5){var r=new i(1-t.re,-t.im),n=new i(Math.PI*t.re,Math.PI*t.im);return new i(Math.PI).div(n.sin()).div(e(r))}t=new i(t.re-1,t.im);for(var a=new i(Uh[0],0),o=1;o<Uh.length;++o){var u=new i(Uh[o],0);a=a.add(u.div(t.add(o)))}var s=new i(t.re+Lh+.5,t.im),c=Math.sqrt(2*Math.PI),f=s.pow(t.add(.5)),l=s.neg().exp();return a.mul(c).mul(f).mul(l)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new n(1/0):a(e.minus(1));if(!e.isFinite())return new n(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function a(e){if(e<8)return new n([1,1,2,6,24,120,720,5040][e]);var t=r.precision+(0|Math.log(e.toNumber())),i=n.clone({precision:t});if(e%2==1)return e.times(a(new n(e-1)));for(var o=e,u=new i(e),s=e.toNumber();o>2;)s+=o-=2,u=u.times(s);return new n(u.toPrecision(n.precision))}})),Wh="lgamma",Yh=Ee(Wh,["Complex","typed"],(function(e){var t=e.Complex,r=e.typed,n=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(Wh,{number:Gh,Complex:function e(r){if(r.isNaN())return new t(NaN,NaN);if(0===r.im)return new t(Gh(r.re),0);if(r.re>=7||Math.abs(r.im)>=7)return i(r);if(r.re<=.1){var n=(s=6.283185307179586,(!0^((c=r.im)>0||!(c<0)&&1/c==1/0)?-s:s)*Math.floor(.5*r.re+.25)),o=r.mul(Math.PI).sin().log(),u=e(new t(1-r.re,-r.im));return new t(1.1447298858494002,n).sub(o).sub(u)}return r.im>=0?a(r):a(r.conjugate()).conjugate();var s,c},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(e){for(var r=e.sub(.5).mul(e.log()).sub(e).add($h),i=new t(1,0).div(e),a=i.div(e),o=n[0],u=n[1],s=2*a.re,c=a.re*a.re+a.im*a.im,f=2;f<8;f++){var l=u;u=-c*o+n[f],o=s*o+l}var p=i.mul(a.mul(o).add(u));return r.add(p)}function a(e){var r=0,n=0,a=e;for(e=e.add(1);e.re<=7;){var o=(a=a.mul(e)).im<0?1:0;0!==o&&0===n&&r++,n=o,e=e.add(1)}return i(e).sub(a.log()).sub(new t(0,2*r*Math.PI*1))}})),Jh="factorial",Xh=Ee(Jh,["typed","gamma"],(function(e){var t=e.typed,r=e.gamma;return t(Jh,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return r(e.plus(1))},"Array | Matrix":t.referToSelf((function(e){return function(t){return Hn(t,e)}}))})})),Qh="kldivergence",Kh=Ee(Qh,["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],(function(e){var t=e.typed,r=e.matrix,n=e.divide,i=e.sum,a=e.multiply,o=e.map,u=e.dotDivide,s=e.log,c=e.isNumeric;return t(Qh,{"Array, Array":function(e,t){return f(r(e),r(t))},"Matrix, Array":function(e,t){return f(e,r(t))},"Array, Matrix":function(e,t){return f(r(e),t)},"Matrix, Matrix":function(e,t){return f(e,t)}});function f(e,t){var r=t.size().length,f=e.size().length;if(r>1)throw new Error("first object must be one dimensional");if(f>1)throw new Error("second object must be one dimensional");if(r!==f)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(t))throw new Error("Sum of elements in second object must be non zero");var l=n(e,i(e)),p=n(t,i(t)),m=i(a(l,o(u(l,p),(function(e){return s(e)}))));return c(m)?m:Number.NaN}})),ed="multinomial",td=Ee(ed,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(function(e){var t=e.typed,r=e.add,n=e.divide,i=e.multiply,a=e.factorial,o=e.isInteger,u=e.isPositive;return t(ed,{"Array | Matrix":function(e){var t=0,s=1;return $n(e,(function(e){if(!o(e)||!u(e))throw new TypeError("Positive integer value expected in function multinomial");t=r(t,e),s=i(s,a(e))})),n(a(t),s)}})})),rd="permutations",nd=Ee(rd,["typed","factorial"],(function(e){var t=e.typed,r=e.factorial;return t(rd,{"number | BigNumber":r,"number, number":function(e,t){if(!V(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!V(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(t>e)throw new TypeError("second argument k must be less than or equal to first argument n");return Bh(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!id(e)||!id(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=e.mul(0).add(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}})}));function id(e){return e.isInteger()&&e.gte(0)}r(2227);var ad=r(6377),od=ad(Date.now());function ud(e){var t,r;return t=null===(r=e)?od:ad(String(r)),function(){return t()}}var sd="pickRandom",cd=Ee(sd,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,a=ud(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(a=ud(e.randomSeed))})),t(sd,{"Array | Matrix":function(e){return o(e,{})},"Array | Matrix, Object":function(e,t){return o(e,t)},"Array | Matrix, number":function(e,t){return o(e,{number:t})},"Array | Matrix, Array | Matrix":function(e,t){return o(e,{weights:t})},"Array | Matrix, Array | Matrix, number":function(e,t,r){return o(e,{number:r,weights:t})},"Array | Matrix, number, Array | Matrix":function(e,t,r){return o(e,{number:t,weights:r})}});function o(e,t){var r=t.number,n=t.weights,o=t.elementWise,u=void 0===o||o,s=void 0===r;s&&(r=1);var c=l(e)?e.create:l(n)?n.create:null;e=e.valueOf(),n&&(n=n.valueOf()),!0===u&&(e=bn(e),n=bn(n));var f=0;if(void 0!==n){if(n.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var p=0,m=n.length;p<m;p++){if(!i(n[p])||n[p]<0)throw new Error("Weights must be an array of positive numbers");f+=n[p]}}for(var h,d=e.length,v=[];v.length<r;){if(void 0===n)h=e[Math.floor(a()*d)];else for(var y=a()*f,g=0,x=e.length;g<x;g++)if((y-=n[g])<0){h=e[g];break}v.push(h)}return s?v[0]:c?c(v):v}}));function fd(e,t){var r=[];if((e=e.slice(0)).length>1)for(var n=0,i=e.shift();n<i;n++)r.push(fd(e,t));else for(var a=0,o=e.shift();a<o;a++)r.push(t());return r}var ld="random",pd=Ee(ld,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,i=ud(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=ud(e.randomSeed))})),t(ld,{"":function(){return o(0,1)},number:function(e){return o(0,e)},"number, number":function(e,t){return o(e,t)},"Array | Matrix":function(e){return a(e,0,1)},"Array | Matrix, number":function(e,t){return a(e,0,t)},"Array | Matrix, number, number":function(e,t,r){return a(e,t,r)}});function a(e,t,r){var n=fd(e.valueOf(),(function(){return o(t,r)}));return l(e)?e.create(n):n}function o(e,t){return e+i()*(t-e)}})),md="randomInt",hd=Ee(md,["typed","config","?on"],(function(e){var t=e.typed,r=e.config,n=e.on,i=ud(r.randomSeed);return n&&n("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=ud(e.randomSeed))})),t(md,{"":function(){return o(0,1)},number:function(e){return o(0,e)},"number, number":function(e,t){return o(e,t)},"Array | Matrix":function(e){return a(e,0,1)},"Array | Matrix, number":function(e,t){return a(e,0,t)},"Array | Matrix, number, number":function(e,t,r){return a(e,t,r)}});function a(e,t,r){var n=fd(e.valueOf(),(function(){return o(t,r)}));return l(e)?e.create(n):n}function o(e,t){return Math.floor(e+i()*(t-e))}})),dd="stirlingS2",vd=Ee(dd,["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],(function(e){var t=e.typed,r=e.addScalar,n=(e.subtractScalar,e.multiplyScalar),a=(e.divideScalar,e.pow,e.factorial,e.combinations,e.isNegative),o=e.isInteger,u=e.number,s=e.bignumber,c=e.larger,f=[],l=[];return t(dd,{"number | BigNumber, number | BigNumber":function(e,t){if(!o(e)||a(e)||!o(t)||a(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(c(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");var p=!(i(e)&&i(t)),m=p?l:f,h=p?s:u,d=u(e),v=u(t);if(m[d]&&m[d].length>v)return m[d][v];for(var y=0;y<=d;++y)if(m[y]||(m[y]=[h(0===y?1:0)]),0!==y)for(var g=m[y],x=m[y-1],b=g.length;b<=y&&b<=v;++b)g[b]=b===y?1:r(n(h(b),x[b]),x[b-1]);return m[d][v]}})})),yd="bellNumbers",gd=Ee(yd,["typed","addScalar","isNegative","isInteger","stirlingS2"],(function(e){var t=e.typed,r=e.addScalar,n=e.isNegative,i=e.isInteger,a=e.stirlingS2;return t(yd,{"number | BigNumber":function(e){if(!i(e)||n(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,o=0;o<=e;o++)t=r(t,a(e,o));return t}})})),xd="catalan",bd=Ee(xd,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(function(e){var t=e.typed,r=e.addScalar,n=e.divideScalar,i=e.multiplyScalar,a=e.combinations,o=e.isNegative,u=e.isInteger;return t(xd,{"number | BigNumber":function(e){if(!u(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(e,2),e),r(e,1))}})})),wd="composition",Nd=Ee(wd,["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(function(e){var t=e.typed,r=e.addScalar,n=e.combinations,i=e.isPositive,a=(e.isNegative,e.isInteger),o=e.larger;return t(wd,{"number | BigNumber, number | BigNumber":function(e,t){if(!(a(e)&&i(e)&&a(t)&&i(t)))throw new TypeError("Positive integer value expected in function composition");if(o(t,e))throw new TypeError("k must be less than or equal to n in function composition");return n(r(e,-1),r(t,-1))}})})),Dd="leafCount",Ed=Ee(Dd,["parse","typed"],(function(e){function t(e){var r=0;return e.forEach((function(e){r+=t(e)})),r||1}return e.parse,(0,e.typed)(Dd,{Node:function(e){return t(e)}})}));function Ad(e){return T(e)||q(e)&&e.isUnary()&&T(e.args[0])}function Sd(e){return!!T(e)||!(!k(e)&&!q(e)||!e.args.every(Sd))||!(!j(e)||!Sd(e.content))}function Cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Md(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(r),!0).forEach((function(t){Ua(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cd(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}r(9588);var Fd=Ee("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(function(e){var t=e.FunctionNode,r=e.OperatorNode,n=e.SymbolNode,i=!0,a=!1,o="defaultF",u={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}};function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,n=o;if("string"==typeof e?n=e:q(e)?n=e.fn.toString():k(e)?n=e.name:j(e)&&(n="paren"),Ne(r,n)){var i=r[n];if(Ne(i,t))return i[t];if(Ne(u,n))return u[n][t]}if(Ne(r,o)){var a=r[o];return Ne(a,t)?a[t]:u[o][t]}if(Ne(u,n)){var s=u[n];if(Ne(s,t))return s[t]}return u[o][t]}function c(e){return s(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:u)}function f(e,t){var r,n=[];return c(e,t)?(r=e.op,function e(t){for(var i=0;i<t.args.length;i++){var a=t.args[i];q(a)&&r===a.op?e(a):n.push(a)}}(e),n):e.args}function l(e){return q(e)?function(t){try{return new r(e.op,e.fn,t,e.implicit)}catch(e){return console.error(e),[]}}:function(r){return new t(new n(e.name),r)}}return{createMakeNodeFunction:l,hasProperty:s,isCommutative:function(e){return s(e,"commutative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:u)},isAssociative:c,mergeContext:function(e,t){var r=Md({},e);for(var n in t)Ne(e,n)?r[n]=Md(Md({},t[n]),e[n]):r[n]=t[n];return r},flatten:function e(t,r){if(!t.args||0===t.args.length)return t;t.args=f(t,r);for(var n=0;n<t.args.length;n++)e(t.args[n],r)},allChildren:f,unflattenr:function e(t,r){if(t.args&&0!==t.args.length){for(var n=l(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(i>2&&c(t,r)){for(var o=t.args.pop();t.args.length>0;)o=n([t.args.pop(),o]);t.args=o.args}}},unflattenl:function e(t,r){if(t.args&&0!==t.args.length){for(var n=l(t),i=t.args.length,a=0;a<i;a++)e(t.args[a],r);if(i>2&&c(t,r)){for(var o=t.args.shift();t.args.length>0;)o=n([o,t.args.shift()]);t.args=o.args}}},defaultContext:u,realContext:{divide:{total:a},log:{total:a}},positiveContext:{subtract:{total:a},abs:{trivial:i},log:{total:i}}}})),Od=Ee("simplify",["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){e.config;var r=e.typed,n=e.parse,i=(e.add,e.subtract,e.multiply,e.divide,e.pow,e.isZero,e.equal),a=e.resolve,o=e.simplifyConstant,u=e.simplifyCore,s=(e.fraction,e.bignumber,e.mathWithTransform,e.matrix,e.AccessorNode),c=e.ArrayNode,f=e.ConstantNode,l=e.FunctionNode,p=e.IndexNode,m=e.ObjectNode,h=e.OperatorNode,d=e.ParenthesisNode,v=e.SymbolNode,y=Fd({FunctionNode:l,OperatorNode:h,SymbolNode:v}),g=y.hasProperty,x=y.isCommutative,b=y.isAssociative,w=y.mergeContext,N=y.flatten,D=y.unflattenr,E=y.unflattenl,A=y.createMakeNodeFunction,S=y.defaultContext,C=y.realContext,M=y.positiveContext;r.addConversion({from:"Object",to:"Map",convert:Ue});var F=r("simplify",{Node:R,"Node, Map":function(e,t){return R(e,!1,t)},"Node, Map, Object":function(e,t,r){return R(e,!1,t,r)},"Node, Array":R,"Node, Array, Map":R,"Node, Array, Map, Object":R});function O(e){return e.transform((function(e,t,r){return j(e)?O(e.content):e}))}r.removeConversion({from:"Object",to:"Map",convert:Ue}),F.defaultContext=S,F.realContext=C,F.positiveContext=M;var B={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};function _(e,t){var r={};if(e.s){var i=e.s.split("->");if(2!==i.length)throw SyntaxError("Could not parse rule: "+e.s);r.l=i[0],r.r=i[1]}else r.l=e.l,r.r=e.r;r.l=O(n(r.l)),r.r=O(n(r.r));for(var a=0,o=["imposeContext","repeat","assuming"];a<o.length;a++){var u=o[a];u in e&&(r[u]=e[u])}if(e.evaluate&&(r.evaluate=n(e.evaluate)),b(r.l,t)){var s,c=!x(r.l,t);c&&(s=I());var f=A(r.l),l=I();r.expanded={},r.expanded.l=f([r.l,l]),N(r.expanded.l,t),D(r.expanded.l,t),r.expanded.r=f([r.r,l]),c&&(r.expandedNC1={},r.expandedNC1.l=f([s,r.l]),r.expandedNC1.r=f([s,r.r]),r.expandedNC2={},r.expandedNC2.l=f([s,r.expanded.l]),r.expandedNC2.r=f([s,r.expanded.r]))}return r}F.rules=[u,{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}}},o,{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}}},o,{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"}];var k=0;function I(){return new v("_p"+k++)}function R(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Le(),i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i.consoleDebug;r=function(e,r){for(var n=[],i=0;i<e.length;i++){var a=e[i],o=void 0,u=t(a);switch(u){case"string":a={s:a};case"object":o=_(a,r);break;case"function":o=a;break;default:throw TypeError("Unsupported type of rule: "+u)}n.push(o)}return n}(r||F.rules,i.context);for(var u=a(e,n),s={},c=(u=O(u)).toString({parenthesis:"all"});!s[c];){s[c]=!0,k=0;var f=c;o&&console.log("Working on: ",c);for(var l=0;l<r.length;l++){var p="";if("function"==typeof r[l]?(u=r[l](u,i),o&&(p=r[l].name)):(N(u,i.context),u=q(u,r[l],i.context),o&&(p="".concat(r[l].l.toString()," -> ").concat(r[l].r.toString()))),o){var m=u.toString({parenthesis:"all"});m!==f&&(console.log("Applying",p,"produced",m),f=m)}E(u,i.context)}c=u.toString({parenthesis:"all"})}return u}function z(e,t,r){var n=e;if(e)for(var i=0;i<e.length;++i){var a=q(e[i],t,r);a!==e[i]&&(n===e&&(n=e.slice()),n[i]=a)}return n}function q(e,t,r){if(t.assuming)for(var n in t.assuming)for(var i in t.assuming[n])if(g(n,i,r)!==t.assuming[n][i])return e;var a=w(t.imposeContext,r),o=e;if(o instanceof h||o instanceof l){var u=z(o.args,t,r);u!==o.args&&((o=o.clone()).args=u)}else if(o instanceof d){if(o.content){var f=q(o.content,t,r);f!==o.content&&(o=new d(f))}}else if(o instanceof c){var v=z(o.items,t,r);v!==o.items&&(o=new c(v))}else if(o instanceof s){var y=o.object;o.object&&(y=q(o.object,t,r));var x=o.index;o.index&&(x=q(o.index,t,r)),y===o.object&&x===o.index||(o=new s(y,x))}else if(o instanceof p){var b=z(o.dimensions,t,r);b!==o.dimensions&&(o=new p(b))}else if(o instanceof m){var N=!1,D={};for(var E in o.properties)D[E]=q(o.properties[E],t,r),D[E]!==o.properties[E]&&(N=!0);N&&(o=new m(D))}var A=t.r,S=$(t.l,o,a)[0];if(!S&&t.expanded&&(A=t.expanded.r,S=$(t.expanded.l,o,a)[0]),!S&&t.expandedNC1&&(A=t.expandedNC1.r,(S=$(t.expandedNC1.l,o,a)[0])||(A=t.expandedNC2.r,S=$(t.expandedNC2.l,o,a)[0])),S){var C=o.implicit;o=A.clone(),C&&"implicit"in A&&(o.implicit=!0),o=o.transform((function(e){return e.isSymbolNode&&Ne(S.placeholders,e.name)?S.placeholders[e.name].clone():e}))}return t.repeat&&o!==e&&(o=q(o,t,r)),o}function P(e,t){var r={placeholders:{}};if(!e.placeholders&&!t.placeholders)return r;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var n in e.placeholders)if(Ne(e.placeholders,n)&&(r.placeholders[n]=e.placeholders[n],Ne(t.placeholders,n)&&!H(e.placeholders[n],t.placeholders[n])))return null;for(var i in t.placeholders)Ne(t.placeholders,i)&&(r.placeholders[i]=t.placeholders[i]);return r}function L(e,t){var r,n=[];if(0===e.length||0===t.length)return n;for(var i=0;i<e.length;i++)for(var a=0;a<t.length;a++)(r=P(e[i],t[a]))&&n.push(r);return n}function $(e,t,r,n){var a=[{placeholders:{}}];if(e instanceof h&&t instanceof h||e instanceof l&&t instanceof l){if(e instanceof h){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof l&&e.name!==t.name)return[];if(!(1===t.args.length&&1===e.args.length||!b(t,r)&&t.args.length===e.args.length||n)){if(t.args.length>=2&&2===e.args.length){for(var o=function(e,t){var r,n,i=[],a=A(e);if(x(e,t))for(var o=0;o<e.args.length;o++)(n=e.args.slice(0)).splice(o,1),r=1===n.length?n[0]:a(n),i.push(a([e.args[o],r]));else for(var u=1;u<e.args.length;u++){var s=e.args[0];u>1&&(s=a(e.args.slice(0,u))),r=1===(n=e.args.slice(u)).length?n[0]:a(n),i.push(a([s,r]))}return i}(t,r),u=[],s=0;s<o.length;s++){var c=$(e,o[s],r,!0);u=u.concat(c)}return u}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var p=[],m=0;m<e.args.length;m++){var d=$(e.args[m],t.args[m],r);if(0===d.length)break;p.push(d)}if(p.length!==e.args.length){if(!x(t,r)||1===e.args.length)return[];if(e.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var y=$(e.args[0],t.args[1],r);if(0===y.length)return[];var g=$(e.args[1],t.args[0],r);if(0===g.length)return[];p=[y,g]}a=function(e){if(0===e.length)return e;for(var t=e.reduce(L),r=[],n={},i=0;i<t.length;i++){var a=JSON.stringify(t[i]);n[a]||(n[a]=!0,r.push(t[i]))}return r}(p)}else if(e instanceof v){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(B[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(!T(t))return[];a[0].placeholders[e.name]=t;break;case"v":if(T(t))return[];a[0].placeholders[e.name]=t;break;case"vl":if(!U(t))return[];a[0].placeholders[e.name]=t;break;case"cd":if(!Ad(t))return[];a[0].placeholders[e.name]=t;break;case"vd":if(Ad(t))return[];a[0].placeholders[e.name]=t;break;case"ce":if(!Sd(t))return[];a[0].placeholders[e.name]=t;break;case"ve":if(Sd(t))return[];a[0].placeholders[e.name]=t;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof f))return[];if(!i(e.value,t.value))return[]}return a}function H(e,t){if(e instanceof f&&t instanceof f){if(!i(e.value,t.value))return!1}else if(e instanceof v&&t instanceof v){if(e.name!==t.name)return!1}else{if(!(e instanceof h&&t instanceof h||e instanceof l&&t instanceof l))return!1;if(e instanceof h){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof l&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var r=0;r<e.args.length;r++)if(!H(e.args[r],t.args[r]))return!1}return!0}return F}));function Td(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Bd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Bd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}function Bd(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var _d=Ee("simplifyConstant",["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],(function(e){var r=e.typed,n=e.config,i=e.mathWithTransform,a=e.matrix,o=e.fraction,s=e.bignumber,c=e.AccessorNode,f=e.ArrayNode,p=e.ConstantNode,m=e.FunctionNode,h=e.IndexNode,d=e.ObjectNode,v=e.OperatorNode,y=e.SymbolNode,g=Fd({FunctionNode:m,OperatorNode:v,SymbolNode:y}),x=g.isCommutative,b=g.isAssociative,w=g.allChildren,N=g.createMakeNodeFunction,D=r("simplifyConstant",{Node:function(e){return M(k(e,{}))},"Node, Object":function(e,t){return M(k(e,t))}});function E(e){return u(e)?e.valueOf():e instanceof Array?e.map(E):l(e)?a(E(e.valueOf())):e}function A(e,t,r){try{return i[e].apply(null,t)}catch(n){return t=t.map(E),O(i[e].apply(null,t),r)}}var S=r({Fraction:function(e){var t,r=e.s*e.n;return t=r<0?new v("-","unaryMinus",[new p(-r)]):new p(r),1===e.d?t:new v("/","divide",[t,new p(e.d)])},number:function(e){return e<0?B(new p(-e)):new p(e)},BigNumber:function(e){return e<0?B(new p(-e)):new p(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new p(e)},Matrix:function(e){return new f(e.valueOf().map((function(e){return S(e)})))}});function M(e){return R(e)?e:S(e)}function F(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&o){var r=o(e),n=t&&"number"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n<n&&r.d<n)return r}return e}var O=r({"string, Object":function(e,t){return"BigNumber"===n.number?(void 0===s&&Hu(),s(e)):"Fraction"===n.number?(void 0===o&&Gu(),o(e)):F(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return F(e,t)},"Complex, Object":function(e,t){return 0!==e.im?e:F(e.re,t)},"Matrix, Object":function(e,t){return a(F(e.valueOf()))},"Array, Object":function(e,t){return e.map(F)}});function B(e){return new v("-","unaryMinus",[e])}function _(e,t,r,n){var i=t.shift(),a=t.reduce((function(t,i){if(!R(i)){var a=t.pop();if(R(a))return[a,i];try{return t.push(A(e,[a,i],n)),t}catch(e){t.push(a)}}t.push(M(t.pop()));var o=1===t.length?t[0]:r(t);return[r([o,M(i)])]}),[i]);return 1===a.length?a[0]:r([a[0],S(a[1])])}function k(e,r){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(t(e.value)){case"number":return O(e.value,r);case"string":return e.value;default:if(!isNaN(e.value))return O(e.value,r)}return e;case"FunctionNode":if(i[e.name]&&i[e.name].rawArgs)return e;if(-1===["add","multiply"].indexOf(e.name)){var n=e.args.map((function(e){return k(e,r)}));if(!n.some(R))try{return A(e.name,n,r)}catch(e){}if("size"===e.name&&1===n.length&&C(n[0])){for(var o=[],u=n[0];C(u);)o.push(u.items.length),u=u.items[0];return a(o)}return new m(e.name,n.map(M))}case"OperatorNode":var s,v,y=e.fn.toString(),g=N(e);if(q(e)&&e.isUnary())v=R((s=[k(e.args[0],r)])[0])?g(s):A(y,s,r);else if(b(e,r.context))if(s=(s=w(e,r.context)).map((function(e){return k(e,r)})),x(y,r.context)){for(var E=[],S=[],F=0;F<s.length;F++)R(s[F])?S.push(s[F]):E.push(s[F]);E.length>1?(v=_(y,E,g,r),S.unshift(v),v=_(y,S,g,r)):v=_(y,s,g,r)}else v=_(y,s,g,r);else v=_(y,s=e.args.map((function(e){return k(e,r)})),g,r);return v;case"ParenthesisNode":return k(e.content,r);case"AccessorNode":return function(e,t,r){if(!I(t))return new c(M(e),M(t));if(C(e)||l(e)){for(var n=Array.from(t.dimensions);n.length>0;)if(T(n[0])&&"string"!=typeof n[0].value){var i=O(n.shift().value,r);C(e)?e=e.items[i-1]:(e=e.valueOf()[i-1])instanceof Array&&(e=a(e))}else{if(!(n.length>1&&T(n[1])&&"string"!=typeof n[1].value))break;var o,u=O(n[1].value,r),s=[],m=C(e)?e.items:e.valueOf(),d=Td(m);try{for(d.s();!(o=d.n()).done;){var v=o.value;if(C(v))s.push(v.items[u-1]);else{if(!l(e))break;s.push(v[u-1])}}}catch(e){d.e(e)}finally{d.f()}if(s.length!==m.length)break;e=C(e)?new f(s):a(s),n.splice(1,1)}return n.length===t.dimensions.length?new c(M(e),t):n.length>0?(t=new h(n),new c(M(e),t)):e}if(z(e)&&1===t.dimensions.length&&T(t.dimensions[0])){var y=t.dimensions[0].value;return y in e.properties?e.properties[y]:new p}return new c(M(e),t)}(k(e.object,r),k(e.index,r),r);case"ArrayNode":var B=e.items.map((function(e){return k(e,r)}));return B.some(R)?new f(B.map(M)):a(B);case"IndexNode":return new h(e.dimensions.map((function(e){return D(e,r)})));case"ObjectNode":var j={};for(var P in e.properties)j[P]=D(e.properties[P],r);return new d(j);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return D})),kd="simplifyCore",Id=Ee(kd,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){var t=e.typed,r=(e.parse,e.equal),n=e.isZero,i=(e.add,e.subtract,e.multiply,e.divide,e.pow,e.AccessorNode),a=e.ArrayNode,o=e.ConstantNode,u=e.FunctionNode,s=e.IndexNode,c=e.ObjectNode,f=e.OperatorNode,l=(e.ParenthesisNode,e.SymbolNode),p=new o(0),m=new o(1),h=new o(!0),d=new o(!1);function v(e){return q(e)&&["and","not","or"].includes(e.op)}var y=Fd({FunctionNode:u,OperatorNode:f,SymbolNode:l}),g=y.hasProperty,x=y.isCommutative;function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t?t.context:void 0;if(g(e,"trivial",o)){if(k(e)&&1===e.args.length)return b(e.args[0],t);var l=!1,y=0;if(e.forEach((function(e){1==++y&&(l=b(e,t))})),1===y)return l}var w=e;if(k(w)){var N=function(e){var t,r="OperatorNode:"+e,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Ep(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ep(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw a}}}}(Ap);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(r in i)return i[r].op}}catch(e){n.e(e)}finally{n.f()}return null}(w.name);if(!N)return new u(b(w.fn),w.args.map((function(e){return b(e,t)})));if(w.args.length>2&&g(w,"associative",o))for(;w.args.length>2;){var D=w.args.pop(),E=w.args.pop();w.args.push(new f(N,w.name,[D,E]))}w=new f(N,w.name,w.args)}if(q(w)&&w.isUnary()){var A=b(w.args[0],t);if("~"===w.op&&q(A)&&A.isUnary()&&"~"===A.op)return A.args[0];if("not"===w.op&&q(A)&&A.isUnary()&&"not"===A.op&&v(A.args[0]))return A.args[0];var M=!0;if("-"===w.op&&q(A)&&(A.isBinary()&&"subtract"===A.fn&&(w=new f("-","subtract",[A.args[1],A.args[0]]),M=!1),A.isUnary()&&"-"===A.op))return A.args[0];if(M)return new f(w.op,w.fn,[A])}if(q(w)&&w.isBinary()){var F=b(w.args[0],t),O=b(w.args[1],t);if("+"===w.op){if(T(F)&&n(F.value))return O;if(T(O)&&n(O.value))return F;q(O)&&O.isUnary()&&"-"===O.op&&(O=O.args[0],w=new f("-","subtract",[F,O]))}if("-"===w.op)return q(O)&&O.isUnary()&&"-"===O.op?b(new f("+","add",[F,O.args[0]]),t):T(F)&&n(F.value)?b(new f("-","unaryMinus",[O])):T(O)&&n(O.value)?F:new f(w.op,w.fn,[F,O]);if("*"===w.op){if(T(F)){if(n(F.value))return p;if(r(F.value,1))return O}if(T(O)){if(n(O.value))return p;if(r(O.value,1))return F;if(x(w,o))return new f(w.op,w.fn,[O,F],w.implicit)}return new f(w.op,w.fn,[F,O],w.implicit)}if("/"===w.op)return T(F)&&n(F.value)?p:T(O)&&r(O.value,1)?F:new f(w.op,w.fn,[F,O]);if("^"===w.op&&T(O)){if(n(O.value))return m;if(r(O.value,1))return F}if("and"===w.op){if(T(F)){if(!F.value)return d;if(v(O))return O}if(T(O)){if(!O.value)return d;if(v(F))return F}}if("or"===w.op){if(T(F)){if(F.value)return h;if(v(O))return O}if(T(O)){if(O.value)return h;if(v(F))return F}}return new f(w.op,w.fn,[F,O])}if(q(w))return new f(w.op,w.fn,w.args.map((function(e){return b(e,t)})));if(C(w))return new a(w.items.map((function(e){return b(e,t)})));if(S(w))return new i(b(w.object,t),b(w.index,t));if(I(w))return new s(w.dimensions.map((function(e){return b(e,t)})));if(z(w)){var B={};for(var _ in w.properties)B[_]=b(w.properties[_],t);return new c(B)}return w}return t(kd,{Node:b,"Node,Object":b})})),Rd=Ee("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],(function(e){var t=e.typed,r=e.parse,n=e.ConstantNode,i=e.FunctionNode,a=e.OperatorNode,o=e.ParenthesisNode;function u(e,t){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!t)return e;if(U(e)){if(s.has(e.name)){var c=Array.from(s).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(c,"}"))}var f=t.get(e.name);if(R(f)){var l=new Set(s);return l.add(e.name),u(f,t,l)}return"number"==typeof f?r(String(f)):void 0!==f?new n(f):e}if(q(e)){var p=e.args.map((function(e){return u(e,t,s)}));return new a(e.op,e.fn,p,e.implicit)}if(j(e))return new o(u(e.content,t,s));if(k(e)){var m=e.args.map((function(e){return u(e,t,s)}));return new i(e.name,m)}return e.map((function(e){return u(e,t,s)}))}return t("resolve",{Node:u,"Node, Map | null | undefined":u,"Node, Object":function(e,t){return u(e,Ue(t))},"Array | Matrix":t.referToSelf((function(e){return function(t){return t.map((function(t){return e(t)}))}})),"Array | Matrix, null | undefined":t.referToSelf((function(e){return function(t){return t.map((function(t){return e(t)}))}})),"Array, Object":t.referTo("Array,Map",(function(e){return function(t,r){return e(t,Ue(r))}})),"Matrix, Object":t.referTo("Matrix,Map",(function(e){return function(t,r){return e(t,Ue(r))}})),"Array | Matrix, Map":t.referToSelf((function(e){return function(t,r){return t.map((function(t){return e(t,r)}))}}))})})),zd="symbolicEqual",qd=Ee(zd,["parse","simplify","typed","OperatorNode"],(function(e){e.parse;var t=e.simplify,r=e.typed,n=e.OperatorNode;function i(e,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new n("-","subtract",[e,r]),o=t(a,{},i);return T(o)&&!o.value}return r(zd,{"Node, Node":i,"Node, Node, Object":i})})),jd="derivative",Pd=Ee(jd,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){var t=e.typed,r=e.config,n=e.parse,i=e.simplify,a=e.equal,o=e.isZero,u=e.numeric,s=e.ConstantNode,c=e.FunctionNode,f=e.OperatorNode,l=e.ParenthesisNode,p=e.SymbolNode;function m(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0},n={};v(n,e,t.name);var a=y(e,n);return r.simplify?i(a):a}t.addConversion({from:"identifier",to:"SymbolNode",convert:n});var h=t(jd,{"Node, SymbolNode":m,"Node, SymbolNode, Object":m});t.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),h._simplify=!0,h.toTex=function(e){return d.apply(null,e.args)};var d=t("_derivTex",{"Node, SymbolNode":function(e,t){return T(e)&&"string"===H(e.value)?d(n(e.value).toString(),t.toString(),1):d(e.toTex(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===H(t.value))return d(e,n(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return d(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),v=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,r){return v(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return-1===t.params.indexOf(r)?(e[t]=!0,!0):v(e,t.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(t.args.length>0){for(var n=v(e,t.args[0],r),i=1;i<t.args.length;++i)n=v(e,t.args[i],r)&&n;if(n)return e[t]=!0,!0}return!1}}),y=t("_derivative",{"ConstantNode, Object":function(e){return g(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?g(0):g(1)},"ParenthesisNode, Object":function(e,t){return new l(y(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?g(0):y(e.expr,t)},"FunctionNode, Object":function(e,t){if(void 0!==t[e])return g(0);var r,n,i,a,o=e.args[0],u=!1,s=!1;switch(e.name){case"cbrt":u=!0,n=new f("*","multiply",[g(3),new f("^","pow",[o,new f("/","divide",[g(2),g(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)u=!0,n=new f("*","multiply",[g(2),new c("sqrt",[o])]);else if(2===e.args.length)return t[r=new f("/","divide",[g(1),e.args[1]])]=t[e.args[1]],y(new f("^","pow",[o,r]),t);break;case"log10":r=g(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&void 0!==t[e.args[1]])n=new f("*","multiply",[o.clone(),new c("log",[r||e.args[1]])]),u=!0;else if(2===e.args.length)return y(new f("/","divide",[new c("log",[o]),new c("log",[e.args[1]])]),t)}else n=o.clone(),u=!0;break;case"pow":if(2===e.args.length)return t[r]=t[e.args[1]],y(new f("^","pow",[o,e.args[1]]),t);break;case"exp":n=new c("exp",[o.clone()]);break;case"sin":n=new c("cos",[o.clone()]);break;case"cos":n=new f("-","unaryMinus",[new c("sin",[o.clone()])]);break;case"tan":n=new f("^","pow",[new c("sec",[o.clone()]),g(2)]);break;case"sec":n=new f("*","multiply",[e,new c("tan",[o.clone()])]);break;case"csc":s=!0,n=new f("*","multiply",[e,new c("cot",[o.clone()])]);break;case"cot":s=!0,n=new f("^","pow",[new c("csc",[o.clone()]),g(2)]);break;case"asin":u=!0,n=new c("sqrt",[new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])])]);break;case"acos":u=!0,s=!0,n=new c("sqrt",[new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])])]);break;case"atan":u=!0,n=new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)]);break;case"asec":u=!0,n=new f("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acsc":u=!0,s=!0,n=new f("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acot":u=!0,s=!0,n=new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)]);break;case"sinh":n=new c("cosh",[o.clone()]);break;case"cosh":n=new c("sinh",[o.clone()]);break;case"tanh":n=new f("^","pow",[new c("sech",[o.clone()]),g(2)]);break;case"sech":s=!0,n=new f("*","multiply",[e,new c("tanh",[o.clone()])]);break;case"csch":s=!0,n=new f("*","multiply",[e,new c("coth",[o.clone()])]);break;case"coth":s=!0,n=new f("^","pow",[new c("csch",[o.clone()]),g(2)]);break;case"asinh":u=!0,n=new c("sqrt",[new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)])]);break;case"acosh":u=!0,n=new c("sqrt",[new f("-","subtract",[new f("^","pow",[o.clone(),g(2)]),g(1)])]);break;case"atanh":u=!0,n=new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])]);break;case"asech":u=!0,s=!0,n=new f("*","multiply",[o.clone(),new c("sqrt",[new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])])])]);break;case"acsch":u=!0,s=!0,n=new f("*","multiply",[new c("abs",[o.clone()]),new c("sqrt",[new f("+","add",[new f("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acoth":u=!0,s=!0,n=new f("-","subtract",[g(1),new f("^","pow",[o.clone(),g(2)])]);break;case"abs":n=new f("/","divide",[new c(new p("abs"),[o.clone()]),o.clone()]);break;default:throw new 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')}u?(i="/",a="divide"):(i="*",a="multiply");var l=y(o,t);return s&&(l=new f("-","unaryMinus",[l])),new f(i,a,[l,n])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return g(0);if("+"===e.op)return new f(e.op,e.fn,e.args.map((function(e){return y(e,t)})));if("-"===e.op){if(e.isUnary())return new f(e.op,e.fn,[y(e.args[0],t)]);if(e.isBinary())return new f(e.op,e.fn,[y(e.args[0],t),y(e.args[1],t)])}if("*"===e.op){var r=e.args.filter((function(e){return void 0!==t[e]}));if(r.length>0){var n=e.args.filter((function(e){return void 0===t[e]})),i=1===n.length?n[0]:new f("*","multiply",n),u=r.concat(y(i,t));return new f("*","multiply",u)}return new f("+","add",e.args.map((function(r){return new f("*","multiply",e.args.map((function(e){return e===r?y(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var s=e.args[0],l=e.args[1];return void 0!==t[l]?new f("/","divide",[y(s,t),l]):void 0!==t[s]?new f("*","multiply",[new f("-","unaryMinus",[s]),new f("/","divide",[y(l,t),new f("^","pow",[l.clone(),g(2)])])]):new f("/","divide",[new f("-","subtract",[new f("*","multiply",[y(s,t),l.clone()]),new f("*","multiply",[s.clone(),y(l,t)])]),new f("^","pow",[l.clone(),g(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],m=e.args[1];if(void 0!==t[p])return T(p)&&(o(p.value)||a(p.value,1))?g(0):new f("*","multiply",[e,new f("*","multiply",[new c("log",[p.clone()]),y(m.clone(),t)])]);if(void 0!==t[m]){if(T(m)){if(o(m.value))return g(0);if(a(m.value,1))return y(p,t)}var h=new f("^","pow",[p.clone(),new f("-","subtract",[m,g(1)])]);return new f("*","multiply",[m.clone(),new f("*","multiply",[y(p,t),h])])}return new f("*","multiply",[new f("^","pow",[p.clone(),m.clone()]),new f("+","add",[new f("*","multiply",[y(p,t),new f("/","divide",[m.clone(),p.clone()])]),new f("*","multiply",[y(m,t),new c("log",[p.clone()])])])])}throw new 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 g(e,t){return new s(u(e,t||r.number))}return h})),Ld="rationalize",Ud=Ee(Ld,["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"],(function(e){e.config;var t=e.typed,r=(e.equal,e.isZero,e.add,e.subtract,e.multiply,e.divide,e.pow,e.parse,e.simplifyConstant),n=e.simplifyCore,i=e.simplify,a=(e.fraction,e.bignumber,e.mathWithTransform,e.matrix,e.AccessorNode,e.ArrayNode,e.ConstantNode),o=(e.FunctionNode,e.IndexNode,e.ObjectNode,e.OperatorNode),u=e.SymbolNode;function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=function(){var e=[n,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},r,{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)"}],i=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],a={};return a.firstRules=e.concat(t,i),a.distrDivRules=[{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)"}],a.sucDivRules=i,a.firstRulesAgain=e.concat(t),a.finalRules=[n,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},r,{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))"}],a}(),u=function(e,t,r,n){var a=[],o=i(e,n,t,{exactFractions:!1}),u="+-*"+((r=!!r)?"/":"");!function e(t){var r=t.type;if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!V(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===u.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n<t.args.length;n++)e(t.args[n])}else if("SymbolNode"===r){var i=t.name;-1===a.indexOf(i)&&a.push(i)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw new Error("type "+r+" is not allowed in polynomial expression")}(o);var s={};return s.expression=o,s.variables=a,s}(e,t,!0,o.firstRules),s=u.variables.length,l={exactFractions:!1},p={exactFractions:!0};if(e=u.expression,s>=1){var m,h;e=c(e);var d,v=!0,y=!1;for(e=i(e,o.firstRules,{},l);h=v?o.distrDivRules:o.sucDivRules,v=!v,(d=(e=i(e,h,{},p)).toString())!==m;)y=!0,m=d;y&&(e=i(e,o.firstRulesAgain,{},l)),e=i(e,o.finalRules,{},l)}var g=[],x={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===s&&(e.args[0]=f(e.args[0],g),e.args[1]=f(e.args[1])),a&&(x.numerator=e.args[0],x.denominator=e.args[1])):(1===s&&(e=f(e,g)),a&&(x.numerator=e,x.denominator=null)),a?(x.coefficients=g,x.variables=u.variables,x.expression=e,x):e}return e.ParenthesisNode,t(Ld,{Node:s,"Node, boolean":function(e,t){return s(e,{},t)},"Node, Object":s,"Node, Object, boolean":s});function c(e,t,r){var n=e.type,i=arguments.length>1;if("OperatorNode"===n&&e.isBinary()){var u,s=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(s=(u=parseFloat(e.args[1].value))>=2&&V(u))),s){if(u>2){var f=e.args[0],l=new o("^","pow",[e.args[0].cloneDeep(),new a(u-1)]);e=new o("*","multiply",[f,l])}else e=new o("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===r?t.content=e:t.args[r]=e)}}if("ParenthesisNode"===n)c(e.content,e,"content");else if("ConstantNode"!==n&&"SymbolNode"!==n)for(var p=0;p<e.args.length;p++)c(e.args[p],e,p);if(!i)return e}function f(e,t){void 0===t&&(t=[]),t[0]=0;var r=0,n="";!function e(i,a,o){var u=i.type;if("FunctionNode"===u)throw new Error("There is an unsolved function call");if("OperatorNode"===u){if(-1==="+-*^".indexOf(i.op))throw new Error("Operator "+i.op+" invalid");if(null!==a){if(("unaryMinus"===i.fn||"pow"===i.fn)&&"add"!==a.fn&&"subtract"!==a.fn&&"multiply"!==a.fn)throw new Error("Invalid "+i.op+" placing");if(("subtract"===i.fn||"add"===i.fn||"multiply"===i.fn)&&"add"!==a.fn&&"subtract"!==a.fn)throw new Error("Invalid "+i.op+" placing");if(("subtract"===i.fn||"add"===i.fn||"unaryMinus"===i.fn)&&0!==o.noFil)throw new Error("Invalid "+i.op+" placing")}"^"!==i.op&&"*"!==i.op||(o.fire=i.op);for(var s=0;s<i.args.length;s++)"unaryMinus"===i.fn&&(o.oper="-"),"+"!==i.op&&"subtract"!==i.fn||(o.fire="",o.cte=1,o.oper=0===s?"+":i.op),o.noFil=s,e(i.args[s],i,o)}else if("SymbolNode"===u){if(i.name!==n&&""!==n)throw new Error("There is more than one variable");if(n=i.name,null===a)return void(t[1]=1);if("^"===a.op&&0!==o.noFil)throw new Error("In power the variable should be the first parameter");if("*"===a.op&&1!==o.noFil)throw new Error("In multiply the variable should be the second parameter");""!==o.fire&&"*"!==o.fire||(r<1&&(t[1]=0),t[1]+=o.cte*("+"===o.oper?1:-1),r=Math.max(1,r))}else{if("ConstantNode"!==u)throw new Error("Type "+u+" is not allowed");var c=parseFloat(i.value);if(null===a)return void(t[0]=c);if("^"===a.op){if(1!==o.noFil)throw new Error("Constant cannot be powered");if(!V(c)||c<=0)throw new Error("Non-integer exponent is not allowed");for(var f=r+1;f<c;f++)t[f]=0;return c>r&&(t[c]=0),t[c]+=o.cte*("+"===o.oper?1:-1),void(r=Math.max(c,r))}o.cte=c,""===o.fire&&(t[0]+=o.cte*("+"===o.oper?1:-1))}}(e,null,{cte:1,oper:"+",fire:""});for(var i,s=!0,c=r=t.length-1;c>=0;c--)if(0!==t[c]){var f=new a(s?t[c]:Math.abs(t[c])),l=t[c]<0?"-":"+";if(c>0){var p=new u(n);if(c>1){var m=new a(c);p=new o("^","pow",[p,m])}f=-1===t[c]&&s?new o("-","unaryMinus",[p]):1===Math.abs(t[c])?p:new o("*","multiply",[f,p])}i=s?f:"+"===l?new o("+","add",[i,f]):new o("-","subtract",[i,f]),s=!1}return s?new a(0):i}})),$d="zpk2tf",Hd=Ee($d,["typed","add","multiply","Complex","number"],(function(e){var t=e.typed,r=e.add,n=e.multiply,i=e.Complex,a=e.number;return t($d,{"Array,Array,number":function(e,t,r){return o(e,t,r)},"Array,Array":function(e,t){return o(e,t,1)},"Matrix,Matrix,number":function(e,t,r){return o(e.valueOf(),t.valueOf(),r)},"Matrix,Matrix":function(e,t){return o(e.valueOf(),t.valueOf(),1)}});function o(e,t,r){e.some((function(e){return"BigNumber"===e.type}))&&(e=e.map((function(e){return a(e)}))),t.some((function(e){return"BigNumber"===e.type}))&&(t=t.map((function(e){return a(e)})));for(var o=[i(1,0)],s=[i(1,0)],c=0;c<e.length;c++){var f=e[c];"number"==typeof f&&(f=i(f,0)),o=u(o,[i(1,0),i(-f.re,-f.im)])}for(var l=0;l<t.length;l++){var p=t[l];"number"==typeof p&&(p=i(p,0)),s=u(s,[i(1,0),i(-p.re,-p.im)])}for(var m=0;m<o.length;m++)o[m]=n(o[m],r);return[o,s]}function u(e,t){for(var a=[],o=0;o<e.length+t.length-1;o++){a[o]=i(0,0);for(var u=0;u<e.length;u++)o-u>=0&&o-u<t.length&&(a[o]=r(a[o],n(e[u],t[o-u])))}return a}})),Gd="freqz",Vd=Ee(Gd,["typed","add","multiply","Complex","divide","matrix"],(function(e){var t=e.typed,r=e.add,n=e.multiply,i=e.Complex,a=e.divide,o=e.matrix;return t(Gd,{"Array, Array":function(e,t){return u(e,t,s(512))},"Array, Array, Array":function(e,t,r){return u(e,t,r)},"Array, Array, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");return u(e,t,s(r))},"Matrix, Matrix":function(e,t){var r=s(512),n=u(e.valueOf(),t.valueOf(),r),i=n.w,a=n.h;return{w:o(i),h:o(a)}},"Matrix, Matrix, Matrix":function(e,t,r){var n=u(e.valueOf(),t.valueOf(),r.valueOf()).h;return{h:o(n),w:o(r)}},"Matrix, Matrix, number":function(e,t,r){if(r<0)throw new Error("w must be a positive number");var n=s(r),i=u(e.valueOf(),t.valueOf(),n).h;return{h:o(i),w:o(n)}}});function u(e,t,o){for(var u=[],s=[],c=0;c<o.length;c++){for(var f=i(0,0),l=i(0,0),p=0;p<e.length;p++)f=r(f,n(e[p],i(Math.cos(-p*o[c]),Math.sin(-p*o[c]))));for(var m=0;m<t.length;m++)l=r(l,n(t[m],i(Math.cos(-m*o[c]),Math.sin(-m*o[c]))));u.push(f),s.push(l)}for(var h=[],d=0;d<u.length;d++)h.push(a(u[d],s[d]));return{h,w:o}}function s(e){for(var t=[],r=0;r<e;r++)t.push(r/e*Math.PI);return t}})),Zd=Ee("reviver",["classes"],(function(e){var t=e.classes;return function(e,r){var n=t[r&&r.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(r):r}})),Wd=Ee("replacer",[],(function(){return function(e,t){return"number"!=typeof t||isFinite(t)&&!isNaN(t)?t:{mathjs:"number",value:String(t)}}})),Yd=Math.PI,Jd=2*Math.PI,Xd=Math.E,Qd=Ee("true",[],(function(){return!0})),Kd=Ee("false",[],(function(){return!1})),ev=Ee("null",[],(function(){return null})),tv=yv("Infinity",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1/0):1/0})),rv=yv("NaN",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(NaN):NaN})),nv=yv("pi",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?bf(r):Yd})),iv=yv("tau",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?wf(r):Jd})),av=yv("e",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?gf(r):Xd})),ov=yv("phi",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?xf(r):1.618033988749895})),uv=yv("LN2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).ln():Math.LN2})),sv=yv("LN10",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(10).ln():Math.LN10})),cv=yv("LOG2E",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E})),fv=yv("LOG10E",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E})),lv=yv("SQRT1_2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r("0.5").sqrt():Math.SQRT1_2})),pv=yv("SQRT2",["config","?BigNumber"],(function(e){var t=e.config,r=e.BigNumber;return"BigNumber"===t.number?new r(2).sqrt():Math.SQRT2})),mv=yv("i",["Complex"],(function(e){return e.Complex.I})),hv=Ee("PI",["pi"],(function(e){return e.pi})),dv=Ee("E",["e"],(function(e){return e.e})),vv=Ee("version",[],(function(){return"12.1.0"}));function yv(e,t,r){return Ee(e,t,r,{recreateOnConfigChange:!0})}var gv=hy("speedOfLight","299792458","m s^-1"),xv=hy("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),bv=hy("planckConstant","6.62607015e-34","J s"),wv=hy("reducedPlanckConstant","1.0545718176461565e-34","J s"),Nv=hy("magneticConstant","1.25663706212e-6","N A^-2"),Dv=hy("electricConstant","8.8541878128e-12","F m^-1"),Ev=hy("vacuumImpedance","376.730313667","ohm"),Av=hy("coulomb","8.987551792261171e9","N m^2 C^-2"),Sv=hy("elementaryCharge","1.602176634e-19","C"),Cv=hy("bohrMagneton","9.2740100783e-24","J T^-1"),Mv=hy("conductanceQuantum","7.748091729863649e-5","S"),Fv=hy("inverseConductanceQuantum","12906.403729652257","ohm"),Ov=hy("magneticFluxQuantum","2.0678338484619295e-15","Wb"),Tv=hy("nuclearMagneton","5.0507837461e-27","J T^-1"),Bv=hy("klitzing","25812.807459304513","ohm"),_v=hy("bohrRadius","5.29177210903e-11","m"),kv=hy("classicalElectronRadius","2.8179403262e-15","m"),Iv=hy("electronMass","9.1093837015e-31","kg"),Rv=hy("fermiCoupling","1.1663787e-5","GeV^-2"),zv=dy("fineStructure",.0072973525693),qv=hy("hartreeEnergy","4.3597447222071e-18","J"),jv=hy("protonMass","1.67262192369e-27","kg"),Pv=hy("deuteronMass","3.3435830926e-27","kg"),Lv=hy("neutronMass","1.6749271613e-27","kg"),Uv=hy("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),$v=hy("rydberg","10973731.568160","m^-1"),Hv=hy("thomsonCrossSection","6.6524587321e-29","m^2"),Gv=dy("weakMixingAngle",.2229),Vv=dy("efimovFactor",22.7),Zv=hy("atomicMass","1.66053906660e-27","kg"),Wv=hy("avogadro","6.02214076e23","mol^-1"),Yv=hy("boltzmann","1.380649e-23","J K^-1"),Jv=hy("faraday","96485.33212331001","C mol^-1"),Xv=hy("firstRadiation","3.7417718521927573e-16","W m^2"),Qv=hy("loschmidt","2.686780111798444e25","m^-3"),Kv=hy("gasConstant","8.31446261815324","J K^-1 mol^-1"),ey=hy("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),ty=hy("molarVolume","0.022413969545014137","m^3 mol^-1"),ry=dy("sackurTetrode",-1.16487052358),ny=hy("secondRadiation","0.014387768775039337","m K"),iy=hy("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),ay=hy("wienDisplacement","2.897771955e-3","m K"),oy=hy("molarMass","0.99999999965e-3","kg mol^-1"),uy=hy("molarMassC12","11.9999999958e-3","kg mol^-1"),sy=hy("gravity","9.80665","m s^-2"),cy=hy("planckLength","1.616255e-35","m"),fy=hy("planckMass","2.176435e-8","kg"),ly=hy("planckTime","5.391245e-44","s"),py=hy("planckCharge","1.87554603778e-18","C"),my=hy("planckTemperature","1.416785e+32","K");function hy(e,t,r){return Ee(e,["config","Unit","BigNumber"],(function(e){var n=e.config,i=e.Unit,a=e.BigNumber,o=new i("BigNumber"===n.number?new a(t):parseFloat(t),r);return o.fixPrefix=!0,o}))}function dy(e,t){return Ee(e,["config","BigNumber"],(function(e){var r=e.config,n=e.BigNumber;return"BigNumber"===r.number?new n(t):t}))}var vy=Ee("apply",["typed","isInteger"],(function(e){var t=e.typed,r=e.isInteger,n=ma({typed:t,isInteger:r});return t("apply",{"...any":function(e){var t=e[1];i(t)?e[1]=t-1:a(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),yy=Ee("column",["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,a=e.range,o=gu({typed:t,Index:r,matrix:n,range:a});return t("column",{"...any":function(e){var t=e.length-1,r=e[t];i(r)&&(e[t]=r-1);try{return o.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0});function gy(e,t,r){var n=e.filter((function(e){return U(e)&&!(e.name in t)&&!r.has(e.name)}))[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=sm(r),o=e.compile();return function(e){return a.set(i,e),o.evaluate(a)}}var xy=Ee("filter",["typed"],(function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=U(e[1])||_(e[1])?e[1].compile().evaluate(r):gy(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("filter",{"Array, function":by,"Matrix, function":function(e,t){return e.create(by(e.toArray(),t))},"Array, RegExp":En,"Matrix, RegExp":function(e,t){return e.create(En(e.toArray(),t))}});return r}),{isTransformFunction:!0});function by(e,t){return Dn(e,(function(e,r,n){return Au(t,e,[r+1],n,"filter")}))}var wy=Ee("forEach",["typed"],(function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=U(e[1])||_(e[1])?e[1].compile().evaluate(r):gy(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("forEach",{"Array | Matrix, function":function(e,t){!function r(n,i){if(!Array.isArray(n))return Au(t,n,i,e,"forEach");Nn(n,(function(e,t){r(e,i.concat(t+1))}))}(e.valueOf(),[])}});return r}),{isTransformFunction:!0}),Ny=Ee("index",["Index","getMatrixDataType"],(function(e){var t=e.Index,r=e.getMatrixDataType;return function(){for(var e=[],n=0,o=arguments.length;n<o;n++){var u=arguments[n];if(d(u))u.start--,u.end-=u.step>0?0:2;else if(u&&!0===u.isSet)u=u.map((function(e){return e-1}));else if(f(u)||l(u))"boolean"!==r(u)&&(u=u.map((function(e){return e-1})));else if(i(u))u--;else if(a(u))u=u.toNumber()-1;else if("string"!=typeof u)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[n]=u}var s=new t;return t.apply(s,e),s}}),{isTransformFunction:!0}),Dy=Ee("map",["typed"],(function(e){var t=e.typed;function r(e,t,r){var i,a;return e[0]&&(i=e[0].compile().evaluate(r)),e[1]&&(a=U(e[1])||_(e[1])?e[1].compile().evaluate(r):gy(e[1],t,r)),n(i,a)}r.rawArgs=!0;var n=t("map",{"Array, function":function(e,t){return Ey(e,t,e)},"Matrix, function":function(e,t){return e.create(Ey(e.valueOf(),t,e))}});return r}),{isTransformFunction:!0});function Ey(e,t,r){return function e(n,i){return Array.isArray(n)?wn(n,(function(t,r){return e(t,i.concat(r+1))})):Au(t,n,i,r,"map")}(e,[])}function Ay(e){if(2===e.length&&p(e[0])){var t=(e=e.slice())[1];i(t)?e[1]=t-1:a(t)&&(e[1]=t.minus(1))}return e}var Sy=Ee("max",["typed","config","numeric","larger"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.larger,a=lf({typed:t,config:r,numeric:n,larger:i});return t("max",{"...any":function(e){e=Ay(e);try{return a.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Cy=Ee("mean",["typed","add","divide"],(function(e){var t=e.typed,r=e.add,n=e.divide,i=bh({typed:t,add:r,divide:n});return t("mean",{"...any":function(e){e=Ay(e);try{return i.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),My=Ee("min",["typed","config","numeric","smaller"],(function(e){var t=e.typed,r=e.config,n=e.numeric,i=e.smaller,a=pf({typed:t,config:r,numeric:n,smaller:i});return t("min",{"...any":function(e){e=Ay(e);try{return a.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Fy=Ee("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(function(e){var t=e.typed,r=e.config,n=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,u=e.larger,s=e.largerEq,c=e.add,f=e.isPositive,l=Wu({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:u,largerEq:s,add:c,isPositive:f});return t("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),l.apply(null,e)}})}),{isTransformFunction:!0}),Oy=Ee("row",["typed","Index","matrix","range"],(function(e){var t=e.typed,r=e.Index,n=e.matrix,a=e.range,o=rs({typed:t,Index:r,matrix:n,range:a});return t("row",{"...any":function(e){var t=e.length-1,r=e[t];i(r)&&(e[t]=r-1);try{return o.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Ty=Ee("subset",["typed","matrix","zeros","add"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.add,a=ss({typed:t,matrix:r,zeros:n,add:i});return t("subset",{"...any":function(e){try{return a.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),By=Ee("concat",["typed","matrix","isInteger"],(function(e){var t=e.typed,r=e.matrix,n=e.isInteger,o=vu({typed:t,matrix:r,isInteger:n});return t("concat",{"...any":function(e){var t=e.length-1,r=e[t];i(r)?e[t]=r-1:a(r)&&(e[t]=r.minus(1));try{return o.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),_y="diff",ky=Ee(_y,["typed","matrix","subtract","number","bignumber"],(function(e){var t=e.typed,r=e.matrix,n=e.subtract,i=e.number,a=e.bignumber,o=Uu({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(_y,{"...any":function(e){e=Ay(e);try{return o.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Iy=Ee("std",["typed","map","sqrt","variance"],(function(e){var t=e.typed,r=e.map,n=e.sqrt,i=e.variance,a=Fh({typed:t,map:r,sqrt:n,variance:i});return t("std",{"...any":function(e){e=Ay(e);try{return a.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Ry=Ee("sum",["typed","config","add","numeric"],(function(e){var t=e.typed,r=e.config,n=e.add,i=e.numeric,a=vh({typed:t,config:r,add:n,numeric:i});return t("sum",{"...any":function(e){e=Ay(e);try{return a.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),zy=Ee("quantileSeq",["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],(function(e){var t=e.typed,r=e.bignumber,n=e.add,i=e.subtract,a=e.divide,o=e.multiply,u=e.partitionSelect,s=e.compare,c=e.isInteger,f=e.smaller,l=e.smallerEq,p=e.larger,m=Mh({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:u,compare:s,isInteger:c,smaller:f,smallerEq:l,larger:p});return t("quantileSeq",{"Array | Matrix, number | BigNumber":m,"Array | Matrix, number | BigNumber, number":function(e,t,r){return m(e,t,h(r))},"Array | Matrix, number | BigNumber, boolean":m,"Array | Matrix, number | BigNumber, boolean, number":function(e,t,r,n){return m(e,t,r,h(n))},"Array | Matrix, Array | Matrix":m,"Array | Matrix, Array | Matrix, number":function(e,t,r){return m(e,t,h(r))},"Array | Matrix, Array | Matrix, boolean":m,"Array | Matrix, Array | Matrix, boolean, number":function(e,t,r,n){return m(e,t,r,h(n))}});function h(e){return Ay([[],e])[1]}}),{isTransformFunction:!0}),qy="cumsum",jy=Ee(qy,["typed","add","unaryPlus"],(function(e){var t=e.typed,r=e.add,n=e.unaryPlus,o=gh({typed:t,add:r,unaryPlus:n});return t(qy,{"...any":function(e){if(2===e.length&&p(e[0])){var t=e[1];i(t)?e[1]=t-1:a(t)&&(e[1]=t.minus(1))}try{return o.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Py="variance",Ly=Ee(Py,["typed","add","subtract","multiply","divide","apply","isNaN"],(function(e){var t=e.typed,r=e.add,n=e.subtract,i=e.multiply,a=e.divide,o=e.apply,u=e.isNaN,s=Sh({typed:t,add:r,subtract:n,multiply:i,divide:a,apply:o,isNaN:u});return t(Py,{"...any":function(e){e=Ay(e);try{return s.apply(null,e)}catch(e){throw gp(e)}}})}),{isTransformFunction:!0}),Uy="print",$y=Ee(Uy,["typed","matrix","zeros","add"],(function(e){var t=e.typed,r=e.matrix,n=e.zeros,i=e.add,a=Hs({typed:t,matrix:r,zeros:n,add:i});return t(Uy,{"string, Object | Array":function(e,t){return a(o(e),t)},"string, Object | Array, number | Object":function(e,t,r){return a(o(e),t,r)}});function o(e){return e.replace(Us,(function(e){return"$"+e.slice(1).split(".").map((function(e){return!isNaN(e)&&e.length>0?parseInt(e)-1:e})).join(".")}))}}),{isTransformFunction:!0}),Hy=(r(1517),r(4279));var Gy={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null},Vy=["Matrix","Array"],Zy=["number","BigNumber","Fraction"];function Wy(e,t){function r(r){if(r){var n=de(e,he);Yy(r,"matrix",Vy),Yy(r,"number",Zy),ye(e,r);var i=de(e,he),a=de(r,he);return t("config",i,n,a),i}return de(e,he)}return r.MATRIX_OPTIONS=Vy,r.NUMBER_OPTIONS=Zy,Object.keys(Gy).forEach((function(t){Object.defineProperty(r,t,{get:function(){return e[t]},enumerable:!0,configurable:!0})})),r}function Yy(e,t,r){var n,i;void 0!==e[t]&&(n=r,i=e[t],-1===n.indexOf(i))&&console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map((function(e){return JSON.stringify(e)})).join(", ")+".")}const Jy=function e(r,n){var B=$r({},Gy,n);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var H,V,Z=(H={isNumber:i,isComplex:o,isBigNumber:a,isFraction:u,isUnit:s,isString:c,isArray:f,isMatrix:l,isCollection:p,isDenseMatrix:m,isSparseMatrix:h,isRange:d,isIndex:v,isBoolean:y,isResultSet:g,isHelp:x,isFunction:b,isDate:w,isRegExp:N,isObject:D,isNull:E,isUndefined:A,isAccessorNode:S,isArrayNode:C,isAssignmentNode:M,isBlockNode:F,isConditionalNode:O,isConstantNode:T,isFunctionAssignmentNode:_,isFunctionNode:k,isIndexNode:I,isNode:R,isObjectNode:z,isOperatorNode:q,isParenthesisNode:j,isRangeNode:P,isRelationalNode:L,isSymbolNode:U,isChain:$},V=new Hy,H.on=V.on.bind(V),H.off=V.off.bind(V),H.once=V.once.bind(V),H.emit=V.emit.bind(V),H);Z.config=Wy(B,Z.emit),Z.expression={transform:{},mathWithTransform:{config:Z.config}};var W={};function Y(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Z.typed.apply(Z.typed,t)}Y.isTypedFunction=G.isTypedFunction;var J=function(e,r,n,i){function c(t,r,a){var o;if(a.wrap&&"function"==typeof r&&(r=function(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}(r)),"function"==typeof(o=r)&&"string"==typeof o.signature&&(r=e(t,Ua({},r.signature,r))),e.isTypedFunction(n[t])&&e.isTypedFunction(r))return r=a.override?e(t,r.signatures):e(n[t],r),n[t]=r,delete i[t],f(t,r),void n.emit("import",t,(function(){return r}));if(void 0===n[t]||a.override)return n[t]=r,delete i[t],f(t,r),void n.emit("import",t,(function(){return r}));if(!a.silent)throw new Error('Cannot import "'+t+'": already exists')}function f(e,t){t&&"function"==typeof t.transform?(n.expression.transform[e]=t.transform,h(e)&&(n.expression.mathWithTransform[e]=t.transform)):(delete n.expression.transform[e],h(e)&&(n.expression.mathWithTransform[e]=t))}function p(e){delete n.expression.transform[e],h(e)?n.expression.mathWithTransform[e]=n[e]:delete n.expression.mathWithTransform[e]}function m(t,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(Fn(a,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(a));var o=v(t)?n.expression.transform:n,u=a in n.expression.transform,s=Ne(o,a)?o[a]:void 0,c=function(){var i={};t.dependencies.map(Se).forEach((function(e){if(Fn(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?i.math=n:"mathWithTransform"===e?i.mathWithTransform=n.expression.mathWithTransform:"classes"===e?i.classes=n:i[e]=n[e]}));var o=t(i);if(o&&"function"==typeof o.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===s||r.override)return o;if(e.isTypedFunction(s)&&e.isTypedFunction(o))return e(s,o);if(r.silent)return s;throw new Error('Cannot import "'+a+'": already exists')};t.meta&&!1===t.meta.lazy?(o[a]=c(),s&&u?p(a):(v(t)||d(t))&&we(n.expression.mathWithTransform,a,(function(){return o[a]}))):(we(o,a,c),s&&u?p(a):(v(t)||d(t))&&we(n.expression.mathWithTransform,a,(function(){return o[a]}))),i[a]=t,n.emit("import",a,c)}function h(e){return!Ne(y,e)}function d(e){return!(-1!==e.fn.indexOf(".")||Ne(y,e.fn)||e.meta&&e.meta.isClass)}function v(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var y={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,r){var n=arguments.length;if(1!==n&&2!==n)throw new Ka("import",n,1,2);r||(r={});var i,f={};for(var p in function e(n,i,a){if(Array.isArray(i))i.forEach((function(t){return e(n,t)}));else if("object"===t(i))for(var o in i)Ne(i,o)&&e(n,i[o],o);else if(Ae(i)||void 0!==a){var u=Ae(i)?v(i)?i.fn+".transform":i.fn:a;if(Ne(n,u)&&n[u]!==i&&!r.silent)throw new Error('Cannot import "'+u+'" twice');n[u]=i}else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}(f,e),f)if(Ne(f,p)){var h=f[p];if(Ae(h))m(h,r);else if("function"==typeof(i=h)||"number"==typeof i||"string"==typeof i||"boolean"==typeof i||null===i||s(i)||o(i)||a(i)||u(i)||l(i)||Array.isArray(i))c(p,h,r);else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}}}(Y,0,Z,W);return Z.import=J,Z.on("config",(function(){De(W).forEach((function(e){e&&e.meta&&e.meta.recreateOnConfigChange&&J(e,{override:!0})}))})),Z.create=e.bind(null,r),Z.factory=Ee,Z.import(De(xe(r))),Z.ArgumentsError=Ka,Z.DimensionError=rn,Z.IndexError=nn,Z}(e)})(),n.default})()));
//# sourceMappingURL=math.js.map