@datagrok/curves 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -8
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/img/plate-dose-response-series.gif +0 -0
- package/img/plate-readers.gif +0 -0
- package/package.json +13 -11
- package/src/fit/const.ts +3 -2
- package/src/fit/fit-grid-cell-handler.ts +61 -56
- package/src/fit/fit-renderer.ts +142 -79
- package/src/fit/multi-curve-viewer.ts +32 -11
- package/src/fit/render-utils.ts +196 -138
- package/src/package-test.ts +7 -1
- package/src/package.g.ts +8 -0
- package/src/package.ts +253 -10
- package/src/plate/excel-plates.ts +112 -0
- package/src/plate/plate-cell-renderer.ts +40 -0
- package/src/plate/plate-reader.ts +28 -0
- package/src/plate/plate-widget.ts +478 -0
- package/src/plate/plate.ts +446 -0
- package/src/plate/readers/bmg-pherastar-96.ts +42 -0
- package/src/plate/readers/delfia-envision-96-max-rlu.ts +15 -0
- package/src/plate/readers/delfia-envision-by-row.ts +18 -0
- package/src/plate/readers/spectramax.ts +43 -0
- package/src/plate/utils.ts +129 -0
- package/src/tests/curves-cell-renderer-tests.ts +41 -22
- package/src/tests/fit-tests.ts +46 -11
- package/src/tests/plate-tests.ts +154 -0
- package/src/tests/transform-tests.ts +2 -2
- package/src/fit/cell-render-viewer.ts +0 -54
package/dist/package-test.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var curves_test;(()=>{var t={368:(t,e,n)=>{"use strict";function r(t){t.sort();const e=t[Math.trunc(t.length/4)],n=t.length%2==0?(t[Math.trunc(t.length/2)]+t[Math.trunc(t.length/2)-1])/2:t[Math.trunc(t.length/2)],r=t[Math.trunc(3*t.length/4)],i=1.5*(r-e);let s=o(t,r+i);s<0&&(s=~s);let a=t[Math.max(0,s-1)];a<r&&(a=r);let l=o(t,e-i);l<0&&(l=~l);let u=t[l];return u>e&&(u=e),{q1:e,q2:n,q3:r,lowerAdjacentValue:u,upperAdjacentValue:a}}function o(t,e,n=0,r){if(0===t.length)return-1;if(void 0===r&&(r=t.length-1),e<t[n])return-1;if(e>t[r])return-(r+1);for(;r-n>1;){const o=Math.trunc((r+n)/2);if(e===t[o])return o;e<t[o]?r=o:n=o}return t[n]===e?n:0===t[r]?r:e<t[n]?-(n+1):-(r+1)}n.d(e,{k:()=>r})},71:(t,e,n)=>{"use strict";n.d(e,{Pf:()=>I,Ff:()=>C,kx:()=>E,G7:()=>_,oH:()=>p,dZ:()=>m,EV:()=>M,xs:()=>w,W6:()=>b,IL:()=>T,O8:()=>S,ah:()=>N,TV:()=>A,mW:()=>L,sn:()=>P,AJ:()=>R,ry:()=>O,nK:()=>v});var r,o=n(82),i=n(572);class s extends Error{constructor(t){super(t)}}function a(t,e,n,r){for(let o=0;o<e;o++){let i=0;for(let t=0;t<e+1;t++)t!==n&&(i+=r[t][o]);t[o]=i/e}}function l(t,e,n,r,o,i,s,a){for(let l=0;l<i;l++)e[l]=t[l],e[l]+=o*(t[l]-r[n][l]),e[l]<s[l]?e[l]=s[l]:e[l]>a[l]&&(e[l]=a[l])}!function(t){t[t.TOLERANCE=.01]="TOLERANCE",t[t.MAX_ITER=20]="MAX_ITER",t[t.NON_ZERO_PARAM=1e-4]="NON_ZERO_PARAM",t[t.INITIAL_SCALE=.02]="INITIAL_SCALE",t[t.SCALE_REFLECTION=1]="SCALE_REFLECTION",t[t.SCALE_EXPANSION=2]="SCALE_EXPANSION",t[t.SCALE_CONTRACTION=-.5]="SCALE_CONTRACTION"}(r||(r={})),new Map([["tolerance","Tolerance"],["maxIter","Max iterations"],["nonZeroParam","Non-zero param"],["initialScale","Initial scale"],["scaleReflection","Scale reflection"],["scaleExpansion","Scale expansion"],["scaleContraction","Scale contraction"]]);const u=function(t,e,n,r,o){const i=n.tolerance,s=n.maxIter,u=n.scaleReflection,c=n.scaleExpansion,f=n.scaleContraction,h=e.length+1,d=e.length,[m,p]=function(t,e,n,r,o){const i=n.length+1,s=n.length,a=e.nonZeroParam,l=e.initialScale,u=new Array(i),c=new Array(i);for(let e=0;e<i;e++){u[e]=new Float32Array(s);for(let t=0;t<s;t++)u[e][t]=n[t],0!==e&&e-1===t&&(0===n[t]?u[e][t]=a:u[e][t]+=l*n[e-1],u[e][t]<r[t]?u[e][t]=r[t]:u[e][t]>o[t]&&(u[e][t]=o[t]));c[e]=t(u[e]).likelihood}return[u,c]}(t,n,e,r,o),y=new Array(h);for(let t=0;t<h;t++)y[t]=t;const g=y.length-1;let x=0,v=0,w=0,T=0;const _=new Float32Array(d),C=new Float32Array(d),E=new Float32Array(d),I=new Float32Array(d),A=new Array(s);if(h>1){for(;y.sort(((t,e)=>p[t]-p[e])),!(x>s);){if(0===x&&(v=p[0],w=2*p[y[0]]),A[x]=v,++x,v=p[y[0]],w-v>i)T=0;else if(++T,T>2*h)break;w=v,a(_,d,y[g],m),l(_,C,y[g],m,u,d,r,o);const e=t(C).likelihood;if(e<p[y[g]]){l(_,E,y[g],m,c,d,r,o);const n=t(E).likelihood;if(n<e){p[y[g]]=n;for(let t=0;t<d;t++)m[y[g]][t]=E[t];continue}p[y[g]]=e;for(let t=0;t<d;t++)m[y[g]][t]=C[t];continue}l(_,I,y[g],m,f,d,r,o);const n=t(I).likelihood;if(!(n<p[y[g]]))break;p[y[g]]=n;for(let t=0;t<d;t++)m[y[g]][t]=I[t]}for(let t=x;t<s;t++)A[t]=p[y[0]]}return{point:m[y[0]],cost:p[y[0]],iterCosts:A,iterCount:x-1}};var c=n(391),f=n.n(c);function h(t,e,n,r){const o=e-n,i=new Array(t);for(let e=0;e<t;e++){const t=r();i[e]=n+t*o}return i}function d(t,e,n,r,i=1,a=null,l=!0){const c=function(t,e,n){const r=f()("12345"),o=e.length,i=new Array(t);for(let e=0;e<t;e++)i[e]=new Float32Array(o);for(let s=0;s<o;s++)if(e[s]===n[s])for(let n=0;n<t;n++)i[n][s]=e[s];else{const o=h(t,e[s],n[s],r);for(let e=0;e<t;e++)i[e][s]=o[e]}return i}(i,n,e),d=[],m=[],p=[];let y,g=0,x=null;for(y=0;y<i;++y)try{if(0===y&&l){const e=new Float32Array(a.length).map((t=>-1/0)),n=new Float32Array(a.length).map((t=>1/0));d.push(u(t,c[y],r,e,n))}else d.push(u(t,c[y],r,e,n))}catch(t){if(t instanceof s)throw new Error(`Inconsistent dataframes: ${t.message}`);++g,m.push(t instanceof Error?t.message:"Platform issue"),p.push(c[y])}if(g>0){const t=n.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=new Float32Array(g);p.forEach(((t,n)=>t.forEach(((t,r)=>e[r][n]=t)))),x=o.DataFrame.fromColumns(e.map(((t,e)=>o.Column.fromFloat32Array(`arg${e}`,t)))),x.columns.add(o.Column.fromStrings("Issue",m))}return{extremums:d,fails:x}}const m={CONSTANT:"constant",PROPORTIONAL:"proportional",COMBINED:"combined"};class p{constructor(){this.chartOptions={},this.seriesOptions={},this.series=[]}}class y{}class g extends y{constructor(t,e,n,r){super(),this._name=t,this._parameterNames=r,this.y=e,this.getInitialParameters=n}get name(){return this._name}get parameterNames(){return this._parameterNames}y(t,e){throw new Error("Not implemented")}getInitialParameters(t,e){throw new Error("Not implemented")}}const x={linear:new class extends y{get name(){return C}get parameterNames(){return["Slope","Intercept"]}y(t,e){return P(t,e)}getInitialParameters(t,e){let n=0,r=0;for(let e=1;e<t.length;e++)t[e]<t[n]&&(n=e),t[e]>t[r]&&(r=e);const o=t[r]-t[n],i=(e[r]-e[n])/o,s=e[r]-i*t[r],a=new Float32Array(2);return a.set([i,s]),a}},sigmoid:new class extends y{get name(){return _}get parameterNames(){return["Top","Bottom","Slope","IC50"]}y(t,e){return O(t,e)}getInitialParameters(t,e){const n=o.Rect.fromXYArrays(t,e),r=(n.bottom-n.top)/2+n.top;let i=n.bottom-n.top,s=0;for(let n=0;n<t.length;n++){const t=Math.abs(e[n]-r);t<i&&(i=t,s=n)}const a=t[s],l=e[0]>e[e.length-1]?1:-1,u=new Float32Array(4);return u.set([n.bottom,l,a,n.top]),u}},"log-linear":new class extends y{get name(){return E}get parameterNames(){return["Slope","Intercept"]}y(t,e){return R(t,e)}getInitialParameters(t,e){const n=new Float32Array(2);return n.set([-5,100]),n}},exponential:new class extends y{get name(){return I}get parameterNames(){return["Mantissa","Power"]}y(t,e){return M(t,e)}getInitialParameters(t,e){const n=new Float32Array(2);return n.set([100,-2]),n}}},v=[o.Property.js("rSquared",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("auc",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("interceptY",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("interceptX",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("slope",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("top",o.TYPE.FLOAT,{userEditable:!1}),o.Property.js("bottom",o.TYPE.FLOAT,{userEditable:!1})],w=[o.Property.js("minX",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("minY",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("maxX",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("maxY",o.TYPE.FLOAT,{nullable:!0}),o.Property.js("title",o.TYPE.STRING,{nullable:!0}),o.Property.js("xAxisName",o.TYPE.STRING,{description:"Label to show on the X axis. If not specified, corresponding data column name is used",nullable:!0}),o.Property.js("yAxisName",o.TYPE.STRING,{description:"Label to show on the Y axis. If not specified, corresponding data column name is used",nullable:!0}),o.Property.js("logX",o.TYPE.BOOL,{description:"Whether the X axis should be logarithmic",defaultValue:!1}),o.Property.js("logY",o.TYPE.BOOL,{description:"Whether the Y axis should be logarithmic",defaultValue:!1}),o.Property.js("allowXZeroes",o.TYPE.BOOL,{description:"Whether x zeroes allowed for logarithmic data or not",defaultValue:!0}),o.Property.js("mergeSeries",o.TYPE.BOOL,{description:"Merges all series within one cell into one series",defaultValue:!1}),o.Property.js("showColumnLabel",o.TYPE.BOOL,{description:"Whether to show the column label in the legend or not",defaultValue:!1}),o.Property.js("showStatistics",o.TYPE.STRING_LIST,{description:"Whether specific statistics should be rendered",choices:v.map((t=>t.name)),inputType:"MultiChoice",friendlyName:"Statistics"})],T=[o.Property.js("fitFunction",o.TYPE.STRING,{category:"Fitting",choices:Object.keys(x),defaultValue:"sigmoid"}),o.Property.js("pointColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("fitLineColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("outlierColor",o.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),o.Property.js("errorModel",o.TYPE.STRING,{category:"Fitting",defaultValue:"constant",choices:["constant","proportional","combined"],nullable:!1}),o.Property.js("connectDots",o.TYPE.BOOL,{category:"Fitting",defaultValue:!1}),o.Property.js("clickToToggle",o.TYPE.BOOL,{category:"Fitting",description:"Click on a point to mark it as outlier and refit",nullable:!0,defaultValue:!1}),o.Property.js("showFitLine",o.TYPE.BOOL,{category:"Fitting",defaultValue:!0}),o.Property.js("showPoints",o.TYPE.STRING,{category:"Fitting",description:"Whether points/candlesticks/none should be rendered",defaultValue:"points",choices:["points","candlesticks","both"]}),o.Property.js("showCurveConfidenceInterval",o.TYPE.BOOL,{category:"Fitting",description:"Whether confidence intervals should be rendered",defaultValue:!1,friendlyName:"Confidence Interval"}),o.Property.js("markerType",o.TYPE.STRING,{category:"Rendering",defaultValue:"circle",choices:["asterisk","circle","cross border","diamond","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Marker"}),o.Property.js("outlierMarkerType",o.TYPE.STRING,{category:"Rendering",defaultValue:"outlier",choices:["asterisk","circle","cross border","diamond","outlier","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Outlier Marker"}),o.Property.js("lineStyle",o.TYPE.STRING,{category:"Rendering",defaultValue:"solid",choices:["solid","dotted","dashed","dashdotted"],nullable:!1}),o.Property.js("droplines",o.TYPE.STRING_LIST,{description:"Whether specific droplines should be rendered",choices:["IC50"],inputType:"MultiChoice"}),o.Property.js("columnName",o.TYPE.STRING,{description:"Column name where the series is stored",defaultValue:""})],_="sigmoid",C="linear",E="log-linear",I="exponential";function A(t){if("string"==typeof t)return x[t];if(!x[t.name]){const e=t.name,n=t.parameterNames,r=t.function.split("=>").map((t=>t.trim())),o=t.getInitialParameters.split("=>").map((t=>t.trim())),i=new Function(r[0].slice(1,r[0].length-1),`${r[1].includes(";")?"":"return "}${r[1]}`),s=new Function(o[0].slice(1,o[0].length-1),`return ${o[1]}`),a=new g(e,i,s,n);x[e]=a}return x[t.name]}function b(t,e,n,i){const s=e.y;let a=e.getInitialParameters(t.x,t.y);const l=function(t,e,n){return r=>{let o=0,i=0,s=0;const a=e.y,l=e.x.map((e=>t(r,e))),u=a.map(((t,e)=>t-l[e])),c=u.map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[m.CONSTANT,m.COMBINED].includes(n)?i+=c[t]:n===m.PROPORTIONAL&&(s+=c[t]/(l[t]*l[t]));i=Math.sqrt(i/c.length),s=Math.sqrt(s/c.length),n===m.COMBINED&&({sigmaA:i,sigmaB:s}=F(i,s,c,l));const f=[];for(let t=0;t<c.length;t++)f[t]=Math.pow(i+s*l[t],2),o+=c[t]/f[t]+Math.log(2*Math.PI*f[t]);return{likelihood:o,residuals:u}}}(s,t,n),u=new Float32Array(e.parameterNames.length),c=new Float32Array(e.parameterNames.length);for(let t=0;t<e.parameterNames.length;t++)u[t]=0===a[t]?-1:a[t]-Math.abs(.5*a[t]),c[t]=0===a[t]?1:a[t]+Math.abs(.5*a[t]);const f=o.BitSet.create(2*e.parameterNames.length);if(i&&0!==i.length)for(let t=0;t<i.length;t++)void 0!==i[t].min&&null!==i[t].min&&(u[t]=i[t].min,f.set(2*t,!0)),void 0!==i[t].max&&null!==i[t].max&&(c[t]=i[t].max,f.set(2*t+1,!0));const h=t=>{const e=l(t.point).residuals;let n=0,r=0;for(let t=0;t<e.length;t++)e.length/4>t?n+=Math.pow(e[t],2):3*e.length/4>t?r+=Math.pow(e[t],2):n+=Math.pow(e[t],2);return n/r};let p,y=-1,g=0,x=null,v=0;for(;;){p=d(l,u,c,{tolerance:r.TOLERANCE,maxIter:r.MAX_ITER,nonZeroParam:r.NON_ZERO_PARAM,initialScale:r.INITIAL_SCALE,scaleReflection:r.SCALE_REFLECTION,scaleExpansion:r.SCALE_EXPANSION,scaleContraction:r.SCALE_CONTRACTION},10,a),v=0;for(let t=1;t<p.extremums.length;t++)p.extremums[t].cost<p.extremums[v].cost&&(v=t);const t=h(p.extremums[v]);if(null===x?x=t:t<x?(x=t,g=0):g++,-1===y){if(x<=2)break;y++}if(y>40)break;if(3===g)break;for(let t=0;t<e.parameterNames.length;t++)f.get(2*t)||(u[t]=a[t]-Math.abs(p.extremums[v].point[t]*(g+1.5))),f.get(2*t+1)||(c[t]=a[t]+Math.abs(p.extremums[v].point[t]*(g+1.5)))}return a=p.extremums[v].point,{fittedCurve:N(s,a),parameters:a}}function N(t,e){return n=>t(e,n)}function S(t,e,n,r=.05,o){const s=function(t,e,n,r){let o=0,i=0;const s=e.y,a=e.x.map((e=>t(r,e))),l=s.map(((t,e)=>t-a[e])),u=l.map((t=>Math.pow(t,2)));for(let t=0;t<u.length;t++)[m.CONSTANT,m.COMBINED].includes(n)?o+=u[t]:n===m.PROPORTIONAL&&(i+=Math.pow(l[t]/Math.abs(a[t]),2));return o=Math.sqrt(o/u.length),i=Math.sqrt(i/u.length),n===m.COMBINED&&({sigmaA:o,sigmaB:i}=F(o,i,u,a)),{sigmaA:o,sigmaB:i}}(n,t,o,e),a=i.normal.inv(1-r/2,0,1);return{confidenceTop:t=>{const r=n(e,t);return r+a*(s.sigmaA+Math.abs(r)*s.sigmaB)},confidenceBottom:t=>{const r=n(e,t);return r-a*(s.sigmaA+Math.abs(r)*s.sigmaB)}}}function L(t,e,n,r=!0){const o=N(n,e);return{rSquared:r?D(o,t):void 0,auc:r?X(o,t):void 0,interceptX:e[2],interceptY:o(e[2]),slope:e[1],top:e[0],bottom:e[3]}}function O(t,e){const n=t[0],r=t[1],o=t[2],i=t[3];return i+(n-i)/(1+Math.pow(10,(e-o)*r))}function P(t,e){return t[0]*e+t[1]}function R(t,e){const n=t[0],r=t[1];return n*Math.log(e+1)+r}function M(t,e){const n=t[0],r=t[1];return n*Math.exp(e*r)}function X(t,e){let n=0;const r=Math.min(...e.x),o=Math.max(...e.x),i=(o-r)/1e3;for(let e=r;e<o;e+=i)n+=i*t(e);return n}function D(t,e){let n=0,r=0;const o=i.mean(e.y);for(let i=0;i<e.x.length;i++)n+=Math.pow(e.y[i]-t(e.x[i]),2),r+=Math.pow(e.y[i]-o,2);return 1-n/r}function F(t,e,n,r){let o=Number.MAX_VALUE,i=0;for(let e=0;e<=10;e++){let s=0;const a=e/10,l=t*a,u=t*(1-a),c=[];for(let t=0;t<n.length;t++)c[t]=Math.pow(l+u*r[t],2),s+=n[t]/c[t]+Math.log(2*Math.PI*c[t]);s<o&&(o=s,i=a)}return e=t*(1-i),{sigmaA:t*=i,sigmaB:e}}},999:(t,e,n)=>{"use strict";n.d(e,{Kh:()=>s,VA:()=>m,W$:()=>a,_T:()=>f,fY:()=>d,nT:()=>h,s$:()=>u,zB:()=>c});var r=n(82),o=n(71);function i(t){const e={};for(const n of t)null!==n.defaultValue&&(e[n.name]=n.defaultValue);return e}function s(){return{chartOptions:i(o.xs),seriesOptions:i(o.IL)}}function a(t){const e=[],n=[];for(let r=0;r<t.length;r++)e[r]=t[r].x,n[r]=t[r].y;return{xs:e,ys:n}}function l(t){const e=Math.floor(t.y.length/2),n=t.y.sort(((t,e)=>t-e));return n.length%2==0?(n[e-1]+n[e])/2:n[e]}function u(t){var e;const n=t.chartOptions;if((null===(e=t.series)||void 0===e?void 0:e.length)&&0!==t.series.length){const{xs:e,ys:o}=a(t.series[0].points);let i=r.Rect.fromXYArrays(e,o);for(let e=1;e<t.series.length;e++){const{xs:n,ys:o}=a(t.series[e].points);n.some((t=>void 0===t))||o.some((t=>void 0===t))||(i=i.union(r.Rect.fromXYArrays(n,o)))}return n?function(t,e){let n=t.x,o=t.y,i=t.width,s=t.height;return void 0!==e.minX&&null!==e.minX&&(!e.logX||e.logX&&e.minX>0)&&(i+=n-e.minX,n=e.minX),void 0!==e.maxX&&null!==e.maxX&&(!e.logX||e.logX&&e.maxX>0)&&(i+=e.maxX-(n+i)),void 0!==e.minY&&null!==e.minY&&(!e.logY||e.logY&&e.minY>0)&&(s+=o-e.minY,o=e.minY),void 0!==e.maxY&&null!==e.maxY&&(!e.logY||e.logY&&e.maxY>0)&&(s+=e.maxY-(o+s)),new r.Rect(n,o,i,s)}(i,n):i}return new r.Rect(0,0,1,1)}function c(t){return(0,o.TV)(t.fitFunction)}function f(t,e){var n;const r=new Float32Array(null===(n=t.parameters)||void 0===n?void 0:n.length);return r.set(t.parameters),(0,o.ah)(e.y,r)}function h(t,e,n){var r;const i={x:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logY)?Math.log10(t.y):t.y))};var s;return t.parameterBounds&&(null==n?void 0:n.logX)&&(t.parameterBounds[2]=((s=t.parameterBounds[2])&&(void 0!==s.max&&(s.max=Math.log10(s.max)),void 0!==s.min&&(s.min=0===s.min?-Number.MAX_VALUE:Math.log10(s.min))),s)),(0,o.W6)(function(t){const e={x:[],y:[]},n={x:[t.x[0]],y:[t.y[0]]};for(let r=1;r<t.x.length;r++){if(t.x[r]===n.x[0]){n.x[n.x.length]=t.x[r],n.y[n.y.length]=t.y[r];continue}const o=l(n);e.x[e.x.length]=n.x[0],e.y[e.y.length]=o,n.x=[t.x[r]],n.y=[t.y[r]]}const r=l(n);return e.x[e.x.length]=n.x[0],e.y[e.y.length]=r,e}(i),e,null!==(r=t.errorModel)&&void 0!==r?r:o.dZ.CONSTANT,t.parameterBounds)}function d(t,e,n,r){var i,s;const a=n?{x:t.points.map((t=>(null==r?void 0:r.logX)?Math.log10(t.x):t.x)),y:t.points.map((t=>(null==r?void 0:r.logY)?Math.log10(t.y):t.y))}:{x:t.points.filter((t=>!t.outlier)).map((t=>(null==r?void 0:r.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==r?void 0:r.logY)?Math.log10(t.y):t.y))};if(!t.parameters){const n=h(t,e).parameters;t.parameters=[...n]}const l=new Float32Array(null===(i=t.parameters)||void 0===i?void 0:i.length);return l.set(t.parameters),(0,o.O8)(a,l,e.y,.05,null!==(s=t.errorModel)&&void 0!==s?s:o.dZ.CONSTANT)}function m(t,e,n){var r;const i={x:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logX)?Math.log10(t.x):t.x)),y:t.points.filter((t=>!t.outlier)).map((t=>(null==n?void 0:n.logY)?Math.log10(t.y):t.y))};if(!t.parameters){const n=h(t,e).parameters;t.parameters=[...n]}const s=new Float32Array(null===(r=t.parameters)||void 0===r?void 0:r.length);return s.set(t.parameters),(0,o.mW)(i,s,e.y,!0)}},293:(t,e,n)=>{"use strict";n.d(e,{L:()=>a});var r=n(82);const o=1e-30,i=new class{screenToWorld(t,e,n,r,o){return n+(o?1-t/e:t/e)*(r-n)}worldToScreen(t,e,n,r,o){return o?(1-(t-n)/(r-n))*e:(t-n)/(r-n)*e}},s=new class{screenToWorld(t,e,n,r,i){n=n<o?o:n;const s=Math.log(r),a=Math.log(n);return Math.exp(a+(s-a)*(i?e-t:t)/e)}worldToScreen(t,e,n,r,i){if(t<=0)return NaN;if(Math.abs(t-n)<o)return i?e:0;if(Math.abs(t-r)<o)return i?0:e;n=n<o?o:n,t=t<o?o:t;const s=e*Math.log(t/n)/Math.log(r/n);return i?e-s:s}};class a{get xt(){return this.logX?s:i}get yt(){return this.logY?s:i}constructor(t,e,n=!1,r=!1){this.logX=!1,this.logY=!1,this.inverseX=!1,this.inverseY=!1,this.world=t,this.screen=e,this.logX=n,this.logY=r}xToScreen(t){return this.screen.left+this.xt.worldToScreen(t,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToScreen(t){return this.screen.top+this.yt.worldToScreen(t,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}xToWorld(t){return this.xt.screenToWorld(t-this.screen.left,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToWorld(t){return this.yt.screenToWorld(t-this.screen.top,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}toScreen(t){return new r.Point(this.xToScreen(t.x),this.yToScreen(t.y))}toWorld(t){return new r.Point(this.xToWorld(t.x),this.yToWorld(t.y))}drawCoordinateGrid(t,e,n){e&&r.Paint.horzAxis(t,this.world.minX,this.world.maxX,e.x,e.y,e.width,e.height,this.logX,this.inverseX),n&&r.Paint.vertAxis(t,this.world.minY,this.world.maxY,n.x,n.y,n.width,n.height,this.logY,this.inverseY)}}},982:function(t,e,n){var r;!function(){var e={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,r,o,i){for(var s,a,l,u,c,f,h,d,m,p,y,g,x;i>=64;){for(s=n[0],a=n[1],l=n[2],u=n[3],c=n[4],f=n[5],h=n[6],d=n[7],p=0;p<16;p++)y=o+4*p,t[p]=(255&r[y])<<24|(255&r[y+1])<<16|(255&r[y+2])<<8|255&r[y+3];for(p=16;p<64;p++)g=((m=t[p-2])>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,x=((m=t[p-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,t[p]=(g+t[p-7]|0)+(x+t[p-16]|0);for(p=0;p<64;p++)g=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&f^~c&h)|0)+(d+(e[p]+t[p]|0)|0)|0,x=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,d=h,h=f,f=c,c=u+g|0,u=l,l=a,a=s,s=g+x|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=u,n[4]+=c,n[5]+=f,n[6]+=h,n[7]+=d,o+=64,i-=64}return o}var r=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[r++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(r=n(this.temp,this.state,t,r,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[r++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,r=this.bufferLength,o=e/536870912|0,i=e<<3,s=e%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<s-8;a++)this.buffer[a]=0;this.buffer[s-8]=o>>>24&255,this.buffer[s-7]=o>>>16&255,this.buffer[s-6]=o>>>8&255,this.buffer[s-5]=o>>>0&255,this.buffer[s-4]=i>>>24&255,this.buffer[s-3]=i>>>16&255,this.buffer[s-2]=i>>>8&255,this.buffer[s-1]=i>>>0&255,n(this.temp,this.state,this.buffer,0,s),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=r;var o=function(){function t(t){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new r).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function i(t){var e=(new r).update(t),n=e.digest();return e.clean(),n}function s(t,e){var n=new o(t).update(e),r=n.digest();return n.clean(),r}function a(t,e,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");e.reset(),o>1&&e.update(t),n&&e.update(n),e.update(r),e.finish(t),r[0]++}t.HMAC=o,t.hash=i,t.default=i,t.hmac=s;var l=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,r){void 0===e&&(e=l),void 0===r&&(r=32);for(var i=new Uint8Array([1]),u=s(e,t),c=new o(u),f=new Uint8Array(c.digestLength),h=f.length,d=new Uint8Array(r),m=0;m<r;m++)h===f.length&&(a(f,c,n,i),h=0),d[m]=f[h++];return c.clean(),f.fill(0),i.fill(0),d},t.pbkdf2=function(t,e,n,r){for(var i=new o(t),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),u=new Uint8Array(s),c=new Uint8Array(r),f=0;f*s<r;f++){var h=f+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,i.reset(),i.update(e),i.update(a),i.finish(u);for(var d=0;d<s;d++)l[d]=u[d];for(d=2;d<=n;d++){i.reset(),i.update(u).finish(u);for(var m=0;m<s;m++)l[m]^=u[m]}for(d=0;d<s&&f*s+d<r;d++)c[f*s+d]=l[d]}for(f=0;f<s;f++)l[f]=u[f]=0;for(f=0;f<4;f++)a[f]=0;return i.clean(),c}}(e);var o=e.default;for(var i in e)o[i]=e[i];"object"==typeof t.exports?t.exports=o:void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},572:function(t){var e;t.exports=(e=function(t,e){var n=Array.prototype.concat,r=Array.prototype.slice,o=Object.prototype.toString;function i(e,n){var r=e>n?e:n;return t.pow(10,17-~~(t.log(r>0?r:-r)*t.LOG10E))}var s=Array.isArray||function(t){return"[object Array]"===o.call(t)};function a(t){return"[object Function]"===o.call(t)}function l(t){return"number"==typeof t&&t-t==0}function u(){return new u._init(arguments)}function c(){return 0}function f(){return 1}function h(t,e){return t===e?1:0}u.fn=u.prototype,u._init=function(t){if(s(t[0]))if(s(t[0][0])){a(t[1])&&(t[0]=u.map(t[0],t[1]));for(var e=0;e<t[0].length;e++)this[e]=t[0][e];this.length=t[0].length}else this[0]=a(t[1])?u.map(t[0],t[1]):t[0],this.length=1;else if(l(t[0]))this[0]=u.seq.apply(null,t),this.length=1;else{if(t[0]instanceof u)return u(t[0].toArray());this[0]=[],this.length=1}return this},u._init.prototype=u.prototype,u._init.constructor=u,u.utils={calcRdx:i,isArray:s,isFunction:a,isNumber:l,toVector:function(t){return n.apply([],t)}},u._random_fn=t.random,u.setRandom=function(t){if("function"!=typeof t)throw new TypeError("fn is not a function");u._random_fn=t},u.extend=function(t){var e,n;if(1===arguments.length){for(n in t)u[n]=t[n];return this}for(e=1;e<arguments.length;e++)for(n in arguments[e])t[n]=arguments[e][n];return t},u.rows=function(t){return t.length||1},u.cols=function(t){return t[0].length||1},u.dimensions=function(t){return{rows:u.rows(t),cols:u.cols(t)}},u.row=function(t,e){return s(e)?e.map((function(e){return u.row(t,e)})):t[e]},u.rowa=function(t,e){return u.row(t,e)},u.col=function(t,e){if(s(e)){var n=u.arange(t.length).map((function(){return new Array(e.length)}));return e.forEach((function(e,r){u.arange(t.length).forEach((function(o){n[o][r]=t[o][e]}))})),n}for(var r=new Array(t.length),o=0;o<t.length;o++)r[o]=[t[o][e]];return r},u.cola=function(t,e){return u.col(t,e).map((function(t){return t[0]}))},u.diag=function(t){for(var e=u.rows(t),n=new Array(e),r=0;r<e;r++)n[r]=[t[r][r]];return n},u.antidiag=function(t){for(var e=u.rows(t)-1,n=new Array(e),r=0;e>=0;e--,r++)n[r]=[t[r][e]];return n},u.transpose=function(t){var e,n,r,o,i,a=[];for(s(t[0])||(t=[t]),n=t.length,r=t[0].length,i=0;i<r;i++){for(e=new Array(n),o=0;o<n;o++)e[o]=t[o][i];a.push(e)}return 1===a.length?a[0]:a},u.map=function(t,e,n){var r,o,i,a,l;for(s(t[0])||(t=[t]),o=t.length,i=t[0].length,a=n?t:new Array(o),r=0;r<o;r++)for(a[r]||(a[r]=new Array(i)),l=0;l<i;l++)a[r][l]=e(t[r][l],r,l);return 1===a.length?a[0]:a},u.cumreduce=function(t,e,n){var r,o,i,a,l;for(s(t[0])||(t=[t]),o=t.length,i=t[0].length,a=n?t:new Array(o),r=0;r<o;r++)for(a[r]||(a[r]=new Array(i)),i>0&&(a[r][0]=t[r][0]),l=1;l<i;l++)a[r][l]=e(a[r][l-1],t[r][l]);return 1===a.length?a[0]:a},u.alter=function(t,e){return u.map(t,e,!0)},u.create=function(t,e,n){var r,o,i=new Array(t);for(a(e)&&(n=e,e=t),r=0;r<t;r++)for(i[r]=new Array(e),o=0;o<e;o++)i[r][o]=n(r,o);return i},u.zeros=function(t,e){return l(e)||(e=t),u.create(t,e,c)},u.ones=function(t,e){return l(e)||(e=t),u.create(t,e,f)},u.rand=function(t,e){return l(e)||(e=t),u.create(t,e,u._random_fn)},u.identity=function(t,e){return l(e)||(e=t),u.create(t,e,h)},u.symmetric=function(t){var e,n,r=t.length;if(t.length!==t[0].length)return!1;for(e=0;e<r;e++)for(n=0;n<r;n++)if(t[n][e]!==t[e][n])return!1;return!0},u.clear=function(t){return u.alter(t,c)},u.seq=function(t,e,n,r){a(r)||(r=!1);var o,s=[],l=i(t,e),u=(e*l-t*l)/((n-1)*l),c=t;for(o=0;c<=e&&o<n;c=(t*l+u*l*++o)/l)s.push(r?r(c,o):c);return s},u.arange=function(t,n,r){var o,i=[];if(r=r||1,n===e&&(n=t,t=0),t===n||0===r)return[];if(t<n&&r<0)return[];if(t>n&&r>0)return[];if(r>0)for(o=t;o<n;o+=r)i.push(o);else for(o=t;o>n;o+=r)i.push(o);return i},u.slice=function(){function t(t,n,r,o){var i,s=[],a=t.length;if(n===e&&r===e&&o===e)return u.copy(t);if(o=o||1,(n=(n=n||0)>=0?n:a+n)===(r=(r=r||t.length)>=0?r:a+r)||0===o)return[];if(n<r&&o<0)return[];if(n>r&&o>0)return[];if(o>0)for(i=n;i<r;i+=o)s.push(t[i]);else for(i=n;i>r;i+=o)s.push(t[i]);return s}return function(e,n){var r,o;return l((n=n||{}).row)?l(n.col)?e[n.row][n.col]:t(u.rowa(e,n.row),(r=n.col||{}).start,r.end,r.step):l(n.col)?t(u.cola(e,n.col),(o=n.row||{}).start,o.end,o.step):(o=n.row||{},r=n.col||{},t(e,o.start,o.end,o.step).map((function(e){return t(e,r.start,r.end,r.step)})))}}(),u.sliceAssign=function(n,r,o){var i,s;if(l(r.row)){if(l(r.col))return n[r.row][r.col]=o;r.col=r.col||{},r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,i=u.arange(r.col.start,t.min(n.length,r.col.end),r.col.step);var a=r.row;return i.forEach((function(t,e){n[a][t]=o[e]})),n}if(l(r.col)){r.row=r.row||{},r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,s=u.arange(r.row.start,t.min(n[0].length,r.row.end),r.row.step);var c=r.col;return s.forEach((function(t,e){n[t][c]=o[e]})),n}return o[0].length===e&&(o=[o]),r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,s=u.arange(r.row.start,t.min(n.length,r.row.end),r.row.step),i=u.arange(r.col.start,t.min(n[0].length,r.col.end),r.col.step),s.forEach((function(t,e){i.forEach((function(r,i){n[t][r]=o[e][i]}))})),n},u.diagonal=function(t){var e=u.zeros(t.length,t.length);return t.forEach((function(t,n){e[n][n]=t})),e},u.copy=function(t){return t.map((function(t){return l(t)?t:t.map((function(t){return t}))}))};var d=u.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?r.call(this):r.call(this)[0]},d.map=function(t,e){return u(u.map(this,t,e))},d.cumreduce=function(t,e){return u(u.cumreduce(this,t,e))},d.alter=function(t){return u.alter(this,t),this},function(t){for(var e=0;e<t.length;e++)!function(t){d[t]=function(e){var n,r=this;return e?(setTimeout((function(){e.call(r,d[t].call(r))})),this):(n=u[t](this),s(n)?u(n):n)}}(t[e])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){d[t]=function(e,n){var r=this;return n?(setTimeout((function(){n.call(r,d[t].call(r,e))})),this):u(u[t](this,e))}}(t[e])}("row col".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){d[t]=function(){return u(u[t].apply(null,arguments))}}(t[e])}("create zeros ones rand identity".split(" ")),u}(Math),function(t,e){var n=t.utils.isFunction;function r(t,e){return t-e}function o(t,n,r){return e.max(n,e.min(t,r))}t.sum=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n];return e},t.sumsqrd=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n]*t[n];return e},t.sumsqerr=function(e){for(var n,r=t.mean(e),o=0,i=e.length;--i>=0;)o+=(n=e[i]-r)*n;return o},t.sumrow=function(t){for(var e=0,n=t.length;--n>=0;)e+=t[n];return e},t.product=function(t){for(var e=1,n=t.length;--n>=0;)e*=t[n];return e},t.min=function(t){for(var e=t[0],n=0;++n<t.length;)t[n]<e&&(e=t[n]);return e},t.max=function(t){for(var e=t[0],n=0;++n<t.length;)t[n]>e&&(e=t[n]);return e},t.unique=function(t){for(var e={},n=[],r=0;r<t.length;r++)e[t[r]]||(e[t[r]]=!0,n.push(t[r]));return n},t.mean=function(e){return t.sum(e)/e.length},t.meansqerr=function(e){return t.sumsqerr(e)/e.length},t.geomean=function(n){var r=n.map(e.log),o=t.mean(r);return e.exp(o)},t.median=function(t){var e=t.length,n=t.slice().sort(r);return 1&e?n[e/2|0]:(n[e/2-1]+n[e/2])/2},t.cumsum=function(e){return t.cumreduce(e,(function(t,e){return t+e}))},t.cumprod=function(e){return t.cumreduce(e,(function(t,e){return t*e}))},t.diff=function(t){var e,n=[],r=t.length;for(e=1;e<r;e++)n.push(t[e]-t[e-1]);return n},t.rank=function(t){var e,n=[],o={};for(e=0;e<t.length;e++)o[l=t[e]]?o[l]++:(o[l]=1,n.push(l));var i=n.sort(r),s={},a=1;for(e=0;e<i.length;e++){var l,u=o[l=i[e]],c=(a+(a+u-1))/2;s[l]=c,a+=u}return t.map((function(t){return s[t]}))},t.mode=function(t){var e,n=t.length,o=t.slice().sort(r),i=1,s=0,a=0,l=[];for(e=0;e<n;e++)o[e]===o[e+1]?i++:(i>s?(l=[o[e]],s=i,a=0):i===s&&(l.push(o[e]),a++),i=1);return 0===a?l[0]:l},t.range=function(e){return t.max(e)-t.min(e)},t.variance=function(e,n){return t.sumsqerr(e)/(e.length-(n?1:0))},t.pooledvariance=function(e){return e.reduce((function(e,n){return e+t.sumsqerr(n)}),0)/(e.reduce((function(t,e){return t+e.length}),0)-e.length)},t.deviation=function(e){for(var n=t.mean(e),r=e.length,o=new Array(r),i=0;i<r;i++)o[i]=e[i]-n;return o},t.stdev=function(n,r){return e.sqrt(t.variance(n,r))},t.pooledstdev=function(n){return e.sqrt(t.pooledvariance(n))},t.meandev=function(n){for(var r=t.mean(n),o=[],i=n.length-1;i>=0;i--)o.push(e.abs(n[i]-r));return t.mean(o)},t.meddev=function(n){for(var r=t.median(n),o=[],i=n.length-1;i>=0;i--)o.push(e.abs(n[i]-r));return t.median(o)},t.coeffvar=function(e){return t.stdev(e)/t.mean(e)},t.quartiles=function(t){var n=t.length,o=t.slice().sort(r);return[o[e.round(n/4)-1],o[e.round(n/2)-1],o[e.round(3*n/4)-1]]},t.quantiles=function(t,n,i,s){var a,l,u,c,f,h=t.slice().sort(r),d=[n.length],m=t.length;for(void 0===i&&(i=3/8),void 0===s&&(s=3/8),a=0;a<n.length;a++)u=m*(l=n[a])+(i+l*(1-i-s)),c=e.floor(o(u,1,m-1)),f=o(u-c,0,1),d[a]=(1-f)*h[c-1]+f*h[c];return d},t.percentile=function(t,e,n){var o=t.slice().sort(r),i=e*(o.length+(n?1:-1))+(n?0:1),s=parseInt(i),a=i-s;return s+1<o.length?o[s-1]+a*(o[s]-o[s-1]):o[s-1]},t.percentileOfScore=function(t,e,n){var r,o,i=0,s=t.length,a=!1;for("strict"===n&&(a=!0),o=0;o<s;o++)r=t[o],(a&&r<e||!a&&r<=e)&&i++;return i/s},t.histogram=function(n,r){r=r||4;var o,i=t.min(n),s=(t.max(n)-i)/r,a=n.length,l=[];for(o=0;o<r;o++)l[o]=0;for(o=0;o<a;o++)l[e.min(e.floor((n[o]-i)/s),r-1)]+=1;return l},t.covariance=function(e,n){var r,o=t.mean(e),i=t.mean(n),s=e.length,a=new Array(s);for(r=0;r<s;r++)a[r]=(e[r]-o)*(n[r]-i);return t.sum(a)/(s-1)},t.corrcoeff=function(e,n){return t.covariance(e,n)/t.stdev(e,1)/t.stdev(n,1)},t.spearmancoeff=function(e,n){return e=t.rank(e),n=t.rank(n),t.corrcoeff(e,n)},t.stanMoment=function(n,r){for(var o=t.mean(n),i=t.stdev(n),s=n.length,a=0,l=0;l<s;l++)a+=e.pow((n[l]-o)/i,r);return a/n.length},t.skewness=function(e){return t.stanMoment(e,3)},t.kurtosis=function(e){return t.stanMoment(e,4)-3};var i=t.prototype;!function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(r,o){var s=[],a=0,l=this;if(n(r)&&(o=r,r=!1),o)return setTimeout((function(){o.call(l,i[e].call(l,r))})),this;if(this.length>1){for(l=!0===r?this:this.transpose();a<l.length;a++)s[a]=t[e](l[a]);return s}return t[e](this[0],r)}}(e[r])}("cumsum cumprod".split(" ")),function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(r,o){var s=[],a=0,l=this;if(n(r)&&(o=r,r=!1),o)return setTimeout((function(){o.call(l,i[e].call(l,r))})),this;if(this.length>1){for("sumrow"!==e&&(l=!0===r?this:this.transpose());a<l.length;a++)s[a]=t[e](l[a]);return!0===r?t[e](t.utils.toVector(s)):s}return t[e](this[0],r)}}(e[r])}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")),function(e){for(var r=0;r<e.length;r++)!function(e){i[e]=function(){var r,o=[],s=0,a=this,l=Array.prototype.slice.call(arguments);if(n(l[l.length-1])){r=l[l.length-1];var u=l.slice(0,l.length-1);return setTimeout((function(){r.call(a,i[e].apply(a,u))})),this}r=void 0;var c=function(n){return t[e].apply(a,[n].concat(l))};if(this.length>1){for(a=a.transpose();s<a.length;s++)o[s]=c(a[s]);return o}return c(this[0])}}(e[r])}("quantiles percentileOfScore".split(" "))}(e,Math),function(t,e){t.gammaln=function(t){var n,r,o,i=0,s=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],a=1.000000000190015;for(o=(r=n=t)+5.5,o-=(n+.5)*e.log(o);i<6;i++)a+=s[i]/++r;return e.log(2.5066282746310007*a/n)-o},t.loggam=function(t){var n,r,o,i,s,a,l,u=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(n=t,l=0,1==t||2==t)return 0;for(t<=7&&(n=t+(l=e.floor(7-t))),r=1/(n*n),o=2*e.PI,s=u[9],a=8;a>=0;a--)s*=r,s+=u[a];if(i=s/n+.5*e.log(o)+(n-.5)*e.log(n)-n,t<=7)for(a=1;a<=l;a++)i-=e.log(n-1),n-=1;return i},t.gammafn=function(t){var n,r,o,i,s=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],a=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],l=!1,u=0,c=0,f=0,h=t;if(t>171.6243769536076)return 1/0;if(h<=0){if(!(i=h%1+36e-17))return 1/0;l=(1&h?-1:1)*e.PI/e.sin(e.PI*i),h=1-h}for(o=h,r=h<1?h++:(h-=u=(0|h)-1)-1,n=0;n<8;++n)f=(f+s[n])*r,c=c*r+a[n];if(i=f/c+1,o<h)i/=o;else if(o>h)for(n=0;n<u;++n)i*=h,h++;return l&&(i=l/i),i},t.gammap=function(e,n){return t.lowRegGamma(e,n)*t.gammafn(e)},t.lowRegGamma=function(n,r){var o,i=t.gammaln(n),s=n,a=1/n,l=a,u=r+1-n,c=1/1e-30,f=1/u,h=f,d=1,m=-~(8.5*e.log(n>=1?n:1/n)+.4*n+17);if(r<0||n<=0)return NaN;if(r<n+1){for(;d<=m;d++)a+=l*=r/++s;return a*e.exp(-r+n*e.log(r)-i)}for(;d<=m;d++)h*=(f=1/(f=(o=-d*(d-n))*f+(u+=2)))*(c=u+o/c);return 1-h*e.exp(-r+n*e.log(r)-i)},t.factorialln=function(e){return e<0?NaN:t.gammaln(e+1)},t.factorial=function(e){return e<0?NaN:t.gammafn(e+1)},t.combination=function(n,r){return n>170||r>170?e.exp(t.combinationln(n,r)):t.factorial(n)/t.factorial(r)/t.factorial(n-r)},t.combinationln=function(e,n){return t.factorialln(e)-t.factorialln(n)-t.factorialln(e-n)},t.permutation=function(e,n){return t.factorial(e)/t.factorial(e-n)},t.betafn=function(n,r){if(!(n<=0||r<=0))return n+r>170?e.exp(t.betaln(n,r)):t.gammafn(n)*t.gammafn(r)/t.gammafn(n+r)},t.betaln=function(e,n){return t.gammaln(e)+t.gammaln(n)-t.gammaln(e+n)},t.betacf=function(t,n,r){var o,i,s,a,l=1e-30,u=1,c=n+r,f=n+1,h=n-1,d=1,m=1-c*t/f;for(e.abs(m)<l&&(m=l),a=m=1/m;u<=100&&(m=1+(i=u*(r-u)*t/((h+(o=2*u))*(n+o)))*m,e.abs(m)<l&&(m=l),d=1+i/d,e.abs(d)<l&&(d=l),a*=(m=1/m)*d,m=1+(i=-(n+u)*(c+u)*t/((n+o)*(f+o)))*m,e.abs(m)<l&&(m=l),d=1+i/d,e.abs(d)<l&&(d=l),a*=s=(m=1/m)*d,!(e.abs(s-1)<3e-7));u++);return a},t.gammapinv=function(n,r){var o,i,s,a,l,u,c=0,f=r-1,h=t.gammaln(r);if(n>=1)return e.max(100,r+100*e.sqrt(r));if(n<=0)return 0;for(r>1?(l=e.log(f),u=e.exp(f*(l-1)-h),a=n<.5?n:1-n,o=(2.30753+.27061*(i=e.sqrt(-2*e.log(a))))/(1+i*(.99229+.04481*i))-i,n<.5&&(o=-o),o=e.max(.001,r*e.pow(1-1/(9*r)-o/(3*e.sqrt(r)),3))):o=n<(i=1-r*(.253+.12*r))?e.pow(n/i,1/r):1-e.log(1-(n-i)/(1-i));c<12;c++){if(o<=0)return 0;if((o-=i=(s=(t.lowRegGamma(r,o)-n)/(i=r>1?u*e.exp(-(o-f)+f*(e.log(o)-l)):e.exp(-o+f*e.log(o)-h)))/(1-.5*e.min(1,s*((r-1)/o-1))))<=0&&(o=.5*(o+i)),e.abs(i)<1e-8*o)break}return o},t.erf=function(t){var n,r,o,i,s=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],a=s.length-1,l=!1,u=0,c=0;for(t<0&&(t=-t,l=!0),r=4*(n=2/(2+t))-2;a>0;a--)o=u,u=r*u-c+s[a],c=o;return i=n*e.exp(-t*t+.5*(s[0]+r*u)-c),l?i-1:1-i},t.erfc=function(e){return 1-t.erf(e)},t.erfcinv=function(n){var r,o,i,s,a=0;if(n>=2)return-100;if(n<=0)return 100;for(s=n<1?n:2-n,r=-.70711*((2.30753+.27061*(i=e.sqrt(-2*e.log(s/2))))/(1+i*(.99229+.04481*i))-i);a<2;a++)r+=(o=t.erfc(r)-s)/(1.1283791670955126*e.exp(-r*r)-r*o);return n<1?r:-r},t.ibetainv=function(n,r,o){var i,s,a,l,u,c,f,h,d,m,p=r-1,y=o-1,g=0;if(n<=0)return 0;if(n>=1)return 1;for(r>=1&&o>=1?(a=n<.5?n:1-n,c=(2.30753+.27061*(l=e.sqrt(-2*e.log(a))))/(1+l*(.99229+.04481*l))-l,n<.5&&(c=-c),f=(c*c-3)/6,h=2/(1/(2*r-1)+1/(2*o-1)),d=c*e.sqrt(f+h)/h-(1/(2*o-1)-1/(2*r-1))*(f+5/6-2/(3*h)),c=r/(r+o*e.exp(2*d))):(i=e.log(r/(r+o)),s=e.log(o/(r+o)),c=n<(l=e.exp(r*i)/r)/(d=l+(u=e.exp(o*s)/o))?e.pow(r*d*n,1/r):1-e.pow(o*d*(1-n),1/o)),m=-t.gammaln(r)-t.gammaln(o)+t.gammaln(r+o);g<10;g++){if(0===c||1===c)return c;if((c-=l=(u=(t.ibeta(c,r,o)-n)/(l=e.exp(p*e.log(c)+y*e.log(1-c)+m)))/(1-.5*e.min(1,u*(p/c-y/(1-c)))))<=0&&(c=.5*(c+l)),c>=1&&(c=.5*(c+l+1)),e.abs(l)<1e-8*c&&g>0)break}return c},t.ibeta=function(n,r,o){var i=0===n||1===n?0:e.exp(t.gammaln(r+o)-t.gammaln(r)-t.gammaln(o)+r*e.log(n)+o*e.log(1-n));return!(n<0||n>1)&&(n<(r+1)/(r+o+2)?i*t.betacf(n,r,o)/r:1-i*t.betacf(1-n,o,r)/o)},t.randn=function(n,r){var o,i,s,a,l;if(r||(r=n),n)return t.create(n,r,(function(){return t.randn()}));do{o=t._random_fn(),i=1.7156*(t._random_fn()-.5),l=(s=o-.449871)*s+(a=e.abs(i)+.386595)*(.196*a-.25472*s)}while(l>.27597&&(l>.27846||i*i>-4*e.log(o)*o*o));return i/o},t.randg=function(n,r,o){var i,s,a,l,u,c,f=n;if(o||(o=r),n||(n=1),r)return(c=t.zeros(r,o)).alter((function(){return t.randg(n)})),c;n<1&&(n+=1),i=n-1/3,s=1/e.sqrt(9*i);do{do{l=1+s*(u=t.randn())}while(l<=0);l*=l*l,a=t._random_fn()}while(a>1-.331*e.pow(u,4)&&e.log(a)>.5*u*u+i*(1-l+e.log(l)));if(n==f)return i*l;do{a=t._random_fn()}while(0===a);return e.pow(a,1/f)*i*l},function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(){return t(t.map(this,(function(n){return t[e](n)})))}}(e[n])}("gammaln gammafn factorial factorialln".split(" ")),function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(){return t(t[e].apply(null,arguments))}}(e[n])}("randn".split(" "))}(e,Math),function(t,e){function n(t,n,r,o){for(var i,s=0,a=1,l=1,u=1,c=0,f=0;e.abs((l-f)/l)>o;)f=l,a=u+(i=-(n+c)*(n+r+c)*t/(n+2*c)/(n+2*c+1))*a,l=(s=l+i*s)+(i=(c+=1)*(r-c)*t/(n+2*c-1)/(n+2*c))*l,s/=u=a+i*u,a/=u,l/=u,u=1;return l/n}function r(n,r,o){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],s=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],a=.5*n;if(a>=8)return 1;var l,u=2*t.normal.cdf(a,0,1,1,0)-1;u=u>=e.exp(-50/o)?e.pow(u,o):0;for(var c=a,f=(8-a)/(l=n>3?2:3),h=c+f,d=0,m=o-1,p=1;p<=l;p++){for(var y=0,g=.5*(h+c),x=.5*(h-c),v=1;v<=12;v++){var w,T=g+x*(6<v?i[(w=12-v+1)-1]:-i[(w=v)-1]),_=T*T;if(_>60)break;var C=2*t.normal.cdf(T,0,1,1,0)*.5-2*t.normal.cdf(T,n,1,1,0)*.5;C>=e.exp(-30/m)&&(y+=C=s[w-1]*e.exp(-.5*_)*e.pow(C,m))}d+=y*=2*x*o/e.sqrt(2*e.PI),c=h,h+=f}return(u+=d)<=e.exp(-30/r)?0:(u=e.pow(u,r))>=1?1:u}!function(e){for(var n=0;n<e.length;n++)!function(e){t[e]=function t(e,n,r){return this instanceof t?(this._a=e,this._b=n,this._c=r,this):new t(e,n,r)},t.fn[e]=function(n,r,o){var i=t[e](n,r,o);return i.data=this,i},t[e].prototype.sample=function(n){var r=this._a,o=this._b,i=this._c;return n?t.alter(n,(function(){return t[e].sample(r,o,i)})):t[e].sample(r,o,i)},function(n){for(var r=0;r<n.length;r++)!function(n){t[e].prototype[n]=function(r){var o=this._a,i=this._b,s=this._c;return r||0===r||(r=this.data),"number"!=typeof r?t.fn.map.call(r,(function(r){return t[e][n](r,o,i,s)})):t[e][n](r,o,i,s)}}(n[r])}("pdf cdf inv".split(" ")),function(n){for(var r=0;r<n.length;r++)!function(n){t[e].prototype[n]=function(){return t[e][n](this._a,this._b,this._c)}}(n[r])}("mean median mode variance".split(" "))}(e[n])}("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")),t.extend(t.beta,{pdf:function(n,r,o){return n>1||n<0?0:1==r&&1==o?1:r<512&&o<512?e.pow(n,r-1)*e.pow(1-n,o-1)/t.betafn(r,o):e.exp((r-1)*e.log(n)+(o-1)*e.log(1-n)-t.betaln(r,o))},cdf:function(e,n,r){return e>1||e<0?1*(e>1):t.ibeta(e,n,r)},inv:function(e,n,r){return t.ibetainv(e,n,r)},mean:function(t,e){return t/(t+e)},median:function(e,n){return t.ibetainv(.5,e,n)},mode:function(t,e){return(t-1)/(t+e-2)},sample:function(e,n){var r=t.randg(e);return r/(r+t.randg(n))},variance:function(t,n){return t*n/(e.pow(t+n,2)*(t+n+1))}}),t.extend(t.centralF,{pdf:function(n,r,o){var i;return n<0?0:r<=2?0===n&&r<2?1/0:0===n&&2===r?1:1/t.betafn(r/2,o/2)*e.pow(r/o,r/2)*e.pow(n,r/2-1)*e.pow(1+r/o*n,-(r+o)/2):(i=r*n/(o+n*r),r*(o/(o+n*r))/2*t.binomial.pdf((r-2)/2,(r+o-2)/2,i))},cdf:function(e,n,r){return e<0?0:t.ibeta(n*e/(n*e+r),n/2,r/2)},inv:function(e,n,r){return r/(n*(1/t.ibetainv(e,n/2,r/2)-1))},mean:function(t,e){return e>2?e/(e-2):void 0},mode:function(t,e){return t>2?e*(t-2)/(t*(e+2)):void 0},sample:function(e,n){return 2*t.randg(e/2)/e/(2*t.randg(n/2)/n)},variance:function(t,e){if(!(e<=4))return 2*e*e*(t+e-2)/(t*(e-2)*(e-2)*(e-4))}}),t.extend(t.cauchy,{pdf:function(t,n,r){return r<0?0:r/(e.pow(t-n,2)+e.pow(r,2))/e.PI},cdf:function(t,n,r){return e.atan((t-n)/r)/e.PI+.5},inv:function(t,n,r){return n+r*e.tan(e.PI*(t-.5))},median:function(t){return t},mode:function(t){return t},sample:function(n,r){return t.randn()*e.sqrt(1/(2*t.randg(.5)))*r+n}}),t.extend(t.chisquare,{pdf:function(n,r){return n<0?0:0===n&&2===r?.5:e.exp((r/2-1)*e.log(n)-n/2-r/2*e.log(2)-t.gammaln(r/2))},cdf:function(e,n){return e<0?0:t.lowRegGamma(n/2,e/2)},inv:function(e,n){return 2*t.gammapinv(e,.5*n)},mean:function(t){return t},median:function(t){return t*e.pow(1-2/(9*t),3)},mode:function(t){return t-2>0?t-2:0},sample:function(e){return 2*t.randg(e/2)},variance:function(t){return 2*t}}),t.extend(t.exponential,{pdf:function(t,n){return t<0?0:n*e.exp(-n*t)},cdf:function(t,n){return t<0?0:1-e.exp(-n*t)},inv:function(t,n){return-e.log(1-t)/n},mean:function(t){return 1/t},median:function(t){return 1/t*e.log(2)},mode:function(){return 0},sample:function(n){return-1/n*e.log(t._random_fn())},variance:function(t){return e.pow(t,-2)}}),t.extend(t.gamma,{pdf:function(n,r,o){return n<0?0:0===n&&1===r?1/o:e.exp((r-1)*e.log(n)-n/o-t.gammaln(r)-r*e.log(o))},cdf:function(e,n,r){return e<0?0:t.lowRegGamma(n,e/r)},inv:function(e,n,r){return t.gammapinv(e,n)*r},mean:function(t,e){return t*e},mode:function(t,e){if(t>1)return(t-1)*e},sample:function(e,n){return t.randg(e)*n},variance:function(t,e){return t*e*e}}),t.extend(t.invgamma,{pdf:function(n,r,o){return n<=0?0:e.exp(-(r+1)*e.log(n)-o/n-t.gammaln(r)+r*e.log(o))},cdf:function(e,n,r){return e<=0?0:1-t.lowRegGamma(n,r/e)},inv:function(e,n,r){return r/t.gammapinv(1-e,n)},mean:function(t,e){return t>1?e/(t-1):void 0},mode:function(t,e){return e/(t+1)},sample:function(e,n){return n/t.randg(e)},variance:function(t,e){if(!(t<=2))return e*e/((t-1)*(t-1)*(t-2))}}),t.extend(t.kumaraswamy,{pdf:function(t,n,r){return 0===t&&1===n?r:1===t&&1===r?n:e.exp(e.log(n)+e.log(r)+(n-1)*e.log(t)+(r-1)*e.log(1-e.pow(t,n)))},cdf:function(t,n,r){return t<0?0:t>1?1:1-e.pow(1-e.pow(t,n),r)},inv:function(t,n,r){return e.pow(1-e.pow(1-t,1/r),1/n)},mean:function(e,n){return n*t.gammafn(1+1/e)*t.gammafn(n)/t.gammafn(1+1/e+n)},median:function(t,n){return e.pow(1-e.pow(2,-1/n),1/t)},mode:function(t,n){if(t>=1&&n>=1&&1!==t&&1!==n)return e.pow((t-1)/(t*n-1),1/t)},variance:function(){throw new Error("variance not yet implemented")}}),t.extend(t.lognormal,{pdf:function(t,n,r){return t<=0?0:e.exp(-e.log(t)-.5*e.log(2*e.PI)-e.log(r)-e.pow(e.log(t)-n,2)/(2*r*r))},cdf:function(n,r,o){return n<0?0:.5+.5*t.erf((e.log(n)-r)/e.sqrt(2*o*o))},inv:function(n,r,o){return e.exp(-1.4142135623730951*o*t.erfcinv(2*n)+r)},mean:function(t,n){return e.exp(t+n*n/2)},median:function(t){return e.exp(t)},mode:function(t,n){return e.exp(t-n*n)},sample:function(n,r){return e.exp(t.randn()*r+n)},variance:function(t,n){return(e.exp(n*n)-1)*e.exp(2*t+n*n)}}),t.extend(t.noncentralt,{pdf:function(n,r,o){return e.abs(o)<1e-14?t.studentt.pdf(n,r):e.abs(n)<1e-14?e.exp(t.gammaln((r+1)/2)-o*o/2-.5*e.log(e.PI*r)-t.gammaln(r/2)):r/n*(t.noncentralt.cdf(n*e.sqrt(1+2/r),r+2,o)-t.noncentralt.cdf(n,r,o))},cdf:function(n,r,o){var i=1e-14;if(e.abs(o)<i)return t.studentt.cdf(n,r);var s=!1;n<0&&(s=!0,o=-o);for(var a=t.normal.cdf(-o,0,1),l=i+1,u=l,c=n*n/(n*n+r),f=0,h=e.exp(-o*o/2),d=e.exp(-o*o/2-.5*e.log(2)-t.gammaln(1.5))*o;f<200||u>i||l>i;)u=l,f>0&&(h*=o*o/(2*f),d*=o*o/(2*(f+.5))),a+=.5*(l=h*t.beta.cdf(c,f+.5,r/2)+d*t.beta.cdf(c,f+1,r/2)),f++;return s?1-a:a}}),t.extend(t.normal,{pdf:function(t,n,r){return e.exp(-.5*e.log(2*e.PI)-e.log(r)-e.pow(t-n,2)/(2*r*r))},cdf:function(n,r,o){return.5*(1+t.erf((n-r)/e.sqrt(2*o*o)))},inv:function(e,n,r){return-1.4142135623730951*r*t.erfcinv(2*e)+n},mean:function(t){return t},median:function(t){return t},mode:function(t){return t},sample:function(e,n){return t.randn()*n+e},variance:function(t,e){return e*e}}),t.extend(t.pareto,{pdf:function(t,n,r){return t<n?0:r*e.pow(n,r)/e.pow(t,r+1)},cdf:function(t,n,r){return t<n?0:1-e.pow(n/t,r)},inv:function(t,n,r){return n/e.pow(1-t,1/r)},mean:function(t,n){if(!(n<=1))return n*e.pow(t,n)/(n-1)},median:function(t,n){return t*(n*e.SQRT2)},mode:function(t){return t},variance:function(t,n){if(!(n<=2))return t*t*n/(e.pow(n-1,2)*(n-2))}}),t.extend(t.studentt,{pdf:function(n,r){return r=r>1e100?1e100:r,1/(e.sqrt(r)*t.betafn(.5,r/2))*e.pow(1+n*n/r,-(r+1)/2)},cdf:function(n,r){var o=r/2;return t.ibeta((n+e.sqrt(n*n+r))/(2*e.sqrt(n*n+r)),o,o)},inv:function(n,r){var o=t.ibetainv(2*e.min(n,1-n),.5*r,.5);return o=e.sqrt(r*(1-o)/o),n>.5?o:-o},mean:function(t){return t>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(n){return t.randn()*e.sqrt(n/(2*t.randg(n/2)))},variance:function(t){return t>2?t/(t-2):t>1?1/0:void 0}}),t.extend(t.weibull,{pdf:function(t,n,r){return t<0||n<0||r<0?0:r/n*e.pow(t/n,r-1)*e.exp(-e.pow(t/n,r))},cdf:function(t,n,r){return t<0?0:1-e.exp(-e.pow(t/n,r))},inv:function(t,n,r){return n*e.pow(-e.log(1-t),1/r)},mean:function(e,n){return e*t.gammafn(1+1/n)},median:function(t,n){return t*e.pow(e.log(2),1/n)},mode:function(t,n){return n<=1?0:t*e.pow((n-1)/n,1/n)},sample:function(n,r){return n*e.pow(-e.log(t._random_fn()),1/r)},variance:function(n,r){return n*n*t.gammafn(1+2/r)-e.pow(t.weibull.mean(n,r),2)}}),t.extend(t.uniform,{pdf:function(t,e,n){return t<e||t>n?0:1/(n-e)},cdf:function(t,e,n){return t<e?0:t<n?(t-e)/(n-e):1},inv:function(t,e,n){return e+t*(n-e)},mean:function(t,e){return.5*(t+e)},median:function(e,n){return t.mean(e,n)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(e,n){return e/2+n/2+(n/2-e/2)*(2*t._random_fn()-1)},variance:function(t,n){return e.pow(n-t,2)/12}}),t.extend(t.binomial,{pdf:function(n,r,o){return 0===o||1===o?r*o===n?1:0:t.combination(r,n)*e.pow(o,n)*e.pow(1-o,r-n)},cdf:function(r,o,i){var s,a=1e-10;if(r<0)return 0;if(r>=o)return 1;if(i<0||i>1||o<=0)return NaN;var l=i,u=(r=e.floor(r))+1,c=o-r,f=u+c,h=e.exp(t.gammaln(f)-t.gammaln(c)-t.gammaln(u)+u*e.log(l)+c*e.log(1-l));return s=l<(u+1)/(f+2)?h*n(l,u,c,a):1-h*n(1-l,c,u,a),e.round(1/a*(1-s))/(1/a)}}),t.extend(t.negbin,{pdf:function(n,r,o){return n===n>>>0&&(n<0?0:t.combination(n+r-1,r-1)*e.pow(1-o,n)*e.pow(o,r))},cdf:function(e,n,r){var o=0,i=0;if(e<0)return 0;for(;i<=e;i++)o+=t.negbin.pdf(i,n,r);return o}}),t.extend(t.hypgeom,{pdf:function(n,r,o,i){if(n!=n|0)return!1;if(n<0||n<o-(r-i))return 0;if(n>i||n>o)return 0;if(2*o>r)return 2*i>r?t.hypgeom.pdf(r-o-i+n,r,r-o,r-i):t.hypgeom.pdf(i-n,r,r-o,i);if(2*i>r)return t.hypgeom.pdf(o-n,r,o,r-i);if(o<i)return t.hypgeom.pdf(n,r,i,o);for(var s=1,a=0,l=0;l<n;l++){for(;s>1&&a<i;)s*=1-o/(r-a),a++;s*=(i-l)*(o-l)/((l+1)*(r-o-i+l+1))}for(;a<i;a++)s*=1-o/(r-a);return e.min(1,e.max(0,s))},cdf:function(n,r,o,i){if(n<0||n<o-(r-i))return 0;if(n>=i||n>=o)return 1;if(2*o>r)return 2*i>r?t.hypgeom.cdf(r-o-i+n,r,r-o,r-i):1-t.hypgeom.cdf(i-n-1,r,r-o,i);if(2*i>r)return 1-t.hypgeom.cdf(o-n-1,r,o,r-i);if(o<i)return t.hypgeom.cdf(n,r,i,o);for(var s=1,a=1,l=0,u=0;u<n;u++){for(;s>1&&l<i;){var c=1-o/(r-l);a*=c,s*=c,l++}s+=a*=(i-u)*(o-u)/((u+1)*(r-o-i+u+1))}for(;l<i;l++)s*=1-o/(r-l);return e.min(1,e.max(0,s))}}),t.extend(t.poisson,{pdf:function(n,r){return r<0||n%1!=0||n<0?0:e.pow(r,n)*e.exp(-r)/t.factorial(n)},cdf:function(e,n){var r=[],o=0;if(e<0)return 0;for(;o<=e;o++)r.push(t.poisson.pdf(o,n));return t.sum(r)},mean:function(t){return t},variance:function(t){return t},sampleSmall:function(n){var r=1,o=0,i=e.exp(-n);do{o++,r*=t._random_fn()}while(r>i);return o-1},sampleLarge:function(n){var r,o,i,s,a,l,u,c,f,h,d=n;for(s=e.sqrt(d),a=e.log(d),l=.02483*(u=.931+2.53*s)-.059,c=1.1239+1.1328/(u-3.4),f=.9277-3.6224/(u-2);;){if(o=e.random()-.5,i=e.random(),h=.5-e.abs(o),r=e.floor((2*l/h+u)*o+d+.43),h>=.07&&i<=f)return r;if(!(r<0||h<.013&&i>h)&&e.log(i)+e.log(c)-e.log(l/(h*h)+u)<=r*a-d-t.loggam(r+1))return r}},sample:function(t){return t<10?this.sampleSmall(t):this.sampleLarge(t)}}),t.extend(t.triangular,{pdf:function(t,e,n,r){return n<=e||r<e||r>n?NaN:t<e||t>n?0:t<r?2*(t-e)/((n-e)*(r-e)):t===r?2/(n-e):2*(n-t)/((n-e)*(n-r))},cdf:function(t,n,r,o){return r<=n||o<n||o>r?NaN:t<=n?0:t>=r?1:t<=o?e.pow(t-n,2)/((r-n)*(o-n)):1-e.pow(r-t,2)/((r-n)*(r-o))},inv:function(t,n,r,o){return r<=n||o<n||o>r?NaN:t<=(o-n)/(r-n)?n+(r-n)*e.sqrt(t*((o-n)/(r-n))):n+(r-n)*(1-e.sqrt((1-t)*(1-(o-n)/(r-n))))},mean:function(t,e,n){return(t+e+n)/3},median:function(t,n,r){return r<=(t+n)/2?n-e.sqrt((n-t)*(n-r))/e.sqrt(2):r>(t+n)/2?t+e.sqrt((n-t)*(r-t))/e.sqrt(2):void 0},mode:function(t,e,n){return n},sample:function(n,r,o){var i=t._random_fn();return i<(o-n)/(r-n)?n+e.sqrt(i*(r-n)*(o-n)):r-e.sqrt((1-i)*(r-n)*(r-o))},variance:function(t,e,n){return(t*t+e*e+n*n-t*e-t*n-e*n)/18}}),t.extend(t.arcsine,{pdf:function(t,n,r){return r<=n?NaN:t<=n||t>=r?0:2/e.PI*e.pow(e.pow(r-n,2)-e.pow(2*t-n-r,2),-.5)},cdf:function(t,n,r){return t<n?0:t<r?2/e.PI*e.asin(e.sqrt((t-n)/(r-n))):1},inv:function(t,n,r){return n+(.5-.5*e.cos(e.PI*t))*(r-n)},mean:function(t,e){return e<=t?NaN:(t+e)/2},median:function(t,e){return e<=t?NaN:(t+e)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(n,r){return(n+r)/2+(r-n)/2*e.sin(2*e.PI*t.uniform.sample(0,1))},variance:function(t,n){return n<=t?NaN:e.pow(n-t,2)/8}}),t.extend(t.laplace,{pdf:function(t,n,r){return r<=0?0:e.exp(-e.abs(t-n)/r)/(2*r)},cdf:function(t,n,r){return r<=0?0:t<n?.5*e.exp((t-n)/r):1-.5*e.exp(-(t-n)/r)},mean:function(t){return t},median:function(t){return t},mode:function(t){return t},variance:function(t,e){return 2*e*e},sample:function(n,r){var o,i=t._random_fn()-.5;return n-r*((o=i)/e.abs(o))*e.log(1-2*e.abs(i))}}),t.extend(t.tukey,{cdf:function(n,o,i){var s=o,a=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],l=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(n<=0)return 0;if(i<2||s<2)return NaN;if(!Number.isFinite(n))return 1;if(i>25e3)return r(n,1,s);var u,c=.5*i,f=c*e.log(i)-i*e.log(2)-t.gammaln(c),h=c-1,d=.25*i;u=i<=100?1:i<=800?.5:i<=5e3?.25:.125,f+=e.log(u);for(var m=0,p=1;p<=50;p++){for(var y=0,g=(2*p-1)*u,x=1;x<=16;x++){var v,w;8<x?(v=x-8-1,w=f+h*e.log(g+a[v]*u)-(a[v]*u+g)*d):(v=x-1,w=f+h*e.log(g-a[v]*u)+(a[v]*u-g)*d),w>=-30&&(y+=r(8<x?n*e.sqrt(.5*(a[v]*u+g)):n*e.sqrt(.5*(-a[v]*u+g)),1,s)*l[v]*e.exp(w))}if(p*u>=1&&y<=1e-14)break;m+=y}if(y>1e-14)throw new Error("tukey.cdf failed to converge");return m>1&&(m=1),m},inv:function(n,r,o){if(o<2||r<2)return NaN;if(n<0||n>1)return NaN;if(0===n)return 0;if(1===n)return 1/0;var i,s=function(t,n,r){var o=.5-.5*t,i=e.sqrt(e.log(1/(o*o))),s=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);r<120&&(s+=(s*s*s+s)/r/4);var a=.8832-.2368*s;return r<120&&(a+=-1.214/r+1.208*s/r),s*(a*e.log(n-1)+1.4142)}(n,r,o),a=t.tukey.cdf(s,r,o)-n;i=a>0?e.max(0,s-1):s+1;for(var l,u=t.tukey.cdf(i,r,o)-n,c=1;c<50;c++)if(l=i-u*(i-s)/(u-a),a=u,s=i,l<0&&(l=0,u=-n),u=t.tukey.cdf(l,r,o)-n,i=l,e.abs(i-s)<1e-4)return l;throw new Error("tukey.inv failed to converge")}})}(e,Math),function(t,e){var n,r,o=Array.prototype.push,i=t.utils.isArray;function s(e){return i(e)||e instanceof t}t.extend({add:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.map(e,(function(t,e,r){return t+n[e][r]}))):t.map(e,(function(t){return t+n}))},subtract:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.map(e,(function(t,e,r){return t-n[e][r]||0}))):t.map(e,(function(t){return t-n}))},divide:function(e,n){return s(n)?(s(n[0])||(n=[n]),t.multiply(e,t.inv(n))):t.map(e,(function(t){return t/n}))},multiply:function(e,n){var r,o,i,a,l,u,c,f;if(void 0===e.length&&void 0===n.length)return e*n;if(l=e.length,u=e[0].length,c=t.zeros(l,i=s(n)?n[0].length:u),f=0,s(n)){for(;f<i;f++)for(r=0;r<l;r++){for(a=0,o=0;o<u;o++)a+=e[r][o]*n[o][f];c[r][f]=a}return 1===l&&1===f?c[0][0]:c}return t.map(e,(function(t){return t*n}))},outer:function(e,n){return t.multiply(e.map((function(t){return[t]})),[n])},dot:function(e,n){s(e[0])||(e=[e]),s(n[0])||(n=[n]);for(var r,o,i=1===e[0].length&&1!==e.length?t.transpose(e):e,a=1===n[0].length&&1!==n.length?t.transpose(n):n,l=[],u=0,c=i.length,f=i[0].length;u<c;u++){for(l[u]=[],r=0,o=0;o<f;o++)r+=i[u][o]*a[u][o];l[u]=r}return 1===l.length?l[0]:l},pow:function(n,r){return t.map(n,(function(t){return e.pow(t,r)}))},exp:function(n){return t.map(n,(function(t){return e.exp(t)}))},log:function(n){return t.map(n,(function(t){return e.log(t)}))},abs:function(n){return t.map(n,(function(t){return e.abs(t)}))},norm:function(t,n){var r=0,o=0;for(isNaN(n)&&(n=2),s(t[0])&&(t=t[0]);o<t.length;o++)r+=e.pow(e.abs(t[o]),n);return e.pow(r,1/n)},angle:function(n,r){return e.acos(t.dot(n,r)/(t.norm(n)*t.norm(r)))},aug:function(t,e){var n,r=[];for(n=0;n<t.length;n++)r.push(t[n].slice());for(n=0;n<r.length;n++)o.apply(r[n],e[n]);return r},inv:function(e){for(var n,r=e.length,o=e[0].length,i=t.identity(r,o),s=t.gauss_jordan(e,i),a=[],l=0;l<r;l++)for(a[l]=[],n=o;n<s[0].length;n++)a[l][n-o]=s[l][n];return a},det:function t(e){if(2===e.length)return e[0][0]*e[1][1]-e[0][1]*e[1][0];for(var n=0,r=0;r<e.length;r++){for(var o=[],i=1;i<e.length;i++){o[i-1]=[];for(var s=0;s<e.length;s++)s<r?o[i-1][s]=e[i][s]:s>r&&(o[i-1][s-1]=e[i][s])}var a=r%2?-1:1;n+=t(o)*e[0][r]*a}return n},gauss_elimination:function(n,r){var o,i,s,a,l=0,u=0,c=n.length,f=n[0].length,h=1,d=0,m=[];for(o=(n=t.aug(n,r))[0].length,l=0;l<c;l++){for(i=n[l][l],u=l,a=l+1;a<f;a++)i<e.abs(n[a][l])&&(i=n[a][l],u=a);if(u!=l)for(a=0;a<o;a++)s=n[l][a],n[l][a]=n[u][a],n[u][a]=s;for(u=l+1;u<c;u++)for(h=n[u][l]/n[l][l],a=l;a<o;a++)n[u][a]=n[u][a]-h*n[l][a]}for(l=c-1;l>=0;l--){for(d=0,u=l+1;u<=c-1;u++)d+=m[u]*n[l][u];m[l]=(n[l][o-1]-d)/n[l][l]}return m},gauss_jordan:function(n,r){var o,i,s,a=t.aug(n,r),l=a.length,u=a[0].length,c=0;for(i=0;i<l;i++){var f=i;for(s=i+1;s<l;s++)e.abs(a[s][i])>e.abs(a[f][i])&&(f=s);var h=a[i];for(a[i]=a[f],a[f]=h,s=i+1;s<l;s++)for(c=a[s][i]/a[i][i],o=i;o<u;o++)a[s][o]-=a[i][o]*c}for(i=l-1;i>=0;i--){for(c=a[i][i],s=0;s<i;s++)for(o=u-1;o>i-1;o--)a[s][o]-=a[i][o]*a[s][i]/c;for(a[i][i]/=c,o=l;o<u;o++)a[i][o]/=c}return a},triaUpSolve:function(e,n){var r,o=e[0].length,i=t.zeros(1,o)[0],s=!1;return null!=n[0].length&&(n=n.map((function(t){return t[0]})),s=!0),t.arange(o-1,-1,-1).forEach((function(s){r=t.arange(s+1,o).map((function(t){return i[t]*e[s][t]})),i[s]=(n[s]-t.sum(r))/e[s][s]})),s?i.map((function(t){return[t]})):i},triaLowSolve:function(e,n){var r,o=e[0].length,i=t.zeros(1,o)[0],s=!1;return null!=n[0].length&&(n=n.map((function(t){return t[0]})),s=!0),t.arange(o).forEach((function(o){r=t.arange(o).map((function(t){return e[o][t]*i[t]})),i[o]=(n[o]-t.sum(r))/e[o][o]})),s?i.map((function(t){return[t]})):i},lu:function(e){var n,r=e.length,o=t.identity(r),i=t.zeros(e.length,e[0].length);return t.arange(r).forEach((function(t){i[0][t]=e[0][t]})),t.arange(1,r).forEach((function(s){t.arange(s).forEach((function(r){n=t.arange(r).map((function(t){return o[s][t]*i[t][r]})),o[s][r]=(e[s][r]-t.sum(n))/i[r][r]})),t.arange(s,r).forEach((function(r){n=t.arange(s).map((function(t){return o[s][t]*i[t][r]})),i[s][r]=e[n.length][r]-t.sum(n)}))})),[o,i]},cholesky:function(n){var r,o=n.length,i=t.zeros(n.length,n[0].length);return t.arange(o).forEach((function(s){r=t.arange(s).map((function(t){return e.pow(i[s][t],2)})),i[s][s]=e.sqrt(n[s][s]-t.sum(r)),t.arange(s+1,o).forEach((function(e){r=t.arange(s).map((function(t){return i[s][t]*i[e][t]})),i[e][s]=(n[s][e]-t.sum(r))/i[s][s]}))})),i},gauss_jacobi:function(n,r,o,i){for(var s,a,l,u,c=0,f=0,h=n.length,d=[],m=[],p=[];c<h;c++)for(d[c]=[],m[c]=[],p[c]=[],f=0;f<h;f++)c>f?(d[c][f]=n[c][f],m[c][f]=p[c][f]=0):c<f?(m[c][f]=n[c][f],d[c][f]=p[c][f]=0):(p[c][f]=n[c][f],d[c][f]=m[c][f]=0);for(l=t.multiply(t.multiply(t.inv(p),t.add(d,m)),-1),a=t.multiply(t.inv(p),r),s=o,u=t.add(t.multiply(l,o),a),c=2;e.abs(t.norm(t.subtract(u,s)))>i;)s=u,u=t.add(t.multiply(l,s),a),c++;return u},gauss_seidel:function(n,r,o,i){for(var s,a,l,u,c,f=0,h=n.length,d=[],m=[],p=[];f<h;f++)for(d[f]=[],m[f]=[],p[f]=[],s=0;s<h;s++)f>s?(d[f][s]=n[f][s],m[f][s]=p[f][s]=0):f<s?(m[f][s]=n[f][s],d[f][s]=p[f][s]=0):(p[f][s]=n[f][s],d[f][s]=m[f][s]=0);for(u=t.multiply(t.multiply(t.inv(t.add(p,d)),m),-1),l=t.multiply(t.inv(t.add(p,d)),r),a=o,c=t.add(t.multiply(u,o),l),f=2;e.abs(t.norm(t.subtract(c,a)))>i;)a=c,c=t.add(t.multiply(u,a),l),f+=1;return c},SOR:function(n,r,o,i,s){for(var a,l,u,c,f,h=0,d=n.length,m=[],p=[],y=[];h<d;h++)for(m[h]=[],p[h]=[],y[h]=[],a=0;a<d;a++)h>a?(m[h][a]=n[h][a],p[h][a]=y[h][a]=0):h<a?(p[h][a]=n[h][a],m[h][a]=y[h][a]=0):(y[h][a]=n[h][a],m[h][a]=p[h][a]=0);for(c=t.multiply(t.inv(t.add(y,t.multiply(m,s))),t.subtract(t.multiply(y,1-s),t.multiply(p,s))),u=t.multiply(t.multiply(t.inv(t.add(y,t.multiply(m,s))),r),s),l=o,f=t.add(t.multiply(c,o),u),h=2;e.abs(t.norm(t.subtract(f,l)))>i;)l=f,f=t.add(t.multiply(c,l),u),h++;return f},householder:function(n){for(var r,o,i,s,a=n.length,l=n[0].length,u=0,c=[],f=[];u<a-1;u++){for(r=0,s=u+1;s<l;s++)r+=n[s][u]*n[s][u];for(r=(n[u+1][u]>0?-1:1)*e.sqrt(r),o=e.sqrt((r*r-n[u+1][u]*r)/2),(c=t.zeros(a,1))[u+1][0]=(n[u+1][u]-r)/(2*o),i=u+2;i<a;i++)c[i][0]=n[i][u]/(2*o);f=t.subtract(t.identity(a,l),t.multiply(t.multiply(c,t.transpose(c)),2)),n=t.multiply(f,t.multiply(n,f))}return n},QR:(n=t.sum,r=t.arange,function(o){var i,s,a,l=o.length,u=o[0].length,c=t.zeros(u,u);for(o=t.copy(o),s=0;s<u;s++){for(c[s][s]=e.sqrt(n(r(l).map((function(t){return o[t][s]*o[t][s]})))),i=0;i<l;i++)o[i][s]=o[i][s]/c[s][s];for(a=s+1;a<u;a++)for(c[s][a]=n(r(l).map((function(t){return o[t][s]*o[t][a]}))),i=0;i<l;i++)o[i][a]=o[i][a]-o[i][s]*c[s][a]}return[o,c]}),lstsq:function(e,n){var r=!1;void 0===n[0].length&&(n=n.map((function(t){return[t]})),r=!0);var o=t.QR(e),i=o[0],s=o[1],a=e[0].length,l=t.slice(i,{col:{end:a}}),u=function(e){var n=(e=t.copy(e)).length,r=t.identity(n);return t.arange(n-1,-1,-1).forEach((function(n){t.sliceAssign(r,{row:n},t.divide(t.slice(r,{row:n}),e[n][n])),t.sliceAssign(e,{row:n},t.divide(t.slice(e,{row:n}),e[n][n])),t.arange(n).forEach((function(o){var i=t.multiply(e[o][n],-1),s=t.slice(e,{row:o}),a=t.multiply(t.slice(e,{row:n}),i);t.sliceAssign(e,{row:o},t.add(s,a));var l=t.slice(r,{row:o}),u=t.multiply(t.slice(r,{row:n}),i);t.sliceAssign(r,{row:o},t.add(l,u))}))})),r}(t.slice(s,{row:{end:a}})),c=t.transpose(l);void 0===c[0].length&&(c=[c]);var f=t.multiply(t.multiply(u,c),n);return void 0===f.length&&(f=[[f]]),r?f.map((function(t){return t[0]})):f},jacobi:function(n){for(var r,o,i,s,a,l,u,c=1,f=n.length,h=t.identity(f,f),d=[];1===c;){for(a=n[0][1],i=0,s=1,r=0;r<f;r++)for(o=0;o<f;o++)r!=o&&a<e.abs(n[r][o])&&(a=e.abs(n[r][o]),i=r,s=o);for(l=n[i][i]===n[s][s]?n[i][s]>0?e.PI/4:-e.PI/4:e.atan(2*n[i][s]/(n[i][i]-n[s][s]))/2,(u=t.identity(f,f))[i][i]=e.cos(l),u[i][s]=-e.sin(l),u[s][i]=e.sin(l),u[s][s]=e.cos(l),h=t.multiply(h,u),n=t.multiply(t.multiply(t.inv(u),n),u),c=0,r=1;r<f;r++)for(o=1;o<f;o++)r!=o&&e.abs(n[r][o])>.001&&(c=1)}for(r=0;r<f;r++)d.push(n[r][r]);return[h,d]},rungekutta:function(t,e,n,r,o,i){var s,a,l;if(2===i)for(;r<=n;)o+=((s=e*t(r,o))+(a=e*t(r+e,o+s)))/2,r+=e;if(4===i)for(;r<=n;)o+=((s=e*t(r,o))+2*(a=e*t(r+e/2,o+s/2))+2*(l=e*t(r+e/2,o+a/2))+e*t(r+e,o+l))/6,r+=e;return o},romberg:function(t,n,r,o){for(var i,s,a,l,u,c=0,f=(r-n)/2,h=[],d=[],m=[];c<o/2;){for(u=t(n),a=n,l=0;a<=r;a+=f,l++)h[l]=a;for(i=h.length,a=1;a<i-1;a++)u+=(a%2!=0?4:2)*t(h[a]);u=f/3*(u+t(r)),m[c]=u,f/=2,c++}for(s=m.length,i=1;1!==s;){for(a=0;a<s-1;a++)d[a]=(e.pow(4,i)*m[a+1]-m[a])/(e.pow(4,i)-1);s=d.length,m=d,d=[],i++}return m},richardson:function(t,n,r,o){function i(t,e){for(var n,r=0,o=t.length;r<o;r++)t[r]===e&&(n=r);return n}for(var s,a,l,u,c,f=e.abs(r-t[i(t,r)+1]),h=0,d=[],m=[];o>=f;)s=i(t,r+o),a=i(t,r),d[h]=(n[s]-2*n[a]+n[2*a-s])/(o*o),o/=2,h++;for(u=d.length,l=1;1!=u;){for(c=0;c<u-1;c++)m[c]=(e.pow(4,l)*d[c+1]-d[c])/(e.pow(4,l)-1);u=m.length,d=m,m=[],l++}return d},simpson:function(t,e,n,r){for(var o,i=(n-e)/r,s=t(e),a=[],l=e,u=0,c=1;l<=n;l+=i,u++)a[u]=l;for(o=a.length;c<o-1;c++)s+=(c%2!=0?4:2)*t(a[c]);return i/3*(s+t(n))},hermite:function(t,e,n,r){for(var o,i=t.length,s=0,a=0,l=[],u=[],c=[],f=[];a<i;a++){for(l[a]=1,o=0;o<i;o++)a!=o&&(l[a]*=(r-t[o])/(t[a]-t[o]));for(u[a]=0,o=0;o<i;o++)a!=o&&(u[a]+=1/(t[a]-t[o]));c[a]=(1-2*(r-t[a])*u[a])*(l[a]*l[a]),f[a]=(r-t[a])*(l[a]*l[a]),s+=c[a]*e[a]+f[a]*n[a]}return s},lagrange:function(t,e,n){for(var r,o,i=0,s=0,a=t.length;s<a;s++){for(o=e[s],r=0;r<a;r++)s!=r&&(o*=(n-t[r])/(t[s]-t[r]));i+=o}return i},cubic_spline:function(e,n,r){for(var o,i,s=e.length,a=0,l=[],u=[],c=[],f=[],h=[],d=[];a<s-1;a++)f[a]=e[a+1]-e[a];for(c[0]=0,a=1;a<s-1;a++)c[a]=3/f[a]*(n[a+1]-n[a])-3/f[a-1]*(n[a]-n[a-1]);for(a=1;a<s-1;a++)l[a]=[],u[a]=[],l[a][a-1]=f[a-1],l[a][a]=2*(f[a-1]+f[a]),l[a][a+1]=f[a],u[a][0]=c[a];for(i=t.multiply(t.inv(l),u),o=0;o<s-1;o++)h[o]=(n[o+1]-n[o])/f[o]-f[o]*(i[o+1][0]+2*i[o][0])/3,d[o]=(i[o+1][0]-i[o][0])/(3*f[o]);for(o=0;o<s&&!(e[o]>r);o++);return n[o-=1]+(r-e[o])*h[o]+t.sq(r-e[o])*i[o]+(r-e[o])*t.sq(r-e[o])*d[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(e){var n,r,o,i,s,a=e.length,l=e[0].length,u=0,c=[],f=[],h=[],d=[],m=[],p=[],y=[];for(u=0;u<a;u++)c[u]=t.sum(e[u])/l;for(u=0;u<l;u++)for(m[u]=[],n=0;n<a;n++)m[u][n]=e[n][u]-c[n];for(m=t.transpose(m),u=0;u<a;u++)for(p[u]=[],n=0;n<a;n++)p[u][n]=t.dot([m[u]],[m[n]])/(l-1);for(s=(o=t.jacobi(p))[0],f=o[1],y=t.transpose(s),u=0;u<f.length;u++)for(n=u;n<f.length;n++)f[u]<f[n]&&(r=f[u],f[u]=f[n],f[n]=r,h=y[u],y[u]=y[n],y[n]=h);for(i=t.transpose(m),u=0;u<a;u++)for(d[u]=[],n=0;n<i.length;n++)d[u][n]=t.dot([y[u]],[i[n]]);return[e,f,y,d]}}),function(e){for(var n=0;n<e.length;n++)!function(e){t.fn[e]=function(n,r){var o=this;return r?(setTimeout((function(){r.call(o,t.fn[e].call(o,n))}),15),this):"number"==typeof t[e](this,n)?t[e](this,n):t(t[e](this,n))}}(e[n])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(e,Math),function(t,e){var n=[].slice,r=t.utils.isNumber,o=t.utils.isArray;function i(t,n,r,o){if(t>1||r>1||t<=0||r<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(t*n+r*o)/(n+o);return(t-r)/e.sqrt(i*(1-i)*(1/n+1/o))}t.extend({zscore:function(){var e=n.call(arguments);return r(e[1])?(e[0]-e[1])/e[2]:(e[0]-t.mean(e[1]))/t.stdev(e[1],e[2])},ztest:function(){var r,i=n.call(arguments);return o(i[1])?(r=t.zscore(i[0],i[1],i[3]),1===i[2]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1)):i.length>2?(r=t.zscore(i[0],i[1],i[2]),1===i[3]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1)):(r=i[0],1===i[1]?t.normal.cdf(-e.abs(r),0,1):2*t.normal.cdf(-e.abs(r),0,1))}}),t.extend(t.fn,{zscore:function(t,e){return(t-this.mean())/this.stdev(e)},ztest:function(n,r,o){var i=e.abs(this.zscore(n,o));return 1===r?t.normal.cdf(-i,0,1):2*t.normal.cdf(-i,0,1)}}),t.extend({tscore:function(){var r=n.call(arguments);return 4===r.length?(r[0]-r[1])/(r[2]/e.sqrt(r[3])):(r[0]-t.mean(r[1]))/(t.stdev(r[1],!0)/e.sqrt(r[1].length))},ttest:function(){var o,i=n.call(arguments);return 5===i.length?(o=e.abs(t.tscore(i[0],i[1],i[2],i[3])),1===i[4]?t.studentt.cdf(-o,i[3]-1):2*t.studentt.cdf(-o,i[3]-1)):r(i[1])?(o=e.abs(i[0]),1==i[2]?t.studentt.cdf(-o,i[1]-1):2*t.studentt.cdf(-o,i[1]-1)):(o=e.abs(t.tscore(i[0],i[1])),1==i[2]?t.studentt.cdf(-o,i[1].length-1):2*t.studentt.cdf(-o,i[1].length-1))}}),t.extend(t.fn,{tscore:function(t){return(t-this.mean())/(this.stdev(!0)/e.sqrt(this.cols()))},ttest:function(n,r){return 1===r?1-t.studentt.cdf(e.abs(this.tscore(n)),this.cols()-1):2*t.studentt.cdf(-e.abs(this.tscore(n)),this.cols()-1)}}),t.extend({anovafscore:function(){var r,o,i,s,a,l,u,c,f=n.call(arguments);if(1===f.length){for(a=new Array(f[0].length),u=0;u<f[0].length;u++)a[u]=f[0][u];f=a}for(o=new Array,u=0;u<f.length;u++)o=o.concat(f[u]);for(i=t.mean(o),r=0,u=0;u<f.length;u++)r+=f[u].length*e.pow(t.mean(f[u])-i,2);for(r/=f.length-1,l=0,u=0;u<f.length;u++)for(s=t.mean(f[u]),c=0;c<f[u].length;c++)l+=e.pow(f[u][c]-s,2);return r/(l/(o.length-f.length))},anovaftest:function(){var e,o,i,s,a=n.call(arguments);if(r(a[0]))return 1-t.centralF.cdf(a[0],a[1],a[2]);var l=t.anovafscore(a);for(e=a.length-1,i=0,s=0;s<a.length;s++)i+=a[s].length;return o=i-e-1,1-t.centralF.cdf(l,e,o)},ftest:function(e,n,r){return 1-t.centralF.cdf(e,n,r)}}),t.extend(t.fn,{anovafscore:function(){return t.anovafscore(this.toArray())},anovaftes:function(){var e,n=0;for(e=0;e<this.length;e++)n+=this[e].length;return t.ftest(this.anovafscore(),this.length-1,n-this.length)}}),t.extend({qscore:function(){var o,i,s,a,l,u=n.call(arguments);return r(u[0])?(o=u[0],i=u[1],s=u[2],a=u[3],l=u[4]):(o=t.mean(u[0]),i=t.mean(u[1]),s=u[0].length,a=u[1].length,l=u[2]),e.abs(o-i)/(l*e.sqrt((1/s+1/a)/2))},qtest:function(){var e,r=n.call(arguments);3===r.length?(e=r[0],r=r.slice(1)):7===r.length?(e=t.qscore(r[0],r[1],r[2],r[3],r[4]),r=r.slice(5)):(e=t.qscore(r[0],r[1],r[2]),r=r.slice(3));var o=r[0],i=r[1];return 1-t.tukey.cdf(e,i,o-i)},tukeyhsd:function(e){for(var n=t.pooledstdev(e),r=e.map((function(e){return t.mean(e)})),o=e.reduce((function(t,e){return t+e.length}),0),i=[],s=0;s<e.length;++s)for(var a=s+1;a<e.length;++a){var l=t.qtest(r[s],r[a],e[s].length,e[a].length,n,o,e.length);i.push([[s,a],l])}return i}}),t.extend({normalci:function(){var r,o=n.call(arguments),i=new Array(2);return r=4===o.length?e.abs(t.normal.inv(o[1]/2,0,1)*o[2]/e.sqrt(o[3])):e.abs(t.normal.inv(o[1]/2,0,1)*t.stdev(o[2])/e.sqrt(o[2].length)),i[0]=o[0]-r,i[1]=o[0]+r,i},tci:function(){var r,o=n.call(arguments),i=new Array(2);return r=4===o.length?e.abs(t.studentt.inv(o[1]/2,o[3]-1)*o[2]/e.sqrt(o[3])):e.abs(t.studentt.inv(o[1]/2,o[2].length-1)*t.stdev(o[2],!0)/e.sqrt(o[2].length)),i[0]=o[0]-r,i[1]=o[0]+r,i},significant:function(t,e){return t<e}}),t.extend(t.fn,{normalci:function(e,n){return t.normalci(e,n,this.toArray())},tci:function(e,n){return t.tci(e,n,this.toArray())}}),t.extend(t.fn,{oneSidedDifferenceOfProportions:function(e,n,r,o){var s=i(e,n,r,o);return t.ztest(s,1)},twoSidedDifferenceOfProportions:function(e,n,r,o){var s=i(e,n,r,o);return t.ztest(s,2)}})}(e,Math),e.models=function(){function t(t,n){var r=t.length,o=n[0].length-1,i=r-o-1,s=e.lstsq(n,t),a=e.multiply(n,s.map((function(t){return[t]}))).map((function(t){return t[0]})),l=e.subtract(t,a),u=e.mean(t),c=e.sum(a.map((function(t){return Math.pow(t-u,2)}))),f=e.sum(t.map((function(t,e){return Math.pow(t-a[e],2)}))),h=c+f;return{exog:n,endog:t,nobs:r,df_model:o,df_resid:i,coef:s,predict:a,resid:l,ybar:u,SST:h,SSE:c,SSR:f,R2:c/h}}function n(n){var r,o,i=(r=n.exog,o=r[0].length,e.arange(o).map((function(n){var i=e.arange(o).filter((function(t){return t!==n}));return t(e.col(r,n).map((function(t){return t[0]})),e.col(r,i))}))),s=Math.sqrt(n.SSR/n.df_resid),a=i.map((function(t){var e=t.SST,n=t.R2;return s/Math.sqrt(e*(1-n))})),l=n.coef.map((function(t,e){return(t-0)/a[e]})),u=l.map((function(t){var r=e.studentt.cdf(t,n.df_resid);return 2*(r>.5?1-r:r)})),c=e.studentt.inv(.975,n.df_resid),f=n.coef.map((function(t,e){var n=c*a[e];return[t-n,t+n]}));return{se:a,t:l,p:u,sigmaHat:s,interval95:f}}return{ols:function(r,o){var i=t(r,o),s=n(i),a=function(t){var n,r,o,i=t.R2/t.df_model/((1-t.R2)/t.df_resid);return{F_statistic:i,pvalue:1-(n=i,r=t.df_model,o=t.df_resid,e.beta.cdf(n/(o/r+n),r/2,o/2))}}(i),l=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=s,i.f=a,i.adjust_R2=l,i}}}(),e.extend({buildxmatrix:function(){for(var t=new Array(arguments.length),n=0;n<arguments.length;n++)t[n]=[1].concat(arguments[n]);return e(t)},builddxmatrix:function(){for(var t=new Array(arguments[0].length),n=0;n<arguments[0].length;n++)t[n]=[1].concat(arguments[0][n]);return e(t)},buildjxmatrix:function(t){for(var n=new Array(t.length),r=0;r<t.length;r++)n[r]=t[r];return e.builddxmatrix(n)},buildymatrix:function(t){return e(t).transpose()},buildjymatrix:function(t){return t.transpose()},matrixmult:function(t,n){var r,o,i,s,a;if(t.cols()==n.rows()){if(n.rows()>1){for(s=[],r=0;r<t.rows();r++)for(s[r]=[],o=0;o<n.cols();o++){for(a=0,i=0;i<t.cols();i++)a+=t.toArray()[r][i]*n.toArray()[i][o];s[r][o]=a}return e(s)}for(s=[],r=0;r<t.rows();r++)for(s[r]=[],o=0;o<n.cols();o++){for(a=0,i=0;i<t.cols();i++)a+=t.toArray()[r][i]*n.toArray()[o];s[r][o]=a}return e(s)}},regress:function(t,n){var r=e.xtranspxinv(t),o=t.transpose(),i=e.matrixmult(e(r),o);return e.matrixmult(i,n)},regresst:function(t,n,r){var o=e.regress(t,n),i={anova:{}},s=e.jMatYBar(t,o);i.yBar=s;var a=n.mean();i.anova.residuals=e.residuals(n,s),i.anova.ssr=e.ssr(s,a),i.anova.msr=i.anova.ssr/(t[0].length-1),i.anova.sse=e.sse(n,s),i.anova.mse=i.anova.sse/(n.length-(t[0].length-1)-1),i.anova.sst=e.sst(n,a),i.anova.mst=i.anova.sst/(n.length-1),i.anova.r2=1-i.anova.sse/i.anova.sst,i.anova.r2<0&&(i.anova.r2=0),i.anova.fratio=i.anova.msr/i.anova.mse,i.anova.pvalue=e.anovaftest(i.anova.fratio,t[0].length-1,n.length-(t[0].length-1)-1),i.anova.rmse=Math.sqrt(i.anova.mse),i.anova.r2adj=1-i.anova.mse/i.anova.mst,i.anova.r2adj<0&&(i.anova.r2adj=0),i.stats=new Array(t[0].length);for(var l,u,c,f=e.xtranspxinv(t),h=0;h<o.length;h++)l=Math.sqrt(i.anova.mse*Math.abs(f[h][h])),u=Math.abs(o[h]/l),c=e.ttest(u,n.length-t[0].length-1,r),i.stats[h]=[o[h],l,u,c];return i.regress=o,i},xtranspx:function(t){return e.matrixmult(t.transpose(),t)},xtranspxinv:function(t){var n=e.matrixmult(t.transpose(),t);return e.inv(n)},jMatYBar:function(t,n){var r=e.matrixmult(t,n);return new e(r)},residuals:function(t,n){return e.matrixsubtract(t,n)},ssr:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e,2);return n},sse:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e[r],2);return n},sst:function(t,e){for(var n=0,r=0;r<t.length;r++)n+=Math.pow(t[r]-e,2);return n},matrixsubtract:function(t,n){for(var r=new Array(t.length),o=0;o<t.length;o++){r[o]=new Array(t[o].length);for(var i=0;i<t[o].length;i++)r[o][i]=t[o][i]-n[o][i]}return e(r)}}),e.jStat=e,e)},391:(t,e,n)=>{var r=n(180),o=n(181),i=n(31),s=n(67),a=n(833),l=n(717),u=n(801);u.alea=r,u.xor128=o,u.xorwow=i,u.xorshift7=s,u.xor4096=a,u.tychei=l,t.exports=u},180:function(t,e,n){var r;!function(t,o){function i(t){var e,n=this,r=(e=4022871197,function(t){t=String(t);for(var n=0;n<t.length;n++){var r=.02519603282416938*(e+=t.charCodeAt(n));r-=e=r>>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(t),n.s0<0&&(n.s0+=1),n.s1-=r(t),n.s1<0&&(n.s1+=1),n.s2-=r(t),n.s2<0&&(n.s2+=1),r=null}function s(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function a(t,e){var n=new i(t),r=e&&e.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+11102230246251565e-32*(2097152*o()|0)},o.quick=o,r&&("object"==typeof r&&s(r,n),o.state=function(){return s(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(e,n,e,o))||(o.exports=r):this.alea=a}(0,t=n.nmd(t),n.amdD)},717:function(t,e,n){var r;!function(t,o){function i(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,o=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^o,e.a=o-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r<n.length+20;r++)e.b^=0|n.charCodeAt(r),e.next()}function s(t,e){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e}function a(t,e){var n=new i(t),r=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&s(r,n),o.state=function(){return s(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(e,n,e,o))||(o.exports=r):this.tychei=a}(0,t=n.nmd(t),n.amdD)},181:function(t,e,n){var r;!function(t,o){function i(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),e.next()}function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e}function a(t,e){var n=new i(t),r=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&s(r,n),o.state=function(){return s(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(e,n,e,o))||(o.exports=r):this.xor128=a}(0,t=n.nmd(t),n.amdD)},833:function(t,e,n){var r;!function(t,o){function i(t){var e=this;e.next=function(){var t,n,r=e.w,o=e.X,i=e.i;return e.w=r=r+1640531527|0,n=o[i+34&127],t=o[i=i+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=o[i]=n^t,e.i=i,n+(r^r>>>16)|0},function(t,e){var n,r,o,i,s,a=[],l=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,l=Math.max(l,e.length)),o=0,i=-32;i<l;++i)e&&(r^=e.charCodeAt((i+32)%e.length)),0===i&&(s=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,i>=0&&(s=s+1640531527|0,o=0==(n=a[127&i]^=r+s)?o+1:0);for(o>=128&&(a[127&(e&&e.length||0)]=-1),o=127,i=512;i>0;--i)r=a[o+34&127],n=a[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,a[o]=r^n;t.w=s,t.X=a,t.i=o}(e,t)}function s(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function a(t,e){null==t&&(t=+new Date);var n=new i(t),r=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,r&&(r.X&&s(r,n),o.state=function(){return s(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(e,n,e,o))||(o.exports=r):this.xor4096=a}(0,t=n.nmd(t),n.amdD)},67:function(t,e,n){var r;!function(t,o){function i(t){var e=this;e.next=function(){var t,n,r=e.x,o=e.i;return t=r[o],n=(t^=t>>>7)^t<<24,n^=(t=r[o+1&7])^t>>>10,n^=(t=r[o+3&7])^t>>>3,n^=(t=r[o+4&7])^t<<7,t=r[o+7&7],n^=(t^=t<<13)^t<<9,r[o]=n,e.i=o+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n<e.length;++n)r[7&n]=r[7&n]<<15^e.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],t.x=r,t.i=0,n=256;n>0;--n)t.next()}(e,t)}function s(t,e){return e.x=t.x.slice(),e.i=t.i,e}function a(t,e){null==t&&(t=+new Date);var n=new i(t),r=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,r&&(r.x&&s(r,n),o.state=function(){return s(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(e,n,e,o))||(o.exports=r):this.xorshift7=a}(0,t=n.nmd(t),n.amdD)},31:function(t,e,n){var r;!function(t,o){function i(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r<n.length+64;r++)e.x^=0|n.charCodeAt(r),r==n.length&&(e.d=e.x<<10^e.x>>>4),e.next()}function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function a(t,e){var n=new i(t),r=e&&e.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&s(r,n),o.state=function(){return s(n,{})}),o}o&&o.exports?o.exports=a:n.amdD&&n.amdO?void 0===(r=function(){return a}.call(e,n,e,o))||(o.exports=r):this.xorwow=a}(0,t=n.nmd(t),n.amdD)},801:function(t,e,n){var r;!function(o,i,s){var a,l=256,u=s.pow(l,6),c=s.pow(2,52),f=2*c,h=l-1;function d(t,e,n){var r=[],h=g(y((e=1==e?{entropy:!0}:e||{}).entropy?[t,x(i)]:null==t?function(){try{var t;return a&&(t=a.randomBytes)?t=t(l):(t=new Uint8Array(l),(o.crypto||o.msCrypto).getRandomValues(t)),x(t)}catch(t){var e=o.navigator,n=e&&e.plugins;return[+new Date,o,n,o.screen,x(i)]}}():t,3),r),d=new m(r),v=function(){for(var t=d.g(6),e=u,n=0;t<c;)t=(t+n)*l,e*=l,n=d.g(1);for(;t>=f;)t/=2,e/=2,n>>>=1;return(t+n)/e};return v.int32=function(){return 0|d.g(4)},v.quick=function(){return d.g(4)/4294967296},v.double=v,g(x(d.S),i),(e.pass||n||function(t,e,n,r){return r&&(r.S&&p(r,d),t.state=function(){return p(d,{})}),n?(s.random=t,e):t})(v,h,"global"in e?e.global:this==s,e.state)}function m(t){var e,n=t.length,r=this,o=0,i=r.i=r.j=0,s=r.S=[];for(n||(t=[n++]);o<l;)s[o]=o++;for(o=0;o<l;o++)s[o]=s[i=h&i+t[o%n]+(e=s[o])],s[i]=e;(r.g=function(t){for(var e,n=0,o=r.i,i=r.j,s=r.S;t--;)e=s[o=h&o+1],n=n*l+s[h&(s[o]=s[i=h&i+e])+(s[i]=e)];return r.i=o,r.j=i,n})(l)}function p(t,e){return e.i=t.i,e.j=t.j,e.S=t.S.slice(),e}function y(t,e){var n,r=[],o=typeof t;if(e&&"object"==o)for(n in t)try{r.push(y(t[n],e-1))}catch(t){}return r.length?r:"string"==o?t:t+"\0"}function g(t,e){for(var n,r=t+"",o=0;o<r.length;)e[h&o]=h&(n^=19*e[h&o])+r.charCodeAt(o++);return x(e)}function x(t){return String.fromCharCode.apply(0,t)}if(g(s.random(),i),t.exports){t.exports=d;try{a=n(234)}catch(t){}}else void 0===(r=function(){return d}.call(e,n,e,t))||(t.exports=r)}("undefined"!=typeof self?self:this,[],Math)},326:(t,e,n)=>{"use strict";n.d(e,{D:()=>s});var r=n(82),o=n(389),i=n(755);class s extends r.JsViewer{constructor(t){super(),this.canvas=o.canvas(),this.gridCellStyle=r.GridCellStyle.create(),this.renderer=t,this.root.append(this.canvas),this.canvas.style.width="100%",this.canvas.style.height="100%",o.tools.handleResize(this.canvas,((t,e)=>{this.canvas.width=t,this.canvas.height=e,this.render()}));const e=t=>e=>{this.gridCell&&t(this.gridCell,e)};this.canvas.onmousemove=e(this.renderer.onMouseMove),this.canvas.onmouseenter=e(this.renderer.onMouseEnter),this.canvas.onmouseleave=e(this.renderer.onMouseLeave)}static fromGridCell(t){const e=new s(new i.lR);return e.gridCell=t,e.render(),e}render(){if(!this.gridCell)return;const t=this.canvas.getContext("2d");t.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderer.renderInternal(t,0,0,this.canvas.width,this.canvas.height,this.gridCell.dart,this.gridCellStyle)}}},95:(t,e,n)=>{"use strict";n.d(e,{h:()=>r});class r{}r.TAG_FIT_CHART_FORMAT=".fitChartFormat",r.TAG_FIT_CHART_FORMAT_3DX="3dx",r.FIT_SEM_TYPE="fit",r.FIT_CELL_TYPE="fit",r.TAG_FIT=".fit",r.CELL_DEFAULT_WIDTH=230,r.CELL_DEFAULT_HEIGHT=160,r.MIN_CELL_RENDERER_PX_WIDTH=20,r.MIN_CELL_RENDERER_PX_HEIGHT=10,r.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH=70,r.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT=45,r.MIN_AXES_CELL_PX_WIDTH=100,r.MIN_AXES_CELL_PX_HEIGHT=55,r.MIN_TITLE_PX_WIDTH=275,r.MIN_TITLE_PX_HEIGHT=225,r.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH=180,r.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT=140,r.MIN_LEGEND_PX_WIDTH=325,r.MIN_LEGEND_PX_HEIGHT=275,r.MIN_DROPLINES_VISIBILITY_PX_WIDTH=120,r.MIN_DROPLINES_VISIBILITY_PX_HEIGHT=110,r.AXES_LEFT_PX_MARGIN=38,r.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS=45,r.AXES_TOP_PX_MARGIN=5,r.AXES_TOP_PX_MARGIN_WITH_TITLE=25,r.AXES_RIGHT_PX_MARGIN=18,r.AXES_BOTTOM_PX_MARGIN=15,r.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS=30,r.X_AXIS_LABEL_BOTTOM_PX_MARGIN=4,r.LEGEND_TOP_PX_MARGIN=10,r.OUTLIER_PX_SIZE=12,r.POINT_PX_SIZE=4,r.OUTLIER_HITBOX_RADIUS=2,r.CANDLESTICK_BORDER_PX_SIZE=4,r.CANDLESTICK_MEDIAN_PX_SIZE=3.5,r.CANDLESTICK_OUTLIER_PX_SIZE=6,r.INFLATE_SIZE=-6,r.LEGEND_RECORD_PX_HEIGHT=18,r.LEGEND_RECORD_LINE_PX_WIDTH=20,r.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN=5,r.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN=4,r.LINE_STYLES={solid:[],dotted:[1,1],dashed:[5,5],dashdotted:[5,5,2,5]},r.CURVE_CONFIDENCE_INTERVAL_BOUNDS={TOP:"top",BOTTOM:"bottom"},r.CONFIDENCE_INTERVAL_STROKE_COLOR="rgba(255,191,63,0.4)",r.CONFIDENCE_INTERVAL_FILL_COLOR="rgba(255,238,204,0.3)",r.CONDITION_MAP={"No series to show":t=>void 0===t||0===(null==t?void 0:t.length),"There were series with no points":t=>t.some((t=>{var e;return 0===(null===(e=t.points)||void 0===e?void 0:e.length)})),"There were series with all x zeroes":t=>t.some((t=>{var e;return null===(e=t.points)||void 0===e?void 0:e.every((t=>0===t.x))})),"There were series with all y zeroes":t=>t.some((t=>{var e;return null===(e=t.points)||void 0===e?void 0:e.every((t=>0===t.y))}))}},471:(t,e,n)=>{"use strict";n.d(e,{kL:()=>u,nO:()=>c});var r=n(82),o=(n(328),n(860),n(71)),i=n(991),s=n.n(i),a=n(95);function l(t,e){return Math.random()*(e-t)+t}function u(t,e,n=1){const r=new Float32Array(t*n),i=new Float32Array(t*n),s=[l(1,2),l(1,2),l(1,2),l(-5,5)],a=0-Math.floor(t/2)*e,u=a+e*(t-1);for(let t=a,l=0;t<=u;t+=e,l++)for(let e=0;e<n;e++){r[l*n+e]=t-a+.1;const u=new Float32Array(4);u.set(s),i[l*n+e]=(0,o.ry)(u,t)}const c=(1===n?.2:.4)*(Math.max(...i)-Math.min(...i)),f=Math.min(...i);for(let t=0;t<r.length;t++)i[t]=-f+i[t]+l(0,c);return{x:r,y:i,params:s}}function c(t,e,n){var o;const i=r.DataFrame.create(t);for(let l=0;l<e;l++){const e=3===l?5:1,c=i.columns.addNewString(`json chart ${l}`);c.semType=a.h.FIT_SEM_TYPE;let f=l%2==0?n:1;for(let i=0;i<t;i++){const t={series:[],chartOptions:{showStatistics:1===f?["auc"]:[],xAxisName:"Conc.",yAxisName:"Activity",title:"Dose-Response curves"}};for(let i=0;i<f;i++){const a=u(15,.5,e);let c=r.Color.toHtml(r.Color.getCategoricalColor(l*n+i));null===(o=t.series)||void 0===o||o.push({parameters:void 0,fitLineColor:c,pointColor:c,showCurveConfidenceInterval:1===f,points:s().count().take(15*e).map((function(t){return{x:a.x[t],y:a.y[t]}})).toArray()})}c.set(i,JSON.stringify(t))}}return i}},48:(t,e,n)=>{"use strict";n.d(e,{JR:()=>l,VK:()=>a});var r,o=n(82),i=(n(389),n(999));n(71),n(755),n(326),n(283),n(95),function(t){t.DATAFRAME="Dataframe",t.COLUMN="Column",t.CELL="Cell"}(r||(r={}));const s={count:"totalCount",nulls:"missingValueCount",unique:"uniqueCount",values:"valueCount",min:"min",max:"max",sum:"sum",avg:"avg",stdev:"stdev",variance:"variance",skew:"skew",kurt:"kurt",med:"med",q1:"q1",q2:"q2",q3:"q3"};function a(t,e){const n=(0,i.zB)(t);if(t.parameters)e.logX&&t.parameters[2]>0&&(t.parameters[2]=Math.log10(t.parameters[2]));else{const r=(0,i.nT)(t,n,e).parameters;t.parameters=[...r]}return(0,i.VA)(t,n,e)}function l(t,e){var n,r,i;const l={logX:null===(n=t.chartOptions)||void 0===n?void 0:n.logX,logY:null===(r=t.chartOptions)||void 0===r?void 0:r.logY},u=[],c=[],f=[],h=[],d=[],m=[],p=[];for(let e=0,n=0;e<(null===(i=t.series)||void 0===i?void 0:i.length);e++){if(t.series[e].points.every((t=>t.outlier)))continue;const r=a(t.series[e],l);u[n]=r.rSquared,c[n]=r.auc,f[n]=r.interceptX,h[n]=r.interceptY,d[n]=r.slope,m[n]=r.top,p[n]=r.bottom,n++}return{rSquared:u.some((t=>null==t))?void 0:o.Stats.fromValues(u)[s[e]],auc:c.some((t=>null==t))?void 0:o.Stats.fromValues(c)[s[e]],interceptX:f.some((t=>null==t))?void 0:o.Stats.fromValues(f)[s[e]],interceptY:h.some((t=>null==t))?void 0:o.Stats.fromValues(h)[s[e]],slope:d.some((t=>null==t))?void 0:o.Stats.fromValues(d)[s[e]],top:m.some((t=>null==t))?void 0:o.Stats.fromValues(m)[s[e]],bottom:p.some((t=>null==t))?void 0:o.Stats.fromValues(p)[s[e]]}}o.ObjectHandler},283:(t,e,n)=>{"use strict";n.d(e,{K:()=>u});var r=n(82),o=n(71);const i={x:"xAxis",y:"yAxis"},s={min:"min",max:"max"};function a(t){var e,n,i;const s=null===(n=null===(e=t.getElementsByTagName("params")[0])||void 0===e?void 0:e.childNodes[0].nodeValue)||void 0===n?void 0:n.split(",").map(Number);let a=null===(i=t.getElementsByTagName("function")[0])||void 0===i?void 0:i.getAttribute("type");a=a&&"sigif"!==a?a:o.G7;const l=t.getElementsByTagName("settings")[0].getAttribute("markerColor"),u=t.getElementsByTagName("settings")[0].getAttribute("color"),c=!!t.getElementsByTagName("settings")[0].getAttribute("drawLine"),f={name:t.getAttribute("name"),fitFunction:a,markerType:r.MARKER_TYPE.CIRCLE,pointColor:l,fitLineColor:u,showFitLine:c,showPoints:"points",showCurveConfidenceInterval:!1,clickToToggle:!1};return s&&(f.parameters=[s[2],s[1],s[0],s[3]]),f}function l(t){const e=function(t){var e,n,r;const o=null===(e=t.getElementsByTagName("x")[0].childNodes[0].nodeValue)||void 0===e?void 0:e.split(","),i=null===(n=t.getElementsByTagName("y")[0].childNodes[0].nodeValue)||void 0===n?void 0:n.split(","),s=null===(r=t.getElementsByTagName("mask")[0].childNodes[0].nodeValue)||void 0===r?void 0:r.split(""),a=[];for(let t=0;t<o.length;t++)a[t]={x:+o[t],y:+i[t],outlier:!Boolean(s[t])};return a}(t),n=a(t),r={points:e};return Object.assign(r,n),r}function u(t){const e=(new DOMParser).parseFromString(t,"text/xml"),n=e.getElementsByTagName("grid")[0],r=(u=e.getElementsByTagName("settings")[0],{minX:+(o=n).getElementsByTagName(i.x)[0].getAttribute(s.min),minY:+o.getElementsByTagName(i.y)[0].getAttribute(s.min),maxX:+o.getElementsByTagName(i.x)[0].getAttribute(s.max),maxY:+o.getElementsByTagName(i.y)[0].getAttribute(s.max),xAxisName:u.getAttribute("xLabel"),yAxisName:u.getAttribute("yLabel"),logX:!!u.getAttribute("logX")});var o,u;const c=e.getElementsByTagName("seriesCollection")[0],f=a(c.getElementsByTagName("series")[0]),h=function(t){const e=[],n=t.getElementsByTagName("series").length;for(let r=0;r<n;r++){const n=t.getElementsByTagName("series")[r];e[r]=l(n)}return e}(c);return{chartOptions:r,seriesOptions:f,series:h}}},755:(t,e,n)=>{"use strict";n.d(e,{lR:()=>G,j$:()=>M,bc:()=>D,Ig:()=>X,Yc:()=>k,Tv:()=>F,LX:()=>P,g2:()=>O,wU:()=>R,B3:()=>B});var r=n(82),o=n(328),i=n(389),s=n(71),a=n(293),l=n(999),u=n(283),c=n(326),f=n(48),h=n(95),d=n(368);const m=window,p=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});class y{static getUniqueName(t,e,n){return m.grok_Utils_GetUniqueName(t,e,null==n?void 0:n.auto,null==n?void 0:n.idx,null==n?void 0:n.render,null==n?void 0:n.choices)}static isEmpty(t){return null==t||""==t}static formatNumber(t){return p.format(t)}}function g(t,e){const n=t.pointColor&&r.Color.fromHtml(t.pointColor)?t.pointColor:r.Color.toHtml(r.Color.getCategoricalColor(e)),o=t.outlierColor&&r.Color.fromHtml(t.outlierColor)?t.outlierColor:r.Color.toHtml(r.Color.red),i=t.fitLineColor&&r.Color.fromHtml(t.fitLineColor)?t.fitLineColor:r.Color.toHtml(r.Color.getCategoricalColor(e));t.pointColor=n,t.outlierColor=o,t.fitLineColor=i}function x(t,e,n){var r;if(null!==(r=e.connectDots)&&void 0!==r&&r){t.strokeStyle=e.pointColor,t.lineWidth=2*n.ratio,t.beginPath();for(let r=0;r<e.points.length;r++){const o=e.points[r].x,i=e.points[r].y,s=n.viewport.xToScreen(o),a=n.viewport.yToScreen(i);0===r?t.moveTo(s,a):t.lineTo(s,a)}t.stroke()}}function v(t,e,n){var o;(null===(o=e.showPoints)||void 0===o||o)&&(t.strokeStyle=e.pointColor,e.connectDots&&""!==e.showPoints||"points"===e.showPoints?function(t,e,n){for(let o=0;o<e.points.length;o++){const i=e.points[o],s=e.connectDots?e.pointColor:i.outlier?i.outlierColor&&r.Color.fromHtml(i.outlierColor)?i.outlierColor:e.outlierColor:i.color&&r.Color.fromHtml(i.color)?i.color:e.pointColor,a=i.marker?i.marker:e.markerType,l=i.outlierMarker?i.outlierMarker:e.outlierMarkerType,u=e.connectDots?h.h.POINT_PX_SIZE*n.ratio:i.outlier?h.h.OUTLIER_PX_SIZE*n.ratio:i.size?i.size:h.h.POINT_PX_SIZE*n.ratio;r.Paint.marker(t,e.connectDots?a:i.outlier?l:a,n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y),s,u),i.stdev&&!i.outlier&&(t.strokeStyle=s,t.beginPath(),t.moveTo(n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y+i.stdev)),t.lineTo(n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y-i.stdev)),t.stroke())}}(t,e,n):["candlesticks","both"].includes(e.showPoints)&&function(t,e,n){for(let o=0,i=null;o<e.points.length;o++){const s=e.points[o];if(s.outlier)continue;const a=o+1<e.points.length&&e.points[o+1].x===s.x;if(!i&&a)i=o;else if(null!==i&&!a){const a=[];for(let t=i,n=0;t<=o;t++,n++)a[n]=e.points[t].y;const l=(0,d.k)(a);if(t.beginPath(),w(t,{viewport:n.viewport,ratio:n.ratio,x:s.x,boxPlotStats:l,color:e.pointColor}),t.stroke(),"both"===e.showPoints)for(let o=0;o<a.length;o++)(a[o]<l.lowerAdjacentValue||a[o]>l.upperAdjacentValue)&&r.Paint.marker(t,r.MARKER_TYPE.OUTLIER,n.viewport.xToScreen(s.x),n.viewport.yToScreen(a[o]),e.pointColor,h.h.CANDLESTICK_OUTLIER_PX_SIZE*n.ratio);i=null}}}(t,e,n))}function w(t,e){T(t,e.x,e.boxPlotStats.lowerAdjacentValue,e.viewport),t.moveTo(e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.lowerAdjacentValue)),t.lineTo(e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.upperAdjacentValue)),T(t,e.x,e.boxPlotStats.upperAdjacentValue,e.viewport),r.Paint.marker(t,r.MARKER_TYPE.CIRCLE,e.viewport.xToScreen(e.x),e.viewport.yToScreen(e.boxPlotStats.q2),e.color,h.h.CANDLESTICK_MEDIAN_PX_SIZE*e.ratio)}function T(t,e,n,r){t.moveTo(r.xToScreen(e)-h.h.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n)),t.lineTo(r.xToScreen(e)+h.h.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n))}function _(t,e,n){var r;if(null===(r=e.showFitLine)||void 0===r||r){t.save(),t.strokeStyle=e.fitLineColor,t.lineWidth=2*n.ratio,t.beginPath(),e.lineStyle&&t.setLineDash(h.h.LINE_STYLES[e.lineStyle]);const r=n.showAxes?n.showAxesLabels?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN:0,o=n.showAxes?h.h.AXES_RIGHT_PX_MARGIN:0;for(let e=r;e<=n.screenBounds.width-o;e++){const o=n.screenBounds.x+e,i=n.logOptions.logX?Math.log10(n.viewport.xToWorld(o)):n.viewport.xToWorld(o),s=n.logOptions.logY?n.viewport.yToScreen(Math.pow(10,n.curveFunc(i))):n.viewport.yToScreen(n.curveFunc(i));e===r?t.moveTo(o,s):t.lineTo(o,s)}t.stroke(),t.restore()}}function C(t,e,n){var r,o,i,s;if((null===(r=e.showFitLine)||void 0===r||r)&&null!==(o=e.showCurveConfidenceInterval)&&void 0!==o&&o){t.strokeStyle=null!==(i=e.confidenceIntervalColor)&&void 0!==i?i:h.h.CONFIDENCE_INTERVAL_STROKE_COLOR,t.fillStyle=null!==(s=e.confidenceIntervalColor)&&void 0!==s?s:h.h.CONFIDENCE_INTERVAL_FILL_COLOR;const r=(0,l.fY)(e,n.fitFunc,n.userParamsFlag,n.logOptions);E(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:h.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP}),E(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:h.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.BOTTOM}),function(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?h.h.AXES_RIGHT_PX_MARGIN:0;for(let o=n;o<=e.screenBounds.width-r;o++){const r=e.screenBounds.x+o,i=e.logOptions.logX?Math.log10(e.viewport.xToWorld(r)):e.viewport.xToWorld(r),s=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,e.confidenceIntervals.confidenceTop(i))):e.viewport.yToScreen(e.confidenceIntervals.confidenceTop(i));o===n?t.moveTo(r,s):t.lineTo(r,s)}for(let o=e.screenBounds.width-r;o>=n;o--){const n=e.screenBounds.x+o,r=e.logOptions.logX?Math.log10(e.viewport.xToWorld(n)):e.viewport.xToWorld(n),i=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,e.confidenceIntervals.confidenceBottom(r))):e.viewport.yToScreen(e.confidenceIntervals.confidenceBottom(r));t.lineTo(n,i)}t.closePath(),t.fill()}(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r})}}function E(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?h.h.AXES_RIGHT_PX_MARGIN:0,o=e.confidenceType===h.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP?e.confidenceIntervals.confidenceTop:e.confidenceIntervals.confidenceBottom;for(let i=n;i<=e.screenBounds.width-r;i++){const r=e.screenBounds.x+i,s=e.logOptions.logX?Math.log10(e.viewport.xToWorld(r)):e.viewport.xToWorld(r),a=e.logOptions.logY?e.viewport.yToScreen(Math.pow(10,o(s))):e.viewport.yToScreen(o(s));i===n?t.moveTo(r,a):t.lineTo(r,a)}t.stroke()}function I(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&e.droplines&&n.showDroplines){t.save(),t.strokeStyle="blue",t.lineWidth=n.ratio,t.beginPath(),t.setLineDash([5,5]);for(let r=0;r<e.droplines.length;r++)"IC50"===e.droplines[r]&&A(t,{viewport:n.viewport,xValue:e.parameters[2],dataBounds:n.dataBounds,curveFunc:n.curveFunc,logOptions:n.logOptions});t.stroke(),t.restore()}}function A(t,e){e.logOptions.logX&&(e.xValue=Math.pow(10,e.xValue));const n=e.logOptions.logX?Math.log10(e.xValue):e.xValue,r=e.logOptions.logY?Math.pow(10,e.curveFunc(n)):e.curveFunc(n);t.moveTo(e.viewport.xToScreen(e.dataBounds.minX),e.viewport.yToScreen(r)),t.lineTo(e.viewport.xToScreen(e.xValue),e.viewport.yToScreen(r)),t.lineTo(e.viewport.xToScreen(e.xValue),e.viewport.yToScreen(e.dataBounds.minY))}function b(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&n.statistics){const r=(0,l.VA)(e,n.fitFunc,n.logOptions);for(let o=0;o<n.statistics.length;o++){const i=n.statistics[o],a=s.nK.find((t=>t.name===i));if(a){const i=y.formatNumber(a.get(r));t.fillStyle=e.fitLineColor,t.textAlign="left",t.fillText(a.name+": "+i,n.dataBox.x+5,n.dataBox.y+20+20*o)}}}}function N(t,e,n){t.beginPath(),t.fillStyle="black";const r=t.measureText(e).width;t.fillText(e,n.dataBox.maxX-r,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN+(n.columnIdx*h.h.LEGEND_RECORD_PX_HEIGHT+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend))}function S(t,e,n){t.beginPath(),t.strokeStyle=e.fitLineColor,t.lineWidth=2*n.ratio;const o=t.measureText(e.name).width;t.moveTo(n.dataBox.maxX-o-h.h.LEGEND_RECORD_LINE_PX_WIDTH-h.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN-h.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.lineTo(n.dataBox.maxX-o-h.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN-h.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend);const i=e.markerType?e.markerType:r.MARKER_TYPE.CIRCLE;r.Paint.marker(t,i,n.dataBox.maxX-o-h.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN-h.h.LEGEND_RECORD_LINE_PX_WIDTH/2,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN-h.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend,e.pointColor,h.h.POINT_PX_SIZE*n.ratio),t.fillStyle=e.fitLineColor,t.fillText(e.name,n.dataBox.maxX-o,n.dataBox.y+h.h.LEGEND_TOP_PX_MARGIN+(n.showColumnLabel?h.h.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+h.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.stroke()}function L(t,e){var n;r.Paint.marker(t,r.MARKER_TYPE.OUTLIER,e.midX,e.midY,r.Color.red,(n=.8*Math.min(e.width,e.height),Math.min(Math.max(n,0),30)))}function O(t,e,n){if(e&&n)for(const r of t)!(r.name in n)&&r.name in e&&(n[r.name]=e[r.name])}function P(t){if(0===t.length)return{};let e,n,r,o=Number.MAX_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,a=Number.MIN_VALUE,l=!1,u=!1,c=!1;for(const f of t)null!==f.minX&&void 0!==f.minX&&(o=Math.min(o,f.minX)),null!==f.minY&&void 0!==f.minY&&(i=Math.min(i,f.minY)),null!==f.maxX&&void 0!==f.maxX&&(s=Math.max(s,f.maxX)),null!==f.maxY&&void 0!==f.maxY&&(a=Math.max(a,f.maxY)),null!==f.title&&void 0!==f.title&&(null!=r||(r=f.title)),null!==f.xAxisName&&void 0!==f.xAxisName&&(null!=e||(e=f.xAxisName)),null!==f.yAxisName&&void 0!==f.yAxisName&&(null!=n||(n=f.yAxisName)),null!==f.logX&&void 0!==f.logX&&f.logX&&(l=!0),null!==f.logY&&void 0!==f.logY&&f.logY&&(u=!0),null!==f.allowXZeroes&&void 0!==f.allowXZeroes&&f.allowXZeroes&&(c=!0);return{minX:o===Number.MAX_VALUE?void 0:o,minY:i===Number.MAX_VALUE?void 0:i,maxX:s===Number.MIN_VALUE?void 0:s,maxY:a===Number.MIN_VALUE?void 0:a,title:r,xAxisName:e,yAxisName:n,logX:l,logY:u,allowXZeroes:c}}function R(t){if(0===t.length)return null;const e={points:[],name:t[0].name,fitFunction:t[0].fitFunction,markerType:t[0].markerType,lineStyle:t[0].lineStyle,pointColor:t[0].pointColor,fitLineColor:t[0].fitLineColor,confidenceIntervalColor:t[0].confidenceIntervalColor,outlierColor:t[0].outlierColor,connectDots:t[0].connectDots,showFitLine:t[0].showFitLine,showPoints:t[0].showPoints,showCurveConfidenceInterval:t[0].showCurveConfidenceInterval,errorModel:t[0].errorModel,clickToToggle:t[0].clickToToggle,labels:t[0].labels,droplines:t[0].droplines,columnName:t[0].columnName};for(const n of t)e.points=[...e.points,...n.points];return e}function M(t){var e,n,o,i,a;let c=t.cell.value;c.includes("|")&&(c=c.replaceAll("|",""));const f=(null===(n=null===(e=t.cell)||void 0===e?void 0:e.column)||void 0===n?void 0:n.type)===r.TYPE.STRING?t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,u.K)(c):null!==(o=JSON.parse(null!=c?c:"{}"))&&void 0!==o?o:{}:(0,l.Kh)(),d=t.cell.column?D(t.cell.column):{},m=t.cell.column?X(t.cell.dataFrame):{};null!==(i=f.series)&&void 0!==i||(f.series=[]),null!==(a=f.chartOptions)&&void 0!==a||(f.chartOptions=d.chartOptions),O(s.xs,d.chartOptions,f.chartOptions),O(s.xs,m.chartOptions,f.chartOptions);for(const t of f.series)O(s.IL,f.seriesOptions,t),O(s.IL,d.seriesOptions,t),O(s.IL,m.seriesOptions,t);return f}function X(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=h.h.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.Kh)()))}function D(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=h.h.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.Kh)()))}function F(t,e,n){if(t.width<h.h.MIN_AXES_CELL_PX_WIDTH||t.height<h.h.MIN_AXES_CELL_PX_HEIGHT)return[t,void 0,void 0];const r=e?h.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_LEFT_PX_MARGIN,o=e?h.h.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS:h.h.AXES_BOTTOM_PX_MARGIN,i=n?h.h.AXES_TOP_PX_MARGIN_WITH_TITLE:h.h.AXES_TOP_PX_MARGIN;return[t.cutLeft(r).cutBottom(o).cutTop(i).cutRight(h.h.AXES_RIGHT_PX_MARGIN),t.getBottom(o).getTop(i).cutLeft(r).cutRight(h.h.AXES_RIGHT_PX_MARGIN),t.getLeft(r).getRight(h.h.AXES_RIGHT_PX_MARGIN).cutBottom(o).cutTop(i)]}function k(t){return null!=t&&""!==t&&void 0!==r.Color.fromHtml(t)}function B(t){var e;for(let n=0;n<(null===(e=t.series)||void 0===e?void 0:e.length);n++){const e=t.series[n];if(e.points.every((t=>0!==t.x)))continue;let r=Number.MAX_VALUE,o=0,i=0;const s=[];for(let t=0;t<e.points.length;t++)e.points[t].x<r&&0!==e.points[t].x&&(r=e.points[t].x),e.points[t].x>o&&0!==e.points[t].x&&(o=e.points[t].x),s.includes(e.points[t].x)||(s[s.length]=e.points[t].x,i++);const a=Math.pow(10,Math.log10(r)-(Math.log10(o)-Math.log10(r)/(i-1)));for(let t=0;t<e.points.length;t++)0===e.points[t].x&&(e.points[t].x=a)}}let G=class extends r.GridCellRenderer{get name(){return h.h.FIT_CELL_TYPE}get cellType(){return h.h.FIT_CELL_TYPE}getDefaultSize(t){return{width:h.h.CELL_DEFAULT_WIDTH,height:h.h.CELL_DEFAULT_HEIGHT}}onClick(t,e){var n,r,s,c,d,m,p;if(!t.cell.value)return;const y=t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,u.K)(t.cell.value):M(t);for(const[t,e]of Object.entries(h.h.CONDITION_MAP))if(e(y.series))return void(o.shell.o=i.divText(t,{style:{color:"red"}}));o.shell.o=t;const g=t.bounds.inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE),x=F(g,this.areAxesLabelsShown(g,y),this.isTitleShown(g,y))[0],v=(0,l.s$)(y),w=new a.L(v,x,null!==(r=null===(n=y.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==r&&r,null!==(c=null===(s=y.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==c&&c);for(let n=0;n<(null===(d=y.series)||void 0===d?void 0:d.length);n++)if(!(y.series[n].connectDots||!y.series[n].clickToToggle||"points"!==y.series[n].showPoints||g.width<h.h.MIN_AXES_CELL_PX_WIDTH||g.height<h.h.MIN_AXES_CELL_PX_HEIGHT))for(let r=0;r<y.series[n].points.length;r++){const o=y.series[n].points[r];if(this.hitTest(e,o,w)){o.outlier=!o.outlier;const e=t.grid.dataFrame.columns.byTags({".sourceColumn":t.cell.column.name});if(e)for(const r of e){const e={logX:null===(m=y.chartOptions)||void 0===m?void 0:m.logX,logY:null===(p=y.chartOptions)||void 0===p?void 0:p.logY},o=null!==r.tags[".seriesAggregation"]?(0,f.JR)(y,r.tags[".seriesAggregation"]):r.tags[".seriesNumber"]===n?(0,f.VK)(y.series[n],e):null;null!==o&&r.set(t.cell.rowIndex,o[r.tags[".statistics"]])}if(t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)!==h.h.TAG_FIT_CHART_FORMAT_3DX){const e=JSON.parse(t.cell.value);e.series[n].points[r].outlier=o.outlier,t.cell.value=JSON.stringify(e)}return}}}onDoubleClick(t,e){if(!t.cell.value)return;const n=c.D.fromGridCell(t),r=i.dialog({title:"Edit chart"}).add(n.root).show({resizable:!0}).root.getElementsByClassName("d4-dialog-contents dlg-edit-chart")[0].firstChild;n.canvas.width=r.clientWidth,n.canvas.height=r.clientHeight,n.render(),r.style.width="100%",r.style.height="100%",i.tools.handleResize(r,((t,e)=>{n.canvas.width=t,n.canvas.height=e,n.render()}))}areAxesShown(t){return t.width>=h.h.MIN_AXES_CELL_PX_WIDTH&&t.height>=h.h.MIN_AXES_CELL_PX_HEIGHT}areAxesLabelsShown(t,e){var n;return t.width>=h.h.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH&&t.height>=h.h.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.xAxisName)&&!!e.chartOptions.yAxisName}isTitleShown(t,e){var n;return t.width>=h.h.MIN_TITLE_PX_WIDTH&&t.height>=h.h.MIN_TITLE_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.title)}isLegendShown(t){return t.width>=h.h.MIN_LEGEND_PX_WIDTH&&t.height>=h.h.MIN_LEGEND_PX_HEIGHT}areDroplinesShown(t){return t.width>=h.h.MIN_DROPLINES_VISIBILITY_PX_WIDTH&&t.height>=h.h.MIN_DROPLINES_VISIBILITY_PX_HEIGHT}renderCurves(t,e,n){var r,o,i,s,u,c,f,d,m,p,y,w,T,E,A;t.save(),t.beginPath(),t.rect(e.x,e.y,e.width,e.height),t.clip(),(null===(r=n.chartOptions)||void 0===r?void 0:r.allowXZeroes)&&(null===(o=n.chartOptions)||void 0===o?void 0:o.logX)&&(null===(i=n.series)||void 0===i?void 0:i.some((t=>t.points.some((t=>0===t.x)))))&&B(n);const[L,O,P]=F(e,this.areAxesLabelsShown(e,n),this.isTitleShown(e,n)),R=(0,l.s$)(n);(R.x<0&&n.chartOptions||0===R.x&&n.chartOptions&&!n.chartOptions.allowXZeroes)&&(n.chartOptions.logX=!1),R.y<=0&&n.chartOptions&&(n.chartOptions.logY=!1);const M=new a.L(R,L,null!==(u=null===(s=n.chartOptions)||void 0===s?void 0:s.logX)&&void 0!==u&&u,null!==(f=null===(c=n.chartOptions)||void 0===c?void 0:c.logY)&&void 0!==f&&f),X=Math.min(L.width,L.height),D=X>100?1:.2+X/100*.8,k={logX:null===(d=n.chartOptions)||void 0===d?void 0:d.logX,logY:null===(m=n.chartOptions)||void 0===m?void 0:m.logY};t.save(),t.font='11px Roboto, "Roboto Local"',M.drawCoordinateGrid(t,O,P),t.restore();for(let r=0;r<(null===(p=n.series)||void 0===p?void 0:p.length);r++){const o=n.series[r];if(o.points.some((t=>void 0===t.x||void 0===t.y)))continue;(e.width<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||e.height<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT)&&(o.showPoints="",n.chartOptions&&(n.chartOptions.showStatistics=[])),o.points.sort(((t,e)=>t.x-e.x));let i=!0;const s=(0,l.zB)(o);let a=null;if(!o.connectDots||o.showFitLine)if(o.parameters)(null===(y=n.chartOptions)||void 0===y?void 0:y.logX)&&o.parameters[2]>0&&(o.parameters[2]=Math.log10(o.parameters[2])),a=(0,l._T)(o,s);else{const t=(0,l.nT)(o,s,k);a=t.fittedCurve;const e=[...t.parameters];o.parameters=e,i=!1}g(o,r),x(t,o,{viewport:M,ratio:D}),v(t,o,{viewport:M,ratio:D}),_(t,o,{viewport:M,ratio:D,logOptions:k,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,curveFunc:a}),C(t,o,{viewport:M,logOptions:k,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,fitFunc:s,userParamsFlag:i}),o.parameters&&I(t,o,{viewport:M,ratio:D,showDroplines:this.areDroplinesShown(e),xValue:o.parameters[2],dataBounds:R,curveFunc:a,logOptions:k}),b(t,o,{statistics:null===(w=n.chartOptions)||void 0===w?void 0:w.showStatistics,fitFunc:s,logOptions:k,dataBox:L})}!function(t,e){e.showTitle&&(t.font='12px Roboto, "Roboto Local"',t.textAlign="center",t.fillStyle="black",t.fillText(e.title,e.dataBox.midX-5,e.screenBounds.y+15))}(t,{showTitle:this.isTitleShown(e,n),title:null===(T=n.chartOptions)||void 0===T?void 0:T.title,dataBox:L,screenBounds:e}),function(t,e){if(e.showAxesLabels){t.font='11px Roboto, "Roboto Local"',t.textAlign="center",t.fillStyle="black",t.fillText(e.xAxisName,e.dataBox.midX-5,e.screenBounds.maxY-h.h.X_AXIS_LABEL_BOTTOM_PX_MARGIN),t.translate(e.screenBounds.x,e.screenBounds.y),t.rotate(-Math.PI/2);const n=e.showTitle?h.h.AXES_TOP_PX_MARGIN_WITH_TITLE:h.h.AXES_TOP_PX_MARGIN;t.fillText(e.yAxisName,-(e.dataBox.height/2+n+15),15),t.restore()}}(t,{showTitle:this.isTitleShown(e,n),dataBox:L,screenBounds:e,showAxesLabels:this.areAxesLabelsShown(e,n),xAxisName:null===(E=n.chartOptions)||void 0===E?void 0:E.xAxisName,yAxisName:null===(A=n.chartOptions)||void 0===A?void 0:A.yAxisName}),function(t,e,n){var r,o,i,s;if(n.showLegend){t.font='11px Roboto, "Roboto Local"';const a=[...new Set(null===(r=e.series)||void 0===r?void 0:r.map((t=>t.columnName)))].filter((t=>null!=t));let l=0;for(let r=0;r<a.length;r++){const u=a[r];(null===(o=e.chartOptions)||void 0===o?void 0:o.showColumnLabel)&&N(t,u,{dataBox:n.dataBox,columnIdx:r,drawnCurvesInLegend:l});const c=null===(i=e.series)||void 0===i?void 0:i.filter((t=>t.columnName===u));for(let o=0;o<(null==c?void 0:c.length);o++){const i=c[o];""!==i.name&&null!==i.name&&void 0!==i.name&&(S(t,i,{dataBox:n.dataBox,ratio:n.ratio,columnIdx:r,drawnCurvesInLegend:l,showColumnLabel:null===(s=e.chartOptions)||void 0===s?void 0:s.showColumnLabel}),l++)}}t.restore()}}(t,n,{showLegend:this.isLegendShown(e),dataBox:L,ratio:D}),t.restore()}render(t,e,n,o,i,s,a){var l,c,f;if(!s.cell.value)return;if(o<h.h.MIN_CELL_RENDERER_PX_WIDTH||i<h.h.MIN_CELL_RENDERER_PX_HEIGHT)return;const d=(null===(l=s.cell.column)||void 0===l?void 0:l.getTag(h.h.TAG_FIT_CHART_FORMAT))===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,u.K)(s.cell.value):M(s),m=new r.Rect(e,n,o,i).inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE);for(const[e,n]of Object.entries(h.h.CONDITION_MAP))if(n(d.series))return void L(t,m);null===(c=d.series)||void 0===c||c.forEach((t=>t.columnName=s.cell.column.name)),(null===(f=d.chartOptions)||void 0===f?void 0:f.mergeSeries)&&(d.series=[R(d.series)]),this.renderCurves(t,m,d)}hitTest(t,e,n){const o=n.xToScreen(e.x),i=n.yToScreen(e.y),s=(e.outlier?h.h.OUTLIER_PX_SIZE:h.h.POINT_PX_SIZE)/2+h.h.OUTLIER_HITBOX_RADIUS;return new r.Rect(o-s,i-s,2*s,2*s).containsPoint(new r.Point(t.offsetX,t.offsetY))}onMouseMove(t,e){var n,o,s,c,f;if(!t.cell.value)return;const d=t.bounds.inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE);if(d.width<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||d.height<h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const n=i.canvas(300,200);this.render(n.getContext("2d"),0,0,300,200,t,null);const r=i.divV([n]);i.tooltip.show(r,e.x,e.y)}const m=t.cell.column.getTag(h.h.TAG_FIT_CHART_FORMAT)===h.h.TAG_FIT_CHART_FORMAT_3DX?(0,u.K)(t.cell.value):M(t);if(d.width>=h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH&&d.height>=h.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const t=F(d,this.areAxesLabelsShown(d,m),this.isTitleShown(d,m))[0],u=(0,l.s$)(m),p=new a.L(u,t,null!==(o=null===(n=m.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==o&&o,null!==(c=null===(s=m.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==c&&c);for(let t=0;t<(null===(f=m.series)||void 0===f?void 0:f.length);t++)if("points"===m.series[t].showPoints)for(let n=0;n<m.series[t].points.length;n++){const o=m.series[t].points[n];if(this.hitTest(e,o,p))return i.tooltip.show(i.divV([i.divText(`x: ${r.format(o.x,"#0.000")}`),i.divText(`y: ${r.format(o.y,"#0.000")}`)]),e.x+16,e.y+16),void(!m.series[t].connectDots&&m.series[t].clickToToggle&&d.width>=h.h.MIN_AXES_CELL_PX_WIDTH&&d.height>=h.h.MIN_AXES_CELL_PX_HEIGHT&&(document.body.style.cursor="pointer"))}i.tooltip.hide()}document.body.style.cursor="default"}};G=function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}([o.decorators.cellRenderer({name:"Fit",cellType:"fit",virtual:!0})],G)},860:(t,e,n)=>{"use strict";var r=n(755),o=n(82),i=n(389),s=n(328),a=n(326),l=n(71);const u=rxjs.operators,c=rxjs;var f,h=n(95);let d=f=class extends a.D{constructor(){super(new r.lR),this.curvesColumnNames=[],this.showSelectedRowsCurves=!1,this.showCurrentRowCurve=!0,this.showMouseOverRowCurve=!0,this.mergeColumnSeries=!1,this.rows=[],this.data=new l.oH,this.curvesColumnNames=this.addProperty("curvesColumnNames",o.TYPE.COLUMN_LIST,[],{semType:h.h.FIT_SEM_TYPE}),this.showSelectedRowsCurves=this.bool("showSelectedRowsCurves",!1,{description:"Adds curves from the selected rows"}),this.showCurrentRowCurve=this.bool("showCurrentRowCurve",!0),this.showMouseOverRowCurve=this.bool("showMouseOverRowCurve",!0),this.mergeColumnSeries=this.bool("mergeColumnSeries",!1);for(const t of l.xs)this.addProperty("mergeSeries"===t.name?"mergeCellSeries":t.name,t.propertyType,t.defaultValue,t.options)}static fromChartData(t){let e=new f;return e.data=t,e.render(),e}applyViewerProperties(){(0,r.g2)(l.xs,this,this.data.chartOptions)}mergeViewerChartOptions(){for(const t of l.xs)if(["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===t.name?"mergeCellSeries":t.name)?void 0!==this["mergeSeries"===t.name?"mergeCellSeries":t.name]:void 0!==this.props.get(t.name)&&this.props.get(t.name)!==t.defaultValue){if(["title","xAxisName","yAxisName"].includes(t.name)&&""===this.props.get(t.name))continue;["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===t.name?"mergeCellSeries":t.name)?this.data.chartOptions[t.name]=this[t.name]:this.data.chartOptions[t.name]=this.props.get(t.name)}}createChartData(){var t,e,n,i,s,a;if(0===(null===(t=this.curvesColumnNames)||void 0===t?void 0:t.length))return;this.rows.length=0;let u=-1;this.showCurrentRowCurve&&-1!==this.dataFrame.currentRowIdx&&this.rows.push(this.dataFrame.currentRowIdx),this.showMouseOverRowCurve&&-1!==this.dataFrame.mouseOverRowIdx&&this.rows.push(this.dataFrame.mouseOverRowIdx),this.showSelectedRowsCurves&&-1!==this.dataFrame.mouseOverRowIdx&&(u=this.rows.length,this.rows.push(...this.dataFrame.selection.getSelectedIndexes())),this.data=new l.oH;const c=null===(e=this.tableView)||void 0===e?void 0:e.grid,f=this.props.get("mergeCellSeries"),h=[];for(const t of this.curvesColumnNames){const e=[];for(const o of new Set(this.rows)){const i=c.cell(t,c.tableRowToGrid(o));if(""===i.cell.value)continue;const s=(0,r.j$)(i);null===(n=s.series)||void 0===n||n.forEach((t=>t.columnName=i.cell.column.name));const a=s.chartOptions;if(null!=a&&(h[h.length]=a),f){const t=(0,r.wU)(s.series);void 0!==(null==a?void 0:a.title)&&""!==(null==a?void 0:a.title)&&(t.name=null==a?void 0:a.title),s.series=[t]}e.push(...s.series)}this.mergeColumnSeries?null===(i=this.data.series)||void 0===i||i.push((0,r.wU)(e)):null===(s=this.data.series)||void 0===s||s.push(...e)}this.data.chartOptions=(0,r.LX)(h),this.mergeViewerChartOptions(),null===(a=this.data.series)||void 0===a||a.forEach(((t,e)=>{var n,r,i,s,a;if(t.pointColor=o.Color.toHtml(o.Color.getCategoricalColor((null===(n=this.data.series)||void 0===n?void 0:n.length)>20?0:e)),t.fitLineColor=o.Color.toHtml(o.Color.getCategoricalColor((null===(r=this.data.series)||void 0===r?void 0:r.length)>20?0:e)),t.showCurveConfidenceInterval=!1,t.droplines=[],(null===(i=this.data.series)||void 0===i?void 0:i.length)>20&&(t.showPoints="",t.lineStyle="solid"),(null===(s=this.data.series)||void 0===s?void 0:s.length)>10&&(null===(a=this.data.series)||void 0===a?void 0:a.length)<100&&e>=u){const e=o.Color.fromHtml(t.fitLineColor);t.fitLineColor=`rgba(${o.Color.r(e)}, ${o.Color.g(e)}, ${o.Color.b(e)}, 0.2)`}}))}onPropertyChanged(t){var e,n,r,o,i;"curvesColumnNames"===(null==t?void 0:t.name)&&(this.props.set("showColumnLabel",(null===(e=this.curvesColumnNames)||void 0===e?void 0:e.length)>1),this.showColumnLabel=(null===(n=this.curvesColumnNames)||void 0===n?void 0:n.length)>1),["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===(null==t?void 0:t.name)?"mergeCellSeries":null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"")&&(this["mergeSeries"===(null==t?void 0:t.name)?"mergeCellSeries":null!==(o=null==t?void 0:t.name)&&void 0!==o?o:""]=this[null!==(i=null==t?void 0:t.name)&&void 0!==i?i:""]),this.applyViewerProperties(),this.createChartData(),this.render()}onTableAttached(){var t;const e=null===(t=this.tableView)||void 0===t?void 0:t.grid,n=this.dataFrame.columns.bySemType(h.h.FIT_SEM_TYPE);null!==n&&(this.curvesColumnNames=[n.name]),(0,c.merge)(this.dataFrame.onCurrentCellChanged,e.onCellMouseEnter,this.dataFrame.onSelectionChanged).pipe((0,u.debounce)((t=>(0,c.interval)(50)))).subscribe((t=>{this.createChartData(),this.render()}))}_showErrorMessage(t){this.root.appendChild(i.divText(t,"d4-viewer-error"))}_removeErrorMessage(){const t=this.root.getElementsByClassName("d4-viewer-error")[0];t&&this.root.removeChild(t)}render(){var t;const e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),0!==(null===(t=this.curvesColumnNames)||void 0===t?void 0:t.length)?(this._removeErrorMessage(),this.renderer.renderCurves(e,new o.Rect(0,0,this.canvas.width,this.canvas.height).inflate(h.h.INFLATE_SIZE,h.h.INFLATE_SIZE),this.data)):this._showErrorMessage("The MultiCurveViewer viewer requires a minimum of 1 curves column.")}};d=f=function(t,e,n,r){var o,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,n,s):o(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}([s.decorators.viewer({name:"MultiCurveViewer",description:"A viewer that superimposes multiple in-cell curves on one chart",icon:"icons/multi-curve-viewer.png"}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],d),n(48),n(471),n(283),new o.Package},82:t=>{"use strict";t.exports=DG},328:t=>{"use strict";t.exports=grok},389:t=>{"use strict";t.exports=ui},991:t=>{"use strict";t.exports=wu},234:()=>{}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={id:r,loaded:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>it,test:()=>st,tests:()=>h});var t=n(82),e=n(328);n(982);const o=t.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');o.columns.add(t.Column.fromList(t.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const s=3e4,a=108e5,l=console.log.bind(console),u=console.info.bind(console),c=console.warn.bind(console),f=console.error.bind(console),h={},d="Auto Tests",m="Demo",p="Detectors",y="Core",g={};let x;var v;!function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(v||(v={}));class w{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class T{constructor(t,e,n,r){var o;this.category=t,this.name=e,null!=r||(r={}),null!==(o=r.timeout)&&void 0!==o||(r.timeout=s),this.options=r,this.test=()=>i(this,void 0,void 0,(function*(){return new Promise(((t,e)=>i(this,void 0,void 0,(function*(){let r="";try{r=yield n()}catch(t){e(t)}t(r)}))))}))}}function _(t,e,n){null==h[x]&&(h[x]={}),null==h[x].tests&&(h[x].tests=[]),h[x].tests.push(new T(x,t,e,n))}function C(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function E(t,e,n=.001,r){if(t===Number.POSITIVE_INFINITY&&e===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY&&e===Number.NEGATIVE_INFINITY||t===Number.NaN&&e===Number.NaN||isNaN(t)&&isNaN(e))return;const o=Math.abs(t-e)<n;if(C(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function I(t,e){for(const[n,r]of Object.entries(e)){if(!t.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const e=t[n];if(e instanceof Array&&r instanceof Array)A(e,r);else if(e instanceof Object&&r instanceof Object)I(e,r);else if(Number.isFinite(e)&&Number.isFinite(r))E(e,r);else if(e!=r)throw new Error(`Expected (${r}) for key '${n}', got (${e})`)}}function A(t,e){const n=t.length,r=e.length;if(n!=r)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${r}`);for(let r=0;r<n;r++)if(t[r]instanceof Array&&e[r]instanceof Array)A(t[r],e[r]);else if(t[r]instanceof Object&&e[r]instanceof Object)I(t[r],e[r]);else if(t[r]!=e[r])throw new Error(`Expected ${e[r]} at position ${r}, got ${t[r]}`)}function b(t,e,n){var r;x=t,e(),h[x]&&(h[x].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,h[x].timeout=null==n?void 0:n.timeout,h[x].benchmarks=null==n?void 0:n.benchmarks,h[x].stressTests=null==n?void 0:n.stressTests)}function N(t,e){return t.replace(new RegExp(e.name,"gi"),e.nqName)}function S(n){var r,a,x,v;return i(this,void 0,void 0,(function*(){const E=null===(a=null===(r=e.functions.getCurrentCall())||void 0===r?void 0:r.func)||void 0===a?void 0:a.package;yield function(n){var r,a,l,u;return i(this,void 0,void 0,(function*(){const c=n.id;if(g[c])return;const f=h;if(void 0!==f[d]||void 0!==f[m]||Object.keys(f).find((t=>t.startsWith(d)||t.startsWith(y))))return void(g[c]=!0);if("DevTools"===n.name)for(const t of window.dartTests){const e=t.name.split(/\s*\|\s*!/g);let n=null!==(r=e.pop())&&void 0!==r?r:t.name,o=e.length?y+": "+e.join(": "):y,i=n.split(" | ");n=i[i.length-1],i.unshift(o),i.pop(),o=i.join(": "),void 0===f[o]&&(f[o]={tests:[],clear:!0}),f[o].tests.push(new T(o,n,t.test,{isAggregated:!1,timeout:null!==(l=null===(a=t.options)||void 0===a?void 0:a.timeout)&&void 0!==l?l:s,skipReason:null===(u=t.options)||void 0===u?void 0:u.skipReason}))}const x=[],v=[],w=[],_=yield e.dapi.functions.filter(`package.id = "${c}"`).list(),E=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const n of _){const r=n.options.test,s=n.options.demoPath;if(r&&Array.isArray(r)&&r.length)for(let o=0;o<r.length;o++){const s=r[o].matchAll(E),a={};Array.from(s).forEach((t=>{t[0].startsWith("skip")?a.skip=t[1]:t[0].startsWith("wait")?a.wait=parseInt(t[2]):t[0].startsWith("cat")?a.cat=t[3]:t[0].startsWith("timeout")&&(a.timeout=parseInt(t[4]))}));const l=new T(d,1===r.length?n.name:`${n.name} ${o+1}`,(()=>i(this,void 0,void 0,(function*(){const t=yield e.functions.eval(N(r[o],n));if(a.wait&&(yield P(a.wait)),"boolean"==typeof t&&!t)throw`Failed: ${r[o]}, expected true, got ${t}`}))),{skipReason:a.skip,timeout:t.Test.isInBenchmark?a.benchmarkTimeout:a.timeout});if(a.cat){const t=d+": "+a.cat;l.category=t,void 0===f[t]&&(f[t]={tests:[],clear:!0}),f[t].tests.push(l)}else x.push(l)}if(s){const r=n.options.demoWait?parseInt(n.options.demoWait):void 0,o=new T(m,n.friendlyName,(()=>i(this,void 0,void 0,(function*(){e.shell.isInDemo=!0,void 0===e.shell.view(t.View.BROWSE)&&(e.shell.v=t.View.createByType(t.View.BROWSE)),yield P(300),e.shell.clearLastError(),yield n.apply(),yield P(r||2e3);const o=yield e.shell.lastError;if(o)throw new Error(o);e.shell.isInDemo=!1}))),{skipReason:n.options.demoSkip});v.push(o)}if(n.hasTag("semTypeDetector")){const t=new T(p,n.friendlyName,(()=>i(this,void 0,void 0,(function*(){const t=[];for(const e of o.clone().columns){const r=yield n.apply([e]);t.push(r||e.semType)}C(t.filter((t=>t)).length,1)}))),{skipReason:n.options.skipTest});w.push(t)}}g[c]=!0,x.length&&(f[d]={tests:x,clear:!0}),v.length&&(f[m]={tests:v,clear:!0}),w.length&&(f[p]={tests:w,clear:!1})}))}(E);const I=[];console.log("Running tests"),null!=n||(n={}),null!==(x=(v=n).testContext)&&void 0!==x||(v.testContext=new w),e.shell.clearLastError();const A=function(){const t=[];return console.log=(...e)=>{t.push(...e),l(...e)},console.info=(...e)=>{t.push(...e),u(...e)},console.warn=(...e)=>{t.push(...e),c(...e)},console.error=(...e)=>{t.push(...e),f(...e)},t}();(null==n?void 0:n.stressTest)?yield function(e){var n,r,o,s,a,l;return i(this,void 0,void 0,(function*(){let i=[];for(const[t,e]of Object.entries(h)){let t=null===(n=e.tests)||void 0===n?void 0:n.filter((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.stressTest}));e.stressTests&&(t=null===(r=e.tests)||void 0===r?void 0:r.filter((t=>{var e,n;return void 0===(null===(e=t.options)||void 0===e?void 0:e.stressTest)||!0===(null===(n=t.options)||void 0===n?void 0:n.stressTest)})));const a=null===(o=e.tests)||void 0===o?void 0:o.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));if(!a)for(let n of null!=t?t:[])null==(null===(s=n.options)||void 0===s?void 0:s.skipReason)&&i.push({test:n,value:e})}i=function(t){const e=t.slice();return e.sort((()=>Math.random()-.5)),e}(i);const u=[];for(let n of i){yield b(n.value.before,null!==(a=e.category)&&void 0!==a?a:"");let r=yield O(n.test,null==e?void 0:e.test,A,t.Test.isInBenchmark?n.value.benchmarkTimeout:n.value.timeout,E.name,e.verbose);r&&u.push(r),console.log(`Test: ${null==_?void 0:_.name}; result: ${r}`),yield b(n.value.after,null!==(l=e.category)&&void 0!==l?l:"")}I.push(...u)}))}(n):yield function(n,r){var o,s,a,h,d,m,p;return i(this,void 0,void 0,(function*(){try{for(const[i,u]of Object.entries(n)){if((null==r?void 0:r.category)&&!i.toLowerCase().startsWith(null==r?void 0:r.category.toLowerCase())||(null===(o=r.exclude)||void 0===o?void 0:o.some((t=>i.startsWith(t)))))continue;l(`Started ${i} category`);const n=null===(s=u.tests)||void 0===s?void 0:s.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));n||(u.beforeStatus=yield b(u.before,null!==(a=r.category)&&void 0!==a?a:""));const c=null!==(h=u.tests)&&void 0!==h?h:[],f=[];if(u.clear)for(let n=0;n<c.length;n++){c[n].options&&void 0===(null===(d=c[n].options)||void 0===d?void 0:d.benchmark)&&(c[n].options||(c[n].options={}),c[n].options.benchmark=null!==(m=u.benchmarks)&&void 0!==m&&m);let o=yield O(c[n],null==r?void 0:r.test,A,t.Test.isInBenchmark?u.benchmarkTimeout:u.timeout,E.name,r.verbose);o&&f.push(o),e.shell.closeAll(),t.Balloon.closeAll()}else for(let e=0;e<c.length;e++){let n=yield O(c[e],null==r?void 0:r.test,A,t.Test.isInBenchmark?u.benchmarkTimeout:u.timeout,E.name,r.verbose);n&&f.push(n)}const y=f.filter((t=>"skipped"!=t.result));n||(u.afterStatus=yield b(u.after,null!==(p=r.category)&&void 0!==p?p:"")),u.afterStatus&&y.push({date:(new Date).toISOString(),logs:"",category:i,name:"after",result:u.afterStatus,success:!1,ms:0,skipped:!1}),u.beforeStatus&&y.push({date:(new Date).toISOString(),logs:"",category:i,name:"before",result:u.beforeStatus,success:!1,ms:0,skipped:!1}),I.push(...y)}}finally{console.log=l,console.info=u,console.warn=c,console.error=f}if(r.testContext.catchUnhandled&&!t.Test.isInBenchmark){yield P(1e3);const t=yield e.shell.lastError,n={logs:"",date:(new Date).toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=t?t:"",success:!t,ms:0,skipped:!1};I.push(n),n.package=E.name,null!=e.shell.reportTest?yield e.shell.reportTest("package",n):yield fetch(`${e.dapi.root}/log/tests/package`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)})}}))}(h,n);for(let t of I)t.result=t.result.toString().replace(/"/g,"'"),null!=t.logs&&(t.logs=t.logs.toString().replace(/"/g,"'"));return I;function b(t,e){return i(this,void 0,void 0,(function*(){var n=void 0;try{void 0!==t&&(yield R((()=>i(this,void 0,void 0,(function*(){yield t()}))),1e5,`before ${e}: timeout error`))}catch(t){n=yield L(t)}return n}))}}))}function L(e){return i(this,void 0,void 0,(function*(){return`${e.toString()}\n${e.stack?yield t.Logger.translateStackTrace(e.stack):""}`}))}function O(n,r,o,u,c,h){var d,m,p,y,g,x,v,w;return i(this,void 0,void 0,(function*(){let i;o.length=0;let T="package";const _=null!=r&&n.name.toLowerCase()!==r.toLowerCase();let C=(null===(d=n.options)||void 0===d?void 0:d.skipReason)||_,E=_?"skipped":null===(m=n.options)||void 0===m?void 0:m.skipReason;if(t.Test.isInBenchmark&&!(null===(p=n.options)||void 0===p?void 0:p.benchmark))return void l(`SKIPPED: ${n.category} ${n.name} doesnt available in benchmark mode`);C||l(`Started ${n.category} ${n.name}`);const I=Date.now();try{if(C)i={date:(new Date).toISOString(),success:!0,result:E,ms:0,skipped:!0};else{let e=(null===(y=n.options)||void 0===y?void 0:y.timeout)===s&&u?u:null===(g=n.options)||void 0===g?void 0:g.timeout;e=e===s&&t.Test.isInBenchmark?a:e,i={date:(new Date).toISOString(),success:!0,result:null!==(x=yield R(n.test,e))&&void 0!==x?x:"OK",ms:0,skipped:!1}}}catch(t){f(t),i={date:(new Date).toISOString(),success:!1,result:yield L(t),ms:0,skipped:!1}}if((null===(v=n.options)||void 0===v?void 0:v.isAggregated)&&i.result.constructor===t.DataFrame){const t=i.result.col("success");if(t&&(i.success=t.stats.sum===t.length),!h){const t=i.result;t.columns.remove("stack"),t.rows.removeWhere((t=>t.get("success"))),i.result=t}i.result=i.result.toCsv()}if(i.logs=o.join("\n"),i.ms=Date.now()-I,C||l(`Finished ${n.category} ${n.name} for ${i.ms} ms`),i.category=n.category,i.name=n.name,!_){let r={success:i.success,result:i.result,ms:i.ms,skipped:i.skipped,package:c,category:n.category,name:n.name,logs:i.logs};if(i.result.constructor==Object){const t=Object.keys(i.result).reduce(((t,e)=>Object.assign(Object.assign({},t),{["result."+e]:i.result[e]})),{});r=Object.assign(Object.assign({},r),t)}r.result instanceof t.DataFrame&&(r.result=JSON.stringify(null===(w=r.result)||void 0===w?void 0:w.toJson())||""),null!=e.shell.reportTest?yield e.shell.reportTest(T,r):yield fetch(`${e.dapi.root}/log/tests/${T}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(r)})}return i}))}function P(t){return i(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}function R(t,e,n="EXECUTION TIMEOUT"){return i(this,void 0,void 0,(function*(){let r=null;const o=new Promise(((t,o)=>{r=setTimeout((()=>{o(n)}),e)}));try{return yield Promise.race([t(),o])}finally{r&&clearTimeout(r)}}))}t.DataFrame.fromColumns([t.Column.fromStrings("col",["val1","val2","val3"])]);var M=n(95),X=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};b("detectors",(()=>{_("detectFitCurves",(()=>X(void 0,void 0,void 0,(function*(){const n=t.DataFrame.fromCsv('dataframes,json chart 0,json chart 1,json chart 2\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4325498997897106,1.9857091601431633,1.1549088606928581,1.7111330488305754],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.04513680189847946},{""x"":0.6000000238418579,""y"":0.05534003674983978},{""x"":1.100000023841858,""y"":0.041759949177503586},{""x"":1.600000023841858,""y"":0.019746985286474228},{""x"":2.0999999046325684,""y"":0.009008238092064857},{""x"":2.5999999046325684,""y"":0.00802786834537983},{""x"":3.0999999046325684,""y"":0.046114228665828705},{""x"":3.5999999046325684,""y"":0.0032935715280473232},{""x"":4.099999904632568,""y"":0.05305013433098793},{""x"":4.599999904632568,""y"":0.11946146935224533},{""x"":5.099999904632568,""y"":0.24304461479187012},{""x"":5.599999904632568,""y"":0.32507050037384033},{""x"":6.099999904632568,""y"":0.30492347478866577},{""x"":6.599999904632568,""y"":0.30675041675567627},{""x"":7.099999904632568,""y"":0.28282707929611206}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.027537694200873375},{""x"":0.6000000238418579,""y"":0.20163409411907196},{""x"":1.100000023841858,""y"":0.4537210166454315},{""x"":1.600000023841858,""y"":0.1709870994091034},{""x"":2.0999999046325684,""y"":0.35089364647865295},{""x"":2.5999999046325684,""y"":0.30297139286994934},{""x"":3.0999999046325684,""y"":0.3161645829677582},{""x"":3.5999999046325684,""y"":0.460237979888916},{""x"":4.099999904632568,""y"":0.5018354058265686},{""x"":4.599999904632568,""y"":1.2936394214630127},{""x"":5.099999904632568,""y"":2.336543321609497},{""x"":5.599999904632568,""y"":2.353417158126831},{""x"":6.099999904632568,""y"":2.5554966926574707},{""x"":6.599999904632568,""y"":2.7185072898864746},{""x"":7.099999904632568,""y"":2.8088953495025635}]}]}","{""series"":[{""parameters"":[1.4257157458000065,1.587135296876273,1.6780074048516793,4.72187609991688],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.5346568822860718},{""x"":0.6000000238418579,""y"":0.6445727348327637},{""x"":1.100000023841858,""y"":0.08188246190547943},{""x"":1.600000023841858,""y"":0.0516531839966774},{""x"":2.0999999046325684,""y"":0.17018724977970123},{""x"":2.5999999046325684,""y"":0.618033766746521},{""x"":3.0999999046325684,""y"":0.16852399706840515},{""x"":3.5999999046325684,""y"":0.013230039738118649},{""x"":4.099999904632568,""y"":0.6706985831260681},{""x"":4.599999904632568,""y"":0.6293138861656189},{""x"":5.099999904632568,""y"":1.4058887958526611},{""x"":5.599999904632568,""y"":2.6412644386291504},{""x"":6.099999904632568,""y"":3.775967597961426},{""x"":6.599999904632568,""y"":3.3188939094543457},{""x"":7.099999904632568,""y"":3.793793201446533}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.4518023469757255,1.051351211186544,1.6612723878444138,-0.9253134758193626],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":2.5458569526672363},{""x"":0.10000000149011612,""y"":3.0017518997192383},{""x"":0.10000000149011612,""y"":2.4102466106414795},{""x"":0.10000000149011612,""y"":2.7017934322357178},{""x"":0.10000000149011612,""y"":2.8341686725616455},{""x"":0.6000000238418579,""y"":2.9751579761505127},{""x"":0.6000000238418579,""y"":2.8365142345428467},{""x"":0.6000000238418579,""y"":2.898362874984741},{""x"":0.6000000238418579,""y"":2.9964826107025146},{""x"":0.6000000238418579,""y"":2.6708292961120605},{""x"":1.100000023841858,""y"":3.263227939605713},{""x"":1.100000023841858,""y"":3.0655293464660645},{""x"":1.100000023841858,""y"":2.6620445251464844},{""x"":1.100000023841858,""y"":3.002741813659668},{""x"":1.100000023841858,""y"":3.1540098190307617},{""x"":1.600000023841858,""y"":2.8934433460235596},{""x"":1.600000023841858,""y"":2.7970690727233887},{""x"":1.600000023841858,""y"":3.0466723442077637},{""x"":1.600000023841858,""y"":3.179988145828247},{""x"":1.600000023841858,""y"":2.611898899078369},{""x"":2.0999999046325684,""y"":2.497966766357422},{""x"":2.0999999046325684,""y"":2.645627498626709},{""x"":2.0999999046325684,""y"":2.5474727153778076},{""x"":2.0999999046325684,""y"":2.530237913131714},{""x"":2.0999999046325684,""y"":2.9498236179351807},{""x"":2.5999999046325684,""y"":2.7639214992523193},{""x"":2.5999999046325684,""y"":3.007110595703125},{""x"":2.5999999046325684,""y"":2.71816086769104},{""x"":2.5999999046325684,""y"":3.050650119781494},{""x"":2.5999999046325684,""y"":2.591902017593384},{""x"":3.0999999046325684,""y"":2.79219388961792},{""x"":3.0999999046325684,""y"":2.380063056945801},{""x"":3.0999999046325684,""y"":3.2450575828552246},{""x"":3.0999999046325684,""y"":2.6954219341278076},{""x"":3.0999999046325684,""y"":2.368993043899536},{""x"":3.5999999046325684,""y"":3.2338552474975586},{""x"":3.5999999046325684,""y"":3.222881555557251},{""x"":3.5999999046325684,""y"":2.6137502193450928},{""x"":3.5999999046325684,""y"":2.3624353408813477},{""x"":3.5999999046325684,""y"":2.830970525741577},{""x"":4.099999904632568,""y"":2.8000826835632324},{""x"":4.099999904632568,""y"":2.8115334510803223},{""x"":4.099999904632568,""y"":2.8906726837158203},{""x"":4.099999904632568,""y"":2.5641937255859375},{""x"":4.099999904632568,""y"":2.3881938457489014},{""x"":4.599999904632568,""y"":2.076000928878784},{""x"":4.599999904632568,""y"":2.241201400756836},{""x"":4.599999904632568,""y"":2.018866777420044},{""x"":4.599999904632568,""y"":2.7197747230529785},{""x"":4.599999904632568,""y"":2.3649282455444336},{""x"":5.099999904632568,""y"":2.068617105484009},{""x"":5.099999904632568,""y"":2.0637989044189453},{""x"":5.099999904632568,""y"":1.5100634098052979},{""x"":5.099999904632568,""y"":1.9978814125061035},{""x"":5.099999904632568,""y"":2.1007437705993652},{""x"":5.599999904632568,""y"":0.7437329292297363},{""x"":5.599999904632568,""y"":0.8030821681022644},{""x"":5.599999904632568,""y"":1.0766953229904175},{""x"":5.599999904632568,""y"":1.5326048135757446},{""x"":5.599999904632568,""y"":1.5971065759658813},{""x"":6.099999904632568,""y"":0.31388434767723083},{""x"":6.099999904632568,""y"":0.6875622272491455},{""x"":6.099999904632568,""y"":0.855545163154602},{""x"":6.099999904632568,""y"":0.6559354662895203},{""x"":6.099999904632568,""y"":0.3100747764110565},{""x"":6.599999904632568,""y"":0.4792144000530243},{""x"":6.599999904632568,""y"":0.855309009552002},{""x"":6.599999904632568,""y"":0.18937373161315918},{""x"":6.599999904632568,""y"":0.3708323538303375},{""x"":6.599999904632568,""y"":0.08053481578826904},{""x"":7.099999904632568,""y"":0.7577306628227234},{""x"":7.099999904632568,""y"":0.3387751877307892},{""x"":7.099999904632568,""y"":0.1985611915588379},{""x"":7.099999904632568,""y"":0.172195702791214},{""x"":7.099999904632568,""y"":0.13258741796016693}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4030933784862443,1.0245979562516274,1.7428150024861861,-3.5779850370795696],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":5.7036309242248535},{""x"":0.6000000238418579,""y"":5.746265888214111},{""x"":1.100000023841858,""y"":5.299612045288086},{""x"":1.600000023841858,""y"":5.343863487243652},{""x"":2.0999999046325684,""y"":5.506134033203125},{""x"":2.5999999046325684,""y"":5.4817914962768555},{""x"":3.0999999046325684,""y"":5.3505539894104},{""x"":3.5999999046325684,""y"":5.151522159576416},{""x"":4.099999904632568,""y"":5.212680339813232},{""x"":4.599999904632568,""y"":4.80598783493042},{""x"":5.099999904632568,""y"":3.351301431655884},{""x"":5.599999904632568,""y"":2.108116865158081},{""x"":6.099999904632568,""y"":1.246281623840332},{""x"":6.599999904632568,""y"":0.5875148773193359},{""x"":7.099999904632568,""y"":0.6986792683601379}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":4.777379035949707},{""x"":0.6000000238418579,""y"":5.265642166137695},{""x"":1.100000023841858,""y"":5.713808059692383},{""x"":1.600000023841858,""y"":5.249830722808838},{""x"":2.0999999046325684,""y"":5.587547779083252},{""x"":2.5999999046325684,""y"":5.36907434463501},{""x"":3.0999999046325684,""y"":4.934175968170166},{""x"":3.5999999046325684,""y"":5.372972011566162},{""x"":4.099999904632568,""y"":5.017283916473389},{""x"":4.599999904632568,""y"":4.6751484870910645},{""x"":5.099999904632568,""y"":3.423663854598999},{""x"":5.599999904632568,""y"":1.594344973564148},{""x"":6.099999904632568,""y"":0.5661525130271912},{""x"":6.599999904632568,""y"":0.19819404184818268},{""x"":7.099999904632568,""y"":0.8421927690505981}]}]}","{""series"":[{""parameters"":[1.5400648543589148,1.7239324972922214,1.4063297934320662,0.33443731185267556],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":1.27737557888031},{""x"":0.6000000238418579,""y"":1.2780145406723022},{""x"":1.100000023841858,""y"":1.3489571809768677},{""x"":1.600000023841858,""y"":1.3250025510787964},{""x"":2.0999999046325684,""y"":1.309158444404602},{""x"":2.5999999046325684,""y"":1.441296935081482},{""x"":3.0999999046325684,""y"":1.3621265888214111},{""x"":3.5999999046325684,""y"":1.3409022092819214},{""x"":4.099999904632568,""y"":1.2703818082809448},{""x"":4.599999904632568,""y"":1.2195014953613281},{""x"":5.099999904632568,""y"":0.585429310798645},{""x"":5.599999904632568,""y"":0.19421088695526123},{""x"":6.099999904632568,""y"":0.2276361584663391},{""x"":6.599999904632568,""y"":0.03259352594614029},{""x"":7.099999904632568,""y"":0.03811067342758179}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.3987701446422334,1.0025589776619843,1.950431059109577,1.57489342486818],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.03612012043595314},{""x"":0.10000000149011612,""y"":0.05706661567091942},{""x"":0.10000000149011612,""y"":0.007174440659582615},{""x"":0.10000000149011612,""y"":0.006656676065176725},{""x"":0.10000000149011612,""y"":0.03480849787592888},{""x"":0.6000000238418579,""y"":0.0665726289153099},{""x"":0.6000000238418579,""y"":0.054525356739759445},{""x"":0.6000000238418579,""y"":0.055943023413419724},{""x"":0.6000000238418579,""y"":0.0544852614402771},{""x"":0.6000000238418579,""y"":0.02734142541885376},{""x"":1.100000023841858,""y"":0.02047267183661461},{""x"":1.100000023841858,""y"":0.04814719781279564},{""x"":1.100000023841858,""y"":0.05629648640751839},{""x"":1.100000023841858,""y"":0.05200682207942009},{""x"":1.100000023841858,""y"":0.046626269817352295},{""x"":1.600000023841858,""y"":0.027950428426265717},{""x"":1.600000023841858,""y"":0.021106986328959465},{""x"":1.600000023841858,""y"":0.011796108447015285},{""x"":1.600000023841858,""y"":0.04013078659772873},{""x"":1.600000023841858,""y"":0.018657365813851357},{""x"":2.0999999046325684,""y"":0.010390376672148705},{""x"":2.0999999046325684,""y"":0.06717702001333237},{""x"":2.0999999046325684,""y"":0.015734216198325157},{""x"":2.0999999046325684,""y"":0.0005020603421144187},{""x"":2.0999999046325684,""y"":0.03601917624473572},{""x"":2.5999999046325684,""y"":0.04580968990921974},{""x"":2.5999999046325684,""y"":0.013811883516609669},{""x"":2.5999999046325684,""y"":0.0347907729446888},{""x"":2.5999999046325684,""y"":0.003400992602109909},{""x"":2.5999999046325684,""y"":0.0658077746629715},{""x"":3.0999999046325684,""y"":0.06470326334238052},{""x"":3.0999999046325684,""y"":0.040105774998664856},{""x"":3.0999999046325684,""y"":0.004536386113613844},{""x"":3.0999999046325684,""y"":0.028299888595938683},{""x"":3.0999999046325684,""y"":0.015297790057957172},{""x"":3.5999999046325684,""y"":0.010205036029219627},{""x"":3.5999999046325684,""y"":0.030351044610142708},{""x"":3.5999999046325684,""y"":0.02823905274271965},{""x"":3.5999999046325684,""y"":0.00543160829693079},{""x"":3.5999999046325684,""y"":0.03528806194663048},{""x"":4.099999904632568,""y"":0.024404611438512802},{""x"":4.099999904632568,""y"":0.021398605778813362},{""x"":4.099999904632568,""y"":0.01746137998998165},{""x"":4.099999904632568,""y"":0.06801135092973709},{""x"":4.099999904632568,""y"":0.02418249472975731},{""x"":4.599999904632568,""y"":0.08065827190876007},{""x"":4.599999904632568,""y"":0.03795705363154411},{""x"":4.599999904632568,""y"":0.03595327213406563},{""x"":4.599999904632568,""y"":0.019490951672196388},{""x"":4.599999904632568,""y"":0.0357535295188427},{""x"":5.099999904632568,""y"":0.06301134079694748},{""x"":5.099999904632568,""y"":0.04880264401435852},{""x"":5.099999904632568,""y"":0.046849530190229416},{""x"":5.099999904632568,""y"":0.046094998717308044},{""x"":5.099999904632568,""y"":0.07735799998044968},{""x"":5.599999904632568,""y"":0.10287926346063614},{""x"":5.599999904632568,""y"":0.15329882502555847},{""x"":5.599999904632568,""y"":0.09895746409893036},{""x"":5.599999904632568,""y"":0.10509312152862549},{""x"":5.599999904632568,""y"":0.10584071278572083},{""x"":6.099999904632568,""y"":0.19464170932769775},{""x"":6.099999904632568,""y"":0.1837087869644165},{""x"":6.099999904632568,""y"":0.19690236449241638},{""x"":6.099999904632568,""y"":0.14827826619148254},{""x"":6.099999904632568,""y"":0.15355728566646576},{""x"":6.599999904632568,""y"":0.21270307898521423},{""x"":6.599999904632568,""y"":0.19529509544372559},{""x"":6.599999904632568,""y"":0.20716492831707},{""x"":6.599999904632568,""y"":0.18739652633666992},{""x"":6.599999904632568,""y"":0.22446008026599884},{""x"":7.099999904632568,""y"":0.18822836875915527},{""x"":7.099999904632568,""y"":0.2324085384607315},{""x"":7.099999904632568,""y"":0.1877404898405075},{""x"":7.099999904632568,""y"":0.19784560799598694},{""x"":7.099999904632568,""y"":0.21554286777973175}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"'),r=n.columns.byName("json chart 0"),o=n.columns.byName("json chart 1"),i=n.columns.byName("json chart 2");yield e.data.detectSemanticTypes(n),C(r.semType,M.h.FIT_SEM_TYPE),C(o.semType,M.h.FIT_SEM_TYPE),C(i.semType,M.h.FIT_SEM_TYPE)})))),_("detectXMLCurveChart",(()=>X(void 0,void 0,void 0,(function*(){const n=t.DataFrame.fromCsv('xmlCurveFitChart\n"<chart><grid><xAxis min=""0.0"" max=""5"" /><yAxis min=""-100"" max=""100"" /></grid><settings xLabel=""Concentration"" yLabel=""Activity"" logX=""true"" /><seriesCollection><series><x>7.2e-12,7.1e-12,7e-12,6e-8,6e-5,6e-4</x><y>112,115,116,100,123,124</y><fitLine><function type=""sigif""><params>2e-08,-1.5,125,-20</params></function></fitLine><settings color=""Green"" marker=""SquareBorder"" markerColor=""Yellow"" markerBorderColor=""Black"" errorBarColor=""Red"" showErrorBars=""True"" drawLine=""True"" bound=""True"" /></series></seriesCollection></chart>"'),r=n.columns.byName("xmlCurveFitChart");yield e.data.detectSemanticTypes(n),C(r.semType,M.h.FIT_SEM_TYPE),C(r.tags[M.h.TAG_FIT_CHART_FORMAT],M.h.TAG_FIT_CHART_FORMAT_3DX)}))))}));var D=n(389),F=n(991),k=n.n(F),B=n(471),G=n(755),Y=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};function H(e){const n={series:[],chartOptions:{showStatistics:["auc"]}},r=(0,B.kL)(e,.5),o=t.Color.toHtml(t.Color.scatterPlotMarker);return n.series[0]={fitLineColor:o,pointColor:o,markerType:t.MARKER_TYPE.CIRCLE,showFitLine:!0,showPoints:"points",showCurveConfidenceInterval:!0,fitFunction:"sigmoid",points:k().count().take(e).map((function(t){return{x:r.x[t],y:r.y[t]}})).toArray()},n}b("creation",(()=>{_("fit curve creation",(()=>Y(void 0,void 0,void 0,(function*(){const n=Date.now(),r=(0,B.nO)(t.Test.isInBenchmark?1e3:100,5,2);e.shell.addTableView(r);const o=Date.now();return yield P(50),console.log(`Creation took ${o.valueOf()-n.valueOf()} ms`),`${t.Test.isInBenchmark?1e3:100} points, took ${o.valueOf()-n.valueOf()} ms`}))),{benchmark:!0})})),b("rendering",(()=>{_("rendering same fitChartData on canvas",(()=>Y(void 0,void 0,void 0,(function*(){const n=D.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new G.lR,i=H(t.Test.isInBenchmark?50:15);for(let e=1;e<=1e3;e++)o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(M.h.INFLATE_SIZE,M.h.INFLATE_SIZE),i),r.clearRect(0,0,160,120);return"rendering performed 1000 times"}))),{benchmark:!0}),_("rendering different fitChartData on canvas",(()=>Y(void 0,void 0,void 0,(function*(){const n=D.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new G.lR;for(let e=1;e<=1e3;e++){const e=H(t.Test.isInBenchmark?50:15);o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(M.h.INFLATE_SIZE,M.h.INFLATE_SIZE),e),r.clearRect(0,0,160,120)}return"rendering performed 1000 times"}))),{benchmark:!0}),_("rendering in grid",(()=>Y(void 0,void 0,void 0,(function*(){const t=(0,B.nO)(30,5,2),n=e.shell.addTableView(t);yield P(100);const r=n.grid.root.getElementsByTagName("canvas")[2],o=new Date;yield function(t){return Y(this,void 0,void 0,(function*(){for(let e=0;e<10;e++)t.dispatchEvent(new WheelEvent("wheel",{deltaY:300})),yield P(10)}))}(r);const i=new Date;return console.log(`curves rendering took ${i.valueOf()-o.valueOf()} ms`),i.valueOf()-o.valueOf()+" ms"}))))}));var V=n(293);b("viewport",(()=>{_("viewportMethods",(()=>{return e=void 0,n=void 0,o=function*(){const e=new t.Rect(120,20,160,100).inflate(M.h.INFLATE_SIZE,M.h.INFLATE_SIZE),[n]=(0,G.Tv)(e,!1,!1),r=new t.Rect(.1,.06,7,5.94),o=new V.L(r,n,!1,!1);C(o.xToScreen(1.5),182.4),C(o.yToScreen(2.33),73.01346801346801),C(o.xToWorld(150),-.9652173913043479),C(o.yToWorld(67),2.855294117647059)},new((r=void 0)||(r=Promise))((function(t,i){function s(t){try{l(o.next(t))}catch(t){i(t)}}function a(t){try{l(o.throw(t))}catch(t){i(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(t){t(n)}))).then(s,a)}l((o=o.apply(e,n||[])).next())}));var e,n,r,o}))}));var j=n(999),q=n(71),W=n(368),U=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const $={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7412786483764648},{x:.6000000238418579,y:1.8561450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"sigmoid",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[1.6914372095641517,1.1536998642628853,5.410173358224149,.2089689354045083]},z={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.5412786483764649},{x:.6000000238418579,y:1.9261450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-5.45641324,10.456486765]},K={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7897127864837648},{x:.6000000238418579,y:1.2101614502429963},{x:1.100000023841858,y:1.7895685749053956},{x:1.600000023841858,y:1.82476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"log-linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-8.45641324,90.4456456486765]},Z={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7897127864837648},{x:.6000000238418579,y:1.2101614502429963},{x:1.100000023841858,y:1.7895685749053956},{x:1.600000023841858,y:1.82476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"exponential",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[88.45641324,-10.4456456486765]},J={fitLineColor:"#2ca02c",pointColor:"#2ca02c",showCurveConfidenceInterval:!0,fitFunction:{name:"Polynomial",function:"([p1, p2, p3, p4], x) => p1 * x * x * x + p2 * x * x + p3 * x + p4",getInitialParameters:"(xs, ys) => [0.1, -1, 4, 4]",parameterNames:["Slope","Intercept","Parameter3","Parameter4"]},points:[{x:.10000000149011612,y:7.365033149719238},{x:.6000000238418579,y:6.595034599304199},{x:1.100000023841858,y:7.05179500579834},{x:1.600000023841858,y:7.251461982727051},{x:2.0999999046325684,y:7.775498867034912},{x:2.5999999046325684,y:7.748039722442627},{x:3.0999999046325684,y:6.8391804695129395},{x:3.5999999046325684,y:7.570991516113281},{x:4.099999904632568,y:6.387666702270508},{x:4.599999904632568,y:6.464827537536621},{x:5.099999904632568,y:3.932436227798462},{x:5.599999904632568,y:1.4741199016571045},{x:6.099999904632568,y:.47604307532310486},{x:6.599999904632568,y:.5836760401725769},{x:7.099999904632568,y:1.0317600965499878}],clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[.07070206940832963,-1.138666933634074,3.947509109407932,3.9947960440506685]},Q=(0,j.zB)($),tt=(0,j.zB)(z),et=(0,j.zB)(K),nt=(0,j.zB)(Z),rt=(0,j.zB)(J);b("fit",(()=>{_("getSeriesFitFunction",(()=>U(void 0,void 0,void 0,(function*(){var t;const{xs:e,ys:n}=(0,j.W$)($.points),{xs:r,ys:o}=(0,j.W$)(z.points),{xs:i,ys:s}=(0,j.W$)(K.points),{xs:a,ys:l}=(0,j.W$)(Z.points),{xs:u,ys:c}=(0,j.W$)(J.points);C(Q.name,q.G7),C(tt.name,q.Ff),C(et.name,q.kx),C(nt.name,q.Pf),C(rt.name,"Polynomial"),A(Q.parameterNames,["Top","Bottom","Slope","IC50"]),A(tt.parameterNames,["Slope","Intercept"]),A(et.parameterNames,["Slope","Intercept"]),A(nt.parameterNames,["Mantissa","Power"]),A(rt.parameterNames,["Slope","Intercept","Parameter3","Parameter4"]),A(Q.getInitialParameters(e,n),[1.8561450242996216,1,5.099999904632568,.23361243307590485]),A(tt.getInitialParameters(r,o),[-.1868094652891159,1.5599596500396729]),A(et.getInitialParameters(i,s),[-5,100]),A(nt.getInitialParameters(a,l),[100,-2]),A(rt.getInitialParameters(u,c),[.1,-1,4,4]);const f=new Float32Array(null===(t=$.parameters)||void 0===t?void 0:t.length);f.set($.parameters),C(Q.y(f,1.1),1.6914214561555851),C(tt.y(tt.getInitialParameters(r,o),1.1),1.3544692382216454),C(et.y(et.getInitialParameters(i,s),1.1),96.29031327635312),C(nt.y(nt.getInitialParameters(a,l),1.1),11.080315836233387),C(rt.y(rt.getInitialParameters(u,c),1.1),7.3231)})))),_("getCurve",(()=>U(void 0,void 0,void 0,(function*(){const t=(0,j._T)($,Q),e=(0,j._T)(z,tt),n=(0,j._T)(K,et),r=(0,j._T)(Z,nt),o=(0,j._T)(J,rt);C(t(2.5),1.690786623428712),C(t(5.8858),.5356638447565519),C(e(2.5),-3.18454647064209),C(e(5.8858),-21.658870516967774),C(n(2.5),79.85176680360948),C(n(5.8858),74.12932588432805),C(r(.01),79.68277758636006),C(r(1345e-8),88.4439865528934),C(o(1.56),7.650264639782428),C(o(3.99876),6.093284856699922)})))),_("fitSeries",(()=>U(void 0,void 0,void 0,(function*(){const t=Date.now(),e=(0,j.nT)($,Q),n=(0,j.nT)(z,tt),r=(0,j.nT)(K,et),o=(0,j.nT)(Z,nt),i=(0,j.nT)(J,rt),s=Date.now();return C(e.fittedCurve(2.5),1.7048618582775712),C(n.fittedCurve(2.5),1.5337481647729874),C(r.fittedCurve(2.5),1.4879121793209378),C(o.fittedCurve(1345e-8),2.739771889293024),C(i.fittedCurve(3.99876),6.449473383870631),A(e.parameters,[1.7049071788787842,1.569833517074585,5.36868143081665,.2605934143066406]),A(n.parameters,[-.21358928084373474,2.067721366882324]),A(r.parameters,[-1.1107122898101807,2.879371404647827]),A(o.parameters,[2.739849090576172,-2.0949888229370117]),A(i.parameters,[.05000000074505806,-.887523889541626,2.861894130706787,6]),s.valueOf()-t.valueOf()+" ms"})))),_("getSeriesConfidenceInterval",(()=>U(void 0,void 0,void 0,(function*(){const t=(0,j.fY)($,Q,!0),e=(0,j.fY)(z,tt,!0),n=(0,j.fY)(K,et,!0),r=(0,j.fY)(Z,nt,!0),o=(0,j.fY)(J,rt,!0);C(t.confidenceTop(2.578),1.8540855269320198),C(e.confidenceTop(2.578),26.645777275332037),C(n.confidenceTop(2.578),231.75768109324696),C(r.confidenceTop(1345e-8),103.51168317113999),C(o.confidenceTop(2.3342),10.03522960294218),C(t.confidenceBottom(3.987),1.4949306416468298),C(e.confidenceBottom(3.987),-41.55415698266847),C(n.confidenceBottom(3.987),-75.23471085303483),C(r.confidenceBottom(.01),64.61508096811347),C(o.confidenceBottom(3.8796),4.1686506915250385)})))),_("getSeriesStatistics",(()=>U(void 0,void 0,void 0,(function*(){const t=(0,j.VA)($,Q),e=(0,j.VA)(J,rt);C(t.auc,9.335422628533761),C(e.auc,36.525538394763096),C(t.rSquared,.9781915962461156),C(e.rSquared,.846055768956569)})))),_("calculateBoxPlotStatistics",(()=>U(void 0,void 0,void 0,(function*(){const t=(0,W.k)([.7654603719711304,.8199243545532227,.8257747292518616,.9558155536651611,.9596694707870483]);C(t.q1,.8199243545532227),C(t.q2,.8257747292518616),C(t.q3,.9558155536651611),C(t.lowerAdjacentValue,.7654603719711304),C(t.upperAdjacentValue,.9558155536651611)})))),_("sigmoid",(()=>U(void 0,void 0,void 0,(function*(){const t=new Float32Array(4);t.set([2.612687371569039,-1.421800778574126,5.16688669906018,.341788492203575]),C((0,q.ry)(t,.5),.341789026340178),C((0,q.ry)(t,2.5),.34215523020636207),C((0,q.ry)(t,5.678976),2.2548815999597016)})))),_("linear",(()=>U(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([-5.12346546,6.24654654]),C((0,q.sn)(t,.5),3.684813976287842),C((0,q.sn)(t,2.5),-6.562117099761963),C((0,q.sn)(t,5.678976),-22.849491081970214)})))),_("log-linear",(()=>U(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([-5.12346546,91.5465454654]),C((0,q.AJ)(t,.5),89.46916042777144),C((0,q.AJ)(t,2.5),85.12805903963536),C((0,q.AJ)(t,5.678976),81.81726682791052)})))),_("exponential",(()=>U(void 0,void 0,void 0,(function*(){const t=new Float32Array(2);t.set([95.12346546,-11.5465454654]),C((0,q.EV)(t,5e-4),94.57587501550823),C((0,q.EV)(t,.5),.2957925783034655),C((0,q.EV)(t,.98746),.0010630898492656174)}))))}));var ot=function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function s(t){try{l(r.next(t))}catch(t){i(t)}}function a(t){try{l(r.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((r=r.apply(t,e||[])).next())}))};const it=new t.Package;function st(e,n,r){return ot(this,void 0,void 0,(function*(){const o=yield S({category:e,test:n,testContext:r});return t.DataFrame.fromObjects(o)}))}})(),curves_test=r})();
|
|
1
|
+
var curves_test;(()=>{var e={368:(e,t,n)=>{"use strict";function o(e){e.sort();const t=e[Math.trunc(e.length/4)],n=e.length%2==0?(e[Math.trunc(e.length/2)]+e[Math.trunc(e.length/2)-1])/2:e[Math.trunc(e.length/2)],o=e[Math.trunc(3*e.length/4)],i=1.5*(o-t);let s=r(e,o+i);s<0&&(s=~s);let a=e[Math.max(0,s-1)];a<o&&(a=o);let l=r(e,t-i);l<0&&(l=~l);let u=e[l];return u>t&&(u=t),{q1:t,q2:n,q3:o,lowerAdjacentValue:u,upperAdjacentValue:a}}function r(e,t,n=0,o){if(0===e.length)return-1;if(void 0===o&&(o=e.length-1),t<e[n])return-1;if(t>e[o])return-(o+1);for(;o-n>1;){const r=Math.trunc((o+n)/2);if(t===e[r])return r;t<e[r]?o=r:n=r}return e[n]===t?n:0===e[o]?o:t<e[n]?-(n+1):-(o+1)}n.d(t,{k:()=>o})},71:(e,t,n)=>{"use strict";n.d(t,{kC:()=>E,Pf:()=>b,Ff:()=>_,kx:()=>I,G7:()=>T,oH:()=>p,dZ:()=>h,EV:()=>D,xs:()=>C,W6:()=>A,IL:()=>w,Sm:()=>F,Mi:()=>X,O8:()=>O,Hr:()=>k,ah:()=>S,TV:()=>N,mW:()=>P,sn:()=>R,AJ:()=>M,ry:()=>L,nK:()=>x});var o,r=n(82),i=n(572);class s extends Error{constructor(e){super(e)}}function a(e,t,n,o){for(let r=0;r<t;r++){let i=0;for(let e=0;e<t+1;e++)e!==n&&(i+=o[e][r]);e[r]=i/t}}function l(e,t,n,o,r,i,s,a){for(let l=0;l<i;l++)t[l]=e[l],t[l]+=r*(e[l]-o[n][l]),t[l]<s[l]?t[l]=s[l]:t[l]>a[l]&&(t[l]=a[l])}!function(e){e[e.TOLERANCE=.01]="TOLERANCE",e[e.MAX_ITER=30]="MAX_ITER",e[e.NON_ZERO_PARAM=1e-4]="NON_ZERO_PARAM",e[e.INITIAL_SCALE=.02]="INITIAL_SCALE",e[e.SCALE_REFLECTION=1]="SCALE_REFLECTION",e[e.SCALE_EXPANSION=2]="SCALE_EXPANSION",e[e.SCALE_CONTRACTION=-.5]="SCALE_CONTRACTION"}(o||(o={})),new Map([["tolerance","Tolerance"],["maxIter","Max iterations"],["nonZeroParam","Non-zero param"],["initialScale","Initial scale"],["scaleReflection","Scale reflection"],["scaleExpansion","Scale expansion"],["scaleContraction","Scale contraction"]]);const u=function(e,t,n,o,r){const i=n.tolerance,s=n.maxIter,u=n.scaleReflection,c=n.scaleExpansion,d=n.scaleContraction,f=t.length+1,m=t.length,[h,p]=function(e,t,n,o,r){const i=n.length+1,s=n.length,a=t.nonZeroParam,l=t.initialScale,u=new Array(i),c=new Array(i);for(let t=0;t<i;t++){u[t]=new Float32Array(s);for(let e=0;e<s;e++)u[t][e]=n[e],0!==t&&t-1===e&&(0===n[e]?u[t][e]=a:u[t][e]+=l*n[t-1],u[t][e]<o[e]?u[t][e]=o[e]:u[t][e]>r[e]&&(u[t][e]=r[e]));c[t]=e(u[t]).likelihood}return[u,c]}(e,n,t,o,r),g=new Array(f);for(let e=0;e<f;e++)g[e]=e;const v=g.length-1;let y=0,x=0,C=0,w=0;const T=new Float32Array(m),_=new Float32Array(m),I=new Float32Array(m),b=new Float32Array(m),E=new Array(s);if(f>1){for(;g.sort(((e,t)=>p[e]-p[t])),!(y>s);){if(0===y&&(x=p[0],C=2*p[g[0]]),E[y]=x,++y,x=p[g[0]],C-x>i)w=0;else if(++w,w>2*f)break;C=x,a(T,m,g[v],h),l(T,_,g[v],h,u,m,o,r);const t=e(_).likelihood;if(t<p[g[v]]){l(T,I,g[v],h,c,m,o,r);const n=e(I).likelihood;if(n<t){p[g[v]]=n;for(let e=0;e<m;e++)h[g[v]][e]=I[e];continue}p[g[v]]=t;for(let e=0;e<m;e++)h[g[v]][e]=_[e];continue}l(T,b,g[v],h,d,m,o,r);const n=e(b).likelihood;if(!(n<p[g[v]]))break;p[g[v]]=n;for(let e=0;e<m;e++)h[g[v]][e]=b[e]}for(let e=y;e<s;e++)E[e]=p[g[0]]}return{point:h[g[0]],cost:p[g[0]],iterCosts:E,iterCount:y-1}};var c=n(391),d=n.n(c);function f(e,t,n,o){const r=t-n,i=new Array(e);for(let t=0;t<e;t++){const e=o();i[t]=n+e*r}return i}function m(e,t,n,o,i=1,a=null,l=!0){const c=function(e,t,n){const o=d()("12345"),r=t.length,i=new Array(e);for(let t=0;t<e;t++)i[t]=new Float32Array(r);for(let s=0;s<r;s++)if(t[s]===n[s])for(let n=0;n<e;n++)i[n][s]=t[s];else{const r=f(e,t[s],n[s],o);for(let t=0;t<e;t++)i[t][s]=r[t]}return i}(i,n,t),m=[],h=[],p=[];let g,v=0,y=null;for(g=0;g<i;++g)try{if(0===g&&l){const t=null===a?c[g]:a,n=new Float32Array(a.length).map((e=>-1/0)),r=new Float32Array(a.length).map((e=>1/0));m.push(u(e,t,o,n,r))}else m.push(u(e,c[g],o,t,n))}catch(e){if(e instanceof s)throw new Error(`Inconsistent dataframes: ${e.message}`);++v,h.push(e instanceof Error?e.message:"Platform issue"),p.push(c[g])}if(v>0){const e=n.length,t=new Array(e);for(let n=0;n<e;++n)t[n]=new Float32Array(v);p.forEach(((e,n)=>e.forEach(((e,o)=>t[o][n]=e)))),y=r.DataFrame.fromColumns(t.map(((e,t)=>r.Column.fromFloat32Array(`arg${t}`,e)))),y.columns.add(r.Column.fromStrings("Issue",h))}return{extremums:m,fails:y}}const h={CONSTANT:"constant",PROPORTIONAL:"proportional",COMBINED:"combined"};class p{constructor(){this.chartOptions={},this.seriesOptions={},this.series=[]}}class g{}class v extends g{constructor(e,t,n,o){super(),this._name=e,this._parameterNames=o,this.y=t,this.getInitialParameters=n}get name(){return this._name}get parameterNames(){return this._parameterNames}y(e,t){throw new Error("Not implemented")}getInitialParameters(e,t){throw new Error("Not implemented")}}const y={linear:new class extends g{get name(){return _}get parameterNames(){return["Slope","Intercept"]}y(e,t){return R(e,t)}getInitialParameters(e,t){let n=0,o=0;for(let t=1;t<e.length;t++)e[t]<e[n]&&(n=t),e[t]>e[o]&&(o=t);const r=e[o]-e[n],i=(t[o]-t[n])/r,s=t[o]-i*e[o],a=new Float32Array(2);return a.set([i,s]),a}},sigmoid:new class extends g{get name(){return T}get parameterNames(){return["Top","Slope","IC50","Bottom"]}y(e,t){return L(e,t)}getInitialParameters(e,t){const n=r.Rect.fromXYArrays(e,t),o=(n.maxY-n.minY)/2+n.minY;let i=n.maxY-n.minY,s=0;for(let n=0;n<e.length;n++){const e=Math.abs(t[n]-o);e<i&&(i=e,s=n)}const a=e[s],l=t[0]>t[t.length-1]?1:-1,u=new Float32Array(4);return u.set([n.maxY,l,a,n.minY]),u}},"log-linear":new class extends g{get name(){return I}get parameterNames(){return["Slope","Intercept"]}y(e,t){return M(e,t)}getInitialParameters(e,t){const n=new Float32Array(2);return n.set([-5,100]),n}},exponential:new class extends g{get name(){return b}get parameterNames(){return["Mantissa","Power"]}y(e,t){return D(e,t)}getInitialParameters(e,t){const n=new Float32Array(2);return n.set([100,-2]),n}},"4pl-regression":new class extends g{get name(){return E}get parameterNames(){return["Top","Slope","EC50","Bottom"]}y(e,t){return F(e,t)}getInitialParameters(e,t){const n=new Float32Array(4),o=Math.min(...t),r=Math.max(...t),i=(r-o)/2+o;let s=r-o,a=0;for(let n=0;n<e.length;n++){const e=Math.abs(t[n]-i);e<s&&(s=e,a=n)}const l=e[a],u=t[0]>t[t.length-1]?-10:10;return n.set([r,u,l,o]),n}}},x=[r.Property.js("rSquared",r.TYPE.FLOAT,{userEditable:!1}),r.Property.js("auc",r.TYPE.FLOAT,{userEditable:!1,friendlyName:"AUC"}),r.Property.js("interceptY",r.TYPE.FLOAT,{userEditable:!1}),r.Property.js("interceptX",r.TYPE.FLOAT,{userEditable:!1}),r.Property.js("slope",r.TYPE.FLOAT,{userEditable:!1}),r.Property.js("top",r.TYPE.FLOAT,{userEditable:!1,friendlyName:"Max Y"}),r.Property.js("bottom",r.TYPE.FLOAT,{userEditable:!1,friendlyName:"Min Y"})],C=[r.Property.js("minX",r.TYPE.FLOAT,{nullable:!0}),r.Property.js("minY",r.TYPE.FLOAT,{nullable:!0}),r.Property.js("maxX",r.TYPE.FLOAT,{nullable:!0}),r.Property.js("maxY",r.TYPE.FLOAT,{nullable:!0}),r.Property.js("title",r.TYPE.STRING,{nullable:!0}),r.Property.js("xAxisName",r.TYPE.STRING,{description:"Label to show on the X axis. If not specified, corresponding data column name is used",nullable:!0}),r.Property.js("yAxisName",r.TYPE.STRING,{description:"Label to show on the Y axis. If not specified, corresponding data column name is used",nullable:!0}),r.Property.js("logX",r.TYPE.BOOL,{description:"Whether the X axis should be logarithmic",defaultValue:!1}),r.Property.js("logY",r.TYPE.BOOL,{description:"Whether the Y axis should be logarithmic",defaultValue:!1}),r.Property.js("allowXZeroes",r.TYPE.BOOL,{description:"Whether x zeroes allowed for logarithmic data or not",defaultValue:!0}),r.Property.js("mergeSeries",r.TYPE.BOOL,{description:"Merges all series within one cell into one series",defaultValue:!1}),r.Property.js("showColumnLabel",r.TYPE.BOOL,{description:"Whether to show the column label in the legend or not",defaultValue:!1}),r.Property.js("showStatistics",r.TYPE.STRING_LIST,{description:"Whether specific statistics should be rendered",choices:x.map((e=>e.name)),inputType:"MultiChoice",friendlyName:"Statistics"})],w=[r.Property.js("fitFunction",r.TYPE.STRING,{category:"Fitting",choices:Object.keys(y),defaultValue:"sigmoid"}),r.Property.js("pointColor",r.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),r.Property.js("fitLineColor",r.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),r.Property.js("outlierColor",r.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),r.Property.js("errorModel",r.TYPE.STRING,{category:"Fitting",defaultValue:"constant",choices:["constant","proportional","combined"],nullable:!1}),r.Property.js("connectDots",r.TYPE.BOOL,{category:"Fitting",defaultValue:!1}),r.Property.js("clickToToggle",r.TYPE.BOOL,{category:"Fitting",description:"Click on a point to mark it as outlier and refit",nullable:!0,defaultValue:!1}),r.Property.js("showFitLine",r.TYPE.BOOL,{category:"Fitting",defaultValue:!0}),r.Property.js("showPoints",r.TYPE.STRING,{category:"Fitting",description:"Whether points/candlesticks/none should be rendered",defaultValue:"points",choices:["points","candlesticks","both"]}),r.Property.js("showCurveConfidenceInterval",r.TYPE.BOOL,{category:"Fitting",description:"Whether confidence intervals should be rendered",defaultValue:!1,friendlyName:"Confidence Interval"}),r.Property.js("markerType",r.TYPE.STRING,{category:"Rendering",defaultValue:"circle",choices:["asterisk","circle","cross border","diamond","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Marker"}),r.Property.js("outlierMarkerType",r.TYPE.STRING,{category:"Rendering",defaultValue:"outlier",choices:["asterisk","circle","cross border","diamond","outlier","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1,friendlyName:"Outlier Marker"}),r.Property.js("lineStyle",r.TYPE.STRING,{category:"Rendering",defaultValue:"solid",choices:["solid","dotted","dashed","dashdotted"],nullable:!1}),r.Property.js("droplines",r.TYPE.STRING_LIST,{description:"Whether specific droplines should be rendered",choices:["IC50"],inputType:"MultiChoice"}),r.Property.js("columnName",r.TYPE.STRING,{description:"Column name where the series is stored",defaultValue:""})],T="sigmoid",_="linear",I="log-linear",b="exponential",E="4pl-regression";function N(e){if("string"==typeof e)return y[e];if(!y[e.name]){const t=e.name,n=e.parameterNames,o=e.function.split("=>").map((e=>e.trim())),r=e.getInitialParameters.split("=>").map((e=>e.trim())),i=new Function(o[0].slice(1,o[0].length-1),`${o[1].includes(";")?"":"return "}${o[1]}`),s=new Function(r[0].slice(1,r[0].length-1),`return ${r[1]}`),a=new v(t,i,s,n);y[t]=a}return y[e.name]}function A(e,t,n,i){null!=n||(n=h.CONSTANT);const s=t.y;let a=t.getInitialParameters(e.x,e.y);const l=function(e,t,n){return o=>{let r=0,i=0,s=0;const a=t.y,l=t.x.map((t=>e(o,t))),u=a.map(((e,t)=>e-l[t])),c=u.map((e=>Math.pow(e,2)));for(let e=0;e<c.length;e++)[h.CONSTANT,h.COMBINED].includes(n)?i+=c[e]:n===h.PROPORTIONAL&&(s+=c[e]/(l[e]*l[e]));i=Math.sqrt(i/c.length),s=Math.sqrt(s/c.length),n===h.COMBINED&&({sigmaA:i,sigmaB:s}=Y(i,s,c,l));const d=[];for(let e=0;e<c.length;e++)d[e]=Math.pow(i+s*l[e],2),r+=c[e]/d[e]+Math.log(2*Math.PI*d[e]);return{likelihood:r,residuals:u}}}(s,e,n),u=new Float32Array(t.parameterNames.length),c=new Float32Array(t.parameterNames.length);for(let e=0;e<t.parameterNames.length;e++)u[e]=0===a[e]?-1:a[e]-Math.abs(.5*a[e]),c[e]=0===a[e]?1:a[e]+Math.abs(.5*a[e]);const d=r.BitSet.create(2*t.parameterNames.length);if(i&&0!==i.length)for(let e=0;e<i.length;e++)void 0!==i[e].min&&null!==i[e].min&&(u[e]=i[e].min,d.set(2*e,!0)),void 0!==i[e].max&&null!==i[e].max&&(c[e]=i[e].max,d.set(2*e+1,!0));const f=e=>{const t=l(e.point).residuals;let n=0,o=0;for(let e=0;e<t.length;e++)t.length/4>e?n+=Math.pow(t[e],2):3*t.length/4>e?o+=Math.pow(t[e],2):n+=Math.pow(t[e],2);return n/o};let p,g=-1,v=0,y=null,x=0;for(;;){p=m(l,u,c,{tolerance:o.TOLERANCE,maxIter:o.MAX_ITER,nonZeroParam:o.NON_ZERO_PARAM,initialScale:o.INITIAL_SCALE,scaleReflection:o.SCALE_REFLECTION,scaleExpansion:o.SCALE_EXPANSION,scaleContraction:o.SCALE_CONTRACTION},10,a),x=0;for(let e=1;e<p.extremums.length;e++)p.extremums[e].cost<p.extremums[x].cost&&(x=e);const e=f(p.extremums[x]);if(null===y?y=e:e<y?(y=e,v=0):v++,a=p.extremums[x].point,g>40||3===v)break;for(let e=0;e<t.parameterNames.length;e++)d.get(2*e)||(u[e]=a[e]-Math.abs(a[e]*(v+.5))),d.get(2*e+1)||(c[e]=a[e]+Math.abs(a[e]*(v+.5)));g++}return{fittedCurve:S(s,a),parameters:a}}function S(e,t){return n=>e(t,n)}function O(e,t,n,o=.05,r){const s=function(e,t,n,o){let r=0,i=0;const s=t.y,a=t.x.map((t=>e(o,t))),l=s.map(((e,t)=>e-a[t])),u=l.map((e=>Math.pow(e,2)));for(let e=0;e<u.length;e++)[h.CONSTANT,h.COMBINED].includes(n)?r+=u[e]:n===h.PROPORTIONAL&&(i+=Math.pow(l[e]/Math.abs(a[e]),2));return r=Math.sqrt(r/u.length),i=Math.sqrt(i/u.length),n===h.COMBINED&&({sigmaA:r,sigmaB:i}=Y(r,i,u,a)),{sigmaA:r,sigmaB:i}}(n,e,r,t),a=i.normal.inv(1-o/2,0,1);return{confidenceTop:e=>{const o=n(t,e);return o+a*(s.sigmaA+Math.abs(o)*s.sigmaB)},confidenceBottom:e=>{const o=n(t,e);return o-a*(s.sigmaA+Math.abs(o)*s.sigmaB)}}}function P(e,t,n,o=!0){const r=S(n,t);return{rSquared:o?k(r,e):void 0,auc:o?X(r,e):void 0,interceptX:t[2],interceptY:r(t[2]),slope:t[1],top:t[0],bottom:t[3]}}function L(e,t){const n=e[0],o=e[1],r=e[2],i=e[3];return i+(n-i)/(1+Math.pow(10,(t-r)*o))}function R(e,t){return e[0]*t+e[1]}function M(e,t){const n=e[0],o=e[1];return n*Math.log(t+1)+o}function D(e,t){const n=e[0],o=e[1];return n*Math.exp(t*o)}function F(e,t){const n=e[0],o=e[1],r=e[2],i=e[3];return i+(n-i)/(1+Math.pow(t/r,o))}function X(e,t){let n=0;const o=Math.min(...t.x),r=Math.max(...t.x),i=(r-o)/1e3;for(let t=o;t<r;t+=i)n+=i*e(t);return n}function k(e,t){let n=0,o=0;const r=i.mean(t.y);for(let i=0;i<t.x.length;i++)n+=Math.pow(t.y[i]-e(t.x[i]),2),o+=Math.pow(t.y[i]-r,2);return 1-n/o}function Y(e,t,n,o){let r=Number.MAX_VALUE,i=0;for(let t=0;t<=10;t++){let s=0;const a=t/10,l=e*a,u=e*(1-a),c=[];for(let e=0;e<n.length;e++)c[e]=Math.pow(l+u*o[e],2),s+=n[e]/c[e]+Math.log(2*Math.PI*c[e]);s<r&&(r=s,i=a)}return t=e*(1-i),{sigmaA:e*=i,sigmaB:t}}},999:(e,t,n)=>{"use strict";n.d(t,{Kh:()=>s,Sm:()=>f,VA:()=>p,W$:()=>a,_T:()=>d,fY:()=>h,nT:()=>m,s$:()=>u,zB:()=>c});var o=n(82),r=n(71);function i(e){const t={};for(const n of e)null!==n.defaultValue&&(t[n.name]=n.defaultValue);return t}function s(){return{chartOptions:i(r.xs),seriesOptions:i(r.IL)}}function a(e){const t=[],n=[];for(let o=0;o<e.length;o++)t[o]=e[o].x,n[o]=e[o].y;return{xs:t,ys:n}}function l(e){const t=Math.floor(e.y.length/2),n=e.y.sort(((e,t)=>e-t));return n.length%2==0?(n[t-1]+n[t])/2:n[t]}function u(e){var t;const n=e.chartOptions;if((null===(t=e.series)||void 0===t?void 0:t.length)&&0!==e.series.length){const{xs:t,ys:r}=a(e.series[0].points);let i=o.Rect.fromXYArrays(t,r);for(let t=1;t<e.series.length;t++){const{xs:n,ys:r}=a(e.series[t].points);n.some((e=>void 0===e))||r.some((e=>void 0===e))||(i=i.union(o.Rect.fromXYArrays(n,r)))}return n?function(e,t){let n=e.x,r=e.y,i=e.width,s=e.height;return void 0!==t.minX&&null!==t.minX&&(!t.logX||t.logX&&t.minX>0)&&(i+=n-t.minX,n=t.minX),void 0!==t.maxX&&null!==t.maxX&&(!t.logX||t.logX&&t.maxX>0)&&(i+=t.maxX-(n+i)),void 0!==t.minY&&null!==t.minY&&(!t.logY||t.logY&&t.minY>0)&&(s+=r-t.minY,r=t.minY),void 0!==t.maxY&&null!==t.maxY&&(!t.logY||t.logY&&t.maxY>0)&&(s+=t.maxY-(r+s)),new o.Rect(n,r,i,s)}(i,n):i}return new o.Rect(0,0,1,1)}function c(e){return(0,r.TV)(e.fitFunction)}function d(e,t){var n;const o=new Float32Array(null===(n=e.parameters)||void 0===n?void 0:n.length);return o.set(e.parameters),(0,r.ah)(t.y,o)}function f(e,t,n){const o=n?e.points:e.points.filter((e=>!e.outlier));return{x:o.map((e=>(null==t?void 0:t.logX)?Math.log10(e.x):e.x)),y:o.map((e=>(null==t?void 0:t.logY)?Math.log10(e.y):e.y))}}function m(e,t,n,o){var i,s;return null!=n||(n=f(e,o,!1)),e.parameterBounds&&(null==o?void 0:o.logX)&&(e.parameterBounds[2]=((s=e.parameterBounds[2])&&(void 0!==s.max&&(s.max=Math.log10(s.max)),void 0!==s.min&&(s.min=0===s.min?-Number.MAX_VALUE:Math.log10(s.min))),s)),(0,r.W6)(function(e){const t={x:[],y:[]},n={x:[e.x[0]],y:[e.y[0]]};for(let o=1;o<e.x.length;o++){if(e.x[o]===n.x[0]){n.x[n.x.length]=e.x[o],n.y[n.y.length]=e.y[o];continue}const r=l(n);t.x[t.x.length]=n.x[0],t.y[t.y.length]=r,n.x=[e.x[o]],n.y=[e.y[o]]}const o=l(n);return t.x[t.x.length]=n.x[0],t.y[t.y.length]=o,t}(n),t,null!==(i=e.errorModel)&&void 0!==i?i:r.dZ.CONSTANT,e.parameterBounds)}function h(e,t,n,o,i){var s,a;if(null!=o||(o=f(e,i,n)),!e.parameters){const n=m(e,t,o).parameters;e.parameters=[...n]}const l=new Float32Array(null===(s=e.parameters)||void 0===s?void 0:s.length);return l.set(e.parameters),(0,r.O8)(o,l,t.y,.05,null!==(a=e.errorModel)&&void 0!==a?a:r.dZ.CONSTANT)}function p(e,t,n,o){var i;if(null!=n||(n=f(e,o,!1)),!e.parameters){const o=m(e,t,n).parameters;e.parameters=[...o]}const s=new Float32Array(null===(i=e.parameters)||void 0===i?void 0:i.length);return s.set(e.parameters),(0,r.mW)(n,s,t.y,!0)}},293:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var o=n(82);const r=1e-30,i=new class{screenToWorld(e,t,n,o,r){return n+(r?1-e/t:e/t)*(o-n)}worldToScreen(e,t,n,o,r){return r?(1-(e-n)/(o-n))*t:(e-n)/(o-n)*t}},s=new class{screenToWorld(e,t,n,o,i){n=n<r?r:n;const s=Math.log(o),a=Math.log(n);return Math.exp(a+(s-a)*(i?t-e:e)/t)}worldToScreen(e,t,n,o,i){if(e<=0)return NaN;if(Math.abs(e-n)<r)return i?t:0;if(Math.abs(e-o)<r)return i?0:t;n=n<r?r:n,e=e<r?r:e;const s=t*Math.log(e/n)/Math.log(o/n);return i?t-s:s}};class a{get xt(){return this.logX?s:i}get yt(){return this.logY?s:i}constructor(e,t,n=!1,o=!1){this.logX=!1,this.logY=!1,this.inverseX=!1,this.inverseY=!1,this.world=e,this.screen=t,this.logX=n,this.logY=o}xToScreen(e){return this.screen.left+this.xt.worldToScreen(e,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToScreen(e){return this.screen.top+this.yt.worldToScreen(e,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}xToWorld(e){return this.xt.screenToWorld(e-this.screen.left,this.screen.width,this.world.minX,this.world.maxX,this.inverseX)}yToWorld(e){return this.yt.screenToWorld(e-this.screen.top,this.screen.height,this.world.minY,this.world.maxY,!this.inverseY)}toScreen(e){return new o.Point(this.xToScreen(e.x),this.yToScreen(e.y))}toWorld(e){return new o.Point(this.xToWorld(e.x),this.yToWorld(e.y))}drawCoordinateGrid(e,t,n){t&&o.Paint.horzAxis(e,this.world.minX,this.world.maxX,t.x,t.y,t.width,t.height,this.logX,this.inverseX),n&&o.Paint.vertAxis(e,this.world.minY,this.world.maxY,n.x,n.y,n.width,n.height,this.logY,this.inverseY)}}},982:function(e,t,n){var o;!function(){var t={};!function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(e,n,o,r,i){for(var s,a,l,u,c,d,f,m,h,p,g,v,y;i>=64;){for(s=n[0],a=n[1],l=n[2],u=n[3],c=n[4],d=n[5],f=n[6],m=n[7],p=0;p<16;p++)g=r+4*p,e[p]=(255&o[g])<<24|(255&o[g+1])<<16|(255&o[g+2])<<8|255&o[g+3];for(p=16;p<64;p++)v=((h=e[p-2])>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,y=((h=e[p-15])>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,e[p]=(v+e[p-7]|0)+(y+e[p-16]|0);for(p=0;p<64;p++)v=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&d^~c&f)|0)+(m+(t[p]+e[p]|0)|0)|0,y=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,m=f,f=d,d=c,c=u+v|0,u=l,l=a,a=s,s=v+y|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=u,n[4]+=c,n[5]+=d,n[6]+=f,n[7]+=m,r+=64,i-=64}return r}var o=function(){function t(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return t.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},t.prototype.clean=function(){for(var e=0;e<this.buffer.length;e++)this.buffer[e]=0;for(e=0;e<this.temp.length;e++)this.temp[e]=0;this.reset()},t.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var o=0;if(this.bytesHashed+=t,this.bufferLength>0){for(;this.bufferLength<64&&t>0;)this.buffer[this.bufferLength++]=e[o++],t--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(t>=64&&(o=n(this.temp,this.state,e,o,t),t%=64);t>0;)this.buffer[this.bufferLength++]=e[o++],t--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,o=this.bufferLength,r=t/536870912|0,i=t<<3,s=t%64<56?64:128;this.buffer[o]=128;for(var a=o+1;a<s-8;a++)this.buffer[a]=0;this.buffer[s-8]=r>>>24&255,this.buffer[s-7]=r>>>16&255,this.buffer[s-6]=r>>>8&255,this.buffer[s-5]=r>>>0&255,this.buffer[s-4]=i>>>24&255,this.buffer[s-3]=i>>>16&255,this.buffer[s-2]=i>>>8&255,this.buffer[s-1]=i>>>0&255,n(this.temp,this.state,this.buffer,0,s),this.finished=!0}for(a=0;a<8;a++)e[4*a+0]=this.state[a]>>>24&255,e[4*a+1]=this.state[a]>>>16&255,e[4*a+2]=this.state[a]>>>8&255,e[4*a+3]=this.state[a]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t<this.state.length;t++)e[t]=this.state[t]},t.prototype._restoreState=function(e,t){for(var n=0;n<this.state.length;n++)this.state[n]=e[n];this.bytesHashed=t,this.finished=!1,this.bufferLength=0},t}();e.Hash=o;var r=function(){function e(e){this.inner=new o,this.outer=new o,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var t=new Uint8Array(this.blockSize);if(e.length>this.blockSize)(new o).update(e).finish(t).clean();else for(var n=0;n<e.length;n++)t[n]=e[n];for(n=0;n<t.length;n++)t[n]^=54;for(this.inner.update(t),n=0;n<t.length;n++)t[n]^=106;for(this.outer.update(t),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<t.length;n++)t[n]=0}return e.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},e.prototype.clean=function(){for(var e=0;e<this.istate.length;e++)this.ostate[e]=this.istate[e]=0;this.inner.clean(),this.outer.clean()},e.prototype.update=function(e){return this.inner.update(e),this},e.prototype.finish=function(e){return this.outer.finished?this.outer.finish(e):(this.inner.finish(e),this.outer.update(e,this.digestLength).finish(e)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e}();function i(e){var t=(new o).update(e),n=t.digest();return t.clean(),n}function s(e,t){var n=new r(e).update(t),o=n.digest();return n.clean(),o}function a(e,t,n,o){var r=o[0];if(0===r)throw new Error("hkdf: cannot expand more");t.reset(),r>1&&t.update(e),n&&t.update(n),t.update(o),t.finish(e),o[0]++}e.HMAC=r,e.hash=i,e.default=i,e.hmac=s;var l=new Uint8Array(e.digestLength);e.hkdf=function(e,t,n,o){void 0===t&&(t=l),void 0===o&&(o=32);for(var i=new Uint8Array([1]),u=s(t,e),c=new r(u),d=new Uint8Array(c.digestLength),f=d.length,m=new Uint8Array(o),h=0;h<o;h++)f===d.length&&(a(d,c,n,i),f=0),m[h]=d[f++];return c.clean(),d.fill(0),i.fill(0),m},e.pbkdf2=function(e,t,n,o){for(var i=new r(e),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),u=new Uint8Array(s),c=new Uint8Array(o),d=0;d*s<o;d++){var f=d+1;a[0]=f>>>24&255,a[1]=f>>>16&255,a[2]=f>>>8&255,a[3]=f>>>0&255,i.reset(),i.update(t),i.update(a),i.finish(u);for(var m=0;m<s;m++)l[m]=u[m];for(m=2;m<=n;m++){i.reset(),i.update(u).finish(u);for(var h=0;h<s;h++)l[h]^=u[h]}for(m=0;m<s&&d*s+m<o;m++)c[d*s+m]=l[m]}for(d=0;d<s;d++)l[d]=u[d]=0;for(d=0;d<4;d++)a[d]=0;return i.clean(),c}}(t);var r=t.default;for(var i in t)r[i]=t[i];"object"==typeof e.exports?e.exports=r:void 0===(o=function(){return r}.call(t,n,t,e))||(e.exports=o)}()},572:function(e){var t;e.exports=(t=function(e,t){var n=Array.prototype.concat,o=Array.prototype.slice,r=Object.prototype.toString;function i(t,n){var o=t>n?t:n;return e.pow(10,17-~~(e.log(o>0?o:-o)*e.LOG10E))}var s=Array.isArray||function(e){return"[object Array]"===r.call(e)};function a(e){return"[object Function]"===r.call(e)}function l(e){return"number"==typeof e&&e-e==0}function u(){return new u._init(arguments)}function c(){return 0}function d(){return 1}function f(e,t){return e===t?1:0}u.fn=u.prototype,u._init=function(e){if(s(e[0]))if(s(e[0][0])){a(e[1])&&(e[0]=u.map(e[0],e[1]));for(var t=0;t<e[0].length;t++)this[t]=e[0][t];this.length=e[0].length}else this[0]=a(e[1])?u.map(e[0],e[1]):e[0],this.length=1;else if(l(e[0]))this[0]=u.seq.apply(null,e),this.length=1;else{if(e[0]instanceof u)return u(e[0].toArray());this[0]=[],this.length=1}return this},u._init.prototype=u.prototype,u._init.constructor=u,u.utils={calcRdx:i,isArray:s,isFunction:a,isNumber:l,toVector:function(e){return n.apply([],e)}},u._random_fn=e.random,u.setRandom=function(e){if("function"!=typeof e)throw new TypeError("fn is not a function");u._random_fn=e},u.extend=function(e){var t,n;if(1===arguments.length){for(n in e)u[n]=e[n];return this}for(t=1;t<arguments.length;t++)for(n in arguments[t])e[n]=arguments[t][n];return e},u.rows=function(e){return e.length||1},u.cols=function(e){return e[0].length||1},u.dimensions=function(e){return{rows:u.rows(e),cols:u.cols(e)}},u.row=function(e,t){return s(t)?t.map((function(t){return u.row(e,t)})):e[t]},u.rowa=function(e,t){return u.row(e,t)},u.col=function(e,t){if(s(t)){var n=u.arange(e.length).map((function(){return new Array(t.length)}));return t.forEach((function(t,o){u.arange(e.length).forEach((function(r){n[r][o]=e[r][t]}))})),n}for(var o=new Array(e.length),r=0;r<e.length;r++)o[r]=[e[r][t]];return o},u.cola=function(e,t){return u.col(e,t).map((function(e){return e[0]}))},u.diag=function(e){for(var t=u.rows(e),n=new Array(t),o=0;o<t;o++)n[o]=[e[o][o]];return n},u.antidiag=function(e){for(var t=u.rows(e)-1,n=new Array(t),o=0;t>=0;t--,o++)n[o]=[e[o][t]];return n},u.transpose=function(e){var t,n,o,r,i,a=[];for(s(e[0])||(e=[e]),n=e.length,o=e[0].length,i=0;i<o;i++){for(t=new Array(n),r=0;r<n;r++)t[r]=e[r][i];a.push(t)}return 1===a.length?a[0]:a},u.map=function(e,t,n){var o,r,i,a,l;for(s(e[0])||(e=[e]),r=e.length,i=e[0].length,a=n?e:new Array(r),o=0;o<r;o++)for(a[o]||(a[o]=new Array(i)),l=0;l<i;l++)a[o][l]=t(e[o][l],o,l);return 1===a.length?a[0]:a},u.cumreduce=function(e,t,n){var o,r,i,a,l;for(s(e[0])||(e=[e]),r=e.length,i=e[0].length,a=n?e:new Array(r),o=0;o<r;o++)for(a[o]||(a[o]=new Array(i)),i>0&&(a[o][0]=e[o][0]),l=1;l<i;l++)a[o][l]=t(a[o][l-1],e[o][l]);return 1===a.length?a[0]:a},u.alter=function(e,t){return u.map(e,t,!0)},u.create=function(e,t,n){var o,r,i=new Array(e);for(a(t)&&(n=t,t=e),o=0;o<e;o++)for(i[o]=new Array(t),r=0;r<t;r++)i[o][r]=n(o,r);return i},u.zeros=function(e,t){return l(t)||(t=e),u.create(e,t,c)},u.ones=function(e,t){return l(t)||(t=e),u.create(e,t,d)},u.rand=function(e,t){return l(t)||(t=e),u.create(e,t,u._random_fn)},u.identity=function(e,t){return l(t)||(t=e),u.create(e,t,f)},u.symmetric=function(e){var t,n,o=e.length;if(e.length!==e[0].length)return!1;for(t=0;t<o;t++)for(n=0;n<o;n++)if(e[n][t]!==e[t][n])return!1;return!0},u.clear=function(e){return u.alter(e,c)},u.seq=function(e,t,n,o){a(o)||(o=!1);var r,s=[],l=i(e,t),u=(t*l-e*l)/((n-1)*l),c=e;for(r=0;c<=t&&r<n;c=(e*l+u*l*++r)/l)s.push(o?o(c,r):c);return s},u.arange=function(e,n,o){var r,i=[];if(o=o||1,n===t&&(n=e,e=0),e===n||0===o)return[];if(e<n&&o<0)return[];if(e>n&&o>0)return[];if(o>0)for(r=e;r<n;r+=o)i.push(r);else for(r=e;r>n;r+=o)i.push(r);return i},u.slice=function(){function e(e,n,o,r){var i,s=[],a=e.length;if(n===t&&o===t&&r===t)return u.copy(e);if(r=r||1,(n=(n=n||0)>=0?n:a+n)===(o=(o=o||e.length)>=0?o:a+o)||0===r)return[];if(n<o&&r<0)return[];if(n>o&&r>0)return[];if(r>0)for(i=n;i<o;i+=r)s.push(e[i]);else for(i=n;i>o;i+=r)s.push(e[i]);return s}return function(t,n){var o,r;return l((n=n||{}).row)?l(n.col)?t[n.row][n.col]:e(u.rowa(t,n.row),(o=n.col||{}).start,o.end,o.step):l(n.col)?e(u.cola(t,n.col),(r=n.row||{}).start,r.end,r.step):(r=n.row||{},o=n.col||{},e(t,r.start,r.end,r.step).map((function(t){return e(t,o.start,o.end,o.step)})))}}(),u.sliceAssign=function(n,o,r){var i,s;if(l(o.row)){if(l(o.col))return n[o.row][o.col]=r;o.col=o.col||{},o.col.start=o.col.start||0,o.col.end=o.col.end||n[0].length,o.col.step=o.col.step||1,i=u.arange(o.col.start,e.min(n.length,o.col.end),o.col.step);var a=o.row;return i.forEach((function(e,t){n[a][e]=r[t]})),n}if(l(o.col)){o.row=o.row||{},o.row.start=o.row.start||0,o.row.end=o.row.end||n.length,o.row.step=o.row.step||1,s=u.arange(o.row.start,e.min(n[0].length,o.row.end),o.row.step);var c=o.col;return s.forEach((function(e,t){n[e][c]=r[t]})),n}return r[0].length===t&&(r=[r]),o.row.start=o.row.start||0,o.row.end=o.row.end||n.length,o.row.step=o.row.step||1,o.col.start=o.col.start||0,o.col.end=o.col.end||n[0].length,o.col.step=o.col.step||1,s=u.arange(o.row.start,e.min(n.length,o.row.end),o.row.step),i=u.arange(o.col.start,e.min(n[0].length,o.col.end),o.col.step),s.forEach((function(e,t){i.forEach((function(o,i){n[e][o]=r[t][i]}))})),n},u.diagonal=function(e){var t=u.zeros(e.length,e.length);return e.forEach((function(e,n){t[n][n]=e})),t},u.copy=function(e){return e.map((function(e){return l(e)?e:e.map((function(e){return e}))}))};var m=u.prototype;return m.length=0,m.push=Array.prototype.push,m.sort=Array.prototype.sort,m.splice=Array.prototype.splice,m.slice=Array.prototype.slice,m.toArray=function(){return this.length>1?o.call(this):o.call(this)[0]},m.map=function(e,t){return u(u.map(this,e,t))},m.cumreduce=function(e,t){return u(u.cumreduce(this,e,t))},m.alter=function(e){return u.alter(this,e),this},function(e){for(var t=0;t<e.length;t++)!function(e){m[e]=function(t){var n,o=this;return t?(setTimeout((function(){t.call(o,m[e].call(o))})),this):(n=u[e](this),s(n)?u(n):n)}}(e[t])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(e){for(var t=0;t<e.length;t++)!function(e){m[e]=function(t,n){var o=this;return n?(setTimeout((function(){n.call(o,m[e].call(o,t))})),this):u(u[e](this,t))}}(e[t])}("row col".split(" ")),function(e){for(var t=0;t<e.length;t++)!function(e){m[e]=function(){return u(u[e].apply(null,arguments))}}(e[t])}("create zeros ones rand identity".split(" ")),u}(Math),function(e,t){var n=e.utils.isFunction;function o(e,t){return e-t}function r(e,n,o){return t.max(n,t.min(e,o))}e.sum=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n];return t},e.sumsqrd=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n]*e[n];return t},e.sumsqerr=function(t){for(var n,o=e.mean(t),r=0,i=t.length;--i>=0;)r+=(n=t[i]-o)*n;return r},e.sumrow=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n];return t},e.product=function(e){for(var t=1,n=e.length;--n>=0;)t*=e[n];return t},e.min=function(e){for(var t=e[0],n=0;++n<e.length;)e[n]<t&&(t=e[n]);return t},e.max=function(e){for(var t=e[0],n=0;++n<e.length;)e[n]>t&&(t=e[n]);return t},e.unique=function(e){for(var t={},n=[],o=0;o<e.length;o++)t[e[o]]||(t[e[o]]=!0,n.push(e[o]));return n},e.mean=function(t){return e.sum(t)/t.length},e.meansqerr=function(t){return e.sumsqerr(t)/t.length},e.geomean=function(n){var o=n.map(t.log),r=e.mean(o);return t.exp(r)},e.median=function(e){var t=e.length,n=e.slice().sort(o);return 1&t?n[t/2|0]:(n[t/2-1]+n[t/2])/2},e.cumsum=function(t){return e.cumreduce(t,(function(e,t){return e+t}))},e.cumprod=function(t){return e.cumreduce(t,(function(e,t){return e*t}))},e.diff=function(e){var t,n=[],o=e.length;for(t=1;t<o;t++)n.push(e[t]-e[t-1]);return n},e.rank=function(e){var t,n=[],r={};for(t=0;t<e.length;t++)r[l=e[t]]?r[l]++:(r[l]=1,n.push(l));var i=n.sort(o),s={},a=1;for(t=0;t<i.length;t++){var l,u=r[l=i[t]],c=(a+(a+u-1))/2;s[l]=c,a+=u}return e.map((function(e){return s[e]}))},e.mode=function(e){var t,n=e.length,r=e.slice().sort(o),i=1,s=0,a=0,l=[];for(t=0;t<n;t++)r[t]===r[t+1]?i++:(i>s?(l=[r[t]],s=i,a=0):i===s&&(l.push(r[t]),a++),i=1);return 0===a?l[0]:l},e.range=function(t){return e.max(t)-e.min(t)},e.variance=function(t,n){return e.sumsqerr(t)/(t.length-(n?1:0))},e.pooledvariance=function(t){return t.reduce((function(t,n){return t+e.sumsqerr(n)}),0)/(t.reduce((function(e,t){return e+t.length}),0)-t.length)},e.deviation=function(t){for(var n=e.mean(t),o=t.length,r=new Array(o),i=0;i<o;i++)r[i]=t[i]-n;return r},e.stdev=function(n,o){return t.sqrt(e.variance(n,o))},e.pooledstdev=function(n){return t.sqrt(e.pooledvariance(n))},e.meandev=function(n){for(var o=e.mean(n),r=[],i=n.length-1;i>=0;i--)r.push(t.abs(n[i]-o));return e.mean(r)},e.meddev=function(n){for(var o=e.median(n),r=[],i=n.length-1;i>=0;i--)r.push(t.abs(n[i]-o));return e.median(r)},e.coeffvar=function(t){return e.stdev(t)/e.mean(t)},e.quartiles=function(e){var n=e.length,r=e.slice().sort(o);return[r[t.round(n/4)-1],r[t.round(n/2)-1],r[t.round(3*n/4)-1]]},e.quantiles=function(e,n,i,s){var a,l,u,c,d,f=e.slice().sort(o),m=[n.length],h=e.length;for(void 0===i&&(i=3/8),void 0===s&&(s=3/8),a=0;a<n.length;a++)u=h*(l=n[a])+(i+l*(1-i-s)),c=t.floor(r(u,1,h-1)),d=r(u-c,0,1),m[a]=(1-d)*f[c-1]+d*f[c];return m},e.percentile=function(e,t,n){var r=e.slice().sort(o),i=t*(r.length+(n?1:-1))+(n?0:1),s=parseInt(i),a=i-s;return s+1<r.length?r[s-1]+a*(r[s]-r[s-1]):r[s-1]},e.percentileOfScore=function(e,t,n){var o,r,i=0,s=e.length,a=!1;for("strict"===n&&(a=!0),r=0;r<s;r++)o=e[r],(a&&o<t||!a&&o<=t)&&i++;return i/s},e.histogram=function(n,o){o=o||4;var r,i=e.min(n),s=(e.max(n)-i)/o,a=n.length,l=[];for(r=0;r<o;r++)l[r]=0;for(r=0;r<a;r++)l[t.min(t.floor((n[r]-i)/s),o-1)]+=1;return l},e.covariance=function(t,n){var o,r=e.mean(t),i=e.mean(n),s=t.length,a=new Array(s);for(o=0;o<s;o++)a[o]=(t[o]-r)*(n[o]-i);return e.sum(a)/(s-1)},e.corrcoeff=function(t,n){return e.covariance(t,n)/e.stdev(t,1)/e.stdev(n,1)},e.spearmancoeff=function(t,n){return t=e.rank(t),n=e.rank(n),e.corrcoeff(t,n)},e.stanMoment=function(n,o){for(var r=e.mean(n),i=e.stdev(n),s=n.length,a=0,l=0;l<s;l++)a+=t.pow((n[l]-r)/i,o);return a/n.length},e.skewness=function(t){return e.stanMoment(t,3)},e.kurtosis=function(t){return e.stanMoment(t,4)-3};var i=e.prototype;!function(t){for(var o=0;o<t.length;o++)!function(t){i[t]=function(o,r){var s=[],a=0,l=this;if(n(o)&&(r=o,o=!1),r)return setTimeout((function(){r.call(l,i[t].call(l,o))})),this;if(this.length>1){for(l=!0===o?this:this.transpose();a<l.length;a++)s[a]=e[t](l[a]);return s}return e[t](this[0],o)}}(t[o])}("cumsum cumprod".split(" ")),function(t){for(var o=0;o<t.length;o++)!function(t){i[t]=function(o,r){var s=[],a=0,l=this;if(n(o)&&(r=o,o=!1),r)return setTimeout((function(){r.call(l,i[t].call(l,o))})),this;if(this.length>1){for("sumrow"!==t&&(l=!0===o?this:this.transpose());a<l.length;a++)s[a]=e[t](l[a]);return!0===o?e[t](e.utils.toVector(s)):s}return e[t](this[0],o)}}(t[o])}("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" ")),function(t){for(var o=0;o<t.length;o++)!function(t){i[t]=function(){var o,r=[],s=0,a=this,l=Array.prototype.slice.call(arguments);if(n(l[l.length-1])){o=l[l.length-1];var u=l.slice(0,l.length-1);return setTimeout((function(){o.call(a,i[t].apply(a,u))})),this}o=void 0;var c=function(n){return e[t].apply(a,[n].concat(l))};if(this.length>1){for(a=a.transpose();s<a.length;s++)r[s]=c(a[s]);return r}return c(this[0])}}(t[o])}("quantiles percentileOfScore".split(" "))}(t,Math),function(e,t){e.gammaln=function(e){var n,o,r,i=0,s=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],a=1.000000000190015;for(r=(o=n=e)+5.5,r-=(n+.5)*t.log(r);i<6;i++)a+=s[i]/++o;return t.log(2.5066282746310007*a/n)-r},e.loggam=function(e){var n,o,r,i,s,a,l,u=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(n=e,l=0,1==e||2==e)return 0;for(e<=7&&(n=e+(l=t.floor(7-e))),o=1/(n*n),r=2*t.PI,s=u[9],a=8;a>=0;a--)s*=o,s+=u[a];if(i=s/n+.5*t.log(r)+(n-.5)*t.log(n)-n,e<=7)for(a=1;a<=l;a++)i-=t.log(n-1),n-=1;return i},e.gammafn=function(e){var n,o,r,i,s=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],a=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],l=!1,u=0,c=0,d=0,f=e;if(e>171.6243769536076)return 1/0;if(f<=0){if(!(i=f%1+36e-17))return 1/0;l=(1&f?-1:1)*t.PI/t.sin(t.PI*i),f=1-f}for(r=f,o=f<1?f++:(f-=u=(0|f)-1)-1,n=0;n<8;++n)d=(d+s[n])*o,c=c*o+a[n];if(i=d/c+1,r<f)i/=r;else if(r>f)for(n=0;n<u;++n)i*=f,f++;return l&&(i=l/i),i},e.gammap=function(t,n){return e.lowRegGamma(t,n)*e.gammafn(t)},e.lowRegGamma=function(n,o){var r,i=e.gammaln(n),s=n,a=1/n,l=a,u=o+1-n,c=1/1e-30,d=1/u,f=d,m=1,h=-~(8.5*t.log(n>=1?n:1/n)+.4*n+17);if(o<0||n<=0)return NaN;if(o<n+1){for(;m<=h;m++)a+=l*=o/++s;return a*t.exp(-o+n*t.log(o)-i)}for(;m<=h;m++)f*=(d=1/(d=(r=-m*(m-n))*d+(u+=2)))*(c=u+r/c);return 1-f*t.exp(-o+n*t.log(o)-i)},e.factorialln=function(t){return t<0?NaN:e.gammaln(t+1)},e.factorial=function(t){return t<0?NaN:e.gammafn(t+1)},e.combination=function(n,o){return n>170||o>170?t.exp(e.combinationln(n,o)):e.factorial(n)/e.factorial(o)/e.factorial(n-o)},e.combinationln=function(t,n){return e.factorialln(t)-e.factorialln(n)-e.factorialln(t-n)},e.permutation=function(t,n){return e.factorial(t)/e.factorial(t-n)},e.betafn=function(n,o){if(!(n<=0||o<=0))return n+o>170?t.exp(e.betaln(n,o)):e.gammafn(n)*e.gammafn(o)/e.gammafn(n+o)},e.betaln=function(t,n){return e.gammaln(t)+e.gammaln(n)-e.gammaln(t+n)},e.betacf=function(e,n,o){var r,i,s,a,l=1e-30,u=1,c=n+o,d=n+1,f=n-1,m=1,h=1-c*e/d;for(t.abs(h)<l&&(h=l),a=h=1/h;u<=100&&(h=1+(i=u*(o-u)*e/((f+(r=2*u))*(n+r)))*h,t.abs(h)<l&&(h=l),m=1+i/m,t.abs(m)<l&&(m=l),a*=(h=1/h)*m,h=1+(i=-(n+u)*(c+u)*e/((n+r)*(d+r)))*h,t.abs(h)<l&&(h=l),m=1+i/m,t.abs(m)<l&&(m=l),a*=s=(h=1/h)*m,!(t.abs(s-1)<3e-7));u++);return a},e.gammapinv=function(n,o){var r,i,s,a,l,u,c=0,d=o-1,f=e.gammaln(o);if(n>=1)return t.max(100,o+100*t.sqrt(o));if(n<=0)return 0;for(o>1?(l=t.log(d),u=t.exp(d*(l-1)-f),a=n<.5?n:1-n,r=(2.30753+.27061*(i=t.sqrt(-2*t.log(a))))/(1+i*(.99229+.04481*i))-i,n<.5&&(r=-r),r=t.max(.001,o*t.pow(1-1/(9*o)-r/(3*t.sqrt(o)),3))):r=n<(i=1-o*(.253+.12*o))?t.pow(n/i,1/o):1-t.log(1-(n-i)/(1-i));c<12;c++){if(r<=0)return 0;if((r-=i=(s=(e.lowRegGamma(o,r)-n)/(i=o>1?u*t.exp(-(r-d)+d*(t.log(r)-l)):t.exp(-r+d*t.log(r)-f)))/(1-.5*t.min(1,s*((o-1)/r-1))))<=0&&(r=.5*(r+i)),t.abs(i)<1e-8*r)break}return r},e.erf=function(e){var n,o,r,i,s=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-9.91364156e-10,-2.27365122e-10,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],a=s.length-1,l=!1,u=0,c=0;for(e<0&&(e=-e,l=!0),o=4*(n=2/(2+e))-2;a>0;a--)r=u,u=o*u-c+s[a],c=r;return i=n*t.exp(-e*e+.5*(s[0]+o*u)-c),l?i-1:1-i},e.erfc=function(t){return 1-e.erf(t)},e.erfcinv=function(n){var o,r,i,s,a=0;if(n>=2)return-100;if(n<=0)return 100;for(s=n<1?n:2-n,o=-.70711*((2.30753+.27061*(i=t.sqrt(-2*t.log(s/2))))/(1+i*(.99229+.04481*i))-i);a<2;a++)o+=(r=e.erfc(o)-s)/(1.1283791670955126*t.exp(-o*o)-o*r);return n<1?o:-o},e.ibetainv=function(n,o,r){var i,s,a,l,u,c,d,f,m,h,p=o-1,g=r-1,v=0;if(n<=0)return 0;if(n>=1)return 1;for(o>=1&&r>=1?(a=n<.5?n:1-n,c=(2.30753+.27061*(l=t.sqrt(-2*t.log(a))))/(1+l*(.99229+.04481*l))-l,n<.5&&(c=-c),d=(c*c-3)/6,f=2/(1/(2*o-1)+1/(2*r-1)),m=c*t.sqrt(d+f)/f-(1/(2*r-1)-1/(2*o-1))*(d+5/6-2/(3*f)),c=o/(o+r*t.exp(2*m))):(i=t.log(o/(o+r)),s=t.log(r/(o+r)),c=n<(l=t.exp(o*i)/o)/(m=l+(u=t.exp(r*s)/r))?t.pow(o*m*n,1/o):1-t.pow(r*m*(1-n),1/r)),h=-e.gammaln(o)-e.gammaln(r)+e.gammaln(o+r);v<10;v++){if(0===c||1===c)return c;if((c-=l=(u=(e.ibeta(c,o,r)-n)/(l=t.exp(p*t.log(c)+g*t.log(1-c)+h)))/(1-.5*t.min(1,u*(p/c-g/(1-c)))))<=0&&(c=.5*(c+l)),c>=1&&(c=.5*(c+l+1)),t.abs(l)<1e-8*c&&v>0)break}return c},e.ibeta=function(n,o,r){var i=0===n||1===n?0:t.exp(e.gammaln(o+r)-e.gammaln(o)-e.gammaln(r)+o*t.log(n)+r*t.log(1-n));return!(n<0||n>1)&&(n<(o+1)/(o+r+2)?i*e.betacf(n,o,r)/o:1-i*e.betacf(1-n,r,o)/r)},e.randn=function(n,o){var r,i,s,a,l;if(o||(o=n),n)return e.create(n,o,(function(){return e.randn()}));do{r=e._random_fn(),i=1.7156*(e._random_fn()-.5),l=(s=r-.449871)*s+(a=t.abs(i)+.386595)*(.196*a-.25472*s)}while(l>.27597&&(l>.27846||i*i>-4*t.log(r)*r*r));return i/r},e.randg=function(n,o,r){var i,s,a,l,u,c,d=n;if(r||(r=o),n||(n=1),o)return(c=e.zeros(o,r)).alter((function(){return e.randg(n)})),c;n<1&&(n+=1),i=n-1/3,s=1/t.sqrt(9*i);do{do{l=1+s*(u=e.randn())}while(l<=0);l*=l*l,a=e._random_fn()}while(a>1-.331*t.pow(u,4)&&t.log(a)>.5*u*u+i*(1-l+t.log(l)));if(n==d)return i*l;do{a=e._random_fn()}while(0===a);return t.pow(a,1/d)*i*l},function(t){for(var n=0;n<t.length;n++)!function(t){e.fn[t]=function(){return e(e.map(this,(function(n){return e[t](n)})))}}(t[n])}("gammaln gammafn factorial factorialln".split(" ")),function(t){for(var n=0;n<t.length;n++)!function(t){e.fn[t]=function(){return e(e[t].apply(null,arguments))}}(t[n])}("randn".split(" "))}(t,Math),function(e,t){function n(e,n,o,r){for(var i,s=0,a=1,l=1,u=1,c=0,d=0;t.abs((l-d)/l)>r;)d=l,a=u+(i=-(n+c)*(n+o+c)*e/(n+2*c)/(n+2*c+1))*a,l=(s=l+i*s)+(i=(c+=1)*(o-c)*e/(n+2*c-1)/(n+2*c))*l,s/=u=a+i*u,a/=u,l/=u,u=1;return l/n}function o(n,o,r){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],s=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],a=.5*n;if(a>=8)return 1;var l,u=2*e.normal.cdf(a,0,1,1,0)-1;u=u>=t.exp(-50/r)?t.pow(u,r):0;for(var c=a,d=(8-a)/(l=n>3?2:3),f=c+d,m=0,h=r-1,p=1;p<=l;p++){for(var g=0,v=.5*(f+c),y=.5*(f-c),x=1;x<=12;x++){var C,w=v+y*(6<x?i[(C=12-x+1)-1]:-i[(C=x)-1]),T=w*w;if(T>60)break;var _=2*e.normal.cdf(w,0,1,1,0)*.5-2*e.normal.cdf(w,n,1,1,0)*.5;_>=t.exp(-30/h)&&(g+=_=s[C-1]*t.exp(-.5*T)*t.pow(_,h))}m+=g*=2*y*r/t.sqrt(2*t.PI),c=f,f+=d}return(u+=m)<=t.exp(-30/o)?0:(u=t.pow(u,o))>=1?1:u}!function(t){for(var n=0;n<t.length;n++)!function(t){e[t]=function e(t,n,o){return this instanceof e?(this._a=t,this._b=n,this._c=o,this):new e(t,n,o)},e.fn[t]=function(n,o,r){var i=e[t](n,o,r);return i.data=this,i},e[t].prototype.sample=function(n){var o=this._a,r=this._b,i=this._c;return n?e.alter(n,(function(){return e[t].sample(o,r,i)})):e[t].sample(o,r,i)},function(n){for(var o=0;o<n.length;o++)!function(n){e[t].prototype[n]=function(o){var r=this._a,i=this._b,s=this._c;return o||0===o||(o=this.data),"number"!=typeof o?e.fn.map.call(o,(function(o){return e[t][n](o,r,i,s)})):e[t][n](o,r,i,s)}}(n[o])}("pdf cdf inv".split(" ")),function(n){for(var o=0;o<n.length;o++)!function(n){e[t].prototype[n]=function(){return e[t][n](this._a,this._b,this._c)}}(n[o])}("mean median mode variance".split(" "))}(t[n])}("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" ")),e.extend(e.beta,{pdf:function(n,o,r){return n>1||n<0?0:1==o&&1==r?1:o<512&&r<512?t.pow(n,o-1)*t.pow(1-n,r-1)/e.betafn(o,r):t.exp((o-1)*t.log(n)+(r-1)*t.log(1-n)-e.betaln(o,r))},cdf:function(t,n,o){return t>1||t<0?1*(t>1):e.ibeta(t,n,o)},inv:function(t,n,o){return e.ibetainv(t,n,o)},mean:function(e,t){return e/(e+t)},median:function(t,n){return e.ibetainv(.5,t,n)},mode:function(e,t){return(e-1)/(e+t-2)},sample:function(t,n){var o=e.randg(t);return o/(o+e.randg(n))},variance:function(e,n){return e*n/(t.pow(e+n,2)*(e+n+1))}}),e.extend(e.centralF,{pdf:function(n,o,r){var i;return n<0?0:o<=2?0===n&&o<2?1/0:0===n&&2===o?1:1/e.betafn(o/2,r/2)*t.pow(o/r,o/2)*t.pow(n,o/2-1)*t.pow(1+o/r*n,-(o+r)/2):(i=o*n/(r+n*o),o*(r/(r+n*o))/2*e.binomial.pdf((o-2)/2,(o+r-2)/2,i))},cdf:function(t,n,o){return t<0?0:e.ibeta(n*t/(n*t+o),n/2,o/2)},inv:function(t,n,o){return o/(n*(1/e.ibetainv(t,n/2,o/2)-1))},mean:function(e,t){return t>2?t/(t-2):void 0},mode:function(e,t){return e>2?t*(e-2)/(e*(t+2)):void 0},sample:function(t,n){return 2*e.randg(t/2)/t/(2*e.randg(n/2)/n)},variance:function(e,t){if(!(t<=4))return 2*t*t*(e+t-2)/(e*(t-2)*(t-2)*(t-4))}}),e.extend(e.cauchy,{pdf:function(e,n,o){return o<0?0:o/(t.pow(e-n,2)+t.pow(o,2))/t.PI},cdf:function(e,n,o){return t.atan((e-n)/o)/t.PI+.5},inv:function(e,n,o){return n+o*t.tan(t.PI*(e-.5))},median:function(e){return e},mode:function(e){return e},sample:function(n,o){return e.randn()*t.sqrt(1/(2*e.randg(.5)))*o+n}}),e.extend(e.chisquare,{pdf:function(n,o){return n<0?0:0===n&&2===o?.5:t.exp((o/2-1)*t.log(n)-n/2-o/2*t.log(2)-e.gammaln(o/2))},cdf:function(t,n){return t<0?0:e.lowRegGamma(n/2,t/2)},inv:function(t,n){return 2*e.gammapinv(t,.5*n)},mean:function(e){return e},median:function(e){return e*t.pow(1-2/(9*e),3)},mode:function(e){return e-2>0?e-2:0},sample:function(t){return 2*e.randg(t/2)},variance:function(e){return 2*e}}),e.extend(e.exponential,{pdf:function(e,n){return e<0?0:n*t.exp(-n*e)},cdf:function(e,n){return e<0?0:1-t.exp(-n*e)},inv:function(e,n){return-t.log(1-e)/n},mean:function(e){return 1/e},median:function(e){return 1/e*t.log(2)},mode:function(){return 0},sample:function(n){return-1/n*t.log(e._random_fn())},variance:function(e){return t.pow(e,-2)}}),e.extend(e.gamma,{pdf:function(n,o,r){return n<0?0:0===n&&1===o?1/r:t.exp((o-1)*t.log(n)-n/r-e.gammaln(o)-o*t.log(r))},cdf:function(t,n,o){return t<0?0:e.lowRegGamma(n,t/o)},inv:function(t,n,o){return e.gammapinv(t,n)*o},mean:function(e,t){return e*t},mode:function(e,t){if(e>1)return(e-1)*t},sample:function(t,n){return e.randg(t)*n},variance:function(e,t){return e*t*t}}),e.extend(e.invgamma,{pdf:function(n,o,r){return n<=0?0:t.exp(-(o+1)*t.log(n)-r/n-e.gammaln(o)+o*t.log(r))},cdf:function(t,n,o){return t<=0?0:1-e.lowRegGamma(n,o/t)},inv:function(t,n,o){return o/e.gammapinv(1-t,n)},mean:function(e,t){return e>1?t/(e-1):void 0},mode:function(e,t){return t/(e+1)},sample:function(t,n){return n/e.randg(t)},variance:function(e,t){if(!(e<=2))return t*t/((e-1)*(e-1)*(e-2))}}),e.extend(e.kumaraswamy,{pdf:function(e,n,o){return 0===e&&1===n?o:1===e&&1===o?n:t.exp(t.log(n)+t.log(o)+(n-1)*t.log(e)+(o-1)*t.log(1-t.pow(e,n)))},cdf:function(e,n,o){return e<0?0:e>1?1:1-t.pow(1-t.pow(e,n),o)},inv:function(e,n,o){return t.pow(1-t.pow(1-e,1/o),1/n)},mean:function(t,n){return n*e.gammafn(1+1/t)*e.gammafn(n)/e.gammafn(1+1/t+n)},median:function(e,n){return t.pow(1-t.pow(2,-1/n),1/e)},mode:function(e,n){if(e>=1&&n>=1&&1!==e&&1!==n)return t.pow((e-1)/(e*n-1),1/e)},variance:function(){throw new Error("variance not yet implemented")}}),e.extend(e.lognormal,{pdf:function(e,n,o){return e<=0?0:t.exp(-t.log(e)-.5*t.log(2*t.PI)-t.log(o)-t.pow(t.log(e)-n,2)/(2*o*o))},cdf:function(n,o,r){return n<0?0:.5+.5*e.erf((t.log(n)-o)/t.sqrt(2*r*r))},inv:function(n,o,r){return t.exp(-1.4142135623730951*r*e.erfcinv(2*n)+o)},mean:function(e,n){return t.exp(e+n*n/2)},median:function(e){return t.exp(e)},mode:function(e,n){return t.exp(e-n*n)},sample:function(n,o){return t.exp(e.randn()*o+n)},variance:function(e,n){return(t.exp(n*n)-1)*t.exp(2*e+n*n)}}),e.extend(e.noncentralt,{pdf:function(n,o,r){return t.abs(r)<1e-14?e.studentt.pdf(n,o):t.abs(n)<1e-14?t.exp(e.gammaln((o+1)/2)-r*r/2-.5*t.log(t.PI*o)-e.gammaln(o/2)):o/n*(e.noncentralt.cdf(n*t.sqrt(1+2/o),o+2,r)-e.noncentralt.cdf(n,o,r))},cdf:function(n,o,r){var i=1e-14;if(t.abs(r)<i)return e.studentt.cdf(n,o);var s=!1;n<0&&(s=!0,r=-r);for(var a=e.normal.cdf(-r,0,1),l=i+1,u=l,c=n*n/(n*n+o),d=0,f=t.exp(-r*r/2),m=t.exp(-r*r/2-.5*t.log(2)-e.gammaln(1.5))*r;d<200||u>i||l>i;)u=l,d>0&&(f*=r*r/(2*d),m*=r*r/(2*(d+.5))),a+=.5*(l=f*e.beta.cdf(c,d+.5,o/2)+m*e.beta.cdf(c,d+1,o/2)),d++;return s?1-a:a}}),e.extend(e.normal,{pdf:function(e,n,o){return t.exp(-.5*t.log(2*t.PI)-t.log(o)-t.pow(e-n,2)/(2*o*o))},cdf:function(n,o,r){return.5*(1+e.erf((n-o)/t.sqrt(2*r*r)))},inv:function(t,n,o){return-1.4142135623730951*o*e.erfcinv(2*t)+n},mean:function(e){return e},median:function(e){return e},mode:function(e){return e},sample:function(t,n){return e.randn()*n+t},variance:function(e,t){return t*t}}),e.extend(e.pareto,{pdf:function(e,n,o){return e<n?0:o*t.pow(n,o)/t.pow(e,o+1)},cdf:function(e,n,o){return e<n?0:1-t.pow(n/e,o)},inv:function(e,n,o){return n/t.pow(1-e,1/o)},mean:function(e,n){if(!(n<=1))return n*t.pow(e,n)/(n-1)},median:function(e,n){return e*(n*t.SQRT2)},mode:function(e){return e},variance:function(e,n){if(!(n<=2))return e*e*n/(t.pow(n-1,2)*(n-2))}}),e.extend(e.studentt,{pdf:function(n,o){return o=o>1e100?1e100:o,1/(t.sqrt(o)*e.betafn(.5,o/2))*t.pow(1+n*n/o,-(o+1)/2)},cdf:function(n,o){var r=o/2;return e.ibeta((n+t.sqrt(n*n+o))/(2*t.sqrt(n*n+o)),r,r)},inv:function(n,o){var r=e.ibetainv(2*t.min(n,1-n),.5*o,.5);return r=t.sqrt(o*(1-r)/r),n>.5?r:-r},mean:function(e){return e>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(n){return e.randn()*t.sqrt(n/(2*e.randg(n/2)))},variance:function(e){return e>2?e/(e-2):e>1?1/0:void 0}}),e.extend(e.weibull,{pdf:function(e,n,o){return e<0||n<0||o<0?0:o/n*t.pow(e/n,o-1)*t.exp(-t.pow(e/n,o))},cdf:function(e,n,o){return e<0?0:1-t.exp(-t.pow(e/n,o))},inv:function(e,n,o){return n*t.pow(-t.log(1-e),1/o)},mean:function(t,n){return t*e.gammafn(1+1/n)},median:function(e,n){return e*t.pow(t.log(2),1/n)},mode:function(e,n){return n<=1?0:e*t.pow((n-1)/n,1/n)},sample:function(n,o){return n*t.pow(-t.log(e._random_fn()),1/o)},variance:function(n,o){return n*n*e.gammafn(1+2/o)-t.pow(e.weibull.mean(n,o),2)}}),e.extend(e.uniform,{pdf:function(e,t,n){return e<t||e>n?0:1/(n-t)},cdf:function(e,t,n){return e<t?0:e<n?(e-t)/(n-t):1},inv:function(e,t,n){return t+e*(n-t)},mean:function(e,t){return.5*(e+t)},median:function(t,n){return e.mean(t,n)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(t,n){return t/2+n/2+(n/2-t/2)*(2*e._random_fn()-1)},variance:function(e,n){return t.pow(n-e,2)/12}}),e.extend(e.binomial,{pdf:function(n,o,r){return 0===r||1===r?o*r===n?1:0:e.combination(o,n)*t.pow(r,n)*t.pow(1-r,o-n)},cdf:function(o,r,i){var s,a=1e-10;if(o<0)return 0;if(o>=r)return 1;if(i<0||i>1||r<=0)return NaN;var l=i,u=(o=t.floor(o))+1,c=r-o,d=u+c,f=t.exp(e.gammaln(d)-e.gammaln(c)-e.gammaln(u)+u*t.log(l)+c*t.log(1-l));return s=l<(u+1)/(d+2)?f*n(l,u,c,a):1-f*n(1-l,c,u,a),t.round(1/a*(1-s))/(1/a)}}),e.extend(e.negbin,{pdf:function(n,o,r){return n===n>>>0&&(n<0?0:e.combination(n+o-1,o-1)*t.pow(1-r,n)*t.pow(r,o))},cdf:function(t,n,o){var r=0,i=0;if(t<0)return 0;for(;i<=t;i++)r+=e.negbin.pdf(i,n,o);return r}}),e.extend(e.hypgeom,{pdf:function(n,o,r,i){if(n!=n|0)return!1;if(n<0||n<r-(o-i))return 0;if(n>i||n>r)return 0;if(2*r>o)return 2*i>o?e.hypgeom.pdf(o-r-i+n,o,o-r,o-i):e.hypgeom.pdf(i-n,o,o-r,i);if(2*i>o)return e.hypgeom.pdf(r-n,o,r,o-i);if(r<i)return e.hypgeom.pdf(n,o,i,r);for(var s=1,a=0,l=0;l<n;l++){for(;s>1&&a<i;)s*=1-r/(o-a),a++;s*=(i-l)*(r-l)/((l+1)*(o-r-i+l+1))}for(;a<i;a++)s*=1-r/(o-a);return t.min(1,t.max(0,s))},cdf:function(n,o,r,i){if(n<0||n<r-(o-i))return 0;if(n>=i||n>=r)return 1;if(2*r>o)return 2*i>o?e.hypgeom.cdf(o-r-i+n,o,o-r,o-i):1-e.hypgeom.cdf(i-n-1,o,o-r,i);if(2*i>o)return 1-e.hypgeom.cdf(r-n-1,o,r,o-i);if(r<i)return e.hypgeom.cdf(n,o,i,r);for(var s=1,a=1,l=0,u=0;u<n;u++){for(;s>1&&l<i;){var c=1-r/(o-l);a*=c,s*=c,l++}s+=a*=(i-u)*(r-u)/((u+1)*(o-r-i+u+1))}for(;l<i;l++)s*=1-r/(o-l);return t.min(1,t.max(0,s))}}),e.extend(e.poisson,{pdf:function(n,o){return o<0||n%1!=0||n<0?0:t.pow(o,n)*t.exp(-o)/e.factorial(n)},cdf:function(t,n){var o=[],r=0;if(t<0)return 0;for(;r<=t;r++)o.push(e.poisson.pdf(r,n));return e.sum(o)},mean:function(e){return e},variance:function(e){return e},sampleSmall:function(n){var o=1,r=0,i=t.exp(-n);do{r++,o*=e._random_fn()}while(o>i);return r-1},sampleLarge:function(n){var o,r,i,s,a,l,u,c,d,f,m=n;for(s=t.sqrt(m),a=t.log(m),l=.02483*(u=.931+2.53*s)-.059,c=1.1239+1.1328/(u-3.4),d=.9277-3.6224/(u-2);;){if(r=t.random()-.5,i=t.random(),f=.5-t.abs(r),o=t.floor((2*l/f+u)*r+m+.43),f>=.07&&i<=d)return o;if(!(o<0||f<.013&&i>f)&&t.log(i)+t.log(c)-t.log(l/(f*f)+u)<=o*a-m-e.loggam(o+1))return o}},sample:function(e){return e<10?this.sampleSmall(e):this.sampleLarge(e)}}),e.extend(e.triangular,{pdf:function(e,t,n,o){return n<=t||o<t||o>n?NaN:e<t||e>n?0:e<o?2*(e-t)/((n-t)*(o-t)):e===o?2/(n-t):2*(n-e)/((n-t)*(n-o))},cdf:function(e,n,o,r){return o<=n||r<n||r>o?NaN:e<=n?0:e>=o?1:e<=r?t.pow(e-n,2)/((o-n)*(r-n)):1-t.pow(o-e,2)/((o-n)*(o-r))},inv:function(e,n,o,r){return o<=n||r<n||r>o?NaN:e<=(r-n)/(o-n)?n+(o-n)*t.sqrt(e*((r-n)/(o-n))):n+(o-n)*(1-t.sqrt((1-e)*(1-(r-n)/(o-n))))},mean:function(e,t,n){return(e+t+n)/3},median:function(e,n,o){return o<=(e+n)/2?n-t.sqrt((n-e)*(n-o))/t.sqrt(2):o>(e+n)/2?e+t.sqrt((n-e)*(o-e))/t.sqrt(2):void 0},mode:function(e,t,n){return n},sample:function(n,o,r){var i=e._random_fn();return i<(r-n)/(o-n)?n+t.sqrt(i*(o-n)*(r-n)):o-t.sqrt((1-i)*(o-n)*(o-r))},variance:function(e,t,n){return(e*e+t*t+n*n-e*t-e*n-t*n)/18}}),e.extend(e.arcsine,{pdf:function(e,n,o){return o<=n?NaN:e<=n||e>=o?0:2/t.PI*t.pow(t.pow(o-n,2)-t.pow(2*e-n-o,2),-.5)},cdf:function(e,n,o){return e<n?0:e<o?2/t.PI*t.asin(t.sqrt((e-n)/(o-n))):1},inv:function(e,n,o){return n+(.5-.5*t.cos(t.PI*e))*(o-n)},mean:function(e,t){return t<=e?NaN:(e+t)/2},median:function(e,t){return t<=e?NaN:(e+t)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(n,o){return(n+o)/2+(o-n)/2*t.sin(2*t.PI*e.uniform.sample(0,1))},variance:function(e,n){return n<=e?NaN:t.pow(n-e,2)/8}}),e.extend(e.laplace,{pdf:function(e,n,o){return o<=0?0:t.exp(-t.abs(e-n)/o)/(2*o)},cdf:function(e,n,o){return o<=0?0:e<n?.5*t.exp((e-n)/o):1-.5*t.exp(-(e-n)/o)},mean:function(e){return e},median:function(e){return e},mode:function(e){return e},variance:function(e,t){return 2*t*t},sample:function(n,o){var r,i=e._random_fn()-.5;return n-o*((r=i)/t.abs(r))*t.log(1-2*t.abs(i))}}),e.extend(e.tukey,{cdf:function(n,r,i){var s=r,a=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],l=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(n<=0)return 0;if(i<2||s<2)return NaN;if(!Number.isFinite(n))return 1;if(i>25e3)return o(n,1,s);var u,c=.5*i,d=c*t.log(i)-i*t.log(2)-e.gammaln(c),f=c-1,m=.25*i;u=i<=100?1:i<=800?.5:i<=5e3?.25:.125,d+=t.log(u);for(var h=0,p=1;p<=50;p++){for(var g=0,v=(2*p-1)*u,y=1;y<=16;y++){var x,C;8<y?(x=y-8-1,C=d+f*t.log(v+a[x]*u)-(a[x]*u+v)*m):(x=y-1,C=d+f*t.log(v-a[x]*u)+(a[x]*u-v)*m),C>=-30&&(g+=o(8<y?n*t.sqrt(.5*(a[x]*u+v)):n*t.sqrt(.5*(-a[x]*u+v)),1,s)*l[x]*t.exp(C))}if(p*u>=1&&g<=1e-14)break;h+=g}if(g>1e-14)throw new Error("tukey.cdf failed to converge");return h>1&&(h=1),h},inv:function(n,o,r){if(r<2||o<2)return NaN;if(n<0||n>1)return NaN;if(0===n)return 0;if(1===n)return 1/0;var i,s=function(e,n,o){var r=.5-.5*e,i=t.sqrt(t.log(1/(r*r))),s=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);o<120&&(s+=(s*s*s+s)/o/4);var a=.8832-.2368*s;return o<120&&(a+=-1.214/o+1.208*s/o),s*(a*t.log(n-1)+1.4142)}(n,o,r),a=e.tukey.cdf(s,o,r)-n;i=a>0?t.max(0,s-1):s+1;for(var l,u=e.tukey.cdf(i,o,r)-n,c=1;c<50;c++)if(l=i-u*(i-s)/(u-a),a=u,s=i,l<0&&(l=0,u=-n),u=e.tukey.cdf(l,o,r)-n,i=l,t.abs(i-s)<1e-4)return l;throw new Error("tukey.inv failed to converge")}})}(t,Math),function(e,t){var n,o,r=Array.prototype.push,i=e.utils.isArray;function s(t){return i(t)||t instanceof e}e.extend({add:function(t,n){return s(n)?(s(n[0])||(n=[n]),e.map(t,(function(e,t,o){return e+n[t][o]}))):e.map(t,(function(e){return e+n}))},subtract:function(t,n){return s(n)?(s(n[0])||(n=[n]),e.map(t,(function(e,t,o){return e-n[t][o]||0}))):e.map(t,(function(e){return e-n}))},divide:function(t,n){return s(n)?(s(n[0])||(n=[n]),e.multiply(t,e.inv(n))):e.map(t,(function(e){return e/n}))},multiply:function(t,n){var o,r,i,a,l,u,c,d;if(void 0===t.length&&void 0===n.length)return t*n;if(l=t.length,u=t[0].length,c=e.zeros(l,i=s(n)?n[0].length:u),d=0,s(n)){for(;d<i;d++)for(o=0;o<l;o++){for(a=0,r=0;r<u;r++)a+=t[o][r]*n[r][d];c[o][d]=a}return 1===l&&1===d?c[0][0]:c}return e.map(t,(function(e){return e*n}))},outer:function(t,n){return e.multiply(t.map((function(e){return[e]})),[n])},dot:function(t,n){s(t[0])||(t=[t]),s(n[0])||(n=[n]);for(var o,r,i=1===t[0].length&&1!==t.length?e.transpose(t):t,a=1===n[0].length&&1!==n.length?e.transpose(n):n,l=[],u=0,c=i.length,d=i[0].length;u<c;u++){for(l[u]=[],o=0,r=0;r<d;r++)o+=i[u][r]*a[u][r];l[u]=o}return 1===l.length?l[0]:l},pow:function(n,o){return e.map(n,(function(e){return t.pow(e,o)}))},exp:function(n){return e.map(n,(function(e){return t.exp(e)}))},log:function(n){return e.map(n,(function(e){return t.log(e)}))},abs:function(n){return e.map(n,(function(e){return t.abs(e)}))},norm:function(e,n){var o=0,r=0;for(isNaN(n)&&(n=2),s(e[0])&&(e=e[0]);r<e.length;r++)o+=t.pow(t.abs(e[r]),n);return t.pow(o,1/n)},angle:function(n,o){return t.acos(e.dot(n,o)/(e.norm(n)*e.norm(o)))},aug:function(e,t){var n,o=[];for(n=0;n<e.length;n++)o.push(e[n].slice());for(n=0;n<o.length;n++)r.apply(o[n],t[n]);return o},inv:function(t){for(var n,o=t.length,r=t[0].length,i=e.identity(o,r),s=e.gauss_jordan(t,i),a=[],l=0;l<o;l++)for(a[l]=[],n=r;n<s[0].length;n++)a[l][n-r]=s[l][n];return a},det:function e(t){if(2===t.length)return t[0][0]*t[1][1]-t[0][1]*t[1][0];for(var n=0,o=0;o<t.length;o++){for(var r=[],i=1;i<t.length;i++){r[i-1]=[];for(var s=0;s<t.length;s++)s<o?r[i-1][s]=t[i][s]:s>o&&(r[i-1][s-1]=t[i][s])}var a=o%2?-1:1;n+=e(r)*t[0][o]*a}return n},gauss_elimination:function(n,o){var r,i,s,a,l=0,u=0,c=n.length,d=n[0].length,f=1,m=0,h=[];for(r=(n=e.aug(n,o))[0].length,l=0;l<c;l++){for(i=n[l][l],u=l,a=l+1;a<d;a++)i<t.abs(n[a][l])&&(i=n[a][l],u=a);if(u!=l)for(a=0;a<r;a++)s=n[l][a],n[l][a]=n[u][a],n[u][a]=s;for(u=l+1;u<c;u++)for(f=n[u][l]/n[l][l],a=l;a<r;a++)n[u][a]=n[u][a]-f*n[l][a]}for(l=c-1;l>=0;l--){for(m=0,u=l+1;u<=c-1;u++)m+=h[u]*n[l][u];h[l]=(n[l][r-1]-m)/n[l][l]}return h},gauss_jordan:function(n,o){var r,i,s,a=e.aug(n,o),l=a.length,u=a[0].length,c=0;for(i=0;i<l;i++){var d=i;for(s=i+1;s<l;s++)t.abs(a[s][i])>t.abs(a[d][i])&&(d=s);var f=a[i];for(a[i]=a[d],a[d]=f,s=i+1;s<l;s++)for(c=a[s][i]/a[i][i],r=i;r<u;r++)a[s][r]-=a[i][r]*c}for(i=l-1;i>=0;i--){for(c=a[i][i],s=0;s<i;s++)for(r=u-1;r>i-1;r--)a[s][r]-=a[i][r]*a[s][i]/c;for(a[i][i]/=c,r=l;r<u;r++)a[i][r]/=c}return a},triaUpSolve:function(t,n){var o,r=t[0].length,i=e.zeros(1,r)[0],s=!1;return null!=n[0].length&&(n=n.map((function(e){return e[0]})),s=!0),e.arange(r-1,-1,-1).forEach((function(s){o=e.arange(s+1,r).map((function(e){return i[e]*t[s][e]})),i[s]=(n[s]-e.sum(o))/t[s][s]})),s?i.map((function(e){return[e]})):i},triaLowSolve:function(t,n){var o,r=t[0].length,i=e.zeros(1,r)[0],s=!1;return null!=n[0].length&&(n=n.map((function(e){return e[0]})),s=!0),e.arange(r).forEach((function(r){o=e.arange(r).map((function(e){return t[r][e]*i[e]})),i[r]=(n[r]-e.sum(o))/t[r][r]})),s?i.map((function(e){return[e]})):i},lu:function(t){var n,o=t.length,r=e.identity(o),i=e.zeros(t.length,t[0].length);return e.arange(o).forEach((function(e){i[0][e]=t[0][e]})),e.arange(1,o).forEach((function(s){e.arange(s).forEach((function(o){n=e.arange(o).map((function(e){return r[s][e]*i[e][o]})),r[s][o]=(t[s][o]-e.sum(n))/i[o][o]})),e.arange(s,o).forEach((function(o){n=e.arange(s).map((function(e){return r[s][e]*i[e][o]})),i[s][o]=t[n.length][o]-e.sum(n)}))})),[r,i]},cholesky:function(n){var o,r=n.length,i=e.zeros(n.length,n[0].length);return e.arange(r).forEach((function(s){o=e.arange(s).map((function(e){return t.pow(i[s][e],2)})),i[s][s]=t.sqrt(n[s][s]-e.sum(o)),e.arange(s+1,r).forEach((function(t){o=e.arange(s).map((function(e){return i[s][e]*i[t][e]})),i[t][s]=(n[s][t]-e.sum(o))/i[s][s]}))})),i},gauss_jacobi:function(n,o,r,i){for(var s,a,l,u,c=0,d=0,f=n.length,m=[],h=[],p=[];c<f;c++)for(m[c]=[],h[c]=[],p[c]=[],d=0;d<f;d++)c>d?(m[c][d]=n[c][d],h[c][d]=p[c][d]=0):c<d?(h[c][d]=n[c][d],m[c][d]=p[c][d]=0):(p[c][d]=n[c][d],m[c][d]=h[c][d]=0);for(l=e.multiply(e.multiply(e.inv(p),e.add(m,h)),-1),a=e.multiply(e.inv(p),o),s=r,u=e.add(e.multiply(l,r),a),c=2;t.abs(e.norm(e.subtract(u,s)))>i;)s=u,u=e.add(e.multiply(l,s),a),c++;return u},gauss_seidel:function(n,o,r,i){for(var s,a,l,u,c,d=0,f=n.length,m=[],h=[],p=[];d<f;d++)for(m[d]=[],h[d]=[],p[d]=[],s=0;s<f;s++)d>s?(m[d][s]=n[d][s],h[d][s]=p[d][s]=0):d<s?(h[d][s]=n[d][s],m[d][s]=p[d][s]=0):(p[d][s]=n[d][s],m[d][s]=h[d][s]=0);for(u=e.multiply(e.multiply(e.inv(e.add(p,m)),h),-1),l=e.multiply(e.inv(e.add(p,m)),o),a=r,c=e.add(e.multiply(u,r),l),d=2;t.abs(e.norm(e.subtract(c,a)))>i;)a=c,c=e.add(e.multiply(u,a),l),d+=1;return c},SOR:function(n,o,r,i,s){for(var a,l,u,c,d,f=0,m=n.length,h=[],p=[],g=[];f<m;f++)for(h[f]=[],p[f]=[],g[f]=[],a=0;a<m;a++)f>a?(h[f][a]=n[f][a],p[f][a]=g[f][a]=0):f<a?(p[f][a]=n[f][a],h[f][a]=g[f][a]=0):(g[f][a]=n[f][a],h[f][a]=p[f][a]=0);for(c=e.multiply(e.inv(e.add(g,e.multiply(h,s))),e.subtract(e.multiply(g,1-s),e.multiply(p,s))),u=e.multiply(e.multiply(e.inv(e.add(g,e.multiply(h,s))),o),s),l=r,d=e.add(e.multiply(c,r),u),f=2;t.abs(e.norm(e.subtract(d,l)))>i;)l=d,d=e.add(e.multiply(c,l),u),f++;return d},householder:function(n){for(var o,r,i,s,a=n.length,l=n[0].length,u=0,c=[],d=[];u<a-1;u++){for(o=0,s=u+1;s<l;s++)o+=n[s][u]*n[s][u];for(o=(n[u+1][u]>0?-1:1)*t.sqrt(o),r=t.sqrt((o*o-n[u+1][u]*o)/2),(c=e.zeros(a,1))[u+1][0]=(n[u+1][u]-o)/(2*r),i=u+2;i<a;i++)c[i][0]=n[i][u]/(2*r);d=e.subtract(e.identity(a,l),e.multiply(e.multiply(c,e.transpose(c)),2)),n=e.multiply(d,e.multiply(n,d))}return n},QR:(n=e.sum,o=e.arange,function(r){var i,s,a,l=r.length,u=r[0].length,c=e.zeros(u,u);for(r=e.copy(r),s=0;s<u;s++){for(c[s][s]=t.sqrt(n(o(l).map((function(e){return r[e][s]*r[e][s]})))),i=0;i<l;i++)r[i][s]=r[i][s]/c[s][s];for(a=s+1;a<u;a++)for(c[s][a]=n(o(l).map((function(e){return r[e][s]*r[e][a]}))),i=0;i<l;i++)r[i][a]=r[i][a]-r[i][s]*c[s][a]}return[r,c]}),lstsq:function(t,n){var o=!1;void 0===n[0].length&&(n=n.map((function(e){return[e]})),o=!0);var r=e.QR(t),i=r[0],s=r[1],a=t[0].length,l=e.slice(i,{col:{end:a}}),u=function(t){var n=(t=e.copy(t)).length,o=e.identity(n);return e.arange(n-1,-1,-1).forEach((function(n){e.sliceAssign(o,{row:n},e.divide(e.slice(o,{row:n}),t[n][n])),e.sliceAssign(t,{row:n},e.divide(e.slice(t,{row:n}),t[n][n])),e.arange(n).forEach((function(r){var i=e.multiply(t[r][n],-1),s=e.slice(t,{row:r}),a=e.multiply(e.slice(t,{row:n}),i);e.sliceAssign(t,{row:r},e.add(s,a));var l=e.slice(o,{row:r}),u=e.multiply(e.slice(o,{row:n}),i);e.sliceAssign(o,{row:r},e.add(l,u))}))})),o}(e.slice(s,{row:{end:a}})),c=e.transpose(l);void 0===c[0].length&&(c=[c]);var d=e.multiply(e.multiply(u,c),n);return void 0===d.length&&(d=[[d]]),o?d.map((function(e){return e[0]})):d},jacobi:function(n){for(var o,r,i,s,a,l,u,c=1,d=n.length,f=e.identity(d,d),m=[];1===c;){for(a=n[0][1],i=0,s=1,o=0;o<d;o++)for(r=0;r<d;r++)o!=r&&a<t.abs(n[o][r])&&(a=t.abs(n[o][r]),i=o,s=r);for(l=n[i][i]===n[s][s]?n[i][s]>0?t.PI/4:-t.PI/4:t.atan(2*n[i][s]/(n[i][i]-n[s][s]))/2,(u=e.identity(d,d))[i][i]=t.cos(l),u[i][s]=-t.sin(l),u[s][i]=t.sin(l),u[s][s]=t.cos(l),f=e.multiply(f,u),n=e.multiply(e.multiply(e.inv(u),n),u),c=0,o=1;o<d;o++)for(r=1;r<d;r++)o!=r&&t.abs(n[o][r])>.001&&(c=1)}for(o=0;o<d;o++)m.push(n[o][o]);return[f,m]},rungekutta:function(e,t,n,o,r,i){var s,a,l;if(2===i)for(;o<=n;)r+=((s=t*e(o,r))+(a=t*e(o+t,r+s)))/2,o+=t;if(4===i)for(;o<=n;)r+=((s=t*e(o,r))+2*(a=t*e(o+t/2,r+s/2))+2*(l=t*e(o+t/2,r+a/2))+t*e(o+t,r+l))/6,o+=t;return r},romberg:function(e,n,o,r){for(var i,s,a,l,u,c=0,d=(o-n)/2,f=[],m=[],h=[];c<r/2;){for(u=e(n),a=n,l=0;a<=o;a+=d,l++)f[l]=a;for(i=f.length,a=1;a<i-1;a++)u+=(a%2!=0?4:2)*e(f[a]);u=d/3*(u+e(o)),h[c]=u,d/=2,c++}for(s=h.length,i=1;1!==s;){for(a=0;a<s-1;a++)m[a]=(t.pow(4,i)*h[a+1]-h[a])/(t.pow(4,i)-1);s=m.length,h=m,m=[],i++}return h},richardson:function(e,n,o,r){function i(e,t){for(var n,o=0,r=e.length;o<r;o++)e[o]===t&&(n=o);return n}for(var s,a,l,u,c,d=t.abs(o-e[i(e,o)+1]),f=0,m=[],h=[];r>=d;)s=i(e,o+r),a=i(e,o),m[f]=(n[s]-2*n[a]+n[2*a-s])/(r*r),r/=2,f++;for(u=m.length,l=1;1!=u;){for(c=0;c<u-1;c++)h[c]=(t.pow(4,l)*m[c+1]-m[c])/(t.pow(4,l)-1);u=h.length,m=h,h=[],l++}return m},simpson:function(e,t,n,o){for(var r,i=(n-t)/o,s=e(t),a=[],l=t,u=0,c=1;l<=n;l+=i,u++)a[u]=l;for(r=a.length;c<r-1;c++)s+=(c%2!=0?4:2)*e(a[c]);return i/3*(s+e(n))},hermite:function(e,t,n,o){for(var r,i=e.length,s=0,a=0,l=[],u=[],c=[],d=[];a<i;a++){for(l[a]=1,r=0;r<i;r++)a!=r&&(l[a]*=(o-e[r])/(e[a]-e[r]));for(u[a]=0,r=0;r<i;r++)a!=r&&(u[a]+=1/(e[a]-e[r]));c[a]=(1-2*(o-e[a])*u[a])*(l[a]*l[a]),d[a]=(o-e[a])*(l[a]*l[a]),s+=c[a]*t[a]+d[a]*n[a]}return s},lagrange:function(e,t,n){for(var o,r,i=0,s=0,a=e.length;s<a;s++){for(r=t[s],o=0;o<a;o++)s!=o&&(r*=(n-e[o])/(e[s]-e[o]));i+=r}return i},cubic_spline:function(t,n,o){for(var r,i,s=t.length,a=0,l=[],u=[],c=[],d=[],f=[],m=[];a<s-1;a++)d[a]=t[a+1]-t[a];for(c[0]=0,a=1;a<s-1;a++)c[a]=3/d[a]*(n[a+1]-n[a])-3/d[a-1]*(n[a]-n[a-1]);for(a=1;a<s-1;a++)l[a]=[],u[a]=[],l[a][a-1]=d[a-1],l[a][a]=2*(d[a-1]+d[a]),l[a][a+1]=d[a],u[a][0]=c[a];for(i=e.multiply(e.inv(l),u),r=0;r<s-1;r++)f[r]=(n[r+1]-n[r])/d[r]-d[r]*(i[r+1][0]+2*i[r][0])/3,m[r]=(i[r+1][0]-i[r][0])/(3*d[r]);for(r=0;r<s&&!(t[r]>o);r++);return n[r-=1]+(o-t[r])*f[r]+e.sq(o-t[r])*i[r]+(o-t[r])*e.sq(o-t[r])*m[r]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(t){var n,o,r,i,s,a=t.length,l=t[0].length,u=0,c=[],d=[],f=[],m=[],h=[],p=[],g=[];for(u=0;u<a;u++)c[u]=e.sum(t[u])/l;for(u=0;u<l;u++)for(h[u]=[],n=0;n<a;n++)h[u][n]=t[n][u]-c[n];for(h=e.transpose(h),u=0;u<a;u++)for(p[u]=[],n=0;n<a;n++)p[u][n]=e.dot([h[u]],[h[n]])/(l-1);for(s=(r=e.jacobi(p))[0],d=r[1],g=e.transpose(s),u=0;u<d.length;u++)for(n=u;n<d.length;n++)d[u]<d[n]&&(o=d[u],d[u]=d[n],d[n]=o,f=g[u],g[u]=g[n],g[n]=f);for(i=e.transpose(h),u=0;u<a;u++)for(m[u]=[],n=0;n<i.length;n++)m[u][n]=e.dot([g[u]],[i[n]]);return[t,d,g,m]}}),function(t){for(var n=0;n<t.length;n++)!function(t){e.fn[t]=function(n,o){var r=this;return o?(setTimeout((function(){o.call(r,e.fn[t].call(r,n))}),15),this):"number"==typeof e[t](this,n)?e[t](this,n):e(e[t](this,n))}}(t[n])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(t,Math),function(e,t){var n=[].slice,o=e.utils.isNumber,r=e.utils.isArray;function i(e,n,o,r){if(e>1||o>1||e<=0||o<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(e*n+o*r)/(n+r);return(e-o)/t.sqrt(i*(1-i)*(1/n+1/r))}e.extend({zscore:function(){var t=n.call(arguments);return o(t[1])?(t[0]-t[1])/t[2]:(t[0]-e.mean(t[1]))/e.stdev(t[1],t[2])},ztest:function(){var o,i=n.call(arguments);return r(i[1])?(o=e.zscore(i[0],i[1],i[3]),1===i[2]?e.normal.cdf(-t.abs(o),0,1):2*e.normal.cdf(-t.abs(o),0,1)):i.length>2?(o=e.zscore(i[0],i[1],i[2]),1===i[3]?e.normal.cdf(-t.abs(o),0,1):2*e.normal.cdf(-t.abs(o),0,1)):(o=i[0],1===i[1]?e.normal.cdf(-t.abs(o),0,1):2*e.normal.cdf(-t.abs(o),0,1))}}),e.extend(e.fn,{zscore:function(e,t){return(e-this.mean())/this.stdev(t)},ztest:function(n,o,r){var i=t.abs(this.zscore(n,r));return 1===o?e.normal.cdf(-i,0,1):2*e.normal.cdf(-i,0,1)}}),e.extend({tscore:function(){var o=n.call(arguments);return 4===o.length?(o[0]-o[1])/(o[2]/t.sqrt(o[3])):(o[0]-e.mean(o[1]))/(e.stdev(o[1],!0)/t.sqrt(o[1].length))},ttest:function(){var r,i=n.call(arguments);return 5===i.length?(r=t.abs(e.tscore(i[0],i[1],i[2],i[3])),1===i[4]?e.studentt.cdf(-r,i[3]-1):2*e.studentt.cdf(-r,i[3]-1)):o(i[1])?(r=t.abs(i[0]),1==i[2]?e.studentt.cdf(-r,i[1]-1):2*e.studentt.cdf(-r,i[1]-1)):(r=t.abs(e.tscore(i[0],i[1])),1==i[2]?e.studentt.cdf(-r,i[1].length-1):2*e.studentt.cdf(-r,i[1].length-1))}}),e.extend(e.fn,{tscore:function(e){return(e-this.mean())/(this.stdev(!0)/t.sqrt(this.cols()))},ttest:function(n,o){return 1===o?1-e.studentt.cdf(t.abs(this.tscore(n)),this.cols()-1):2*e.studentt.cdf(-t.abs(this.tscore(n)),this.cols()-1)}}),e.extend({anovafscore:function(){var o,r,i,s,a,l,u,c,d=n.call(arguments);if(1===d.length){for(a=new Array(d[0].length),u=0;u<d[0].length;u++)a[u]=d[0][u];d=a}for(r=new Array,u=0;u<d.length;u++)r=r.concat(d[u]);for(i=e.mean(r),o=0,u=0;u<d.length;u++)o+=d[u].length*t.pow(e.mean(d[u])-i,2);for(o/=d.length-1,l=0,u=0;u<d.length;u++)for(s=e.mean(d[u]),c=0;c<d[u].length;c++)l+=t.pow(d[u][c]-s,2);return o/(l/(r.length-d.length))},anovaftest:function(){var t,r,i,s,a=n.call(arguments);if(o(a[0]))return 1-e.centralF.cdf(a[0],a[1],a[2]);var l=e.anovafscore(a);for(t=a.length-1,i=0,s=0;s<a.length;s++)i+=a[s].length;return r=i-t-1,1-e.centralF.cdf(l,t,r)},ftest:function(t,n,o){return 1-e.centralF.cdf(t,n,o)}}),e.extend(e.fn,{anovafscore:function(){return e.anovafscore(this.toArray())},anovaftes:function(){var t,n=0;for(t=0;t<this.length;t++)n+=this[t].length;return e.ftest(this.anovafscore(),this.length-1,n-this.length)}}),e.extend({qscore:function(){var r,i,s,a,l,u=n.call(arguments);return o(u[0])?(r=u[0],i=u[1],s=u[2],a=u[3],l=u[4]):(r=e.mean(u[0]),i=e.mean(u[1]),s=u[0].length,a=u[1].length,l=u[2]),t.abs(r-i)/(l*t.sqrt((1/s+1/a)/2))},qtest:function(){var t,o=n.call(arguments);3===o.length?(t=o[0],o=o.slice(1)):7===o.length?(t=e.qscore(o[0],o[1],o[2],o[3],o[4]),o=o.slice(5)):(t=e.qscore(o[0],o[1],o[2]),o=o.slice(3));var r=o[0],i=o[1];return 1-e.tukey.cdf(t,i,r-i)},tukeyhsd:function(t){for(var n=e.pooledstdev(t),o=t.map((function(t){return e.mean(t)})),r=t.reduce((function(e,t){return e+t.length}),0),i=[],s=0;s<t.length;++s)for(var a=s+1;a<t.length;++a){var l=e.qtest(o[s],o[a],t[s].length,t[a].length,n,r,t.length);i.push([[s,a],l])}return i}}),e.extend({normalci:function(){var o,r=n.call(arguments),i=new Array(2);return o=4===r.length?t.abs(e.normal.inv(r[1]/2,0,1)*r[2]/t.sqrt(r[3])):t.abs(e.normal.inv(r[1]/2,0,1)*e.stdev(r[2])/t.sqrt(r[2].length)),i[0]=r[0]-o,i[1]=r[0]+o,i},tci:function(){var o,r=n.call(arguments),i=new Array(2);return o=4===r.length?t.abs(e.studentt.inv(r[1]/2,r[3]-1)*r[2]/t.sqrt(r[3])):t.abs(e.studentt.inv(r[1]/2,r[2].length-1)*e.stdev(r[2],!0)/t.sqrt(r[2].length)),i[0]=r[0]-o,i[1]=r[0]+o,i},significant:function(e,t){return e<t}}),e.extend(e.fn,{normalci:function(t,n){return e.normalci(t,n,this.toArray())},tci:function(t,n){return e.tci(t,n,this.toArray())}}),e.extend(e.fn,{oneSidedDifferenceOfProportions:function(t,n,o,r){var s=i(t,n,o,r);return e.ztest(s,1)},twoSidedDifferenceOfProportions:function(t,n,o,r){var s=i(t,n,o,r);return e.ztest(s,2)}})}(t,Math),t.models=function(){function e(e,n){var o=e.length,r=n[0].length-1,i=o-r-1,s=t.lstsq(n,e),a=t.multiply(n,s.map((function(e){return[e]}))).map((function(e){return e[0]})),l=t.subtract(e,a),u=t.mean(e),c=t.sum(a.map((function(e){return Math.pow(e-u,2)}))),d=t.sum(e.map((function(e,t){return Math.pow(e-a[t],2)}))),f=c+d;return{exog:n,endog:e,nobs:o,df_model:r,df_resid:i,coef:s,predict:a,resid:l,ybar:u,SST:f,SSE:c,SSR:d,R2:c/f}}function n(n){var o,r,i=(o=n.exog,r=o[0].length,t.arange(r).map((function(n){var i=t.arange(r).filter((function(e){return e!==n}));return e(t.col(o,n).map((function(e){return e[0]})),t.col(o,i))}))),s=Math.sqrt(n.SSR/n.df_resid),a=i.map((function(e){var t=e.SST,n=e.R2;return s/Math.sqrt(t*(1-n))})),l=n.coef.map((function(e,t){return(e-0)/a[t]})),u=l.map((function(e){var o=t.studentt.cdf(e,n.df_resid);return 2*(o>.5?1-o:o)})),c=t.studentt.inv(.975,n.df_resid),d=n.coef.map((function(e,t){var n=c*a[t];return[e-n,e+n]}));return{se:a,t:l,p:u,sigmaHat:s,interval95:d}}return{ols:function(o,r){var i=e(o,r),s=n(i),a=function(e){var n,o,r,i=e.R2/e.df_model/((1-e.R2)/e.df_resid);return{F_statistic:i,pvalue:1-(n=i,o=e.df_model,r=e.df_resid,t.beta.cdf(n/(r/o+n),o/2,r/2))}}(i),l=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=s,i.f=a,i.adjust_R2=l,i}}}(),t.extend({buildxmatrix:function(){for(var e=new Array(arguments.length),n=0;n<arguments.length;n++)e[n]=[1].concat(arguments[n]);return t(e)},builddxmatrix:function(){for(var e=new Array(arguments[0].length),n=0;n<arguments[0].length;n++)e[n]=[1].concat(arguments[0][n]);return t(e)},buildjxmatrix:function(e){for(var n=new Array(e.length),o=0;o<e.length;o++)n[o]=e[o];return t.builddxmatrix(n)},buildymatrix:function(e){return t(e).transpose()},buildjymatrix:function(e){return e.transpose()},matrixmult:function(e,n){var o,r,i,s,a;if(e.cols()==n.rows()){if(n.rows()>1){for(s=[],o=0;o<e.rows();o++)for(s[o]=[],r=0;r<n.cols();r++){for(a=0,i=0;i<e.cols();i++)a+=e.toArray()[o][i]*n.toArray()[i][r];s[o][r]=a}return t(s)}for(s=[],o=0;o<e.rows();o++)for(s[o]=[],r=0;r<n.cols();r++){for(a=0,i=0;i<e.cols();i++)a+=e.toArray()[o][i]*n.toArray()[r];s[o][r]=a}return t(s)}},regress:function(e,n){var o=t.xtranspxinv(e),r=e.transpose(),i=t.matrixmult(t(o),r);return t.matrixmult(i,n)},regresst:function(e,n,o){var r=t.regress(e,n),i={anova:{}},s=t.jMatYBar(e,r);i.yBar=s;var a=n.mean();i.anova.residuals=t.residuals(n,s),i.anova.ssr=t.ssr(s,a),i.anova.msr=i.anova.ssr/(e[0].length-1),i.anova.sse=t.sse(n,s),i.anova.mse=i.anova.sse/(n.length-(e[0].length-1)-1),i.anova.sst=t.sst(n,a),i.anova.mst=i.anova.sst/(n.length-1),i.anova.r2=1-i.anova.sse/i.anova.sst,i.anova.r2<0&&(i.anova.r2=0),i.anova.fratio=i.anova.msr/i.anova.mse,i.anova.pvalue=t.anovaftest(i.anova.fratio,e[0].length-1,n.length-(e[0].length-1)-1),i.anova.rmse=Math.sqrt(i.anova.mse),i.anova.r2adj=1-i.anova.mse/i.anova.mst,i.anova.r2adj<0&&(i.anova.r2adj=0),i.stats=new Array(e[0].length);for(var l,u,c,d=t.xtranspxinv(e),f=0;f<r.length;f++)l=Math.sqrt(i.anova.mse*Math.abs(d[f][f])),u=Math.abs(r[f]/l),c=t.ttest(u,n.length-e[0].length-1,o),i.stats[f]=[r[f],l,u,c];return i.regress=r,i},xtranspx:function(e){return t.matrixmult(e.transpose(),e)},xtranspxinv:function(e){var n=t.matrixmult(e.transpose(),e);return t.inv(n)},jMatYBar:function(e,n){var o=t.matrixmult(e,n);return new t(o)},residuals:function(e,n){return t.matrixsubtract(e,n)},ssr:function(e,t){for(var n=0,o=0;o<e.length;o++)n+=Math.pow(e[o]-t,2);return n},sse:function(e,t){for(var n=0,o=0;o<e.length;o++)n+=Math.pow(e[o]-t[o],2);return n},sst:function(e,t){for(var n=0,o=0;o<e.length;o++)n+=Math.pow(e[o]-t,2);return n},matrixsubtract:function(e,n){for(var o=new Array(e.length),r=0;r<e.length;r++){o[r]=new Array(e[r].length);for(var i=0;i<e[r].length;i++)o[r][i]=e[r][i]-n[r][i]}return t(o)}}),t.jStat=t,t)},391:(e,t,n)=>{var o=n(180),r=n(181),i=n(31),s=n(67),a=n(833),l=n(717),u=n(801);u.alea=o,u.xor128=r,u.xorwow=i,u.xorshift7=s,u.xor4096=a,u.tychei=l,e.exports=u},180:function(e,t,n){var o;!function(e,r){function i(e){var t,n=this,o=(t=4022871197,function(e){e=String(e);for(var n=0;n<e.length;n++){var o=.02519603282416938*(t+=e.charCodeAt(n));o-=t=o>>>0,t=(o*=t)>>>0,t+=4294967296*(o-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=o(" "),n.s1=o(" "),n.s2=o(" "),n.s0-=o(e),n.s0<0&&(n.s0+=1),n.s1-=o(e),n.s1<0&&(n.s1+=1),n.s2-=o(e),n.s2<0&&(n.s2+=1),o=null}function s(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function a(e,t){var n=new i(e),o=t&&t.state,r=n.next;return r.int32=function(){return 4294967296*n.next()|0},r.double=function(){return r()+11102230246251565e-32*(2097152*r()|0)},r.quick=r,o&&("object"==typeof o&&s(o,n),r.state=function(){return s(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(o=function(){return a}.call(t,n,t,r))||(r.exports=o):this.alea=a}(0,e=n.nmd(e),n.amdD)},717:function(e,t,n){var o;!function(e,r){function i(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,o=t.d,r=t.a;return e=e<<25^e>>>7^n,n=n-o|0,o=o<<24^o>>>8^r,r=r-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-o|0,t.d=o<<16^n>>>16^r,t.a=r-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var o=0;o<n.length+20;o++)t.b^=0|n.charCodeAt(o),t.next()}function s(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function a(e,t){var n=new i(e),o=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,o&&("object"==typeof o&&s(o,n),r.state=function(){return s(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(o=function(){return a}.call(t,n,t,r))||(r.exports=o):this.tychei=a}(0,e=n.nmd(e),n.amdD)},181:function(e,t,n){var o;!function(e,r){function i(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var o=0;o<n.length+64;o++)t.x^=0|n.charCodeAt(o),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function a(e,t){var n=new i(e),o=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,o&&("object"==typeof o&&s(o,n),r.state=function(){return s(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(o=function(){return a}.call(t,n,t,r))||(r.exports=o):this.xor128=a}(0,e=n.nmd(e),n.amdD)},833:function(e,t,n){var o;!function(e,r){function i(e){var t=this;t.next=function(){var e,n,o=t.w,r=t.X,i=t.i;return t.w=o=o+1640531527|0,n=r[i+34&127],e=r[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=r[i]=n^e,t.i=i,n+(o^o>>>16)|0},function(e,t){var n,o,r,i,s,a=[],l=128;for(t===(0|t)?(o=t,t=null):(t+="\0",o=0,l=Math.max(l,t.length)),r=0,i=-32;i<l;++i)t&&(o^=t.charCodeAt((i+32)%t.length)),0===i&&(s=o),o^=o<<10,o^=o>>>15,o^=o<<4,o^=o>>>13,i>=0&&(s=s+1640531527|0,r=0==(n=a[127&i]^=o+s)?r+1:0);for(r>=128&&(a[127&(t&&t.length||0)]=-1),r=127,i=512;i>0;--i)o=a[r+34&127],n=a[r=r+1&127],o^=o<<13,n^=n<<17,o^=o>>>15,n^=n>>>12,a[r]=o^n;e.w=s,e.X=a,e.i=r}(t,e)}function s(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function a(e,t){null==e&&(e=+new Date);var n=new i(e),o=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,o&&(o.X&&s(o,n),r.state=function(){return s(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(o=function(){return a}.call(t,n,t,r))||(r.exports=o):this.xor4096=a}(0,e=n.nmd(e),n.amdD)},67:function(e,t,n){var o;!function(e,r){function i(e){var t=this;t.next=function(){var e,n,o=t.x,r=t.i;return e=o[r],n=(e^=e>>>7)^e<<24,n^=(e=o[r+1&7])^e>>>10,n^=(e=o[r+3&7])^e>>>3,n^=(e=o[r+4&7])^e<<7,e=o[r+7&7],n^=(e^=e<<13)^e<<9,o[r]=n,t.i=r+1&7,n},function(e,t){var n,o=[];if(t===(0|t))o[0]=t;else for(t=""+t,n=0;n<t.length;++n)o[7&n]=o[7&n]<<15^t.charCodeAt(n)+o[n+1&7]<<13;for(;o.length<8;)o.push(0);for(n=0;n<8&&0===o[n];++n);for(8==n?o[7]=-1:o[n],e.x=o,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function s(e,t){return t.x=e.x.slice(),t.i=e.i,t}function a(e,t){null==e&&(e=+new Date);var n=new i(e),o=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,o&&(o.x&&s(o,n),r.state=function(){return s(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(o=function(){return a}.call(t,n,t,r))||(r.exports=o):this.xorshift7=a}(0,e=n.nmd(e),n.amdD)},31:function(e,t,n){var o;!function(e,r){function i(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var o=0;o<n.length+64;o++)t.x^=0|n.charCodeAt(o),o==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function s(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function a(e,t){var n=new i(e),o=t&&t.state,r=function(){return(n.next()>>>0)/4294967296};return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,o&&("object"==typeof o&&s(o,n),r.state=function(){return s(n,{})}),r}r&&r.exports?r.exports=a:n.amdD&&n.amdO?void 0===(o=function(){return a}.call(t,n,t,r))||(r.exports=o):this.xorwow=a}(0,e=n.nmd(e),n.amdD)},801:function(e,t,n){var o;!function(r,i,s){var a,l=256,u=s.pow(l,6),c=s.pow(2,52),d=2*c,f=l-1;function m(e,t,n){var o=[],f=v(g((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(i)]:null==e?function(){try{var e;return a&&(e=a.randomBytes)?e=e(l):(e=new Uint8Array(l),(r.crypto||r.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=r.navigator,n=t&&t.plugins;return[+new Date,r,n,r.screen,y(i)]}}():e,3),o),m=new h(o),x=function(){for(var e=m.g(6),t=u,n=0;e<c;)e=(e+n)*l,t*=l,n=m.g(1);for(;e>=d;)e/=2,t/=2,n>>>=1;return(e+n)/t};return x.int32=function(){return 0|m.g(4)},x.quick=function(){return m.g(4)/4294967296},x.double=x,v(y(m.S),i),(t.pass||n||function(e,t,n,o){return o&&(o.S&&p(o,m),e.state=function(){return p(m,{})}),n?(s.random=e,t):e})(x,f,"global"in t?t.global:this==s,t.state)}function h(e){var t,n=e.length,o=this,r=0,i=o.i=o.j=0,s=o.S=[];for(n||(e=[n++]);r<l;)s[r]=r++;for(r=0;r<l;r++)s[r]=s[i=f&i+e[r%n]+(t=s[r])],s[i]=t;(o.g=function(e){for(var t,n=0,r=o.i,i=o.j,s=o.S;e--;)t=s[r=f&r+1],n=n*l+s[f&(s[r]=s[i=f&i+t])+(s[i]=t)];return o.i=r,o.j=i,n})(l)}function p(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function g(e,t){var n,o=[],r=typeof e;if(t&&"object"==r)for(n in e)try{o.push(g(e[n],t-1))}catch(e){}return o.length?o:"string"==r?e:e+"\0"}function v(e,t){for(var n,o=e+"",r=0;r<o.length;)t[f&r]=f&(n^=19*t[f&r])+o.charCodeAt(r++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(v(s.random(),i),e.exports){e.exports=m;try{a=n(234)}catch(e){}}else void 0===(o=function(){return m}.call(t,n,t,e))||(e.exports=o)}("undefined"!=typeof self?self:this,[],Math)},95:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});class o{}o.TAG_FIT_CHART_FORMAT=".fitChartFormat",o.TAG_FIT_CHART_FORMAT_3DX="3dx",o.FIT_SEM_TYPE="fit",o.FIT_CELL_TYPE="fit",o.TAG_FIT=".fit",o.CELL_DEFAULT_WIDTH=230,o.CELL_DEFAULT_HEIGHT=160,o.MIN_CELL_RENDERER_PX_WIDTH=10,o.MIN_CELL_RENDERER_PX_HEIGHT=5,o.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH=70,o.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT=45,o.MIN_AXES_CELL_PX_WIDTH=100,o.MIN_AXES_CELL_PX_HEIGHT=55,o.MIN_TITLE_PX_WIDTH=275,o.MIN_TITLE_PX_HEIGHT=225,o.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH=180,o.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT=140,o.MIN_LEGEND_PX_WIDTH=325,o.MIN_LEGEND_PX_HEIGHT=275,o.MIN_DROPLINES_VISIBILITY_PX_WIDTH=120,o.MIN_DROPLINES_VISIBILITY_PX_HEIGHT=110,o.AXES_LEFT_PX_MARGIN=38,o.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS=45,o.AXES_TOP_PX_MARGIN=5,o.AXES_TOP_PX_MARGIN_WITH_TITLE=25,o.AXES_RIGHT_PX_MARGIN=18,o.AXES_BOTTOM_PX_MARGIN=15,o.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS=30,o.X_AXIS_LABEL_BOTTOM_PX_MARGIN=4,o.LEGEND_TOP_PX_MARGIN=10,o.OUTLIER_PX_SIZE=12,o.POINT_PX_SIZE=4,o.OUTLIER_HITBOX_RADIUS=2,o.CANDLESTICK_BORDER_PX_SIZE=4,o.CANDLESTICK_MEDIAN_PX_SIZE=3.5,o.CANDLESTICK_OUTLIER_PX_SIZE=6,o.INFLATE_SIZE=-6,o.MIN_INFLATE_SIZE=-2,o.LEGEND_RECORD_PX_HEIGHT=18,o.LEGEND_RECORD_LINE_PX_WIDTH=20,o.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN=5,o.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN=4,o.LINE_STYLES={solid:[],dotted:[1,1],dashed:[5,5],dashdotted:[5,5,2,5]},o.CURVE_CONFIDENCE_INTERVAL_BOUNDS={TOP:"top",BOTTOM:"bottom"},o.CONFIDENCE_INTERVAL_STROKE_COLOR="rgba(255,191,63,0.4)",o.CONFIDENCE_INTERVAL_FILL_COLOR="rgba(255,238,204,0.3)",o.CONDITION_MAP={"No series to show":e=>void 0===e||0===(null==e?void 0:e.length),"There were series with no points":e=>e.some((e=>{var t;return 0===(null===(t=e.points)||void 0===t?void 0:t.length)})),"There were series with all x zeroes":e=>e.some((e=>{var t;return null===(t=e.points)||void 0===t?void 0:t.every((e=>0===e.x))})),"There were series with all y zeroes":e=>e.some((e=>{var t;return null===(t=e.points)||void 0===t?void 0:t.every((e=>0===e.y))}))}},471:(e,t,n)=>{"use strict";n.d(t,{kL:()=>u,nO:()=>c});var o=n(82),r=(n(328),n(48),n(71)),i=n(991),s=n.n(i),a=n(95);function l(e,t){return Math.random()*(t-e)+e}function u(e,t,n=1){const o=new Float32Array(e*n),i=new Float32Array(e*n),s=[l(1,2),l(1,2),l(1,2),l(-5,5)],a=0-Math.floor(e/2)*t,u=a+t*(e-1);for(let e=a,l=0;e<=u;e+=t,l++)for(let t=0;t<n;t++){o[l*n+t]=e-a+.1;const u=new Float32Array(4);u.set(s),i[l*n+t]=(0,r.ry)(u,e)}const c=(1===n?.2:.4)*(Math.max(...i)-Math.min(...i)),d=Math.min(...i);for(let e=0;e<o.length;e++)i[e]=-d+i[e]+l(0,c);return{x:o,y:i,params:s}}function c(e,t,n){var r;const i=o.DataFrame.create(e);for(let l=0;l<t;l++){const t=3===l?5:1,c=i.columns.addNewString(`json chart ${l}`);c.semType=a.h.FIT_SEM_TYPE;let d=l%2==0?n:1;for(let i=0;i<e;i++){const e={series:[],chartOptions:{showStatistics:1===d?["auc"]:[],xAxisName:"Conc.",yAxisName:"Activity",title:"Dose-Response curves"}};for(let i=0;i<d;i++){const a=u(15,.5,t);let c=o.Color.toHtml(o.Color.getCategoricalColor(l*n+i));null===(r=e.series)||void 0===r||r.push({parameters:void 0,fitLineColor:c,pointColor:c,showCurveConfidenceInterval:1===d,points:s().count().take(15*t).map((function(e){return{x:a.x[e],y:a.y[e]}})).toArray()})}c.set(i,JSON.stringify(e))}}return i}},667:(e,t,n)=>{"use strict";n.d(t,{JR:()=>c,VK:()=>u});var o,r=n(82),i=(n(389),n(999)),s=n(71),a=n(407);n(283),n(95),n(672),function(e){e.DATAFRAME="Dataframe",e.COLUMN="Column",e.CELL="Cell"}(o||(o={}));const l={count:"totalCount",nulls:"missingValueCount",unique:"uniqueCount",values:"valueCount",min:"min",max:"max",sum:"sum",avg:"avg",stdev:"stdev",variance:"variance",skew:"skew",kurt:"kurt",med:"med",q1:"q1",q2:"q2",q3:"q3"};function u(e,t,n,o){const r=(0,i.zB)(e);if(e.parameters)n.logX&&e.parameters[2]>0&&(e.parameters[2]=Math.log10(e.parameters[2]));else{const i=(0,a.IY)(e,t,r,n,o).parameters;e.parameters=[...i]}const l=(0,i.VA)(e,r,(0,a.Xm)(e,t,n,!1,o),n);return[s.kC,s.G7].includes(r.name)&&n.logX&&void 0!==l.interceptX&&l.interceptX<0&&(l.interceptX=Math.pow(10,l.interceptX)),l}function c(e,t,n){var o,i,s;const a={logX:null===(o=e.chartOptions)||void 0===o?void 0:o.logX,logY:null===(i=e.chartOptions)||void 0===i?void 0:i.logY},c=[],d=[],f=[],m=[],h=[],p=[],g=[];for(let t=0,o=0;t<(null===(s=e.series)||void 0===s?void 0:s.length);t++){if(e.series[t].points.every((e=>e.outlier)))continue;const r=u(e.series[t],t,a,n);c[o]=r.rSquared,d[o]=r.auc,f[o]=r.interceptX,m[o]=r.interceptY,h[o]=r.slope,p[o]=r.top,g[o]=r.bottom,o++}return{rSquared:c.some((e=>null==e))?void 0:r.Stats.fromValues(c)[l[t]],auc:d.some((e=>null==e))?void 0:r.Stats.fromValues(d)[l[t]],interceptX:f.some((e=>null==e))?void 0:r.Stats.fromValues(f)[l[t]],interceptY:m.some((e=>null==e))?void 0:r.Stats.fromValues(m)[l[t]],slope:h.some((e=>null==e))?void 0:r.Stats.fromValues(h)[l[t]],top:p.some((e=>null==e))?void 0:r.Stats.fromValues(p)[l[t]],bottom:g.some((e=>null==e))?void 0:r.Stats.fromValues(g)[l[t]]}}r.ObjectHandler},283:(e,t,n)=>{"use strict";n.d(t,{K:()=>u});var o=n(82),r=n(71);const i={x:"xAxis",y:"yAxis"},s={min:"min",max:"max"};function a(e){var t,n,i;const s=null===(n=null===(t=e.getElementsByTagName("params")[0])||void 0===t?void 0:t.childNodes[0].nodeValue)||void 0===n?void 0:n.split(",").map(Number);let a=null===(i=e.getElementsByTagName("function")[0])||void 0===i?void 0:i.getAttribute("type");a=a&&"sigif"!==a?a:r.G7;const l=e.getElementsByTagName("settings")[0].getAttribute("markerColor"),u=e.getElementsByTagName("settings")[0].getAttribute("color"),c=!!e.getElementsByTagName("settings")[0].getAttribute("drawLine"),d={name:e.getAttribute("name"),fitFunction:a,markerType:o.MARKER_TYPE.CIRCLE,pointColor:l,fitLineColor:u,showFitLine:c,showPoints:"points",showCurveConfidenceInterval:!1,clickToToggle:!1};return s&&(d.parameters=[s[2],s[1],s[0],s[3]]),d}function l(e){const t=function(e){var t,n,o;const r=null===(t=e.getElementsByTagName("x")[0].childNodes[0].nodeValue)||void 0===t?void 0:t.split(","),i=null===(n=e.getElementsByTagName("y")[0].childNodes[0].nodeValue)||void 0===n?void 0:n.split(","),s=null===(o=e.getElementsByTagName("mask")[0].childNodes[0].nodeValue)||void 0===o?void 0:o.split(""),a=[];for(let e=0;e<r.length;e++)a[e]={x:+r[e],y:+i[e],outlier:!Boolean(s[e])};return a}(e),n=a(e),o={points:t};return Object.assign(o,n),o}function u(e){const t=(new DOMParser).parseFromString(e,"text/xml"),n=t.getElementsByTagName("grid")[0],o=(u=t.getElementsByTagName("settings")[0],{minX:+(r=n).getElementsByTagName(i.x)[0].getAttribute(s.min),minY:+r.getElementsByTagName(i.y)[0].getAttribute(s.min),maxX:+r.getElementsByTagName(i.x)[0].getAttribute(s.max),maxY:+r.getElementsByTagName(i.y)[0].getAttribute(s.max),xAxisName:u.getAttribute("xLabel"),yAxisName:u.getAttribute("yLabel"),logX:!!u.getAttribute("logX")});var r,u;const c=t.getElementsByTagName("seriesCollection")[0],d=a(c.getElementsByTagName("series")[0]),f=function(e){const t=[],n=e.getElementsByTagName("series").length;for(let o=0;o<n;o++){const n=e.getElementsByTagName("series")[o];t[o]=l(n)}return t}(c);return{chartOptions:o,seriesOptions:d,series:f}}},407:(e,t,n)=>{"use strict";n.d(t,{B3:()=>N,Fw:()=>A,I4:()=>S,IY:()=>w,Ig:()=>_,LX:()=>v,Tv:()=>b,Xm:()=>T,Yc:()=>E,bc:()=>I,g2:()=>g,h8:()=>x,lR:()=>O,wU:()=>y});var o,r=n(82),i=n(328),s=n(389),a=n(71),l=n(293),u=n(999),c=n(283),d=n(667),f=n(95),m=n(672),h=n(858);function p(e,t){var n;r.Paint.marker(e,r.MARKER_TYPE.OUTLIER,t.midX,t.midY,r.Color.red,(n=.8*Math.min(t.width,t.height),Math.min(Math.max(n,0),30)))}function g(e,t,n){if(t&&n)for(const o of e)!(o.name in n)&&o.name in t&&(n[o.name]=t[o.name])}function v(e){if(0===e.length)return{};let t,n,o,r=Number.MAX_VALUE,i=Number.MAX_VALUE,s=Number.MIN_VALUE,a=Number.MIN_VALUE,l=!1,u=!1,c=!1;for(const d of e)null!==d.minX&&void 0!==d.minX&&(r=Math.min(r,d.minX)),null!==d.minY&&void 0!==d.minY&&(i=Math.min(i,d.minY)),null!==d.maxX&&void 0!==d.maxX&&(s=Math.max(s,d.maxX)),null!==d.maxY&&void 0!==d.maxY&&(a=Math.max(a,d.maxY)),null!==d.title&&void 0!==d.title&&(null!=o||(o=d.title)),null!==d.xAxisName&&void 0!==d.xAxisName&&(null!=t||(t=d.xAxisName)),null!==d.yAxisName&&void 0!==d.yAxisName&&(null!=n||(n=d.yAxisName)),null!==d.logX&&void 0!==d.logX&&d.logX&&(l=!0),null!==d.logY&&void 0!==d.logY&&d.logY&&(u=!0),null!==d.allowXZeroes&&void 0!==d.allowXZeroes&&d.allowXZeroes&&(c=!0);return{minX:r===Number.MAX_VALUE?void 0:r,minY:i===Number.MAX_VALUE?void 0:i,maxX:s===Number.MIN_VALUE?void 0:s,maxY:a===Number.MIN_VALUE?void 0:a,title:o,xAxisName:t,yAxisName:n,logX:l,logY:u,allowXZeroes:c}}function y(e){if(0===e.length)return null;const t={points:[],name:e[0].name,fitFunction:e[0].fitFunction,markerType:e[0].markerType,lineStyle:e[0].lineStyle,pointColor:e[0].pointColor,fitLineColor:e[0].fitLineColor,confidenceIntervalColor:e[0].confidenceIntervalColor,outlierColor:e[0].outlierColor,connectDots:e[0].connectDots,showFitLine:e[0].showFitLine,showPoints:e[0].showPoints,showCurveConfidenceInterval:e[0].showCurveConfidenceInterval,errorModel:e[0].errorModel,clickToToggle:e[0].clickToToggle,labels:e[0].labels,droplines:e[0].droplines,columnName:e[0].columnName};for(const n of e)t.points=[...t.points,...n.points];return t}function x(e,t=!0){var n;const o=null===(n=null==e?void 0:e.cell)||void 0===n?void 0:n.column;return t&&o&&(null==e?void 0:e.cell)?O.parsedCurves.getOrCreate(`tableId: ${o.dataFrame.id} || tableName: ${o.dataFrame.name} || colName: ${o.name} || colVersion: ${o.version} || rowIdx: ${null==e?void 0:e.tableRowIndex}`,(()=>C(e))):C(e)}function C(e){var t,n,o,i;let s=e.cell.value;s.includes("|")&&(s=s.replaceAll("|",""));const l=e.cell.column,d=l?l.type===r.TYPE.STRING?l.getTag(f.h.TAG_FIT_CHART_FORMAT)===f.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(s):null!==(t=JSON.parse(null!=s?s:"{}"))&&void 0!==t?t:{}:(0,u.Kh)():null!==(n=JSON.parse(null!=s?s:"{}"))&&void 0!==n?n:{},m=e.cell.column?I(e.cell.column):{},h=e.cell.column?_(e.cell.dataFrame):{};null!==(o=d.series)&&void 0!==o||(d.series=[]),null!==(i=d.chartOptions)&&void 0!==i||(d.chartOptions=m.chartOptions),g(a.xs,m.chartOptions,d.chartOptions),g(a.xs,h.chartOptions,d.chartOptions);for(const e of d.series)g(a.IL,d.seriesOptions,e),g(a.IL,m.seriesOptions,e),g(a.IL,h.seriesOptions,e);return d}function w(e,t,n,o,r,i=!0){var s;const a=T(e,t,o,!1,r,i),l=null===(s=null==r?void 0:r.cell)||void 0===s?void 0:s.column;return i&&l&&(null==r?void 0:r.cell)?O.fittedCurves.getOrCreate(`tableId: ${l.dataFrame.id} || tableName: ${l.dataFrame.name} || colName: ${l.name} || colVersion: ${l.version} || rowIdx: ${null==r?void 0:r.tableRowIndex}`,(()=>(0,u.nT)(e,n,a,o))):(0,u.nT)(e,n,a,o)}function T(e,t,n,o,r,i=!0){var s;const a=null===(s=null==r?void 0:r.cell)||void 0===s?void 0:s.column;return i&&a&&(null==r?void 0:r.cell)?O.curvesDataPoints.getOrCreate(`tableId: ${a.dataFrame.id} || tableName: ${a.dataFrame.name} || colName: ${a.name} || colVersion: ${a.version} || rowIdx: ${null==r?void 0:r.tableRowIndex} || idx: ${t} || userParamsFlag: ${o}`,(()=>(0,u.Sm)(e,n,o))):(0,u.Sm)(e,n,o)}function _(e){var t,n,o;return JSON.parse(null!==(t=(n=e.tags)[o=f.h.TAG_FIT])&&void 0!==t?t:n[o]=JSON.stringify((0,u.Kh)()))}function I(e){var t,n,o;return JSON.parse(null!==(t=(n=e.tags)[o=f.h.TAG_FIT])&&void 0!==t?t:n[o]=JSON.stringify((0,u.Kh)()))}function b(e,t,n){if(e.width<f.h.MIN_AXES_CELL_PX_WIDTH||e.height<f.h.MIN_AXES_CELL_PX_HEIGHT)return[e,void 0,void 0];const o=t?f.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:f.h.AXES_LEFT_PX_MARGIN,r=t?f.h.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS:f.h.AXES_BOTTOM_PX_MARGIN,i=n?f.h.AXES_TOP_PX_MARGIN_WITH_TITLE:f.h.AXES_TOP_PX_MARGIN;return[e.cutLeft(o).cutBottom(r).cutTop(i).cutRight(f.h.AXES_RIGHT_PX_MARGIN),e.getBottom(r).getTop(i).cutLeft(o).cutRight(f.h.AXES_RIGHT_PX_MARGIN),e.getLeft(o).getRight(f.h.AXES_RIGHT_PX_MARGIN).cutBottom(r).cutTop(i)]}function E(e){return null!=e&&""!==e&&void 0!==r.Color.fromHtml(e)}function N(e){var t;for(let n=0;n<(null===(t=e.series)||void 0===t?void 0:t.length);n++){const t=e.series[n];if(t.points.every((e=>0!==e.x)))continue;let o=Number.MAX_VALUE,r=0,i=0;const s=[];for(let e=0;e<t.points.length;e++)t.points[e].x<o&&0!==t.points[e].x&&(o=t.points[e].x),t.points[e].x>r&&0!==t.points[e].x&&(r=t.points[e].x),s.includes(t.points[e].x)||(s[s.length]=t.points[e].x,i++);const a=Math.pow(10,Math.log10(o)-(Math.log10(r)-Math.log10(o)/(i-1)));for(let e=0;e<t.points.length;e++)0===t.points[e].x&&(t.points[e].x=a)}}function A(e,t,n,o,r){var s,a;if(null!=r||(r=e.cell.column.getTag(f.h.TAG_FIT_CHART_FORMAT)===f.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(e.cell.value):x(e)),t.outlier=!t.outlier,e.cell.column.getTag(f.h.TAG_FIT_CHART_FORMAT)!==f.h.TAG_FIT_CHART_FORMAT_3DX){const r=JSON.parse(e.cell.value);r.series[n].points[o].outlier=t.outlier,e.cell.column.set(e.cell.rowIndex,JSON.stringify(r),!1),i.events.fireCustomEvent("fit-cell-outlier-toggle",{gridCell:e,series:r.series[n],seriesIdx:n,pointIdx:o});const s=e.grid.canvas.getContext("2d");e.render({context:s,bounds:e.bounds})}const l=e.grid.dataFrame.columns.byTags({".sourceColumn":e.cell.column.name});if(l)for(const t of l){const o={logX:null===(s=r.chartOptions)||void 0===s?void 0:s.logX,logY:null===(a=r.chartOptions)||void 0===a?void 0:a.logY},i=null!==t.tags[".seriesAggregation"]?(0,d.JR)(r,t.tags[".seriesAggregation"],e):t.tags[".seriesNumber"]===n?(0,d.VK)(r.series[n],n,o,e):null;null!==i&&t.set(e.cell.rowIndex,i[t.tags[".statistics"]])}}function S(e,t,n=!1){var o,i;if(!e.cell.value)return;const a=r.GridCellWidget.fromGridCell(e);a.root.style.removeProperty("aspectRatio"),a.root.style.height="100%",a.canvas.style.removeProperty("height"),a.canvas.style.removeProperty("width"),a.canvas.style.left="18px",a.canvas.style.top="18px";const l=s.dialog({title:"Edit chart"}).add(a.root).show({resizable:!0,width:null!==(o=null==t?void 0:t.width)&&void 0!==o?o:350,height:null!==(i=null==t?void 0:t.height)&&void 0!==i?i:300});n&&l.sub((0,h.merge)(e.grid.dataFrame.onDataChanged,e.grid.dataFrame.onMetadataChanged).subscribe((()=>a.render())))}let O=o=class extends r.GridCellRenderer{get name(){return f.h.FIT_CELL_TYPE}get cellType(){return f.h.FIT_CELL_TYPE}get defaultHeight(){return f.h.CELL_DEFAULT_HEIGHT}get defaultWidth(){return f.h.CELL_DEFAULT_WIDTH}getDefaultSize(e){return{width:f.h.CELL_DEFAULT_WIDTH,height:f.h.CELL_DEFAULT_HEIGHT}}static inflateScreenBounds(e){return e.inflate(e.width<f.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH?f.h.MIN_INFLATE_SIZE:f.h.INFLATE_SIZE,e.height<f.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT?f.h.MIN_INFLATE_SIZE:f.h.INFLATE_SIZE)}onClick(e,t){var n,r,a,d,m;if(!e.cell.value)return;const h=e.cell.column.getTag(f.h.TAG_FIT_CHART_FORMAT)===f.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(e.cell.value):x(e);for(const[e,t]of Object.entries(f.h.CONDITION_MAP))if(t(h.series))return void(i.shell.o=s.divText(e,{style:{color:"red"}}));i.shell.o=e;const p=o.inflateScreenBounds(e.bounds),g=b(p,this.areAxesLabelsShown(p,h),this.isTitleShown(p,h))[0],v=(0,u.s$)(h),y=new l.L(v,g,null!==(r=null===(n=h.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==r&&r,null!==(d=null===(a=h.chartOptions)||void 0===a?void 0:a.logY)&&void 0!==d&&d);for(let n=0;n<(null===(m=h.series)||void 0===m?void 0:m.length);n++)if(!(h.series[n].connectDots||!h.series[n].clickToToggle||"points"!==h.series[n].showPoints||p.width<f.h.MIN_AXES_CELL_PX_WIDTH||p.height<f.h.MIN_AXES_CELL_PX_HEIGHT))for(let o=0;o<h.series[n].points.length;o++){const r=h.series[n].points[o];if(this.hitTest(t,r,y))return void A(e,r,n,o,h)}}onDoubleClick(e,t){S(e)}areAxesShown(e){return e.width>=f.h.MIN_AXES_CELL_PX_WIDTH&&e.height>=f.h.MIN_AXES_CELL_PX_HEIGHT}areAxesLabelsShown(e,t){var n;return e.width>=f.h.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH&&e.height>=f.h.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT&&!!(null===(n=t.chartOptions)||void 0===n?void 0:n.xAxisName)&&!!t.chartOptions.yAxisName}isTitleShown(e,t){var n;return e.width>=f.h.MIN_TITLE_PX_WIDTH&&e.height>=f.h.MIN_TITLE_PX_HEIGHT&&!!(null===(n=t.chartOptions)||void 0===n?void 0:n.title)}isLegendShown(e){return e.width>=f.h.MIN_LEGEND_PX_WIDTH&&e.height>=f.h.MIN_LEGEND_PX_HEIGHT}areDroplinesShown(e){return e.width>=f.h.MIN_DROPLINES_VISIBILITY_PX_WIDTH&&e.height>=f.h.MIN_DROPLINES_VISIBILITY_PX_HEIGHT}renderCurves(e,t,n,o){var r,i,s,a,c,d,f,h,p,g,v,y,x,C,_,I;e.save(),e.beginPath(),e.rect(t.x,t.y,t.width,t.height),e.clip();const E=(null==o?void 0:o.grid)&&(null==o?void 0:o.grid.dart)&&e.canvas===(null===(r=null==o?void 0:o.grid)||void 0===r?void 0:r.canvas);(null===(i=n.chartOptions)||void 0===i?void 0:i.allowXZeroes)&&(null===(s=n.chartOptions)||void 0===s?void 0:s.logX)&&(null===(a=n.series)||void 0===a?void 0:a.some((e=>e.points.some((e=>0===e.x)))))&&N(n);const[A,S,O]=b(t,this.areAxesLabelsShown(t,n),this.isTitleShown(t,n)),P=(0,u.s$)(n);(P.x<0&&n.chartOptions||0===P.x&&n.chartOptions&&!n.chartOptions.allowXZeroes)&&(n.chartOptions.logX=!1),P.y<=0&&n.chartOptions&&(n.chartOptions.logY=!1);const L=new l.L(P,A,null!==(d=null===(c=n.chartOptions)||void 0===c?void 0:c.logX)&&void 0!==d&&d,null!==(h=null===(f=n.chartOptions)||void 0===f?void 0:f.logY)&&void 0!==h&&h),R=Math.min(A.width,A.height),M=R>100?1:.2+R/100*.8,D={logX:null===(p=n.chartOptions)||void 0===p?void 0:p.logX,logY:null===(g=n.chartOptions)||void 0===g?void 0:g.logY};e.save(),e.font='11px Roboto, "Roboto Local"',L.drawCoordinateGrid(e,S,O),e.restore();for(let r=0;r<(null===(v=n.series)||void 0===v?void 0:v.length);r++){const i=n.series[r],s=i.parameters&&i.parameters.length>0;if(i.points.some((e=>void 0===e.x||void 0===e.y)))continue;i.points.sort(((e,t)=>e.x-t.x));let a=!0;const l=(0,u.zB)(i);let c=null;if(!i.connectDots||i.showFitLine)if(i.parameters)(null===(y=n.chartOptions)||void 0===y?void 0:y.logX)&&i.parameters[2]>0&&(i.parameters[2]=Math.log10(i.parameters[2])),c=(0,u._T)(i,l);else{const e=w(i,r,l,D,o,E);c=e.fittedCurve;const t=[...e.parameters];i.parameters=t,a=!1}(0,m.qR)(e,i,{viewport:L,ratio:M,logOptions:D,showAxes:this.areAxesShown(t),showAxesLabels:this.areAxesLabelsShown(t,n),screenBounds:t,curveFunc:c,seriesIdx:r}),(0,m.nx)(e,i,{viewport:L,ratio:M,seriesIdx:r}),(0,m.QW)(e,i,{viewport:L,ratio:M,screenBounds:t,seriesIdx:r}),(0,m.Zk)(e,i,{viewport:L,logOptions:D,showAxes:this.areAxesShown(t),showAxesLabels:this.areAxesLabelsShown(t,n),screenBounds:t,fitFunc:l,userParamsFlag:a,dataPoints:T(i,r,D,a,o,E)}),i.parameters&&(0,m.HQ)(e,i,{viewport:L,ratio:M,showDroplines:this.areDroplinesShown(t),xValue:i.parameters[2],dataBounds:P,curveFunc:c,logOptions:D}),(0,m.yv)(e,i,{statistics:null===(x=n.chartOptions)||void 0===x?void 0:x.showStatistics,fitFunc:l,logOptions:D,dataBox:A,screenBounds:t,seriesIdx:r}),s||delete i.parameters}(0,m.zF)(e,{showTitle:this.isTitleShown(t,n),title:null===(C=n.chartOptions)||void 0===C?void 0:C.title,dataBox:A,screenBounds:t}),(0,m.jI)(e,{showTitle:this.isTitleShown(t,n),dataBox:A,screenBounds:t,showAxesLabels:this.areAxesLabelsShown(t,n),xAxisName:null===(_=n.chartOptions)||void 0===_?void 0:_.xAxisName,yAxisName:null===(I=n.chartOptions)||void 0===I?void 0:I.yAxisName}),(0,m.GU)(e,n,{showLegend:this.isLegendShown(t),dataBox:A,ratio:M}),e.restore()}render(e,t,n,i,s,a,l){var u,d,m,h,g;if(!a.cell.value)return;if(i<f.h.MIN_CELL_RENDERER_PX_WIDTH||s<f.h.MIN_CELL_RENDERER_PX_HEIGHT)return;const v=(null==a?void 0:a.grid)&&(null==a?void 0:a.grid.dart)&&e.canvas===(null===(u=null==a?void 0:a.grid)||void 0===u?void 0:u.canvas),C=(null===(d=a.cell.column)||void 0===d?void 0:d.getTag(f.h.TAG_FIT_CHART_FORMAT))===f.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(a.cell.value):x(a,v),w=o.inflateScreenBounds(new r.Rect(t,n,i,s));for(const[t,n]of Object.entries(f.h.CONDITION_MAP))if(n(C.series))return void p(e,w);(null===(m=a.cell.column)||void 0===m?void 0:m.name)&&(null===(h=C.series)||void 0===h||h.forEach((e=>e.columnName=a.cell.column.name))),(null===(g=C.chartOptions)||void 0===g?void 0:g.mergeSeries)&&(C.series=[y(C.series)]),e.clearRect(w.x,w.y,w.width,w.height),this.renderCurves(e,w,C,a)}hitTest(e,t,n){const o=n.xToScreen(t.x),i=n.yToScreen(t.y),s=(t.outlier?f.h.OUTLIER_PX_SIZE:f.h.POINT_PX_SIZE)/2+f.h.OUTLIER_HITBOX_RADIUS;return new r.Rect(o-s,i-s,2*s,2*s).containsPoint(new r.Point(e.offsetX,e.offsetY))}onMouseMove(e,t){var n,i,a,d,m,h,p,g,v,y,C,w;if(!e.cell.value)return;const T=o.inflateScreenBounds(e.bounds);if(T.width<f.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||T.height<f.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const n=s.canvas(300,200);this.render(n.getContext("2d"),0,0,300,200,e,null);const o=s.divV([n]);s.tooltip.show(o,t.x,t.y)}const _=(null===(n=e.cell.column)||void 0===n?void 0:n.getTag(f.h.TAG_FIT_CHART_FORMAT))===f.h.TAG_FIT_CHART_FORMAT_3DX?(0,c.K)(e.cell.value):x(e);if(T.width>=f.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH&&T.height>=f.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const e=b(T,this.areAxesLabelsShown(T,_),this.isTitleShown(T,_))[0],n=(0,u.s$)(_),o=new l.L(n,e,null!==(a=null===(i=_.chartOptions)||void 0===i?void 0:i.logX)&&void 0!==a&&a,null!==(m=null===(d=_.chartOptions)||void 0===d?void 0:d.logY)&&void 0!==m&&m);for(let e=0;e<(null===(h=_.series)||void 0===h?void 0:h.length);e++)if("points"===_.series[e].showPoints)for(let n=0;n<_.series[e].points.length;n++){const i=_.series[e].points[n];if(this.hitTest(t,i,o))return s.tooltip.show(s.divV([s.divText(`${null!==(g=null===(p=_.chartOptions)||void 0===p?void 0:p.xAxisName)&&void 0!==g?g:"x"}: ${r.format(i.x,(null===(v=_.chartOptions)||void 0===v?void 0:v.logX)?"scientific":"#0.000")}`),s.divText(`${null!==(C=null===(y=_.chartOptions)||void 0===y?void 0:y.yAxisName)&&void 0!==C?C:"y"}: ${r.format(i.y,(null===(w=_.chartOptions)||void 0===w?void 0:w.logY)?"scientific":"#0.000")}`)]),t.x+16,t.y+16),void(!_.series[e].connectDots&&_.series[e].clickToToggle&&T.width>=f.h.MIN_AXES_CELL_PX_WIDTH&&T.height>=f.h.MIN_AXES_CELL_PX_HEIGHT&&(document.body.style.cursor="pointer"))}s.tooltip.hide()}document.body.style.cursor="default"}};O.fittedCurves=new r.LruCache(1e3),O.parsedCurves=new r.LruCache(1e3),O.curvesDataPoints=new r.LruCache(2e3),O=o=function(e,t,n,o){var r,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,n,s):r(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([i.decorators.cellRenderer({name:"Fit",cellType:"fit",virtual:!0})],O)},672:(e,t,n)=>{"use strict";n.d(t,{mE:()=>d,Z:()=>f,jI:()=>b,Zk:()=>x,nx:()=>m,HQ:()=>w,qR:()=>y,GU:()=>E,QW:()=>h,yv:()=>_,zF:()=>I});var o=n(82),r=n(71),i=n(999),s=n(95),a=n(368);const l=window,u=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});class c{static getUniqueName(e,t,n){return l.grok_Utils_GetUniqueName(e,t,null==n?void 0:n.auto,null==n?void 0:n.idx,null==n?void 0:n.render,null==n?void 0:n.choices)}static isEmpty(e){return null==e||""==e}static formatNumber(e){return u.format(e)}}var d;function f(e,t,n){const r=o.Color.toHtml("outlierColor"===n?o.Color.red:o.Color.getCategoricalColor(t));return e[n]&&o.Color.fromHtml(e[n])?e[n]:r}function m(e,t,n){var o;if(null!==(o=t.connectDots)&&void 0!==o&&o){const o=n.viewport;e.strokeStyle=f(t,n.seriesIdx,"pointColor"),e.lineWidth=2*n.ratio,e.beginPath();for(let n=0;n<t.points.length;n++){const r=t.points[n].x,i=t.points[n].y,s=o.xToScreen(r),a=o.yToScreen(i);0===n?e.moveTo(s,a):e.lineTo(s,a)}e.stroke()}}function h(e,t,n){var r;const i=n.screenBounds;!(i.width<s.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||i.height<s.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT)&&(null===(r=t.showPoints)||void 0===r||r)&&(e.strokeStyle=f(t,n.seriesIdx,d.POINT),t.connectDots&&""!==t.showPoints||"points"===t.showPoints?function(e,t,n){const r=n.ratio,i=s.h.POINT_PX_SIZE*r,a=n.viewport,l=t.connectDots,u=f(t,n.seriesIdx,d.POINT),c=f(t,n.seriesIdx,d.OUTLIER);for(let n=0;n<t.points.length;n++){const d=t.points[n],f=a.xToScreen(d.x),m=a.yToScreen(d.y),h=l?u:d.outlier?d.outlierColor&&o.Color.fromHtml(d.outlierColor)?d.outlierColor:c:d.color&&o.Color.fromHtml(d.color)?d.color:u,p=d.marker?d.marker:t.markerType,g=d.outlierMarker?d.outlierMarker:t.outlierMarkerType,v=l?i:d.outlier?s.h.OUTLIER_PX_SIZE*r:d.size?d.size:i,y=l?p:d.outlier?g:p;o.Paint.marker(e,y,f,m,h,v),d.stdev&&!d.outlier&&(e.strokeStyle=h,e.beginPath(),e.moveTo(f,a.yToScreen(d.y+d.stdev)),e.lineTo(f,a.yToScreen(d.y-d.stdev)),e.stroke())}}(e,t,n):["candlesticks","both"].includes(t.showPoints)&&function(e,t,n){const r=n.ratio,i=n.viewport,l=f(t,n.seriesIdx,d.POINT);for(let n=0,u=null;n<t.points.length;n++){const c=t.points[n];if(c.outlier)continue;const d=n+1<t.points.length&&t.points[n+1].x===c.x;if(!u&&d)u=n;else if(null!==u&&!d){const d=[];for(let e=u,o=0;e<=n;e++,o++)d[o]=t.points[e].y;const f=(0,a.k)(d);if(e.beginPath(),p(e,{viewport:i,ratio:r,x:c.x,boxPlotStats:f,color:l}),e.stroke(),"both"===t.showPoints)for(let t=0;t<d.length;t++)(d[t]<f.lowerAdjacentValue||d[t]>f.upperAdjacentValue)&&o.Paint.marker(e,o.MARKER_TYPE.OUTLIER,i.xToScreen(c.x),i.yToScreen(d[t]),l,s.h.CANDLESTICK_OUTLIER_PX_SIZE*r);u=null}}}(e,t,n))}function p(e,t){const n=t.viewport,r=t.x,i=n.xToScreen(r),a=t.boxPlotStats;g(e,r,a.lowerAdjacentValue,n),e.moveTo(i,n.yToScreen(a.lowerAdjacentValue)),e.lineTo(i,n.yToScreen(a.upperAdjacentValue)),g(e,r,a.upperAdjacentValue,n),o.Paint.marker(e,o.MARKER_TYPE.CIRCLE,i,n.yToScreen(a.q2),t.color,s.h.CANDLESTICK_MEDIAN_PX_SIZE*t.ratio)}function g(e,t,n,o){const r=o.xToScreen(t),i=o.yToScreen(n);e.moveTo(r-s.h.CANDLESTICK_BORDER_PX_SIZE/2,i),e.lineTo(r+s.h.CANDLESTICK_BORDER_PX_SIZE/2,i)}function v(e){const t=e.logOptions.logX,n=e.logOptions.logY,o=e.screenBounds,r=e.showAxes?e.showAxesLabels?s.h.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:s.h.AXES_LEFT_PX_MARGIN:0,i=e.showAxes?s.h.AXES_RIGHT_PX_MARGIN:0;return{logX:t,logY:n,xMin:o.x+r,xMax:o.x+o.width-i,viewport:e.viewport}}function y(e,t,n){var o;if(null===(o=t.showFitLine)||void 0===o||o){e.save(),e.strokeStyle=f(t,n.seriesIdx,d.FIT_LINE),e.lineWidth=2*n.ratio,e.beginPath(),t.lineStyle&&e.setLineDash(s.h.LINE_STYLES[t.lineStyle]);const{logX:o,logY:r,xMin:i,xMax:a,viewport:l}=v(n),u=n.curveFunc;for(let t=i;t<=a;t++){const n=o?Math.log10(l.xToWorld(t)):l.xToWorld(t),s=r?l.yToScreen(Math.pow(10,u(n))):l.yToScreen(u(n));t===i?e.moveTo(t,s):e.lineTo(t,s)}e.stroke(),e.restore()}}function x(e,t,n){var o,r,a,l;if((null===(o=t.showFitLine)||void 0===o||o)&&null!==(r=t.showCurveConfidenceInterval)&&void 0!==r&&r){e.strokeStyle=null!==(a=t.confidenceIntervalColor)&&void 0!==a?a:s.h.CONFIDENCE_INTERVAL_STROKE_COLOR,e.fillStyle=null!==(l=t.confidenceIntervalColor)&&void 0!==l?l:s.h.CONFIDENCE_INTERVAL_FILL_COLOR;const o=n.showAxes,r=n.showAxesLabels,u=n.logOptions,c=n.viewport,d=n.screenBounds,f=t.dataPoints,m=(0,i.fY)(t,n.fitFunc,n.userParamsFlag,f,u);C(e,{viewport:c,logOptions:u,showAxes:o,showAxesLabels:r,screenBounds:d,confidenceIntervals:m,confidenceType:s.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP}),C(e,{viewport:c,logOptions:u,showAxes:o,showAxesLabels:r,screenBounds:d,confidenceIntervals:m,confidenceType:s.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.BOTTOM}),function(e,t){e.beginPath();const{logX:n,logY:o,xMin:r,xMax:i,viewport:s}=v(t),a=t.confidenceIntervals.confidenceTop,l=t.confidenceIntervals.confidenceBottom;for(let t=r;t<=i;t++){const i=n?Math.log10(s.xToWorld(t)):s.xToWorld(t),l=o?s.yToScreen(Math.pow(10,a(i))):s.yToScreen(a(i));t===r?e.moveTo(t,l):e.lineTo(t,l)}for(let t=i;t>=r;t--){const r=n?Math.log10(s.xToWorld(t)):s.xToWorld(t),i=o?s.yToScreen(Math.pow(10,l(r))):s.yToScreen(l(r));e.lineTo(t,i)}e.closePath(),e.fill()}(e,{viewport:c,logOptions:u,showAxes:o,showAxesLabels:r,screenBounds:d,confidenceIntervals:m})}}function C(e,t){e.beginPath();const{logX:n,logY:o,xMin:r,xMax:i,viewport:a}=v(t),l=t.confidenceType===s.h.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP?t.confidenceIntervals.confidenceTop:t.confidenceIntervals.confidenceBottom;for(let t=r;t<=i;t++){const i=n?Math.log10(a.xToWorld(t)):a.xToWorld(t),s=o?a.yToScreen(Math.pow(10,l(i))):a.yToScreen(l(i));t===r?e.moveTo(t,s):e.lineTo(t,s)}e.stroke()}function w(e,t,n){var o;if((null===(o=t.showFitLine)||void 0===o||o)&&t.droplines&&n.showDroplines){e.save(),e.strokeStyle="blue",e.lineWidth=n.ratio,e.beginPath(),e.setLineDash([5,5]);const o=n.viewport,r=n.dataBounds,i=n.curveFunc,s=n.logOptions;for(let n=0;n<t.droplines.length;n++)"IC50"===t.droplines[n]&&T(e,{viewport:o,xValue:t.parameters[2],dataBounds:r,curveFunc:i,logOptions:s});e.stroke(),e.restore()}}function T(e,t){const n=t.logOptions.logX,o=t.logOptions.logY,r=n?Math.pow(10,t.xValue):t.xValue,i=t.viewport,s=t.dataBounds,a=n?Math.log10(r):r,l=o?Math.pow(10,t.curveFunc(a)):t.curveFunc(a),u=i.xToScreen(r),c=i.yToScreen(l);e.moveTo(i.xToScreen(s.minX),c),e.lineTo(u,c),e.lineTo(u,i.yToScreen(s.minY))}function _(e,t,n){var o;const a=n.screenBounds,l=a.width<s.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||a.height<s.h.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT?[]:n.statistics;if((null===(o=t.showFitLine)||void 0===o||o)&&l&&l.length>0){const o=n.dataBox,s=n.dataPoints,a=(0,i.VA)(t,n.fitFunc,s,n.logOptions),u=f(t,n.seriesIdx,d.FIT_LINE);for(let t=0;t<l.length;t++){const n=l[t],i=r.nK.find((e=>e.name===n));if(i){const n=c.formatNumber(i.get(a));e.fillStyle=u,e.textAlign="left",e.fillText(i.name+": "+n,o.x+5,o.y+20+20*t)}}}}function I(e,t){t.showTitle&&(e.font='12px Roboto, "Roboto Local"',e.textAlign="center",e.fillStyle="black",e.fillText(t.title,t.dataBox.midX-5,t.screenBounds.y+15))}function b(e,t){if(t.showAxesLabels){const n=t.screenBounds,o=t.dataBox;e.font='11px Roboto, "Roboto Local"',e.textAlign="center",e.fillStyle="black",e.fillText(t.xAxisName,o.midX-5,n.maxY-s.h.X_AXIS_LABEL_BOTTOM_PX_MARGIN),e.translate(n.x,n.y),e.rotate(-Math.PI/2);const r=t.showTitle?s.h.AXES_TOP_PX_MARGIN_WITH_TITLE:s.h.AXES_TOP_PX_MARGIN;e.fillText(t.yAxisName,-(o.height/2+r+15),15),e.restore()}}function E(e,t,n){var o,r,i,s;if(n.showLegend){const a=n.dataBox,l=n.ratio;e.font='11px Roboto, "Roboto Local"';const u=[...new Set(null===(o=t.series)||void 0===o?void 0:o.map((e=>e.columnName)))].filter((e=>null!=e));let c=0;for(let n=0;n<u.length;n++){const o=u[n];(null===(r=t.chartOptions)||void 0===r?void 0:r.showColumnLabel)&&N(e,o,{dataBox:a,columnIdx:n,drawnCurvesInLegend:c});const d=null===(i=t.series)||void 0===i?void 0:i.filter((e=>e.columnName===o));for(let o=0;o<(null==d?void 0:d.length);o++){const r=d[o];""!==r.name&&null!==r.name&&void 0!==r.name&&(A(e,r,{dataBox:a,ratio:l,columnIdx:n,drawnCurvesInLegend:c,showColumnLabel:null===(s=t.chartOptions)||void 0===s?void 0:s.showColumnLabel,seriesIdx:o}),c++)}}e.restore()}}function N(e,t,n){const o=n.dataBox;e.beginPath(),e.fillStyle="black";const r=e.measureText(t).width;e.fillText(t,o.maxX-r,o.y+s.h.LEGEND_TOP_PX_MARGIN+(n.columnIdx*s.h.LEGEND_RECORD_PX_HEIGHT+s.h.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend))}function A(e,t,n){const r=n.dataBox,i=n.columnIdx,a=n.ratio,l=n.showColumnLabel,u=n.drawnCurvesInLegend,c=f(t,n.seriesIdx,d.POINT),m=f(t,n.seriesIdx,d.FIT_LINE);e.beginPath(),e.strokeStyle=m,e.lineWidth=2*a;const h=e.measureText(t.name).width;e.moveTo(r.maxX-h-s.h.LEGEND_RECORD_LINE_PX_WIDTH-s.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,r.y+s.h.LEGEND_TOP_PX_MARGIN-s.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(l?s.h.LEGEND_RECORD_PX_HEIGHT*(i+1):0)+s.h.LEGEND_RECORD_PX_HEIGHT*u),e.lineTo(r.maxX-h-s.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,r.y+s.h.LEGEND_TOP_PX_MARGIN-s.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(l?s.h.LEGEND_RECORD_PX_HEIGHT*(i+1):0)+s.h.LEGEND_RECORD_PX_HEIGHT*u);const p=t.markerType?t.markerType:o.MARKER_TYPE.CIRCLE;o.Paint.marker(e,p,r.maxX-h-s.h.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN-s.h.LEGEND_RECORD_LINE_PX_WIDTH/2,r.y+s.h.LEGEND_TOP_PX_MARGIN-s.h.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(l?s.h.LEGEND_RECORD_PX_HEIGHT*(i+1):0)+s.h.LEGEND_RECORD_PX_HEIGHT*u,c,s.h.POINT_PX_SIZE*a),e.fillStyle=m,e.fillText(t.name,r.maxX-h,r.y+s.h.LEGEND_TOP_PX_MARGIN+(l?s.h.LEGEND_RECORD_PX_HEIGHT*(i+1):0)+s.h.LEGEND_RECORD_PX_HEIGHT*u),e.stroke()}!function(e){e.POINT="pointColor",e.OUTLIER="outlierColor",e.FIT_LINE="fitLineColor"}(d||(d={}))},48:(e,t,n)=>{"use strict";var o=n(407),r=n(82),i=n(389),s=n(328),a=n(71);const l=rxjs.operators;var u,c=n(858),d=n(95);let f=u=class extends r.JsViewer{constructor(){super(),this.curvesColumnNames=[],this.showSelectedRowsCurves=!1,this.showCurrentRowCurve=!0,this.showMouseOverRowCurve=!0,this.mergeColumnSeries=!1,this.rows=[],this.data=new a.oH,this.gridCellWidget=r.GridCellWidget.fromGridCell(this.createGridCell("")),this.canvas=this.gridCellWidget.canvas,this.root.append(this.gridCellWidget.canvas),i.tools.handleResize(this.root,((e,t)=>{this.canvas.width=e,this.canvas.height=t,this.render()})),this.curvesColumnNames=this.addProperty("curvesColumnNames",r.TYPE.COLUMN_LIST,[],{semType:d.h.FIT_SEM_TYPE}),this.showSelectedRowsCurves=this.bool("showSelectedRowsCurves",!1,{description:"Adds curves from the selected rows"}),this.showCurrentRowCurve=this.bool("showCurrentRowCurve",!0),this.showMouseOverRowCurve=this.bool("showMouseOverRowCurve",!0),this.mergeColumnSeries=this.bool("mergeColumnSeries",!1);for(const e of a.xs)this.addProperty("mergeSeries"===e.name?"mergeCellSeries":e.name,e.propertyType,e.defaultValue,e.options)}static fromChartData(e){let t=new u;return t.data=e,t.render(),t}createGridCell(e){const t=r.GridCell.fromValue(e);return t.cellType=d.h.FIT_CELL_TYPE,t}applyViewerProperties(){(0,o.g2)(a.xs,this,this.data.chartOptions)}mergeViewerChartOptions(){for(const e of a.xs)if(["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===e.name?"mergeCellSeries":e.name)?void 0!==this["mergeSeries"===e.name?"mergeCellSeries":e.name]:void 0!==this.props.get(e.name)&&this.props.get(e.name)!==e.defaultValue){if(["title","xAxisName","yAxisName"].includes(e.name)&&""===this.props.get(e.name))continue;["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===e.name?"mergeCellSeries":e.name)?this.data.chartOptions[e.name]=this[e.name]:this.data.chartOptions[e.name]=this.props.get(e.name)}}createChartData(){var e,t,n,i,s,l;if(0===(null===(e=this.curvesColumnNames)||void 0===e?void 0:e.length))return;this.rows.length=0;let u=-1;this.showCurrentRowCurve&&-1!==this.dataFrame.currentRowIdx&&this.rows.push(this.dataFrame.currentRowIdx),this.showMouseOverRowCurve&&-1!==this.dataFrame.mouseOverRowIdx&&this.rows.push(this.dataFrame.mouseOverRowIdx),this.showSelectedRowsCurves&&-1!==this.dataFrame.mouseOverRowIdx&&(u=this.rows.length,this.rows.push(...this.dataFrame.selection.getSelectedIndexes())),this.data=new a.oH;const c=null===(t=this.tableView)||void 0===t?void 0:t.grid,d=this.props.get("mergeCellSeries"),f=[];for(const e of this.curvesColumnNames){const t=[];for(const r of new Set(this.rows)){const i=c.cell(e,c.tableRowToGrid(r));if(""===i.cell.value)continue;const s=(0,o.h8)(i);null===(n=s.series)||void 0===n||n.forEach((e=>e.columnName=i.cell.column.name));const a=s.chartOptions;if(null!=a&&(f[f.length]=a),d){const e=(0,o.wU)(s.series);void 0!==(null==a?void 0:a.title)&&""!==(null==a?void 0:a.title)&&(e.name=null==a?void 0:a.title),s.series=[e]}t.push(...s.series)}this.mergeColumnSeries?null===(i=this.data.series)||void 0===i||i.push((0,o.wU)(t)):null===(s=this.data.series)||void 0===s||s.push(...JSON.parse(JSON.stringify(t)))}this.data.chartOptions=(0,o.LX)(f),this.mergeViewerChartOptions(),null===(l=this.data.series)||void 0===l||l.forEach(((e,t)=>{var n,o,i,s,a;if(e.pointColor=r.Color.toHtml(r.Color.getCategoricalColor((null===(n=this.data.series)||void 0===n?void 0:n.length)>20?0:t)),e.fitLineColor=r.Color.toHtml(r.Color.getCategoricalColor((null===(o=this.data.series)||void 0===o?void 0:o.length)>20?0:t)),e.showCurveConfidenceInterval=!1,e.droplines=[],(null===(i=this.data.series)||void 0===i?void 0:i.length)>20&&(e.showPoints="",e.lineStyle="solid"),(null===(s=this.data.series)||void 0===s?void 0:s.length)>10&&(null===(a=this.data.series)||void 0===a?void 0:a.length)<100&&t>=u){const t=r.Color.fromHtml(e.fitLineColor);e.fitLineColor=`rgba(${r.Color.r(t)}, ${r.Color.g(t)}, ${r.Color.b(t)}, 0.2)`}}))}onPropertyChanged(e){var t,n,o,r,i;"curvesColumnNames"===(null==e?void 0:e.name)&&(this.props.set("showColumnLabel",(null===(t=this.curvesColumnNames)||void 0===t?void 0:t.length)>1),this.showColumnLabel=(null===(n=this.curvesColumnNames)||void 0===n?void 0:n.length)>1),["logX","logY","allowXZeroes","mergeCellSeries","showColumnLabel"].includes("mergeSeries"===(null==e?void 0:e.name)?"mergeCellSeries":null!==(o=null==e?void 0:e.name)&&void 0!==o?o:"")&&(this["mergeSeries"===(null==e?void 0:e.name)?"mergeCellSeries":null!==(r=null==e?void 0:e.name)&&void 0!==r?r:""]=this[null!==(i=null==e?void 0:e.name)&&void 0!==i?i:""]),this.applyViewerProperties(),this.createChartData(),this.render()}onTableAttached(){var e;const t=null===(e=this.tableView)||void 0===e?void 0:e.grid,n=this.dataFrame.columns.bySemType(d.h.FIT_SEM_TYPE);null!==n&&(this.curvesColumnNames=[n.name]),(0,c.merge)(this.dataFrame.onCurrentCellChanged,t.onCellMouseEnter,this.dataFrame.onSelectionChanged).pipe((0,l.debounce)((e=>(0,c.interval)(50)))).subscribe((e=>{this.dataFrame&&(this.createChartData(),this.render())}))}_showErrorMessage(e){this.root.appendChild(i.divText(e,"d4-viewer-error"))}_removeErrorMessage(){const e=this.root.getElementsByClassName("d4-viewer-error")[0];e&&this.root.removeChild(e)}render(){var e,t,n;this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height),this._removeErrorMessage(),0!==(null===(e=this.curvesColumnNames)||void 0===e?void 0:e.length)?0!==(null===(n=null===(t=this.data)||void 0===t?void 0:t.series)||void 0===n?void 0:n.length)?this.gridCellWidget.gridCell=this.createGridCell(JSON.stringify(this.data)):this._showErrorMessage("No data to show."):this._showErrorMessage("The MultiCurveViewer viewer requires a minimum of 1 curves column.")}};f=u=function(e,t,n,o){var r,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,n,s):r(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([s.decorators.viewer({name:"MultiCurveViewer",description:"A viewer that superimposes multiple in-cell curves on one chart",icon:"icons/multi-curve-viewer.png"}),function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}("design:paramtypes",[])],f);var m=n(140);r.ObjectHandler;let h=class extends r.GridCellRenderer{constructor(){super(...arguments),this.plate=new m.Xe}get name(){return"Plate"}get cellType(){return"Plate"}getDefaultSize(e){return{width:120,height:80}}render(e,t,n,o,i,s,a){this.plate.plateData=s.value,this.plate.grid.props.colHeaderHeight=i>120?16:0,this.plate.grid.props.showRowHeader=o>100,this.plate.grid.render(e,new r.Rect(t,n,o,i).cutTop(Math.min(i/20,5)).cutRight(Math.min(o/20,5)))}onClick(e,t){s.shell.o=m.Xe.detailedView(e.value).root}};h=function(e,t,n,o){var r,i=arguments.length,s=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(s=(i<3?r(s):i>3?r(t,n,s):r(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}([s.decorators.cellRenderer({cellType:"Plate"})],h),n(667),n(471),n(283);var p=n(973),g=(n(572),n(358));new class{isApplicable(e){return e.startsWith("Plate information")&&e.includes("DELFIA")&&e.includes("Number of the wells in the plate,,,,96")}read(e){const t=e.indexOf(",01,02,03,04,05,06,07,08,09,10,11,12,");let n=e.indexOf("\n\n",t+1);return n=-1!=n?n:e.indexOf("\r\n\r\n",t+1),p.T6.fromCsv(e.substring(t,n))}},new class{isApplicable(e){return e.includes("PltRpt=1")&&e.includes("Group=1")}read(e){let t=e.indexOf("\n\n");t=-1==t?e.indexOf("\r\n\r\n"):t;const n=e.substring(e.indexOf("\n")+1,t),o=r.DataFrame.fromCsv(n,{delimiter:"\t"});return p.T6.fromTableByRow(o)}},new class{isApplicable(e){return e.includes("No. of Channels / Multichromatics:")&&e.includes("No. of Cycles:")}read(e){const t=e.indexOf("A01;");if(-1===t)throw new Error("Data section not found");const n=e.substring(t).split("\n").map((e=>e.trim())).filter((e=>e.length>0)).map((e=>e.split(";").map((e=>e.trim())))),o=p.T6.autoSize(n.map((e=>(0,g.cx)(e[0])))),r=o.data.columns.addNewFloat("Channel A"),i=o.data.columns.addNewFloat("Channel B");for(const e of n){const[t,n,s]=e;if(!t||3!==t.length)continue;const[a,l]=(0,g.cx)(t),u=o._idx(a,l);r.set(u,parseFloat(n),!1),i.set(u,parseFloat(s),!1)}return o}},new class{isApplicable(e){return e.includes("Plate:")&&e.includes("##BLOCKS=")}read(e){const t=e.split(/\r\n|\r|\n/),n=t[2].split("\t").filter((e=>""!==e)),o=parseInt(t[1].split("\t")[8]),r=n.filter(((e,t)=>""==e&&t<5||!/^-?\d+$/.test(e))),i=n.filter((e=>/^-?\d+$/.test(e))).length,s=2*i/3,a=[];for(let e=0;e<o;e++){const n=new p.T6(s,i),o=t[e*(s+1)+3].split("\t"),l=r.map(((e,t)=>e+": "+o[t])).filter(((e,t)=>""!=e)).join(", "),u=n.data.columns.addNewFloat(l);for(let n=0;n<s;n++){const o=t[e*(s+1)+3+n].split("\t");for(let e=0;e<i;e++)u.set(n*i+e,parseFloat(o[e+2].replace(",",".")),!1)}a.push(n)}return p.T6.fromPlates(a)}},new r.Package},140:(e,t,n)=>{"use strict";n.d(t,{Xe:()=>m});var o=n(82),r=n(389),i=n(328),s=n(358),a=n(973),l=n(71),u=n(95),c=n(407);n(48);const d=[o.Color.white,o.Color.gray],f=new Map([[96,{rows:8,cols:12}],[384,{rows:16,cols:24}],[1536,{rows:32,cols:48}]]);class m extends o.Widget{constructor(){super(r.div([],"curves-plate-widget")),this._plateData=o.DataFrame.create(),this.grid=o.Viewer.heatMap(this._plateData),this._posToRow=new Map,this.rows=0,this.cols=0,this.colorColumnName="",this.mapFromRowFunc=s.FH,this.root.appendChild(this.grid.root),this.subs.push(this.grid.onAfterDrawContent.subscribe((()=>{this.grid.root.querySelectorAll(".d4-range-selector").forEach((e=>e.style.display="none"))}))),this.grid.onCellRender.subscribe((e=>this.renderCell(e)))}static fromPlate(e){return m.detailedView(e.data)}static detailedView(e){const t=new m;return t.grid.root.style.width="100%",t.plateData=e,t.colorSelector=r.input.column("Color by",{table:e,value:t._colorColumn,onValueChanged:e=>{t._colorColumn=e,t.grid.invalidate()}}),t.detailsDiv=r.divV([]),t.wellDetailsDiv=(0,r.div)(),t.detailsDiv.appendChild(t.wellDetailsDiv),t.grid.onCurrentCellChanged.subscribe((e=>{r.empty(t.wellDetailsDiv);const n=t.dataRow(e);null!=n&&n>=0&&t.wellDetailsDiv.appendChild(r.tableFromMap(t.mapFromRowFunc(t.plateData.rows.get(n))))})),t.root.prepend(t.colorSelector.root),t.root.append(t.detailsDiv),t}static analysisView(e,t){const n=m.detailedView(e.data),d=n.grid.root,f=n.detailsDiv;n.plateActionsDiv=r.div(),n.plateDetailsDiv=r.div(),f.prepend(n.plateDetailsDiv),f.append(n.plateActionsDiv);const h={roleName:"layout",concentrationName:"concentration",valueName:"readout",normalize:!0,controlColumns:["High Control","Low Control"],autoFilterOutliers:!0,categorizeFormula:"${rSquared} > 0.8 && ${Hill} > 0.25 && ${Max} > 80 && ${Max} < 120",statisticsColumns:["Min","Max","rSquared","Hill","IC50","AUC"]};if(Object.entries({concentrationName:["conc","dose","conc.","dilution","concentrations"],valueName:["response","value","signal","raw data","raw signal","raw","response","values"],roleName:["role","plate layout","plate positions","group","compound","well"]}).forEach((([t,n])=>{const o=h[t];if(e.data.columns.contains(o))return;const r=n.find((t=>e.data.columns.contains(t)));r&&(h[t]=r)})),e.data.columns.contains(h.roleName)&&!h.controlColumns.every((t=>e.data.col(h.roleName).categories.includes(t)))){const t=e.data.col(h.roleName).categories.filter((e=>e.toLowerCase().includes("control")));h.controlColumns=t.slice(0,2)}const p=Object.assign(Object.assign({},h),t),g={rSquared:["rsquared","r2","r squared","r^2"],slope:["slope","hill","steepness","hill slope"],bottom:["bottom","min","minimum","miny","min y"],top:["top","max","maximum","maxy","max y"],interceptX:["interceptx","intercept x","ic50","ic 50","ic-50","ic_50","ic 50 value","ic50 value","ic50value","ec50","ec 50","ec-50","ec_50","ec 50 value","ec50 value","ec50value"],auc:["auc","area under the curve","area under curve","area"]},v={};if(p.statisticsColumns.forEach((e=>{const t=Object.entries(g).find((([t,n])=>n.includes(e.toLowerCase())));t&&(v[t[0]]=e)})),!d||!f)return n;const y=r.divH([d,f]);n.root.appendChild(y),f.style.flex="0 0 min(250px, 25%)",d.style.flexGrow="1",d.style.removeProperty("width");const x={exclude:{[p.roleName]:p.controlColumns}};let C=!1;if(p.normalize&&2===p.controlColumns.length){const[t,i]=p.controlColumns.map((t=>e.getStatistics(p.valueName,["mean","std"],{match:{[p.roleName]:t}}))).sort(((e,t)=>e.mean-t.mean));h.plateStatistics={"Z Prime":e=>1-3*(i.std+t.std)/Math.abs(i.mean-t.mean),"Signal to background":e=>i.mean/t.mean},p.plateStatistics||(p.plateStatistics=h.plateStatistics),p.normalizedColName=e.normalize(p.valueName,(e=>(i.mean-e)/(i.mean-t.mean)*100)).name,C=!0;const s={};Object.entries(p.plateStatistics).forEach((([t,n])=>{const r=n(e);s[t]="number"==typeof r?o.format(r,"#0.0000"):r}));const a=r.tableFromMap(s);n.plateDetailsDiv.appendChild(a),p.autoFilterOutliers&&e.markOutliersWhere(p.normalizedColName,(e=>e>106||e<-6),x)}const w=e.doseResponseSeries(Object.assign(Object.assign({},x),{value:C?p.normalizedColName:p.valueName,concentration:p.concentrationName,groupBy:p.roleName})),T=Object.entries(w),_=C?{minY:-10,maxY:110}:0,I=o.Column.string(p.roleName,T.length),b=o.Column.string("Curve",T.length);b.init((e=>JSON.stringify({chartOptions:Object.assign({xAxisName:p.concentrationName,yAxisName:C?`norm(${p.valueName})`:p.valueName,logX:!0,title:`${T[e][0]}`},_),series:[Object.assign(Object.assign({},T[e][1]),{fit:void 0,fitFunction:l.kC,clickToToggle:!0,droplines:["IC50"],name:T[e][0]})]}))),I.init((e=>T[e][0]));const E=o.DataFrame.fromColumns([I,b]);E.name=n.plateData.name,E.id=(0,a.rH)(),b.semType="fit";const N=E.plot.grid();Object.entries(v).forEach((([e,t])=>{const n={df:E,colName:b.name,propName:e,seriesName:"series 0",seriesNumber:0,newColName:t};o.Func.find({name:"addStatisticsColumn"})[0].prepare(n).callSync({processed:!1})})),v.interceptX&&E.col(v.interceptX)&&(E.col(v.interceptX).meta.format="scientific");const A=E.columns.addNewString(E.columns.getUnusedName("Criteria"));A.applyFormula(`if(${p.categorizeFormula}, "Qualified", "Fails Criteria")`,"string"),A.meta.colors.setCategorical({"Fails Criteria":4294922560,Qualified:4283477800}),N.root.style.width="100%",n.root.style.display="flex",n.root.style.flexDirection="column",n.root.style.height="100%",n.root.appendChild(N.root);let S=null;n.mapFromRowFunc=t=>(0,s.FH)(t,((t,o)=>{e._markOutlier(t,o),S&&S.curvesGridCell&&(0,c.Fw)(S.curvesGridCell,{x:0,y:0,outlier:!o},0,S.pointIndex),n.grid.invalidate()})),n.subs.push(n.grid.onCurrentCellChanged.subscribe((e=>{var t,r,i,s,a;if(function(){var e,t;try{if(!S||(null!==(e=S.seriesIndex)&&void 0!==e?e:-1)<0)return;const n=b.get(S.seriesIndex);if(!n)return;const o=JSON.parse(n),r=null===(t=o.series[0])||void 0===t?void 0:t.points;r&&r.length&&r.length>S.pointIndex&&(r[S.pointIndex].marker=S.markerType,r[S.pointIndex].size=S.markerSize,r[S.pointIndex].color=S.markerColor,b.set(S.seriesIndex,JSON.stringify(o)))}catch(e){console.error(e)}finally{S=null}}(),null==(null==e?void 0:e.gridRow)||-1==(null==e?void 0:e.gridRow)||!(null==e?void 0:e.gridColumn)||0==(null==e?void 0:e.gridColumn.idx))return;const l=n.dataRow(e);if(null==l||l<0)return;const c=null===(t=n.plateData.get(p.roleName,l))||void 0===t?void 0:t.toLowerCase();if(!c)return;const d=T.findIndex((([e,t])=>(null==e?void 0:e.toLowerCase())===c));if(d<0)return;const f=n.plateData.get(p.concentrationName,l),m=n.plateData.get(C?p.normalizedColName:p.valueName,l),h=T[d][1].points.findIndex((e=>e.x===f&&e.y===m));if(h<0)return;S={seriesIndex:d,pointIndex:h,markerType:null!==(r=T[d][1].points[h].marker)&&void 0!==r?r:o.MARKER_TYPE.CIRCLE,markerSize:null!==(i=T[d][1].points[h].size)&&void 0!==i?i:u.h.POINT_PX_SIZE,markerColor:null!==(s=T[d][1].points[h].color)&&void 0!==s?s:o.Color.toHtml(o.Color.getCategoricalColor(0))};const g=JSON.parse(b.get(d)),v=null===(a=g.series[0])||void 0===a?void 0:a.points;v&&v.length&&v.length>h&&(v[h].marker=o.MARKER_TYPE.SQUARE,v[h].size=2*u.h.POINT_PX_SIZE,v[h].color=o.Color.toHtml(o.Color.green),b.set(d,JSON.stringify(g)));const y=N.tableRowToGrid(d);S.curvesGridCell=N.cell(b.name,y),S.curvesGridCell&&N.scrollToCell(b.name,y)}))),n.subs.push(i.events.onCustomEvent("fit-cell-outlier-toggle").subscribe((t=>{if(!t||!t.gridCell||!t.series||null==t.pointIdx||t.gridCell.cell.column!==b)return;const o=t.series.points[t.pointIdx];null!==o.meta&&(e._markOutlier(o.meta,!!o.outlier),n.grid.invalidate())})));const O=o.debounce(N.onAfterDrawContent,300).subscribe((()=>{O.unsubscribe(),N.col(b.name)&&(N.col(b.name).width=400),N.props.rowHeight=200}));if(p.submitAction){const t=r.button("Save to ELN",(()=>p.submitAction(e,E)));n.plateActionsDiv.appendChild(t)}return n}get plateData(){return this._plateData}set plateData(e){var t,n,r,i,s,a,l,u,c,d;this._plateData=e,this._colorColumn=null!==(i=null!==(r=null!==(n=null!==(t=e.columns.firstWhere((e=>"activity"==e.name&&e.type==o.TYPE.FLOAT)))&&void 0!==t?t:e.columns.firstWhere((e=>("concentration"==e.name||"concentrations"==e.name)&&e.type==o.TYPE.FLOAT)))&&void 0!==n?n:e.columns.firstWhere((e=>"row"!=e.name&&"col"!=e.name&&e.type==o.TYPE.FLOAT)))&&void 0!==r?r:e.columns.firstWhere((e=>e.type==o.TYPE.FLOAT)))&&void 0!==i?i:e.columns.byIndex(0);let m=this._plateData.col("row"),h=this._plateData.col("col");if(this.rows=null!==(a=null===(s=null==m?void 0:m.stats)||void 0===s?void 0:s.max)&&void 0!==a?a:null===(l=f.get(e.rowCount))||void 0===l?void 0:l.rows,this.cols=null!==(c=null===(u=null==h?void 0:h.stats)||void 0===u?void 0:u.max)&&void 0!==c?c:null===(d=f.get(e.rowCount))||void 0===d?void 0:d.cols,null==this.rows||null==this.cols)throw"Row/col columns not found, and dataframe length is not of the recognized sizes (96, 384, 1536)";for(let e=0;e<this._plateData.rowCount;e++)m&&h?this._posToRow.set(`${m.get(e)}:${h.get(e)}`,e):this._posToRow.set(`${Math.floor(e/this.cols)}:${e%this.cols+1}`,e);this.grid.dataFrame=o.DataFrame.create(this.rows),this.grid.columns.clear();for(let e=0;e<=this.cols;e++)this.grid.columns.add({gridColumnName:e.toString(),cellType:"string"});this.grid.invalidate()}dataRow(e){return this._posToRow.get(`${e.gridRow}:${e.gridColumn.idx}`)}renderCell(e){var t,n,r;const i=e.cell;e.g.fillStyle="grey",e.g.strokeStyle="grey",e.g.lineWidth=1;let s=e.g,l=e.bounds.x,u=e.bounds.y,c=e.bounds.width,d=e.bounds.height;const f=this.dataRow(i);s.textAlign="center",s.textBaseline="middle",s.font=`${Math.ceil(Math.min(16,c-1,d-1))}px Roboto, Roboto Local`;const m=null===(r=null===(n=null===(t=this._colorColumn)||void 0===t?void 0:t.name)||void 0===n?void 0:n.toLowerCase())||void 0===r?void 0:r.includes("conc");if(i.isColHeader&&i.gridColumn.idx>0)s.fillText(""+i.gridColumn.idx,l+c/2,u+d/2);else if(0==i.gridColumn.idx&&i.gridRow>=0){const e=i.gridRow>25?"A":"";s.fillText(e+String.fromCharCode(65+i.gridRow%26),l+c/2,u+d/2)}else if(d>0&&null!=f){s.beginPath();const e=.8*Math.min(d/2,c/2);if(s.ellipse(l+c/2,u+d/2,e,e,0,0,2*Math.PI),this._colorColumn){this._colorColumn.isCategorical&&this._colorColumn.meta.colors.getType()!==o.COLOR_CODING_TYPE.CATEGORICAL&&this._colorColumn.meta.colors.setCategorical();const t=this._colorColumn.isNone(f)?o.Color.white:this._colorColumn.isNumerical?this.getColor(f,m):this._colorColumn.meta.colors.getColor(f);s.fillStyle=o.Color.toHtml(t),s.fill();const n=this.plateData.col(a.bP);(null==n?void 0:n.get(f))&&(s.strokeStyle=o.Color.toHtml(o.Color.red),s.lineWidth=2,s.moveTo(l+c/2-e,u+d/2-e),s.lineTo(l+c/2+e,u+d/2+e),s.moveTo(l+c/2+e,u+d/2-e),s.lineTo(l+c/2-e,u+d/2+e),s.stroke())}s.stroke()}e.preventDefault()}getColor(e,t){const n=this._colorColumn.get(e),r=t?(0,s.Ei)(1e9*(n-this._colorColumn.min)):n,i=t?(0,s.Ei)(Math.max(this._colorColumn.min,1)):this._colorColumn.min,a=t?(0,s.Ei)(1e9*(this._colorColumn.max-this._colorColumn.min)):this._colorColumn.max;return o.Color.scaleColor(r,i,a,void 0,d)}}},973:(e,t,n)=>{"use strict";n.d(t,{bP:()=>b,T6:()=>N,rH:()=>E});var o=n(82),r=n(328),i=n(389),s=n(991),a=n.n(s),l=n(358),u=n(71),c=n(999);class d{}class f{constructor(e,t){this.auc=e.auc,this.rSquared=e.rSquared,this.series=t}}class m extends f{get name(){return u.Ff}constructor(e,t){super(e,t),this.slope=e.slope,this.intercept=e.intercept}}class h extends m{get name(){return u.kx}}class p extends f{get name(){return u.G7}constructor(e,t){super(e,t),this.top=e.top,this.slope=e.slope,this.ic50=e.ic50,this.bottom=e.bottom}}class g extends f{get name(){return u.Pf}constructor(e,t){super(e,t),this.mantissa=e.mantissa,this.power=e.power}}class v extends f{get name(){return u.kC}constructor(e,t){super(e,t),this.top=e.top,this.bottom=e.bottom,this.slope=e.slope,this.ec50=e.ec50}}function y(e,t){return{auc:(0,u.Mi)(e,t),rSquared:(0,u.Hr)(e,t)}}const x={linear:new class extends d{get name(){return u.Ff}get parameterNames(){return["Slope","Intercept"]}fillParams(e,t){return new m({...y(e.fittedCurve,(0,c.Sm)(t)),slope:e.parameters[0],intercept:e.parameters[1]},t)}y(e,t){return(0,u.sn)(e,t)}getInitialParameters(e,t){let n=0,o=0;for(let t=1;t<e.length;t++)e[t]<e[n]&&(n=t),e[t]>e[o]&&(o=t);const r=e[o]-e[n],i=(t[o]-t[n])/r,s=t[o]-i*e[o],a=new Float32Array(2);return a.set([i,s]),a}},sigmoid:new class extends d{get name(){return u.G7}get parameterNames(){return["Top","Slope","IC50","Bottom"]}fillParams(e,t){return new p({...y(e.fittedCurve,(0,c.Sm)(t)),top:e.parameters[0],slope:e.parameters[1],ic50:e.parameters[2],bottom:e.parameters[3]},t)}y(e,t){return(0,u.ry)(e,t)}getInitialParameters(e,t){const n=o.Rect.fromXYArrays(e,t),r=(n.maxY-n.minY)/2+n.minY;let i=n.maxY-n.minY,s=0;for(let n=0;n<e.length;n++){const e=Math.abs(t[n]-r);e<i&&(i=e,s=n)}const a=e[s],l=t[0]>t[t.length-1]?1:-1,u=new Float32Array(4);return u.set([n.maxY,l,a,n.minY]),u}},"log-linear":new class extends d{get name(){return u.kx}get parameterNames(){return["Slope","Intercept"]}fillParams(e,t){return new h({...y(e.fittedCurve,(0,c.Sm)(t)),slope:e.parameters[0],intercept:e.parameters[1]},t)}y(e,t){return(0,u.AJ)(e,t)}getInitialParameters(e,t){const n=new Float32Array(2);return n.set([-5,100]),n}},exponential:new class extends d{get name(){return u.Pf}get parameterNames(){return["Mantissa","Power"]}fillParams(e,t){return new g({...y(e.fittedCurve,(0,c.Sm)(t)),mantissa:e.parameters[0],power:e.parameters[1]},t)}y(e,t){return(0,u.EV)(e,t)}getInitialParameters(e,t){const n=new Float32Array(2);return n.set([100,-2]),n}},"4pl-regression":new class extends d{get name(){return u.kC}get parameterNames(){return["Top","Slope","EC50","Bottom"]}fillParams(e,t){return new v({...y(e.fittedCurve,(0,c.Sm)(t)),top:e.parameters[0],slope:e.parameters[1],ec50:e.parameters[2],bottom:e.parameters[3]},t)}y(e,t){return(0,u.Sm)(e,t)}getInitialParameters(e,t){const n=new Float32Array(4),o=Math.min(...t),r=Math.max(...t),i=(r-o)/2+o;let s=r-o,a=0;for(let n=0;n<e.length;n++){const e=Math.abs(t[n]-i);e<s&&(s=e,a=n)}const l=e[a],u=t[0]>t[t.length-1]?-10:10;return n.set([r,u,l,o]),n}}};class C{constructor(e){this.series=e}linear(){return x[u.Ff].fillParams((0,c.nT)(this.series,x[u.Ff]),this.series)}logLinear(){return x[u.kx].fillParams((0,c.nT)(this.series,x[u.kx]),this.series)}sigmoid(){return x[u.G7].fillParams((0,c.nT)(this.series,x[u.G7]),this.series)}exponential(){return x[u.Pf].fillParams((0,c.nT)(this.series,x[u.Pf]),this.series)}fourPL(){return x[u.kC].fillParams((0,c.nT)(this.series,x[u.kC]),this.series)}}class w{constructor(e){this.points=e,this.fit=new C(this)}}new w([{x:0,y:0},{x:1,y:.5},{x:2,y:1},{x:3,y:10,outlier:!0},{x:4,y:0}]);var T=n(140),_=n(407),I=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};const b="Outlier";function E(){return`${Math.random()}-${Math.random()}-${Math.random()}-${Math.random()}-${Math.random()}-${Math.random()}-${Math.random()}-${Math.random()}`}class N{constructor(e,t){this.rows=8,this.cols=12,this.data=o.DataFrame.create(e*t),this.rows=e,this.cols=t}static autoSize(e){const[t,n]=(0,l.au)((0,l.OQ)(e));return new N(t,n)}_idx(e,t){return e*this.cols+t}_markOutlier(e,t=!0){this.data.columns.getOrCreate(b,o.TYPE.BOOL).set(e,t)}markOutlier(e,t,n=!0){this._markOutlier(this._idx(e,t),n)}_isOutlier(e){return this.data.columns.getOrCreate(b,o.TYPE.BOOL).get(e)}isOutlier(e,t){return this._isOutlier(this._idx(e,t))}markOutliersWhere(e,t,n){this.values([e],n).forEach((n=>{t(n[e])&&this._markOutlier(n.innerDfRow,!0)}))}static fromTable(e,t){var n,r,i;const s=e.rowCount,u=a()(e.columns).filter((e=>!function(e){return e.type==o.TYPE.STRING&&o.range(s).every((t=>(0,l.JG)(t)==e.get(t).toUpperCase()))}(e))).toArray(),c=u.length,d=new N(s,c),f=u.filter((e=>e.stats.missingValueCount!=s)),m=f.length>0&&-1!=f.findIndex((e=>e.type!=f[0].type))?o.TYPE.STRING:null!==(r=null===(n=(0,l.U1)(u,(e=>e.stats.missingValueCount!=s)))||void 0===n?void 0:n.type)&&void 0!==r?r:o.TYPE.STRING,h=d.data.columns.addNew(null!==(i=e.name)&&void 0!==i?i:t,m);for(let e=0;e<u.length;e++)if(u[e].stats.missingValueCount!=s)for(let t=0;t<s;t++)h.set(d._idx(t,e),m!=o.TYPE.STRING?u[e].get(t):u[e].getString(t),!1);return d}static fromTableByRow(e,t){const n=a()(e.columns).find((e=>e.type==o.TYPE.STRING&&/^([A-Za-z]+)(\d+)$/.test(e.get(0))));if(!n)throw"Column with well positions not found";const[r,i]=(0,l.au)((0,l.OQ)(a()(n.values()).map(l.cx))),s=new N(r,i);for(const t of e.columns){if(t.isEmpty||t==n)continue;const e=s.data.columns.addNew(t.name,t.type);for(let o=0;o<t.length;o++){const[r,s]=(0,l.cx)(n.get(o));e.set(r*i+s,t.get(o),!1)}}return s}static fromCsvTableFile(e,t,n){return I(this,void 0,void 0,(function*(){return this.fromTable(yield r.dapi.files.readCsv(e,n),t)}))}static fromCsvTable(e,t,n){return this.fromTable(o.DataFrame.fromCsv(e,n),t)}static fromCsv(e,t){var n,r;const i=o.DataFrame.fromCsv(e);return o.range(i.rowCount).every((e=>i.col(0).get(e)==String.fromCharCode(65+e)))&&i.columns.remove(i.columns.byIndex(0).name),(13==i.columns.length||25==i.columns.length||49==i.columns.length&&(null===(n=i.col(i.columns.length-1))||void 0===n?void 0:n.isEmpty))&&i.columns.remove(i.columns.length-1),this.fromTable(i,null!==(r=null==t?void 0:t.field)&&void 0!==r?r:"value")}static fromPlates(e,t){(0,l.yO)(e.length>0,"Array is empty."),(0,l.yO)(e.every((t=>t.rows==e[0].rows&&t.cols==e[0].cols)),"Plate dimensions differ.");const n=e.reduce(((e,t)=>e?e.merge(t):t.clone()));return null!=t&&(n.data.name=t),n}static fromExcelFileInfo(e){return I(this,void 0,void 0,(function*(){return e.data&&e.data.length?yield N.fromExcel(e.data,e.friendlyName):yield N.fromExcelPath(e.fullPath,e.friendlyName)}))}static fromExcelPath(e,t){return I(this,void 0,void 0,(function*(){const n=yield r.dapi.files.readAsBytes(e);return this.fromExcel(n,t)}))}static fromExcel(e,t){return I(this,void 0,void 0,(function*(){yield o.Utils.loadJsCss(["/js/common/exceljs.min.js"]);const n=new window.ExcelJS.Workbook,r=function(e){const t=[],n="A".charCodeAt(0);return e.eachSheet((e=>{var o;if("desired outputs"===(null===(o=e.name)||void 0===o?void 0:o.toLowerCase()))return;const r=[];e.eachRow(((e,t)=>{r[t]=[],e.eachCell(((e,n)=>{r[t][n]=e.value}))}));let i=-1,s=-1,a=0;for(let e=1;e<r.length;e++){const t=r[e]||[];let n=0,o=-1;for(let e=1;e<t.length;e++)if("number"==typeof t[e]&&Number.isInteger(t[e])&&t[e]===n+1)0===n&&(o=e),n++;else if(n>0)break;if(n>=12){i=e,s=o,a=n;break}}let l=-1,u=-1,c=0;if(-1!==i)for(let e=1;e<s;e++){let t=0,o=-1;for(let s=i+1;s<r.length;s++){if(!r[s])continue;const i=r[s][e];if("string"==typeof i&&/^[A-Za-z]{1,2}$/.test(i)){const e=(t>25?"A":"")+String.fromCharCode(n+t%26);if((null==i?void 0:i.toLowerCase())!==(null==e?void 0:e.toLowerCase()))break;0===t&&(o=s),t++}else if(t>0)break}if(t>=8){l=e,u=o,c=t;break}}-1!==i&&-1!==l&&t.push({sheet:e,startRow:i,startCol:l,rows:c,cols:a})})),t}(yield n.xlsx.load(e));if(0==r.length)throw'Plates not found in "${excelPath}"';const i=r[0];if(!r.every((e=>e.rows==i.rows||e.cols==i.cols)))throw`Plate sizes differ in "${t}"`;return N.fromPlates(r.map((e=>function(e){const t=o.DataFrame.create(e.rows);for(let n=e.startCol+1;n<=e.startCol+e.cols;n++){const r=o.range(e.rows).map((t=>e.sheet.getCell(e.startRow+t+1,n).toString())).toArray();t.columns.add(o.Column.fromStrings(""+(n-e.startCol+1),r))}return N.fromTable(t,e.sheet.name)}(e))),t)}))}get wells(){const e=this;return function*(){for(let t=0;t<e.rows;t++)for(let n=0;n<e.cols;n++){const o={row:t,col:n};for(const r of e.data.columns)r.isNone(e._idx(t,n))||(o[r.name]=r.get(e._idx(t,n)));yield o}}()}get(e,t,n){if((0,l.yO)(null!=this.data.columns.byName(e),`Field does not exist: ${e}`),"number"==typeof t&&!n)throw"Column not defined";const[o,r]="string"==typeof t?(0,l.cx)(t):[t,n];return this.data.columns.byName(e).get(this._idx(o,r))}normalize(e,t,n=!1){const o=this.data.getCol(e),r=n?o:this.data.columns.addNewFloat(this.data.columns.getUnusedName(`${e}_normalized`));return r.init((e=>o.isNone(e)?null:t(o.get(e)))),r}matches(e,t){const n=this.data.columns,o=t.match?Object.entries(t.match).reduce(((e,[t,n])=>(e[t]=Array.isArray(n)?n:[n],e)),{}):null,r=t.exclude?Object.entries(t.exclude).reduce(((e,[t,n])=>(e[t]=Array.isArray(n)?n:[n],e)),{}):null;return!t||!o&&!r||Object.keys(null!=o?o:{}).filter((e=>n.contains(e))).every((t=>o[t].some((n=>this.data.columns.byName(t).get(e)===n))))&&Object.keys(null!=r?r:{}).filter((e=>n.contains(e))).every((t=>r[t].every((n=>this.data.columns.byName(t).get(e)!==n))))}count(e){if(!e)return this.rows*this.cols;let t=0;for(let n=0;n<this.rows*this.cols;n++)this.matches(n,e)&&t++;return t}values(e,t){var n;const o=e.map((e=>this.data.columns.byName(e)));(0,l.yO)(o.every((e=>null!=e)),`Field does not exist: ${e.find(((e,t)=>null==o[t]))}`);const r={};for(let t=0;t<e.length;t++)r[e[t]]=o[t];const i=[];for(let s=0;s<this.rows*this.cols;s++)if((null!==(n=null==t?void 0:t.includeEmpty)&&void 0!==n&&n||o.every((e=>!e.isNone(s))))&&(!t||this.matches(s,t))){const t=e.reduce(((e,t)=>(e[t]=r[t].isNone(s)?null:r[t].get(s),e)),{});t.innerDfRow=s,i.push(t)}return i}getStatistics(e,t,n){const o=this.fieldValues(e,n),r={};for(const e of t)r[e]=l.IB[e](o);return r}fieldValues(e,t){return this.values([e],t).map((t=>t[e]))}static inspectSeriesByName(e,t,n){t&&n&&N.inspectSeries(e[t],n)}static inspectSeries(e,t){var n;const i=null!==(n=null==e?void 0:e.name)&&void 0!==n?n:"Series";if(!e||!t)return;const s=o.Column.string("Curve",1);s.set(0,JSON.stringify({chartOptions:{logX:!0,title:i},series:[Object.assign(Object.assign({},e),{fit:void 0,fitFunction:t,clickToToggle:!0,droplines:["IC50"],name:i})]}),!1);const a=o.DataFrame.fromColumns([s]);a.name=i,a.id=E(),s.semType="fit",s.tags[o.Tags.CellRenderer]="fit";const l=o.Viewer.grid(a).cell("Curve",0);r.shell.windows.showContextPanel=!0,r.shell.o=l,(0,_.I4)(l,{width:480,height:370},!0)}doseResponseSeries(e){var t,n,o,r;const i={includeEmpty:null!==(t=null==e?void 0:e.includeEmpty)&&void 0!==t&&t,exclude:null!==(n=null==e?void 0:e.exclude)&&void 0!==n?n:{role:["High Control","Low Control"]}},s=null!==(o=null==e?void 0:e.concentration)&&void 0!==o?o:"concentration",a=null!==(r=null==e?void 0:e.value)&&void 0!==r?r:"value",l=this.values([s,a,...(null==e?void 0:e.groupBy)?[e.groupBy]:[]],i),u={};for(const t of l){const n=(null==e?void 0:e.groupBy)?t[e.groupBy]:"0";u[n]||(u[n]={x:[],y:[],meta:[],outlier:[]}),u[n].x.push(t[s]),u[n].y.push(t[a]),u[n].meta.push(t.innerDfRow),u[n].outlier.push(this._isOutlier(t.innerDfRow))}return Object.fromEntries(Object.entries(u).map((([e,t])=>{const n=new w(t.x.map(((e,n)=>({x:t.x[n],y:t.y[n],outlier:t.outlier[n],meta:t.meta[n]}))).sort(((e,t)=>e.x-t.x)));return n.name=e,[e,n]})))}getAnalysisDialog(e){i.dialog("Plate Analysis").add(T.Xe.analysisView(this,e)).showModal(!0)}getAnalysisView(e){const t=o.View.fromRoot(T.Xe.analysisView(this,e).root);return t.name="Plate Analysis",r.shell.addView(t)}merge(e){for(const t of e.data.columns)this.data.columns.add(t.clone());return this}clone(){const e=new N(this.rows,this.cols);return e.data=this.data.clone(),e}print(){for(const e of this.data.columns){console.log(),console.log(e.name),console.log(o.range(this.cols+1).map((e=>0==e?"":`${e}`)).toArray().join("\t"));for(let t=0;t<this.rows;t++)console.log((0,l.JG)(t)+"\t"+o.range(this.cols).map((n=>e.getString(this._idx(t,n)))).toArray().join(",\t"))}}}},358:(e,t,n)=>{"use strict";n.d(t,{Ei:()=>p,FH:()=>g,Fj:()=>d,IB:()=>v,JG:()=>c,OQ:()=>m,U1:()=>u,au:()=>h,cx:()=>f,yO:()=>l});var o=n(82),r=n(973),i=n(991),s=n.n(i),a=n(572);function l(e,t){if(!e)throw new Error("string"==typeof t?t:t())}function u(e,t){for(const n of e)if(t(n))return n;return null}function c(e){l(e>=0,"Column number cannot be negative"),l(e<701,"Column number too large - would require more than 2 letters");const t="A".charCodeAt(0);if(e<24)return String.fromCharCode(t+e);const n=Math.floor(e/26),o=e%26;return String.fromCharCode(t+n-1)+String.fromCharCode(t+o)}function d(e){let t=0;for(let n=0;n<e.length;n++)t=26*t+(e.charCodeAt(n)-64);return t-1}function f(e){const t=e.match(/^([A-Za-z]+)(\d+)$/);if(!t)throw new Error("Invalid cell format. Expected format like 'A3'.");return[d(t[1].toUpperCase()),parseInt(t[2])-1]}function m(e){return s()(e).reduce(((e,[t,n])=>[Math.max(e[0],t),Math.max(e[1],n)]),[0,0])}function h([e,t]){if(e<=8&&t<=12)return[8,12];if(e<=16&&t<=24)return[16,24];if(e<=32&&t<=48)return[32,48];throw`${e}x${t} exceeds maximum plate size 32x48`}function p(e){return e<=0?0:Math.log10(e)}function g(e,t){var n;if(!e||null==e.idx||e.idx<0||!e.table)return{};const i={},s=e.idx;for(const l of e.table.columns)if((null===(n=l.name)||void 0===n?void 0:n.toLowerCase())===(null===r.bP||void 0===r.bP?void 0:r.bP.toLowerCase())&&l.type===o.COLUMN_TYPE.BOOL&&t){const n=!l.isNone(s)&&l.get(s),o=document.createElement("input");o.type="checkbox",o.checked=o.value=n,o.onchange=n=>t(e.idx,o.checked),i[l.name]=o}else i[l.name]=l.isNone(s)?"No data":l.isNumerical&&l.type!==o.COLUMN_TYPE.DATE_TIME?0===(a=l.get(s))?"0":Math.abs(a)<.001?o.format(a,"scientific"):Math.abs(a)<1?o.format(a,"0.0000"):a:l.get(s);var a;return i}const v={mean:a.mean,median:a.median,std:a.stdev,min:a.min,max:a.max,meansqerr:a.meansqerr,geomean:a.geomean}},82:e=>{"use strict";e.exports=DG},328:e=>{"use strict";e.exports=grok},858:e=>{"use strict";e.exports=rxjs},389:e=>{"use strict";e.exports=ui},991:e=>{"use strict";e.exports=wu},234:()=>{}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,loaded:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};(()=>{"use strict";n.r(o),n.d(o,{_package:()=>ye,initAutoTests:()=>Ce,test:()=>xe,tests:()=>f});var e=n(82),t=n(328);n(982);const r=e.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,');r.columns.add(e.Column.fromList(e.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};const s=3e4,a=108e5,l=console.log.bind(console),u=console.info.bind(console),c=console.warn.bind(console),d=console.error.bind(console),f={},m="Auto Tests",h="Demo",p="Detectors",g="Core",v={};let y;var x;!function(e){e.notNull=function(e,t){if(null==e)throw new Error(`${null==t?"Value":t} not defined`)}}(x||(x={}));class C{constructor(e,t){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==t&&(this.report=t)}}class w{constructor(t,n,o,r){var a;this.category=t,this.name=n,null!=r||(r={}),null!==(a=r.timeout)&&void 0!==a||(r.timeout=s),this.options=r,this.test=()=>i(this,void 0,void 0,(function*(){return new Promise(((t,n)=>i(this,void 0,void 0,(function*(){let r="";try{e.Test.isInDebug,r=yield o()}catch(e){n(e)}t(r)}))))}))}}function T(e,t,n){null==f[y]&&(f[y]={}),null==f[y].tests&&(f[y].tests=[]),f[y].tests.push(new w(y,e,t,n))}function _(e,t=!0,n){if(n=n?`${n}, `:"",e!==t)throw new Error(`${n}Expected "${t}", got "${e}"`)}function I(e,t,n=.001,o){if(e===Number.POSITIVE_INFINITY&&t===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&t===Number.NEGATIVE_INFINITY||e===Number.NaN&&t===Number.NaN||isNaN(e)&&isNaN(t))return;const r=Math.abs(e-t)<n;if(_(r,!0,`${null!=o?o:""} (tolerance = ${n})`),!r)throw new Error(`Expected ${t}, got ${e} (tolerance = ${n})`)}function b(e,t){for(const[n,o]of Object.entries(t)){if(!e.hasOwnProperty(n))throw new Error(`Expected property "${n}" not found`);const t=e[n];if(t instanceof Array&&o instanceof Array)E(t,o);else if(t instanceof Object&&o instanceof Object)b(t,o);else if(Number.isFinite(t)&&Number.isFinite(o))I(t,o);else if(t!=o)throw new Error(`Expected (${o}) for key '${n}', got (${t})`)}}function E(e,t){const n=e.length,o=t.length;if(n!=o)throw new Error(`Arrays are of different length: actual array length is ${n} and expected array length is ${o}`);for(let o=0;o<n;o++)if(e[o]instanceof Array&&t[o]instanceof Array)E(e[o],t[o]);else if(e[o]instanceof Object&&t[o]instanceof Object)b(e[o],t[o]);else if(e[o]!=t[o])throw new Error(`Expected ${t[o]} at position ${o}, got ${e[o]}`)}function N(e,t,n){var o;y=e,t(),f[y]&&(f[y].clear=null===(o=null==n?void 0:n.clear)||void 0===o||o,f[y].timeout=null==n?void 0:n.timeout,f[y].benchmarks=null==n?void 0:n.benchmarks,f[y].stressTests=null==n?void 0:n.stressTests,f[y].owner=null==n?void 0:n.owner)}function A(e,t){return e.replace(new RegExp(t.name,"gi"),t.nqName)}function S(n,o){var l,u,c,d,y,x,C;return i(this,void 0,void 0,(function*(){const T=n.id;if(v[T])return;const I=o?o.tests:f;if(void 0!==I[m]||void 0!==I[h]||Object.keys(I).find((e=>e.startsWith(m)||e.startsWith(g))))return void(v[T]=!0);if("DevTools"===n.name||o&&"DevTools"===o._package.name)for(const e of window.dartTests){const t=e.name.split(/\s*\|\s*!/g);let n=null!==(l=t.pop())&&void 0!==l?l:e.name,o=t.length?g+": "+t.join(": "):g,r=n.split(" | ");n=r[r.length-1],r.unshift(o),r.pop(),o=r.join(": "),void 0===I[o]&&(I[o]={tests:[],clear:!0}),I[o].tests.push(new w(o,n,e.test,{isAggregated:!1,timeout:null!==(c=null===(u=e.options)||void 0===u?void 0:u.timeout)&&void 0!==c?c:s,skipReason:null===(d=e.options)||void 0===d?void 0:d.skipReason,owner:null===(y=e.options)||void 0===y?void 0:y.owner}))}const b=[],E=[],N=[],S=yield t.dapi.functions.filter(`package.id = "${T}"`).list(),O=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const o of S){const l=o.options.test,u=o.options.demoPath;if(l&&Array.isArray(l)&&l.length)for(let n=0;n<l.length;n++){const r=l[n].matchAll(O),u={};Array.from(r).forEach((e=>{e[0].startsWith("skip")?u.skip=e[1]:e[0].startsWith("wait")?u.wait=parseInt(e[2]):e[0].startsWith("cat")?u.cat=e[3]:e[0].startsWith("timeout")&&(u.timeout=parseInt(e[4]))}));const c=new w(m,1===l.length?o.name:`${o.name} ${n+1}`,(()=>i(this,void 0,void 0,(function*(){const e=yield t.functions.eval(A(l[n],o));if(u.wait&&(yield M(u.wait)),"boolean"==typeof e&&!e)throw`Failed: ${l[n]}, expected true, got ${e}`}))),{skipReason:u.skip,timeout:e.Test.isInBenchmark?null!==(x=u.benchmarkTimeout)&&void 0!==x?x:a:null!==(C=u.timeout)&&void 0!==C?C:s});if(u.cat){const e=m+": "+u.cat;c.category=e,void 0===I[e]&&(I[e]={tests:[],clear:!0}),I[e].tests.push(c)}else b.push(c)}if(u){const e=o.options.demoWait?parseInt(o.options.demoWait):void 0,n=new w(h,o.friendlyName,(()=>i(this,void 0,void 0,(function*(){yield M(300),t.shell.clearLastError(),yield o.apply(),yield M(e||2e3);const n=yield t.shell.lastError;if(n)throw new Error(n)}))),{skipReason:o.options.demoSkip});E.push(n)}if(o.hasTag("semTypeDetector")){let e=r;o.options.testData&&(e=yield t.data.files.openTable(`System:AppData/${n.nqName}/${o.options.testData}`));const s=new w(p,o.friendlyName,(()=>i(this,void 0,void 0,(function*(){const t=[];console.log(`System:AppData/${n.nqName}/${o.options.testData}`);for(const n of e.clone().columns){const e=yield o.apply([n]);t.push(e||n.semType)}const r=t.filter((e=>e));_(r.length,1),o.options.testDataColumnName&&_(r[0],o.options.testDataColumnName)}))),{skipReason:o.options.skipTest});N.push(s)}}v[T]=!0,b.length>0&&(I[m]={tests:b,clear:!0}),E.length>0&&(I[h]={tests:E,clear:!0}),N.length>0&&(I[p]={tests:N,clear:!1})}))}function O(e,n){return i(this,void 0,void 0,(function*(){null!=t.shell.reportTest?yield t.shell.reportTest(e,n):yield fetch(`${t.dapi.root}/log/tests/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"same-origin",body:JSON.stringify(n)})}))}function P(t){return i(this,void 0,void 0,(function*(){return`${t.toString()}\n${t.stack?yield e.Logger.translateStackTrace(t.stack):""}`}))}function L(n,o,r,a,u,c){var f,m,h,p,g,v,y,x,C,w;return i(this,void 0,void 0,(function*(){let i;r.length=0;const T=null!=o&&n.name.toLowerCase()!==o.toLowerCase();let _=(null===(f=n.options)||void 0===f?void 0:f.skipReason)||T,I=T?"skipped":null===(m=n.options)||void 0===m?void 0:m.skipReason;if(e.Test.isInBenchmark&&!(null===(h=n.options)||void 0===h?void 0:h.benchmark))return void l(`SKIPPED: ${n.category} ${n.name} doesnt available in benchmark mode`);_||l(`Started ${n.category} ${n.name}`);const b=Date.now(),E=new Date(b).toISOString();try{if(_)i={date:E,success:!0,result:I,ms:0,skipped:!0};else{let o=null!=a?a:s;e.Test.isProfiling&&console.profile(`${n.category}: ${n.name}`),i={date:E,success:!0,result:null!==(p=yield D(n.test,o))&&void 0!==p?p:"OK",ms:0,skipped:!1},e.Test.isProfiling&&(console.profileEnd(`${n.category}: ${n.name}`),t.shell.info(`Profiling of ${n.category}: ${n.name} finished \n Please ensure that you have opened DevTools (F12) / Performance panel before test starts.`))}}catch(e){d(e),i={date:E,success:!1,result:yield P(e),ms:0,skipped:!1}}if((null===(g=n.options)||void 0===g?void 0:g.isAggregated)&&i.result.constructor===e.DataFrame){const e=i.result.col("success");if(e&&(i.success=e.stats.sum===e.length),!c){const e=i.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),i.result=e}i.result=i.result.toCsv()}if(i.logs=r.join("\n"),i.ms=Date.now()-b,_||l(`Finished ${n.category} ${n.name} for ${i.ms} ms`),i.category=n.category,i.name=n.name,i.owner=null!==(y=null===(v=n.options)||void 0===v?void 0:v.owner)&&void 0!==y?y:"",!T){let t={success:i.success,result:i.result,ms:i.ms,date:i.date,skipped:i.skipped,package:u,category:n.category,name:n.name,logs:i.logs,owner:i.owner,flaking:e.Test.isReproducing&&i.success,timeoutWarning:e.Test.isInBenchmark&&(null===(x=n.options)||void 0===x?void 0:x.benchmarkWarnTimeout)&&i.ms>(null===(C=n.options)||void 0===C?void 0:C.benchmarkWarnTimeout)};if(i.result.constructor==Object){const e=Object.keys(i.result).reduce(((e,t)=>Object.assign(Object.assign({},e),{["result."+t]:i.result[t]})),{});t=Object.assign(Object.assign({},t),e)}t.result instanceof e.DataFrame&&(t.result=JSON.stringify(null===(w=t.result)||void 0===w?void 0:w.toJson())||""),yield O("package",t)}return i}))}function R(e){const t=e.slice();return t.sort((()=>Math.random()-.5)),t}function M(e){return i(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,e)))}))}function D(e,t,n="EXECUTION TIMEOUT"){return i(this,void 0,void 0,(function*(){let o=null;const r=new Promise(((e,r)=>{o=setTimeout((()=>{r(n)}),t)}));try{return yield Promise.race([e(),r])}finally{o&&clearTimeout(o)}}))}e.DataFrame.fromColumns([e.Column.fromStrings("col",["val1","val2","val3"])]);var F=n(95),X=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};N("detectors",(()=>{T("detectFitCurves",(()=>X(void 0,void 0,void 0,(function*(){const n=e.DataFrame.fromCsv('dataframes,json chart 0,json chart 1,json chart 2\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4325498997897106,1.9857091601431633,1.1549088606928581,1.7111330488305754],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.04513680189847946},{""x"":0.6000000238418579,""y"":0.05534003674983978},{""x"":1.100000023841858,""y"":0.041759949177503586},{""x"":1.600000023841858,""y"":0.019746985286474228},{""x"":2.0999999046325684,""y"":0.009008238092064857},{""x"":2.5999999046325684,""y"":0.00802786834537983},{""x"":3.0999999046325684,""y"":0.046114228665828705},{""x"":3.5999999046325684,""y"":0.0032935715280473232},{""x"":4.099999904632568,""y"":0.05305013433098793},{""x"":4.599999904632568,""y"":0.11946146935224533},{""x"":5.099999904632568,""y"":0.24304461479187012},{""x"":5.599999904632568,""y"":0.32507050037384033},{""x"":6.099999904632568,""y"":0.30492347478866577},{""x"":6.599999904632568,""y"":0.30675041675567627},{""x"":7.099999904632568,""y"":0.28282707929611206}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":0.027537694200873375},{""x"":0.6000000238418579,""y"":0.20163409411907196},{""x"":1.100000023841858,""y"":0.4537210166454315},{""x"":1.600000023841858,""y"":0.1709870994091034},{""x"":2.0999999046325684,""y"":0.35089364647865295},{""x"":2.5999999046325684,""y"":0.30297139286994934},{""x"":3.0999999046325684,""y"":0.3161645829677582},{""x"":3.5999999046325684,""y"":0.460237979888916},{""x"":4.099999904632568,""y"":0.5018354058265686},{""x"":4.599999904632568,""y"":1.2936394214630127},{""x"":5.099999904632568,""y"":2.336543321609497},{""x"":5.599999904632568,""y"":2.353417158126831},{""x"":6.099999904632568,""y"":2.5554966926574707},{""x"":6.599999904632568,""y"":2.7185072898864746},{""x"":7.099999904632568,""y"":2.8088953495025635}]}]}","{""series"":[{""parameters"":[1.4257157458000065,1.587135296876273,1.6780074048516793,4.72187609991688],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.5346568822860718},{""x"":0.6000000238418579,""y"":0.6445727348327637},{""x"":1.100000023841858,""y"":0.08188246190547943},{""x"":1.600000023841858,""y"":0.0516531839966774},{""x"":2.0999999046325684,""y"":0.17018724977970123},{""x"":2.5999999046325684,""y"":0.618033766746521},{""x"":3.0999999046325684,""y"":0.16852399706840515},{""x"":3.5999999046325684,""y"":0.013230039738118649},{""x"":4.099999904632568,""y"":0.6706985831260681},{""x"":4.599999904632568,""y"":0.6293138861656189},{""x"":5.099999904632568,""y"":1.4058887958526611},{""x"":5.599999904632568,""y"":2.6412644386291504},{""x"":6.099999904632568,""y"":3.775967597961426},{""x"":6.599999904632568,""y"":3.3188939094543457},{""x"":7.099999904632568,""y"":3.793793201446533}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.4518023469757255,1.051351211186544,1.6612723878444138,-0.9253134758193626],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":2.5458569526672363},{""x"":0.10000000149011612,""y"":3.0017518997192383},{""x"":0.10000000149011612,""y"":2.4102466106414795},{""x"":0.10000000149011612,""y"":2.7017934322357178},{""x"":0.10000000149011612,""y"":2.8341686725616455},{""x"":0.6000000238418579,""y"":2.9751579761505127},{""x"":0.6000000238418579,""y"":2.8365142345428467},{""x"":0.6000000238418579,""y"":2.898362874984741},{""x"":0.6000000238418579,""y"":2.9964826107025146},{""x"":0.6000000238418579,""y"":2.6708292961120605},{""x"":1.100000023841858,""y"":3.263227939605713},{""x"":1.100000023841858,""y"":3.0655293464660645},{""x"":1.100000023841858,""y"":2.6620445251464844},{""x"":1.100000023841858,""y"":3.002741813659668},{""x"":1.100000023841858,""y"":3.1540098190307617},{""x"":1.600000023841858,""y"":2.8934433460235596},{""x"":1.600000023841858,""y"":2.7970690727233887},{""x"":1.600000023841858,""y"":3.0466723442077637},{""x"":1.600000023841858,""y"":3.179988145828247},{""x"":1.600000023841858,""y"":2.611898899078369},{""x"":2.0999999046325684,""y"":2.497966766357422},{""x"":2.0999999046325684,""y"":2.645627498626709},{""x"":2.0999999046325684,""y"":2.5474727153778076},{""x"":2.0999999046325684,""y"":2.530237913131714},{""x"":2.0999999046325684,""y"":2.9498236179351807},{""x"":2.5999999046325684,""y"":2.7639214992523193},{""x"":2.5999999046325684,""y"":3.007110595703125},{""x"":2.5999999046325684,""y"":2.71816086769104},{""x"":2.5999999046325684,""y"":3.050650119781494},{""x"":2.5999999046325684,""y"":2.591902017593384},{""x"":3.0999999046325684,""y"":2.79219388961792},{""x"":3.0999999046325684,""y"":2.380063056945801},{""x"":3.0999999046325684,""y"":3.2450575828552246},{""x"":3.0999999046325684,""y"":2.6954219341278076},{""x"":3.0999999046325684,""y"":2.368993043899536},{""x"":3.5999999046325684,""y"":3.2338552474975586},{""x"":3.5999999046325684,""y"":3.222881555557251},{""x"":3.5999999046325684,""y"":2.6137502193450928},{""x"":3.5999999046325684,""y"":2.3624353408813477},{""x"":3.5999999046325684,""y"":2.830970525741577},{""x"":4.099999904632568,""y"":2.8000826835632324},{""x"":4.099999904632568,""y"":2.8115334510803223},{""x"":4.099999904632568,""y"":2.8906726837158203},{""x"":4.099999904632568,""y"":2.5641937255859375},{""x"":4.099999904632568,""y"":2.3881938457489014},{""x"":4.599999904632568,""y"":2.076000928878784},{""x"":4.599999904632568,""y"":2.241201400756836},{""x"":4.599999904632568,""y"":2.018866777420044},{""x"":4.599999904632568,""y"":2.7197747230529785},{""x"":4.599999904632568,""y"":2.3649282455444336},{""x"":5.099999904632568,""y"":2.068617105484009},{""x"":5.099999904632568,""y"":2.0637989044189453},{""x"":5.099999904632568,""y"":1.5100634098052979},{""x"":5.099999904632568,""y"":1.9978814125061035},{""x"":5.099999904632568,""y"":2.1007437705993652},{""x"":5.599999904632568,""y"":0.7437329292297363},{""x"":5.599999904632568,""y"":0.8030821681022644},{""x"":5.599999904632568,""y"":1.0766953229904175},{""x"":5.599999904632568,""y"":1.5326048135757446},{""x"":5.599999904632568,""y"":1.5971065759658813},{""x"":6.099999904632568,""y"":0.31388434767723083},{""x"":6.099999904632568,""y"":0.6875622272491455},{""x"":6.099999904632568,""y"":0.855545163154602},{""x"":6.099999904632568,""y"":0.6559354662895203},{""x"":6.099999904632568,""y"":0.3100747764110565},{""x"":6.599999904632568,""y"":0.4792144000530243},{""x"":6.599999904632568,""y"":0.855309009552002},{""x"":6.599999904632568,""y"":0.18937373161315918},{""x"":6.599999904632568,""y"":0.3708323538303375},{""x"":6.599999904632568,""y"":0.08053481578826904},{""x"":7.099999904632568,""y"":0.7577306628227234},{""x"":7.099999904632568,""y"":0.3387751877307892},{""x"":7.099999904632568,""y"":0.1985611915588379},{""x"":7.099999904632568,""y"":0.172195702791214},{""x"":7.099999904632568,""y"":0.13258741796016693}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"\n"null (15 rows, 2 columns)","{""series"":[{""parameters"":[1.4030933784862443,1.0245979562516274,1.7428150024861861,-3.5779850370795696],""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":5.7036309242248535},{""x"":0.6000000238418579,""y"":5.746265888214111},{""x"":1.100000023841858,""y"":5.299612045288086},{""x"":1.600000023841858,""y"":5.343863487243652},{""x"":2.0999999046325684,""y"":5.506134033203125},{""x"":2.5999999046325684,""y"":5.4817914962768555},{""x"":3.0999999046325684,""y"":5.3505539894104},{""x"":3.5999999046325684,""y"":5.151522159576416},{""x"":4.099999904632568,""y"":5.212680339813232},{""x"":4.599999904632568,""y"":4.80598783493042},{""x"":5.099999904632568,""y"":3.351301431655884},{""x"":5.599999904632568,""y"":2.108116865158081},{""x"":6.099999904632568,""y"":1.246281623840332},{""x"":6.599999904632568,""y"":0.5875148773193359},{""x"":7.099999904632568,""y"":0.6986792683601379}]},{""fitFunction"":""sigmoid"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showCurveConfidenceInterval"":false,""points"":[{""x"":0.10000000149011612,""y"":4.777379035949707},{""x"":0.6000000238418579,""y"":5.265642166137695},{""x"":1.100000023841858,""y"":5.713808059692383},{""x"":1.600000023841858,""y"":5.249830722808838},{""x"":2.0999999046325684,""y"":5.587547779083252},{""x"":2.5999999046325684,""y"":5.36907434463501},{""x"":3.0999999046325684,""y"":4.934175968170166},{""x"":3.5999999046325684,""y"":5.372972011566162},{""x"":4.099999904632568,""y"":5.017283916473389},{""x"":4.599999904632568,""y"":4.6751484870910645},{""x"":5.099999904632568,""y"":3.423663854598999},{""x"":5.599999904632568,""y"":1.594344973564148},{""x"":6.099999904632568,""y"":0.5661525130271912},{""x"":6.599999904632568,""y"":0.19819404184818268},{""x"":7.099999904632568,""y"":0.8421927690505981}]}]}","{""series"":[{""parameters"":[1.5400648543589148,1.7239324972922214,1.4063297934320662,0.33443731185267556],""fitFunction"":""sigmoid"",""fitLineColor"":""#2ca02c"",""pointColor"":""#2ca02c"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":1.27737557888031},{""x"":0.6000000238418579,""y"":1.2780145406723022},{""x"":1.100000023841858,""y"":1.3489571809768677},{""x"":1.600000023841858,""y"":1.3250025510787964},{""x"":2.0999999046325684,""y"":1.309158444404602},{""x"":2.5999999046325684,""y"":1.441296935081482},{""x"":3.0999999046325684,""y"":1.3621265888214111},{""x"":3.5999999046325684,""y"":1.3409022092819214},{""x"":4.099999904632568,""y"":1.2703818082809448},{""x"":4.599999904632568,""y"":1.2195014953613281},{""x"":5.099999904632568,""y"":0.585429310798645},{""x"":5.599999904632568,""y"":0.19421088695526123},{""x"":6.099999904632568,""y"":0.2276361584663391},{""x"":6.599999904632568,""y"":0.03259352594614029},{""x"":7.099999904632568,""y"":0.03811067342758179}]}],""chartOptions"":{""showStatistics"":[""auc""]}}","{""series"":[{""parameters"":[1.3987701446422334,1.0025589776619843,1.950431059109577,1.57489342486818],""fitFunction"":""sigmoid"",""fitLineColor"":""#9467bd"",""pointColor"":""#9467bd"",""showCurveConfidenceInterval"":true,""points"":[{""x"":0.10000000149011612,""y"":0.03612012043595314},{""x"":0.10000000149011612,""y"":0.05706661567091942},{""x"":0.10000000149011612,""y"":0.007174440659582615},{""x"":0.10000000149011612,""y"":0.006656676065176725},{""x"":0.10000000149011612,""y"":0.03480849787592888},{""x"":0.6000000238418579,""y"":0.0665726289153099},{""x"":0.6000000238418579,""y"":0.054525356739759445},{""x"":0.6000000238418579,""y"":0.055943023413419724},{""x"":0.6000000238418579,""y"":0.0544852614402771},{""x"":0.6000000238418579,""y"":0.02734142541885376},{""x"":1.100000023841858,""y"":0.02047267183661461},{""x"":1.100000023841858,""y"":0.04814719781279564},{""x"":1.100000023841858,""y"":0.05629648640751839},{""x"":1.100000023841858,""y"":0.05200682207942009},{""x"":1.100000023841858,""y"":0.046626269817352295},{""x"":1.600000023841858,""y"":0.027950428426265717},{""x"":1.600000023841858,""y"":0.021106986328959465},{""x"":1.600000023841858,""y"":0.011796108447015285},{""x"":1.600000023841858,""y"":0.04013078659772873},{""x"":1.600000023841858,""y"":0.018657365813851357},{""x"":2.0999999046325684,""y"":0.010390376672148705},{""x"":2.0999999046325684,""y"":0.06717702001333237},{""x"":2.0999999046325684,""y"":0.015734216198325157},{""x"":2.0999999046325684,""y"":0.0005020603421144187},{""x"":2.0999999046325684,""y"":0.03601917624473572},{""x"":2.5999999046325684,""y"":0.04580968990921974},{""x"":2.5999999046325684,""y"":0.013811883516609669},{""x"":2.5999999046325684,""y"":0.0347907729446888},{""x"":2.5999999046325684,""y"":0.003400992602109909},{""x"":2.5999999046325684,""y"":0.0658077746629715},{""x"":3.0999999046325684,""y"":0.06470326334238052},{""x"":3.0999999046325684,""y"":0.040105774998664856},{""x"":3.0999999046325684,""y"":0.004536386113613844},{""x"":3.0999999046325684,""y"":0.028299888595938683},{""x"":3.0999999046325684,""y"":0.015297790057957172},{""x"":3.5999999046325684,""y"":0.010205036029219627},{""x"":3.5999999046325684,""y"":0.030351044610142708},{""x"":3.5999999046325684,""y"":0.02823905274271965},{""x"":3.5999999046325684,""y"":0.00543160829693079},{""x"":3.5999999046325684,""y"":0.03528806194663048},{""x"":4.099999904632568,""y"":0.024404611438512802},{""x"":4.099999904632568,""y"":0.021398605778813362},{""x"":4.099999904632568,""y"":0.01746137998998165},{""x"":4.099999904632568,""y"":0.06801135092973709},{""x"":4.099999904632568,""y"":0.02418249472975731},{""x"":4.599999904632568,""y"":0.08065827190876007},{""x"":4.599999904632568,""y"":0.03795705363154411},{""x"":4.599999904632568,""y"":0.03595327213406563},{""x"":4.599999904632568,""y"":0.019490951672196388},{""x"":4.599999904632568,""y"":0.0357535295188427},{""x"":5.099999904632568,""y"":0.06301134079694748},{""x"":5.099999904632568,""y"":0.04880264401435852},{""x"":5.099999904632568,""y"":0.046849530190229416},{""x"":5.099999904632568,""y"":0.046094998717308044},{""x"":5.099999904632568,""y"":0.07735799998044968},{""x"":5.599999904632568,""y"":0.10287926346063614},{""x"":5.599999904632568,""y"":0.15329882502555847},{""x"":5.599999904632568,""y"":0.09895746409893036},{""x"":5.599999904632568,""y"":0.10509312152862549},{""x"":5.599999904632568,""y"":0.10584071278572083},{""x"":6.099999904632568,""y"":0.19464170932769775},{""x"":6.099999904632568,""y"":0.1837087869644165},{""x"":6.099999904632568,""y"":0.19690236449241638},{""x"":6.099999904632568,""y"":0.14827826619148254},{""x"":6.099999904632568,""y"":0.15355728566646576},{""x"":6.599999904632568,""y"":0.21270307898521423},{""x"":6.599999904632568,""y"":0.19529509544372559},{""x"":6.599999904632568,""y"":0.20716492831707},{""x"":6.599999904632568,""y"":0.18739652633666992},{""x"":6.599999904632568,""y"":0.22446008026599884},{""x"":7.099999904632568,""y"":0.18822836875915527},{""x"":7.099999904632568,""y"":0.2324085384607315},{""x"":7.099999904632568,""y"":0.1877404898405075},{""x"":7.099999904632568,""y"":0.19784560799598694},{""x"":7.099999904632568,""y"":0.21554286777973175}]}],""chartOptions"":{""showStatistics"":[""auc""]}}"'),o=n.columns.byName("json chart 0"),r=n.columns.byName("json chart 1"),i=n.columns.byName("json chart 2");yield t.data.detectSemanticTypes(n),_(o.semType,F.h.FIT_SEM_TYPE),_(r.semType,F.h.FIT_SEM_TYPE),_(i.semType,F.h.FIT_SEM_TYPE)})))),T("detectXMLCurveChart",(()=>X(void 0,void 0,void 0,(function*(){const n=e.DataFrame.fromCsv('xmlCurveFitChart\n"<chart><grid><xAxis min=""0.0"" max=""5"" /><yAxis min=""-100"" max=""100"" /></grid><settings xLabel=""Concentration"" yLabel=""Activity"" logX=""true"" /><seriesCollection><series><x>7.2e-12,7.1e-12,7e-12,6e-8,6e-5,6e-4</x><y>112,115,116,100,123,124</y><fitLine><function type=""sigif""><params>2e-08,-1.5,125,-20</params></function></fitLine><settings color=""Green"" marker=""SquareBorder"" markerColor=""Yellow"" markerBorderColor=""Black"" errorBarColor=""Red"" showErrorBars=""True"" drawLine=""True"" bound=""True"" /></series></seriesCollection></chart>"'),o=n.columns.byName("xmlCurveFitChart");yield t.data.detectSemanticTypes(n),_(o.semType,F.h.FIT_SEM_TYPE),_(o.tags[F.h.TAG_FIT_CHART_FORMAT],F.h.TAG_FIT_CHART_FORMAT_3DX)}))))}));var k=n(389),Y=n(991),G=n.n(Y),H=n(471),B=n(407),V=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};function j(t){const n={series:[],chartOptions:{showStatistics:["auc"]}},o=(0,H.kL)(t,.5),r=e.Color.toHtml(e.Color.scatterPlotMarker);return n.series[0]={fitLineColor:r,pointColor:r,markerType:e.MARKER_TYPE.CIRCLE,showFitLine:!0,showPoints:"points",showCurveConfidenceInterval:!0,fitFunction:"sigmoid",points:G().count().take(t).map((function(e){return{x:o.x[e],y:o.y[e]}})).toArray()},n}function q(e,t,n,o){return V(this,void 0,void 0,(function*(){for(let r=0;r<n;r++)e.dispatchEvent(new WheelEvent("wheel",{deltaY:t})),yield M(o)}))}function $(e,t){return V(this,void 0,void 0,(function*(){const n=Date.now();return yield e(t),Date.now().valueOf()-n.valueOf()}))}N("creation",(()=>{T("fit curve creation",(()=>V(void 0,void 0,void 0,(function*(){const n=e.Test.isInBenchmark?1e3:100,o=yield $((e=>V(void 0,void 0,void 0,(function*(){const e=(0,H.nO)(n,5,2);t.shell.addTableView(e)}))),null);return console.log(`Creation took ${o} ms`),`${n} points, took ${o} ms`}))),{benchmark:!0})})),N("rendering",(()=>{T("rendering same fitChartData on canvas",(()=>V(void 0,void 0,void 0,(function*(){const n=k.canvas(160,120);t.shell.newView("canvas",[n]);const o=n.getContext("2d"),r=new B.lR,i=j(e.Test.isInBenchmark?50:15),s=[],a=t=>V(void 0,void 0,void 0,(function*(){r.renderCurves(o,B.lR.inflateScreenBounds(new e.Rect(n.clientLeft,n.clientTop,160,120)),i),o.clearRect(0,0,160,120)}));for(let e=1;e<=1e3;e++)s[s.length]=yield $(a);return`rendering performed 1000 times, max time is ${Math.max(...s)} ms, min time is ${Math.min(...s)} ms, average time is ${s.reduce(((e,t)=>e+t),0)/s.length} ms`}))),{benchmark:!0}),T("rendering different fitChartData on canvas",(()=>V(void 0,void 0,void 0,(function*(){const n=k.canvas(160,120);t.shell.newView("canvas",[n]);const o=n.getContext("2d"),r=new B.lR,i=[],s=t=>V(void 0,void 0,void 0,(function*(){r.renderCurves(o,B.lR.inflateScreenBounds(new e.Rect(n.clientLeft,n.clientTop,160,120)),t),o.clearRect(0,0,160,120)}));for(let t=1;t<=1e3;t++){const t=j(e.Test.isInBenchmark?50:15);i[i.length]=yield $(s,t)}return`rendering performed 1000 times, max time is ${Math.max(...i)} ms, min time is ${Math.min(...i)} ms, average time is ${i.reduce(((e,t)=>e+t),0)/i.length} ms`}))),{benchmark:!0}),T("rendering in grid",(()=>V(void 0,void 0,void 0,(function*(){const e=(0,H.nO)(50,5,5),n=t.shell.addTableView(e);yield M(100);const o=n.grid.root.getElementsByTagName("canvas")[2],r=(yield $((e=>V(void 0,void 0,void 0,(function*(){yield q(o,300,10,1),yield q(o,-300,10,1),yield q(o,300,10,1)}))),null))-30;return console.log(`curves rendering took ${r} ms`),r}))),{benchmark:!0})}));var W=n(293);N("viewport",(()=>{T("viewportMethods",(()=>{return t=void 0,n=void 0,r=function*(){const t=B.lR.inflateScreenBounds(new e.Rect(120,20,160,100)),[n]=(0,B.Tv)(t,!1,!1),o=new e.Rect(.1,.06,7,5.94),r=new W.L(o,n,!1,!1);_(r.xToScreen(1.5),182.4),_(r.yToScreen(2.33),73.01346801346801),_(r.xToWorld(150),-.9652173913043479),_(r.yToWorld(67),2.855294117647059)},new((o=void 0)||(o=Promise))((function(e,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,a)}l((r=r.apply(t,n||[])).next())}));var t,n,o,r}))}));var U=n(999),z=n(71),K=n(368),Z=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};const J={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7412786483764648},{x:.6000000238418579,y:1.8561450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"sigmoid",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[1.6914372095641517,1.1536998642628853,5.410173358224149,.2089689354045083]},Q={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.5412786483764649},{x:.6000000238418579,y:1.9261450242996216},{x:1.100000023841858,y:1.6065685749053955},{x:1.600000023841858,y:1.70476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-5.45641324,10.456486765]},ee={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7897127864837648},{x:.6000000238418579,y:1.2101614502429963},{x:1.100000023841858,y:1.7895685749053956},{x:1.600000023841858,y:1.82476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"log-linear",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[-8.45641324,90.4456456486765]},te={fitLineColor:"#1f77b4",pointColor:"#1f77b4",showCurveConfidenceInterval:!1,points:[{x:.10000000149011612,y:1.7897127864837648},{x:.6000000238418579,y:1.2101614502429963},{x:1.100000023841858,y:1.7895685749053956},{x:1.600000023841858,y:1.82476496219635},{x:2.0999999046325684,y:1.5737264156341553},{x:2.5999999046325684,y:1.6007002592086792},{x:3.0999999046325684,y:1.6796687841415405},{x:3.5999999046325684,y:1.656104326248169},{x:4.099999904632568,y:1.782997488975525},{x:4.599999904632568,y:1.530208945274353},{x:5.099999904632568,y:1.1572397947311401},{x:5.599999904632568,y:.8691964745521545},{x:6.099999904632568,y:.3228665590286255},{x:6.599999904632568,y:.2990703880786896},{x:7.099999904632568,y:.23361243307590485}],fitFunction:"exponential",clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[88.45641324,-10.4456456486765]},ne={fitLineColor:"#2ca02c",pointColor:"#2ca02c",showCurveConfidenceInterval:!0,fitFunction:{name:"Polynomial",function:"([p1, p2, p3, p4], x) => p1 * x * x * x + p2 * x * x + p3 * x + p4",getInitialParameters:"(xs, ys) => [0.1, -1, 4, 4]",parameterNames:["Slope","Intercept","Parameter3","Parameter4"]},points:[{x:.10000000149011612,y:7.365033149719238},{x:.6000000238418579,y:6.595034599304199},{x:1.100000023841858,y:7.05179500579834},{x:1.600000023841858,y:7.251461982727051},{x:2.0999999046325684,y:7.775498867034912},{x:2.5999999046325684,y:7.748039722442627},{x:3.0999999046325684,y:6.8391804695129395},{x:3.5999999046325684,y:7.570991516113281},{x:4.099999904632568,y:6.387666702270508},{x:4.599999904632568,y:6.464827537536621},{x:5.099999904632568,y:3.932436227798462},{x:5.599999904632568,y:1.4741199016571045},{x:6.099999904632568,y:.47604307532310486},{x:6.599999904632568,y:.5836760401725769},{x:7.099999904632568,y:1.0317600965499878}],clickToToggle:!1,showFitLine:!0,showPoints:"points",parameters:[.07070206940832963,-1.138666933634074,3.947509109407932,3.9947960440506685]},oe=(0,U.zB)(J),re=(0,U.zB)(Q),ie=(0,U.zB)(ee),se=(0,U.zB)(te),ae=(0,U.zB)(ne);N("fit",(()=>{T("getSeriesFitFunction",(()=>Z(void 0,void 0,void 0,(function*(){var e;const{xs:t,ys:n}=(0,U.W$)(J.points),{xs:o,ys:r}=(0,U.W$)(Q.points),{xs:i,ys:s}=(0,U.W$)(ee.points),{xs:a,ys:l}=(0,U.W$)(te.points),{xs:u,ys:c}=(0,U.W$)(ne.points);_(oe.name,z.G7),_(re.name,z.Ff),_(ie.name,z.kx),_(se.name,z.Pf),_(ae.name,"Polynomial"),E(oe.parameterNames,["Top","Slope","IC50","Bottom"]),E(re.parameterNames,["Slope","Intercept"]),E(ie.parameterNames,["Slope","Intercept"]),E(se.parameterNames,["Mantissa","Power"]),E(ae.parameterNames,["Slope","Intercept","Parameter3","Parameter4"]),E(oe.getInitialParameters(t,n),[1.8561450242996216,1,5.099999904632568,.23361243307590485]),E(re.getInitialParameters(o,r),[-.1868094652891159,1.5599596500396729]),E(ie.getInitialParameters(i,s),[-5,100]),E(se.getInitialParameters(a,l),[100,-2]),E(ae.getInitialParameters(u,c),[.1,-1,4,4]);const d=new Float32Array(null===(e=J.parameters)||void 0===e?void 0:e.length);d.set(J.parameters),_(oe.y(d,1.1),1.6914214561555851),_(re.y(re.getInitialParameters(o,r),1.1),1.3544692382216454),_(ie.y(ie.getInitialParameters(i,s),1.1),96.29031327635312),_(se.y(se.getInitialParameters(a,l),1.1),11.080315836233387),_(ae.y(ae.getInitialParameters(u,c),1.1),7.3231)})))),T("getCurve",(()=>Z(void 0,void 0,void 0,(function*(){const e=(0,U._T)(J,oe),t=(0,U._T)(Q,re),n=(0,U._T)(ee,ie),o=(0,U._T)(te,se),r=(0,U._T)(ne,ae);_(e(2.5),1.690786623428712),_(e(5.8858),.5356638447565519),_(t(2.5),-3.18454647064209),_(t(5.8858),-21.658870516967774),_(n(2.5),79.85176680360948),_(n(5.8858),74.12932588432805),_(o(.01),79.68277758636006),_(o(1345e-8),88.4439865528934),_(r(1.56),7.650264639782428),_(r(3.99876),6.093284856699922)})))),T("fitSeries",(()=>Z(void 0,void 0,void 0,(function*(){const e=Date.now(),t=(0,U.nT)(J,oe),n=(0,U.nT)(Q,re),o=(0,U.nT)(ee,ie),r=(0,U.nT)(te,se),i=(0,U.nT)(ne,ae),s=Date.now();return _(t.fittedCurve(2.5),1.6903875076701773),_(n.fittedCurve(2.5),1.5348530188202858),_(o.fittedCurve(2.5),1.3696734183366701),_(r.fittedCurve(1345e-8),2.005337264075174),_(i.fittedCurve(3.99876),5.911350894323636),E(t.parameters,[1.690911054611206,1.1880898475646973,5.402130603790283,.22163867950439453]),E(n.parameters,[-.21431826055049896,2.070648670196533]),E(o.parameters,[-.6303421854972839,2.1593427658081055]),E(r.parameters,[2.005340814590454,-.13163800537586212]),E(i.parameters,[.06199381500482559,-.9554166793823242,2.872941017150879,5.736424446105957]),s.valueOf()-e.valueOf()+" ms"})))),T("fitSeries sigmoid benchmark",(()=>Z(void 0,void 0,void 0,(function*(){const e=Date.now();return(0,U.nT)(J,oe),Date.now().valueOf()-e.valueOf()+" ms"}))),{benchmark:!0}),T("fitSeries linear benchmark",(()=>Z(void 0,void 0,void 0,(function*(){const e=Date.now();return(0,U.nT)(Q,re),Date.now().valueOf()-e.valueOf()+" ms"}))),{benchmark:!0}),T("fitSeries log-linear benchmark",(()=>Z(void 0,void 0,void 0,(function*(){const e=Date.now();return(0,U.nT)(ee,ie),Date.now().valueOf()-e.valueOf()+" ms"}))),{benchmark:!0}),T("fitSeries exponential benchmark",(()=>Z(void 0,void 0,void 0,(function*(){const e=Date.now();return(0,U.nT)(te,se),Date.now().valueOf()-e.valueOf()+" ms"}))),{benchmark:!0}),T("fitSeries polynomial benchmark",(()=>Z(void 0,void 0,void 0,(function*(){const e=Date.now();return(0,U.nT)(ne,ae),Date.now().valueOf()-e.valueOf()+" ms"}))),{benchmark:!0}),T("getSeriesConfidenceInterval",(()=>Z(void 0,void 0,void 0,(function*(){const e=(0,U.fY)(J,oe,!0),t=(0,U.fY)(Q,re,!0),n=(0,U.fY)(ee,ie,!0),o=(0,U.fY)(te,se,!0),r=(0,U.fY)(ne,ae,!0);_(e.confidenceTop(2.578),1.8540855269320198),_(t.confidenceTop(2.578),26.645777275332037),_(n.confidenceTop(2.578),231.75768109324696),_(o.confidenceTop(1345e-8),103.51168317113999),_(r.confidenceTop(2.3342),10.03522960294218),_(e.confidenceBottom(3.987),1.4949306416468298),_(t.confidenceBottom(3.987),-41.55415698266847),_(n.confidenceBottom(3.987),-75.23471085303483),_(o.confidenceBottom(.01),64.61508096811347),_(r.confidenceBottom(3.8796),4.1686506915250385)})))),T("getSeriesStatistics",(()=>Z(void 0,void 0,void 0,(function*(){const e=(0,U.VA)(J,oe),t=(0,U.VA)(ne,ae);_(e.auc,9.335422628533761),_(t.auc,36.525538394763096),_(e.rSquared,.9781915962461156),_(t.rSquared,.846055768956569)})))),T("calculateBoxPlotStatistics",(()=>Z(void 0,void 0,void 0,(function*(){const e=(0,K.k)([.7654603719711304,.8199243545532227,.8257747292518616,.9558155536651611,.9596694707870483]);_(e.q1,.8199243545532227),_(e.q2,.8257747292518616),_(e.q3,.9558155536651611),_(e.lowerAdjacentValue,.7654603719711304),_(e.upperAdjacentValue,.9558155536651611)})))),T("sigmoid",(()=>Z(void 0,void 0,void 0,(function*(){const e=new Float32Array(4);e.set([2.612687371569039,-1.421800778574126,5.16688669906018,.341788492203575]),_((0,z.ry)(e,.5),.341789026340178),_((0,z.ry)(e,2.5),.34215523020636207),_((0,z.ry)(e,5.678976),2.2548815999597016)})))),T("linear",(()=>Z(void 0,void 0,void 0,(function*(){const e=new Float32Array(2);e.set([-5.12346546,6.24654654]),_((0,z.sn)(e,.5),3.684813976287842),_((0,z.sn)(e,2.5),-6.562117099761963),_((0,z.sn)(e,5.678976),-22.849491081970214)})))),T("log-linear",(()=>Z(void 0,void 0,void 0,(function*(){const e=new Float32Array(2);e.set([-5.12346546,91.5465454654]),_((0,z.AJ)(e,.5),89.46916042777144),_((0,z.AJ)(e,2.5),85.12805903963536),_((0,z.AJ)(e,5.678976),81.81726682791052)})))),T("exponential",(()=>Z(void 0,void 0,void 0,(function*(){const e=new Float32Array(2);e.set([95.12346546,-11.5465454654]),_((0,z.EV)(e,5e-4),94.57587501550823),_((0,z.EV)(e,.5),.2957925783034655),_((0,z.EV)(e,.98746),.0010630898492656174)}))))}));var le=n(973),ue=n(572),ce=n(358),de=n(140),fe=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};function me(){const e=le.T6.fromCsvTable(he,"concentration"),t=le.T6.fromCsvTable(pe,"role"),n=le.T6.fromCsvTable(ge,"readout");return le.T6.fromPlates([e,t,n])}N("plates",(()=>{T("fromCsvPlate",(()=>fe(void 0,void 0,void 0,(function*(){const e=le.T6.fromCsv(he,{field:"concentration"});e.print(),_(e.rows,16),_(e.cols,24)})))),T("mergePlates",(()=>fe(void 0,void 0,void 0,(function*(){const e=le.T6.fromCsvTable(he,"concentration"),t=le.T6.fromCsvTable(pe,"role");le.T6.fromCsvTable(ge,"value").merge(t).merge(e).print()})))),T("fromFile",(()=>fe(void 0,void 0,void 0,(function*(){const e=yield le.T6.fromCsvTableFile("System:DemoFiles/hts/plate/concentration.csv","concentration"),t=yield le.T6.fromCsvTableFile("System:DemoFiles/hts/plate/layout.csv","role"),n=yield le.T6.fromCsvTableFile("System:DemoFiles/hts/plate/readout.csv","value");le.T6.fromPlates([e,t,n]).print()})))),T("fromExcel",(()=>fe(void 0,void 0,void 0,(function*(){const t=yield le.T6.fromExcelPath("System:DemoFiles/hts/xlsx_plates/plate1.xlsx");k.dialog({title:"Inspect plate"}).add(de.Xe.detailedView(t.data).root).show({width:500,height:500}),yield e.delay(1e4)})))),T("normalization",(()=>fe(void 0,void 0,void 0,(function*(){const e=me(),t=ue.mean(e.fieldValues("readout",{match:{layout:"High Control"}})),n=ue.mean(e.fieldValues("readout",{match:{layout:"Low Control"}}));e.normalize("readout",(e=>(t-e)/(t-n)))})))),T("use case",(()=>fe(void 0,void 0,void 0,(function*(){const e=me(),t=ue.mean(e.fieldValues("readout",{match:{layout:"High Control"}})),n=ue.mean(e.fieldValues("readout",{match:{layout:"Low Control"}}));e.normalize("readout",(e=>(t-e)/(t-n)));const o=e.doseResponseSeries({concentration:"concentration",value:"readout"});le.T6.inspectSeries(o["Compound 1"],"4pl-regression")})))),T("render",(()=>fe(void 0,void 0,void 0,(function*(){const t=me();k.dialog({title:"Inspect plate"}).add(de.Xe.detailedView(t.data).root).show({width:500,height:500}),yield e.delay(1e4)})))),T("numToExcel",(()=>fe(void 0,void 0,void 0,(function*(){_((0,ce.JG)(0),"A"),_((0,ce.JG)(1),"B"),_((0,ce.JG)(26),"AA"),_((0,ce.JG)(52),"BA")})))),T("excelToNum",(()=>fe(void 0,void 0,void 0,(function*(){_((0,ce.Fj)("A"),0),_((0,ce.Fj)("B"),1),_((0,ce.Fj)("Z"),25),_((0,ce.Fj)("AA"),26),_((0,ce.Fj)("BA"),52)}))))}));const he="col 1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24\nA,,,,,,,,,,,,,,,,,,,,,,,,\nB,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nC,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nD,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nE,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nF,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nG,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nH,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nI,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nJ,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nK,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nL,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nM,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nN,,0.00001,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,\nO,,0.00000,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00001,0.00000403,0.00000163,0.000000656,0.000000265,0.000000107,0.0000000431,0.0000000174,0.00000000701,0.00000000183,0.00000,\nP,,,,,,,,,,,,,,,,,,,,,,,,",pe="col 1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24\nA,,,,,,,,,,,,,,,,,,,,,,,,\nB,,Low Control,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Low Control,\nC,,High Control,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 1,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,Compound 41,High Control,\nD,,Low Control,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Low Control,\nE,,High Control,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 42,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,Compound 43,High Control,\nF,,Low Control,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Low Control,\nG,,High Control,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 44,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,Compound 45,High Control,\nH,,Low Control,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Low Control,\nI,,High Control,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 46,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,Compound 47,High Control,\nJ,,Low Control,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Low Control,\nK,,High Control,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 48,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,Compound 49,High Control,\nL,,Low Control,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Low Control,\nM,,High Control,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 50,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,Compound 51,High Control,\nN,,Low Control,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Low Control,\nO,,High Control,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 52,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,Compound 53,High Control,\nP,,,,,,,,,,,,,,,,,,,,,,,,",ge="col 1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24\nA,,,,,,,,,,,,,,,,,,,,,,,,\nB,,0.07219099668,0.06947737465,0.07019976172,0.07263956168,0.07334269904,0.07654089128,0.07628940202,0.08834969214,0.13557287840,0.1486864679,0.1503697113,0.15200083420,0.15061775480,0.15309907440,0.15286653780,0.15379914010,0.15155727890,0.15232794460,0.15298766400,0.1538730651,0.1542393465,0.15071555580,\nC,,0.14996855360,0.07212290660,0.06957076093,0.07069321642,0.07227733865,0.07664359412,0.07918610560,0.07808503586,0.12496495030,0.1378908893,0.1465698921,0.15578283900,0.15186884230,0.15151635070,0.15141401530,0.15052587190,0.15486747600,0.15294037650,0.15241116130,0.1546532344,0.1537365814,0.07231605295,\nD,,0.07023863668,0.07030474895,0.07086594623,0.07378772619,0.07813099195,0.08443275691,0.10024937710,0.11821695280,0.14031173800,0.1505845411,0.1505987702,0.07099481653,0.07322787956,0.07588648236,0.08377558210,0.09888790085,0.11395358370,0.12947949180,0.14055841590,0.1493699333,0.1540055735,0.15226875140,\nE,,0.14929130930,0.06932695867,0.07157716491,0.07214187679,0.07721194315,0.08504549754,0.10174360480,0.11748417490,0.13321393730,0.1456650512,0.1483001297,0.07167267085,0.07383087952,0.07670410142,0.08204578635,0.09386326869,0.11296832520,0.30900000000,0.13807843210,0.1487301787,0.1519785410,0.07219836243,\nF,,0.07063914398,0.07039007372,0.07078597316,0.07132027961,0.07222210814,0.07442561862,0.08135627908,0.09196745273,0.11146019360,0.1364485205,0.1450632971,0.08126099235,0.09318398047,0.10961914380,0.12860206080,0.14110717340,0.14655533300,0.15212245890,0.15233422070,0.1521740437,0.1539843278,0.15514745160,\nG,,0.15147635060,0.07238581078,0.06968522213,0.07128524617,0.07252406181,0.07567350355,0.07943235275,0.09117074615,0.10537654310,0.1344820888,0.1400224330,0.08242500433,0.09563371204,0.10936069820,0.12848949680,0.14108995770,0.14405660970,0.15031406210,0.15131600980,0.1522018720,0.1534152011,0.07219962790,\nH,,0.07201551934,0.14139074650,0.10970399700,0.14927003800,0.15153471030,0.15239784500,0.15275285200,0.15300022370,0.15204696770,0.1499048651,0.1522479639,0.08013306126,0.08511773454,0.09873312909,0.11965236570,0.13423325770,0.14790643020,0.14787378410,0.15121033310,0.1516832849,0.1546688514,0.15391338010,\nI,,0.15106747120,0.14298828240,0.14478508750,0.14400005770,0.12812788070,0.15020659840,0.15070640480,0.14981230230,0.15107167610,0.1525554191,0.1492535524,0.08018720930,0.08601155699,0.09880353225,0.11672648890,0.13325225690,0.14354164670,0.14463708830,0.15318329890,0.1521327032,0.1512182552,0.07244861048,\nJ,,0.07134151692,0.07106139536,0.07290563639,0.07320964199,0.07531163459,0.08077714646,0.08726929940,0.10068593880,0.11914215450,0.1418191958,0.1443463920,0.07247201272,0.06999750950,0.07076991276,0.07228675508,0.07237591892,0.07201251723,0.07741640477,0.08773368972,0.1219768071,0.1387552698,0.15192226570,\nK,,0.15000436380,0.07156625599,0.07087075250,0.07123659002,0.07345421874,0.07832545577,0.08734304748,0.09985159477,0.11591447310,0.1397237122,0.1459823861,0.07214517236,0.07005683091,0.07016838344,0.07131776580,0.07200174821,0.07350492337,0.07785311421,0.08866229169,0.1234911377,0.1371697196,0.07064796366,\nL,,0.07054096934,0.07004726921,0.07201825002,0.07179815990,0.07268889103,0.07379454514,0.07427085340,0.07982570255,0.08854676858,0.1198873673,0.1322562498,0.07034679393,0.07523627163,0.07582258339,0.08392782907,0.09669262374,0.11261560310,0.12874291890,0.14171585180,0.1491004443,0.1502214336,0.15198125010,\nM,,0.15232172270,0.07166689716,0.07099964730,0.07172948942,0.07140356089,0.07359647053,0.07391627346,0.07872536050,0.08793247921,0.1177668597,0.1316288144,0.06733039177,0.07260462946,0.07516068933,0.08359475310,0.09611904399,0.11364151330,0.12772328380,0.14070692820,0.1486696188,0.1541842928,0.07174453270,\nN,,0.07126884935,0.07332587669,0.07786873273,0.08482253378,0.10140499840,0.11854947500,0.13401382360,0.14613488070,0.15066237370,0.1545757395,0.1510962397,0.07286614211,0.07215169457,0.07227939024,0.07337505876,0.07530546981,0.08265249465,0.09167518260,0.11122719660,0.1391977320,0.1459690588,0.15291802550,\nO,,0.15243482930,0.07280165939,0.07688708790,0.31500000000,0.09886803400,0.11454911710,0.12960429510,0.14047477320,0.14718270040,0.1509524590,0.1501338551,0.07212897291,0.07072700474,0.07059273173,0.07088234657,0.07421414395,0.08105493058,0.09094554089,0.10660934950,0.1358113503,0.1432621746,0.07009305748,\nP,,,,,,,,,,,,,,,,,,,,,,,,";var ve=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((o=o.apply(e,t||[])).next())}))};const ye=new e.Package;function xe(n,o,r){return ve(this,void 0,void 0,(function*(){const m=yield function(n){var o,r,m,h,p,g;return i(this,void 0,void 0,(function*(){const v=null===(r=null===(o=t.functions.getCurrentCall())||void 0===o?void 0:o.func)||void 0===r?void 0:r.package,y=(null!==(h=(null!==(m=null==v?void 0:v.packageOwner)&&void 0!==m?m:"").match(new RegExp("[^<]*<([^>]*)>")))&&void 0!==h?h:["",""])[1];yield S(v);const x=[];console.log("Running tests"),null!=n||(n={}),null!==(p=(g=n).testContext)&&void 0!==p||(g.testContext=new C),t.shell.clearLastError();const w=function(){const e=[];return console.log=(...t)=>{e.push(...t),l(...t)},console.info=(...t)=>{e.push(...t),u(...t)},console.warn=(...t)=>{e.push(...t),c(...t)},console.error=(...t)=>{e.push(...t),d(...t)},e}();yield function(n,o){var r,s,a,f,m,h,p;return i(this,void 0,void 0,(function*(){try{for(const[e,t]of Object.entries(n)){if((null==o?void 0:o.category)&&!e.toLowerCase().startsWith(null==o?void 0:o.category.toLowerCase())||(null===(r=o.exclude)||void 0===r?void 0:r.some((t=>e.startsWith(t)))))continue;l(`Started ${e} category`);const n=null===(s=t.tests)||void 0===s?void 0:s.every((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.skipReason}));n||(t.beforeStatus=yield T(t.before,null!==(a=o.category)&&void 0!==a?a:""));let u,c=null!==(f=t.tests)&&void 0!==f?f:[];o.stressTest&&(c=c.filter((e=>{var t;return null===(t=e.options)||void 0===t?void 0:t.stressTest})),c=R(c)),(null!==(h=null===(m=o.tags)||void 0===m?void 0:m.length)&&void 0!==h?h:0)>0&&(c=c.filter((e=>{var t,n;return null===(n=null===(t=e.options)||void 0===t?void 0:t.tags)||void 0===n?void 0:n.some((e=>{var t;return(null!==(t=null==o?void 0:o.tags)&&void 0!==t?t:[]).includes(e)}))}))),t.beforeStatus?(u=Array.from(c.map((t=>({date:(new Date).toISOString(),logs:"",category:e,name:t.name,result:"before() failed",success:!1,ms:0,skipped:!1})))),u.forEach((e=>i(this,void 0,void 0,(function*(){return O("package",e)}))))):u=yield _(t,o);const d=u.filter((e=>"skipped"!=e.result));n||(t.afterStatus=yield T(t.after,null!==(p=o.category)&&void 0!==p?p:"")),t.afterStatus&&d.push({date:(new Date).toISOString(),logs:"",category:e,name:"after",result:t.afterStatus,success:!1,ms:0,skipped:!1}),t.beforeStatus&&d.push({date:(new Date).toISOString(),logs:"",category:e,name:"before",result:t.beforeStatus,success:!1,ms:0,skipped:!1}),x.push(...d)}}finally{console.log=l,console.info=u,console.warn=c,console.error=d}if(o.testContext.catchUnhandled&&!e.Test.isInBenchmark){yield M(1e3);const n=yield t.shell.lastError,o={logs:"",date:(new Date).toISOString(),category:"Unhandled exceptions",name:"Exception",result:null!=n?n:"",success:!n,ms:0,skipped:!1,flaking:e.Test.isReproducing&&!n,owner:null!=y?y:""};x.push(o),o.package=v.name,yield O("package",o)}}))}(f,n);for(let e of x)e.result=e.result.toString().replace(/"/g,"'"),null!=e.logs&&(e.logs=e.logs.toString().replace(/"/g,"'"));return x;function T(e,t){return i(this,void 0,void 0,(function*(){var n=void 0;try{void 0!==e&&(yield D((()=>i(this,void 0,void 0,(function*(){yield e()}))),1e5,`before ${t}: timeout error`))}catch(e){n=yield P(e)}return n}))}function _(n,o){var r,l,u,c,d,f,m,h,p,g,x,C,T,_,I,b,E,N,A,S,O,P,R,M;return i(this,void 0,void 0,(function*(){let i=null!==(r=n.tests)&&void 0!==r?r:[];const D=[],F=null===(u=null===(l=null===window||void 0===window?void 0:window.performance)||void 0===l?void 0:l.memory)||void 0===u?void 0:u.usedJSHeapSize,X=e.Widget.getAll().length;if(n.clear)for(let r=0;r<i.length;r++){i[r].options&&void 0===(null===(c=i[r].options)||void 0===c?void 0:c.benchmark)&&(i[r].options||(i[r].options={}),i[r].options.benchmark=null!==(d=n.benchmarks)&&void 0!==d&&d);let l=i[r];(null==l?void 0:l.options)&&(l.options.owner=null!==(p=null!==(h=null!==(m=null===(f=i[r].options)||void 0===f?void 0:f.owner)&&void 0!==m?m:null==n?void 0:n.owner)&&void 0!==h?h:y)&&void 0!==p?p:""),window.gc&&window.gc();let u=yield L(l,null==o?void 0:o.test,w,e.Test.isInBenchmark?null!==(x=null===(g=i[r].options)||void 0===g?void 0:g.benchmarkTimeout)&&void 0!==x?x:a:null!==(T=null===(C=i[r].options)||void 0===C?void 0:C.timeout)&&void 0!==T?T:s,v.name,o.verbose);window.gc&&window.gc(),u&&D.push(Object.assign(Object.assign({},u),{memoryDelta:(null===(I=null===(_=null===window||void 0===window?void 0:window.performance)||void 0===_?void 0:_.memory)||void 0===I?void 0:I.usedJSHeapSize)-F,widgetsDelta:e.Widget.getAll().length-X})),t.shell.closeAll(),e.Balloon.closeAll()}else for(let t=0;t<i.length;t++){let r=i[t];(null==r?void 0:r.options)&&(r.options.owner=null!==(A=null!==(N=null!==(E=null===(b=i[t].options)||void 0===b?void 0:b.owner)&&void 0!==E?E:null==n?void 0:n.owner)&&void 0!==N?N:y)&&void 0!==A?A:""),window.gc&&window.gc();let s=yield L(r,null==o?void 0:o.test,w,e.Test.isInBenchmark?null!==(O=null===(S=i[t].options)||void 0===S?void 0:S.benchmarkTimeout)&&void 0!==O?O:a:null===(P=i[t].options)||void 0===P?void 0:P.timeout,v.name,o.verbose);window.gc&&window.gc(),s&&D.push(Object.assign(Object.assign({},s),{memoryUsed:(null===(M=null===(R=null===window||void 0===window?void 0:window.performance)||void 0===R?void 0:R.memory)||void 0===M?void 0:M.usedJSHeapSize)-F,widgetsDifference:e.Widget.getAll().length-X}))}return D}))}}))}({category:n,test:o,testContext:r});return e.DataFrame.fromObjects(m)}))}function Ce(){return ve(this,void 0,void 0,(function*(){yield S(ye,ye.getModule("package-test.js"))}))}})(),curves_test=o})();
|
|
2
2
|
//# sourceMappingURL=package-test.js.map
|