@datagrok/eda 1.4.13 → 1.5.1

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +11 -5
  2. package/dist/111.js +1 -1
  3. package/dist/111.js.map +1 -1
  4. package/dist/128.js +1 -1
  5. package/dist/128.js.map +1 -1
  6. package/dist/153.js +1 -1
  7. package/dist/153.js.map +1 -1
  8. package/dist/23.js +1 -1
  9. package/dist/23.js.map +1 -1
  10. package/dist/234.js +1 -1
  11. package/dist/234.js.map +1 -1
  12. package/dist/242.js +1 -1
  13. package/dist/242.js.map +1 -1
  14. package/dist/260.js +1 -1
  15. package/dist/260.js.map +1 -1
  16. package/dist/33.js +1 -1
  17. package/dist/33.js.map +1 -1
  18. package/dist/348.js +1 -1
  19. package/dist/348.js.map +1 -1
  20. package/dist/377.js +1 -1
  21. package/dist/377.js.map +1 -1
  22. package/dist/397.js +2 -0
  23. package/dist/397.js.map +1 -0
  24. package/dist/412.js +1 -1
  25. package/dist/412.js.map +1 -1
  26. package/dist/415.js +1 -1
  27. package/dist/415.js.map +1 -1
  28. package/dist/501.js +1 -1
  29. package/dist/501.js.map +1 -1
  30. package/dist/531.js +1 -1
  31. package/dist/531.js.map +1 -1
  32. package/dist/583.js +1 -1
  33. package/dist/583.js.map +1 -1
  34. package/dist/589.js +1 -1
  35. package/dist/589.js.map +1 -1
  36. package/dist/603.js +1 -1
  37. package/dist/603.js.map +1 -1
  38. package/dist/656.js +1 -1
  39. package/dist/656.js.map +1 -1
  40. package/dist/682.js +1 -1
  41. package/dist/682.js.map +1 -1
  42. package/dist/705.js +1 -1
  43. package/dist/705.js.map +1 -1
  44. package/dist/727.js +1 -1
  45. package/dist/727.js.map +1 -1
  46. package/dist/731.js +1 -1
  47. package/dist/731.js.map +1 -1
  48. package/dist/738.js +1 -1
  49. package/dist/738.js.map +1 -1
  50. package/dist/763.js +1 -1
  51. package/dist/763.js.map +1 -1
  52. package/dist/778.js +1 -1
  53. package/dist/778.js.map +1 -1
  54. package/dist/783.js +1 -1
  55. package/dist/783.js.map +1 -1
  56. package/dist/793.js +1 -1
  57. package/dist/793.js.map +1 -1
  58. package/dist/810.js +1 -1
  59. package/dist/810.js.map +1 -1
  60. package/dist/860.js +1 -1
  61. package/dist/860.js.map +1 -1
  62. package/dist/907.js +1 -1
  63. package/dist/907.js.map +1 -1
  64. package/dist/950.js +1 -1
  65. package/dist/950.js.map +1 -1
  66. package/dist/980.js +1 -1
  67. package/dist/980.js.map +1 -1
  68. package/dist/990.js +1 -1
  69. package/dist/990.js.map +1 -1
  70. package/dist/package-test.js +1 -1
  71. package/dist/package-test.js.map +1 -1
  72. package/dist/package.js +1 -1
  73. package/dist/package.js.map +1 -1
  74. package/package.json +5 -5
  75. package/src/package.ts +2 -1
  76. package/src/pareto-optimization/pareto-optimizer.ts +1 -1
  77. package/src/pls/pls-constants.ts +8 -1
  78. package/src/pls/pls-tools.ts +176 -74
  79. package/src/probabilistic-scoring/data-generator.ts +48 -3
  80. package/src/probabilistic-scoring/pmpo-defs.ts +30 -2
  81. package/src/probabilistic-scoring/pmpo-utils.ts +143 -52
  82. package/src/probabilistic-scoring/prob-scoring.ts +477 -104
  83. package/src/probabilistic-scoring/stat-tools.ts +1 -1
  84. package/src/tests/pareto-tests.ts +13 -15
  85. package/src/tests/pmpo-tests.ts +643 -3
  86. package/test-console-output-1.log +224 -86
  87. package/test-record-1.mp4 +0 -0
package/dist/412.js CHANGED
@@ -1,2 +1,2 @@
1
- var eda;(()=>{"use strict";var e,r,t={8412:(e,r,t)=>{var o=t(4829),a=t(3995);onmessage=async function(e){(0,o.D)().then(r=>{let t=e.data,o=(0,a.zz)(r,t,"partialLeastSquareRegression","number");postMessage({callResult:o,args:t})})}}},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return t[e](n,n.exports,a),n.loaded=!0,n.exports}a.m=t,a.x=()=>{var e=a.O(void 0,[23],()=>a(8412));return a.O(e)},a.amdO={},e=[],a.O=(r,t,o,n)=>{if(!t){var s=1/0;for(l=0;l<e.length;l++){for(var[t,o,n]=e[l],i=!0,c=0;c<t.length;c++)(!1&n||s>=n)&&Object.keys(a.O).every(e=>a.O[e](t[c]))?t.splice(c--,1):(i=!1,n<s&&(s=n));if(i){e.splice(l--,1);var p=o();void 0!==p&&(r=p)}}return r}n=n||0;for(var l=e.length;l>0&&e[l-1][2]>n;l--)e[l]=e[l-1];e[l]=[t,o,n]},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.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),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 o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{a.b=self.location+"";var e={412:1};a.f.i=(r,t)=>{e[r]||importScripts(a.p+a.u(r))};var r=self.webpackChunkeda=self.webpackChunkeda||[],t=r.push.bind(r);r.push=r=>{var[o,n,s]=r;for(var i in n)a.o(n,i)&&(a.m[i]=n[i]);for(s&&s(a);o.length;)e[o.pop()]=1;t(r)}})(),r=a.x,a.x=()=>a.e(23).then(r);var n=a.x();eda=n})();
1
+ var eda;(()=>{"use strict";var e,r,t={8412(e,r,t){var o=t(4829),a=t(3995);onmessage=async function(e){(0,o.D)().then(r=>{let t=e.data,o=(0,a.zz)(r,t,"partialLeastSquareRegression","number");postMessage({callResult:o,args:t})})}}},o={};function a(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return t[e](n,n.exports,a),n.loaded=!0,n.exports}a.m=t,a.x=()=>{var e=a.O(void 0,[23],()=>a(8412));return a.O(e)},a.amdO={},e=[],a.O=(r,t,o,n)=>{if(!t){var s=1/0;for(l=0;l<e.length;l++){for(var[t,o,n]=e[l],i=!0,c=0;c<t.length;c++)(!1&n||s>=n)&&Object.keys(a.O).every(e=>a.O[e](t[c]))?t.splice(c--,1):(i=!1,n<s&&(s=n));if(i){e.splice(l--,1);var p=o();void 0!==p&&(r=p)}}return r}n=n||0;for(var l=e.length;l>0&&e[l-1][2]>n;l--)e[l]=e[l-1];e[l]=[t,o,n]},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.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),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 o=t.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=t[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{a.b=self.location+"";var e={412:1};a.f.i=(r,t)=>{e[r]||importScripts(a.p+a.u(r))};var r=self.webpackChunkeda=self.webpackChunkeda||[],t=r.push.bind(r);r.push=r=>{var[o,n,s]=r;for(var i in n)a.o(n,i)&&(a.m[i]=n[i]);for(s&&s(a);o.length;)e[o.pop()]=1;t(r)}})(),r=a.x,a.x=()=>a.e(23).then(r);var n=a.x();eda=n})();
2
2
  //# sourceMappingURL=412.js.map
