var chem;(()=>{"use strict";var e,r,t={603:(e,r,t)=>{var n=t(6066);const a=e=>null==e;var o=t(2780),s=t(8774);onmessage=async e=>{const{values:r,startIdx:t,endIdx:l,fnNames:c,opts:i,threshold:h,weights:p,aggregationMethod:u}=e.data;try{const e=new Array(r[0].length).fill(null).map(()=>new Array(0)),f=new Array(r[0].length).fill(null).map(()=>new Array(0)),g=function(e,r){return e===n.G.MANHATTAN?e=>e.reduce((e,t,n)=>e+t*r[n],0):e=>{const t=e.reduce((e,t,n)=>e+(t*r[n])**2,0);return Math.sqrt(t)}}(u,p),v=l-t;r.forEach((e,t)=>{if((0,o.lW)(c[t]))for(let n=0;n<e.length;++n)a(e[n])||(r[t][n]=new s.A(r[t][n]._data,r[t][n]._length))});let m=0;const d=new Array(c.length).fill(null).map((e,r)=>new o.t$(c[r]).getMeasure(i[r])),w=r[0].length-2-Math.floor(Math.sqrt(-8*t+4*r[0].length*(r[0].length-1)-7)/2-.5),y=t-r[0].length*w+Math.floor((w+1)*(w+2)/2);let b=w,x=y;for(;m<v;){const t=d.map((e,t)=>a(r[t][b])||a(r[t][x])?1:e(r[t][b],r[t][x])),n=1===t.length?t[0]:g(t);1-n>h&&(f[b].push(n),e[b].push(x),f[x].push(n),e[x].push(b)),m++,x++,x===r[0].length&&(b++,x=b+1)}postMessage({knnDistances:f,knnIndexes:e})}catch(e){postMessage({error:e})}}}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,a.x=()=>{var e=a.O(void 0,[242,589],()=>a(603));return a.O(e)},e=[],a.O=(r,t,n,o)=>{if(!t){var s=1/0;for(h=0;h<e.length;h++){for(var[t,n,o]=e[h],l=!0,c=0;c<t.length;c++)(!1&o||s>=o)&&Object.keys(a.O).every(e=>a.O[e](t[c]))?t.splice(c--,1):(l=!1,o<s&&(s=o));if(l){e.splice(h--,1);var i=n();void 0!==i&&(r=i)}}return r}o=o||0;for(var h=e.length;h>0&&e[h-1][2]>o;h--)e[h]=e[h-1];e[h]=[t,n,o]},a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((r,t)=>(a.f[t](e,r),r),[])),a.u=e=>e+".js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var r=a.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{var e={603:1};a.f.i=(r,t)=>{e[r]||importScripts(a.p+a.u(r))};var r=self.webpackChunkchem=self.webpackChunkchem||[],t=r.push.bind(r);r.push=r=>{var[n,o,s]=r;for(var l in o)a.o(o,l)&&(a.m[l]=o[l]);for(s&&s(a);n.length;)e[n.pop()]=1;t(r)}})(),r=a.x,a.x=()=>Promise.all([a.e(242),a.e(589)]).then(r);var o=a.x();chem=o})();
//# sourceMappingURL=603.js.map