@datagrok/curves 1.3.1 → 1.4.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/CHANGELOG.md +17 -0
- package/README.md +2 -3
- 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/package.json +2 -2
- package/src/fit/const.ts +17 -41
- package/src/fit/fit-demo.ts +6 -3
- package/src/fit/fit-grid-cell-handler.ts +36 -22
- package/src/fit/fit-renderer.ts +15 -6
- package/src/fit/multi-curve-viewer.ts +3 -3
- package/src/fit/render-utils.ts +50 -96
- package/src/tests/detector-tests.ts +4 -5
- package/src/tests/fit-tests.ts +24 -20
package/dist/package-test.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var curves_test;(()=>{var __webpack_modules__={78:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function copyInto(e,n){for(var r=0;r<n.length;r++)e[r]=n[r]}function limitedMemoryBFGS(e,n){var r=+new Date,t=n.length,o=numeric.rep([t],0);e.getGradient(n,o);var i=numeric.clone(o),a=numeric.clone(n),s=numeric.clone(o);numeric.diveq(s,numeric.norm2(s));var u=[],c=[],l=[],f=(backtrackingLineSearch(e,s,o,n),e.getValue(n));o=e.getGradient(n,o);for(var m=f,h=0;h<100;h++){var d;if(new Date,u.length<4)u.unshift(numeric.sub(n,a)),c.unshift(numeric.sub(o,i));else{for(var p=u.pop(),y=c.pop(),g=0;g<t;g++)p[g]=n[g]-a[g],y[g]=o[g]-i[g];u.unshift(p),c.unshift(y)}copyInto(a,n),copyInto(i,o);var x=0,v=0;for(g=0;g<t;g++)x+=u[0][g]*c[0][g],v+=c[0][g]*c[0][g];var _=x/v;l.unshift(1/x),copyInto(s,o);for(var w=[],T=0;T<u.length;T++){var b=0;for(g=0;g<t;g++)b+=u[T][g]*s[g];for(b*=l[T],w.push(b),g=0;g<t;g++)s[g]+=c[T][g]*-b}for(g=0;g<t;g++)s[g]*=_;for(T=u.length-1;T>=0;T--){var A=0;for(g=0;g<t;g++)A+=c[T][g]*s[g];for(A*=l[T],b=w[T],g=0;g<t;g++)s[g]+=u[T][g]*(b-A)}for(g=0;g<t;g++)s[g]=-s[g];if(backtrackingLineSearch(e,s,o,n),f=e.getValue(n),o=e.getGradient(n,o),2*(f-m)<=1e-4*(Math.abs(f)+Math.abs(m)+1e-5))return d=+new Date,!0;var E=numeric.norm2(o);if(E<.001)return d=+new Date,!0;if(0==E)return d=+new Date,!0;m=f}return d=+new Date,console.log("Finished iterations "+(d-r)),!0}function backtrackingLineSearch(e,n,r,t){var o=t.length,i=0,a=1,s=0,u=e.getValue(t),c=u,l=numeric.norm2(n);l>100&&numeric.muleq(n,100/l);for(var f=0,m=0;m<o;m++)f+=r[m]*n[m];var h=0;for(m=0;m<o;m++){var d=Math.abs(n[m]/Math.max(Math.abs(t[m]),1));d>h&&(h=d)}for(var p=1e-4/h,y=0;y<25;y++){for(m=0;m<o;m++)t[m]+=(a-i)*n[m];if(a<p)return 0;var g=e.getValue(t);if(g>=u+1e-4*a*f)return a;if(isFinite(g))if(1==a)s=-f/(2*(g-u-f));else{var x=g-u-a*f,v=c-u-i*f,_=1/(a*a),w=1/(i*i),T=1/(a-i),b=T*(x*_-v*w),A=T*(-x*i*_+v*a*w);if(0==b)s=-f/(2*A);else{var E=A*A-3*b*f;s=E<0?.5*a:A<=0?(-A+Math.sqrt(E))/(3*b):-f/(A+Math.sqrt(E))}s>.5*a&&(s=.5*a)}else s=.2*a;c=g,i=a,a=Math.max(s,.1*a)}}__webpack_require__.d(__webpack_exports__,{U:()=>limitedMemoryBFGS});var quadratic={getValue:function(e){var n=e[0],r=e[1];return-3*n*n-4*r*r+2*n-4*r+18},getGradient:function(e,n){return n[0]=-6*e[0]+2,n[1]=-8*e[1]-4,n}};function doubleExp(e){for(var n=Array(e),r=0;r<e;r++)n[r]=Math.log(Math.random())*(Math.random()>.5?1:-1);return n}var ridgeRegression={covariates:[],responses:[],originalParameters:doubleExp(100),sample:function(e,n){for(var r=0;r<e;r++){var t=doubleExp(100);this.responses.push(numeric.dot(t,this.originalParameters)+n()),this.covariates.push(t)}},getValue:function(e){for(var n=0,r=0;r<this.covariates.length;r++){var t=this.responses[r]-numeric.dot(this.covariates[r],e);n+=-.5*t*t}return n},getGradient:function(e,n){for(var r=0;r<this.covariates.length;r++){var t=this.responses[r]-numeric.dot(this.covariates[r],e);numeric.addeq(n,numeric.mul(this.covariates[r],t))}return n}},numeric="undefined"==typeof exports?function(){}:exports;void 0!==__webpack_require__.g&&(__webpack_require__.g.numeric=numeric),numeric.version="1.2.6",numeric.bench=function(e,n){var r,t,o;for(void 0===n&&(n=15),t=.5,r=new Date;;){for(o=t*=2;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;if(new Date-r>n)break}for(o=t;o>3;o-=4)e(),e(),e(),e();for(;o>0;)e(),o--;return 1e3*(3*t-1)/(new Date-r)},numeric._myIndexOf=function(e){var n,r=this.length;for(n=0;n<r;++n)if(this[n]===e)return n;return-1},numeric.myIndexOf=Array.prototype.indexOf?Array.prototype.indexOf:numeric._myIndexOf,numeric.Function=Function,numeric.precision=4,numeric.largeArray=50,numeric.prettyPrint=function(e){function n(e){if(0===e)return"0";if(isNaN(e))return"NaN";if(e<0)return"-"+n(-e);if(isFinite(e)){var r=Math.floor(Math.log(e)/Math.log(10)),t=e/Math.pow(10,r),o=t.toPrecision(numeric.precision);return 10===parseFloat(o)&&(r++,o=(t=1).toPrecision(numeric.precision)),parseFloat(o).toString()+"e"+r.toString()}return"Infinity"}var r=[];return function e(t){var o;if(void 0===t)return r.push(Array(numeric.precision+8).join(" ")),!1;if("string"==typeof t)return r.push('"'+t+'"'),!1;if("boolean"==typeof t)return r.push(t.toString()),!1;if("number"==typeof t){var i=n(t),a=t.toPrecision(numeric.precision),s=parseFloat(t.toString()).toString(),u=[i,a,s,parseFloat(a).toString(),parseFloat(s).toString()];for(o=1;o<u.length;o++)u[o].length<i.length&&(i=u[o]);return r.push(Array(numeric.precision+8-i.length).join(" ")+i),!1}if(null===t)return r.push("null"),!1;if("function"==typeof t){r.push(t.toString());var c=!1;for(o in t)t.hasOwnProperty(o)&&(c?r.push(",\n"):r.push("\n{"),c=!0,r.push(o),r.push(": \n"),e(t[o]));return c&&r.push("}\n"),!0}if(t instanceof Array){if(t.length>numeric.largeArray)return r.push("...Large Array..."),!0;for(c=!1,r.push("["),o=0;o<t.length;o++)o>0&&(r.push(","),c&&r.push("\n ")),c=e(t[o]);return r.push("]"),!0}for(o in r.push("{"),c=!1,t)t.hasOwnProperty(o)&&(c&&r.push(",\n"),c=!0,r.push(o),r.push(": \n"),e(t[o]));return r.push("}"),!0}(e),r.join("")},numeric.parseDate=function(e){return function e(n){if("string"==typeof n)return Date.parse(n.replace(/-/g,"/"));if(n instanceof Array){var r,t=[];for(r=0;r<n.length;r++)t[r]=e(n[r]);return t}throw new Error("parseDate: parameter must be arrays of strings")}(e)},numeric.parseFloat=function(e){return function e(n){if("string"==typeof n)return parseFloat(n);if(n instanceof Array){var r,t=[];for(r=0;r<n.length;r++)t[r]=e(n[r]);return t}throw new Error("parseFloat: parameter must be arrays of strings")}(e)},numeric.parseCSV=function(e){var n,r,t,o=e.split("\n"),i=[],a=/(([^'",]*)|('[^']*')|("[^"]*")),/g,s=/^\s*(([+-]?[0-9]+(\.[0-9]*)?(e[+-]?[0-9]+)?)|([+-]?[0-9]*(\.[0-9]+)?(e[+-]?[0-9]+)?))\s*$/,u=0;for(r=0;r<o.length;r++){var c,l=(o[r]+",").match(a);if(l.length>0){for(i[u]=[],n=0;n<l.length;n++)c=(t=l[n]).substr(0,t.length-1),s.test(c)?i[u][n]=parseFloat(c):i[u][n]=c;u++}}return i},numeric.toCSV=function(e){var n,r,t,o,i,a=numeric.dim(e);for(t=a[0],a[1],i=[],n=0;n<t;n++){for(o=[],r=0;r<t;r++)o[r]=e[n][r].toString();i[n]=o.join(", ")}return i.join("\n")+"\n"},numeric.getURL=function(e){var n=new XMLHttpRequest;return n.open("GET",e,!1),n.send(),n},numeric.imageURL=function(e){function n(e,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);var t,o=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],i=-1;for(e.length,t=n;t<r;t++)i=i>>>8^o[255&(i^e[t])];return-1^i}var r,t,o,i,a,s,u,c,l,f,m=e[0].length,h=e[0][0].length,d=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,h>>24&255,h>>16&255,h>>8&255,255&h,m>>24&255,m>>16&255,m>>8&255,255&m,8,2,0,0,0,-1,-2,-3,-4,-5,-6,-7,-8,73,68,65,84,8,29];for(f=n(d,12,29),d[29]=f>>24&255,d[30]=f>>16&255,d[31]=f>>8&255,d[32]=255&f,r=1,t=0,u=0;u<m;u++){for(u<m-1?d.push(0):d.push(1),a=3*h+1+(0===u)&255,s=3*h+1+(0===u)>>8&255,d.push(a),d.push(s),d.push(255&~a),d.push(255&~s),0===u&&d.push(0),c=0;c<h;c++)for(o=0;o<3;o++)t=(t+(r=(r+(a=(a=e[o][u][c])>255?255:a<0?0:Math.round(a)))%65521))%65521,d.push(a);d.push(0)}return l=(t<<16)+r,d.push(l>>24&255),d.push(l>>16&255),d.push(l>>8&255),d.push(255&l),i=d.length-41,d[33]=i>>24&255,d[34]=i>>16&255,d[35]=i>>8&255,d[36]=255&i,f=n(d,37),d.push(f>>24&255),d.push(f>>16&255),d.push(f>>8&255),d.push(255&f),d.push(0),d.push(0),d.push(0),d.push(0),d.push(73),d.push(69),d.push(78),d.push(68),d.push(174),d.push(66),d.push(96),d.push(130),"data:image/png;base64,"+function(e){var n,r,t,o,i,a,s,u=e.length,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="";for(n=0;n<u;n+=3)i=((3&(r=e[n]))<<4)+((t=e[n+1])>>4),a=((15&t)<<2)+((o=e[n+2])>>6),s=63&o,n+1>=u?a=s=64:n+2>=u&&(s=64),l+=c.charAt(r>>2)+c.charAt(i)+c.charAt(a)+c.charAt(s);return l}(d)},numeric._dim=function(e){for(var n=[];"object"==typeof e;)n.push(e.length),e=e[0];return n},numeric.dim=function(e){var n;return"object"==typeof e?"object"==typeof(n=e[0])?"object"==typeof n[0]?numeric._dim(e):[e.length,n.length]:[e.length]:[]},numeric.mapreduce=function(e,n){return Function("x","accum","_s","_k",'if(typeof accum === "undefined") accum = '+n+';\nif(typeof x === "number") { var xi = x; '+e+'; return accum; }\nif(typeof _s === "undefined") _s = numeric.dim(x);\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i,xi;\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) {\n accum = arguments.callee(x[i],accum,_s,_k+1);\n } return accum;\n}\nfor(i=_n-1;i>=1;i-=2) { \n xi = x[i];\n '+e+";\n xi = x[i-1];\n "+e+";\n}\nif(i === 0) {\n xi = x[i];\n "+e+"\n}\nreturn accum;")},numeric.mapreduce2=function(e,n){return Function("x","var n = x.length;\nvar i,xi;\n"+n+";\nfor(i=n-1;i!==-1;--i) { \n xi = x[i];\n "+e+";\n}\nreturn accum;")},numeric.same=function e(n,r){var t,o;if(n instanceof Array&&r instanceof Array){if((o=n.length)!==r.length)return!1;for(t=0;t<o;t++)if(n[t]!==r[t]){if("object"!=typeof n[t])return!1;if(!e(n[t],r[t]))return!1}return!0}return!1},numeric.rep=function(e,n,r){void 0===r&&(r=0);var t,o=e[r],i=Array(o);if(r===e.length-1){for(t=o-2;t>=0;t-=2)i[t+1]=n,i[t]=n;return-1===t&&(i[0]=n),i}for(t=o-1;t>=0;t--)i[t]=numeric.rep(e,n,r+1);return i},numeric.dotMMsmall=function(e,n){var r,t,o,i,a,s,u,c,l,f,m;for(i=e.length,a=n.length,s=n[0].length,u=Array(i),r=i-1;r>=0;r--){for(c=Array(s),l=e[r],o=s-1;o>=0;o--){for(f=l[a-1]*n[a-1][o],t=a-2;t>=1;t-=2)m=t-1,f+=l[t]*n[t][o]+l[m]*n[m][o];0===t&&(f+=l[0]*n[0][o]),c[o]=f}u[r]=c}return u},numeric._getCol=function(e,n,r){var t;for(t=e.length-1;t>0;--t)r[t]=e[t][n],r[--t]=e[t][n];0===t&&(r[0]=e[0][n])},numeric.dotMMbig=function(e,n){var r,t,o,i=numeric._getCol,a=n.length,s=Array(a),u=e.length,c=n[0].length,l=new Array(u),f=numeric.dotVV;for(--a,t=--u;-1!==t;--t)l[t]=Array(c);for(t=--c;-1!==t;--t)for(i(n,t,s),o=u;-1!==o;--o)r=e[o],l[o][t]=f(r,s);return l},numeric.dotMV=function(e,n){var r,t=e.length,o=(n.length,Array(t)),i=numeric.dotVV;for(r=t-1;r>=0;r--)o[r]=i(e[r],n);return o},numeric.dotVM=function(e,n){var r,t,o,i,a,s,u;for(o=e.length,i=n[0].length,a=Array(i),t=i-1;t>=0;t--){for(s=e[o-1]*n[o-1][t],r=o-2;r>=1;r-=2)u=r-1,s+=e[r]*n[r][t]+e[u]*n[u][t];0===r&&(s+=e[0]*n[0][t]),a[t]=s}return a},numeric.dotVV=function(e,n){var r,t,o=e.length,i=e[o-1]*n[o-1];for(r=o-2;r>=1;r-=2)t=r-1,i+=e[r]*n[r]+e[t]*n[t];return 0===r&&(i+=e[0]*n[0]),i},numeric.dot=function(e,n){var r=numeric.dim;switch(1e3*r(e).length+r(n).length){case 2002:return n.length<10?numeric.dotMMsmall(e,n):numeric.dotMMbig(e,n);case 2001:return numeric.dotMV(e,n);case 1002:return numeric.dotVM(e,n);case 1001:return numeric.dotVV(e,n);case 1e3:return numeric.mulVS(e,n);case 1:return numeric.mulSV(e,n);case 0:return e*n;default:throw new Error("numeric.dot only works on vectors and matrices")}},numeric.diag=function(e){var n,r,t,o,i=e.length,a=Array(i);for(n=i-1;n>=0;n--){for(o=Array(i),r=n+2,t=i-1;t>=r;t-=2)o[t]=0,o[t-1]=0;for(t>n&&(o[t]=0),o[n]=e[n],t=n-1;t>=1;t-=2)o[t]=0,o[t-1]=0;0===t&&(o[0]=0),a[n]=o}return a},numeric.getDiag=function(e){var n,r=Math.min(e.length,e[0].length),t=Array(r);for(n=r-1;n>=1;--n)t[n]=e[n][n],t[--n]=e[n][n];return 0===n&&(t[0]=e[0][0]),t},numeric.identity=function(e){return numeric.diag(numeric.rep([e],1))},numeric.pointwise=function(e,n,r){void 0===r&&(r="");var t,o,i=[],a=/\[i\]$/,s="",u=!1;for(t=0;t<e.length;t++)a.test(e[t])?s=o=e[t].substring(0,e[t].length-3):o=e[t],"ret"===o&&(u=!0),i.push(o);return i[e.length]="_s",i[e.length+1]="_k",i[e.length+2]='if(typeof _s === "undefined") _s = numeric.dim('+s+');\nif(typeof _k === "undefined") _k = 0;\nvar _n = _s[_k];\nvar i'+(u?"":", ret = Array(_n)")+";\nif(_k < _s.length-1) {\n for(i=_n-1;i>=0;i--) ret[i] = arguments.callee("+e.join(",")+",_s,_k+1);\n return ret;\n}\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n "+n+"\n}\nreturn ret;",Function.apply(null,i)},numeric.pointwise2=function(e,n,r){void 0===r&&(r="");var t,o,i=[],a=/\[i\]$/,s="",u=!1;for(t=0;t<e.length;t++)a.test(e[t])?s=o=e[t].substring(0,e[t].length-3):o=e[t],"ret"===o&&(u=!0),i.push(o);return i[e.length]="var _n = "+s+".length;\nvar i"+(u?"":", ret = Array(_n)")+";\n"+r+"\nfor(i=_n-1;i!==-1;--i) {\n"+n+"\n}\nreturn ret;",Function.apply(null,i)},numeric._biforeach=function e(n,r,t,o,i){var a;if(o!==t.length-1)for(a=t[o]-1;a>=0;a--)e("object"==typeof n?n[a]:n,"object"==typeof r?r[a]:r,t,o+1,i);else i(n,r)},numeric._biforeach2=function e(n,r,t,o,i){if(o===t.length-1)return i(n,r);var a,s=t[o],u=Array(s);for(a=s-1;a>=0;--a)u[a]=e("object"==typeof n?n[a]:n,"object"==typeof r?r[a]:r,t,o+1,i);return u},numeric._foreach=function e(n,r,t,o){var i;if(t!==r.length-1)for(i=r[t]-1;i>=0;i--)e(n[i],r,t+1,o);else o(n)},numeric._foreach2=function e(n,r,t,o){if(t===r.length-1)return o(n);var i,a=r[t],s=Array(a);for(i=a-1;i>=0;i--)s[i]=e(n[i],r,t+1,o);return s},numeric.ops2={add:"+",sub:"-",mul:"*",div:"/",mod:"%",and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">=",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"},numeric.opseq={addeq:"+=",subeq:"-=",muleq:"*=",diveq:"/=",modeq:"%=",lshifteq:"<<=",rshifteq:">>=",rrshifteq:">>>=",bandeq:"&=",boreq:"|=",bxoreq:"^="},numeric.mathfuns=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan","isNaN","isFinite"],numeric.mathfuns2=["atan2","pow","max","min"],numeric.ops1={neg:"-",not:"!",bnot:"~",clone:""},numeric.mapreducers={any:["if(xi) return true;","var accum = false;"],all:["if(!xi) return false;","var accum = true;"],sum:["accum += xi;","var accum = 0;"],prod:["accum *= xi;","var accum = 1;"],norm2Squared:["accum += xi*xi;","var accum = 0;"],norminf:["accum = max(accum,abs(xi));","var accum = 0, max = Math.max, abs = Math.abs;"],norm1:["accum += abs(xi)","var accum = 0, abs = Math.abs;"],sup:["accum = max(accum,xi);","var accum = -Infinity, max = Math.max;"],inf:["accum = min(accum,xi);","var accum = Infinity, min = Math.min;"]},function(){var e,n;for(e=0;e<numeric.mathfuns2.length;++e)n=numeric.mathfuns2[e],numeric.ops2[n]=n;for(e in numeric.ops2)if(numeric.ops2.hasOwnProperty(e)){n=numeric.ops2[e];var r,t,o="";-1!==numeric.myIndexOf.call(numeric.mathfuns2,e)?(o="var "+n+" = Math."+n+";\n",r=function(e,r,t){return e+" = "+n+"("+r+","+t+")"},t=function(e,r){return e+" = "+n+"("+e+","+r+")"}):(r=function(e,r,t){return e+" = "+r+" "+n+" "+t},t=numeric.opseq.hasOwnProperty(e+"eq")?function(e,r){return e+" "+n+"= "+r}:function(e,r){return e+" = "+e+" "+n+" "+r}),numeric[e+"VV"]=numeric.pointwise2(["x[i]","y[i]"],r("ret[i]","x[i]","y[i]"),o),numeric[e+"SV"]=numeric.pointwise2(["x","y[i]"],r("ret[i]","x","y[i]"),o),numeric[e+"VS"]=numeric.pointwise2(["x[i]","y"],r("ret[i]","x[i]","y"),o),numeric[e]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar VV = numeric."+e+"VV, VS = numeric."+e+"VS, SV = numeric."+e+'SV;\nvar dim = numeric.dim;\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof x === "object") {\n if(typeof y === "object") x = numeric._biforeach2(x,y,dim(x),0,VV);\n else x = numeric._biforeach2(x,y,dim(x),0,VS);\n } else if(typeof y === "object") x = numeric._biforeach2(x,y,dim(y),0,SV);\n else '+t("x","y")+"\n}\nreturn x;\n"),numeric[n]=numeric[e],numeric[e+"eqV"]=numeric.pointwise2(["ret[i]","x[i]"],t("ret[i]","x[i]"),o),numeric[e+"eqS"]=numeric.pointwise2(["ret[i]","x"],t("ret[i]","x"),o),numeric[e+"eq"]=Function("var n = arguments.length, i, x = arguments[0], y;\nvar V = numeric."+e+"eqV, S = numeric."+e+'eqS\nvar s = numeric.dim(x);\nfor(i=1;i!==n;++i) { \n y = arguments[i];\n if(typeof y === "object") numeric._biforeach(x,y,s,0,V);\n else numeric._biforeach(x,y,s,0,S);\n}\nreturn x;\n')}for(e=0;e<numeric.mathfuns2.length;++e)n=numeric.mathfuns2[e],delete numeric.ops2[n];for(e=0;e<numeric.mathfuns.length;++e)n=numeric.mathfuns[e],numeric.ops1[n]=n;for(e in numeric.ops1)numeric.ops1.hasOwnProperty(e)&&(o="",n=numeric.ops1[e],-1!==numeric.myIndexOf.call(numeric.mathfuns,e)&&Math.hasOwnProperty(n)&&(o="var "+n+" = Math."+n+";\n"),numeric[e+"eqV"]=numeric.pointwise2(["ret[i]"],"ret[i] = "+n+"(ret[i]);",o),numeric[e+"eq"]=Function("x",'if(typeof x !== "object") return '+n+"x\nvar i;\nvar V = numeric."+e+"eqV;\nvar s = numeric.dim(x);\nnumeric._foreach(x,s,0,V);\nreturn x;\n"),numeric[e+"V"]=numeric.pointwise2(["x[i]"],"ret[i] = "+n+"(x[i]);",o),numeric[e]=Function("x",'if(typeof x !== "object") return '+n+"(x)\nvar i;\nvar V = numeric."+e+"V;\nvar s = numeric.dim(x);\nreturn numeric._foreach2(x,s,0,V);\n"));for(e=0;e<numeric.mathfuns.length;++e)n=numeric.mathfuns[e],delete numeric.ops1[n];for(e in numeric.mapreducers)numeric.mapreducers.hasOwnProperty(e)&&(n=numeric.mapreducers[e],numeric[e+"V"]=numeric.mapreduce2(n[0],n[1]),numeric[e]=Function("x","s","k",n[1]+'if(typeof x !== "object") { xi = x;\n'+n[0]+';\n return accum;\n}if(typeof s === "undefined") s = numeric.dim(x);\nif(typeof k === "undefined") k = 0;\nif(k === s.length-1) return numeric.'+e+"V(x);\nvar xi;\nvar n = x.length, i;\nfor(i=n-1;i!==-1;--i) {\n xi = arguments.callee(x[i]);\n"+n[0]+";\n}\nreturn accum;\n"))}(),numeric.truncVV=numeric.pointwise(["x[i]","y[i]"],"ret[i] = round(x[i]/y[i])*y[i];","var round = Math.round;"),numeric.truncVS=numeric.pointwise(["x[i]","y"],"ret[i] = round(x[i]/y)*y;","var round = Math.round;"),numeric.truncSV=numeric.pointwise(["x","y[i]"],"ret[i] = round(x/y[i])*y[i];","var round = Math.round;"),numeric.trunc=function(e,n){return"object"==typeof e?"object"==typeof n?numeric.truncVV(e,n):numeric.truncVS(e,n):"object"==typeof n?numeric.truncSV(e,n):Math.round(e/n)*n},numeric.inv=function(e){var n,r,t,o,i,a,s,u=numeric.dim(e),c=Math.abs,l=u[0],f=u[1],m=numeric.clone(e),h=numeric.identity(l);for(a=0;a<f;++a){var d=-1,p=-1;for(i=a;i!==l;++i)(s=c(m[i][a]))>p&&(d=i,p=s);for(r=m[d],m[d]=m[a],m[a]=r,o=h[d],h[d]=h[a],h[a]=o,e=r[a],s=a;s!==f;++s)r[s]/=e;for(s=f-1;-1!==s;--s)o[s]/=e;for(i=l-1;-1!==i;--i)if(i!==a){for(n=m[i],t=h[i],e=n[a],s=a+1;s!==f;++s)n[s]-=r[s]*e;for(s=f-1;s>0;--s)t[s]-=o[s]*e,t[--s]-=o[s]*e;0===s&&(t[0]-=o[0]*e)}}return h},numeric.det=function(e){var n=numeric.dim(e);if(2!==n.length||n[0]!==n[1])throw new Error("numeric: det() only works on square matrices");var r,t,o,i,a,s,u,c,l=n[0],f=1,m=numeric.clone(e);for(t=0;t<l-1;t++){for(o=t,r=t+1;r<l;r++)Math.abs(m[r][t])>Math.abs(m[o][t])&&(o=r);for(o!==t&&(u=m[o],m[o]=m[t],m[t]=u,f*=-1),i=m[t],r=t+1;r<l;r++){for(s=(a=m[r])[t]/i[t],o=t+1;o<l-1;o+=2)c=o+1,a[o]-=i[o]*s,a[c]-=i[c]*s;o!==l&&(a[o]-=i[o]*s)}if(0===i[t])return 0;f*=i[t]}return f*m[t][t]},numeric.transpose=function(e){var n,r,t,o,i,a=e.length,s=e[0].length,u=Array(s);for(r=0;r<s;r++)u[r]=Array(a);for(n=a-1;n>=1;n-=2){for(o=e[n],t=e[n-1],r=s-1;r>=1;--r)(i=u[r])[n]=o[r],i[n-1]=t[r],(i=u[--r])[n]=o[r],i[n-1]=t[r];0===r&&((i=u[0])[n]=o[0],i[n-1]=t[0])}if(0===n){for(t=e[0],r=s-1;r>=1;--r)u[r][0]=t[r],u[--r][0]=t[r];0===r&&(u[0][0]=t[0])}return u},numeric.negtranspose=function(e){var n,r,t,o,i,a=e.length,s=e[0].length,u=Array(s);for(r=0;r<s;r++)u[r]=Array(a);for(n=a-1;n>=1;n-=2){for(o=e[n],t=e[n-1],r=s-1;r>=1;--r)(i=u[r])[n]=-o[r],i[n-1]=-t[r],(i=u[--r])[n]=-o[r],i[n-1]=-t[r];0===r&&((i=u[0])[n]=-o[0],i[n-1]=-t[0])}if(0===n){for(t=e[0],r=s-1;r>=1;--r)u[r][0]=-t[r],u[--r][0]=-t[r];0===r&&(u[0][0]=-t[0])}return u},numeric._random=function e(n,r){var t,o,i=n[r],a=Array(i);if(r===n.length-1){for(o=Math.random,t=i-1;t>=1;t-=2)a[t]=o(),a[t-1]=o();return 0===t&&(a[0]=o()),a}for(t=i-1;t>=0;t--)a[t]=e(n,r+1);return a},numeric.random=function(e){return numeric._random(e,0)},numeric.norm2=function(e){return Math.sqrt(numeric.norm2Squared(e))},numeric.linspace=function(e,n,r){if(void 0===r&&(r=Math.max(Math.round(n-e)+1,1)),r<2)return 1===r?[e]:[];var t,o=Array(r);for(t=--r;t>=0;t--)o[t]=(t*n+(r-t)*e)/r;return o},numeric.getBlock=function(e,n,r){var t=numeric.dim(e);return function e(o,i){var a,s=n[i],u=r[i]-s,c=Array(u);if(i===t.length-1){for(a=u;a>=0;a--)c[a]=o[a+s];return c}for(a=u;a>=0;a--)c[a]=e(o[a+s],i+1);return c}(e,0)},numeric.setBlock=function(e,n,r,t){var o=numeric.dim(e);return function e(t,i,a){var s,u=n[a],c=r[a]-u;if(a===o.length-1)for(s=c;s>=0;s--)t[s+u]=i[s];for(s=c;s>=0;s--)e(t[s+u],i[s],a+1)}(e,t,0),e},numeric.getRange=function(e,n,r){var t,o,i,a,s=n.length,u=r.length,c=Array(s);for(t=s-1;-1!==t;--t)for(c[t]=Array(u),i=c[t],a=e[n[t]],o=u-1;-1!==o;--o)i[o]=a[r[o]];return c},numeric.blockMatrix=function(e){var n=numeric.dim(e);if(n.length<4)return numeric.blockMatrix([e]);var r,t,o,i,a,s=n[0],u=n[1];for(r=0,t=0,o=0;o<s;++o)r+=e[o][0].length;for(i=0;i<u;++i)t+=e[0][i][0].length;var c=Array(r);for(o=0;o<r;++o)c[o]=Array(t);var l,f,m,h,d,p=0;for(o=0;o<s;++o){for(l=t,i=u-1;-1!==i;--i)for(l-=(a=e[o][i])[0].length,m=a.length-1;-1!==m;--m)for(d=a[m],f=c[p+m],h=d.length-1;-1!==h;--h)f[l+h]=d[h];p+=e[o][0].length}return c},numeric.tensor=function(e,n){if("number"==typeof e||"number"==typeof n)return numeric.mul(e,n);var r=numeric.dim(e),t=numeric.dim(n);if(1!==r.length||1!==t.length)throw new Error("numeric: tensor product is only defined for vectors");var o,i,a,s,u=r[0],c=t[0],l=Array(u);for(i=u-1;i>=0;i--){for(o=Array(c),s=e[i],a=c-1;a>=3;--a)o[a]=s*n[a],o[--a]=s*n[a],o[--a]=s*n[a],o[--a]=s*n[a];for(;a>=0;)o[a]=s*n[a],--a;l[i]=o}return l},numeric.T=function(e,n){this.x=e,this.y=n},numeric.t=function(e,n){return new numeric.T(e,n)},numeric.Tbinop=function(e,n,r,t,o){var i;if(numeric.indexOf,"string"!=typeof o)for(i in o="",numeric)numeric.hasOwnProperty(i)&&(e.indexOf(i)>=0||n.indexOf(i)>=0||r.indexOf(i)>=0||t.indexOf(i)>=0)&&i.length>1&&(o+="var "+i+" = numeric."+i+";\n");return Function(["y"],"var x = this;\nif(!(y instanceof numeric.T)) { y = new numeric.T(y); }\n"+o+"\nif(x.y) { if(y.y) { return new numeric.T("+t+");\n }\n return new numeric.T("+r+");\n}\nif(y.y) {\n return new numeric.T("+n+");\n}\nreturn new numeric.T("+e+");\n")},numeric.T.prototype.add=numeric.Tbinop("add(x.x,y.x)","add(x.x,y.x),y.y","add(x.x,y.x),x.y","add(x.x,y.x),add(x.y,y.y)"),numeric.T.prototype.sub=numeric.Tbinop("sub(x.x,y.x)","sub(x.x,y.x),neg(y.y)","sub(x.x,y.x),x.y","sub(x.x,y.x),sub(x.y,y.y)"),numeric.T.prototype.mul=numeric.Tbinop("mul(x.x,y.x)","mul(x.x,y.x),mul(x.x,y.y)","mul(x.x,y.x),mul(x.y,y.x)","sub(mul(x.x,y.x),mul(x.y,y.y)),add(mul(x.x,y.y),mul(x.y,y.x))"),numeric.T.prototype.reciprocal=function(){var e=numeric.mul,n=numeric.div;if(this.y){var r=numeric.add(e(this.x,this.x),e(this.y,this.y));return new numeric.T(n(this.x,r),n(numeric.neg(this.y),r))}return new T(n(1,this.x))},numeric.T.prototype.div=function(e){if(e instanceof numeric.T||(e=new numeric.T(e)),e.y)return this.mul(e.reciprocal());var n=numeric.div;return this.y?new numeric.T(n(this.x,e.x),n(this.y,e.x)):new numeric.T(n(this.x,e.x))},numeric.T.prototype.dot=numeric.Tbinop("dot(x.x,y.x)","dot(x.x,y.x),dot(x.x,y.y)","dot(x.x,y.x),dot(x.y,y.x)","sub(dot(x.x,y.x),dot(x.y,y.y)),add(dot(x.x,y.y),dot(x.y,y.x))"),numeric.T.prototype.transpose=function(){var e=numeric.transpose,n=this.x,r=this.y;return r?new numeric.T(e(n),e(r)):new numeric.T(e(n))},numeric.T.prototype.transjugate=function(){var e=numeric.transpose,n=this.x,r=this.y;return r?new numeric.T(e(n),numeric.negtranspose(r)):new numeric.T(e(n))},numeric.Tunop=function(e,n,r){return"string"!=typeof r&&(r=""),Function("var x = this;\n"+r+"\nif(x.y) { "+n+";\n}\n"+e+";\n")},numeric.T.prototype.exp=numeric.Tunop("return new numeric.T(ex)","return new numeric.T(mul(cos(x.y),ex),mul(sin(x.y),ex))","var ex = numeric.exp(x.x), cos = numeric.cos, sin = numeric.sin, mul = numeric.mul;"),numeric.T.prototype.conj=numeric.Tunop("return new numeric.T(x.x);","return new numeric.T(x.x,numeric.neg(x.y));"),numeric.T.prototype.neg=numeric.Tunop("return new numeric.T(neg(x.x));","return new numeric.T(neg(x.x),neg(x.y));","var neg = numeric.neg;"),numeric.T.prototype.sin=numeric.Tunop("return new numeric.T(numeric.sin(x.x))","return x.exp().sub(x.neg().exp()).div(new numeric.T(0,2));"),numeric.T.prototype.cos=numeric.Tunop("return new numeric.T(numeric.cos(x.x))","return x.exp().add(x.neg().exp()).div(2);"),numeric.T.prototype.abs=numeric.Tunop("return new numeric.T(numeric.abs(x.x));","return new numeric.T(numeric.sqrt(numeric.add(mul(x.x,x.x),mul(x.y,x.y))));","var mul = numeric.mul;"),numeric.T.prototype.log=numeric.Tunop("return new numeric.T(numeric.log(x.x));","var theta = new numeric.T(numeric.atan2(x.y,x.x)), r = x.abs();\nreturn new numeric.T(numeric.log(r.x),theta.x);"),numeric.T.prototype.norm2=numeric.Tunop("return numeric.norm2(x.x);","var f = numeric.norm2Squared;\nreturn Math.sqrt(f(x.x)+f(x.y));"),numeric.T.prototype.inv=function(){var e=this;if(void 0===e.y)return new numeric.T(numeric.inv(e.x));var n,r,t,o,i,a,s,u,c,l,f,m,h,d,p,y,g,x,v=e.x.length,_=numeric.identity(v),w=numeric.rep([v,v],0),T=numeric.clone(e.x),b=numeric.clone(e.y);for(c=0;c<v;c++){for(m=(d=T[c][c])*d+(p=b[c][c])*p,f=c,l=c+1;l<v;l++)(h=(d=T[l][c])*d+(p=b[l][c])*p)>m&&(f=l,m=h);for(f!==c&&(x=T[c],T[c]=T[f],T[f]=x,x=b[c],b[c]=b[f],b[f]=x,x=_[c],_[c]=_[f],_[f]=x,x=w[c],w[c]=w[f],w[f]=x),n=T[c],r=b[c],i=_[c],a=w[c],d=n[c],p=r[c],l=c+1;l<v;l++)y=n[l],g=r[l],n[l]=(y*d+g*p)/m,r[l]=(g*d-y*p)/m;for(l=0;l<v;l++)y=i[l],g=a[l],i[l]=(y*d+g*p)/m,a[l]=(g*d-y*p)/m;for(l=c+1;l<v;l++){for(t=T[l],o=b[l],s=_[l],u=w[l],d=t[c],p=o[c],f=c+1;f<v;f++)y=n[f],g=r[f],t[f]-=y*d-g*p,o[f]-=g*d+y*p;for(f=0;f<v;f++)y=i[f],g=a[f],s[f]-=y*d-g*p,u[f]-=g*d+y*p}}for(c=v-1;c>0;c--)for(i=_[c],a=w[c],l=c-1;l>=0;l--)for(s=_[l],u=w[l],d=T[l][c],p=b[l][c],f=v-1;f>=0;f--)y=i[f],g=a[f],s[f]-=d*y-p*g,u[f]-=d*g+p*y;return new numeric.T(_,w)},numeric.T.prototype.get=function(e){var n,r=this.x,t=this.y,o=0,i=e.length;if(t){for(;o<i;)r=r[n=e[o]],t=t[n],o++;return new numeric.T(r,t)}for(;o<i;)r=r[n=e[o]],o++;return new numeric.T(r)},numeric.T.prototype.set=function(e,n){var r,t=this.x,o=this.y,i=0,a=e.length,s=n.x,u=n.y;if(0===a)return u?this.y=u:o&&(this.y=void 0),this.x=t,this;if(u){for(o||(o=numeric.rep(numeric.dim(t),0),this.y=o);i<a-1;)t=t[r=e[i]],o=o[r],i++;return t[r=e[i]]=s,o[r]=u,this}if(o){for(;i<a-1;)t=t[r=e[i]],o=o[r],i++;return t[r=e[i]]=s,o[r]=s instanceof Array?numeric.rep(numeric.dim(s),0):0,this}for(;i<a-1;)t=t[r=e[i]],i++;return t[r=e[i]]=s,this},numeric.T.prototype.getRows=function(e,n){var r,t,o=n-e+1,i=Array(o),a=this.x,s=this.y;for(r=e;r<=n;r++)i[r-e]=a[r];if(s){for(t=Array(o),r=e;r<=n;r++)t[r-e]=s[r];return new numeric.T(i,t)}return new numeric.T(i)},numeric.T.prototype.setRows=function(e,n,r){var t,o=this.x,i=this.y,a=r.x,s=r.y;for(t=e;t<=n;t++)o[t]=a[t-e];if(s)for(i||(i=numeric.rep(numeric.dim(o),0),this.y=i),t=e;t<=n;t++)i[t]=s[t-e];else if(i)for(t=e;t<=n;t++)i[t]=numeric.rep([a[t-e].length],0);return this},numeric.T.prototype.getRow=function(e){var n=this.x,r=this.y;return r?new numeric.T(n[e],r[e]):new numeric.T(n[e])},numeric.T.prototype.setRow=function(e,n){var r=this.x,t=this.y,o=n.x,i=n.y;return r[e]=o,i?(t||(t=numeric.rep(numeric.dim(r),0),this.y=t),t[e]=i):t&&(t=numeric.rep([o.length],0)),this},numeric.T.prototype.getBlock=function(e,n){var r=this.x,t=this.y,o=numeric.getBlock;return t?new numeric.T(o(r,e,n),o(t,e,n)):new numeric.T(o(r,e,n))},numeric.T.prototype.setBlock=function(e,n,r){r instanceof numeric.T||(r=new numeric.T(r));var t=this.x,o=this.y,i=numeric.setBlock,a=r.x,s=r.y;if(s)return o||(this.y=numeric.rep(numeric.dim(this),0),o=this.y),i(t,e,n,a),i(o,e,n,s),this;i(t,e,n,a),o&&i(o,e,n,numeric.rep(numeric.dim(a),0))},numeric.T.rep=function(e,n){var r=numeric.T;n instanceof r||(n=new r(n));var t=n.x,o=n.y,i=numeric.rep;return o?new r(i(e,t),i(e,o)):new r(i(e,t))},numeric.T.diag=function(e){e instanceof numeric.T||(e=new numeric.T(e));var n=e.x,r=e.y,t=numeric.diag;return r?new numeric.T(t(n),t(r)):new numeric.T(t(n))},numeric.T.eig=function(){if(this.y)throw new Error("eig: not implemented for complex matrices.");return numeric.eig(this.x)},numeric.T.identity=function(e){return new numeric.T(numeric.identity(e))},numeric.T.prototype.getDiag=function(){var e=numeric,n=this.x,r=this.y;return r?new e.T(e.getDiag(n),e.getDiag(r)):new e.T(e.getDiag(n))},numeric.house=function(e){var n=numeric.clone(e),r=(e[0]>=0?1:-1)*numeric.norm2(e);n[0]+=r;var t=numeric.norm2(n);if(0===t)throw new Error("eig: internal error");return numeric.div(n,t)},numeric.toUpperHessenberg=function(e){var n=numeric.dim(e);if(2!==n.length||n[0]!==n[1])throw new Error("numeric: toUpperHessenberg() only works on square matrices");var r,t,o,i,a,s,u,c,l,f,m=n[0],h=numeric.clone(e),d=numeric.identity(m);for(t=0;t<m-2;t++){for(i=Array(m-t-1),r=t+1;r<m;r++)i[r-t-1]=h[r][t];if(numeric.norm2(i)>0){for(a=numeric.house(i),s=numeric.getBlock(h,[t+1,t],[m-1,m-1]),u=numeric.tensor(a,numeric.dot(a,s)),r=t+1;r<m;r++)for(c=h[r],l=u[r-t-1],o=t;o<m;o++)c[o]-=2*l[o-t];for(s=numeric.getBlock(h,[0,t+1],[m-1,m-1]),u=numeric.tensor(numeric.dot(s,a),a),r=0;r<m;r++)for(c=h[r],l=u[r],o=t+1;o<m;o++)c[o]-=2*l[o-t-1];for(s=Array(m-t-1),r=t+1;r<m;r++)s[r-t-1]=d[r];for(u=numeric.tensor(a,numeric.dot(a,s)),r=t+1;r<m;r++)for(f=d[r],l=u[r-t-1],o=0;o<m;o++)f[o]-=2*l[o]}}return{H:h,Q:d}},numeric.epsilon=2220446049250313e-31,numeric.QRFrancis=function(e,n){void 0===n&&(n=1e4),e=numeric.clone(e),numeric.clone(e);var r,t,o,i,a,s,u,c,l,f,m,h,d,p,y,g,x,v,_=numeric.dim(e)[0],w=numeric.identity(_);if(_<3)return{Q:w,B:[[0,_-1]]};var T=numeric.epsilon;for(v=0;v<n;v++){for(g=0;g<_-1;g++)if(Math.abs(e[g+1][g])<T*(Math.abs(e[g][g])+Math.abs(e[g+1][g+1]))){var b=numeric.QRFrancis(numeric.getBlock(e,[0,0],[g,g]),n),A=numeric.QRFrancis(numeric.getBlock(e,[g+1,g+1],[_-1,_-1]),n);for(h=Array(g+1),y=0;y<=g;y++)h[y]=w[y];for(d=numeric.dot(b.Q,h),y=0;y<=g;y++)w[y]=d[y];for(h=Array(_-g-1),y=g+1;y<_;y++)h[y-g-1]=w[y];for(d=numeric.dot(A.Q,h),y=g+1;y<_;y++)w[y]=d[y-g-1];return{Q:w,B:b.B.concat(numeric.add(A.B,g+1))}}var E,I,C;for(o=e[_-2][_-2],i=e[_-2][_-1],a=e[_-1][_-2],c=o+(s=e[_-1][_-1]),u=o*s-i*a,l=numeric.getBlock(e,[0,0],[2,2]),c*c>=4*u?(E=.5*(c+Math.sqrt(c*c-4*u)),I=.5*(c-Math.sqrt(c*c-4*u)),l=numeric.add(numeric.sub(numeric.dot(l,l),numeric.mul(l,E+I)),numeric.diag(numeric.rep([3],E*I)))):l=numeric.add(numeric.sub(numeric.dot(l,l),numeric.mul(l,c)),numeric.diag(numeric.rep([3],u))),r=[l[0][0],l[1][0],l[2][0]],t=numeric.house(r),h=[e[0],e[1],e[2]],d=numeric.tensor(t,numeric.dot(t,h)),y=0;y<3;y++)for(m=e[y],p=d[y],x=0;x<_;x++)m[x]-=2*p[x];for(h=numeric.getBlock(e,[0,0],[_-1,2]),d=numeric.tensor(numeric.dot(h,t),t),y=0;y<_;y++)for(m=e[y],p=d[y],x=0;x<3;x++)m[x]-=2*p[x];for(h=[w[0],w[1],w[2]],d=numeric.tensor(t,numeric.dot(t,h)),y=0;y<3;y++)for(f=w[y],p=d[y],x=0;x<_;x++)f[x]-=2*p[x];for(g=0;g<_-2;g++){for(x=g;x<=g+1;x++)if(Math.abs(e[x+1][x])<T*(Math.abs(e[x][x])+Math.abs(e[x+1][x+1]))){for(b=numeric.QRFrancis(numeric.getBlock(e,[0,0],[x,x]),n),A=numeric.QRFrancis(numeric.getBlock(e,[x+1,x+1],[_-1,_-1]),n),h=Array(x+1),y=0;y<=x;y++)h[y]=w[y];for(d=numeric.dot(b.Q,h),y=0;y<=x;y++)w[y]=d[y];for(h=Array(_-x-1),y=x+1;y<_;y++)h[y-x-1]=w[y];for(d=numeric.dot(A.Q,h),y=x+1;y<_;y++)w[y]=d[y-x-1];return{Q:w,B:b.B.concat(numeric.add(A.B,x+1))}}for(C=Math.min(_-1,g+3),r=Array(C-g),y=g+1;y<=C;y++)r[y-g-1]=e[y][g];for(t=numeric.house(r),h=numeric.getBlock(e,[g+1,g],[C,_-1]),d=numeric.tensor(t,numeric.dot(t,h)),y=g+1;y<=C;y++)for(m=e[y],p=d[y-g-1],x=g;x<_;x++)m[x]-=2*p[x-g];for(h=numeric.getBlock(e,[0,g+1],[_-1,C]),d=numeric.tensor(numeric.dot(h,t),t),y=0;y<_;y++)for(m=e[y],p=d[y],x=g+1;x<=C;x++)m[x]-=2*p[x-g-1];for(h=Array(C-g),y=g+1;y<=C;y++)h[y-g-1]=w[y];for(d=numeric.tensor(t,numeric.dot(t,h)),y=g+1;y<=C;y++)for(f=w[y],p=d[y-g-1],x=0;x<_;x++)f[x]-=2*p[x]}}throw new Error("numeric: eigenvalue iteration does not converge -- increase maxiter?")},numeric.eig=function(e,n){var r,t,o,i,a,s,u,c,l,f,m,h,d,p,y,g,x=numeric.toUpperHessenberg(e),v=numeric.QRFrancis(x.H,n),_=numeric.T,w=e.length,T=v.B,b=numeric.dot(v.Q,numeric.dot(x.H,numeric.transpose(v.Q))),A=new _(numeric.dot(v.Q,x.Q)),E=T.length,I=Math.sqrt;for(t=0;t<E;t++)if((r=T[t][0])!==T[t][1]){if(i=r+1,a=b[r][r],s=b[r][i],u=b[i][r],c=b[i][i],0===s&&0===u)continue;(f=(l=-a-c)*l-4*(a*c-s*u))>=0?((y=(a-(m=l<0?-.5*(l-I(f)):-.5*(l+I(f))))*(a-m)+s*s)>(g=u*u+(c-m)*(c-m))?(d=(a-m)/(y=I(y)),p=s/y):(d=u/(g=I(g)),p=(c-m)/g),o=new _([[p,-d],[d,p]]),A.setRows(r,i,o.dot(A.getRows(r,i)))):(m=-.5*l,h=.5*I(-f),(y=(a-m)*(a-m)+s*s)>(g=u*u+(c-m)*(c-m))?(d=(a-m)/(y=I(y+h*h)),p=s/y,m=0,h/=y):(d=u/(g=I(g+h*h)),p=(c-m)/g,m=h/g,h=0),o=new _([[p,-d],[d,p]],[[m,h],[h,-m]]),A.setRows(r,i,o.dot(A.getRows(r,i))))}var C=A.dot(e).dot(A.transjugate()),S=(w=e.length,numeric.T.identity(w));for(i=0;i<w;i++)if(i>0)for(t=i-1;t>=0;t--){var N=C.get([t,t]),M=C.get([i,i]);numeric.neq(N.x,M.x)||numeric.neq(N.y,M.y)?(m=C.getRow(t).getBlock([t],[i-1]),h=S.getRow(i).getBlock([t],[i-1]),S.set([i,t],C.get([t,i]).neg().sub(m.dot(h)).div(N.sub(M)))):S.setRow(i,S.getRow(t))}for(i=0;i<w;i++)m=S.getRow(i),S.setRow(i,m.div(m.norm2()));return S=S.transpose(),S=A.transjugate().dot(S),{lambda:C.getDiag(),E:S}},numeric.ccsSparse=function(e){var n,r,t,o=e.length,i=[];for(r=o-1;-1!==r;--r)for(t in n=e[r]){for(t=parseInt(t);t>=i.length;)i[i.length]=0;0!==n[t]&&i[t]++}var a=i.length,s=Array(a+1);for(s[0]=0,r=0;r<a;++r)s[r+1]=s[r]+i[r];var u=Array(s[a]),c=Array(s[a]);for(r=o-1;-1!==r;--r)for(t in n=e[r])0!==n[t]&&(i[t]--,u[s[t]+i[t]]=r,c[s[t]+i[t]]=n[t]);return[s,u,c]},numeric.ccsFull=function(e){var n,r,t,o,i=e[0],a=e[1],s=e[2],u=numeric.ccsDim(e),c=u[0],l=u[1],f=numeric.rep([c,l],0);for(n=0;n<l;n++)for(t=i[n],o=i[n+1],r=t;r<o;++r)f[a[r]][n]=s[r];return f},numeric.ccsTSolve=function(e,n,r,t,o){function i(e){var n;if(0===r[e]){for(r[e]=1,n=h[e];n<h[e+1];++n)i(d[n]);o[x]=e,++x}}var a,s,u,c,l,f,m,h=e[0],d=e[1],p=e[2],y=h.length-1,g=Math.max,x=0;for(void 0===t&&(r=numeric.rep([y],0)),void 0===t&&(t=numeric.linspace(0,r.length-1)),void 0===o&&(o=[]),a=t.length-1;-1!==a;--a)i(t[a]);for(o.length=x,a=o.length-1;-1!==a;--a)r[o[a]]=0;for(a=t.length-1;-1!==a;--a)s=t[a],r[s]=n[s];for(a=o.length-1;-1!==a;--a){for(s=o[a],u=h[s],c=g(h[s+1],u),l=u;l!==c;++l)if(d[l]===s){r[s]/=p[l];break}for(m=r[s],l=u;l!==c;++l)(f=d[l])!==s&&(r[f]-=m*p[l])}return r},numeric.ccsDFS=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS.prototype.dfs=function(e,n,r,t,o,i){var a,s,u,c=0,l=o.length,f=this.k,m=this.k1,h=this.j;if(0===t[e])for(t[e]=1,h[0]=e,f[0]=s=n[e],m[0]=u=n[e+1];;)if(s>=u){if(o[l]=h[c],0===c)return;++l,s=f[--c],u=m[c]}else 0===t[a=i[r[s]]]?(t[a]=1,f[c]=s,h[++c]=a,s=n[a],m[c]=u=n[a+1]):++s},numeric.ccsLPSolve=function(e,n,r,t,o,i,a){var s,u,c,l,f,m,h,d,p,y=e[0],g=e[1],x=e[2],v=(y.length,n[0]),_=n[1],w=n[2];for(u=v[o],c=v[o+1],t.length=0,s=u;s<c;++s)a.dfs(i[_[s]],y,g,r,t,i);for(s=t.length-1;-1!==s;--s)r[t[s]]=0;for(s=u;s!==c;++s)r[l=i[_[s]]]=w[s];for(s=t.length-1;-1!==s;--s){for(f=y[l=t[s]],m=y[l+1],h=f;h<m;++h)if(i[g[h]]===l){r[l]/=x[h];break}for(p=r[l],h=f;h<m;++h)(d=i[g[h]])!==l&&(r[d]-=p*x[h])}return r},numeric.ccsLUP1=function(e,n){var r,t,o,i,a,s,u,c=e[0].length-1,l=[numeric.rep([c+1],0),[],[]],f=[numeric.rep([c+1],0),[],[]],m=l[0],h=l[1],d=l[2],p=f[0],y=f[1],g=f[2],x=numeric.rep([c],0),v=numeric.rep([c],0),_=numeric.ccsLPSolve,w=(Math.max,Math.abs),T=numeric.linspace(0,c-1),b=numeric.linspace(0,c-1),A=new numeric.ccsDFS(c);for(void 0===n&&(n=1),r=0;r<c;++r){for(_(l,e,x,v,r,b,A),i=-1,a=-1,t=v.length-1;-1!==t;--t)(o=v[t])<=r||(s=w(x[o]))>i&&(a=o,i=s);for(w(x[r])<n*i&&(t=T[r],i=T[a],T[r]=i,b[i]=r,T[a]=t,b[t]=a,i=x[r],x[r]=x[a],x[a]=i),i=m[r],a=p[r],u=x[r],h[i]=T[r],d[i]=1,++i,t=v.length-1;-1!==t;--t)s=x[o=v[t]],v[t]=0,x[o]=0,o<=r?(y[a]=o,g[a]=s,++a):(h[i]=T[o],d[i]=s/u,++i);m[r+1]=i,p[r+1]=a}for(t=h.length-1;-1!==t;--t)h[t]=b[h[t]];return{L:l,U:f,P:T,Pinv:b}},numeric.ccsDFS0=function(e){this.k=Array(e),this.k1=Array(e),this.j=Array(e)},numeric.ccsDFS0.prototype.dfs=function(e,n,r,t,o,i,a){var s,u,c,l=0,f=o.length,m=this.k,h=this.k1,d=this.j;if(0===t[e])for(t[e]=1,d[0]=e,m[0]=u=n[i[e]],h[0]=c=n[i[e]+1];;){if(isNaN(u))throw new Error("Ow!");if(u>=c){if(o[f]=i[d[l]],0===l)return;++f,u=m[--l],c=h[l]}else 0===t[s=r[u]]?(t[s]=1,m[l]=u,d[++l]=s,u=n[s=i[s]],h[l]=c=n[s+1]):++u}},numeric.ccsLPSolve0=function(e,n,r,t,o,i,a,s){var u,c,l,f,m,h,d,p,y,g=e[0],x=e[1],v=e[2],_=(g.length,n[0]),w=n[1],T=n[2];for(c=_[o],l=_[o+1],t.length=0,u=c;u<l;++u)s.dfs(w[u],g,x,r,t,i,a);for(u=t.length-1;-1!==u;--u)r[a[f=t[u]]]=0;for(u=c;u!==l;++u)r[f=w[u]]=T[u];for(u=t.length-1;-1!==u;--u){for(p=a[f=t[u]],m=g[f],h=g[f+1],d=m;d<h;++d)if(x[d]===p){r[p]/=v[d];break}for(y=r[p],d=m;d<h;++d)r[x[d]]-=y*v[d];r[p]=y}},numeric.ccsLUP0=function(e,n){var r,t,o,i,a,s,u,c=e[0].length-1,l=[numeric.rep([c+1],0),[],[]],f=[numeric.rep([c+1],0),[],[]],m=l[0],h=l[1],d=l[2],p=f[0],y=f[1],g=f[2],x=numeric.rep([c],0),v=numeric.rep([c],0),_=numeric.ccsLPSolve0,w=(Math.max,Math.abs),T=numeric.linspace(0,c-1),b=numeric.linspace(0,c-1),A=new numeric.ccsDFS0(c);for(void 0===n&&(n=1),r=0;r<c;++r){for(_(l,e,x,v,r,b,T,A),i=-1,a=-1,t=v.length-1;-1!==t;--t)(o=v[t])<=r||(s=w(x[T[o]]))>i&&(a=o,i=s);for(w(x[T[r]])<n*i&&(t=T[r],i=T[a],T[r]=i,b[i]=r,T[a]=t,b[t]=a),i=m[r],a=p[r],u=x[T[r]],h[i]=T[r],d[i]=1,++i,t=v.length-1;-1!==t;--t)s=x[T[o=v[t]]],v[t]=0,x[T[o]]=0,o<=r?(y[a]=o,g[a]=s,++a):(h[i]=T[o],d[i]=s/u,++i);m[r+1]=i,p[r+1]=a}for(t=h.length-1;-1!==t;--t)h[t]=b[h[t]];return{L:l,U:f,P:T,Pinv:b}},numeric.ccsLUP=numeric.ccsLUP0,numeric.ccsDim=function(e){return[numeric.sup(e[1])+1,e[0].length-1]},numeric.ccsGetBlock=function(e,n,r){var t=numeric.ccsDim(e),o=t[0],i=t[1];void 0===n?n=numeric.linspace(0,o-1):"number"==typeof n&&(n=[n]),void 0===r?r=numeric.linspace(0,i-1):"number"==typeof r&&(r=[r]);var a,s,u,c,l=n.length,f=r.length,m=numeric.rep([i],0),h=[],d=[],p=[m,h,d],y=e[0],g=e[1],x=e[2],v=numeric.rep([o],0),_=0,w=numeric.rep([o],0);for(s=0;s<f;++s){var T=y[c=r[s]],b=y[c+1];for(a=T;a<b;++a)w[u=g[a]]=1,v[u]=x[a];for(a=0;a<l;++a)w[n[a]]&&(h[_]=a,d[_]=v[n[a]],++_);for(a=T;a<b;++a)w[u=g[a]]=0;m[s+1]=_}return p},numeric.ccsDot=function(e,n){var r,t,o,i,a,s,u,c,l,f,m,h=e[0],d=e[1],p=e[2],y=n[0],g=n[1],x=n[2],v=numeric.ccsDim(e),_=numeric.ccsDim(n),w=v[0],T=(v[1],_[1]),b=numeric.rep([w],0),A=numeric.rep([w],0),E=Array(w),I=numeric.rep([T],0),C=[],S=[],N=[I,C,S];for(o=0;o!==T;++o){for(i=y[o],a=y[o+1],l=0,t=i;t<a;++t)for(f=g[t],m=x[t],s=h[f],u=h[f+1],r=s;r<u;++r)0===A[c=d[r]]&&(E[l]=c,A[c]=1,l+=1),b[c]=b[c]+p[r]*m;for(a=(i=I[o])+l,I[o+1]=a,t=l-1;-1!==t;--t)m=i+t,r=E[t],C[m]=r,S[m]=b[r],A[r]=0,b[r]=0;I[o+1]=I[o]+l}return N},numeric.ccsLUPSolve=function(e,n){var r=e.L,t=e.U,o=(e.P,n[0]),i=!1;"object"!=typeof o&&(o=(n=[[0,n.length],numeric.linspace(0,n.length-1),n])[0],i=!0);var a,s,u,c,l,f,m=n[1],h=n[2],d=r[0].length-1,p=o.length-1,y=numeric.rep([d],0),g=Array(d),x=numeric.rep([d],0),v=Array(d),_=numeric.rep([p+1],0),w=[],T=[],b=numeric.ccsTSolve,A=0;for(a=0;a<p;++a){for(l=0,u=o[a],c=o[a+1],s=u;s<c;++s)f=e.Pinv[m[s]],v[l]=f,x[f]=h[s],++l;for(v.length=l,b(r,x,y,v,g),s=v.length-1;-1!==s;--s)x[v[s]]=0;if(b(t,y,x,g,v),i)return x;for(s=g.length-1;-1!==s;--s)y[g[s]]=0;for(s=v.length-1;-1!==s;--s)f=v[s],w[A]=f,T[A]=x[f],x[f]=0,++A;_[a+1]=A}return[_,w,T]},numeric.ccsbinop=function(e,n){return void 0===n&&(n=""),Function("X","Y","var Xi = X[0], Xj = X[1], Xv = X[2];\nvar Yi = Y[0], Yj = Y[1], Yv = Y[2];\nvar n = Xi.length-1,m = Math.max(numeric.sup(Xj),numeric.sup(Yj))+1;\nvar Zi = numeric.rep([n+1],0), Zj = [], Zv = [];\nvar x = numeric.rep([m],0),y = numeric.rep([m],0);\nvar xk,yk,zk;\nvar i,j,j0,j1,k,p=0;\n"+n+"for(i=0;i<n;++i) {\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Xj[j];\n x[k] = 1;\n Zj[p] = k;\n ++p;\n }\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Yj[j];\n y[k] = Yv[j];\n if(x[k] === 0) {\n Zj[p] = k;\n ++p;\n }\n }\n Zi[i+1] = p;\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = Xv[j];\n j0 = Zi[i]; j1 = Zi[i+1];\n for(j=j0;j!==j1;++j) {\n k = Zj[j];\n xk = x[k];\n yk = y[k];\n"+e+"\n Zv[j] = zk;\n }\n j0 = Xi[i]; j1 = Xi[i+1];\n for(j=j0;j!==j1;++j) x[Xj[j]] = 0;\n j0 = Yi[i]; j1 = Yi[i+1];\n for(j=j0;j!==j1;++j) y[Yj[j]] = 0;\n}\nreturn [Zi,Zj,Zv];")},function(){var k,A,B,C;for(k in numeric.ops2)A=isFinite(eval("1"+numeric.ops2[k]+"0"))?"[Y[0],Y[1],numeric."+k+"(X,Y[2])]":"NaN",B=isFinite(eval("0"+numeric.ops2[k]+"1"))?"[X[0],X[1],numeric."+k+"(X[2],Y)]":"NaN",C=isFinite(eval("1"+numeric.ops2[k]+"0"))&&isFinite(eval("0"+numeric.ops2[k]+"1"))?"numeric.ccs"+k+"MM(X,Y)":"NaN",numeric["ccs"+k+"MM"]=numeric.ccsbinop("zk = xk "+numeric.ops2[k]+"yk;"),numeric["ccs"+k]=Function("X","Y",'if(typeof X === "number") return '+A+';\nif(typeof Y === "number") return '+B+";\nreturn "+C+";\n")}(),numeric.ccsScatter=function(e){var n,r=e[0],t=e[1],o=e[2],i=numeric.sup(t)+1,a=r.length,s=numeric.rep([i],0),u=Array(a),c=Array(a),l=numeric.rep([i],0);for(n=0;n<a;++n)l[t[n]]++;for(n=0;n<i;++n)s[n+1]=s[n]+l[n];var f,m,h=s.slice(0);for(n=0;n<a;++n)u[f=h[m=t[n]]]=r[n],c[f]=o[n],h[m]=h[m]+1;return[s,u,c]},numeric.ccsGather=function(e){var n,r,t,o,i,a=e[0],s=e[1],u=e[2],c=a.length-1,l=s.length,f=Array(l),m=Array(l),h=Array(l);for(i=0,n=0;n<c;++n)for(t=a[n],o=a[n+1],r=t;r!==o;++r)m[i]=n,f[i]=s[r],h[i]=u[r],++i;return[f,m,h]},numeric.sdim=function e(n,r,t){if(void 0===r&&(r=[]),"object"!=typeof n)return r;var o;for(o in void 0===t&&(t=0),t in r||(r[t]=0),n.length>r[t]&&(r[t]=n.length),n)n.hasOwnProperty(o)&&e(n[o],r,t+1);return r},numeric.sclone=function e(n,r,t){void 0===r&&(r=0),void 0===t&&(t=numeric.sdim(n).length);var o,i=Array(n.length);if(r===t-1){for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i}for(o in n)n.hasOwnProperty(o)&&(i[o]=e(n[o],r+1,t));return i},numeric.sdiag=function(e){var n,r,t=e.length,o=Array(t);for(n=t-1;n>=1;n-=2)r=n-1,o[n]=[],o[n][n]=e[n],o[r]=[],o[r][r]=e[r];return 0===n&&(o[0]=[],o[0][0]=e[n]),o},numeric.sidentity=function(e){return numeric.sdiag(numeric.rep([e],1))},numeric.stranspose=function(e){var n,r,t,o=[];for(n in e.length,e)if(e.hasOwnProperty(n))for(r in t=e[n])t.hasOwnProperty(r)&&("object"!=typeof o[r]&&(o[r]=[]),o[r][n]=t[r]);return o},numeric.sLUP=function(e,n){throw new Error("The function numeric.sLUP had a bug in it and has been removed. Please use the new numeric.ccsLUP function instead.")},numeric.sdotMM=function(e,n){var r,t,o,i,a,s,u,c=e.length,l=(n.length,numeric.stranspose(n)),f=l.length,m=Array(c);for(o=c-1;o>=0;o--){for(u=[],r=e[o],a=f-1;a>=0;a--){for(i in s=0,t=l[a],r)r.hasOwnProperty(i)&&i in t&&(s+=r[i]*t[i]);s&&(u[a]=s)}m[o]=u}return m},numeric.sdotMV=function(e,n){var r,t,o,i,a=e.length,s=Array(a);for(t=a-1;t>=0;t--){for(o in i=0,r=e[t])r.hasOwnProperty(o)&&n[o]&&(i+=r[o]*n[o]);i&&(s[t]=i)}return s},numeric.sdotVM=function(e,n){var r,t,o,i,a=[];for(r in e)if(e.hasOwnProperty(r))for(t in o=n[r],i=e[r],o)o.hasOwnProperty(t)&&(a[t]||(a[t]=0),a[t]+=i*o[t]);return a},numeric.sdotVV=function(e,n){var r,t=0;for(r in e)e[r]&&n[r]&&(t+=e[r]*n[r]);return t},numeric.sdot=function(e,n){var r=numeric.sdim(e).length,t=numeric.sdim(n).length;switch(1e3*r+t){case 0:return e*n;case 1001:return numeric.sdotVV(e,n);case 2001:return numeric.sdotMV(e,n);case 1002:return numeric.sdotVM(e,n);case 2002:return numeric.sdotMM(e,n);default:throw new Error("numeric.sdot not implemented for tensors of order "+r+" and "+t)}},numeric.sscatter=function(e){var n,r,t,o,i=e[0].length,a=e.length,s=[];for(r=i-1;r>=0;--r)if(e[a-1][r]){for(o=s,t=0;t<a-2;t++)o[n=e[t][r]]||(o[n]=[]),o=o[n];o[e[t][r]]=e[t+1][r]}return s},numeric.sgather=function e(n,r,t){var o,i,a;for(i in void 0===r&&(r=[]),void 0===t&&(t=[]),o=t.length,n)if(n.hasOwnProperty(i))if(t[o]=parseInt(i),"number"==typeof(a=n[i])){if(a){if(0===r.length)for(i=o+1;i>=0;--i)r[i]=[];for(i=o;i>=0;--i)r[i].push(t[i]);r[o+1].push(a)}}else e(a,r,t);return t.length>o&&t.pop(),r},numeric.cLU=function(e){var n,r,t,o,i,a,s=e[0],u=e[1],c=e[2],l=s.length,f=0;for(n=0;n<l;n++)s[n]>f&&(f=s[n]);f++;var m,h=Array(f),d=Array(f),p=numeric.rep([f],1/0),y=numeric.rep([f],-1/0);for(t=0;t<l;t++)n=s[t],(r=u[t])<p[n]&&(p[n]=r),r>y[n]&&(y[n]=r);for(n=0;n<f-1;n++)y[n]>y[n+1]&&(y[n+1]=y[n]);for(n=f-1;n>=1;n--)p[n]<p[n-1]&&(p[n-1]=p[n]);for(n=0;n<f;n++)d[n]=numeric.rep([y[n]-p[n]+1],0),h[n]=numeric.rep([n-p[n]],0),p[n],y[n];for(t=0;t<l;t++)d[n=s[t]][u[t]-p[n]]=c[t];for(n=0;n<f-1;n++)for(o=n-p[n],v=d[n],r=n+1;p[r]<=n&&r<f;r++)if(i=n-p[r],a=y[n]-n,m=(_=d[r])[i]/v[o]){for(t=1;t<=a;t++)_[t+i]-=m*v[t+o];h[r][n-p[r]]=m}var g,x,v=[],_=[],w=[],T=[],b=[],A=[];for(l=0,g=0,n=0;n<f;n++){for(o=p[n],i=y[n],x=d[n],r=n;r<=i;r++)x[r-o]&&(v[l]=n,_[l]=r,w[l]=x[r-o],l++);for(x=h[n],r=o;r<n;r++)x[r-o]&&(T[g]=n,b[g]=r,A[g]=x[r-o],g++);T[g]=n,b[g]=n,A[g]=1,g++}return{U:[v,_,w],L:[T,b,A]}},numeric.cLUsolve=function(e,n){var r,t,o=e.L,i=e.U,a=numeric.clone(n),s=o[0],u=o[1],c=o[2],l=i[0],f=i[1],m=i[2],h=l.length,d=(s.length,a.length);for(t=0,r=0;r<d;r++){for(;u[t]<r;)a[r]-=c[t]*a[u[t]],t++;t++}for(t=h-1,r=d-1;r>=0;r--){for(;f[t]>r;)a[r]-=m[t]*a[f[t]],t--;a[r]/=m[t],t--}return a},numeric.cgrid=function(e,n){"number"==typeof e&&(e=[e,e]);var r,t,o,i=numeric.rep(e,-1);for("function"!=typeof n&&(n="L"===n?function(n,r){return n>=e[0]/2||r<e[1]/2}:function(e,n){return!0}),o=0,r=1;r<e[0]-1;r++)for(t=1;t<e[1]-1;t++)n(r,t)&&(i[r][t]=o,o++);return i},numeric.cdelsq=function(e){var n,r,t,o,i,a=[[-1,0],[0,-1],[0,1],[1,0]],s=numeric.dim(e),u=s[0],c=s[1],l=[],f=[],m=[];for(n=1;n<u-1;n++)for(r=1;r<c-1;r++)if(!(e[n][r]<0)){for(t=0;t<4;t++)o=n+a[t][0],i=r+a[t][1],e[o][i]<0||(l.push(e[n][r]),f.push(e[o][i]),m.push(-1));l.push(e[n][r]),f.push(e[n][r]),m.push(4)}return[l,f,m]},numeric.cdotMV=function(e,n){var r,t,o,i=e[0],a=e[1],s=e[2],u=i.length;for(o=0,t=0;t<u;t++)i[t]>o&&(o=i[t]);for(o++,r=numeric.rep([o],0),t=0;t<u;t++)r[i[t]]+=s[t]*n[a[t]];return r},numeric.Spline=function(e,n,r,t,o){this.x=e,this.yl=n,this.yr=r,this.kl=t,this.kr=o},numeric.Spline.prototype._at=function(e,n){var r,t,o,i=this.x,a=this.yl,s=this.yr,u=this.kl,c=this.kr,l=numeric.add,f=numeric.sub,m=numeric.mul;r=f(m(u[n],i[n+1]-i[n]),f(s[n+1],a[n])),t=l(m(c[n+1],i[n]-i[n+1]),f(s[n+1],a[n]));var h=(o=(e-i[n])/(i[n+1]-i[n]))*(1-o);return l(l(l(m(1-o,a[n]),m(o,s[n+1])),m(r,h*(1-o))),m(t,h*o))},numeric.Spline.prototype.at=function(e){if("number"==typeof e){var n,r,t,o=this.x,i=o.length,a=Math.floor;for(n=0,r=i-1;r-n>1;)o[t=a((n+r)/2)]<=e?n=t:r=t;return this._at(e,n)}i=e.length;var s,u=Array(i);for(s=i-1;-1!==s;--s)u[s]=this.at(e[s]);return u},numeric.Spline.prototype.diff=function(){var e,n,r,t=this.x,o=this.yl,i=this.yr,a=this.kl,s=this.kr,u=o.length,c=a,l=s,f=Array(u),m=Array(u),h=numeric.add,d=numeric.mul,p=numeric.div,y=numeric.sub;for(e=u-1;-1!==e;--e)n=t[e+1]-t[e],r=y(i[e+1],o[e]),f[e]=p(h(d(r,6),d(a[e],-4*n),d(s[e+1],-2*n)),n*n),m[e+1]=p(h(d(r,-6),d(a[e],2*n),d(s[e+1],4*n)),n*n);return new numeric.Spline(t,c,l,f,m)},numeric.Spline.prototype.roots=function(){var e=[],n=this.x,r=this.yl,t=this.yr,o=this.kl,i=this.kr;"number"==typeof r[0]&&(r=[r],t=[t],o=[o],i=[i]);var a,s,u,c,l,f,m,h,d,p,y,g,x,v,_,w,T,b,A,E,I,C,S,N,M=r.length,P=n.length-1,L=(e=Array(M),Math.sqrt);for(a=0;a!==M;++a){for(c=r[a],l=t[a],f=o[a],m=i[a],h=[],s=0;s!==P;s++){for(s>0&&l[s]*c[s]<0&&h.push(n[s]),w=n[s+1]-n[s],n[s],y=c[s],g=l[s+1],d=f[s]/w,x=(p=m[s+1]/w)+3*y+2*d-3*g,v=3*(p+d+2*(y-g)),(_=(N=d-p+3*(y-g))*N+12*p*y)<=0?T=(b=x/v)>n[s]&&b<n[s+1]?[n[s],b,n[s+1]]:[n[s],n[s+1]]:(b=(x-L(_))/v,A=(x+L(_))/v,T=[n[s]],b>n[s]&&b<n[s+1]&&T.push(b),A>n[s]&&A<n[s+1]&&T.push(A),T.push(n[s+1])),I=T[0],b=this._at(I,s),u=0;u<T.length-1;u++)if(C=T[u+1],A=this._at(C,s),0!==b)if(0===A||b*A>0)I=C,b=A;else{for(var O=0;!((S=(b*C-A*I)/(b-A))<=I||S>=C);)if((E=this._at(S,s))*A>0)C=S,A=E,-1===O&&(b*=.5),O=-1;else{if(!(E*b>0))break;I=S,b=E,1===O&&(A*=.5),O=1}h.push(S),I=T[u+1],b=this._at(I,s)}else h.push(I),I=C,b=A;0===A&&h.push(C)}e[a]=h}return"number"==typeof this.yl[0]?e[0]:e},numeric.spline=function(e,n,r,t){var o,i=e.length,a=[],s=[],u=[],c=numeric.sub,l=numeric.mul,f=numeric.add;for(o=i-2;o>=0;o--)s[o]=e[o+1]-e[o],u[o]=c(n[o+1],n[o]);"string"!=typeof r&&"string"!=typeof t||(r=t="periodic");var m=[[],[],[]];switch(typeof r){case"undefined":a[0]=l(3/(s[0]*s[0]),u[0]),m[0].push(0,0),m[1].push(0,1),m[2].push(2/s[0],1/s[0]);break;case"string":a[0]=f(l(3/(s[i-2]*s[i-2]),u[i-2]),l(3/(s[0]*s[0]),u[0])),m[0].push(0,0,0),m[1].push(i-2,0,1),m[2].push(1/s[i-2],2/s[i-2]+2/s[0],1/s[0]);break;default:a[0]=r,m[0].push(0),m[1].push(0),m[2].push(1)}for(o=1;o<i-1;o++)a[o]=f(l(3/(s[o-1]*s[o-1]),u[o-1]),l(3/(s[o]*s[o]),u[o])),m[0].push(o,o,o),m[1].push(o-1,o,o+1),m[2].push(1/s[o-1],2/s[o-1]+2/s[o],1/s[o]);switch(typeof t){case"undefined":a[i-1]=l(3/(s[i-2]*s[i-2]),u[i-2]),m[0].push(i-1,i-1),m[1].push(i-2,i-1),m[2].push(1/s[i-2],2/s[i-2]);break;case"string":m[1][m[1].length-1]=0;break;default:a[i-1]=t,m[0].push(i-1),m[1].push(i-1),m[2].push(1)}a="number"!=typeof a[0]?numeric.transpose(a):[a];var h=Array(a.length);if("string"==typeof r)for(o=h.length-1;-1!==o;--o)h[o]=numeric.ccsLUPSolve(numeric.ccsLUP(numeric.ccsScatter(m)),a[o]),h[o][i-1]=h[o][0];else for(o=h.length-1;-1!==o;--o)h[o]=numeric.cLUsolve(numeric.cLU(m),a[o]);return h="number"==typeof n[0]?h[0]:numeric.transpose(h),new numeric.Spline(e,n,n,h,h)},numeric.fftpow2=function e(n,r){var t=n.length;if(1!==t){var o,i,a=Math.cos,s=Math.sin,u=Array(t/2),c=Array(t/2),l=Array(t/2),f=Array(t/2);for(i=t/2,o=t-1;-1!==o;--o)l[--i]=n[o],f[i]=r[o],--o,u[i]=n[o],c[i]=r[o];e(u,c),e(l,f),i=t/2;var m,h,d,p=-6.283185307179586/t;for(o=t-1;-1!==o;--o)-1==--i&&(i=t/2-1),h=a(m=p*o),d=s(m),n[o]=u[i]+h*l[i]-d*f[i],r[o]=c[i]+h*f[i]+d*l[i]}},numeric._ifftpow2=function e(n,r){var t=n.length;if(1!==t){var o,i,a=Math.cos,s=Math.sin,u=Array(t/2),c=Array(t/2),l=Array(t/2),f=Array(t/2);for(i=t/2,o=t-1;-1!==o;--o)l[--i]=n[o],f[i]=r[o],--o,u[i]=n[o],c[i]=r[o];e(u,c),e(l,f),i=t/2;var m,h,d,p=6.283185307179586/t;for(o=t-1;-1!==o;--o)-1==--i&&(i=t/2-1),h=a(m=p*o),d=s(m),n[o]=u[i]+h*l[i]-d*f[i],r[o]=c[i]+h*f[i]+d*l[i]}},numeric.ifftpow2=function(e,n){numeric._ifftpow2(e,n),numeric.diveq(e,e.length),numeric.diveq(n,n.length)},numeric.convpow2=function(e,n,r,t){var o,i,a,s,u;for(numeric.fftpow2(e,n),numeric.fftpow2(r,t),o=e.length-1;-1!==o;--o)i=e[o],s=n[o],a=r[o],u=t[o],e[o]=i*a-s*u,n[o]=i*u+s*a;numeric.ifftpow2(e,n)},numeric.T.prototype.fft=function(){var e,n,r=this.x,t=this.y,o=r.length,i=Math.log,a=i(2),s=Math.ceil(i(2*o-1)/a),u=Math.pow(2,s),c=numeric.rep([u],0),l=numeric.rep([u],0),f=Math.cos,m=Math.sin,h=-3.141592653589793/o,d=numeric.rep([u],0),p=numeric.rep([u],0);for(Math.floor(o/2),e=0;e<o;e++)d[e]=r[e];if(void 0!==t)for(e=0;e<o;e++)p[e]=t[e];for(c[0]=1,e=1;e<=u/2;e++)n=h*e*e,c[e]=f(n),l[e]=m(n),c[u-e]=f(n),l[u-e]=m(n);var y=new numeric.T(d,p),g=new numeric.T(c,l);return y=y.mul(g),numeric.convpow2(y.x,y.y,numeric.clone(g.x),numeric.neg(g.y)),(y=y.mul(g)).x.length=o,y.y.length=o,y},numeric.T.prototype.ifft=function(){var e,n,r=this.x,t=this.y,o=r.length,i=Math.log,a=i(2),s=Math.ceil(i(2*o-1)/a),u=Math.pow(2,s),c=numeric.rep([u],0),l=numeric.rep([u],0),f=Math.cos,m=Math.sin,h=3.141592653589793/o,d=numeric.rep([u],0),p=numeric.rep([u],0);for(Math.floor(o/2),e=0;e<o;e++)d[e]=r[e];if(void 0!==t)for(e=0;e<o;e++)p[e]=t[e];for(c[0]=1,e=1;e<=u/2;e++)n=h*e*e,c[e]=f(n),l[e]=m(n),c[u-e]=f(n),l[u-e]=m(n);var y=new numeric.T(d,p),g=new numeric.T(c,l);return y=y.mul(g),numeric.convpow2(y.x,y.y,numeric.clone(g.x),numeric.neg(g.y)),(y=y.mul(g)).x.length=o,y.y.length=o,y.div(o)},numeric.gradient=function(e,n){var r=n.length,t=e(n);if(isNaN(t))throw new Error("gradient: f(x) is a NaN!");var o,i,a,s,u,c,l,f,m,h=Math.max,d=numeric.clone(n),p=Array(r),y=(numeric.div,numeric.sub,h=Math.max,Math.abs),g=Math.min,x=0;for(o=0;o<r;o++)for(var v=h(1e-6*t,1e-8);;){if(++x>20)throw new Error("Numerical gradient fails");if(d[o]=n[o]+v,i=e(d),d[o]=n[o]-v,a=e(d),d[o]=n[o],isNaN(i)||isNaN(a))v/=16;else{if(p[o]=(i-a)/(2*v),s=n[o]-v,u=n[o],c=n[o]+v,l=(i-t)/v,f=(t-a)/v,m=h(y(p[o]),y(t),y(i),y(a),y(s),y(u),y(c),1e-8),!(g(h(y(l-p[o]),y(f-p[o]),y(l-f))/m,v/m)>.001))break;v/=16}}return p},numeric.uncmin=function(e,n,r,t,o,i,a){var s=numeric.gradient;void 0===a&&(a={}),void 0===r&&(r=1e-8),void 0===t&&(t=function(n){return s(e,n)}),void 0===o&&(o=1e3);var u,c,l=(n=numeric.clone(n)).length,f=e(n);if(isNaN(f))throw new Error("uncmin: f(x0) is a NaN!");var m=Math.max,h=numeric.norm2;r=m(r,numeric.epsilon);var d,p,y,g,x,v,_,w,T,b,A=a.Hinv||numeric.identity(l),E=numeric.dot,I=(numeric.inv,numeric.sub),C=numeric.add,S=numeric.tensor,N=numeric.div,M=numeric.mul,P=numeric.all,L=numeric.isFinite,O=numeric.neg,k=0,R="";for(p=t(n);k<o;){if("function"==typeof i&&i(k,n,f,p,A)){R="Callback returned true";break}if(!P(L(p))){R="Gradient has Infinity or NaN";break}if(!P(L(d=O(E(A,p))))){R="Search direction has Infinity or NaN";break}if((b=h(d))<r){R="Newton step smaller than tol";break}for(T=1,c=E(p,d),x=n;k<o&&!(T*b<r)&&(x=C(n,g=M(d,T)),(u=e(x))-f>=.1*T*c||isNaN(u));)T*=.5,++k;if(T*b<r){R="Line search step size smaller than tol";break}if(k===o){R="maxit reached during line search";break}w=E(v=I(y=t(x),p),g),_=E(A,v),A=I(C(A,M((w+E(v,_))/(w*w),S(g,g))),N(C(S(_,g),S(g,_)),w)),n=x,f=u,p=y,++k}return{solution:n,f,gradient:p,invHessian:A,iterations:k,message:R}},numeric.Dopri=function(e,n,r,t,o,i,a){this.x=e,this.y=n,this.f=r,this.ymid=t,this.iterations=o,this.events=a,this.message=i},numeric.Dopri.prototype._at=function(e,n){function r(e){return e*e}var t,o,i,a,s,u,c,l,f,m=this,h=m.x,d=m.y,p=m.f,y=m.ymid,g=(h.length,Math.floor,numeric.add),x=numeric.mul,v=numeric.sub;return t=h[n],o=h[n+1],a=d[n],s=d[n+1],i=t+.5*(o-t),u=y[n],c=v(p[n],x(a,1/(t-i)+2/(t-o))),l=v(p[n+1],x(s,1/(o-i)+2/(o-t))),g(g(g(g(x(a,(f=[r(e-o)*(e-i)/r(t-o)/(t-i),r(e-t)*r(e-o)/r(t-i)/r(o-i),r(e-t)*(e-i)/r(o-t)/(o-i),(e-t)*r(e-o)*(e-i)/r(t-o)/(t-i),(e-o)*r(e-t)*(e-i)/r(t-o)/(o-i)])[0]),x(u,f[1])),x(s,f[2])),x(c,f[3])),x(l,f[4]))},numeric.Dopri.prototype.at=function(e){var n,r,t,o=Math.floor;if("number"!=typeof e){var i=e.length,a=Array(i);for(n=i-1;-1!==n;--n)a[n]=this.at(e[n]);return a}var s=this.x;for(n=0,r=s.length-1;r-n>1;)s[t=o(.5*(n+r))]<=e?n=t:r=t;return this._at(e,n)},numeric.dopri=function(e,n,r,t,o,i,a){void 0===o&&(o=1e-6),void 0===i&&(i=1e3);var s,u,c,l,f,m,h,d,p,y,g,x,v,_=[e],w=[r],T=[t(e,r)],b=[],A=[.075,.225],E=[44/45,-56/15,32/9],I=[19372/6561,-25360/2187,64448/6561,-212/729],C=[9017/3168,-355/33,46732/5247,49/176,-5103/18656],S=[35/384,0,500/1113,125/192,-2187/6784,11/84],N=[.10013431883002395,0,.3918321794184259,-.02982460176594817,.05893268337240795,-.04497888809104361,.023904308236133973],M=[.2,.3,.8,8/9,1,1],P=[-71/57600,0,71/16695,-71/1920,17253/339200,-22/525,.025],L=0,O=(n-e)/10,k=0,R=numeric.add,X=numeric.mul,D=(Math.max,Math.min),F=Math.abs,j=numeric.norminf,q=Math.pow,G=numeric.any,B=numeric.lt,Y=numeric.and,H=(numeric.sub,new numeric.Dopri(_,w,T,b,-1,""));for("function"==typeof a&&(g=a(e,r));e<n&&k<i;)if(++k,e+O>n&&(O=n-e),s=t(e+M[0]*O,R(r,X(.2*O,T[L]))),u=t(e+M[1]*O,R(R(r,X(A[0]*O,T[L])),X(A[1]*O,s))),c=t(e+M[2]*O,R(R(R(r,X(E[0]*O,T[L])),X(E[1]*O,s)),X(E[2]*O,u))),l=t(e+M[3]*O,R(R(R(R(r,X(I[0]*O,T[L])),X(I[1]*O,s)),X(I[2]*O,u)),X(I[3]*O,c))),f=t(e+M[4]*O,R(R(R(R(R(r,X(C[0]*O,T[L])),X(C[1]*O,s)),X(C[2]*O,u)),X(C[3]*O,c)),X(C[4]*O,l))),m=t(e+O,p=R(R(R(R(R(r,X(T[L],O*S[0])),X(u,O*S[2])),X(c,O*S[3])),X(l,O*S[4])),X(f,O*S[5]))),(y="number"==typeof(h=R(R(R(R(R(X(T[L],O*P[0]),X(u,O*P[2])),X(c,O*P[3])),X(l,O*P[4])),X(f,O*P[5])),X(m,O*P[6])))?F(h):j(h))>o){if(e+(O=.2*O*q(o/y,.25))===e){H.msg="Step size became too small";break}}else{if(b[L]=R(R(R(R(R(R(r,X(T[L],O*N[0])),X(u,O*N[2])),X(c,O*N[3])),X(l,O*N[4])),X(f,O*N[5])),X(m,O*N[6])),_[++L]=e+O,w[L]=p,T[L]=m,"function"==typeof a){var V,W,U=e,$=e+.5*O;if(x=a($,b[L-1]),G(v=Y(B(g,0),B(0,x)))||(U=$,g=x,x=a($=e+O,p),v=Y(B(g,0),B(0,x))),G(v)){for(var K,Z,z=0,Q=1,J=1;;){if("number"==typeof g)W=(J*x*U-Q*g*$)/(J*x-Q*g);else for(W=$,d=g.length-1;-1!==d;--d)g[d]<0&&x[d]>0&&(W=D(W,(J*x[d]*U-Q*g[d]*$)/(J*x[d]-Q*g[d])));if(W<=U||W>=$)break;Z=a(W,V=H._at(W,L-1)),G(K=Y(B(g,0),B(0,Z)))?($=W,x=Z,v=K,J=1,-1===z?Q*=.5:Q=1,z=-1):(U=W,g=Z,Q=1,1===z?J*=.5:J=1,z=1)}return p=H._at(.5*(e+W),L-1),H.f[L]=t(W,V),H.x[L]=W,H.y[L]=V,H.ymid[L-1]=p,H.events=v,H.iterations=k,H}}e+=O,r=p,g=x,O=D(.8*O*q(o/y,.25),4*O)}return H.iterations=k,H},numeric.LU=function(e,n){n=n||!1;var r,t,o,i,a,s,u,c,l,f=Math.abs,m=e.length,h=m-1,d=new Array(m);for(n||(e=numeric.clone(e)),o=0;o<m;++o){for(u=o,l=f((s=e[o])[o]),t=o+1;t<m;++t)l<(i=f(e[t][o]))&&(l=i,u=t);for(d[o]=u,u!=o&&(e[o]=e[u],e[u]=s,s=e[o]),a=s[o],r=o+1;r<m;++r)e[r][o]/=a;for(r=o+1;r<m;++r){for(c=e[r],t=o+1;t<h;++t)c[t]-=c[o]*s[t],c[++t]-=c[o]*s[t];t===h&&(c[t]-=c[o]*s[t])}}return{LU:e,P:d}},numeric.LUsolve=function(e,n){var r,t,o,i,a,s=e.LU,u=s.length,c=numeric.clone(n),l=e.P;for(r=u-1;-1!==r;--r)c[r]=n[r];for(r=0;r<u;++r)for(o=l[r],l[r]!==r&&(a=c[r],c[r]=c[o],c[o]=a),i=s[r],t=0;t<r;++t)c[r]-=c[t]*i[t];for(r=u-1;r>=0;--r){for(i=s[r],t=r+1;t<u;++t)c[r]-=c[t]*i[t];c[r]/=i[r]}return c},numeric.solve=function(e,n,r){return numeric.LUsolve(numeric.LU(e,r),n)},numeric.echelonize=function(e){var n,r,t,o,i,a,s,u,c=numeric.dim(e),l=c[0],f=c[1],m=numeric.identity(l),h=Array(l),d=Math.abs,p=numeric.diveq;for(e=numeric.clone(e),n=0;n<l;++n){for(t=0,i=e[n],a=m[n],r=1;r<f;++r)d(i[t])<d(i[r])&&(t=r);for(h[n]=t,p(a,i[t]),p(i,i[t]),r=0;r<l;++r)if(r!==n){for(u=(s=e[r])[t],o=f-1;-1!==o;--o)s[o]-=i[o]*u;for(s=m[r],o=l-1;-1!==o;--o)s[o]-=a[o]*u}}return{I:m,A:e,P:h}},numeric.__solveLP=function(e,n,r,t,o,i,a){var s,u,c,l,f=numeric.sum,m=(numeric.log,numeric.mul),h=numeric.sub,d=numeric.dot,p=numeric.div,y=numeric.add,g=e.length,x=r.length,v=!1,_=1,w=(numeric.transpose(n),numeric.svd,numeric.transpose),T=(numeric.leq,Math.sqrt),b=Math.abs,A=(numeric.muleq,numeric.norminf,numeric.any,Math.min),E=numeric.all,I=numeric.gt,C=Array(g),S=Array(x),N=(numeric.rep([x],1),numeric.solve),M=h(r,d(n,i)),P=d(e,e);for(c=0;c<o;++c){var L,O;for(L=x-1;-1!==L;--L)S[L]=p(n[L],M[L]);var k=w(S);for(L=g-1;-1!==L;--L)C[L]=f(k[L]);_=.25*b(P/d(e,C));var R=100*T(P/d(C,C));for((!isFinite(_)||_>R)&&(_=R),l=y(e,m(_,C)),u=d(k,S),L=g-1;-1!==L;--L)u[L][L]+=1;O=N(u,p(l,_),!0);var X=p(M,d(n,O)),D=1;for(L=x-1;-1!==L;--L)X[L]<0&&(D=A(D,-.999*X[L]));if(s=h(i,m(O,D)),!E(I(M=h(r,d(n,s)),0)))return{solution:i,message:"",iterations:c};if(i=s,_<t)return{solution:s,message:"",iterations:c};if(a){var F=d(e,l),j=d(n,l);for(v=!0,L=x-1;-1!==L;--L)if(F*j[L]<0){v=!1;break}}else v=!(i[g-1]>=0);if(v)return{solution:s,message:"Unbounded",iterations:c}}return{solution:i,message:"maximum iteration count exceeded",iterations:c}},numeric._solveLP=function(e,n,r,t,o){var i=e.length,a=r.length,s=(numeric.sum,numeric.log,numeric.mul,numeric.sub),u=numeric.dot,c=(numeric.div,numeric.add,numeric.rep([i],0).concat([1])),l=numeric.rep([a,1],-1),f=numeric.blockMatrix([[n,l]]),m=r,h=numeric.rep([i],0).concat(Math.max(0,numeric.sup(numeric.neg(r)))+1),d=numeric.__solveLP(c,f,m,t,o,h,!1),p=numeric.clone(d.solution);if(p.length=i,numeric.inf(s(r,u(n,p)))<0)return{solution:NaN,message:"Infeasible",iterations:d.iterations};var y=numeric.__solveLP(e,n,r,t,o-d.iterations,p,!0);return y.iterations+=d.iterations,y},numeric.solveLP=function(e,n,r,t,o,i,a){if(void 0===a&&(a=1e3),void 0===i&&(i=numeric.epsilon),void 0===t)return numeric._solveLP(e,n,r,i,a);var s,u=t.length,c=t[0].length,l=n.length,f=numeric.echelonize(t),m=numeric.rep([c],0),h=f.P,d=[];for(s=h.length-1;-1!==s;--s)m[h[s]]=1;for(s=c-1;-1!==s;--s)0===m[s]&&d.push(s);var p=numeric.getRange,y=numeric.linspace(0,u-1),g=numeric.linspace(0,l-1),x=p(t,y,d),v=p(n,g,h),_=p(n,g,d),w=numeric.dot,T=numeric.sub,b=w(v,f.I),A=T(_,w(b,x)),E=T(r,w(b,o)),I=Array(h.length),C=Array(d.length);for(s=h.length-1;-1!==s;--s)I[s]=e[h[s]];for(s=d.length-1;-1!==s;--s)C[s]=e[d[s]];var S=T(C,w(I,w(f.I,x))),N=numeric._solveLP(S,A,E,i,a),M=N.solution;if(M!=M)return N;var P=w(f.I,T(o,w(x,M))),L=Array(e.length);for(s=h.length-1;-1!==s;--s)L[h[s]]=P[s];for(s=d.length-1;-1!==s;--s)L[d[s]]=M[s];return{solution:L,message:N.message,iterations:N.iterations}},numeric.MPStoLP=function(e){function n(n){throw new Error("MPStoLP: "+n+"\nLine "+r+": "+e[r]+"\nCurrent state: "+s[a]+"\n")}e instanceof String&&e.split("\n");var r,t,o,i,a=0,s=["Initial state","NAME","ROWS","COLUMNS","RHS","BOUNDS","ENDATA"],u=e.length,c=0,l={},f=[],m=0,h={},d=0,p=[],y=[],g=[];for(r=0;r<u;++r){var x=(o=e[r]).match(/\S*/g),v=[];for(t=0;t<x.length;++t)""!==x[t]&&v.push(x[t]);if(0!==v.length){for(t=0;t<s.length&&o.substr(0,s[t].length)!==s[t];++t);if(t<s.length){if(a=t,1===t&&(i=v[1]),6===t)return{name:i,c:p,A:numeric.transpose(y),b:g,rows:l,vars:h}}else switch(a){case 0:case 1:n("Unexpected line");case 2:switch(v[0]){case"N":0===c?c=v[1]:n("Two or more N rows");break;case"L":l[v[1]]=m,f[m]=1,g[m]=0,++m;break;case"G":l[v[1]]=m,f[m]=-1,g[m]=0,++m;break;case"E":l[v[1]]=m,f[m]=0,g[m]=0,++m;break;default:n("Parse error "+numeric.prettyPrint(v))}break;case 3:h.hasOwnProperty(v[0])||(h[v[0]]=d,p[d]=0,y[d]=numeric.rep([m],0),++d);var _=h[v[0]];for(t=1;t<v.length;t+=2)if(v[t]!==c){var w=l[v[t]];y[_][w]=(f[w]<0?-1:1)*parseFloat(v[t+1])}else p[_]=parseFloat(v[t+1]);break;case 4:for(t=1;t<v.length;t+=2)g[l[v[t]]]=(f[l[v[t]]]<0?-1:1)*parseFloat(v[t+1]);break;case 5:break;case 6:n("Internal error")}}}n("Reached end of file without ENDATA")},numeric.seedrandom={pow:Math.pow,random:Math.random},function(e,n,r,t,o,i,a){function s(e){var n,t,o=this,i=e.length,a=0,s=o.i=o.j=o.m=0;for(o.S=[],o.c=[],i||(e=[i++]);a<r;)o.S[a]=a++;for(a=0;a<r;a++)s=l(s+(n=o.S[a])+e[a%i]),t=o.S[s],o.S[a]=t,o.S[s]=n;o.g=function(e){var n=o.S,t=l(o.i+1),i=n[t],a=l(o.j+i),s=n[a];n[t]=s,n[a]=i;for(var u=n[l(i+s)];--e;)t=l(t+1),s=n[a=l(a+(i=n[t]))],n[t]=s,n[a]=i,u=u*r+n[l(i+s)];return o.i=t,o.j=a,u},o.g(r)}function u(e,n,r,t,o){if(r=[],o=typeof e,n&&"object"==o)for(t in e)if(t.indexOf("S")<5)try{r.push(u(e[t],n-1))}catch(e){}return r.length?r:e+("string"!=o?"\0":"")}function c(e,n,r,t){for(e+="",r=0,t=0;t<e.length;t++)n[l(t)]=l((r^=19*n[l(t)])+e.charCodeAt(t));for(t in e="",n)e+=String.fromCharCode(n[t]);return e}function l(e){return e&r-1}n.seedrandom=function(t,l){var f,m=[];return t=c(u(l?[t,e]:arguments.length?t:[(new Date).getTime(),e,window],3),m),c((f=new s(m)).S,e),n.random=function(){for(var e=f.g(6),n=a,t=0;e<o;)e=(e+t)*r,n*=r,t=f.g(1);for(;e>=i;)e/=2,n/=2,t>>>=1;return(e+t)/n},t},a=n.pow(r,6),o=n.pow(2,o),i=2*o,c(n.random(),e)}([],numeric.seedrandom,256,0,52),function(e){function n(e){if("object"!=typeof e)return e;var r,t=[],o=e.length;for(r=0;r<o;r++)t[r+1]=n(e[r]);return t}function r(e){if("object"!=typeof e)return e;var n,t=[],o=e.length;for(n=1;n<o;n++)t[n-1]=r(e[n]);return t}e.solveQP=function(e,t,o,i,a,s){e=n(e),t=n(t),o=n(o);var u,c,l,f,m,h=[],d=[],p=[],y=[],g=[];if(a=a||0,s=s?n(s):[void 0,0],i=i?n(i):[],c=e.length-1,l=o[1].length-1,!i)for(u=1;u<=l;u+=1)i[u]=0;for(u=1;u<=l;u+=1)d[u]=0;for(f=Math.min(c,l),u=1;u<=c;u+=1)p[u]=0;for(h[1]=0,u=1;u<=2*c+f*(f+5)/2+2*l+1;u+=1)y[u]=0;for(u=1;u<=2;u+=1)g[u]=0;return function(e,n,r,t,o,i,a,s,u,c,l,f,m,h,d,p){function y(){for(h[1]=h[1]+1,b=M,w=1;w<=c;w+=1){for(b+=1,X=-s[w],T=1;T<=t;T+=1)X+=a[T][w]*o[T];if(Math.abs(X)<H&&(X=0),w>l)d[b]=X;else if(d[b]=-Math.abs(X),X>0){for(T=1;T<=t;T+=1)a[T][w]=-a[T][w];s[w]=-s[w]}}for(w=1;w<=m;w+=1)d[M+f[w]]=0;for(L=0,R=0,w=1;w<=c;w+=1)d[M+w]<R*d[k+w]&&(L=w,R=d[M+w]/d[k+w]);return 0===L?999:0}function g(){for(w=1;w<=t;w+=1){for(X=0,T=1;T<=t;T+=1)X+=e[T][w]*a[T][L];d[w]=X}for(A=C,w=1;w<=t;w+=1)d[A+w]=0;for(T=m+1;T<=t;T+=1)for(w=1;w<=t;w+=1)d[A+w]=d[A+w]+e[w][T]*d[T];for(B=!0,w=m;w>=1;w-=1){for(X=d[w],A=(b=N+w*(w+3)/2)-w,T=w+1;T<=m;T+=1)X-=d[b]*d[S+T],b+=T;if(X/=d[A],d[S+w]=X,f[w]<l)break;if(X<0)break;B=!1,I=w}if(!B)for(D=d[P+I]/d[S+I],w=1;w<=m&&!(f[w]<l)&&!(d[S+w]<0);w+=1)(R=d[P+w]/d[S+w])<D&&(D=R,I=w);for(X=0,w=C+1;w<=C+t;w+=1)X+=d[w]*d[w];if(Math.abs(X)<=H){if(B)return p[1]=1,999;for(w=1;w<=m;w+=1)d[P+w]=d[P+w]-D*d[S+w];return d[P+m+1]=d[P+m+1]+D,700}for(X=0,w=1;w<=t;w+=1)X+=d[C+w]*a[w][L];for(F=-d[M+L]/X,Y=!0,B||D<F&&(F=D,Y=!1),w=1;w<=t;w+=1)o[w]=o[w]+F*d[C+w],Math.abs(o[w])<H&&(o[w]=0);for(i[1]=i[1]+F*X*(F/2+d[P+m+1]),w=1;w<=m;w+=1)d[P+w]=d[P+w]-F*d[S+w];if(d[P+m+1]=d[P+m+1]+F,!Y){for(X=-s[L],T=1;T<=t;T+=1)X+=o[T]*a[T][L];if(L>l)d[M+L]=X;else if(d[M+L]=-Math.abs(X),X>0){for(T=1;T<=t;T+=1)a[T][L]=-a[T][L];s[L]=-s[L]}return 700}for(f[m+=1]=L,b=N+(m-1)*m/2+1,w=1;w<=m-1;w+=1)d[b]=d[w],b+=1;if(m===t)d[b]=d[t];else{for(w=t;w>=m+1&&0!==d[w]&&(j=Math.max(Math.abs(d[w-1]),Math.abs(d[w])),q=Math.min(Math.abs(d[w-1]),Math.abs(d[w])),R=d[w-1]>=0?Math.abs(j*Math.sqrt(1+q*q/(j*j))):-Math.abs(j*Math.sqrt(1+q*q/(j*j))),j=d[w-1]/R,q=d[w]/R,1!==j);w-=1)if(0===j)for(d[w-1]=q*R,T=1;T<=t;T+=1)R=e[T][w-1],e[T][w-1]=e[T][w],e[T][w]=R;else for(d[w-1]=R,G=q/(1+j),T=1;T<=t;T+=1)R=j*e[T][w-1]+q*e[T][w],e[T][w]=G*(e[T][w-1]+R)-e[T][w],e[T][w-1]=R;d[b]=d[m]}return 0}function x(){if(0===d[A=(b=N+I*(I+1)/2+1)+I])return 798;if(j=Math.max(Math.abs(d[A-1]),Math.abs(d[A])),q=Math.min(Math.abs(d[A-1]),Math.abs(d[A])),R=d[A-1]>=0?Math.abs(j*Math.sqrt(1+q*q/(j*j))):-Math.abs(j*Math.sqrt(1+q*q/(j*j))),j=d[A-1]/R,q=d[A]/R,1===j)return 798;if(0===j){for(w=I+1;w<=m;w+=1)R=d[A-1],d[A-1]=d[A],d[A]=R,A+=w;for(w=1;w<=t;w+=1)R=e[w][I],e[w][I]=e[w][I+1],e[w][I+1]=R}else{for(G=q/(1+j),w=I+1;w<=m;w+=1)R=j*d[A-1]+q*d[A],d[A]=G*(d[A-1]+R)-d[A],d[A-1]=R,A+=w;for(w=1;w<=t;w+=1)R=j*e[w][I]+q*e[w][I+1],e[w][I+1]=G*(e[w][I]+R)-e[w][I+1],e[w][I]=R}return 0}function v(){for(A=b-I,w=1;w<=I;w+=1)d[A]=d[b],b+=1,A+=1;return d[P+I]=d[P+I+1],f[I]=f[I+1],(I+=1)<m?797:0}function _(){return d[P+m]=d[P+m+1],d[P+m+1]=0,f[m]=0,m-=1,h[2]=h[2]+1,0}var w,T,b,A,E,I,C,S,N,M,P,L,O,k,R,X,D,F,j,q,G,B,Y,H,V,W,U;O=Math.min(t,c),b=2*t+O*(O+5)/2+2*c+1,H=1e-60;do{V=1+.1*(H+=H),W=1+.2*H}while(V<=1||W<=1);for(w=1;w<=t;w+=1)d[w]=n[w];for(w=t+1;w<=b;w+=1)d[w]=0;for(w=1;w<=c;w+=1)f[w]=0;if(E=[],0===p[1]){if(function(e,n,r,t){var o,i,a,s,u,c;for(i=1;i<=r;i+=1){if(t[1]=i,c=0,(a=i-1)<1){if((c=e[i][i]-c)<=0)break;e[i][i]=Math.sqrt(c)}else{for(s=1;s<=a;s+=1){for(u=e[s][i],o=1;o<s;o+=1)u-=e[o][i]*e[o][s];u/=e[s][s],e[s][i]=u,c+=u*u}if((c=e[i][i]-c)<=0)break;e[i][i]=Math.sqrt(c)}t[1]=0}}(e,0,t,E),0!==E[1])return void(p[1]=2);(function(e,n,r,t){var o,i,a,s;for(i=1;i<=r;i+=1){for(s=0,o=1;o<i;o+=1)s+=e[o][i]*t[o];t[i]=(t[i]-s)/e[i][i]}for(a=1;a<=r;a+=1)for(t[i=r+1-a]=t[i]/e[i][i],s=-t[i],o=1;o<i;o+=1)t[o]=t[o]+s*e[o][i]})(e,0,t,n),function(e,n,r){var t,o,i,a,s;for(i=1;i<=r;i+=1){for(e[i][i]=1/e[i][i],s=-e[i][i],t=1;t<i;t+=1)e[t][i]=s*e[t][i];if(r<(a=i+1))break;for(o=a;o<=r;o+=1)for(s=e[i][o],e[i][o]=0,t=1;t<=i;t+=1)e[t][o]=e[t][o]+s*e[t][i]}}(e,0,t)}else{for(T=1;T<=t;T+=1)for(o[T]=0,w=1;w<=T;w+=1)o[T]=o[T]+e[w][T]*n[w];for(T=1;T<=t;T+=1)for(n[T]=0,w=T;w<=t;w+=1)n[T]=n[T]+e[T][w]*o[w]}for(i[1]=0,T=1;T<=t;T+=1)for(o[T]=n[T],i[1]=i[1]+d[T]*o[T],d[T]=0,w=T+1;w<=t;w+=1)e[w][T]=0;for(i[1]=-i[1]/2,p[1]=0,k=(M=(N=(P=(S=(C=t)+t)+O)+O+1)+O*(O+1)/2)+c,w=1;w<=c;w+=1){for(X=0,T=1;T<=t;T+=1)X+=a[T][w]*a[T][w];d[k+w]=Math.sqrt(X)}for(m=0,h[1]=0,h[2]=0,U=0;;){if(999===(U=y()))return;for(;0!==(U=g());){if(999===U)return;if(700===U)if(I===m)_();else{for(;x(),797===(U=v()););_()}}}}(e,t,0,c,p,h,o,i,0,l,a,d,0,g,y,s),m="",1===s[1]&&(m="constraints are inconsistent, no solution!"),2===s[1]&&(m="matrix D in quadratic function is not positive definite!"),{solution:r(p),value:r(h),unconstrained_solution:r(t),iterations:r(g),iact:r(d),message:m}}}(numeric),numeric.svd=function(e){function n(e,n){return(e=Math.abs(e))>(n=Math.abs(n))?e*Math.sqrt(1+n*n/e/e):0==n?e:n*Math.sqrt(1+e*e/n/n)}var r,t=numeric.epsilon,o=1e-64/t,i=0,a=0,s=0,u=0,c=0,l=numeric.clone(e),f=l.length,m=l[0].length;if(f<m)throw"Need more rows than columns";var h=new Array(m),d=new Array(m);for(a=0;a<m;a++)h[a]=d[a]=0;var p=numeric.rep([m,m],0),y=0,g=0,x=0,v=0,_=0,w=0,T=0;for(a=0;a<m;a++){for(h[a]=g,T=0,c=a+1,s=a;s<f;s++)T+=l[s][a]*l[s][a];if(T<=o)g=0;else for(y=l[a][a],g=Math.sqrt(T),y>=0&&(g=-g),x=y*g-T,l[a][a]=y-g,s=c;s<m;s++){for(T=0,u=a;u<f;u++)T+=l[u][a]*l[u][s];for(y=T/x,u=a;u<f;u++)l[u][s]+=y*l[u][a]}for(d[a]=g,T=0,s=c;s<m;s++)T+=l[a][s]*l[a][s];if(T<=o)g=0;else{for(y=l[a][a+1],g=Math.sqrt(T),y>=0&&(g=-g),x=y*g-T,l[a][a+1]=y-g,s=c;s<m;s++)h[s]=l[a][s]/x;for(s=c;s<f;s++){for(T=0,u=c;u<m;u++)T+=l[s][u]*l[a][u];for(u=c;u<m;u++)l[s][u]+=T*h[u]}}(_=Math.abs(d[a])+Math.abs(h[a]))>v&&(v=_)}for(a=m-1;-1!=a;a+=-1){if(0!=g){for(x=g*l[a][a+1],s=c;s<m;s++)p[s][a]=l[a][s]/x;for(s=c;s<m;s++){for(T=0,u=c;u<m;u++)T+=l[a][u]*p[u][s];for(u=c;u<m;u++)p[u][s]+=T*p[u][a]}}for(s=c;s<m;s++)p[a][s]=0,p[s][a]=0;p[a][a]=1,g=h[a],c=a}for(a=m-1;-1!=a;a+=-1){for(c=a+1,g=d[a],s=c;s<m;s++)l[a][s]=0;if(0!=g){for(x=l[a][a]*g,s=c;s<m;s++){for(T=0,u=c;u<f;u++)T+=l[u][a]*l[u][s];for(y=T/x,u=a;u<f;u++)l[u][s]+=y*l[u][a]}for(s=a;s<f;s++)l[s][a]=l[s][a]/g}else for(s=a;s<f;s++)l[s][a]=0;l[a][a]+=1}for(t*=v,u=m-1;-1!=u;u+=-1)for(var b=0;b<50;b++){var A=!1;for(c=u;-1!=c;c+=-1){if(Math.abs(h[c])<=t){A=!0;break}if(Math.abs(d[c-1])<=t)break}if(!A){i=0,T=1;var E=c-1;for(a=c;a<u+1&&(y=T*h[a],h[a]=i*h[a],!(Math.abs(y)<=t));a++)for(x=n(y,g=d[a]),d[a]=x,i=g/x,T=-y/x,s=0;s<f;s++)_=l[s][E],w=l[s][a],l[s][E]=_*i+w*T,l[s][a]=-_*T+w*i}if(w=d[u],c==u){if(w<0)for(d[u]=-w,s=0;s<m;s++)p[s][u]=-p[s][u];break}if(b>=49)throw"Error: no convergence.";for(v=d[c],g=n(y=(((_=d[u-1])-w)*(_+w)+((g=h[u-1])-(x=h[u]))*(g+x))/(2*x*_),1),y=y<0?((v-w)*(v+w)+x*(_/(y-g)-x))/v:((v-w)*(v+w)+x*(_/(y+g)-x))/v,i=1,T=1,a=c+1;a<u+1;a++){for(g=h[a],_=d[a],x=T*g,g*=i,w=n(y,x),h[a-1]=w,y=v*(i=y/w)+g*(T=x/w),g=-v*T+g*i,x=_*T,_*=i,s=0;s<m;s++)v=p[s][a-1],w=p[s][a],p[s][a-1]=v*i+w*T,p[s][a]=-v*T+w*i;for(w=n(y,x),d[a-1]=w,y=(i=y/w)*g+(T=x/w)*_,v=-T*g+i*_,s=0;s<f;s++)_=l[s][a-1],w=l[s][a],l[s][a-1]=_*i+w*T,l[s][a]=-_*T+w*i}h[c]=0,h[u]=y,d[u]=v}for(a=0;a<d.length;a++)d[a]<t&&(d[a]=0);for(a=0;a<m;a++)for(s=a-1;s>=0;s--)if(d[s]<d[a]){for(i=d[s],d[s]=d[a],d[a]=i,u=0;u<l.length;u++)r=l[u][a],l[u][a]=l[u][s],l[u][s]=r;for(u=0;u<p.length;u++)r=p[u][a],p[u][a]=p[u][s],p[u][s]=r;a=s}return{U:l,S:d,V:p}}},111:(e,n,r)=>{"use strict";function t(e){e.sort();const n=e[Math.trunc(e.length/4)],r=e.length%2==0?(e[Math.trunc(e.length/2)]+e[Math.trunc(e.length/2)-1])/2:e[Math.trunc(e.length/2)],t=e[Math.trunc(3*e.length/4)],i=1.5*(t-n);let a=o(e,t+i);a<0&&(a=~a);let s=e[Math.max(0,a-1)];s<t&&(s=t);let u=o(e,n-i);u<0&&(u=~u);let c=e[u];return c>n&&(c=n),{q1:n,q2:r,q3:t,lowerAdjacentValue:c,upperAdjacentValue:s}}function o(e,n,r=0,t){if(0===e.length)return-1;if(void 0===t&&(t=e.length-1),n<e[r])return-1;if(n>e[t])return-(t+1);for(;t-r>1;){const o=Math.trunc((t+r)/2);if(n===e[o])return o;n<e[o]?t=o:r=o}return e[r]===n?r:0===e[t]?t:n<e[r]?-(r+1):-(t+1)}r.d(n,{G:()=>t})},875:(e,n,r)=>{"use strict";r.d(n,{Hg:()=>C,K0:()=>p,Kp:()=>c,Qc:()=>l,XD:()=>f,ZY:()=>T,aC:()=>I,d8:()=>u,hR:()=>A,iC:()=>b,j2:()=>s,js:()=>a,kW:()=>d,sw:()=>h,ue:()=>E,vK:()=>m,yB:()=>y});var t=r(976),o=r(78),i=r(162);const a={CONSTANT:"constant",PROPORTIONAL:"proportional"},s="fit",u="fit",c=".fit",l="rgba(255,191,63,0.4)",f="rgba(255,238,204,0.3)",m={TOP:"top",BOTTOM:"bottom"},h=[t.Property.js("rSquared",t.TYPE.FLOAT,{userEditable:!1}),t.Property.js("auc",t.TYPE.FLOAT,{userEditable:!1}),t.Property.js("interceptY",t.TYPE.FLOAT,{userEditable:!1}),t.Property.js("interceptX",t.TYPE.FLOAT,{userEditable:!1}),t.Property.js("slope",t.TYPE.FLOAT,{userEditable:!1}),t.Property.js("top",t.TYPE.FLOAT,{userEditable:!1}),t.Property.js("bottom",t.TYPE.FLOAT,{userEditable:!1})],d=[t.Property.js("minX",t.TYPE.FLOAT,{description:"Minimum value of the X axis",nullable:!0}),t.Property.js("minY",t.TYPE.FLOAT,{description:"Minimum value of the Y axis",nullable:!0}),t.Property.js("maxX",t.TYPE.FLOAT,{description:"Maximum value of the X axis",nullable:!0}),t.Property.js("maxY",t.TYPE.FLOAT,{description:"Maximum value of the Y axis",nullable:!0}),t.Property.js("title",t.TYPE.STRING,{nullable:!0}),t.Property.js("xAxisName",t.TYPE.STRING,{description:"Label to show on the X axis. If not specified, corresponding data column name is used",nullable:!0}),t.Property.js("yAxisName",t.TYPE.STRING,{description:"Label to show on the Y axis. If not specified, corresponding data column name is used",nullable:!0}),t.Property.js("logX",t.TYPE.BOOL,{description:"Whether the X axis should be logarithmic",defaultValue:!1}),t.Property.js("logY",t.TYPE.BOOL,{description:"Whether the Y axis should be logarithmic",defaultValue:!1}),t.Property.js("allowXZeroes",t.TYPE.BOOL,{description:"Whether x zeroes allowed for logarithmic data or not",defaultValue:!0}),t.Property.js("mergeSeries",t.TYPE.BOOL,{description:"Whether to merge series or not",defaultValue:!1}),t.Property.js("showColumnLabel",t.TYPE.BOOL,{description:"Whether to show the column label in the legend or not",defaultValue:!1}),t.Property.js("showStatistics",t.TYPE.STRING_LIST,{description:"Whether specific statistics should be rendered",choices:h.map((e=>e.name)),inputType:"MultiChoice",friendlyName:"Statistics"})],p=[t.Property.js("fitFunction",t.TYPE.STRING,{category:"Fitting",choices:["sigmoid","linear"],defaultValue:"sigmoid"}),t.Property.js("pointColor",t.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),t.Property.js("fitLineColor",t.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),t.Property.js("outlierColor",t.TYPE.STRING,{category:"Rendering",nullable:!0,inputType:"Color"}),t.Property.js("errorModel",t.TYPE.STRING,{category:"Fitting",defaultValue:"constant",choices:["constant","proportional"],nullable:!1}),t.Property.js("connectDots",t.TYPE.BOOL,{category:"Fitting",defaultValue:!1}),t.Property.js("clickToToggle",t.TYPE.BOOL,{category:"Fitting",description:"Click on a point to mark it as outlier and refit",nullable:!0,defaultValue:!1}),t.Property.js("showFitLine",t.TYPE.BOOL,{category:"Fitting",defaultValue:!0}),t.Property.js("showPoints",t.TYPE.STRING,{category:"Fitting",description:"Whether points/candlesticks/none should be rendered",defaultValue:"points",choices:["points","candlesticks","both"]}),t.Property.js("showCurveConfidenceInterval",t.TYPE.BOOL,{category:"Fitting",description:"Whether confidence intervals should be rendered",defaultValue:!1,friendlyName:"Confidence Interval"}),t.Property.js("markerType",t.TYPE.STRING,{category:"Rendering",defaultValue:"circle",choices:["asterisk","circle","cross border","diamond","square","star","triangle bottom","triangle left","triangle right","triangle top"],nullable:!1}),t.Property.js("lineStyle",t.TYPE.STRING,{category:"Rendering",defaultValue:"solid",choices:["solid","dotted","dashed","dashdotted"],nullable:!1}),t.Property.js("droplines",t.TYPE.STRING_LIST,{description:"Whether specific droplines should be rendered",choices:["IC50"],inputType:"MultiChoice"}),t.Property.js("columnName",t.TYPE.STRING,{description:"Column name where the series is stored",defaultValue:""})],y="sigmoid";class g{}class x extends g{constructor(e,n,r,t){super(),this._name=e,this._parameterNames=t,this.y=n,this.getInitialParameters=r}get name(){return this._name}get parameterNames(){return this._parameterNames}y(e,n){throw new Error("Not implemented")}getInitialParameters(e,n){throw new Error("Not implemented")}}const v={linear:new class extends g{get name(){return"linear"}get parameterNames(){return["Slope","Intercept"]}y(e,n){return function(e,n){return e[0]*n+e[1]}(e,n)}getInitialParameters(e,n){let r=0,t=0;for(let n=1;n<e.length;n++)e[n]<e[r]&&(r=n),e[n]>e[t]&&(t=n);const o=e[t]-e[r],i=(n[t]-n[r])/o;return[i,n[t]-i*e[t]]}},sigmoid:new class extends g{get name(){return y}get parameterNames(){return["Top","Bottom","Slope","IC50"]}y(e,n){return C(e,n)}getInitialParameters(e,n){const r=t.Rect.fromXYArrays(e,n),o=(r.bottom-r.top)/2+r.top;let i=r.bottom-r.top,a=0;for(let r=0;r<e.length;r++){const e=Math.abs(n[r]-o);e<i&&(i=e,a=r)}const s=e[a],u=n[0]>n[n.length-1]?1:-1;return[r.bottom,u,s,r.top]}}};function _(e){let n;switch(e){case a.CONSTANT:n=P;break;case a.PROPORTIONAL:n=L;break;default:n=P}return n}function w(e,n,r,t){return{getValue:t=>r(n,e,t).value,getGradient:(o,i)=>{for(let a=0;a<o.length;a++)i[a]=t.includes(a)?0:M(r,n,e,o,a);return i}}}function T(e){if("string"==typeof e)return v[e];if(!v[e.name]){const n=e.name,r=e.parameterNames,t=e.function.split("=>").map((e=>e.trim())),o=e.getInitialParameters.split("=>").map((e=>e.trim())),i=new Function(t[0].slice(1,t[0].length-1),`${t[1].includes(";")?"":"return "}${t[1]}`),a=new Function(o[0].slice(1,o[0].length-1),`return ${o[1]}`),s=new x(n,i,a,r);v[n]=s}return v[e.name]}function b(e,n,r,t){var i,a;const s=n.y,u=n.getInitialParameters(e.x,e.y),c=_(r),l=[];let f=!0;for(;f;){const n=w(e,s,c,l);if((0,o.U)(n,u),(0,o.U)(n,u),f=!1,!t)break;for(let e=0;e<t.length;e++){if(void 0!==(null===(i=t[e])||void 0===i?void 0:i.max)&&u[e]>t[e].max){f=!0,l.push(e),u[e]=t[e].max;break}if(void 0!==(null===(a=t[e])||void 0===a?void 0:a.min)&&u[e]<t[e].min){f=!0,l.push(e),u[e]=t[e].min;break}}}return{fittedCurve:A(s,u),parameters:u}}function A(e,n){return r=>e(n,r)}function E(e,n,r,t=.05,o){const s=_(o),u=o===a.PROPORTIONAL?s(r,e,n).mult:s(r,e,n).const,c=i.normal.inv(1-t/2,0,1);return{confidenceTop:e=>{const t=r(n,e);return o===a.CONSTANT?t+c*u:t+c*Math.abs(t)*u},confidenceBottom:e=>{const t=r(n,e);return o===a.CONSTANT?t-c*u:t-c*Math.abs(t)*u}}}function I(e,n,r,t=!0){const o=A(r,n);return{rSquared:t?N(o,e):void 0,auc:t?S(o,e):void 0,interceptX:n[2],interceptY:o(n[2]),slope:n[1],top:n[0],bottom:n[3]}}function C(e,n){const r=e[0],t=e[1],o=e[2],i=e[3];return i+(r-i)/(1+Math.pow(10,(n-o)*t))}function S(e,n){let r=0;const t=Math.min(...n.x),o=Math.max(...n.x),i=(o-t)/1e3;for(let n=t;n<o;n+=i)r+=i*e(n);return r}function N(e,n){let r=0,t=0;const o=i.mean(n.y);for(let i=0;i<n.x.length;i++)r+=Math.pow(n.y[i]-e(n.x[i]),2),t+=Math.pow(n.y[i]-o,2);return 1-r/t}function M(e,n,r,t,o){const i=1e-4*t[o]==0?.001:1e-4*t[o],a=[],s=[];for(let e=0;e<t.length;e++)e===o?(a.push(t[e]+i),s.push(t[e]-i)):(a.push(t[e]),s.push(t[e]));return(e(n,r,a).value-e(n,r,s).value)/(2*i)}function P(e,n,r){const t=Math.PI;let o=0,i=0,a=0;const s=new Float32Array(n.x.length);for(let t=0;t<n.x.length;t++){const o=n.y[t],i=e(r,n.x[t]);s[t]=Math.pow(o-i,2)}for(let e=0;e<s.length;e++)i+=s[e];i/=s.length,o=Math.sqrt(i);for(let e=0;e<s.length;e++)a+=s[e]/i+Math.log(2*t*i);return{value:-a,const:o,mult:0}}function L(e,n,r){const t=Math.PI;let o=0,i=0,a=0;const s=new Float32Array(n.x.length);for(let t=0;t<n.x.length;t++){const o=n.y[t],i=e(r,n.x[t]);s[t]=Math.pow(o-i,2)}for(let e=0;e<s.length;e++)i+=s[e];i/=s.length,o=Math.sqrt(i);for(let e=0;e<s.length;e++)a+=s[e]/i+Math.log(2*t*i);return{value:-a,const:0,mult:o}}},416:(e,n,r)=>{"use strict";r.d(n,{LC:()=>p,PK:()=>d,TL:()=>a,Y6:()=>m,dU:()=>f,hq:()=>u,jG:()=>s,kG:()=>h,q_:()=>c,tq:()=>y});var t=r(976),o=r(875);function i(e){const n={};for(const r of e)null!==r.defaultValue&&(n[r.name]=r.defaultValue);return n}function a(){return{chartOptions:i(o.kW),seriesOptions:i(o.K0)}}function s(e){var n,r;return JSON.parse(null!==(n=(r=e.tags)[o.Kp])&&void 0!==n?n:r[o.Kp]=JSON.stringify(a()))}function u(e){var n,r;return JSON.parse(null!==(n=(r=e.tags)[o.Kp])&&void 0!==n?n:r[o.Kp]=JSON.stringify(a()))}function c(e){const n=[],r=[];for(let t=0;t<e.length;t++)n[t]=e[t].x,r[t]=e[t].y;return{xs:n,ys:r}}function l(e){const n=Math.floor(e.y.length/2),r=e.y.sort(((e,n)=>e-n));return r.length%2==0?(r[n-1]+r[n])/2:r[n]}function f(e){var n;const r=e.chartOptions;if((null===(n=e.series)||void 0===n?void 0:n.length)&&0!==e.series.length){const{xs:n,ys:o}=c(e.series[0].points);let i=t.Rect.fromXYArrays(n,o);for(let n=1;n<e.series.length;n++){const{xs:r,ys:o}=c(e.series[n].points);r.some((e=>void 0===e))||o.some((e=>void 0===e))||(i=i.union(t.Rect.fromXYArrays(r,o)))}return r?function(e,n){let r=e.x,o=e.y,i=e.width,a=e.height;return void 0!==n.minX&&null!==n.minX&&(!n.logX||n.logX&&n.minX>0)&&(i+=r-n.minX,r=n.minX),void 0!==n.maxX&&null!==n.maxX&&(!n.logX||n.logX&&n.maxX>0)&&(i+=n.maxX-(r+i)),void 0!==n.minY&&null!==n.minY&&(!n.logY||n.logY&&n.minY>0)&&(a+=o-n.minY,o=n.minY),void 0!==n.maxY&&null!==n.maxY&&(!n.logY||n.logY&&n.maxY>0)&&(a+=n.maxY-(o+a)),new t.Rect(r,o,i,a)}(i,r):i}return new t.Rect(0,0,1,1)}function m(e){return(0,o.ZY)(e.fitFunction)}function h(e,n){return(0,o.hR)(n.y,e.parameters)}function d(e,n,r){var t;const i={x:e.points.filter((e=>!e.outlier)).map((e=>(null==r?void 0:r.logX)?Math.log10(e.x):e.x)),y:e.points.filter((e=>!e.outlier)).map((e=>(null==r?void 0:r.logY)?Math.log10(e.y):e.y))};var a;return e.parameterBounds&&(null==r?void 0:r.logX)&&(e.parameterBounds[2]=((a=e.parameterBounds[2])&&(void 0!==a.max&&(a.max=Math.log10(a.max)),void 0!==a.min&&(a.min=0===a.min?-Number.MAX_VALUE:Math.log10(a.min))),a)),(0,o.iC)(function(e){const n={x:[],y:[]},r={x:[e.x[0]],y:[e.y[0]]};for(let t=1;t<e.x.length;t++){if(e.x[t]===r.x[0]){r.x[r.x.length]=e.x[t],r.y[r.y.length]=e.y[t];continue}const o=l(r);n.x[n.x.length]=r.x[0],n.y[n.y.length]=o,r.x=[e.x[t]],r.y=[e.y[t]]}const t=l(r);return n.x[n.x.length]=r.x[0],n.y[n.y.length]=t,n}(i),n,null!==(t=e.errorModel)&&void 0!==t?t:o.js.CONSTANT,e.parameterBounds)}function p(e,n,r,t){var i;const a=r?{x:e.points.map((e=>(null==t?void 0:t.logX)?Math.log10(e.x):e.x)),y:e.points.map((e=>(null==t?void 0:t.logY)?Math.log10(e.y):e.y))}:{x:e.points.filter((e=>!e.outlier)).map((e=>(null==t?void 0:t.logX)?Math.log10(e.x):e.x)),y:e.points.filter((e=>!e.outlier)).map((e=>(null==t?void 0:t.logY)?Math.log10(e.y):e.y))};return e.parameters||(e.parameters=d(e,n).parameters),(0,o.ue)(a,e.parameters,n.y,.05,null!==(i=e.errorModel)&&void 0!==i?i:o.js.CONSTANT)}function y(e,n,r){const t={x:e.points.filter((e=>!e.outlier)).map((e=>(null==r?void 0:r.logX)?Math.log10(e.x):e.x)),y:e.points.filter((e=>!e.outlier)).map((e=>(null==r?void 0:r.logY)?Math.log10(e.y):e.y))};return e.parameters||(e.parameters=d(e,n).parameters),(0,o.aC)(t,e.parameters,n.y,!0)}},766:(e,n,r)=>{"use strict";r.d(n,{l:()=>s});var t=r(976);const o=1e-30,i=new class{screenToWorld(e,n,r,t,o){return r+(o?1-e/n:e/n)*(t-r)}worldToScreen(e,n,r,t,o){return o?(1-(e-r)/(t-r))*n:(e-r)/(t-r)*n}},a=new class{screenToWorld(e,n,r,t,i){r=r<o?o:r;const a=Math.log(t),s=Math.log(r);return Math.exp(s+(a-s)*(i?n-e:e)/n)}worldToScreen(e,n,r,t,i){if(e<=0)return NaN;if(Math.abs(e-r)<o)return i?n:0;if(Math.abs(e-t)<o)return i?0:n;r=r<o?o:r,e=e<o?o:e;const a=n*Math.log(e/r)/Math.log(t/r);return i?n-a:a}};class s{get xt(){return this.logX?a:i}get yt(){return this.logY?a:i}constructor(e,n,r=!1,t=!1){this.logX=!1,this.logY=!1,this.inverseX=!1,this.inverseY=!1,this.world=e,this.screen=n,this.logX=r,this.logY=t}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 t.Point(this.xToScreen(e.x),this.yToScreen(e.y))}toWorld(e){return new t.Point(this.xToWorld(e.x),this.yToWorld(e.y))}drawCoordinateGrid(e,n,r){n&&t.Paint.horzAxis(e,this.world.minX,this.world.maxX,n.x,n.y,n.width,n.height,this.logX,this.inverseX),r&&t.Paint.vertAxis(e,this.world.minY,this.world.maxY,r.x,r.y,r.width,r.height,this.logY,this.inverseY)}}},133:function(e,n,r){var t;!function(n,o){var i={};!function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var n=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 r(e,r,t,o,i){for(var a,s,u,c,l,f,m,h,d,p,y,g,x;i>=64;){for(a=r[0],s=r[1],u=r[2],c=r[3],l=r[4],f=r[5],m=r[6],h=r[7],p=0;p<16;p++)y=o+4*p,e[p]=(255&t[y])<<24|(255&t[y+1])<<16|(255&t[y+2])<<8|255&t[y+3];for(p=16;p<64;p++)g=((d=e[p-2])>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,x=((d=e[p-15])>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,e[p]=(g+e[p-7]|0)+(x+e[p-16]|0);for(p=0;p<64;p++)g=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&f^~l&m)|0)+(h+(n[p]+e[p]|0)|0)|0,x=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&s^a&u^s&u)|0,h=m,m=f,f=l,l=c+g|0,c=u,u=s,s=a,a=g+x|0;r[0]+=a,r[1]+=s,r[2]+=u,r[3]+=c,r[4]+=l,r[5]+=f,r[6]+=m,r[7]+=h,o+=64,i-=64}return o}var t=function(){function n(){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 n.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},n.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()},n.prototype.update=function(e,n){if(void 0===n&&(n=e.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var t=0;if(this.bytesHashed+=n,this.bufferLength>0){for(;this.bufferLength<64&&n>0;)this.buffer[this.bufferLength++]=e[t++],n--;64===this.bufferLength&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(n>=64&&(t=r(this.temp,this.state,e,t,n),n%=64);n>0;)this.buffer[this.bufferLength++]=e[t++],n--;return this},n.prototype.finish=function(e){if(!this.finished){var n=this.bytesHashed,t=this.bufferLength,o=n/536870912|0,i=n<<3,a=n%64<56?64:128;this.buffer[t]=128;for(var s=t+1;s<a-8;s++)this.buffer[s]=0;this.buffer[a-8]=o>>>24&255,this.buffer[a-7]=o>>>16&255,this.buffer[a-6]=o>>>8&255,this.buffer[a-5]=o>>>0&255,this.buffer[a-4]=i>>>24&255,this.buffer[a-3]=i>>>16&255,this.buffer[a-2]=i>>>8&255,this.buffer[a-1]=i>>>0&255,r(this.temp,this.state,this.buffer,0,a),this.finished=!0}for(s=0;s<8;s++)e[4*s+0]=this.state[s]>>>24&255,e[4*s+1]=this.state[s]>>>16&255,e[4*s+2]=this.state[s]>>>8&255,e[4*s+3]=this.state[s]>>>0&255;return this},n.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},n.prototype._saveState=function(e){for(var n=0;n<this.state.length;n++)e[n]=this.state[n]},n.prototype._restoreState=function(e,n){for(var r=0;r<this.state.length;r++)this.state[r]=e[r];this.bytesHashed=n,this.finished=!1,this.bufferLength=0},n}();e.Hash=t;var o=function(){function e(e){this.inner=new t,this.outer=new t,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var n=new Uint8Array(this.blockSize);if(e.length>this.blockSize)(new t).update(e).finish(n).clean();else for(var r=0;r<e.length;r++)n[r]=e[r];for(r=0;r<n.length;r++)n[r]^=54;for(this.inner.update(n),r=0;r<n.length;r++)n[r]^=106;for(this.outer.update(n),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),r=0;r<n.length;r++)n[r]=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 n=(new t).update(e),r=n.digest();return n.clean(),r}function a(e,n){var r=new o(e).update(n),t=r.digest();return r.clean(),t}function s(e,n,r,t){var o=t[0];if(0===o)throw new Error("hkdf: cannot expand more");n.reset(),o>1&&n.update(e),r&&n.update(r),n.update(t),n.finish(e),t[0]++}e.HMAC=o,e.hash=i,e.default=i,e.hmac=a;var u=new Uint8Array(e.digestLength);e.hkdf=function(e,n,r,t){void 0===n&&(n=u),void 0===t&&(t=32);for(var i=new Uint8Array([1]),c=a(n,e),l=new o(c),f=new Uint8Array(l.digestLength),m=f.length,h=new Uint8Array(t),d=0;d<t;d++)m===f.length&&(s(f,l,r,i),m=0),h[d]=f[m++];return l.clean(),f.fill(0),i.fill(0),h},e.pbkdf2=function(e,n,r,t){for(var i=new o(e),a=i.digestLength,s=new Uint8Array(4),u=new Uint8Array(a),c=new Uint8Array(a),l=new Uint8Array(t),f=0;f*a<t;f++){var m=f+1;s[0]=m>>>24&255,s[1]=m>>>16&255,s[2]=m>>>8&255,s[3]=m>>>0&255,i.reset(),i.update(n),i.update(s),i.finish(c);for(var h=0;h<a;h++)u[h]=c[h];for(h=2;h<=r;h++){i.reset(),i.update(c).finish(c);for(var d=0;d<a;d++)u[d]^=c[d]}for(h=0;h<a&&f*a+h<t;h++)l[f*a+h]=u[h]}for(f=0;f<a;f++)u[f]=c[f]=0;for(f=0;f<4;f++)s[f]=0;return i.clean(),l}}(i);var a=i.default;for(var s in i)a[s]=i[s];"object"==typeof e.exports?e.exports=a:void 0===(t=function(){return a}.call(i,r,i,e))||(e.exports=t)}()},162:function(e){var n;e.exports=(n=function(e,n){var r=Array.prototype.concat,t=Array.prototype.slice,o=Object.prototype.toString;function i(n,r){var t=n>r?n:r;return e.pow(10,17-~~(e.log(t>0?t:-t)*e.LOG10E))}var a=Array.isArray||function(e){return"[object Array]"===o.call(e)};function s(e){return"[object Function]"===o.call(e)}function u(e){return"number"==typeof e&&e-e==0}function c(){return new c._init(arguments)}function l(){return 0}function f(){return 1}function m(e,n){return e===n?1:0}c.fn=c.prototype,c._init=function(e){if(a(e[0]))if(a(e[0][0])){s(e[1])&&(e[0]=c.map(e[0],e[1]));for(var n=0;n<e[0].length;n++)this[n]=e[0][n];this.length=e[0].length}else this[0]=s(e[1])?c.map(e[0],e[1]):e[0],this.length=1;else if(u(e[0]))this[0]=c.seq.apply(null,e),this.length=1;else{if(e[0]instanceof c)return c(e[0].toArray());this[0]=[],this.length=1}return this},c._init.prototype=c.prototype,c._init.constructor=c,c.utils={calcRdx:i,isArray:a,isFunction:s,isNumber:u,toVector:function(e){return r.apply([],e)}},c._random_fn=e.random,c.setRandom=function(e){if("function"!=typeof e)throw new TypeError("fn is not a function");c._random_fn=e},c.extend=function(e){var n,r;if(1===arguments.length){for(r in e)c[r]=e[r];return this}for(n=1;n<arguments.length;n++)for(r in arguments[n])e[r]=arguments[n][r];return e},c.rows=function(e){return e.length||1},c.cols=function(e){return e[0].length||1},c.dimensions=function(e){return{rows:c.rows(e),cols:c.cols(e)}},c.row=function(e,n){return a(n)?n.map((function(n){return c.row(e,n)})):e[n]},c.rowa=function(e,n){return c.row(e,n)},c.col=function(e,n){if(a(n)){var r=c.arange(e.length).map((function(){return new Array(n.length)}));return n.forEach((function(n,t){c.arange(e.length).forEach((function(o){r[o][t]=e[o][n]}))})),r}for(var t=new Array(e.length),o=0;o<e.length;o++)t[o]=[e[o][n]];return t},c.cola=function(e,n){return c.col(e,n).map((function(e){return e[0]}))},c.diag=function(e){for(var n=c.rows(e),r=new Array(n),t=0;t<n;t++)r[t]=[e[t][t]];return r},c.antidiag=function(e){for(var n=c.rows(e)-1,r=new Array(n),t=0;n>=0;n--,t++)r[t]=[e[t][n]];return r},c.transpose=function(e){var n,r,t,o,i,s=[];for(a(e[0])||(e=[e]),r=e.length,t=e[0].length,i=0;i<t;i++){for(n=new Array(r),o=0;o<r;o++)n[o]=e[o][i];s.push(n)}return 1===s.length?s[0]:s},c.map=function(e,n,r){var t,o,i,s,u;for(a(e[0])||(e=[e]),o=e.length,i=e[0].length,s=r?e:new Array(o),t=0;t<o;t++)for(s[t]||(s[t]=new Array(i)),u=0;u<i;u++)s[t][u]=n(e[t][u],t,u);return 1===s.length?s[0]:s},c.cumreduce=function(e,n,r){var t,o,i,s,u;for(a(e[0])||(e=[e]),o=e.length,i=e[0].length,s=r?e:new Array(o),t=0;t<o;t++)for(s[t]||(s[t]=new Array(i)),i>0&&(s[t][0]=e[t][0]),u=1;u<i;u++)s[t][u]=n(s[t][u-1],e[t][u]);return 1===s.length?s[0]:s},c.alter=function(e,n){return c.map(e,n,!0)},c.create=function(e,n,r){var t,o,i=new Array(e);for(s(n)&&(r=n,n=e),t=0;t<e;t++)for(i[t]=new Array(n),o=0;o<n;o++)i[t][o]=r(t,o);return i},c.zeros=function(e,n){return u(n)||(n=e),c.create(e,n,l)},c.ones=function(e,n){return u(n)||(n=e),c.create(e,n,f)},c.rand=function(e,n){return u(n)||(n=e),c.create(e,n,c._random_fn)},c.identity=function(e,n){return u(n)||(n=e),c.create(e,n,m)},c.symmetric=function(e){var n,r,t=e.length;if(e.length!==e[0].length)return!1;for(n=0;n<t;n++)for(r=0;r<t;r++)if(e[r][n]!==e[n][r])return!1;return!0},c.clear=function(e){return c.alter(e,l)},c.seq=function(e,n,r,t){s(t)||(t=!1);var o,a=[],u=i(e,n),c=(n*u-e*u)/((r-1)*u),l=e;for(o=0;l<=n&&o<r;l=(e*u+c*u*++o)/u)a.push(t?t(l,o):l);return a},c.arange=function(e,r,t){var o,i=[];if(t=t||1,r===n&&(r=e,e=0),e===r||0===t)return[];if(e<r&&t<0)return[];if(e>r&&t>0)return[];if(t>0)for(o=e;o<r;o+=t)i.push(o);else for(o=e;o>r;o+=t)i.push(o);return i},c.slice=function(){function e(e,r,t,o){var i,a=[],s=e.length;if(r===n&&t===n&&o===n)return c.copy(e);if(o=o||1,(r=(r=r||0)>=0?r:s+r)===(t=(t=t||e.length)>=0?t:s+t)||0===o)return[];if(r<t&&o<0)return[];if(r>t&&o>0)return[];if(o>0)for(i=r;i<t;i+=o)a.push(e[i]);else for(i=r;i>t;i+=o)a.push(e[i]);return a}return function(n,r){var t,o;return u((r=r||{}).row)?u(r.col)?n[r.row][r.col]:e(c.rowa(n,r.row),(t=r.col||{}).start,t.end,t.step):u(r.col)?e(c.cola(n,r.col),(o=r.row||{}).start,o.end,o.step):(o=r.row||{},t=r.col||{},e(n,o.start,o.end,o.step).map((function(n){return e(n,t.start,t.end,t.step)})))}}(),c.sliceAssign=function(r,t,o){var i,a;if(u(t.row)){if(u(t.col))return r[t.row][t.col]=o;t.col=t.col||{},t.col.start=t.col.start||0,t.col.end=t.col.end||r[0].length,t.col.step=t.col.step||1,i=c.arange(t.col.start,e.min(r.length,t.col.end),t.col.step);var s=t.row;return i.forEach((function(e,n){r[s][e]=o[n]})),r}if(u(t.col)){t.row=t.row||{},t.row.start=t.row.start||0,t.row.end=t.row.end||r.length,t.row.step=t.row.step||1,a=c.arange(t.row.start,e.min(r[0].length,t.row.end),t.row.step);var l=t.col;return a.forEach((function(e,n){r[e][l]=o[n]})),r}return o[0].length===n&&(o=[o]),t.row.start=t.row.start||0,t.row.end=t.row.end||r.length,t.row.step=t.row.step||1,t.col.start=t.col.start||0,t.col.end=t.col.end||r[0].length,t.col.step=t.col.step||1,a=c.arange(t.row.start,e.min(r.length,t.row.end),t.row.step),i=c.arange(t.col.start,e.min(r[0].length,t.col.end),t.col.step),a.forEach((function(e,n){i.forEach((function(t,i){r[e][t]=o[n][i]}))})),r},c.diagonal=function(e){var n=c.zeros(e.length,e.length);return e.forEach((function(e,r){n[r][r]=e})),n},c.copy=function(e){return e.map((function(e){return u(e)?e:e.map((function(e){return e}))}))};var h=c.prototype;return h.length=0,h.push=Array.prototype.push,h.sort=Array.prototype.sort,h.splice=Array.prototype.splice,h.slice=Array.prototype.slice,h.toArray=function(){return this.length>1?t.call(this):t.call(this)[0]},h.map=function(e,n){return c(c.map(this,e,n))},h.cumreduce=function(e,n){return c(c.cumreduce(this,e,n))},h.alter=function(e){return c.alter(this,e),this},function(e){for(var n=0;n<e.length;n++)!function(e){h[e]=function(n){var r,t=this;return n?(setTimeout((function(){n.call(t,h[e].call(t))})),this):(r=c[e](this),a(r)?c(r):r)}}(e[n])}("transpose clear symmetric rows cols dimensions diag antidiag".split(" ")),function(e){for(var n=0;n<e.length;n++)!function(e){h[e]=function(n,r){var t=this;return r?(setTimeout((function(){r.call(t,h[e].call(t,n))})),this):c(c[e](this,n))}}(e[n])}("row col".split(" ")),function(e){for(var n=0;n<e.length;n++)!function(e){h[e]=function(){return c(c[e].apply(null,arguments))}}(e[n])}("create zeros ones rand identity".split(" ")),c}(Math),function(e,n){var r=e.utils.isFunction;function t(e,n){return e-n}function o(e,r,t){return n.max(r,n.min(e,t))}e.sum=function(e){for(var n=0,r=e.length;--r>=0;)n+=e[r];return n},e.sumsqrd=function(e){for(var n=0,r=e.length;--r>=0;)n+=e[r]*e[r];return n},e.sumsqerr=function(n){for(var r,t=e.mean(n),o=0,i=n.length;--i>=0;)o+=(r=n[i]-t)*r;return o},e.sumrow=function(e){for(var n=0,r=e.length;--r>=0;)n+=e[r];return n},e.product=function(e){for(var n=1,r=e.length;--r>=0;)n*=e[r];return n},e.min=function(e){for(var n=e[0],r=0;++r<e.length;)e[r]<n&&(n=e[r]);return n},e.max=function(e){for(var n=e[0],r=0;++r<e.length;)e[r]>n&&(n=e[r]);return n},e.unique=function(e){for(var n={},r=[],t=0;t<e.length;t++)n[e[t]]||(n[e[t]]=!0,r.push(e[t]));return r},e.mean=function(n){return e.sum(n)/n.length},e.meansqerr=function(n){return e.sumsqerr(n)/n.length},e.geomean=function(r){var t=r.map(n.log),o=e.mean(t);return n.exp(o)},e.median=function(e){var n=e.length,r=e.slice().sort(t);return 1&n?r[n/2|0]:(r[n/2-1]+r[n/2])/2},e.cumsum=function(n){return e.cumreduce(n,(function(e,n){return e+n}))},e.cumprod=function(n){return e.cumreduce(n,(function(e,n){return e*n}))},e.diff=function(e){var n,r=[],t=e.length;for(n=1;n<t;n++)r.push(e[n]-e[n-1]);return r},e.rank=function(e){var n,r=[],o={};for(n=0;n<e.length;n++)o[u=e[n]]?o[u]++:(o[u]=1,r.push(u));var i=r.sort(t),a={},s=1;for(n=0;n<i.length;n++){var u,c=o[u=i[n]],l=(s+(s+c-1))/2;a[u]=l,s+=c}return e.map((function(e){return a[e]}))},e.mode=function(e){var n,r=e.length,o=e.slice().sort(t),i=1,a=0,s=0,u=[];for(n=0;n<r;n++)o[n]===o[n+1]?i++:(i>a?(u=[o[n]],a=i,s=0):i===a&&(u.push(o[n]),s++),i=1);return 0===s?u[0]:u},e.range=function(n){return e.max(n)-e.min(n)},e.variance=function(n,r){return e.sumsqerr(n)/(n.length-(r?1:0))},e.pooledvariance=function(n){return n.reduce((function(n,r){return n+e.sumsqerr(r)}),0)/(n.reduce((function(e,n){return e+n.length}),0)-n.length)},e.deviation=function(n){for(var r=e.mean(n),t=n.length,o=new Array(t),i=0;i<t;i++)o[i]=n[i]-r;return o},e.stdev=function(r,t){return n.sqrt(e.variance(r,t))},e.pooledstdev=function(r){return n.sqrt(e.pooledvariance(r))},e.meandev=function(r){for(var t=e.mean(r),o=[],i=r.length-1;i>=0;i--)o.push(n.abs(r[i]-t));return e.mean(o)},e.meddev=function(r){for(var t=e.median(r),o=[],i=r.length-1;i>=0;i--)o.push(n.abs(r[i]-t));return e.median(o)},e.coeffvar=function(n){return e.stdev(n)/e.mean(n)},e.quartiles=function(e){var r=e.length,o=e.slice().sort(t);return[o[n.round(r/4)-1],o[n.round(r/2)-1],o[n.round(3*r/4)-1]]},e.quantiles=function(e,r,i,a){var s,u,c,l,f,m=e.slice().sort(t),h=[r.length],d=e.length;for(void 0===i&&(i=3/8),void 0===a&&(a=3/8),s=0;s<r.length;s++)c=d*(u=r[s])+(i+u*(1-i-a)),l=n.floor(o(c,1,d-1)),f=o(c-l,0,1),h[s]=(1-f)*m[l-1]+f*m[l];return h},e.percentile=function(e,n,r){var o=e.slice().sort(t),i=n*(o.length+(r?1:-1))+(r?0:1),a=parseInt(i),s=i-a;return a+1<o.length?o[a-1]+s*(o[a]-o[a-1]):o[a-1]},e.percentileOfScore=function(e,n,r){var t,o,i=0,a=e.length,s=!1;for("strict"===r&&(s=!0),o=0;o<a;o++)t=e[o],(s&&t<n||!s&&t<=n)&&i++;return i/a},e.histogram=function(r,t){t=t||4;var o,i=e.min(r),a=(e.max(r)-i)/t,s=r.length,u=[];for(o=0;o<t;o++)u[o]=0;for(o=0;o<s;o++)u[n.min(n.floor((r[o]-i)/a),t-1)]+=1;return u},e.covariance=function(n,r){var t,o=e.mean(n),i=e.mean(r),a=n.length,s=new Array(a);for(t=0;t<a;t++)s[t]=(n[t]-o)*(r[t]-i);return e.sum(s)/(a-1)},e.corrcoeff=function(n,r){return e.covariance(n,r)/e.stdev(n,1)/e.stdev(r,1)},e.spearmancoeff=function(n,r){return n=e.rank(n),r=e.rank(r),e.corrcoeff(n,r)},e.stanMoment=function(r,t){for(var o=e.mean(r),i=e.stdev(r),a=r.length,s=0,u=0;u<a;u++)s+=n.pow((r[u]-o)/i,t);return s/r.length},e.skewness=function(n){return e.stanMoment(n,3)},e.kurtosis=function(n){return e.stanMoment(n,4)-3};var i=e.prototype;!function(n){for(var t=0;t<n.length;t++)!function(n){i[n]=function(t,o){var a=[],s=0,u=this;if(r(t)&&(o=t,t=!1),o)return setTimeout((function(){o.call(u,i[n].call(u,t))})),this;if(this.length>1){for(u=!0===t?this:this.transpose();s<u.length;s++)a[s]=e[n](u[s]);return a}return e[n](this[0],t)}}(n[t])}("cumsum cumprod".split(" ")),function(n){for(var t=0;t<n.length;t++)!function(n){i[n]=function(t,o){var a=[],s=0,u=this;if(r(t)&&(o=t,t=!1),o)return setTimeout((function(){o.call(u,i[n].call(u,t))})),this;if(this.length>1){for("sumrow"!==n&&(u=!0===t?this:this.transpose());s<u.length;s++)a[s]=e[n](u[s]);return!0===t?e[n](e.utils.toVector(a)):a}return e[n](this[0],t)}}(n[t])}("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(n){for(var t=0;t<n.length;t++)!function(n){i[n]=function(){var t,o=[],a=0,s=this,u=Array.prototype.slice.call(arguments);if(r(u[u.length-1])){t=u[u.length-1];var c=u.slice(0,u.length-1);return setTimeout((function(){t.call(s,i[n].apply(s,c))})),this}t=void 0;var l=function(r){return e[n].apply(s,[r].concat(u))};if(this.length>1){for(s=s.transpose();a<s.length;a++)o[a]=l(s[a]);return o}return l(this[0])}}(n[t])}("quantiles percentileOfScore".split(" "))}(n,Math),function(e,n){e.gammaln=function(e){var r,t,o,i=0,a=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],s=1.000000000190015;for(o=(t=r=e)+5.5,o-=(r+.5)*n.log(o);i<6;i++)s+=a[i]/++t;return n.log(2.5066282746310007*s/r)-o},e.loggam=function(e){var r,t,o,i,a,s,u,c=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(r=e,u=0,1==e||2==e)return 0;for(e<=7&&(r=e+(u=n.floor(7-e))),t=1/(r*r),o=2*n.PI,a=c[9],s=8;s>=0;s--)a*=t,a+=c[s];if(i=a/r+.5*n.log(o)+(r-.5)*n.log(r)-r,e<=7)for(s=1;s<=u;s++)i-=n.log(r-1),r-=1;return i},e.gammafn=function(e){var r,t,o,i,a=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],s=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],u=!1,c=0,l=0,f=0,m=e;if(e>171.6243769536076)return 1/0;if(m<=0){if(!(i=m%1+36e-17))return 1/0;u=(1&m?-1:1)*n.PI/n.sin(n.PI*i),m=1-m}for(o=m,t=m<1?m++:(m-=c=(0|m)-1)-1,r=0;r<8;++r)f=(f+a[r])*t,l=l*t+s[r];if(i=f/l+1,o<m)i/=o;else if(o>m)for(r=0;r<c;++r)i*=m,m++;return u&&(i=u/i),i},e.gammap=function(n,r){return e.lowRegGamma(n,r)*e.gammafn(n)},e.lowRegGamma=function(r,t){var o,i=e.gammaln(r),a=r,s=1/r,u=s,c=t+1-r,l=1/1e-30,f=1/c,m=f,h=1,d=-~(8.5*n.log(r>=1?r:1/r)+.4*r+17);if(t<0||r<=0)return NaN;if(t<r+1){for(;h<=d;h++)s+=u*=t/++a;return s*n.exp(-t+r*n.log(t)-i)}for(;h<=d;h++)m*=(f=1/(f=(o=-h*(h-r))*f+(c+=2)))*(l=c+o/l);return 1-m*n.exp(-t+r*n.log(t)-i)},e.factorialln=function(n){return n<0?NaN:e.gammaln(n+1)},e.factorial=function(n){return n<0?NaN:e.gammafn(n+1)},e.combination=function(r,t){return r>170||t>170?n.exp(e.combinationln(r,t)):e.factorial(r)/e.factorial(t)/e.factorial(r-t)},e.combinationln=function(n,r){return e.factorialln(n)-e.factorialln(r)-e.factorialln(n-r)},e.permutation=function(n,r){return e.factorial(n)/e.factorial(n-r)},e.betafn=function(r,t){if(!(r<=0||t<=0))return r+t>170?n.exp(e.betaln(r,t)):e.gammafn(r)*e.gammafn(t)/e.gammafn(r+t)},e.betaln=function(n,r){return e.gammaln(n)+e.gammaln(r)-e.gammaln(n+r)},e.betacf=function(e,r,t){var o,i,a,s,u=1e-30,c=1,l=r+t,f=r+1,m=r-1,h=1,d=1-l*e/f;for(n.abs(d)<u&&(d=u),s=d=1/d;c<=100&&(d=1+(i=c*(t-c)*e/((m+(o=2*c))*(r+o)))*d,n.abs(d)<u&&(d=u),h=1+i/h,n.abs(h)<u&&(h=u),s*=(d=1/d)*h,d=1+(i=-(r+c)*(l+c)*e/((r+o)*(f+o)))*d,n.abs(d)<u&&(d=u),h=1+i/h,n.abs(h)<u&&(h=u),s*=a=(d=1/d)*h,!(n.abs(a-1)<3e-7));c++);return s},e.gammapinv=function(r,t){var o,i,a,s,u,c,l=0,f=t-1,m=e.gammaln(t);if(r>=1)return n.max(100,t+100*n.sqrt(t));if(r<=0)return 0;for(t>1?(u=n.log(f),c=n.exp(f*(u-1)-m),s=r<.5?r:1-r,o=(2.30753+.27061*(i=n.sqrt(-2*n.log(s))))/(1+i*(.99229+.04481*i))-i,r<.5&&(o=-o),o=n.max(.001,t*n.pow(1-1/(9*t)-o/(3*n.sqrt(t)),3))):o=r<(i=1-t*(.253+.12*t))?n.pow(r/i,1/t):1-n.log(1-(r-i)/(1-i));l<12;l++){if(o<=0)return 0;if((o-=i=(a=(e.lowRegGamma(t,o)-r)/(i=t>1?c*n.exp(-(o-f)+f*(n.log(o)-u)):n.exp(-o+f*n.log(o)-m)))/(1-.5*n.min(1,a*((t-1)/o-1))))<=0&&(o=.5*(o+i)),n.abs(i)<1e-8*o)break}return o},e.erf=function(e){var r,t,o,i,a=[-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],s=a.length-1,u=!1,c=0,l=0;for(e<0&&(e=-e,u=!0),t=4*(r=2/(2+e))-2;s>0;s--)o=c,c=t*c-l+a[s],l=o;return i=r*n.exp(-e*e+.5*(a[0]+t*c)-l),u?i-1:1-i},e.erfc=function(n){return 1-e.erf(n)},e.erfcinv=function(r){var t,o,i,a,s=0;if(r>=2)return-100;if(r<=0)return 100;for(a=r<1?r:2-r,t=-.70711*((2.30753+.27061*(i=n.sqrt(-2*n.log(a/2))))/(1+i*(.99229+.04481*i))-i);s<2;s++)t+=(o=e.erfc(t)-a)/(1.1283791670955126*n.exp(-t*t)-t*o);return r<1?t:-t},e.ibetainv=function(r,t,o){var i,a,s,u,c,l,f,m,h,d,p=t-1,y=o-1,g=0;if(r<=0)return 0;if(r>=1)return 1;for(t>=1&&o>=1?(s=r<.5?r:1-r,l=(2.30753+.27061*(u=n.sqrt(-2*n.log(s))))/(1+u*(.99229+.04481*u))-u,r<.5&&(l=-l),f=(l*l-3)/6,m=2/(1/(2*t-1)+1/(2*o-1)),h=l*n.sqrt(f+m)/m-(1/(2*o-1)-1/(2*t-1))*(f+5/6-2/(3*m)),l=t/(t+o*n.exp(2*h))):(i=n.log(t/(t+o)),a=n.log(o/(t+o)),l=r<(u=n.exp(t*i)/t)/(h=u+(c=n.exp(o*a)/o))?n.pow(t*h*r,1/t):1-n.pow(o*h*(1-r),1/o)),d=-e.gammaln(t)-e.gammaln(o)+e.gammaln(t+o);g<10;g++){if(0===l||1===l)return l;if((l-=u=(c=(e.ibeta(l,t,o)-r)/(u=n.exp(p*n.log(l)+y*n.log(1-l)+d)))/(1-.5*n.min(1,c*(p/l-y/(1-l)))))<=0&&(l=.5*(l+u)),l>=1&&(l=.5*(l+u+1)),n.abs(u)<1e-8*l&&g>0)break}return l},e.ibeta=function(r,t,o){var i=0===r||1===r?0:n.exp(e.gammaln(t+o)-e.gammaln(t)-e.gammaln(o)+t*n.log(r)+o*n.log(1-r));return!(r<0||r>1)&&(r<(t+1)/(t+o+2)?i*e.betacf(r,t,o)/t:1-i*e.betacf(1-r,o,t)/o)},e.randn=function(r,t){var o,i,a,s,u;if(t||(t=r),r)return e.create(r,t,(function(){return e.randn()}));do{o=e._random_fn(),i=1.7156*(e._random_fn()-.5),u=(a=o-.449871)*a+(s=n.abs(i)+.386595)*(.196*s-.25472*a)}while(u>.27597&&(u>.27846||i*i>-4*n.log(o)*o*o));return i/o},e.randg=function(r,t,o){var i,a,s,u,c,l,f=r;if(o||(o=t),r||(r=1),t)return(l=e.zeros(t,o)).alter((function(){return e.randg(r)})),l;r<1&&(r+=1),i=r-1/3,a=1/n.sqrt(9*i);do{do{u=1+a*(c=e.randn())}while(u<=0);u*=u*u,s=e._random_fn()}while(s>1-.331*n.pow(c,4)&&n.log(s)>.5*c*c+i*(1-u+n.log(u)));if(r==f)return i*u;do{s=e._random_fn()}while(0===s);return n.pow(s,1/f)*i*u},function(n){for(var r=0;r<n.length;r++)!function(n){e.fn[n]=function(){return e(e.map(this,(function(r){return e[n](r)})))}}(n[r])}("gammaln gammafn factorial factorialln".split(" ")),function(n){for(var r=0;r<n.length;r++)!function(n){e.fn[n]=function(){return e(e[n].apply(null,arguments))}}(n[r])}("randn".split(" "))}(n,Math),function(e,n){function r(e,r,t,o){for(var i,a=0,s=1,u=1,c=1,l=0,f=0;n.abs((u-f)/u)>o;)f=u,s=c+(i=-(r+l)*(r+t+l)*e/(r+2*l)/(r+2*l+1))*s,u=(a=u+i*a)+(i=(l+=1)*(t-l)*e/(r+2*l-1)/(r+2*l))*u,a/=c=s+i*c,s/=c,u/=c,c=1;return u/r}function t(r,t,o){var i=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],a=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],s=.5*r;if(s>=8)return 1;var u,c=2*e.normal.cdf(s,0,1,1,0)-1;c=c>=n.exp(-50/o)?n.pow(c,o):0;for(var l=s,f=(8-s)/(u=r>3?2:3),m=l+f,h=0,d=o-1,p=1;p<=u;p++){for(var y=0,g=.5*(m+l),x=.5*(m-l),v=1;v<=12;v++){var _,w=g+x*(6<v?i[(_=12-v+1)-1]:-i[(_=v)-1]),T=w*w;if(T>60)break;var b=2*e.normal.cdf(w,0,1,1,0)*.5-2*e.normal.cdf(w,r,1,1,0)*.5;b>=n.exp(-30/d)&&(y+=b=a[_-1]*n.exp(-.5*T)*n.pow(b,d))}h+=y*=2*x*o/n.sqrt(2*n.PI),l=m,m+=f}return(c+=h)<=n.exp(-30/t)?0:(c=n.pow(c,t))>=1?1:c}!function(n){for(var r=0;r<n.length;r++)!function(n){e[n]=function e(n,r,t){return this instanceof e?(this._a=n,this._b=r,this._c=t,this):new e(n,r,t)},e.fn[n]=function(r,t,o){var i=e[n](r,t,o);return i.data=this,i},e[n].prototype.sample=function(r){var t=this._a,o=this._b,i=this._c;return r?e.alter(r,(function(){return e[n].sample(t,o,i)})):e[n].sample(t,o,i)},function(r){for(var t=0;t<r.length;t++)!function(r){e[n].prototype[r]=function(t){var o=this._a,i=this._b,a=this._c;return t||0===t||(t=this.data),"number"!=typeof t?e.fn.map.call(t,(function(t){return e[n][r](t,o,i,a)})):e[n][r](t,o,i,a)}}(r[t])}("pdf cdf inv".split(" ")),function(r){for(var t=0;t<r.length;t++)!function(r){e[n].prototype[r]=function(){return e[n][r](this._a,this._b,this._c)}}(r[t])}("mean median mode variance".split(" "))}(n[r])}("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(r,t,o){return r>1||r<0?0:1==t&&1==o?1:t<512&&o<512?n.pow(r,t-1)*n.pow(1-r,o-1)/e.betafn(t,o):n.exp((t-1)*n.log(r)+(o-1)*n.log(1-r)-e.betaln(t,o))},cdf:function(n,r,t){return n>1||n<0?1*(n>1):e.ibeta(n,r,t)},inv:function(n,r,t){return e.ibetainv(n,r,t)},mean:function(e,n){return e/(e+n)},median:function(n,r){return e.ibetainv(.5,n,r)},mode:function(e,n){return(e-1)/(e+n-2)},sample:function(n,r){var t=e.randg(n);return t/(t+e.randg(r))},variance:function(e,r){return e*r/(n.pow(e+r,2)*(e+r+1))}}),e.extend(e.centralF,{pdf:function(r,t,o){var i;return r<0?0:t<=2?0===r&&t<2?1/0:0===r&&2===t?1:1/e.betafn(t/2,o/2)*n.pow(t/o,t/2)*n.pow(r,t/2-1)*n.pow(1+t/o*r,-(t+o)/2):(i=t*r/(o+r*t),t*(o/(o+r*t))/2*e.binomial.pdf((t-2)/2,(t+o-2)/2,i))},cdf:function(n,r,t){return n<0?0:e.ibeta(r*n/(r*n+t),r/2,t/2)},inv:function(n,r,t){return t/(r*(1/e.ibetainv(n,r/2,t/2)-1))},mean:function(e,n){return n>2?n/(n-2):void 0},mode:function(e,n){return e>2?n*(e-2)/(e*(n+2)):void 0},sample:function(n,r){return 2*e.randg(n/2)/n/(2*e.randg(r/2)/r)},variance:function(e,n){if(!(n<=4))return 2*n*n*(e+n-2)/(e*(n-2)*(n-2)*(n-4))}}),e.extend(e.cauchy,{pdf:function(e,r,t){return t<0?0:t/(n.pow(e-r,2)+n.pow(t,2))/n.PI},cdf:function(e,r,t){return n.atan((e-r)/t)/n.PI+.5},inv:function(e,r,t){return r+t*n.tan(n.PI*(e-.5))},median:function(e){return e},mode:function(e){return e},sample:function(r,t){return e.randn()*n.sqrt(1/(2*e.randg(.5)))*t+r}}),e.extend(e.chisquare,{pdf:function(r,t){return r<0?0:0===r&&2===t?.5:n.exp((t/2-1)*n.log(r)-r/2-t/2*n.log(2)-e.gammaln(t/2))},cdf:function(n,r){return n<0?0:e.lowRegGamma(r/2,n/2)},inv:function(n,r){return 2*e.gammapinv(n,.5*r)},mean:function(e){return e},median:function(e){return e*n.pow(1-2/(9*e),3)},mode:function(e){return e-2>0?e-2:0},sample:function(n){return 2*e.randg(n/2)},variance:function(e){return 2*e}}),e.extend(e.exponential,{pdf:function(e,r){return e<0?0:r*n.exp(-r*e)},cdf:function(e,r){return e<0?0:1-n.exp(-r*e)},inv:function(e,r){return-n.log(1-e)/r},mean:function(e){return 1/e},median:function(e){return 1/e*n.log(2)},mode:function(){return 0},sample:function(r){return-1/r*n.log(e._random_fn())},variance:function(e){return n.pow(e,-2)}}),e.extend(e.gamma,{pdf:function(r,t,o){return r<0?0:0===r&&1===t?1/o:n.exp((t-1)*n.log(r)-r/o-e.gammaln(t)-t*n.log(o))},cdf:function(n,r,t){return n<0?0:e.lowRegGamma(r,n/t)},inv:function(n,r,t){return e.gammapinv(n,r)*t},mean:function(e,n){return e*n},mode:function(e,n){if(e>1)return(e-1)*n},sample:function(n,r){return e.randg(n)*r},variance:function(e,n){return e*n*n}}),e.extend(e.invgamma,{pdf:function(r,t,o){return r<=0?0:n.exp(-(t+1)*n.log(r)-o/r-e.gammaln(t)+t*n.log(o))},cdf:function(n,r,t){return n<=0?0:1-e.lowRegGamma(r,t/n)},inv:function(n,r,t){return t/e.gammapinv(1-n,r)},mean:function(e,n){return e>1?n/(e-1):void 0},mode:function(e,n){return n/(e+1)},sample:function(n,r){return r/e.randg(n)},variance:function(e,n){if(!(e<=2))return n*n/((e-1)*(e-1)*(e-2))}}),e.extend(e.kumaraswamy,{pdf:function(e,r,t){return 0===e&&1===r?t:1===e&&1===t?r:n.exp(n.log(r)+n.log(t)+(r-1)*n.log(e)+(t-1)*n.log(1-n.pow(e,r)))},cdf:function(e,r,t){return e<0?0:e>1?1:1-n.pow(1-n.pow(e,r),t)},inv:function(e,r,t){return n.pow(1-n.pow(1-e,1/t),1/r)},mean:function(n,r){return r*e.gammafn(1+1/n)*e.gammafn(r)/e.gammafn(1+1/n+r)},median:function(e,r){return n.pow(1-n.pow(2,-1/r),1/e)},mode:function(e,r){if(e>=1&&r>=1&&1!==e&&1!==r)return n.pow((e-1)/(e*r-1),1/e)},variance:function(){throw new Error("variance not yet implemented")}}),e.extend(e.lognormal,{pdf:function(e,r,t){return e<=0?0:n.exp(-n.log(e)-.5*n.log(2*n.PI)-n.log(t)-n.pow(n.log(e)-r,2)/(2*t*t))},cdf:function(r,t,o){return r<0?0:.5+.5*e.erf((n.log(r)-t)/n.sqrt(2*o*o))},inv:function(r,t,o){return n.exp(-1.4142135623730951*o*e.erfcinv(2*r)+t)},mean:function(e,r){return n.exp(e+r*r/2)},median:function(e){return n.exp(e)},mode:function(e,r){return n.exp(e-r*r)},sample:function(r,t){return n.exp(e.randn()*t+r)},variance:function(e,r){return(n.exp(r*r)-1)*n.exp(2*e+r*r)}}),e.extend(e.noncentralt,{pdf:function(r,t,o){return n.abs(o)<1e-14?e.studentt.pdf(r,t):n.abs(r)<1e-14?n.exp(e.gammaln((t+1)/2)-o*o/2-.5*n.log(n.PI*t)-e.gammaln(t/2)):t/r*(e.noncentralt.cdf(r*n.sqrt(1+2/t),t+2,o)-e.noncentralt.cdf(r,t,o))},cdf:function(r,t,o){var i=1e-14;if(n.abs(o)<i)return e.studentt.cdf(r,t);var a=!1;r<0&&(a=!0,o=-o);for(var s=e.normal.cdf(-o,0,1),u=i+1,c=u,l=r*r/(r*r+t),f=0,m=n.exp(-o*o/2),h=n.exp(-o*o/2-.5*n.log(2)-e.gammaln(1.5))*o;f<200||c>i||u>i;)c=u,f>0&&(m*=o*o/(2*f),h*=o*o/(2*(f+.5))),s+=.5*(u=m*e.beta.cdf(l,f+.5,t/2)+h*e.beta.cdf(l,f+1,t/2)),f++;return a?1-s:s}}),e.extend(e.normal,{pdf:function(e,r,t){return n.exp(-.5*n.log(2*n.PI)-n.log(t)-n.pow(e-r,2)/(2*t*t))},cdf:function(r,t,o){return.5*(1+e.erf((r-t)/n.sqrt(2*o*o)))},inv:function(n,r,t){return-1.4142135623730951*t*e.erfcinv(2*n)+r},mean:function(e){return e},median:function(e){return e},mode:function(e){return e},sample:function(n,r){return e.randn()*r+n},variance:function(e,n){return n*n}}),e.extend(e.pareto,{pdf:function(e,r,t){return e<r?0:t*n.pow(r,t)/n.pow(e,t+1)},cdf:function(e,r,t){return e<r?0:1-n.pow(r/e,t)},inv:function(e,r,t){return r/n.pow(1-e,1/t)},mean:function(e,r){if(!(r<=1))return r*n.pow(e,r)/(r-1)},median:function(e,r){return e*(r*n.SQRT2)},mode:function(e){return e},variance:function(e,r){if(!(r<=2))return e*e*r/(n.pow(r-1,2)*(r-2))}}),e.extend(e.studentt,{pdf:function(r,t){return t=t>1e100?1e100:t,1/(n.sqrt(t)*e.betafn(.5,t/2))*n.pow(1+r*r/t,-(t+1)/2)},cdf:function(r,t){var o=t/2;return e.ibeta((r+n.sqrt(r*r+t))/(2*n.sqrt(r*r+t)),o,o)},inv:function(r,t){var o=e.ibetainv(2*n.min(r,1-r),.5*t,.5);return o=n.sqrt(t*(1-o)/o),r>.5?o:-o},mean:function(e){return e>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(r){return e.randn()*n.sqrt(r/(2*e.randg(r/2)))},variance:function(e){return e>2?e/(e-2):e>1?1/0:void 0}}),e.extend(e.weibull,{pdf:function(e,r,t){return e<0||r<0||t<0?0:t/r*n.pow(e/r,t-1)*n.exp(-n.pow(e/r,t))},cdf:function(e,r,t){return e<0?0:1-n.exp(-n.pow(e/r,t))},inv:function(e,r,t){return r*n.pow(-n.log(1-e),1/t)},mean:function(n,r){return n*e.gammafn(1+1/r)},median:function(e,r){return e*n.pow(n.log(2),1/r)},mode:function(e,r){return r<=1?0:e*n.pow((r-1)/r,1/r)},sample:function(r,t){return r*n.pow(-n.log(e._random_fn()),1/t)},variance:function(r,t){return r*r*e.gammafn(1+2/t)-n.pow(e.weibull.mean(r,t),2)}}),e.extend(e.uniform,{pdf:function(e,n,r){return e<n||e>r?0:1/(r-n)},cdf:function(e,n,r){return e<n?0:e<r?(e-n)/(r-n):1},inv:function(e,n,r){return n+e*(r-n)},mean:function(e,n){return.5*(e+n)},median:function(n,r){return e.mean(n,r)},mode:function(){throw new Error("mode is not yet implemented")},sample:function(n,r){return n/2+r/2+(r/2-n/2)*(2*e._random_fn()-1)},variance:function(e,r){return n.pow(r-e,2)/12}}),e.extend(e.binomial,{pdf:function(r,t,o){return 0===o||1===o?t*o===r?1:0:e.combination(t,r)*n.pow(o,r)*n.pow(1-o,t-r)},cdf:function(t,o,i){var a,s=1e-10;if(t<0)return 0;if(t>=o)return 1;if(i<0||i>1||o<=0)return NaN;var u=i,c=(t=n.floor(t))+1,l=o-t,f=c+l,m=n.exp(e.gammaln(f)-e.gammaln(l)-e.gammaln(c)+c*n.log(u)+l*n.log(1-u));return a=u<(c+1)/(f+2)?m*r(u,c,l,s):1-m*r(1-u,l,c,s),n.round(1/s*(1-a))/(1/s)}}),e.extend(e.negbin,{pdf:function(r,t,o){return r===r>>>0&&(r<0?0:e.combination(r+t-1,t-1)*n.pow(1-o,r)*n.pow(o,t))},cdf:function(n,r,t){var o=0,i=0;if(n<0)return 0;for(;i<=n;i++)o+=e.negbin.pdf(i,r,t);return o}}),e.extend(e.hypgeom,{pdf:function(r,t,o,i){if(r!=r|0)return!1;if(r<0||r<o-(t-i))return 0;if(r>i||r>o)return 0;if(2*o>t)return 2*i>t?e.hypgeom.pdf(t-o-i+r,t,t-o,t-i):e.hypgeom.pdf(i-r,t,t-o,i);if(2*i>t)return e.hypgeom.pdf(o-r,t,o,t-i);if(o<i)return e.hypgeom.pdf(r,t,i,o);for(var a=1,s=0,u=0;u<r;u++){for(;a>1&&s<i;)a*=1-o/(t-s),s++;a*=(i-u)*(o-u)/((u+1)*(t-o-i+u+1))}for(;s<i;s++)a*=1-o/(t-s);return n.min(1,n.max(0,a))},cdf:function(r,t,o,i){if(r<0||r<o-(t-i))return 0;if(r>=i||r>=o)return 1;if(2*o>t)return 2*i>t?e.hypgeom.cdf(t-o-i+r,t,t-o,t-i):1-e.hypgeom.cdf(i-r-1,t,t-o,i);if(2*i>t)return 1-e.hypgeom.cdf(o-r-1,t,o,t-i);if(o<i)return e.hypgeom.cdf(r,t,i,o);for(var a=1,s=1,u=0,c=0;c<r;c++){for(;a>1&&u<i;){var l=1-o/(t-u);s*=l,a*=l,u++}a+=s*=(i-c)*(o-c)/((c+1)*(t-o-i+c+1))}for(;u<i;u++)a*=1-o/(t-u);return n.min(1,n.max(0,a))}}),e.extend(e.poisson,{pdf:function(r,t){return t<0||r%1!=0||r<0?0:n.pow(t,r)*n.exp(-t)/e.factorial(r)},cdf:function(n,r){var t=[],o=0;if(n<0)return 0;for(;o<=n;o++)t.push(e.poisson.pdf(o,r));return e.sum(t)},mean:function(e){return e},variance:function(e){return e},sampleSmall:function(r){var t=1,o=0,i=n.exp(-r);do{o++,t*=e._random_fn()}while(t>i);return o-1},sampleLarge:function(r){var t,o,i,a,s,u,c,l,f,m,h=r;for(a=n.sqrt(h),s=n.log(h),u=.02483*(c=.931+2.53*a)-.059,l=1.1239+1.1328/(c-3.4),f=.9277-3.6224/(c-2);;){if(o=n.random()-.5,i=n.random(),m=.5-n.abs(o),t=n.floor((2*u/m+c)*o+h+.43),m>=.07&&i<=f)return t;if(!(t<0||m<.013&&i>m)&&n.log(i)+n.log(l)-n.log(u/(m*m)+c)<=t*s-h-e.loggam(t+1))return t}},sample:function(e){return e<10?this.sampleSmall(e):this.sampleLarge(e)}}),e.extend(e.triangular,{pdf:function(e,n,r,t){return r<=n||t<n||t>r?NaN:e<n||e>r?0:e<t?2*(e-n)/((r-n)*(t-n)):e===t?2/(r-n):2*(r-e)/((r-n)*(r-t))},cdf:function(e,r,t,o){return t<=r||o<r||o>t?NaN:e<=r?0:e>=t?1:e<=o?n.pow(e-r,2)/((t-r)*(o-r)):1-n.pow(t-e,2)/((t-r)*(t-o))},inv:function(e,r,t,o){return t<=r||o<r||o>t?NaN:e<=(o-r)/(t-r)?r+(t-r)*n.sqrt(e*((o-r)/(t-r))):r+(t-r)*(1-n.sqrt((1-e)*(1-(o-r)/(t-r))))},mean:function(e,n,r){return(e+n+r)/3},median:function(e,r,t){return t<=(e+r)/2?r-n.sqrt((r-e)*(r-t))/n.sqrt(2):t>(e+r)/2?e+n.sqrt((r-e)*(t-e))/n.sqrt(2):void 0},mode:function(e,n,r){return r},sample:function(r,t,o){var i=e._random_fn();return i<(o-r)/(t-r)?r+n.sqrt(i*(t-r)*(o-r)):t-n.sqrt((1-i)*(t-r)*(t-o))},variance:function(e,n,r){return(e*e+n*n+r*r-e*n-e*r-n*r)/18}}),e.extend(e.arcsine,{pdf:function(e,r,t){return t<=r?NaN:e<=r||e>=t?0:2/n.PI*n.pow(n.pow(t-r,2)-n.pow(2*e-r-t,2),-.5)},cdf:function(e,r,t){return e<r?0:e<t?2/n.PI*n.asin(n.sqrt((e-r)/(t-r))):1},inv:function(e,r,t){return r+(.5-.5*n.cos(n.PI*e))*(t-r)},mean:function(e,n){return n<=e?NaN:(e+n)/2},median:function(e,n){return n<=e?NaN:(e+n)/2},mode:function(){throw new Error("mode is not yet implemented")},sample:function(r,t){return(r+t)/2+(t-r)/2*n.sin(2*n.PI*e.uniform.sample(0,1))},variance:function(e,r){return r<=e?NaN:n.pow(r-e,2)/8}}),e.extend(e.laplace,{pdf:function(e,r,t){return t<=0?0:n.exp(-n.abs(e-r)/t)/(2*t)},cdf:function(e,r,t){return t<=0?0:e<r?.5*n.exp((e-r)/t):1-.5*n.exp(-(e-r)/t)},mean:function(e){return e},median:function(e){return e},mode:function(e){return e},variance:function(e,n){return 2*n*n},sample:function(r,t){var o,i=e._random_fn()-.5;return r-t*((o=i)/n.abs(o))*n.log(1-2*n.abs(i))}}),e.extend(e.tukey,{cdf:function(r,o,i){var a=o,s=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],u=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(r<=0)return 0;if(i<2||a<2)return NaN;if(!Number.isFinite(r))return 1;if(i>25e3)return t(r,1,a);var c,l=.5*i,f=l*n.log(i)-i*n.log(2)-e.gammaln(l),m=l-1,h=.25*i;c=i<=100?1:i<=800?.5:i<=5e3?.25:.125,f+=n.log(c);for(var d=0,p=1;p<=50;p++){for(var y=0,g=(2*p-1)*c,x=1;x<=16;x++){var v,_;8<x?(v=x-8-1,_=f+m*n.log(g+s[v]*c)-(s[v]*c+g)*h):(v=x-1,_=f+m*n.log(g-s[v]*c)+(s[v]*c-g)*h),_>=-30&&(y+=t(8<x?r*n.sqrt(.5*(s[v]*c+g)):r*n.sqrt(.5*(-s[v]*c+g)),1,a)*u[v]*n.exp(_))}if(p*c>=1&&y<=1e-14)break;d+=y}if(y>1e-14)throw new Error("tukey.cdf failed to converge");return d>1&&(d=1),d},inv:function(r,t,o){if(o<2||t<2)return NaN;if(r<0||r>1)return NaN;if(0===r)return 0;if(1===r)return 1/0;var i,a=function(e,r,t){var o=.5-.5*e,i=n.sqrt(n.log(1/(o*o))),a=i+((((-453642210148e-16*i-.204231210125)*i-.342242088547)*i-1)*i+.322232421088)/((((.0038560700634*i+.10353775285)*i+.531103462366)*i+.588581570495)*i+.099348462606);t<120&&(a+=(a*a*a+a)/t/4);var s=.8832-.2368*a;return t<120&&(s+=-1.214/t+1.208*a/t),a*(s*n.log(r-1)+1.4142)}(r,t,o),s=e.tukey.cdf(a,t,o)-r;i=s>0?n.max(0,a-1):a+1;for(var u,c=e.tukey.cdf(i,t,o)-r,l=1;l<50;l++)if(u=i-c*(i-a)/(c-s),s=c,a=i,u<0&&(u=0,c=-r),c=e.tukey.cdf(u,t,o)-r,i=u,n.abs(i-a)<1e-4)return u;throw new Error("tukey.inv failed to converge")}})}(n,Math),function(e,n){var r,t,o=Array.prototype.push,i=e.utils.isArray;function a(n){return i(n)||n instanceof e}e.extend({add:function(n,r){return a(r)?(a(r[0])||(r=[r]),e.map(n,(function(e,n,t){return e+r[n][t]}))):e.map(n,(function(e){return e+r}))},subtract:function(n,r){return a(r)?(a(r[0])||(r=[r]),e.map(n,(function(e,n,t){return e-r[n][t]||0}))):e.map(n,(function(e){return e-r}))},divide:function(n,r){return a(r)?(a(r[0])||(r=[r]),e.multiply(n,e.inv(r))):e.map(n,(function(e){return e/r}))},multiply:function(n,r){var t,o,i,s,u,c,l,f;if(void 0===n.length&&void 0===r.length)return n*r;if(u=n.length,c=n[0].length,l=e.zeros(u,i=a(r)?r[0].length:c),f=0,a(r)){for(;f<i;f++)for(t=0;t<u;t++){for(s=0,o=0;o<c;o++)s+=n[t][o]*r[o][f];l[t][f]=s}return 1===u&&1===f?l[0][0]:l}return e.map(n,(function(e){return e*r}))},outer:function(n,r){return e.multiply(n.map((function(e){return[e]})),[r])},dot:function(n,r){a(n[0])||(n=[n]),a(r[0])||(r=[r]);for(var t,o,i=1===n[0].length&&1!==n.length?e.transpose(n):n,s=1===r[0].length&&1!==r.length?e.transpose(r):r,u=[],c=0,l=i.length,f=i[0].length;c<l;c++){for(u[c]=[],t=0,o=0;o<f;o++)t+=i[c][o]*s[c][o];u[c]=t}return 1===u.length?u[0]:u},pow:function(r,t){return e.map(r,(function(e){return n.pow(e,t)}))},exp:function(r){return e.map(r,(function(e){return n.exp(e)}))},log:function(r){return e.map(r,(function(e){return n.log(e)}))},abs:function(r){return e.map(r,(function(e){return n.abs(e)}))},norm:function(e,r){var t=0,o=0;for(isNaN(r)&&(r=2),a(e[0])&&(e=e[0]);o<e.length;o++)t+=n.pow(n.abs(e[o]),r);return n.pow(t,1/r)},angle:function(r,t){return n.acos(e.dot(r,t)/(e.norm(r)*e.norm(t)))},aug:function(e,n){var r,t=[];for(r=0;r<e.length;r++)t.push(e[r].slice());for(r=0;r<t.length;r++)o.apply(t[r],n[r]);return t},inv:function(n){for(var r,t=n.length,o=n[0].length,i=e.identity(t,o),a=e.gauss_jordan(n,i),s=[],u=0;u<t;u++)for(s[u]=[],r=o;r<a[0].length;r++)s[u][r-o]=a[u][r];return s},det:function e(n){if(2===n.length)return n[0][0]*n[1][1]-n[0][1]*n[1][0];for(var r=0,t=0;t<n.length;t++){for(var o=[],i=1;i<n.length;i++){o[i-1]=[];for(var a=0;a<n.length;a++)a<t?o[i-1][a]=n[i][a]:a>t&&(o[i-1][a-1]=n[i][a])}var s=t%2?-1:1;r+=e(o)*n[0][t]*s}return r},gauss_elimination:function(r,t){var o,i,a,s,u=0,c=0,l=r.length,f=r[0].length,m=1,h=0,d=[];for(o=(r=e.aug(r,t))[0].length,u=0;u<l;u++){for(i=r[u][u],c=u,s=u+1;s<f;s++)i<n.abs(r[s][u])&&(i=r[s][u],c=s);if(c!=u)for(s=0;s<o;s++)a=r[u][s],r[u][s]=r[c][s],r[c][s]=a;for(c=u+1;c<l;c++)for(m=r[c][u]/r[u][u],s=u;s<o;s++)r[c][s]=r[c][s]-m*r[u][s]}for(u=l-1;u>=0;u--){for(h=0,c=u+1;c<=l-1;c++)h+=d[c]*r[u][c];d[u]=(r[u][o-1]-h)/r[u][u]}return d},gauss_jordan:function(r,t){var o,i,a,s=e.aug(r,t),u=s.length,c=s[0].length,l=0;for(i=0;i<u;i++){var f=i;for(a=i+1;a<u;a++)n.abs(s[a][i])>n.abs(s[f][i])&&(f=a);var m=s[i];for(s[i]=s[f],s[f]=m,a=i+1;a<u;a++)for(l=s[a][i]/s[i][i],o=i;o<c;o++)s[a][o]-=s[i][o]*l}for(i=u-1;i>=0;i--){for(l=s[i][i],a=0;a<i;a++)for(o=c-1;o>i-1;o--)s[a][o]-=s[i][o]*s[a][i]/l;for(s[i][i]/=l,o=u;o<c;o++)s[i][o]/=l}return s},triaUpSolve:function(n,r){var t,o=n[0].length,i=e.zeros(1,o)[0],a=!1;return null!=r[0].length&&(r=r.map((function(e){return e[0]})),a=!0),e.arange(o-1,-1,-1).forEach((function(a){t=e.arange(a+1,o).map((function(e){return i[e]*n[a][e]})),i[a]=(r[a]-e.sum(t))/n[a][a]})),a?i.map((function(e){return[e]})):i},triaLowSolve:function(n,r){var t,o=n[0].length,i=e.zeros(1,o)[0],a=!1;return null!=r[0].length&&(r=r.map((function(e){return e[0]})),a=!0),e.arange(o).forEach((function(o){t=e.arange(o).map((function(e){return n[o][e]*i[e]})),i[o]=(r[o]-e.sum(t))/n[o][o]})),a?i.map((function(e){return[e]})):i},lu:function(n){var r,t=n.length,o=e.identity(t),i=e.zeros(n.length,n[0].length);return e.arange(t).forEach((function(e){i[0][e]=n[0][e]})),e.arange(1,t).forEach((function(a){e.arange(a).forEach((function(t){r=e.arange(t).map((function(e){return o[a][e]*i[e][t]})),o[a][t]=(n[a][t]-e.sum(r))/i[t][t]})),e.arange(a,t).forEach((function(t){r=e.arange(a).map((function(e){return o[a][e]*i[e][t]})),i[a][t]=n[r.length][t]-e.sum(r)}))})),[o,i]},cholesky:function(r){var t,o=r.length,i=e.zeros(r.length,r[0].length);return e.arange(o).forEach((function(a){t=e.arange(a).map((function(e){return n.pow(i[a][e],2)})),i[a][a]=n.sqrt(r[a][a]-e.sum(t)),e.arange(a+1,o).forEach((function(n){t=e.arange(a).map((function(e){return i[a][e]*i[n][e]})),i[n][a]=(r[a][n]-e.sum(t))/i[a][a]}))})),i},gauss_jacobi:function(r,t,o,i){for(var a,s,u,c,l=0,f=0,m=r.length,h=[],d=[],p=[];l<m;l++)for(h[l]=[],d[l]=[],p[l]=[],f=0;f<m;f++)l>f?(h[l][f]=r[l][f],d[l][f]=p[l][f]=0):l<f?(d[l][f]=r[l][f],h[l][f]=p[l][f]=0):(p[l][f]=r[l][f],h[l][f]=d[l][f]=0);for(u=e.multiply(e.multiply(e.inv(p),e.add(h,d)),-1),s=e.multiply(e.inv(p),t),a=o,c=e.add(e.multiply(u,o),s),l=2;n.abs(e.norm(e.subtract(c,a)))>i;)a=c,c=e.add(e.multiply(u,a),s),l++;return c},gauss_seidel:function(r,t,o,i){for(var a,s,u,c,l,f=0,m=r.length,h=[],d=[],p=[];f<m;f++)for(h[f]=[],d[f]=[],p[f]=[],a=0;a<m;a++)f>a?(h[f][a]=r[f][a],d[f][a]=p[f][a]=0):f<a?(d[f][a]=r[f][a],h[f][a]=p[f][a]=0):(p[f][a]=r[f][a],h[f][a]=d[f][a]=0);for(c=e.multiply(e.multiply(e.inv(e.add(p,h)),d),-1),u=e.multiply(e.inv(e.add(p,h)),t),s=o,l=e.add(e.multiply(c,o),u),f=2;n.abs(e.norm(e.subtract(l,s)))>i;)s=l,l=e.add(e.multiply(c,s),u),f+=1;return l},SOR:function(r,t,o,i,a){for(var s,u,c,l,f,m=0,h=r.length,d=[],p=[],y=[];m<h;m++)for(d[m]=[],p[m]=[],y[m]=[],s=0;s<h;s++)m>s?(d[m][s]=r[m][s],p[m][s]=y[m][s]=0):m<s?(p[m][s]=r[m][s],d[m][s]=y[m][s]=0):(y[m][s]=r[m][s],d[m][s]=p[m][s]=0);for(l=e.multiply(e.inv(e.add(y,e.multiply(d,a))),e.subtract(e.multiply(y,1-a),e.multiply(p,a))),c=e.multiply(e.multiply(e.inv(e.add(y,e.multiply(d,a))),t),a),u=o,f=e.add(e.multiply(l,o),c),m=2;n.abs(e.norm(e.subtract(f,u)))>i;)u=f,f=e.add(e.multiply(l,u),c),m++;return f},householder:function(r){for(var t,o,i,a,s=r.length,u=r[0].length,c=0,l=[],f=[];c<s-1;c++){for(t=0,a=c+1;a<u;a++)t+=r[a][c]*r[a][c];for(t=(r[c+1][c]>0?-1:1)*n.sqrt(t),o=n.sqrt((t*t-r[c+1][c]*t)/2),(l=e.zeros(s,1))[c+1][0]=(r[c+1][c]-t)/(2*o),i=c+2;i<s;i++)l[i][0]=r[i][c]/(2*o);f=e.subtract(e.identity(s,u),e.multiply(e.multiply(l,e.transpose(l)),2)),r=e.multiply(f,e.multiply(r,f))}return r},QR:(r=e.sum,t=e.arange,function(o){var i,a,s,u=o.length,c=o[0].length,l=e.zeros(c,c);for(o=e.copy(o),a=0;a<c;a++){for(l[a][a]=n.sqrt(r(t(u).map((function(e){return o[e][a]*o[e][a]})))),i=0;i<u;i++)o[i][a]=o[i][a]/l[a][a];for(s=a+1;s<c;s++)for(l[a][s]=r(t(u).map((function(e){return o[e][a]*o[e][s]}))),i=0;i<u;i++)o[i][s]=o[i][s]-o[i][a]*l[a][s]}return[o,l]}),lstsq:function(n,r){var t=!1;void 0===r[0].length&&(r=r.map((function(e){return[e]})),t=!0);var o=e.QR(n),i=o[0],a=o[1],s=n[0].length,u=e.slice(i,{col:{end:s}}),c=function(n){var r=(n=e.copy(n)).length,t=e.identity(r);return e.arange(r-1,-1,-1).forEach((function(r){e.sliceAssign(t,{row:r},e.divide(e.slice(t,{row:r}),n[r][r])),e.sliceAssign(n,{row:r},e.divide(e.slice(n,{row:r}),n[r][r])),e.arange(r).forEach((function(o){var i=e.multiply(n[o][r],-1),a=e.slice(n,{row:o}),s=e.multiply(e.slice(n,{row:r}),i);e.sliceAssign(n,{row:o},e.add(a,s));var u=e.slice(t,{row:o}),c=e.multiply(e.slice(t,{row:r}),i);e.sliceAssign(t,{row:o},e.add(u,c))}))})),t}(e.slice(a,{row:{end:s}})),l=e.transpose(u);void 0===l[0].length&&(l=[l]);var f=e.multiply(e.multiply(c,l),r);return void 0===f.length&&(f=[[f]]),t?f.map((function(e){return e[0]})):f},jacobi:function(r){for(var t,o,i,a,s,u,c,l=1,f=r.length,m=e.identity(f,f),h=[];1===l;){for(s=r[0][1],i=0,a=1,t=0;t<f;t++)for(o=0;o<f;o++)t!=o&&s<n.abs(r[t][o])&&(s=n.abs(r[t][o]),i=t,a=o);for(u=r[i][i]===r[a][a]?r[i][a]>0?n.PI/4:-n.PI/4:n.atan(2*r[i][a]/(r[i][i]-r[a][a]))/2,(c=e.identity(f,f))[i][i]=n.cos(u),c[i][a]=-n.sin(u),c[a][i]=n.sin(u),c[a][a]=n.cos(u),m=e.multiply(m,c),r=e.multiply(e.multiply(e.inv(c),r),c),l=0,t=1;t<f;t++)for(o=1;o<f;o++)t!=o&&n.abs(r[t][o])>.001&&(l=1)}for(t=0;t<f;t++)h.push(r[t][t]);return[m,h]},rungekutta:function(e,n,r,t,o,i){var a,s,u;if(2===i)for(;t<=r;)o+=((a=n*e(t,o))+(s=n*e(t+n,o+a)))/2,t+=n;if(4===i)for(;t<=r;)o+=((a=n*e(t,o))+2*(s=n*e(t+n/2,o+a/2))+2*(u=n*e(t+n/2,o+s/2))+n*e(t+n,o+u))/6,t+=n;return o},romberg:function(e,r,t,o){for(var i,a,s,u,c,l=0,f=(t-r)/2,m=[],h=[],d=[];l<o/2;){for(c=e(r),s=r,u=0;s<=t;s+=f,u++)m[u]=s;for(i=m.length,s=1;s<i-1;s++)c+=(s%2!=0?4:2)*e(m[s]);c=f/3*(c+e(t)),d[l]=c,f/=2,l++}for(a=d.length,i=1;1!==a;){for(s=0;s<a-1;s++)h[s]=(n.pow(4,i)*d[s+1]-d[s])/(n.pow(4,i)-1);a=h.length,d=h,h=[],i++}return d},richardson:function(e,r,t,o){function i(e,n){for(var r,t=0,o=e.length;t<o;t++)e[t]===n&&(r=t);return r}for(var a,s,u,c,l,f=n.abs(t-e[i(e,t)+1]),m=0,h=[],d=[];o>=f;)a=i(e,t+o),s=i(e,t),h[m]=(r[a]-2*r[s]+r[2*s-a])/(o*o),o/=2,m++;for(c=h.length,u=1;1!=c;){for(l=0;l<c-1;l++)d[l]=(n.pow(4,u)*h[l+1]-h[l])/(n.pow(4,u)-1);c=d.length,h=d,d=[],u++}return h},simpson:function(e,n,r,t){for(var o,i=(r-n)/t,a=e(n),s=[],u=n,c=0,l=1;u<=r;u+=i,c++)s[c]=u;for(o=s.length;l<o-1;l++)a+=(l%2!=0?4:2)*e(s[l]);return i/3*(a+e(r))},hermite:function(e,n,r,t){for(var o,i=e.length,a=0,s=0,u=[],c=[],l=[],f=[];s<i;s++){for(u[s]=1,o=0;o<i;o++)s!=o&&(u[s]*=(t-e[o])/(e[s]-e[o]));for(c[s]=0,o=0;o<i;o++)s!=o&&(c[s]+=1/(e[s]-e[o]));l[s]=(1-2*(t-e[s])*c[s])*(u[s]*u[s]),f[s]=(t-e[s])*(u[s]*u[s]),a+=l[s]*n[s]+f[s]*r[s]}return a},lagrange:function(e,n,r){for(var t,o,i=0,a=0,s=e.length;a<s;a++){for(o=n[a],t=0;t<s;t++)a!=t&&(o*=(r-e[t])/(e[a]-e[t]));i+=o}return i},cubic_spline:function(n,r,t){for(var o,i,a=n.length,s=0,u=[],c=[],l=[],f=[],m=[],h=[];s<a-1;s++)f[s]=n[s+1]-n[s];for(l[0]=0,s=1;s<a-1;s++)l[s]=3/f[s]*(r[s+1]-r[s])-3/f[s-1]*(r[s]-r[s-1]);for(s=1;s<a-1;s++)u[s]=[],c[s]=[],u[s][s-1]=f[s-1],u[s][s]=2*(f[s-1]+f[s]),u[s][s+1]=f[s],c[s][0]=l[s];for(i=e.multiply(e.inv(u),c),o=0;o<a-1;o++)m[o]=(r[o+1]-r[o])/f[o]-f[o]*(i[o+1][0]+2*i[o][0])/3,h[o]=(i[o+1][0]-i[o][0])/(3*f[o]);for(o=0;o<a&&!(n[o]>t);o++);return r[o-=1]+(t-n[o])*m[o]+e.sq(t-n[o])*i[o]+(t-n[o])*e.sq(t-n[o])*h[o]},gauss_quadrature:function(){throw new Error("gauss_quadrature not yet implemented")},PCA:function(n){var r,t,o,i,a,s=n.length,u=n[0].length,c=0,l=[],f=[],m=[],h=[],d=[],p=[],y=[];for(c=0;c<s;c++)l[c]=e.sum(n[c])/u;for(c=0;c<u;c++)for(d[c]=[],r=0;r<s;r++)d[c][r]=n[r][c]-l[r];for(d=e.transpose(d),c=0;c<s;c++)for(p[c]=[],r=0;r<s;r++)p[c][r]=e.dot([d[c]],[d[r]])/(u-1);for(a=(o=e.jacobi(p))[0],f=o[1],y=e.transpose(a),c=0;c<f.length;c++)for(r=c;r<f.length;r++)f[c]<f[r]&&(t=f[c],f[c]=f[r],f[r]=t,m=y[c],y[c]=y[r],y[r]=m);for(i=e.transpose(d),c=0;c<s;c++)for(h[c]=[],r=0;r<i.length;r++)h[c][r]=e.dot([y[c]],[i[r]]);return[n,f,y,h]}}),function(n){for(var r=0;r<n.length;r++)!function(n){e.fn[n]=function(r,t){var o=this;return t?(setTimeout((function(){t.call(o,e.fn[n].call(o,r))}),15),this):"number"==typeof e[n](this,r)?e[n](this,r):e(e[n](this,r))}}(n[r])}("add divide multiply subtract dot pow exp log abs norm angle".split(" "))}(n,Math),function(e,n){var r=[].slice,t=e.utils.isNumber,o=e.utils.isArray;function i(e,r,t,o){if(e>1||t>1||e<=0||t<=0)throw new Error("Proportions should be greater than 0 and less than 1");var i=(e*r+t*o)/(r+o);return(e-t)/n.sqrt(i*(1-i)*(1/r+1/o))}e.extend({zscore:function(){var n=r.call(arguments);return t(n[1])?(n[0]-n[1])/n[2]:(n[0]-e.mean(n[1]))/e.stdev(n[1],n[2])},ztest:function(){var t,i=r.call(arguments);return o(i[1])?(t=e.zscore(i[0],i[1],i[3]),1===i[2]?e.normal.cdf(-n.abs(t),0,1):2*e.normal.cdf(-n.abs(t),0,1)):i.length>2?(t=e.zscore(i[0],i[1],i[2]),1===i[3]?e.normal.cdf(-n.abs(t),0,1):2*e.normal.cdf(-n.abs(t),0,1)):(t=i[0],1===i[1]?e.normal.cdf(-n.abs(t),0,1):2*e.normal.cdf(-n.abs(t),0,1))}}),e.extend(e.fn,{zscore:function(e,n){return(e-this.mean())/this.stdev(n)},ztest:function(r,t,o){var i=n.abs(this.zscore(r,o));return 1===t?e.normal.cdf(-i,0,1):2*e.normal.cdf(-i,0,1)}}),e.extend({tscore:function(){var t=r.call(arguments);return 4===t.length?(t[0]-t[1])/(t[2]/n.sqrt(t[3])):(t[0]-e.mean(t[1]))/(e.stdev(t[1],!0)/n.sqrt(t[1].length))},ttest:function(){var o,i=r.call(arguments);return 5===i.length?(o=n.abs(e.tscore(i[0],i[1],i[2],i[3])),1===i[4]?e.studentt.cdf(-o,i[3]-1):2*e.studentt.cdf(-o,i[3]-1)):t(i[1])?(o=n.abs(i[0]),1==i[2]?e.studentt.cdf(-o,i[1]-1):2*e.studentt.cdf(-o,i[1]-1)):(o=n.abs(e.tscore(i[0],i[1])),1==i[2]?e.studentt.cdf(-o,i[1].length-1):2*e.studentt.cdf(-o,i[1].length-1))}}),e.extend(e.fn,{tscore:function(e){return(e-this.mean())/(this.stdev(!0)/n.sqrt(this.cols()))},ttest:function(r,t){return 1===t?1-e.studentt.cdf(n.abs(this.tscore(r)),this.cols()-1):2*e.studentt.cdf(-n.abs(this.tscore(r)),this.cols()-1)}}),e.extend({anovafscore:function(){var t,o,i,a,s,u,c,l,f=r.call(arguments);if(1===f.length){for(s=new Array(f[0].length),c=0;c<f[0].length;c++)s[c]=f[0][c];f=s}for(o=new Array,c=0;c<f.length;c++)o=o.concat(f[c]);for(i=e.mean(o),t=0,c=0;c<f.length;c++)t+=f[c].length*n.pow(e.mean(f[c])-i,2);for(t/=f.length-1,u=0,c=0;c<f.length;c++)for(a=e.mean(f[c]),l=0;l<f[c].length;l++)u+=n.pow(f[c][l]-a,2);return t/(u/(o.length-f.length))},anovaftest:function(){var n,o,i,a,s=r.call(arguments);if(t(s[0]))return 1-e.centralF.cdf(s[0],s[1],s[2]);var u=e.anovafscore(s);for(n=s.length-1,i=0,a=0;a<s.length;a++)i+=s[a].length;return o=i-n-1,1-e.centralF.cdf(u,n,o)},ftest:function(n,r,t){return 1-e.centralF.cdf(n,r,t)}}),e.extend(e.fn,{anovafscore:function(){return e.anovafscore(this.toArray())},anovaftes:function(){var n,r=0;for(n=0;n<this.length;n++)r+=this[n].length;return e.ftest(this.anovafscore(),this.length-1,r-this.length)}}),e.extend({qscore:function(){var o,i,a,s,u,c=r.call(arguments);return t(c[0])?(o=c[0],i=c[1],a=c[2],s=c[3],u=c[4]):(o=e.mean(c[0]),i=e.mean(c[1]),a=c[0].length,s=c[1].length,u=c[2]),n.abs(o-i)/(u*n.sqrt((1/a+1/s)/2))},qtest:function(){var n,t=r.call(arguments);3===t.length?(n=t[0],t=t.slice(1)):7===t.length?(n=e.qscore(t[0],t[1],t[2],t[3],t[4]),t=t.slice(5)):(n=e.qscore(t[0],t[1],t[2]),t=t.slice(3));var o=t[0],i=t[1];return 1-e.tukey.cdf(n,i,o-i)},tukeyhsd:function(n){for(var r=e.pooledstdev(n),t=n.map((function(n){return e.mean(n)})),o=n.reduce((function(e,n){return e+n.length}),0),i=[],a=0;a<n.length;++a)for(var s=a+1;s<n.length;++s){var u=e.qtest(t[a],t[s],n[a].length,n[s].length,r,o,n.length);i.push([[a,s],u])}return i}}),e.extend({normalci:function(){var t,o=r.call(arguments),i=new Array(2);return t=4===o.length?n.abs(e.normal.inv(o[1]/2,0,1)*o[2]/n.sqrt(o[3])):n.abs(e.normal.inv(o[1]/2,0,1)*e.stdev(o[2])/n.sqrt(o[2].length)),i[0]=o[0]-t,i[1]=o[0]+t,i},tci:function(){var t,o=r.call(arguments),i=new Array(2);return t=4===o.length?n.abs(e.studentt.inv(o[1]/2,o[3]-1)*o[2]/n.sqrt(o[3])):n.abs(e.studentt.inv(o[1]/2,o[2].length-1)*e.stdev(o[2],!0)/n.sqrt(o[2].length)),i[0]=o[0]-t,i[1]=o[0]+t,i},significant:function(e,n){return e<n}}),e.extend(e.fn,{normalci:function(n,r){return e.normalci(n,r,this.toArray())},tci:function(n,r){return e.tci(n,r,this.toArray())}}),e.extend(e.fn,{oneSidedDifferenceOfProportions:function(n,r,t,o){var a=i(n,r,t,o);return e.ztest(a,1)},twoSidedDifferenceOfProportions:function(n,r,t,o){var a=i(n,r,t,o);return e.ztest(a,2)}})}(n,Math),n.models=function(){function e(e,r){var t=e.length,o=r[0].length-1,i=t-o-1,a=n.lstsq(r,e),s=n.multiply(r,a.map((function(e){return[e]}))).map((function(e){return e[0]})),u=n.subtract(e,s),c=n.mean(e),l=n.sum(s.map((function(e){return Math.pow(e-c,2)}))),f=n.sum(e.map((function(e,n){return Math.pow(e-s[n],2)}))),m=l+f;return{exog:r,endog:e,nobs:t,df_model:o,df_resid:i,coef:a,predict:s,resid:u,ybar:c,SST:m,SSE:l,SSR:f,R2:l/m}}function r(r){var t,o,i=(t=r.exog,o=t[0].length,n.arange(o).map((function(r){var i=n.arange(o).filter((function(e){return e!==r}));return e(n.col(t,r).map((function(e){return e[0]})),n.col(t,i))}))),a=Math.sqrt(r.SSR/r.df_resid),s=i.map((function(e){var n=e.SST,r=e.R2;return a/Math.sqrt(n*(1-r))})),u=r.coef.map((function(e,n){return(e-0)/s[n]})),c=u.map((function(e){var t=n.studentt.cdf(e,r.df_resid);return 2*(t>.5?1-t:t)})),l=n.studentt.inv(.975,r.df_resid),f=r.coef.map((function(e,n){var r=l*s[n];return[e-r,e+r]}));return{se:s,t:u,p:c,sigmaHat:a,interval95:f}}return{ols:function(t,o){var i=e(t,o),a=r(i),s=function(e){var r,t,o,i=e.R2/e.df_model/((1-e.R2)/e.df_resid);return{F_statistic:i,pvalue:1-(r=i,t=e.df_model,o=e.df_resid,n.beta.cdf(r/(o/t+r),t/2,o/2))}}(i),u=1-(1-i.R2)*((i.nobs-1)/i.df_resid);return i.t=a,i.f=s,i.adjust_R2=u,i}}}(),n.extend({buildxmatrix:function(){for(var e=new Array(arguments.length),r=0;r<arguments.length;r++)e[r]=[1].concat(arguments[r]);return n(e)},builddxmatrix:function(){for(var e=new Array(arguments[0].length),r=0;r<arguments[0].length;r++)e[r]=[1].concat(arguments[0][r]);return n(e)},buildjxmatrix:function(e){for(var r=new Array(e.length),t=0;t<e.length;t++)r[t]=e[t];return n.builddxmatrix(r)},buildymatrix:function(e){return n(e).transpose()},buildjymatrix:function(e){return e.transpose()},matrixmult:function(e,r){var t,o,i,a,s;if(e.cols()==r.rows()){if(r.rows()>1){for(a=[],t=0;t<e.rows();t++)for(a[t]=[],o=0;o<r.cols();o++){for(s=0,i=0;i<e.cols();i++)s+=e.toArray()[t][i]*r.toArray()[i][o];a[t][o]=s}return n(a)}for(a=[],t=0;t<e.rows();t++)for(a[t]=[],o=0;o<r.cols();o++){for(s=0,i=0;i<e.cols();i++)s+=e.toArray()[t][i]*r.toArray()[o];a[t][o]=s}return n(a)}},regress:function(e,r){var t=n.xtranspxinv(e),o=e.transpose(),i=n.matrixmult(n(t),o);return n.matrixmult(i,r)},regresst:function(e,r,t){var o=n.regress(e,r),i={anova:{}},a=n.jMatYBar(e,o);i.yBar=a;var s=r.mean();i.anova.residuals=n.residuals(r,a),i.anova.ssr=n.ssr(a,s),i.anova.msr=i.anova.ssr/(e[0].length-1),i.anova.sse=n.sse(r,a),i.anova.mse=i.anova.sse/(r.length-(e[0].length-1)-1),i.anova.sst=n.sst(r,s),i.anova.mst=i.anova.sst/(r.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=n.anovaftest(i.anova.fratio,e[0].length-1,r.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 u,c,l,f=n.xtranspxinv(e),m=0;m<o.length;m++)u=Math.sqrt(i.anova.mse*Math.abs(f[m][m])),c=Math.abs(o[m]/u),l=n.ttest(c,r.length-e[0].length-1,t),i.stats[m]=[o[m],u,c,l];return i.regress=o,i},xtranspx:function(e){return n.matrixmult(e.transpose(),e)},xtranspxinv:function(e){var r=n.matrixmult(e.transpose(),e);return n.inv(r)},jMatYBar:function(e,r){var t=n.matrixmult(e,r);return new n(t)},residuals:function(e,r){return n.matrixsubtract(e,r)},ssr:function(e,n){for(var r=0,t=0;t<e.length;t++)r+=Math.pow(e[t]-n,2);return r},sse:function(e,n){for(var r=0,t=0;t<e.length;t++)r+=Math.pow(e[t]-n[t],2);return r},sst:function(e,n){for(var r=0,t=0;t<e.length;t++)r+=Math.pow(e[t]-n,2);return r},matrixsubtract:function(e,r){for(var t=new Array(e.length),o=0;o<e.length;o++){t[o]=new Array(e[o].length);for(var i=0;i<e[o].length;i++)t[o][i]=e[o][i]-r[o][i]}return n(t)}}),n.jStat=n,n)},184:(e,n,r)=>{"use strict";r.d(n,{$:()=>a});var t=r(976),o=r(870),i=r(874);class a extends t.JsViewer{constructor(e){super(),this.canvas=o.canvas(),this.gridCellStyle=t.GridCellStyle.create(),this.renderer=e,this.root.append(this.canvas),this.canvas.style.width="100%",this.canvas.style.height="100%",o.tools.handleResize(this.canvas,((e,n)=>{this.canvas.width=e,this.canvas.height=n,this.render()}));const n=e=>n=>{this.gridCell&&e(this.gridCell,n)};this.canvas.onmousemove=n(this.renderer.onMouseMove),this.canvas.onmouseenter=n(this.renderer.onMouseEnter),this.canvas.onmouseleave=n(this.renderer.onMouseLeave)}static fromGridCell(e){const n=new a(new i.cv);return n.gridCell=e,n.render(),n}render(){if(!this.gridCell)return;const e=this.canvas.getContext("2d");e.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderer.renderInternal(e,0,0,this.canvas.width,this.canvas.height,this.gridCell.dart,this.gridCellStyle)}}},638:(e,n,r)=>{"use strict";r.d(n,{d:()=>t});class t{}t.CELL_DEFAULT_WIDTH=230,t.CELL_DEFAULT_HEIGHT=160,t.TAG_FIT_CHART_FORMAT=".fitChartFormat",t.TAG_FIT_CHART_FORMAT_3DX="3dx",t.MIN_CELL_RENDERER_PX_WIDTH=20,t.MIN_CELL_RENDERER_PX_HEIGHT=10,t.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH=70,t.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT=45,t.OUTLIER_PX_SIZE=12,t.POINT_PX_SIZE=4,t.OUTLIER_HITBOX_RADIUS=2,t.MIN_AXES_CELL_PX_WIDTH=100,t.MIN_AXES_CELL_PX_HEIGHT=55,t.MIN_TITLE_PX_WIDTH=275,t.MIN_TITLE_PX_HEIGHT=225,t.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH=180,t.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT=140,t.MIN_LEGEND_PX_WIDTH=325,t.MIN_LEGEND_PX_HEIGHT=275,t.MIN_DROPLINES_VISIBILITY_PX_WIDTH=120,t.MIN_DROPLINES_VISIBILITY_PX_HEIGHT=110,t.AXES_LEFT_PX_MARGIN=38,t.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS=45,t.AXES_TOP_PX_MARGIN=5,t.AXES_TOP_PX_MARGIN_WITH_TITLE=25,t.AXES_RIGHT_PX_MARGIN=18,t.AXES_BOTTOM_PX_MARGIN=15,t.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS=30,t.X_AXIS_LABEL_BOTTOM_PX_MARGIN=4,t.CANDLESTICK_BORDER_PX_SIZE=4,t.CANDLESTICK_MEDIAN_PX_SIZE=3.5,t.CANDLESTICK_OUTLIER_PX_SIZE=6,t.INFLATE_SIZE=-6,t.LEGEND_TOP_PX_MARGIN=10,t.LEGEND_RECORD_PX_HEIGHT=18,t.LEGEND_RECORD_LINE_PX_WIDTH=20,t.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN=5,t.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN=4,t.LINE_STYLES={solid:[],dotted:[1,1],dashed:[5,5],dashdotted:[5,5,2,5]},t.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 n;return 0===(null===(n=e.points)||void 0===n?void 0:n.length)})),"There were series with all x zeroes":e=>e.some((e=>{var n;return null===(n=e.points)||void 0===n?void 0:n.every((e=>0===e.x))})),"There were series with all y zeroes":e=>e.some((e=>{var n;return null===(n=e.points)||void 0===n?void 0:n.every((e=>0===e.y))}))}},840:(e,n,r)=>{"use strict";r.d(n,{YC:()=>u,lf:()=>c});var t=r(976),o=(r(469),r(363),r(875)),i=r(414),a=r.n(i);function s(e,n){return Math.random()*(n-e)+e}function u(e,n,r=1){const t=new Float32Array(e*r),i=new Float32Array(e*r),a=[s(1,2),s(1,2),s(1,2),s(-5,5)],u=0-Math.floor(e/2)*n,c=u+n*(e-1);for(let e=u,s=0;e<=c;e+=n,s++)for(let n=0;n<r;n++)t[s*r+n]=e-u+.1,i[s*r+n]=(0,o.Hg)(a,e);const l=(1===r?.2:.4)*(Math.max(...i)-Math.min(...i)),f=Math.min(...i);for(let e=0;e<t.length;e++)i[e]=-f+i[e]+s(0,l);return{x:t,y:i,params:a}}function c(e,n,r){var i;const s=t.DataFrame.create(e);for(let c=0;c<n;c++){const n=3===c?5:1,l=s.columns.addNewString(`json chart ${c}`);l.semType=o.j2;let f=c%2==0?r:1;for(let o=0;o<e;o++){const e={series:[],chartOptions:{showStatistics:1===f?["auc"]:[],xAxisName:"Conc.",yAxisName:"Activity",title:"Dose-Response curves"}};for(let o=0;o<f;o++){const s=u(15,.5,n);let l=t.Color.toHtml(t.Color.getCategoricalColor(c*r+o));null===(i=e.series)||void 0===i||i.push({parameters:void 0,fitLineColor:l,pointColor:l,showCurveConfidenceInterval:1===f,points:a().count().take(15*n).map((function(e){return{x:s.x[e],y:s.y[e]}})).toArray()})}l.set(o,JSON.stringify(e))}}return s}},188:(e,n,r)=>{"use strict";r.d(n,{No:()=>u,hS:()=>s});var t,o=r(976),i=(r(870),r(416));r(875),r(874),r(184),r(711),r(638),function(e){e.DATAFRAME="Dataframe",e.COLUMN="Column",e.CELL="Cell"}(t||(t={}));const a={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 s(e,n){const r=(0,i.Y6)(e);return e.parameters?n.logX&&e.parameters[2]>0&&(e.parameters[2]=Math.log10(e.parameters[2])):e.parameters=(0,i.PK)(e,r,n).parameters,(0,i.tq)(e,r,n)}function u(e,n){var r,t,i;const u={logX:null===(r=e.chartOptions)||void 0===r?void 0:r.logX,logY:null===(t=e.chartOptions)||void 0===t?void 0:t.logY},c=[],l=[],f=[],m=[],h=[],d=[],p=[];for(let n=0,r=0;n<(null===(i=e.series)||void 0===i?void 0:i.length);n++){if(e.series[n].points.every((e=>e.outlier)))continue;const t=s(e.series[n],u);c[r]=t.rSquared,l[r]=t.auc,f[r]=t.interceptX,m[r]=t.interceptY,h[r]=t.slope,d[r]=t.top,p[r]=t.bottom,r++}return{rSquared:o.Stats.fromValues(c)[a[n]],auc:o.Stats.fromValues(l)[a[n]],interceptX:o.Stats.fromValues(f)[a[n]],interceptY:o.Stats.fromValues(m)[a[n]],slope:o.Stats.fromValues(h)[a[n]],top:o.Stats.fromValues(d)[a[n]],bottom:o.Stats.fromValues(p)[a[n]]}}o.ObjectHandler},711:(e,n,r)=>{"use strict";r.d(n,{f:()=>c});var t=r(976),o=r(875);const i={x:"xAxis",y:"yAxis"},a={min:"min",max:"max"};function s(e){var n,r,i;const a=null===(r=null===(n=e.getElementsByTagName("params")[0])||void 0===n?void 0:n.childNodes[0].nodeValue)||void 0===r?void 0:r.split(",").map(Number);let s=null===(i=e.getElementsByTagName("function")[0])||void 0===i?void 0:i.getAttribute("type");s=s&&"sigif"!==s?s:o.yB;const u=e.getElementsByTagName("settings")[0].getAttribute("markerColor"),c=e.getElementsByTagName("settings")[0].getAttribute("color"),l=!!e.getElementsByTagName("settings")[0].getAttribute("drawLine"),f={name:e.getAttribute("name"),fitFunction:s,markerType:t.MARKER_TYPE.CIRCLE,pointColor:u,fitLineColor:c,showFitLine:l,showPoints:"points",showCurveConfidenceInterval:!1,clickToToggle:!1};return a&&(f.parameters=[a[2],a[1],a[0],a[3]]),f}function u(e){const n=function(e){var n,r,t;const o=null===(n=e.getElementsByTagName("x")[0].childNodes[0].nodeValue)||void 0===n?void 0:n.split(","),i=null===(r=e.getElementsByTagName("y")[0].childNodes[0].nodeValue)||void 0===r?void 0:r.split(","),a=null===(t=e.getElementsByTagName("mask")[0].childNodes[0].nodeValue)||void 0===t?void 0:t.split(""),s=[];for(let e=0;e<o.length;e++)s[e]={x:+o[e],y:+i[e],outlier:!Boolean(a[e])};return s}(e),r=s(e),t={points:n};return Object.assign(t,r),t}function c(e){const n=(new DOMParser).parseFromString(e,"text/xml"),r=n.getElementsByTagName("grid")[0],t=(c=n.getElementsByTagName("settings")[0],{minX:+(o=r).getElementsByTagName(i.x)[0].getAttribute(a.min),minY:+o.getElementsByTagName(i.y)[0].getAttribute(a.min),maxX:+o.getElementsByTagName(i.x)[0].getAttribute(a.max),maxY:+o.getElementsByTagName(i.y)[0].getAttribute(a.max),xAxisName:c.getAttribute("xLabel"),yAxisName:c.getAttribute("yLabel"),logX:!!c.getAttribute("logX")});var o,c;const l=n.getElementsByTagName("seriesCollection")[0],f=s(l.getElementsByTagName("series")[0]),m=function(e){const n=[],r=e.getElementsByTagName("series").length;for(let t=0;t<r;t++){const r=e.getElementsByTagName("series")[t];n[t]=u(r)}return n}(l);return{chartOptions:t,seriesOptions:f,series:m}}},874:(e,n,r)=>{"use strict";r.d(n,{cv:()=>R,W$:()=>P,fi:()=>O,Ce:()=>L,BI:()=>N,kb:()=>k});var t=r(976),o=r(469),i=r(870),a=r(875),s=r(766),u=r(416),c=r(711),l=r(184),f=r(188),m=r(638),h=r(111);const d=window,p=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});class y{static getUniqueName(e,n,r){return d.grok_Utils_GetUniqueName(e,n,null==r?void 0:r.auto,null==r?void 0:r.idx,null==r?void 0:r.render,null==r?void 0:r.choices)}static isEmpty(e){return null==e||""==e}static formatNumber(e){return p.format(e)}}function g(e,n){const r=e.pointColor&&t.Color.fromHtml(e.pointColor)?e.pointColor:t.Color.toHtml(t.Color.getCategoricalColor(n)),o=e.outlierColor&&t.Color.fromHtml(e.outlierColor)?e.outlierColor:t.Color.toHtml(t.Color.red),i=e.fitLineColor&&t.Color.fromHtml(e.fitLineColor)?e.fitLineColor:t.Color.toHtml(t.Color.getCategoricalColor(n));e.pointColor=r,e.outlierColor=o,e.fitLineColor=i}function x(e,n,r){var t;if(null!==(t=n.connectDots)&&void 0!==t&&t){e.strokeStyle=n.pointColor,e.lineWidth=2*r.ratio,e.beginPath();for(let t=0;t<n.points.length;t++){const o=n.points[t].x,i=n.points[t].y,a=r.viewport.xToScreen(o),s=r.viewport.yToScreen(i);0===t?e.moveTo(a,s):e.lineTo(a,s)}e.stroke()}}function v(e,n,r){var o;(null===(o=n.showPoints)||void 0===o||o)&&(e.strokeStyle=n.pointColor,n.connectDots&&""!==n.showPoints||"points"===n.showPoints?function(e,n,r){for(let o=0;o<n.points.length;o++){const i=n.points[o],a=n.connectDots?n.pointColor:i.outlier?i.outlierColor&&t.Color.fromHtml(i.outlierColor)?i.outlierColor:n.outlierColor:i.color&&t.Color.fromHtml(i.color)?i.color:n.pointColor,s=i.marker?i.marker:n.markerType,u=n.connectDots?m.d.POINT_PX_SIZE*r.ratio:i.outlier?m.d.OUTLIER_PX_SIZE*r.ratio:i.size?i.size:m.d.POINT_PX_SIZE*r.ratio;t.Paint.marker(e,n.connectDots?s:i.outlier?t.MARKER_TYPE.OUTLIER:s,r.viewport.xToScreen(i.x),r.viewport.yToScreen(i.y),a,u),i.stdev&&!i.outlier&&(e.strokeStyle=a,e.beginPath(),e.moveTo(r.viewport.xToScreen(i.x),r.viewport.yToScreen(i.y+i.stdev)),e.lineTo(r.viewport.xToScreen(i.x),r.viewport.yToScreen(i.y-i.stdev)),e.stroke())}}(e,n,r):["candlesticks","both"].includes(n.showPoints)&&function(e,n,r){for(let o=0,i=null;o<n.points.length;o++){const a=n.points[o];if(a.outlier)continue;const s=o+1<n.points.length&&n.points[o+1].x===a.x;if(!i&&s)i=o;else if(null!==i&&!s){const s=[];for(let e=i,r=0;e<=o;e++,r++)s[r]=n.points[e].y;const u=(0,h.G)(s);if(e.beginPath(),_(e,{viewport:r.viewport,ratio:r.ratio,x:a.x,boxPlotStats:u,color:n.pointColor}),e.stroke(),"both"===n.showPoints)for(let o=0;o<s.length;o++)(s[o]<u.lowerAdjacentValue||s[o]>u.upperAdjacentValue)&&t.Paint.marker(e,t.MARKER_TYPE.OUTLIER,r.viewport.xToScreen(a.x),r.viewport.yToScreen(s[o]),n.pointColor,m.d.CANDLESTICK_OUTLIER_PX_SIZE*r.ratio);i=null}}}(e,n,r))}function _(e,n){w(e,n.x,n.boxPlotStats.lowerAdjacentValue,n.viewport),e.moveTo(n.viewport.xToScreen(n.x),n.viewport.yToScreen(n.boxPlotStats.lowerAdjacentValue)),e.lineTo(n.viewport.xToScreen(n.x),n.viewport.yToScreen(n.boxPlotStats.upperAdjacentValue)),w(e,n.x,n.boxPlotStats.upperAdjacentValue,n.viewport),t.Paint.marker(e,t.MARKER_TYPE.CIRCLE,n.viewport.xToScreen(n.x),n.viewport.yToScreen(n.boxPlotStats.q2),n.color,m.d.CANDLESTICK_MEDIAN_PX_SIZE*n.ratio)}function w(e,n,r,t){e.moveTo(t.xToScreen(n)-m.d.CANDLESTICK_BORDER_PX_SIZE/2,t.yToScreen(r)),e.lineTo(t.xToScreen(n)+m.d.CANDLESTICK_BORDER_PX_SIZE/2,t.yToScreen(r))}function T(e,n,r){var t;if(null===(t=n.showFitLine)||void 0===t||t){e.save(),e.strokeStyle=n.fitLineColor,e.lineWidth=2*r.ratio,e.beginPath(),n.lineStyle&&e.setLineDash(m.d.LINE_STYLES[n.lineStyle]);const t=r.showAxes?r.showAxesLabels?m.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:m.d.AXES_LEFT_PX_MARGIN:0,o=r.showAxes?m.d.AXES_RIGHT_PX_MARGIN:0;for(let n=t;n<=r.screenBounds.width-o;n++){const o=r.screenBounds.x+n,i=r.logOptions.logX?Math.log10(r.viewport.xToWorld(o)):r.viewport.xToWorld(o),a=r.logOptions.logY?r.viewport.yToScreen(Math.pow(10,r.curveFunc(i))):r.viewport.yToScreen(r.curveFunc(i));n===t?e.moveTo(o,a):e.lineTo(o,a)}e.stroke(),e.restore()}}function b(e,n,r){var t,o,i,s;if((null===(t=n.showFitLine)||void 0===t||t)&&null!==(o=n.showCurveConfidenceInterval)&&void 0!==o&&o){e.strokeStyle=null!==(i=n.confidenceIntervalColor)&&void 0!==i?i:a.Qc,e.fillStyle=null!==(s=n.confidenceIntervalColor)&&void 0!==s?s:a.XD;const t=(0,u.LC)(n,r.fitFunc,r.userParamsFlag,r.logOptions);A(e,{viewport:r.viewport,logOptions:r.logOptions,showAxes:r.showAxes,showAxesLabels:r.showAxesLabels,screenBounds:r.screenBounds,confidenceIntervals:t,confidenceType:a.vK.TOP}),A(e,{viewport:r.viewport,logOptions:r.logOptions,showAxes:r.showAxes,showAxesLabels:r.showAxesLabels,screenBounds:r.screenBounds,confidenceIntervals:t,confidenceType:a.vK.BOTTOM}),function(e,n){e.beginPath();const r=n.showAxes?n.showAxesLabels?m.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:m.d.AXES_LEFT_PX_MARGIN:0,t=n.showAxes?m.d.AXES_RIGHT_PX_MARGIN:0;for(let o=r;o<=n.screenBounds.width-t;o++){const t=n.screenBounds.x+o,i=n.logOptions.logX?Math.log10(n.viewport.xToWorld(t)):n.viewport.xToWorld(t),a=n.logOptions.logY?n.viewport.yToScreen(Math.pow(10,n.confidenceIntervals.confidenceTop(i))):n.viewport.yToScreen(n.confidenceIntervals.confidenceTop(i));o===r?e.moveTo(t,a):e.lineTo(t,a)}for(let o=n.screenBounds.width-t;o>=r;o--){const r=n.screenBounds.x+o,t=n.logOptions.logX?Math.log10(n.viewport.xToWorld(r)):n.viewport.xToWorld(r),i=n.logOptions.logY?n.viewport.yToScreen(Math.pow(10,n.confidenceIntervals.confidenceBottom(t))):n.viewport.yToScreen(n.confidenceIntervals.confidenceBottom(t));e.lineTo(r,i)}e.closePath(),e.fill()}(e,{viewport:r.viewport,logOptions:r.logOptions,showAxes:r.showAxes,showAxesLabels:r.showAxesLabels,screenBounds:r.screenBounds,confidenceIntervals:t})}}function A(e,n){e.beginPath();const r=n.showAxes?n.showAxesLabels?m.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:m.d.AXES_LEFT_PX_MARGIN:0,t=n.showAxes?m.d.AXES_RIGHT_PX_MARGIN:0,o=n.confidenceType===a.vK.TOP?n.confidenceIntervals.confidenceTop:n.confidenceIntervals.confidenceBottom;for(let i=r;i<=n.screenBounds.width-t;i++){const t=n.screenBounds.x+i,a=n.logOptions.logX?Math.log10(n.viewport.xToWorld(t)):n.viewport.xToWorld(t),s=n.logOptions.logY?n.viewport.yToScreen(Math.pow(10,o(a))):n.viewport.yToScreen(o(a));i===r?e.moveTo(t,s):e.lineTo(t,s)}e.stroke()}function E(e,n,r){var t;if((null===(t=n.showFitLine)||void 0===t||t)&&n.droplines&&r.showDroplines){e.save(),e.strokeStyle="blue",e.lineWidth=r.ratio,e.beginPath(),e.setLineDash([5,5]);for(let t=0;t<n.droplines.length;t++)"IC50"===n.droplines[t]&&I(e,{viewport:r.viewport,xValue:n.parameters[2],dataBounds:r.dataBounds,curveFunc:r.curveFunc,logOptions:r.logOptions});e.stroke(),e.restore()}}function I(e,n){n.logOptions.logX&&(n.xValue=Math.pow(10,n.xValue));const r=n.logOptions.logX?Math.log10(n.xValue):n.xValue,t=n.logOptions.logY?Math.pow(10,n.curveFunc(r)):n.curveFunc(r);e.moveTo(n.viewport.xToScreen(n.dataBounds.minX),n.viewport.yToScreen(t)),e.lineTo(n.viewport.xToScreen(n.xValue),n.viewport.yToScreen(t)),e.lineTo(n.viewport.xToScreen(n.xValue),n.viewport.yToScreen(n.dataBounds.minY))}function C(e,n,r){var t;if((null===(t=n.showFitLine)||void 0===t||t)&&r.statistics){const t=(0,u.tq)(n,r.fitFunc,r.logOptions);for(let o=0;o<r.statistics.length;o++){const i=r.statistics[o],s=a.sw.find((e=>e.name===i));if(s){const i=y.formatNumber(s.get(t));e.fillStyle=n.fitLineColor,e.textAlign="left",e.fillText(s.name+": "+i,r.dataBox.x+5,r.dataBox.y+20+20*o)}}}}function S(e,n){var r;t.Paint.marker(e,t.MARKER_TYPE.OUTLIER,n.midX,n.midY,t.Color.red,(r=.8*Math.min(n.width,n.height),0,30,Math.min(Math.max(r,0),30)))}function N(e,n,r){if(n&&r)for(const t of e)!(t.name in r)&&t.name in n&&(r[t.name]=n[t.name])}function M(e){if(0===e.length)return null;const n={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 r of e)n.points=[...n.points,...r.points];return n}function P(e){var n,r,o,i,s;let l=e.cell.value;l.includes("|")&&(l=l.replaceAll("|",""));const f=(null===(r=null===(n=e.cell)||void 0===n?void 0:n.column)||void 0===r?void 0:r.type)===t.TYPE.STRING?e.cell.column.getTag(m.d.TAG_FIT_CHART_FORMAT)===m.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(l):null!==(o=JSON.parse(null!=l?l:"{}"))&&void 0!==o?o:{}:(0,u.TL)(),h=e.cell.column?(0,u.hq)(e.cell.column):{},d=e.cell.column?(0,u.jG)(e.cell.dataFrame):{};null!==(i=f.series)&&void 0!==i||(f.series=[]),null!==(s=f.chartOptions)&&void 0!==s||(f.chartOptions=h.chartOptions),N(a.kW,h.chartOptions,f.chartOptions),N(a.kW,d.chartOptions,f.chartOptions);for(const e of f.series)N(a.K0,h.seriesOptions,e),N(a.K0,d.seriesOptions,e);return f}function L(e,n,r){if(e.width<m.d.MIN_AXES_CELL_PX_WIDTH||e.height<m.d.MIN_AXES_CELL_PX_HEIGHT)return[e,void 0,void 0];const t=n?m.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:m.d.AXES_LEFT_PX_MARGIN,o=n?m.d.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS:m.d.AXES_BOTTOM_PX_MARGIN,i=r?m.d.AXES_TOP_PX_MARGIN_WITH_TITLE:m.d.AXES_TOP_PX_MARGIN;return[e.cutLeft(t).cutBottom(o).cutTop(i).cutRight(m.d.AXES_RIGHT_PX_MARGIN),e.getBottom(o).getTop(i).cutLeft(t).cutRight(m.d.AXES_RIGHT_PX_MARGIN),e.getLeft(t).getRight(m.d.AXES_RIGHT_PX_MARGIN).cutBottom(o).cutTop(i)]}function O(e){return null!=e&&""!==e&&void 0!==t.Color.fromHtml(e)}function k(e){var n;for(let r=0;r<(null===(n=e.series)||void 0===n?void 0:n.length);r++){const n=e.series[r];if(n.points.every((e=>0!==e.x)))continue;let t=Number.MAX_VALUE,o=0,i=0;const a=[];for(let e=0;e<n.points.length;e++)n.points[e].x<t&&0!==n.points[e].x&&(t=n.points[e].x),n.points[e].x>o&&0!==n.points[e].x&&(o=n.points[e].x),a.includes(n.points[e].x)||(a[a.length]=n.points[e].x,i++);const s=Math.pow(10,Math.log10(t)-(Math.log10(o)-Math.log10(t)/(i-1)));for(let e=0;e<n.points.length;e++)0===n.points[e].x&&(n.points[e].x=s)}}class R extends t.GridCellRenderer{get name(){return a.d8}get cellType(){return a.d8}getDefaultSize(e){return{width:m.d.CELL_DEFAULT_WIDTH,height:m.d.CELL_DEFAULT_HEIGHT}}onClick(e,n){var r,t,a,l,h,d,p;if(!e.cell.value)return;const y=e.cell.column.getTag(m.d.TAG_FIT_CHART_FORMAT)===m.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(e.cell.value):P(e);for(const[e,n]of Object.entries(m.d.CONDITION_MAP))if(n(y.series))return void(o.shell.o=i.divText(e,{style:{color:"red"}}));o.shell.o=e;const g=e.bounds.inflate(m.d.INFLATE_SIZE,m.d.INFLATE_SIZE),x=L(g,this.areAxesLabelsShown(g,y),this.isTitleShown(g,y))[0],v=(0,u.dU)(y),_=new s.l(v,x,null!==(t=null===(r=y.chartOptions)||void 0===r?void 0:r.logX)&&void 0!==t&&t,null!==(l=null===(a=y.chartOptions)||void 0===a?void 0:a.logY)&&void 0!==l&&l);for(let r=0;r<(null===(h=y.series)||void 0===h?void 0:h.length);r++)if(!(y.series[r].connectDots||!y.series[r].clickToToggle||"points"!==y.series[r].showPoints||g.width<m.d.MIN_AXES_CELL_PX_WIDTH||g.height<m.d.MIN_AXES_CELL_PX_HEIGHT))for(let t=0;t<y.series[r].points.length;t++){const o=y.series[r].points[t];if(this.hitTest(n,o,_)){o.outlier=!o.outlier;const n=e.grid.dataFrame.columns.byTags({".sourceColumn":e.cell.column.name});if(n)for(const t of n){const n={logX:null===(d=y.chartOptions)||void 0===d?void 0:d.logX,logY:null===(p=y.chartOptions)||void 0===p?void 0:p.logY},o=null!==t.tags[".seriesAggregation"]?(0,f.No)(y,t.tags[".seriesAggregation"]):t.tags[".seriesNumber"]===r?(0,f.hS)(y.series[r],n):null;null!==o&&t.set(e.cell.rowIndex,o[t.tags[".statistics"]])}if(e.cell.column.getTag(m.d.TAG_FIT_CHART_FORMAT)!==m.d.TAG_FIT_CHART_FORMAT_3DX){const n=JSON.parse(e.cell.value);n.series[r].points[t].outlier=o.outlier,e.cell.value=JSON.stringify(n)}return}}}onDoubleClick(e,n){if(!e.cell.value)return;const r=l.$.fromGridCell(e),t=i.dialog({title:"Edit chart"}).add(r.root).show({resizable:!0}).root.getElementsByClassName("d4-dialog-contents dlg-edit-chart")[0].firstChild;r.canvas.width=t.clientWidth,r.canvas.height=t.clientHeight,r.render(),t.style.width="100%",t.style.height="100%",i.tools.handleResize(t,((e,n)=>{r.canvas.width=e,r.canvas.height=n,r.render()}))}areAxesShown(e){return e.width>=m.d.MIN_AXES_CELL_PX_WIDTH&&e.height>=m.d.MIN_AXES_CELL_PX_HEIGHT}areAxesLabelsShown(e,n){var r;return e.width>=m.d.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH&&e.height>=m.d.MIN_Y_AXIS_NAME_VISIBILITY_PX_HEIGHT&&!!(null===(r=n.chartOptions)||void 0===r?void 0:r.xAxisName)&&!!n.chartOptions.yAxisName}isTitleShown(e,n){var r;return e.width>=m.d.MIN_TITLE_PX_WIDTH&&e.height>=m.d.MIN_TITLE_PX_HEIGHT&&!!(null===(r=n.chartOptions)||void 0===r?void 0:r.title)}isLegendShown(e){return e.width>=m.d.MIN_LEGEND_PX_WIDTH&&e.height>=m.d.MIN_LEGEND_PX_HEIGHT}areDroplinesShown(e){return e.width>=m.d.MIN_DROPLINES_VISIBILITY_PX_WIDTH&&e.height>=m.d.MIN_DROPLINES_VISIBILITY_PX_HEIGHT}renderCurves(e,n,r){var o,i,a,c,l,f,h,d,p,y,_,w,A,I,S;e.save(),e.beginPath(),e.rect(n.x,n.y,n.width,n.height),e.clip(),(null===(o=r.chartOptions)||void 0===o?void 0:o.allowXZeroes)&&(null===(i=r.chartOptions)||void 0===i?void 0:i.logX)&&(null===(a=r.series)||void 0===a?void 0:a.some((e=>e.points.some((e=>0===e.x)))))&&k(r);const[N,M,P]=L(n,this.areAxesLabelsShown(n,r),this.isTitleShown(n,r)),O=(0,u.dU)(r);(O.x<0&&r.chartOptions||0===O.x&&r.chartOptions&&!r.chartOptions.allowXZeroes)&&(r.chartOptions.logX=!1),O.y<=0&&r.chartOptions&&(r.chartOptions.logY=!1);const R=new s.l(O,N,null!==(l=null===(c=r.chartOptions)||void 0===c?void 0:c.logX)&&void 0!==l&&l,null!==(h=null===(f=r.chartOptions)||void 0===f?void 0:f.logY)&&void 0!==h&&h),X=Math.min(N.width,N.height),D=X>100?1:.2+X/100*.8,F={logX:null===(d=r.chartOptions)||void 0===d?void 0:d.logX,logY:null===(p=r.chartOptions)||void 0===p?void 0:p.logY};e.save(),e.font='11px Roboto, "Roboto Local"',R.drawCoordinateGrid(e,M,P),e.restore();for(let t=0;t<(null===(y=r.series)||void 0===y?void 0:y.length);t++){const o=r.series[t];if(o.points.some((e=>void 0===e.x||void 0===e.y)))continue;(n.width<m.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||n.height<m.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT)&&(o.showPoints="",r.chartOptions&&(r.chartOptions.showStatistics=[])),o.points.sort(((e,n)=>e.x-n.x));let i=!0;const a=(0,u.Y6)(o);let s=null;if(!o.connectDots||o.showFitLine)if(o.parameters)(null===(_=r.chartOptions)||void 0===_?void 0:_.logX)&&o.parameters[2]>0&&(o.parameters[2]=Math.log10(o.parameters[2])),s=(0,u.kG)(o,a);else{const e=(0,u.PK)(o,a,F);s=e.fittedCurve,o.parameters=e.parameters,i=!1}g(o,t),x(e,o,{viewport:R,ratio:D}),v(e,o,{viewport:R,ratio:D}),T(e,o,{viewport:R,ratio:D,logOptions:F,showAxes:this.areAxesShown(n),showAxesLabels:this.areAxesLabelsShown(n,r),screenBounds:n,curveFunc:s}),b(e,o,{viewport:R,logOptions:F,showAxes:this.areAxesShown(n),showAxesLabels:this.areAxesLabelsShown(n,r),screenBounds:n,fitFunc:a,userParamsFlag:i}),E(e,o,{viewport:R,ratio:D,showDroplines:this.areDroplinesShown(n),xValue:o.parameters[2],dataBounds:O,curveFunc:s,logOptions:F}),C(e,o,{statistics:null===(w=r.chartOptions)||void 0===w?void 0:w.showStatistics,fitFunc:a,logOptions:F,dataBox:N})}!function(e,n){n.showTitle&&(e.font='12px Roboto, "Roboto Local"',e.textAlign="center",e.fillStyle="black",e.fillText(n.title,n.dataBox.midX-5,n.screenBounds.y+15))}(e,{showTitle:this.isTitleShown(n,r),title:null===(A=r.chartOptions)||void 0===A?void 0:A.title,dataBox:N,screenBounds:n}),function(e,n){if(n.showAxesLabels){e.font='11px Roboto, "Roboto Local"',e.textAlign="center",e.fillStyle="black",e.fillText(n.xAxisName,n.dataBox.midX-5,n.screenBounds.maxY-m.d.X_AXIS_LABEL_BOTTOM_PX_MARGIN),e.translate(n.screenBounds.x,n.screenBounds.y),e.rotate(-Math.PI/2);const r=n.showTitle?m.d.AXES_TOP_PX_MARGIN_WITH_TITLE:m.d.AXES_TOP_PX_MARGIN;e.fillText(n.yAxisName,-(n.dataBox.height/2+r+15),15),e.restore()}}(e,{showTitle:this.isTitleShown(n,r),dataBox:N,screenBounds:n,showAxesLabels:this.areAxesLabelsShown(n,r),xAxisName:null===(I=r.chartOptions)||void 0===I?void 0:I.xAxisName,yAxisName:null===(S=r.chartOptions)||void 0===S?void 0:S.yAxisName}),function(e,n,r){var o,i,a,s,u,c,l;if(r.showLegend){e.font='11px Roboto, "Roboto Local"';const f=[...new Set(null===(o=n.series)||void 0===o?void 0:o.map((e=>e.columnName)))].filter((e=>null!=e));let h=0;for(let o=0;o<f.length;o++){const d=f[o];if(null===(i=n.chartOptions)||void 0===i?void 0:i.showColumnLabel){e.beginPath(),e.fillStyle="black";const n=e.measureText(d).width;e.fillText(d,r.dataBox.maxX-n,r.dataBox.y+m.d.LEGEND_TOP_PX_MARGIN+(o*m.d.LEGEND_RECORD_PX_HEIGHT+m.d.LEGEND_RECORD_PX_HEIGHT*h))}const p=null===(a=n.series)||void 0===a?void 0:a.filter((e=>e.columnName===d));for(let i=0;i<(null==p?void 0:p.length);i++){const a=p[i];if(""===a.name||null===a.name||void 0===a.name)continue;e.beginPath(),e.strokeStyle=a.fitLineColor,e.lineWidth=2*r.ratio;const f=e.measureText(a.name).width;e.moveTo(r.dataBox.maxX-f-m.d.LEGEND_RECORD_LINE_PX_WIDTH-m.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,r.dataBox.y+m.d.LEGEND_TOP_PX_MARGIN-m.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+((null===(s=n.chartOptions)||void 0===s?void 0:s.showColumnLabel)?m.d.LEGEND_RECORD_PX_HEIGHT*(o+1):0)+m.d.LEGEND_RECORD_PX_HEIGHT*h),e.lineTo(r.dataBox.maxX-f-m.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,r.dataBox.y+m.d.LEGEND_TOP_PX_MARGIN-m.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+((null===(u=n.chartOptions)||void 0===u?void 0:u.showColumnLabel)?m.d.LEGEND_RECORD_PX_HEIGHT*(o+1):0)+m.d.LEGEND_RECORD_PX_HEIGHT*h);const d=a.markerType?a.markerType:t.MARKER_TYPE.CIRCLE;t.Paint.marker(e,d,r.dataBox.maxX-f-m.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN-m.d.LEGEND_RECORD_LINE_PX_WIDTH/2,r.dataBox.y+m.d.LEGEND_TOP_PX_MARGIN-m.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+((null===(c=n.chartOptions)||void 0===c?void 0:c.showColumnLabel)?m.d.LEGEND_RECORD_PX_HEIGHT*(o+1):0)+m.d.LEGEND_RECORD_PX_HEIGHT*h,a.pointColor,m.d.POINT_PX_SIZE*r.ratio),e.fillStyle=a.fitLineColor,e.fillText(a.name,r.dataBox.maxX-f,r.dataBox.y+m.d.LEGEND_TOP_PX_MARGIN+((null===(l=n.chartOptions)||void 0===l?void 0:l.showColumnLabel)?m.d.LEGEND_RECORD_PX_HEIGHT*(o+1):0)+m.d.LEGEND_RECORD_PX_HEIGHT*h),e.stroke(),h++}}e.restore()}}(e,r,{showLegend:this.isLegendShown(n),dataBox:N,ratio:D}),e.restore()}render(e,n,r,o,i,a,s){var u,l,f;if(!a.cell.value)return;if(o<m.d.MIN_CELL_RENDERER_PX_WIDTH||i<m.d.MIN_CELL_RENDERER_PX_HEIGHT)return;const h=(null===(u=a.cell.column)||void 0===u?void 0:u.getTag(m.d.TAG_FIT_CHART_FORMAT))===m.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(a.cell.value):P(a),d=new t.Rect(n,r,o,i).inflate(m.d.INFLATE_SIZE,m.d.INFLATE_SIZE);for(const[n,r]of Object.entries(m.d.CONDITION_MAP))if(r(h.series))return void S(e,d);null===(l=h.series)||void 0===l||l.forEach((e=>e.columnName=a.cell.column.name)),(null===(f=h.chartOptions)||void 0===f?void 0:f.mergeSeries)&&(h.series=[M(h.series)]),this.renderCurves(e,d,h)}hitTest(e,n,r){const o=r.xToScreen(n.x),i=r.yToScreen(n.y),a=(n.outlier?m.d.OUTLIER_PX_SIZE:m.d.POINT_PX_SIZE)/2+m.d.OUTLIER_HITBOX_RADIUS;return new t.Rect(o-a,i-a,2*a,2*a).containsPoint(new t.Point(e.offsetX,e.offsetY))}onMouseMove(e,n){var r,o,a,l,f;if(!e.cell.value)return;const h=e.bounds.inflate(m.d.INFLATE_SIZE,m.d.INFLATE_SIZE);if(h.width<m.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||h.height<m.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const r=i.canvas(300,200);this.render(r.getContext("2d"),0,0,300,200,e,null);const t=i.divV([r]);i.tooltip.show(t,n.x,n.y)}const d=e.cell.column.getTag(m.d.TAG_FIT_CHART_FORMAT)===m.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(e.cell.value):P(e);if(h.width>=m.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH&&h.height>=m.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const e=L(h,this.areAxesLabelsShown(h,d),this.isTitleShown(h,d))[0],c=(0,u.dU)(d),p=new s.l(c,e,null!==(o=null===(r=d.chartOptions)||void 0===r?void 0:r.logX)&&void 0!==o&&o,null!==(l=null===(a=d.chartOptions)||void 0===a?void 0:a.logY)&&void 0!==l&&l);for(let e=0;e<(null===(f=d.series)||void 0===f?void 0:f.length);e++)if("points"===d.series[e].showPoints)for(let r=0;r<d.series[e].points.length;r++){const o=d.series[e].points[r];if(this.hitTest(n,o,p))return i.tooltip.show(i.divV([i.divText(`x: ${t.format(o.x,"#0.000")}`),i.divText(`y: ${t.format(o.y,"#0.000")}`)]),n.x+16,n.y+16),void(!d.series[e].connectDots&&d.series[e].clickToToggle&&h.width>=m.d.MIN_AXES_CELL_PX_WIDTH&&h.height>=m.d.MIN_AXES_CELL_PX_HEIGHT&&(document.body.style.cursor="pointer"))}i.tooltip.hide()}document.body.style.cursor="default"}}},363:(e,n,r)=>{"use strict";var t=r(976);r(188),r(874),r(870),r(184),r(875),rxjs.operators,rxjs,r(638),r(840),r(711),new t.Package},976:e=>{"use strict";e.exports=DG},469:e=>{"use strict";e.exports=grok},870:e=>{"use strict";e.exports=ui},414:e=>{"use strict";e.exports=wu}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(n,{a:n}),n},__webpack_require__.d=(e,n)=>{for(var r in n)__webpack_require__.o(n,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{_package:()=>Z,test:()=>z,tests:()=>l});var e=__webpack_require__(976),n=__webpack_require__(469);__webpack_require__(133);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 t=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((t=t.apply(e,n||[])).next())}))};const o=3e4,i=108e5,a=console.log.bind(console),s=console.info.bind(console),u=console.warn.bind(console),c=console.error.bind(console),l={},f="Auto Tests",m="Demo",h="Detectors",d="Core",p={};let y;var g;!function(e){e.notNull=function(e,n){if(null==e)throw new Error(`${null==n?"Value":n} not defined`)}}(g||(g={}));class x{constructor(e,n){this.catchUnhandled=!0,this.report=!1,void 0!==e&&(this.catchUnhandled=e),void 0!==n&&(this.report=n)}}class v{constructor(e,n,r,i){var a;this.category=e,this.name=n,null!=i||(i={}),null!==(a=i.timeout)&&void 0!==a||(i.timeout=o),this.options=i,this.test=()=>t(this,void 0,void 0,(function*(){return new Promise(((e,n)=>t(this,void 0,void 0,(function*(){let t="";try{t=yield r()}catch(e){n(e)}e(t)}))))}))}}function _(e,n,r){null==l[y]&&(l[y]={}),null==l[y].tests&&(l[y].tests=[]),l[y].tests.push(new v(y,e,n,r))}function w(e,n=!0,r){if(r=r?`${r}, `:"",e!==n)throw new Error(`${r}Expected "${n}", got "${e}"`)}function T(e,n,r=.001,t){if(e===Number.POSITIVE_INFINITY&&n===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY&&n===Number.NEGATIVE_INFINITY||e===Number.NaN&&n===Number.NaN||isNaN(e)&&isNaN(n))return;const o=Math.abs(e-n)<r;if(w(o,!0,`${null!=t?t:""} (tolerance = ${r})`),!o)throw new Error(`Expected ${n}, got ${e} (tolerance = ${r})`)}function b(e,n){for(const[r,t]of Object.entries(n)){if(!e.hasOwnProperty(r))throw new Error(`Expected property "${r}" not found`);const n=e[r];if(n instanceof Array&&t instanceof Array)A(n,t);else if(n instanceof Object&&t instanceof Object)b(n,t);else if(Number.isFinite(n)&&Number.isFinite(t))T(n,t);else if(n!=t)throw new Error(`Expected (${t}) for key '${r}', got (${n})`)}}function A(e,n){const r=e.length,t=n.length;if(r!=t)throw new Error(`Arrays are of different length: actual array length is ${r} and expected array length is ${t}`);for(let t=0;t<r;t++)if(e[t]instanceof Array&&n[t]instanceof Array)A(e[t],n[t]);else if(e[t]instanceof Object&&n[t]instanceof Object)b(e[t],n[t]);else if(e[t]!=n[t])throw new Error(`Expected ${n[t]} at position ${t}, got ${e[t]}`)}function E(e,n,r){var t;y=e,n(),l[y]&&(l[y].clear=null===(t=null==r?void 0:r.clear)||void 0===t||t,l[y].timeout=null==r?void 0:r.timeout)}function I(e,n){return e.replace(new RegExp(n.name,"gi"),n.nqName)}function C(n){return`${n.toString()}\n${n.stack?e.Logger.translateStackTrace(n.stack):""}`}function S(r,s,u,c,l,f){var m,h,d,p,y,g;return t(this,void 0,void 0,(function*(){let t;u.length=0;let x="package";const v=null!=s&&r.name.toLowerCase()!==s.toLowerCase(),_=(null===(m=r.options)||void 0===m?void 0:m.skipReason)||v,w=v?"skipped":null===(h=r.options)||void 0===h?void 0:h.skipReason;_||a(`Started ${r.category} ${r.name}`);const T=Date.now();try{if(_)t={success:!0,result:w,ms:0,skipped:!0};else{let n=(null===(d=r.options)||void 0===d?void 0:d.timeout)===o&&c?c:null===(p=r.options)||void 0===p?void 0:p.timeout;n=e.Test.isInBenchmark&&n===o?i:n,t={success:!0,result:null!==(y=yield M(r.test,n))&&void 0!==y?y:"OK",ms:0,skipped:!1}}}catch(e){t={success:!1,result:C(e),ms:0,skipped:!1}}if((null===(g=r.options)||void 0===g?void 0:g.isAggregated)&&t.result.constructor===e.DataFrame){const e=t.result.col("success");if(x="core",e&&(t.success=e.stats.sum===e.length),!f){const e=t.result;e.columns.remove("stack"),e.rows.removeWhere((e=>e.get("success"))),t.result=e}t.result=t.result.toCsv()}if(t.logs=u.join("\n"),t.ms=Date.now()-T,_||a(`Finished ${r.category} ${r.name} for ${t.ms} ms`),t.category=r.category,t.name=r.name,!v){let e={success:t.success,result:t.result,ms:t.ms,skipped:t.skipped,type:x,packageName:l,category:r.category,test:r.name,logs:t.logs};if(t.result.constructor==Object){const n=Object.keys(t.result).reduce(((e,n)=>Object.assign(Object.assign({},e),{["result."+n]:t.result[n]})),{});e=Object.assign(Object.assign({},e),n)}n.log.usage(`${l}: ${r.category}: ${r.name}`,e,`test-${x} ${l}: ${r.category}: ${r.name}`)}return t}))}function N(e){return t(this,void 0,void 0,(function*(){yield new Promise((n=>setTimeout(n,e)))}))}function M(e,n){return t(this,void 0,void 0,(function*(){let r=null;const t=new Promise(((e,t)=>{r=setTimeout((()=>{t("EXECUTION TIMEOUT")}),n)}));try{return yield Promise.race([e(),t])}finally{r&&clearTimeout(r)}}))}e.DataFrame.fromColumns([e.Column.fromStrings("col",["val1","val2","val3"])]);var P=__webpack_require__(875),L=__webpack_require__(638),O=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((t=t.apply(e,n||[])).next())}))};E("detectors",(()=>{_("detectFitCurves",(()=>O(void 0,void 0,void 0,(function*(){const r=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""]}}"'),t=r.columns.byName("json chart 0"),o=r.columns.byName("json chart 1"),i=r.columns.byName("json chart 2");yield n.data.detectSemanticTypes(r),w(t.semType,P.j2),w(o.semType,P.j2),w(i.semType,P.j2)})))),_("detectXMLCurveChart",(()=>O(void 0,void 0,void 0,(function*(){const r=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>"'),t=r.columns.byName("xmlCurveFitChart");yield n.data.detectSemanticTypes(r),w(t.semType,P.j2),w(t.tags[L.d.TAG_FIT_CHART_FORMAT],L.d.TAG_FIT_CHART_FORMAT_3DX)}))))}));var k=__webpack_require__(870),R=__webpack_require__(414),X=__webpack_require__.n(R),D=__webpack_require__(840),F=__webpack_require__(874),j=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((t=t.apply(e,n||[])).next())}))};function q(n){const r={series:[],chartOptions:{showStatistics:["auc"]}},t=(0,D.YC)(n,.5),o=e.Color.toHtml(e.Color.scatterPlotMarker);return r.series[0]={fitLineColor:o,pointColor:o,markerType:e.MARKER_TYPE.CIRCLE,showFitLine:!0,showPoints:"points",showCurveConfidenceInterval:!0,fitFunction:"sigmoid",points:X().count().take(n).map((function(e){return{x:t.x[e],y:t.y[e]}})).toArray()},r}E("creation",(()=>{_("fit curve creation",(()=>j(void 0,void 0,void 0,(function*(){const r=Date.now(),t=(0,D.lf)(e.Test.isInBenchmark?1e3:100,5,2);n.shell.addTableView(t);const o=Date.now();return yield N(50),console.log(`Creation took ${o.valueOf()-r.valueOf()} ms`),`${e.Test.isInBenchmark?1e3:100} points, took ${o.valueOf()-r.valueOf()} ms`}))))})),E("rendering",(()=>{_("rendering same fitChartData on canvas",(()=>j(void 0,void 0,void 0,(function*(){const r=k.canvas(160,120);n.shell.newView("canvas",[r]);const t=r.getContext("2d"),o=new F.cv,i=q(e.Test.isInBenchmark?50:15);for(let n=1;n<=1e3;n++)o.renderCurves(t,new e.Rect(r.clientLeft,r.clientTop,160,120).inflate(L.d.INFLATE_SIZE,L.d.INFLATE_SIZE),i),t.clearRect(0,0,160,120);return"rendering performed 1000 times"})))),_("rendering different fitChartData on canvas",(()=>j(void 0,void 0,void 0,(function*(){const r=k.canvas(160,120);n.shell.newView("canvas",[r]);const t=r.getContext("2d"),o=new F.cv;for(let n=1;n<=1e3;n++){const n=q(e.Test.isInBenchmark?50:15);o.renderCurves(t,new e.Rect(r.clientLeft,r.clientTop,160,120).inflate(L.d.INFLATE_SIZE,L.d.INFLATE_SIZE),n),t.clearRect(0,0,160,120)}return"rendering performed 1000 times"})))),_("rendering in grid",(()=>j(void 0,void 0,void 0,(function*(){const e=(0,D.lf)(30,5,2),r=n.shell.addTableView(e);yield N(100);const t=r.grid.root.getElementsByTagName("canvas")[2],o=new Date;yield function(e,n,r,t){return j(this,void 0,void 0,(function*(){for(let n=0;n<10;n++)e.dispatchEvent(new WheelEvent("wheel",{deltaY:300})),yield N(10)}))}(t);const i=new Date;return console.log(`curves rendering took ${i.valueOf()-o.valueOf()} ms`),i.valueOf()-o.valueOf()+" ms"}))))}));var G=__webpack_require__(766);E("viewport",(()=>{_("viewportMethods",(()=>{return n=void 0,r=void 0,o=function*(){const n=new e.Rect(120,20,160,100).inflate(L.d.INFLATE_SIZE,L.d.INFLATE_SIZE),[r]=(0,F.Ce)(n,!1,!1),t=new e.Rect(.1,.06,7,5.94),o=new G.l(t,r,!1,!1);w(o.xToScreen(1.5),182.4),w(o.yToScreen(2.33),73.01346801346801),w(o.xToWorld(150),-.9652173913043479),w(o.yToWorld(67),2.855294117647059)},new((t=void 0)||(t=Promise))((function(e,i){function a(e){try{u(o.next(e))}catch(e){i(e)}}function s(e){try{u(o.throw(e))}catch(e){i(e)}}function u(n){var r;n.done?e(n.value):(r=n.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,s)}u((o=o.apply(n,r||[])).next())}));var n,r,t,o}))}));var B=__webpack_require__(416),Y=__webpack_require__(111),H=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((t=t.apply(e,n||[])).next())}))};const V={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]},W={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]},U=(0,B.Y6)(V),$=(0,B.Y6)(W);E("fit",(()=>{_("getSeriesFitFunction",(()=>H(void 0,void 0,void 0,(function*(){const{xs:e,ys:n}=(0,B.q_)(V.points),{xs:r,ys:t}=(0,B.q_)(W.points);w(U.name,P.yB),w($.name,"Polynomial"),A(U.parameterNames,["Top","Bottom","Slope","IC50"]),A($.parameterNames,["Slope","Intercept","Parameter3","Parameter4"]),A(U.getInitialParameters(e,n),[1.8561450242996216,1,5.099999904632568,.23361243307590485]),A($.getInitialParameters(r,t),[.1,-1,4,4]),w(U.y(V.parameters,1.1),1.6914214213007113),w($.y($.getInitialParameters(r,t),1.1),7.3231)})))),_("getCurve",(()=>H(void 0,void 0,void 0,(function*(){const e=(0,B.kG)(V,U),n=(0,B.kG)(W,$);w(e(2.5),1.6907865884456907),w(e(5.8858),.5356637992990292),w(n(1.56),7.6502648725700535),w(n(3.99876),6.09328601677405)})))),_("fitSeries",(()=>H(void 0,void 0,void 0,(function*(){const e=Date.now(),n=(0,B.PK)(V,U),r=(0,B.PK)(W,$),t=Date.now();return w(n.fittedCurve(2.5),1.690742266220136),w(r.fittedCurve(3.99876),6.09328601677405),A(n.parameters,[1.691390784119389,1.1540819399621425,5.4104428146970704,.20886765646057662]),A(r.parameters,[.07070206940832963,-1.138666933634074,3.947509109407932,3.9947960440506685]),t.valueOf()-e.valueOf()+" ms"})))),_("getSeriesConfidenceInterval",(()=>H(void 0,void 0,void 0,(function*(){const e=(0,B.LC)(V,U,!0),n=(0,B.LC)(W,$,!0);w(e.confidenceTop(2.578),1.8540854906189528),w(n.confidenceTop(2.3342),10.035230015978911),w(e.confidenceBottom(3.987),1.494930602732917),w(n.confidenceBottom(3.8796),4.168651824724921)})))),_("getSeriesStatistics",(()=>H(void 0,void 0,void 0,(function*(){const e=(0,B.tq)(V,U),n=(0,B.tq)(W,$);w(e.auc,9.33542235488813),w(n.auc,36.52554692824738),w(e.rSquared,.9781915962446398),w(n.rSquared,.8460557736673078)})))),_("calculateBoxPlotStatistics",(()=>H(void 0,void 0,void 0,(function*(){const e=(0,Y.G)([.7654603719711304,.8199243545532227,.8257747292518616,.9558155536651611,.9596694707870483]);w(e.q1,.8199243545532227),w(e.q2,.8257747292518616),w(e.q3,.9558155536651611),w(e.lowerAdjacentValue,.7654603719711304),w(e.upperAdjacentValue,.9558155536651611)})))),_("sigmoid",(()=>H(void 0,void 0,void 0,(function*(){const e=[2.612687371569039,-1.421800778574126,5.16688669906018,.341788492203575];w((0,P.Hg)(e,.5),.34178901799627626),w((0,P.Hg)(e,2.5),.3421552218929382),w((0,P.Hg)(e,5.678976),2.254881739737238)}))))}));var K=function(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{u(t.next(e))}catch(e){i(e)}}function s(e){try{u(t.throw(e))}catch(e){i(e)}}function u(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}u((t=t.apply(e,n||[])).next())}))};const Z=new e.Package;function z(o,i,y){return K(this,void 0,void 0,(function*(){const g=yield function(o){var i,y,g,_,T,b,A;return t(this,void 0,void 0,(function*(){const E=null===(y=null===(i=n.functions.getCurrentCall())||void 0===i?void 0:i.func)||void 0===y?void 0:y.package;yield function(o,i){var a;return t(this,void 0,void 0,(function*(){const i=o.id;if(p[i])return;const s=l;if(void 0!==s[f]||void 0!==s[m]||Object.keys(s).find((e=>e.startsWith(f)||e.startsWith(d))))return void(p[i]=!0);if("DevTools"===o.name){const n=e.Func.find({tags:["dartTest"]});for(const e of n){const n=e.name.split(/\s*\|\s*/g),r=null!==(a=n.pop())&&void 0!==a?a:e.name,o=n.length?d+": "+n.join(": "):d;void 0===s[o]&&(s[o]={tests:[],clear:!0}),s[o].tests.push(new v(o,r,(()=>t(this,void 0,void 0,(function*(){return yield e.apply()}))),{isAggregated:e.outputs.length>0,timeout:3e5}))}}const u=[],c=[],y=[],g=yield n.dapi.functions.filter(`package.id = "${i}"`).list(),x=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const e of g){const o=e.options.test,i=e.options.demoPath;if(o&&Array.isArray(o)&&o.length)for(let r=0;r<o.length;r++){const i=o[r].matchAll(x),a={};Array.from(i).forEach((e=>{e[0].startsWith("skip")?a.skip=e[1]:e[0].startsWith("wait")?a.wait=parseInt(e[2]):e[0].startsWith("cat")?a.cat=e[3]:e[0].startsWith("timeout")&&(a.timeout=parseInt(e[4]))}));const c=new v(f,1===o.length?e.name:`${e.name} ${r+1}`,(()=>t(this,void 0,void 0,(function*(){const t=yield n.functions.eval(I(o[r],e));if(a.wait&&(yield N(a.wait)),"boolean"==typeof t&&!t)throw`Failed: ${o[r]}, expected true, got ${t}`}))),{skipReason:a.skip,timeout:a.timeout});if(a.cat){const e=f+": "+a.cat;c.category=e,void 0===s[e]&&(s[e]={tests:[],clear:!0}),s[e].tests.push(c)}else u.push(c)}if(i){const r=e.options.demoWait?parseInt(e.options.demoWait):void 0,o=new v(m,e.friendlyName,(()=>t(this,void 0,void 0,(function*(){if(n.shell.lastError="",yield e.apply(),yield N(r||2e3),n.shell.lastError)throw new Error(n.shell.lastError)}))),{skipReason:e.options.demoSkip});c.push(o)}if(e.hasTag("semTypeDetector")){const n=new v(h,e.friendlyName,(()=>t(this,void 0,void 0,(function*(){const n=[];for(const t of r.clone().columns){const r=yield e.apply([t]);n.push(r||t.semType)}w(n.filter((e=>e)).length,1)}))),{skipReason:e.options.skipTest});y.push(n)}}p[i]=!0,u.length&&(s[f]={tests:u,clear:!0}),c.length&&(s[m]={tests:c,clear:!0}),y.length&&(s[h]={tests:y,clear:!1})}))}(E);const M=[];console.log("Running tests"),null!=o||(o={}),null!==(g=(A=o).testContext)&&void 0!==g||(A.testContext=new x),n.shell.lastError="";const P=[],L=function(){const e=[];return console.log=(...n)=>{e.push(...n),a(...n)},console.info=(...n)=>{e.push(...n),s(...n)},console.warn=(...n)=>{e.push(...n),u(...n)},console.error=(...n)=>{e.push(...n),c(...n)},e}();try{for(const[r,t]of Object.entries(l)){if((null==o?void 0:o.category)&&!r.toLowerCase().startsWith(null==o?void 0:o.category.toLowerCase())||(null===(_=o.exclude)||void 0===_?void 0:_.some((e=>r.startsWith(e)))))continue;a(`Started ${r} category`),P.push(r);const i=null===(T=t.tests)||void 0===T?void 0:T.every((e=>{var n;return null===(n=e.options)||void 0===n?void 0:n.skipReason}));try{t.before&&!i&&(yield t.before())}catch(e){t.beforeStatus=C(e)}const s=null!==(b=t.tests)&&void 0!==b?b:[],u=[];if(t.clear)for(let r=0;r<s.length;r++)u.push(yield S(s[r],null==o?void 0:o.test,L,t.timeout,E.name,o.verbose)),n.shell.closeAll(),e.Balloon.closeAll();else for(let e=0;e<s.length;e++)u.push(yield S(s[e],null==o?void 0:o.test,L,t.timeout,E.name,o.verbose));const c=u.filter((e=>"skipped"!=e.result));try{t.after&&!i&&(yield t.after())}catch(e){t.afterStatus=C(e)}t.afterStatus&&c.push({category:r,name:"after",result:t.afterStatus,success:!1,ms:0,skipped:!1}),t.beforeStatus&&c.push({category:r,name:"before",result:t.beforeStatus,success:!1,ms:0,skipped:!1}),M.push(...c)}}finally{console.log=a,console.info=s,console.warn=u,console.error=c}if(o.testContext.catchUnhandled&&(yield N(1e3),n.shell.lastError.length>0&&M.push({category:"Unhandled exceptions",name:"exceptions",result:n.shell.lastError,success:!1,ms:0,skipped:!1})),!o.test&&M.length){const r=M.filter((e=>e.success)).length,t=M.filter((e=>e.skipped)).length,i=M.filter((e=>!e.success)),a=E.name;for(const e of P){const r=M.filter((n=>n.category===e)),t=r.filter((e=>!e.success)).length,o={success:0===t,passed:r.filter((e=>e.success)).length,skipped:r.filter((e=>e.skipped)).length,failed:t,type:"package",packageName:a,category:e};n.log.usage(`${a}: ${e}`,o,`category-package ${a}: ${e}`)}if(!o.category){const e={success:0===i.length,passed:r,skipped:t,failed:i.length,type:"package",packageName:a};n.log.usage(a,e,`package-package ${a}`)}if(o.testContext.report){const n=new e.Logger,o="Package @package tested: @successful successful, @skipped skipped, @failed failed tests",a={successful:r,skipped:t,failed:i.length,package:E};for(const e of i)Object.assign(a,{[`${e.category} | ${e.name}`]:e.result});n.log(o,a,"package-tested")}}return M}))}({category:o,test:i,testContext:y});return e.DataFrame.fromObjects(g)}))}})(),curves_test=__webpack_exports__})();
|
|
1
|
+
var curves_test;(()=>{var t={111:(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 c=t[l];return c>e&&(c=e),{q1:e,q2:n,q3:r,lowerAdjacentValue:c,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,{G:()=>r})},102:(t,e,n)=>{"use strict";n.d(e,{yB:()=>x,js:()=>f,kW:()=>y,iC:()=>_,K0:()=>g,ue:()=>E,hR:()=>w,ZY:()=>T,aC:()=>I,XD:()=>C,sw:()=>m});var r,o=n(976),i=n(162);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 c=function(t,e,n,r,o){const i=n.tolerance,s=n.maxIter,c=n.scaleReflection,u=n.scaleExpansion,f=n.scaleContraction,d=e.length+1,h=e.length,[p,m]=function(t,e,n,r,o){const i=n.length+1,s=n.length,a=e.nonZeroParam,l=e.initialScale,c=new Array(i),u=new Array(i);for(let e=0;e<i;e++){c[e]=new Float32Array(s);for(let t=0;t<s;t++)c[e][t]=n[t],0!==e&&e-1===t&&(0===n[t]?c[e][t]=a:c[e][t]+=l*n[e-1],c[e][t]<r[t]?c[e][t]=r[t]:c[e][t]>o[t]&&(c[e][t]=o[t]));u[e]=t(c[e])}return[c,u]}(t,n,e,r,o),y=new Array(d);for(let t=0;t<d;t++)y[t]=t;const g=y.length-1;let x=0,v=0,T=0,_=0;const w=new Float32Array(h),E=new Float32Array(h),I=new Float32Array(h),C=new Float32Array(h),A=new Array(s);if(d>1){for(;y.sort(((t,e)=>m[t]-m[e])),!(x>s);){if(0===x&&(v=m[0],T=2*m[y[0]]),A[x]=v,++x,v=m[y[0]],T-v>i)_=0;else if(++_,_>2*d)break;T=v,a(w,h,y[g],p),l(w,E,y[g],p,c,h,r,o);const e=t(E);if(e<m[y[g]]){l(w,I,y[g],p,u,h,r,o);const n=t(I);if(n<e){m[y[g]]=n;for(let t=0;t<h;t++)p[y[g]][t]=I[t];continue}m[y[g]]=e;for(let t=0;t<h;t++)p[y[g]][t]=E[t];continue}l(w,C,y[g],p,f,h,r,o);const n=t(C);if(!(n<m[y[g]]))break;m[y[g]]=n;for(let t=0;t<h;t++)p[y[g]][t]=C[t]}for(let t=x;t<s;t++)A[t]=m[y[0]]}return{point:p[y[0]],cost:m[y[0]],iterCosts:A,iterCount:x-1}};function u(t,e,n){const r=e-n,o=new Array(t);for(let e=0;e<t;e++){const t=Math.random();o[e]=n+t*r}return o}const f={CONSTANT:"constant",PROPORTIONAL:"proportional",COMBINED:"combined"};class d{}class h extends d{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 p={linear:new class extends d{get name(){return v}get parameterNames(){return["Slope","Intercept"]}y(t,e){return function(t,e){return t[0]*e+t[1]}(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 d{get name(){return x}get parameterNames(){return["Top","Bottom","Slope","IC50"]}y(t,e){return C(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,c=new Float32Array(4);return c.set([n.bottom,l,a,n.top]),c}}},m=[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})],y=[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:m.map((t=>t.name)),inputType:"MultiChoice",friendlyName:"Statistics"})],g=[o.Property.js("fitFunction",o.TYPE.STRING,{category:"Fitting",choices:Object.keys(p),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}),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:""})],x="sigmoid",v="linear";function T(t){if("string"==typeof t)return p[t];if(!p[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 h(e,i,s,n);p[e]=a}return p[t.name]}function _(t,e,n,i){const a=e.y;let l=e.getInitialParameters(t.x,t.y);const d=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))),c=a.map(((t,e)=>t-l[e])).map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[f.CONSTANT,f.COMBINED].includes(n)?i+=c[t]:n===f.PROPORTIONAL&&(s+=c[t]/(l[t]*l[t]));i=Math.sqrt(i/c.length),s=Math.sqrt(s/c.length),n===f.COMBINED&&({sigmaA:i,sigmaB:s}=b(i,s,c,l));const u=[];for(let t=0;t<c.length;t++)u[t]=Math.pow(i+s*l[t],2),o+=c[t]/u[t]+Math.log(2*Math.PI*u[t]);return o}}(a,t,n);let h=new Float32Array(e.parameterNames.length),p=new Float32Array(e.parameterNames.length);for(let t=0;t<e.parameterNames.length;t++)h[t]=0===l[t]?-1:l[t]-Math.abs(.5*l[t]),p[t]=0===l[t]?1:l[t]+Math.abs(.5*l[t]);return i&&0!==i.length&&(h=new Float32Array(i.length),h.set(i.map((t=>t.min))),p=new Float32Array(i.length),p.set(i.map((t=>t.max)))),l=function(t,e,n,r,i=1,a=null,l=!0){const f=function(t,e,n){const r=e.length,o=new Array(t);for(let e=0;e<t;e++)o[e]=new Float32Array(r);for(let i=0;i<r;i++)if(e[i]===n[i])for(let n=0;n<t;n++)o[n][i]=e[i];else{const r=u(t,e[i],n[i]);for(let e=0;e<t;e++)o[e][i]=r[e]}return o}(i,n,e);null!==a&&(f[0]=a);const d=[],h=[],p=[];let m,y=0,g=null;for(m=0;m<i;++m)try{if(0===m&&l){const e=new Float32Array(a.length).map((t=>-1/0)),n=new Float32Array(a.length).map((t=>1/0));d.push(c(t,f[m],r,e,n))}else d.push(c(t,f[m],r,e,n))}catch(t){if(t instanceof s)throw new Error(`Inconsistent dataframes: ${t.message}`);++y,h.push(t instanceof Error?t.message:"Platform issue"),p.push(f[m])}if(y>0){const t=n.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=new Float32Array(y);p.forEach(((t,n)=>t.forEach(((t,r)=>e[r][n]=t)))),g=o.DataFrame.fromColumns(e.map(((t,e)=>o.Column.fromFloat32Array(`arg${e}`,t)))),g.columns.add(o.Column.fromStrings("Issue",h))}return{extremums:d,fails:g}}(d,h,p,{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},1,l).extremums[0].point,{fittedCurve:w(a,l),parameters:l}}function w(t,e){return n=>t(e,n)}function E(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])),c=l.map((t=>Math.pow(t,2)));for(let t=0;t<c.length;t++)[f.CONSTANT,f.COMBINED].includes(n)?o+=c[t]:n===f.PROPORTIONAL&&(i+=Math.pow(l[t]/Math.abs(a[t]),2));return o=Math.sqrt(o/c.length),i=Math.sqrt(i/c.length),n===f.COMBINED&&({sigmaA:o,sigmaB:i}=b(o,i,c,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 I(t,e,n,r=!0){const o=w(n,e);return{rSquared:r?N(o,t):void 0,auc:r?A(o,t):void 0,interceptX:e[2],interceptY:o(e[2]),slope:e[1],top:e[0],bottom:e[3]}}function C(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 A(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 N(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 b(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,c=t*(1-a),u=[];for(let t=0;t<n.length;t++)u[t]=Math.pow(l+c*r[t],2),s+=n[t]/u[t]+Math.log(2*Math.PI*u[t]);s<o&&(o=s,i=a)}return e=t*(1-i),{sigmaA:t*=i,sigmaB:e}}},416:(t,e,n)=>{"use strict";n.d(e,{LC:()=>h,PK:()=>d,TL:()=>s,Y6:()=>u,dU:()=>c,kG:()=>f,q_:()=>a,tq:()=>p});var r=n(976),o=n(102);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.kW),seriesOptions:i(o.K0)}}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 c(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 u(t){return(0,o.ZY)(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.hR)(e.y,r)}function d(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.iC)(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.js.CONSTANT,t.parameterBounds)}function h(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=d(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.ue)(a,l,e.y,.05,null!==(s=t.errorModel)&&void 0!==s?s:o.js.CONSTANT)}function p(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=d(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.aC)(i,s,e.y,!0)}},766:(t,e,n)=>{"use strict";n.d(e,{l:()=>a});var r=n(976);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)}}},133:function(t,e,n){var r;!function(e,o){var i={};!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,c,u,f,d,h,p,m,y,g,x;i>=64;){for(s=n[0],a=n[1],l=n[2],c=n[3],u=n[4],f=n[5],d=n[6],h=n[7],m=0;m<16;m++)y=o+4*m,t[m]=(255&r[y])<<24|(255&r[y+1])<<16|(255&r[y+2])<<8|255&r[y+3];for(m=16;m<64;m++)g=((p=t[m-2])>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,x=((p=t[m-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,t[m]=(g+t[m-7]|0)+(x+t[m-16]|0);for(m=0;m<64;m++)g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&f^~u&d)|0)+(h+(e[m]+t[m]|0)|0)|0,x=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&a^s&l^a&l)|0,h=d,d=f,f=u,u=c+g|0,c=l,l=a,a=s,s=g+x|0;n[0]+=s,n[1]+=a,n[2]+=l,n[3]+=c,n[4]+=u,n[5]+=f,n[6]+=d,n[7]+=h,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]),c=s(e,t),u=new o(c),f=new Uint8Array(u.digestLength),d=f.length,h=new Uint8Array(r),p=0;p<r;p++)d===f.length&&(a(f,u,n,i),d=0),h[p]=f[d++];return u.clean(),f.fill(0),i.fill(0),h},t.pbkdf2=function(t,e,n,r){for(var i=new o(t),s=i.digestLength,a=new Uint8Array(4),l=new Uint8Array(s),c=new Uint8Array(s),u=new Uint8Array(r),f=0;f*s<r;f++){var d=f+1;a[0]=d>>>24&255,a[1]=d>>>16&255,a[2]=d>>>8&255,a[3]=d>>>0&255,i.reset(),i.update(e),i.update(a),i.finish(c);for(var h=0;h<s;h++)l[h]=c[h];for(h=2;h<=n;h++){i.reset(),i.update(c).finish(c);for(var p=0;p<s;p++)l[p]^=c[p]}for(h=0;h<s&&f*s+h<r;h++)u[f*s+h]=l[h]}for(f=0;f<s;f++)l[f]=c[f]=0;for(f=0;f<4;f++)a[f]=0;return i.clean(),u}}(i);var s=i.default;for(var a in i)s[a]=i[a];"object"==typeof t.exports?t.exports=s:void 0===(r=function(){return s}.call(i,n,i,t))||(t.exports=r)}()},162: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 c(){return new c._init(arguments)}function u(){return 0}function f(){return 1}function d(t,e){return t===e?1:0}c.fn=c.prototype,c._init=function(t){if(s(t[0]))if(s(t[0][0])){a(t[1])&&(t[0]=c.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])?c.map(t[0],t[1]):t[0],this.length=1;else if(l(t[0]))this[0]=c.seq.apply(null,t),this.length=1;else{if(t[0]instanceof c)return c(t[0].toArray());this[0]=[],this.length=1}return this},c._init.prototype=c.prototype,c._init.constructor=c,c.utils={calcRdx:i,isArray:s,isFunction:a,isNumber:l,toVector:function(t){return n.apply([],t)}},c._random_fn=t.random,c.setRandom=function(t){if("function"!=typeof t)throw new TypeError("fn is not a function");c._random_fn=t},c.extend=function(t){var e,n;if(1===arguments.length){for(n in t)c[n]=t[n];return this}for(e=1;e<arguments.length;e++)for(n in arguments[e])t[n]=arguments[e][n];return t},c.rows=function(t){return t.length||1},c.cols=function(t){return t[0].length||1},c.dimensions=function(t){return{rows:c.rows(t),cols:c.cols(t)}},c.row=function(t,e){return s(e)?e.map((function(e){return c.row(t,e)})):t[e]},c.rowa=function(t,e){return c.row(t,e)},c.col=function(t,e){if(s(e)){var n=c.arange(t.length).map((function(){return new Array(e.length)}));return e.forEach((function(e,r){c.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},c.cola=function(t,e){return c.col(t,e).map((function(t){return t[0]}))},c.diag=function(t){for(var e=c.rows(t),n=new Array(e),r=0;r<e;r++)n[r]=[t[r][r]];return n},c.antidiag=function(t){for(var e=c.rows(t)-1,n=new Array(e),r=0;e>=0;e--,r++)n[r]=[t[r][e]];return n},c.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},c.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},c.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},c.alter=function(t,e){return c.map(t,e,!0)},c.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},c.zeros=function(t,e){return l(e)||(e=t),c.create(t,e,u)},c.ones=function(t,e){return l(e)||(e=t),c.create(t,e,f)},c.rand=function(t,e){return l(e)||(e=t),c.create(t,e,c._random_fn)},c.identity=function(t,e){return l(e)||(e=t),c.create(t,e,d)},c.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},c.clear=function(t){return c.alter(t,u)},c.seq=function(t,e,n,r){a(r)||(r=!1);var o,s=[],l=i(t,e),c=(e*l-t*l)/((n-1)*l),u=t;for(o=0;u<=e&&o<n;u=(t*l+c*l*++o)/l)s.push(r?r(u,o):u);return s},c.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},c.slice=function(){function t(t,n,r,o){var i,s=[],a=t.length;if(n===e&&r===e&&o===e)return c.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(c.rowa(e,n.row),(r=n.col||{}).start,r.end,r.step):l(n.col)?t(c.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)})))}}(),c.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=c.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=c.arange(r.row.start,t.min(n[0].length,r.row.end),r.row.step);var u=r.col;return s.forEach((function(t,e){n[t][u]=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=c.arange(r.row.start,t.min(n.length,r.row.end),r.row.step),i=c.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},c.diagonal=function(t){var e=c.zeros(t.length,t.length);return t.forEach((function(t,n){e[n][n]=t})),e},c.copy=function(t){return t.map((function(t){return l(t)?t:t.map((function(t){return t}))}))};var h=c.prototype;return h.length=0,h.push=Array.prototype.push,h.sort=Array.prototype.sort,h.splice=Array.prototype.splice,h.slice=Array.prototype.slice,h.toArray=function(){return this.length>1?r.call(this):r.call(this)[0]},h.map=function(t,e){return c(c.map(this,t,e))},h.cumreduce=function(t,e){return c(c.cumreduce(this,t,e))},h.alter=function(t){return c.alter(this,t),this},function(t){for(var e=0;e<t.length;e++)!function(t){h[t]=function(e){var n,r=this;return e?(setTimeout((function(){e.call(r,h[t].call(r))})),this):(n=c[t](this),s(n)?c(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){h[t]=function(e,n){var r=this;return n?(setTimeout((function(){n.call(r,h[t].call(r,e))})),this):c(c[t](this,e))}}(t[e])}("row col".split(" ")),function(t){for(var e=0;e<t.length;e++)!function(t){h[t]=function(){return c(c[t].apply(null,arguments))}}(t[e])}("create zeros ones rand identity".split(" ")),c}(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,c=o[l=i[e]],u=(a+(a+c-1))/2;s[l]=u,a+=c}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,c,u,f,d=t.slice().sort(r),h=[n.length],p=t.length;for(void 0===i&&(i=3/8),void 0===s&&(s=3/8),a=0;a<n.length;a++)c=p*(l=n[a])+(i+l*(1-i-s)),u=e.floor(o(c,1,p-1)),f=o(c-u,0,1),h[a]=(1-f)*d[u-1]+f*d[u];return h},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 c=l.slice(0,l.length-1);return setTimeout((function(){r.call(a,i[e].apply(a,c))})),this}r=void 0;var u=function(n){return t[e].apply(a,[n].concat(l))};if(this.length>1){for(a=a.transpose();s<a.length;s++)o[s]=u(a[s]);return o}return u(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,c=[.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=c[9],a=8;a>=0;a--)s*=r,s+=c[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,c=0,u=0,f=0,d=t;if(t>171.6243769536076)return 1/0;if(d<=0){if(!(i=d%1+36e-17))return 1/0;l=(1&d?-1:1)*e.PI/e.sin(e.PI*i),d=1-d}for(o=d,r=d<1?d++:(d-=c=(0|d)-1)-1,n=0;n<8;++n)f=(f+s[n])*r,u=u*r+a[n];if(i=f/u+1,o<d)i/=o;else if(o>d)for(n=0;n<c;++n)i*=d,d++;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,c=r+1-n,u=1/1e-30,f=1/c,d=f,h=1,p=-~(8.5*e.log(n>=1?n:1/n)+.4*n+17);if(r<0||n<=0)return NaN;if(r<n+1){for(;h<=p;h++)a+=l*=r/++s;return a*e.exp(-r+n*e.log(r)-i)}for(;h<=p;h++)d*=(f=1/(f=(o=-h*(h-n))*f+(c+=2)))*(u=c+o/u);return 1-d*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,c=1,u=n+r,f=n+1,d=n-1,h=1,p=1-u*t/f;for(e.abs(p)<l&&(p=l),a=p=1/p;c<=100&&(p=1+(i=c*(r-c)*t/((d+(o=2*c))*(n+o)))*p,e.abs(p)<l&&(p=l),h=1+i/h,e.abs(h)<l&&(h=l),a*=(p=1/p)*h,p=1+(i=-(n+c)*(u+c)*t/((n+o)*(f+o)))*p,e.abs(p)<l&&(p=l),h=1+i/h,e.abs(h)<l&&(h=l),a*=s=(p=1/p)*h,!(e.abs(s-1)<3e-7));c++);return a},t.gammapinv=function(n,r){var o,i,s,a,l,c,u=0,f=r-1,d=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),c=e.exp(f*(l-1)-d),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));u<12;u++){if(o<=0)return 0;if((o-=i=(s=(t.lowRegGamma(r,o)-n)/(i=r>1?c*e.exp(-(o-f)+f*(e.log(o)-l)):e.exp(-o+f*e.log(o)-d)))/(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,c=0,u=0;for(t<0&&(t=-t,l=!0),r=4*(n=2/(2+t))-2;a>0;a--)o=c,c=r*c-u+s[a],u=o;return i=n*e.exp(-t*t+.5*(s[0]+r*c)-u),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,c,u,f,d,h,p,m=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,u=(2.30753+.27061*(l=e.sqrt(-2*e.log(a))))/(1+l*(.99229+.04481*l))-l,n<.5&&(u=-u),f=(u*u-3)/6,d=2/(1/(2*r-1)+1/(2*o-1)),h=u*e.sqrt(f+d)/d-(1/(2*o-1)-1/(2*r-1))*(f+5/6-2/(3*d)),u=r/(r+o*e.exp(2*h))):(i=e.log(r/(r+o)),s=e.log(o/(r+o)),u=n<(l=e.exp(r*i)/r)/(h=l+(c=e.exp(o*s)/o))?e.pow(r*h*n,1/r):1-e.pow(o*h*(1-n),1/o)),p=-t.gammaln(r)-t.gammaln(o)+t.gammaln(r+o);g<10;g++){if(0===u||1===u)return u;if((u-=l=(c=(t.ibeta(u,r,o)-n)/(l=e.exp(m*e.log(u)+y*e.log(1-u)+p)))/(1-.5*e.min(1,c*(m/u-y/(1-u)))))<=0&&(u=.5*(u+l)),u>=1&&(u=.5*(u+l+1)),e.abs(l)<1e-8*u&&g>0)break}return u},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,c,u,f=n;if(o||(o=r),n||(n=1),r)return(u=t.zeros(r,o)).alter((function(){return t.randg(n)})),u;n<1&&(n+=1),i=n-1/3,s=1/e.sqrt(9*i);do{do{l=1+s*(c=t.randn())}while(l<=0);l*=l*l,a=t._random_fn()}while(a>1-.331*e.pow(c,4)&&e.log(a)>.5*c*c+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,c=1,u=0,f=0;e.abs((l-f)/l)>o;)f=l,a=c+(i=-(n+u)*(n+r+u)*t/(n+2*u)/(n+2*u+1))*a,l=(s=l+i*s)+(i=(u+=1)*(r-u)*t/(n+2*u-1)/(n+2*u))*l,s/=c=a+i*c,a/=c,l/=c,c=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,c=2*t.normal.cdf(a,0,1,1,0)-1;c=c>=e.exp(-50/o)?e.pow(c,o):0;for(var u=a,f=(8-a)/(l=n>3?2:3),d=u+f,h=0,p=o-1,m=1;m<=l;m++){for(var y=0,g=.5*(d+u),x=.5*(d-u),v=1;v<=12;v++){var T,_=g+x*(6<v?i[(T=12-v+1)-1]:-i[(T=v)-1]),w=_*_;if(w>60)break;var E=2*t.normal.cdf(_,0,1,1,0)*.5-2*t.normal.cdf(_,n,1,1,0)*.5;E>=e.exp(-30/p)&&(y+=E=s[T-1]*e.exp(-.5*w)*e.pow(E,p))}h+=y*=2*x*o/e.sqrt(2*e.PI),u=d,d+=f}return(c+=h)<=e.exp(-30/r)?0:(c=e.pow(c,r))>=1?1:c}!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,c=l,u=n*n/(n*n+r),f=0,d=e.exp(-o*o/2),h=e.exp(-o*o/2-.5*e.log(2)-t.gammaln(1.5))*o;f<200||c>i||l>i;)c=l,f>0&&(d*=o*o/(2*f),h*=o*o/(2*(f+.5))),a+=.5*(l=d*t.beta.cdf(u,f+.5,r/2)+h*t.beta.cdf(u,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,c=(r=e.floor(r))+1,u=o-r,f=c+u,d=e.exp(t.gammaln(f)-t.gammaln(u)-t.gammaln(c)+c*e.log(l)+u*e.log(1-l));return s=l<(c+1)/(f+2)?d*n(l,c,u,a):1-d*n(1-l,u,c,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,c=0;c<n;c++){for(;s>1&&l<i;){var u=1-o/(r-l);a*=u,s*=u,l++}s+=a*=(i-c)*(o-c)/((c+1)*(r-o-i+c+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,c,u,f,d,h=n;for(s=e.sqrt(h),a=e.log(h),l=.02483*(c=.931+2.53*s)-.059,u=1.1239+1.1328/(c-3.4),f=.9277-3.6224/(c-2);;){if(o=e.random()-.5,i=e.random(),d=.5-e.abs(o),r=e.floor((2*l/d+c)*o+h+.43),d>=.07&&i<=f)return r;if(!(r<0||d<.013&&i>d)&&e.log(i)+e.log(u)-e.log(l/(d*d)+c)<=r*a-h-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 c,u=.5*i,f=u*e.log(i)-i*e.log(2)-t.gammaln(u),d=u-1,h=.25*i;c=i<=100?1:i<=800?.5:i<=5e3?.25:.125,f+=e.log(c);for(var p=0,m=1;m<=50;m++){for(var y=0,g=(2*m-1)*c,x=1;x<=16;x++){var v,T;8<x?(v=x-8-1,T=f+d*e.log(g+a[v]*c)-(a[v]*c+g)*h):(v=x-1,T=f+d*e.log(g-a[v]*c)+(a[v]*c-g)*h),T>=-30&&(y+=r(8<x?n*e.sqrt(.5*(a[v]*c+g)):n*e.sqrt(.5*(-a[v]*c+g)),1,s)*l[v]*e.exp(T))}if(m*c>=1&&y<=1e-14)break;p+=y}if(y>1e-14)throw new Error("tukey.cdf failed to converge");return p>1&&(p=1),p},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,c=t.tukey.cdf(i,r,o)-n,u=1;u<50;u++)if(l=i-c*(i-s)/(c-a),a=c,s=i,l<0&&(l=0,c=-n),c=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,c,u,f;if(void 0===e.length&&void 0===n.length)return e*n;if(l=e.length,c=e[0].length,u=t.zeros(l,i=s(n)?n[0].length:c),f=0,s(n)){for(;f<i;f++)for(r=0;r<l;r++){for(a=0,o=0;o<c;o++)a+=e[r][o]*n[o][f];u[r][f]=a}return 1===l&&1===f?u[0][0]:u}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=[],c=0,u=i.length,f=i[0].length;c<u;c++){for(l[c]=[],r=0,o=0;o<f;o++)r+=i[c][o]*a[c][o];l[c]=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,c=0,u=n.length,f=n[0].length,d=1,h=0,p=[];for(o=(n=t.aug(n,r))[0].length,l=0;l<u;l++){for(i=n[l][l],c=l,a=l+1;a<f;a++)i<e.abs(n[a][l])&&(i=n[a][l],c=a);if(c!=l)for(a=0;a<o;a++)s=n[l][a],n[l][a]=n[c][a],n[c][a]=s;for(c=l+1;c<u;c++)for(d=n[c][l]/n[l][l],a=l;a<o;a++)n[c][a]=n[c][a]-d*n[l][a]}for(l=u-1;l>=0;l--){for(h=0,c=l+1;c<=u-1;c++)h+=p[c]*n[l][c];p[l]=(n[l][o-1]-h)/n[l][l]}return p},gauss_jordan:function(n,r){var o,i,s,a=t.aug(n,r),l=a.length,c=a[0].length,u=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 d=a[i];for(a[i]=a[f],a[f]=d,s=i+1;s<l;s++)for(u=a[s][i]/a[i][i],o=i;o<c;o++)a[s][o]-=a[i][o]*u}for(i=l-1;i>=0;i--){for(u=a[i][i],s=0;s<i;s++)for(o=c-1;o>i-1;o--)a[s][o]-=a[i][o]*a[s][i]/u;for(a[i][i]/=u,o=l;o<c;o++)a[i][o]/=u}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,c,u=0,f=0,d=n.length,h=[],p=[],m=[];u<d;u++)for(h[u]=[],p[u]=[],m[u]=[],f=0;f<d;f++)u>f?(h[u][f]=n[u][f],p[u][f]=m[u][f]=0):u<f?(p[u][f]=n[u][f],h[u][f]=m[u][f]=0):(m[u][f]=n[u][f],h[u][f]=p[u][f]=0);for(l=t.multiply(t.multiply(t.inv(m),t.add(h,p)),-1),a=t.multiply(t.inv(m),r),s=o,c=t.add(t.multiply(l,o),a),u=2;e.abs(t.norm(t.subtract(c,s)))>i;)s=c,c=t.add(t.multiply(l,s),a),u++;return c},gauss_seidel:function(n,r,o,i){for(var s,a,l,c,u,f=0,d=n.length,h=[],p=[],m=[];f<d;f++)for(h[f]=[],p[f]=[],m[f]=[],s=0;s<d;s++)f>s?(h[f][s]=n[f][s],p[f][s]=m[f][s]=0):f<s?(p[f][s]=n[f][s],h[f][s]=m[f][s]=0):(m[f][s]=n[f][s],h[f][s]=p[f][s]=0);for(c=t.multiply(t.multiply(t.inv(t.add(m,h)),p),-1),l=t.multiply(t.inv(t.add(m,h)),r),a=o,u=t.add(t.multiply(c,o),l),f=2;e.abs(t.norm(t.subtract(u,a)))>i;)a=u,u=t.add(t.multiply(c,a),l),f+=1;return u},SOR:function(n,r,o,i,s){for(var a,l,c,u,f,d=0,h=n.length,p=[],m=[],y=[];d<h;d++)for(p[d]=[],m[d]=[],y[d]=[],a=0;a<h;a++)d>a?(p[d][a]=n[d][a],m[d][a]=y[d][a]=0):d<a?(m[d][a]=n[d][a],p[d][a]=y[d][a]=0):(y[d][a]=n[d][a],p[d][a]=m[d][a]=0);for(u=t.multiply(t.inv(t.add(y,t.multiply(p,s))),t.subtract(t.multiply(y,1-s),t.multiply(m,s))),c=t.multiply(t.multiply(t.inv(t.add(y,t.multiply(p,s))),r),s),l=o,f=t.add(t.multiply(u,o),c),d=2;e.abs(t.norm(t.subtract(f,l)))>i;)l=f,f=t.add(t.multiply(u,l),c),d++;return f},householder:function(n){for(var r,o,i,s,a=n.length,l=n[0].length,c=0,u=[],f=[];c<a-1;c++){for(r=0,s=c+1;s<l;s++)r+=n[s][c]*n[s][c];for(r=(n[c+1][c]>0?-1:1)*e.sqrt(r),o=e.sqrt((r*r-n[c+1][c]*r)/2),(u=t.zeros(a,1))[c+1][0]=(n[c+1][c]-r)/(2*o),i=c+2;i<a;i++)u[i][0]=n[i][c]/(2*o);f=t.subtract(t.identity(a,l),t.multiply(t.multiply(u,t.transpose(u)),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,c=o[0].length,u=t.zeros(c,c);for(o=t.copy(o),s=0;s<c;s++){for(u[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]/u[s][s];for(a=s+1;a<c;a++)for(u[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]*u[s][a]}return[o,u]}),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}}),c=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}),c=t.multiply(t.slice(r,{row:n}),i);t.sliceAssign(r,{row:o},t.add(l,c))}))})),r}(t.slice(s,{row:{end:a}})),u=t.transpose(l);void 0===u[0].length&&(u=[u]);var f=t.multiply(t.multiply(c,u),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,c,u=1,f=n.length,d=t.identity(f,f),h=[];1===u;){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,(c=t.identity(f,f))[i][i]=e.cos(l),c[i][s]=-e.sin(l),c[s][i]=e.sin(l),c[s][s]=e.cos(l),d=t.multiply(d,c),n=t.multiply(t.multiply(t.inv(c),n),c),u=0,r=1;r<f;r++)for(o=1;o<f;o++)r!=o&&e.abs(n[r][o])>.001&&(u=1)}for(r=0;r<f;r++)h.push(n[r][r]);return[d,h]},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,c,u=0,f=(r-n)/2,d=[],h=[],p=[];u<o/2;){for(c=t(n),a=n,l=0;a<=r;a+=f,l++)d[l]=a;for(i=d.length,a=1;a<i-1;a++)c+=(a%2!=0?4:2)*t(d[a]);c=f/3*(c+t(r)),p[u]=c,f/=2,u++}for(s=p.length,i=1;1!==s;){for(a=0;a<s-1;a++)h[a]=(e.pow(4,i)*p[a+1]-p[a])/(e.pow(4,i)-1);s=h.length,p=h,h=[],i++}return p},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,c,u,f=e.abs(r-t[i(t,r)+1]),d=0,h=[],p=[];o>=f;)s=i(t,r+o),a=i(t,r),h[d]=(n[s]-2*n[a]+n[2*a-s])/(o*o),o/=2,d++;for(c=h.length,l=1;1!=c;){for(u=0;u<c-1;u++)p[u]=(e.pow(4,l)*h[u+1]-h[u])/(e.pow(4,l)-1);c=p.length,h=p,p=[],l++}return h},simpson:function(t,e,n,r){for(var o,i=(n-e)/r,s=t(e),a=[],l=e,c=0,u=1;l<=n;l+=i,c++)a[c]=l;for(o=a.length;u<o-1;u++)s+=(u%2!=0?4:2)*t(a[u]);return i/3*(s+t(n))},hermite:function(t,e,n,r){for(var o,i=t.length,s=0,a=0,l=[],c=[],u=[],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(c[a]=0,o=0;o<i;o++)a!=o&&(c[a]+=1/(t[a]-t[o]));u[a]=(1-2*(r-t[a])*c[a])*(l[a]*l[a]),f[a]=(r-t[a])*(l[a]*l[a]),s+=u[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=[],c=[],u=[],f=[],d=[],h=[];a<s-1;a++)f[a]=e[a+1]-e[a];for(u[0]=0,a=1;a<s-1;a++)u[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]=[],c[a]=[],l[a][a-1]=f[a-1],l[a][a]=2*(f[a-1]+f[a]),l[a][a+1]=f[a],c[a][0]=u[a];for(i=t.multiply(t.inv(l),c),o=0;o<s-1;o++)d[o]=(n[o+1]-n[o])/f[o]-f[o]*(i[o+1][0]+2*i[o][0])/3,h[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])*d[o]+t.sq(r-e[o])*i[o]+(r-e[o])*t.sq(r-e[o])*h[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,c=0,u=[],f=[],d=[],h=[],p=[],m=[],y=[];for(c=0;c<a;c++)u[c]=t.sum(e[c])/l;for(c=0;c<l;c++)for(p[c]=[],n=0;n<a;n++)p[c][n]=e[n][c]-u[n];for(p=t.transpose(p),c=0;c<a;c++)for(m[c]=[],n=0;n<a;n++)m[c][n]=t.dot([p[c]],[p[n]])/(l-1);for(s=(o=t.jacobi(m))[0],f=o[1],y=t.transpose(s),c=0;c<f.length;c++)for(n=c;n<f.length;n++)f[c]<f[n]&&(r=f[c],f[c]=f[n],f[n]=r,d=y[c],y[c]=y[n],y[n]=d);for(i=t.transpose(p),c=0;c<a;c++)for(h[c]=[],n=0;n<i.length;n++)h[c][n]=t.dot([y[c]],[i[n]]);return[e,f,y,h]}}),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,c,u,f=n.call(arguments);if(1===f.length){for(a=new Array(f[0].length),c=0;c<f[0].length;c++)a[c]=f[0][c];f=a}for(o=new Array,c=0;c<f.length;c++)o=o.concat(f[c]);for(i=t.mean(o),r=0,c=0;c<f.length;c++)r+=f[c].length*e.pow(t.mean(f[c])-i,2);for(r/=f.length-1,l=0,c=0;c<f.length;c++)for(s=t.mean(f[c]),u=0;u<f[c].length;u++)l+=e.pow(f[c][u]-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,c=n.call(arguments);return r(c[0])?(o=c[0],i=c[1],s=c[2],a=c[3],l=c[4]):(o=t.mean(c[0]),i=t.mean(c[1]),s=c[0].length,a=c[1].length,l=c[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),c=e.mean(t),u=e.sum(a.map((function(t){return Math.pow(t-c,2)}))),f=e.sum(t.map((function(t,e){return Math.pow(t-a[e],2)}))),d=u+f;return{exog:n,endog:t,nobs:r,df_model:o,df_resid:i,coef:s,predict:a,resid:l,ybar:c,SST:d,SSE:u,SSR:f,R2:u/d}}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]})),c=l.map((function(t){var r=e.studentt.cdf(t,n.df_resid);return 2*(r>.5?1-r:r)})),u=e.studentt.inv(.975,n.df_resid),f=n.coef.map((function(t,e){var n=u*a[e];return[t-n,t+n]}));return{se:a,t:l,p:c,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,c,u,f=e.xtranspxinv(t),d=0;d<o.length;d++)l=Math.sqrt(i.anova.mse*Math.abs(f[d][d])),c=Math.abs(o[d]/l),u=e.ttest(c,n.length-t[0].length-1,r),i.stats[d]=[o[d],l,c,u];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)},184:(t,e,n)=>{"use strict";n.d(e,{$:()=>s});var r=n(976),o=n(870),i=n(874);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.cv);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)}}},638:(t,e,n)=>{"use strict";n.d(e,{d:()=>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))}))}},840:(t,e,n)=>{"use strict";n.d(e,{YC:()=>c,lf:()=>u});var r=n(976),o=(n(469),n(363),n(102)),i=n(414),s=n.n(i),a=n(638);function l(t,e){return Math.random()*(e-t)+t}function c(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,c=a+e*(t-1);for(let t=a,l=0;t<=c;t+=e,l++)for(let e=0;e<n;e++){r[l*n+e]=t-a+.1;const c=new Float32Array(4);c.set(s),i[l*n+e]=(0,o.XD)(c,t)}const u=(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,u);return{x:r,y:i,params:s}}function u(t,e,n){var o;const i=r.DataFrame.create(t);for(let l=0;l<e;l++){const e=3===l?5:1,u=i.columns.addNewString(`json chart ${l}`);u.semType=a.d.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=c(15,.5,e);let u=r.Color.toHtml(r.Color.getCategoricalColor(l*n+i));null===(o=t.series)||void 0===o||o.push({parameters:void 0,fitLineColor:u,pointColor:u,showCurveConfidenceInterval:1===f,points:s().count().take(15*e).map((function(t){return{x:a.x[t],y:a.y[t]}})).toArray()})}u.set(i,JSON.stringify(t))}}return i}},188:(t,e,n)=>{"use strict";n.d(e,{No:()=>l,hS:()=>a});var r,o=n(976),i=(n(870),n(416));n(102),n(874),n(184),n(711),n(638),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.Y6)(t);if(t.parameters)e.logX&&t.parameters[2]>0&&(t.parameters[2]=Math.log10(t.parameters[2]));else{const r=(0,i.PK)(t,n,e).parameters;t.parameters=[...r]}return(0,i.tq)(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},c=[],u=[],f=[],d=[],h=[],p=[],m=[];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);c[n]=r.rSquared,u[n]=r.auc,f[n]=r.interceptX,d[n]=r.interceptY,h[n]=r.slope,p[n]=r.top,m[n]=r.bottom,n++}return{rSquared:c.some((t=>null==t))?void 0:o.Stats.fromValues(c)[s[e]],auc:u.some((t=>null==t))?void 0:o.Stats.fromValues(u)[s[e]],interceptX:f.some((t=>null==t))?void 0:o.Stats.fromValues(f)[s[e]],interceptY:d.some((t=>null==t))?void 0:o.Stats.fromValues(d)[s[e]],slope:h.some((t=>null==t))?void 0:o.Stats.fromValues(h)[s[e]],top:p.some((t=>null==t))?void 0:o.Stats.fromValues(p)[s[e]],bottom:m.some((t=>null==t))?void 0:o.Stats.fromValues(m)[s[e]]}}o.ObjectHandler},711:(t,e,n)=>{"use strict";n.d(e,{f:()=>c});var r=n(976),o=n(102);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.yB;const l=t.getElementsByTagName("settings")[0].getAttribute("markerColor"),c=t.getElementsByTagName("settings")[0].getAttribute("color"),u=!!t.getElementsByTagName("settings")[0].getAttribute("drawLine"),f={name:t.getAttribute("name"),fitFunction:a,markerType:r.MARKER_TYPE.CIRCLE,pointColor:l,fitLineColor:c,showFitLine:u,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 c(t){const e=(new DOMParser).parseFromString(t,"text/xml"),n=e.getElementsByTagName("grid")[0],r=(c=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:c.getAttribute("xLabel"),yAxisName:c.getAttribute("yLabel"),logX:!!c.getAttribute("logX")});var o,c;const u=e.getElementsByTagName("seriesCollection")[0],f=a(u.getElementsByTagName("series")[0]),d=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}(u);return{chartOptions:r,seriesOptions:f,series:d}}},874:(t,e,n)=>{"use strict";n.d(e,{cv:()=>k,W$:()=>R,hq:()=>X,jG:()=>M,fi:()=>F,Ce:()=>D,BI:()=>O,kb:()=>G});var r=n(976),o=n(469),i=n(870),s=n(102),a=n(766),l=n(416),c=n(711),u=n(184),f=n(188),d=n(638),h=n(111);const p=window,m=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2});class y{static getUniqueName(t,e,n){return p.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 m.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=e.connectDots?d.d.POINT_PX_SIZE*n.ratio:i.outlier?d.d.OUTLIER_PX_SIZE*n.ratio:i.size?i.size:d.d.POINT_PX_SIZE*n.ratio;r.Paint.marker(t,e.connectDots?a:i.outlier?r.MARKER_TYPE.OUTLIER:a,n.viewport.xToScreen(i.x),n.viewport.yToScreen(i.y),s,l),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,h.G)(a);if(t.beginPath(),T(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,d.d.CANDLESTICK_OUTLIER_PX_SIZE*n.ratio);i=null}}}(t,e,n))}function T(t,e){_(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,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,d.d.CANDLESTICK_MEDIAN_PX_SIZE*e.ratio)}function _(t,e,n,r){t.moveTo(r.xToScreen(e)-d.d.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n)),t.lineTo(r.xToScreen(e)+d.d.CANDLESTICK_BORDER_PX_SIZE/2,r.yToScreen(n))}function w(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(d.d.LINE_STYLES[e.lineStyle]);const r=n.showAxes?n.showAxesLabels?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN:0,o=n.showAxes?d.d.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 E(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:d.d.CONFIDENCE_INTERVAL_STROKE_COLOR,t.fillStyle=null!==(s=e.confidenceIntervalColor)&&void 0!==s?s:d.d.CONFIDENCE_INTERVAL_FILL_COLOR;const r=(0,l.LC)(e,n.fitFunc,n.userParamsFlag,n.logOptions);I(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:d.d.CURVE_CONFIDENCE_INTERVAL_BOUNDS.TOP}),I(t,{viewport:n.viewport,logOptions:n.logOptions,showAxes:n.showAxes,showAxesLabels:n.showAxesLabels,screenBounds:n.screenBounds,confidenceIntervals:r,confidenceType:d.d.CURVE_CONFIDENCE_INTERVAL_BOUNDS.BOTTOM}),function(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?d.d.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 I(t,e){t.beginPath();const n=e.showAxes?e.showAxesLabels?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN:0,r=e.showAxes?d.d.AXES_RIGHT_PX_MARGIN:0,o=e.confidenceType===d.d.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 C(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 N(t,e,n){var r;if((null===(r=e.showFitLine)||void 0===r||r)&&n.statistics){const r=(0,l.tq)(e,n.fitFunc,n.logOptions);for(let o=0;o<n.statistics.length;o++){const i=n.statistics[o],a=s.sw.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 b(t,e,n){t.beginPath(),t.fillStyle="black";const r=t.measureText(e).width;t.fillText(e,n.dataBox.maxX-r,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN+(n.columnIdx*d.d.LEGEND_RECORD_PX_HEIGHT+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend))}function L(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-d.d.LEGEND_RECORD_LINE_PX_WIDTH-d.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN-d.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.lineTo(n.dataBox.maxX-o-d.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN-d.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.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-d.d.LEGEND_RECORD_LINE_RIGHT_PX_MARGIN-d.d.LEGEND_RECORD_LINE_PX_WIDTH/2,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN-d.d.LEGEND_RECORD_LINE_BOTTOM_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend,e.pointColor,d.d.POINT_PX_SIZE*n.ratio),t.fillStyle=e.fitLineColor,t.fillText(e.name,n.dataBox.maxX-o,n.dataBox.y+d.d.LEGEND_TOP_PX_MARGIN+(n.showColumnLabel?d.d.LEGEND_RECORD_PX_HEIGHT*(n.columnIdx+1):0)+d.d.LEGEND_RECORD_PX_HEIGHT*n.drawnCurvesInLegend),t.stroke()}function S(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),0,30,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 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 R(t){var e,n,o,i,a;let u=t.cell.value;u.includes("|")&&(u=u.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(d.d.TAG_FIT_CHART_FORMAT)===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(u):null!==(o=JSON.parse(null!=u?u:"{}"))&&void 0!==o?o:{}:(0,l.TL)(),h=t.cell.column?X(t.cell.column):{},p=t.cell.column?M(t.cell.dataFrame):{};null!==(i=f.series)&&void 0!==i||(f.series=[]),null!==(a=f.chartOptions)&&void 0!==a||(f.chartOptions=h.chartOptions),O(s.kW,h.chartOptions,f.chartOptions),O(s.kW,p.chartOptions,f.chartOptions);for(const t of f.series)O(s.K0,f.seriesOptions,t),O(s.K0,h.seriesOptions,t),O(s.K0,p.seriesOptions,t);return f}function M(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=d.d.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.TL)()))}function X(t){var e,n,r;return JSON.parse(null!==(e=(n=t.tags)[r=d.d.TAG_FIT])&&void 0!==e?e:n[r]=JSON.stringify((0,l.TL)()))}function D(t,e,n){if(t.width<d.d.MIN_AXES_CELL_PX_WIDTH||t.height<d.d.MIN_AXES_CELL_PX_HEIGHT)return[t,void 0,void 0];const r=e?d.d.AXES_LEFT_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_LEFT_PX_MARGIN,o=e?d.d.AXES_BOTTOM_PX_MARGIN_WITH_AXES_LABELS:d.d.AXES_BOTTOM_PX_MARGIN,i=n?d.d.AXES_TOP_PX_MARGIN_WITH_TITLE:d.d.AXES_TOP_PX_MARGIN;return[t.cutLeft(r).cutBottom(o).cutTop(i).cutRight(d.d.AXES_RIGHT_PX_MARGIN),t.getBottom(o).getTop(i).cutLeft(r).cutRight(d.d.AXES_RIGHT_PX_MARGIN),t.getLeft(r).getRight(d.d.AXES_RIGHT_PX_MARGIN).cutBottom(o).cutTop(i)]}function F(t){return null!=t&&""!==t&&void 0!==r.Color.fromHtml(t)}function G(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)}}class k extends r.GridCellRenderer{get name(){return d.d.FIT_CELL_TYPE}get cellType(){return d.d.FIT_CELL_TYPE}getDefaultSize(t){return{width:d.d.CELL_DEFAULT_WIDTH,height:d.d.CELL_DEFAULT_HEIGHT}}onClick(t,e){var n,r,s,u,h,p,m;if(!t.cell.value)return;const y=t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(t.cell.value):R(t);for(const[t,e]of Object.entries(d.d.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(d.d.INFLATE_SIZE,d.d.INFLATE_SIZE),x=D(g,this.areAxesLabelsShown(g,y),this.isTitleShown(g,y))[0],v=(0,l.dU)(y),T=new a.l(v,x,null!==(r=null===(n=y.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==r&&r,null!==(u=null===(s=y.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==u&&u);for(let n=0;n<(null===(h=y.series)||void 0===h?void 0:h.length);n++)if(!(y.series[n].connectDots||!y.series[n].clickToToggle||"points"!==y.series[n].showPoints||g.width<d.d.MIN_AXES_CELL_PX_WIDTH||g.height<d.d.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,T)){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===(p=y.chartOptions)||void 0===p?void 0:p.logX,logY:null===(m=y.chartOptions)||void 0===m?void 0:m.logY},o=null!==r.tags[".seriesAggregation"]?(0,f.No)(y,r.tags[".seriesAggregation"]):r.tags[".seriesNumber"]===n?(0,f.hS)(y.series[n],e):null;null!==o&&r.set(t.cell.rowIndex,o[r.tags[".statistics"]])}if(t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)!==d.d.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=u.$.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>=d.d.MIN_AXES_CELL_PX_WIDTH&&t.height>=d.d.MIN_AXES_CELL_PX_HEIGHT}areAxesLabelsShown(t,e){var n;return t.width>=d.d.MIN_X_AXIS_NAME_VISIBILITY_PX_WIDTH&&t.height>=d.d.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>=d.d.MIN_TITLE_PX_WIDTH&&t.height>=d.d.MIN_TITLE_PX_HEIGHT&&!!(null===(n=e.chartOptions)||void 0===n?void 0:n.title)}isLegendShown(t){return t.width>=d.d.MIN_LEGEND_PX_WIDTH&&t.height>=d.d.MIN_LEGEND_PX_HEIGHT}areDroplinesShown(t){return t.width>=d.d.MIN_DROPLINES_VISIBILITY_PX_WIDTH&&t.height>=d.d.MIN_DROPLINES_VISIBILITY_PX_HEIGHT}renderCurves(t,e,n){var r,o,i,s,c,u,f,h,p,m,y,T,_,I,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)))))&&G(n);const[S,O,P]=D(e,this.areAxesLabelsShown(e,n),this.isTitleShown(e,n)),R=(0,l.dU)(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,S,null!==(c=null===(s=n.chartOptions)||void 0===s?void 0:s.logX)&&void 0!==c&&c,null!==(f=null===(u=n.chartOptions)||void 0===u?void 0:u.logY)&&void 0!==f&&f),X=Math.min(S.width,S.height),F=X>100?1:.2+X/100*.8,k={logX:null===(h=n.chartOptions)||void 0===h?void 0:h.logX,logY:null===(p=n.chartOptions)||void 0===p?void 0:p.logY};t.save(),t.font='11px Roboto, "Roboto Local"',M.drawCoordinateGrid(t,O,P),t.restore();for(let r=0;r<(null===(m=n.series)||void 0===m?void 0:m.length);r++){const o=n.series[r];if(o.points.some((t=>void 0===t.x||void 0===t.y)))continue;(e.width<d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||e.height<d.d.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.Y6)(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.kG)(o,s);else{const t=(0,l.PK)(o,s,k);a=t.fittedCurve;const e=[...t.parameters];o.parameters=e,i=!1}g(o,r),x(t,o,{viewport:M,ratio:F}),v(t,o,{viewport:M,ratio:F}),w(t,o,{viewport:M,ratio:F,logOptions:k,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,curveFunc:a}),E(t,o,{viewport:M,logOptions:k,showAxes:this.areAxesShown(e),showAxesLabels:this.areAxesLabelsShown(e,n),screenBounds:e,fitFunc:s,userParamsFlag:i}),C(t,o,{viewport:M,ratio:F,showDroplines:this.areDroplinesShown(e),xValue:o.parameters[2],dataBounds:R,curveFunc:a,logOptions:k}),N(t,o,{statistics:null===(T=n.chartOptions)||void 0===T?void 0:T.showStatistics,fitFunc:s,logOptions:k,dataBox:S})}!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===(_=n.chartOptions)||void 0===_?void 0:_.title,dataBox:S,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-d.d.X_AXIS_LABEL_BOTTOM_PX_MARGIN),t.translate(e.screenBounds.x,e.screenBounds.y),t.rotate(-Math.PI/2);const n=e.showTitle?d.d.AXES_TOP_PX_MARGIN_WITH_TITLE:d.d.AXES_TOP_PX_MARGIN;t.fillText(e.yAxisName,-(e.dataBox.height/2+n+15),15),t.restore()}}(t,{showTitle:this.isTitleShown(e,n),dataBox:S,screenBounds:e,showAxesLabels:this.areAxesLabelsShown(e,n),xAxisName:null===(I=n.chartOptions)||void 0===I?void 0:I.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 c=a[r];(null===(o=e.chartOptions)||void 0===o?void 0:o.showColumnLabel)&&b(t,c,{dataBox:n.dataBox,columnIdx:r,drawnCurvesInLegend:l});const u=null===(i=e.series)||void 0===i?void 0:i.filter((t=>t.columnName===c));for(let o=0;o<(null==u?void 0:u.length);o++){const i=u[o];""!==i.name&&null!==i.name&&void 0!==i.name&&(L(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:S,ratio:F}),t.restore()}render(t,e,n,o,i,s,a){var l,u,f;if(!s.cell.value)return;if(o<d.d.MIN_CELL_RENDERER_PX_WIDTH||i<d.d.MIN_CELL_RENDERER_PX_HEIGHT)return;const h=(null===(l=s.cell.column)||void 0===l?void 0:l.getTag(d.d.TAG_FIT_CHART_FORMAT))===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(s.cell.value):R(s),p=new r.Rect(e,n,o,i).inflate(d.d.INFLATE_SIZE,d.d.INFLATE_SIZE);for(const[e,n]of Object.entries(d.d.CONDITION_MAP))if(n(h.series))return void S(t,p);null===(u=h.series)||void 0===u||u.forEach((t=>t.columnName=s.cell.column.name)),(null===(f=h.chartOptions)||void 0===f?void 0:f.mergeSeries)&&(h.series=[P(h.series)]),this.renderCurves(t,p,h)}hitTest(t,e,n){const o=n.xToScreen(e.x),i=n.yToScreen(e.y),s=(e.outlier?d.d.OUTLIER_PX_SIZE:d.d.POINT_PX_SIZE)/2+d.d.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,u,f;if(!t.cell.value)return;const h=t.bounds.inflate(d.d.INFLATE_SIZE,d.d.INFLATE_SIZE);if(h.width<d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH||h.height<d.d.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 p=t.cell.column.getTag(d.d.TAG_FIT_CHART_FORMAT)===d.d.TAG_FIT_CHART_FORMAT_3DX?(0,c.f)(t.cell.value):R(t);if(h.width>=d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_WIDTH&&h.height>=d.d.MIN_POINTS_AND_STATS_VISIBILITY_PX_HEIGHT){const t=D(h,this.areAxesLabelsShown(h,p),this.isTitleShown(h,p))[0],c=(0,l.dU)(p),m=new a.l(c,t,null!==(o=null===(n=p.chartOptions)||void 0===n?void 0:n.logX)&&void 0!==o&&o,null!==(u=null===(s=p.chartOptions)||void 0===s?void 0:s.logY)&&void 0!==u&&u);for(let t=0;t<(null===(f=p.series)||void 0===f?void 0:f.length);t++)if("points"===p.series[t].showPoints)for(let n=0;n<p.series[t].points.length;n++){const o=p.series[t].points[n];if(this.hitTest(e,o,m))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(!p.series[t].connectDots&&p.series[t].clickToToggle&&h.width>=d.d.MIN_AXES_CELL_PX_WIDTH&&h.height>=d.d.MIN_AXES_CELL_PX_HEIGHT&&(document.body.style.cursor="pointer"))}i.tooltip.hide()}document.body.style.cursor="default"}}},363:(t,e,n)=>{"use strict";var r=n(976);n(188),n(874),n(870),n(184),n(102),rxjs.operators,rxjs,n(638),n(840),n(711),new r.Package},976:t=>{"use strict";t.exports=DG},469:t=>{"use strict";t.exports=grok},870:t=>{"use strict";t.exports=ui},414:t=>{"use strict";t.exports=wu}},e={};function n(r){var o=e[r];if(void 0!==o)return o.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}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})};var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>Q,test:()=>J,tests:()=>d});var t=n(976),e=n(469);n(133);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),c=console.info.bind(console),u=console.warn.bind(console),f=console.error.bind(console),d={},h="Auto Tests",p="Demo",m="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 T{constructor(t,e){this.catchUnhandled=!0,this.report=!1,void 0!==t&&(this.catchUnhandled=t),void 0!==e&&(this.report=e)}}class _{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 w(t,e,n){null==d[x]&&(d[x]={}),null==d[x].tests&&(d[x].tests=[]),d[x].tests.push(new _(x,t,e,n))}function E(t,e=!0,n){if(n=n?`${n}, `:"",t!==e)throw new Error(`${n}Expected "${e}", got "${t}"`)}function I(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(E(o,!0,`${null!=r?r:""} (tolerance = ${n})`),!o)throw new Error(`Expected ${e}, got ${t} (tolerance = ${n})`)}function C(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)C(e,r);else if(Number.isFinite(e)&&Number.isFinite(r))I(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)C(t[r],e[r]);else if(t[r]!=e[r])throw new Error(`Expected ${e[r]} at position ${r}, got ${t[r]}`)}function N(t,e,n){var r;x=t,e(),d[x]&&(d[x].clear=null===(r=null==n?void 0:n.clear)||void 0===r||r,d[x].timeout=null==n?void 0:n.timeout)}function b(t,e){return t.replace(new RegExp(e.name,"gi"),e.nqName)}function L(e){return`${e.toString()}\n${e.stack?t.Logger.translateStackTrace(e.stack):""}`}function S(n,r,o,c,u,f){var d,h,p,m,y,g;return i(this,void 0,void 0,(function*(){let i;o.length=0;let x="package";const v=null!=r&&n.name.toLowerCase()!==r.toLowerCase(),T=(null===(d=n.options)||void 0===d?void 0:d.skipReason)||v,_=v?"skipped":null===(h=n.options)||void 0===h?void 0:h.skipReason;T||l(`Started ${n.category} ${n.name}`);const w=Date.now();try{if(T)i={success:!0,result:_,ms:0,skipped:!0};else{let e=(null===(p=n.options)||void 0===p?void 0:p.timeout)===s&&c?c:null===(m=n.options)||void 0===m?void 0:m.timeout;e=t.Test.isInBenchmark&&e===s?a:e,i={success:!0,result:null!==(y=yield P(n.test,e))&&void 0!==y?y:"OK",ms:0,skipped:!1}}}catch(t){i={success:!1,result:L(t),ms:0,skipped:!1}}if((null===(g=n.options)||void 0===g?void 0:g.isAggregated)&&i.result.constructor===t.DataFrame){const t=i.result.col("success");if(x="core",t&&(i.success=t.stats.sum===t.length),!f){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()-w,T||l(`Finished ${n.category} ${n.name} for ${i.ms} ms`),i.category=n.category,i.name=n.name,!v){let t={success:i.success,result:i.result,ms:i.ms,skipped:i.skipped,type:x,packageName:u,category:n.category,test:n.name,logs:i.logs};if(i.result.constructor==Object){const e=Object.keys(i.result).reduce(((t,e)=>Object.assign(Object.assign({},t),{["result."+e]:i.result[e]})),{});t=Object.assign(Object.assign({},t),e)}e.log.usage(`${u}: ${n.category}: ${n.name}`,t,`test-${x} ${u}: ${n.category}: ${n.name}`)}return i}))}function O(t){return i(this,void 0,void 0,(function*(){yield new Promise((e=>setTimeout(e,t)))}))}function P(t,e){return i(this,void 0,void 0,(function*(){let n=null;const r=new Promise(((t,r)=>{n=setTimeout((()=>{r("EXECUTION TIMEOUT")}),e)}));try{return yield Promise.race([t(),r])}finally{n&&clearTimeout(n)}}))}t.DataFrame.fromColumns([t.Column.fromStrings("col",["val1","val2","val3"])]);var R=n(638),M=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())}))};N("detectors",(()=>{w("detectFitCurves",(()=>M(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),E(r.semType,R.d.FIT_SEM_TYPE),E(o.semType,R.d.FIT_SEM_TYPE),E(i.semType,R.d.FIT_SEM_TYPE)})))),w("detectXMLCurveChart",(()=>M(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),E(r.semType,R.d.FIT_SEM_TYPE),E(r.tags[R.d.TAG_FIT_CHART_FORMAT],R.d.TAG_FIT_CHART_FORMAT_3DX)}))))}));var X=n(870),D=n(414),F=n.n(D),G=n(840),k=n(874),B=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 Y(e){const n={series:[],chartOptions:{showStatistics:["auc"]}},r=(0,G.YC)(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:F().count().take(e).map((function(t){return{x:r.x[t],y:r.y[t]}})).toArray()},n}N("creation",(()=>{w("fit curve creation",(()=>B(void 0,void 0,void 0,(function*(){const n=Date.now(),r=(0,G.lf)(t.Test.isInBenchmark?1e3:100,5,2);e.shell.addTableView(r);const o=Date.now();return yield O(50),console.log(`Creation took ${o.valueOf()-n.valueOf()} ms`),`${t.Test.isInBenchmark?1e3:100} points, took ${o.valueOf()-n.valueOf()} ms`}))))})),N("rendering",(()=>{w("rendering same fitChartData on canvas",(()=>B(void 0,void 0,void 0,(function*(){const n=X.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new k.cv,i=Y(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(R.d.INFLATE_SIZE,R.d.INFLATE_SIZE),i),r.clearRect(0,0,160,120);return"rendering performed 1000 times"})))),w("rendering different fitChartData on canvas",(()=>B(void 0,void 0,void 0,(function*(){const n=X.canvas(160,120);e.shell.newView("canvas",[n]);const r=n.getContext("2d"),o=new k.cv;for(let e=1;e<=1e3;e++){const e=Y(t.Test.isInBenchmark?50:15);o.renderCurves(r,new t.Rect(n.clientLeft,n.clientTop,160,120).inflate(R.d.INFLATE_SIZE,R.d.INFLATE_SIZE),e),r.clearRect(0,0,160,120)}return"rendering performed 1000 times"})))),w("rendering in grid",(()=>B(void 0,void 0,void 0,(function*(){const t=(0,G.lf)(30,5,2),n=e.shell.addTableView(t);yield O(100);const r=n.grid.root.getElementsByTagName("canvas")[2],o=new Date;yield function(t,e,n,r){return B(this,void 0,void 0,(function*(){for(let e=0;e<10;e++)t.dispatchEvent(new WheelEvent("wheel",{deltaY:300})),yield O(10)}))}(r);const i=new Date;return console.log(`curves rendering took ${i.valueOf()-o.valueOf()} ms`),i.valueOf()-o.valueOf()+" ms"}))))}));var H=n(766);N("viewport",(()=>{w("viewportMethods",(()=>{return e=void 0,n=void 0,o=function*(){const e=new t.Rect(120,20,160,100).inflate(R.d.INFLATE_SIZE,R.d.INFLATE_SIZE),[n]=(0,k.Ce)(e,!1,!1),r=new t.Rect(.1,.06,7,5.94),o=new H.l(r,n,!1,!1);E(o.xToScreen(1.5),182.4),E(o.yToScreen(2.33),73.01346801346801),E(o.xToWorld(150),-.9652173913043479),E(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 q=n(416),V=n(102),j=n(111),W=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 U={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]},$={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]},K=(0,q.Y6)(U),Z=(0,q.Y6)($);N("fit",(()=>{w("getSeriesFitFunction",(()=>W(void 0,void 0,void 0,(function*(){var t;const{xs:e,ys:n}=(0,q.q_)(U.points),{xs:r,ys:o}=(0,q.q_)($.points);E(K.name,V.yB),E(Z.name,"Polynomial"),A(K.parameterNames,["Top","Bottom","Slope","IC50"]),A(Z.parameterNames,["Slope","Intercept","Parameter3","Parameter4"]),A(K.getInitialParameters(e,n),[1.8561450242996216,1,5.099999904632568,.23361243307590485]),A(Z.getInitialParameters(r,o),[.1,-1,4,4]);const i=new Float32Array(null===(t=U.parameters)||void 0===t?void 0:t.length);i.set(U.parameters),E(K.y(i,1.1),1.6914214561555851),E(Z.y(Z.getInitialParameters(r,o),1.1),7.3231)})))),w("getCurve",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,q.kG)(U,K),e=(0,q.kG)($,Z);E(t(2.5),1.690786623428712),E(t(5.8858),.5356638447565519),E(e(1.56),7.650264639782428),E(e(3.99876),6.093284856699922)})))),w("fitSeries",(()=>W(void 0,void 0,void 0,(function*(){const t=Date.now(),e=(0,q.PK)(U,K),n=(0,q.PK)($,Z),r=Date.now();return E(e.fittedCurve(2.5),1.7023284700958918),E(n.fittedCurve(3.99876),4.793906282943224),A(e.parameters,[1.7039494514465332,1.030500888824463,5.367032051086426,.2426503598690033]),A(n.parameters,[.09034820646047592,-1.148695945739746,3.3145318031311035,4.130721569061279]),r.valueOf()-t.valueOf()+" ms"})))),w("getSeriesConfidenceInterval",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,q.LC)(U,K,!0),e=(0,q.LC)($,Z,!0);E(t.confidenceTop(2.578),1.8540855269320198),E(e.confidenceTop(2.3342),10.03522960294218),E(t.confidenceBottom(3.987),1.4949306416468298),E(e.confidenceBottom(3.8796),4.1686506915250385)})))),w("getSeriesStatistics",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,q.tq)(U,K),e=(0,q.tq)($,Z);E(t.auc,9.335422628533761),E(e.auc,36.525538394763096),E(t.rSquared,.9781915962461156),E(e.rSquared,.846055768956569)})))),w("calculateBoxPlotStatistics",(()=>W(void 0,void 0,void 0,(function*(){const t=(0,j.G)([.7654603719711304,.8199243545532227,.8257747292518616,.9558155536651611,.9596694707870483]);E(t.q1,.8199243545532227),E(t.q2,.8257747292518616),E(t.q3,.9558155536651611),E(t.lowerAdjacentValue,.7654603719711304),E(t.upperAdjacentValue,.9558155536651611)})))),w("sigmoid",(()=>W(void 0,void 0,void 0,(function*(){const t=new Float32Array(4);t.set([2.612687371569039,-1.421800778574126,5.16688669906018,.341788492203575]),E((0,V.XD)(t,.5),.341789026340178),E((0,V.XD)(t,2.5),.34215523020636207),E((0,V.XD)(t,5.678976),2.2548815999597016)}))))}));var z=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 Q=new t.Package;function J(n,r,s){return z(this,void 0,void 0,(function*(){const a=yield function(n){var r,s,a,x,v,w,I;return i(this,void 0,void 0,(function*(){const C=null===(s=null===(r=e.functions.getCurrentCall())||void 0===r?void 0:r.func)||void 0===s?void 0:s.package;yield function(n,r){var s;return i(this,void 0,void 0,(function*(){const r=n.id;if(g[r])return;const a=d;if(void 0!==a[h]||void 0!==a[p]||Object.keys(a).find((t=>t.startsWith(h)||t.startsWith(y))))return void(g[r]=!0);if("DevTools"===n.name){const e=t.Func.find({tags:["dartTest"]});for(const t of e){const e=t.name.split(/\s*\|\s*/g),n=null!==(s=e.pop())&&void 0!==s?s:t.name,r=e.length?y+": "+e.join(": "):y;void 0===a[r]&&(a[r]={tests:[],clear:!0}),a[r].tests.push(new _(r,n,(()=>i(this,void 0,void 0,(function*(){return yield t.apply()}))),{isAggregated:t.outputs.length>0,timeout:3e5}))}}const l=[],c=[],u=[],f=yield e.dapi.functions.filter(`package.id = "${r}"`).list(),x=new RegExp(/skip:\s*([^,\s]+)|wait:\s*(\d+)|cat:\s*([^,\s]+)|timeout:\s*(\d+)/g);for(const t of f){const n=t.options.test,r=t.options.demoPath;if(n&&Array.isArray(n)&&n.length)for(let r=0;r<n.length;r++){const o=n[r].matchAll(x),s={};Array.from(o).forEach((t=>{t[0].startsWith("skip")?s.skip=t[1]:t[0].startsWith("wait")?s.wait=parseInt(t[2]):t[0].startsWith("cat")?s.cat=t[3]:t[0].startsWith("timeout")&&(s.timeout=parseInt(t[4]))}));const c=new _(h,1===n.length?t.name:`${t.name} ${r+1}`,(()=>i(this,void 0,void 0,(function*(){const o=yield e.functions.eval(b(n[r],t));if(s.wait&&(yield O(s.wait)),"boolean"==typeof o&&!o)throw`Failed: ${n[r]}, expected true, got ${o}`}))),{skipReason:s.skip,timeout:s.timeout});if(s.cat){const t=h+": "+s.cat;c.category=t,void 0===a[t]&&(a[t]={tests:[],clear:!0}),a[t].tests.push(c)}else l.push(c)}if(r){const n=t.options.demoWait?parseInt(t.options.demoWait):void 0,r=new _(p,t.friendlyName,(()=>i(this,void 0,void 0,(function*(){if(e.shell.lastError="",yield t.apply(),yield O(n||2e3),e.shell.lastError)throw new Error(e.shell.lastError)}))),{skipReason:t.options.demoSkip});c.push(r)}if(t.hasTag("semTypeDetector")){const e=new _(m,t.friendlyName,(()=>i(this,void 0,void 0,(function*(){const e=[];for(const n of o.clone().columns){const r=yield t.apply([n]);e.push(r||n.semType)}E(e.filter((t=>t)).length,1)}))),{skipReason:t.options.skipTest});u.push(e)}}g[r]=!0,l.length&&(a[h]={tests:l,clear:!0}),c.length&&(a[p]={tests:c,clear:!0}),u.length&&(a[m]={tests:u,clear:!1})}))}(C);const A=[];console.log("Running tests"),null!=n||(n={}),null!==(a=(I=n).testContext)&&void 0!==a||(I.testContext=new T),e.shell.lastError="";const N=[],P=function(){const t=[];return console.log=(...e)=>{t.push(...e),l(...e)},console.info=(...e)=>{t.push(...e),c(...e)},console.warn=(...e)=>{t.push(...e),u(...e)},console.error=(...e)=>{t.push(...e),f(...e)},t}();try{for(const[r,o]of Object.entries(d)){if((null==n?void 0:n.category)&&!r.toLowerCase().startsWith(null==n?void 0:n.category.toLowerCase())||(null===(x=n.exclude)||void 0===x?void 0:x.some((t=>r.startsWith(t)))))continue;l(`Started ${r} category`),N.push(r);const i=null===(v=o.tests)||void 0===v?void 0:v.every((t=>{var e;return null===(e=t.options)||void 0===e?void 0:e.skipReason}));try{o.before&&!i&&(yield o.before())}catch(t){o.beforeStatus=L(t)}const s=null!==(w=o.tests)&&void 0!==w?w:[],a=[];if(o.clear)for(let r=0;r<s.length;r++)a.push(yield S(s[r],null==n?void 0:n.test,P,o.timeout,C.name,n.verbose)),e.shell.closeAll(),t.Balloon.closeAll();else for(let t=0;t<s.length;t++)a.push(yield S(s[t],null==n?void 0:n.test,P,o.timeout,C.name,n.verbose));const c=a.filter((t=>"skipped"!=t.result));try{o.after&&!i&&(yield o.after())}catch(t){o.afterStatus=L(t)}o.afterStatus&&c.push({category:r,name:"after",result:o.afterStatus,success:!1,ms:0,skipped:!1}),o.beforeStatus&&c.push({category:r,name:"before",result:o.beforeStatus,success:!1,ms:0,skipped:!1}),A.push(...c)}}finally{console.log=l,console.info=c,console.warn=u,console.error=f}if(n.testContext.catchUnhandled&&(yield O(1e3),e.shell.lastError.length>0&&A.push({category:"Unhandled exceptions",name:"exceptions",result:e.shell.lastError,success:!1,ms:0,skipped:!1})),!n.test&&A.length){const r=A.filter((t=>t.success)).length,o=A.filter((t=>t.skipped)).length,i=A.filter((t=>!t.success)),s=C.name;for(const t of N){const n=A.filter((e=>e.category===t)),r=n.filter((t=>!t.success)).length,o={success:0===r,passed:n.filter((t=>t.success)).length,skipped:n.filter((t=>t.skipped)).length,failed:r,type:"package",packageName:s,category:t};e.log.usage(`${s}: ${t}`,o,`category-package ${s}: ${t}`)}if(!n.category){const t={success:0===i.length,passed:r,skipped:o,failed:i.length,type:"package",packageName:s};e.log.usage(s,t,`package-package ${s}`)}if(n.testContext.report){const e=new t.Logger,n="Package @package tested: @successful successful, @skipped skipped, @failed failed tests",s={successful:r,skipped:o,failed:i.length,package:C};for(const t of i)Object.assign(s,{[`${t.category} | ${t.name}`]:t.result});e.log(n,s,"package-tested")}}return A}))}({category:n,test:r,testContext:s});return t.DataFrame.fromObjects(a)}))}})(),curves_test=r})();
|
|
2
2
|
//# sourceMappingURL=package-test.js.map
|