package/dist/412.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"412.js","mappings":"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","sources":["webpack://eda/webpack/runtime/chunk loaded","webpack://eda/webpack/runtime/startup chunk dependencies","webpack://eda/./wasm/workers/partialLeastSquareRegressionWorker.js","webpack://eda/webpack/bootstrap","webpack://eda/webpack/runtime/amd options","webpack://eda/webpack/runtime/define property getters","webpack://eda/webpack/runtime/ensure chunk","webpack://eda/webpack/runtime/get javascript chunk filename","webpack://eda/webpack/runtime/global","webpack://eda/webpack/runtime/harmony module decorator","webpack://eda/webpack/runtime/hasOwnProperty shorthand","webpack://eda/webpack/runtime/publicPath","webpack://eda/webpack/runtime/importScripts chunk loading","webpack://eda/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(23).then(next);\n};","// The following code is generated automatically.\n\nimport {exportEDA} from '../../wasm/EDAForWebWorker';\nimport {cppWrapper} from '../../wasm/callWasmForWebWorker.js';\n\nonmessage = async function (evt) {\n exportEDA().then(module => \n {\n let args = evt.data;\n let result = cppWrapper(module, args, 'partialLeastSquareRegression', 'number');\n postMessage({'callResult': result, 'args': args});\n } )\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [23], () => (__webpack_require__(8412)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.amdO = {};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = self.location + \"\";\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t412: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunkeda\"] = self[\"webpackChunkeda\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","onmessage","async","evt","then","module","args","data","result","postMessage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","id","loaded","__webpack_modules__","m","x","__webpack_exports__","O","amdO","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","d","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","reduce","promises","u","g","globalThis","this","Function","window","hmd","create","children","set","Error","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","test","replace","p","b","self","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","push","bind","moreModules","runtime","pop"],"sourceRoot":""}
1
+ {"version":3,"file":"412.js","mappings":"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","sources":["webpack://eda/webpack/runtime/chunk loaded","webpack://eda/webpack/runtime/startup chunk dependencies","webpack://eda/./wasm/workers/partialLeastSquareRegressionWorker.js","webpack://eda/webpack/bootstrap","webpack://eda/webpack/runtime/amd options","webpack://eda/webpack/runtime/define property getters","webpack://eda/webpack/runtime/ensure chunk","webpack://eda/webpack/runtime/get javascript chunk filename","webpack://eda/webpack/runtime/global","webpack://eda/webpack/runtime/harmony module decorator","webpack://eda/webpack/runtime/hasOwnProperty shorthand","webpack://eda/webpack/runtime/publicPath","webpack://eda/webpack/runtime/importScripts chunk loading","webpack://eda/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\treturn __webpack_require__.e(23).then(next);\n};","// The following code is generated automatically.\n\nimport {exportEDA} from '../../wasm/EDAForWebWorker';\nimport {cppWrapper} from '../../wasm/callWasmForWebWorker.js';\n\nonmessage = async function (evt) {\n exportEDA().then(module => \n {\n let args = evt.data;\n let result = cppWrapper(module, args, 'partialLeastSquareRegression', 'number');\n postMessage({'callResult': result, 'args': args});\n } )\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [23], () => (__webpack_require__(8412)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.amdO = {};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and chunks that the entrypoint depends on\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = self.location + \"\";\n\n// object to store loaded chunks\n// \"1\" means \"already loaded\"\nvar installedChunks = {\n\t412: 1\n};\n\n// importScripts chunk loading\nvar installChunk = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\twhile(chunkIds.length)\n\t\tinstalledChunks[chunkIds.pop()] = 1;\n\tparentChunkLoadingFunction(data);\n};\n__webpack_require__.f.i = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\timportScripts(__webpack_require__.p + __webpack_require__.u(chunkId));\n\t\t}\n\t}\n};\n\nvar chunkLoadingGlobal = self[\"webpackChunkeda\"] = self[\"webpackChunkeda\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = installChunk;\n\n// no HMR\n\n// no HMR manifest","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n"],"names":["deferred","next","onmessage","async","evt","then","module","args","data","result","postMessage","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","id","loaded","__webpack_modules__","m","x","__webpack_exports__","O","amdO","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","d","definition","o","defineProperty","enumerable","get","f","e","chunkId","Promise","all","reduce","promises","u","g","globalThis","this","Function","window","hmd","create","children","set","Error","obj","prop","prototype","hasOwnProperty","call","scriptUrl","importScripts","location","document","currentScript","tagName","toUpperCase","src","scripts","getElementsByTagName","test","replace","p","b","self","installedChunks","chunkLoadingGlobal","parentChunkLoadingFunction","push","bind","moreModules","runtime","pop"],"sourceRoot":""}
package/dist/415.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunkeda=self.webpackChunkeda||[]).push([[415],{702:function(t,e,r){var n,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return a(e,t),e},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},u=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.getCSR=e.normalize=e.eliminateZeros=e.multiplyScalar=e.maximum=e.subtract=e.add=e.pairwiseMultiply=e.identity=e.transpose=e.SparseMatrix=void 0;var h=o(r(8186)),l=function(){function t(t,e,r,n){if(this.entries=new Map,this.nRows=0,this.nCols=0,t.length!==e.length||t.length!==r.length)throw new Error("rows, cols and values arrays must all have the same length");this.nRows=n[0],this.nCols=n[1];for(var i=0;i<r.length;i++){var a=t[i],o=e[i];this.checkDims(a,o);var s=this.makeKey(a,o);this.entries.set(s,{value:r[i],row:a,col:o})}}return t.prototype.makeKey=function(t,e){return t+":"+e},t.prototype.checkDims=function(t,e){if(!(t<this.nRows&&e<this.nCols))throw new Error("row and/or col specified outside of matrix dimensions")},t.prototype.set=function(t,e,r){this.checkDims(t,e);var n=this.makeKey(t,e);this.entries.has(n)?this.entries.get(n).value=r:this.entries.set(n,{value:r,row:t,col:e})},t.prototype.get=function(t,e,r){void 0===r&&(r=0),this.checkDims(t,e);var n=this.makeKey(t,e);return this.entries.has(n)?this.entries.get(n).value:r},t.prototype.getAll=function(t){void 0===t&&(t=!0);var e=[];return this.entries.forEach(function(t){e.push(t)}),t&&e.sort(function(t,e){return t.row===e.row?t.col-e.col:t.row-e.row}),e},t.prototype.getDims=function(){return[this.nRows,this.nCols]},t.prototype.getRows=function(){return Array.from(this.entries,function(t){var e=s(t,2);return e[0],e[1].row})},t.prototype.getCols=function(){return Array.from(this.entries,function(t){var e=s(t,2);return e[0],e[1].col})},t.prototype.getValues=function(){return Array.from(this.entries,function(t){var e=s(t,2);return e[0],e[1].value})},t.prototype.forEach=function(t){this.entries.forEach(function(e){return t(e.value,e.row,e.col)})},t.prototype.map=function(e){var r=[];this.entries.forEach(function(t){r.push(e(t.value,t.row,t.col))});var n=[this.nRows,this.nCols];return new t(this.getRows(),this.getCols(),r,n)},t.prototype.toArray=function(){var t=this,e=h.empty(this.nRows).map(function(){return h.zeros(t.nCols)});return this.entries.forEach(function(t){e[t.row][t.col]=t.value}),e},t}();e.SparseMatrix=l,e.transpose=function(t){var e=[],r=[],n=[];t.forEach(function(t,i,a){e.push(i),r.push(a),n.push(t)});var i=[t.nCols,t.nRows];return new l(r,e,n,i)},e.identity=function(t){for(var e=s(t,1)[0],r=new l([],[],[],t),n=0;n<e;n++)r.set(n,n,1);return r},e.pairwiseMultiply=function(t,e){return f(t,e,function(t,e){return t*e})},e.add=function(t,e){return f(t,e,function(t,e){return t+e})},e.subtract=function(t,e){return f(t,e,function(t,e){return t-e})},e.maximum=function(t,e){return f(t,e,function(t,e){return t>e?t:e})},e.multiplyScalar=function(t,e){return t.map(function(t){return t*e})},e.eliminateZeros=function(t){for(var e=new Set,r=t.getValues(),n=t.getRows(),i=t.getCols(),a=0;a<r.length;a++)0===r[a]&&e.add(a);var o=function(t,r){return!e.has(r)},s=r.filter(o),u=n.filter(o),h=i.filter(o);return new l(u,h,s,t.getDims())},e.normalize=function(t,e){var r,n;void 0===e&&(e="l2");var i=c[e],a=new Map;t.forEach(function(t,e,r){var n=a.get(e)||[];n.push(r),a.set(e,n)});var o=new l([],[],[],t.getDims()),s=function(e){for(var r=a.get(e).sort(),n=r.map(function(r){return t.get(e,r)}),s=i(n),u=0;u<s.length;u++)o.set(e,r[u],s[u])};try{for(var h=u(a.keys()),f=h.next();!f.done;f=h.next())s(f.value)}catch(t){r={error:t}}finally{try{f&&!f.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}return o};var c=((n={}).max=function(t){for(var e=-1/0,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return t.map(function(t){return t/e})},n.l1=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r];return t.map(function(t){return t/e})},n.l2=function(t){for(var e=0,r=0;r<t.length;r++)e+=Math.pow(t[r],2);return t.map(function(t){return Math.sqrt(Math.pow(t,2)/e)})},n);function f(t,e,r){for(var n=new Set,i=[],a=[],o=[],s=function(n,s){i.push(n),a.push(s);var u=r(t.get(n,s),e.get(n,s));o.push(u)},u=t.getValues(),h=t.getRows(),c=t.getCols(),f=0;f<u.length;f++){var p=(g=h[f])+":"+(y=c[f]);n.add(p),s(g,y)}var d=e.getValues(),m=e.getRows(),v=e.getCols();for(f=0;f<d.length;f++){var g,y;p=(g=m[f])+":"+(y=v[f]),n.has(p)||s(g,y)}var b=[t.nRows,t.nCols];return new l(i,a,o,b)}e.getCSR=function(t){var e=[];t.forEach(function(t,r,n){e.push({value:t,row:r,col:n})}),e.sort(function(t,e){return t.row===e.row?t.col-e.col:t.row-e.row});for(var r=[],n=[],i=[],a=-1,o=0;o<e.length;o++){var s=e[o],u=s.row,h=s.col,l=s.value;u!==a&&(a=u,i.push(o)),r.push(h),n.push(l)}return{indices:r,values:n,indptr:i}}},1853:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.smallestFlagged=e.deheapSort=e.buildCandidates=e.uncheckedHeapPush=e.heapPush=e.rejectionSample=e.makeHeap=void 0;var o=a(r(8186));function s(t,e){var r=function(r){return o.empty(t).map(function(){return o.filled(e,r)})},n=[];return n.push(r(-1)),n.push(r(1/0)),n.push(r(0)),n}function u(t,e,r,n,i){e=Math.floor(e);var a=t[0][e],o=t[1][e];if(t[2][e],r>=o[0])return 0;for(var s=0;s<a.length;s++)if(n===a[s])return 0;return h(t,e,r,n,i)}function h(t,e,r,n,i){var a=t[0][e],o=t[1][e],s=t[2][e];if(r>=o[0])return 0;o[0]=r,a[0]=n,s[0]=i;for(var u=0,h=0;;){var l=2*u+1,c=l+1,f=t[0][0].length;if(l>=f)break;if(c>=f){if(!(o[l]>r))break;h=l}else if(o[l]>=o[c]){if(!(r<o[l]))break;h=l}else{if(!(r<o[c]))break;h=c}o[u]=o[h],a[u]=a[h],s[u]=s[h],u=h}return o[u]=r,a[u]=n,s[u]=i,1}function l(t,e,r,n){for(;2*n+1<r;){var i=2*n+1,a=i+1,o=n;if(t[o]<t[i]&&(o=i),a<r&&t[o]<t[a]&&(o=a),o===n)break;var s=t[n];t[n]=t[o],t[o]=s;var u=e[n];e[n]=e[o],e[o]=u,n=o}}e.makeHeap=s,e.rejectionSample=function(t,e,r){for(var n=o.zeros(t),i=0;i<t;i++){for(var a=!0,s=0;a;){s=o.tauRandInt(e,r);for(var u=!1,h=0;h<i;h++)if(s===n[h]){u=!0;break}u||(a=!1)}n[i]=s}return n},e.heapPush=u,e.uncheckedHeapPush=h,e.buildCandidates=function(t,e,r,n,i){for(var a=s(e,n),h=0;h<e;h++)for(var l=0;l<r;l++)if(!(t[0][h][l]<0)){var c=t[0][h][l],f=t[2][h][l],p=o.tauRand(i);u(a,h,p,c,f),u(a,c,p,h,f),t[2][h][l]=0}return a},e.deheapSort=function(t){for(var e=t[0],r=t[1],n=0;n<e.length;n++)for(var i=e[n],a=r[n],o=0;o<i.length-1;o++){var s=i.length-o-1,u=a.length-o-1,h=i[0];i[0]=i[s],i[s]=h;var c=a[0];a[0]=a[u],a[u]=c,l(a,i,u,0)}return{indices:e,weights:r}},e.smallestFlagged=function(t,e){for(var r=t[0][e],n=t[1][e],i=t[2][e],a=1/0,o=-1,s=0;s>r.length;s++)1===i[s]&&n[s]<a&&(a=n[s],o=s);return o>=0?(i[o]=0,Math.floor(r[o])):-1}},2286:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.initializeSearch=e.makeInitializedNNSearch=e.makeInitializations=e.makeNNDescent=void 0;var s=a(r(1853)),u=a(r(702)),h=a(r(3731)),l=a(r(8186));e.makeNNDescent=function(t,e){return function(r,n,i,a,o,u,h,c){void 0===a&&(a=10),void 0===o&&(o=50),void 0===u&&(u=.001),void 0===h&&(h=.5),void 0===c&&(c=!0);for(var f=r.length,p=s.makeHeap(r.length,i),d=0;d<r.length;d++)for(var m=s.rejectionSample(i,r.length,e),v=0;v<m.length;v++){var g=t(r[d],r[m[v]]);s.heapPush(p,d,g,m[v],1),s.heapPush(p,m[v],g,d,1)}if(c)for(var y=0;y<n.length;y++)for(d=0;d<n[y].length&&!(n[y][d]<0);d++)for(v=d+1;v<n[y].length&&!(n[y][v]<0);v++)g=t(r[n[y][d]],r[n[y][v]]),s.heapPush(p,n[y][d],g,n[y][v],1),s.heapPush(p,n[y][v],g,n[y][d],1);for(y=0;y<a;y++){var b=s.buildCandidates(p,f,i,o,e),w=0;for(d=0;d<f;d++)for(v=0;v<o;v++){var S=Math.floor(b[0][d][v]);if(!(S<0||l.tauRand(e)<h))for(var M=0;M<o;M++){var z=Math.floor(b[0][d][M]),_=b[2][d][v],N=b[2][d][M];z<0||!_&&!N||(g=t(r[S],r[z]),w+=s.heapPush(p,S,g,z,1),w+=s.heapPush(p,z,g,S,1))}}if(w<=u*i*r.length)break}return s.deheapSort(p)}},e.makeInitializations=function(t){return{initFromRandom:function(e,r,n,i,a){for(var o=0;o<n.length;o++)for(var u=l.rejectionSample(e,r.length,a),h=0;h<u.length;h++)if(!(u[h]<0)){var c=t(r[u[h]],n[o]);s.heapPush(i,o,c,u[h],1)}},initFromTree:function(e,r,n,i,a){for(var o=0;o<n.length;o++)for(var u=h.searchFlatTree(n[o],e,a),l=0;l<u.length;l++){if(u[l]<0)return;var c=t(r[u[l]],n[o]);s.heapPush(i,o,c,u[l],1)}}}},e.makeInitializedNNSearch=function(t){return function(e,r,n,i){for(var a,h,l=u.getCSR(r),c=l.indices,f=l.indptr,p=0;p<i.length;p++)for(var d=new Set(n[0][p]);;){var m=s.smallestFlagged(n,p);if(-1===m)break;var v=c.slice(f[m],f[m+1]);try{for(var g=(a=void 0,o(v)),y=g.next();!y.done;y=g.next()){var b=y.value;if(b!==m&&-1!==b&&!d.has(b)){var w=t(e[b],i[p]);s.uncheckedHeapPush(n,p,w,b,1),d.add(b)}}}catch(t){a={error:t}}finally{try{y&&!y.done&&(h=g.return)&&h.call(g)}finally{if(a)throw a.error}}}return n}},e.initializeSearch=function(t,e,r,n,i,a,u){var h,l,c=s.makeHeap(r.length,n);if(i(n,e,r,c,u),t)try{for(var f=o(t),p=f.next();!p.done;p=f.next())a(p.value,e,r,c,u)}catch(t){h={error:t}}finally{try{p&&!p.done&&(l=f.return)&&l.call(f)}finally{if(h)throw h.error}}return c}},2415:(t,e,r)=>{var n=r(5112);Object.defineProperty(e,"Q",{enumerable:!0,get:function(){return n.UMAP}})},3731:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},o=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},s=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t},u=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.searchFlatTree=e.makeLeafArray=e.makeForest=e.FlatTree=void 0;var h=a(r(8186)),l=function(t,e,r,n){this.hyperplanes=t,this.offsets=e,this.children=r,this.indices=n};function c(t,e,r,n,i){if(void 0===r&&(r=30),e.length>r){var a=function(t,e,r){var n=t[0].length,i=h.tauRandInt(e.length,r),a=h.tauRandInt(e.length,r);a=(a+=i===a?1:0)%e.length;for(var o=e[i],s=e[a],u=0,l=h.zeros(n),c=0;c<l.length;c++)l[c]=t[o][c]-t[s][c],u-=l[c]*(t[o][c]+t[s][c])/2;var f=0,p=0,d=h.zeros(e.length);for(c=0;c<e.length;c++){for(var m=u,v=0;v<n;v++)m+=l[v]*t[e[c]][v];0===m?(d[c]=h.tauRandInt(2,r),0===d[c]?f+=1:p+=1):m>0?(d[c]=0,f+=1):(d[c]=1,p+=1)}var g=h.zeros(f),y=h.zeros(p);for(f=0,p=0,c=0;c<d.length;c++)0===d[c]?(g[f]=e[c],f+=1):(y[p]=e[c],p+=1);return{indicesLeft:g,indicesRight:y,hyperplane:l,offset:u}}(t,e,i),o=a.indicesLeft,s=a.indicesRight,u=a.hyperplane,l=a.offset;return{leftChild:c(t,o,r,n+1,i),rightChild:c(t,s,r,n+1,i),isLeaf:!1,hyperplane:u,offset:l}}return{indices:e,isLeaf:!0}}function f(t,e,r,n,i,a,o){var u;if(t.isLeaf)return n[a][0]=-o,(u=i[o]).splice.apply(u,s([0,t.indices.length],t.indices)),{nodeNum:a,leafNum:o+=1};e[a]=t.hyperplane,r[a]=t.offset,n[a][0]=a+1;var h=a,l=f(t.leftChild,e,r,n,i,a+1,o);return a=l.nodeNum,o=l.leafNum,n[h][1]=a+1,{nodeNum:(l=f(t.rightChild,e,r,n,i,a+1,o)).nodeNum,leafNum:l.leafNum}}function p(t){return t.isLeaf?1:1+p(t.leftChild)+p(t.rightChild)}function d(t){return t.isLeaf?1:d(t.leftChild)+d(t.rightChild)}function m(t,e,r,n){for(var i=e,a=0;a<r.length;a++)i+=t[a]*r[a];return 0===i?h.tauRandInt(2,n):i>0?0:1}e.FlatTree=l,e.makeForest=function(t,e,r,n){var i=Math.max(10,e);return h.range(r).map(function(e,r){return function(t,e,r,n){return void 0===e&&(e=30),c(t,h.range(t.length),e,r,n)}(t,i,r,n)}).map(function(t){return function(t,e){var r=p(t),n=d(t),i=h.range(r).map(function(){return h.zeros(t.hyperplane?t.hyperplane.length:0)}),a=h.zeros(r),o=h.range(r).map(function(){return[-1,-1]}),s=h.range(n).map(function(){return h.range(e).map(function(){return-1})});return f(t,i,a,o,s,0,0),new l(i,a,o,s)}(t,i)})},e.makeLeafArray=function(t){var e,r;if(t.length>0){var n=[];try{for(var i=u(t),a=i.next();!a.done;a=i.next()){var o=a.value;n.push.apply(n,s(o.indices))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}return[[-1]]},e.searchFlatTree=function(t,e,r){for(var n=0;e.children[n][0]>0;)n=0===m(e.hyperplanes[n],e.offsets[n],t,r)?e.children[n][0]:e.children[n][1];var i=-1*e.children[n][0];return e.indices[i]}},5112:function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(t){try{u(n.next(t))}catch(t){a(t)}}function s(t){try{u(n.throw(t))}catch(t){a(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,s)}u((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},u=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},h=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.initTransform=e.resetLocalConnectivity=e.fastIntersection=e.findABParams=e.cosine=e.euclidean=e.UMAP=void 0;var c=a(r(1853)),f=a(r(702)),p=a(r(2286)),d=a(r(3731)),m=a(r(8186)),v=l(r(5407)),g=1e-5,y=.001,b=function(){function t(t){var e=this;void 0===t&&(t={}),this.learningRate=1,this.localConnectivity=1,this.minDist=.1,this.nComponents=2,this.nEpochs=0,this.nNeighbors=15,this.negativeSampleRate=5,this.random=Math.random,this.repulsionStrength=1,this.setOpMixRatio=1,this.spread=1,this.transformQueueSize=4,this.targetMetric="categorical",this.targetWeight=.5,this.targetNNeighbors=this.nNeighbors,this.distanceFn=w,this.isInitialized=!1,this.rpForest=[],this.embedding=[],this.optimizationState=new S;var r=function(r){void 0!==t[r]&&(e[r]=t[r])};r("distanceFn"),r("learningRate"),r("localConnectivity"),r("minDist"),r("nComponents"),r("nEpochs"),r("nNeighbors"),r("negativeSampleRate"),r("random"),r("repulsionStrength"),r("setOpMixRatio"),r("spread"),r("transformQueueSize")}return t.prototype.fit=function(t){return this.initializeFit(t),this.optimizeLayout(),this.embedding},t.prototype.fitAsync=function(t,e){return void 0===e&&(e=function(){return!0}),o(this,void 0,void 0,function(){return s(this,function(r){switch(r.label){case 0:return this.initializeFit(t),[4,this.optimizeLayoutAsync(e)];case 1:return r.sent(),[2,this.embedding]}})})},t.prototype.setSupervisedProjection=function(t,e){void 0===e&&(e={}),this.Y=t,this.targetMetric=e.targetMetric||this.targetMetric,this.targetWeight=e.targetWeight||this.targetWeight,this.targetNNeighbors=e.targetNNeighbors||this.targetNNeighbors},t.prototype.setPrecomputedKNN=function(t,e){this.knnIndices=t,this.knnDistances=e},t.prototype.initializeFit=function(t){if(t.length<=this.nNeighbors)throw new Error("Not enough data points ("+t.length+") to create nNeighbors: "+this.nNeighbors+". Add more data points or adjust the configuration.");if(this.X===t&&this.isInitialized)return this.getNEpochs();if(this.X=t,!this.knnIndices&&!this.knnDistances){var e=this.nearestNeighbors(t);this.knnIndices=e.knnIndices,this.knnDistances=e.knnDistances}this.graph=this.fuzzySimplicialSet(t,this.nNeighbors,this.setOpMixRatio),this.makeSearchFns(),this.searchGraph=this.makeSearchGraph(t),this.processGraphForSupervisedProjection();var r=this.initializeSimplicialSetEmbedding(),n=r.head,i=r.tail,a=r.epochsPerSample;return this.optimizationState.head=n,this.optimizationState.tail=i,this.optimizationState.epochsPerSample=a,this.initializeOptimization(),this.prepareForOptimizationLoop(),this.isInitialized=!0,this.getNEpochs()},t.prototype.makeSearchFns=function(){var t=p.makeInitializations(this.distanceFn),e=t.initFromTree,r=t.initFromRandom;this.initFromTree=e,this.initFromRandom=r,this.search=p.makeInitializedNNSearch(this.distanceFn)},t.prototype.makeSearchGraph=function(t){for(var e=this.knnIndices,r=this.knnDistances,n=[t.length,t.length],i=new f.SparseMatrix([],[],[],n),a=0;a<e.length;a++)for(var o=e[a],s=r[a],u=0;u<o.length;u++){var h=o[u],l=s[u];l>0&&i.set(a,h,l)}var c=f.transpose(i);return f.maximum(i,c)},t.prototype.transform=function(t){var e=this,r=this.X;if(void 0===r||0===r.length)throw new Error("No data has been fit.");var n=Math.floor(this.nNeighbors*this.transformQueueSize);n=Math.min(r.length,n);var i=p.initializeSearch(this.rpForest,r,t,n,this.initFromRandom,this.initFromTree,this.random),a=this.search(r,this.searchGraph,i,t),o=c.deheapSort(a),s=o.indices,u=o.weights;s=s.map(function(t){return t.slice(0,e.nNeighbors)}),u=u.map(function(t){return t.slice(0,e.nNeighbors)});var h=Math.max(0,this.localConnectivity-1),l=this.smoothKNNDistance(u,this.nNeighbors,h),d=l.sigmas,v=l.rhos,g=this.computeMembershipStrengths(s,u,d,v),y=g.rows,b=g.cols,w=g.vals,S=[t.length,r.length],M=new f.SparseMatrix(y,b,w,S),z=f.normalize(M,"l1"),_=f.getCSR(z),N=t.length,E=x(m.reshape2d(_.indices,N,this.nNeighbors),m.reshape2d(_.values,N,this.nNeighbors),this.embedding),k=this.nEpochs?this.nEpochs/3:M.nRows<=1e4?100:30,P=M.getValues().reduce(function(t,e){return e>t?e:t},0);M=M.map(function(t){return t<P/k?0:t}),M=f.eliminateZeros(M);var O=this.makeEpochsPerSample(M.getValues(),k),R=M.getRows(),j=M.getCols();return this.assignOptimizationStateParameters({headEmbedding:E,tailEmbedding:this.embedding,head:R,tail:j,currentEpoch:0,nEpochs:k,nVertices:M.getDims()[1],epochsPerSample:O}),this.prepareForOptimizationLoop(),this.optimizeLayout()},t.prototype.processGraphForSupervisedProjection=function(){var t=this.Y,e=this.X;if(t){if(t.length!==e.length)throw new Error("Length of X and y must be equal");if("categorical"===this.targetMetric){var r=this.targetWeight<1?1/(1-this.targetWeight)*2.5:1e12;this.graph=this.categoricalSimplicialSetIntersection(this.graph,t,r)}}},t.prototype.step=function(){var t=this.optimizationState.currentEpoch;return t<this.getNEpochs()&&this.optimizeLayoutStep(t),this.optimizationState.currentEpoch},t.prototype.getEmbedding=function(){return this.embedding},t.prototype.nearestNeighbors=function(t){var e,r=this.distanceFn,n=this.nNeighbors,i=p.makeNNDescent(r,this.random),a=5+Math.floor(.5==(e=Math.pow(t.length,.5)/20)?0:Math.round(e)),o=Math.max(5,Math.floor(Math.round(function(t){return Math.log(t)/Math.log(2)}(t.length))));this.rpForest=d.makeForest(t,n,a,this.random);var s=i(t,d.makeLeafArray(this.rpForest),n,o);return{knnIndices:s.indices,knnDistances:s.weights}},t.prototype.fuzzySimplicialSet=function(t,e,r){void 0===r&&(r=1);var n=this,i=n.knnIndices,a=void 0===i?[]:i,o=n.knnDistances,s=void 0===o?[]:o,u=n.localConnectivity,h=this.smoothKNNDistance(s,e,u),l=h.sigmas,c=h.rhos,p=this.computeMembershipStrengths(a,s,l,c),d=p.rows,m=p.cols,v=p.vals,g=[t.length,t.length],y=new f.SparseMatrix(d,m,v,g),b=f.transpose(y),w=f.pairwiseMultiply(y,b),S=f.subtract(f.add(y,b),w),M=f.multiplyScalar(S,r),z=f.multiplyScalar(w,1-r);return f.add(M,z)},t.prototype.categoricalSimplicialSetIntersection=function(t,e,r,n){void 0===n&&(n=1);var i=N(t,e,n,r);return E(i=f.eliminateZeros(i))},t.prototype.smoothKNNDistance=function(t,e,r,n,i){void 0===r&&(r=1),void 0===n&&(n=64),void 0===i&&(i=1);for(var a=Math.log(e)/Math.log(2)*i,o=m.zeros(t.length),s=m.zeros(t.length),u=0;u<t.length;u++){var h=0,l=1/0,c=1,f=t[u],p=f.filter(function(t){return t>0});if(p.length>=r){var d=Math.floor(r),v=r-d;d>0?(o[u]=p[d-1],v>g&&(o[u]+=v*(p[d]-p[d-1]))):o[u]=v*p[0]}else p.length>0&&(o[u]=m.max(p));for(var b=0;b<n;b++){for(var w=0,S=1;S<t[u].length;S++){var M=t[u][S]-o[u];w+=M>0?Math.exp(-M/c):1}if(Math.abs(w-a)<g)break;w>a?c=(h+(l=c))/2:(h=c,l===1/0?c*=2:c=(h+l)/2)}if(s[u]=c,o[u]>0){var z=m.mean(f);s[u]<y*z&&(s[u]=y*z)}else{var _=m.mean(t.map(m.mean));s[u]<y*_&&(s[u]=y*_)}}return{sigmas:s,rhos:o}},t.prototype.computeMembershipStrengths=function(t,e,r,n){for(var i=t.length,a=t[0].length,o=m.zeros(i*a),s=m.zeros(i*a),u=m.zeros(i*a),h=0;h<i;h++)for(var l=0;l<a;l++){var c=0;-1!==t[h][l]&&(c=t[h][l]===h?0:e[h][l]-n[h]<=0?1:Math.exp(-(e[h][l]-n[h])/r[h]),o[h*a+l]=h,s[h*a+l]=t[h][l],u[h*a+l]=c)}return{rows:o,cols:s,vals:u}},t.prototype.initializeSimplicialSetEmbedding=function(){for(var t=this,e=this.getNEpochs(),r=this.nComponents,n=this.graph.getValues(),i=0,a=0;a<n.length;a++){var o=n[a];i<n[a]&&(i=o)}var s=this.graph.map(function(t){return t<i/e?0:t});this.embedding=m.zeros(s.nRows).map(function(){return m.zeros(r).map(function(){return 20*m.tauRand(t.random)-10})});var u=[],h=[],l=[],c=s.getAll();for(a=0;a<c.length;a++){var f=c[a];f.value&&(u.push(f.value),l.push(f.row),h.push(f.col))}return{head:h,tail:l,epochsPerSample:this.makeEpochsPerSample(u,e)}},t.prototype.makeEpochsPerSample=function(t,e){var r=m.filled(t.length,-1),n=m.max(t),i=t.map(function(t){return t/n*e});return i.forEach(function(t,n){t>0&&(r[n]=e/i[n])}),r},t.prototype.assignOptimizationStateParameters=function(t){Object.assign(this.optimizationState,t)},t.prototype.prepareForOptimizationLoop=function(){var t=this,e=t.repulsionStrength,r=t.learningRate,n=t.negativeSampleRate,i=this.optimizationState,a=i.epochsPerSample,o=i.headEmbedding,s=i.tailEmbedding,u=o[0].length,l=o.length===s.length,c=a.map(function(t){return t/n}),f=h(c),p=h(a);this.assignOptimizationStateParameters({epochOfNextSample:p,epochOfNextNegativeSample:f,epochsPerNegativeSample:c,moveOther:l,initialAlpha:r,alpha:r,gamma:e,dim:u})},t.prototype.initializeOptimization=function(){var t=this.embedding,e=this.embedding,r=this.optimizationState,n=r.head,i=r.tail,a=r.epochsPerSample,o=this.getNEpochs(),s=this.graph.nCols,u=_(this.spread,this.minDist),h=u.a,l=u.b;this.assignOptimizationStateParameters({headEmbedding:t,tailEmbedding:e,head:n,tail:i,epochsPerSample:a,a:h,b:l,nEpochs:o,nVertices:s})},t.prototype.optimizeLayoutStep=function(t){for(var e=this.optimizationState,r=e.head,n=e.tail,i=e.headEmbedding,a=e.tailEmbedding,o=e.epochsPerSample,s=e.epochOfNextSample,u=e.epochOfNextNegativeSample,h=e.epochsPerNegativeSample,l=e.moveOther,c=e.initialAlpha,f=e.alpha,p=e.gamma,d=e.a,v=e.b,g=e.dim,y=e.nEpochs,b=e.nVertices,w=0;w<o.length;w++)if(!(s[w]>t)){var S=r[w],_=n[w],N=i[S],E=a[_],x=z(N,E),k=0;x>0&&(k=-2*d*v*Math.pow(x,v-1),k/=d*Math.pow(x,v)+1);for(var P=0;P<g;P++){var O=M(k*(N[P]-E[P]),4);N[P]+=O*f,l&&(E[P]+=-O*f)}s[w]+=o[w];for(var R=Math.floor((t-u[w])/h[w]),j=0;j<R;j++){var C=m.tauRandInt(b,this.random),F=a[C],A=z(N,F),D=0;if(A>0)D=2*p*v,D/=(.001+A)*(d*Math.pow(A,v)+1);else if(S===C)continue;for(P=0;P<g;P++)O=4,D>0&&(O=M(D*(N[P]-F[P]),4)),N[P]+=O*f}u[w]+=R*h[w]}return e.alpha=c*(1-t/y),e.currentEpoch+=1,i},t.prototype.optimizeLayoutAsync=function(t){var e=this;return void 0===t&&(t=function(){return!0}),new Promise(function(r,n){var i=function(){return o(e,void 0,void 0,function(){var e,a,o,u,h,l;return s(this,function(s){try{if(e=this.optimizationState,a=e.nEpochs,o=e.currentEpoch,this.embedding=this.optimizeLayoutStep(o),u=this.optimizationState.currentEpoch,h=!1===t(u),l=u===a,h||l)return[2,r(l)];setTimeout(function(){return i()},0)}catch(t){n(t)}return[2]})})};setTimeout(function(){return i()},0)})},t.prototype.optimizeLayout=function(t){void 0===t&&(t=function(){return!0});for(var e=!1,r=[];!e;){var n=this.optimizationState,i=n.nEpochs,a=n.currentEpoch;r=this.optimizeLayoutStep(a);var o=this.optimizationState.currentEpoch,s=!1===t(o);e=o===i||s}return r},t.prototype.getNEpochs=function(){var t=this.graph;if(this.nEpochs>0)return this.nEpochs;var e=t.nRows;return e<=2500?500:e<=5e3?400:e<=7500?300:200},t}();function w(t,e){for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n]-e[n],2);return Math.sqrt(r)}e.UMAP=b,e.euclidean=w,e.cosine=function(t,e){for(var r=0,n=0,i=0,a=0;a<t.length;a++)r+=t[a]*e[a],n+=Math.pow(t[a],2),i+=Math.pow(e[a],2);return 0===n&&0===i?0:0===n||0===i?1:1-r/Math.sqrt(n*i)};var S=function(){this.currentEpoch=0,this.headEmbedding=[],this.tailEmbedding=[],this.head=[],this.tail=[],this.epochsPerSample=[],this.epochOfNextSample=[],this.epochOfNextNegativeSample=[],this.epochsPerNegativeSample=[],this.moveOther=!0,this.initialAlpha=1,this.alpha=1,this.gamma=1,this.a=1.5769434603113077,this.b=.8950608779109733,this.dim=2,this.nEpochs=500,this.nVertices=0};function M(t,e){return t>e?e:t<-e?-e:t}function z(t,e){for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n]-e[n],2);return r}function _(t,e){var r=m.linear(0,3*t,300).map(function(t){return t<e?1:t}),n=m.zeros(r.length).map(function(n,i){return r[i]>=e?Math.exp(-(r[i]-e)/t):n}),i={x:r,y:n},a=v.default(i,function(t){var e=u(t,2),r=e[0],n=e[1];return function(t){return 1/(1+r*Math.pow(t,2*n))}},{damping:1.5,initialValues:[.5,.5],gradientDifference:.1,maxIterations:100,errorTolerance:.01}).parameterValues,o=u(a,2);return{a:o[0],b:o[1]}}function N(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=5),t.map(function(t,i,a){return-1===e[i]||-1===e[a]?t*Math.exp(-r):e[i]!==e[a]?t*Math.exp(-n):t})}function E(t){t=f.normalize(t,"max");var e=f.transpose(t),r=f.pairwiseMultiply(e,t);return t=f.add(t,f.subtract(e,r)),f.eliminateZeros(t)}function x(t,e,r){for(var n=m.zeros(t.length).map(function(t){return m.zeros(r[0].length)}),i=0;i<t.length;i++)for(var a=0;a<t[0].length;a++)for(var o=0;o<r[0].length;o++){var s=t[i][a];n[i][o]+=e[i][a]*r[s][o]}return n}e.findABParams=_,e.fastIntersection=N,e.resetLocalConnectivity=E,e.initTransform=x},5407:(t,e,r)=>{r.r(e),r.d(e,{default:()=>u});const n=Object.prototype.toString;function i(t){return n.call(t).endsWith("Array]")}function a(t,e,r){let n=0;const i=r(e);for(let e=0;e<t.x.length;e++)n+=Math.abs(t.y[e]-i(t.x[e]));return n}var o=r(5907);function s(t,e,r,n,i){let a=r*n*n,s=o.uq.eye(e.length,e.length,a);const u=i(e);let h=new Float64Array(t.x.length);for(let e=0;e<t.x.length;e++)h[e]=u(t.x[e]);let l=function(t,e,r,n,i){const a=r.length,s=t.x.length;let u=new Array(a);for(let o=0;o<a;o++){u[o]=new Array(s);let a=r.slice();a[o]+=n;let h=i(a);for(let r=0;r<s;r++)u[o][r]=e[r]-h(t.x[r])}return new o.uq(u)}(t,h,e,n,i),c=function(t,e){const r=t.x.length;let n=new Array(r);for(let i=0;i<r;i++)n[i]=[t.y[i]-e[i]];return new o.uq(n)}(t,h),f=(0,o.DI)(s.add(l.mmul(l.transpose())));return(e=(e=new o.uq([e])).sub(f.mmul(l).mmul(c).mul(n).transpose())).to1DArray()}function u(t,e,r={}){let{maxIterations:n=100,gradientDifference:o=.1,damping:u=0,errorTolerance:h=.01,minValues:l,maxValues:c,initialValues:f}=r;if(u<=0)throw new Error("The damping option must be a positive number");if(!t.x||!t.y)throw new Error("The data parameter must have x and y elements");if(!i(t.x)||t.x.length<2||!i(t.y)||t.y.length<2)throw new Error("The data parameter elements must be an array with more than 2 points");if(t.x.length!==t.y.length)throw new Error("The data parameter elements must have the same size");let p=f||new Array(e.length).fill(1),d=p.length;if(c=c||new Array(d).fill(Number.MAX_SAFE_INTEGER),l=l||new Array(d).fill(Number.MIN_SAFE_INTEGER),c.length!==l.length)throw new Error("minValues and maxValues must be the same size");if(!i(p))throw new Error("initialValues must be an array");let m,v=a(t,p,e),g=v<=h;for(m=0;m<n&&!g;m++){p=s(t,p,u,o,e);for(let t=0;t<d;t++)p[t]=Math.min(Math.max(l[t],p[t]),c[t]);if(v=a(t,p,e),isNaN(v))break;g=v<=h}return{parameterValues:p,parameterError:v,iterations:m}}},8186:function(t,e){var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function n(t,e){return Math.floor(e()*t)}function i(t){for(var e=[],r=0;r<t;r++)e.push(void 0);return e}function a(t,e){return i(t).map(function(){return e})}function o(t){return a(t,0)}function s(t){return t.reduce(function(t,e){return t+e})}Object.defineProperty(e,"__esModule",{value:!0}),e.reshape2d=e.rejectionSample=e.max2d=e.max=e.mean=e.sum=e.linear=e.ones=e.zeros=e.filled=e.range=e.empty=e.norm=e.tauRand=e.tauRandInt=void 0,e.tauRandInt=n,e.tauRand=function(t){return t()},e.norm=function(t){var e,n,i=0;try{for(var a=r(t),o=a.next();!o.done;o=a.next()){var s=o.value;i+=Math.pow(s,2)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return Math.sqrt(i)},e.empty=i,e.range=function(t){return i(t).map(function(t,e){return e})},e.filled=a,e.zeros=o,e.ones=function(t){return a(t,1)},e.linear=function(t,e,r){return i(r).map(function(n,i){return t+i*((e-t)/(r-1))})},e.sum=s,e.mean=function(t){return s(t)/t.length},e.max=function(t){for(var e=0,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return e},e.max2d=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r].length;n++)e=t[r][n]>e?t[r][n]:e;return e},e.rejectionSample=function(t,e,r){for(var i=o(t),a=0;a<t;a++)for(var s=!0;s;){for(var u=n(e,r),h=!1,l=0;l<a;l++)if(u===i[l]){h=!0;break}h||(s=!1),i[a]=u}return i},e.reshape2d=function(t,e,r){var n=[],i=0;if(t.length!==e*r)throw new Error("Array dimensions must match input length.");for(var a=0;a<e;a++){for(var o=[],s=0;s<r;s++)o.push(t[i]),i+=1;n.push(o)}return n}}}]);
1
+ "use strict";(self.webpackChunkeda=self.webpackChunkeda||[]).push([[415],{1853(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.smallestFlagged=e.deheapSort=e.buildCandidates=e.uncheckedHeapPush=e.heapPush=e.rejectionSample=e.makeHeap=void 0;var o=a(r(8186));function s(t,e){var r=function(r){return o.empty(t).map(function(){return o.filled(e,r)})},n=[];return n.push(r(-1)),n.push(r(1/0)),n.push(r(0)),n}function h(t,e,r,n,i){e=Math.floor(e);var a=t[0][e],o=t[1][e];if(t[2][e],r>=o[0])return 0;for(var s=0;s<a.length;s++)if(n===a[s])return 0;return u(t,e,r,n,i)}function u(t,e,r,n,i){var a=t[0][e],o=t[1][e],s=t[2][e];if(r>=o[0])return 0;o[0]=r,a[0]=n,s[0]=i;for(var h=0,u=0;;){var l=2*h+1,c=l+1,f=t[0][0].length;if(l>=f)break;if(c>=f){if(!(o[l]>r))break;u=l}else if(o[l]>=o[c]){if(!(r<o[l]))break;u=l}else{if(!(r<o[c]))break;u=c}o[h]=o[u],a[h]=a[u],s[h]=s[u],h=u}return o[h]=r,a[h]=n,s[h]=i,1}function l(t,e,r,n){for(;2*n+1<r;){var i=2*n+1,a=i+1,o=n;if(t[o]<t[i]&&(o=i),a<r&&t[o]<t[a]&&(o=a),o===n)break;var s=t[n];t[n]=t[o],t[o]=s;var h=e[n];e[n]=e[o],e[o]=h,n=o}}e.makeHeap=s,e.rejectionSample=function(t,e,r){for(var n=o.zeros(t),i=0;i<t;i++){for(var a=!0,s=0;a;){s=o.tauRandInt(e,r);for(var h=!1,u=0;u<i;u++)if(s===n[u]){h=!0;break}h||(a=!1)}n[i]=s}return n},e.heapPush=h,e.uncheckedHeapPush=u,e.buildCandidates=function(t,e,r,n,i){for(var a=s(e,n),u=0;u<e;u++)for(var l=0;l<r;l++)if(!(t[0][u][l]<0)){var c=t[0][u][l],f=t[2][u][l],p=o.tauRand(i);h(a,u,p,c,f),h(a,c,p,u,f),t[2][u][l]=0}return a},e.deheapSort=function(t){for(var e=t[0],r=t[1],n=0;n<e.length;n++)for(var i=e[n],a=r[n],o=0;o<i.length-1;o++){var s=i.length-o-1,h=a.length-o-1,u=i[0];i[0]=i[s],i[s]=u;var c=a[0];a[0]=a[h],a[h]=c,l(a,i,h,0)}return{indices:e,weights:r}},e.smallestFlagged=function(t,e){for(var r=t[0][e],n=t[1][e],i=t[2][e],a=1/0,o=-1,s=0;s>r.length;s++)1===i[s]&&n[s]<a&&(a=n[s],o=s);return o>=0?(i[o]=0,Math.floor(r[o])):-1}},2415(t,e,r){var n=r(5112);Object.defineProperty(e,"Q",{enumerable:!0,get:function(){return n.UMAP}})},702(t,e,r){var n,i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return a(e,t),e},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},h=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.getCSR=e.normalize=e.eliminateZeros=e.multiplyScalar=e.maximum=e.subtract=e.add=e.pairwiseMultiply=e.identity=e.transpose=e.SparseMatrix=void 0;var u=o(r(8186)),l=function(){function t(t,e,r,n){if(this.entries=new Map,this.nRows=0,this.nCols=0,t.length!==e.length||t.length!==r.length)throw new Error("rows, cols and values arrays must all have the same length");this.nRows=n[0],this.nCols=n[1];for(var i=0;i<r.length;i++){var a=t[i],o=e[i];this.checkDims(a,o);var s=this.makeKey(a,o);this.entries.set(s,{value:r[i],row:a,col:o})}}return t.prototype.makeKey=function(t,e){return t+":"+e},t.prototype.checkDims=function(t,e){if(!(t<this.nRows&&e<this.nCols))throw new Error("row and/or col specified outside of matrix dimensions")},t.prototype.set=function(t,e,r){this.checkDims(t,e);var n=this.makeKey(t,e);this.entries.has(n)?this.entries.get(n).value=r:this.entries.set(n,{value:r,row:t,col:e})},t.prototype.get=function(t,e,r){void 0===r&&(r=0),this.checkDims(t,e);var n=this.makeKey(t,e);return this.entries.has(n)?this.entries.get(n).value:r},t.prototype.getAll=function(t){void 0===t&&(t=!0);var e=[];return this.entries.forEach(function(t){e.push(t)}),t&&e.sort(function(t,e){return t.row===e.row?t.col-e.col:t.row-e.row}),e},t.prototype.getDims=function(){return[this.nRows,this.nCols]},t.prototype.getRows=function(){return Array.from(this.entries,function(t){var e=s(t,2);return e[0],e[1].row})},t.prototype.getCols=function(){return Array.from(this.entries,function(t){var e=s(t,2);return e[0],e[1].col})},t.prototype.getValues=function(){return Array.from(this.entries,function(t){var e=s(t,2);return e[0],e[1].value})},t.prototype.forEach=function(t){this.entries.forEach(function(e){return t(e.value,e.row,e.col)})},t.prototype.map=function(e){var r=[];this.entries.forEach(function(t){r.push(e(t.value,t.row,t.col))});var n=[this.nRows,this.nCols];return new t(this.getRows(),this.getCols(),r,n)},t.prototype.toArray=function(){var t=this,e=u.empty(this.nRows).map(function(){return u.zeros(t.nCols)});return this.entries.forEach(function(t){e[t.row][t.col]=t.value}),e},t}();e.SparseMatrix=l,e.transpose=function(t){var e=[],r=[],n=[];t.forEach(function(t,i,a){e.push(i),r.push(a),n.push(t)});var i=[t.nCols,t.nRows];return new l(r,e,n,i)},e.identity=function(t){for(var e=s(t,1)[0],r=new l([],[],[],t),n=0;n<e;n++)r.set(n,n,1);return r},e.pairwiseMultiply=function(t,e){return f(t,e,function(t,e){return t*e})},e.add=function(t,e){return f(t,e,function(t,e){return t+e})},e.subtract=function(t,e){return f(t,e,function(t,e){return t-e})},e.maximum=function(t,e){return f(t,e,function(t,e){return t>e?t:e})},e.multiplyScalar=function(t,e){return t.map(function(t){return t*e})},e.eliminateZeros=function(t){for(var e=new Set,r=t.getValues(),n=t.getRows(),i=t.getCols(),a=0;a<r.length;a++)0===r[a]&&e.add(a);var o=function(t,r){return!e.has(r)},s=r.filter(o),h=n.filter(o),u=i.filter(o);return new l(h,u,s,t.getDims())},e.normalize=function(t,e){var r,n;void 0===e&&(e="l2");var i=c[e],a=new Map;t.forEach(function(t,e,r){var n=a.get(e)||[];n.push(r),a.set(e,n)});var o=new l([],[],[],t.getDims()),s=function(e){for(var r=a.get(e).sort(),n=r.map(function(r){return t.get(e,r)}),s=i(n),h=0;h<s.length;h++)o.set(e,r[h],s[h])};try{for(var u=h(a.keys()),f=u.next();!f.done;f=u.next())s(f.value)}catch(t){r={error:t}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return o};var c=((n={}).max=function(t){for(var e=-1/0,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return t.map(function(t){return t/e})},n.l1=function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r];return t.map(function(t){return t/e})},n.l2=function(t){for(var e=0,r=0;r<t.length;r++)e+=Math.pow(t[r],2);return t.map(function(t){return Math.sqrt(Math.pow(t,2)/e)})},n);function f(t,e,r){for(var n=new Set,i=[],a=[],o=[],s=function(n,s){i.push(n),a.push(s);var h=r(t.get(n,s),e.get(n,s));o.push(h)},h=t.getValues(),u=t.getRows(),c=t.getCols(),f=0;f<h.length;f++){var p=(g=u[f])+":"+(y=c[f]);n.add(p),s(g,y)}var d=e.getValues(),m=e.getRows(),v=e.getCols();for(f=0;f<d.length;f++){var g,y;p=(g=m[f])+":"+(y=v[f]),n.has(p)||s(g,y)}var b=[t.nRows,t.nCols];return new l(i,a,o,b)}e.getCSR=function(t){var e=[];t.forEach(function(t,r,n){e.push({value:t,row:r,col:n})}),e.sort(function(t,e){return t.row===e.row?t.col-e.col:t.row-e.row});for(var r=[],n=[],i=[],a=-1,o=0;o<e.length;o++){var s=e[o],h=s.row,u=s.col,l=s.value;h!==a&&(a=h,i.push(o)),r.push(u),n.push(l)}return{indices:r,values:n,indptr:i}}},2286(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.initializeSearch=e.makeInitializedNNSearch=e.makeInitializations=e.makeNNDescent=void 0;var s=a(r(1853)),h=a(r(702)),u=a(r(3731)),l=a(r(8186));e.makeNNDescent=function(t,e){return function(r,n,i,a,o,h,u,c){void 0===a&&(a=10),void 0===o&&(o=50),void 0===h&&(h=.001),void 0===u&&(u=.5),void 0===c&&(c=!0);for(var f=r.length,p=s.makeHeap(r.length,i),d=0;d<r.length;d++)for(var m=s.rejectionSample(i,r.length,e),v=0;v<m.length;v++){var g=t(r[d],r[m[v]]);s.heapPush(p,d,g,m[v],1),s.heapPush(p,m[v],g,d,1)}if(c)for(var y=0;y<n.length;y++)for(d=0;d<n[y].length&&!(n[y][d]<0);d++)for(v=d+1;v<n[y].length&&!(n[y][v]<0);v++)g=t(r[n[y][d]],r[n[y][v]]),s.heapPush(p,n[y][d],g,n[y][v],1),s.heapPush(p,n[y][v],g,n[y][d],1);for(y=0;y<a;y++){var b=s.buildCandidates(p,f,i,o,e),w=0;for(d=0;d<f;d++)for(v=0;v<o;v++){var S=Math.floor(b[0][d][v]);if(!(S<0||l.tauRand(e)<u))for(var M=0;M<o;M++){var z=Math.floor(b[0][d][M]),_=b[2][d][v],N=b[2][d][M];z<0||!_&&!N||(g=t(r[S],r[z]),w+=s.heapPush(p,S,g,z,1),w+=s.heapPush(p,z,g,S,1))}}if(w<=h*i*r.length)break}return s.deheapSort(p)}},e.makeInitializations=function(t){return{initFromRandom:function(e,r,n,i,a){for(var o=0;o<n.length;o++)for(var h=l.rejectionSample(e,r.length,a),u=0;u<h.length;u++)if(!(h[u]<0)){var c=t(r[h[u]],n[o]);s.heapPush(i,o,c,h[u],1)}},initFromTree:function(e,r,n,i,a){for(var o=0;o<n.length;o++)for(var h=u.searchFlatTree(n[o],e,a),l=0;l<h.length;l++){if(h[l]<0)return;var c=t(r[h[l]],n[o]);s.heapPush(i,o,c,h[l],1)}}}},e.makeInitializedNNSearch=function(t){return function(e,r,n,i){for(var a,u,l=h.getCSR(r),c=l.indices,f=l.indptr,p=0;p<i.length;p++)for(var d=new Set(n[0][p]);;){var m=s.smallestFlagged(n,p);if(-1===m)break;var v=c.slice(f[m],f[m+1]);try{for(var g=(a=void 0,o(v)),y=g.next();!y.done;y=g.next()){var b=y.value;if(b!==m&&-1!==b&&!d.has(b)){var w=t(e[b],i[p]);s.uncheckedHeapPush(n,p,w,b,1),d.add(b)}}}catch(t){a={error:t}}finally{try{y&&!y.done&&(u=g.return)&&u.call(g)}finally{if(a)throw a.error}}}return n}},e.initializeSearch=function(t,e,r,n,i,a,h){var u,l,c=s.makeHeap(r.length,n);if(i(n,e,r,c,h),t)try{for(var f=o(t),p=f.next();!p.done;p=f.next())a(p.value,e,r,c,h)}catch(t){u={error:t}}finally{try{p&&!p.done&&(l=f.return)&&l.call(f)}finally{if(u)throw u.error}}return c}},3731(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},o=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},s=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t},h=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.searchFlatTree=e.makeLeafArray=e.makeForest=e.FlatTree=void 0;var u=a(r(8186)),l=function(t,e,r,n){this.hyperplanes=t,this.offsets=e,this.children=r,this.indices=n};function c(t,e,r,n,i){if(void 0===r&&(r=30),e.length>r){var a=function(t,e,r){var n=t[0].length,i=u.tauRandInt(e.length,r),a=u.tauRandInt(e.length,r);a=(a+=i===a?1:0)%e.length;for(var o=e[i],s=e[a],h=0,l=u.zeros(n),c=0;c<l.length;c++)l[c]=t[o][c]-t[s][c],h-=l[c]*(t[o][c]+t[s][c])/2;var f=0,p=0,d=u.zeros(e.length);for(c=0;c<e.length;c++){for(var m=h,v=0;v<n;v++)m+=l[v]*t[e[c]][v];0===m?(d[c]=u.tauRandInt(2,r),0===d[c]?f+=1:p+=1):m>0?(d[c]=0,f+=1):(d[c]=1,p+=1)}var g=u.zeros(f),y=u.zeros(p);for(f=0,p=0,c=0;c<d.length;c++)0===d[c]?(g[f]=e[c],f+=1):(y[p]=e[c],p+=1);return{indicesLeft:g,indicesRight:y,hyperplane:l,offset:h}}(t,e,i),o=a.indicesLeft,s=a.indicesRight,h=a.hyperplane,l=a.offset;return{leftChild:c(t,o,r,n+1,i),rightChild:c(t,s,r,n+1,i),isLeaf:!1,hyperplane:h,offset:l}}return{indices:e,isLeaf:!0}}function f(t,e,r,n,i,a,o){var h;if(t.isLeaf)return n[a][0]=-o,(h=i[o]).splice.apply(h,s([0,t.indices.length],t.indices)),{nodeNum:a,leafNum:o+=1};e[a]=t.hyperplane,r[a]=t.offset,n[a][0]=a+1;var u=a,l=f(t.leftChild,e,r,n,i,a+1,o);return a=l.nodeNum,o=l.leafNum,n[u][1]=a+1,{nodeNum:(l=f(t.rightChild,e,r,n,i,a+1,o)).nodeNum,leafNum:l.leafNum}}function p(t){return t.isLeaf?1:1+p(t.leftChild)+p(t.rightChild)}function d(t){return t.isLeaf?1:d(t.leftChild)+d(t.rightChild)}function m(t,e,r,n){for(var i=e,a=0;a<r.length;a++)i+=t[a]*r[a];return 0===i?u.tauRandInt(2,n):i>0?0:1}e.FlatTree=l,e.makeForest=function(t,e,r,n){var i=Math.max(10,e);return u.range(r).map(function(e,r){return function(t,e,r,n){return void 0===e&&(e=30),c(t,u.range(t.length),e,r,n)}(t,i,r,n)}).map(function(t){return function(t,e){var r=p(t),n=d(t),i=u.range(r).map(function(){return u.zeros(t.hyperplane?t.hyperplane.length:0)}),a=u.zeros(r),o=u.range(r).map(function(){return[-1,-1]}),s=u.range(n).map(function(){return u.range(e).map(function(){return-1})});return f(t,i,a,o,s,0,0),new l(i,a,o,s)}(t,i)})},e.makeLeafArray=function(t){var e,r;if(t.length>0){var n=[];try{for(var i=h(t),a=i.next();!a.done;a=i.next()){var o=a.value;n.push.apply(n,s(o.indices))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}return[[-1]]},e.searchFlatTree=function(t,e,r){for(var n=0;e.children[n][0]>0;)n=0===m(e.hyperplanes[n],e.offsets[n],t,r)?e.children[n][0]:e.children[n][1];var i=-1*e.children[n][0];return e.indices[i]}},5112(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return i(e,t),e},o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,a){function o(t){try{h(n.next(t))}catch(t){a(t)}}function s(t){try{h(n.throw(t))}catch(t){a(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,s)}h((n=n.apply(t,e||[])).next())})},s=this&&this.__generator||function(t,e){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},h=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},u=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.initTransform=e.resetLocalConnectivity=e.fastIntersection=e.findABParams=e.cosine=e.euclidean=e.UMAP=void 0;var c=a(r(1853)),f=a(r(702)),p=a(r(2286)),d=a(r(3731)),m=a(r(8186)),v=l(r(5407)),g=1e-5,y=.001,b=function(){function t(t){var e=this;void 0===t&&(t={}),this.learningRate=1,this.localConnectivity=1,this.minDist=.1,this.nComponents=2,this.nEpochs=0,this.nNeighbors=15,this.negativeSampleRate=5,this.random=Math.random,this.repulsionStrength=1,this.setOpMixRatio=1,this.spread=1,this.transformQueueSize=4,this.targetMetric="categorical",this.targetWeight=.5,this.targetNNeighbors=this.nNeighbors,this.distanceFn=w,this.isInitialized=!1,this.rpForest=[],this.embedding=[],this.optimizationState=new S;var r=function(r){void 0!==t[r]&&(e[r]=t[r])};r("distanceFn"),r("learningRate"),r("localConnectivity"),r("minDist"),r("nComponents"),r("nEpochs"),r("nNeighbors"),r("negativeSampleRate"),r("random"),r("repulsionStrength"),r("setOpMixRatio"),r("spread"),r("transformQueueSize")}return t.prototype.fit=function(t){return this.initializeFit(t),this.optimizeLayout(),this.embedding},t.prototype.fitAsync=function(t,e){return void 0===e&&(e=function(){return!0}),o(this,void 0,void 0,function(){return s(this,function(r){switch(r.label){case 0:return this.initializeFit(t),[4,this.optimizeLayoutAsync(e)];case 1:return r.sent(),[2,this.embedding]}})})},t.prototype.setSupervisedProjection=function(t,e){void 0===e&&(e={}),this.Y=t,this.targetMetric=e.targetMetric||this.targetMetric,this.targetWeight=e.targetWeight||this.targetWeight,this.targetNNeighbors=e.targetNNeighbors||this.targetNNeighbors},t.prototype.setPrecomputedKNN=function(t,e){this.knnIndices=t,this.knnDistances=e},t.prototype.initializeFit=function(t){if(t.length<=this.nNeighbors)throw new Error("Not enough data points ("+t.length+") to create nNeighbors: "+this.nNeighbors+". Add more data points or adjust the configuration.");if(this.X===t&&this.isInitialized)return this.getNEpochs();if(this.X=t,!this.knnIndices&&!this.knnDistances){var e=this.nearestNeighbors(t);this.knnIndices=e.knnIndices,this.knnDistances=e.knnDistances}this.graph=this.fuzzySimplicialSet(t,this.nNeighbors,this.setOpMixRatio),this.makeSearchFns(),this.searchGraph=this.makeSearchGraph(t),this.processGraphForSupervisedProjection();var r=this.initializeSimplicialSetEmbedding(),n=r.head,i=r.tail,a=r.epochsPerSample;return this.optimizationState.head=n,this.optimizationState.tail=i,this.optimizationState.epochsPerSample=a,this.initializeOptimization(),this.prepareForOptimizationLoop(),this.isInitialized=!0,this.getNEpochs()},t.prototype.makeSearchFns=function(){var t=p.makeInitializations(this.distanceFn),e=t.initFromTree,r=t.initFromRandom;this.initFromTree=e,this.initFromRandom=r,this.search=p.makeInitializedNNSearch(this.distanceFn)},t.prototype.makeSearchGraph=function(t){for(var e=this.knnIndices,r=this.knnDistances,n=[t.length,t.length],i=new f.SparseMatrix([],[],[],n),a=0;a<e.length;a++)for(var o=e[a],s=r[a],h=0;h<o.length;h++){var u=o[h],l=s[h];l>0&&i.set(a,u,l)}var c=f.transpose(i);return f.maximum(i,c)},t.prototype.transform=function(t){var e=this,r=this.X;if(void 0===r||0===r.length)throw new Error("No data has been fit.");var n=Math.floor(this.nNeighbors*this.transformQueueSize);n=Math.min(r.length,n);var i=p.initializeSearch(this.rpForest,r,t,n,this.initFromRandom,this.initFromTree,this.random),a=this.search(r,this.searchGraph,i,t),o=c.deheapSort(a),s=o.indices,h=o.weights;s=s.map(function(t){return t.slice(0,e.nNeighbors)}),h=h.map(function(t){return t.slice(0,e.nNeighbors)});var u=Math.max(0,this.localConnectivity-1),l=this.smoothKNNDistance(h,this.nNeighbors,u),d=l.sigmas,v=l.rhos,g=this.computeMembershipStrengths(s,h,d,v),y=g.rows,b=g.cols,w=g.vals,S=[t.length,r.length],M=new f.SparseMatrix(y,b,w,S),z=f.normalize(M,"l1"),_=f.getCSR(z),N=t.length,E=x(m.reshape2d(_.indices,N,this.nNeighbors),m.reshape2d(_.values,N,this.nNeighbors),this.embedding),k=this.nEpochs?this.nEpochs/3:M.nRows<=1e4?100:30,P=M.getValues().reduce(function(t,e){return e>t?e:t},0);M=M.map(function(t){return t<P/k?0:t}),M=f.eliminateZeros(M);var O=this.makeEpochsPerSample(M.getValues(),k),R=M.getRows(),j=M.getCols();return this.assignOptimizationStateParameters({headEmbedding:E,tailEmbedding:this.embedding,head:R,tail:j,currentEpoch:0,nEpochs:k,nVertices:M.getDims()[1],epochsPerSample:O}),this.prepareForOptimizationLoop(),this.optimizeLayout()},t.prototype.processGraphForSupervisedProjection=function(){var t=this.Y,e=this.X;if(t){if(t.length!==e.length)throw new Error("Length of X and y must be equal");if("categorical"===this.targetMetric){var r=this.targetWeight<1?1/(1-this.targetWeight)*2.5:1e12;this.graph=this.categoricalSimplicialSetIntersection(this.graph,t,r)}}},t.prototype.step=function(){var t=this.optimizationState.currentEpoch;return t<this.getNEpochs()&&this.optimizeLayoutStep(t),this.optimizationState.currentEpoch},t.prototype.getEmbedding=function(){return this.embedding},t.prototype.nearestNeighbors=function(t){var e,r=this.distanceFn,n=this.nNeighbors,i=p.makeNNDescent(r,this.random),a=5+Math.floor(.5==(e=Math.pow(t.length,.5)/20)?0:Math.round(e)),o=Math.max(5,Math.floor(Math.round(function(t){return Math.log(t)/Math.log(2)}(t.length))));this.rpForest=d.makeForest(t,n,a,this.random);var s=i(t,d.makeLeafArray(this.rpForest),n,o);return{knnIndices:s.indices,knnDistances:s.weights}},t.prototype.fuzzySimplicialSet=function(t,e,r){void 0===r&&(r=1);var n=this,i=n.knnIndices,a=void 0===i?[]:i,o=n.knnDistances,s=void 0===o?[]:o,h=n.localConnectivity,u=this.smoothKNNDistance(s,e,h),l=u.sigmas,c=u.rhos,p=this.computeMembershipStrengths(a,s,l,c),d=p.rows,m=p.cols,v=p.vals,g=[t.length,t.length],y=new f.SparseMatrix(d,m,v,g),b=f.transpose(y),w=f.pairwiseMultiply(y,b),S=f.subtract(f.add(y,b),w),M=f.multiplyScalar(S,r),z=f.multiplyScalar(w,1-r);return f.add(M,z)},t.prototype.categoricalSimplicialSetIntersection=function(t,e,r,n){void 0===n&&(n=1);var i=N(t,e,n,r);return E(i=f.eliminateZeros(i))},t.prototype.smoothKNNDistance=function(t,e,r,n,i){void 0===r&&(r=1),void 0===n&&(n=64),void 0===i&&(i=1);for(var a=Math.log(e)/Math.log(2)*i,o=m.zeros(t.length),s=m.zeros(t.length),h=0;h<t.length;h++){var u=0,l=1/0,c=1,f=t[h],p=f.filter(function(t){return t>0});if(p.length>=r){var d=Math.floor(r),v=r-d;d>0?(o[h]=p[d-1],v>g&&(o[h]+=v*(p[d]-p[d-1]))):o[h]=v*p[0]}else p.length>0&&(o[h]=m.max(p));for(var b=0;b<n;b++){for(var w=0,S=1;S<t[h].length;S++){var M=t[h][S]-o[h];w+=M>0?Math.exp(-M/c):1}if(Math.abs(w-a)<g)break;w>a?c=(u+(l=c))/2:(u=c,l===1/0?c*=2:c=(u+l)/2)}if(s[h]=c,o[h]>0){var z=m.mean(f);s[h]<y*z&&(s[h]=y*z)}else{var _=m.mean(t.map(m.mean));s[h]<y*_&&(s[h]=y*_)}}return{sigmas:s,rhos:o}},t.prototype.computeMembershipStrengths=function(t,e,r,n){for(var i=t.length,a=t[0].length,o=m.zeros(i*a),s=m.zeros(i*a),h=m.zeros(i*a),u=0;u<i;u++)for(var l=0;l<a;l++){var c=0;-1!==t[u][l]&&(c=t[u][l]===u?0:e[u][l]-n[u]<=0?1:Math.exp(-(e[u][l]-n[u])/r[u]),o[u*a+l]=u,s[u*a+l]=t[u][l],h[u*a+l]=c)}return{rows:o,cols:s,vals:h}},t.prototype.initializeSimplicialSetEmbedding=function(){for(var t=this,e=this.getNEpochs(),r=this.nComponents,n=this.graph.getValues(),i=0,a=0;a<n.length;a++){var o=n[a];i<n[a]&&(i=o)}var s=this.graph.map(function(t){return t<i/e?0:t});this.embedding=m.zeros(s.nRows).map(function(){return m.zeros(r).map(function(){return 20*m.tauRand(t.random)-10})});var h=[],u=[],l=[],c=s.getAll();for(a=0;a<c.length;a++){var f=c[a];f.value&&(h.push(f.value),l.push(f.row),u.push(f.col))}return{head:u,tail:l,epochsPerSample:this.makeEpochsPerSample(h,e)}},t.prototype.makeEpochsPerSample=function(t,e){var r=m.filled(t.length,-1),n=m.max(t),i=t.map(function(t){return t/n*e});return i.forEach(function(t,n){t>0&&(r[n]=e/i[n])}),r},t.prototype.assignOptimizationStateParameters=function(t){Object.assign(this.optimizationState,t)},t.prototype.prepareForOptimizationLoop=function(){var t=this,e=t.repulsionStrength,r=t.learningRate,n=t.negativeSampleRate,i=this.optimizationState,a=i.epochsPerSample,o=i.headEmbedding,s=i.tailEmbedding,h=o[0].length,l=o.length===s.length,c=a.map(function(t){return t/n}),f=u(c),p=u(a);this.assignOptimizationStateParameters({epochOfNextSample:p,epochOfNextNegativeSample:f,epochsPerNegativeSample:c,moveOther:l,initialAlpha:r,alpha:r,gamma:e,dim:h})},t.prototype.initializeOptimization=function(){var t=this.embedding,e=this.embedding,r=this.optimizationState,n=r.head,i=r.tail,a=r.epochsPerSample,o=this.getNEpochs(),s=this.graph.nCols,h=_(this.spread,this.minDist),u=h.a,l=h.b;this.assignOptimizationStateParameters({headEmbedding:t,tailEmbedding:e,head:n,tail:i,epochsPerSample:a,a:u,b:l,nEpochs:o,nVertices:s})},t.prototype.optimizeLayoutStep=function(t){for(var e=this.optimizationState,r=e.head,n=e.tail,i=e.headEmbedding,a=e.tailEmbedding,o=e.epochsPerSample,s=e.epochOfNextSample,h=e.epochOfNextNegativeSample,u=e.epochsPerNegativeSample,l=e.moveOther,c=e.initialAlpha,f=e.alpha,p=e.gamma,d=e.a,v=e.b,g=e.dim,y=e.nEpochs,b=e.nVertices,w=0;w<o.length;w++)if(!(s[w]>t)){var S=r[w],_=n[w],N=i[S],E=a[_],x=z(N,E),k=0;x>0&&(k=-2*d*v*Math.pow(x,v-1),k/=d*Math.pow(x,v)+1);for(var P=0;P<g;P++){var O=M(k*(N[P]-E[P]),4);N[P]+=O*f,l&&(E[P]+=-O*f)}s[w]+=o[w];for(var R=Math.floor((t-h[w])/u[w]),j=0;j<R;j++){var C=m.tauRandInt(b,this.random),F=a[C],A=z(N,F),D=0;if(A>0)D=2*p*v,D/=(.001+A)*(d*Math.pow(A,v)+1);else if(S===C)continue;for(P=0;P<g;P++)O=4,D>0&&(O=M(D*(N[P]-F[P]),4)),N[P]+=O*f}h[w]+=R*u[w]}return e.alpha=c*(1-t/y),e.currentEpoch+=1,i},t.prototype.optimizeLayoutAsync=function(t){var e=this;return void 0===t&&(t=function(){return!0}),new Promise(function(r,n){var i=function(){return o(e,void 0,void 0,function(){var e,a,o,h,u,l;return s(this,function(s){try{if(e=this.optimizationState,a=e.nEpochs,o=e.currentEpoch,this.embedding=this.optimizeLayoutStep(o),h=this.optimizationState.currentEpoch,u=!1===t(h),l=h===a,u||l)return[2,r(l)];setTimeout(function(){return i()},0)}catch(t){n(t)}return[2]})})};setTimeout(function(){return i()},0)})},t.prototype.optimizeLayout=function(t){void 0===t&&(t=function(){return!0});for(var e=!1,r=[];!e;){var n=this.optimizationState,i=n.nEpochs,a=n.currentEpoch;r=this.optimizeLayoutStep(a);var o=this.optimizationState.currentEpoch,s=!1===t(o);e=o===i||s}return r},t.prototype.getNEpochs=function(){var t=this.graph;if(this.nEpochs>0)return this.nEpochs;var e=t.nRows;return e<=2500?500:e<=5e3?400:e<=7500?300:200},t}();function w(t,e){for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n]-e[n],2);return Math.sqrt(r)}e.UMAP=b,e.euclidean=w,e.cosine=function(t,e){for(var r=0,n=0,i=0,a=0;a<t.length;a++)r+=t[a]*e[a],n+=Math.pow(t[a],2),i+=Math.pow(e[a],2);return 0===n&&0===i?0:0===n||0===i?1:1-r/Math.sqrt(n*i)};var S=function(){this.currentEpoch=0,this.headEmbedding=[],this.tailEmbedding=[],this.head=[],this.tail=[],this.epochsPerSample=[],this.epochOfNextSample=[],this.epochOfNextNegativeSample=[],this.epochsPerNegativeSample=[],this.moveOther=!0,this.initialAlpha=1,this.alpha=1,this.gamma=1,this.a=1.5769434603113077,this.b=.8950608779109733,this.dim=2,this.nEpochs=500,this.nVertices=0};function M(t,e){return t>e?e:t<-e?-e:t}function z(t,e){for(var r=0,n=0;n<t.length;n++)r+=Math.pow(t[n]-e[n],2);return r}function _(t,e){var r=m.linear(0,3*t,300).map(function(t){return t<e?1:t}),n=m.zeros(r.length).map(function(n,i){return r[i]>=e?Math.exp(-(r[i]-e)/t):n}),i={x:r,y:n},a=v.default(i,function(t){var e=h(t,2),r=e[0],n=e[1];return function(t){return 1/(1+r*Math.pow(t,2*n))}},{damping:1.5,initialValues:[.5,.5],gradientDifference:.1,maxIterations:100,errorTolerance:.01}).parameterValues,o=h(a,2);return{a:o[0],b:o[1]}}function N(t,e,r,n){return void 0===r&&(r=1),void 0===n&&(n=5),t.map(function(t,i,a){return-1===e[i]||-1===e[a]?t*Math.exp(-r):e[i]!==e[a]?t*Math.exp(-n):t})}function E(t){t=f.normalize(t,"max");var e=f.transpose(t),r=f.pairwiseMultiply(e,t);return t=f.add(t,f.subtract(e,r)),f.eliminateZeros(t)}function x(t,e,r){for(var n=m.zeros(t.length).map(function(t){return m.zeros(r[0].length)}),i=0;i<t.length;i++)for(var a=0;a<t[0].length;a++)for(var o=0;o<r[0].length;o++){var s=t[i][a];n[i][o]+=e[i][a]*r[s][o]}return n}e.findABParams=_,e.fastIntersection=N,e.resetLocalConnectivity=E,e.initTransform=x},8186(t,e){var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function n(t,e){return Math.floor(e()*t)}function i(t){for(var e=[],r=0;r<t;r++)e.push(void 0);return e}function a(t,e){return i(t).map(function(){return e})}function o(t){return a(t,0)}function s(t){return t.reduce(function(t,e){return t+e})}Object.defineProperty(e,"__esModule",{value:!0}),e.reshape2d=e.rejectionSample=e.max2d=e.max=e.mean=e.sum=e.linear=e.ones=e.zeros=e.filled=e.range=e.empty=e.norm=e.tauRand=e.tauRandInt=void 0,e.tauRandInt=n,e.tauRand=function(t){return t()},e.norm=function(t){var e,n,i=0;try{for(var a=r(t),o=a.next();!o.done;o=a.next()){var s=o.value;i+=Math.pow(s,2)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return Math.sqrt(i)},e.empty=i,e.range=function(t){return i(t).map(function(t,e){return e})},e.filled=a,e.zeros=o,e.ones=function(t){return a(t,1)},e.linear=function(t,e,r){return i(r).map(function(n,i){return t+i*((e-t)/(r-1))})},e.sum=s,e.mean=function(t){return s(t)/t.length},e.max=function(t){for(var e=0,r=0;r<t.length;r++)e=t[r]>e?t[r]:e;return e},e.max2d=function(t){for(var e=0,r=0;r<t.length;r++)for(var n=0;n<t[r].length;n++)e=t[r][n]>e?t[r][n]:e;return e},e.rejectionSample=function(t,e,r){for(var i=o(t),a=0;a<t;a++)for(var s=!0;s;){for(var h=n(e,r),u=!1,l=0;l<a;l++)if(h===i[l]){u=!0;break}u||(s=!1),i[a]=h}return i},e.reshape2d=function(t,e,r){var n=[],i=0;if(t.length!==e*r)throw new Error("Array dimensions must match input length.");for(var a=0;a<e;a++){for(var o=[],s=0;s<r;s++)o.push(t[i]),i+=1;n.push(o)}return n}},5407(t,e,r){r.r(e),r.d(e,{default:()=>h});const n=Object.prototype.toString;function i(t){return n.call(t).endsWith("Array]")}function a(t,e,r){let n=0;const i=r(e);for(let e=0;e<t.x.length;e++)n+=Math.abs(t.y[e]-i(t.x[e]));return n}var o=r(5907);function s(t,e,r,n,i){let a=r*n*n,s=o.uq.eye(e.length,e.length,a);const h=i(e);let u=new Float64Array(t.x.length);for(let e=0;e<t.x.length;e++)u[e]=h(t.x[e]);let l=function(t,e,r,n,i){const a=r.length,s=t.x.length;let h=new Array(a);for(let o=0;o<a;o++){h[o]=new Array(s);let a=r.slice();a[o]+=n;let u=i(a);for(let r=0;r<s;r++)h[o][r]=e[r]-u(t.x[r])}return new o.uq(h)}(t,u,e,n,i),c=function(t,e){const r=t.x.length;let n=new Array(r);for(let i=0;i<r;i++)n[i]=[t.y[i]-e[i]];return new o.uq(n)}(t,u),f=(0,o.DI)(s.add(l.mmul(l.transpose())));return(e=(e=new o.uq([e])).sub(f.mmul(l).mmul(c).mul(n).transpose())).to1DArray()}function h(t,e,r={}){let{maxIterations:n=100,gradientDifference:o=.1,damping:h=0,errorTolerance:u=.01,minValues:l,maxValues:c,initialValues:f}=r;if(h<=0)throw new Error("The damping option must be a positive number");if(!t.x||!t.y)throw new Error("The data parameter must have x and y elements");if(!i(t.x)||t.x.length<2||!i(t.y)||t.y.length<2)throw new Error("The data parameter elements must be an array with more than 2 points");if(t.x.length!==t.y.length)throw new Error("The data parameter elements must have the same size");let p=f||new Array(e.length).fill(1),d=p.length;if(c=c||new Array(d).fill(Number.MAX_SAFE_INTEGER),l=l||new Array(d).fill(Number.MIN_SAFE_INTEGER),c.length!==l.length)throw new Error("minValues and maxValues must be the same size");if(!i(p))throw new Error("initialValues must be an array");let m,v=a(t,p,e),g=v<=u;for(m=0;m<n&&!g;m++){p=s(t,p,h,o,e);for(let t=0;t<d;t++)p[t]=Math.min(Math.max(l[t],p[t]),c[t]);if(v=a(t,p,e),isNaN(v))break;g=v<=u}return{parameterValues:p,parameterError:v,iterations:m}}}}]);
2
2
  //# sourceMappingURL=415.js.map