"use strict";(self.webpackChunkchem=self.webpackChunkchem||[]).push([[589],{6066:(e,t,a)=>{var n;a.d(t,{G:()=>n}),function(e){e.EUCLIDEAN="EUCLIDEAN",e.MANHATTAN="MANHATTAN"}(n||(n={}))},2780:(e,t,a)=>{a.d(t,{lW:()=>n.lW,t$:()=>n.t$}),a(8498);var n=a(9336)},9336:(e,t,a)=>{a.d(t,{lW:()=>A,t$:()=>M});var n=a(2787),r=a(944),o=a(6295),i=a(3629),s=a(6863),T=a(8498);const c={[T.Pn.Euclidean]:i.ou},u={[T.xL.Levenshtein]:n.I,[T.xL.JaroWinkler]:r.Vb,[T.xL.Manhattan]:function(e,t){if(e.length!==t.length)return 1;{let a=0;for(let n=1;n<e.length;n++)a+=e[n]==t[n]?0:1;return a/e.length}},[T.xL.Onehot]:function(e,t){return e===t?0:1}},h={[T.aT.Tanimoto]:o.tO,[T.aT.Dice]:o.zn,[T.aT.Asymmetric]:o.gt,[T.aT.BraunBlanquet]:o.ij,[T.aT.Cosine]:o.lO,[T.aT.Kulczynski]:o.rR,[T.aT.McConnaughey]:o.lP,[T.aT.RogotGoldberg]:o.TK,[T.aT.Russel]:o.yK,[T.aT.Sokal]:o.Ii,[T.aT.Hamming]:o.be,[T.aT.Euclidean]:o.a4},l={[T.m6.TanimotoIntArray]:o.v_},m={[T.RR.Difference]:o.T6},E={[T.Wn.CommonItems]:o.Hr},y={[T.EG.Vector]:{[T.Pn.Euclidean]:c[T.Pn.Euclidean]},[T.EG.String]:{[T.xL.Levenshtein]:u[T.xL.Levenshtein],[T.xL.JaroWinkler]:u[T.xL.JaroWinkler],[T.xL.Manhattan]:u[T.xL.Manhattan],[T.xL.Onehot]:u[T.xL.Onehot]},[T.EG.BitArray]:{[T.aT.Tanimoto]:h[T.aT.Tanimoto],[T.aT.Dice]:h[T.aT.Dice],[T.aT.Asymmetric]:h[T.aT.Asymmetric],[T.aT.BraunBlanquet]:h[T.aT.BraunBlanquet],[T.aT.Cosine]:h[T.aT.Cosine],[T.aT.Kulczynski]:h[T.aT.Kulczynski],[T.aT.McConnaughey]:h[T.aT.McConnaughey],[T.aT.RogotGoldberg]:h[T.aT.RogotGoldberg],[T.aT.Russel]:h[T.aT.Russel],[T.aT.Sokal]:h[T.aT.Sokal]},[T.EG.MacroMolecule]:{[s.Z.HAMMING]:s.V[s.Z.HAMMING],[s.Z.LEVENSHTEIN]:s.V[s.Z.LEVENSHTEIN],[s.Z.NEEDLEMANN_WUNSCH]:s.V[s.Z.NEEDLEMANN_WUNSCH],[s.Z.MONOMER_CHEMICAL_DISTANCE]:s.V[s.Z.MONOMER_CHEMICAL_DISTANCE]},[T.EG.Number]:{[T.RR.Difference]:m[T.RR.Difference]},[T.EG.IntArray]:{[T.m6.TanimotoIntArray]:l[T.m6.TanimotoIntArray]},[T.EG.NumberArray]:{[T.Wn.CommonItems]:E[T.Wn.CommonItems]}},N=Object.keys(y).reduce(((e,t)=>{for(const a of Object.keys(y[t]))e[a]=t;return e}),{});function A(e){return"BitArray"==N[e]}class M{constructor(e){this.method=e,this.dataType=N[e]}metricNeedsArgs(e){return N[e]==T.EG.MacroMolecule.toString()||N[e]==T.EG.Number.toString()||function(e){return N[e]==T.EG.NumberArray.toString()}(e)}getMeasure(e){const t=y;if(!t.hasOwnProperty(this.dataType)||!t[this.dataType].hasOwnProperty(this.method))throw new Error(`Unknown measure ${this.method} for data type ${this.dataType}`);return this.metricNeedsArgs(this.method)?t[this.dataType][this.method](e):t[this.dataType][this.method]}static getMetricByDataType(e){return Object.keys(y[e])}static get availableMeasures(){return Object.keys(y)}}},3629:(e,t,a)=>{function n(e,t){let a=0;const n=e.length;if(n!==t.length)throw new Error("The dimensionality of the vectors must match");for(let r=0;r<n;++r)a+=Math.pow(e[r]-t[r],2);return Math.sqrt(a)}a.d(t,{ou:()=>n})}}]);
//# sourceMappingURL=589.js.map