text: /*! For license information please see 2.1e55130c.chunk.js.LICENSE.txt */
  (this.webpackJsonpcalculator=this.webpackJsonpcalculator||[]).push([[2],[,function(e,t,n){"use strict";e.exports=n(17)},function(e,t,n){var r;!function(n){"use strict";var i=function(e){return.5*(Math.exp(e)+Math.exp(-e))},a=function(e){return.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function s(e,t){var n=Math.abs(e),r=Math.abs(t);return 0===e?Math.log(r):0===t?Math.log(n):n<3e3&&r<3e3?.5*Math.log(e*e+t*t):Math.log(e/Math.cos(Math.atan2(t,e)))}function u(e,t){if(!(this instanceof u))return new u(e,t);var n=function(e,t){var n={re:0,im:0};if(void 0===e||null===e)n.re=n.im=0;else if(void 0!==t)n.re=e,n.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)n.re=e.re,n.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return u.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return u.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else 2===e.length?(n.re=e[0],n.im=e[1]):o();break;case"string":n.im=n.re=0;var r=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===r&&o();for(var s=0;s<r.length;s++){var l=r[s];" "===l||"\t"===l||"\n"===l||("+"===l?i++:"-"===l?a++:"i"===l||"I"===l?(i+a===0&&o()," "===r[s+1]||isNaN(r[s+1])?n.im+=parseFloat((a%2?"-":"")+"1"):(n.im+=parseFloat((a%2?"-":"")+r[s+1]),s++),i=a=0):((i+a===0||isNaN(l))&&o(),"i"===r[s+1]||"I"===r[s+1]?(n.im+=parseFloat((a%2?"-":"")+l),s++):n.re+=parseFloat((a%2?"-":"")+l),i=a=0))}i+a>0&&o();break;case"number":n.im=0,n.re=e;break;default:o()}return isNaN(n.re)||isNaN(n.im),n}(e,t);this.re=n.re,this.im=n.im}u.prototype={re:0,im:0,sign:function(){var e=this.abs();return new u(this.re/e,this.im/e)},add:function(e,t){var n=new u(e,t);return this.isInfinite()&&n.isInfinite()?u.NAN:this.isInfinite()||n.isInfinite()?u.INFINITY:new u(this.re+n.re,this.im+n.im)},sub:function(e,t){var n=new u(e,t);return this.isInfinite()&&n.isInfinite()?u.NAN:this.isInfinite()||n.isInfinite()?u.INFINITY:new u(this.re-n.re,this.im-n.im)},mul:function(e,t){var n=new u(e,t);return this.isInfinite()&&n.isZero()||this.isZero()&&n.isInfinite()?u.NAN:this.isInfinite()||n.isInfinite()?u.INFINITY:0===n.im&&0===this.im?new u(this.re*n.re,0):new u(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){var n=new u(e,t);if(this.isZero()&&n.isZero()||this.isInfinite()&&n.isInfinite())return u.NAN;if(this.isInfinite()||n.isZero())return u.INFINITY;if(this.isZero()||n.isInfinite())return u.ZERO;e=this.re,t=this.im;var r,i,a=n.re,o=n.im;return 0===o?new u(e/a,t/a):Math.abs(a)<Math.abs(o)?new u((e*(i=a/o)+t)/(r=a*i+o),(t*i-e)/r):new u((e+t*(i=o/a))/(r=o*i+a),(t-e*i)/r)},pow:function(e,t){var n=new u(e,t);if(e=this.re,t=this.im,n.isZero())return u.ONE;if(0===n.im){if(0===t&&e>=0)return new u(Math.pow(e,n.re),0);if(0===e)switch((n.re%4+4)%4){case 0:return new u(Math.pow(t,n.re),0);case 1:return new u(0,Math.pow(t,n.re));case 2:return new u(-Math.pow(t,n.re),0);case 3:return new u(0,-Math.pow(t,n.re))}}if(0===e&&0===t&&n.re>0&&n.im>=0)return u.ZERO;var r=Math.atan2(t,e),i=s(e,t);return e=Math.exp(n.re*i-n.im*r),t=n.im*i+n.re*r,new u(e*Math.cos(t),e*Math.sin(t))},sqrt:function(){var e,t,n=this.re,r=this.im,i=this.abs();if(n>=0){if(0===r)return new u(Math.sqrt(n),0);e=.5*Math.sqrt(2*(i+n))}else e=Math.abs(r)/Math.sqrt(2*(i-n));return t=n<=0?.5*Math.sqrt(2*(i-n)):Math.abs(r)/Math.sqrt(2*(i+n)),new u(e,r<0?-t:t)},exp:function(){var e=Math.exp(this.re);return this.im,new u(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,t=this.im;return new u(Math.expm1(e)*Math.cos(t)+function(e){var t=Math.PI/4;if(e<-t||e>t)return Math.cos(e)-1;var n=e*e;return n*(n*(1/24+n*(-1/720+n*(1/40320+n*(-1/3628800+n*(1/4790014600+n*(-1/87178291200+n*(1/20922789888e3)))))))-.5)}(t),Math.exp(e)*Math.sin(t))},log:function(){var e=this.re,t=this.im;return new u(s(e,t),Math.atan2(t,e))},abs:function(){return function(e,t){var n=Math.abs(e),r=Math.abs(t);return n<3e3&&r<3e3?Math.sqrt(n*n+r*r):(n<r?(n=r,r=e/t):r=t/e,n*Math.sqrt(1+r*r))}(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var e=this.re,t=this.im;return new u(Math.sin(e)*i(t),Math.cos(e)*a(t))},cos:function(){var e=this.re,t=this.im;return new u(Math.cos(e)*i(t),-Math.sin(e)*a(t))},tan:function(){var e=2*this.re,t=2*this.im,n=Math.cos(e)+i(t);return new u(Math.sin(e)/n,a(t)/n)},cot:function(){var e=2*this.re,t=2*this.im,n=Math.cos(e)-i(t);return new u(-Math.sin(e)/n,a(t)/n)},sec:function(){var e=this.re,t=this.im,n=.5*i(2*t)+.5*Math.cos(2*e);return new u(Math.cos(e)*i(t)/n,Math.sin(e)*a(t)/n)},csc:function(){var e=this.re,t=this.im,n=.5*i(2*t)-.5*Math.cos(2*e);return new u(Math.sin(e)*i(t)/n,-Math.cos(e)*a(t)/n)},asin:function(){var e=this.re,t=this.im,n=new u(t*t-e*e+1,-2*e*t).sqrt(),r=new u(n.re-t,n.im+e).log();return new u(r.im,-r.re)},acos:function(){var e=this.re,t=this.im,n=new u(t*t-e*e+1,-2*e*t).sqrt(),r=new u(n.re-t,n.im+e).log();return new u(Math.PI/2-r.im,r.re)},atan:function(){var e=this.re,t=this.im;if(0===e){if(1===t)return new u(0,1/0);if(-1===t)return new u(0,-1/0)}var n=e*e+(1-t)*(1-t),r=new u((1-t*t-e*e)/n,-2*e/n).log();return new u(-.5*r.im,.5*r.re)},acot:function(){var e=this.re,t=this.im;if(0===t)return new u(Math.atan2(1,e),0);var n=e*e+t*t;return 0!==n?new u(e/n,-t/n).atan():new u(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 u(0,1/0);var n=e*e+t*t;return 0!==n?new u(e/n,-t/n).acos():new u(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 u(Math.PI/2,1/0);var n=e*e+t*t;return 0!==n?new u(e/n,-t/n).asin():new u(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){var e=this.re,t=this.im;return new u(a(e)*Math.cos(t),i(e)*Math.sin(t))},cosh:function(){var e=this.re,t=this.im;return new u(i(e)*Math.cos(t),a(e)*Math.sin(t))},tanh:function(){var e=2*this.re,t=2*this.im,n=i(e)+Math.cos(t);return new u(a(e)/n,Math.sin(t)/n)},coth:function(){var e=2*this.re,t=2*this.im,n=i(e)-Math.cos(t);return new u(a(e)/n,-Math.sin(t)/n)},csch:function(){var e=this.re,t=this.im,n=Math.cos(2*t)-i(2*e);return new u(-2*a(e)*Math.cos(t)/n,2*i(e)*Math.sin(t)/n)},sech:function(){var e=this.re,t=this.im,n=Math.cos(2*t)+i(2*e);return new u(2*i(e)*Math.cos(t)/n,-2*a(e)*Math.sin(t)/n)},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,n=e>1&&0===t,r=1-e,i=1+e,a=r*r+t*t,o=0!==a?new u((i*r-t*t)/a,(t*r+i*t)/a):new u(-1!==e?e/0:0,0!==t?t/0:0),l=o.re;return o.re=s(o.re,o.im)/2,o.im=Math.atan2(o.im,l)/2,n&&(o.im=-o.im),o},acoth:function(){var e=this.re,t=this.im;if(0===e&&0===t)return new u(0,Math.PI/2);var n=e*e+t*t;return 0!==n?new u(e/n,-t/n).atanh():new u(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 u(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var n=e*e+t*t;return 0!==n?new u(e/n,-t/n).asinh():new u(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){var e=this.re,t=this.im;if(this.isZero())return u.INFINITY;var n=e*e+t*t;return 0!==n?new u(e/n,-t/n).acosh():new u(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return u.INFINITY;if(this.isInfinite())return u.ZERO;var e=this.re,t=this.im,n=e*e+t*t;return new u(e/n,-t/n)},conjugate:function(){return new u(this.re,-this.im)},neg:function(){return new u(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new u(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new u(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new u(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){var n=new u(e,t);return Math.abs(n.re-this.re)<=u.EPSILON&&Math.abs(n.im-this.im)<=u.EPSILON},clone:function(){return new u(this.re,this.im)},toString:function(){var e=this.re,t=this.im,n="";return this.isNaN()?"NaN":this.isZero()?"0":this.isInfinite()?"Infinity":(0!==e&&(n+=e),0!==t&&(0!==e?n+=t<0?" - ":" + ":t<0&&(n+="-"),1!==(t=Math.abs(t))&&(n+=t),n+="i"),n||"0")},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){return isNaN(this.re)||isNaN(this.im)})),isZero:function(){return(0===this.re||-0===this.re)&&(0===this.im||-0===this.im)},isFinite:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(){return isFinite(this.re)&&isFinite(this.im)})),isInfinite:function(){return!(this.isNaN()||this.isFinite())}},u.ZERO=new u(0,0),u.ONE=new u(1,0),u.I=new u(0,1),u.PI=new u(Math.PI,0),u.E=new u(Math.E,0),u.INFINITY=new u(1/0,1/0),u.NAN=new u(NaN,NaN),u.EPSILON=1e-16,void 0===(r=function(){return u}.apply(t,[]))||(e.exports=r)}()},function(e,t,n){var r;!function(n){"use strict";var i={s:1,n:0,d:1};function a(e){function t(){var t=Error.apply(this,arguments);t.name=this.name=e,this.stack=t.stack,this.message=t.message}function n(){}return n.prototype=Error.prototype,t.prototype=new n,t}var o=p.DivisionByZero=a("DivisionByZero"),s=p.InvalidParameter=a("InvalidParameter");function u(e,t){return isNaN(e=parseInt(e,10))&&l(),e*t}function l(){throw new s}var c=function(e,t){var n,r=0,a=1,s=1,c=0,f=0,p=0,m=1,d=1,h=0,y=1,g=1,v=1,x=1e7;if(void 0===e||null===e);else if(void 0!==t)s=(r=e)*(a=t);else switch(typeof e){case"object":"d"in e&&"n"in e?(r=e.n,a=e.d,"s"in e&&(r*=e.s)):0 in e?(r=e[0],1 in e&&(a=e[1])):l(),s=r*a;break;case"number":if(e<0&&(s=e,e=-e),e%1===0)r=e;else if(e>0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));y<=x&&v<=x;){if(e===(n=(h+g)/(y+v))){y+v<=x?(r=h+g,a=y+v):v>y?(r=g,a=v):(r=h,a=y);break}e>n?(h+=g,y+=v):(g+=h,v+=y),y>x?(r=g,a=v):(r=h,a=y)}r*=d}else(isNaN(e)||isNaN(t))&&(a=r=NaN);break;case"string":if(null===(y=e.match(/\d+|./g))&&l(),"-"===y[h]?(s=-1,h++):"+"===y[h]&&h++,y.length===h+1?f=u(y[h++],s):"."===y[h+1]||"."===y[h]?("."!==y[h]&&(c=u(y[h++],s)),(++h+1===y.length||"("===y[h+1]&&")"===y[h+3]||"'"===y[h+1]&&"'"===y[h+3])&&(f=u(y[h],s),m=Math.pow(10,y[h].length),h++),("("===y[h]&&")"===y[h+2]||"'"===y[h]&&"'"===y[h+2])&&(p=u(y[h+1],s),d=Math.pow(10,y[h+1].length)-1,h+=3)):"/"===y[h+1]||":"===y[h+1]?(f=u(y[h],s),m=u(y[h+2],1),h+=3):"/"===y[h+3]&&" "===y[h+1]&&(c=u(y[h],s),f=u(y[h+2],s),m=u(y[h+4],1),h+=5),y.length<=h){s=r=p+(a=m*d)*c+d*f;break}default:l()}if(0===a)throw new o;i.s=s<0?-1:1,i.n=Math.abs(r),i.d=Math.abs(a)};function f(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function p(e,t){if(!(this instanceof p))return new p(e,t);c(e,t),e=p.REDUCE?f(i.d,i.n):1,this.s=i.s,this.n=i.n/e,this.d=i.d/e}p.REDUCE=1,p.prototype={s:1,n:0,d:1,abs:function(){return new p(this.n,this.d)},neg:function(){return new p(-this.s*this.n,this.d)},add:function(e,t){return c(e,t),new p(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(e,t){return c(e,t),new p(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(e,t){return c(e,t),new p(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(e,t){return c(e,t),new p(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return new p(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new p(NaN):void 0===e?new p(this.s*this.n%this.d,1):(c(e,t),0===i.n&&0===this.d&&p(0,0),new p(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d))},gcd:function(e,t){return c(e,t),new p(f(i.n,this.n)*f(i.d,this.d),i.d*this.d)},lcm:function(e,t){return c(e,t),0===i.n&&0===this.n?new p:new p(i.n*this.n,f(i.n,this.n)*f(i.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new p(NaN):new p(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 p(NaN):new p(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 p(NaN):new p(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new p(this.s*this.d,this.n)},pow:function(e){return e<0?new p(Math.pow(this.s*this.d,-e),Math.pow(this.n,-e)):new p(Math.pow(this.s*this.n,e),Math.pow(this.d,e))},equals:function(e,t){return c(e,t),this.s*this.n*i.d===i.s*i.n*this.d},compare:function(e,t){c(e,t);var n=this.s*this.n*i.d-i.s*i.n*this.d;return(0<n)-(n<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;var t=this.abs().toContinued();function n(e){return 1===e.length?new p(e[0]):n(e.slice(1)).inverse().add(e[0])}e=e||.001;for(var r=0;r<t.length;r++){var i=n(t.slice(0,r+1));if(i.sub(this.abs()).abs().valueOf()<e)return i.mul(this.s)}return this},divisible:function(e,t){return c(e,t),!(!(i.n*this.d)||this.n*i.d%(i.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,n+=" ",r%=i),n+=r,n+="/",n+=i),n},toLatex:function(e){var t,n="",r=this.n,i=this.d;return this.s<0&&(n+="-"),1===i?n+=r:(e&&(t=Math.floor(r/i))>0&&(n+=t,r%=i),n+="\\frac{",n+=r,n+="}{",n+=i,n+="}"),n},toContinued:function(){var e,t=this.n,n=this.d,r=[];if(isNaN(this.n)||isNaN(this.d))return r;do{r.push(Math.floor(t/n)),e=t%n,t=n,n=e}while(1!==t);return r},toString:function(e){var t,n=this.n,r=this.d;if(isNaN(n)||isNaN(r))return"NaN";p.REDUCE||(n/=t=f(n,r),r/=t),e=e||15;var i=function(e,t){for(;t%2===0;t/=2);for(;t%5===0;t/=5);if(1===t)return 0;for(var n=10%t,r=1;1!==n;r++)if(n=10*n%t,r>2e3)return 0;return r}(0,r),a=function(e,t,n){for(var r=1,i=function(e,t,n){for(var r=1;t>0;e=e*e%n,t>>=1)1&t&&(r=r*e%n);return r}(10,n,t),a=0;a<300;a++){if(r===i)return a;r=10*r%t,i=10*i%t}return 0}(0,r,i),o=-1===this.s?"-":"";if(o+=n/r|0,n%=r,(n*=10)&&(o+="."),i){for(var s=a;s--;)o+=n/r|0,n%=r,n*=10;o+="(";for(s=i;s--;)o+=n/r|0,n%=r,n*=10;o+=")"}else for(s=e;n&&s--;)o+=n/r|0,n%=r,n*=10;return o}},void 0===(r=function(){return p}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=function e(t,n){"use strict";var r,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,l=/^0/,c=function(t){return e.insensitive&&(""+t).toLowerCase()||""+t},f=c(t).replace(o,"")||"",p=c(n).replace(o,"")||"",m=f.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=parseInt(f.match(u),16)||1!==m.length&&f.match(s)&&Date.parse(f),y=parseInt(p.match(u),16)||h&&p.match(s)&&Date.parse(p)||null;if(y){if(h<y)return-1;if(h>y)return 1}for(var g=0,v=Math.max(m.length,d.length);g<v;g++){if(r=!(m[g]||"").match(l)&&parseFloat(m[g])||m[g]||0,i=!(d[g]||"").match(l)&&parseFloat(d[g])||d[g]||0,isNaN(r)!==isNaN(i))return isNaN(r)?1:-1;if(typeof r!==typeof i&&(r+="",i+=""),r<i)return-1;if(r>i)return 1}return 0}},function(e,t,n){"use strict";var r,i,a;i=[],void 0===(a="function"===typeof(r=function(){function e(){return!0}function t(){return!1}function n(){}return function r(){var i=[{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:function(e){return"object"===typeof e&&null!==e&&e.constructor===Object}},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],a={name:"any",test:e},o=[],s=[],u={types:i,conversions:s,ignore:o};function l(e){var t=U(u.types,(function(t){return t.name===e}));if(t)return t;if("any"===e)return a;var n=U(u.types,(function(t){return t.name.toLowerCase()===e.toLowerCase()}));throw new TypeError('Unknown type "'+e+'"'+(n?'. Did you mean "'+n.name+'"?':""))}function c(e){return e===a?999:u.types.indexOf(e)}function f(e){var t=U(u.types,(function(t){return t.test(e)}));if(t)return t.name;throw new TypeError("Value has unknown type. Value: "+e)}function p(e){return e.map((function(e){var t=e.types.map(b);return(e.restParam?"...":"")+t.join("|")})).join(",")}function m(e,t){var n=0===e.indexOf("..."),r=(n?e.length>3?e.slice(3):"any":e).split("|").map(z).filter(I).filter(k),i=function(e,t){var n={};return e.forEach((function(e){-1!==t.indexOf(e.from)||-1===t.indexOf(e.to)||n[e.from]||(n[e.from]=e)})),Object.keys(n).map((function(e){return n[e]}))}(t,r),a=r.map((function(e){var t=l(e);return{name:e,typeIndex:c(t),test:t.test,conversion:null,conversionIndex:-1}})),o=i.map((function(e){var n=l(e.from);return{name:e.from,typeIndex:c(n),test:n.test,conversion:e,conversionIndex:t.indexOf(e)}}));return{types:a.concat(o),restParam:n}}function d(e){var t=P(e);return!!t&&t.restParam}function h(e){return e.types.some((function(e){return null!=e.conversion}))}function y(t){if(t&&0!==t.types.length){if(1===t.types.length)return l(t.types[0].name).test;if(2===t.types.length){var n=l(t.types[0].name).test,r=l(t.types[1].name).test;return function(e){return n(e)||r(e)}}var i=t.types.map((function(e){return l(e.name).test}));return function(e){for(var t=0;t<i.length;t++)if(i[t](e))return!0;return!1}}return e}function g(e){var t,n,r,i;if(d(e)){var a=(t=(i=e,i.slice(0,i.length-1)).map(y)).length,o=y(P(e));return function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return function(e){for(var t=a;t<e.length;t++)if(!o(e[t]))return!1;return!0}(e)&&e.length>=a+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=y(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=y(e[0]),r=y(e[1]),function(e){return n(e[0])&&r(e[1])&&2===e.length}):(t=e.map(y),function(e){for(var n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length})}function v(e,t){return t<e.params.length?e.params[t]:d(e.params)?P(e.params):null}function x(e,t,n){var r=v(e,t);return(r?n?r.types.filter(w):r.types:[]).map(b)}function b(e){return e.name}function w(e){return null===e.conversion||void 0===e.conversion}function N(e,t){var n=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;return Object.keys(t)}(F(e,(function(e){return x(e,t,!1)})));return-1!==n.indexOf("any")?["any"]:n}function E(e,t,n){var r,i,a,o=e||"unnamed",s=n;for(a=0;a<t.length;a++){var u=s.filter((function(e){var n=y(v(e,a));return(a<e.params.length||d(e.params))&&n(t[a])}));if(0===u.length){if((i=N(s,a)).length>0){var l=f(t[a]);return(r=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+l+", index: "+a+")")).data={category:"wrongType",fn:o,index:a,actual:l,expected:i},r}}else s=u}var c=s.map((function(e){return d(e.params)?1/0:e.params.length}));if(t.length<Math.min.apply(null,c))return i=N(s,a),(r=new TypeError("Too few arguments in function "+o+" (expected: "+i.join(" or ")+", index: "+t.length+")")).data={category:"tooFewArgs",fn:o,index:t.length,expected:i},r;var p=Math.max.apply(null,c);return t.length>p?((r=new TypeError("Too many arguments in function "+o+" (expected: "+p+", actual: "+t.length+")")).data={category:"tooManyArgs",fn:o,index:t.length,expectedLength:p},r):((r=new TypeError('Arguments of type "'+t.join(", ")+'" do not match any of the defined signatures of function '+o+".")).data={category:"mismatch",actual:t.map(f)},r)}function S(e){for(var t=999,n=0;n<e.types.length;n++)w(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function M(e){for(var t=999,n=0;n<e.types.length;n++)w(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function T(e,t){var n;return 0!==(n=e.restParam-t.restParam)||0!==(n=h(e)-h(t))||0!==(n=S(e)-S(t))?n:M(e)-M(t)}function A(e,t){var n,r,i=Math.min(e.params.length,t.params.length);if(0!==(r=e.params.some(h)-t.params.some(h)))return r;for(n=0;n<i;n++)if(0!==(r=h(e.params[n])-h(t.params[n])))return r;for(n=0;n<i;n++)if(0!==(r=T(e.params[n],t.params[n])))return r;return e.params.length-t.params.length}function O(e){var t,n,r,i,a=[],o=[];switch(e.types.forEach((function(e){e.conversion&&(a.push(l(e.conversion.from).test),o.push(e.conversion.convert))})),o.length){case 0:return function(e){return e};case 1:return t=a[0],r=o[0],function(e){return t(e)?r(e):e};case 2:return t=a[0],n=a[1],r=o[0],i=o[1],function(e){return t(e)?r(e):n(e)?i(e):e};default:return function(e){for(var t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}}function C(e,t){return function e(n,r,i){if(r<n.length){var a,o=n[r],s=t?o.types.filter(w):o.types;if(o.restParam){var u=s.filter(w);a=u.length<s.length?[u,s]:[s]}else a=s.map((function(e){return[e]}));return F(a,(function(t){return e(n,r+1,i.concat([t]))}))}return[i.map((function(e,t){return{types:e,restParam:t===n.length-1&&d(n)}}))]}(e,0,[])}function _(e,r){if(0===Object.keys(r).length)throw new SyntaxError("No signatures provided");var i=[];Object.keys(r).map((function(e){return function(e,t,n){var r=[];return""!==e.trim()&&(r=e.split(",").map(z).map((function(e,t,r){var i=m(e,n);if(i.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": only allowed for the last parameter');return i}))),r.some(B)?null:{params:r,fn:t}}(e,r[e],u.conversions)})).filter(D).forEach((function(e){var t=U(i,(function(t){return function(e,t){for(var n=Math.max(e.params.length,t.params.length),r=0;r<n;r++)if(!R(x(e,r,!0),x(t,r,!0)))return!1;var i=e.params.length,a=t.params.length,o=d(e.params),s=d(t.params);return o?s?i===a:a>=i:s?i>=a:i===a}(t,e)}));if(t)throw new TypeError('Conflicting signatures "'+p(t.params)+'" and "'+p(e.params)+'".');i.push(e)}));var a=F(i,(function(e){return(e?C(e.params,!1):[]).map((function(t){return{params:t,fn:e.fn}}))})).filter(D);a.sort(A);var o=a[0]&&a[0].params.length<=2&&!d(a[0].params),s=a[1]&&a[1].params.length<=2&&!d(a[1].params),l=a[2]&&a[2].params.length<=2&&!d(a[2].params),c=a[3]&&a[3].params.length<=2&&!d(a[3].params),f=a[4]&&a[4].params.length<=2&&!d(a[4].params),v=a[5]&&a[5].params.length<=2&&!d(a[5].params),b=o&&s&&l&&c&&f&&v,w=a.map((function(e){return g(e.params)})),N=o?y(a[0].params[0]):t,S=s?y(a[1].params[0]):t,M=l?y(a[2].params[0]):t,T=c?y(a[3].params[0]):t,_=f?y(a[4].params[0]):t,k=v?y(a[5].params[0]):t,I=o?y(a[0].params[1]):t,P=s?y(a[1].params[1]):t,j=l?y(a[2].params[1]):t,L=c?y(a[3].params[1]):t,$=f?y(a[4].params[1]):t,H=v?y(a[5].params[1]):t,V=a.map((function(e){return function(e,t){var n=t;if(e.some(h)){var r=d(e),i=e.map(O);n=function(){for(var e=[],n=r?arguments.length-1:arguments.length,a=0;a<n;a++)e[a]=i[a](arguments[a]);return r&&(e[n]=arguments[n].map(i[n])),t.apply(this,e)}}var a=n;if(d(e)){var o=e.length-1;a=function(){return n.apply(this,q(arguments,0,o).concat([q(arguments,o)]))}}return a}(e.params,e.fn)})),W=o?V[0]:n,G=s?V[1]:n,Z=l?V[2]:n,Y=c?V[3]:n,Q=f?V[4]:n,J=v?V[5]:n,X=o?a[0].params.length:-1,K=s?a[1].params.length:-1,ee=l?a[2].params.length:-1,te=c?a[3].params.length:-1,ne=f?a[4].params.length:-1,re=v?a[5].params.length:-1,ie=b?6:0,ae=a.length,oe=function(){for(var t=ie;t<ae;t++)if(w[t](arguments))return V[t].apply(this,arguments);throw E(e,arguments,a)},se=function e(t,n){return arguments.length===X&&N(t)&&I(n)?W.apply(e,arguments):arguments.length===K&&S(t)&&P(n)?G.apply(e,arguments):arguments.length===ee&&M(t)&&j(n)?Z.apply(e,arguments):arguments.length===te&&T(t)&&L(n)?Y.apply(e,arguments):arguments.length===ne&&_(t)&&$(n)?Q.apply(e,arguments):arguments.length===re&&k(t)&&H(n)?J.apply(e,arguments):oe.apply(e,arguments)};try{Object.defineProperty(se,"name",{value:e})}catch(ue){}return se.signatures=function(e){var t={};return e.forEach((function(e){e.params.some(h)||C(e.params,!0).forEach((function(n){t[p(n)]=e.fn}))})),t}(a),se}function k(e){return-1===u.ignore.indexOf(e)}function z(e){return e.trim()}function I(e){return!!e}function D(e){return null!==e}function B(e){return 0===e.types.length}function P(e){return e[e.length-1]}function q(e,t,n){return Array.prototype.slice.call(e,t,n)}function R(e,t){for(var n=0;n<e.length;n++)if(r=t,i=e[n],-1!==r.indexOf(i))return!0;var r,i;return!1}function U(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function F(e,t){return Array.prototype.concat.apply([],e.map(t))}function j(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(("object"===typeof r.signatures||"string"===typeof r.signature)&&""!==r.name)if(""===t)t=r.name;else if(t!==r.name){var i=new Error("Function names do not match (expected: "+t+", actual: "+r.name+")");throw i.data={actual:r.name,expected:t},i}}return t}function L(e){var t,n={};function r(e,r){if(n.hasOwnProperty(e)&&r!==n[e])throw(t=new Error('Signature "'+e+'" is defined twice')).data={signature:e},t}for(var i=0;i<e.length;i++){var a=e[i];if("object"===typeof a.signatures)for(var o in a.signatures)a.signatures.hasOwnProperty(o)&&(r(o,a.signatures[o]),n[o]=a.signatures[o]);else{if("string"!==typeof a.signature)throw(t=new TypeError("Function is no typed-function (index: "+i+")")).data={index:i},t;r(a.signature,a),n[a.signature]=a}}return n}return(u=_("typed",{"string, Object":_,Object:function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return _(j(t),e)},"...Function":function(e){return _(j(e),L(e))},"string, ...Function":function(e,t){return _(e,L(t))}})).create=r,u.types=i,u.conversions=s,u.ignore=o,u.convert=function(e,t){var n=f(e);if(t===n)return e;for(var r=0;r<u.conversions.length;r++){var i=u.conversions[r];if(i.from===n&&i.to===t)return i.convert(e)}throw new Error("Cannot convert from "+n+" to "+t)},u.find=function(e,t){if(!e.signatures)throw new TypeError("Function is no typed-function");var n;if("string"===typeof t){n=t.split(",");for(var r=0;r<n.length;r++)n[r]=n[r].trim()}else{if(!Array.isArray(t))throw new TypeError("String array or a comma separated string expected");n=t}var i=n.join(","),a=e.signatures[i];if(a)return a;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+n.join(", ")+"))")},u.addType=function(e,t){if(!e||"string"!==typeof e.name||"function"!==typeof e.test)throw new TypeError("Object with properties {name: string, test: function} expected");if(!1!==t)for(var n=0;n<u.types.length;n++)if("Object"===u.types[n].name)return void u.types.splice(n,0,e);u.types.push(e)},u.addConversion=function(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");u.conversions.push(e)},u}()})?r.apply(t,i):r)||(e.exports=a)},function(e,t,n){"use strict";(function(t){var n=[],r="undefined"===typeof t?window:t,i=Math.pow(256,6),a=Math.pow(2,52),o=2*a,s=Math.random;function u(e){var t,n=e.length,r=this,i=0,a=r.i=r.j=0,o=r.S=[];for(n||(e=[n++]);i<256;)o[i]=i++;for(i=0;i<256;i++)o[i]=o[a=255&a+e[i%n]+(t=o[i])],o[a]=t;(r.g=function(e){for(var t,n=0,i=r.i,a=r.j,o=r.S;e--;)t=o[i=255&i+1],n=256*n+o[255&(o[i]=o[a=255&a+t])+(o[a]=t)];return r.i=i,r.j=a,n})(256)}function l(e,t){var n,r=[],i=(typeof e)[0];if(t&&"o"==i)for(n in e)try{r.push(l(e[n],t-1))}catch(a){}return r.length?r:"s"==i?e:e+"\0"}function c(e,t){for(var n,r=e+"",i=0;i<r.length;)t[255&i]=255&(n^=19*t[255&i])+r.charCodeAt(i++);return p(t)}function f(e){try{return r.crypto.getRandomValues(e=new Uint8Array(256)),p(e)}catch(t){return[+new Date,r,r.navigator&&r.navigator.plugins,r.screen,p(n)]}}function p(e){return String.fromCharCode.apply(0,e)}e.exports=function(t,r){if(r&&!0===r.global)return r.global=!1,Math.random=e.exports(t,r),r.global=!0,Math.random;var s=r&&r.entropy||!1,m=[],d=(c(l(s?[t,p(n)]:0 in arguments?t:f(),3),m),new u(m));return c(p(d.S),n),function(){for(var e=d.g(6),t=i,n=0;e<a;)e=256*(e+n),t*=256,n=d.g(1);for(;e>=o;)e/=2,t/=2,n>>>=1;return(e+n)/t}},e.exports.resetGlobal=function(){Math.random=s},c(Math.random(),n)}).call(this,n(23))},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var n,s,u=o(e),l=1;l<arguments.length;l++){for(var c in n=Object(arguments[l]))i.call(n,c)&&(u[c]=n[c]);if(r){s=r(n);for(var f=0;f<s.length;f++)a.call(n,s[f])&&(u[s[f]]=n[s[f]])}}return u}},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(18)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}n.d(t,"a",(function(){return i}))},function(e,t,n){var r;!function(i){"use strict";var a,o,s,u=9e15,l="0123456789abcdef",c="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",f="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",p={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-u,maxE:u,crypto:!1},m=!0,d="[DecimalError] Invalid argument: ",h=Math.floor,y=Math.pow,g=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,v=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,b=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,w=1e7,N=c.length-1,E=f.length-1,S={name:"[object Decimal]"};function M(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)(n=7-(r=e[t]+"").length)&&(a+=P(n)),a+=r;(n=7-(r=(o=e[t])+"").length)&&(a+=P(n))}else if(0===o)return"0";for(;o%10===0;)o/=10;return a+o}function T(e,t,n){if(e!==~~e||e<t||e>n)throw Error(d+e)}function A(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),a=y(10,7-t),s=e[i]%a|0,null==r?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),o=n<4&&99999==s||n>3&&49999==s||5e4==s||0==s):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==y(10,t-2)-1||(s==a/2||0==s)&&0==(e[i+1]/a/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),o=(r||n<4)&&9999==s||!r&&n>3&&4999==s):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==y(10,t-3)-1,o}function O(e,t,n){for(var r,i,a=[0],o=0,s=e.length;o<s;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=l.indexOf(e.charAt(o++)),r=0;r<a.length;r++)a[r]>n-1&&(void 0===a[r+1]&&(a[r+1]=0),a[r+1]+=a[r]/n|0,a[r]%=n)}return a.reverse()}S.absoluteValue=S.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),_(e)},S.ceil=function(){return _(new this.constructor(this),this.e+1,2)},S.comparedTo=S.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,u=a.s,l=e.s;if(!o||!s)return u&&l?u!==l?u:o===s?0:!o^u<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?u:s[0]?-l:0;if(u!==l)return u;if(a.e!==e.e)return a.e>e.e^u<0?1:-1;for(t=0,n=(r=o.length)<(i=s.length)?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^u<0?1:-1;return r===i?0:r>i^u<0?1:-1},S.cosine=S.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r,i=t.d.length;i<32?(n=Math.ceil(i/3),r=(1/W(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10");e.precision+=n,t=V(e,1,t.times(r),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}(r,G(r,n)),r.precision=e,r.rounding=t,_(2==s||3==s?n.neg():n,e,t,!0)):new r(1):new r(NaN)},S.cubeRoot=S.cbrt=function(){var e,t,n,r,i,a,o,s,u,l,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(m=!1,(a=c.s*y(c.s*c,1/3))&&Math.abs(a)!=1/0?r=new f(a.toString()):(n=M(c.d),(a=((e=c.e)-n.length+1)%3)&&(n+=1==a||-2==a?"0":"00"),a=y(n,1/3),e=h((e+1)/3)-(e%3==(e<0?-1:2)),(r=new f(n=a==1/0?"5e"+e:(n=a.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=c.s),o=(e=f.precision)+3;;)if(l=(u=(s=r).times(s).times(s)).plus(c),r=C(l.plus(c).times(s),l.plus(u),o+2,1),M(s.d).slice(0,o)===(n=M(r.d)).slice(0,o)){if("9999"!=(n=n.slice(o-3,o+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(_(r,e+1,1),t=!r.times(r).times(r).eq(c));break}if(!i&&(_(s,e+1,0),s.times(s).times(s).eq(c))){r=s;break}o+=4,i=1}return m=!0,_(r,e,f.rounding,t)},S.decimalPlaces=S.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=7*((e=t.length-1)-h(this.e/7)),e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},S.dividedBy=S.div=function(e){return C(this,new this.constructor(e))},S.dividedToIntegerBy=S.divToInt=function(e){var t=this.constructor;return _(C(this,new t(e),0,1,1),t.precision,t.rounding)},S.equals=S.eq=function(e){return 0===this.cmp(e)},S.floor=function(){return _(new this.constructor(this),this.e+1,3)},S.greaterThan=S.gt=function(e){return this.cmp(e)>0},S.greaterThanOrEqualTo=S.gte=function(e){var t=this.cmp(e);return 1==t||0===t},S.hyperbolicCosine=S.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/W(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=V(o,1,a.times(t),new o(1),!0);for(var u,l=e,c=new o(8);l--;)u=a.times(a),a=s.minus(u.times(c.minus(u.times(c))));return _(a,o.precision=n,o.rounding=r,!0)},S.hyperbolicSine=S.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(r=i.d.length)<3)i=V(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(r))>16?16:0|e,i=V(a,2,i=i.times(1/W(5,e)),i,!0);for(var o,s=new a(5),u=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(u.times(o).plus(l))))}return a.precision=t,a.rounding=n,_(i,t,n,!0)},S.hyperbolicTangent=S.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,C(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},S.inverseCosine=S.acos=function(){var e,t=this,n=t.constructor,r=t.abs().cmp(1),i=n.precision,a=n.rounding;return-1!==r?0===r?t.isNeg()?D(n,i,a):new n(0):new n(NaN):t.isZero()?D(n,i+4,a).times(.5):(n.precision=i+6,n.rounding=1,t=t.asin(),e=D(n,i+4,a).times(.5),n.precision=i,n.rounding=a,e.minus(t))},S.inverseHyperbolicCosine=S.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,m=!1,n=n.times(n).minus(1).sqrt().plus(n),m=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},S.inverseHyperbolicSine=S.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,m=!1,n=n.times(n).plus(1).sqrt().plus(n),m=!0,r.precision=e,r.rounding=t,n.ln())},S.inverseHyperbolicTangent=S.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?_(new a(i),e,t,!0):(a.precision=n=r-i.e,i=C(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},S.inverseSine=S.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,-1!==t?0===t?((e=D(a,n+4,r).times(.5)).s=i.s,e):new a(NaN):(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)))},S.inverseTangent=S.atan=function(){var e,t,n,r,i,a,o,s,u,l=this,c=l.constructor,f=c.precision,p=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&f+4<=E)return(o=D(c,f+4,p).times(.25)).s=l.s,o}else{if(!l.s)return new c(NaN);if(f+4<=E)return(o=D(c,f+4,p).times(.5)).s=l.s,o}for(c.precision=s=f+10,c.rounding=1,e=n=Math.min(28,s/7+2|0);e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(m=!1,t=Math.ceil(s/7),r=1,u=l.times(l),o=new c(l),i=l;-1!==e;)if(i=i.times(u),a=o.minus(i.div(r+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(r+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),m=!0,_(o,c.precision=f,c.rounding=p,!0)},S.isFinite=function(){return!!this.d},S.isInteger=S.isInt=function(){return!!this.d&&h(this.e/7)>this.d.length-2},S.isNaN=function(){return!this.s},S.isNegative=S.isNeg=function(){return this.s<0},S.isPositive=S.isPos=function(){return this.s>0},S.isZero=function(){return!!this.d&&0===this.d[0]},S.lessThan=S.lt=function(e){return this.cmp(e)<0},S.lessThanOrEqualTo=S.lte=function(e){return this.cmp(e)<1},S.logarithm=S.log=function(e){var t,n,r,i,a,o,s,u,l=this.constructor,c=l.precision,f=l.rounding;if(null==e)e=new l(10),t=!0;else{if(n=(e=new l(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=this.d,this.s<0||!n||!n[0]||this.eq(1))return new l(n&&!n[0]?-1/0:1!=this.s?NaN:n?0:1/0);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10===0;)i/=10;a=1!==i}if(m=!1,o=j(this,s=c+5),r=t?I(l,s+10):j(e,s),A((u=C(o,r,s,1)).d,i=c,f))do{if(o=j(this,s+=10),r=t?I(l,s+10):j(e,s),u=C(o,r,s,1),!a){+M(u.d).slice(i+1,i+15)+1==1e14&&(u=_(u,c+1,0));break}}while(A(u.d,i+=10,f));return m=!0,_(u,c,f)},S.minus=S.sub=function(e){var t,n,r,i,a,o,s,u,l,c,f,p,d=this,y=d.constructor;if(e=new y(e),!d.d||!e.d)return d.s&&e.s?d.d?e.s=-e.s:e=new y(e.d||d.s!==e.s?d:NaN):e=new y(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(l=d.d,p=e.d,s=y.precision,u=y.rounding,!l[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!l[0])return new y(3===u?-0:0);e=new y(d)}return m?_(e,s,u):e}if(n=h(e.e/7),c=h(d.e/7),l=l.slice(),a=c-n){for((f=a<0)?(t=l,a=-a,o=p.length):(t=p,n=c,o=l.length),a>(r=Math.max(Math.ceil(s/7),o)+2)&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for((f=(r=l.length)<(o=p.length))&&(o=r),r=0;r<o;r++)if(l[r]!=p[r]){f=l[r]<p[r];break}a=0}for(f&&(t=l,l=p,p=t,e.s=-e.s),o=l.length,r=p.length-o;r>0;--r)l[o++]=0;for(r=p.length;r>a;){if(l[--r]<p[r]){for(i=r;i&&0===l[--i];)l[i]=w-1;--l[i],l[r]+=w}l[r]-=p[r]}for(;0===l[--o];)l.pop();for(;0===l[0];l.shift())--n;return l[0]?(e.d=l,e.e=z(l,n),m?_(e,s,u):e):new y(3===u?-0:0)},S.modulo=S.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?_(new r(n),r.precision,r.rounding):(m=!1,9==r.modulo?(t=C(n,e.abs(),0,3,1)).s*=e.s:t=C(n,e,0,r.modulo,1),t=t.times(e),m=!0,n.minus(t))},S.naturalExponential=S.exp=function(){return F(this)},S.naturalLogarithm=S.ln=function(){return j(this)},S.negated=S.neg=function(){var e=new this.constructor(this);return e.s=-e.s,_(e)},S.plus=S.add=function(e){var t,n,r,i,a,o,s,u,l,c,f=this,p=f.constructor;if(e=new p(e),!f.d||!e.d)return f.s&&e.s?f.d||(e=new p(e.d||f.s===e.s?f:NaN)):e=new p(NaN),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(l=f.d,c=e.d,s=p.precision,u=p.rounding,!l[0]||!c[0])return c[0]||(e=new p(f)),m?_(e,s,u):e;if(a=h(f.e/7),r=h(e.e/7),l=l.slice(),i=a-r){for(i<0?(n=l,i=-i,o=c.length):(n=c,r=a,o=l.length),i>(o=(a=Math.ceil(s/7))>o?a+1:o+1)&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((o=l.length)-(i=c.length)<0&&(i=o,n=c,c=l,l=n),t=0;i;)t=(l[--i]=l[i]+c[i]+t)/w|0,l[i]%=w;for(t&&(l.unshift(t),++r),o=l.length;0==l[--o];)l.pop();return e.d=l,e.e=z(l,r),m?_(e,s,u):e},S.precision=S.sd=function(e){var t,n=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(d+e);return n.d?(t=B(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},S.round=function(){var e=this,t=e.constructor;return _(new t(e),e.e+1,t.rounding)},S.sine=S.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+7,r.rounding=1,n=function(e,t){var n,r=t.d.length;if(r<3)return V(e,2,t,t);n=(n=1.4*Math.sqrt(r))>16?16:0|n,t=t.times(1/W(5,n)),t=V(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(r,G(r,n)),r.precision=e,r.rounding=t,_(s>2?n.neg():n,e,t,!0)):new r(NaN)},S.squareRoot=S.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,u=o.e,l=o.s,c=o.constructor;if(1!==l||!s||!s[0])return new c(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);for(m=!1,0==(l=Math.sqrt(+o))||l==1/0?(((t=M(s)).length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=h((u+1)/2)-(u<0||u%2),r=new c(t=l==1/0?"1e"+u:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new c(l.toString()),n=(u=c.precision)+3;;)if(r=(a=r).plus(C(o,a,n+2,1)).times(.5),M(a.d).slice(0,n)===(t=M(r.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(_(r,u+1,1),e=!r.times(r).eq(o));break}if(!i&&(_(a,u+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}return m=!0,_(r,u,c.rounding,e)},S.tangent=S.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,(n=n.sin()).s=1,n=C(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,_(2==s||4==s?n.neg():n,e,t,!0)):new r(NaN)},S.times=S.mul=function(e){var t,n,r,i,a,o,s,u,l,c=this,f=c.constructor,p=c.d,d=(e=new f(e)).d;if(e.s*=c.s,!p||!p[0]||!d||!d[0])return new f(!e.s||p&&!p[0]&&!d||d&&!d[0]&&!p?NaN:p&&d?0*e.s:e.s/0);for(n=h(c.e/7)+h(e.e/7),(u=p.length)<(l=d.length)&&(a=p,p=d,d=a,o=u,u=l,l=o),a=[],r=o=u+l;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=u+r;i>r;)s=a[i]+d[r]*p[i-r-1]+t,a[i--]=s%w|0,t=s/w|0;a[i]=(a[i]+t)%w|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=z(a,n),m?_(e,f.precision,f.rounding):e},S.toBinary=function(e,t){return Z(this,2,e,t)},S.toDecimalPlaces=S.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(T(e,0,1e9),void 0===t?t=r.rounding:T(t,0,8),_(n,e+n.e+1,t))},S.toExponential=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=k(r,!0):(T(e,0,1e9),void 0===t?t=i.rounding:T(t,0,8),n=k(r=_(new i(r),e+1,t),!0,e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},S.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return void 0===e?n=k(i):(T(e,0,1e9),void 0===t?t=a.rounding:T(t,0,8),n=k(r=_(new a(i),e+i.e+1,t),!1,e+r.e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},S.toFraction=function(e){var t,n,r,i,a,o,s,u,l,c,f,p,h=this,g=h.d,v=h.constructor;if(!g)return new v(h);if(l=n=new v(1),r=u=new v(0),o=(a=(t=new v(r)).e=B(g)-h.e-1)%7,t.d[0]=y(10,o<0?7+o:o),null==e)e=a>0?t:l;else{if(!(s=new v(e)).isInt()||s.lt(l))throw Error(d+s);e=s.gt(t)?a>0?t:l:s}for(m=!1,s=new v(M(g)),c=v.precision,v.precision=a=7*g.length*2;f=C(s,t,0,1,1),1!=(i=n.plus(f.times(r))).cmp(e);)n=r,r=i,i=l,l=u.plus(f.times(i)),u=i,i=t,t=s.minus(f.times(i)),s=i;return i=C(e.minus(n),r,0,1,1),u=u.plus(i.times(l)),n=n.plus(i.times(r)),u.s=l.s=h.s,p=C(l,r,a,1).minus(h).abs().cmp(C(u,n,a,1).minus(h).abs())<1?[l,r]:[u,n],v.precision=c,m=!0,p},S.toHexadecimal=S.toHex=function(e,t){return Z(this,16,e,t)},S.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),null==e){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),void 0===t?t=r.rounding:T(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(m=!1,n=C(n,e,0,t,1).times(e),m=!0,_(n)):(e.s=n.s,n=e),n},S.toNumber=function(){return+this},S.toOctal=function(e,t){return Z(this,8,e,t)},S.toPower=S.pow=function(e){var t,n,r,i,a,o,s=this,u=s.constructor,l=+(e=new u(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new u(y(+s,l));if((s=new u(s)).eq(1))return s;if(r=u.precision,a=u.rounding,e.eq(1))return _(s,r,a);if((t=h(e.e/7))>=e.d.length-1&&(n=l<0?-l:l)<=9007199254740991)return i=q(u,s,n,r),e.s<0?new u(1).div(i):_(i,r,a);if((o=s.s)<0){if(t<e.d.length-1)return new u(NaN);if(0==(1&e.d[t])&&(o=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=o,s}return(t=0!=(n=y(+s,l))&&isFinite(n)?new u(n+"").e:h(l*(Math.log("0."+M(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(m=!1,u.rounding=s.s=1,n=Math.min(12,(t+"").length),(i=F(e.times(j(s,r+n)),r)).d&&A((i=_(i,r+5,1)).d,r,a)&&(t=r+10,+M((i=_(F(e.times(j(s,t+n)),t),t+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=_(i,r+1,0))),i.s=o,m=!0,u.rounding=a,_(i,r,a))},S.toPrecision=function(e,t){var n,r=this,i=r.constructor;return void 0===e?n=k(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(T(e,1,1e9),void 0===t?t=i.rounding:T(t,0,8),n=k(r=_(new i(r),e,t),e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?"-"+n:n},S.toSignificantDigits=S.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(T(e,1,1e9),void 0===t?t=n.rounding:T(t,0,8)),_(new n(this),e,t)},S.toString=function(){var e=this,t=e.constructor,n=k(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},S.truncated=S.trunc=function(){return _(new this.constructor(this),this.e+1,1)},S.valueOf=S.toJSON=function(){var e=this,t=e.constructor,n=k(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};var C=function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,a,s,u,l){var c,f,p,m,d,y,g,v,x,b,N,E,S,M,T,A,O,C,k,z,I=r.constructor,D=r.s==i.s?1:-1,B=r.d,P=i.d;if(!B||!B[0]||!P||!P[0])return new I(r.s&&i.s&&(B?!P||B[0]!=P[0]:P)?B&&0==B[0]||!P?0*D:D/0:NaN);for(l?(d=1,f=r.e-i.e):(l=w,d=7,f=h(r.e/d)-h(i.e/d)),k=P.length,O=B.length,b=(x=new I(D)).d=[],p=0;P[p]==(B[p]||0);p++);if(P[p]>(B[p]||0)&&f--,null==a?(M=a=I.precision,s=I.rounding):M=u?a+(r.e-i.e)+1:a,M<0)b.push(1),y=!0;else{if(M=M/d+2|0,p=0,1==k){for(m=0,P=P[0],M++;(p<O||m)&&M--;p++)T=m*l+(B[p]||0),b[p]=T/P|0,m=T%P|0;y=m||p<O}else{for((m=l/(P[0]+1)|0)>1&&(P=e(P,m,l),B=e(B,m,l),k=P.length,O=B.length),A=k,E=(N=B.slice(0,k)).length;E<k;)N[E++]=0;(z=P.slice()).unshift(0),C=P[0],P[1]>=l/2&&++C;do{m=0,(c=t(P,N,k,E))<0?(S=N[0],k!=E&&(S=S*l+(N[1]||0)),(m=S/C|0)>1?(m>=l&&(m=l-1),1==(c=t(g=e(P,m,l),N,v=g.length,E=N.length))&&(m--,n(g,k<v?z:P,v,l))):(0==m&&(c=m=1),g=P.slice()),(v=g.length)<E&&g.unshift(0),n(N,g,E,l),-1==c&&(c=t(P,N,k,E=N.length))<1&&(m++,n(N,k<E?z:P,E,l)),E=N.length):0===c&&(m++,N=[0]),b[p++]=m,c&&N[0]?N[E++]=B[A]||0:(N=[B[A]],E=1)}while((A++<O||void 0!==N[0])&&M--);y=void 0!==N[0]}b[0]||b.shift()}if(1==d)x.e=f,o=y;else{for(p=1,m=b[0];m>=10;m/=10)p++;x.e=p+f*d-1,_(x,u?a+x.e+1:a,s,y)}return x}}();function _(e,t,n,r){var i,a,o,s,u,l,c,f,p,d=e.constructor;e:if(null!=t){if(!(f=e.d))return e;for(i=1,s=f[0];s>=10;s/=10)i++;if((a=t-i)<0)a+=7,o=t,u=(c=f[p=0])/y(10,i-o-1)%10|0;else if((p=Math.ceil((a+1)/7))>=(s=f.length)){if(!r)break e;for(;s++<=p;)f.push(0);c=u=0,i=1,o=(a%=7)-7+1}else{for(c=s=f[p],i=1;s>=10;s/=10)i++;u=(o=(a%=7)-7+i)<0?0:c/y(10,i-o-1)%10|0}if(r=r||t<0||void 0!==f[p+1]||(o<0?c:c%y(10,i-o-1)),l=n<4?(u||r)&&(0==n||n==(e.s<0?3:2)):u>5||5==u&&(4==n||r||6==n&&(a>0?o>0?c/y(10,i-o):0:f[p-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,l?(t-=e.e+1,f[0]=y(10,(7-t%7)%7),e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=p,s=1,p--):(f.length=p+1,s=y(10,7-a),f[p]=o>0?(c/y(10,i-o)%y(10,o)|0)*s:0),l)for(;;){if(0==p){for(a=1,o=f[0];o>=10;o/=10)a++;for(o=f[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,f[0]==w&&(f[0]=1));break}if(f[p]+=s,f[p]!=w)break;f[p--]=0,s=1}for(a=f.length;0===f[--a];)f.pop()}return m&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e<d.minE&&(e.e=0,e.d=[0])),e}function k(e,t,n){if(!e.isFinite())return L(e);var r,i=e.e,a=M(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+"."+a.slice(1)+P(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+P(-i-1)+a,n&&(r=n-o)>0&&(a+=P(r))):i>=o?(a+=P(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+P(r))):((r=i+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+="."),a+=P(r))),a}function z(e,t){var n=e[0];for(t*=7;n>=10;n/=10)t++;return t}function I(e,t,n){if(t>N)throw m=!0,n&&(e.precision=n),Error("[DecimalError] Precision limit exceeded");return _(new e(c),t,1,!0)}function D(e,t,n){if(t>E)throw Error("[DecimalError] Precision limit exceeded");return _(new e(f),t,n,!0)}function B(e){var t=e.length-1,n=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function P(e){for(var t="";e--;)t+="0";return t}function q(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/7+4);for(m=!1;;){if(n%2&&Y((a=a.times(t)).d,o)&&(i=!0),0===(n=h(n/2))){n=a.d.length-1,i&&0===a.d[n]&&++a.d[n];break}Y((t=t.times(t)).d,o)}return m=!0,a}function R(e){return 1&e.d[e.d.length-1]}function U(e,t,n){for(var r,i=new e(t[0]),a=0;++a<t.length;){if(!(r=new e(t[a])).s){i=r;break}i[n](r)&&(i=r)}return i}function F(e,t){var n,r,i,a,o,s,u,l=0,c=0,f=0,p=e.constructor,d=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?(m=!1,u=h):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),f+=5;for(u+=r=Math.log(y(2,f))/Math.LN10*2+5|0,n=a=o=new p(1),p.precision=u;;){if(a=_(a.times(e),u,1),n=n.times(++c),M((s=o.plus(C(a,n,u,1))).d).slice(0,u)===M(o.d).slice(0,u)){for(i=f;i--;)o=_(o.times(o),u,1);if(null!=t)return p.precision=h,o;if(!(l<3&&A(o.d,u-r,d,l)))return _(o,p.precision=h,d,m=!0);p.precision=u+=10,n=a=s=new p(1),c=0,l++}o=s}}function j(e,t){var n,r,i,a,o,s,u,l,c,f,p,d=1,h=e,y=h.d,g=h.constructor,v=g.rounding,x=g.precision;if(h.s<0||!y||!y[0]||!h.e&&1==y[0]&&1==y.length)return new g(y&&!y[0]?-1/0:1!=h.s?NaN:y?0:h);if(null==t?(m=!1,c=x):c=t,g.precision=c+=10,r=(n=M(y)).charAt(0),!(Math.abs(a=h.e)<15e14))return l=I(g,c+2,x).times(a+""),h=j(new g(r+"."+n.slice(1)),c-10).plus(l),g.precision=x,null==t?_(h,x,v,m=!0):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=M((h=h.times(e)).d)).charAt(0),d++;for(a=h.e,r>1?(h=new g("0."+n),a++):h=new g(r+"."+n.slice(1)),f=h,u=o=h=C(h.minus(1),h.plus(1),c,1),p=_(h.times(h),c,1),i=3;;){if(o=_(o.times(p),c,1),M((l=u.plus(C(o,new g(i),c,1))).d).slice(0,c)===M(u.d).slice(0,c)){if(u=u.times(2),0!==a&&(u=u.plus(I(g,c+2,x).times(a+""))),u=C(u,new g(d),c,1),null!=t)return g.precision=x,u;if(!A(u.d,c-10,v,s))return _(u,g.precision=x,v,m=!0);g.precision=c+=10,l=o=h=C(f.minus(1),f.plus(1),c,1),p=_(h.times(h),c,1),i=s=1}u=l,i+=2}}function L(e){return String(e.s*e.s/0)}function $(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);r++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(r,i)){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%7,n<0&&(r+=7),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=7;r<i;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=i;for(;r--;)t+="0";e.d.push(+t),m&&(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 H(e,t){var n,r,i,o,s,u,l,c,f;if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(v.test(t))n=16,t=t.toLowerCase();else if(g.test(t))n=2;else{if(!x.test(t))throw Error(d+t);n=8}for((o=t.search(/p/i))>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),s=(o=t.indexOf("."))>=0,r=e.constructor,s&&(o=(u=(t=t.replace(".","")).length)-o,i=q(r,new r(n),o,2*o)),o=f=(c=O(t,n,w)).length-1;0===c[o];--o)c.pop();return o<0?new r(0*e.s):(e.e=z(c,f),e.d=c,m=!1,s&&(e=C(e,i,4*u)),l&&(e=e.times(Math.abs(l)<54?y(2,l):a.pow(2,l))),m=!0,e)}function V(e,t,n,r,i){var a,o,s,u,l=e.precision,c=Math.ceil(l/7);for(m=!1,u=n.times(n),s=new e(r);;){if(o=C(s.times(u),new e(t++*t++),l,1),s=i?r.plus(o):r.minus(o),r=C(o.times(u),new e(t++*t++),l,1),void 0!==(o=s.plus(r)).d[c]){for(a=c;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=r,r=o,o=a}return m=!0,o.d.length=c+1,o}function W(e,t){for(var n=e;--t;)n*=e;return n}function G(e,t){var n,r=t.s<0,i=D(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return s=r?4:1,t;if((n=t.divToInt(i)).isZero())s=r?3:2;else{if((t=t.minus(n.times(i))).lte(a))return s=R(n)?r?2:3:r?4:1,t;s=R(n)?r?1:4:r?3:2}return t.minus(i).abs()}function Z(e,t,n,r){var i,a,s,u,c,f,p,m,d,h=e.constructor,y=void 0!==n;if(y?(T(n,1,1e9),void 0===r?r=h.rounding:T(r,0,8)):(n=h.precision,r=h.rounding),e.isFinite()){for(y?(i=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):i=t,(s=(p=k(e)).indexOf("."))>=0&&(p=p.replace(".",""),(d=new h(1)).e=p.length-s,d.d=O(k(d),10,i),d.e=d.d.length),a=c=(m=O(p,10,i)).length;0==m[--c];)m.pop();if(m[0]){if(s<0?a--:((e=new h(e)).d=m,e.e=a,m=(e=C(e,d,n,r,0,i)).d,a=e.e,f=o),s=m[n],u=i/2,f=f||void 0!==m[n+1],f=r<4?(void 0!==s||f)&&(0===r||r===(e.s<0?3:2)):s>u||s===u&&(4===r||f||6===r&&1&m[n-1]||r===(e.s<0?8:7)),m.length=n,f)for(;++m[--n]>i-1;)m[n]=0,n||(++a,m.unshift(1));for(c=m.length;!m[c-1];--c);for(s=0,p="";s<c;s++)p+=l.charAt(m[s]);if(y){if(c>1)if(16==t||8==t){for(s=16==t?4:3,--c;c%s;c++)p+="0";for(c=(m=O(p,i,t)).length;!m[c-1];--c);for(s=1,p="1.";s<c;s++)p+=l.charAt(m[s])}else p=p.charAt(0)+"."+p.slice(1);p=p+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)p="0"+p;p="0."+p}else if(++a>c)for(a-=c;a--;)p+="0";else a<c&&(p=p.slice(0,a)+"."+p.slice(a))}else p=y?"0p+0":"0";p=(16==t?"0x":2==t?"0b":8==t?"0o":"")+p}else p=L(e);return e.s<0?"-"+p:p}function Y(e,t){if(e.length>t)return e.length=t,!0}function Q(e){return new this(e).abs()}function J(e){return new this(e).acos()}function X(e){return new this(e).acosh()}function K(e,t){return new this(e).plus(t)}function ee(e){return new this(e).asin()}function te(e){return new this(e).asinh()}function ne(e){return new this(e).atan()}function re(e){return new this(e).atanh()}function ie(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?D(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=D(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,n=this.atan(C(e,t,a,1)),t=D(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(C(e,t,a,1)):(n=D(this,a,1).times(t.s>0?.25:.75)).s=e.s:n=new this(NaN),n}function ae(e){return new this(e).cbrt()}function oe(e){return _(e=new this(e),e.e+1,2)}function se(e){if(!e||"object"!==typeof e)throw Error("[DecimalError] Object expected");var t,n,r,i=!0===e.defaults,a=["precision",1,1e9,"rounding",0,8,"toExpNeg",-u,0,"toExpPos",0,u,"maxE",0,u,"minE",-u,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=p[n]),void 0!==(r=e[n])){if(!(h(r)===r&&r>=a[t+1]&&r<=a[t+2]))throw Error(d+n+": "+r);this[n]=r}if(n="crypto",i&&(this[n]=p[n]),void 0!==(r=e[n])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(d+n+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[n]=!0}else this[n]=!1}return this}function ue(e){return new this(e).cos()}function le(e){return new this(e).cosh()}function ce(e,t){return new this(e).div(t)}function fe(e){return new this(e).exp()}function pe(e){return _(e=new this(e),e.e+1,3)}function me(){var e,t,n=new this(0);for(m=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return m=!0,new this(1/0);n=t}return m=!0,n.sqrt()}function de(e){return e instanceof a||e&&"[object Decimal]"===e.name||!1}function he(e){return new this(e).ln()}function ye(e,t){return new this(e).log(t)}function ge(e){return new this(e).log(2)}function ve(e){return new this(e).log(10)}function xe(){return U(this,arguments,"lt")}function be(){return U(this,arguments,"gt")}function we(e,t){return new this(e).mod(t)}function Ne(e,t){return new this(e).mul(t)}function Ee(e,t){return new this(e).pow(t)}function Se(e){var t,n,r,i,a=0,o=new this(1),s=[];if(void 0===e?e=this.precision:T(e,1,1e9),r=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)(i=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(t=crypto.randomBytes(r*=4);a<r;)(i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else for(;a<r;)s[a++]=1e7*Math.random()|0;for(e%=7,(r=s[--a])&&e&&(i=y(10,7-e),s[a]=(r/i|0)*i);0===s[a];a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;0===s[0];n-=7)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<7&&(n-=7-r)}return o.e=n,o.d=s,o}function Me(e){return _(e=new this(e),e.e+1,this.rounding)}function Te(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ae(e){return new this(e).sin()}function Oe(e){return new this(e).sinh()}function Ce(e){return new this(e).sqrt()}function _e(e,t){return new this(e).sub(t)}function ke(e){return new this(e).tan()}function ze(e){return new this(e).tanh()}function Ie(e){return _(e=new this(e),e.e+1,1)}(a=function e(t){var n,r,i;function a(e){var t,n,r,i=this;if(!(i instanceof a))return new a(e);if(i.constructor=a,e instanceof a)return i.s=e.s,void(m?!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"===(r=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,n=e;n>=10;n/=10)t++;return void(m?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)):$(i,e.toString())}if("string"!==r)throw Error(d+e);return 45===(n=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===n&&(e=e.slice(1)),i.s=1),b.test(e)?$(i,e):H(i,e)}if(a.prototype=S,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=se,a.clone=e,a.isDecimal=de,a.abs=Q,a.acos=J,a.acosh=X,a.add=K,a.asin=ee,a.asinh=te,a.atan=ne,a.atanh=re,a.atan2=ie,a.cbrt=ae,a.ceil=oe,a.cos=ue,a.cosh=le,a.div=ce,a.exp=fe,a.floor=pe,a.hypot=me,a.ln=he,a.log=ye,a.log10=ve,a.log2=ge,a.max=xe,a.min=be,a.mod=we,a.mul=Ne,a.pow=Ee,a.random=Se,a.round=Me,a.sign=Te,a.sin=Ae,a.sinh=Oe,a.sqrt=Ce,a.sub=_e,a.tan=ke,a.tanh=ze,a.trunc=Ie,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<i.length;)t.hasOwnProperty(r=i[n++])||(t[r]=this[r]);return a.config(t),a}(p)).default=a.Decimal=a,c=new a(c),f=new a(f),void 0===(r=function(){return a}.call(t,n,t,e))||(e.exports=r)}()},function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},a={"\u2013":"\\--","\u2014":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},o=function(e,t){return r({},e,t)};e.exports=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.preserveFormatting,s=void 0!==n&&n,u=t.escapeMapFn,l=void 0===u?o:u,c=String(e),f="",p=l(r({},i),s?r({},a):{}),m=Object.keys(p),d=function(){var e=!1;m.forEach((function(t,n){e||c.length>=t.length&&c.slice(0,t.length)===t&&(f+=p[m[n]],c=c.slice(t.length,c.length),e=!0)})),e||(f+=c.slice(0,1),c=c.slice(1,c.length))};c;)d();return f}},function(e,t,n){"use strict";function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function a(e){return(a="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)}function o(e,t){return!t||"object"!==a(t)&&"function"!==typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return function(){var t,n=r(e);if(i()){var a=r(this).constructor;t=Reflect.construct(n,arguments,a)}else t=n.apply(this,arguments);return o(this,t)}}n.d(t,"a",(function(){return s}))},function(e,t,n){"use strict";function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(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}}),t&&r(e,t)}n.d(t,"a",(function(){return i}))},,,function(e,t,n){"use strict";var r=n(7),i="function"===typeof Symbol&&Symbol.for,a=i?Symbol.for("react.element"):60103,o=i?Symbol.for("react.portal"):60106,s=i?Symbol.for("react.fragment"):60107,u=i?Symbol.for("react.strict_mode"):60108,l=i?Symbol.for("react.profiler"):60114,c=i?Symbol.for("react.provider"):60109,f=i?Symbol.for("react.context"):60110,p=i?Symbol.for("react.forward_ref"):60112,m=i?Symbol.for("react.suspense"):60113,d=i?Symbol.for("react.memo"):60115,h=i?Symbol.for("react.lazy"):60116,y="function"===typeof Symbol&&Symbol.iterator;function g(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x={};function b(e,t,n){this.props=e,this.context=t,this.refs=x,this.updater=n||v}function w(){}function N(e,t,n){this.props=e,this.context=t,this.refs=x,this.updater=n||v}b.prototype.isReactComponent={},b.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error(g(85));this.updater.enqueueSetState(this,e,t,"setState")},b.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},w.prototype=b.prototype;var E=N.prototype=new w;E.constructor=N,r(E,b.prototype),E.isPureReactComponent=!0;var S={current:null},M=Object.prototype.hasOwnProperty,T={key:!0,ref:!0,__self:!0,__source:!0};function A(e,t,n){var r,i={},o=null,s=null;if(null!=t)for(r in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(o=""+t.key),t)M.call(t,r)&&!T.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(1===u)i.children=n;else if(1<u){for(var l=Array(u),c=0;c<u;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===i[r]&&(i[r]=u[r]);return{$$typeof:a,type:e,key:o,ref:s,props:i,_owner:S.current}}function O(e){return"object"===typeof e&&null!==e&&e.$$typeof===a}var C=/\/+/g,_=[];function k(e,t,n,r){if(_.length){var i=_.pop();return i.result=e,i.keyPrefix=t,i.func=n,i.context=r,i.count=0,i}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function z(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>_.length&&_.push(e)}function I(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var u=!1;if(null===t)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case a:case o:u=!0}}if(u)return r(i,t,""===n?"."+D(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l<t.length;l++){var c=n+D(s=t[l],l);u+=e(s,c,r,i)}else if(null===t||"object"!==typeof t?c=null:c="function"===typeof(c=y&&t[y]||t["@@iterator"])?c:null,"function"===typeof c)for(t=c.call(t),l=0;!(s=t.next()).done;)u+=e(s=s.value,c=n+D(s,l++),r,i);else if("object"===s)throw r=""+t,Error(g(31,"[object Object]"===r?"object with keys {"+Object.keys(t).join(", ")+"}":r,""));return u}(e,"",t,n)}function D(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function B(e,t){e.func.call(e.context,t,e.count++)}function P(e,t,n){var r=e.result,i=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?q(e,r,n,(function(e){return e})):null!=e&&(O(e)&&(e=function(e,t){return{$$typeof:a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,i+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(C,"$&/")+"/")+n)),r.push(e))}function q(e,t,n,r,i){var a="";null!=n&&(a=(""+n).replace(C,"$&/")+"/"),I(e,P,t=k(t,a,r,i)),z(t)}var R={current:null};function U(){var e=R.current;if(null===e)throw Error(g(321));return e}var F={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:r};t.Children={map:function(e,t,n){if(null==e)return e;var r=[];return q(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;I(e,B,t=k(null,null,t,n)),z(t)},count:function(e){return I(e,(function(){return null}),null)},toArray:function(e){var t=[];return q(e,t,null,(function(e){return e})),t},only:function(e){if(!O(e))throw Error(g(143));return e}},t.Component=b,t.Fragment=s,t.Profiler=l,t.PureComponent=N,t.StrictMode=u,t.Suspense=m,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error(g(267,e));var i=r({},e.props),o=e.key,s=e.ref,u=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,u=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)M.call(t,c)&&!T.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){l=Array(c);for(var f=0;f<c;f++)l[f]=arguments[f+2];i.children=l}return{$$typeof:a,type:e.type,key:o,ref:s,props:i,_owner:u}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:f,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:c,_context:e},e.Consumer=e},t.createElement=A,t.createFactory=function(e){var t=A.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:p,render:e}},t.isValidElement=O,t.lazy=function(e){return{$$typeof:h,_ctor:e,_status:-1,_result:null}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return U().useCallback(e,t)},t.useContext=function(e,t){return U().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return U().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return U().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return U().useLayoutEffect(e,t)},t.useMemo=function(e,t){return U().useMemo(e,t)},t.useReducer=function(e,t,n){return U().useReducer(e,t,n)},t.useRef=function(e){return U().useRef(e)},t.useState=function(e){return U().useState(e)},t.version="16.13.1"},function(e,t,n){"use strict";var r=n(1),i=n(7),a=n(19);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!r)throw Error(o(227));function s(e,t,n,r,i,a,o,s,u){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(c){this.onError(c)}}var u=!1,l=null,c=!1,f=null,p={onError:function(e){u=!0,l=e}};function m(e,t,n,r,i,a,o,c,f){u=!1,l=null,s.apply(p,arguments)}var d=null,h=null,y=null;function g(e,t,n){var r=e.type||"unknown-event";e.currentTarget=y(n),function(e,t,n,r,i,a,s,p,d){if(m.apply(this,arguments),u){if(!u)throw Error(o(198));var h=l;u=!1,l=null,c||(c=!0,f=h)}}(r,t,void 0,e),e.currentTarget=null}var v=null,x={};function b(){if(v)for(var e in x){var t=x[e],n=v.indexOf(e);if(!(-1<n))throw Error(o(96,e));if(!N[n]){if(!t.extractEvents)throw Error(o(97,e));for(var r in N[n]=t,n=t.eventTypes){var i=void 0,a=n[r],s=t,u=r;if(E.hasOwnProperty(u))throw Error(o(99,u));E[u]=a;var l=a.phasedRegistrationNames;if(l){for(i in l)l.hasOwnProperty(i)&&w(l[i],s,u);i=!0}else a.registrationName?(w(a.registrationName,s,u),i=!0):i=!1;if(!i)throw Error(o(98,r,e))}}}}function w(e,t,n){if(S[e])throw Error(o(100,e));S[e]=t,M[e]=t.eventTypes[n].dependencies}var N=[],E={},S={},M={};function T(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var r=e[t];if(!x.hasOwnProperty(t)||x[t]!==r){if(x[t])throw Error(o(102,t));x[t]=r,n=!0}}n&&b()}var A=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),O=null,C=null,_=null;function k(e){if(e=h(e)){if("function"!==typeof O)throw Error(o(280));var t=e.stateNode;t&&(t=d(t),O(e.stateNode,e.type,t))}}function z(e){C?_?_.push(e):_=[e]:C=e}function I(){if(C){var e=C,t=_;if(_=C=null,k(e),t)for(e=0;e<t.length;e++)k(t[e])}}function D(e,t){return e(t)}function B(e,t,n,r,i){return e(t,n,r,i)}function P(){}var q=D,R=!1,U=!1;function F(){null===C&&null===_||(P(),I())}function j(e,t,n){if(U)return e(t,n);U=!0;try{return q(e,t,n)}finally{U=!1,F()}}var L=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,$=Object.prototype.hasOwnProperty,H={},V={};function W(e,t,n,r,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a}var G={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){G[e]=new W(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];G[t]=new W(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){G[e]=new W(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){G[e]=new W(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){G[e]=new W(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){G[e]=new W(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){G[e]=new W(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){G[e]=new W(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){G[e]=new W(e,5,!1,e.toLowerCase(),null,!1)}));var Z=/[\-:]([a-z])/g;function Y(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Z,Y);G[t]=new W(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Z,Y);G[t]=new W(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Z,Y);G[t]=new W(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){G[e]=new W(e,1,!1,e.toLowerCase(),null,!1)})),G.xlinkHref=new W("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){G[e]=new W(e,1,!1,e.toLowerCase(),null,!0)}));var Q=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function J(e,t,n,r){var i=G.hasOwnProperty(t)?G[t]:null;(null!==i?0===i.type:!r&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,r){if(null===t||"undefined"===typeof t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!$.call(V,e)||!$.call(H,e)&&(L.test(e)?V[e]=!0:(H[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}Q.hasOwnProperty("ReactCurrentDispatcher")||(Q.ReactCurrentDispatcher={current:null}),Q.hasOwnProperty("ReactCurrentBatchConfig")||(Q.ReactCurrentBatchConfig={suspense:null});var X=/^(.*)[\\\/]/,K="function"===typeof Symbol&&Symbol.for,ee=K?Symbol.for("react.element"):60103,te=K?Symbol.for("react.portal"):60106,ne=K?Symbol.for("react.fragment"):60107,re=K?Symbol.for("react.strict_mode"):60108,ie=K?Symbol.for("react.profiler"):60114,ae=K?Symbol.for("react.provider"):60109,oe=K?Symbol.for("react.context"):60110,se=K?Symbol.for("react.concurrent_mode"):60111,ue=K?Symbol.for("react.forward_ref"):60112,le=K?Symbol.for("react.suspense"):60113,ce=K?Symbol.for("react.suspense_list"):60120,fe=K?Symbol.for("react.memo"):60115,pe=K?Symbol.for("react.lazy"):60116,me=K?Symbol.for("react.block"):60121,de="function"===typeof Symbol&&Symbol.iterator;function he(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=de&&e[de]||e["@@iterator"])?e:null}function ye(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case ne:return"Fragment";case te:return"Portal";case ie:return"Profiler";case re:return"StrictMode";case le:return"Suspense";case ce:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case oe:return"Context.Consumer";case ae:return"Context.Provider";case ue:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case fe:return ye(e.type);case me:return ye(e.render);case pe:if(e=1===e._status?e._result:null)return ye(e)}return null}function ge(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var r=e._debugOwner,i=e._debugSource,a=ye(e.type);n=null,r&&(n=ye(r.type)),r=a,a="",i?a=" (at "+i.fileName.replace(X,"")+":"+i.lineNumber+")":n&&(a=" (created by "+n+")"),n="\n    in "+(r||"Unknown")+a}t+=n,e=e.return}while(e);return t}function ve(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function xe(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function be(e){e._valueTracker||(e._valueTracker=function(e){var t=xe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function we(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xe(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Ne(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=ve(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Se(e,t){null!=(t=t.checked)&&J(e,"checked",t,!1)}function Me(e,t){Se(e,t);var n=ve(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?Ae(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ae(e,t.type,ve(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Te(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function Ae(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Oe(e,t){return e=i({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Ce(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ve(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function _e(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ke(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(o(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(o(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:ve(n)}}function ze(e,t){var n=ve(t.value),r=ve(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function Ie(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var De="http://www.w3.org/1999/xhtml",Be="http://www.w3.org/2000/svg";function Pe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function qe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Pe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Re,Ue=function(e){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Be||"innerHTML"in e)e.innerHTML=t;else{for((Re=Re||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Re.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function Fe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function je(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Le={animationend:je("Animation","AnimationEnd"),animationiteration:je("Animation","AnimationIteration"),animationstart:je("Animation","AnimationStart"),transitionend:je("Transition","TransitionEnd")},$e={},He={};function Ve(e){if($e[e])return $e[e];if(!Le[e])return e;var t,n=Le[e];for(t in n)if(n.hasOwnProperty(t)&&t in He)return $e[e]=n[t];return e}A&&(He=document.createElement("div").style,"AnimationEvent"in window||(delete Le.animationend.animation,delete Le.animationiteration.animation,delete Le.animationstart.animation),"TransitionEvent"in window||delete Le.transitionend.transition);var We=Ve("animationend"),Ge=Ve("animationiteration"),Ze=Ve("animationstart"),Ye=Ve("transitionend"),Qe="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Je=new("function"===typeof WeakMap?WeakMap:Map);function Xe(e){var t=Je.get(e);return void 0===t&&(t=new Map,Je.set(e,t)),t}function Ke(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function et(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function tt(e){if(Ke(e)!==e)throw Error(o(188))}function nt(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Ke(e)))throw Error(o(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return tt(i),e;if(a===r)return tt(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,u=i.child;u;){if(u===n){s=!0,n=i,r=a;break}if(u===r){s=!0,r=i,n=a;break}u=u.sibling}if(!s){for(u=a.child;u;){if(u===n){s=!0,n=a,r=i;break}if(u===r){s=!0,r=a,n=i;break}u=u.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(3!==n.tag)throw Error(o(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function rt(e,t){if(null==t)throw Error(o(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function it(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var at=null;function ot(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var r=0;r<t.length&&!e.isPropagationStopped();r++)g(e,t[r],n[r]);else t&&g(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function st(e){if(null!==e&&(at=rt(at,e)),e=at,at=null,e){if(it(e,ot),at)throw Error(o(95));if(c)throw e=f,c=!1,f=null,e}}function ut(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function lt(e){if(!A)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"===typeof t[e]),t}var ct=[];function ft(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>ct.length&&ct.push(e)}function pt(e,t,n,r){if(ct.length){var i=ct.pop();return i.topLevelType=e,i.eventSystemFlags=r,i.nativeEvent=t,i.targetInst=n,i}return{topLevelType:e,eventSystemFlags:r,nativeEvent:t,targetInst:n,ancestors:[]}}function mt(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var r=n;if(3===r.tag)r=r.stateNode.containerInfo;else{for(;r.return;)r=r.return;r=3!==r.tag?null:r.stateNode.containerInfo}if(!r)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=An(r)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var i=ut(e.nativeEvent);r=e.topLevelType;var a=e.nativeEvent,o=e.eventSystemFlags;0===n&&(o|=64);for(var s=null,u=0;u<N.length;u++){var l=N[u];l&&(l=l.extractEvents(r,t,a,i,o))&&(s=rt(s,l))}st(s)}}function dt(e,t,n){if(!n.has(e)){switch(e){case"scroll":Zt(t,"scroll",!0);break;case"focus":case"blur":Zt(t,"focus",!0),Zt(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":lt(e)&&Zt(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Qe.indexOf(e)&&Gt(e,t)}n.set(e,null)}}var ht,yt,gt,vt=!1,xt=[],bt=null,wt=null,Nt=null,Et=new Map,St=new Map,Mt=[],Tt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),At="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function Ot(e,t,n,r,i){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:i,container:r}}function Ct(e,t){switch(e){case"focus":case"blur":bt=null;break;case"dragenter":case"dragleave":wt=null;break;case"mouseover":case"mouseout":Nt=null;break;case"pointerover":case"pointerout":Et.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":St.delete(t.pointerId)}}function _t(e,t,n,r,i,a){return null===e||e.nativeEvent!==a?(e=Ot(t,n,r,i,a),null!==t&&(null!==(t=On(t))&&yt(t)),e):(e.eventSystemFlags|=r,e)}function kt(e){var t=An(e.target);if(null!==t){var n=Ke(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=et(n)))return e.blockedOn=t,void a.unstable_runWithPriority(e.priority,(function(){gt(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function zt(e){if(null!==e.blockedOn)return!1;var t=Xt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=On(t);return null!==n&&yt(n),e.blockedOn=t,!1}return!0}function It(e,t,n){zt(e)&&n.delete(t)}function Dt(){for(vt=!1;0<xt.length;){var e=xt[0];if(null!==e.blockedOn){null!==(e=On(e.blockedOn))&&ht(e);break}var t=Xt(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:xt.shift()}null!==bt&&zt(bt)&&(bt=null),null!==wt&&zt(wt)&&(wt=null),null!==Nt&&zt(Nt)&&(Nt=null),Et.forEach(It),St.forEach(It)}function Bt(e,t){e.blockedOn===t&&(e.blockedOn=null,vt||(vt=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Dt)))}function Pt(e){function t(t){return Bt(t,e)}if(0<xt.length){Bt(xt[0],e);for(var n=1;n<xt.length;n++){var r=xt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==bt&&Bt(bt,e),null!==wt&&Bt(wt,e),null!==Nt&&Bt(Nt,e),Et.forEach(t),St.forEach(t),n=0;n<Mt.length;n++)(r=Mt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Mt.length&&null===(n=Mt[0]).blockedOn;)kt(n),null===n.blockedOn&&Mt.shift()}var qt={},Rt=new Map,Ut=new Map,Ft=["abort","abort",We,"animationEnd",Ge,"animationIteration",Ze,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Ye,"transitionEnd","waiting","waiting"];function jt(e,t){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1],a="on"+(i[0].toUpperCase()+i.slice(1));a={phasedRegistrationNames:{bubbled:a,captured:a+"Capture"},dependencies:[r],eventPriority:t},Ut.set(r,t),Rt.set(r,a),qt[i]=a}}jt("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),jt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),jt(Ft,2);for(var Lt="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),$t=0;$t<Lt.length;$t++)Ut.set(Lt[$t],0);var Ht=a.unstable_UserBlockingPriority,Vt=a.unstable_runWithPriority,Wt=!0;function Gt(e,t){Zt(t,e,!1)}function Zt(e,t,n){var r=Ut.get(t);switch(void 0===r?2:r){case 0:r=Yt.bind(null,t,1,e);break;case 1:r=Qt.bind(null,t,1,e);break;default:r=Jt.bind(null,t,1,e)}n?e.addEventListener(t,r,!0):e.addEventListener(t,r,!1)}function Yt(e,t,n,r){R||P();var i=Jt,a=R;R=!0;try{B(i,e,t,n,r)}finally{(R=a)||F()}}function Qt(e,t,n,r){Vt(Ht,Jt.bind(null,e,t,n,r))}function Jt(e,t,n,r){if(Wt)if(0<xt.length&&-1<Tt.indexOf(e))e=Ot(null,e,t,n,r),xt.push(e);else{var i=Xt(e,t,n,r);if(null===i)Ct(e,r);else if(-1<Tt.indexOf(e))e=Ot(i,e,t,n,r),xt.push(e);else if(!function(e,t,n,r,i){switch(t){case"focus":return bt=_t(bt,e,t,n,r,i),!0;case"dragenter":return wt=_t(wt,e,t,n,r,i),!0;case"mouseover":return Nt=_t(Nt,e,t,n,r,i),!0;case"pointerover":var a=i.pointerId;return Et.set(a,_t(Et.get(a)||null,e,t,n,r,i)),!0;case"gotpointercapture":return a=i.pointerId,St.set(a,_t(St.get(a)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r)){Ct(e,r),e=pt(e,r,null,t);try{j(mt,e)}finally{ft(e)}}}}function Xt(e,t,n,r){if(null!==(n=An(n=ut(r)))){var i=Ke(n);if(null===i)n=null;else{var a=i.tag;if(13===a){if(null!==(n=et(i)))return n;n=null}else if(3===a){if(i.stateNode.hydrate)return 3===i.tag?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null)}}e=pt(e,r,n,t);try{j(mt,e)}finally{ft(e)}return null}var Kt={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},en=["Webkit","ms","Moz","O"];function tn(e,t,n){return null==t||"boolean"===typeof t||""===t?"":n||"number"!==typeof t||0===t||Kt.hasOwnProperty(e)&&Kt[e]?(""+t).trim():t+"px"}function nn(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=tn(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(Kt).forEach((function(e){en.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kt[t]=Kt[e]}))}));var rn=i({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function an(e,t){if(t){if(rn[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62,""))}}function on(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var sn=De;function un(e,t){var n=Xe(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=M[t];for(var r=0;r<t.length;r++)dt(t[r],e,n)}function ln(){}function cn(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function fn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pn(e,t){var n,r=fn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fn(r)}}function mn(){for(var e=window,t=cn();t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=cn((e=t.contentWindow).document)}return t}function dn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var hn=null,yn=null;function gn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function vn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var xn="function"===typeof setTimeout?setTimeout:void 0,bn="function"===typeof clearTimeout?clearTimeout:void 0;function wn(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Nn(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var En=Math.random().toString(36).slice(2),Sn="__reactInternalInstance$"+En,Mn="__reactEventHandlers$"+En,Tn="__reactContainere$"+En;function An(e){var t=e[Sn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Tn]||n[Sn]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Nn(e);null!==e;){if(n=e[Sn])return n;e=Nn(e)}return t}n=(e=n).parentNode}return null}function On(e){return!(e=e[Sn]||e[Tn])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function Cn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function _n(e){return e[Mn]||null}function kn(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function zn(e,t){var n=e.stateNode;if(!n)return null;var r=d(n);if(!r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(o(231,t,typeof n));return n}function In(e,t,n){(t=zn(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Dn(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=kn(t);for(t=n.length;0<t--;)In(n[t],"captured",e);for(t=0;t<n.length;t++)In(n[t],"bubbled",e)}}function Bn(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=zn(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=rt(n._dispatchListeners,t),n._dispatchInstances=rt(n._dispatchInstances,e))}function Pn(e){e&&e.dispatchConfig.registrationName&&Bn(e._targetInst,null,e)}function qn(e){it(e,Dn)}var Rn=null,Un=null,Fn=null;function jn(){if(Fn)return Fn;var e,t,n=Un,r=n.length,i="value"in Rn?Rn.value:Rn.textContent,a=i.length;for(e=0;e<r&&n[e]===i[e];e++);var o=r-e;for(t=1;t<=o&&n[r-t]===i[a-t];t++);return Fn=i.slice(e,1<t?1-t:void 0)}function Ln(){return!0}function $n(){return!1}function Hn(e,t,n,r){for(var i in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(i)&&((t=e[i])?this[i]=t(n):"target"===i?this.target=r:this[i]=n[i]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Ln:$n,this.isPropagationStopped=$n,this}function Vn(e,t,n,r){if(this.eventPool.length){var i=this.eventPool.pop();return this.call(i,e,t,n,r),i}return new this(e,t,n,r)}function Wn(e){if(!(e instanceof this))throw Error(o(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Gn(e){e.eventPool=[],e.getPooled=Vn,e.release=Wn}i(Hn.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ln)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ln)},persist:function(){this.isPersistent=Ln},isPersistent:$n,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=$n,this._dispatchInstances=this._dispatchListeners=null}}),Hn.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Hn.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var a=new t;return i(a,n.prototype),n.prototype=a,n.prototype.constructor=n,n.Interface=i({},r.Interface,e),n.extend=r.extend,Gn(n),n},Gn(Hn);var Zn=Hn.extend({data:null}),Yn=Hn.extend({data:null}),Qn=[9,13,27,32],Jn=A&&"CompositionEvent"in window,Xn=null;A&&"documentMode"in document&&(Xn=document.documentMode);var Kn=A&&"TextEvent"in window&&!Xn,er=A&&(!Jn||Xn&&8<Xn&&11>=Xn),tr=String.fromCharCode(32),nr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},rr=!1;function ir(e,t){switch(e){case"keyup":return-1!==Qn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function ar(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var or=!1;var sr={eventTypes:nr,extractEvents:function(e,t,n,r){var i;if(Jn)e:{switch(e){case"compositionstart":var a=nr.compositionStart;break e;case"compositionend":a=nr.compositionEnd;break e;case"compositionupdate":a=nr.compositionUpdate;break e}a=void 0}else or?ir(e,n)&&(a=nr.compositionEnd):"keydown"===e&&229===n.keyCode&&(a=nr.compositionStart);return a?(er&&"ko"!==n.locale&&(or||a!==nr.compositionStart?a===nr.compositionEnd&&or&&(i=jn()):(Un="value"in(Rn=r)?Rn.value:Rn.textContent,or=!0)),a=Zn.getPooled(a,t,n,r),i?a.data=i:null!==(i=ar(n))&&(a.data=i),qn(a),i=a):i=null,(e=Kn?function(e,t){switch(e){case"compositionend":return ar(t);case"keypress":return 32!==t.which?null:(rr=!0,tr);case"textInput":return(e=t.data)===tr&&rr?null:e;default:return null}}(e,n):function(e,t){if(or)return"compositionend"===e||!Jn&&ir(e,t)?(e=jn(),Fn=Un=Rn=null,or=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return er&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Yn.getPooled(nr.beforeInput,t,n,r)).data=e,qn(t)):t=null,null===i?t:null===t?i:[i,t]}},ur={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function lr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!ur[e.type]:"textarea"===t}var cr={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function fr(e,t,n){return(e=Hn.getPooled(cr.change,e,t,n)).type="change",z(n),qn(e),e}var pr=null,mr=null;function dr(e){st(e)}function hr(e){if(we(Cn(e)))return e}function yr(e,t){if("change"===e)return t}var gr=!1;function vr(){pr&&(pr.detachEvent("onpropertychange",xr),mr=pr=null)}function xr(e){if("value"===e.propertyName&&hr(mr))if(e=fr(mr,e,ut(e)),R)st(e);else{R=!0;try{D(dr,e)}finally{R=!1,F()}}}function br(e,t,n){"focus"===e?(vr(),mr=n,(pr=t).attachEvent("onpropertychange",xr)):"blur"===e&&vr()}function wr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return hr(mr)}function Nr(e,t){if("click"===e)return hr(t)}function Er(e,t){if("input"===e||"change"===e)return hr(t)}A&&(gr=lt("input")&&(!document.documentMode||9<document.documentMode));var Sr={eventTypes:cr,_isInputEventSupported:gr,extractEvents:function(e,t,n,r){var i=t?Cn(t):window,a=i.nodeName&&i.nodeName.toLowerCase();if("select"===a||"input"===a&&"file"===i.type)var o=yr;else if(lr(i))if(gr)o=Er;else{o=wr;var s=br}else(a=i.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===i.type||"radio"===i.type)&&(o=Nr);if(o&&(o=o(e,t)))return fr(o,n,r);s&&s(e,i,t),"blur"===e&&(e=i._wrapperState)&&e.controlled&&"number"===i.type&&Ae(i,"number",i.value)}},Mr=Hn.extend({view:null,detail:null}),Tr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Tr[e])&&!!t[e]}function Or(){return Ar}var Cr=0,_r=0,kr=!1,zr=!1,Ir=Mr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Or,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Cr;return Cr=e.screenX,kr?"mousemove"===e.type?e.screenX-t:0:(kr=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=_r;return _r=e.screenY,zr?"mousemove"===e.type?e.screenY-t:0:(zr=!0,0)}}),Dr=Ir.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Br={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Pr={eventTypes:Br,extractEvents:function(e,t,n,r,i){var a="mouseover"===e||"pointerover"===e,o="mouseout"===e||"pointerout"===e;if(a&&0===(32&i)&&(n.relatedTarget||n.fromElement)||!o&&!a)return null;(a=r.window===r?r:(a=r.ownerDocument)?a.defaultView||a.parentWindow:window,o)?(o=t,null!==(t=(t=n.relatedTarget||n.toElement)?An(t):null)&&(t!==Ke(t)||5!==t.tag&&6!==t.tag)&&(t=null)):o=null;if(o===t)return null;if("mouseout"===e||"mouseover"===e)var s=Ir,u=Br.mouseLeave,l=Br.mouseEnter,c="mouse";else"pointerout"!==e&&"pointerover"!==e||(s=Dr,u=Br.pointerLeave,l=Br.pointerEnter,c="pointer");if(e=null==o?a:Cn(o),a=null==t?a:Cn(t),(u=s.getPooled(u,o,n,r)).type=c+"leave",u.target=e,u.relatedTarget=a,(n=s.getPooled(l,t,n,r)).type=c+"enter",n.target=a,n.relatedTarget=e,c=t,(r=o)&&c)e:{for(l=c,o=0,e=s=r;e;e=kn(e))o++;for(e=0,t=l;t;t=kn(t))e++;for(;0<o-e;)s=kn(s),o--;for(;0<e-o;)l=kn(l),e--;for(;o--;){if(s===l||s===l.alternate)break e;s=kn(s),l=kn(l)}s=null}else s=null;for(l=s,s=[];r&&r!==l&&(null===(o=r.alternate)||o!==l);)s.push(r),r=kn(r);for(r=[];c&&c!==l&&(null===(o=c.alternate)||o!==l);)r.push(c),c=kn(c);for(c=0;c<s.length;c++)Bn(s[c],"bubbled",u);for(c=r.length;0<c--;)Bn(r[c],"captured",n);return 0===(64&i)?[u]:[u,n]}};var qr="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t},Rr=Object.prototype.hasOwnProperty;function Ur(e,t){if(qr(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Rr.call(t,n[r])||!qr(e[n[r]],t[n[r]]))return!1;return!0}var Fr=A&&"documentMode"in document&&11>=document.documentMode,jr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Lr=null,$r=null,Hr=null,Vr=!1;function Wr(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Vr||null==Lr||Lr!==cn(n)?null:("selectionStart"in(n=Lr)&&dn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Hr&&Ur(Hr,n)?null:(Hr=n,(e=Hn.getPooled(jr.select,$r,e,t)).type="select",e.target=Lr,qn(e),e))}var Gr={eventTypes:jr,extractEvents:function(e,t,n,r,i,a){if(!(a=!(i=a||(r.window===r?r.document:9===r.nodeType?r:r.ownerDocument)))){e:{i=Xe(i),a=M.onSelect;for(var o=0;o<a.length;o++)if(!i.has(a[o])){i=!1;break e}i=!0}a=!i}if(a)return null;switch(i=t?Cn(t):window,e){case"focus":(lr(i)||"true"===i.contentEditable)&&(Lr=i,$r=t,Hr=null);break;case"blur":Hr=$r=Lr=null;break;case"mousedown":Vr=!0;break;case"contextmenu":case"mouseup":case"dragend":return Vr=!1,Wr(n,r);case"selectionchange":if(Fr)break;case"keydown":case"keyup":return Wr(n,r)}return null}},Zr=Hn.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Yr=Hn.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qr=Mr.extend({relatedTarget:null});function Jr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Xr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ei=Mr.extend({key:function(e){if(e.key){var t=Xr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Jr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Kr[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Or,charCode:function(e){return"keypress"===e.type?Jr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Jr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),ti=Ir.extend({dataTransfer:null}),ni=Mr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Or}),ri=Hn.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),ii=Ir.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),ai={eventTypes:qt,extractEvents:function(e,t,n,r){var i=Rt.get(e);if(!i)return null;switch(e){case"keypress":if(0===Jr(n))return null;case"keydown":case"keyup":e=ei;break;case"blur":case"focus":e=Qr;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Ir;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=ti;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=ni;break;case We:case Ge:case Ze:e=Zr;break;case Ye:e=ri;break;case"scroll":e=Mr;break;case"wheel":e=ii;break;case"copy":case"cut":case"paste":e=Yr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Dr;break;default:e=Hn}return qn(t=e.getPooled(i,t,n,r)),t}};if(v)throw Error(o(101));v=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),b(),d=_n,h=On,y=Cn,T({SimpleEventPlugin:ai,EnterLeaveEventPlugin:Pr,ChangeEventPlugin:Sr,SelectEventPlugin:Gr,BeforeInputEventPlugin:sr});var oi=[],si=-1;function ui(e){0>si||(e.current=oi[si],oi[si]=null,si--)}function li(e,t){si++,oi[si]=e.current,e.current=t}var ci={},fi={current:ci},pi={current:!1},mi=ci;function di(e,t){var n=e.type.contextTypes;if(!n)return ci;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function hi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function yi(){ui(pi),ui(fi)}function gi(e,t,n){if(fi.current!==ci)throw Error(o(168));li(fi,t),li(pi,n)}function vi(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!==typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in e))throw Error(o(108,ye(t)||"Unknown",a));return i({},n,{},r)}function xi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ci,mi=fi.current,li(fi,e),li(pi,pi.current),!0}function bi(e,t,n){var r=e.stateNode;if(!r)throw Error(o(169));n?(e=vi(e,t,mi),r.__reactInternalMemoizedMergedChildContext=e,ui(pi),ui(fi),li(fi,e)):ui(pi),li(pi,n)}var wi=a.unstable_runWithPriority,Ni=a.unstable_scheduleCallback,Ei=a.unstable_cancelCallback,Si=a.unstable_requestPaint,Mi=a.unstable_now,Ti=a.unstable_getCurrentPriorityLevel,Ai=a.unstable_ImmediatePriority,Oi=a.unstable_UserBlockingPriority,Ci=a.unstable_NormalPriority,_i=a.unstable_LowPriority,ki=a.unstable_IdlePriority,zi={},Ii=a.unstable_shouldYield,Di=void 0!==Si?Si:function(){},Bi=null,Pi=null,qi=!1,Ri=Mi(),Ui=1e4>Ri?Mi:function(){return Mi()-Ri};function Fi(){switch(Ti()){case Ai:return 99;case Oi:return 98;case Ci:return 97;case _i:return 96;case ki:return 95;default:throw Error(o(332))}}function ji(e){switch(e){case 99:return Ai;case 98:return Oi;case 97:return Ci;case 96:return _i;case 95:return ki;default:throw Error(o(332))}}function Li(e,t){return e=ji(e),wi(e,t)}function $i(e,t,n){return e=ji(e),Ni(e,t,n)}function Hi(e){return null===Bi?(Bi=[e],Pi=Ni(Ai,Wi)):Bi.push(e),zi}function Vi(){if(null!==Pi){var e=Pi;Pi=null,Ei(e)}Wi()}function Wi(){if(!qi&&null!==Bi){qi=!0;var e=0;try{var t=Bi;Li(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Bi=null}catch(n){throw null!==Bi&&(Bi=Bi.slice(e+1)),Ni(Ai,Vi),n}finally{qi=!1}}}function Gi(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Zi(e,t){if(e&&e.defaultProps)for(var n in t=i({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Yi={current:null},Qi=null,Ji=null,Xi=null;function Ki(){Xi=Ji=Qi=null}function ea(e){var t=Yi.current;ui(Yi),e.type._context._currentValue=t}function ta(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function na(e,t){Qi=e,Xi=Ji=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(_o=!0),e.firstContext=null)}function ra(e,t){if(Xi!==e&&!1!==t&&0!==t)if("number"===typeof t&&1073741823!==t||(Xi=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Ji){if(null===Qi)throw Error(o(308));Ji=t,Qi.dependencies={expirationTime:0,firstContext:t,responders:null}}else Ji=Ji.next=t;return e._currentValue}var ia=!1;function aa(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function oa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function sa(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function ua(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function la(e,t){var n=e.alternate;null!==n&&oa(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function ca(e,t,n,r){var a=e.updateQueue;ia=!1;var o=a.baseQueue,s=a.shared.pending;if(null!==s){if(null!==o){var u=o.next;o.next=s.next,s.next=u}o=s,a.shared.pending=null,null!==(u=e.alternate)&&(null!==(u=u.updateQueue)&&(u.baseQueue=s))}if(null!==o){u=o.next;var l=a.baseState,c=0,f=null,p=null,m=null;if(null!==u)for(var d=u;;){if((s=d.expirationTime)<r){var h={expirationTime:d.expirationTime,suspenseConfig:d.suspenseConfig,tag:d.tag,payload:d.payload,callback:d.callback,next:null};null===m?(p=m=h,f=l):m=m.next=h,s>c&&(c=s)}else{null!==m&&(m=m.next={expirationTime:1073741823,suspenseConfig:d.suspenseConfig,tag:d.tag,payload:d.payload,callback:d.callback,next:null}),au(s,d.suspenseConfig);e:{var y=e,g=d;switch(s=t,h=n,g.tag){case 1:if("function"===typeof(y=g.payload)){l=y.call(h,l,s);break e}l=y;break e;case 3:y.effectTag=-4097&y.effectTag|64;case 0:if(null===(s="function"===typeof(y=g.payload)?y.call(h,l,s):y)||void 0===s)break e;l=i({},l,s);break e;case 2:ia=!0}}null!==d.callback&&(e.effectTag|=32,null===(s=a.effects)?a.effects=[d]:s.push(d))}if(null===(d=d.next)||d===u){if(null===(s=a.shared.pending))break;d=o.next=s.next,s.next=u,a.baseQueue=o=s,a.shared.pending=null}}null===m?f=l:m.next=p,a.baseState=f,a.baseQueue=m,ou(c),e.expirationTime=c,e.memoizedState=l}}function fa(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=i,i=n,"function"!==typeof r)throw Error(o(191,r));r.call(i)}}}var pa=Q.ReactCurrentBatchConfig,ma=(new r.Component).refs;function da(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:i({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var ha={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Ke(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var r=Ws(),i=pa.suspense;(i=sa(r=Gs(r,e,i),i)).payload=t,void 0!==n&&null!==n&&(i.callback=n),ua(e,i),Zs(e,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var r=Ws(),i=pa.suspense;(i=sa(r=Gs(r,e,i),i)).tag=1,i.payload=t,void 0!==n&&null!==n&&(i.callback=n),ua(e,i),Zs(e,r)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=Ws(),r=pa.suspense;(r=sa(n=Gs(n,e,r),r)).tag=2,void 0!==t&&null!==t&&(r.callback=t),ua(e,r),Zs(e,n)}};function ya(e,t,n,r,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!Ur(n,r)||!Ur(i,a))}function ga(e,t,n){var r=!1,i=ci,a=t.contextType;return"object"===typeof a&&null!==a?a=ra(a):(i=hi(t)?mi:fi.current,a=(r=null!==(r=t.contextTypes)&&void 0!==r)?di(e,i):ci),t=new t(n,a),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=ha,e.stateNode=t,t._reactInternalFiber=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function va(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&ha.enqueueReplaceState(t,t.state,null)}function xa(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=ma,aa(e);var a=t.contextType;"object"===typeof a&&null!==a?i.context=ra(a):(a=hi(t)?mi:fi.current,i.context=di(e,a)),ca(e,n,i,r),i.state=e.memoizedState,"function"===typeof(a=t.getDerivedStateFromProps)&&(da(e,t,a,n),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&ha.enqueueReplaceState(i,i.state,null),ca(e,n,i,r),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.effectTag|=4)}var ba=Array.isArray;function wa(e,t,n){if(null!==(e=n.ref)&&"function"!==typeof e&&"object"!==typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(o(309));var r=n.stateNode}if(!r)throw Error(o(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===i?t.ref:((t=function(e){var t=r.refs;t===ma&&(t=r.refs={}),null===e?delete t[i]:t[i]=e})._stringRef=i,t)}if("string"!==typeof e)throw Error(o(284));if(!n._owner)throw Error(o(290,e))}return e}function Na(e,t){if("textarea"!==e.type)throw Error(o(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function Ea(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Tu(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.effectTag=2,n):r:(t.effectTag=2,n):n}function s(t){return e&&null===t.alternate&&(t.effectTag=2),t}function u(e,t,n,r){return null===t||6!==t.tag?((t=Cu(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function l(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=wa(e,t,n),r.return=e,r):((r=Au(n.type,n.key,n.props,null,e.mode,r)).ref=wa(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=_u(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function f(e,t,n,r,a){return null===t||7!==t.tag?((t=Ou(n,e.mode,r,a)).return=e,t):((t=i(t,n)).return=e,t)}function p(e,t,n){if("string"===typeof t||"number"===typeof t)return(t=Cu(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case ee:return(n=Au(t.type,t.key,t.props,null,e.mode,n)).ref=wa(e,null,t),n.return=e,n;case te:return(t=_u(t,e.mode,n)).return=e,t}if(ba(t)||he(t))return(t=Ou(t,e.mode,n,null)).return=e,t;Na(e,t)}return null}function m(e,t,n,r){var i=null!==t?t.key:null;if("string"===typeof n||"number"===typeof n)return null!==i?null:u(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case ee:return n.key===i?n.type===ne?f(e,t,n.props.children,r,i):l(e,t,n,r):null;case te:return n.key===i?c(e,t,n,r):null}if(ba(n)||he(n))return null!==i?null:f(e,t,n,r,null);Na(e,n)}return null}function d(e,t,n,r,i){if("string"===typeof r||"number"===typeof r)return u(t,e=e.get(n)||null,""+r,i);if("object"===typeof r&&null!==r){switch(r.$$typeof){case ee:return e=e.get(null===r.key?n:r.key)||null,r.type===ne?f(t,e,r.props.children,i,r.key):l(t,e,r,i);case te:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(ba(r)||he(r))return f(t,e=e.get(n)||null,r,i,null);Na(t,r)}return null}function h(i,o,s,u){for(var l=null,c=null,f=o,h=o=0,y=null;null!==f&&h<s.length;h++){f.index>h?(y=f,f=null):y=f.sibling;var g=m(i,f,s[h],u);if(null===g){null===f&&(f=y);break}e&&f&&null===g.alternate&&t(i,f),o=a(g,o,h),null===c?l=g:c.sibling=g,c=g,f=y}if(h===s.length)return n(i,f),l;if(null===f){for(;h<s.length;h++)null!==(f=p(i,s[h],u))&&(o=a(f,o,h),null===c?l=f:c.sibling=f,c=f);return l}for(f=r(i,f);h<s.length;h++)null!==(y=d(f,i,h,s[h],u))&&(e&&null!==y.alternate&&f.delete(null===y.key?h:y.key),o=a(y,o,h),null===c?l=y:c.sibling=y,c=y);return e&&f.forEach((function(e){return t(i,e)})),l}function y(i,s,u,l){var c=he(u);if("function"!==typeof c)throw Error(o(150));if(null==(u=c.call(u)))throw Error(o(151));for(var f=c=null,h=s,y=s=0,g=null,v=u.next();null!==h&&!v.done;y++,v=u.next()){h.index>y?(g=h,h=null):g=h.sibling;var x=m(i,h,v.value,l);if(null===x){null===h&&(h=g);break}e&&h&&null===x.alternate&&t(i,h),s=a(x,s,y),null===f?c=x:f.sibling=x,f=x,h=g}if(v.done)return n(i,h),c;if(null===h){for(;!v.done;y++,v=u.next())null!==(v=p(i,v.value,l))&&(s=a(v,s,y),null===f?c=v:f.sibling=v,f=v);return c}for(h=r(i,h);!v.done;y++,v=u.next())null!==(v=d(h,i,y,v.value,l))&&(e&&null!==v.alternate&&h.delete(null===v.key?y:v.key),s=a(v,s,y),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach((function(e){return t(i,e)})),c}return function(e,r,a,u){var l="object"===typeof a&&null!==a&&a.type===ne&&null===a.key;l&&(a=a.props.children);var c="object"===typeof a&&null!==a;if(c)switch(a.$$typeof){case ee:e:{for(c=a.key,l=r;null!==l;){if(l.key===c){switch(l.tag){case 7:if(a.type===ne){n(e,l.sibling),(r=i(l,a.props.children)).return=e,e=r;break e}break;default:if(l.elementType===a.type){n(e,l.sibling),(r=i(l,a.props)).ref=wa(e,l,a),r.return=e,e=r;break e}}n(e,l);break}t(e,l),l=l.sibling}a.type===ne?((r=Ou(a.props.children,e.mode,u,a.key)).return=e,e=r):((u=Au(a.type,a.key,a.props,null,e.mode,u)).ref=wa(e,r,a),u.return=e,e=u)}return s(e);case te:e:{for(l=a.key;null!==r;){if(r.key===l){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=i(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=_u(a,e.mode,u)).return=e,e=r}return s(e)}if("string"===typeof a||"number"===typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,a)).return=e,e=r):(n(e,r),(r=Cu(a,e.mode,u)).return=e,e=r),s(e);if(ba(a))return h(e,r,a,u);if(he(a))return y(e,r,a,u);if(c&&Na(e,a),"undefined"===typeof a&&!l)switch(e.tag){case 1:case 0:throw e=e.type,Error(o(152,e.displayName||e.name||"Component"))}return n(e,r)}}var Sa=Ea(!0),Ma=Ea(!1),Ta={},Aa={current:Ta},Oa={current:Ta},Ca={current:Ta};function _a(e){if(e===Ta)throw Error(o(174));return e}function ka(e,t){switch(li(Ca,t),li(Oa,e),li(Aa,Ta),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:qe(null,"");break;default:t=qe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}ui(Aa),li(Aa,t)}function za(){ui(Aa),ui(Oa),ui(Ca)}function Ia(e){_a(Ca.current);var t=_a(Aa.current),n=qe(t,e.type);t!==n&&(li(Oa,e),li(Aa,n))}function Da(e){Oa.current===e&&(ui(Aa),ui(Oa))}var Ba={current:0};function Pa(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function qa(e,t){return{responder:e,props:t}}var Ra=Q.ReactCurrentDispatcher,Ua=Q.ReactCurrentBatchConfig,Fa=0,ja=null,La=null,$a=null,Ha=!1;function Va(){throw Error(o(321))}function Wa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function Ga(e,t,n,r,i,a){if(Fa=a,ja=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,Ra.current=null===e||null===e.memoizedState?go:vo,e=n(r,i),t.expirationTime===Fa){a=0;do{if(t.expirationTime=0,!(25>a))throw Error(o(301));a+=1,$a=La=null,t.updateQueue=null,Ra.current=xo,e=n(r,i)}while(t.expirationTime===Fa)}if(Ra.current=yo,t=null!==La&&null!==La.next,Fa=0,$a=La=ja=null,Ha=!1,t)throw Error(o(300));return e}function Za(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===$a?ja.memoizedState=$a=e:$a=$a.next=e,$a}function Ya(){if(null===La){var e=ja.alternate;e=null!==e?e.memoizedState:null}else e=La.next;var t=null===$a?ja.memoizedState:$a.next;if(null!==t)$a=t,La=e;else{if(null===e)throw Error(o(310));e={memoizedState:(La=e).memoizedState,baseState:La.baseState,baseQueue:La.baseQueue,queue:La.queue,next:null},null===$a?ja.memoizedState=$a=e:$a=$a.next=e}return $a}function Qa(e,t){return"function"===typeof t?t(e):t}function Ja(e){var t=Ya(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=La,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var u=s=a=null,l=i;do{var c=l.expirationTime;if(c<Fa){var f={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===u?(s=u=f,a=r):u=u.next=f,c>ja.expirationTime&&(ja.expirationTime=c,ou(c))}else null!==u&&(u=u.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),au(c,l.suspenseConfig),r=l.eagerReducer===e?l.eagerState:e(r,l.action);l=l.next}while(null!==l&&l!==i);null===u?a=r:u.next=s,qr(r,t.memoizedState)||(_o=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=u,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Xa(e){var t=Ya(),n=t.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);qr(a,t.memoizedState)||(_o=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ka(e){var t=Za();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:e}).dispatch=ho.bind(null,ja,e),[t.memoizedState,e]}function eo(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ja.updateQueue)?(t={lastEffect:null},ja.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function to(){return Ya().memoizedState}function no(e,t,n,r){var i=Za();ja.effectTag|=e,i.memoizedState=eo(1|t,n,void 0,void 0===r?null:r)}function ro(e,t,n,r){var i=Ya();r=void 0===r?null:r;var a=void 0;if(null!==La){var o=La.memoizedState;if(a=o.destroy,null!==r&&Wa(r,o.deps))return void eo(t,n,a,r)}ja.effectTag|=e,i.memoizedState=eo(1|t,n,a,r)}function io(e,t){return no(516,4,e,t)}function ao(e,t){return ro(516,4,e,t)}function oo(e,t){return ro(4,2,e,t)}function so(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function uo(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,ro(4,2,so.bind(null,t,e),n)}function lo(){}function co(e,t){return Za().memoizedState=[e,void 0===t?null:t],e}function fo(e,t){var n=Ya();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Wa(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function po(e,t){var n=Ya();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&Wa(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function mo(e,t,n){var r=Fi();Li(98>r?98:r,(function(){e(!0)})),Li(97<r?97:r,(function(){var r=Ua.suspense;Ua.suspense=void 0===t?null:t;try{e(!1),n()}finally{Ua.suspense=r}}))}function ho(e,t,n){var r=Ws(),i=pa.suspense;i={expirationTime:r=Gs(r,e,i),suspenseConfig:i,action:n,eagerReducer:null,eagerState:null,next:null};var a=t.pending;if(null===a?i.next=i:(i.next=a.next,a.next=i),t.pending=i,a=e.alternate,e===ja||null!==a&&a===ja)Ha=!0,i.expirationTime=Fa,ja.expirationTime=Fa;else{if(0===e.expirationTime&&(null===a||0===a.expirationTime)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,n);if(i.eagerReducer=a,i.eagerState=s,qr(s,o))return}catch(u){}Zs(e,r)}}var yo={readContext:ra,useCallback:Va,useContext:Va,useEffect:Va,useImperativeHandle:Va,useLayoutEffect:Va,useMemo:Va,useReducer:Va,useRef:Va,useState:Va,useDebugValue:Va,useResponder:Va,useDeferredValue:Va,useTransition:Va},go={readContext:ra,useCallback:co,useContext:ra,useEffect:io,useImperativeHandle:function(e,t,n){return n=null!==n&&void 0!==n?n.concat([e]):null,no(4,2,so.bind(null,t,e),n)},useLayoutEffect:function(e,t){return no(4,2,e,t)},useMemo:function(e,t){var n=Za();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Za();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=ho.bind(null,ja,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Za().memoizedState=e},useState:Ka,useDebugValue:lo,useResponder:qa,useDeferredValue:function(e,t){var n=Ka(e),r=n[0],i=n[1];return io((function(){var n=Ua.suspense;Ua.suspense=void 0===t?null:t;try{i(e)}finally{Ua.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Ka(!1),n=t[0];return t=t[1],[co(mo.bind(null,t,e),[t,e]),n]}},vo={readContext:ra,useCallback:fo,useContext:ra,useEffect:ao,useImperativeHandle:uo,useLayoutEffect:oo,useMemo:po,useReducer:Ja,useRef:to,useState:function(){return Ja(Qa)},useDebugValue:lo,useResponder:qa,useDeferredValue:function(e,t){var n=Ja(Qa),r=n[0],i=n[1];return ao((function(){var n=Ua.suspense;Ua.suspense=void 0===t?null:t;try{i(e)}finally{Ua.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Ja(Qa),n=t[0];return t=t[1],[fo(mo.bind(null,t,e),[t,e]),n]}},xo={readContext:ra,useCallback:fo,useContext:ra,useEffect:ao,useImperativeHandle:uo,useLayoutEffect:oo,useMemo:po,useReducer:Xa,useRef:to,useState:function(){return Xa(Qa)},useDebugValue:lo,useResponder:qa,useDeferredValue:function(e,t){var n=Xa(Qa),r=n[0],i=n[1];return ao((function(){var n=Ua.suspense;Ua.suspense=void 0===t?null:t;try{i(e)}finally{Ua.suspense=n}}),[e,t]),r},useTransition:function(e){var t=Xa(Qa),n=t[0];return t=t[1],[fo(mo.bind(null,t,e),[t,e]),n]}},bo=null,wo=null,No=!1;function Eo(e,t){var n=Su(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function So(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Mo(e){if(No){var t=wo;if(t){var n=t;if(!So(e,t)){if(!(t=wn(n.nextSibling))||!So(e,t))return e.effectTag=-1025&e.effectTag|2,No=!1,void(bo=e);Eo(bo,n)}bo=e,wo=wn(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,No=!1,bo=e}}function To(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;bo=e}function Ao(e){if(e!==bo)return!1;if(!No)return To(e),No=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!vn(t,e.memoizedProps))for(t=wo;t;)Eo(e,t),t=wn(t.nextSibling);if(To(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){wo=wn(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}wo=null}}else wo=bo?wn(e.stateNode.nextSibling):null;return!0}function Oo(){wo=bo=null,No=!1}var Co=Q.ReactCurrentOwner,_o=!1;function ko(e,t,n,r){t.child=null===e?Ma(t,null,n,r):Sa(t,e.child,n,r)}function zo(e,t,n,r,i){n=n.render;var a=t.ref;return na(t,i),r=Ga(e,t,n,r,a,i),null===e||_o?(t.effectTag|=1,ko(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Zo(e,t,i))}function Io(e,t,n,r,i,a){if(null===e){var o=n.type;return"function"!==typeof o||Mu(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Au(n.type,null,r,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Do(e,t,o,r,i,a))}return o=e.child,i<a&&(i=o.memoizedProps,(n=null!==(n=n.compare)?n:Ur)(i,r)&&e.ref===t.ref)?Zo(e,t,a):(t.effectTag|=1,(e=Tu(o,r)).ref=t.ref,e.return=t,t.child=e)}function Do(e,t,n,r,i,a){return null!==e&&Ur(e.memoizedProps,r)&&e.ref===t.ref&&(_o=!1,i<a)?(t.expirationTime=e.expirationTime,Zo(e,t,a)):Po(e,t,n,r,a)}function Bo(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Po(e,t,n,r,i){var a=hi(n)?mi:fi.current;return a=di(t,a),na(t,i),n=Ga(e,t,n,r,a,i),null===e||_o?(t.effectTag|=1,ko(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=i&&(e.expirationTime=0),Zo(e,t,i))}function qo(e,t,n,r,i){if(hi(n)){var a=!0;xi(t)}else a=!1;if(na(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),ga(t,n,r),xa(t,n,r,i),r=!0;else if(null===e){var o=t.stateNode,s=t.memoizedProps;o.props=s;var u=o.context,l=n.contextType;"object"===typeof l&&null!==l?l=ra(l):l=di(t,l=hi(n)?mi:fi.current);var c=n.getDerivedStateFromProps,f="function"===typeof c||"function"===typeof o.getSnapshotBeforeUpdate;f||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||u!==l)&&va(t,o,r,l),ia=!1;var p=t.memoizedState;o.state=p,ca(t,r,o,i),u=t.memoizedState,s!==r||p!==u||pi.current||ia?("function"===typeof c&&(da(t,n,c,r),u=t.memoizedState),(s=ia||ya(t,n,s,r,p,u,l))?(f||"function"!==typeof o.UNSAFE_componentWillMount&&"function"!==typeof o.componentWillMount||("function"===typeof o.componentWillMount&&o.componentWillMount(),"function"===typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"===typeof o.componentDidMount&&(t.effectTag|=4)):("function"===typeof o.componentDidMount&&(t.effectTag|=4),t.memoizedProps=r,t.memoizedState=u),o.props=r,o.state=u,o.context=l,r=s):("function"===typeof o.componentDidMount&&(t.effectTag|=4),r=!1)}else o=t.stateNode,oa(e,t),s=t.memoizedProps,o.props=t.type===t.elementType?s:Zi(t.type,s),u=o.context,"object"===typeof(l=n.contextType)&&null!==l?l=ra(l):l=di(t,l=hi(n)?mi:fi.current),(f="function"===typeof(c=n.getDerivedStateFromProps)||"function"===typeof o.getSnapshotBeforeUpdate)||"function"!==typeof o.UNSAFE_componentWillReceiveProps&&"function"!==typeof o.componentWillReceiveProps||(s!==r||u!==l)&&va(t,o,r,l),ia=!1,u=t.memoizedState,o.state=u,ca(t,r,o,i),p=t.memoizedState,s!==r||u!==p||pi.current||ia?("function"===typeof c&&(da(t,n,c,r),p=t.memoizedState),(c=ia||ya(t,n,s,r,u,p,l))?(f||"function"!==typeof o.UNSAFE_componentWillUpdate&&"function"!==typeof o.componentWillUpdate||("function"===typeof o.componentWillUpdate&&o.componentWillUpdate(r,p,l),"function"===typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(r,p,l)),"function"===typeof o.componentDidUpdate&&(t.effectTag|=4),"function"===typeof o.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=l,r=c):("function"!==typeof o.componentDidUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=4),"function"!==typeof o.getSnapshotBeforeUpdate||s===e.memoizedProps&&u===e.memoizedState||(t.effectTag|=256),r=!1);return Ro(e,t,n,r,a,i)}function Ro(e,t,n,r,i,a){Bo(e,t);var o=0!==(64&t.effectTag);if(!r&&!o)return i&&bi(t,n,!1),Zo(e,t,a);r=t.stateNode,Co.current=t;var s=o&&"function"!==typeof n.getDerivedStateFromError?null:r.render();return t.effectTag|=1,null!==e&&o?(t.child=Sa(t,e.child,null,a),t.child=Sa(t,null,s,a)):ko(e,t,s,a),t.memoizedState=r.state,i&&bi(t,n,!0),t.child}function Uo(e){var t=e.stateNode;t.pendingContext?gi(0,t.pendingContext,t.pendingContext!==t.context):t.context&&gi(0,t.context,!1),ka(e,t.containerInfo)}var Fo,jo,Lo,$o={dehydrated:null,retryTime:0};function Ho(e,t,n){var r,i=t.mode,a=t.pendingProps,o=Ba.current,s=!1;if((r=0!==(64&t.effectTag))||(r=0!==(2&o)&&(null===e||null!==e.memoizedState)),r?(s=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===a.fallback||!0===a.unstable_avoidThisFallback||(o|=1),li(Ba,1&o),null===e){if(void 0!==a.fallback&&Mo(t),s){if(s=a.fallback,(a=Ou(null,i,0,null)).return=t,0===(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(n=Ou(s,i,n,null)).return=t,a.sibling=n,t.memoizedState=$o,t.child=a,n}return i=a.children,t.memoizedState=null,t.child=Ma(t,null,i,n)}if(null!==e.memoizedState){if(i=(e=e.child).sibling,s){if(a=a.fallback,(n=Tu(e,e.pendingProps)).return=t,0===(2&t.mode)&&(s=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=s;null!==s;)s.return=n,s=s.sibling;return(i=Tu(i,a)).return=t,n.sibling=i,n.childExpirationTime=0,t.memoizedState=$o,t.child=n,i}return n=Sa(t,e.child,a.children,n),t.memoizedState=null,t.child=n}if(e=e.child,s){if(s=a.fallback,(a=Ou(null,i,0,null)).return=t,a.child=e,null!==e&&(e.return=a),0===(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,a.child=e;null!==e;)e.return=a,e=e.sibling;return(n=Ou(s,i,n,null)).return=t,a.sibling=n,n.effectTag|=2,a.childExpirationTime=0,t.memoizedState=$o,t.child=a,n}return t.memoizedState=null,t.child=Sa(t,e,a.children,n)}function Vo(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),ta(e.return,t)}function Wo(e,t,n,r,i,a){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailExpiration:0,tailMode:i,lastEffect:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailExpiration=0,o.tailMode=i,o.lastEffect=a)}function Go(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(ko(e,t,r.children,n),0!==(2&(r=Ba.current)))r=1&r|2,t.effectTag|=64;else{if(null!==e&&0!==(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Vo(e,n);else if(19===e.tag)Vo(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(li(Ba,r),0===(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Pa(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Wo(t,!1,i,n,a,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Pa(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Wo(t,!0,n,null,a,t.lastEffect);break;case"together":Wo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Zo(e,t,n){null!==e&&(t.dependencies=e.dependencies);var r=t.expirationTime;if(0!==r&&ou(r),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(n=Tu(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Tu(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Yo(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Qo(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return hi(t.type)&&yi(),null;case 3:return za(),ui(pi),ui(fi),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!Ao(t)||(t.effectTag|=4),null;case 5:Da(t),n=_a(Ca.current);var a=t.type;if(null!==e&&null!=t.stateNode)jo(e,t,a,r,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!r){if(null===t.stateNode)throw Error(o(166));return null}if(e=_a(Aa.current),Ao(t)){r=t.stateNode,a=t.type;var s=t.memoizedProps;switch(r[Sn]=t,r[Mn]=s,a){case"iframe":case"object":case"embed":Gt("load",r);break;case"video":case"audio":for(e=0;e<Qe.length;e++)Gt(Qe[e],r);break;case"source":Gt("error",r);break;case"img":case"image":case"link":Gt("error",r),Gt("load",r);break;case"form":Gt("reset",r),Gt("submit",r);break;case"details":Gt("toggle",r);break;case"input":Ee(r,s),Gt("invalid",r),un(n,"onChange");break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Gt("invalid",r),un(n,"onChange");break;case"textarea":ke(r,s),Gt("invalid",r),un(n,"onChange")}for(var u in an(a,s),e=null,s)if(s.hasOwnProperty(u)){var l=s[u];"children"===u?"string"===typeof l?r.textContent!==l&&(e=["children",l]):"number"===typeof l&&r.textContent!==""+l&&(e=["children",""+l]):S.hasOwnProperty(u)&&null!=l&&un(n,u)}switch(a){case"input":be(r),Te(r,s,!0);break;case"textarea":be(r),Ie(r);break;case"select":case"option":break;default:"function"===typeof s.onClick&&(r.onclick=ln)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(u=9===n.nodeType?n:n.ownerDocument,e===sn&&(e=Pe(a)),e===sn?"script"===a?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=u.createElement(a,{is:r.is}):(e=u.createElement(a),"select"===a&&(u=e,r.multiple?u.multiple=!0:r.size&&(u.size=r.size))):e=u.createElementNS(e,a),e[Sn]=t,e[Mn]=r,Fo(e,t),t.stateNode=e,u=on(a,r),a){case"iframe":case"object":case"embed":Gt("load",e),l=r;break;case"video":case"audio":for(l=0;l<Qe.length;l++)Gt(Qe[l],e);l=r;break;case"source":Gt("error",e),l=r;break;case"img":case"image":case"link":Gt("error",e),Gt("load",e),l=r;break;case"form":Gt("reset",e),Gt("submit",e),l=r;break;case"details":Gt("toggle",e),l=r;break;case"input":Ee(e,r),l=Ne(e,r),Gt("invalid",e),un(n,"onChange");break;case"option":l=Oe(e,r);break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=i({},r,{value:void 0}),Gt("invalid",e),un(n,"onChange");break;case"textarea":ke(e,r),l=_e(e,r),Gt("invalid",e),un(n,"onChange");break;default:l=r}an(a,l);var c=l;for(s in c)if(c.hasOwnProperty(s)){var f=c[s];"style"===s?nn(e,f):"dangerouslySetInnerHTML"===s?null!=(f=f?f.__html:void 0)&&Ue(e,f):"children"===s?"string"===typeof f?("textarea"!==a||""!==f)&&Fe(e,f):"number"===typeof f&&Fe(e,""+f):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(S.hasOwnProperty(s)?null!=f&&un(n,s):null!=f&&J(e,s,f,u))}switch(a){case"input":be(e),Te(e,r,!1);break;case"textarea":be(e),Ie(e);break;case"option":null!=r.value&&e.setAttribute("value",""+ve(r.value));break;case"select":e.multiple=!!r.multiple,null!=(n=r.value)?Ce(e,!!r.multiple,n,!1):null!=r.defaultValue&&Ce(e,!!r.multiple,r.defaultValue,!0);break;default:"function"===typeof l.onClick&&(e.onclick=ln)}gn(a,r)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Lo(0,t,e.memoizedProps,r);else{if("string"!==typeof r&&null===t.stateNode)throw Error(o(166));n=_a(Ca.current),_a(Aa.current),Ao(t)?(n=t.stateNode,r=t.memoizedProps,n[Sn]=t,n.nodeValue!==r&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(r))[Sn]=t,t.stateNode=n)}return null;case 13:return ui(Ba),r=t.memoizedState,0!==(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==r,r=!1,null===e?void 0!==t.memoizedProps.fallback&&Ao(t):(r=null!==(a=e.memoizedState),n||null===a||null!==(a=e.child.sibling)&&(null!==(s=t.firstEffect)?(t.firstEffect=a,a.nextEffect=s):(t.firstEffect=t.lastEffect=a,a.nextEffect=null),a.effectTag=8)),n&&!r&&0!==(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!==(1&Ba.current)?As===bs&&(As=ws):(As!==bs&&As!==ws||(As=Ns),0!==zs&&null!==Ss&&(Iu(Ss,Ts),Du(Ss,zs)))),(n||r)&&(t.effectTag|=4),null);case 4:return za(),null;case 10:return ea(t),null;case 17:return hi(t.type)&&yi(),null;case 19:if(ui(Ba),null===(r=t.memoizedState))return null;if(a=0!==(64&t.effectTag),null===(s=r.rendering)){if(a)Yo(r,!1);else if(As!==bs||null!==e&&0!==(64&e.effectTag))for(s=t.child;null!==s;){if(null!==(e=Pa(s))){for(t.effectTag|=64,Yo(r,!1),null!==(a=e.updateQueue)&&(t.updateQueue=a,t.effectTag|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,r=t.child;null!==r;)s=n,(a=r).effectTag&=2,a.nextEffect=null,a.firstEffect=null,a.lastEffect=null,null===(e=a.alternate)?(a.childExpirationTime=0,a.expirationTime=s,a.child=null,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null):(a.childExpirationTime=e.childExpirationTime,a.expirationTime=e.expirationTime,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,s=e.dependencies,a.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),r=r.sibling;return li(Ba,1&Ba.current|2),t.child}s=s.sibling}}else{if(!a)if(null!==(e=Pa(s))){if(t.effectTag|=64,a=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Yo(r,!0),null===r.tail&&"hidden"===r.tailMode&&!s.alternate)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Ui()-r.renderingStartTime>r.tailExpiration&&1<n&&(t.effectTag|=64,a=!0,Yo(r,!1),t.expirationTime=t.childExpirationTime=n-1);r.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=r.last)?n.sibling=s:t.child=s,r.last=s)}return null!==r.tail?(0===r.tailExpiration&&(r.tailExpiration=Ui()+500),n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Ui(),n.sibling=null,t=Ba.current,li(Ba,a?1&t|2:1&t),n):null}throw Error(o(156,t.tag))}function Jo(e){switch(e.tag){case 1:hi(e.type)&&yi();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(za(),ui(pi),ui(fi),0!==(64&(t=e.effectTag)))throw Error(o(285));return e.effectTag=-4097&t|64,e;case 5:return Da(e),null;case 13:return ui(Ba),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return ui(Ba),null;case 4:return za(),null;case 10:return ea(e),null;default:return null}}function Xo(e,t){return{value:e,source:t,stack:ge(t)}}Fo=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},jo=function(e,t,n,r,a){var o=e.memoizedProps;if(o!==r){var s,u,l=t.stateNode;switch(_a(Aa.current),e=null,n){case"input":o=Ne(l,o),r=Ne(l,r),e=[];break;case"option":o=Oe(l,o),r=Oe(l,r),e=[];break;case"select":o=i({},o,{value:void 0}),r=i({},r,{value:void 0}),e=[];break;case"textarea":o=_e(l,o),r=_e(l,r),e=[];break;default:"function"!==typeof o.onClick&&"function"===typeof r.onClick&&(l.onclick=ln)}for(s in an(n,r),n=null,o)if(!r.hasOwnProperty(s)&&o.hasOwnProperty(s)&&null!=o[s])if("style"===s)for(u in l=o[s])l.hasOwnProperty(u)&&(n||(n={}),n[u]="");else"dangerouslySetInnerHTML"!==s&&"children"!==s&&"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(S.hasOwnProperty(s)?e||(e=[]):(e=e||[]).push(s,null));for(s in r){var c=r[s];if(l=null!=o?o[s]:void 0,r.hasOwnProperty(s)&&c!==l&&(null!=c||null!=l))if("style"===s)if(l){for(u in l)!l.hasOwnProperty(u)||c&&c.hasOwnProperty(u)||(n||(n={}),n[u]="");for(u in c)c.hasOwnProperty(u)&&l[u]!==c[u]&&(n||(n={}),n[u]=c[u])}else n||(e||(e=[]),e.push(s,n)),n=c;else"dangerouslySetInnerHTML"===s?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(e=e||[]).push(s,c)):"children"===s?l===c||"string"!==typeof c&&"number"!==typeof c||(e=e||[]).push(s,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&(S.hasOwnProperty(s)?(null!=c&&un(a,s),e||l===c||(e=[])):(e=e||[]).push(s,c))}n&&(e=e||[]).push("style",n),a=e,(t.updateQueue=a)&&(t.effectTag|=4)}},Lo=function(e,t,n,r){n!==r&&(t.effectTag|=4)};var Ko="function"===typeof WeakSet?WeakSet:Set;function es(e,t){var n=t.source,r=t.stack;null===r&&null!==n&&(r=ge(n)),null!==n&&ye(n.type),t=t.value,null!==e&&1===e.tag&&ye(e.type);try{console.error(t)}catch(i){setTimeout((function(){throw i}))}}function ts(e){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(n){vu(e,n)}else t.current=null}function ns(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Zi(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(o(163))}function rs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function is(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function as(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void is(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var r=n.elementType===n.type?t.memoizedProps:Zi(n.type,t.memoizedProps);e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&fa(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}fa(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&gn(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Pt(n)))));case 19:case 17:case 20:case 21:return}throw Error(o(163))}function os(e,t,n){switch("function"===typeof Nu&&Nu(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var r=e.next;Li(97<n?97:n,(function(){var e=r;do{var n=e.destroy;if(void 0!==n){var i=t;try{n()}catch(a){vu(i,a)}}e=e.next}while(e!==r)}))}break;case 1:ts(t),"function"===typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){vu(e,n)}}(t,n);break;case 5:ts(t);break;case 4:cs(e,t,n)}}function ss(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&ss(t)}function us(e){return 5===e.tag||3===e.tag||4===e.tag}function ls(e){e:{for(var t=e.return;null!==t;){if(us(t)){var n=t;break e}t=t.return}throw Error(o(160))}switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(o(161))}16&n.effectTag&&(Fe(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||us(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}r?function e(t,n,r){var i=t.tag,a=5===i||6===i;if(a)t=a?t.stateNode:t.stateNode.instance,n?8===r.nodeType?r.parentNode.insertBefore(t,n):r.insertBefore(t,n):(8===r.nodeType?(n=r.parentNode).insertBefore(t,r):(n=r).appendChild(t),null!==(r=r._reactRootContainer)&&void 0!==r||null!==n.onclick||(n.onclick=ln));else if(4!==i&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t):function e(t,n,r){var i=t.tag,a=5===i||6===i;if(a)t=a?t.stateNode:t.stateNode.instance,n?r.insertBefore(t,n):r.appendChild(t);else if(4!==i&&null!==(t=t.child))for(e(t,n,r),t=t.sibling;null!==t;)e(t,n,r),t=t.sibling}(e,n,t)}function cs(e,t,n){for(var r,i,a=t,s=!1;;){if(!s){s=a.return;e:for(;;){if(null===s)throw Error(o(160));switch(r=s.stateNode,s.tag){case 5:i=!1;break e;case 3:case 4:r=r.containerInfo,i=!0;break e}s=s.return}s=!0}if(5===a.tag||6===a.tag){e:for(var u=e,l=a,c=n,f=l;;)if(os(u,f,c),null!==f.child&&4!==f.tag)f.child.return=f,f=f.child;else{if(f===l)break e;for(;null===f.sibling;){if(null===f.return||f.return===l)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}i?(u=r,l=a.stateNode,8===u.nodeType?u.parentNode.removeChild(l):u.removeChild(l)):r.removeChild(a.stateNode)}else if(4===a.tag){if(null!==a.child){r=a.stateNode.containerInfo,i=!0,a.child.return=a,a=a.child;continue}}else if(os(e,a,n),null!==a.child){a.child.return=a,a=a.child;continue}if(a===t)break;for(;null===a.sibling;){if(null===a.return||a.return===t)return;4===(a=a.return).tag&&(s=!1)}a.sibling.return=a.return,a=a.sibling}}function fs(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void rs(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps,i=null!==e?e.memoizedProps:r;e=t.type;var a=t.updateQueue;if(t.updateQueue=null,null!==a){for(n[Mn]=r,"input"===e&&"radio"===r.type&&null!=r.name&&Se(n,r),on(e,i),t=on(e,r),i=0;i<a.length;i+=2){var s=a[i],u=a[i+1];"style"===s?nn(n,u):"dangerouslySetInnerHTML"===s?Ue(n,u):"children"===s?Fe(n,u):J(n,s,u,t)}switch(e){case"input":Me(n,r);break;case"textarea":ze(n,r);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,null!=(e=r.value)?Ce(n,!!r.multiple,e,!1):t!==!!r.multiple&&(null!=r.defaultValue?Ce(n,!!r.multiple,r.defaultValue,!0):Ce(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(o(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Pt(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?r=!1:(r=!0,n=t.child,Ds=Ui()),null!==n)e:for(e=n;;){if(5===e.tag)a=e.stateNode,r?"function"===typeof(a=a.style).setProperty?a.setProperty("display","none","important"):a.display="none":(a=e.stateNode,i=void 0!==(i=e.memoizedProps.style)&&null!==i&&i.hasOwnProperty("display")?i.display:null,a.style.display=tn("display",i));else if(6===e.tag)e.stateNode.nodeValue=r?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(a=e.child.sibling).return=e,e=a;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void ps(t);case 19:return void ps(t);case 17:return}throw Error(o(163))}function ps(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ko),t.forEach((function(t){var r=bu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}var ms="function"===typeof WeakMap?WeakMap:Map;function ds(e,t,n){(n=sa(n,null)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ps||(Ps=!0,qs=r),es(e,t)},n}function hs(e,t,n){(n=sa(n,null)).tag=3;var r=e.type.getDerivedStateFromError;if("function"===typeof r){var i=t.value;n.payload=function(){return es(e,t),r(i)}}var a=e.stateNode;return null!==a&&"function"===typeof a.componentDidCatch&&(n.callback=function(){"function"!==typeof r&&(null===Rs?Rs=new Set([this]):Rs.add(this),es(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var ys,gs=Math.ceil,vs=Q.ReactCurrentDispatcher,xs=Q.ReactCurrentOwner,bs=0,ws=3,Ns=4,Es=0,Ss=null,Ms=null,Ts=0,As=bs,Os=null,Cs=1073741823,_s=1073741823,ks=null,zs=0,Is=!1,Ds=0,Bs=null,Ps=!1,qs=null,Rs=null,Us=!1,Fs=null,js=90,Ls=null,$s=0,Hs=null,Vs=0;function Ws(){return 0!==(48&Es)?1073741821-(Ui()/10|0):0!==Vs?Vs:Vs=1073741821-(Ui()/10|0)}function Gs(e,t,n){if(0===(2&(t=t.mode)))return 1073741823;var r=Fi();if(0===(4&t))return 99===r?1073741823:1073741822;if(0!==(16&Es))return Ts;if(null!==n)e=Gi(e,0|n.timeoutMs||5e3,250);else switch(r){case 99:e=1073741823;break;case 98:e=Gi(e,150,100);break;case 97:case 96:e=Gi(e,5e3,250);break;case 95:e=2;break;default:throw Error(o(326))}return null!==Ss&&e===Ts&&--e,e}function Zs(e,t){if(50<$s)throw $s=0,Hs=null,Error(o(185));if(null!==(e=Ys(e,t))){var n=Fi();1073741823===t?0!==(8&Es)&&0===(48&Es)?Ks(e):(Js(e),0===Es&&Vi()):Js(e),0===(4&Es)||98!==n&&99!==n||(null===Ls?Ls=new Map([[e,t]]):(void 0===(n=Ls.get(e))||n>t)&&Ls.set(e,t))}}function Ys(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var r=e.return,i=null;if(null===r&&3===e.tag)i=e.stateNode;else for(;null!==r;){if(n=r.alternate,r.childExpirationTime<t&&(r.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===r.return&&3===r.tag){i=r.stateNode;break}r=r.return}return null!==i&&(Ss===i&&(ou(t),As===Ns&&Iu(i,Ts)),Du(i,t)),i}function Qs(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!zu(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Js(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Hi(Ks.bind(null,e));else{var t=Qs(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Ws();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var i=e.callbackPriority;if(e.callbackExpirationTime===t&&i>=r)return;n!==zi&&Ei(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?Hi(Ks.bind(null,e)):$i(r,Xs.bind(null,e),{timeout:10*(1073741821-t)-Ui()}),e.callbackNode=t}}}function Xs(e,t){if(Vs=0,t)return Bu(e,t=Ws()),Js(e),null;var n=Qs(e);if(0!==n){if(t=e.callbackNode,0!==(48&Es))throw Error(o(327));if(hu(),e===Ss&&n===Ts||nu(e,n),null!==Ms){var r=Es;Es|=16;for(var i=iu();;)try{uu();break}catch(u){ru(e,u)}if(Ki(),Es=r,vs.current=i,1===As)throw t=Os,nu(e,n),Iu(e,n),Js(e),t;if(null===Ms)switch(i=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,r=As,Ss=null,r){case bs:case 1:throw Error(o(345));case 2:Bu(e,2<n?2:n);break;case ws:if(Iu(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(i)),1073741823===Cs&&10<(i=Ds+500-Ui())){if(Is){var a=e.lastPingedTime;if(0===a||a>=n){e.lastPingedTime=n,nu(e,n);break}}if(0!==(a=Qs(e))&&a!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=xn(pu.bind(null,e),i);break}pu(e);break;case Ns:if(Iu(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=fu(i)),Is&&(0===(i=e.lastPingedTime)||i>=n)){e.lastPingedTime=n,nu(e,n);break}if(0!==(i=Qs(e))&&i!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==_s?r=10*(1073741821-_s)-Ui():1073741823===Cs?r=0:(r=10*(1073741821-Cs)-5e3,0>(r=(i=Ui())-r)&&(r=0),(n=10*(1073741821-n)-i)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gs(r/1960))-r)&&(r=n)),10<r){e.timeoutHandle=xn(pu.bind(null,e),r);break}pu(e);break;case 5:if(1073741823!==Cs&&null!==ks){a=Cs;var s=ks;if(0>=(r=0|s.busyMinDurationMs)?r=0:(i=0|s.busyDelayMs,r=(a=Ui()-(10*(1073741821-a)-(0|s.timeoutMs||5e3)))<=i?0:i+r-a),10<r){Iu(e,n),e.timeoutHandle=xn(pu.bind(null,e),r);break}}pu(e);break;default:throw Error(o(329))}if(Js(e),e.callbackNode===t)return Xs.bind(null,e)}}return null}function Ks(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!==(48&Es))throw Error(o(327));if(hu(),e===Ss&&t===Ts||nu(e,t),null!==Ms){var n=Es;Es|=16;for(var r=iu();;)try{su();break}catch(i){ru(e,i)}if(Ki(),Es=n,vs.current=r,1===As)throw n=Os,nu(e,t),Iu(e,t),Js(e),n;if(null!==Ms)throw Error(o(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Ss=null,pu(e),Js(e)}return null}function eu(e,t){var n=Es;Es|=1;try{return e(t)}finally{0===(Es=n)&&Vi()}}function tu(e,t){var n=Es;Es&=-2,Es|=8;try{return e(t)}finally{0===(Es=n)&&Vi()}}function nu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,bn(n)),null!==Ms)for(n=Ms.return;null!==n;){var r=n;switch(r.tag){case 1:null!==(r=r.type.childContextTypes)&&void 0!==r&&yi();break;case 3:za(),ui(pi),ui(fi);break;case 5:Da(r);break;case 4:za();break;case 13:case 19:ui(Ba);break;case 10:ea(r)}n=n.return}Ss=e,Ms=Tu(e.current,null),Ts=t,As=bs,Os=null,_s=Cs=1073741823,ks=null,zs=0,Is=!1}function ru(e,t){for(;;){try{if(Ki(),Ra.current=yo,Ha)for(var n=ja.memoizedState;null!==n;){var r=n.queue;null!==r&&(r.pending=null),n=n.next}if(Fa=0,$a=La=ja=null,Ha=!1,null===Ms||null===Ms.return)return As=1,Os=t,Ms=null;e:{var i=e,a=Ms.return,o=Ms,s=t;if(t=Ts,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,null!==s&&"object"===typeof s&&"function"===typeof s.then){var u=s;if(0===(2&o.mode)){var l=o.alternate;l?(o.updateQueue=l.updateQueue,o.memoizedState=l.memoizedState,o.expirationTime=l.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var c=0!==(1&Ba.current),f=a;do{var p;if(p=13===f.tag){var m=f.memoizedState;if(null!==m)p=null!==m.dehydrated;else{var d=f.memoizedProps;p=void 0!==d.fallback&&(!0!==d.unstable_avoidThisFallback||!c)}}if(p){var h=f.updateQueue;if(null===h){var y=new Set;y.add(u),f.updateQueue=y}else h.add(u);if(0===(2&f.mode)){if(f.effectTag|=64,o.effectTag&=-2981,1===o.tag)if(null===o.alternate)o.tag=17;else{var g=sa(1073741823,null);g.tag=2,ua(o,g)}o.expirationTime=1073741823;break e}s=void 0,o=t;var v=i.pingCache;if(null===v?(v=i.pingCache=new ms,s=new Set,v.set(u,s)):void 0===(s=v.get(u))&&(s=new Set,v.set(u,s)),!s.has(o)){s.add(o);var x=xu.bind(null,i,u,o);u.then(x,x)}f.effectTag|=4096,f.expirationTime=t;break e}f=f.return}while(null!==f);s=Error((ye(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ge(o))}5!==As&&(As=2),s=Xo(s,o),f=a;do{switch(f.tag){case 3:u=s,f.effectTag|=4096,f.expirationTime=t,la(f,ds(f,u,t));break e;case 1:u=s;var b=f.type,w=f.stateNode;if(0===(64&f.effectTag)&&("function"===typeof b.getDerivedStateFromError||null!==w&&"function"===typeof w.componentDidCatch&&(null===Rs||!Rs.has(w)))){f.effectTag|=4096,f.expirationTime=t,la(f,hs(f,u,t));break e}}f=f.return}while(null!==f)}Ms=cu(Ms)}catch(N){t=N;continue}break}}function iu(){var e=vs.current;return vs.current=yo,null===e?yo:e}function au(e,t){e<Cs&&2<e&&(Cs=e),null!==t&&e<_s&&2<e&&(_s=e,ks=t)}function ou(e){e>zs&&(zs=e)}function su(){for(;null!==Ms;)Ms=lu(Ms)}function uu(){for(;null!==Ms&&!Ii();)Ms=lu(Ms)}function lu(e){var t=ys(e.alternate,e,Ts);return e.memoizedProps=e.pendingProps,null===t&&(t=cu(e)),xs.current=null,t}function cu(e){Ms=e;do{var t=Ms.alternate;if(e=Ms.return,0===(2048&Ms.effectTag)){if(t=Qo(t,Ms,Ts),1===Ts||1!==Ms.childExpirationTime){for(var n=0,r=Ms.child;null!==r;){var i=r.expirationTime,a=r.childExpirationTime;i>n&&(n=i),a>n&&(n=a),r=r.sibling}Ms.childExpirationTime=n}if(null!==t)return t;null!==e&&0===(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=Ms.firstEffect),null!==Ms.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Ms.firstEffect),e.lastEffect=Ms.lastEffect),1<Ms.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=Ms:e.firstEffect=Ms,e.lastEffect=Ms))}else{if(null!==(t=Jo(Ms)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=Ms.sibling))return t;Ms=e}while(null!==Ms);return As===bs&&(As=5),null}function fu(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function pu(e){var t=Fi();return Li(99,mu.bind(null,e,t)),null}function mu(e,t){do{hu()}while(null!==Fs);if(0!==(48&Es))throw Error(o(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(o(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var i=fu(n);if(e.firstPendingTime=i,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Ss&&(Ms=Ss=null,Ts=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,i=n.firstEffect):i=n:i=n.firstEffect,null!==i){var a=Es;Es|=32,xs.current=null,hn=Wt;var s=mn();if(dn(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{var l=(u=(u=s.ownerDocument)&&u.defaultView||window).getSelection&&u.getSelection();if(l&&0!==l.rangeCount){u=l.anchorNode;var c=l.anchorOffset,f=l.focusNode;l=l.focusOffset;try{u.nodeType,f.nodeType}catch(T){u=null;break e}var p=0,m=-1,d=-1,h=0,y=0,g=s,v=null;t:for(;;){for(var x;g!==u||0!==c&&3!==g.nodeType||(m=p+c),g!==f||0!==l&&3!==g.nodeType||(d=p+l),3===g.nodeType&&(p+=g.nodeValue.length),null!==(x=g.firstChild);)v=g,g=x;for(;;){if(g===s)break t;if(v===u&&++h===c&&(m=p),v===f&&++y===l&&(d=p),null!==(x=g.nextSibling))break;v=(g=v).parentNode}g=x}u=-1===m||-1===d?null:{start:m,end:d}}else u=null}u=u||{start:0,end:0}}else u=null;yn={activeElementDetached:null,focusedElem:s,selectionRange:u},Wt=!1,Bs=i;do{try{du()}catch(T){if(null===Bs)throw Error(o(330));vu(Bs,T),Bs=Bs.nextEffect}}while(null!==Bs);Bs=i;do{try{for(s=e,u=t;null!==Bs;){var b=Bs.effectTag;if(16&b&&Fe(Bs.stateNode,""),128&b){var w=Bs.alternate;if(null!==w){var N=w.ref;null!==N&&("function"===typeof N?N(null):N.current=null)}}switch(1038&b){case 2:ls(Bs),Bs.effectTag&=-3;break;case 6:ls(Bs),Bs.effectTag&=-3,fs(Bs.alternate,Bs);break;case 1024:Bs.effectTag&=-1025;break;case 1028:Bs.effectTag&=-1025,fs(Bs.alternate,Bs);break;case 4:fs(Bs.alternate,Bs);break;case 8:cs(s,c=Bs,u),ss(c)}Bs=Bs.nextEffect}}catch(T){if(null===Bs)throw Error(o(330));vu(Bs,T),Bs=Bs.nextEffect}}while(null!==Bs);if(N=yn,w=mn(),b=N.focusedElem,u=N.selectionRange,w!==b&&b&&b.ownerDocument&&function e(t,n){return!(!t||!n)&&(t===n||(!t||3!==t.nodeType)&&(n&&3===n.nodeType?e(t,n.parentNode):"contains"in t?t.contains(n):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(n))))}(b.ownerDocument.documentElement,b)){null!==u&&dn(b)&&(w=u.start,void 0===(N=u.end)&&(N=w),"selectionStart"in b?(b.selectionStart=w,b.selectionEnd=Math.min(N,b.value.length)):(N=(w=b.ownerDocument||document)&&w.defaultView||window).getSelection&&(N=N.getSelection(),c=b.textContent.length,s=Math.min(u.start,c),u=void 0===u.end?s:Math.min(u.end,c),!N.extend&&s>u&&(c=u,u=s,s=c),c=pn(b,s),f=pn(b,u),c&&f&&(1!==N.rangeCount||N.anchorNode!==c.node||N.anchorOffset!==c.offset||N.focusNode!==f.node||N.focusOffset!==f.offset)&&((w=w.createRange()).setStart(c.node,c.offset),N.removeAllRanges(),s>u?(N.addRange(w),N.extend(f.node,f.offset)):(w.setEnd(f.node,f.offset),N.addRange(w))))),w=[];for(N=b;N=N.parentNode;)1===N.nodeType&&w.push({element:N,left:N.scrollLeft,top:N.scrollTop});for("function"===typeof b.focus&&b.focus(),b=0;b<w.length;b++)(N=w[b]).element.scrollLeft=N.left,N.element.scrollTop=N.top}Wt=!!hn,yn=hn=null,e.current=n,Bs=i;do{try{for(b=e;null!==Bs;){var E=Bs.effectTag;if(36&E&&as(b,Bs.alternate,Bs),128&E){w=void 0;var S=Bs.ref;if(null!==S){var M=Bs.stateNode;switch(Bs.tag){case 5:w=M;break;default:w=M}"function"===typeof S?S(w):S.current=w}}Bs=Bs.nextEffect}}catch(T){if(null===Bs)throw Error(o(330));vu(Bs,T),Bs=Bs.nextEffect}}while(null!==Bs);Bs=null,Di(),Es=a}else e.current=n;if(Us)Us=!1,Fs=e,js=t;else for(Bs=i;null!==Bs;)t=Bs.nextEffect,Bs.nextEffect=null,Bs=t;if(0===(t=e.firstPendingTime)&&(Rs=null),1073741823===t?e===Hs?$s++:($s=0,Hs=e):$s=0,"function"===typeof wu&&wu(n.stateNode,r),Js(e),Ps)throw Ps=!1,e=qs,qs=null,e;return 0!==(8&Es)||Vi(),null}function du(){for(;null!==Bs;){var e=Bs.effectTag;0!==(256&e)&&ns(Bs.alternate,Bs),0===(512&e)||Us||(Us=!0,$i(97,(function(){return hu(),null}))),Bs=Bs.nextEffect}}function hu(){if(90!==js){var e=97<js?97:js;return js=90,Li(e,yu)}}function yu(){if(null===Fs)return!1;var e=Fs;if(Fs=null,0!==(48&Es))throw Error(o(331));var t=Es;for(Es|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!==(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:rs(5,n),is(5,n)}}catch(r){if(null===e)throw Error(o(330));vu(e,r)}n=e.nextEffect,e.nextEffect=null,e=n}return Es=t,Vi(),!0}function gu(e,t,n){ua(e,t=ds(e,t=Xo(n,t),1073741823)),null!==(e=Ys(e,1073741823))&&Js(e)}function vu(e,t){if(3===e.tag)gu(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){gu(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"===typeof n.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Rs||!Rs.has(r))){ua(n,e=hs(n,e=Xo(t,e),1073741823)),null!==(n=Ys(n,1073741823))&&Js(n);break}}n=n.return}}function xu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),Ss===e&&Ts===n?As===Ns||As===ws&&1073741823===Cs&&Ui()-Ds<500?nu(e,Ts):Is=!0:zu(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Js(e)))}function bu(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=Gs(t=Ws(),e,null)),null!==(e=Ys(e,t))&&Js(e)}ys=function(e,t,n){var r=t.expirationTime;if(null!==e){var i=t.pendingProps;if(e.memoizedProps!==i||pi.current)_o=!0;else{if(r<n){switch(_o=!1,t.tag){case 3:Uo(t),Oo();break;case 5:if(Ia(t),4&t.mode&&1!==n&&i.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:hi(t.type)&&xi(t);break;case 4:ka(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value,i=t.type._context,li(Yi,i._currentValue),i._currentValue=r;break;case 13:if(null!==t.memoizedState)return 0!==(r=t.child.childExpirationTime)&&r>=n?Ho(e,t,n):(li(Ba,1&Ba.current),null!==(t=Zo(e,t,n))?t.sibling:null);li(Ba,1&Ba.current);break;case 19:if(r=t.childExpirationTime>=n,0!==(64&e.effectTag)){if(r)return Go(e,t,n);t.effectTag|=64}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null),li(Ba,Ba.current),!r)return null}return Zo(e,t,n)}_o=!1}}else _o=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,i=di(t,fi.current),na(t,n),i=Ga(null,t,r,e,i,n),t.effectTag|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,hi(r)){var a=!0;xi(t)}else a=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,aa(t);var s=r.getDerivedStateFromProps;"function"===typeof s&&da(t,r,s,e),i.updater=ha,t.stateNode=i,i._reactInternalFiber=t,xa(t,r,e,n),t=Ro(null,t,r,!0,a,n)}else t.tag=0,ko(null,t,i,n),t=t.child;return t;case 16:e:{if(i=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(i),1!==i._status)throw i._result;switch(i=i._result,t.type=i,a=t.tag=function(e){if("function"===typeof e)return Mu(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===ue)return 11;if(e===fe)return 14}return 2}(i),e=Zi(i,e),a){case 0:t=Po(null,t,i,e,n);break e;case 1:t=qo(null,t,i,e,n);break e;case 11:t=zo(null,t,i,e,n);break e;case 14:t=Io(null,t,i,Zi(i.type,e),r,n);break e}throw Error(o(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Po(e,t,r,i=t.elementType===r?i:Zi(r,i),n);case 1:return r=t.type,i=t.pendingProps,qo(e,t,r,i=t.elementType===r?i:Zi(r,i),n);case 3:if(Uo(t),r=t.updateQueue,null===e||null===r)throw Error(o(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,oa(e,t),ca(t,r,null,n),(r=t.memoizedState.element)===i)Oo(),t=Zo(e,t,n);else{if((i=t.stateNode.hydrate)&&(wo=wn(t.stateNode.containerInfo.firstChild),bo=t,i=No=!0),i)for(n=Ma(t,null,r,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else ko(e,t,r,n),Oo();t=t.child}return t;case 5:return Ia(t),null===e&&Mo(t),r=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,vn(r,i)?s=null:null!==a&&vn(r,a)&&(t.effectTag|=16),Bo(e,t),4&t.mode&&1!==n&&i.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(ko(e,t,s,n),t=t.child),t;case 6:return null===e&&Mo(t),null;case 13:return Ho(e,t,n);case 4:return ka(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Sa(t,null,r,n):ko(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,zo(e,t,r,i=t.elementType===r?i:Zi(r,i),n);case 7:return ko(e,t,t.pendingProps,n),t.child;case 8:case 12:return ko(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,i=t.pendingProps,s=t.memoizedProps,a=i.value;var u=t.type._context;if(li(Yi,u._currentValue),u._currentValue=a,null!==s)if(u=s.value,0===(a=qr(u,a)?0:0|("function"===typeof r._calculateChangedBits?r._calculateChangedBits(u,a):1073741823))){if(s.children===i.children&&!pi.current){t=Zo(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var l=u.dependencies;if(null!==l){s=u.child;for(var c=l.firstContext;null!==c;){if(c.context===r&&0!==(c.observedBits&a)){1===u.tag&&((c=sa(n,null)).tag=2,ua(u,c)),u.expirationTime<n&&(u.expirationTime=n),null!==(c=u.alternate)&&c.expirationTime<n&&(c.expirationTime=n),ta(u.return,n),l.expirationTime<n&&(l.expirationTime=n);break}c=c.next}}else s=10===u.tag&&u.type===t.type?null:u.child;if(null!==s)s.return=u;else for(s=u;null!==s;){if(s===t){s=null;break}if(null!==(u=s.sibling)){u.return=s.return,s=u;break}s=s.return}u=s}ko(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(a=t.pendingProps).children,na(t,n),r=r(i=ra(i,a.unstable_observedBits)),t.effectTag|=1,ko(e,t,r,n),t.child;case 14:return a=Zi(i=t.type,t.pendingProps),Io(e,t,i,a=Zi(i.type,a),r,n);case 15:return Do(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Zi(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,hi(r)?(e=!0,xi(t)):e=!1,na(t,n),ga(t,r,i),xa(t,r,i,n),Ro(null,t,r,!0,e,n);case 19:return Go(e,t,n)}throw Error(o(156,t.tag))};var wu=null,Nu=null;function Eu(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function Su(e,t,n,r){return new Eu(e,t,n,r)}function Mu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Tu(e,t){var n=e.alternate;return null===n?((n=Su(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Au(e,t,n,r,i,a){var s=2;if(r=e,"function"===typeof e)Mu(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case ne:return Ou(n.children,i,a,t);case se:s=8,i|=7;break;case re:s=8,i|=1;break;case ie:return(e=Su(12,n,t,8|i)).elementType=ie,e.type=ie,e.expirationTime=a,e;case le:return(e=Su(13,n,t,i)).type=le,e.elementType=le,e.expirationTime=a,e;case ce:return(e=Su(19,n,t,i)).elementType=ce,e.expirationTime=a,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case ae:s=10;break e;case oe:s=9;break e;case ue:s=11;break e;case fe:s=14;break e;case pe:s=16,r=null;break e;case me:s=22;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Su(s,n,t,i)).elementType=e,t.type=r,t.expirationTime=a,t}function Ou(e,t,n,r){return(e=Su(7,e,r,t)).expirationTime=n,e}function Cu(e,t,n){return(e=Su(6,e,null,t)).expirationTime=n,e}function _u(e,t,n){return(t=Su(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ku(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function zu(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Iu(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(r>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Du(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Bu(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Pu(e,t,n,r){var i=t.current,a=Ws(),s=pa.suspense;a=Gs(a,i,s);e:if(n){t:{if(Ke(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(o(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(hi(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw Error(o(171))}if(1===n.tag){var l=n.type;if(hi(l)){n=vi(n,l,u);break e}}n=u}else n=ci;return null===t.context?t.context=n:t.pendingContext=n,(t=sa(a,s)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),ua(i,t),Zs(i,a),a}function qu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Ru(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Uu(e,t){Ru(e,t),(e=e.alternate)&&Ru(e,t)}function Fu(e,t,n){var r=new ku(e,t,n=null!=n&&!0===n.hydrate),i=Su(3,null,null,2===t?7:1===t?3:0);r.current=i,i.stateNode=r,aa(i),e[Tn]=r.current,n&&0!==t&&function(e,t){var n=Xe(t);Tt.forEach((function(e){dt(e,t,n)})),At.forEach((function(e){dt(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=r}function ju(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Lu(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a._internalRoot;if("function"===typeof i){var s=i;i=function(){var e=qu(o);s.call(e)}}Pu(t,o,e,i)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Fu(e,0,t?{hydrate:!0}:void 0)}(n,r),o=a._internalRoot,"function"===typeof i){var u=i;i=function(){var e=qu(o);u.call(e)}}tu((function(){Pu(t,o,e,i)}))}return qu(o)}function $u(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:te,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}function Hu(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!ju(t))throw Error(o(200));return $u(e,t,null,n)}Fu.prototype.render=function(e){Pu(e,this._internalRoot,null,null)},Fu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Pu(null,e,null,(function(){t[Tn]=null}))},ht=function(e){if(13===e.tag){var t=Gi(Ws(),150,100);Zs(e,t),Uu(e,t)}},yt=function(e){13===e.tag&&(Zs(e,3),Uu(e,3))},gt=function(e){if(13===e.tag){var t=Ws();Zs(e,t=Gs(t,e,null)),Uu(e,t)}},O=function(e,t,n){switch(t){case"input":if(Me(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=_n(r);if(!i)throw Error(o(90));we(r),Me(r,i)}}}break;case"textarea":ze(e,n);break;case"select":null!=(t=n.value)&&Ce(e,!!n.multiple,t,!1)}},D=eu,B=function(e,t,n,r,i){var a=Es;Es|=4;try{return Li(98,e.bind(null,t,n,r,i))}finally{0===(Es=a)&&Vi()}},P=function(){0===(49&Es)&&(function(){if(null!==Ls){var e=Ls;Ls=null,e.forEach((function(e,t){Bu(t,e),Js(t)})),Vi()}}(),hu())},q=function(e,t){var n=Es;Es|=2;try{return e(t)}finally{0===(Es=n)&&Vi()}};var Vu={Events:[On,Cn,_n,T,E,qn,function(e){it(e,Pn)},z,I,Jt,st,hu,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);wu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64===(64&e.current.effectTag))}catch(r){}},Nu=function(e){try{t.onCommitFiberUnmount(n,e)}catch(r){}}}catch(r){}})(i({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Q.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=nt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:An,bundleType:0,version:"16.13.1",rendererPackageName:"react-dom"}),t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vu,t.createPortal=Hu,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw Error(o(268,Object.keys(e)))}return e=null===(e=nt(t))?null:e.stateNode},t.flushSync=function(e,t){if(0!==(48&Es))throw Error(o(187));var n=Es;Es|=1;try{return Li(99,e.bind(null,t))}finally{Es=n,Vi()}},t.hydrate=function(e,t,n){if(!ju(t))throw Error(o(200));return Lu(null,e,t,!0,n)},t.render=function(e,t,n){if(!ju(t))throw Error(o(200));return Lu(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!ju(e))throw Error(o(40));return!!e._reactRootContainer&&(tu((function(){Lu(null,null,e,!1,(function(){e._reactRootContainer=null,e[Tn]=null}))})),!0)},t.unstable_batchedUpdates=eu,t.unstable_createPortal=function(e,t){return Hu(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!ju(n))throw Error(o(200));if(null==e||void 0===e._reactInternalFiber)throw Error(o(38));return Lu(e,t,n,!1,r)},t.version="16.13.1"},function(e,t,n){"use strict";e.exports=n(20)},function(e,t,n){"use strict";var r,i,a,o,s;if("undefined"===typeof window||"function"!==typeof MessageChannel){var u=null,l=null,c=function e(){if(null!==u)try{var n=t.unstable_now();u(!0,n),u=null}catch(r){throw setTimeout(e,0),r}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(c,0))},i=function(e,t){l=setTimeout(e,t)},a=function(){clearTimeout(l)},o=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var p=window.performance,m=window.Date,d=window.setTimeout,h=window.clearTimeout;if("undefined"!==typeof console){var y=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!==typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"===typeof p&&"function"===typeof p.now)t.unstable_now=function(){return p.now()};else{var g=m.now();t.unstable_now=function(){return m.now()-g}}var v=!1,x=null,b=-1,w=5,N=0;o=function(){return t.unstable_now()>=N},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var E=new MessageChannel,S=E.port2;E.port1.onmessage=function(){if(null!==x){var e=t.unstable_now();N=e+w;try{x(!0,e)?S.postMessage(null):(v=!1,x=null)}catch(n){throw S.postMessage(null),n}}else v=!1},r=function(e){x=e,v||(v=!0,S.postMessage(null))},i=function(e,n){b=d((function(){e(t.unstable_now())}),n)},a=function(){h(b),b=-1}}function M(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<O(i,t)))break e;e[r]=t,e[n]=i,n=r}}function T(e){return void 0===(e=e[0])?null:e}function A(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var a=2*(r+1)-1,o=e[a],s=a+1,u=e[s];if(void 0!==o&&0>O(o,n))void 0!==u&&0>O(u,o)?(e[r]=u,e[s]=n,r=s):(e[r]=o,e[a]=n,r=a);else{if(!(void 0!==u&&0>O(u,n)))break e;e[r]=u,e[s]=n,r=s}}}return t}return null}function O(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var C=[],_=[],k=1,z=null,I=3,D=!1,B=!1,P=!1;function q(e){for(var t=T(_);null!==t;){if(null===t.callback)A(_);else{if(!(t.startTime<=e))break;A(_),t.sortIndex=t.expirationTime,M(C,t)}t=T(_)}}function R(e){if(P=!1,q(e),!B)if(null!==T(C))B=!0,r(U);else{var t=T(_);null!==t&&i(R,t.startTime-e)}}function U(e,n){B=!1,P&&(P=!1,a()),D=!0;var r=I;try{for(q(n),z=T(C);null!==z&&(!(z.expirationTime>n)||e&&!o());){var s=z.callback;if(null!==s){z.callback=null,I=z.priorityLevel;var u=s(z.expirationTime<=n);n=t.unstable_now(),"function"===typeof u?z.callback=u:z===T(C)&&A(C),q(n)}else A(C);z=T(C)}if(null!==z)var l=!0;else{var c=T(_);null!==c&&i(R,c.startTime-n),l=!1}return l}finally{z=null,I=r,D=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var j=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){B||D||(B=!0,r(U))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return T(C)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=j,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,o){var s=t.unstable_now();if("object"===typeof o&&null!==o){var u=o.delay;u="number"===typeof u&&0<u?s+u:s,o="number"===typeof o.timeout?o.timeout:F(e)}else o=F(e),u=s;return e={id:k++,callback:n,priorityLevel:e,startTime:u,expirationTime:o=u+o,sortIndex:-1},u>s?(e.sortIndex=u,M(_,e),null===T(C)&&e===T(_)&&(P?a():P=!0,i(R,u-s))):(e.sortIndex=o,M(C,e),B||D||(B=!0,r(U))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();q(e);var n=T(C);return n!==z&&null!==z&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime<z.expirationTime||o()},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}}},function(e,t,n){},,function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},,,function(e,t,n){"use strict";n.d(t,"a",(function(){return Py}));var r={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function i(e){return(i="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)}function a(e){return"number"===typeof e}function o(e){return e&&!0===e.constructor.prototype.isBigNumber||!1}function s(e){return e&&"object"===i(e)&&!0===Object.getPrototypeOf(e).isComplex||!1}function u(e){return e&&"object"===i(e)&&!0===Object.getPrototypeOf(e).isFraction||!1}function l(e){return e&&!0===e.constructor.prototype.isUnit||!1}function c(e){return"string"===typeof e}var f=Array.isArray;function p(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function m(e){return Array.isArray(e)||p(e)}function d(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 y(e){return e&&!0===e.constructor.prototype.isRange||!1}function g(e){return e&&!0===e.constructor.prototype.isIndex||!1}function v(e){return"boolean"===typeof e}function x(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function b(e){return e&&!0===e.constructor.prototype.isHelp||!1}function w(e){return"function"===typeof e}function N(e){return e instanceof Date}function E(e){return e instanceof RegExp}function S(e){return!(!e||"object"!==i(e)||e.constructor!==Object||s(e)||u(e))}function M(e){return null===e}function T(e){return void 0===e}function A(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function O(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function C(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function _(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function k(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function z(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function I(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function D(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function B(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function P(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function q(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function R(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function U(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function F(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function j(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.constructor.prototype.isChain||!1}function $(e){var t=i(e);return"object"===t?null===e?"null":Array.isArray(e)?"Array":e instanceof Date?"Date":e instanceof RegExp?"RegExp":o(e)?"BigNumber":s(e)?"Complex":u(e)?"Fraction":p(e)?"Matrix":l(e)?"Unit":g(e)?"Index":y(e)?"Range":x(e)?"ResultSet":P(e)?e.type:L(e)?"Chain":b(e)?"Help":"Object":"function"===t?"Function":t}function H(e){return(H="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)}function V(e){var t=H(e);if("number"===t||"string"===t||"boolean"===t||null===e||void 0===e)return e;if("function"===typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return V(e)}));if(e instanceof Date)return new Date(e.valueOf());if(o(e))return e;if(e instanceof RegExp)throw new TypeError("Cannot clone "+e);return W(e,V)}function W(e,t){var n={};for(var r in e)Y(e,r)&&(n[r]=t(e[r]));return n}function G(e,t){for(var n in t)Y(t,n)&&(e[n]=t[n]);return e}function Z(e,t){var n,r,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(r=0,i=e.length;r<i;r++)if(!Z(e[r],t[r]))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(n in e)if(!(n in t)||!Z(e[n],t[n]))return!1;for(n in t)if(!(n in e)||!Z(e[n],t[n]))return!1;return!0}return e===t}function Y(e,t){return e&&Object.hasOwnProperty.call(e,t)}var Q=["Matrix","Array"],J=["number","BigNumber","Fraction"];function X(){return(X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var K=function(e){if(e)throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n  import { create, all } from 'mathjs';\n  const mathjs = create(all);\n  mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(r)};X(K,r,{MATRIX_OPTIONS:Q,NUMBER_OPTIONS:J});var ee={end:!0};function te(e){return"boolean"===typeof e||!!isFinite(e)&&e===Math.round(e)}var ne=Math.sign||function(e){return e>0?1:e<0?-1:0},re=Math.log2||function(e){return Math.log(e)/Math.LN2},ie=Math.log10||function(e){return Math.log(e)/Math.LN10},ae=Math.log1p||function(e){return Math.log(e+1)},oe=Math.cbrt||function(e){if(0===e)return e;var t,n=e<0;return n&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,n?-t:t},se=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function ue(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 n,r="auto";switch(t&&(t.notation&&(r=t.notation),a(t)?n=t:a(t.precision)&&(n=t.precision)),r){case"fixed":return ce(e,n);case"exponential":return fe(e,n);case"engineering":return function(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=pe(le(e),t),r=n.exponent,i=n.coefficients,o=r%3===0?r:r<0?r-3-r%3:r-r%3;if(a(t))for(;t>i.length||r-o+1>i.length;)i.push(0);else for(var s=Math.abs(r-o)-(i.length-1),u=0;u<s;u++)i.push(0);var l=Math.abs(r-o),c=1;for(;l>0;)c++,l--;var f=i.slice(c).join(""),p=a(t)&&f.length||f.match(/[1-9]/)?"."+f:"",m=i.slice(0,c).join("")+p+"e"+(r>=0?"+":"")+o.toString();return n.sign+m}(e,n);case"auto":return function(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&void 0!==n.lowerExp?n.lowerExp:-3,i=n&&void 0!==n.upperExp?n.upperExp:5,a=le(e),o=t?pe(a,t):a;if(o.exponent<r||o.exponent>=i)return fe(e,t);var s=o.coefficients,u=o.exponent;s.length<t&&(s=s.concat(me(t-s.length))),s=s.concat(me(u-s.length+1+(s.length<t?t-s.length:0))),s=me(-u).concat(s);var l=u>0?u:0;return l<s.length-1&&s.splice(l+1,0,"."),o.sign+s.join("")}(e,n,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 "'+r+'". Choose "auto", "exponential", or "fixed".')}}function le(e){var t=String(e).toLowerCase().match(/^0*?(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var n=t[1],r=t[2],i=parseFloat(t[4]||"0"),a=r.indexOf(".");i+=-1!==a?a-1:r.length-1;var o=r.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:n,coefficients:o,exponent:i}}function ce(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=le(e),r="number"===typeof t?pe(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(me(o-i.length))),a<0&&(i=me(1-a).concat(i),a=1),a<i.length&&i.splice(a,0,0===a?"0.":"."),r.sign+i.join("")}function fe(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=le(e),r=t?pe(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(me(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function pe(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),n.exponent++,i++),r[--i]++}return n}function me(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}var de=Number.EPSILON||2220446049250313e-31;function he(e,t,n){if(null===n||void 0===n)return e===t;if(e===t)return!0;if(isNaN(e)||isNaN(t))return!1;if(isFinite(e)&&isFinite(t)){var r=Math.abs(e-t);return r<de||r<=Math.max(Math.abs(e),Math.abs(t))*n}return!1}var ye=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},ge=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},ve=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},xe=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},be=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},we=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};function Ne(e,t){if("function"===typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var n,r="auto";switch(void 0!==t&&(t.notation&&(r=t.notation),"number"===typeof t?n=t:t.precision&&(n=t.precision)),r){case"fixed":return function(e,t){return e.toFixed(t)}(e,n);case"exponential":return Ee(e,n);case"engineering":return function(e,t){var n=e.e,r=n%3===0?n:n<0?n-3-n%3:n-n%3,i=e.mul(Math.pow(10,-r)),a=i.toPrecision(t);-1!==a.indexOf("e")&&(a=i.toString());return a+"e"+(n>=0?"+":"")+r.toString()}(e,n);case"auto":var i=t&&void 0!==t.lowerExp?t.lowerExp:-3,a=t&&void 0!==t.upperExp?t.upperExp:5;if(e.isZero())return"0";var o=e.toSignificantDigits(n),s=o.e;return(s>=i&&s<a?o.toFixed():Ee(e,n)).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t}));default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", or "fixed".')}}function Ee(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function Se(e){return(Se="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)}function Me(e,t){var n=e.length-t.length,r=e.length;return e.substring(n,r)===t}function Te(e,t){return"number"===typeof e?ue(e,t):o(e)?Ne(e,t):function(e){return e&&"object"===Se(e)&&"number"===typeof e.s&&"number"===typeof e.n&&"number"===typeof e.d||!1}(e)?t&&"decimal"===t.fraction?e.toString():e.s*e.n+"/"+e.d:Array.isArray(e)?function e(t,n){if(Array.isArray(t)){for(var r="[",i=t.length,a=0;a<i;a++)0!==a&&(r+=", "),r+=e(t[a],n);return r+="]"}return Te(t,n)}(e,t):c(e)?'"'+e+'"':"function"===typeof e?e.syntax?String(e.syntax):"function":e&&"object"===Se(e)?"function"===typeof e.format?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):"{"+Object.keys(e).map((function(n){return'"'+n+'": '+Te(e[n],t)})).join(", ")+"}":String(e)}function Ae(e){for(var t=String(e),n="",r=0;r<t.length;){var i=t.charAt(r);"\\"===i?(n+=i,r++,""!==(i=t.charAt(r))&&-1!=='"\\/bfnrtu'.indexOf(i)||(n+="\\"),n+=i):n+='"'===i?'\\"':i,r++}return'"'+n+'"'}function Oe(e){var t=String(e);return t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Ce(e,t){if(!c(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+$(e)+", index: 0)");if(!c(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+$(t)+", index: 1)");return e===t?0:e>t?1:-1}function _e(e,t,n){if(!(this instanceof _e))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function ke(e,t,n){if(!(this instanceof ke))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),void 0!==this.min&&this.index<this.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 ze(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Ie(e,t){if(0===t.length){if(Array.isArray(e))throw new _e(e.length,0)}else!function e(t,n,r){var i,a=t.length;if(a!==n[r])throw new _e(a,n[r]);if(r<n.length-1){var o=r+1;for(i=0;i<a;i++){var s=t[i];if(!Array.isArray(s))throw new _e(n.length-1,n.length,"<");e(t[i],n,o)}}else for(i=0;i<a;i++)if(Array.isArray(t[i]))throw new _e(n.length+1,n.length,">")}(e,t,0)}function De(e,t){if(!a(e)||!te(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"===typeof t&&e>=t)throw new ke(e,t)}function Be(e,t,n){if(!Array.isArray(e)||!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(!a(e)||!te(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Te(t)+")")})),function e(t,n,r,i){var a,o,s=t.length,u=n[r],l=Math.min(s,u);if(t.length=u,r<n.length-1){var c=r+1;for(a=0;a<l;a++)o=t[a],Array.isArray(o)||(o=[o],t[a]=o),e(o,n,c,i);for(a=l;a<u;a++)o=[],t[a]=o,e(o,n,c,i)}else{for(a=0;a<l;a++)for(;Array.isArray(t[a]);)t[a]=t[a][0];for(a=l;a<u;a++)t[a]=i}}(e,t,0,void 0!==n?n:0),e}function Pe(e,t){var n,r=Ue(e);function i(e){return e.reduce((function(e,t){return e*t}))}if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new _e(0,i(ze(e)),"!=");for(var a=1,o=0;o<t.length;o++)a*=t[o];if(r.length!==a)throw new _e(i(t),i(ze(e)),"!=");try{n=function(e,t){for(var n,r=e,i=t.length-1;i>0;i--){var a=t[i];n=[];for(var o=r.length/a,s=0;s<o;s++)n.push(r.slice(s*a,(s+1)*a));r=n}return r}(r,t)}catch(s){if(s instanceof _e)throw new _e(i(t),i(ze(e)),"!=");throw s}return n}function qe(e,t){for(var n=t||ze(e);Array.isArray(e)&&1===e.length;)e=e[0],n.shift();for(var r=n.length;1===n[r-1];)r--;return r<n.length&&(e=function e(t,n,r){var i,a;if(r<n){var o=r+1;for(i=0,a=t.length;i<a;i++)t[i]=e(t[i],n,o)}else for(;Array.isArray(t);)t=t[0];return t}(e,r,0),n.length=r),e}function Re(e,t,n,r){var i=r||ze(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=function e(t,n,r){var i,a;if(Array.isArray(t)){var o=r+1;for(i=0,a=t.length;i<a;i++)t[i]=e(t[i],n,o)}else for(var s=r;s<n;s++)t=[t];return t}(e,t,0);i.length<t;)i.push(1);return e}function Ue(e){if(!Array.isArray(e))return e;var t=[];return e.forEach((function e(n){Array.isArray(n)?n.forEach(e):t.push(n)})),t}function Fe(e,t){return Array.prototype.map.call(e,t)}function je(e,t){Array.prototype.forEach.call(e,t)}function Le(e,t){if(1!==ze(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,t)}function $e(e,t){if(1!==ze(e).length)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(e,(function(e){return t.test(e)}))}function He(e,t){return Array.prototype.join.call(e,t)}function Ve(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var t=[],n=0;t[0]={value:e[0],identifier:0};for(var r=1;r<e.length;r++)e[r]===e[r-1]?n++:n=0,t.push({value:e[r],identifier:n});return t}function We(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;for(var t=[],n=0;n<e.length;n++)t.push(e[n].value);return t}function Ge(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(0===i&&o&&(r=a.length),o&&a.length!==r)return;var s=o?Ge(a,t):t(a);if(void 0===n)n=s;else if(n!==s)return"mixed"}return n}function Ze(e,t,n,r){function i(r){var i=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r],a=e[i];void 0!==a&&(n[i]=a)}return n}(r,t.map(Ye));return function(e,t,n){if(!t.filter((function(e){return!function(e){return e&&"?"===e[0]}(e)})).every((function(e){return void 0!==n[e]}))){var r=t.filter((function(e){return void 0===n[e]}));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(r.map((function(e){return'"'.concat(e,'"')})).join(", "),"."))}}(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function Ye(e){return e&&"?"===e[0]?e.slice(1):e}function Qe(e){return(Qe="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)}_e.prototype=new RangeError,_e.prototype.constructor=RangeError,_e.prototype.name="DimensionError",_e.prototype.isDimensionError=!0,ke.prototype=new RangeError,ke.prototype.constructor=RangeError,ke.prototype.name="IndexError",ke.prototype.isIndexError=!0;var Je=Ze("Node",["mathWithTransform"],(function(e){var t=e.mathWithTransform;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator")}return n.prototype.evaluate=function(e){return this.compile().evaluate(e)},n.prototype.type="Node",n.prototype.isNode=!0,n.prototype.comment="",n.prototype.compile=function(){var e=this._compile(t,{}),n={};return{evaluate:function(t){var r=t||{};return function(e){for(var t in e)if(Y(e,t)&&t in ee)throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(r),e(r,n,null)}}},n.prototype._compile=function(e,t){throw new Error("Method _compile should be implemented by type "+this.type)},n.prototype.forEach=function(e){throw new Error("Cannot run forEach on a Node interface")},n.prototype.map=function(e){throw new Error("Cannot run map on a Node interface")},n.prototype._ifNode=function(e){if(!P(e))throw new TypeError("Callback function must return a Node");return e},n.prototype.traverse=function(e){e(this,null,null),function e(t,n){t.forEach((function(t,r,i){n(t,r,i),e(t,n)}))}(this,e)},n.prototype.transform=function(e){return function t(n,r,i){var a=e(n,r,i);return a!==n?a:n.map(t)}(this,null,null)},n.prototype.filter=function(e){var t=[];return this.traverse((function(n,r,i){e(n,r,i)&&t.push(n)})),t},n.prototype.clone=function(){throw new Error("Cannot clone a Node interface")},n.prototype.cloneDeep=function(){return this.map((function(e){return e.cloneDeep()}))},n.prototype.equals=function(e){return!!e&&Z(this,e)},n.prototype.toString=function(e){var t;if(e&&"object"===Qe(e))switch(Qe(e.handler)){case"object":case"undefined":break;case"function":t=e.handler(this,e);break;default:throw new TypeError("Object or function expected as callback")}return"undefined"!==typeof t?t:this._toString(e)},n.prototype.toJSON=function(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)},n.prototype.toHTML=function(e){var t;if(e&&"object"===Qe(e))switch(Qe(e.handler)){case"object":case"undefined":break;case"function":t=e.handler(this,e);break;default:throw new TypeError("Object or function expected as callback")}return"undefined"!==typeof t?t:this.toHTML(e)},n.prototype._toString=function(){throw new Error("_toString not implemented for "+this.type)},n.prototype.toTex=function(e){var t;if(e&&"object"===Qe(e))switch(Qe(e.handler)){case"object":case"undefined":break;case"function":t=e.handler(this,e);break;default:throw new TypeError("Object or function expected as callback")}return"undefined"!==typeof t?t:this._toTex(e)},n.prototype._toTex=function(e){throw new Error("_toTex not implemented for "+this.type)},n.prototype.getIdentifier=function(){return this.type},n.prototype.getContent=function(){return this},n}),{isClass:!0,isNode:!0}),Xe=Ze("ArrayNode",["Node"],(function(e){var t=e.Node;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.items=e||[],!Array.isArray(this.items)||!this.items.every(P))throw new TypeError("Array containing Nodes expected")}return n.prototype=new t,n.prototype.type="ArrayNode",n.prototype.isArrayNode=!0,n.prototype._compile=function(e,t){var n=Fe(this.items,(function(n){return n._compile(e,t)}));if("Array"!==e.config.matrix){var r=e.matrix;return function(e,t,i){return r(Fe(n,(function(n){return n(e,t,i)})))}}return function(e,t,r){return Fe(n,(function(n){return n(e,t,r)}))}},n.prototype.forEach=function(e){for(var t=0;t<this.items.length;t++){e(this.items[t],"items["+t+"]",this)}},n.prototype.map=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 n(t)},n.prototype.clone=function(){return new n(this.items.slice(0))},n.prototype._toString=function(e){return"["+this.items.map((function(t){return t.toString(e)})).join(", ")+"]"},n.prototype.toJSON=function(){return{mathjs:"ArrayNode",items:this.items}},n.fromJSON=function(e){return new n(e.items)},n.prototype.toHTML=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>'},n.prototype._toTex=function(e){var t="\\begin{bmatrix}";return this.items.forEach((function(n){n.items?t+=n.items.map((function(t){return t.toTex(e)})).join("&"):t+=n.toTex(e),t+="\\\\"})),t+="\\end{bmatrix}"},n}),{isClass:!0,isNode:!0}),Ke=Ze("BlockNode",["ResultSet","Node"],(function(e){var t=e.ResultSet,n=e.Node;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var t=e&&e.node,n=!e||void 0===e.visible||e.visible;if(!P(t))throw new TypeError('Property "node" must be a Node');if("boolean"!==typeof n)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:n}}))}return r.prototype=new n,r.prototype.type="BlockNode",r.prototype.isBlockNode=!0,r.prototype._compile=function(e,n){var r=Fe(this.blocks,(function(t){return{evaluate:t.node._compile(e,n),visible:t.visible}}));return function(e,n,i){var a=[];return je(r,(function(t){var r=t.evaluate(e,n,i);t.visible&&a.push(r)})),new t(a)}},r.prototype.forEach=function(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)},r.prototype.map=function(e){for(var t=[],n=0;n<this.blocks.length;n++){var i=this.blocks[n],a=this._ifNode(e(i.node,"blocks["+n+"].node",this));t[n]={node:a,visible:i.visible}}return new r(t)},r.prototype.clone=function(){return new r(this.blocks.map((function(e){return{node:e.node,visible:e.visible}})))},r.prototype._toString=function(e){return this.blocks.map((function(t){return t.node.toString(e)+(t.visible?"":";")})).join("\n")},r.prototype.toJSON=function(){return{mathjs:"BlockNode",blocks:this.blocks}},r.fromJSON=function(e){return new r(e.blocks)},r.prototype.toHTML=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>')},r.prototype._toTex=function(e){return this.blocks.map((function(t){return t.node.toTex(e)+(t.visible?"":";")})).join("\\;\\;\n")},r}),{isClass:!0,isNode:!0}),et=n(12),tt=n.n(et),nt={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{?}"},rt={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"},it={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(rt.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(rt.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(rt.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(rt.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(rt.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(rt.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(rt.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(rt.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(rt.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(rt.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(rt.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(rt.bitAnd,"${args[1]}\\right)")},bitNot:{1:rt.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(rt.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(rt.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(rt.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(rt.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(rt.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(rt.and,"${args[1]}\\right)")},not:{1:rt.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(rt.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(rt.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(rt.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}"},sqrtm:{1:"{${args[0]}}".concat(rt.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(rt.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(rt.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(rt.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(rt.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(rt.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(rt.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(rt.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(rt.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(rt.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(nt.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)"}},at={deg:"^\\circ"};function ot(e){return tt()(e,{preserveFormatting:!0})}function st(e,t){return(t="undefined"!==typeof t&&t)?Y(at,e)?at[e]:"\\mathrm{"+ot(e)+"}":Y(nt,e)?nt[e]:ot(e)}var ut=Ze("ConstantNode",["Node"],(function(e){var t=e.Node;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.value=e}return n.prototype=new t,n.prototype.type="ConstantNode",n.prototype.isConstantNode=!0,n.prototype._compile=function(e,t){var n=this.value;return function(){return n}},n.prototype.forEach=function(e){},n.prototype.map=function(e){return this.clone()},n.prototype.clone=function(){return new n(this.value)},n.prototype._toString=function(e){return Te(this.value,e)},n.prototype.toHTML=function(e){var t=this._toString(e);switch($(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>"}},n.prototype.toJSON=function(){return{mathjs:"ConstantNode",value:this.value}},n.fromJSON=function(e){return new n(e.value)},n.prototype._toTex=function(e){var t=this._toString(e);switch($(this.value)){case"string":return"\\mathtt{"+ot(t)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");return-1!==n?t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}":t;case"Fraction":return this.value.toLatex();default:return t}},n}),{isClass:!0,isNode:!0});function lt(e){return(lt="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)}function ct(e,t){if(dt(e)&&pt(e,t))return e[t];if("function"===typeof e[t]&&mt(e,t))throw new Error('Cannot access method "'+t+'" as a property');throw new Error('No access to property "'+t+'"')}function ft(e,t,n){if(dt(e)&&pt(e,t))return e[t]=n,n;throw new Error('No access to property "'+t+'"')}function pt(e,t){return!(!e||"object"!==lt(e))&&(!!Y(ht,t)||!(t in Object.prototype)&&!(t in Function.prototype))}function mt(e,t){return null!==e&&void 0!==e&&"function"===typeof e[t]&&(!(Y(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!Y(yt,t)||!(t in Object.prototype)&&!(t in Function.prototype)))}function dt(e){return"object"===lt(e)&&e&&e.constructor===Object}var ht={length:!0,name:!0},yt={toString:!0,valueOf:!0,toLocaleString:!0};function gt(e){return(gt="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)}var vt=Ze("ObjectNode",["Node"],(function(e){var t=e.Node;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(this.properties=e||{},e&&("object"!==gt(e)||!Object.keys(e).every((function(t){return P(e[t])}))))throw new TypeError("Object containing Nodes expected")}return n.prototype=new t,n.prototype.type="ObjectNode",n.prototype.isObjectNode=!0,n.prototype._compile=function(e,t){var n={};for(var r in this.properties)if(Y(this.properties,r)){var i=Ae(r),a=JSON.parse(i);if(!pt(this.properties,a))throw new Error('No access to property "'+a+'"');n[a]=this.properties[r]._compile(e,t)}return function(e,t,r){var i={};for(var a in n)Y(n,a)&&(i[a]=n[a](e,t,r));return i}},n.prototype.forEach=function(e){for(var t in this.properties)Y(this.properties,t)&&e(this.properties[t],"properties["+Ae(t)+"]",this)},n.prototype.map=function(e){var t={};for(var r in this.properties)Y(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],"properties["+Ae(r)+"]",this)));return new n(t)},n.prototype.clone=function(){var e={};for(var t in this.properties)Y(this.properties,t)&&(e[t]=this.properties[t]);return new n(e)},n.prototype._toString=function(e){var t=[];for(var n in this.properties)Y(this.properties,n)&&t.push(Ae(n)+": "+this.properties[n].toString(e));return"{"+t.join(", ")+"}"},n.prototype.toJSON=function(){return{mathjs:"ObjectNode",properties:this.properties}},n.fromJSON=function(e){return new n(e.properties)},n.prototype.toHTML=function(e){var t=[];for(var n in this.properties)Y(this.properties,n)&&t.push('<span class="math-symbol math-property">'+Oe(n)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[n].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'},n.prototype._toTex=function(e){var t=[];for(var n in this.properties)Y(this.properties,n)&&t.push("\\mathbf{"+n+":} & "+this.properties[n].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}".concat(t.join("\n"),"\\end{array}\\right\\}")},n}),{isClass:!0,isNode:!0}),xt=Ze("ParenthesisNode",["Node"],(function(e){var t=e.Node;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!P(e))throw new TypeError('Node expected for parameter "content"');this.content=e}return n.prototype=new t,n.prototype.type="ParenthesisNode",n.prototype.isParenthesisNode=!0,n.prototype._compile=function(e,t){return this.content._compile(e,t)},n.prototype.getContent=function(){return this.content.getContent()},n.prototype.forEach=function(e){e(this.content,"content",this)},n.prototype.map=function(e){return new n(e(this.content,"content",this))},n.prototype.clone=function(){return new n(this.content)},n.prototype._toString=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)},n.prototype.toJSON=function(){return{mathjs:"ParenthesisNode",content:this.content}},n.fromJSON=function(e){return new n(e.content)},n.prototype.toHTML=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)},n.prototype._toTex=function(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)},n}),{isClass:!0,isNode:!0}),bt=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{associativity:"left",associativeWith:[]}},{"OperatorNode:and":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{associativity:"left",associativeWith:[]},"OperatorNode:unequal":{associativity:"left",associativeWith:[]},"OperatorNode:smaller":{associativity:"left",associativeWith:[]},"OperatorNode:larger":{associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{associativity:"left",associativeWith:[]}},{"OperatorNode:to":{associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{associativity:"left",associativeWith:[]},"OperatorNode:mod":{associativity:"left",associativeWith:[]}},{"OperatorNode:unaryPlus":{associativity:"right"},"OperatorNode:unaryMinus":{associativity:"right"},"OperatorNode:bitNot":{associativity:"right"},"OperatorNode:not":{associativity:"right"}},{"OperatorNode:pow":{associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{associativity:"left"}},{"OperatorNode:transpose":{associativity:"left"}}];function wt(e,t){var n=e;"keep"!==t&&(n=e.getContent());for(var r=n.getIdentifier(),i=0;i<bt.length;i++)if(r in bt[i])return i;return null}function Nt(e,t){var n=e;"keep"!==t&&(n=e.getContent());var r=n.getIdentifier(),i=wt(n,t);if(null===i)return null;var a=bt[i][r];if(Y(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+r+"' has the invalid associativity '"+a.associativity+"'.")}return null}function Et(e,t,n){var r="keep"!==n?e.getContent():e,i="keep"!==n?e.getContent():t,a=r.getIdentifier(),o=i.getIdentifier(),s=wt(r,n);if(null===s)return null;var u=bt[s][a];if(Y(u,"associativeWith")&&u.associativeWith instanceof Array){for(var l=0;l<u.associativeWith.length;l++)if(u.associativeWith[l]===o)return!0;return!1}return null}var St=Ze("RelationalNode",["Node"],(function(e){var t=e.Node;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!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");this.conditionals=e,this.params=t}return n.prototype=new t,n.prototype.type="RelationalNode",n.prototype.isRelationalNode=!0,n.prototype._compile=function(e,t){var n=this,r=this.params.map((function(n){return n._compile(e,t)}));return function(t,i,a){for(var o,s=r[0](t,i,a),u=0;u<n.conditionals.length;u++){if(o=s,s=r[u+1](t,i,a),!ct(e,n.conditionals[u])(o,s))return!1}return!0}},n.prototype.forEach=function(e){var t=this;this.params.forEach((function(n,r){return e(n,"params["+r+"]",t)}),this)},n.prototype.map=function(e){var t=this;return new n(this.conditionals.slice(),this.params.map((function(n,r){return t._ifNode(e(n,"params["+r+"]",t))}),this))},n.prototype.clone=function(){return new n(this.conditionals,this.params)},n.prototype._toString=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=wt(this,t),r=this.params.map((function(r,i){var a=wt(r,t);return"all"===t||null!==a&&a<=n?"("+r.toString(e)+")":r.toString(e)})),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},a=r[0],o=0;o<this.conditionals.length;o++)a+=" "+i[this.conditionals[o]]+" "+r[o+1];return a},n.prototype.toJSON=function(){return{mathjs:"RelationalNode",conditionals:this.conditionals,params:this.params}},n.fromJSON=function(e){return new n(e.conditionals,e.params)},n.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=wt(this,t),r=this.params.map((function(r,i){var a=wt(r,t);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)})),i={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="},a=r[0],o=0;o<this.conditionals.length;o++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Oe(i[this.conditionals[o]])+"</span>"+r[o+1];return a},n.prototype._toTex=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=wt(this,t),r=this.params.map((function(r,i){var a=wt(r,t);return"all"===t||null!==a&&a<=n?"\\left("+r.toTex(e)+"\right)":r.toTex(e)})),i=r[0],a=0;a<this.conditionals.length;a++)i+=rt[this.conditionals[a]]+r[a+1];return i},n}),{isClass:!0,isNode:!0}),Mt=Ze("Chain",["?on","math"],(function(e){var t=e.on,n=e.math;function r(e){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");L(e)?this.value=e.value:this.value=e}function i(e,t){!function(e,t,n){var r,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(r=n(),i=!1),r},set:function(e){r=e,i=!1},configurable:!0,enumerable:!0})}(r.prototype,e,(function(){var e=t();if("function"===typeof e)return a(e)}))}function a(e){return function(){for(var t=[this.value],n=0;n<arguments.length;n++)t[n+1]=arguments[n];return new r(e.apply(e,t))}}r.prototype.type="Chain",r.prototype.isChain=!0,r.prototype.done=function(){return this.value},r.prototype.valueOf=function(){return this.value},r.prototype.toString=function(){return Te(this.value)},r.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},r.fromJSON=function(e){return new r(e.value)},r.createProxy=function(e,t){if("string"===typeof e)u=e,"function"===typeof(l=t)&&(r.prototype[u]=a(l));else{var n=function(t){Y(e,t)&&void 0===o[t]&&i(t,(function(){return e[t]}))};for(var s in e)n(s)}var u,l};var o={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return r.createProxy(n),t&&t("import",(function(e,t,n){n||i(e,t)})),r}),{isClass:!0}),Tt=Ze("reviver",["classes"],(function(e){var t=e.classes;return function(e,n){var r=t[n&&n.mathjs];return r&&"function"===typeof r.fromJSON?r.fromJSON(n):n}})),At=Ze("ConditionalNode",["Node"],(function(e){var t=e.Node;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!P(e))throw new TypeError("Parameter condition must be a Node");if(!P(t))throw new TypeError("Parameter trueExpr must be a Node");if(!P(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}return n.prototype=new t,n.prototype.type="ConditionalNode",n.prototype.isConditionalNode=!0,n.prototype._compile=function(e,t){var n=this.condition._compile(e,t),r=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return function(e){if("number"===typeof e||"boolean"===typeof e||"string"===typeof e)return!!e;if(e){if(o(e))return!e.isZero();if(s(e))return!(!e.re&&!e.im);if(l(e))return!!e.value}if(null===e||void 0===e)return!1;throw new TypeError('Unsupported type of condition "'+$(e)+'"')}(n(e,t,a))?r(e,t,a):i(e,t,a)}},n.prototype.forEach=function(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))},n.prototype.clone=function(){return new n(this.condition,this.trueExpr,this.falseExpr)},n.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=wt(this,t),r=this.condition.toString(e),i=wt(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=n)&&(r="("+r+")");var a=this.trueExpr.toString(e),o=wt(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=n)&&(a="("+a+")");var s=this.falseExpr.toString(e),u=wt(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=n)&&(s="("+s+")"),r+" ? "+a+" : "+s},n.prototype.toJSON=function(){return{mathjs:"ConditionalNode",condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}},n.fromJSON=function(e){return new n(e.condition,e.trueExpr,e.falseExpr)},n.prototype.toHTML=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=wt(this,t),r=this.condition.toHTML(e),i=wt(this.condition,t);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=n)&&(r='<span class="math-parenthesis math-round-parenthesis">(</span>'+r+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),o=wt(this.trueExpr,t);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=n)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.falseExpr.toHTML(e),u=wt(this.falseExpr,t);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=n)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),r+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+s},n.prototype._toTex=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}"},n}),{isClass:!0,isNode:!0}),Ot=Ze("OperatorNode",["Node"],(function(e){var t=e.Node;function n(e,t,r,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if("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(P))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===i,this.op=e,this.fn=t,this.args=r||[]}function r(e,t,n,r,i){var a,o=wt(e,t),s=Nt(e,t);if("all"===t||r.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return r.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(r.length){case 0:a=[];break;case 1:var u=wt(r[0],t);if(i&&null!==u){var l,c;if("keep"===t?(l=r[0].getIdentifier(),c=e.getIdentifier()):(l=r[0].getContent().getIdentifier(),c=e.getContent().getIdentifier()),!1===bt[o][c].latexLeftParens){a=[!1];break}if(!1===bt[u][l].latexParens){a=[!1];break}}if(null===u){a=[!1];break}if(u<=o){a=[!0];break}a=[!1];break;case 2:var f,p,m=wt(r[0],t),d=Et(e,r[0],t);f=null!==m&&(m===o&&"right"===s&&!d||m<o);var h,y,g,v=wt(r[1],t),x=Et(e,r[1],t);if(p=null!==v&&(v===o&&"left"===s&&!x||v<o),i)"keep"===t?(h=e.getIdentifier(),y=e.args[0].getIdentifier(),g=e.args[1].getIdentifier()):(h=e.getContent().getIdentifier(),y=e.args[0].getContent().getIdentifier(),g=e.args[1].getContent().getIdentifier()),null!==m&&(!1===bt[o][h].latexLeftParens&&(f=!1),!1===bt[m][y].latexParens&&(f=!1)),null!==v&&(!1===bt[o][h].latexRightParens&&(p=!1),!1===bt[v][g].latexParens&&(p=!1));a=[f,p];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(a=r.map((function(n){var r=wt(n,t),i=Et(e,n,t),a=Nt(n,t);return null!==r&&(o===r&&s===a&&!i||r<o)})))}return r.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"auto"===t&&"hide"===n&&(a=r.map((function(e,t){var n="ParenthesisNode"===e.getIdentifier();return!(!a[t]&&!n)}))),a}return n.prototype=new t,n.prototype.type="OperatorNode",n.prototype.isOperatorNode=!0,n.prototype._compile=function(e,t){if("string"!==typeof this.fn||!mt(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 n=ct(e,this.fn),r=Fe(this.args,(function(n){return n._compile(e,t)}));if(1===r.length){var i=r[0];return function(e,t,r){return n(i(e,t,r))}}if(2===r.length){var a=r[0],o=r[1];return function(e,t,r){return n(a(e,t,r),o(e,t,r))}}return function(e,t,i){return n.apply(null,Fe(r,(function(n){return n(e,t,i)})))}},n.prototype.forEach=function(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},n.prototype.map=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 n(this.op,this.fn,t,this.implicit)},n.prototype.clone=function(){return new n(this.op,this.fn,this.args.slice(0),this.implicit)},n.prototype.isUnary=function(){return 1===this.args.length},n.prototype.isBinary=function(){return 2===this.args.length},n.prototype._toString=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=Nt(this,t),s=i[0].toString(e);a[0]&&(s="("+s+")");var u=/[a-zA-Z]+/.test(this.op);return"right"===o?this.op+(u?" ":"")+s:"left"===o?s+(u?" ":"")+this.op:s+this.op}if(2===i.length){var l=i[0].toString(e),c=i[1].toString(e);return a[0]&&(l="("+l+")"),a[1]&&(c="("+c+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?l+" "+c:l+" "+this.op+" "+c}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var f=i.map((function(t,n){return t=t.toString(e),a[n]&&(t="("+t+")"),t}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?f.join(" "):f.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"},n.prototype.toJSON=function(){return{mathjs:"OperatorNode",op:this.op,fn:this.fn,args:this.args,implicit:this.implicit}},n.fromJSON=function(e){return new n(e.op,e.fn,e.args,e.implicit)},n.prototype.toHTML=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=Nt(this,t),s=i[0].toHTML(e);return a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===o?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+Oe(this.op)+"</span>"+s:s+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+Oe(this.op)+"</span>"}if(2===i.length){var u=i[0].toHTML(e),l=i[1].toHTML(e);return a[0]&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?u+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+l:u+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Oe(this.op)+"</span>"+l}var c=i.map((function(t,n){return t=t.toHTML(e),a[n]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===n?c.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):c.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+Oe(this.op)+"</span>"):'<span class="math-function">'+Oe(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+c.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'},n.prototype._toTex=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=rt[this.fn];if(o="undefined"===typeof o?this.op:o,1===i.length){var s=Nt(this,t),u=i[0].toTex(e);return a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===s?o+u:u+o}if(2===i.length){var l=i[0],c=l.toTex(e);a[0]&&(c="\\left(".concat(c,"\\right)"));var f,p=i[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),f="keep"===t?l.getIdentifier():l.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+c+"}{"+p+"}";case"OperatorNode:pow":switch(c="{"+c+"}",p="{"+p+"}",f){case"ConditionalNode":case"OperatorNode:divide":c="\\left(".concat(c,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===n)return c+"~"+p}return c+o+p}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var m=i.map((function(t,n){return t=t.toTex(e),a[n]&&(t="\\left(".concat(t,"\\right)")),t}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit?m.join("~"):m.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(t){return t.toTex(e)})).join(",")+"\\right)"},n.prototype.getIdentifier=function(){return this.type+":"+this.fn},n}),{isClass:!0,isNode:!0}),Ct=Ze("RangeNode",["Node"],(function(e){var t=e.Node;function n(e,t,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!P(e))throw new TypeError("Node expected");if(!P(t))throw new TypeError("Node expected");if(r&&!P(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}function r(e,t){var n=wt(e,t),r={},i=wt(e.start,t);if(r.start=null!==i&&i<=n||"all"===t,e.step){var a=wt(e.step,t);r.step=null!==a&&a<=n||"all"===t}var o=wt(e.end,t);return r.end=null!==o&&o<=n||"all"===t,r}return n.prototype=new t,n.prototype.type="RangeNode",n.prototype.isRangeNode=!0,n.prototype.needsEnd=function(){return this.filter((function(e){return j(e)&&"end"===e.name})).length>0},n.prototype._compile=function(e,t){var n=e.range,r=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,o){return n(r(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return n(r(e,t,a),i(e,t,a))}},n.prototype.forEach=function(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)},n.prototype.map=function(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))},n.prototype.clone=function(){return new n(this.start,this.end,this.step&&this.step)},n.prototype._toString=function(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep"),i=this.start.toString(e);if(n.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),t+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),t+=":"+o},n.prototype.toJSON=function(){return{mathjs:"RangeNode",start:this.start,end:this.end,step:this.step}},n.fromJSON=function(e){return new n(e.start,e.end,e.step)},n.prototype.toHTML=function(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep"),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>'),t=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>'),t+='<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>'),t+='<span class="math-operator math-range-operator">:</span>'+o},n.prototype._toTex=function(e){var t=r(this,e&&e.parenthesis?e.parenthesis:"keep"),n=this.start.toTex(e);if(t.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);t.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),n+=":"+a},n}),{isClass:!0,isNode:!0}),_t=Ze("FunctionAssignmentNode",["typed","Node"],(function(e){var t=e.typed,n=e.Node;function r(e,t,n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if("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(!P(n))throw new TypeError('Node expected for parameter "expr"');if(e in ee)throw new Error('Illegal function name, "'+e+'" is a reserved keyword');this.name=e,this.params=t.map((function(e){return e&&e.name||e})),this.types=t.map((function(e){return e&&e.type||"any"})),this.expr=n}function i(e,t){var n=wt(e,t),r=wt(e.expr,t);return"all"===t||null!==r&&r<=n}return r.prototype=new n,r.prototype.type="FunctionAssignmentNode",r.prototype.isFunctionAssignmentNode=!0,r.prototype._compile=function(e,n){var r=Object.create(n);je(this.params,(function(e){r[e]=!0}));var i=this.expr._compile(e,r),a=this.name,o=this.params,s=He(this.types,","),u=a+"("+He(this.params,", ")+")";return function(e,n,r){var l={};l[s]=function(){for(var t=Object.create(n),a=0;a<o.length;a++)t[o[a]]=arguments[a];return i(e,t,r)};var c=t(a,l);return c.syntax=u,ft(e,a,c),c}},r.prototype.forEach=function(e){e(this.expr,"expr",this)},r.prototype.map=function(e){var t=this._ifNode(e(this.expr,"expr",this));return new r(this.name,this.params.slice(0),t)},r.prototype.clone=function(){return new r(this.name,this.params.slice(0),this.expr)},r.prototype._toString=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toString(e);return i(this,t)&&(n="("+n+")"),this.name+"("+this.params.join(", ")+") = "+n},r.prototype.toJSON=function(){var e=this.types;return{mathjs:"FunctionAssignmentNode",name:this.name,params:this.params.map((function(t,n){return{name:t,type:e[n]}})),expr:this.expr}},r.fromJSON=function(e){return new r(e.name,e.params,e.expr)},r.prototype.toHTML=function(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=[],r=0;r<this.params.length;r++)n.push('<span class="math-symbol math-parameter">'+Oe(this.params[r])+"</span>");var a=this.expr.toHTML(e);return i(this,t)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+Oe(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},r.prototype._toTex=function(e){var t=e&&e.parenthesis?e.parenthesis:"keep",n=this.expr.toTex(e);return i(this,t)&&(n="\\left(".concat(n,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(st).join(",")+"\\right):="+n},r}),{isClass:!0,isNode:!0}),kt=Ze("chain",["typed","Chain"],(function(e){var t=e.typed,n=e.Chain;return t("chain",{"":function(){return new n},any:function(e){return new n(e)}})}));function zt(e){return e&&e.isIndexError?new ke(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function It(e){return(It="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)}function Dt(e){var t=e.subset;return function(e,n){try{if(Array.isArray(e))return t(e,n);if(e&&"function"===typeof e.subset)return e.subset(n);if("string"===typeof e)return t(e,n);if("object"===It(e)){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return ct(e,n.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(r){throw zt(r)}}}var Bt=Ze("AccessorNode",["subset","Node"],(function(e){var t=e.subset,n=e.Node,r=Dt({subset:t});function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(!P(e))throw new TypeError('Node expected for parameter "object"');if(!B(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e||null,this.index=t,Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function a(e){return!(A(e)||O(e)||z(e)||D(e)||q(e)||U(e)||j(e))}return i.prototype=new n,i.prototype.type="AccessorNode",i.prototype.isAccessorNode=!0,i.prototype._compile=function(e,t){var n=this.object._compile(e,t),i=this.index._compile(e,t);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,t,r){return ct(n(e,t,r),a)}}return function(e,t,a){var o=n(e,t,a),s=i(e,t,o);return r(o,s)}},i.prototype.forEach=function(e){e(this.object,"object",this),e(this.index,"index",this)},i.prototype.map=function(e){return new i(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))},i.prototype.clone=function(){return new i(this.object,this.index)},i.prototype._toString=function(e){var t=this.object.toString(e);return a(this.object)&&(t="("+t+")"),t+this.index.toString(e)},i.prototype.toHTML=function(e){var t=this.object.toHTML(e);return a(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)},i.prototype._toTex=function(e){var t=this.object.toTex(e);return a(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)},i.prototype.toJSON=function(){return{mathjs:"AccessorNode",object:this.object,index:this.index}},i.fromJSON=function(e){return new i(e.object,e.index)},i}),{isClass:!0,isNode:!0});function Pt(e){return function(e){if(Array.isArray(e))return qt(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return qt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return qt(e,t)}(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 qt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Rt=Ze("IndexNode",["Range","Node","size"],(function(e){var t=e.Range,n=e.Node,r=e.size;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(P))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}function a(e,n,r){return new t(o(e)?e.toNumber():e,o(n)?n.toNumber():n,o(r)?r.toNumber():r)}return i.prototype=new n,i.prototype.type="IndexNode",i.prototype.isIndexNode=!0,i.prototype._compile=function(e,t){var n=Fe(this.dimensions,(function(n,i){if(F(n)){if(n.needsEnd()){var o=Object.create(t);o.end=!0;var s=n.start._compile(e,o),u=n.end._compile(e,o),l=n.step?n.step._compile(e,o):function(){return 1};return function(e,t,n){var o=r(n).valueOf(),c=Object.create(t);return c.end=o[i],a(s(e,c,n),u(e,c,n),l(e,c,n))}}var c=n.start._compile(e,t),f=n.end._compile(e,t),p=n.step?n.step._compile(e,t):function(){return 1};return function(e,t,n){return a(c(e,t,n),f(e,t,n),p(e,t,n))}}if(j(n)&&"end"===n.name){var m=Object.create(t);m.end=!0;var d=n._compile(e,m);return function(e,t,n){var a=r(n).valueOf(),o=Object.create(t);return o.end=a[i],d(e,o,n)}}var h=n._compile(e,t);return function(e,t,n){return h(e,t,n)}})),i=ct(e,"index");return function(e,t,r){var a=Fe(n,(function(n){return n(e,t,r)}));return i.apply(void 0,Pt(a))}},i.prototype.forEach=function(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)},i.prototype.map=function(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this._ifNode(e(this.dimensions[n],"dimensions["+n+"]",this));return new i(t,this.dotNotation)},i.prototype.clone=function(){return new i(this.dimensions.slice(0),this.dotNotation)},i.prototype.isObjectProperty=function(){return 1===this.dimensions.length&&z(this.dimensions[0])&&"string"===typeof this.dimensions[0].value},i.prototype.getObjectProperty=function(){return this.isObjectProperty()?this.dimensions[0].value:null},i.prototype._toString=function(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"},i.prototype.toJSON=function(){return{mathjs:"IndexNode",dimensions:this.dimensions,dotNotation:this.dotNotation}},i.fromJSON=function(e){return new i(e.dimensions,e.dotNotation)},i.prototype.toHTML=function(e){for(var t=[],n=0;n<this.dimensions.length;n++)t[n]=this.dimensions[n].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+Oe(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>'},i.prototype._toTex=function(e){var t=this.dimensions.map((function(t){return t.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"},i}),{isClass:!0,isNode:!0});function Ut(e){return(Ut="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)}var Ft=Ze("AssignmentNode",["subset","?matrix","Node"],(function(e){var t=e.subset,n=e.matrix,r=e.Node,i=Dt({subset:t}),a=function(e){var t=e.subset,n=e.matrix;return function(e,r,i){try{if(Array.isArray(e))return n(e).subset(r,i).valueOf();if(e&&"function"===typeof e.subset)return e.subset(r,i);if("string"===typeof e)return t(e,r,i);if("object"===Ut(e)){if(!r.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return ft(e,r.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw zt(a)}}}({subset:t,matrix:n});function o(e,t,n){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(this.object=e,this.index=n?t:null,this.value=n||t,!j(e)&&!A(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(j(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!B(this.index))throw new TypeError('IndexNode expected as "index"');if(!P(this.value))throw new TypeError('Node expected as "value"');Object.defineProperty(this,"name",{get:function(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}function s(e,t){t||(t="keep");var n=wt(e,t),r=wt(e.value,t);return"all"===t||null!==r&&r<=n}return o.prototype=new r,o.prototype.type="AssignmentNode",o.prototype.isAssignmentNode=!0,o.prototype._compile=function(e,t){var n=this.object._compile(e,t),r=this.index?this.index._compile(e,t):null,o=this.value._compile(e,t),s=this.object.name;if(this.index){if(this.index.isObjectProperty()){var u=this.index.getObjectProperty();return function(e,t,r){var i=n(e,t,r),a=o(e,t,r);return ft(i,u,a)}}if(j(this.object))return function(e,t,i){var u=n(e,t,i),l=o(e,t,i),c=r(e,t,u);return ft(e,s,a(u,c,l)),l};var l=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var c=this.object.index.getObjectProperty();return function(e,t,n){var i=l(e,t,n),s=ct(i,c),u=r(e,t,s),f=o(e,t,n);return ft(i,c,a(s,u,f)),f}}var f=this.object.index._compile(e,t);return function(e,t,n){var s=l(e,t,n),u=f(e,t,s),c=i(s,u),p=r(e,t,c),m=o(e,t,n);return a(s,u,a(c,p,m)),m}}if(!j(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,n){return ft(e,s,o(e,t,n))}},o.prototype.forEach=function(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)},o.prototype.map=function(e){return new o(this._ifNode(e(this.object,"object",this)),this.index?this._ifNode(e(this.index,"index",this)):null,this._ifNode(e(this.value,"value",this)))},o.prototype.clone=function(){return new o(this.object,this.index,this.value)},o.prototype._toString=function(e){var t=this.object.toString(e),n=this.index?this.index.toString(e):"",r=this.value.toString(e);return s(this,e&&e.parenthesis)&&(r="("+r+")"),t+n+" = "+r},o.prototype.toJSON=function(){return{mathjs:"AssignmentNode",object:this.object,index:this.index,value:this.value}},o.fromJSON=function(e){return new o(e.object,e.index,e.value)},o.prototype.toHTML=function(e){var t=this.object.toHTML(e),n=this.index?this.index.toHTML(e):"",r=this.value.toHTML(e);return s(this,e&&e.parenthesis)&&(r='<span class="math-paranthesis math-round-parenthesis">(</span>'+r+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+n+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+r},o.prototype._toTex=function(e){var t=this.object.toTex(e),n=this.index?this.index.toTex(e):"",r=this.value.toTex(e);return s(this,e&&e.parenthesis)&&(r="\\left(".concat(r,"\\right)")),t+n+":="+r},o}),{isClass:!0,isNode:!0}),jt=Ze("SymbolNode",["math","?Unit","Node"],(function(e){var t=e.math,n=e.Unit,r=e.Node;function i(e){return!!n&&n.isValuelessUnit(e)}function a(e){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if("string"!==typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}return a.prototype=new r,a.prototype.type="SymbolNode",a.prototype.isSymbolNode=!0,a.prototype._compile=function(e,t){var r=this.name;if(!0===t[r])return function(e,t,n){return t[r]};if(r in e)return function(t,n,i){return ct(r in t?t:e,r)};var a=i(r);return function(e,t,i){return r in e?ct(e,r):a?new n(null,r):function(e){throw new Error("Undefined symbol "+e)}(r)}},a.prototype.forEach=function(e){},a.prototype.map=function(e){return this.clone()},a.prototype.clone=function(){return new a(this.name)},a.prototype._toString=function(e){return this.name},a.prototype.toHTML=function(e){var t=Oe(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>"},a.prototype.toJSON=function(){return{mathjs:"SymbolNode",name:this.name}},a.fromJSON=function(e){return new a(e.name)},a.prototype._toTex=function(e){var n=!1;"undefined"===typeof t[this.name]&&i(this.name)&&(n=!0);var r=st(this.name,n);return"\\"===r[0]?r:" "+r},a}),{isClass:!0,isNode:!0});function Lt(e){return(Lt="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)}function $t(){return($t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Ht=Ze("FunctionNode",["math","Node","SymbolNode"],(function(e){var t=e.math,n=e.Node,r=e.SymbolNode;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if("string"===typeof e&&(e=new r(e)),!P(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(P))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=t||[],Object.defineProperty(this,"name",{get:function(){return this.fn.name||""}.bind(this),set:function(){throw new Error("Cannot assign a new name, name is read-only")}})}i.prototype=new n,i.prototype.type="FunctionNode",i.prototype.isFunctionNode=!0,i.prototype._compile=function(e,t){if(!(this instanceof i))throw new TypeError("No valid FunctionNode");var n=Fe(this.args,(function(n){return n._compile(e,t)}));if(j(this.fn)){var r=this.fn.name,a=r in e?ct(e,r):void 0;if("function"===typeof a&&!0===a.rawArgs){var o=this.args;return function(t,n,i){return(r in t?ct(t,r):a)(o,e,$t({},t,n))}}if(1===n.length){var s=n[0];return function(e,t,n){return(r in e?ct(e,r):a)(s(e,t,n))}}if(2===n.length){var u=n[0],l=n[1];return function(e,t,n){return(r in e?ct(e,r):a)(u(e,t,n),l(e,t,n))}}return function(e,t,i){return(r in e?ct(e,r):a).apply(null,Fe(n,(function(n){return n(e,t,i)})))}}if(A(this.fn)&&B(this.fn.index)&&this.fn.index.isObjectProperty()){var c=this.fn.object._compile(e,t),f=this.fn.index.getObjectProperty(),p=this.args;return function(t,r,i){var a=c(t,r,i);return function(e,t){if(!mt(e,t))throw new Error('No access to method "'+t+'"')}(a,f),a[f]&&a[f].rawArgs?a[f](p,e,$t({},t,r)):a[f].apply(a,Fe(n,(function(e){return e(t,r,i)})))}}var m=this.fn._compile(e,t),d=this.args;return function(t,r,i){var a=m(t,r,i);return a&&a.rawArgs?a(d,e,$t({},t,r)):a.apply(a,Fe(n,(function(e){return e(t,r,i)})))}},i.prototype.forEach=function(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)},i.prototype.map=function(e){for(var t=this._ifNode(e(this.fn,"fn",this)),n=[],r=0;r<this.args.length;r++)n[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new i(t,n)},i.prototype.clone=function(){return new i(this.fn,this.args.slice(0))};var a=i.prototype.toString;function o(e,t,n){for(var r,i="",a=new RegExp("\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)","ig"),o=0;null!==(r=a.exec(e));)if(i+=e.substring(o,r.index),o=r.index,"$$"===r[0])i+="$",o++;else{o+=r[0].length;var s=t[r[1]];if(!s)throw new ReferenceError("Template: Property "+r[1]+" does not exist.");if(void 0===r[2])switch(Lt(s)){case"string":i+=s;break;case"object":if(P(s))i+=s.toTex(n);else{if(!Array.isArray(s))throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes");i+=s.map((function(e,t){if(P(e))return e.toTex(n);throw new TypeError("Template: "+r[1]+"["+t+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+r[1]+" has to be a Node, String or array of Nodes")}else{if(!P(s[r[2]]&&s[r[2]]))throw new TypeError("Template: "+r[1]+"["+r[2]+"] is not a Node.");i+=s[r[2]].toTex(n)}}return i+=e.slice(o)}i.prototype.toString=function(e){var t,n=this.fn.toString(e);return e&&"object"===Lt(e.handler)&&Y(e.handler,n)&&(t=e.handler[n](this,e)),"undefined"!==typeof t?t:a.call(this,e)},i.prototype._toString=function(e){var t=this.args.map((function(t){return t.toString(e)}));return(I(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"},i.prototype.toJSON=function(){return{mathjs:"FunctionNode",fn:this.fn,args:this.args}},i.fromJSON=function(e){return new i(e.fn,e.args)},i.prototype.toHTML=function(e){var t=this.args.map((function(t){return t.toHTML(e)}));return'<span class="math-function">'+Oe(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>'};var s=i.prototype.toTex;return i.prototype.toTex=function(e){var t;return e&&"object"===Lt(e.handler)&&Y(e.handler,this.name)&&(t=e.handler[this.name](this,e)),"undefined"!==typeof t?t:s.call(this,e)},i.prototype._toTex=function(e){var n,r,i=this.args.map((function(t){return t.toTex(e)}));switch(it[this.name]&&(n=it[this.name]),!t[this.name]||"function"!==typeof t[this.name].toTex&&"object"!==Lt(t[this.name].toTex)&&"string"!==typeof t[this.name].toTex||(n=t[this.name].toTex),Lt(n)){case"function":r=n(this,e);break;case"string":r=o(n,this,e);break;case"object":switch(Lt(n[i.length])){case"function":r=n[i.length](this,e);break;case"string":r=o(n[i.length],this,e)}}return"undefined"!==typeof r?r:o("\\mathrm{${name}}\\left(${args}\\right)",this,e)},i.prototype.getIdentifier=function(){return this.type+":"+this.name},i}),{isClass:!0,isNode:!0});function Vt(e){for(var t=0;t<e.length;t++)if(m(e[t]))return!0;return!1}function Wt(e,t){p(e)&&(e=e.valueOf());for(var n=0,r=e.length;n<r;n++){var i=e[n];Array.isArray(i)?Wt(i,t):t(i)}}function Gt(e,t,n){return e&&"function"===typeof e.map?e.map((function(e){return Gt(e,t,n)})):t(e)}function Zt(e,t,n){var r=Array.isArray(e)?ze(e):e.size();if(t<0||t>=r.length)throw new ke(t,r.length);return p(e)?e.create(Yt(e.valueOf(),t,n)):Yt(e,t,n)}function Yt(e,t,n){var r,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=function(e){var t,n,r=e.length,i=e[0].length,a=[];for(n=0;n<i;n++){var o=[];for(t=0;t<r;t++)o.push(e[t][n]);a.push(o)}return a}(e),i=[],r=0;r<o.length;r++)i[r]=Yt(o[r],t-1,n);return i}for(a=e[0],r=1;r<e.length;r++)a=n(a,e[r]);return a}for(i=[],r=0;r<e.length;r++)i[r]=Yt(e[r],t-1,n);return i}function Qt(e,t,n,r,i,a,o,s,u,l,c){var f,p,m,d,h=e._values,y=e._index,g=e._ptr;if(r)for(p=g[t],m=g[t+1],f=p;f<m;f++)n[d=y[f]]!==a?(n[d]=a,o.push(d),l?(r[d]=u?s(h[f],c):s(c,h[f]),i[d]=a):r[d]=h[f]):(r[d]=u?s(h[f],r[d]):s(r[d],h[f]),i[d]=a);else for(p=g[t],m=g[t+1],f=p;f<m;f++)n[d=y[f]]!==a?(n[d]=a,o.push(d)):i[d]=a}function Jt(){return(Jt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Xt=Ze("parse",["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(function(e){var t=e.typed,n=e.numeric,r=e.config,i=e.AccessorNode,a=e.ArrayNode,o=e.AssignmentNode,s=e.BlockNode,u=e.ConditionalNode,l=e.ConstantNode,c=e.FunctionAssignmentNode,f=e.FunctionNode,p=e.IndexNode,m=e.ObjectNode,d=e.OperatorNode,h=e.ParenthesisNode,y=e.RangeNode,g=e.RelationalNode,v=e.SymbolNode,x=t("parse",{string:function(e){return H(e,{})},"Array | Matrix":function(e){return b(e,{})},"string, Object":function(e,t){return H(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]:{},n=void 0!==t.nodes?t.nodes:{};return Gt(e,(function(e){if("string"!==typeof e)throw new TypeError("String expected");return H(e,n)}))}var w=0,N=1,E=2,S=3,M=4,T={",":!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},O={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},C={true:!0,false:!1,null:null,undefined:void 0},_=["NaN","Infinity"];function k(e,t){return e.expression.substr(e.index,t)}function I(e){return k(e,1)}function B(e){e.index++}function P(e){return e.expression.charAt(e.index-1)}function q(e){return e.expression.charAt(e.index+1)}function U(e){for(e.tokenType=w,e.token="",e.comment="";x.isWhitespace(I(e),e.nestingLevel);)B(e);if("#"===I(e))for(;"\n"!==I(e)&&""!==I(e);)e.comment+=I(e),B(e);if(""!==I(e)){if("\n"===I(e)&&!e.nestingLevel)return e.tokenType=N,e.token=I(e),void B(e);var t=I(e),n=k(e,2),r=k(e,3);if(3===r.length&&T[r])return e.tokenType=N,e.token=r,B(e),B(e),void B(e);if(2===n.length&&T[n])return e.tokenType=N,e.token=n,B(e),void B(e);if(T[t])return e.tokenType=N,e.token=t,void B(e);if(x.isDigitDot(t)){if(e.tokenType=E,"."===I(e))e.token+=I(e),B(e),x.isDigit(I(e))||(e.tokenType=N);else{for(;x.isDigit(I(e));)e.token+=I(e),B(e);x.isDecimalMark(I(e),q(e))&&(e.token+=I(e),B(e))}for(;x.isDigit(I(e));)e.token+=I(e),B(e);if("E"===I(e)||"e"===I(e))if(x.isDigit(q(e))||"-"===q(e)||"+"===q(e)){if(e.token+=I(e),B(e),"+"!==I(e)&&"-"!==I(e)||(e.token+=I(e),B(e)),!x.isDigit(I(e)))throw pe(e,'Digit expected, got "'+I(e)+'"');for(;x.isDigit(I(e));)e.token+=I(e),B(e);if(x.isDecimalMark(I(e),q(e)))throw pe(e,'Digit expected, got "'+I(e)+'"')}else if("."===q(e))throw B(e),pe(e,'Digit expected, got "'+I(e)+'"')}else{if(!x.isAlpha(I(e),P(e),q(e))){for(e.tokenType=M;""!==I(e);)e.token+=I(e),B(e);throw pe(e,'Syntax error in part "'+e.token+'"')}for(;x.isAlpha(I(e),P(e),q(e))||x.isDigit(I(e));)e.token+=I(e),B(e);Y(O,e.token)?e.tokenType=N:e.tokenType=S}}else e.tokenType=N}function F(e){do{U(e)}while("\n"===e.token)}function L(e){e.nestingLevel++}function $(e){e.nestingLevel--}function H(e,t){var n={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w,nestingLevel:0,conditionalLevel:null};Jt(n,{expression:e,extraNodes:t}),U(n);var r=function(e){var t,n,r=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&((t=V(e)).comment=e.comment);for(;"\n"===e.token||";"===e.token;)0===r.length&&t&&(n=";"!==e.token,r.push({node:t,visible:n})),U(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&((t=V(e)).comment=e.comment,n=";"!==e.token,r.push({node:t,visible:n}));return r.length>0?new s(r):(t||((t=new l(void 0)).comment=e.comment),t)}(n);if(""!==n.token)throw n.tokenType===N?me(n,"Unexpected operator "+n.token):pe(n,'Unexpected part "'+n.token+'"');return r}function V(e){var t,n,r,i,a=function(e){var t=function(e){var t=W(e);for(;"or"===e.token;)F(e),t=new d("or","or",[t,W(e)]);return t}(e);for(;"?"===e.token;){var n=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,F(e);var r=t,i=V(e);if(":"!==e.token)throw pe(e,"False part of conditional expression expected");e.conditionalLevel=null,F(e);var a=V(e);t=new u(r,i,a),e.conditionalLevel=n}return t}(e);if("="===e.token){if(j(a))return t=a.name,F(e),r=V(e),new o(new v(t),r);if(A(a))return F(e),r=V(e),new o(a.object,a.index,r);if(D(a)&&j(a.fn)&&(i=!0,n=[],t=a.name,a.args.forEach((function(e,t){j(e)?n[t]=e.name:i=!1})),i))return F(e),r=V(e),new c(t,n,r);throw pe(e,"Invalid left hand side of assignment operator =")}return a}function W(e){for(var t=G(e);"xor"===e.token;)F(e),t=new d("xor","xor",[t,G(e)]);return t}function G(e){for(var t=Z(e);"and"===e.token;)F(e),t=new d("and","and",[t,Z(e)]);return t}function Z(e){for(var t=Q(e);"|"===e.token;)F(e),t=new d("|","bitOr",[t,Q(e)]);return t}function Q(e){for(var t=J(e);"^|"===e.token;)F(e),t=new d("^|","bitXor",[t,J(e)]);return t}function J(e){for(var t=X(e);"&"===e.token;)F(e),t=new d("&","bitAnd",[t,X(e)]);return t}function X(e){for(var t=[K(e)],n=[],r={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Y(r,e.token);){var i={name:e.token,fn:r[e.token]};n.push(i),F(e),t.push(K(e))}return 1===t.length?t[0]:2===t.length?new d(n[0].name,n[0].fn,t):new g(n.map((function(e){return e.fn})),t)}function K(e){var t,n,r,i;t=ee(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Y(a,e.token);)r=a[n=e.token],F(e),i=[t,ee(e)],t=new d(n,r,i);return t}function ee(e){var t,n,r,i;t=te(e);for(var a={to:"to",in:"to"};Y(a,e.token);)r=a[n=e.token],F(e),"in"===n&&""===e.token?t=new d("*","multiply",[t,new v("in")],!0):(i=[t,te(e)],t=new d(n,r,i));return t}function te(e){var t,n=[];if(t=":"===e.token?new l(1):ne(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(n.push(t);":"===e.token&&n.length<3;)F(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?n.push(new v("end")):n.push(ne(e));t=3===n.length?new y(n[0],n[2],n[1]):new y(n[0],n[1])}return t}function ne(e){var t,n,r,i;t=re(e);for(var a={"+":"add","-":"subtract"};Y(a,e.token);)r=a[n=e.token],F(e),i=[t,re(e)],t=new d(n,r,i);return t}function re(e){var t,n,r,i;n=t=ie(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};Y(a,e.token);)i=a[r=e.token],F(e),n=ie(e),t=new d(r,i,[t,n]);return t}function ie(e){var t,n;for(n=t=ae(e);e.tokenType===S||"in"===e.token&&z(t)||!(e.tokenType!==E||z(n)||R(n)&&"!"!==n.op)||"("===e.token;)n=ae(e),t=new d("*","multiply",[t,n],!0);return t}function ae(e){for(var t=oe(e),n=t,r=[];"/"===e.token&&z(n);){if(r.push(Jt({},e)),F(e),e.tokenType!==E){Jt(e,r.pop());break}if(r.push(Jt({},e)),F(e),e.tokenType!==S&&"("!==e.token){r.pop(),Jt(e,r.pop());break}Jt(e,r.pop()),r.pop(),n=oe(e),t=new d("/","divide",[t,n])}return t}function oe(e){var t,i,o,s={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Y(s,e.token)?(o=s[e.token],t=e.token,F(e),i=[oe(e)],new d(t,o,i)):function(e){var t,i,o,s;t=function(e){var t,i,o;t=function(e){var t=[];if(e.tokenType===S&&Y(e.extraNodes,e.token)){var i=e.extraNodes[e.token];if(U(e),"("===e.token){if(t=[],L(e),U(e),")"!==e.token)for(t.push(V(e));","===e.token;)U(e),t.push(V(e));if(")"!==e.token)throw pe(e,"Parenthesis ) expected");$(e),U(e)}return new i(t)}return function(e){var t,i;if(e.tokenType===S||e.tokenType===N&&e.token in O)return i=e.token,U(e),t=Y(C,i)?new l(C[i]):-1!==_.indexOf(i)?new l(n(i,"number")):new v(i),t=se(e,t);return function(e){var t,i;if('"'===e.token)return i=ue(e),t=new l(i),t=se(e,t);return function(e){var t,i;if("'"===e.token)return i=le(e),t=new l(i),t=se(e,t);return function(e){var t,i,o,s;if("["===e.token){if(L(e),U(e),"]"!==e.token){var u=ce(e);if(";"===e.token){for(o=1,i=[u];";"===e.token;)U(e),i[o]=ce(e),o++;if("]"!==e.token)throw pe(e,"End of matrix ] expected");$(e),U(e),s=i[0].items.length;for(var c=1;c<o;c++)if(i[c].items.length!==s)throw me(e,"Column dimensions mismatch ("+i[c].items.length+" !== "+s+")");t=new a(i)}else{if("]"!==e.token)throw pe(e,"End of matrix ] expected");$(e),U(e),t=u}}else $(e),U(e),t=new a([]);return se(e,t)}return function(e){if("{"===e.token){var t;L(e);var i={};do{if(U(e),"}"!==e.token){if('"'===e.token)t=ue(e);else if("'"===e.token)t=le(e);else{if(!(e.tokenType===S||e.tokenType===N&&e.token in O))throw pe(e,"Symbol or string expected as object key");t=e.token,U(e)}if(":"!==e.token)throw pe(e,"Colon : expected after object key");U(e),i[t]=V(e)}}while(","===e.token);if("}"!==e.token)throw pe(e,"Comma , or bracket } expected after object value");$(e),U(e);var a=new m(i);return a=se(e,a)}return function(e){var t;if(e.tokenType===E)return t=e.token,U(e),new l(n(t,r.number));return function(e){var t;if("("===e.token){if(L(e),U(e),t=V(e),")"!==e.token)throw pe(e,"Parenthesis ) expected");return $(e),U(e),t=new h(t),t=se(e,t)}return function(e){throw""===e.token?pe(e,"Unexpected end of expression"):pe(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);var s={"!":"factorial","'":"ctranspose"};for(;Y(s,e.token);)i=e.token,o=s[i],U(e),t=new d(i,o,[t]),t=se(e,t);return t}(e),("^"===e.token||".^"===e.token)&&(i=e.token,o="^"===i?"pow":"dotPow",F(e),s=[t,oe(e)],t=new d(i,o,s));return t}(e)}function se(e,t,n){for(var r;("("===e.token||"["===e.token||"."===e.token)&&(!n||-1!==n.indexOf(e.token));)if(r=[],"("===e.token){if(!j(t)&&!A(t))return t;if(L(e),U(e),")"!==e.token)for(r.push(V(e));","===e.token;)U(e),r.push(V(e));if(")"!==e.token)throw pe(e,"Parenthesis ) expected");$(e),U(e),t=new f(t,r)}else if("["===e.token){if(L(e),U(e),"]"!==e.token)for(r.push(V(e));","===e.token;)U(e),r.push(V(e));if("]"!==e.token)throw pe(e,"Parenthesis ] expected");$(e),U(e),t=new i(t,new p(r))}else{if(U(e),e.tokenType!==S)throw pe(e,"Property name expected after dot");r.push(new l(e.token)),U(e);t=new i(t,new p(r,!0))}return t}function ue(e){for(var t="";""!==I(e)&&'"'!==I(e);)"\\"===I(e)&&(t+=I(e),B(e)),t+=I(e),B(e);if(U(e),'"'!==e.token)throw pe(e,'End of string " expected');return U(e),JSON.parse('"'+t+'"')}function le(e){for(var t="";""!==I(e)&&"'"!==I(e);)"\\"===I(e)&&(t+=I(e),B(e)),t+=I(e),B(e);if(U(e),"'"!==e.token)throw pe(e,"End of string ' expected");return U(e),JSON.parse('"'+t+'"')}function ce(e){for(var t=[V(e)],n=1;","===e.token;)U(e),t[n]=V(e),n++;return new a(t)}function fe(e){return e.index-e.token.length+1}function pe(e,t){var n=fe(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}function me(e,t){var n=fe(e),r=new SyntaxError(t+" (char "+n+")");return r.char=n,r}return x.isAlpha=function(e,t,n){return x.isValidLatinOrGreek(e)||x.isValidMathSymbol(e,n)||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})),Kt=Ze("evaluate",["typed","parse"],(function(e){var t=e.typed,n=e.parse;return t("evaluate",{string:function(e){return n(e).compile().evaluate({})},"string, Object":function(e,t){return n(e).compile().evaluate(t)},"Array | Matrix":function(e){var t={};return Gt(e,(function(e){return n(e).compile().evaluate(t)}))},"Array | Matrix, Object":function(e,t){return Gt(e,(function(e){return n(e).compile().evaluate(t)}))}})})),en=Ze("Help",["parse"],(function(e){var t=e.parse;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){var e=this.doc||{},n="\n";if(e.name&&(n+="Name: "+e.name+"\n\n"),e.category&&(n+="Category: "+e.category+"\n\n"),e.description&&(n+="Description:\n    "+e.description+"\n\n"),e.syntax&&(n+="Syntax:\n    "+e.syntax.join("\n    ")+"\n\n"),e.examples){n+="Examples:\n";for(var r={},i=0;i<e.examples.length;i++){var a=e.examples[i];n+="    "+a+"\n";var o=void 0;try{o=t(a).compile().evaluate(r)}catch(s){o=s}void 0===o||b(o)||(n+="        "+Te(o,{precision:14})+"\n")}n+="\n"}return e.seealso&&e.seealso.length&&(n+="See also: "+e.seealso.join(", ")+"\n"),n},n.prototype.toJSON=function(){var e=V(this.doc);return e.mathjs="Help",e},n.fromJSON=function(e){var t={};return Object.keys(e).filter((function(e){return"mathjs"!==e})).forEach((function(n){t[n]=e[n]})),new n(t)},n.prototype.valueOf=n.prototype.toString,n}),{isClass:!0}),tn=Ze("compile",["typed","parse"],(function(e){var t=e.typed,n=e.parse;return t("compile",{string:function(e){return n(e).compile()},"Array | Matrix":function(e){return Gt(e,(function(e){return n(e).compile()}))}})})),nn=Ze("simplifyUtil",["FunctionNode","OperatorNode","SymbolNode"],(function(e){var t=e.FunctionNode,n=e.OperatorNode,r=e.SymbolNode,i={add:!0,multiply:!0},a={add:!0,multiply:!0};function o(e,t){if(!R(e))return!1;var n=e.fn.toString();return t&&Y(t,n)&&Y(t[n],"associative")?t[n].associative:a[n]||!1}function s(e){var t,n=[];return o(e)?(t=e.op,function e(r){for(var i=0;i<r.args.length;i++){var a=r.args[i];R(a)&&t===a.op?e(a):n.push(a)}}(e),n):e.args}function u(e){return R(e)?function(t){try{return new n(e.op,e.fn,t,e.implicit)}catch(r){return console.error(r),[]}}:function(n){return new t(new r(e.name),n)}}return{createMakeNodeFunction:u,isCommutative:function(e,t){if(!R(e))return!0;var n=e.fn.toString();return t&&Y(t,n)&&Y(t[n],"commutative")?t[n].commutative:i[n]||!1},isAssociative:o,flatten:function e(t){if(!t.args||0===t.args.length)return t;t.args=s(t);for(var n=0;n<t.args.length;n++)e(t.args[n])},allChildren:s,unflattenr:function e(t){if(t.args&&0!==t.args.length){for(var n=u(t),r=t.args.length,i=0;i<r;i++)e(t.args[i]);if(r>2&&o(t)){for(var a=t.args.pop();t.args.length>0;)a=n([t.args.pop(),a]);t.args=a.args}}},unflattenl:function e(t){if(t.args&&0!==t.args.length){for(var n=u(t),r=t.args.length,i=0;i<r;i++)e(t.args[i]);if(r>2&&o(t)){for(var a=t.args.shift();t.args.length>0;)a=n([a,t.args.shift()]);t.args=a.args}}}}})),rn=Ze("simplifyCore",["equal","isZero","add","subtract","multiply","divide","pow","ConstantNode","OperatorNode","FunctionNode","ParenthesisNode"],(function(e){var t=e.equal,n=e.isZero,r=e.add,i=e.subtract,a=e.multiply,o=e.divide,s=e.pow,u=e.ConstantNode,l=e.OperatorNode,c=e.FunctionNode,f=e.ParenthesisNode,p=new u(0),m=new u(1);return function e(d){if(R(d)&&d.isUnary()){var h=e(d.args[0]);if("+"===d.op)return h;if("-"===d.op){if(R(h)){if(h.isUnary()&&"-"===h.op)return h.args[0];if(h.isBinary()&&"subtract"===h.fn)return new l("-","subtract",[h.args[1],h.args[0]])}return new l(d.op,d.fn,[h])}}else if(R(d)&&d.isBinary()){var y=e(d.args[0]),g=e(d.args[1]);if("+"===d.op){if(z(y)){if(n(y.value))return g;if(z(g))return new u(r(y.value,g.value))}return z(g)&&n(g.value)?y:R(g)&&g.isUnary()&&"-"===g.op?new l("-","subtract",[y,g.args[0]]):new l(d.op,d.fn,g?[y,g]:[y])}if("-"===d.op){if(z(y)&&g){if(z(g))return new u(i(y.value,g.value));if(n(y.value))return new l("-","unaryMinus",[g])}if("subtract"===d.fn)return z(g)&&n(g.value)?y:R(g)&&g.isUnary()&&"-"===g.op?e(new l("+","add",[y,g.args[0]])):new l(d.op,d.fn,[y,g])}else{if("*"===d.op){if(z(y)){if(n(y.value))return p;if(t(y.value,1))return g;if(z(g))return new u(a(y.value,g.value))}if(z(g)){if(n(g.value))return p;if(t(g.value,1))return y;if(R(y)&&y.isBinary()&&y.op===d.op){var v=y.args[0];if(z(v)){var x=new u(a(v.value,g.value));return new l(d.op,d.fn,[x,y.args[1]],d.implicit)}}return new l(d.op,d.fn,[g,y],d.implicit)}return new l(d.op,d.fn,[y,g],d.implicit)}if("/"===d.op){if(z(y)){if(n(y.value))return p;if(z(g)&&(t(g.value,1)||t(g.value,2)||t(g.value,4)))return new u(o(y.value,g.value))}return new l(d.op,d.fn,[y,g])}if("^"===d.op){if(z(g)){if(n(g.value))return m;if(t(g.value,1))return y;if(z(y))return new u(s(y.value,g.value));if(R(y)&&y.isBinary()&&"^"===y.op){var b=y.args[1];if(z(b))return new l(d.op,d.fn,[y.args[0],new u(a(b.value,g.value))])}}return new l(d.op,d.fn,[y,g])}}}else{if(U(d)){var w=e(d.content);return U(w)||j(w)||z(w)?w:new f(w)}if(D(d)){var N=d.args.map(e).map((function(e){return U(e)?e.content:e}));return new c(e(d.fn),N)}}return d}}));function an(){throw new Error('No "bignumber" implementation available')}function on(){throw new Error('No "fraction" implementation available')}function sn(){throw new Error('No "matrix" implementation available')}var un=Ze("simplifyConstant",["typed","config","mathWithTransform","?fraction","?bignumber","ConstantNode","OperatorNode","FunctionNode","SymbolNode"],(function(e){var t=e.typed,n=e.config,r=e.mathWithTransform,i=e.fraction,a=e.bignumber,o=e.ConstantNode,s=e.OperatorNode,l=e.FunctionNode,c=e.SymbolNode,f=nn({FunctionNode:l,OperatorNode:s,SymbolNode:c}),p=f.isCommutative,m=f.isAssociative,d=f.allChildren,h=f.createMakeNodeFunction;function y(e,t,n){try{return x(r[e].apply(null,t),n)}catch(i){return t=t.map((function(e){return u(e)?e.valueOf():e})),x(r[e].apply(null,t),n)}}var g=t({Fraction:function(e){var t,n=e.s*e.n;t=n<0?new s("-","unaryMinus",[new o(-n)]):new o(n);if(1===e.d)return t;return new s("/","divide",[t,new o(e.d)])},number:function(e){return e<0?b(new o(-e)):new o(e)},BigNumber:function(e){return e<0?b(new o(-e)):new o(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")}});function v(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&i){var n=i(e);if(n.valueOf()===e)return n}return e}var x=t({"string, Object":function(e,t){return"BigNumber"===n.number?(void 0===a&&an(),a(e)):"Fraction"===n.number?(void 0===i&&on(),i(e)):v(parseFloat(e),t)},"Fraction, Object":function(e,t){return e},"BigNumber, Object":function(e,t){return e},"number, Object":function(e,t){return v(e,t)},"Complex, Object":function(e,t){return 0!==e.im?e:v(e.re,t)}});function b(e){return new s("-","unaryMinus",[e])}function w(e,t,n,r){return t.reduce((function(t,i){if(P(t)||P(i))P(t)?P(i)||(i=g(i)):t=g(t);else{try{return y(e,[t,i],r)}catch(a){}t=g(t),i=g(i)}return n([t,i])}))}return function(e,t){var n=function e(t,n){switch(t.type){case"SymbolNode":return t;case"ConstantNode":return"number"!==typeof t.value&&isNaN(t.value)?t:x(t.value,n);case"FunctionNode":if(r[t.name]&&r[t.name].rawArgs)return t;if(-1===["add","multiply"].indexOf(t.name)){var i=t.args.map((function(t){return e(t,n)}));if(!i.some(P))try{return y(t.name,i,n)}catch(b){}return i=i.map((function(e){return P(e)?e:g(e)})),new l(t.name,i)}case"OperatorNode":var a,o,s=t.fn.toString(),u=h(t);if(R(t)&&t.isUnary())a=[e(t.args[0],n)],o=P(a[0])?u(a):y(s,a,n);else if(m(t))if(a=(a=d(t)).map((function(t){return e(t,n)})),p(s)){for(var c=[],f=[],v=0;v<a.length;v++)P(a[v])?f.push(a[v]):c.push(a[v]);c.length>1?(o=w(s,c,u,n),f.unshift(o),o=w(s,f,u,n)):o=w(s,a,u,n)}else o=w(s,a,u,n);else a=t.args.map((function(t){return e(t,n)})),o=w(s,a,u,n);return o;case"ParenthesisNode":return e(t.content,n);case"AccessorNode":case"ArrayNode":case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"IndexNode":case"ObjectNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(t.type))}}(e,t);return P(n)?n:g(n)}})),ln=Ze("resolve",["parse","FunctionNode","OperatorNode","ParenthesisNode"],(function(e){var t=e.parse,n=e.FunctionNode,r=e.OperatorNode,i=e.ParenthesisNode;return function e(a,o){if(!o)return a;if(j(a)){var s=o[a.name];if(P(s))return e(s,o);if("number"===typeof s)return t(String(s))}else{if(R(a)){var u=a.args.map((function(t){return e(t,o)}));return new r(a.op,a.fn,u,a.implicit)}if(U(a))return new i(e(a.content,o));if(D(a)){var l=a.args.map((function(t){return e(t,o)}));return new n(a.name,l)}}return a}}));function cn(e){return(cn="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)}var fn=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","?fraction","?bignumber","mathWithTransform","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],pn=Ze("simplify",fn,(function(e){var t=e.config,n=e.typed,r=e.parse,i=e.add,a=e.subtract,o=e.multiply,s=e.divide,u=e.pow,l=e.isZero,c=e.equal,f=e.fraction,p=e.bignumber,m=e.mathWithTransform,d=e.ConstantNode,h=e.FunctionNode,y=e.OperatorNode,g=e.ParenthesisNode,v=e.SymbolNode,x=un({typed:n,config:t,mathWithTransform:m,fraction:f,bignumber:p,ConstantNode:d,OperatorNode:y,FunctionNode:h,SymbolNode:v}),b=rn({equal:c,isZero:l,add:i,subtract:a,multiply:o,divide:s,pow:u,ConstantNode:d,OperatorNode:y,FunctionNode:h,ParenthesisNode:g}),w=ln({parse:r,FunctionNode:h,OperatorNode:y,ParenthesisNode:g}),N=nn({FunctionNode:h,OperatorNode:y,SymbolNode:v}),E=N.isCommutative,S=N.isAssociative,M=N.flatten,T=N.unflattenr,A=N.unflattenl,O=N.createMakeNodeFunction,C=n("simplify",{string:function(e){return this(r(e),this.rules,{},{})},"string, Object":function(e,t){return this(r(e),this.rules,t,{})},"string, Object, Object":function(e,t,n){return this(r(e),this.rules,t,n)},"string, Array":function(e,t){return this(r(e),t,{},{})},"string, Array, Object":function(e,t,n){return this(r(e),t,n,{})},"string, Array, Object, Object":function(e,t,n,i){return this(r(e),t,n,i)},"Node, Object":function(e,t){return this(e,this.rules,t,{})},"Node, Object, Object":function(e,t,n){return this(e,this.rules,t,n)},Node:function(e){return this(e,this.rules,{},{})},"Node, Array":function(e,t){return this(e,t,{},{})},"Node, Array, Object":function(e,t,n){return this(e,t,n,{})},"Node, Array, Object, Object":function(e,t,n,i){t=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],a=void 0,o=cn(i);switch(o){case"string":var s=i.split("->");if(2!==s.length)throw SyntaxError("Could not parse rule: "+i);i={l:s[0],r:s[1]};case"object":if(a={l:_(r(i.l)),r:_(r(i.r))},i.context&&(a.evaluate=i.context),i.evaluate&&(a.evaluate=r(i.evaluate)),S(a.l)){var u=O(a.l),l=new v("_p"+I++);a.expanded={},a.expanded.l=u([a.l.clone(),l]),M(a.expanded.l),T(a.expanded.l),a.expanded.r=u([a.r,l])}break;case"function":a=i;break;default:throw TypeError("Unsupported type of rule: "+o)}t.push(a)}return t}(t);for(var a=w(e,n),o={},s=(a=_(a)).toString({parenthesis:"all"});!o[s];){o[s]=!0,I=0;for(var u=0;u<t.length;u++)"function"===typeof t[u]?a=t[u](a,i):(M(a),a=D(a,t[u])),A(a);s=a.toString({parenthesis:"all"})}return a}});function _(e){return e.transform((function(e,t,n){return U(e)?_(e.content):e}))}C.simplifyCore=b,C.resolve=w;var k={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};C.rules=[b,{l:"log(e)",r:"1"},{l:"n-n1",r:"n+-n1"},{l:"-(c*v)",r:"(-c) * v"},{l:"-v",r:"(-1) * v"},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{l:"(n ^ n1) ^ n2",r:"n ^ (n1 * n2)"},{l:"n*n",r:"n^2"},{l:"n * n^n1",r:"n^(n1+1)"},{l:"n^n1 * n^n2",r:"n^(n1+n2)"},{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},{l:"n1*n2 + n2",r:"(n1+1)*n2"},{l:"n1*n3 + n2*n3",r:"(n1+n2)*n3"},{l:"n1 + -1 * (n2 + n3)",r:"n1 + -1 * n2 + -1 * n3"},x,{l:"(-n)*n1",r:"-(n*n1)"},{l:"c+v",r:"v+c",context:{add:{commutative:!1}}},{l:"v*c",r:"c*v",context:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{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:"n-(n1+n2)",r:"n-n1-n2"},{l:"1*n",r:"n"},{l:"n1/(n2/n3)",r:"(n1*n3)/n2"}];var I=0;var D=n("applyRule",{"Node, Object":function(e,t){var n=e;if(n instanceof y||n instanceof h){if(n.args)for(var r=0;r<n.args.length;r++)n.args[r]=D(n.args[r],t)}else n instanceof g&&n.content&&(n.content=D(n.content,t));var i=t.r,a=q(t.l,n)[0];if(!a&&t.expanded&&(i=t.expanded.r,a=q(t.expanded.l,n)[0]),a){var o=n.implicit;n=i.clone(),o&&"implicit"in i&&(n.implicit=!0),n=n.transform((function(e){return e.isSymbolNode&&Y(a.placeholders,e.name)?a.placeholders[e.name].clone():e}))}return n}});function B(e,t){var n={placeholders:{}};if(!e.placeholders&&!t.placeholders)return n;if(!e.placeholders)return t;if(!t.placeholders)return e;for(var r in e.placeholders)if(Y(e.placeholders,r)&&(n.placeholders[r]=e.placeholders[r],Y(t.placeholders,r)&&!R(e.placeholders[r],t.placeholders[r])))return null;for(var i in t.placeholders)Y(t.placeholders,i)&&(n.placeholders[i]=t.placeholders[i]);return n}function P(e,t){var n,r=[];if(0===e.length||0===t.length)return r;for(var i=0;i<e.length;i++)for(var a=0;a<t.length;a++)(n=B(e[i],t[a]))&&r.push(n);return r}function q(e,t,n){var r=[{placeholders:{}}];if(e instanceof y&&t instanceof y||e instanceof h&&t instanceof h){if(e instanceof y){if(e.op!==t.op||e.fn!==t.fn)return[]}else if(e instanceof h&&e.name!==t.name)return[];if((1!==t.args.length||1!==e.args.length)&&S(t)&&!n){if(t.args.length>=2&&2===e.args.length){for(var i=function(e,t){var n,r,i=[],a=O(e);if(E(e,t))for(var o=0;o<e.args.length;o++)(r=e.args.slice(0)).splice(o,1),n=1===r.length?r[0]:a(r),i.push(a([e.args[o],n]));else n=1===(r=e.args.slice(1)).length?r[0]:a(r),i.push(a([e.args[0],n]));return i}(t,e.context),a=[],o=0;o<i.length;o++){var s=q(e,i[o],!0);a=a.concat(s)}return a}if(e.args.length>2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var u=[],l=0;l<e.args.length;l++){var f=q(e.args[l],t.args[l]);if(0===f.length)return[];u.push(f)}r=function(e){if(0===e.length)return e;for(var t=e.reduce(P),n=[],r={},i=0;i<t.length;i++){var a=JSON.stringify(t[i]);r[a]||(r[a]=!0,n.push(t[i]))}return n}(u)}else if(e instanceof v){if(0===e.name.length)throw new Error("Symbol in rule has 0 length...!?");if(k[e.name]){if(e.name!==t.name)return[]}else if("n"===e.name[0]||"_p"===e.name.substring(0,2))r[0].placeholders[e.name]=t;else if("v"===e.name[0]){if(z(t))return[];r[0].placeholders[e.name]=t}else{if("c"!==e.name[0])throw new Error("Invalid symbol in rule: "+e.name);if(!(t instanceof d))return[];r[0].placeholders[e.name]=t}}else{if(!(e instanceof d))return[];if(!c(e.value,t.value))return[]}return r}function R(e,t){if(e instanceof d&&t instanceof d){if(!c(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 y&&t instanceof y||e instanceof h&&t instanceof h))return!1;if(e instanceof y){if(e.op!==t.op||e.fn!==t.fn)return!1}else if(e instanceof h&&e.name!==t.name)return!1;if(e.args.length!==t.args.length)return!1;for(var n=0;n<e.args.length;n++)if(!R(e.args[n],t.args[n]))return!1}return!0}return C})),mn=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplify","?bignumber","?fraction","mathWithTransform","ConstantNode","OperatorNode","FunctionNode","SymbolNode","ParenthesisNode"],dn=Ze("rationalize",mn,(function(e){var t=e.config,n=e.typed,r=e.equal,i=e.isZero,a=e.add,o=e.subtract,s=e.multiply,u=e.divide,l=e.pow,c=e.parse,f=e.simplify,p=e.fraction,m=e.bignumber,d=e.mathWithTransform,h=e.ConstantNode,y=e.OperatorNode,g=e.FunctionNode,v=e.SymbolNode,x=e.ParenthesisNode,b=un({typed:n,config:t,mathWithTransform:d,fraction:p,bignumber:m,ConstantNode:h,OperatorNode:y,FunctionNode:g,SymbolNode:v}),w=rn({equal:r,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:l,ConstantNode:h,OperatorNode:y,FunctionNode:g,ParenthesisNode:x});return n("rationalize",{string:function(e){return this(c(e),{},!1)},"string, boolean":function(e,t){return this(c(e),{},t)},"string, Object":function(e,t){return this(c(e),t,!1)},"string, Object, boolean":function(e,t,n){return this(c(e),t,n)},Node:function(e){return this(e,{},!1)},"Node, boolean":function(e,t){return this(e,{},t)},"Node, Object":function(e,t){return this(e,t,!1)},"Node, Object, boolean":function(e,t,n){var r=function(){var e=[w,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},b,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],t=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],n=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],r={};return r.firstRules=e.concat(t,n),r.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)"}],r.sucDivRules=n,r.firstRulesAgain=e.concat(t),r.finalRules=[w,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},b,{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))"}],r}(),i=function(e,t,n,r){var i=[],a=f(e,r,t,{exactFractions:!1}),o="+-*"+((n=!!n)?"/":"");!function e(t){var n=t.type;if("FunctionNode"===n)throw new Error("There is an unsolved function call");if("OperatorNode"===n)if("^"===t.op){if("ConstantNode"!==t.args[1].type||!te(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===o.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var r=0;r<t.args.length;r++)e(t.args[r])}else if("SymbolNode"===n){var a=t.name;-1===i.indexOf(a)&&i.push(a)}else if("ParenthesisNode"===n)e(t.content);else if("ConstantNode"!==n)throw new Error("type "+n+" is not allowed in polynomial expression")}(a);var s={};return s.expression=a,s.variables=i,s}(e,t,!0,r.firstRules),a=i.variables.length;if(e=i.expression,a>=1){var o,s;e=function e(t,n,r){var i=t.type,a=arguments.length>1;if("OperatorNode"===i&&t.isBinary()){var o,s=!1;if("^"===t.op&&("ParenthesisNode"!==t.args[0].type&&"OperatorNode"!==t.args[0].type||"ConstantNode"!==t.args[1].type||(o=parseFloat(t.args[1].value),s=o>=2&&te(o))),s){if(o>2){var u=t.args[0],l=new y("^","pow",[t.args[0].cloneDeep(),new h(o-1)]);t=new y("*","multiply",[u,l])}else t=new y("*","multiply",[t.args[0],t.args[0].cloneDeep()]);a&&("content"===r?n.content=t:n.args[r]=t)}}if("ParenthesisNode"===i)e(t.content,t,"content");else if("ConstantNode"!==i&&"SymbolNode"!==i)for(var c=0;c<t.args.length;c++)e(t.args[c],t,c);if(!a)return t}(e);var u,l=!0,c=!1;for(e=f(e,r.firstRules,{},{exactFractions:!1});s=l?r.distrDivRules:r.sucDivRules,l=!l,(u=(e=f(e,s)).toString())!==o;)c=!0,o=u;c&&(e=f(e,r.firstRulesAgain,{},{exactFractions:!1})),e=f(e,r.finalRules,{},{exactFractions:!1})}var p=[],m={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===a&&(e.args[0]=N(e.args[0],p),e.args[1]=N(e.args[1])),n&&(m.numerator=e.args[0],m.denominator=e.args[1])):(1===a&&(e=N(e,p)),n&&(m.numerator=e,m.denominator=null)),n?(m.coefficients=p,m.variables=i.variables,m.expression=e,m):e}});function N(e,t){void 0===t&&(t=[]),t[0]=0;var n={cte:1,oper:"+",fire:""},r=0,i="";!function e(n,a,o){var s=n.type;if("FunctionNode"===s)throw new Error("There is an unsolved function call");if("OperatorNode"===s){if(-1==="+-*^".indexOf(n.op))throw new Error("Operator "+n.op+" invalid");if(null!==a){if(("unaryMinus"===n.fn||"pow"===n.fn)&&"add"!==a.fn&&"subtract"!==a.fn&&"multiply"!==a.fn)throw new Error("Invalid "+n.op+" placing");if(("subtract"===n.fn||"add"===n.fn||"multiply"===n.fn)&&"add"!==a.fn&&"subtract"!==a.fn)throw new Error("Invalid "+n.op+" placing");if(("subtract"===n.fn||"add"===n.fn||"unaryMinus"===n.fn)&&0!==o.noFil)throw new Error("Invalid "+n.op+" placing")}"^"!==n.op&&"*"!==n.op||(o.fire=n.op);for(var u=0;u<n.args.length;u++)"unaryMinus"===n.fn&&(o.oper="-"),"+"!==n.op&&"subtract"!==n.fn||(o.fire="",o.cte=1,o.oper=0===u?"+":n.op),o.noFil=u,e(n.args[u],n,o)}else if("SymbolNode"===s){if(n.name!==i&&""!==i)throw new Error("There is more than one variable");if(i=n.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"!==s)throw new Error("Type "+s+" is not allowed");var l=parseFloat(n.value);if(null===a)return void(t[0]=l);if("^"===a.op){if(1!==o.noFil)throw new Error("Constant cannot be powered");if(!te(l)||l<=0)throw new Error("Non-integer exponent is not allowed");for(var c=r+1;c<l;c++)t[c]=0;return l>r&&(t[l]=0),t[l]+=o.cte*("+"===o.oper?1:-1),void(r=Math.max(l,r))}o.cte=l,""===o.fire&&(t[0]+=o.cte*("+"===o.oper?1:-1))}}(e,null,n);for(var a,o=!0,s=r=t.length-1;s>=0;s--)if(0!==t[s]){var u=new h(o?t[s]:Math.abs(t[s])),l=t[s]<0?"-":"+";if(s>0){var c=new v(i);if(s>1){var f=new h(s);c=new y("^","pow",[c,f])}u=-1===t[s]&&o?new y("-","unaryMinus",[c]):1===Math.abs(t[s])?c:new y("*","multiply",[u,c])}a=o?u:"+"===l?new y("+","add",[a,u]):new y("-","subtract",[a,u]),o=!1}return o?new h(0):a}})),hn=["parse"],yn=Ze("Parser",hn,(function(e){var t=e.parse;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this.scope={}}return n.prototype.type="Parser",n.prototype.isParser=!0,n.prototype.evaluate=function(e){return t(e).compile().evaluate(this.scope)},n.prototype.get=function(e){return e in this.scope?ct(this.scope,e):void 0},n.prototype.getAll=function(){return G({},this.scope)},n.prototype.set=function(e,t){return ft(this.scope,e,t)},n.prototype.remove=function(e){delete this.scope[e]},n.prototype.clear=function(){for(var e in this.scope)Y(this.scope,e)&&delete this.scope[e]},n}),{isClass:!0}),gn={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"]},vn={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"]},xn={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(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],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:["[]","[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[0:2, 0:2] = ones(2, 2)"],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:vn,E:vn,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:gn,PI:gn,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:"Solves 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:["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"]},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:["derivative","parse","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:"Solves 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:["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)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)"],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)"],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([[1, 2], [3, 4]])"],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"]},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, number": f(x)=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([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(" + 4 + ")")'],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"]},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"]},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:["diff([1, 2, 4, 7, 0])","diff([1, 2, 4, 7, 0], 0)","diff(matrix([1, 2, 4, 7, 0]))","diff([[1, 2], [3, 4]])","diff([[1, 2], [3, 4]], 0)","diff([[1, 2], [3, 4]], 1)","diff([[1, 2], [3, 4]], bignumber(1))","diff(matrix([[1, 2], [3, 4]]), 1)","diff([[1, 2], matrix([3, 4])], 1)"],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:["forEach([1, 2, 3], function(val) { console.log(val) })"],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"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and eigenvectors of a real symmetric matrix",examples:["eigs([[5, 2.3], [2.3, 1]])"],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"]},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)'],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")',"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])"],seealso:["size","squeeze","resize"]},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"]},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","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"])',"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 a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",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]"],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"]},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:[]},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 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"]},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:[]},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, dim)"],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, dim)"],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, dim)"],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, 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)"],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, 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"]},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"]},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"]},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"]}},bn=Ze("help",["typed","mathWithTransform","Help"],(function(e){var t=e.typed,n=e.mathWithTransform,r=e.Help;return t("help",{any:function(e){var t,i=e;if("string"!==typeof e)for(t in n)if(Y(n,t)&&e===n[t]){i=t;break}var a=ct(xn,i);if(!a){var o="function"===typeof i?i.name:i;throw new Error('No documentation found on "'+o+'"')}return new r(a)}})})),wn=Ze("parser",["typed","Parser"],(function(e){var t=e.typed,n=e.Parser;return t("parser",{"":function(){return new n}})})),Nn=Ze("derivative",["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(function(e){var t=e.typed,n=e.config,r=e.parse,i=e.simplify,a=e.equal,o=e.isZero,s=e.numeric,u=e.ConstantNode,l=e.FunctionNode,c=e.OperatorNode,f=e.ParenthesisNode,p=e.SymbolNode,m=t("derivative",{"Node, SymbolNode, Object":function(e,t,n){var r={};h(r,e,t.name);var a=y(e,r);return n.simplify?i(a):a},"Node, SymbolNode":function(e,t){return this(e,t,{simplify:!0})},"string, SymbolNode":function(e,t){return this(r(e),t)},"string, SymbolNode, Object":function(e,t,n){return this(r(e),t,n)},"string, string":function(e,t){return this(r(e),r(t))},"string, string, Object":function(e,t,n){return this(r(e),r(t),n)},"Node, string":function(e,t){return this(e,r(t))},"Node, string, Object":function(e,t,n){return this(e,r(t),n)}});m._simplify=!0,m.toTex=function(e){return d.apply(null,e.args)};var d=t("_derivTex",{"Node, SymbolNode":function(e,t){return z(e)&&"string"===$(e.value)?d(r(e.value).toString(),t.toString(),1):d(e.toString(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===$(t.value))return d(e,r(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,n){return d(e.toString(),t.name,n.value)},"string, string, number":function(e,t,n){return(1===n?"{d\\over d"+t+"}":"{d^{"+n+"}\\over d"+t+"^{"+n+"}}")+"\\left[".concat(e,"\\right]")}}),h=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0,!0},"Object, SymbolNode, string":function(e,t,n){return t.name!==n&&(e[t]=!0,!0)},"Object, ParenthesisNode, string":function(e,t,n){return h(e,t.content,n)},"Object, FunctionAssignmentNode, string":function(e,t,n){return-1===t.params.indexOf(n)?(e[t]=!0,!0):h(e,t.expr,n)},"Object, FunctionNode | OperatorNode, string":function(e,t,n){if(t.args.length>0){for(var r=h(e,t.args[0],n),i=1;i<t.args.length;++i)r=h(e,t.args[i],n)&&r;if(r)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 f(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(1!==e.args.length&&function(e){if(("log"===e.name||"nthRoot"===e.name||"pow"===e.name)&&2===e.args.length)return;for(var t=0;t<e.args.length;++t)e.args[t]=g(0);throw e.compile().evaluate(),new Error("Expected TypeError, but none found")}(e),void 0!==t[e])return g(0);var n,r,i,a,o=e.args[0],s=!1,u=!1;switch(e.name){case"cbrt":s=!0,r=new c("*","multiply",[g(3),new c("^","pow",[o,new c("/","divide",[g(2),g(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,r=new c("*","multiply",[g(2),new l("sqrt",[o])]);else if(2===e.args.length)return t[n=new c("/","divide",[g(1),e.args[1]])]=t[e.args[1]],y(new c("^","pow",[o,n]),t);break;case"log10":n=g(10);case"log":if(n||1!==e.args.length){if(1===e.args.length&&n||2===e.args.length&&void 0!==t[e.args[1]])r=new c("*","multiply",[o.clone(),new l("log",[n||e.args[1]])]),s=!0;else if(2===e.args.length)return y(new c("/","divide",[new l("log",[o]),new l("log",[e.args[1]])]),t)}else r=o.clone(),s=!0;break;case"pow":return t[n]=t[e.args[1]],y(new c("^","pow",[o,e.args[1]]),t);case"exp":r=new l("exp",[o.clone()]);break;case"sin":r=new l("cos",[o.clone()]);break;case"cos":r=new c("-","unaryMinus",[new l("sin",[o.clone()])]);break;case"tan":r=new c("^","pow",[new l("sec",[o.clone()]),g(2)]);break;case"sec":r=new c("*","multiply",[e,new l("tan",[o.clone()])]);break;case"csc":u=!0,r=new c("*","multiply",[e,new l("cot",[o.clone()])]);break;case"cot":u=!0,r=new c("^","pow",[new l("csc",[o.clone()]),g(2)]);break;case"asin":s=!0,r=new l("sqrt",[new c("-","subtract",[g(1),new c("^","pow",[o.clone(),g(2)])])]);break;case"acos":s=!0,u=!0,r=new l("sqrt",[new c("-","subtract",[g(1),new c("^","pow",[o.clone(),g(2)])])]);break;case"atan":s=!0,r=new c("+","add",[new c("^","pow",[o.clone(),g(2)]),g(1)]);break;case"asec":s=!0,r=new c("*","multiply",[new l("abs",[o.clone()]),new l("sqrt",[new c("-","subtract",[new c("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acsc":s=!0,u=!0,r=new c("*","multiply",[new l("abs",[o.clone()]),new l("sqrt",[new c("-","subtract",[new c("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acot":s=!0,u=!0,r=new c("+","add",[new c("^","pow",[o.clone(),g(2)]),g(1)]);break;case"sinh":r=new l("cosh",[o.clone()]);break;case"cosh":r=new l("sinh",[o.clone()]);break;case"tanh":r=new c("^","pow",[new l("sech",[o.clone()]),g(2)]);break;case"sech":u=!0,r=new c("*","multiply",[e,new l("tanh",[o.clone()])]);break;case"csch":u=!0,r=new c("*","multiply",[e,new l("coth",[o.clone()])]);break;case"coth":u=!0,r=new c("^","pow",[new l("csch",[o.clone()]),g(2)]);break;case"asinh":s=!0,r=new l("sqrt",[new c("+","add",[new c("^","pow",[o.clone(),g(2)]),g(1)])]);break;case"acosh":s=!0,r=new l("sqrt",[new c("-","subtract",[new c("^","pow",[o.clone(),g(2)]),g(1)])]);break;case"atanh":s=!0,r=new c("-","subtract",[g(1),new c("^","pow",[o.clone(),g(2)])]);break;case"asech":s=!0,u=!0,r=new c("*","multiply",[o.clone(),new l("sqrt",[new c("-","subtract",[g(1),new c("^","pow",[o.clone(),g(2)])])])]);break;case"acsch":s=!0,u=!0,r=new c("*","multiply",[new l("abs",[o.clone()]),new l("sqrt",[new c("+","add",[new c("^","pow",[o.clone(),g(2)]),g(1)])])]);break;case"acoth":s=!0,u=!0,r=new c("-","subtract",[g(1),new c("^","pow",[o.clone(),g(2)])]);break;case"abs":r=new c("/","divide",[new l(new p("abs"),[o.clone()]),o.clone()]);break;case"gamma":default:throw new Error('Function "'+e.name+'" is not supported by derivative, or a wrong number of arguments is passed')}s?(i="/",a="divide"):(i="*",a="multiply");var f=y(o,t);return u&&(f=new c("-","unaryMinus",[f])),new c(i,a,[f,r])},"OperatorNode, Object":function(e,t){if(void 0!==t[e])return g(0);if("+"===e.op)return new c(e.op,e.fn,e.args.map((function(e){return y(e,t)})));if("-"===e.op){if(e.isUnary())return new c(e.op,e.fn,[y(e.args[0],t)]);if(e.isBinary())return new c(e.op,e.fn,[y(e.args[0],t),y(e.args[1],t)])}if("*"===e.op){var n=e.args.filter((function(e){return void 0!==t[e]}));if(n.length>0){var r=e.args.filter((function(e){return void 0===t[e]})),i=1===r.length?r[0]:new c("*","multiply",r),s=n.concat(y(i,t));return new c("*","multiply",s)}return new c("+","add",e.args.map((function(n){return new c("*","multiply",e.args.map((function(e){return e===n?y(e,t):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var u=e.args[0],f=e.args[1];return void 0!==t[f]?new c("/","divide",[y(u,t),f]):void 0!==t[u]?new c("*","multiply",[new c("-","unaryMinus",[u]),new c("/","divide",[y(f,t),new c("^","pow",[f.clone(),g(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[y(u,t),f.clone()]),new c("*","multiply",[u.clone(),y(f,t)])]),new c("^","pow",[f.clone(),g(2)])])}if("^"===e.op&&e.isBinary()){var p=e.args[0],m=e.args[1];if(void 0!==t[p])return z(p)&&(o(p.value)||a(p.value,1))?g(0):new c("*","multiply",[e,new c("*","multiply",[new l("log",[p.clone()]),y(m.clone(),t)])]);if(void 0!==t[m]){if(z(m)){if(o(m.value))return g(0);if(a(m.value,1))return y(p,t)}var d=new c("^","pow",[p.clone(),new c("-","subtract",[m,g(1)])]);return new c("*","multiply",[m.clone(),new c("*","multiply",[y(p,t),d])])}return new c("*","multiply",[new c("^","pow",[p.clone(),m.clone()]),new c("+","add",[new c("*","multiply",[y(p,t),new c("/","divide",[m.clone(),p.clone()])]),new c("*","multiply",[y(m,t),new l("log",[p.clone()])])])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function g(e,t){return new u(s(e,t||n.number))}return m})),En=Ze("apply",["typed","isInteger"],(function(e){var t=e.typed,n=e.isInteger;return t("apply",{"Array | Matrix, number | BigNumber, function":function(e,t,r){if(!n(t))throw new TypeError("Integer number expected for dimension");var i=Array.isArray(e)?ze(e):e.size();if(t<0||t>=i.length)throw new ke(t,i.length);return p(e)?e.create(Sn(e.valueOf(),t,r)):Sn(e,t,r)}})}));function Sn(e,t,n){var r,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){var t,n,r=e.length,i=e[0].length,a=[];for(n=0;n<i;n++){var o=[];for(t=0;t<r;t++)o.push(e[t][n]);a.push(o)}return a}(e),i=[],r=0;r<a.length;r++)i[r]=Sn(a[r],t-1,n);return i}return n(e)}for(i=[],r=0;r<e.length;r++)i[r]=Sn(e[r],t-1,n);return i}var Mn=Ze("apply",["typed","isInteger"],(function(e){var t=e.typed,n=e.isInteger,r=En({typed:t,isInteger:n});return t("apply",{"...any":function(e){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1));try{return r.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0});function Tn(e){return(Tn="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)}function An(e,t){return function n(){"object"!==Tn(n.cache)&&(n.cache={});for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=t?t(r):JSON.stringify(r);return a in n.cache||(n.cache[a]=e.apply(e,r)),n.cache[a]}}function On(e){return Object.keys(e.signatures||{}).reduce((function(e,t){var n=(t.match(/,/g)||[]).length+1;return Math.max(e,n)}),-1)}function Cn(e,t,n){var r=e.filter((function(e){return j(e)&&!(e.name in t)&&!(e.name in n)}))[0];if(!r)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=r.name,a=Object.create(n),o=e.compile();return function(e){return a[i]=e,o.evaluate(a)}}var _n=Ze("filter",["typed"],(function(e){var t=e.typed;function n(e,t,n){var i,a;return e[0]&&(i=e[0].compile().evaluate(n)),e[1]&&(a=j(e[1])||I(e[1])?e[1].compile().evaluate(n):Cn(e[1],t,n)),r(i,a)}n.rawArgs=!0;var r=t("filter",{"Array, function":kn,"Matrix, function":function(e,t){return e.create(kn(e.toArray(),t))},"Array, RegExp":$e,"Matrix, RegExp":function(e,t){return e.create($e(e.toArray(),t))}});return n}),{isTransformFunction:!0});function kn(e,t){var n=On(t);return Le(e,(function(e,r,i){return 1===n?t(e):2===n?t(e,[r+1]):t(e,[r+1],i)}))}var zn=Ze("map",["typed"],(function(e){var t=e.typed;function n(e,t,n){var i,a;return e[0]&&(i=e[0].compile().evaluate(n)),e[1]&&(a=j(e[1])||I(e[1])?e[1].compile().evaluate(n):Cn(e[1],t,n)),r(i,a)}n.rawArgs=!0;var r=t("map",{"Array, function":function(e,t){return In(e,t,e)},"Matrix, function":function(e,t){return e.create(In(e.valueOf(),t,e))}});return n}),{isTransformFunction:!0});function In(e,t,n){var r=On(t);return function e(i,a){return Array.isArray(i)?Fe(i,(function(t,n){return e(t,a.concat(n+1))})):1===r?t(i):2===r?t(i,a):t(i,a,n)}(e,[])}var Dn=Ze("forEach",["typed"],(function(e){var t=e.typed;function n(e,t,n){var i,a;return e[0]&&(i=e[0].compile().evaluate(n)),e[1]&&(a=j(e[1])||I(e[1])?e[1].compile().evaluate(n):Cn(e[1],t,n)),r(i,a)}n.rawArgs=!0;var r=t("forEach",{"Array | Matrix, function":function(e,t){var n=On(t);!function r(i,a){Array.isArray(i)?je(i,(function(e,t){r(e,a.concat(t+1))})):1===n?t(i):2===n?t(i,a):t(i,a,e)}(e.valueOf(),[])}});return n}),{isTransformFunction:!0}),Bn=Ze("subset",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix;return t("subset",{"Array, Index":function(e,t){var r=n(e).subset(t);return t.isScalar()?r:r.valueOf()},"Matrix, Index":function(e,t){return e.subset(t)},"Object, Index":Rn,"string, Index":Pn,"Array, Index, any":function(e,t,r){return n(V(e)).subset(t,r,void 0).valueOf()},"Array, Index, any, any":function(e,t,r,i){return n(V(e)).subset(t,r,i).valueOf()},"Matrix, Index, any":function(e,t,n){return e.clone().subset(t,n)},"Matrix, Index, any, any":function(e,t,n,r){return e.clone().subset(t,n,r)},"string, Index, string":qn,"string, Index, string, string":qn,"Object, Index, any":Un})}));function Pn(e,t){if(!g(t))throw new TypeError("Index expected");if(1!==t.size().length)throw new _e(t.size().length,1);var n=e.length;De(t.min()[0],n),De(t.max()[0],n);var r=t.dimension(0),i="";return r.forEach((function(t){i+=e.charAt(t)})),i}function qn(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(1!==t.size().length)throw new _e(t.size().length,1);if(void 0!==r){if("string"!==typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";var i=t.dimension(0);if(i.size()[0]!==n.length)throw new _e(i.size()[0],n.length);var a=e.length;De(t.min()[0]),De(t.max()[0]);for(var o=[],s=0;s<a;s++)o[s]=e.charAt(s);if(i.forEach((function(e,t){o[e]=n.charAt(t[0])})),o.length>a)for(var u=a-1,l=o.length;u<l;u++)o[u]||(o[u]=r);return o.join("")}function Rn(e,t){if(1!==t.size().length)throw new _e(t.size(),1);var n=t.dimension(0);if("string"!==typeof n)throw new TypeError("String expected as index to retrieve an object property");return ct(e,n)}function Un(e,t,n){if(1!==t.size().length)throw new _e(t.size(),1);var r=t.dimension(0);if("string"!==typeof r)throw new TypeError("String expected as index to retrieve an object property");var i=V(e);return ft(i,r,n),i}var Fn=Ze("subset",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix,r=Bn({typed:t,matrix:n});return t("subset",{"...any":function(e){try{return r.apply(null,e)}catch(t){throw zt(t)}}})}),{isTransformFunction:!0}),jn=Ze("index",["Index"],(function(e){var t=e.Index;return function(){for(var e=[],n=0,r=arguments.length;n<r;n++){var i=arguments[n];if(y(i))i.start--,i.end-=i.step>0?0:2;else if(i&&!0===i.isSet)i=i.map((function(e){return e-1}));else if(f(i)||p(i))i=i.map((function(e){return e-1}));else if(a(i))i--;else if(o(i))i=i.toNumber()-1;else if("string"!==typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[n]=i}var s=new t;return t.apply(s,e),s}}),{isTransformFunction:!0}),Ln=Ze("concat",["typed","matrix","isInteger"],(function(e){var t=e.typed,n=e.matrix,r=e.isInteger;return t("concat",{"...Array | Matrix | number | BigNumber":function(e){var t,i,s=e.length,u=-1,l=!1,c=[];for(t=0;t<s;t++){var f=e[t];if(p(f)&&(l=!0),a(f)||o(f)){if(t!==s-1)throw new Error("Dimension must be specified as last argument");if(i=u,u=f.valueOf(),!r(u))throw new TypeError("Integer number expected for dimension");if(u<0||t>0&&u>i)throw new ke(u,i+1)}else{var m=V(f).valueOf(),d=ze(m);if(c[t]=m,i=u,u=d.length-1,t>0&&u!==i)throw new _e(i+1,u+1)}}if(0===c.length)throw new SyntaxError("At least one matrix expected");for(var h=c.shift();c.length;)h=$n(h,c.shift(),u,0);return l?n(h):h},"...string":function(e){return e.join("")}})}));function $n(e,t,n,r){if(r<n){if(e.length!==t.length)throw new _e(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=$n(e[a],t[a],n,r+1);return i}return e.concat(t)}var Hn=Ze("concat",["typed","matrix","isInteger"],(function(e){var t=e.typed,n=e.matrix,r=e.isInteger,i=Ln({typed:t,matrix:n,isInteger:r});return t("concat",{"...any":function(e){var t=e.length-1,n=e[t];a(n)?e[t]=n-1:o(n)&&(e[t]=n.minus(1));try{return i.apply(null,e)}catch(r){throw zt(r)}}})}),{isTransformFunction:!0});function Vn(e,t,n){var r;return-1!==String(e).indexOf("Unexpected type")?(r=arguments.length>2?" (type: "+$(n)+", value: "+JSON.stringify(n)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+t+", unexpected type of argument"+r)):-1!==String(e).indexOf("complex numbers")?(r=arguments.length>2?" (type: "+$(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+t+", no ordering relation is defined for complex numbers"+r)):e}var Wn=Ze("max",["typed","config","numeric","larger"],(function(e){var t=e.typed,n=e.config,r=e.numeric,i=e.larger;return t("max",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Zt(e,t.valueOf(),a)},"...":function(e){if(Vt(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(n){throw Vn(n,"max",t)}}function o(e){var t;if(Wt(e,(function(e){try{isNaN(e)&&"number"===typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(n){throw Vn(n,"max",e)}})),void 0===t)throw new Error("Cannot calculate max of an empty array");return"string"===typeof t&&(t=r(t,n.number)),t}})),Gn=Ze("max",["typed","config","numeric","larger"],(function(e){var t=e.typed,n=e.config,r=e.numeric,i=e.larger,s=Wn({typed:t,config:n,numeric:r,larger:i});return t("max",{"...any":function(e){if(2===e.length&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return s.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),Zn=Ze("min",["typed","config","numeric","smaller"],(function(e){var t=e.typed,n=e.config,r=e.numeric,i=e.smaller;return t("min",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){return Zt(e,t.valueOf(),a)},"...":function(e){if(Vt(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(n){throw Vn(n,"min",t)}}function o(e){var t;if(Wt(e,(function(e){try{isNaN(e)&&"number"===typeof e?t=NaN:(void 0===t||i(e,t))&&(t=e)}catch(n){throw Vn(n,"min",e)}})),void 0===t)throw new Error("Cannot calculate min of an empty array");return"string"===typeof t&&(t=r(t,n.number)),t}})),Yn=Ze("min",["typed","config","numeric","smaller"],(function(e){var t=e.typed,n=e.config,r=e.numeric,i=e.smaller,s=Zn({typed:t,config:n,numeric:r,smaller:i});return t("min",{"...any":function(e){if(2===e.length&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return s.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),Qn=Ze("sum",["typed","config","add","numeric"],(function(e){var t=e.typed,n=e.config,r=e.add,i=e.numeric;return t("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,t){try{return Zt(e,t,r)}catch(n){throw Vn(n,"sum")}},"...":function(e){if(Vt(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var t;return Wt(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(n){throw Vn(n,"sum",e)}})),void 0===t&&(t=i(0,n.number)),"string"===typeof t&&(t=i(t,n.number)),t}})),Jn=Ze("sum",["typed","config","add","numeric"],(function(e){var t=e.typed,n=e.config,r=e.add,i=e.numeric,s=Qn({typed:t,config:n,add:r,numeric:i});return t("sum",{"...any":function(e){if(2===e.length&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return s.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),Xn=Ze("column",["typed","Index","matrix","range"],(function(e){var t=e.typed,n=e.Index,r=e.matrix,i=e.range;return t("column",{"Matrix, number":a,"Array, number":function(e,t){return a(r(V(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");De(t,e.size()[1]);var r=i(0,e.size()[0]),a=new n(r,t);return e.subset(a)}})),Kn=Ze("column",["typed","Index","matrix","range"],(function(e){var t=e.typed,n=e.Index,r=e.matrix,i=e.range,o=Xn({typed:t,Index:n,matrix:r,range:i});return t("column",{"...any":function(e){var t=e.length-1,n=e[t];a(n)&&(e[t]=n-1);try{return o.apply(null,e)}catch(r){throw zt(r)}}})}),{isTransformFunction:!0}),er=Ze("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,s=e.larger,u=e.largerEq;return t("range",{string:c,"string, boolean":c,"number, number":function(e,t){return l(f(e,t,1))},"number, number, number":function(e,t,n){return l(f(e,t,n))},"number, number, boolean":function(e,t,n){return l(n?p(e,t,1):f(e,t,1))},"number, number, number, boolean":function(e,t,n,r){return l(r?p(e,t,n):f(e,t,n))},"BigNumber, BigNumber":function(e,t){return l(m(e,t,new(0,e.constructor)(1)))},"BigNumber, BigNumber, BigNumber":function(e,t,n){return l(m(e,t,n))},"BigNumber, BigNumber, boolean":function(e,t,n){var r=e.constructor;return l(n?d(e,t,new r(1)):m(e,t,new r(1)))},"BigNumber, BigNumber, BigNumber, boolean":function(e,t,n,r){return l(r?d(e,t,n):m(e,t,n))}});function l(e){return"Matrix"===n.matrix?r?r(e):sn():e}function c(e,t){var r=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(!r)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===n.number?(void 0===i&&an(),l((t?d:m)(i(r.start),i(r.end),i(r.step)))):l((t?p:f)(r.start,r.end,r.step))}function f(e,t,n){var r=[],i=e;if(n>0)for(;a(i,t);)r.push(i),i+=n;else if(n<0)for(;s(i,t);)r.push(i),i+=n;return r}function p(e,t,n){var r=[],i=e;if(n>0)for(;o(i,t);)r.push(i),i+=n;else if(n<0)for(;u(i,t);)r.push(i),i+=n;return r}function m(e,t,n){var r=i(0),o=[],u=e;if(n.gt(r))for(;a(u,t);)o.push(u),u=u.plus(n);else if(n.lt(r))for(;s(u,t);)o.push(u),u=u.plus(n);return o}function d(e,t,n){var r=i(0),a=[],s=e;if(n.gt(r))for(;o(s,t);)a.push(s),s=s.plus(n);else if(n.lt(r))for(;u(s,t);)a.push(s),s=s.plus(n);return a}})),tr=Ze("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.bignumber,a=e.smaller,o=e.smallerEq,s=e.larger,u=e.largerEq,l=er({typed:t,config:n,matrix:r,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u});return t("range",{"...any":function(e){return"boolean"!==typeof e[e.length-1]&&e.push(!0),l.apply(null,e)}})}),{isTransformFunction:!0}),nr=Ze("diff",["typed","matrix","subtract","number"],(function(e){var t=e.typed,n=e.matrix,r=e.subtract,i=e.number;return t("diff",{"Array | Matrix":function(e){return p(e)?n(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,t){if(!te(t))throw new RangeError("Dimension must be a whole number");return p(e)?n(a(e.toArray(),t)):a(e,t)},"Array | Matrix, BigNumber":function(e,t){return this(e,i(t))}});function a(e,t){if(p(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(t>0){var n=[];return e.forEach((function(e){n.push(a(e,t-1))})),n}if(0===t)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){var t=[],n=e.length;if(n<2)return e;for(var r=1;r<n;r++)t.push(s(e[r-1],e[r]));return t}function s(e,t){p(e)&&(e=e.toArray()),p(t)&&(t=t.toArray());var n=Array.isArray(e),i=Array.isArray(t);if(n&&i)return function(e,t){if(e.length!==t.length)throw RangeError("Not all sub-arrays have the same length");for(var n=[],r=e.length,i=0;i<r;i++)n.push(s(e[i],t[i]));return n}(e,t);if(!n&&!i)return r(t,e);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}})),rr=Ze("diff",["typed","matrix","subtract","number","bignumber"],(function(e){var t=e.typed,n=e.matrix,r=e.subtract,i=e.number,s=e.bignumber,u=nr({typed:t,matrix:n,subtract:r,number:i,bignumber:s});return t("diff",{"...any":function(e){if(2===e.length&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return u.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),ir=Ze("row",["typed","Index","matrix","range"],(function(e){var t=e.typed,n=e.Index,r=e.matrix,i=e.range;return t("row",{"Matrix, number":a,"Array, number":function(e,t){return a(r(V(e)),t).valueOf()}});function a(e,t){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");De(t,e.size()[0]);var r=i(0,e.size()[1]),a=new n(t,r);return e.subset(a)}})),ar=Ze("row",["typed","Index","matrix","range"],(function(e){var t=e.typed,n=e.Index,r=e.matrix,i=e.range,o=ir({typed:t,Index:n,matrix:r,range:i});return t("row",{"...any":function(e){var t=e.length-1,n=e[t];a(n)&&(e[t]=n-1);try{return o.apply(null,e)}catch(r){throw zt(r)}}})}),{isTransformFunction:!0}),or=Ze("mean",["typed","add","divide"],(function(e){var t=e.typed,n=e.add,r=e.divide;return t("mean",{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,t){try{var i=Zt(e,t,n),a=Array.isArray(e)?ze(e):e.size();return r(i,a[t])}catch(o){throw Vn(o,"mean")}},"...":function(e){if(Vt(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){var t,i=0;if(Wt(e,(function(e){try{t=void 0===t?e:n(t,e),i++}catch(r){throw Vn(r,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return r(t,i)}})),sr=Ze("mean",["typed","add","divide"],(function(e){var t=e.typed,n=e.add,r=e.divide,i=or({typed:t,add:n,divide:r});return t("mean",{"...any":function(e){if(2===e.length&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),ur=Ze("variance",["typed","add","subtract","multiply","divide","apply","isNaN"],(function(e){var t=e.typed,n=e.add,r=e.subtract,i=e.multiply,a=e.divide,s=e.apply,u=e.isNaN;return t("variance",{"Array | Matrix":function(e){return l(e,"unbiased")},"Array | Matrix, string":l,"Array | Matrix, number | BigNumber":function(e,t){return c(e,t,"unbiased")},"Array | Matrix, number | BigNumber, string":c,"...":function(e){return l(e,"unbiased")}});function l(e,t){var s=0,l=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Wt(e,(function(e){try{s=n(s,e),l++}catch(t){throw Vn(t,"variance",e)}})),0===l)throw new Error("Cannot calculate variance of an empty array");var c=a(s,l);if(s=0,Wt(e,(function(e){var t=r(e,c);s=n(s,i(t,t))})),u(s))return s;switch(t){case"uncorrected":return a(s,l);case"biased":return a(s,l+1);case"unbiased":var f=o(s)?s.mul(0):0;return 1===l?f:a(s,l-1);default:throw new Error('Unknown normalization "'+t+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function c(e,t,n){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return s(e,t,(function(e){return l(e,n)}))}catch(r){throw Vn(r,"variance")}}})),lr=Ze("variance",["typed","add","subtract","multiply","divide","apply","isNaN"],(function(e){var t=e.typed,n=e.add,r=e.subtract,i=e.multiply,s=e.divide,u=e.apply,l=e.isNaN,c=ur({typed:t,add:n,subtract:r,multiply:i,divide:s,apply:u,isNaN:l});return t("variance",{"...any":function(e){if(e.length>=2&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return c.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),cr=Ze("std",["typed","sqrt","variance"],(function(e){var t=e.typed,n=e.sqrt,r=e.variance;return t("std",{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(e){return i(e)}});function i(e,t){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{return n(r.apply(null,arguments))}catch(i){throw i instanceof TypeError&&-1!==i.message.indexOf(" variance")?new TypeError(i.message.replace(" variance"," std")):i}}})),fr=Ze("std",["typed","sqrt","variance"],(function(e){var t=e.typed,n=e.sqrt,r=e.variance,i=cr({typed:t,sqrt:n,variance:r});return t("std",{"...any":function(e){if(e.length>=2&&m(e[0])){var t=e[1];a(t)?e[1]=t-1:o(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(n){throw zt(n)}}})}),{isTransformFunction:!0}),pr=Ze("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}),mr=n(2),dr=n.n(mr);function hr(e){return(hr="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)}var yr=Ze("Complex",[],(function(){return dr.a.prototype.type="Complex",dr.a.prototype.isComplex=!0,dr.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},dr.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},dr.a.prototype.format=function(e){var t=this.im,n=this.re,r=ue(this.re,e),i=ue(this.im,e),o=a(e)?e:e?e.precision:null;if(null!==o){var s=Math.pow(10,-o);Math.abs(n/t)<s&&(n=0),Math.abs(t/n)<s&&(t=0)}return 0===t?r:0===n?1===t?"i":-1===t?"-i":i+"i":t<0?-1===t?r+" - i":r+" - "+i.substring(1)+"i":1===t?r+" + i":r+" + "+i+"i"},dr.a.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"===hr(t))return dr()(t);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var n=arguments[0],r=arguments[1];if(a(n)){if(l(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),a(r))return new dr.a({r:n,phi:r});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")}},dr.a.prototype.valueOf=dr.a.prototype.toString,dr.a.fromJSON=function(e){return new dr.a(e)},dr.a.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},dr.a}),{isClass:!0}),gr=Ze("Range",[],(function(){function e(t,n,r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=null!==t&&void 0!==t,a=null!==n&&void 0!==n,s=null!==r&&void 0!==r;if(i)if(o(t))t=t.toNumber();else if("number"!==typeof t)throw new TypeError("Parameter start must be a number");if(a)if(o(n))n=n.toNumber();else if("number"!==typeof n)throw new TypeError("Parameter end must be a number");if(s)if(o(r))r=r.toNumber();else if("number"!==typeof r)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(t):0,this.end=a?parseFloat(n):0,this.step=s?parseFloat(r):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(t){if("string"!==typeof t)return null;var n=t.split(":").map((function(e){return parseFloat(e)}));if(n.some((function(e){return isNaN(e)})))return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var e=0,t=this.start,n=this.step,r=this.end-t;return ne(n)===ne(r)?e=Math.ceil(r/n):0===r&&(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,n=this.step,r=this.end,i=0;if(n>0)for(;t<r;)e(t,[i],this),t+=n,i++;else if(n<0)for(;t>r;)e(t,[i],this),t+=n,i++},e.prototype.map=function(e){var t=[];return this.forEach((function(n,r,i){t[r[0]]=e(n,r,i)})),t},e.prototype.toArray=function(){var e=[];return this.forEach((function(t,n){e[n[0]]=t})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var t=ue(this.start,e);return 1!==this.step&&(t+=":"+ue(this.step,e)),t+=":"+ue(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}),vr=An((function(e){return new e(1).exp()}),Nr),xr=An((function(e){return new e(1).plus(new e(5).sqrt()).div(2)}),Nr),br=An((function(e){return e.acos(-1)}),Nr),wr=An((function(e){return br(e).times(2)}),Nr);function Nr(e){return e[0].precision}var Er=Math.PI,Sr=2*Math.PI,Mr=Math.E,Tr=Ze("true",[],(function(){return!0})),Ar=Ze("false",[],(function(){return!1})),Or=Ze("null",[],(function(){return null})),Cr=$r("Infinity",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(1/0):1/0})),_r=$r("NaN",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(NaN):NaN})),kr=$r("pi",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?br(n):Er})),zr=$r("tau",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?wr(n):Sr})),Ir=$r("e",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?vr(n):Mr})),Dr=$r("phi",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?xr(n):1.618033988749895})),Br=$r("LN2",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(2).ln():Math.LN2})),Pr=$r("LN10",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(10).ln():Math.LN10})),qr=$r("LOG2E",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(1).div(new n(2).ln()):Math.LOG2E})),Rr=$r("LOG10E",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(1).div(new n(10).ln()):Math.LOG10E})),Ur=$r("SQRT1_2",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n("0.5").sqrt():Math.SQRT1_2})),Fr=$r("SQRT2",["config","?BigNumber"],(function(e){var t=e.config,n=e.BigNumber;return"BigNumber"===t.number?new n(2).sqrt():Math.SQRT2})),jr=$r("i",["Complex"],(function(e){return e.Complex.I})),Lr=Ze("version",[],(function(){return"7.2.0"}));function $r(e,t,n){return Ze(e,t,n,{recreateOnConfigChange:!0})}var Hr=n(11),Vr=n.n(Hr),Wr=Ze("BigNumber",["?on","config"],(function(e){var t=e.on,n=e.config,r=Vr.a.clone({precision:n.precision});return r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t("config",(function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})})),r}),{isClass:!0}),Gr=Ze("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,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype.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}),Zr=Ze("replacer",[],(function(){return function(e,t){return"number"!==typeof t||isFinite(t)&&!isNaN(t)?t:{mathjs:"number",value:String(t)}}})),Yr=Vi("speedOfLight","299792458","m s^-1"),Qr=Vi("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Jr=Vi("planckConstant","6.62607015e-34","J s"),Xr=Vi("reducedPlanckConstant","1.0545718176461565e-34","J s"),Kr=Vi("magneticConstant","1.25663706212e-6","N A^-2"),ei=Vi("electricConstant","8.8541878128e-12","F m^-1"),ti=Vi("vacuumImpedance","376.730313667","ohm"),ni=Vi("coulomb","8.987551792261171e9","N m^2 C^-2"),ri=Vi("elementaryCharge","1.602176634e-19","C"),ii=Vi("bohrMagneton","9.2740100783e-24","J T^-1"),ai=Vi("conductanceQuantum","7.748091729863649e-5","S"),oi=Vi("inverseConductanceQuantum","12906.403729652257","ohm"),si=Vi("magneticFluxQuantum","2.0678338484619295e-15","Wb"),ui=Vi("nuclearMagneton","5.0507837461e-27","J T^-1"),li=Vi("klitzing","25812.807459304513","ohm"),ci=Vi("bohrRadius","5.29177210903e-11","m"),fi=Vi("classicalElectronRadius","2.8179403262e-15","m"),pi=Vi("electronMass","9.1093837015e-31","kg"),mi=Vi("fermiCoupling","1.1663787e-5","GeV^-2"),di=Wi("fineStructure",.0072973525693),hi=Vi("hartreeEnergy","4.3597447222071e-18","J"),yi=Vi("protonMass","1.67262192369e-27","kg"),gi=Vi("deuteronMass","3.3435830926e-27","kg"),vi=Vi("neutronMass","1.6749271613e-27","kg"),xi=Vi("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),bi=Vi("rydberg","10973731.568160","m^-1"),wi=Vi("thomsonCrossSection","6.6524587321e-29","m^2"),Ni=Wi("weakMixingAngle",.2229),Ei=Wi("efimovFactor",22.7),Si=Vi("atomicMass","1.66053906660e-27","kg"),Mi=Vi("avogadro","6.02214076e23","mol^-1"),Ti=Vi("boltzmann","1.380649e-23","J K^-1"),Ai=Vi("faraday","96485.33212331001","C mol^-1"),Oi=Vi("firstRadiation","3.7417718521927573e-16","W m^2"),Ci=Vi("loschmidt","2.686780111798444e25","m^-3"),_i=Vi("gasConstant","8.31446261815324","J K^-1 mol^-1"),ki=Vi("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),zi=Vi("molarVolume","0.022413969545014137","m^3 mol^-1"),Ii=Wi("sackurTetrode",-1.16487052358),Di=Vi("secondRadiation","0.014387768775039337","m K"),Bi=Vi("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Pi=Vi("wienDisplacement","2.897771955e-3","m K"),qi=Vi("molarMass","0.99999999965e-3","kg mol^-1"),Ri=Vi("molarMassC12","11.9999999958e-3","kg mol^-1"),Ui=Vi("gravity","9.80665","m s^-2"),Fi=Vi("planckLength","1.616255e-35","m"),ji=Vi("planckMass","2.176435e-8","kg"),Li=Vi("planckTime","5.391245e-44","s"),$i=Vi("planckCharge","1.87554603778e-18","C"),Hi=Vi("planckTemperature","1.416785e+32","K");function Vi(e,t,n){return Ze(e,["config","Unit","BigNumber"],(function(e){var r=e.config,i=e.Unit,a=e.BigNumber,o=new i("BigNumber"===r.number?new a(t):parseFloat(t),n);return o.fixPrefix=!0,o}))}function Wi(e,t){return Ze(e,["config","BigNumber"],(function(e){var n=e.config,r=e.BigNumber;return"BigNumber"===n.number?new r(t):t}))}var Gi=n(3),Zi=n.n(Gi),Yi=Ze("Fraction",[],(function(){return Zi.a.prototype.type="Fraction",Zi.a.prototype.isFraction=!0,Zi.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Zi.a.fromJSON=function(e){return new Zi.a(e)},Zi.a}),{isClass:!0}),Qi=Ze("DenseMatrix",["Matrix"],(function(e){var t=e.Matrix;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(p(e))"DenseMatrix"===e.type?(this._data=V(e._data),this._size=V(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,Ie(this._data,this._size),this._datatype=t||e.datatype;else if(f(e))this._data=function e(t){for(var n=0,r=t.length;n<r;n++){var i=t[n];f(i)?t[n]=e(i):i&&!0===i.isMatrix&&(t[n]=e(i.valueOf()))}return t}(e),this._size=ze(this._data),Ie(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+$(e)+")");this._data=[],this._size=[0],this._datatype=t}}function r(e,t){if(!g(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r=t.size();if(r.length!==e._size.length)throw new _e(r.length,e._size.length);for(var i=t.min(),a=t.max(),o=0,s=e._size.length;o<s;o++)De(i[o],e._size[o]),De(a[o],e._size[o]);return new n(function e(t,n,r,i){var a=i===r-1,o=n.dimension(i);return a?o.map((function(e){return De(e,t.length),t[e]})).valueOf():o.map((function(a){De(a,t.length);var o=t[a];return e(o,n,r,i+1)})).valueOf()}(e._data,t,r.length,0),e._datatype)}function i(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),o=t.isScalar();if(p(n)?(i=n.size(),n=n.valueOf()):i=ze(n),o){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(a.length<e._size.length)throw new _e(a.length,e._size.length,"<");if(i.length<a.length){for(var s=0,l=0;1===a[s]&&1===i[s];)s++;for(;1===a[s];)l++,s++;n=Re(n,a.length,l,i)}if(!Z(a,i))throw new _e(a,i,">");u(e,t.max().map((function(e){return e+1})),r);var c=a.length;!function e(t,n,r,i,a){var o=a===i-1,s=n.dimension(a);o?s.forEach((function(e,n){De(e),t[e]=r[n[0]]})):s.forEach((function(o,s){De(o),e(t[o],n,r[s[0]],i,a+1)}))}(e._data,t,n,c,0)}return e}function s(e,t,n){if(0===t.length){for(var r=e._data;f(r);)r=r[0];return r}return e._size=t.slice(0),e._data=Be(e._data,e._size,n),e}function u(e,t,n){for(var r=e._size.slice(0),i=!1;r.length<t.length;)r.push(0),i=!0;for(var a=0,o=t.length;a<o;a++)t[a]>r[a]&&(r[a]=t[a],i=!0);i&&s(e,r,n)}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return Ge(this._data,$)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,n){switch(arguments.length){case 1:return r(this,e);case 2:case 3:return i(this,e,t,n);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new _e(e.length,this._size.length);for(var t=0;t<e.length;t++)De(e[t],this._size[t]);for(var n=this._data,r=0,i=e.length;r<i;r++){var a=e[r];De(a,n.length),n=n[a]}return n},n.prototype.set=function(e,t,n){if(!f(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new _e(e.length,this._size.length,"<");var r,i,a;u(this,e.map((function(e){return e+1})),n);var o=this._data;for(r=0,i=e.length-1;r<i;r++)De(a=e[r],o.length),o=o[a];return De(a=e[e.length-1],o.length),o[a]=t,this},n.prototype.resize=function(e,t,n){if(!m(e))throw new TypeError("Array or Matrix expected");var r=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));return s(n?this.clone():this,r,t)},n.prototype.reshape=function(e,t){var n=t?this.clone():this;return n._data=Pe(n._data,e),n._size=e.slice(0),n},n.prototype.clone=function(){return new n({data:V(this._data),size:V(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=this,r=function n(r,i){return f(r)?r.map((function(e,t){return n(e,i.concat(t))})):e(r,i,t)}(this._data,[]);return new n(r,void 0!==this._datatype?Ge(r,$):void 0)},n.prototype.forEach=function(e){var t=this;!function n(r,i){f(r)?r.forEach((function(e,t){n(e,i.concat(t))})):e(r,i,t)}(this._data,[])},n.prototype.toArray=function(){return V(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return Te(this._data,e)},n.prototype.toString=function(){return Te(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(o(e)&&(e=e.toNumber()),!a(e)||!te(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=this._size[0],s=this._size[1],u=Math.min(i-r,s-t),l=[],c=0;c<u;c++)l[c]=this._data[c+r][c+t];return new n({data:l,size:[u],datatype:this._datatype})},n.diagonal=function(e,t,r,i){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(o(e)&&(e=e.toNumber()),!a(e)||!te(e)||e<1)throw new Error("Size values must be positive integers");return e})),r){if(o(r)&&(r=r.toNumber()),!a(r)||!te(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var s,u=r>0?r:0,l=r<0?-r:0,c=e[0],m=e[1],d=Math.min(c-l,m-u);if(f(t)){if(t.length!==d)throw new Error("Invalid value array length");s=function(e){return t[e]}}else if(p(t)){var h=t.size();if(1!==h.length||h[0]!==d)throw new Error("Invalid matrix length");s=function(e){return t.get([e])}}else s=function(){return t};i||(i=o(s(0))?s(0).mul(0):0);var y=[];if(e.length>0){y=Be(y,e,i);for(var g=0;g<d;g++)y[g+l][g+u]=s(g)}return new n({data:y,size:[c,m]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!a(e)||!te(e)||!a(t)||!te(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 De(e,this._size[0]),De(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,n){var r=n[e];n[e]=n[t],n[t]=r},n}),{isClass:!0}),Ji=n(5),Xi=n.n(Ji),Ki=function(){return Ki=Xi.a.create,Xi.a},ea=Ze("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(e){var t=e.BigNumber,n=e.Complex,r=e.DenseMatrix,i=e.Fraction,m=Ki();return m.types=[{name:"number",test:a},{name:"Complex",test:s},{name:"BigNumber",test:o},{name:"Fraction",test:u},{name:"Unit",test:l},{name:"string",test:c},{name:"Chain",test:L},{name:"Array",test:f},{name:"Matrix",test:p},{name:"DenseMatrix",test:d},{name:"SparseMatrix",test:h},{name:"Range",test:y},{name:"Index",test:g},{name:"boolean",test:v},{name:"ResultSet",test:x},{name:"Help",test:b},{name:"function",test:w},{name:"Date",test:N},{name:"RegExp",test:E},{name:"null",test:M},{name:"undefined",test:T},{name:"AccessorNode",test:A},{name:"ArrayNode",test:O},{name:"AssignmentNode",test:C},{name:"BlockNode",test:_},{name:"ConditionalNode",test:k},{name:"ConstantNode",test:z},{name:"FunctionNode",test:D},{name:"FunctionAssignmentNode",test:I},{name:"IndexNode",test:B},{name:"Node",test:P},{name:"ObjectNode",test:q},{name:"OperatorNode",test:R},{name:"ParenthesisNode",test:U},{name:"RangeNode",test:F},{name:"SymbolNode",test:j},{name:"Object",test:S}],m.conversions=[{from:"number",to:"BigNumber",convert:function(e){if(t||ta(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new t(e)}},{from:"number",to:"Complex",convert:function(e){return n||na(e),new n(e,0)}},{from:"number",to:"string",convert:function(e){return e+""}},{from:"BigNumber",to:"Complex",convert:function(e){return n||na(e),new n(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 n||na(e),new n(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||ra(e);var t=new i(e);if(t.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return t}},{from:"string",to:"number",convert:function(e){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||ta(e);try{return new t(e)}catch(n){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||ra(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){n||na(e);try{return new n(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||ta(e),new t(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||ra(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}],m}));function ta(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function na(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function ra(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var ia=Ze("isInteger",["typed"],(function(e){return(0,e.typed)("isInteger",{number:te,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":function(e){return Gt(e,this)}})})),aa=Ze("isNumeric",["typed"],(function(e){return(0,e.typed)("isNumeric",{"number | BigNumber | Fraction | boolean":function(){return!0},"Complex | Unit | string | null | undefined | Node":function(){return!1},"Array | Matrix":function(e){return Gt(e,this)}})}));function oa(e){return e<0}function sa(e){return e>0}function ua(e){return 0===e}function la(e){return Number.isNaN(e)}oa.signature="number",sa.signature="number",ua.signature="number",la.signature="number";var ca=Ze("isPositive",["typed"],(function(e){return(0,e.typed)("isPositive",{number:sa,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),fa=Ze("isNaN",["typed"],(function(e){return(0,e.typed)("isNaN",{number:la,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 Gt(e,Number.isNaN)}})}));function pa(e,t,n){if(null===n||void 0===n)return e.eq(t);if(e.eq(t))return!0;if(e.isNaN()||t.isNaN())return!1;if(e.isFinite()&&t.isFinite()){var r=e.minus(t).abs();if(r.isZero())return!0;var i=e.constructor.max(e.abs(),t.abs());return r.lte(i.times(n))}return!1}var ma=Ze("equalScalar",["typed","config"],(function(e){var t=e.typed,n=e.config;return t("equalScalar",{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return he(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||pa(e,t,n.epsilon)},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,n){return he(e.re,t.re,n)&&he(e.im,t.im,n)}(e,t,n.epsilon)},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)}})})),da=(Ze("equalScalar",["typed","config"],(function(e){var t=e.typed,n=e.config;return t("equalScalar",{"number, number":function(e,t){return he(e,t,n.epsilon)}})})),Ze("number",["typed"],(function(e){var t=(0,e.typed)("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var t=Number(e);if(isNaN(t))throw new SyntaxError('String "'+e+'" is no valid number');return t},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:function(e){throw new Error("Second argument with valueless unit expected")},null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":function(e){return Gt(e,this)}});return t.fromJSON=function(e){return parseFloat(e.value)},t}))),ha=Ze("boolean",["typed"],(function(e){return(0,e.typed)("boolean",{"":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 n=Number(e);if(""!==e&&!isNaN(n))return!!n;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":function(e){return Gt(e,this)}})})),ya=Ze("complex",["typed","Complex"],(function(e){var t=e.typed,n=e.Complex;return t("complex",{"":function(){return n.ZERO},number:function(e){return new n(e,0)},"number, number":function(e,t){return new n(e,t)},"BigNumber, BigNumber":function(e,t){return new n(e.toNumber(),t.toNumber())},Fraction:function(e){return new n(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return n(e)},null:function(e){return n(0)},Object:function(e){if("re"in e&&"im"in e)return new n(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new n(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":function(e){return Gt(e,this)}})})),ga=Ze("splitUnit",["typed"],(function(e){return(0,e.typed)("splitUnit",{"Unit, Array":function(e,t){return e.splitUnit(t)}})})),va="number, number";function xa(e){return Math.abs(e)}function ba(e,t){return e+t}function wa(e,t){return e*t}function Na(e){return-e}function Ea(e){return e}function Sa(e){return oe(e)}function Ma(e){return Math.ceil(e)}function Ta(e){return e*e*e}function Aa(e){return Math.exp(e)}function Oa(e){return se(e)}function Ca(e,t){if(!te(e)||!te(t))throw new Error("Parameters in function gcd must be integer numbers");for(var n;0!==t;)n=e%t,e=t,t=n;return e<0?-e:e}function _a(e,t){if(!te(e)||!te(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var n,r=e*t;0!==t;)t=e%(n=t),e=n;return Math.abs(r/e)}function ka(e){return Math.log(e)}function za(e){return ie(e)}function Ia(e){return re(e)}function Da(e,t){if(t>0)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}function Ba(e,t){var n=t<0;if(n&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!==1)throw new Error("Root must be odd when a is negative.");if(0===e)return n?1/0:0;if(!isFinite(e))return n?0:e;var r=Math.pow(Math.abs(e),1/t);return r=e<0?-r:r,n?1/r:r}function Pa(e){return ne(e)}function qa(e){return e*e}function Ra(e,t){var n,r,i,a=0,o=1,s=1,u=0;if(!te(e)||!te(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)i=e-(r=Math.floor(e/t))*t,n=a,a=o-r*a,o=n,n=s,s=u-r*s,u=n,e=t,t=i;return e<0?[-e,-o,-u]:[e,e?o:0,u]}function Ua(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function Fa(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return parseFloat(ce(e,t))}xa.signature="number",ba.signature=va,wa.signature=va,Na.signature="number",Ea.signature="number",Sa.signature="number",Ma.signature="number",Ta.signature="number",Aa.signature="number",Oa.signature="number",Ca.signature=va,_a.signature=va,ka.signature="number",za.signature="number",Ia.signature="number",Da.signature=va,Ba.signature=va,Pa.signature="number",qa.signature="number",Ra.signature=va,Ua.signature=va,Fa.signature=va;var ja=Ze("unaryPlus",["typed","config","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.BigNumber;return t("unaryPlus",{number:Ea,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return Gt(e,this,!0)},"boolean | string":function(e){return"BigNumber"===n.number?new r(+e):+e}})})),La=Ze("cube",["typed"],(function(e){return(0,e.typed)("cube",{number:Ta,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)},"Array | Matrix":function(e){return Gt(e,this,!0)},Unit:function(e){return e.pow(3)}})})),$a=Ze("expm1",["typed","Complex"],(function(e){var t=e.typed,n=e.Complex;return t("expm1",{number:Oa,Complex:function(e){var t=Math.exp(e.re);return new n(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(e){return Gt(e,this)}})})),Ha=Ze("log10",["typed","config","Complex"],(function(e){var t=e.typed,n=e.config,r=e.Complex;return t("log10",{number:function(e){return e>=0||n.predictable?za(e):new r(e,0).log().div(Math.LN10)},Complex:function(e){return new r(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||n.predictable?e.log():new r(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return Gt(e,this)}})})),Va=Ze("multiplyScalar",["typed"],(function(e){return(0,e.typed)("multiplyScalar",{"number, number":wa,"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){var n=t.clone();return n.value=null===n.value?n._normalize(e):this(n.value,e),n},"Unit, number | Fraction | BigNumber | Complex":function(e,t){var n=e.clone();return n.value=null===n.value?n._normalize(t):this(n.value,t),n},"Unit, Unit":function(e,t){return e.multiply(t)}})})),Wa=Ze("sign",["typed","BigNumber","Fraction","complex"],(function(e){var t=e.typed,n=e.BigNumber,r=e.complex,i=e.Fraction;return t("sign",{number:Pa,Complex:function(e){return 0===e.im?r(Pa(e.re)):e.sign()},BigNumber:function(e){return new n(e.cmp(0))},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":function(e){return Gt(e,this,!0)},Unit:function(e){return this(e.value)}})})),Ga=Ze("square",["typed"],(function(e){return(0,e.typed)("square",{number:qa,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return Gt(e,this,!0)},Unit:function(e){return e.pow(2)}})}));function Za(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new n(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e}return Ja(e,t,(function(e,t){return e&t}))}function Ya(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var t=e.constructor,n=t.precision;t.config({precision:1e9});var r=e.plus(new t(1));return r.s=-r.s||null,t.config({precision:n}),r}function Qa(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);var r=new n(-1);return e.isZero()||t.eq(r)||e.eq(t)?t:t.isZero()||e.eq(r)?e:e.isFinite()&&t.isFinite()?Ja(e,t,(function(e,t){return e|t})):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?r:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function Ja(e,t,n){var r,i,a,o,s,u=e.constructor,l=+(e.s<0),c=+(t.s<0);if(l){r=Xa(Ya(e));for(var f=0;f<r.length;++f)r[f]^=1}else r=Xa(e);if(c){i=Xa(Ya(t));for(var p=0;p<i.length;++p)i[p]^=1}else i=Xa(t);r.length<=i.length?(a=r,o=i,s=l):(a=i,o=r,s=c);var m=a.length,d=o.length,h=1^n(l,c),y=new u(1^h),g=new u(1),v=new u(2),x=u.precision;for(u.config({precision:1e9});m>0;)n(a[--m],o[--d])===h&&(y=y.plus(g)),g=g.times(v);for(;d>0;)n(s,o[--d])===h&&(y=y.plus(g)),g=g.times(v);return u.config({precision:x}),0===h&&(y.s=-y.s),y}function Xa(e){for(var t=e.d,n=t[0]+"",r=1;r<t.length;++r){for(var i=t[r]+"",a=7-i.length;a--;)i="0"+i;n+=i}for(var o=n.length;"0"===n.charAt(o);)o--;var s=e.e,u=n.slice(0,o+1||1),l=u.length;if(s>0)if(++s>l)for(s-=l;s--;)u+="0";else s<l&&(u=u.slice(0,s)+"."+u.slice(s));for(var c=[0],f=0;f<u.length;){for(var p=c.length;p--;)c[p]*=10;c[0]+=parseInt(u.charAt(f++));for(var m=0;m<c.length;++m)c[m]>1&&(null!==c[m+1]&&void 0!==c[m+1]||(c[m+1]=0),c[m+1]+=c[m]>>1,c[m]&=1)}return c.reverse()}function Ka(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var n=e.constructor;if(e.isNaN()||t.isNaN())return new n(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new n(0);var r=new n(-1);return e.eq(r)?Ya(t):t.eq(r)?Ya(e):e.isFinite()&&t.isFinite()?Ja(e,t,(function(e,t){return e^t})):e.isFinite()||t.isFinite()?new n(e.isNegative()===t.isNegative()?1/0:-1/0):r}function eo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new n(2).pow(t)):new n(NaN)}function to(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var n=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new n(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new n(2).pow(t)).floor():e.isNegative()?new n(-1):e.isFinite()?new n(0):new n(NaN)}var no="number, number";function ro(e,t){if(!te(e)||!te(t))throw new Error("Integers expected in function bitAnd");return e&t}function io(e){if(!te(e))throw new Error("Integer expected in function bitNot");return~e}function ao(e,t){if(!te(e)||!te(t))throw new Error("Integers expected in function bitOr");return e|t}function oo(e,t){if(!te(e)||!te(t))throw new Error("Integers expected in function bitXor");return e^t}function so(e,t){if(!te(e)||!te(t))throw new Error("Integers expected in function leftShift");return e<<t}function uo(e,t){if(!te(e)||!te(t))throw new Error("Integers expected in function rightArithShift");return e>>t}function lo(e,t){if(!te(e)||!te(t))throw new Error("Integers expected in function rightLogShift");return e>>>t}ro.signature=no,io.signature="number",ao.signature=no,oo.signature=no,so.signature=no,uo.signature=no,lo.signature=no;var co=Ze("bitNot",["typed"],(function(e){return(0,e.typed)("bitNot",{number:io,BigNumber:Ya,"Array | Matrix":function(e){return Gt(e,this)}})})),fo=Ze("arg",["typed"],(function(e){return(0,e.typed)("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":function(e){return Gt(e,this)}})})),po=Ze("im",["typed"],(function(e){return(0,e.typed)("im",{number:function(e){return 0},BigNumber:function(e){return e.mul(0)},Complex:function(e){return e.im},"Array | Matrix":function(e){return Gt(e,this)}})}));function mo(e){return!e}function ho(e,t){return!(!e&&!t)}function yo(e,t){return!!e!==!!t}function go(e,t){return!(!e||!t)}mo.signature="number",ho.signature="number, number",yo.signature="number, number",go.signature="number, number";var vo=Ze("not",["typed"],(function(e){return(0,e.typed)("not",{number:mo,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:function(e){return null===e.value||this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),xo=Ze("filter",["typed"],(function(e){return(0,e.typed)("filter",{"Array, function":bo,"Matrix, function":function(e,t){return e.create(bo(e.toArray(),t))},"Array, RegExp":$e,"Matrix, RegExp":function(e,t){return e.create($e(e.toArray(),t))}})}));function bo(e,t){var n=On(t);return Le(e,(function(e,r,i){return 1===n?t(e):2===n?t(e,[r]):t(e,[r],i)}))}var wo=Ze("forEach",["typed"],(function(e){return(0,e.typed)("forEach",{"Array, function":No,"Matrix, function":function(e,t){return e.forEach(t)}})}));function No(e,t){var n=On(t);!function r(i,a){Array.isArray(i)?je(i,(function(e,t){r(e,a.concat(t))})):1===n?t(i):2===n?t(i,a):t(i,a,e)}(e,[])}var Eo=Ze("map",["typed"],(function(e){return(0,e.typed)("map",{"Array, function":So,"Matrix, function":function(e,t){return e.map(t)}})}));function So(e,t){var n=On(t);return function r(i,a){return Array.isArray(i)?i.map((function(e,t){return r(e,a.concat(t))})):1===n?t(i):2===n?t(i,a):t(i,a,e)}(e,[])}var Mo=Ze("erf",["typed"],(function(e){return(0,e.typed)("name",{number:function(e){var t=Math.abs(e);return t>=_o?ne(e):t<=To?ne(e)*function(e){var t,n=e*e,r=Oo[0][4]*n,i=n;for(t=0;t<3;t+=1)r=(r+Oo[0][t])*n,i=(i+Co[0][t])*n;return e*(r+Oo[0][3])/(i+Co[0][3])}(t):t<=4?ne(e)*(1-function(e){var t,n=Oo[1][8]*e,r=e;for(t=0;t<7;t+=1)n=(n+Oo[1][t])*e,r=(r+Co[1][t])*e;var i=(n+Oo[1][7])/(r+Co[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):ne(e)*(1-function(e){var t,n=1/(e*e),r=Oo[2][5]*n,i=n;for(t=0;t<4;t+=1)r=(r+Oo[2][t])*n,i=(i+Co[2][t])*n;var a=n*(r+Oo[2][4])/(i+Co[2][4]);a=(Ao-a)/e,n=parseInt(16*e)/16;var o=(e-n)*(e+n);return Math.exp(-n*n)*Math.exp(-o)*a}(t))},"Array | Matrix":function(e){return Gt(e,this)}})})),To=.46875,Ao=.5641895835477563,Oo=[[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]],Co=[[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]],_o=Math.pow(2,53),ko=Ze("format",["typed"],(function(e){return(0,e.typed)("format",{any:Te,"any, Object | function | number":Te})})),zo=Ze("isPrime",["typed"],(function(e){return(0,e.typed)("isPrime",{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;for(var t=5;e.gte(t*t);t+=6)if(e.mod(t).eq(0)||e.mod(t+2).eq(0))return!1;return!0},"Array | Matrix":function(e){return Gt(e,this)}})})),Io=Ze("acos",["typed","config","Complex"],(function(e){var t=e.typed,n=e.config,r=e.Complex;return t("acos",{number:function(e){return e>=-1&&e<=1||n.predictable?Math.acos(e):new r(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return Gt(e,this)}})}));function Do(e){return ye(e)}function Bo(e){return Math.atan(1/e)}function Po(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function qo(e){return Math.asin(1/e)}function Ro(e){var t=1/e;return Math.log(t+Math.sqrt(t*t+1))}function Uo(e){return Math.acos(1/e)}function Fo(e){var t=1/e,n=Math.sqrt(t*t-1);return Math.log(n+t)}function jo(e){return ge(e)}function Lo(e){return ve(e)}function $o(e){return 1/Math.tan(e)}function Ho(e){var t=Math.exp(2*e);return(t+1)/(t-1)}function Vo(e){return 1/Math.sin(e)}function Wo(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*ne(e)}function Go(e){return 1/Math.cos(e)}function Zo(e){return 2/(Math.exp(e)+Math.exp(-e))}function Yo(e){return be(e)}Do.signature="number",Bo.signature="number",Po.signature="number",qo.signature="number",Ro.signature="number",Uo.signature="number",Fo.signature="number",jo.signature="number",Lo.signature="number",$o.signature="number",Ho.signature="number",Vo.signature="number",Wo.signature="number",Go.signature="number",Zo.signature="number",Yo.signature="number";var Qo=Ze("acot",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("acot",{number:Bo,Complex:function(e){return e.acot()},BigNumber:function(e){return new n(1).div(e).atan()},"Array | Matrix":function(e){return Gt(e,this)}})})),Jo=Ze("acsc",["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.Complex,i=e.BigNumber;return t("acsc",{number:function(e){return e<=-1||e>=1||n.predictable?qo(e):new r(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()},"Array | Matrix":function(e){return Gt(e,this)}})})),Xo=Ze("asec",["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.Complex,i=e.BigNumber;return t("asec",{number:function(e){return e<=-1||e>=1||n.predictable?Uo(e):new r(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()},"Array | Matrix":function(e){return Gt(e,this)}})})),Ko=Ze("asin",["typed","config","Complex"],(function(e){var t=e.typed,n=e.config,r=e.Complex;return t("asin",{number:function(e){return e>=-1&&e<=1||n.predictable?Math.asin(e):new r(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),es=Ze("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()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),ts=Ze("atanh",["typed","config","Complex"],(function(e){var t=e.typed,n=e.config,r=e.Complex;return t("atanh",{number:function(e){return e<=1&&e>=-1||n.predictable?Lo(e):new r(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),ns=Ze("cosh",["typed"],(function(e){return(0,e.typed)("cosh",{number:xe,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),rs=Ze("coth",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("coth",{number:Ho,Complex:function(e){return e.coth()},BigNumber:function(e){return new n(1).div(e.tanh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),is=Ze("csch",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("csch",{number:Wo,Complex:function(e){return e.csch()},BigNumber:function(e){return new n(1).div(e.sinh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),as=Ze("sech",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("sech",{number:Zo,Complex:function(e){return e.sech()},BigNumber:function(e){return new n(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),os=Ze("sinh",["typed"],(function(e){return(0,e.typed)("sinh",{number:Yo,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),ss=Ze("tanh",["typed"],(function(e){return(0,e.typed)("tanh",{number:we,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this,!0)}})}));function us(e,t){if(t<e)return 1;if(t===e)return t;var n=t+e>>1;return us(e,n)*us(n+1,t)}function ls(e,t){if(!te(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!te(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");var n=e-t;return t<n?us(n+1,e)/us(1,t):us(t+1,e)/us(1,n)}ls.signature="number, number";var cs=Ze("combinations",["typed"],(function(e){return(0,e.typed)("combinations",{"number, number":ls,"BigNumber, BigNumber":function(e,t){var n,r,i=e.constructor,a=e.minus(t),o=new i(1);if(!fs(e)||!fs(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(n=o,t.lt(a))for(r=o;r.lte(a);r=r.plus(o))n=n.times(t.plus(r)).dividedBy(r);else for(r=o;r.lte(t);r=r.plus(o))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function fs(e){return e.isInteger()&&e.gte(0)}var ps=n(6),ms=n.n(ps),ds=ms()();function hs(e){var t,n;return t=null===(n=e)?ds:ms()(String(n)),function(){return t()}}var ys=Ze("pickRandom",["typed","config","?on"],(function(e){var t=e.typed,n=e.config,r=e.on,i=hs(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=hs(e.randomSeed))})),t({"Array | Matrix":function(e){return o(e)},"Array | Matrix, number":function(e,t){return o(e,t,void 0)},"Array | Matrix, Array":function(e,t){return o(e,void 0,t)},"Array | Matrix, Array | Matrix, number":function(e,t,n){return o(e,n,t)},"Array | Matrix, number, Array | Matrix":function(e,t,n){return o(e,t,n)}});function o(e,t,n){var r="undefined"===typeof t;if(r&&(t=1),e=e.valueOf(),n&&(n=n.valueOf()),ze(e).length>1)throw new Error("Only one dimensional vectors supported");var o=0;if("undefined"!==typeof n){if(n.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var s=0,u=n.length;s<u;s++){if(!a(n[s])||n[s]<0)throw new Error("Weights must be an array of positive numbers");o+=n[s]}}var l=e.length;if(0===l)return[];if(t>=l)return t>1?e:e[0];for(var c,f=[];f.length<t;){if("undefined"===typeof n)c=e[Math.floor(i()*l)];else for(var p=i()*o,m=0,d=e.length;m<d;m++)if((p-=n[m])<0){c=e[m];break}-1===f.indexOf(c)&&f.push(c)}return r?f[0]:f}}));function gs(e,t){var n=[];if((e=e.slice(0)).length>1)for(var r=0,i=e.shift();r<i;r++)n.push(gs(e,t));else for(var a=0,o=e.shift();a<o;a++)n.push(t());return n}var vs=Ze("randomInt",["typed","config","?on"],(function(e){var t=e.typed,n=e.config,r=e.on,i=hs(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=hs(e.randomSeed))})),t("randomInt",{"":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,n){return a(e,t,n)}});function a(e,t,n){var r=gs(e.valueOf(),(function(){return o(t,n)}));return p(e)?e.create(r):r}function o(e,t){return Math.floor(e+i()*(t-e))}})),xs=Ze("clone",["typed"],(function(e){return(0,e.typed)("clone",{any:V})})),bs=Ze("hasNumericValue",["typed","isNumeric"],(function(e){var t=e.typed,n=e.isNumeric;return t("hasNumericValue",{string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return n(e)}})})),ws=Ze("typeOf",["typed"],(function(e){return(0,e.typed)("typeOf",{any:$})})),Ns=Ze("string",["typed"],(function(e){return(0,e.typed)("string",{"":function(){return""},number:ue,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return Gt(e,this)},any:function(e){return String(e)}})})),Es=Ze("fraction",["typed","Fraction"],(function(e){var t=e.typed,n=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 n(e)},string:function(e){return new n(e)},"number, number":function(e,t){return new n(e,t)},null:function(e){return new n(0)},BigNumber:function(e){return new n(e.toString())},Fraction:function(e){return e},Object:function(e){return new n(e)},"Array | Matrix":function(e){return Gt(e,this)}})})),Ss=Ze("unaryMinus",["typed"],(function(e){return(0,e.typed)("unaryMinus",{number:Na,Complex:function(e){return e.neg()},BigNumber:function(e){return e.neg()},Fraction:function(e){return e.neg()},Unit:function(e){var t=e.clone();return t.value=this(e.value),t},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),Ms=Ze("addScalar",["typed"],(function(e){return(0,e.typed)("addScalar",{"number, number":ba,"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":function(e,t){if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value||void 0===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var n=e.clone();return n.value=this(n.value,t.value),n.fixPrefix=!1,n}})})),Ts=Ze("exp",["typed"],(function(e){return(0,e.typed)("exp",{number:Aa,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(e){return Gt(e,this)}})})),As=Ze("log2",["typed","config","Complex"],(function(e){var t=e.typed,n=e.config,r=e.Complex;return t("log2",{number:function(e){return e>=0||n.predictable?Ia(e):i(new r(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||n.predictable?e.log(2):i(new r(e.toNumber(),0))},"Array | Matrix":function(e){return Gt(e,this)}});function i(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),Os=Ze("sqrt",["config","typed","Complex"],(function(e){var t=e.config,n=e.typed,r=e.Complex;return n("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},"Array | Matrix":function(e){return Gt(e,this,!0)},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||t.predictable?Math.sqrt(e):new r(e,0).sqrt()}})),Cs=Ze("conj",["typed"],(function(e){return(0,e.typed)("conj",{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.conjugate()},"Array | Matrix":function(e){return Gt(e,this)}})})),_s=Ze("getMatrixDataType",["typed"],(function(e){return(0,e.typed)("getMatrixDataType",{Array:function(e){return Ge(e,$)},Matrix:function(e){return e.getDataType()}})})),ks=Ze("mode",["typed","isNaN","isNumeric"],(function(e){var t=e.typed,n=e.isNaN,r=e.isNumeric;return t("mode",{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=Ue(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 s=e[o];if(r(s)&&n(s))throw new Error("Cannot calculate mode of an array containing NaN values");s in t||(t[s]=0),t[s]++,t[s]===a?i.push(s):t[s]>a&&(a=t[s],i=[s])}return i}})),zs=Ze("print",["typed"],(function(e){return(0,e.typed)("print",{"string, Object | Array":Is,"string, Object | Array, number | Object":Is})}));function Is(e,t,n){return e.replace(/\$([\w.]+)/g,(function(e,r){for(var i=r.split("."),a=t[i.shift()];i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}return void 0!==a?c(a)?a:Te(a,n):e}))}var Ds=Ze("acosh",["typed","config","Complex"],(function(e){var t=e.typed,n=e.config,r=e.Complex;return t("acosh",{number:function(e){return e>=1||n.predictable?Do(e):e<=-1?new r(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new r(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return Gt(e,this)}})})),Bs=Ze("acsch",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("acsch",{number:Ro,Complex:function(e){return e.acsch()},BigNumber:function(e){return new n(1).div(e).asinh()},"Array | Matrix":function(e){return Gt(e,this)}})})),Ps=Ze("asinh",["typed"],(function(e){return(0,e.typed)("asinh",{number:jo,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),qs=Ze("cos",["typed"],(function(e){return(0,e.typed)("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),Rs=Ze("csc",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("csc",{number:Vo,Complex:function(e){return e.csc()},BigNumber:function(e){return new n(1).div(e.sin())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),Us=Ze("sin",["typed"],(function(e){return(0,e.typed)("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),Fs=Ze("combinationsWithRep",["typed"],(function(e){return(0,e.typed)("combinationsWithRep",{"number, number":function(e,t){if(!te(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!te(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?us(e,e+t-1)/us(1,t):us(t+1,e+t-1)/us(1,e-1)},"BigNumber, BigNumber":function(e,t){var n,r,i=new(0,e.constructor)(1),a=e.minus(i);if(!js(e)||!js(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(n=i,t.lt(a))for(r=i;r.lte(a);r=r.plus(i))n=n.times(t.plus(r)).dividedBy(r);else for(r=i;r.lte(t);r=r.plus(i))n=n.times(a.plus(r)).dividedBy(r);return n}})}));function js(e){return e.isInteger()&&e.gte(0)}var Ls=Ze("random",["typed","config","?on"],(function(e){var t=e.typed,n=e.config,r=e.on,i=hs(n.randomSeed);return r&&r("config",(function(e,t){e.randomSeed!==t.randomSeed&&(i=hs(e.randomSeed))})),t("random",{"":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,n){return a(e,t,n)}});function a(e,t,n){var r=gs(e.valueOf(),(function(){return o(t,n)}));return p(e)?e.create(r):r}function o(e,t){return e+i()*(t-e)}})),$s=Ze("isNegative",["typed"],(function(e){return(0,e.typed)("isNegative",{number:oa,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:function(e){return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),Hs=Ze("SparseMatrix",["typed","equalScalar","Matrix"],(function(e){var t=e.typed,n=e.equalScalar,r=e.Matrix;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!c(t))throw new Error("Invalid datatype: "+t);if(p(e))!function(e,t,n){"SparseMatrix"===t.type?(e._values=t._values?V(t._values):void 0,e._index=V(t._index),e._ptr=V(t._ptr),e._size=V(t._size),e._datatype=n||t._datatype):s(e,t.valueOf(),n||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))s(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+$(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function s(e,r,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=r.length,o=0,s=n,u=0;if(c(i)&&(s=t.find(n,[i,i])||n,u=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=r[p];if(f(m)){if(0===l&&o<m.length&&(o=m.length),l<m.length){var d=m[l];s(d,u)||(e._values.push(d),e._index.push(p))}}else 0===l&&o<1&&(o=1),s(m,u)||(e._values.push(m),e._index.push(p))}l++}while(l<o)}e._ptr.push(e._index.length),e._size=[a,o]}function u(e,t){if(!g(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var n,r,a,o,s=t.size();if(s.length!==e._size.length)throw new _e(s.length,e._size.length);var u=t.min(),l=t.max();for(n=0,r=e._size.length;n<r;n++)De(u[n],e._size[n]),De(l[n],e._size[n]);var c=e._values,f=e._index,p=e._ptr,m=t.dimension(0),d=t.dimension(1),h=[],y=[];m.forEach((function(e,t){y[e]=t[0],h[e]=!0}));var v=c?[]:void 0,x=[],b=[];return d.forEach((function(e){for(b.push(x.length),a=p[e],o=p[e+1];a<o;a++)n=f[a],!0===h[n]&&(x.push(y[n]),v&&v.push(c[a]))})),b.push(x.length),new i({values:v,index:x,ptr:b,size:s,datatype:e._datatype})}function l(e,t,n,r){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),o=t.isScalar();if(p(n)?(i=n.size(),n=n.toArray()):i=ze(n),o){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),n,r)}else{if(1!==a.length&&2!==a.length)throw new _e(a.length,e._size.length,"<");if(i.length<a.length){for(var s=0,u=0;1===a[s]&&1===i[s];)s++;for(;1===a[s];)u++,s++;n=Re(n,a.length,u,i)}if(!Z(a,i))throw new _e(a,i,">");for(var l=t.min()[0],c=t.min()[1],f=i[0],m=i[1],d=0;d<f;d++)for(var h=0;h<m;h++){var y=n[d][h];e.set([d+l,h+c],y,r)}}return e}function d(e,t,n,r){if(n-t===0)return n;for(var i=t;i<n;i++)if(r[i]===e)return i;return t}function h(e,t,n,r,i,a,o){i.splice(e,0,r),a.splice(e,0,t);for(var s=n+1;s<o.length;s++)o[s]++}function y(e,r,i,a){var o=a||0,s=n,u=0;c(e._datatype)&&(s=t.find(n,[e._datatype,e._datatype])||n,u=t.convert(0,e._datatype),o=t.convert(o,e._datatype));var l,f,p,m=!s(o,u),d=e._size[0],h=e._size[1];if(i>h){for(f=h;f<i;f++)if(e._ptr[f]=e._values.length,m)for(l=0;l<d;l++)e._values.push(o),e._index.push(l);e._ptr[i]=e._values.length}else i<h&&(e._ptr.splice(i+1,h-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(h=i,r>d){if(m){var y=0;for(f=0;f<h;f++){e._ptr[f]=e._ptr[f]+y,p=e._ptr[f+1]+y;var g=0;for(l=d;l<r;l++,g++)e._values.splice(p+g,0,o),e._index.splice(p+g,0,l),y++}e._ptr[h]=e._values.length}}else if(r<d){var v=0;for(f=0;f<h;f++){e._ptr[f]=e._ptr[f]-v;var x=e._ptr[f],b=e._ptr[f+1]-v;for(p=x;p<b;p++)(l=e._index[p])>r-1&&(e._values.splice(p,1),e._index.splice(p,1),v++)}e._ptr[f]=e._values.length}return e._size[0]=r,e._size[1]=i,e}function v(e,t,n,r,i){var a,o,s=r[0],u=r[1],l=[];for(a=0;a<s;a++)for(l[a]=[],o=0;o<u;o++)l[a][o]=0;for(o=0;o<u;o++)for(var c=n[o],f=n[o+1],p=c;p<f;p++)l[a=t[p]][o]=e?i?V(e[p]):e[p]:1;return l}return i.prototype=new r,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return Ge(this._values,$)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},i.prototype.subset=function(e,t,n){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return u(this,e);case 2:case 3:return l(this,e,t,n);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new _e(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],n=e[1];De(t,this._size[0]),De(n,this._size[1]);var r=d(t,this._ptr[n],this._ptr[n+1],this._index);return r<this._ptr[n+1]&&this._index[r]===t?this._values[r]:0},i.prototype.set=function(e,r,i){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new _e(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],s=this._size[0],u=this._size[1],l=n,p=0;c(this._datatype)&&(l=t.find(n,[this._datatype,this._datatype])||n,p=t.convert(0,this._datatype)),(a>s-1||o>u-1)&&(y(this,Math.max(a+1,s),Math.max(o+1,u),i),s=this._size[0],u=this._size[1]),De(a,s),De(o,u);var m=d(a,this._ptr[o],this._ptr[o+1],this._index);return m<this._ptr[o+1]&&this._index[m]===a?l(r,p)?function(e,t,n,r,i){n.splice(e,1),r.splice(e,1);for(var a=t+1;a<i.length;a++)i[a]--}(m,o,this._values,this._index,this._ptr):this._values[m]=r:h(m,a,o,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(e,t,n){if(!m(e))throw new TypeError("Array or Matrix expected");var r=e.valueOf().map((function(e){return Array.isArray(e)&&1===e.length?e[0]:e}));if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(e){if(!a(e)||!te(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Te(r)+")")})),y(n?this.clone():this,r[0],r[1],t)},i.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");if(e.forEach((function(t){if(!a(t)||!te(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Te(e)+")")})),this._size[0]*this._size[1]!==e[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 r=[],i=0;i<n._ptr.length;i++)for(var o=0;o<n._ptr[i+1]-n._ptr[i];o++)r.push(i);for(var s=n._values.slice(),u=n._index.slice(),l=0;l<n._index.length;l++){var c=u[l],p=r[l],m=c*n._size[1]+p;r[l]=m%e[1],u[l]=Math.floor(m/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<s.length;g++){var v=u[g],x=r[g],b=s[g];h(d(v,n._ptr[x],n._ptr[x+1],n._index),v,x,b,n._values,n._index,n._ptr)}return n},i.prototype.clone=function(){return new i({values:this._values?V(this._values):void 0,index:V(this._index),ptr:V(this._ptr),size:V(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var a=this;return function(e,r,a,o,s,u,l){var f=[],p=[],m=[],d=n,h=0;c(e._datatype)&&(d=t.find(n,[e._datatype,e._datatype])||n,h=t.convert(0,e._datatype));for(var y=function(e,t,n){e=u(e,t,n),d(e,h)||(f.push(e),p.push(t))},g=o;g<=s;g++){m.push(f.length);var v=e._ptr[g],x=e._ptr[g+1];if(l)for(var b=v;b<x;b++){var w=e._index[b];w>=r&&w<=a&&y(e._values[b],w-r,g-o)}else{for(var N={},E=v;E<x;E++){var S=e._index[E];N[S]=e._values[E]}for(var M=r;M<=a;M++){var T=M in N?N[M]:0;y(T,M-r,g-o)}}}return m.push(f.length),new i({values:f,index:p,ptr:m,size:[a-r+1,s-o+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,(function(t,n,r){return e(t,[n,r],a)}),r)},i.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var n=this._size[0],r=this._size[1],i=0;i<r;i++){var a=this._ptr[i],o=this._ptr[i+1];if(t)for(var s=a;s<o;s++){var u=this._index[s];e(this._values[s],[u,i],this)}else{for(var l={},c=a;c<o;c++){l[this._index[c]]=this._values[c]}for(var f=0;f<n;f++){e(f in l?l[f]:0,[f,i],this)}}}},i.prototype.toArray=function(){return v(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return v(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(e){for(var t=this._size[0],n=this._size[1],r=this.density(),i="Sparse Matrix ["+Te(t,e)+" x "+Te(n,e)+"] density: "+Te(r,e)+"\n",a=0;a<n;a++)for(var o=this._ptr[a],s=this._ptr[a+1],u=o;u<s;u++){i+="\n    ("+Te(this._index[u],e)+", "+Te(a,e)+") ==> "+(this._values?Te(this._values[u],e):"X")}return i},i.prototype.toString=function(){return Te(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(o(e)&&(e=e.toNumber()),!a(e)||!te(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,n=e<0?-e:0,r=this._size[0],s=this._size[1],u=Math.min(r-n,s-t),l=[],c=[],f=[];f[0]=0;for(var p=t;p<s&&l.length<u;p++)for(var m=this._ptr[p],d=this._ptr[p+1],h=m;h<d;h++){var y=this._index[h];if(y===p-t+n){l.push(this._values[h]),c[l.length-1]=y-n;break}}return f.push(l.length),new i({values:l,index:c,ptr:f,size:[u,1]})},i.fromJSON=function(e){return new i(e)},i.diagonal=function(e,r,s,u,l){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(o(e)&&(e=e.toNumber()),!a(e)||!te(e)||e<1)throw new Error("Size values must be positive integers");return e})),s){if(o(s)&&(s=s.toNumber()),!a(s)||!te(s))throw new TypeError("The parameter k must be an integer number")}else s=0;var m=n,d=0;c(l)&&(m=t.find(n,[l,l])||n,d=t.convert(0,l));var h,y=s>0?s:0,g=s<0?-s:0,v=e[0],x=e[1],b=Math.min(v-g,x-y);if(f(r)){if(r.length!==b)throw new Error("Invalid value array length");h=function(e){return r[e]}}else if(p(r)){var w=r.size();if(1!==w.length||w[0]!==b)throw new Error("Invalid matrix length");h=function(e){return r.get([e])}}else h=function(){return r};for(var N=[],E=[],S=[],M=0;M<x;M++){S.push(N.length);var T=M-y;if(T>=0&&T<b){var A=h(T);m(A,d)||(E.push(T+g),N.push(A))}}return S.push(N.length),new i({values:N,index:E,ptr:S,size:[v,x]})},i.prototype.swapRows=function(e,t){if(!a(e)||!te(e)||!a(t)||!te(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 De(e,this._size[0]),De(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,n,r,i){for(var a=r[e],o=r[e+1],s=a;s<o;s++)i(n[s],t[s])},i._swapRows=function(e,t,n,r,i,a){for(var o=0;o<n;o++){var s=a[o],u=a[o+1],l=d(e,s,u,i),c=d(t,s,u,i);if(l<u&&c<u&&i[l]===e&&i[c]===t){if(r){var f=r[l];r[l]=r[c],r[c]=f}}else if(l<u&&i[l]===e&&(c>=u||i[c]!==t)){var p=r?r[l]:void 0;i.splice(c,0,t),r&&r.splice(c,0,p),i.splice(c<=l?l+1:l,1),r&&r.splice(c<=l?l+1:l,1)}else if(c<u&&i[c]===t&&(l>=u||i[l]!==e)){var m=r?r[c]:void 0;i.splice(l,0,e),r&&r.splice(l,0,m),i.splice(l<=c?c+1:c,1),r&&r.splice(l<=c?c+1:c,1)}}},i}),{isClass:!0}),Vs=Ze("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,n=(e.Matrix,e.DenseMatrix),r=e.SparseMatrix;return t("matrix",{"":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 n(e,i);if("sparse"===t)return new r(e,i);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}})),Ws=Ze("cbrt",["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(function(e){var t=e.config,n=e.typed,r=e.isNegative,i=e.unaryMinus,a=e.matrix,l=e.Complex,c=e.BigNumber,f=e.Fraction;return n("cbrt",{number:Sa,Complex:p,"Complex, boolean":p,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&s(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=p(e.value),t}var n,a=r(e.value);a&&(e.value=i(e.value)),n=o(e.value)?new c(1).div(3):u(e.value)?new f(1,3):1/3;var l=e.pow(n);return a&&(l.value=i(l.value)),l},"Array | Matrix":function(e){return Gt(e,this,!0)}});function p(e,n){var r=e.arg()/3,i=e.abs(),o=new l(Sa(i),0).mul(new l(0,r).exp());if(n){var s=[o,new l(Sa(i),0).mul(new l(0,r+2*Math.PI/3).exp()),new l(Sa(i),0).mul(new l(0,r-2*Math.PI/3).exp())];return"Array"===t.matrix?s:a(s)}return o}})),Gs=Ze("algorithm01",["typed"],(function(e){var t=e.typed;return function(e,n,r,i){var a=e._data,o=e._size,s=e._datatype,u=n._values,l=n._index,c=n._ptr,f=n._size,p=n._datatype;if(o.length!==f.length)throw new _e(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,d,h=o[0],y=o[1],g="string"===typeof s&&s===p?s:void 0,v=g?t.find(r,[g,g]):r,x=[];for(m=0;m<h;m++)x[m]=[];var b=[],w=[];for(d=0;d<y;d++){for(var N=d+1,E=c[d],S=c[d+1],M=E;M<S;M++)b[m=l[M]]=i?v(u[M],a[m][d]):v(a[m][d],u[M]),w[m]=N;for(m=0;m<h;m++)w[m]===N?x[m][d]=b[m]:x[m][d]=a[m][d]}return e.createDenseMatrix({data:x,size:[h,y],datatype:g})}})),Zs=Ze("algorithm04",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,l=e._datatype,c=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype;if(u.length!==m.length)throw new _e(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");var h,y=u[0],g=u[1],v=n,x=0,b=i;"string"===typeof l&&l===d&&(h=l,v=t.find(n,[h,h]),x=t.convert(0,h),b=t.find(i,[h,h]));var w,N,E,S,M,T=a&&c?[]:void 0,A=[],O=[],C=a&&c?[]:void 0,_=a&&c?[]:void 0,k=[],z=[];for(N=0;N<g;N++){O[N]=A.length;var I=N+1;for(S=s[N],M=s[N+1],E=S;E<M;E++)w=o[E],A.push(w),k[w]=I,C&&(C[w]=a[E]);for(S=p[N],M=p[N+1],E=S;E<M;E++)if(k[w=f[E]]===I){if(C){var D=b(C[w],c[E]);v(D,x)?k[w]=null:C[w]=D}}else A.push(w),z[w]=I,_&&(_[w]=c[E]);if(C&&_)for(E=O[N];E<A.length;)k[w=A[E]]===I?(T[E]=C[w],E++):z[w]===I?(T[E]=_[w],E++):A.splice(E,1)}return O[g]=A.length,e.createSparseMatrix({values:T,index:A,ptr:O,size:[y,g],datatype:h})}})),Ys=Ze("algorithm10",["typed","DenseMatrix"],(function(e){var t=e.typed,n=e.DenseMatrix;return function(e,r,i,a){var o=e._values,s=e._index,u=e._ptr,l=e._size,c=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=l[0],m=l[1],d=i;"string"===typeof c&&(f=c,r=t.convert(r,f),d=t.find(i,[f,f]));for(var h=[],y=[],g=[],v=0;v<m;v++){for(var x=v+1,b=u[v],w=u[v+1],N=b;N<w;N++){var E=s[N];y[E]=o[N],g[E]=x}for(var S=0;S<p;S++)0===v&&(h[S]=[]),g[S]===x?h[S][v]=a?d(r,y[S]):d(y[S],r):h[S][v]=r}return new n({data:h,size:[p,m],datatype:f})}})),Qs=Ze("algorithm13",["typed"],(function(e){var t=e.typed;return function(e,n,r){var i,a=e._data,o=e._size,s=e._datatype,u=n._data,l=n._size,c=n._datatype,f=[];if(o.length!==l.length)throw new _e(o.length,l.length);for(var p=0;p<o.length;p++){if(o[p]!==l[p])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");f[p]=o[p]}var m=r;"string"===typeof s&&s===c&&(i=s,m=t.find(r,[i,i]));var d=f.length>0?function e(t,n,r,i,a,o){var s=[];if(n===r.length-1)for(var u=0;u<i;u++)s[u]=t(a[u],o[u]);else for(var l=0;l<i;l++)s[l]=e(t,n+1,r,r[n+1],a[l],o[l]);return s}(m,0,f,f[0],a,u):[];return e.createDenseMatrix({data:d,size:f,datatype:i})}})),Js=Ze("algorithm14",["typed"],(function(e){var t=e.typed;return function(e,n,r,i){var a,o=e._data,s=e._size,u=e._datatype,l=r;"string"===typeof u&&(a=u,n=t.convert(n,a),l=t.find(r,[a,a]));var c=s.length>0?function e(t,n,r,i,a,o,s){var u=[];if(n===r.length-1)for(var l=0;l<i;l++)u[l]=s?t(o,a[l]):t(a[l],o);else for(var c=0;c<i;c++)u[c]=e(t,n+1,r,r[n+1],a[c],o,s);return u}(l,0,s,s[0],o,n,i):[];return e.createDenseMatrix({data:c,size:V(s),datatype:a})}})),Xs=Ze("gcd",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.BigNumber,a=e.DenseMatrix,o=Gs({typed:t}),s=Zs({typed:t,equalScalar:r}),u=Ys({typed:t,DenseMatrix:a}),l=Qs({typed:t}),c=Js({typed:t});return t("gcd",{"number, number":Ca,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var n=new i(0);for(;!t.isZero();){var r=e.mod(t);e=t,t=r}return e.lt(n)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return u(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}})})),Ks=Ze("algorithm02",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i,a){var o=e._data,s=e._size,u=e._datatype,l=r._values,c=r._index,f=r._ptr,p=r._size,m=r._datatype;if(s.length!==p.length)throw new _e(s.length,p.length);if(s[0]!==p[0]||s[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+p+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,h=s[0],y=s[1],g=n,v=0,x=i;"string"===typeof u&&u===m&&(d=u,g=t.find(n,[d,d]),v=t.convert(0,d),x=t.find(i,[d,d]));for(var b=[],w=[],N=[],E=0;E<y;E++){N[E]=w.length;for(var S=f[E],M=f[E+1],T=S;T<M;T++){var A=c[T],O=a?x(l[T],o[A][E]):x(o[A][E],l[T]);g(O,v)||(w.push(A),b.push(O))}}return N[y]=w.length,r.createSparseMatrix({values:b,index:w,ptr:N,size:[h,y],datatype:d})}})),eu=Ze("algorithm03",["typed"],(function(e){var t=e.typed;return function(e,n,r,i){var a=e._data,o=e._size,s=e._datatype,u=n._values,l=n._index,c=n._ptr,f=n._size,p=n._datatype;if(o.length!==f.length)throw new _e(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+f+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,d=o[0],h=o[1],y=0,g=r;"string"===typeof s&&s===p&&(m=s,y=t.convert(0,m),g=t.find(r,[m,m]));for(var v=[],x=0;x<d;x++)v[x]=[];for(var b=[],w=[],N=0;N<h;N++){for(var E=N+1,S=c[N],M=c[N+1],T=S;T<M;T++){var A=l[T];b[A]=i?g(u[T],a[A][N]):g(a[A][N],u[T]),w[A]=E}for(var O=0;O<d;O++)w[O]===E?v[O][N]=b[O]:v[O][N]=i?g(y,a[O][N]):g(a[O][N],y)}return e.createDenseMatrix({data:v,size:[d,h],datatype:m})}})),tu=Ze("algorithm05",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,l=e._datatype,c=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype;if(u.length!==m.length)throw new _e(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");var h,y=u[0],g=u[1],v=n,x=0,b=i;"string"===typeof l&&l===d&&(h=l,v=t.find(n,[h,h]),x=t.convert(0,h),b=t.find(i,[h,h]));var w,N,E,S,M=a&&c?[]:void 0,T=[],A=[],O=M?[]:void 0,C=M?[]:void 0,_=[],k=[];for(N=0;N<g;N++){A[N]=T.length;var z=N+1;for(E=s[N],S=s[N+1];E<S;E++)w=o[E],T.push(w),_[w]=z,O&&(O[w]=a[E]);for(E=p[N],S=p[N+1];E<S;E++)_[w=f[E]]!==z&&T.push(w),k[w]=z,C&&(C[w]=c[E]);if(M)for(E=A[N];E<T.length;){var I=_[w=T[E]],D=k[w];if(I===z||D===z){var B=b(I===z?O[w]:x,D===z?C[w]:x);v(B,x)?T.splice(E,1):(M.push(B),E++)}}}return A[g]=T.length,e.createSparseMatrix({values:M,index:T,ptr:A,size:[y,g],datatype:h})}})),nu=Ze("algorithm11",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i,a){var o=e._values,s=e._index,u=e._ptr,l=e._size,c=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=l[0],m=l[1],d=n,h=0,y=i;"string"===typeof c&&(f=c,d=t.find(n,[f,f]),h=t.convert(0,f),r=t.convert(r,f),y=t.find(i,[f,f]));for(var g=[],v=[],x=[],b=0;b<m;b++){x[b]=v.length;for(var w=u[b],N=u[b+1],E=w;E<N;E++){var S=s[E],M=a?y(r,o[E]):y(o[E],r);d(M,h)||(v.push(S),g.push(M))}}return x[m]=v.length,e.createSparseMatrix({values:g,index:v,ptr:x,size:[p,m],datatype:f})}})),ru=Ze("algorithm12",["typed","DenseMatrix"],(function(e){var t=e.typed,n=e.DenseMatrix;return function(e,r,i,a){var o=e._values,s=e._index,u=e._ptr,l=e._size,c=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f,p=l[0],m=l[1],d=i;"string"===typeof c&&(f=c,r=t.convert(r,f),d=t.find(i,[f,f]));for(var h=[],y=[],g=[],v=0;v<m;v++){for(var x=v+1,b=u[v],w=u[v+1],N=b;N<w;N++){var E=s[N];y[E]=o[N],g[E]=x}for(var S=0;S<p;S++)0===v&&(h[S]=[]),g[S]===x?h[S][v]=a?d(r,y[S]):d(y[S],r):h[S][v]=a?d(r,0):d(0,r)}return new n({data:h,size:[p,m],datatype:f})}})),iu=Ze("mod",["typed","matrix","equalScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.DenseMatrix,a=Ks({typed:t,equalScalar:r}),o=eu({typed:t}),s=tu({typed:t,equalScalar:r}),u=nu({typed:t,equalScalar:r}),l=ru({typed:t,DenseMatrix:i}),c=Qs({typed:t}),f=Js({typed:t});return t("mod",{"number, number":Da,"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.mod(t)},"Fraction, Fraction":function(e,t){return e.mod(t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return f(e,t,this,!1)},"any, SparseMatrix":function(e,t){return l(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, any":function(e,t){return f(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return f(n(t),e,this,!0).valueOf()}})})),au=Ze("algorithm06",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i){var a=e._values,o=e._size,s=e._datatype,u=r._values,l=r._size,c=r._datatype;if(o.length!==l.length)throw new _e(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+")");var f,p=o[0],m=o[1],d=n,h=0,y=i;"string"===typeof s&&s===c&&(f=s,d=t.find(n,[f,f]),h=t.convert(0,f),y=t.find(i,[f,f]));for(var g=a&&u?[]:void 0,v=[],x=[],b=g?[]:void 0,w=[],N=[],E=0;E<m;E++){x[E]=v.length;var S=E+1;if(Qt(e,E,w,b,N,S,v,y),Qt(r,E,w,b,N,S,v,y),b)for(var M=x[E];M<v.length;){var T=v[M];if(N[T]===S){var A=b[T];d(A,h)?v.splice(M,1):(g.push(A),M++)}else v.splice(M,1)}else for(var O=x[E];O<v.length;){N[v[O]]!==S?v.splice(O,1):O++}}return x[m]=v.length,e.createSparseMatrix({values:g,index:v,ptr:x,size:[p,m],datatype:f})}})),ou=Ze("nthRoot",["typed","matrix","equalScalar","BigNumber"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.BigNumber,a=Gs({typed:t}),o=Ks({typed:t,equalScalar:r}),s=au({typed:t,equalScalar:r}),u=nu({typed:t,equalScalar:r}),l=Qs({typed:t}),c=Js({typed:t}),f="Complex number not supported in function nthRoot. Use nthRoots instead.";return t("nthRoot",{number:function(e){return Ba(e,2)},"number, number":Ba,BigNumber:function(e){return p(e,new i(2))},Complex:function(e){throw new Error(f)},"Complex, number":function(e,t){throw new Error(f)},"BigNumber, BigNumber":p,"Array | Matrix":function(e){return this(e,2)},"SparseMatrix, SparseMatrix":function(e,t){if(1===t.density())return s(e,t,this);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){if(1===t.density())return a(e,t,this,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){if(1===t.density())return u(t,e,this,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}});function p(e,t){var n=i.precision,r=i.clone({precision:n+2}),a=new i(0),o=new r(1),s=t.isNegative();if(s&&(t=t.neg()),t.isZero())throw 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 s?new r(1/0):0;if(!e.isFinite())return s?a:e;var u=e.abs().pow(o.div(t));return u=e.isNeg()?u.neg():u,new i((s?o.div(u):u).toPrecision(n))}})),su=Ze("xgcd",["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.BigNumber;return t("xgcd",{"number, number":function(e,t){var i=Ra(e,t);return"Array"===n.matrix?i:r(i)},"BigNumber, BigNumber":function(e,t){var a,o,s,u,l=new i(0),c=new i(1),f=l,p=c,m=c,d=l;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)o=e.div(t).floor(),s=e.mod(t),a=f,f=p.minus(o.times(f)),p=a,a=m,m=d.minus(o.times(m)),d=a,e=t,t=s;u=e.lt(l)?[e.neg(),p.neg(),d.neg()]:[e,e.isZero()?0:p,d];return"Array"===n.matrix?u:r(u)}})})),uu=Ze("bitAnd",["typed","matrix","equalScalar"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=Ks({typed:t,equalScalar:r}),a=au({typed:t,equalScalar:r}),o=nu({typed:t,equalScalar:r}),s=Qs({typed:t}),u=Js({typed:t});return t("bitAnd",{"number, number":ro,"BigNumber, BigNumber":Za,"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})})),lu=Ze("algorithm07",["typed","DenseMatrix"],(function(e){var t=e.typed,n=e.DenseMatrix;return function(e,i,a){var o=e._size,s=e._datatype,u=i._size,l=i._datatype;if(o.length!==u.length)throw new _e(o.length,u.length);if(o[0]!==u[0]||o[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+u+")");var c,f,p,m=o[0],d=o[1],h=0,y=a;"string"===typeof s&&s===l&&(c=s,h=t.convert(0,c),y=t.find(a,[c,c]));var g=[];for(f=0;f<m;f++)g[f]=[];var v=[],x=[],b=[],w=[];for(p=0;p<d;p++){var N=p+1;for(r(e,p,b,v,N),r(i,p,w,x,N),f=0;f<m;f++){var E=b[f]===N?v[f]:h,S=w[f]===N?x[f]:h;g[f][p]=y(E,S)}}return new n({data:g,size:[m,d],datatype:c})};function r(e,t,n,r,i){for(var a=e._values,o=e._index,s=e._ptr,u=s[t],l=s[t+1];u<l;u++){var c=o[u];n[c]=i,r[c]=a[u]}}})),cu=Ze("bitXor",["typed","matrix","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.DenseMatrix,i=eu({typed:t}),a=lu({typed:t,DenseMatrix:r}),o=ru({typed:t,DenseMatrix:r}),s=Qs({typed:t}),u=Js({typed:t});return t("bitXor",{"number, number":oo,"BigNumber, BigNumber":Ka,"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})})),fu=Ze("or",["typed","matrix","equalScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.DenseMatrix,a=eu({typed:t}),o=tu({typed:t,equalScalar:r}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("or",{"number, number":ho,"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":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(n(t),e,this,!0).valueOf()}})})),pu=Ze("diag",["typed","matrix","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.DenseMatrix,i=e.SparseMatrix;return t("diag",{Array:function(e){return a(e,0,ze(e),null)},"Array, number":function(e,t){return a(e,t,ze(e),null)},"Array, BigNumber":function(e,t){return a(e,t.toNumber(),ze(e),null)},"Array, string":function(e,t){return a(e,0,ze(e),t)},"Array, number, string":function(e,t,n){return a(e,t,ze(e),n)},"Array, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),ze(e),n)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return a(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return a(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return a(e,0,e.size(),t)},"Matrix, number, string":function(e,t,n){return a(e,t,e.size(),n)},"Matrix, BigNumber, string":function(e,t,n){return a(e,t.toNumber(),e.size(),n)}});function a(e,t,a,o){if(!te(t))throw new TypeError("Second parameter in function diag must be an integer");var s=t>0?t:0,u=t<0?-t:0;switch(a.length){case 1:return function(e,t,n,a,o,s){var u=[a+o,a+s];if(n&&"sparse"!==n&&"dense"!==n)throw new TypeError("Unknown matrix type ".concat(n,'"'));var l="sparse"===n?i.diagonal(u,e,t):r.diagonal(u,e,t);return null!==n?l:l.valueOf()}(e,t,o,a[0],u,s);case 2:return function(e,t,r,i,a,o){if(p(e)){var s=e.diagonal(t);return null!==r?r!==s.storage()?n(s,r):s:s.valueOf()}for(var u=Math.min(i[0]-a,i[1]-o),l=[],c=0;c<u;c++)l[c]=e[c+a][c+o];return null!==r?n(l):l}(e,t,o,a,u,s)}throw new RangeError("Matrix for function diag must be 2 dimensional")}})),mu=Ze("identity",["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.BigNumber,a=e.DenseMatrix,s=e.SparseMatrix;return t("identity",{"":function(){return"Matrix"===n.matrix?r([]):[]},string:function(e){return r(e)},"number | BigNumber":function(e){return l(e,e,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return l(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return l(e,t,"Matrix"===n.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,n){return l(e,t,n)},Array:function(e){return u(e)},"Array, string":function(e,t){return u(e,t)},Matrix:function(e){return u(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return u(e.valueOf(),t)}});function u(e,t){switch(e.length){case 0:return t?r(t):[];case 1:return l(e[0],e[0],t);case 2:return l(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function l(e,t,n){var r=o(e)||o(t)?i:null;if(o(e)&&(e=e.toNumber()),o(t)&&(t=t.toNumber()),!te(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!te(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var u=r?new i(1):1,l=r?new r(0):0,c=[e,t];if(n){if("sparse"===n)return s.diagonal(c,u,0,l);if("dense"===n)return a.diagonal(c,u,0,l);throw new TypeError('Unknown matrix type "'.concat(n,'"'))}for(var f=Be([],c,l),p=e<t?e:t,m=0;m<p;m++)f[m][m]=u;return f}})),du=Ze("ones",["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.BigNumber;return t("ones",{"":function(){return"Array"===n.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"===typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===n.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var n=function(e){var t=!1;return e.forEach((function(e,n,r){o(e)&&(t=!0,r[n]=e.toNumber())})),t}(e)?new i(1):1;if(function(e){e.forEach((function(e){if("number"!==typeof e||!te(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),t){var a=r(t);return e.length>0?a.resize(e,n):a}var s=[];return e.length>0?Be(s,e,n):s}})),hu=Ze("reshape",["typed","isInteger","matrix"],(function(e){var t=e.typed,n=e.isInteger,r=e.matrix;return t("reshape",{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):r(Pe(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach((function(e){if(!n(e))throw new TypeError("Invalid size for dimension: "+e)})),Pe(e,t)}})})),yu=Ze("size",["typed","config","?matrix"],(function(e){var t=e.typed,n=e.config,r=e.matrix;return t("size",{Matrix:function(e){return e.create(e.size())},Array:ze,string:function(e){return"Array"===n.matrix?[e.length]:r([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===n.matrix?[]:r?r([]):sn()}})})),gu=Ze("zeros",["typed","config","matrix","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.BigNumber;return t("zeros",{"":function(){return"Array"===n.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"===typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===n.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var n=function(e){var t=!1;return e.forEach((function(e,n,r){o(e)&&(t=!0,r[n]=e.toNumber())})),t}(e)?new i(0):0;if(function(e){e.forEach((function(e){if("number"!==typeof e||!te(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),t){var a=r(t);return e.length>0?a.resize(e,n):a}var s=[];return e.length>0?Be(s,e,n):s}})),vu=Ze("to",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix,r=Qs({typed:t}),i=Js({typed:t});return t("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return r(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"Matrix, any":function(e,t){return i(e,t,this,!1)},"any, Matrix":function(e,t){return i(t,e,this,!0)},"Array, any":function(e,t){return i(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return i(n(t),e,this,!0).valueOf()}})}));function xu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xu(Object(n),!0).forEach((function(t){wu(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Nu="Number of decimals in function round must be an integer",Eu=Ze("round",["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.zeros,a=e.BigNumber,o=e.DenseMatrix,s=nu({typed:t,equalScalar:r}),u=ru({typed:t,DenseMatrix:o}),l=Js({typed:t});return t("round",bu(bu({},Su),{},{Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(Nu);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Nu);var n=t.toNumber();return e.round(n)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Nu);return new a(e).toDecimalPlaces(t.toNumber())},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Nu);return e.toDecimalPlaces(t.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(Nu);return e.round(t)},"Array | Matrix":function(e){return Gt(e,this,!0)},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"number | Complex | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):u(t,e,this,!0)},"number | Complex | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return l(n(e),t,this,!1).valueOf()},"number | Complex | BigNumber, Array":function(e,t){return l(n(t),e,this,!0).valueOf()}}))})),Su={number:Fa,"number, number":function(e,t){if(!te(t))throw new TypeError(Nu);if(t<0||t>15)throw new Error("Number of decimals in function round must be in te range of 0-15");return Fa(e,t)}},Mu=Ze("algorithm08",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,l=e._datatype,c=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype;if(u.length!==m.length)throw new _e(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");if(!a||!c)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var h,y=u[0],g=u[1],v=n,x=0,b=i;"string"===typeof l&&l===d&&(h=l,v=t.find(n,[h,h]),x=t.convert(0,h),b=t.find(i,[h,h]));for(var w,N,E,S,M=[],T=[],A=[],O=[],C=[],_=0;_<g;_++){A[_]=T.length;var k=_+1;for(N=s[_],E=s[_+1],w=N;w<E;w++)C[S=o[w]]=k,O[S]=a[w],T.push(S);for(N=p[_],E=p[_+1],w=N;w<E;w++)C[S=f[w]]===k&&(O[S]=b(O[S],c[w]));for(w=A[_];w<T.length;){var z=O[S=T[w]];v(z,x)?T.splice(w,1):(M.push(z),w++)}}return A[g]=T.length,e.createSparseMatrix({values:M,index:T,ptr:A,size:[y,g],datatype:h})}})),Tu=Ze("leftShift",["typed","matrix","equalScalar","zeros","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=Gs({typed:t}),s=Ks({typed:t,equalScalar:r}),u=Mu({typed:t,equalScalar:r}),l=Ys({typed:t,DenseMatrix:a}),c=nu({typed:t,equalScalar:r}),f=Qs({typed:t}),p=Js({typed:t});return t("leftShift",{"number, number":so,"BigNumber, BigNumber":eo,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():p(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):p(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}})})),Au=Ze("rightLogShift",["typed","matrix","equalScalar","zeros","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=Gs({typed:t}),s=Ks({typed:t,equalScalar:r}),u=Mu({typed:t,equalScalar:r}),l=Ys({typed:t,DenseMatrix:a}),c=nu({typed:t,equalScalar:r}),f=Qs({typed:t}),p=Js({typed:t});return t("rightLogShift",{"number, number":lo,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():p(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):p(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}})})),Ou=Ze("compare",["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix"],(function(e){var t=e.typed,n=e.config,r=e.equalScalar,i=e.matrix,a=e.BigNumber,o=e.Fraction,s=e.DenseMatrix,u=eu({typed:t}),l=tu({typed:t,equalScalar:r}),c=ru({typed:t,DenseMatrix:s}),f=Qs({typed:t}),p=Js({typed:t});return t("compare",{"boolean, boolean":function(e,t){return e===t?0:e>t?1:-1},"number, number":function(e,t){return he(e,t,n.epsilon)?0:e>t?1:-1},"BigNumber, BigNumber":function(e,t){return pa(e,t,n.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")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return l(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return this(i(e),t)},"Matrix, Array":function(e,t){return this(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,this,!1)},"DenseMatrix, any":function(e,t){return p(e,t,this,!1)},"any, SparseMatrix":function(e,t){return c(t,e,this,!0)},"any, DenseMatrix":function(e,t){return p(t,e,this,!0)},"Array, any":function(e,t){return p(i(e),t,this,!1).valueOf()},"any, Array":function(e,t){return p(i(t),e,this,!0).valueOf()}})})),Cu=Ze("compareText",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix,r=Qs({typed:t}),i=Js({typed:t});return t("compareText",{"any, any":Ce,"DenseMatrix, DenseMatrix":function(e,t){return r(e,t,Ce)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"DenseMatrix, any":function(e,t){return i(e,t,Ce,!1)},"any, DenseMatrix":function(e,t){return i(t,e,Ce,!0)},"Array, any":function(e,t){return i(n(e),t,Ce,!1).valueOf()},"any, Array":function(e,t){return i(n(t),e,Ce,!0).valueOf()}})})),_u=Ze("smaller",["typed","config","matrix","DenseMatrix"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.DenseMatrix,a=eu({typed:t}),o=lu({typed:t,DenseMatrix:i}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("smaller",{"boolean, boolean":function(e,t){return e<t},"number, number":function(e,t){return e<t&&!he(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lt(t)&&!pa(e,t,n.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")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,this,!0).valueOf()}})})),ku=Ze("larger",["typed","config","matrix","DenseMatrix"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.DenseMatrix,a=eu({typed:t}),o=lu({typed:t,DenseMatrix:i}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("larger",{"boolean, boolean":function(e,t){return e>t},"number, number":function(e,t){return e>t&&!he(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gt(t)&&!pa(e,t,n.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")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,this,!0).valueOf()}})})),zu=Ze("unequal",["typed","config","equalScalar","matrix","DenseMatrix"],(function(e){var t=e.typed,n=(e.config,e.equalScalar),r=e.matrix,i=e.DenseMatrix,a=eu({typed:t}),o=lu({typed:t,DenseMatrix:i}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("unequal",{"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:c(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,c)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,c,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,c,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,c)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,c,!1)},"DenseMatrix, any":function(e,t){return l(e,t,c,!1)},"any, SparseMatrix":function(e,t){return s(t,e,c,!0)},"any, DenseMatrix":function(e,t){return l(t,e,c,!0)},"Array, any":function(e,t){return l(r(e),t,c,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,c,!0).valueOf()}});function c(e,t){return!n(e,t)}})),Iu=(Ze("unequal",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return t("unequal",{"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:!n(e,t)}})})),Ze("ImmutableDenseMatrix",["smaller","DenseMatrix"],(function(e){var t=e.smaller,n=e.DenseMatrix;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(p(e)||f(e)){var i=new n(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min="undefined"!==typeof e.min?e.min:null,this._max="undefined"!==typeof e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+$(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return r.prototype=new n,r.prototype.type="ImmutableDenseMatrix",r.prototype.isImmutableDenseMatrix=!0,r.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return p(t)?new r({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")}},r.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},r.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},r.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},r.prototype.clone=function(){return new r({data:V(this._data),size:V(this._size),datatype:this._datatype})},r.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.fromJSON=function(e){return new r(e)},r.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},r.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(n){(null===e||t(n,e))&&(e=n)})),this._min=null!==e?e:void 0}return this._min},r.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(n){(null===e||t(e,n))&&(e=n)})),this._max=null!==e?e:void 0}return this._max},r}),{isClass:!0})),Du=Ze("FibonacciHeap",["smaller","larger"],(function(e){var t=e.smaller,n=e.larger,r=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,n){t.left.right=t.right,t.right.left=t.left,n.degree--,n.child===t&&(n.child=t.right),0===n.degree&&(n.child=null),t.left=e,t.right=e.right,e.right=t,t.right.left=t,t.parent=null,t.mark=!1}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,n){var r={key:e,value:n,degree:0};if(this._minimum){var i=this._minimum;r.left=i,r.right=i.right,i.right=r,r.right.left=r,t(e,i.key)&&(this._minimum=r)}else r.left=r,r.right=r,this._minimum=r;return this._size++,r},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var i=this._minimum,a=e.degree,s=e.child;a>0;){var u=s.right;s.left.right=s.right,s.right.left=s.left,s.left=i,s.right=i.right,i.right=s,s.right.left=s,s.parent=null,s=u,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,s=Math.floor(Math.log(i)*r)+1,u=new Array(s),l=0,c=e;if(c)for(l++,c=c.right;c!==e;)l++,c=c.right;for(;l>0;){for(var f=c.degree,p=c.right;a=u[f];){if(n(c.key,a.key)){var m=a;a=c,c=m}o(a,c),u[f]=null,f++}u[f]=c,c=p,l--}e=null;for(var d=0;d<s;d++)(a=u[d])&&(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,n,r){n.key=r;var i=n.parent;i&&t(n.key,i.key)&&(a(e,n,i),function e(t,n){var r=n.parent;if(!r)return;n.mark?(a(t,n,r),e(r)):n.mark=!0}(e,i));t(n.key,e.key)&&(e=n);return e}(this._minimum,e,-1),this.extractMinimum()};var o=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}),Bu=Ze("sparse",["typed","SparseMatrix"],(function(e){var t=e.typed,n=e.SparseMatrix;return t("sparse",{"":function(){return new n([])},string:function(e){return new n([],e)},"Array | Matrix":function(e){return new n(e)},"Array | Matrix, string":function(e,t){return new n(e,t)}})})),Pu=Ze("acoth",["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.Complex,i=e.BigNumber;return t("acoth",{number:function(e){return e>=1||e<=-1||n.predictable?Po(e):new r(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()},"Array | Matrix":function(e){return Gt(e,this)}})})),qu=Ze("algorithm09",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return function(e,r,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,l=e._datatype,c=r._values,f=r._index,p=r._ptr,m=r._size,d=r._datatype;if(u.length!==m.length)throw new _e(u.length,m.length);if(u[0]!==m[0]||u[1]!==m[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+m+")");var h,y=u[0],g=u[1],v=n,x=0,b=i;"string"===typeof l&&l===d&&(h=l,v=t.find(n,[h,h]),x=t.convert(0,h),b=t.find(i,[h,h]));var w,N,E,S,M,T=a&&c?[]:void 0,A=[],O=[],C=T?[]:void 0,_=[];for(N=0;N<g;N++){O[N]=A.length;var k=N+1;if(C)for(S=p[N],M=p[N+1],E=S;E<M;E++)_[w=f[E]]=k,C[w]=c[E];for(S=s[N],M=s[N+1],E=S;E<M;E++)if(w=o[E],C){var z=_[w]===k?C[w]:x,I=b(a[E],z);v(I,x)||(A.push(w),T.push(I))}else A.push(w)}return O[g]=A.length,e.createSparseMatrix({values:T,index:A,ptr:O,size:[y,g],datatype:h})}})),Ru=Ze("atan2",["typed","matrix","equalScalar","BigNumber","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.BigNumber,a=e.DenseMatrix,o=Ks({typed:t,equalScalar:r}),s=eu({typed:t}),u=qu({typed:t,equalScalar:r}),l=nu({typed:t,equalScalar:r}),c=ru({typed:t,DenseMatrix:a}),f=Qs({typed:t}),p=Js({typed:t});return t("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return i.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return l(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return p(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return c(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return p(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return p(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return p(n(t),e,this,!0).valueOf()}})})),Uu=Ze("sec",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("sec",{number:Go,Complex:function(e){return e.sec()},BigNumber:function(e){return new n(1).div(e.cos())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),Fu=Ze("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.addScalar,i=e.equalScalar,a=e.DenseMatrix,o=(e.SparseMatrix,Gs({typed:t})),s=Zs({typed:t,equalScalar:i}),u=Ys({typed:t,DenseMatrix:a}),l=Qs({typed:t}),c=Js({typed:t});return t("add",G({"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,r)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,r,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,r,!0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,r)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"DenseMatrix, any":function(e,t){return c(e,t,r,!1)},"SparseMatrix, any":function(e,t){return u(e,t,r,!1)},"any, DenseMatrix":function(e,t){return c(t,e,r,!0)},"any, SparseMatrix":function(e,t){return u(t,e,r,!0)},"Array, any":function(e,t){return c(n(e),t,r,!1).valueOf()},"any, Array":function(e,t){return c(n(t),e,r,!0).valueOf()},"any, any":r,"any, any, ...any":function(e,t,n){for(var r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}},r.signatures))})),ju=Ze("dot",["typed","addScalar","multiplyScalar","conj","size"],(function(e){var t=e.typed,n=e.addScalar,r=e.multiplyScalar,i=e.conj,a=e.size;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var u=o(e,a),l=p(e)?e._data:e,c=p(e)?e._datatype:void 0,f=p(a)?a._data:a,m=p(a)?a._datatype:void 0,d=2===s(e).length,h=2===s(a).length,y=n,g=r;if(c&&m&&c===m&&"string"===typeof c){var v=c;y=t.find(n,[v,v]),g=t.find(r,[v,v])}if(!d&&!h){for(var x=g(i(l[0]),f[0]),b=1;b<u;b++)x=y(x,g(i(l[b]),f[b]));return x}if(!d&&h){for(var w=g(i(l[0]),f[0][0]),N=1;N<u;N++)w=y(w,g(i(l[N]),f[N][0]));return w}if(d&&!h){for(var E=g(i(l[0][0]),f[0]),S=1;S<u;S++)E=y(E,g(i(l[S][0]),f[S]));return E}if(d&&h){for(var M=g(i(l[0][0]),f[0][0]),T=1;T<u;T++)M=y(M,g(i(l[T][0]),f[T][0]));return M}},"SparseMatrix, SparseMatrix":function(e,t){o(e,t);var i=e._index,a=e._values,s=t._index,u=t._values,l=0,c=n,f=r,p=0,m=0;for(;p<i.length&&m<s.length;){var d=i[p],h=s[m];d<h?p++:d>h?m++:d===h&&(l=c(l,f(a[p],u[m])),p++,m++)}return l}});function o(e,t){var n,r,i=s(e),a=s(t);if(1===i.length)n=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(", ")+")");n=i[0]}if(1===a.length)r=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(", ")+")");r=a[0]}if(n!==r)throw new RangeError("Vectors must have equal length ("+n+" != "+r+")");if(0===n)throw new RangeError("Cannot calculate the dot product of empty vectors");return n}function s(e){return p(e)?e.size():a(e)}})),Lu=Ze("composition",["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],(function(e){var t=e.typed,n=e.addScalar,r=e.combinations,i=e.isPositive,a=(e.isNegative,e.isInteger),o=e.larger;return t("composition",{"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 r(n(e,-1),n(t,-1))}})})),$u=Ze("isZero",["typed"],(function(e){return(0,e.typed)("isZero",{number:ua,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:function(e){return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),Hu=Ze("abs",["typed"],(function(e){return(0,e.typed)("abs",{number:xa,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},Fraction:function(e){return e.abs()},"Array | Matrix":function(e){return Gt(e,this,!0)},Unit:function(e){return e.abs()}})})),Vu=Ze("floor",["typed","config","round"],(function(e){var t=e.typed,n=e.config,r=e.round;return t("floor",{number:function(e){return he(e,r(e),n.epsilon)?r(e):Math.floor(e)},Complex:function(e){return e.floor()},BigNumber:function(e){return pa(e,r(e),n.epsilon)?r(e):e.floor()},Fraction:function(e){return e.floor()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),Wu=Ze("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(function(e){var t=e.typed,n=e.matrix,r=e.addScalar,i=e.multiplyScalar,a=e.equalScalar,o=e.dot,s=nu({typed:t,equalScalar:a}),u=Js({typed:t});function l(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)")}}function c(e,n){if("dense"!==n.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,n){var a,o=e._data,s=e._size,u=e._datatype,l=n._data,c=n._size,f=n._datatype,p=s[0],m=c[1],d=r,h=i;u&&f&&u===f&&"string"===typeof u&&(a=u,d=t.find(r,[a,a]),h=t.find(i,[a,a]));for(var y=[],g=0;g<m;g++){for(var v=h(o[0],l[0][g]),x=1;x<p;x++)v=d(v,h(o[x],l[x][g]));y[g]=v}return e.createDenseMatrix({data:y,size:[m],datatype:a})}(e,n)}var f=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,n){var a,o=e._data,s=e._size,u=e._datatype,l=n._data,c=n._datatype,f=s[0],p=s[1],m=r,d=i;u&&c&&u===c&&"string"===typeof u&&(a=u,m=t.find(r,[a,a]),d=t.find(i,[a,a]));for(var h=[],y=0;y<f;y++){for(var g=o[y],v=d(g[0],l[0]),x=1;x<p;x++)v=m(v,d(g[x],l[x]));h[y]=v}return e.createDenseMatrix({data:h,size:[f],datatype:a})},"SparseMatrix, any":function(e,n){var o=e._values,s=e._index,u=e._ptr,l=e._datatype;if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var c,f=n._data,p=n._datatype,m=e._size[0],d=n._size[0],h=[],y=[],g=[],v=r,x=i,b=a,w=0;l&&p&&l===p&&"string"===typeof l&&(c=l,v=t.find(r,[c,c]),x=t.find(i,[c,c]),b=t.find(a,[c,c]),w=t.convert(0,c));var N=[],E=[];g[0]=0;for(var S=0;S<d;S++){var M=f[S];if(!b(M,w))for(var T=u[S],A=u[S+1],O=T;O<A;O++){var C=s[O];E[C]?N[C]=v(N[C],x(M,o[O])):(E[C]=!0,y.push(C),N[C]=x(M,o[O]))}}for(var _=y.length,k=0;k<_;k++){var z=y[k];h[k]=N[z]}return g[1]=y.length,e.createSparseMatrix({values:h,index:y,ptr:g,size:[m,1],datatype:c})}}),m=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,n){var a,o=e._data,s=e._size,u=e._datatype,l=n._data,c=n._size,f=n._datatype,p=s[0],m=s[1],d=c[1],h=r,y=i;u&&f&&u===f&&"string"===typeof u&&(a=u,h=t.find(r,[a,a]),y=t.find(i,[a,a]));for(var g=[],v=0;v<p;v++){var x=o[v];g[v]=[];for(var b=0;b<d;b++){for(var w=y(x[0],l[0][b]),N=1;N<m;N++)w=h(w,y(x[N],l[N][b]));g[v][b]=w}}return e.createDenseMatrix({data:g,size:[p,d],datatype:a})},"DenseMatrix, SparseMatrix":function(e,n){var o=e._data,s=e._size,u=e._datatype,l=n._values,c=n._index,f=n._ptr,p=n._size,m=n._datatype;if(!l)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var d,h=s[0],y=p[1],g=r,v=i,x=a,b=0;u&&m&&u===m&&"string"===typeof u&&(d=u,g=t.find(r,[d,d]),v=t.find(i,[d,d]),x=t.find(a,[d,d]),b=t.convert(0,d));for(var w=[],N=[],E=[],S=n.createSparseMatrix({values:w,index:N,ptr:E,size:[h,y],datatype:d}),M=0;M<y;M++){E[M]=N.length;var T=f[M],A=f[M+1];if(A>T)for(var O=0,C=0;C<h;C++){for(var _=C+1,k=void 0,z=T;z<A;z++){var I=c[z];O!==_?(k=v(o[C][I],l[z]),O=_):k=g(k,v(o[C][I],l[z]))}O!==_||x(k,b)||(N.push(C),w.push(k))}}return E[y]=N.length,S},"SparseMatrix, DenseMatrix":function(e,n){var o=e._values,s=e._index,u=e._ptr,l=e._datatype;if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var c,f=n._data,p=n._datatype,m=e._size[0],d=n._size[0],h=n._size[1],y=r,g=i,v=a,x=0;l&&p&&l===p&&"string"===typeof l&&(c=l,y=t.find(r,[c,c]),g=t.find(i,[c,c]),v=t.find(a,[c,c]),x=t.convert(0,c));for(var b=[],w=[],N=[],E=e.createSparseMatrix({values:b,index:w,ptr:N,size:[m,h],datatype:c}),S=[],M=[],T=0;T<h;T++){N[T]=w.length;for(var A=T+1,O=0;O<d;O++){var C=f[O][T];if(!v(C,x))for(var _=u[O],k=u[O+1],z=_;z<k;z++){var I=s[z];M[I]!==A?(M[I]=A,w.push(I),S[I]=g(C,o[z])):S[I]=y(S[I],g(C,o[z]))}}for(var D=N[T],B=w.length,P=D;P<B;P++){var q=w[P];b[P]=S[q]}}return N[h]=w.length,E},"SparseMatrix, SparseMatrix":function(e,n){var a,o=e._values,s=e._index,u=e._ptr,l=e._datatype,c=n._values,f=n._index,p=n._ptr,m=n._datatype,d=e._size[0],h=n._size[1],y=o&&c,g=r,v=i;l&&m&&l===m&&"string"===typeof l&&(a=l,g=t.find(r,[a,a]),v=t.find(i,[a,a]));for(var x,b,w,N,E,S,M,T,A=y?[]:void 0,O=[],C=[],_=e.createSparseMatrix({values:A,index:O,ptr:C,size:[d,h],datatype:a}),k=y?[]:void 0,z=[],I=0;I<h;I++){C[I]=O.length;var D=I+1;for(E=p[I],S=p[I+1],N=E;N<S;N++)if(T=f[N],y)for(b=u[T],w=u[T+1],x=b;x<w;x++)M=s[x],z[M]!==D?(z[M]=D,O.push(M),k[M]=v(c[N],o[x])):k[M]=g(k[M],v(c[N],o[x]));else for(b=u[T],w=u[T+1],x=b;x<w;x++)M=s[x],z[M]!==D&&(z[M]=D,O.push(M));if(y)for(var B=C[I],P=O.length,q=B;q<P;q++){var R=O[q];A[q]=k[R]}}return C[h]=O.length,_}});return t("multiply",G({"Array, Array":function(e,t){l(ze(e),ze(t));var r=this(n(e),n(t));return p(r)?r.valueOf():r},"Matrix, Matrix":function(e,t){var n=e.size(),r=t.size();return l(n,r),1===n.length?1===r.length?function(e,t,n){if(0===n)throw new Error("Cannot multiply two empty vectors");return o(e,t)}(e,t,n[0]):c(e,t):1===r.length?f(e,t):m(e,t)},"Matrix, Array":function(e,t){return this(e,n(t))},"Array, Matrix":function(e,t){return this(n(e,t.storage()),t)},"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return u(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return u(t,e,i,!0)},"Array, any":function(e,t){return u(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":function(e,t,n){for(var r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}},i.signatures))})),Gu=Ze("dotMultiply",["typed","matrix","equalScalar","multiplyScalar"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.multiplyScalar,a=Ks({typed:t,equalScalar:r}),o=qu({typed:t,equalScalar:r}),s=nu({typed:t,equalScalar:r}),u=Qs({typed:t}),l=Js({typed:t});return t("dotMultiply",{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,i)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return l(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return l(t,e,i,!0)},"Array, any":function(e,t){return l(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return l(n(t),e,i,!0).valueOf()}})})),Zu=Ze("re",["typed"],(function(e){return(0,e.typed)("re",{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.re},"Array | Matrix":function(e){return Gt(e,this)}})})),Yu=Ze("flatten",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix;return t("flatten",{Array:function(e){return Ue(V(e))},Matrix:function(e){var t=Ue(V(e.toArray()));return n(t)}})}));function Qu(e,t,n,r){if(!(this instanceof Qu))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=n,this.max=r,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+n+(void 0!==r&&null!==r?"-"+r:"")+" expected)",this.stack=(new Error).stack}Qu.prototype=new Error,Qu.prototype.constructor=Error,Qu.prototype.name="ArgumentsError",Qu.prototype.isArgumentsError=!0;var Ju=Ze("resize",["config","matrix"],(function(e){var t=e.config,n=e.matrix;return function(e,i,a){if(2!==arguments.length&&3!==arguments.length)throw new Qu("resize",arguments.length,2,3);if(p(i)&&(i=i.valueOf()),o(i[0])&&(i=i.map((function(e){return o(e)?e.toNumber():e}))),p(e))return e.resize(i,a,!0);if("string"===typeof e)return r(e,i,a);var s=!Array.isArray(e)&&"Array"!==t.matrix;if(0===i.length){for(;Array.isArray(e);)e=e[0];return V(e)}Array.isArray(e)||(e=[e]);var u=Be(e=V(e),i,a);return s?n(u):u};function r(e,t,n){if(void 0!==n){if("string"!==typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";if(1!==t.length)throw new _e(t.length,1);var r=t[0];if("number"!==typeof r||!te(r))throw new TypeError("Invalid size, must contain positive integers (size: "+Te(t)+")");if(e.length>r)return e.substring(0,r);if(e.length<r){for(var i=e,a=0,o=r-e.length;a<o;a++)i+=n;return i}return e}})),Xu=Ze("squeeze",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix;return t("squeeze",{Array:function(e){return qe(V(e))},Matrix:function(e){var t=qe(e.toArray());return Array.isArray(t)?n(t):t},any:function(e){return V(e)}})})),Ku=Ze("pow",["typed","config","identity","multiply","matrix","fraction","number","Complex"],(function(e){var t=e.typed,n=e.config,r=e.identity,i=e.multiply,a=e.matrix,o=e.number,s=e.fraction,u=e.Complex;return t("pow",{"number, number":l,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||n.predictable?e.pow(t):new u(e.toNumber(),0).pow(t.toNumber(),0)},"Fraction, Fraction":function(e,t){if(1!==t.d){if(n.predictable)throw new Error("Function pow does not support non-integer exponents for fractions.");return l(e.valueOf(),t.valueOf())}return e.pow(t)},"Array, number":c,"Array, BigNumber":function(e,t){return c(e,t.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(e,t){return f(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function l(e,t){if(n.predictable&&!te(t)&&e<0)try{var r=s(t),i=o(r);if((t===i||Math.abs((t-i)/t)<1e-14)&&r.d%2===1)return(r.n%2===0?1:-1)*Math.pow(-e,t)}catch(a){}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:te(t)||e>=0||n.predictable?Ua(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new u(e,0).pow(t,0)}function c(e,t){if(!te(t)||t<0)throw new TypeError("For A^b, b must be a positive integer (value is "+t+")");var n=ze(e);if(2!==n.length)throw new Error("For A^b, A must be 2 dimensional (A has "+n.length+" dimensions)");if(n[0]!==n[1])throw new Error("For A^b, A must be square (size is "+n[0]+"x"+n[1]+")");for(var a=r(n[0]).valueOf(),o=e;t>=1;)1===(1&t)&&(a=i(o,a)),t>>=1,o=i(o,o);return a}function f(e,t){return a(c(e.valueOf(),t))}})),el=Ze("dotPow",["typed","equalScalar","matrix","pow","DenseMatrix"],(function(e){var t=e.typed,n=e.equalScalar,r=e.matrix,i=e.pow,a=e.DenseMatrix,o=eu({typed:t}),s=lu({typed:t,DenseMatrix:a}),u=nu({typed:t,equalScalar:n}),l=ru({typed:t,DenseMatrix:a}),c=Qs({typed:t}),f=Js({typed:t});return t("dotPow",{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,i)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return f(e,t,this,!1)},"any, SparseMatrix":function(e,t){return l(t,e,this,!0)},"any, DenseMatrix":function(e,t){return f(t,e,this,!0)},"Array, any":function(e,t){return f(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return f(r(t),e,this,!0).valueOf()}})})),tl=Ze("rightArithShift",["typed","matrix","equalScalar","zeros","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.zeros,a=e.DenseMatrix,o=Gs({typed:t}),s=Ks({typed:t,equalScalar:r}),u=Mu({typed:t,equalScalar:r}),l=Ys({typed:t,DenseMatrix:a}),c=nu({typed:t,equalScalar:r}),f=Qs({typed:t}),p=Js({typed:t});return t("rightArithShift",{"number, number":uo,"BigNumber, BigNumber":to,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():c(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return r(t,0)?e.clone():p(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):l(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return r(e,0)?i(t.size(),t.storage()):p(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return this(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return this(e,n(t)).valueOf()}})})),nl=n(4),rl=n.n(nl),il=Ze("compareNatural",["typed","compare"],(function(e){var t=e.typed,n=e.compare,r=n.signatures["boolean,boolean"];return t("compareNatural",{"any, any":function(e,t){var a,o=$(e),s=$(t);if(("number"===o||"BigNumber"===o||"Fraction"===o)&&("number"===s||"BigNumber"===s||"Fraction"===s))return"0"!==(a=n(e,t)).toString()?a>0?1:-1:rl()(o,s);if("Array"===o||"Matrix"===o||"Array"===s||"Matrix"===s)return 0!==(a=function e(t,n,r){if(h(n)&&h(r))return i(t,n.toJSON().values,r.toJSON().values);if(h(n))return e(t,n.toArray(),r);if(h(r))return e(t,n,r.toArray());if(d(n))return e(t,n.toJSON().data,r);if(d(r))return e(t,n,r.toJSON().data);if(!Array.isArray(n))return e(t,[n],r);if(!Array.isArray(r))return e(t,n,[r]);return i(t,n,r)}(this,e,t))?a:rl()(o,s);if(o!==s)return rl()(o,s);if("Complex"===o)return function(e,t){if(e.re>t.re)return 1;if(e.re<t.re)return-1;if(e.im>t.im)return 1;if(e.im<t.im)return-1;return 0}(e,t);if("Unit"===o)return e.equalBase(t)?this(e.value,t.value):i(this,e.formatUnits(),t.formatUnits());if("boolean"===o)return r(e,t);if("string"===o)return rl()(e,t);if("Object"===o)return function(e,t,n){var r=Object.keys(t),a=Object.keys(n);r.sort(rl.a),a.sort(rl.a);var o=i(e,r,a);if(0!==o)return o;for(var s=0;s<r.length;s++){var u=e(t[r[s]],n[a[s]]);if(0!==u)return u}return 0}(this,e,t);if("null"===o)return 0;if("undefined"===o)return 0;throw new TypeError('Unsupported type of value "'+o+'"')}});function i(e,t,n){for(var r=0,i=Math.min(t.length,n.length);r<i;r++){var a=e(t[r],n[r]);if(0!==a)return a}return t.length>n.length?1:t.length<n.length?-1:0}}));var al=Ze("equalText",["typed","compareText","isZero"],(function(e){var t=e.typed,n=e.compareText,r=e.isZero;return t("equalText",{"any, any":function(e,t){return r(n(e,t))}})})),ol=Ze("largerEq",["typed","config","matrix","DenseMatrix"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.DenseMatrix,a=eu({typed:t}),o=lu({typed:t,DenseMatrix:i}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("largerEq",{"boolean, boolean":function(e,t){return e>=t},"number, number":function(e,t){return e>=t||he(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.gte(t)||pa(e,t,n.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")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,this,!0).valueOf()}})})),sl=Ze("partitionSelect",["typed","isNumeric","isNaN","compare"],(function(e){var t=e.typed,n=e.isNumeric,r=e.isNaN,i=e.compare,a=i,o=function(e,t){return-i(e,t)};return t("partitionSelect",{"Array | Matrix, number":function(e,t){return s(e,t,a)},"Array | Matrix, number, string":function(e,t,n){if("asc"===n)return s(e,t,a);if("desc"===n)return s(e,t,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(e,t,n){if(!te(t)||t<0)throw new Error("k must be a non-negative integer");if(p(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return u(e.valueOf(),t,n)}if(Array.isArray(e))return u(e,t,n)}function u(e,t,i){if(t>=e.length)throw new Error("k out of bounds");for(var a=0;a<e.length;a++)if(n(e[a])&&r(e[a]))return e[a];for(var o=0,s=e.length-1;o<s;){for(var u=o,l=s,c=e[Math.floor(Math.random()*(s-o+1))+o];u<l;)if(i(e[u],c)>=0){var f=e[l];e[l]=e[u],e[u]=f,--l}else++u;i(e[u],c)>0&&--u,t<=u?s=u:o=u+1}return e[t]}})),ul=Ze("Index",["ImmutableDenseMatrix"],(function(e){var t=e.ImmutableDenseMatrix;function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var t=0,i=arguments.length;t<i;t++){var a=arguments[t];if(y(a))this._dimensions.push(a),this._isScalar=!1;else if(Array.isArray(a)||p(a)){var o=r(a.valueOf());this._dimensions.push(o);var s=o.size();1===s.length&&1===s[0]||(this._isScalar=!1)}else if("number"===typeof a)this._dimensions.push(r([a]));else{if("string"!==typeof a)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");this._dimensions.push(a)}}}function r(e){for(var n=0,r=e.length;n<r;n++)if("number"!==typeof e[n]||!te(e[n]))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=V(this._dimensions),e._isScalar=this._isScalar,e},n.create=function(e){var t=new n;return n.apply(t,e),t},n.prototype.size=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"===typeof r?1:r.size()[0]}return e},n.prototype.max=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"===typeof r?r:r.max()}return e},n.prototype.min=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e[t]="string"===typeof r?r:r.min()}return e},n.prototype.forEach=function(e){for(var t=0,n=this._dimensions.length;t<n;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,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];e.push("string"===typeof r?r:r.toArray())}return e},n.prototype.valueOf=n.prototype.toArray,n.prototype.toString=function(){for(var e=[],t=0,n=this._dimensions.length;t<n;t++){var r=this._dimensions[t];"string"===typeof r?e.push(JSON.stringify(r)):e.push(r.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}),ll=Ze("asech",["typed","config","Complex","BigNumber"],(function(e){var t=e.typed,n=e.config,r=e.Complex,i=e.BigNumber;return t("asech",{number:function(e){if(e<=1&&e>=-1||n.predictable){var t=1/e;if(t>0||n.predictable)return Fo(e);var i=Math.sqrt(t*t-1);return new r(Math.log(i-t),Math.PI)}return new r(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()},"Array | Matrix":function(e){return Gt(e,this)}})})),cl=Ze("tan",["typed"],(function(e){return(0,e.typed)("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),fl=Ze("setDifference",["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t("setDifference",{"Array | Matrix, Array | Matrix":function(e,t){var s;if(0===r(n(e),new a(0)))s=[];else{if(0===r(n(t),new a(0)))return Ue(e.toArray());var u,l=Ve(Ue(Array.isArray(e)?e:e.toArray()).sort(i)),c=Ve(Ue(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var f=0;f<l.length;f++){u=!1;for(var p=0;p<c.length;p++)if(0===i(l[f].value,c[p].value)&&l[f].identifier===c[p].identifier){u=!0;break}u||s.push(l[f])}}return Array.isArray(e)&&Array.isArray(t)?We(s):new o(We(s))}})})),pl=Ze("setIntersect",["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t("setIntersect",{"Array | Matrix, Array | Matrix":function(e,t){var s;if(0===r(n(e),new a(0))||0===r(n(t),new a(0)))s=[];else{var u=Ve(Ue(Array.isArray(e)?e:e.toArray()).sort(i)),l=Ve(Ue(Array.isArray(t)?t:t.toArray()).sort(i));s=[];for(var c=0;c<u.length;c++)for(var f=0;f<l.length;f++)if(0===i(u[c].value,l[f].value)&&u[c].identifier===l[f].identifier){s.push(u[c]);break}}return Array.isArray(e)&&Array.isArray(t)?We(s):new o(We(s))}})})),ml=Ze("setMultiplicity",["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index;return t("setMultiplicity",{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===r(n(t),new a(0)))return 0;for(var o=Ue(Array.isArray(t)?t:t.toArray()),s=0,u=0;u<o.length;u++)0===i(o[u],e)&&s++;return s}})})),dl=Ze("setSize",["typed","compareNatural"],(function(e){var t=e.typed,n=e.compareNatural;return t("setSize",{"Array | Matrix":function(e){return Array.isArray(e)?Ue(e).length:Ue(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?Ue(e).length:Ue(e.toArray()).length;for(var r=Ue(Array.isArray(e)?e:e.toArray()).sort(n),i=1,a=1;a<r.length;a++)0!==n(r[a],r[a-1])&&i++;return i}})})),hl=Ze("trace",["typed","matrix","add"],(function(e){var t=e.typed,n=e.matrix,r=e.add;return t("trace",{Array:function(e){return i(n(e))},SparseMatrix:function(e){var t=e._values,n=e._index,i=e._ptr,a=e._size,o=a[0],s=a[1];if(o===s){var u=0;if(t.length>0)for(var l=0;l<s;l++)for(var c=i[l],f=i[l+1],p=c;p<f;p++){var m=n[p];if(m===l){u=r(u,t[p]);break}if(m>l)break}return u}throw new RangeError("Matrix must be square (size: "+Te(a)+")")},DenseMatrix:i,any:V});function i(e){var t=e._size,n=e._data;switch(t.length){case 1:if(1===t[0])return V(n[0]);throw new RangeError("Matrix must be square (size: "+Te(t)+")");case 2:var i=t[0];if(i===t[1]){for(var a=0,o=0;o<i;o++)a=r(a,n[o][o]);return a}throw new RangeError("Matrix must be square (size: "+Te(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+Te(t)+")")}}})),yl=Ze("quantileSeq",["typed","add","multiply","partitionSelect","compare"],(function(e){var t=e.typed,n=e.add,r=e.multiply,i=e.partitionSelect,s=e.compare;function u(e,t,o){var u=Ue(e),c=u.length;if(0===c)throw new Error("Cannot calculate quantile of an empty sequence");if(a(t)){var f=t*(c-1),p=f%1;if(0===p){var m=o?u[f]:i(u,f);return l(m),m}var d,h,y=Math.floor(f);if(o)d=u[y],h=u[y+1];else{h=i(u,y+1),d=u[y];for(var g=0;g<y;++g)s(u[g],d)>0&&(d=u[g])}return l(d),l(h),n(r(d,1-p),r(h,p))}var v=t.times(c-1);if(v.isInteger()){v=v.toNumber();var x=o?u[v]:i(u,v);return l(x),x}var b,w,N=v.floor(),E=v.minus(N),S=N.toNumber();if(o)b=u[S],w=u[S+1];else{w=i(u,S+1),b=u[S];for(var M=0;M<S;++M)s(u[M],b)>0&&(b=u[M])}l(b),l(w);var T=new E.constructor(1);return n(r(b,T.minus(E)),r(w,E))}var l=t({"number | BigNumber | Unit":function(e){return e}});return function(e,t,n){var r,i,s;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(m(e)){if("boolean"===typeof(n=n||!1)){if(i=e.valueOf(),a(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return u(i,t,n);if(t>1){if(!te(t))throw new Error("N must be a positive integer");var l=t+1;r=new Array(t);for(var c=0;c<t;)r[c]=u(i,++c/l,n);return r}}if(o(t)){var f=t.constructor;if(t.isNegative())throw new Error("N/prob must be non-negative");if(s=new f(1),t.lte(s))return new f(u(i,t,n));if(t.gt(s)){if(!t.isInteger())throw new Error("N must be a positive integer");var p=t.toNumber();if(p>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 d=new f(p+1);r=new Array(p);for(var h=0;h<p;)r[h]=new f(u(i,new f(++h).div(d),n));return r}}if(Array.isArray(t)){r=new Array(t.length);for(var y=0;y<r.length;++y){var g=t[y];if(a(g)){if(g<0||g>1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!o(g))throw new TypeError("Unexpected type of argument in function quantileSeq");if(s=new g.constructor(1),g.isNegative()||g.gt(s))throw new Error("Probability must be between 0 and 1, inclusive")}r[y]=u(i,g,n)}return r}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}));function gl(e){var t;if(te(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:us(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*gl(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,r=n*e,i=r*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*r)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,t=xl[0];for(var o=1;o<xl.length;++o)t+=xl[o]/(e+o);var s=e+vl+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,e+.5)*Math.exp(-s)*t}gl.signature="number";var vl=4.7421875,xl=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],bl=Ze("gamma",["typed","config","multiplyScalar","pow","BigNumber","Complex"],(function(e){var t=e.typed,n=e.config,r=e.multiplyScalar,i=e.pow,a=e.BigNumber,o=e.Complex;return t("gamma",{number:gl,Complex:function(e){if(0===e.im)return this(e.re);e=new o(e.re-1,e.im);for(var t=new o(xl[0],0),n=1;n<xl.length;++n){var a=e.re+n,s=a*a+e.im*e.im;0!==s?(t.re+=xl[n]*a/s,t.im+=-xl[n]*e.im/s):t.re=xl[n]<0?-1/0:1/0}var u=new o(e.re+vl+.5,e.im),l=Math.sqrt(2*Math.PI);e.re+=.5;var c=i(u,e);0===c.im?c.re*=l:(0===c.re||(c.re*=l),c.im*=l);var f=Math.exp(-u.re);return u.re=f*Math.cos(-u.im),u.im=f*Math.sin(-u.im),r(r(c,u),t)},BigNumber:function(e){if(e.isInteger())return e.isNegative()||e.isZero()?new a(1/0):function e(t){if(t<8)return new a([1,1,2,6,24,120,720,5040][t]);var r=n.precision+(0|Math.log(t.toNumber())),i=a.clone({precision:r});if(t%2===1)return t.times(e(new a(t-1)));var o=t,s=new i(t),u=t.toNumber();for(;o>2;)u+=o-=2,s=s.times(u);return new a(s.toPrecision(a.precision))}(e.minus(1));if(!e.isFinite())return new a(e.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")},"Array | Matrix":function(e){return Gt(e,this)}})})),wl=Ze("bignumber",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("bignumber",{"":function(){return new n(0)},number:function(e){return new n(e+"")},string:function(e){return new n(e)},BigNumber:function(e){return e},Fraction:function(e){return new n(e.n).div(e.d).times(e.s)},null:function(e){return new n(0)},"Array | Matrix":function(e){return Gt(e,this)}})})),Nl=Ze("lcm",["typed","matrix","equalScalar"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=Ks({typed:t,equalScalar:r}),a=au({typed:t,equalScalar:r}),o=nu({typed:t,equalScalar:r}),s=Qs({typed:t}),u=Js({typed:t});return t("lcm",{"number, number":_a,"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;var n=e.times(t);for(;!t.isZero();){var r=t;t=e.mod(r),e=r}return n.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return o(e,t,this,!1)},"DenseMatrix, number | BigNumber":function(e,t){return u(e,t,this,!1)},"number | BigNumber, SparseMatrix":function(e,t){return o(t,e,this,!0)},"number | BigNumber, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, number | BigNumber":function(e,t){return u(n(e),t,this,!1).valueOf()},"number | BigNumber, Array":function(e,t){return u(n(t),e,this,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,n){for(var r=this(e,t),i=0;i<n.length;i++)r=this(r,n[i]);return r}})})),El=Ze("bitOr",["typed","matrix","equalScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.DenseMatrix,a=Gs({typed:t}),o=Zs({typed:t,equalScalar:r}),s=Ys({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("bitOr",{"number, number":ao,"BigNumber, BigNumber":Qa,"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(n(t),e,this,!0).valueOf()}})})),Sl=Ze("kron",["typed","matrix","multiplyScalar"],(function(e){var t=e.typed,n=e.matrix,r=e.multiplyScalar;return t("kron",{"Matrix, Matrix":function(e,t){return n(i(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(i(e.toArray(),t))},"Array, Matrix":function(e,t){return n(i(e,t.toArray()))},"Array, Array":i});function i(e,t){if(1===ze(e).length&&(e=[e]),1===ze(t).length&&(t=[t]),ze(e).length>2||ze(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 n=[],i=[];return e.map((function(e){return t.map((function(t){return i=[],n.push(i),e.map((function(e){return t.map((function(t){return i.push(r(e,t))}))}))}))}))&&n}})),Ml=Ze("transpose",["typed","matrix"],(function(e){var t=e.typed,n=e.matrix;return t("transpose",{Array:function(e){return this(n(e)).valueOf()},Matrix:function(e){var t,n=e.size();switch(n.length){case 1:t=e.clone();break;case 2:var r=n[0],i=n[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Te(n)+")");switch(e.storage()){case"dense":t=function(e,t,n){for(var r,i=e._data,a=[],o=0;o<n;o++){r=a[o]=[];for(var s=0;s<t;s++)r[s]=V(i[s][o])}return e.createDenseMatrix({data:a,size:[n,t],datatype:e._datatype})}(e,r,i);break;case"sparse":t=function(e,t,n){for(var r,i,a,o=e._values,s=e._index,u=e._ptr,l=o?[]:void 0,c=[],f=[],p=[],m=0;m<t;m++)p[m]=0;for(r=0,i=s.length;r<i;r++)p[s[r]]++;for(var d=0,h=0;h<t;h++)f.push(d),d+=p[h],p[h]=f[h];for(f.push(d),a=0;a<n;a++)for(var y=u[a],g=u[a+1],v=y;v<g;v++){var x=p[s[v]]++;c[x]=a,o&&(l[x]=V(o[v]))}return e.createSparseMatrix({values:l,index:c,ptr:f,size:[n,t],datatype:e._datatype})}(e,r,i)}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Te(this._size)+")")}return t},any:function(e){return V(e)}})})),Tl=Ze("numeric",["number","?bignumber","?fraction"],(function(e){var t=e.number,n=e.bignumber,r=e.fraction,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:function(e){return t(e)},BigNumber:n?function(e){return n(e)}:an,Fraction:r?function(e){return r(e)}:on};return function(e,t){var n=$(e);if(!(n in i))throw new TypeError("Cannot convert "+e+' of type "'+n+'"; 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===n?e:a[t](e)}})),Al=Ze("and",["typed","matrix","equalScalar","zeros","not"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.zeros,a=e.not,o=Ks({typed:t,equalScalar:r}),s=au({typed:t,equalScalar:r}),u=nu({typed:t,equalScalar:r}),l=Qs({typed:t}),c=Js({typed:t});return t("and",{"number, number":go,"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":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,this,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return a(t)?i(e.size(),e.storage()):u(e,t,this,!1)},"DenseMatrix, any":function(e,t){return a(t)?i(e.size(),e.storage()):c(e,t,this,!1)},"any, SparseMatrix":function(e,t){return a(e)?i(e.size(),e.storage()):u(t,e,this,!0)},"any, DenseMatrix":function(e,t){return a(e)?i(e.size(),e.storage()):c(t,e,this,!0)},"Array, any":function(e,t){return this(n(e),t).valueOf()},"any, Array":function(e,t){return this(e,n(t)).valueOf()}})})),Ol=Ze("smallerEq",["typed","config","matrix","DenseMatrix"],(function(e){var t=e.typed,n=e.config,r=e.matrix,i=e.DenseMatrix,a=eu({typed:t}),o=lu({typed:t,DenseMatrix:i}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("smallerEq",{"boolean, boolean":function(e,t){return e<=t},"number, number":function(e,t){return e<=t||he(e,t,n.epsilon)},"BigNumber, BigNumber":function(e,t){return e.lte(t)||pa(e,t,n.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")},"Unit, Unit":function(e,t){if(!e.equalBase(t))throw new Error("Cannot compare units with different base");return this(e.value,t.value)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,this)},"Array, Array":function(e,t){return this(r(e),r(t)).valueOf()},"Array, Matrix":function(e,t){return this(r(e),t)},"Matrix, Array":function(e,t){return this(e,r(t))},"SparseMatrix, any":function(e,t){return s(e,t,this,!1)},"DenseMatrix, any":function(e,t){return l(e,t,this,!1)},"any, SparseMatrix":function(e,t){return s(t,e,this,!0)},"any, DenseMatrix":function(e,t){return l(t,e,this,!0)},"Array, any":function(e,t){return l(r(e),t,this,!1).valueOf()},"any, Array":function(e,t){return l(r(t),e,this,!0).valueOf()}})})),Cl=Ze("sort",["typed","matrix","compare","compareNatural"],(function(e){var t=e.typed,n=e.matrix,r=e.compare,i=e.compareNatural,a=r,o=function(e,t){return-r(e,t)};return t("sort",{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return l(e),n(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return u(e),e.sort(t)},"Matrix, function":function(e,t){return l(e),n(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return u(e),e.sort(s(t))},"Matrix, string":function(e,t){return l(e),n(e.toArray().sort(s(t)),e.storage())}});function s(e){if("asc"===e)return a;if("desc"===e)return o;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==ze(e).length)throw new Error("One dimensional array expected")}function l(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),_l=Ze("cot",["typed","BigNumber"],(function(e){var t=e.typed,n=e.BigNumber;return t("cot",{number:$o,Complex:function(e){return e.cot()},BigNumber:function(e){return new n(1).div(e.tan())},Unit:function(e){if(!e.hasBase(e.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return this(e.value)},"Array | Matrix":function(e){return Gt(e,this)}})})),kl=Ze("setDistinct",["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t("setDistinct",{"Array | Matrix":function(e){var t;if(0===r(n(e),new a(0)))t=[];else{var s=Ue(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(s[0]);for(var u=1;u<s.length;u++)0!==i(s[u],s[u-1])&&t.push(s[u])}return Array.isArray(e)?t:new o(t)}})})),zl=Ze("setPowerset",["typed","size","subset","compareNatural","Index"],(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index;return t("setPowerset",{"Array | Matrix":function(e){if(0===r(n(e),new a(0)))return[];for(var t=Ue(Array.isArray(e)?e:e.toArray()).sort(i),s=[],u=0;u.toString(2).length<=t.length;)s.push(o(t,u.toString(2).split("").reverse())),u++;return function(e){for(var t=[],n=e.length-1;n>0;n--)for(var r=0;r<n;r++)e[r].length>e[r+1].length&&(t=e[r],e[r]=e[r+1],e[r+1]=t);return e}(s)}});function o(e,t){for(var n=[],r=0;r<t.length;r++)"1"===t[r]&&n.push(e[r]);return n}})),Il=Ze("index",["typed","Index"],(function(e){var t=e.typed,n=e.Index;return t("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map((function(e){return o(e)?e.toNumber():Array.isArray(e)||p(e)?e.map((function(e){return o(e)?e.toNumber():e})):e})),r=new n;return n.apply(r,t),r}})})),Dl=Ze("factorial",["typed","gamma"],(function(e){var t=e.typed,n=e.gamma;return t("factorial",{number:function(e){if(e<0)throw new Error("Value must be non-negative");return n(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return n(e.plus(1))},"Array | Matrix":function(e){return Gt(e,this)}})})),Bl=Ze("permutations",["typed","factorial"],(function(e){return(0,e.typed)("permutations",{"number | BigNumber":e.factorial,"number, number":function(e,t){if(!te(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!te(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 us(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var n,r;if(!Pl(e)||!Pl(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(n=e.mul(0).add(1),r=e.minus(t).plus(1);r.lte(e);r=r.plus(1))n=n.times(r);return n}})}));function Pl(e){return e.isInteger()&&e.gte(0)}var ql=Ze("ceil",["typed","config","round"],(function(e){var t=e.typed,n=e.config,r=e.round;return t("ceil",{number:function(e){return he(e,r(e),n.epsilon)?r(e):Ma(e)},Complex:function(e){return e.ceil()},BigNumber:function(e){return pa(e,r(e),n.epsilon)?r(e):e.ceil()},Fraction:function(e){return e.ceil()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),Rl=Ze("subtract",["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.addScalar,a=e.unaryMinus,o=e.DenseMatrix,s=Gs({typed:t}),u=eu({typed:t}),l=tu({typed:t,equalScalar:r}),c=Ys({typed:t,DenseMatrix:o}),f=Qs({typed:t}),p=Js({typed:t});return t("subtract",{"number, number":function(e,t){return e-t},"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":function(e,t){if(null===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===t.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(t))throw new Error("Units do not match");var n=e.clone();return n.value=this(n.value,t.value),n.fixPrefix=!1,n},"SparseMatrix, SparseMatrix":function(e,t){return Ul(e,t),l(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return Ul(e,t),u(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return Ul(e,t),s(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return Ul(e,t),f(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return c(e,a(t),i)},"DenseMatrix, any":function(e,t){return p(e,t,this)},"any, SparseMatrix":function(e,t){return c(t,e,this,!0)},"any, DenseMatrix":function(e,t){return p(t,e,this,!0)},"Array, any":function(e,t){return p(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return p(n(t),e,this,!0).valueOf()}})}));function Ul(e,t){var n=e.size(),r=t.size();if(n.length!==r.length)throw new _e(n.length,r.length)}var Fl=Ze("cross",["typed","matrix","subtract","multiply"],(function(e){var t=e.typed,n=e.matrix,r=e.subtract,i=e.multiply;return t("cross",{"Matrix, Matrix":function(e,t){return n(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return n(a(e.toArray(),t))},"Array, Matrix":function(e,t){return n(a(e,t.toArray()))},"Array, Array":a});function a(e,t){var n=Math.max(ze(e).length,ze(t).length);e=qe(e),t=qe(t);var a=ze(e),o=ze(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 s=[r(i(e[1],t[2]),i(e[2],t[1])),r(i(e[2],t[0]),i(e[0],t[2])),r(i(e[0],t[1]),i(e[1],t[0]))];return n>1?[s]:s}})),jl=Ze("ctranspose",["typed","transpose","conj"],(function(e){var t=e.typed,n=e.transpose,r=e.conj;return t("ctranspose",{any:function(e){return r(n(e))}})})),Ll=Ze("divideScalar",["typed","numeric"],(function(e){var t=e.typed,n=e.numeric;return t("divideScalar",{"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 | Fraction | BigNumber":function(e,t){var r=e.clone(),i=n(1,$(t));return r.value=this(null===r.value?r._normalize(i):r.value,t),r},"number | Fraction | BigNumber, Unit":function(e,t){var r=t.clone();r=r.pow(-1);var i=n(1,$(e));return r.value=this(e,null===t.value?t._normalize(i):t.value),r},"Unit, Unit":function(e,t){return e.divide(t)}})})),$l=Ze("nthRoots",["config","typed","divideScalar","Complex"],(function(e){var t=e.typed,n=(e.config,e.divideScalar,e.Complex),r=[function(e){return new n(e,0)},function(e){return new n(0,e)},function(e){return new n(-e,0)},function(e){return new n(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 n(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(),s=e.abs(),u=[],l=Math.pow(s,1/t),c=0;c<t;c++){var f=(i+4*c)/t;f!==Math.round(f)?u.push(new n({r:l,phi:(o+2*Math.PI*c)/t})):u.push(r[f%4](l))}return u}return t("nthRoots",{Complex:function(e){return i(e,2)},"Complex, number":i})}));function Hl(e){var t=e.DenseMatrix;return function(e,n,r){var i=e.size();if(2!==i.length)throw new RangeError("Matrix must be two dimensional (size: "+Te(i)+")");var a,o,s,u=i[0];if(u!==i[1])throw new RangeError("Matrix must be square (size: "+Te(i)+")");if(p(n)){var l=n.size();if(1===l.length){if(l[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(a=[],s=n._data,o=0;o<u;o++)a[o]=[s[o]];return new t({data:a,size:[u,1],datatype:n._datatype})}if(2===l.length){if(l[0]!==u||1!==l[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(d(n)){if(r){for(a=[],s=n._data,o=0;o<u;o++)a[o]=[s[o][0]];return new t({data:a,size:[u,1],datatype:n._datatype})}return n}for(a=[],o=0;o<u;o++)a[o]=[0];for(var c=n._values,m=n._index,h=n._ptr,y=h[1],g=h[0];g<y;g++)a[o=m[g]][0]=c[g];return new t({data:a,size:[u,1],datatype:n._datatype})}throw new RangeError("Dimension mismatch. Matrix columns must match vector length.")}if(f(n)){var v=ze(n);if(1===v.length){if(v[0]!==u)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(a=[],o=0;o<u;o++)a[o]=[n[o]];return new t({data:a,size:[u,1]})}if(2===v.length){if(v[0]!==u||1!==v[1])throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(a=[],o=0;o<u;o++)a[o]=[n[o][0]];return new t({data:a,size:[u,1]})}throw new RangeError("Dimension mismatch. Matrix columns must match vector length.")}}}var Vl=Ze("lsolve",["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.divideScalar,i=e.multiplyScalar,a=e.subtract,o=e.equalScalar,s=e.DenseMatrix,u=Hl({DenseMatrix:s});return t("lsolve",{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n,l,c=(t=u(e,t,!0))._data,f=e._size[0],p=e._size[1],m=e._values,d=e._index,h=e._ptr,y=[],g=0;g<p;g++){var v=c[g][0]||0;if(o(v,0))y[g]=[0];else{var x=0,b=[],w=[],N=h[g+1];for(l=h[g];l<N;l++)(n=d[l])===g?x=m[l]:n>g&&(b.push(m[l]),w.push(n));if(o(x,0))throw new Error("Linear system cannot be solved since matrix is singular");var E=r(v,x);for(l=0,N=w.length;l<N;l++)n=w[l],c[n]=[a(c[n][0]||0,i(E,b[l]))];y[g]=[E]}}return new s({data:y,size:[f,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return l(e,t)},"Array, Array | Matrix":function(e,t){return l(n(e),t).valueOf()}});function l(e,t){for(var n=(t=u(e,t,!0))._data,l=e._size[0],c=e._size[1],f=[],p=e._data,m=0;m<c;m++){var d=n[m][0]||0,h=void 0;if(o(d,0))h=0;else{var y=p[m][m];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");h=r(d,y);for(var g=m+1;g<l;g++)n[g]=[a(n[g][0]||0,i(h,p[g][m]))]}f[m]=[h]}return new s({data:f,size:[l,1]})}})),Wl=Ze("equal",["typed","matrix","equalScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.DenseMatrix,a=eu({typed:t}),o=lu({typed:t,DenseMatrix:i}),s=ru({typed:t,DenseMatrix:i}),u=Qs({typed:t}),l=Js({typed:t});return t("equal",{"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)},"SparseMatrix, SparseMatrix":function(e,t){return o(e,t,r)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,r,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,r,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,r)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return s(e,t,r,!1)},"DenseMatrix, any":function(e,t){return l(e,t,r,!1)},"any, SparseMatrix":function(e,t){return s(t,e,r,!0)},"any, DenseMatrix":function(e,t){return l(t,e,r,!0)},"Array, any":function(e,t){return l(n(e),t,r,!1).valueOf()},"any, Array":function(e,t){return l(n(t),e,r,!0).valueOf()}})})),Gl=(Ze("equal",["typed","equalScalar"],(function(e){var t=e.typed,n=e.equalScalar;return t("equal",{"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:n(e,t)}})})),Ze("setCartesian",["typed","size","subset","compareNatural","Index","DenseMatrix"],(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index,o=e.DenseMatrix;return t("setCartesian",{"Array | Matrix, Array | Matrix":function(e,t){var s=[];if(0!==r(n(e),new a(0))&&0!==r(n(t),new a(0))){var u=Ue(Array.isArray(e)?e:e.toArray()).sort(i),l=Ue(Array.isArray(t)?t:t.toArray()).sort(i);s=[];for(var c=0;c<u.length;c++)for(var f=0;f<l.length;f++)s.push([u[c],l[f]])}return Array.isArray(e)&&Array.isArray(t)?s:new o(s)}})}))),Zl=Ze("setSymDifference",["typed","size","concat","subset","setDifference","Index"],(function(e){var t=e.typed,n=e.size,r=e.concat,i=e.subset,a=e.setDifference,o=e.Index;return t("setSymDifference",{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(n(e),new o(0)))return Ue(t);if(0===i(n(t),new o(0)))return Ue(e);var s=Ue(e),u=Ue(t);return r(a(s,u),a(u,s))}})})),Yl=Ze("hypot",["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],(function(e){var t=e.typed,n=e.abs,r=e.addScalar,i=e.divideScalar,a=e.multiplyScalar,o=e.sqrt,s=e.smaller,u=e.isPositive;return t("hypot",{"... number | BigNumber":function(e){for(var t=0,l=0,c=0;c<e.length;c++){var f=n(e[c]);s(l,f)?(t=a(t,a(i(l,f),i(l,f))),t=r(t,1),l=f):t=r(t,u(f)?a(i(f,l),i(f,l)):f)}return a(l,o(t))},Array:function(e){return this.apply(this,Ue(e))},Matrix:function(e){return this.apply(this,Ue(e.toArray()))}})}));function Ql(){return(Ql=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Jl=Ze("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtract","complex"],(function(e){var t=e.typed,n=e.matrix,r=e.zeros,i=e.identity,a=e.isZero,o=e.equal,s=e.sign,u=e.sqrt,l=e.conj,c=e.unaryMinus,f=e.addScalar,p=e.divideScalar,m=e.multiplyScalar,d=e.subtract,h=e.complex;return Ql(t("qr",{DenseMatrix:function(e){return g(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=g(n(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:y});function y(e){var t,n,h,y=e._size[0],g=e._size[1],v=i([y],"dense"),x=v._data,b=e.clone(),w=b._data,N=r([y],"");for(h=0;h<Math.min(g,y);++h){var E=w[h][h],S=c(o(E,0)?1:s(E)),M=l(S),T=0;for(t=h;t<y;t++)T=f(T,m(w[t][h],l(w[t][h])));var A=m(S,u(T));if(!a(A)){var O=d(E,A);for(N[h]=1,t=h+1;t<y;t++)N[t]=p(w[t][h],O);var C=c(l(p(O,A))),_=void 0;for(n=h;n<g;n++){for(_=0,t=h;t<y;t++)_=f(_,m(l(N[t]),w[t][n]));for(_=m(_,C),t=h;t<y;t++)w[t][n]=m(d(w[t][n],m(N[t],_)),M)}for(t=0;t<y;t++){for(_=0,n=h;n<y;n++)_=f(_,m(x[t][n],N[n]));for(_=m(_,C),n=h;n<y;++n)x[t][n]=p(d(x[t][n],m(_,l(N[n]))),M)}}}return{Q:v,R:b,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}function g(e){var t=y(e),n=t.R._data;if(e._data.length>0)for(var r="Complex"===n[0][0].type?h(0):0,i=0;i<n.length;++i)for(var a=0;a<i&&a<(n[0]||[]).length;++a)n[i][a]=r;return t}})),Xl=Ze("distance",["typed","addScalar","subtract","divideScalar","multiplyScalar","unaryMinus","sqrt","abs"],(function(e){var t=e.typed,n=e.addScalar,r=e.subtract,i=e.multiplyScalar,a=e.divideScalar,s=e.unaryMinus,u=e.sqrt,l=e.abs;return t("distance",{"Array, Array, Array":function(e,t,n){if(2===e.length&&2===t.length&&2===n.length){if(!f(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!f(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var o=a(r(n[1],n[0]),r(t[1],t[0])),u=i(i(o,o),t[0]),l=s(i(o,t[0])),c=e[1];return y(e[0],e[1],u,l,c)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,t,n){if(2===Object.keys(e).length&&2===Object.keys(t).length&&2===Object.keys(n).length){if(!f(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!f(n))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in t&&"lineOnePtY"in t&&"lineTwoPtX"in n&&"lineTwoPtY"in n){var o=a(r(n.lineTwoPtY,n.lineTwoPtX),r(t.lineOnePtY,t.lineOnePtX)),u=i(i(o,o),t.lineOnePtX),l=s(i(o,t.lineOnePtX)),c=e.pointX;return y(e.pointX,e.pointY,u,l,c)}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(!f(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 y(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(!d(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return g(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 v(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(!f(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 y(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(!d(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 g(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(!f(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!f(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 v([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 v([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&&c(e[0][0])&&c(e[0][1])){if(e.some((function(e){return 2!==e.length||!c(e[0])||!c(e[1])})))return!1}else{if(!(3===e[0].length&&c(e[0][0])&&c(e[0][1])&&c(e[0][2])))return!1;if(e.some((function(e){return 3!==e.length||!c(e[0])||!c(e[1])||!c(e[2])})))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],n=[],r=[],i=0;i<e.length-1;i++)for(var a=i+1;a<e.length;a++)2===e[0].length?(n=[e[i][0],e[i][1]],r=[e[a][0],e[a][1]]):3===e[0].length&&(n=[e[i][0],e[i][1],e[i][2]],r=[e[a][0],e[a][1],e[a][2]]),t.push(v(n,r));return t}(e)}});function c(e){return"number"===typeof e||o(e)}function f(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])}function p(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])&&c(e[2])}function m(e){return Array.isArray(e)||(e=h(e)),e.every(c)}function d(e){return e.constructor!==Array&&(e=h(e)),c(e[0])&&c(e[1])&&c(e[2])&&c(e[3])&&c(e[4])&&c(e[5])}function h(e){for(var t=Object.keys(e),n=[],r=0;r<t.length;r++)n.push(e[t[r]]);return n}function y(e,t,r,o,s){var c=l(n(n(i(r,e),i(o,t)),s)),f=u(n(i(r,r),i(o,o)));return a(c,f)}function g(e,t,o,s,l,c,f,p,m){var d=[r(i(r(l,t),m),i(r(c,o),p)),r(i(r(c,o),f),i(r(s,e),m)),r(i(r(s,e),p),i(r(l,t),f))];d=u(n(n(i(d[0],d[0]),i(d[1],d[1])),i(d[2],d[2])));var h=u(n(n(i(f,f),i(p,p)),i(m,m)));return a(d,h)}function v(e,t){for(var a=e.length,o=0,s=0,l=0;l<a;l++)s=r(e[l],t[l]),o=n(i(s,s),o);return u(o)}})),Kl=Ze("stirlingS2",["typed","addScalar","subtract","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","larger"],(function(e){var t=e.typed,n=e.addScalar,r=e.subtract,i=e.multiplyScalar,a=e.divideScalar,o=e.pow,s=e.factorial,u=e.combinations,l=e.isNegative,c=e.isInteger,f=e.larger;return t("stirlingS2",{"number | BigNumber, number | BigNumber":function(e,t){if(!c(e)||l(e)||!c(t)||l(t))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(f(t,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");for(var p=s(t),m=0,d=0;d<=t;d++){var h=o(-1,r(t,d)),y=u(t,d),g=o(d,e);m=n(m,i(i(y,g),h))}return a(m,p)}})})),ec=Ze("catalan",["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(function(e){var t=e.typed,n=e.addScalar,r=e.divideScalar,i=e.multiplyScalar,a=e.combinations,o=e.isNegative,s=e.isInteger;return t("catalan",{"number | BigNumber":function(e){if(!s(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return r(a(i(e,2),e),n(e,1))}})})),tc=Ze("fix",["typed","Complex","ceil","floor"],(function(e){var t=e.typed,n=e.Complex,r=e.ceil,i=e.floor;return t("fix",{number:function(e){return e>0?i(e):r(e)},Complex:function(e){return new n(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},BigNumber:function(e){return e.isNegative()?r(e):i(e)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Array | Matrix":function(e){return Gt(e,this,!0)}})})),nc=Ze("log",["config","typed","divideScalar","Complex"],(function(e){var t=e.typed,n=e.config,r=e.divideScalar,i=e.Complex;return t("log",{number:function(e){return e>=0||n.predictable?ka(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||n.predictable?e.ln():new i(e.toNumber(),0).log()},"Array | Matrix":function(e){return Gt(e,this)},"any, any":function(e,t){return r(this(e),this(t))}})})),rc=Ze("dotDivide",["typed","matrix","equalScalar","divideScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.equalScalar,i=e.divideScalar,a=e.DenseMatrix,o=Ks({typed:t,equalScalar:r}),s=eu({typed:t}),u=lu({typed:t,DenseMatrix:a}),l=nu({typed:t,equalScalar:r}),c=ru({typed:t,DenseMatrix:a}),f=Qs({typed:t}),p=Js({typed:t});return t("dotDivide",{"any, any":i,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,i,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,i,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,i,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,i)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return l(e,t,i,!1)},"DenseMatrix, any":function(e,t){return p(e,t,i,!1)},"any, SparseMatrix":function(e,t){return c(t,e,i,!0)},"any, DenseMatrix":function(e,t){return p(t,e,i,!0)},"Array, any":function(e,t){return p(n(e),t,i,!1).valueOf()},"any, Array":function(e,t){return p(n(t),e,i,!0).valueOf()}})})),ic=Ze("deepEqual",["typed","equal"],(function(e){var t=e.typed,n=e.equal;return t("deepEqual",{"any, any":function(e,t){return function e(t,r){if(Array.isArray(t)){if(Array.isArray(r)){var i=t.length;if(i!==r.length)return!1;for(var a=0;a<i;a++)if(!e(t[a],r[a]))return!1;return!0}return!1}return!Array.isArray(r)&&n(t,r)}(e.valueOf(),t.valueOf())}})}));function ac(e){return(ac="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)}function oc(){return(oc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function sc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(n),!0).forEach((function(t){lc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function lc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var cc=Ze("Unit",["?on","config","addScalar","subtract","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],(function(e){var t,n,r,i=e.on,a=e.config,o=e.addScalar,u=e.subtract,c=e.multiplyScalar,f=e.divideScalar,p=e.pow,m=e.abs,d=e.fix,h=e.round,y=e.equal,g=e.isNumeric,v=e.format,x=e.number,b=e.Complex,w=e.BigNumber,N=e.Fraction,E=x;function S(e,t){if(!(this instanceof S))throw new Error("Constructor must be called with the new operator");if(null!==e&&void 0!==e&&!g(e)&&!s(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==t&&("string"!==typeof t||""===t))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==t){var n=S.parse(t);this.units=n.units,this.dimensions=n.dimensions}else{this.units=[{unit:R,prefix:D.NONE,power:0}],this.dimensions=[];for(var r=0;r<B.length;r++)this.dimensions[r]=0}this.value=void 0!==e&&null!==e?this._normalize(e):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function M(){for(;" "===r||"\t"===r;)A()}function T(e){return e>="0"&&e<="9"}function A(){n++,r=t.charAt(n)}function O(e){n=e,r=t.charAt(n)}function C(){var e="",t=n;if("+"===r?A():"-"===r&&(e+=r,A()),!function(e){return e>="0"&&e<="9"||"."===e}(r))return O(t),null;if("."===r){if(e+=r,A(),!T(r))return O(t),null}else{for(;T(r);)e+=r,A();"."===r&&(e+=r,A())}for(;T(r);)e+=r,A();if("E"===r||"e"===r){var i="",a=n;if(i+=r,A(),"+"!==r&&"-"!==r||(i+=r,A()),!T(r))return O(a),e;for(e+=i;T(r);)e+=r,A()}return e}function _(){for(var e="",i=t.charCodeAt(n);i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122;)e+=r,A(),i=t.charCodeAt(n);return((i=e.charCodeAt(0))>=65&&i<=90||i>=97&&i<=122)&&e||null}function k(e){return r===e?(A(),e):null}function z(e){if(Y(U,e)){var t=U[e];return{unit:t,prefix:t.prefixes[""]}}for(var n in U)if(Y(U,n)&&Me(e,n)){var r=U[n],i=e.length-n.length,a=e.substring(0,i),o=Y(r.prefixes,a)?r.prefixes[a]:void 0;if(void 0!==o)return{unit:r,prefix:o}}return null}function I(e){return e.equalBase(P.NONE)&&null!==e.value&&!a.predictable?e.value:e}S.prototype.type="Unit",S.prototype.isUnit=!0,S.parse=function(e,i){if(i=i||{},n=-1,r="","string"!==typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var o=new S;o.units=[];var s=1,u=!1;A(),M();var l=C(),c=null;if(l){if("BigNumber"===a.number)c=new w(l);else if("Fraction"===a.number)try{c=new N(l)}catch(b){c=parseFloat(l)}else c=parseFloat(l);M(),k("*")?(s=1,u=!0):k("/")&&(s=-1,u=!0)}for(var f=[],p=1;;){for(M();"("===r;)f.push(s),p*=s,s=1,A(),M();var m=void 0;if(!r)break;var d=r;if(null===(m=_()))throw new SyntaxError('Unexpected "'+d+'" in "'+t+'" at index '+n.toString());var h=z(m);if(null===h)throw new SyntaxError('Unit "'+m+'" not found.');var y=s*p;if(M(),k("^")){M();var g=C();if(null===g)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');y*=g}o.units.push({unit:h.unit,prefix:h.prefix,power:y});for(var v=0;v<B.length;v++)o.dimensions[v]+=(h.unit.dimensions[v]||0)*y;for(M();")"===r;){if(0===f.length)throw new SyntaxError('Unmatched ")" in "'+t+'" at index '+n.toString());p/=f.pop(),A(),M()}if(u=!1,k("*")?(s=1,u=!0):k("/")?(s=-1,u=!0):s=1,h.unit.base){var x=h.unit.base.key;L.auto[x]={unit:h.unit,prefix:h.prefix}}}if(M(),r)throw new SyntaxError('Could not parse: "'+e+'"');if(u)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==f.length)throw new SyntaxError('Unmatched "(" in "'+t+'"');if(0===o.units.length&&!i.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return o.value=void 0!==c?o._normalize(c):null,o},S.prototype.clone=function(){var e=new S;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=V(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var n in e.units[t]={},this.units[t])Y(this.units[t],n)&&(e.units[t][n]=this.units[t][n]);return e},S.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},S.prototype._normalize=function(e){var t,n,r,i,a;if(null===e||void 0===e||0===this.units.length)return e;if(this._isDerived()){var s=e;a=S._getNumberConverter($(e));for(var u=0;u<this.units.length;u++)t=a(this.units[u].unit.value),i=a(this.units[u].prefix.value),r=a(this.units[u].power),s=c(s,p(c(t,i),r));return s}return t=(a=S._getNumberConverter($(e)))(this.units[0].unit.value),n=a(this.units[0].unit.offset),i=a(this.units[0].prefix.value),c(o(e,n),c(t,i))},S.prototype._denormalize=function(e,t){var n,r,i,a,o;if(null===e||void 0===e||0===this.units.length)return e;if(this._isDerived()){var s=e;o=S._getNumberConverter($(e));for(var l=0;l<this.units.length;l++)n=o(this.units[l].unit.value),a=o(this.units[l].prefix.value),i=o(this.units[l].power),s=f(s,p(c(n,a),i));return s}return n=(o=S._getNumberConverter($(e)))(this.units[0].unit.value),a=o(this.units[0].prefix.value),r=o(this.units[0].unit.offset),u(f(f(e,n),void 0===t||null===t?a:t),r)},S.isValuelessUnit=function(e){return null!==z(e)},S.prototype.hasBase=function(e){if("string"===typeof e&&(e=P[e]),!e)return!1;for(var t=0;t<B.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},S.prototype.equalBase=function(e){for(var t=0;t<B.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},S.prototype.equals=function(e){return this.equalBase(e)&&y(this.value,e.value)},S.prototype.multiply=function(e){for(var t=this.clone(),n=0;n<B.length;n++)t.dimensions[n]=(this.dimensions[n]||0)+(e.dimensions[n]||0);for(var r=0;r<e.units.length;r++){var i=uc({},e.units[r]);t.units.push(i)}if(null!==this.value||null!==e.value){var a=null===this.value?this._normalize(1):this.value,o=null===e.value?e._normalize(1):e.value;t.value=c(a,o)}else t.value=null;return t.skipAutomaticSimplification=!1,I(t)},S.prototype.divide=function(e){for(var t=this.clone(),n=0;n<B.length;n++)t.dimensions[n]=(this.dimensions[n]||0)-(e.dimensions[n]||0);for(var r=0;r<e.units.length;r++){var i=uc(uc({},e.units[r]),{},{power:-e.units[r].power});t.units.push(i)}if(null!==this.value||null!==e.value){var a=null===this.value?this._normalize(1):this.value,o=null===e.value?e._normalize(1):e.value;t.value=f(a,o)}else t.value=null;return t.skipAutomaticSimplification=!1,I(t)},S.prototype.pow=function(e){for(var t=this.clone(),n=0;n<B.length;n++)t.dimensions[n]=(this.dimensions[n]||0)*e;for(var r=0;r<t.units.length;r++)t.units[r].power*=e;return null!==t.value?t.value=p(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,I(t)},S.prototype.abs=function(){var e=this.clone();for(var t in e.value=null!==e.value?m(e.value):null,e.units)"VA"!==e.units[t].unit.name&&"VAR"!==e.units[t].unit.name||(e.units[t].unit=U.W);return e},S.prototype.to=function(e){var t,n=null===this.value?this._normalize(1):this.value;if("string"===typeof e){if(t=S.parse(e),!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");return t.value=V(n),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}if(l(e)){if(!this.equalBase(e))throw new Error("Units do not match ('".concat(e.toString(),"' != '").concat(this.toString(),"')"));if(null!==e.value)throw new Error("Cannot convert to a unit with a value");return(t=e.clone()).value=V(n),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}throw new Error("String or Unit expected as parameter")},S.prototype.toNumber=function(e){return E(this.toNumeric(e))},S.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)},S.prototype.toString=function(){return this.format()},S.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},S.fromJSON=function(e){var t=new S(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},S.prototype.valueOf=S.prototype.toString,S.prototype.simplify=function(){var e,t,n=this.clone(),r=[];for(var i in H)if(Y(H,i)&&n.hasBase(P[i])){e=i;break}if("NONE"===e)n.units=[];else if(e&&Y(H,e)&&(t=H[e]),t)n.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,o=0;o<B.length;o++){var s=B[o];Math.abs(n.dimensions[o]||0)>1e-12&&(Y(H,s)?r.push({unit:H[s].unit,prefix:H[s].prefix,power:n.dimensions[o]||0}):a=!0)}r.length<n.units.length&&!a&&(n.units=r)}return n},S.prototype.toSI=function(){for(var e=this.clone(),t=[],n=0;n<B.length;n++){var r=B[n];if(Math.abs(e.dimensions[n]||0)>1e-12){if(!Y(L.si,r))throw new Error("Cannot express custom unit "+r+" in SI units");t.push({unit:L.si[r].unit,prefix:L.si[r].prefix,power:e.dimensions[n]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},S.prototype.formatUnits=function(){for(var e="",t="",n=0,r=0,i=0;i<this.units.length;i++)this.units[i].power>0?(n++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&r++;if(r>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(n>0?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+="^"+-this.units[a].power)):(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,t+="^"+this.units[a].power));e=e.substr(1),t=t.substr(1),n>1&&r>0&&(e="("+e+")"),r>1&&n>0&&(t="("+t+")");var o=e;return n>0&&r>0&&(o+=" / "),o+=t},S.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),n=!1;for(var r in"undefined"!==typeof t.value&&null!==t.value&&s(t.value)&&(n=Math.abs(t.value.re)<1e-14),t.units)Y(t.units,r)&&t.units[r].unit&&("VA"===t.units[r].unit.name&&n?t.units[r].unit=U.VAR:"VAR"!==t.units[r].unit.name||n||(t.units[r].unit=U.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?v(i,e||{}):"",o=t.formatUnits();return t.value&&s(t.value)&&(a="("+a+")"),o.length>0&&a.length>0&&(a+=" "),a+=o},S.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?m(this.value):0,t=m(this.units[0].unit.value),n=this.units[0].prefix;if(0===e)return n;var r=this.units[0].power,i=Math.log(e/Math.pow(n.value*t,r))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return n;i=Math.abs(i);var a=this.units[0].unit.prefixes;for(var o in a)if(Y(a,o)){var s=a[o];if(s.scientific){var u=Math.abs(Math.log(e/Math.pow(s.value*t,r))/Math.LN10-1.2);(u<i||u===i&&s.name.length<n.name.length)&&(n=s,i=u)}}return n},S.prototype.splitUnit=function(e){for(var t=this.clone(),n=[],r=0;r<e.length&&(t=t.to(e[r]),r!==e.length-1);r++){var i=t.toNumeric(),a=h(i),s=new S(y(a,i)?a:d(t.toNumeric()),e[r].toString());n.push(s),t=u(t,s)}for(var l=0,c=0;c<n.length;c++)l=o(l,n[c].value);return y(l,this.value)&&(t.value=0),n.push(t),n};var D={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}}};D.SHORTLONG=oc({},D.SHORT,D.LONG),D.BINARY_SHORT=oc({},D.BINARY_SHORT_SI,D.BINARY_SHORT_IEC),D.BINARY_LONG=oc({},D.BINARY_LONG_SI,D.BINARY_LONG_IEC);var B=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],P={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 P)Y(P,q)&&(P[q].key=q);var R={name:"",base:{},value:1,offset:0,dimensions:B.map((function(e){return 0}))},U={meter:{name:"meter",base:P.LENGTH,prefixes:D.LONG,value:1,offset:0},inch:{name:"inch",base:P.LENGTH,prefixes:D.NONE,value:.0254,offset:0},foot:{name:"foot",base:P.LENGTH,prefixes:D.NONE,value:.3048,offset:0},yard:{name:"yard",base:P.LENGTH,prefixes:D.NONE,value:.9144,offset:0},mile:{name:"mile",base:P.LENGTH,prefixes:D.NONE,value:1609.344,offset:0},link:{name:"link",base:P.LENGTH,prefixes:D.NONE,value:.201168,offset:0},rod:{name:"rod",base:P.LENGTH,prefixes:D.NONE,value:5.0292,offset:0},chain:{name:"chain",base:P.LENGTH,prefixes:D.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:P.LENGTH,prefixes:D.NONE,value:1e-10,offset:0},m:{name:"m",base:P.LENGTH,prefixes:D.SHORT,value:1,offset:0},in:{name:"in",base:P.LENGTH,prefixes:D.NONE,value:.0254,offset:0},ft:{name:"ft",base:P.LENGTH,prefixes:D.NONE,value:.3048,offset:0},yd:{name:"yd",base:P.LENGTH,prefixes:D.NONE,value:.9144,offset:0},mi:{name:"mi",base:P.LENGTH,prefixes:D.NONE,value:1609.344,offset:0},li:{name:"li",base:P.LENGTH,prefixes:D.NONE,value:.201168,offset:0},rd:{name:"rd",base:P.LENGTH,prefixes:D.NONE,value:5.02921,offset:0},ch:{name:"ch",base:P.LENGTH,prefixes:D.NONE,value:20.1168,offset:0},mil:{name:"mil",base:P.LENGTH,prefixes:D.NONE,value:254e-7,offset:0},m2:{name:"m2",base:P.SURFACE,prefixes:D.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:P.SURFACE,prefixes:D.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:P.SURFACE,prefixes:D.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:P.SURFACE,prefixes:D.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:P.SURFACE,prefixes:D.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:P.SURFACE,prefixes:D.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:P.SURFACE,prefixes:D.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:P.SURFACE,prefixes:D.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:P.SURFACE,prefixes:D.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:P.SURFACE,prefixes:D.NONE,value:1e4,offset:0},m3:{name:"m3",base:P.VOLUME,prefixes:D.CUBIC,value:1,offset:0},L:{name:"L",base:P.VOLUME,prefixes:D.SHORT,value:.001,offset:0},l:{name:"l",base:P.VOLUME,prefixes:D.SHORT,value:.001,offset:0},litre:{name:"litre",base:P.VOLUME,prefixes:D.LONG,value:.001,offset:0},cuin:{name:"cuin",base:P.VOLUME,prefixes:D.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:P.VOLUME,prefixes:D.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:P.VOLUME,prefixes:D.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:P.VOLUME,prefixes:D.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:P.VOLUME,prefixes:D.NONE,value:15e-6,offset:0},drop:{name:"drop",base:P.VOLUME,prefixes:D.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:P.VOLUME,prefixes:D.NONE,value:5e-8,offset:0},minim:{name:"minim",base:P.VOLUME,prefixes:D.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:P.VOLUME,prefixes:D.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:P.VOLUME,prefixes:D.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:P.VOLUME,prefixes:D.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:P.VOLUME,prefixes:D.NONE,value:1e-6,offset:0},cup:{name:"cup",base:P.VOLUME,prefixes:D.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:P.VOLUME,prefixes:D.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:P.VOLUME,prefixes:D.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:P.VOLUME,prefixes:D.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:P.VOLUME,prefixes:D.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:P.VOLUME,prefixes:D.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:P.VOLUME,prefixes:D.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:P.VOLUME,prefixes:D.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:P.VOLUME,prefixes:D.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:P.VOLUME,prefixes:D.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:P.VOLUME,prefixes:D.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:P.VOLUME,prefixes:D.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:P.VOLUME,prefixes:D.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:P.VOLUME,prefixes:D.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:P.VOLUME,prefixes:D.NONE,value:.1173478,offset:0},obl:{name:"obl",base:P.VOLUME,prefixes:D.NONE,value:.1589873,offset:0},g:{name:"g",base:P.MASS,prefixes:D.SHORT,value:.001,offset:0},gram:{name:"gram",base:P.MASS,prefixes:D.LONG,value:.001,offset:0},ton:{name:"ton",base:P.MASS,prefixes:D.SHORT,value:907.18474,offset:0},t:{name:"t",base:P.MASS,prefixes:D.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:P.MASS,prefixes:D.LONG,value:1e3,offset:0},grain:{name:"grain",base:P.MASS,prefixes:D.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:P.MASS,prefixes:D.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:P.MASS,prefixes:D.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:P.MASS,prefixes:D.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:P.MASS,prefixes:D.NONE,value:45.359237,offset:0},stick:{name:"stick",base:P.MASS,prefixes:D.NONE,value:.115,offset:0},stone:{name:"stone",base:P.MASS,prefixes:D.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:P.MASS,prefixes:D.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:P.MASS,prefixes:D.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:P.MASS,prefixes:D.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:P.MASS,prefixes:D.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:P.MASS,prefixes:D.NONE,value:45.359237,offset:0},s:{name:"s",base:P.TIME,prefixes:D.SHORT,value:1,offset:0},min:{name:"min",base:P.TIME,prefixes:D.NONE,value:60,offset:0},h:{name:"h",base:P.TIME,prefixes:D.NONE,value:3600,offset:0},second:{name:"second",base:P.TIME,prefixes:D.LONG,value:1,offset:0},sec:{name:"sec",base:P.TIME,prefixes:D.LONG,value:1,offset:0},minute:{name:"minute",base:P.TIME,prefixes:D.NONE,value:60,offset:0},hour:{name:"hour",base:P.TIME,prefixes:D.NONE,value:3600,offset:0},day:{name:"day",base:P.TIME,prefixes:D.NONE,value:86400,offset:0},week:{name:"week",base:P.TIME,prefixes:D.NONE,value:604800,offset:0},month:{name:"month",base:P.TIME,prefixes:D.NONE,value:2629800,offset:0},year:{name:"year",base:P.TIME,prefixes:D.NONE,value:31557600,offset:0},decade:{name:"decade",base:P.TIME,prefixes:D.NONE,value:315576e3,offset:0},century:{name:"century",base:P.TIME,prefixes:D.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:P.TIME,prefixes:D.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:P.FREQUENCY,prefixes:D.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:P.FREQUENCY,prefixes:D.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:P.ANGLE,prefixes:D.SHORT,value:1,offset:0},radian:{name:"radian",base:P.ANGLE,prefixes:D.LONG,value:1,offset:0},deg:{name:"deg",base:P.ANGLE,prefixes:D.SHORT,value:null,offset:0},degree:{name:"degree",base:P.ANGLE,prefixes:D.LONG,value:null,offset:0},grad:{name:"grad",base:P.ANGLE,prefixes:D.SHORT,value:null,offset:0},gradian:{name:"gradian",base:P.ANGLE,prefixes:D.LONG,value:null,offset:0},cycle:{name:"cycle",base:P.ANGLE,prefixes:D.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:P.ANGLE,prefixes:D.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:P.ANGLE,prefixes:D.NONE,value:null,offset:0},A:{name:"A",base:P.CURRENT,prefixes:D.SHORT,value:1,offset:0},ampere:{name:"ampere",base:P.CURRENT,prefixes:D.LONG,value:1,offset:0},K:{name:"K",base:P.TEMPERATURE,prefixes:D.NONE,value:1,offset:0},degC:{name:"degC",base:P.TEMPERATURE,prefixes:D.NONE,value:1,offset:273.15},degF:{name:"degF",base:P.TEMPERATURE,prefixes:D.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:P.TEMPERATURE,prefixes:D.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:P.TEMPERATURE,prefixes:D.NONE,value:1,offset:0},celsius:{name:"celsius",base:P.TEMPERATURE,prefixes:D.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:P.TEMPERATURE,prefixes:D.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:P.TEMPERATURE,prefixes:D.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:P.AMOUNT_OF_SUBSTANCE,prefixes:D.SHORT,value:1,offset:0},mole:{name:"mole",base:P.AMOUNT_OF_SUBSTANCE,prefixes:D.LONG,value:1,offset:0},cd:{name:"cd",base:P.LUMINOUS_INTENSITY,prefixes:D.SHORT,value:1,offset:0},candela:{name:"candela",base:P.LUMINOUS_INTENSITY,prefixes:D.LONG,value:1,offset:0},N:{name:"N",base:P.FORCE,prefixes:D.SHORT,value:1,offset:0},newton:{name:"newton",base:P.FORCE,prefixes:D.LONG,value:1,offset:0},dyn:{name:"dyn",base:P.FORCE,prefixes:D.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:P.FORCE,prefixes:D.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:P.FORCE,prefixes:D.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:P.FORCE,prefixes:D.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:P.FORCE,prefixes:D.LONG,value:4448.2216,offset:0},J:{name:"J",base:P.ENERGY,prefixes:D.SHORT,value:1,offset:0},joule:{name:"joule",base:P.ENERGY,prefixes:D.SHORT,value:1,offset:0},erg:{name:"erg",base:P.ENERGY,prefixes:D.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:P.ENERGY,prefixes:D.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:P.ENERGY,prefixes:D.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:P.ENERGY,prefixes:D.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:P.ENERGY,prefixes:D.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:P.POWER,prefixes:D.SHORT,value:1,offset:0},watt:{name:"watt",base:P.POWER,prefixes:D.LONG,value:1,offset:0},hp:{name:"hp",base:P.POWER,prefixes:D.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:P.POWER,prefixes:D.SHORT,value:b.I,offset:0},VA:{name:"VA",base:P.POWER,prefixes:D.SHORT,value:1,offset:0},Pa:{name:"Pa",base:P.PRESSURE,prefixes:D.SHORT,value:1,offset:0},psi:{name:"psi",base:P.PRESSURE,prefixes:D.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:P.PRESSURE,prefixes:D.NONE,value:101325,offset:0},bar:{name:"bar",base:P.PRESSURE,prefixes:D.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:P.PRESSURE,prefixes:D.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:P.PRESSURE,prefixes:D.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:P.PRESSURE,prefixes:D.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:P.PRESSURE,prefixes:D.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:P.ELECTRIC_CHARGE,prefixes:D.LONG,value:1,offset:0},C:{name:"C",base:P.ELECTRIC_CHARGE,prefixes:D.SHORT,value:1,offset:0},farad:{name:"farad",base:P.ELECTRIC_CAPACITANCE,prefixes:D.LONG,value:1,offset:0},F:{name:"F",base:P.ELECTRIC_CAPACITANCE,prefixes:D.SHORT,value:1,offset:0},volt:{name:"volt",base:P.ELECTRIC_POTENTIAL,prefixes:D.LONG,value:1,offset:0},V:{name:"V",base:P.ELECTRIC_POTENTIAL,prefixes:D.SHORT,value:1,offset:0},ohm:{name:"ohm",base:P.ELECTRIC_RESISTANCE,prefixes:D.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:P.ELECTRIC_INDUCTANCE,prefixes:D.LONG,value:1,offset:0},H:{name:"H",base:P.ELECTRIC_INDUCTANCE,prefixes:D.SHORT,value:1,offset:0},siemens:{name:"siemens",base:P.ELECTRIC_CONDUCTANCE,prefixes:D.LONG,value:1,offset:0},S:{name:"S",base:P.ELECTRIC_CONDUCTANCE,prefixes:D.SHORT,value:1,offset:0},weber:{name:"weber",base:P.MAGNETIC_FLUX,prefixes:D.LONG,value:1,offset:0},Wb:{name:"Wb",base:P.MAGNETIC_FLUX,prefixes:D.SHORT,value:1,offset:0},tesla:{name:"tesla",base:P.MAGNETIC_FLUX_DENSITY,prefixes:D.LONG,value:1,offset:0},T:{name:"T",base:P.MAGNETIC_FLUX_DENSITY,prefixes:D.SHORT,value:1,offset:0},b:{name:"b",base:P.BIT,prefixes:D.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:P.BIT,prefixes:D.BINARY_LONG,value:1,offset:0},B:{name:"B",base:P.BIT,prefixes:D.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:P.BIT,prefixes:D.BINARY_LONG,value:8,offset:0}},F={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",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",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function j(e){if("BigNumber"===e.number){var t=br(w);U.rad.value=new w(1),U.deg.value=t.div(180),U.grad.value=t.div(200),U.cycle.value=t.times(2),U.arcsec.value=t.div(648e3),U.arcmin.value=t.div(10800)}else U.rad.value=1,U.deg.value=Math.PI/180,U.grad.value=Math.PI/200,U.cycle.value=2*Math.PI,U.arcsec.value=Math.PI/648e3,U.arcmin.value=Math.PI/10800;U.radian.value=U.rad.value,U.degree.value=U.deg.value,U.gradian.value=U.grad.value}j(a),i&&i("config",(function(e,t){e.number!==t.number&&j(e)}));var L={si:{NONE:{unit:R,prefix:D.NONE[""]},LENGTH:{unit:U.m,prefix:D.SHORT[""]},MASS:{unit:U.g,prefix:D.SHORT.k},TIME:{unit:U.s,prefix:D.SHORT[""]},CURRENT:{unit:U.A,prefix:D.SHORT[""]},TEMPERATURE:{unit:U.K,prefix:D.SHORT[""]},LUMINOUS_INTENSITY:{unit:U.cd,prefix:D.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:U.mol,prefix:D.SHORT[""]},ANGLE:{unit:U.rad,prefix:D.SHORT[""]},BIT:{unit:U.bits,prefix:D.SHORT[""]},FORCE:{unit:U.N,prefix:D.SHORT[""]},ENERGY:{unit:U.J,prefix:D.SHORT[""]},POWER:{unit:U.W,prefix:D.SHORT[""]},PRESSURE:{unit:U.Pa,prefix:D.SHORT[""]},ELECTRIC_CHARGE:{unit:U.C,prefix:D.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:U.F,prefix:D.SHORT[""]},ELECTRIC_POTENTIAL:{unit:U.V,prefix:D.SHORT[""]},ELECTRIC_RESISTANCE:{unit:U.ohm,prefix:D.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:U.H,prefix:D.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:U.S,prefix:D.SHORT[""]},MAGNETIC_FLUX:{unit:U.Wb,prefix:D.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:U.T,prefix:D.SHORT[""]},FREQUENCY:{unit:U.Hz,prefix:D.SHORT[""]}}};L.cgs=JSON.parse(JSON.stringify(L.si)),L.cgs.LENGTH={unit:U.m,prefix:D.SHORT.c},L.cgs.MASS={unit:U.g,prefix:D.SHORT[""]},L.cgs.FORCE={unit:U.dyn,prefix:D.SHORT[""]},L.cgs.ENERGY={unit:U.erg,prefix:D.NONE[""]},L.us=JSON.parse(JSON.stringify(L.si)),L.us.LENGTH={unit:U.ft,prefix:D.NONE[""]},L.us.MASS={unit:U.lbm,prefix:D.NONE[""]},L.us.TEMPERATURE={unit:U.degF,prefix:D.NONE[""]},L.us.FORCE={unit:U.lbf,prefix:D.NONE[""]},L.us.ENERGY={unit:U.BTU,prefix:D.BTU[""]},L.us.POWER={unit:U.hp,prefix:D.NONE[""]},L.us.PRESSURE={unit:U.psi,prefix:D.NONE[""]},L.auto=JSON.parse(JSON.stringify(L.si));var H=L.auto;for(var W in S.setUnitSystem=function(e){if(!Y(L,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(L).join(", "));H=L[e]},S.getUnitSystem=function(){for(var e in L)if(Y(L,e)&&L[e]===H)return e},S.typeConverters={BigNumber:function(e){return new w(e+"")},Fraction:function(e){return new N(e)},Complex:function(e){return e},number:function(e){return e}},S._getNumberConverter=function(e){if(!S.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return S.typeConverters[e]},U)if(Y(U,W)){var G=U[W];G.dimensions=G.base.dimensions}for(var Z in F)if(Y(F,Z)){var Q=U[F[Z]],J={};for(var X in Q)Y(Q,X)&&(J[X]=Q[X]);J.name=Z,U[Z]=J}return S.createUnit=function(e,t){if("object"!==ac(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var n in e)if(Y(e,n)&&S.deleteUnit(n),e[n].aliases)for(var r=0;r<e[n].aliases.length;r++)S.deleteUnit(e[n].aliases[r]);var i;for(var a in e)Y(e,a)&&(i=S.createUnitSingle(a,e[a]));return i},S.createUnitSingle=function(e,t,n){if("undefined"!==typeof t&&null!==t||(t={}),"string"!==typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(Y(U,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++){var n=e.charAt(t),r=function(e){return/^[a-zA-Z]$/.test(e)};if(0===t&&!r(n))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!r(n)&&!function(e){return e>="0"&&e<="9"}(n))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var r,i,a,o=null,s=[],u=0;if(t&&"Unit"===t.type)o=t.clone();else if("string"===typeof t)""!==t&&(r=t);else{if("object"!==ac(t))throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');r=t.definition,i=t.prefixes,u=t.offset,a=t.baseName,t.aliases&&(s=t.aliases.valueOf())}if(s)for(var l=0;l<s.length;l++)if(Y(U,s[l]))throw new Error('Cannot create alias "'+s[l]+'": a unit with that name already exists');if(r&&"string"===typeof r&&!o)try{o=S.parse(r,{allowNoUnits:!0})}catch(E){throw E.message='Could not create unit "'+e+'" from "'+r+'": '+E.message,E}else r&&"Unit"===r.type&&(o=r.clone());s=s||[],u=u||0,i=i&&i.toUpperCase&&D[i.toUpperCase()]||D.NONE;var c={};if(o){c={name:e,value:o.value,dimensions:o.dimensions.slice(0),prefixes:i,offset:u};var f=!1;for(var p in P)if(Y(P,p)){for(var m=!0,d=0;d<B.length;d++)if(Math.abs((c.dimensions[d]||0)-(P[p].dimensions[d]||0))>1e-12){m=!1;break}if(m){f=!0,c.base=P[p];break}}if(!f){a=a||e+"_STUFF";var h={dimensions:o.dimensions.slice(0)};h.key=a,P[a]=h,H[a]={unit:c,prefix:D.NONE[""]},c.base=P[a]}}else{if(a=a||e+"_STUFF",B.indexOf(a)>=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 B.push(a),P)Y(P,y)&&(P[y].dimensions[B.length-1]=0);for(var g={dimensions:[]},v=0;v<B.length;v++)g.dimensions[v]=0;g.dimensions[B.length-1]=1,g.key=a,P[a]=g,c={name:e,value:1,dimensions:P[a].dimensions.slice(0),prefixes:i,offset:u,base:P[a]},H[a]={unit:c,prefix:D.NONE[""]}}S.UNITS[e]=c;for(var x=0;x<s.length;x++){var b=s[x],w={};for(var N in c)Y(c,N)&&(w[N]=c[N]);w.name=b,S.UNITS[b]=w}return new S(null,e)},S.deleteUnit=function(e){delete S.UNITS[e]},S.PREFIXES=D,S.BASE_DIMENSIONS=B,S.BASE_UNITS=P,S.UNIT_SYSTEMS=L,S.UNITS=U,S}),{isClass:!0}),fc=Ze("createUnit",["typed","Unit"],(function(e){var t=e.typed,n=e.Unit;return t("createUnit",{"Object, Object":function(e,t){return n.createUnit(e,t)},Object:function(e){return n.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var i={};return i[e]=t,n.createUnit(i,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,n.createUnit(r,{})},string:function(e){var t={};return t[e]={},n.createUnit(t,{})}})})),pc=Ze("setUnion",["typed","size","concat","subset","setIntersect","setSymDifference","Index"],(function(e){var t=e.typed,n=e.size,r=e.concat,i=e.subset,a=e.setIntersect,o=e.setSymDifference,s=e.Index;return t("setUnion",{"Array | Matrix, Array | Matrix":function(e,t){if(0===i(n(e),new s(0)))return Ue(t);if(0===i(n(t),new s(0)))return Ue(e);var u=Ue(e),l=Ue(t);return r(o(u,l),a(u,l))}})}));function mc(e,t,n,r,i,a,o){var s=0;for(n[o]=e;s>=0;){var u=n[o+s],l=n[r+u];-1===l?(s--,a[t++]=u):(n[r+u]=n[i+l],n[o+ ++s]=l)}return t}function dc(e){return-e-2}var hc=Ze("csAmd",["add","multiply","transpose"],(function(e){var t=e.add,n=e.multiply,r=e.transpose;return function(e,o){if(!o||e<=0||e>3)return null;var s=o._size,u=s[0],l=s[1],c=0,f=Math.max(16,10*Math.sqrt(l)),p=function(e,i,a,o,s){var u=r(i);if(1===e&&o===a)return t(i,u);if(2===e){for(var l=u._index,c=u._ptr,f=0,p=0;p<a;p++){var m=c[p];if(c[p]=f,!(c[p+1]-m>s))for(var d=c[p+1];m<d;m++)l[f++]=l[m]}return c[a]=f,i=r(u),n(u,i)}return n(u,i)}(e,o,u,l,f=Math.min(l-2,f));!function(e,t,n){for(var r=e._values,i=e._index,a=e._ptr,o=e._size[1],s=0,u=0;u<o;u++){var l=a[u];for(a[u]=s;l<a[u+1];l++)t(i[l],u,r?r[l]:1,n)&&(i[s]=i[l],r&&(r[s]=r[l]),s++)}a[o]=s,i.splice(s,i.length-s),r&&r.splice(s,r.length-s)}(p,a,null);for(var m,d,h,y,g,v,x,b,w,N,E,S,M,T,A,O,C=p._index,_=p._ptr,k=_[l],z=[],I=[],D=l+1,B=2*(l+1),P=3*(l+1),q=4*(l+1),R=5*(l+1),U=6*(l+1),F=7*(l+1),j=z,L=function(e,t,n,r,a,o,s,u,l,c,f,p){for(var m=0;m<e;m++)n[r+m]=t[m+1]-t[m];n[r+e]=0;for(var d=0;d<=e;d++)n[a+d]=-1,o[d]=-1,n[s+d]=-1,n[u+d]=-1,n[l+d]=1,n[c+d]=1,n[f+d]=0,n[p+d]=n[r+d];var h=i(0,0,n,c,e);return n[f+e]=-2,t[e]=-1,n[c+e]=0,h}(l,_,I,0,P,j,B,F,D,U,q,R),$=function(e,t,n,r,i,a,o,s,u,l,c){for(var f=0,p=0;p<e;p++){var m=n[r+p];if(0===m)n[i+p]=-2,f++,t[p]=-1,n[a+p]=0;else if(m>o)n[s+p]=0,n[i+p]=-1,f++,t[p]=dc(e),n[s+e]++;else{var d=n[u+m];-1!==d&&(l[d]=p),n[c+p]=n[u+m],n[u+m]=p}}return f}(l,_,I,R,q,U,f,D,P,j,B),H=0;$<l;){for(h=-1;H<l&&-1===(h=I[P+H]);H++);-1!==I[B+h]&&(j[I[B+h]]=-1),I[P+H]=I[B+h];var V=I[q+h],W=I[D+h];$+=W;var G=0;I[D+h]=-W;var Z=_[h],Y=0===V?Z:k,Q=Y;for(y=1;y<=V+1;y++){for(y>V?(v=h,x=Z,b=I[0+h]-V):(x=_[v=C[Z++]],b=I[0+v]),g=1;g<=b;g++)(w=I[D+(m=C[x++])])<=0||(G+=w,I[D+m]=-w,C[Q++]=m,-1!==I[B+m]&&(j[I[B+m]]=j[m]),-1!==j[m]?I[B+j[m]]=I[B+m]:I[P+I[R+m]]=I[B+m]);v!==h&&(_[v]=dc(h),I[U+v]=0)}for(0!==V&&(k=Q),I[R+h]=G,_[h]=Y,I[0+h]=Q-Y,I[q+h]=-2,L=i(L,c,I,U,l),N=Y;N<Q;N++)if(!((E=I[q+(m=C[N])])<=0)){var J=L-(w=-I[D+m]);for(Z=_[m],S=_[m]+E-1;Z<=S;Z++)I[U+(v=C[Z])]>=L?I[U+v]-=w:0!==I[U+v]&&(I[U+v]=I[R+v]+J)}for(N=Y;N<Q;N++){for(M=(S=_[m=C[N]])+I[q+m]-1,T=S,A=0,O=0,Z=S;Z<=M;Z++)if(0!==I[U+(v=C[Z])]){var X=I[U+v]-L;X>0?(O+=X,C[T++]=v,A+=v):(_[v]=dc(h),I[U+v]=0)}I[q+m]=T-S+1;var K=T,ee=S+I[0+m];for(Z=M+1;Z<ee;Z++){var te=I[D+(d=C[Z])];te<=0||(O+=te,C[T++]=d,A+=d)}0===O?(_[m]=dc(h),G-=w=-I[D+m],W+=w,$+=w,I[D+m]=0,I[q+m]=-1):(I[R+m]=Math.min(I[R+m],O),C[T]=C[K],C[K]=C[S],C[S]=h,I[0+m]=T-S+1,A=(A<0?-A:A)%l,I[B+m]=I[F+A],I[F+A]=m,j[m]=A)}for(I[R+h]=G,L=i(L+(c=Math.max(c,G)),c,I,U,l),N=Y;N<Q;N++)if(!(I[D+(m=C[N])]>=0))for(m=I[F+(A=j[m])],I[F+A]=-1;-1!==m&&-1!==I[B+m];m=I[B+m],L++){for(b=I[0+m],E=I[q+m],Z=_[m]+1;Z<=_[m]+b-1;Z++)I[U+C[Z]]=L;var ne=m;for(d=I[B+m];-1!==d;){var re=I[0+d]===b&&I[q+d]===E;for(Z=_[d]+1;re&&Z<=_[d]+b-1;Z++)I[U+C[Z]]!==L&&(re=0);re?(_[d]=dc(m),I[D+m]+=I[D+d],I[D+d]=0,I[q+d]=-1,d=I[B+d],I[B+ne]=d):(ne=d,d=I[B+d])}}for(Z=Y,N=Y;N<Q;N++)(w=-I[D+(m=C[N])])<=0||(I[D+m]=w,O=I[R+m]+G-w,-1!==I[P+(O=Math.min(O,l-$-w))]&&(j[I[P+O]]=m),I[B+m]=I[P+O],j[m]=-1,I[P+O]=m,H=Math.min(H,O),I[R+m]=O,C[Z++]=m);I[D+h]=W,0===(I[0+h]=Z-Y)&&(_[h]=-1,I[U+h]=0),0!==V&&(k=Z)}for(m=0;m<l;m++)_[m]=dc(_[m]);for(d=0;d<=l;d++)I[P+d]=-1;for(d=l;d>=0;d--)I[D+d]>0||(I[B+d]=I[P+_[d]],I[P+_[d]]=d);for(v=l;v>=0;v--)I[D+v]<=0||-1!==_[v]&&(I[B+v]=I[P+_[v]],I[P+_[v]]=v);for(h=0,m=0;m<=l;m++)-1===_[m]&&(h=mc(m,h,I,P,B,z,U));return z.splice(z.length-1,1),z};function i(e,t,n,r,i){if(e<2||e+t<0){for(var a=0;a<i;a++)0!==n[r+a]&&(n[r+a]=1);e=2}return e}function a(e,t){return e!==t}}));function yc(e,t,n,r,i,a,o){var s,u,l,c=0;if(e<=t||n[r+t]<=n[i+e])return-1;n[i+e]=n[r+t];var f=n[a+e];if(n[a+e]=t,-1===f)c=1,l=e;else{for(c=2,l=f;l!==n[o+l];l=n[o+l]);for(s=f;s!==l;s=u)u=n[o+s],n[o+s]=l}return{jleaf:c,q:l}}var gc=Ze("csCounts",["transpose"],(function(e){var t=e.transpose;return function(e,n,r,i){if(!e||!n||!r)return null;var a,o,s,u,l,c,f,p=e._size,m=p[0],d=p[1],h=4*d+(i?d+m+1:0),y=[],g=d,v=2*d,x=3*d,b=4*d,w=5*d+1;for(s=0;s<h;s++)y[s]=-1;var N=[],E=t(e),S=E._index,M=E._ptr;for(s=0;s<d;s++)for(N[o=r[s]]=-1===y[x+o]?1:0;-1!==o&&-1===y[x+o];o=n[o])y[x+o]=s;if(i){for(s=0;s<d;s++)y[r[s]]=s;for(a=0;a<m;a++){for(s=d,c=M[a],f=M[a+1],l=c;l<f;l++)s=Math.min(s,y[S[l]]);y[w+a]=y[b+s],y[b+s]=a}}for(a=0;a<d;a++)y[0+a]=a;for(s=0;s<d;s++){for(-1!==n[o=r[s]]&&N[n[o]]--,u=i?y[b+s]:o;-1!==u;u=i?y[w+u]:-1)for(l=M[u];l<M[u+1];l++){var T=yc(a=S[l],o,y,x,g,v,0);T.jleaf>=1&&N[o]++,2===T.jleaf&&N[T.q]--}-1!==n[o]&&(y[0+o]=n[o])}for(o=0;o<d;o++)-1!==n[o]&&(N[n[o]]+=N[o]);return N}})),vc=Ze("csSqr",["add","multiply","transpose"],(function(e){var t=e.add,n=e.multiply,r=e.transpose,i=hc({add:t,multiply:n,transpose:r}),a=gc({transpose:r});return function(e,t,n){var r,o=t._ptr,s=t._size[1],u={};if(u.q=i(e,t),e&&!u.q)return null;if(n){var l=e?function(e,t,n,r){for(var i=e._values,a=e._index,o=e._ptr,s=e._size,u=e._datatype,l=s[0],c=s[1],f=r&&e._values?[]:null,p=[],m=[],d=0,h=0;h<c;h++){m[h]=d;for(var y=n?n[h]:h,g=o[y],v=o[y+1],x=g;x<v;x++){var b=t?t[a[x]]:a[x];p[d]=b,f&&(f[d]=i[x]),d++}}return m[c]=d,e.createSparseMatrix({values:f,index:p,ptr:m,size:[l,c],datatype:u})}(t,null,u.q,0):t;u.parent=function(e,t){if(!e)return null;var n,r,i=e._index,a=e._ptr,o=e._size,s=o[0],u=o[1],l=[],c=[],f=u;if(t)for(n=0;n<s;n++)c[f+n]=-1;for(var p=0;p<u;p++){l[p]=-1,c[0+p]=-1;for(var m=a[p],d=a[p+1],h=m;h<d;h++){var y=i[h];for(n=t?c[f+y]:y;-1!==n&&n<p;n=r)r=c[0+n],c[0+n]=p,-1===r&&(l[n]=p);t&&(c[f+y]=p)}}return l}(l,1);var c=function(e,t){if(!e)return null;var n,r=0,i=[],a=[],o=t,s=2*t;for(n=0;n<t;n++)a[0+n]=-1;for(n=t-1;n>=0;n--)-1!==e[n]&&(a[o+n]=a[0+e[n]],a[0+e[n]]=n);for(n=0;n<t;n++)-1===e[n]&&(r=mc(n,r,a,0,o,i,s));return i}(u.parent,s);if(u.cp=a(l,u.parent,c,1),l&&u.parent&&u.cp&&function(e,t){var n=e._ptr,r=e._index,i=e._size,a=i[0],o=i[1];t.pinv=[],t.leftmost=[];var s,u,l,c,f,p=t.parent,m=t.pinv,d=t.leftmost,h=[],y=a,g=a+o,v=a+2*o;for(u=0;u<o;u++)h[y+u]=-1,h[g+u]=-1,h[v+u]=0;for(s=0;s<a;s++)d[s]=-1;for(u=o-1;u>=0;u--)for(c=n[u],f=n[u+1],l=c;l<f;l++)d[r[l]]=u;for(s=a-1;s>=0;s--)m[s]=-1,-1!==(u=d[s])&&(0===h[v+u]++&&(h[g+u]=s),h[0+s]=h[y+u],h[y+u]=s);for(t.lnz=0,t.m2=a,u=0;u<o;u++)if(s=h[y+u],t.lnz++,s<0&&(s=t.m2++),m[s]=u,!(--v[u]<=0)){t.lnz+=h[v+u];var x=p[u];-1!==x&&(0===h[v+x]&&(h[g+x]=h[g+u]),h[0+h[g+u]]=h[y+x],h[y+x]=h[0+s],h[v+x]+=h[v+u])}for(s=0;s<a;s++)m[s]<0&&(m[s]=u++);return!0}(l,u))for(u.unz=0,r=0;r<s;r++)u.unz+=u.cp[r]}else u.unz=4*o[s]+s,u.lnz=u.unz;return u}}));function xc(e,t){return e[t]<0}function bc(e,t){e[t]=dc(e[t])}function wc(e){return e<0?dc(e):e}function Nc(e,t,n,r,i){var a,o,s,u=t._index,l=t._ptr,c=t._size[1],f=0;for(r[0]=e;f>=0;){e=r[f];var p=i?i[e]:e;xc(l,e)||(bc(l,e),r[c+f]=p<0?0:wc(l[p]));var m=1;for(o=r[c+f],s=p<0?0:wc(l[p+1]);o<s;o++)if(!xc(l,a=u[o])){r[c+f]=o,r[++f]=a,m=0;break}m&&(f--,r[--n]=e)}return n}var Ec=Ze("csSpsolve",["divideScalar","multiply","subtract"],(function(e){var t=e.divideScalar,n=e.multiply,r=e.subtract;return function(e,i,a,o,s,u,l){var c,f,p,m,d=e._values,h=e._index,y=e._ptr,g=e._size[1],v=i._values,x=i._index,b=i._ptr,w=function(e,t,n,r,i){var a,o,s,u=e._ptr,l=e._size,c=t._index,f=t._ptr,p=l[1],m=p;for(o=f[n],s=f[n+1],a=o;a<s;a++){var d=c[a];xc(u,d)||(m=Nc(d,e,m,r,i))}for(a=m;a<p;a++)bc(u,r[a]);return m}(e,i,a,o,u);for(c=w;c<g;c++)s[o[c]]=0;for(f=b[a],p=b[a+1],c=f;c<p;c++)s[x[c]]=v[c];for(var N=w;N<g;N++){var E=o[N],S=u?u[E]:E;if(!(S<0))for(f=y[S],p=y[S+1],s[E]=t(s[E],d[l?f:p-1]),c=l?f+1:f,m=l?p:p-1;c<m;c++){var M=h[c];s[M]=r(s[M],n(d[c],s[E]))}}return w}})),Sc=Ze("csLu",["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],(function(e){var t=e.abs,n=e.divideScalar,r=e.multiply,i=e.subtract,a=e.larger,o=e.largerEq,s=e.SparseMatrix,u=Ec({divideScalar:n,multiply:r,subtract:i});return function(e,i,l){if(!e)return null;var c,f=e._size[1],p=100,m=100;i&&(c=i.q,p=i.lnz||p,m=i.unz||m);var d,h,y=[],g=[],v=[],x=new s({values:y,index:g,ptr:v,size:[f,f]}),b=[],w=[],N=[],E=new s({values:b,index:w,ptr:N,size:[f,f]}),S=[],M=[],T=[];for(d=0;d<f;d++)M[d]=0,S[d]=-1,v[d+1]=0;p=0,m=0;for(var A=0;A<f;A++){v[A]=p,N[A]=m;var O=c?c[A]:A,C=u(x,e,O,T,M,S,1),_=-1,k=-1;for(h=C;h<f;h++)if(S[d=T[h]]<0){var z=t(M[d]);a(z,k)&&(k=z,_=d)}else w[m]=S[d],b[m++]=M[d];if(-1===_||k<=0)return null;S[O]<0&&o(t(M[O]),r(k,l))&&(_=O);var I=M[_];for(w[m]=A,b[m++]=I,S[_]=A,g[p]=_,y[p++]=1,h=C;h<f;h++)S[d=T[h]]<0&&(g[p]=d,y[p++]=n(M[d],I)),M[d]=0}for(v[f]=p,N[f]=m,h=0;h<p;h++)g[h]=S[g[h]];return y.splice(p,y.length-p),g.splice(p,g.length-p),b.splice(m,b.length-m),w.splice(m,w.length-m),{L:x,U:E,pinv:S}}})),Mc=Ze("slu",["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],(function(e){var t=e.typed,n=e.abs,r=e.add,i=e.multiply,a=e.transpose,o=e.divideScalar,s=e.subtract,u=e.larger,l=e.largerEq,c=e.SparseMatrix,f=vc({add:r,multiply:i,transpose:a}),p=Sc({abs:n,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:l,SparseMatrix:c});return t("slu",{"SparseMatrix, number, number":function(e,t,n){if(!te(t)||t<0||t>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(n<0||n>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var r=f(t,e,!1),i=p(e,r,n);return{L:i.L,U:i.U,p:i.pinv,q:r.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})})),Tc=Ze("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar"],(function(e){var t=e.typed,n=e.config,r=e.abs,i=e.add,a=e.addScalar,s=e.matrix,u=e.multiply,l=e.multiplyScalar,c=e.divideScalar,f=e.subtract,p=e.smaller,m=e.equalScalar;return t("intersect",{"Array, Array, Array":function(e,t,n){if(!y(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!y(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])}(n))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,n,r,i,o,s,u,p,m){var d=l(e,s),h=l(r,s),y=l(t,u),g=l(i,u),v=l(n,p),x=l(o,p),b=c(f(f(f(m,d),y),v),f(f(f(a(a(h,g),x),d),y),v)),w=a(e,l(b,f(r,e))),N=a(t,l(b,f(i,t))),E=a(n,l(b,f(o,n)));return[w,N,E]}(e[0],e[1],e[2],t[0],t[1],t[2],n[0],n[1],n[2],n[3])},"Array, Array, Array, Array":function(e,t,o,s){if(2===e.length){if(!h(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!h(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!h(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!h(s))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,o,s){var m=e,d=o,h=f(m,t),y=f(d,s),g=f(l(h[0],y[1]),l(y[0],h[1]));if(p(r(g),n.epsilon))return null;var v=l(y[0],m[1]),x=l(y[1],m[0]),b=l(y[0],d[1]),w=l(y[1],d[0]),N=c(a(f(f(v,x),b),w),g);return i(u(h,N),m)}(e,t,o,s)}if(3===e.length){if(!y(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!y(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!y(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!y(s))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,n,r,i,o,s,u,p,d,h,y){var v=g(e,s,d,s,t,u,h,u,n,p,y,p),x=g(d,s,r,e,h,u,i,t,y,p,o,n),b=g(e,s,r,e,t,u,i,t,n,p,o,n),w=g(d,s,d,s,h,u,h,u,y,p,y,p),N=g(r,e,r,e,i,t,i,t,o,n,o,n),E=c(f(l(v,x),l(b,w)),f(l(N,w),l(x,x))),S=c(a(v,l(E,x)),w),M=a(e,l(E,f(r,e))),T=a(t,l(E,f(i,t))),A=a(n,l(E,f(o,n))),O=a(s,l(S,f(d,s))),C=a(u,l(S,f(h,u))),_=a(p,l(S,f(y,p)));return m(M,O)&&m(T,C)&&m(A,_)?[M,T,A]:null}(e[0],e[1],e[2],t[0],t[1],t[2],o[0],o[1],o[2],s[0],s[1],s[2])}throw new TypeError("Arrays with two or thee dimensional points expected")},"Matrix, Matrix, Matrix":function(e,t,n){return s(this(e.valueOf(),t.valueOf(),n.valueOf()))},"Matrix, Matrix, Matrix, Matrix":function(e,t,n,r){return s(this(e.valueOf(),t.valueOf(),n.valueOf(),r.valueOf()))}});function d(e){return"number"===typeof e||o(e)}function h(e){return 2===e.length&&d(e[0])&&d(e[1])}function y(e){return 3===e.length&&d(e[0])&&d(e[1])&&d(e[2])}function g(e,t,n,r,i,o,s,u,c,p,m,d){var h=l(f(e,t),f(n,r)),y=l(f(i,o),f(s,u)),g=l(f(c,p),f(m,d));return a(a(h,y),g)}})),Ac=Ze("bellNumbers",["typed","addScalar","isNegative","isInteger","stirlingS2"],(function(e){var t=e.typed,n=e.addScalar,r=e.isNegative,i=e.isInteger,a=e.stirlingS2;return t("bellNumbers",{"number | BigNumber":function(e){if(!i(e)||r(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,o=0;o<=e;o++)t=n(t,a(e,o));return t}})})),Oc=Ze("xor",["typed","matrix","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.DenseMatrix,i=eu({typed:t}),a=lu({typed:t,DenseMatrix:r}),o=ru({typed:t,DenseMatrix:r}),s=Qs({typed:t}),u=Js({typed:t});return t("xor",{"number, number":yo,"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":function(e,t){return this(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,this)},"SparseMatrix, DenseMatrix":function(e,t){return i(t,e,this,!0)},"DenseMatrix, SparseMatrix":function(e,t){return i(e,t,this,!1)},"DenseMatrix, DenseMatrix":function(e,t){return s(e,t,this)},"Array, Array":function(e,t){return this(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return this(n(e),t)},"Matrix, Array":function(e,t){return this(e,n(t))},"SparseMatrix, any":function(e,t){return o(e,t,this,!1)},"DenseMatrix, any":function(e,t){return u(e,t,this,!1)},"any, SparseMatrix":function(e,t){return o(t,e,this,!0)},"any, DenseMatrix":function(e,t){return u(t,e,this,!0)},"Array, any":function(e,t){return u(n(e),t,this,!1).valueOf()},"any, Array":function(e,t){return u(n(t),e,this,!0).valueOf()}})})),Cc=Ze("prod",["typed","config","multiplyScalar","numeric"],(function(e){var t=e.typed,n=e.config,r=e.multiplyScalar,i=e.numeric;return t("prod",{"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(Wt(e,(function(e){try{t=void 0===t?e:r(t,e)}catch(n){throw Vn(n,"prod",e)}})),"string"===typeof t&&(t=i(t,n.number)),void 0===t)throw new Error("Cannot calculate prod of an empty array");return t}})),_c=Ze("usolve",["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(function(e){var t=e.typed,n=e.matrix,r=e.divideScalar,i=e.multiplyScalar,a=e.subtract,o=e.equalScalar,s=e.DenseMatrix,u=Hl({DenseMatrix:s});return t("usolve",{"SparseMatrix, Array | Matrix":function(e,t){return function(e,t){for(var n,l,c=(t=u(e,t,!0))._data,f=e._size[0],p=e._size[1],m=e._values,d=e._index,h=e._ptr,y=[],g=p-1;g>=0;g--){var v=c[g][0]||0;if(o(v,0))y[g]=[0];else{var x=0,b=[],w=[],N=h[g],E=h[g+1];for(l=E-1;l>=N;l--)(n=d[l])===g?x=m[l]:n<g&&(b.push(m[l]),w.push(n));if(o(x,0))throw new Error("Linear system cannot be solved since matrix is singular");var S=r(v,x);for(l=0,E=w.length;l<E;l++)n=w[l],c[n]=[a(c[n][0],i(S,b[l]))];y[g]=[S]}}return new s({data:y,size:[f,1]})}(e,t)},"DenseMatrix, Array | Matrix":function(e,t){return l(e,t)},"Array, Array | Matrix":function(e,t){return l(n(e),t).valueOf()}});function l(e,t){for(var n=(t=u(e,t,!0))._data,l=e._size[0],c=e._size[1],f=[],p=e._data,m=c-1;m>=0;m--){var d=n[m][0]||0,h=void 0;if(o(d,0))h=0;else{var y=p[m][m];if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");h=r(d,y);for(var g=m-1;g>=0;g--)n[g]=[a(n[g][0]||0,i(h,p[g][m]))]}f[m]=[h]}return new s({data:f,size:[l,1]})}})),kc=Ze("unit",["typed","Unit"],(function(e){var t=e.typed,n=e.Unit;return t("unit",{Unit:function(e){return e.clone()},string:function(e){return n.isValuelessUnit(e)?new n(null,e):n.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(e,t){return new n(e,t)},"Array | Matrix":function(e){return Gt(e,this)}})})),zc=Ze("Spa",["addScalar","equalScalar","FibonacciHeap"],(function(e){var t=e.addScalar,n=e.equalScalar,r=e.FibonacciHeap;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new r}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var n=this._heap.insert(e,t);this._values[e]=n}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,n){var r=this._values[e];r?r.value=t(r.value,n):(r=this._heap.insert(e,n),this._values[e]=r)},i.prototype.forEach=function(e,t,r){var i=this._heap,a=this._values,o=[],s=i.extractMinimum();for(s&&o.push(s);s&&s.key<=t;)s.key>=e&&(n(s.value,0)||r(s.key,s.value,this)),(s=i.extractMinimum())&&o.push(s);for(var u=0;u<o.length;u++){var l=o[u];a[(s=i.insert(l.key,l.value)).key]=s}},i.prototype.swap=function(e,t){var n=this._values[e],r=this._values[t];if(!n&&r)n=this._heap.insert(e,r.value),this._heap.remove(r),this._values[e]=n,this._values[t]=void 0;else if(n&&!r)r=this._heap.insert(t,n.value),this._heap.remove(n),this._values[t]=r,this._values[e]=void 0;else if(n&&r){var i=n.value;n.value=r.value,r.value=i}},i}),{isClass:!0}),Ic=Ze("lup",["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtract","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],(function(e){var t=e.typed,n=e.matrix,r=e.abs,i=e.addScalar,a=e.divideScalar,o=e.multiplyScalar,s=e.subtract,u=e.larger,l=e.equalScalar,c=e.unaryMinus,f=e.DenseMatrix,p=e.SparseMatrix,m=e.Spa;return t("lup",{DenseMatrix:function(e){return d(e)},SparseMatrix:function(e){return h(e)},Array:function(e){var t=d(n(e));return{L:t.L.valueOf(),U:t.U.valueOf(),p:t.p}}});function d(e){var t,n,c,p=e._size[0],m=e._size[1],d=Math.min(p,m),h=V(e._data),y=[],g=[p,d],v=[],x=[d,m],b=[];for(t=0;t<p;t++)b[t]=t;for(n=0;n<m;n++){if(n>0)for(t=0;t<p;t++){var w=Math.min(t,n),N=0;for(c=0;c<w;c++)N=i(N,o(h[t][c],h[c][n]));h[t][n]=s(h[t][n],N)}var E=n,S=0,M=0;for(t=n;t<p;t++){var T=h[t][n],A=r(T);u(A,S)&&(E=t,S=A,M=T)}if(n!==E&&(b[n]=[b[E],b[E]=b[n]][0],f._swapRows(n,E,h)),n<p)for(t=n+1;t<p;t++){var O=h[t][n];l(O,0)||(h[t][n]=a(h[t][n],M))}}for(n=0;n<m;n++)for(t=0;t<p;t++)0===n&&(t<m&&(v[t]=[]),y[t]=[]),t<n?(t<m&&(v[t][n]=h[t][n]),n<p&&(y[t][n]=0)):t!==n?(t<m&&(v[t][n]=0),n<p&&(y[t][n]=h[t][n])):(t<m&&(v[t][n]=h[t][n]),n<p&&(y[t][n]=1));var C=new f({data:y,size:g}),_=new f({data:v,size:x}),k=[];for(t=0,d=b.length;t<d;t++)k[b[t]]=t;return{L:C,U:_,p:k,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}function h(e){var t,n,i,s=e._size[0],f=e._size[1],d=Math.min(s,f),h=e._values,y=e._index,g=e._ptr,v=[],x=[],b=[],w=[s,d],N=[],E=[],S=[],M=[d,f],T=[],A=[];for(t=0;t<s;t++)T[t]=t,A[t]=t;var O=function(){var e=new m;n<s&&(b.push(v.length),v.push(1),x.push(n)),S.push(N.length);var f=g[n],d=g[n+1];for(i=f;i<d;i++)t=y[i],e.set(T[t],h[i]);n>0&&e.forEach(0,n-1,(function(t,n){p._forEachRow(t,v,x,b,(function(r,i){r>t&&e.accumulate(r,c(o(i,n)))}))}));var O=n,C=e.get(n),_=r(C);e.forEach(n+1,s-1,(function(e,t){var n=r(t);u(n,_)&&(O=e,_=n,C=t)})),n!==O&&(p._swapRows(n,O,w[1],v,x,b),p._swapRows(n,O,M[1],N,E,S),e.swap(n,O),function(e,t){var n=A[e],r=A[t];T[n]=t,T[r]=e,A[e]=r,A[t]=n}(n,O)),e.forEach(0,s-1,(function(e,t){e<=n?(N.push(t),E.push(e)):(t=a(t,C),l(t,0)||(v.push(t),x.push(e)))}))};for(n=0;n<f;n++)O();return S.push(N.length),b.push(v.length),{L:new p({values:v,index:x,ptr:b,size:w}),U:new p({values:N,index:E,ptr:S,size:M}),p:T,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\nP: "+this.p}}}})),Dc=Ze("det",["typed","matrix","subtract","multiply","unaryMinus","lup"],(function(e){var t=e.typed,n=e.matrix,r=e.subtract,i=e.multiply,a=e.unaryMinus,o=e.lup;return t("det",{any:function(e){return V(e)},"Array | Matrix":function(e){var t;switch((t=p(e)?e.size():Array.isArray(e)?(e=n(e)).size():[]).length){case 0:return V(e);case 1:if(1===t[0])return V(e.valueOf()[0]);throw new RangeError("Matrix must be square (size: "+Te(t)+")");case 2:var s=t[0],u=t[1];if(s===u)return function(e,t,n){if(1===t)return V(e[0][0]);if(2===t)return r(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var s=o(e),u=s.U[0][0],l=1;l<t;l++)u=i(u,s.U[l][l]);for(var c=0,f=0,p=[];;){for(;p[f];)f++;if(f>=t)break;for(var m=f,d=0;!p[s.p[m]];)p[s.p[m]]=!0,m=s.p[m],d++;d%2===0&&c++}return c%2===0?u:a(u)}(e.clone().valueOf(),s);throw new RangeError("Matrix must be square (size: "+Te(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+Te(t)+")")}}})})),Bc=Ze("log1p",["typed","config","divideScalar","log","Complex"],(function(e){var t=e.typed,n=e.config,r=e.divideScalar,i=e.log,a=e.Complex;return t("log1p",{number:function(e){return e>=-1||n.predictable?ae(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():o(new a(e.toNumber(),0))},"Array | Matrix":function(e){return Gt(e,this)},"any, any":function(e,t){return r(this(e),i(t))}});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))}}));function Pc(e,t){var n,r=t.length,i=[];if(e)for(n=0;n<r;n++)i[e[n]]=t[n];else for(n=0;n<r;n++)i[n]=t[n];return i}var qc=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],Rc=Ze("lusolve",qc,(function(e){var t=e.typed,n=e.matrix,r=e.lup,i=e.slu,a=e.usolve,o=e.lsolve,s=Hl({DenseMatrix:e.DenseMatrix});return t("lusolve",{"Array, Array | Matrix":function(e,t){e=n(e);var i=r(e);return l(i.L,i.U,i.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var n=r(e);return l(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var n=r(e);return l(n.L,n.U,n.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,n,r){var a=i(e,n,r);return l(a.L,a.U,a.p,a.q,t)},"Object, Array | Matrix":function(e,t){return l(e.L,e.U,e.p,e.q,t)}});function u(e){if(p(e))return e;if(f(e))return n(e);throw new TypeError("Invalid Matrix LU decomposition")}function l(e,t,n,r,i){e=u(e),t=u(t),i=s(e,i,!1),n&&(i._data=Pc(n,i._data));var l=o(e,i),c=a(t,l);return r&&(c._data=Pc(r,c._data)),c}})),Uc=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],Fc=Ze("inv",Uc,(function(e){var t=e.typed,n=e.matrix,r=e.divideScalar,i=e.addScalar,a=e.multiply,o=e.unaryMinus,s=e.det,u=e.identity,l=e.abs;return t("inv",{"Array | Matrix":function(e){var t=p(e)?e.size():ze(e);switch(t.length){case 1:if(1===t[0])return p(e)?n([r(1,e.valueOf()[0])]):[r(1,e[0])];throw new RangeError("Matrix must be square (size: "+Te(t)+")");case 2:var i=t[0],a=t[1];if(i===a)return p(e)?n(c(e.valueOf(),i,a),e.storage()):c(e,i,a);throw new RangeError("Matrix must be square (size: "+Te(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+Te(t)+")")}},any:function(e){return r(1,e)}});function c(e,t,n){var c,f,p,m,d;if(1===t){if(0===(m=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[r(1,m)]]}if(2===t){var h=s(e);if(0===h)throw Error("Cannot calculate inverse, determinant is zero");return[[r(e[1][1],h),r(o(e[0][1]),h)],[r(o(e[1][0]),h),r(e[0][0],h)]]}var y=e.concat();for(c=0;c<t;c++)y[c]=y[c].concat();for(var g=u(t).valueOf(),v=0;v<n;v++){var x=l(y[v][v]),b=v;for(c=v+1;c<t;)l(y[c][v])>x&&(x=l(y[c][v]),b=c),c++;if(0===x)throw Error("Cannot calculate inverse, determinant is zero");(c=b)!==v&&(d=y[v],y[v]=y[c],y[c]=d,d=g[v],g[v]=g[c],g[c]=d);var w=y[v],N=g[v];for(c=0;c<t;c++){var E=y[c],S=g[c];if(c!==v){if(0!==E[v]){for(p=r(o(E[v]),w[v]),f=v;f<n;f++)E[f]=i(E[f],a(p,w[f]));for(f=0;f<n;f++)S[f]=i(S[f],a(p,N[f]))}}else{for(p=w[v],f=v;f<n;f++)E[f]=r(E[f],p);for(f=0;f<n;f++)S[f]=r(S[f],p)}}}return g}})),jc=["typed","abs","add","identity","inv","multiply"],Lc=Ze("expm",jc,(function(e){var t=e.typed,n=e.abs,r=e.add,i=e.identity,a=e.inv,o=e.multiply;return t("expm",{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+Te(t)+")");for(var u=t[0],l=function(e,t){for(var n=0;n<30;n++)for(var r=0;r<=n;r++){var i=n-r;if(s(e,r,i)<t)return{q:r,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(function(e){for(var t=e.size()[0],r=0,i=0;i<t;i++){for(var a=0,o=0;o<t;o++)a+=n(e.get([i,o]));r=Math.max(a,r)}return r}(e),1e-15),c=l.q,f=l.j,p=o(e,Math.pow(2,-f)),m=i(u),d=i(u),y=1,g=p,v=-1,x=1;x<=c;x++)x>1&&(g=o(g,p),v=-v),m=r(m,o(y=y*(c-x+1)/((2*c-x+1)*x),g)),d=r(d,o(y*v,g));for(var b=o(a(d),m),w=0;w<f;w++)b=o(b,b);return h(e)?e.createSparseMatrix(b):b}});function s(e,t,n){for(var r=1,i=2;i<=t;i++)r*=i;for(var a=r,o=t+1;o<=2*t;o++)a*=o;var s=a*(2*t+1);return 8*Math.pow(e/Math.pow(2,n),2*t)*r*r/(a*s)}})),$c=["typed","matrix","multiply","equalScalar","divideScalar","inv"],Hc=Ze("divide",$c,(function(e){var t=e.typed,n=e.matrix,r=e.multiply,i=e.equalScalar,a=e.divideScalar,o=e.inv,s=nu({typed:t,equalScalar:i}),u=Js({typed:t});return t("divide",G({"Array | Matrix, Array | Matrix":function(e,t){return r(e,o(t))},"DenseMatrix, any":function(e,t){return u(e,t,a,!1)},"SparseMatrix, any":function(e,t){return s(e,t,a,!1)},"Array, any":function(e,t){return u(n(e),t,a,!1).valueOf()},"any, Array | Matrix":function(e,t){return r(e,o(t))}},a.signatures))})),Vc=["typed","add","divide","compare","partitionSelect"],Wc=Ze("median",Vc,(function(e){var t=e.typed,n=e.add,r=e.divide,i=e.compare,a=e.partitionSelect;function o(e){try{var t=(e=Ue(e.valueOf())).length;if(0===t)throw new Error("Cannot calculate median of an empty array");if(t%2===0){for(var n=t/2-1,r=a(e,n+1),o=e[n],l=0;l<n;++l)i(e[l],o)>0&&(o=e[l]);return u(o,r)}var c=a(e,(t-1)/2);return s(c)}catch(f){throw Vn(f,"median")}}var s=t({"number | BigNumber | Complex | Unit":function(e){return e}}),u=t({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,t){return r(n(e,t),2)}});return t("median",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,t){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(Vt(e))throw new TypeError("Scalar values expected in function median");return o(e)}})})),Gc=["typed","matrix","divide","sum","multiply","dotDivide","log","isNumeric"],Zc=Ze("kldivergence",Gc,(function(e){var t=e.typed,n=e.matrix,r=e.divide,i=e.sum,a=e.multiply,o=e.dotDivide,s=e.log,u=e.isNumeric;return t("kldivergence",{"Array, Array":function(e,t){return l(n(e),n(t))},"Matrix, Array":function(e,t){return l(e,n(t))},"Array, Matrix":function(e,t){return l(n(e),t)},"Matrix, Matrix":function(e,t){return l(e,t)}});function l(e,t){var n=t.size().length,l=e.size().length;if(n>1)throw new Error("first object must be one dimensional");if(l>1)throw new Error("second object must be one dimensional");if(n!==l)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 c=r(e,i(e)),f=r(t,i(t)),p=i(a(c,s(o(c,f))));return u(p)?p:Number.NaN}})),Yc=["typed","size","subset","compareNatural","Index"],Qc=Ze("setIsSubset",Yc,(function(e){var t=e.typed,n=e.size,r=e.subset,i=e.compareNatural,a=e.Index;return t("setIsSubset",{"Array | Matrix, Array | Matrix":function(e,t){if(0===r(n(e),new a(0)))return!0;if(0===r(n(t),new a(0)))return!1;for(var o,s=Ve(Ue(Array.isArray(e)?e:e.toArray()).sort(i)),u=Ve(Ue(Array.isArray(t)?t:t.toArray()).sort(i)),l=0;l<s.length;l++){o=!1;for(var c=0;c<u.length;c++)if(0===i(s[l].value,u[c].value)&&s[l].identifier===u[c].identifier){o=!0;break}if(!1===o)return!1}return!0}})})),Jc=["typed","abs","add","multiply","sqrt","subtract","inv","size","max","identity"],Xc=Ze("sqrtm",Jc,(function(e){var t=e.typed,n=e.abs,r=e.add,i=e.multiply,a=e.sqrt,o=e.subtract,s=e.inv,u=e.size,l=e.max,c=e.identity;function f(e){var t,a=0,f=e,p=c(u(e));do{var m=f;if(f=i(.5,r(m,s(p))),p=i(.5,r(p,s(m))),(t=l(n(o(f,m))))>1e-6&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(t>1e-6);return f}return t("sqrtm",{"Array | Matrix":function(e){var t=p(e)?e.size():ze(e);switch(t.length){case 1:if(1===t[0])return a(e);throw new RangeError("Matrix must be square (size: "+Te(t)+")");case 2:if(t[0]===t[1])return f(e);throw new RangeError("Matrix must be square (size: "+Te(t)+")")}}})})),Kc=["typed","abs","map","median","subtract"],ef=Ze("mad",Kc,(function(e){var t=e.typed,n=e.abs,r=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=Ue(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=i(e);return i(r(e,(function(e){return n(a(e,t))})))}catch(o){throw o instanceof TypeError&&-1!==o.message.indexOf("median")?new TypeError(o.message.replace("median","mad")):Vn(o,"mad")}}})),tf=["typed","add","divide","multiply","factorial","isInteger","isPositive"],nf=Ze("multinomial",tf,(function(e){var t=e.typed,n=e.add,r=e.divide,i=e.multiply,a=e.factorial,o=e.isInteger,s=e.isPositive;return t("multinomial",{"Array | Matrix":function(e){var t=0,u=1;return Wt(e,(function(e){if(!o(e)||!s(e))throw new TypeError("Positive integer value expected in function multinomial");t=n(t,e),u=i(u,a(e))})),r(a(t),u)}})})),rf=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","inv","bignumber","multiply","add"],af=Ze("eigs",rf,(function(e){var t=e.config,n=e.typed,r=e.matrix,i=e.addScalar,a=e.subtract,o=e.equal,s=e.abs,u=e.atan,l=e.cos,c=e.sin,f=e.multiplyScalar,p=e.inv,m=e.bignumber,d=e.multiply,h=e.add;return n("eigs",{Array:function(e){var t=r(e),n=t.size();if(2!==n.length||n[0]!==n[1])throw new RangeError("Matrix must be square (size: "+Te(n)+")");var i=y(t,n[0]);return{values:i[0],vectors:i[1]}},Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+Te(t)+")");var n=y(e,t[0]);return{values:r(n[0]),vectors:r(n[1])}}});function y(e,n){var r=e.datatype();if(void 0===r&&(r=e.getDataType()),"number"!==r&&"BigNumber"!==r&&"Fraction"!==r)throw"mixed"===r?new TypeError("Mixed matrix element type is not supported"):new TypeError("Matrix element type not supported ("+r+")");if(function(e,t){for(var n=0;n<t;n++)for(var r=n;r<t;r++)if(!o(e[n][r],e[r][n]))throw new TypeError("Input matrix is not symmetric")}(e.toArray(),n),"number"===r)return g(e.toArray());if("Fraction"===r){for(var i=e.toArray(),a=0;a<n;a++)for(var u=a;u<n;u++)i[a][u]=i[a][u].valueOf(),i[u][a]=i[a][u];return g(e.toArray())}return"BigNumber"===r?function(e){for(var n,r=e.length,i=s(t.epsilon/r),a=new Array(r),o=0;o<r;o++)a[o]=A(r,0),a[o][o]=1;var u=M(e);for(;s(u[1])>=s(i);){var l=u[0][0],c=u[0][1];n=x(e[l][l],e[c][c],e[l][c]),e=N(e,n,l,c),a=w(a,n,l,c),u=M(e)}for(var f=A(r,0),p=0;p<r;p++)f[p]=e[p][p];return T(V(f),V(a))}(e.toArray()):void 0}function g(e){for(var n,r=e.length,i=Math.abs(t.epsilon/r),a=new Array(r),o=0;o<r;o++)a[o]=A(r,0),a[o][o]=1;for(var s=S(e);Math.abs(s[1])>=Math.abs(i);){var u=s[0][0],l=s[0][1];e=E(e,n=v(e[u][u],e[l][l],e[u][l]),u,l),a=b(a,n,u,l),s=S(e)}for(var c=A(r,0),f=0;f<r;f++)c[f]=e[f][f];return T(V(c),V(a))}function v(e,n,r){var i=n-e;return Math.abs(i)<=t.epsilon?Math.PI/4:.5*Math.atan(2*r/(n-e))}function x(e,n,r){var i=a(n,e);return s(i)<=t.epsilon?m(-1).acos().div(4):f(.5,u(d(2,r,p(i))))}function b(e,t,n,r){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=A(i,0),u=A(i,0),l=0;l<i;l++)s[l]=a*e[l][n]-o*e[l][r],u[l]=o*e[l][n]+a*e[l][r];for(var c=0;c<i;c++)e[c][n]=s[c],e[c][r]=u[c];return e}function w(e,t,n,r){for(var o=e.length,s=l(t),u=c(t),p=A(o,m(0)),d=A(o,m(0)),h=0;h<o;h++)p[h]=a(f(s,e[h][n]),f(u,e[h][r])),d[h]=i(f(u,e[h][n]),f(s,e[h][r]));for(var y=0;y<o;y++)e[y][n]=p[y],e[y][r]=d[y];return e}function N(e,t,n,r){for(var o=e.length,s=m(l(t)),u=m(c(t)),p=f(s,s),y=f(u,u),g=A(o,m(0)),v=A(o,m(0)),x=d(m(2),s,u,e[n][r]),b=i(a(f(p,e[n][n]),x),f(y,e[r][r])),w=h(f(y,e[n][n]),x,f(p,e[r][r])),N=0;N<o;N++)g[N]=a(f(s,e[n][N]),f(u,e[r][N])),v[N]=i(f(u,e[n][N]),f(s,e[r][N]));e[n][n]=b,e[r][r]=w,e[n][r]=m(0),e[r][n]=m(0);for(var E=0;E<o;E++)E!==n&&E!==r&&(e[n][E]=g[E],e[E][n]=g[E],e[r][E]=v[E],e[E][r]=v[E]);return e}function E(e,t,n,r){for(var i=e.length,a=Math.cos(t),o=Math.sin(t),s=a*a,u=o*o,l=A(i,0),c=A(i,0),f=s*e[n][n]-2*a*o*e[n][r]+u*e[r][r],p=u*e[n][n]+2*a*o*e[n][r]+s*e[r][r],m=0;m<i;m++)l[m]=a*e[n][m]-o*e[r][m],c[m]=o*e[n][m]+a*e[r][m];e[n][n]=f,e[r][r]=p,e[n][r]=0,e[r][n]=0;for(var d=0;d<i;d++)d!==n&&d!==r&&(e[n][d]=l[d],e[d][n]=l[d],e[r][d]=c[d],e[d][r]=c[d]);return e}function S(e){for(var t=e.length,n=0,r=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)Math.abs(n)<Math.abs(e[i][a])&&(n=Math.abs(e[i][a]),r=[i,a]);return[r,n]}function M(e){for(var t=e.length,n=0,r=[0,1],i=0;i<t;i++)for(var a=i+1;a<t;a++)s(n)<s(e[i][a])&&(n=s(e[i][a]),r=[i,a]);return[r,n]}function T(e,t){for(var n=e.length,r=Array(n),i=Array(n),a=0;a<n;a++)i[a]=Array(n);for(var o=0;o<n;o++){for(var s=0,u=e[0],l=0;l<e.length;l++)e[l]<u&&(u=e[s=l]);r[o]=e.splice(s,1)[0];for(var c=0;c<n;c++)i[c][o]=t[c][s],t[c].splice(s,1)}return[V(r),V(i)]}function A(e,t){for(var n=new Array(e),r=0;r<e;r++)n[r]=t;return n}})),of=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],sf=Ze("norm",of,(function(e){var t=e.typed,n=e.abs,r=e.add,i=e.pow,a=e.conj,o=e.sqrt,s=e.multiply,u=e.equalScalar,l=e.larger,c=e.smaller,f=e.matrix,p=e.ctranspose,m=e.eigs;return t("norm",{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 y(f(e),2)},Matrix:function(e){return y(e,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(e){return this(e)},"Array, number | BigNumber | string":function(e,t){return y(f(e),t)},"Matrix, number | BigNumber | string":function(e,t){return y(e,t)}});function d(e,t){if(t===Number.POSITIVE_INFINITY||"inf"===t)return function(e){var t=0;return e.forEach((function(e){var r=n(e);l(r,t)&&(t=r)}),!0),t}(e);if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return function(e){var t;return e.forEach((function(e){var r=n(e);t&&!c(r,t)||(t=r)}),!0),t||0}(e);if("fro"===t)return y(e,2);if("number"===typeof t&&!isNaN(t)){if(!u(t,0)){var a=0;return e.forEach((function(e){a=r(i(n(e),t),a)}),!0),i(a,1/t)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function h(e,t){if(1===t)return function(e){var t=[],i=0;return e.forEach((function(e,a){var o=a[1],s=r(t[o]||0,n(e));l(s,i)&&(i=s),t[o]=s}),!0),i}(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],s=r(t[o]||0,n(e));l(s,i)&&(i=s),t[o]=s}),!0),i}(e);if("fro"===t)return function(e){var t=0;return e.forEach((function(e,n){t=r(t,s(e,a(e)))})),n(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 r=p(e),i=s(r,e),a=m(i).values,u=a.get([a.size()[0]-1]);return n(o(u))}(e);throw new Error("Unsupported parameter value "+t)}function y(e,t){var n=e.size();if(1===n.length)return d(e,t);if(2===n.length){if(n[0]&&n[1])return h(e,t);throw new RangeError("Invalid matrix dimensions")}}})),uf=pr({}),lf=yr({}),cf=gr({}),ff=Ar({}),pf=Or({}),mf=Tr({}),df=Wr({config:K}),hf=Gr({}),yf=Zr({}),gf=jr({Complex:lf}),vf=Pr({BigNumber:df,config:K}),xf=Rr({BigNumber:df,config:K}),bf=_r({BigNumber:df,config:K}),wf=kr({BigNumber:df,config:K}),Nf=Ur({BigNumber:df,config:K}),Ef=zr({BigNumber:df,config:K}),Sf=Ei({BigNumber:df,config:K}),Mf=di({BigNumber:df,config:K}),Tf=Ii({BigNumber:df,config:K}),Af=Ni({BigNumber:df,config:K}),Of=Yi({}),Cf=Ir({BigNumber:df,config:K}),_f=Cr({BigNumber:df,config:K}),kf=qr({BigNumber:df,config:K}),zf=Lr({}),If=Qi({Matrix:hf}),Df=Dr({BigNumber:df,config:K}),Bf=ea({BigNumber:df,Complex:lf,DenseMatrix:If,Fraction:Of}),Pf=ia({typed:Bf}),qf=aa({typed:Bf}),Rf=ca({typed:Bf}),Uf=fa({typed:Bf}),Ff=ma({config:K,typed:Bf}),jf=da({typed:Bf}),Lf=ha({typed:Bf}),$f=ya({Complex:lf,typed:Bf}),Hf=ga({typed:Bf}),Vf=ja({BigNumber:df,config:K,typed:Bf}),Wf=En({isInteger:Pf,typed:Bf}),Gf=La({typed:Bf}),Zf=$a({Complex:lf,typed:Bf}),Yf=Ha({Complex:lf,config:K,typed:Bf}),Qf=Va({typed:Bf}),Jf=Wa({BigNumber:df,Fraction:Of,complex:$f,typed:Bf}),Xf=Ga({typed:Bf}),Kf=co({typed:Bf}),ep=fo({typed:Bf}),tp=po({typed:Bf}),np=vo({typed:Bf}),rp=xo({typed:Bf}),ip=wo({typed:Bf}),ap=Eo({typed:Bf}),op=Mo({typed:Bf}),sp=ko({typed:Bf}),up=zo({typed:Bf}),lp=Io({Complex:lf,config:K,typed:Bf}),cp=Qo({BigNumber:df,typed:Bf}),fp=Jo({BigNumber:df,Complex:lf,config:K,typed:Bf}),pp=Xo({BigNumber:df,Complex:lf,config:K,typed:Bf}),mp=Ko({Complex:lf,config:K,typed:Bf}),dp=es({typed:Bf}),hp=ts({Complex:lf,config:K,typed:Bf}),yp=ns({typed:Bf}),gp=rs({BigNumber:df,typed:Bf}),vp=is({BigNumber:df,typed:Bf}),xp=as({BigNumber:df,typed:Bf}),bp=os({typed:Bf}),wp=ss({typed:Bf}),Np=cs({typed:Bf}),Ep=ys({config:K,typed:Bf}),Sp=vs({config:K,typed:Bf}),Mp=Br({BigNumber:df,config:K}),Tp=xs({typed:Bf}),Ap=bs({isNumeric:qf,typed:Bf}),Op=ws({typed:Bf}),Cp=Ns({typed:Bf}),_p=Es({Fraction:Of,typed:Bf}),kp=Ss({typed:Bf}),zp=Ms({typed:Bf}),Ip=Ts({typed:Bf}),Dp=As({Complex:lf,config:K,typed:Bf}),Bp=Os({Complex:lf,config:K,typed:Bf}),Pp=Cs({typed:Bf}),qp=_s({typed:Bf}),Rp=ks({isNaN:Uf,isNumeric:qf,typed:Bf}),Up=zs({typed:Bf}),Fp=Ds({Complex:lf,config:K,typed:Bf}),jp=Bs({BigNumber:df,typed:Bf}),Lp=Ps({typed:Bf}),$p=qs({typed:Bf}),Hp=Rs({BigNumber:df,typed:Bf}),Vp=Us({typed:Bf}),Wp=Fs({typed:Bf}),Gp=Ls({config:K,typed:Bf}),Zp=Fr({BigNumber:df,config:K}),Yp=$s({typed:Bf}),Qp=Hs({Matrix:hf,equalScalar:Ff,typed:Bf}),Jp=Vs({DenseMatrix:If,Matrix:hf,SparseMatrix:Qp,typed:Bf}),Xp=Ws({BigNumber:df,Complex:lf,Fraction:Of,config:K,isNegative:Yp,matrix:Jp,typed:Bf,unaryMinus:kp}),Kp=Xs({BigNumber:df,DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf}),em=iu({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf}),tm=ou({BigNumber:df,equalScalar:Ff,matrix:Jp,typed:Bf}),nm=su({BigNumber:df,config:K,matrix:Jp,typed:Bf}),rm=uu({equalScalar:Ff,matrix:Jp,typed:Bf}),im=cu({DenseMatrix:If,matrix:Jp,typed:Bf}),am=fu({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf}),om=Ln({isInteger:Pf,matrix:Jp,typed:Bf}),sm=pu({DenseMatrix:If,SparseMatrix:Qp,matrix:Jp,typed:Bf}),um=mu({BigNumber:df,DenseMatrix:If,SparseMatrix:Qp,config:K,matrix:Jp,typed:Bf}),lm=du({BigNumber:df,config:K,matrix:Jp,typed:Bf}),cm=hu({isInteger:Pf,matrix:Jp,typed:Bf}),fm=yu({matrix:Jp,config:K,typed:Bf}),pm=Bn({matrix:Jp,typed:Bf}),mm=gu({BigNumber:df,config:K,matrix:Jp,typed:Bf}),dm=vu({matrix:Jp,typed:Bf}),hm=Eu({BigNumber:df,DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf,zeros:mm}),ym=Tu({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf,zeros:mm}),gm=Au({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf,zeros:mm}),vm=Ou({BigNumber:df,DenseMatrix:If,Fraction:Of,config:K,equalScalar:Ff,matrix:Jp,typed:Bf}),xm=Cu({matrix:Jp,typed:Bf}),bm=_u({DenseMatrix:If,config:K,matrix:Jp,typed:Bf}),wm=ku({DenseMatrix:If,config:K,matrix:Jp,typed:Bf}),Nm=zu({DenseMatrix:If,config:K,equalScalar:Ff,matrix:Jp,typed:Bf}),Em=Iu({DenseMatrix:If,smaller:bm}),Sm=Du({larger:wm,smaller:bm}),Mm=Bu({SparseMatrix:Qp,typed:Bf}),Tm=Pu({BigNumber:df,Complex:lf,config:K,typed:Bf}),Am=Ru({BigNumber:df,DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf}),Om=Uu({BigNumber:df,typed:Bf}),Cm=Fu({DenseMatrix:If,SparseMatrix:Qp,addScalar:zp,equalScalar:Ff,matrix:Jp,typed:Bf}),_m=ju({addScalar:zp,conj:Pp,multiplyScalar:Qf,size:fm,typed:Bf}),km=Lu({addScalar:zp,combinations:Np,isInteger:Pf,isNegative:Yp,isPositive:Rf,larger:wm,typed:Bf}),zm=$u({typed:Bf}),Im=Hu({typed:Bf}),Dm=Vu({config:K,round:hm,typed:Bf}),Bm=Wu({addScalar:zp,dot:_m,equalScalar:Ff,matrix:Jp,multiplyScalar:Qf,typed:Bf}),Pm=Gu({equalScalar:Ff,matrix:Jp,multiplyScalar:Qf,typed:Bf}),qm=Zu({typed:Bf}),Rm=Yu({matrix:Jp,typed:Bf}),Um=Ju({config:K,matrix:Jp}),Fm=Xu({matrix:Jp,typed:Bf}),jm=Ku({Complex:lf,config:K,fraction:_p,identity:um,matrix:Jp,multiply:Bm,number:jf,typed:Bf}),Lm=el({DenseMatrix:If,equalScalar:Ff,matrix:Jp,pow:jm,typed:Bf}),$m=tl({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf,zeros:mm}),Hm=il({compare:vm,typed:Bf}),Vm=al({compareText:xm,isZero:zm,typed:Bf}),Wm=ol({DenseMatrix:If,config:K,matrix:Jp,typed:Bf}),Gm=sl({compare:vm,isNaN:Uf,isNumeric:qf,typed:Bf}),Zm=ul({ImmutableDenseMatrix:Em}),Ym=ll({BigNumber:df,Complex:lf,config:K,typed:Bf}),Qm=cl({typed:Bf}),Jm=fl({DenseMatrix:If,Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),Xm=pl({DenseMatrix:If,Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),Km=ml({Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),ed=dl({compareNatural:Hm,typed:Bf}),td=hl({add:Cm,matrix:Jp,typed:Bf}),nd=yl({add:Cm,compare:vm,multiply:Bm,partitionSelect:Gm,typed:Bf}),rd=bl({BigNumber:df,Complex:lf,config:K,multiplyScalar:Qf,pow:jm,typed:Bf}),id=wl({BigNumber:df,typed:Bf}),ad=Nl({equalScalar:Ff,matrix:Jp,typed:Bf}),od=El({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf}),sd=Sl({matrix:Jp,multiplyScalar:Qf,typed:Bf}),ud=Ml({matrix:Jp,typed:Bf}),ld=Tl({bignumber:id,fraction:_p,number:jf}),cd=Al({equalScalar:Ff,matrix:Jp,not:np,typed:Bf,zeros:mm}),fd=Ol({DenseMatrix:If,config:K,matrix:Jp,typed:Bf}),pd=Cl({compare:vm,compareNatural:Hm,matrix:Jp,typed:Bf}),md=Zn({config:K,numeric:ld,smaller:bm,typed:Bf}),dd=_l({BigNumber:df,typed:Bf}),hd=kl({DenseMatrix:If,Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),yd=zl({Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),gd=Il({Index:Zm,typed:Bf}),vd=Qn({add:Cm,config:K,numeric:ld,typed:Bf}),xd=Dl({gamma:rd,typed:Bf}),bd=Bl({factorial:xd,typed:Bf}),wd=ql({config:K,round:hm,typed:Bf}),Nd=Rl({DenseMatrix:If,addScalar:zp,equalScalar:Ff,matrix:Jp,typed:Bf,unaryMinus:kp}),Ed=Fl({matrix:Jp,multiply:Bm,subtract:Nd,typed:Bf}),Sd=er({bignumber:id,matrix:Jp,config:K,larger:wm,largerEq:Wm,smaller:bm,smallerEq:fd,typed:Bf}),Md=jl({conj:Pp,transpose:ud,typed:Bf}),Td=Ll({numeric:ld,typed:Bf}),Ad=$l({Complex:lf,config:K,divideScalar:Td,typed:Bf}),Od=Vl({DenseMatrix:If,divideScalar:Td,equalScalar:Ff,matrix:Jp,multiplyScalar:Qf,subtract:Nd,typed:Bf}),Cd=Wl({DenseMatrix:If,equalScalar:Ff,matrix:Jp,typed:Bf}),_d=Wn({config:K,larger:wm,numeric:ld,typed:Bf}),kd=Gl({DenseMatrix:If,Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),zd=Zl({Index:Zm,concat:om,setDifference:Jm,size:fm,subset:pm,typed:Bf}),Id=Yl({abs:Im,addScalar:zp,divideScalar:Td,isPositive:Rf,multiplyScalar:Qf,smaller:bm,sqrt:Bp,typed:Bf}),Dd=Jl({addScalar:zp,complex:$f,conj:Pp,divideScalar:Td,equal:Cd,identity:um,isZero:zm,matrix:Jp,multiplyScalar:Qf,sign:Jf,sqrt:Bp,subtract:Nd,typed:Bf,unaryMinus:kp,zeros:mm}),Bd=Xl({abs:Im,addScalar:zp,divideScalar:Td,multiplyScalar:Qf,sqrt:Bp,subtract:Nd,typed:Bf,unaryMinus:kp}),Pd=Kl({addScalar:zp,combinations:Np,divideScalar:Td,factorial:xd,isInteger:Pf,isNegative:Yp,larger:wm,multiplyScalar:Qf,pow:jm,subtract:Nd,typed:Bf}),qd=ec({addScalar:zp,combinations:Np,divideScalar:Td,isInteger:Pf,isNegative:Yp,multiplyScalar:Qf,typed:Bf}),Rd=tc({Complex:lf,ceil:wd,floor:Dm,typed:Bf}),Ud=Xn({Index:Zm,matrix:Jp,range:Sd,typed:Bf}),Fd=ir({Index:Zm,matrix:Jp,range:Sd,typed:Bf}),jd=nc({Complex:lf,config:K,divideScalar:Td,typed:Bf}),Ld=rc({DenseMatrix:If,divideScalar:Td,equalScalar:Ff,matrix:Jp,typed:Bf}),$d=ic({equal:Cd,typed:Bf}),Hd=cc({BigNumber:df,Complex:lf,Fraction:Of,abs:Im,addScalar:zp,config:K,divideScalar:Td,equal:Cd,fix:Rd,format:sp,isNumeric:qf,multiplyScalar:Qf,number:jf,pow:jm,round:hm,subtract:Nd}),Vd=fc({Unit:Hd,typed:Bf}),Wd=pc({Index:Zm,concat:om,setIntersect:Xm,setSymDifference:zd,size:fm,subset:pm,typed:Bf}),Gd=Mc({SparseMatrix:Qp,abs:Im,add:Cm,divideScalar:Td,larger:wm,largerEq:Wm,multiply:Bm,subtract:Nd,transpose:ud,typed:Bf}),Zd=Tc({abs:Im,add:Cm,addScalar:zp,config:K,divideScalar:Td,equalScalar:Ff,matrix:Jp,multiply:Bm,multiplyScalar:Qf,smaller:bm,subtract:Nd,typed:Bf}),Yd=Ac({addScalar:zp,isInteger:Pf,isNegative:Yp,stirlingS2:Pd,typed:Bf}),Qd=Si({BigNumber:df,Unit:Hd,config:K}),Jd=ii({BigNumber:df,Unit:Hd,config:K}),Xd=Ti({BigNumber:df,Unit:Hd,config:K}),Kd=ai({BigNumber:df,Unit:Hd,config:K}),eh=gi({BigNumber:df,Unit:Hd,config:K}),th=pi({BigNumber:df,Unit:Hd,config:K}),nh=Ai({BigNumber:df,Unit:Hd,config:K}),rh=Oi({BigNumber:df,Unit:Hd,config:K}),ih=Qr({BigNumber:df,Unit:Hd,config:K}),ah=hi({BigNumber:df,Unit:Hd,config:K}),oh=li({BigNumber:df,Unit:Hd,config:K}),sh=Kr({BigNumber:df,Unit:Hd,config:K}),uh=qi({BigNumber:df,Unit:Hd,config:K}),lh=ki({BigNumber:df,Unit:Hd,config:K}),ch=vi({BigNumber:df,Unit:Hd,config:K}),fh=$i({BigNumber:df,Unit:Hd,config:K}),ph=Fi({BigNumber:df,Unit:Hd,config:K}),mh=Hi({BigNumber:df,Unit:Hd,config:K}),dh=yi({BigNumber:df,Unit:Hd,config:K}),hh=Xr({BigNumber:df,Unit:Hd,config:K}),yh=Di({BigNumber:df,Unit:Hd,config:K}),gh=Bi({BigNumber:df,Unit:Hd,config:K}),vh=ti({BigNumber:df,Unit:Hd,config:K}),xh=Oc({DenseMatrix:If,matrix:Jp,typed:Bf}),bh=Cc({config:K,multiplyScalar:Qf,numeric:ld,typed:Bf}),wh=_c({DenseMatrix:If,divideScalar:Td,equalScalar:Ff,matrix:Jp,multiplyScalar:Qf,subtract:Nd,typed:Bf}),Nh=kc({Unit:Hd,typed:Bf}),Eh=Mi({BigNumber:df,Unit:Hd,config:K}),Sh=fi({BigNumber:df,Unit:Hd,config:K}),Mh=ei({BigNumber:df,Unit:Hd,config:K}),Th=mi({BigNumber:df,Unit:Hd,config:K}),Ah=Ui({BigNumber:df,Unit:Hd,config:K}),Oh=Ci({BigNumber:df,Unit:Hd,config:K}),Ch=Ri({BigNumber:df,Unit:Hd,config:K}),_h=ui({BigNumber:df,Unit:Hd,config:K}),kh=ji({BigNumber:df,Unit:Hd,config:K}),zh=xi({BigNumber:df,Unit:Hd,config:K}),Ih=Yr({BigNumber:df,Unit:Hd,config:K}),Dh=Pi({BigNumber:df,Unit:Hd,config:K}),Bh=nr({matrix:Jp,number:jf,subtract:Nd,typed:Bf}),Ph=zc({FibonacciHeap:Sm,addScalar:zp,equalScalar:Ff}),qh=Ic({DenseMatrix:If,Spa:Ph,SparseMatrix:Qp,abs:Im,addScalar:zp,divideScalar:Td,equalScalar:Ff,larger:wm,matrix:Jp,multiplyScalar:Qf,subtract:Nd,typed:Bf,unaryMinus:kp}),Rh=Dc({lup:qh,matrix:Jp,multiply:Bm,subtract:Nd,typed:Bf,unaryMinus:kp}),Uh=ci({BigNumber:df,Unit:Hd,config:K}),Fh=ri({BigNumber:df,Unit:Hd,config:K}),jh=oi({BigNumber:df,Unit:Hd,config:K}),Lh=zi({BigNumber:df,Unit:Hd,config:K}),$h=Li({BigNumber:df,Unit:Hd,config:K}),Hh=wi({BigNumber:df,Unit:Hd,config:K}),Vh=Bc({Complex:lf,config:K,divideScalar:Td,log:jd,typed:Bf}),Wh=Rc({DenseMatrix:If,lsolve:Od,lup:qh,matrix:Jp,slu:Gd,typed:Bf,usolve:wh}),Gh=Fc({abs:Im,addScalar:zp,det:Rh,divideScalar:Td,identity:um,matrix:Jp,multiply:Bm,typed:Bf,unaryMinus:kp}),Zh=Lc({abs:Im,add:Cm,identity:um,inv:Gh,multiply:Bm,typed:Bf}),Yh=Hc({divideScalar:Td,equalScalar:Ff,inv:Gh,matrix:Jp,multiply:Bm,typed:Bf}),Qh=Wc({add:Cm,compare:vm,divide:Yh,partitionSelect:Gm,typed:Bf}),Jh=ur({add:Cm,apply:Wf,divide:Yh,isNaN:Uf,multiply:Bm,subtract:Nd,typed:Bf}),Xh=Zc({divide:Yh,dotDivide:Ld,isNumeric:qf,log:jd,matrix:Jp,multiply:Bm,sum:vd,typed:Bf}),Kh=_i({BigNumber:df,Unit:Hd,config:K}),ey=Jr({BigNumber:df,Unit:Hd,config:K}),ty=Qc({Index:Zm,compareNatural:Hm,size:fm,subset:pm,typed:Bf}),ny=Xc({abs:Im,add:Cm,identity:um,inv:Gh,max:_d,multiply:Bm,size:fm,sqrt:Bp,subtract:Nd,typed:Bf}),ry=ef({abs:Im,map:ap,median:Qh,subtract:Nd,typed:Bf}),iy=nf({add:Cm,divide:Yh,factorial:xd,isInteger:Pf,isPositive:Rf,multiply:Bm,typed:Bf}),ay=ni({BigNumber:df,Unit:Hd,config:K}),oy=bi({BigNumber:df,Unit:Hd,config:K}),sy=or({add:Cm,divide:Yh,typed:Bf}),uy=af({abs:Im,add:Cm,addScalar:zp,atan:dp,bignumber:id,config:K,cos:$p,equal:Cd,inv:Gh,matrix:Jp,multiply:Bm,multiplyScalar:Qf,sin:Vp,subtract:Nd,typed:Bf}),ly=si({BigNumber:df,Unit:Hd,config:K}),cy=sf({abs:Im,add:Cm,conj:Pp,ctranspose:Md,eigs:uy,equalScalar:Ff,larger:wm,matrix:Jp,multiply:Bm,pow:jm,smaller:bm,sqrt:Bp,typed:Bf}),fy=cr({sqrt:Bp,typed:Bf,variance:Jh});function py(){return(py=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var my={},dy={},hy={},yy=Je({mathWithTransform:dy}),gy=Xe({Node:yy}),vy=Ke({Node:yy,ResultSet:uf}),xy=ut({Node:yy}),by=vt({Node:yy}),wy=xt({Node:yy}),Ny=St({Node:yy}),Ey=Mt({math:my}),Sy=Tt({classes:hy}),My=At({Node:yy}),Ty=Ot({Node:yy}),Ay=Ct({Node:yy}),Oy=_t({Node:yy,typed:Bf}),Cy=kt({Chain:Ey,typed:Bf}),_y=Bt({Node:yy,subset:pm}),ky=Rt({Node:yy,Range:cf,size:fm}),zy=Ft({matrix:Jp,Node:yy,subset:pm}),Iy=jt({Unit:Hd,Node:yy,math:my}),Dy=Ht({Node:yy,SymbolNode:Iy,math:my}),By=Xt({AccessorNode:_y,ArrayNode:gy,AssignmentNode:zy,BlockNode:vy,ConditionalNode:My,ConstantNode:xy,FunctionAssignmentNode:Oy,FunctionNode:Dy,IndexNode:ky,ObjectNode:by,OperatorNode:Ty,ParenthesisNode:wy,RangeNode:Ay,RelationalNode:Ny,SymbolNode:Iy,config:K,numeric:ld,typed:Bf}),Py=Kt({parse:By,typed:Bf}),qy=en({parse:By}),Ry=tn({parse:By,typed:Bf}),Uy=pn({bignumber:id,fraction:_p,ConstantNode:xy,FunctionNode:Dy,OperatorNode:Ty,ParenthesisNode:wy,SymbolNode:Iy,add:Cm,config:K,divide:Yh,equal:Cd,isZero:zm,mathWithTransform:dy,multiply:Bm,parse:By,pow:jm,subtract:Nd,typed:Bf}),Fy=dn({bignumber:id,fraction:_p,ConstantNode:xy,FunctionNode:Dy,OperatorNode:Ty,ParenthesisNode:wy,SymbolNode:Iy,add:Cm,config:K,divide:Yh,equal:Cd,isZero:zm,mathWithTransform:dy,multiply:Bm,parse:By,pow:jm,simplify:Uy,subtract:Nd,typed:Bf}),jy=yn({parse:By}),Ly=bn({Help:qy,mathWithTransform:dy,typed:Bf}),$y=wn({Parser:jy,typed:Bf}),Hy=Nn({ConstantNode:xy,FunctionNode:Dy,OperatorNode:Ty,ParenthesisNode:wy,SymbolNode:Iy,config:K,equal:Cd,isZero:zm,numeric:ld,parse:By,simplify:Uy,typed:Bf});py(my,{reviver:Sy,false:ff,null:pf,true:mf,replacer:yf,i:gf,LN10:vf,LOG10E:xf,NaN:bf,pi:wf,SQRT1_2:Nf,tau:Ef,efimovFactor:Sf,fineStructure:Mf,sackurTetrode:Tf,weakMixingAngle:Af,e:Cf,Infinity:_f,LOG2E:kf,PI:wf,version:zf,E:Cf,phi:Df,typed:Bf,isInteger:Pf,isNumeric:qf,isPositive:Rf,isNaN:Uf,equalScalar:Ff,number:jf,boolean:Lf,complex:$f,splitUnit:Hf,unaryPlus:Vf,apply:Wf,cube:Gf,expm1:Zf,log10:Yf,multiplyScalar:Qf,sign:Jf,square:Xf,bitNot:Kf,arg:ep,im:tp,not:np,filter:rp,forEach:ip,map:ap,erf:op,format:sp,isPrime:up,acos:lp,acot:cp,acsc:fp,asec:pp,asin:mp,atan:dp,atanh:hp,cosh:yp,coth:gp,csch:vp,sech:xp,sinh:bp,tanh:wp,chain:Cy,combinations:Np,pickRandom:Ep,randomInt:Sp,LN2:Mp,clone:Tp,hasNumericValue:Ap,typeOf:Op,string:Cp,fraction:_p,unaryMinus:kp,addScalar:zp,exp:Ip,log2:Dp,sqrt:Bp,conj:Pp,getMatrixDataType:qp,mode:Rp,print:Up,acosh:Fp,acsch:jp,asinh:Lp,cos:$p,csc:Hp,sin:Vp,combinationsWithRep:Wp,random:Gp,SQRT2:Zp,isNegative:Yp,matrix:Jp,cbrt:Xp,gcd:Kp,mod:em,nthRoot:tm,xgcd:nm,bitAnd:rm,bitXor:im,or:am,concat:om,diag:sm,identity:um,ones:lm,reshape:cm,size:fm,subset:pm,zeros:mm,to:dm,round:hm,leftShift:ym,rightLogShift:gm,compare:vm,compareText:xm,smaller:bm,larger:wm,unequal:Nm,sparse:Mm,acoth:Tm,atan2:Am,sec:Om,add:Cm,dot:_m,composition:km,isZero:zm,abs:Im,floor:Dm,multiply:Bm,dotMultiply:Pm,re:qm,flatten:Rm,resize:Um,squeeze:Fm,pow:jm,dotPow:Lm,rightArithShift:$m,compareNatural:Hm,equalText:Vm,largerEq:Wm,partitionSelect:Gm,asech:Ym,tan:Qm,setDifference:Jm,setIntersect:Xm,setMultiplicity:Km,setSize:ed,trace:td,quantileSeq:nd,gamma:rd,bignumber:id,lcm:ad,bitOr:od,kron:sd,transpose:ud,numeric:ld,and:cd,smallerEq:fd,sort:pd,min:md,cot:dd,setDistinct:hd,setPowerset:yd,index:gd,sum:vd,factorial:xd,permutations:bd,ceil:wd,subtract:Nd,cross:Ed,range:Sd,ctranspose:Md,divideScalar:Td,nthRoots:Ad,lsolve:Od,equal:Cd,max:_d,setCartesian:kd,setSymDifference:zd,hypot:Id,qr:Dd,distance:Bd,stirlingS2:Pd,catalan:qd,fix:Rd,column:Ud,row:Fd,log:jd,dotDivide:Ld,deepEqual:$d,createUnit:Vd,setUnion:Wd,slu:Gd,intersect:Zd,bellNumbers:Yd,atomicMass:Qd,bohrMagneton:Jd,boltzmann:Xd,conductanceQuantum:Kd,deuteronMass:eh,electronMass:th,faraday:nh,firstRadiation:rh,gravitationConstant:ih,hartreeEnergy:ah,klitzing:oh,magneticConstant:sh,molarMass:uh,molarPlanckConstant:lh,neutronMass:ch,planckCharge:fh,planckLength:ph,planckTemperature:mh,protonMass:dh,reducedPlanckConstant:hh,secondRadiation:yh,stefanBoltzmann:gh,vacuumImpedance:vh,xor:xh,prod:bh,usolve:wh,unit:Nh,avogadro:Eh,classicalElectronRadius:Sh,electricConstant:Mh,fermiCoupling:Th,gravity:Ah,loschmidt:Oh,molarMassC12:Ch,nuclearMagneton:_h,planckMass:kh,quantumOfCirculation:zh,speedOfLight:Ih,wienDisplacement:Dh,diff:Bh,parse:By,evaluate:Py,lup:qh,det:Rh,bohrRadius:Uh,elementaryCharge:Fh,inverseConductanceQuantum:jh,molarVolume:Lh,planckTime:$h,thomsonCrossSection:Hh,log1p:Vh,compile:Ry,lusolve:Wh,inv:Gh,expm:Zh,divide:Yh,median:Qh,variance:Jh,kldivergence:Xh,simplify:Uy,rationalize:Fy,gasConstant:Kh,planckConstant:ey,setIsSubset:ty,help:Ly,sqrtm:ny,mad:ry,multinomial:iy,coulomb:ay,rydberg:oy,parser:$y,mean:sy,derivative:Hy,eigs:uy,magneticFluxQuantum:ly,norm:cy,std:fy,config:K}),py(dy,my,{apply:Mn({isInteger:Pf,typed:Bf}),filter:_n({typed:Bf}),map:zn({typed:Bf}),forEach:Dn({typed:Bf}),subset:Fn({matrix:Jp,typed:Bf}),index:jn({Index:Zm}),concat:Hn({isInteger:Pf,matrix:Jp,typed:Bf}),max:Gn({config:K,larger:wm,numeric:ld,typed:Bf}),min:Yn({config:K,numeric:ld,smaller:bm,typed:Bf}),sum:Jn({add:Cm,config:K,numeric:ld,typed:Bf}),column:Kn({Index:Zm,matrix:Jp,range:Sd,typed:Bf}),range:tr({bignumber:id,matrix:Jp,config:K,larger:wm,largerEq:Wm,smaller:bm,smallerEq:fd,typed:Bf}),diff:rr({bignumber:id,matrix:Jp,number:jf,subtract:Nd,typed:Bf}),row:ar({Index:Zm,matrix:Jp,range:Sd,typed:Bf}),mean:sr({add:Cm,divide:Yh,typed:Bf}),variance:lr({add:Cm,apply:Wf,divide:Yh,isNaN:Uf,multiply:Bm,subtract:Nd,typed:Bf}),std:fr({sqrt:Bp,typed:Bf,variance:Jh})}),py(hy,{ResultSet:uf,Complex:lf,Range:cf,Node:yy,ArrayNode:gy,BlockNode:vy,ConstantNode:xy,ObjectNode:by,ParenthesisNode:wy,RelationalNode:Ny,Chain:Ey,BigNumber:df,Matrix:hf,ConditionalNode:My,OperatorNode:Ty,Fraction:Of,RangeNode:Ay,DenseMatrix:If,FunctionAssignmentNode:Oy,SparseMatrix:Qp,ImmutableDenseMatrix:Em,FibonacciHeap:Sm,AccessorNode:_y,IndexNode:ky,Index:Zm,AssignmentNode:zy,Unit:Hd,SymbolNode:Iy,FunctionNode:Dy,Spa:Ph,Help:qy,Parser:jy}),Ey.createProxy(my)}]]);
  //# sourceMappingURL=2.1e55130c.chunk.js.map