@datagrok/helm 2.1.34 → 2.2.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.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.md +30 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +12 -12
- package/src/cell-renderer.ts +21 -153
- package/src/constants.ts +0 -11
- package/src/helm-helper.ts +9 -10
- package/src/helm-monomer-placer.ts +21 -85
- package/src/helm-web-editor.ts +5 -2
- package/src/package-test.ts +6 -2
- package/src/package-utils.ts +150 -0
- package/src/package.ts +96 -100
- package/src/tests/get-monomer-tests.ts +210 -0
- package/src/tests/helm-service-tests.ts +97 -0
- package/src/tests/helm-tests.ts +1 -0
- package/src/tests/properties-widget-tests.ts +4 -2
- package/src/tests/renderers-tests.ts +97 -22
- package/src/types/dojo.ts +3 -0
- package/src/types/index.ts +0 -0
- package/src/utils/dummy-monomer.ts +184 -0
- package/src/utils/get-hovered.ts +104 -0
- package/src/utils/get-monomer.ts +111 -0
- package/src/utils/helm-grid-cell-renderer.ts +199 -0
- package/src/utils/helm-service.ts +130 -0
- package/src/utils/index.ts +7 -7
- package/webpack.config.js +7 -0
- /package/src/tests/{get-molfiles.ts → get-molfiles-tests.ts} +0 -0
package/dist/package.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var helm;(()=>{"use strict";var t={460:(t,e,n)=>{n.d(e,{wW:()=>m});var r,s,i,o,l,a,h,c=n(888);n(200),n(852),n(923),n(688);class u{constructor(t,e=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof t){const n=t,r=u._createBuffer(n);if(e)for(let t=0;t<r.length;t++)r[t]=-1;this._data=r,this._length=n}else{if(!(t instanceof Uint32Array))throw new Error("Invalid constructor");this._data=t,this._length=e}}getRawData(){return this._data}assureGoez(t,e){if(t<0)throw new Error(`${e} should be greater than zero`)}assureInRange(t,e,n,r){if(t<e||t>n)throw new Error(`Argument ${r} (${t}) out of range (${e}, ${n})`)}copy(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}copyFrom(t){if(this._length!=t._length)throw new Error(`Lengths differ (${this._length} != ${t._length})`);this.copy(t._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(t){this._data=t,this._version++}get version(){return this._version}set version(t){this._version=t}incrementVersion(t=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(t){this._versionedName=t,this._versionedNameVersion=this._version}get self(){return this}setLength(t){if(t<0)throw new Error("should be >= 0");if(t==this._length)return;const e=Math.floor((t+31)/32);if(e>this._data.length||e+this.SHRINK_THRESHOLD<this._data.length){const t=new Uint32Array(e);this.copy(this._data,t,e>this._data.length?this._data.length:e),this._data=t}t>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,e)),this._length=t,this._version++}static fromAnd(t,e){if(t._length!=e._length)throw new Error(`Lengths differ (${t._length} != ${e._length})`);const n=new u(t._length);n._length=t._length,n._data=u._createBuffer(n._length),n._version=0;const r=t.lengthInInts;for(let s=0;s<r;s++)n._data[s]=t._data[s]&e._data[s];return n}static _createBuffer(t){return new Uint32Array(Math.floor((t+31)/32))}static fromValues(t){const e=new u(t.length);e._version=0;for(let n=0;n<e._length;n++)t[n]&&(e._data[Math.floor(n/32)]|=1<<(n%32&31));return e}static fromSeq(t,e){const n=new u(t);for(let r=0;r<t;++r)n.setBit(r,e(r));return n._version=0,n}static fromString(t){return u.fromSeq(t.length,(e=>"1"==t.charAt(e)))}static fromUint32Array(t,e){const n=new u(t);return n._data=e,n}static fromBytes(t){const e=t.length,n=new u(8*e);n._data=new Uint32Array(Math.floor((e+3)/4)),n._length=8*e;let r=0,s=0;for(;e-s>=4;)n._data[r++]=255&t[s]|(255&t[s+1])<<8|(255&t[s+2])<<16|(255&t[s+3])<<24,s+=4;return e-s==3&&(n._data[r]=(255&t[s+2])<<16),e-s==2&&(n._data[r]|=(255&t[s+1])<<8),e-s==1&&(n._data[r]|=255&t[s]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(t){if(this==t)return!0;if(null==t)return!1;if(this._length!=t._length)return!1;if(0==this._length)return!0;for(let e=0;e<this._data.length-1;e++)if(this._data[e]!=t._data[e])return!1;for(let e=8*(this._data.length-1);e<this._length;e++)if(this.getBit(e)!=t.getBit(e))return!1;return!0}clone(){const t=new u(0,!1);return t._data=Uint32Array.from(this._data),t._length=this._length,t._version=this._version,t}init(t,e){this.setAll(!1,!1);for(let e=0;e<this._length;e++)t(e)&&(this._data[Math.floor(e/32)]|=1<<(e%32&31));return this.incrementVersion(e),this}invert(t=!0){for(let t=0;t<this._data.length;t++)this._data[t]^=-1;this.incrementVersion(t)}setAll(t,e=!1){const n=t?-1:0,r=this.lengthInInts;for(let t=0;t<r;t++)this._data[t]=n;this.incrementVersion(e)}setIndexes(t,e=!0,n=!0,r=!0){n&&this.setAll(!e,!1);for(const n of t)this.setFast(n,e);this.incrementVersion(r)}everyIndex(t,e=!0){for(const n of t)if(this.getBit(n)!=e)return!1;return!0}anyIndex(t,e=!0){for(const n of t)if(this.getBit(n)==e)return!0;return!1}setWhere(t,e=!0,n=!0,r=!0,s=!0){if(n&&s&&this.setAll(!e,!1),s)for(let n=0;n<this._length;n++)t(n)&&this.setFast(n,e);else for(let n=0;n<this._length;n++)this.setFast(n,t(n)?e:!e);this.incrementVersion(r)}getRange(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return u.fromValues(n)}getRangeAsList(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return n}setRange(t,e,n,r=!0){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length-1,"to");const s=Math.min(t,e),i=Math.max(t,e);if(n)for(let t=s;t<=i;t++)this.setTrue(t);else for(let t=s;t<=i;t++)this.setFalse(t);return this.incrementVersion(r),this}setRandom(t,e,n=!0){if(t<0||t>this._length)throw new Error("n must be >= 0 && <= Count");t>this._length/2&&this.setRandom(this._length-t,!e),this.setAll(!e);for(let n=0;n<t;){const t=Math.floor(Math.random()*this._length);this.getBit(t)!=e&&(this.setFast(t,e),n++)}this.incrementVersion(n)}and(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]&=t._data[e];return this.incrementVersion(e),this}andNot(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let e=0;e<n;e++)this._data[e]&=~t._data[e];return this.incrementVersion(e),this}notAnd(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]=~this._data[e]&t._data[e];return this.incrementVersion(e),this}not(t=!0){for(let t=0,e=this.lengthInInts;t<e;t++)this._data[t]=~this._data[t];return this.incrementVersion(t),this}or(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]|=t._data[e];return this.incrementVersion(e),this}xor(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]^=t._data[e];return this.incrementVersion(e),this}insertAt(t,e,n=!1){if(this.assureInRange(t,0,this._length,"pos"),0==e)return;const r=this._length;this.setLength(this._length+e);for(let n=r-1;n>=t;n--)this.setBit(n+e,this.getBit(n));for(let r=t;r<t+e;r++)this.setBit(r,n)}removeAt(t,e=1){if(e<0)throw new Error("n cannot be negative");if(this.assureInRange(t,0,this._length-e,"pos"),this.contains(!0))for(let n=t;n<this._length-e;n++)this.setBit(n,this.getBit(n+e));this.setLength(this._length-e)}removeByMask(t,e=!0){if(this._length!=t.length)throw new Error("length != mask.length");if(t==this)this.setLength(t.countBits(!e)),this.setAll(!e);else{let n=0;for(let r=-1;-1!=(r=t.findNext(r,!e));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(t){return 0!=(this._data[Math.floor(t/32)]&1<<(31&t))}setBit(t,e,n=!0){this.setFast(t,e),this._version++}setFast(t,e){e?this._data[Math.floor(t/32)]|=1<<(31&t):this._data[Math.floor(t/32)]&=~(1<<(31&t))}setTrue(t){this._data[Math.floor(t/32)]|=1<<(31&t)}setFalse(t){this._data[Math.floor(t/32)]&=~(1<<(31&t))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(t){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const t=this.lengthInInts;let e=0;for(;e<t-1;e++)for(let t=this._data[e];0!=t;t>>>=8)this._selectedCount+=u._onBitCount[255&t];let n=this._data[e];const r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));0!=n;n>>>=8)this._selectedCount+=u._onBitCount[255&n];this._selectedCountVersion=this._version}return t?this._selectedCount:this._length-this._selectedCount}countWhere(t){let e=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)e+=t(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)e+=t(n)?1:0;return e}andWithCountBits(t,e){if(0==this._length)return 0;let n=0;const r=this.lengthInInts;let s=0;for(;s<r-1;s++)for(let e=this._data[s]&t._data[s];0!=e;e>>>=8)n+=u._onBitCount[255&e];let i=this._data[s]&t._data[s];const o=31&this._length;for(0!=o&&(i&=~(4294967295<<o));0!=i;i>>>=8)n+=u._onBitCount[255&i];return e?n:this._length-n}clear(){this.setLength(0)}contains(t){return this.findNext(-1,t)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(t,e=!0){if(this.assureInRange(t,-1,this._length,"index"),t>=this._length-1)return-1;let n=31&(t=t<0?0:t+1);const r=this.lengthInInts;for(let s=Math.floor(t/32);s<r;s++){let r=e?this._data[s]:~this._data[s];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!e&&-4294967296==r)continue;for(let e=0;0!=r;e+=8,r>>>=8){const n=u._firstOnBit[255&r];if(n>=0)return(t=n+32*s+e)>=this._length?-1:t}}return-1}findPrev(t,e=!0){if(0==t)return-1;this.assureInRange(t,-1,this._length,"index");let n=1+(t=t<0?this._length-1:t-1)&31;for(let r=Math.floor(t/32);r>=0;r--){let t=e?this._data[r]:~this._data[r];0!=n&&(t&=~(4294967295<<n),n=0);for(let e=24;0!=t;e-=8,t<<=8){const n=u._lastOnBit[t>>>24];if(n>=0)return n+32*r+e}}return-1}}u._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),u._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),u._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]),function(t){t.Levenshtein="Levenshtein",t.JaroWinkler="Jaro-Winkler",t.Manhattan="Manhattan",t.Onehot="One-Hot"}(r||(r={})),function(t){t.Euclidean="Euclidean"}(s||(s={})),function(t){t.Tanimoto="Tanimoto",t.Dice="Dice",t.Asymmetric="Asymmetric",t.BraunBlanquet="Braun-Blanquet",t.Cosine="Cosine",t.Kulczynski="Kulczynski",t.McConnaughey="Mc-Connaughey",t.RogotGoldberg="Rogot-Goldberg",t.Russel="Russel",t.Sokal="Sokal",t.Hamming="Hamming",t.Euclidean="Euclidean"}(i||(i={})),function(t){t.TanimotoIntArray="TanimotoIntArray"}(o||(o={})),function(t){t.Vector="Vector",t.String="String",t.BitArray="BitArray",t.MacroMolecule="MacroMolecule",t.Number="Number",t.IntArray="IntArray",t.NumberArray="NumberArray"}(l||(l={})),function(t){t.Difference="Difference"}(a||(a={})),function(t){t.CommonItems="Common Items"}(h||(h={}));var g=n(384);async function m(){const t=c.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===t.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await t[0].prepare().call()).getOutputParamValue()}i.Tanimoto,i.Dice,i.Asymmetric,i.BraunBlanquet,i.Cosine,i.Kulczynski,i.McConnaughey,i.RogotGoldberg,i.Russel,i.Sokal,i.Hamming,i.Euclidean,i.Tanimoto,i.Dice,i.Asymmetric,i.BraunBlanquet,i.Cosine,i.Kulczynski,i.McConnaughey,i.RogotGoldberg,i.Russel,i.Sokal,i.Hamming,i.Euclidean,i.Tanimoto,i.Dice,i.Cosine,i.Tanimoto,i.Asymmetric,i.Cosine,i.Sokal,g.Y.HAMMING,g.Y.LEVENSHTEIN,g.Y.MONOMER_CHEMICAL_DISTANCE,g.Y.NEEDLEMANN_WUNSCH},852:(t,e,n)=>{n.d(e,{E1:()=>r,cT:()=>s});const r="p",s=new RegExp(`[rd]\\((\\w)\\)${r}?`,"g")},136:(t,e,n)=>{n.d(e,{YF:()=>i,eQ:()=>o,qD:()=>r,y6:()=>a});var r,s=n(923);!function(t){t.FASTA="fasta",t.SEPARATOR="separator",t.HELM="helm"}(r||(r={}));const i=", ",o=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,l=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},a=[new s._u("PT",l.fasta.peptide,.5),new s._u("DNA",l.fasta.dna,.55),new s._u("RNA",l.fasta.rna,.55)]},736:(t,e,n)=>{n.d(e,{YF:()=>r.YF,g9:()=>s.g9,gX:()=>s.gX,oB:()=>s.oB,qD:()=>r.qD,y6:()=>r.y6});var r=n(136),s=n(502)},923:(t,e,n)=>{n.d(e,{AD:()=>i,_u:()=>s,yK:()=>r});const r="";class s{constructor(t,e,n){this.name=t,this.alphabet=e,this.cutoff=n}}class i extends s{constructor(t,e,n){super(t.name,t.alphabet,t.cutoff),this.freq=e,this.similarity=n}}},502:(t,e,n)=>{n.d(e,{Mx:()=>b,o5:()=>N,gX:()=>T,uw:()=>v,oB:()=>w,lh:()=>_,g9:()=>S});var r=n(888),s=n(848),i=n.n(s),o=n(923),l=n(136),a=n(688);class h extends Float32Array{}function c(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*t[n];return Math.sqrt(e)}class u{static makePalette(t,e=!1,n=u){const r={};return t.forEach((t=>{const n=t[0],s=t[1];n.forEach(((t,n)=>{r[t]=this.colourPalette[s][e?0:n]}))})),new n(r)}constructor(t){this._palette=t}get(t){return this._palette[t]}}u.undefinedColor="rgb(100,100,100)",u.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]};class g extends u{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,g)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,g)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new g({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(t){const e=t in g.aaSynonyms?g.aaSynonyms[t]:t;return super.get(e)}}g.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class m{static getPalette(t="grok"){switch(t){case"grok":return g.GrokGroups;case"lesk":return g.Lesk;default:throw new Error(`ChemPalette: scheme \`${t}\` does not exist`)}}static getInnerOuter(t){let e=0,n="",r="";for(const s of t)"("==s?e++:")"==s?e--:e?n+=s:r+=s;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(t="",e="grok"){const n=this.getPalette(e);let[r,s]=this.getInnerOuter(t);if(r=r.length>6?`${r.slice(0,3)}...`:r,s=s.length>6?`${s.slice(0,3)}...`:s,1==t.length||"("==t[1]){const e=t[0]?.toUpperCase();return e in n?[n.get(e),e,s,1]:[this.undefinedColor,r,s,1]}if("d"==t[0]&&t[1]in n&&(2==t.length||"("==t[2])){const e=t[1]?.toUpperCase();return e in n?[n.get(e),e,s,2]:[this.undefinedColor,r,s,2]}if(t.substring(0,3)in this.AAFullNames&&(3==t.length||"("==t[3])){const e=this.AAFullNames[t.substring(0,3)];return e in n?[n.get(e),e,s,3]:[this.undefinedColor,r,s,3]}if(t[0]?.toLowerCase()==t[0]&&t.substring(1,3)in this.AAFullNames&&(4==t.length||"("==t[4])){const e=this.AAFullNames[t.substring(1,3)];return e in n?[n.get(e),e,s,4]:[this.undefinedColor,r,s,4]}return[this.undefinedColor,r,s,0]}}m.SemType="Aminoacids",m.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",m.undefinedColor="rgb(100,100,100)",m.Names={G:"Glycine",L:"Leucine",Y:"Tyrosine",S:"Serine",E:"Glutamic acid",Q:"Glutamine",D:"Aspartic acid",N:"Asparagine",F:"Phenylalanine",A:"Alanine",K:"Lysine",R:"Arginine",H:"Histidine",C:"Cysteine",V:"Valine",P:"Proline",W:"Tryptophan",I:"Isoleucine",M:"Methionine",T:"Threonine"},m.AASmiles={G:"NCC(=O)O",L:"N[C@H](CC(C)C)C(=O)O",Y:"NC(CC1=CC=C(O)C=C1)C(=O)O",S:"NC(CO)C(=O)O",E:"N[C@@H](CCC(O)=O)C(=O)O",Q:"N[C@@H](CCC(N)=O)C(=O)O",D:"N[C@@H](CC(O)=O)C(=O)O",N:"N[C@@H](CC(N)=O)C(=O)O",F:"NC(CC1=CC=CC=C1)C(=O)O",A:"N[C@H](C)C(=O)O",K:"NC(CCCCN)C(=O)O",R:"N[C@H](CCCNC(=N)C)C(=O)O",H:"NC(CC1=CN=C[N]1)C(=O)O",C:"N[C@@H](CS)C(=O)O",V:"NC(C(C)C)C(=O)O",P:"N(CCC1)C1C(=O)O",W:"N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O",I:"N[C@H]([C@H](C)CC)C(=O)O",M:"NC(CCSC)C(=O)O",T:"NC(C(O)C)C(=O)O"},m.AASmilesTruncated={G:"*C*",L:"CC(C)C[C@H](*)*",Y:"C1=CC(=CC=C1CC(*)*)O",S:"OCC(*)C*",E:"*[C@@H](CCC(O)=O)*",Q:"*N[C@@H](CCC(N)=O)*",D:"*[C@@H](CC(O)=O)*",N:"*[C@@H](CC(N)=O)*",F:"C1=CC=C(C=C1)CC(*)*",A:"C[C@H](*)*",K:"C(CCN)CC(*)*",R:"*[C@H](CCCNC(=N)C)*",H:"C1=C(NC=N1)CC(*)*",C:"C([C@@H](*)*)S",V:"CC(C)C(*)*",P:"C1CCN(*)C1*",W:"*[C@@H](Cc1c2ccccc2n([H])c1)*",I:"CC[C@H](C)[C@H](*)*",M:"CSCCC(*)*",T:"CC(O)C(*)*"},m.AAFullNames={Ala:"A",Arg:"R",Asn:"N",Asp:"D",Cys:"C",Gln:"Q",Glu:"E",Gly:"G",His:"H",Ile:"I",Leu:"L",Lys:"K",Met:"M",Phe:"F",Pro:"P",Ser:"S",Thr:"T",Trp:"W",Tyr:"Y",Val:"V"};class f{}f.SemType="Nucleotides",f.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",f.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"};class d{static hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}}class p{}class C extends p{static buildPalette(){return[].concat(...Object.values(u.colourPalette))}get(t){const e=d.hashCode(t)%C.palette.length;return function(t){if(null==t)return"rgb(100,100,100)";const e=r.Color.fromHtml(t),n=r.Color.g(e),s=r.Color.r(e),i=r.Color.b(e),o=Math.sqrt(Math.pow(0-s,2)+Math.pow(0-n,2)+Math.pow(0-i,2));return o>210?`rgb(${s/o*210},${n/o*210},${i/o*210})`:r.Color.toRgb(e)}(C.palette[e])}}C.palette=C.buildPalette();class b{get length(){return this.mList.length}get canonicals(){return this.mList}get originals(){return this.mList}isGap(t){return this.getOriginal(t)===this.gapOriginalMonomer}getCanonical(t){if(this.length<=t)throw new Error("Index out of bounds");return this.mList[t]}getOriginal(t){if(this.length<=t)throw new Error("Index out of bounds");return this.mList[t]}constructor(t,e){this.mList=t,this.gapOriginalMonomer=e}}class A{get length(){return this.seqS.length}get canonicals(){return this.seqS}get originals(){return this.seqS}isGap(t){return this.getOriginal(t)===a.oh[l.qD.FASTA]}getCanonical(t){if(this.length<=t)throw new Error("Index out of bounds");return this.isGap(t)?o.yK:this.seqS[t]}getOriginal(t){if(this.length<=t)throw new Error("Index out of bounds");return this.seqS[t]}constructor(t){this.seqS=t}}const w=t=>{const e=i()(t.toString().matchAll(l.eQ)).map((t=>t[2]??t[1])).toArray();return new b(e,a.oh[l.qD.FASTA])},_=t=>t?new A(t):new b([],a.oh[l.qD.FASTA]);function T(t,e=void 0){return n=>{if(n){const r=n.replaceAll('"-"',"").replaceAll("'-'","").split(t,e);return new b(r,a.oh[l.qD.SEPARATOR])}return new b([],a.oh[l.qD.SEPARATOR])}}const E=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,y=/\[([^\[\]]+)]/g,S=t=>{E.lastIndex=0;const e=E.exec(t.toString()),n=e?e[2]:null,r=n?n.split("."):[];return new b(r.map((t=>{y.lastIndex=0;const e=y.exec(t);return e&&e.length>=2?e[1]:t})),a.oh[l.qD.HELM])},M=/([^\W_]+)/g;function v(t,e){if(t.length<=e)return t;const n=t.match(M),r=t.length>e||(n?.length??0)>1,s=n?.[0]??" ";return r?s.substring(0,e-1)+"…":s}function N(t,e,n="-"){const r=e.map((e=>{const r=function(t,e,n="-"){const r=new Set([...new Set(Object.keys(t)),...e]);r.delete(n);const s=[],i=[];for(const n of r)s.push(n in t?t[n]:0),i.push(e.has(n)?1:0);const o=new h(s),l=new h(i);return function(t,e){if(t.length!=e.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<t.length;r++)n+=t[r]*e[r];return n}(o,l)/(c(o)*c(l))}(t,e.alphabet,n);return new o.AD(e,t,r)}));let s;const i=Math.max(...r.map((t=>t.similarity>t.cutoff?t.similarity:-1)));return s=i>0?r.find((t=>t.similarity===i)).name:"UN",s}},688:(t,e,n)=>{n.d(e,{YL:()=>f,oh:()=>m});var r=n(888),s=n(848),i=n.n(s),o=n(736),l=n(923),a=n(502),h=n(384),c=n(460),u=n(852);const g=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},m={[o.qD.FASTA]:"-",[o.qD.SEPARATOR]:"",[o.qD.HELM]:"*"};class f{constructor(t){if(this._splitter=null,this.cached=!0,this._splitted=null,this.columnVersion=null,this._stats=null,this._maxLength=null,this._posList=null,this._joiner=void 0,t.type!==r.TYPE.STRING)throw new Error(`Unexpected column type '${t.type}', must be '${r.TYPE.STRING}'.`);this._column=t;const e=this._column.getTag(r.TAGS.UNITS);if(null==e)throw new Error("Units are not specified in column");if(this._units=e,this._notation=this.getNotation(),this._defaultGapOriginal=this.isFasta()?m[o.qD.FASTA]:this.isHelm()?m[o.qD.HELM]:m[o.qD.SEPARATOR],!this.column.tags.has("aligned")||!this.column.tags.has("alphabet")||!this.column.tags.has(".alphabetIsMultichar")&&!this.isHelm()&&"UN"===this.alphabet)if(this.isFasta())f.setUnitsToFastaColumn(this);else if(this.isSeparator()){const e=t.getTag("separator");f.setUnitsToSeparatorColumn(this,e)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.getTag(r.TAGS.UNITS)}'.`);f.setUnitsToHelmColumn(this)}if(!this.column.tags.has(".alphabetIsMultichar"))if(this.isHelm())this.column.setTag(".alphabetIsMultichar","true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '.alphabetIsMultichar' is mandatory.`);this.notationProvider=this.column.temp[g.notationProvider]??null,this.columnVersion=this.column.version}static setUnitsToFastaColumn(t){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE||t.column.getTag(r.TAGS.UNITS)!==o.qD.FASTA)throw new Error(`The column of notation '${o.qD.FASTA}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);t.column.setTag(r.TAGS.UNITS,o.qD.FASTA),f.setTags(t)}static setUnitsToSeparatorColumn(t,e){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE||t.column.getTag(r.TAGS.UNITS)!==o.qD.SEPARATOR)throw new Error(`The column of notation '${o.qD.SEPARATOR}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);if(!e)throw new Error(`The column of notation '${o.qD.SEPARATOR}' must have the separator tag.`);t.column.setTag(r.TAGS.UNITS,o.qD.SEPARATOR),t.column.setTag("separator",e),f.setTags(t)}static setUnitsToHelmColumn(t){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation '${o.qD.HELM}' must be '${r.SEMTYPE.MACROMOLECULE}'`);t.column.setTag(r.TAGS.UNITS,o.qD.HELM),f.setTags(t)}static setTags(t){const e=t.column.getTag(r.TAGS.UNITS),n=t.stats;if(Object.keys(n.freq).some((t=>t.length>1)),[o.qD.FASTA,o.qD.SEPARATOR].includes(e)){if(!t.column.getTag("alphabet")&&0===Object.keys(n.freq).length)throw new Error("Alphabet is empty and not annotated.");let e=t.column.getTag("aligned");null===e&&(e=n.sameLength?"SEQ.MSA":"SEQ",t.column.setTag("aligned",e));let r=t.column.getTag("alphabet");if(null===r&&(r=(0,a.o5)(n.freq,o.y6),t.column.setTag("alphabet",r)),"UN"===r){const e=Object.keys(n.freq).length,r=Object.keys(n.freq).some((t=>t.length>1));t.column.setTag(".alphabetSize",e.toString()),t.column.setTag(".alphabetIsMultichar",r?"true":"false")}}}get column(){return this._column}get length(){return this._column.length}get units(){return this._units}get notation(){return this._notation}get defaultGapOriginal(){return this._defaultGapOriginal}get separator(){const t=this.column.getTag("separator")??void 0;if(this.notation===o.qD.SEPARATOR&&void 0===t)throw new Error(`Separator is mandatory for column '${this.column.name}' of notation '${this.notation}'.`);return t}get aligned(){const t=this.column.getTag("aligned");if(!t&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return t}get alphabet(){const t=this.column.getTag("alphabet");if(!t&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return t}get helmCompatible(){return this.column.getTag(".isHelmCompatible")}getAlphabetSize(){if(this.notation==o.qD.HELM||"UN"==this.alphabet){const t=this.column.getTag(".alphabetSize");let e;if(t)e=parseInt(t);else{const t=this.stats;e=Object.keys(t.freq).length}return e}switch(this.alphabet){case"PT":return 20;case"DNA":case"RNA":return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return this.notation===o.qD.HELM||"UN"===this.alphabet&&"true"===this.column.getTag(".alphabetIsMultichar")}getSplitted(t){if(this.cached){this.column.version===this.columnVersion&&null!==this._splitted||(this.columnVersion=this.column.version,this._splitted=new Array(this.column.length));let e=this._splitted[t]?this._splitted[t].deref():void 0;if(!e){const n=this.column.get(t);e=this.splitter(n),this._splitted[t]=new WeakRef(e)}return e}{const e=this.column.get(t);return this.splitter(e)}}get stats(){if(null===this._stats){const t={};let e=!0,n=null;const r=this.column.length;for(let s=0;s<r;++s){const r=this.getSplitted(s);null==n?n=r.length:r.length!==n&&(e=!1);for(const e of r.canonicals)e in t||(t[e]=0),t[e]+=1}this._stats={freq:t,sameLength:e}}return this._stats}get maxLength(){return null===this._maxLength&&(this._maxLength=0===this.column.length?0:Math.max(...i().count(0).take(this.column.length).map((t=>this.getSplitted(t).length)))),this._maxLength}get posList(){if(null===this._posList){const t=this.column.getTag(".positionNames");this._posList=t?t.split(o.YF).map((t=>t.trim())):i().count(1).take(this.maxLength).map((t=>t.toString())).toArray()}return this._posList}isFasta(){return this.notation===o.qD.FASTA}isSeparator(){return this.notation===o.qD.SEPARATOR}isHelm(){return this.notation===o.qD.HELM}isRna(){return"RNA"===this.alphabet}isDna(){return"DNA"===this.alphabet}isPeptide(){return"PT"===this.alphabet}isMsa(){return!!this.aligned&&this.aligned.toUpperCase().includes("MSA")}isHelmCompatible(){return"true"===this.helmCompatible}isGap(t){return!t||t===this._defaultGapOriginal}getNotation(){if(this.units.toLowerCase().startsWith(o.qD.FASTA))return o.qD.FASTA;if(this.units.toLowerCase().startsWith(o.qD.SEPARATOR))return o.qD.SEPARATOR;if(this.units.toLowerCase().startsWith(o.qD.HELM))return o.qD.HELM;throw new Error(`Column '${this.column.name}' has unexpected notation '${this.units}'.`)}getHelmWrappers(){return[this.isDna()||this.isRna()||this.isHelmCompatible()?"RNA1{":"PEPTIDE1{",this.isDna()?"d(":this.isRna()?"r(":"",this.isDna()||this.isRna()?")p":"","}$$$$"]}getNewColumn(t,e,n,s){const i=this.column,l=t.toLowerCase()+"("+i.name+")",a=n??i.dataFrame.columns.getUnusedName(l),h=r.Column.fromList("string",a,s??new Array(this.column.length).fill(""));if(h.semType=r.SEMTYPE.MACROMOLECULE,h.setTag(r.TAGS.UNITS,t),t===o.qD.SEPARATOR){if(!e)throw new Error(`Notation '${o.qD.SEPARATOR}' requires separator value.`);h.setTag("separator",e)}h.setTag(r.TAGS.CELL_RENDERER,"sequence");const c=i.getTag("aligned");c&&h.setTag("aligned",c);let u=i.getTag("alphabet");u||this.notation!==o.qD.HELM||t===o.qD.HELM||(u="UN"),null!=u&&h.setTag("alphabet",u);let g=i.getTag(".alphabetSize");null!=u&&g&&h.setTag(".alphabetSize",g);const m=i.getTag(".alphabetIsMultichar");return null!=u&&void 0!==m&&h.setTag(".alphabetIsMultichar",m),t==o.qD.HELM&&(g=this.getAlphabetSize().toString(),h.setTag(".alphabetSize",g)),h}getNewColumnFromList(t,e){return this.getNewColumn(this.notation,this.separator,t,e)}static getNewColumn(t){const e=f.forColumn(t),n=e.notation;return e.getNewColumn(n)}static unitsStringIsValid(t){return t=t.toLowerCase(),[o.qD.FASTA,o.qD.SEPARATOR,o.qD.HELM].some((e=>t.startsWith(e.toLowerCase())))}static getNewColumnFromParams(t,e,n){if(!f.unitsStringIsValid(n))throw new Error("Invalid format of 'units' parameter");const s=r.Column.fromList("string",e,new Array(t).fill(""));return s.semType=r.SEMTYPE.MACROMOLECULE,s.setTag(r.TAGS.UNITS,n),s}getSplitter(t){let e=null;if(e=this.notationProvider?this.notationProvider.splitter:null,e)return e;if(this.units.toLowerCase().startsWith(o.qD.FASTA))return null===this.column.getTag("alphabet")||this.getAlphabetIsMultichar()?o.oB:a.lh;if(this.units.toLowerCase().startsWith(o.qD.SEPARATOR))return(0,o.gX)(this.separator,t);if(this.units.toLowerCase().startsWith(o.qD.HELM))return o.g9;throw new Error(`Unexpected units ${this.units} .`)}split(t){return this.splitter(t)}getDistanceFunctionName(){if(!this.isFasta())throw new Error("Only FASTA notation is supported");return this.isMsa()?h.Y.HAMMING:(this.alphabet,h.Y.LEVENSHTEIN)}getDistanceFunction(){return h.S[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(".isHelmCompatible"))return"true"===this.column.getTag(".isHelmCompatible");const t=(await(0,c.wW)()).getBioLib().getMonomerSymbolsByType("PEPTIDE".toString()),e=new Set(t),n=((0,o.gX)(this.separator),new Set),r=this.column.length,s=this.column.getRawData();for(let t=0;t<r;++t){const r=s[t];if(!(r in n)){n.add(r);const s=this.getSplitted(t);for(const t of s.canonicals)if(!e.has(t))return this.column.setTag(".isHelmCompatible","false"),!1}}return this.column.setTag(".isHelmCompatible","true"),!0}get splitter(){return null===this._splitter&&(this._splitter=this.getSplitter()),this._splitter}toFasta(t){return t===o.qD.FASTA}toSeparator(t){return t===o.qD.SEPARATOR}toHelm(t){return t===o.qD.HELM}convertHelmToFastaSeparator(t,e,n,r){r||(r=this.toFasta(e)?m[o.qD.FASTA]:m[o.qD.SEPARATOR]),n||(n=this.toFasta(e)?"":this.separator);const s=t.startsWith("RNA"),i=this.splitter(t),l=[];for(let t=0;t<i.length;++t){let n=i.getOriginal(t);if(s&&(n=n.replace(u.cT,"")),n===m[o.qD.HELM])l.push(r);else if(this.toFasta(e)&&n.length>1){const t="["+n+"]";l.push(t)}else l.push(n)}return l.join(n)}convert(t,e){const n=this.getJoiner({notation:t,separator:e}),r=this.getNewColumn(t,e);return r.init((t=>{const e=this.getSplitted(t);return n(e)})),r}getRegion(t,e,n){const r=this.getNewColumn(this.notation,this.separator);r.name=n;const s=t??0,i=e??this.maxLength-1,l=this.getJoiner(),h=i-s+1,c=m[this.notation];r.init((t=>{const e=this.getSplitted(t),n=new Array(h);for(let t=0;t<h;++t){const r=s+t;n[t]=r<e.length?e.getOriginal(r):c}return l(new a.Mx(n,c))}));const u=t=>{const e=t.split(",").map((t=>t.trim())),n=new Array(h);for(let t=0;t<h;++t){const r=s+t;n[t]=r<e.length?e[r]:"?"}return n.join(o.YF)},g=this.column.getTag(".positionNames");g&&r.setTag(".positionNames",u(g));const f=this.column.getTag(".positionLabels");return f&&r.setTag(".positionLabels",u(f)),r}get joiner(){return this._joiner||(this._joiner=this.getJoiner()),this._joiner}getJoiner(t){const e=t?t.notation:this.notation,n=t?t.separator:this.separator;let r;const s=this;switch(e){case o.qD.FASTA:r=function(t){return s.joinToFasta(t,s.isHelm())};break;case o.qD.SEPARATOR:if(!n)throw new Error(`Separator is mandatory for notation '${e}'.`);r=function(t){return d(t,n,s.isHelm())};break;case o.qD.HELM:{const t="DNA"===s.alphabet||"RNA"===s.alphabet,e=s.getHelmWrappers();r=function(n){return p(n,e,t)};break}default:throw new Error(`Unexpected notation '${e}'.`)}return r}getConverter(t,e=void 0){if(t===o.qD.SEPARATOR&&!e)throw new Error(`Target separator is not specified for target units '${o.qD.SEPARATOR}'.`);const n=this;if(t===o.qD.FASTA)return function(t){return n.convertToFasta(t)};if(t===o.qD.HELM)return function(t){return n.convertToHelm(t)};if(t===o.qD.SEPARATOR)return function(t){return n.convertToSeparator(t,e)};throw new Error}static forColumn(t){let e=t.temp[g.seqHandler];return e&&e.columnVersion===t.version||(e=t.temp[g.seqHandler]=new f(t)),e}joinToFasta(t,e){const n=new Array(t.length);for(let r=0;r<t.length;++r){const s=t.getOriginal(r);let i=t.getOriginal(r);e&&(i=i.replace(u.cT,"$1")),s===l.yK?i=m[o.qD.FASTA]:s===u.E1?i="":i.length>1&&(i="["+i+"]"),n[r]=i}return n.join("")}convertToFasta(t){const e=this.splitter,n=this.isHelm()?this.splitterAsHelmNucl(t):e(t);return this.joinToFasta(n,this.isHelm())}convertToSeparator(t,e){return d(this.isHelm()?this.splitterAsHelmNucl(t):this.splitter(t),e,this.isHelm())}convertToHelm(t){const e=this.getHelmWrappers(),n=t.startsWith("DNA")||t.startsWith("RNA");return p(this.splitter(t),e,n)}splitterAsHelmNucl(t){const e=this.splitter(t),n=new Array(e.length),r=t.startsWith("DNA"),s=t.startsWith("RNA");for(let t=0;t<e.length;++t){let i=e.getOriginal(t);(r||s)&&(i=i.replace(u.cT,"$1"),i=i===u.E1?null:i),n[t]=i||null}return new a.Mx(n.filter((t=>!!t)),m[o.qD.HELM])}}function d(t,e,n){const r=new Array(t.length);for(let e=0;e<t.length;++e){const s=t.getCanonical(e);let i=t.getOriginal(e);n&&(i=i.replace(u.cT,"$1")),s===l.yK?i=m[o.qD.SEPARATOR]:s===u.E1&&(i=""),r[e]=i}return r.join(e)}function p(t,e,n){const[r,s,i,a]=e,h=new Array(t.length);for(let e=0;e<t.length;++e){const r=t.getCanonical(e);let a=t.getOriginal(e);r===l.yK?a=m[o.qD.HELM]:(n&&(a=a.replace(u.cT,"$1")),a=1===a.length?`${s}${a}${i}`:`${s}[${a}]${i}`),h[e]=a}return`${r}${h.join(".")}${a}`}},384:(t,e,n)=>{function r(t={}){const e=function(){if(!t||!t.scoringMatrix||!t.alphabetIndexes)return(t,e)=>t===e?0:1;if(t.scoringMatrix.length!==Object.keys(t.alphabetIndexes).length)throw new Error("Scoring matrix and alphabet indexes should have the same length");const e=t.alphabetIndexes,n=t.scoringMatrix,r=Math.min(...Object.keys(e).map((t=>t.charCodeAt(0))))+1,s=new Float32Array((n.length+r)*(n.length+r));return Object.entries(e).forEach((([t,r])=>{const i=n[r];Object.entries(e).forEach((([e,r])=>{s[t.charCodeAt(0)*n.length+e.charCodeAt(0)]=i[r]}))})),(t,e)=>1-s[t.charCodeAt(0)*n.length+e.charCodeAt(0)]}(),n=t?.threshold??0;return(t,r)=>{let s=0;const i=t.length,o=r.length,l=Math.max(i,o)*(1-n);i!==o&&(s=Math.abs(i-o));let a=0;for(let n=0;n<Math.min(i,o);n++)if(t[n]!==r[n]&&(a+=e(t[n],r[n]),a>l))return 1;return a+=s,a/=Math.max(i,o),a}}n.d(e,{Y:()=>o,S:()=>l});const s=new Uint32Array(65536),i={gapOpen:1,gapExtend:.6,scoringMatrix:[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0,-4],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1,-4],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1,-4],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1,-4],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2,-4],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1,-4],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1,-4],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1,-4],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1,-4],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1,-4],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1,-4],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1,-4],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1,-4],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2,-4],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0,-4],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0,-4],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2,-4],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1,-4],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1,-4],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1,-4],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1,-4],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,1]],alphabetIndexes:{A:0,R:1,N:2,D:3,C:4,Q:5,E:6,G:7,H:8,I:9,L:10,K:11,M:12,F:13,P:14,S:15,T:16,W:17,Y:18,V:19,B:20,Z:21,X:22,"*":23}};var o;!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",t.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(o||(o={}));const l={[o.HAMMING]:r,[o.LEVENSHTEIN]:function(){return(t,e)=>((t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return 0===e.length?t.length:t.length<=32?((t,e)=>{const n=t.length,r=e.length,i=1<<n-1;let o=-1,l=0,a=n,h=n;for(;h--;)s[t.charCodeAt(h)]|=1<<h;for(h=0;h<r;h++){let t=s[e.charCodeAt(h)];const n=t|l;t|=(t&o)+o^o,l|=~(t|o),o&=t,l&i&&a++,o&i&&a--,l=l<<1|1,o=o<<1|~(n|l),l&=n}for(h=n;h--;)s[t.charCodeAt(h)]=0;return a})(t,e):((t,e)=>{const n=e.length,r=t.length,i=[],o=[],l=Math.ceil(n/32),a=Math.ceil(r/32);for(let t=0;t<l;t++)o[t]=-1,i[t]=0;let h=0;for(;h<a-1;h++){let l=0,a=-1;const c=32*h,u=Math.min(32,r)+c;for(let e=c;e<u;e++)s[t.charCodeAt(e)]|=1<<e;for(let t=0;t<n;t++){const n=s[e.charCodeAt(t)],r=o[t/32|0]>>>t&1,h=i[t/32|0]>>>t&1,c=n|l,u=((n|h)&a)+a^a|n|h;let g=l|~(u|a),m=a&u;g>>>31^r&&(o[t/32|0]^=1<<t),m>>>31^h&&(i[t/32|0]^=1<<t),g=g<<1|r,m=m<<1|h,a=m|~(c|g),l=g&c}for(let e=c;e<u;e++)s[t.charCodeAt(e)]=0}let c=0,u=-1;const g=32*h,m=Math.min(32,r-g)+g;for(let e=g;e<m;e++)s[t.charCodeAt(e)]|=1<<e;let f=r;for(let t=0;t<n;t++){const n=s[e.charCodeAt(t)],l=o[t/32|0]>>>t&1,a=i[t/32|0]>>>t&1,h=n|c,g=((n|a)&u)+u^u|n|a;let m=c|~(g|u),d=u&g;f+=m>>>r-1&1,f-=d>>>r-1&1,m>>>31^l&&(o[t/32|0]^=1<<t),d>>>31^a&&(i[t/32|0]^=1<<t),m=m<<1|l,d=d<<1|a,u=d|~(h|m),c=m&h}for(let e=g;e<m;e++)s[t.charCodeAt(e)]=0;return f})(t,e)})(t,e)/Math.max(t.length,e.length)},[o.NEEDLEMANN_WUNSCH]:function(t){const e=new Uint16Array(65536),{gapOpen:n,gapExtend:r,scoringMatrix:s,alphabetIndexes:o}={...i,...t};Object.entries(o).forEach((([t,n])=>e[t.charCodeAt(0)]=n));const l=[new Float32Array(1e4),new Float32Array(1e4)];return(t,i)=>{const o=new Array(t.length+1).fill(!1),a=new Array(t.length+1).fill(!1);let h=0,c=1;for(let e=1;e<t.length+1;e++)l[0][e]=-n-(e-1)*r,l[1][e]=0;l[0][0]=0;for(let u=1;u<i.length+1;u++){l[c][0]=-n-(u-1)*r;for(let g=1;g<t.length+1;g++){const m=l[h][g-1]+s[e[t.charCodeAt(g-1)]][e[i.charCodeAt(u-1)]],f=l[h][g]-(o[g]?r:n),d=l[c][g-1]-(a[g-1]?r:n);l[c][g]=Math.max(m,d,f),l[c][g]===m?(o[g]=!1,a[g]=!1):l[c][g]===d?(o[g]=!1,a[g]=!0):(o[g]=!0,a[g]=!1)}h=c,c=(c+1)%2}const u=Math.max(t.length,i.length);return(u-l[h][t.length])/u}},[o.MONOMER_CHEMICAL_DISTANCE]:r}},24:(t,e,n)=>{function r(t){var e;return"string"==typeof t||t instanceof String?t:("object"==typeof t||t instanceof Object)&&"$thrownJsError"in t?r(t.$thrownJsError):t instanceof Error?null!==(e=t.stack)&&void 0!==e?e:t.message:t.toString()}n.d(e,{v:()=>r})},52:(t,e,n)=>{n.d(e,{S:()=>a});var r=n(200),s=n(848),i=n.n(s),o=n(788),l=n(48);class a{constructor(t,e){this.gridCol=t,this.col=e,this.monomerCharWidth=7,this.leftPadding=5,this.monomerTextSizeMap={},this.subs=[],this.grid=this.gridCol?this.gridCol.grid:null,this.reset(),this.grid&&(this.subs.push(this.col.dataFrame.onDataChanged.subscribe((()=>{try{this.reset()}catch(t){console.error(t)}}))),this.subs.push(r.events.onViewRemoved.subscribe((t=>{try{this.grid&&this.grid.view?.id===t.id&&this.destroy()}catch(t){console.error(t)}})))),this.monomerLib=(0,l.getMonomerLib)(),this.subs.push(this.monomerLib.onChanged.subscribe(this.monomerLibOnChanged.bind(this)))}reset(){this._allPartsList=new Array(this.col.length).fill(null),this._lengthsList=new Array(this.col.length).fill(null),this._editorList=new Array(this.col.length).fill(null)}destroy(){for(const t of this.subs)t.unsubscribe()}skipCell(t){this._allPartsList[t]=[],this._lengthsList[t]=[]}getCellAllPartsLengths(t){const[e,n]=this.getCellMonomerLengthsForSeq(t),r=new Array(n.length+1);r[0]=this.leftPadding;for(let t=1;t<r.length;t++)r[t]=r[t-1]+n[t-1];return[e,n,r]}getCellMonomerLengthsForSeq(t){let e=this._allPartsList[t];if(null===e){const n=this.col.get(t);e=this._allPartsList[t]=function(t){const e=t?(0,o.a6)(t):[];return t?(0,o.kR)(e,t):[]}(n)}let n=this._lengthsList[t];if(null===n){n=this._lengthsList[t]=new Array(e.length);for(const[t,r]of i().enumerate(e)){const e=t.length*this.monomerCharWidth;n[r]=e}}return[e,n]}getMonomer(t){let e=null;if(t.polymerType)e=this.monomerLib.getMonomer(t.polymerType,t.symbol);else for(const n of this.monomerLib.getPolymerTypes())if(e=this.monomerLib.getMonomer(n,t.symbol),e)break;return e}monomerLibOnChanged(t){this.reset(),this.grid&&this.grid.invalidate()}setEditor(t,e){this._editorList[t]=e}getEditor(t){return this._editorList[t]}}},48:(t,e,n)=>{n.r(e),n.d(e,{_package:()=>N,editMoleculeCell:()=>I,getHelmHelper:()=>B,getMolfiles:()=>F,getMonomerLib:()=>O,helmCellRenderer:()=>H,initHelm:()=>L,openEditor:()=>D,propertiesWidget:()=>q});var r=n(200),s=n(304),i=n(888),o=n(592),l=n.n(o),a=n(24),h=n(736),c=n(688),u=n(788),g=n(848),m=n.n(g);const f=n(502).uw;var d,p;function C(t,e,n,r,s,i,o="rgb(100,100,100)",l=0,a=!1,h=1,c="",u=!1,g=p.classic,m=[],d=0,C=null,b=null,A=null,w={}){s.textAlign="start";let _=i.substring(0),T=u?"":c;g===p.MSA&&(T="");let E=!0,y=!0,S="difference";if(null!=C&&null!=C.cell.column&&(E=C.cell.column.temp["color-code"]??!0,y=C.cell.column.temp["compare-with-current"]??!0,S=C.cell.column.temp["highlight-difference"]??"difference"),b){const t=b[d];y&&b.length>0&&"difference"===S&&(h=_==t?.3:h),y&&b.length>0&&"equal"===S&&(h=_!=t?.3:h)}null!=A&&(_=f(_,A));const M=_+T;w[M]??(w[M]=s.measureText(M));let v=w[M];w[_]??(w[_]=s.measureText(_));let N=w[_].width;w[T]??(w[T]=s.measureText(T));const L=w[T].width,O=r/2-(v.fontBoundingBoxAscent+v.fontBoundingBoxDescent)/2+1;function x(n,r){const i=E?o:"rgb(0,0,0)";s.fillStyle=i,s.globalAlpha=h,g===p.classic&&(s.fillText(_,t+n,e+O),s.fillStyle="#808080",s.fillText(T,t+r,e+O)),g===p.MSA&&s.fillText(_,t+n,e+O)}v=v.width,g===p.MSA&&(N=m[d],v=m[d]);const H=(m[d]??0)-(m[0]??0);if(a||v>n)return x(H,H+N),t+H+N+L;{const e=(n-v)/2;return x(e,e+N),t+H+e+N}}!function(t){t.maxMonomerLength=".mm.cellRenderer.maxMonomerLength"}(d||(d={})),function(t){t.MSA="MSA",t.classic="classic"}(p||(p={}));var b=n(52);function A(t){let e=null,n=null;try{n=t.gridColumn}catch{n=null}e=n?n.temp:null;const r=t.cell.column;if(e||(e=r.temp),null===e)throw new Error("Monomer placer store (GridColumn or Column) not found.");return[n,r,e]}class w extends i.GridCellRenderer{get name(){return"helm"}get cellType(){return"helm"}get defaultWidth(){return 400}get defaultHeight(){return 100}onMouseMove(t,e){try{const[n,r,i]=A(t),o=i["bio-helmMonomerPlacer"];if(!r)return;const l=t.bounds,a=e.offsetX-l.x,h=e.offsetY-l.y,c=o.getEditor(t.tableRowIndex);let g,f=new Set;if(c)g=function(t,e,n,r){let s=null;function i(n){let s,i;for(let o=0;o<r.m.atoms.length;++o)if(!n.includes(o)){const n=r.m.atoms[o].p.x,l=r.m.atoms[o].p.y,a=Math.sqrt((t-n)**2+(e-l)**2);(void 0===i||i>a)&&(s=o,i=a)}return[s,i]}const[o,l]=i([]),[a,h]=i([o]);if(void 0!==o&&void 0!==l){const t=function(t){let e;switch(t.bio.type){case"HELM_BASE":case"HELM_SUGAR":case"HELM_LINKER":e="RNA";break;default:e="PEPTIDE"}return{symbol:t.elem,polymerType:e}}(r.m.atoms[o]);void 0!==a&&void 0!==h?l<.45*h&&(s=t):l<.35*n.bounds.height&&(s=t)}return s}(a,h,t,c);else{const e=t.cell.value?(0,u.aY)(t.cell.value):"",n=(0,u.a6)(e);f=(0,u.__)(n);const r=new Set(n);if(g=function(t,e,n,r){let s=null;const[i,o,l]=r.getCellAllPartsLengths(n.tableRowIndex);let a=0,h=Object.values(o).length-1,c=!1,u=0,g=0;if(t>l[0])for(;!c&&u<l.length;)g=Math.floor((h+a)/2),t>=l[g]&&t<=l[g+1]?(a=g,c=!0):t<l[g]?h=g-1:t>l[g+1]&&(a=g+1),a==h&&(c=!0),u++;return a=t>=l[a]?a:a-1,a>=0&&(s=function(t,e,n){let r;for(const s of n.getPolymerTypes())t.startsWith(s)&&(r={symbol:e,polymerType:s});if(!r)throw new Error(`Monomer not found for symbol = '${e}' and helmPrefix = '${t}'.`);return r}(i[0],i[a],r.monomerLib)),s}(a,0,t,o),g&&!r.has(g.symbol)&&(g=null),g){const t=o.monomerTextSizeMap[g.symbol];if(t){const e=l.height/2-(t.fontBoundingBoxAscent+t.fontBoundingBoxDescent)/2+1,n=e-t.fontBoundingBoxAscent,r=e+t.fontBoundingBoxDescent;(h<n||r<h)&&(g=null)}}}if(g)if(f.has(g.symbol))s.tooltip.show(s.divV([s.divText(`Monomer '${g.symbol}' not found.`),s.divText("Open the Context Panel, then expand Manage Libraries")]),e.x+16,e.y+16);else{const t=[s.div(g.symbol)],n=o.monomerLib.getTooltip(g.polymerType,g.symbol);t.push(n),s.tooltip.show(s.divV(t),e.x+16,e.y+16)}else{if(0==f.size)return void s.tooltip.hide();{const t=m()(f.keys()).toArray().sort().filter(((t,e)=>e<3)).join(", ")+(f.size>3?", ...":"");s.tooltip.show(s.divV([s.divText("Monomers missed in monomer libraries:"),s.divText(t)]),e.x+16,e.y+16)}}}catch(t){const e=(0,a.v)(t);console.error("Helm: HelmCellRenderer.onMouseMove() error:\n"+e)}finally{e.preventDefault(),e.stopPropagation()}}render(t,e,n,r,i,o,l){t.save();try{const[l,a,h]=A(o);if(!a)return;let c=h["bio-helmMonomerPlacer"];c||(c=h["bio-helmMonomerPlacer"]=new b.S(l,a));const g=-1!==o.gridRow?o.grid:void 0,m="red",f="#404040",d="#C0C0C0",p=o.cell.value?(0,u.aY)(o.cell.value):"",w=(0,u.a6)(p),_=new Set(w),T=(0,u.__)(w);if(0==T.size){const t=o.element=s.div([],{style:{width:r-2+"px",height:i-2+"px",margin:"1px",backgroundColor:"#FFE0E0"}});t.setAttribute("dataformat","helm"),t.setAttribute("data",p),t.parentElement&&(o.grid?.canvas?.offsetLeft??0)>0&&(t.parentElement.style.left=`${(o.grid?.canvas?.offsetLeft??0)+t.parentElement.offsetLeft}px`);const e=new JSDraw2.Editor(t,{width:r,height:i,skin:"w8",viewonly:!0});return c.setEditor(o.tableRowIndex,e),void c.skipCell(o.tableRowIndex)}if(T.size>0){if(!g){const e=window.devicePixelRatio;i=28,t.canvas.height=i*e,t.canvas.style.height=`${i}px`}r=g?Math.min(g.canvas.width-e,r):t.canvas.width-e,t.beginPath(),t.rect(e,n,r,i),t.clip(),t.transform(1,0,0,1,e,n),t.font="12px monospace",t.textBaseline="top";const[s,l,a]=c.getCellAllPartsLengths(o.tableRowIndex);for(let e=0;e<s.length;++e){const n=s[e],o="."===n||n.endsWith("{")||n.startsWith("}")?d:T.has(n)?m:_.has(n)?f:d;t.fillStyle=o,C(a[e],0,r,i,t,s[e],o,0,!0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,c.monomerTextSizeMap)}}}finally{t.restore()}}}class _{constructor(){this.w=200,this.h=100,this.host=s.div([],{style:{width:`${this.w}px`,height:`${this.h}px`}}),this.editor=new JSDraw2.Editor(this.host,{width:this.w,height:this.h,viewonly:!0})}resizeEditor(t,e){this.editor.setSize(t,e)}}class T{createHelmWebEditor(){return new _}createWebEditorApp(t,e){org.helm.webeditor.MolViewer.molscale=.8;const n=new scil.helm.App(t,{showabout:!1,mexfontsize:"90%",mexrnapinontab:!0,topmargin:20,mexmonomerstab:!0,sequenceviewonly:!1,mexfavoritefirst:!0,mexfilter:!0}),r=n.calculateSizes();n.canvas.resize(r.rightwidth-100,r.topheight-210);let s={width:r.rightwidth-100+"px",height:r.bottomheight+"px"};return scil.apply(n.sequence.style,s),scil.apply(n.notation.style,s),s={width:r.rightwidth+"px",height:r.bottomheight+n.toolbarheight+"px"},scil.apply(n.properties.parent.style,s),n.structureview.resize(r.rightwidth,r.bottomheight+n.toolbarheight),n.mex.resize(r.topheight-80),setTimeout((()=>{n.canvas.helm.setSequence(e,"HELM")}),200),n}static async getInstance(){let t=window.$helmHelper;return t||(window.$helmHelper=t=new T),t}}var E=n(980);const y="smiles",S="capGroupName",M="label";let v=null;const N=new i.Package;async function L(){return org.helm.webeditor.kCaseSensitive=!0,Promise.all([new Promise(((t,e)=>{dojo.ready((function(){t(null)}))})).then((()=>{window.dojox.gfx.svg.Text.prototype.getTextWidth=function(){const t=this.rawNode,e=t.parentNode,n=t.cloneNode(!0);n.style.visibility="hidden";let r=0;const s=n.firstChild.nodeValue;if(e.appendChild(n),""!=s){let t=100;for(;!r&&--t>0;)r=n.getBBox?parseInt(n.getBBox().width):68}return e.removeChild(n),r}})),r.functions.call("Bio:getBioLib")]).then((([t,e])=>{v=e,x(),v.onChanged.subscribe((t=>{try{x();const t=v.getPolymerTypes(),e="Monomer lib updated:<br />"+(0==t.length?"empty":t.map((t=>`${t} ${v.getMonomerSymbolsByType(t).length}`)).join("<br />"));r.shell.info(e)}catch(t){const e=(0,a.v)(t);console.error("Helm: initHelm monomerLib.onChanged() error:\n"+e)}}))})).catch((t=>{const e=t instanceof Error?t.message:t?t.toString():"Exception 'undefined'";r.shell.error(`Package 'Helm' init initHelm() error: ${e}`);const n=new Error(e);throw n.stack=t.stack,n}))}function O(){return v}function x(){org.helm.webeditor.Monomers.clear(),v.getPolymerTypes().forEach((t=>{v.getMonomerSymbolsByType(t).forEach((e=>{let n=!1;const r=v.getMonomer(t,e),s={id:e,m:r.molfile,n:r.name,na:r.naturalAnalog,rs:r.rgroups.length,type:r.polymerType,mt:r.monomerType,at:{}};if(r.rgroups.length>0){s.rs=r.rgroups.length;const t={};r.rgroups.forEach((e=>{t[e[M]]=e[S]})),s.at=t}else null!=r[y]?(s.rs=Object.keys(P(r[y].toString())).length,s.at=P(r[y].toString())):n=!0;n||org.helm.webeditor.Monomers.addOneMonomer(s)}))}));const t=r.shell.tv?.grid;t&&t.invalidate()}function H(){return new w}function R(t,e,n){const i=t&&void 0===n?t.value:e,o=(0,u.a6)(i),l=(0,u.__)(o);0===l.size?function(t,e,n){const r=s.div(),i=t.column,o=c.YL.forColumn(i);t.rowIndex,org.helm.webeditor.MolViewer.molscale=.8;const l=new scil.helm.App(r,{showabout:!1,mexfontsize:"90%",mexrnapinontab:!0,topmargin:20,mexmonomerstab:!0,sequenceviewonly:!1,mexfavoritefirst:!0,mexfilter:!0}),a=l.calculateSizes();l.canvas.resize(a.rightwidth-100,a.topheight-210);let h={width:a.rightwidth-100+"px",height:a.bottomheight+"px"};scil.apply(l.sequence.style,h),scil.apply(l.notation.style,h),h={width:a.rightwidth+"px",height:a.bottomheight+l.toolbarheight+"px"},scil.apply(l.properties.parent.style,h),l.structureview.resize(a.rightwidth,a.bottomheight+l.toolbarheight),l.mex.resize(a.topheight-80),setTimeout((()=>{t&&void 0===n?l.canvas.helm.setSequence(t.value,"HELM"):l.canvas.helm.setSequence(e,"HELM")}),200),s.dialog({showHeader:!1,showFooter:!0}).add(r).onOK((()=>{const e=l.canvas.getHelm(!0).replace(/<\/span>/g,"").replace(/<span style='background:#bbf;'>/g,"");if(t)if(void 0===n)t.value=e;else{const r=o.convertHelmToFastaSeparator(e,n,o.separator);t.value=r}})).show({modal:!0,fullScreen:!0})}(t,e,n):1===l.size&&l.has(c.oh[h.qD.HELM])?r.shell.warning(`WebEditor doesn't support Helm with gaps '${c.oh[h.qD.HELM]}'.`):r.shell.warning(`Monomers ${Array.from(l).map((t=>`'${t}'`)).join(", ")} are absent! <br/>Please, upload the monomer library! <br/><a href="https://datagrok.ai/help/domains/bio/macromolecules" target="_blank">Learn more</a>`)}function I(t){R(t.cell,void 0,void 0)}function D(t){const e=r.shell.tv.grid.dataFrame,n=e.columns.bySemType("Macromolecule"),s=c.YL.forColumn(n);n.getTag(i.TAGS.UNITS)===h.qD.HELM&&R(e.currentCell,void 0,void 0);const o=s.getConverter(h.qD.HELM)(t);R(e.currentCell,o,n.getTag(i.TAGS.UNITS))}function q(t){return(0,E.g)(t)}function P(t){const e=t.match(/(?<=\[)[^\][]*(?=])/gm),n={};let r,s="";if(e)for(let t=0;t<e.length;t++)if(null!=e[t]&&/\d/.test(e[t])){r=e[t][e[t].length-1],e[t]=e[t].replace(/[0-9]/g,"");for(let n=0;n<e[t].length;n++)":"!=e[t][n]&&(s+=e[t][n]);n["R"+r]=s,s=""}return n}function F(t){const e=i.Column.string("mols",t.length),n=s.div([],{style:{width:"0",height:"0"}});document.documentElement.appendChild(n);try{const r=new JSDraw2.Editor(n,{viewonly:!0});return e.init((e=>(r.setHelm(t.get(e)),r.getMolfile()))),e}finally{l()(n).empty(),n.remove()}}async function B(){return T.getInstance()}},788:(t,e,n)=>{n.d(e,{__:()=>h,a6:()=>a,aY:()=>o,kR:()=>l});const r=/\{(\*\.)+/g,s=/\.(\*\.)+/g,i=/(\.\*)+\}/g;function o(t){return t.replaceAll(r,"{").replaceAll(s,".").replaceAll(i,"}").replace("{*}","{}")}function l(t,e){const n=[];for(let r=0;r<(t??[]).length;++r){const s=e.indexOf(t[r]),i=e.slice(0,s);n.push(i),n.push(t[r]),e=e.substring(s+t[r].length)}return n.push(e),n}function a(t){t=g(t,"$")[0];const e=[];if(!scil.Utils.isNullOrEmpty(t)){const n=g(t,"|");for(let r=0;r<n.length;++r){let s=(t=m(n[r]).str).indexOf("{");s=(t=t.substring(s+1)).indexOf("}");const i=g(t=t.substring(0,s),".");for(const t of i)if(t&&""!==t)if(t.startsWith("[")&&t.includes("]")){const n=c(t,1,"[","]"),r=t.substring(1,n);e.push(r);const s=t.substring(n+1);i.push(s)}else if(t.includes("[")&&t.endsWith("]")){const n=u(t,t.length-2,"[","]"),r=t.substring(n+1,t.length-1);e.push(r);const s=t.substring(0,n);i.push(s)}else if(t.includes("(")&&t.includes(")")){const e=t.substring(0,t.indexOf("(")),n=t.substring(t.lastIndexOf(")")+1),r=[e,t.substring(e.length+1,t.length-n.length-1),n];for(const t of r)i.push(t)}else e.push(t)}}return e}function h(t){const e=Object.keys(org.helm.webeditor.monomerTypeList()),n=[],r=[];for(let t=0;t<e.length;t++)n.push(new scil.helm.Monomers.getMonomerSet(e[t])),Object.keys(n[t]).forEach((e=>{r.push(n[t][e].id)}));return new Set(t.filter((t=>!r.includes(t))))}function c(t,e,n,r){let s=e,i=0;for(;s<t.length;){if(t[s]===n&&i++,t[s]===r){if(0===i)return s;i--}s++}return-1}function u(t,e,n,r){let s=e,i=0;for(;s>=0;){if(t[s]===r&&i++,t[s]===n){if(0===i)return s;i--}s--}return-1}function g(t,e){const n=[];let r="",s=0,i=0,o=0,l=0;for(let a=0;a<t.length;++a){let h=t.substring(a,a+1);if(h==e&&0==i&&0==s&&0==o&&0==l)n.push(r),r="";else{if(r+=h,l>0&&"\\"==h&&a+1<t.length){++a;const e=t.substring(a,a+1);r+=e,h+=e}'"'==h?a>0&&"\\"==t.substring(a-1,a)||(l=0==l?1:0):"["==h?++i:"]"==h?--i:"("==h?++s:")"==h?--s:"{"==h?++o:"}"==h&&--o}}return n.push(r),n}function m(t){const e=f(t,'"');if(null!=e.tag)return e;const n=f(t,"'");return{tag:e.tag,repeat:n.tag,str:n.str}}function f(t,e){let n=null;if(scil.Utils.endswith(t,e)){let r=t.length-1;for(;r>0&&(r=t.lastIndexOf(e,r-1),!(r<=0||"\\"!=t.substring(r-1,r))););r>0&&r<t.length-1&&(n=t.substring(r+1,t.length-1),t=t.substring(0,r))}return null!=n&&(n=function(t){return scil.Utils.isNullOrEmpty(t)?t:t.replace(/[\\]./g,(function(t){switch(t){case"\\r":return"\r";case"\\n":return"\n";case"\\t":return"\t";default:return t.substring(1)}}))}(n.replace(new RegExp("\\"+e,"g"),e))),{tag:n,str:t}}},980:(t,e,n)=>{n.d(e,{g:()=>c});var r=n(304),s=n(888),i=n(592),o=n.n(i),l=n(688),a=n(736),h=n(788);function c(t){const e=l.YL.forColumn(t.cell.column),n=function(t,e){const n=e.isHelm()?t:e.getConverter(a.qD.HELM)(t),s=(0,h.aY)(n),i=r.div([],{style:{width:"0",height:"0"}});document.documentElement.appendChild(i);try{const t=new JSDraw2.Editor(i,{viewonly:!0});t.setHelm(s);const e=t.getFormula(!0),n=Math.round(100*t.getMolWeight())/100,r=Math.round(100*t.getExtinctionCoefficient(!0))/100;return{formula:e.replace(/<sub>/g,"").replace(/<\/sub>/g,""),"molecular weight":n,"extinction coefficient":r}}finally{o()(i).empty(),i.remove()}}(t.value,e);return new s.Widget(r.tableFromMap(n))}},592:t=>{t.exports=$},888:t=>{t.exports=DG},200:t=>{t.exports=grok},304:t=>{t.exports=ui},848:t=>{t.exports=wu}},e={};function n(r){var s=e[r];if(void 0!==s)return s.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,n),i.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r=n(48);helm=r})();
|
|
1
|
+
var helm;(()=>{var t={460:(t,e,n)=>{"use strict";n.d(e,{wW:()=>d});var r,i,s,o,a,h,l,c=n(888);n(200);class u{constructor(t,e=!1){if(this._length=0,this._version=0,this._updateLevel=0,this._selectedCount=0,this._selectedCountVersion=-1,this._selectedIndexesVersion=-1,this._versionedName="",this._versionedNameVersion=-1,this.SHRINK_THRESHOLD=256,"number"==typeof t){const n=t,r=u._createBuffer(n);if(e)for(let t=0;t<r.length;t++)r[t]=-1;this._data=r,this._length=n}else{if(!(t instanceof Uint32Array))throw new Error("Invalid constructor");this._data=t,this._length=e}}getRawData(){return this._data}assureGoez(t,e){if(t<0)throw new Error(`${e} should be greater than zero`)}assureInRange(t,e,n,r){if(t<e||t>n)throw new Error(`Argument ${r} (${t}) out of range (${e}, ${n})`)}copy(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}copyFrom(t){if(this._length!=t._length)throw new Error(`Lengths differ (${this._length} != ${t._length})`);this.copy(t._data,this._data,this.lengthInInts),this._version++}get length(){return this._length}get buffer(){return this._data}set buffer(t){this._data=t,this._version++}get version(){return this._version}set version(t){this._version=t}incrementVersion(t=!0){this._version++}get lengthInInts(){return Math.floor((this._length+31)/32)}get versionedName(){return this._version==this._versionedNameVersion?this._versionedName:""}set versionedName(t){this._versionedName=t,this._versionedNameVersion=this._version}get self(){return this}setLength(t){if(t<0)throw new Error("should be >= 0");if(t==this._length)return;const e=Math.floor((t+31)/32);if(e>this._data.length||e+this.SHRINK_THRESHOLD<this._data.length){const t=new Uint32Array(e);this.copy(this._data,t,e>this._data.length?this._data.length:e),this._data=t}t>this._length&&(this._length%32>0&&(this._data[this.lengthInInts-1]&=(1<<(this._length%32&31))-1),this._data.fill(0,this.lengthInInts,e)),this._length=t,this._version++}static fromAnd(t,e){if(t._length!=e._length)throw new Error(`Lengths differ (${t._length} != ${e._length})`);const n=new u(t._length);n._length=t._length,n._data=u._createBuffer(n._length),n._version=0;const r=t.lengthInInts;for(let i=0;i<r;i++)n._data[i]=t._data[i]&e._data[i];return n}static _createBuffer(t){return new Uint32Array(Math.floor((t+31)/32))}static fromValues(t){const e=new u(t.length);e._version=0;for(let n=0;n<e._length;n++)t[n]&&(e._data[Math.floor(n/32)]|=1<<(n%32&31));return e}static fromSeq(t,e){const n=new u(t);for(let r=0;r<t;++r)n.setBit(r,e(r));return n._version=0,n}static fromString(t){return u.fromSeq(t.length,(e=>"1"==t.charAt(e)))}static fromUint32Array(t,e){const n=new u(t);return n._data=e,n}static fromBytes(t){const e=t.length,n=new u(8*e);n._data=new Uint32Array(Math.floor((e+3)/4)),n._length=8*e;let r=0,i=0;for(;e-i>=4;)n._data[r++]=255&t[i]|(255&t[i+1])<<8|(255&t[i+2])<<16|(255&t[i+3])<<24,i+=4;return e-i==3&&(n._data[r]=(255&t[i+2])<<16),e-i==2&&(n._data[r]|=(255&t[i+1])<<8),e-i==1&&(n._data[r]|=255&t[i]),n._version=0,n}toString(){return`${this._length} bits, ${this.countBits(!0)} set`}equals(t){if(this==t)return!0;if(null==t)return!1;if(this._length!=t._length)return!1;if(0==this._length)return!0;for(let e=0;e<this._data.length-1;e++)if(this._data[e]!=t._data[e])return!1;for(let e=8*(this._data.length-1);e<this._length;e++)if(this.getBit(e)!=t.getBit(e))return!1;return!0}clone(){const t=new u(0,!1);return t._data=Uint32Array.from(this._data),t._length=this._length,t._version=this._version,t}init(t,e){this.setAll(!1,!1);for(let e=0;e<this._length;e++)t(e)&&(this._data[Math.floor(e/32)]|=1<<(e%32&31));return this.incrementVersion(e),this}invert(t=!0){for(let t=0;t<this._data.length;t++)this._data[t]^=-1;this.incrementVersion(t)}setAll(t,e=!1){const n=t?-1:0,r=this.lengthInInts;for(let t=0;t<r;t++)this._data[t]=n;this.incrementVersion(e)}setIndexes(t,e=!0,n=!0,r=!0){n&&this.setAll(!e,!1);for(const n of t)this.setFast(n,e);this.incrementVersion(r)}everyIndex(t,e=!0){for(const n of t)if(this.getBit(n)!=e)return!1;return!0}anyIndex(t,e=!0){for(const n of t)if(this.getBit(n)==e)return!0;return!1}setWhere(t,e=!0,n=!0,r=!0,i=!0){if(n&&i&&this.setAll(!e,!1),i)for(let n=0;n<this._length;n++)t(n)&&this.setFast(n,e);else for(let n=0;n<this._length;n++)this.setFast(n,t(n)?e:!e);this.incrementVersion(r)}getRange(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return u.fromValues(n)}getRangeAsList(t,e){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length,"to");const n=[];for(let r=t;r<e;++r)n.push(this.getBit(r));return n}setRange(t,e,n,r=!0){this.assureInRange(t,0,this._length-1,"from"),this.assureInRange(e,0,this._length-1,"to");const i=Math.min(t,e),s=Math.max(t,e);if(n)for(let t=i;t<=s;t++)this.setTrue(t);else for(let t=i;t<=s;t++)this.setFalse(t);return this.incrementVersion(r),this}setRandom(t,e,n=!0){if(t<0||t>this._length)throw new Error("n must be >= 0 && <= Count");t>this._length/2&&this.setRandom(this._length-t,!e),this.setAll(!e);for(let n=0;n<t;){const t=Math.floor(Math.random()*this._length);this.getBit(t)!=e&&(this.setFast(t,e),n++)}this.incrementVersion(n)}and(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]&=t._data[e];return this.incrementVersion(e),this}andNot(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");const n=this.lengthInInts;for(let e=0;e<n;e++)this._data[e]&=~t._data[e];return this.incrementVersion(e),this}notAnd(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]=~this._data[e]&t._data[e];return this.incrementVersion(e),this}not(t=!0){for(let t=0,e=this.lengthInInts;t<e;t++)this._data[t]=~this._data[t];return this.incrementVersion(t),this}or(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]|=t._data[e];return this.incrementVersion(e),this}xor(t,e=!0){if(this._length!=t._length)throw new Error("Array lengths differ.");for(let e=0,n=this.lengthInInts;e<n;e++)this._data[e]^=t._data[e];return this.incrementVersion(e),this}insertAt(t,e,n=!1){if(this.assureInRange(t,0,this._length,"pos"),0==e)return;const r=this._length;this.setLength(this._length+e);for(let n=r-1;n>=t;n--)this.setBit(n+e,this.getBit(n));for(let r=t;r<t+e;r++)this.setBit(r,n)}removeAt(t,e=1){if(e<0)throw new Error("n cannot be negative");if(this.assureInRange(t,0,this._length-e,"pos"),this.contains(!0))for(let n=t;n<this._length-e;n++)this.setBit(n,this.getBit(n+e));this.setLength(this._length-e)}removeByMask(t,e=!0){if(this._length!=t.length)throw new Error("length != mask.length");if(t==this)this.setLength(t.countBits(!e)),this.setAll(!e);else{let n=0;for(let r=-1;-1!=(r=t.findNext(r,!e));)this.setFast(n++,this.getBit(r));this._length=n,this._version++}return this}getBit(t){return 0!=(this._data[Math.floor(t/32)]&1<<(31&t))}setBit(t,e,n=!0){this.setFast(t,e),this._version++}setFast(t,e){e?this._data[Math.floor(t/32)]|=1<<(31&t):this._data[Math.floor(t/32)]&=~(1<<(31&t))}setTrue(t){this._data[Math.floor(t/32)]|=1<<(31&t)}setFalse(t){this._data[Math.floor(t/32)]&=~(1<<(31&t))}trueCount(){return this.countBits(!0)}falseCount(){return this.countBits(!1)}countBits(t){if(0==this._length)return 0;if(this._selectedCountVersion!=this._version){this._selectedCount=0;const t=this.lengthInInts;let e=0;for(;e<t-1;e++)for(let t=this._data[e];0!=t;t>>>=8)this._selectedCount+=u._onBitCount[255&t];let n=this._data[e];const r=31&this._length;for(0!=r&&(n&=~(4294967295<<r));0!=n;n>>>=8)this._selectedCount+=u._onBitCount[255&n];this._selectedCountVersion=this._version}return t?this._selectedCount:this._length-this._selectedCount}countWhere(t){let e=0;if(this.trueCount()==this._length)for(let n=0;n<this._length;n++)e+=t(n)?1:0;else for(let n=-1;-1!=(n=this.findNext(n,!0));)e+=t(n)?1:0;return e}andWithCountBits(t,e){if(0==this._length)return 0;let n=0;const r=this.lengthInInts;let i=0;for(;i<r-1;i++)for(let e=this._data[i]&t._data[i];0!=e;e>>>=8)n+=u._onBitCount[255&e];let s=this._data[i]&t._data[i];const o=31&this._length;for(0!=o&&(s&=~(4294967295<<o));0!=s;s>>>=8)n+=u._onBitCount[255&s];return e?n:this._length-n}clear(){this.setLength(0)}contains(t){return this.findNext(-1,t)>=0}get allTrue(){return this.countBits(!0)==this._length}get allFalse(){return this.countBits(!1)==this._length}get anyTrue(){return this.countBits(!0)>0}get anyFalse(){return this.countBits(!1)>0}findNext(t,e=!0){if(this.assureInRange(t,-1,this._length,"index"),t>=this._length-1)return-1;let n=31&(t=t<0?0:t+1);const r=this.lengthInInts;for(let i=Math.floor(t/32);i<r;i++){let r=e?this._data[i]:~this._data[i];if(0!=n)r&=4294967295<<n&4294967295,n=0;else if(!e&&-4294967296==r)continue;for(let e=0;0!=r;e+=8,r>>>=8){const n=u._firstOnBit[255&r];if(n>=0)return(t=n+32*i+e)>=this._length?-1:t}}return-1}findPrev(t,e=!0){if(0==t)return-1;this.assureInRange(t,-1,this._length,"index");let n=1+(t=t<0?this._length-1:t-1)&31;for(let r=Math.floor(t/32);r>=0;r--){let t=e?this._data[r]:~this._data[r];0!=n&&(t&=~(4294967295<<n),n=0);for(let e=24;0!=t;e-=8,t<<=8){const n=u._lastOnBit[t>>>24];if(n>=0)return n+32*r+e}}return-1}}u._onBitCount=Int8Array.from([0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8]),u._firstOnBit=Int8Array.from([-1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0]),u._lastOnBit=Int8Array.from([-1,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]),function(t){t.Levenshtein="Levenshtein",t.JaroWinkler="Jaro-Winkler",t.Manhattan="Manhattan",t.Onehot="One-Hot"}(r||(r={})),function(t){t.Euclidean="Euclidean"}(i||(i={})),function(t){t.Tanimoto="Tanimoto",t.Dice="Dice",t.Asymmetric="Asymmetric",t.BraunBlanquet="Braun-Blanquet",t.Cosine="Cosine",t.Kulczynski="Kulczynski",t.McConnaughey="Mc-Connaughey",t.RogotGoldberg="Rogot-Goldberg",t.Russel="Russel",t.Sokal="Sokal",t.Hamming="Hamming",t.Euclidean="Euclidean"}(s||(s={})),function(t){t.TanimotoIntArray="TanimotoIntArray"}(o||(o={})),function(t){t.Vector="Vector",t.String="String",t.BitArray="BitArray",t.MacroMolecule="MacroMolecule",t.Number="Number",t.IntArray="IntArray",t.NumberArray="NumberArray"}(a||(a={})),function(t){t.Difference="Difference"}(h||(h={})),function(t){t.CommonItems="Common Items"}(l||(l={}));var g=n(384);async function d(){const t=c.Func.find({package:"Bio",name:"getMonomerLibHelper"});if(0===t.length)throw new Error('Package "Bio" must be installed for MonomerLibHelper.');return(await t[0].prepare().call()).getOutputParamValue()}s.Tanimoto,s.Dice,s.Asymmetric,s.BraunBlanquet,s.Cosine,s.Kulczynski,s.McConnaughey,s.RogotGoldberg,s.Russel,s.Sokal,s.Hamming,s.Euclidean,s.Tanimoto,s.Dice,s.Asymmetric,s.BraunBlanquet,s.Cosine,s.Kulczynski,s.McConnaughey,s.RogotGoldberg,s.Russel,s.Sokal,s.Hamming,s.Euclidean,s.Tanimoto,s.Dice,s.Cosine,s.Tanimoto,s.Asymmetric,s.Cosine,s.Sokal,g.Y.HAMMING,g.Y.LEVENSHTEIN,g.Y.MONOMER_CHEMICAL_DISTANCE,g.Y.NEEDLEMANN_WUNSCH,n(852),n(923),n(688)},516:(t,e,n)=>{"use strict";function r(t){let e;switch(t){case"HELM_BASE":case"HELM_SUGAR":case"HELM_LINKER":case"HELM_NUCLETIDE":case"nucleotide":e="RNA";break;case"HELM_AA":e="PEPTIDE";break;case"HELM_CHEM":e="CHEM";break;case"HELM_BLOB":e="BLOB";break;default:e="PEPTIDE",console.warn(`Unexpected HelmType '${t}'`)}return e}n.d(e,{y:()=>r})},248:(t,e,n)=>{"use strict";n.d(e,{I5:()=>c,_m:()=>a,y4:()=>l});var r=n(888),i=n(304),s=n(872),o=n(544);class a{constructor(t,e,n){this.backColor=t,this.width=e,this.height=n}}class h{constructor(t,e,n,r){this.name=t,this.props=e,this.onAfterRender=n,this.isPriority=r}}class l{constructor(t,e=3,n=0,r=3,i=1e3){this.logger=t,this.retryLimit=e,this._errorCount=n,this.errorLimit=r,this.taskTimout=i,this.consumerCounter=0,this._busy=!1,this._sweeperHandle=null,this.viewerId=++l.viewerCounter,this._queue=[],this._queueDict={},this._sweepToggle(!1)}toLog(){return`${this.constructor.name}<${this.viewerId}>`}get errorCount(){return this._errorCount}render(t,e,n,r=0){const i=`${this.toLog()}.render()`;if(this.logger.debug(`${i}, start key: ${n?.toString()}`),void 0!==n){if(n in this._queueDict){const t=this._queue.findIndex((t=>t.key===n));this._queue.splice(t,1)}this.logger.debug(`${i}, _queueDict[ key: ${n?.toString()} ] = <task>`),this._queueDict[n]=e}return this.logger.debug(`${i}, _queue.push(), key: ${n?.toString()}`),null===t&&(t=++this.consumerCounter),this._queue.push({consumerId:t,key:n,task:e,tryCount:r,dt:window.performance.now()}),this._busy||(this._sweepToggle(this._busy=!0),this.logger.debug(`${i}, window.requestAnimationFrame() -> this._processQueue() `),window.requestAnimationFrame((()=>{this._processQueue()}))),t}isBusy(t){return this._queue.some((e=>e.consumerId===t))}getTask(){if(0==this._queue.length)return;let t;const e=this._queue[0];if(e.task.isPriority&&!e.task.isPriority()){let n=null;for(let t=0;t<this._queue.length;++t){const r=this._queue[t];if(r.consumerId===e.consumerId&&r.task.isPriority){if(r.task.isPriority()){n=t;break}{const e=this._queue.splice(t);this._queue.push(...e)}}}null!==n&&(t=this._queue.splice(n,1)[0])}return t||(t=this._queue.shift()),t}_processQueue(){const t=`${this.toLog()}._processQueue()`;if(0===this._queue.length)return;this.logger.debug(`${t}, queue: ${JSON.stringify(this._queue.map((t=>t.key)))}`);let e=null;const n=n=>{const r=`${t}.finallyProcessQueue( <- ${n} )`;e&&e.unsubscribe(),this._queue.length>0?(this.logger.debug(`${r}, window.requestAnimationFrame() -> this._processQueue() `),window.requestAnimationFrame((()=>{this._processQueue()}))):(this.logger.debug(`${r}, this._busy = false`),this._sweepToggle(this._busy=!1))},r=this.getTask();if(!r)return this.logger.error(`${t}, queueItem = undefined `),void n("no queue item");const{consumerId:i,key:o,task:a,tryCount:h,dt:l}=r;if(void 0!==o&&(this.logger.debug(`${t}, key: ${o.toString()}`),delete this._queueDict[o]),h>this.retryLimit)return this.logger.warning(`${t}, skip task, key: ${o?.toString()}, tryCount: ${h}`),void n("try count limit");let c,u=!1;const g=window.setTimeout((()=>{u||(this.logger.warning(`${t}.timeoutHandle(), not handled, key: ${o?.toString()}.\n The .requestRender() overridden method must call renderHandler callback from args.`),this._errorCount+=1,this.render(i,a,o,h+1),n("timeout"))}),1e3);this.requestRender(o,a,(e=>{this.logger.debug(`${t}.renderHandler(), key: ${o?.toString()}`),this.onRendered(o,a,c,e)&&(u=!0,window.clearTimeout(g),n("render"))})).then((n=>{const r=`${t}, requestRender().then()`;e=n[0],c=n[1];const i=n[2];void 0===c&&console.warn(`${r}, this.requestRender.then() emptyCanvasHash undefined`),i()})).catch((e=>{const r=`${t}, requestRender().catch()`,[l,c]=(0,s.g$)(e);this.logger.error(l,void 0,c),window.clearTimeout(g),this._errorCount+=1,this.render(i,a,o,h+1),n(`${r}`)}))}_sweepQueue(){const t=`${this.toLog()}._sweepQueue()`,e=window.performance.now();let n=0;for(let r=this._queue.length-1;r>=0;r--){const{key:i,task:s,dt:o}=this._queue[r];e-o>this.taskTimout&&(this.logger.warning(`${t}, remove task key = ${i?.toString()}`),this._queue.splice(r),delete this._queueDict[i],++n)}this._sweepToggle(this._busy=this._queue.length>0),!this._busy&&n&&this.logger.warning(`${t}, ${n} task(s) had been swept`)}_sweepToggle(t){const e=`${this.toLog()}._sweepToggle( busy = ${t} )`;return t&&null!==this._sweeperHandle&&(this.logger.debug(`${e}, disable queue sweeper`),window.clearInterval(this._sweeperHandle),this._sweeperHandle=null),t||null!==this._sweeperHandle||(this.logger.debug(`${e}, enable queue sweeper`),this._sweeperHandle=window.setInterval((()=>{this._sweepQueue()}),500)),t}}l.viewerCounter=-1;class c extends o.W{constructor(t,e,n,r=!0){super(t,e,n),this.cacheEnabled=r,this.taskQueueMap=new Map,this.imageCache=new Map,this.consumerId=null}reset(){this.imageCache,this.imageCache=new Map}render(t,e,n,s,o,a,l){const c=window.devicePixelRatio,u=this.getRenderService();if(null==a.tableRowIndex)return;const g=a.tableRowIndex;this.logger.debug(`PdbRenderer.render() start rowIdx=${g}`),t.save();try{const d=this.imageCache.has(g)?this.imageCache.get(g):null,m=new r.Rect(e,n,s,o);let f,p,y;if(this.gridCol?(f=a.gridColumn.width*c-2,p=a.grid.props.rowHeight*c-2,y=l?l.backColor:null,y=y??(this.gridCol?this.gridCol.grid.props.backColor:null),y=y??r.Color.argb(0,0,0,0)):(f=s*c-2,p=o*c-2,y=r.Color.argb(0,0,0,0)),!this.cacheEnabled||!d||Math.abs(d.width/c-f)>.5||Math.abs(d.height/c-p)>.5){let l=!0;if(d&&(l=this.renderCellImageData(t,m,a,d)),!l)return;const c=new h(a.cell.rowIndex.toString(),this.getRenderTaskProps(a,y,f,p),((h,l)=>{this.storeAux(a,l),t.save();try{this.logger.debug(`PdbRenderer.render() onAfterRender() rowIdx = ${g}`);let l=h.getContext("2d");l||(l=i.canvas(h.width,h.height).getContext("2d"),l.drawImage(h,0,0));const c=l.getImageData(0,0,h.width,h.height);this.renderOnGrid(t,new r.Rect(e,n,s,o),a,c),this.imageCache.set(g,c)}finally{t.restore(),this.taskQueueMap.delete(g),0===this.taskQueueMap.size&&this._onRendered.next()}}),this.gridCol?()=>{const t=a.grid;return t.vertScroll.min-1<=a.gridRow&&a.gridRow<=t.vertScroll.max}:void 0);this.taskQueueMap.set(g,c),this.consumerId=u.render(this.consumerId,c,g)}else this.logger.debug(`PdbRenderer.render(), from imageCache[${g}]`),this.renderOnGrid(t,m,a,d);this.consumerId&&u.isBusy(this.consumerId)||this._onRendered.next()}catch(t){const e=t instanceof Error?t.message:t.toString();this.logger.error(`BsV:PdbGridCellRenderer.render() no rethrown error: ${e}`,void 0,t instanceof Error?t.stack:void 0)}finally{t.restore()}}renderCellImageData(t,e,n,r){const s=window.devicePixelRatio,o=i.canvas(r.width,r.height);o.getContext("2d").putImageData(r,0,0);const a=(e.width-1)*s,h=(e.height-1)*s,l=i.canvas(a,h),c=Math.min(a/r.width,h/r.height),u=(a-r.width*c)/2,g=(h-r.height*c)/2,d=l.getContext("2d");d.transform(c,0,0,c,u,g),d.drawImage(o,0,0);const m=d.getImageData(0,0,a,h);return this.renderOnGrid(t,e,n,m),!0}renderOnGrid(t,e,n,i){const s=`renderOnGridCell( gRow = ${n.gridRow} )`,o=`${this.toLog()}.${s}`,a=window.devicePixelRatio;this.logger.debug(`${o}, start`),t.save();try{if(t.resetTransform(),this.gridCol){const t=this.gridCol.grid,r=Math.floor(t.vertScroll.min);e.y=((n.gridRow-r)*t.props.rowHeight+t.colHeaderHeight)*a;let i=0;for(let e=0;e<this.gridCol.idx;e++){const n=t.columns.byIndex(e);i+=n.visible?n.width:0}e.x=(i-t.horzScroll.min)*a}const s=new r.Rect(e.x+a,e.y+a,(e.width-1)*a,(e.height-1)*a);t.beginPath(),t.rect(s.x,s.y,s.width,s.height),t.clip(),t.putImageData(i,e.x+a,e.y+a)}finally{t.restore()}}}},544:(t,e,n)=>{"use strict";n.d(e,{M:()=>o,W:()=>a});var r=n(200),i=n(468),s=n(272);function o(t){let e=null,n=null;try{n=t.dart?t.gridColumn:null,e=n?n.temp:null}catch{[n,e]=[null,null]}const r=t.cell.column;if(e=e??r.temp,!e)throw new Error("Grid cell renderer back store (GridColumn or Column) not found.");return[n,r,e]}class a{constructor(t,e,n){this.gridCol=t,this.tableCol=e,this.logger=n,this.subs=[],this.destroyed=!1,this.viewerId=++a.viewerCounter,this.errors=[],this._onRendered=new i.Subject,this.reset(),this.tableCol&&this.tableCol.dataFrame&&this.subs.push(this.tableCol.dataFrame.onDataChanged.subscribe((()=>{try{this.reset()}catch(t){this.logger.error(t)}}))),this.tableCol&&this.subs.push(r.events.onTableRemoved.subscribe((t=>{try{const e=t.args.dataFrame;this.tableCol?.dataFrame.id!==e.id||this.destroyed||this.destroy()}catch(t){this.logger.error(t)}}))),this.gridCol&&this.subs.push(r.events.onViewRemoving.subscribe((t=>{try{const e=t.args.view;this.gridCol?.dart&&this.gridCol.grid&&this.gridCol?.grid?.dart&&this.gridCol?.grid?.view?.id===e.id&&!this.destroyed&&this.destroy()}catch(t){this.logger.error(t)}})))}toLog(){return`${this.constructor.name}<${this.viewerId}>`}destroy(){for(const t of this.subs)t.unsubscribe();this.destroyed=!0}invalidateGrid(){this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}get onRendered(){return this._onRendered}invalidate(t){this.invalidateGrid()}async awaitRendered(t=1e4,e=`${t} timeout`){const n=`${this.toLog()}.awaitRendered()`;if(this.logger.debug(`${n}, start, testEvent before`),await(0,s.SG)(this._onRendered,(()=>{}),(()=>{this.invalidate()}),t,`${n}, ${e}`),this.errors.length>0){const t=this.errors[0];throw this.errors=[],t}this.logger.debug(`${n}, end`)}}a.viewerCounter=-1},852:(t,e,n)=>{"use strict";n.d(e,{E1:()=>r,cT:()=>i});const r="p",i=new RegExp(`[rd]\\((\\w)\\)${r}?`,"g")},872:(t,e,n)=>{"use strict";function r(t){return"string"==typeof t||t instanceof String?t:"StateError"===t.constructor.name?t.message:"StateError"===t.constructor.name&&"$thrownJsError"in t?r(t.$thrownJsError):t instanceof Error?t.message:t.toString()}function i(t){return t instanceof Error?t.stack:"StateError"===t.constructor.name&&"$thrownJsError"in t?i(t.$thrownJsError):void 0}function s(t){return[r(t),i(t)]}n.d(e,{g$:()=>s})},136:(t,e,n)=>{"use strict";n.d(e,{YF:()=>s,eQ:()=>o,qD:()=>r,y6:()=>h});var r,i=n(923);!function(t){t.FASTA="fasta",t.SEPARATOR="separator",t.HELM="helm"}(r||(r={}));const s=", ",o=/(?:\[([A-Za-z0-9_\-,()]+)\])|([A-Za-z\-])/g,a=new class{constructor(){this.fasta={peptide:new Set(["G","L","Y","S","E","Q","D","N","F","A","K","R","H","C","V","P","W","I","M","T"]),dna:new Set(["A","C","G","T"]),rna:new Set(["A","C","G","U"])}}},h=[new i._u("PT",a.fasta.peptide,.5),new i._u("DNA",a.fasta.dna,.55),new i._u("RNA",a.fasta.rna,.55)]},736:(t,e,n)=>{"use strict";n.d(e,{YF:()=>r.YF,g9:()=>i.g9,gX:()=>i.gX,oB:()=>i.oB,qD:()=>r.qD,y6:()=>r.y6});var r=n(136),i=n(502)},923:(t,e,n)=>{"use strict";n.d(e,{AD:()=>s,_u:()=>i,yK:()=>r});const r="";class i{constructor(t,e,n){this.name=t,this.alphabet=e,this.cutoff=n}}class s extends i{constructor(t,e,n){super(t.name,t.alphabet,t.cutoff),this.freq=e,this.similarity=n}}},502:(t,e,n)=>{"use strict";n.d(e,{Mx:()=>C,o5:()=>T,gX:()=>A,oB:()=>b,lh:()=>w,g9:()=>v});var r=n(888),i=n(848),s=n.n(i),o=n(923),a=n(136),h=n(688);class l extends Float32Array{}function c(t){let e=0;for(let n=0;n<t.length;n++)e+=t[n]*t[n];return Math.sqrt(e)}class u{static makePalette(t,e=!1,n=u){const r={};return t.forEach((t=>{const n=t[0],i=t[1];n.forEach(((t,n)=>{r[t]=this.colourPalette[i][e?0:n]}))})),new n(r)}constructor(t){this._palette=t}get(t){return this._palette[t]}}u.undefinedColor="rgb(100,100,100)",u.colourPalette={orange:["rgb(255,187,120)","rgb(245,167,100)","rgb(235,137,70)","rgb(205, 111, 71)"],all_green:["rgb(44,160,44)","rgb(74,160,74)","rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)","rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],all_blue:["rgb(31,119,180)","rgb(23,190,207)","rgb(122, 102, 189)","rgb(158,218,229)","rgb(141, 124, 217)","rgb(31, 120, 150)"],magenta:["rgb(162,106,192)","rgb(197,165,224)","rgb(208,113,218)"],red:["rgb(214,39,40)","rgb(255,152,150)"],st_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(31,119,180)"],dark_blue:["rgb(31,119,180)","rgb(31, 120, 150)"],light_blue:["rgb(23,190,207)","rgb(158,218,229)","rgb(108, 218, 229)","rgb(23,190,227)"],lilac_blue:["rgb(124,102,211)","rgb(149,134,217)","rgb(97, 81, 150)"],dark_green:["rgb(23,103,57)","rgb(30,110,96)","rgb(60,131,95)","rgb(24,110,79)"],green:["rgb(44,160,44)","rgb(74,160,74)"],light_green:["rgb(152,223,138)","rgb(182, 223, 138)","rgb(152, 193, 138)"],st_green:["rgb(44,160,44)","rgb(152,223,138)","rgb(39, 174, 96)","rgb(74,160,74)"],pink:["rgb(247,182,210)"],brown:["rgb(140,86,75)","rgb(102, 62, 54)"],gray:["rgb(127,127,127)","rgb(199,199,199)","rgb(196,156,148)","rgb(222, 222, 180)"],yellow:["rgb(188,189,34)"],white:["rgb(230,230,230)"]};class g extends u{static get Lesk(){return void 0===this.lesk&&(this.lesk=this.makePalette([[["G","A","S","T"],"orange"],[["C","V","I","L","P","F","Y","M","W"],"all_green"],[["N","Q","H"],"magenta"],[["D","E"],"red"],[["K","R"],"all_blue"]],!1,g)),this.lesk}static get GrokGroups(){return void 0===this.grokGroups&&(this.grokGroups=this.makePalette([[["C","U"],"yellow"],[["G","P"],"red"],[["A","V","I","L","M","F","Y","W"],"all_green"],[["R","H","K"],"light_blue"],[["D","E"],"dark_blue"],[["S","T","N","Q"],"orange"]],!1,g)),this.grokGroups}static get RasMol(){return void 0===this.rasMol&&(this.rasMol=new g({D:"#E60A0A",E:"#E60A0A",C:"#E6E600",M:"#E6E600",K:"#145AFF",R:"#145AFF",S:"#FA9600",T:"#FA9600",F:"#3232AA",Y:"#3232AA",N:"#00DCDC",Q:"#00DCDC",G:"#EBEBEB",L:"#0F820F",V:"#0F820F",I:"#0F820F",A:"#C8C8C8",W:"#B45AB4",H:"#8282D2",P:"#DC9682",others:"#BEA06E"})),this.rasMol}get(t){const e=t in g.aaSynonyms?g.aaSynonyms[t]:t;return super.get(e)}}g.aaSynonyms={MeNle:"L",MeA:"A",MeG:"G",MeF:"F"};class d{static getPalette(t="grok"){switch(t){case"grok":return g.GrokGroups;case"lesk":return g.Lesk;default:throw new Error(`ChemPalette: scheme \`${t}\` does not exist`)}}static getInnerOuter(t){let e=0,n="",r="";for(const i of t)"("==i?e++:")"==i?e--:e?n+=i:r+=i;return isNaN(parseInt(n))?[r,n]:[r,""]}static getColorAAPivot(t="",e="grok"){const n=this.getPalette(e);let[r,i]=this.getInnerOuter(t);if(r=r.length>6?`${r.slice(0,3)}...`:r,i=i.length>6?`${i.slice(0,3)}...`:i,1==t.length||"("==t[1]){const e=t[0]?.toUpperCase();return e in n?[n.get(e),e,i,1]:[this.undefinedColor,r,i,1]}if("d"==t[0]&&t[1]in n&&(2==t.length||"("==t[2])){const e=t[1]?.toUpperCase();return e in n?[n.get(e),e,i,2]:[this.undefinedColor,r,i,2]}if(t.substring(0,3)in this.AAFullNames&&(3==t.length||"("==t[3])){const e=this.AAFullNames[t.substring(0,3)];return e in n?[n.get(e),e,i,3]:[this.undefinedColor,r,i,3]}if(t[0]?.toLowerCase()==t[0]&&t.substring(1,3)in this.AAFullNames&&(4==t.length||"("==t[4])){const e=this.AAFullNames[t.substring(1,3)];return e in n?[n.get(e),e,i,4]:[this.undefinedColor,r,i,4]}return[this.undefinedColor,r,i,0]}}d.SemType="Aminoacids",d.SemTypeMultipleAlignment="AminoacidsMultipleAlignment",d.undefinedColor="rgb(100,100,100)",d.Names={G:"Glycine",L:"Leucine",Y:"Tyrosine",S:"Serine",E:"Glutamic acid",Q:"Glutamine",D:"Aspartic acid",N:"Asparagine",F:"Phenylalanine",A:"Alanine",K:"Lysine",R:"Arginine",H:"Histidine",C:"Cysteine",V:"Valine",P:"Proline",W:"Tryptophan",I:"Isoleucine",M:"Methionine",T:"Threonine"},d.AASmiles={G:"NCC(=O)O",L:"N[C@H](CC(C)C)C(=O)O",Y:"NC(CC1=CC=C(O)C=C1)C(=O)O",S:"NC(CO)C(=O)O",E:"N[C@@H](CCC(O)=O)C(=O)O",Q:"N[C@@H](CCC(N)=O)C(=O)O",D:"N[C@@H](CC(O)=O)C(=O)O",N:"N[C@@H](CC(N)=O)C(=O)O",F:"NC(CC1=CC=CC=C1)C(=O)O",A:"N[C@H](C)C(=O)O",K:"NC(CCCCN)C(=O)O",R:"N[C@H](CCCNC(=N)C)C(=O)O",H:"NC(CC1=CN=C[N]1)C(=O)O",C:"N[C@@H](CS)C(=O)O",V:"NC(C(C)C)C(=O)O",P:"N(CCC1)C1C(=O)O",W:"N[C@@H](Cc1c2ccccc2n([H])c1)C(=O)O",I:"N[C@H]([C@H](C)CC)C(=O)O",M:"NC(CCSC)C(=O)O",T:"NC(C(O)C)C(=O)O"},d.AASmilesTruncated={G:"*C*",L:"CC(C)C[C@H](*)*",Y:"C1=CC(=CC=C1CC(*)*)O",S:"OCC(*)C*",E:"*[C@@H](CCC(O)=O)*",Q:"*N[C@@H](CCC(N)=O)*",D:"*[C@@H](CC(O)=O)*",N:"*[C@@H](CC(N)=O)*",F:"C1=CC=C(C=C1)CC(*)*",A:"C[C@H](*)*",K:"C(CCN)CC(*)*",R:"*[C@H](CCCNC(=N)C)*",H:"C1=C(NC=N1)CC(*)*",C:"C([C@@H](*)*)S",V:"CC(C)C(*)*",P:"C1CCN(*)C1*",W:"*[C@@H](Cc1c2ccccc2n([H])c1)*",I:"CC[C@H](C)[C@H](*)*",M:"CSCCC(*)*",T:"CC(O)C(*)*"},d.AAFullNames={Ala:"A",Arg:"R",Asn:"N",Asp:"D",Cys:"C",Gln:"Q",Glu:"E",Gly:"G",His:"H",Ile:"I",Leu:"L",Lys:"K",Met:"M",Phe:"F",Pro:"P",Ser:"S",Thr:"T",Trp:"W",Tyr:"Y",Val:"V"};class m{}m.SemType="Nucleotides",m.SemTypeMultipleAlignment="NucleotidesMultipleAlignment",m.Names={A:"Adenine",C:"Cytosine",G:"Guanine",T:"Thymine",U:"Uracil"};class f{static hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}}class p{}class y extends p{static buildPalette(){return[].concat(...Object.values(u.colourPalette))}get(t){const e=f.hashCode(t)%y.palette.length;return function(t){if(null==t)return"rgb(100,100,100)";const e=r.Color.fromHtml(t),n=r.Color.g(e),i=r.Color.r(e),s=r.Color.b(e),o=Math.sqrt(Math.pow(0-i,2)+Math.pow(0-n,2)+Math.pow(0-s,2));return o>210?`rgb(${i/o*210},${n/o*210},${s/o*210})`:r.Color.toRgb(e)}(y.palette[e])}}y.palette=y.buildPalette();class C{get length(){return this.mList.length}get canonicals(){return this.mList}get originals(){return this.mList}isGap(t){return this.getOriginal(t)===this.gapOriginalMonomer}getCanonical(t){if(this.length<=t)throw new Error("Index out of bounds");return this.mList[t]}getOriginal(t){if(this.length<=t)throw new Error("Index out of bounds");return this.mList[t]}constructor(t,e){this.mList=t,this.gapOriginalMonomer=e}}class x{get length(){return this.seqS.length}get canonicals(){return this.seqS}get originals(){return this.seqS}isGap(t){return this.getOriginal(t)===h.oh[a.qD.FASTA]}getCanonical(t){if(this.length<=t)throw new Error("Index out of bounds");return this.isGap(t)?o.yK:this.seqS[t]}getOriginal(t){if(this.length<=t)throw new Error("Index out of bounds");return this.seqS[t]}constructor(t){this.seqS=t}}const b=t=>{const e=s()(t.toString().matchAll(a.eQ)).map((t=>t[2]??t[1])).toArray();return new C(e,h.oh[a.qD.FASTA])},w=t=>t?new x(t):new C([],h.oh[a.qD.FASTA]);function A(t,e=void 0){return n=>{if(n){let r;const i=new RegExp(String.raw`"-"|'-'|[^${t}]+`,"g");if(void 0!==e){i.lastIndex=0,r=new Array(e);let t=null,s=0;for(;null!==(t=i.exec(n))&&s<e;)r[s++]=t[0].replace('"-"',"").replace("'-'","");r.splice(s)}else r=n.replaceAll('"-"',"").replaceAll("'-'","").split(t,e);return new C(r,h.oh[a.qD.SEPARATOR])}return new C([],h.oh[a.qD.SEPARATOR])}}const _=/(PEPTIDE1|DNA1|RNA1)\{([^}]+)}/g,E=/\[([^\[\]]+)]/g,v=t=>{_.lastIndex=0;const e=_.exec(t.toString()),n=e?e[2]:null,r=n?n.split("."):[];return new C(r.map((t=>{E.lastIndex=0;const e=E.exec(t);return e&&e.length>=2?e[1]:t})),h.oh[a.qD.HELM])};function T(t,e,n="-"){const r=e.map((e=>{const r=function(t,e,n="-"){const r=new Set([...new Set(Object.keys(t)),...e]);r.delete(n);const i=[],s=[];for(const n of r)i.push(n in t?t[n]:0),s.push(e.has(n)?1:0);const o=new l(i),a=new l(s);return function(t,e){if(t.length!=e.length)throw new Error("The dimensionality of the vectors must match");let n=0;for(let r=0;r<t.length;r++)n+=t[r]*e[r];return n}(o,a)/(c(o)*c(a))}(t,e.alphabet,n);return new o.AD(e,t,r)}));let i;const s=Math.max(...r.map((t=>t.similarity>t.cutoff?t.similarity:-1)));return i=s>0?r.find((t=>t.similarity===s)).name:"UN",i}},688:(t,e,n)=>{"use strict";n.d(e,{YL:()=>m,oh:()=>d});var r=n(888),i=n(848),s=n.n(i),o=n(736),a=n(923),h=n(502),l=n(384),c=n(460),u=n(852);const g=new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},d={[o.qD.FASTA]:"-",[o.qD.SEPARATOR]:"",[o.qD.HELM]:"*"};class m{constructor(t){if(this._splitter=null,this.cached=!0,this._splitted=null,this.columnVersion=null,this._stats=null,this._maxLength=null,this._posList=null,this._joiner=void 0,t.type!==r.TYPE.STRING)throw new Error(`Unexpected column type '${t.type}', must be '${r.TYPE.STRING}'.`);this._column=t;const e=this._column.getTag(r.TAGS.UNITS);if(null==e)throw new Error("Units are not specified in column");if(this._units=e,this._notation=this.getNotation(),this._defaultGapOriginal=this.isFasta()?d[o.qD.FASTA]:this.isHelm()?d[o.qD.HELM]:d[o.qD.SEPARATOR],!this.column.tags.has("aligned")||!this.column.tags.has("alphabet")||!this.column.tags.has(".alphabetIsMultichar")&&!this.isHelm()&&"UN"===this.alphabet)if(this.isFasta())m.setUnitsToFastaColumn(this);else if(this.isSeparator()){const e=t.getTag("separator");m.setUnitsToSeparatorColumn(this,e)}else{if(!this.isHelm())throw new Error(`Unexpected units '${this.column.getTag(r.TAGS.UNITS)}'.`);m.setUnitsToHelmColumn(this)}if(!this.column.tags.has(".alphabetIsMultichar"))if(this.isHelm())this.column.setTag(".alphabetIsMultichar","true");else if(["UN"].includes(this.alphabet))throw new Error(`For column '${this.column.name}' of alphabet '${this.alphabet}' tag '.alphabetIsMultichar' is mandatory.`);this.notationProvider=this.column.temp[g.notationProvider]??null,this.columnVersion=this.column.version}static setUnitsToFastaColumn(t){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE||t.column.getTag(r.TAGS.UNITS)!==o.qD.FASTA)throw new Error(`The column of notation '${o.qD.FASTA}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);t.column.setTag(r.TAGS.UNITS,o.qD.FASTA),m.setTags(t)}static setUnitsToSeparatorColumn(t,e){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE||t.column.getTag(r.TAGS.UNITS)!==o.qD.SEPARATOR)throw new Error(`The column of notation '${o.qD.SEPARATOR}' must be '${r.SEMTYPE.MACROMOLECULE}'.`);if(!e)throw new Error(`The column of notation '${o.qD.SEPARATOR}' must have the separator tag.`);t.column.setTag(r.TAGS.UNITS,o.qD.SEPARATOR),t.column.setTag("separator",e),m.setTags(t)}static setUnitsToHelmColumn(t){if(t.column.semType!==r.SEMTYPE.MACROMOLECULE)throw new Error(`The column of notation '${o.qD.HELM}' must be '${r.SEMTYPE.MACROMOLECULE}'`);t.column.setTag(r.TAGS.UNITS,o.qD.HELM),m.setTags(t)}static setTags(t){const e=t.column.getTag(r.TAGS.UNITS),n=t.stats;if(Object.keys(n.freq).some((t=>t.length>1)),[o.qD.FASTA,o.qD.SEPARATOR].includes(e)){if(!t.column.getTag("alphabet")&&0===Object.keys(n.freq).length)throw new Error("Alphabet is empty and not annotated.");let e=t.column.getTag("aligned");null===e&&(e=n.sameLength?"SEQ.MSA":"SEQ",t.column.setTag("aligned",e));let r=t.column.getTag("alphabet");if(null===r&&(r=(0,h.o5)(n.freq,o.y6),t.column.setTag("alphabet",r)),"UN"===r){const e=Object.keys(n.freq).length,r=Object.keys(n.freq).some((t=>t.length>1));t.column.setTag(".alphabetSize",e.toString()),t.column.setTag(".alphabetIsMultichar",r?"true":"false")}}}get column(){return this._column}get length(){return this._column.length}get units(){return this._units}get notation(){return this._notation}get defaultGapOriginal(){return this._defaultGapOriginal}get separator(){const t=this.column.getTag("separator")??void 0;if(this.notation===o.qD.SEPARATOR&&void 0===t)throw new Error(`Separator is mandatory for column '${this.column.name}' of notation '${this.notation}'.`);return t}get aligned(){const t=this.column.getTag("aligned");if(!t&&(this.isFasta()||this.isSeparator()))throw new Error("Tag aligned not set");return t}get alphabet(){const t=this.column.getTag("alphabet");if(!t&&(this.isFasta()||this.isSeparator()))throw new Error("Tag alphabet not set");return t}get helmCompatible(){return this.column.getTag(".isHelmCompatible")}getAlphabetSize(){if(this.notation==o.qD.HELM||"UN"==this.alphabet){const t=this.column.getTag(".alphabetSize");let e;if(t)e=parseInt(t);else{const t=this.stats;e=Object.keys(t.freq).length}return e}switch(this.alphabet){case"PT":return 20;case"DNA":case"RNA":return 4;case"NT":return console.warn("Unexpected alphabet 'NT'."),4;default:throw new Error(`Unexpected alphabet '${this.alphabet}'.`)}}getAlphabetIsMultichar(){return this.notation===o.qD.HELM||"UN"===this.alphabet&&"true"===this.column.getTag(".alphabetIsMultichar")}getSplitted(t,e){if(this.cached&&void 0===e){this.column.version===this.columnVersion&&null!==this._splitted||(this.columnVersion=this.column.version,this._splitted=new Array(this.column.length));let e=this._splitted[t]?this._splitted[t].deref():void 0;if(!e){const n=this.column.get(t);e=this.splitter(n),this._splitted[t]=new WeakRef(e)}return e}{const n=this.column.get(t);return this.getSplitter(e)(n)}}get stats(){if(null===this._stats){const t={};let e=!0,n=null;const r=this.column.length;for(let i=0;i<r;++i){const r=this.getSplitted(i);null==n?n=r.length:r.length!==n&&(e=!1);for(const e of r.canonicals)e in t||(t[e]=0),t[e]+=1}this._stats={freq:t,sameLength:e}}return this._stats}get maxLength(){return null===this._maxLength&&(this._maxLength=0===this.column.length?0:Math.max(...s().count(0).take(this.column.length).map((t=>this.getSplitted(t).length)))),this._maxLength}get posList(){if(null===this._posList){const t=this.column.getTag(".positionNames");this._posList=t?t.split(o.YF).map((t=>t.trim())):s().count(1).take(this.maxLength).map((t=>t.toString())).toArray()}return this._posList}isFasta(){return this.notation===o.qD.FASTA}isSeparator(){return this.notation===o.qD.SEPARATOR}isHelm(){return this.notation===o.qD.HELM}isRna(){return"RNA"===this.alphabet}isDna(){return"DNA"===this.alphabet}isPeptide(){return"PT"===this.alphabet}isMsa(){return!!this.aligned&&this.aligned.toUpperCase().includes("MSA")}isHelmCompatible(){return"true"===this.helmCompatible}isGap(t){return!t||t===this._defaultGapOriginal}getNotation(){if(this.units.toLowerCase().startsWith(o.qD.FASTA))return o.qD.FASTA;if(this.units.toLowerCase().startsWith(o.qD.SEPARATOR))return o.qD.SEPARATOR;if(this.units.toLowerCase().startsWith(o.qD.HELM))return o.qD.HELM;throw new Error(`Column '${this.column.name}' has unexpected notation '${this.units}'.`)}getHelmWrappers(){return[this.isDna()||this.isRna()||this.isHelmCompatible()?"RNA1{":"PEPTIDE1{",this.isDna()?"d(":this.isRna()?"r(":"",this.isDna()||this.isRna()?")p":"","}$$$$"]}getNewColumn(t,e,n,i){const s=this.column,a=t.toLowerCase()+"("+s.name+")",h=n??s.dataFrame.columns.getUnusedName(a),l=r.Column.fromList("string",h,i??new Array(this.column.length).fill(""));if(l.semType=r.SEMTYPE.MACROMOLECULE,l.setTag(r.TAGS.UNITS,t),t===o.qD.SEPARATOR){if(!e)throw new Error(`Notation '${o.qD.SEPARATOR}' requires separator value.`);l.setTag("separator",e)}l.setTag(r.TAGS.CELL_RENDERER,"sequence");const c=s.getTag("aligned");c&&l.setTag("aligned",c);let u=s.getTag("alphabet");u||this.notation!==o.qD.HELM||t===o.qD.HELM||(u="UN"),null!=u&&l.setTag("alphabet",u);let g=s.getTag(".alphabetSize");null!=u&&g&&l.setTag(".alphabetSize",g);const d=s.getTag(".alphabetIsMultichar");return null!=u&&void 0!==d&&l.setTag(".alphabetIsMultichar",d),t==o.qD.HELM&&(g=this.getAlphabetSize().toString(),l.setTag(".alphabetSize",g)),l}getNewColumnFromList(t,e){return this.getNewColumn(this.notation,this.separator,t,e)}static getNewColumn(t){const e=m.forColumn(t),n=e.notation;return e.getNewColumn(n)}static unitsStringIsValid(t){return t=t.toLowerCase(),[o.qD.FASTA,o.qD.SEPARATOR,o.qD.HELM].some((e=>t.startsWith(e.toLowerCase())))}static getNewColumnFromParams(t,e,n){if(!m.unitsStringIsValid(n))throw new Error("Invalid format of 'units' parameter");const i=r.Column.fromList("string",e,new Array(t).fill(""));return i.semType=r.SEMTYPE.MACROMOLECULE,i.setTag(r.TAGS.UNITS,n),i}getSplitter(t){let e=null;if(e=this.notationProvider?this.notationProvider.splitter:null,e)return e;if(this.units.toLowerCase().startsWith(o.qD.FASTA))return null===this.column.getTag("alphabet")||this.getAlphabetIsMultichar()?o.oB:h.lh;if(this.units.toLowerCase().startsWith(o.qD.SEPARATOR))return(0,o.gX)(this.separator,t);if(this.units.toLowerCase().startsWith(o.qD.HELM))return o.g9;throw new Error(`Unexpected units ${this.units} .`)}split(t){return this.splitter(t)}getDistanceFunctionName(){if(!this.isFasta())throw new Error("Only FASTA notation is supported");return this.isMsa()?l.Y.HAMMING:(this.alphabet,l.Y.LEVENSHTEIN)}getDistanceFunction(){return l.S[this.getDistanceFunctionName()]()}async checkHelmCompatibility(){if(this.column.tags.has(".isHelmCompatible"))return"true"===this.column.getTag(".isHelmCompatible");const t=(await(0,c.wW)()).getBioLib().getMonomerSymbolsByType("PEPTIDE"),e=new Set(t),n=((0,o.gX)(this.separator),new Set),r=this.column.length,i=this.column.getRawData();for(let t=0;t<r;++t){const r=i[t];if(!(r in n)){n.add(r);const i=this.getSplitted(t);for(const t of i.canonicals)if(!e.has(t))return this.column.setTag(".isHelmCompatible","false"),!1}}return this.column.setTag(".isHelmCompatible","true"),!0}get splitter(){return null===this._splitter&&(this._splitter=this.getSplitter()),this._splitter}toFasta(t){return t===o.qD.FASTA}toSeparator(t){return t===o.qD.SEPARATOR}toHelm(t){return t===o.qD.HELM}convertHelmToFastaSeparator(t,e,n,r){r||(r=this.toFasta(e)?d[o.qD.FASTA]:d[o.qD.SEPARATOR]),n||(n=this.toFasta(e)?"":this.separator);const i=t.startsWith("RNA"),s=this.splitter(t),a=[];for(let t=0;t<s.length;++t){let n=s.getOriginal(t);if(i&&(n=n.replace(u.cT,"")),n===d[o.qD.HELM])a.push(r);else if(this.toFasta(e)&&n.length>1){const t="["+n+"]";a.push(t)}else a.push(n)}return a.join(n)}convert(t,e){const n=this.getJoiner({notation:t,separator:e}),r=this.getNewColumn(t,e);return r.init((t=>{const e=this.getSplitted(t);return n(e)})),r}getRegion(t,e,n){const r=this.getNewColumn(this.notation,this.separator);r.name=n;const i=t??0,s=e??this.maxLength-1,a=this.getJoiner(),l=s-i+1,c=d[this.notation];r.init((t=>{const e=this.getSplitted(t),n=new Array(l);for(let t=0;t<l;++t){const r=i+t;n[t]=r<e.length?e.getOriginal(r):c}return a(new h.Mx(n,c))}));const u=t=>{const e=t.split(",").map((t=>t.trim())),n=new Array(l);for(let t=0;t<l;++t){const r=i+t;n[t]=r<e.length?e[r]:"?"}return n.join(o.YF)},g=this.column.getTag(".positionNames");g&&r.setTag(".positionNames",u(g));const m=this.column.getTag(".positionLabels");return m&&r.setTag(".positionLabels",u(m)),r}get joiner(){return this._joiner||(this._joiner=this.getJoiner()),this._joiner}getJoiner(t){const e=t?t.notation:this.notation,n=t?t.separator:this.separator;let r;const i=this;switch(e){case o.qD.FASTA:r=function(t){return i.joinToFasta(t,i.isHelm())};break;case o.qD.SEPARATOR:if(!n)throw new Error(`Separator is mandatory for notation '${e}'.`);r=function(t){return f(t,n,i.isHelm())};break;case o.qD.HELM:{const t="DNA"===i.alphabet||"RNA"===i.alphabet,e=i.getHelmWrappers();r=function(n){return p(n,e,t)};break}default:throw new Error(`Unexpected notation '${e}'.`)}return r}getConverter(t,e=void 0){if(t===o.qD.SEPARATOR&&!e)throw new Error(`Target separator is not specified for target units '${o.qD.SEPARATOR}'.`);const n=this;if(t===o.qD.FASTA)return function(t){return n.convertToFasta(t)};if(t===o.qD.HELM)return function(t){return n.convertToHelm(t)};if(t===o.qD.SEPARATOR)return function(t){return n.convertToSeparator(t,e)};throw new Error}static forColumn(t){let e=t.temp[g.seqHandler];return e&&e.columnVersion===t.version||(e=t.temp[g.seqHandler]=new m(t)),e}joinToFasta(t,e){const n=new Array(t.length);for(let r=0;r<t.length;++r){const i=t.getOriginal(r);let s=t.getOriginal(r);e&&(s=s.replace(u.cT,"$1")),i===a.yK?s=d[o.qD.FASTA]:i===u.E1?s="":s.length>1&&(s="["+s+"]"),n[r]=s}return n.join("")}convertToFasta(t){const e=this.splitter,n=this.isHelm()?this.splitterAsHelmNucl(t):e(t);return this.joinToFasta(n,this.isHelm())}convertToSeparator(t,e){return f(this.isHelm()?this.splitterAsHelmNucl(t):this.splitter(t),e,this.isHelm())}convertToHelm(t){const e=this.getHelmWrappers(),n=t.startsWith("DNA")||t.startsWith("RNA");return p(this.splitter(t),e,n)}splitterAsHelmNucl(t){const e=this.splitter(t),n=new Array(e.length),r=t.startsWith("DNA"),i=t.startsWith("RNA");for(let t=0;t<e.length;++t){let s=e.getOriginal(t);(r||i)&&(s=s.replace(u.cT,"$1"),s=s===u.E1?null:s),n[t]=s||null}return new h.Mx(n.filter((t=>!!t)),d[o.qD.HELM])}}function f(t,e,n){const r=new Array(t.length);for(let e=0;e<t.length;++e){const i=t.getCanonical(e);let s=t.getOriginal(e);n&&(s=s.replace(u.cT,"$1")),i===a.yK?s=d[o.qD.SEPARATOR]:i===u.E1&&(s=""),r[e]=s}return r.join(e)}function p(t,e,n){const[r,i,s,h]=e,l=new Array(t.length);for(let e=0;e<t.length;++e){const r=t.getCanonical(e);let h=t.getOriginal(e);r===a.yK?h=d[o.qD.HELM]:(n&&(h=h.replace(u.cT,"$1")),h=1===h.length?`${i}${h}${s}`:`${i}[${h}]${s}`),l[e]=h}return`${r}${l.join(".")}${h}`}},824:(t,e,n)=>{"use strict";n.d(e,{Cu:()=>s,st:()=>i}),n(888);var r=n(248);class i extends r._m{constructor(t,e,n,r){super(e,n,r),this.helm=t}}class s extends r.y4{}},384:(t,e,n)=>{"use strict";function r(t={}){const e=function(){if(!t||!t.scoringMatrix||!t.alphabetIndexes)return(t,e)=>t===e?0:1;if(t.scoringMatrix.length!==Object.keys(t.alphabetIndexes).length)throw new Error("Scoring matrix and alphabet indexes should have the same length");const e=t.alphabetIndexes,n=t.scoringMatrix,r=Math.min(...Object.keys(e).map((t=>t.charCodeAt(0))))+1,i=new Float32Array((n.length+r)*(n.length+r));return Object.entries(e).forEach((([t,r])=>{const s=n[r];Object.entries(e).forEach((([e,r])=>{i[t.charCodeAt(0)*n.length+e.charCodeAt(0)]=s[r]}))})),(t,e)=>1-i[t.charCodeAt(0)*n.length+e.charCodeAt(0)]}(),n=t?.threshold??0;return(t,r)=>{let i=0;const s=t.length,o=r.length,a=Math.ceil(Math.max(s,o)*(1-n));s!==o&&(i=Math.abs(s-o));let h=0;for(let n=0;n<Math.min(s,o);n++)if(t[n]!==r[n]&&(h+=e(t[n],r[n]),h>a))return 1;return h+=i,h/=Math.max(s,o),h}}n.d(e,{Y:()=>o,S:()=>a});const i=new Uint32Array(65536),s={gapOpen:1,gapExtend:.6,scoringMatrix:[[4,-1,-2,-2,0,-1,-1,0,-2,-1,-1,-1,-1,-2,-1,1,0,-3,-2,0,-2,-1,0,-4],[-1,5,0,-2,-3,1,0,-2,0,-3,-2,2,-1,-3,-2,-1,-1,-3,-2,-3,-1,0,-1,-4],[-2,0,6,1,-3,0,0,0,1,-3,-3,0,-2,-3,-2,1,0,-4,-2,-3,3,0,-1,-4],[-2,-2,1,6,-3,0,2,-1,-1,-3,-4,-1,-3,-3,-1,0,-1,-4,-3,-3,4,1,-1,-4],[0,-3,-3,-3,9,-3,-4,-3,-3,-1,-1,-3,-1,-2,-3,-1,-1,-2,-2,-1,-3,-3,-2,-4],[-1,1,0,0,-3,5,2,-2,0,-3,-2,1,0,-3,-1,0,-1,-2,-1,-2,0,3,-1,-4],[-1,0,0,2,-4,2,5,-2,0,-3,-3,1,-2,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-2,0,-1,-3,-2,-2,6,-2,-4,-4,-2,-3,-3,-2,0,-2,-2,-3,-3,-1,-2,-1,-4],[-2,0,1,-1,-3,0,0,-2,8,-3,-3,-1,-2,-1,-2,-1,-2,-2,2,-3,0,0,-1,-4],[-1,-3,-3,-3,-1,-3,-3,-4,-3,4,2,-3,1,0,-3,-2,-1,-3,-1,3,-3,-3,-1,-4],[-1,-2,-3,-4,-1,-2,-3,-4,-3,2,4,-2,2,0,-3,-2,-1,-2,-1,1,-4,-3,-1,-4],[-1,2,0,-1,-3,1,1,-2,-1,-3,-2,5,-1,-3,-1,0,-1,-3,-2,-2,0,1,-1,-4],[-1,-1,-2,-3,-1,0,-2,-3,-2,1,2,-1,5,0,-2,-1,-1,-1,-1,1,-3,-1,-1,-4],[-2,-3,-3,-3,-2,-3,-3,-3,-1,0,0,-3,0,6,-4,-2,-2,1,3,-1,-3,-3,-1,-4],[-1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4,7,-1,-1,-4,-3,-2,-2,-1,-2,-4],[1,-1,1,0,-1,0,0,0,-1,-2,-2,0,-1,-2,-1,4,1,-3,-2,-2,0,0,0,-4],[0,-1,0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1,1,5,-2,-2,0,-1,-1,0,-4],[-3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1,1,-4,-3,-2,11,2,-3,-4,-3,-2,-4],[-2,-2,-2,-3,-2,-1,-2,-3,2,-1,-1,-2,-1,3,-3,-2,-2,2,7,-1,-3,-2,-1,-4],[0,-3,-3,-3,-1,-2,-2,-3,-3,3,1,-2,1,-1,-2,-2,0,-3,-1,4,-3,-2,-1,-4],[-2,-1,3,4,-3,0,1,-1,0,-3,-4,0,-3,-3,-2,0,-1,-4,-3,-3,4,1,-1,-4],[-1,0,0,1,-3,3,4,-2,0,-3,-3,1,-1,-3,-1,0,-1,-3,-2,-2,1,4,-1,-4],[0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2,0,0,-2,-1,-1,-1,-1,-1,-4],[-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,-4,1]],alphabetIndexes:{A:0,R:1,N:2,D:3,C:4,Q:5,E:6,G:7,H:8,I:9,L:10,K:11,M:12,F:13,P:14,S:15,T:16,W:17,Y:18,V:19,B:20,Z:21,X:22,"*":23}};var o;!function(t){t.HAMMING="Hamming",t.LEVENSHTEIN="Levenshtein",t.NEEDLEMANN_WUNSCH="Needlemann-Wunsch",t.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance"}(o||(o={}));const a={[o.HAMMING]:r,[o.LEVENSHTEIN]:function(){return(t,e)=>((t,e)=>{if(t.length<e.length){const n=e;e=t,t=n}return 0===e.length?t.length:t.length<=32?((t,e)=>{const n=t.length,r=e.length,s=1<<n-1;let o=-1,a=0,h=n,l=n;for(;l--;)i[t.charCodeAt(l)]|=1<<l;for(l=0;l<r;l++){let t=i[e.charCodeAt(l)];const n=t|a;t|=(t&o)+o^o,a|=~(t|o),o&=t,a&s&&h++,o&s&&h--,a=a<<1|1,o=o<<1|~(n|a),a&=n}for(l=n;l--;)i[t.charCodeAt(l)]=0;return h})(t,e):((t,e)=>{const n=e.length,r=t.length,s=[],o=[],a=Math.ceil(n/32),h=Math.ceil(r/32);for(let t=0;t<a;t++)o[t]=-1,s[t]=0;let l=0;for(;l<h-1;l++){let a=0,h=-1;const c=32*l,u=Math.min(32,r)+c;for(let e=c;e<u;e++)i[t.charCodeAt(e)]|=1<<e;for(let t=0;t<n;t++){const n=i[e.charCodeAt(t)],r=o[t/32|0]>>>t&1,l=s[t/32|0]>>>t&1,c=n|a,u=((n|l)&h)+h^h|n|l;let g=a|~(u|h),d=h&u;g>>>31^r&&(o[t/32|0]^=1<<t),d>>>31^l&&(s[t/32|0]^=1<<t),g=g<<1|r,d=d<<1|l,h=d|~(c|g),a=g&c}for(let e=c;e<u;e++)i[t.charCodeAt(e)]=0}let c=0,u=-1;const g=32*l,d=Math.min(32,r-g)+g;for(let e=g;e<d;e++)i[t.charCodeAt(e)]|=1<<e;let m=r;for(let t=0;t<n;t++){const n=i[e.charCodeAt(t)],a=o[t/32|0]>>>t&1,h=s[t/32|0]>>>t&1,l=n|c,g=((n|h)&u)+u^u|n|h;let d=c|~(g|u),f=u&g;m+=d>>>r-1&1,m-=f>>>r-1&1,d>>>31^a&&(o[t/32|0]^=1<<t),f>>>31^h&&(s[t/32|0]^=1<<t),d=d<<1|a,f=f<<1|h,u=f|~(l|d),c=d&l}for(let e=g;e<d;e++)i[t.charCodeAt(e)]=0;return m})(t,e)})(t,e)/Math.max(t.length,e.length)},[o.NEEDLEMANN_WUNSCH]:function(t){const e=new Uint16Array(65536),{gapOpen:n,gapExtend:r,scoringMatrix:i,alphabetIndexes:o}={...s,...t};Object.entries(o).forEach((([t,n])=>e[t.charCodeAt(0)]=n));const a=[new Float32Array(1e4),new Float32Array(1e4)];return(t,s)=>{const o=new Array(t.length+1).fill(!1),h=new Array(t.length+1).fill(!1);let l=0,c=1;for(let e=1;e<t.length+1;e++)a[0][e]=-n-(e-1)*r,a[1][e]=0;a[0][0]=0;for(let u=1;u<s.length+1;u++){a[c][0]=-n-(u-1)*r;for(let g=1;g<t.length+1;g++){const d=a[l][g-1]+i[e[t.charCodeAt(g-1)]][e[s.charCodeAt(u-1)]],m=a[l][g]-(o[g]?r:n),f=a[c][g-1]-(h[g-1]?r:n);a[c][g]=Math.max(d,f,m),a[c][g]===d?(o[g]=!1,h[g]=!1):a[c][g]===f?(o[g]=!1,h[g]=!0):(o[g]=!0,h[g]=!1)}l=c,c=(c+1)%2}const u=Math.max(t.length,s.length);return(u-a[l][t.length])/u}},[o.MONOMER_CHEMICAL_DISTANCE]:r}},272:(t,e,n)=>{"use strict";n.d(e,{SG:()=>o}),n(200);var r=n(888);n(8),r.DataFrame.fromCsv('countries,fasta,smiles,molregno,LON,Zip Code,Street Address Line 1,ImageUrl,user_id,error_message,xray,flag,magnitude,CS-id,pdb_id,accel_a,time_offset,chart,fit,Questions,empty_number,empty_string\nBelgium,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C(=O)OCCCc1cccnc1)c2cccc(c2)C(=O)c3ccccc3,1480014,36.276729583740234,995042300,14016 ROUTE 31W,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,1,1,1QBS,1,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.497360340644872, 1.7058694986686864, 5.278052678195135, 0.16000320889028383],""points"":[{""x"":0.10000000149011612,""y"":2.374499797821045},{""x"":0.6000000238418579,""y"":2.6242473125457764},{""x"":1.100000023841858,""y"":2.367267608642578},{""x"":1.600000023841858,""y"":2.6723148822784424},{""x"":2.0999999046325684,""y"":2.6537344455718994},{""x"":2.5999999046325684,""y"":2.3651671409606934},{""x"":3.0999999046325684,""y"":2.5654284954071045},{""x"":3.5999999046325684,""y"":2.4160959720611572},{""x"":4.099999904632568,""y"":2.286726713180542},{""x"":4.599999904632568,""y"":2.5100042819976807},{""x"":5.099999904632568,""y"":1.6676985025405884},{""x"":5.599999904632568,""y"":0.680136501789093},{""x"":6.099999904632568,""y"":0.3391543924808502},{""x"":6.599999904632568,""y"":0.09038983285427094},{""x"":7.099999904632568,""y"":0.19802775979042053}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[7.525235855508179, 1.3186911876809984, 5.335672608564294, 0.7860743343958098],""points"":[{""x"":0.10000000149011612,""y"":7.988070487976074},{""x"":0.6000000238418579,""y"":7.018453121185303},{""x"":1.100000023841858,""y"":8.115279197692871},{""x"":1.600000023841858,""y"":7.486658096313477},{""x"":2.0999999046325684,""y"":7.396438121795654},{""x"":2.5999999046325684,""y"":7.477052211761475},{""x"":3.0999999046325684,""y"":6.913095474243164},{""x"":3.5999999046325684,""y"":8.01385498046875},{""x"":4.099999904632568,""y"":6.985900402069092},{""x"":4.599999904632568,""y"":6.970335960388184},{""x"":5.099999904632568,""y"":5.448817253112793},{""x"":5.599999904632568,""y"":2.5534818172454834},{""x"":6.099999904632568,""y"":1.893947958946228},{""x"":6.599999904632568,""y"":0.6340042352676392},{""x"":7.099999904632568,""y"":0.8403874039649963}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,100,abc\nBurundi,MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW,COc1ccc2cc(ccc2c1)C(C)C(=O)Oc3ccc(C)cc3OC,1480015,36.276729583740234,995073444,80 STATE HIGHWAY 310,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,2,2,1ZP8,2,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.431460753103398, 2.1691498799246745, 5.266445597102774, 0.7825762827017926],""points"":[{""x"":0.10000000149011612,""y"":4.751083850860596},{""x"":0.6000000238418579,""y"":4.203000068664551},{""x"":1.100000023841858,""y"":4.415858745574951},{""x"":1.600000023841858,""y"":4.68414306640625},{""x"":2.0999999046325684,""y"":4.198400974273682},{""x"":2.5999999046325684,""y"":4.179222106933594},{""x"":3.0999999046325684,""y"":4.638473987579346},{""x"":3.5999999046325684,""y"":4.708553314208984},{""x"":4.099999904632568,""y"":4.291589260101318},{""x"":4.599999904632568,""y"":4.038082599639893},{""x"":5.099999904632568,""y"":3.4349939823150635},{""x"":5.599999904632568,""y"":1.2194708585739136},{""x"":6.099999904632568,""y"":1.1920831203460693},{""x"":6.599999904632568,""y"":0.5352635979652405},{""x"":7.099999904632568,""y"":0.3346920311450958}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.339458017970126, -1.0734184310171178, 4.746332950550934, 0.2482416857595658],""points"":[{""x"":0.10000000149011612,""y"":0.2139337658882141},{""x"":0.6000000238418579,""y"":0.4269562065601349},{""x"":1.100000023841858,""y"":0.2441573292016983},{""x"":1.600000023841858,""y"":0.146635964512825},{""x"":2.0999999046325684,""y"":0.08818462491035461},{""x"":2.5999999046325684,""y"":0.2560656666755676},{""x"":3.0999999046325684,""y"":0.42434045672416687},{""x"":3.5999999046325684,""y"":0.37111231684684753},{""x"":4.099999904632568,""y"":0.5581737160682678},{""x"":4.599999904632568,""y"":1.183590054512024},{""x"":5.099999904632568,""y"":1.5629843473434448},{""x"":5.599999904632568,""y"":2.3211288452148438},{""x"":6.099999904632568,""y"":2.229961633682251},{""x"":6.599999904632568,""y"":2.2560226917266846},{""x"":7.099999904632568,""y"":2.2142398357391357}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCameroon,MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL,COc1ccc2cc(ccc2c1)C(C)C(=O)OCCCc3cccnc3,1480016,36.26095962524414,995153596,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,3,3,2BDJ,3,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[4.6760652578642325, 0.9046956320756703, 5.651408971856738, 0.07738846012184185],""points"":[{""x"":0.10000000149011612,""y"":4.32425594329834},{""x"":0.6000000238418579,""y"":4.668442249298096},{""x"":1.100000023841858,""y"":4.379785060882568},{""x"":1.600000023841858,""y"":5.0345139503479},{""x"":2.0999999046325684,""y"":4.878653526306152},{""x"":2.5999999046325684,""y"":4.3451313972473145},{""x"":3.0999999046325684,""y"":4.336992263793945},{""x"":3.5999999046325684,""y"":5.037430286407471},{""x"":4.099999904632568,""y"":5.0092692375183105},{""x"":4.599999904632568,""y"":4.151902675628662},{""x"":5.099999904632568,""y"":3.4066951274871826},{""x"":5.599999904632568,""y"":2.3732759952545166},{""x"":6.099999904632568,""y"":1.673728108406067},{""x"":6.599999904632568,""y"":0.48574790358543396},{""x"":7.099999904632568,""y"":0.2783052325248718}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[2.938395863010111, -1.4658480661392117, 5.462702751996584, 0.3473139023615039],""points"":[{""x"":0.10000000149011612,""y"":0.4941710829734802},{""x"":0.6000000238418579,""y"":0.15323974192142487},{""x"":1.100000023841858,""y"":0.46373432874679565},{""x"":1.600000023841858,""y"":0.3370431363582611},{""x"":2.0999999046325684,""y"":0.5179030299186707},{""x"":2.5999999046325684,""y"":0.27899765968322754},{""x"":3.0999999046325684,""y"":0.22075064480304718},{""x"":3.5999999046325684,""y"":0.5789918899536133},{""x"":4.099999904632568,""y"":0.21169911324977875},{""x"":4.599999904632568,""y"":0.27857646346092224},{""x"":5.099999904632568,""y"":1.0906332731246948},{""x"":5.599999904632568,""y"":1.8520300388336182},{""x"":6.099999904632568,""y"":2.7177059650421143},{""x"":6.599999904632568,""y"":2.8680918216705322},{""x"":7.099999904632568,""y"":3.2413077354431152}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCanada,MMELVLKTIIGPIVVGVVLRIVDKWLNKDK,CC(C(=O)NCCS)c1cccc(c1)C(=O)c2ccccc2,1480017,36.26095962524414,99515,30-56 WHITESTONE EXPY,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,4,4,1IAN,4,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[0.8597390975430008, 1.0957625732481946, 5.260537067987958, 0.07974187998177736],""points"":[{""x"":0.10000000149011612,""y"":0.8190152645111084},{""x"":0.6000000238418579,""y"":0.8421689867973328},{""x"":1.100000023841858,""y"":0.8740922212600708},{""x"":1.600000023841858,""y"":0.8924275040626526},{""x"":2.0999999046325684,""y"":0.8249067664146423},{""x"":2.5999999046325684,""y"":0.9327669143676758},{""x"":3.0999999046325684,""y"":0.8522974252700806},{""x"":3.5999999046325684,""y"":0.8174492716789246},{""x"":4.099999904632568,""y"":0.8394647240638733},{""x"":4.599999904632568,""y"":0.7139387726783752},{""x"":5.099999904632568,""y"":0.5561167597770691},{""x"":5.599999904632568,""y"":0.3276226818561554},{""x"":6.099999904632568,""y"":0.12479474395513535},{""x"":6.599999904632568,""y"":0.13006797432899475},{""x"":7.099999904632568,""y"":0.059702079743146896}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.760930219582546, 1.6591793293833013, 4.667155929720851, 0.7858109544121652],""points"":[{""x"":0.10000000149011612,""y"":6.156993389129639},{""x"":0.6000000238418579,""y"":5.236701965332031},{""x"":1.100000023841858,""y"":6.010560512542725},{""x"":1.600000023841858,""y"":5.495512962341309},{""x"":2.0999999046325684,""y"":6.087770462036133},{""x"":2.5999999046325684,""y"":5.79986572265625},{""x"":3.0999999046325684,""y"":5.597546577453613},{""x"":3.5999999046325684,""y"":5.520902156829834},{""x"":4.099999904632568,""y"":5.360654354095459},{""x"":4.599999904632568,""y"":3.5539746284484863},{""x"":5.099999904632568,""y"":1.577236294746399},{""x"":5.599999904632568,""y"":1.0001264810562134},{""x"":6.099999904632568,""y"":0.9305797815322876},{""x"":6.599999904632568,""y"":0.6033638715744019},{""x"":7.099999904632568,""y"":0.4203685522079468}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nColombia,MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN,FC(F)(F)c1ccc(OC2CCNCC2)cc1,1480029,36.3309440612793,995152050,1 COURT HOUSE SQUARE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,5,5,4UJ1,5,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[6.4995088314153655, 2.4270351004539914, 5.178659535348579, 0.625653346241577],""points"":[{""x"":0.10000000149011612,""y"":6.496231555938721},{""x"":0.6000000238418579,""y"":6.42543363571167},{""x"":1.100000023841858,""y"":7.040063858032227},{""x"":1.600000023841858,""y"":6.1115403175354},{""x"":2.0999999046325684,""y"":6.680728435516357},{""x"":2.5999999046325684,""y"":6.406774520874023},{""x"":3.0999999046325684,""y"":6.611269474029541},{""x"":3.5999999046325684,""y"":5.889094352722168},{""x"":4.099999904632568,""y"":6.75344705581665},{""x"":4.599999904632568,""y"":6.361435890197754},{""x"":5.099999904632568,""y"":4.1666975021362305},{""x"":5.599999904632568,""y"":1.172118902206421},{""x"":6.099999904632568,""y"":0.801048994064331},{""x"":6.599999904632568,""y"":0.4640021026134491},{""x"":7.099999904632568,""y"":0.0010357667924836278}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[1.4734381347446401, 1.1649805188074196, 4.82958608866421, 0.09500545496710007],""points"":[{""x"":0.10000000149011612,""y"":1.5279096364974976},{""x"":0.6000000238418579,""y"":1.3559974431991577},{""x"":1.100000023841858,""y"":1.5246378183364868},{""x"":1.600000023841858,""y"":1.5567657947540283},{""x"":2.0999999046325684,""y"":1.4114240407943726},{""x"":2.5999999046325684,""y"":1.4045010805130005},{""x"":3.0999999046325684,""y"":1.4769829511642456},{""x"":3.5999999046325684,""y"":1.4875500202178955},{""x"":4.099999904632568,""y"":1.2991987466812134},{""x"":4.599999904632568,""y"":0.922961413860321},{""x"":5.099999904632568,""y"":0.6520044803619385},{""x"":5.599999904632568,""y"":0.15350978076457977},{""x"":6.099999904632568,""y"":0.1078903079032898},{""x"":6.599999904632568,""y"":0.17276449501514435},{""x"":7.099999904632568,""y"":0.14066608250141144}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCosta Rica,MKSTKEEIQTIKTLLKDSRTAKYHKRLQIVL,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCCc3ccccc3,1480018,36.3309440612793,995084218,4041 SOUTHWESTERN BLVD,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,6,6,2BPW,6,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.4833641843311227, -1.8945978742090062, 4.671127708092568, 0.24159861311815153],""points"":[{""x"":0.10000000149011612,""y"":0.0969524160027504},{""x"":0.6000000238418579,""y"":0.028483040630817413},{""x"":1.100000023841858,""y"":0.22087176144123077},{""x"":1.600000023841858,""y"":0.0068915546871721745},{""x"":2.0999999046325684,""y"":0.4305879771709442},{""x"":2.5999999046325684,""y"":0.44774115085601807},{""x"":3.0999999046325684,""y"":0.45346319675445557},{""x"":3.5999999046325684,""y"":0.2370593100786209},{""x"":4.099999904632568,""y"":0.4657953977584839},{""x"":4.599999904632568,""y"":1.155200719833374},{""x"":5.099999904632568,""y"":2.2294070720672607},{""x"":5.599999904632568,""y"":2.4311530590057373},{""x"":6.099999904632568,""y"":2.33846116065979},{""x"":6.599999904632568,""y"":2.608201026916504},{""x"":7.099999904632568,""y"":2.8136143684387207}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.224573521642033, 1.4454033924198528, 5.6014197746076535, 0.2823216054197577],""points"":[{""x"":0.10000000149011612,""y"":4.95027494430542},{""x"":0.6000000238418579,""y"":5.1754679679870605},{""x"":1.100000023841858,""y"":5.276752948760986},{""x"":1.600000023841858,""y"":5.589294910430908},{""x"":2.0999999046325684,""y"":5.616994857788086},{""x"":2.5999999046325684,""y"":5.120813846588135},{""x"":3.0999999046325684,""y"":5.340766906738281},{""x"":3.5999999046325684,""y"":4.876471042633057},{""x"":4.099999904632568,""y"":4.94999361038208},{""x"":4.599999904632568,""y"":5.162564754486084},{""x"":5.099999904632568,""y"":4.399557590484619},{""x"":5.599999904632568,""y"":2.7977969646453857},{""x"":6.099999904632568,""y"":1.0229872465133667},{""x"":6.599999904632568,""y"":0.48275601863861084},{""x"":7.099999904632568,""y"":0.10408931970596313}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nCuba,MHAILRYFIRRLFYHIFYKIYSLISKKHQSLPSDVRQF,COc1ccc2c(c1)c(CC(=O)N3CCCC3C(=O)Oc4ccc(C)cc4OC)c(C)n2C(=O)c5ccc(Cl)cc5,1480019,36.33115768432617,995081928,1227 US HIGHWAY 11,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,7,7,1QBS,7,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.320838679713925, -1.2421619987316728, 4.831325425225256, 0.3236011098403072],""points"":[{""x"":0.10000000149011612,""y"":0.3727470338344574},{""x"":0.6000000238418579,""y"":0.12365014106035233},{""x"":1.100000023841858,""y"":0.48422467708587646},{""x"":1.600000023841858,""y"":0.2264465093612671},{""x"":2.0999999046325684,""y"":0.16821794211864471},{""x"":2.5999999046325684,""y"":0.3879014551639557},{""x"":3.0999999046325684,""y"":0.5470244884490967},{""x"":3.5999999046325684,""y"":0.3419053554534912},{""x"":4.099999904632568,""y"":0.7655120491981506},{""x"":4.599999904632568,""y"":1.2346516847610474},{""x"":5.099999904632568,""y"":2.453336715698242},{""x"":5.599999904632568,""y"":2.9565491676330566},{""x"":6.099999904632568,""y"":3.335299491882324},{""x"":6.599999904632568,""y"":3.240290880203247},{""x"":7.099999904632568,""y"":3.1107218265533447}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.6401853521511094, 1.26211588875013, 5.399028074402744, 0.5089580830068091],""points"":[{""x"":0.10000000149011612,""y"":3.8585598468780518},{""x"":0.6000000238418579,""y"":3.6077206134796143},{""x"":1.100000023841858,""y"":3.855252265930176},{""x"":1.600000023841858,""y"":3.619039297103882},{""x"":2.0999999046325684,""y"":3.839388370513916},{""x"":2.5999999046325684,""y"":3.335283041000366},{""x"":3.0999999046325684,""y"":3.571141481399536},{""x"":3.5999999046325684,""y"":3.4155046939849854},{""x"":4.099999904632568,""y"":3.7316646575927734},{""x"":4.599999904632568,""y"":3.0680155754089355},{""x"":5.099999904632568,""y"":2.891066551208496},{""x"":5.599999904632568,""y"":1.6022753715515137},{""x"":6.099999904632568,""y"":0.7652576565742493},{""x"":6.599999904632568,""y"":0.6875326037406921},{""x"":7.099999904632568,""y"":0.5828871726989746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nItaly,MSNFHNEHVMQFYRNNLKTKGVFGRQ,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO[N+](=O)[O-],1480020,36.33115768432617,99502,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,8,8,1ZP8,8,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[2.293592105923809, 1.3781586549141835, 5.1025898038676605, 0.03493851245291291],""points"":[{""x"":0.10000000149011612,""y"":2.1287283897399902},{""x"":0.6000000238418579,""y"":2.267972230911255},{""x"":1.100000023841858,""y"":2.398442506790161},{""x"":1.600000023841858,""y"":2.5130622386932373},{""x"":2.0999999046325684,""y"":2.3255116939544678},{""x"":2.5999999046325684,""y"":2.127340793609619},{""x"":3.0999999046325684,""y"":2.47259783744812},{""x"":3.5999999046325684,""y"":2.131181478500366},{""x"":4.099999904632568,""y"":2.090421438217163},{""x"":4.599999904632568,""y"":2.02299165725708},{""x"":5.099999904632568,""y"":1.1105059385299683},{""x"":5.599999904632568,""y"":0.4494485855102539},{""x"":6.099999904632568,""y"":0.1375635862350464},{""x"":6.599999904632568,""y"":0.036351121962070465},{""x"":7.099999904632568,""y"":0.1619771122932434}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.953125499439879, 1.2528620255306528, 5.187637440149802, 0.3110348753260886],""points"":[{""x"":0.10000000149011612,""y"":5.6585283279418945},{""x"":0.6000000238418579,""y"":5.911152362823486},{""x"":1.100000023841858,""y"":5.924920082092285},{""x"":1.600000023841858,""y"":5.8469438552856445},{""x"":2.0999999046325684,""y"":5.929472923278809},{""x"":2.5999999046325684,""y"":6.190037727355957},{""x"":3.0999999046325684,""y"":6.236179828643799},{""x"":3.5999999046325684,""y"":6.141019344329834},{""x"":4.099999904632568,""y"":5.295210838317871},{""x"":4.599999904632568,""y"":5.265801906585693},{""x"":5.099999904632568,""y"":3.3722851276397705},{""x"":5.599999904632568,""y"":1.8299226760864258},{""x"":6.099999904632568,""y"":0.32690900564193726},{""x"":6.599999904632568,""y"":0.6274543404579163},{""x"":7.099999904632568,""y"":0.8441857099533081}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nRwanda,MPNSEPASLLELFNSIATQGELVRSLKAGNASK,CC(C)Cc1ccc(cc1)C(C)C(=O)N2CCCC2C(=O)OCCO,1480021,36.33137130737305,995037247,"168-46 91ST AVE., 2ND FLR",https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,9,2BDJ,9,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[3.8209972202654474, 1.3779216716448506, 5.299882228439686, 0.06040645519069608],""points"":[{""x"":0.10000000149011612,""y"":3.7821109294891357},{""x"":0.6000000238418579,""y"":3.542433023452759},{""x"":1.100000023841858,""y"":3.7008674144744873},{""x"":1.600000023841858,""y"":3.717301607131958},{""x"":2.0999999046325684,""y"":4.024452209472656},{""x"":2.5999999046325684,""y"":4.013899326324463},{""x"":3.0999999046325684,""y"":3.945094347000122},{""x"":3.5999999046325684,""y"":3.866621971130371},{""x"":4.099999904632568,""y"":3.7461626529693604},{""x"":4.599999904632568,""y"":3.3454740047454834},{""x"":5.099999904632568,""y"":2.61944317817688},{""x"":5.599999904632568,""y"":0.999405026435852},{""x"":6.099999904632568,""y"":0.46259793639183044},{""x"":6.599999904632568,""y"":0.054134611040353775},{""x"":7.099999904632568,""y"":0.05711187422275543}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[5.6318079657726035, 1.8495493770000595, 5.391793312471116, 0.17060707587348442],""points"":[{""x"":0.10000000149011612,""y"":5.458079814910889},{""x"":0.6000000238418579,""y"":5.554427146911621},{""x"":1.100000023841858,""y"":5.799983024597168},{""x"":1.600000023841858,""y"":5.364140033721924},{""x"":2.0999999046325684,""y"":5.864485740661621},{""x"":2.5999999046325684,""y"":5.4509806632995605},{""x"":3.0999999046325684,""y"":5.702574729919434},{""x"":3.5999999046325684,""y"":5.7314534187316895},{""x"":4.099999904632568,""y"":5.5123443603515625},{""x"":4.599999904632568,""y"":5.724395751953125},{""x"":5.099999904632568,""y"":4.354506969451904},{""x"":5.599999904632568,""y"":1.7307666540145874},{""x"":6.099999904632568,""y"":0.6305936574935913},{""x"":6.599999904632568,""y"":0.035183437168598175},{""x"":7.099999904632568,""y"":0.7575169205665588}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\nSwitzerland,IRVVGRYLIEVWKAAGMDMDKVLFLWSSDEI,CN1CCC(CC1)Oc2ccc(cc2)C(F)(F)F,1480028,36.33137130737305,99504,92-11 179TH PLACE,https://datagrok.ai/img/slides/access-db-connect.png,id,ErrorMessage,"COMPND \nATOM \nEND",flag,9,10,1IAN,10,1.23,<chart></chart>,"{""series"":[{""name"":""Run:2023-08-08"",""fitFunction"":""sigmoid"",""fitLineColor"":""#1f77b4"",""pointColor"":""#1f77b4"",""showPoints"":""points"",""parameters"":[1.1190255865097471, 2.3163895161544437, 5.4968866182279195, 0.2035204047289052],""points"":[{""x"":0.10000000149011612,""y"":1.1057683229446411},{""x"":0.6000000238418579,""y"":1.1019697189331055},{""x"":1.100000023841858,""y"":1.0818607807159424},{""x"":1.600000023841858,""y"":1.062997817993164},{""x"":2.0999999046325684,""y"":1.046447515487671},{""x"":2.5999999046325684,""y"":1.1217249631881714},{""x"":3.0999999046325684,""y"":1.2166996002197266},{""x"":3.5999999046325684,""y"":1.215477705001831},{""x"":4.099999904632568,""y"":1.0581893920898438},{""x"":4.599999904632568,""y"":1.1747995615005493},{""x"":5.099999904632568,""y"":1.0181127786636353},{""x"":5.599999904632568,""y"":0.5344523191452026},{""x"":6.099999904632568,""y"":0.2569526433944702},{""x"":6.599999904632568,""y"":0.1912207305431366},{""x"":7.099999904632568,""y"":0.15060538053512573}]},{""name"":""Run:2023-08-08"",""fitLineColor"":""#ffbb78"",""pointColor"":""#ffbb78"",""showPoints"":""points"",""parameters"":[3.1038581025805785, 2.0032224204185245, 5.087602825989163, 0.13277988512492753],""points"":[{""x"":0.10000000149011612,""y"":3.0498509407043457},{""x"":0.6000000238418579,""y"":2.805217742919922},{""x"":1.100000023841858,""y"":3.3415253162384033},{""x"":1.600000023841858,""y"":3.0549843311309814},{""x"":2.0999999046325684,""y"":3.250074863433838},{""x"":2.5999999046325684,""y"":3.0432586669921875},{""x"":3.0999999046325684,""y"":3.265852451324463},{""x"":3.5999999046325684,""y"":2.9475724697113037},{""x"":4.099999904632568,""y"":3.1929898262023926},{""x"":4.599999904632568,""y"":2.7460060119628906},{""x"":5.099999904632568,""y"":1.6175861358642578},{""x"":5.599999904632568,""y"":0.3006608486175537},{""x"":6.099999904632568,""y"":0.3444803059101105},{""x"":6.599999904632568,""y"":0.015537971630692482},{""x"":7.099999904632568,""y"":0.5527358055114746}]}],""chartOptions"":{""xAxisName"":""Conc."",""yAxisName"":""Activity"",""title"":""Dose-Response curves""}}",text,,\n,,,,,,,,,,,,,,,,,,,,,').columns.add(r.Column.fromList(r.TYPE.BYTE_ARRAY,"BinaryImage",Array.from(new Uint8Array(11))));var i,s=function(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{h(r.next(t))}catch(t){s(t)}}function a(t){try{h(r.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}h((r=r.apply(t,e||[])).next())}))};function o(t,e,n,r=0,i="timeout"){return s(this,void 0,void 0,(function*(){return new Promise(((s,o)=>{const a=t.subscribe((t=>{try{e(t),s("OK")}catch(t){o(t)}finally{a.unsubscribe(),clearTimeout(h)}})),h=setTimeout((()=>{a.unsubscribe(),o(i)}),r);n()}))}))}console.log.bind(console),console.info.bind(console),console.warn.bind(console),console.error.bind(console),function(t){t.notNull=function(t,e){if(null==t)throw new Error(`${null==e?"Value":e} not defined`)}}(i||(i={})),r.DataFrame.fromColumns([r.Column.fromStrings("col",["val1","val2","val3"])])},24:(t,e,n)=>{"use strict";function r(t){var e;return"string"==typeof t||t instanceof String?t:("object"==typeof t||t instanceof Object)&&"$thrownJsError"in t?r(t.$thrownJsError):t instanceof Error?null!==(e=t.stack)&&void 0!==e?e:t.message:t.toString()}n.d(e,{v:()=>r})},8:function(t,e,n){var r;!function(e,i){var s={};!function(t){"use strict";t.__esModule=!0,t.digestLength=32,t.blockSize=64;var e=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function n(t,n,r,i,s){for(var o,a,h,l,c,u,g,d,m,f,p,y,C;s>=64;){for(o=n[0],a=n[1],h=n[2],l=n[3],c=n[4],u=n[5],g=n[6],d=n[7],f=0;f<16;f++)p=i+4*f,t[f]=(255&r[p])<<24|(255&r[p+1])<<16|(255&r[p+2])<<8|255&r[p+3];for(f=16;f<64;f++)y=((m=t[f-2])>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,C=((m=t[f-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,t[f]=(y+t[f-7]|0)+(C+t[f-16]|0);for(f=0;f<64;f++)y=(((c>>>6|c<<26)^(c>>>11|c<<21)^(c>>>25|c<<7))+(c&u^~c&g)|0)+(d+(e[f]+t[f]|0)|0)|0,C=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&a^o&h^a&h)|0,d=g,g=u,u=c,c=l+y|0,l=h,h=a,a=o,o=y+C|0;n[0]+=o,n[1]+=a,n[2]+=h,n[3]+=l,n[4]+=c,n[5]+=u,n[6]+=g,n[7]+=d,i+=64,s-=64}return i}var r=function(){function e(){this.digestLength=t.digestLength,this.blockSize=t.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return e.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},e.prototype.clean=function(){for(var t=0;t<this.buffer.length;t++)this.buffer[t]=0;for(t=0;t<this.temp.length;t++)this.temp[t]=0;this.reset()},e.prototype.update=function(t,e){if(void 0===e&&(e=t.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=e,this.bufferLength>0){for(;this.bufferLength<64&&e>0;)this.buffer[this.bufferLength++]=t[r++],e--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(e>=64&&(r=n(this.temp,this.state,t,r,e),e%=64);e>0;)this.buffer[this.bufferLength++]=t[r++],e--;return this},e.prototype.finish=function(t){if(!this.finished){var e=this.bytesHashed,r=this.bufferLength,i=e/536870912|0,s=e<<3,o=e%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<o-8;a++)this.buffer[a]=0;this.buffer[o-8]=i>>>24&255,this.buffer[o-7]=i>>>16&255,this.buffer[o-6]=i>>>8&255,this.buffer[o-5]=i>>>0&255,this.buffer[o-4]=s>>>24&255,this.buffer[o-3]=s>>>16&255,this.buffer[o-2]=s>>>8&255,this.buffer[o-1]=s>>>0&255,n(this.temp,this.state,this.buffer,0,o),this.finished=!0}for(a=0;a<8;a++)t[4*a+0]=this.state[a]>>>24&255,t[4*a+1]=this.state[a]>>>16&255,t[4*a+2]=this.state[a]>>>8&255,t[4*a+3]=this.state[a]>>>0&255;return this},e.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},e.prototype._saveState=function(t){for(var e=0;e<this.state.length;e++)t[e]=this.state[e]},e.prototype._restoreState=function(t,e){for(var n=0;n<this.state.length;n++)this.state[n]=t[n];this.bytesHashed=e,this.finished=!1,this.bufferLength=0},e}();t.Hash=r;var i=function(){function t(t){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var e=new Uint8Array(this.blockSize);if(t.length>this.blockSize)(new r).update(t).finish(e).clean();else for(var n=0;n<t.length;n++)e[n]=t[n];for(n=0;n<e.length;n++)e[n]^=54;for(this.inner.update(e),n=0;n<e.length;n++)e[n]^=106;for(this.outer.update(e),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<e.length;n++)e[n]=0}return t.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},t.prototype.clean=function(){for(var t=0;t<this.istate.length;t++)this.ostate[t]=this.istate[t]=0;this.inner.clean(),this.outer.clean()},t.prototype.update=function(t){return this.inner.update(t),this},t.prototype.finish=function(t){return this.outer.finished?this.outer.finish(t):(this.inner.finish(t),this.outer.update(t,this.digestLength).finish(t)),this},t.prototype.digest=function(){var t=new Uint8Array(this.digestLength);return this.finish(t),t},t}();function s(t){var e=(new r).update(t),n=e.digest();return e.clean(),n}function o(t,e){var n=new i(t).update(e),r=n.digest();return n.clean(),r}function a(t,e,n,r){var i=r[0];if(0===i)throw new Error("hkdf: cannot expand more");e.reset(),i>1&&e.update(t),n&&e.update(n),e.update(r),e.finish(t),r[0]++}t.HMAC=i,t.hash=s,t.default=s,t.hmac=o;var h=new Uint8Array(t.digestLength);t.hkdf=function(t,e,n,r){void 0===e&&(e=h),void 0===r&&(r=32);for(var s=new Uint8Array([1]),l=o(e,t),c=new i(l),u=new Uint8Array(c.digestLength),g=u.length,d=new Uint8Array(r),m=0;m<r;m++)g===u.length&&(a(u,c,n,s),g=0),d[m]=u[g++];return c.clean(),u.fill(0),s.fill(0),d},t.pbkdf2=function(t,e,n,r){for(var s=new i(t),o=s.digestLength,a=new Uint8Array(4),h=new Uint8Array(o),l=new Uint8Array(o),c=new Uint8Array(r),u=0;u*o<r;u++){var g=u+1;a[0]=g>>>24&255,a[1]=g>>>16&255,a[2]=g>>>8&255,a[3]=g>>>0&255,s.reset(),s.update(e),s.update(a),s.finish(l);for(var d=0;d<o;d++)h[d]=l[d];for(d=2;d<=n;d++){s.reset(),s.update(l).finish(l);for(var m=0;m<o;m++)h[m]^=l[m]}for(d=0;d<o&&u*o+d<r;d++)c[u*o+d]=h[d]}for(u=0;u<o;u++)h[u]=l[u]=0;for(u=0;u<4;u++)a[u]=0;return s.clean(),c}}(s);var o=s.default;for(var a in s)o[a]=s[a];"object"==typeof t.exports?t.exports=o:void 0===(r=function(){return o}.call(s,n,s,t))||(t.exports=r)}()},543:(t,e,n)=>{"use strict";function r(t){const e=t.match(/(?<=\[)[^\][]*(?=])/gm),n={};let r,i="";if(e)for(let t=0;t<e.length;t++)if(null!=e[t]&&/\d/.test(e[t])){r=e[t][e[t].length-1],e[t]=e[t].replace(/[0-9]/g,"");for(let n=0;n<e[t].length;n++)":"!=e[t][n]&&(i+=e[t][n]);n["R"+r]=i,i=""}return n}n.d(e,{Mp:()=>i,iu:()=>a,mA:()=>r,uM:()=>o});class i{get rs(){return Object.keys(this.at).length}constructor(t,e,n,r,i,s,o){this.id=t,this.m=e,this.n=n,this.na=r,this.type=i,this.mt=s,this.at=o}static fromMonomer(t,e){let n={};const s=e.smiles;if(e.rgroups.length>0)e.rgroups.forEach((t=>{n[t.label]=t.capGroupName}));else{if(!s)return new h(t,e.symbol);n=r(s)}return new i(e.symbol,e.molfile,e.name,e.naturalAnalog,e.polymerType,e.monomerType,n)}}class s{get rs(){return Object.keys(this.at).length}constructor(t,e,n="missing",r=void 0,i=void 0,o=void 0){if(this.biotype=t,this.id=e,this.n=n,this.m=r,this.type=i,this.mt=o,this.at={R1:"H",R2:"H",R3:"H",R4:"H",R5:"H",R6:"H",R7:"H",R8:"H",R9:"H"},this.objId=++s.objCounter,this.className="DummyWebEditorMonomer",!this.id)throw new Error("Invalid arg undefined [id].")}toLog(){return`Helm: ${this.className}<${this.objId}>`}}s.objCounter=-1;class o extends s{constructor(t,e){super(t,e,"gap"),this.backgroundcolor="#FFFFFF",this.linecolor="#808080",this.textcolor="#808080"}}class a extends s{constructor(t,e){super(t,e,"ambiguous"),this.backgroundcolor="#808080",this.linecolor="#000000",this.textcolor="#000000"}}class h extends s{constructor(t,e){super(t,e,"broken"),this.backgroundcolor="#FFFF44",this.linecolor="#800000",this.textcolor="#000000"}}},696:(t,e,n)=>{"use strict";n.d(e,{aO:()=>h});var r=n(372),i=(n(482),n(516)),s=n(543);const o=/[\w()]+/,a=RegExp(String.raw`\(${o}(,${o})+\)`);function h(t,e,n){const[o,h]=function(t,e){let n,i;return"ATOM"===t.T?(n=t.biotype(),i=t.elem):(n=t,i=r.helm.webeditor.IO.trimBracket(e)),[n,i]}(e,n),l=(0,i.y)(o);let c=t.getMonomer(l,h);if(c&&"HELM_LINKER"==o&&2!=c.rgroups.length)return null;if(c&&"HELM_SUGAR"==o&&3!=c.rgroups.length)return null;c||(c=t.addMissingMonomer(l,h));let u=c.wem;return u||("*"===h?u=c.wem=new s.uM(o,h):("HELM_NUCLETIDE"===o&&"N"===h||"HELM_AA"===o&&"X"===h||a.test(h))&&(u=c.wem=new s.iu(o,h)),u||(u=c.wem=s.Mp.fromMonomer(o,c))),u}},788:(t,e,n)=>{"use strict";n.d(e,{aY:()=>o}),n(482),n(372);const r=/\{(\*\.)+/g,i=/\.(\*\.)+/g,s=/(\.\*)+\}/g;function o(t){return t.replaceAll(r,"{").replaceAll(i,".").replaceAll(s,"}").replace("{*}","{}")}},980:(t,e,n)=>{"use strict";n.d(e,{g:()=>c});var r=n(304),i=n(888),s=n(592),o=n.n(s),a=n(688),h=n(736),l=n(788);function c(t){const e=a.YL.forColumn(t.cell.column),n=function(t,e){const n=e.isHelm()?t:e.getConverter(h.qD.HELM)(t),i=(0,l.aY)(n),s=r.div([],{style:{width:"0",height:"0"}});document.documentElement.appendChild(s);try{const t=new JSDraw2.Editor(s,{viewonly:!0});t.setHelm(i);const e=t.getFormula(!0),n=Math.round(100*t.getMolWeight())/100,r=Math.round(100*t.getExtinctionCoefficient(!0))/100;return{formula:e.replace(/<sub>/g,"").replace(/<\/sub>/g,""),"molecular weight":n,"extinction coefficient":r}}finally{o()(s).empty(),s.remove()}}(t.value,e);return new i.Widget(r.tableFromMap(n))}},592:t=>{"use strict";t.exports=$},888:t=>{"use strict";t.exports=DG},924:t=>{"use strict";t.exports=JSDraw2},200:t=>{"use strict";t.exports=grok},372:t=>{"use strict";t.exports=org},468:t=>{"use strict";t.exports=rxjs},482:t=>{"use strict";t.exports=scil},304:t=>{"use strict";t.exports=ui},848:t=>{"use strict";t.exports=wu}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var s=e[r]={exports:{}};return t[r].call(s.exports,s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>$,editMoleculeCell:()=>U,getHelmHelper:()=>j,getHelmService:()=>k,getMolfiles:()=>Y,getMonomerLib:()=>F,helmCellRenderer:()=>B,initHelm:()=>P,measureCellRenderer:()=>K,openEditor:()=>V,propertiesWidget:()=>W});var t=n(200),e=n(304),i=n(888),s=n(482),o=n(372),a=n(924),h=n(592),l=n.n(h),c=n(24),u=n(736),g=n(688);class d{constructor(){this.w=200,this.h=100,this.host=e.div([],{style:{width:`${this.w}px`,height:`${this.h}px`}}),this.editor=new a.Editor(this.host,{width:this.w,height:this.h,viewonly:!0})}resizeEditor(t,e){this.editor.setSize(t,e)}}class m{createHelmWebEditor(){return new d}createWebEditorApp(t,e){o.helm.webeditor.MolViewer.molscale=.8;const n=new o.helm.webeditor.App(t,{showabout:!1,mexfontsize:"90%",mexrnapinontab:!0,topmargin:20,mexmonomerstab:!0,sequenceviewonly:!1,mexfavoritefirst:!0,mexfilter:!0}),r=n.calculateSizes();n.canvas.resize(r.rightwidth-100,r.topheight-210);let i={width:r.rightwidth-100+"px",height:r.bottomheight+"px"};return s.apply(n.sequence.style,i),s.apply(n.notation.style,i),i={width:r.rightwidth+"px",height:r.bottomheight+n.toolbarheight+"px"},s.apply(n.properties.parent.style,i),n.structureview.resize(r.rightwidth,r.bottomheight+n.toolbarheight),n.mex.resize(r.topheight-80),setTimeout((()=>{n.canvas.helm.setSequence(e,"HELM")}),200),n}static async getInstance(){let t=window.$helmHelper;return t||(window.$helmHelper=t=new m),t}}var f=n(980),p=n(248),y=n(824),C=n(516);var x=n(872),b=n(468),w=n(272);class A extends y.Cu{constructor(){super($.logger),this.image=null,this.hostDiv=e.box(),this.hostDiv.style.position="absolute",this.hostDiv.style.left="0px",this.hostDiv.style.right="0px",this.hostDiv.style.width="0px",this.hostDiv.style.height="0px",this.hostDiv.style.visibility="hidden",document.body.appendChild(this.hostDiv)}toLog(){return`Helm: ${super.toLog()}`}async requestRender(t,e,n){const r=`${this.toLog()}.requestRender()`;this.logger.debug(`${r}, start, key: ${t?.toString()}`),this.editor||(this.editor=new a.Editor(this.hostDiv,{width:e.props.width,height:e.props.height,skin:"w8",viewonly:!0}));const s=window.performance.now();this.editor.options.width=e.props.width,this.editor.options.height=e.props.height,this.editor.resize(e.props.width,e.props.height);const o=e.props.helm;o&&(this.logger.debug(`${r}, editor.setData( '${o}' )`),this.editor.setData(o,"helm")),o||this.editor.reset();const h=this.editor.div.children[0].getBBox(),c={mol:this.editor.m.clone(!1),bBox:new i.Rect(h.x,h.y,h.width+2,h.height+2),cBox:new i.Rect(0,0,e.props.width,e.props.height)},u=window.performance.now(),g=l()(this.hostDiv).find("svg").get(0),d=window.devicePixelRatio,m=window.performance.now(),f=()=>{const e=window.performance.now();this.logger.debug(`${r}.renderHandlerInt(), key: ${t?.toString()}, load: ${u-s} ms,\n renderET: ${e-m} ms, emptyCanvasHash: 0`),n(c)},p=(new b.Subject).subscribe((()=>{const t=`${r} on renderEvent`;this.logger.debug(`${t}`)}));return this.logger.debug(`${r}, end, key: ${t?.toString()}`),[p,-1,()=>{(function(t,e,n=1e3){const r=t.width.baseVal.value,i=t.height.baseVal.value,s=new Image(e*r,e*i),o=(new XMLSerializer).serializeToString(t),a=window.btoa(o),h=new b.Subject,l=()=>{h.next()};return s.addEventListener("load",l),new Promise(((t,e)=>{(0,w.SG)(h,(()=>{t(s)}),(()=>{s.src="data:image/svg+xml;base64,"+a}),n).catch((t=>{e(t)})).finally((()=>{s.removeEventListener("load",l)}))}))})(g,d).then((t=>{this.image=t,f()}))}]}onRendered(t,n,r,i){window.devicePixelRatio;const s=e.canvas(n.props.width,n.props.height);try{const t=s.getContext("2d");if(!this.image||!t)return!1;t.drawImage(this.image,0,0),n.onAfterRender(s,i)}finally{s.remove()}return!0}async reset(){}}var _=n(696);function E(){let t=window.$helmService;return t||(t=window.$helmService=new A),t}class v extends i.Package{initHelmPatchPistoia(t,e){const n="Helm: initHelmPatchPistoia()",r=o.helm.webeditor.Monomers;this.getMonomerOriginal=r.getMonomer.bind(r),this.logger.debug(`${n}, this.getMonomerOriginal stored`),this.alertOriginal=s.Utils.alert,o.helm.webeditor.Monomers.getMonomer=(r,i)=>{const s=`${n}, org.helm.webeditor.Monomers.getMonomer()`;try{return(0,_.aO)(t,r,i)}catch(t){const[n,r]=(0,x.g$)(t);throw e.error(`${s}, Error: ${n}`,void 0,r),t}},s.Utils.alert=t=>{e.warning(`${n}, scil.Utils.alert() s = 's'.`)},o.helm.webeditor.Monomers=new class{constructor(t){return new Proxy(t,{get:(t,e,n)=>t[e],set:(t,e,n,r)=>(t[e]=n,!0),apply:(t,e,n)=>t[e](...n)})}}(o.helm.webeditor.Monomers),o.helm.webeditor=new class{constructor(t){return new Proxy(t,{get:(t,e,n)=>t[e],set:(t,e,n,r)=>(t[e]=n,!0),apply:(t,e,n)=>t[e](...n)})}}(o.helm.webeditor)}}var T=n(544);class S{constructor(t){this.base=t}error(t,e,n){this.base.error(t,e,n)}warning(t,e){this.base.warning(t,e)}info(t,e){}debug(t,e){}}class M extends p.I5{constructor(t,e){super(t,e,new S($.logger),!0)}reset(){super.reset(),this._auxList=new Array(this.tableCol.length).fill(null),this.gridCol&&this.gridCol.dart&&this.gridCol.grid?.invalidate()}getRenderService(){return E()}getRenderTaskProps(t,e,n,r){return new y.st(t.cell.value,e,n,r)}storeAux(t,e){null!==t.tableRowIndex&&(this._auxList[t.tableRowIndex]=e)}renderCellImageData(t,n,r,i){const s=window.devicePixelRatio;if(null===r.tableRowIndex)return!1;const o=this._auxList[r.tableRowIndex];if(!o)return!0;const a=e.canvas(i.width,i.height).getContext("2d");a.putImageData(i,0,0);const h=a.getImageData(o.bBox.x,o.bBox.y,o.bBox.width,o.bBox.height),l=e.canvas(o.bBox.width,o.bBox.height);l.getContext("2d").putImageData(h,0,0);const c=n.width*s-2,u=n.height*s-2,g=Math.max(o.bBox.width/o.cBox.width,o.bBox.height/o.cBox.height),d=o.bBox.width/g,m=o.bBox.height/g,f=Math.min(c/d,u/m),p=(o.bBox.left+o.bBox.width/2-o.cBox.width/2)/o.cBox.width,y=(o.bBox.top+o.bBox.height/2-o.cBox.height/2)/o.cBox.height,C=c/2-l.width*f*(1-2*p)/2,x=u/2-l.height*f*(1-2*y)/2,b=e.canvas(c,u).getContext("2d");b.transform(f,0,0,f,C,x),b.drawImage(l,0,0);const w=b.getImageData(0,0,c,u);return this.renderOnGrid(t,n,r,w),!0}onMouseMove(t,n){if(null===t.tableRowIndex)return;const r=this._auxList[t.tableRowIndex];if(!r)return;const i=`${this.toLog()}.onMouseMove()`,s=window.devicePixelRatio,o=t.bounds,a=(n.offsetX-o.x)*s,h=(n.offsetY-o.y)*s,l=r.mol;if(!l)return void this.logger.warning(`${i}, editorMol of the cell not found.`);const c=function(t,e,n,r){let i=null;function s(n){let i,s;for(let o=0;o<r.atoms.length;++o)if(!n.includes(o)){const n=r.atoms[o].p.x,a=r.atoms[o].p.y,h=Math.sqrt((t-n)**2+(e-a)**2);(void 0===s||s>h)&&(i=o,s=h)}return[i,s]}const[o,a]=s([]),[h,l]=s([o]);if(void 0!==o&&void 0!==a){const t=function(t){const e=(0,C.y)(t.bio.type);return{symbol:t.elem,polymerType:e}}(r.atoms[o]);void 0!==h&&void 0!==l?a<.45*l&&(i=t):a<.35*n.bounds.height&&(i=t)}return i}(a,h,t,l);if(c){const t=F(),r=t?t.getTooltip(c.polymerType,c.symbol):e.divText("Monomer library is not available");e.tooltip.show(r,n.x+16,n.y+16)}else e.tooltip.hide()}monomerLibOnChanged(t){this.reset(),this.invalidateGrid()}static getOrCreate(t){const[e,n,r]=(0,T.M)(t);let i=r.rendererBack;return i||(i=r.rendererBack=new M(e,n)),i}}class R extends i.GridCellRenderer{get name(){return"helm"}get cellType(){return"helm"}get defaultWidth(){return 400}get defaultHeight(){return 100}onMouseMove(t,e){try{M.getOrCreate(t).onMouseMove(t,e)}catch(t){const[e,n]=(0,x.g$)(t);$.logger.error(e,void 0,n)}finally{e.preventDefault(),e.stopPropagation()}}render(t,e,n,r,i,s,o){M.getOrCreate(s).render(t,e,n,r,i,s,o)}}const L="smiles",N="capGroupName",O="label";var I=n(543),H=n(460);let D=null;const $=new v;async function P(){const e="Helm: initHelm()";$.logger.debug(`${e}, start`),o.helm.webeditor.kCaseSensitive=!0,await Promise.all([new Promise(((t,e)=>{dojo.ready((function(){t(null)}))})).then((()=>{window.dojox.gfx.svg.Text.prototype.getTextWidth=function(){const t=this.rawNode,e=t.parentNode,n=t.cloneNode(!0);n.style.visibility="hidden";let r=0;const i=n.firstChild.nodeValue;if(e.appendChild(n),""!=i){let t=100;for(;!r&&--t>0;)r=n.getBBox?parseInt(n.getBBox().width):68}return e.removeChild(n),r}})),(async()=>(await(0,H.wW)()).getBioLib())()]).then((([n,r])=>{$.logger.debug(`${e}, then(), lib loaded`),D=r,q(),$.initHelmPatchPistoia(D,$.logger),D.onChanged.subscribe((n=>{try{const n=D.getSummary(),r=0==Object.keys(n).length,i=r?"empty":Object.entries(n).map((([t,e])=>`${t}: ${e}`)).join(", "),s=`${e} monomerLib.onChanged()`;$.logger.debug(`${s}, start, lib: { ${i} }`);const o=`Monomer lib updated:<br /> ${r?"empty":Object.entries(n).map((([t,e])=>`${t} ${e}`)).join("<br />")}`;t.shell.info(o),$.logger.debug(`${s}, org,helm.webeditor.Monomers updating ...`),q(),$.logger.debug(`${s}, end, org.helm.webeditor.Monomers completed`)}catch(t){const e=(0,c.v)(t);console.error("Helm: initHelm monomerLib.onChanged() error:\n"+e)}}))})).catch((e=>{const n=e instanceof Error?e.message:e?e.toString():"Exception 'undefined'";t.shell.error(`Package 'Helm' init initHelm() error: ${n}`);const r=new Error(n);throw r.stack=e.stack,r})),$.logger.debug(`${e}, end`)}function F(){return D}function q(){o.helm.webeditor.Monomers.clear(),D.getPolymerTypes().forEach((t=>{D.getMonomerSymbolsByType(t).forEach((e=>{let n=!1;const r=D.getMonomer(t,e),i={id:e,m:r.molfile,n:r.name,na:r.naturalAnalog,rs:r.rgroups.length,type:r.polymerType,mt:r.monomerType,at:{}};if(r.rgroups.length>0){i.rs=r.rgroups.length;const t={};r.rgroups.forEach((e=>{t[e[O]]=e[N]})),i.at=t}else null!=r[L]?(i.rs=Object.keys((0,I.mA)(r[L].toString())).length,i.at=(0,I.mA)(r[L].toString())):n=!0;n||o.helm.webeditor.Monomers.addOneMonomer(i)}))}));const e=t.shell.tv?.grid;e&&e.invalidate()}function k(){return E()}function B(){return new R}function G(t,n,r){!function(t,n,r){const i=e.div(),a=t.column,h=g.YL.forColumn(a);t.rowIndex,o.helm.webeditor.MolViewer.molscale=.8;const l=new o.helm.webeditor.App(i,{showabout:!1,mexfontsize:"90%",mexrnapinontab:!0,topmargin:20,mexmonomerstab:!0,sequenceviewonly:!1,mexfavoritefirst:!0,mexfilter:!0}),c=l.calculateSizes();l.canvas.resize(c.rightwidth-100,c.topheight-210);let u={width:c.rightwidth-100+"px",height:c.bottomheight+"px"};s.apply(l.sequence.style,u),s.apply(l.notation.style,u),u={width:c.rightwidth+"px",height:c.bottomheight+l.toolbarheight+"px"},s.apply(l.properties.parent.style,u),l.structureview.resize(c.rightwidth,c.bottomheight+l.toolbarheight),l.mex.resize(c.topheight-80),setTimeout((()=>{t&&void 0===r?l.canvas.helm.setSequence(t.value,"HELM"):l.canvas.helm.setSequence(n,"HELM")}),200),e.dialog({showHeader:!1,showFooter:!0}).add(i).onOK((()=>{const e=l.canvas.getHelm(!0).replace(/<\/span>/g,"").replace(/<span style='background:#bbf;'>/g,"");if(t)if(void 0===r)t.value=e;else{const n=h.convertHelmToFastaSeparator(e,r,h.separator);t.value=n}})).show({modal:!0,fullScreen:!0})}(t,n,r)}function U(t){G(t.cell,void 0,void 0)}function V(e){const n=t.shell.tv.grid.dataFrame,r=n.columns.bySemType("Macromolecule"),s=g.YL.forColumn(r);r.getTag(i.TAGS.UNITS)===u.qD.HELM&&G(n.currentCell,void 0,void 0);const o=s.getConverter(u.qD.HELM)(e);G(n.currentCell,o,r.getTag(i.TAGS.UNITS))}function W(t){return(0,f.g)(t)}function Y(t){const n=i.Column.string("mols",t.length),r=e.div([],{style:{width:"0",height:"0"}});document.documentElement.appendChild(r);try{const e=new a.Editor(r,{viewonly:!0});return n.init((n=>(e.setHelm(t.get(n)),e.getMolfile()))),n}finally{l()(r).empty(),r.remove()}}async function j(){return m.getInstance()}async function K(){const e=t.shell.tv.grid,n=e.columns.byName("sequence").temp.rendererBack;let r=0,i=0;for(let t=0;t<20;++t){const t=window.performance.now();let s;n.cacheEnabled?await(0,w.SG)(e.onAfterDrawContent,(()=>{s=window.performance.now(),$.logger.info(`measureCellRenderer() cache enabled, ET: ${s-t} ms`)}),(()=>{e.invalidate()}),5e3):await(0,w.SG)(n.onRendered,(()=>{s=window.performance.now(),$.logger.info(`measureCellRenderer() cache disabled , ET: ${s-t} ms`)}),(()=>{n.invalidate()}),5e3),r+=s-t,i++}$.logger.info(`measureCellRenderer(), avg ET: ${r/i} ms`)}})(),helm=r})();
|
|
2
2
|
//# sourceMappingURL=package.js.map
|