@datagrok/bio 2.16.2 → 2.16.3
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/CHANGELOG.md +6 -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 +2 -2
- package/src/utils/monomer-lib/library-file-manager/file-manager.ts +1 -1
- package/src/viewers/web-logo-viewer.ts +1 -0
package/dist/package-test.js
CHANGED
|
@@ -4,5 +4,5 @@ var bio_test;(()=>{var e={8924:(e,t,n)=>{"use strict";n.d(t,{X:()=>s});var r=n(7
|
|
|
4
4
|
|| ${a} === "boolean" || ${s} === null`).assign(c,i._`[${s}]`)}}r.else(),m(e),r.endIf(),r.if(i._`${c} !== undefined`,(()=>{r.assign(s,c),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(i._`${t} !== undefined`,(()=>e.assign(i._`${t}[${n}]`,r)))}(e,c)}))}(e,t,a):m(e)}))}return l};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=c.Correct){const s=r===c.Correct?i.operators.EQ:i.operators.NEQ;let o;switch(e){case"null":return i._`${t} ${s} null`;case"array":o=i._`Array.isArray(${t})`;break;case"object":o=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return i._`typeof ${t} ${s} ${e}`}return r===c.Correct?o:(0,i.not)(o);function a(e=i.nil){return(0,i.and)(i._`typeof ${t} == "number"`,e,n?i._`isFinite(${t})`:i.nil)}}function h(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let s;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=i._`typeof ${t} != "object"`;s=o.null?e:i._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else s=i.nil;o.number&&delete o.integer;for(const e in o)s=(0,i.and)(s,d(e,t,n,r));return s}t.checkDataType=d,t.checkDataTypes=h;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?i._`{type: ${e}}`:i._`{type: ${t}}`};function m(e){const t=function(e){const{gen:t,data:n,schema:r}=e,s=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,p)}t.reportTypeError=m},7870:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(9029),s=n(4227);function o(e,t,n){const{gen:o,compositeRule:i,data:a,opts:c}=e;if(void 0===n)return;const l=r._`${a}${(0,r.getProperty)(t)}`;if(i)return void(0,s.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),o.if(u,r._`${l} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},2586:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(8727),s=n(208),o=n(7887),i=n(208),a=n(7870),c=n(3673),l=n(4495),u=n(9029),d=n(2023),h=n(6939),p=n(4227),m=n(8708);function f({gen:e,validateName:t,schema:n,schemaEnv:r,opts:s},o){s.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,s)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,s),e.code(o)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(s)}`,r.$async,(()=>e.code(g(n,s)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function w(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:n,opts:r,self:s}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}(e)}function v(e,t){if(e.opts.jtd)return E(e,[],!1,t);const n=(0,s.getSchemaTypes)(e.schema);E(e,n,!(0,s.coerceAndCheckDataType)(e,n),t)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:s}){const o=n.$comment;if(!0===s.$comment)e.code(u._`${d.default.self}.logger.log(${o})`);else if("function"==typeof s.$comment){const n=u.str`${r}/$comment`,s=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${o}, ${n}, ${s}.schema)`)}}function E(e,t,n,r){const{gen:s,schema:a,data:c,allErrors:l,opts:h,self:m}=e,{RULES:f}=m;function g(p){(0,o.shouldUseGroup)(a,p)&&(p.type?(s.if((0,i.checkDataType)(p.type,c,h.strictNumbers)),T(e,p),1===t.length&&t[0]===p.type&&n&&(s.else(),(0,i.reportTypeError)(e)),s.endIf()):T(e,p),l||s.if(u._`${d.default.errors} === ${r||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,f)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach((t=>{C(e.dataTypes,t)||S(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)})),function(e,t){const n=[];for(const r of e.dataTypes)C(t,r)?n.push(r):t.includes("integer")&&"number"===r&&n.push("integer");e.dataTypes=n}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&S(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const n=e.self.RULES.all;for(const r in n){const s=n[r];if("object"==typeof s&&(0,o.shouldUseRule)(e.schema,s)){const{type:n}=s.definition;n.length&&!n.some((e=>{return r=e,(n=t).includes(r)||"number"===r&&n.includes("integer");var n,r}))&&S(e,`missing type "${n.join(",")}" for keyword "${r}"`)}}}(e,e.dataTypes))}(e,t),s.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):s.block((()=>P(e,"$ref",f.all.$ref.definition)))}function T(e,t){const{gen:n,schema:r,opts:{useDefaults:s}}=e;s&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,o.shouldUseRule)(r,n)&&P(e,n.keyword,n.definition,t.type)}))}function C(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function S(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(w(e),y(e))?function(e){const{schema:t,opts:n,gen:r}=e;f(e,(()=>{n.$comment&&t.$comment&&A(e),function(e){const{schema:t,opts:n}=e;void 0!==t.default&&n.useDefaults&&n.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),r.let(d.default.vErrors,null),r.let(d.default.errors,0),n.unevaluated&&function(e){const{gen:t,validateName:n}=e;e.evaluated=t.const("evaluated",u._`${n}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,(()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`))),t.if(u._`${e.evaluated}.dynamicItems`,(()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`)))}(e),v(e),function(e){const{gen:t,schemaEnv:n,validateName:r,ValidationError:s,opts:o}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${s}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:n,items:r}){n instanceof u.Name&&e.assign(u._`${t}.props`,n),r instanceof u.Name&&e.assign(u._`${t}.items`,r)}(e),t.return(u._`${d.default.errors} === 0`))}(e)}))}(e):f(e,(()=>(0,r.topBoolOrEmptySchema)(e)))};class _{constructor(e,t,n){if((0,c.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",x(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,n){this.failResult((0,u.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t)return this.setParams(t),this._error(e,n),void this.setParams({});this._error(e,n)}_error(e,t){(e?m.reportExtraError:m.reportError)(this,this.def.error,t)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=u.nil){this.gen.block((()=>{this.check$data(e,n),t()}))}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:n,schemaCode:r,schemaType:s,def:o}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(s.length||o.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&n.assign(e,!1)),n.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:n,def:r,it:s}=this;return(0,u.or)(function(){if(n.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(n)?n:[n];return u._`${(0,i.checkDataTypes)(e,t,s.opts.strictNumbers,i.DataType.Wrong)}`}return u.nil}(),function(){if(r.validateSchema){const n=e.scopeValue("validate$data",{ref:r.validateSchema});return u._`!${n}(${t})`}return u.nil}())}subschema(e,t){const n=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(n,this.it,e),(0,l.extendSubschemaMode)(n,e);const s={...this.it,...n,items:void 0,props:void 0};return function(e,t){b(e)&&(w(e),y(e))?function(e,t){const{schema:n,gen:r,opts:s}=e;s.$comment&&n.$comment&&A(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=r.const("_errs",d.default.errors);v(e,o),r.var(t,u._`${o} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(s,t),s}mergeEvaluated(e,t){const{it:n,gen:r}=this;n.opts.unevaluated&&(!0!==n.props&&void 0!==e.props&&(n.props=p.mergeEvaluated.props(r,e.props,n.props,t)),!0!==n.items&&void 0!==e.items&&(n.items=p.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){const{it:n,gen:r}=this;if(n.opts.unevaluated&&(!0!==n.props||!0!==n.items))return r.if(t,(()=>this.mergeEvaluated(e,u.Name))),!0}}function P(e,t,n,r){const s=new _(e,n,t);"code"in n?n.code(s,r):s.$data&&n.validate?(0,c.funcKeywordCode)(s,n):"macro"in n?(0,c.macroKeywordCode)(s,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(s,n)}t.KeywordCxt=_;const N=/^\/(?:[^~]|~0|~1)*$/,M=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let s,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!N.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,o=d.default.rootData}else{const i=M.exec(e);if(!i)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+i[1];if(s=i[2],"#"===s){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(o=n[t-a],!s)return o}let i=o;const a=s.split("/");for(const e of a)e&&(o=u._`${o}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,i=u._`${i} && ${o}`);return i;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=x},3673:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const r=n(9029),s=n(2023),o=n(5765),i=n(8708);function a(e){const{gen:t,data:n,it:s}=e;t.if(s.parentData,(()=>t.assign(n,r._`${s.parentData}[${s.parentDataProperty}]`)))}function c(e,t,n){if(void 0===n)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof n?{ref:n}:{ref:n,code:(0,r.stringify)(n)})}t.macroKeywordCode=function(e,t){const{gen:n,keyword:s,schema:o,parentSchema:i,it:a}=e,l=t.macro.call(a.self,o,i,a),u=c(n,s,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const d=n.name("valid");e.subschema({schema:l,schemaPath:r.nil,errSchemaPath:`${a.errSchemaPath}/${s}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,(()=>e.error(!0)))},t.funcKeywordCode=function(e,t){var n;const{gen:l,keyword:u,schema:d,parentSchema:h,$data:p,it:m}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(m,t);const f=!p&&t.compile?t.compile.call(m.self,d,h,m):t.validate,g=c(l,u,f),y=l.let("valid");function b(n=(t.async?r._`await `:r.nil)){const i=m.opts.passContext?s.default.this:s.default.self,a=!("compile"in t&&!p||!1===t.schema);l.assign(y,r._`${n}${(0,o.callValidateCode)(e,g,i,a)}`,t.modifying)}function w(e){var n;l.if((0,r.not)(null!==(n=t.valid)&&void 0!==n?n:y),e)}e.block$data(y,(function(){if(!1===t.errors)b(),t.modifying&&a(e),w((()=>e.error()));else{const n=t.async?function(){const e=l.let("ruleErrs",null);return l.try((()=>b(r._`await `)),(t=>l.assign(y,!1).if(r._`${t} instanceof ${m.ValidationError}`,(()=>l.assign(e,r._`${t}.errors`)),(()=>l.throw(t))))),e}():function(){const e=r._`${g}.errors`;return l.assign(e,null),b(r.nil),e}();t.modifying&&a(e),w((()=>function(e,t){const{gen:n}=e;n.if(r._`Array.isArray(${t})`,(()=>{n.assign(s.default.vErrors,r._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`).assign(s.default.errors,r._`${s.default.vErrors}.length`),(0,i.extendErrors)(e)}),(()=>e.error()))}(e,n)))}})),e.ok(null!==(n=t.valid)&&void 0!==n?n:y)},t.validSchemaType=function(e,t,n=!1){return!t.length||t.some((t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||n&&void 0===e))},t.validateKeywordUsage=function({schema:e,opts:t,self:n,errSchemaPath:r},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw new Error("ajv implementation error");const i=s.dependencies;if(null==i?void 0:i.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${r}": `+n.errorsText(s.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);n.logger.error(e)}}},4495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const r=n(9029),s=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:o,schemaPath:i,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===n?{schema:o,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,s.escapeFragment)(n)}`}}if(void 0!==o){if(void 0===i||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:i,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:o,data:i,dataTypes:a,propertyName:c}){if(void 0!==i&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==n){const{errorPath:i,dataPathArr:a,opts:c}=t;u(l.let("data",r._`${t.data}${(0,r.getProperty)(n)}`,!0)),e.errorPath=r.str`${i}${(0,s.getErrorPath)(n,o,c.jsPropertySyntax)}`,e.parentDataProperty=r._`${n}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(n){e.data=n,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,n]}void 0!==i&&(u(i instanceof r.Name?i:l.let("data",i,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:s,allErrors:o}){void 0!==r&&(e.compositeRule=r),void 0!==s&&(e.createErrors=s),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=n}},4042:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var r=n(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return r.KeywordCxt}});var s=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return s.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return s.CodeGen}});const o=n(3558),i=n(4551),a=n(396),c=n(3835),l=n(9029),u=n(6939),d=n(208),h=n(4227),p=n(3837),m=n(5944),f=(e,t)=>new RegExp(e,t);f.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},w={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,n,r,s,o,i,a,c,l,u,d,h,p,g,y,b,w,v,A,E,T,C,S,_,P;const N=e.strict,M=null===(t=e.code)||void 0===t?void 0:t.optimize,x=!0===M||void 0===M?1:M||0,$=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:f,L=null!==(s=e.uriResolver)&&void 0!==s?s:m.default;return{strictSchema:null===(i=null!==(o=e.strictSchema)&&void 0!==o?o:N)||void 0===i||i,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:N)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:N)&&void 0!==u?u:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:N)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(p=e.strictRequired)&&void 0!==p?p:N)&&void 0!==g&&g,code:e.code?{...e.code,optimize:x,regExp:$}:{optimize:x,regExp:$},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(w=e.meta)||void 0===w||w,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(A=e.inlineRefs)||void 0===A||A,schemaId:null!==(E=e.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(T=e.addUsedSchema)||void 0===T||T,validateSchema:null===(C=e.validateSchema)||void 0===C||C,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(_=e.unicodeRegExp)||void 0===_||_,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:L}}class A{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:n}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:y,es5:t,lines:n}),this.logger=function(e){if(!1===e)return N;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),E.call(this,b,e,"NOT SUPPORTED"),E.call(this,w,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),C.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:n}=this.opts;let r=p;"id"===n&&(r={...p},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let n;if("string"==typeof e){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);const r=n(t);return"$async"in n||(this.errors=n.errors),r}compile(e,t){const n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await s.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function s(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const n=await l.call(this,e);this.refs[e]||await s.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,n,r);return this}let s;if("object"==typeof e){const{schemaId:t}=this.opts;if(s=e[t],void 0!==s&&"string"!=typeof s)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let n;if(n=e.$schema,void 0!==n&&"string"!=typeof n)throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(n,e);if(!r&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return r}getSchema(e){let t;for(;"string"==typeof(t=T.call(this,e));)e=t;if(void 0===t){const{schemaId:n}=this.opts,r=new c.SchemaEnv({schema:{},schemaId:n});if(t=c.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=T.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,u.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if("string"==typeof e)n=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(n=(t=e).keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,n,t),!t)return(0,h.eachItem)(n,(e=>$.call(this,e))),this;I.call(this,t);const r={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(n,0===r.type.length?e=>$.call(this,e,r):e=>r.type.forEach((t=>$.call(this,e,r,t)))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const n of t.rules){const t=n.rules.findIndex((t=>t.keyword===e));t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return e&&0!==e.length?e.map((e=>`${n}${e.instancePath} ${e.message}`)).reduce(((e,n)=>e+t+n)):"No errors"}$dataMetaSchema(e,t){const n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const r of t){const t=r.split("/").slice(1);let s=e;for(const e of t)s=s[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,o=s[e];r&&o&&(s[e]=O(o))}}return e}_removeAllSchemas(e,t){for(const n in e){const r=e[n];t&&!t.test(n)||("string"==typeof r?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,s=this.opts.addUsedSchema){let o;const{schemaId:i}=this.opts;if("object"==typeof e)o=e[i];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;n=(0,u.normalizeId)(o||n);const l=u.getSchemaRefs.call(this,e,n);return a=new c.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:n,localRefs:l}),this._cache.set(a.schema,a),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=a),r&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function E(e,t,n,r="error"){for(const s in e){const o=s;o in t&&this.logger[r](`${n}: option ${s}. ${e[o]}`)}}function T(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function C(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function S(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function _(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const n=e[t];n.keyword||(n.keyword=t),this.addKeyword(n)}}}function P(){const e={...this.opts};for(const t of g)delete e[t];return e}A.ValidationError=o.default,A.MissingRefError=i.default,t.default=A;const N={log(){},warn(){},error(){}},M=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:n}=this;if((0,h.eachItem)(e,(e=>{if(n.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!M.test(e))throw new Error(`Keyword ${e} has invalid name`)})),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function $(e,t,n){var r;const s=null==t?void 0:t.post;if(n&&s)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let i=s?o.post:o.rules.find((({type:e})=>e===n));if(i||(i={type:n,rules:[]},o.rules.push(i)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?L.call(this,i,a,t.before):i.rules.push(a),o.all[e]=a,null===(r=t.implements)||void 0===r||r.forEach((e=>this.addKeyword(e)))}function L(e,t,n){const r=e.rules.findIndex((e=>e.keyword===n));r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function I(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=O(t)),e.validateSchema=this.compile(t,!0))}const R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function O(e){return{anyOf:[e,R]}}},9572:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1678),s=n(7216),o=n(9547),i=n(8226),a=n(518),c=n(4588),l=n(5707),u=n(7082),d=["/properties"];t.default=function(e){return[r,s,o,i,a,t(this,c),l,t(this,u)].forEach((e=>this.addMetaSchema(e,void 0,!1))),this;function t(t,n){return e?t.$dataMetaSchema(n,d):n}}},6250:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2017);r.code='require("ajv/dist/runtime/equal").default',t.default=r},3853:(e,t)=>{"use strict";function n(e){const t=e.length;let n,r=0,s=0;for(;s<t;)r++,n=e.charCodeAt(s++),n>=55296&&n<=56319&&s<t&&(n=e.charCodeAt(s),56320==(64512&n)&&s++);return r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},5944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(8343);r.code='require("ajv/dist/runtime/uri").default',t.default=r},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=n},5457:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const r=n(9029),s=n(4227),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{parentSchema:t,it:n}=e,{items:r}=t;Array.isArray(r)?i(e,r):(0,s.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function i(e,t){const{gen:n,schema:o,data:i,keyword:a,it:c}=e;c.items=!0;const l=n.const("len",r._`${i}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof o&&!(0,s.alwaysValidSchema)(c,o)){const o=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(o),(()=>function(o){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:s.Type.Num},o),c.allErrors||n.if((0,r.not)(o),(()=>n.break()))}))}(o))),e.ok(o)}}t.validateAdditionalItems=i,t.default=o},8660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o=n(2023),i=n(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>s._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:n,parentSchema:a,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:d,opts:h}=u;if(u.props=!0,"all"!==h.removeAdditional&&(0,i.alwaysValidSchema)(u,n))return;const p=(0,r.allSchemaProperties)(a.properties),m=(0,r.allSchemaProperties)(a.patternProperties);function f(e){t.code(s._`delete ${c}[${e}]`)}function g(r){if("all"===h.removeAdditional||h.removeAdditional&&!1===n)f(r);else{if(!1===n)return e.setParams({additionalProperty:r}),e.error(),void(d||t.break());if("object"==typeof n&&!(0,i.alwaysValidSchema)(u,n)){const n=t.name("valid");"failing"===h.removeAdditional?(y(r,n,!1),t.if((0,s.not)(n),(()=>{e.reset(),f(r)}))):(y(r,n),d||t.if((0,s.not)(n),(()=>t.break())))}}}function y(t,n,r){const s={keyword:"additionalProperties",dataProp:t,dataPropType:i.Type.Str};!1===r&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(s,n)}t.forIn("key",c,(n=>{p.length||m.length?t.if(function(n){let o;if(p.length>8){const e=(0,i.schemaRefOrVal)(u,a.properties,"properties");o=(0,r.isOwnProperty)(t,e,n)}else o=p.length?(0,s.or)(...p.map((e=>s._`${n} === ${e}`))):s.nil;return m.length&&(o=(0,s.or)(o,...m.map((t=>s._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,s.not)(o)}(n),(()=>g(n))):g(n)})),e.ok(s._`${l} === ${o.default.errors}`)}};t.default=a},5844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:s}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const o=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(s,t))return;const i=e.subschema({keyword:"allOf",schemaProp:n},o);e.ok(o),e.mergeEvaluated(i)}))}};t.default=s},6505:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:n(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=r},2661:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?r.str`must contain at least ${e} valid item(s)`:r.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?r._`{minContains: ${e}}`:r._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:n,parentSchema:o,data:i,it:a}=e;let c,l;const{minContains:u,maxContains:d}=o;a.opts.next?(c=void 0===u?1:u,l=d):c=1;const h=t.const("len",r._`${i}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,s.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,s.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,s.alwaysValidSchema)(a,n)){let t=r._`${h} >= ${c}`;return void 0!==l&&(t=r._`${t} && ${h} <= ${l}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function m(){const e=t.name("_valid"),n=t.let("count",0);f(e,(()=>t.if(e,(()=>function(e){t.code(r._`${e}++`),void 0===l?t.if(r._`${e} >= ${c}`,(()=>t.assign(p,!0).break())):(t.if(r._`${e} > ${l}`,(()=>t.assign(p,!1).break())),1===c?t.assign(p,!0):t.if(r._`${e} >= ${c}`,(()=>t.assign(p,!0))))}(n)))))}function f(n,r){t.forRange("i",0,h,(t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:s.Type.Num,compositeRule:!0},n),r()}))}void 0===l&&1===c?f(p,(()=>t.if(p,(()=>t.break())))):0===c?(t.let(p,!0),void 0!==l&&t.if(r._`${i}.length > 0`,m)):(t.let(p,!1),m()),e.result(p,(()=>e.reset()))}};t.default=o},3025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(9029),s=n(4227),o=n(5765);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const s=1===t?"property":"properties";return r.str`must have ${s} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:s}})=>r._`{property: ${e},
|
|
5
5
|
missingProperty: ${s},
|
|
6
6
|
depsCount: ${t},
|
|
7
|
-
deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:s,it:i}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,o.propertyInData)(n,s,c,i.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),i.allErrors?n.if(u,(()=>{for(const t of l)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,o.checkMissingProp)(e,l,a)})`),(0,o.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:i,it:a}=e,c=n.name("valid");for(const l in t)(0,s.alwaysValidSchema)(a,t[l])||(n.if((0,o.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:i,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=i},4845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3025),s={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,r.validateSchemaDeps)(e)};t.default=s},1239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=i(o,"then"),c=i(o,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,s){return()=>{const o=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(o,l),s?t.assign(s,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function i(e,t){const n=e.schema[t];return void 0!==n&&!(0,s.alwaysValidSchema)(e,n)}t.default=o},6378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5457),s=n(5354),o=n(494),i=n(3966),a=n(2661),c=n(3025),l=n(9713),u=n(8660),d=n(117),h=n(5333),p=n(7923),m=n(6505),f=n(6163),g=n(5844),y=n(1239),b=n(4426);t.default=function(e=!1){const t=[p.default,m.default,f.default,g.default,y.default,b.default,l.default,u.default,c.default,d.default,h.default];return e?t.push(s.default,i.default):t.push(r.default,o.default),t.push(a.default),t}},494:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(9029),s=n(4227),o=n(5765),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,s.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:o,parentSchema:i,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:o}=l,i=n.length,a=i===e.minItems&&(i===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${i}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,s.checkStrictMode)(l,e,r.strictTuples)}}(i),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=s.mergeEvaluated.items(o,n.length,l.items));const u=o.name("valid"),d=o.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,s.alwaysValidSchema)(l,t)||(o.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=i},3966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(5765),i=n(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,s.alwaysValidSchema)(r,t)||(a?(0,i.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},7923:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:s}=e;if((0,r.alwaysValidSchema)(s,n))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=s},6163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:o,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&o.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,o)=>{let a;(0,s.alwaysValidSchema)(i,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},u),o>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${o}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,o),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},5333:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o=n(4227),i=n(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),h=d.filter((e=>(0,o.alwaysValidSchema)(l,n[e])));if(0===d.length||h.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=t.name("valid");!0===l.props||l.props instanceof s.Name||(l.props=(0,i.evaluatedPropsToName)(t,l.props));const{props:f}=l;function g(e){for(const t in p)new RegExp(e).test(t)&&(0,o.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(n){t.forIn("key",a,(o=>{t.if(s._`${(0,r.usePattern)(e,n)}.test(${o})`,(()=>{const r=h.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&!0!==f?t.assign(s._`${f}[${o}]`,!0):r||l.allErrors||t.if((0,s.not)(m),(()=>t.break()))}))}))}!function(){for(const e of d)p&&g(e),l.allErrors?y(e):(t.var(m,!0),y(e),t.if(m))}()}};t.default=a},5354:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(494),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=s},117:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2586),s=n(5765),o=n(4227),i=n(8660),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&i.default.code(new r.KeywordCxt(l,i.default,"additionalProperties"));const u=(0,s.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=o.mergeEvaluated.props(t,(0,o.toHash)(u),l.props));const d=u.filter((e=>!(0,o.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const h=t.name("valid");for(const n of d)p(n)?m(n):(t.if((0,s.propertyInData)(t,c,n,l.opts.ownProperties)),m(n),l.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(h);function p(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function m(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},9713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:o,it:i}=e;if((0,s.alwaysValidSchema)(i,n))return;const a=t.name("valid");t.forIn("key",o,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(a)}};t.default=o},4426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=s},5765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(9029),s=n(4227),o=n(2023),i=n(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function c(e,t,n){return r._`${a(e)}.call(${t}, ${n})`}function l(e,t,n,s){const o=r._`${t}${(0,r.getProperty)(n)} === undefined`;return s?(0,r.or)(o,(0,r.not)(c(e,t,n))):o}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:s,it:o}=e;n.if(l(n,s,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},s,o){return(0,r.or)(...s.map((s=>(0,r.and)(l(e,t,s,n.ownProperties),r._`${o} = ${s}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,n,s){const o=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return s?r._`${o} && ${c(e,t,n)}`:o},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((n=>!(0,s.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:s,schemaPath:i,errorPath:a},it:c},l,u,d){const h=d?r._`${e}, ${t}, ${s}${i}`:t,p=[[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&p.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const m=r._`${h}, ${n.object(...p)}`;return u!==r.nil?r._`${l}.call(${u}, ${m})`:r._`${l}(${m})`};const d=r._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},n){const s=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(n,s);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:r._`${"new RegExp"===o.code?d:(0,i.useFunc)(e,o)}(${n}, ${s})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:o,it:i}=e,a=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(i){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:o,dataProp:n,dataPropType:s.Type.Num},a),t.if((0,r.not)(a),i)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:o,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,s.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,s)=>{const i=e.subschema({keyword:o,schemaProp:s,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(i,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},2128:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3463),s=n(3693),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,s.default];t.default=o},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(4551),s=n(5765),o=n(9029),i=n(2023),a=n(3835),c=n(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:s}=e,{baseId:i,schemaEnv:c,validateName:l,opts:h,self:p}=s,{root:m}=c;if(("#"===n||"#/"===n)&&i===m.baseId)return function(){if(c===m)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:m});return d(e,o._`${n}.validate`,m,m.$async)}();const f=a.resolveRef.call(p,m,i,n);if(void 0===f)throw new r.default(s.opts.uriResolver,i,n);return f instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(f):function(r){const s=t.scopeValue("schema",!0===h.code.source?{ref:r,code:(0,o.stringify)(r)}:{ref:r}),i=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:n},i);e.mergeEvaluated(a),e.ok(i)}(f)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):o._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:h}=l,p=h.passContext?i.default.this:o.nil;function m(e){const t=o._`${e}.errors`;a.assign(i.default.vErrors,o._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),a.assign(i.default.errors,o._`${i.default.vErrors}.length`)}function f(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",o._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,o.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",o._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,o.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(o._`await ${(0,s.callValidateCode)(e,t,p)}`),f(t),u||a.assign(n,!0)}),(e=>{a.if(o._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),m(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,s.callValidateCode)(e,t,p),(()=>f(t)),(()=>m(t)))}t.getValidate=u,t.callRef=d,t.default=l},6653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(7652),o=n(3835),i=n(4551),a=n(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const h=c.propertyName;if("string"!=typeof h)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),m=t.const("tag",r._`${n}${(0,r.getProperty)(h)}`);function f(n){const s=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:n},s);return e.mergeEvaluated(o,r.Name),s}t.if(r._`typeof ${m} == "string"`,(()=>function(){const n=function(){var e;const t={},n=s(l);let r=!0;for(let t=0;t<d.length;t++){let l=d[t];if((null==l?void 0:l.$ref)&&!(0,a.schemaHasRulesButRef)(l,u.self.RULES)){const e=l.$ref;if(l=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),l instanceof o.SchemaEnv&&(l=l.schema),void 0===l)throw new i.default(u.opts.uriResolver,u.baseId,e)}const p=null===(e=null==l?void 0:l.properties)||void 0===e?void 0:e[h];if("object"!=typeof p)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);r=r&&(n||s(l)),c(p,t)}if(!r)throw new Error(`discriminator: "${h}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(h)}function c(e,t){if(e.const)p(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${h}" must have "const" or "enum"`);for(const n of e.enum)p(n,t)}}function p(e,n){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${h}" values must be unique strings`);t[e]=n}}();t.if(!1);for(const e in n)t.elseIf(r._`${m} === ${e}`),t.assign(p,f(n[e]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:m,tagName:h}),t.endIf()}()),(()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:m,tagName:h}))),e.ok(p)}};t.default=c},7652:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(n||(t.DiscrError=n={}))},6105:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2128),s=n(7060),o=n(6378),i=n(5520),a=n(5413),c=n(3265),l=n(7532),u=n(9857),d=[i.default,r.default,s.default,(0,o.default)(!0),l.default,u.metadataVocabulary,u.contentVocabulary,a.default,c.default];t.default=d},6144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2128),s=n(7060),o=n(6378),i=n(7532),a=n(9857),c=[r.default,s.default,(0,o.default)(),i.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},2476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicAnchor=void 0;const r=n(9029),s=n(2023),o=n(3835),i=n(3693),a={keyword:"$dynamicAnchor",schemaType:"string",code:e=>c(e,e.schema)};function c(e,t){const{gen:n,it:a}=e;a.schemaEnv.root.dynamicAnchors[t]=!0;const c=r._`${s.default.dynamicAnchors}${(0,r.getProperty)(t)}`,l="#"===a.errSchemaPath?a.validateName:function(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:s,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new o.SchemaEnv({schema:n,schemaId:u,root:s,baseId:a,localRefs:c,meta:l});return o.compileSchema.call(r,d),(0,i.getValidate)(e,d)}(e);n.if(r._`!${c}`,(()=>n.assign(c,l)))}t.dynamicAnchor=c,t.default=a},3252:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicRef=void 0;const r=n(9029),s=n(2023),o=n(3693),i={keyword:"$dynamicRef",schemaType:"string",code:e=>a(e,e.schema)};function a(e,t){const{gen:n,keyword:i,it:a}=e;if("#"!==t[0])throw new Error(`"${i}" only supports hash fragment reference`);const c=t.slice(1);if(a.allErrors)l();else{const t=n.let("valid",!1);l(t),e.ok(t)}function l(e){if(a.schemaEnv.root.dynamicAnchors[c]){const t=n.let("_v",r._`${s.default.dynamicAnchors}${(0,r.getProperty)(c)}`);n.if(t,u(t,e),u(a.validateName,e))}else u(a.validateName,e)()}function u(t,r){return r?()=>n.block((()=>{(0,o.callRef)(e,t),n.let(r,!0)})):()=>(0,o.callRef)(e,t)}}t.dynamicRef=a,t.default=i},5520:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2476),s=n(3252),o=n(2721),i=n(3799),a=[r.default,s.default,o.default,i.default];t.default=a},2721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2476),s=n(4227),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,r.dynamicAnchor)(e,""):(0,s.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};t.default=o},3799:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3252),s={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,r.dynamicRef)(e,e.schema)};t.default=s},4737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:s,$data:o,schema:i,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:h}=c;l.validateFormats&&(o?function(){const o=n.scopeValue("formats",{ref:h.formats,code:l.code.formats}),i=n.const("fDef",r._`${o}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${i} == "object" && !(${i} instanceof RegExp)`,(()=>n.assign(c,r._`${i}.type || "string"`).assign(u,r._`${i}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,i))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${i}.async ? await ${u}(${s}) : ${u}(${s}))`:r._`${u}(${s})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${s}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const o=h.formats[i];if(!o)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${i}" ignored in schema at path "${u}"`}h.logger.warn(e())}();if(!0===o)return;const[a,c,p]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(i)}`:void 0,s=n.scopeValue("formats",{key:i,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,s]:[e.type||"string",e.validate,r._`${s}.validate`]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${p}(${s})`}return"function"==typeof c?r._`${p}(${s})`:r._`${p}.test(${s})`}())}())}};t.default=s},7532:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(4737).default];t.default=r},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},5413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1846),s=n(4845),o=n(2626),i=[r.default,s.default,o.default];t.default=i},3265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(392),s=n(3445),o=[r.default,s.default];t.default=o},3445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{gen:t,schema:n,data:o,it:i}=e,a=i.items||0;if(!0===a)return;const c=t.const("len",r._`${o}.length`);if(!1===n)e.setParams({len:a}),e.fail(r._`${c} > ${a}`);else if("object"==typeof n&&!(0,s.alwaysValidSchema)(i,n)){const n=t.var("valid",r._`${c} <= ${a}`);t.if((0,r.not)(n),(()=>function(n,o){t.forRange("i",o,c,(o=>{e.subschema({keyword:"unevaluatedItems",dataProp:o,dataPropType:s.Type.Num},n),i.allErrors||t.if((0,r.not)(n),(()=>t.break()))}))}(n,a))),e.ok(n)}i.items=!0}};t.default=o},392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(2023),i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>r._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){const{gen:t,schema:n,data:i,errsCount:a,it:c}=e;if(!a)throw new Error("ajv implementation error");const{allErrors:l,props:u}=c;function d(o){if(!1===n)return e.setParams({unevaluatedProperty:o}),e.error(),void(l||t.break());if(!(0,s.alwaysValidSchema)(c,n)){const n=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:s.Type.Str},n),l||t.if((0,r.not)(n),(()=>t.break()))}}u instanceof r.Name?t.if(r._`${u} !== true`,(()=>t.forIn("key",i,(e=>t.if(function(e,t){return r._`!${e} || !${e}[${t}]`}(u,e),(()=>d(e))))))):!0!==u&&t.forIn("key",i,(e=>void 0===u?d(e):t.if(function(e,t){const n=[];for(const s in e)!0===e[s]&&n.push(r._`${t} !== ${s}`);return(0,r.and)(...n)}(u,e),(()=>d(e))))),c.props=!0,e.ok(r._`${a} === ${o.default.errors}`)}};t.default=i},7935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(6250),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:i,schemaCode:a,schema:c}=e;i||c&&"object"==typeof c?e.fail$data(r._`!${(0,s.useFunc)(t,o.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=i},1846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3025),s={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:e=>(0,r.validatePropertyDeps)(e)};t.default=s},8643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(6250),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:i,schema:a,schemaCode:c,it:l}=e;if(!i&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum;let d;const h=()=>null!=d?d:d=(0,s.useFunc)(t,o.default);let p;if(u||i)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${h()}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?r._`${h()}(${n}, ${e}[${t}])`:r._`${n} === ${s}`}(e,s))))}e.pass(p)}};t.default=i},7060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5882),s=n(3439),o=n(7307),i=n(422),a=n(4486),c=n(4003),l=n(1163),u=n(617),d=n(7935),h=n(8643),p=[r.default,s.default,o.default,i.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,h.default];t.default=p},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){void 0===t.contains&&(0,r.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};t.default=s},1163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,o="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${o} ${s}`)}};t.default=s},7307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(3853),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:i,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,s.useFunc)(e.gen,o.default)}(${n})`;e.fail$data(r._`${l} ${c} ${i}`)}};t.default=i},5882:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=r.operators,o={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},i={message:({keyword:e,schemaCode:t})=>r.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:i,code(e){const{keyword:t,data:n,schemaCode:s}=e;e.fail$data(r._`${n} ${o[t].fail} ${s} || isNaN(${n})`)}};t.default=a},4486:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,o="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${o} ${s}`)}};t.default=s},3439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:s,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),c=i?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${s} === 0 || (${a} = ${n}/${s}, ${c}))`)}};t.default=s},422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match pattern "${e}"`,params:({schemaCode:e})=>s._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:o,schemaCode:i,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?s._`(new RegExp(${i}, ${c}))`:(0,r.usePattern)(e,o);e.fail$data(s._`!${l}.test(${t})`)}};t.default=o},4003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o=n(4227),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:i,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(s.nil,h);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,o){e.setParams({missingProperty:n}),t.forOf(n,i,(()=>{t.assign(o,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,s.not)(o),(()=>{e.error(),t.break()}))}),s.nil)}(o,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,o)),(0,r.reportMissingProp)(e,o),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(l,t,l.opts.strictRequired)}}function h(){t.forOf("prop",i,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=i},617:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(208),s=n(9029),o=n(4227),i=n(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const h=t.let("valid"),p=l.items?(0,r.getSchemaTypes)(l.items):[];function m(o,i){const a=t.name("item"),c=(0,r.checkDataTypes)(p,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",s._`{}`);t.for(s._`;${o}--;`,(()=>{t.let(a,s._`${n}[${o}]`),t.if(c,s._`continue`),p.length>1&&t.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),t.if(s._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(i,s._`${l}[${a}]`),e.error(),t.assign(h,!1).break()})).code(s._`${l}[${a}] = ${o}`)}))}function f(r,a){const c=(0,o.useFunc)(t,i.default),l=t.name("outer");t.label(l).for(s._`;${r}--;`,(()=>t.for(s._`${a} = ${r}; ${a}--;`,(()=>t.if(s._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(l)}))))))}e.block$data(h,(function(){const r=t.let("i",s._`${n}.length`),o=t.let("j");e.setParams({i:r,j:o}),t.assign(h,!0),t.if(s._`${r} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?m:f)(r,o)))}),s._`${u} === false`),e.ok(h)}};t.default=a},5488:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,"\n.ui-form.ui-tooltip .ui-input-root > label.ui-input-label:not(:empty) {\n /* min-width: 30px; /* Breaks right margin /**/\n}\n\n.ui-form.ui-tooltip .ui-input-root > div.ui-input-text:not(:empty) {\n margin-top: 6px;\n}","",{version:3,sources:["webpack://./css/cell-renderer.css"],names:[],mappings:";AACA;IACI,8CAA8C;AAClD;;AAEA;IACI,eAAe;AACnB",sourcesContent:["\n.ui-form.ui-tooltip .ui-input-root > label.ui-input-label:not(:empty) {\n /* min-width: 30px; /* Breaks right margin /**/\n}\n\n.ui-form.ui-tooltip .ui-input-root > div.ui-input-text:not(:empty) {\n margin-top: 6px;\n}"],sourceRoot:""}]);const a=i},5999:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".macromolecule-cell-comp-analysis-host{\n max-height: 250px;\n overflow-y: scroll;\n}\n\n.macromolecule-cell-comp-analysis-bar{\n height: inherit;\n display: block;\n margin-top: 1.5px;\n margin-bottom: 1.5px;\n margin-right: 3px;\n}\n\n.macromolecule-cell-comp-analysis-value{\n display: flex;\n}","",{version:3,sources:["webpack://./css/composition-analysis.css"],names:[],mappings:"AAAA;IACI,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;AACrB;;AAEA;IACI,aAAa;AACjB",sourcesContent:[".macromolecule-cell-comp-analysis-host{\n max-height: 250px;\n overflow-y: scroll;\n}\n\n.macromolecule-cell-comp-analysis-bar{\n height: inherit;\n display: block;\n margin-top: 1.5px;\n margin-bottom: 1.5px;\n margin-right: 3px;\n}\n\n.macromolecule-cell-comp-analysis-value{\n display: flex;\n}"],sourceRoot:""}]);const a=i},857:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".monomer-manager-root .grok-sketcher {\n min-width: unset !important;\n}\n\n.monomer-manager-root {\n width: 100% !important;\n height: 100% !important;\n}\n\n.monomer-manager-sketcher .ketcher-host {\n height: 100% !important;\n} \n\n.monomer-manager-root > div:first-child {\n flex-basis: 40% !important;\n}\n.monomer-manager-root > div:nth-child(2) {\n flex-basis: 60% !important;\n}\n\n.monomer-manager-root > div:first-child > .ui-form {\n max-width: unset !important;\n}\n\n.monomer-card-info-row {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-row > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-row > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n\n.duplicate-monomer-symbol-row {\n visibility: visible !important;\n}\n\n.monomer-card-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 300px;\n min-width: 200px;\n min-height: 300px;\n}\n\n.duplicate-monomers-virtual-view {\n width: 100% !important;\n overflow-x: clip;\n overflow-y: auto;\n}\n\n.monomer-manager-form-tab-control input.d4-invalid {\n background: #ff000030;\n}","",{version:3,sources:["webpack://./css/monomer-manager.css"],names:[],mappings:"AAAA;IACI,2BAA2B;AAC/B;;AAEA;IACI,sBAAsB;IACtB,uBAAuB;AAC3B;;AAEA;IACI,uBAAuB;AAC3B;;AAEA;IACI,0BAA0B;AAC9B;AACA;IACI,0BAA0B;AAC9B;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,mBAAmB;AACvB;;AAEA;IACI,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;AACrB;;AAEA;IACI,8BAA8B;AAClC;;AAEA;IACI,+BAA+B;IAC/B,kBAAkB;IAClB,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,sBAAsB;IACtB,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,qBAAqB;AACzB",sourcesContent:[".monomer-manager-root .grok-sketcher {\n min-width: unset !important;\n}\n\n.monomer-manager-root {\n width: 100% !important;\n height: 100% !important;\n}\n\n.monomer-manager-sketcher .ketcher-host {\n height: 100% !important;\n} \n\n.monomer-manager-root > div:first-child {\n flex-basis: 40% !important;\n}\n.monomer-manager-root > div:nth-child(2) {\n flex-basis: 60% !important;\n}\n\n.monomer-manager-root > div:first-child > .ui-form {\n max-width: unset !important;\n}\n\n.monomer-card-info-row {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-row > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-row > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n\n.duplicate-monomer-symbol-row {\n visibility: visible !important;\n}\n\n.monomer-card-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 300px;\n min-width: 200px;\n min-height: 300px;\n}\n\n.duplicate-monomers-virtual-view {\n width: 100% !important;\n overflow-x: clip;\n overflow-y: auto;\n}\n\n.monomer-manager-form-tab-control input.d4-invalid {\n background: #ff000030;\n}"],sourceRoot:""}]);const a=i},6369:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".kalign-version {\n margin-bottom: 0;\n text-align: end;\n font-size: 12px;\n opacity: 0.8;\n}\nbutton.msa-params-button.ui-btn {\n justify-content: end;\n}","",{version:3,sources:["webpack://./css/msa.css"],names:[],mappings:"AAAA;IACI,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,YAAY;AAChB;AACA;IACI,oBAAoB;AACxB",sourcesContent:[".kalign-version {\n margin-bottom: 0;\n text-align: end;\n font-size: 12px;\n opacity: 0.8;\n}\nbutton.msa-params-button.ui-btn {\n justify-content: end;\n}"],sourceRoot:""}]);const a=i},7939:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".scatter_plot_link {\n position: absolute!important;\n right: 10px;\n}\n\n.cliffs_grid {\n top: 10px;\n}\n\n.show_only_cliffs {\n top: 30px;\n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings {\n font-size: 18px;\n position: absolute;\n height: 28px;\n \n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings:not(.ml-dim-reduction-column-editor-input-root i) {\n left: -20px;\n}\n.dlg-dimensionality-reduction.ui-form, .dlg-markov-clustering.ui-form, .dlg-markov-clustering.ui-form .ui-form, .dlg-dimensionality-reduction.ui-form .ui-form {\n max-width: unset;\n}\n\n.ml-dim-reduction-column-editor-input-root label {\n display: none !important;\n}\n\n.dim-reduction-dialog-form > .ui-input-root, .dim-reduction-dialog-form > div > .ui-input-root {\n margin-left: 10px;\n}\n\n.ml-dim-reduction-column-editor-input-root input, .ml-dim-reduction-column-editor-input-root select {\n margin-left: 20px !important;\n}\n\nh3.ml-dim-reduction-column-editor-input-root {\n margin: 0 !important;\n}\n\n.ml-dim-reduction-column-editor-root, .ml-dim-reduction-column-editor-header-root {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 10px !important;\n width: 700px !important;\n}\n\n.ml-dim-reduction-column-editor-column-title {\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ml-dim-reduction-column-editor-header-root > h1:not(:first-child) {\n margin-left: 20px !important;\n}\n\n.ml-dim-reduction-column-editor-table-root .header > td:not(:first-child) {\n padding-left: 32px;\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/ml/css/styles.css"],names:[],mappings:"AAAA;IACI,4BAA4B;IAC5B,WAAW;AACf;;AAEA;IACI,SAAS;AACb;;AAEA;IACI,SAAS;AACb;;AAEA;IACI,eAAe;IACf,kBAAkB;IAClB,YAAY;;AAEhB;;AAEA;IACI,WAAW;AACf;AACA;IACI,gBAAgB;AACpB;;AAEA;IACI,wBAAwB;AAC5B;;AAEA;IACI,iBAAiB;AACrB;;AAEA;IACI,4BAA4B;AAChC;;AAEA;IACI,oBAAoB;AACxB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,8BAA8B;IAC9B,uBAAuB;AAC3B;;AAEA;IACI,uBAAuB;IACvB,gBAAgB;AACpB;;AAEA;IACI,4BAA4B;AAChC;;AAEA;IACI,kBAAkB;AACtB",sourcesContent:[".scatter_plot_link {\n position: absolute!important;\n right: 10px;\n}\n\n.cliffs_grid {\n top: 10px;\n}\n\n.show_only_cliffs {\n top: 30px;\n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings {\n font-size: 18px;\n position: absolute;\n height: 28px;\n \n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings:not(.ml-dim-reduction-column-editor-input-root i) {\n left: -20px;\n}\n.dlg-dimensionality-reduction.ui-form, .dlg-markov-clustering.ui-form, .dlg-markov-clustering.ui-form .ui-form, .dlg-dimensionality-reduction.ui-form .ui-form {\n max-width: unset;\n}\n\n.ml-dim-reduction-column-editor-input-root label {\n display: none !important;\n}\n\n.dim-reduction-dialog-form > .ui-input-root, .dim-reduction-dialog-form > div > .ui-input-root {\n margin-left: 10px;\n}\n\n.ml-dim-reduction-column-editor-input-root input, .ml-dim-reduction-column-editor-input-root select {\n margin-left: 20px !important;\n}\n\nh3.ml-dim-reduction-column-editor-input-root {\n margin: 0 !important;\n}\n\n.ml-dim-reduction-column-editor-root, .ml-dim-reduction-column-editor-header-root {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 10px !important;\n width: 700px !important;\n}\n\n.ml-dim-reduction-column-editor-column-title {\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ml-dim-reduction-column-editor-header-root > h1:not(:first-child) {\n margin-left: 20px !important;\n}\n\n.ml-dim-reduction-column-editor-table-root .header > td:not(:first-child) {\n padding-left: 32px;\n}"],sourceRoot:""}]);const a=i},3017:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".monomer-lib-controls-form {\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n}\n","",{version:3,sources:["webpack://./src/utils/monomer-lib/library-file-manager/style.css"],names:[],mappings:"AAAA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,sBAAsB;EACtB,mBAAmB;EACnB,WAAW;AACb",sourcesContent:[".monomer-lib-controls-form {\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n}\n"],sourceRoot:""}]);const a=i},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),t.push(u))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),o="/*# ".concat(s," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},2017:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,s,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(s=r;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=r;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,o[s]))return!1;for(s=r;0!=s--;){var i=o[s];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},9982:function(e,t,n){var r;!function(){var t={};!function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=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(e,n,r,s,o){for(var i,a,c,l,u,d,h,p,m,f,g,y,b;o>=64;){for(i=n[0],a=n[1],c=n[2],l=n[3],u=n[4],d=n[5],h=n[6],p=n[7],f=0;f<16;f++)g=s+4*f,e[f]=(255&r[g])<<24|(255&r[g+1])<<16|(255&r[g+2])<<8|255&r[g+3];for(f=16;f<64;f++)y=((m=e[f-2])>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,b=((m=e[f-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,e[f]=(y+e[f-7]|0)+(b+e[f-16]|0);for(f=0;f<64;f++)y=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&d^~u&h)|0)+(p+(t[f]+e[f]|0)|0)|0,b=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&a^i&c^a&c)|0,p=h,h=d,d=u,u=l+y|0,l=c,c=a,a=i,i=y+b|0;n[0]+=i,n[1]+=a,n[2]+=c,n[3]+=l,n[4]+=u,n[5]+=d,n[6]+=h,n[7]+=p,s+=64,o-=64}return s}var r=function(){function t(){this.digestLength=e.digestLength,this.blockSize=e.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 t.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},t.prototype.clean=function(){for(var e=0;e<this.buffer.length;e++)this.buffer[e]=0;for(e=0;e<this.temp.length;e++)this.temp[e]=0;this.reset()},t.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=t,this.bufferLength>0){for(;this.bufferLength<64&&t>0;)this.buffer[this.bufferLength++]=e[r++],t--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(t>=64&&(r=n(this.temp,this.state,e,r,t),t%=64);t>0;)this.buffer[this.bufferLength++]=e[r++],t--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,r=this.bufferLength,s=t/536870912|0,o=t<<3,i=t%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<i-8;a++)this.buffer[a]=0;this.buffer[i-8]=s>>>24&255,this.buffer[i-7]=s>>>16&255,this.buffer[i-6]=s>>>8&255,this.buffer[i-5]=s>>>0&255,this.buffer[i-4]=o>>>24&255,this.buffer[i-3]=o>>>16&255,this.buffer[i-2]=o>>>8&255,this.buffer[i-1]=o>>>0&255,n(this.temp,this.state,this.buffer,0,i),this.finished=!0}for(a=0;a<8;a++)e[4*a+0]=this.state[a]>>>24&255,e[4*a+1]=this.state[a]>>>16&255,e[4*a+2]=this.state[a]>>>8&255,e[4*a+3]=this.state[a]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t<this.state.length;t++)e[t]=this.state[t]},t.prototype._restoreState=function(e,t){for(var n=0;n<this.state.length;n++)this.state[n]=e[n];this.bytesHashed=t,this.finished=!1,this.bufferLength=0},t}();e.Hash=r;var s=function(){function e(e){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var t=new Uint8Array(this.blockSize);if(e.length>this.blockSize)(new r).update(e).finish(t).clean();else for(var n=0;n<e.length;n++)t[n]=e[n];for(n=0;n<t.length;n++)t[n]^=54;for(this.inner.update(t),n=0;n<t.length;n++)t[n]^=106;for(this.outer.update(t),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<t.length;n++)t[n]=0}return e.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},e.prototype.clean=function(){for(var e=0;e<this.istate.length;e++)this.ostate[e]=this.istate[e]=0;this.inner.clean(),this.outer.clean()},e.prototype.update=function(e){return this.inner.update(e),this},e.prototype.finish=function(e){return this.outer.finished?this.outer.finish(e):(this.inner.finish(e),this.outer.update(e,this.digestLength).finish(e)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e}();function o(e){var t=(new r).update(e),n=t.digest();return t.clean(),n}function i(e,t){var n=new s(e).update(t),r=n.digest();return n.clean(),r}function a(e,t,n,r){var s=r[0];if(0===s)throw new Error("hkdf: cannot expand more");t.reset(),s>1&&t.update(e),n&&t.update(n),t.update(r),t.finish(e),r[0]++}e.HMAC=s,e.hash=o,e.default=o,e.hmac=i;var c=new Uint8Array(e.digestLength);e.hkdf=function(e,t,n,r){void 0===t&&(t=c),void 0===r&&(r=32);for(var o=new Uint8Array([1]),l=i(t,e),u=new s(l),d=new Uint8Array(u.digestLength),h=d.length,p=new Uint8Array(r),m=0;m<r;m++)h===d.length&&(a(d,u,n,o),h=0),p[m]=d[h++];return u.clean(),d.fill(0),o.fill(0),p},e.pbkdf2=function(e,t,n,r){for(var o=new s(e),i=o.digestLength,a=new Uint8Array(4),c=new Uint8Array(i),l=new Uint8Array(i),u=new Uint8Array(r),d=0;d*i<r;d++){var h=d+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,o.reset(),o.update(t),o.update(a),o.finish(l);for(var p=0;p<i;p++)c[p]=l[p];for(p=2;p<=n;p++){o.reset(),o.update(l).finish(l);for(var m=0;m<i;m++)c[m]^=l[m]}for(p=0;p<i&&d*i+p<r;p++)u[d*i+p]=c[p]}for(d=0;d<i;d++)c[d]=l[d]=0;for(d=0;d<4;d++)a[d]=0;return o.clean(),u}}(t);var s=t.default;for(var o in t)s[o]=t[o];"object"==typeof e.exports?e.exports=s:void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()},2787:(e,t,n)=>{"use strict";n.d(t,{I:()=>s});const r=new Uint32Array(65536),s=(e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return 0===t.length?e.length:e.length<=32?((e,t)=>{const n=e.length,s=t.length,o=1<<n-1;let i=-1,a=0,c=n,l=n;for(;l--;)r[e.charCodeAt(l)]|=1<<l;for(l=0;l<s;l++){let e=r[t.charCodeAt(l)];const n=e|a;e|=(e&i)+i^i,a|=~(e|i),i&=e,a&o&&c++,i&o&&c--,a=a<<1|1,i=i<<1|~(n|a),a&=n}for(l=n;l--;)r[e.charCodeAt(l)]=0;return c})(e,t):((e,t)=>{const n=t.length,s=e.length,o=[],i=[],a=Math.ceil(n/32),c=Math.ceil(s/32);for(let e=0;e<a;e++)i[e]=-1,o[e]=0;let l=0;for(;l<c-1;l++){let a=0,c=-1;const u=32*l,d=Math.min(32,s)+u;for(let t=u;t<d;t++)r[e.charCodeAt(t)]|=1<<t;for(let e=0;e<n;e++){const n=r[t.charCodeAt(e)],s=i[e/32|0]>>>e&1,l=o[e/32|0]>>>e&1,u=n|a,d=((n|l)&c)+c^c|n|l;let h=a|~(d|c),p=c&d;h>>>31^s&&(i[e/32|0]^=1<<e),p>>>31^l&&(o[e/32|0]^=1<<e),h=h<<1|s,p=p<<1|l,c=p|~(u|h),a=h&u}for(let t=u;t<d;t++)r[e.charCodeAt(t)]=0}let u=0,d=-1;const h=32*l,p=Math.min(32,s-h)+h;for(let t=h;t<p;t++)r[e.charCodeAt(t)]|=1<<t;let m=s;for(let e=0;e<n;e++){const n=r[t.charCodeAt(e)],a=i[e/32|0]>>>e&1,c=o[e/32|0]>>>e&1,l=n|u,h=((n|c)&d)+d^d|n|c;let p=u|~(h|d),f=d&h;m+=p>>>s-1&1,m-=f>>>s-1&1,p>>>31^a&&(i[e/32|0]^=1<<e),f>>>31^c&&(o[e/32|0]^=1<<e),p=p<<1|a,f=f<<1|c,d=f|~(l|p),u=p&l}for(let t=h;t<p;t++)r[e.charCodeAt(t)]=0;return m})(e,t)}},9937:e=>{e.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}},1782:(e,t)=>{t.assign=function(e){e=e||{};var t,n,r,s=Array.prototype.slice.call(arguments).slice(1);for(t=0,r=s.length;t<r;t++)if(s[t])for(n in s[t])e[n]=s[t][n];return e},t.validateSettings=function(e){return"linLogMode"in e&&"boolean"!=typeof e.linLogMode?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in e&&"boolean"!=typeof e.outboundAttractionDistribution?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in e&&"boolean"!=typeof e.adjustSizes?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in e&&"number"!=typeof e.edgeWeightInfluence?{message:"the `edgeWeightInfluence` setting should be a number."}:!("scalingRatio"in e)||"number"==typeof e.scalingRatio&&e.scalingRatio>=0?"strongGravityMode"in e&&"boolean"!=typeof e.strongGravityMode?{message:"the `strongGravityMode` setting should be a boolean."}:!("gravity"in e)||"number"==typeof e.gravity&&e.gravity>=0?"slowDown"in e&&!("number"==typeof e.slowDown||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in e&&"boolean"!=typeof e.barnesHutOptimize?{message:"the `barnesHutOptimize` setting should be a boolean."}:!("barnesHutTheta"in e)||"number"==typeof e.barnesHutTheta&&e.barnesHutTheta>=0?null:{message:"the `barnesHutTheta` setting should be a number >= 0."}:{message:"the `gravity` setting should be a number >= 0."}:{message:"the `scalingRatio` setting should be a number >= 0."}},t.graphToByteArrays=function(e,t){var n,r=e.order,s=e.size,o={},i=new Float32Array(10*r),a=new Float32Array(3*s);return n=0,e.forEachNode((function(e,t){o[e]=n,i[n]=t.x,i[n+1]=t.y,i[n+2]=0,i[n+3]=0,i[n+4]=0,i[n+5]=0,i[n+6]=1,i[n+7]=1,i[n+8]=t.size||1,i[n+9]=t.fixed?1:0,n+=10})),n=0,e.forEachEdge((function(e,r,s,c,l,u,d){var h=o[s],p=o[c],m=t(e,r,s,c,l,u,d);i[h+6]+=m,i[p+6]+=m,a[n]=h,a[n+1]=p,a[n+2]=m,n+=3})),{nodes:i,edges:a}},t.assignLayoutChanges=function(e,t,n){var r=0;e.updateEachNodeAttributes((function(e,s){return s.x=t[r],s.y=t[r+1],r+=10,n?n(e,s):s}))},t.readGraphPositions=function(e,t){var n=0;e.forEachNode((function(e,r){t[n]=r.x,t[n+1]=r.y,n+=10}))},t.collectLayoutChanges=function(e,t,n){for(var r=e.nodes(),s={},o=0,i=0,a=t.length;o<a;o+=10){if(n){var c=Object.assign({},e.getNodeAttributes(r[i]));c.x=t[o],c.y=t[o+1],c=n(r[i],c),s[r[i]]={x:c.x,y:c.y}}else s[r[i]]={x:t[o],y:t[o+1]};i++}return s},t.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),s=new Worker(r);return t.revokeObjectURL(r),s}},8903:(e,t,n)=>{var r=n(1736),s=n(8153).Fd,o=n(2561),i=n(1782),a=n(9937);function c(e,t,n){if(!r(t))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");"number"==typeof n&&(n={iterations:n});var c=n.iterations;if("number"!=typeof c)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(c<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var l=s("getEdgeWeight"in n?n.getEdgeWeight:"weight").fromEntry,u="function"==typeof n.outputReducer?n.outputReducer:null,d=i.assign({},a,n.settings),h=i.validateSettings(d);if(h)throw new Error("graphology-layout-forceatlas2: "+h.message);var p,m=i.graphToByteArrays(t,l);for(p=0;p<c;p++)o(d,m.nodes,m.edges);if(!e)return i.collectLayoutChanges(t,m.nodes);i.assignLayoutChanges(t,m.nodes,u)}var l=c.bind(null,!1);l.assign=c.bind(null,!0),l.inferSettings=function(e){var t="number"==typeof e?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}},e.exports=l},2561:e=>{var t=10;e.exports=function(e,n,r){var s,o,i,a,c,l,u,d,h,p,m,f,g,y,b,w,v,A,E,T,C,S,_,P=n.length,N=r.length,M=e.adjustSizes,x=e.barnesHutTheta*e.barnesHutTheta,$=[];for(i=0;i<P;i+=t)n[i+4]=n[i+2],n[i+5]=n[i+3],n[i+2]=0,n[i+3]=0;if(e.outboundAttractionDistribution){for(m=0,i=0;i<P;i+=t)m+=n[i+6];m/=P/t}if(e.barnesHutOptimize){var L,I,R,O=1/0,k=-1/0,G=1/0,D=-1/0;for(i=0;i<P;i+=t)O=Math.min(O,n[i+0]),k=Math.max(k,n[i+0]),G=Math.min(G,n[i+1]),D=Math.max(D,n[i+1]);var H=k-O,F=D-G;for(H>F?D=(G-=(H-F)/2)+H:k=(O-=(F-H)/2)+F,$[0]=-1,$[1]=(O+k)/2,$[2]=(G+D)/2,$[3]=Math.max(k-O,D-G),$[4]=-1,$[5]=-1,$[6]=0,$[7]=0,$[8]=0,s=1,i=0;i<P;i+=t)for(o=0,R=3;;){if(!($[o+5]>=0)){if($[o+0]<0){$[o+0]=i;break}if($[o+5]=9*s,d=$[o+3]/2,$[(h=$[o+5])+0]=-1,$[h+1]=$[o+1]-d,$[h+2]=$[o+2]-d,$[h+3]=d,$[h+4]=h+9,$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,$[(h+=9)+0]=-1,$[h+1]=$[o+1]-d,$[h+2]=$[o+2]+d,$[h+3]=d,$[h+4]=h+9,$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,$[(h+=9)+0]=-1,$[h+1]=$[o+1]+d,$[h+2]=$[o+2]-d,$[h+3]=d,$[h+4]=h+9,$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,$[(h+=9)+0]=-1,$[h+1]=$[o+1]+d,$[h+2]=$[o+2]+d,$[h+3]=d,$[h+4]=$[o+4],$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,s+=4,L=n[$[o+0]+0]<$[o+1]?n[$[o+0]+1]<$[o+2]?$[o+5]:$[o+5]+9:n[$[o+0]+1]<$[o+2]?$[o+5]+18:$[o+5]+27,$[o+6]=n[$[o+0]+6],$[o+7]=n[$[o+0]+0],$[o+8]=n[$[o+0]+1],$[L+0]=$[o+0],$[o+0]=-1,L===(I=n[i+0]<$[o+1]?n[i+1]<$[o+2]?$[o+5]:$[o+5]+9:n[i+1]<$[o+2]?$[o+5]+18:$[o+5]+27)){if(R--){o=L;continue}R=3;break}$[I+0]=i;break}L=n[i+0]<$[o+1]?n[i+1]<$[o+2]?$[o+5]:$[o+5]+9:n[i+1]<$[o+2]?$[o+5]+18:$[o+5]+27,$[o+7]=($[o+7]*$[o+6]+n[i+0]*n[i+6])/($[o+6]+n[i+6]),$[o+8]=($[o+8]*$[o+6]+n[i+1]*n[i+6])/($[o+6]+n[i+6]),$[o+6]+=n[i+6],o=L}}if(e.barnesHutOptimize){for(f=e.scalingRatio,i=0;i<P;i+=t)for(o=0;;)if($[o+5]>=0){if(w=Math.pow(n[i+0]-$[o+7],2)+Math.pow(n[i+1]-$[o+8],2),4*(p=$[o+3])*p/w<x){if(g=n[i+0]-$[o+7],y=n[i+1]-$[o+8],!0===M?w>0?(v=f*n[i+6]*$[o+6]/w,n[i+2]+=g*v,n[i+3]+=y*v):w<0&&(v=-f*n[i+6]*$[o+6]/Math.sqrt(w),n[i+2]+=g*v,n[i+3]+=y*v):w>0&&(v=f*n[i+6]*$[o+6]/w,n[i+2]+=g*v,n[i+3]+=y*v),(o=$[o+4])<0)break;continue}o=$[o+5]}else if((l=$[o+0])>=0&&l!==i&&(w=(g=n[i+0]-n[l+0])*g+(y=n[i+1]-n[l+1])*y,!0===M?w>0?(v=f*n[i+6]*n[l+6]/w,n[i+2]+=g*v,n[i+3]+=y*v):w<0&&(v=-f*n[i+6]*n[l+6]/Math.sqrt(w),n[i+2]+=g*v,n[i+3]+=y*v):w>0&&(v=f*n[i+6]*n[l+6]/w,n[i+2]+=g*v,n[i+3]+=y*v)),(o=$[o+4])<0)break}else for(f=e.scalingRatio,a=0;a<P;a+=t)for(c=0;c<a;c+=t)g=n[a+0]-n[c+0],y=n[a+1]-n[c+1],!0===M?(w=Math.sqrt(g*g+y*y)-n[a+8]-n[c+8])>0?(v=f*n[a+6]*n[c+6]/w/w,n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v):w<0&&(v=100*f*n[a+6]*n[c+6],n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v):(w=Math.sqrt(g*g+y*y))>0&&(v=f*n[a+6]*n[c+6]/w/w,n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v);for(h=e.gravity/e.scalingRatio,f=e.scalingRatio,i=0;i<P;i+=t)v=0,g=n[i+0],y=n[i+1],w=Math.sqrt(Math.pow(g,2)+Math.pow(y,2)),e.strongGravityMode?w>0&&(v=f*n[i+6]*h):w>0&&(v=f*n[i+6]*h/w),n[i+2]-=g*v,n[i+3]-=y*v;for(f=1*(e.outboundAttractionDistribution?m:1),u=0;u<N;u+=3)a=r[u+0],c=r[u+1],d=r[u+2],b=Math.pow(d,e.edgeWeightInfluence),g=n[a+0]-n[c+0],y=n[a+1]-n[c+1],!0===M?(w=Math.sqrt(g*g+y*y)-n[a+8]-n[c+8],e.linLogMode?e.outboundAttractionDistribution?w>0&&(v=-f*b*Math.log(1+w)/w/n[a+6]):w>0&&(v=-f*b*Math.log(1+w)/w):e.outboundAttractionDistribution?w>0&&(v=-f*b/n[a+6]):w>0&&(v=-f*b)):(w=Math.sqrt(Math.pow(g,2)+Math.pow(y,2)),e.linLogMode?e.outboundAttractionDistribution?w>0&&(v=-f*b*Math.log(1+w)/w/n[a+6]):w>0&&(v=-f*b*Math.log(1+w)/w):e.outboundAttractionDistribution?(w=1,v=-f*b/n[a+6]):(w=1,v=-f*b)),w>0&&(n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v);if(!0===M)for(i=0;i<P;i+=t)1!==n[i+9]&&((A=Math.sqrt(Math.pow(n[i+2],2)+Math.pow(n[i+3],2)))>10&&(n[i+2]=10*n[i+2]/A,n[i+3]=10*n[i+3]/A),E=n[i+6]*Math.sqrt((n[i+4]-n[i+2])*(n[i+4]-n[i+2])+(n[i+5]-n[i+3])*(n[i+5]-n[i+3])),T=Math.sqrt((n[i+4]+n[i+2])*(n[i+4]+n[i+2])+(n[i+5]+n[i+3])*(n[i+5]+n[i+3]))/2,C=.1*Math.log(1+T)/(1+Math.sqrt(E)),S=n[i+0]+n[i+2]*(C/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(C/e.slowDown),n[i+1]=_);else for(i=0;i<P;i+=t)1!==n[i+9]&&(E=n[i+6]*Math.sqrt((n[i+4]-n[i+2])*(n[i+4]-n[i+2])+(n[i+5]-n[i+3])*(n[i+5]-n[i+3])),T=Math.sqrt((n[i+4]+n[i+2])*(n[i+4]+n[i+2])+(n[i+5]+n[i+3])*(n[i+5]+n[i+3]))/2,C=n[i+7]*Math.log(1+T)/(1+Math.sqrt(E)),n[i+7]=Math.min(1,Math.sqrt(C*(Math.pow(n[i+2],2)+Math.pow(n[i+3],2))/(1+Math.sqrt(E)))),S=n[i+0]+n[i+2]*(C/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(C/e.slowDown),n[i+1]=_);return{}}},8153:(e,t)=>{function n(e){return"number"!=typeof e||isNaN(e)?1:e}t.Fd=function(e){return function(e,t){var n={},r=function(e){return void 0===e?t:e};"function"==typeof t&&(r=t);var s=function(t){return r(t[e])},o=function(){return r(void 0)};return"string"==typeof e?(n.fromAttributes=s,n.fromGraph=function(e,t){return s(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return s(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):"function"==typeof e?(n.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},n.fromGraph=function(t,n){var s=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),s[0],s[1],t.getNodeAttributes(s[0]),t.getNodeAttributes(s[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,s,o,i,a,c){return r(e(t,n,s,o,i,a,c))},n.fromPartialEntry=function(t,n,s,o){return r(e(t,n,s,o))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=o,n.fromGraph=o,n.fromEntry=o,n.fromMinimalEntry=o),n}(e,n)}},1736:e=>{e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNode&&"boolean"==typeof e.multi}},934:function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function s(e,t,n){return s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var s=[null];s.push.apply(s,t);var o=new(Function.bind.apply(e,s));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||(o=e,-1===Function.toString.call(o).indexOf("[native code]")))return e;var o;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return s(e,arguments,n(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)},o(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var a=function(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var r in arguments[t])e[r]=arguments[t][r];return e};function c(e,t,n,r){var s=e._nodes.get(t),o=null;return s?o="mixed"===r?s.out&&s.out[n]||s.undirected&&s.undirected[n]:"directed"===r?s.out&&s.out[n]:s.undirected&&s.undirected[n]:o}function l(t){return"object"===e(t)&&null!==t}function u(e){var t;for(t in e)return!1;return!0}function d(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function h(e,t,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function p(e){return!(!l(e)||e.attributes&&!Array.isArray(e.attributes))}"function"==typeof Object.assign&&(a=Object.assign);var m,f={exports:{}},g="object"==typeof Reflect?Reflect:null,y=g&&"function"==typeof g.apply?g.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};m=g&&"function"==typeof g.ownKeys?g.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var b=Number.isNaN||function(e){return e!=e};function w(){w.init.call(this)}f.exports=w,f.exports.once=function(e,t){return new Promise((function(n,r){function s(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),n([].slice.call(arguments))}M(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&M(e,"error",t,{once:!0})}(e,s)}))},w.EventEmitter=w,w.prototype._events=void 0,w.prototype._eventsCount=0,w.prototype._maxListeners=void 0;var v=10;function A(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function E(e){return void 0===e._maxListeners?w.defaultMaxListeners:e._maxListeners}function T(e,t,n,r){var s,o,i,a;if(A(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),void 0===i)i=o[t]=n,++e._eventsCount;else if("function"==typeof i?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(s=E(e))>0&&i.length>s&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,a=c,console&&console.warn&&console.warn(a)}return e}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function S(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=C.bind(r);return s.listener=n,r.wrapFn=s,s}function _(e,t,n){var r=e._events;if(void 0===r)return[];var s=r[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(s):N(s,s.length)}function P(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function N(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function M(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(o){r.once&&e.removeEventListener(t,s),n(o)}))}}function x(e){if("function"!=typeof e)throw new Error("obliterator/iterator: expecting a function!");this.next=e}Object.defineProperty(w,"defaultMaxListeners",{enumerable:!0,get:function(){return v},set:function(e){if("number"!=typeof e||e<0||b(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");v=e}}),w.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},w.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||b(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},w.prototype.getMaxListeners=function(){return E(this)},w.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var i=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw i.context=o,i}var a=s[e];if(void 0===a)return!1;if("function"==typeof a)y(a,this,t);else{var c=a.length,l=N(a,c);for(n=0;n<c;++n)y(l[n],this,t)}return!0},w.prototype.addListener=function(e,t){return T(this,e,t,!1)},w.prototype.on=w.prototype.addListener,w.prototype.prependListener=function(e,t){return T(this,e,t,!0)},w.prototype.once=function(e,t){return A(t),this.on(e,S(this,e,t)),this},w.prototype.prependOnceListener=function(e,t){return A(t),this.prependListener(e,S(this,e,t)),this},w.prototype.removeListener=function(e,t){var n,r,s,o,i;if(A(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){i=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,s),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,i||t)}return this},w.prototype.off=w.prototype.removeListener,w.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var s,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(s=o[r])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},w.prototype.listeners=function(e){return _(this,e,!0)},w.prototype.rawListeners=function(e){return _(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):P.call(e,t)},w.prototype.listenerCount=P,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},"undefined"!=typeof Symbol&&(x.prototype[Symbol.iterator]=function(){return this}),x.of=function(){var e=arguments,t=e.length,n=0;return new x((function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}}))},x.empty=function(){return new x((function(){return{done:!0}}))},x.fromSequence=function(e){var t=0,n=e.length;return new x((function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}}))},x.is=function(e){return e instanceof x||"object"==typeof e&&null!==e&&"function"==typeof e.next};var $=x,L={};L.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,L.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var I=$,R=L,O=R.ARRAY_BUFFER_SUPPORT,k=R.SYMBOL_SUPPORT,G=function(e){var t=function(e){return"string"==typeof e||Array.isArray(e)||O&&ArrayBuffer.isView(e)?I.fromSequence(e):"object"!=typeof e||null===e?null:k&&"function"==typeof e[Symbol.iterator]?e[Symbol.iterator]():"function"==typeof e.next?e:null}(e);if(!t)throw new Error("obliterator: target is not iterable nor a valid iterator.");return t},D=G,H=function(e,t){for(var n,r=arguments.length>1?t:1/0,s=r!==1/0?new Array(r):[],o=0,i=D(e);;){if(o===r)return s;if((n=i.next()).done)return o!==t&&(s.length=o),s;s[o++]=n.value}},F=function(e){function n(t){var n;return(n=e.call(this)||this).name="GraphError",n.message=t,n}return t(n,e),n}(o(Error)),V=function(e){function n(t){var r;return(r=e.call(this,t)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i(r),n.prototype.constructor),r}return t(n,e),n}(F),U=function(e){function n(t){var r;return(r=e.call(this,t)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i(r),n.prototype.constructor),r}return t(n,e),n}(F),Y=function(e){function n(t){var r;return(r=e.call(this,t)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i(r),n.prototype.constructor),r}return t(n,e),n}(F);function B(e,t){this.key=e,this.attributes=t,this.clear()}function W(e,t){this.key=e,this.attributes=t,this.clear()}function j(e,t){this.key=e,this.attributes=t,this.clear()}function K(e,t,n,r,s){this.key=t,this.attributes=s,this.undirected=e,this.source=n,this.target=r}function q(e,t,n,r,s,o,i){var a,c,l,u;if(r=""+r,0===n){if(!(a=e._nodes.get(r)))throw new U("Graph.".concat(t,': could not find the "').concat(r,'" node in the graph.'));l=s,u=o}else if(3===n){if(s=""+s,!(c=e._edges.get(s)))throw new U("Graph.".concat(t,': could not find the "').concat(s,'" edge in the graph.'));var d=c.source.key,h=c.target.key;if(r===d)a=c.target;else{if(r!==h)throw new U("Graph.".concat(t,': the "').concat(r,'" node is not attached to the "').concat(s,'" edge (').concat(d,", ").concat(h,")."));a=c.source}l=o,u=i}else{if(!(c=e._edges.get(r)))throw new U("Graph.".concat(t,': could not find the "').concat(r,'" edge in the graph.'));a=1===n?c.source:c.target,l=s,u=o}return[a,l,u]}B.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},W.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},j.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},K.prototype.attach=function(){var e="out",t="in";this.undirected&&(e=t="undirected");var n=this.source.key,r=this.target.key;this.source[e][r]=this,this.undirected&&n===r||(this.target[t][n]=this)},K.prototype.attachMulti=function(){var e="out",t="in",n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");var s=this.source[e],o=s[r];if(void 0===o)return s[r]=this,void(this.undirected&&n===r||(this.target[t][n]=this));o.previous=this,this.next=o,s[r]=this,this.target[t][n]=this},K.prototype.detach=function(){var e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]},K.prototype.detachMulti=function(){var e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous))};var z=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];return i.attributes[a]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){return q(this,t,n,e,r)[0].attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];return i.attributes.hasOwnProperty(a)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s,o){var i=q(this,t,n,e,r,s,o),a=i[0],c=i[1],l=i[2];return a.attributes[c]=l,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s,o){var i=q(this,t,n,e,r,s,o),a=i[0],c=i[1],l=i[2];if("function"!=typeof l)throw new V("Graph.".concat(t,": updater should be a function."));var u=a.attributes,d=l(u[c]);return u[c]=d,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];return delete i.attributes[a],this.emit("nodeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];if(!l(a))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return i.attributes=a,this.emit("nodeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],c=o[1];if(!l(c))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return a(i.attributes,c),this.emit("nodeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:c}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];if("function"!=typeof a)throw new V("Graph.".concat(t,": provided updater is not a function."));return i.attributes=a(i.attributes),this.emit("nodeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}}],Z=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return s.attributes[r]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,o=""+arguments[1];if(!(r=c(this,s,o,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return r.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return s.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+r;if(r=arguments[2],s=arguments[3],!(o=c(this,i,a,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return o.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+r;if(r=arguments[2],s=arguments[3],!(o=c(this,i,a,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof s)throw new V("Graph.".concat(t,": updater should be a function."));return o.attributes[r]=s(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if(!l(r))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if(!l(r))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return a(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof r)throw new V("Graph.".concat(t,": provided updater is not a function."));return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}}],X=$,Q=G,J=function(){var e=arguments,t=null,n=-1;return new X((function(){for(var r=null;;){if(null===t){if(++n>=e.length)return{done:!0};t=Q(e[n])}if(!0!==(r=t.next()).done)break;t=null}return r}))},ee=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function te(e,t,n,r){var s=!1;for(var o in t)if(o!==r){var i=t[o];if(s=n(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&s)return i.key}}function ne(e,t,n,r){var s,o,i,a=!1;for(var c in t)if(c!==r){s=t[c];do{if(o=s.source,i=s.target,a=n(s.key,s.attributes,o.key,i.key,o.attributes,i.attributes,s.undirected),e&&a)return s.key;s=s.next}while(void 0!==s)}}function re(e,t){var n,r=Object.keys(e),s=r.length,o=0;return new $((function(){do{if(n)n=n.next;else{if(o>=s)return{done:!0};var i=r[o++];if(i===t){n=void 0;continue}n=e[i]}}while(!n);return{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function se(e,t,n,r){var s=t[n];if(s){var o=s.source,i=s.target;return r(s.key,s.attributes,o.key,i.key,o.attributes,i.attributes,s.undirected)&&e?s.key:void 0}}function oe(e,t,n,r){var s=t[n];if(s){var o=!1;do{if(o=r(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&o)return s.key;s=s.next}while(void 0!==s)}}function ie(e,t){var n=e[t];return void 0!==n.next?new $((function(){if(!n)return{done:!0};var e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}})):$.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function ae(e,t,n,r){if(0!==t.size)for(var s,o,i="mixed"!==n&&n!==t.type,a="undirected"===n,c=!1,l=t._edges.values();!0!==(s=l.next()).done;)if(o=s.value,!i||o.undirected===a){var u=o,d=u.key,h=u.attributes,p=u.source,m=u.target;if(c=r(d,h,p.key,m.key,p.attributes,m.attributes,o.undirected),e&&c)return d}}function ce(e,t,n,r,s,o){var i,a=t?ne:te;if("undirected"!==n){if("out"!==r&&(i=a(e,s.in,o),e&&i))return i;if("in"!==r&&(i=a(e,s.out,o,r?void 0:s.key),e&&i))return i}if("directed"!==n&&(i=a(e,s.undirected,o),e&&i))return i}function le(e,t,n,r,s,o,i){var a,c=n?oe:se;if("undirected"!==t){if(void 0!==s.in&&"out"!==r&&(a=c(e,s.in,o,i),e&&a))return a;if(void 0!==s.out&&"in"!==r&&(r||s.key!==o)&&(a=c(e,s.out,o,i),e&&a))return a}if("directed"!==t&&void 0!==s.undirected&&(a=c(e,s.undirected,o,i),e&&a))return a}var ue=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function de(){this.A=null,this.B=null}function he(e,t,n,r,s){for(var o in r){var i=r[o],a=i.source,c=i.target,l=a===n?c:a;if(!t||!t.has(l.key)){var u=s(l.key,l.attributes);if(e&&u)return l.key}}}function pe(e,t,n,r,s){if("mixed"!==t){if("undirected"===t)return he(e,null,r,r.undirected,s);if("string"==typeof n)return he(e,null,r,r[n],s)}var o,i=new de;if("undirected"!==t){if("out"!==n){if(o=he(e,null,r,r.in,s),e&&o)return o;i.wrap(r.in)}if("in"!==n){if(o=he(e,i,r,r.out,s),e&&o)return o;i.wrap(r.out)}}if("directed"!==t&&(o=he(e,i,r,r.undirected,s),e&&o))return o}function me(e,t,n){var r=Object.keys(n),s=r.length,o=0;return new $((function(){var i=null;do{if(o>=s)return e&&e.wrap(n),{done:!0};var a=n[r[o++]],c=a.source,l=a.target;i=c===t?l:c,e&&e.has(i.key)&&(i=null)}while(null===i);return{done:!1,value:{neighbor:i.key,attributes:i.attributes}}}))}function fe(e,t,n,r,s){for(var o,i,a,c,l,u,d,h=r._nodes.values(),p=r.type;!0!==(o=h.next()).done;){var m=!1;if(i=o.value,"undirected"!==p)for(a in c=i.out){l=c[a];do{if(u=l.target,m=!0,d=s(i.key,u.key,i.attributes,u.attributes,l.key,l.attributes,l.undirected),e&&d)return l;l=l.next}while(l)}if("directed"!==p)for(a in c=i.undirected)if(!(t&&i.key>a)){l=c[a];do{if((u=l.target).key!==a&&(u=l.source),m=!0,d=s(i.key,u.key,i.attributes,u.attributes,l.key,l.attributes,l.undirected),e&&d)return l;l=l.next}while(l)}if(n&&!m&&(d=s(i.key,null,i.attributes,null,null,null,null),e&&d))return null}}function ge(e){if(!l(e))throw new V('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new V("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!l(e.attributes)||null===e.attributes))throw new V("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function ye(e){if(!l(e))throw new V('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new V("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new V("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!l(e.attributes)||null===e.attributes))throw new V("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&"boolean"!=typeof e.undirected)throw new V("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}de.prototype.wrap=function(e){null===this.A?this.A=e:null===this.B&&(this.B=e)},de.prototype.has=function(e){return null!==this.A&&e in this.A||null!==this.B&&e in this.B};var be,we=(be=255&Math.floor(256*Math.random()),function(){return be++}),ve=new Set(["directed","undirected","mixed"]),Ae=new Set(["domain","_events","_eventsCount","_maxListeners"]),Ee={allowSelfLoops:!0,multi:!1,type:"mixed"};function Te(e,t,n){var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function Ce(e,t,n,r,s,o,i,a){if(!r&&"undirected"===e.type)throw new Y("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new Y("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a&&!l(a))throw new V("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(a,'"'));if(o=""+o,i=""+i,a=a||{},!e.allowSelfLoops&&o===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var c=e._nodes.get(o),u=e._nodes.get(i);if(!c)throw new U("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!u)throw new U("Graph.".concat(t,': target node "').concat(i,'" not found.'));var d={key:null,undirected:r,source:o,target:i,attributes:a};if(n)s=e._edgeKeyGenerator();else if(s=""+s,e._edges.has(s))throw new Y("Graph.".concat(t,': the "').concat(s,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==c.undirected[i]:void 0!==c.out[i]))throw new Y("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(i,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var h=new K(r,s,c,u,a);e._edges.set(s,h);var p=o===i;return r?(c.undirectedDegree++,u.undirectedDegree++,p&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,u.inDegree++,p&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),r?e._undirectedSize++:e._directedSize++,d.key=s,e.emit("edgeAdded",d),s}function Se(e,t,n,r,s,o,i,c,u){if(!r&&"undirected"===e.type)throw new Y("Graph.".concat(t,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new Y("Graph.".concat(t,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(c)if(u){if("function"!=typeof c)throw new V("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(c,'"'))}else if(!l(c))throw new V("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));var d;if(o=""+o,i=""+i,u&&(d=c,c=void 0),!e.allowSelfLoops&&o===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var h,p,m=e._nodes.get(o),f=e._nodes.get(i);if(!n&&(h=e._edges.get(s))){if(!(h.source.key===o&&h.target.key===i||r&&h.source.key===i&&h.target.key===o))throw new Y("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(s,'" edge with "').concat(o,'" source & "').concat(i,'" target vs. ("').concat(h.source.key,'", "').concat(h.target.key,'").'));p=h}if(p||e.multi||!m||(p=r?m.undirected[i]:m.out[i]),p){var g=[p.key,!1,!1,!1];if(u?!d:!c)return g;if(u){var y=p.attributes;p.attributes=d(y),e.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else a(p.attributes,c),e.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:c});return g}c=c||{},u&&d&&(c=d(c));var b={key:null,undirected:r,source:o,target:i,attributes:c};if(n)s=e._edgeKeyGenerator();else if(s=""+s,e._edges.has(s))throw new Y("Graph.".concat(t,': the "').concat(s,'" edge already exists in the graph.'));var w=!1,v=!1;m||(m=Te(e,o,{}),w=!0,o===i&&(f=m,v=!0)),f||(f=Te(e,i,{}),v=!0),h=new K(r,s,m,f,c),e._edges.set(s,h);var A=o===i;return r?(m.undirectedDegree++,f.undirectedDegree++,A&&(m.undirectedLoops++,e._undirectedSelfLoopCount++)):(m.outDegree++,f.inDegree++,A&&(m.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),r?e._undirectedSize++:e._directedSize++,b.key=s,e.emit("edgeAdded",b),[s,!0,w,v]}function _e(e,t){e._edges.delete(t.key);var n=t.source,r=t.target,s=t.attributes,o=t.undirected,i=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,i&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,i&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:s,source:n.key,target:r.key,undirected:o})}var Pe=function(n){function r(e){var t;if(t=n.call(this)||this,"boolean"!=typeof(e=a({},Ee,e)).multi)throw new V("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!ve.has(e.type))throw new V('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new V("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var r="mixed"===e.type?B:"directed"===e.type?W:j;d(i(t),"NodeDataClass",r);var s="geid_"+we()+"_",o=0;return d(i(t),"_attributes",{}),d(i(t),"_nodes",new Map),d(i(t),"_edges",new Map),d(i(t),"_directedSize",0),d(i(t),"_undirectedSize",0),d(i(t),"_directedSelfLoopCount",0),d(i(t),"_undirectedSelfLoopCount",0),d(i(t),"_edgeKeyGenerator",(function(){var e;do{e=s+o++}while(t._edges.has(e));return e})),d(i(t),"_options",e),Ae.forEach((function(e){return d(i(t),e,t[e])})),h(i(t),"order",(function(){return t._nodes.size})),h(i(t),"size",(function(){return t._edges.size})),h(i(t),"directedSize",(function(){return t._directedSize})),h(i(t),"undirectedSize",(function(){return t._undirectedSize})),h(i(t),"selfLoopCount",(function(){return t._directedSelfLoopCount+t._undirectedSelfLoopCount})),h(i(t),"directedSelfLoopCount",(function(){return t._directedSelfLoopCount})),h(i(t),"undirectedSelfLoopCount",(function(){return t._undirectedSelfLoopCount})),h(i(t),"multi",t._options.multi),h(i(t),"type",t._options.type),h(i(t),"allowSelfLoops",t._options.allowSelfLoops),h(i(t),"implementation",(function(){return"graphology"})),t}t(r,n);var s=r.prototype;return s._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},s.hasNode=function(e){return this._nodes.has(""+e)},s.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&!r.undirected}if(2===arguments.length){e=""+e,t=""+t;var s=this._nodes.get(e);return!!s&&s.out.hasOwnProperty(t)}throw new V("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},s.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r.undirected}if(2===arguments.length){e=""+e,t=""+t;var s=this._nodes.get(e);return!!s&&s.undirected.hasOwnProperty(t)}throw new V("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},s.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);return!!r&&(void 0!==r.out&&r.out.hasOwnProperty(t)||void 0!==r.undirected&&r.undirected.hasOwnProperty(t))}throw new V("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},s.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new Y("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new U('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},s.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new Y("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new U('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},s.edge=function(e,t){if(this.multi)throw new Y("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},s.areDirectedNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areDirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&(t in n.in||t in n.out)},s.areOutNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areOutNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.out},s.areInNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areInNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.in},s.areUndirectedNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areUndirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"directed"!==this.type&&t in n.undirected},s.areNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&(t in n.in||t in n.out)||"directed"!==this.type&&t in n.undirected},s.areInboundNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areInboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.in||"directed"!==this.type&&t in n.undirected},s.areOutboundNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areOutboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.out||"directed"!==this.type&&t in n.undirected},s.inDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree},s.outDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.outDegree},s.directedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree+t.outDegree},s.undirectedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:t.undirectedDegree},s.inboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inboundDegree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.inDegree),n},s.outboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outboundDegree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.outDegree),n},s.degree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.inDegree+t.outDegree),n},s.inDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree-t.directedLoops},s.outDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.outDegree-t.directedLoops},s.directedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree+t.outDegree-2*t.directedLoops},s.undirectedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:t.undirectedDegree-2*t.undirectedLoops},s.inboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=t.undirectedDegree,r+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.inDegree,r+=t.directedLoops),n-r},s.outboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=t.undirectedDegree,r+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.outDegree,r+=t.directedLoops),n-r},s.degreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.degreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=t.undirectedDegree,r+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.inDegree+t.outDegree,r+=2*t.directedLoops),n-r},s.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},s.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},s.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},s.opposite=function(e,t){e=""+e,t=""+t;var n=this._edges.get(t);if(!n)throw new U('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,s=n.target.key;if(e===r)return s;if(e===s)return r;throw new U('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(s,")."))},s.hasExtremity=function(e,t){e=""+e,t=""+t;var n=this._edges.get(e);if(!n)throw new U('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},s.isUndirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},s.isDirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},s.isSelfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},s.addNode=function(e,t){var n=function(e,t,n){if(n&&!l(n))throw new V('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(t=""+t,n=n||{},e._nodes.has(t))throw new Y('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}(this,e,t);return n.key},s.mergeNode=function(e,t){if(t&&!l(t))throw new V('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&(a(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])},s.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new V('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));e=""+e;var n=this._nodes.get(e);if(n){if(t){var r=n.attributes;n.attributes=t(r),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}var s=t?t({}):{};return n=new this.NodeDataClass(e,s),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:s}),[e,!0]},s.dropNode=function(e){e=""+e;var t,n=this._nodes.get(e);if(!n)throw new U('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){t=n.out[r];do{_e(this,t),t=t.next}while(t)}for(var s in n.in){t=n.in[s];do{_e(this,t),t=t.next}while(t)}}if("directed"!==this.type)for(var o in n.undirected){t=n.undirected[o];do{_e(this,t),t=t.next}while(t)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},s.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new U('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new U('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));return _e(this,t),this},s.dropDirectedEdge=function(e,t){if(arguments.length<2)throw new Y("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Y("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=c(this,e=""+e,t=""+t,"directed");if(!n)throw new U('Graph.dropDirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return _e(this,n),this},s.dropUndirectedEdge=function(e,t){if(arguments.length<2)throw new Y("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Y("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=c(this,e,t,"undirected");if(!n)throw new U('Graph.dropUndirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return _e(this,n),this},s.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},s.clearEdges=function(){for(var e,t=this._nodes.values();!0!==(e=t.next()).done;)e.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},s.getAttribute=function(e){return this._attributes[e]},s.getAttributes=function(){return this._attributes},s.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},s.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},s.updateAttribute=function(e,t){if("function"!=typeof t)throw new V("Graph.updateAttribute: updater should be a function.");var n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},s.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},s.replaceAttributes=function(e){if(!l(e))throw new V("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},s.mergeAttributes=function(e){if(!l(e))throw new V("Graph.mergeAttributes: provided attributes are not a plain object.");return a(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},s.updateAttributes=function(e){if("function"!=typeof e)throw new V("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},s.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new V("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!p(t))throw new V("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,s=this._nodes.values();!0!==(n=s.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},s.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new V("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!p(t))throw new V("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,s,o,i=this._edges.values();!0!==(n=i.next()).done;)s=(r=n.value).source,o=r.target,r.attributes=e(r.key,r.attributes,s.key,o.key,s.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},s.forEachAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntry: expecting a callback.");fe(!1,!1,!1,this,e)},s.forEachAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!1,!0,this,e)},s.forEachAssymetricAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");fe(!1,!0,!1,this,e)},s.forEachAssymetricAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!0,!0,this,e)},s.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):H(this._nodes.keys(),this._nodes.size)},s.forEachNode=function(e){if("function"!=typeof e)throw new V("Graph.forEachNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)e((n=t.value).key,n.attributes)},s.findNode=function(e){if("function"!=typeof e)throw new V("Graph.findNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)if(e((n=t.value).key,n.attributes))return n.key},s.mapNodes=function(e){if("function"!=typeof e)throw new V("Graph.mapNode: expecting a callback.");for(var t,n,r=this._nodes.values(),s=new Array(this.order),o=0;!0!==(t=r.next()).done;)n=t.value,s[o++]=e(n.key,n.attributes);return s},s.someNode=function(e){if("function"!=typeof e)throw new V("Graph.someNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)if(e((n=t.value).key,n.attributes))return!0;return!1},s.everyNode=function(e){if("function"!=typeof e)throw new V("Graph.everyNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)if(!e((n=t.value).key,n.attributes))return!1;return!0},s.filterNodes=function(e){if("function"!=typeof e)throw new V("Graph.filterNodes: expecting a callback.");for(var t,n,r=this._nodes.values(),s=[];!0!==(t=r.next()).done;)e((n=t.value).key,n.attributes)&&s.push(n.key);return s},s.reduceNodes=function(e,t){if("function"!=typeof e)throw new V("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new V("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,s=t,o=this._nodes.values();!0!==(n=o.next()).done;)s=e(s,(r=n.value).key,r.attributes);return s},s.nodeEntries=function(){var e=this._nodes.values();return new $((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},s.export=function(){var e=this,t=new Array(this._nodes.size),n=0;this._nodes.forEach((function(e,r){t[n++]=function(e,t){var n={key:e};return u(t.attributes)||(n.attributes=a({},t.attributes)),n}(r,e)}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(t,s){r[n++]=function(e,t,n){var r={key:t,source:n.source.key,target:n.target.key};return u(n.attributes)||(r.attributes=a({},n.attributes)),"mixed"===e&&n.undirected&&(r.undirected=!0),r}(e.type,s,t)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}},s.import=function(e){var t,n,s,o,i,a=this,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof r)return e.forEachNode((function(e,t){c?a.mergeNode(e,t):a.addNode(e,t)})),e.forEachEdge((function(e,t,n,r,s,o,i){c?i?a.mergeUndirectedEdgeWithKey(e,n,r,t):a.mergeDirectedEdgeWithKey(e,n,r,t):i?a.addUndirectedEdgeWithKey(e,n,r,t):a.addDirectedEdgeWithKey(e,n,r,t)})),this;if(!l(e))throw new V("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!l(e.attributes))throw new V("Graph.import: invalid attributes. Expecting a plain object.");c?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new V("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=s.length;t<n;t++){ge(o=s[t]);var u=o,d=u.key,h=u.attributes;c?this.mergeNode(d,h):this.addNode(d,h)}}if(e.edges){var p=!1;if("undirected"===this.type&&(p=!0),s=e.edges,!Array.isArray(s))throw new V("Graph.import: invalid edges. Expecting an array.");for(t=0,n=s.length;t<n;t++){ye(i=s[t]);var m=i,f=m.source,g=m.target,y=m.attributes,b=m.undirected,w=void 0===b?p:b;"key"in i?(c?w?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:w?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,i.key,f,g,y):(c?w?this.mergeUndirectedEdge:this.mergeDirectedEdge:w?this.addUndirectedEdge:this.addDirectedEdge).call(this,f,g,y)}}return this},s.nullCopy=function(e){var t=new r(a({},this._options,e));return t.replaceAttributes(a({},this.getAttributes())),t},s.emptyCopy=function(e){var t=this.nullCopy(e);return this._nodes.forEach((function(e,n){var r=a({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)})),t},s.copy=function(e){if("string"==typeof(e=e||{}).type&&e.type!==this.type&&"mixed"!==e.type)throw new Y('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(e.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof e.multi&&e.multi!==this.multi&&!0!==e.multi)throw new Y("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof e.allowSelfLoops&&e.allowSelfLoops!==this.allowSelfLoops&&!0!==e.allowSelfLoops)throw new Y("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var t,n,r=this.emptyCopy(e),s=this._edges.values();!0!==(t=s.next()).done;)Ce(r,"copy",!1,(n=t.value).undirected,n.key,n.source.key,n.target.key,a({},n.attributes));return r},s.toJSON=function(){return this.export()},s.toString=function(){return"[object Graph]"},s.inspect=function(){var t=this,n={};this._nodes.forEach((function(e,t){n[t]=e.attributes}));var r={},s={};this._edges.forEach((function(e,n){var o,i=e.undirected?"--":"->",a="",c=e.source.key,l=e.target.key;e.undirected&&c>l&&(o=c,c=l,l=o);var u="(".concat(c,")").concat(i,"(").concat(l,")");n.startsWith("geid_")?t.multi&&(void 0===s[u]?s[u]=0:s[u]++,a+="".concat(s[u],". ")):a+="[".concat(n,"]: "),r[a+=u]=e.attributes}));var o={};for(var i in this)this.hasOwnProperty(i)&&!Ae.has(i)&&"function"!=typeof this[i]&&"symbol"!==e(i)&&(o[i]=this[i]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,d(o,"constructor",this.constructor),o},r}(f.exports.EventEmitter);"undefined"!=typeof Symbol&&(Pe.prototype[Symbol.for("nodejs.util.inspect.custom")]=Pe.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge","update"].forEach((function(t){var n=e.name(t),r="add"===t?Ce:Se;e.generateKey?Pe.prototype[n]=function(s,o,i){return r(this,n,!0,"undirected"===(e.type||this.type),null,s,o,i,"update"===t)}:Pe.prototype[n]=function(s,o,i,a){return r(this,n,!1,"undirected"===(e.type||this.type),s,o,i,a,"update"===t)}}))})),function(e){z.forEach((function(t){var n=t.name,r=t.attacher;r(e,n("Node"),0),r(e,n("Source"),1),r(e,n("Target"),2),r(e,n("Opposite"),3)}))}(Pe),function(e){Z.forEach((function(t){var n=t.name,r=t.attacher;r(e,n("Edge"),"mixed"),r(e,n("DirectedEdge"),"directed"),r(e,n("UndirectedEdge"),"undirected")}))}(Pe),function(e){ee.forEach((function(t){!function(e,t){var n=t.name,r=t.type,s=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return function(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):H(e._edges.keys(),e._edges.size);for(var n,r,s="undirected"===t?e.undirectedSize:e.directedSize,o=new Array(s),i="undirected"===t,a=e._edges.values(),c=0;!0!==(n=a.next()).done;)(r=n.value).undirected===i&&(o[c++]=r.key);return o}(this,r);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n,r){var s=[];return ce(!1,e,t,n,r,(function(e){s.push(e)})),s}(this.multi,"mixed"===r?this.type:r,s,o)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return function(e,t,n,r,s){var o=[];return le(!1,e,t,n,r,s,(function(e){o.push(e)})),o}(r,this.multi,s,i,t)}throw new V("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return ae(!1,this,r,n=e);if(2===arguments.length){e=""+e,n=t;var i=this._nodes.get(e);if(void 0===i)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ce(!1,this.multi,"mixed"===r?this.type:r,s,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return le(!1,r,this.multi,s,a,t,n)}throw new V("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var i="map"+n[0].toUpperCase()+n.slice(1);e.prototype[i]=function(){var e,t=Array.prototype.slice.call(arguments),n=t.pop();if(0===t.length){var s=0;"directed"!==r&&(s+=this.undirectedSize),"undirected"!==r&&(s+=this.directedSize),e=new Array(s);var i=0;t.push((function(t,r,s,o,a,c,l){e[i++]=n(t,r,s,o,a,c,l)}))}else e=[],t.push((function(t,r,s,o,i,a,c){e.push(n(t,r,s,o,i,a,c))}));return this[o].apply(this,t),e};var a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((function(e,r,s,o,i,a,c){t(e,r,s,o,i,a,c)&&n.push(e)})),this[o].apply(this,e),n};var c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){var e,t,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new V("Graph.".concat(c,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new V("Graph.".concat(c,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(e=n[0],t=n[1],n=[]):3===n.length?(e=n[1],t=n[2],n=[n[0]]):4===n.length&&(e=n[2],t=n[3],n=[n[0],n[1]]);var r=t;return n.push((function(t,n,s,o,i,a,c){r=e(r,t,n,s,o,i,a,c)})),this[o].apply(this,n),r}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return!1;if(1===arguments.length)return ae(!0,this,r,n=e);if(2===arguments.length){e=""+e,n=t;var i=this._nodes.get(e);if(void 0===i)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ce(!0,this.multi,"mixed"===r?this.type:r,s,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return le(!0,r,this.multi,s,a,t,n)}throw new V("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var i="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((function(e,n,r,s,o,i,a){return t(e,n,r,s,o,i,a)})),!!this[o].apply(this,e)};var a="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((function(e,n,r,s,o,i,a){return!t(e,n,r,s,o,i,a)})),!this[o].apply(this,e)}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return $.empty();if(!arguments.length)return function(e,t){if(0===e.size)return $.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,s=e._edges.values();return new $((function(){for(var e,t;;){if((e=s.next()).done)return e;if(t=e.value,!n||t.undirected===r)break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}))}(this,r);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){var r=$.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=J(r,re(n.in))),"in"!==t&&void 0!==n.out&&(r=J(r,re(n.out,t?void 0:n.key)))),"directed"!==e&&void 0!==n.undirected&&(r=J(r,re(n.undirected))),r}(r,s,n)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return function(e,t,n,r){var s=$.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(s=J(s,ie(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(t||n.key!==r)&&(s=J(s,ie(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(s=J(s,ie(n.undirected,r))),s}(r,s,i,t)}throw new V("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(Pe),function(e){ue.forEach((function(t){(function(e,t){var n=t.name,r=t.type,s=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=[];return pe(!1,e,t,n,(function(e){r.push(e)})),r}("mixed"===r?this.type:r,s,t)}})(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));pe(!1,"mixed"===r?this.type:r,s,n,t)}};var i="map"+n[0].toUpperCase()+n.slice(1);e.prototype[i]=function(e,t){var n=[];return this[o](e,(function(e,r){n.push(t(e,r))})),n};var a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(e,t){var n=[];return this[o](e,(function(e,r){t(e,r)&&n.push(e)})),n};var c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new V("Graph.".concat(c,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](e,(function(e,n){r=t(r,e,n)})),r}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o=n[0].toUpperCase()+n.slice(1,-1),i="find"+o;e.prototype[i]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new U("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return pe(!0,"mixed"===r?this.type:r,s,n,t)}};var a="some"+o;e.prototype[a]=function(e,t){return!!this[i](e,t)};var c="every"+o;e.prototype[c]=function(e,t){return!this[i](e,(function(e,n){return!t(e,n)}))}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return $.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return me(null,n,n.undirected);if("string"==typeof t)return me(null,n,n[t])}var r=$.empty(),s=new de;return"undirected"!==e&&("out"!==t&&(r=J(r,me(s,n,n.in))),"in"!==t&&(r=J(r,me(s,n,n.out)))),"directed"!==e&&(r=J(r,me(s,n,n.undirected))),r}("mixed"===r?this.type:r,s,t)}}(e,t)}))}(Pe);var Ne=function(e){function n(t){var n=a({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new V("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new V('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Me=function(e){function n(t){var n=a({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new V("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new V('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),xe=function(e){function n(t){var n=a({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new V("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(Pe),$e=function(e){function n(t){var n=a({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new V("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new V('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Le=function(e){function n(t){var n=a({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new V("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new V('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe);function Ie(e){e.from=function(t,n){var r=a({},t.options,n),s=new e(r);return s.import(t),s}}return Ie(Pe),Ie(Ne),Ie(Me),Ie(xe),Ie($e),Ie(Le),Pe.Graph=Pe,Pe.DirectedGraph=Ne,Pe.UndirectedGraph=Me,Pe.MultiGraph=xe,Pe.MultiDirectedGraph=$e,Pe.MultiUndirectedGraph=Le,Pe.InvalidArgumentsGraphError=V,Pe.NotFoundGraphError=U,Pe.UsageGraphError=Y,Pe}()},944:(e,t)=>{"use strict";t.Vb=void 0,t.Vb=function(e,t,n){var r=function(e,t,n){if(0===e.length||0===t.length)return 0;if(n&&!n.caseSensitive&&(e=e.toUpperCase(),t=t.toUpperCase()),e===t)return 1;for(var r=0,s=e.length,o=t.length,i=Math.floor(Math.max(s,o)/2)-1,a=new Array(s),c=new Array(o),l=0;l<s;l++)for(var u=Math.max(0,l-i);u<=Math.min(o,l+i+1);u++)if(!a[l]&&!c[u]&&e[l]===t[u]){++r,a[l]=c[u]=!0;break}if(0===r)return 0;var d=0,h=0;for(l=0;l<s;l++)if(a[l]){for(;!c[h];)h++;e.charAt(l)!==t.charAt(h++)&&d++}return(r/s+r/o+(r-(d/=2))/r)/3}(e,t,n),s=0;if(r>.7){for(var o=Math.min(e.length,t.length),i=0;e[i]===t[i]&&i<4&&i<o;)++s,i++;r+=.1*s*(1-r)}return r}},7106:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,s,o,i,a,c,l,u,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in r(o,i,a,c,l,u,d),o){var p=o[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var m=0;m<p.length;m++)n(e,r,s,p[m],i+"/"+h+"/"+m,a,i,h,o,m)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var f in p)n(e,r,s,p[f],i+"/"+h+"/"+f.replace(/~/g,"~0").replace(/\//g,"~1"),a,i,h,o,f)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&n(e,r,s,p,i+"/"+h,a,i,h,o)}s(o,i,a,c,l,u,d)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var c=e[a],l=r.base?c[0]+r.base:c[0],u=o[l]||0,d="".concat(l," ").concat(u);o[l]=u+1;var h=n(d),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var m=s(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:m,references:1})}i.push(d)}return i}function s(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var o=r(e=e||[],s=s||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var a=n(o[i]);t[a].references--}for(var c=r(e,s),l=0;l<o.length;l++){var u=n(o[l]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=c}}},7659:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,s&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1407:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var r=n(4328),s=n(6082),o=n(439);const i=31;async function a(e,t,n=!1,o){const a=t.getSeqHandler(e);let l;o??=new Map;const u=a.isHelm()?t.getSeqMonomers(e):Object.keys(a.stats.freq).filter((e=>""!==e));for(let e=0;e<u.length;e++)o.has(u[e])||o.set(u[e],`${o.size+1}`);if(a.isHelm())l=await r.functions.call("HELM:getMolFiles",{col:e}),l=function(e,t,n=!1){const r=new Array(e.length);for(let s=0;s<e.length;s++){let o=0,a=0,c="\n Datagrok macromolecule handler\n\n 0 0 0 0 0 0 999 V3000\nM V30 BEGIN CTAB\n";const l=e.get(s);o=l.indexOf("\n",o)+1,o=l.indexOf("\n",o)+1,o=l.indexOf("\n",o)+1;const u=parseInt(l.substring(o,o+3)),d=parseInt(l.substring(o+3,o+6));c+=`M V30 COUNTS ${u} ${d} 0 0 0\n`,c+="M V30 BEGIN ATOM\n";for(let e=0;e<u;e++){o=l.indexOf("\n",o)+1+i,a=l.indexOf(" ",o);const r=l.substring(o,a);c+=n?`M V30 ${e+1} R${t.get(r)} 0.000 0.000 0 0\n`:`M V30 ${e+1} At 0.000 0.000 0 0 MASS=${t.get(r)}\n`}c+="M V30 END ATOM\n",c+="M V30 BEGIN BOND\n";for(let e=0;e<d;e++){o=l.indexOf("\n",o)+1;const t=parseInt(l.substring(o,o+3).trim()),n=parseInt(l.substring(o+3,o+6).trim());c+=`M V30 ${e+1} ${parseInt(l.substring(o+6,o+9).trim())} ${t} ${n}\n`}c+="M V30 END BOND\n",c+="M V30 END CTAB\n",c+="M END",r[s]=c}return r}(l,o,n);else{l=new Array(e.length);for(let t=0;t<e.length;t++){const e=c(a.getSplitted(t),o,n);l[t]=e}}return s.Column.fromStrings("monomericMols",l)}function c(e,t,n=!1){let r="\n Datagrok macromolecule handler\n\n 0 0 0 0 0 0 999 V3000\nM V30 BEGIN CTAB\n";r+=`M V30 COUNTS ${e.length} ${e.length?e.length-1:0} 0 0 0\n`,r+="M V30 BEGIN ATOM\n";for(let s=0;s<e.length;s++){const i=e.getCanonical(s);i!==o._S&&(r+=n?`M V30 ${s+1} R${t.get(i)} 0.000 0.000 0 0\n`:`M V30 ${s+1} At 0.000 0.000 0 0 MASS=${t.get(i)}\n`)}r+="M V30 END ATOM\n",r+="M V30 BEGIN BOND\n";for(let t=0;t<e.length-1;t++)r+=`M V30 ${t+1} 1 ${t+1} ${t+2}\n`;return r+="M V30 END BOND\n",r+="M V30 END CTAB\n",r+="M END",r}},4374:(e,t,n)=>{"use strict";n.d(t,{_package:()=>Ye,getMonomerLibHelper:()=>Be});var r,s,o=n(4328),i=n(7389),a=n(6082);n(684),n(9039),(s=r||(r={})).EUCLIDEAN="EUCLIDEAN",s.MANHATTAN="MANHATTAN";var c=n(1858),l=n(5072),u=n.n(l),d=n(7825),h=n.n(d),p=n(7659),m=n.n(p),f=n(5056),g=n.n(f),y=n(540),b=n.n(y),w=n(1113),v=n.n(w),A=n(7939),E={};E.styleTagTransform=v(),E.setAttributes=g(),E.insert=m().bind(null,"head"),E.domAPI=h(),E.insertStyleElement=b(),u()(A.A,E),A.A&&A.A.locals&&A.A.locals,Promise.resolve(),n(934),n(8903),a.SEMTYPE.MOLECULE,a.SEMTYPE.MACROMOLECULE;const T=rxjs.operators;n(6295);var C,S,_,P,N,M,x=n(8774);(_=C||(C={})).none="none",_.bold="bold",_.dashed="dashed",(P=S||(S={})).EUCLIDEAN="EUCLIDEAN",P.MANHATTAN="MANHATTAN",S.EUCLIDEAN,S.MANHATTAN,(M=N||(N={})).HAMMING="Hamming",M.EUCLIDEAN="Euclidean",M.MANHATTAN="Manhattan",M.TANIMOTO="Tanimoto",M.LEVENSTEIN="Levenshtein",M.NEEDLEMAN_WUNSCH="Needlemann-Wunsch",M.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance",M.SOKAL="Sokal",M.COSINE="Cosine",M.ASYMMETRIC="Asymmetric",M.Difference="Difference",M.OneHot="One-Hot",N.HAMMING,N.EUCLIDEAN,N.MANHATTAN,N.TANIMOTO,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.MONOMER_CHEMICAL_DISTANCE,N.SOKAL,N.COSINE,N.ASYMMETRIC,N.Difference,N.OneHot,N.HAMMING,N.EUCLIDEAN,N.MANHATTAN,N.TANIMOTO,N.SOKAL,N.COSINE,N.ASYMMETRIC,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.MONOMER_CHEMICAL_DISTANCE,N.Difference,N.OneHot,new Set([N.HAMMING,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.MONOMER_CHEMICAL_DISTANCE,N.OneHot]),new Set([N.HAMMING,N.EUCLIDEAN,N.MANHATTAN,N.MONOMER_CHEMICAL_DISTANCE,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.TANIMOTO,N.COSINE,N.SOKAL,N.ASYMMETRIC,N.OneHot,N.Difference]),new Set([N.EUCLIDEAN,N.MANHATTAN,N.OneHot,N.Difference]),new Set([N.EUCLIDEAN,N.MANHATTAN,N.Difference]),new Set([N.EUCLIDEAN,N.MANHATTAN,N.Difference]),new Set([N.TANIMOTO,N.COSINE,N.SOKAL,N.ASYMMETRIC]);var $=n(1991),L=n.n($);new c.Subject;var I,R,O,k,G,D=n(2003),H=(n(3516),n(6718),n(3077),n(439));(R=I||(I={})).IDENTITY="identity",R.SIMILARITY="similarity",n(5540),function(e){e.ADD="ADD",e.SUB="SUB",e.MULT="MULT"}(O||(O={})),function(e){e.SQUARE="SQUARE",e.INVERSE="INVERSE",e.TRANSPOSE="TRANSPOSE",e.NORM="NORM",e.COLUMN_NORM="COLUMN_NORM"}(k||(k={})),function(e){e.SCALARMULT="SCALARMULT",e.SCALARADD="SCALARADD",e.SCALARPOW="SCALARPOW"}(G||(G={})),Object.prototype.toString,n(6873);var F=n(4356),V=(n(6717),n(4870),n(3856),n(6882),n(7278),n(310),n(6642)),U=n(3599);n(673),n(8312),V.sD,n(4139),D.zS,a.GridCellRenderer,a.GridCellRenderer,a.GridCellRenderer;var Y,B,W,j,K=n(8070),q=n(4326);!function(e){e.Unknown="unknown",e.FR="framework",e.CDR="cdr"}(Y||(Y={})),new class{constructor(){this.regionTypes=[Y.CDR],this.chains=["Heavy","Light"],this.skipEmptyPositions=!1,this.fitWidth=!1,this.positionWidth=16,this.positionHeight=q.fH.Entropy,this.filterSource=q.Fo.filterSource}},n(7602),n(8047),function(e){e.STYLE="Style",e.BEHAVIOR="Behavior",e.LAYOUT="Layout",e.DATA="Data"}(B||(B={})),function(e){e.skipEmptyPositions="skipEmptyPositions",e.regionTypes="regionTypes",e.chains="chains",e.fitWidth="fitWidth",e.positionWidth="positionWidth",e.positionHeight="positionHeight",e.filterSource="filterSource"}(W||(W={})),a.JsViewer,n(6863),n(2780),n(8115),a.JsViewer,n(1407),H.b9[H.Hi.FASTA],n(5433),n(3890),n(1687),function(e){e.TYPE="V2000",e[e.NUM_OF_HEADER_LINES=3]="NUM_OF_HEADER_LINES",e[e.NUM_OF_COUNTS_DIGITS=3]="NUM_OF_COUNTS_DIGITS",e[e.ATOM_TYPE_COL=4]="ATOM_TYPE_COL",e[e.FIRST_BONDED_ATOM_COL=1]="FIRST_BONDED_ATOM_COL",e[e.BOND_TYPE_COL=3]="BOND_TYPE_COL",e[e.RGP_SHIFT=8]="RGP_SHIFT",e[e.MAX_ATOM_COUNT=999]="MAX_ATOM_COUNT",e.RGP_LINE_START="M RGP",e.ATOM_ALIAS_LINE_START="A ",e.END="M END"}(j||(j={}));class z{constructor(e){this.init(e)}init(e){this.fileContent=e.replace(/\r/g,""),this._atomCount=void 0,this._atomTypes=void 0,this._bondCount=void 0,this._bondTypes=void 0,this.xyzAtomCoordinates=void 0,this._pairsOfBondedAtoms=void 0}get atomCount(){return void 0===this._atomCount&&this.setAtomAndBondCounts(),this._atomCount}get bondCount(){return void 0===this._bondCount&&this.setAtomAndBondCounts(),this._bondCount}get x(){var e;return null!==(e=this.xyzAtomCoordinates)&&void 0!==e||(this.xyzAtomCoordinates=this.parseAtomCoordinates()),this.xyzAtomCoordinates.x}get y(){var e;return null!==(e=this.xyzAtomCoordinates)&&void 0!==e||(this.xyzAtomCoordinates=this.parseAtomCoordinates()),this.xyzAtomCoordinates.y}get z(){var e;return null!==(e=this.xyzAtomCoordinates)&&void 0!==e||(this.xyzAtomCoordinates=this.parseAtomCoordinates()),this.xyzAtomCoordinates.z}get atomTypes(){var e;return null!==(e=this._atomTypes)&&void 0!==e||(this._atomTypes=this.parseAtomTypes()),this._atomTypes}get pairsOfBondedAtoms(){var e;return null!==(e=this._pairsOfBondedAtoms)&&void 0!==e||(this._pairsOfBondedAtoms=this.parseBondedAtomPairs()),this._pairsOfBondedAtoms}get bondTypes(){var e;return null!==(e=this._bondTypes)&&void 0!==e||(this._bondTypes=this.parseBondTypes()),this._bondTypes}setAtomAndBondCounts(){const{atomCount:e,bondCount:t}=this.parseAtomAndBondCounts();this._atomCount=e,this._bondCount=t}getNextColumnIdx(e){for(;!this.isWhitespace(e);)++e;for(;this.isWhitespace(e);)++e;return e}shiftIdxToSpecifiedColumn(e,t){let n=e;const r=this.isWhitespace(n)?t:t-1;for(let e=0;e<r;e++)n=this.getNextColumnIdx(n);return n}parseAtomTypes(){const e=this.atomCount,t=new Array(e);let n=this.getAtomBlockIdx();for(let r=0;r<e;r++)n=this.shiftIdxToAtomType(n),t[r]=this.parseAtomType(n),n=this.getNextLineIdx(n);return t}parseAtomCoordinates(){const e=new Float32Array(this.atomCount),t=new Float32Array(this.atomCount),n=new Float32Array(this.atomCount);let r=this.getAtomBlockIdx();for(let s=0;s<this.atomCount;s++){r=this.shiftIdxToXColumn(r);for(const o of[e,t,n])o[s]=this.parseFloatValue(r),r=this.getNextColumnIdx(r);r=this.getNextLineIdx(r)}return{x:e,y:t,z:n}}parseBondedAtomPairs(){const e=new Array(this.bondCount);let t=this.getBondBlockIdx();for(let n=0;n<this.bondCount;n++){t=this.shiftIdxToBondedAtomsPair(t);const r=new Uint16Array(2);r[0]=this.parseIntValue(t),t=this.getNextColumnIdx(t),r[1]=this.parseIntValue(t),e[n]=r,t=this.getNextLineIdx(t)}return e}parseBondTypes(){const e=this.bondCount,t=new Uint16Array(e);let n=this.getBondBlockIdx();for(let r=0;r<e;r++)n=this.shiftIdxToBondType(n),t[r]=this.parseIntValue(n),n=this.getNextLineIdx(n);return t}isWhitespace(e){const t=this.fileContent[e];return" "===t||"\t"===t}getNextLineIdx(e){return"\n"!==this.fileContent[e]?this.fileContent.indexOf("\n",e)+1:e+1}parseFloatValue(e){return this.parseNumericValue(parseFloat,e)}parseIntValue(e){return this.parseNumericValue(parseInt,e)}parseNumericValue(e,t){let n=t+1;for(;!this.isWhitespace(n);)++n;return e(this.fileContent.substring(t,n))}}class Z extends z{constructor(e){super(e),this.init(e)}init(e){super.init(e)}parseAtomType(e){let t=e,n=t;return this.isQuote(t)?(n=this.getNextIdenticalChar(t),t++):n=this.fileContent.indexOf(" ",n),this.fileContent.substring(t,n)}isQuote(e){const t=this.fileContent[e].charCodeAt(0);return 39===t||34===t}getNextIdenticalChar(e){const t=this.fileContent[e];return t?this.fileContent.indexOf(t,e+1):-1}isQuery(){return this.isQueryOrFragment(((e,t)=>{return 39===e||34===e||76===e&&!((n=this.fileContent.charCodeAt(t+1))>64&&n<91||n>96&&n<123);var n}))}isFragment(){return this.isQueryOrFragment((e=>82===e||42===e))}isQueryOrFragment(e){const t=this.atomCount;let n=this.getAtomBlockIdx();for(let r=0;r<t;r++){if(n=this.shiftIdxToAtomType(n),e(this.fileContent.charCodeAt(n),n))return!0;n=this.getNextLineIdx(n)}return!1}}class X extends Z{constructor(e){super(e)}getAtomLines(){const e=this.getAtomBlockIdx(),t=this.getBondBlockIdx();return this.fileContent.substring(e,t).split("\n").slice(0,this.atomCount)}getBondLines(){const e=this.getBondBlockIdx();return this.fileContent.substring(e).split("\n").slice(0,this.bondCount)}getRGroupIdToAtomicIdxMap(){const e=new Map,t=this.fileContent.split("\n");t.filter((e=>e.startsWith(j.RGP_LINE_START))).forEach((t=>{const n=this.getAtomIdxToRgpIdxList(t);for(const[t,r]of n){if(e.has(t))throw new Error(`R group ${t} is already in the map`);e.set(t,r)}}));const n=t.map(((e,t)=>{if(e.startsWith(j.ATOM_ALIAS_LINE_START))return t})).filter((e=>void 0!==e)),r=n.map((e=>t[e])),s=n.map((e=>t[e+1]));r.forEach(((t,n)=>{const r=parseInt(t.split(/\s+/)[1])-1,o=parseInt(s[n].substring(1));if(e.has(o))throw new Error(`R group ${o} is already in the map`);e.set(o,r)}));const o=this.getRGroupAtomicIndices().filter((t=>!Array.from(e.values()).includes(t)));if(0!==o.length)throw new Error(`Unaccounted R group indices: ${o}`);return e}getAtomIdxToRgpIdxList(e){const t=e.split(/\s+/).filter((e=>e)).slice(3).map((e=>parseInt(e))),n=new Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=[t[e+1],t[e]-1];return n}getRGroupAtomicIndices(){return this.atomTypes.map(((e,t)=>{if(e.includes("R#"))return t})).filter((e=>void 0!==e))}static isValidMolfile(e){return-1!==e.indexOf(j.TYPE)&&-1!==e.indexOf(j.END)}shiftIdxToAtomType(e){return this.shiftIdxToSpecifiedColumn(e,j.ATOM_TYPE_COL)}getCountsLineIdx(){let e=0;for(let t=0;t<j.NUM_OF_HEADER_LINES;++t)e=this.getNextLineIdx(e);return e}getAtomBlockIdx(){let e=this.getCountsLineIdx();return e=this.getNextLineIdx(e),e}shiftIdxToXColumn(e){return this.getNextColumnIdx(e)}shiftIdxToBondedAtomsPair(e){return this.shiftIdxToSpecifiedColumn(e,j.FIRST_BONDED_ATOM_COL)}shiftIdxToBondType(e){return this.shiftIdxToSpecifiedColumn(e,j.BOND_TYPE_COL)}getBondBlockIdx(){let e=this.getAtomBlockIdx();for(let t=0;t<this.atomCount;t++)e=this.getNextLineIdx(e);return e}parseAtomAndBondCounts(){let e=this.getCountsLineIdx(),t=e+j.NUM_OF_COUNTS_DIGITS;const n=parseInt(this.fileContent.substring(e,t));return e=t,t+=j.NUM_OF_COUNTS_DIGITS,{atomCount:n,bondCount:parseInt(this.fileContent.substring(e,t))}}}class Q extends Z{constructor(e){super(e),this.init(e)}getAtomLines(){const e=this.getAtomBlockIdx(),t=this.getBondBlockIdx();return this.fileContent.substring(e,t).split("\n").slice(0,this.atomCount)}getBondLines(){const e=this.getBondBlockIdx();return this.fileContent.substring(e).split("\n").slice(0,this.bondCount)}getRGroupIdToAtomicIdxMap(){const e=new Map;return this.getAtomLines().forEach(((t,n)=>{const r=t.match(/RGROUPS=\(([\d\s]+)\)/);if(r){const t=r[1].split(/\s+/).map((e=>parseInt(e)));if(t.length>2)throw new Error(`R group data ${t} has more than 2 elements`);const s=t[1];if(e.has(s))throw new Error(`R group ${s} is already in the map`);e.set(s,n)}})),e}shiftIdxToAtomType(e){return this.shiftIdxToSpecifiedColumn(e,4)}getCountsLineIdx(){return this.fileContent.indexOf("M V30 COUNTS ")}getAtomBlockIdx(){let e=this.fileContent.indexOf("M V30 BEGIN ATOM");return e=this.getNextLineIdx(e),e}shiftIdxToXColumn(e){let t=this.shiftIdxToAtomType(e);return this.isQuote(t)?(t=this.getNextIdenticalChar(t),t=this.getNextColumnIdx(t),t):this.shiftIdxToSpecifiedColumn(e,5)}shiftIdxToBondedAtomsPair(e){return this.shiftIdxToSpecifiedColumn(e,5)}shiftIdxToBondType(e){return this.shiftIdxToSpecifiedColumn(e,4)}getBondBlockIdx(){return this.getNextLineIdx(this.fileContent.indexOf("M V30 BEGIN BOND"))}static isValidMolfile(e){return-1!==e.indexOf("V3000")&&-1!==e.indexOf("M END")}parseAtomAndBondCounts(){let e=this.fileContent.indexOf("M V30 COUNTS ")+14,t=this.fileContent.indexOf(" ",e+1);const n=parseInt(this.fileContent.substring(e,t));return e=t+1,t=this.fileContent.indexOf(" ",e+1),{atomCount:n,bondCount:parseInt(this.fileContent.substring(e,t))}}}class J{constructor(){}static getInstance(e){if(J.isMolfileV2K(e))return new X(e);if(J.isMolfileV3K(e))return new Q(e);throw new Error("Malformed molfile")}static isMolfileV2K(e){return X.isValidMolfile(e)}static isMolfileV3K(e){return Q.isValidMolfile(e)}}var ee=n(6197),te=n(9124),ne=n(3527),re=n(3629);class se{biotype;id;n;m;type;mt;smiles;get issmiles(){return!!this.smiles}at={R1:"H",R2:"H",R3:"H",R4:"H",R5:"H",R6:"H",R7:"H",R8:"H",R9:"H"};get rs(){return Object.keys(this.at).length}constructor(e,t,n="missing",r=void 0,s=void 0,o=void 0,i){if(this.biotype=e,this.id=t,this.n=n,this.m=r,this.type=s,this.mt=o,this.smiles=i,!this.id)throw new Error("Invalid arg undefined [id].")}static objCounter=-1;objId=++se.objCounter;className="WebEditorMonomerDummy";toLog(){return`Helm: ${this.className}<${this.objId}>`}}class oe extends se{backgroundcolor="#FFFFFF";linecolor="#808080";textcolor="#808080";constructor(e){super(e,"*","gap")}}class ie extends se{backgroundcolor="#808080";linecolor="#000000";textcolor="#000000";constructor(e,t){super(e,t,"ambiguous")}}class ae extends se{backgroundcolor="#FF4444";linecolor="#800000";textcolor="#FFFFFF";constructor(e,t,n){super(e,t,"missing"),n&&(this.backgroundcolor="#C0C0C0",this.linecolor="#404040",this.textcolor="#404040")}}class ce extends se{backgroundcolor="#FFFF44";linecolor="#800000";textcolor="#000000";constructor(e,t){super(e,t,"broken")}}class le{id;m;n;na;type;mt;at;smiles;get rs(){return Object.keys(this.at).length}get issmiles(){return!!this.smiles}linecolor;backgroundcolor;textcolor;constructor(e,t,n,r,s,o,i,a){this.id=e,this.m=t,this.n=n,this.na=r,this.type=s,this.mt=o,this.at=i,this.smiles=a}static fromMonomer(e,t,n){let r={};const s=t.symbol,o=t.smiles;if(t.rgroups.length>0)t.rgroups.forEach((e=>{r[e.label]=e.capGroupName}));else{if(!o){if(t.lib)return new ce(e,s);throw new Error("Unexpected missing monomer without .lib")}r=n.getRS(o)}const i=new le(t.symbol,t.molfile,t.name,t.naturalAnalog,t.polymerType,t.monomerType,r),a=n.getMonomerColors(e,t.symbol);return a&&(i.textcolor=a?.textcolor,i.linecolor=a?.linecolor,i.backgroundcolor=a?.backgroundcolor),i}}const ue={[U.o.BASE]:{A:"#20E040",G:"#040404",T:"#FF8080",C:"#2060FF",U:"#FF8080"},[U.o.NUCLEOTIDE]:{A:"#20E040",G:"#040404",T:"#FF8080",C:"#2060FF",U:"#FF8080"},[U.o.LINKER]:{P:"#9aa5e1",p:"#9aa5e1"},[U.o.SUGAR]:{R:"#7a85c1",r:"#7a85c1"},[U.o.AA]:{A:"rgb(44,160,44)",R:"rgb(23,190,207)",N:"rgb(235,137,70)",D:"rgb(31,119,180)",C:"rgb(188,189,34)",E:"rgb(31, 120, 150)",Q:"rgb(205, 111, 71)",G:"rgb(214,39,40)",H:"rgb(158,218,229)",I:"rgb(23,103,57)",L:"rgb(30,110,96)",K:"rgb(108, 218, 229)",M:"rgb(60,131,95)",F:"rgb(24,110,79)",P:"rgb(255,152,150)",S:"rgb(255,187,120)",T:"rgb(245,167,100)",W:"rgb(182, 223, 138)",Y:"rgb(152,223,138)",V:"rgb(74,160,74)"},[U.o.CHEM]:{R:"#eeeeee"},[U.o.BLOB]:{B:"#999999",G:"#e2e2e2"}},de=/[\w()]+/,he=RegExp(String.raw`\(${de}(,${de})+\)`),pe=new ne.Mi([255,255,255]),me=new ne.Mi([0,0,0]),fe=.7*(0,re.wQ)(pe);class ge{_monomers;source;_isEmpty;get isEmpty(){return this._isEmpty}_onChanged=new c.Subject;get onChanged(){return this._onChanged}constructor(e,t){this._monomers=e,this.source=t,this._isEmpty=!this._monomers||0===Object.keys(this._monomers).length||Object.entries(this._monomers).every((([e,t])=>0===Object.keys(t).length))}getMonomerSymbolsByType(e){return Object.keys(this._monomers[e])}addMissingMonomer(e,t){let n=this._monomers[e];n||(n=this._monomers[e]={});let r=t;return t==H._S||t===H.b9[H.Hi.HELM]?r="Gap":("PEPTIDE"===e&&"X"===t||"RNA"===e&&"N"===t)&&(r="Any"),n[t]={symbol:t,name:r,molfile:"",author:"MISSING",id:-1,rgroups:L().count(1).take(9).map((e=>({capGroupSmiles:"",alternateId:"",capGroupName:"",label:`R${e.toString()}`}))).toArray(),smiles:"",polymerType:e,monomerType:void 0,createDate:null}}getMonomer(e,t){let n=t;"RNA"==e&&"R"==n&&(n="r"),"RNA"==e&&"P"==n&&(n="p");let r=null;if(e){const t=this._monomers[e];r=t?t[n]:null}else{Ye.logger.warning(`Bio: MonomerLib.getMonomer() symbol '${t}', polymerType not specified.`);for(const[e,t]of Object.entries(this._monomers))if(r=t[n],r)break}return r}getWebEditorMonomer(e,t){const[n,r]=(0,te.fA)(e,t),s=(0,ee.Y)(n);let o=this.getMonomer(s,r);if(o&&n==U.o.LINKER&&2!=o.rgroups.length)return null;if(o&&n==U.o.SUGAR&&3!=o.rgroups.length)return null;o||(o=this.addMissingMonomer(s,r));let i=o.wem??null;return i||(r===H._S||"*"==r?i=o.wem=new oe(n):n===U.o.NUCLEOTIDE&&"N"===r||n===U.o.AA&&"X"===r||(U.o.CHEM,0)||he.test(r)?i=o.wem=new ie(n,r):o.lib||(i=o.wem=new ae(n,r,this.isEmpty)),i||(i=o.wem=le.fromMonomer(n,o,this))),i}getTooltip(e,t){const n=(0,ee.Y)(e),r=i.div([],{classes:"ui-form ui-tooltip"}),s=this.getMonomer(n,t);if(s){const n=s.symbol,a=(s.name,this.getWebEditorMonomer(e,t));a.backgroundcolor,r.append(i.divH([i.div([n],{style:{textWrap:"nowrap",marginLeft:"4px",marginRight:"4px",color:a.textcolor,backgroundColor:a.backgroundcolor,borderColor:a.linecolor,borderWidth:"1px",borderStyle:"solid",borderRadius:"2px",padding:"3px",minWidth:"24px",textAlign:"center"}}),i.div([s.name],{style:{padding:"4px"}})],{style:{display:"flex",flexDirection:"row",justifyContent:"left"}}));const c={autoCrop:!0,autoCropMargin:0,suppressChiralText:!0};let l;l=s.molfile?o.chem.svgMol(s.molfile,void 0,void 0,c):s.smiles?i.divV([o.chem.svgMol(s.smiles,void 0,void 0,c),i.divText("from smiles",{style:{fontSize:"smaller"}})]):i.divText("No structure",{style:{margin:"6px"}}),r.append(i.div(l,{style:{display:"flex",flexDirection:"row",justifyContent:"center",margin:"6px"}})),s.symbol!=H._S&&r.append(i.divText(s.lib?.source??"Missed in libraries"))}else r.append(i.divV([i.divText(`Monomer '${t}' of type '${n}' not found.`),i.divText("Open the Context Panel, then expand Manage Libraries")]));return r}getMonomerTextColor(e,t){const n=this.getMonomerColors(e,t),r=e=>{const t=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(t)return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])];const n=a.Color.fromHtml(e);return[a.Color.r(n),a.Color.g(n),a.Color.b(n)]},s=r(n.textcolor),o=new ne.Mi([...s.map((e=>e+1))]),i=(0,re.KE)(o,pe)/((0,re.wQ)(o)*(0,re.wQ)(pe)),c=r(n.backgroundcolor),l=new ne.Mi([...c.map((e=>e+.01))]);let u;u=(0,re.KE)(l,pe)/((0,re.wQ)(l)*(0,re.wQ)(pe))<i?c:s;let d=new ne.Mi(u);const h=(0,re.wQ)(d);return h>fe&&(d=(0,re.dC)(me,d,fe/h)),`rgb(${d[0]}, ${d[1]}, ${d[2]})`}getMonomerColors(e,t){const n="default";let r=n;const s=(0,ee.Y)(e),o=this.getMonomer(s,t);let i;if(o){if(o.meta&&o.meta.colors){const e=o.meta.colors;n in e||(r="default"),i=e[r]}if(!i){const t=ue[e],n=t?.[o.symbol];n&&(i={textColor:a.Color.toHtml(a.Color.getContrastColor(a.Color.fromHtml(n))),lineColor:"#202020",backgroundColor:n})}const t=o.naturalAnalog;if(!i&&t)return this.getMonomerColors(e,t)}return i||(i={textColor:"#202020",lineColor:"#202020",backgroundColor:"#A0A0A0"}),{textcolor:i.text??i.textColor,linecolor:i.line??i.lineColor,backgroundcolor:i.background??i.backgroundColor}}getRS(e){const t=e.match(/(?<=\[)[^\][]*(?=])/gm),n={};let r,s="";if(t)for(let e=0;e<t.length;e++)if(null!=t[e]&&/\d/.test(t[e])){r=t[e][t[e].length-1],t[e]=t[e].replace(/[0-9]/g,"");for(let n=0;n<t[e].length;n++)":"!=t[e][n]&&(s+=t[e][n]);n["R"+r]=s,s=""}return n}}var ye=n(5488),be={};be.styleTagTransform=v(),be.setAttributes=g(),be.insert=m().bind(null,"head"),be.domAPI=h(),be.insertStyleElement=b(),u()(ye.A,be),ye.A&&ye.A.locals&&ye.A.locals;class we extends ge{error;_duplicateMonomers={};get duplicateMonomers(){return this._duplicateMonomers}_duplicatesHandled=!0;get duplicatesHandled(){return this._duplicatesHandled}duplicatesNotified=!1;constructor(e,t,n=void 0){super(e,t),this.error=n;for(const[e,t]of Object.entries(this._monomers))for(const[e,n]of Object.entries(t))n.lib=this}toJSON(){const e=[];for(const t of Object.values(this._monomers))for(const n of Object.values(t))e.push({...n,lib:void 0,wem:void 0});return e}getMonomer(e,t){let n=t;"RNA"==e&&"R"==n&&(n="r"),"RNA"==e&&"P"==n&&(n="p");let r=null;if(e){const t=this._monomers[e];r=t?.[n]??null}else{Ye.logger.warning(`Bio: MonomerLib.getMonomer() symbol '${t}', polymerType not specified.`);for(const[e,t]of Object.entries(this._monomers))if(r=t[n],r)break}return r}_monomerSets=null;getMonomerSet(e){const t=(0,ee.Y)(e);if(this._monomerSets||(this._monomerSets={}),!(e in this._monomerSets))for(const[e,n]of Object.entries(this._monomers[t]));return this._monomerSets[e]}getPolymerTypes(){return Object.keys(this._monomers)}getMonomerMolsByPolymerType(e){const t={};return Object.keys(this._monomers[e]??{}).forEach((n=>{t[n]=this._monomers[e][n].molfile})),t}getMonomerSymbolsByRGroup(e,t,n){let r=this.getMonomerSymbolsByType(t).map((e=>this.getMonomer(t,e)));return r=r.filter((e=>null!==e)),0===r.length?[]:(r=r.filter((t=>{if(!t?.rgroups)return!1;let n=t?.rgroups.length>=e;var r;return r=J.getInstance(t.molfile).atomTypes,r.map(((e,t)=>"R#"===e?t:-1)).filter((e=>-1!==e)),n&&=!0,n})),r.map((e=>e?.symbol)))}_updateLibInt(e){const t=e.getPolymerTypes(),n=this.getPolymerTypes();t.forEach((t=>{n.includes(t)||(this._monomers[t]={}),e.getMonomerSymbolsByType(t).forEach((n=>{this._monomers[t][n]&&(this._duplicateMonomers[t]??={},this._duplicateMonomers[t][n]??=[this._monomers[t][n]],this._duplicateMonomers[t][n].push(e.getMonomer(t,n))),this._monomers[t][n]=e.getMonomer(t,n)}))})),this._isEmpty=this.isEmpty&&e.isEmpty}updateLibs(e,t=!1){t&&(this._monomers={},this._isEmpty=!0),this._duplicateMonomers={};for(const t of e)t.error||this._updateLibInt(t);Object.entries(this.duplicateMonomers).length>0?(0,F.ub)().then((e=>{this.assignDuplicatePreferences(e)})):this._duplicatesHandled=!0,this._onChanged.next()}assignDuplicatePreferences(e){let t=!0;for(const n in this.duplicateMonomers)for(const r in this.duplicateMonomers[n])if(e.duplicateMonomerPreferences?.[n]?.[r]){const s=e.duplicateMonomerPreferences[n][r],o=this.duplicateMonomers[n][r].find((e=>e.lib?.source===s));o?this._monomers[n][r]=o:t=!1}else t=!1;return this._duplicatesHandled=t,t}clear(){this._monomers={},this._onChanged.next()}getSummaryObj(){const e={},t=this.getPolymerTypes();for(const n of t)e[n]=this.getMonomerSymbolsByType(n).length;return e}getSummaryDf(){const e=this.getPolymerTypes(),t=new Array(e.length);for(const[n,r]of L().enumerate(e))t[r]=this.getMonomerSymbolsByType(n).length;return a.DataFrame.fromColumns([a.Column.fromStrings("polymerType",e),a.Column.fromList(a.COLUMN_TYPE.INT,"count",t)])}getSummary(){const e=this.getPolymerTypes();return 0==e.length?"empty":e.map((e=>`${e} ${this.getMonomerSymbolsByType(e).length}`)).join("\n")}override(e,t){return new ve(e,t,this)}}class ve extends ge{data;base;constructor(e,t,n){super(e,t),this.data=e,this.base=n}get onChanged(){return this.base.onChanged}getMonomerSymbolsByType(e){const t=this.base.getMonomerSymbolsByType(e);for(const n of Object.keys(this.data[e]??{}))t.includes(n)||t.push(n);return t}addMissingMonomer(e,t){return this.base.addMissingMonomer(e,t)}getMonomer(e,t){const n=this.data[e]?.[t];return n??this.base.getMonomer(e,t)}}var Ae=n(9192);class Ee{monomerLib;symbol;polymerType;monomerType;monomerLinks;monomers;error=null;constructor(e,t,n,r,s){this.monomerLib=e,this.symbol=t,this.polymerType=n,this.monomerType=r,this.monomerLinks=s;try{this.monomers=this.monomerLinks.map((e=>{const n=this.monomerLib.getMonomer(this.polymerType,e.symbol);if(!n)throw new Error("Monomer not found: ");if(n.lib?.source!=e.source)throw new Error(`Monomer '${t}' found in different library.`);return n}))}catch(e){const[t,n]=(0,Ae.AP)(e);this.error=t,this.monomers=[]}}}class Te{description;placeholders;source;error;constructor(e,t,n=void 0,r=void 0){this.description=e,this.placeholders=t,this.source=n,this.error=r}updateSets(e,t=!1){t&&(this.placeholders=[]);for(const t of e)t.error||this._updateSetInt(t)}_updateSetInt(e){for(const t of e.placeholders)this.placeholders.push(t)}}var Ce=n(7433),Se=n.n(Ce),_e=n(1913),Pe=n.n(_e);class Ne{helmMonomerSchema;validateMonomerSchema;constructor(e){this.helmMonomerSchema=e;const t=new(Se())({allErrors:!0,strictTuples:!1,allowUnionTypes:!0});Pe()(t),this.validateMonomerSchema=t.compile(this.helmMonomerSchema)}validateFile(e,t){const n=this.parseJson(e,t);return null!==n&&(Array.isArray(n)?this.validateJsonContent(n,t):(console.warn(`Bio: Monomer Library File Validator file '${t}': Invalid JSON format: The file must contain an array of monomers.`),!1))}parseJson(e,t){try{return JSON.parse(e)}catch(e){return console.error(`Bio: Monomer Library File Validator file '${t}': Invalid JSON format:`,e),null}}validateJsonContent(e,t){let n=!0;const r=new Set;for(const s of e){const e=s.symbol??s.id??s.name??"#N/A";if(n=this.validateMonomerSchema(s),!n){console.warn(`Bio: Monomer Library File Validator file ${t}, monomer '${e}' violating JSON schema:`,s,"\nError reason: ",this.validateMonomerSchema.errors,`\nThere may be other errors in ${t} since the validation is stopped after the first error.`," Please, verify that the monomer library file satisfies the JSON schema");break}const o=`${s.polymerType??""}-${e}`;r.has(o)&&console.warn(`Bio: Monomer Library File Validator file ${t}, monomer '${e}' is duplicated.`,"Please, verify that the monomer library file does not contain duplicated monomer symbols."),r.add(o)}return n}}var Me=n(8604);class xe{fileValidator;libHelper;eventManager;logger;filesPromise=Promise.resolve();constructor(e,t,n,r){this.fileValidator=e,this.libHelper=t,this.eventManager=n,this.logger=r,this.eventManager.updateValidLibraryFileListRequested$.subscribe((()=>{this.updateValidLibList().then((()=>{}))})),this.eventManager.updateValidSetFileListRequested$.subscribe((()=>{this.updateValidSetList().then((()=>{}))}))}static objCounter=-1;objId=++xe.objCounter;toLog(){return`MonomerLibFileManager<${this.objId}>`}static async create(e,t,n){const r=await o.dapi.files.readAsText(Me.gt),s=JSON.parse(r),i=new Ne(s);return new xe(i,e,t,n)}async addLibraryFile(e,t,n=!0){try{if(await o.dapi.files.exists(Me.so+`${t}`))return void o.shell.error(`File ${t} already exists`);await this.validateAgainstHELM(e,t),await o.dapi.files.writeAsText(Me.so+`${t}`,e),await this.updateValidLibList(),await o.dapi.files.exists(Me.so+`${t}`)?o.shell.info(`Added ${t} HELM library`):o.shell.error(`Failed to add ${t} library`)}catch(e){console.error(e),o.shell.error(`Failed to add ${t} library`)}}async deleteLibraryFile(e){try{await o.dapi.files.delete(Me.so+`${e}`),await this.updateValidLibList(),o.shell.info(`Deleted ${e} library`)}catch(t){console.error(t),await o.dapi.files.exists(Me.so+`${e}`)?o.shell.error(`Failed to delete ${e} library`):o.shell.warning(`File ${e} already deleted, refresh the list`)}}async loadLibraryFromFile(e,t){let n=[];const r=new a.FileSource(e),s=await r.readAsText(t);n=JSON.parse(s);const o={},i=[];return n.forEach((e=>{const t=e.polymerType,n=e.symbol;i.includes(t)||(o[t]={},i.push(t)),o[t][n]=e})),new we(o,t)}async loadSetFromFile(e,t,n){let r={};const s=new a.FileSource(t),o=await s.readAsText(n);r=JSON.parse(o);const i=r.description,c=Object.entries(r.placeholders).map((([t,n])=>{const r=t,s=n.polymerType,o=n.monomerType,i=n.set;return new Ee(e,r,s,o,i)}));return new Te(i,c)}getValidLibraryPaths(){return this.eventManager.getValidLibPathList()}getValidSetPaths(){return this.eventManager.getValidSetPathList()}async getValidLibraryPathsAsynchronously(){return await this.eventManager.getValidLibraryPathsAsynchronously()}async updateValidLibList(){const e=`${this.toLog()}.updateValidLibList()`;return this.logger.debug(`${e}, start`),this.filesPromise=this.filesPromise.then((async()=>{this.logger.debug(`${e}, IN`);const t=[],n=await this.getLibFileListAtLocation();if(!this.libListHasChanged(n))return void this.logger.debug(`${e}, end, not changed`);for(const e of n){if(!e.endsWith(".json")){t.push(e);continue}const n=await o.dapi.files.readAsText(Me.so+`${e}`);this.isValidHELMLibrary(n,e)||t.push(e)}const r=n.filter((e=>!t.includes(e)));if(this.libListHasChanged(r)&&(this.eventManager.changeValidLibPathList(r),this.libHelper.loadMonomerLib(!0)),r.some((e=>!e.endsWith(".json")))&&this.logger.warning(`Wrong validation: ${r}`),t.length>0){const e=`Invalid monomer library files in ${Me.so}, consider fixing or removing them: ${t.join(", ")}`;this.logger.warning(e)}this.logger.debug(`${e}, OUT`)})),this.logger.debug(`${e}, end`),this.filesPromise}async updateValidSetList(){const e=`${this.toLog()}.updateValidSetList()`;return Ye.logger.debug(`${e}, start`),this.filesPromise=this.filesPromise.then((async()=>{Ye.logger.debug(`${e}, IN`);const t=[],n=await this.getSetFileListAtLocation();if(!this.setListHasChanged(n))return void Ye.logger.debug(`${e}, end, not changed`);for(const e of n)e.endsWith(".json")?await o.dapi.files.readAsText(Me.Es+`${e}`):t.push(e);const r=n.filter((e=>!t.includes(e)));this.setListHasChanged(r)&&(this.eventManager.changeValidSetPathList(r),this.libHelper.loadMonomerSets(!0)),Ye.logger.debug(`${e}, OUT`)})),Ye.logger.debug(`${e}, end`),this.filesPromise}libListHasChanged(e){const t=this.eventManager.getValidLibPathList();return e.length!==t.length||e.some(((e,n)=>e!==t[n]))}setListHasChanged(e){const t=this.eventManager.getValidSetPathList();return e.length!==t.length||e.some(((e,n)=>e!==t[n]))}async validateAgainstHELM(e,t){if(!this.isValidHELMLibrary(e,t))throw new Error(`File ${t} does not satisfy HELM standard`)}isValidHELMLibrary(e,t){return this.fileValidator.validateFile(e,t)}async getLibFileListAtLocation(){const e=`${this.toLog()}.getLibFileListAtLocation()`;this.logger.debug(`${e}, start`);const t=await o.dapi.files.list(Me.so).then((e=>e.map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring(Me.so.length)))}async getSetFileListAtLocation(){const e=`${this.toLog()}.getSetFileListAtLocation()`;this.logger.debug(`${e}, start`);const t=await o.dapi.files.list(Me.Es).then((e=>e.map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring(Me.Es.length)))}}class $e{constructor(){}static _instance;static getInstance(){return $e._instance||($e._instance=new $e),$e._instance}_libFilesUpdateSubject$=new c.BehaviorSubject([]);_setFilesUpdateSubject$=new c.BehaviorSubject([]);_addLibraryFilesSubject$=new c.Subject;_librarySelectionSubject$=new c.Subject;getValidLibPathList(){return this._libFilesUpdateSubject$.getValue()}getValidSetPathList(){return this._setFilesUpdateSubject$.getValue()}async getValidLibraryPathsAsynchronously(){return new Promise((e=>{const t=this._libFilesUpdateSubject$.pipe((0,T.skip)(1)).subscribe((n=>{e(n),t.unsubscribe()}))}))}changeValidLibPathList(e){this._libFilesUpdateSubject$.next(e)}changeValidSetPathList(e){this._setFilesUpdateSubject$.next(e)}get updateUIControlsRequested$(){return this._libFilesUpdateSubject$.pipe()}get updateValidLibraryFileListRequested$(){return this._libFilesUpdateSubject$.pipe()}get updateValidSetFileListRequested$(){return this._setFilesUpdateSubject$.pipe()}get addLibraryFileRequested$(){return this._addLibraryFilesSubject$.pipe()}addLibraryFile(){this._addLibraryFilesSubject$.next()}get librarySelectionRequested$(){return this._librarySelectionSubject$}updateLibrarySelectionStatus(e,t){this._librarySelectionSubject$.next([e,t])}}class Le{logger;_monomerLib=new we({},"MAIN");_monomerSets=new Te("MAIN",[]);_eventManager;get eventManager(){return this._eventManager}async awaitLoaded(e=1/0){return e=e===1/0?6e4:e,await Promise.race([(async()=>{const e=await this.getFileManager();return await e.filesPromise,!0})(),(async()=>(await(0,K.cb)(e),!1))()]).then((t=>{if(!t)throw new Error(`Loading monomer libraries timeout ${e} ms.`)}))}constructor(e){this.logger=e}static objCounter=-1;objId=(()=>{if(++Le.objCounter>0)throw new Error("MonomerLibManager MUST be a singleton.");return Le.objCounter})();toLog(){return`MonomerLibManager<${this.objId}>`}getMonomerLib(){return this._monomerLib}getBioLib(){return this.getMonomerLib()}getMonomerSets(){return this._monomerSets}get duplicateMonomers(){return this._monomerLib.duplicateMonomers}get duplicatesHandled(){return this._monomerLib.duplicatesHandled}assignDuplicatePreferances(e){this._monomerLib.assignDuplicatePreferences(e)}_fileManagerPromise;async getFileManager(){return void 0===this._fileManagerPromise&&(this._fileManagerPromise=(async()=>await xe.create(this,this._eventManager,this.logger))()),this._fileManagerPromise}loadLibrariesPromise=Promise.resolve();async loadMonomerLib(e=!1){const t=`${this.toLog()}.loadMonomerLib()`;return this.logger.debug(`${t}, start`),this.loadLibrariesPromise=this.loadLibrariesPromise.then((async()=>{this.logger.debug(`${t}, IN`);const n=a.TaskBarProgressIndicator.create("Loading monomers ...");try{const[[t],r]=await Promise.all([await this.getFileManager().then((e=>[e.getValidLibraryPaths()])),(0,F.ub)()]),s=t.filter((e=>{const t=!r.exclude.includes(e),n=0===r.explicit.length||r.explicit.includes(e);return t&&n}));let o=0;const i=s.length,[a]=await Promise.all([Promise.all(s.map((e=>this.readLibrary(Me.so,e).catch((t=>{const n=`Loading monomers from '${e}' error: ${t instanceof Error?t.message:t.toString()}`;return new we({},e,n)})).finally((()=>{n.update(Math.round(100*++o/i),`Loading monomers ${o}/${i}`)})))))]);this._monomerLib.updateLibs(a,e)}catch(e){const t=`Loading monomer libraries error: ${e instanceof Error?e.message:e.toString()}`;o.shell.warning(t);const n=e instanceof Error?e.stack:void 0;this.logger.error(t,void 0,n)}finally{n.close(),this.logger.debug(`${t}, OUT`)}})),this.logger.debug(`${t}, end`),this.loadLibrariesPromise}async loadLibraries(e){return this.loadMonomerLib(e)}loadSetsPromise=Promise.resolve();async loadMonomerSets(e=!1){const t=`${this.toLog()}.loadMonomerSets()`;return this.logger.debug(`${t}, start`),this.loadSetsPromise=this.loadSetsPromise.then((async()=>{this.logger.debug(`${t}, IN`);const e=a.TaskBarProgressIndicator.create("Loading monomer sets ...");try{const[[t]]=await Promise.all([await this.getFileManager().then((e=>[e.getValidSetPaths()]))]),n=t.filter((e=>!0));let r=0;const s=n.length,[o]=await Promise.all([Promise.all(n.map((t=>this.readSet(Me.Es,t).catch((e=>{const n=`Loading monomer sets from '${t}' error: ${e instanceof Error?e.message:e.toString()}`;return new Te("Broken monomer set",[],t,n)})).finally((()=>{e.update(Math.round(100*++r/s),`Loading monomers ${r}/${s}`)})))))]);this._monomerSets.updateSets(o)}catch(e){const t=`Loading monomer sets error: ${e instanceof Error?e.message:e.toString()}`;o.shell.warning(t);const n=e instanceof Error?e.stack:void 0;this.logger.error(t,void 0,n)}finally{e.close(),this.logger.debug(`${t}, OUT`)}})),this.logger.debug(`${t}, end`),this.loadSetsPromise}async readLibrary(e,t){const n=await this.getFileManager();return await n.loadLibraryFromFile(e,t)}async readSet(e,t){const n=await this.getFileManager();return await n.loadSetFromFile(this._monomerLib,e,t)}async selectSpecifiedLibraries(e){const t=await this.getInvalidFileNames(e);if(t.length>0)throw new Error(`Cannot select libraries ${t}: no such library in the list`);const n=await(0,F.ub)();n.exclude=(await this.getFileManager()).getValidLibraryPaths().filter((t=>!e.includes(t))),await(0,F.Eu)(n)}async getInvalidFileNames(e){const t=(await this.getFileManager()).getValidLibraryPaths();return e.filter((e=>!t.includes(e)))}async loadMonomerLibForTests(){await(0,F.Eu)(Me.G3),await this.awaitLoaded(1e4),await this.loadMonomerLib(!0)}static async getInstance(){let e=window.$monomerLibHelperPromise;return null==e&&(e=window.$monomerLibHelperPromise=(async()=>{const e=new Le(Ye.logger);return e._eventManager=$e.getInstance(),e})()),e}}n(1757);var Ie=n(3017),Re={};Re.styleTagTransform=v(),Re.setAttributes=g(),Re.insert=m().bind(null,"head"),Re.domAPI=h(),Re.insertStyleElement=b(),u()(Ie.A,Re),Ie.A&&Ie.A.locals&&Ie.A.locals,n(3151);new x.A(new Uint32Array([2,0,0,0,16,0,0,0,134217728,0,0,0,32,0,33554432,0,0,0,0,0,1024,0,0,0,262144,128,0,0,0,0,0,0,0,2,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1048576,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,32,0,0,2,0,32,0,0,0,0,0,0,0,1024,0,0,0,262144,128,0,0,0,0,0,0,0,65536,0,0,524288,0,0,0,0,0,0,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,34603008,0,536870912,64,0,0,0]),2048),new x.A(new Uint32Array([2,0,65600,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,0,262400,128,0,0,0,0,0,0,0,0,0,2097152,524288,0,0,0,1024,0,0,0,524288,0,0,0,0,0,0,0,0,0,512,0,0,34603008,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,8,262144,128,0,0,16,134217728,0,0,0,0,0,0,524288,0,0,0,128,0,0,0,524288,0,0,0,268435456,0,0,0,0,0,512,2147483648,0,34603008,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,98304,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,0,262144,128,33554432,0,0,0,0,33554432,0,1024,1,0,524288,32768,32,0,0,0,0,16,524288,0,0,0,0,0,0,0,0,0,71303168,0,0,34603008,131072,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([134217728,0,65536,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,0,0,128,0,0,0,0,2097216,0,0,0,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,0,0,0,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,1073840128,0,0,0,0,0,0,0,0,67108864,32,0,0,0,0,0,0,0,1024,0,512,0,262144,192,0,268435456,0,0,8200,0,0,0,67108864,0,524296,0,32,0,0,0,0,16,524288,0,0,2147483648,0,0,8,0,0,0,0,0,0,34603008,131072,536870920,4194304,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,150994944,64,0,0,32,0,0,0,0,0,0,0,1024,0,8388608,0,327680,128,0,0,0,0,0,0,0,2,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,256,0,0,0,0,8388608,0,33554432,0,1048576,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,0,0,0,0,268435488,0,0,0,0,0,0,0,1024,0,0,8,262144,128,0,0,0,0,2097152,0,0,67108864,0,0,524288,0,0,0,8,0,0,0,524288,0,0,8192,0,0,0,0,0,0,0,2147483648,0,34668544,0,545259520,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,134217728,0,0,0,32,512,0,0,0,0,0,0,1024,256,0,8388608,262400,128,0,0,0,0,0,0,0,2,0,0,524288,0,0,0,0,0,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,42991616,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2050,0,65536,1048576,0,0,0,0,0,0,0,0,1056,0,0,0,0,0,0,0,1024,0,0,8,262144,128,0,0,0,0,0,536870912,0,2,0,0,1074266112,0,0,0,0,0,0,0,524288,0,0,0,4194304,0,0,0,0,0,0,2147483648,0,34603008,0,536870912,4194304,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,4096,0,0,0,0,0,0,16777216,32,0,0,0,0,0,0,0,1024,0,0,0,262400,128,0,0,0,0,0,0,0,0,0,0,524288,0,0,0,1024,0,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,34603008,0,536871936,67108864,0,0,0]),2048),new x.A(new Uint32Array([0,0,1024,0,0,0,0,0,0,131072,0,1024,32,0,0,0,0,512,0,0,1024,0,0,64,0,128,0,0,1073741824,0,0,138412032,16,0,67108864,0,0,0,0,0,0,8192,0,0,8388608,0,0,8,0,0,0,0,0,0,256,0,0,0,0,553648128,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,4096,0,0,0,0,0,0,0,32,0,0,0,0,2,0,0,1024,0,0,8,262144,128,0,0,16,0,0,0,0,0,0,0,524288,0,0,0,0,0,0,0,524288,0,0,0,268435456,0,0,0,0,0,16777216,2147483648,0,34603008,0,536871936,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,4096,0,32,0,0,0,0,0,268435488,0,0,0,0,0,0,32768,134218752,0,16,8,262144,128,0,1073741824,0,0,8388608,0,0,0,65536,0,524289,0,0,0,0,0,0,0,524288,2048,0,0,0,0,0,0,0,0,0,2147483648,0,34603008,1048576,545259520,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,1073741824,0,0,0,0,0,32,0,0,4,0,0,0,0,1024,0,0,0,262144,128,0,0,0,0,0,0,0,0,0,0,524288,0,0,1048576,0,0,0,0,524288,0,0,0,0,0,0,0,0,0,8388608,0,0,34603008,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,0,0,0,0,0,8,134217728,0,0,67108864,32,0,0,0,0,0,0,0,1024,0,8388608,0,262144,128,0,0,0,0,0,0,0,2,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,536870912,0,0,0,0,1048576,67108864,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,0,0,0,0,0,0,134217728,0,0,0,32,0,0,0,0,0,0,0,1024,0,8388608,0,262144,128,0,0,0,0,0,1073741824,128,2,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,1048576,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,98304,8388608,0,0,0,0,0,0,256,4096,32,0,0,0,0,0,0,0,1024,0,0,0,262144,192,0,0,0,0,0,0,0,0,67108865,0,524288,32768,32,0,0,0,8224,16,524288,0,0,0,0,32,128,0,2097152,0,4194304,8388608,0,34603008,8519680,536870912,131072,262144,0,0]),2048),new x.A(new Uint32Array([2,0,98304,0,0,0,0,0,0,4194304,0,0,32,0,0,0,0,0,0,0,1024,0,0,512,262144,128,33554432,0,0,0,0,33554432,0,0,0,0,524288,0,32,0,0,2,0,16,524288,0,0,0,0,0,4,0,0,0,71303168,262144,0,34603008,131072,536870912,0,0,0,0]),2048);new x.A(new Uint32Array([0,0,0,0,0,0,0,0,0,1024,0,67108864,0,0,0,512,0,0,0,8388608,0,0,512,0,0,64,4,0,0,0,4,0,0,0,67108864,0,524289,0,0,0,0,0,0,16,0,659456,0,256,0,16,0,0,0,268435456,0,0,262144,0,131072,0,0,0,8388608,0]),2048),new x.A(new Uint32Array([0,1073741824,0,0,0,0,0,2147483648,4,67108864,0,67108864,0,256,0,0,0,0,0,0,1024,0,128,0,0,64,0,0,0,0,0,0,0,0,67108864,0,524289,0,65536,0,0,0,0,16,0,131072,0,4,0,0,0,0,0,0,4194304,0,0,2147483648,131072,0,4096,0,0,0]),2048),new x.A(new Uint32Array([0,0,0,0,1024,0,0,0,0,67109888,16384,67108864,0,0,0,0,0,0,0,33562624,1024,33554432,512,16384,0,64,4,0,0,33554432,0,0,0,0,67108864,0,524289,0,0,0,0,0,0,16,0,135168,0,268435456,0,0,0,0,0,268435456,131072,0,0,2147483648,131072,0,0,0,8388608,0]),2048),new x.A(new Uint32Array([8388608,0,0,0,0,0,0,0,0,67108864,0,0,0,4,0,0,0,0,0,0,1024,0,0,16384,0,64,0,0,0,0,0,0,0,2,67108864,0,0,0,0,0,0,0,0,40976,0,0,0,0,0,0,0,0,0,67108864,131072,524288,0,0,8519680,0,1,33554432,1048576,0]),2048),new x.A(new Uint32Array([0,0,131072,1073741824,0,0,0,0,0,67108864,0,0,0,0,0,0,0,0,0,0,1024,0,128,0,0,64,0,0,0,0,0,0,0,32768,67108864,0,0,0,0,0,0,0,0,16,0,0,0,4,0,0,2048,0,0,0,4341760,0,0,0,131072,0,0,33554432,1048576,0]),2048);var Oe,ke=n(857),Ge={};Ge.styleTagTransform=v(),Ge.setAttributes=g(),Ge.insert=m().bind(null,"head"),Ge.domAPI=h(),Ge.insertStyleElement=b(),u()(ke.A,Ge),ke.A&&ke.A.locals&&ke.A.locals,function(e){e.MONOMER="Monomer",e.SYMBOL="Symbol",e.NAME="Name",e.R_GROUPS="~R-Groups",e.MONOMER_TYPE="Monomer Type",e.POLYMER_TYPE="Polymer Type",e.NATURAL_ANALOG="Natural Analog",e.AUTHOR="Author",e.CREATE_DATE="Create Date",e.ID="ID",e.META="Meta",e.SOURCE="Source"}(Oe||(Oe={})),Oe.MONOMER,a.COLUMN_TYPE.STRING,Oe.SYMBOL,a.COLUMN_TYPE.STRING,Oe.NAME,a.COLUMN_TYPE.STRING,Oe.R_GROUPS,a.COLUMN_TYPE.STRING,Oe.MONOMER_TYPE,a.COLUMN_TYPE.STRING,Oe.POLYMER_TYPE,a.COLUMN_TYPE.STRING,Oe.NATURAL_ANALOG,a.COLUMN_TYPE.STRING,Oe.AUTHOR,a.COLUMN_TYPE.STRING,Oe.CREATE_DATE,a.COLUMN_TYPE.DATE_TIME,Oe.ID,a.COLUMN_TYPE.INT,Oe.META,a.COLUMN_TYPE.STRING,Oe.SOURCE,a.COLUMN_TYPE.STRING;var De,He=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};class Fe{constructor(e,t,n=!1,r){var s;this.name="",this.description="",this._isAutomatic=!1,this._autoStartFirstStep=!1,this._currentStep=0,this._isStopped=!1,this._isCancelled=!1,this._isStepProcessed=!1,this._root=i.div([],{id:"demo-script",classes:"tutorials-root tutorials-track demo-app-script"}),this._steps=[],this._mainHeader=i.panel([],"tutorials-main-header"),this._header=i.h2(""),this._headerDiv=i.divH([],"tutorials-root-header"),this._stopStartBtn=i.button(i.iconFA("pause"),(()=>He(this,void 0,void 0,(function*(){return yield this._changeStopState()}))),"Play / pause"),this._restartBtn=i.button(i.iconFA("redo"),(()=>He(this,void 0,void 0,(function*(){return yield this._restartScript()}))),"Restart"),this._nextStepBtn=i.button(i.iconFA("play"),(()=>He(this,void 0,void 0,(function*(){this._isStepProcessed||(yield this._nextStep())}))),"Next step"),this._activity=i.panel([],"tutorials-root-description"),this._progressDiv=i.divV([],"tutorials-root-progress"),this._progress=i.element("progress"),this._progressSteps=i.divText(""),this._closeBtn=i.button(i.iconFA("chevron-left"),(()=>this._closeDock()),"Back to demo"),this.name=e,this.description=t,this._isAutomatic=n,this._autoStartFirstStep=null!==(s=null==r?void 0:r.autoStartFirstStep)&&void 0!==s&&s,this._progress.max=0,this._progress.value=1,Fe.currentObject=this}get steps(){return this._steps}get stepNumber(){return this._steps.length}_addHeader(){this._createHeaderDiv(),this._createProgressDiv(),this._mainHeader.append(this._headerDiv,this._progressDiv)}_createHeaderDiv(){this._header.innerText=this.name,this._headerDiv.append(this._closeBtn),this._headerDiv.append(this._header),this._nextStepBtn.firstChild.className="grok-icon fas fa-play",this._headerDiv.append(this._isAutomatic?this._stopStartBtn:this._nextStepBtn)}_createProgressDiv(){this._progress.max=this.stepNumber,this._progressDiv.append(this._progress),this._progressSteps=i.divText(`Step: ${this._progress.value} of ${this.stepNumber}`),this._progressDiv.append(this._progressSteps)}_addDescription(){var e;this._activity.append(i.div(this.description,"tutorials-root-description"));for(let t=0;t<this.stepNumber;t++){let n=i.iconFA("clock");this._isAutomatic||0===t&&(n=i.iconFA("play",(()=>this._nextStep()),"Next step"),n.className="grok-icon fas fa-play");const r=i.div(this._steps[t].name,"grok-tutorial-entry-instruction"),s=i.div(null===(e=this._steps[t].options)||void 0===e?void 0:e.description,"grok-tutorial-step-description hidden"),o=i.divH([n,r],"grok-tutorial-entry");this._activity.append(o,s)}}_initRoot(){var e,t,n;o.shell.windows.showContextPanel=!0,o.shell.windows.showHelp=!1;const r=o.shell.isInDemo?Array.from(o.shell.view("Browse").dockManager.rootNode.children)[0]:Array.from(o.shell.dockManager.rootNode.children)[0];this._node=o.shell.dockManager.dock(this._root,a.DOCK_TYPE.FILL,r,""),(null===(t=null===(e=r.parent.container.containerElement.firstElementChild)||void 0===e?void 0:e.lastElementChild)||void 0===t?void 0:t.classList.contains("tab-handle-list-container"))&&(null===(n=r.parent.container.containerElement.firstElementChild)||void 0===n||n.lastElementChild.remove()),this._node.container.containerElement.classList.add("tutorials-demo-script-container"),this._addHeader(),this._root.append(this._mainHeader),this._addDescription(),this._root.append(this._activity)}_nextStep(){var e,t;return He(this,void 0,void 0,(function*(){this._isStepProcessed=!0,this._isAutomatic||(this._nextStepBtn.classList.add("disabled"),this._nextStepBtn.firstChild.classList.add("fa-disabled"));const n=this._activity.getElementsByClassName("grok-tutorial-entry")[this._currentStep],r=this._activity.getElementsByClassName("grok-icon")[this._currentStep],s=this._activity.getElementsByClassName("grok-tutorial-step-description")[this._currentStep];r.className="grok-icon far fa-spinner-third fa-spin",s.classList.remove("hidden"),s.classList.add("visible");const c=n,l=(null===(e=this._steps[this._currentStep].options)||void 0===e?void 0:e.delay)?null===(t=this._steps[this._currentStep].options)||void 0===t?void 0:t.delay:2e3;try{o.shell.isInDemo=!0,yield this._steps[this._currentStep].func()}catch(e){o.shell.isInDemo=!1,console.error(e)}this._scrollTo(this._root,c.offsetTop-this._mainHeader.offsetHeight),this._isAutomatic&&(yield this._countdown(n,r,l),yield(0,K.cb)(l));const u=i.iconFA("check");if(r.replaceWith(u),u.className="grok-icon far fa-check",this._progress.value++,this._progressSteps.innerText=`Step: ${this._progress.value} of ${this.stepNumber}`,this._currentStep++,this._isStepProcessed=!1,this._currentStep===this.stepNumber)return this._isAutomatic?this._stopStartBtn.replaceWith(this._restartBtn):this._nextStepBtn.replaceWith(this._restartBtn),void(o.shell.isInDemo=!1);if(!this._isAutomatic){const e=this._activity.getElementsByClassName("grok-icon")[this._currentStep],t=i.iconFA("play",(()=>this._nextStep()),"Next step");t.className="grok-icon fas fa-play",e.replaceWith(t),this._nextStepBtn.classList.remove("disabled"),this._nextStepBtn.firstChild.classList.remove("fa-disabled")}if(o.shell.isInDemo){const e=o.shell.view("Browse");(null==e?void 0:e.preview)instanceof a.TableView&&(yield o.data.detectSemanticTypes(e.preview.dataFrame)),o.shell.isInDemo=!1}}))}_startScript(){return He(this,void 0,void 0,(function*(){for(let e=this._currentStep;e<this.stepNumber&&!this._isStopped&&!this._isCancelled;e++)yield this._nextStep()}))}_scrollTo(e,t){e.focus(),e.scrollTop=t}_countdown(e,t,n){return He(this,void 0,void 0,(function*(){const r=i.div([],"demo-script-countdown");t.classList.add("hidden");let s=n/1e3;const o=this._createSVGIndicator(s);r.append(o),e.prepend(r);const a=setInterval((()=>{s--,0===s&&(clearInterval(a),r.remove(),t.classList.remove("hidden"),t.classList.add("visible"))}),1e3)}))}_createSVGIndicator(e){const t=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","circle");return n.setAttributeNS(null,"cx","7"),n.setAttributeNS(null,"cy","7"),n.setAttributeNS(null,"r","6"),n.setAttributeNS(null,"style",`animation: countdown ${e}s linear infinite forwards`),t.append(n),t}_changeStopState(){return He(this,void 0,void 0,(function*(){const e=this._stopStartBtn.getElementsByClassName("grok-icon");e[0].className="grok-icon fas fa-play",this._isStopped=!this._isStopped,this._isStopped||(e[0].className="grok-icon fal fa-pause",this._isStepProcessed||(yield this._startScript()))}))}_restartScript(){return He(this,void 0,void 0,(function*(){o.shell.dockManager.close(this._node),this._clearRoot(),this._setInitParams(),yield this.start()}))}_clearRoot(){this._root=i.div([],{id:"demo-script",classes:"tutorials-root tutorials-track demo-app-script"}),this._mainHeader=i.panel([],"tutorials-main-header"),this._header=i.h2(""),this._headerDiv=i.divH([],"tutorials-root-header"),this._activity=i.panel([],"tutorials-root-description"),this._progressDiv=i.divV([],"tutorials-root-progress"),this._progress=i.element("progress"),this._progressSteps=i.divText(""),this._progress.max=0,this._progress.value=1}_setInitParams(){this._currentStep=0,this._isStopped=!1,this._isCancelled=!1,this._stopStartBtn.getElementsByClassName("grok-icon")[0].className="grok-icon fal fa-pause",this._nextStepBtn.classList.remove("disabled")}_closeDock(){o.shell.dockManager.close(this._node),this.cancelScript()}cancelScript(){this._isCancelled=!0,Fe.currentObject=null,o.shell.isInDemo=!1}step(e,t,n){return this._steps[this.steps.length]={name:e,func:t,options:n},this}start(){return He(this,void 0,void 0,(function*(){o.shell.isInDemo=!0,this._initRoot(),o.shell.newView(this.name),this._isAutomatic?yield this._startScript():this._autoStartFirstStep&&(yield this._nextStep())}))}}Fe.currentObject=null,function(e){e.X="Embed_X",e.Y="Embed_Y"}(De||(De={})),n(8152),n(966),n(608),n(1619),n(6869),new class{tooltipHandlerTemp="tooltip-handler.Monomer"},a.GridCellRenderer;class Ve{constructor(e,t,n=""){this.target=e,this.debugEnabled=t,this.prefix=n}error(e,t,n){return this.target.error(this.prefix+e,t,n)}warning(e,t){return this.target.warning(this.prefix+e,t)}info(e,t){return this.target.info(this.prefix+e,t)}debug(e,t){if(this.debugEnabled)return this.target.debug(this.prefix+e,t)}}Map;class Ue extends a.Package{_properties;_seqHelper;get seqHelper(){if(!this._seqHelper)throw new Error("Package Bio .seqHelper is not initialized.");return this._seqHelper}_monomerLib;get monomerLib(){if(!this._monomerLib)throw new Error("Package Bio .monomerLib is not initialized.");return this._monomerLib}_monomerSets;get monomerSets(){if(!this._monomerSets)throw new Error("Package Bio .monomerSets is not initialized.");return this._monomerSets}_rdKitModule;get rdKitModule(){if(!this._rdKitModule)throw new Error("Package Bio .rdKitModule is not initialized.");return this._rdKitModule}get properties(){return this._properties}set properties(e){this._properties=e}_initialized=!1;get initialized(){return this._initialized}constructor(e={debug:!1}){super(),super._logger=new Ve(super.logger,e.debug)}completeInit(e,t,n,r){this._seqHelper=e,this._monomerLib=t,this._monomerSets=n,this._rdKitModule=r,this._initialized=!0}handleErrorUI(e){const[t,n]=(0,Ae.AP)(e);o.shell.error(t),this.logger.error(t,void 0,n)}}n(2174),a.Widget,a.DataFrame.fromCsv("seq,value\nATCCGTCGT,0.5\nTGTTCGTCA,0.4\nATGGTCGTA,0.7\nATCCGTGCA,0.1"),["1","1A","1C","2","4","4A","4B","5","6"].join(D.z1),n(8754),n(330),n(9235),OCL,n(294),n(6956),new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}};const Ye=new Ue;async function Be(){return await Le.getInstance()}},8115:(e,t,n)=>{"use strict";n.d(t,{if:()=>l,nI:()=>c});var r=n(4328),s=(n(7389),n(6082)),o=n(8070),i=n(2003),a=n(1407);function c(e,t,n){const r=n?function(e,t){const n=`${t}`.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),r=e.charAt(0)===t,s=e.charAt(e.length-1)===t,o=e.replace(new RegExp(`^${n}|${n}$`,"g"),"");return r?s?`${n}${o}${n}`:`${n}${o}${n}|${n}${o}$`:s?`^${o}${n}|${n}${o}${n}`:`^${o}${n}|${n}${o}${n}|${n}${o}$`}(e,n):e,o=s.BitSet.create(t.length);for(let n=0;n<t.length;n++){const s=t.get(n);(s.match(r)||s===e)&&o.set(n,!0,!1)}return o}async function l(e,t,n){t.version!==t.temp["last-invalidated-version"]&&await async function(e,t){const n=s.TaskBarProgressIndicator.create(`Invalidating molfiles for ${e.name}`);try{await(0,o.cb)(10);const n=new Map,r=await(0,a.R)(e,t,!0,n);e.temp["monomeric-mols"]=r,e.temp["monomers-dict"]=n,e.temp["last-invalidated-version"]=e.version}finally{n.close()}}(t,n);const c=s.Column.string("helm",1).init((t=>e));c.semType=s.SEMTYPE.MACROMOLECULE,c.meta.units=i.Hi.HELM;const l=await(0,a.R)(c,n,!0,t.temp["monomers-dict"]);return(await r.functions.call("Chem:searchSubstructure",{molStringsColumn:t.temp["monomeric-mols"],molString:l.get(0),molBlockFailover:""})).get(0)}n(4870)},966:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(4328),s=n(6082);function o(e,t,n,o=[],i=[]){let a=!0,c="";if(e.semType!==s.SEMTYPE.MACROMOLECULE)r.shell.warning(t+" analysis is allowed for Macromolecules semantic type"),a=!1;else{const r=n.getSeqHandler(e),s=r.notation;if(o.length>0&&!o.some((e=>s.toUpperCase()==e.toUpperCase())))c=`${t} + ' analysis is allowed for Macromolecules with notation ${0==o.length?"any notation":`notation${o.length>1?"s":""} ${o.map((e=>`"${e}"`)).join(", ")} `}.`,a=!1;else if(!r.isHelm()){const e=r.alphabet;i.length>0&&!i.some((t=>e.toUpperCase()==t.toUpperCase()))&&(c=`${t} + ' analysis is allowed for Macromolecules with alphabet ${0==i.length?"any alphabet":`alphabet${i.length>1?"s":""} ${i.map((e=>`"${e}"`)).join(", ")}.`}.`,a=!1)}}return[a,c]}n(4374)},4139:(e,t,n)=>{"use strict";n.d(t,{HX:()=>d,J:()=>l,b9:()=>u,gN:()=>a,uF:()=>o});var r,s,o,i=n(8152);!function(e){e.SPLIT_COL="~split",e.ACTIVITY="~activity",e.ACTIVITY_SCALED="activity_scaled",e.ALIGNED_SEQUENCE="~aligned_sequence",e.AMINO_ACID_RESIDUE="AAR",e.POSITION="Pos",e.P_VALUE="pValue",e.MEAN_DIFFERENCE="Mean difference"}(r||(r={})),function(e){e.AAR="AAR",e.POSITION="Pos",e.SELECTION="selection"}(s||(s={})),function(e){e.MONOMER="Monomer",e.MACROMOLECULE_DIFFERENCE="MacromoleculeDifference",e.ACTIVITY="activity",e.ACTIVITY_SCALED="activityScaled"}(o||(o={}));const a="MSA";var c,l;!function(e){e.CELL_CHANGING="isCellChanging"}(c||(c={})),function(e){e.SEPARATOR="."}(l||(l={}));const u="3.3.1",d={pepsea:{gapOpen:1.53,gapExtend:0,method:i.ZY[0]},kalign:{gapOpen:-1,gapExtend:-1,terminalGap:-1}}},5433:(e,t,n)=>{"use strict";n.d(t,{r:()=>s}),n(6082),n(7389);var r=n(4328);async function s(e,t,n,s){const o=t.getSeqHandler(e).convert(n,s);e.dataFrame.columns.add(o);const i=await r.functions.call("Bio:detectMacromolecule",{col:o});return i&&(o.semType=i),await r.data.detectSemanticTypes(e.dataFrame),o}n(1757),n(2003)},6740:(e,t,n)=>{"use strict";n.d(t,{m8:()=>i});var r=n(4328),s=n(8070),o=n(8152);async function i(e=6e4){const t=await o.Nk.getDockerContainer();await async function(e,t=6e4){let n=e,o=!1;for(let i=0;i<t/200;++i){if(null===n&&(n=await r.dapi.docker.dockerContainers.find(e.id)),a(n)){o=!0;break}switch(n.status){case"stopped":await r.dapi.docker.dockerContainers.run(n.id);break;case"pending change":case"changing":break;case"error":throw new Error("Docker container error state.")}n=null,await(0,s.cb)(200)}if(!o)throw new Error("Docker container start timeout.")}(t,e)}function a(e){return"checking"===e.status||"started"===e.status}},6956:(e,t,n)=>{"use strict";n.d(t,{mP:()=>o,pk:()=>s,xe:()=>r});const r="|",s="$",o="H"},8604:(e,t,n)=>{"use strict";n.d(t,{Es:()=>s,G3:()=>i,VV:()=>a,gt:()=>o,so:()=>r});const r="System:AppData/Bio/monomer-libraries/",s="System:AppData/Bio/monomer-sets/",o="System:AppData/Bio/tests/libraries/HELMmonomerSchema.json",i={explicit:["HELMCoreLibrary.json","polytool-lib.json"],exclude:[],duplicateMonomerPreferences:{}},a={PEPTIDE:326,RNA:383,CHEM:0}},1619:(e,t,n)=>{"use strict";n.d(t,{D:()=>N});var r=n(4328),s=n(6082),o=n(7389),i=n(8070),a=n(2003),c=n(608),l=n(8152),u=n(966),d=n(4139),h=n(6740),p=n(5072),m=n.n(p),f=n(7825),g=n.n(f),y=n(7659),b=n.n(y),w=n(5056),v=n.n(w),A=n(540),E=n.n(A),T=n(1113),C=n.n(T),S=n(6369),_={};_.styleTagTransform=C(),_.setAttributes=v(),_.insert=b().bind(null,"head"),_.domAPI=g(),_.insertStyleElement=E(),m()(S.A,_),S.A&&S.A.locals&&S.A.locals;var P=n(4374);async function N(e,t){return new Promise((async(n,a)=>{e.clustersCol??=null,e.pepsea??={},e.pepsea.method??=d.HX.pepsea.method,e.pepsea.gapOpen??=d.HX.pepsea.gapOpen,e.pepsea.gapExtend??=d.HX.pepsea.gapExtend;const u=e.col?.dataFrame??r.shell.t,h=e.col??u.columns.bySemType(s.SEMTYPE.MACROMOLECULE);if(null==h){const e="Multiple Sequence Alignment analysis requires a dataset with a macromolecule column.";return r.shell.warning(e),void a(new c.Ap(o.divText(e)))}const p=o.input.choice("Method",{value:e.pepsea.method,items:l.ZY});p.setTooltip("Alignment method");const m=o.input.float("Terminal gap",{value:e?.kalign?.terminalGap});m.setTooltip("Penalty for opening a gap at the beginning or end of the sequence");const f=o.p(`Kalign version: ${d.b9}`,"kalign-version"),g=o.input.float("Gap open",{value:e.pepsea.gapOpen});g.setTooltip("Gap opening penalty at group-to-group alignment");const y=o.input.float("Gap extend",{value:e.pepsea.gapExtend});y.setTooltip("Gap extension penalty to skip the alignment");const b=o.inputs([g,y,m]),w=o.button("Alignment parameters",(()=>{b.hidden=!b.hidden,[g,y,m].forEach((e=>{e.root.style.removeProperty("max-width"),e.captionLabel.style.removeProperty("max-width")}))}),"Adjust alignment parameters such as penalties for opening and extending gaps");w.classList.add("msa-params-button"),b.hidden=!0,w.prepend(o.icons.settings((()=>null)));const v=[p.root.style],A=[m.root.style,f.style];let E,T=h;const C=o.input.column("Sequence",{table:u,value:h,onValueChanged:async e=>{if(!e||e.semType!==s.SEMTYPE.MACROMOLECULE)return P.disabled=!0,await(0,i.cb)(0),void(C.value=T);T=e,P.disabled=!1,E=await x(C.value,u,t,v,A,p,S,g,y,m)},filter:e=>e.semType===s.SEMTYPE.MACROMOLECULE});C.setTooltip("Sequences column to use for alignment");const S=o.input.column("Clusters",{table:u,value:e.clustersCol});S.nullable=!0;const _=o.dialog("MSA").add(C).add(S).add(p).add(b).add(w).add(f).onOK((async()=>{await M(C,u,E,n,a)})),P=_.getButton("OK");if(C.fireChanged(),e.col)return E=await x(e.col,u,t,v,A,p,S,g,y,m),void await M(C,u,E,n,a);_.show()}))}async function M(e,t,n,o,i){let a=null;const c=s.TaskBarProgressIndicator.create("Analyze for MSA ...");try{if(e.fireChanged(),e.value.semType!==s.SEMTYPE.MACROMOLECULE)throw new Error("Chosen column has to be of Macromolecule semantic type");if(void 0===n)throw new Error("Invalid column format");if(a=await n(),null==a)return i("PepSeA container has not started");t.columns.add(a),await r.data.detectSemanticTypes(t),o(a)}catch(e){i(e)}finally{c.close()}}async function x(e,t,n,o,i,p,m,f,g,y){try{if(e.semType!==s.SEMTYPE.MACROMOLECULE)return;const r=t.columns.getUnusedName(`msa(${e.name})`);if((0,u.l)(e,e.name,n,[a.Hi.FASTA,a.Hi.SEPARATOR],[a.YI.DNA,a.YI.RNA,a.YI.PT])[0]){$(o,i,"kalign"),f.value=null,g.value=null,y.value=null;const t=n.getSeqHandler(e),s=t.isFasta()?e:t.convert(a.Hi.FASTA);return async()=>await(0,c.eE)(s,!1,r,m.value)}if((0,u.l)(e,e.name,n,[a.Hi.HELM],[])[0])return $(o,i,"pepsea"),f.value??=d.HX.pepsea.gapOpen,g.value??=d.HX.pepsea.gapExtend,async()=>(await(0,h.m8)(),(0,l.GD)(e,r,p.value,f.value,g.value,m.value));if((0,u.l)(e,e.name,n,[a.Hi.SEPARATOR],[a.YI.UN])[0]){const t=n.getSeqHandler(e).convert(a.Hi.HELM);return $(o,i,"pepsea"),f.value??=d.HX.pepsea.gapOpen,g.value??=d.HX.pepsea.gapExtend,async()=>(await(0,h.m8)(),(0,l.GD)(t,r,p.value,f.value,g.value,m.value))}return f.value=null,g.value=null,y.value=null,void $(o,i,"kalign")}catch(e){const t=e instanceof Error?e.message:e.toString();r.shell.error(t),P._package.logger.error(t)}}function $(e,t,n){if("kalign"===n){for(const t of e)t.display="none";for(const e of t)e.removeProperty("display")}else{for(const e of t)e.display="none";for(const t of e)t.removeProperty("display")}}},608:(e,t,n)=>{"use strict";n.d(t,{Ap:()=>G,aZ:()=>V,eE:()=>H});var r=n(7389),s=n(6082),o=n(1991),i=n.n(o),a=n(3516),c=n(2003);const l=Symbol("Comlink.proxy"),u=Symbol("Comlink.endpoint"),d=Symbol("Comlink.releaseProxy"),h=Symbol("Comlink.thrown"),p=e=>"object"==typeof e&&null!==e||"function"==typeof e,m=new Map([["proxy",{canHandle:e=>p(e)&&e[l],serialize(e){const{port1:t,port2:n}=new MessageChannel;return f(e,t),[n,[n]]},deserialize:e=>(e.start(),y(e))}],["throw",{canHandle:e=>p(e)&&h in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function f(e,t=self){t.addEventListener("message",(function n(r){if(!r||!r.data)return;const{id:s,type:o,path:i}=Object.assign({path:[]},r.data),a=(r.data.argumentList||[]).map(C);let c;try{const t=i.slice(0,-1).reduce(((e,t)=>e[t]),e),n=i.reduce(((e,t)=>e[t]),e);switch(o){case"GET":c=n;break;case"SET":t[i.slice(-1)[0]]=C(r.data.value),c=!0;break;case"APPLY":c=n.apply(t,a);break;case"CONSTRUCT":c=function(e){return Object.assign(e,{[l]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;f(e,n),c=function(e,t){return E.set(e,t),e}(t,[t])}break;case"RELEASE":c=void 0;break;default:return}}catch(e){c={value:e,[h]:0}}Promise.resolve(c).catch((e=>({value:e,[h]:0}))).then((e=>{const[r,i]=T(e);t.postMessage(Object.assign(Object.assign({},r),{id:s}),i),"RELEASE"===o&&(t.removeEventListener("message",n),g(t))}))})),t.start&&t.start()}function g(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function y(e,t){return w(e,[],t)}function b(e){if(e)throw new Error("Proxy has been released and is not useable")}function w(e,t=[],n=function(){}){let r=!1;const s=new Proxy(n,{get(n,o){if(b(r),o===d)return()=>S(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{g(e),r=!0}));if("then"===o){if(0===t.length)return{then:()=>s};const n=S(e,{type:"GET",path:t.map((e=>e.toString()))}).then(C);return n.then.bind(n)}return w(e,[...t,o])},set(n,s,o){b(r);const[i,a]=T(o);return S(e,{type:"SET",path:[...t,s].map((e=>e.toString())),value:i},a).then(C)},apply(n,s,o){b(r);const i=t[t.length-1];if(i===u)return S(e,{type:"ENDPOINT"}).then(C);if("bind"===i)return w(e,t.slice(0,-1));const[a,c]=A(o);return S(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:a},c).then(C)},construct(n,s){b(r);const[o,i]=A(s);return S(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:o},i).then(C)}});return s}function v(e){return Array.prototype.concat.apply([],e)}function A(e){const t=e.map(T);return[t.map((e=>e[0])),v(t.map((e=>e[1])))]}const E=new WeakMap;function T(e){for(const[t,n]of m)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},E.get(e)||[]]}function C(e){switch(e.type){case"HANDLER":return m.get(e.name).deserialize(e.value);case"RAW":return e.value}}function S(e,t,n){return new Promise((r=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){!n.data||!n.data.id||n.data.id!==s||(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),n)}))}const _="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0ICQ9U3ltYm9sKCJDb21saW5rLnByb3h5IiksQT1TeW1ib2woIkNvbWxpbmsuZW5kcG9pbnQiKSxSPVN5bWJvbCgiQ29tbGluay5yZWxlYXNlUHJveHkiKSx5PVN5bWJvbCgiQ29tbGluay50aHJvd24iKSxfPWU9PnR5cGVvZiBlPT0ib2JqZWN0IiYmZSE9PW51bGx8fHR5cGVvZiBlPT0iZnVuY3Rpb24iLEw9e2NhbkhhbmRsZTplPT5fKGUpJiZlWyRdLHNlcmlhbGl6ZShlKXtjb25zdHtwb3J0MTpyLHBvcnQyOml9PW5ldyBNZXNzYWdlQ2hhbm5lbDtyZXR1cm4gdyhlLHIpLFtpLFtpXV19LGRlc2VyaWFsaXplKGUpe3JldHVybiBlLnN0YXJ0KCksQyhlKX19LE89e2NhbkhhbmRsZTplPT5fKGUpJiZ5IGluIGUsc2VyaWFsaXplKHt2YWx1ZTplfSl7bGV0IHI7cmV0dXJuIGUgaW5zdGFuY2VvZiBFcnJvcj9yPXtpc0Vycm9yOiEwLHZhbHVlOnttZXNzYWdlOmUubWVzc2FnZSxuYW1lOmUubmFtZSxzdGFjazplLnN0YWNrfX06cj17aXNFcnJvcjohMSx2YWx1ZTplfSxbcixbXV19LGRlc2VyaWFsaXplKGUpe3Rocm93IGUuaXNFcnJvcj9PYmplY3QuYXNzaWduKG5ldyBFcnJvcihlLnZhbHVlLm1lc3NhZ2UpLGUudmFsdWUpOmUudmFsdWV9fSxFPW5ldyBNYXAoW1sicHJveHkiLExdLFsidGhyb3ciLE9dXSk7ZnVuY3Rpb24gdyhlLHI9c2VsZil7ci5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixmdW5jdGlvbiBpKHMpe2lmKCFzfHwhcy5kYXRhKXJldHVybjtjb25zdHtpZDpvLHR5cGU6YSxwYXRoOm59PU9iamVjdC5hc3NpZ24oe3BhdGg6W119LHMuZGF0YSksYz0ocy5kYXRhLmFyZ3VtZW50TGlzdHx8W10pLm1hcChtKTtsZXQgbDt0cnl7Y29uc3QgdT1uLnNsaWNlKDAsLTEpLnJlZHVjZSgoZCxwKT0+ZFtwXSxlKSxmPW4ucmVkdWNlKChkLHApPT5kW3BdLGUpO3N3aXRjaChhKXtjYXNlIkdFVCI6bD1mO2JyZWFrO2Nhc2UiU0VUIjp1W24uc2xpY2UoLTEpWzBdXT1tKHMuZGF0YS52YWx1ZSksbD0hMDticmVhaztjYXNlIkFQUExZIjpsPWYuYXBwbHkodSxjKTticmVhaztjYXNlIkNPTlNUUlVDVCI6e2NvbnN0IGQ9bmV3IGYoLi4uYyk7bD16KGQpfWJyZWFrO2Nhc2UiRU5EUE9JTlQiOntjb25zdHtwb3J0MTpkLHBvcnQyOnB9PW5ldyBNZXNzYWdlQ2hhbm5lbDt3KGUscCksbD1OKGQsW2RdKX1icmVhaztjYXNlIlJFTEVBU0UiOmw9dm9pZCAwO2JyZWFrO2RlZmF1bHQ6cmV0dXJufX1jYXRjaCh1KXtsPXt2YWx1ZTp1LFt5XTowfX1Qcm9taXNlLnJlc29sdmUobCkuY2F0Y2godT0+KHt2YWx1ZTp1LFt5XTowfSkpLnRoZW4odT0+e2NvbnN0W2YsZF09Uyh1KTtyLnBvc3RNZXNzYWdlKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxmKSx7aWQ6b30pLGQpLGE9PT0iUkVMRUFTRSImJihyLnJlbW92ZUV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGkpLE0ocikpfSl9KSxyLnN0YXJ0JiZyLnN0YXJ0KCl9ZnVuY3Rpb24gVChlKXtyZXR1cm4gZS5jb25zdHJ1Y3Rvci5uYW1lPT09Ik1lc3NhZ2VQb3J0In1mdW5jdGlvbiBNKGUpe1QoZSkmJmUuY2xvc2UoKX1mdW5jdGlvbiBDKGUscil7cmV0dXJuIGIoZSxbXSxyKX1mdW5jdGlvbiBoKGUpe2lmKGUpdGhyb3cgbmV3IEVycm9yKCJQcm94eSBoYXMgYmVlbiByZWxlYXNlZCBhbmQgaXMgbm90IHVzZWFibGUiKX1mdW5jdGlvbiBiKGUscj1bXSxpPWZ1bmN0aW9uKCl7fSl7bGV0IHM9ITE7Y29uc3Qgbz1uZXcgUHJveHkoaSx7Z2V0KGEsbil7aWYoaChzKSxuPT09UilyZXR1cm4oKT0+ZyhlLHt0eXBlOiJSRUxFQVNFIixwYXRoOnIubWFwKGM9PmMudG9TdHJpbmcoKSl9KS50aGVuKCgpPT57TShlKSxzPSEwfSk7aWYobj09PSJ0aGVuIil7aWYoci5sZW5ndGg9PT0wKXJldHVybnt0aGVuOigpPT5vfTtjb25zdCBjPWcoZSx7dHlwZToiR0VUIixwYXRoOnIubWFwKGw9PmwudG9TdHJpbmcoKSl9KS50aGVuKG0pO3JldHVybiBjLnRoZW4uYmluZChjKX1yZXR1cm4gYihlLFsuLi5yLG5dKX0sc2V0KGEsbixjKXtoKHMpO2NvbnN0W2wsdV09UyhjKTtyZXR1cm4gZyhlLHt0eXBlOiJTRVQiLHBhdGg6Wy4uLnIsbl0ubWFwKGY9PmYudG9TdHJpbmcoKSksdmFsdWU6bH0sdSkudGhlbihtKX0sYXBwbHkoYSxuLGMpe2gocyk7Y29uc3QgbD1yW3IubGVuZ3RoLTFdO2lmKGw9PT1BKXJldHVybiBnKGUse3R5cGU6IkVORFBPSU5UIn0pLnRoZW4obSk7aWYobD09PSJiaW5kIilyZXR1cm4gYihlLHIuc2xpY2UoMCwtMSkpO2NvbnN0W3UsZl09RihjKTtyZXR1cm4gZyhlLHt0eXBlOiJBUFBMWSIscGF0aDpyLm1hcChkPT5kLnRvU3RyaW5nKCkpLGFyZ3VtZW50TGlzdDp1fSxmKS50aGVuKG0pfSxjb25zdHJ1Y3QoYSxuKXtoKHMpO2NvbnN0W2MsbF09RihuKTtyZXR1cm4gZyhlLHt0eXBlOiJDT05TVFJVQ1QiLHBhdGg6ci5tYXAodT0+dS50b1N0cmluZygpKSxhcmd1bWVudExpc3Q6Y30sbCkudGhlbihtKX19KTtyZXR1cm4gb31mdW5jdGlvbiBEKGUpe3JldHVybiBBcnJheS5wcm90b3R5cGUuY29uY2F0LmFwcGx5KFtdLGUpfWZ1bmN0aW9uIEYoZSl7Y29uc3Qgcj1lLm1hcChTKTtyZXR1cm5bci5tYXAoaT0+aVswXSksRChyLm1hcChpPT5pWzFdKSldfWNvbnN0IFA9bmV3IFdlYWtNYXA7ZnVuY3Rpb24gTihlLHIpe3JldHVybiBQLnNldChlLHIpLGV9ZnVuY3Rpb24geihlKXtyZXR1cm4gT2JqZWN0LmFzc2lnbihlLHtbJF06ITB9KX1mdW5jdGlvbiBTKGUpe2Zvcihjb25zdFtyLGldb2YgRSlpZihpLmNhbkhhbmRsZShlKSl7Y29uc3RbcyxvXT1pLnNlcmlhbGl6ZShlKTtyZXR1cm5be3R5cGU6IkhBTkRMRVIiLG5hbWU6cix2YWx1ZTpzfSxvXX1yZXR1cm5be3R5cGU6IlJBVyIsdmFsdWU6ZX0sUC5nZXQoZSl8fFtdXX1mdW5jdGlvbiBtKGUpe3N3aXRjaChlLnR5cGUpe2Nhc2UiSEFORExFUiI6cmV0dXJuIEUuZ2V0KGUubmFtZSkuZGVzZXJpYWxpemUoZS52YWx1ZSk7Y2FzZSJSQVciOnJldHVybiBlLnZhbHVlfX1mdW5jdGlvbiBnKGUscixpKXtyZXR1cm4gbmV3IFByb21pc2Uocz0+e2NvbnN0IG89VSgpO2UuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24gYShuKXshbi5kYXRhfHwhbi5kYXRhLmlkfHxuLmRhdGEuaWQhPT1vfHwoZS5yZW1vdmVFdmVudExpc3RlbmVyKCJtZXNzYWdlIixhKSxzKG4uZGF0YSkpfSksZS5zdGFydCYmZS5zdGFydCgpLGUucG9zdE1lc3NhZ2UoT2JqZWN0LmFzc2lnbih7aWQ6b30sciksaSl9KX1mdW5jdGlvbiBVKCl7cmV0dXJuIG5ldyBBcnJheSg0KS5maWxsKDApLm1hcCgoKT0+TWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpKk51bWJlci5NQVhfU0FGRV9JTlRFR0VSKS50b1N0cmluZygxNikpLmpvaW4oIi0iKX1jb25zdCBXPWFzeW5jKCk9PldlYkFzc2VtYmx5LnZhbGlkYXRlKG5ldyBVaW50OEFycmF5KFswLDk3LDExNSwxMDksMSwwLDAsMCwxLDUsMSw5NiwwLDEsMTIzLDMsMiwxLDAsMTAsMTAsMSw4LDAsNjUsMCwyNTMsMTUsMjUzLDk4LDExXSkpLGs9ImVhZ2VyIix4PSJsYXp5IixqPXtzc3c6WyJzaW1kIl0sbWluaW1hcDI6WyJzaW1kIl19LHQ9e3Rvb2xzOltdLGNvbmZpZzp7fSxmaWxlczpbXSxiYXNlOnt9LGZzOnt9LGFzeW5jIGluaXQoKXtpZih0LnRvb2xzLmxlbmd0aD09PTApdGhyb3ciRXhwZWN0aW5nIGF0IGxlYXN0IDEgdG9vbC4iO2lmKG5ldyBTZXQodC50b29scy5tYXAocj0+YCR7ci50b29sfS8ke3IucHJvZ3JhbXx8ci50b29sfWApKS5zaXplIT09dC50b29scy5sZW5ndGgpdGhyb3ciRm91bmQgZHVwbGljYXRlIHRvb2xzOyBjYW4gb25seSBoYXZlIGVhY2ggdG9vbC9wcm9ncmFtIGNvbWJpbmF0aW9uIGF0IG1vc3Qgb25jZS4iO2lmKHQuYmFzZT10LnRvb2xzLmZpbmQocj0+ci5yZWluaXQhPT0hMCksIXQuYmFzZSl0aHJvdyJDb3VsZCBub3QgZmluZCBhIHRvb2wgd2l0aCBgcmVpbml0OiBmYWxzZWAgdG8gdXNlIGFzIHRoZSBiYXNlIG1vZHVsZS4gVG8gZml4IHRoaXMgaXNzdWUsIGluY2x1ZGUgdGhlIHRvb2wgYGJhc2UvMS4wLjBgIHdoZW4gaW5pdGlhbGl6aW5nIEFpb2xpLiI7cmV0dXJuIHQuYmFzZS5pc0Jhc2VNb2R1bGU9ITAsYXdhaXQgdGhpcy5fc2V0dXAodC5iYXNlKSxhd2FpdCB0aGlzLl9pbml0TW9kdWxlcygpLHQuX2xvZygiUmVhZHkiKSwhMH0sYXN5bmMgX2luaXRNb2R1bGVzKCl7YXdhaXQgUHJvbWlzZS5hbGwodC50b29scy5tYXAodGhpcy5fc2V0dXApKSxhd2FpdCB0aGlzLl9zZXR1cEZTKCl9LG1vdW50KGU9W10pe2NvbnN0IHI9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyRGF0YX1gLGk9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyTW91bnRlZH1gO2xldCBzPVtdLG89W10sYT1bXTshQXJyYXkuaXNBcnJheShlKSYmIShlIGluc3RhbmNlb2YgRmlsZUxpc3QpJiYoZT1bZV0pLHQuX2xvZyhgTW91bnRpbmcgJHtlLmxlbmd0aH0gZmlsZXNgKTtmb3IobGV0IG4gb2YgZSl7aWYobiBpbnN0YW5jZW9mIEZpbGV8fChuPT1udWxsP3ZvaWQgMDpuLmRhdGEpaW5zdGFuY2VvZiBCbG9iJiZuLm5hbWV8fHR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmbi5uYW1lKXR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmKG4uZGF0YT1uZXcgQmxvYihbbi5kYXRhXSx7dHlwZToidGV4dC9wbGFpbiJ9KSkscy5wdXNoKG4pO2Vsc2UgaWYobi5uYW1lJiZuLnVybClvLnB1c2gobik7ZWxzZSBpZih0eXBlb2Ygbj09InN0cmluZyImJm4uc3RhcnRzV2l0aCgiaHR0cCIpKW49e3VybDpuLG5hbWU6bi5zcGxpdCgiLy8iKS5wb3AoKS5yZXBsYWNlKC9cLy9nLCItIil9LG8ucHVzaChuKTtlbHNlIHRocm93J0Nhbm5vdCBtb3VudCBmaWxlKHMpIHNwZWNpZmllZC4gTXVzdCBiZSBhIEZpbGUsIEJsb2IsIGEgVVJMIHN0cmluZywgb3IgeyBuYW1lOiAiZmlsZS50eHQiLCBkYXRhOiAic3RyaW5nIiB9Lic7YS5wdXNoKG4ubmFtZSl9dHJ5e3QuZnMudW5tb3VudChpKX1jYXRjaHt9Zm9yKGxldCBuIG9mIG8pdC5mcy5jcmVhdGVMYXp5RmlsZShyLG4ubmFtZSxuLnVybCwhMCwhMCk7cmV0dXJuIHQuZmlsZXM9dC5maWxlcy5jb25jYXQocyksdC5iYXNlLm1vZHVsZS5GUy5tb3VudCh0LmJhc2UubW9kdWxlLldPUktFUkZTLHtmaWxlczp0LmZpbGVzLmZpbHRlcihuPT5uIGluc3RhbmNlb2YgRmlsZSksYmxvYnM6dC5maWxlcy5maWx0ZXIobj0+KG49PW51bGw/dm9pZCAwOm4uZGF0YSlpbnN0YW5jZW9mIEJsb2IpfSxpKSxzLm1hcChuPT57Y29uc3QgYz1gJHtpfS8ke24ubmFtZX1gLGw9YCR7cn0vJHtuLm5hbWV9YDt0cnl7dC5mcy51bmxpbmsobCl9Y2F0Y2h7fXQuX2xvZyhgQ3JlYXRpbmcgc3ltbGluazogJHtsfSAtLT4gJHtjfWApLHQuZnMuc3ltbGluayhjLGwpfSksYS5tYXAobj0+YCR7cn0vJHtufWApfSxhc3luYyBleGVjKGUscj1udWxsKXtpZih0Ll9sb2coYEV4ZWN1dGluZyAlYyR7ZX0lYyBhcmdzPSR7cn1gLCJjb2xvcjpkYXJrYmx1ZTsgZm9udC13ZWlnaHQ6Ym9sZCIsIiIpLCFlKXRocm93IkV4cGVjdGluZyBhIGNvbW1hbmQiO2xldCBpPWU7cj09bnVsbCYmKHI9ZS5zcGxpdCgiICIpLGk9ci5zaGlmdCgpKTtjb25zdCBzPXQudG9vbHMuZmluZChhPT57dmFyIGM7bGV0IG49aTtyZXR1cm4oKGM9YT09bnVsbD92b2lkIDA6YS5mZWF0dXJlcyk9PW51bGw/dm9pZCAwOmMuc2ltZCk9PT0hMCYmKG49YCR7bn0tc2ltZGApLGEucHJvZ3JhbT09bn0pO2lmKHM9PW51bGwpdGhyb3dgUHJvZ3JhbSAke2l9IG5vdCBmb3VuZC5gO3Muc3Rkb3V0PSIiLHMuc3RkZXJyPSIiLHMubG9hZGluZz09eCYmKHMubG9hZGluZz1rLGF3YWl0IHRoaXMuX2luaXRNb2R1bGVzKCkpO3RyeXtzLm1vZHVsZS5jYWxsTWFpbihyKX1jYXRjaChhKXtjb25zb2xlLmVycm9yKGEpfXRyeXtzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzFdKSxzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzJdKX1jYXRjaHt9cy5tb2R1bGUuRlMuc3RyZWFtc1sxXT1zLm1vZHVsZS5GUy5vcGVuKCIvZGV2L3N0ZG91dCIsInciKSxzLm1vZHVsZS5GUy5zdHJlYW1zWzJdPXMubW9kdWxlLkZTLm9wZW4oIi9kZXYvc3RkZXJyIiwidyIpO2xldCBvPXtzdGRvdXQ6cy5zdGRvdXQsc3RkZXJyOnMuc3RkZXJyfTtyZXR1cm4gdC5jb25maWcucHJpbnRJbnRlcmxlYXZlZCYmKG89cy5zdGRvdXQpLHMucmVpbml0PT09ITAmJmF3YWl0IHRoaXMucmVpbml0KHMudG9vbCksb30sY2F0KGUpe3JldHVybiB0Ll9maWxlb3AoImNhdCIsZSl9LGxzKGUpe3JldHVybiB0Ll9maWxlb3AoImxzIixlKX0sZG93bmxvYWQoZSl7cmV0dXJuIHQuX2ZpbGVvcCgiZG93bmxvYWQiLGUpfSxwd2QoKXtyZXR1cm4gdC5mcy5jd2QoKX0sY2QoZSl7Zm9yKGxldCByIG9mIHQudG9vbHMpIXIubW9kdWxlfHxyLm1vZHVsZS5GUy5jaGRpcihlKX0sbWtkaXIoZSl7cmV0dXJuIHQuZnMubWtkaXIoZSksITB9LHJlYWQoe3BhdGg6ZSxsZW5ndGg6cixmbGFnOmk9InIiLG9mZnNldDpzPTAscG9zaXRpb246bz0wfSl7Y29uc3QgYT10LmZzLm9wZW4oZSxpKSxuPW5ldyBVaW50OEFycmF5KHIpO3JldHVybiB0LmZzLnJlYWQoYSxuLHMscixvKSx0LmZzLmNsb3NlKGEpLG59LHdyaXRlKHtwYXRoOmUsYnVmZmVyOnIsZmxhZzppPSJ3KyIsb2Zmc2V0OnM9MCxwb3NpdGlvbjpvPTB9KXtjb25zdCBhPXQuZnMub3BlbihlLGkpO3QuZnMud3JpdGUoYSxyLHMsci5sZW5ndGgsbyksdC5mcy5jbG9zZShhKX0sYXN5bmMgcmVpbml0KGUpe2NvbnN0IHI9dC50b29scy5maW5kKHM9PnMudG9vbD09ZSksaT10LmJhc2UubW9kdWxlLkZTLmN3ZCgpO09iamVjdC5hc3NpZ24ocixyLmNvbmZpZyksci5yZWFkeT0hMSxhd2FpdCB0aGlzLmluaXQoKSxyLmlzQmFzZU1vZHVsZSYmdGhpcy5tb3VudCgpLHRoaXMuY2QoaSl9LF9zdGRpblR4dDoiIixfc3RkaW5QdHI6MCxnZXQgc3RkaW4oKXtyZXR1cm4gdC5fc3RkaW5UeHR9LHNldCBzdGRpbihlPSIiKXt0Ll9sb2coYFNldHRpbmcgc3RkaW4gdG8gJWMke2V9JWNgLCJjb2xvcjpkYXJrYmx1ZSIsIiIpLHQuX3N0ZGluVHh0PWUsdC5fc3RkaW5QdHI9MH0sYXN5bmMgX3NldHVwKGUpe2lmKGUucmVhZHkpcmV0dXJuO2lmKHQuX2xvZyhgU2V0dGluZyB1cCAke2UudG9vbH0gKGJhc2UgPSAke2UuaXNCYXNlTW9kdWxlPT09ITB9KS4uLmApLGUuY29uZmlnPU9iamVjdC5hc3NpZ24oe30sZSksZS51cmxQcmVmaXh8fChlLnVybFByZWZpeD1gJHt0LmNvbmZpZy51cmxDRE59LyR7ZS50b29sfS8ke2UudmVyc2lvbn1gKSxlLnByb2dyYW18fChlLnByb2dyYW09ZS50b29sKSxlLmZlYXR1cmVzfHwoZS5mZWF0dXJlcz17fSwoaltlLnByb2dyYW1dfHxbXSkuaW5jbHVkZXMoInNpbWQiKSYmKGF3YWl0IFcoKT8oZS5wcm9ncmFtKz0iLXNpbWQiLGUuZmVhdHVyZXMuc2ltZD0hMCk6dC5fbG9nKGBXZWJBc3NlbWJseSBTSU1EIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhpcyBicm93c2VyOyB3aWxsIGxvYWQgbm9uLVNJTUQgdmVyc2lvbiBvZiAke2UucHJvZ3JhbX0uYCkpKSxlLmlzQmFzZU1vZHVsZSYmKGUubG9hZGluZz1rKSxlLmxvYWRpbmc9PT14KXt0Ll9sb2coYFdpbGwgbGF6eS1sb2FkICR7ZS50b29sfTsgc2tpcHBpbmcgaW5pdGlhbGl6YXRpb24uYCk7cmV0dXJufXNlbGYuaW1wb3J0U2NyaXB0cyhgJHtlLnVybFByZWZpeH0vJHtlLnByb2dyYW19LmpzYCksZS5tb2R1bGU9YXdhaXQgTW9kdWxlKHt0aGlzUHJvZ3JhbTplLnByb2dyYW0sbG9jYXRlRmlsZTooaSxzKT0+YCR7ZS51cmxQcmVmaXh9LyR7aX1gLHN0ZGluOigpPT50Ll9zdGRpblB0cjx0LnN0ZGluLmxlbmd0aD90LnN0ZGluLmNoYXJDb2RlQXQodC5fc3RkaW5QdHIrKyk6KHQuc3RkaW49IiIsbnVsbCkscHJpbnQ6aT0+e2Uuc3Rkb3V0Kz1pK2AKYCx0LmNvbmZpZy5wcmludFN0cmVhbSYmcG9zdE1lc3NhZ2Uoe3R5cGU6ImJpb3dhc20iLHZhbHVlOntzdGRvdXQ6aX19KX0scHJpbnRFcnI6aT0+e2NvbnN0IHM9dC5jb25maWcucHJpbnRJbnRlcmxlYXZlZD8ic3Rkb3V0Ijoic3RkZXJyIjtlW3NdKz1pK2AKYCx0LmNvbmZpZy5wcmludFN0cmVhbSYmcG9zdE1lc3NhZ2Uoe3R5cGU6ImJpb3dhc20iLHZhbHVlOntbc106aX19KX19KTtjb25zdCByPWUubW9kdWxlLkZTO2UuaXNCYXNlTW9kdWxlPyh0Ll9sb2coYFNldHRpbmcgdXAgJHtlLnRvb2x9IHdpdGggYmFzZSBtb2R1bGUgZmlsZXN5c3RlbS4uLmApLHIubWtkaXIodC5jb25maWcuZGlyU2hhcmVkLDUxMSksci5ta2RpcihgJHt0LmNvbmZpZy5kaXJTaGFyZWR9LyR7dC5jb25maWcuZGlyRGF0YX1gLDUxMSksci5ta2RpcihgJHt0LmNvbmZpZy5kaXJTaGFyZWR9LyR7dC5jb25maWcuZGlyTW91bnRlZH1gLDUxMSksci5jaGRpcihgJHt0LmNvbmZpZy5kaXJTaGFyZWR9LyR7dC5jb25maWcuZGlyRGF0YX1gKSx0LmZzPXIpOih0Ll9sb2coYFNldHRpbmcgdXAgJHtlLnRvb2x9IHdpdGggZmlsZXN5c3RlbS4uLmApLHIubWtkaXIodC5jb25maWcuZGlyU2hhcmVkKSxyLm1vdW50KGUubW9kdWxlLlBST1hZRlMse3Jvb3Q6dC5jb25maWcuZGlyU2hhcmVkLGZzOnQuZnN9LHQuY29uZmlnLmRpclNoYXJlZCksci5jaGRpcih0LmZzLmN3ZCgpKSksZS5zdGRvdXQ9IiIsZS5zdGRlcnI9IiIsZS5yZWFkeT0hMH0sYXN5bmMgX3NldHVwRlMoKXtjb25zdCBlPXQuZnM7Zm9yKGxldCByIG9mIHQudG9vbHMpe2lmKCFyLnJlYWR5KWNvbnRpbnVlO2NvbnN0IGk9ci5tb2R1bGUuRlMscz1gLyR7ci50b29sfWAsbz1gJHt0LmNvbmZpZy5kaXJTaGFyZWR9JHtzfWA7IWkuYW5hbHl6ZVBhdGgocykuZXhpc3RzfHxlLmFuYWx5emVQYXRoKG8pLmV4aXN0c3x8KHQuX2xvZyhgTW91bnRpbmcgJHtzfSBvbnRvICR7dC5iYXNlLnRvb2x9IGZpbGVzeXN0ZW0gYXQgJHtvfWApLGUubWtkaXIobyksZS5tb3VudCh0LmJhc2UubW9kdWxlLlBST1hZRlMse3Jvb3Q6cyxmczppfSxvKSl9fSxfZmlsZW9wKGUscil7dC5fbG9nKGBSdW5uaW5nICR7ZX0gJHtyfWApO2NvbnN0IGk9dC5mcy5hbmFseXplUGF0aChyKTtpZighaS5leGlzdHMpcmV0dXJuIHQuX2xvZyhgRmlsZSAke3J9IG5vdCBmb3VuZC5gKSwhMTtzd2l0Y2goZSl7Y2FzZSJjYXQiOnJldHVybiB0LmZzLnJlYWRGaWxlKHIse2VuY29kaW5nOiJ1dGY4In0pO2Nhc2UibHMiOnJldHVybiB0LmZzLmlzRmlsZShpLm9iamVjdC5tb2RlKT90LmZzLnN0YXQocik6dC5mcy5yZWFkZGlyKHIpO2Nhc2UiZG93bmxvYWQiOmNvbnN0IHM9bmV3IEJsb2IoW3RoaXMuY2F0KHIpXSk7cmV0dXJuIFVSTC5jcmVhdGVPYmplY3RVUkwocyl9cmV0dXJuITF9LF9sb2coZSl7aWYoIXQuY29uZmlnLmRlYnVnKXJldHVybjtsZXQgcj1bLi4uYXJndW1lbnRzXTtyLnNoaWZ0KCksY29uc29sZS5sb2coYCVjW1dlYldvcmtlcl0lYyAke2V9YCwiZm9udC13ZWlnaHQ6Ym9sZCIsIiIsLi4ucil9fTt3KHQpfSkoKTsK",P=typeof window<"u"&&window.Blob&&new Blob([atob(_)],{type:"text/javascript;charset=utf-8"});function N(){const e=P&&(window.URL||window.webkitURL).createObjectURL(P);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+_)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const M={urlCDN:"https://biowasm.com/cdn/v3",urlCDNStg:"https://stg.biowasm.com/cdn/v3",dirShared:"/shared",dirMounted:"/mnt",dirData:"/data",printInterleaved:!0,printStream:!1,callback:null,debug:!1,env:"prd"};class x{constructor(e,t={}){if(null==e)throw"Expecting array of tools as input to Aioli constructor.";return Array.isArray(e)||(e=[e]),t=Object.assign({},M,t),e=e.map(this._parseTool),"stg"===t.env&&(t.urlCDN=t.urlCDNStg),this.tools=e,this.config=t,null!=this.config.callback&&(this.callback=this.config.callback),delete this.config.callback,this.init()}async init(){const e=new N;this.callback&&(e.onmessage=e=>{"biowasm"===e.data.type&&this.callback(e.data.value)});const t=y(e);return t.tools=this.tools,t.config=this.config,await t.init(),t}_parseTool(e){if("string"!=typeof e)return e;const t=e.split("/");if(2!=t.length&&3!=t.length)throw"Expecting '<tool>/<version>' or '<tool>/<program>/<version>'";return{tool:t[0],program:3==t.length?t[1]:t[0],version:t[t.length-1]}}}var $=n(3629);class L{static getAvailableScales(){return Object.entries(this.scales).map((([e,t])=>e))}static getScale(e){return(0,$.vA)(!(void 0===this.scales[e]),`Scale '${e}' was not found.`),this.scales[e]}}L.scales={WimleyWhite:{"-":0,A:.17,C:-.24,D:-.07,E:-.01,F:-1.13,G:.01,H:.17,I:-.31,K:.99,L:-.56,M:-.23,N:.42,P:.45,Q:.58,R:.81,S:.13,T:.14,V:.07,W:-1.85,Y:-.94},categorial:{"-":0,A:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,K:9,L:10,M:11,N:12,P:13,Q:14,R:15,S:16,T:17,V:18,W:19,Y:20}};class I{constructor(e="categorial"){this.aa2num=L.getScale(e),this.num2aa={},Object.entries(this.aa2num).forEach((([e,t])=>this.num2aa[t]=e))}static _truncateSequence(e){let t=0,n=e.length;const r=["NH2","COOH"];if(e.startsWith(r[0])){const n=r[0].length;(0,$.vA)("-"==e[n],`Wrong sequence format: ${r[0]} without following '-' in '${e}'.`),t=n}if(e.endsWith(r[1])){const t=r[1].length+1;(0,$.vA)("-"==e[n-t],`Wrong sequence format: ${r[1]} without '-' precending in '${e}'.`),n-=t}return e.substring(t,n)}static _dropDefises(e){return e.replace(/(-)([^-]+)/g,"$2")}static clean(e){return I._dropDefises(I._truncateSequence(e))}encode(e){const t=e.length,n=new Array(t).fill(0);for(let r=0;r<t;++r){const t=e[r];(0,$.vA)(t in this.aa2num,`Unknown char '${t}' found in sequence '${e}'`),n[r]=this.encodeLettter(t)}return n}encodeLettter(e){return this.aa2num[e]}decode(e){let t="";for(let n=0;n<e.length;++n){const r=e[n];(0,$.vA)(r in this.num2aa,`Unknown code '${r}' found in vector '${e}'`),t+=this.num2aa[r]}return t}}var R=n(4139);const O="input.fa",k="result.fasta";class G extends Error{element;constructor(e,t){super(e.innerText,t),this.element=e}}function D(e){return e.reduce(((e,t,n)=>e+`>sample${n+1}\n${t}\n`),"")}async function H(e,t=!1,n="",r=null,o,i,l){let u=e.toList();t&&(u=u.map((e=>I.clean(e).replace(/\-/g,""))));const d=e.length;r??=s.Column.string("Clusters",d).init("0"),r.type!=s.COLUMN_TYPE.STRING&&(r=r.convertTo(s.TYPE.STRING)),r.compact();const h=r.categories,p=r.getRawData(),m=new Array(h.length),f=new Array(h.length);for(let e=0;e<d;++e){const t=p[e];(m[t]??=[]).push(u[e]),(f[t]??=[]).push(e)}V(f,h);const g=await new x(["base/1.0.0",{tool:"kalign",version:R.b9,reinit:!0}]),y=s.Column.string(n,d);for(let e=0;e<h.length;++e){const t=D(m[e]);await g.fs.writeFile(O,t);const n=`${void 0!==o?` --gpo ${o}`:""}${void 0!==i?` --gpe ${i}`:""}${void 0!==l?` --tgpe ${l}`:""}`,r=await g.exec(`kalign ${O} -f fasta -o ${k}${n}`);console.warn(r);const s=await g.cat(k);if(!s){const e=F(r,1);throw new Error(e)}const c=new a.m(s).sequencesArray,u=f[e];for(let e=0;e<c.length;++e)y.set(u[e],c[e])}const b=e.meta.units,w=e.getTag(c.gp.alphabet);return y.meta.units=b,y.setTag(c.gp.aligned,"SEQ.MSA"),y.setTag(c.gp.alphabet,w),y.semType=s.SEMTYPE.MACROMOLECULE,y}function F(e,t){const n=[],r=/^.+ERROR : (.+)$/gm;let s;for(;null!=(s=r.exec(e))&&(void 0===t||n.length<t);)n.push(s[1]);return n.join("\n")}function V(e,t){const n=e.map(((e,t)=>[e,t])).filter((([e,t])=>1==e.length)).map((([e,t])=>t));if(n.length>0){const e=r.div([r.divText(`MSA analysis is not available on single sequence clusters #${n.length}:`),...i()(n).take(3).map((e=>{let s=t[e];return s.length>25&&(s=s.slice(0,25)+"..."),r.divText(`"${s}"${e<n.length-1?", ":"."}`)})).toArray(),...n.length>3?[r.divText("...")]:[]]);throw new G(e)}}},8152:(e,t,n)=>{"use strict";n.d(t,{GD:()=>h,Nk:()=>l,ZY:()=>u});var r=n(4328),s=n(6082),o=n(2003),i=n(608),a=n(4139),c=n(4374);const l=new class{dcName="bio";async getDockerContainer(){return await r.dapi.docker.dockerContainers.filter(this.dcName).first()}},u=["mafft --auto","mafft","linsi","ginsi","einsi","fftns","fftnsi","nwns","nwnsi"],d=["AlignedSeq","AlignedSubpeptide","HELM","ID","PolymerID"];async function h(e,t,n="ginsi",r=1.53,c=0,u=null,h){const m=await l.getDockerContainer();if("started"!==m.status&&"checking"!==m.status)throw new Error("PepSeA container has not started yet");const f=e.length;u??=s.Column.int("Clusters",f).init(0),u.type!=s.COLUMN_TYPE.STRING&&(u=u.convertTo(s.TYPE.STRING));const g=u.categories,y=u.getRawData(),b=new Array(g.length),w=new Array(g.length);for(let t=0;t<f;++t){const n=y[t],r=g[n];if(""===r)continue;const s=g.indexOf(r),o=e.get(t);o&&((b[s]??=[]).push({ID:t.toString(),HELM:o}),(w[n]??=[]).push(t))}(0,i.aZ)(w,g);const v=new Array(f);for(const e of b){const t=(await p(m.id,e,n,r,c,h)).Alignment;for(const e of t)v[parseInt(e.ID)]=Object.entries(e).filter((e=>!d.includes(e[0]))).map((e=>"-"!==e[1]?e[1]:"")).join(a.J.SEPARATOR)}const A=s.Column.fromStrings(t,v);return A.meta.units=o.Hi.SEPARATOR,A.setTag(o.gp.separator,a.J.SEPARATOR),A.setTag(o.gp.aligned,"SEQ.MSA"),A.setTag(o.gp.alphabet,o.YI.UN),A.setTag(o.gp.alphabetIsMultichar,"true"),A.semType=s.SEMTYPE.MACROMOLECULE,A}async function p(e,t,n,s,o,i){const a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)},l=`/align?method=${n}&gap_open=${s}&gap_extend=${o}`;let u;if("fetchProxy"in r.dapi.docker.dockerContainers){const t=window.performance.now(),n=await r.dapi.docker.dockerContainers.fetchProxy(e,l,a),s=window.performance.now();c._package.logger.debug(`Bio: requestAlignedObjects() dockerContainers.fetchProxy(), ET: ${s-t} ms`);const o="application/json"===n.headers.get("content-type");if(!n.ok&&o){const e=await n.json(),t=e["pepsea-error"];if(t)throw new Error(`PepSeA error: ${t}`);const r=e["datagrok-error"];if(r)throw new Error(`Datagrok error: ${r}`);throw new Error(n.statusText)}if(!n.ok&&!o){const e=await n.text();throw new Error(`Error: ${e}`)}if(!o){const e=await n.text();throw new Error(`Error: PepSeA expected JSON response, got '${e}'.`)}u=await n.json()}else{const t=await r.dapi.docker.dockerContainers.request(e,l,a);if(!t)throw new Error("Empty response");u=JSON.parse(t);const n=u["pepsea-error"];if(n)throw new Error(`PepSeA error: ${n}`);const s=u["datagrok-error"];if(s)throw new Error(`Datagrok error: ${s}`)}if("pepsea-stderr"in u){const e=u["pepsea-stderr"];i?.warning(e)}return u}},3890:(e,t,n)=>{"use strict";n.d(t,{aS:()=>a,wz:()=>i}),n(6082),n(7389),n(4328);var r=n(1991),s=n.n(r);n(4374);const o=60;function i(e,t,n=o,r="\n"){const s=[];for(let o=0;o<t.length;o++){const i=e.map((e=>e.get(o).toString())).join("|"),c=a(t.getSplitted(o),n);s.push(`>${i}${r}`);for(const e of c)s.push(`${e}${r}`)}return"".concat(...s)}function a(e,t=o){let n=0;const r=e.length,i=[];for(;n<r;){const r=s().count(n).take(Math.min(e.length-n,t)).map((t=>e.getOriginal(t))).toArray(),o=r.map((e=>e.length>1?`[${e}]`:e)).reduce(((e,t)=>e+t),"");i.push(o),n+=r.length}return i}},8754:(e,t,n)=>{"use strict";n.d(t,{V:()=>u});var r=n(4328),s=n(6077),o=n(2003),i=n(8312),a=n(310),c=n(966),l=n(330);async function u(e,t,n,u,d,h,p){let m;if(n){const n=await(0,i.Q)(),r=n.getSeqHandler(t);let s,a;r.isHelm()?s=t:(a=t.name,t.name=`__${a}`,s=r.convert(o.Hi.HELM),s.name=a,e.columns.add(s,!1));try{m=await n.helmToAtomicLevel(s,!0,!0)}finally{s!==t&&(e.columns.remove(s.name),t.name=a)}}else{if(!(0,c.l)(t,"To Atomic Level",h)[0])return{molCol:null,warnings:["Column is not suitable"]};m=await(0,s.C4)(e,t,d,h,p)}if(m.molCol){const n=(0,l.qj)(e,t.name);m.molCol.name=n,e.columns.add(m.molCol,!0),(0,a.Qc)(t,m.molCol,d,h,p),m.molCol.setTag(".sequence-src-highlight-monomers",String(u)),await r.data.detectSemanticTypes(e)}return m}},4870:(e,t,n)=>{"use strict";function r(e,t){e.innerHTML="",e.append(t)}n.d(t,{K:()=>r}),n(4328),n(6082)},8047:(e,t,n)=>{"use strict";n.d(t,{VN:()=>m,n5:()=>l,Ue:()=>p,Tc:()=>h,eN:()=>f}),n(4328),n(7389);var r=n(6082),s=(n(1757),n(1991),n(1858),n(2003)),o=n(4326);n(8070),n(7602);var i=n(439),a=n(6882);var c,l,u,d=n(2174);n(4374),HTMLCanvasElement.prototype.getCursorPosition=function(e,t){const n=this.getBoundingClientRect();return new r.Point((e.clientX-n.left)*t,(e.clientY-n.top)*t)},r.Rect.prototype.contains=function(e,t){return this.left<=e&&e<=this.right&&this.top<=t&&t<=this.bottom};class h{rowCount;value;plotValue;valueList=null;valueIdx=0;bounds;constructor(e=0,t){this.value=this.rowCount=e,this.bounds=t}push(e){this.valueList||(this.valueList=new Array(this.rowCount),this.valueIdx=0),this.valueList[this.valueIdx]=e,++this.valueIdx}aggregate(e){this.value=e(this.valueList)??0,this.valueList=null}}class p{pos;name;_label;get label(){return this._label?this._label:this.name}_freqs;sumRowCount=0;sumPlotValue;sumPlotValueForHeight;constructor(e,t,n,r){this.pos=e,this.name=t,this._freqs=n??{},r?.sumRowCount&&(this.sumRowCount=r.sumRowCount),r?.sumValueForHeight&&(this.sumPlotValue=r.sumValueForHeight),r?.label&&(this._label=r.label)}getMonomers(){return Object.keys(this._freqs)}hasMonomer(e){return e in this._freqs}getFreq(e){let t=this._freqs[e];return t||(t=this._freqs[e]=new h),t}aggregate(e){const t=function(e){return t=>{const n=function(e){let t;const n="agg";return t=e instanceof Float32Array?r.Column.fromFloat32Array(n,e):e instanceof Int32Array?r.Column.fromInt32Array(n,e):r.Column.fromList(r.COLUMN_TYPE.FLOAT,n,e),t}(t);return n.aggregate(e)}}(e);for(const[e,n]of Object.entries(this._freqs))n.aggregate(t)}getMinValue(){return Math.min(...Object.values(this._freqs).map((e=>e.value)))}calcPlotValue(e){for(const t of Object.values(this._freqs))t.plotValue=t.value-e}calcHeights(e){this.sumPlotValue=0;for(const e of Object.values(this._freqs))this.sumPlotValue+=e.plotValue;if(this.sumPlotValueForHeight=0,e===o.fH.Entropy){const e=Object.keys(this._freqs).length,t=.01*this.sumPlotValue,n=t/e;for(const e of Object.values(this._freqs)){const r=(e.plotValue+n)/(this.sumPlotValue+t);this.sumPlotValueForHeight+=-r*Math.log2(r)}}else if(e===o.fH.full)for(const[e,t]of Object.entries(this._freqs)){const e=t.plotValue/this.sumPlotValue;this.sumPlotValueForHeight+=e}}calcScreen(e,t,n,s,a,c,l,u,d){const h=s===o.fH.Entropy?n*(a-this.sumPlotValueForHeight)/a:n;let p=d*u+(n-h-1);const m=Object.entries(this._freqs).sort(((e,t)=>e[0]!==i._S&&t[0]!==i._S?t[1].value-e[1].value:e[0]===i._S&&t[0]===i._S?0:e[0]===i._S?-1:1));for(const[n,s]of m){const n=h*s.plotValue/this.sumPlotValue;s.bounds=new r.Rect((e-t)*u*c,p,l*u,n),p+=n}}render(e,t,n,r,o,c){for(const[l,u]of Object.entries(this._freqs))if(l!==i._S){const i=(0,s.zS)(l,5),d=u.bounds,h=d.left;let p=a.S$;c&&(p=c.getMonomerTextColor(o,l)),e.resetTransform(),e.strokeStyle="lightgray",e.lineWidth=1,e.rect(h,d.top,d.width,d.height),e.fillStyle=p,e.textAlign="left",e.font=t;const m=e.measureText(i);e.setTransform(d.width/m.width,0,0,d.height/r,h,d.top),e.fillText(i,0,-n)}}getMonomerAt(e,t){const n=Object.entries(this._freqs).find((([n,r])=>r.bounds.contains(e,t)));return n?n[0]:void 0}buildCompositionTable(e,t){if("-"in this._freqs)throw new Error("Unexpected monomer symbol '-'.");return(0,d.F)(Object.assign({},...Object.entries(this._freqs).map((([e,t])=>({[e]:t.rowCount})))),e,t)}}!function(e){e.STYLE="Style",e.BEHAVIOR="Behavior",e.LAYOUT="Layout",e.DATA="Data"}(c||(c={})),function(e){e.sequenceColumnName="sequenceColumnName",e.valueAggrType="valueAggrType",e.valueColumnName="valueColumnName",e.startPositionName="startPositionName",e.endPositionName="endPositionName",e.skipEmptySequences="skipEmptySequences",e.skipEmptyPositions="skipEmptyPositions",e.shrinkEmptyTail="shrinkEmptyTail",e.backgroundColor="backgroundColor",e.positionHeight="positionHeight",e.positionWidth="positionWidth",e.verticalAlignment="verticalAlignment",e.horizontalAlignment="horizontalAlignment",e.fixWidth="fixWidth",e.fitArea="fitArea",e.minHeight="minHeight",e.maxHeight="maxHeight",e.showPositionLabels="showPositionLabels",e.positionMarginState="positionMarginState",e.positionMargin="positionMargin",e.filterSource="filterSource"}(l||(l={})),o.Fo,function(e){e[e.None=0]="None",e[e.Render=1]="Render",e[e.Layout=1]="Layout",e[e.Freqs=2]="Freqs"}(u||(u={}));const m=new class{render=20};function f(e,t,n,r,s){let o=0,i=-1;for(;-1!=(i=n.findNext(i,!0));){const e=t.getSplitted(i),n=s.pos,a=n<e.length?e.getCanonical(n):null;null!==a&&a===r&&o++}return o}r.JsViewer},4577:(e,t,n)=>{"use strict";n.d(t,{O:()=>i,n:()=>o});var r=n(1858),s=n(4374);class o{substructure;readOnly;constructor(e,t=!0){return this.substructure=e,this.readOnly=t,new Proxy(this,{set:(e,t,n)=>{if(s._package.logger.debug(`BioFilterProps.set ${t.toString()}( '${n}' )`),this.readOnly)throw new Error("Properties are immutable.");return e[t]=n,!0}})}}class i{onChanged=new r.Subject;_props;_propsChanging=!1;get props(){return this._props||(this._props=this.emptyProps),this._props}set props(e){this._propsChanging=!0;try{this._props=e,this.applyProps(),this.onChanged.next()}finally{this._propsChanging=!1}}saveProps(){const e={};for(const[t,n]of Object.entries(this.props))"_onChanged"!==t&&(e[t]=this.props[t]);return e}async detach(){}get filterSummary(){return this.props.substructure}get isFiltering(){return""!==this.props.substructure}resetFilter(){this.props=this.emptyProps,this.onChanged.next()}}},1687:(e,t,n)=>{"use strict";n.d(t,{_i:()=>C,AR:()=>T});var r=n(7389),s=n(6082),o=n(4328),i=n(1991),a=n.n(i),c=n(1858),l=n(2003),u=n(8070),d=n(7602),h=n(8115),p=n(4577),m=n(1757),f=n.n(m),g=n(9124),y=n(9192),b=n(4870),w=n(4374);class v extends p.O{seqHelper;emptyProps=new p.n("");helmEditor;_filterPanel=r.div("",{style:{cursor:"pointer"}});logger;static viewerCounter=-1;viewerId=++v.viewerCounter;viewerToLog(){return`HelmBioFilter<${this.viewerId}>`}get type(){return"HelmBioFilter"}constructor(e){super(),this.seqHelper=e,this.logger=w._package.logger}viewSubs=[];async detach(){await super.detach();for(const e of this.viewSubs)e.unsubscribe()}async attach(){this.viewerToLog();try{const e=await(0,g.b2)();let t,n;this.helmEditor=e.createHelmWebEditor(),this.logger.warning("TEST: HelmBioFilter.init().sync() waitForElementInDom waiting..."),await r.tools.waitForElementInDom(this._filterPanel),this.logger.warning("TEST: HelmBioFilter.init().sync() waitForElementInDom ready"),this.updateFilterPanel(),this.viewSubs.push((0,c.fromEvent)(this._filterPanel,"click").subscribe((()=>{t=r.div(),n=e.createWebEditorApp(t,this.props.substructure),r.dialog({showHeader:!1,showFooter:!0}).add(t).onOK((()=>{try{const e=n.canvas.getHelm(!0).replace(/<\/span>/g,"").replace(/<span style='background:#bbf;'>/g,"");this.props=new p.n(e)}catch(e){this.logger.error(e)}finally{f()(t).empty(),t=null,n=null}})).onCancel((()=>{f()(t).empty(),t=null,n=null})).show({modal:!0,fullScreen:!0})}))),this.viewSubs.push(r.onSizeChanged(this._filterPanel).subscribe((e=>{try{if(n){const e=n.canvas.getHelm(!0).replace(/<\/span>/g,"").replace(/<span style='background:#bbf;'>/g,"");this.updateFilterPanel(e)}}catch(e){const[t,n]=(0,y.AP)(e);this.logger.error(t,void 0,n)}})))}catch(e){const[t,n]=(0,y.AP)(e),s=this._filterPanel;s.innerText="error",s.classList.add("d4-error"),r.tooltip.bind(s,t)}}applyProps(){this.helmEditor&&this.updateFilterPanel(this.props.substructure)}get filterPanel(){return this._filterPanel}updateFilterPanel(e){if(!this.helmEditor)throw new Error("helmEditor is not created, the filter is not in dom yet");const t=this._filterPanel.parentElement.clientWidth<100?100:this._filterPanel.parentElement.clientWidth,n=t/2;if(e)(0,b.K)(this._filterPanel,this.helmEditor.host),this.helmEditor.editor.setHelm(e),this.helmEditor.resizeEditor(t,n);else{const e=r.divText("Click to edit","helm-substructure-filter");(0,b.K)(this._filterPanel,e)}}async substructureSearch(e){const t=`${this.viewerToLog()}.substructureSearch( column = <${e.name}> )`;w._package.logger.debug(`${t}, start`);try{return await(0,u.cb)(10),await(0,h.if)(this.props.substructure,e,this.seqHelper)}finally{w._package.logger.debug(`${t}, end`)}}}const A="bio-substructure-filter";class E{props;filterId;dataFrameId;columnName;bitset;constructor(e,t,n,r,s){this.props=e,this.filterId=t,this.dataFrameId=n,this.columnName=r,this.bitset=s}}class T extends p.n{separator;constructor(e,t){super(e,!1),this.separator=t,this.readOnly=!0}}class C extends s.Filter{seqHelper;logger;bioFilter=null;bitset=null;loader;notation=void 0;filterSyncer;get calculating(){return"initial"==this.loader.style.display}set calculating(e){this.loader.style.display=e?"initial":"none"}get filterSummary(){return this.bioFilter.filterSummary}get isFiltering(){return super.isFiltering&&(this.bioFilter?.isFiltering??!1)}get isReadyToApplyFilter(){return!this.calculating&&null!=this.bitset}get debounceTime(){if(null==this.column)return 1e3;const e=this.column.length;return e<500?0:e>1e4?1e3:Math.floor((e-500)/9500*1e3)}constructor(e,t){super(),this.seqHelper=e,this.logger=t,this.root=r.divV([]),this.loader=r.loader(),this.calculating=!1,this.filterSyncer=new d.g(this.logger)}static filterCounter=-1;filterId=++C.filterCounter;filterToLog(){return`BioSubstructureFilter<${this.filterId}>`}viewSubs=[];attach(e){const t=super.attach.bind(this),n=`${this.filterToLog()}.attach()`;this.filterSyncer.sync(n,(async()=>{t(e),this.column||(this.columnName?this.column=this.dataFrame.getCol(this.columnName):this.column=e.columns.bySemType(s.SEMTYPE.MACROMOLECULE)),this.seqHelper.getSeqHandler(this.column),this.columnName??=this.column?.name,this.notation??=this.column?.meta.units,this.bioFilter=this.notation===l.Hi.FASTA?new S:this.notation===l.Hi.SEPARATOR?new _(this.column.getTag(l.gp.separator)):new v(this.seqHelper),this.root.appendChild(this.bioFilter.filterPanel),this.root.appendChild(this.loader),await this.bioFilter.attach(),this.viewSubs.push(s.debounce(this.bioFilter.onChanged,this.debounceTime).subscribe(this.bioFilterOnChangedDebounced.bind(this))),this.viewSubs.push(o.events.onResetFilterRequest.subscribe(this.grokEventsOnResetFilterRequest.bind(this))),this.viewSubs.push(o.events.onCustomEvent(A).subscribe(this.filterOnSync.bind(this)))}))}detach(){const e=super.detach.bind(this),t=`${this.filterToLog()}.detach()`;this.filterSyncer.sync(t,(async()=>{for(const e of this.viewSubs)e.unsubscribe();this.viewSubs=[],e(),this.bioFilter&&this.bioFilter.detach(),this.bioFilter=null}))}filterOnSync(e){e.filterId!==this.filterId&&e.dataFrameId===this.dataFrame.id&&e.columnName===this.columnName&&(this.bioFilter.props=e.props)}applyFilter(){const e=`${this.filterToLog()}.applyFilter()`;this.logger.debug(`${e}, IN`),this.bitset&&!this.isDetached&&this.dataFrame?.filter.and(this.bitset)}saveState(){const e=`${this.filterToLog()}.saveState()`,t=super.saveState();return this.logger.debug(`${e}, super.state = ${JSON.stringify(t)}`),t.props=this.bioFilter.saveProps(),t}applyState(e){const t=`${this.filterToLog()}.applyState()`;super.applyState(e),this.filterSyncer.sync(t,(async()=>{e.props&&this.bioFilter&&(this.bioFilter.props=s.toJs(e.props??{}))}))}fireFilterSync(){const e=`${this.filterToLog()}.fireFilterSync()`;this.logger.debug(`${e}, bioFilter = ${this.bioFilter?this.bioFilter.constructor.name:"null"}`+(this.bioFilter?`, props = ${JSON.stringify(this.bioFilter.saveProps())}`:"")),o.events.fireCustomEvent(A,new E(this.bioFilter.props,this.filterId,this.dataFrame.id,this.columnName,this.bitset))}bioFilterOnChangedDebounced(){if(!this.dataFrame)return;const e=`${this.filterToLog()}.bioFilterOnChangedDebounced()`;if(this.logger.debug(`${e}, start, isFiltering = ${this.isFiltering}, props = ${JSON.stringify(this.bioFilter.saveProps())}`),!this.isFiltering)return this.bitset=null,void this.dataFrame.rows.requestFilter();a()(this.dataFrame.rows.filters).has(`${this.columnName}: ${this.filterSummary}`)||this.filterSyncer.sync(e,(async()=>{this.calculating=!0;try{this.logger.debug(`${e}, before substructureSearch`),this.bitset=await(this.bioFilter?.substructureSearch(this.column)),this.logger.debug(`${e}, after substructureSearch`),this.calculating=!1,this.fireFilterSync(),this.dataFrame?.rows.requestFilter()}finally{this.calculating=!1,this.logger.debug(`${e}, end`)}}))}grokEventsOnResetFilterRequest(){const e=`${this.filterToLog()}.grokEventsOnResetFilterRequest()`;this.logger.debug(`${e}`),this.bioFilter?.resetFilter()}_onRendered=new c.Subject;get onRendered(){return this._onRendered}invalidate(e){const t=`${this.filterToLog()}.invalidate(${e?` <- ${e} `:""})`;this.filterSyncer.sync(t,(async()=>{this._onRendered.next()}))}async awaitRendered(e=1e4){const t=`awaitRendered( ${e} )`,n=`${this.filterToLog()}.${t}`;await(0,u.cb)(10),await(0,u.PE)(this.onRendered,(()=>{this.logger.debug(`${n}, _onRendered event caught`)}),(()=>{this.invalidate(t)}),e,`${n} timeout`);const r=this.filterSyncer.resetErrors();if(r.length>0)throw r[0]}}class S extends p.O{emptyProps=new p.n("");substructureInput;get type(){return"FastaBioFilter"}constructor(){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{window.setTimeout((()=>{this.props=new p.n(e),this._propsChanging||this.onChanged.next()}),0)},placeholder:"Substructure"})}applyProps(){this.substructureInput.value!==this.props.substructure&&(this.substructureInput.value=this.props.substructure)}get filterPanel(){return this.substructureInput.root}get isFiltering(){return""!==this.substructureInput.value}async substructureSearch(e){return(0,h.nI)(this.props.substructure,e)}async attach(){}async detach(){await super.detach()}}class _ extends p.O{emptyProps=new T("",void 0);substructureInput;separatorInput;colSeparator="";get type(){return"SeparatorBioFilter"}constructor(e){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{this.props=new T(e,this.props.separator),this._propsChanging||this.onChanged.next()},placeholder:"Substructure"}),this.separatorInput=r.input.string("",{value:this.colSeparator=e,onValueChanged:e=>{const t=e||void 0;this.props=new T(this.props.substructure,t),this._propsChanging||this.onChanged.next()},placeholder:"Separator"})}applyProps(){this.substructureInput.value!==this.props.substructure&&(this.substructureInput.value=this.props.substructure);const e=this.props.separator??this.colSeparator;this.separatorInput.value!==e&&(this.separatorInput.value=e)}get filterSummary(){return this.props.separator?this.props.separator:this.colSeparator,`${this.props.substructure}, {sep}`}get isFiltering(){return""!==this.props.substructure}resetFilter(){this.props=new T("")}get filterPanel(){return r.divV([this.substructureInput.root,this.separatorInput.root])}get substructure(){return this.separatorInput.value&&this.separatorInput.value!==this.colSeparator?this.substructureInput.value.replaceAll(this.separatorInput.value,this.colSeparator):this.substructureInput.value}set substructure(e){this.substructureInput.value=e}async substructureSearch(e){return(0,h.nI)(this.substructure,e,this.colSeparator)}async attach(){}async detach(){await super.detach()}}},2174:(e,t,n)=>{"use strict";n.d(t,{F:()=>v});var r=n(7389),s=n(6082),o=(n(1991),n(2003),n(439)),i=(n(3599),n(5072)),a=n.n(i),c=n(7825),l=n.n(c),u=n(7659),d=n.n(u),h=n(5056),p=n.n(h),m=n(540),f=n.n(m),g=n(1113),y=n.n(g),b=n(5999),w={};function v(e,t,n){let i=0,a=null;for(const t of Object.values(e))i+=t,a=null===a?t:Math.max(a,t);const c=a/i,l=Object.assign({},...Array.from(Object.entries(e)).sort(((e,t)=>t[1]-e[1])).map((([e,a])=>{const l=a/i,u=n.getWebEditorMonomer(t,e).backgroundcolor,d=r.div("",{classes:"macromolecule-cell-comp-analysis-bar"});d.style.width=50*l/c+"px",d.style.backgroundColor=u,o._S===e&&(d.style.borderWidth="1px",d.style.borderStyle="solid",d.style.borderColor=s.Color.toHtml(s.Color.lightGray));const h=o._S===e?"-":e,p=r.div(`${(100*l).toFixed(2)}%`),m=r.div([d,p],{classes:"macromolecule-cell-comp-analysis-value"});return{[h]:m}}))),u=r.tableFromMap(l);return Array.from(u.rows).forEach((e=>{const t=e.getElementsByClassName("macromolecule-cell-comp-analysis-bar")[0].style.backgroundColor;e.cells[0].style.color=t})),u}w.styleTagTransform=y(),w.setAttributes=p(),w.insert=d().bind(null,"head"),w.domAPI=l(),w.insertStyleElement=f(),a()(b.A,w),b.A&&b.A.locals&&b.A.locals},1757:e=>{"use strict";e.exports=$},6082:e=>{"use strict";e.exports=DG},4328:e=>{"use strict";e.exports=grok},1858:e=>{"use strict";e.exports=rxjs},7389:e=>{"use strict";e.exports=ui},1991:e=>{"use strict";e.exports=wu},8343:(e,t,n)=>{"use strict";const{normalizeIPv6:r,normalizeIPv4:s,removeDotSegments:o,recomposeAuthority:i,normalizeComponentEncoding:a}=n(4834),c=n(343);function l(e,t,n,r){const s={};return r||(e=p(u(e,n),n),t=p(u(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=o(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=o(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=o(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function u(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),s=[],a=c[(r.scheme||n.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(n,r),void 0!==n.path&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),void 0!==n.scheme&&(n.path=n.path.split("%3A").join(":")))),"suffix"!==r.reference&&n.scheme&&(s.push(n.scheme),s.push(":"));const l=i(n,r);if(void 0!==l&&("suffix"!==r.reference&&s.push("//"),s.push(l),n.path&&"/"!==n.path.charAt(0)&&s.push("/")),void 0!==n.path){let e=n.path;r.absolutePath||a&&a.absolutePath||(e=o(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),s.push(e)}return void 0!==n.query&&(s.push("?"),s.push(n.query)),void 0!==n.fragment&&(s.push("#"),s.push(n.fragment)),s.join("")}const d=Array.from({length:127},((e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)))),h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(e,t){const n=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=-1!==e.indexOf("%");let a=!1;"suffix"===n.reference&&(e=(n.scheme?n.scheme+":":"")+"//"+e);const l=e.match(h);if(l){if(o.scheme=l[1],o.userinfo=l[3],o.host=l[4],o.port=parseInt(l[5],10),o.path=l[6]||"",o.query=l[7],o.fragment=l[8],isNaN(o.port)&&(o.port=l[5]),o.host){const e=s(o.host);if(!1===e.isIPV4){const t=r(e.host,{isIPV4:!1});o.host=t.host.toLowerCase(),a=t.isIPV6}else o.host=e.host,a=!0}void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||o.path||void 0!==o.query?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==o.reference&&(o.error=o.error||"URI is not a "+n.reference+" reference.");const e=c[(n.scheme||o.scheme||"").toLowerCase()];if(!(n.unicodeSupport||e&&e.unicodeSupport)&&o.host&&(n.domainHost||e&&e.domainHost)&&!1===a&&function(e){let t=0;for(let n=0,r=e.length;n<r;++n)if(t=e.charCodeAt(n),t>126||d[t])return!0;return!1}(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(e){o.error=o.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(i&&void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),i&&void 0!==o.userinfo&&(o.userinfo=unescape(o.userinfo)),i&&void 0!==o.host&&(o.host=unescape(o.host)),void 0!==o.path&&o.path.length&&(o.path=escape(unescape(o.path))),void 0!==o.fragment&&o.fragment.length&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),e&&e.parse&&e.parse(o,n)}else o.error=o.error||"URI can not be parsed.";return o}const m={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=u(p(e,t),t):"object"==typeof e&&(e=p(u(e,t),t)),e},resolve:function(e,t,n){const r=Object.assign({scheme:"null"},n);return u(l(p(e,r),p(t,r),r,!0),{...r,skipEscape:!0})},resolveComponents:l,equal:function(e,t,n){return"string"==typeof e?(e=unescape(e),e=u(a(p(e,n),!0),{...n,skipEscape:!0})):"object"==typeof e&&(e=u(a(e,!0),{...n,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=u(a(p(t,n),!0),{...n,skipEscape:!0})):"object"==typeof t&&(t=u(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:u,parse:p};e.exports=m,e.exports.default=m,e.exports.fastUri=m},343:e=>{"use strict";const t=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function s(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function o(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const i={scheme:"http",domainHost:!0,parse:s,serialize:o},a={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=r(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(r(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}},c={http:i,https:{scheme:"https",domainHost:i.domainHost,parse:s,serialize:o},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(n);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,o=c[s];e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),s=`${n}:${t.nid||r}`,o=c[s];o&&(e=o.serialize(e,t));const i=e,a=e.nss;return i.path=`${r||t.nid}:${a}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,n){const r=e;return r.uuid=r.nss,r.nss=void 0,n.tolerant||r.uuid&&t.test(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};e.exports=c},4914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},4834:(e,t,n)=>{"use strict";const{HEX:r}=n(4914);function s(e){if(c(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[n]=t;return n?{host:a(n,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function o(e,t=!1){let n="",s=!0;for(const t of e){if(void 0===r[t])return;"0"!==t&&!0===s&&(s=!1),s||(n+=t)}return t&&0===n.length&&(n="0"),n}function i(e,t={}){if(c(e,":")<2)return{host:e,isIPV6:!1};const n=function(e){let t=0;const n={error:!1,address:"",zone:""},r=[],s=[];let i=!1,a=!1,c=!1;function l(){if(s.length){if(!1===i){const e=o(s);if(void 0===e)return n.error=!0,!1;r.push(e)}s.length=0}return!0}for(let o=0;o<e.length;o++){const u=e[o];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!l())break;i=!0}else s.push(u);else{if(!0===a&&(c=!0),!l())break;if(t++,r.push(":"),t>7){n.error=!0;break}o-1>=0&&":"===e[o-1]&&(a=!0)}}return s.length&&(i?n.zone=s.join(""):c?r.push(s.join("")):r.push(o(s))),n.address=r.join(""),n}(e);if(n.error)return{host:e,isIPV6:!1};{let e=n.address,t=n.address;return n.zone&&(e+="%"+n.zone,t+="%25"+n.zone),{host:e,escapedHost:t,isIPV6:!0}}}function a(e,t){let n="",r=!0;const s=e.length;for(let o=0;o<s;o++){const i=e[o];"0"===i&&r?(o+1<=s&&e[o+1]===t||o+1===s)&&(n+=i,r=!1):(r=i===t,n+=i)}return n}function c(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}const l=/^\.\.?\//u,u=/^\/\.(?:\/|$)/u,d=/^\/\.\.(?:\/|$)/u,h=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e,t){const n=[];if(void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host){let t=unescape(e.host);const r=s(t);if(r.isIPV4)t=r.host;else{const n=i(r.host,{isIPV4:!1});t=!0===n.isIPV6?`[${n.escapedHost}]`:e.host}n.push(t)}return"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0},normalizeComponentEncoding:function(e,t){const n=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=n(e.scheme)),void 0!==e.userinfo&&(e.userinfo=n(e.userinfo)),void 0!==e.host&&(e.host=n(e.host)),void 0!==e.path&&(e.path=n(e.path)),void 0!==e.query&&(e.query=n(e.query)),void 0!==e.fragment&&(e.fragment=n(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(l))e=e.replace(l,"");else if(e.match(u))e=e.replace(u,"/");else if(e.match(d))e=e.replace(d,"/"),t.pop();else if("."===e||".."===e)e="";else{const n=e.match(h);if(!n)throw new Error("Unexpected dot segment condition");{const r=n[0];e=e.slice(r.length),t.push(r)}}return t.join("")},normalizeIPv4:s,normalizeIPv6:i,stringArrayToHexStripped:o}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7216:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/applicator":true},"$dynamicAnchor":"meta","title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"prefixItems":{"$ref":"#/$defs/schemaArray"},"items":{"$dynamicRef":"#meta"},"contains":{"$dynamicRef":"#meta"},"additionalProperties":{"$dynamicRef":"#meta"},"properties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"propertyNames":{"$dynamicRef":"#meta"},"if":{"$dynamicRef":"#meta"},"then":{"$dynamicRef":"#meta"},"else":{"$dynamicRef":"#meta"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$dynamicRef":"#meta"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$dynamicRef":"#meta"}}}}')},8226:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/content","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentEncoding":{"type":"string"},"contentMediaType":{"type":"string"},"contentSchema":{"$dynamicRef":"#meta"}}}')},518:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/core","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true},"$dynamicAnchor":"meta","title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"$ref":"#/$defs/uriReferenceString","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"$ref":"#/$defs/uriString"},"$ref":{"$ref":"#/$defs/uriReferenceString"},"$anchor":{"$ref":"#/$defs/anchorString"},"$dynamicRef":{"$ref":"#/$defs/uriReferenceString"},"$dynamicAnchor":{"$ref":"#/$defs/anchorString"},"$vocabulary":{"type":"object","propertyNames":{"$ref":"#/$defs/uriString"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"}}},"$defs":{"anchorString":{"type":"string","pattern":"^[A-Za-z_][-A-Za-z0-9._]*$"},"uriString":{"type":"string","format":"uri"},"uriReferenceString":{"type":"string","format":"uri-reference"}}}')},4588:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/format-annotation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},"$dynamicAnchor":"meta","title":"Format vocabulary meta-schema for annotation results","type":["object","boolean"],"properties":{"format":{"type":"string"}}}')},5707:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},"$dynamicAnchor":"meta","title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}')},9547:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/unevaluated","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},"$dynamicAnchor":"meta","title":"Unevaluated applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"unevaluatedItems":{"$dynamicRef":"#meta"},"unevaluatedProperties":{"$dynamicRef":"#meta"}}}')},7082:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/validation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/validation":true},"$dynamicAnchor":"meta","title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]},"const":true,"enum":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}')},1678:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/unevaluated"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format-annotation"},{"$ref":"meta/content"}],"type":["object","boolean"],"$comment":"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.","properties":{"definitions":{"$comment":"\\"definitions\\" has been replaced by \\"$defs\\".","type":"object","additionalProperties":{"$dynamicRef":"#meta"},"deprecated":true,"default":{}},"dependencies":{"$comment":"\\"dependencies\\" has been split and replaced by \\"dependentSchemas\\" and \\"dependentRequired\\" in order to serve their differing semantics.","type":"object","additionalProperties":{"anyOf":[{"$dynamicRef":"#meta"},{"$ref":"meta/validation#/$defs/stringArray"}]},"deprecated":true,"default":{}},"$recursiveAnchor":{"$comment":"\\"$recursiveAnchor\\" has been replaced by \\"$dynamicAnchor\\".","$ref":"meta/core#/$defs/anchorString","deprecated":true},"$recursiveRef":{"$comment":"\\"$recursiveRef\\" has been replaced by \\"$dynamicRef\\".","$ref":"meta/core#/$defs/uriReferenceString","deprecated":true}}}')},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=e,n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.u=e=>e+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>Se,initAutoTests:()=>Pe,test:()=>_e,tests:()=>t.CN});var e=n(6082),t=n(8070);(0,t.L1)("_first",(()=>{(0,t.t6)("_first",(async()=>{}))}));var s=n(8924),o=n(7362),i=n(1093);(0,t.L1)("Palettes",(()=>{(0,t.t6)("testPaletteN",(async()=>{await async function(){const e=i.A.Chromatogram;(0,t.E3)(e instanceof o.e,!0),(0,t.E3)(e instanceof i.A,!0)}()})),(0,t.t6)("testPaletteAA",(async()=>{await async function(){const e=s.X.Lesk,n=s.X.RasMol,r=s.X.GrokGroups;(0,t.E3)(e instanceof o.e,!0),(0,t.E3)(n instanceof o.e,!0),(0,t.E3)(r instanceof o.e,!0),(0,t.E3)(e instanceof s.X,!0),(0,t.E3)(n instanceof s.X,!0),(0,t.E3)(r instanceof s.X,!0)}()})),(0,t.t6)("testPalettePtMe",(async()=>{const e=s.X.GrokGroups.get("MeNle"),n=s.X.GrokGroups.get("MeA"),r=s.X.GrokGroups.get("MeG"),o=s.X.GrokGroups.get("MeF"),i=s.X.GrokGroups.get("L"),a=s.X.GrokGroups.get("A"),c=s.X.GrokGroups.get("G"),l=s.X.GrokGroups.get("F");(0,t.E3)(e,i),(0,t.E3)(n,a),(0,t.E3)(r,c),(0,t.E3)(o,l)}))}));var a=n(4328),c=n(2003),l=n(8312);class u{units;aligned;alphabet;alphabetSize;alphabetIsMultichar;separator;constructor(e,t,n,r,s,o){this.units=e,this.aligned=t,this.alphabet=n,this.alphabetSize=r,this.alphabetIsMultichar=s,this.separator=o}}async function d(t,n){const r=(await t()).getCol(n),s=await a.functions.call("Bio:detectMacromolecule",{col:r});if(s&&(r.semType=s),r.semType===e.SEMTYPE.MACROMOLECULE){const e=`Negative test detected semType='${r.semType}', units='${r.meta.units}'.`;throw new Error(e)}}async function h(n,r,s,o,i,l,u,d,h=null){const p=(await n()).col(r),m=await a.functions.call("Bio:detectMacromolecule",{col:p});m&&(p.semType=m),(0,t.E3)(p.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(p.meta.units,o),(0,t.E3)(p.getTag(c.gp.aligned),i),(0,t.E3)(p.getTag(c.gp.alphabet),l),h&&(0,t.E3)(p.getTag(c.gp.separator),h);const f=s.getSeqHandler(p);(0,t.E3)(f.getAlphabetSize(),u),(0,t.E3)(f.getAlphabetIsMultichar(),d),f.isHelm()||((0,t.E3)(f.aligned,i),(0,t.E3)(f.alphabet,l))}async function p(t){const n=e.Column.fromList(e.TYPE.STRING,"col1",t);if(await a.functions.call("Bio:detectMacromolecule",{col:n}),n.semType===e.SEMTYPE.MACROMOLECULE){const e=`Negative test detected semType='${n.semType}', units='${n.meta.units}'.`;throw new Error(e)}}async function m(n,r,s,o,i,l,u,d=null){const h=e.Column.fromList(e.TYPE.STRING,"seq",n),p=await a.functions.call("Bio:detectMacromolecule",{col:h});p&&(h.semType=p),(0,t.E3)(h.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(h.meta.units,s),(0,t.E3)(h.getTag(c.gp.aligned),o),(0,t.E3)(h.getTag(c.gp.alphabet),i),d&&(0,t.E3)(h.getTag(c.gp.separator),d);const m=r.getSeqHandler(h);(0,t.E3)(m.getAlphabetSize(),l),(0,t.E3)(m.getAlphabetIsMultichar(),u),m.isHelm()||((0,t.E3)(m.aligned,o),(0,t.E3)(m.alphabet,i))}async function f(e,t,n){const r=await e(),s=[];for(const o of r.columns.names())if(o in t){const r=t[o];try{await h(e,o,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}catch(e){const t=e.toString();s.push(`Positive col '${o}' failed: ${t}`)}}else try{await d(e,o)}catch(e){const t=e.toString();s.push(`Negative col '${o}' failed: ${t}`)}if(s.length>0)throw new Error(s.join("\n"))}(0,t.L1)("detectors",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r={negEmpty:{csv:"id,col1\n1,\n2,\n3,\n4,\n5,",neg:["col1"]},negNum1:{csv:"col1\n1\n2\n3",neg:["col1"]},negNum2:{csv:"col1\n4\n5\n6\n7",neg:["col1"]},negNum3:{csv:"col1\n8\n9\n10\n11\n12",neg:["col1"]},negSmiles:{csv:"col1\nCCCCN1C(=O)CN=C(c2cc(F)ccc12)C3CCCCC3\nC1CCCCC1\nCCCCCC",neg:["col1"]},negSmilesWithSquareBrackets:{csv:"col1\nCl.c1ccc2nc3ccccc3cc2c1\nOc1cccc2cc3ccccc3cc12\n[SeH]c1ccc2ccccc2c1",neg:["col1"]},negFastaUnSingleChar:{csv:"col1\nAlanine\nCysteine\nAspartic acid\nGlutamic acid\nPhenylalanine",neg:["col1"]},fastaMsaSameLength:{csv:"seq\nFWPHEYFWPHEYYV\nYNRQWYVYNRQWYV\nMKPSEYVMKPSEYV",pos:{seq:new u(c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1,void 0)}},fastaExtSameLength:{csv:"seq\nFW[Ac]PHEYFWPH\nYN[Re]VYNRQWYV\n[Me]EYVMPS[Et]",pos:{seq:new u(c.Hi.FASTA,"SEQ",c.YI.UN,16,!0,void 0)}},fastaMsaExtSameLength:{csv:"seq\nFW[Ac]PHEY[Re]WPH\nYN[Re]VYNR[Ac]WYV\n[Me]EYVMPSFW[Me]H",pos:{seq:new u(c.Hi.FASTA,"SEQ.MSA",c.YI.UN,14,!0,void 0)}},fastaMsaExtManyMinus:{csv:"seq\n[D-Tic]-------[D-Tyr_Et][Tyr_ab-dehydroMe][dV][Cys_SEt]N[D-Orn][D-aThr]-[Phe_4Me]\n[Phe_2F]--------[Tyr_ab-dehydroMe][dV][Aca]N[D-Orn][D-aThr]-[Phe_4Me]\n[D-Tic]-[Hcy]QTWQ[Phe_4NH2][D-Tyr_Et][Tyr_ab-dehydroMe][dV][Cys_SEt]----[Phe_4Me]",pos:{seq:new u(c.Hi.FASTA,"SEQ.MSA",c.YI.UN,17,!0,void 0)}},sepSameLength:{csv:"seq\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-C-G-NH2\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-C-G-NH2\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-C-G-NH2",pos:{seq:new u(c.Hi.SEPARATOR,"SEQ.MSA",c.YI.UN,5,!0,"-")}},sepMsaSameLength:{csv:"seq\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-Aca-G-NH2\nAca-A-Aca-A-A-A-meI-A-A-A-A-A-Aca-G-NH2\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-Aca-G-NH2",pos:{seq:new u(c.Hi.SEPARATOR,"SEQ",c.YI.UN,5,!0,"-")}},helmSameLength:{csv:"seq\nPEPTIDE1{Ac(1).A.A.A.A.A.A.A.A.A.A.A.A.A.C(1).G.NH2}$$$$\nPEPTIDE1{Ab(1).Y.V.K.H.P.F.W.R.W.Y.A.A.A.C(1).G.NH2}$$$$\nPEPTIDE1{Ad(1).S.W.Y.C.K.H.P.M.W.A.A.A.A.C(1)-G-NH2}$$$$",pos:{seq:new u(c.Hi.HELM,null,null,19,void 0,void 0)}},fastaNonDigitAlphabet:{csv:'flagC\n"NMe-pyridazineH"\n"Pyrrolo[2,3-c]pyridazineH"',neg:["flagC"]}};for(const[s,o]of Object.entries(r))(0,t.t6)(`csvData2-${s}`,(async()=>{const t=(i=s,async()=>{const t=r[i].csv,n=e.DataFrame.fromCsv(t);return await a.data.detectSemanticTypes(n),n});var i;for(const e of o.neg??[])await d(t,e);for(const[e,r]of Object.entries(o.pos??{}))await h(t,e,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}));const s=new class{csvFastaDna1="seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC";fastaRna1="seq\nACGUCACGUC\nCAGUGUCAGUGU\nUUCAACUUCAAC";fastaPt1="seq\nFWPHEY\nYNRQWYV\nMKPSEYV";fastaUn="seq\n[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]DN\n[meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Aca]\n[Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Aca]";sepDna="seq\nA*C*G*T*C*A*C*G*T*C\nC*A*G*T*G*T*C*A*G*T*G*T\nT*T*C*A*A*C*T*T*C*A*A*C";sepRna="seq\nA*C*G*U*C*A*C*G*U*C\nC*A*G*U*G*U*C*A*G*U*G*U\nU*U*C*A*A*C*U*U*C*A*A*C";sepPt="seq\nF-W-P-H-E-Y-F-W-P-H-E-Y\nY-N-R-Q-W-Y-V-Y-N-R-Q-W-Y-V\nM-K-P-S-E-Y-V-M-K-P-S-E-Y-V";sepUn1="seq\nabc-dfgg-abc1-cfr3-rty-wert-cfr3-rty-wert\nrut12-her2-rty-wert-abc-abc1-dfgg-abc-abc1-dfgg\nrut12-rty-her2-abc-cfr3-wert-rut12-cfr3-wert-rut12";sepUn2="seq\nabc/dfgg/abc1/cfr3/rty/wert/abc/dfgg/abc1/cfr3/rty/wert\nrut12/her2/rty/wert//abc/abc1/dfgg/rut12/her2/rty/wert//abc/abc1/dfgg\nrut12/rty/her2/abc/cfr3//wert/rut12/rut12/rty/her2/abc/cfr3//wert/rut12";sepMsaDna1="seq\nA-C--G-T--C-T-A-C--G-T--C-T\nC-A-C--T--G-T-C-A-C--T--G-T\nA-C-C-G-T-A-C-T-A-C-C-G-T-A-C-T";sepMsaUnWEmpty="seq\nm1-M-m3-mon4-mon5-N-T-MON8-N9-m1-M-m3-mon4-mon5-N-T-MON8-N9\nm1-mon2-m3-mon4-mon5-Num--MON8-N9-m1-mon2-m3-mon4-mon5-Num--MON8-N9\n\nmon1-M-mon3-mon4-mon5---MON8-N9-mon1-M-mon3-mon4-mon5---MON8-N9";sepComplex="seq\nAca-F-K(AEEA-AEEA-R-Ac)-L-mF-V-Y-mNle-D-W-N-mF-Aca-G-NH2\nAca-F-K(AEEA-ARRA-W-Ac)-L-mF-V-Y-mNle-D-W-N-mF-Aca-G-NH2\nAca-F-K(AEEA-AEEA-Ac)-L-mF-V-Y-mNle-D-W-N-mF-Aca-G-NH2";fastaMsaDna1="seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT";fastaMsaPt1="seq\nFWR-WYV-KHPFWR-WYV-KHP\nYNR-WYV-KHPYNR-WYV-KHP\nMWRSWY-CKHPMWRSWY-CKHP"},o={fastaPtCsv:"System:AppData/Bio/samples/FASTA_PT.csv",msaComplex:"System:AppData/Bio/samples/MSA.csv",fastaCsv:"System:AppData/Bio/samples/FASTA.csv",helmCsv:"System:AppData/Bio/samples/HELM.csv",peptidesComplex:"System:AppData/Bio/tests/peptides_complex_msa.csv",peptidesSimple:"System:AppData/Bio/tests/peptides_simple_msa.csv",testDemogCsv:"System:AppData/Bio/tests/testDemog.csv",testHelmCsv:"System:AppData/Bio/tests/testHelm.csv",testIdCsv:"System:AppData/Bio/tests/testId.csv",testSmilesCsv:"System:AppData/Bio/tests/testSmiles.csv",testSmiles2Csv:"System:AppData/Bio/tests/testSmiles2.csv",testSmilesShort:"System:AppData/Bio/tests/testSmilesShort.csv",testActivityCliffsCsv:"System:AppData/Bio/tests/testActivityCliffs.csv",testCerealCsv:"System:AppData/Bio/tests/testCereal.csv",testUnichemSources:"System:AppData/Bio/tests/testUnichemSources.csv",testDmvOffices:"System:AppData/Bio/tests/testDmvOffices.csv",testAlertCollection:"System:AppData/Bio/tests/testAlertCollection.csv",testSpgi100:"System:AppData/Bio/tests/testSpgi100.csv",testSpgi:"System:AppData/Bio/tests/SPGI-derived.csv",testUrl:"System:AppData/Bio/tests/testUrl.csv"},i={};function g(e,t=y){return async()=>(e in i||(i[e]=(async()=>await t(o[e]))().catch((t=>{throw delete i[e],t}))),i[e])}async function y(t){const n=await a.dapi.files.readAsText(t);return e.DataFrame.fromCsv(n)}const b=t=>async()=>{const n=s[t],r=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(r),r};(0,t.t6)("NegativeStartEnd",(async()=>{await p(["START","END"])})),(0,t.t6)("NegativeStartEndIntermediate",(async()=>{await p(["START","END","INTERMEDIATE"])})),(0,t.t6)("FastaDna1",(async()=>{await h(b("csvFastaDna1"),"seq",n,c.Hi.FASTA,"SEQ",c.YI.DNA,4,!1)})),(0,t.t6)("FastaRna1",(async()=>{await h(b("fastaRna1"),"seq",n,c.Hi.FASTA,"SEQ",c.YI.RNA,4,!1)})),(0,t.t6)("FastaPt1",(async()=>{await h(b("fastaPt1"),"seq",n,c.Hi.FASTA,"SEQ",c.YI.PT,20,!1)})),(0,t.t6)("FastaPtGaps",(()=>m(["FW-PH-EYY","FYNRQWYV-","FKP-Q-SEYV"],n,c.Hi.FASTA,"SEQ",c.YI.PT,20,!1))),(0,t.t6)("FastaPtGapsMsa",(()=>m(["FW-PH-EYY","FYNRQWYV-","FKP-Q-SEY"],n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1))),(0,t.t6)("FastaUn",(async()=>{await h(b("fastaUn"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.UN,12,!0)})),(0,t.t6)("FastaMsaDna1",(async()=>{await h(b("fastaMsaDna1"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.DNA,4,!1)})),(0,t.t6)("FastaMsaPt1",(async()=>{await h(b("fastaMsaPt1"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1)})),(0,t.t6)("SepDna",(async()=>{await h(b("sepDna"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.DNA,4,!1,"*")})),(0,t.t6)("SepRna",(async()=>{await h(b("sepRna"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.RNA,4,!1,"*")})),(0,t.t6)("SepPt",(async()=>{await h(b("sepPt"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.PT,20,!1,"-")})),(0,t.t6)("SepUn1",(async()=>{await h(b("sepUn1"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.UN,8,!0,"-")})),(0,t.t6)("SepUn2",(async()=>{await h(b("sepUn2"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.UN,9,!0,"/")})),(0,t.t6)("SepMsaN1",(async()=>{await h(b("sepMsaDna1"),"seq",n,c.Hi.SEPARATOR,"SEQ.MSA",c.YI.DNA,4,!1,"-")})),(0,t.t6)("SepMsaUnWEmpty",(async()=>{await h(b("sepMsaUnWEmpty"),"seq",n,c.Hi.SEPARATOR,"SEQ.MSA",c.YI.UN,14,!0)})),(0,t.t6)("SepComplex",(async()=>{await h(b("sepComplex"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.UN,17,!0)})),(0,t.t6)("samplesFastaCsv",(async()=>{await f(g("fastaCsv"),{Sequence:new u(c.Hi.FASTA,"SEQ",c.YI.PT,20,!1)},n)})),(0,t.t6)("samplesPeptidesComplex",(async()=>{await f(g("peptidesComplex"),{},n)})),(0,t.t6)("samplesMsaComplex",(async()=>{await f(g("msaComplex"),{MSA:new u(c.Hi.SEPARATOR,"SEQ.MSA",c.YI.UN,161,!0,"/")},n)})),(0,t.t6)("samplesIdCsv",(async()=>{await f(g("testIdCsv"),{},n)})),(0,t.t6)("samplesSarSmallCsv",(async()=>{await f(g("testSmilesCsv"),{},n)})),(0,t.t6)("samplesHelmCsv",(async()=>{await f(g("helmCsv"),{HELM:new u(c.Hi.HELM,null,null,160,!0)},n)})),(0,t.t6)("samplesTestHelmCsv",(async()=>{await f(g("testHelmCsv"),{"HELM string":new u(c.Hi.HELM,null,null,9,!0)},n)})),(0,t.t6)("samplesTestDemogCsv",(async()=>{await f(g("testDemogCsv"),{},n)})),(0,t.t6)("samplesTestSmiles2Csv",(async()=>{await f(g("testSmiles2Csv"),{},n)})),(0,t.t6)("samplesTestSmilesShort",(async()=>{await f(g("testSmilesShort"),{},n)})),(0,t.t6)("samplesTestActivityCliffsNegativeSmiles",(async()=>{await f(g("testActivityCliffsCsv"),{},n)})),(0,t.t6)("samplesFastaPtCsv",(async()=>{await f(g("fastaPtCsv"),{sequence:new u(c.Hi.FASTA,"SEQ",c.YI.PT,20,!1)},n)})),(0,t.t6)("samplesTestCerealCsv",(async()=>{await f(g("testCerealCsv"),{},n)})),(0,t.t6)("samplesTestUnichemSources",(async()=>{await f(g("testUnichemSources"),{},n)})),(0,t.t6)("samplesTestDmvOffices",(async()=>{await f(g("testDmvOffices"),{},n)})),(0,t.t6)("samplesTestAlertCollection",(async()=>{await f(g("testAlertCollection"),{},n)})),(0,t.t6)("samplesTestSpgi",(async()=>{await f(g("testSpgi"),{},n)})),(0,t.t6)("samplesTestSpgi100",(async()=>{await f(g("testSpgi100"),{},n)})),(0,t.t6)("samplesTestUrl",(async()=>{await f(g("testUrl"),{},n)}))})),(0,t.L1)("detectors.weak-and-likely",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r={fastaDnaWeak1:"id,colName\n1,TTTTTTTTTT\n2,TTTTTTTTTT\n3,TTTTTTTTTT\n4,TTTTTTTTTT",fastaDnaWeak1LikelyName:"id,seq\n1,TTTTTTT\n2,TTTTTTT\n3,TTTTTTT\n4,TTTTTTT",fastaRnaWeak1:"id,colName\n1,UUUUUUUUUU\n2,UUUUUUUUUU\n3,UUUUUUUUUU\n4,UUUUUUUUUU",fastaRnaWeak1LikelyName:"id,seq\n1,UUUUUUU\n2,UUUUUUU\n3,UUUUUUU\n4,UUUUUUU",fastaPtWeak1:"id,colName\n1,SLSLSPGKSLSLSPGK\n2,SLSLSPGKSLSLSPGK\n3,SLSLSPGKSLSLSPGK\n4,SLSLSPGKSLSLSPGK",fastaPtWeak1LikelyName:"id,seq\n1,SLSLSPGKSLSLSPGK\n2,SLSLSPGKSLSLSPGK\n3,SLSLSPGKSLSLSPGK\n4,SLSLSPGKSLSLSPGK",fastaUn1:"id,colName\n1,word\n2,other\n3,some\n4,another",fastaUn1LikelyName:"id,seq\n1,word\n2,other\n3,some\n4,another",fastaUn2LikelyName:'protein\nBoombastic\nMegafantastic\n"just-a-random-thought,oy!"',fastaUnMsa1LikelyName:"id,seq\n1,word\n2,male\n3,bare\n4,core"},s=t=>async()=>{const n=r[t],s=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(s),s};(0,t.t6)("fastaDnaWeak1",(async()=>{await d(s("fastaDnaWeak1"),"colName")})),(0,t.t6)("fastaDnaWeak1LikelyName",(async()=>{await h(s("fastaDnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.DNA,4,!1)})),(0,t.t6)("fastaRnaWeak1",(async()=>{await d(s("fastaRnaWeak1"),"colName")})),(0,t.t6)("fastaRnaWeak1LikelyName",(async()=>{await h(s("fastaRnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.RNA,4,!1)})),(0,t.t6)("fastaPtWeak1",(async()=>{await d(s("fastaPtWeak1"),"colName")})),(0,t.t6)("fastaPtWeak1LikelyName",(async()=>{await h(s("fastaPtWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1)})),(0,t.t6)("fastaUn1",(async()=>{await d(s("fastaUn1"),"colName")})),(0,t.t6)("fastaUn1LikelyName",(async()=>{await d(s("fastaUn1LikelyName"),"seq")})),(0,t.t6)("fastaUn2LikelyName",(async()=>{await d(s("fastaUn2LikelyName"),"protein")})),(0,t.t6)("fastaUnMsa1LikelyName",(async()=>{await d(s("fastaUnMsa1LikelyName"),"seq")}))})),(0,t.L1)("detectorsBenchmark",(()=>{let n,r;async function s(s,i,a,l,u,d){return await async function(s){const h=await(async()=>{const t=function(t,n,r,s,o){let i;switch(t){case c.Hi.FASTA:i=e=>{let t="";for(let n=0;n<e.length;n++){const r=e[n];t+=1==r.length?r:`[${r}]`}return t};break;case c.Hi.SEPARATOR:i=(e,t)=>e.join(t);break;default:throw new Error(`Not supported notation '${t}'.`)}const a=(e,t)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e[Math.floor(Math.random()*e.length)];return i(n,o)},l=Array(s);for(let e=0;e<s;e++)l[e]=a(n,r);return e.Column.fromStrings("seq",l)}(i,[...(0,c.Qf)(a)],l,u,d),n=r.prepare({col:t});return o(n),n})(),p=Date.now(),m=o(h),f=Date.now();(function(e,r){const s=n.getSeqHandler(e);(0,t.E3)(e.semType===r.semType,!0),(0,t.E3)(s.notation===r.notation,!0),(0,t.E3)(s.alphabet===r.alphabet,!0),(0,t.E3)(s.separator===r.separator,!0)})(m,{semType:e.SEMTYPE.MACROMOLECULE,notation:i,alphabet:a,separator:d});const g=f-p;if(g>s){const e=`ET ${g} ms is more than max allowed ${s} ms.`;throw console.error(e),new Error(e)}return console.log(`ET ${g} ms is OK.`),g}(s)}function o(e){e.callSync();const t=e.getOutputParamValue(),n=e.inputs.col;return t&&(n.semType=t),n}(0,t.gM)((async()=>{n=await(0,l.Q)();const t=e.Func.find({package:"Bio",name:"detectMacromolecule"});r=t[0];const s=e.Column.fromStrings("seq",["ACGT","ACGT","ACGT"]);await r.prepare({col:s}).call()})),(0,t.t6)("fastaDnaShorts50Few50",(async()=>{await s(10,c.Hi.FASTA,c.YI.DNA,50,50)})),(0,t.t6)("fastaDnaShorts50Many1E6",(async()=>{await s(20,c.Hi.FASTA,c.YI.DNA,50,1e6)})),(0,t.t6)("fastaDnaLong1e6Few50",(async()=>{await s(20,c.Hi.FASTA,c.YI.DNA,1e6,50)})),(0,t.t6)("separatorDnaShorts50Few50",(async()=>{await s(10,c.Hi.SEPARATOR,c.YI.DNA,50,50,"/")})),(0,t.t6)("separatorDnaShorts50Many1E6",(async()=>{await s(20,c.Hi.SEPARATOR,c.YI.DNA,50,1e6,"/")})),(0,t.t6)("separatorDnaLong1e6Few50",(async()=>{await s(20,c.Hi.SEPARATOR,c.YI.DNA,1e6,50,"/")}))}));var g=n(608),y=n(1619),b=n(6740);async function w(n,r){const s=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(s);const o=e.DataFrame.fromCsv(r),i=s.getCol("seq");(0,t.E3)(i.semType,e.SEMTYPE.MACROMOLECULE);const c=o.getCol("seq"),l=await(0,g.eE)(i,!0);(0,t.J6)(l.toList(),c.toList())}(0,t.L1)("MSA",(async()=>{let n;async function r(r,s,o,i,l,u){const d=e.DataFrame.fromCsv(r);await a.data.detectSemanticTypes(d);const h=e.DataFrame.fromCsv(s).getCol("seq"),p=d.getCol("seq");(0,t.E3)(p.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(p.meta.units,o),l&&(0,t.E3)(p.getTag(c.gp.alphabet),l);const m=await(0,y.D)({col:p,pepsea:{method:u}},n);(0,t.E3)(m.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(m.meta.units,i),(0,t.E3)(m.getTag(c.gp.aligned),"SEQ.MSA"),l&&(0,t.E3)(m.getTag(c.gp.alphabet),l),(0,t.J6)(m.toList(),h.toList())}(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("isCorrect",(async()=>{await w("seq\nFWRWYVKHP\nYNRWYVKHP\nMWRSWYCKHP","seq\nFWR-WYVKHP\nYNR-WYVKHP\nMWRSWYCKHP")})),(0,t.t6)("isCorrectLong",(async()=>{await w("seq\nFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHP\nYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHP\nMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHP","seq\nFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHP\nYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHP\nMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHP")})),(0,t.t6)("isCorrectHelm",(async()=>{await(0,b.m8)(),await r("seq\n PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2}$$$$\n PEPTIDE1{meI.Aca.N.T.dE.Thr_PO3H2}$$$$\n PEPTIDE1{hHis.Aca.N.T.dE.Thr_PO3H2}$$$$","seq\n meI.hHis.Aca.N.T.dE.Thr_PO3H2\n .meI.Aca.N.T.dE.Thr_PO3H2\n .hHis.Aca.N.T.dE.Thr_PO3H2",c.Hi.HELM,c.Hi.SEPARATOR,void 0,"mafft")}),{timeout:6e4}),(0,t.t6)("isCorrectHelmLong",(async()=>{await(0,b.m8)(),await r("seq\n PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.dV.E.N.D-Orn.D-aThr.Phe_4Me.Thr_PO3H2}$$$$\n PEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Tyr_PO3H2.D-Chg.dV.Phe_ab-dehydro.N.D-Orn.D-aThr.Phe_4Me}$$$$\n PEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me}$$$$","seq\n meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.dV.E.N.D-Orn.D-aThr.Phe_4Me.Thr_PO3H2\n meI.hHis.Aca.Cys_SEt.T.dK..Tyr_PO3H2.D-Chg.dV.Phe_ab-dehydro.N.D-Orn.D-aThr.Phe_4Me.\n Lys_Boc.hHis.Aca.Cys_SEt.T.dK..Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me.",c.Hi.HELM,c.Hi.SEPARATOR,void 0,"mafft")}),{timeout:6e4}),(0,t.t6)("isCorrectSeparator",(async()=>{await r("seq\n F-W-P-H-E-Y\n Y-N-R-Q-W-Y-V\n M-K-P-S-E-Y-V","seq\n FWPHEY-\n YNRQWYV\n MKPSEYV",c.Hi.SEPARATOR,c.Hi.FASTA,c.YI.PT)})),(0,t.t6)("isCorrectSeparatorLong",(async()=>{await r("seq\n M-I-E-V-F-L-F-G-I-V-L-G-L-I-P-I-T-L-A-G-L-F-V-T-A-Y-L-Q-Y-R-R-G-D-Q-L-D-L\n M-M-E-L-V-L-K-T-I-I-G-P-I-V-V-G-V-V-L-R-I-V-D-K-W-L-N-K-D-K\n M-D-R-T-D-E-V-S-N-H-T-H-D-K-P-T-L-T-W-F-E-E-I-F-E-E-Y-H-S-P-F-H-N","seq\n MIEV-FLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL\n MMEL-VLKTII-GPIVVGVVLRIVDKWLNKDK------\n MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN-----",c.Hi.SEPARATOR,c.Hi.FASTA,c.YI.PT)}))}));var v=n(1991),A=n.n(v),E=n(7278),T=n(6718),C=n(6642);async function S(t){const n=await async function(e){return await Se.files.readAsText(e)}(t),r=e.DataFrame.fromCsv(n);return r.name=t.replace(".csv",""),r}async function _(e,n=5e3){await(0,t.cb)(0),await(0,t.PE)(e.onAfterDrawContent,(()=>{}),(()=>{e.invalidate()}),n);const r=e.columns.length;for(let t=0;t<r;++t){const n=e.columns.byIndex(t);if(n){const t=e.cell(n.name,0),[r,i,a]=(0,C.BG)(t),c=(void 0,(o=s=a.rendererBack)&&void 0!==o.onRendered&&void 0!==o.invalidate&&void 0!==o.awaitRendered?s:null);c&&await c.awaitRendered()}}var s,o}var P=n(4139),N=n(4356);async function M(e,n){const r=(0,c.J9)(e);console.debug(`Bio: tests: splitters: src=${JSON.stringify(e)}, res=${JSON.stringify(r)} .`),(0,t.J6)(A().count(0).take(r.length).map((e=>r.getOriginal(e))).toArray(),n)}async function x(e,n){const r=(0,E.qp)(e);console.debug(`Bio: tests: splitters: src=${JSON.stringify(e)}, res=${JSON.stringify(r)} .`),(0,t.J6)(A().count(0).take(r.length).map((e=>r.getOriginal(e))).toArray(),n)}(0,t.L1)("splitters",(async()=>{(0,t.gM)((async()=>{})),(0,t.Pl)((async()=>{}));const e=["M[MeI]YKETLL[MeF]PKTDFPMRGGL[MeA]",["M","MeI","Y","K","E","T","L","L","MeF","P","K","T","D","F","P","M","R","G","G","L","MeA"]],n=["[meI][Pip][dK][Thr_PO3H2][L-hArg(Et,Et)][D-Tyr_Et][Tyr_ab-dehydroMe][dV]EN[D-Orn][D-aThr][Phe_4Me]",["meI","Pip","dK","Thr_PO3H2","L-hArg(Et,Et)","D-Tyr_Et","Tyr_ab-dehydroMe","dV","E","N","D-Orn","D-aThr","Phe_4Me"]],r=["PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Tyr_ab-dehydroMe.dV.E.N.D-Orn.D-aThr.Phe_4Me}$$$",["meI","hHis","Aca","N","T","dE","Thr_PO3H2","Aca","D-Tyr_Et","Tyr_ab-dehydroMe","dV","E","N","D-Orn","D-aThr","Phe_4Me"]],s=["PEPTIDE1{meI.hHis.Aca.N.T.dK.Thr_PO3H2.Aca.D-Tyr_Et.D-Dap.dV.E.N.pnG.Phe_4Me}$$$",["meI","hHis","Aca","N","T","dK","Thr_PO3H2","Aca","D-Tyr_Et","D-Dap","dV","E","N","pnG","Phe_4Me"]],o=["PEPTIDE1{[meI].[hHis].[Aca].N.T.[dK].[Thr_PO3H2].[Aca].[D-Tyr_Et].[D-Dap].[dV].E.N.[pnG].[Phe_4Me]}$$$",["meI","hHis","Aca","N","T","dK","Thr_PO3H2","Aca","D-Tyr_Et","D-Dap","dV","E","N","pnG","Phe_4Me"]],i=["RNA1{R(U)P.R(T)P.R(G)P.R(C)P.R(A)}$$$$",["R(U)P","R(T)P","R(G)P","R(C)P","R(A)"]],a=["RNA1{P.R(U)P.R(T)}$$$$",["P","R(U)P","R(T)"]],c=["RNA1{P.R(U).P.R(T)}$$$$",["P","R(U)","P","R(T)"]];(0,t.t6)("fastaMulti",(async()=>{await M(e[0],e[1])})),(0,t.t6)("fastaFromHelm",(async()=>{await M(n[0],n[1])})),(0,t.t6)("helm1",(async()=>{await x(r[0],r[1])})),(0,t.t6)("helm2",(async()=>{await x(s[0],s[1])})),(0,t.t6)("helm3-multichar",(async()=>{await x(o[0],o[1])})),(0,t.t6)("testHelm1",(async()=>{await x(i[0],i[1])})),(0,t.t6)("testHelm2",(async()=>{await x(a[0],a[1])})),(0,t.t6)("testHelm3",(async()=>{await x(c[0],c[1])}))})),(0,t.L1)("splitters",(()=>{let n,r,s;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)})),(0,t.t6)("splitToMonomers",(async()=>{const e=await a.dapi.files.readCsv("System:AppData/Bio/samples/MSA.csv"),n=e.getCol("MSA"),r=await a.functions.call("Bio:detectMacromolecule",{col:n});r&&(n.semType=r),n.setTag(c.gp.aligned,P.gN);const s=await a.functions.call("Bio:splitToMonomersTopMenu",{table:e,sequence:n});(0,t.E3)(s.columns.names().includes("17"),!0),await a.data.detectSemanticTypes(s);const o=a.shell.addTableView(s);await _(o.grid),(0,t.E3)(o.grid.dataFrame.id,e.id)})),(0,t.t6)("getHelmMonomers",(async()=>{const t=e.DataFrame.fromCsv("HELM,Activity\nPEPTIDE1{hHis.N.T}$$$,5.30751\nPEPTIDE1{hHis.Aca.Cys_SEt}$$$,5.72388\n");await a.data.detectSemanticTypes(t);const n=["hHis","Aca","Cys_SEt","N","T"],r=t.getCol("HELM"),s=await a.functions.call("Bio:getHelmMonomers",{sequence:r}),o=n.filter((e=>!s.includes(e))),i=s.filter((e=>!n.includes(e)));if(o.length>0||i.length){const e=[];throw o.length>0&&e.push(`Missed monomers ${JSON.stringify(o)}.`),i.length>0&&e.push(`Unexpected monomers ${JSON.stringify(i)}.`),new Error(e.join(" "))}}))}));var $=n(8604);(0,t.L1)("monomerLibraries",(()=>{let e,n=null;(0,t.gM)((async()=>{e=await(0,T.pj)(),n=(0,N.ub)()})),(0,t.Pl)((async()=>{await(0,N.Eu)(n)})),(0,t.t6)("default",(async()=>{await(0,N.Eu)({exclude:[],explicit:[],duplicateMonomerPreferences:{}}),await e.loadMonomerLib(!0);const n=e.getMonomerLib();(0,t.E3)(n.getPolymerTypes().length>0,!0)})),(0,t.t6)("forTests",(async()=>{await e.loadMonomerLibForTests(),function(e,n){const r=n,s=e.getSummaryObj();for(const e in r)r[e]||delete r[e];for(const e in s)s[e]||delete s[e];if(0==Object.keys(r).length&&0!=Object.keys(s).length)throw new Error("Expected empty monomer lib, actual is not.");if(0!=Object.keys(r).length&&0==Object.keys(s).length)throw new Error("Expected non-empty monomer lib, actual is empty.");try{(0,t.Xk)(s,r),(0,t.Xk)(r,s)}catch(e){throw new Error(`Expected monomer lib ${JSON.stringify(r)} does not match actual ${JSON.stringify(s)}.`)}}(e.getMonomerLib(),$.VV)})),(0,t.t6)("empty",(async()=>{const n=await(0,N.ub)(),r=await e.getFileManager();let s=r.getValidLibraryPaths();0===s.length&&(s=await r.getValidLibraryPathsAsynchronously()),n.exclude=s,n.explicit=[],await(0,N.Eu)(n),await e.loadMonomerLib(!0);const o=e.getMonomerLib().getPolymerTypes();(0,t.E3)(0===o.length,!0)})),(0,t.t6)("override",(async()=>{const n={symbol:"over1",name:"Test override monomer 1",molfile:"",author:"Test Author",id:0,rgroups:[],smiles:"",polymerType:"PEPTIDE",monomerType:"Backbone",createDate:null},r=e.getMonomerLib(),s=r.getMonomer(n.polymerType,n.symbol);(0,t.E3)(null===s,!0,`Unexpectedly found monomer '${n.symbol}' `);const o=r.override({[n.polymerType]:{[n.symbol]:n}},"test").getMonomer(n.polymerType,n.symbol);(0,t.Xk)(o,n)}))}));var L=n(7389),I=n(1757),R=n.n(I),O=n(1858),k=n(6873),G=n(5433);async function D(n,r){const s=n(),o=e.DataFrame.fromColumns(s);await a.data.detectSemanticTypes(o);const i=Date.now(),c=(o.columns.byName("MSA"),a.shell.addTableView(o));await _(c.grid),(0,t.E3)(c.grid.dataFrame.id,o.id);const l=Date.now()-i;console.log(`Performance test: ${r}: ${l}ms`)}(0,t.L1)("renderers",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("long sequence performance ",(async()=>{await D(k.dW,"Long sequences")})),(0,t.t6)("many sequence performance",(async()=>{await D(k.fD,"Many sequences")})),(0,t.t6)("rendererMacromoleculeFasta",(async()=>{await async function(){const n=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA.csv"),r=e.DataFrame.fromCsv(n),s=r.getCol("Sequence"),o=await a.functions.call("Bio:detectMacromolecule",{col:s});o&&(s.semType=o);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await _(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=s.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(c,"sequence")}()})),(0,t.t6)("rendererMacromoleculeSeparator",(async()=>{await async function(){const n=await a.dapi.files.readAsText("System:AppData/Bio/samples/SEPARATOR_PT.csv"),r=e.DataFrame.fromCsv(n),s=r.getCol("sequence"),o=await a.functions.call("Bio:detectMacromolecule",{col:s});o&&(s.semType=o);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await _(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=s.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(c,"sequence")}()})),(0,t.t6)("rendererMacromoleculeDifference",(async()=>{await async function(){const n=e.Column.fromStrings("SequencesDiff",["meI/hHis/Aca/N/T/dK/Thr_PO3H2/Aca#D-Tyr_Et/Tyr_ab-dehydroMe/meN/E/N/dV"]);n.meta.units=c.Hi.SEPARATOR,n.setTag(c.gp.separator,"/"),n.setTag(c.gp.aligned,"SEQ"),n.setTag(c.gp.alphabet,"UN"),n.setTag(c.gp.alphabetIsMultichar,"true"),n.semType=P.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]),s=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await _(s.grid),(0,t.E3)(s.grid.dataFrame.id,r.id);const o=n.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(o,P.uF.MACROMOLECULE_DIFFERENCE)}()})),(0,t.t6)("afterMsa",(async()=>{await async function(){const r=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA.fasta"),s=(await a.functions.call("Bio:importFasta",{fileContent:r}))[0],o=s.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:o});i&&(o.semType=i);const l=a.shell.addTableView(s);await a.data.detectSemanticTypes(s),console.log("Bio: tests/renderers/afterMsa, table view"),await _(l.grid),(0,t.E3)(l.grid.dataFrame.id,s.id),console.log(`Bio: tests/renderers/afterMsa, src before test semType="${o.semType}", units="${o.meta.units}", cell.renderer="${o.getTag(e.TAGS.CELL_RENDERER)}"`),(0,t.E3)(o.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(o.meta.units,c.Hi.FASTA),(0,t.E3)(o.getTag(c.gp.aligned),"SEQ"),(0,t.E3)(o.getTag(c.gp.alphabet),c.YI.PT),(0,t.E3)(o.getTag(e.TAGS.CELL_RENDERER),"sequence");const u=await(0,y.D)({col:o},n);await _(l.grid),(0,t.E3)(l.grid.dataFrame.id,s.id),(0,t.E3)(u.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(u.meta.units,c.Hi.FASTA),(0,t.E3)(u.getTag(c.gp.aligned),"SEQ.MSA"),(0,t.E3)(u.getTag(c.gp.alphabet),c.YI.PT),(0,t.E3)(u.getTag(e.TAGS.CELL_RENDERER),"sequence"),n.getSeqHandler(u)}()})),(0,t.t6)("afterConvert",(async()=>{await async function(){const r=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA_PT.csv"),s=e.DataFrame.fromCsv(r),o=s.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:o});i&&(o.semType=i);const l=a.shell.addTableView(s);await a.data.detectSemanticTypes(s);const u=await(0,G.r)(o,n,c.Hi.SEPARATOR,"/");await _(l.grid),(0,t.E3)(l.grid.dataFrame.id,s.id);const d=u.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(d,"sequence"),n.getSeqHandler(u)}()})),(0,t.t6)("afterConvertToHelm",(async()=>{await async function(){const r=await a.dapi.files.readCsv("System:AppData/Bio/samples/FASTA_PT.csv"),s=a.shell.addTableView(r);await _(s.grid);const o=r.getCol("sequence"),i=n.getSeqHandler(o).convert(c.Hi.HELM);r.columns.add(i),await _(s.grid),(0,t.E3)(i.getTag(e.TAGS.CELL_RENDERER),"helm")}()})),(0,t.t6)("selectRendererBySemType",(async()=>{await async function(){const n=e.Column.fromStrings("SequencesDiff",["meI/hHis/Aca/N/T/dK/Thr_PO3H2/Aca#D-Tyr_Et/Tyr_ab-dehydroMe/meN/E/N/dV"]);n.meta.units=c.Hi.SEPARATOR,n.setTag(c.gp.separator,"/"),n.setTag(c.gp.aligned,"SEQ"),n.setTag(c.gp.alphabet,"UN"),n.setTag(c.gp.alphabetIsMultichar,"true"),n.semType=P.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]);a.shell.addTableView(r),await(0,t.cb)(100);const s=n.getTag(e.TAGS.CELL_RENDERER);if("MacromoleculeDifference"!==s)throw new Error(`Units 'separator', separator '/' and semType 'MacromoleculeDifference' have been manually set on column but after df was added as table, view renderer has set to '${s}' instead of correct 'MacromoleculeDifference'.`)}()})),(0,t.t6)("scatterPlotTooltip",(async()=>{await async function(){const n=e.DataFrame.fromCsv(r);n.currentRowIdx=0;const s=a.shell.addTableView(n),o=n.plot.scatter({x:"x",y:"y"});s.dockManager.dock(o,e.DOCK_TYPE.RIGHT,null),await Promise.all([(0,t.PE)(o.onAfterDrawScene,(()=>{}),(()=>{o.invalidateCanvas()}),1e3),_(s.grid,500)]);const i=o.root.getBoundingClientRect(),c=o.worldToScreen(1,0),l=new MouseEvent("mousemove",{cancelable:!0,bubbles:!0,view:window,button:0,clientX:i.left+c.x,clientY:i.top+c.y}),u=R()(o.root).find("canvas").get()[0];await(0,t.PE)((0,O.fromEvent)(u,"mousemove"),(()=>{Se.logger.debug(`Test: event, currentRowIdx=${n.currentRowIdx}`),(0,t.E3)(R()(L.tooltip.root).find("div table.d4-row-tooltip-table tr td canvas").length,1),(0,t.E3)(o.hitTest(c.x,c.y),1)}),(()=>{u.dispatchEvent(l)}),500),await _(s.grid,500)}()}));const r="seq,x,y\nACGGTGTCGT,0,0\nCGGTATCCCT,1,0\nCTCGGCATGC,2,0\n"}));var H=n(6882);(0,t.L1)("renderers: monomerPlacer",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,T.pj)(),r=await(0,N.ub)(),await n.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(r),await n.loadMonomerLib(!0)}));const s={splitter:{csv:"id,seq\nid1,m1-M-m3-mon4-mon5-N-T-MON8-N9\nid2,m1-mon2-m3-mon4-mon5-Num-MON8-N9\nid3,mon1-M-mon3-mon4-mon5-MON8-N9\n",testList:[{src:{row:0,x:-1},tgt:{pos:null}},{src:{row:1,x:0},tgt:{pos:null}},{src:{row:1,x:5},tgt:{pos:0}},{src:{row:1,x:6},tgt:{pos:0}},{src:{row:1,x:26},tgt:{pos:1}},{src:{row:1,x:160},tgt:{pos:6}},{src:{row:1,x:185},tgt:{pos:7}},{src:{row:2,x:140},tgt:{pos:5}},{src:{row:2,x:145},tgt:{pos:5}}]},splitterMsa:{csv:"id,seq\nid1,m1-M-m3-mon4-mon5-N-T-MON8-N9\nid2,m1-mon2-m3-mon4-mon5-Num--MON8-N9\nid3,\nid4,mon1-M-mon3-mon4-mon5---MON8-N9\n",testList:[{src:{row:0,x:-1},tgt:{pos:null}},{src:{row:1,x:0},tgt:{pos:null}},{src:{row:1,x:1},tgt:{pos:null}},{src:{row:1,x:4},tgt:{pos:null}},{src:{row:1,x:5},tgt:{pos:0}},{src:{row:1,x:37},tgt:{pos:0}},{src:{row:1,x:38},tgt:{pos:1}},{src:{row:1,x:170},tgt:{pos:5}},{src:{row:1,x:200},tgt:{pos:5}},{src:{row:2,x:20},tgt:{pos:null}},{src:{row:3,x:170},tgt:{pos:5}},{src:{row:3,x:200},tgt:{pos:5}},{src:{row:3,x:297},tgt:{pos:null}}]},fastaMsa:{csv:"id,seq\nid1,QQYNIYPLT\nid2,QQWSSFPYT\nid3,\nid3,QHIRE--LT\n",testList:[{src:{row:1,x:-1},tgt:{pos:null}},{src:{row:1,x:0},tgt:{pos:null}},{src:{row:1,x:1},tgt:{pos:null}},{src:{row:1,x:19},tgt:{pos:0}},{src:{row:1,x:170},tgt:{pos:8}},{src:{row:1,x:171},tgt:{pos:8}},{src:{row:2,x:5},tgt:{pos:null}},{src:{row:3,x:170},tgt:{pos:8}},{src:{row:3,x:181},tgt:{pos:null}}]}};for(const[n,r]of Object.entries(s))(0,t.t6)(`getPosition-${n}`,(async()=>{const t=e.DataFrame.fromCsv(r.csv);await a.data.detectSemanticTypes(t);const n=t.getCol("seq"),s=new H.Jy(null,n,Se.logger,3,(()=>({monomerCharWidth:7,separatorWidth:12,monomerToShort:c.zS})));await s.init();const o=r.testList;for(let e=0;e<n.length;++e)s.getCellMonomerLengths(e,1e4);const i=[];for(const[e,t]of A().enumerate(o)){const t={pos:s.getPosition(e.src.row,e.src.x,1e4)};e.tgt.pos!=t.pos&&i.push(`Test src ${JSON.stringify(e.src)} expected tgt ${JSON.stringify(e.tgt)}, but get ${JSON.stringify({res:t})}`)}if(i.length>0)throw new Error("Test failed error(s):\n"+i.join(", \n"))}));const o=[10,20,30,40,50,60],i={left:{x:3,tgt:null},c0left:{x:10,tgt:0},c0mid:{x:12,tgt:0},c0right:{x:19,tgt:0},c1left:{x:20,tgt:1},c2right:{x:39,tgt:2},c4left:{x:50,tgt:4},c4right:{x:59,tgt:4},max:{x:60,tgt:null},right:{x:65,tgt:null}};for(const[e,n]of Object.entries(i))(0,t.t6)("hitBounds-"+e,(async()=>{const e=(0,H.Bb)(o,n.x);(0,t.E3)(e,n.tgt)}))})),(0,t.L1)("converters",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,l.Q)()})),function(e){e.fastaPt="fastaPt",e.separatorPt="separatorPt",e.helmPt="helmPt",e.fastaDna="fastaDna",e.separatorDna="separatorDna",e.helmDna="helmDna",e.fastaRna="fastaRna",e.separatorRna="separatorRna",e.helmRna="helmRna",e.fastaGaps="fastaGaps",e.separatorGaps="separatorGaps",e.helmGaps="helmGaps",e.fastaUn="fastaUn",e.separatorUn="separatorUn",e.helmUn="helmUn",e.helmLoneDeoxyribose="helmLoneDeoxyribose",e.helmLoneRibose="helmLoneRibose",e.helmLonePhosphorus="helmLonePhosphorus",e.fastaLoneDeoxyribose="fastaLoneDeoxyribose",e.fastaLoneRibose="fastaLoneRibose",e.fastaLonePhosphorus="fastaLonePhosphorus"}(r||(r={}));const s={[r.fastaPt]:"seq\nFWPHEYFWPHEY\nYNRQWYVYNRQWYV\nMKPSEYVMKPSEYV",[r.separatorPt]:"seq\nF-W-P-H-E-Y-F-W-P-H-E-Y\nY-N-R-Q-W-Y-V-Y-N-R-Q-W-Y-V\nM-K-P-S-E-Y-V-M-K-P-S-E-Y-V",[r.helmPt]:"seq\nPEPTIDE1{F.W.P.H.E.Y.F.W.P.H.E.Y}$$$$\nPEPTIDE1{Y.N.R.Q.W.Y.V.Y.N.R.Q.W.Y.V}$$$$\nPEPTIDE1{M.K.P.S.E.Y.V.M.K.P.S.E.Y.V}$$$$",[r.fastaDna]:"seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",[r.separatorDna]:"seq\nA/C/G/T/C/A/C/G/T/C\nC/A/G/T/G/T/C/A/G/T/G/T\nT/T/C/A/A/C/T/T/C/A/A/C",[r.helmDna]:"seq\nRNA1{d(A)p.d(C)p.d(G)p.d(T)p.d(C)p.d(A)p.d(C)p.d(G)p.d(T)p.d(C)p}$$$$\nRNA1{d(C)p.d(A)p.d(G)p.d(T)p.d(G)p.d(T)p.d(C)p.d(A)p.d(G)p.d(T)p.d(G)p.d(T)p}$$$$\nRNA1{d(T)p.d(T)p.d(C)p.d(A)p.d(A)p.d(C)p.d(T)p.d(T)p.d(C)p.d(A)p.d(A)p.d(C)p}$$$$",[r.fastaRna]:"seq\nACGUCACGUC\nCAGUGUCAGUGU\nUUCAACUUCAAC",[r.separatorRna]:"seq\nA*C*G*U*C*A*C*G*U*C\nC*A*G*U*G*U*C*A*G*U*G*U\nU*U*C*A*A*C*U*U*C*A*A*C",[r.helmRna]:"seq\nRNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(C)p.r(A)p.r(C)p.r(G)p.r(U)p.r(C)p}$$$$\nRNA1{r(C)p.r(A)p.r(G)p.r(U)p.r(G)p.r(U)p.r(C)p.r(A)p.r(G)p.r(U)p.r(G)p.r(U)p}$$$$\nRNA1{r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p.r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p}$$$$",[r.fastaGaps]:"seq\nFW-PH-EYYFW-PH-EYY\nFYNRQWYV-FYNRQWYV-\nFKP-Q-SEYVFKP-Q-SEYV",[r.separatorGaps]:"seq\nF/W//P/H//E/Y/Y/F/W//P/H//E/Y/Y\nF/Y/N/R/Q/W/Y/V//F/Y/N/R/Q/W/Y/V/\nF/K/P//Q//S/E/Y/V/F/K/P//Q//S/E/Y/V",[r.helmGaps]:"seq\nPEPTIDE1{F.W.*.P.H.*.E.Y.Y.F.W.*.P.H.*.E.Y.Y}$$$$\nPEPTIDE1{F.Y.N.R.Q.W.Y.V.*.F.Y.N.R.Q.W.Y.V.*}$$$$\nPEPTIDE1{F.K.P.*.Q.*.S.E.Y.V.F.K.P.*.Q.*.S.E.Y.V}$$$$",[r.fastaUn]:"seq\n[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D\n[meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2]\n[Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca]",[r.separatorUn]:"seq\nmeI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D-meI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D\nmeI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-meI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2\nLys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-Lys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca",[r.helmUn]:"seq\nPEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D.meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2}$$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca}$$$$",[r.helmLoneDeoxyribose]:"seq\nRNA1{d(A).d(C).d(G).d(T).d(C).d(A).d(C).d(G).d(T).d(C)}$$$$\nRNA1{d(C).d(A).d(G).d(T).d(G).d(T)p.d(C).d(A).d(G).d(T).d(G).d(T)p}$$$$\nRNA1{d(T).d(T).d(C).d(A).d(A).d(C)p.d(T).d(T).d(C).d(A).d(A).d(C)p}$$$$",[r.helmLoneRibose]:"seq\nRNA1{r(A).r(C).r(G).r(U).r(C).r(A).r(C).r(G).r(U).r(C)}$$$$\nRNA1{r(C).r(A).r(G).r(U).r(G).r(U)p.r(C).r(A).r(G).r(U).r(G).r(U)p}$$$$\nRNA1{r(U).r(U).r(C).r(A).r(A).r(C)p.r(U).r(U).r(C).r(A).r(A).r(C)p}$$$$",[r.helmLonePhosphorus]:"seq\nRNA1{p.p.r(A)p.r(C)p.r(G)p.r(U)p.r(C)p.r(A)p.r(C)p.r(G)p.r(U)p.r(C)p}$$$$\nRNA1{p.p.r(C)p.r(A)p.p.r(G)p.r(U)p.r(G)p.r(U)p.r(C)p.r(A)p.p.r(G)p.r(U)p.r(G)p.r(U)p}$$$$\nRNA1{p.r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p.r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p.p.p}$$$$"},o=new Set(Object.values(c.gp));async function i(t){const n=s[t],r=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(r),r}function u(e,r){if(e===c.Hi.SEPARATOR&&!r)throw new Error(`Argument 'separator' is mandatory for target notation '${e.toString()}'.`);return function(s){const o=n.getSeqHandler(s).convert(e,r);return(0,t.E3)(o.meta.units,e),o}}async function d(e,r,s){const a=(await i(e)).getCol("seq"),l=r(a),u=(await i(s)).getCol("seq");(0,t.J6)(l.toList(),u.toList());const d=n.getSeqHandler(a),h=n.getSeqHandler(l);for(const[e,n]of Object.entries(u.tags)){if(!o.has(e)||d.notation===c.Hi.HELM&&[c.gp.alphabet,c.gp.alphabetIsMultichar].includes(e)||h.notation===c.Hi.HELM&&[c.gp.alphabet,c.gp.alphabetIsMultichar].includes(e))continue;const r=l.getTag(e);(0,t.E3)(r,n,`Tag '${e}' expected value '${n}' is not equal to actual '${r}'.`)}}(0,t.t6)("testFastaPtToSeparator",(async()=>{await d(r.fastaPt,u(c.Hi.SEPARATOR,"-"),r.separatorPt)})),(0,t.t6)("testFastaDnaToSeparator",(async()=>{await d(r.fastaDna,u(c.Hi.SEPARATOR,"/"),r.separatorDna)})),(0,t.t6)("testFastaRnaToSeparator",(async()=>{await d(r.fastaRna,u(c.Hi.SEPARATOR,"*"),r.separatorRna)})),(0,t.t6)("testFastaGapsToSeparator",(async()=>{await d(r.fastaGaps,u(c.Hi.SEPARATOR,"/"),r.separatorGaps)})),(0,t.t6)("testFastaUnToSeparator",(async()=>{await d(r.fastaUn,u(c.Hi.SEPARATOR,"-"),r.separatorUn)})),(0,t.t6)("testFastaPtToHelm",(async()=>{await d(r.fastaPt,u(c.Hi.HELM),r.helmPt)})),(0,t.t6)("testFastaDnaToHelm",(async()=>{await d(r.fastaDna,u(c.Hi.HELM),r.helmDna)})),(0,t.t6)("testFastaRnaToHelm",(async()=>{await d(r.fastaRna,u(c.Hi.HELM),r.helmRna)})),(0,t.t6)("testFastaGapsToHelm",(async()=>{await d(r.fastaGaps,u(c.Hi.HELM),r.helmGaps)})),(0,t.t6)("testSeparatorPtToFasta",(async()=>{await d(r.separatorPt,u(c.Hi.FASTA),r.fastaPt)})),(0,t.t6)("testSeparatorDnaToFasta",(async()=>{await d(r.separatorDna,u(c.Hi.FASTA),r.fastaDna)})),(0,t.t6)("testSeparatorRnaToFasta",(async()=>{await d(r.separatorRna,u(c.Hi.FASTA),r.fastaRna)})),(0,t.t6)("testSeparatorGapsToFasta",(async()=>{await d(r.separatorGaps,u(c.Hi.FASTA),r.fastaGaps)})),(0,t.t6)("testSeparatorUnToFasta",(async()=>{await d(r.separatorUn,u(c.Hi.FASTA),r.fastaUn)})),(0,t.t6)("testSeparatorPtToHelm",(async()=>{await d(r.separatorPt,u(c.Hi.HELM),r.helmPt)})),(0,t.t6)("testSeparatorDnaToHelm",(async()=>{await d(r.separatorDna,u(c.Hi.HELM),r.helmDna)})),(0,t.t6)("testSeparatorRnaToHelm",(async()=>{await d(r.separatorRna,u(c.Hi.HELM),r.helmRna)})),(0,t.t6)("testSeparatorGapsToHelm",(async()=>{await d(r.separatorGaps,u(c.Hi.HELM),r.helmGaps)})),(0,t.t6)("testHelmDnaToFasta",(async()=>{await d(r.helmDna,u(c.Hi.FASTA),r.fastaDna)})),(0,t.t6)("testHelmRnaToFasta",(async()=>{await d(r.helmRna,u(c.Hi.FASTA),r.fastaRna)})),(0,t.t6)("testHelmPtToFasta",(async()=>{await d(r.helmPt,u(c.Hi.FASTA),r.fastaPt)})),(0,t.t6)("testHelmUnToFasta",(async()=>{await d(r.helmUn,u(c.Hi.FASTA),r.fastaUn)})),(0,t.t6)("testHelmDnaToSeparator",(async()=>{await d(r.helmDna,u(c.Hi.SEPARATOR,"/"),r.separatorDna)})),(0,t.t6)("testHelmRnaToSeparator",(async()=>{await d(r.helmRna,u(c.Hi.SEPARATOR,"*"),r.separatorRna)})),(0,t.t6)("testHelmPtToSeparator",(async()=>{await d(r.helmPt,u(c.Hi.SEPARATOR,"-"),r.separatorPt)})),(0,t.t6)("testHelmUnToSeparator",(async()=>{await d(r.helmUn,u(c.Hi.SEPARATOR,"-"),r.separatorUn)})),(0,t.t6)("testHelmLoneRibose",(async()=>{await d(r.helmLoneRibose,u(c.Hi.FASTA),r.fastaRna)})),(0,t.t6)("testHelmLoneDeoxyribose",(async()=>{await d(r.helmLoneDeoxyribose,u(c.Hi.SEPARATOR,"/"),r.separatorDna)})),(0,t.t6)("testHelmLonePhosphorus",(async()=>{await d(r.helmLonePhosphorus,u(c.Hi.FASTA),r.fastaRna)}))}));var F=n(3516);(0,t.L1)("fastaFileHandler",(()=>{const n=["description:1","description:2","description:3","description:4"],r=(e.Column.fromStrings("description",n),["MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW","MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL","MMELVLKTIIGPIVVGVVLRIVDKWLNKDK","MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN"]);function s(e){const s=new F.m(e),o=s.descriptionsArray,i=s.sequencesArray;(0,t.J6)([o,i],[n,r])}(0,t.t6)("testNormalFormatting",(async()=>{s(">description:1\nMDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL\n\n>description:3\nMMELVLKTIIGPIVVGVVLRIVDKWLNKDK\n\n>description:4\nMDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN\n")})),(0,t.t6)("testExtraSpaces",(async()=>{s(">description:1\n MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMI EVF LFGIVLGLI PITLAGLFVTAY LQYRRGDQLDL\n\n>description:3\nM MELVLKTI IGPI VVGVVLR IVDKWLNKDK\n\n>description:4\nMDR TDEVSNHTHDKP TLTWFEEIFEEYHSPFHN\n ")})),(0,t.t6)("testExtraNewlines",(async()=>{s(">description:1\n\nMDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMIEVF\nLFGIVLGLI\nPITLAGLFVTA\nYLQYRRGDQLDL\n\n>description:3\nM\nME\n\nLVLKTIIG\n\nPIVVGVVLRI\nVDKWLNKDK\n\n\n>description:4\n\nMDRT\n\nDEVSNHTHDKP\n\nTLTWFEEIFEE\n\n\n\nYHSPFHN\n")}))}));var V=n(3890);(0,t.L1)("fastaExport",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,l.Q)()})),function(e){e.single="single",e.multi="multi"}(r||(r={}));const s={[r.single]:{src:"MDYKETLLMPKTDFPMRGGLP",tgt:["MDYKETLLMP","KTDFPMRGGL","P"]},[r.multi]:{src:"M[MeI]YKETLL[MeF]PKTDFPMRGGL[MeA]",tgt:["M[MeI]YKETLL[MeF]P","KTDFPMRGGL","[MeA]"]}};let o;!function(e){e.test1="test1",e.test2="test2"}(o||(o={}));const i={[o.test1]:{srcCsv:"id,seq\n1,MDYKETLLMP\n2,KTDFPMRGGL\n3,P",idCols:["id"],seqCol:"seq",lineWidth:10,tgtFasta:">1\nMDYKETLLMP\n>2\nKTDFPMRGGL\n>3\nP\n"},[o.test2]:{srcCsv:"id,id2,seq\n1,seqA,M[MeI]YKETLL[MeF]P\n2,seqB,KTDFPMRGGL\n3,seqC,[MeA]\n",idCols:["id2","id"],seqCol:"seq",lineWidth:5,tgtFasta:">seqA|1\nM[MeI]YKE\nTLL[MeF]P\n>seqB|2\nKTDFP\nMRGGL\n>seqC|3\n[MeA]\n"}};function a(r,o=10){const i=s[r].src,a=e.Column.fromStrings("src",[i]);a.semType=e.SEMTYPE.MACROMOLECULE,a.meta.units=c.Hi.FASTA;const l=n.getSeqHandler(a).getSplitted(0),u=(0,V.aS)(l,o),d=s[r].tgt;(0,t.J6)(u,d)}async function u(r){const s=e.DataFrame.fromCsv(r.srcCsv),o=s.getCol(r.seqCol);o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA;const i=r.idCols.map((e=>s.getCol(e))),a=n.getSeqHandler(o),l=(0,V.wz)(i,a,r.lineWidth);(0,t.E3)(l,r.tgtFasta)}(0,t.t6)("wrapSequenceSingle",(async()=>{a(r.single,10)})),(0,t.t6)("wrapSequenceMulti",(async()=>{a(r.multi,10)})),(0,t.t6)("saveAsFastaTest1",(async()=>{u(i[o.test1])})),(0,t.t6)("saveAsFastaTest2",(async()=>{u(i[o.test2])}))}));var U=n(4152),Y=n(439);const B=Y._S;(0,t.L1)("bio",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r="seq\nACGTCT\nCAGTGT\nTTCAAC";(0,t.t6)("testGetStatsHelm1",(async()=>{const n=e.DataFrame.fromCsv("seq\nPEPTIDE1{meI}$$$$").getCol("seq");n.semType=e.SEMTYPE.MACROMOLECULE,n.meta.units=c.Hi.HELM;const r=(0,E.vZ)(n,1,c.qp);(0,t.Xk)(r.freq,{meI:1}),(0,t.E3)(r.sameLength,!0)})),(0,t.t6)("testGetStatsN1",(async()=>{await function(n){const r=e.DataFrame.fromCsv(n).col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const s=(0,E.vZ)(r,5,c.J9);(0,t.Xk)(s.freq,{A:4,C:5,G:3,T:6}),(0,t.E3)(s.sameLength,!0)}(r)})),(0,t.t6)("testGetAlphabetSimilarity",(async()=>{await async function(){const e={A:2041,C:3015,G:3015,T:2048,[B]:1e3},n=new Set(Object.keys(i.Q.Names)),r=(0,c.nq)(e,n);(0,t.E3)(r>.6,!0)}()})),(0,t.t6)("testPickupPaletteN1",(async()=>{await async function(r){const s=e.DataFrame.fromCsv(r).col("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA;const o=(0,c.SM)(s,n);(0,t.E3)(o instanceof i.A,!0)}(r)})),(0,t.t6)("testPickupPaletteN1e",(async()=>{await async function(){const r=e.DataFrame.fromCsv("seq\nACGTAT\nCAGTTG\nTTCG2C").col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const s=(0,c.SM)(r,n);(0,t.E3)(s instanceof i.A,!0)}()})),(0,t.t6)("testPickupPaletteAA1",(async()=>{await async function(){const r=e.DataFrame.fromCsv("seq\nFWPHEYV\nYNRQWYV\nMKPSEYV").col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const o=(0,c.SM)(r,n);(0,t.E3)(o instanceof s.X,!0)}()})),(0,t.t6)("testPickupPaletteX",(async()=>{await async function(){const r=e.DataFrame.fromCsv("seq\nXZJ{}2\n5Z4733\n3Z6></\n675687").col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const s=(0,c.SM)(r,n);(0,t.E3)(s instanceof U.$u,!0)}()}))})),(0,t.L1)("WebLogo.monomerToShort",(()=>{(0,t.t6)("longMonomerSingle",(async()=>{(0,t.E3)((0,c.zS)("S",5),"S")})),(0,t.t6)("longMonomerShort",(async()=>{(0,t.E3)((0,c.zS)("Short",5),"Short")})),(0,t.t6)("longMonomerLong56",(async()=>{(0,t.E3)((0,c.zS)("Long56",6),"Long56")})),(0,t.t6)("longMonomerComplexFirstPartShort",(async()=>{(0,t.E3)((0,c.zS)("Long-long",5),"Long…")})),(0,t.t6)("longMonomerComplexFirstPartLong56",(async()=>{(0,t.E3)((0,c.zS)("Long56-long",6),"Long5…")})),(0,t.t6)("monomerToShort",(async()=>{const e=[["AbC","AbC"],["AbCd","Ab…"],["ABc","ABc"],["ABcd","AB…"],["A_b","A_b"],["A_bc","A…"],["Ab_c","Ab…"],["A1_b","A1…"],["Abc_d","Ab…"],["Abcd_e","Ab…"],["A-b","A-b"],["A-bc","A…"],["Ab-c","Ab…"],["A1-b","A1…"],["Abc-d","Ab…"],["Abcd-e","Ab…"],["A","A"],["Ab","Ab"],["Abc","Abc"],["Ab…","Ab…"],["Abcd","Ab…"],["Abcde","Ab…"]],n=e.map((e=>e[0])),r=e.map((e=>e[1])),s=n.map((e=>(0,c.zS)(e,3)));(0,t.J6)(s,r)}))}));var W=n(8047);const j=Y._S;function K(e,n){(0,t.E3)(e.name,n.name),(0,t.J6)(e.getMonomers(),n.getMonomers());for(const r of e.getMonomers())(0,t.E3)(e.getFreq(r).rowCount,n.getFreq(r).rowCount)}(0,t.L1)("WebLogo.positions",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r="seq\nATC-G-TTGC--\nATC-G-TTGC--\n-TC-G-TTGC--\n-TC-GCTTGC--\n-TC-GCTTGC--";(0,t.t6)("allPositions",(async()=>{const n=e.DataFrame.fromCsv(r),s=a.shell.addTableView(n),o=n.getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,c.YI.DNA),o.setTag(c.gp.aligned,"SEQ.MSA");const i=await n.plot.fromType("WebLogo");await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{s.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500,"Layout calculate timeout");const l=i.positions,u=[new W.Ue(0,"1",{A:new W.Tc(2),[j]:new W.Tc(3)}),new W.Ue(1,"2",{T:new W.Tc(5)}),new W.Ue(2,"3",{C:new W.Tc(5)}),new W.Ue(3,"4",{[j]:new W.Tc(5)}),new W.Ue(4,"5",{G:new W.Tc(5)}),new W.Ue(5,"6",{[j]:new W.Tc(3),C:new W.Tc(2)}),new W.Ue(6,"7",{T:new W.Tc(5)}),new W.Ue(7,"8",{T:new W.Tc(5)}),new W.Ue(8,"9",{G:new W.Tc(5)}),new W.Ue(9,"10",{C:new W.Tc(5)}),new W.Ue(10,"11",{[j]:new W.Tc(5)}),new W.Ue(11,"12",{[j]:new W.Tc(5)})];(0,t.E3)(l.length,u.length);for(let e=0;e<l.length;e++){(0,t.E3)(l[e].name,u[e].name);for(const n of l[e].getMonomers())(0,t.E3)(l[e].getFreq(n).rowCount,u[e].getFreq(n).rowCount)}await i.awaitRendered()})),(0,t.t6)("positions with shrinkEmptyTail option true (filtered)",(async()=>{const n=e.DataFrame.fromCsv("seq\n-TC-G-TTGC--\n-TC-GCTTGC--\n-T--C-GT-\n-T--C-GT-\n-T--C-GT-\n-T--CCGT-"),r=a.shell.addTableView(n),s=n.getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,c.YI.DNA),s.setTag(c.gp.aligned,"SEQ"),n.filter.init((e=>e>2)),n.filter.fireChanged();const o=await n.plot.fromType("WebLogo",{shrinkEmptyTail:!0});await(0,t.PE)(o.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(o.root,e.DOCK_TYPE.DOWN)}),500);const i=o.positions,l=[new W.Ue(0,"1",{[j]:new W.Tc(3)}),new W.Ue(1,"2",{T:new W.Tc(3)}),new W.Ue(2,"3",{[j]:new W.Tc(3)}),new W.Ue(3,"4",{[j]:new W.Tc(3)}),new W.Ue(4,"5",{C:new W.Tc(3)}),new W.Ue(5,"6",{[j]:new W.Tc(2),C:new W.Tc(1)}),new W.Ue(6,"7",{G:new W.Tc(3)}),new W.Ue(7,"8",{T:new W.Tc(3)}),new W.Ue(8,"9",{[j]:new W.Tc(3)})];(0,t.E3)(i.length,l.length);for(let e=0;e<i.length;e++){(0,t.E3)(i[e].name,l[e].name);for(const n of i[e].getMonomers())(0,t.E3)(i[e].getFreq(n).rowCount,l[e].getFreq(n).rowCount)}await o.awaitRendered()})),(0,t.t6)("positions with skipEmptyPositions option",(async()=>{const n=e.DataFrame.fromCsv(r),s=a.shell.addTableView(n),o=n.getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,c.YI.DNA),o.setTag(c.gp.aligned,"SEQ.MSA");const i=await n.plot.fromType("WebLogo",{skipEmptyPositions:!0});await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{s.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500);const l=i.positions,u=[new W.Ue(0,"1",{A:new W.Tc(2),[j]:new W.Tc(3)}),new W.Ue(1,"2",{T:new W.Tc(5)}),new W.Ue(2,"3",{C:new W.Tc(5)}),new W.Ue(4,"5",{G:new W.Tc(5)}),new W.Ue(5,"6",{[j]:new W.Tc(3),C:new W.Tc(2)}),new W.Ue(6,"7",{T:new W.Tc(5)}),new W.Ue(7,"8",{T:new W.Tc(5)}),new W.Ue(8,"9",{G:new W.Tc(5)}),new W.Ue(9,"10",{C:new W.Tc(5)})];(0,t.E3)(l.length,u.length);for(let e=0;e<l.length;e++)K(l[e],u[e]);await i.awaitRendered()})),(0,t.t6)("count sequences for monomer at position",(async()=>{const s=function(t,n,r){const s=e.DataFrame.fromCsv(t),o=s.getCol("seq");return o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=n,o.setTag(c.gp.alphabet,r),o.setTag(c.gp.aligned,"SEQ.MSA"),s}(r,c.Hi.FASTA,c.YI.DNA),o=s.getCol("seq"),i=a.shell.addTableView(s),l=await s.plot.fromType("WebLogo",{startPositionName:"3",endPositionName:"7",skipEmptyPositions:!0});await(0,t.PE)(l.onLayoutCalculated,(()=>{}),(()=>{i.dockManager.dock(l.root,e.DOCK_TYPE.DOWN)}),500);const u=l.positions,d=[new W.Ue(2,"3",{C:new W.Tc(5)}),new W.Ue(4,"5",{G:new W.Tc(5)}),new W.Ue(5,"6",{[j]:new W.Tc(3),C:new W.Tc(2)}),new W.Ue(6,"7",{T:new W.Tc(5)})];(0,t.E3)(u.length,d.length);for(let e=0;e<u.length;e++)K(u[e],d[e]);const h=u[1],p=n.getSeqHandler(o),m=(0,W.eN)(s,p,s.filter,"G",h);(0,t.E3)(m,5),await l.awaitRendered()})),(0,t.t6)("empty",(async()=>{const n=e.DataFrame.fromColumns([(()=>{const t=e.Column.fromStrings("seq",[]);return t.semType=e.SEMTYPE.MACROMOLECULE,t.meta.units=c.Hi.FASTA,t.setTag(c.gp.alphabet,c.YI.DNA),t})()]),r=a.shell.addTableView(n),s=await n.plot.fromType("WebLogo");await(0,t.PE)(s.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(s.root,e.DOCK_TYPE.DOWN)}),500),s.positions,await s.awaitRendered()}))})),(0,t.L1)("WebLogo.project",(()=>{(0,t.t6)("fasta",(async()=>{const n="Tests.Bio.WebLogo-project.fasta",r=await Se.files.readCsv("tests/filter_FASTA.csv"),s=r.name,o=r.getCol("fasta");await a.data.detectSemanticTypes(r);const i=a.shell.addTableView(r),c=await r.plot.fromType("WebLogo",{sequenceColumnName:o.name});i.dockManager.dock(c),await c.awaitRendered(),await _(i.grid),await async function(t,n,r,s){const o=e.Project.create(),i=r.saveLayout();o.name=t,o.addChild(n),o.addChild(i),await a.dapi.layouts.save(r.saveLayout()),await a.dapi.tables.uploadDataFrame(s),await a.dapi.tables.save(n),await a.dapi.projects.save(o)}(n,r.getTableInfo(),i,r),a.shell.closeAll(),await(0,t.cb)(500),await a.dapi.projects.open(n);const l=a.shell.getTableView(s),u=A()(l.viewers).toArray();(0,t.E3)(u.length,2),(0,t.E3)(u.filter((e=>"Grid"===e.type)).length,1);const d=u.find((e=>"WebLogo"===e.type));(0,t.E3)(!!d,!0),await _(i.grid),await d.awaitRendered()}),{skipReason:"depends on 1.18"})})),(0,t.L1)("WebLogo.layout",(()=>{(0,t.t6)("fasta",(async()=>{const e=await Se.files.readCsv("tests/filter_FASTA.csv"),n=e.getCol("fasta");await a.data.detectSemanticTypes(e);const r=a.shell.addTableView(e),s=await e.plot.fromType("WebLogo",{sequenceColumnName:n.name});r.dockManager.dock(s),await(0,t.cb)(2*W.VN.render),await s.awaitRendered(),await _(r.grid);const o=r.saveLayout();o.toJson(),r.loadLayout(o),await(0,t.cb)(2*W.VN.render),await s.awaitRendered(),await _(r.grid);const i=A()(r.viewers).toArray();(0,t.E3)(i.length,2),(0,t.E3)(i.filter((e=>"Grid"===e.type)).length,1),(0,t.E3)(i.filter((e=>"WebLogo"===e.type)).length,1)}))}));var q=n(966);function z(e,t){let n=null;for(const r of e.viewers)r.type===t&&(n=r);return n}(0,t.L1)("checkInputColumn",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r="seq\nseq1,\nseq2,\nseq3,\nseq4";(0,t.t6)("testMsaPos",(async()=>{const s=e.DataFrame.fromCsv(r).getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,c.YI.DNA),s.setTag(c.gp.aligned,"SEQ");const[o,i]=(0,q.l)(s,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(o,!0)})),(0,t.t6)("testMsaNegHelm",(async()=>{const s=e.DataFrame.fromCsv(r).getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.HELM,s.setTag(c.gp.alphabetIsMultichar,"true");const[o,i]=(0,q.l)(s,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(o,!1)})),(0,t.t6)("testMsaNegUN",(async()=>{const s=e.DataFrame.fromCsv(r).getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,"UN"),s.setTag(c.gp.alphabetSize,"11"),s.setTag(c.gp.alphabetIsMultichar,"true"),s.setTag(c.gp.aligned,"SEQ");const[o,i]=(0,q.l)(s,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(o,!1)})),(0,t.t6)("testGetActionFunctionMeta",(async()=>{e.Func.find({package:"Bio",name:"multipleSequenceAlignmentDialog"})[0].inputs.find((e=>"sequence"==e.name))}))})),(0,t.L1)("similarity/diversity",(async()=>{(0,t.t6)("similaritySearchViewer",(async()=>{await async function(){const n=await Se.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(r);const s=a.shell.addTableView(r),o=s.dataFrame.getCol("MSA");(0,t.E3)(o.semType,e.SEMTYPE.MACROMOLECULE);const i=await s.dataFrame.plot.fromType("Sequence Similarity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),s.dockManager.dock(i,e.DOCK_TYPE.RIGHT,null,"Similarity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==z(s,"Sequence Similarity Search")),"Sequence Similarity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.moleculeColumn)throw new Error("The viewer has not molecule column (onTableAttached).");if(!i.beforeRender())throw new Error("The viewer is not able to render.");if(!i.computeRequested)throw new Error("The viewer has not compute requested even.");if(!c)throw new Error("The viewer has not compute completed.");const l=i;await(0,t.bk)((()=>0!==l.root.getElementsByClassName("d4-grid").length),"Sequence Similarity Search viewer grid has not been created",100);(0,t.E3)(l.fingerprint,"Morgan"),(0,t.E3)(l.distanceMetric,"Tanimoto"),(0,t.E3)(l.scores.get(0),e.FLOAT_NULL),(0,t.E3)(l.idxs.get(0),0),(0,t.E3)(l.molCol.get(0),"D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me"),(0,t.E3)(l.scores.get(1).toFixed(2),"0.73"),(0,t.E3)(l.idxs.get(1),4),(0,t.E3)(l.molCol.get(1),"Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe/dV/Chg/N/D-Orn/D-aThr//Phe_4Me"),s.dataFrame.currentRowIdx=1,await(0,t.bk)((()=>1===l.targetMoleculeIdx),"Target molecule has not been changed",5e3),await(0,t.bk)((()=>"meI/hHis/Aca/Cys_SEt/T/dK/Thr_PO3H2/Aca/Tyr_PO3H2/D-Chg/dV/Phe_ab-dehydro/N/D-Orn/D-aThr//Phe_4Me"===l.molCol.get(0)),"Incorrect first similar molecule",5e3)}()})),(0,t.t6)("diversitySearchViewer",(async()=>{await async function(){const n=await Se.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n),s=a.shell.addTableView(r);await a.data.detectSemanticTypes(r);const o=s.dataFrame.getCol("MSA");(0,t.E3)(o.semType,e.SEMTYPE.MACROMOLECULE);const i=await s.dataFrame.plot.fromType("Sequence Diversity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),s.dockManager.dock(i,e.DOCK_TYPE.DOWN,null,"Diversity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==z(s,"Sequence Diversity Search")),"Sequence Diversity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.moleculeColumn)throw new Error("The viewer has not molecule column (onTableAttached).");if(!i.beforeRender())throw new Error("The viewer is not able to render.");if(!i.computeRequested)throw new Error("The viewer has not compute requested even.");if(!c)throw new Error("The viewer has not compute completed.");const l=i;await(0,t.bk)((()=>0!==l.root.getElementsByClassName("d4-grid").length),"Sequence Diversity Search viewer grid has not been created",100),(0,t.E3)(l.fingerprint,"Morgan"),(0,t.E3)(l.distanceMetric,"Tanimoto"),(0,t.E3)(l.initialized,!0),(0,t.E3)(l.renderMolIds.length>0,!0)}()}))}));var Z=n(1687),X=n(4577);(0,t.L1)("bio-substructure-filters",(async()=>{let n,r,s;async function o(e,t){if(!t.columns.names().includes(e))throw new Error(`The column '${e}' not found. Available in data frame are ${JSON.stringify(t.columns.names())}`);const r=new Z._i(n,Se.logger);return r.attach(t),r.applyState({columnName:e}),r.column=t.col(e),r.columnName=e,r}(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)})),(0,t.t6)("fasta",(async()=>{const e=await S("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const r=new Z._i(n,Se.logger);r.attach(e),await r.awaitRendered();try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"FastaBioFilter");const n=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new X.n("MD")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,3),(0,t.E3)(r.dataFrame?.filter.toBinaryString(),"10010000100000")}finally{r.detach()}await r.awaitRendered()})),(0,t.t6)("separator",(async()=>{const e=await S("tests/filter_MSA.csv"),r=new Z._i(n,Se.logger);await a.data.detectSemanticTypes(e),r.attach(e),await r.awaitRendered();try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"SeparatorBioFilter");const n=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.AR("meI")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,7),(0,t.E3)(r.dataFrame.filter.get(2),!1),await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.AR("/meI")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,0),await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.AR("meI-hHis","-")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,7),(0,t.E3)(r.dataFrame.filter.get(2),!1)}finally{r.detach()}await r.awaitRendered()})),(0,t.t6)("helm-dialog",(async()=>{const e="Bio tests: substructureFilters/helm-dialog",r=await S("tests/filter_HELM.csv");await a.data.detectSemanticTypes(r);const s=a.shell.addTableView(r);Se.logger.debug(`${e}, filter attaching.`);const o=new Z._i(n,Se.logger);o.attach(r);const i=L.dialog("Test filters").add(o.root).show();await o.awaitRendered();try{const n=o.bioFilter;(0,t.E3)(null!==o.bioFilter,!0,"bioFilter is not created"),Se.logger.debug(`${e}, filter 1 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new X.n("PEPTIDE1{A.C}$$$$V2.0")}),2e4),Se.logger.debug(`${e}, filter 1 changed.`),(0,t.E3)(o.dataFrame.filter.trueCount,1),(0,t.E3)(o.dataFrame.filter.toBinaryString(),"0001"),Se.logger.debug(`${e}, filter 2 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new X.n("PEPTIDE1{C}$$$$V2.0")}),2e4),await _(s.grid),Se.logger.debug(`${e}, filter 2 changed.`),(0,t.E3)(o.dataFrame.filter.trueCount,2),(0,t.E3)(o.dataFrame.filter.toBinaryString(),"1001")}finally{i.close()}await o.awaitRendered(),await(0,t.cb)(3e3)})),(0,t.t6)("helm-view",(async()=>{const e=await S("tests/filter_HELM.csv");e.getCol("HELM string"),await a.data.detectSemanticTypes(e);const t=a.shell.addTableView(e);t.getFiltersGroup(),await _(t.grid)})),(0,t.t6)("sync-fasta",(async()=>{const e=await Se.files.readCsv("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const n=await o("fasta",e),r=await o("fasta",e);await Promise.all([n.awaitRendered(),r.awaitRendered()]);try{(0,t.E3)(!!n.bioFilter,!0),(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(n.bioFilter.type,"FastaBioFilter"),(0,t.E3)(r.bioFilter.type,"FastaBioFilter");const s=n.bioFilter,o=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{s.props=new X.n("MD")}),1e4,"await onRowsFiltered"),(0,t.E3)(e.filter.trueCount,3),await n.awaitRendered(),(0,t.E3)(o.props.substructure,"MD")}finally{n.detach(),r.detach()}await Promise.all([n.awaitRendered(),r.awaitRendered()])})),(0,t.t6)("sync-msa",(async()=>{const e=await Se.files.readCsv("tests/filter_MSA.csv");await a.data.detectSemanticTypes(e);const n="hHis-Aca",r=await o("MSA",e),s=await o("MSA",e);await Promise.all([r.awaitRendered(),s.awaitRendered()]);try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(!!s.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"SeparatorBioFilter"),(0,t.E3)(s.bioFilter.type,"SeparatorBioFilter");const o=r.bioFilter,i=s.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{o.props=new Z.AR(n,"-")}),1e4,"await onRowsFiltered"),(0,t.E3)(e.filter.trueCount,8),(0,t.E3)(i.props.substructure,n),(0,t.E3)(i.props.separator,"-")}finally{r.detach(),s.detach()}await Promise.all([r.awaitRendered(),s.awaitRendered()])})),(0,t.t6)("sync-helm",(async()=>{const e=await Se.files.readCsv("tests/filter_HELM.csv");await a.data.detectSemanticTypes(e);const n=a.shell.addTableView(e),r="PEPTIDE1{A.C}$$$$V2.0",s=await o("HELM string",e),i=await o("HELM string",e),c=L.dialog("Test filters").add(s.root).add(i.root).show();await Promise.all([s.awaitRendered(),i.awaitRendered()]);try{(0,t.E3)(!!s.bioFilter,!0),(0,t.E3)(!!i.bioFilter,!0),(0,t.E3)(s.bioFilter.type,"HelmBioFilter"),(0,t.E3)(i.bioFilter.type,"HelmBioFilter");const o=s.bioFilter,a=i.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{o.props=new X.n(r)}),6e4,"await onRowsFiltered"),await _(n.grid),Se.logger.debug("Bio tests: substructureFilters/sync-helm, before changed event"),await(0,t.cb)(2*s.debounceTime),Se.logger.debug("Bio tests: substructureFilters/sync-helm, after changed event"),(0,t.E3)(e.filter.trueCount,1),await s.awaitRendered(),(0,t.E3)(a.props.substructure,r)}finally{s.detach(),i.detach(),c.close()}await Promise.all([s.awaitRendered(),i.awaitRendered()]),await _(n.grid),await(0,t.cb)(3e3)})),(0,t.t6)("two-columns-fasta",(async()=>{const n=e.DataFrame.fromCsv("id,seq1,seq2,trueSeq1,trueSeq2\n0,CGGCTACGGC,ATTGCATTCG,0,1,\n1,CGGCTGCCGC,ATAGCATTCG,1,1,\n2,CGGCTGCGCC,AATGCATACG,1,0,\n3,CGGCTGCATT,TTTGCATTCG,1,1,\n4,CGGCTGCATT,AAAGCATACG,1,0,\n");await a.data.detectSemanticTypes(n);const r=a.shell.addTableView(n),s="seq1",o="CGGCTG",i=n.getCol("trueSeq1").toList(),c="seq2",l="GCATT",u=n.getCol("trueSeq2").toList(),d=[{type:"Bio:bioSubstructureFilter",columnName:s},{type:"Bio:bioSubstructureFilter",columnName:c}],h=await n.plot.fromType(e.VIEWER.FILTERS,{filters:d});r.dockManager.dock(h,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid);const p=h.filters[0],m=h.filters[1];(0,t.E3)(p.column.name,s),(0,t.E3)(m.column.name,c);const f=p.bioFilter,g=m.bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n(o)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n("")}),1e3,"testEvent onRowsFiltered on seq1"),(0,t.E3)(n.filter.trueCount,i.filter((e=>1===e)).length),(0,t.E3)(n.filter.toBinaryString(),i.map((e=>e.toString())).join("")),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n("")}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n(l)}),1e3,"testEvent onRowsFiltered on seq2"),(0,t.E3)(n.filter.trueCount,u.filter((e=>1===e)).length),(0,t.E3)(n.filter.toBinaryString(),u.map((e=>e.toString())).join("")),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n("")}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n("")}),1e3,"testEvent onRowsFiltered on neither"),(0,t.E3)(n.filter.trueCount,n.rowCount),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n(o)}),5e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n(l)}),5e3,"testEvent onRowsFiltered on both");const y=A().count(0).take(n.rowCount).map((e=>i[e]*u[e])).toArray();(0,t.E3)(n.filter.trueCount,y.filter((e=>1===e)).length),(0,t.E3)(n.filter.toBinaryString(),y.map((e=>e.toString())).join("")),await Promise.all([p.awaitRendered(),m.awaitRendered(),_(r.grid)])})),(0,t.t6)("reset-fasta",(async()=>{const n=await S("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(n);const r=a.shell.addTableView(n),s="MD",o=await n.plot.fromType(e.VIEWER.FILTERS,{filters:[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}]});r.dockManager.dock(o,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid);const i=o.filters[0].bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{i.props=new X.n(s)}),1e3,"testEvent onRowsFiltered"),(0,t.E3)(n.filter.trueCount,3),(0,t.E3)(i.props.substructure,s),(0,t.E3)(i.substructureInput.value,s),R()(o.root).find('i[name="icon-arrow-rotate-left"]')[0].click(),await(0,t.cb)(100),await _(r.grid),(0,t.E3)(i.props.substructure,""),(0,t.E3)(i.substructureInput.value,"")})),(0,t.t6)("reopen",(async()=>{const n=await Se.files.readCsv("tests/filter_FASTA.csv"),r=a.shell.addTableView(n),s=[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}],o=await n.plot.fromType(e.VIEWER.FILTERS,{filters:s});r.dockManager.dock(o,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid),o.close(),await _(r.grid);const i=await n.plot.fromType(e.VIEWER.FILTERS,{filters:s});r.dockManager.dock(i,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid)}))}));var Q=n(8152);class J{errorList=[];warningList=[];infoList=[];debugList=[];error(e,t,n){this.errorList.push({message:e,params:t,stackTrace:n})}warning(e,t){this.warningList.push({message:e,params:t})}info(e,t){this.infoList.push({message:e,params:t})}debug(e,t){this.debugList.push({message:e,params:t})}}var ee=n(9192);(0,t.L1)("PepSeA",(()=>{(0,t.gM)((async()=>{await(0,b.m8)()})),(0,t.t6)("Basic alignment",(async()=>{const n=e.DataFrame.fromCsv('HELM,MSA\n"PEPTIDE1{F.L.R.G.W.[MeF].Y.S.N.N.C}$$$$","F.L.R.G.W.MeF.Y..S.N.N.C"\n"PEPTIDE1{F.L.R.G.Y.[MeF].Y.W.N.C}$$$$","F.L.R.G.Y.MeF.Y.W...N.C"\n"PEPTIDE1{F.G.Y.[MeF].Y.W.S.D.N.C}$$$$","F...G.Y.MeF.Y.W.S.D.N.C"\n"PEPTIDE1{F.L.R.G.Y.[MeF].Y.W.S.N.D.C}$$$$","F.L.R.G.Y.MeF.Y.W.S.N.D.C"\n"PEPTIDE1{F.V.R.G.Y.[MeF].Y.W.S.N.C}$$$$","F.V.R.G.Y.MeF.Y.W.S..N.C"\n'),r=await(0,Q.GD)(n.getCol("HELM"),"msa(HELM)"),s=n.getCol("MSA");for(let e=0;e<r.length;++e)(0,t.E3)(r.get(e)==s.get(e),!0)}),{timeout:6e4,stressTest:!0}),(0,t.t6)("stderr",(async()=>{const n=new J,r=e.DataFrame.fromCsv('HELM,MSA\n"PEPTIDE1{F.L.Mis.G.W.[MeF].Y.S.N.N.C}$$$$","F.L.Mis.G.W.MeF.Y..S.N.N.C"\n"PEPTIDE1{F.L.Mis.G.Y.[MeF].Y.W.N.C}$$$$","F.L.Mis.G.Y.MeF.Y...W.N.C"\n"PEPTIDE1{F.G.Y.[MeF].Y.W.S.D.N.C}$$$$","F...G.Y.MeF.Y.W.S.D.N.C"\n'),s=await(0,Q.GD)(r.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n),o=r.getCol("MSA");(0,t.J6)(s.toList(),o.toList()),(0,t.E3)(n.warningList[0].message,"Mis not found in Monomer Map\nMeF not found in Monomer Map\n")}),{timeout:6e4,stressTest:!0}),(0,t.t6)("error",(async()=>{const n=new J;try{const t=e.DataFrame.fromCsv('HELM\n"PEPTIDE1{[NH2].*.A.Q.T.T.Y.K.N.Y.R.R.N.L.L.*.[COOH]}$$$$"\n"PEPTIDE1{[NH2].M.A.N.T.T.Y.K.N.Y.R.N.N.L.L.*.[COOH]}$$$$"\n"PEPTIDE1{[NH2].*.A.N.T.T.Y.K.C.Y.R.R.N.L.L.*.[COOH]}$$$$"\n"PEPTIDE1{[NH2].*.A.N.T.T.Y.K.F.Y.R.R.N.L.L.*.[COOH]}$$$$"\n');await(0,Q.GD)(t.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n)}catch(e){const[t,r]=(0,ee.AP)(e);n.error(t,void 0,r)}(0,t.E3)(n.errorList[0].message,"PepSeA error: The pair (*,M) couldn't be found in the substitution matrix")}))})),(0,t.L1)("viewers",(()=>{const n=e.Func.find({package:"Bio",tags:["viewer"]}).map((e=>e.friendlyName));for(const e of n)(0,t.t6)(e,(async()=>{const n=await S("samples/FASTA_DNA.csv");await(0,t.Bl)(e,n,{detectSemanticTypes:!0})}),{skipReason:{"Sequence Similarity Search":"GROK-13162","Sequence Diversity Search":"GROK-13162",WebLogo:"GROK-13162",VdRegions:"GROK-13162"}[e]})}));const te="seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",ne="seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT",re="seq\nabc-dfgg-abc1-cfr3-rty-wert-abc-dfgg-abc1-cfr3-rty-wert\nrut12-her2-rty-wert-abc-abc1-dfgg-rut12-her2-rty-wert-abc-abc1-dfgg\nrut12-rty-her2-abc-cfr3-wert-rut12-rut12-rty-her2-abc-cfr3-wert-rut12";var se;(0,t.L1)("SeqHandler",(()=>{let n;async function r(t){const r=e.DataFrame.fromCsv(t);await a.data.detectSemanticTypes(r);const s=n.getSeqHandler(r.getCol("seq"));return[r,s]}(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("Seq-Fasta",(async()=>{const[e,n]=await r(te);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!1)})),(0,t.t6)("Seq-Fasta-MSA",(async()=>{const[e,n]=await r(ne);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!0)})),(0,t.t6)("Seq-Fasta-units",(async()=>{const[e,n]=await r(te);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!1)})),(0,t.t6)("Seq-Fasta-MSA-units",(async()=>{const[e,n]=await r(ne);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!0)})),(0,t.t6)("Seq-Helm",(async()=>{const[e,n]=await r("seq\nPEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Tyr_ab-dehydroMe.dV.E.N.D-Orn.D-aThr.Phe_4Me}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.D-Chg.dV.Phe_ab-dehydro.N.D-Orn.D-aThr.Phe_4Me}$$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me}$$$$");(0,t.E3)(n.notation,c.Hi.HELM),(0,t.E3)(n.isHelm(),!0)})),(0,t.t6)("Seq-UN",(async()=>{const[e,n]=await r(re);(0,t.E3)(n.notation,c.Hi.SEPARATOR),(0,t.E3)(n.separator,"-"),(0,t.E3)(n.alphabet,c.YI.UN)})),(0,t.t6)("Seq-UN-auto",(async()=>{const[e,n]=await r(re);(0,t.E3)(n.notation,c.Hi.SEPARATOR),(0,t.E3)(n.separator,"-"),(0,t.E3)(n.alphabet,c.YI.UN)})),(0,t.t6)("column-version",(async()=>{const r=e.DataFrame.fromCsv(te);await a.data.detectSemanticTypes(r);const s=r.getCol("seq"),o=n.getSeqHandler(s),i=s.version,c=n.getSeqHandler(s),l=s.version;(0,t.E3)(i,l,"Unexpected column version changed"),(0,t.E3)(o,c,"Unexpected SeqHandler object changed"),r.rows.addNew(["TACCCCTTCAAC"]);const u=n.getSeqHandler(s),d=s.version;(0,t.E3)(l<d,!0,"Stalled column version on add row"),(0,t.E3)(c!==u,!0,"Stalled SeqHandler object on add row"),s.set(1,"CAGTGTCCCCGT");const h=n.getSeqHandler(s),p=s.version;(0,t.E3)(d<p,!0,"Stalled column version on change data"),(0,t.E3)(u!==h,!0,"Stalled SeqHandler object on change data"),s.setTag("testTag","testValue");const m=n.getSeqHandler(s),f=s.version;(0,t.E3)(p<f,!0,"Stalled column version on set tag"),(0,t.E3)(h!==m,!0,"Stalled SeqHandler object on set tag")}))})),function(e){e.fasta="fasta",e.fastaMsa="fastaMsa",e.separator="separator",e.separatorMsa="separatorMsa",e.helm="helm"}(se||(se={})),(0,t.L1)("SeqHandler: splitted",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()})),Y.b9[c.Hi.FASTA],Y.b9[c.Hi.HELM];const r=Y.b9[c.Hi.SEPARATOR],s={[se.fasta]:{src:{csv:"seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC"},tgt:{notation:c.Hi.FASTA,splitted:[["A","C","G","T","C","A","C","G","T","C"],["C","A","G","T","G","T","C","A","G","T","G","T"],["T","T","C","A","A","C","T","T","C","A","A","C"]]}},[se.fastaMsa]:{src:{csv:"seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT"},tgt:{notation:c.Hi.FASTA,splitted:[["A","C","-","G","T","-","C","T","A","C","-","G","T","-","C","T"],["C","A","C","-","T","-","G","T","C","A","C","-","T","-","G","T"],["A","C","C","G","T","A","C","T","A","C","C","G","T","A","C","T"]]}},[se.separator]:{src:{csv:"seq\nabc-dfgg-abc1-cfr3-rty-wert-abc-dfgg-abc1-cfr3-rty-wert\nrut12-her2-rty-wert-abc-abc1-dfgg-rut12-her2-rty-wert-abc\nrut12-rty-her2-abc-cfr3-wert-rut12-rut12-rty-her2-abc-cfr3"},tgt:{notation:c.Hi.SEPARATOR,separator:"-",splitted:[["abc","dfgg","abc1","cfr3","rty","wert","abc","dfgg","abc1","cfr3","rty","wert"],["rut12","her2","rty","wert","abc","abc1","dfgg","rut12","her2","rty","wert","abc"],["rut12","rty","her2","abc","cfr3","wert","rut12","rut12","rty","her2","abc","cfr3"]]}},[se.separatorMsa]:{src:{csv:'seq\nrut0-dfgg-abc1-cfr3-rty-wert-abc-dfgg-abc1-cfr3-rty-wert\nrut1-her2-rty--abc1-dfgg-rut12-her2-rty--abc1-dfgg\nrut2-rty-her2---wert-rut12-rty-her2---wert\n"rut3-rty-her2-""-""-""-""-wert-rut12-rty-her2-""-""-""-""-wert"\n"""-""-rut4-her2-wert-rut12-rty-her2-wert"\n"rut5-rty-her2-wert-rut12-rty-her2-wert-""-"""'},tgt:{notation:c.Hi.SEPARATOR,separator:"-",splitted:[["rut0","dfgg","abc1","cfr3","rty","wert","abc","dfgg","abc1","cfr3","rty","wert"],["rut1","her2","rty",r,"abc1","dfgg","rut12","her2","rty",r,"abc1","dfgg"],["rut2","rty","her2",r,r,"wert","rut12","rty","her2",r,r,"wert"],["rut3","rty","her2",r,r,"wert","rut12","rty","her2",r,r,"wert"],[r,"rut4","her2","wert","rut12","rty","her2","wert"],["rut5","rty","her2","wert","rut12","rty","her2","wert",r]]}},[se.helm]:{src:{csv:"seq\nPEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Thr_PO3H2.Aca.D-Tyr_Et}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.dK.Thr_PO3H2.Aca}$$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.dK.Thr_PO3H2.Aca}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.T.dK.Thr_PO3H2}$$$$"},tgt:{notation:c.Hi.HELM,splitted:[["meI","hHis","Aca","N","T","dE","Thr_PO3H2","Aca","D-Tyr_Et","Thr_PO3H2","Aca","D-Tyr_Et"],["meI","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","Aca","dK","Thr_PO3H2","Aca"],["Lys_Boc","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","Aca","dK","Thr_PO3H2","Aca"],["meI","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","T","dK","Thr_PO3H2"]]}}};for(const[r,o]of Object.entries(s))(0,t.t6)(`${r}`,(async()=>{const r=e.DataFrame.fromCsv(o.src.csv).getCol("seq"),s=await a.functions.call("Bio:detectMacromolecule",{col:r});s&&(r.semType=s),(0,t.E3)(r.semType,e.SEMTYPE.MACROMOLECULE);const i=n.getSeqHandler(r);(0,t.E3)(i.notation,o.tgt.notation),(0,t.E3)(i.separator===o.tgt.separator,!0);const c=A().count(0).take(i.length).map((e=>{const t=i.getSplitted(e);return A().count(0).take(t.length).map((e=>t.getOriginal(e))).toArray()})).toArray();(0,t.J6)(c,o.tgt.splitted)}))})),(0,t.L1)("SeqHandler: getRegion",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r={fastaDna:{srcCsv:"seq\nATTCGT\nACTGCTC\nATTCCGTA",startIdx:2,endIdx:4,tgtCsv:"seq\nTCG\nTGC\nTCC",units:c.Hi.FASTA,alphabet:c.YI.DNA,positionNames:{tag:"a, b, c, d, e, f, g, h",start:"c",end:"e"}},separatorPt:{srcCsv:"seq\nM-D-Y-K-E-T-L\nM-I-E-V-F-L-F-G-I\nM-M-",startIdx:5,endIdx:null,tgtCsv:"seq\nT-L--\nL-F-G-I\n---",units:c.Hi.SEPARATOR,alphabet:c.YI.PT,positionNames:{tag:"1, 1A, 1B, 2, 3, 4, 4A, 4A, 4C",start:"4",end:null}},helm:{srcCsv:"seq\nPEPTIDE1{[meI].[hHis].[Aca].N.T.[dE].[Thr_PO3H2].[Aca].[D-Tyr_Et].[Tyr_ab-dehydroMe].[dV].E.N.[D-Orn]}$$$$\nPEPTIDE1{[meI].[hHis].[Aca].[Cys_SEt].T.[dK].[Thr_PO3H2].[Aca].[Tyr_PO3H2].[D-Chg].[dV].[Phe_ab-dehydro]}$$$$\nPEPTIDE1{[Lys_Boc].[hHis].[Aca].[Cys_SEt].T}$$$$",startIdx:3,endIdx:6,tgtCsv:"seq\nPEPTIDE1{N.T.[dE].[Thr_PO3H2]}$$$$\nPEPTIDE1{[Cys_SEt].T.[dK].[Thr_PO3H2]}$$$$\nPEPTIDE1{[Cys_SEt].T.*.*}$$$$",units:c.Hi.HELM,alphabet:null,positionNames:{tag:null,start:"4",end:"7"}}};for(const[s,o]of Object.entries(r))(0,t.t6)(`${s}-idx`,(async()=>{const r=e.DataFrame.fromCsv(o.srcCsv).getCol("seq"),s=await a.functions.call("Bio:detectMacromolecule",{col:r});s&&(r.semType=s);const i=n.getSeqHandler(r).getRegion(o.startIdx,o.endIdx,"regSeq"),l=e.DataFrame.fromCsv(o.tgtCsv).getCol("seq");(0,t.E3)(r.meta.units,o.units),(0,t.E3)(i.meta.units,o.units),(0,t.E3)(r.getTag(c.gp.alphabet),o.alphabet),(0,t.E3)(i.getTag(c.gp.alphabet),o.alphabet),(0,t.J6)(i.toList(),l.toList())})),o.positionNames&&(0,t.t6)(`${s}-positionNames`,(async()=>{const n=e.DataFrame.fromCsv(o.srcCsv).getCol("seq");o.positionNames.tag&&n.setTag(c.gp.positionNames,o.positionNames.tag);const r=await a.functions.call("Bio:detectMacromolecule",{col:n});r&&(n.semType=r);const s=await a.functions.call("Bio:getRegion",{sequence:n,start:o.positionNames.start,end:o.positionNames.end}),i=e.DataFrame.fromCsv(o.tgtCsv).getCol("seq");(0,t.E3)(n.meta.units,o.units),(0,t.E3)(s.meta.units,o.units),(0,t.E3)(n.getTag(c.gp.alphabet),o.alphabet),(0,t.E3)(s.getTag(c.gp.alphabet),o.alphabet),(0,t.J6)(s.toList(),i.toList())}))})),(0,t.L1)("SeqHandler: getHelm",(()=>{let n,r,s;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)}));const o={fasta:{src:{seq:"MDYKETMDYKET",notation:c.Hi.FASTA},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T.M.D.Y.K.E.T}$$$$"}},separator:{src:{seq:"M-D-Y-K-E-T-M-D-Y-K-E-T",notation:c.Hi.SEPARATOR,separator:"-"},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T.M.D.Y.K.E.T}$$$$"}},helm:{src:{seq:"PEPTIDE1{M.D.Y.K.E.T}$$$$",notation:c.Hi.HELM},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T}$$$$"}},"helm-cyclic":{src:{seq:"PEPTIDE1{M.D.Y.K.E.T}$PEPTIDE1,PEPTIDE1,6:R2-1:R1$$$V2.0",notation:c.Hi.HELM},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T}$PEPTIDE1,PEPTIDE1,6:R2-1:R1$$$V2.0"}}};for(const[e,n]of Object.entries(o))(0,t.t6)(e,(async()=>{await i(n.src.seq,n.src.notation,n.src.separator,n.tgt.helm)}));async function i(r,s,o,i){const c=e.Column.fromStrings("seq",[r]),l=e.DataFrame.fromColumns([c]);await a.data.detectSemanticTypes(l);const u=n.getSeqHandler(c),d=(await u.getHelm(0)).value;(0,t.E3)(d,i)}}));var oe=n(6956);class ie{constructor(e){const t=e.split(oe.xe);t.forEach((e=>this.validateConnectionItem(e))),this.connectionItems=t}connectionItems;validateConnectionItem(e){const t="(PEPTIDE|RNA)",n=new RegExp(`${t}[0-9]+,${t}[0-9]+,[0-9]+:R[0-9]+-[0-9]+:R[0-9]+`,"g");if(!e.match(n))throw new Error(`Cannot parse connection item from ${e}`)}getConnectionData(){const e=[];return this.connectionItems.forEach((t=>{const n=[],r=t.split(",");r[2].split("-").forEach(((e,t)=>{const s=r[t],o=e.split(":"),i={monomerIdx:parseInt(o[0])-1,rGroupId:parseInt(o[1].slice(1))};n.push({polymerId:s,bond:i})})),e.push(n)})),e}}class ae{simplePolymer;constructor(e){this.simplePolymer=e,this.polymerType=this.getPolymerType(),this.idx=this.getIdx();const{monomers:t,monomerTypes:n}=this.getMonomerSymbolsAndTypes();this.monomers=t,this.monomerTypes=n}polymerType;monomers;idx;monomerTypes;get id(){return this.polymerType+this.idx.toString()}getPolymerType(){const e=new RegExp("(PEPTIDE|RNA)[0-9]+{"),t=this.simplePolymer.match(e);if(!t)throw new Error(`Unsupported polymer type in ${this.simplePolymer}`);return t[1]}getIdx(){const e=new RegExp(`${this.polymerType}([0-9]+){`),t=this.simplePolymer.match(e);if(!t)throw new Error(`Cannot parse simple polymer id from ${this.simplePolymer}`);return parseInt(t[1])}getMonomerSymbolsAndTypes(){const e=new RegExp(`${this.polymerType}${this.idx}{|}`,"g"),t=this.simplePolymer.replace(e,"").split("."),n=[],r=[];return t.forEach((e=>{n.push(e),r.push("Backbone")})),{monomers:n,monomerTypes:r}}getBondData(){const e=[],t=this.monomerTypes.map(((e,t)=>{if("Backbone"===e)return t})).filter((e=>void 0!==e)),n=this.monomerTypes.map(((e,t)=>{if("Branch"===e)return t})).filter((e=>void 0!==e));for(let n=0;n<t.length-1;n++){const r=t[n],s=t[n+1];e.push([{monomerIdx:r,rGroupId:2},{monomerIdx:s,rGroupId:1}])}for(let t=0;t<n.length;t++){const r=n[t],s=r-1;e.push([{monomerIdx:s,rGroupId:3},{monomerIdx:r,rGroupId:1}])}return e}}class ce{helmString;constructor(e){this.helmString=e;const t=this.helmString.split(oe.pk),n=t[0].split(oe.xe);this.simplePolymers=n.map((e=>new ae(e))),""!==t[1]&&(this.connectionList=new ie(t[1])),this.bondData=this.getBondData(),this.bondedRGroupsMap=this.getBondedRGroupsMap()}bondData;simplePolymers;connectionList;bondedRGroupsMap;getBondedRGroupsMap(){const e=new Map;return this.bondData.forEach((t=>{t.forEach((t=>{const n=t.monomerIdx,r=t.rGroupId;e.get(n)||e.set(n,[]),e.get(n).push(r)}))})),e}toString(){return this.helmString}getPolymerTypeByMonomerIdx(e){return this.getSimplePolymerByMonomerIdx(e).polymerType}getSimplePolymerByMonomerIdx(e){const t=this.getMonomerIdxShifts(),n=Object.values(t).sort(((e,t)=>e-t)).find((t=>e>=t));if(void 0===n)throw new Error(`Cannot find simple polymer for monomer ${e}`);const r=Object.keys(t).find((e=>t[e]===n));return this.simplePolymers.find((e=>e.id===r))}shiftBondMonomerIds(e,t){t.forEach((t=>{t.forEach((t=>{t.monomerIdx+=e}))}))}getMonomerIdxShifts(){const e={};let t=0;return this.simplePolymers.forEach((n=>{e[n.id]=t,t+=n.monomers.length})),e}getBondData(){const e=this.getMonomerIdxShifts(),t=[];return this.simplePolymers.forEach((n=>{const r=n.getBondData(),s=e[n.id];this.shiftBondMonomerIds(s,r),t.push(...r)})),this.connectionList&&this.connectionList.getConnectionData().forEach((n=>{const r=[];n.forEach((t=>{const n=e[t.polymerId],s=t.bond;s.monomerIdx+=n,r.push(s)})),t.push(r)})),t}}(0,t.L1)("helm",(()=>{const e={"single-linear":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T.[meI]}$$$$"},tgt:{simplePolymers:[6],bondedRGroups:[1,2,2,2,2,1]}},"single-cyclized-C-2-2":{src:{helm:"PEPTIDE1{R.F.C.Y.G.H.[GGaz].C.T.[meI]}$PEPTIDE1,PEPTIDE1,3:R3-8,R3$$$"},tgt:{simplePolymers:[10],bondedRGroups:[1,2,3,2,2,2,2,3,2,1]}},"single-cyclized-C-1-1":{src:{helm:"PEPTIDE1{F.C.Y.G.H.[GGaz].C.[meI]}$PEPTIDE1,PEPTIDE1,2:R3-7,R3$$$"},tgt:{simplePolymers:[8],bondedRGroups:[1,3,2,2,2,1,3,1]}},"single-cyclized-C-0-0":{src:{helm:"PEPTIDE1{C.Y.G.H.[GGaz].C}$PEPTIDE1,PEPTIDE1,2:R3-7,R3$$$"},tgt:{simplePolymers:[6],bondedRGroups:[2,2,2,2,2,2]}},"two-separated-1":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T}|PEPTIDE2{[meI]}$$$$"},tgt:{simplePolymers:[5,1],bondedRGroups:[1,2,2,2,1,1]}},"two-separated-2":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz]}|PEPTIDE2{T.[meI]}$$$$"},tgt:{simplePolymers:[4,2],bondedRGroups:[1,2,2,1,1,1]}},"two-connected-1":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T}|PEPTIDE2{[meI]}$PEPTIDE1,PEPTIDE2,5:R2-1,R1$$$"},tgt:{simplePolymers:[5,1],bondedRGroups:[1,2,2,2,2,1]}},"two-connected-2":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz]}|PEPTIDE2{T.[meI]}$PEPTIDE1,PEPTIDE2,4:R2-1,R1$$$"},tgt:{simplePolymers:[4,2],bondedRGroups:[1,2,2,2,2,1]}}};for(const[n,{src:r,tgt:s}]of Object.entries(e))(0,t.t6)(n,(async()=>{const e=new ce(r.helm),n=e.simplePolymers.map((e=>e.monomers.length)),o=n.reduce(((e,t)=>e+t),0);(0,t.E3)(n,s.simplePolymers);const i=A().count(0).take(e.bondedRGroupsMap.size).map((t=>e.bondedRGroupsMap.get(t).length)).toArray();(0,t.E3)(o,i.length)}),{skipReason:"new tests"})}));var le=n(6077),ue=n(6717);const de=new e.FileSource("System:AppData/Bio"),he={"peptides-fasta":{inPath:"tests/to-atomic-level-peptides-fasta-input.csv",outPath:"tests/to-atomic-level-peptides-fasta-output.csv"},"dna-fasta":{inPath:"tests/to-atomic-level-dna-fasta-input.csv",outPath:"tests/to-atomic-level-dna-fasta-output.csv"},"msa-separator":{inPath:"tests/to-atomic-level-msa-separator-input.csv",outPath:"tests/to-atomic-level-msa-separator-output.csv"},"msa-fasta":{inPath:"tests/to-atomic-level-msa-fasta-input.csv",outPath:"tests/to-atomic-level-msa-fasta-output.csv"}},pe="molfile(sequence)";function me(e){return e.replaceAll("\r\n","\n").replace(/\n$/,"").split("\n").map((e=>e.trimEnd())).join("\n")}(0,t.L1)("toAtomicLevel",(async()=>{const n={},r={};let s,o,i,u,d,h;async function p(e,n){const r=e.getCol("sequence");await a.functions.call("Bio:toAtomicLevel",{table:e,seqCol:r,nonlinear:!1});const s=e.getCol(pe),o=n.getCol(pe),i=A()(s.values()).map((e=>me(e))).toArray(),c=A()(o.values()).map((e=>me(e))).toArray();(0,t.J6)(i,c)}(0,t.gM)((async()=>{d=await(0,ue.j)(),i=await(0,l.Q)(),s=await(0,T.pj)(),o=await(0,N.ub)(),await s.loadMonomerLibForTests(),u=s.getMonomerLib();for(const[t,s]of Object.entries(he))s.inPath,n[t]=e.DataFrame.fromCsv((await de.readAsText(s.inPath)).replace(/\n$/,"")),await a.data.detectSemanticTypes(n[t]),r[t]=e.DataFrame.fromCsv((await de.readAsText(s.outPath)).replace(/\n$/,""))})),(0,t.Pl)((async()=>{await(0,N.Eu)(o),await s.loadMonomerLib(!0)}));for(const[e,s]of Object.entries(he))(0,t.t6)(`${e}`,(async()=>{await p(n[e],r[e])}));!function(e){e.fastaDna="fastaDna",e.fastaRna="fastaRna",e.fastaPt="fastaPt",e.fastaUn="fastaUn",e.separatorDna="separatorDna",e.separatorRna="separatorRna",e.separatorPt="separatorPt",e.separatorUn="separatorUn",e.helm="helm"}(h||(h={}));const m={[h.fastaDna]:"seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",[h.fastaRna]:"seq\nACGUCACGUC\nCAGUGUCAGUGU\nUUCAACUUCAAC",[h.fastaPt]:"seq\nFWPHEYFWPHEY\nYNRQWYVYNRQWYV\nMKPSEYVMKPSEYV",[h.fastaUn]:"seq\n[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D\n[meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2]\n[Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2]",[h.separatorDna]:"seq\nA/C/G/T/C/A/C/G/T/C\nC/A/G/T/G/T/C/A/G/T/G/T\nT/T/C/A/A/C/T/T/C/A/A/C",[h.separatorRna]:"seq\nA*C*G*U*C*A*C*G*U*C\nC*A*G*U*G*U*C*A*G*U*G*U\nU*U*C*A*A*C*U*U*C*A*A*C",[h.separatorPt]:"seq\nF-W-P-H-E-Y-F-W-P-H-E-Y\nY-N-R-Q-W-Y-V-Y-N-R-Q-W-Y-V\nM-K-P-S-E-Y-V-M-K-P-S-E-Y-V",[h.separatorUn]:"seq\nmeI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D-meI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D\nmeI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-meI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2\nLys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-Lys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2",[h.helm]:"seq\nPEPTIDE1{meI.D-gGlu.Aca.N.T.dE.Thr_PO3H2.Aca.D.Thr_PO3H2.Aca.D}$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.Thr_PO3H2.Aca.Tyr_PO3H2}$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.Thr_PO3H2.Aca.Tyr_PO3H2}$$$"};async function f(t){const n=m[t],r=e.DataFrame.fromCsv(n.replace(/\n$/,""));return await a.data.detectSemanticTypes(r),r}async function g(e,t="seq",n){const r=e.getCol(t),s=await(0,le.C4)(e,r,u,i,d);return s.warnings.length>0&&Se.logger.warning(`_toAtomicLevel() warnings ${s.warnings.join("\n")}`),s.molCol}(0,t.t6)("fastaDna",(async()=>{await g(await f(h.fastaDna),"seq")})),(0,t.t6)("fastaRna",(async()=>{await g(await f(h.fastaRna),"seq")})),(0,t.t6)("fastaPt",(async()=>{await g(await f(h.fastaPt),"seq")})),(0,t.t6)("fastaUn",(async()=>{await g(await f(h.fastaUn),"seq")})),(0,t.t6)("separatorDna",(async()=>{await g(await f(h.separatorDna),"seq")})),(0,t.t6)("separatorDna",(async()=>{await g(await f(h.separatorRna),"seq")})),(0,t.t6)("separatorPt",(async()=>{await g(await f(h.separatorPt),"seq")})),(0,t.t6)("separatorUn",(async()=>{await g(await f(h.separatorUn),"seq")})),(0,t.t6)("helm",(async()=>{await g(await f(h.helm),"seq")})),(0,t.t6)("ptFasta2",(async()=>{const n=await Se.files.readAsText("tests/to-atomic-level-pt-fasta-2.mol"),r=e.DataFrame.fromCsv("seq\nAR"),s=r.getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,c.YI.PT),i.getSeqHandler(s);const o=await g(r,"seq");(0,t.E3)(me(o.get(0)),me(n))}))}));var fe=n(8754);(0,t.L1)("toAtomicLevel-ui",(()=>{let n,r,s,o,i;(0,t.gM)((async()=>{s=await(0,l.Q)(),i=await(0,ue.j)(),n=await(0,T.pj)(),r=await(0,N.ub)(),await n.loadMonomerLibForTests(),o=n.getMonomerLib()})),(0,t.Pl)((async()=>{await(0,N.Eu)(r),await n.loadMonomerLib(!0)}));const u={fasta:{src:{seq:"MDYKETLLMPK",units:c.Hi.FASTA},tgt:{atomCount:94,bondCount:95}},"fasta-with-gap":{src:{seq:"MD-YKETLLMPK",units:c.Hi.FASTA},tgt:{atomCount:94,bondCount:95}},helm:{src:{seq:"PEPTIDE1{meI.hHis.Aca.N.T.dK.Thr_PO3H2}$$$$",units:c.Hi.HELM},tgt:{atomCount:68,bondCount:68}},"helm-with-gap":{src:{seq:"PEPTIDE1{meI.hHis.*.Aca.N.T.dK.Thr_PO3H2}$$$$",units:c.Hi.HELM},tgt:{atomCount:68,bondCount:68}}},d=async t=>{const n=t.src.seq,r=e.DataFrame.fromColumns([e.Column.fromList(e.COLUMN_TYPE.STRING,"seq",[n])]);return await a.data.detectSemanticTypes(r),r.getCol("seq")};for(const[e,n]of Object.entries(u))(0,t.t6)(`${e}-linear`,(async()=>{const e=await d(n);await h(e,!1,n.tgt)}));for(const[e,n]of Object.entries(u))(0,t.t6)(`${e}-nonlinear`,(async()=>{const e=await d(n);await h(e,!0,n.tgt)}));async function h(n,r,a){const c=await(0,fe.V)(n.dataFrame,n,r,!1,o,s,i);(0,t.E3)(c.molCol.semType,e.SEMTYPE.MOLECULE);const l=c.molCol.get(0),u=i.get_mol(l);(0,t.E3)(null!=u,!0,"No molecule generated");try{const e=u.get_num_atoms(),n=u.get_num_bonds();(0,t.E3)(e,a.atomCount),(0,t.E3)(n,a.bondCount)}finally{u.delete()}}}));var ge=n(6863);async function ye(t,n){const r=e.DataFrame.fromCsv(t),s=r.col("seq"),o=await a.functions.call("Bio:detectMacromolecule",{col:s});return o&&(s.semType=o),await a.data.detectSemanticTypes(r),n.getSeqHandler(s)}function be(e,n,r,s){const o=r(e,n);(0,t.E3)(Number(o.toFixed(3)),Number(s.toFixed(3)))}(0,t.L1)("Distance",(async()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s={F:0,W:1,R:2,Y:3},o="FWRWY",i="FWRWW",a="FWY",c="FWRWY",u="FWY",d="FWRRRRY";(0,t.t6)("protein-distance-function",(async()=>{const e=(await ye("seq\nFWRWYVKHPFWRWYVKHP\nYNRWYVKHPYNRWYVKHP\nMWRSWYCKHPMWRSWYCKHP",n)).getDistanceFunctionName();(0,t.E3)(e,ge.Z.LEVENSHTEIN)})),(0,t.t6)("DNA-distance-function",(async()=>{const e=(await ye("seq\nATAACGATAACG\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ge.Z.LEVENSHTEIN)})),(0,t.t6)("MSA-distance-function",(async()=>{const e=(await ye("seq\nATAACATAAC\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ge.Z.HAMMING)})),(0,t.t6)("levenstein-sub",(async()=>{const e=ge.V[ge.Z.LEVENSHTEIN]();be(o,i,e,.2)})),(0,t.t6)("levenstein-del",(async()=>{const e=ge.V[ge.Z.LEVENSHTEIN]();be(a,c,e,.4)})),(0,t.t6)("hamming",(async()=>{const e=ge.V[ge.Z.HAMMING]();be(a,c,e,.6)})),(0,t.t6)("needleman-blosum62",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});be(o,i,e,-6)})),(0,t.t6)("needleman-blosum62-del",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});be(a,c,e,-3.667)})),(0,t.t6)("needleman-custom-sub",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:1});be(o,i,e,.2)})),(0,t.t6)("needleman-custom-del",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:1});be(a,c,e,.667)})),(0,t.t6)("needleman-custom-zero-extend",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:0});be(u,d,e,.333)})),(0,t.t6)("needleman-custom-half-extend",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:2,gapExtend:1});be(u,d,e,1.667)})),(0,t.t6)("needleman-custom-same-extend",(async()=>{const t=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:1});e.Test.isInBenchmark?be(Array(1e3).fill(u).join(""),Array(1e3).fill(d).join(""),t,1.333):be(u,d,t,1.333)}),{benchmark:!0})}));var we=n(684);async function ve(e,n,r,s,o,i,c,l){await a.data.detectSemanticTypes(e);const u=await a.functions.call("Bio:activityCliffs",{table:e,molecules:e.getCol(r),activities:e.getCol(s),similarity:o,methodName:n,similarityMetric:c,preprocessingFunction:l,options:{[`${we.vb}`]:!0},demo:!1});(0,t.E3)(null!=u,!0);const d=Array.from(u.root.children).find((e=>{const t=e.className.split(" ");return["ui-btn","ui-btn-ok"].every((e=>t.includes(e)))}));(0,t.E3)(d.innerText.toLowerCase(),`${i} cliffs`)}var Ae=n(2780),Ee=n(9039),Te=n(9124);async function Ce(n,r,s){const o=n.getCol(s),i=await a.functions.call("Bio:detectMacromolecule",{col:o});i&&(o.semType=i);const c=e.Func.find({package:"Bio",name:"macromoleculePreprocessingFunction"})[0];if(!c)throw new Error("Preprocessing function not found");const l=await a.functions.call("Bio:sequenceSpaceTopMenu",{table:n,molecules:n.col(s),methodName:r,similarityMetric:ge.Z.LEVENSHTEIN,plotEmbeddings:!0,preprocessingFunction:c,options:{[we.vb]:!0}});(0,t.E3)(null!=l,!0)}(0,t.L1)("activityCliffs",(async()=>{let n,r,s;const o=e.Func.find({name:"macromoleculePreprocessingFunction",package:"Bio"})[0],i=e.Func.find({name:"helmPreprocessingFunction",package:"Bio"})[0];(0,t.gM)((async()=>{n=await(0,Te.b2)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)})),(0,t.t6)("activityCliffsOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_motif-with-random_10000.csv",tgt:{cliffCount:53}}:{fileName:"tests/100_3_clustests.csv",tgt:{cliffCount:3}},n=await S(t.fileName);a.shell.addTableView(n),await ve(n,Ee.c.UMAP,"sequence","Activity",90,t.tgt.cliffCount,ge.Z.LEVENSHTEIN,o)}),{benchmark:!0}),(0,t.t6)("activityCliffsWithEmptyRows",(async()=>{const e=await S("tests/100_3_clustests_empty_vals.csv");a.shell.addTableView(e),await ve(e,Ee.c.UMAP,"sequence","Activity",90,3,ge.Z.LEVENSHTEIN,o)})),(0,t.t6)("Helm",(async()=>{const e=await Se.files.readCsv("samples/HELM_50.csv");a.shell.addTableView(e),await ve(e,Ee.c.UMAP,"HELM","Activity",65,20,Ae.aT.Tanimoto,i)}))})),(0,t.L1)("sequenceSpace",(async()=>{let n,r,s,o;(0,t.t6)("sequenceSpaceOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_motif-with-random_10000.csv"}:{fileName:"tests/100_3_clustests.csv"};n=await S(t.fileName),r=a.shell.addTableView(n),await Ce(n,Ee.c.UMAP,"sequence")}),{benchmark:!0}),(0,t.t6)("sequenceSpaceWithEmptyRows",(async()=>{s=await S("tests/100_3_clustests_empty_vals.csv"),o=a.shell.addTableView(s),await Ce(s,Ee.c.UMAP,"sequence")}))})),(0,t.L1)("Scoring",(()=>{const n="sequence",r="expected_similarity",s="expected_identity",o=e.DataFrame.fromCsv(`${n},${r},${s}\nPEPTIDE1{Aca.Orn.gGlu.Pqa.D-His_1Bn.dH.hHis.4Abz.D-Tic.D-Dap.Y.Iva.meS.F.P.F.D-1Nal}$$$$,1.0,1.0\nPEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva.I.Tyr_26diMe.P.Asu.meC}$$$$,0.68,0.53\nPEPTIDE1{[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal]}$$$$V2.0,0.34,0.0`),i=o.getCol(n);i.meta.units=c.Hi.HELM,i.semType=e.SEMTYPE.MACROMOLECULE;const l=i.get(0);let u,d;(0,t.gM)((async()=>{u=await(0,T.pj)(),d=await(0,N.ub)(),await u.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(d),await u.loadMonomerLib(!0)})),(0,t.t6)("Identity",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:o,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const r=e.get(n),i=o.get(s,n);(0,t.Wj)(r,i,.01,`Wrong identity score for sequence at position ${n}`)}})),(0,t.t6)("Identity-shortReference",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:o,macromolecule:i,reference:"PEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva}$$$$"});(0,t.E3)(A().count(0).take(e.length).map((t=>e.get(t))).every((e=>null!=e&&!isNaN(e))),!0)})),(0,t.t6)("Identity-longReference",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:o,macromolecule:i,reference:"PEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva.I.Tyr_26diMe.P.Asu.meC.I.Tyr_26diMe.P.Asu.meC}$$$$"});(0,t.E3)(A().count(0).take(e.length).map((t=>e.get(t))).every((e=>null!=e&&!isNaN(e))),!0)})),(0,t.t6)("Similarity",(async()=>{const e=await a.functions.call("Bio:sequenceSimilarityScoring",{table:o,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const s=e.get(n),i=o.get(r,n);(0,t.Wj)(s,i,.01,`Wrong similarity score for sequence at position ${n}`)}}))}));const Se=new e.Package;async function _e(n,r,s,o){const i=await(0,t.N$)({category:n,test:r,testContext:s,stressTest:o});return e.DataFrame.fromObjects(i)}async function Pe(){await(0,t.Xb)(Se,Se.getModule("package-test.js"))}})(),bio_test=r})();
|
|
7
|
+
deps: ${n}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);a(e,t),c(e,n)}};function a(e,t=e.schema){const{gen:n,data:s,it:i}=e;if(0===Object.keys(t).length)return;const a=n.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,o.propertyInData)(n,s,c,i.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),i.allErrors?n.if(u,(()=>{for(const t of l)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,o.checkMissingProp)(e,l,a)})`),(0,o.reportMissingProp)(e,a),n.else())}}function c(e,t=e.schema){const{gen:n,data:r,keyword:i,it:a}=e,c=n.name("valid");for(const l in t)(0,s.alwaysValidSchema)(a,t[l])||(n.if((0,o.propertyInData)(n,r,l,a.opts.ownProperties),(()=>{const t=e.subschema({keyword:i,schemaProp:l},c);e.mergeValidEvaluated(t,c)}),(()=>n.var(c,!0))),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=i},4845:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3025),s={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,r.validateSchemaDeps)(e)};t.default=s},1239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,s.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=i(o,"then"),c=i(o,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else a?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,s){return()=>{const o=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(o,l),s?t.assign(s,r._`${n}`):e.setParams({ifClause:n})}}e.pass(l,(()=>e.error(!0)))}};function i(e,t){const n=e.schema[t];return void 0!==n&&!(0,s.alwaysValidSchema)(e,n)}t.default=o},6378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5457),s=n(5354),o=n(494),i=n(3966),a=n(2661),c=n(3025),l=n(9713),u=n(8660),d=n(117),h=n(5333),p=n(7923),m=n(6505),f=n(6163),g=n(5844),y=n(1239),b=n(4426);t.default=function(e=!1){const t=[p.default,m.default,f.default,g.default,y.default,b.default,l.default,u.default,c.default,d.default,h.default];return e?t.push(s.default,i.default):t.push(r.default,o.default),t.push(a.default),t}},494:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(9029),s=n(4227),o=n(5765),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return a(e,"additionalItems",t);n.items=!0,(0,s.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:o,parentSchema:i,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:o}=l,i=n.length,a=i===e.minItems&&(i===e.maxItems||!1===e[t]);if(r.strictTuples&&!a){const e=`"${c}" is ${i}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,s.checkStrictMode)(l,e,r.strictTuples)}}(i),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=s.mergeEvaluated.items(o,n.length,l.items));const u=o.name("valid"),d=o.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,s.alwaysValidSchema)(l,t)||(o.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:c,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=a,t.default=i},3966:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(5765),i=n(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:n,it:r}=e,{prefixItems:a}=n;r.items=!0,(0,s.alwaysValidSchema)(r,t)||(a?(0,i.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},7923:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:s}=e;if((0,r.alwaysValidSchema)(s,n))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=s},6163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>r._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:n,parentSchema:o,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&o.discriminator)return;const a=n,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block((function(){a.forEach(((n,o)=>{let a;(0,s.alwaysValidSchema)(i,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},u),o>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${o}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,o),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=o},5333:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o=n(4227),i=n(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,data:a,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,r.allSchemaProperties)(n),h=d.filter((e=>(0,o.alwaysValidSchema)(l,n[e])));if(0===d.length||h.length===d.length&&(!l.opts.unevaluated||!0===l.props))return;const p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=t.name("valid");!0===l.props||l.props instanceof s.Name||(l.props=(0,i.evaluatedPropsToName)(t,l.props));const{props:f}=l;function g(e){for(const t in p)new RegExp(e).test(t)&&(0,o.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(n){t.forIn("key",a,(o=>{t.if(s._`${(0,r.usePattern)(e,n)}.test(${o})`,(()=>{const r=h.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&!0!==f?t.assign(s._`${f}[${o}]`,!0):r||l.allErrors||t.if((0,s.not)(m),(()=>t.break()))}))}))}!function(){for(const e of d)p&&g(e),l.allErrors?y(e):(t.var(m,!0),y(e),t.if(m))}()}};t.default=a},5354:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(494),s={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=s},117:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2586),s=n(5765),o=n(4227),i=n(8660),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:n,parentSchema:a,data:c,it:l}=e;"all"===l.opts.removeAdditional&&void 0===a.additionalProperties&&i.default.code(new r.KeywordCxt(l,i.default,"additionalProperties"));const u=(0,s.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=o.mergeEvaluated.props(t,(0,o.toHash)(u),l.props));const d=u.filter((e=>!(0,o.alwaysValidSchema)(l,n[e])));if(0===d.length)return;const h=t.name("valid");for(const n of d)p(n)?m(n):(t.if((0,s.propertyInData)(t,c,n,l.opts.ownProperties)),m(n),l.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(h);function p(e){return l.opts.useDefaults&&!l.compositeRule&&void 0!==n[e].default}function m(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},9713:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>r._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:n,data:o,it:i}=e;if((0,s.alwaysValidSchema)(i,n))return;const a=t.name("valid");t.forIn("key",o,(n=>{e.setParams({propertyName:n}),e.subschema({keyword:"propertyNames",data:n,dataTypes:["string"],propertyName:n,compositeRule:!0},a),t.if((0,r.not)(a),(()=>{e.error(!0),i.allErrors||t.break()}))})),e.ok(a)}};t.default=o},4426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:n}){void 0===t.if&&(0,r.checkStrictMode)(n,`"${e}" without "if" is ignored`)}};t.default=s},5765:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const r=n(9029),s=n(4227),o=n(2023),i=n(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:r._`Object.prototype.hasOwnProperty`})}function c(e,t,n){return r._`${a(e)}.call(${t}, ${n})`}function l(e,t,n,s){const o=r._`${t}${(0,r.getProperty)(n)} === undefined`;return s?(0,r.or)(o,(0,r.not)(c(e,t,n))):o}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:s,it:o}=e;n.if(l(n,s,t,o.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},s,o){return(0,r.or)(...s.map((s=>(0,r.and)(l(e,t,s,n.ownProperties),r._`${o} = ${s}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,n,s){const o=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return s?r._`${o} && ${c(e,t,n)}`:o},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((n=>!(0,s.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:s,schemaPath:i,errorPath:a},it:c},l,u,d){const h=d?r._`${e}, ${t}, ${s}${i}`:t,p=[[o.default.instancePath,(0,r.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&p.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const m=r._`${h}, ${n.object(...p)}`;return u!==r.nil?r._`${l}.call(${u}, ${m})`:r._`${l}(${m})`};const d=r._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},n){const s=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(n,s);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:r._`${"new RegExp"===o.code?d:(0,i.useFunc)(e,o)}(${n}, ${s})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:o,it:i}=e,a=t.name("valid");if(i.allErrors){const e=t.let("valid",!0);return c((()=>t.assign(e,!1))),e}return t.var(a,!0),c((()=>t.break())),a;function c(i){const c=t.const("len",r._`${n}.length`);t.forRange("i",0,c,(n=>{e.subschema({keyword:o,dataProp:n,dataPropType:s.Type.Num},a),t.if((0,r.not)(a),i)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:o,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,s.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,s)=>{const i=e.subschema({keyword:o,schemaProp:s,compositeRule:!0},c);t.assign(a,r._`${a} || ${c}`),e.mergeValidEvaluated(i,c)||t.if((0,r.not)(a))})))),e.result(a,(()=>e.reset()),(()=>e.error(!0)))}},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=n},2128:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3463),s=n(3693),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,s.default];t.default=o},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(4551),s=n(5765),o=n(9029),i=n(2023),a=n(3835),c=n(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:s}=e,{baseId:i,schemaEnv:c,validateName:l,opts:h,self:p}=s,{root:m}=c;if(("#"===n||"#/"===n)&&i===m.baseId)return function(){if(c===m)return d(e,l,c,c.$async);const n=t.scopeValue("root",{ref:m});return d(e,o._`${n}.validate`,m,m.$async)}();const f=a.resolveRef.call(p,m,i,n);if(void 0===f)throw new r.default(s.opts.uriResolver,i,n);return f instanceof a.SchemaEnv?function(t){const n=u(e,t);d(e,n,t,t.$async)}(f):function(r){const s=t.scopeValue("schema",!0===h.code.source?{ref:r,code:(0,o.stringify)(r)}:{ref:r}),i=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:o.nil,topSchemaRef:s,errSchemaPath:n},i);e.mergeEvaluated(a),e.ok(i)}(f)}};function u(e,t){const{gen:n}=e;return t.validate?n.scopeValue("validate",{ref:t.validate}):o._`${n.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,n,r){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:d,opts:h}=l,p=h.passContext?i.default.this:o.nil;function m(e){const t=o._`${e}.errors`;a.assign(i.default.vErrors,o._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),a.assign(i.default.errors,o._`${i.default.vErrors}.length`)}function f(e){var t;if(!l.opts.unevaluated)return;const r=null===(t=null==n?void 0:n.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(r&&!r.dynamicProps)void 0!==r.props&&(l.props=c.mergeEvaluated.props(a,r.props,l.props));else{const t=a.var("props",o._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,o.Name)}if(!0!==l.items)if(r&&!r.dynamicItems)void 0!==r.items&&(l.items=c.mergeEvaluated.items(a,r.items,l.items));else{const t=a.var("items",o._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,o.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(o._`await ${(0,s.callValidateCode)(e,t,p)}`),f(t),u||a.assign(n,!0)}),(e=>{a.if(o._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),m(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,s.callValidateCode)(e,t,p),(()=>f(t)),(()=>m(t)))}t.getValidate=u,t.callRef=d,t.default=l},6653:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(7652),o=n(3835),i=n(4551),a=n(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===s.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:n}})=>r._`{error: ${e}, tag: ${n}, tagValue: ${t}}`},code(e){const{gen:t,data:n,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const h=c.propertyName;if("string"!=typeof h)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!d)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),m=t.const("tag",r._`${n}${(0,r.getProperty)(h)}`);function f(n){const s=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:n},s);return e.mergeEvaluated(o,r.Name),s}t.if(r._`typeof ${m} == "string"`,(()=>function(){const n=function(){var e;const t={},n=s(l);let r=!0;for(let t=0;t<d.length;t++){let l=d[t];if((null==l?void 0:l.$ref)&&!(0,a.schemaHasRulesButRef)(l,u.self.RULES)){const e=l.$ref;if(l=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),l instanceof o.SchemaEnv&&(l=l.schema),void 0===l)throw new i.default(u.opts.uriResolver,u.baseId,e)}const p=null===(e=null==l?void 0:l.properties)||void 0===e?void 0:e[h];if("object"!=typeof p)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);r=r&&(n||s(l)),c(p,t)}if(!r)throw new Error(`discriminator: "${h}" must be required`);return t;function s({required:e}){return Array.isArray(e)&&e.includes(h)}function c(e,t){if(e.const)p(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${h}" must have "const" or "enum"`);for(const n of e.enum)p(n,t)}}function p(e,n){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${h}" values must be unique strings`);t[e]=n}}();t.if(!1);for(const e in n)t.elseIf(r._`${m} === ${e}`),t.assign(p,f(n[e]));t.else(),e.error(!1,{discrError:s.DiscrError.Mapping,tag:m,tagName:h}),t.endIf()}()),(()=>e.error(!1,{discrError:s.DiscrError.Tag,tag:m,tagName:h}))),e.ok(p)}};t.default=c},7652:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(n||(t.DiscrError=n={}))},6105:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2128),s=n(7060),o=n(6378),i=n(5520),a=n(5413),c=n(3265),l=n(7532),u=n(9857),d=[i.default,r.default,s.default,(0,o.default)(!0),l.default,u.metadataVocabulary,u.contentVocabulary,a.default,c.default];t.default=d},6144:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2128),s=n(7060),o=n(6378),i=n(7532),a=n(9857),c=[r.default,s.default,(0,o.default)(),i.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},2476:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicAnchor=void 0;const r=n(9029),s=n(2023),o=n(3835),i=n(3693),a={keyword:"$dynamicAnchor",schemaType:"string",code:e=>c(e,e.schema)};function c(e,t){const{gen:n,it:a}=e;a.schemaEnv.root.dynamicAnchors[t]=!0;const c=r._`${s.default.dynamicAnchors}${(0,r.getProperty)(t)}`,l="#"===a.errSchemaPath?a.validateName:function(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:s,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new o.SchemaEnv({schema:n,schemaId:u,root:s,baseId:a,localRefs:c,meta:l});return o.compileSchema.call(r,d),(0,i.getValidate)(e,d)}(e);n.if(r._`!${c}`,(()=>n.assign(c,l)))}t.dynamicAnchor=c,t.default=a},3252:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dynamicRef=void 0;const r=n(9029),s=n(2023),o=n(3693),i={keyword:"$dynamicRef",schemaType:"string",code:e=>a(e,e.schema)};function a(e,t){const{gen:n,keyword:i,it:a}=e;if("#"!==t[0])throw new Error(`"${i}" only supports hash fragment reference`);const c=t.slice(1);if(a.allErrors)l();else{const t=n.let("valid",!1);l(t),e.ok(t)}function l(e){if(a.schemaEnv.root.dynamicAnchors[c]){const t=n.let("_v",r._`${s.default.dynamicAnchors}${(0,r.getProperty)(c)}`);n.if(t,u(t,e),u(a.validateName,e))}else u(a.validateName,e)()}function u(t,r){return r?()=>n.block((()=>{(0,o.callRef)(e,t),n.let(r,!0)})):()=>(0,o.callRef)(e,t)}}t.dynamicRef=a,t.default=i},5520:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2476),s=n(3252),o=n(2721),i=n(3799),a=[r.default,s.default,o.default,i.default];t.default=a},2721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2476),s=n(4227),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,r.dynamicAnchor)(e,""):(0,s.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};t.default=o},3799:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3252),s={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,r.dynamicRef)(e,e.schema)};t.default=s},4737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>r.str`must match format "${e}"`,params:({schemaCode:e})=>r._`{format: ${e}}`},code(e,t){const{gen:n,data:s,$data:o,schema:i,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:h}=c;l.validateFormats&&(o?function(){const o=n.scopeValue("formats",{ref:h.formats,code:l.code.formats}),i=n.const("fDef",r._`${o}[${a}]`),c=n.let("fType"),u=n.let("format");n.if(r._`typeof ${i} == "object" && !(${i} instanceof RegExp)`,(()=>n.assign(c,r._`${i}.type || "string"`).assign(u,r._`${i}.validate`)),(()=>n.assign(c,r._`"string"`).assign(u,i))),e.fail$data((0,r.or)(!1===l.strictSchema?r.nil:r._`${a} && !${u}`,function(){const e=d.$async?r._`(${i}.async ? await ${u}(${s}) : ${u}(${s}))`:r._`${u}(${s})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${s}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const o=h.formats[i];if(!o)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${i}" ignored in schema at path "${u}"`}h.logger.warn(e())}();if(!0===o)return;const[a,c,p]=function(e){const t=e instanceof RegExp?(0,r.regexpCode)(e):l.code.formats?r._`${l.code.formats}${(0,r.getProperty)(i)}`:void 0,s=n.scopeValue("formats",{key:i,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,s]:[e.type||"string",e.validate,r._`${s}.validate`]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${p}(${s})`}return"function"==typeof c?r._`${p}(${s})`:r._`${p}.test(${s})`}())}())}};t.default=s},7532:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=[n(4737).default];t.default=r},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},5413:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1846),s=n(4845),o=n(2626),i=[r.default,s.default,o.default];t.default=i},3265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(392),s=n(3445),o=[r.default,s.default];t.default=o},3445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{gen:t,schema:n,data:o,it:i}=e,a=i.items||0;if(!0===a)return;const c=t.const("len",r._`${o}.length`);if(!1===n)e.setParams({len:a}),e.fail(r._`${c} > ${a}`);else if("object"==typeof n&&!(0,s.alwaysValidSchema)(i,n)){const n=t.var("valid",r._`${c} <= ${a}`);t.if((0,r.not)(n),(()=>function(n,o){t.forRange("i",o,c,(o=>{e.subschema({keyword:"unevaluatedItems",dataProp:o,dataPropType:s.Type.Num},n),i.allErrors||t.if((0,r.not)(n),(()=>t.break()))}))}(n,a))),e.ok(n)}i.items=!0}};t.default=o},392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(2023),i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>r._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){const{gen:t,schema:n,data:i,errsCount:a,it:c}=e;if(!a)throw new Error("ajv implementation error");const{allErrors:l,props:u}=c;function d(o){if(!1===n)return e.setParams({unevaluatedProperty:o}),e.error(),void(l||t.break());if(!(0,s.alwaysValidSchema)(c,n)){const n=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:o,dataPropType:s.Type.Str},n),l||t.if((0,r.not)(n),(()=>t.break()))}}u instanceof r.Name?t.if(r._`${u} !== true`,(()=>t.forIn("key",i,(e=>t.if(function(e,t){return r._`!${e} || !${e}[${t}]`}(u,e),(()=>d(e))))))):!0!==u&&t.forIn("key",i,(e=>void 0===u?d(e):t.if(function(e,t){const n=[];for(const s in e)!0===e[s]&&n.push(r._`${t} !== ${s}`);return(0,r.and)(...n)}(u,e),(()=>d(e))))),c.props=!0,e.ok(r._`${a} === ${o.default.errors}`)}};t.default=i},7935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(6250),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>r._`{allowedValue: ${e}}`},code(e){const{gen:t,data:n,$data:i,schemaCode:a,schema:c}=e;i||c&&"object"==typeof c?e.fail$data(r._`!${(0,s.useFunc)(t,o.default)}(${n}, ${a})`):e.fail(r._`${c} !== ${n}`)}};t.default=i},1846:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3025),s={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:e=>(0,r.validatePropertyDeps)(e)};t.default=s},8643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(6250),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>r._`{allowedValues: ${e}}`},code(e){const{gen:t,data:n,$data:i,schema:a,schemaCode:c,it:l}=e;if(!i&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum;let d;const h=()=>null!=d?d:d=(0,s.useFunc)(t,o.default);let p;if(u||i)p=t.let("valid"),e.block$data(p,(function(){t.assign(p,!1),t.forOf("v",c,(e=>t.if(r._`${h()}(${n}, ${e})`,(()=>t.assign(p,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,r.or)(...a.map(((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?r._`${h()}(${n}, ${e}[${t}])`:r._`${n} === ${s}`}(e,s))))}e.pass(p)}};t.default=i},7060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5882),s=n(3439),o=n(7307),i=n(422),a=n(4486),c=n(4003),l=n(1163),u=n(617),d=n(7935),h=n(8643),p=[r.default,s.default,o.default,i.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,h.default];t.default=p},2626:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),s={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:n}){void 0===t.contains&&(0,r.checkStrictMode)(n,`"${e}" without "contains" is ignored`)}};t.default=s},1163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxItems"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} items`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,o="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${o} ${s}`)}};t.default=s},7307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=n(4227),o=n(3853),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxLength"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} characters`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:i,it:a}=e,c="maxLength"===t?r.operators.GT:r.operators.LT,l=!1===a.opts.unicode?r._`${n}.length`:r._`${(0,s.useFunc)(e.gen,o.default)}(${n})`;e.fail$data(r._`${l} ${c} ${i}`)}};t.default=i},5882:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s=r.operators,o={maximum:{okStr:"<=",ok:s.LTE,fail:s.GT},minimum:{okStr:">=",ok:s.GTE,fail:s.LT},exclusiveMaximum:{okStr:"<",ok:s.LT,fail:s.GTE},exclusiveMinimum:{okStr:">",ok:s.GT,fail:s.LTE}},i={message:({keyword:e,schemaCode:t})=>r.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:i,code(e){const{keyword:t,data:n,schemaCode:s}=e;e.fail$data(r._`${n} ${o[t].fail} ${s} || isNaN(${n})`)}};t.default=a},4486:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const n="maxProperties"===e?"more":"fewer";return r.str`must NOT have ${n} than ${t} properties`},params:({schemaCode:e})=>r._`{limit: ${e}}`},code(e){const{keyword:t,data:n,schemaCode:s}=e,o="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${o} ${s}`)}};t.default=s},3439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),s={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>r.str`must be multiple of ${e}`,params:({schemaCode:e})=>r._`{multipleOf: ${e}}`},code(e){const{gen:t,data:n,schemaCode:s,it:o}=e,i=o.opts.multipleOfPrecision,a=t.let("res"),c=i?r._`Math.abs(Math.round(${a}) - ${a}) > 1e-${i}`:r._`${a} !== parseInt(${a})`;e.fail$data(r._`(${s} === 0 || (${a} = ${n}/${s}, ${c}))`)}};t.default=s},422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>s.str`must match pattern "${e}"`,params:({schemaCode:e})=>s._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:o,schemaCode:i,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?s._`(new RegExp(${i}, ${c}))`:(0,r.usePattern)(e,o);e.fail$data(s._`!${l}.test(${t})`)}};t.default=o},4003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),s=n(9029),o=n(4227),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>s.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>s._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:n,schemaCode:i,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===n.length)return;const d=n.length>=u.loopRequired;if(l.allErrors?function(){if(d||c)e.block$data(s.nil,h);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,o){e.setParams({missingProperty:n}),t.forOf(n,i,(()=>{t.assign(o,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,s.not)(o),(()=>{e.error(),t.break()}))}),s.nil)}(o,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,o)),(0,r.reportMissingProp)(e,o),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:r}=e.it;for(const e of n)if(void 0===(null==t?void 0:t[e])&&!r.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(l,t,l.opts.strictRequired)}}function h(){t.forOf("prop",i,(n=>{e.setParams({missingProperty:n}),t.if((0,r.noPropertyInData)(t,a,n,u.ownProperties),(()=>e.error()))}))}}};t.default=i},617:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(208),s=n(9029),o=n(4227),i=n(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>s.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>s._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:n,$data:a,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!a&&!c)return;const h=t.let("valid"),p=l.items?(0,r.getSchemaTypes)(l.items):[];function m(o,i){const a=t.name("item"),c=(0,r.checkDataTypes)(p,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",s._`{}`);t.for(s._`;${o}--;`,(()=>{t.let(a,s._`${n}[${o}]`),t.if(c,s._`continue`),p.length>1&&t.if(s._`typeof ${a} == "string"`,s._`${a} += "_"`),t.if(s._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(i,s._`${l}[${a}]`),e.error(),t.assign(h,!1).break()})).code(s._`${l}[${a}] = ${o}`)}))}function f(r,a){const c=(0,o.useFunc)(t,i.default),l=t.name("outer");t.label(l).for(s._`;${r}--;`,(()=>t.for(s._`${a} = ${r}; ${a}--;`,(()=>t.if(s._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(l)}))))))}e.block$data(h,(function(){const r=t.let("i",s._`${n}.length`),o=t.let("j");e.setParams({i:r,j:o}),t.assign(h,!0),t.if(s._`${r} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?m:f)(r,o)))}),s._`${u} === false`),e.ok(h)}};t.default=a},5488:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,"\n.ui-form.ui-tooltip .ui-input-root > label.ui-input-label:not(:empty) {\n /* min-width: 30px; /* Breaks right margin /**/\n}\n\n.ui-form.ui-tooltip .ui-input-root > div.ui-input-text:not(:empty) {\n margin-top: 6px;\n}","",{version:3,sources:["webpack://./css/cell-renderer.css"],names:[],mappings:";AACA;IACI,8CAA8C;AAClD;;AAEA;IACI,eAAe;AACnB",sourcesContent:["\n.ui-form.ui-tooltip .ui-input-root > label.ui-input-label:not(:empty) {\n /* min-width: 30px; /* Breaks right margin /**/\n}\n\n.ui-form.ui-tooltip .ui-input-root > div.ui-input-text:not(:empty) {\n margin-top: 6px;\n}"],sourceRoot:""}]);const a=i},5999:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".macromolecule-cell-comp-analysis-host{\n max-height: 250px;\n overflow-y: scroll;\n}\n\n.macromolecule-cell-comp-analysis-bar{\n height: inherit;\n display: block;\n margin-top: 1.5px;\n margin-bottom: 1.5px;\n margin-right: 3px;\n}\n\n.macromolecule-cell-comp-analysis-value{\n display: flex;\n}","",{version:3,sources:["webpack://./css/composition-analysis.css"],names:[],mappings:"AAAA;IACI,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,eAAe;IACf,cAAc;IACd,iBAAiB;IACjB,oBAAoB;IACpB,iBAAiB;AACrB;;AAEA;IACI,aAAa;AACjB",sourcesContent:[".macromolecule-cell-comp-analysis-host{\n max-height: 250px;\n overflow-y: scroll;\n}\n\n.macromolecule-cell-comp-analysis-bar{\n height: inherit;\n display: block;\n margin-top: 1.5px;\n margin-bottom: 1.5px;\n margin-right: 3px;\n}\n\n.macromolecule-cell-comp-analysis-value{\n display: flex;\n}"],sourceRoot:""}]);const a=i},857:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".monomer-manager-root .grok-sketcher {\n min-width: unset !important;\n}\n\n.monomer-manager-root {\n width: 100% !important;\n height: 100% !important;\n}\n\n.monomer-manager-sketcher .ketcher-host {\n height: 100% !important;\n} \n\n.monomer-manager-root > div:first-child {\n flex-basis: 40% !important;\n}\n.monomer-manager-root > div:nth-child(2) {\n flex-basis: 60% !important;\n}\n\n.monomer-manager-root > div:first-child > .ui-form {\n max-width: unset !important;\n}\n\n.monomer-card-info-row {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-row > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-row > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n\n.duplicate-monomer-symbol-row {\n visibility: visible !important;\n}\n\n.monomer-card-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 300px;\n min-width: 200px;\n min-height: 300px;\n}\n\n.duplicate-monomers-virtual-view {\n width: 100% !important;\n overflow-x: clip;\n overflow-y: auto;\n}\n\n.monomer-manager-form-tab-control input.d4-invalid {\n background: #ff000030;\n}","",{version:3,sources:["webpack://./css/monomer-manager.css"],names:[],mappings:"AAAA;IACI,2BAA2B;AAC/B;;AAEA;IACI,sBAAsB;IACtB,uBAAuB;AAC3B;;AAEA;IACI,uBAAuB;AAC3B;;AAEA;IACI,0BAA0B;AAC9B;AACA;IACI,0BAA0B;AAC9B;;AAEA;IACI,2BAA2B;AAC/B;;AAEA;IACI,WAAW;IACX,gBAAgB;IAChB,uBAAuB;IACvB,mBAAmB;AACvB;;AAEA;IACI,mBAAmB;IACnB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;AACrB;;AAEA;IACI,8BAA8B;AAClC;;AAEA;IACI,+BAA+B;IAC/B,kBAAkB;IAClB,YAAY;IACZ,WAAW;IACX,gBAAgB;IAChB,mBAAmB;IACnB,eAAe;IACf,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,sBAAsB;IACtB,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA;IACI,qBAAqB;AACzB",sourcesContent:[".monomer-manager-root .grok-sketcher {\n min-width: unset !important;\n}\n\n.monomer-manager-root {\n width: 100% !important;\n height: 100% !important;\n}\n\n.monomer-manager-sketcher .ketcher-host {\n height: 100% !important;\n} \n\n.monomer-manager-root > div:first-child {\n flex-basis: 40% !important;\n}\n.monomer-manager-root > div:nth-child(2) {\n flex-basis: 60% !important;\n}\n\n.monomer-manager-root > div:first-child > .ui-form {\n max-width: unset !important;\n}\n\n.monomer-card-info-row {\n width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: 10px;\n}\n\n.monomer-card-info-row > div:nth-child(2) {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.monomer-card-info-row > div:nth-child(1) {\n font-weight: bold;\n margin-right: 5px;\n text-wrap: nowrap;\n}\n\n.duplicate-monomer-symbol-row {\n visibility: visible !important;\n}\n\n.monomer-card-root {\n border: 2px solid var(--grey-2);\n border-radius: 5px;\n padding: 5px;\n margin: 5px;\n overflow: hidden;\n align-items: center;\n cursor: pointer;\n width: 200px;\n height: 300px;\n min-width: 200px;\n min-height: 300px;\n}\n\n.duplicate-monomers-virtual-view {\n width: 100% !important;\n overflow-x: clip;\n overflow-y: auto;\n}\n\n.monomer-manager-form-tab-control input.d4-invalid {\n background: #ff000030;\n}"],sourceRoot:""}]);const a=i},6369:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".kalign-version {\n margin-bottom: 0;\n text-align: end;\n font-size: 12px;\n opacity: 0.8;\n}\nbutton.msa-params-button.ui-btn {\n justify-content: end;\n}","",{version:3,sources:["webpack://./css/msa.css"],names:[],mappings:"AAAA;IACI,gBAAgB;IAChB,eAAe;IACf,eAAe;IACf,YAAY;AAChB;AACA;IACI,oBAAoB;AACxB",sourcesContent:[".kalign-version {\n margin-bottom: 0;\n text-align: end;\n font-size: 12px;\n opacity: 0.8;\n}\nbutton.msa-params-button.ui-btn {\n justify-content: end;\n}"],sourceRoot:""}]);const a=i},7939:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".scatter_plot_link {\n position: absolute!important;\n right: 10px;\n}\n\n.cliffs_grid {\n top: 10px;\n}\n\n.show_only_cliffs {\n top: 30px;\n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings {\n font-size: 18px;\n position: absolute;\n height: 28px;\n \n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings:not(.ml-dim-reduction-column-editor-input-root i) {\n left: -20px;\n}\n.dlg-dimensionality-reduction.ui-form, .dlg-markov-clustering.ui-form, .dlg-markov-clustering.ui-form .ui-form, .dlg-dimensionality-reduction.ui-form .ui-form {\n max-width: unset;\n}\n\n.ml-dim-reduction-column-editor-input-root label {\n display: none !important;\n}\n\n.dim-reduction-dialog-form > .ui-input-root, .dim-reduction-dialog-form > div > .ui-input-root {\n margin-left: 10px;\n}\n\n.ml-dim-reduction-column-editor-input-root input, .ml-dim-reduction-column-editor-input-root select {\n margin-left: 20px !important;\n}\n\nh3.ml-dim-reduction-column-editor-input-root {\n margin: 0 !important;\n}\n\n.ml-dim-reduction-column-editor-root, .ml-dim-reduction-column-editor-header-root {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 10px !important;\n width: 700px !important;\n}\n\n.ml-dim-reduction-column-editor-column-title {\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ml-dim-reduction-column-editor-header-root > h1:not(:first-child) {\n margin-left: 20px !important;\n}\n\n.ml-dim-reduction-column-editor-table-root .header > td:not(:first-child) {\n padding-left: 32px;\n}","",{version:3,sources:["webpack://./node_modules/@datagrok-libraries/ml/css/styles.css"],names:[],mappings:"AAAA;IACI,4BAA4B;IAC5B,WAAW;AACf;;AAEA;IACI,SAAS;AACb;;AAEA;IACI,SAAS;AACb;;AAEA;IACI,eAAe;IACf,kBAAkB;IAClB,YAAY;;AAEhB;;AAEA;IACI,WAAW;AACf;AACA;IACI,gBAAgB;AACpB;;AAEA;IACI,wBAAwB;AAC5B;;AAEA;IACI,iBAAiB;AACrB;;AAEA;IACI,4BAA4B;AAChC;;AAEA;IACI,oBAAoB;AACxB;;AAEA;IACI,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,8BAA8B;IAC9B,uBAAuB;AAC3B;;AAEA;IACI,uBAAuB;IACvB,gBAAgB;AACpB;;AAEA;IACI,4BAA4B;AAChC;;AAEA;IACI,kBAAkB;AACtB",sourcesContent:[".scatter_plot_link {\n position: absolute!important;\n right: 10px;\n}\n\n.cliffs_grid {\n top: 10px;\n}\n\n.show_only_cliffs {\n top: 30px;\n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings {\n font-size: 18px;\n position: absolute;\n height: 28px;\n \n}\n\n.ml-dim-reduction-settings-input i.grok-icon.grok-font-icon-settings:not(.ml-dim-reduction-column-editor-input-root i) {\n left: -20px;\n}\n.dlg-dimensionality-reduction.ui-form, .dlg-markov-clustering.ui-form, .dlg-markov-clustering.ui-form .ui-form, .dlg-dimensionality-reduction.ui-form .ui-form {\n max-width: unset;\n}\n\n.ml-dim-reduction-column-editor-input-root label {\n display: none !important;\n}\n\n.dim-reduction-dialog-form > .ui-input-root, .dim-reduction-dialog-form > div > .ui-input-root {\n margin-left: 10px;\n}\n\n.ml-dim-reduction-column-editor-input-root input, .ml-dim-reduction-column-editor-input-root select {\n margin-left: 20px !important;\n}\n\nh3.ml-dim-reduction-column-editor-input-root {\n margin: 0 !important;\n}\n\n.ml-dim-reduction-column-editor-root, .ml-dim-reduction-column-editor-header-root {\n display: flex;\n flex-direction: row;\n align-items: center;\n margin-bottom: 10px !important;\n width: 700px !important;\n}\n\n.ml-dim-reduction-column-editor-column-title {\n text-overflow: ellipsis;\n overflow: hidden;\n}\n\n.ml-dim-reduction-column-editor-header-root > h1:not(:first-child) {\n margin-left: 20px !important;\n}\n\n.ml-dim-reduction-column-editor-table-root .header > td:not(:first-child) {\n padding-left: 32px;\n}"],sourceRoot:""}]);const a=i},3017:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),s=n.n(r),o=n(6314),i=n.n(o)()(s());i.push([e.id,".monomer-lib-controls-form {\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n}\n","",{version:3,sources:["webpack://./src/utils/monomer-lib/library-file-manager/style.css"],names:[],mappings:"AAAA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;EACb,sBAAsB;EACtB,mBAAmB;EACnB,WAAW;AACb",sourcesContent:[".monomer-lib-controls-form {\n margin-left: auto;\n margin-right: auto;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n}\n"],sourceRoot:""}]);const a=i},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,o){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(i[c]=!0)}for(var l=0;l<e.length;l++){var u=[].concat(e[l]);r&&i[u[0]]||(void 0!==o&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=o),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),s&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=s):u[4]="".concat(s)),t.push(u))}},t}},1354:e=>{"use strict";e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),o="/*# ".concat(s," */");return[t].concat([o]).join("\n")}return[t].join("\n")}},2017:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,s,o;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(s=r;0!=s--;)if(!e(t[s],n[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(s=r;0!=s--;)if(!Object.prototype.hasOwnProperty.call(n,o[s]))return!1;for(s=r;0!=s--;){var i=o[s];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}},9982:function(e,t,n){var r;!function(){var t={};!function(e){"use strict";e.__esModule=!0,e.digestLength=32,e.blockSize=64;var t=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(e,n,r,s,o){for(var i,a,c,l,u,d,h,p,m,f,g,y,b;o>=64;){for(i=n[0],a=n[1],c=n[2],l=n[3],u=n[4],d=n[5],h=n[6],p=n[7],f=0;f<16;f++)g=s+4*f,e[f]=(255&r[g])<<24|(255&r[g+1])<<16|(255&r[g+2])<<8|255&r[g+3];for(f=16;f<64;f++)y=((m=e[f-2])>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,b=((m=e[f-15])>>>7|m<<25)^(m>>>18|m<<14)^m>>>3,e[f]=(y+e[f-7]|0)+(b+e[f-16]|0);for(f=0;f<64;f++)y=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&d^~u&h)|0)+(p+(t[f]+e[f]|0)|0)|0,b=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&a^i&c^a&c)|0,p=h,h=d,d=u,u=l+y|0,l=c,c=a,a=i,i=y+b|0;n[0]+=i,n[1]+=a,n[2]+=c,n[3]+=l,n[4]+=u,n[5]+=d,n[6]+=h,n[7]+=p,s+=64,o-=64}return s}var r=function(){function t(){this.digestLength=e.digestLength,this.blockSize=e.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 t.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},t.prototype.clean=function(){for(var e=0;e<this.buffer.length;e++)this.buffer[e]=0;for(e=0;e<this.temp.length;e++)this.temp[e]=0;this.reset()},t.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this.bytesHashed+=t,this.bufferLength>0){for(;this.bufferLength<64&&t>0;)this.buffer[this.bufferLength++]=e[r++],t--;64===this.bufferLength&&(n(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(t>=64&&(r=n(this.temp,this.state,e,r,t),t%=64);t>0;)this.buffer[this.bufferLength++]=e[r++],t--;return this},t.prototype.finish=function(e){if(!this.finished){var t=this.bytesHashed,r=this.bufferLength,s=t/536870912|0,o=t<<3,i=t%64<56?64:128;this.buffer[r]=128;for(var a=r+1;a<i-8;a++)this.buffer[a]=0;this.buffer[i-8]=s>>>24&255,this.buffer[i-7]=s>>>16&255,this.buffer[i-6]=s>>>8&255,this.buffer[i-5]=s>>>0&255,this.buffer[i-4]=o>>>24&255,this.buffer[i-3]=o>>>16&255,this.buffer[i-2]=o>>>8&255,this.buffer[i-1]=o>>>0&255,n(this.temp,this.state,this.buffer,0,i),this.finished=!0}for(a=0;a<8;a++)e[4*a+0]=this.state[a]>>>24&255,e[4*a+1]=this.state[a]>>>16&255,e[4*a+2]=this.state[a]>>>8&255,e[4*a+3]=this.state[a]>>>0&255;return this},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype._saveState=function(e){for(var t=0;t<this.state.length;t++)e[t]=this.state[t]},t.prototype._restoreState=function(e,t){for(var n=0;n<this.state.length;n++)this.state[n]=e[n];this.bytesHashed=t,this.finished=!1,this.bufferLength=0},t}();e.Hash=r;var s=function(){function e(e){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var t=new Uint8Array(this.blockSize);if(e.length>this.blockSize)(new r).update(e).finish(t).clean();else for(var n=0;n<e.length;n++)t[n]=e[n];for(n=0;n<t.length;n++)t[n]^=54;for(this.inner.update(t),n=0;n<t.length;n++)t[n]^=106;for(this.outer.update(t),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate),n=0;n<t.length;n++)t[n]=0}return e.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},e.prototype.clean=function(){for(var e=0;e<this.istate.length;e++)this.ostate[e]=this.istate[e]=0;this.inner.clean(),this.outer.clean()},e.prototype.update=function(e){return this.inner.update(e),this},e.prototype.finish=function(e){return this.outer.finished?this.outer.finish(e):(this.inner.finish(e),this.outer.update(e,this.digestLength).finish(e)),this},e.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},e}();function o(e){var t=(new r).update(e),n=t.digest();return t.clean(),n}function i(e,t){var n=new s(e).update(t),r=n.digest();return n.clean(),r}function a(e,t,n,r){var s=r[0];if(0===s)throw new Error("hkdf: cannot expand more");t.reset(),s>1&&t.update(e),n&&t.update(n),t.update(r),t.finish(e),r[0]++}e.HMAC=s,e.hash=o,e.default=o,e.hmac=i;var c=new Uint8Array(e.digestLength);e.hkdf=function(e,t,n,r){void 0===t&&(t=c),void 0===r&&(r=32);for(var o=new Uint8Array([1]),l=i(t,e),u=new s(l),d=new Uint8Array(u.digestLength),h=d.length,p=new Uint8Array(r),m=0;m<r;m++)h===d.length&&(a(d,u,n,o),h=0),p[m]=d[h++];return u.clean(),d.fill(0),o.fill(0),p},e.pbkdf2=function(e,t,n,r){for(var o=new s(e),i=o.digestLength,a=new Uint8Array(4),c=new Uint8Array(i),l=new Uint8Array(i),u=new Uint8Array(r),d=0;d*i<r;d++){var h=d+1;a[0]=h>>>24&255,a[1]=h>>>16&255,a[2]=h>>>8&255,a[3]=h>>>0&255,o.reset(),o.update(t),o.update(a),o.finish(l);for(var p=0;p<i;p++)c[p]=l[p];for(p=2;p<=n;p++){o.reset(),o.update(l).finish(l);for(var m=0;m<i;m++)c[m]^=l[m]}for(p=0;p<i&&d*i+p<r;p++)u[d*i+p]=c[p]}for(d=0;d<i;d++)c[d]=l[d]=0;for(d=0;d<4;d++)a[d]=0;return o.clean(),u}}(t);var s=t.default;for(var o in t)s[o]=t[o];"object"==typeof e.exports?e.exports=s:void 0===(r=function(){return s}.call(t,n,t,e))||(e.exports=r)}()},2787:(e,t,n)=>{"use strict";n.d(t,{I:()=>s});const r=new Uint32Array(65536),s=(e,t)=>{if(e.length<t.length){const n=t;t=e,e=n}return 0===t.length?e.length:e.length<=32?((e,t)=>{const n=e.length,s=t.length,o=1<<n-1;let i=-1,a=0,c=n,l=n;for(;l--;)r[e.charCodeAt(l)]|=1<<l;for(l=0;l<s;l++){let e=r[t.charCodeAt(l)];const n=e|a;e|=(e&i)+i^i,a|=~(e|i),i&=e,a&o&&c++,i&o&&c--,a=a<<1|1,i=i<<1|~(n|a),a&=n}for(l=n;l--;)r[e.charCodeAt(l)]=0;return c})(e,t):((e,t)=>{const n=t.length,s=e.length,o=[],i=[],a=Math.ceil(n/32),c=Math.ceil(s/32);for(let e=0;e<a;e++)i[e]=-1,o[e]=0;let l=0;for(;l<c-1;l++){let a=0,c=-1;const u=32*l,d=Math.min(32,s)+u;for(let t=u;t<d;t++)r[e.charCodeAt(t)]|=1<<t;for(let e=0;e<n;e++){const n=r[t.charCodeAt(e)],s=i[e/32|0]>>>e&1,l=o[e/32|0]>>>e&1,u=n|a,d=((n|l)&c)+c^c|n|l;let h=a|~(d|c),p=c&d;h>>>31^s&&(i[e/32|0]^=1<<e),p>>>31^l&&(o[e/32|0]^=1<<e),h=h<<1|s,p=p<<1|l,c=p|~(u|h),a=h&u}for(let t=u;t<d;t++)r[e.charCodeAt(t)]=0}let u=0,d=-1;const h=32*l,p=Math.min(32,s-h)+h;for(let t=h;t<p;t++)r[e.charCodeAt(t)]|=1<<t;let m=s;for(let e=0;e<n;e++){const n=r[t.charCodeAt(e)],a=i[e/32|0]>>>e&1,c=o[e/32|0]>>>e&1,l=n|u,h=((n|c)&d)+d^d|n|c;let p=u|~(h|d),f=d&h;m+=p>>>s-1&1,m-=f>>>s-1&1,p>>>31^a&&(i[e/32|0]^=1<<e),f>>>31^c&&(o[e/32|0]^=1<<e),p=p<<1|a,f=f<<1|c,d=f|~(l|p),u=p&l}for(let t=h;t<p;t++)r[e.charCodeAt(t)]=0;return m})(e,t)}},9937:e=>{e.exports={linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:1,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5}},1782:(e,t)=>{t.assign=function(e){e=e||{};var t,n,r,s=Array.prototype.slice.call(arguments).slice(1);for(t=0,r=s.length;t<r;t++)if(s[t])for(n in s[t])e[n]=s[t][n];return e},t.validateSettings=function(e){return"linLogMode"in e&&"boolean"!=typeof e.linLogMode?{message:"the `linLogMode` setting should be a boolean."}:"outboundAttractionDistribution"in e&&"boolean"!=typeof e.outboundAttractionDistribution?{message:"the `outboundAttractionDistribution` setting should be a boolean."}:"adjustSizes"in e&&"boolean"!=typeof e.adjustSizes?{message:"the `adjustSizes` setting should be a boolean."}:"edgeWeightInfluence"in e&&"number"!=typeof e.edgeWeightInfluence?{message:"the `edgeWeightInfluence` setting should be a number."}:!("scalingRatio"in e)||"number"==typeof e.scalingRatio&&e.scalingRatio>=0?"strongGravityMode"in e&&"boolean"!=typeof e.strongGravityMode?{message:"the `strongGravityMode` setting should be a boolean."}:!("gravity"in e)||"number"==typeof e.gravity&&e.gravity>=0?"slowDown"in e&&!("number"==typeof e.slowDown||e.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in e&&"boolean"!=typeof e.barnesHutOptimize?{message:"the `barnesHutOptimize` setting should be a boolean."}:!("barnesHutTheta"in e)||"number"==typeof e.barnesHutTheta&&e.barnesHutTheta>=0?null:{message:"the `barnesHutTheta` setting should be a number >= 0."}:{message:"the `gravity` setting should be a number >= 0."}:{message:"the `scalingRatio` setting should be a number >= 0."}},t.graphToByteArrays=function(e,t){var n,r=e.order,s=e.size,o={},i=new Float32Array(10*r),a=new Float32Array(3*s);return n=0,e.forEachNode((function(e,t){o[e]=n,i[n]=t.x,i[n+1]=t.y,i[n+2]=0,i[n+3]=0,i[n+4]=0,i[n+5]=0,i[n+6]=1,i[n+7]=1,i[n+8]=t.size||1,i[n+9]=t.fixed?1:0,n+=10})),n=0,e.forEachEdge((function(e,r,s,c,l,u,d){var h=o[s],p=o[c],m=t(e,r,s,c,l,u,d);i[h+6]+=m,i[p+6]+=m,a[n]=h,a[n+1]=p,a[n+2]=m,n+=3})),{nodes:i,edges:a}},t.assignLayoutChanges=function(e,t,n){var r=0;e.updateEachNodeAttributes((function(e,s){return s.x=t[r],s.y=t[r+1],r+=10,n?n(e,s):s}))},t.readGraphPositions=function(e,t){var n=0;e.forEachNode((function(e,r){t[n]=r.x,t[n+1]=r.y,n+=10}))},t.collectLayoutChanges=function(e,t,n){for(var r=e.nodes(),s={},o=0,i=0,a=t.length;o<a;o+=10){if(n){var c=Object.assign({},e.getNodeAttributes(r[i]));c.x=t[o],c.y=t[o+1],c=n(r[i],c),s[r[i]]={x:c.x,y:c.y}}else s[r[i]]={x:t[o],y:t[o+1]};i++}return s},t.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),s=new Worker(r);return t.revokeObjectURL(r),s}},8903:(e,t,n)=>{var r=n(1736),s=n(8153).Fd,o=n(2561),i=n(1782),a=n(9937);function c(e,t,n){if(!r(t))throw new Error("graphology-layout-forceatlas2: the given graph is not a valid graphology instance.");"number"==typeof n&&(n={iterations:n});var c=n.iterations;if("number"!=typeof c)throw new Error("graphology-layout-forceatlas2: invalid number of iterations.");if(c<=0)throw new Error("graphology-layout-forceatlas2: you should provide a positive number of iterations.");var l=s("getEdgeWeight"in n?n.getEdgeWeight:"weight").fromEntry,u="function"==typeof n.outputReducer?n.outputReducer:null,d=i.assign({},a,n.settings),h=i.validateSettings(d);if(h)throw new Error("graphology-layout-forceatlas2: "+h.message);var p,m=i.graphToByteArrays(t,l);for(p=0;p<c;p++)o(d,m.nodes,m.edges);if(!e)return i.collectLayoutChanges(t,m.nodes);i.assignLayoutChanges(t,m.nodes,u)}var l=c.bind(null,!1);l.assign=c.bind(null,!0),l.inferSettings=function(e){var t="number"==typeof e?e:e.order;return{barnesHutOptimize:t>2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(t)}},e.exports=l},2561:e=>{var t=10;e.exports=function(e,n,r){var s,o,i,a,c,l,u,d,h,p,m,f,g,y,b,w,v,A,E,T,C,S,_,P=n.length,N=r.length,M=e.adjustSizes,x=e.barnesHutTheta*e.barnesHutTheta,$=[];for(i=0;i<P;i+=t)n[i+4]=n[i+2],n[i+5]=n[i+3],n[i+2]=0,n[i+3]=0;if(e.outboundAttractionDistribution){for(m=0,i=0;i<P;i+=t)m+=n[i+6];m/=P/t}if(e.barnesHutOptimize){var L,I,R,O=1/0,k=-1/0,G=1/0,D=-1/0;for(i=0;i<P;i+=t)O=Math.min(O,n[i+0]),k=Math.max(k,n[i+0]),G=Math.min(G,n[i+1]),D=Math.max(D,n[i+1]);var H=k-O,F=D-G;for(H>F?D=(G-=(H-F)/2)+H:k=(O-=(F-H)/2)+F,$[0]=-1,$[1]=(O+k)/2,$[2]=(G+D)/2,$[3]=Math.max(k-O,D-G),$[4]=-1,$[5]=-1,$[6]=0,$[7]=0,$[8]=0,s=1,i=0;i<P;i+=t)for(o=0,R=3;;){if(!($[o+5]>=0)){if($[o+0]<0){$[o+0]=i;break}if($[o+5]=9*s,d=$[o+3]/2,$[(h=$[o+5])+0]=-1,$[h+1]=$[o+1]-d,$[h+2]=$[o+2]-d,$[h+3]=d,$[h+4]=h+9,$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,$[(h+=9)+0]=-1,$[h+1]=$[o+1]-d,$[h+2]=$[o+2]+d,$[h+3]=d,$[h+4]=h+9,$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,$[(h+=9)+0]=-1,$[h+1]=$[o+1]+d,$[h+2]=$[o+2]-d,$[h+3]=d,$[h+4]=h+9,$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,$[(h+=9)+0]=-1,$[h+1]=$[o+1]+d,$[h+2]=$[o+2]+d,$[h+3]=d,$[h+4]=$[o+4],$[h+5]=-1,$[h+6]=0,$[h+7]=0,$[h+8]=0,s+=4,L=n[$[o+0]+0]<$[o+1]?n[$[o+0]+1]<$[o+2]?$[o+5]:$[o+5]+9:n[$[o+0]+1]<$[o+2]?$[o+5]+18:$[o+5]+27,$[o+6]=n[$[o+0]+6],$[o+7]=n[$[o+0]+0],$[o+8]=n[$[o+0]+1],$[L+0]=$[o+0],$[o+0]=-1,L===(I=n[i+0]<$[o+1]?n[i+1]<$[o+2]?$[o+5]:$[o+5]+9:n[i+1]<$[o+2]?$[o+5]+18:$[o+5]+27)){if(R--){o=L;continue}R=3;break}$[I+0]=i;break}L=n[i+0]<$[o+1]?n[i+1]<$[o+2]?$[o+5]:$[o+5]+9:n[i+1]<$[o+2]?$[o+5]+18:$[o+5]+27,$[o+7]=($[o+7]*$[o+6]+n[i+0]*n[i+6])/($[o+6]+n[i+6]),$[o+8]=($[o+8]*$[o+6]+n[i+1]*n[i+6])/($[o+6]+n[i+6]),$[o+6]+=n[i+6],o=L}}if(e.barnesHutOptimize){for(f=e.scalingRatio,i=0;i<P;i+=t)for(o=0;;)if($[o+5]>=0){if(w=Math.pow(n[i+0]-$[o+7],2)+Math.pow(n[i+1]-$[o+8],2),4*(p=$[o+3])*p/w<x){if(g=n[i+0]-$[o+7],y=n[i+1]-$[o+8],!0===M?w>0?(v=f*n[i+6]*$[o+6]/w,n[i+2]+=g*v,n[i+3]+=y*v):w<0&&(v=-f*n[i+6]*$[o+6]/Math.sqrt(w),n[i+2]+=g*v,n[i+3]+=y*v):w>0&&(v=f*n[i+6]*$[o+6]/w,n[i+2]+=g*v,n[i+3]+=y*v),(o=$[o+4])<0)break;continue}o=$[o+5]}else if((l=$[o+0])>=0&&l!==i&&(w=(g=n[i+0]-n[l+0])*g+(y=n[i+1]-n[l+1])*y,!0===M?w>0?(v=f*n[i+6]*n[l+6]/w,n[i+2]+=g*v,n[i+3]+=y*v):w<0&&(v=-f*n[i+6]*n[l+6]/Math.sqrt(w),n[i+2]+=g*v,n[i+3]+=y*v):w>0&&(v=f*n[i+6]*n[l+6]/w,n[i+2]+=g*v,n[i+3]+=y*v)),(o=$[o+4])<0)break}else for(f=e.scalingRatio,a=0;a<P;a+=t)for(c=0;c<a;c+=t)g=n[a+0]-n[c+0],y=n[a+1]-n[c+1],!0===M?(w=Math.sqrt(g*g+y*y)-n[a+8]-n[c+8])>0?(v=f*n[a+6]*n[c+6]/w/w,n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v):w<0&&(v=100*f*n[a+6]*n[c+6],n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v):(w=Math.sqrt(g*g+y*y))>0&&(v=f*n[a+6]*n[c+6]/w/w,n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v);for(h=e.gravity/e.scalingRatio,f=e.scalingRatio,i=0;i<P;i+=t)v=0,g=n[i+0],y=n[i+1],w=Math.sqrt(Math.pow(g,2)+Math.pow(y,2)),e.strongGravityMode?w>0&&(v=f*n[i+6]*h):w>0&&(v=f*n[i+6]*h/w),n[i+2]-=g*v,n[i+3]-=y*v;for(f=1*(e.outboundAttractionDistribution?m:1),u=0;u<N;u+=3)a=r[u+0],c=r[u+1],d=r[u+2],b=Math.pow(d,e.edgeWeightInfluence),g=n[a+0]-n[c+0],y=n[a+1]-n[c+1],!0===M?(w=Math.sqrt(g*g+y*y)-n[a+8]-n[c+8],e.linLogMode?e.outboundAttractionDistribution?w>0&&(v=-f*b*Math.log(1+w)/w/n[a+6]):w>0&&(v=-f*b*Math.log(1+w)/w):e.outboundAttractionDistribution?w>0&&(v=-f*b/n[a+6]):w>0&&(v=-f*b)):(w=Math.sqrt(Math.pow(g,2)+Math.pow(y,2)),e.linLogMode?e.outboundAttractionDistribution?w>0&&(v=-f*b*Math.log(1+w)/w/n[a+6]):w>0&&(v=-f*b*Math.log(1+w)/w):e.outboundAttractionDistribution?(w=1,v=-f*b/n[a+6]):(w=1,v=-f*b)),w>0&&(n[a+2]+=g*v,n[a+3]+=y*v,n[c+2]-=g*v,n[c+3]-=y*v);if(!0===M)for(i=0;i<P;i+=t)1!==n[i+9]&&((A=Math.sqrt(Math.pow(n[i+2],2)+Math.pow(n[i+3],2)))>10&&(n[i+2]=10*n[i+2]/A,n[i+3]=10*n[i+3]/A),E=n[i+6]*Math.sqrt((n[i+4]-n[i+2])*(n[i+4]-n[i+2])+(n[i+5]-n[i+3])*(n[i+5]-n[i+3])),T=Math.sqrt((n[i+4]+n[i+2])*(n[i+4]+n[i+2])+(n[i+5]+n[i+3])*(n[i+5]+n[i+3]))/2,C=.1*Math.log(1+T)/(1+Math.sqrt(E)),S=n[i+0]+n[i+2]*(C/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(C/e.slowDown),n[i+1]=_);else for(i=0;i<P;i+=t)1!==n[i+9]&&(E=n[i+6]*Math.sqrt((n[i+4]-n[i+2])*(n[i+4]-n[i+2])+(n[i+5]-n[i+3])*(n[i+5]-n[i+3])),T=Math.sqrt((n[i+4]+n[i+2])*(n[i+4]+n[i+2])+(n[i+5]+n[i+3])*(n[i+5]+n[i+3]))/2,C=n[i+7]*Math.log(1+T)/(1+Math.sqrt(E)),n[i+7]=Math.min(1,Math.sqrt(C*(Math.pow(n[i+2],2)+Math.pow(n[i+3],2))/(1+Math.sqrt(E)))),S=n[i+0]+n[i+2]*(C/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(C/e.slowDown),n[i+1]=_);return{}}},8153:(e,t)=>{function n(e){return"number"!=typeof e||isNaN(e)?1:e}t.Fd=function(e){return function(e,t){var n={},r=function(e){return void 0===e?t:e};"function"==typeof t&&(r=t);var s=function(t){return r(t[e])},o=function(){return r(void 0)};return"string"==typeof e?(n.fromAttributes=s,n.fromGraph=function(e,t){return s(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return s(t)},n.fromPartialEntry=n.fromEntry,n.fromMinimalEntry=n.fromEntry):"function"==typeof e?(n.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},n.fromGraph=function(t,n){var s=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),s[0],s[1],t.getNodeAttributes(s[0]),t.getNodeAttributes(s[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,s,o,i,a,c){return r(e(t,n,s,o,i,a,c))},n.fromPartialEntry=function(t,n,s,o){return r(e(t,n,s,o))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=o,n.fromGraph=o,n.fromEntry=o,n.fromMinimalEntry=o),n}(e,n)}},1736:e=>{e.exports=function(e){return null!==e&&"object"==typeof e&&"function"==typeof e.addUndirectedEdgeWithKey&&"function"==typeof e.dropNode&&"boolean"==typeof e.multi}},934:function(e){e.exports=function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,r(e,t)}function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function s(e,t,n){return s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct.bind():function(e,t,n){var s=[null];s.push.apply(s,t);var o=new(Function.bind.apply(e,s));return n&&r(o,n.prototype),o},s.apply(null,arguments)}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||(o=e,-1===Function.toString.call(o).indexOf("[native code]")))return e;var o;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return s(e,arguments,n(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)},o(e)}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var a=function(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++)if(arguments[t])for(var r in arguments[t])e[r]=arguments[t][r];return e};function c(e,t,n,r){var s=e._nodes.get(t),o=null;return s?o="mixed"===r?s.out&&s.out[n]||s.undirected&&s.undirected[n]:"directed"===r?s.out&&s.out[n]:s.undirected&&s.undirected[n]:o}function l(t){return"object"===e(t)&&null!==t}function u(e){var t;for(t in e)return!1;return!0}function d(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!1,writable:!0,value:n})}function h(e,t,n){var r={enumerable:!0,configurable:!0};"function"==typeof n?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(e,t,r)}function p(e){return!(!l(e)||e.attributes&&!Array.isArray(e.attributes))}"function"==typeof Object.assign&&(a=Object.assign);var m,f={exports:{}},g="object"==typeof Reflect?Reflect:null,y=g&&"function"==typeof g.apply?g.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};m=g&&"function"==typeof g.ownKeys?g.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var b=Number.isNaN||function(e){return e!=e};function w(){w.init.call(this)}f.exports=w,f.exports.once=function(e,t){return new Promise((function(n,r){function s(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",s),n([].slice.call(arguments))}M(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&M(e,"error",t,{once:!0})}(e,s)}))},w.EventEmitter=w,w.prototype._events=void 0,w.prototype._eventsCount=0,w.prototype._maxListeners=void 0;var v=10;function A(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function E(e){return void 0===e._maxListeners?w.defaultMaxListeners:e._maxListeners}function T(e,t,n,r){var s,o,i,a;if(A(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),void 0===i)i=o[t]=n,++e._eventsCount;else if("function"==typeof i?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(s=E(e))>0&&i.length>s&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,a=c,console&&console.warn&&console.warn(a)}return e}function C(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function S(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=C.bind(r);return s.listener=n,r.wrapFn=s,s}function _(e,t,n){var r=e._events;if(void 0===r)return[];var s=r[t];return void 0===s?[]:"function"==typeof s?n?[s.listener||s]:[s]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(s):N(s,s.length)}function P(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function N(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function M(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function s(o){r.once&&e.removeEventListener(t,s),n(o)}))}}function x(e){if("function"!=typeof e)throw new Error("obliterator/iterator: expecting a function!");this.next=e}Object.defineProperty(w,"defaultMaxListeners",{enumerable:!0,get:function(){return v},set:function(e){if("number"!=typeof e||e<0||b(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");v=e}}),w.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},w.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||b(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},w.prototype.getMaxListeners=function(){return E(this)},w.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var i=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw i.context=o,i}var a=s[e];if(void 0===a)return!1;if("function"==typeof a)y(a,this,t);else{var c=a.length,l=N(a,c);for(n=0;n<c;++n)y(l[n],this,t)}return!0},w.prototype.addListener=function(e,t){return T(this,e,t,!1)},w.prototype.on=w.prototype.addListener,w.prototype.prependListener=function(e,t){return T(this,e,t,!0)},w.prototype.once=function(e,t){return A(t),this.on(e,S(this,e,t)),this},w.prototype.prependOnceListener=function(e,t){return A(t),this.prependListener(e,S(this,e,t)),this},w.prototype.removeListener=function(e,t){var n,r,s,o,i;if(A(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){i=n[o].listener,s=o;break}if(s<0)return this;0===s?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,s),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,i||t)}return this},w.prototype.off=w.prototype.removeListener,w.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var s,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(s=o[r])&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},w.prototype.listeners=function(e){return _(this,e,!0)},w.prototype.rawListeners=function(e){return _(this,e,!1)},w.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):P.call(e,t)},w.prototype.listenerCount=P,w.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]},"undefined"!=typeof Symbol&&(x.prototype[Symbol.iterator]=function(){return this}),x.of=function(){var e=arguments,t=e.length,n=0;return new x((function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}}))},x.empty=function(){return new x((function(){return{done:!0}}))},x.fromSequence=function(e){var t=0,n=e.length;return new x((function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}}))},x.is=function(e){return e instanceof x||"object"==typeof e&&null!==e&&"function"==typeof e.next};var $=x,L={};L.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,L.SYMBOL_SUPPORT="undefined"!=typeof Symbol;var I=$,R=L,O=R.ARRAY_BUFFER_SUPPORT,k=R.SYMBOL_SUPPORT,G=function(e){var t=function(e){return"string"==typeof e||Array.isArray(e)||O&&ArrayBuffer.isView(e)?I.fromSequence(e):"object"!=typeof e||null===e?null:k&&"function"==typeof e[Symbol.iterator]?e[Symbol.iterator]():"function"==typeof e.next?e:null}(e);if(!t)throw new Error("obliterator: target is not iterable nor a valid iterator.");return t},D=G,H=function(e,t){for(var n,r=arguments.length>1?t:1/0,s=r!==1/0?new Array(r):[],o=0,i=D(e);;){if(o===r)return s;if((n=i.next()).done)return o!==t&&(s.length=o),s;s[o++]=n.value}},F=function(e){function n(t){var n;return(n=e.call(this)||this).name="GraphError",n.message=t,n}return t(n,e),n}(o(Error)),V=function(e){function n(t){var r;return(r=e.call(this,t)||this).name="InvalidArgumentsGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i(r),n.prototype.constructor),r}return t(n,e),n}(F),U=function(e){function n(t){var r;return(r=e.call(this,t)||this).name="NotFoundGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i(r),n.prototype.constructor),r}return t(n,e),n}(F),Y=function(e){function n(t){var r;return(r=e.call(this,t)||this).name="UsageGraphError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i(r),n.prototype.constructor),r}return t(n,e),n}(F);function B(e,t){this.key=e,this.attributes=t,this.clear()}function W(e,t){this.key=e,this.attributes=t,this.clear()}function j(e,t){this.key=e,this.attributes=t,this.clear()}function K(e,t,n,r,s){this.key=t,this.attributes=s,this.undirected=e,this.source=n,this.target=r}function q(e,t,n,r,s,o,i){var a,c,l,u;if(r=""+r,0===n){if(!(a=e._nodes.get(r)))throw new U("Graph.".concat(t,': could not find the "').concat(r,'" node in the graph.'));l=s,u=o}else if(3===n){if(s=""+s,!(c=e._edges.get(s)))throw new U("Graph.".concat(t,': could not find the "').concat(s,'" edge in the graph.'));var d=c.source.key,h=c.target.key;if(r===d)a=c.target;else{if(r!==h)throw new U("Graph.".concat(t,': the "').concat(r,'" node is not attached to the "').concat(s,'" edge (').concat(d,", ").concat(h,")."));a=c.source}l=o,u=i}else{if(!(c=e._edges.get(r)))throw new U("Graph.".concat(t,': could not find the "').concat(r,'" edge in the graph.'));a=1===n?c.source:c.target,l=s,u=o}return[a,l,u]}B.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},W.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},j.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},K.prototype.attach=function(){var e="out",t="in";this.undirected&&(e=t="undirected");var n=this.source.key,r=this.target.key;this.source[e][r]=this,this.undirected&&n===r||(this.target[t][n]=this)},K.prototype.attachMulti=function(){var e="out",t="in",n=this.source.key,r=this.target.key;this.undirected&&(e=t="undirected");var s=this.source[e],o=s[r];if(void 0===o)return s[r]=this,void(this.undirected&&n===r||(this.target[t][n]=this));o.previous=this,this.next=o,s[r]=this,this.target[t][n]=this},K.prototype.detach=function(){var e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][t],delete this.target[r][e]},K.prototype.detachMulti=function(){var e=this.source.key,t=this.target.key,n="out",r="in";this.undirected&&(n=r="undirected"),void 0===this.previous?void 0===this.next?(delete this.source[n][t],delete this.target[r][e]):(this.next.previous=void 0,this.source[n][t]=this.next,this.target[r][e]=this.next):(this.previous.next=this.next,void 0!==this.next&&(this.next.previous=this.previous))};var z=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];return i.attributes[a]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){return q(this,t,n,e,r)[0].attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];return i.attributes.hasOwnProperty(a)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s,o){var i=q(this,t,n,e,r,s,o),a=i[0],c=i[1],l=i[2];return a.attributes[c]=l,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s,o){var i=q(this,t,n,e,r,s,o),a=i[0],c=i[1],l=i[2];if("function"!=typeof l)throw new V("Graph.".concat(t,": updater should be a function."));var u=a.attributes,d=l(u[c]);return u[c]=d,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:c}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];return delete i.attributes[a],this.emit("nodeAttributesUpdated",{key:i.key,type:"remove",attributes:i.attributes,name:a}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];if(!l(a))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return i.attributes=a,this.emit("nodeAttributesUpdated",{key:i.key,type:"replace",attributes:i.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],c=o[1];if(!l(c))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return a(i.attributes,c),this.emit("nodeAttributesUpdated",{key:i.key,type:"merge",attributes:i.attributes,data:c}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o=q(this,t,n,e,r,s),i=o[0],a=o[1];if("function"!=typeof a)throw new V("Graph.".concat(t,": provided updater is not a function."));return i.attributes=a(i.attributes),this.emit("nodeAttributesUpdated",{key:i.key,type:"update",attributes:i.attributes}),this}}}],Z=[{name:function(e){return"get".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return s.attributes[r]}}},{name:function(e){return"get".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e){var r;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var s=""+e,o=""+arguments[1];if(!(r=c(this,s,o,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').concat(o,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(r=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return r.attributes}}},{name:function(e){return"has".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return s.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+r;if(r=arguments[2],s=arguments[3],!(o=c(this,i,a,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return o.attributes[r]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,s){var o;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var i=""+e,a=""+r;if(r=arguments[2],s=arguments[3],!(o=c(this,i,a,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(i,'" - "').concat(a,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof s)throw new V("Graph.".concat(t,": updater should be a function."));return o.attributes[r]=s(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return delete s.attributes[r],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if(!l(r))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return s.attributes=r,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if(!l(r))throw new V("Graph.".concat(t,": provided attributes are not a plain object."));return a(s.attributes,r),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:r}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){var s;if("mixed"!==this.type&&"mixed"!==n&&n!==this.type)throw new Y("Graph.".concat(t,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new Y("Graph.".concat(t,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var o=""+e,i=""+r;if(r=arguments[2],!(s=c(this,o,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(i,'").'))}else{if("mixed"!==n)throw new Y("Graph.".concat(t,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(e=""+e,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof r)throw new V("Graph.".concat(t,": provided updater is not a function."));return s.attributes=r(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}}],X=$,Q=G,J=function(){var e=arguments,t=null,n=-1;return new X((function(){for(var r=null;;){if(null===t){if(++n>=e.length)return{done:!0};t=Q(e[n])}if(!0!==(r=t.next()).done)break;t=null}return r}))},ee=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function te(e,t,n,r){var s=!1;for(var o in t)if(o!==r){var i=t[o];if(s=n(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&s)return i.key}}function ne(e,t,n,r){var s,o,i,a=!1;for(var c in t)if(c!==r){s=t[c];do{if(o=s.source,i=s.target,a=n(s.key,s.attributes,o.key,i.key,o.attributes,i.attributes,s.undirected),e&&a)return s.key;s=s.next}while(void 0!==s)}}function re(e,t){var n,r=Object.keys(e),s=r.length,o=0;return new $((function(){do{if(n)n=n.next;else{if(o>=s)return{done:!0};var i=r[o++];if(i===t){n=void 0;continue}n=e[i]}}while(!n);return{done:!1,value:{edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected}}}))}function se(e,t,n,r){var s=t[n];if(s){var o=s.source,i=s.target;return r(s.key,s.attributes,o.key,i.key,o.attributes,i.attributes,s.undirected)&&e?s.key:void 0}}function oe(e,t,n,r){var s=t[n];if(s){var o=!1;do{if(o=r(s.key,s.attributes,s.source.key,s.target.key,s.source.attributes,s.target.attributes,s.undirected),e&&o)return s.key;s=s.next}while(void 0!==s)}}function ie(e,t){var n=e[t];return void 0!==n.next?new $((function(){if(!n)return{done:!0};var e={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:e}})):$.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function ae(e,t,n,r){if(0!==t.size)for(var s,o,i="mixed"!==n&&n!==t.type,a="undirected"===n,c=!1,l=t._edges.values();!0!==(s=l.next()).done;)if(o=s.value,!i||o.undirected===a){var u=o,d=u.key,h=u.attributes,p=u.source,m=u.target;if(c=r(d,h,p.key,m.key,p.attributes,m.attributes,o.undirected),e&&c)return d}}function ce(e,t,n,r,s,o){var i,a=t?ne:te;if("undirected"!==n){if("out"!==r&&(i=a(e,s.in,o),e&&i))return i;if("in"!==r&&(i=a(e,s.out,o,r?void 0:s.key),e&&i))return i}if("directed"!==n&&(i=a(e,s.undirected,o),e&&i))return i}function le(e,t,n,r,s,o,i){var a,c=n?oe:se;if("undirected"!==t){if(void 0!==s.in&&"out"!==r&&(a=c(e,s.in,o,i),e&&a))return a;if(void 0!==s.out&&"in"!==r&&(r||s.key!==o)&&(a=c(e,s.out,o,i),e&&a))return a}if("directed"!==t&&void 0!==s.undirected&&(a=c(e,s.undirected,o,i),e&&a))return a}var ue=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function de(){this.A=null,this.B=null}function he(e,t,n,r,s){for(var o in r){var i=r[o],a=i.source,c=i.target,l=a===n?c:a;if(!t||!t.has(l.key)){var u=s(l.key,l.attributes);if(e&&u)return l.key}}}function pe(e,t,n,r,s){if("mixed"!==t){if("undirected"===t)return he(e,null,r,r.undirected,s);if("string"==typeof n)return he(e,null,r,r[n],s)}var o,i=new de;if("undirected"!==t){if("out"!==n){if(o=he(e,null,r,r.in,s),e&&o)return o;i.wrap(r.in)}if("in"!==n){if(o=he(e,i,r,r.out,s),e&&o)return o;i.wrap(r.out)}}if("directed"!==t&&(o=he(e,i,r,r.undirected,s),e&&o))return o}function me(e,t,n){var r=Object.keys(n),s=r.length,o=0;return new $((function(){var i=null;do{if(o>=s)return e&&e.wrap(n),{done:!0};var a=n[r[o++]],c=a.source,l=a.target;i=c===t?l:c,e&&e.has(i.key)&&(i=null)}while(null===i);return{done:!1,value:{neighbor:i.key,attributes:i.attributes}}}))}function fe(e,t,n,r,s){for(var o,i,a,c,l,u,d,h=r._nodes.values(),p=r.type;!0!==(o=h.next()).done;){var m=!1;if(i=o.value,"undirected"!==p)for(a in c=i.out){l=c[a];do{if(u=l.target,m=!0,d=s(i.key,u.key,i.attributes,u.attributes,l.key,l.attributes,l.undirected),e&&d)return l;l=l.next}while(l)}if("directed"!==p)for(a in c=i.undirected)if(!(t&&i.key>a)){l=c[a];do{if((u=l.target).key!==a&&(u=l.source),m=!0,d=s(i.key,u.key,i.attributes,u.attributes,l.key,l.attributes,l.undirected),e&&d)return l;l=l.next}while(l)}if(n&&!m&&(d=s(i.key,null,i.attributes,null,null,null,null),e&&d))return null}}function ge(e){if(!l(e))throw new V('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in e))throw new V("Graph.import: serialized node is missing its key.");if("attributes"in e&&(!l(e.attributes)||null===e.attributes))throw new V("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function ye(e){if(!l(e))throw new V('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in e))throw new V("Graph.import: serialized edge is missing its source.");if(!("target"in e))throw new V("Graph.import: serialized edge is missing its target.");if("attributes"in e&&(!l(e.attributes)||null===e.attributes))throw new V("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in e&&"boolean"!=typeof e.undirected)throw new V("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}de.prototype.wrap=function(e){null===this.A?this.A=e:null===this.B&&(this.B=e)},de.prototype.has=function(e){return null!==this.A&&e in this.A||null!==this.B&&e in this.B};var be,we=(be=255&Math.floor(256*Math.random()),function(){return be++}),ve=new Set(["directed","undirected","mixed"]),Ae=new Set(["domain","_events","_eventsCount","_maxListeners"]),Ee={allowSelfLoops:!0,multi:!1,type:"mixed"};function Te(e,t,n){var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}function Ce(e,t,n,r,s,o,i,a){if(!r&&"undirected"===e.type)throw new Y("Graph.".concat(t,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new Y("Graph.".concat(t,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(a&&!l(a))throw new V("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(a,'"'));if(o=""+o,i=""+i,a=a||{},!e.allowSelfLoops&&o===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var c=e._nodes.get(o),u=e._nodes.get(i);if(!c)throw new U("Graph.".concat(t,': source node "').concat(o,'" not found.'));if(!u)throw new U("Graph.".concat(t,': target node "').concat(i,'" not found.'));var d={key:null,undirected:r,source:o,target:i,attributes:a};if(n)s=e._edgeKeyGenerator();else if(s=""+s,e._edges.has(s))throw new Y("Graph.".concat(t,': the "').concat(s,'" edge already exists in the graph.'));if(!e.multi&&(r?void 0!==c.undirected[i]:void 0!==c.out[i]))throw new Y("Graph.".concat(t,': an edge linking "').concat(o,'" to "').concat(i,"\" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option."));var h=new K(r,s,c,u,a);e._edges.set(s,h);var p=o===i;return r?(c.undirectedDegree++,u.undirectedDegree++,p&&(c.undirectedLoops++,e._undirectedSelfLoopCount++)):(c.outDegree++,u.inDegree++,p&&(c.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),r?e._undirectedSize++:e._directedSize++,d.key=s,e.emit("edgeAdded",d),s}function Se(e,t,n,r,s,o,i,c,u){if(!r&&"undirected"===e.type)throw new Y("Graph.".concat(t,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(r&&"directed"===e.type)throw new Y("Graph.".concat(t,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(c)if(u){if("function"!=typeof c)throw new V("Graph.".concat(t,': invalid updater function. Expecting a function but got "').concat(c,'"'))}else if(!l(c))throw new V("Graph.".concat(t,': invalid attributes. Expecting an object but got "').concat(c,'"'));var d;if(o=""+o,i=""+i,u&&(d=c,c=void 0),!e.allowSelfLoops&&o===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(o,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var h,p,m=e._nodes.get(o),f=e._nodes.get(i);if(!n&&(h=e._edges.get(s))){if(!(h.source.key===o&&h.target.key===i||r&&h.source.key===i&&h.target.key===o))throw new Y("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(s,'" edge with "').concat(o,'" source & "').concat(i,'" target vs. ("').concat(h.source.key,'", "').concat(h.target.key,'").'));p=h}if(p||e.multi||!m||(p=r?m.undirected[i]:m.out[i]),p){var g=[p.key,!1,!1,!1];if(u?!d:!c)return g;if(u){var y=p.attributes;p.attributes=d(y),e.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else a(p.attributes,c),e.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:c});return g}c=c||{},u&&d&&(c=d(c));var b={key:null,undirected:r,source:o,target:i,attributes:c};if(n)s=e._edgeKeyGenerator();else if(s=""+s,e._edges.has(s))throw new Y("Graph.".concat(t,': the "').concat(s,'" edge already exists in the graph.'));var w=!1,v=!1;m||(m=Te(e,o,{}),w=!0,o===i&&(f=m,v=!0)),f||(f=Te(e,i,{}),v=!0),h=new K(r,s,m,f,c),e._edges.set(s,h);var A=o===i;return r?(m.undirectedDegree++,f.undirectedDegree++,A&&(m.undirectedLoops++,e._undirectedSelfLoopCount++)):(m.outDegree++,f.inDegree++,A&&(m.directedLoops++,e._directedSelfLoopCount++)),e.multi?h.attachMulti():h.attach(),r?e._undirectedSize++:e._directedSize++,b.key=s,e.emit("edgeAdded",b),[s,!0,w,v]}function _e(e,t){e._edges.delete(t.key);var n=t.source,r=t.target,s=t.attributes,o=t.undirected,i=n===r;o?(n.undirectedDegree--,r.undirectedDegree--,i&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,i&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),o?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:s,source:n.key,target:r.key,undirected:o})}var Pe=function(n){function r(e){var t;if(t=n.call(this)||this,"boolean"!=typeof(e=a({},Ee,e)).multi)throw new V("Graph.constructor: invalid 'multi' option. Expecting a boolean but got \"".concat(e.multi,'".'));if(!ve.has(e.type))throw new V('Graph.constructor: invalid \'type\' option. Should be one of "mixed", "directed" or "undirected" but got "'.concat(e.type,'".'));if("boolean"!=typeof e.allowSelfLoops)throw new V("Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got \"".concat(e.allowSelfLoops,'".'));var r="mixed"===e.type?B:"directed"===e.type?W:j;d(i(t),"NodeDataClass",r);var s="geid_"+we()+"_",o=0;return d(i(t),"_attributes",{}),d(i(t),"_nodes",new Map),d(i(t),"_edges",new Map),d(i(t),"_directedSize",0),d(i(t),"_undirectedSize",0),d(i(t),"_directedSelfLoopCount",0),d(i(t),"_undirectedSelfLoopCount",0),d(i(t),"_edgeKeyGenerator",(function(){var e;do{e=s+o++}while(t._edges.has(e));return e})),d(i(t),"_options",e),Ae.forEach((function(e){return d(i(t),e,t[e])})),h(i(t),"order",(function(){return t._nodes.size})),h(i(t),"size",(function(){return t._edges.size})),h(i(t),"directedSize",(function(){return t._directedSize})),h(i(t),"undirectedSize",(function(){return t._undirectedSize})),h(i(t),"selfLoopCount",(function(){return t._directedSelfLoopCount+t._undirectedSelfLoopCount})),h(i(t),"directedSelfLoopCount",(function(){return t._directedSelfLoopCount})),h(i(t),"undirectedSelfLoopCount",(function(){return t._undirectedSelfLoopCount})),h(i(t),"multi",t._options.multi),h(i(t),"type",t._options.type),h(i(t),"allowSelfLoops",t._options.allowSelfLoops),h(i(t),"implementation",(function(){return"graphology"})),t}t(r,n);var s=r.prototype;return s._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},s.hasNode=function(e){return this._nodes.has(""+e)},s.hasDirectedEdge=function(e,t){if("undirected"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&!r.undirected}if(2===arguments.length){e=""+e,t=""+t;var s=this._nodes.get(e);return!!s&&s.out.hasOwnProperty(t)}throw new V("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},s.hasUndirectedEdge=function(e,t){if("directed"===this.type)return!1;if(1===arguments.length){var n=""+e,r=this._edges.get(n);return!!r&&r.undirected}if(2===arguments.length){e=""+e,t=""+t;var s=this._nodes.get(e);return!!s&&s.undirected.hasOwnProperty(t)}throw new V("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},s.hasEdge=function(e,t){if(1===arguments.length){var n=""+e;return this._edges.has(n)}if(2===arguments.length){e=""+e,t=""+t;var r=this._nodes.get(e);return!!r&&(void 0!==r.out&&r.out.hasOwnProperty(t)||void 0!==r.undirected&&r.undirected.hasOwnProperty(t))}throw new V("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},s.directedEdge=function(e,t){if("undirected"!==this.type){if(e=""+e,t=""+t,this.multi)throw new Y("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var n=this._nodes.get(e);if(!n)throw new U('Graph.directedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U('Graph.directedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||void 0;return r?r.key:void 0}},s.undirectedEdge=function(e,t){if("directed"!==this.type){if(e=""+e,t=""+t,this.multi)throw new Y("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var n=this._nodes.get(e);if(!n)throw new U('Graph.undirectedEdge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U('Graph.undirectedEdge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.undirected&&n.undirected[t]||void 0;return r?r.key:void 0}},s.edge=function(e,t){if(this.multi)throw new Y("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.edge: could not find the "'.concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U('Graph.edge: could not find the "'.concat(t,'" target node in the graph.'));var r=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(r)return r.key},s.areDirectedNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areDirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&(t in n.in||t in n.out)},s.areOutNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areOutNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.out},s.areInNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areInNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.in},s.areUndirectedNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areUndirectedNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"directed"!==this.type&&t in n.undirected},s.areNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&(t in n.in||t in n.out)||"directed"!==this.type&&t in n.undirected},s.areInboundNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areInboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.in||"directed"!==this.type&&t in n.undirected},s.areOutboundNeighbors=function(e,t){e=""+e,t=""+t;var n=this._nodes.get(e);if(!n)throw new U('Graph.areOutboundNeighbors: could not find the "'.concat(e,'" node in the graph.'));return"undirected"!==this.type&&t in n.out||"directed"!==this.type&&t in n.undirected},s.inDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree},s.outDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.outDegree},s.directedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.directedDegree: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree+t.outDegree},s.undirectedDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.undirectedDegree: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:t.undirectedDegree},s.inboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inboundDegree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.inDegree),n},s.outboundDegree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outboundDegree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.outDegree),n},s.degree=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.degree: could not find the "'.concat(e,'" node in the graph.'));var n=0;return"directed"!==this.type&&(n+=t.undirectedDegree),"undirected"!==this.type&&(n+=t.inDegree+t.outDegree),n},s.inDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree-t.directedLoops},s.outDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.outDegree-t.directedLoops},s.directedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"undirected"===this.type?0:t.inDegree+t.outDegree-2*t.directedLoops},s.undirectedDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));return"directed"===this.type?0:t.undirectedDegree-2*t.undirectedLoops},s.inboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=t.undirectedDegree,r+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.inDegree,r+=t.directedLoops),n-r},s.outboundDegreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=t.undirectedDegree,r+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.outDegree,r+=t.directedLoops),n-r},s.degreeWithoutSelfLoops=function(e){e=""+e;var t=this._nodes.get(e);if(!t)throw new U('Graph.degreeWithoutSelfLoops: could not find the "'.concat(e,'" node in the graph.'));var n=0,r=0;return"directed"!==this.type&&(n+=t.undirectedDegree,r+=2*t.undirectedLoops),"undirected"!==this.type&&(n+=t.inDegree+t.outDegree,r+=2*t.directedLoops),n-r},s.source=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.source: could not find the "'.concat(e,'" edge in the graph.'));return t.source.key},s.target=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.target: could not find the "'.concat(e,'" edge in the graph.'));return t.target.key},s.extremities=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.extremities: could not find the "'.concat(e,'" edge in the graph.'));return[t.source.key,t.target.key]},s.opposite=function(e,t){e=""+e,t=""+t;var n=this._edges.get(t);if(!n)throw new U('Graph.opposite: could not find the "'.concat(t,'" edge in the graph.'));var r=n.source.key,s=n.target.key;if(e===r)return s;if(e===s)return r;throw new U('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(s,")."))},s.hasExtremity=function(e,t){e=""+e,t=""+t;var n=this._edges.get(e);if(!n)throw new U('Graph.hasExtremity: could not find the "'.concat(e,'" edge in the graph.'));return n.source.key===t||n.target.key===t},s.isUndirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.isUndirected: could not find the "'.concat(e,'" edge in the graph.'));return t.undirected},s.isDirected=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.isDirected: could not find the "'.concat(e,'" edge in the graph.'));return!t.undirected},s.isSelfLoop=function(e){e=""+e;var t=this._edges.get(e);if(!t)throw new U('Graph.isSelfLoop: could not find the "'.concat(e,'" edge in the graph.'));return t.source===t.target},s.addNode=function(e,t){var n=function(e,t,n){if(n&&!l(n))throw new V('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(n,'"'));if(t=""+t,n=n||{},e._nodes.has(t))throw new Y('Graph.addNode: the "'.concat(t,'" node already exist in the graph.'));var r=new e.NodeDataClass(t,n);return e._nodes.set(t,r),e.emit("nodeAdded",{key:t,attributes:n}),r}(this,e,t);return n.key},s.mergeNode=function(e,t){if(t&&!l(t))throw new V('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(t,'"'));e=""+e,t=t||{};var n=this._nodes.get(e);return n?(t&&(a(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])},s.updateNode=function(e,t){if(t&&"function"!=typeof t)throw new V('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(t,'"'));e=""+e;var n=this._nodes.get(e);if(n){if(t){var r=n.attributes;n.attributes=t(r),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}var s=t?t({}):{};return n=new this.NodeDataClass(e,s),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:s}),[e,!0]},s.dropNode=function(e){e=""+e;var t,n=this._nodes.get(e);if(!n)throw new U('Graph.dropNode: could not find the "'.concat(e,'" node in the graph.'));if("undirected"!==this.type){for(var r in n.out){t=n.out[r];do{_e(this,t),t=t.next}while(t)}for(var s in n.in){t=n.in[s];do{_e(this,t),t=t.next}while(t)}}if("directed"!==this.type)for(var o in n.undirected){t=n.undirected[o];do{_e(this,t),t=t.next}while(t)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},s.dropEdge=function(e){var t;if(arguments.length>1){var n=""+arguments[0],r=""+arguments[1];if(!(t=c(this,n,r,this.type)))throw new U('Graph.dropEdge: could not find the "'.concat(n,'" -> "').concat(r,'" edge in the graph.'))}else if(e=""+e,!(t=this._edges.get(e)))throw new U('Graph.dropEdge: could not find the "'.concat(e,'" edge in the graph.'));return _e(this,t),this},s.dropDirectedEdge=function(e,t){if(arguments.length<2)throw new Y("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Y("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=c(this,e=""+e,t=""+t,"directed");if(!n)throw new U('Graph.dropDirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return _e(this,n),this},s.dropUndirectedEdge=function(e,t){if(arguments.length<2)throw new Y("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Y("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var n=c(this,e,t,"undirected");if(!n)throw new U('Graph.dropUndirectedEdge: could not find a "'.concat(e,'" -> "').concat(t,'" edge in the graph.'));return _e(this,n),this},s.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},s.clearEdges=function(){for(var e,t=this._nodes.values();!0!==(e=t.next()).done;)e.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},s.getAttribute=function(e){return this._attributes[e]},s.getAttributes=function(){return this._attributes},s.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},s.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},s.updateAttribute=function(e,t){if("function"!=typeof t)throw new V("Graph.updateAttribute: updater should be a function.");var n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},s.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},s.replaceAttributes=function(e){if(!l(e))throw new V("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},s.mergeAttributes=function(e){if(!l(e))throw new V("Graph.mergeAttributes: provided attributes are not a plain object.");return a(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this},s.updateAttributes=function(e){if("function"!=typeof e)throw new V("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},s.updateEachNodeAttributes=function(e,t){if("function"!=typeof e)throw new V("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!p(t))throw new V("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,s=this._nodes.values();!0!==(n=s.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},s.updateEachEdgeAttributes=function(e,t){if("function"!=typeof e)throw new V("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!p(t))throw new V("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var n,r,s,o,i=this._edges.values();!0!==(n=i.next()).done;)s=(r=n.value).source,o=r.target,r.attributes=e(r.key,r.attributes,s.key,o.key,s.attributes,o.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},s.forEachAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntry: expecting a callback.");fe(!1,!1,!1,this,e)},s.forEachAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!1,!0,this,e)},s.forEachAssymetricAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");fe(!1,!0,!1,this,e)},s.forEachAssymetricAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!0,!0,this,e)},s.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):H(this._nodes.keys(),this._nodes.size)},s.forEachNode=function(e){if("function"!=typeof e)throw new V("Graph.forEachNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)e((n=t.value).key,n.attributes)},s.findNode=function(e){if("function"!=typeof e)throw new V("Graph.findNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)if(e((n=t.value).key,n.attributes))return n.key},s.mapNodes=function(e){if("function"!=typeof e)throw new V("Graph.mapNode: expecting a callback.");for(var t,n,r=this._nodes.values(),s=new Array(this.order),o=0;!0!==(t=r.next()).done;)n=t.value,s[o++]=e(n.key,n.attributes);return s},s.someNode=function(e){if("function"!=typeof e)throw new V("Graph.someNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)if(e((n=t.value).key,n.attributes))return!0;return!1},s.everyNode=function(e){if("function"!=typeof e)throw new V("Graph.everyNode: expecting a callback.");for(var t,n,r=this._nodes.values();!0!==(t=r.next()).done;)if(!e((n=t.value).key,n.attributes))return!1;return!0},s.filterNodes=function(e){if("function"!=typeof e)throw new V("Graph.filterNodes: expecting a callback.");for(var t,n,r=this._nodes.values(),s=[];!0!==(t=r.next()).done;)e((n=t.value).key,n.attributes)&&s.push(n.key);return s},s.reduceNodes=function(e,t){if("function"!=typeof e)throw new V("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new V("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var n,r,s=t,o=this._nodes.values();!0!==(n=o.next()).done;)s=e(s,(r=n.value).key,r.attributes);return s},s.nodeEntries=function(){var e=this._nodes.values();return new $((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},s.export=function(){var e=this,t=new Array(this._nodes.size),n=0;this._nodes.forEach((function(e,r){t[n++]=function(e,t){var n={key:e};return u(t.attributes)||(n.attributes=a({},t.attributes)),n}(r,e)}));var r=new Array(this._edges.size);return n=0,this._edges.forEach((function(t,s){r[n++]=function(e,t,n){var r={key:t,source:n.source.key,target:n.target.key};return u(n.attributes)||(r.attributes=a({},n.attributes)),"mixed"===e&&n.undirected&&(r.undirected=!0),r}(e.type,s,t)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}},s.import=function(e){var t,n,s,o,i,a=this,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof r)return e.forEachNode((function(e,t){c?a.mergeNode(e,t):a.addNode(e,t)})),e.forEachEdge((function(e,t,n,r,s,o,i){c?i?a.mergeUndirectedEdgeWithKey(e,n,r,t):a.mergeDirectedEdgeWithKey(e,n,r,t):i?a.addUndirectedEdgeWithKey(e,n,r,t):a.addDirectedEdgeWithKey(e,n,r,t)})),this;if(!l(e))throw new V("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!l(e.attributes))throw new V("Graph.import: invalid attributes. Expecting a plain object.");c?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new V("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=s.length;t<n;t++){ge(o=s[t]);var u=o,d=u.key,h=u.attributes;c?this.mergeNode(d,h):this.addNode(d,h)}}if(e.edges){var p=!1;if("undirected"===this.type&&(p=!0),s=e.edges,!Array.isArray(s))throw new V("Graph.import: invalid edges. Expecting an array.");for(t=0,n=s.length;t<n;t++){ye(i=s[t]);var m=i,f=m.source,g=m.target,y=m.attributes,b=m.undirected,w=void 0===b?p:b;"key"in i?(c?w?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:w?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,i.key,f,g,y):(c?w?this.mergeUndirectedEdge:this.mergeDirectedEdge:w?this.addUndirectedEdge:this.addDirectedEdge).call(this,f,g,y)}}return this},s.nullCopy=function(e){var t=new r(a({},this._options,e));return t.replaceAttributes(a({},this.getAttributes())),t},s.emptyCopy=function(e){var t=this.nullCopy(e);return this._nodes.forEach((function(e,n){var r=a({},e.attributes);e=new t.NodeDataClass(n,r),t._nodes.set(n,e)})),t},s.copy=function(e){if("string"==typeof(e=e||{}).type&&e.type!==this.type&&"mixed"!==e.type)throw new Y('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(e.type,'" because this would mean losing information about the current graph.'));if("boolean"==typeof e.multi&&e.multi!==this.multi&&!0!==e.multi)throw new Y("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if("boolean"==typeof e.allowSelfLoops&&e.allowSelfLoops!==this.allowSelfLoops&&!0!==e.allowSelfLoops)throw new Y("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var t,n,r=this.emptyCopy(e),s=this._edges.values();!0!==(t=s.next()).done;)Ce(r,"copy",!1,(n=t.value).undirected,n.key,n.source.key,n.target.key,a({},n.attributes));return r},s.toJSON=function(){return this.export()},s.toString=function(){return"[object Graph]"},s.inspect=function(){var t=this,n={};this._nodes.forEach((function(e,t){n[t]=e.attributes}));var r={},s={};this._edges.forEach((function(e,n){var o,i=e.undirected?"--":"->",a="",c=e.source.key,l=e.target.key;e.undirected&&c>l&&(o=c,c=l,l=o);var u="(".concat(c,")").concat(i,"(").concat(l,")");n.startsWith("geid_")?t.multi&&(void 0===s[u]?s[u]=0:s[u]++,a+="".concat(s[u],". ")):a+="[".concat(n,"]: "),r[a+=u]=e.attributes}));var o={};for(var i in this)this.hasOwnProperty(i)&&!Ae.has(i)&&"function"!=typeof this[i]&&"symbol"!==e(i)&&(o[i]=this[i]);return o.attributes=this._attributes,o.nodes=n,o.edges=r,d(o,"constructor",this.constructor),o},r}(f.exports.EventEmitter);"undefined"!=typeof Symbol&&(Pe.prototype[Symbol.for("nodejs.util.inspect.custom")]=Pe.prototype.inspect),[{name:function(e){return"".concat(e,"Edge")},generateKey:!0},{name:function(e){return"".concat(e,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(e){return"".concat(e,"EdgeWithKey")}},{name:function(e){return"".concat(e,"DirectedEdgeWithKey")},type:"directed"},{name:function(e){return"".concat(e,"UndirectedEdgeWithKey")},type:"undirected"}].forEach((function(e){["add","merge","update"].forEach((function(t){var n=e.name(t),r="add"===t?Ce:Se;e.generateKey?Pe.prototype[n]=function(s,o,i){return r(this,n,!0,"undirected"===(e.type||this.type),null,s,o,i,"update"===t)}:Pe.prototype[n]=function(s,o,i,a){return r(this,n,!1,"undirected"===(e.type||this.type),s,o,i,a,"update"===t)}}))})),function(e){z.forEach((function(t){var n=t.name,r=t.attacher;r(e,n("Node"),0),r(e,n("Source"),1),r(e,n("Target"),2),r(e,n("Opposite"),3)}))}(Pe),function(e){Z.forEach((function(t){var n=t.name,r=t.attacher;r(e,n("Edge"),"mixed"),r(e,n("DirectedEdge"),"directed"),r(e,n("UndirectedEdge"),"undirected")}))}(Pe),function(e){ee.forEach((function(t){!function(e,t){var n=t.name,r=t.type,s=t.direction;e.prototype[n]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];if(!arguments.length)return function(e,t){if(0===e.size)return[];if("mixed"===t||t===e.type)return"function"==typeof Array.from?Array.from(e._edges.keys()):H(e._edges.keys(),e._edges.size);for(var n,r,s="undirected"===t?e.undirectedSize:e.directedSize,o=new Array(s),i="undirected"===t,a=e._edges.values(),c=0;!0!==(n=a.next()).done;)(r=n.value).undirected===i&&(o[c++]=r.key);return o}(this,r);if(1===arguments.length){e=""+e;var o=this._nodes.get(e);if(void 0===o)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n,r){var s=[];return ce(!1,e,t,n,r,(function(e){s.push(e)})),s}(this.multi,"mixed"===r?this.type:r,s,o)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(n,': could not find the "').concat(t,'" target node in the graph.'));return function(e,t,n,r,s){var o=[];return le(!1,e,t,n,r,s,(function(e){o.push(e)})),o}(r,this.multi,s,i,t)}throw new V("Graph.".concat(n,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"===r||"mixed"===this.type||r===this.type){if(1===arguments.length)return ae(!1,this,r,n=e);if(2===arguments.length){e=""+e,n=t;var i=this._nodes.get(e);if(void 0===i)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ce(!1,this.multi,"mixed"===r?this.type:r,s,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return le(!1,r,this.multi,s,a,t,n)}throw new V("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var i="map"+n[0].toUpperCase()+n.slice(1);e.prototype[i]=function(){var e,t=Array.prototype.slice.call(arguments),n=t.pop();if(0===t.length){var s=0;"directed"!==r&&(s+=this.undirectedSize),"undirected"!==r&&(s+=this.directedSize),e=new Array(s);var i=0;t.push((function(t,r,s,o,a,c,l){e[i++]=n(t,r,s,o,a,c,l)}))}else e=[],t.push((function(t,r,s,o,i,a,c){e.push(n(t,r,s,o,i,a,c))}));return this[o].apply(this,t),e};var a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop(),n=[];return e.push((function(e,r,s,o,i,a,c){t(e,r,s,o,i,a,c)&&n.push(e)})),this[o].apply(this,e),n};var c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(){var e,t,n=Array.prototype.slice.call(arguments);if(n.length<2||n.length>4)throw new V("Graph.".concat(c,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(n.length,")."));if("function"==typeof n[n.length-1]&&"function"!=typeof n[n.length-2])throw new V("Graph.".concat(c,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));2===n.length?(e=n[0],t=n[1],n=[]):3===n.length?(e=n[1],t=n[2],n=[n[0]]):4===n.length&&(e=n[2],t=n[3],n=[n[0],n[1]]);var r=t;return n.push((function(t,n,s,o,i,a,c){r=e(r,t,n,s,o,i,a,c)})),this[o].apply(this,n),r}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t,n){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return!1;if(1===arguments.length)return ae(!0,this,r,n=e);if(2===arguments.length){e=""+e,n=t;var i=this._nodes.get(e);if(void 0===i)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return ce(!0,this.multi,"mixed"===r?this.type:r,s,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return le(!0,r,this.multi,s,a,t,n)}throw new V("Graph.".concat(o,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var i="some"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[i]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((function(e,n,r,s,o,i,a){return t(e,n,r,s,o,i,a)})),!!this[o].apply(this,e)};var a="every"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[a]=function(){var e=Array.prototype.slice.call(arguments),t=e.pop();return e.push((function(e,n,r,s,o,i,a){return!t(e,n,r,s,o,i,a)})),!this[o].apply(this,e)}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return $.empty();if(!arguments.length)return function(e,t){if(0===e.size)return $.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,s=e._edges.values();return new $((function(){for(var e,t;;){if((e=s.next()).done)return e;if(t=e.value,!n||t.undirected===r)break}return{value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected},done:!1}}))}(this,r);if(1===arguments.length){e=""+e;var n=this._nodes.get(e);if(!n)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){var r=$.empty();return"undirected"!==e&&("out"!==t&&void 0!==n.in&&(r=J(r,re(n.in))),"in"!==t&&void 0!==n.out&&(r=J(r,re(n.out,t?void 0:n.key)))),"directed"!==e&&void 0!==n.undirected&&(r=J(r,re(n.undirected))),r}(r,s,n)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(o,': could not find the "').concat(t,'" target node in the graph.'));return function(e,t,n,r){var s=$.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(s=J(s,ie(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(t||n.key!==r)&&(s=J(s,ie(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(s=J(s,ie(n.undirected,r))),s}(r,s,i,t)}throw new V("Graph.".concat(o,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(e,t)}))}(Pe),function(e){ue.forEach((function(t){(function(e,t){var n=t.name,r=t.type,s=t.direction;e.prototype[n]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return[];e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return Object.keys(n.undirected);if("string"==typeof t)return Object.keys(n[t])}var r=[];return pe(!1,e,t,n,(function(e){r.push(e)})),r}("mixed"===r?this.type:r,s,t)}})(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[o]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));pe(!1,"mixed"===r?this.type:r,s,n,t)}};var i="map"+n[0].toUpperCase()+n.slice(1);e.prototype[i]=function(e,t){var n=[];return this[o](e,(function(e,r){n.push(t(e,r))})),n};var a="filter"+n[0].toUpperCase()+n.slice(1);e.prototype[a]=function(e,t){var n=[];return this[o](e,(function(e,r){t(e,r)&&n.push(e)})),n};var c="reduce"+n[0].toUpperCase()+n.slice(1);e.prototype[c]=function(e,t,n){if(arguments.length<3)throw new V("Graph.".concat(c,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var r=n;return this[o](e,(function(e,n){r=t(r,e,n)})),r}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o=n[0].toUpperCase()+n.slice(1,-1),i="find"+o;e.prototype[i]=function(e,t){if("mixed"===r||"mixed"===this.type||r===this.type){e=""+e;var n=this._nodes.get(e);if(void 0===n)throw new U("Graph.".concat(i,': could not find the "').concat(e,'" node in the graph.'));return pe(!0,"mixed"===r?this.type:r,s,n,t)}};var a="some"+o;e.prototype[a]=function(e,t){return!!this[i](e,t)};var c="every"+o;e.prototype[c]=function(e,t){return!this[i](e,(function(e,n){return!t(e,n)}))}}(e,t),function(e,t){var n=t.name,r=t.type,s=t.direction,o=n.slice(0,-1)+"Entries";e.prototype[o]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return $.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new U("Graph.".concat(o,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){if("mixed"!==e){if("undirected"===e)return me(null,n,n.undirected);if("string"==typeof t)return me(null,n,n[t])}var r=$.empty(),s=new de;return"undirected"!==e&&("out"!==t&&(r=J(r,me(s,n,n.in))),"in"!==t&&(r=J(r,me(s,n,n.out)))),"directed"!==e&&(r=J(r,me(s,n,n.undirected))),r}("mixed"===r?this.type:r,s,t)}}(e,t)}))}(Pe);var Ne=function(e){function n(t){var n=a({type:"directed"},t);if("multi"in n&&!1!==n.multi)throw new V("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("directed"!==n.type)throw new V('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Me=function(e){function n(t){var n=a({type:"undirected"},t);if("multi"in n&&!1!==n.multi)throw new V("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if("undirected"!==n.type)throw new V('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),xe=function(e){function n(t){var n=a({multi:!0},t);if("multi"in n&&!0!==n.multi)throw new V("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return e.call(this,n)||this}return t(n,e),n}(Pe),$e=function(e){function n(t){var n=a({type:"directed",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new V("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("directed"!==n.type)throw new V('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe),Le=function(e){function n(t){var n=a({type:"undirected",multi:!0},t);if("multi"in n&&!0!==n.multi)throw new V("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if("undirected"!==n.type)throw new V('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');return e.call(this,n)||this}return t(n,e),n}(Pe);function Ie(e){e.from=function(t,n){var r=a({},t.options,n),s=new e(r);return s.import(t),s}}return Ie(Pe),Ie(Ne),Ie(Me),Ie(xe),Ie($e),Ie(Le),Pe.Graph=Pe,Pe.DirectedGraph=Ne,Pe.UndirectedGraph=Me,Pe.MultiGraph=xe,Pe.MultiDirectedGraph=$e,Pe.MultiUndirectedGraph=Le,Pe.InvalidArgumentsGraphError=V,Pe.NotFoundGraphError=U,Pe.UsageGraphError=Y,Pe}()},944:(e,t)=>{"use strict";t.Vb=void 0,t.Vb=function(e,t,n){var r=function(e,t,n){if(0===e.length||0===t.length)return 0;if(n&&!n.caseSensitive&&(e=e.toUpperCase(),t=t.toUpperCase()),e===t)return 1;for(var r=0,s=e.length,o=t.length,i=Math.floor(Math.max(s,o)/2)-1,a=new Array(s),c=new Array(o),l=0;l<s;l++)for(var u=Math.max(0,l-i);u<=Math.min(o,l+i+1);u++)if(!a[l]&&!c[u]&&e[l]===t[u]){++r,a[l]=c[u]=!0;break}if(0===r)return 0;var d=0,h=0;for(l=0;l<s;l++)if(a[l]){for(;!c[h];)h++;e.charAt(l)!==t.charAt(h++)&&d++}return(r/s+r/o+(r-(d/=2))/r)/3}(e,t,n),s=0;if(r>.7){for(var o=Math.min(e.length,t.length),i=0;e[i]===t[i]&&i<4&&i<o;)++s,i++;r+=.1*s*(1-r)}return r}},7106:e=>{"use strict";var t=e.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),n(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function n(e,r,s,o,i,a,c,l,u,d){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var h in r(o,i,a,c,l,u,d),o){var p=o[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var m=0;m<p.length;m++)n(e,r,s,p[m],i+"/"+h+"/"+m,a,i,h,o,m)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var f in p)n(e,r,s,p[f],i+"/"+h+"/"+f.replace(/~/g,"~0").replace(/\//g,"~1"),a,i,h,o,f)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&n(e,r,s,p,i+"/"+h,a,i,h,o)}s(o,i,a,c,l,u,d)}}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},5072:e=>{"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var o={},i=[],a=0;a<e.length;a++){var c=e[a],l=r.base?c[0]+r.base:c[0],u=o[l]||0,d="".concat(l," ").concat(u);o[l]=u+1;var h=n(d),p={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==h)t[h].references++,t[h].updater(p);else{var m=s(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:m,references:1})}i.push(d)}return i}function s(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var o=r(e=e||[],s=s||{});return function(e){e=e||[];for(var i=0;i<o.length;i++){var a=n(o[i]);t[a].references--}for(var c=r(e,s),l=0;l<o.length;l++){var u=n(o[l]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=c}}},7659:e=>{"use strict";var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,s&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1407:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var r=n(4328),s=n(6082),o=n(439);const i=31;async function a(e,t,n=!1,o){const a=t.getSeqHandler(e);let l;o??=new Map;const u=a.isHelm()?t.getSeqMonomers(e):Object.keys(a.stats.freq).filter((e=>""!==e));for(let e=0;e<u.length;e++)o.has(u[e])||o.set(u[e],`${o.size+1}`);if(a.isHelm())l=await r.functions.call("HELM:getMolFiles",{col:e}),l=function(e,t,n=!1){const r=new Array(e.length);for(let s=0;s<e.length;s++){let o=0,a=0,c="\n Datagrok macromolecule handler\n\n 0 0 0 0 0 0 999 V3000\nM V30 BEGIN CTAB\n";const l=e.get(s);o=l.indexOf("\n",o)+1,o=l.indexOf("\n",o)+1,o=l.indexOf("\n",o)+1;const u=parseInt(l.substring(o,o+3)),d=parseInt(l.substring(o+3,o+6));c+=`M V30 COUNTS ${u} ${d} 0 0 0\n`,c+="M V30 BEGIN ATOM\n";for(let e=0;e<u;e++){o=l.indexOf("\n",o)+1+i,a=l.indexOf(" ",o);const r=l.substring(o,a);c+=n?`M V30 ${e+1} R${t.get(r)} 0.000 0.000 0 0\n`:`M V30 ${e+1} At 0.000 0.000 0 0 MASS=${t.get(r)}\n`}c+="M V30 END ATOM\n",c+="M V30 BEGIN BOND\n";for(let e=0;e<d;e++){o=l.indexOf("\n",o)+1;const t=parseInt(l.substring(o,o+3).trim()),n=parseInt(l.substring(o+3,o+6).trim());c+=`M V30 ${e+1} ${parseInt(l.substring(o+6,o+9).trim())} ${t} ${n}\n`}c+="M V30 END BOND\n",c+="M V30 END CTAB\n",c+="M END",r[s]=c}return r}(l,o,n);else{l=new Array(e.length);for(let t=0;t<e.length;t++){const e=c(a.getSplitted(t),o,n);l[t]=e}}return s.Column.fromStrings("monomericMols",l)}function c(e,t,n=!1){let r="\n Datagrok macromolecule handler\n\n 0 0 0 0 0 0 999 V3000\nM V30 BEGIN CTAB\n";r+=`M V30 COUNTS ${e.length} ${e.length?e.length-1:0} 0 0 0\n`,r+="M V30 BEGIN ATOM\n";for(let s=0;s<e.length;s++){const i=e.getCanonical(s);i!==o._S&&(r+=n?`M V30 ${s+1} R${t.get(i)} 0.000 0.000 0 0\n`:`M V30 ${s+1} At 0.000 0.000 0 0 MASS=${t.get(i)}\n`)}r+="M V30 END ATOM\n",r+="M V30 BEGIN BOND\n";for(let t=0;t<e.length-1;t++)r+=`M V30 ${t+1} 1 ${t+1} ${t+2}\n`;return r+="M V30 END BOND\n",r+="M V30 END CTAB\n",r+="M END",r}},4374:(e,t,n)=>{"use strict";n.d(t,{_package:()=>Ye,getMonomerLibHelper:()=>Be});var r,s,o=n(4328),i=n(7389),a=n(6082);n(684),n(9039),(s=r||(r={})).EUCLIDEAN="EUCLIDEAN",s.MANHATTAN="MANHATTAN";var c=n(1858),l=n(5072),u=n.n(l),d=n(7825),h=n.n(d),p=n(7659),m=n.n(p),f=n(5056),g=n.n(f),y=n(540),b=n.n(y),w=n(1113),v=n.n(w),A=n(7939),E={};E.styleTagTransform=v(),E.setAttributes=g(),E.insert=m().bind(null,"head"),E.domAPI=h(),E.insertStyleElement=b(),u()(A.A,E),A.A&&A.A.locals&&A.A.locals,Promise.resolve(),n(934),n(8903),a.SEMTYPE.MOLECULE,a.SEMTYPE.MACROMOLECULE;const T=rxjs.operators;n(6295);var C,S,_,P,N,M,x=n(8774);(_=C||(C={})).none="none",_.bold="bold",_.dashed="dashed",(P=S||(S={})).EUCLIDEAN="EUCLIDEAN",P.MANHATTAN="MANHATTAN",S.EUCLIDEAN,S.MANHATTAN,(M=N||(N={})).HAMMING="Hamming",M.EUCLIDEAN="Euclidean",M.MANHATTAN="Manhattan",M.TANIMOTO="Tanimoto",M.LEVENSTEIN="Levenshtein",M.NEEDLEMAN_WUNSCH="Needlemann-Wunsch",M.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance",M.SOKAL="Sokal",M.COSINE="Cosine",M.ASYMMETRIC="Asymmetric",M.Difference="Difference",M.OneHot="One-Hot",N.HAMMING,N.EUCLIDEAN,N.MANHATTAN,N.TANIMOTO,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.MONOMER_CHEMICAL_DISTANCE,N.SOKAL,N.COSINE,N.ASYMMETRIC,N.Difference,N.OneHot,N.HAMMING,N.EUCLIDEAN,N.MANHATTAN,N.TANIMOTO,N.SOKAL,N.COSINE,N.ASYMMETRIC,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.MONOMER_CHEMICAL_DISTANCE,N.Difference,N.OneHot,new Set([N.HAMMING,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.MONOMER_CHEMICAL_DISTANCE,N.OneHot]),new Set([N.HAMMING,N.EUCLIDEAN,N.MANHATTAN,N.MONOMER_CHEMICAL_DISTANCE,N.LEVENSTEIN,N.NEEDLEMAN_WUNSCH,N.TANIMOTO,N.COSINE,N.SOKAL,N.ASYMMETRIC,N.OneHot,N.Difference]),new Set([N.EUCLIDEAN,N.MANHATTAN,N.OneHot,N.Difference]),new Set([N.EUCLIDEAN,N.MANHATTAN,N.Difference]),new Set([N.EUCLIDEAN,N.MANHATTAN,N.Difference]),new Set([N.TANIMOTO,N.COSINE,N.SOKAL,N.ASYMMETRIC]);var $=n(1991),L=n.n($);new c.Subject;var I,R,O,k,G,D=n(2003),H=(n(3516),n(6718),n(3077),n(439));(R=I||(I={})).IDENTITY="identity",R.SIMILARITY="similarity",n(5540),function(e){e.ADD="ADD",e.SUB="SUB",e.MULT="MULT"}(O||(O={})),function(e){e.SQUARE="SQUARE",e.INVERSE="INVERSE",e.TRANSPOSE="TRANSPOSE",e.NORM="NORM",e.COLUMN_NORM="COLUMN_NORM"}(k||(k={})),function(e){e.SCALARMULT="SCALARMULT",e.SCALARADD="SCALARADD",e.SCALARPOW="SCALARPOW"}(G||(G={})),Object.prototype.toString,n(6873);var F=n(4356),V=(n(6717),n(4870),n(3856),n(6882),n(7278),n(310),n(6642)),U=n(3599);n(673),n(8312),V.sD,n(4139),D.zS,a.GridCellRenderer,a.GridCellRenderer,a.GridCellRenderer;var Y,B,W,j,K=n(8070),q=n(4326);!function(e){e.Unknown="unknown",e.FR="framework",e.CDR="cdr"}(Y||(Y={})),new class{constructor(){this.regionTypes=[Y.CDR],this.chains=["Heavy","Light"],this.skipEmptyPositions=!1,this.fitWidth=!1,this.positionWidth=16,this.positionHeight=q.fH.Entropy,this.filterSource=q.Fo.filterSource}},n(7602),n(8047),function(e){e.STYLE="Style",e.BEHAVIOR="Behavior",e.LAYOUT="Layout",e.DATA="Data"}(B||(B={})),function(e){e.skipEmptyPositions="skipEmptyPositions",e.regionTypes="regionTypes",e.chains="chains",e.fitWidth="fitWidth",e.positionWidth="positionWidth",e.positionHeight="positionHeight",e.filterSource="filterSource"}(W||(W={})),a.JsViewer,n(6863),n(2780),n(8115),a.JsViewer,n(1407),H.b9[H.Hi.FASTA],n(5433),n(3890),n(1687),function(e){e.TYPE="V2000",e[e.NUM_OF_HEADER_LINES=3]="NUM_OF_HEADER_LINES",e[e.NUM_OF_COUNTS_DIGITS=3]="NUM_OF_COUNTS_DIGITS",e[e.ATOM_TYPE_COL=4]="ATOM_TYPE_COL",e[e.FIRST_BONDED_ATOM_COL=1]="FIRST_BONDED_ATOM_COL",e[e.BOND_TYPE_COL=3]="BOND_TYPE_COL",e[e.RGP_SHIFT=8]="RGP_SHIFT",e[e.MAX_ATOM_COUNT=999]="MAX_ATOM_COUNT",e.RGP_LINE_START="M RGP",e.ATOM_ALIAS_LINE_START="A ",e.END="M END"}(j||(j={}));class z{constructor(e){this.init(e)}init(e){this.fileContent=e.replace(/\r/g,""),this._atomCount=void 0,this._atomTypes=void 0,this._bondCount=void 0,this._bondTypes=void 0,this.xyzAtomCoordinates=void 0,this._pairsOfBondedAtoms=void 0}get atomCount(){return void 0===this._atomCount&&this.setAtomAndBondCounts(),this._atomCount}get bondCount(){return void 0===this._bondCount&&this.setAtomAndBondCounts(),this._bondCount}get x(){var e;return null!==(e=this.xyzAtomCoordinates)&&void 0!==e||(this.xyzAtomCoordinates=this.parseAtomCoordinates()),this.xyzAtomCoordinates.x}get y(){var e;return null!==(e=this.xyzAtomCoordinates)&&void 0!==e||(this.xyzAtomCoordinates=this.parseAtomCoordinates()),this.xyzAtomCoordinates.y}get z(){var e;return null!==(e=this.xyzAtomCoordinates)&&void 0!==e||(this.xyzAtomCoordinates=this.parseAtomCoordinates()),this.xyzAtomCoordinates.z}get atomTypes(){var e;return null!==(e=this._atomTypes)&&void 0!==e||(this._atomTypes=this.parseAtomTypes()),this._atomTypes}get pairsOfBondedAtoms(){var e;return null!==(e=this._pairsOfBondedAtoms)&&void 0!==e||(this._pairsOfBondedAtoms=this.parseBondedAtomPairs()),this._pairsOfBondedAtoms}get bondTypes(){var e;return null!==(e=this._bondTypes)&&void 0!==e||(this._bondTypes=this.parseBondTypes()),this._bondTypes}setAtomAndBondCounts(){const{atomCount:e,bondCount:t}=this.parseAtomAndBondCounts();this._atomCount=e,this._bondCount=t}getNextColumnIdx(e){for(;!this.isWhitespace(e);)++e;for(;this.isWhitespace(e);)++e;return e}shiftIdxToSpecifiedColumn(e,t){let n=e;const r=this.isWhitespace(n)?t:t-1;for(let e=0;e<r;e++)n=this.getNextColumnIdx(n);return n}parseAtomTypes(){const e=this.atomCount,t=new Array(e);let n=this.getAtomBlockIdx();for(let r=0;r<e;r++)n=this.shiftIdxToAtomType(n),t[r]=this.parseAtomType(n),n=this.getNextLineIdx(n);return t}parseAtomCoordinates(){const e=new Float32Array(this.atomCount),t=new Float32Array(this.atomCount),n=new Float32Array(this.atomCount);let r=this.getAtomBlockIdx();for(let s=0;s<this.atomCount;s++){r=this.shiftIdxToXColumn(r);for(const o of[e,t,n])o[s]=this.parseFloatValue(r),r=this.getNextColumnIdx(r);r=this.getNextLineIdx(r)}return{x:e,y:t,z:n}}parseBondedAtomPairs(){const e=new Array(this.bondCount);let t=this.getBondBlockIdx();for(let n=0;n<this.bondCount;n++){t=this.shiftIdxToBondedAtomsPair(t);const r=new Uint16Array(2);r[0]=this.parseIntValue(t),t=this.getNextColumnIdx(t),r[1]=this.parseIntValue(t),e[n]=r,t=this.getNextLineIdx(t)}return e}parseBondTypes(){const e=this.bondCount,t=new Uint16Array(e);let n=this.getBondBlockIdx();for(let r=0;r<e;r++)n=this.shiftIdxToBondType(n),t[r]=this.parseIntValue(n),n=this.getNextLineIdx(n);return t}isWhitespace(e){const t=this.fileContent[e];return" "===t||"\t"===t}getNextLineIdx(e){return"\n"!==this.fileContent[e]?this.fileContent.indexOf("\n",e)+1:e+1}parseFloatValue(e){return this.parseNumericValue(parseFloat,e)}parseIntValue(e){return this.parseNumericValue(parseInt,e)}parseNumericValue(e,t){let n=t+1;for(;!this.isWhitespace(n);)++n;return e(this.fileContent.substring(t,n))}}class Z extends z{constructor(e){super(e),this.init(e)}init(e){super.init(e)}parseAtomType(e){let t=e,n=t;return this.isQuote(t)?(n=this.getNextIdenticalChar(t),t++):n=this.fileContent.indexOf(" ",n),this.fileContent.substring(t,n)}isQuote(e){const t=this.fileContent[e].charCodeAt(0);return 39===t||34===t}getNextIdenticalChar(e){const t=this.fileContent[e];return t?this.fileContent.indexOf(t,e+1):-1}isQuery(){return this.isQueryOrFragment(((e,t)=>{return 39===e||34===e||76===e&&!((n=this.fileContent.charCodeAt(t+1))>64&&n<91||n>96&&n<123);var n}))}isFragment(){return this.isQueryOrFragment((e=>82===e||42===e))}isQueryOrFragment(e){const t=this.atomCount;let n=this.getAtomBlockIdx();for(let r=0;r<t;r++){if(n=this.shiftIdxToAtomType(n),e(this.fileContent.charCodeAt(n),n))return!0;n=this.getNextLineIdx(n)}return!1}}class X extends Z{constructor(e){super(e)}getAtomLines(){const e=this.getAtomBlockIdx(),t=this.getBondBlockIdx();return this.fileContent.substring(e,t).split("\n").slice(0,this.atomCount)}getBondLines(){const e=this.getBondBlockIdx();return this.fileContent.substring(e).split("\n").slice(0,this.bondCount)}getRGroupIdToAtomicIdxMap(){const e=new Map,t=this.fileContent.split("\n");t.filter((e=>e.startsWith(j.RGP_LINE_START))).forEach((t=>{const n=this.getAtomIdxToRgpIdxList(t);for(const[t,r]of n){if(e.has(t))throw new Error(`R group ${t} is already in the map`);e.set(t,r)}}));const n=t.map(((e,t)=>{if(e.startsWith(j.ATOM_ALIAS_LINE_START))return t})).filter((e=>void 0!==e)),r=n.map((e=>t[e])),s=n.map((e=>t[e+1]));r.forEach(((t,n)=>{const r=parseInt(t.split(/\s+/)[1])-1,o=parseInt(s[n].substring(1));if(e.has(o))throw new Error(`R group ${o} is already in the map`);e.set(o,r)}));const o=this.getRGroupAtomicIndices().filter((t=>!Array.from(e.values()).includes(t)));if(0!==o.length)throw new Error(`Unaccounted R group indices: ${o}`);return e}getAtomIdxToRgpIdxList(e){const t=e.split(/\s+/).filter((e=>e)).slice(3).map((e=>parseInt(e))),n=new Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=[t[e+1],t[e]-1];return n}getRGroupAtomicIndices(){return this.atomTypes.map(((e,t)=>{if(e.includes("R#"))return t})).filter((e=>void 0!==e))}static isValidMolfile(e){return-1!==e.indexOf(j.TYPE)&&-1!==e.indexOf(j.END)}shiftIdxToAtomType(e){return this.shiftIdxToSpecifiedColumn(e,j.ATOM_TYPE_COL)}getCountsLineIdx(){let e=0;for(let t=0;t<j.NUM_OF_HEADER_LINES;++t)e=this.getNextLineIdx(e);return e}getAtomBlockIdx(){let e=this.getCountsLineIdx();return e=this.getNextLineIdx(e),e}shiftIdxToXColumn(e){return this.getNextColumnIdx(e)}shiftIdxToBondedAtomsPair(e){return this.shiftIdxToSpecifiedColumn(e,j.FIRST_BONDED_ATOM_COL)}shiftIdxToBondType(e){return this.shiftIdxToSpecifiedColumn(e,j.BOND_TYPE_COL)}getBondBlockIdx(){let e=this.getAtomBlockIdx();for(let t=0;t<this.atomCount;t++)e=this.getNextLineIdx(e);return e}parseAtomAndBondCounts(){let e=this.getCountsLineIdx(),t=e+j.NUM_OF_COUNTS_DIGITS;const n=parseInt(this.fileContent.substring(e,t));return e=t,t+=j.NUM_OF_COUNTS_DIGITS,{atomCount:n,bondCount:parseInt(this.fileContent.substring(e,t))}}}class Q extends Z{constructor(e){super(e),this.init(e)}getAtomLines(){const e=this.getAtomBlockIdx(),t=this.getBondBlockIdx();return this.fileContent.substring(e,t).split("\n").slice(0,this.atomCount)}getBondLines(){const e=this.getBondBlockIdx();return this.fileContent.substring(e).split("\n").slice(0,this.bondCount)}getRGroupIdToAtomicIdxMap(){const e=new Map;return this.getAtomLines().forEach(((t,n)=>{const r=t.match(/RGROUPS=\(([\d\s]+)\)/);if(r){const t=r[1].split(/\s+/).map((e=>parseInt(e)));if(t.length>2)throw new Error(`R group data ${t} has more than 2 elements`);const s=t[1];if(e.has(s))throw new Error(`R group ${s} is already in the map`);e.set(s,n)}})),e}shiftIdxToAtomType(e){return this.shiftIdxToSpecifiedColumn(e,4)}getCountsLineIdx(){return this.fileContent.indexOf("M V30 COUNTS ")}getAtomBlockIdx(){let e=this.fileContent.indexOf("M V30 BEGIN ATOM");return e=this.getNextLineIdx(e),e}shiftIdxToXColumn(e){let t=this.shiftIdxToAtomType(e);return this.isQuote(t)?(t=this.getNextIdenticalChar(t),t=this.getNextColumnIdx(t),t):this.shiftIdxToSpecifiedColumn(e,5)}shiftIdxToBondedAtomsPair(e){return this.shiftIdxToSpecifiedColumn(e,5)}shiftIdxToBondType(e){return this.shiftIdxToSpecifiedColumn(e,4)}getBondBlockIdx(){return this.getNextLineIdx(this.fileContent.indexOf("M V30 BEGIN BOND"))}static isValidMolfile(e){return-1!==e.indexOf("V3000")&&-1!==e.indexOf("M END")}parseAtomAndBondCounts(){let e=this.fileContent.indexOf("M V30 COUNTS ")+14,t=this.fileContent.indexOf(" ",e+1);const n=parseInt(this.fileContent.substring(e,t));return e=t+1,t=this.fileContent.indexOf(" ",e+1),{atomCount:n,bondCount:parseInt(this.fileContent.substring(e,t))}}}class J{constructor(){}static getInstance(e){if(J.isMolfileV2K(e))return new X(e);if(J.isMolfileV3K(e))return new Q(e);throw new Error("Malformed molfile")}static isMolfileV2K(e){return X.isValidMolfile(e)}static isMolfileV3K(e){return Q.isValidMolfile(e)}}var ee=n(6197),te=n(9124),ne=n(3527),re=n(3629);class se{biotype;id;n;m;type;mt;smiles;get issmiles(){return!!this.smiles}at={R1:"H",R2:"H",R3:"H",R4:"H",R5:"H",R6:"H",R7:"H",R8:"H",R9:"H"};get rs(){return Object.keys(this.at).length}constructor(e,t,n="missing",r=void 0,s=void 0,o=void 0,i){if(this.biotype=e,this.id=t,this.n=n,this.m=r,this.type=s,this.mt=o,this.smiles=i,!this.id)throw new Error("Invalid arg undefined [id].")}static objCounter=-1;objId=++se.objCounter;className="WebEditorMonomerDummy";toLog(){return`Helm: ${this.className}<${this.objId}>`}}class oe extends se{backgroundcolor="#FFFFFF";linecolor="#808080";textcolor="#808080";constructor(e){super(e,"*","gap")}}class ie extends se{backgroundcolor="#808080";linecolor="#000000";textcolor="#000000";constructor(e,t){super(e,t,"ambiguous")}}class ae extends se{backgroundcolor="#FF4444";linecolor="#800000";textcolor="#FFFFFF";constructor(e,t,n){super(e,t,"missing"),n&&(this.backgroundcolor="#C0C0C0",this.linecolor="#404040",this.textcolor="#404040")}}class ce extends se{backgroundcolor="#FFFF44";linecolor="#800000";textcolor="#000000";constructor(e,t){super(e,t,"broken")}}class le{id;m;n;na;type;mt;at;smiles;get rs(){return Object.keys(this.at).length}get issmiles(){return!!this.smiles}linecolor;backgroundcolor;textcolor;constructor(e,t,n,r,s,o,i,a){this.id=e,this.m=t,this.n=n,this.na=r,this.type=s,this.mt=o,this.at=i,this.smiles=a}static fromMonomer(e,t,n){let r={};const s=t.symbol,o=t.smiles;if(t.rgroups.length>0)t.rgroups.forEach((e=>{r[e.label]=e.capGroupName}));else{if(!o){if(t.lib)return new ce(e,s);throw new Error("Unexpected missing monomer without .lib")}r=n.getRS(o)}const i=new le(t.symbol,t.molfile,t.name,t.naturalAnalog,t.polymerType,t.monomerType,r),a=n.getMonomerColors(e,t.symbol);return a&&(i.textcolor=a?.textcolor,i.linecolor=a?.linecolor,i.backgroundcolor=a?.backgroundcolor),i}}const ue={[U.o.BASE]:{A:"#20E040",G:"#040404",T:"#FF8080",C:"#2060FF",U:"#FF8080"},[U.o.NUCLEOTIDE]:{A:"#20E040",G:"#040404",T:"#FF8080",C:"#2060FF",U:"#FF8080"},[U.o.LINKER]:{P:"#9aa5e1",p:"#9aa5e1"},[U.o.SUGAR]:{R:"#7a85c1",r:"#7a85c1"},[U.o.AA]:{A:"rgb(44,160,44)",R:"rgb(23,190,207)",N:"rgb(235,137,70)",D:"rgb(31,119,180)",C:"rgb(188,189,34)",E:"rgb(31, 120, 150)",Q:"rgb(205, 111, 71)",G:"rgb(214,39,40)",H:"rgb(158,218,229)",I:"rgb(23,103,57)",L:"rgb(30,110,96)",K:"rgb(108, 218, 229)",M:"rgb(60,131,95)",F:"rgb(24,110,79)",P:"rgb(255,152,150)",S:"rgb(255,187,120)",T:"rgb(245,167,100)",W:"rgb(182, 223, 138)",Y:"rgb(152,223,138)",V:"rgb(74,160,74)"},[U.o.CHEM]:{R:"#eeeeee"},[U.o.BLOB]:{B:"#999999",G:"#e2e2e2"}},de=/[\w()]+/,he=RegExp(String.raw`\(${de}(,${de})+\)`),pe=new ne.Mi([255,255,255]),me=new ne.Mi([0,0,0]),fe=.7*(0,re.wQ)(pe);class ge{_monomers;source;_isEmpty;get isEmpty(){return this._isEmpty}_onChanged=new c.Subject;get onChanged(){return this._onChanged}constructor(e,t){this._monomers=e,this.source=t,this._isEmpty=!this._monomers||0===Object.keys(this._monomers).length||Object.entries(this._monomers).every((([e,t])=>0===Object.keys(t).length))}getMonomerSymbolsByType(e){return Object.keys(this._monomers[e])}addMissingMonomer(e,t){let n=this._monomers[e];n||(n=this._monomers[e]={});let r=t;return t==H._S||t===H.b9[H.Hi.HELM]?r="Gap":("PEPTIDE"===e&&"X"===t||"RNA"===e&&"N"===t)&&(r="Any"),n[t]={symbol:t,name:r,molfile:"",author:"MISSING",id:-1,rgroups:L().count(1).take(9).map((e=>({capGroupSmiles:"",alternateId:"",capGroupName:"",label:`R${e.toString()}`}))).toArray(),smiles:"",polymerType:e,monomerType:void 0,createDate:null}}getMonomer(e,t){let n=t;"RNA"==e&&"R"==n&&(n="r"),"RNA"==e&&"P"==n&&(n="p");let r=null;if(e){const t=this._monomers[e];r=t?t[n]:null}else{Ye.logger.warning(`Bio: MonomerLib.getMonomer() symbol '${t}', polymerType not specified.`);for(const[e,t]of Object.entries(this._monomers))if(r=t[n],r)break}return r}getWebEditorMonomer(e,t){const[n,r]=(0,te.fA)(e,t),s=(0,ee.Y)(n);let o=this.getMonomer(s,r);if(o&&n==U.o.LINKER&&2!=o.rgroups.length)return null;if(o&&n==U.o.SUGAR&&3!=o.rgroups.length)return null;o||(o=this.addMissingMonomer(s,r));let i=o.wem??null;return i||(r===H._S||"*"==r?i=o.wem=new oe(n):n===U.o.NUCLEOTIDE&&"N"===r||n===U.o.AA&&"X"===r||(U.o.CHEM,0)||he.test(r)?i=o.wem=new ie(n,r):o.lib||(i=o.wem=new ae(n,r,this.isEmpty)),i||(i=o.wem=le.fromMonomer(n,o,this))),i}getTooltip(e,t){const n=(0,ee.Y)(e),r=i.div([],{classes:"ui-form ui-tooltip"}),s=this.getMonomer(n,t);if(s){const n=s.symbol,a=(s.name,this.getWebEditorMonomer(e,t));a.backgroundcolor,r.append(i.divH([i.div([n],{style:{textWrap:"nowrap",marginLeft:"4px",marginRight:"4px",color:a.textcolor,backgroundColor:a.backgroundcolor,borderColor:a.linecolor,borderWidth:"1px",borderStyle:"solid",borderRadius:"2px",padding:"3px",minWidth:"24px",textAlign:"center"}}),i.div([s.name],{style:{padding:"4px"}})],{style:{display:"flex",flexDirection:"row",justifyContent:"left"}}));const c={autoCrop:!0,autoCropMargin:0,suppressChiralText:!0};let l;l=s.molfile?o.chem.svgMol(s.molfile,void 0,void 0,c):s.smiles?i.divV([o.chem.svgMol(s.smiles,void 0,void 0,c),i.divText("from smiles",{style:{fontSize:"smaller"}})]):i.divText("No structure",{style:{margin:"6px"}}),r.append(i.div(l,{style:{display:"flex",flexDirection:"row",justifyContent:"center",margin:"6px"}})),s.symbol!=H._S&&r.append(i.divText(s.lib?.source??"Missed in libraries"))}else r.append(i.divV([i.divText(`Monomer '${t}' of type '${n}' not found.`),i.divText("Open the Context Panel, then expand Manage Libraries")]));return r}getMonomerTextColor(e,t){const n=this.getMonomerColors(e,t),r=e=>{const t=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(t)return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])];const n=a.Color.fromHtml(e);return[a.Color.r(n),a.Color.g(n),a.Color.b(n)]},s=r(n.textcolor),o=new ne.Mi([...s.map((e=>e+1))]),i=(0,re.KE)(o,pe)/((0,re.wQ)(o)*(0,re.wQ)(pe)),c=r(n.backgroundcolor),l=new ne.Mi([...c.map((e=>e+.01))]);let u;u=(0,re.KE)(l,pe)/((0,re.wQ)(l)*(0,re.wQ)(pe))<i?c:s;let d=new ne.Mi(u);const h=(0,re.wQ)(d);return h>fe&&(d=(0,re.dC)(me,d,fe/h)),`rgb(${d[0]}, ${d[1]}, ${d[2]})`}getMonomerColors(e,t){const n="default";let r=n;const s=(0,ee.Y)(e),o=this.getMonomer(s,t);let i;if(o){if(o.meta&&o.meta.colors){const e=o.meta.colors;n in e||(r="default"),i=e[r]}if(!i){const t=ue[e],n=t?.[o.symbol];n&&(i={textColor:a.Color.toHtml(a.Color.getContrastColor(a.Color.fromHtml(n))),lineColor:"#202020",backgroundColor:n})}const t=o.naturalAnalog;if(!i&&t)return this.getMonomerColors(e,t)}return i||(i={textColor:"#202020",lineColor:"#202020",backgroundColor:"#A0A0A0"}),{textcolor:i.text??i.textColor,linecolor:i.line??i.lineColor,backgroundcolor:i.background??i.backgroundColor}}getRS(e){const t=e.match(/(?<=\[)[^\][]*(?=])/gm),n={};let r,s="";if(t)for(let e=0;e<t.length;e++)if(null!=t[e]&&/\d/.test(t[e])){r=t[e][t[e].length-1],t[e]=t[e].replace(/[0-9]/g,"");for(let n=0;n<t[e].length;n++)":"!=t[e][n]&&(s+=t[e][n]);n["R"+r]=s,s=""}return n}}var ye=n(5488),be={};be.styleTagTransform=v(),be.setAttributes=g(),be.insert=m().bind(null,"head"),be.domAPI=h(),be.insertStyleElement=b(),u()(ye.A,be),ye.A&&ye.A.locals&&ye.A.locals;class we extends ge{error;_duplicateMonomers={};get duplicateMonomers(){return this._duplicateMonomers}_duplicatesHandled=!0;get duplicatesHandled(){return this._duplicatesHandled}duplicatesNotified=!1;constructor(e,t,n=void 0){super(e,t),this.error=n;for(const[e,t]of Object.entries(this._monomers))for(const[e,n]of Object.entries(t))n.lib=this}toJSON(){const e=[];for(const t of Object.values(this._monomers))for(const n of Object.values(t))e.push({...n,lib:void 0,wem:void 0});return e}getMonomer(e,t){let n=t;"RNA"==e&&"R"==n&&(n="r"),"RNA"==e&&"P"==n&&(n="p");let r=null;if(e){const t=this._monomers[e];r=t?.[n]??null}else{Ye.logger.warning(`Bio: MonomerLib.getMonomer() symbol '${t}', polymerType not specified.`);for(const[e,t]of Object.entries(this._monomers))if(r=t[n],r)break}return r}_monomerSets=null;getMonomerSet(e){const t=(0,ee.Y)(e);if(this._monomerSets||(this._monomerSets={}),!(e in this._monomerSets))for(const[e,n]of Object.entries(this._monomers[t]));return this._monomerSets[e]}getPolymerTypes(){return Object.keys(this._monomers)}getMonomerMolsByPolymerType(e){const t={};return Object.keys(this._monomers[e]??{}).forEach((n=>{t[n]=this._monomers[e][n].molfile})),t}getMonomerSymbolsByRGroup(e,t,n){let r=this.getMonomerSymbolsByType(t).map((e=>this.getMonomer(t,e)));return r=r.filter((e=>null!==e)),0===r.length?[]:(r=r.filter((t=>{if(!t?.rgroups)return!1;let n=t?.rgroups.length>=e;var r;return r=J.getInstance(t.molfile).atomTypes,r.map(((e,t)=>"R#"===e?t:-1)).filter((e=>-1!==e)),n&&=!0,n})),r.map((e=>e?.symbol)))}_updateLibInt(e){const t=e.getPolymerTypes(),n=this.getPolymerTypes();t.forEach((t=>{n.includes(t)||(this._monomers[t]={}),e.getMonomerSymbolsByType(t).forEach((n=>{this._monomers[t][n]&&(this._duplicateMonomers[t]??={},this._duplicateMonomers[t][n]??=[this._monomers[t][n]],this._duplicateMonomers[t][n].push(e.getMonomer(t,n))),this._monomers[t][n]=e.getMonomer(t,n)}))})),this._isEmpty=this.isEmpty&&e.isEmpty}updateLibs(e,t=!1){t&&(this._monomers={},this._isEmpty=!0),this._duplicateMonomers={};for(const t of e)t.error||this._updateLibInt(t);Object.entries(this.duplicateMonomers).length>0?(0,F.ub)().then((e=>{this.assignDuplicatePreferences(e)})):this._duplicatesHandled=!0,this._onChanged.next()}assignDuplicatePreferences(e){let t=!0;for(const n in this.duplicateMonomers)for(const r in this.duplicateMonomers[n])if(e.duplicateMonomerPreferences?.[n]?.[r]){const s=e.duplicateMonomerPreferences[n][r],o=this.duplicateMonomers[n][r].find((e=>e.lib?.source===s));o?this._monomers[n][r]=o:t=!1}else t=!1;return this._duplicatesHandled=t,t}clear(){this._monomers={},this._onChanged.next()}getSummaryObj(){const e={},t=this.getPolymerTypes();for(const n of t)e[n]=this.getMonomerSymbolsByType(n).length;return e}getSummaryDf(){const e=this.getPolymerTypes(),t=new Array(e.length);for(const[n,r]of L().enumerate(e))t[r]=this.getMonomerSymbolsByType(n).length;return a.DataFrame.fromColumns([a.Column.fromStrings("polymerType",e),a.Column.fromList(a.COLUMN_TYPE.INT,"count",t)])}getSummary(){const e=this.getPolymerTypes();return 0==e.length?"empty":e.map((e=>`${e} ${this.getMonomerSymbolsByType(e).length}`)).join("\n")}override(e,t){return new ve(e,t,this)}}class ve extends ge{data;base;constructor(e,t,n){super(e,t),this.data=e,this.base=n}get onChanged(){return this.base.onChanged}getMonomerSymbolsByType(e){const t=this.base.getMonomerSymbolsByType(e);for(const n of Object.keys(this.data[e]??{}))t.includes(n)||t.push(n);return t}addMissingMonomer(e,t){return this.base.addMissingMonomer(e,t)}getMonomer(e,t){const n=this.data[e]?.[t];return n??this.base.getMonomer(e,t)}}var Ae=n(9192);class Ee{monomerLib;symbol;polymerType;monomerType;monomerLinks;monomers;error=null;constructor(e,t,n,r,s){this.monomerLib=e,this.symbol=t,this.polymerType=n,this.monomerType=r,this.monomerLinks=s;try{this.monomers=this.monomerLinks.map((e=>{const n=this.monomerLib.getMonomer(this.polymerType,e.symbol);if(!n)throw new Error("Monomer not found: ");if(n.lib?.source!=e.source)throw new Error(`Monomer '${t}' found in different library.`);return n}))}catch(e){const[t,n]=(0,Ae.AP)(e);this.error=t,this.monomers=[]}}}class Te{description;placeholders;source;error;constructor(e,t,n=void 0,r=void 0){this.description=e,this.placeholders=t,this.source=n,this.error=r}updateSets(e,t=!1){t&&(this.placeholders=[]);for(const t of e)t.error||this._updateSetInt(t)}_updateSetInt(e){for(const t of e.placeholders)this.placeholders.push(t)}}var Ce=n(7433),Se=n.n(Ce),_e=n(1913),Pe=n.n(_e);class Ne{helmMonomerSchema;validateMonomerSchema;constructor(e){this.helmMonomerSchema=e;const t=new(Se())({allErrors:!0,strictTuples:!1,allowUnionTypes:!0});Pe()(t),this.validateMonomerSchema=t.compile(this.helmMonomerSchema)}validateFile(e,t){const n=this.parseJson(e,t);return null!==n&&(Array.isArray(n)?this.validateJsonContent(n,t):(console.warn(`Bio: Monomer Library File Validator file '${t}': Invalid JSON format: The file must contain an array of monomers.`),!1))}parseJson(e,t){try{return JSON.parse(e)}catch(e){return console.error(`Bio: Monomer Library File Validator file '${t}': Invalid JSON format:`,e),null}}validateJsonContent(e,t){let n=!0;const r=new Set;for(const s of e){const e=s.symbol??s.id??s.name??"#N/A";if(n=this.validateMonomerSchema(s),!n){console.warn(`Bio: Monomer Library File Validator file ${t}, monomer '${e}' violating JSON schema:`,s,"\nError reason: ",this.validateMonomerSchema.errors,`\nThere may be other errors in ${t} since the validation is stopped after the first error.`," Please, verify that the monomer library file satisfies the JSON schema");break}const o=`${s.polymerType??""}-${e}`;r.has(o)&&console.warn(`Bio: Monomer Library File Validator file ${t}, monomer '${e}' is duplicated.`,"Please, verify that the monomer library file does not contain duplicated monomer symbols."),r.add(o)}return n}}var Me=n(8604);class xe{fileValidator;libHelper;eventManager;logger;filesPromise=Promise.resolve();constructor(e,t,n,r){this.fileValidator=e,this.libHelper=t,this.eventManager=n,this.logger=r,this.eventManager.updateValidLibraryFileListRequested$.subscribe((()=>{this.updateValidLibList().then((()=>{}))})),this.eventManager.updateValidSetFileListRequested$.subscribe((()=>{this.updateValidSetList().then((()=>{}))}))}static objCounter=-1;objId=++xe.objCounter;toLog(){return`MonomerLibFileManager<${this.objId}>`}static async create(e,t,n){const r=await o.dapi.files.readAsText(Me.gt),s=JSON.parse(r),i=new Ne(s);return new xe(i,e,t,n)}async addLibraryFile(e,t,n=!0){try{if(await o.dapi.files.exists(Me.so+`${t}`))return void o.shell.error(`File ${t} already exists`);await this.validateAgainstHELM(e,t),await o.dapi.files.writeAsText(Me.so+`${t}`,e),await this.updateValidLibList(),await o.dapi.files.exists(Me.so+`${t}`)?o.shell.info(`Added ${t} HELM library`):o.shell.error(`Failed to add ${t} library`)}catch(e){console.error(e),o.shell.error(`Failed to add ${t} library`)}}async deleteLibraryFile(e){try{await o.dapi.files.delete(Me.so+`${e}`),await this.updateValidLibList(),o.shell.info(`Deleted ${e} library`)}catch(t){console.error(t),await o.dapi.files.exists(Me.so+`${e}`)?o.shell.error(`Failed to delete ${e} library`):o.shell.warning(`File ${e} already deleted, refresh the list`)}}async loadLibraryFromFile(e,t){let n=[];const r=new a.FileSource(e),s=await r.readAsText(t);n=JSON.parse(s);const o={},i=[];return n.forEach((e=>{const t=e.polymerType,n=e.symbol;i.includes(t)||(o[t]={},i.push(t)),o[t][n]=e})),new we(o,t)}async loadSetFromFile(e,t,n){let r={};const s=new a.FileSource(t),o=await s.readAsText(n);r=JSON.parse(o);const i=r.description,c=Object.entries(r.placeholders).map((([t,n])=>{const r=t,s=n.polymerType,o=n.monomerType,i=n.set;return new Ee(e,r,s,o,i)}));return new Te(i,c)}getValidLibraryPaths(){return this.eventManager.getValidLibPathList()}getValidSetPaths(){return this.eventManager.getValidSetPathList()}async getValidLibraryPathsAsynchronously(){return await this.eventManager.getValidLibraryPathsAsynchronously()}async updateValidLibList(){const e=`${this.toLog()}.updateValidLibList()`;return this.logger.debug(`${e}, start`),this.filesPromise=this.filesPromise.then((async()=>{this.logger.debug(`${e}, IN`);const t=[],n=await this.getLibFileListAtLocation();if(!this.libListHasChanged(n))return void this.logger.debug(`${e}, end, not changed`);for(const e of n){if(!e.endsWith(".json")){t.push(e);continue}const n=await o.dapi.files.readAsText(Me.so+`${e}`);this.isValidHELMLibrary(n,e)||t.push(e)}const r=n.filter((e=>!t.includes(e)));if(this.libListHasChanged(r)&&(this.eventManager.changeValidLibPathList(r),this.libHelper.loadMonomerLib(!0)),r.some((e=>!e.endsWith(".json")))&&this.logger.warning(`Wrong validation: ${r}`),t.length>0){const e=`Invalid monomer library files in ${Me.so}, consider fixing or removing them: ${t.join(", ")}`;this.logger.warning(e)}this.logger.debug(`${e}, OUT`)})),this.logger.debug(`${e}, end`),this.filesPromise}async updateValidSetList(){const e=`${this.toLog()}.updateValidSetList()`;return Ye.logger.debug(`${e}, start`),this.filesPromise=this.filesPromise.then((async()=>{Ye.logger.debug(`${e}, IN`);const t=[],n=await this.getSetFileListAtLocation();if(!this.setListHasChanged(n))return void Ye.logger.debug(`${e}, end, not changed`);for(const e of n)e.endsWith(".json")?await o.dapi.files.readAsText(Me.Es+`${e}`):t.push(e);const r=n.filter((e=>!t.includes(e)));this.setListHasChanged(r)&&(this.eventManager.changeValidSetPathList(r),this.libHelper.loadMonomerSets(!0)),Ye.logger.debug(`${e}, OUT`)})),Ye.logger.debug(`${e}, end`),this.filesPromise}libListHasChanged(e){const t=this.eventManager.getValidLibPathList();return e.length!==t.length||e.some(((e,n)=>e!==t[n]))}setListHasChanged(e){const t=this.eventManager.getValidSetPathList();return e.length!==t.length||e.some(((e,n)=>e!==t[n]))}async validateAgainstHELM(e,t){if(!this.isValidHELMLibrary(e,t))throw new Error(`File ${t} does not satisfy HELM standard`)}isValidHELMLibrary(e,t){return this.fileValidator.validateFile(e,t)}async getLibFileListAtLocation(){const e=`${this.toLog()}.getLibFileListAtLocation()`;this.logger.debug(`${e}, start`);const t=await o.dapi.files.list(Me.so).then((e=>e.filter((e=>e.isFile)).map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring(Me.so.length)))}async getSetFileListAtLocation(){const e=`${this.toLog()}.getSetFileListAtLocation()`;this.logger.debug(`${e}, start`);const t=await o.dapi.files.list(Me.Es).then((e=>e.map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring(Me.Es.length)))}}class $e{constructor(){}static _instance;static getInstance(){return $e._instance||($e._instance=new $e),$e._instance}_libFilesUpdateSubject$=new c.BehaviorSubject([]);_setFilesUpdateSubject$=new c.BehaviorSubject([]);_addLibraryFilesSubject$=new c.Subject;_librarySelectionSubject$=new c.Subject;getValidLibPathList(){return this._libFilesUpdateSubject$.getValue()}getValidSetPathList(){return this._setFilesUpdateSubject$.getValue()}async getValidLibraryPathsAsynchronously(){return new Promise((e=>{const t=this._libFilesUpdateSubject$.pipe((0,T.skip)(1)).subscribe((n=>{e(n),t.unsubscribe()}))}))}changeValidLibPathList(e){this._libFilesUpdateSubject$.next(e)}changeValidSetPathList(e){this._setFilesUpdateSubject$.next(e)}get updateUIControlsRequested$(){return this._libFilesUpdateSubject$.pipe()}get updateValidLibraryFileListRequested$(){return this._libFilesUpdateSubject$.pipe()}get updateValidSetFileListRequested$(){return this._setFilesUpdateSubject$.pipe()}get addLibraryFileRequested$(){return this._addLibraryFilesSubject$.pipe()}addLibraryFile(){this._addLibraryFilesSubject$.next()}get librarySelectionRequested$(){return this._librarySelectionSubject$}updateLibrarySelectionStatus(e,t){this._librarySelectionSubject$.next([e,t])}}class Le{logger;_monomerLib=new we({},"MAIN");_monomerSets=new Te("MAIN",[]);_eventManager;get eventManager(){return this._eventManager}async awaitLoaded(e=1/0){return e=e===1/0?6e4:e,await Promise.race([(async()=>{const e=await this.getFileManager();return await e.filesPromise,!0})(),(async()=>(await(0,K.cb)(e),!1))()]).then((t=>{if(!t)throw new Error(`Loading monomer libraries timeout ${e} ms.`)}))}constructor(e){this.logger=e}static objCounter=-1;objId=(()=>{if(++Le.objCounter>0)throw new Error("MonomerLibManager MUST be a singleton.");return Le.objCounter})();toLog(){return`MonomerLibManager<${this.objId}>`}getMonomerLib(){return this._monomerLib}getBioLib(){return this.getMonomerLib()}getMonomerSets(){return this._monomerSets}get duplicateMonomers(){return this._monomerLib.duplicateMonomers}get duplicatesHandled(){return this._monomerLib.duplicatesHandled}assignDuplicatePreferances(e){this._monomerLib.assignDuplicatePreferences(e)}_fileManagerPromise;async getFileManager(){return void 0===this._fileManagerPromise&&(this._fileManagerPromise=(async()=>await xe.create(this,this._eventManager,this.logger))()),this._fileManagerPromise}loadLibrariesPromise=Promise.resolve();async loadMonomerLib(e=!1){const t=`${this.toLog()}.loadMonomerLib()`;return this.logger.debug(`${t}, start`),this.loadLibrariesPromise=this.loadLibrariesPromise.then((async()=>{this.logger.debug(`${t}, IN`);const n=a.TaskBarProgressIndicator.create("Loading monomers ...");try{const[[t],r]=await Promise.all([await this.getFileManager().then((e=>[e.getValidLibraryPaths()])),(0,F.ub)()]),s=t.filter((e=>{const t=!r.exclude.includes(e),n=0===r.explicit.length||r.explicit.includes(e);return t&&n}));let o=0;const i=s.length,[a]=await Promise.all([Promise.all(s.map((e=>this.readLibrary(Me.so,e).catch((t=>{const n=`Loading monomers from '${e}' error: ${t instanceof Error?t.message:t.toString()}`;return new we({},e,n)})).finally((()=>{n.update(Math.round(100*++o/i),`Loading monomers ${o}/${i}`)})))))]);this._monomerLib.updateLibs(a,e)}catch(e){const t=`Loading monomer libraries error: ${e instanceof Error?e.message:e.toString()}`;o.shell.warning(t);const n=e instanceof Error?e.stack:void 0;this.logger.error(t,void 0,n)}finally{n.close(),this.logger.debug(`${t}, OUT`)}})),this.logger.debug(`${t}, end`),this.loadLibrariesPromise}async loadLibraries(e){return this.loadMonomerLib(e)}loadSetsPromise=Promise.resolve();async loadMonomerSets(e=!1){const t=`${this.toLog()}.loadMonomerSets()`;return this.logger.debug(`${t}, start`),this.loadSetsPromise=this.loadSetsPromise.then((async()=>{this.logger.debug(`${t}, IN`);const e=a.TaskBarProgressIndicator.create("Loading monomer sets ...");try{const[[t]]=await Promise.all([await this.getFileManager().then((e=>[e.getValidSetPaths()]))]),n=t.filter((e=>!0));let r=0;const s=n.length,[o]=await Promise.all([Promise.all(n.map((t=>this.readSet(Me.Es,t).catch((e=>{const n=`Loading monomer sets from '${t}' error: ${e instanceof Error?e.message:e.toString()}`;return new Te("Broken monomer set",[],t,n)})).finally((()=>{e.update(Math.round(100*++r/s),`Loading monomers ${r}/${s}`)})))))]);this._monomerSets.updateSets(o)}catch(e){const t=`Loading monomer sets error: ${e instanceof Error?e.message:e.toString()}`;o.shell.warning(t);const n=e instanceof Error?e.stack:void 0;this.logger.error(t,void 0,n)}finally{e.close(),this.logger.debug(`${t}, OUT`)}})),this.logger.debug(`${t}, end`),this.loadSetsPromise}async readLibrary(e,t){const n=await this.getFileManager();return await n.loadLibraryFromFile(e,t)}async readSet(e,t){const n=await this.getFileManager();return await n.loadSetFromFile(this._monomerLib,e,t)}async selectSpecifiedLibraries(e){const t=await this.getInvalidFileNames(e);if(t.length>0)throw new Error(`Cannot select libraries ${t}: no such library in the list`);const n=await(0,F.ub)();n.exclude=(await this.getFileManager()).getValidLibraryPaths().filter((t=>!e.includes(t))),await(0,F.Eu)(n)}async getInvalidFileNames(e){const t=(await this.getFileManager()).getValidLibraryPaths();return e.filter((e=>!t.includes(e)))}async loadMonomerLibForTests(){await(0,F.Eu)(Me.G3),await this.awaitLoaded(1e4),await this.loadMonomerLib(!0)}static async getInstance(){let e=window.$monomerLibHelperPromise;return null==e&&(e=window.$monomerLibHelperPromise=(async()=>{const e=new Le(Ye.logger);return e._eventManager=$e.getInstance(),e})()),e}}n(1757);var Ie=n(3017),Re={};Re.styleTagTransform=v(),Re.setAttributes=g(),Re.insert=m().bind(null,"head"),Re.domAPI=h(),Re.insertStyleElement=b(),u()(Ie.A,Re),Ie.A&&Ie.A.locals&&Ie.A.locals,n(3151);new x.A(new Uint32Array([2,0,0,0,16,0,0,0,134217728,0,0,0,32,0,33554432,0,0,0,0,0,1024,0,0,0,262144,128,0,0,0,0,0,0,0,2,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1048576,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,32,0,0,2,0,32,0,0,0,0,0,0,0,1024,0,0,0,262144,128,0,0,0,0,0,0,0,65536,0,0,524288,0,0,0,0,0,0,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,34603008,0,536870912,64,0,0,0]),2048),new x.A(new Uint32Array([2,0,65600,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,0,262400,128,0,0,0,0,0,0,0,0,0,2097152,524288,0,0,0,1024,0,0,0,524288,0,0,0,0,0,0,0,0,0,512,0,0,34603008,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,8,262144,128,0,0,16,134217728,0,0,0,0,0,0,524288,0,0,0,128,0,0,0,524288,0,0,0,268435456,0,0,0,0,0,512,2147483648,0,34603008,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,98304,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,0,262144,128,33554432,0,0,0,0,33554432,0,1024,1,0,524288,32768,32,0,0,0,0,16,524288,0,0,0,0,0,0,0,0,0,71303168,0,0,34603008,131072,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([134217728,0,65536,0,0,0,0,0,0,0,0,0,32,0,0,0,0,0,0,0,1024,0,0,0,0,128,0,0,0,0,2097216,0,0,0,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,0,0,0,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,1073840128,0,0,0,0,0,0,0,0,67108864,32,0,0,0,0,0,0,0,1024,0,512,0,262144,192,0,268435456,0,0,8200,0,0,0,67108864,0,524296,0,32,0,0,0,0,16,524288,0,0,2147483648,0,0,8,0,0,0,0,0,0,34603008,131072,536870920,4194304,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,150994944,64,0,0,32,0,0,0,0,0,0,0,1024,0,8388608,0,327680,128,0,0,0,0,0,0,0,2,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,256,0,0,0,0,8388608,0,33554432,0,1048576,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,0,0,0,0,268435488,0,0,0,0,0,0,0,1024,0,0,8,262144,128,0,0,0,0,2097152,0,0,67108864,0,0,524288,0,0,0,8,0,0,0,524288,0,0,8192,0,0,0,0,0,0,0,2147483648,0,34668544,0,545259520,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,0,0,134217728,0,0,0,32,512,0,0,0,0,0,0,1024,256,0,8388608,262400,128,0,0,0,0,0,0,0,2,0,0,524288,0,0,0,0,0,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,42991616,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2050,0,65536,1048576,0,0,0,0,0,0,0,0,1056,0,0,0,0,0,0,0,1024,0,0,8,262144,128,0,0,0,0,0,536870912,0,2,0,0,1074266112,0,0,0,0,0,0,0,524288,0,0,0,4194304,0,0,0,0,0,0,2147483648,0,34603008,0,536870912,4194304,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,4096,0,0,0,0,0,0,16777216,32,0,0,0,0,0,0,0,1024,0,0,0,262400,128,0,0,0,0,0,0,0,0,0,0,524288,0,0,0,1024,0,0,0,524288,0,0,0,0,0,0,0,0,0,0,0,0,34603008,0,536871936,67108864,0,0,0]),2048),new x.A(new Uint32Array([0,0,1024,0,0,0,0,0,0,131072,0,1024,32,0,0,0,0,512,0,0,1024,0,0,64,0,128,0,0,1073741824,0,0,138412032,16,0,67108864,0,0,0,0,0,0,8192,0,0,8388608,0,0,8,0,0,0,0,0,0,256,0,0,0,0,553648128,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,4096,0,0,0,0,0,0,0,32,0,0,0,0,2,0,0,1024,0,0,8,262144,128,0,0,16,0,0,0,0,0,0,0,524288,0,0,0,0,0,0,0,524288,0,0,0,268435456,0,0,0,0,0,16777216,2147483648,0,34603008,0,536871936,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,4096,0,32,0,0,0,0,0,268435488,0,0,0,0,0,0,32768,134218752,0,16,8,262144,128,0,1073741824,0,0,8388608,0,0,0,65536,0,524289,0,0,0,0,0,0,0,524288,2048,0,0,0,0,0,0,0,0,0,2147483648,0,34603008,1048576,545259520,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,65536,0,0,0,1073741824,0,0,0,0,0,32,0,0,4,0,0,0,0,1024,0,0,0,262144,128,0,0,0,0,0,0,0,0,0,0,524288,0,0,1048576,0,0,0,0,524288,0,0,0,0,0,0,0,0,0,8388608,0,0,34603008,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,0,0,0,0,0,8,134217728,0,0,67108864,32,0,0,0,0,0,0,0,1024,0,8388608,0,262144,128,0,0,0,0,0,0,0,2,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,536870912,0,0,0,0,1048576,67108864,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,0,0,0,0,0,0,134217728,0,0,0,32,0,0,0,0,0,0,0,1024,0,8388608,0,262144,128,0,0,0,0,0,1073741824,128,2,0,524288,524288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8192,0,1048576,0,536870912,0,0,0,0]),2048),new x.A(new Uint32Array([2,0,98304,8388608,0,0,0,0,0,0,256,4096,32,0,0,0,0,0,0,0,1024,0,0,0,262144,192,0,0,0,0,0,0,0,0,67108865,0,524288,32768,32,0,0,0,8224,16,524288,0,0,0,0,32,128,0,2097152,0,4194304,8388608,0,34603008,8519680,536870912,131072,262144,0,0]),2048),new x.A(new Uint32Array([2,0,98304,0,0,0,0,0,0,4194304,0,0,32,0,0,0,0,0,0,0,1024,0,0,512,262144,128,33554432,0,0,0,0,33554432,0,0,0,0,524288,0,32,0,0,2,0,16,524288,0,0,0,0,0,4,0,0,0,71303168,262144,0,34603008,131072,536870912,0,0,0,0]),2048);new x.A(new Uint32Array([0,0,0,0,0,0,0,0,0,1024,0,67108864,0,0,0,512,0,0,0,8388608,0,0,512,0,0,64,4,0,0,0,4,0,0,0,67108864,0,524289,0,0,0,0,0,0,16,0,659456,0,256,0,16,0,0,0,268435456,0,0,262144,0,131072,0,0,0,8388608,0]),2048),new x.A(new Uint32Array([0,1073741824,0,0,0,0,0,2147483648,4,67108864,0,67108864,0,256,0,0,0,0,0,0,1024,0,128,0,0,64,0,0,0,0,0,0,0,0,67108864,0,524289,0,65536,0,0,0,0,16,0,131072,0,4,0,0,0,0,0,0,4194304,0,0,2147483648,131072,0,4096,0,0,0]),2048),new x.A(new Uint32Array([0,0,0,0,1024,0,0,0,0,67109888,16384,67108864,0,0,0,0,0,0,0,33562624,1024,33554432,512,16384,0,64,4,0,0,33554432,0,0,0,0,67108864,0,524289,0,0,0,0,0,0,16,0,135168,0,268435456,0,0,0,0,0,268435456,131072,0,0,2147483648,131072,0,0,0,8388608,0]),2048),new x.A(new Uint32Array([8388608,0,0,0,0,0,0,0,0,67108864,0,0,0,4,0,0,0,0,0,0,1024,0,0,16384,0,64,0,0,0,0,0,0,0,2,67108864,0,0,0,0,0,0,0,0,40976,0,0,0,0,0,0,0,0,0,67108864,131072,524288,0,0,8519680,0,1,33554432,1048576,0]),2048),new x.A(new Uint32Array([0,0,131072,1073741824,0,0,0,0,0,67108864,0,0,0,0,0,0,0,0,0,0,1024,0,128,0,0,64,0,0,0,0,0,0,0,32768,67108864,0,0,0,0,0,0,0,0,16,0,0,0,4,0,0,2048,0,0,0,4341760,0,0,0,131072,0,0,33554432,1048576,0]),2048);var Oe,ke=n(857),Ge={};Ge.styleTagTransform=v(),Ge.setAttributes=g(),Ge.insert=m().bind(null,"head"),Ge.domAPI=h(),Ge.insertStyleElement=b(),u()(ke.A,Ge),ke.A&&ke.A.locals&&ke.A.locals,function(e){e.MONOMER="Monomer",e.SYMBOL="Symbol",e.NAME="Name",e.R_GROUPS="~R-Groups",e.MONOMER_TYPE="Monomer Type",e.POLYMER_TYPE="Polymer Type",e.NATURAL_ANALOG="Natural Analog",e.AUTHOR="Author",e.CREATE_DATE="Create Date",e.ID="ID",e.META="Meta",e.SOURCE="Source"}(Oe||(Oe={})),Oe.MONOMER,a.COLUMN_TYPE.STRING,Oe.SYMBOL,a.COLUMN_TYPE.STRING,Oe.NAME,a.COLUMN_TYPE.STRING,Oe.R_GROUPS,a.COLUMN_TYPE.STRING,Oe.MONOMER_TYPE,a.COLUMN_TYPE.STRING,Oe.POLYMER_TYPE,a.COLUMN_TYPE.STRING,Oe.NATURAL_ANALOG,a.COLUMN_TYPE.STRING,Oe.AUTHOR,a.COLUMN_TYPE.STRING,Oe.CREATE_DATE,a.COLUMN_TYPE.DATE_TIME,Oe.ID,a.COLUMN_TYPE.INT,Oe.META,a.COLUMN_TYPE.STRING,Oe.SOURCE,a.COLUMN_TYPE.STRING;var De,He=function(e,t,n,r){return new(n||(n=Promise))((function(s,o){function i(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}c((r=r.apply(e,t||[])).next())}))};class Fe{constructor(e,t,n=!1,r){var s;this.name="",this.description="",this._isAutomatic=!1,this._autoStartFirstStep=!1,this._currentStep=0,this._isStopped=!1,this._isCancelled=!1,this._isStepProcessed=!1,this._root=i.div([],{id:"demo-script",classes:"tutorials-root tutorials-track demo-app-script"}),this._steps=[],this._mainHeader=i.panel([],"tutorials-main-header"),this._header=i.h2(""),this._headerDiv=i.divH([],"tutorials-root-header"),this._stopStartBtn=i.button(i.iconFA("pause"),(()=>He(this,void 0,void 0,(function*(){return yield this._changeStopState()}))),"Play / pause"),this._restartBtn=i.button(i.iconFA("redo"),(()=>He(this,void 0,void 0,(function*(){return yield this._restartScript()}))),"Restart"),this._nextStepBtn=i.button(i.iconFA("play"),(()=>He(this,void 0,void 0,(function*(){this._isStepProcessed||(yield this._nextStep())}))),"Next step"),this._activity=i.panel([],"tutorials-root-description"),this._progressDiv=i.divV([],"tutorials-root-progress"),this._progress=i.element("progress"),this._progressSteps=i.divText(""),this._closeBtn=i.button(i.iconFA("chevron-left"),(()=>this._closeDock()),"Back to demo"),this.name=e,this.description=t,this._isAutomatic=n,this._autoStartFirstStep=null!==(s=null==r?void 0:r.autoStartFirstStep)&&void 0!==s&&s,this._progress.max=0,this._progress.value=1,Fe.currentObject=this}get steps(){return this._steps}get stepNumber(){return this._steps.length}_addHeader(){this._createHeaderDiv(),this._createProgressDiv(),this._mainHeader.append(this._headerDiv,this._progressDiv)}_createHeaderDiv(){this._header.innerText=this.name,this._headerDiv.append(this._closeBtn),this._headerDiv.append(this._header),this._nextStepBtn.firstChild.className="grok-icon fas fa-play",this._headerDiv.append(this._isAutomatic?this._stopStartBtn:this._nextStepBtn)}_createProgressDiv(){this._progress.max=this.stepNumber,this._progressDiv.append(this._progress),this._progressSteps=i.divText(`Step: ${this._progress.value} of ${this.stepNumber}`),this._progressDiv.append(this._progressSteps)}_addDescription(){var e;this._activity.append(i.div(this.description,"tutorials-root-description"));for(let t=0;t<this.stepNumber;t++){let n=i.iconFA("clock");this._isAutomatic||0===t&&(n=i.iconFA("play",(()=>this._nextStep()),"Next step"),n.className="grok-icon fas fa-play");const r=i.div(this._steps[t].name,"grok-tutorial-entry-instruction"),s=i.div(null===(e=this._steps[t].options)||void 0===e?void 0:e.description,"grok-tutorial-step-description hidden"),o=i.divH([n,r],"grok-tutorial-entry");this._activity.append(o,s)}}_initRoot(){var e,t,n;o.shell.windows.showContextPanel=!0,o.shell.windows.showHelp=!1;const r=o.shell.isInDemo?Array.from(o.shell.view("Browse").dockManager.rootNode.children)[0]:Array.from(o.shell.dockManager.rootNode.children)[0];this._node=o.shell.dockManager.dock(this._root,a.DOCK_TYPE.FILL,r,""),(null===(t=null===(e=r.parent.container.containerElement.firstElementChild)||void 0===e?void 0:e.lastElementChild)||void 0===t?void 0:t.classList.contains("tab-handle-list-container"))&&(null===(n=r.parent.container.containerElement.firstElementChild)||void 0===n||n.lastElementChild.remove()),this._node.container.containerElement.classList.add("tutorials-demo-script-container"),this._addHeader(),this._root.append(this._mainHeader),this._addDescription(),this._root.append(this._activity)}_nextStep(){var e,t;return He(this,void 0,void 0,(function*(){this._isStepProcessed=!0,this._isAutomatic||(this._nextStepBtn.classList.add("disabled"),this._nextStepBtn.firstChild.classList.add("fa-disabled"));const n=this._activity.getElementsByClassName("grok-tutorial-entry")[this._currentStep],r=this._activity.getElementsByClassName("grok-icon")[this._currentStep],s=this._activity.getElementsByClassName("grok-tutorial-step-description")[this._currentStep];r.className="grok-icon far fa-spinner-third fa-spin",s.classList.remove("hidden"),s.classList.add("visible");const c=n,l=(null===(e=this._steps[this._currentStep].options)||void 0===e?void 0:e.delay)?null===(t=this._steps[this._currentStep].options)||void 0===t?void 0:t.delay:2e3;try{o.shell.isInDemo=!0,yield this._steps[this._currentStep].func()}catch(e){o.shell.isInDemo=!1,console.error(e)}this._scrollTo(this._root,c.offsetTop-this._mainHeader.offsetHeight),this._isAutomatic&&(yield this._countdown(n,r,l),yield(0,K.cb)(l));const u=i.iconFA("check");if(r.replaceWith(u),u.className="grok-icon far fa-check",this._progress.value++,this._progressSteps.innerText=`Step: ${this._progress.value} of ${this.stepNumber}`,this._currentStep++,this._isStepProcessed=!1,this._currentStep===this.stepNumber)return this._isAutomatic?this._stopStartBtn.replaceWith(this._restartBtn):this._nextStepBtn.replaceWith(this._restartBtn),void(o.shell.isInDemo=!1);if(!this._isAutomatic){const e=this._activity.getElementsByClassName("grok-icon")[this._currentStep],t=i.iconFA("play",(()=>this._nextStep()),"Next step");t.className="grok-icon fas fa-play",e.replaceWith(t),this._nextStepBtn.classList.remove("disabled"),this._nextStepBtn.firstChild.classList.remove("fa-disabled")}if(o.shell.isInDemo){const e=o.shell.view("Browse");(null==e?void 0:e.preview)instanceof a.TableView&&(yield o.data.detectSemanticTypes(e.preview.dataFrame)),o.shell.isInDemo=!1}}))}_startScript(){return He(this,void 0,void 0,(function*(){for(let e=this._currentStep;e<this.stepNumber&&!this._isStopped&&!this._isCancelled;e++)yield this._nextStep()}))}_scrollTo(e,t){e.focus(),e.scrollTop=t}_countdown(e,t,n){return He(this,void 0,void 0,(function*(){const r=i.div([],"demo-script-countdown");t.classList.add("hidden");let s=n/1e3;const o=this._createSVGIndicator(s);r.append(o),e.prepend(r);const a=setInterval((()=>{s--,0===s&&(clearInterval(a),r.remove(),t.classList.remove("hidden"),t.classList.add("visible"))}),1e3)}))}_createSVGIndicator(e){const t=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","circle");return n.setAttributeNS(null,"cx","7"),n.setAttributeNS(null,"cy","7"),n.setAttributeNS(null,"r","6"),n.setAttributeNS(null,"style",`animation: countdown ${e}s linear infinite forwards`),t.append(n),t}_changeStopState(){return He(this,void 0,void 0,(function*(){const e=this._stopStartBtn.getElementsByClassName("grok-icon");e[0].className="grok-icon fas fa-play",this._isStopped=!this._isStopped,this._isStopped||(e[0].className="grok-icon fal fa-pause",this._isStepProcessed||(yield this._startScript()))}))}_restartScript(){return He(this,void 0,void 0,(function*(){o.shell.dockManager.close(this._node),this._clearRoot(),this._setInitParams(),yield this.start()}))}_clearRoot(){this._root=i.div([],{id:"demo-script",classes:"tutorials-root tutorials-track demo-app-script"}),this._mainHeader=i.panel([],"tutorials-main-header"),this._header=i.h2(""),this._headerDiv=i.divH([],"tutorials-root-header"),this._activity=i.panel([],"tutorials-root-description"),this._progressDiv=i.divV([],"tutorials-root-progress"),this._progress=i.element("progress"),this._progressSteps=i.divText(""),this._progress.max=0,this._progress.value=1}_setInitParams(){this._currentStep=0,this._isStopped=!1,this._isCancelled=!1,this._stopStartBtn.getElementsByClassName("grok-icon")[0].className="grok-icon fal fa-pause",this._nextStepBtn.classList.remove("disabled")}_closeDock(){o.shell.dockManager.close(this._node),this.cancelScript()}cancelScript(){this._isCancelled=!0,Fe.currentObject=null,o.shell.isInDemo=!1}step(e,t,n){return this._steps[this.steps.length]={name:e,func:t,options:n},this}start(){return He(this,void 0,void 0,(function*(){o.shell.isInDemo=!0,this._initRoot(),o.shell.newView(this.name),this._isAutomatic?yield this._startScript():this._autoStartFirstStep&&(yield this._nextStep())}))}}Fe.currentObject=null,function(e){e.X="Embed_X",e.Y="Embed_Y"}(De||(De={})),n(8152),n(966),n(608),n(1619),n(6869),new class{tooltipHandlerTemp="tooltip-handler.Monomer"},a.GridCellRenderer;class Ve{constructor(e,t,n=""){this.target=e,this.debugEnabled=t,this.prefix=n}error(e,t,n){return this.target.error(this.prefix+e,t,n)}warning(e,t){return this.target.warning(this.prefix+e,t)}info(e,t){return this.target.info(this.prefix+e,t)}debug(e,t){if(this.debugEnabled)return this.target.debug(this.prefix+e,t)}}Map;class Ue extends a.Package{_properties;_seqHelper;get seqHelper(){if(!this._seqHelper)throw new Error("Package Bio .seqHelper is not initialized.");return this._seqHelper}_monomerLib;get monomerLib(){if(!this._monomerLib)throw new Error("Package Bio .monomerLib is not initialized.");return this._monomerLib}_monomerSets;get monomerSets(){if(!this._monomerSets)throw new Error("Package Bio .monomerSets is not initialized.");return this._monomerSets}_rdKitModule;get rdKitModule(){if(!this._rdKitModule)throw new Error("Package Bio .rdKitModule is not initialized.");return this._rdKitModule}get properties(){return this._properties}set properties(e){this._properties=e}_initialized=!1;get initialized(){return this._initialized}constructor(e={debug:!1}){super(),super._logger=new Ve(super.logger,e.debug)}completeInit(e,t,n,r){this._seqHelper=e,this._monomerLib=t,this._monomerSets=n,this._rdKitModule=r,this._initialized=!0}handleErrorUI(e){const[t,n]=(0,Ae.AP)(e);o.shell.error(t),this.logger.error(t,void 0,n)}}n(2174),a.Widget,a.DataFrame.fromCsv("seq,value\nATCCGTCGT,0.5\nTGTTCGTCA,0.4\nATGGTCGTA,0.7\nATCCGTGCA,0.1"),["1","1A","1C","2","4","4A","4B","5","6"].join(D.z1),n(8754),n(330),n(9235),OCL,n(294),n(6956),new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}};const Ye=new Ue;async function Be(){return await Le.getInstance()}},8115:(e,t,n)=>{"use strict";n.d(t,{if:()=>l,nI:()=>c});var r=n(4328),s=(n(7389),n(6082)),o=n(8070),i=n(2003),a=n(1407);function c(e,t,n){const r=n?function(e,t){const n=`${t}`.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),r=e.charAt(0)===t,s=e.charAt(e.length-1)===t,o=e.replace(new RegExp(`^${n}|${n}$`,"g"),"");return r?s?`${n}${o}${n}`:`${n}${o}${n}|${n}${o}$`:s?`^${o}${n}|${n}${o}${n}`:`^${o}${n}|${n}${o}${n}|${n}${o}$`}(e,n):e,o=s.BitSet.create(t.length);for(let n=0;n<t.length;n++){const s=t.get(n);(s.match(r)||s===e)&&o.set(n,!0,!1)}return o}async function l(e,t,n){t.version!==t.temp["last-invalidated-version"]&&await async function(e,t){const n=s.TaskBarProgressIndicator.create(`Invalidating molfiles for ${e.name}`);try{await(0,o.cb)(10);const n=new Map,r=await(0,a.R)(e,t,!0,n);e.temp["monomeric-mols"]=r,e.temp["monomers-dict"]=n,e.temp["last-invalidated-version"]=e.version}finally{n.close()}}(t,n);const c=s.Column.string("helm",1).init((t=>e));c.semType=s.SEMTYPE.MACROMOLECULE,c.meta.units=i.Hi.HELM;const l=await(0,a.R)(c,n,!0,t.temp["monomers-dict"]);return(await r.functions.call("Chem:searchSubstructure",{molStringsColumn:t.temp["monomeric-mols"],molString:l.get(0),molBlockFailover:""})).get(0)}n(4870)},966:(e,t,n)=>{"use strict";n.d(t,{l:()=>o});var r=n(4328),s=n(6082);function o(e,t,n,o=[],i=[]){let a=!0,c="";if(e.semType!==s.SEMTYPE.MACROMOLECULE)r.shell.warning(t+" analysis is allowed for Macromolecules semantic type"),a=!1;else{const r=n.getSeqHandler(e),s=r.notation;if(o.length>0&&!o.some((e=>s.toUpperCase()==e.toUpperCase())))c=`${t} + ' analysis is allowed for Macromolecules with notation ${0==o.length?"any notation":`notation${o.length>1?"s":""} ${o.map((e=>`"${e}"`)).join(", ")} `}.`,a=!1;else if(!r.isHelm()){const e=r.alphabet;i.length>0&&!i.some((t=>e.toUpperCase()==t.toUpperCase()))&&(c=`${t} + ' analysis is allowed for Macromolecules with alphabet ${0==i.length?"any alphabet":`alphabet${i.length>1?"s":""} ${i.map((e=>`"${e}"`)).join(", ")}.`}.`,a=!1)}}return[a,c]}n(4374)},4139:(e,t,n)=>{"use strict";n.d(t,{HX:()=>d,J:()=>l,b9:()=>u,gN:()=>a,uF:()=>o});var r,s,o,i=n(8152);!function(e){e.SPLIT_COL="~split",e.ACTIVITY="~activity",e.ACTIVITY_SCALED="activity_scaled",e.ALIGNED_SEQUENCE="~aligned_sequence",e.AMINO_ACID_RESIDUE="AAR",e.POSITION="Pos",e.P_VALUE="pValue",e.MEAN_DIFFERENCE="Mean difference"}(r||(r={})),function(e){e.AAR="AAR",e.POSITION="Pos",e.SELECTION="selection"}(s||(s={})),function(e){e.MONOMER="Monomer",e.MACROMOLECULE_DIFFERENCE="MacromoleculeDifference",e.ACTIVITY="activity",e.ACTIVITY_SCALED="activityScaled"}(o||(o={}));const a="MSA";var c,l;!function(e){e.CELL_CHANGING="isCellChanging"}(c||(c={})),function(e){e.SEPARATOR="."}(l||(l={}));const u="3.3.1",d={pepsea:{gapOpen:1.53,gapExtend:0,method:i.ZY[0]},kalign:{gapOpen:-1,gapExtend:-1,terminalGap:-1}}},5433:(e,t,n)=>{"use strict";n.d(t,{r:()=>s}),n(6082),n(7389);var r=n(4328);async function s(e,t,n,s){const o=t.getSeqHandler(e).convert(n,s);e.dataFrame.columns.add(o);const i=await r.functions.call("Bio:detectMacromolecule",{col:o});return i&&(o.semType=i),await r.data.detectSemanticTypes(e.dataFrame),o}n(1757),n(2003)},6740:(e,t,n)=>{"use strict";n.d(t,{m8:()=>i});var r=n(4328),s=n(8070),o=n(8152);async function i(e=6e4){const t=await o.Nk.getDockerContainer();await async function(e,t=6e4){let n=e,o=!1;for(let i=0;i<t/200;++i){if(null===n&&(n=await r.dapi.docker.dockerContainers.find(e.id)),a(n)){o=!0;break}switch(n.status){case"stopped":await r.dapi.docker.dockerContainers.run(n.id);break;case"pending change":case"changing":break;case"error":throw new Error("Docker container error state.")}n=null,await(0,s.cb)(200)}if(!o)throw new Error("Docker container start timeout.")}(t,e)}function a(e){return"checking"===e.status||"started"===e.status}},6956:(e,t,n)=>{"use strict";n.d(t,{mP:()=>o,pk:()=>s,xe:()=>r});const r="|",s="$",o="H"},8604:(e,t,n)=>{"use strict";n.d(t,{Es:()=>s,G3:()=>i,VV:()=>a,gt:()=>o,so:()=>r});const r="System:AppData/Bio/monomer-libraries/",s="System:AppData/Bio/monomer-sets/",o="System:AppData/Bio/tests/libraries/HELMmonomerSchema.json",i={explicit:["HELMCoreLibrary.json","polytool-lib.json"],exclude:[],duplicateMonomerPreferences:{}},a={PEPTIDE:326,RNA:383,CHEM:0}},1619:(e,t,n)=>{"use strict";n.d(t,{D:()=>N});var r=n(4328),s=n(6082),o=n(7389),i=n(8070),a=n(2003),c=n(608),l=n(8152),u=n(966),d=n(4139),h=n(6740),p=n(5072),m=n.n(p),f=n(7825),g=n.n(f),y=n(7659),b=n.n(y),w=n(5056),v=n.n(w),A=n(540),E=n.n(A),T=n(1113),C=n.n(T),S=n(6369),_={};_.styleTagTransform=C(),_.setAttributes=v(),_.insert=b().bind(null,"head"),_.domAPI=g(),_.insertStyleElement=E(),m()(S.A,_),S.A&&S.A.locals&&S.A.locals;var P=n(4374);async function N(e,t){return new Promise((async(n,a)=>{e.clustersCol??=null,e.pepsea??={},e.pepsea.method??=d.HX.pepsea.method,e.pepsea.gapOpen??=d.HX.pepsea.gapOpen,e.pepsea.gapExtend??=d.HX.pepsea.gapExtend;const u=e.col?.dataFrame??r.shell.t,h=e.col??u.columns.bySemType(s.SEMTYPE.MACROMOLECULE);if(null==h){const e="Multiple Sequence Alignment analysis requires a dataset with a macromolecule column.";return r.shell.warning(e),void a(new c.Ap(o.divText(e)))}const p=o.input.choice("Method",{value:e.pepsea.method,items:l.ZY});p.setTooltip("Alignment method");const m=o.input.float("Terminal gap",{value:e?.kalign?.terminalGap});m.setTooltip("Penalty for opening a gap at the beginning or end of the sequence");const f=o.p(`Kalign version: ${d.b9}`,"kalign-version"),g=o.input.float("Gap open",{value:e.pepsea.gapOpen});g.setTooltip("Gap opening penalty at group-to-group alignment");const y=o.input.float("Gap extend",{value:e.pepsea.gapExtend});y.setTooltip("Gap extension penalty to skip the alignment");const b=o.inputs([g,y,m]),w=o.button("Alignment parameters",(()=>{b.hidden=!b.hidden,[g,y,m].forEach((e=>{e.root.style.removeProperty("max-width"),e.captionLabel.style.removeProperty("max-width")}))}),"Adjust alignment parameters such as penalties for opening and extending gaps");w.classList.add("msa-params-button"),b.hidden=!0,w.prepend(o.icons.settings((()=>null)));const v=[p.root.style],A=[m.root.style,f.style];let E,T=h;const C=o.input.column("Sequence",{table:u,value:h,onValueChanged:async e=>{if(!e||e.semType!==s.SEMTYPE.MACROMOLECULE)return P.disabled=!0,await(0,i.cb)(0),void(C.value=T);T=e,P.disabled=!1,E=await x(C.value,u,t,v,A,p,S,g,y,m)},filter:e=>e.semType===s.SEMTYPE.MACROMOLECULE});C.setTooltip("Sequences column to use for alignment");const S=o.input.column("Clusters",{table:u,value:e.clustersCol});S.nullable=!0;const _=o.dialog("MSA").add(C).add(S).add(p).add(b).add(w).add(f).onOK((async()=>{await M(C,u,E,n,a)})),P=_.getButton("OK");if(C.fireChanged(),e.col)return E=await x(e.col,u,t,v,A,p,S,g,y,m),void await M(C,u,E,n,a);_.show()}))}async function M(e,t,n,o,i){let a=null;const c=s.TaskBarProgressIndicator.create("Analyze for MSA ...");try{if(e.fireChanged(),e.value.semType!==s.SEMTYPE.MACROMOLECULE)throw new Error("Chosen column has to be of Macromolecule semantic type");if(void 0===n)throw new Error("Invalid column format");if(a=await n(),null==a)return i("PepSeA container has not started");t.columns.add(a),await r.data.detectSemanticTypes(t),o(a)}catch(e){i(e)}finally{c.close()}}async function x(e,t,n,o,i,p,m,f,g,y){try{if(e.semType!==s.SEMTYPE.MACROMOLECULE)return;const r=t.columns.getUnusedName(`msa(${e.name})`);if((0,u.l)(e,e.name,n,[a.Hi.FASTA,a.Hi.SEPARATOR],[a.YI.DNA,a.YI.RNA,a.YI.PT])[0]){$(o,i,"kalign"),f.value=null,g.value=null,y.value=null;const t=n.getSeqHandler(e),s=t.isFasta()?e:t.convert(a.Hi.FASTA);return async()=>await(0,c.eE)(s,!1,r,m.value)}if((0,u.l)(e,e.name,n,[a.Hi.HELM],[])[0])return $(o,i,"pepsea"),f.value??=d.HX.pepsea.gapOpen,g.value??=d.HX.pepsea.gapExtend,async()=>(await(0,h.m8)(),(0,l.GD)(e,r,p.value,f.value,g.value,m.value));if((0,u.l)(e,e.name,n,[a.Hi.SEPARATOR],[a.YI.UN])[0]){const t=n.getSeqHandler(e).convert(a.Hi.HELM);return $(o,i,"pepsea"),f.value??=d.HX.pepsea.gapOpen,g.value??=d.HX.pepsea.gapExtend,async()=>(await(0,h.m8)(),(0,l.GD)(t,r,p.value,f.value,g.value,m.value))}return f.value=null,g.value=null,y.value=null,void $(o,i,"kalign")}catch(e){const t=e instanceof Error?e.message:e.toString();r.shell.error(t),P._package.logger.error(t)}}function $(e,t,n){if("kalign"===n){for(const t of e)t.display="none";for(const e of t)e.removeProperty("display")}else{for(const e of t)e.display="none";for(const t of e)t.removeProperty("display")}}},608:(e,t,n)=>{"use strict";n.d(t,{Ap:()=>G,aZ:()=>V,eE:()=>H});var r=n(7389),s=n(6082),o=n(1991),i=n.n(o),a=n(3516),c=n(2003);const l=Symbol("Comlink.proxy"),u=Symbol("Comlink.endpoint"),d=Symbol("Comlink.releaseProxy"),h=Symbol("Comlink.thrown"),p=e=>"object"==typeof e&&null!==e||"function"==typeof e,m=new Map([["proxy",{canHandle:e=>p(e)&&e[l],serialize(e){const{port1:t,port2:n}=new MessageChannel;return f(e,t),[n,[n]]},deserialize:e=>(e.start(),y(e))}],["throw",{canHandle:e=>p(e)&&h in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}}]]);function f(e,t=self){t.addEventListener("message",(function n(r){if(!r||!r.data)return;const{id:s,type:o,path:i}=Object.assign({path:[]},r.data),a=(r.data.argumentList||[]).map(C);let c;try{const t=i.slice(0,-1).reduce(((e,t)=>e[t]),e),n=i.reduce(((e,t)=>e[t]),e);switch(o){case"GET":c=n;break;case"SET":t[i.slice(-1)[0]]=C(r.data.value),c=!0;break;case"APPLY":c=n.apply(t,a);break;case"CONSTRUCT":c=function(e){return Object.assign(e,{[l]:!0})}(new n(...a));break;case"ENDPOINT":{const{port1:t,port2:n}=new MessageChannel;f(e,n),c=function(e,t){return E.set(e,t),e}(t,[t])}break;case"RELEASE":c=void 0;break;default:return}}catch(e){c={value:e,[h]:0}}Promise.resolve(c).catch((e=>({value:e,[h]:0}))).then((e=>{const[r,i]=T(e);t.postMessage(Object.assign(Object.assign({},r),{id:s}),i),"RELEASE"===o&&(t.removeEventListener("message",n),g(t))}))})),t.start&&t.start()}function g(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function y(e,t){return w(e,[],t)}function b(e){if(e)throw new Error("Proxy has been released and is not useable")}function w(e,t=[],n=function(){}){let r=!1;const s=new Proxy(n,{get(n,o){if(b(r),o===d)return()=>S(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{g(e),r=!0}));if("then"===o){if(0===t.length)return{then:()=>s};const n=S(e,{type:"GET",path:t.map((e=>e.toString()))}).then(C);return n.then.bind(n)}return w(e,[...t,o])},set(n,s,o){b(r);const[i,a]=T(o);return S(e,{type:"SET",path:[...t,s].map((e=>e.toString())),value:i},a).then(C)},apply(n,s,o){b(r);const i=t[t.length-1];if(i===u)return S(e,{type:"ENDPOINT"}).then(C);if("bind"===i)return w(e,t.slice(0,-1));const[a,c]=A(o);return S(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:a},c).then(C)},construct(n,s){b(r);const[o,i]=A(s);return S(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:o},i).then(C)}});return s}function v(e){return Array.prototype.concat.apply([],e)}function A(e){const t=e.map(T);return[t.map((e=>e[0])),v(t.map((e=>e[1])))]}const E=new WeakMap;function T(e){for(const[t,n]of m)if(n.canHandle(e)){const[r,s]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},s]}return[{type:"RAW",value:e},E.get(e)||[]]}function C(e){switch(e.type){case"HANDLER":return m.get(e.name).deserialize(e.value);case"RAW":return e.value}}function S(e,t,n){return new Promise((r=>{const s=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(n){!n.data||!n.data.id||n.data.id!==s||(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:s},t),n)}))}const _="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0ICQ9U3ltYm9sKCJDb21saW5rLnByb3h5IiksQT1TeW1ib2woIkNvbWxpbmsuZW5kcG9pbnQiKSxSPVN5bWJvbCgiQ29tbGluay5yZWxlYXNlUHJveHkiKSx5PVN5bWJvbCgiQ29tbGluay50aHJvd24iKSxfPWU9PnR5cGVvZiBlPT0ib2JqZWN0IiYmZSE9PW51bGx8fHR5cGVvZiBlPT0iZnVuY3Rpb24iLEw9e2NhbkhhbmRsZTplPT5fKGUpJiZlWyRdLHNlcmlhbGl6ZShlKXtjb25zdHtwb3J0MTpyLHBvcnQyOml9PW5ldyBNZXNzYWdlQ2hhbm5lbDtyZXR1cm4gdyhlLHIpLFtpLFtpXV19LGRlc2VyaWFsaXplKGUpe3JldHVybiBlLnN0YXJ0KCksQyhlKX19LE89e2NhbkhhbmRsZTplPT5fKGUpJiZ5IGluIGUsc2VyaWFsaXplKHt2YWx1ZTplfSl7bGV0IHI7cmV0dXJuIGUgaW5zdGFuY2VvZiBFcnJvcj9yPXtpc0Vycm9yOiEwLHZhbHVlOnttZXNzYWdlOmUubWVzc2FnZSxuYW1lOmUubmFtZSxzdGFjazplLnN0YWNrfX06cj17aXNFcnJvcjohMSx2YWx1ZTplfSxbcixbXV19LGRlc2VyaWFsaXplKGUpe3Rocm93IGUuaXNFcnJvcj9PYmplY3QuYXNzaWduKG5ldyBFcnJvcihlLnZhbHVlLm1lc3NhZ2UpLGUudmFsdWUpOmUudmFsdWV9fSxFPW5ldyBNYXAoW1sicHJveHkiLExdLFsidGhyb3ciLE9dXSk7ZnVuY3Rpb24gdyhlLHI9c2VsZil7ci5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixmdW5jdGlvbiBpKHMpe2lmKCFzfHwhcy5kYXRhKXJldHVybjtjb25zdHtpZDpvLHR5cGU6YSxwYXRoOm59PU9iamVjdC5hc3NpZ24oe3BhdGg6W119LHMuZGF0YSksYz0ocy5kYXRhLmFyZ3VtZW50TGlzdHx8W10pLm1hcChtKTtsZXQgbDt0cnl7Y29uc3QgdT1uLnNsaWNlKDAsLTEpLnJlZHVjZSgoZCxwKT0+ZFtwXSxlKSxmPW4ucmVkdWNlKChkLHApPT5kW3BdLGUpO3N3aXRjaChhKXtjYXNlIkdFVCI6bD1mO2JyZWFrO2Nhc2UiU0VUIjp1W24uc2xpY2UoLTEpWzBdXT1tKHMuZGF0YS52YWx1ZSksbD0hMDticmVhaztjYXNlIkFQUExZIjpsPWYuYXBwbHkodSxjKTticmVhaztjYXNlIkNPTlNUUlVDVCI6e2NvbnN0IGQ9bmV3IGYoLi4uYyk7bD16KGQpfWJyZWFrO2Nhc2UiRU5EUE9JTlQiOntjb25zdHtwb3J0MTpkLHBvcnQyOnB9PW5ldyBNZXNzYWdlQ2hhbm5lbDt3KGUscCksbD1OKGQsW2RdKX1icmVhaztjYXNlIlJFTEVBU0UiOmw9dm9pZCAwO2JyZWFrO2RlZmF1bHQ6cmV0dXJufX1jYXRjaCh1KXtsPXt2YWx1ZTp1LFt5XTowfX1Qcm9taXNlLnJlc29sdmUobCkuY2F0Y2godT0+KHt2YWx1ZTp1LFt5XTowfSkpLnRoZW4odT0+e2NvbnN0W2YsZF09Uyh1KTtyLnBvc3RNZXNzYWdlKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxmKSx7aWQ6b30pLGQpLGE9PT0iUkVMRUFTRSImJihyLnJlbW92ZUV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGkpLE0ocikpfSl9KSxyLnN0YXJ0JiZyLnN0YXJ0KCl9ZnVuY3Rpb24gVChlKXtyZXR1cm4gZS5jb25zdHJ1Y3Rvci5uYW1lPT09Ik1lc3NhZ2VQb3J0In1mdW5jdGlvbiBNKGUpe1QoZSkmJmUuY2xvc2UoKX1mdW5jdGlvbiBDKGUscil7cmV0dXJuIGIoZSxbXSxyKX1mdW5jdGlvbiBoKGUpe2lmKGUpdGhyb3cgbmV3IEVycm9yKCJQcm94eSBoYXMgYmVlbiByZWxlYXNlZCBhbmQgaXMgbm90IHVzZWFibGUiKX1mdW5jdGlvbiBiKGUscj1bXSxpPWZ1bmN0aW9uKCl7fSl7bGV0IHM9ITE7Y29uc3Qgbz1uZXcgUHJveHkoaSx7Z2V0KGEsbil7aWYoaChzKSxuPT09UilyZXR1cm4oKT0+ZyhlLHt0eXBlOiJSRUxFQVNFIixwYXRoOnIubWFwKGM9PmMudG9TdHJpbmcoKSl9KS50aGVuKCgpPT57TShlKSxzPSEwfSk7aWYobj09PSJ0aGVuIil7aWYoci5sZW5ndGg9PT0wKXJldHVybnt0aGVuOigpPT5vfTtjb25zdCBjPWcoZSx7dHlwZToiR0VUIixwYXRoOnIubWFwKGw9PmwudG9TdHJpbmcoKSl9KS50aGVuKG0pO3JldHVybiBjLnRoZW4uYmluZChjKX1yZXR1cm4gYihlLFsuLi5yLG5dKX0sc2V0KGEsbixjKXtoKHMpO2NvbnN0W2wsdV09UyhjKTtyZXR1cm4gZyhlLHt0eXBlOiJTRVQiLHBhdGg6Wy4uLnIsbl0ubWFwKGY9PmYudG9TdHJpbmcoKSksdmFsdWU6bH0sdSkudGhlbihtKX0sYXBwbHkoYSxuLGMpe2gocyk7Y29uc3QgbD1yW3IubGVuZ3RoLTFdO2lmKGw9PT1BKXJldHVybiBnKGUse3R5cGU6IkVORFBPSU5UIn0pLnRoZW4obSk7aWYobD09PSJiaW5kIilyZXR1cm4gYihlLHIuc2xpY2UoMCwtMSkpO2NvbnN0W3UsZl09RihjKTtyZXR1cm4gZyhlLHt0eXBlOiJBUFBMWSIscGF0aDpyLm1hcChkPT5kLnRvU3RyaW5nKCkpLGFyZ3VtZW50TGlzdDp1fSxmKS50aGVuKG0pfSxjb25zdHJ1Y3QoYSxuKXtoKHMpO2NvbnN0W2MsbF09RihuKTtyZXR1cm4gZyhlLHt0eXBlOiJDT05TVFJVQ1QiLHBhdGg6ci5tYXAodT0+dS50b1N0cmluZygpKSxhcmd1bWVudExpc3Q6Y30sbCkudGhlbihtKX19KTtyZXR1cm4gb31mdW5jdGlvbiBEKGUpe3JldHVybiBBcnJheS5wcm90b3R5cGUuY29uY2F0LmFwcGx5KFtdLGUpfWZ1bmN0aW9uIEYoZSl7Y29uc3Qgcj1lLm1hcChTKTtyZXR1cm5bci5tYXAoaT0+aVswXSksRChyLm1hcChpPT5pWzFdKSldfWNvbnN0IFA9bmV3IFdlYWtNYXA7ZnVuY3Rpb24gTihlLHIpe3JldHVybiBQLnNldChlLHIpLGV9ZnVuY3Rpb24geihlKXtyZXR1cm4gT2JqZWN0LmFzc2lnbihlLHtbJF06ITB9KX1mdW5jdGlvbiBTKGUpe2Zvcihjb25zdFtyLGldb2YgRSlpZihpLmNhbkhhbmRsZShlKSl7Y29uc3RbcyxvXT1pLnNlcmlhbGl6ZShlKTtyZXR1cm5be3R5cGU6IkhBTkRMRVIiLG5hbWU6cix2YWx1ZTpzfSxvXX1yZXR1cm5be3R5cGU6IlJBVyIsdmFsdWU6ZX0sUC5nZXQoZSl8fFtdXX1mdW5jdGlvbiBtKGUpe3N3aXRjaChlLnR5cGUpe2Nhc2UiSEFORExFUiI6cmV0dXJuIEUuZ2V0KGUubmFtZSkuZGVzZXJpYWxpemUoZS52YWx1ZSk7Y2FzZSJSQVciOnJldHVybiBlLnZhbHVlfX1mdW5jdGlvbiBnKGUscixpKXtyZXR1cm4gbmV3IFByb21pc2Uocz0+e2NvbnN0IG89VSgpO2UuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24gYShuKXshbi5kYXRhfHwhbi5kYXRhLmlkfHxuLmRhdGEuaWQhPT1vfHwoZS5yZW1vdmVFdmVudExpc3RlbmVyKCJtZXNzYWdlIixhKSxzKG4uZGF0YSkpfSksZS5zdGFydCYmZS5zdGFydCgpLGUucG9zdE1lc3NhZ2UoT2JqZWN0LmFzc2lnbih7aWQ6b30sciksaSl9KX1mdW5jdGlvbiBVKCl7cmV0dXJuIG5ldyBBcnJheSg0KS5maWxsKDApLm1hcCgoKT0+TWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpKk51bWJlci5NQVhfU0FGRV9JTlRFR0VSKS50b1N0cmluZygxNikpLmpvaW4oIi0iKX1jb25zdCBXPWFzeW5jKCk9PldlYkFzc2VtYmx5LnZhbGlkYXRlKG5ldyBVaW50OEFycmF5KFswLDk3LDExNSwxMDksMSwwLDAsMCwxLDUsMSw5NiwwLDEsMTIzLDMsMiwxLDAsMTAsMTAsMSw4LDAsNjUsMCwyNTMsMTUsMjUzLDk4LDExXSkpLGs9ImVhZ2VyIix4PSJsYXp5IixqPXtzc3c6WyJzaW1kIl0sbWluaW1hcDI6WyJzaW1kIl19LHQ9e3Rvb2xzOltdLGNvbmZpZzp7fSxmaWxlczpbXSxiYXNlOnt9LGZzOnt9LGFzeW5jIGluaXQoKXtpZih0LnRvb2xzLmxlbmd0aD09PTApdGhyb3ciRXhwZWN0aW5nIGF0IGxlYXN0IDEgdG9vbC4iO2lmKG5ldyBTZXQodC50b29scy5tYXAocj0+YCR7ci50b29sfS8ke3IucHJvZ3JhbXx8ci50b29sfWApKS5zaXplIT09dC50b29scy5sZW5ndGgpdGhyb3ciRm91bmQgZHVwbGljYXRlIHRvb2xzOyBjYW4gb25seSBoYXZlIGVhY2ggdG9vbC9wcm9ncmFtIGNvbWJpbmF0aW9uIGF0IG1vc3Qgb25jZS4iO2lmKHQuYmFzZT10LnRvb2xzLmZpbmQocj0+ci5yZWluaXQhPT0hMCksIXQuYmFzZSl0aHJvdyJDb3VsZCBub3QgZmluZCBhIHRvb2wgd2l0aCBgcmVpbml0OiBmYWxzZWAgdG8gdXNlIGFzIHRoZSBiYXNlIG1vZHVsZS4gVG8gZml4IHRoaXMgaXNzdWUsIGluY2x1ZGUgdGhlIHRvb2wgYGJhc2UvMS4wLjBgIHdoZW4gaW5pdGlhbGl6aW5nIEFpb2xpLiI7cmV0dXJuIHQuYmFzZS5pc0Jhc2VNb2R1bGU9ITAsYXdhaXQgdGhpcy5fc2V0dXAodC5iYXNlKSxhd2FpdCB0aGlzLl9pbml0TW9kdWxlcygpLHQuX2xvZygiUmVhZHkiKSwhMH0sYXN5bmMgX2luaXRNb2R1bGVzKCl7YXdhaXQgUHJvbWlzZS5hbGwodC50b29scy5tYXAodGhpcy5fc2V0dXApKSxhd2FpdCB0aGlzLl9zZXR1cEZTKCl9LG1vdW50KGU9W10pe2NvbnN0IHI9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyRGF0YX1gLGk9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyTW91bnRlZH1gO2xldCBzPVtdLG89W10sYT1bXTshQXJyYXkuaXNBcnJheShlKSYmIShlIGluc3RhbmNlb2YgRmlsZUxpc3QpJiYoZT1bZV0pLHQuX2xvZyhgTW91bnRpbmcgJHtlLmxlbmd0aH0gZmlsZXNgKTtmb3IobGV0IG4gb2YgZSl7aWYobiBpbnN0YW5jZW9mIEZpbGV8fChuPT1udWxsP3ZvaWQgMDpuLmRhdGEpaW5zdGFuY2VvZiBCbG9iJiZuLm5hbWV8fHR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmbi5uYW1lKXR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmKG4uZGF0YT1uZXcgQmxvYihbbi5kYXRhXSx7dHlwZToidGV4dC9wbGFpbiJ9KSkscy5wdXNoKG4pO2Vsc2UgaWYobi5uYW1lJiZuLnVybClvLnB1c2gobik7ZWxzZSBpZih0eXBlb2Ygbj09InN0cmluZyImJm4uc3RhcnRzV2l0aCgiaHR0cCIpKW49e3VybDpuLG5hbWU6bi5zcGxpdCgiLy8iKS5wb3AoKS5yZXBsYWNlKC9cLy9nLCItIil9LG8ucHVzaChuKTtlbHNlIHRocm93J0Nhbm5vdCBtb3VudCBmaWxlKHMpIHNwZWNpZmllZC4gTXVzdCBiZSBhIEZpbGUsIEJsb2IsIGEgVVJMIHN0cmluZywgb3IgeyBuYW1lOiAiZmlsZS50eHQiLCBkYXRhOiAic3RyaW5nIiB9Lic7YS5wdXNoKG4ubmFtZSl9dHJ5e3QuZnMudW5tb3VudChpKX1jYXRjaHt9Zm9yKGxldCBuIG9mIG8pdC5mcy5jcmVhdGVMYXp5RmlsZShyLG4ubmFtZSxuLnVybCwhMCwhMCk7cmV0dXJuIHQuZmlsZXM9dC5maWxlcy5jb25jYXQocyksdC5iYXNlLm1vZHVsZS5GUy5tb3VudCh0LmJhc2UubW9kdWxlLldPUktFUkZTLHtmaWxlczp0LmZpbGVzLmZpbHRlcihuPT5uIGluc3RhbmNlb2YgRmlsZSksYmxvYnM6dC5maWxlcy5maWx0ZXIobj0+KG49PW51bGw/dm9pZCAwOm4uZGF0YSlpbnN0YW5jZW9mIEJsb2IpfSxpKSxzLm1hcChuPT57Y29uc3QgYz1gJHtpfS8ke24ubmFtZX1gLGw9YCR7cn0vJHtuLm5hbWV9YDt0cnl7dC5mcy51bmxpbmsobCl9Y2F0Y2h7fXQuX2xvZyhgQ3JlYXRpbmcgc3ltbGluazogJHtsfSAtLT4gJHtjfWApLHQuZnMuc3ltbGluayhjLGwpfSksYS5tYXAobj0+YCR7cn0vJHtufWApfSxhc3luYyBleGVjKGUscj1udWxsKXtpZih0Ll9sb2coYEV4ZWN1dGluZyAlYyR7ZX0lYyBhcmdzPSR7cn1gLCJjb2xvcjpkYXJrYmx1ZTsgZm9udC13ZWlnaHQ6Ym9sZCIsIiIpLCFlKXRocm93IkV4cGVjdGluZyBhIGNvbW1hbmQiO2xldCBpPWU7cj09bnVsbCYmKHI9ZS5zcGxpdCgiICIpLGk9ci5zaGlmdCgpKTtjb25zdCBzPXQudG9vbHMuZmluZChhPT57dmFyIGM7bGV0IG49aTtyZXR1cm4oKGM9YT09bnVsbD92b2lkIDA6YS5mZWF0dXJlcyk9PW51bGw/dm9pZCAwOmMuc2ltZCk9PT0hMCYmKG49YCR7bn0tc2ltZGApLGEucHJvZ3JhbT09bn0pO2lmKHM9PW51bGwpdGhyb3dgUHJvZ3JhbSAke2l9IG5vdCBmb3VuZC5gO3Muc3Rkb3V0PSIiLHMuc3RkZXJyPSIiLHMubG9hZGluZz09eCYmKHMubG9hZGluZz1rLGF3YWl0IHRoaXMuX2luaXRNb2R1bGVzKCkpO3RyeXtzLm1vZHVsZS5jYWxsTWFpbihyKX1jYXRjaChhKXtjb25zb2xlLmVycm9yKGEpfXRyeXtzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzFdKSxzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzJdKX1jYXRjaHt9cy5tb2R1bGUuRlMuc3RyZWFtc1sxXT1zLm1vZHVsZS5GUy5vcGVuKCIvZGV2L3N0ZG91dCIsInciKSxzLm1vZHVsZS5GUy5zdHJlYW1zWzJdPXMubW9kdWxlLkZTLm9wZW4oIi9kZXYvc3RkZXJyIiwidyIpO2xldCBvPXtzdGRvdXQ6cy5zdGRvdXQsc3RkZXJyOnMuc3RkZXJyfTtyZXR1cm4gdC5jb25maWcucHJpbnRJbnRlcmxlYXZlZCYmKG89cy5zdGRvdXQpLHMucmVpbml0PT09ITAmJmF3YWl0IHRoaXMucmVpbml0KHMudG9vbCksb30sY2F0KGUpe3JldHVybiB0Ll9maWxlb3AoImNhdCIsZSl9LGxzKGUpe3JldHVybiB0Ll9maWxlb3AoImxzIixlKX0sZG93bmxvYWQoZSl7cmV0dXJuIHQuX2ZpbGVvcCgiZG93bmxvYWQiLGUpfSxwd2QoKXtyZXR1cm4gdC5mcy5jd2QoKX0sY2QoZSl7Zm9yKGxldCByIG9mIHQudG9vbHMpIXIubW9kdWxlfHxyLm1vZHVsZS5GUy5jaGRpcihlKX0sbWtkaXIoZSl7cmV0dXJuIHQuZnMubWtkaXIoZSksITB9LHJlYWQoe3BhdGg6ZSxsZW5ndGg6cixmbGFnOmk9InIiLG9mZnNldDpzPTAscG9zaXRpb246bz0wfSl7Y29uc3QgYT10LmZzLm9wZW4oZSxpKSxuPW5ldyBVaW50OEFycmF5KHIpO3JldHVybiB0LmZzLnJlYWQoYSxuLHMscixvKSx0LmZzLmNsb3NlKGEpLG59LHdyaXRlKHtwYXRoOmUsYnVmZmVyOnIsZmxhZzppPSJ3KyIsb2Zmc2V0OnM9MCxwb3NpdGlvbjpvPTB9KXtjb25zdCBhPXQuZnMub3BlbihlLGkpO3QuZnMud3JpdGUoYSxyLHMsci5sZW5ndGgsbyksdC5mcy5jbG9zZShhKX0sYXN5bmMgcmVpbml0KGUpe2NvbnN0IHI9dC50b29scy5maW5kKHM9PnMudG9vbD09ZSksaT10LmJhc2UubW9kdWxlLkZTLmN3ZCgpO09iamVjdC5hc3NpZ24ocixyLmNvbmZpZyksci5yZWFkeT0hMSxhd2FpdCB0aGlzLmluaXQoKSxyLmlzQmFzZU1vZHVsZSYmdGhpcy5tb3VudCgpLHRoaXMuY2QoaSl9LF9zdGRpblR4dDoiIixfc3RkaW5QdHI6MCxnZXQgc3RkaW4oKXtyZXR1cm4gdC5fc3RkaW5UeHR9LHNldCBzdGRpbihlPSIiKXt0Ll9sb2coYFNldHRpbmcgc3RkaW4gdG8gJWMke2V9JWNgLCJjb2xvcjpkYXJrYmx1ZSIsIiIpLHQuX3N0ZGluVHh0PWUsdC5fc3RkaW5QdHI9MH0sYXN5bmMgX3NldHVwKGUpe2lmKGUucmVhZHkpcmV0dXJuO2lmKHQuX2xvZyhgU2V0dGluZyB1cCAke2UudG9vbH0gKGJhc2UgPSAke2UuaXNCYXNlTW9kdWxlPT09ITB9KS4uLmApLGUuY29uZmlnPU9iamVjdC5hc3NpZ24oe30sZSksZS51cmxQcmVmaXh8fChlLnVybFByZWZpeD1gJHt0LmNvbmZpZy51cmxDRE59LyR7ZS50b29sfS8ke2UudmVyc2lvbn1gKSxlLnByb2dyYW18fChlLnByb2dyYW09ZS50b29sKSxlLmZlYXR1cmVzfHwoZS5mZWF0dXJlcz17fSwoaltlLnByb2dyYW1dfHxbXSkuaW5jbHVkZXMoInNpbWQiKSYmKGF3YWl0IFcoKT8oZS5wcm9ncmFtKz0iLXNpbWQiLGUuZmVhdHVyZXMuc2ltZD0hMCk6dC5fbG9nKGBXZWJBc3NlbWJseSBTSU1EIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhpcyBicm93c2VyOyB3aWxsIGxvYWQgbm9uLVNJTUQgdmVyc2lvbiBvZiAke2UucHJvZ3JhbX0uYCkpKSxlLmlzQmFzZU1vZHVsZSYmKGUubG9hZGluZz1rKSxlLmxvYWRpbmc9PT14KXt0Ll9sb2coYFdpbGwgbGF6eS1sb2FkICR7ZS50b29sfTsgc2tpcHBpbmcgaW5pdGlhbGl6YXRpb24uYCk7cmV0dXJufXNlbGYuaW1wb3J0U2NyaXB0cyhgJHtlLnVybFByZWZpeH0vJHtlLnByb2dyYW19LmpzYCksZS5tb2R1bGU9YXdhaXQgTW9kdWxlKHt0aGlzUHJvZ3JhbTplLnByb2dyYW0sbG9jYXRlRmlsZTooaSxzKT0+YCR7ZS51cmxQcmVmaXh9LyR7aX1gLHN0ZGluOigpPT50Ll9zdGRpblB0cjx0LnN0ZGluLmxlbmd0aD90LnN0ZGluLmNoYXJDb2RlQXQodC5fc3RkaW5QdHIrKyk6KHQuc3RkaW49IiIsbnVsbCkscHJpbnQ6aT0+e2Uuc3Rkb3V0Kz1pK2AKYCx0LmNvbmZpZy5wcmludFN0cmVhbSYmcG9zdE1lc3NhZ2Uoe3R5cGU6ImJpb3dhc20iLHZhbHVlOntzdGRvdXQ6aX19KX0scHJpbnRFcnI6aT0+e2NvbnN0IHM9dC5jb25maWcucHJpbnRJbnRlcmxlYXZlZD8ic3Rkb3V0Ijoic3RkZXJyIjtlW3NdKz1pK2AKYCx0LmNvbmZpZy5wcmludFN0cmVhbSYmcG9zdE1lc3NhZ2Uoe3R5cGU6ImJpb3dhc20iLHZhbHVlOntbc106aX19KX19KTtjb25zdCByPWUubW9kdWxlLkZTO2UuaXNCYXNlTW9kdWxlPyh0Ll9sb2coYFNldHRpbmcgdXAgJHtlLnRvb2x9IHdpdGggYmFzZSBtb2R1bGUgZmlsZXN5c3RlbS4uLmApLHIubWtkaXIodC5jb25maWcuZGlyU2hhcmVkLDUxMSksci5ta2RpcihgJHt0LmNvbmZpZy5kaXJTaGFyZWR9LyR7dC5jb25maWcuZGlyRGF0YX1gLDUxMSksci5ta2RpcihgJHt0LmNvbmZpZy5kaXJTaGFyZWR9LyR7dC5jb25maWcuZGlyTW91bnRlZH1gLDUxMSksci5jaGRpcihgJHt0LmNvbmZpZy5kaXJTaGFyZWR9LyR7dC5jb25maWcuZGlyRGF0YX1gKSx0LmZzPXIpOih0Ll9sb2coYFNldHRpbmcgdXAgJHtlLnRvb2x9IHdpdGggZmlsZXN5c3RlbS4uLmApLHIubWtkaXIodC5jb25maWcuZGlyU2hhcmVkKSxyLm1vdW50KGUubW9kdWxlLlBST1hZRlMse3Jvb3Q6dC5jb25maWcuZGlyU2hhcmVkLGZzOnQuZnN9LHQuY29uZmlnLmRpclNoYXJlZCksci5jaGRpcih0LmZzLmN3ZCgpKSksZS5zdGRvdXQ9IiIsZS5zdGRlcnI9IiIsZS5yZWFkeT0hMH0sYXN5bmMgX3NldHVwRlMoKXtjb25zdCBlPXQuZnM7Zm9yKGxldCByIG9mIHQudG9vbHMpe2lmKCFyLnJlYWR5KWNvbnRpbnVlO2NvbnN0IGk9ci5tb2R1bGUuRlMscz1gLyR7ci50b29sfWAsbz1gJHt0LmNvbmZpZy5kaXJTaGFyZWR9JHtzfWA7IWkuYW5hbHl6ZVBhdGgocykuZXhpc3RzfHxlLmFuYWx5emVQYXRoKG8pLmV4aXN0c3x8KHQuX2xvZyhgTW91bnRpbmcgJHtzfSBvbnRvICR7dC5iYXNlLnRvb2x9IGZpbGVzeXN0ZW0gYXQgJHtvfWApLGUubWtkaXIobyksZS5tb3VudCh0LmJhc2UubW9kdWxlLlBST1hZRlMse3Jvb3Q6cyxmczppfSxvKSl9fSxfZmlsZW9wKGUscil7dC5fbG9nKGBSdW5uaW5nICR7ZX0gJHtyfWApO2NvbnN0IGk9dC5mcy5hbmFseXplUGF0aChyKTtpZighaS5leGlzdHMpcmV0dXJuIHQuX2xvZyhgRmlsZSAke3J9IG5vdCBmb3VuZC5gKSwhMTtzd2l0Y2goZSl7Y2FzZSJjYXQiOnJldHVybiB0LmZzLnJlYWRGaWxlKHIse2VuY29kaW5nOiJ1dGY4In0pO2Nhc2UibHMiOnJldHVybiB0LmZzLmlzRmlsZShpLm9iamVjdC5tb2RlKT90LmZzLnN0YXQocik6dC5mcy5yZWFkZGlyKHIpO2Nhc2UiZG93bmxvYWQiOmNvbnN0IHM9bmV3IEJsb2IoW3RoaXMuY2F0KHIpXSk7cmV0dXJuIFVSTC5jcmVhdGVPYmplY3RVUkwocyl9cmV0dXJuITF9LF9sb2coZSl7aWYoIXQuY29uZmlnLmRlYnVnKXJldHVybjtsZXQgcj1bLi4uYXJndW1lbnRzXTtyLnNoaWZ0KCksY29uc29sZS5sb2coYCVjW1dlYldvcmtlcl0lYyAke2V9YCwiZm9udC13ZWlnaHQ6Ym9sZCIsIiIsLi4ucil9fTt3KHQpfSkoKTsK",P=typeof window<"u"&&window.Blob&&new Blob([atob(_)],{type:"text/javascript;charset=utf-8"});function N(){const e=P&&(window.URL||window.webkitURL).createObjectURL(P);try{return e?new Worker(e):new Worker("data:application/javascript;base64,"+_)}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}const M={urlCDN:"https://biowasm.com/cdn/v3",urlCDNStg:"https://stg.biowasm.com/cdn/v3",dirShared:"/shared",dirMounted:"/mnt",dirData:"/data",printInterleaved:!0,printStream:!1,callback:null,debug:!1,env:"prd"};class x{constructor(e,t={}){if(null==e)throw"Expecting array of tools as input to Aioli constructor.";return Array.isArray(e)||(e=[e]),t=Object.assign({},M,t),e=e.map(this._parseTool),"stg"===t.env&&(t.urlCDN=t.urlCDNStg),this.tools=e,this.config=t,null!=this.config.callback&&(this.callback=this.config.callback),delete this.config.callback,this.init()}async init(){const e=new N;this.callback&&(e.onmessage=e=>{"biowasm"===e.data.type&&this.callback(e.data.value)});const t=y(e);return t.tools=this.tools,t.config=this.config,await t.init(),t}_parseTool(e){if("string"!=typeof e)return e;const t=e.split("/");if(2!=t.length&&3!=t.length)throw"Expecting '<tool>/<version>' or '<tool>/<program>/<version>'";return{tool:t[0],program:3==t.length?t[1]:t[0],version:t[t.length-1]}}}var $=n(3629);class L{static getAvailableScales(){return Object.entries(this.scales).map((([e,t])=>e))}static getScale(e){return(0,$.vA)(!(void 0===this.scales[e]),`Scale '${e}' was not found.`),this.scales[e]}}L.scales={WimleyWhite:{"-":0,A:.17,C:-.24,D:-.07,E:-.01,F:-1.13,G:.01,H:.17,I:-.31,K:.99,L:-.56,M:-.23,N:.42,P:.45,Q:.58,R:.81,S:.13,T:.14,V:.07,W:-1.85,Y:-.94},categorial:{"-":0,A:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,K:9,L:10,M:11,N:12,P:13,Q:14,R:15,S:16,T:17,V:18,W:19,Y:20}};class I{constructor(e="categorial"){this.aa2num=L.getScale(e),this.num2aa={},Object.entries(this.aa2num).forEach((([e,t])=>this.num2aa[t]=e))}static _truncateSequence(e){let t=0,n=e.length;const r=["NH2","COOH"];if(e.startsWith(r[0])){const n=r[0].length;(0,$.vA)("-"==e[n],`Wrong sequence format: ${r[0]} without following '-' in '${e}'.`),t=n}if(e.endsWith(r[1])){const t=r[1].length+1;(0,$.vA)("-"==e[n-t],`Wrong sequence format: ${r[1]} without '-' precending in '${e}'.`),n-=t}return e.substring(t,n)}static _dropDefises(e){return e.replace(/(-)([^-]+)/g,"$2")}static clean(e){return I._dropDefises(I._truncateSequence(e))}encode(e){const t=e.length,n=new Array(t).fill(0);for(let r=0;r<t;++r){const t=e[r];(0,$.vA)(t in this.aa2num,`Unknown char '${t}' found in sequence '${e}'`),n[r]=this.encodeLettter(t)}return n}encodeLettter(e){return this.aa2num[e]}decode(e){let t="";for(let n=0;n<e.length;++n){const r=e[n];(0,$.vA)(r in this.num2aa,`Unknown code '${r}' found in vector '${e}'`),t+=this.num2aa[r]}return t}}var R=n(4139);const O="input.fa",k="result.fasta";class G extends Error{element;constructor(e,t){super(e.innerText,t),this.element=e}}function D(e){return e.reduce(((e,t,n)=>e+`>sample${n+1}\n${t}\n`),"")}async function H(e,t=!1,n="",r=null,o,i,l){let u=e.toList();t&&(u=u.map((e=>I.clean(e).replace(/\-/g,""))));const d=e.length;r??=s.Column.string("Clusters",d).init("0"),r.type!=s.COLUMN_TYPE.STRING&&(r=r.convertTo(s.TYPE.STRING)),r.compact();const h=r.categories,p=r.getRawData(),m=new Array(h.length),f=new Array(h.length);for(let e=0;e<d;++e){const t=p[e];(m[t]??=[]).push(u[e]),(f[t]??=[]).push(e)}V(f,h);const g=await new x(["base/1.0.0",{tool:"kalign",version:R.b9,reinit:!0}]),y=s.Column.string(n,d);for(let e=0;e<h.length;++e){const t=D(m[e]);await g.fs.writeFile(O,t);const n=`${void 0!==o?` --gpo ${o}`:""}${void 0!==i?` --gpe ${i}`:""}${void 0!==l?` --tgpe ${l}`:""}`,r=await g.exec(`kalign ${O} -f fasta -o ${k}${n}`);console.warn(r);const s=await g.cat(k);if(!s){const e=F(r,1);throw new Error(e)}const c=new a.m(s).sequencesArray,u=f[e];for(let e=0;e<c.length;++e)y.set(u[e],c[e])}const b=e.meta.units,w=e.getTag(c.gp.alphabet);return y.meta.units=b,y.setTag(c.gp.aligned,"SEQ.MSA"),y.setTag(c.gp.alphabet,w),y.semType=s.SEMTYPE.MACROMOLECULE,y}function F(e,t){const n=[],r=/^.+ERROR : (.+)$/gm;let s;for(;null!=(s=r.exec(e))&&(void 0===t||n.length<t);)n.push(s[1]);return n.join("\n")}function V(e,t){const n=e.map(((e,t)=>[e,t])).filter((([e,t])=>1==e.length)).map((([e,t])=>t));if(n.length>0){const e=r.div([r.divText(`MSA analysis is not available on single sequence clusters #${n.length}:`),...i()(n).take(3).map((e=>{let s=t[e];return s.length>25&&(s=s.slice(0,25)+"..."),r.divText(`"${s}"${e<n.length-1?", ":"."}`)})).toArray(),...n.length>3?[r.divText("...")]:[]]);throw new G(e)}}},8152:(e,t,n)=>{"use strict";n.d(t,{GD:()=>h,Nk:()=>l,ZY:()=>u});var r=n(4328),s=n(6082),o=n(2003),i=n(608),a=n(4139),c=n(4374);const l=new class{dcName="bio";async getDockerContainer(){return await r.dapi.docker.dockerContainers.filter(this.dcName).first()}},u=["mafft --auto","mafft","linsi","ginsi","einsi","fftns","fftnsi","nwns","nwnsi"],d=["AlignedSeq","AlignedSubpeptide","HELM","ID","PolymerID"];async function h(e,t,n="ginsi",r=1.53,c=0,u=null,h){const m=await l.getDockerContainer();if("started"!==m.status&&"checking"!==m.status)throw new Error("PepSeA container has not started yet");const f=e.length;u??=s.Column.int("Clusters",f).init(0),u.type!=s.COLUMN_TYPE.STRING&&(u=u.convertTo(s.TYPE.STRING));const g=u.categories,y=u.getRawData(),b=new Array(g.length),w=new Array(g.length);for(let t=0;t<f;++t){const n=y[t],r=g[n];if(""===r)continue;const s=g.indexOf(r),o=e.get(t);o&&((b[s]??=[]).push({ID:t.toString(),HELM:o}),(w[n]??=[]).push(t))}(0,i.aZ)(w,g);const v=new Array(f);for(const e of b){const t=(await p(m.id,e,n,r,c,h)).Alignment;for(const e of t)v[parseInt(e.ID)]=Object.entries(e).filter((e=>!d.includes(e[0]))).map((e=>"-"!==e[1]?e[1]:"")).join(a.J.SEPARATOR)}const A=s.Column.fromStrings(t,v);return A.meta.units=o.Hi.SEPARATOR,A.setTag(o.gp.separator,a.J.SEPARATOR),A.setTag(o.gp.aligned,"SEQ.MSA"),A.setTag(o.gp.alphabet,o.YI.UN),A.setTag(o.gp.alphabetIsMultichar,"true"),A.semType=s.SEMTYPE.MACROMOLECULE,A}async function p(e,t,n,s,o,i){const a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)},l=`/align?method=${n}&gap_open=${s}&gap_extend=${o}`;let u;if("fetchProxy"in r.dapi.docker.dockerContainers){const t=window.performance.now(),n=await r.dapi.docker.dockerContainers.fetchProxy(e,l,a),s=window.performance.now();c._package.logger.debug(`Bio: requestAlignedObjects() dockerContainers.fetchProxy(), ET: ${s-t} ms`);const o="application/json"===n.headers.get("content-type");if(!n.ok&&o){const e=await n.json(),t=e["pepsea-error"];if(t)throw new Error(`PepSeA error: ${t}`);const r=e["datagrok-error"];if(r)throw new Error(`Datagrok error: ${r}`);throw new Error(n.statusText)}if(!n.ok&&!o){const e=await n.text();throw new Error(`Error: ${e}`)}if(!o){const e=await n.text();throw new Error(`Error: PepSeA expected JSON response, got '${e}'.`)}u=await n.json()}else{const t=await r.dapi.docker.dockerContainers.request(e,l,a);if(!t)throw new Error("Empty response");u=JSON.parse(t);const n=u["pepsea-error"];if(n)throw new Error(`PepSeA error: ${n}`);const s=u["datagrok-error"];if(s)throw new Error(`Datagrok error: ${s}`)}if("pepsea-stderr"in u){const e=u["pepsea-stderr"];i?.warning(e)}return u}},3890:(e,t,n)=>{"use strict";n.d(t,{aS:()=>a,wz:()=>i}),n(6082),n(7389),n(4328);var r=n(1991),s=n.n(r);n(4374);const o=60;function i(e,t,n=o,r="\n"){const s=[];for(let o=0;o<t.length;o++){const i=e.map((e=>e.get(o).toString())).join("|"),c=a(t.getSplitted(o),n);s.push(`>${i}${r}`);for(const e of c)s.push(`${e}${r}`)}return"".concat(...s)}function a(e,t=o){let n=0;const r=e.length,i=[];for(;n<r;){const r=s().count(n).take(Math.min(e.length-n,t)).map((t=>e.getOriginal(t))).toArray(),o=r.map((e=>e.length>1?`[${e}]`:e)).reduce(((e,t)=>e+t),"");i.push(o),n+=r.length}return i}},8754:(e,t,n)=>{"use strict";n.d(t,{V:()=>u});var r=n(4328),s=n(6077),o=n(2003),i=n(8312),a=n(310),c=n(966),l=n(330);async function u(e,t,n,u,d,h,p){let m;if(n){const n=await(0,i.Q)(),r=n.getSeqHandler(t);let s,a;r.isHelm()?s=t:(a=t.name,t.name=`__${a}`,s=r.convert(o.Hi.HELM),s.name=a,e.columns.add(s,!1));try{m=await n.helmToAtomicLevel(s,!0,!0)}finally{s!==t&&(e.columns.remove(s.name),t.name=a)}}else{if(!(0,c.l)(t,"To Atomic Level",h)[0])return{molCol:null,warnings:["Column is not suitable"]};m=await(0,s.C4)(e,t,d,h,p)}if(m.molCol){const n=(0,l.qj)(e,t.name);m.molCol.name=n,e.columns.add(m.molCol,!0),(0,a.Qc)(t,m.molCol,d,h,p),m.molCol.setTag(".sequence-src-highlight-monomers",String(u)),await r.data.detectSemanticTypes(e)}return m}},4870:(e,t,n)=>{"use strict";function r(e,t){e.innerHTML="",e.append(t)}n.d(t,{K:()=>r}),n(4328),n(6082)},8047:(e,t,n)=>{"use strict";n.d(t,{VN:()=>m,n5:()=>l,Ue:()=>p,Tc:()=>h,eN:()=>f}),n(4328),n(7389);var r=n(6082),s=(n(1757),n(1991),n(1858),n(2003)),o=n(4326);n(8070),n(7602);var i=n(439),a=n(6882);var c,l,u,d=n(2174);n(4374),HTMLCanvasElement.prototype.getCursorPosition=function(e,t){const n=this.getBoundingClientRect();return new r.Point((e.clientX-n.left)*t,(e.clientY-n.top)*t)},r.Rect.prototype.contains=function(e,t){return this.left<=e&&e<=this.right&&this.top<=t&&t<=this.bottom};class h{rowCount;value;plotValue;valueList=null;valueIdx=0;bounds;constructor(e=0,t){this.value=this.rowCount=e,this.bounds=t}push(e){this.valueList||(this.valueList=new Array(this.rowCount),this.valueIdx=0),this.valueList[this.valueIdx]=e,++this.valueIdx}aggregate(e){this.value=e(this.valueList)??0,this.valueList=null}}class p{pos;name;_label;get label(){return this._label?this._label:this.name}_freqs;sumRowCount=0;sumPlotValue;sumPlotValueForHeight;constructor(e,t,n,r){this.pos=e,this.name=t,this._freqs=n??{},r?.sumRowCount&&(this.sumRowCount=r.sumRowCount),r?.sumValueForHeight&&(this.sumPlotValue=r.sumValueForHeight),r?.label&&(this._label=r.label)}getMonomers(){return Object.keys(this._freqs)}hasMonomer(e){return e in this._freqs}getFreq(e){let t=this._freqs[e];return t||(t=this._freqs[e]=new h),t}aggregate(e){const t=function(e){return t=>{const n=function(e){let t;const n="agg";return t=e instanceof Float32Array?r.Column.fromFloat32Array(n,e):e instanceof Int32Array?r.Column.fromInt32Array(n,e):r.Column.fromList(r.COLUMN_TYPE.FLOAT,n,e),t}(t);return n.aggregate(e)}}(e);for(const[e,n]of Object.entries(this._freqs))n.aggregate(t)}getMinValue(){return Math.min(...Object.values(this._freqs).map((e=>e.value)))}calcPlotValue(e){for(const t of Object.values(this._freqs))t.plotValue=t.value-e}calcHeights(e){this.sumPlotValue=0;for(const e of Object.values(this._freqs))this.sumPlotValue+=e.plotValue;if(this.sumPlotValueForHeight=0,e===o.fH.Entropy){const e=Object.keys(this._freqs).length,t=.01*this.sumPlotValue,n=t/e;for(const e of Object.values(this._freqs)){const r=(e.plotValue+n)/(this.sumPlotValue+t);this.sumPlotValueForHeight+=-r*Math.log2(r)}}else if(e===o.fH.full)for(const[e,t]of Object.entries(this._freqs)){const e=t.plotValue/this.sumPlotValue;this.sumPlotValueForHeight+=e}}calcScreen(e,t,n,s,a,c,l,u,d){const h=s===o.fH.Entropy?n*(a-this.sumPlotValueForHeight)/a:n;let p=d*u+(n-h-1);const m=Object.entries(this._freqs).sort(((e,t)=>e[0]!==i._S&&t[0]!==i._S?t[1].value-e[1].value:e[0]===i._S&&t[0]===i._S?0:e[0]===i._S?-1:1));for(const[n,s]of m){const n=h*s.plotValue/this.sumPlotValue;s.bounds=new r.Rect((e-t)*u*c,p,l*u,n),p+=n}}render(e,t,n,r,o,c){for(const[l,u]of Object.entries(this._freqs))if(l!==i._S){const i=(0,s.zS)(l,5),d=u.bounds,h=d.left;let p=a.S$;c&&(p=c.getMonomerTextColor(o,l)),e.resetTransform(),e.strokeStyle="lightgray",e.lineWidth=1,e.rect(h,d.top,d.width,d.height),e.fillStyle=p,e.textAlign="left",e.font=t;const m=e.measureText(i);e.setTransform(d.width/m.width,0,0,d.height/r,h,d.top),e.fillText(i,0,-n)}}getMonomerAt(e,t){const n=Object.entries(this._freqs).find((([n,r])=>r.bounds.contains(e,t)));return n?n[0]:void 0}buildCompositionTable(e,t){if("-"in this._freqs)throw new Error("Unexpected monomer symbol '-'.");return(0,d.F)(Object.assign({},...Object.entries(this._freqs).map((([e,t])=>({[e]:t.rowCount})))),e,t)}}!function(e){e.STYLE="Style",e.BEHAVIOR="Behavior",e.LAYOUT="Layout",e.DATA="Data"}(c||(c={})),function(e){e.sequenceColumnName="sequenceColumnName",e.valueAggrType="valueAggrType",e.valueColumnName="valueColumnName",e.startPositionName="startPositionName",e.endPositionName="endPositionName",e.skipEmptySequences="skipEmptySequences",e.skipEmptyPositions="skipEmptyPositions",e.shrinkEmptyTail="shrinkEmptyTail",e.backgroundColor="backgroundColor",e.positionHeight="positionHeight",e.positionWidth="positionWidth",e.verticalAlignment="verticalAlignment",e.horizontalAlignment="horizontalAlignment",e.fixWidth="fixWidth",e.fitArea="fitArea",e.minHeight="minHeight",e.maxHeight="maxHeight",e.showPositionLabels="showPositionLabels",e.positionMarginState="positionMarginState",e.positionMargin="positionMargin",e.filterSource="filterSource"}(l||(l={})),o.Fo,function(e){e[e.None=0]="None",e[e.Render=1]="Render",e[e.Layout=1]="Layout",e[e.Freqs=2]="Freqs"}(u||(u={}));const m=new class{render=20};function f(e,t,n,r,s){let o=0,i=-1;for(;-1!=(i=n.findNext(i,!0));){const e=t.getSplitted(i),n=s.pos,a=n<e.length?e.getCanonical(n):null;null!==a&&a===r&&o++}return o}r.JsViewer},4577:(e,t,n)=>{"use strict";n.d(t,{O:()=>i,n:()=>o});var r=n(1858),s=n(4374);class o{substructure;readOnly;constructor(e,t=!0){return this.substructure=e,this.readOnly=t,new Proxy(this,{set:(e,t,n)=>{if(s._package.logger.debug(`BioFilterProps.set ${t.toString()}( '${n}' )`),this.readOnly)throw new Error("Properties are immutable.");return e[t]=n,!0}})}}class i{onChanged=new r.Subject;_props;_propsChanging=!1;get props(){return this._props||(this._props=this.emptyProps),this._props}set props(e){this._propsChanging=!0;try{this._props=e,this.applyProps(),this.onChanged.next()}finally{this._propsChanging=!1}}saveProps(){const e={};for(const[t,n]of Object.entries(this.props))"_onChanged"!==t&&(e[t]=this.props[t]);return e}async detach(){}get filterSummary(){return this.props.substructure}get isFiltering(){return""!==this.props.substructure}resetFilter(){this.props=this.emptyProps,this.onChanged.next()}}},1687:(e,t,n)=>{"use strict";n.d(t,{_i:()=>C,AR:()=>T});var r=n(7389),s=n(6082),o=n(4328),i=n(1991),a=n.n(i),c=n(1858),l=n(2003),u=n(8070),d=n(7602),h=n(8115),p=n(4577),m=n(1757),f=n.n(m),g=n(9124),y=n(9192),b=n(4870),w=n(4374);class v extends p.O{seqHelper;emptyProps=new p.n("");helmEditor;_filterPanel=r.div("",{style:{cursor:"pointer"}});logger;static viewerCounter=-1;viewerId=++v.viewerCounter;viewerToLog(){return`HelmBioFilter<${this.viewerId}>`}get type(){return"HelmBioFilter"}constructor(e){super(),this.seqHelper=e,this.logger=w._package.logger}viewSubs=[];async detach(){await super.detach();for(const e of this.viewSubs)e.unsubscribe()}async attach(){this.viewerToLog();try{const e=await(0,g.b2)();let t,n;this.helmEditor=e.createHelmWebEditor(),this.logger.warning("TEST: HelmBioFilter.init().sync() waitForElementInDom waiting..."),await r.tools.waitForElementInDom(this._filterPanel),this.logger.warning("TEST: HelmBioFilter.init().sync() waitForElementInDom ready"),this.updateFilterPanel(),this.viewSubs.push((0,c.fromEvent)(this._filterPanel,"click").subscribe((()=>{t=r.div(),n=e.createWebEditorApp(t,this.props.substructure),r.dialog({showHeader:!1,showFooter:!0}).add(t).onOK((()=>{try{const e=n.canvas.getHelm(!0).replace(/<\/span>/g,"").replace(/<span style='background:#bbf;'>/g,"");this.props=new p.n(e)}catch(e){this.logger.error(e)}finally{f()(t).empty(),t=null,n=null}})).onCancel((()=>{f()(t).empty(),t=null,n=null})).show({modal:!0,fullScreen:!0})}))),this.viewSubs.push(r.onSizeChanged(this._filterPanel).subscribe((e=>{try{if(n){const e=n.canvas.getHelm(!0).replace(/<\/span>/g,"").replace(/<span style='background:#bbf;'>/g,"");this.updateFilterPanel(e)}}catch(e){const[t,n]=(0,y.AP)(e);this.logger.error(t,void 0,n)}})))}catch(e){const[t,n]=(0,y.AP)(e),s=this._filterPanel;s.innerText="error",s.classList.add("d4-error"),r.tooltip.bind(s,t)}}applyProps(){this.helmEditor&&this.updateFilterPanel(this.props.substructure)}get filterPanel(){return this._filterPanel}updateFilterPanel(e){if(!this.helmEditor)throw new Error("helmEditor is not created, the filter is not in dom yet");const t=this._filterPanel.parentElement.clientWidth<100?100:this._filterPanel.parentElement.clientWidth,n=t/2;if(e)(0,b.K)(this._filterPanel,this.helmEditor.host),this.helmEditor.editor.setHelm(e),this.helmEditor.resizeEditor(t,n);else{const e=r.divText("Click to edit","helm-substructure-filter");(0,b.K)(this._filterPanel,e)}}async substructureSearch(e){const t=`${this.viewerToLog()}.substructureSearch( column = <${e.name}> )`;w._package.logger.debug(`${t}, start`);try{return await(0,u.cb)(10),await(0,h.if)(this.props.substructure,e,this.seqHelper)}finally{w._package.logger.debug(`${t}, end`)}}}const A="bio-substructure-filter";class E{props;filterId;dataFrameId;columnName;bitset;constructor(e,t,n,r,s){this.props=e,this.filterId=t,this.dataFrameId=n,this.columnName=r,this.bitset=s}}class T extends p.n{separator;constructor(e,t){super(e,!1),this.separator=t,this.readOnly=!0}}class C extends s.Filter{seqHelper;logger;bioFilter=null;bitset=null;loader;notation=void 0;filterSyncer;get calculating(){return"initial"==this.loader.style.display}set calculating(e){this.loader.style.display=e?"initial":"none"}get filterSummary(){return this.bioFilter.filterSummary}get isFiltering(){return super.isFiltering&&(this.bioFilter?.isFiltering??!1)}get isReadyToApplyFilter(){return!this.calculating&&null!=this.bitset}get debounceTime(){if(null==this.column)return 1e3;const e=this.column.length;return e<500?0:e>1e4?1e3:Math.floor((e-500)/9500*1e3)}constructor(e,t){super(),this.seqHelper=e,this.logger=t,this.root=r.divV([]),this.loader=r.loader(),this.calculating=!1,this.filterSyncer=new d.g(this.logger)}static filterCounter=-1;filterId=++C.filterCounter;filterToLog(){return`BioSubstructureFilter<${this.filterId}>`}viewSubs=[];attach(e){const t=super.attach.bind(this),n=`${this.filterToLog()}.attach()`;this.filterSyncer.sync(n,(async()=>{t(e),this.column||(this.columnName?this.column=this.dataFrame.getCol(this.columnName):this.column=e.columns.bySemType(s.SEMTYPE.MACROMOLECULE)),this.seqHelper.getSeqHandler(this.column),this.columnName??=this.column?.name,this.notation??=this.column?.meta.units,this.bioFilter=this.notation===l.Hi.FASTA?new S:this.notation===l.Hi.SEPARATOR?new _(this.column.getTag(l.gp.separator)):new v(this.seqHelper),this.root.appendChild(this.bioFilter.filterPanel),this.root.appendChild(this.loader),await this.bioFilter.attach(),this.viewSubs.push(s.debounce(this.bioFilter.onChanged,this.debounceTime).subscribe(this.bioFilterOnChangedDebounced.bind(this))),this.viewSubs.push(o.events.onResetFilterRequest.subscribe(this.grokEventsOnResetFilterRequest.bind(this))),this.viewSubs.push(o.events.onCustomEvent(A).subscribe(this.filterOnSync.bind(this)))}))}detach(){const e=super.detach.bind(this),t=`${this.filterToLog()}.detach()`;this.filterSyncer.sync(t,(async()=>{for(const e of this.viewSubs)e.unsubscribe();this.viewSubs=[],e(),this.bioFilter&&this.bioFilter.detach(),this.bioFilter=null}))}filterOnSync(e){e.filterId!==this.filterId&&e.dataFrameId===this.dataFrame.id&&e.columnName===this.columnName&&(this.bioFilter.props=e.props)}applyFilter(){const e=`${this.filterToLog()}.applyFilter()`;this.logger.debug(`${e}, IN`),this.bitset&&!this.isDetached&&this.dataFrame?.filter.and(this.bitset)}saveState(){const e=`${this.filterToLog()}.saveState()`,t=super.saveState();return this.logger.debug(`${e}, super.state = ${JSON.stringify(t)}`),t.props=this.bioFilter.saveProps(),t}applyState(e){const t=`${this.filterToLog()}.applyState()`;super.applyState(e),this.filterSyncer.sync(t,(async()=>{e.props&&this.bioFilter&&(this.bioFilter.props=s.toJs(e.props??{}))}))}fireFilterSync(){const e=`${this.filterToLog()}.fireFilterSync()`;this.logger.debug(`${e}, bioFilter = ${this.bioFilter?this.bioFilter.constructor.name:"null"}`+(this.bioFilter?`, props = ${JSON.stringify(this.bioFilter.saveProps())}`:"")),o.events.fireCustomEvent(A,new E(this.bioFilter.props,this.filterId,this.dataFrame.id,this.columnName,this.bitset))}bioFilterOnChangedDebounced(){if(!this.dataFrame)return;const e=`${this.filterToLog()}.bioFilterOnChangedDebounced()`;if(this.logger.debug(`${e}, start, isFiltering = ${this.isFiltering}, props = ${JSON.stringify(this.bioFilter.saveProps())}`),!this.isFiltering)return this.bitset=null,void this.dataFrame.rows.requestFilter();a()(this.dataFrame.rows.filters).has(`${this.columnName}: ${this.filterSummary}`)||this.filterSyncer.sync(e,(async()=>{this.calculating=!0;try{this.logger.debug(`${e}, before substructureSearch`),this.bitset=await(this.bioFilter?.substructureSearch(this.column)),this.logger.debug(`${e}, after substructureSearch`),this.calculating=!1,this.fireFilterSync(),this.dataFrame?.rows.requestFilter()}finally{this.calculating=!1,this.logger.debug(`${e}, end`)}}))}grokEventsOnResetFilterRequest(){const e=`${this.filterToLog()}.grokEventsOnResetFilterRequest()`;this.logger.debug(`${e}`),this.bioFilter?.resetFilter()}_onRendered=new c.Subject;get onRendered(){return this._onRendered}invalidate(e){const t=`${this.filterToLog()}.invalidate(${e?` <- ${e} `:""})`;this.filterSyncer.sync(t,(async()=>{this._onRendered.next()}))}async awaitRendered(e=1e4){const t=`awaitRendered( ${e} )`,n=`${this.filterToLog()}.${t}`;await(0,u.cb)(10),await(0,u.PE)(this.onRendered,(()=>{this.logger.debug(`${n}, _onRendered event caught`)}),(()=>{this.invalidate(t)}),e,`${n} timeout`);const r=this.filterSyncer.resetErrors();if(r.length>0)throw r[0]}}class S extends p.O{emptyProps=new p.n("");substructureInput;get type(){return"FastaBioFilter"}constructor(){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{window.setTimeout((()=>{this.props=new p.n(e),this._propsChanging||this.onChanged.next()}),0)},placeholder:"Substructure"})}applyProps(){this.substructureInput.value!==this.props.substructure&&(this.substructureInput.value=this.props.substructure)}get filterPanel(){return this.substructureInput.root}get isFiltering(){return""!==this.substructureInput.value}async substructureSearch(e){return(0,h.nI)(this.props.substructure,e)}async attach(){}async detach(){await super.detach()}}class _ extends p.O{emptyProps=new T("",void 0);substructureInput;separatorInput;colSeparator="";get type(){return"SeparatorBioFilter"}constructor(e){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{this.props=new T(e,this.props.separator),this._propsChanging||this.onChanged.next()},placeholder:"Substructure"}),this.separatorInput=r.input.string("",{value:this.colSeparator=e,onValueChanged:e=>{const t=e||void 0;this.props=new T(this.props.substructure,t),this._propsChanging||this.onChanged.next()},placeholder:"Separator"})}applyProps(){this.substructureInput.value!==this.props.substructure&&(this.substructureInput.value=this.props.substructure);const e=this.props.separator??this.colSeparator;this.separatorInput.value!==e&&(this.separatorInput.value=e)}get filterSummary(){return this.props.separator?this.props.separator:this.colSeparator,`${this.props.substructure}, {sep}`}get isFiltering(){return""!==this.props.substructure}resetFilter(){this.props=new T("")}get filterPanel(){return r.divV([this.substructureInput.root,this.separatorInput.root])}get substructure(){return this.separatorInput.value&&this.separatorInput.value!==this.colSeparator?this.substructureInput.value.replaceAll(this.separatorInput.value,this.colSeparator):this.substructureInput.value}set substructure(e){this.substructureInput.value=e}async substructureSearch(e){return(0,h.nI)(this.substructure,e,this.colSeparator)}async attach(){}async detach(){await super.detach()}}},2174:(e,t,n)=>{"use strict";n.d(t,{F:()=>v});var r=n(7389),s=n(6082),o=(n(1991),n(2003),n(439)),i=(n(3599),n(5072)),a=n.n(i),c=n(7825),l=n.n(c),u=n(7659),d=n.n(u),h=n(5056),p=n.n(h),m=n(540),f=n.n(m),g=n(1113),y=n.n(g),b=n(5999),w={};function v(e,t,n){let i=0,a=null;for(const t of Object.values(e))i+=t,a=null===a?t:Math.max(a,t);const c=a/i,l=Object.assign({},...Array.from(Object.entries(e)).sort(((e,t)=>t[1]-e[1])).map((([e,a])=>{const l=a/i,u=n.getWebEditorMonomer(t,e).backgroundcolor,d=r.div("",{classes:"macromolecule-cell-comp-analysis-bar"});d.style.width=50*l/c+"px",d.style.backgroundColor=u,o._S===e&&(d.style.borderWidth="1px",d.style.borderStyle="solid",d.style.borderColor=s.Color.toHtml(s.Color.lightGray));const h=o._S===e?"-":e,p=r.div(`${(100*l).toFixed(2)}%`),m=r.div([d,p],{classes:"macromolecule-cell-comp-analysis-value"});return{[h]:m}}))),u=r.tableFromMap(l);return Array.from(u.rows).forEach((e=>{const t=e.getElementsByClassName("macromolecule-cell-comp-analysis-bar")[0].style.backgroundColor;e.cells[0].style.color=t})),u}w.styleTagTransform=y(),w.setAttributes=p(),w.insert=d().bind(null,"head"),w.domAPI=l(),w.insertStyleElement=f(),a()(b.A,w),b.A&&b.A.locals&&b.A.locals},1757:e=>{"use strict";e.exports=$},6082:e=>{"use strict";e.exports=DG},4328:e=>{"use strict";e.exports=grok},1858:e=>{"use strict";e.exports=rxjs},7389:e=>{"use strict";e.exports=ui},1991:e=>{"use strict";e.exports=wu},8343:(e,t,n)=>{"use strict";const{normalizeIPv6:r,normalizeIPv4:s,removeDotSegments:o,recomposeAuthority:i,normalizeComponentEncoding:a}=n(4834),c=n(343);function l(e,t,n,r){const s={};return r||(e=p(u(e,n),n),t=p(u(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=o(t.path||""),s.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=o(t.path||""),s.query=t.query):(t.path?("/"===t.path.charAt(0)?s.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:s.path=t.path:s.path="/"+t.path,s.path=o(s.path)),s.query=t.query):(s.path=e.path,void 0!==t.query?s.query=t.query:s.query=e.query),s.userinfo=e.userinfo,s.host=e.host,s.port=e.port),s.scheme=e.scheme),s.fragment=t.fragment,s}function u(e,t){const n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},r=Object.assign({},t),s=[],a=c[(r.scheme||n.scheme||"").toLowerCase()];a&&a.serialize&&a.serialize(n,r),void 0!==n.path&&(r.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),void 0!==n.scheme&&(n.path=n.path.split("%3A").join(":")))),"suffix"!==r.reference&&n.scheme&&(s.push(n.scheme),s.push(":"));const l=i(n,r);if(void 0!==l&&("suffix"!==r.reference&&s.push("//"),s.push(l),n.path&&"/"!==n.path.charAt(0)&&s.push("/")),void 0!==n.path){let e=n.path;r.absolutePath||a&&a.absolutePath||(e=o(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),s.push(e)}return void 0!==n.query&&(s.push("?"),s.push(n.query)),void 0!==n.fragment&&(s.push("#"),s.push(n.fragment)),s.join("")}const d=Array.from({length:127},((e,t)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(t)))),h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(e,t){const n=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=-1!==e.indexOf("%");let a=!1;"suffix"===n.reference&&(e=(n.scheme?n.scheme+":":"")+"//"+e);const l=e.match(h);if(l){if(o.scheme=l[1],o.userinfo=l[3],o.host=l[4],o.port=parseInt(l[5],10),o.path=l[6]||"",o.query=l[7],o.fragment=l[8],isNaN(o.port)&&(o.port=l[5]),o.host){const e=s(o.host);if(!1===e.isIPV4){const t=r(e.host,{isIPV4:!1});o.host=t.host.toLowerCase(),a=t.isIPV6}else o.host=e.host,a=!0}void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||o.path||void 0!==o.query?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==o.reference&&(o.error=o.error||"URI is not a "+n.reference+" reference.");const e=c[(n.scheme||o.scheme||"").toLowerCase()];if(!(n.unicodeSupport||e&&e.unicodeSupport)&&o.host&&(n.domainHost||e&&e.domainHost)&&!1===a&&function(e){let t=0;for(let n=0,r=e.length;n<r;++n)if(t=e.charCodeAt(n),t>126||d[t])return!0;return!1}(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(e){o.error=o.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(i&&void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),i&&void 0!==o.userinfo&&(o.userinfo=unescape(o.userinfo)),i&&void 0!==o.host&&(o.host=unescape(o.host)),void 0!==o.path&&o.path.length&&(o.path=escape(unescape(o.path))),void 0!==o.fragment&&o.fragment.length&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),e&&e.parse&&e.parse(o,n)}else o.error=o.error||"URI can not be parsed.";return o}const m={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=u(p(e,t),t):"object"==typeof e&&(e=p(u(e,t),t)),e},resolve:function(e,t,n){const r=Object.assign({scheme:"null"},n);return u(l(p(e,r),p(t,r),r,!0),{...r,skipEscape:!0})},resolveComponents:l,equal:function(e,t,n){return"string"==typeof e?(e=unescape(e),e=u(a(p(e,n),!0),{...n,skipEscape:!0})):"object"==typeof e&&(e=u(a(e,!0),{...n,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=u(a(p(t,n),!0),{...n,skipEscape:!0})):"object"==typeof t&&(t=u(a(t,!0),{...n,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:u,parse:p};e.exports=m,e.exports.default=m,e.exports.fastUri=m},343:e=>{"use strict";const t=/^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu,n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function s(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function o(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const i={scheme:"http",domainHost:!0,parse:s,serialize:o},a={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=r(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(r(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,n]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}},c={http:i,https:{scheme:"https",domainHost:i.domainHost,parse:s,serialize:o},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(n);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const s=`${n}:${t.nid||e.nid}`,o=c[s];e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){const n=t.scheme||e.scheme||"urn",r=e.nid.toLowerCase(),s=`${n}:${t.nid||r}`,o=c[s];o&&(e=o.serialize(e,t));const i=e,a=e.nss;return i.path=`${r||t.nid}:${a}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,n){const r=e;return r.uuid=r.nss,r.nss=void 0,n.tolerant||r.uuid&&t.test(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};e.exports=c},4914:e=>{"use strict";e.exports={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}},4834:(e,t,n)=>{"use strict";const{HEX:r}=n(4914);function s(e){if(c(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/u)||[],[n]=t;return n?{host:a(n,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function o(e,t=!1){let n="",s=!0;for(const t of e){if(void 0===r[t])return;"0"!==t&&!0===s&&(s=!1),s||(n+=t)}return t&&0===n.length&&(n="0"),n}function i(e,t={}){if(c(e,":")<2)return{host:e,isIPV6:!1};const n=function(e){let t=0;const n={error:!1,address:"",zone:""},r=[],s=[];let i=!1,a=!1,c=!1;function l(){if(s.length){if(!1===i){const e=o(s);if(void 0===e)return n.error=!0,!1;r.push(e)}s.length=0}return!0}for(let o=0;o<e.length;o++){const u=e[o];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!l())break;i=!0}else s.push(u);else{if(!0===a&&(c=!0),!l())break;if(t++,r.push(":"),t>7){n.error=!0;break}o-1>=0&&":"===e[o-1]&&(a=!0)}}return s.length&&(i?n.zone=s.join(""):c?r.push(s.join("")):r.push(o(s))),n.address=r.join(""),n}(e);if(n.error)return{host:e,isIPV6:!1};{let e=n.address,t=n.address;return n.zone&&(e+="%"+n.zone,t+="%25"+n.zone),{host:e,escapedHost:t,isIPV6:!0}}}function a(e,t){let n="",r=!0;const s=e.length;for(let o=0;o<s;o++){const i=e[o];"0"===i&&r?(o+1<=s&&e[o+1]===t||o+1===s)&&(n+=i,r=!1):(r=i===t,n+=i)}return n}function c(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}const l=/^\.\.?\//u,u=/^\/\.(?:\/|$)/u,d=/^\/\.\.(?:\/|$)/u,h=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e,t){const n=[];if(void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host){let t=unescape(e.host);const r=s(t);if(r.isIPV4)t=r.host;else{const n=i(r.host,{isIPV4:!1});t=!0===n.isIPV6?`[${n.escapedHost}]`:e.host}n.push(t)}return"number"!=typeof e.port&&"string"!=typeof e.port||(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0},normalizeComponentEncoding:function(e,t){const n=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=n(e.scheme)),void 0!==e.userinfo&&(e.userinfo=n(e.userinfo)),void 0!==e.host&&(e.host=n(e.host)),void 0!==e.path&&(e.path=n(e.path)),void 0!==e.query&&(e.query=n(e.query)),void 0!==e.fragment&&(e.fragment=n(e.fragment)),e},removeDotSegments:function(e){const t=[];for(;e.length;)if(e.match(l))e=e.replace(l,"");else if(e.match(u))e=e.replace(u,"/");else if(e.match(d))e=e.replace(d,"/"),t.pop();else if("."===e||".."===e)e="";else{const n=e.match(h);if(!n)throw new Error("Unexpected dot segment condition");{const r=n[0];e=e.slice(r.length),t.push(r)}}return t.join("")},normalizeIPv4:s,normalizeIPv6:i,stringArrayToHexStripped:o}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},7216:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/applicator":true},"$dynamicAnchor":"meta","title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"prefixItems":{"$ref":"#/$defs/schemaArray"},"items":{"$dynamicRef":"#meta"},"contains":{"$dynamicRef":"#meta"},"additionalProperties":{"$dynamicRef":"#meta"},"properties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"propertyNames":{"$dynamicRef":"#meta"},"if":{"$dynamicRef":"#meta"},"then":{"$dynamicRef":"#meta"},"else":{"$dynamicRef":"#meta"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$dynamicRef":"#meta"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$dynamicRef":"#meta"}}}}')},8226:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/content","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentEncoding":{"type":"string"},"contentMediaType":{"type":"string"},"contentSchema":{"$dynamicRef":"#meta"}}}')},518:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/core","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true},"$dynamicAnchor":"meta","title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"$ref":"#/$defs/uriReferenceString","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"$ref":"#/$defs/uriString"},"$ref":{"$ref":"#/$defs/uriReferenceString"},"$anchor":{"$ref":"#/$defs/anchorString"},"$dynamicRef":{"$ref":"#/$defs/uriReferenceString"},"$dynamicAnchor":{"$ref":"#/$defs/anchorString"},"$vocabulary":{"type":"object","propertyNames":{"$ref":"#/$defs/uriString"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"}}},"$defs":{"anchorString":{"type":"string","pattern":"^[A-Za-z_][-A-Za-z0-9._]*$"},"uriString":{"type":"string","format":"uri"},"uriReferenceString":{"type":"string","format":"uri-reference"}}}')},4588:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/format-annotation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},"$dynamicAnchor":"meta","title":"Format vocabulary meta-schema for annotation results","type":["object","boolean"],"properties":{"format":{"type":"string"}}}')},5707:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},"$dynamicAnchor":"meta","title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}')},9547:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/unevaluated","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},"$dynamicAnchor":"meta","title":"Unevaluated applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"unevaluatedItems":{"$dynamicRef":"#meta"},"unevaluatedProperties":{"$dynamicRef":"#meta"}}}')},7082:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/validation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/validation":true},"$dynamicAnchor":"meta","title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]},"const":true,"enum":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}')},1678:e=>{"use strict";e.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/unevaluated"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format-annotation"},{"$ref":"meta/content"}],"type":["object","boolean"],"$comment":"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.","properties":{"definitions":{"$comment":"\\"definitions\\" has been replaced by \\"$defs\\".","type":"object","additionalProperties":{"$dynamicRef":"#meta"},"deprecated":true,"default":{}},"dependencies":{"$comment":"\\"dependencies\\" has been split and replaced by \\"dependentSchemas\\" and \\"dependentRequired\\" in order to serve their differing semantics.","type":"object","additionalProperties":{"anyOf":[{"$dynamicRef":"#meta"},{"$ref":"meta/validation#/$defs/stringArray"}]},"deprecated":true,"default":{}},"$recursiveAnchor":{"$comment":"\\"$recursiveAnchor\\" has been replaced by \\"$dynamicAnchor\\".","$ref":"meta/core#/$defs/anchorString","deprecated":true},"$recursiveRef":{"$comment":"\\"$recursiveRef\\" has been replaced by \\"$dynamicRef\\".","$ref":"meta/core#/$defs/uriReferenceString","deprecated":true}}}')},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.m=e,n.amdO={},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.u=e=>e+".js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var s=r.length-1;s>-1&&(!e||!/^http(s?):/.test(e));)e=r[s--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),n.b=document.baseURI||self.location.href,n.nc=void 0;var r={};(()=>{"use strict";n.r(r),n.d(r,{_package:()=>Se,initAutoTests:()=>Pe,test:()=>_e,tests:()=>t.CN});var e=n(6082),t=n(8070);(0,t.L1)("_first",(()=>{(0,t.t6)("_first",(async()=>{}))}));var s=n(8924),o=n(7362),i=n(1093);(0,t.L1)("Palettes",(()=>{(0,t.t6)("testPaletteN",(async()=>{await async function(){const e=i.A.Chromatogram;(0,t.E3)(e instanceof o.e,!0),(0,t.E3)(e instanceof i.A,!0)}()})),(0,t.t6)("testPaletteAA",(async()=>{await async function(){const e=s.X.Lesk,n=s.X.RasMol,r=s.X.GrokGroups;(0,t.E3)(e instanceof o.e,!0),(0,t.E3)(n instanceof o.e,!0),(0,t.E3)(r instanceof o.e,!0),(0,t.E3)(e instanceof s.X,!0),(0,t.E3)(n instanceof s.X,!0),(0,t.E3)(r instanceof s.X,!0)}()})),(0,t.t6)("testPalettePtMe",(async()=>{const e=s.X.GrokGroups.get("MeNle"),n=s.X.GrokGroups.get("MeA"),r=s.X.GrokGroups.get("MeG"),o=s.X.GrokGroups.get("MeF"),i=s.X.GrokGroups.get("L"),a=s.X.GrokGroups.get("A"),c=s.X.GrokGroups.get("G"),l=s.X.GrokGroups.get("F");(0,t.E3)(e,i),(0,t.E3)(n,a),(0,t.E3)(r,c),(0,t.E3)(o,l)}))}));var a=n(4328),c=n(2003),l=n(8312);class u{units;aligned;alphabet;alphabetSize;alphabetIsMultichar;separator;constructor(e,t,n,r,s,o){this.units=e,this.aligned=t,this.alphabet=n,this.alphabetSize=r,this.alphabetIsMultichar=s,this.separator=o}}async function d(t,n){const r=(await t()).getCol(n),s=await a.functions.call("Bio:detectMacromolecule",{col:r});if(s&&(r.semType=s),r.semType===e.SEMTYPE.MACROMOLECULE){const e=`Negative test detected semType='${r.semType}', units='${r.meta.units}'.`;throw new Error(e)}}async function h(n,r,s,o,i,l,u,d,h=null){const p=(await n()).col(r),m=await a.functions.call("Bio:detectMacromolecule",{col:p});m&&(p.semType=m),(0,t.E3)(p.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(p.meta.units,o),(0,t.E3)(p.getTag(c.gp.aligned),i),(0,t.E3)(p.getTag(c.gp.alphabet),l),h&&(0,t.E3)(p.getTag(c.gp.separator),h);const f=s.getSeqHandler(p);(0,t.E3)(f.getAlphabetSize(),u),(0,t.E3)(f.getAlphabetIsMultichar(),d),f.isHelm()||((0,t.E3)(f.aligned,i),(0,t.E3)(f.alphabet,l))}async function p(t){const n=e.Column.fromList(e.TYPE.STRING,"col1",t);if(await a.functions.call("Bio:detectMacromolecule",{col:n}),n.semType===e.SEMTYPE.MACROMOLECULE){const e=`Negative test detected semType='${n.semType}', units='${n.meta.units}'.`;throw new Error(e)}}async function m(n,r,s,o,i,l,u,d=null){const h=e.Column.fromList(e.TYPE.STRING,"seq",n),p=await a.functions.call("Bio:detectMacromolecule",{col:h});p&&(h.semType=p),(0,t.E3)(h.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(h.meta.units,s),(0,t.E3)(h.getTag(c.gp.aligned),o),(0,t.E3)(h.getTag(c.gp.alphabet),i),d&&(0,t.E3)(h.getTag(c.gp.separator),d);const m=r.getSeqHandler(h);(0,t.E3)(m.getAlphabetSize(),l),(0,t.E3)(m.getAlphabetIsMultichar(),u),m.isHelm()||((0,t.E3)(m.aligned,o),(0,t.E3)(m.alphabet,i))}async function f(e,t,n){const r=await e(),s=[];for(const o of r.columns.names())if(o in t){const r=t[o];try{await h(e,o,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}catch(e){const t=e.toString();s.push(`Positive col '${o}' failed: ${t}`)}}else try{await d(e,o)}catch(e){const t=e.toString();s.push(`Negative col '${o}' failed: ${t}`)}if(s.length>0)throw new Error(s.join("\n"))}(0,t.L1)("detectors",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r={negEmpty:{csv:"id,col1\n1,\n2,\n3,\n4,\n5,",neg:["col1"]},negNum1:{csv:"col1\n1\n2\n3",neg:["col1"]},negNum2:{csv:"col1\n4\n5\n6\n7",neg:["col1"]},negNum3:{csv:"col1\n8\n9\n10\n11\n12",neg:["col1"]},negSmiles:{csv:"col1\nCCCCN1C(=O)CN=C(c2cc(F)ccc12)C3CCCCC3\nC1CCCCC1\nCCCCCC",neg:["col1"]},negSmilesWithSquareBrackets:{csv:"col1\nCl.c1ccc2nc3ccccc3cc2c1\nOc1cccc2cc3ccccc3cc12\n[SeH]c1ccc2ccccc2c1",neg:["col1"]},negFastaUnSingleChar:{csv:"col1\nAlanine\nCysteine\nAspartic acid\nGlutamic acid\nPhenylalanine",neg:["col1"]},fastaMsaSameLength:{csv:"seq\nFWPHEYFWPHEYYV\nYNRQWYVYNRQWYV\nMKPSEYVMKPSEYV",pos:{seq:new u(c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1,void 0)}},fastaExtSameLength:{csv:"seq\nFW[Ac]PHEYFWPH\nYN[Re]VYNRQWYV\n[Me]EYVMPS[Et]",pos:{seq:new u(c.Hi.FASTA,"SEQ",c.YI.UN,16,!0,void 0)}},fastaMsaExtSameLength:{csv:"seq\nFW[Ac]PHEY[Re]WPH\nYN[Re]VYNR[Ac]WYV\n[Me]EYVMPSFW[Me]H",pos:{seq:new u(c.Hi.FASTA,"SEQ.MSA",c.YI.UN,14,!0,void 0)}},fastaMsaExtManyMinus:{csv:"seq\n[D-Tic]-------[D-Tyr_Et][Tyr_ab-dehydroMe][dV][Cys_SEt]N[D-Orn][D-aThr]-[Phe_4Me]\n[Phe_2F]--------[Tyr_ab-dehydroMe][dV][Aca]N[D-Orn][D-aThr]-[Phe_4Me]\n[D-Tic]-[Hcy]QTWQ[Phe_4NH2][D-Tyr_Et][Tyr_ab-dehydroMe][dV][Cys_SEt]----[Phe_4Me]",pos:{seq:new u(c.Hi.FASTA,"SEQ.MSA",c.YI.UN,17,!0,void 0)}},sepSameLength:{csv:"seq\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-C-G-NH2\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-C-G-NH2\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-C-G-NH2",pos:{seq:new u(c.Hi.SEPARATOR,"SEQ.MSA",c.YI.UN,5,!0,"-")}},sepMsaSameLength:{csv:"seq\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-Aca-G-NH2\nAca-A-Aca-A-A-A-meI-A-A-A-A-A-Aca-G-NH2\nAca-A-A-A-A-A-A-A-A-A-A-A-A-A-Aca-G-NH2",pos:{seq:new u(c.Hi.SEPARATOR,"SEQ",c.YI.UN,5,!0,"-")}},helmSameLength:{csv:"seq\nPEPTIDE1{Ac(1).A.A.A.A.A.A.A.A.A.A.A.A.A.C(1).G.NH2}$$$$\nPEPTIDE1{Ab(1).Y.V.K.H.P.F.W.R.W.Y.A.A.A.C(1).G.NH2}$$$$\nPEPTIDE1{Ad(1).S.W.Y.C.K.H.P.M.W.A.A.A.A.C(1)-G-NH2}$$$$",pos:{seq:new u(c.Hi.HELM,null,null,19,void 0,void 0)}},fastaNonDigitAlphabet:{csv:'flagC\n"NMe-pyridazineH"\n"Pyrrolo[2,3-c]pyridazineH"',neg:["flagC"]}};for(const[s,o]of Object.entries(r))(0,t.t6)(`csvData2-${s}`,(async()=>{const t=(i=s,async()=>{const t=r[i].csv,n=e.DataFrame.fromCsv(t);return await a.data.detectSemanticTypes(n),n});var i;for(const e of o.neg??[])await d(t,e);for(const[e,r]of Object.entries(o.pos??{}))await h(t,e,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}));const s=new class{csvFastaDna1="seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC";fastaRna1="seq\nACGUCACGUC\nCAGUGUCAGUGU\nUUCAACUUCAAC";fastaPt1="seq\nFWPHEY\nYNRQWYV\nMKPSEYV";fastaUn="seq\n[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]DN\n[meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Aca]\n[Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Aca]";sepDna="seq\nA*C*G*T*C*A*C*G*T*C\nC*A*G*T*G*T*C*A*G*T*G*T\nT*T*C*A*A*C*T*T*C*A*A*C";sepRna="seq\nA*C*G*U*C*A*C*G*U*C\nC*A*G*U*G*U*C*A*G*U*G*U\nU*U*C*A*A*C*U*U*C*A*A*C";sepPt="seq\nF-W-P-H-E-Y-F-W-P-H-E-Y\nY-N-R-Q-W-Y-V-Y-N-R-Q-W-Y-V\nM-K-P-S-E-Y-V-M-K-P-S-E-Y-V";sepUn1="seq\nabc-dfgg-abc1-cfr3-rty-wert-cfr3-rty-wert\nrut12-her2-rty-wert-abc-abc1-dfgg-abc-abc1-dfgg\nrut12-rty-her2-abc-cfr3-wert-rut12-cfr3-wert-rut12";sepUn2="seq\nabc/dfgg/abc1/cfr3/rty/wert/abc/dfgg/abc1/cfr3/rty/wert\nrut12/her2/rty/wert//abc/abc1/dfgg/rut12/her2/rty/wert//abc/abc1/dfgg\nrut12/rty/her2/abc/cfr3//wert/rut12/rut12/rty/her2/abc/cfr3//wert/rut12";sepMsaDna1="seq\nA-C--G-T--C-T-A-C--G-T--C-T\nC-A-C--T--G-T-C-A-C--T--G-T\nA-C-C-G-T-A-C-T-A-C-C-G-T-A-C-T";sepMsaUnWEmpty="seq\nm1-M-m3-mon4-mon5-N-T-MON8-N9-m1-M-m3-mon4-mon5-N-T-MON8-N9\nm1-mon2-m3-mon4-mon5-Num--MON8-N9-m1-mon2-m3-mon4-mon5-Num--MON8-N9\n\nmon1-M-mon3-mon4-mon5---MON8-N9-mon1-M-mon3-mon4-mon5---MON8-N9";sepComplex="seq\nAca-F-K(AEEA-AEEA-R-Ac)-L-mF-V-Y-mNle-D-W-N-mF-Aca-G-NH2\nAca-F-K(AEEA-ARRA-W-Ac)-L-mF-V-Y-mNle-D-W-N-mF-Aca-G-NH2\nAca-F-K(AEEA-AEEA-Ac)-L-mF-V-Y-mNle-D-W-N-mF-Aca-G-NH2";fastaMsaDna1="seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT";fastaMsaPt1="seq\nFWR-WYV-KHPFWR-WYV-KHP\nYNR-WYV-KHPYNR-WYV-KHP\nMWRSWY-CKHPMWRSWY-CKHP"},o={fastaPtCsv:"System:AppData/Bio/samples/FASTA_PT.csv",msaComplex:"System:AppData/Bio/samples/MSA.csv",fastaCsv:"System:AppData/Bio/samples/FASTA.csv",helmCsv:"System:AppData/Bio/samples/HELM.csv",peptidesComplex:"System:AppData/Bio/tests/peptides_complex_msa.csv",peptidesSimple:"System:AppData/Bio/tests/peptides_simple_msa.csv",testDemogCsv:"System:AppData/Bio/tests/testDemog.csv",testHelmCsv:"System:AppData/Bio/tests/testHelm.csv",testIdCsv:"System:AppData/Bio/tests/testId.csv",testSmilesCsv:"System:AppData/Bio/tests/testSmiles.csv",testSmiles2Csv:"System:AppData/Bio/tests/testSmiles2.csv",testSmilesShort:"System:AppData/Bio/tests/testSmilesShort.csv",testActivityCliffsCsv:"System:AppData/Bio/tests/testActivityCliffs.csv",testCerealCsv:"System:AppData/Bio/tests/testCereal.csv",testUnichemSources:"System:AppData/Bio/tests/testUnichemSources.csv",testDmvOffices:"System:AppData/Bio/tests/testDmvOffices.csv",testAlertCollection:"System:AppData/Bio/tests/testAlertCollection.csv",testSpgi100:"System:AppData/Bio/tests/testSpgi100.csv",testSpgi:"System:AppData/Bio/tests/SPGI-derived.csv",testUrl:"System:AppData/Bio/tests/testUrl.csv"},i={};function g(e,t=y){return async()=>(e in i||(i[e]=(async()=>await t(o[e]))().catch((t=>{throw delete i[e],t}))),i[e])}async function y(t){const n=await a.dapi.files.readAsText(t);return e.DataFrame.fromCsv(n)}const b=t=>async()=>{const n=s[t],r=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(r),r};(0,t.t6)("NegativeStartEnd",(async()=>{await p(["START","END"])})),(0,t.t6)("NegativeStartEndIntermediate",(async()=>{await p(["START","END","INTERMEDIATE"])})),(0,t.t6)("FastaDna1",(async()=>{await h(b("csvFastaDna1"),"seq",n,c.Hi.FASTA,"SEQ",c.YI.DNA,4,!1)})),(0,t.t6)("FastaRna1",(async()=>{await h(b("fastaRna1"),"seq",n,c.Hi.FASTA,"SEQ",c.YI.RNA,4,!1)})),(0,t.t6)("FastaPt1",(async()=>{await h(b("fastaPt1"),"seq",n,c.Hi.FASTA,"SEQ",c.YI.PT,20,!1)})),(0,t.t6)("FastaPtGaps",(()=>m(["FW-PH-EYY","FYNRQWYV-","FKP-Q-SEYV"],n,c.Hi.FASTA,"SEQ",c.YI.PT,20,!1))),(0,t.t6)("FastaPtGapsMsa",(()=>m(["FW-PH-EYY","FYNRQWYV-","FKP-Q-SEY"],n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1))),(0,t.t6)("FastaUn",(async()=>{await h(b("fastaUn"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.UN,12,!0)})),(0,t.t6)("FastaMsaDna1",(async()=>{await h(b("fastaMsaDna1"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.DNA,4,!1)})),(0,t.t6)("FastaMsaPt1",(async()=>{await h(b("fastaMsaPt1"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1)})),(0,t.t6)("SepDna",(async()=>{await h(b("sepDna"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.DNA,4,!1,"*")})),(0,t.t6)("SepRna",(async()=>{await h(b("sepRna"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.RNA,4,!1,"*")})),(0,t.t6)("SepPt",(async()=>{await h(b("sepPt"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.PT,20,!1,"-")})),(0,t.t6)("SepUn1",(async()=>{await h(b("sepUn1"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.UN,8,!0,"-")})),(0,t.t6)("SepUn2",(async()=>{await h(b("sepUn2"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.UN,9,!0,"/")})),(0,t.t6)("SepMsaN1",(async()=>{await h(b("sepMsaDna1"),"seq",n,c.Hi.SEPARATOR,"SEQ.MSA",c.YI.DNA,4,!1,"-")})),(0,t.t6)("SepMsaUnWEmpty",(async()=>{await h(b("sepMsaUnWEmpty"),"seq",n,c.Hi.SEPARATOR,"SEQ.MSA",c.YI.UN,14,!0)})),(0,t.t6)("SepComplex",(async()=>{await h(b("sepComplex"),"seq",n,c.Hi.SEPARATOR,"SEQ",c.YI.UN,17,!0)})),(0,t.t6)("samplesFastaCsv",(async()=>{await f(g("fastaCsv"),{Sequence:new u(c.Hi.FASTA,"SEQ",c.YI.PT,20,!1)},n)})),(0,t.t6)("samplesPeptidesComplex",(async()=>{await f(g("peptidesComplex"),{},n)})),(0,t.t6)("samplesMsaComplex",(async()=>{await f(g("msaComplex"),{MSA:new u(c.Hi.SEPARATOR,"SEQ.MSA",c.YI.UN,161,!0,"/")},n)})),(0,t.t6)("samplesIdCsv",(async()=>{await f(g("testIdCsv"),{},n)})),(0,t.t6)("samplesSarSmallCsv",(async()=>{await f(g("testSmilesCsv"),{},n)})),(0,t.t6)("samplesHelmCsv",(async()=>{await f(g("helmCsv"),{HELM:new u(c.Hi.HELM,null,null,160,!0)},n)})),(0,t.t6)("samplesTestHelmCsv",(async()=>{await f(g("testHelmCsv"),{"HELM string":new u(c.Hi.HELM,null,null,9,!0)},n)})),(0,t.t6)("samplesTestDemogCsv",(async()=>{await f(g("testDemogCsv"),{},n)})),(0,t.t6)("samplesTestSmiles2Csv",(async()=>{await f(g("testSmiles2Csv"),{},n)})),(0,t.t6)("samplesTestSmilesShort",(async()=>{await f(g("testSmilesShort"),{},n)})),(0,t.t6)("samplesTestActivityCliffsNegativeSmiles",(async()=>{await f(g("testActivityCliffsCsv"),{},n)})),(0,t.t6)("samplesFastaPtCsv",(async()=>{await f(g("fastaPtCsv"),{sequence:new u(c.Hi.FASTA,"SEQ",c.YI.PT,20,!1)},n)})),(0,t.t6)("samplesTestCerealCsv",(async()=>{await f(g("testCerealCsv"),{},n)})),(0,t.t6)("samplesTestUnichemSources",(async()=>{await f(g("testUnichemSources"),{},n)})),(0,t.t6)("samplesTestDmvOffices",(async()=>{await f(g("testDmvOffices"),{},n)})),(0,t.t6)("samplesTestAlertCollection",(async()=>{await f(g("testAlertCollection"),{},n)})),(0,t.t6)("samplesTestSpgi",(async()=>{await f(g("testSpgi"),{},n)})),(0,t.t6)("samplesTestSpgi100",(async()=>{await f(g("testSpgi100"),{},n)})),(0,t.t6)("samplesTestUrl",(async()=>{await f(g("testUrl"),{},n)}))})),(0,t.L1)("detectors.weak-and-likely",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r={fastaDnaWeak1:"id,colName\n1,TTTTTTTTTT\n2,TTTTTTTTTT\n3,TTTTTTTTTT\n4,TTTTTTTTTT",fastaDnaWeak1LikelyName:"id,seq\n1,TTTTTTT\n2,TTTTTTT\n3,TTTTTTT\n4,TTTTTTT",fastaRnaWeak1:"id,colName\n1,UUUUUUUUUU\n2,UUUUUUUUUU\n3,UUUUUUUUUU\n4,UUUUUUUUUU",fastaRnaWeak1LikelyName:"id,seq\n1,UUUUUUU\n2,UUUUUUU\n3,UUUUUUU\n4,UUUUUUU",fastaPtWeak1:"id,colName\n1,SLSLSPGKSLSLSPGK\n2,SLSLSPGKSLSLSPGK\n3,SLSLSPGKSLSLSPGK\n4,SLSLSPGKSLSLSPGK",fastaPtWeak1LikelyName:"id,seq\n1,SLSLSPGKSLSLSPGK\n2,SLSLSPGKSLSLSPGK\n3,SLSLSPGKSLSLSPGK\n4,SLSLSPGKSLSLSPGK",fastaUn1:"id,colName\n1,word\n2,other\n3,some\n4,another",fastaUn1LikelyName:"id,seq\n1,word\n2,other\n3,some\n4,another",fastaUn2LikelyName:'protein\nBoombastic\nMegafantastic\n"just-a-random-thought,oy!"',fastaUnMsa1LikelyName:"id,seq\n1,word\n2,male\n3,bare\n4,core"},s=t=>async()=>{const n=r[t],s=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(s),s};(0,t.t6)("fastaDnaWeak1",(async()=>{await d(s("fastaDnaWeak1"),"colName")})),(0,t.t6)("fastaDnaWeak1LikelyName",(async()=>{await h(s("fastaDnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.DNA,4,!1)})),(0,t.t6)("fastaRnaWeak1",(async()=>{await d(s("fastaRnaWeak1"),"colName")})),(0,t.t6)("fastaRnaWeak1LikelyName",(async()=>{await h(s("fastaRnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.RNA,4,!1)})),(0,t.t6)("fastaPtWeak1",(async()=>{await d(s("fastaPtWeak1"),"colName")})),(0,t.t6)("fastaPtWeak1LikelyName",(async()=>{await h(s("fastaPtWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1)})),(0,t.t6)("fastaUn1",(async()=>{await d(s("fastaUn1"),"colName")})),(0,t.t6)("fastaUn1LikelyName",(async()=>{await d(s("fastaUn1LikelyName"),"seq")})),(0,t.t6)("fastaUn2LikelyName",(async()=>{await d(s("fastaUn2LikelyName"),"protein")})),(0,t.t6)("fastaUnMsa1LikelyName",(async()=>{await d(s("fastaUnMsa1LikelyName"),"seq")}))})),(0,t.L1)("detectorsBenchmark",(()=>{let n,r;async function s(s,i,a,l,u,d){return await async function(s){const h=await(async()=>{const t=function(t,n,r,s,o){let i;switch(t){case c.Hi.FASTA:i=e=>{let t="";for(let n=0;n<e.length;n++){const r=e[n];t+=1==r.length?r:`[${r}]`}return t};break;case c.Hi.SEPARATOR:i=(e,t)=>e.join(t);break;default:throw new Error(`Not supported notation '${t}'.`)}const a=(e,t)=>{const n=new Array(t);for(let r=0;r<t;r++)n[r]=e[Math.floor(Math.random()*e.length)];return i(n,o)},l=Array(s);for(let e=0;e<s;e++)l[e]=a(n,r);return e.Column.fromStrings("seq",l)}(i,[...(0,c.Qf)(a)],l,u,d),n=r.prepare({col:t});return o(n),n})(),p=Date.now(),m=o(h),f=Date.now();(function(e,r){const s=n.getSeqHandler(e);(0,t.E3)(e.semType===r.semType,!0),(0,t.E3)(s.notation===r.notation,!0),(0,t.E3)(s.alphabet===r.alphabet,!0),(0,t.E3)(s.separator===r.separator,!0)})(m,{semType:e.SEMTYPE.MACROMOLECULE,notation:i,alphabet:a,separator:d});const g=f-p;if(g>s){const e=`ET ${g} ms is more than max allowed ${s} ms.`;throw console.error(e),new Error(e)}return console.log(`ET ${g} ms is OK.`),g}(s)}function o(e){e.callSync();const t=e.getOutputParamValue(),n=e.inputs.col;return t&&(n.semType=t),n}(0,t.gM)((async()=>{n=await(0,l.Q)();const t=e.Func.find({package:"Bio",name:"detectMacromolecule"});r=t[0];const s=e.Column.fromStrings("seq",["ACGT","ACGT","ACGT"]);await r.prepare({col:s}).call()})),(0,t.t6)("fastaDnaShorts50Few50",(async()=>{await s(10,c.Hi.FASTA,c.YI.DNA,50,50)})),(0,t.t6)("fastaDnaShorts50Many1E6",(async()=>{await s(20,c.Hi.FASTA,c.YI.DNA,50,1e6)})),(0,t.t6)("fastaDnaLong1e6Few50",(async()=>{await s(20,c.Hi.FASTA,c.YI.DNA,1e6,50)})),(0,t.t6)("separatorDnaShorts50Few50",(async()=>{await s(10,c.Hi.SEPARATOR,c.YI.DNA,50,50,"/")})),(0,t.t6)("separatorDnaShorts50Many1E6",(async()=>{await s(20,c.Hi.SEPARATOR,c.YI.DNA,50,1e6,"/")})),(0,t.t6)("separatorDnaLong1e6Few50",(async()=>{await s(20,c.Hi.SEPARATOR,c.YI.DNA,1e6,50,"/")}))}));var g=n(608),y=n(1619),b=n(6740);async function w(n,r){const s=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(s);const o=e.DataFrame.fromCsv(r),i=s.getCol("seq");(0,t.E3)(i.semType,e.SEMTYPE.MACROMOLECULE);const c=o.getCol("seq"),l=await(0,g.eE)(i,!0);(0,t.J6)(l.toList(),c.toList())}(0,t.L1)("MSA",(async()=>{let n;async function r(r,s,o,i,l,u){const d=e.DataFrame.fromCsv(r);await a.data.detectSemanticTypes(d);const h=e.DataFrame.fromCsv(s).getCol("seq"),p=d.getCol("seq");(0,t.E3)(p.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(p.meta.units,o),l&&(0,t.E3)(p.getTag(c.gp.alphabet),l);const m=await(0,y.D)({col:p,pepsea:{method:u}},n);(0,t.E3)(m.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(m.meta.units,i),(0,t.E3)(m.getTag(c.gp.aligned),"SEQ.MSA"),l&&(0,t.E3)(m.getTag(c.gp.alphabet),l),(0,t.J6)(m.toList(),h.toList())}(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("isCorrect",(async()=>{await w("seq\nFWRWYVKHP\nYNRWYVKHP\nMWRSWYCKHP","seq\nFWR-WYVKHP\nYNR-WYVKHP\nMWRSWYCKHP")})),(0,t.t6)("isCorrectLong",(async()=>{await w("seq\nFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHPFWRWYVKHP\nYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHPYNRWYVKHP\nMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHP","seq\nFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHPFWR-WYVKHP\nYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHPYNR-WYVKHP\nMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHPMWRSWYCKHP")})),(0,t.t6)("isCorrectHelm",(async()=>{await(0,b.m8)(),await r("seq\n PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2}$$$$\n PEPTIDE1{meI.Aca.N.T.dE.Thr_PO3H2}$$$$\n PEPTIDE1{hHis.Aca.N.T.dE.Thr_PO3H2}$$$$","seq\n meI.hHis.Aca.N.T.dE.Thr_PO3H2\n .meI.Aca.N.T.dE.Thr_PO3H2\n .hHis.Aca.N.T.dE.Thr_PO3H2",c.Hi.HELM,c.Hi.SEPARATOR,void 0,"mafft")}),{timeout:6e4}),(0,t.t6)("isCorrectHelmLong",(async()=>{await(0,b.m8)(),await r("seq\n PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.dV.E.N.D-Orn.D-aThr.Phe_4Me.Thr_PO3H2}$$$$\n PEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Tyr_PO3H2.D-Chg.dV.Phe_ab-dehydro.N.D-Orn.D-aThr.Phe_4Me}$$$$\n PEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me}$$$$","seq\n meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.dV.E.N.D-Orn.D-aThr.Phe_4Me.Thr_PO3H2\n meI.hHis.Aca.Cys_SEt.T.dK..Tyr_PO3H2.D-Chg.dV.Phe_ab-dehydro.N.D-Orn.D-aThr.Phe_4Me.\n Lys_Boc.hHis.Aca.Cys_SEt.T.dK..Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me.",c.Hi.HELM,c.Hi.SEPARATOR,void 0,"mafft")}),{timeout:6e4}),(0,t.t6)("isCorrectSeparator",(async()=>{await r("seq\n F-W-P-H-E-Y\n Y-N-R-Q-W-Y-V\n M-K-P-S-E-Y-V","seq\n FWPHEY-\n YNRQWYV\n MKPSEYV",c.Hi.SEPARATOR,c.Hi.FASTA,c.YI.PT)})),(0,t.t6)("isCorrectSeparatorLong",(async()=>{await r("seq\n M-I-E-V-F-L-F-G-I-V-L-G-L-I-P-I-T-L-A-G-L-F-V-T-A-Y-L-Q-Y-R-R-G-D-Q-L-D-L\n M-M-E-L-V-L-K-T-I-I-G-P-I-V-V-G-V-V-L-R-I-V-D-K-W-L-N-K-D-K\n M-D-R-T-D-E-V-S-N-H-T-H-D-K-P-T-L-T-W-F-E-E-I-F-E-E-Y-H-S-P-F-H-N","seq\n MIEV-FLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL\n MMEL-VLKTII-GPIVVGVVLRIVDKWLNKDK------\n MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN-----",c.Hi.SEPARATOR,c.Hi.FASTA,c.YI.PT)}))}));var v=n(1991),A=n.n(v),E=n(7278),T=n(6718),C=n(6642);async function S(t){const n=await async function(e){return await Se.files.readAsText(e)}(t),r=e.DataFrame.fromCsv(n);return r.name=t.replace(".csv",""),r}async function _(e,n=5e3){await(0,t.cb)(0),await(0,t.PE)(e.onAfterDrawContent,(()=>{}),(()=>{e.invalidate()}),n);const r=e.columns.length;for(let t=0;t<r;++t){const n=e.columns.byIndex(t);if(n){const t=e.cell(n.name,0),[r,i,a]=(0,C.BG)(t),c=(void 0,(o=s=a.rendererBack)&&void 0!==o.onRendered&&void 0!==o.invalidate&&void 0!==o.awaitRendered?s:null);c&&await c.awaitRendered()}}var s,o}var P=n(4139),N=n(4356);async function M(e,n){const r=(0,c.J9)(e);console.debug(`Bio: tests: splitters: src=${JSON.stringify(e)}, res=${JSON.stringify(r)} .`),(0,t.J6)(A().count(0).take(r.length).map((e=>r.getOriginal(e))).toArray(),n)}async function x(e,n){const r=(0,E.qp)(e);console.debug(`Bio: tests: splitters: src=${JSON.stringify(e)}, res=${JSON.stringify(r)} .`),(0,t.J6)(A().count(0).take(r.length).map((e=>r.getOriginal(e))).toArray(),n)}(0,t.L1)("splitters",(async()=>{(0,t.gM)((async()=>{})),(0,t.Pl)((async()=>{}));const e=["M[MeI]YKETLL[MeF]PKTDFPMRGGL[MeA]",["M","MeI","Y","K","E","T","L","L","MeF","P","K","T","D","F","P","M","R","G","G","L","MeA"]],n=["[meI][Pip][dK][Thr_PO3H2][L-hArg(Et,Et)][D-Tyr_Et][Tyr_ab-dehydroMe][dV]EN[D-Orn][D-aThr][Phe_4Me]",["meI","Pip","dK","Thr_PO3H2","L-hArg(Et,Et)","D-Tyr_Et","Tyr_ab-dehydroMe","dV","E","N","D-Orn","D-aThr","Phe_4Me"]],r=["PEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Tyr_ab-dehydroMe.dV.E.N.D-Orn.D-aThr.Phe_4Me}$$$",["meI","hHis","Aca","N","T","dE","Thr_PO3H2","Aca","D-Tyr_Et","Tyr_ab-dehydroMe","dV","E","N","D-Orn","D-aThr","Phe_4Me"]],s=["PEPTIDE1{meI.hHis.Aca.N.T.dK.Thr_PO3H2.Aca.D-Tyr_Et.D-Dap.dV.E.N.pnG.Phe_4Me}$$$",["meI","hHis","Aca","N","T","dK","Thr_PO3H2","Aca","D-Tyr_Et","D-Dap","dV","E","N","pnG","Phe_4Me"]],o=["PEPTIDE1{[meI].[hHis].[Aca].N.T.[dK].[Thr_PO3H2].[Aca].[D-Tyr_Et].[D-Dap].[dV].E.N.[pnG].[Phe_4Me]}$$$",["meI","hHis","Aca","N","T","dK","Thr_PO3H2","Aca","D-Tyr_Et","D-Dap","dV","E","N","pnG","Phe_4Me"]],i=["RNA1{R(U)P.R(T)P.R(G)P.R(C)P.R(A)}$$$$",["R(U)P","R(T)P","R(G)P","R(C)P","R(A)"]],a=["RNA1{P.R(U)P.R(T)}$$$$",["P","R(U)P","R(T)"]],c=["RNA1{P.R(U).P.R(T)}$$$$",["P","R(U)","P","R(T)"]];(0,t.t6)("fastaMulti",(async()=>{await M(e[0],e[1])})),(0,t.t6)("fastaFromHelm",(async()=>{await M(n[0],n[1])})),(0,t.t6)("helm1",(async()=>{await x(r[0],r[1])})),(0,t.t6)("helm2",(async()=>{await x(s[0],s[1])})),(0,t.t6)("helm3-multichar",(async()=>{await x(o[0],o[1])})),(0,t.t6)("testHelm1",(async()=>{await x(i[0],i[1])})),(0,t.t6)("testHelm2",(async()=>{await x(a[0],a[1])})),(0,t.t6)("testHelm3",(async()=>{await x(c[0],c[1])}))})),(0,t.L1)("splitters",(()=>{let n,r,s;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)})),(0,t.t6)("splitToMonomers",(async()=>{const e=await a.dapi.files.readCsv("System:AppData/Bio/samples/MSA.csv"),n=e.getCol("MSA"),r=await a.functions.call("Bio:detectMacromolecule",{col:n});r&&(n.semType=r),n.setTag(c.gp.aligned,P.gN);const s=await a.functions.call("Bio:splitToMonomersTopMenu",{table:e,sequence:n});(0,t.E3)(s.columns.names().includes("17"),!0),await a.data.detectSemanticTypes(s);const o=a.shell.addTableView(s);await _(o.grid),(0,t.E3)(o.grid.dataFrame.id,e.id)})),(0,t.t6)("getHelmMonomers",(async()=>{const t=e.DataFrame.fromCsv("HELM,Activity\nPEPTIDE1{hHis.N.T}$$$,5.30751\nPEPTIDE1{hHis.Aca.Cys_SEt}$$$,5.72388\n");await a.data.detectSemanticTypes(t);const n=["hHis","Aca","Cys_SEt","N","T"],r=t.getCol("HELM"),s=await a.functions.call("Bio:getHelmMonomers",{sequence:r}),o=n.filter((e=>!s.includes(e))),i=s.filter((e=>!n.includes(e)));if(o.length>0||i.length){const e=[];throw o.length>0&&e.push(`Missed monomers ${JSON.stringify(o)}.`),i.length>0&&e.push(`Unexpected monomers ${JSON.stringify(i)}.`),new Error(e.join(" "))}}))}));var $=n(8604);(0,t.L1)("monomerLibraries",(()=>{let e,n=null;(0,t.gM)((async()=>{e=await(0,T.pj)(),n=(0,N.ub)()})),(0,t.Pl)((async()=>{await(0,N.Eu)(n)})),(0,t.t6)("default",(async()=>{await(0,N.Eu)({exclude:[],explicit:[],duplicateMonomerPreferences:{}}),await e.loadMonomerLib(!0);const n=e.getMonomerLib();(0,t.E3)(n.getPolymerTypes().length>0,!0)})),(0,t.t6)("forTests",(async()=>{await e.loadMonomerLibForTests(),function(e,n){const r=n,s=e.getSummaryObj();for(const e in r)r[e]||delete r[e];for(const e in s)s[e]||delete s[e];if(0==Object.keys(r).length&&0!=Object.keys(s).length)throw new Error("Expected empty monomer lib, actual is not.");if(0!=Object.keys(r).length&&0==Object.keys(s).length)throw new Error("Expected non-empty monomer lib, actual is empty.");try{(0,t.Xk)(s,r),(0,t.Xk)(r,s)}catch(e){throw new Error(`Expected monomer lib ${JSON.stringify(r)} does not match actual ${JSON.stringify(s)}.`)}}(e.getMonomerLib(),$.VV)})),(0,t.t6)("empty",(async()=>{const n=await(0,N.ub)(),r=await e.getFileManager();let s=r.getValidLibraryPaths();0===s.length&&(s=await r.getValidLibraryPathsAsynchronously()),n.exclude=s,n.explicit=[],await(0,N.Eu)(n),await e.loadMonomerLib(!0);const o=e.getMonomerLib().getPolymerTypes();(0,t.E3)(0===o.length,!0)})),(0,t.t6)("override",(async()=>{const n={symbol:"over1",name:"Test override monomer 1",molfile:"",author:"Test Author",id:0,rgroups:[],smiles:"",polymerType:"PEPTIDE",monomerType:"Backbone",createDate:null},r=e.getMonomerLib(),s=r.getMonomer(n.polymerType,n.symbol);(0,t.E3)(null===s,!0,`Unexpectedly found monomer '${n.symbol}' `);const o=r.override({[n.polymerType]:{[n.symbol]:n}},"test").getMonomer(n.polymerType,n.symbol);(0,t.Xk)(o,n)}))}));var L=n(7389),I=n(1757),R=n.n(I),O=n(1858),k=n(6873),G=n(5433);async function D(n,r){const s=n(),o=e.DataFrame.fromColumns(s);await a.data.detectSemanticTypes(o);const i=Date.now(),c=(o.columns.byName("MSA"),a.shell.addTableView(o));await _(c.grid),(0,t.E3)(c.grid.dataFrame.id,o.id);const l=Date.now()-i;console.log(`Performance test: ${r}: ${l}ms`)}(0,t.L1)("renderers",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("long sequence performance ",(async()=>{await D(k.dW,"Long sequences")})),(0,t.t6)("many sequence performance",(async()=>{await D(k.fD,"Many sequences")})),(0,t.t6)("rendererMacromoleculeFasta",(async()=>{await async function(){const n=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA.csv"),r=e.DataFrame.fromCsv(n),s=r.getCol("Sequence"),o=await a.functions.call("Bio:detectMacromolecule",{col:s});o&&(s.semType=o);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await _(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=s.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(c,"sequence")}()})),(0,t.t6)("rendererMacromoleculeSeparator",(async()=>{await async function(){const n=await a.dapi.files.readAsText("System:AppData/Bio/samples/SEPARATOR_PT.csv"),r=e.DataFrame.fromCsv(n),s=r.getCol("sequence"),o=await a.functions.call("Bio:detectMacromolecule",{col:s});o&&(s.semType=o);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await _(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=s.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(c,"sequence")}()})),(0,t.t6)("rendererMacromoleculeDifference",(async()=>{await async function(){const n=e.Column.fromStrings("SequencesDiff",["meI/hHis/Aca/N/T/dK/Thr_PO3H2/Aca#D-Tyr_Et/Tyr_ab-dehydroMe/meN/E/N/dV"]);n.meta.units=c.Hi.SEPARATOR,n.setTag(c.gp.separator,"/"),n.setTag(c.gp.aligned,"SEQ"),n.setTag(c.gp.alphabet,"UN"),n.setTag(c.gp.alphabetIsMultichar,"true"),n.semType=P.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]),s=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await _(s.grid),(0,t.E3)(s.grid.dataFrame.id,r.id);const o=n.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(o,P.uF.MACROMOLECULE_DIFFERENCE)}()})),(0,t.t6)("afterMsa",(async()=>{await async function(){const r=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA.fasta"),s=(await a.functions.call("Bio:importFasta",{fileContent:r}))[0],o=s.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:o});i&&(o.semType=i);const l=a.shell.addTableView(s);await a.data.detectSemanticTypes(s),console.log("Bio: tests/renderers/afterMsa, table view"),await _(l.grid),(0,t.E3)(l.grid.dataFrame.id,s.id),console.log(`Bio: tests/renderers/afterMsa, src before test semType="${o.semType}", units="${o.meta.units}", cell.renderer="${o.getTag(e.TAGS.CELL_RENDERER)}"`),(0,t.E3)(o.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(o.meta.units,c.Hi.FASTA),(0,t.E3)(o.getTag(c.gp.aligned),"SEQ"),(0,t.E3)(o.getTag(c.gp.alphabet),c.YI.PT),(0,t.E3)(o.getTag(e.TAGS.CELL_RENDERER),"sequence");const u=await(0,y.D)({col:o},n);await _(l.grid),(0,t.E3)(l.grid.dataFrame.id,s.id),(0,t.E3)(u.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(u.meta.units,c.Hi.FASTA),(0,t.E3)(u.getTag(c.gp.aligned),"SEQ.MSA"),(0,t.E3)(u.getTag(c.gp.alphabet),c.YI.PT),(0,t.E3)(u.getTag(e.TAGS.CELL_RENDERER),"sequence"),n.getSeqHandler(u)}()})),(0,t.t6)("afterConvert",(async()=>{await async function(){const r=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA_PT.csv"),s=e.DataFrame.fromCsv(r),o=s.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:o});i&&(o.semType=i);const l=a.shell.addTableView(s);await a.data.detectSemanticTypes(s);const u=await(0,G.r)(o,n,c.Hi.SEPARATOR,"/");await _(l.grid),(0,t.E3)(l.grid.dataFrame.id,s.id);const d=u.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(d,"sequence"),n.getSeqHandler(u)}()})),(0,t.t6)("afterConvertToHelm",(async()=>{await async function(){const r=await a.dapi.files.readCsv("System:AppData/Bio/samples/FASTA_PT.csv"),s=a.shell.addTableView(r);await _(s.grid);const o=r.getCol("sequence"),i=n.getSeqHandler(o).convert(c.Hi.HELM);r.columns.add(i),await _(s.grid),(0,t.E3)(i.getTag(e.TAGS.CELL_RENDERER),"helm")}()})),(0,t.t6)("selectRendererBySemType",(async()=>{await async function(){const n=e.Column.fromStrings("SequencesDiff",["meI/hHis/Aca/N/T/dK/Thr_PO3H2/Aca#D-Tyr_Et/Tyr_ab-dehydroMe/meN/E/N/dV"]);n.meta.units=c.Hi.SEPARATOR,n.setTag(c.gp.separator,"/"),n.setTag(c.gp.aligned,"SEQ"),n.setTag(c.gp.alphabet,"UN"),n.setTag(c.gp.alphabetIsMultichar,"true"),n.semType=P.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]);a.shell.addTableView(r),await(0,t.cb)(100);const s=n.getTag(e.TAGS.CELL_RENDERER);if("MacromoleculeDifference"!==s)throw new Error(`Units 'separator', separator '/' and semType 'MacromoleculeDifference' have been manually set on column but after df was added as table, view renderer has set to '${s}' instead of correct 'MacromoleculeDifference'.`)}()})),(0,t.t6)("scatterPlotTooltip",(async()=>{await async function(){const n=e.DataFrame.fromCsv(r);n.currentRowIdx=0;const s=a.shell.addTableView(n),o=n.plot.scatter({x:"x",y:"y"});s.dockManager.dock(o,e.DOCK_TYPE.RIGHT,null),await Promise.all([(0,t.PE)(o.onAfterDrawScene,(()=>{}),(()=>{o.invalidateCanvas()}),1e3),_(s.grid,500)]);const i=o.root.getBoundingClientRect(),c=o.worldToScreen(1,0),l=new MouseEvent("mousemove",{cancelable:!0,bubbles:!0,view:window,button:0,clientX:i.left+c.x,clientY:i.top+c.y}),u=R()(o.root).find("canvas").get()[0];await(0,t.PE)((0,O.fromEvent)(u,"mousemove"),(()=>{Se.logger.debug(`Test: event, currentRowIdx=${n.currentRowIdx}`),(0,t.E3)(R()(L.tooltip.root).find("div table.d4-row-tooltip-table tr td canvas").length,1),(0,t.E3)(o.hitTest(c.x,c.y),1)}),(()=>{u.dispatchEvent(l)}),500),await _(s.grid,500)}()}));const r="seq,x,y\nACGGTGTCGT,0,0\nCGGTATCCCT,1,0\nCTCGGCATGC,2,0\n"}));var H=n(6882);(0,t.L1)("renderers: monomerPlacer",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,T.pj)(),r=await(0,N.ub)(),await n.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(r),await n.loadMonomerLib(!0)}));const s={splitter:{csv:"id,seq\nid1,m1-M-m3-mon4-mon5-N-T-MON8-N9\nid2,m1-mon2-m3-mon4-mon5-Num-MON8-N9\nid3,mon1-M-mon3-mon4-mon5-MON8-N9\n",testList:[{src:{row:0,x:-1},tgt:{pos:null}},{src:{row:1,x:0},tgt:{pos:null}},{src:{row:1,x:5},tgt:{pos:0}},{src:{row:1,x:6},tgt:{pos:0}},{src:{row:1,x:26},tgt:{pos:1}},{src:{row:1,x:160},tgt:{pos:6}},{src:{row:1,x:185},tgt:{pos:7}},{src:{row:2,x:140},tgt:{pos:5}},{src:{row:2,x:145},tgt:{pos:5}}]},splitterMsa:{csv:"id,seq\nid1,m1-M-m3-mon4-mon5-N-T-MON8-N9\nid2,m1-mon2-m3-mon4-mon5-Num--MON8-N9\nid3,\nid4,mon1-M-mon3-mon4-mon5---MON8-N9\n",testList:[{src:{row:0,x:-1},tgt:{pos:null}},{src:{row:1,x:0},tgt:{pos:null}},{src:{row:1,x:1},tgt:{pos:null}},{src:{row:1,x:4},tgt:{pos:null}},{src:{row:1,x:5},tgt:{pos:0}},{src:{row:1,x:37},tgt:{pos:0}},{src:{row:1,x:38},tgt:{pos:1}},{src:{row:1,x:170},tgt:{pos:5}},{src:{row:1,x:200},tgt:{pos:5}},{src:{row:2,x:20},tgt:{pos:null}},{src:{row:3,x:170},tgt:{pos:5}},{src:{row:3,x:200},tgt:{pos:5}},{src:{row:3,x:297},tgt:{pos:null}}]},fastaMsa:{csv:"id,seq\nid1,QQYNIYPLT\nid2,QQWSSFPYT\nid3,\nid3,QHIRE--LT\n",testList:[{src:{row:1,x:-1},tgt:{pos:null}},{src:{row:1,x:0},tgt:{pos:null}},{src:{row:1,x:1},tgt:{pos:null}},{src:{row:1,x:19},tgt:{pos:0}},{src:{row:1,x:170},tgt:{pos:8}},{src:{row:1,x:171},tgt:{pos:8}},{src:{row:2,x:5},tgt:{pos:null}},{src:{row:3,x:170},tgt:{pos:8}},{src:{row:3,x:181},tgt:{pos:null}}]}};for(const[n,r]of Object.entries(s))(0,t.t6)(`getPosition-${n}`,(async()=>{const t=e.DataFrame.fromCsv(r.csv);await a.data.detectSemanticTypes(t);const n=t.getCol("seq"),s=new H.Jy(null,n,Se.logger,3,(()=>({monomerCharWidth:7,separatorWidth:12,monomerToShort:c.zS})));await s.init();const o=r.testList;for(let e=0;e<n.length;++e)s.getCellMonomerLengths(e,1e4);const i=[];for(const[e,t]of A().enumerate(o)){const t={pos:s.getPosition(e.src.row,e.src.x,1e4)};e.tgt.pos!=t.pos&&i.push(`Test src ${JSON.stringify(e.src)} expected tgt ${JSON.stringify(e.tgt)}, but get ${JSON.stringify({res:t})}`)}if(i.length>0)throw new Error("Test failed error(s):\n"+i.join(", \n"))}));const o=[10,20,30,40,50,60],i={left:{x:3,tgt:null},c0left:{x:10,tgt:0},c0mid:{x:12,tgt:0},c0right:{x:19,tgt:0},c1left:{x:20,tgt:1},c2right:{x:39,tgt:2},c4left:{x:50,tgt:4},c4right:{x:59,tgt:4},max:{x:60,tgt:null},right:{x:65,tgt:null}};for(const[e,n]of Object.entries(i))(0,t.t6)("hitBounds-"+e,(async()=>{const e=(0,H.Bb)(o,n.x);(0,t.E3)(e,n.tgt)}))})),(0,t.L1)("converters",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,l.Q)()})),function(e){e.fastaPt="fastaPt",e.separatorPt="separatorPt",e.helmPt="helmPt",e.fastaDna="fastaDna",e.separatorDna="separatorDna",e.helmDna="helmDna",e.fastaRna="fastaRna",e.separatorRna="separatorRna",e.helmRna="helmRna",e.fastaGaps="fastaGaps",e.separatorGaps="separatorGaps",e.helmGaps="helmGaps",e.fastaUn="fastaUn",e.separatorUn="separatorUn",e.helmUn="helmUn",e.helmLoneDeoxyribose="helmLoneDeoxyribose",e.helmLoneRibose="helmLoneRibose",e.helmLonePhosphorus="helmLonePhosphorus",e.fastaLoneDeoxyribose="fastaLoneDeoxyribose",e.fastaLoneRibose="fastaLoneRibose",e.fastaLonePhosphorus="fastaLonePhosphorus"}(r||(r={}));const s={[r.fastaPt]:"seq\nFWPHEYFWPHEY\nYNRQWYVYNRQWYV\nMKPSEYVMKPSEYV",[r.separatorPt]:"seq\nF-W-P-H-E-Y-F-W-P-H-E-Y\nY-N-R-Q-W-Y-V-Y-N-R-Q-W-Y-V\nM-K-P-S-E-Y-V-M-K-P-S-E-Y-V",[r.helmPt]:"seq\nPEPTIDE1{F.W.P.H.E.Y.F.W.P.H.E.Y}$$$$\nPEPTIDE1{Y.N.R.Q.W.Y.V.Y.N.R.Q.W.Y.V}$$$$\nPEPTIDE1{M.K.P.S.E.Y.V.M.K.P.S.E.Y.V}$$$$",[r.fastaDna]:"seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",[r.separatorDna]:"seq\nA/C/G/T/C/A/C/G/T/C\nC/A/G/T/G/T/C/A/G/T/G/T\nT/T/C/A/A/C/T/T/C/A/A/C",[r.helmDna]:"seq\nRNA1{d(A)p.d(C)p.d(G)p.d(T)p.d(C)p.d(A)p.d(C)p.d(G)p.d(T)p.d(C)p}$$$$\nRNA1{d(C)p.d(A)p.d(G)p.d(T)p.d(G)p.d(T)p.d(C)p.d(A)p.d(G)p.d(T)p.d(G)p.d(T)p}$$$$\nRNA1{d(T)p.d(T)p.d(C)p.d(A)p.d(A)p.d(C)p.d(T)p.d(T)p.d(C)p.d(A)p.d(A)p.d(C)p}$$$$",[r.fastaRna]:"seq\nACGUCACGUC\nCAGUGUCAGUGU\nUUCAACUUCAAC",[r.separatorRna]:"seq\nA*C*G*U*C*A*C*G*U*C\nC*A*G*U*G*U*C*A*G*U*G*U\nU*U*C*A*A*C*U*U*C*A*A*C",[r.helmRna]:"seq\nRNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(C)p.r(A)p.r(C)p.r(G)p.r(U)p.r(C)p}$$$$\nRNA1{r(C)p.r(A)p.r(G)p.r(U)p.r(G)p.r(U)p.r(C)p.r(A)p.r(G)p.r(U)p.r(G)p.r(U)p}$$$$\nRNA1{r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p.r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p}$$$$",[r.fastaGaps]:"seq\nFW-PH-EYYFW-PH-EYY\nFYNRQWYV-FYNRQWYV-\nFKP-Q-SEYVFKP-Q-SEYV",[r.separatorGaps]:"seq\nF/W//P/H//E/Y/Y/F/W//P/H//E/Y/Y\nF/Y/N/R/Q/W/Y/V//F/Y/N/R/Q/W/Y/V/\nF/K/P//Q//S/E/Y/V/F/K/P//Q//S/E/Y/V",[r.helmGaps]:"seq\nPEPTIDE1{F.W.*.P.H.*.E.Y.Y.F.W.*.P.H.*.E.Y.Y}$$$$\nPEPTIDE1{F.Y.N.R.Q.W.Y.V.*.F.Y.N.R.Q.W.Y.V.*}$$$$\nPEPTIDE1{F.K.P.*.Q.*.S.E.Y.V.F.K.P.*.Q.*.S.E.Y.V}$$$$",[r.fastaUn]:"seq\n[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D\n[meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2]\n[Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca]",[r.separatorUn]:"seq\nmeI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D-meI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D\nmeI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-meI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2\nLys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-Lys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca",[r.helmUn]:"seq\nPEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D.meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2}$$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca}$$$$",[r.helmLoneDeoxyribose]:"seq\nRNA1{d(A).d(C).d(G).d(T).d(C).d(A).d(C).d(G).d(T).d(C)}$$$$\nRNA1{d(C).d(A).d(G).d(T).d(G).d(T)p.d(C).d(A).d(G).d(T).d(G).d(T)p}$$$$\nRNA1{d(T).d(T).d(C).d(A).d(A).d(C)p.d(T).d(T).d(C).d(A).d(A).d(C)p}$$$$",[r.helmLoneRibose]:"seq\nRNA1{r(A).r(C).r(G).r(U).r(C).r(A).r(C).r(G).r(U).r(C)}$$$$\nRNA1{r(C).r(A).r(G).r(U).r(G).r(U)p.r(C).r(A).r(G).r(U).r(G).r(U)p}$$$$\nRNA1{r(U).r(U).r(C).r(A).r(A).r(C)p.r(U).r(U).r(C).r(A).r(A).r(C)p}$$$$",[r.helmLonePhosphorus]:"seq\nRNA1{p.p.r(A)p.r(C)p.r(G)p.r(U)p.r(C)p.r(A)p.r(C)p.r(G)p.r(U)p.r(C)p}$$$$\nRNA1{p.p.r(C)p.r(A)p.p.r(G)p.r(U)p.r(G)p.r(U)p.r(C)p.r(A)p.p.r(G)p.r(U)p.r(G)p.r(U)p}$$$$\nRNA1{p.r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p.r(U)p.r(U)p.r(C)p.r(A)p.r(A)p.r(C)p.p.p}$$$$"},o=new Set(Object.values(c.gp));async function i(t){const n=s[t],r=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(r),r}function u(e,r){if(e===c.Hi.SEPARATOR&&!r)throw new Error(`Argument 'separator' is mandatory for target notation '${e.toString()}'.`);return function(s){const o=n.getSeqHandler(s).convert(e,r);return(0,t.E3)(o.meta.units,e),o}}async function d(e,r,s){const a=(await i(e)).getCol("seq"),l=r(a),u=(await i(s)).getCol("seq");(0,t.J6)(l.toList(),u.toList());const d=n.getSeqHandler(a),h=n.getSeqHandler(l);for(const[e,n]of Object.entries(u.tags)){if(!o.has(e)||d.notation===c.Hi.HELM&&[c.gp.alphabet,c.gp.alphabetIsMultichar].includes(e)||h.notation===c.Hi.HELM&&[c.gp.alphabet,c.gp.alphabetIsMultichar].includes(e))continue;const r=l.getTag(e);(0,t.E3)(r,n,`Tag '${e}' expected value '${n}' is not equal to actual '${r}'.`)}}(0,t.t6)("testFastaPtToSeparator",(async()=>{await d(r.fastaPt,u(c.Hi.SEPARATOR,"-"),r.separatorPt)})),(0,t.t6)("testFastaDnaToSeparator",(async()=>{await d(r.fastaDna,u(c.Hi.SEPARATOR,"/"),r.separatorDna)})),(0,t.t6)("testFastaRnaToSeparator",(async()=>{await d(r.fastaRna,u(c.Hi.SEPARATOR,"*"),r.separatorRna)})),(0,t.t6)("testFastaGapsToSeparator",(async()=>{await d(r.fastaGaps,u(c.Hi.SEPARATOR,"/"),r.separatorGaps)})),(0,t.t6)("testFastaUnToSeparator",(async()=>{await d(r.fastaUn,u(c.Hi.SEPARATOR,"-"),r.separatorUn)})),(0,t.t6)("testFastaPtToHelm",(async()=>{await d(r.fastaPt,u(c.Hi.HELM),r.helmPt)})),(0,t.t6)("testFastaDnaToHelm",(async()=>{await d(r.fastaDna,u(c.Hi.HELM),r.helmDna)})),(0,t.t6)("testFastaRnaToHelm",(async()=>{await d(r.fastaRna,u(c.Hi.HELM),r.helmRna)})),(0,t.t6)("testFastaGapsToHelm",(async()=>{await d(r.fastaGaps,u(c.Hi.HELM),r.helmGaps)})),(0,t.t6)("testSeparatorPtToFasta",(async()=>{await d(r.separatorPt,u(c.Hi.FASTA),r.fastaPt)})),(0,t.t6)("testSeparatorDnaToFasta",(async()=>{await d(r.separatorDna,u(c.Hi.FASTA),r.fastaDna)})),(0,t.t6)("testSeparatorRnaToFasta",(async()=>{await d(r.separatorRna,u(c.Hi.FASTA),r.fastaRna)})),(0,t.t6)("testSeparatorGapsToFasta",(async()=>{await d(r.separatorGaps,u(c.Hi.FASTA),r.fastaGaps)})),(0,t.t6)("testSeparatorUnToFasta",(async()=>{await d(r.separatorUn,u(c.Hi.FASTA),r.fastaUn)})),(0,t.t6)("testSeparatorPtToHelm",(async()=>{await d(r.separatorPt,u(c.Hi.HELM),r.helmPt)})),(0,t.t6)("testSeparatorDnaToHelm",(async()=>{await d(r.separatorDna,u(c.Hi.HELM),r.helmDna)})),(0,t.t6)("testSeparatorRnaToHelm",(async()=>{await d(r.separatorRna,u(c.Hi.HELM),r.helmRna)})),(0,t.t6)("testSeparatorGapsToHelm",(async()=>{await d(r.separatorGaps,u(c.Hi.HELM),r.helmGaps)})),(0,t.t6)("testHelmDnaToFasta",(async()=>{await d(r.helmDna,u(c.Hi.FASTA),r.fastaDna)})),(0,t.t6)("testHelmRnaToFasta",(async()=>{await d(r.helmRna,u(c.Hi.FASTA),r.fastaRna)})),(0,t.t6)("testHelmPtToFasta",(async()=>{await d(r.helmPt,u(c.Hi.FASTA),r.fastaPt)})),(0,t.t6)("testHelmUnToFasta",(async()=>{await d(r.helmUn,u(c.Hi.FASTA),r.fastaUn)})),(0,t.t6)("testHelmDnaToSeparator",(async()=>{await d(r.helmDna,u(c.Hi.SEPARATOR,"/"),r.separatorDna)})),(0,t.t6)("testHelmRnaToSeparator",(async()=>{await d(r.helmRna,u(c.Hi.SEPARATOR,"*"),r.separatorRna)})),(0,t.t6)("testHelmPtToSeparator",(async()=>{await d(r.helmPt,u(c.Hi.SEPARATOR,"-"),r.separatorPt)})),(0,t.t6)("testHelmUnToSeparator",(async()=>{await d(r.helmUn,u(c.Hi.SEPARATOR,"-"),r.separatorUn)})),(0,t.t6)("testHelmLoneRibose",(async()=>{await d(r.helmLoneRibose,u(c.Hi.FASTA),r.fastaRna)})),(0,t.t6)("testHelmLoneDeoxyribose",(async()=>{await d(r.helmLoneDeoxyribose,u(c.Hi.SEPARATOR,"/"),r.separatorDna)})),(0,t.t6)("testHelmLonePhosphorus",(async()=>{await d(r.helmLonePhosphorus,u(c.Hi.FASTA),r.fastaRna)}))}));var F=n(3516);(0,t.L1)("fastaFileHandler",(()=>{const n=["description:1","description:2","description:3","description:4"],r=(e.Column.fromStrings("description",n),["MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW","MIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL","MMELVLKTIIGPIVVGVVLRIVDKWLNKDK","MDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN"]);function s(e){const s=new F.m(e),o=s.descriptionsArray,i=s.sequencesArray;(0,t.J6)([o,i],[n,r])}(0,t.t6)("testNormalFormatting",(async()=>{s(">description:1\nMDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL\n\n>description:3\nMMELVLKTIIGPIVVGVVLRIVDKWLNKDK\n\n>description:4\nMDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN\n")})),(0,t.t6)("testExtraSpaces",(async()=>{s(">description:1\n MDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMI EVF LFGIVLGLI PITLAGLFVTAY LQYRRGDQLDL\n\n>description:3\nM MELVLKTI IGPI VVGVVLR IVDKWLNKDK\n\n>description:4\nMDR TDEVSNHTHDKP TLTWFEEIFEEYHSPFHN\n ")})),(0,t.t6)("testExtraNewlines",(async()=>{s(">description:1\n\nMDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMIEVF\nLFGIVLGLI\nPITLAGLFVTA\nYLQYRRGDQLDL\n\n>description:3\nM\nME\n\nLVLKTIIG\n\nPIVVGVVLRI\nVDKWLNKDK\n\n\n>description:4\n\nMDRT\n\nDEVSNHTHDKP\n\nTLTWFEEIFEE\n\n\n\nYHSPFHN\n")}))}));var V=n(3890);(0,t.L1)("fastaExport",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,l.Q)()})),function(e){e.single="single",e.multi="multi"}(r||(r={}));const s={[r.single]:{src:"MDYKETLLMPKTDFPMRGGLP",tgt:["MDYKETLLMP","KTDFPMRGGL","P"]},[r.multi]:{src:"M[MeI]YKETLL[MeF]PKTDFPMRGGL[MeA]",tgt:["M[MeI]YKETLL[MeF]P","KTDFPMRGGL","[MeA]"]}};let o;!function(e){e.test1="test1",e.test2="test2"}(o||(o={}));const i={[o.test1]:{srcCsv:"id,seq\n1,MDYKETLLMP\n2,KTDFPMRGGL\n3,P",idCols:["id"],seqCol:"seq",lineWidth:10,tgtFasta:">1\nMDYKETLLMP\n>2\nKTDFPMRGGL\n>3\nP\n"},[o.test2]:{srcCsv:"id,id2,seq\n1,seqA,M[MeI]YKETLL[MeF]P\n2,seqB,KTDFPMRGGL\n3,seqC,[MeA]\n",idCols:["id2","id"],seqCol:"seq",lineWidth:5,tgtFasta:">seqA|1\nM[MeI]YKE\nTLL[MeF]P\n>seqB|2\nKTDFP\nMRGGL\n>seqC|3\n[MeA]\n"}};function a(r,o=10){const i=s[r].src,a=e.Column.fromStrings("src",[i]);a.semType=e.SEMTYPE.MACROMOLECULE,a.meta.units=c.Hi.FASTA;const l=n.getSeqHandler(a).getSplitted(0),u=(0,V.aS)(l,o),d=s[r].tgt;(0,t.J6)(u,d)}async function u(r){const s=e.DataFrame.fromCsv(r.srcCsv),o=s.getCol(r.seqCol);o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA;const i=r.idCols.map((e=>s.getCol(e))),a=n.getSeqHandler(o),l=(0,V.wz)(i,a,r.lineWidth);(0,t.E3)(l,r.tgtFasta)}(0,t.t6)("wrapSequenceSingle",(async()=>{a(r.single,10)})),(0,t.t6)("wrapSequenceMulti",(async()=>{a(r.multi,10)})),(0,t.t6)("saveAsFastaTest1",(async()=>{u(i[o.test1])})),(0,t.t6)("saveAsFastaTest2",(async()=>{u(i[o.test2])}))}));var U=n(4152),Y=n(439);const B=Y._S;(0,t.L1)("bio",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r="seq\nACGTCT\nCAGTGT\nTTCAAC";(0,t.t6)("testGetStatsHelm1",(async()=>{const n=e.DataFrame.fromCsv("seq\nPEPTIDE1{meI}$$$$").getCol("seq");n.semType=e.SEMTYPE.MACROMOLECULE,n.meta.units=c.Hi.HELM;const r=(0,E.vZ)(n,1,c.qp);(0,t.Xk)(r.freq,{meI:1}),(0,t.E3)(r.sameLength,!0)})),(0,t.t6)("testGetStatsN1",(async()=>{await function(n){const r=e.DataFrame.fromCsv(n).col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const s=(0,E.vZ)(r,5,c.J9);(0,t.Xk)(s.freq,{A:4,C:5,G:3,T:6}),(0,t.E3)(s.sameLength,!0)}(r)})),(0,t.t6)("testGetAlphabetSimilarity",(async()=>{await async function(){const e={A:2041,C:3015,G:3015,T:2048,[B]:1e3},n=new Set(Object.keys(i.Q.Names)),r=(0,c.nq)(e,n);(0,t.E3)(r>.6,!0)}()})),(0,t.t6)("testPickupPaletteN1",(async()=>{await async function(r){const s=e.DataFrame.fromCsv(r).col("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA;const o=(0,c.SM)(s,n);(0,t.E3)(o instanceof i.A,!0)}(r)})),(0,t.t6)("testPickupPaletteN1e",(async()=>{await async function(){const r=e.DataFrame.fromCsv("seq\nACGTAT\nCAGTTG\nTTCG2C").col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const s=(0,c.SM)(r,n);(0,t.E3)(s instanceof i.A,!0)}()})),(0,t.t6)("testPickupPaletteAA1",(async()=>{await async function(){const r=e.DataFrame.fromCsv("seq\nFWPHEYV\nYNRQWYV\nMKPSEYV").col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const o=(0,c.SM)(r,n);(0,t.E3)(o instanceof s.X,!0)}()})),(0,t.t6)("testPickupPaletteX",(async()=>{await async function(){const r=e.DataFrame.fromCsv("seq\nXZJ{}2\n5Z4733\n3Z6></\n675687").col("seq");r.semType=e.SEMTYPE.MACROMOLECULE,r.meta.units=c.Hi.FASTA;const s=(0,c.SM)(r,n);(0,t.E3)(s instanceof U.$u,!0)}()}))})),(0,t.L1)("WebLogo.monomerToShort",(()=>{(0,t.t6)("longMonomerSingle",(async()=>{(0,t.E3)((0,c.zS)("S",5),"S")})),(0,t.t6)("longMonomerShort",(async()=>{(0,t.E3)((0,c.zS)("Short",5),"Short")})),(0,t.t6)("longMonomerLong56",(async()=>{(0,t.E3)((0,c.zS)("Long56",6),"Long56")})),(0,t.t6)("longMonomerComplexFirstPartShort",(async()=>{(0,t.E3)((0,c.zS)("Long-long",5),"Long…")})),(0,t.t6)("longMonomerComplexFirstPartLong56",(async()=>{(0,t.E3)((0,c.zS)("Long56-long",6),"Long5…")})),(0,t.t6)("monomerToShort",(async()=>{const e=[["AbC","AbC"],["AbCd","Ab…"],["ABc","ABc"],["ABcd","AB…"],["A_b","A_b"],["A_bc","A…"],["Ab_c","Ab…"],["A1_b","A1…"],["Abc_d","Ab…"],["Abcd_e","Ab…"],["A-b","A-b"],["A-bc","A…"],["Ab-c","Ab…"],["A1-b","A1…"],["Abc-d","Ab…"],["Abcd-e","Ab…"],["A","A"],["Ab","Ab"],["Abc","Abc"],["Ab…","Ab…"],["Abcd","Ab…"],["Abcde","Ab…"]],n=e.map((e=>e[0])),r=e.map((e=>e[1])),s=n.map((e=>(0,c.zS)(e,3)));(0,t.J6)(s,r)}))}));var W=n(8047);const j=Y._S;function K(e,n){(0,t.E3)(e.name,n.name),(0,t.J6)(e.getMonomers(),n.getMonomers());for(const r of e.getMonomers())(0,t.E3)(e.getFreq(r).rowCount,n.getFreq(r).rowCount)}(0,t.L1)("WebLogo.positions",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r="seq\nATC-G-TTGC--\nATC-G-TTGC--\n-TC-G-TTGC--\n-TC-GCTTGC--\n-TC-GCTTGC--";(0,t.t6)("allPositions",(async()=>{const n=e.DataFrame.fromCsv(r),s=a.shell.addTableView(n),o=n.getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,c.YI.DNA),o.setTag(c.gp.aligned,"SEQ.MSA");const i=await n.plot.fromType("WebLogo");await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{s.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500,"Layout calculate timeout");const l=i.positions,u=[new W.Ue(0,"1",{A:new W.Tc(2),[j]:new W.Tc(3)}),new W.Ue(1,"2",{T:new W.Tc(5)}),new W.Ue(2,"3",{C:new W.Tc(5)}),new W.Ue(3,"4",{[j]:new W.Tc(5)}),new W.Ue(4,"5",{G:new W.Tc(5)}),new W.Ue(5,"6",{[j]:new W.Tc(3),C:new W.Tc(2)}),new W.Ue(6,"7",{T:new W.Tc(5)}),new W.Ue(7,"8",{T:new W.Tc(5)}),new W.Ue(8,"9",{G:new W.Tc(5)}),new W.Ue(9,"10",{C:new W.Tc(5)}),new W.Ue(10,"11",{[j]:new W.Tc(5)}),new W.Ue(11,"12",{[j]:new W.Tc(5)})];(0,t.E3)(l.length,u.length);for(let e=0;e<l.length;e++){(0,t.E3)(l[e].name,u[e].name);for(const n of l[e].getMonomers())(0,t.E3)(l[e].getFreq(n).rowCount,u[e].getFreq(n).rowCount)}await i.awaitRendered()})),(0,t.t6)("positions with shrinkEmptyTail option true (filtered)",(async()=>{const n=e.DataFrame.fromCsv("seq\n-TC-G-TTGC--\n-TC-GCTTGC--\n-T--C-GT-\n-T--C-GT-\n-T--C-GT-\n-T--CCGT-"),r=a.shell.addTableView(n),s=n.getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,c.YI.DNA),s.setTag(c.gp.aligned,"SEQ"),n.filter.init((e=>e>2)),n.filter.fireChanged();const o=await n.plot.fromType("WebLogo",{shrinkEmptyTail:!0});await(0,t.PE)(o.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(o.root,e.DOCK_TYPE.DOWN)}),500);const i=o.positions,l=[new W.Ue(0,"1",{[j]:new W.Tc(3)}),new W.Ue(1,"2",{T:new W.Tc(3)}),new W.Ue(2,"3",{[j]:new W.Tc(3)}),new W.Ue(3,"4",{[j]:new W.Tc(3)}),new W.Ue(4,"5",{C:new W.Tc(3)}),new W.Ue(5,"6",{[j]:new W.Tc(2),C:new W.Tc(1)}),new W.Ue(6,"7",{G:new W.Tc(3)}),new W.Ue(7,"8",{T:new W.Tc(3)}),new W.Ue(8,"9",{[j]:new W.Tc(3)})];(0,t.E3)(i.length,l.length);for(let e=0;e<i.length;e++){(0,t.E3)(i[e].name,l[e].name);for(const n of i[e].getMonomers())(0,t.E3)(i[e].getFreq(n).rowCount,l[e].getFreq(n).rowCount)}await o.awaitRendered()})),(0,t.t6)("positions with skipEmptyPositions option",(async()=>{const n=e.DataFrame.fromCsv(r),s=a.shell.addTableView(n),o=n.getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,c.YI.DNA),o.setTag(c.gp.aligned,"SEQ.MSA");const i=await n.plot.fromType("WebLogo",{skipEmptyPositions:!0});await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{s.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500);const l=i.positions,u=[new W.Ue(0,"1",{A:new W.Tc(2),[j]:new W.Tc(3)}),new W.Ue(1,"2",{T:new W.Tc(5)}),new W.Ue(2,"3",{C:new W.Tc(5)}),new W.Ue(4,"5",{G:new W.Tc(5)}),new W.Ue(5,"6",{[j]:new W.Tc(3),C:new W.Tc(2)}),new W.Ue(6,"7",{T:new W.Tc(5)}),new W.Ue(7,"8",{T:new W.Tc(5)}),new W.Ue(8,"9",{G:new W.Tc(5)}),new W.Ue(9,"10",{C:new W.Tc(5)})];(0,t.E3)(l.length,u.length);for(let e=0;e<l.length;e++)K(l[e],u[e]);await i.awaitRendered()})),(0,t.t6)("count sequences for monomer at position",(async()=>{const s=function(t,n,r){const s=e.DataFrame.fromCsv(t),o=s.getCol("seq");return o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=n,o.setTag(c.gp.alphabet,r),o.setTag(c.gp.aligned,"SEQ.MSA"),s}(r,c.Hi.FASTA,c.YI.DNA),o=s.getCol("seq"),i=a.shell.addTableView(s),l=await s.plot.fromType("WebLogo",{startPositionName:"3",endPositionName:"7",skipEmptyPositions:!0});await(0,t.PE)(l.onLayoutCalculated,(()=>{}),(()=>{i.dockManager.dock(l.root,e.DOCK_TYPE.DOWN)}),500);const u=l.positions,d=[new W.Ue(2,"3",{C:new W.Tc(5)}),new W.Ue(4,"5",{G:new W.Tc(5)}),new W.Ue(5,"6",{[j]:new W.Tc(3),C:new W.Tc(2)}),new W.Ue(6,"7",{T:new W.Tc(5)})];(0,t.E3)(u.length,d.length);for(let e=0;e<u.length;e++)K(u[e],d[e]);const h=u[1],p=n.getSeqHandler(o),m=(0,W.eN)(s,p,s.filter,"G",h);(0,t.E3)(m,5),await l.awaitRendered()})),(0,t.t6)("empty",(async()=>{const n=e.DataFrame.fromColumns([(()=>{const t=e.Column.fromStrings("seq",[]);return t.semType=e.SEMTYPE.MACROMOLECULE,t.meta.units=c.Hi.FASTA,t.setTag(c.gp.alphabet,c.YI.DNA),t})()]),r=a.shell.addTableView(n),s=await n.plot.fromType("WebLogo");await(0,t.PE)(s.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(s.root,e.DOCK_TYPE.DOWN)}),500),s.positions,await s.awaitRendered()}))})),(0,t.L1)("WebLogo.project",(()=>{(0,t.t6)("fasta",(async()=>{const n="Tests.Bio.WebLogo-project.fasta",r=await Se.files.readCsv("tests/filter_FASTA.csv"),s=r.name,o=r.getCol("fasta");await a.data.detectSemanticTypes(r);const i=a.shell.addTableView(r),c=await r.plot.fromType("WebLogo",{sequenceColumnName:o.name});i.dockManager.dock(c),await c.awaitRendered(),await _(i.grid),await async function(t,n,r,s){const o=e.Project.create(),i=r.saveLayout();o.name=t,o.addChild(n),o.addChild(i),await a.dapi.layouts.save(r.saveLayout()),await a.dapi.tables.uploadDataFrame(s),await a.dapi.tables.save(n),await a.dapi.projects.save(o)}(n,r.getTableInfo(),i,r),a.shell.closeAll(),await(0,t.cb)(500),await a.dapi.projects.open(n);const l=a.shell.getTableView(s),u=A()(l.viewers).toArray();(0,t.E3)(u.length,2),(0,t.E3)(u.filter((e=>"Grid"===e.type)).length,1);const d=u.find((e=>"WebLogo"===e.type));(0,t.E3)(!!d,!0),await _(i.grid),await d.awaitRendered()}),{skipReason:"depends on 1.18"})})),(0,t.L1)("WebLogo.layout",(()=>{(0,t.t6)("fasta",(async()=>{const e=await Se.files.readCsv("tests/filter_FASTA.csv"),n=e.getCol("fasta");await a.data.detectSemanticTypes(e);const r=a.shell.addTableView(e),s=await e.plot.fromType("WebLogo",{sequenceColumnName:n.name});r.dockManager.dock(s),await(0,t.cb)(2*W.VN.render),await s.awaitRendered(),await _(r.grid);const o=r.saveLayout();o.toJson(),r.loadLayout(o),await(0,t.cb)(2*W.VN.render),await s.awaitRendered(),await _(r.grid);const i=A()(r.viewers).toArray();(0,t.E3)(i.length,2),(0,t.E3)(i.filter((e=>"Grid"===e.type)).length,1),(0,t.E3)(i.filter((e=>"WebLogo"===e.type)).length,1)}))}));var q=n(966);function z(e,t){let n=null;for(const r of e.viewers)r.type===t&&(n=r);return n}(0,t.L1)("checkInputColumn",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r="seq\nseq1,\nseq2,\nseq3,\nseq4";(0,t.t6)("testMsaPos",(async()=>{const s=e.DataFrame.fromCsv(r).getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,c.YI.DNA),s.setTag(c.gp.aligned,"SEQ");const[o,i]=(0,q.l)(s,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(o,!0)})),(0,t.t6)("testMsaNegHelm",(async()=>{const s=e.DataFrame.fromCsv(r).getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.HELM,s.setTag(c.gp.alphabetIsMultichar,"true");const[o,i]=(0,q.l)(s,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(o,!1)})),(0,t.t6)("testMsaNegUN",(async()=>{const s=e.DataFrame.fromCsv(r).getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,"UN"),s.setTag(c.gp.alphabetSize,"11"),s.setTag(c.gp.alphabetIsMultichar,"true"),s.setTag(c.gp.aligned,"SEQ");const[o,i]=(0,q.l)(s,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(o,!1)})),(0,t.t6)("testGetActionFunctionMeta",(async()=>{e.Func.find({package:"Bio",name:"multipleSequenceAlignmentDialog"})[0].inputs.find((e=>"sequence"==e.name))}))})),(0,t.L1)("similarity/diversity",(async()=>{(0,t.t6)("similaritySearchViewer",(async()=>{await async function(){const n=await Se.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(r);const s=a.shell.addTableView(r),o=s.dataFrame.getCol("MSA");(0,t.E3)(o.semType,e.SEMTYPE.MACROMOLECULE);const i=await s.dataFrame.plot.fromType("Sequence Similarity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),s.dockManager.dock(i,e.DOCK_TYPE.RIGHT,null,"Similarity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==z(s,"Sequence Similarity Search")),"Sequence Similarity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.moleculeColumn)throw new Error("The viewer has not molecule column (onTableAttached).");if(!i.beforeRender())throw new Error("The viewer is not able to render.");if(!i.computeRequested)throw new Error("The viewer has not compute requested even.");if(!c)throw new Error("The viewer has not compute completed.");const l=i;await(0,t.bk)((()=>0!==l.root.getElementsByClassName("d4-grid").length),"Sequence Similarity Search viewer grid has not been created",100);(0,t.E3)(l.fingerprint,"Morgan"),(0,t.E3)(l.distanceMetric,"Tanimoto"),(0,t.E3)(l.scores.get(0),e.FLOAT_NULL),(0,t.E3)(l.idxs.get(0),0),(0,t.E3)(l.molCol.get(0),"D-Tyr_Et/Tyr_ab-dehydroMe/dV/E/N/D-Orn/D-aThr//Phe_4Me"),(0,t.E3)(l.scores.get(1).toFixed(2),"0.73"),(0,t.E3)(l.idxs.get(1),4),(0,t.E3)(l.molCol.get(1),"Thr_PO3H2/Aca/D-Tyr_Et/Tyr_ab-dehydroMe/dV/Chg/N/D-Orn/D-aThr//Phe_4Me"),s.dataFrame.currentRowIdx=1,await(0,t.bk)((()=>1===l.targetMoleculeIdx),"Target molecule has not been changed",5e3),await(0,t.bk)((()=>"meI/hHis/Aca/Cys_SEt/T/dK/Thr_PO3H2/Aca/Tyr_PO3H2/D-Chg/dV/Phe_ab-dehydro/N/D-Orn/D-aThr//Phe_4Me"===l.molCol.get(0)),"Incorrect first similar molecule",5e3)}()})),(0,t.t6)("diversitySearchViewer",(async()=>{await async function(){const n=await Se.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n),s=a.shell.addTableView(r);await a.data.detectSemanticTypes(r);const o=s.dataFrame.getCol("MSA");(0,t.E3)(o.semType,e.SEMTYPE.MACROMOLECULE);const i=await s.dataFrame.plot.fromType("Sequence Diversity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),s.dockManager.dock(i,e.DOCK_TYPE.DOWN,null,"Diversity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==z(s,"Sequence Diversity Search")),"Sequence Diversity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.moleculeColumn)throw new Error("The viewer has not molecule column (onTableAttached).");if(!i.beforeRender())throw new Error("The viewer is not able to render.");if(!i.computeRequested)throw new Error("The viewer has not compute requested even.");if(!c)throw new Error("The viewer has not compute completed.");const l=i;await(0,t.bk)((()=>0!==l.root.getElementsByClassName("d4-grid").length),"Sequence Diversity Search viewer grid has not been created",100),(0,t.E3)(l.fingerprint,"Morgan"),(0,t.E3)(l.distanceMetric,"Tanimoto"),(0,t.E3)(l.initialized,!0),(0,t.E3)(l.renderMolIds.length>0,!0)}()}))}));var Z=n(1687),X=n(4577);(0,t.L1)("bio-substructure-filters",(async()=>{let n,r,s;async function o(e,t){if(!t.columns.names().includes(e))throw new Error(`The column '${e}' not found. Available in data frame are ${JSON.stringify(t.columns.names())}`);const r=new Z._i(n,Se.logger);return r.attach(t),r.applyState({columnName:e}),r.column=t.col(e),r.columnName=e,r}(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)})),(0,t.t6)("fasta",(async()=>{const e=await S("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const r=new Z._i(n,Se.logger);r.attach(e),await r.awaitRendered();try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"FastaBioFilter");const n=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new X.n("MD")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,3),(0,t.E3)(r.dataFrame?.filter.toBinaryString(),"10010000100000")}finally{r.detach()}await r.awaitRendered()})),(0,t.t6)("separator",(async()=>{const e=await S("tests/filter_MSA.csv"),r=new Z._i(n,Se.logger);await a.data.detectSemanticTypes(e),r.attach(e),await r.awaitRendered();try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"SeparatorBioFilter");const n=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.AR("meI")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,7),(0,t.E3)(r.dataFrame.filter.get(2),!1),await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.AR("/meI")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,0),await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.AR("meI-hHis","-")}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,7),(0,t.E3)(r.dataFrame.filter.get(2),!1)}finally{r.detach()}await r.awaitRendered()})),(0,t.t6)("helm-dialog",(async()=>{const e="Bio tests: substructureFilters/helm-dialog",r=await S("tests/filter_HELM.csv");await a.data.detectSemanticTypes(r);const s=a.shell.addTableView(r);Se.logger.debug(`${e}, filter attaching.`);const o=new Z._i(n,Se.logger);o.attach(r);const i=L.dialog("Test filters").add(o.root).show();await o.awaitRendered();try{const n=o.bioFilter;(0,t.E3)(null!==o.bioFilter,!0,"bioFilter is not created"),Se.logger.debug(`${e}, filter 1 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new X.n("PEPTIDE1{A.C}$$$$V2.0")}),2e4),Se.logger.debug(`${e}, filter 1 changed.`),(0,t.E3)(o.dataFrame.filter.trueCount,1),(0,t.E3)(o.dataFrame.filter.toBinaryString(),"0001"),Se.logger.debug(`${e}, filter 2 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new X.n("PEPTIDE1{C}$$$$V2.0")}),2e4),await _(s.grid),Se.logger.debug(`${e}, filter 2 changed.`),(0,t.E3)(o.dataFrame.filter.trueCount,2),(0,t.E3)(o.dataFrame.filter.toBinaryString(),"1001")}finally{i.close()}await o.awaitRendered(),await(0,t.cb)(3e3)})),(0,t.t6)("helm-view",(async()=>{const e=await S("tests/filter_HELM.csv");e.getCol("HELM string"),await a.data.detectSemanticTypes(e);const t=a.shell.addTableView(e);t.getFiltersGroup(),await _(t.grid)})),(0,t.t6)("sync-fasta",(async()=>{const e=await Se.files.readCsv("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const n=await o("fasta",e),r=await o("fasta",e);await Promise.all([n.awaitRendered(),r.awaitRendered()]);try{(0,t.E3)(!!n.bioFilter,!0),(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(n.bioFilter.type,"FastaBioFilter"),(0,t.E3)(r.bioFilter.type,"FastaBioFilter");const s=n.bioFilter,o=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{s.props=new X.n("MD")}),1e4,"await onRowsFiltered"),(0,t.E3)(e.filter.trueCount,3),await n.awaitRendered(),(0,t.E3)(o.props.substructure,"MD")}finally{n.detach(),r.detach()}await Promise.all([n.awaitRendered(),r.awaitRendered()])})),(0,t.t6)("sync-msa",(async()=>{const e=await Se.files.readCsv("tests/filter_MSA.csv");await a.data.detectSemanticTypes(e);const n="hHis-Aca",r=await o("MSA",e),s=await o("MSA",e);await Promise.all([r.awaitRendered(),s.awaitRendered()]);try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(!!s.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"SeparatorBioFilter"),(0,t.E3)(s.bioFilter.type,"SeparatorBioFilter");const o=r.bioFilter,i=s.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{o.props=new Z.AR(n,"-")}),1e4,"await onRowsFiltered"),(0,t.E3)(e.filter.trueCount,8),(0,t.E3)(i.props.substructure,n),(0,t.E3)(i.props.separator,"-")}finally{r.detach(),s.detach()}await Promise.all([r.awaitRendered(),s.awaitRendered()])})),(0,t.t6)("sync-helm",(async()=>{const e=await Se.files.readCsv("tests/filter_HELM.csv");await a.data.detectSemanticTypes(e);const n=a.shell.addTableView(e),r="PEPTIDE1{A.C}$$$$V2.0",s=await o("HELM string",e),i=await o("HELM string",e),c=L.dialog("Test filters").add(s.root).add(i.root).show();await Promise.all([s.awaitRendered(),i.awaitRendered()]);try{(0,t.E3)(!!s.bioFilter,!0),(0,t.E3)(!!i.bioFilter,!0),(0,t.E3)(s.bioFilter.type,"HelmBioFilter"),(0,t.E3)(i.bioFilter.type,"HelmBioFilter");const o=s.bioFilter,a=i.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{o.props=new X.n(r)}),6e4,"await onRowsFiltered"),await _(n.grid),Se.logger.debug("Bio tests: substructureFilters/sync-helm, before changed event"),await(0,t.cb)(2*s.debounceTime),Se.logger.debug("Bio tests: substructureFilters/sync-helm, after changed event"),(0,t.E3)(e.filter.trueCount,1),await s.awaitRendered(),(0,t.E3)(a.props.substructure,r)}finally{s.detach(),i.detach(),c.close()}await Promise.all([s.awaitRendered(),i.awaitRendered()]),await _(n.grid),await(0,t.cb)(3e3)})),(0,t.t6)("two-columns-fasta",(async()=>{const n=e.DataFrame.fromCsv("id,seq1,seq2,trueSeq1,trueSeq2\n0,CGGCTACGGC,ATTGCATTCG,0,1,\n1,CGGCTGCCGC,ATAGCATTCG,1,1,\n2,CGGCTGCGCC,AATGCATACG,1,0,\n3,CGGCTGCATT,TTTGCATTCG,1,1,\n4,CGGCTGCATT,AAAGCATACG,1,0,\n");await a.data.detectSemanticTypes(n);const r=a.shell.addTableView(n),s="seq1",o="CGGCTG",i=n.getCol("trueSeq1").toList(),c="seq2",l="GCATT",u=n.getCol("trueSeq2").toList(),d=[{type:"Bio:bioSubstructureFilter",columnName:s},{type:"Bio:bioSubstructureFilter",columnName:c}],h=await n.plot.fromType(e.VIEWER.FILTERS,{filters:d});r.dockManager.dock(h,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid);const p=h.filters[0],m=h.filters[1];(0,t.E3)(p.column.name,s),(0,t.E3)(m.column.name,c);const f=p.bioFilter,g=m.bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n(o)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n("")}),1e3,"testEvent onRowsFiltered on seq1"),(0,t.E3)(n.filter.trueCount,i.filter((e=>1===e)).length),(0,t.E3)(n.filter.toBinaryString(),i.map((e=>e.toString())).join("")),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n("")}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n(l)}),1e3,"testEvent onRowsFiltered on seq2"),(0,t.E3)(n.filter.trueCount,u.filter((e=>1===e)).length),(0,t.E3)(n.filter.toBinaryString(),u.map((e=>e.toString())).join("")),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n("")}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n("")}),1e3,"testEvent onRowsFiltered on neither"),(0,t.E3)(n.filter.trueCount,n.rowCount),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new X.n(o)}),5e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new X.n(l)}),5e3,"testEvent onRowsFiltered on both");const y=A().count(0).take(n.rowCount).map((e=>i[e]*u[e])).toArray();(0,t.E3)(n.filter.trueCount,y.filter((e=>1===e)).length),(0,t.E3)(n.filter.toBinaryString(),y.map((e=>e.toString())).join("")),await Promise.all([p.awaitRendered(),m.awaitRendered(),_(r.grid)])})),(0,t.t6)("reset-fasta",(async()=>{const n=await S("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(n);const r=a.shell.addTableView(n),s="MD",o=await n.plot.fromType(e.VIEWER.FILTERS,{filters:[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}]});r.dockManager.dock(o,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid);const i=o.filters[0].bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{i.props=new X.n(s)}),1e3,"testEvent onRowsFiltered"),(0,t.E3)(n.filter.trueCount,3),(0,t.E3)(i.props.substructure,s),(0,t.E3)(i.substructureInput.value,s),R()(o.root).find('i[name="icon-arrow-rotate-left"]')[0].click(),await(0,t.cb)(100),await _(r.grid),(0,t.E3)(i.props.substructure,""),(0,t.E3)(i.substructureInput.value,"")})),(0,t.t6)("reopen",(async()=>{const n=await Se.files.readCsv("tests/filter_FASTA.csv"),r=a.shell.addTableView(n),s=[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}],o=await n.plot.fromType(e.VIEWER.FILTERS,{filters:s});r.dockManager.dock(o,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid),o.close(),await _(r.grid);const i=await n.plot.fromType(e.VIEWER.FILTERS,{filters:s});r.dockManager.dock(i,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await _(r.grid)}))}));var Q=n(8152);class J{errorList=[];warningList=[];infoList=[];debugList=[];error(e,t,n){this.errorList.push({message:e,params:t,stackTrace:n})}warning(e,t){this.warningList.push({message:e,params:t})}info(e,t){this.infoList.push({message:e,params:t})}debug(e,t){this.debugList.push({message:e,params:t})}}var ee=n(9192);(0,t.L1)("PepSeA",(()=>{(0,t.gM)((async()=>{await(0,b.m8)()})),(0,t.t6)("Basic alignment",(async()=>{const n=e.DataFrame.fromCsv('HELM,MSA\n"PEPTIDE1{F.L.R.G.W.[MeF].Y.S.N.N.C}$$$$","F.L.R.G.W.MeF.Y..S.N.N.C"\n"PEPTIDE1{F.L.R.G.Y.[MeF].Y.W.N.C}$$$$","F.L.R.G.Y.MeF.Y.W...N.C"\n"PEPTIDE1{F.G.Y.[MeF].Y.W.S.D.N.C}$$$$","F...G.Y.MeF.Y.W.S.D.N.C"\n"PEPTIDE1{F.L.R.G.Y.[MeF].Y.W.S.N.D.C}$$$$","F.L.R.G.Y.MeF.Y.W.S.N.D.C"\n"PEPTIDE1{F.V.R.G.Y.[MeF].Y.W.S.N.C}$$$$","F.V.R.G.Y.MeF.Y.W.S..N.C"\n'),r=await(0,Q.GD)(n.getCol("HELM"),"msa(HELM)"),s=n.getCol("MSA");for(let e=0;e<r.length;++e)(0,t.E3)(r.get(e)==s.get(e),!0)}),{timeout:6e4,stressTest:!0}),(0,t.t6)("stderr",(async()=>{const n=new J,r=e.DataFrame.fromCsv('HELM,MSA\n"PEPTIDE1{F.L.Mis.G.W.[MeF].Y.S.N.N.C}$$$$","F.L.Mis.G.W.MeF.Y..S.N.N.C"\n"PEPTIDE1{F.L.Mis.G.Y.[MeF].Y.W.N.C}$$$$","F.L.Mis.G.Y.MeF.Y...W.N.C"\n"PEPTIDE1{F.G.Y.[MeF].Y.W.S.D.N.C}$$$$","F...G.Y.MeF.Y.W.S.D.N.C"\n'),s=await(0,Q.GD)(r.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n),o=r.getCol("MSA");(0,t.J6)(s.toList(),o.toList()),(0,t.E3)(n.warningList[0].message,"Mis not found in Monomer Map\nMeF not found in Monomer Map\n")}),{timeout:6e4,stressTest:!0}),(0,t.t6)("error",(async()=>{const n=new J;try{const t=e.DataFrame.fromCsv('HELM\n"PEPTIDE1{[NH2].*.A.Q.T.T.Y.K.N.Y.R.R.N.L.L.*.[COOH]}$$$$"\n"PEPTIDE1{[NH2].M.A.N.T.T.Y.K.N.Y.R.N.N.L.L.*.[COOH]}$$$$"\n"PEPTIDE1{[NH2].*.A.N.T.T.Y.K.C.Y.R.R.N.L.L.*.[COOH]}$$$$"\n"PEPTIDE1{[NH2].*.A.N.T.T.Y.K.F.Y.R.R.N.L.L.*.[COOH]}$$$$"\n');await(0,Q.GD)(t.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n)}catch(e){const[t,r]=(0,ee.AP)(e);n.error(t,void 0,r)}(0,t.E3)(n.errorList[0].message,"PepSeA error: The pair (*,M) couldn't be found in the substitution matrix")}))})),(0,t.L1)("viewers",(()=>{const n=e.Func.find({package:"Bio",tags:["viewer"]}).map((e=>e.friendlyName));for(const e of n)(0,t.t6)(e,(async()=>{const n=await S("samples/FASTA_DNA.csv");await(0,t.Bl)(e,n,{detectSemanticTypes:!0})}),{skipReason:{"Sequence Similarity Search":"GROK-13162","Sequence Diversity Search":"GROK-13162",WebLogo:"GROK-13162",VdRegions:"GROK-13162"}[e]})}));const te="seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",ne="seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT",re="seq\nabc-dfgg-abc1-cfr3-rty-wert-abc-dfgg-abc1-cfr3-rty-wert\nrut12-her2-rty-wert-abc-abc1-dfgg-rut12-her2-rty-wert-abc-abc1-dfgg\nrut12-rty-her2-abc-cfr3-wert-rut12-rut12-rty-her2-abc-cfr3-wert-rut12";var se;(0,t.L1)("SeqHandler",(()=>{let n;async function r(t){const r=e.DataFrame.fromCsv(t);await a.data.detectSemanticTypes(r);const s=n.getSeqHandler(r.getCol("seq"));return[r,s]}(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("Seq-Fasta",(async()=>{const[e,n]=await r(te);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!1)})),(0,t.t6)("Seq-Fasta-MSA",(async()=>{const[e,n]=await r(ne);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!0)})),(0,t.t6)("Seq-Fasta-units",(async()=>{const[e,n]=await r(te);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!1)})),(0,t.t6)("Seq-Fasta-MSA-units",(async()=>{const[e,n]=await r(ne);(0,t.E3)(n.notation,c.Hi.FASTA),(0,t.E3)(n.isMsa(),!0)})),(0,t.t6)("Seq-Helm",(async()=>{const[e,n]=await r("seq\nPEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Tyr_ab-dehydroMe.dV.E.N.D-Orn.D-aThr.Phe_4Me}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.D-Chg.dV.Phe_ab-dehydro.N.D-Orn.D-aThr.Phe_4Me}$$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.D-Chg.dV.Thr_PO3H2.N.D-Orn.D-aThr.Phe_4Me}$$$$");(0,t.E3)(n.notation,c.Hi.HELM),(0,t.E3)(n.isHelm(),!0)})),(0,t.t6)("Seq-UN",(async()=>{const[e,n]=await r(re);(0,t.E3)(n.notation,c.Hi.SEPARATOR),(0,t.E3)(n.separator,"-"),(0,t.E3)(n.alphabet,c.YI.UN)})),(0,t.t6)("Seq-UN-auto",(async()=>{const[e,n]=await r(re);(0,t.E3)(n.notation,c.Hi.SEPARATOR),(0,t.E3)(n.separator,"-"),(0,t.E3)(n.alphabet,c.YI.UN)})),(0,t.t6)("column-version",(async()=>{const r=e.DataFrame.fromCsv(te);await a.data.detectSemanticTypes(r);const s=r.getCol("seq"),o=n.getSeqHandler(s),i=s.version,c=n.getSeqHandler(s),l=s.version;(0,t.E3)(i,l,"Unexpected column version changed"),(0,t.E3)(o,c,"Unexpected SeqHandler object changed"),r.rows.addNew(["TACCCCTTCAAC"]);const u=n.getSeqHandler(s),d=s.version;(0,t.E3)(l<d,!0,"Stalled column version on add row"),(0,t.E3)(c!==u,!0,"Stalled SeqHandler object on add row"),s.set(1,"CAGTGTCCCCGT");const h=n.getSeqHandler(s),p=s.version;(0,t.E3)(d<p,!0,"Stalled column version on change data"),(0,t.E3)(u!==h,!0,"Stalled SeqHandler object on change data"),s.setTag("testTag","testValue");const m=n.getSeqHandler(s),f=s.version;(0,t.E3)(p<f,!0,"Stalled column version on set tag"),(0,t.E3)(h!==m,!0,"Stalled SeqHandler object on set tag")}))})),function(e){e.fasta="fasta",e.fastaMsa="fastaMsa",e.separator="separator",e.separatorMsa="separatorMsa",e.helm="helm"}(se||(se={})),(0,t.L1)("SeqHandler: splitted",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()})),Y.b9[c.Hi.FASTA],Y.b9[c.Hi.HELM];const r=Y.b9[c.Hi.SEPARATOR],s={[se.fasta]:{src:{csv:"seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC"},tgt:{notation:c.Hi.FASTA,splitted:[["A","C","G","T","C","A","C","G","T","C"],["C","A","G","T","G","T","C","A","G","T","G","T"],["T","T","C","A","A","C","T","T","C","A","A","C"]]}},[se.fastaMsa]:{src:{csv:"seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT"},tgt:{notation:c.Hi.FASTA,splitted:[["A","C","-","G","T","-","C","T","A","C","-","G","T","-","C","T"],["C","A","C","-","T","-","G","T","C","A","C","-","T","-","G","T"],["A","C","C","G","T","A","C","T","A","C","C","G","T","A","C","T"]]}},[se.separator]:{src:{csv:"seq\nabc-dfgg-abc1-cfr3-rty-wert-abc-dfgg-abc1-cfr3-rty-wert\nrut12-her2-rty-wert-abc-abc1-dfgg-rut12-her2-rty-wert-abc\nrut12-rty-her2-abc-cfr3-wert-rut12-rut12-rty-her2-abc-cfr3"},tgt:{notation:c.Hi.SEPARATOR,separator:"-",splitted:[["abc","dfgg","abc1","cfr3","rty","wert","abc","dfgg","abc1","cfr3","rty","wert"],["rut12","her2","rty","wert","abc","abc1","dfgg","rut12","her2","rty","wert","abc"],["rut12","rty","her2","abc","cfr3","wert","rut12","rut12","rty","her2","abc","cfr3"]]}},[se.separatorMsa]:{src:{csv:'seq\nrut0-dfgg-abc1-cfr3-rty-wert-abc-dfgg-abc1-cfr3-rty-wert\nrut1-her2-rty--abc1-dfgg-rut12-her2-rty--abc1-dfgg\nrut2-rty-her2---wert-rut12-rty-her2---wert\n"rut3-rty-her2-""-""-""-""-wert-rut12-rty-her2-""-""-""-""-wert"\n"""-""-rut4-her2-wert-rut12-rty-her2-wert"\n"rut5-rty-her2-wert-rut12-rty-her2-wert-""-"""'},tgt:{notation:c.Hi.SEPARATOR,separator:"-",splitted:[["rut0","dfgg","abc1","cfr3","rty","wert","abc","dfgg","abc1","cfr3","rty","wert"],["rut1","her2","rty",r,"abc1","dfgg","rut12","her2","rty",r,"abc1","dfgg"],["rut2","rty","her2",r,r,"wert","rut12","rty","her2",r,r,"wert"],["rut3","rty","her2",r,r,"wert","rut12","rty","her2",r,r,"wert"],[r,"rut4","her2","wert","rut12","rty","her2","wert"],["rut5","rty","her2","wert","rut12","rty","her2","wert",r]]}},[se.helm]:{src:{csv:"seq\nPEPTIDE1{meI.hHis.Aca.N.T.dE.Thr_PO3H2.Aca.D-Tyr_Et.Thr_PO3H2.Aca.D-Tyr_Et}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.dK.Thr_PO3H2.Aca}$$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.dK.Thr_PO3H2.Aca}$$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.T.dK.Thr_PO3H2}$$$$"},tgt:{notation:c.Hi.HELM,splitted:[["meI","hHis","Aca","N","T","dE","Thr_PO3H2","Aca","D-Tyr_Et","Thr_PO3H2","Aca","D-Tyr_Et"],["meI","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","Aca","dK","Thr_PO3H2","Aca"],["Lys_Boc","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","Aca","dK","Thr_PO3H2","Aca"],["meI","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","T","dK","Thr_PO3H2"]]}}};for(const[r,o]of Object.entries(s))(0,t.t6)(`${r}`,(async()=>{const r=e.DataFrame.fromCsv(o.src.csv).getCol("seq"),s=await a.functions.call("Bio:detectMacromolecule",{col:r});s&&(r.semType=s),(0,t.E3)(r.semType,e.SEMTYPE.MACROMOLECULE);const i=n.getSeqHandler(r);(0,t.E3)(i.notation,o.tgt.notation),(0,t.E3)(i.separator===o.tgt.separator,!0);const c=A().count(0).take(i.length).map((e=>{const t=i.getSplitted(e);return A().count(0).take(t.length).map((e=>t.getOriginal(e))).toArray()})).toArray();(0,t.J6)(c,o.tgt.splitted)}))})),(0,t.L1)("SeqHandler: getRegion",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r={fastaDna:{srcCsv:"seq\nATTCGT\nACTGCTC\nATTCCGTA",startIdx:2,endIdx:4,tgtCsv:"seq\nTCG\nTGC\nTCC",units:c.Hi.FASTA,alphabet:c.YI.DNA,positionNames:{tag:"a, b, c, d, e, f, g, h",start:"c",end:"e"}},separatorPt:{srcCsv:"seq\nM-D-Y-K-E-T-L\nM-I-E-V-F-L-F-G-I\nM-M-",startIdx:5,endIdx:null,tgtCsv:"seq\nT-L--\nL-F-G-I\n---",units:c.Hi.SEPARATOR,alphabet:c.YI.PT,positionNames:{tag:"1, 1A, 1B, 2, 3, 4, 4A, 4A, 4C",start:"4",end:null}},helm:{srcCsv:"seq\nPEPTIDE1{[meI].[hHis].[Aca].N.T.[dE].[Thr_PO3H2].[Aca].[D-Tyr_Et].[Tyr_ab-dehydroMe].[dV].E.N.[D-Orn]}$$$$\nPEPTIDE1{[meI].[hHis].[Aca].[Cys_SEt].T.[dK].[Thr_PO3H2].[Aca].[Tyr_PO3H2].[D-Chg].[dV].[Phe_ab-dehydro]}$$$$\nPEPTIDE1{[Lys_Boc].[hHis].[Aca].[Cys_SEt].T}$$$$",startIdx:3,endIdx:6,tgtCsv:"seq\nPEPTIDE1{N.T.[dE].[Thr_PO3H2]}$$$$\nPEPTIDE1{[Cys_SEt].T.[dK].[Thr_PO3H2]}$$$$\nPEPTIDE1{[Cys_SEt].T.*.*}$$$$",units:c.Hi.HELM,alphabet:null,positionNames:{tag:null,start:"4",end:"7"}}};for(const[s,o]of Object.entries(r))(0,t.t6)(`${s}-idx`,(async()=>{const r=e.DataFrame.fromCsv(o.srcCsv).getCol("seq"),s=await a.functions.call("Bio:detectMacromolecule",{col:r});s&&(r.semType=s);const i=n.getSeqHandler(r).getRegion(o.startIdx,o.endIdx,"regSeq"),l=e.DataFrame.fromCsv(o.tgtCsv).getCol("seq");(0,t.E3)(r.meta.units,o.units),(0,t.E3)(i.meta.units,o.units),(0,t.E3)(r.getTag(c.gp.alphabet),o.alphabet),(0,t.E3)(i.getTag(c.gp.alphabet),o.alphabet),(0,t.J6)(i.toList(),l.toList())})),o.positionNames&&(0,t.t6)(`${s}-positionNames`,(async()=>{const n=e.DataFrame.fromCsv(o.srcCsv).getCol("seq");o.positionNames.tag&&n.setTag(c.gp.positionNames,o.positionNames.tag);const r=await a.functions.call("Bio:detectMacromolecule",{col:n});r&&(n.semType=r);const s=await a.functions.call("Bio:getRegion",{sequence:n,start:o.positionNames.start,end:o.positionNames.end}),i=e.DataFrame.fromCsv(o.tgtCsv).getCol("seq");(0,t.E3)(n.meta.units,o.units),(0,t.E3)(s.meta.units,o.units),(0,t.E3)(n.getTag(c.gp.alphabet),o.alphabet),(0,t.E3)(s.getTag(c.gp.alphabet),o.alphabet),(0,t.J6)(s.toList(),i.toList())}))})),(0,t.L1)("SeqHandler: getHelm",(()=>{let n,r,s;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)}));const o={fasta:{src:{seq:"MDYKETMDYKET",notation:c.Hi.FASTA},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T.M.D.Y.K.E.T}$$$$"}},separator:{src:{seq:"M-D-Y-K-E-T-M-D-Y-K-E-T",notation:c.Hi.SEPARATOR,separator:"-"},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T.M.D.Y.K.E.T}$$$$"}},helm:{src:{seq:"PEPTIDE1{M.D.Y.K.E.T}$$$$",notation:c.Hi.HELM},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T}$$$$"}},"helm-cyclic":{src:{seq:"PEPTIDE1{M.D.Y.K.E.T}$PEPTIDE1,PEPTIDE1,6:R2-1:R1$$$V2.0",notation:c.Hi.HELM},tgt:{helm:"PEPTIDE1{M.D.Y.K.E.T}$PEPTIDE1,PEPTIDE1,6:R2-1:R1$$$V2.0"}}};for(const[e,n]of Object.entries(o))(0,t.t6)(e,(async()=>{await i(n.src.seq,n.src.notation,n.src.separator,n.tgt.helm)}));async function i(r,s,o,i){const c=e.Column.fromStrings("seq",[r]),l=e.DataFrame.fromColumns([c]);await a.data.detectSemanticTypes(l);const u=n.getSeqHandler(c),d=(await u.getHelm(0)).value;(0,t.E3)(d,i)}}));var oe=n(6956);class ie{constructor(e){const t=e.split(oe.xe);t.forEach((e=>this.validateConnectionItem(e))),this.connectionItems=t}connectionItems;validateConnectionItem(e){const t="(PEPTIDE|RNA)",n=new RegExp(`${t}[0-9]+,${t}[0-9]+,[0-9]+:R[0-9]+-[0-9]+:R[0-9]+`,"g");if(!e.match(n))throw new Error(`Cannot parse connection item from ${e}`)}getConnectionData(){const e=[];return this.connectionItems.forEach((t=>{const n=[],r=t.split(",");r[2].split("-").forEach(((e,t)=>{const s=r[t],o=e.split(":"),i={monomerIdx:parseInt(o[0])-1,rGroupId:parseInt(o[1].slice(1))};n.push({polymerId:s,bond:i})})),e.push(n)})),e}}class ae{simplePolymer;constructor(e){this.simplePolymer=e,this.polymerType=this.getPolymerType(),this.idx=this.getIdx();const{monomers:t,monomerTypes:n}=this.getMonomerSymbolsAndTypes();this.monomers=t,this.monomerTypes=n}polymerType;monomers;idx;monomerTypes;get id(){return this.polymerType+this.idx.toString()}getPolymerType(){const e=new RegExp("(PEPTIDE|RNA)[0-9]+{"),t=this.simplePolymer.match(e);if(!t)throw new Error(`Unsupported polymer type in ${this.simplePolymer}`);return t[1]}getIdx(){const e=new RegExp(`${this.polymerType}([0-9]+){`),t=this.simplePolymer.match(e);if(!t)throw new Error(`Cannot parse simple polymer id from ${this.simplePolymer}`);return parseInt(t[1])}getMonomerSymbolsAndTypes(){const e=new RegExp(`${this.polymerType}${this.idx}{|}`,"g"),t=this.simplePolymer.replace(e,"").split("."),n=[],r=[];return t.forEach((e=>{n.push(e),r.push("Backbone")})),{monomers:n,monomerTypes:r}}getBondData(){const e=[],t=this.monomerTypes.map(((e,t)=>{if("Backbone"===e)return t})).filter((e=>void 0!==e)),n=this.monomerTypes.map(((e,t)=>{if("Branch"===e)return t})).filter((e=>void 0!==e));for(let n=0;n<t.length-1;n++){const r=t[n],s=t[n+1];e.push([{monomerIdx:r,rGroupId:2},{monomerIdx:s,rGroupId:1}])}for(let t=0;t<n.length;t++){const r=n[t],s=r-1;e.push([{monomerIdx:s,rGroupId:3},{monomerIdx:r,rGroupId:1}])}return e}}class ce{helmString;constructor(e){this.helmString=e;const t=this.helmString.split(oe.pk),n=t[0].split(oe.xe);this.simplePolymers=n.map((e=>new ae(e))),""!==t[1]&&(this.connectionList=new ie(t[1])),this.bondData=this.getBondData(),this.bondedRGroupsMap=this.getBondedRGroupsMap()}bondData;simplePolymers;connectionList;bondedRGroupsMap;getBondedRGroupsMap(){const e=new Map;return this.bondData.forEach((t=>{t.forEach((t=>{const n=t.monomerIdx,r=t.rGroupId;e.get(n)||e.set(n,[]),e.get(n).push(r)}))})),e}toString(){return this.helmString}getPolymerTypeByMonomerIdx(e){return this.getSimplePolymerByMonomerIdx(e).polymerType}getSimplePolymerByMonomerIdx(e){const t=this.getMonomerIdxShifts(),n=Object.values(t).sort(((e,t)=>e-t)).find((t=>e>=t));if(void 0===n)throw new Error(`Cannot find simple polymer for monomer ${e}`);const r=Object.keys(t).find((e=>t[e]===n));return this.simplePolymers.find((e=>e.id===r))}shiftBondMonomerIds(e,t){t.forEach((t=>{t.forEach((t=>{t.monomerIdx+=e}))}))}getMonomerIdxShifts(){const e={};let t=0;return this.simplePolymers.forEach((n=>{e[n.id]=t,t+=n.monomers.length})),e}getBondData(){const e=this.getMonomerIdxShifts(),t=[];return this.simplePolymers.forEach((n=>{const r=n.getBondData(),s=e[n.id];this.shiftBondMonomerIds(s,r),t.push(...r)})),this.connectionList&&this.connectionList.getConnectionData().forEach((n=>{const r=[];n.forEach((t=>{const n=e[t.polymerId],s=t.bond;s.monomerIdx+=n,r.push(s)})),t.push(r)})),t}}(0,t.L1)("helm",(()=>{const e={"single-linear":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T.[meI]}$$$$"},tgt:{simplePolymers:[6],bondedRGroups:[1,2,2,2,2,1]}},"single-cyclized-C-2-2":{src:{helm:"PEPTIDE1{R.F.C.Y.G.H.[GGaz].C.T.[meI]}$PEPTIDE1,PEPTIDE1,3:R3-8,R3$$$"},tgt:{simplePolymers:[10],bondedRGroups:[1,2,3,2,2,2,2,3,2,1]}},"single-cyclized-C-1-1":{src:{helm:"PEPTIDE1{F.C.Y.G.H.[GGaz].C.[meI]}$PEPTIDE1,PEPTIDE1,2:R3-7,R3$$$"},tgt:{simplePolymers:[8],bondedRGroups:[1,3,2,2,2,1,3,1]}},"single-cyclized-C-0-0":{src:{helm:"PEPTIDE1{C.Y.G.H.[GGaz].C}$PEPTIDE1,PEPTIDE1,2:R3-7,R3$$$"},tgt:{simplePolymers:[6],bondedRGroups:[2,2,2,2,2,2]}},"two-separated-1":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T}|PEPTIDE2{[meI]}$$$$"},tgt:{simplePolymers:[5,1],bondedRGroups:[1,2,2,2,1,1]}},"two-separated-2":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz]}|PEPTIDE2{T.[meI]}$$$$"},tgt:{simplePolymers:[4,2],bondedRGroups:[1,2,2,1,1,1]}},"two-connected-1":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T}|PEPTIDE2{[meI]}$PEPTIDE1,PEPTIDE2,5:R2-1,R1$$$"},tgt:{simplePolymers:[5,1],bondedRGroups:[1,2,2,2,2,1]}},"two-connected-2":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz]}|PEPTIDE2{T.[meI]}$PEPTIDE1,PEPTIDE2,4:R2-1,R1$$$"},tgt:{simplePolymers:[4,2],bondedRGroups:[1,2,2,2,2,1]}}};for(const[n,{src:r,tgt:s}]of Object.entries(e))(0,t.t6)(n,(async()=>{const e=new ce(r.helm),n=e.simplePolymers.map((e=>e.monomers.length)),o=n.reduce(((e,t)=>e+t),0);(0,t.E3)(n,s.simplePolymers);const i=A().count(0).take(e.bondedRGroupsMap.size).map((t=>e.bondedRGroupsMap.get(t).length)).toArray();(0,t.E3)(o,i.length)}),{skipReason:"new tests"})}));var le=n(6077),ue=n(6717);const de=new e.FileSource("System:AppData/Bio"),he={"peptides-fasta":{inPath:"tests/to-atomic-level-peptides-fasta-input.csv",outPath:"tests/to-atomic-level-peptides-fasta-output.csv"},"dna-fasta":{inPath:"tests/to-atomic-level-dna-fasta-input.csv",outPath:"tests/to-atomic-level-dna-fasta-output.csv"},"msa-separator":{inPath:"tests/to-atomic-level-msa-separator-input.csv",outPath:"tests/to-atomic-level-msa-separator-output.csv"},"msa-fasta":{inPath:"tests/to-atomic-level-msa-fasta-input.csv",outPath:"tests/to-atomic-level-msa-fasta-output.csv"}},pe="molfile(sequence)";function me(e){return e.replaceAll("\r\n","\n").replace(/\n$/,"").split("\n").map((e=>e.trimEnd())).join("\n")}(0,t.L1)("toAtomicLevel",(async()=>{const n={},r={};let s,o,i,u,d,h;async function p(e,n){const r=e.getCol("sequence");await a.functions.call("Bio:toAtomicLevel",{table:e,seqCol:r,nonlinear:!1});const s=e.getCol(pe),o=n.getCol(pe),i=A()(s.values()).map((e=>me(e))).toArray(),c=A()(o.values()).map((e=>me(e))).toArray();(0,t.J6)(i,c)}(0,t.gM)((async()=>{d=await(0,ue.j)(),i=await(0,l.Q)(),s=await(0,T.pj)(),o=await(0,N.ub)(),await s.loadMonomerLibForTests(),u=s.getMonomerLib();for(const[t,s]of Object.entries(he))s.inPath,n[t]=e.DataFrame.fromCsv((await de.readAsText(s.inPath)).replace(/\n$/,"")),await a.data.detectSemanticTypes(n[t]),r[t]=e.DataFrame.fromCsv((await de.readAsText(s.outPath)).replace(/\n$/,""))})),(0,t.Pl)((async()=>{await(0,N.Eu)(o),await s.loadMonomerLib(!0)}));for(const[e,s]of Object.entries(he))(0,t.t6)(`${e}`,(async()=>{await p(n[e],r[e])}));!function(e){e.fastaDna="fastaDna",e.fastaRna="fastaRna",e.fastaPt="fastaPt",e.fastaUn="fastaUn",e.separatorDna="separatorDna",e.separatorRna="separatorRna",e.separatorPt="separatorPt",e.separatorUn="separatorUn",e.helm="helm"}(h||(h={}));const m={[h.fastaDna]:"seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",[h.fastaRna]:"seq\nACGUCACGUC\nCAGUGUCAGUGU\nUUCAACUUCAAC",[h.fastaPt]:"seq\nFWPHEYFWPHEY\nYNRQWYVYNRQWYV\nMKPSEYVMKPSEYV",[h.fastaUn]:"seq\n[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D[meI][hHis][Aca]NT[dE][Thr_PO3H2][Aca]D\n[meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][meI][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2]\n[Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2][Lys_Boc][hHis][Aca][Cys_SEt]T[dK][Thr_PO3H2][Aca][Tyr_PO3H2]",[h.separatorDna]:"seq\nA/C/G/T/C/A/C/G/T/C\nC/A/G/T/G/T/C/A/G/T/G/T\nT/T/C/A/A/C/T/T/C/A/A/C",[h.separatorRna]:"seq\nA*C*G*U*C*A*C*G*U*C\nC*A*G*U*G*U*C*A*G*U*G*U\nU*U*C*A*A*C*U*U*C*A*A*C",[h.separatorPt]:"seq\nF-W-P-H-E-Y-F-W-P-H-E-Y\nY-N-R-Q-W-Y-V-Y-N-R-Q-W-Y-V\nM-K-P-S-E-Y-V-M-K-P-S-E-Y-V",[h.separatorUn]:"seq\nmeI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D-meI-hHis-Aca-N-T-dE-Thr_PO3H2-Aca-D\nmeI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-meI-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2\nLys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2-Lys_Boc-hHis-Aca-Cys_SEt-T-dK-Thr_PO3H2-Aca-Tyr_PO3H2",[h.helm]:"seq\nPEPTIDE1{meI.D-gGlu.Aca.N.T.dE.Thr_PO3H2.Aca.D.Thr_PO3H2.Aca.D}$$$\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.Thr_PO3H2.Aca.Tyr_PO3H2}$$$\nPEPTIDE1{Lys_Boc.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.Aca.Tyr_PO3H2.Thr_PO3H2.Aca.Tyr_PO3H2}$$$"};async function f(t){const n=m[t],r=e.DataFrame.fromCsv(n.replace(/\n$/,""));return await a.data.detectSemanticTypes(r),r}async function g(e,t="seq",n){const r=e.getCol(t),s=await(0,le.C4)(e,r,u,i,d);return s.warnings.length>0&&Se.logger.warning(`_toAtomicLevel() warnings ${s.warnings.join("\n")}`),s.molCol}(0,t.t6)("fastaDna",(async()=>{await g(await f(h.fastaDna),"seq")})),(0,t.t6)("fastaRna",(async()=>{await g(await f(h.fastaRna),"seq")})),(0,t.t6)("fastaPt",(async()=>{await g(await f(h.fastaPt),"seq")})),(0,t.t6)("fastaUn",(async()=>{await g(await f(h.fastaUn),"seq")})),(0,t.t6)("separatorDna",(async()=>{await g(await f(h.separatorDna),"seq")})),(0,t.t6)("separatorDna",(async()=>{await g(await f(h.separatorRna),"seq")})),(0,t.t6)("separatorPt",(async()=>{await g(await f(h.separatorPt),"seq")})),(0,t.t6)("separatorUn",(async()=>{await g(await f(h.separatorUn),"seq")})),(0,t.t6)("helm",(async()=>{await g(await f(h.helm),"seq")})),(0,t.t6)("ptFasta2",(async()=>{const n=await Se.files.readAsText("tests/to-atomic-level-pt-fasta-2.mol"),r=e.DataFrame.fromCsv("seq\nAR"),s=r.getCol("seq");s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA,s.setTag(c.gp.alphabet,c.YI.PT),i.getSeqHandler(s);const o=await g(r,"seq");(0,t.E3)(me(o.get(0)),me(n))}))}));var fe=n(8754);(0,t.L1)("toAtomicLevel-ui",(()=>{let n,r,s,o,i;(0,t.gM)((async()=>{s=await(0,l.Q)(),i=await(0,ue.j)(),n=await(0,T.pj)(),r=await(0,N.ub)(),await n.loadMonomerLibForTests(),o=n.getMonomerLib()})),(0,t.Pl)((async()=>{await(0,N.Eu)(r),await n.loadMonomerLib(!0)}));const u={fasta:{src:{seq:"MDYKETLLMPK",units:c.Hi.FASTA},tgt:{atomCount:94,bondCount:95}},"fasta-with-gap":{src:{seq:"MD-YKETLLMPK",units:c.Hi.FASTA},tgt:{atomCount:94,bondCount:95}},helm:{src:{seq:"PEPTIDE1{meI.hHis.Aca.N.T.dK.Thr_PO3H2}$$$$",units:c.Hi.HELM},tgt:{atomCount:68,bondCount:68}},"helm-with-gap":{src:{seq:"PEPTIDE1{meI.hHis.*.Aca.N.T.dK.Thr_PO3H2}$$$$",units:c.Hi.HELM},tgt:{atomCount:68,bondCount:68}}},d=async t=>{const n=t.src.seq,r=e.DataFrame.fromColumns([e.Column.fromList(e.COLUMN_TYPE.STRING,"seq",[n])]);return await a.data.detectSemanticTypes(r),r.getCol("seq")};for(const[e,n]of Object.entries(u))(0,t.t6)(`${e}-linear`,(async()=>{const e=await d(n);await h(e,!1,n.tgt)}));for(const[e,n]of Object.entries(u))(0,t.t6)(`${e}-nonlinear`,(async()=>{const e=await d(n);await h(e,!0,n.tgt)}));async function h(n,r,a){const c=await(0,fe.V)(n.dataFrame,n,r,!1,o,s,i);(0,t.E3)(c.molCol.semType,e.SEMTYPE.MOLECULE);const l=c.molCol.get(0),u=i.get_mol(l);(0,t.E3)(null!=u,!0,"No molecule generated");try{const e=u.get_num_atoms(),n=u.get_num_bonds();(0,t.E3)(e,a.atomCount),(0,t.E3)(n,a.bondCount)}finally{u.delete()}}}));var ge=n(6863);async function ye(t,n){const r=e.DataFrame.fromCsv(t),s=r.col("seq"),o=await a.functions.call("Bio:detectMacromolecule",{col:s});return o&&(s.semType=o),await a.data.detectSemanticTypes(r),n.getSeqHandler(s)}function be(e,n,r,s){const o=r(e,n);(0,t.E3)(Number(o.toFixed(3)),Number(s.toFixed(3)))}(0,t.L1)("Distance",(async()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()}));const r=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s={F:0,W:1,R:2,Y:3},o="FWRWY",i="FWRWW",a="FWY",c="FWRWY",u="FWY",d="FWRRRRY";(0,t.t6)("protein-distance-function",(async()=>{const e=(await ye("seq\nFWRWYVKHPFWRWYVKHP\nYNRWYVKHPYNRWYVKHP\nMWRSWYCKHPMWRSWYCKHP",n)).getDistanceFunctionName();(0,t.E3)(e,ge.Z.LEVENSHTEIN)})),(0,t.t6)("DNA-distance-function",(async()=>{const e=(await ye("seq\nATAACGATAACG\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ge.Z.LEVENSHTEIN)})),(0,t.t6)("MSA-distance-function",(async()=>{const e=(await ye("seq\nATAACATAAC\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ge.Z.HAMMING)})),(0,t.t6)("levenstein-sub",(async()=>{const e=ge.V[ge.Z.LEVENSHTEIN]();be(o,i,e,.2)})),(0,t.t6)("levenstein-del",(async()=>{const e=ge.V[ge.Z.LEVENSHTEIN]();be(a,c,e,.4)})),(0,t.t6)("hamming",(async()=>{const e=ge.V[ge.Z.HAMMING]();be(a,c,e,.6)})),(0,t.t6)("needleman-blosum62",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});be(o,i,e,-6)})),(0,t.t6)("needleman-blosum62-del",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});be(a,c,e,-3.667)})),(0,t.t6)("needleman-custom-sub",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:1});be(o,i,e,.2)})),(0,t.t6)("needleman-custom-del",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:1});be(a,c,e,.667)})),(0,t.t6)("needleman-custom-zero-extend",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:0});be(u,d,e,.333)})),(0,t.t6)("needleman-custom-half-extend",(async()=>{const e=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:2,gapExtend:1});be(u,d,e,1.667)})),(0,t.t6)("needleman-custom-same-extend",(async()=>{const t=ge.V[ge.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:s,gapOpen:1,gapExtend:1});e.Test.isInBenchmark?be(Array(1e3).fill(u).join(""),Array(1e3).fill(d).join(""),t,1.333):be(u,d,t,1.333)}),{benchmark:!0})}));var we=n(684);async function ve(e,n,r,s,o,i,c,l){await a.data.detectSemanticTypes(e);const u=await a.functions.call("Bio:activityCliffs",{table:e,molecules:e.getCol(r),activities:e.getCol(s),similarity:o,methodName:n,similarityMetric:c,preprocessingFunction:l,options:{[`${we.vb}`]:!0},demo:!1});(0,t.E3)(null!=u,!0);const d=Array.from(u.root.children).find((e=>{const t=e.className.split(" ");return["ui-btn","ui-btn-ok"].every((e=>t.includes(e)))}));(0,t.E3)(d.innerText.toLowerCase(),`${i} cliffs`)}var Ae=n(2780),Ee=n(9039),Te=n(9124);async function Ce(n,r,s){const o=n.getCol(s),i=await a.functions.call("Bio:detectMacromolecule",{col:o});i&&(o.semType=i);const c=e.Func.find({package:"Bio",name:"macromoleculePreprocessingFunction"})[0];if(!c)throw new Error("Preprocessing function not found");const l=await a.functions.call("Bio:sequenceSpaceTopMenu",{table:n,molecules:n.col(s),methodName:r,similarityMetric:ge.Z.LEVENSHTEIN,plotEmbeddings:!0,preprocessingFunction:c,options:{[we.vb]:!0}});(0,t.E3)(null!=l,!0)}(0,t.L1)("activityCliffs",(async()=>{let n,r,s;const o=e.Func.find({name:"macromoleculePreprocessingFunction",package:"Bio"})[0],i=e.Func.find({name:"helmPreprocessingFunction",package:"Bio"})[0];(0,t.gM)((async()=>{n=await(0,Te.b2)(),r=await(0,T.pj)(),s=await(0,N.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(s),await r.loadMonomerLib(!0)})),(0,t.t6)("activityCliffsOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_motif-with-random_10000.csv",tgt:{cliffCount:53}}:{fileName:"tests/100_3_clustests.csv",tgt:{cliffCount:3}},n=await S(t.fileName);a.shell.addTableView(n),await ve(n,Ee.c.UMAP,"sequence","Activity",90,t.tgt.cliffCount,ge.Z.LEVENSHTEIN,o)}),{benchmark:!0}),(0,t.t6)("activityCliffsWithEmptyRows",(async()=>{const e=await S("tests/100_3_clustests_empty_vals.csv");a.shell.addTableView(e),await ve(e,Ee.c.UMAP,"sequence","Activity",90,3,ge.Z.LEVENSHTEIN,o)})),(0,t.t6)("Helm",(async()=>{const e=await Se.files.readCsv("samples/HELM_50.csv");a.shell.addTableView(e),await ve(e,Ee.c.UMAP,"HELM","Activity",65,20,Ae.aT.Tanimoto,i)}))})),(0,t.L1)("sequenceSpace",(async()=>{let n,r,s,o;(0,t.t6)("sequenceSpaceOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_motif-with-random_10000.csv"}:{fileName:"tests/100_3_clustests.csv"};n=await S(t.fileName),r=a.shell.addTableView(n),await Ce(n,Ee.c.UMAP,"sequence")}),{benchmark:!0}),(0,t.t6)("sequenceSpaceWithEmptyRows",(async()=>{s=await S("tests/100_3_clustests_empty_vals.csv"),o=a.shell.addTableView(s),await Ce(s,Ee.c.UMAP,"sequence")}))})),(0,t.L1)("Scoring",(()=>{const n="sequence",r="expected_similarity",s="expected_identity",o=e.DataFrame.fromCsv(`${n},${r},${s}\nPEPTIDE1{Aca.Orn.gGlu.Pqa.D-His_1Bn.dH.hHis.4Abz.D-Tic.D-Dap.Y.Iva.meS.F.P.F.D-1Nal}$$$$,1.0,1.0\nPEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva.I.Tyr_26diMe.P.Asu.meC}$$$$,0.68,0.53\nPEPTIDE1{[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal]}$$$$V2.0,0.34,0.0`),i=o.getCol(n);i.meta.units=c.Hi.HELM,i.semType=e.SEMTYPE.MACROMOLECULE;const l=i.get(0);let u,d;(0,t.gM)((async()=>{u=await(0,T.pj)(),d=await(0,N.ub)(),await u.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,N.Eu)(d),await u.loadMonomerLib(!0)})),(0,t.t6)("Identity",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:o,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const r=e.get(n),i=o.get(s,n);(0,t.Wj)(r,i,.01,`Wrong identity score for sequence at position ${n}`)}})),(0,t.t6)("Identity-shortReference",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:o,macromolecule:i,reference:"PEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva}$$$$"});(0,t.E3)(A().count(0).take(e.length).map((t=>e.get(t))).every((e=>null!=e&&!isNaN(e))),!0)})),(0,t.t6)("Identity-longReference",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:o,macromolecule:i,reference:"PEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva.I.Tyr_26diMe.P.Asu.meC.I.Tyr_26diMe.P.Asu.meC}$$$$"});(0,t.E3)(A().count(0).take(e.length).map((t=>e.get(t))).every((e=>null!=e&&!isNaN(e))),!0)})),(0,t.t6)("Similarity",(async()=>{const e=await a.functions.call("Bio:sequenceSimilarityScoring",{table:o,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const s=e.get(n),i=o.get(r,n);(0,t.Wj)(s,i,.01,`Wrong similarity score for sequence at position ${n}`)}}))}));const Se=new e.Package;async function _e(n,r,s,o){const i=await(0,t.N$)({category:n,test:r,testContext:s,stressTest:o});return e.DataFrame.fromObjects(i)}async function Pe(){await(0,t.Xb)(Se,Se.getModule("package-test.js"))}})(),bio_test=r})();
|
|
8
8
|
//# sourceMappingURL=package-test.js.map
|