/*! For license information please see main-e2b91302.d5b7fad680a583ba526a.js.LICENSE.txt */ (self.webpackChunkstudio_client=self.webpackChunkstudio_client||[]).push([[3696],{2162:function(n){var r;n.exports=(r=function(n,r){var t=Array.prototype.concat,e=Array.prototype.slice,o=Object.prototype.toString;function a(r,t){var e=r>t?r:t;return n.pow(10,17-~~(n.log(e>0?e:-e)*n.LOG10E))}var u=Array.isArray||function(n){return"[object Array]"===o.call(n)};function i(n){return"[object Function]"===o.call(n)}function f(n){return"number"==typeof n&&n-n==0}function c(n){return t.apply([],n)}function l(){return new l._init(arguments)}function s(){return 0}function m(){return 1}function p(n,r){return n===r?1:0}l.fn=l.prototype,l._init=function(n){if(u(n[0]))if(u(n[0][0])){i(n[1])&&(n[0]=l.map(n[0],n[1]));for(var r=0;r=0;r--,e++)t[e]=[n[e][r]];return t},l.transpose=function(n){var r,t,e,o,a,i=[];for(u(n[0])||(n=[n]),t=n.length,e=n[0].length,a=0;a0&&(i[e][0]=n[e][0]),f=1;ft&&e>0)return[];if(e>0)for(o=n;ot;o+=e)a.push(o);return a},l.slice=function(){function n(n,t,e,o){var a,u=[],i=n.length;if(t===r&&e===r&&o===r)return l.copy(n);if(o=o||1,(t=(t=t||0)>=0?t:i+t)===(e=(e=e||n.length)>=0?e:i+e)||0===o)return[];if(te&&o>0)return[];if(o>0)for(a=t;ae;a+=o)u.push(n[a]);return u}function t(r,t){var e,o;return f((t=t||{}).row)?f(t.col)?r[t.row][t.col]:n(l.rowa(r,t.row),(e=t.col||{}).start,e.end,e.step):f(t.col)?n(l.cola(r,t.col),(o=t.row||{}).start,o.end,o.step):(o=t.row||{},e=t.col||{},n(r,o.start,o.end,o.step).map((function(r){return n(r,e.start,e.end,e.step)})))}return t}(),l.sliceAssign=function(t,e,o){var a,u;if(f(e.row)){if(f(e.col))return t[e.row][e.col]=o;e.col=e.col||{},e.col.start=e.col.start||0,e.col.end=e.col.end||t[0].length,e.col.step=e.col.step||1,a=l.arange(e.col.start,n.min(t.length,e.col.end),e.col.step);var i=e.row;return a.forEach((function(n,r){t[i][n]=o[r]})),t}if(f(e.col)){e.row=e.row||{},e.row.start=e.row.start||0,e.row.end=e.row.end||t.length,e.row.step=e.row.step||1,u=l.arange(e.row.start,n.min(t[0].length,e.row.end),e.row.step);var c=e.col;return u.forEach((function(n,r){t[n][c]=o[r]})),t}return o[0].length===r&&(o=[o]),e.row.start=e.row.start||0,e.row.end=e.row.end||t.length,e.row.step=e.row.step||1,e.col.start=e.col.start||0,e.col.end=e.col.end||t[0].length,e.col.step=e.col.step||1,u=l.arange(e.row.start,n.min(t.length,e.row.end),e.row.step),a=l.arange(e.col.start,n.min(t[0].length,e.col.end),e.col.step),u.forEach((function(n,r){a.forEach((function(e,a){t[n][e]=o[r][a]}))})),t},l.diagonal=function(n){var r=l.zeros(n.length,n.length);return n.forEach((function(n,t){r[t][t]=n})),r},l.copy=function(n){return n.map((function(n){return f(n)?n:n.map((function(n){return n}))}))};var d=l.prototype;return d.length=0,d.push=Array.prototype.push,d.sort=Array.prototype.sort,d.splice=Array.prototype.splice,d.slice=Array.prototype.slice,d.toArray=function(){return this.length>1?e.call(this):e.call(this)[0]},d.map=function(n,r){return l(l.map(this,n,r))},d.cumreduce=function(n,r){return l(l.cumreduce(this,n,r))},d.alter=function(n){return l.alter(this,n),this},function(n){for(var r=0;r=0;)r+=n[t];return r},n.sumsqrd=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t]*n[t];return r},n.sumsqerr=function(r){for(var t,e=n.mean(r),o=0,a=r.length;--a>=0;)o+=(t=r[a]-e)*t;return o},n.sumrow=function(n){for(var r=0,t=n.length;--t>=0;)r+=n[t];return r},n.product=function(n){for(var r=1,t=n.length;--t>=0;)r*=n[t];return r},n.min=function(n){for(var r=n[0],t=0;++tr&&(r=n[t]);return r},n.unique=function(n){for(var r={},t=[],e=0;eu?(f=[o[r]],u=a,i=0):a===u&&(f.push(o[r]),i++),a=1);return 0===i?f[0]:f},n.range=function(r){return n.max(r)-n.min(r)},n.variance=function(r,t){return n.sumsqerr(r)/(r.length-(t?1:0))},n.pooledvariance=function(r){return r.reduce((function(r,t){return r+n.sumsqerr(t)}),0)/(r.reduce((function(n,r){return n+r.length}),0)-r.length)},n.deviation=function(r){for(var t=n.mean(r),e=r.length,o=new Array(e),a=0;a=0;a--)o.push(r.abs(t[a]-e));return n.mean(o)},n.meddev=function(t){for(var e=n.median(t),o=[],a=t.length-1;a>=0;a--)o.push(r.abs(t[a]-e));return n.median(o)},n.coeffvar=function(r){return n.stdev(r)/n.mean(r)},n.quartiles=function(n){var t=n.length,o=n.slice().sort(e);return[o[r.round(t/4)-1],o[r.round(t/2)-1],o[r.round(3*t/4)-1]]},n.quantiles=function(n,t,a,u){var i,f,c,l,s,m=n.slice().sort(e),p=[t.length],d=n.length;for(void 0===a&&(a=3/8),void 0===u&&(u=3/8),i=0;i1){for(f=!0===e?this:this.transpose();i1){for("sumrow"!==r&&(f=!0===e?this:this.transpose());i1){for(i=i.transpose();u=0;i--)u*=e,u+=c[i];if(a=u/t+.5*r.log(o)+(t-.5)*r.log(t)-t,n<=7)for(i=1;i<=f;i++)a-=r.log(t-1),t-=1;return a},n.gammafn=function(n){var t,e,o,a,u=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],i=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],f=!1,c=0,l=0,s=0,m=n;if(n>171.6243769536076)return 1/0;if(m<=0){if(!(a=m%1+36e-17))return 1/0;f=(1&m?-1:1)*r.PI/r.sin(r.PI*a),m=1-m}for(o=m,e=m<1?m++:(m-=c=(0|m)-1)-1,t=0;t<8;++t)s=(s+u[t])*e,l=l*e+i[t];if(a=s/l+1,om)for(t=0;t=1?t:1/t)+.4*t+17);if(e<0||t<=0)return NaN;if(e170||e>170?r.exp(n.combinationln(t,e)):n.factorial(t)/n.factorial(e)/n.factorial(t-e)},n.combinationln=function(r,t){return n.factorialln(r)-n.factorialln(t)-n.factorialln(r-t)},n.permutation=function(r,t){return n.factorial(r)/n.factorial(r-t)},n.betafn=function(t,e){if(!(t<=0||e<=0))return t+e>170?r.exp(n.betaln(t,e)):n.gammafn(t)*n.gammafn(e)/n.gammafn(t+e)},n.betaln=function(r,t){return n.gammaln(r)+n.gammaln(t)-n.gammaln(r+t)},n.betacf=function(n,t,e){var o,a,u,i,f=1e-30,c=1,l=t+e,s=t+1,m=t-1,p=1,d=1-l*n/s;for(r.abs(d)=1)return r.max(100,e+100*r.sqrt(e));if(t<=0)return 0;for(e>1?(f=r.log(s),c=r.exp(s*(f-1)-p),i=t<.5?t:1-t,o=(2.30753+.27061*(a=r.sqrt(-2*r.log(i))))/(1+a*(.99229+.04481*a))-a,t<.5&&(o=-o),o=r.max(.001,e*r.pow(1-1/(9*e)-o/(3*r.sqrt(e)),3))):o=t<(a=1-e*(.253+.12*e))?r.pow(t/a,1/e):1-r.log(1-(t-a)/(1-a));l<12;l++){if(o<=0)return 0;if((o-=a=(u=(n.lowRegGamma(e,o)-t)/(a=e>1?c*r.exp(-(o-s)+s*(r.log(o)-f)):r.exp(-o+s*r.log(o)-p)))/(1-.5*r.min(1,u*((e-1)/o-1))))<=0&&(o=.5*(o+a)),r.abs(a)0;i--)o=c,c=e*c-l+u[i],l=o;return a=t*r.exp(-n*n+.5*(u[0]+e*c)-l),f?a-1:1-a},n.erfc=function(r){return 1-n.erf(r)},n.erfcinv=function(t){var e,o,a,u,i=0;if(t>=2)return-100;if(t<=0)return 100;for(u=t<1?t:2-t,e=-.70711*((2.30753+.27061*(a=r.sqrt(-2*r.log(u/2))))/(1+a*(.99229+.04481*a))-a);i<2;i++)e+=(o=n.erfc(e)-u)/(1.1283791670955126*r.exp(-e*e)-e*o);return t<1?e:-e},n.ibetainv=function(t,e,o){var a,u,i,f,c,l,s,m,p,d,g=1e-8,h=e-1,v=o-1,w=0;if(t<=0)return 0;if(t>=1)return 1;for(e>=1&&o>=1?(i=t<.5?t:1-t,l=(2.30753+.27061*(f=r.sqrt(-2*r.log(i))))/(1+f*(.99229+.04481*f))-f,t<.5&&(l=-l),s=(l*l-3)/6,m=2/(1/(2*e-1)+1/(2*o-1)),p=l*r.sqrt(s+m)/m-(1/(2*o-1)-1/(2*e-1))*(s+5/6-2/(3*m)),l=e/(e+o*r.exp(2*p))):(a=r.log(e/(e+o)),u=r.log(o/(e+o)),l=t<(f=r.exp(e*a)/e)/(p=f+(c=r.exp(o*u)/o))?r.pow(e*p*t,1/e):1-r.pow(o*p*(1-t),1/o)),d=-n.gammaln(e)-n.gammaln(o)+n.gammaln(e+o);w<10;w++){if(0===l||1===l)return l;if((l-=f=(c=(n.ibeta(l,e,o)-t)/(f=r.exp(h*r.log(l)+v*r.log(1-l)+d)))/(1-.5*r.min(1,c*(h/l-v/(1-l)))))<=0&&(l=.5*(l+f)),l>=1&&(l=.5*(l+f+1)),r.abs(f)0)break}return l},n.ibeta=function(t,e,o){var a=0===t||1===t?0:r.exp(n.gammaln(e+o)-n.gammaln(e)-n.gammaln(o)+e*r.log(t)+o*r.log(1-t));return!(t<0||t>1)&&(t<(e+1)/(e+o+2)?a*n.betacf(t,e,o)/e:1-a*n.betacf(1-t,o,e)/o)},n.randn=function(t,e){var o,a,u,i,f;if(e||(e=t),t)return n.create(t,e,(function(){return n.randn()}));do{o=n._random_fn(),a=1.7156*(n._random_fn()-.5),f=(u=o-.449871)*u+(i=r.abs(a)+.386595)*(.196*i-.25472*u)}while(f>.27597&&(f>.27846||a*a>-4*r.log(o)*o*o));return a/o},n.randg=function(t,e,o){var a,u,i,f,c,l,s=t;if(o||(o=e),t||(t=1),e)return(l=n.zeros(e,o)).alter((function(){return n.randg(t)})),l;t<1&&(t+=1),a=t-1/3,u=1/r.sqrt(9*a);do{do{f=1+u*(c=n.randn())}while(f<=0);f*=f*f,i=n._random_fn()}while(i>1-.331*r.pow(c,4)&&r.log(i)>.5*c*c+a*(1-f+r.log(f)));if(t==s)return a*f;do{i=n._random_fn()}while(0===i);return r.pow(i,1/s)*a*f},function(r){for(var t=0;to;)s=f,i=c+(a=-(t+l)*(t+e+l)*n/(t+2*l)/(t+2*l+1))*i,f=(u=f+a*u)+(a=(l+=1)*(e-l)*n/(t+2*l-1)/(t+2*l))*f,u/=c=i+a*c,i/=c,f/=c,c=1;return f/t}function e(n){return n/r.abs(n)}function o(t,e,o){var a=12,u=6,i=-30,f=-50,c=60,l=8,s=3,m=2,p=3,d=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],g=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],h=.5*t;if(h>=l)return 1;var v,w=2*n.normal.cdf(h,0,1,1,0)-1;w=w>=r.exp(f/o)?r.pow(w,o):0;for(var y=h,b=(l-h)/(v=t>s?m:p),x=y+b,q=0,_=o-1,A=1;A<=v;A++){for(var k=0,N=.5*(x+y),E=.5*(x-y),I=1;I<=a;I++){var R,S=N+E*(uc)break;var M=2*n.normal.cdf(S,0,1,1,0)*.5-2*n.normal.cdf(S,t,1,1,0)*.5;M>=r.exp(i/_)&&(k+=M=g[R-1]*r.exp(-.5*z)*r.pow(M,_))}q+=k*=2*E*o/r.sqrt(2*r.PI),y=x,x+=b}return(w+=q)<=r.exp(i/e)?0:(w=r.pow(w,e))>=1?1:w}function a(n,t,e){var o=.322232421088,a=.099348462606,u=-1,i=.588581570495,f=-.342242088547,c=.531103462366,l=-.204231210125,s=.10353775285,m=-453642210148e-16,p=.0038560700634,d=.8832,g=.2368,h=1.214,v=1.208,w=1.4142,y=120,b=.5-.5*n,x=r.sqrt(r.log(1/(b*b))),q=x+((((x*m+l)*x+f)*x+u)*x+o)/((((x*p+s)*x+c)*x+i)*x+a);e1||t<0?0:1==e&&1==o?1:e<512&&o<512?r.pow(t,e-1)*r.pow(1-t,o-1)/n.betafn(e,o):r.exp((e-1)*r.log(t)+(o-1)*r.log(1-t)-n.betaln(e,o))},cdf:function(r,t,e){return r>1||r<0?1*(r>1):n.ibeta(r,t,e)},inv:function(r,t,e){return n.ibetainv(r,t,e)},mean:function(n,r){return n/(n+r)},median:function(r,t){return n.ibetainv(.5,r,t)},mode:function(n,r){return(n-1)/(n+r-2)},sample:function(r,t){var e=n.randg(r);return e/(e+n.randg(t))},variance:function(n,t){return n*t/(r.pow(n+t,2)*(n+t+1))}}),n.extend(n.centralF,{pdf:function(t,e,o){var a;return t<0?0:e<=2?0===t&&e<2?1/0:0===t&&2===e?1:1/n.betafn(e/2,o/2)*r.pow(e/o,e/2)*r.pow(t,e/2-1)*r.pow(1+e/o*t,-(e+o)/2):(a=e*t/(o+t*e),e*(o/(o+t*e))/2*n.binomial.pdf((e-2)/2,(e+o-2)/2,a))},cdf:function(r,t,e){return r<0?0:n.ibeta(t*r/(t*r+e),t/2,e/2)},inv:function(r,t,e){return e/(t*(1/n.ibetainv(r,t/2,e/2)-1))},mean:function(n,r){return r>2?r/(r-2):void 0},mode:function(n,r){return n>2?r*(n-2)/(n*(r+2)):void 0},sample:function(r,t){return 2*n.randg(r/2)/r/(2*n.randg(t/2)/t)},variance:function(n,r){if(!(r<=4))return 2*r*r*(n+r-2)/(n*(r-2)*(r-2)*(r-4))}}),n.extend(n.cauchy,{pdf:function(n,t,e){return e<0?0:e/(r.pow(n-t,2)+r.pow(e,2))/r.PI},cdf:function(n,t,e){return r.atan((n-t)/e)/r.PI+.5},inv:function(n,t,e){return t+e*r.tan(r.PI*(n-.5))},median:function(n){return n},mode:function(n){return n},sample:function(t,e){return n.randn()*r.sqrt(1/(2*n.randg(.5)))*e+t}}),n.extend(n.chisquare,{pdf:function(t,e){return t<0?0:0===t&&2===e?.5:r.exp((e/2-1)*r.log(t)-t/2-e/2*r.log(2)-n.gammaln(e/2))},cdf:function(r,t){return r<0?0:n.lowRegGamma(t/2,r/2)},inv:function(r,t){return 2*n.gammapinv(r,.5*t)},mean:function(n){return n},median:function(n){return n*r.pow(1-2/(9*n),3)},mode:function(n){return n-2>0?n-2:0},sample:function(r){return 2*n.randg(r/2)},variance:function(n){return 2*n}}),n.extend(n.exponential,{pdf:function(n,t){return n<0?0:t*r.exp(-t*n)},cdf:function(n,t){return n<0?0:1-r.exp(-t*n)},inv:function(n,t){return-r.log(1-n)/t},mean:function(n){return 1/n},median:function(n){return 1/n*r.log(2)},mode:function(){return 0},sample:function(t){return-1/t*r.log(n._random_fn())},variance:function(n){return r.pow(n,-2)}}),n.extend(n.gamma,{pdf:function(t,e,o){return t<0?0:0===t&&1===e?1/o:r.exp((e-1)*r.log(t)-t/o-n.gammaln(e)-e*r.log(o))},cdf:function(r,t,e){return r<0?0:n.lowRegGamma(t,r/e)},inv:function(r,t,e){return n.gammapinv(r,t)*e},mean:function(n,r){return n*r},mode:function(n,r){if(n>1)return(n-1)*r},sample:function(r,t){return n.randg(r)*t},variance:function(n,r){return n*r*r}}),n.extend(n.invgamma,{pdf:function(t,e,o){return t<=0?0:r.exp(-(e+1)*r.log(t)-o/t-n.gammaln(e)+e*r.log(o))},cdf:function(r,t,e){return r<=0?0:1-n.lowRegGamma(t,e/r)},inv:function(r,t,e){return e/n.gammapinv(1-r,t)},mean:function(n,r){return n>1?r/(n-1):void 0},mode:function(n,r){return r/(n+1)},sample:function(r,t){return t/n.randg(r)},variance:function(n,r){if(!(n<=2))return r*r/((n-1)*(n-1)*(n-2))}}),n.extend(n.kumaraswamy,{pdf:function(n,t,e){return 0===n&&1===t?e:1===n&&1===e?t:r.exp(r.log(t)+r.log(e)+(t-1)*r.log(n)+(e-1)*r.log(1-r.pow(n,t)))},cdf:function(n,t,e){return n<0?0:n>1?1:1-r.pow(1-r.pow(n,t),e)},inv:function(n,t,e){return r.pow(1-r.pow(1-n,1/e),1/t)},mean:function(r,t){return t*n.gammafn(1+1/r)*n.gammafn(t)/n.gammafn(1+1/r+t)},median:function(n,t){return r.pow(1-r.pow(2,-1/t),1/n)},mode:function(n,t){if(n>=1&&t>=1&&1!==n&&1!==t)return r.pow((n-1)/(n*t-1),1/n)},variance:function(){throw new Error("variance not yet implemented")}}),n.extend(n.lognormal,{pdf:function(n,t,e){return n<=0?0:r.exp(-r.log(n)-.5*r.log(2*r.PI)-r.log(e)-r.pow(r.log(n)-t,2)/(2*e*e))},cdf:function(t,e,o){return t<0?0:.5+.5*n.erf((r.log(t)-e)/r.sqrt(2*o*o))},inv:function(t,e,o){return r.exp(-1.4142135623730951*o*n.erfcinv(2*t)+e)},mean:function(n,t){return r.exp(n+t*t/2)},median:function(n){return r.exp(n)},mode:function(n,t){return r.exp(n-t*t)},sample:function(t,e){return r.exp(n.randn()*e+t)},variance:function(n,t){return(r.exp(t*t)-1)*r.exp(2*n+t*t)}}),n.extend(n.noncentralt,{pdf:function(t,e,o){var a=1e-14;return r.abs(o)a||c>a;)l=c,m>0&&(p*=o*o/(2*m),d*=o*o/(2*(m+.5))),f+=.5*(c=p*n.beta.cdf(s,m+.5,e/2)+d*n.beta.cdf(s,m+1,e/2)),m++;return i?1-f:f}}),n.extend(n.normal,{pdf:function(n,t,e){return r.exp(-.5*r.log(2*r.PI)-r.log(e)-r.pow(n-t,2)/(2*e*e))},cdf:function(t,e,o){return.5*(1+n.erf((t-e)/r.sqrt(2*o*o)))},inv:function(r,t,e){return-1.4142135623730951*e*n.erfcinv(2*r)+t},mean:function(n){return n},median:function(n){return n},mode:function(n){return n},sample:function(r,t){return n.randn()*t+r},variance:function(n,r){return r*r}}),n.extend(n.pareto,{pdf:function(n,t,e){return n1e100?1e100:e,1/(r.sqrt(e)*n.betafn(.5,e/2))*r.pow(1+t*t/e,-(e+1)/2)},cdf:function(t,e){var o=e/2;return n.ibeta((t+r.sqrt(t*t+e))/(2*r.sqrt(t*t+e)),o,o)},inv:function(t,e){var o=n.ibetainv(2*r.min(t,1-t),.5*e,.5);return o=r.sqrt(e*(1-o)/o),t>.5?o:-o},mean:function(n){return n>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(t){return n.randn()*r.sqrt(t/(2*n.randg(t/2)))},variance:function(n){return n>2?n/(n-2):n>1?1/0:void 0}}),n.extend(n.weibull,{pdf:function(n,t,e){return n<0||t<0||e<0?0:e/t*r.pow(n/t,e-1)*r.exp(-r.pow(n/t,e))},cdf:function(n,t,e){return n<0?0:1-r.exp(-r.pow(n/t,e))},inv:function(n,t,e){return t*r.pow(-r.log(1-n),1/e)},mean:function(r,t){return r*n.gammafn(1+1/t)},median:function(n,t){return n*r.pow(r.log(2),1/t)},mode:function(n,t){return t<=1?0:n*r.pow((t-1)/t,1/t)},sample:function(t,e){return t*r.pow(-r.log(n._random_fn()),1/e)},variance:function(t,e){return t*t*n.gammafn(1+2/e)-r.pow(n.weibull.mean(t,e),2)}}),n.extend(n.uniform,{pdf:function(n,r,t){return nt?0:1/(t-r)},cdf:function(n,r,t){return n=o)return 1;if(a<0||a>1||o<=0)return NaN;var f=a,c=(e=r.floor(e))+1,l=o-e,s=c+l,m=r.exp(n.gammaln(s)-n.gammaln(l)-n.gammaln(c)+c*r.log(f)+l*r.log(1-f));return u=f<(c+1)/(s+2)?m*t(f,c,l,i):1-m*t(1-f,l,c,i),r.round(1/i*(1-u))/(1/i)}}),n.extend(n.negbin,{pdf:function(t,e,o){return t===t>>>0&&(t<0?0:n.combination(t+e-1,e-1)*r.pow(1-o,t)*r.pow(o,e))},cdf:function(r,t,e){var o=0,a=0;if(r<0)return 0;for(;a<=r;a++)o+=n.negbin.pdf(a,t,e);return o}}),n.extend(n.hypgeom,{pdf:function(t,e,o,a){if(t!=t|0)return!1;if(t<0||ta||t>o)return 0;if(2*o>e)return 2*a>e?n.hypgeom.pdf(e-o-a+t,e,e-o,e-a):n.hypgeom.pdf(a-t,e,e-o,a);if(2*a>e)return n.hypgeom.pdf(o-t,e,o,e-a);if(o1&&i=a||t>=o)return 1;if(2*o>e)return 2*a>e?n.hypgeom.cdf(e-o-a+t,e,e-o,e-a):1-n.hypgeom.cdf(a-t-1,e,e-o,a);if(2*a>e)return 1-n.hypgeom.cdf(o-t-1,e,o,e-a);if(o1&&fa);return o-1},sampleLarge:function(t){var e,o,a,u,i,f,c,l,s,m,p=t;for(u=r.sqrt(p),i=r.log(p),f=.02483*(c=.931+2.53*u)-.059,l=1.1239+1.1328/(c-3.4),s=.9277-3.6224/(c-2);;){if(o=r.random()-.5,a=r.random(),m=.5-r.abs(o),e=r.floor((2*f/m+c)*o+p+.43),m>=.07&&a<=s)return e;if(!(e<0||m<.013&&a>m)&&r.log(a)+r.log(l)-r.log(f/(m*m)+c)<=e*i-p-n.loggam(e+1))return e}},sample:function(n){return n<10?this.sampleSmall(n):this.sampleLarge(n)}}),n.extend(n.triangular,{pdf:function(n,r,t,e){return t<=r||et?NaN:nt?0:ne?NaN:n<=t?0:n>=e?1:n<=o?r.pow(n-t,2)/((e-t)*(o-t)):1-r.pow(e-n,2)/((e-t)*(e-o))},inv:function(n,t,e,o){return e<=t||oe?NaN:n<=(o-t)/(e-t)?t+(e-t)*r.sqrt(n*((o-t)/(e-t))):t+(e-t)*(1-r.sqrt((1-n)*(1-(o-t)/(e-t))))},mean:function(n,r,t){return(n+r+t)/3},median:function(n,t,e){return e<=(n+t)/2?t-r.sqrt((t-n)*(t-e))/r.sqrt(2):e>(n+t)/2?n+r.sqrt((t-n)*(e-n))/r.sqrt(2):void 0},mode:function(n,r,t){return t},sample:function(t,e,o){var a=n._random_fn();return a<(o-t)/(e-t)?t+r.sqrt(a*(e-t)*(o-t)):e-r.sqrt((1-a)*(e-t)*(e-o))},variance:function(n,r,t){return(n*n+r*r+t*t-n*r-n*t-r*t)/18}}),n.extend(n.arcsine,{pdf:function(n,t,e){return e<=t?NaN:n<=t||n>=e?0:2/r.PI*r.pow(r.pow(e-t,2)-r.pow(2*n-t-e,2),-.5)},cdf:function(n,t,e){return ng)return o(t,u,i);var q,_=.5*a,A=_*r.log(a)-a*r.log(2)-n.gammaln(_),k=_-1,N=.25*a;q=a<=m?h:a<=p?v:a<=d?w:y,A+=r.log(q);for(var E=0,I=1;I<=50;I++){for(var R=0,S=(2*I-1)*q,z=1;z<=f;z++){var M,j;c=l&&(R+=o(c=1&&R<=s)break;E+=R}if(R>s)throw new Error("tukey.cdf failed to converge");return E>1&&(E=1),E},inv:function(t,e,o){var u=1e-4,i=50;if(o<2||e<2)return NaN;if(t<0||t>1)return NaN;if(0===t)return 0;if(1===t)return 1/0;var f,c=a(t,e,o),l=n.tukey.cdf(c,e,o)-t;f=l>0?r.max(0,c-1):c+1;for(var s,m=n.tukey.cdf(f,e,o)-t,p=1;pe&&(o[a-1][u-1]=r[a][u])}var i=e%2?-1:1;t+=n(o)*r[0][e]*i}return t},gauss_elimination:function(t,e){var o,a,u,i,f=0,c=0,l=t.length,s=t[0].length,m=1,p=0,d=[];for(o=(t=n.aug(t,e))[0].length,f=0;f=0;f--){for(p=0,c=f+1;c<=l-1;c++)p+=d[c]*t[f][c];d[f]=(t[f][o-1]-p)/t[f][f]}return d},gauss_jordan:function(t,e){var o,a,u,i=n.aug(t,e),f=i.length,c=i[0].length,l=0;for(a=0;ar.abs(i[s][a])&&(s=u);var m=i[a];for(i[a]=i[s],i[s]=m,u=a+1;u=0;a--){for(l=i[a][a],u=0;ua-1;o--)i[u][o]-=i[a][o]*i[u][a]/l;for(i[a][a]/=l,o=f;os?(p[l][s]=t[l][s],d[l][s]=g[l][s]=0):la;)u=c,c=n.add(n.multiply(f,u),i),l++;return c},gauss_seidel:function(t,e,o,a){for(var u,i,f,c,l,s=0,m=t.length,p=[],d=[],g=[];su?(p[s][u]=t[s][u],d[s][u]=g[s][u]=0):sa;)i=l,l=n.add(n.multiply(c,i),f),s+=1;return l},SOR:function(t,e,o,a,u){for(var i,f,c,l,s,m=0,p=t.length,d=[],g=[],h=[];mi?(d[m][i]=t[m][i],g[m][i]=h[m][i]=0):ma;)f=s,s=n.add(n.multiply(l,f),c),m++;return s},householder:function(t){for(var e,o,a,u,i=t.length,f=t[0].length,c=0,l=[],s=[];c0?-1:1)*r.sqrt(e),o=r.sqrt((e*e-t[c+1][c]*e)/2),(l=n.zeros(i,1))[c+1][0]=(t[c+1][c]-e)/(2*o),a=c+2;a0?r.PI/4:-r.PI/4:r.atan(2*t[a][u]/(t[a][a]-t[u][u]))/2,(c=n.identity(s,s))[a][a]=r.cos(f),c[a][u]=-r.sin(f),c[u][a]=r.sin(f),c[u][u]=r.cos(f),m=n.multiply(m,c),t=n.multiply(n.multiply(n.inv(c),t),c),l=0,e=1;e.001&&(l=1)}for(e=0;e=s;)u=a(n,e+o),i=a(n,e),p[m]=(t[u]-2*t[i]+t[2*i-u])/(o*o),o/=2,m++;for(c=p.length,f=1;1!=c;){for(l=0;le);o++);return t[o-=1]+(e-r[o])*m[o]+n.sq(e-r[o])*l[o]+(e-r[o])*n.sq(e-r[o])*p[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(r){var t,e,o=r.length,a=r[0].length,u=0,i=[],f=[],c=[],l=[],s=[],m=[],p=[],d=[],g=[],h=[];for(u=0;u1||e>1||n<=0||e<=0)throw new Error("Proportions should be greater than 0 and less than 1");var a=(n*t+e*o)/(t+o);return(n-e)/r.sqrt(a*(1-a)*(1/t+1/o))}n.extend({zscore:function(){var r=t.call(arguments);return e(r[1])?(r[0]-r[1])/r[2]:(r[0]-n.mean(r[1]))/n.stdev(r[1],r[2])},ztest:function(){var e,a=t.call(arguments);return o(a[1])?(e=n.zscore(a[0],a[1],a[3]),1===a[2]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1)):a.length>2?(e=n.zscore(a[0],a[1],a[2]),1===a[3]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1)):(e=a[0],1===a[1]?n.normal.cdf(-r.abs(e),0,1):2*n.normal.cdf(-r.abs(e),0,1))}}),n.extend(n.fn,{zscore:function(n,r){return(n-this.mean())/this.stdev(r)},ztest:function(t,e,o){var a=r.abs(this.zscore(t,o));return 1===e?n.normal.cdf(-a,0,1):2*n.normal.cdf(-a,0,1)}}),n.extend({tscore:function(){var e=t.call(arguments);return 4===e.length?(e[0]-e[1])/(e[2]/r.sqrt(e[3])):(e[0]-n.mean(e[1]))/(n.stdev(e[1],!0)/r.sqrt(e[1].length))},ttest:function(){var o,a=t.call(arguments);return 5===a.length?(o=r.abs(n.tscore(a[0],a[1],a[2],a[3])),1===a[4]?n.studentt.cdf(-o,a[3]-1):2*n.studentt.cdf(-o,a[3]-1)):e(a[1])?(o=r.abs(a[0]),1==a[2]?n.studentt.cdf(-o,a[1]-1):2*n.studentt.cdf(-o,a[1]-1)):(o=r.abs(n.tscore(a[0],a[1])),1==a[2]?n.studentt.cdf(-o,a[1].length-1):2*n.studentt.cdf(-o,a[1].length-1))}}),n.extend(n.fn,{tscore:function(n){return(n-this.mean())/(this.stdev(!0)/r.sqrt(this.cols()))},ttest:function(t,e){return 1===e?1-n.studentt.cdf(r.abs(this.tscore(t)),this.cols()-1):2*n.studentt.cdf(-r.abs(this.tscore(t)),this.cols()-1)}}),n.extend({anovafscore:function(){var e,o,a,u,i,f,c,l,s=t.call(arguments);if(1===s.length){for(i=new Array(s[0].length),c=0;c.5?1-e:e)})),f=r.studentt.inv(.975,t.df_resid),c=t.coef.map((function(n,r){var t=f*a[r];return[n-t,n+t]}));return{se:a,t:u,p:i,sigmaHat:o,interval95:c}}function o(n){var t,e,o,a=n.R2/n.df_model/((1-n.R2)/n.df_resid);return{F_statistic:a,pvalue:1-(t=a,e=n.df_model,o=n.df_resid,r.beta.cdf(t/(o/e+t),e/2,o/2))}}function a(n,r){var a=t(n,r),u=e(a),i=o(a),f=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=u,a.f=i,a.adjust_R2=f,a}return{ols:a}}(),r.extend({buildxmatrix:function(){for(var n=new Array(arguments.length),t=0;t1){for(u=[],e=0;e{"use strict";function e(n){this.message=n}t.d(r,{Z:()=>i}),e.prototype=new Error,e.prototype.name="InvalidCharacterError";var o="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(n){var r=String(n).replace(/=+$/,"");if(r.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,o,a=0,u=0,i="";o=r.charAt(u++);~o&&(t=a%4?64*t+o:o,a++%4)?i+=String.fromCharCode(255&t>>(-2*a&6)):0)o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(o);return i};function a(n){var r=n.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(o(n).replace(/(.)/g,(function(n,r){var t=r.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t="0"+t),"%"+t})))}(r)}catch(n){return o(r)}}function u(n){this.message=n}u.prototype=new Error,u.prototype.name="InvalidTokenError";const i=function(n,r){if("string"!=typeof n)throw new u("Invalid token specified");var t=!0===(r=r||{}).header?0:1;try{return JSON.parse(a(n.split(".")[t]))}catch(n){throw new u("Invalid token specified: "+n.message)}}},1955:(n,r,t)=>{"use strict";function e(n){for(var r=1;ro});var o=function n(r,t){function o(n,o,a){if("undefined"!=typeof document){"number"==typeof(a=e({},t,a)).expires&&(a.expires=new Date(Date.now()+864e5*a.expires)),a.expires&&(a.expires=a.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var i in a)a[i]&&(u+="; "+i,!0!==a[i]&&(u+="="+a[i].split(";")[0]));return document.cookie=n+"="+r.write(o,n)+u}}return Object.create({set:o,get:function(n){if("undefined"!=typeof document&&(!arguments.length||n)){for(var t=document.cookie?document.cookie.split("; "):[],e={},o=0;o