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