@datagrok/bio 2.22.0 → 2.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/detectors.js +1 -1
- 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 +1 -1
- package/src/analysis/sequence-diversity-viewer.ts +1 -14
- package/src/utils/monomer-lib/library-file-manager/ui.ts +9 -1
- package/test-console-output-1.log +301 -300
- package/test-record-1.mp4 +0 -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:()=>o});var r=n(7
|
|
|
4
4
|
|| ${a} === "boolean" || ${o} === null`).assign(c,i._`[${o}]`)}}r.else(),m(e),r.endIf(),r.if(i._`${c} !== undefined`,(()=>{r.assign(o,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 o=r===c.Correct?i.operators.EQ:i.operators.NEQ;let s;switch(e){case"null":return i._`${t} ${o} null`;case"array":s=i._`Array.isArray(${t})`;break;case"object":s=i._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":s=a(i._`!(${t} % 1) && !isNaN(${t})`);break;case"number":s=a();break;default:return i._`typeof ${t} ${o} ${e}`}return r===c.Correct?s:(0,i.not)(s);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 o;const s=(0,a.toHash)(e);if(s.array&&s.object){const e=i._`typeof ${t} != "object"`;o=s.null?e:i._`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(const e in s)o=(0,i.and)(o,d(e,t,n,r));return o}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,o=(0,a.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:o,schemaValue:o,parentSchema:r,params:{},it:e}}(e);(0,s.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),o=n(4227);function s(e,t,n){const{gen:s,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,o.checkStrictMode)(e,`default is ignored for: ${l}`);let u=r._`${l} === undefined`;"empty"===c.useDefaults&&(u=r._`${u} || ${l} === null || ${l} === ""`),s.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)s(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>s(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),o=n(208),s=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:o},s){o.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,o)}`),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,o),e.code(s)})):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}}={}`}(o)}`,r.$async,(()=>e.code(g(n,o)).code(s)))}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:o}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,o.RULES)&&o.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,o.getSchemaTypes)(e.schema);E(e,n,!(0,o.coerceAndCheckDataType)(e,n),t)}function A({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:o}){const s=n.$comment;if(!0===o.$comment)e.code(u._`${d.default.self}.logger.log(${s})`);else if("function"==typeof o.$comment){const n=u.str`${r}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${d.default.self}.opts.$comment(${s}, ${n}, ${o}.schema)`)}}function E(e,t,n,r){const{gen:o,schema:a,data:c,allErrors:l,opts:h,self:m}=e,{RULES:f}=m;function g(p){(0,s.shouldUseGroup)(a,p)&&(p.type?(o.if((0,i.checkDataType)(p.type,c,h.strictNumbers)),C(e,p),1===t.length&&t[0]===p.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):C(e,p),l||o.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=>{T(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)T(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 o=n[r];if("object"==typeof o&&(0,s.shouldUseRule)(e.schema,o)){const{type:n}=o.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),o.block((()=>{for(const e of f.rules)g(e);g(f.post)}))):o.block((()=>P(e,"$ref",f.all.$ref.definition)))}function C(e,t){const{gen:n,schema:r,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block((()=>{for(const n of t.rules)(0,s.shouldUseRule)(r,n)&&P(e,n.keyword,n.definition,t.type)}))}function T(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:o,opts:s}=e;n.$async?t.if(u._`${d.default.errors} === 0`,(()=>t.return(d.default.data)),(()=>t.throw(u._`new ${o}(${d.default.vErrors})`))):(t.assign(u._`${r}.errors`,d.default.vErrors),s.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",$(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:o,def:s}=this;n.if((0,u.or)(u._`${r} === undefined`,t)),e!==u.nil&&n.assign(e,!0),(o.length||s.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:o}=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,o.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 o={...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:o}=e;o.$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 s=r.const("_errs",d.default.errors);v(e,s),r.var(t,u._`${s} === ${d.default.errors}`)}(e,t):(0,r.boolOrEmptySchema)(e,t)}(o,t),o}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 o=new _(e,n,t);"code"in n?n.code(o,r):o.$data&&n.validate?(0,c.funcKeywordCode)(o,n):"macro"in n?(0,c.macroKeywordCode)(o,n):(n.compile||n.validate)&&(0,c.funcKeywordCode)(o,n)}t.KeywordCxt=_;const M=/^\/(?:[^~]|~0|~1)*$/,N=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function $(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let o,s;if(""===e)return d.default.rootData;if("/"===e[0]){if(!M.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,s=d.default.rootData}else{const i=N.exec(e);if(!i)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+i[1];if(o=i[2],"#"===o){if(a>=t)throw new Error(c("property/index",a));return r[t-a]}if(a>t)throw new Error(c("data",a));if(s=n[t-a],!o)return s}let i=s;const a=o.split("/");for(const e of a)e&&(s=u._`${s}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,i=u._`${i} && ${s}`);return i;function c(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}t.getData=$},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),o=n(2023),s=n(5765),i=n(8708);function a(e){const{gen:t,data:n,it:o}=e;t.if(o.parentData,(()=>t.assign(n,r._`${o.parentData}[${o.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:o,schema:s,parentSchema:i,it:a}=e,l=t.macro.call(a.self,s,i,a),u=c(n,o,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}/${o}`,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?o.default.this:o.default.self,a=!("compile"in t&&!p||!1===t.schema);l.assign(y,r._`${n}${(0,s.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(o.default.vErrors,r._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,r._`${o.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},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");const i=o.dependencies;if(null==i?void 0:i.some((t=>!Object.prototype.hasOwnProperty.call(e,t))))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[s])){const e=`keyword "${s}" value is invalid at path "${r}": `+n.errorsText(o.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),o=n(4227);t.getSubschema=function(e,{keyword:t,schemaProp:n,schema:s,schemaPath:i,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const s=e.schema[t];return void 0===n?{schema:s,schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[n],schemaPath:r._`${e.schemaPath}${(0,r.getProperty)(t)}${(0,r.getProperty)(n)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(n)}`}}if(void 0!==s){if(void 0===i||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:i,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:n,dataPropType:s,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,o.getErrorPath)(n,s,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:o,allErrors:s}){void 0!==r&&(e.compositeRule=r),void 0!==o&&(e.createErrors=o),void 0!==s&&(e.allErrors=s),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 o=n(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const s=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,o,s,i,a,c,l,u,d,h,p,g,y,b,w,v,A,E,C,T,S,_,P;const M=e.strict,N=null===(t=e.code)||void 0===t?void 0:t.optimize,$=!0===N||void 0===N?1:N||0,x=null!==(r=null===(n=e.code)||void 0===n?void 0:n.regExp)&&void 0!==r?r:f,L=null!==(o=e.uriResolver)&&void 0!==o?o:m.default;return{strictSchema:null===(i=null!==(s=e.strictSchema)&&void 0!==s?s:M)||void 0===i||i,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:M)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:M)&&void 0!==u?u:"log",strictTuples:null!==(h=null!==(d=e.strictTuples)&&void 0!==d?d:M)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(p=e.strictRequired)&&void 0!==p?p:M)&&void 0!==g&&g,code:e.code?{...e.code,optimize:$,regExp:x}:{optimize:$,regExp:x},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===(C=e.addUsedSchema)||void 0===C||C,validateSchema:null===(T=e.validateSchema)||void 0===T||T,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 M;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),T.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 o.call(this,e.$schema);const n=this._addSchema(e,t);return n.validate||s.call(this,n)}async function o(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function s(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),s.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 o.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 o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),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=C.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=C.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($.call(this,n,t),!t)return(0,h.eachItem)(n,(e=>x.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=>x.call(this,e,r):e=>r.type.forEach((t=>x.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 o=e;for(const e of t)o=o[e];for(const e in n){const t=n[e];if("object"!=typeof t)continue;const{$data:r}=t.definition,s=o[e];r&&s&&(o[e]=O(s))}}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,o=this.opts.addUsedSchema){let s;const{schemaId:i}=this.opts;if("object"==typeof e)s=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)(s||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),o&&!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 o in e){const s=o;s in t&&this.logger[r](`${n}: option ${o}. ${e[s]}`)}}function C(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function T(){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=s.default,A.MissingRefError=i.default,t.default=A;const M={log(){},warn(){},error(){}},N=/^[a-z_$][a-z0-9_$:-]*$/i;function $(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(!N.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 x(e,t,n){var r;const o=null==t?void 0:t.post;if(n&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let i=o?s.post:s.rules.find((({type:e})=>e===n));if(i||(i={type:n,rules:[]},s.rules.push(i)),s.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),s.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),o=n(7216),s=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,o,s,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,o=0;for(;o<t;)r++,n=e.charCodeAt(o++),n>=55296&&n<=56319&&o<t&&(n=e.charCodeAt(o),56320==(64512&n)&&o++);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),o=n(4227),s={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,o.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function i(e,t){const{gen:n,schema:s,data:i,keyword:a,it:c}=e;c.items=!0;const l=n.const("len",r._`${i}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(r._`${l} <= ${t.length}`);else if("object"==typeof s&&!(0,o.alwaysValidSchema)(c,s)){const s=n.var("valid",r._`${l} <= ${t.length}`);n.if((0,r.not)(s),(()=>function(s){n.forRange("i",t.length,l,(t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},s),c.allErrors||n.if((0,r.not)(s),(()=>n.break()))}))}(s))),e.ok(s)}}t.validateAdditionalItems=i,t.default=s},8660:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s=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})=>o._`{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(o._`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,o.not)(n),(()=>{e.reset(),f(r)}))):(y(r,n),d||t.if((0,o.not)(n),(()=>t.break())))}}}function y(t,n,r){const o={keyword:"additionalProperties",dataProp:t,dataPropType:i.Type.Str};!1===r&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,n)}t.forIn("key",c,(n=>{p.length||m.length?t.if(function(n){let s;if(p.length>8){const e=(0,i.schemaRefOrVal)(u,a.properties,"properties");s=(0,r.isOwnProperty)(t,e,n)}else s=p.length?(0,o.or)(...p.map((e=>o._`${n} === ${e}`))):o.nil;return m.length&&(s=(0,o.or)(s,...m.map((t=>o._`${(0,r.usePattern)(e,t)}.test(${n})`)))),(0,o.not)(s)}(n),(()=>g(n))):g(n)})),e.ok(o._`${l} === ${s.default.errors}`)}};t.default=a},5844:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:n,it:o}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");const s=t.name("valid");n.forEach(((t,n)=>{if((0,r.alwaysValidSchema)(o,t))return;const i=e.subschema({keyword:"allOf",schemaProp:n},s);e.ok(s),e.mergeEvaluated(i)}))}};t.default=o},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),o=n(4227),s={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:s,data:i,it:a}=e;let c,l;const{minContains:u,maxContains:d}=s;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,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.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:o.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=s},3025:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const r=n(9029),o=n(4227),s=n(5765);t.error={message:({params:{property:e,depsCount:t,deps:n}})=>{const o=1===t?"property":"properties";return r.str`must have ${o} ${n} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:n,missingProperty:o}})=>r._`{property: ${e},
|
|
5
5
|
missingProperty: ${o},
|
|
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:o,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,s.propertyInData)(n,o,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,s.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,s.checkMissingProp)(e,l,a)})`),(0,s.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,o.alwaysValidSchema)(a,t[l])||(n.if((0,s.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),o={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,r.validateSchemaDeps)(e)};t.default=o},1239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const a=i(s,"then"),c=i(s,"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,o){return()=>{const s=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(s,l),o?t.assign(o,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,o.alwaysValidSchema)(e,n)}t.default=s},6378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5457),o=n(5354),s=n(494),i=n(3966),a=n(2661),c=n(3025),l=n(2094),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(o.default,i.default):t.push(r.default,s.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),o=n(4227),s=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,o.alwaysValidSchema)(n,t)||e.ok((0,s.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:s,parentSchema:i,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:s}=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 "${s}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(i),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(s,n.length,l.items));const u=s.name("valid"),d=s.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(s.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),o=n(4227),s=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,o.alwaysValidSchema)(r,t)||(a?(0,i.validateAdditionalItems)(e,a):e.ok((0,s.validateArray)(e)))}};t.default=a},7923:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},6163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&s.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,s)=>{let a;(0,o.alwaysValidSchema)(i,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},u),s>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${s}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,s),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=s},5333:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s=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,s.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 o.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,s.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(n){t.forIn("key",a,(s=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${s})`,(()=>{const r=h.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:s,dataPropType:i.Type.Str},m),l.opts.unevaluated&&!0!==f?t.assign(o._`${f}[${s}]`,!0):r||l.allErrors||t.if((0,o.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),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},117:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2586),o=n(5765),s=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,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=s.mergeEvaluated.props(t,(0,s.toHash)(u),l.props));const d=u.filter((e=>!(0,s.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,o.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},2094:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s,it:i}=e;if((0,o.alwaysValidSchema)(i,n))return;const a=t.name("valid");t.forIn("key",s,(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=s},4426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),o={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=o},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),o=n(4227),s=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,o){const s=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(s,(0,r.not)(c(e,t,n))):s}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:s}=e;n.if(l(n,o,t,s.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,s){return(0,r.or)(...o.map((o=>(0,r.and)(l(e,t,o,n.ownProperties),r._`${s} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,n,o){const s=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${s} && ${c(e,t,n)}`:s},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:i,errorPath:a},it:c},l,u,d){const h=d?r._`${e}, ${t}, ${o}${i}`:t,p=[[s.default.instancePath,(0,r.strConcat)(s.default.instancePath,a)],[s.default.parentData,c.parentData],[s.default.parentDataProperty,c.parentDataProperty],[s.default.rootData,s.default.rootData]];c.opts.dynamicRef&&p.push([s.default.dynamicAnchors,s.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 o=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(n,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:r._`${"new RegExp"===s.code?d:(0,i.useFunc)(e,s)}(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:s,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:s,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),i)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:s,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const i=e.subschema({keyword:s,schemaProp:o,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),o=n(3693),s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=s},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(4551),o=n(5765),s=n(9029),i=n(2023),a=n(3835),c=n(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:i,schemaEnv:c,validateName:l,opts:h,self:p}=o,{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,s._`${n}.validate`,m,m.$async)}();const f=a.resolveRef.call(p,m,i,n);if(void 0===f)throw new r.default(o.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 o=t.scopeValue("schema",!0===h.code.source?{ref:r,code:(0,s.stringify)(r)}:{ref:r}),i=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:s.nil,topSchemaRef:o,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}):s._`${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:s.nil;function m(e){const t=s._`${e}.errors`;a.assign(i.default.vErrors,s._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),a.assign(i.default.errors,s._`${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",s._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,s.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",s._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,s.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(s._`await ${(0,o.callValidateCode)(e,t,p)}`),f(t),u||a.assign(n,!0)}),(e=>{a.if(s._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),m(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.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),o=n(7652),s=n(3835),i=n(4551),a=n(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.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 o=t.name("valid"),s=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(s,r.Name),o}t.if(r._`typeof ${m} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(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=s.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),l instanceof s.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||o(l)),c(p,t)}if(!r)throw new Error(`discriminator: "${h}" must be required`);return t;function o({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:o.DiscrError.Mapping,tag:m,tagName:h}),t.endIf()}()),(()=>e.error(!1,{discrError:o.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),o=n(7060),s=n(6378),i=n(5520),a=n(5413),c=n(3265),l=n(7532),u=n(9857),d=[i.default,r.default,o.default,(0,s.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),o=n(7060),s=n(6378),i=n(7532),a=n(9857),c=[r.default,o.default,(0,s.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),o=n(2023),s=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._`${o.default.dynamicAnchors}${(0,r.getProperty)(t)}`,l="#"===a.errSchemaPath?a.validateName:function(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:o,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new s.SchemaEnv({schema:n,schemaId:u,root:o,baseId:a,localRefs:c,meta:l});return s.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),o=n(2023),s=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._`${o.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,s.callRef)(e,t),n.let(r,!0)})):()=>(0,s.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),o=n(3252),s=n(2721),i=n(3799),a=[r.default,o.default,s.default,i.default];t.default=a},2721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2476),o=n(4227),s={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,r.dynamicAnchor)(e,""):(0,o.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};t.default=s},3799:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3252),o={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,r.dynamicRef)(e,e.schema)};t.default=o},4737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o,$data:s,schema:i,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:h}=c;l.validateFormats&&(s?function(){const s=n.scopeValue("formats",{ref:h.formats,code:l.code.formats}),i=n.const("fDef",r._`${s}[${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}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const s=h.formats[i];if(!s)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===s)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,o=n.scopeValue("formats",{key:i,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(s);a===t&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${p}(${o})`}return"function"==typeof c?r._`${p}(${o})`:r._`${p}.test(${o})`}())}())}};t.default=o},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),o=n(4845),s=n(2626),i=[r.default,o.default,s.default];t.default=i},3265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(392),o=n(3445),s=[r.default,o.default];t.default=s},3445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s,it:i}=e,a=i.items||0;if(!0===a)return;const c=t.const("len",r._`${s}.length`);if(!1===n)e.setParams({len:a}),e.fail(r._`${c} > ${a}`);else if("object"==typeof n&&!(0,o.alwaysValidSchema)(i,n)){const n=t.var("valid",r._`${c} <= ${a}`);t.if((0,r.not)(n),(()=>function(n,s){t.forRange("i",s,c,(s=>{e.subschema({keyword:"unevaluatedItems",dataProp:s,dataPropType:o.Type.Num},n),i.allErrors||t.if((0,r.not)(n),(()=>t.break()))}))}(n,a))),e.ok(n)}i.items=!0}};t.default=s},392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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(s){if(!1===n)return e.setParams({unevaluatedProperty:s}),e.error(),void(l||t.break());if(!(0,o.alwaysValidSchema)(c,n)){const n=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:s,dataPropType:o.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 o in e)!0===e[o]&&n.push(r._`${t} !== ${o}`);return(0,r.and)(...n)}(u,e),(()=>d(e))))),c.props=!0,e.ok(r._`${a} === ${s.default.errors}`)}};t.default=i},7935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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,o.useFunc)(t,s.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),o={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:e=>(0,r.validatePropertyDeps)(e)};t.default=o},8643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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,o.useFunc)(t,s.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,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${h()}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=i},7060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5882),o=n(3439),s=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,o.default,s.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),o={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=o},1163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o}=e,s="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${s} ${o}`)}};t.default=o},7307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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,o.useFunc)(e.gen,s.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),o=r.operators,s={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},i={message:({keyword:e,schemaCode:t})=>r.str`must be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${s[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(s),type:"number",schemaType:"number",$data:!0,error:i,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${s[t].fail} ${o} || isNaN(${n})`)}};t.default=a},4486:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o}=e,s="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${s} ${o}`)}};t.default=o},3439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o,it:s}=e,i=s.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._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:s,schemaCode:i,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${i}, ${c}))`:(0,r.usePattern)(e,s);e.fail$data(o._`!${l}.test(${t})`)}};t.default=s},4003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s=n(4227),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{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(o.nil,h);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const s=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,s){e.setParams({missingProperty:n}),t.forOf(n,i,(()=>{t.assign(s,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(s),(()=>{e.error(),t.break()}))}),o.nil)}(s,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,s)),(0,r.reportMissingProp)(e,s),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,s.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),o=n(9029),s=n(4227),i=n(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{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(s,i){const a=t.name("item"),c=(0,r.checkDataTypes)(p,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${s}--;`,(()=>{t.let(a,o._`${n}[${s}]`),t.if(c,o._`continue`),p.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(i,o._`${l}[${a}]`),e.error(),t.assign(h,!1).break()})).code(o._`${l}[${a}] = ${s}`)}))}function f(r,a){const c=(0,s.useFunc)(t,i.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(l)}))))))}e.block$data(h,(function(){const r=t.let("i",o._`${n}.length`),s=t.let("j");e.setParams({i:r,j:s}),t.assign(h,!0),t.if(o._`${r} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?m:f)(r,s)))}),o._`${u} === false`),e.ok(h)}};t.default=a},5488:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),o=n.n(r),s=n(6314),i=n.n(s)()(o());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),o=n.n(r),s=n(6314),i=n.n(s)()(o());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),o=n.n(r),s=n(6314),i=n.n(s)()(o());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 width: unset !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}\n\n.monomer-lib-controls-form .ui-input-root {\n flex-wrap: nowrap !important;\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;IACvB,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;;AAEA;IACI,4BAA4B;AAChC",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 width: unset !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}\n\n.monomer-lib-controls-form .ui-input-root {\n flex-wrap: nowrap !important;\n}"],sourceRoot:""}]);const a=i},6369:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),o=n.n(r),s=n(6314),i=n.n(s)()(o());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),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".scatter_plot_link {\n right: 10px;\n}\n\n.cliffs_div {\n flex-grow: initial!important;\n justify-content: flex-end;\n flex-wrap: wrap;\n}\n\n.cliffs_grid {\n margin: 0!important;\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.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,WAAW;AACf;;AAEA;IACI,4BAA4B;IAC5B,yBAAyB;IACzB,eAAe;AACnB;;AAEA;GACG,mBAAmB;AACtB;;AAEA;IACI,eAAe;IACf,kBAAkB;IAClB,YAAY;AAChB;;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 right: 10px;\n}\n\n.cliffs_div {\n flex-grow: initial!important;\n justify-content: flex-end;\n flex-wrap: wrap;\n}\n\n.cliffs_grid {\n margin: 0!important;\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.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),o=n.n(r),s=n(6314),i=n.n(s)()(o());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 min-width: 220px;\n width: 100%;\n\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,gBAAgB;EAChB,WAAW;;AAEb",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 min-width: 220px;\n width: 100%;\n\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,o,s){"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!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),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)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),s="/*# ".concat(o," */");return[t].concat([s]).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,o,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))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=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;0!=o--;){var i=s[o];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,o,s){for(var i,a,c,l,u,d,h,p,m,f,g,y,b;s>=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=o+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,o+=64,s-=64}return o}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,o=t/536870912|0,s=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]=o>>>24&255,this.buffer[i-7]=o>>>16&255,this.buffer[i-6]=o>>>8&255,this.buffer[i-5]=o>>>0&255,this.buffer[i-4]=s>>>24&255,this.buffer[i-3]=s>>>16&255,this.buffer[i-2]=s>>>8&255,this.buffer[i-1]=s>>>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 o=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 s(e){var t=(new r).update(e),n=t.digest();return t.clean(),n}function i(e,t){var n=new o(e).update(t),r=n.digest();return n.clean(),r}function a(e,t,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");t.reset(),o>1&&t.update(e),n&&t.update(n),t.update(r),t.finish(e),r[0]++}e.HMAC=o,e.hash=s,e.default=s,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 s=new Uint8Array([1]),l=i(t,e),u=new o(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,s),h=0),p[m]=d[h++];return u.clean(),d.fill(0),s.fill(0),p},e.pbkdf2=function(e,t,n,r){for(var s=new o(e),i=s.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,s.reset(),s.update(t),s.update(a),s.finish(l);for(var p=0;p<i;p++)c[p]=l[p];for(p=2;p<=n;p++){s.reset(),s.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 s.clean(),u}}(t);var o=t.default;for(var s in t)o[s]=t[s];"object"==typeof e.exports?e.exports=o:void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},2787:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});const r=new Uint32Array(65536),o=(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,o=t.length,s=1<<n-1;let i=-1,a=0,c=n,l=n;for(;l--;)r[e.charCodeAt(l)]|=1<<l;for(l=0;l<o;l++){let e=r[t.charCodeAt(l)];const n=e|a;e|=(e&i)+i^i,a|=~(e|i),i&=e,a&s&&c++,i&s&&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,o=e.length,s=[],i=[],a=Math.ceil(n/32),c=Math.ceil(o/32);for(let e=0;e<a;e++)i[e]=-1,s[e]=0;let l=0;for(;l<c-1;l++){let a=0,c=-1;const u=32*l,d=Math.min(32,o)+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)],o=i[e/32|0]>>>e&1,l=s[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^o&&(i[e/32|0]^=1<<e),p>>>31^l&&(s[e/32|0]^=1<<e),h=h<<1|o,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,o-h)+h;for(let t=h;t<p;t++)r[e.charCodeAt(t)]|=1<<t;let m=o;for(let e=0;e<n;e++){const n=r[t.charCodeAt(e)],a=i[e/32|0]>>>e&1,c=s[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>>>o-1&1,m-=f>>>o-1&1,p>>>31^a&&(i[e/32|0]^=1<<e),f>>>31^c&&(s[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,o=Array.prototype.slice.call(arguments).slice(1);for(t=0,r=o.length;t<r;t++)if(o[t])for(n in o[t])e[n]=o[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,o=e.size,s={},i=new Float32Array(10*r),a=new Float32Array(3*o);return n=0,e.forEachNode((function(e,t){s[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,o,c,l,u,d){var h=s[o],p=s[c],m=t(e,r,o,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,o){return o.x=t[r],o.y=t[r+1],r+=10,n?n(e,o):o}))},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(),o={},s=0,i=0,a=t.length;s<a;s+=10){if(n){var c=Object.assign({},e.getNodeAttributes(r[i]));c.x=t[s],c.y=t[s+1],c=n(r[i],c),o[r[i]]={x:c.x,y:c.y}}else o[r[i]]={x:t[s],y:t[s+1]};i++}return o},t.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),o=new Worker(r);return t.revokeObjectURL(r),o}},8903:(e,t,n)=>{var r=n(1736),o=n(8153).Fd,s=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=o("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++)s(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 o,s,i,a,c,l,u,d,h,p,m,f,g,y,b,w,v,A,E,C,T,S,_,P=n.length,M=r.length,N=e.adjustSizes,$=e.barnesHutTheta*e.barnesHutTheta,x=[];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,x[0]=-1,x[1]=(O+k)/2,x[2]=(G+D)/2,x[3]=Math.max(k-O,D-G),x[4]=-1,x[5]=-1,x[6]=0,x[7]=0,x[8]=0,o=1,i=0;i<P;i+=t)for(s=0,R=3;;){if(!(x[s+5]>=0)){if(x[s+0]<0){x[s+0]=i;break}if(x[s+5]=9*o,d=x[s+3]/2,x[(h=x[s+5])+0]=-1,x[h+1]=x[s+1]-d,x[h+2]=x[s+2]-d,x[h+3]=d,x[h+4]=h+9,x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,x[(h+=9)+0]=-1,x[h+1]=x[s+1]-d,x[h+2]=x[s+2]+d,x[h+3]=d,x[h+4]=h+9,x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,x[(h+=9)+0]=-1,x[h+1]=x[s+1]+d,x[h+2]=x[s+2]-d,x[h+3]=d,x[h+4]=h+9,x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,x[(h+=9)+0]=-1,x[h+1]=x[s+1]+d,x[h+2]=x[s+2]+d,x[h+3]=d,x[h+4]=x[s+4],x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,o+=4,L=n[x[s+0]+0]<x[s+1]?n[x[s+0]+1]<x[s+2]?x[s+5]:x[s+5]+9:n[x[s+0]+1]<x[s+2]?x[s+5]+18:x[s+5]+27,x[s+6]=n[x[s+0]+6],x[s+7]=n[x[s+0]+0],x[s+8]=n[x[s+0]+1],x[L+0]=x[s+0],x[s+0]=-1,L===(I=n[i+0]<x[s+1]?n[i+1]<x[s+2]?x[s+5]:x[s+5]+9:n[i+1]<x[s+2]?x[s+5]+18:x[s+5]+27)){if(R--){s=L;continue}R=3;break}x[I+0]=i;break}L=n[i+0]<x[s+1]?n[i+1]<x[s+2]?x[s+5]:x[s+5]+9:n[i+1]<x[s+2]?x[s+5]+18:x[s+5]+27,x[s+7]=(x[s+7]*x[s+6]+n[i+0]*n[i+6])/(x[s+6]+n[i+6]),x[s+8]=(x[s+8]*x[s+6]+n[i+1]*n[i+6])/(x[s+6]+n[i+6]),x[s+6]+=n[i+6],s=L}}if(e.barnesHutOptimize){for(f=e.scalingRatio,i=0;i<P;i+=t)for(s=0;;)if(x[s+5]>=0){if(w=Math.pow(n[i+0]-x[s+7],2)+Math.pow(n[i+1]-x[s+8],2),4*(p=x[s+3])*p/w<$){if(g=n[i+0]-x[s+7],y=n[i+1]-x[s+8],!0===N?w>0?(v=f*n[i+6]*x[s+6]/w,n[i+2]+=g*v,n[i+3]+=y*v):w<0&&(v=-f*n[i+6]*x[s+6]/Math.sqrt(w),n[i+2]+=g*v,n[i+3]+=y*v):w>0&&(v=f*n[i+6]*x[s+6]/w,n[i+2]+=g*v,n[i+3]+=y*v),(s=x[s+4])<0)break;continue}s=x[s+5]}else if((l=x[s+0])>=0&&l!==i&&(w=(g=n[i+0]-n[l+0])*g+(y=n[i+1]-n[l+1])*y,!0===N?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)),(s=x[s+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===N?(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<M;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===N?(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===N)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])),C=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,T=.1*Math.log(1+C)/(1+Math.sqrt(E)),S=n[i+0]+n[i+2]*(T/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(T/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])),C=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,T=n[i+7]*Math.log(1+C)/(1+Math.sqrt(E)),n[i+7]=Math.min(1,Math.sqrt(T*(Math.pow(n[i+2],2)+Math.pow(n[i+3],2))/(1+Math.sqrt(E)))),S=n[i+0]+n[i+2]*(T/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(T/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 o=function(t){return r(t[e])},s=function(){return r(void 0)};return"string"==typeof e?(n.fromAttributes=o,n.fromGraph=function(e,t){return o(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return o(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 o=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),o[0],o[1],t.getNodeAttributes(o[0]),t.getNodeAttributes(o[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,o,s,i,a,c){return r(e(t,n,o,s,i,a,c))},n.fromPartialEntry=function(t,n,o,s){return r(e(t,n,o,s))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=s,n.fromGraph=s,n.fromEntry=s,n.fromMinimalEntry=s),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 o(e,t,n){return o=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 o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return n&&r(s,n.prototype),s},o.apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(s=e,-1===Function.toString.call(s).indexOf("[native code]")))return e;var s;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 o(e,arguments,n(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)},s(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 o=e._nodes.get(t),s=null;return o?s="mixed"===r?o.out&&o.out[n]||o.undirected&&o.undirected[n]:"directed"===r?o.out&&o.out[n]:o.undirected&&o.undirected[n]:s}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 o(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}N(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&N(e,"error",t,{once:!0})}(e,o)}))},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 C(e,t,n,r){var o,s,i,a;if(A(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),i=s[t]),void 0===i)i=s[t]=n,++e._eventsCount;else if("function"==typeof i?i=s[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=E(e))>0&&i.length>o&&!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 T(){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},o=T.bind(r);return o.listener=n,r.wrapFn=o,o}function _(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]: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}(o):M(o,o.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 M(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function N(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 o(s){r.once&&e.removeEventListener(t,o),n(s)}))}}function $(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,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var a=o[e];if(void 0===a)return!1;if("function"==typeof a)y(a,this,t);else{var c=a.length,l=M(a,c);for(n=0;n<c;++n)y(l[n],this,t)}return!0},w.prototype.addListener=function(e,t){return C(this,e,t,!1)},w.prototype.on=w.prototype.addListener,w.prototype.prependListener=function(e,t){return C(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,o,s,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(o=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){i=n[s].listener,o=s;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),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 o,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(o=s[r])&&this.removeAllListeners(o);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&&($.prototype[Symbol.iterator]=function(){return this}),$.of=function(){var e=arguments,t=e.length,n=0;return new $((function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}}))},$.empty=function(){return new $((function(){return{done:!0}}))},$.fromSequence=function(e){var t=0,n=e.length;return new $((function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}}))},$.is=function(e){return e instanceof $||"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=x,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,o=r!==1/0?new Array(r):[],s=0,i=D(e);;){if(s===r)return o;if((n=i.next()).done)return s!==t&&(o.length=s),o;o[s++]=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}(s(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,o){this.key=t,this.attributes=o,this.undirected=e,this.source=n,this.target=r}function q(e,t,n,r,o,s,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=o,u=s}else if(3===n){if(o=""+o,!(c=e._edges.get(o)))throw new U("Graph.".concat(t,': could not find the "').concat(o,'" 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(o,'" edge (').concat(d,", ").concat(h,")."));a=c.source}l=s,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=o,u=s}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 o=this.source[e],s=o[r];if(void 0===s)return o[r]=this,void(this.undirected&&n===r||(this.target[t][n]=this));s.previous=this,this.next=s,o[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o,s){var i=q(this,t,n,e,r,o,s),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,o,s){var i=q(this,t,n,e,r,o,s),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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],c=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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 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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(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]}}},{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 o=""+e,s=""+arguments[1];if(!(r=c(this,o,s,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}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 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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return o.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,o){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>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],o=arguments[3],!(s=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,!(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]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,o){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>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],o=arguments[3],!(s=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,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof o)throw new V("Graph.".concat(t,": updater should be a function."));return s.attributes[r]=o(s.attributes[r]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return delete o.attributes[r],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=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 o.attributes=r,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=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(o.attributes,r),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:r}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=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 o.attributes=r(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}}],X=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 o=!1;for(var s in t)if(s!==r){var i=t[s];if(o=n(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key}}function ne(e,t,n,r){var o,s,i,a=!1;for(var c in t)if(c!==r){o=t[c];do{if(s=o.source,i=o.target,a=n(o.key,o.attributes,s.key,i.key,s.attributes,i.attributes,o.undirected),e&&a)return o.key;o=o.next}while(void 0!==o)}}function re(e,t){var n,r=Object.keys(e),o=r.length,s=0;return new x((function(){do{if(n)n=n.next;else{if(s>=o)return{done:!0};var i=r[s++];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 oe(e,t,n,r){var o=t[n];if(o){var s=o.source,i=o.target;return r(o.key,o.attributes,s.key,i.key,s.attributes,i.attributes,o.undirected)&&e?o.key:void 0}}function se(e,t,n,r){var o=t[n];if(o){var s=!1;do{if(s=r(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&s)return o.key;o=o.next}while(void 0!==o)}}function ie(e,t){var n=e[t];return void 0!==n.next?new x((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}})):x.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 o,s,i="mixed"!==n&&n!==t.type,a="undirected"===n,c=!1,l=t._edges.values();!0!==(o=l.next()).done;)if(s=o.value,!i||s.undirected===a){var u=s,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,s.undirected),e&&c)return d}}function ce(e,t,n,r,o,s){var i,a=t?ne:te;if("undirected"!==n){if("out"!==r&&(i=a(e,o.in,s),e&&i))return i;if("in"!==r&&(i=a(e,o.out,s,r?void 0:o.key),e&&i))return i}if("directed"!==n&&(i=a(e,o.undirected,s),e&&i))return i}function le(e,t,n,r,o,s,i){var a,c=n?se:oe;if("undirected"!==t){if(void 0!==o.in&&"out"!==r&&(a=c(e,o.in,s,i),e&&a))return a;if(void 0!==o.out&&"in"!==r&&(r||o.key!==s)&&(a=c(e,o.out,s,i),e&&a))return a}if("directed"!==t&&void 0!==o.undirected&&(a=c(e,o.undirected,s,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,o){for(var s in r){var i=r[s],a=i.source,c=i.target,l=a===n?c:a;if(!t||!t.has(l.key)){var u=o(l.key,l.attributes);if(e&&u)return l.key}}}function pe(e,t,n,r,o){if("mixed"!==t){if("undirected"===t)return he(e,null,r,r.undirected,o);if("string"==typeof n)return he(e,null,r,r[n],o)}var s,i=new de;if("undirected"!==t){if("out"!==n){if(s=he(e,null,r,r.in,o),e&&s)return s;i.wrap(r.in)}if("in"!==n){if(s=he(e,i,r,r.out,o),e&&s)return s;i.wrap(r.out)}}if("directed"!==t&&(s=he(e,i,r,r.undirected,o),e&&s))return s}function me(e,t,n){var r=Object.keys(n),o=r.length,s=0;return new x((function(){var i=null;do{if(s>=o)return e&&e.wrap(n),{done:!0};var a=n[r[s++]],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,o){for(var s,i,a,c,l,u,d,h=r._nodes.values(),p=r.type;!0!==(s=h.next()).done;){var m=!1;if(i=s.value,"undirected"!==p)for(a in c=i.out){l=c[a];do{if(u=l.target,m=!0,d=o(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=o(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=o(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 Ce(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 Te(e,t,n,r,o,s,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(s=""+s,i=""+i,a=a||{},!e.allowSelfLoops&&s===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var c=e._nodes.get(s),u=e._nodes.get(i);if(!c)throw new U("Graph.".concat(t,': source node "').concat(s,'" not found.'));if(!u)throw new U("Graph.".concat(t,': target node "').concat(i,'" not found.'));var d={key:null,undirected:r,source:s,target:i,attributes:a};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new Y("Graph.".concat(t,': the "').concat(o,'" 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(s,'" 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,o,c,u,a);e._edges.set(o,h);var p=s===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=o,e.emit("edgeAdded",d),o}function Se(e,t,n,r,o,s,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(s=""+s,i=""+i,u&&(d=c,c=void 0),!e.allowSelfLoops&&s===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var h,p,m=e._nodes.get(s),f=e._nodes.get(i);if(!n&&(h=e._edges.get(o))){if(!(h.source.key===s&&h.target.key===i||r&&h.source.key===i&&h.target.key===s))throw new Y("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(o,'" edge with "').concat(s,'" 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:s,target:i,attributes:c};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new Y("Graph.".concat(t,': the "').concat(o,'" edge already exists in the graph.'));var w=!1,v=!1;m||(m=Ce(e,s,{}),w=!0,s===i&&(f=m,v=!0)),f||(f=Ce(e,i,{}),v=!0),h=new K(r,o,m,f,c),e._edges.set(o,h);var A=s===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=o,e.emit("edgeAdded",b),[o,!0,w,v]}function _e(e,t){e._edges.delete(t.key);var n=t.source,r=t.target,o=t.attributes,s=t.undirected,i=n===r;s?(n.undirectedDegree--,r.undirectedDegree--,i&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,i&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:o,source:n.key,target:r.key,undirected:s})}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 o="geid_"+we()+"_",s=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=o+s++}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 o=r.prototype;return o._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},o.hasNode=function(e){return this._nodes.has(""+e)},o.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 o=this._nodes.get(e);return!!o&&o.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."))},o.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 o=this._nodes.get(e);return!!o&&o.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."))},o.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."))},o.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}},o.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}},o.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},o.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)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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]},o.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,o=n.target.key;if(e===r)return o;if(e===o)return r;throw new U('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(o,")."))},o.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},o.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},o.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},o.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},o.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},o.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])},o.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 o=t?t({}):{};return n=new this.NodeDataClass(e,o),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:o}),[e,!0]},o.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 o in n.in){t=n.in[o];do{_e(this,t),t=t.next}while(t)}}if("directed"!==this.type)for(var s in n.undirected){t=n.undirected[s];do{_e(this,t),t=t.next}while(t)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},o.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},o.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},o.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},o.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},o.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")},o.getAttribute=function(e){return this._attributes[e]},o.getAttributes=function(){return this._attributes},o.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},o.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},o.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},o.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},o.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},o.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},o.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},o.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,o=this._nodes.values();!0!==(n=o.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},o.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,o,s,i=this._edges.values();!0!==(n=i.next()).done;)o=(r=n.value).source,s=r.target,r.attributes=e(r.key,r.attributes,o.key,s.key,o.attributes,s.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},o.forEachAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntry: expecting a callback.");fe(!1,!1,!1,this,e)},o.forEachAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!1,!0,this,e)},o.forEachAssymetricAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");fe(!1,!0,!1,this,e)},o.forEachAssymetricAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!0,!0,this,e)},o.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):H(this._nodes.keys(),this._nodes.size)},o.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)},o.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},o.mapNodes=function(e){if("function"!=typeof e)throw new V("Graph.mapNode: expecting a callback.");for(var t,n,r=this._nodes.values(),o=new Array(this.order),s=0;!0!==(t=r.next()).done;)n=t.value,o[s++]=e(n.key,n.attributes);return o},o.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},o.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},o.filterNodes=function(e){if("function"!=typeof e)throw new V("Graph.filterNodes: expecting a callback.");for(var t,n,r=this._nodes.values(),o=[];!0!==(t=r.next()).done;)e((n=t.value).key,n.attributes)&&o.push(n.key);return o},o.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,o=t,s=this._nodes.values();!0!==(n=s.next()).done;)o=e(o,(r=n.value).key,r.attributes);return o},o.nodeEntries=function(){var e=this._nodes.values();return new x((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},o.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,o){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,o,t)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}},o.import=function(e){var t,n,o,s,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,o,s,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(o=e.nodes,!Array.isArray(o))throw new V("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=o.length;t<n;t++){ge(s=o[t]);var u=s,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),o=e.edges,!Array.isArray(o))throw new V("Graph.import: invalid edges. Expecting an array.");for(t=0,n=o.length;t<n;t++){ye(i=o[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},o.nullCopy=function(e){var t=new r(a({},this._options,e));return t.replaceAttributes(a({},this.getAttributes())),t},o.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},o.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),o=this._edges.values();!0!==(t=o.next()).done;)Te(r,"copy",!1,(n=t.value).undirected,n.key,n.source.key,n.target.key,a({},n.attributes));return r},o.toJSON=function(){return this.export()},o.toString=function(){return"[object Graph]"},o.inspect=function(){var t=this,n={};this._nodes.forEach((function(e,t){n[t]=e.attributes}));var r={},o={};this._edges.forEach((function(e,n){var s,i=e.undirected?"--":"->",a="",c=e.source.key,l=e.target.key;e.undirected&&c>l&&(s=c,c=l,l=s);var u="(".concat(c,")").concat(i,"(").concat(l,")");n.startsWith("geid_")?t.multi&&(void 0===o[u]?o[u]=0:o[u]++,a+="".concat(o[u],". ")):a+="[".concat(n,"]: "),r[a+=u]=e.attributes}));var s={};for(var i in this)this.hasOwnProperty(i)&&!Ae.has(i)&&"function"!=typeof this[i]&&"symbol"!==e(i)&&(s[i]=this[i]);return s.attributes=this._attributes,s.nodes=n,s.edges=r,d(s,"constructor",this.constructor),s},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?Te:Se;e.generateKey?Pe.prototype[n]=function(o,s,i){return r(this,n,!0,"undirected"===(e.type||this.type),null,o,s,i,"update"===t)}:Pe.prototype[n]=function(o,s,i,a){return r(this,n,!1,"undirected"===(e.type||this.type),o,s,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,o=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,o="undirected"===t?e.undirectedSize:e.directedSize,s=new Array(o),i="undirected"===t,a=e._edges.values(),c=0;!0!==(n=a.next()).done;)(r=n.value).undirected===i&&(s[c++]=r.key);return s}(this,r);if(1===arguments.length){e=""+e;var s=this._nodes.get(e);if(void 0===s)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n,r){var o=[];return ce(!1,e,t,n,r,(function(e){o.push(e)})),o}(this.multi,"mixed"===r?this.type:r,o,s)}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,o){var s=[];return le(!1,e,t,n,r,o,(function(e){s.push(e)})),s}(r,this.multi,o,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,o=t.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=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(s,': could not find the "').concat(e,'" node in the graph.'));return ce(!1,this.multi,"mixed"===r?this.type:r,o,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(s,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(s,': could not find the "').concat(t,'" target node in the graph.'));return le(!1,r,this.multi,o,a,t,n)}throw new V("Graph.".concat(s,": 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 o=0;"directed"!==r&&(o+=this.undirectedSize),"undirected"!==r&&(o+=this.directedSize),e=new Array(o);var i=0;t.push((function(t,r,o,s,a,c,l){e[i++]=n(t,r,o,s,a,c,l)}))}else e=[],t.push((function(t,r,o,s,i,a,c){e.push(n(t,r,o,s,i,a,c))}));return this[s].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,o,s,i,a,c){t(e,r,o,s,i,a,c)&&n.push(e)})),this[s].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,o,s,i,a,c){r=e(r,t,n,o,s,i,a,c)})),this[s].apply(this,n),r}}(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=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(s,': could not find the "').concat(e,'" node in the graph.'));return ce(!0,this.multi,"mixed"===r?this.type:r,o,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(s,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(s,': could not find the "').concat(t,'" target node in the graph.'));return le(!0,r,this.multi,o,a,t,n)}throw new V("Graph.".concat(s,": 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,o,s,i,a){return t(e,n,r,o,s,i,a)})),!!this[s].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,o,s,i,a){return!t(e,n,r,o,s,i,a)})),!this[s].apply(this,e)}}(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return x.empty();if(!arguments.length)return function(e,t){if(0===e.size)return x.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,o=e._edges.values();return new x((function(){for(var e,t;;){if((e=o.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(s,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){var r=x.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,o,n)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new U("Graph.".concat(s,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(s,': could not find the "').concat(t,'" target node in the graph.'));return function(e,t,n,r){var o=x.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(o=J(o,ie(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(t||n.key!==r)&&(o=J(o,ie(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(o=J(o,ie(n.undirected,r))),o}(r,o,i,t)}throw new V("Graph.".concat(s,": 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,o=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,o,t)}})(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=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(s,': could not find the "').concat(e,'" node in the graph.'));pe(!1,"mixed"===r?this.type:r,o,n,t)}};var i="map"+n[0].toUpperCase()+n.slice(1);e.prototype[i]=function(e,t){var n=[];return this[s](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[s](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[s](e,(function(e,n){r=t(r,e,n)})),r}}(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s=n[0].toUpperCase()+n.slice(1,-1),i="find"+s;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,o,n,t)}};var a="some"+s;e.prototype[a]=function(e,t){return!!this[i](e,t)};var c="every"+s;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,o=t.direction,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return x.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new U("Graph.".concat(s,': 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=x.empty(),o=new de;return"undirected"!==e&&("out"!==t&&(r=J(r,me(o,n,n.in))),"in"!==t&&(r=J(r,me(o,n,n.out)))),"directed"!==e&&(r=J(r,me(o,n,n.undirected))),r}("mixed"===r?this.type:r,o,t)}}(e,t)}))}(Pe);var Me=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),Ne=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),$e=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),xe=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),o=new e(r);return o.import(t),o}}return Ie(Pe),Ie(Me),Ie(Ne),Ie($e),Ie(xe),Ie(Le),Pe.Graph=Pe,Pe.DirectedGraph=Me,Pe.UndirectedGraph=Ne,Pe.MultiGraph=$e,Pe.MultiDirectedGraph=xe,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,o=e.length,s=t.length,i=Math.floor(Math.max(o,s)/2)-1,a=new Array(o),c=new Array(s),l=0;l<o;l++)for(var u=Math.max(0,l-i);u<=Math.min(s,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<o;l++)if(a[l]){for(;!c[h];)h++;e.charAt(l)!==t.charAt(h++)&&d++}return(r/o+r/s+(r-(d/=2))/r)/3}(e,t,n),o=0;if(r>.7){for(var s=Math.min(e.length,t.length),i=0;e[i]===t[i]&&i<4&&i<s;)++o,i++;r+=.1*o*(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,o,s,i,a,c,l,u,d){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in r(s,i,a,c,l,u,d),s){var p=s[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var m=0;m<p.length;m++)n(e,r,o,p[m],i+"/"+h+"/"+m,a,i,h,s,m)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var f in p)n(e,r,o,p[f],i+"/"+h+"/"+f.replace(/~/g,"~0").replace(/\//g,"~1"),a,i,h,s,f)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&n(e,r,o,p,i+"/"+h,a,i,h,s)}o(s,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 s={},i=[],a=0;a<e.length;a++){var c=e[a],l=r.base?c[0]+r.base:c[0],u=s[l]||0,d="".concat(l," ").concat(u);s[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=o(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:m,references:1})}i.push(d)}return i}function o(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,o){var s=r(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=r(e,o),l=0;l<s.length;l++){var u=n(s[l]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}s=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 o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),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),o=n(6082),s=n(439);const i=31;async function a(e,t,n=!1,s){const a=t.getSeqHandler(e);let l;s??=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++)s.has(u[e])||s.set(u[e],`${s.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 o=0;o<e.length;o++){let s=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(o);s=l.indexOf("\n",s)+1,s=l.indexOf("\n",s)+1,s=l.indexOf("\n",s)+1;const u=parseInt(l.substring(s,s+3)),d=parseInt(l.substring(s+3,s+6));c+=`M V30 COUNTS ${u} ${d} 0 0 0\n`,c+="M V30 BEGIN ATOM\n";for(let e=0;e<u;e++){s=l.indexOf("\n",s)+1+i,a=l.indexOf(" ",s);const r=l.substring(s,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++){s=l.indexOf("\n",s)+1;const t=parseInt(l.substring(s,s+3).trim()),n=parseInt(l.substring(s+3,s+6).trim());c+=`M V30 ${e+1} ${parseInt(l.substring(s+6,s+9).trim())} ${t} ${n}\n`}c+="M V30 END BOND\n",c+="M V30 END CTAB\n",c+="M END",r[o]=c}return r}(l,s,n);else{l=new Array(e.length);for(let t=0;t<e.length;t++){const e=c(a.getSplitted(t),s,n);l[t]=e}}return o.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 o=0;o<e.length;o++){const i=e.getCanonical(o);i!==s._S&&(r+=n?`M V30 ${o+1} R${t.get(i)} 0.000 0.000 0 0\n`:`M V30 ${o+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}},6723:(e,t,n)=>{"use strict";n.d(t,{_package:()=>je,getMonomerLibHelper:()=>Ke});var r,o,s=n(4328),i=n(7389),a=n(6082);n(684),n(9039),(o=r||(r={})).EUCLIDEAN="EUCLIDEAN",o.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,n(2780),Promise.resolve(),n(934),n(8903),a.SEMTYPE.MOLECULE,a.SEMTYPE.MACROMOLECULE;var C=n(9713);n(6295);var T,S,_,P,M,N,$=n(8774);(_=T||(T={})).none="none",_.bold="bold",_.dashed="dashed",(P=S||(S={})).EUCLIDEAN="EUCLIDEAN",P.MANHATTAN="MANHATTAN",S.EUCLIDEAN,S.MANHATTAN,(N=M||(M={})).HAMMING="Hamming",N.EUCLIDEAN="Euclidean",N.VECTOR_COSINE="Vector Cosine",N.MANHATTAN="Manhattan",N.TANIMOTO="Tanimoto",N.LEVENSTEIN="Levenshtein",N.NEEDLEMAN_WUNSCH="Needlemann-Wunsch",N.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance",N.SOKAL="Sokal",N.COSINE="Cosine",N.ASYMMETRIC="Asymmetric",N.Difference="Difference",N.OneHot="One-Hot",M.HAMMING,M.EUCLIDEAN,M.MANHATTAN,M.VECTOR_COSINE,M.TANIMOTO,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.MONOMER_CHEMICAL_DISTANCE,M.SOKAL,M.COSINE,M.ASYMMETRIC,M.Difference,M.OneHot,M.HAMMING,M.EUCLIDEAN,M.MANHATTAN,M.TANIMOTO,M.SOKAL,M.COSINE,M.ASYMMETRIC,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.MONOMER_CHEMICAL_DISTANCE,M.Difference,M.OneHot,M.VECTOR_COSINE,new Set([M.HAMMING,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.MONOMER_CHEMICAL_DISTANCE,M.OneHot]),new Set([M.HAMMING,M.EUCLIDEAN,M.MANHATTAN,M.MONOMER_CHEMICAL_DISTANCE,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.TANIMOTO,M.COSINE,M.VECTOR_COSINE,M.SOKAL,M.ASYMMETRIC,M.OneHot,M.Difference]),new Set([M.EUCLIDEAN,M.MANHATTAN,M.OneHot,M.Difference,M.VECTOR_COSINE]),new Set([M.EUCLIDEAN,M.MANHATTAN,M.Difference,M.VECTOR_COSINE]),new Set([M.EUCLIDEAN,M.MANHATTAN,M.Difference]),new Set([M.TANIMOTO,M.COSINE,M.SOKAL,M.ASYMMETRIC]);var x=n(1991),L=n.n(x);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(5553),n(6642)),U=n(3599);n(673),n(8312),V.sD,n(4139),new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},a.SemanticValue,D.zS,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(250),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(8115),a.JsViewer,H.b9[H.Hi.FASTA],n(1407),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 o=0;o<this.atomCount;o++){r=this.shiftIdxToXColumn(r);for(const s of[e,t,n])s[o]=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])),o=n.map((e=>t[e+1]));r.forEach(((t,n)=>{const r=parseInt(t.split(/\s+/)[1])-1,s=parseInt(o[n].substring(1));if(e.has(s))throw new Error(`R group ${s} is already in the map`);e.set(s,r)}));const s=this.getRGroupAtomicIndices().filter((t=>!Array.from(e.values()).includes(t)));if(0!==s.length)throw new Error(`Unaccounted R group indices: ${s}`);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 o=t[1];if(e.has(o))throw new Error(`R group ${o} is already in the map`);e.set(o,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 oe{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,o=void 0,s=void 0,i){if(this.biotype=e,this.id=t,this.n=n,this.m=r,this.type=o,this.mt=s,this.smiles=i,!this.id)throw new Error("Invalid arg undefined [id].")}static objCounter=-1;objId=++oe.objCounter;className="WebEditorMonomerDummy";toLog(){return`Helm: ${this.className}<${this.objId}>`}}class se extends oe{backgroundcolor="#FFFFFF";linecolor="#808080";textcolor="#808080";constructor(e){super(e,"*","gap")}}class ie extends oe{backgroundcolor="#808080";linecolor="#000000";textcolor="#000000";constructor(e,t){super(e,t,"ambiguous")}}class ae extends oe{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 oe{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,o,s,i,a){this.id=e,this.m=t,this.n=n,this.na=r,this.type=o,this.mt=s,this.at=i,this.smiles=a}static fromMonomer(e,t,n){let r={};const o=t.symbol,s=t.smiles;if(t.rgroups.length>0)t.rgroups.forEach((e=>{r[e.label]=e.capGroupName}));else{if(!s){if(t.lib)return new ce(e,o);throw new Error("Unexpected missing monomer without .lib")}r=n.getRS(s)}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=e=>{const t=i.canvas(250,250);return s.chem.canvasMol(0,0,250,250,t,e),t},me=new ne.Mi([255,255,255]),fe=new ne.Mi([0,0,0]),ge=.7*(0,re.wQ)(me);class ye{_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));for(const[e,t]of Object.entries(this._monomers))for(const[e,n]of Object.entries(t))n.lib=this}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{je.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),o=(0,ee.Y)(n);let s=this.getMonomer(o,r);if(s&&n==U.o.LINKER&&2!=s.rgroups.length)return null;if(s&&n==U.o.SUGAR&&3!=s.rgroups.length)return null;s||(s=this.addMissingMonomer(o,r));let i=s.wem??null;return i||(r===H._S||"*"==r?i=s.wem=new se(n):n===U.o.NUCLEOTIDE&&"N"===r||n===U.o.AA&&"X"===r||(U.o.CHEM,0)||he.test(r)?i=s.wem=new ie(n,r):s.lib||(i=s.wem=new ae(n,r,this.isEmpty)),i||(i=s.wem=le.fromMonomer(n,s,this))),i}getTooltip(e,t){const n=(0,ee.Y)(e),r=i.div([],{classes:"ui-form ui-tooltip"}),o=this.getWebEditorMonomer(e,t),s=this.getMonomer(n,t);if(s){const e=s.symbol,[t,n,a]=(s.name,o?[o.textcolor,o.backgroundcolor,o.linecolor]:["#202020","#A0A0A0","#202020"]);let c;if(r.append(i.divH([i.div([e],{style:{textWrap:"nowrap",marginLeft:"4px",marginRight:"4px",color:t,backgroundColor:n,borderColor:a,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"}})),c=s.molfile?pe(s.molfile):s.smiles?i.divV([pe(s.smiles),i.divText("from smiles",{style:{fontSize:"smaller"}})]):i.divText("No structure",{style:{margin:"6px"}}),r.append(i.div(c,{style:{display:"flex",flexDirection:"row",justifyContent:"center",margin:"6px"}})),s.symbol!=H._S){let e=s.lib?.source;e?(e.endsWith(".json")&&(e=e.substring(0,e.length-5)),e=e.replace(/_/g," ").replace(/-/g," ").replace(/([a-z])([a-z])([A-Z])/g,"$1$2 $3"),r.append(i.divText(e))):r.append(i.divText("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)]},o=r(n.textcolor),s=new ne.Mi([...o.map((e=>e+1))]),i=(0,re.KE)(s,me)/((0,re.wQ)(s)*(0,re.wQ)(me)),c=r(n.backgroundcolor),l=new ne.Mi([...c.map((e=>e+.01))]);let u;u=(0,re.KE)(l,me)/((0,re.wQ)(l)*(0,re.wQ)(me))<i?c:o;let d=new ne.Mi(u);const h=(0,re.wQ)(d);return h>ge&&(d=(0,re.dC)(fe,d,ge/h)),`rgb(${d[0]}, ${d[1]}, ${d[2]})`}getMonomerColors(e,t){const n="default";let r=n;const o=(0,ee.Y)(e),s=this.getMonomer(o,t);let i;if(s){if(s.meta&&s.meta.colors){const e=s.meta.colors;n in e||(r="default"),i=e[r]}if(!i){const t=ue[e],n=t?.[s.symbol];n&&(i={textColor:a.Color.toHtml(a.Color.getContrastColor(a.Color.fromHtml(n))),lineColor:"#202020",backgroundColor:n})}const t=s.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,o="";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]&&(o+=t[e][n]);n["R"+r]=o,o=""}return n}}var be=n(5488),we={};we.styleTagTransform=v(),we.setAttributes=g(),we.insert=m().bind(null,"head"),we.domAPI=h(),we.insertStyleElement=b(),u()(be.A,we),be.A&&be.A.locals&&be.A.locals;class ve extends ye{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}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{je.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 o=e.duplicateMonomerPreferences[n][r],s=this.duplicateMonomers[n][r].find((e=>e.lib?.source===o));s?this._monomers[n][r]=s: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")}static overrideCounter=0;override(e,t){return new Ae(e,`override: ${++ve.overrideCounter}, ${t}`,this)}}class Ae extends ye{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 Ee=n(9192);class Ce{monomerLib;symbol;polymerType;monomerType;monomerLinks;monomers;error=null;constructor(e,t,n,r,o){this.monomerLib=e,this.symbol=t,this.polymerType=n,this.monomerType=r,this.monomerLinks=o;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,Ee.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 Se=n(7433),_e=n.n(Se),Pe=n(1913),Me=n.n(Pe);class Ne{helmMonomerSchema;validateMonomerSchema;constructor(e){this.helmMonomerSchema=e;const t=new(_e())({allErrors:!0,strictTuples:!1,allowUnionTypes:!0});Me()(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 o of e){const e=o.symbol??o.id??o.name??"#N/A";if(n=this.validateMonomerSchema(o),!n){console.warn(`Bio: Monomer Library File Validator file ${t}, monomer '${e}' violating JSON schema:`,o,"\nError reason: ",JSON.stringify(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 s=`${o.polymerType??""}-${e}`;r.has(s)&&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(s)}return n}}var $e=n(8604);class xe{fileValidator;libHelper;eventManager;logger;filesPromise=Promise.resolve();initializedPromise=Promise.resolve();constructor(e,t,n,r){let o;this.fileValidator=e,this.libHelper=t,this.eventManager=n,this.logger=r;let s=!1;this.initializedPromise=Promise.race([a.delay(1e3),new Promise((e=>o=e))]),this.eventManager.updateValidLibraryFileListRequested$.subscribe((()=>{this.updateValidLibList().then((()=>{})),s||(s=!0,o())})),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 s.dapi.files.readAsText($e.gt),o=JSON.parse(r),i=new Ne(o);return new xe(i,e,t,n)}async addLibraryFile(e,t,n=!0){try{if(await s.dapi.files.exists($e.so+`${t}`))return void s.shell.error(`File ${t} already exists`);await this.validateAgainstHELM(e,t),await s.dapi.files.writeAsText($e.so+`${t}`,e),await this.updateValidLibList(),await s.dapi.files.exists($e.so+`${t}`)?s.shell.info(`Added ${t} HELM library`):s.shell.error(`Failed to add ${t} library`)}catch(e){console.error(e),s.shell.error(`Failed to add ${t} library`)}}async deleteLibraryFile(e){try{await s.dapi.files.delete($e.so+`${e}`),await this.updateValidLibList(),s.shell.info(`Deleted ${e} library`)}catch(t){console.error(t),await s.dapi.files.exists($e.so+`${e}`)?s.shell.error(`Failed to delete ${e} library`):s.shell.warning(`File ${e} already deleted, refresh the list`)}}async loadLibraryFromFile(e,t){let n=[];const r=new a.FileSource(e),o=await r.readAsText(t);n=JSON.parse(o);const s={},i=[];return n.forEach((e=>{const t=e.polymerType,n=e.symbol;i.includes(t)||(s[t]={},i.push(t)),s[t][n]=e})),new ve(s,t)}async loadSetFromFile(e,t,n){let r={};const o=new a.FileSource(t),s=await o.readAsText(n);r=JSON.parse(s);const i=r.description,c=Object.entries(r.placeholders).map((([t,n])=>{const r=t,o=n.polymerType,s=n.monomerType,i=n.set;return new Ce(e,r,o,s,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 s.dapi.files.readAsText($e.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),await 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 ${$e.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 je.logger.debug(`${e}, start`),this.filesPromise=this.filesPromise.then((async()=>{je.logger.debug(`${e}, IN`);const t=[],n=await this.getSetFileListAtLocation();if(!this.setListHasChanged(n))return void je.logger.debug(`${e}, end, not changed`);for(const e of n)e.endsWith(".json")?await s.dapi.files.readAsText($e.Es+`${e}`):t.push(e);const r=n.filter((e=>!t.includes(e)));this.setListHasChanged(r)&&(this.eventManager.changeValidSetPathList(r),this.libHelper.loadMonomerSets(!0)),je.logger.debug(`${e}, OUT`)})),je.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 s.dapi.files.list($e.so).then((e=>e.filter((e=>e.isFile)).map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring($e.so.length)))}async getSetFileListAtLocation(){const e=`${this.toLog()}.getSetFileListAtLocation()`;this.logger.debug(`${e}, start`);const t=await s.dapi.files.list($e.Es).then((e=>e.map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring($e.Es.length)))}}class Le{constructor(){}static _instance;static getInstance(){return Le._instance||(Le._instance=new Le),Le._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,C.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 Ie{logger;_monomerLib=new ve({},"MAIN");_monomerSets=new Te("MAIN",[]);_initialLoadCompleted=!1;get initialLoadCompleted(){return this._initialLoadCompleted}_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(++Ie.objCounter>0)throw new Error("MonomerLibManager MUST be a singleton.");return Ie.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()=>{const e=await xe.create(this,this._eventManager,this.logger);return await e.initializedPromise,e})()),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)()]),o=t.filter((e=>{const t=!r.exclude.includes(e),n=0===r.explicit.length||r.explicit.includes(e);return t&&n}));let s=0;const i=o.length,[a]=await Promise.all([Promise.all(o.map((e=>this.readLibrary($e.so,e).catch((t=>{const n=`Loading monomers from '${e}' error: ${t instanceof Error?t.message:t.toString()}`;return new ve({},e,n)})).finally((()=>{n.update(Math.round(100*++s/i),`Loading monomers ${s}/${i}`)})))))]);this._monomerLib.updateLibs(a,e),this._initialLoadCompleted=!0}catch(e){const t=`Loading monomer libraries error: ${e instanceof Error?e.message:e.toString()}`;s.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 o=n.length,[s]=await Promise.all([Promise.all(n.map((t=>this.readSet($e.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/o),`Loading monomers ${r}/${o}`)})))))]);this._monomerSets.updateSets(s)}catch(e){const t=`Loading monomer sets error: ${e instanceof Error?e.message:e.toString()}`;s.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)($e.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 Ie(je.logger);return e._eventManager=Le.getInstance(),e})()),e}}n(1757);var Re=n(3017),Oe={};Oe.styleTagTransform=v(),Oe.setAttributes=g(),Oe.insert=m().bind(null,"head"),Oe.domAPI=h(),Oe.insertStyleElement=b(),u()(Re.A,Oe),Re.A&&Re.A.locals&&Re.A.locals,n(3151);new $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 ke,Ge=n(857),De={};De.styleTagTransform=v(),De.setAttributes=g(),De.insert=m().bind(null,"head"),De.domAPI=h(),De.insertStyleElement=b(),u()(Ge.A,De),Ge.A&&Ge.A.locals&&Ge.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"}(ke||(ke={})),ke.MONOMER,a.COLUMN_TYPE.STRING,ke.SYMBOL,a.COLUMN_TYPE.STRING,ke.NAME,a.COLUMN_TYPE.STRING,ke.R_GROUPS,a.COLUMN_TYPE.STRING,ke.MONOMER_TYPE,a.COLUMN_TYPE.STRING,ke.POLYMER_TYPE,a.COLUMN_TYPE.STRING,ke.NATURAL_ANALOG,a.COLUMN_TYPE.STRING,ke.AUTHOR,a.COLUMN_TYPE.STRING,ke.CREATE_DATE,a.COLUMN_TYPE.DATE_TIME,ke.ID,a.COLUMN_TYPE.INT,ke.META,a.COLUMN_TYPE.STRING,ke.SOURCE,a.COLUMN_TYPE.STRING;var He,Fe=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(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 Ve{_setBreadcrumbsInViewName(){var e,t;const n=["Home","Demo",...(null!==(e=this._path)&&void 0!==e?e:"").split("/")],r=i.breadcrumbs(n);if(r.onPathClick.subscribe((e=>Fe(this,void 0,void 0,(function*(){const t=e[e.length-1];if(t===r.path[r.path.length-1])return;const n=s.shell.browsePanel.mainTree.getOrCreateGroup("Apps").getOrCreateGroup("Demo");n.currentItem="Demo"===t?n:n.items.find((e=>e.text===t))})))),s.shell.v){if(0!==r.path.length&&"Home"===r.path[0]){const e=i.iconFA("home",(()=>{s.shell.v.close(),s.shell.v=a.View.createByType(a.VIEW_TYPE.HOME)}));e.classList.add("demo-breadcrumbs-home-element"),r.root.firstElementChild.replaceWith(e)}const e=null===(t=s.shell.v.ribbonMenu.root.parentElement)||void 0===t?void 0:t.getElementsByClassName("d4-ribbon-name")[0];e&&(e.textContent="",e.appendChild(r.root))}}constructor(e,t,n=!1,r){var o,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"),(()=>Fe(this,void 0,void 0,(function*(){return yield this._changeStopState()}))),"Play / pause"),this._restartBtn=i.button(i.iconFA("redo"),(()=>Fe(this,void 0,void 0,(function*(){return yield this._restartScript()}))),"Restart"),this._nextStepBtn=i.button(i.iconFA("play"),(()=>Fe(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.DEMO_PATH="apps/Tutorials/Demo",this.name=e,this.description=t,this._isAutomatic=n,this._autoStartFirstStep=null!==(o=null==r?void 0:r.autoStartFirstStep)&&void 0!==o&&o,this._path=null!==(s=null==r?void 0:r.path)&&void 0!==s?s:"",this._progress.max=0,this._progress.value=1,Ve.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"),o=i.div(null===(e=this._steps[t].options)||void 0===e?void 0:e.description,"grok-tutorial-step-description hidden"),s=i.divH([n,r],"grok-tutorial-entry");this._activity.append(s,o)}}_initRoot(){s.shell.windows.showContextPanel=!0,s.shell.windows.showHelp=!1,this._node=s.shell.dockManager.dock(this._root,a.DOCK_TYPE.FILL,s.shell.dockManager.findNode(s.shell.browsePanel.root),this.name),this._node.container.containerElement.classList.add("tutorials-demo-script-container"),this._addHeader(),this._root.append(this._mainHeader),this._addDescription(),this._root.append(this._activity)}_setViewParams(){var e;s.shell.v&&(s.shell.v.name=this.name,s.shell.v.path=`${this.DEMO_PATH}/${(null!==(e=this._path)&&void 0!==e?e:"").replaceAll(" ","-")}`,this._setBreadcrumbsInViewName())}_nextStep(){return Fe(this,void 0,void 0,(function*(){var e,t;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],o=this._activity.getElementsByClassName("grok-tutorial-step-description")[this._currentStep];r.className="grok-icon far fa-spinner-third fa-spin",o.classList.remove("hidden"),o.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{this._setViewParams(),yield this._steps[this._currentStep].func(),this._setViewParams()}catch(e){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){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")}s.shell.v instanceof a.TableView&&(yield s.data.detectSemanticTypes(s.shell.tv.dataFrame))}else this._isAutomatic?this._stopStartBtn.replaceWith(this._restartBtn):this._nextStepBtn.replaceWith(this._restartBtn)}))}_startScript(){return Fe(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 Fe(this,void 0,void 0,(function*(){const r=i.div([],"demo-script-countdown");t.classList.add("hidden");let o=n/1e3;const s=this._createSVGIndicator(o);r.append(s),e.prepend(r);const a=setInterval((()=>{o--,0===o&&(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 Fe(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 Fe(this,void 0,void 0,(function*(){s.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(){s.shell.dockManager.close(this._node),this.cancelScript()}cancelScript(){this._isCancelled=!0,Ve.currentObject=null}step(e,t,n){return this._steps[this.steps.length]={name:e,func:t,options:n},this}start(){return Fe(this,void 0,void 0,(function*(){this._initRoot(),s.shell.v.name===this.name&&(s.shell.v.close(),this._node=s.shell.dockManager.dock(this._root,a.DOCK_TYPE.FILL,s.shell.dockManager.findNode(s.shell.browsePanel.root),this.name)),this._isAutomatic?yield this._startScript():this._autoStartFirstStep&&(yield this._nextStep())}))}}Ve.currentObject=null,function(e){e.X="Embed_X",e.Y="Embed_Y"}(He||(He={})),n(966),n(608),n(1619),n(6869),new class{tooltipHandlerTemp="tooltip-handler.Monomer"},a.GridCellRenderer;class Ue{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 Ye 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 Ue(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,Ee.AP)(e);s.shell.error(t),this.logger.error(t,void 0,n)}}var Be=n(5999),We={};We.styleTagTransform=v(),We.setAttributes=g(),We.insert=m().bind(null,"head"),We.domAPI=h(),We.insertStyleElement=b(),u()(Be.A,We),Be.A&&Be.A.locals&&Be.A.locals,n(6307),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(294),n(330),OCL,n(6956),new Map;new a.LruCache(100),new a.LruCache(100);const je=new Ye;async function Ke(){return await Ie.getInstance()}},8115:(e,t,n)=>{"use strict";n.d(t,{if:()=>l,nI:()=>c});var r=n(4328),o=(n(7389),n(6082)),s=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,o=e.charAt(e.length-1)===t,s=e.replace(new RegExp(`^${n}|${n}$`,"g"),"");return r?o?`${n}${s}${n}`:`${n}${s}${n}|${n}${s}$`:o?`^${s}${n}|${n}${s}${n}`:`^${s}${n}|${n}${s}${n}|${n}${s}$`}(e,n):e,s=o.BitSet.create(t.length);for(let n=0;n<t.length;n++){const o=t.get(n);(o.match(r)||o===e)&&s.set(n,!0,!1)}return s}async function l(e,t,n){t.version!==t.temp["last-invalidated-version"]&&await async function(e,t){const n=o.TaskBarProgressIndicator.create(`Invalidating molfiles for ${e.name}`);try{await(0,s.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=o.Column.string("helm",1).init((t=>e));c.semType=o.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:()=>s});var r=n(4328),o=n(6082);function s(e,t,n,s=[],i=[]){let a=!0,c="";if(e.semType!==o.SEMTYPE.MACROMOLECULE)r.shell.warning(t+" analysis is allowed for Macromolecules semantic type"),a=!1;else{const r=n.getSeqHandler(e),o=r.notation;if(s.length>0&&!s.some((e=>o.toUpperCase()==e.toUpperCase())))c=`${t} + ' analysis is allowed for Macromolecules with notation ${0==s.length?"any notation":`notation${s.length>1?"s":""} ${s.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(6723)},4139:(e,t,n)=>{"use strict";n.d(t,{HX:()=>d,J:()=>l,b9:()=>u,gN:()=>a,uF:()=>s});var r,o,s,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"}(o||(o={})),function(e){e.MONOMER="Monomer",e.MACROMOLECULE_DIFFERENCE="MacromoleculeDifference",e.ACTIVITY="activity",e.ACTIVITY_SCALED="activityScaled"}(s||(s={}));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:()=>o}),n(6082),n(7389);var r=n(4328);async function o(e,t,n,o){const s=t.getSeqHandler(e).convert(n,o);e.dataFrame.columns.add(s);const i=await r.functions.call("Bio:detectMacromolecule",{col:s});return i&&(s.semType=i),await r.data.detectSemanticTypes(e.dataFrame),s}n(1757),n(2003)},6956:(e,t,n)=>{"use strict";n.d(t,{mP:()=>s,pk:()=>o,xe:()=>r});const r="|",o="$",s="H"},8604:(e,t,n)=>{"use strict";n.d(t,{Es:()=>o,G3:()=>i,VV:()=>a,gt:()=>s,so:()=>r});const r="System:AppData/Bio/monomer-libraries/",o="System:AppData/Bio/monomer-sets/",s="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:()=>P});var r=n(4328),o=n(6082),s=n(7389),i=n(8070),a=n(2003),c=n(608),l=n(8152),u=n(966),d=n(4139),h=n(5072),p=n.n(h),m=n(7825),f=n.n(m),g=n(7659),y=n.n(g),b=n(5056),w=n.n(b),v=n(540),A=n.n(v),E=n(1113),C=n.n(E),T=n(6369),S={};S.styleTagTransform=C(),S.setAttributes=w(),S.insert=y().bind(null,"head"),S.domAPI=f(),S.insertStyleElement=A(),p()(T.A,S),T.A&&T.A.locals&&T.A.locals;var _=n(6723);async function P(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(o.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(s.divText(e)))}const p=s.input.choice("Method",{value:e.pepsea.method,items:l.ZY});p.setTooltip("Alignment method");const m=s.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=s.p(`Kalign version: ${d.b9}`,"kalign-version"),g=s.input.float("Gap open",{value:e.pepsea.gapOpen});g.setTooltip("Gap opening penalty at group-to-group alignment");const y=s.input.float("Gap extend",{value:e.pepsea.gapExtend});y.setTooltip("Gap extension penalty to skip the alignment");const b=s.inputs([g,y,m]),w=s.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(s.icons.settings((()=>null)));const v=[p.root.style],A=[m.root.style,f.style];let E,C=h;const T=s.input.column("Sequence",{table:u,value:h,onValueChanged:async e=>{if(!e||e.semType!==o.SEMTYPE.MACROMOLECULE)return P.disabled=!0,await(0,i.cb)(0),void(T.value=C);C=e,P.disabled=!1,E=await N(T.value,u,t,v,A,p,S,g,y,m)},filter:e=>e.semType===o.SEMTYPE.MACROMOLECULE});T.setTooltip("Sequences column to use for alignment");const S=s.input.column("Clusters",{table:u,value:e.clustersCol});S.nullable=!0;const _=s.dialog("MSA").add(T).add(S).add(p).add(b).add(w).add(f).onOK((async()=>{await M(T,u,E,n,a)})),P=_.getButton("OK");if(T.fireChanged(),e.col)return E=await N(e.col,u,t,v,A,p,S,g,y,m),void await M(T,u,E,n,a);_.show()}))}async function M(e,t,n,s,i){let a=null;const c=o.TaskBarProgressIndicator.create("Analyze for MSA ...");try{if(e.fireChanged(),e.value.semType!==o.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),s(a)}catch(e){i(e)}finally{c.close()}}async function N(e,t,n,s,i,h,p,m,f,g){try{if(e.semType!==o.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]){$(s,i,"kalign"),m.value=null,f.value=null,g.value=null;const t=n.getSeqHandler(e),o=t.isFasta()?e:t.convert(a.Hi.FASTA);return async()=>await(0,c.eE)(o,!1,r,p.value)}if((0,u.l)(e,e.name,n,[a.Hi.HELM],[])[0])return $(s,i,"pepsea"),m.value??=d.HX.pepsea.gapOpen,f.value??=d.HX.pepsea.gapExtend,async()=>(0,l.GD)(e,r,h.value,m.value,f.value,p.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 $(s,i,"pepsea"),m.value??=d.HX.pepsea.gapOpen,f.value??=d.HX.pepsea.gapExtend,async()=>(0,l.GD)(t,r,h.value,m.value,f.value,p.value)}return m.value=null,f.value=null,g.value=null,void $(s,i,"kalign")}catch(e){const t=e instanceof Error?e.message:e.toString();r.shell.error(t),_._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),o=n(6082),s=n(1991),i=n.n(s),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:o,type:s,path:i}=Object.assign({path:[]},r.data),a=(r.data.argumentList||[]).map(T);let c;try{const t=i.slice(0,-1).reduce(((e,t)=>e[t]),e),n=i.reduce(((e,t)=>e[t]),e);switch(s){case"GET":c=n;break;case"SET":t[i.slice(-1)[0]]=T(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]=C(e);t.postMessage(Object.assign(Object.assign({},r),{id:o}),i),"RELEASE"===s&&(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 o=new Proxy(n,{get(n,s){if(b(r),s===d)return()=>S(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{g(e),r=!0}));if("then"===s){if(0===t.length)return{then:()=>o};const n=S(e,{type:"GET",path:t.map((e=>e.toString()))}).then(T);return n.then.bind(n)}return w(e,[...t,s])},set(n,o,s){b(r);const[i,a]=C(s);return S(e,{type:"SET",path:[...t,o].map((e=>e.toString())),value:i},a).then(T)},apply(n,o,s){b(r);const i=t[t.length-1];if(i===u)return S(e,{type:"ENDPOINT"}).then(T);if("bind"===i)return w(e,t.slice(0,-1));const[a,c]=A(s);return S(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:a},c).then(T)},construct(n,o){b(r);const[s,i]=A(o);return S(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:s},i).then(T)}});return o}function v(e){return Array.prototype.concat.apply([],e)}function A(e){const t=e.map(C);return[t.map((e=>e[0])),v(t.map((e=>e[1])))]}const E=new WeakMap;function C(e){for(const[t,n]of m)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},E.get(e)||[]]}function T(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 o=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!==o||(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)}))}const _="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0ICQ9U3ltYm9sKCJDb21saW5rLnByb3h5IiksQT1TeW1ib2woIkNvbWxpbmsuZW5kcG9pbnQiKSxSPVN5bWJvbCgiQ29tbGluay5yZWxlYXNlUHJveHkiKSx5PVN5bWJvbCgiQ29tbGluay50aHJvd24iKSxfPWU9PnR5cGVvZiBlPT0ib2JqZWN0IiYmZSE9PW51bGx8fHR5cGVvZiBlPT0iZnVuY3Rpb24iLEw9e2NhbkhhbmRsZTplPT5fKGUpJiZlWyRdLHNlcmlhbGl6ZShlKXtjb25zdHtwb3J0MTpyLHBvcnQyOml9PW5ldyBNZXNzYWdlQ2hhbm5lbDtyZXR1cm4gdyhlLHIpLFtpLFtpXV19LGRlc2VyaWFsaXplKGUpe3JldHVybiBlLnN0YXJ0KCksQyhlKX19LE89e2NhbkhhbmRsZTplPT5fKGUpJiZ5IGluIGUsc2VyaWFsaXplKHt2YWx1ZTplfSl7bGV0IHI7cmV0dXJuIGUgaW5zdGFuY2VvZiBFcnJvcj9yPXtpc0Vycm9yOiEwLHZhbHVlOnttZXNzYWdlOmUubWVzc2FnZSxuYW1lOmUubmFtZSxzdGFjazplLnN0YWNrfX06cj17aXNFcnJvcjohMSx2YWx1ZTplfSxbcixbXV19LGRlc2VyaWFsaXplKGUpe3Rocm93IGUuaXNFcnJvcj9PYmplY3QuYXNzaWduKG5ldyBFcnJvcihlLnZhbHVlLm1lc3NhZ2UpLGUudmFsdWUpOmUudmFsdWV9fSxFPW5ldyBNYXAoW1sicHJveHkiLExdLFsidGhyb3ciLE9dXSk7ZnVuY3Rpb24gdyhlLHI9c2VsZil7ci5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixmdW5jdGlvbiBpKHMpe2lmKCFzfHwhcy5kYXRhKXJldHVybjtjb25zdHtpZDpvLHR5cGU6YSxwYXRoOm59PU9iamVjdC5hc3NpZ24oe3BhdGg6W119LHMuZGF0YSksYz0ocy5kYXRhLmFyZ3VtZW50TGlzdHx8W10pLm1hcChtKTtsZXQgbDt0cnl7Y29uc3QgdT1uLnNsaWNlKDAsLTEpLnJlZHVjZSgoZCxwKT0+ZFtwXSxlKSxmPW4ucmVkdWNlKChkLHApPT5kW3BdLGUpO3N3aXRjaChhKXtjYXNlIkdFVCI6bD1mO2JyZWFrO2Nhc2UiU0VUIjp1W24uc2xpY2UoLTEpWzBdXT1tKHMuZGF0YS52YWx1ZSksbD0hMDticmVhaztjYXNlIkFQUExZIjpsPWYuYXBwbHkodSxjKTticmVhaztjYXNlIkNPTlNUUlVDVCI6e2NvbnN0IGQ9bmV3IGYoLi4uYyk7bD16KGQpfWJyZWFrO2Nhc2UiRU5EUE9JTlQiOntjb25zdHtwb3J0MTpkLHBvcnQyOnB9PW5ldyBNZXNzYWdlQ2hhbm5lbDt3KGUscCksbD1OKGQsW2RdKX1icmVhaztjYXNlIlJFTEVBU0UiOmw9dm9pZCAwO2JyZWFrO2RlZmF1bHQ6cmV0dXJufX1jYXRjaCh1KXtsPXt2YWx1ZTp1LFt5XTowfX1Qcm9taXNlLnJlc29sdmUobCkuY2F0Y2godT0+KHt2YWx1ZTp1LFt5XTowfSkpLnRoZW4odT0+e2NvbnN0W2YsZF09Uyh1KTtyLnBvc3RNZXNzYWdlKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxmKSx7aWQ6b30pLGQpLGE9PT0iUkVMRUFTRSImJihyLnJlbW92ZUV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGkpLE0ocikpfSl9KSxyLnN0YXJ0JiZyLnN0YXJ0KCl9ZnVuY3Rpb24gVChlKXtyZXR1cm4gZS5jb25zdHJ1Y3Rvci5uYW1lPT09Ik1lc3NhZ2VQb3J0In1mdW5jdGlvbiBNKGUpe1QoZSkmJmUuY2xvc2UoKX1mdW5jdGlvbiBDKGUscil7cmV0dXJuIGIoZSxbXSxyKX1mdW5jdGlvbiBoKGUpe2lmKGUpdGhyb3cgbmV3IEVycm9yKCJQcm94eSBoYXMgYmVlbiByZWxlYXNlZCBhbmQgaXMgbm90IHVzZWFibGUiKX1mdW5jdGlvbiBiKGUscj1bXSxpPWZ1bmN0aW9uKCl7fSl7bGV0IHM9ITE7Y29uc3Qgbz1uZXcgUHJveHkoaSx7Z2V0KGEsbil7aWYoaChzKSxuPT09UilyZXR1cm4oKT0+ZyhlLHt0eXBlOiJSRUxFQVNFIixwYXRoOnIubWFwKGM9PmMudG9TdHJpbmcoKSl9KS50aGVuKCgpPT57TShlKSxzPSEwfSk7aWYobj09PSJ0aGVuIil7aWYoci5sZW5ndGg9PT0wKXJldHVybnt0aGVuOigpPT5vfTtjb25zdCBjPWcoZSx7dHlwZToiR0VUIixwYXRoOnIubWFwKGw9PmwudG9TdHJpbmcoKSl9KS50aGVuKG0pO3JldHVybiBjLnRoZW4uYmluZChjKX1yZXR1cm4gYihlLFsuLi5yLG5dKX0sc2V0KGEsbixjKXtoKHMpO2NvbnN0W2wsdV09UyhjKTtyZXR1cm4gZyhlLHt0eXBlOiJTRVQiLHBhdGg6Wy4uLnIsbl0ubWFwKGY9PmYudG9TdHJpbmcoKSksdmFsdWU6bH0sdSkudGhlbihtKX0sYXBwbHkoYSxuLGMpe2gocyk7Y29uc3QgbD1yW3IubGVuZ3RoLTFdO2lmKGw9PT1BKXJldHVybiBnKGUse3R5cGU6IkVORFBPSU5UIn0pLnRoZW4obSk7aWYobD09PSJiaW5kIilyZXR1cm4gYihlLHIuc2xpY2UoMCwtMSkpO2NvbnN0W3UsZl09RihjKTtyZXR1cm4gZyhlLHt0eXBlOiJBUFBMWSIscGF0aDpyLm1hcChkPT5kLnRvU3RyaW5nKCkpLGFyZ3VtZW50TGlzdDp1fSxmKS50aGVuKG0pfSxjb25zdHJ1Y3QoYSxuKXtoKHMpO2NvbnN0W2MsbF09RihuKTtyZXR1cm4gZyhlLHt0eXBlOiJDT05TVFJVQ1QiLHBhdGg6ci5tYXAodT0+dS50b1N0cmluZygpKSxhcmd1bWVudExpc3Q6Y30sbCkudGhlbihtKX19KTtyZXR1cm4gb31mdW5jdGlvbiBEKGUpe3JldHVybiBBcnJheS5wcm90b3R5cGUuY29uY2F0LmFwcGx5KFtdLGUpfWZ1bmN0aW9uIEYoZSl7Y29uc3Qgcj1lLm1hcChTKTtyZXR1cm5bci5tYXAoaT0+aVswXSksRChyLm1hcChpPT5pWzFdKSldfWNvbnN0IFA9bmV3IFdlYWtNYXA7ZnVuY3Rpb24gTihlLHIpe3JldHVybiBQLnNldChlLHIpLGV9ZnVuY3Rpb24geihlKXtyZXR1cm4gT2JqZWN0LmFzc2lnbihlLHtbJF06ITB9KX1mdW5jdGlvbiBTKGUpe2Zvcihjb25zdFtyLGldb2YgRSlpZihpLmNhbkhhbmRsZShlKSl7Y29uc3RbcyxvXT1pLnNlcmlhbGl6ZShlKTtyZXR1cm5be3R5cGU6IkhBTkRMRVIiLG5hbWU6cix2YWx1ZTpzfSxvXX1yZXR1cm5be3R5cGU6IlJBVyIsdmFsdWU6ZX0sUC5nZXQoZSl8fFtdXX1mdW5jdGlvbiBtKGUpe3N3aXRjaChlLnR5cGUpe2Nhc2UiSEFORExFUiI6cmV0dXJuIEUuZ2V0KGUubmFtZSkuZGVzZXJpYWxpemUoZS52YWx1ZSk7Y2FzZSJSQVciOnJldHVybiBlLnZhbHVlfX1mdW5jdGlvbiBnKGUscixpKXtyZXR1cm4gbmV3IFByb21pc2Uocz0+e2NvbnN0IG89VSgpO2UuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24gYShuKXshbi5kYXRhfHwhbi5kYXRhLmlkfHxuLmRhdGEuaWQhPT1vfHwoZS5yZW1vdmVFdmVudExpc3RlbmVyKCJtZXNzYWdlIixhKSxzKG4uZGF0YSkpfSksZS5zdGFydCYmZS5zdGFydCgpLGUucG9zdE1lc3NhZ2UoT2JqZWN0LmFzc2lnbih7aWQ6b30sciksaSl9KX1mdW5jdGlvbiBVKCl7cmV0dXJuIG5ldyBBcnJheSg0KS5maWxsKDApLm1hcCgoKT0+TWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpKk51bWJlci5NQVhfU0FGRV9JTlRFR0VSKS50b1N0cmluZygxNikpLmpvaW4oIi0iKX1jb25zdCBXPWFzeW5jKCk9PldlYkFzc2VtYmx5LnZhbGlkYXRlKG5ldyBVaW50OEFycmF5KFswLDk3LDExNSwxMDksMSwwLDAsMCwxLDUsMSw5NiwwLDEsMTIzLDMsMiwxLDAsMTAsMTAsMSw4LDAsNjUsMCwyNTMsMTUsMjUzLDk4LDExXSkpLGs9ImVhZ2VyIix4PSJsYXp5IixqPXtzc3c6WyJzaW1kIl0sbWluaW1hcDI6WyJzaW1kIl19LHQ9e3Rvb2xzOltdLGNvbmZpZzp7fSxmaWxlczpbXSxiYXNlOnt9LGZzOnt9LGFzeW5jIGluaXQoKXtpZih0LnRvb2xzLmxlbmd0aD09PTApdGhyb3ciRXhwZWN0aW5nIGF0IGxlYXN0IDEgdG9vbC4iO2lmKG5ldyBTZXQodC50b29scy5tYXAocj0+YCR7ci50b29sfS8ke3IucHJvZ3JhbXx8ci50b29sfWApKS5zaXplIT09dC50b29scy5sZW5ndGgpdGhyb3ciRm91bmQgZHVwbGljYXRlIHRvb2xzOyBjYW4gb25seSBoYXZlIGVhY2ggdG9vbC9wcm9ncmFtIGNvbWJpbmF0aW9uIGF0IG1vc3Qgb25jZS4iO2lmKHQuYmFzZT10LnRvb2xzLmZpbmQocj0+ci5yZWluaXQhPT0hMCksIXQuYmFzZSl0aHJvdyJDb3VsZCBub3QgZmluZCBhIHRvb2wgd2l0aCBgcmVpbml0OiBmYWxzZWAgdG8gdXNlIGFzIHRoZSBiYXNlIG1vZHVsZS4gVG8gZml4IHRoaXMgaXNzdWUsIGluY2x1ZGUgdGhlIHRvb2wgYGJhc2UvMS4wLjBgIHdoZW4gaW5pdGlhbGl6aW5nIEFpb2xpLiI7cmV0dXJuIHQuYmFzZS5pc0Jhc2VNb2R1bGU9ITAsYXdhaXQgdGhpcy5fc2V0dXAodC5iYXNlKSxhd2FpdCB0aGlzLl9pbml0TW9kdWxlcygpLHQuX2xvZygiUmVhZHkiKSwhMH0sYXN5bmMgX2luaXRNb2R1bGVzKCl7YXdhaXQgUHJvbWlzZS5hbGwodC50b29scy5tYXAodGhpcy5fc2V0dXApKSxhd2FpdCB0aGlzLl9zZXR1cEZTKCl9LG1vdW50KGU9W10pe2NvbnN0IHI9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyRGF0YX1gLGk9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyTW91bnRlZH1gO2xldCBzPVtdLG89W10sYT1bXTshQXJyYXkuaXNBcnJheShlKSYmIShlIGluc3RhbmNlb2YgRmlsZUxpc3QpJiYoZT1bZV0pLHQuX2xvZyhgTW91bnRpbmcgJHtlLmxlbmd0aH0gZmlsZXNgKTtmb3IobGV0IG4gb2YgZSl7aWYobiBpbnN0YW5jZW9mIEZpbGV8fChuPT1udWxsP3ZvaWQgMDpuLmRhdGEpaW5zdGFuY2VvZiBCbG9iJiZuLm5hbWV8fHR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmbi5uYW1lKXR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmKG4uZGF0YT1uZXcgQmxvYihbbi5kYXRhXSx7dHlwZToidGV4dC9wbGFpbiJ9KSkscy5wdXNoKG4pO2Vsc2UgaWYobi5uYW1lJiZuLnVybClvLnB1c2gobik7ZWxzZSBpZih0eXBlb2Ygbj09InN0cmluZyImJm4uc3RhcnRzV2l0aCgiaHR0cCIpKW49e3VybDpuLG5hbWU6bi5zcGxpdCgiLy8iKS5wb3AoKS5yZXBsYWNlKC9cLy9nLCItIil9LG8ucHVzaChuKTtlbHNlIHRocm93J0Nhbm5vdCBtb3VudCBmaWxlKHMpIHNwZWNpZmllZC4gTXVzdCBiZSBhIEZpbGUsIEJsb2IsIGEgVVJMIHN0cmluZywgb3IgeyBuYW1lOiAiZmlsZS50eHQiLCBkYXRhOiAic3RyaW5nIiB9Lic7YS5wdXNoKG4ubmFtZSl9dHJ5e3QuZnMudW5tb3VudChpKX1jYXRjaHt9Zm9yKGxldCBuIG9mIG8pdC5mcy5jcmVhdGVMYXp5RmlsZShyLG4ubmFtZSxuLnVybCwhMCwhMCk7cmV0dXJuIHQuZmlsZXM9dC5maWxlcy5jb25jYXQocyksdC5iYXNlLm1vZHVsZS5GUy5tb3VudCh0LmJhc2UubW9kdWxlLldPUktFUkZTLHtmaWxlczp0LmZpbGVzLmZpbHRlcihuPT5uIGluc3RhbmNlb2YgRmlsZSksYmxvYnM6dC5maWxlcy5maWx0ZXIobj0+KG49PW51bGw/dm9pZCAwOm4uZGF0YSlpbnN0YW5jZW9mIEJsb2IpfSxpKSxzLm1hcChuPT57Y29uc3QgYz1gJHtpfS8ke24ubmFtZX1gLGw9YCR7cn0vJHtuLm5hbWV9YDt0cnl7dC5mcy51bmxpbmsobCl9Y2F0Y2h7fXQuX2xvZyhgQ3JlYXRpbmcgc3ltbGluazogJHtsfSAtLT4gJHtjfWApLHQuZnMuc3ltbGluayhjLGwpfSksYS5tYXAobj0+YCR7cn0vJHtufWApfSxhc3luYyBleGVjKGUscj1udWxsKXtpZih0Ll9sb2coYEV4ZWN1dGluZyAlYyR7ZX0lYyBhcmdzPSR7cn1gLCJjb2xvcjpkYXJrYmx1ZTsgZm9udC13ZWlnaHQ6Ym9sZCIsIiIpLCFlKXRocm93IkV4cGVjdGluZyBhIGNvbW1hbmQiO2xldCBpPWU7cj09bnVsbCYmKHI9ZS5zcGxpdCgiICIpLGk9ci5zaGlmdCgpKTtjb25zdCBzPXQudG9vbHMuZmluZChhPT57dmFyIGM7bGV0IG49aTtyZXR1cm4oKGM9YT09bnVsbD92b2lkIDA6YS5mZWF0dXJlcyk9PW51bGw/dm9pZCAwOmMuc2ltZCk9PT0hMCYmKG49YCR7bn0tc2ltZGApLGEucHJvZ3JhbT09bn0pO2lmKHM9PW51bGwpdGhyb3dgUHJvZ3JhbSAke2l9IG5vdCBmb3VuZC5gO3Muc3Rkb3V0PSIiLHMuc3RkZXJyPSIiLHMubG9hZGluZz09eCYmKHMubG9hZGluZz1rLGF3YWl0IHRoaXMuX2luaXRNb2R1bGVzKCkpO3RyeXtzLm1vZHVsZS5jYWxsTWFpbihyKX1jYXRjaChhKXtjb25zb2xlLmVycm9yKGEpfXRyeXtzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzFdKSxzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzJdKX1jYXRjaHt9cy5tb2R1bGUuRlMuc3RyZWFtc1sxXT1zLm1vZHVsZS5GUy5vcGVuKCIvZGV2L3N0ZG91dCIsInciKSxzLm1vZHVsZS5GUy5zdHJlYW1zWzJdPXMubW9kdWxlLkZTLm9wZW4oIi9kZXYvc3RkZXJyIiwidyIpO2xldCBvPXtzdGRvdXQ6cy5zdGRvdXQsc3RkZXJyOnMuc3RkZXJyfTtyZXR1cm4gdC5jb25maWcucHJpbnRJbnRlcmxlYXZlZCYmKG89cy5zdGRvdXQpLHMucmVpbml0PT09ITAmJmF3YWl0IHRoaXMucmVpbml0KHMudG9vbCksb30sY2F0KGUpe3JldHVybiB0Ll9maWxlb3AoImNhdCIsZSl9LGxzKGUpe3JldHVybiB0Ll9maWxlb3AoImxzIixlKX0sZG93bmxvYWQoZSl7cmV0dXJuIHQuX2ZpbGVvcCgiZG93bmxvYWQiLGUpfSxwd2QoKXtyZXR1cm4gdC5mcy5jd2QoKX0sY2QoZSl7Zm9yKGxldCByIG9mIHQudG9vbHMpIXIubW9kdWxlfHxyLm1vZHVsZS5GUy5jaGRpcihlKX0sbWtkaXIoZSl7cmV0dXJuIHQuZnMubWtkaXIoZSksITB9LHJlYWQoe3BhdGg6ZSxsZW5ndGg6cixmbGFnOmk9InIiLG9mZnNldDpzPTAscG9zaXRpb246bz0wfSl7Y29uc3QgYT10LmZzLm9wZW4oZSxpKSxuPW5ldyBVaW50OEFycmF5KHIpO3JldHVybiB0LmZzLnJlYWQoYSxuLHMscixvKSx0LmZzLmNsb3NlKGEpLG59LHdyaXRlKHtwYXRoOmUsYnVmZmVyOnIsZmxhZzppPSJ3KyIsb2Zmc2V0OnM9MCxwb3NpdGlvbjpvPTB9KXtjb25zdCBhPXQuZnMub3BlbihlLGkpO3QuZnMud3JpdGUoYSxyLHMsci5sZW5ndGgsbyksdC5mcy5jbG9zZShhKX0sYXN5bmMgcmVpbml0KGUpe2NvbnN0IHI9dC50b29scy5maW5kKHM9PnMudG9vbD09ZSksaT10LmJhc2UubW9kdWxlLkZTLmN3ZCgpO09iamVjdC5hc3NpZ24ocixyLmNvbmZpZyksci5yZWFkeT0hMSxhd2FpdCB0aGlzLmluaXQoKSxyLmlzQmFzZU1vZHVsZSYmdGhpcy5tb3VudCgpLHRoaXMuY2QoaSl9LF9zdGRpblR4dDoiIixfc3RkaW5QdHI6MCxnZXQgc3RkaW4oKXtyZXR1cm4gdC5fc3RkaW5UeHR9LHNldCBzdGRpbihlPSIiKXt0Ll9sb2coYFNldHRpbmcgc3RkaW4gdG8gJWMke2V9JWNgLCJjb2xvcjpkYXJrYmx1ZSIsIiIpLHQuX3N0ZGluVHh0PWUsdC5fc3RkaW5QdHI9MH0sYXN5bmMgX3NldHVwKGUpe2lmKGUucmVhZHkpcmV0dXJuO2lmKHQuX2xvZyhgU2V0dGluZyB1cCAke2UudG9vbH0gKGJhc2UgPSAke2UuaXNCYXNlTW9kdWxlPT09ITB9KS4uLmApLGUuY29uZmlnPU9iamVjdC5hc3NpZ24oe30sZSksZS51cmxQcmVmaXh8fChlLnVybFByZWZpeD1gJHt0LmNvbmZpZy51cmxDRE59LyR7ZS50b29sfS8ke2UudmVyc2lvbn1gKSxlLnByb2dyYW18fChlLnByb2dyYW09ZS50b29sKSxlLmZlYXR1cmVzfHwoZS5mZWF0dXJlcz17fSwoaltlLnByb2dyYW1dfHxbXSkuaW5jbHVkZXMoInNpbWQiKSYmKGF3YWl0IFcoKT8oZS5wcm9ncmFtKz0iLXNpbWQiLGUuZmVhdHVyZXMuc2ltZD0hMCk6dC5fbG9nKGBXZWJBc3NlbWJseSBTSU1EIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhpcyBicm93c2VyOyB3aWxsIGxvYWQgbm9uLVNJTUQgdmVyc2lvbiBvZiAke2UucHJvZ3JhbX0uYCkpKSxlLmlzQmFzZU1vZHVsZSYmKGUubG9hZGluZz1rKSxlLmxvYWRpbmc9PT14KXt0Ll9sb2coYFdpbGwgbGF6eS1sb2FkICR7ZS50b29sfTsgc2tpcHBpbmcgaW5pdGlhbGl6YXRpb24uYCk7cmV0dXJufXNlbGYuaW1wb3J0U2NyaXB0cyhgJHtlLnVybFByZWZpeH0vJHtlLnByb2dyYW19LmpzYCksZS5tb2R1bGU9YXdhaXQgTW9kdWxlKHt0aGlzUHJvZ3JhbTplLnByb2dyYW0sbG9jYXRlRmlsZTooaSxzKT0+YCR7ZS51cmxQcmVmaXh9LyR7aX1gLHN0ZGluOigpPT50Ll9zdGRpblB0cjx0LnN0ZGluLmxlbmd0aD90LnN0ZGluLmNoYXJDb2RlQXQodC5fc3RkaW5QdHIrKyk6KHQuc3RkaW49IiIsbnVsbCkscHJpbnQ6aT0+e3QuY29uZmlnLnByaW50U3RyZWFtP3Bvc3RNZXNzYWdlKHt0eXBlOiJiaW93YXNtIix2YWx1ZTp7c3Rkb3V0Oml9fSk6ZS5zdGRvdXQrPWkrYApgfSxwcmludEVycjppPT57Y29uc3Qgcz10LmNvbmZpZy5wcmludEludGVybGVhdmVkPyJzdGRvdXQiOiJzdGRlcnIiO3QuY29uZmlnLnByaW50U3RyZWFtP3Bvc3RNZXNzYWdlKHt0eXBlOiJiaW93YXNtIix2YWx1ZTp7W3NdOml9fSk6ZVtzXSs9aStgCmB9fSk7Y29uc3Qgcj1lLm1vZHVsZS5GUztlLmlzQmFzZU1vZHVsZT8odC5fbG9nKGBTZXR0aW5nIHVwICR7ZS50b29sfSB3aXRoIGJhc2UgbW9kdWxlIGZpbGVzeXN0ZW0uLi5gKSxyLm1rZGlyKHQuY29uZmlnLmRpclNoYXJlZCw1MTEpLHIubWtkaXIoYCR7dC5jb25maWcuZGlyU2hhcmVkfS8ke3QuY29uZmlnLmRpckRhdGF9YCw1MTEpLHIubWtkaXIoYCR7dC5jb25maWcuZGlyU2hhcmVkfS8ke3QuY29uZmlnLmRpck1vdW50ZWR9YCw1MTEpLHIuY2hkaXIoYCR7dC5jb25maWcuZGlyU2hhcmVkfS8ke3QuY29uZmlnLmRpckRhdGF9YCksdC5mcz1yKToodC5fbG9nKGBTZXR0aW5nIHVwICR7ZS50b29sfSB3aXRoIGZpbGVzeXN0ZW0uLi5gKSxyLm1rZGlyKHQuY29uZmlnLmRpclNoYXJlZCksci5tb3VudChlLm1vZHVsZS5QUk9YWUZTLHtyb290OnQuY29uZmlnLmRpclNoYXJlZCxmczp0LmZzfSx0LmNvbmZpZy5kaXJTaGFyZWQpLHIuY2hkaXIodC5mcy5jd2QoKSkpLGUuc3Rkb3V0PSIiLGUuc3RkZXJyPSIiLGUucmVhZHk9ITB9LGFzeW5jIF9zZXR1cEZTKCl7Y29uc3QgZT10LmZzO2ZvcihsZXQgciBvZiB0LnRvb2xzKXtpZighci5yZWFkeSljb250aW51ZTtjb25zdCBpPXIubW9kdWxlLkZTLHM9YC8ke3IudG9vbH1gLG89YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7c31gOyFpLmFuYWx5emVQYXRoKHMpLmV4aXN0c3x8ZS5hbmFseXplUGF0aChvKS5leGlzdHN8fCh0Ll9sb2coYE1vdW50aW5nICR7c30gb250byAke3QuYmFzZS50b29sfSBmaWxlc3lzdGVtIGF0ICR7b31gKSxlLm1rZGlyKG8pLGUubW91bnQodC5iYXNlLm1vZHVsZS5QUk9YWUZTLHtyb290OnMsZnM6aX0sbykpfX0sX2ZpbGVvcChlLHIpe3QuX2xvZyhgUnVubmluZyAke2V9ICR7cn1gKTtjb25zdCBpPXQuZnMuYW5hbHl6ZVBhdGgocik7aWYoIWkuZXhpc3RzKXJldHVybiB0Ll9sb2coYEZpbGUgJHtyfSBub3QgZm91bmQuYCksITE7c3dpdGNoKGUpe2Nhc2UiY2F0IjpyZXR1cm4gdC5mcy5yZWFkRmlsZShyLHtlbmNvZGluZzoidXRmOCJ9KTtjYXNlImxzIjpyZXR1cm4gdC5mcy5pc0ZpbGUoaS5vYmplY3QubW9kZSk/dC5mcy5zdGF0KHIpOnQuZnMucmVhZGRpcihyKTtjYXNlImRvd25sb2FkIjpjb25zdCBzPW5ldyBCbG9iKFt0aGlzLmNhdChyKV0pO3JldHVybiBVUkwuY3JlYXRlT2JqZWN0VVJMKHMpfXJldHVybiExfSxfbG9nKGUpe2lmKCF0LmNvbmZpZy5kZWJ1ZylyZXR1cm47bGV0IHI9Wy4uLmFyZ3VtZW50c107ci5zaGlmdCgpLGNvbnNvbGUubG9nKGAlY1tXZWJXb3JrZXJdJWMgJHtlfWAsImZvbnQtd2VpZ2h0OmJvbGQiLCIiLC4uLnIpfX07dyh0KX0pKCk7Cg==",P=typeof window<"u"&&window.Blob&&new Blob([atob(_)],{type:"text/javascript;charset=utf-8"});function M(){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 N={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 ${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({},N,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 M;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 x=n(3629);class L{static getAvailableScales(){return Object.entries(this.scales).map((([e,t])=>e))}static getScale(e){return(0,x.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,x.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,x.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,x.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,x.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,s,i,l){let u=e.toList();t&&(u=u.map((e=>I.clean(e).replace(/\-/g,""))));const d=e.length;r??=o.Column.string("Clusters",d).init("0"),r.type!=o.COLUMN_TYPE.STRING&&(r=r.convertTo(o.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 $(["base/1.0.0",{tool:"kalign",version:R.b9,reinit:!0}]),y=o.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!==s?` --gpo ${s}`:""}${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 o=await g.cat(k);if(!o){const e=F(r,1);throw new Error(e)}const c=new a.m(o).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=o.SEMTYPE.MACROMOLECULE,y}function F(e,t){const n=[],r=/^.+ERROR : (.+)$/gm;let o;for(;null!=(o=r.exec(e))&&(void 0===t||n.length<t);)n.push(o[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 o=t[e];return o.length>25&&(o=o.slice(0,25)+"..."),r.divText(`"${o}"${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,ZY:()=>u});var r=n(4328),o=n(6082),s=n(2003),i=n(608),a=n(4139),c=n(6723);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(),f=e.length;u??=o.Column.int("Clusters",f).init(0),u.type!=o.COLUMN_TYPE.STRING&&(u=u.convertTo(o.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 o=g.indexOf(r),s=e.get(t);s&&((b[o]??=[]).push({ID:t.toString(),HELM:s}),(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=o.Column.fromStrings(t,v);return A.meta.units=s.Hi.SEPARATOR,A.setTag(s.gp.separator,a.J.SEPARATOR),A.setTag(s.gp.aligned,"SEQ.MSA"),A.setTag(s.gp.alphabet,s.YI.UN),A.setTag(s.gp.alphabetIsMultichar,"true"),A.semType=o.SEMTYPE.MACROMOLECULE,A}async function p(e,t,n,o,s,i){const a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)},l=`/align?method=${n}&gap_open=${o}&gap_extend=${s}`,u=window.performance.now(),d=await r.dapi.docker.dockerContainers.fetchProxy(e,l,a),h=window.performance.now();c._package.logger.debug(`Bio: requestAlignedObjects() dockerContainers.fetchProxy(), ET: ${h-u} ms`);const p="application/json"===d.headers.get("content-type");if(!d.ok&&p){const e=await d.json(),t=e["pepsea-error"];if(t)throw new Error(`PepSeA error: ${t}`);const n=e["datagrok-error"];if(n)throw new Error(`Datagrok error: ${n}`);throw new Error(d.statusText)}if(!d.ok&&!p){const e=await d.text();throw new Error(`Error: ${e}`)}if(!p){const e=await d.text();throw new Error(`Error: PepSeA expected JSON response, got '${e}'.`)}const m=await d.json();if("pepsea-stderr"in m){const e=m["pepsea-stderr"];i?.warning(e)}return m}},3890:(e,t,n)=>{"use strict";n.d(t,{aS:()=>a,wz:()=>i}),n(6082),n(7389),n(4328);var r=n(1991),o=n.n(r);n(6723);const s=60;function i(e,t,n=s,r="\n"){const o=[];for(let s=0;s<t.length;s++){const i=e.map((e=>e.get(s).toString())).join("|"),c=a(t.getSplitted(s),n);o.push(`>${i}${r}`);for(const e of c)o.push(`${e}${r}`)}return"".concat(...o)}function a(e,t=s){let n=0;const r=e.length,i=[];for(;n<r;){const r=o().count(n).take(Math.min(e.length-n,t)).map((t=>e.getOriginal(t))).toArray(),s=r.map((e=>e.length>1?`[${e}]`:e)).reduce(((e,t)=>e+t),"");i.push(s),n+=r.length}return i}},8754:(e,t,n)=>{"use strict";n.d(t,{V:()=>u});var r=n(4328),o=n(6077),s=n(2003),i=n(8312),a=n(5553),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 o,a;r.isHelm()?o=t:(a=t.name,t.name=`__${a}`,o=r.convert(s.Hi.HELM),o.name=a,e.columns.add(o,!1));try{m=await n.helmToAtomicLevel(o,!0,!0,d)}finally{o!==t&&(e.columns.remove(o.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,o.C4)(e,t,d,h,p)}if(m.molCol){const o=(0,l.qj)(e,t.name);m.molCol.name=o,e.columns.add(m.molCol,!0),await(0,a.Qc)(t,m.molCol,d,h,p,n),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)}function o(e,t,n,r,o){const s=()=>{const o=e.col(t);o&&(o.width=n),r&&(e.props.rowHeight=r)};if(o)return void s();const i=e.onAfterDrawOverlay.subscribe((()=>{i.unsubscribe(),setTimeout((()=>{s()}))}))}n.d(t,{Kd:()=>o,Ku:()=>r}),n(4328),n(6082)},250:(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),o=(n(1757),n(1991),n(1858),n(2003)),s=n(4326);n(8070),n(7602);var i=n(439),a=n(6882);n(6723);var c,l,u,d=n(6307);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===s.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===s.fH.full)for(const[e,t]of Object.entries(this._freqs)){const e=t.plotValue/this.sumPlotValue;this.sumPlotValueForHeight+=e}}calcScreen(e,t,n,o,a,c,l,u,d){const h=o===s.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,o]of m){const n=h*o.plotValue/this.sumPlotValue;o.bounds=new r.Rect((e-t)*u*c,p,l*u,n),p+=n}}render(e,t,n,r,s,c,l){for(const[u,d]of Object.entries(this._freqs))if(u!==i._S){const i=(0,o.zS)(u,l),h=d.bounds,p=h.left;let m=a.S$;c&&(m=c.getMonomerTextColor(s,u)),e.resetTransform(),e.strokeStyle="lightgray",e.lineWidth=1,e.rect(p,h.top,h.width,h.height),e.fillStyle=m,e.textAlign="left",e.font=t;const f=e.measureText(i);e.setTransform(h.width/f.width,0,0,h.height/r,p,h.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.maxMonomerLetters="maxMonomerLetters",e.showPositionLabels="showPositionLabels",e.positionMarginState="positionMarginState",e.positionMargin="positionMargin",e.filterSource="filterSource"}(l||(l={})),s.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,o){let s=0,i=-1;for(;-1!=(i=n.findNext(i,!0));){const e=t.getSplitted(i),n=o.pos,a=n<e.length?e.getCanonical(n):null;null!==a&&a===r&&s++}return s}r.JsViewer},1687:(e,t,n)=>{"use strict";n.d(t,{_i:()=>T,AR:()=>C});var r=n(7389),o=n(6082),s=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(4574),m=n(1757),f=n.n(m),g=n(9124),y=n(9192),b=n(4870),w=n(6723);class v extends p.O{seqHelper;emptyProps=new p.n("",void 0,w._package.logger);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,void 0,w._package.logger)}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),o=this._filterPanel;o.innerText="error",o.classList.add("d4-error"),r.tooltip.bind(o,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.Ku)(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.Ku)(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,o){this.props=e,this.filterId=t,this.dataFrameId=n,this.columnName=r,this.bitset=o}}class C extends p.n{separator;constructor(e,t,n){super(e,!1,n),this.separator=t,this.readOnly=!0}}class T extends o.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=++T.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(o.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(o.debounce(this.bioFilter.onChanged,this.debounceTime).subscribe(this.bioFilterOnChangedDebounced.bind(this))),this.viewSubs.push(s.events.onResetFilterRequest.subscribe(this.grokEventsOnResetFilterRequest.bind(this))),this.viewSubs.push(s.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=o.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())}`:"")),s.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("",void 0,w._package.logger);substructureInput;get type(){return"FastaBioFilter"}constructor(){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{window.setTimeout((()=>{this.props=new p.n(e,void 0,w._package.logger),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 C("",void 0,w._package.logger);substructureInput;separatorInput;colSeparator="";get type(){return"SeparatorBioFilter"}constructor(e){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{this.props=new C(e,this.props.separator,w._package.logger),setTimeout((()=>{this._propsChanging||this.onChanged.next()}))},placeholder:"Substructure"}),this.separatorInput=r.input.string("",{value:this.colSeparator=e,onValueChanged:e=>{const t=e||"";this.props=new C(this.props.substructure,t,w._package.logger),setTimeout((()=>{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 C("",void 0,w._package.logger)}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()}}},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},9713:e=>{"use strict";e.exports=rxjs.operators},7389:e=>{"use strict";e.exports=ui},1991:e=>{"use strict";e.exports=wu},8343:(e,t,n)=>{"use strict";const{normalizeIPv6:r,normalizeIPv4:o,removeDotSegments:s,recomposeAuthority:i,normalizeComponentEncoding:a}=n(4834),c=n(343);function l(e,t,n,r){const o={};return r||(e=p(u(e,n),n),t=p(u(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=s(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=s(t.path||""),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=s(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=s(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}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),o=[],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&&o.push(n.scheme,":");const l=i(n);if(void 0!==l&&("suffix"!==r.reference&&o.push("//"),o.push(l),n.path&&"/"!==n.path.charAt(0)&&o.push("/")),void 0!==n.path){let e=n.path;r.absolutePath||a&&a.absolutePath||(e=s(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),o.push(e)}return void 0!==n.query&&o.push("?",n.query),void 0!==n.fragment&&o.push("#",n.fragment),o.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),s={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(s.scheme=l[1],s.userinfo=l[3],s.host=l[4],s.port=parseInt(l[5],10),s.path=l[6]||"",s.query=l[7],s.fragment=l[8],isNaN(s.port)&&(s.port=l[5]),s.host){const e=o(s.host);if(!1===e.isIPV4){const t=r(e.host);s.host=t.host.toLowerCase(),a=t.isIPV6}else s.host=e.host,a=!0}void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==s.reference&&(s.error=s.error||"URI is not a "+n.reference+" reference.");const e=c[(n.scheme||s.scheme||"").toLowerCase()];if(!(n.unicodeSupport||e&&e.unicodeSupport)&&s.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}(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(i&&void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),i&&void 0!==s.host&&(s.host=unescape(s.host)),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),e&&e.parse&&e.parse(s,n)}else s.error=s.error||"URI can not be parsed.";return s}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}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\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 o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(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:o,serialize:s},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:o,serialize:s},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 o=`${n}:${t.nid||e.nid}`,s=c[o];e.path=void 0,s&&(e=s.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(),o=`${n}:${t.nid||r}`,s=c[o];s&&(e=s.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),o=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function s(e){if(l(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(o)||[],[n]=t;return n?{host:c(n,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function i(e,t=!1){let n="",o=!0;for(const t of e){if(void 0===r[t])return;"0"!==t&&!0===o&&(o=!1),o||(n+=t)}return t&&0===n.length&&(n="0"),n}function a(e){if(l(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let s=!1,a=!1,c=!1;function l(){if(o.length){if(!1===s){const e=i(o);if(void 0===e)return n.error=!0,!1;r.push(e)}o.length=0}return!0}for(let i=0;i<e.length;i++){const u=e[i];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!l())break;s=!0}else o.push(u);else{if(!0===a&&(c=!0),!l())break;if(t++,r.push(":"),t>7){n.error=!0;break}i-1>=0&&":"===e[i-1]&&(a=!0)}}return o.length&&(s?n.zone=o.join(""):c?r.push(o.join("")):r.push(i(o))),n.address=r.join(""),n}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+="%"+t.zone,n+="%25"+t.zone),{host:e,escapedHost:n,isIPV6:!0}}}function c(e,t){let n="",r=!0;const o=e.length;for(let s=0;s<o;s++){const i=e[s];"0"===i&&r?(s+1<=o&&e[s+1]===t||s+1===o)&&(n+=i,r=!1):(r=i===t,n+=i)}return n}function l(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}const u=/^\.\.?\//u,d=/^\/\.(?:\/|$)/u,h=/^\/\.\.(?:\/|$)/u,p=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);const r=s(n);if(r.isIPV4)n=r.host;else{const t=a(r.host);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.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(u))e=e.replace(u,"");else if(e.match(d))e=e.replace(d,"/");else if(e.match(h))e=e.replace(h,"/"),t.pop();else if("."===e||".."===e)e="";else{const n=e.match(p);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:a,stringArrayToHexStripped:i}},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 o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.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 o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].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:()=>_e,initAutoTests:()=>Me,test:()=>Pe,tests:()=>t.CN});var e=n(6082),t=n(8070);(0,t.L1)("_first",(()=>{(0,t.t6)("_first",(async()=>{}))}));var o=n(8924),s=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 s.e,!0),(0,t.E3)(e instanceof i.A,!0)}()})),(0,t.t6)("testPaletteAA",(async()=>{await async function(){const e=o.X.Lesk,n=o.X.RasMol,r=o.X.GrokGroups;(0,t.E3)(e instanceof s.e,!0),(0,t.E3)(n instanceof s.e,!0),(0,t.E3)(r instanceof s.e,!0),(0,t.E3)(e instanceof o.X,!0),(0,t.E3)(n instanceof o.X,!0),(0,t.E3)(r instanceof o.X,!0)}()})),(0,t.t6)("testPalettePtMe",(async()=>{const e=o.X.GrokGroups.get("MeNle"),n=o.X.GrokGroups.get("MeA"),r=o.X.GrokGroups.get("MeG"),s=o.X.GrokGroups.get("MeF"),i=o.X.GrokGroups.get("L"),a=o.X.GrokGroups.get("A"),c=o.X.GrokGroups.get("G"),l=o.X.GrokGroups.get("F");(0,t.E3)(e,i),(0,t.E3)(n,a),(0,t.E3)(r,c),(0,t.E3)(s,l)}))}));var a=n(4328),c=n(2003),l=n(8312);class u{units;aligned;alphabet;alphabetSize;alphabetIsMultichar;separator;constructor(e,t,n,r,o,s){this.units=e,this.aligned=t,this.alphabet=n,this.alphabetSize=r,this.alphabetIsMultichar=o,this.separator=s}}async function d(t,n){const r=(await t()).getCol(n),o=await a.functions.call("Bio:detectMacromolecule",{col:r});if(o&&(r.semType=o),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,o,s,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,s),(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=o.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,o,s,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,o),(0,t.E3)(h.getTag(c.gp.aligned),s),(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,s),(0,t.E3)(m.alphabet,i))}async function f(e,t,n){const r=await e(),o=[];for(const s of r.columns.names())if(s in t){const r=t[s];try{await h(e,s,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}catch(e){const t=e.toString();o.push(`Positive col '${s}' failed: ${t}`)}}else try{await d(e,s)}catch(e){const t=e.toString();o.push(`Negative col '${s}' failed: ${t}`)}if(o.length>0)throw new Error(o.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[o,s]of Object.entries(r))(0,t.t6)(`csvData2-${o}`,(async()=>{const t=(i=o,async()=>{const t=r[i].csv,n=e.DataFrame.fromCsv(t);return await a.data.detectSemanticTypes(n),n});var i;for(const e of s.neg??[])await d(t,e);for(const[e,r]of Object.entries(s.pos??{}))await h(t,e,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}));const o=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"},s={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",fasta_negative_words:"System:AppData/Bio/tests/fasta_negative_words.csv"},i={};function g(e,t=y){return async()=>(e in i||(i[e]=(async()=>await t(s[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=o[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.t6)("samplesFastaNegativeWords",(async()=>{await f(g("fasta_negative_words"),{},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"},o=t=>async()=>{const n=r[t],o=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(o),o};(0,t.t6)("fastaDnaWeak1",(async()=>{await d(o("fastaDnaWeak1"),"colName")})),(0,t.t6)("fastaDnaWeak1LikelyName",(async()=>{await h(o("fastaDnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.DNA,4,!1)})),(0,t.t6)("fastaRnaWeak1",(async()=>{await d(o("fastaRnaWeak1"),"colName")})),(0,t.t6)("fastaRnaWeak1LikelyName",(async()=>{await h(o("fastaRnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.RNA,4,!1)})),(0,t.t6)("fastaPtWeak1",(async()=>{await d(o("fastaPtWeak1"),"colName")})),(0,t.t6)("fastaPtWeak1LikelyName",(async()=>{await h(o("fastaPtWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1)})),(0,t.t6)("fastaUn1",(async()=>{await d(o("fastaUn1"),"colName")})),(0,t.t6)("fastaUn1LikelyName",(async()=>{await d(o("fastaUn1LikelyName"),"seq")})),(0,t.t6)("fastaUn2LikelyName",(async()=>{await d(o("fastaUn2LikelyName"),"protein")})),(0,t.t6)("fastaUnMsa1LikelyName",(async()=>{await d(o("fastaUnMsa1LikelyName"),"seq")}))})),(0,t.L1)("detectorsBenchmark",(()=>{let n,r;async function o(o,i,a,l,u,d){return await async function(o){const h=await(async()=>{const t=function(t,n,r,o,s){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,s)},l=Array(o);for(let e=0;e<o;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 s(n),n})(),p=Date.now(),m=s(h),f=Date.now();(function(e,r){const o=n.getSeqHandler(e);(0,t.E3)(e.semType===r.semType,!0),(0,t.E3)(o.notation===r.notation,!0),(0,t.E3)(o.alphabet===r.alphabet,!0),(0,t.E3)(o.separator===r.separator,!0)})(m,{semType:e.SEMTYPE.MACROMOLECULE,notation:i,alphabet:a,separator:d});const g=f-p;if(g>o){const e=`ET ${g} ms is more than max allowed ${o} ms.`;throw console.error(e),new Error(e)}return console.log(`ET ${g} ms is OK.`),g}(o)}function s(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 o=e.Column.fromStrings("seq",["ACGT","ACGT","ACGT"]);await r.prepare({col:o}).call()})),(0,t.t6)("fastaDnaShorts50Few50",(async()=>{await o(20,c.Hi.FASTA,c.YI.DNA,50,50)})),(0,t.t6)("fastaDnaShorts50Many1E6",(async()=>{await o(20,c.Hi.FASTA,c.YI.DNA,50,1e6)})),(0,t.t6)("fastaDnaLong1e6Few50",(async()=>{await o(20,c.Hi.FASTA,c.YI.DNA,1e6,50)})),(0,t.t6)("separatorDnaShorts50Few50",(async()=>{await o(20,c.Hi.SEPARATOR,c.YI.DNA,50,50,"/")})),(0,t.t6)("separatorDnaShorts50Many1E6",(async()=>{await o(20,c.Hi.SEPARATOR,c.YI.DNA,50,1e6,"/")})),(0,t.t6)("separatorDnaLong1e6Few50",(async()=>{await o(20,c.Hi.SEPARATOR,c.YI.DNA,1e6,50,"/")}))}));var g=n(608),y=n(1619);async function b(n,r){const o=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(o);const s=e.DataFrame.fromCsv(r),i=o.getCol("seq");(0,t.E3)(i.semType,e.SEMTYPE.MACROMOLECULE);const c=s.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,o,s,i,l,u){const d=e.DataFrame.fromCsv(r);await a.data.detectSemanticTypes(d);const h=e.DataFrame.fromCsv(o).getCol("seq"),p=d.getCol("seq");(0,t.E3)(p.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(p.meta.units,s),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 b("seq\nFWRWYVKHP\nYNRWYVKHP\nMWRSWYCKHP","seq\nFWR-WYVKHP\nYNR-WYVKHP\nMWRSWYCKHP")})),(0,t.t6)("isCorrectLong",(async()=>{await b("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 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:8e4,skipReason:"Fails in docker"}),(0,t.t6)("isCorrectHelmLong",(async()=>{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:8e4,skipReason:"Fails in docker"}),(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 w=n(1991),v=n.n(w),A=n(7278),E=n(6718),C=n(6642);async function T(t){const n=await async function(e){return await _e.files.readAsText(e)}(t),r=e.DataFrame.fromCsv(n);return r.name=t.replace(".csv",""),r}async function S(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,(s=o=a.rendererBack)&&void 0!==s.onRendered&&void 0!==s.invalidate&&void 0!==s.awaitRendered?o:null);c&&await c.awaitRendered()}}var o,s}var _=n(4139),P=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)(v().count(0).take(r.length).map((e=>r.getOriginal(e))).toArray(),n)}async function N(e,n){const r=(0,A.qp)(e);console.debug(`Bio: tests: splitters: src=${JSON.stringify(e)}, res=${JSON.stringify(r)} .`),(0,t.J6)(v().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"]],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"]],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"]],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 N(r[0],r[1])})),(0,t.t6)("helm2",(async()=>{await N(o[0],o[1])})),(0,t.t6)("helm3-multichar",(async()=>{await N(s[0],s[1])})),(0,t.t6)("testHelm1",(async()=>{await N(i[0],i[1])})),(0,t.t6)("testHelm2",(async()=>{await N(a[0],a[1])})),(0,t.t6)("testHelm3",(async()=>{await N(c[0],c[1])}))})),(0,t.L1)("splitters",(()=>{let n,r,o;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),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,_.gN);const o=await a.functions.call("Bio:splitToMonomersTopMenu",{table:e,sequence:n});(0,t.E3)(o.columns.names().includes("17"),!0),await a.data.detectSemanticTypes(o);const s=a.shell.addTableView(o);await S(s.grid),(0,t.E3)(s.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"),o=await a.functions.call("Bio:getHelmMonomers",{sequence:r}),s=n.filter((e=>!o.includes(e))),i=o.filter((e=>!n.includes(e)));if(s.length>0||i.length){const e=[];throw s.length>0&&e.push(`Missed monomers ${JSON.stringify(s)}.`),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,E.pj)(),n=(0,P.ub)()})),(0,t.Pl)((async()=>{await(0,P.Eu)(n)})),(0,t.t6)("default",(async()=>{await(0,P.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,o=e.getSummaryObj();for(const e in r)r[e]||delete r[e];for(const e in o)o[e]||delete o[e];if(0==Object.keys(r).length&&0!=Object.keys(o).length)throw new Error("Expected empty monomer lib, actual is not.");if(0!=Object.keys(r).length&&0==Object.keys(o).length)throw new Error("Expected non-empty monomer lib, actual is empty.");try{(0,t.Xk)(o,r),(0,t.Xk)(r,o)}catch(e){throw new Error(`Expected monomer lib ${JSON.stringify(r)} does not match actual ${JSON.stringify(o)}.`)}}(e.getMonomerLib(),$.VV)})),(0,t.t6)("empty",(async()=>{const n=await(0,P.ub)(),r=await e.getFileManager();let o=r.getValidLibraryPaths();0===o.length&&(o=await r.getValidLibraryPathsAsynchronously()),n.exclude=o,n.explicit=[],await(0,P.Eu)(n),await e.loadMonomerLib(!0);const s=e.getMonomerLib().getPolymerTypes();(0,t.E3)(0===s.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(),o=r.getMonomer(n.polymerType,n.symbol);(0,t.E3)(null===o,!0,`Unexpectedly found monomer '${n.symbol}' `);const s=r.override({[n.polymerType]:{[n.symbol]:n}},"test").getMonomer(n.polymerType,n.symbol);s&&(s.lib=void 0),(0,t.Xk)(s,n)}))}));var x=n(7389),L=n(1757),I=n.n(L),R=n(1858),O=n(6873),k=n(5433);async function G(n,r){const o=n(),s=e.DataFrame.fromColumns(o);await a.data.detectSemanticTypes(s);const i=Date.now(),c=(s.columns.byName("MSA"),a.shell.addTableView(s));await S(c.grid),(0,t.E3)(c.grid.dataFrame.id,s.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 G(O.dW,"Long sequences")})),(0,t.t6)("many sequence performance",(async()=>{await G(O.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),o=r.getCol("Sequence"),s=await a.functions.call("Bio:detectMacromolecule",{col:o});s&&(o.semType=s);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await S(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=o.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),o=r.getCol("sequence"),s=await a.functions.call("Bio:detectMacromolecule",{col:o});s&&(o.semType=s);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await S(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=o.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=_.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]),o=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await S(o.grid),(0,t.E3)(o.grid.dataFrame.id,r.id);const s=n.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(s,_.uF.MACROMOLECULE_DIFFERENCE)}()})),(0,t.t6)("afterMsa",(async()=>{await async function(){const r=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA.fasta"),o=(await a.functions.call("Bio:importFasta",{fileContent:r}))[0],s=o.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:s});i&&(s.semType=i);const l=a.shell.addTableView(o);await a.data.detectSemanticTypes(o),console.log("Bio: tests/renderers/afterMsa, table view"),await S(l.grid),(0,t.E3)(l.grid.dataFrame.id,o.id),console.log(`Bio: tests/renderers/afterMsa, src before test semType="${s.semType}", units="${s.meta.units}", cell.renderer="${s.getTag(e.TAGS.CELL_RENDERER)}"`),(0,t.E3)(s.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(s.meta.units,c.Hi.FASTA),(0,t.E3)(s.getTag(c.gp.aligned),"SEQ"),(0,t.E3)(s.getTag(c.gp.alphabet),c.YI.PT),(0,t.E3)(s.getTag(e.TAGS.CELL_RENDERER),"sequence");const u=await(0,y.D)({col:s},n);await S(l.grid),(0,t.E3)(l.grid.dataFrame.id,o.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"),o=e.DataFrame.fromCsv(r),s=o.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:s});i&&(s.semType=i);const l=a.shell.addTableView(o);await a.data.detectSemanticTypes(o);const u=await(0,k.r)(s,n,c.Hi.SEPARATOR,"/");await S(l.grid),(0,t.E3)(l.grid.dataFrame.id,o.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"),o=a.shell.addTableView(r);await S(o.grid),await r.meta.detectSemanticTypes(),await a.data.detectSemanticTypes(r);const s=r.getCol("sequence"),i=n.getSeqHandler(s).convert(c.Hi.HELM);r.columns.add(i),await S(o.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=_.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]);a.shell.addTableView(r),await(0,t.cb)(100);const o=n.getTag(e.TAGS.CELL_RENDERER);if("MacromoleculeDifference"!==o)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 '${o}' instead of correct 'MacromoleculeDifference'.`)}()})),(0,t.t6)("scatterPlotTooltip",(async()=>{await async function(){const n=e.DataFrame.fromCsv(r);n.currentRowIdx=0;const o=a.shell.addTableView(n);await n.meta.detectSemanticTypes(),await a.data.detectSemanticTypes(n);const s=n.plot.scatter({x:"x",y:"y"});o.dockManager.dock(s,e.DOCK_TYPE.RIGHT,null),await Promise.all([(0,t.PE)(s.onAfterDrawScene,(()=>{}),(()=>{s.invalidateCanvas()}),1e3),S(o.grid,500)]);const i=s.root.getBoundingClientRect(),c=s.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=I()(s.root).find("canvas").get()[0];await(0,t.PE)(e.debounce((0,R.fromEvent)(u,"mousemove"),200),(()=>{_e.logger.debug(`Test: event, currentRowIdx=${n.currentRowIdx}`),(0,t.E3)(I()(x.tooltip.root).find("div table.d4-row-tooltip-table tr td canvas").length,1),(0,t.E3)(s.hitTest(c.x,c.y),1)}),(()=>{u.dispatchEvent(l)}),500),await S(o.grid,500)}()}),{skipReason:"GROK-17450"});const r="seq,x,y\nACGGTGTCGT,0,0\nCGGTATCCCT,1,0\nCTCGGCATGC,2,0\n"}));var D=n(6882);(0,t.L1)("renderers: monomerPlacer",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,E.pj)(),r=await(0,P.ub)(),await n.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(r),await n.loadMonomerLib(!0)}));const o={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:190},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(o))(0,t.t6)(`getPosition-${n}`,(async()=>{const t=e.DataFrame.fromCsv(r.csv);await a.data.detectSemanticTypes(t);const n=t.getCol("seq"),o=new D.Jy(null,n,_e.logger,3,(()=>({font:"12px monospace",fontCharWidth:7,separatorWidth:12,monomerToShort:c.zS})));await o.init();const s=r.testList;for(let e=0;e<n.length;++e)o.getCellMonomerLengths(e,1e4);const i=[];for(const[e,t]of v().enumerate(s)){const t={pos:o.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 s=[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,D.Bb)(s,n.x);(0,t.E3)(e,n.tgt)}));const l={mono1:{src:{csv:"seq\nm1/m2/m3/m4/m5/m6/m7/m8/m9\nn1/m2/n3/m4/n5/m6/n7/m8/n9\nm1/n2/m3/n4/m5/n6/m7/n8/m9\n"},tgt:{lengths:[5,31,57,83,109,135,161,187,213,239]}},monoWithGaps:{src:{csv:"seq\nm1/m2/m3/m4/m5/m6//m8/m9\nn1/m2/n3/m4/n5/m6//m8/n9\nm1/n2/m3/n4/m5/n6/m7/n8/m9\n"},tgt:{lengths:[5,31,57,83,109,135,161,187,213,239]}},monoWithGapColumn:{src:{csv:"seq\nm1/m2/m3/m4/m5/m6//m8/m9\nn1/m2/n3/m4/n5/m6//m8/n9\nm1/n2/m3/n4/m5///n8/m9\n"},tgt:{lengths:[5,31,57,83,109,135,161,180,206,232]}}};for(const[n,r]of Object.entries(l))(0,t.t6)(`getCellMonomerLengths-${n}`,(async()=>{const n=e.DataFrame.fromCsv(r.src.csv);await a.data.detectSemanticTypes(n);const o=n.getCol("seq"),s=new D.Jy(null,o,_e.logger,3,(()=>({fontCharWidth:7,font:"12px monospace",separatorWidth:12,monomerToShort:c.zS})));await s.init();const i=s.getCellMonomerLengths(0,1e3)[1];(0,t.J6)(i,r.tgt.lengths)}))})),(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 o={[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}$$$$"},s=new Set(Object.values(c.gp));async function i(t){const n=o[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(o){const s=n.getSeqHandler(o).convert(e,r);return(0,t.E3)(s.meta.units,e),s}}async function d(e,r,o){const a=(await i(e)).getCol("seq"),l=r(a),u=(await i(o)).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(!s.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 H=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 o(e){const o=new H.m(e),s=o.descriptionsArray,i=o.sequencesArray;(0,t.J6)([s,i],[n,r])}(0,t.t6)("testNormalFormatting",(async()=>{o(">description:1\nMDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL\n\n>description:3\nMMELVLKTIIGPIVVGVVLRIVDKWLNKDK\n\n>description:4\nMDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN\n")})),(0,t.t6)("testExtraSpaces",(async()=>{o(">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()=>{o(">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 F=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 o={[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 s;!function(e){e.test1="test1",e.test2="test2"}(s||(s={}));const i={[s.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"},[s.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,s=10){const i=o[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,F.aS)(l,s),d=o[r].tgt;(0,t.J6)(u,d)}async function u(r){const o=e.DataFrame.fromCsv(r.srcCsv),s=o.getCol(r.seqCol);s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA;const i=r.idCols.map((e=>o.getCol(e))),a=n.getSeqHandler(s),l=(0,F.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[s.test1])})),(0,t.t6)("saveAsFastaTest2",(async()=>{u(i[s.test2])}))}));var V=n(4152),U=n(439);const Y=U._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,A.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 o=(0,A.vZ)(r,5,c.J9);(0,t.Xk)(o.freq,{A:4,C:5,G:3,T:6}),(0,t.E3)(o.sameLength,!0)}(r)})),(0,t.t6)("testGetAlphabetSimilarity",(async()=>{await async function(){const e={A:2041,C:3015,G:3015,T:2048,[Y]: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 o=e.DataFrame.fromCsv(r).col("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA;const s=(0,c.SM)(o,n);(0,t.E3)(s 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 o=(0,c.SM)(r,n);(0,t.E3)(o 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 s=(0,c.SM)(r,n);(0,t.E3)(s instanceof o.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 o=(0,c.SM)(r,n);(0,t.E3)(o instanceof V.$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])),o=n.map((e=>(0,c.zS)(e,3)));(0,t.J6)(o,r)}))}));var B=n(250);const W=U._S;function j(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),o=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.MSA");const i=await n.plot.fromType("WebLogo");await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{o.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500,"Layout calculate timeout");const l=i.positions,u=[new B.Ue(0,"1",{A:new B.Tc(2),[W]:new B.Tc(3)}),new B.Ue(1,"2",{T:new B.Tc(5)}),new B.Ue(2,"3",{C:new B.Tc(5)}),new B.Ue(3,"4",{[W]:new B.Tc(5)}),new B.Ue(4,"5",{G:new B.Tc(5)}),new B.Ue(5,"6",{[W]:new B.Tc(3),C:new B.Tc(2)}),new B.Ue(6,"7",{T:new B.Tc(5)}),new B.Ue(7,"8",{T:new B.Tc(5)}),new B.Ue(8,"9",{G:new B.Tc(5)}),new B.Ue(9,"10",{C:new B.Tc(5)}),new B.Ue(10,"11",{[W]:new B.Tc(5)}),new B.Ue(11,"12",{[W]:new B.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),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"),n.filter.init((e=>e>2)),n.filter.fireChanged();const s=await n.plot.fromType("WebLogo",{shrinkEmptyTail:!0});await(0,t.PE)(s.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(s.root,e.DOCK_TYPE.DOWN)}),500);const i=s.positions,l=[new B.Ue(0,"1",{[W]:new B.Tc(3)}),new B.Ue(1,"2",{T:new B.Tc(3)}),new B.Ue(2,"3",{[W]:new B.Tc(3)}),new B.Ue(3,"4",{[W]:new B.Tc(3)}),new B.Ue(4,"5",{C:new B.Tc(3)}),new B.Ue(5,"6",{[W]:new B.Tc(2),C:new B.Tc(1)}),new B.Ue(6,"7",{G:new B.Tc(3)}),new B.Ue(7,"8",{T:new B.Tc(3)}),new B.Ue(8,"9",{[W]:new B.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 s.awaitRendered()})),(0,t.t6)("positions with skipEmptyPositions option",(async()=>{const n=e.DataFrame.fromCsv(r),o=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.MSA");const i=await n.plot.fromType("WebLogo",{skipEmptyPositions:!0});await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{o.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500);const l=i.positions,u=[new B.Ue(0,"1",{A:new B.Tc(2),[W]:new B.Tc(3)}),new B.Ue(1,"2",{T:new B.Tc(5)}),new B.Ue(2,"3",{C:new B.Tc(5)}),new B.Ue(4,"5",{G:new B.Tc(5)}),new B.Ue(5,"6",{[W]:new B.Tc(3),C:new B.Tc(2)}),new B.Ue(6,"7",{T:new B.Tc(5)}),new B.Ue(7,"8",{T:new B.Tc(5)}),new B.Ue(8,"9",{G:new B.Tc(5)}),new B.Ue(9,"10",{C:new B.Tc(5)})];(0,t.E3)(l.length,u.length);for(let e=0;e<l.length;e++)j(l[e],u[e]);await i.awaitRendered()})),(0,t.t6)("count sequences for monomer at position",(async()=>{const o=function(t,n,r){const o=e.DataFrame.fromCsv(t),s=o.getCol("seq");return s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=n,s.setTag(c.gp.alphabet,r),s.setTag(c.gp.aligned,"SEQ.MSA"),o}(r,c.Hi.FASTA,c.YI.DNA),s=o.getCol("seq"),i=a.shell.addTableView(o),l=await o.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 B.Ue(2,"3",{C:new B.Tc(5)}),new B.Ue(4,"5",{G:new B.Tc(5)}),new B.Ue(5,"6",{[W]:new B.Tc(3),C:new B.Tc(2)}),new B.Ue(6,"7",{T:new B.Tc(5)})];(0,t.E3)(u.length,d.length);for(let e=0;e<u.length;e++)j(u[e],d[e]);const h=u[1],p=n.getSeqHandler(s),m=(0,B.eN)(o,p,o.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),o=await n.plot.fromType("WebLogo");await(0,t.PE)(o.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(o.root,e.DOCK_TYPE.DOWN)}),500),o.positions,await o.awaitRendered()}))})),(0,t.L1)("WebLogo.project",(()=>{(0,t.t6)("fasta",(async()=>{const n="Tests.Bio.WebLogo-project.fasta",r=await _e.files.readCsv("tests/filter_FASTA.csv"),o=r.name,s=r.getCol("fasta");await a.data.detectSemanticTypes(r);const i=a.shell.addTableView(r),c=await r.plot.fromType("WebLogo",{sequenceColumnName:s.name});i.dockManager.dock(c),await c.awaitRendered(),await S(i.grid),await async function(t,n,r,o){const s=e.Project.create(),i=r.saveLayout();s.name=t,s.addChild(n),s.addChild(i),await a.dapi.layouts.save(r.saveLayout()),await a.dapi.tables.uploadDataFrame(o),await a.dapi.tables.save(n),await a.dapi.projects.save(s)}(n,r.getTableInfo(),i,r),a.shell.closeAll(),await(0,t.cb)(500),await a.dapi.projects.open(n);const l=a.shell.getTableView(o),u=v()(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 S(i.grid),await d.awaitRendered()}),{skipReason:"depends on 1.18"})})),(0,t.L1)("WebLogo.layout",(()=>{(0,t.t6)("fasta",(async()=>{const e=await _e.files.readCsv("tests/filter_FASTA.csv"),n=e.getCol("fasta");await a.data.detectSemanticTypes(e);const r=a.shell.addTableView(e),o=await e.plot.fromType("WebLogo",{sequenceColumnName:n.name});r.dockManager.dock(o),await(0,t.cb)(2*B.VN.render),await o.awaitRendered(),await S(r.grid);const s=r.saveLayout();s.toJson(),r.loadLayout(s),await(0,t.cb)(2*B.VN.render),await o.awaitRendered(),await S(r.grid);const i=v()(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 K=n(966);function q(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 o=e.DataFrame.fromCsv(r).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");const[s,i]=(0,K.l)(o,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(s,!0)})),(0,t.t6)("testMsaNegHelm",(async()=>{const o=e.DataFrame.fromCsv(r).getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.HELM,o.setTag(c.gp.alphabetIsMultichar,"true");const[s,i]=(0,K.l)(o,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(s,!1)})),(0,t.t6)("testMsaNegUN",(async()=>{const o=e.DataFrame.fromCsv(r).getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,"UN"),o.setTag(c.gp.alphabetSize,"11"),o.setTag(c.gp.alphabetIsMultichar,"true"),o.setTag(c.gp.aligned,"SEQ");const[s,i]=(0,K.l)(o,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(s,!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 _e.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(r);const o=a.shell.addTableView(r),s=o.dataFrame.getCol("MSA");(0,t.E3)(s.semType,e.SEMTYPE.MACROMOLECULE);const i=await o.dataFrame.plot.fromType("Sequence Similarity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),o.dockManager.dock(i,e.DOCK_TYPE.RIGHT,null,"Similarity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==q(o,"Sequence Similarity Search")),"Sequence Similarity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.targetColumn)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"),o.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 _e.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n),o=a.shell.addTableView(r);await a.data.detectSemanticTypes(r);const s=o.dataFrame.getCol("MSA");(0,t.E3)(s.semType,e.SEMTYPE.MACROMOLECULE);const i=await o.dataFrame.plot.fromType("Sequence Diversity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),o.dockManager.dock(i,e.DOCK_TYPE.DOWN,null,"Diversity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==q(o,"Sequence Diversity Search")),"Sequence Diversity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.targetColumn)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),Z=n(4574);(0,t.L1)("bio-substructure-filters",(async()=>{let n,r,o;async function s(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,_e.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,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),await r.loadMonomerLib(!0)})),(0,t.t6)("fasta",(async()=>{const e=await T("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const r=new z._i(n,_e.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 Z.n("MD",void 0,_e.logger)}),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 T("tests/filter_MSA.csv"),r=new z._i(n,_e.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",void 0,_e.logger)}),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",void 0,_e.logger)}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,0),await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new z.AR("meI-hHis","-",_e.logger)}),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()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e="Bio tests: substructureFilters/helm-dialog",r=await T("tests/filter_HELM.csv"),o=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await r.meta.detectSemanticTypes(),_e.logger.debug(`${e}, filter attaching.`);const s=new z._i(n,_e.logger);s.attach(r);const i=x.dialog("Test filters").add(s.root).show();await s.awaitRendered();try{const n=s.bioFilter;(0,t.E3)(null!==s.bioFilter,!0,"bioFilter is not created"),_e.logger.debug(`${e}, filter 1 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.n("PEPTIDE1{A.C}$$$$V2.0",void 0,_e.logger)}),2e4),_e.logger.debug(`${e}, filter 1 changed.`),(0,t.E3)(s.dataFrame.filter.trueCount,1),(0,t.E3)(s.dataFrame.filter.toBinaryString(),"0001"),_e.logger.debug(`${e}, filter 2 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.n("PEPTIDE1{C}$$$$V2.0",void 0,_e.logger)}),2e4),setTimeout((()=>o.grid.invalidate()),500),await S(o.grid),await(0,t.cb)(1e3),_e.logger.debug(`${e}, filter 2 changed.`),(0,t.E3)(s.dataFrame.filter.trueCount,2),(0,t.E3)(s.dataFrame.filter.toBinaryString(),"1001")}finally{i.close()}await s.awaitRendered(),await(0,t.cb)(3e3)}}),{}),(0,t.t6)("helm-view",(async()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e=await T("tests/filter_HELM.csv");e.getCol("HELM string"),await a.data.detectSemanticTypes(e);const t=a.shell.addTableView(e);t.getFiltersGroup(),await S(t.grid)}})),(0,t.t6)("sync-fasta",(async()=>{const e=await _e.files.readCsv("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const n=await s("fasta",e),r=await s("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 o=n.bioFilter,s=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{o.props=new Z.n("MD",void 0,_e.logger)}),1e4,"await onRowsFiltered"),(0,t.E3)(e.filter.trueCount,3),await n.awaitRendered(),(0,t.E3)(s.props.substructure,"MD")}finally{n.detach(),r.detach()}await Promise.all([n.awaitRendered(),r.awaitRendered()])})),(0,t.t6)("sync-msa",(async()=>{const e=await _e.files.readCsv("tests/filter_MSA.csv");await a.data.detectSemanticTypes(e);const n="hHis-Aca",r=await s("MSA",e),o=await s("MSA",e);await Promise.all([r.awaitRendered(),o.awaitRendered()]);try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(!!o.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"SeparatorBioFilter"),(0,t.E3)(o.bioFilter.type,"SeparatorBioFilter");const s=r.bioFilter,i=o.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{s.props=new z.AR(n,"-",_e.logger)}),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(),o.detach()}await Promise.all([r.awaitRendered(),o.awaitRendered()])})),(0,t.t6)("sync-helm",(async()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e=await _e.files.readCsv("tests/filter_HELM.csv");await a.data.detectSemanticTypes(e);const n=a.shell.addTableView(e),r="PEPTIDE1{A.C}$$$$V2.0",o=1,i=await s("HELM string",e),c=await s("HELM string",e),l=x.dialog("Test filters").add(i.root).add(c.root).show();await Promise.all([i.awaitRendered(),c.awaitRendered()]);try{(0,t.E3)(!!i.bioFilter,!0),(0,t.E3)(!!c.bioFilter,!0),(0,t.E3)(i.bioFilter.type,"HelmBioFilter"),(0,t.E3)(c.bioFilter.type,"HelmBioFilter");const s=i.bioFilter,a=c.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{s.props=new Z.n(r,void 0,_e.logger)}),6e4,"await onRowsFiltered"),await S(n.grid),_e.logger.debug("Bio tests: substructureFilters/sync-helm, before changed event"),await(0,t.cb)(2*i.debounceTime),_e.logger.debug("Bio tests: substructureFilters/sync-helm, after changed event"),(0,t.E3)(e.filter.trueCount,o),await i.awaitRendered(),(0,t.E3)(a.props.substructure,r)}finally{i.detach(),c.detach(),l.close()}await Promise.all([i.awaitRendered(),c.awaitRendered()]),await S(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),o="seq1",s="CGGCTG",i=n.getCol("trueSeq1").toList(),c="seq2",l="GCATT",u=n.getCol("trueSeq2").toList(),d=[{type:"Bio:bioSubstructureFilter",columnName:o},{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 S(r.grid);const p=h.filters[0],m=h.filters[1];(0,t.E3)(p.column.name,o),(0,t.E3)(m.column.name,c);const f=p.bioFilter,g=m.bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new Z.n(s,void 0,_e.logger)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n("",void 0,_e.logger)}),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 Z.n("",void 0,_e.logger)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n(l,void 0,_e.logger)}),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 Z.n("",void 0,_e.logger)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n("",void 0,_e.logger)}),1e3,"testEvent onRowsFiltered on neither"),(0,t.E3)(n.filter.trueCount,n.rowCount),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new Z.n(s,void 0,_e.logger)}),5e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n(l,void 0,_e.logger)}),5e3,"testEvent onRowsFiltered on both");const y=v().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(),S(r.grid)])}),{skipReason:"Inconsistent behavior of test"}),(0,t.t6)("reset-fasta",(async()=>{const n=await T("tests/filter_FASTA.csv"),r=a.shell.addTableView(n);await a.data.detectSemanticTypes(n),await n.meta.detectSemanticTypes();const o="MD",s=await n.plot.fromType(e.VIEWER.FILTERS,{filters:[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}]});r.dockManager.dock(s,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await S(r.grid);const i=s.filters[0].bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{i.props=new Z.n(o,void 0,_e.logger)}),1e3,"testEvent onRowsFiltered"),(0,t.E3)(n.filter.trueCount,3),(0,t.E3)(i.props.substructure,o),(0,t.E3)(i.substructureInput.value,o),I()(s.root).find('i[name="icon-arrow-rotate-left"]')[0].click(),await(0,t.cb)(100),await S(r.grid),(0,t.E3)(i.props.substructure,""),(0,t.E3)(i.substructureInput.value,"")})),(0,t.t6)("reopen",(async()=>{const n=await _e.files.readCsv("tests/filter_FASTA.csv"),r=a.shell.addTableView(n);await a.data.detectSemanticTypes(n),await n.meta.detectSemanticTypes();const o=[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}],s=await n.plot.fromType(e.VIEWER.FILTERS,{filters:o});r.dockManager.dock(s,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await S(r.grid),s.close(),await S(r.grid);const i=await n.plot.fromType(e.VIEWER.FILTERS,{filters:o});r.dockManager.dock(i,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await S(r.grid)}),{})}));var X=n(8152);class Q{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 J=n(9192);(0,t.L1)("PepSeA",(()=>{(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,X.GD)(n.getCol("HELM"),"msa(HELM)"),o=n.getCol("MSA");for(let e=0;e<r.length;++e)(0,t.E3)(r.get(e)==o.get(e),!0)}),{timeout:6e4,stressTest:!0,skipReason:"Fails in docker"}),(0,t.t6)("stderr",(async()=>{const n=new Q,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'),o=await(0,X.GD)(r.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n),s=r.getCol("MSA");(0,t.J6)(o.toList(),s.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,skipReason:"Fails in docker"}),(0,t.t6)("error",(async()=>{const n=new Q;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,X.GD)(t.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n)}catch(e){const[t,r]=(0,J.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")}),{skipReason:"Fails in docker"})})),(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 T("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 ee="seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",te="seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT",ne="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 re,oe;(0,t.L1)("SeqHandler",(()=>{let n;async function r(t){const r=e.DataFrame.fromCsv(t);await a.data.detectSemanticTypes(r);const o=n.getSeqHandler(r.getCol("seq"));return[r,o]}(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("Seq-Fasta",(async()=>{const[e,n]=await r(ee);(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(te);(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(ee);(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(te);(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(ne);(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(ne);(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(ee);await a.data.detectSemanticTypes(r);const o=r.getCol("seq"),s=n.getSeqHandler(o),i=o.version,c=n.getSeqHandler(o),l=o.version;(0,t.E3)(i,l,"Unexpected column version changed"),(0,t.E3)(s,c,"Unexpected SeqHandler object changed"),r.rows.addNew(["TACCCCTTCAAC"]);const u=n.getSeqHandler(o),d=o.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"),o.set(1,"CAGTGTCCCCGT");const h=n.getSeqHandler(o),p=o.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"),o.setTag("testTag","testValue");const m=n.getSeqHandler(o),f=o.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")}))})),(oe=re||(re={})).fasta="fasta",oe.fastaMsa="fastaMsa",oe.separator="separator",oe.separatorMsa="separatorMsa",oe.helm="helm",(0,t.L1)("SeqHandler: splitted",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()})),U.b9[c.Hi.FASTA],U.b9[c.Hi.HELM];const r=U.b9[c.Hi.SEPARATOR],o={[re.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"]]}},[re.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"]]}},[re.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"]]}},[re.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]]}},[re.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}$$$$,\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.T.dK}|PEPTIDE2{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"],["meI","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","T","dK","Thr_PO3H2"]]}}};for(const[r,s]of Object.entries(o))(0,t.t6)(`${r}`,(async()=>{const r=e.DataFrame.fromCsv(s.src.csv).getCol("seq"),o=await a.functions.call("Bio:detectMacromolecule",{col:r});o&&(r.semType=o),(0,t.E3)(r.semType,e.SEMTYPE.MACROMOLECULE);const i=n.getSeqHandler(r);(0,t.E3)(i.notation,s.tgt.notation),(0,t.E3)(i.separator===s.tgt.separator,!0);const c=v().count(0).take(i.length).map((e=>{const t=i.getSplitted(e);return v().count(0).take(t.length).map((e=>t.getOriginal(e))).toArray()})).toArray();(0,t.J6)(c,s.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:c.YI.UN,positionNames:{tag:null,start:"4",end:"7"}}};for(const[o,s]of Object.entries(r))(0,t.t6)(`${o}-idx`,(async()=>{const r=e.DataFrame.fromCsv(s.srcCsv).getCol("seq"),o=await a.functions.call("Bio:detectMacromolecule",{col:r});o&&(r.semType=o);const i=n.getSeqHandler(r).getRegion(s.startIdx,s.endIdx,"regSeq"),l=e.DataFrame.fromCsv(s.tgtCsv).getCol("seq");(0,t.E3)(r.meta.units,s.units),(0,t.E3)(i.meta.units,s.units),(0,t.E3)(r.getTag(c.gp.alphabet),s.alphabet),(0,t.E3)(i.getTag(c.gp.alphabet),s.alphabet),(0,t.J6)(i.toList(),l.toList())})),s.positionNames&&(0,t.t6)(`${o}-positionNames`,(async()=>{const n=e.DataFrame.fromCsv(s.srcCsv).getCol("seq");s.positionNames.tag&&n.setTag(c.gp.positionNames,s.positionNames.tag);const r=await a.functions.call("Bio:detectMacromolecule",{col:n});r&&(n.semType=r);const o=await a.functions.call("Bio:getRegion",{sequence:n,start:s.positionNames.start,end:s.positionNames.end}),i=e.DataFrame.fromCsv(s.tgtCsv).getCol("seq");(0,t.E3)(n.meta.units,s.units),(0,t.E3)(o.meta.units,s.units),(0,t.E3)(n.getTag(c.gp.alphabet),s.alphabet),(0,t.E3)(o.getTag(c.gp.alphabet),s.alphabet),(0,t.J6)(o.toList(),i.toList())}))})),(0,t.L1)("SeqHandler: getHelm",(()=>{let n,r,o;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),await r.loadMonomerLib(!0)}));const s={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(s))(0,t.t6)(e,(async()=>{await i(n.src.seq,n.src.notation,n.src.separator,n.tgt.helm)}));async function i(r,o,s,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.getValue(0)).helm;(0,t.E3)(d,i)}}));var se=n(6956);class ie{constructor(e){const t=e.split(se.xe).filter((e=>e));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 o=r[t],s=e.split(":"),i={monomerIdx:parseInt(s[0])-1,rGroupId:parseInt(s[1].slice(1))};n.push({polymerId:o,bond:i})})),e.push(n)})),e}}var ae=n(8438);class ce{simplePolymer;isNucleotideSequence=!1;constructor(e){this.simplePolymer=e,this.polymerType=this.getPolymerType(),this.isNucleotideSequence="RNA"===this.polymerType,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=>{if(this.isNucleotideSequence){const t=e.split(/\(|\)/).filter((e=>!!e)).map((e=>(0,ae.D)(e)));n.push(...t),t.forEach(((e,t)=>r.push(t%3==1?"Branch":"Backbone")))}else n.push((0,ae.D)(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],o=t[n+1];e.push([{monomerIdx:r,rGroupId:2},{monomerIdx:o,rGroupId:1}])}for(let t=0;t<n.length;t++){const r=n[t],o=r-1;e.push([{monomerIdx:o,rGroupId:3},{monomerIdx:r,rGroupId:1}])}return e}}class le{helmString;constructor(e){this.helmString=e;const t=this.helmString.split(se.pk),n=t[0].split(se.xe);this.simplePolymers=n.map((e=>new ce(e))),this.connectionList=new ie(t[1]),this.bondData=this.getBondData(),this.bondedRGroupsMap=this.getBondedRGroupsMap()}bondData;simplePolymers;connectionList;bondedRGroupsMap;getBondedRGroupsMap(){const e=this.simplePolymers.map((e=>e.monomers.length)).reduce(((e,t)=>e+t),0),t=Array.from({length:e},(()=>[]));return this.bondData.forEach((e=>{e.forEach((e=>{const n=e.monomerIdx,r=e.rGroupId;t[n].push(r)}))})),t}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(),o=e[n.id];this.shiftBondMonomerIds(o,r),t.push(...r)})),this.connectionList.getConnectionData().forEach((n=>{const r=[];n.forEach((t=>{const n=e[t.polymerId],o=t.bond;o.monomerIdx+=n,r.push(o)})),t.push(r)})),t}}(0,t.L1)("helm",(()=>{const e={"single-linear":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T.[meI]}$$$$"},tgt:{simplePolymers:[6],connections:[],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],connections:[[["PEPTIDE1",3,"R3"],["PEPTIDE1",8,"R3"]]],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],connections:[[["PEPTIDE1",2,"R3"],["PEPTIDE1",7,"R3"]]],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,1:R3-6:R3$$$"},tgt:{simplePolymers:[6],connections:[[["PEPTIDE1",1,"R3"],["PEPTIDE1",6,"R3"]]],bondedRGroups:[2,2,2,2,2,2]}},"two-separated-5-1":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T}|PEPTIDE2{[meI]}$$$$"},tgt:{simplePolymers:[5,1],connections:[],bondedRGroups:[1,2,2,2,1,0]}},"two-separated-1-5":{src:{helm:"PEPTIDE1{[meI]}|PEPTIDE2{R.F.Y.[GGaz].T}$$$$"},tgt:{simplePolymers:[1,5],connections:[],bondedRGroups:[0,1,2,2,2,1]}},"two-separated-4-2":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz]}|PEPTIDE2{T.[meI]}$$$$"},tgt:{simplePolymers:[4,2],connections:[],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],connections:[[["PEPTIDE1",5,"R2"],["PEPTIDE2",1,"R1"]]],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],connections:[[["PEPTIDE1",4,"R2"],["PEPTIDE2",1,"R1"]]],bondedRGroups:[1,2,2,2,2,1]}},"two-cyclized-1-9":{src:{helm:"PEPTIDE1{[meI]}|PEPTIDE2{R.F.[GGaz].T.G.H.F.Y.P}$PEPTIDE2,PEPTIDE2,3:R3-9:R2|PEPTIDE2,PEPTIDE1,3:R4-1:R1$$$V2.0"},tgt:{simplePolymers:[1,9],connections:[[["PEPTIDE2",3,"R3"],["PEPTIDE2",9,"R2"]],[["PEPTIDE2",3,"R4"],["PEPTIDE1",1,"R1"]]],bondedRGroups:[1,1,2,4,2,2,2,2,2,1]}}};for(const[n,{src:r,tgt:o}]of Object.entries(e))(0,t.t6)(n,(async()=>{const e=new le(r.helm),n=e.simplePolymers.map((e=>e.monomers.length)),s=n.reduce(((e,t)=>e+t),0);(0,t.J6)(n,o.simplePolymers);const i=e.connectionList.getConnectionData().map((e=>[[e[0].polymerId,e[0].bond.monomerIdx+1,`R${e[0].bond.rGroupId}`],[e[1].polymerId,e[1].bond.monomerIdx+1,`R${e[1].bond.rGroupId}`]]));(0,t.J6)(i,o.connections);const a=v().count(0).take(e.bondedRGroupsMap.length).map((t=>e.bondedRGroupsMap[t].length)).toArray();(0,t.E3)(s,a.length)}))}));var ue=n(6077),de=n(6717);const he=new e.FileSource("System:AppData/Bio"),pe={"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"}},me="molfile(sequence)";function fe(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 o,s,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 o=e.getCol(me),s=n.getCol(me),i=v()(o.values()).map((e=>fe(e))).toArray(),c=v()(s.values()).map((e=>fe(e))).toArray();(0,t.J6)(i,c)}(0,t.gM)((async()=>{d=await(0,de.j)(),i=await(0,l.Q)(),o=await(0,E.pj)(),s=await(0,P.ub)(),await o.loadMonomerLibForTests(),u=o.getMonomerLib();for(const[t,o]of Object.entries(pe))o.inPath,n[t]=e.DataFrame.fromCsv((await he.readAsText(o.inPath)).replace(/\n$/,"")),await a.data.detectSemanticTypes(n[t]),r[t]=e.DataFrame.fromCsv((await he.readAsText(o.outPath)).replace(/\n$/,""))})),(0,t.Pl)((async()=>{await(0,P.Eu)(s),await o.loadMonomerLib(!0)}));for(const[e,o]of Object.entries(pe))(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),o=await(0,ue.C4)(e,r,u,i,d);return o.warnings.length>0&&_e.logger.warning(`_toAtomicLevel() warnings ${o.warnings.join("\n")}`),o.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 _e.files.readAsText("tests/to-atomic-level-pt-fasta-2.mol"),r=e.DataFrame.fromCsv("seq\nAR"),o=r.getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,c.YI.PT),i.getSeqHandler(o);const s=await g(r,"seq");(0,t.E3)(fe(s.get(0)),fe(n))}))}));var ge=n(8754);(0,t.L1)("toAtomicLevel-ui",(()=>{let n,r,o,s,i;(0,t.gM)((async()=>{o=await(0,l.Q)(),i=await(0,de.j)(),n=await(0,E.pj)(),r=await(0,P.ub)(),await n.loadMonomerLibForTests(),s=n.getMonomerLib()})),(0,t.Pl)((async()=>{await(0,P.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)}));if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length)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,ge.V)(n.dataFrame,n,r,!1,s,o,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 ye=n(6863);async function be(t,n){const r=e.DataFrame.fromCsv(t),o=r.col("seq"),s=await a.functions.call("Bio:detectMacromolecule",{col:o});return s&&(o.semType=s),await a.data.detectSemanticTypes(r),n.getSeqHandler(o)}function we(e,n,r,o){const s=r(e,n);(0,t.E3)(Number(s.toFixed(3)),Number(o.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]],o={F:0,W:1,R:2,Y:3},s="FWRWY",i="FWRWW",a="FWY",c="FWRWY",u="FWY",d="FWRRRRY";(0,t.t6)("protein-distance-function",(async()=>{const e=(await be("seq\nFWRWYVKHPFWRWYVKHP\nYNRWYVKHPYNRWYVKHP\nMWRSWYCKHPMWRSWYCKHP",n)).getDistanceFunctionName();(0,t.E3)(e,ye.Z.LEVENSHTEIN)})),(0,t.t6)("DNA-distance-function",(async()=>{const e=(await be("seq\nATAACGATAACG\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ye.Z.LEVENSHTEIN)})),(0,t.t6)("MSA-distance-function",(async()=>{const e=(await be("seq\nATAACATAAC\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ye.Z.HAMMING)})),(0,t.t6)("levenstein-sub",(async()=>{const e=ye.V[ye.Z.LEVENSHTEIN]();we(s,i,e,.2)})),(0,t.t6)("levenstein-del",(async()=>{const e=ye.V[ye.Z.LEVENSHTEIN]();we(a,c,e,.4)})),(0,t.t6)("hamming",(async()=>{const e=ye.V[ye.Z.HAMMING]();we(a,c,e,.6)})),(0,t.t6)("needleman-blosum62",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});we(s,i,e,-6)})),(0,t.t6)("needleman-blosum62-del",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});we(a,c,e,-3.667)})),(0,t.t6)("needleman-custom-sub",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:1});we(s,i,e,.2)})),(0,t.t6)("needleman-custom-del",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:1});we(a,c,e,.667)})),(0,t.t6)("needleman-custom-zero-extend",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:0});we(u,d,e,.333)})),(0,t.t6)("needleman-custom-half-extend",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:2,gapExtend:1});we(u,d,e,1.667)})),(0,t.t6)("needleman-custom-same-extend",(async()=>{const t=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:1});e.Test.isInBenchmark?we(Array(1e3).fill(u).join(""),Array(1e3).fill(d).join(""),t,1.333):we(u,d,t,1.333)}),{benchmark:!0})}));var ve=n(684);async function Ae(e,n,r,o,s,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(o),similarity:s,methodName:n,similarityMetric:c,preprocessingFunction:l,options:{[`${ve.vb}`]:!0},demo:!1});(0,t.E3)(null!=u,!0),await(0,t.bk)((()=>{const e=Array.from(u.root.getElementsByClassName("scatter_plot_link"));return!e.length||e[0].innerText.toLowerCase()===`${i} cliffs`}),"incorrect cliffs link",3e3)}var Ee=n(2780),Ce=n(9039),Te=n(9124);async function Se(n,r,o){const s=n.getCol(o);n.name="seqSpaceDf";const i=await a.functions.call("Bio:detectMacromolecule",{col:s});i&&(s.semType=i);const c=e.Func.find({package:"Bio",name:"macromoleculePreprocessingFunction"})[0];if(!c)throw new Error("Preprocessing function not found");await a.functions.call("Bio:sequenceSpaceTopMenu",{table:n,molecules:n.col(o),methodName:r,similarityMetric:ye.Z.LEVENSHTEIN,plotEmbeddings:!0,preprocessingFunction:c,options:{[ve.vb]:!0}});const l=a.shell.tableView(n.name),u=Array.from(l?.viewers??[])[1];(0,t.E3)(null!=u)}(0,t.L1)("activityCliffs",(async()=>{let n,r,o;const s=e.Func.find({name:"macromoleculePreprocessingFunction",package:"Bio"})[0],i=e.Func.find({name:"helmPreprocessingFunction",package:"Bio"})[0];(0,t.gM)((async()=>{e.Func.find({package:"Helm",name:"getHelmHelper"}).length&&(n=await(0,Te.b2)()),r=await(0,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),await r.loadMonomerLib(!0)})),(0,t.t6)("activityCliffsOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_with_random_motif_1600.csv",tgt:{cliffCount:64}}:{fileName:"tests/100_3_clustests.csv",tgt:{cliffCount:3}},n=await T(t.fileName);a.shell.addTableView(n),await Ae(n,Ce.c.UMAP,"sequence","Activity",90,t.tgt.cliffCount,ye.Z.LEVENSHTEIN,s)}),{benchmark:!0,skipReason:"Fails"}),(0,t.t6)("activityCliffsWithEmptyRows",(async()=>{const e=await T("tests/100_3_clustests_empty_vals.csv");a.shell.addTableView(e),await Ae(e,Ce.c.UMAP,"sequence","Activity",90,3,ye.Z.LEVENSHTEIN,s)})),(0,t.t6)("Helm",(async()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e=await _e.files.readCsv("samples/HELM_50.csv");a.shell.addTableView(e),await Ae(e,Ce.c.UMAP,"HELM","Activity",65,20,Ee.aT.Tanimoto,i)}}))})),(0,t.L1)("sequenceSpace",(async()=>{let n,r,o,s;(0,t.t6)("sequenceSpaceOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_with_random_motif_1600.csv"}:{fileName:"tests/100_3_clustests.csv"};n=await T(t.fileName),r=a.shell.addTableView(n),await Se(n,Ce.c.UMAP,"sequence")}),{benchmark:!0}),(0,t.t6)("sequenceSpaceWithEmptyRows",(async()=>{o=await T("tests/100_3_clustests_empty_vals.csv"),s=a.shell.addTableView(o),await Se(o,Ce.c.UMAP,"sequence")}))})),(0,t.L1)("Scoring",(()=>{const n="sequence",r="expected_similarity",o="expected_identity",s=e.DataFrame.fromCsv(`${n},${r},${o}\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.691,0.53\nPEPTIDE1{[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal]}$$$$V2.0,0.37,0.0`),i=s.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,E.pj)(),d=await(0,P.ub)(),await u.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(d),await u.loadMonomerLib(!0)})),(0,t.t6)("Identity",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:s,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const r=e.get(n),i=s.get(o,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:s,macromolecule:i,reference:"PEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva}$$$$"});(0,t.E3)(v().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:s,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)(v().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:s,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const o=e.get(n),i=s.get(r,n);(0,t.Wj)(o,i,.01,`Wrong similarity score for sequence at position ${n}`)}}))}));const _e=new e.Package;async function Pe(n,r,o,s){const i=await(0,t.N$)({category:n,test:r,testContext:o,stressTest:s});return e.DataFrame.fromObjects(i)}async function Me(){await(0,t.Xb)(_e,_e.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:o,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,s.propertyInData)(n,o,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,s.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,s.checkMissingProp)(e,l,a)})`),(0,s.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,o.alwaysValidSchema)(a,t[l])||(n.if((0,s.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),o={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,r.validateSchemaDeps)(e)};t.default=o},1239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s}=e;void 0===n.then&&void 0===n.else&&(0,o.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const a=i(s,"then"),c=i(s,"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,o){return()=>{const s=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(s,l),o?t.assign(o,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,o.alwaysValidSchema)(e,n)}t.default=s},6378:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5457),o=n(5354),s=n(494),i=n(3966),a=n(2661),c=n(3025),l=n(2094),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(o.default,i.default):t.push(r.default,s.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),o=n(4227),s=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,o.alwaysValidSchema)(n,t)||e.ok((0,s.validateArray)(e))}};function a(e,t,n=e.schema){const{gen:s,parentSchema:i,data:a,keyword:c,it:l}=e;!function(e){const{opts:r,errSchemaPath:s}=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 "${s}"`;(0,o.checkStrictMode)(l,e,r.strictTuples)}}(i),l.opts.unevaluated&&n.length&&!0!==l.items&&(l.items=o.mergeEvaluated.items(s,n.length,l.items));const u=s.name("valid"),d=s.const("len",r._`${a}.length`);n.forEach(((t,n)=>{(0,o.alwaysValidSchema)(l,t)||(s.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),o=n(4227),s=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,o.alwaysValidSchema)(r,t)||(a?(0,i.validateAdditionalItems)(e,a):e.ok((0,s.validateArray)(e)))}};t.default=a},7923:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:n,it:o}=e;if((0,r.alwaysValidSchema)(o,n))return void e.fail();const s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}};t.default=o},6163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(i.opts.discriminator&&s.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,s)=>{let a;(0,o.alwaysValidSchema)(i,n)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},u),s>0&&t.if(r._`${u} && ${c}`).assign(c,!1).assign(l,r._`[${l}, ${s}]`).else(),t.if(u,(()=>{t.assign(c,!0),t.assign(l,s),a&&e.mergeEvaluated(a,r.Name)}))}))})),e.result(c,(()=>e.reset()),(()=>e.error(!0)))}};t.default=s},5333:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s=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,s.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 o.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,s.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(n){t.forIn("key",a,(s=>{t.if(o._`${(0,r.usePattern)(e,n)}.test(${s})`,(()=>{const r=h.includes(n);r||e.subschema({keyword:"patternProperties",schemaProp:n,dataProp:s,dataPropType:i.Type.Str},m),l.opts.unevaluated&&!0!==f?t.assign(o._`${f}[${s}]`,!0):r||l.allErrors||t.if((0,o.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),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,r.validateTuple)(e,"items")};t.default=o},117:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2586),o=n(5765),s=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,o.allSchemaProperties)(n);for(const e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&!0!==l.props&&(l.props=s.mergeEvaluated.props(t,(0,s.toHash)(u),l.props));const d=u.filter((e=>!(0,s.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,o.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},2094:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s,it:i}=e;if((0,o.alwaysValidSchema)(i,n))return;const a=t.name("valid");t.forIn("key",s,(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=s},4426:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4227),o={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=o},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),o=n(4227),s=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,o){const s=r._`${t}${(0,r.getProperty)(n)} === undefined`;return o?(0,r.or)(s,(0,r.not)(c(e,t,n))):s}function u(e){return e?Object.keys(e).filter((e=>"__proto__"!==e)):[]}t.checkReportMissingProp=function(e,t){const{gen:n,data:o,it:s}=e;n.if(l(n,o,t,s.opts.ownProperties),(()=>{e.setParams({missingProperty:r._`${t}`},!0),e.error()}))},t.checkMissingProp=function({gen:e,data:t,it:{opts:n}},o,s){return(0,r.or)(...o.map((o=>(0,r.and)(l(e,t,o,n.ownProperties),r._`${s} = ${o}`))))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,n,o){const s=r._`${t}${(0,r.getProperty)(n)} !== undefined`;return o?r._`${s} && ${c(e,t,n)}`:s},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter((n=>!(0,o.alwaysValidSchema)(e,t[n])))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:n,topSchemaRef:o,schemaPath:i,errorPath:a},it:c},l,u,d){const h=d?r._`${e}, ${t}, ${o}${i}`:t,p=[[s.default.instancePath,(0,r.strConcat)(s.default.instancePath,a)],[s.default.parentData,c.parentData],[s.default.parentDataProperty,c.parentDataProperty],[s.default.rootData,s.default.rootData]];c.opts.dynamicRef&&p.push([s.default.dynamicAnchors,s.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 o=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(n,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:r._`${"new RegExp"===s.code?d:(0,i.useFunc)(e,s)}(${n}, ${o})`})},t.validateArray=function(e){const{gen:t,data:n,keyword:s,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:s,dataProp:n,dataPropType:o.Type.Num},a),t.if((0,r.not)(a),i)}))}},t.validateUnion=function(e){const{gen:t,schema:n,keyword:s,it:i}=e;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((e=>(0,o.alwaysValidSchema)(i,e)))&&!i.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block((()=>n.forEach(((n,o)=>{const i=e.subschema({keyword:s,schemaProp:o,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),o=n(3693),s=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",r.default,o.default];t.default=s},3693:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const r=n(4551),o=n(5765),s=n(9029),i=n(2023),a=n(3835),c=n(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:n,it:o}=e,{baseId:i,schemaEnv:c,validateName:l,opts:h,self:p}=o,{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,s._`${n}.validate`,m,m.$async)}();const f=a.resolveRef.call(p,m,i,n);if(void 0===f)throw new r.default(o.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 o=t.scopeValue("schema",!0===h.code.source?{ref:r,code:(0,s.stringify)(r)}:{ref:r}),i=t.name("valid"),a=e.subschema({schema:r,dataTypes:[],schemaPath:s.nil,topSchemaRef:o,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}):s._`${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:s.nil;function m(e){const t=s._`${e}.errors`;a.assign(i.default.vErrors,s._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),a.assign(i.default.errors,s._`${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",s._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,s.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",s._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,s.Name)}}r?function(){if(!d.$async)throw new Error("async schema referenced by sync schema");const n=a.let("valid");a.try((()=>{a.code(s._`await ${(0,o.callValidateCode)(e,t,p)}`),f(t),u||a.assign(n,!0)}),(e=>{a.if(s._`!(${e} instanceof ${l.ValidationError})`,(()=>a.throw(e))),m(e),u||a.assign(n,!1)})),e.ok(n)}():e.result((0,o.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),o=n(7652),s=n(3835),i=n(4551),a=n(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.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 o=t.name("valid"),s=e.subschema({keyword:"oneOf",schemaProp:n},o);return e.mergeEvaluated(s,r.Name),o}t.if(r._`typeof ${m} == "string"`,(()=>function(){const n=function(){var e;const t={},n=o(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=s.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),l instanceof s.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||o(l)),c(p,t)}if(!r)throw new Error(`discriminator: "${h}" must be required`);return t;function o({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:o.DiscrError.Mapping,tag:m,tagName:h}),t.endIf()}()),(()=>e.error(!1,{discrError:o.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),o=n(7060),s=n(6378),i=n(5520),a=n(5413),c=n(3265),l=n(7532),u=n(9857),d=[i.default,r.default,o.default,(0,s.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),o=n(7060),s=n(6378),i=n(7532),a=n(9857),c=[r.default,o.default,(0,s.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),o=n(2023),s=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._`${o.default.dynamicAnchors}${(0,r.getProperty)(t)}`,l="#"===a.errSchemaPath?a.validateName:function(e){const{schemaEnv:t,schema:n,self:r}=e.it,{root:o,baseId:a,localRefs:c,meta:l}=t.root,{schemaId:u}=r.opts,d=new s.SchemaEnv({schema:n,schemaId:u,root:o,baseId:a,localRefs:c,meta:l});return s.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),o=n(2023),s=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._`${o.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,s.callRef)(e,t),n.let(r,!0)})):()=>(0,s.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),o=n(3252),s=n(2721),i=n(3799),a=[r.default,o.default,s.default,i.default];t.default=a},2721:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2476),o=n(4227),s={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,r.dynamicAnchor)(e,""):(0,o.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};t.default=s},3799:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3252),o={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,r.dynamicRef)(e,e.schema)};t.default=o},4737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o,$data:s,schema:i,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:h}=c;l.validateFormats&&(s?function(){const s=n.scopeValue("formats",{ref:h.formats,code:l.code.formats}),i=n.const("fDef",r._`${s}[${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}(${o}) : ${u}(${o}))`:r._`${u}(${o})`,n=r._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return r._`${u} && ${u} !== true && ${c} === ${t} && !${n}`}()))}():function(){const s=h.formats[i];if(!s)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===s)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,o=n.scopeValue("formats",{key:i,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,r._`${o}.validate`]}(s);a===t&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!d.$async)throw new Error("async format in sync schema");return r._`await ${p}(${o})`}return"function"==typeof c?r._`${p}(${o})`:r._`${p}.test(${o})`}())}())}};t.default=o},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),o=n(4845),s=n(2626),i=[r.default,o.default,s.default];t.default=i},3265:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(392),o=n(3445),s=[r.default,o.default];t.default=s},3445:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s={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:s,it:i}=e,a=i.items||0;if(!0===a)return;const c=t.const("len",r._`${s}.length`);if(!1===n)e.setParams({len:a}),e.fail(r._`${c} > ${a}`);else if("object"==typeof n&&!(0,o.alwaysValidSchema)(i,n)){const n=t.var("valid",r._`${c} <= ${a}`);t.if((0,r.not)(n),(()=>function(n,s){t.forRange("i",s,c,(s=>{e.subschema({keyword:"unevaluatedItems",dataProp:s,dataPropType:o.Type.Num},n),i.allErrors||t.if((0,r.not)(n),(()=>t.break()))}))}(n,a))),e.ok(n)}i.items=!0}};t.default=s},392:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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(s){if(!1===n)return e.setParams({unevaluatedProperty:s}),e.error(),void(l||t.break());if(!(0,o.alwaysValidSchema)(c,n)){const n=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:s,dataPropType:o.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 o in e)!0===e[o]&&n.push(r._`${t} !== ${o}`);return(0,r.and)(...n)}(u,e),(()=>d(e))))),c.props=!0,e.ok(r._`${a} === ${s.default.errors}`)}};t.default=i},7935:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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,o.useFunc)(t,s.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),o={keyword:"dependentRequired",type:"object",schemaType:"object",error:r.error,code:e=>(0,r.validatePropertyDeps)(e)};t.default=o},8643:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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,o.useFunc)(t,s.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,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?r._`${h()}(${n}, ${e}[${t}])`:r._`${n} === ${o}`}(e,o))))}e.pass(p)}};t.default=i},7060:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5882),o=n(3439),s=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,o.default,s.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),o={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=o},1163:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o}=e,s="maxItems"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`${n}.length ${s} ${o}`)}};t.default=o},7307:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o=n(4227),s=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,o.useFunc)(e.gen,s.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),o=r.operators,s={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},i={message:({keyword:e,schemaCode:t})=>r.str`must be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>r._`{comparison: ${s[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(s),type:"number",schemaType:"number",$data:!0,error:i,code(e){const{keyword:t,data:n,schemaCode:o}=e;e.fail$data(r._`${n} ${s[t].fail} ${o} || isNaN(${n})`)}};t.default=a},4486:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o}=e,s="maxProperties"===t?r.operators.GT:r.operators.LT;e.fail$data(r._`Object.keys(${n}).length ${s} ${o}`)}};t.default=o},3439:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(9029),o={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:o,it:s}=e,i=s.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._`(${o} === 0 || (${a} = ${n}/${o}, ${c}))`)}};t.default=o},422:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:n,schema:s,schemaCode:i,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=n?o._`(new RegExp(${i}, ${c}))`:(0,r.usePattern)(e,s);e.fail$data(o._`!${l}.test(${t})`)}};t.default=s},4003:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(5765),o=n(9029),s=n(4227),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{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(o.nil,h);else for(const t of n)(0,r.checkReportMissingProp)(e,t)}():function(){const s=t.let("missing");if(d||c){const n=t.let("valid",!0);e.block$data(n,(()=>function(n,s){e.setParams({missingProperty:n}),t.forOf(n,i,(()=>{t.assign(s,(0,r.propertyInData)(t,a,n,u.ownProperties)),t.if((0,o.not)(s),(()=>{e.error(),t.break()}))}),o.nil)}(s,n))),e.ok(n)}else t.if((0,r.checkMissingProp)(e,n,s)),(0,r.reportMissingProp)(e,s),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,s.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),o=n(9029),s=n(4227),i=n(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{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(s,i){const a=t.name("item"),c=(0,r.checkDataTypes)(p,a,d.opts.strictNumbers,r.DataType.Wrong),l=t.const("indices",o._`{}`);t.for(o._`;${s}--;`,(()=>{t.let(a,o._`${n}[${s}]`),t.if(c,o._`continue`),p.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${l}[${a}] == "number"`,(()=>{t.assign(i,o._`${l}[${a}]`),e.error(),t.assign(h,!1).break()})).code(o._`${l}[${a}] = ${s}`)}))}function f(r,a){const c=(0,s.useFunc)(t,i.default),l=t.name("outer");t.label(l).for(o._`;${r}--;`,(()=>t.for(o._`${a} = ${r}; ${a}--;`,(()=>t.if(o._`${c}(${n}[${r}], ${n}[${a}])`,(()=>{e.error(),t.assign(h,!1).break(l)}))))))}e.block$data(h,(function(){const r=t.let("i",o._`${n}.length`),s=t.let("j");e.setParams({i:r,j:s}),t.assign(h,!0),t.if(o._`${r} > 1`,(()=>(p.length>0&&!p.some((e=>"object"===e||"array"===e))?m:f)(r,s)))}),o._`${u} === false`),e.ok(h)}};t.default=a},5488:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),o=n.n(r),s=n(6314),i=n.n(s)()(o());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),o=n.n(r),s=n(6314),i=n.n(s)()(o());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),o=n.n(r),s=n(6314),i=n.n(s)()(o());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 width: unset !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}\n\n.monomer-lib-controls-form .ui-input-root {\n flex-wrap: nowrap !important;\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;IACvB,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;;AAEA;IACI,4BAA4B;AAChC",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 width: unset !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}\n\n.monomer-lib-controls-form .ui-input-root {\n flex-wrap: nowrap !important;\n}"],sourceRoot:""}]);const a=i},6369:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(1354),o=n.n(r),s=n(6314),i=n.n(s)()(o());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),o=n.n(r),s=n(6314),i=n.n(s)()(o());i.push([e.id,".scatter_plot_link {\n right: 10px;\n}\n\n.cliffs_div {\n flex-grow: initial!important;\n justify-content: flex-end;\n flex-wrap: wrap;\n}\n\n.cliffs_grid {\n margin: 0!important;\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.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,WAAW;AACf;;AAEA;IACI,4BAA4B;IAC5B,yBAAyB;IACzB,eAAe;AACnB;;AAEA;GACG,mBAAmB;AACtB;;AAEA;IACI,eAAe;IACf,kBAAkB;IAClB,YAAY;AAChB;;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 right: 10px;\n}\n\n.cliffs_div {\n flex-grow: initial!important;\n justify-content: flex-end;\n flex-wrap: wrap;\n}\n\n.cliffs_grid {\n margin: 0!important;\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.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),o=n.n(r),s=n(6314),i=n.n(s)()(o());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 min-width: 220px;\n width: 100%;\n\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,gBAAgB;EAChB,WAAW;;AAEb",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 min-width: 220px;\n width: 100%;\n\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,o,s){"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!==s&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=s),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),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)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),s="/*# ".concat(o," */");return[t].concat([s]).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,o,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))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=(s=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,s[o]))return!1;for(o=r;0!=o--;){var i=s[o];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,o,s){for(var i,a,c,l,u,d,h,p,m,f,g,y,b;s>=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=o+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,o+=64,s-=64}return o}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,o=t/536870912|0,s=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]=o>>>24&255,this.buffer[i-7]=o>>>16&255,this.buffer[i-6]=o>>>8&255,this.buffer[i-5]=o>>>0&255,this.buffer[i-4]=s>>>24&255,this.buffer[i-3]=s>>>16&255,this.buffer[i-2]=s>>>8&255,this.buffer[i-1]=s>>>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 o=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 s(e){var t=(new r).update(e),n=t.digest();return t.clean(),n}function i(e,t){var n=new o(e).update(t),r=n.digest();return n.clean(),r}function a(e,t,n,r){var o=r[0];if(0===o)throw new Error("hkdf: cannot expand more");t.reset(),o>1&&t.update(e),n&&t.update(n),t.update(r),t.finish(e),r[0]++}e.HMAC=o,e.hash=s,e.default=s,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 s=new Uint8Array([1]),l=i(t,e),u=new o(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,s),h=0),p[m]=d[h++];return u.clean(),d.fill(0),s.fill(0),p},e.pbkdf2=function(e,t,n,r){for(var s=new o(e),i=s.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,s.reset(),s.update(t),s.update(a),s.finish(l);for(var p=0;p<i;p++)c[p]=l[p];for(p=2;p<=n;p++){s.reset(),s.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 s.clean(),u}}(t);var o=t.default;for(var s in t)o[s]=t[s];"object"==typeof e.exports?e.exports=o:void 0===(r=function(){return o}.call(t,n,t,e))||(e.exports=r)}()},2787:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});const r=new Uint32Array(65536),o=(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,o=t.length,s=1<<n-1;let i=-1,a=0,c=n,l=n;for(;l--;)r[e.charCodeAt(l)]|=1<<l;for(l=0;l<o;l++){let e=r[t.charCodeAt(l)];const n=e|a;e|=(e&i)+i^i,a|=~(e|i),i&=e,a&s&&c++,i&s&&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,o=e.length,s=[],i=[],a=Math.ceil(n/32),c=Math.ceil(o/32);for(let e=0;e<a;e++)i[e]=-1,s[e]=0;let l=0;for(;l<c-1;l++){let a=0,c=-1;const u=32*l,d=Math.min(32,o)+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)],o=i[e/32|0]>>>e&1,l=s[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^o&&(i[e/32|0]^=1<<e),p>>>31^l&&(s[e/32|0]^=1<<e),h=h<<1|o,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,o-h)+h;for(let t=h;t<p;t++)r[e.charCodeAt(t)]|=1<<t;let m=o;for(let e=0;e<n;e++){const n=r[t.charCodeAt(e)],a=i[e/32|0]>>>e&1,c=s[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>>>o-1&1,m-=f>>>o-1&1,p>>>31^a&&(i[e/32|0]^=1<<e),f>>>31^c&&(s[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,o=Array.prototype.slice.call(arguments).slice(1);for(t=0,r=o.length;t<r;t++)if(o[t])for(n in o[t])e[n]=o[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,o=e.size,s={},i=new Float32Array(10*r),a=new Float32Array(3*o);return n=0,e.forEachNode((function(e,t){s[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,o,c,l,u,d){var h=s[o],p=s[c],m=t(e,r,o,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,o){return o.x=t[r],o.y=t[r+1],r+=10,n?n(e,o):o}))},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(),o={},s=0,i=0,a=t.length;s<a;s+=10){if(n){var c=Object.assign({},e.getNodeAttributes(r[i]));c.x=t[s],c.y=t[s+1],c=n(r[i],c),o[r[i]]={x:c.x,y:c.y}}else o[r[i]]={x:t[s],y:t[s+1]};i++}return o},t.createWorker=function(e){var t=window.URL||window.webkitURL,n=e.toString(),r=t.createObjectURL(new Blob(["("+n+").call(this);"],{type:"text/javascript"})),o=new Worker(r);return t.revokeObjectURL(r),o}},8903:(e,t,n)=>{var r=n(1736),o=n(8153).Fd,s=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=o("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++)s(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 o,s,i,a,c,l,u,d,h,p,m,f,g,y,b,w,v,A,E,C,T,S,_,P=n.length,M=r.length,N=e.adjustSizes,$=e.barnesHutTheta*e.barnesHutTheta,x=[];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,x[0]=-1,x[1]=(O+k)/2,x[2]=(G+D)/2,x[3]=Math.max(k-O,D-G),x[4]=-1,x[5]=-1,x[6]=0,x[7]=0,x[8]=0,o=1,i=0;i<P;i+=t)for(s=0,R=3;;){if(!(x[s+5]>=0)){if(x[s+0]<0){x[s+0]=i;break}if(x[s+5]=9*o,d=x[s+3]/2,x[(h=x[s+5])+0]=-1,x[h+1]=x[s+1]-d,x[h+2]=x[s+2]-d,x[h+3]=d,x[h+4]=h+9,x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,x[(h+=9)+0]=-1,x[h+1]=x[s+1]-d,x[h+2]=x[s+2]+d,x[h+3]=d,x[h+4]=h+9,x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,x[(h+=9)+0]=-1,x[h+1]=x[s+1]+d,x[h+2]=x[s+2]-d,x[h+3]=d,x[h+4]=h+9,x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,x[(h+=9)+0]=-1,x[h+1]=x[s+1]+d,x[h+2]=x[s+2]+d,x[h+3]=d,x[h+4]=x[s+4],x[h+5]=-1,x[h+6]=0,x[h+7]=0,x[h+8]=0,o+=4,L=n[x[s+0]+0]<x[s+1]?n[x[s+0]+1]<x[s+2]?x[s+5]:x[s+5]+9:n[x[s+0]+1]<x[s+2]?x[s+5]+18:x[s+5]+27,x[s+6]=n[x[s+0]+6],x[s+7]=n[x[s+0]+0],x[s+8]=n[x[s+0]+1],x[L+0]=x[s+0],x[s+0]=-1,L===(I=n[i+0]<x[s+1]?n[i+1]<x[s+2]?x[s+5]:x[s+5]+9:n[i+1]<x[s+2]?x[s+5]+18:x[s+5]+27)){if(R--){s=L;continue}R=3;break}x[I+0]=i;break}L=n[i+0]<x[s+1]?n[i+1]<x[s+2]?x[s+5]:x[s+5]+9:n[i+1]<x[s+2]?x[s+5]+18:x[s+5]+27,x[s+7]=(x[s+7]*x[s+6]+n[i+0]*n[i+6])/(x[s+6]+n[i+6]),x[s+8]=(x[s+8]*x[s+6]+n[i+1]*n[i+6])/(x[s+6]+n[i+6]),x[s+6]+=n[i+6],s=L}}if(e.barnesHutOptimize){for(f=e.scalingRatio,i=0;i<P;i+=t)for(s=0;;)if(x[s+5]>=0){if(w=Math.pow(n[i+0]-x[s+7],2)+Math.pow(n[i+1]-x[s+8],2),4*(p=x[s+3])*p/w<$){if(g=n[i+0]-x[s+7],y=n[i+1]-x[s+8],!0===N?w>0?(v=f*n[i+6]*x[s+6]/w,n[i+2]+=g*v,n[i+3]+=y*v):w<0&&(v=-f*n[i+6]*x[s+6]/Math.sqrt(w),n[i+2]+=g*v,n[i+3]+=y*v):w>0&&(v=f*n[i+6]*x[s+6]/w,n[i+2]+=g*v,n[i+3]+=y*v),(s=x[s+4])<0)break;continue}s=x[s+5]}else if((l=x[s+0])>=0&&l!==i&&(w=(g=n[i+0]-n[l+0])*g+(y=n[i+1]-n[l+1])*y,!0===N?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)),(s=x[s+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===N?(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<M;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===N?(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===N)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])),C=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,T=.1*Math.log(1+C)/(1+Math.sqrt(E)),S=n[i+0]+n[i+2]*(T/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(T/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])),C=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,T=n[i+7]*Math.log(1+C)/(1+Math.sqrt(E)),n[i+7]=Math.min(1,Math.sqrt(T*(Math.pow(n[i+2],2)+Math.pow(n[i+3],2))/(1+Math.sqrt(E)))),S=n[i+0]+n[i+2]*(T/e.slowDown),n[i+0]=S,_=n[i+1]+n[i+3]*(T/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 o=function(t){return r(t[e])},s=function(){return r(void 0)};return"string"==typeof e?(n.fromAttributes=o,n.fromGraph=function(e,t){return o(e.getEdgeAttributes(t))},n.fromEntry=function(e,t){return o(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 o=t.extremities(n);return r(e(n,t.getEdgeAttributes(n),o[0],o[1],t.getNodeAttributes(o[0]),t.getNodeAttributes(o[1]),t.isUndirected(n)))},n.fromEntry=function(t,n,o,s,i,a,c){return r(e(t,n,o,s,i,a,c))},n.fromPartialEntry=function(t,n,o,s){return r(e(t,n,o,s))},n.fromMinimalEntry=function(t,n){return r(e(t,n))}):(n.fromAttributes=s,n.fromGraph=s,n.fromEntry=s,n.fromMinimalEntry=s),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 o(e,t,n){return o=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 o=[null];o.push.apply(o,t);var s=new(Function.bind.apply(e,o));return n&&r(s,n.prototype),s},o.apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(s=e,-1===Function.toString.call(s).indexOf("[native code]")))return e;var s;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 o(e,arguments,n(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),r(i,e)},s(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 o=e._nodes.get(t),s=null;return o?s="mixed"===r?o.out&&o.out[n]||o.undirected&&o.undirected[n]:"directed"===r?o.out&&o.out[n]:o.undirected&&o.undirected[n]:s}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 o(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}N(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&N(e,"error",t,{once:!0})}(e,o)}))},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 C(e,t,n,r){var o,s,i,a;if(A(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),i=s[t]),void 0===i)i=s[t]=n,++e._eventsCount;else if("function"==typeof i?i=s[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(o=E(e))>0&&i.length>o&&!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 T(){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},o=T.bind(r);return o.listener=n,r.wrapFn=o,o}function _(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]: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}(o):M(o,o.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 M(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function N(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 o(s){r.once&&e.removeEventListener(t,o),n(s)}))}}function $(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,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var i=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw i.context=s,i}var a=o[e];if(void 0===a)return!1;if("function"==typeof a)y(a,this,t);else{var c=a.length,l=M(a,c);for(n=0;n<c;++n)y(l[n],this,t)}return!0},w.prototype.addListener=function(e,t){return C(this,e,t,!1)},w.prototype.on=w.prototype.addListener,w.prototype.prependListener=function(e,t){return C(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,o,s,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(o=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){i=n[s].listener,o=s;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),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 o,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(o=s[r])&&this.removeAllListeners(o);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&&($.prototype[Symbol.iterator]=function(){return this}),$.of=function(){var e=arguments,t=e.length,n=0;return new $((function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}}))},$.empty=function(){return new $((function(){return{done:!0}}))},$.fromSequence=function(e){var t=0,n=e.length;return new $((function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}}))},$.is=function(e){return e instanceof $||"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=x,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,o=r!==1/0?new Array(r):[],s=0,i=D(e);;){if(s===r)return o;if((n=i.next()).done)return s!==t&&(o.length=s),o;o[s++]=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}(s(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,o){this.key=t,this.attributes=o,this.undirected=e,this.source=n,this.target=r}function q(e,t,n,r,o,s,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=o,u=s}else if(3===n){if(o=""+o,!(c=e._edges.get(o)))throw new U("Graph.".concat(t,': could not find the "').concat(o,'" 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(o,'" edge (').concat(d,", ").concat(h,")."));a=c.source}l=s,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=o,u=s}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 o=this.source[e],s=o[r];if(void 0===s)return o[r]=this,void(this.undirected&&n===r||(this.target[t][n]=this));s.previous=this,this.next=s,o[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o,s){var i=q(this,t,n,e,r,o,s),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,o,s){var i=q(this,t,n,e,r,o,s),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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],c=s[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,o){var s=q(this,t,n,e,r,o),i=s[0],a=s[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 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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(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]}}},{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 o=""+e,s=""+arguments[1];if(!(r=c(this,o,s,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(o,'" - "').concat(s,'").'))}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 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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return o.attributes.hasOwnProperty(r)}}},{name:function(e){return"set".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,o){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>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],o=arguments[3],!(s=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,!(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]=o,this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:r}),this}}},{name:function(e){return"update".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r,o){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>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],o=arguments[3],!(s=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,!(s=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}if("function"!=typeof o)throw new V("Graph.".concat(t,": updater should be a function."));return s.attributes[r]=o(s.attributes[r]),this.emit("edgeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:r}),this}}},{name:function(e){return"remove".concat(e,"Attribute")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=this._edges.get(e)))throw new U("Graph.".concat(t,': could not find the "').concat(e,'" edge in the graph.'))}return delete o.attributes[r],this.emit("edgeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:r}),this}}},{name:function(e){return"replace".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=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 o.attributes=r,this.emit("edgeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}},{name:function(e){return"merge".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=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(o.attributes,r),this.emit("edgeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:r}),this}}},{name:function(e){return"update".concat(e,"Attributes")},attacher:function(e,t,n){e.prototype[t]=function(e,r){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>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 s=""+e,i=""+r;if(r=arguments[2],!(o=c(this,s,i,n)))throw new U("Graph.".concat(t,': could not find an edge for the given path ("').concat(s,'" - "').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,!(o=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 o.attributes=r(o.attributes),this.emit("edgeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}}],X=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 o=!1;for(var s in t)if(s!==r){var i=t[s];if(o=n(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),e&&o)return i.key}}function ne(e,t,n,r){var o,s,i,a=!1;for(var c in t)if(c!==r){o=t[c];do{if(s=o.source,i=o.target,a=n(o.key,o.attributes,s.key,i.key,s.attributes,i.attributes,o.undirected),e&&a)return o.key;o=o.next}while(void 0!==o)}}function re(e,t){var n,r=Object.keys(e),o=r.length,s=0;return new x((function(){do{if(n)n=n.next;else{if(s>=o)return{done:!0};var i=r[s++];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 oe(e,t,n,r){var o=t[n];if(o){var s=o.source,i=o.target;return r(o.key,o.attributes,s.key,i.key,s.attributes,i.attributes,o.undirected)&&e?o.key:void 0}}function se(e,t,n,r){var o=t[n];if(o){var s=!1;do{if(s=r(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),e&&s)return o.key;o=o.next}while(void 0!==o)}}function ie(e,t){var n=e[t];return void 0!==n.next?new x((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}})):x.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 o,s,i="mixed"!==n&&n!==t.type,a="undirected"===n,c=!1,l=t._edges.values();!0!==(o=l.next()).done;)if(s=o.value,!i||s.undirected===a){var u=s,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,s.undirected),e&&c)return d}}function ce(e,t,n,r,o,s){var i,a=t?ne:te;if("undirected"!==n){if("out"!==r&&(i=a(e,o.in,s),e&&i))return i;if("in"!==r&&(i=a(e,o.out,s,r?void 0:o.key),e&&i))return i}if("directed"!==n&&(i=a(e,o.undirected,s),e&&i))return i}function le(e,t,n,r,o,s,i){var a,c=n?se:oe;if("undirected"!==t){if(void 0!==o.in&&"out"!==r&&(a=c(e,o.in,s,i),e&&a))return a;if(void 0!==o.out&&"in"!==r&&(r||o.key!==s)&&(a=c(e,o.out,s,i),e&&a))return a}if("directed"!==t&&void 0!==o.undirected&&(a=c(e,o.undirected,s,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,o){for(var s in r){var i=r[s],a=i.source,c=i.target,l=a===n?c:a;if(!t||!t.has(l.key)){var u=o(l.key,l.attributes);if(e&&u)return l.key}}}function pe(e,t,n,r,o){if("mixed"!==t){if("undirected"===t)return he(e,null,r,r.undirected,o);if("string"==typeof n)return he(e,null,r,r[n],o)}var s,i=new de;if("undirected"!==t){if("out"!==n){if(s=he(e,null,r,r.in,o),e&&s)return s;i.wrap(r.in)}if("in"!==n){if(s=he(e,i,r,r.out,o),e&&s)return s;i.wrap(r.out)}}if("directed"!==t&&(s=he(e,i,r,r.undirected,o),e&&s))return s}function me(e,t,n){var r=Object.keys(n),o=r.length,s=0;return new x((function(){var i=null;do{if(s>=o)return e&&e.wrap(n),{done:!0};var a=n[r[s++]],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,o){for(var s,i,a,c,l,u,d,h=r._nodes.values(),p=r.type;!0!==(s=h.next()).done;){var m=!1;if(i=s.value,"undirected"!==p)for(a in c=i.out){l=c[a];do{if(u=l.target,m=!0,d=o(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=o(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=o(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 Ce(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 Te(e,t,n,r,o,s,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(s=""+s,i=""+i,a=a||{},!e.allowSelfLoops&&s===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var c=e._nodes.get(s),u=e._nodes.get(i);if(!c)throw new U("Graph.".concat(t,': source node "').concat(s,'" not found.'));if(!u)throw new U("Graph.".concat(t,': target node "').concat(i,'" not found.'));var d={key:null,undirected:r,source:s,target:i,attributes:a};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new Y("Graph.".concat(t,': the "').concat(o,'" 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(s,'" 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,o,c,u,a);e._edges.set(o,h);var p=s===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=o,e.emit("edgeAdded",d),o}function Se(e,t,n,r,o,s,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(s=""+s,i=""+i,u&&(d=c,c=void 0),!e.allowSelfLoops&&s===i)throw new Y("Graph.".concat(t,': source & target are the same ("').concat(s,"\"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false."));var h,p,m=e._nodes.get(s),f=e._nodes.get(i);if(!n&&(h=e._edges.get(o))){if(!(h.source.key===s&&h.target.key===i||r&&h.source.key===i&&h.target.key===s))throw new Y("Graph.".concat(t,': inconsistency detected when attempting to merge the "').concat(o,'" edge with "').concat(s,'" 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:s,target:i,attributes:c};if(n)o=e._edgeKeyGenerator();else if(o=""+o,e._edges.has(o))throw new Y("Graph.".concat(t,': the "').concat(o,'" edge already exists in the graph.'));var w=!1,v=!1;m||(m=Ce(e,s,{}),w=!0,s===i&&(f=m,v=!0)),f||(f=Ce(e,i,{}),v=!0),h=new K(r,o,m,f,c),e._edges.set(o,h);var A=s===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=o,e.emit("edgeAdded",b),[o,!0,w,v]}function _e(e,t){e._edges.delete(t.key);var n=t.source,r=t.target,o=t.attributes,s=t.undirected,i=n===r;s?(n.undirectedDegree--,r.undirectedDegree--,i&&(n.undirectedLoops--,e._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,i&&(n.directedLoops--,e._directedSelfLoopCount--)),e.multi?t.detachMulti():t.detach(),s?e._undirectedSize--:e._directedSize--,e.emit("edgeDropped",{key:t.key,attributes:o,source:n.key,target:r.key,undirected:s})}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 o="geid_"+we()+"_",s=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=o+s++}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 o=r.prototype;return o._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},o.hasNode=function(e){return this._nodes.has(""+e)},o.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 o=this._nodes.get(e);return!!o&&o.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."))},o.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 o=this._nodes.get(e);return!!o&&o.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."))},o.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."))},o.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}},o.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}},o.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},o.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)},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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},o.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]},o.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,o=n.target.key;if(e===r)return o;if(e===o)return r;throw new U('Graph.opposite: the "'.concat(e,'" node is not attached to the "').concat(t,'" edge (').concat(r,", ").concat(o,")."))},o.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},o.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},o.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},o.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},o.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},o.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])},o.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 o=t?t({}):{};return n=new this.NodeDataClass(e,o),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:o}),[e,!0]},o.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 o in n.in){t=n.in[o];do{_e(this,t),t=t.next}while(t)}}if("directed"!==this.type)for(var s in n.undirected){t=n.undirected[s];do{_e(this,t),t=t.next}while(t)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})},o.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},o.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},o.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},o.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},o.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")},o.getAttribute=function(e){return this._attributes[e]},o.getAttributes=function(){return this._attributes},o.hasAttribute=function(e){return this._attributes.hasOwnProperty(e)},o.setAttribute=function(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this},o.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},o.removeAttribute=function(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this},o.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},o.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},o.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},o.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,o=this._nodes.values();!0!==(n=o.next()).done;)(r=n.value).attributes=e(r.key,r.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})},o.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,o,s,i=this._edges.values();!0!==(n=i.next()).done;)o=(r=n.value).source,s=r.target,r.attributes=e(r.key,r.attributes,o.key,s.key,o.attributes,s.attributes,r.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})},o.forEachAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntry: expecting a callback.");fe(!1,!1,!1,this,e)},o.forEachAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!1,!0,this,e)},o.forEachAssymetricAdjacencyEntry=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");fe(!1,!0,!1,this,e)},o.forEachAssymetricAdjacencyEntryWithOrphans=function(e){if("function"!=typeof e)throw new V("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");fe(!1,!0,!0,this,e)},o.nodes=function(){return"function"==typeof Array.from?Array.from(this._nodes.keys()):H(this._nodes.keys(),this._nodes.size)},o.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)},o.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},o.mapNodes=function(e){if("function"!=typeof e)throw new V("Graph.mapNode: expecting a callback.");for(var t,n,r=this._nodes.values(),o=new Array(this.order),s=0;!0!==(t=r.next()).done;)n=t.value,o[s++]=e(n.key,n.attributes);return o},o.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},o.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},o.filterNodes=function(e){if("function"!=typeof e)throw new V("Graph.filterNodes: expecting a callback.");for(var t,n,r=this._nodes.values(),o=[];!0!==(t=r.next()).done;)e((n=t.value).key,n.attributes)&&o.push(n.key);return o},o.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,o=t,s=this._nodes.values();!0!==(n=s.next()).done;)o=e(o,(r=n.value).key,r.attributes);return o},o.nodeEntries=function(){var e=this._nodes.values();return new x((function(){var t=e.next();if(t.done)return t;var n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}}))},o.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,o){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,o,t)})),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:t,edges:r}},o.import=function(e){var t,n,o,s,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,o,s,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(o=e.nodes,!Array.isArray(o))throw new V("Graph.import: invalid nodes. Expecting an array.");for(t=0,n=o.length;t<n;t++){ge(s=o[t]);var u=s,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),o=e.edges,!Array.isArray(o))throw new V("Graph.import: invalid edges. Expecting an array.");for(t=0,n=o.length;t<n;t++){ye(i=o[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},o.nullCopy=function(e){var t=new r(a({},this._options,e));return t.replaceAttributes(a({},this.getAttributes())),t},o.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},o.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),o=this._edges.values();!0!==(t=o.next()).done;)Te(r,"copy",!1,(n=t.value).undirected,n.key,n.source.key,n.target.key,a({},n.attributes));return r},o.toJSON=function(){return this.export()},o.toString=function(){return"[object Graph]"},o.inspect=function(){var t=this,n={};this._nodes.forEach((function(e,t){n[t]=e.attributes}));var r={},o={};this._edges.forEach((function(e,n){var s,i=e.undirected?"--":"->",a="",c=e.source.key,l=e.target.key;e.undirected&&c>l&&(s=c,c=l,l=s);var u="(".concat(c,")").concat(i,"(").concat(l,")");n.startsWith("geid_")?t.multi&&(void 0===o[u]?o[u]=0:o[u]++,a+="".concat(o[u],". ")):a+="[".concat(n,"]: "),r[a+=u]=e.attributes}));var s={};for(var i in this)this.hasOwnProperty(i)&&!Ae.has(i)&&"function"!=typeof this[i]&&"symbol"!==e(i)&&(s[i]=this[i]);return s.attributes=this._attributes,s.nodes=n,s.edges=r,d(s,"constructor",this.constructor),s},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?Te:Se;e.generateKey?Pe.prototype[n]=function(o,s,i){return r(this,n,!0,"undirected"===(e.type||this.type),null,o,s,i,"update"===t)}:Pe.prototype[n]=function(o,s,i,a){return r(this,n,!1,"undirected"===(e.type||this.type),o,s,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,o=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,o="undirected"===t?e.undirectedSize:e.directedSize,s=new Array(o),i="undirected"===t,a=e._edges.values(),c=0;!0!==(n=a.next()).done;)(r=n.value).undirected===i&&(s[c++]=r.key);return s}(this,r);if(1===arguments.length){e=""+e;var s=this._nodes.get(e);if(void 0===s)throw new U("Graph.".concat(n,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n,r){var o=[];return ce(!1,e,t,n,r,(function(e){o.push(e)})),o}(this.multi,"mixed"===r?this.type:r,o,s)}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,o){var s=[];return le(!1,e,t,n,r,o,(function(e){s.push(e)})),s}(r,this.multi,o,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,o=t.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=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(s,': could not find the "').concat(e,'" node in the graph.'));return ce(!1,this.multi,"mixed"===r?this.type:r,o,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(s,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(s,': could not find the "').concat(t,'" target node in the graph.'));return le(!1,r,this.multi,o,a,t,n)}throw new V("Graph.".concat(s,": 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 o=0;"directed"!==r&&(o+=this.undirectedSize),"undirected"!==r&&(o+=this.directedSize),e=new Array(o);var i=0;t.push((function(t,r,o,s,a,c,l){e[i++]=n(t,r,o,s,a,c,l)}))}else e=[],t.push((function(t,r,o,s,i,a,c){e.push(n(t,r,o,s,i,a,c))}));return this[s].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,o,s,i,a,c){t(e,r,o,s,i,a,c)&&n.push(e)})),this[s].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,o,s,i,a,c){r=e(r,t,n,o,s,i,a,c)})),this[s].apply(this,n),r}}(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s="find"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=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(s,': could not find the "').concat(e,'" node in the graph.'));return ce(!0,this.multi,"mixed"===r?this.type:r,o,i,n)}if(3===arguments.length){e=""+e,t=""+t;var a=this._nodes.get(e);if(!a)throw new U("Graph.".concat(s,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(s,': could not find the "').concat(t,'" target node in the graph.'));return le(!0,r,this.multi,o,a,t,n)}throw new V("Graph.".concat(s,": 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,o,s,i,a){return t(e,n,r,o,s,i,a)})),!!this[s].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,o,s,i,a){return!t(e,n,r,o,s,i,a)})),!this[s].apply(this,e)}}(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(e,t){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return x.empty();if(!arguments.length)return function(e,t){if(0===e.size)return x.empty();var n="mixed"!==t&&t!==e.type,r="undirected"===t,o=e._edges.values();return new x((function(){for(var e,t;;){if((e=o.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(s,': could not find the "').concat(e,'" node in the graph.'));return function(e,t,n){var r=x.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,o,n)}if(2===arguments.length){e=""+e,t=""+t;var i=this._nodes.get(e);if(!i)throw new U("Graph.".concat(s,': could not find the "').concat(e,'" source node in the graph.'));if(!this._nodes.has(t))throw new U("Graph.".concat(s,': could not find the "').concat(t,'" target node in the graph.'));return function(e,t,n,r){var o=x.empty();return"undirected"!==e&&(void 0!==n.in&&"out"!==t&&r in n.in&&(o=J(o,ie(n.in,r))),void 0!==n.out&&"in"!==t&&r in n.out&&(t||n.key!==r)&&(o=J(o,ie(n.out,r)))),"directed"!==e&&void 0!==n.undirected&&r in n.undirected&&(o=J(o,ie(n.undirected,r))),o}(r,o,i,t)}throw new V("Graph.".concat(s,": 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,o=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,o,t)}})(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);e.prototype[s]=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(s,': could not find the "').concat(e,'" node in the graph.'));pe(!1,"mixed"===r?this.type:r,o,n,t)}};var i="map"+n[0].toUpperCase()+n.slice(1);e.prototype[i]=function(e,t){var n=[];return this[s](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[s](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[s](e,(function(e,n){r=t(r,e,n)})),r}}(e,t),function(e,t){var n=t.name,r=t.type,o=t.direction,s=n[0].toUpperCase()+n.slice(1,-1),i="find"+s;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,o,n,t)}};var a="some"+s;e.prototype[a]=function(e,t){return!!this[i](e,t)};var c="every"+s;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,o=t.direction,s=n.slice(0,-1)+"Entries";e.prototype[s]=function(e){if("mixed"!==r&&"mixed"!==this.type&&r!==this.type)return x.empty();e=""+e;var t=this._nodes.get(e);if(void 0===t)throw new U("Graph.".concat(s,': 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=x.empty(),o=new de;return"undirected"!==e&&("out"!==t&&(r=J(r,me(o,n,n.in))),"in"!==t&&(r=J(r,me(o,n,n.out)))),"directed"!==e&&(r=J(r,me(o,n,n.undirected))),r}("mixed"===r?this.type:r,o,t)}}(e,t)}))}(Pe);var Me=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),Ne=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),$e=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),xe=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),o=new e(r);return o.import(t),o}}return Ie(Pe),Ie(Me),Ie(Ne),Ie($e),Ie(xe),Ie(Le),Pe.Graph=Pe,Pe.DirectedGraph=Me,Pe.UndirectedGraph=Ne,Pe.MultiGraph=$e,Pe.MultiDirectedGraph=xe,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,o=e.length,s=t.length,i=Math.floor(Math.max(o,s)/2)-1,a=new Array(o),c=new Array(s),l=0;l<o;l++)for(var u=Math.max(0,l-i);u<=Math.min(s,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<o;l++)if(a[l]){for(;!c[h];)h++;e.charAt(l)!==t.charAt(h++)&&d++}return(r/o+r/s+(r-(d/=2))/r)/3}(e,t,n),o=0;if(r>.7){for(var s=Math.min(e.length,t.length),i=0;e[i]===t[i]&&i<4&&i<s;)++o,i++;r+=.1*o*(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,o,s,i,a,c,l,u,d){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in r(s,i,a,c,l,u,d),s){var p=s[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var m=0;m<p.length;m++)n(e,r,o,p[m],i+"/"+h+"/"+m,a,i,h,s,m)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var f in p)n(e,r,o,p[f],i+"/"+h+"/"+f.replace(/~/g,"~0").replace(/\//g,"~1"),a,i,h,s,f)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&n(e,r,o,p,i+"/"+h,a,i,h,s)}o(s,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 s={},i=[],a=0;a<e.length;a++){var c=e[a],l=r.base?c[0]+r.base:c[0],u=s[l]||0,d="".concat(l," ").concat(u);s[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=o(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:m,references:1})}i.push(d)}return i}function o(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,o){var s=r(e=e||[],o=o||{});return function(e){e=e||[];for(var i=0;i<s.length;i++){var a=n(s[i]);t[a].references--}for(var c=r(e,o),l=0;l<s.length;l++){var u=n(s[l]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}s=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 o=void 0!==n.layer;o&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,o&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),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))}}},6723:(e,t,n)=>{"use strict";n.d(t,{_package:()=>je,getMonomerLibHelper:()=>Ke});var r,o,s=n(4328),i=n(7389),a=n(6082);n(684),n(9039),(o=r||(r={})).EUCLIDEAN="EUCLIDEAN",o.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,n(2780),Promise.resolve(),n(934),n(8903),a.SEMTYPE.MOLECULE,a.SEMTYPE.MACROMOLECULE;var C=n(9713);n(6295);var T,S,_,P,M,N,$=n(8774);(_=T||(T={})).none="none",_.bold="bold",_.dashed="dashed",(P=S||(S={})).EUCLIDEAN="EUCLIDEAN",P.MANHATTAN="MANHATTAN",S.EUCLIDEAN,S.MANHATTAN,(N=M||(M={})).HAMMING="Hamming",N.EUCLIDEAN="Euclidean",N.VECTOR_COSINE="Vector Cosine",N.MANHATTAN="Manhattan",N.TANIMOTO="Tanimoto",N.LEVENSTEIN="Levenshtein",N.NEEDLEMAN_WUNSCH="Needlemann-Wunsch",N.MONOMER_CHEMICAL_DISTANCE="Monomer chemical distance",N.SOKAL="Sokal",N.COSINE="Cosine",N.ASYMMETRIC="Asymmetric",N.Difference="Difference",N.OneHot="One-Hot",M.HAMMING,M.EUCLIDEAN,M.MANHATTAN,M.VECTOR_COSINE,M.TANIMOTO,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.MONOMER_CHEMICAL_DISTANCE,M.SOKAL,M.COSINE,M.ASYMMETRIC,M.Difference,M.OneHot,M.HAMMING,M.EUCLIDEAN,M.MANHATTAN,M.TANIMOTO,M.SOKAL,M.COSINE,M.ASYMMETRIC,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.MONOMER_CHEMICAL_DISTANCE,M.Difference,M.OneHot,M.VECTOR_COSINE,new Set([M.HAMMING,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.MONOMER_CHEMICAL_DISTANCE,M.OneHot]),new Set([M.HAMMING,M.EUCLIDEAN,M.MANHATTAN,M.MONOMER_CHEMICAL_DISTANCE,M.LEVENSTEIN,M.NEEDLEMAN_WUNSCH,M.TANIMOTO,M.COSINE,M.VECTOR_COSINE,M.SOKAL,M.ASYMMETRIC,M.OneHot,M.Difference]),new Set([M.EUCLIDEAN,M.MANHATTAN,M.OneHot,M.Difference,M.VECTOR_COSINE]),new Set([M.EUCLIDEAN,M.MANHATTAN,M.Difference,M.VECTOR_COSINE]),new Set([M.EUCLIDEAN,M.MANHATTAN,M.Difference]),new Set([M.TANIMOTO,M.COSINE,M.SOKAL,M.ASYMMETRIC]);var x=n(1991),L=n.n(x);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(5553),n(6642)),U=n(3599);n(673),n(8312),V.sD,n(4139),new class{constructor(){this.seqHandler="seq-handler",this.notationProvider="seq-handler.notation-provider"}},a.SemanticValue,D.zS,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(250),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(4954),a.JsViewer,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 o=0;o<this.atomCount;o++){r=this.shiftIdxToXColumn(r);for(const s of[e,t,n])s[o]=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])),o=n.map((e=>t[e+1]));r.forEach(((t,n)=>{const r=parseInt(t.split(/\s+/)[1])-1,s=parseInt(o[n].substring(1));if(e.has(s))throw new Error(`R group ${s} is already in the map`);e.set(s,r)}));const s=this.getRGroupAtomicIndices().filter((t=>!Array.from(e.values()).includes(t)));if(0!==s.length)throw new Error(`Unaccounted R group indices: ${s}`);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 o=t[1];if(e.has(o))throw new Error(`R group ${o} is already in the map`);e.set(o,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 oe{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,o=void 0,s=void 0,i){if(this.biotype=e,this.id=t,this.n=n,this.m=r,this.type=o,this.mt=s,this.smiles=i,!this.id)throw new Error("Invalid arg undefined [id].")}static objCounter=-1;objId=++oe.objCounter;className="WebEditorMonomerDummy";toLog(){return`Helm: ${this.className}<${this.objId}>`}}class se extends oe{backgroundcolor="#FFFFFF";linecolor="#808080";textcolor="#808080";constructor(e){super(e,"*","gap")}}class ie extends oe{backgroundcolor="#808080";linecolor="#000000";textcolor="#000000";constructor(e,t){super(e,t,"ambiguous")}}class ae extends oe{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 oe{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,o,s,i,a){this.id=e,this.m=t,this.n=n,this.na=r,this.type=o,this.mt=s,this.at=i,this.smiles=a}static fromMonomer(e,t,n){let r={};const o=t.symbol,s=t.smiles;if(t.rgroups.length>0)t.rgroups.forEach((e=>{r[e.label]=e.capGroupName}));else{if(!s){if(t.lib)return new ce(e,o);throw new Error("Unexpected missing monomer without .lib")}r=n.getRS(s)}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=e=>{const t=i.canvas(250,250);return s.chem.canvasMol(0,0,250,250,t,e),t},me=new ne.Mi([255,255,255]),fe=new ne.Mi([0,0,0]),ge=.7*(0,re.wQ)(me);class ye{_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));for(const[e,t]of Object.entries(this._monomers))for(const[e,n]of Object.entries(t))n.lib=this}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{je.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),o=(0,ee.Y)(n);let s=this.getMonomer(o,r);if(s&&n==U.o.LINKER&&2!=s.rgroups.length)return null;if(s&&n==U.o.SUGAR&&3!=s.rgroups.length)return null;s||(s=this.addMissingMonomer(o,r));let i=s.wem??null;return i||(r===H._S||"*"==r?i=s.wem=new se(n):n===U.o.NUCLEOTIDE&&"N"===r||n===U.o.AA&&"X"===r||(U.o.CHEM,0)||he.test(r)?i=s.wem=new ie(n,r):s.lib||(i=s.wem=new ae(n,r,this.isEmpty)),i||(i=s.wem=le.fromMonomer(n,s,this))),i}getTooltip(e,t){const n=(0,ee.Y)(e),r=i.div([],{classes:"ui-form ui-tooltip"}),o=this.getWebEditorMonomer(e,t),s=this.getMonomer(n,t);if(s){const e=s.symbol,[t,n,a]=(s.name,o?[o.textcolor,o.backgroundcolor,o.linecolor]:["#202020","#A0A0A0","#202020"]);let c;if(r.append(i.divH([i.div([e],{style:{textWrap:"nowrap",marginLeft:"4px",marginRight:"4px",color:t,backgroundColor:n,borderColor:a,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"}})),c=s.molfile?pe(s.molfile):s.smiles?i.divV([pe(s.smiles),i.divText("from smiles",{style:{fontSize:"smaller"}})]):i.divText("No structure",{style:{margin:"6px"}}),r.append(i.div(c,{style:{display:"flex",flexDirection:"row",justifyContent:"center",margin:"6px"}})),s.symbol!=H._S){let e=s.lib?.source;e?(e.endsWith(".json")&&(e=e.substring(0,e.length-5)),e=e.replace(/_/g," ").replace(/-/g," ").replace(/([a-z])([a-z])([A-Z])/g,"$1$2 $3"),r.append(i.divText(e))):r.append(i.divText("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)]},o=r(n.textcolor),s=new ne.Mi([...o.map((e=>e+1))]),i=(0,re.KE)(s,me)/((0,re.wQ)(s)*(0,re.wQ)(me)),c=r(n.backgroundcolor),l=new ne.Mi([...c.map((e=>e+.01))]);let u;u=(0,re.KE)(l,me)/((0,re.wQ)(l)*(0,re.wQ)(me))<i?c:o;let d=new ne.Mi(u);const h=(0,re.wQ)(d);return h>ge&&(d=(0,re.dC)(fe,d,ge/h)),`rgb(${d[0]}, ${d[1]}, ${d[2]})`}getMonomerColors(e,t){const n="default";let r=n;const o=(0,ee.Y)(e),s=this.getMonomer(o,t);let i;if(s){if(s.meta&&s.meta.colors){const e=s.meta.colors;n in e||(r="default"),i=e[r]}if(!i){const t=ue[e],n=t?.[s.symbol];n&&(i={textColor:a.Color.toHtml(a.Color.getContrastColor(a.Color.fromHtml(n))),lineColor:"#202020",backgroundColor:n})}const t=s.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,o="";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]&&(o+=t[e][n]);n["R"+r]=o,o=""}return n}}var be=n(5488),we={};we.styleTagTransform=v(),we.setAttributes=g(),we.insert=m().bind(null,"head"),we.domAPI=h(),we.insertStyleElement=b(),u()(be.A,we),be.A&&be.A.locals&&be.A.locals;class ve extends ye{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}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{je.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 o=e.duplicateMonomerPreferences[n][r],s=this.duplicateMonomers[n][r].find((e=>e.lib?.source===o));s?this._monomers[n][r]=s: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")}static overrideCounter=0;override(e,t){return new Ae(e,`override: ${++ve.overrideCounter}, ${t}`,this)}}class Ae extends ye{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 Ee=n(9192);class Ce{monomerLib;symbol;polymerType;monomerType;monomerLinks;monomers;error=null;constructor(e,t,n,r,o){this.monomerLib=e,this.symbol=t,this.polymerType=n,this.monomerType=r,this.monomerLinks=o;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,Ee.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 Se=n(7433),_e=n.n(Se),Pe=n(1913),Me=n.n(Pe);class Ne{helmMonomerSchema;validateMonomerSchema;constructor(e){this.helmMonomerSchema=e;const t=new(_e())({allErrors:!0,strictTuples:!1,allowUnionTypes:!0});Me()(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 o of e){const e=o.symbol??o.id??o.name??"#N/A";if(n=this.validateMonomerSchema(o),!n){console.warn(`Bio: Monomer Library File Validator file ${t}, monomer '${e}' violating JSON schema:`,o,"\nError reason: ",JSON.stringify(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 s=`${o.polymerType??""}-${e}`;r.has(s)&&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(s)}return n}}var $e=n(8604);class xe{fileValidator;libHelper;eventManager;logger;filesPromise=Promise.resolve();initializedPromise=Promise.resolve();constructor(e,t,n,r){let o;this.fileValidator=e,this.libHelper=t,this.eventManager=n,this.logger=r;let s=!1;this.initializedPromise=Promise.race([a.delay(1e3),new Promise((e=>o=e))]),this.eventManager.updateValidLibraryFileListRequested$.subscribe((()=>{this.updateValidLibList().then((()=>{})),s||(s=!0,o())})),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 s.dapi.files.readAsText($e.gt),o=JSON.parse(r),i=new Ne(o);return new xe(i,e,t,n)}async addLibraryFile(e,t,n=!0){try{if(await s.dapi.files.exists($e.so+`${t}`))return void s.shell.error(`File ${t} already exists`);await this.validateAgainstHELM(e,t),await s.dapi.files.writeAsText($e.so+`${t}`,e),await this.updateValidLibList(),await s.dapi.files.exists($e.so+`${t}`)?s.shell.info(`Added ${t} HELM library`):s.shell.error(`Failed to add ${t} library`)}catch(e){console.error(e),s.shell.error(`Failed to add ${t} library`)}}async deleteLibraryFile(e){try{await s.dapi.files.delete($e.so+`${e}`),await this.updateValidLibList(),s.shell.info(`Deleted ${e} library`)}catch(t){console.error(t),await s.dapi.files.exists($e.so+`${e}`)?s.shell.error(`Failed to delete ${e} library`):s.shell.warning(`File ${e} already deleted, refresh the list`)}}async loadLibraryFromFile(e,t){let n=[];const r=new a.FileSource(e),o=await r.readAsText(t);n=JSON.parse(o);const s={},i=[];return n.forEach((e=>{const t=e.polymerType,n=e.symbol;i.includes(t)||(s[t]={},i.push(t)),s[t][n]=e})),new ve(s,t)}async loadSetFromFile(e,t,n){let r={};const o=new a.FileSource(t),s=await o.readAsText(n);r=JSON.parse(s);const i=r.description,c=Object.entries(r.placeholders).map((([t,n])=>{const r=t,o=n.polymerType,s=n.monomerType,i=n.set;return new Ce(e,r,o,s,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 s.dapi.files.readAsText($e.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),await 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 ${$e.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 je.logger.debug(`${e}, start`),this.filesPromise=this.filesPromise.then((async()=>{je.logger.debug(`${e}, IN`);const t=[],n=await this.getSetFileListAtLocation();if(!this.setListHasChanged(n))return void je.logger.debug(`${e}, end, not changed`);for(const e of n)e.endsWith(".json")?await s.dapi.files.readAsText($e.Es+`${e}`):t.push(e);const r=n.filter((e=>!t.includes(e)));this.setListHasChanged(r)&&(this.eventManager.changeValidSetPathList(r),this.libHelper.loadMonomerSets(!0)),je.logger.debug(`${e}, OUT`)})),je.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 s.dapi.files.list($e.so).then((e=>e.filter((e=>e.isFile)).map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring($e.so.length)))}async getSetFileListAtLocation(){const e=`${this.toLog()}.getSetFileListAtLocation()`;this.logger.debug(`${e}, start`);const t=await s.dapi.files.list($e.Es).then((e=>e.map((e=>e.fullPath)))),n=[];return n.push(...t),n.map((e=>e.substring($e.Es.length)))}}class Le{constructor(){}static _instance;static getInstance(){return Le._instance||(Le._instance=new Le),Le._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,C.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 Ie{logger;_monomerLib=new ve({},"MAIN");_monomerSets=new Te("MAIN",[]);_initialLoadCompleted=!1;get initialLoadCompleted(){return this._initialLoadCompleted}_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(++Ie.objCounter>0)throw new Error("MonomerLibManager MUST be a singleton.");return Ie.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()=>{const e=await xe.create(this,this._eventManager,this.logger);return await e.initializedPromise,e})()),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)()]),o=t.filter((e=>{const t=!r.exclude.includes(e),n=0===r.explicit.length||r.explicit.includes(e);return t&&n}));let s=0;const i=o.length,[a]=await Promise.all([Promise.all(o.map((e=>this.readLibrary($e.so,e).catch((t=>{const n=`Loading monomers from '${e}' error: ${t instanceof Error?t.message:t.toString()}`;return new ve({},e,n)})).finally((()=>{n.update(Math.round(100*++s/i),`Loading monomers ${s}/${i}`)})))))]);this._monomerLib.updateLibs(a,e),this._initialLoadCompleted=!0}catch(e){const t=`Loading monomer libraries error: ${e instanceof Error?e.message:e.toString()}`;s.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 o=n.length,[s]=await Promise.all([Promise.all(n.map((t=>this.readSet($e.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/o),`Loading monomers ${r}/${o}`)})))))]);this._monomerSets.updateSets(s)}catch(e){const t=`Loading monomer sets error: ${e instanceof Error?e.message:e.toString()}`;s.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)($e.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 Ie(je.logger);return e._eventManager=Le.getInstance(),e})()),e}}n(1757);var Re=n(3017),Oe={};Oe.styleTagTransform=v(),Oe.setAttributes=g(),Oe.insert=m().bind(null,"head"),Oe.domAPI=h(),Oe.insertStyleElement=b(),u()(Re.A,Oe),Re.A&&Re.A.locals&&Re.A.locals,n(3151);new $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 $.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 ke,Ge=n(857),De={};De.styleTagTransform=v(),De.setAttributes=g(),De.insert=m().bind(null,"head"),De.domAPI=h(),De.insertStyleElement=b(),u()(Ge.A,De),Ge.A&&Ge.A.locals&&Ge.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"}(ke||(ke={})),ke.MONOMER,a.COLUMN_TYPE.STRING,ke.SYMBOL,a.COLUMN_TYPE.STRING,ke.NAME,a.COLUMN_TYPE.STRING,ke.R_GROUPS,a.COLUMN_TYPE.STRING,ke.MONOMER_TYPE,a.COLUMN_TYPE.STRING,ke.POLYMER_TYPE,a.COLUMN_TYPE.STRING,ke.NATURAL_ANALOG,a.COLUMN_TYPE.STRING,ke.AUTHOR,a.COLUMN_TYPE.STRING,ke.CREATE_DATE,a.COLUMN_TYPE.DATE_TIME,ke.ID,a.COLUMN_TYPE.INT,ke.META,a.COLUMN_TYPE.STRING,ke.SOURCE,a.COLUMN_TYPE.STRING;var He,Fe=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?o(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 Ve{_setBreadcrumbsInViewName(){var e,t;const n=["Home","Demo",...(null!==(e=this._path)&&void 0!==e?e:"").split("/")],r=i.breadcrumbs(n);if(r.onPathClick.subscribe((e=>Fe(this,void 0,void 0,(function*(){const t=e[e.length-1];if(t===r.path[r.path.length-1])return;const n=s.shell.browsePanel.mainTree.getOrCreateGroup("Apps").getOrCreateGroup("Demo");n.currentItem="Demo"===t?n:n.items.find((e=>e.text===t))})))),s.shell.v){if(0!==r.path.length&&"Home"===r.path[0]){const e=i.iconFA("home",(()=>{s.shell.v.close(),s.shell.v=a.View.createByType(a.VIEW_TYPE.HOME)}));e.classList.add("demo-breadcrumbs-home-element"),r.root.firstElementChild.replaceWith(e)}const e=null===(t=s.shell.v.ribbonMenu.root.parentElement)||void 0===t?void 0:t.getElementsByClassName("d4-ribbon-name")[0];e&&(e.textContent="",e.appendChild(r.root))}}constructor(e,t,n=!1,r){var o,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"),(()=>Fe(this,void 0,void 0,(function*(){return yield this._changeStopState()}))),"Play / pause"),this._restartBtn=i.button(i.iconFA("redo"),(()=>Fe(this,void 0,void 0,(function*(){return yield this._restartScript()}))),"Restart"),this._nextStepBtn=i.button(i.iconFA("play"),(()=>Fe(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.DEMO_PATH="apps/Tutorials/Demo",this.name=e,this.description=t,this._isAutomatic=n,this._autoStartFirstStep=null!==(o=null==r?void 0:r.autoStartFirstStep)&&void 0!==o&&o,this._path=null!==(s=null==r?void 0:r.path)&&void 0!==s?s:"",this._progress.max=0,this._progress.value=1,Ve.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"),o=i.div(null===(e=this._steps[t].options)||void 0===e?void 0:e.description,"grok-tutorial-step-description hidden"),s=i.divH([n,r],"grok-tutorial-entry");this._activity.append(s,o)}}_initRoot(){s.shell.windows.showContextPanel=!0,s.shell.windows.showHelp=!1,this._node=s.shell.dockManager.dock(this._root,a.DOCK_TYPE.FILL,s.shell.dockManager.findNode(s.shell.browsePanel.root),this.name),this._node.container.containerElement.classList.add("tutorials-demo-script-container"),this._addHeader(),this._root.append(this._mainHeader),this._addDescription(),this._root.append(this._activity)}_setViewParams(){var e;s.shell.v&&(s.shell.v.name=this.name,s.shell.v.path=`${this.DEMO_PATH}/${(null!==(e=this._path)&&void 0!==e?e:"").replaceAll(" ","-")}`,this._setBreadcrumbsInViewName())}_nextStep(){return Fe(this,void 0,void 0,(function*(){var e,t;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],o=this._activity.getElementsByClassName("grok-tutorial-step-description")[this._currentStep];r.className="grok-icon far fa-spinner-third fa-spin",o.classList.remove("hidden"),o.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{this._setViewParams(),yield this._steps[this._currentStep].func(),this._setViewParams()}catch(e){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){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")}s.shell.v instanceof a.TableView&&(yield s.data.detectSemanticTypes(s.shell.tv.dataFrame))}else this._isAutomatic?this._stopStartBtn.replaceWith(this._restartBtn):this._nextStepBtn.replaceWith(this._restartBtn)}))}_startScript(){return Fe(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 Fe(this,void 0,void 0,(function*(){const r=i.div([],"demo-script-countdown");t.classList.add("hidden");let o=n/1e3;const s=this._createSVGIndicator(o);r.append(s),e.prepend(r);const a=setInterval((()=>{o--,0===o&&(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 Fe(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 Fe(this,void 0,void 0,(function*(){s.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(){s.shell.dockManager.close(this._node),this.cancelScript()}cancelScript(){this._isCancelled=!0,Ve.currentObject=null}step(e,t,n){return this._steps[this.steps.length]={name:e,func:t,options:n},this}start(){return Fe(this,void 0,void 0,(function*(){this._initRoot(),s.shell.v.name===this.name&&(s.shell.v.close(),this._node=s.shell.dockManager.dock(this._root,a.DOCK_TYPE.FILL,s.shell.dockManager.findNode(s.shell.browsePanel.root),this.name)),this._isAutomatic?yield this._startScript():this._autoStartFirstStep&&(yield this._nextStep())}))}}Ve.currentObject=null,function(e){e.X="Embed_X",e.Y="Embed_Y"}(He||(He={})),n(966),n(608),n(1619),n(6869),new class{tooltipHandlerTemp="tooltip-handler.Monomer"},a.GridCellRenderer;class Ue{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 Ye 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 Ue(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,Ee.AP)(e);s.shell.error(t),this.logger.error(t,void 0,n)}}var Be=n(5999),We={};We.styleTagTransform=v(),We.setAttributes=g(),We.insert=m().bind(null,"head"),We.domAPI=h(),We.insertStyleElement=b(),u()(Be.A,We),Be.A&&Be.A.locals&&Be.A.locals,n(6307),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(294),n(330),OCL,n(6956),new Map;new a.LruCache(100),new a.LruCache(100);const je=new Ye;async function Ke(){return await Ie.getInstance()}},4954:(e,t,n)=>{"use strict";n.d(t,{if:()=>h,nI:()=>d});var r=n(4328),o=(n(7389),n(6082)),s=n(8070),i=n(2003),a=n(439);const c=31;async function l(e,t,n=!1,s){const i=t.getSeqHandler(e);let a;s??=new Map;const l=i.isHelm()?t.getSeqMonomers(e):Object.keys(i.stats.freq).filter((e=>""!==e));for(let e=0;e<l.length;e++)s.has(l[e])||s.set(l[e],`${s.size+1}`);if(i.isHelm())a=await r.functions.call("HELM:getMolFiles",{col:e}),a=function(e,t,n=!1){const r=new Array(e.length);for(let o=0;o<e.length;o++){let s=0,i=0,a="\n Datagrok macromolecule handler\n\n 0 0 0 0 0 0 999 V3000\nM V30 BEGIN CTAB\n";const l=e.get(o);s=l.indexOf("\n",s)+1,s=l.indexOf("\n",s)+1,s=l.indexOf("\n",s)+1;const u=parseInt(l.substring(s,s+3)),d=parseInt(l.substring(s+3,s+6));a+=`M V30 COUNTS ${u} ${d} 0 0 0\n`,a+="M V30 BEGIN ATOM\n";for(let e=0;e<u;e++){s=l.indexOf("\n",s)+1+c,i=l.indexOf(" ",s);const r=l.substring(s,i);a+=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`}a+="M V30 END ATOM\n",a+="M V30 BEGIN BOND\n";for(let e=0;e<d;e++){s=l.indexOf("\n",s)+1;const t=parseInt(l.substring(s,s+3).trim()),n=parseInt(l.substring(s+3,s+6).trim());a+=`M V30 ${e+1} ${parseInt(l.substring(s+6,s+9).trim())} ${t} ${n}\n`}a+="M V30 END BOND\n",a+="M V30 END CTAB\n",a+="M END",r[o]=a}return r}(a,s,n);else{a=new Array(e.length);for(let t=0;t<e.length;t++){const e=u(i.getSplitted(t),s,n);a[t]=e}}return o.Column.fromStrings("monomericMols",a)}function u(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 o=0;o<e.length;o++){const s=e.getCanonical(o);s!==a._S&&(r+=n?`M V30 ${o+1} R${t.get(s)} 0.000 0.000 0 0\n`:`M V30 ${o+1} At 0.000 0.000 0 0 MASS=${t.get(s)}\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}function d(e,t,n){const r=n?function(e,t){const n=`${t}`.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),r=e.charAt(0)===t,o=e.charAt(e.length-1)===t,s=e.replace(new RegExp(`^${n}|${n}$`,"g"),"");return r?o?`${n}${s}${n}`:`${n}${s}${n}|${n}${s}$`:o?`^${s}${n}|${n}${s}${n}`:`^${s}${n}|${n}${s}${n}|${n}${s}$`}(e,n):e,s=o.BitSet.create(t.length);for(let n=0;n<t.length;n++){const o=t.get(n);(o.match(r)||o===e)&&s.set(n,!0,!1)}return s}async function h(e,t,n){t.version!==t.temp["last-invalidated-version"]&&await async function(e,t){const n=o.TaskBarProgressIndicator.create(`Invalidating molfiles for ${e.name}`);try{await(0,s.cb)(10);const n=new Map,r=await l(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 a=o.Column.string("helm",1).init((t=>e));a.semType=o.SEMTYPE.MACROMOLECULE,a.meta.units=i.Hi.HELM;const c=await l(a,n,!0,t.temp["monomers-dict"]);return(await r.functions.call("Chem:searchSubstructure",{molStringsColumn:t.temp["monomeric-mols"],molString:c.get(0),molBlockFailover:""})).get(0)}n(4870)},966:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});var r=n(4328),o=n(6082);function s(e,t,n,s=[],i=[]){let a=!0,c="";if(e.semType!==o.SEMTYPE.MACROMOLECULE)r.shell.warning(t+" analysis is allowed for Macromolecules semantic type"),a=!1;else{const r=n.getSeqHandler(e),o=r.notation;if(s.length>0&&!s.some((e=>o.toUpperCase()==e.toUpperCase())))c=`${t} + ' analysis is allowed for Macromolecules with notation ${0==s.length?"any notation":`notation${s.length>1?"s":""} ${s.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(6723)},4139:(e,t,n)=>{"use strict";n.d(t,{HX:()=>d,J:()=>l,b9:()=>u,gN:()=>a,uF:()=>s});var r,o,s,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"}(o||(o={})),function(e){e.MONOMER="Monomer",e.MACROMOLECULE_DIFFERENCE="MacromoleculeDifference",e.ACTIVITY="activity",e.ACTIVITY_SCALED="activityScaled"}(s||(s={}));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:()=>o}),n(6082),n(7389);var r=n(4328);async function o(e,t,n,o){const s=t.getSeqHandler(e).convert(n,o);e.dataFrame.columns.add(s);const i=await r.functions.call("Bio:detectMacromolecule",{col:s});return i&&(s.semType=i),await r.data.detectSemanticTypes(e.dataFrame),s}n(1757),n(2003)},6956:(e,t,n)=>{"use strict";n.d(t,{mP:()=>s,pk:()=>o,xe:()=>r});const r="|",o="$",s="H"},8604:(e,t,n)=>{"use strict";n.d(t,{Es:()=>o,G3:()=>i,VV:()=>a,gt:()=>s,so:()=>r});const r="System:AppData/Bio/monomer-libraries/",o="System:AppData/Bio/monomer-sets/",s="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:()=>P});var r=n(4328),o=n(6082),s=n(7389),i=n(8070),a=n(2003),c=n(608),l=n(8152),u=n(966),d=n(4139),h=n(5072),p=n.n(h),m=n(7825),f=n.n(m),g=n(7659),y=n.n(g),b=n(5056),w=n.n(b),v=n(540),A=n.n(v),E=n(1113),C=n.n(E),T=n(6369),S={};S.styleTagTransform=C(),S.setAttributes=w(),S.insert=y().bind(null,"head"),S.domAPI=f(),S.insertStyleElement=A(),p()(T.A,S),T.A&&T.A.locals&&T.A.locals;var _=n(6723);async function P(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(o.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(s.divText(e)))}const p=s.input.choice("Method",{value:e.pepsea.method,items:l.ZY});p.setTooltip("Alignment method");const m=s.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=s.p(`Kalign version: ${d.b9}`,"kalign-version"),g=s.input.float("Gap open",{value:e.pepsea.gapOpen});g.setTooltip("Gap opening penalty at group-to-group alignment");const y=s.input.float("Gap extend",{value:e.pepsea.gapExtend});y.setTooltip("Gap extension penalty to skip the alignment");const b=s.inputs([g,y,m]),w=s.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(s.icons.settings((()=>null)));const v=[p.root.style],A=[m.root.style,f.style];let E,C=h;const T=s.input.column("Sequence",{table:u,value:h,onValueChanged:async e=>{if(!e||e.semType!==o.SEMTYPE.MACROMOLECULE)return P.disabled=!0,await(0,i.cb)(0),void(T.value=C);C=e,P.disabled=!1,E=await N(T.value,u,t,v,A,p,S,g,y,m)},filter:e=>e.semType===o.SEMTYPE.MACROMOLECULE});T.setTooltip("Sequences column to use for alignment");const S=s.input.column("Clusters",{table:u,value:e.clustersCol});S.nullable=!0;const _=s.dialog("MSA").add(T).add(S).add(p).add(b).add(w).add(f).onOK((async()=>{await M(T,u,E,n,a)})),P=_.getButton("OK");if(T.fireChanged(),e.col)return E=await N(e.col,u,t,v,A,p,S,g,y,m),void await M(T,u,E,n,a);_.show()}))}async function M(e,t,n,s,i){let a=null;const c=o.TaskBarProgressIndicator.create("Analyze for MSA ...");try{if(e.fireChanged(),e.value.semType!==o.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),s(a)}catch(e){i(e)}finally{c.close()}}async function N(e,t,n,s,i,h,p,m,f,g){try{if(e.semType!==o.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]){$(s,i,"kalign"),m.value=null,f.value=null,g.value=null;const t=n.getSeqHandler(e),o=t.isFasta()?e:t.convert(a.Hi.FASTA);return async()=>await(0,c.eE)(o,!1,r,p.value)}if((0,u.l)(e,e.name,n,[a.Hi.HELM],[])[0])return $(s,i,"pepsea"),m.value??=d.HX.pepsea.gapOpen,f.value??=d.HX.pepsea.gapExtend,async()=>(0,l.GD)(e,r,h.value,m.value,f.value,p.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 $(s,i,"pepsea"),m.value??=d.HX.pepsea.gapOpen,f.value??=d.HX.pepsea.gapExtend,async()=>(0,l.GD)(t,r,h.value,m.value,f.value,p.value)}return m.value=null,f.value=null,g.value=null,void $(s,i,"kalign")}catch(e){const t=e instanceof Error?e.message:e.toString();r.shell.error(t),_._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),o=n(6082),s=n(1991),i=n.n(s),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:o,type:s,path:i}=Object.assign({path:[]},r.data),a=(r.data.argumentList||[]).map(T);let c;try{const t=i.slice(0,-1).reduce(((e,t)=>e[t]),e),n=i.reduce(((e,t)=>e[t]),e);switch(s){case"GET":c=n;break;case"SET":t[i.slice(-1)[0]]=T(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]=C(e);t.postMessage(Object.assign(Object.assign({},r),{id:o}),i),"RELEASE"===s&&(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 o=new Proxy(n,{get(n,s){if(b(r),s===d)return()=>S(e,{type:"RELEASE",path:t.map((e=>e.toString()))}).then((()=>{g(e),r=!0}));if("then"===s){if(0===t.length)return{then:()=>o};const n=S(e,{type:"GET",path:t.map((e=>e.toString()))}).then(T);return n.then.bind(n)}return w(e,[...t,s])},set(n,o,s){b(r);const[i,a]=C(s);return S(e,{type:"SET",path:[...t,o].map((e=>e.toString())),value:i},a).then(T)},apply(n,o,s){b(r);const i=t[t.length-1];if(i===u)return S(e,{type:"ENDPOINT"}).then(T);if("bind"===i)return w(e,t.slice(0,-1));const[a,c]=A(s);return S(e,{type:"APPLY",path:t.map((e=>e.toString())),argumentList:a},c).then(T)},construct(n,o){b(r);const[s,i]=A(o);return S(e,{type:"CONSTRUCT",path:t.map((e=>e.toString())),argumentList:s},i).then(T)}});return o}function v(e){return Array.prototype.concat.apply([],e)}function A(e){const t=e.map(C);return[t.map((e=>e[0])),v(t.map((e=>e[1])))]}const E=new WeakMap;function C(e){for(const[t,n]of m)if(n.canHandle(e)){const[r,o]=n.serialize(e);return[{type:"HANDLER",name:t,value:r},o]}return[{type:"RAW",value:e},E.get(e)||[]]}function T(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 o=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!==o||(e.removeEventListener("message",t),r(n.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),n)}))}const _="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0ICQ9U3ltYm9sKCJDb21saW5rLnByb3h5IiksQT1TeW1ib2woIkNvbWxpbmsuZW5kcG9pbnQiKSxSPVN5bWJvbCgiQ29tbGluay5yZWxlYXNlUHJveHkiKSx5PVN5bWJvbCgiQ29tbGluay50aHJvd24iKSxfPWU9PnR5cGVvZiBlPT0ib2JqZWN0IiYmZSE9PW51bGx8fHR5cGVvZiBlPT0iZnVuY3Rpb24iLEw9e2NhbkhhbmRsZTplPT5fKGUpJiZlWyRdLHNlcmlhbGl6ZShlKXtjb25zdHtwb3J0MTpyLHBvcnQyOml9PW5ldyBNZXNzYWdlQ2hhbm5lbDtyZXR1cm4gdyhlLHIpLFtpLFtpXV19LGRlc2VyaWFsaXplKGUpe3JldHVybiBlLnN0YXJ0KCksQyhlKX19LE89e2NhbkhhbmRsZTplPT5fKGUpJiZ5IGluIGUsc2VyaWFsaXplKHt2YWx1ZTplfSl7bGV0IHI7cmV0dXJuIGUgaW5zdGFuY2VvZiBFcnJvcj9yPXtpc0Vycm9yOiEwLHZhbHVlOnttZXNzYWdlOmUubWVzc2FnZSxuYW1lOmUubmFtZSxzdGFjazplLnN0YWNrfX06cj17aXNFcnJvcjohMSx2YWx1ZTplfSxbcixbXV19LGRlc2VyaWFsaXplKGUpe3Rocm93IGUuaXNFcnJvcj9PYmplY3QuYXNzaWduKG5ldyBFcnJvcihlLnZhbHVlLm1lc3NhZ2UpLGUudmFsdWUpOmUudmFsdWV9fSxFPW5ldyBNYXAoW1sicHJveHkiLExdLFsidGhyb3ciLE9dXSk7ZnVuY3Rpb24gdyhlLHI9c2VsZil7ci5hZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixmdW5jdGlvbiBpKHMpe2lmKCFzfHwhcy5kYXRhKXJldHVybjtjb25zdHtpZDpvLHR5cGU6YSxwYXRoOm59PU9iamVjdC5hc3NpZ24oe3BhdGg6W119LHMuZGF0YSksYz0ocy5kYXRhLmFyZ3VtZW50TGlzdHx8W10pLm1hcChtKTtsZXQgbDt0cnl7Y29uc3QgdT1uLnNsaWNlKDAsLTEpLnJlZHVjZSgoZCxwKT0+ZFtwXSxlKSxmPW4ucmVkdWNlKChkLHApPT5kW3BdLGUpO3N3aXRjaChhKXtjYXNlIkdFVCI6bD1mO2JyZWFrO2Nhc2UiU0VUIjp1W24uc2xpY2UoLTEpWzBdXT1tKHMuZGF0YS52YWx1ZSksbD0hMDticmVhaztjYXNlIkFQUExZIjpsPWYuYXBwbHkodSxjKTticmVhaztjYXNlIkNPTlNUUlVDVCI6e2NvbnN0IGQ9bmV3IGYoLi4uYyk7bD16KGQpfWJyZWFrO2Nhc2UiRU5EUE9JTlQiOntjb25zdHtwb3J0MTpkLHBvcnQyOnB9PW5ldyBNZXNzYWdlQ2hhbm5lbDt3KGUscCksbD1OKGQsW2RdKX1icmVhaztjYXNlIlJFTEVBU0UiOmw9dm9pZCAwO2JyZWFrO2RlZmF1bHQ6cmV0dXJufX1jYXRjaCh1KXtsPXt2YWx1ZTp1LFt5XTowfX1Qcm9taXNlLnJlc29sdmUobCkuY2F0Y2godT0+KHt2YWx1ZTp1LFt5XTowfSkpLnRoZW4odT0+e2NvbnN0W2YsZF09Uyh1KTtyLnBvc3RNZXNzYWdlKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxmKSx7aWQ6b30pLGQpLGE9PT0iUkVMRUFTRSImJihyLnJlbW92ZUV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLGkpLE0ocikpfSl9KSxyLnN0YXJ0JiZyLnN0YXJ0KCl9ZnVuY3Rpb24gVChlKXtyZXR1cm4gZS5jb25zdHJ1Y3Rvci5uYW1lPT09Ik1lc3NhZ2VQb3J0In1mdW5jdGlvbiBNKGUpe1QoZSkmJmUuY2xvc2UoKX1mdW5jdGlvbiBDKGUscil7cmV0dXJuIGIoZSxbXSxyKX1mdW5jdGlvbiBoKGUpe2lmKGUpdGhyb3cgbmV3IEVycm9yKCJQcm94eSBoYXMgYmVlbiByZWxlYXNlZCBhbmQgaXMgbm90IHVzZWFibGUiKX1mdW5jdGlvbiBiKGUscj1bXSxpPWZ1bmN0aW9uKCl7fSl7bGV0IHM9ITE7Y29uc3Qgbz1uZXcgUHJveHkoaSx7Z2V0KGEsbil7aWYoaChzKSxuPT09UilyZXR1cm4oKT0+ZyhlLHt0eXBlOiJSRUxFQVNFIixwYXRoOnIubWFwKGM9PmMudG9TdHJpbmcoKSl9KS50aGVuKCgpPT57TShlKSxzPSEwfSk7aWYobj09PSJ0aGVuIil7aWYoci5sZW5ndGg9PT0wKXJldHVybnt0aGVuOigpPT5vfTtjb25zdCBjPWcoZSx7dHlwZToiR0VUIixwYXRoOnIubWFwKGw9PmwudG9TdHJpbmcoKSl9KS50aGVuKG0pO3JldHVybiBjLnRoZW4uYmluZChjKX1yZXR1cm4gYihlLFsuLi5yLG5dKX0sc2V0KGEsbixjKXtoKHMpO2NvbnN0W2wsdV09UyhjKTtyZXR1cm4gZyhlLHt0eXBlOiJTRVQiLHBhdGg6Wy4uLnIsbl0ubWFwKGY9PmYudG9TdHJpbmcoKSksdmFsdWU6bH0sdSkudGhlbihtKX0sYXBwbHkoYSxuLGMpe2gocyk7Y29uc3QgbD1yW3IubGVuZ3RoLTFdO2lmKGw9PT1BKXJldHVybiBnKGUse3R5cGU6IkVORFBPSU5UIn0pLnRoZW4obSk7aWYobD09PSJiaW5kIilyZXR1cm4gYihlLHIuc2xpY2UoMCwtMSkpO2NvbnN0W3UsZl09RihjKTtyZXR1cm4gZyhlLHt0eXBlOiJBUFBMWSIscGF0aDpyLm1hcChkPT5kLnRvU3RyaW5nKCkpLGFyZ3VtZW50TGlzdDp1fSxmKS50aGVuKG0pfSxjb25zdHJ1Y3QoYSxuKXtoKHMpO2NvbnN0W2MsbF09RihuKTtyZXR1cm4gZyhlLHt0eXBlOiJDT05TVFJVQ1QiLHBhdGg6ci5tYXAodT0+dS50b1N0cmluZygpKSxhcmd1bWVudExpc3Q6Y30sbCkudGhlbihtKX19KTtyZXR1cm4gb31mdW5jdGlvbiBEKGUpe3JldHVybiBBcnJheS5wcm90b3R5cGUuY29uY2F0LmFwcGx5KFtdLGUpfWZ1bmN0aW9uIEYoZSl7Y29uc3Qgcj1lLm1hcChTKTtyZXR1cm5bci5tYXAoaT0+aVswXSksRChyLm1hcChpPT5pWzFdKSldfWNvbnN0IFA9bmV3IFdlYWtNYXA7ZnVuY3Rpb24gTihlLHIpe3JldHVybiBQLnNldChlLHIpLGV9ZnVuY3Rpb24geihlKXtyZXR1cm4gT2JqZWN0LmFzc2lnbihlLHtbJF06ITB9KX1mdW5jdGlvbiBTKGUpe2Zvcihjb25zdFtyLGldb2YgRSlpZihpLmNhbkhhbmRsZShlKSl7Y29uc3RbcyxvXT1pLnNlcmlhbGl6ZShlKTtyZXR1cm5be3R5cGU6IkhBTkRMRVIiLG5hbWU6cix2YWx1ZTpzfSxvXX1yZXR1cm5be3R5cGU6IlJBVyIsdmFsdWU6ZX0sUC5nZXQoZSl8fFtdXX1mdW5jdGlvbiBtKGUpe3N3aXRjaChlLnR5cGUpe2Nhc2UiSEFORExFUiI6cmV0dXJuIEUuZ2V0KGUubmFtZSkuZGVzZXJpYWxpemUoZS52YWx1ZSk7Y2FzZSJSQVciOnJldHVybiBlLnZhbHVlfX1mdW5jdGlvbiBnKGUscixpKXtyZXR1cm4gbmV3IFByb21pc2Uocz0+e2NvbnN0IG89VSgpO2UuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsZnVuY3Rpb24gYShuKXshbi5kYXRhfHwhbi5kYXRhLmlkfHxuLmRhdGEuaWQhPT1vfHwoZS5yZW1vdmVFdmVudExpc3RlbmVyKCJtZXNzYWdlIixhKSxzKG4uZGF0YSkpfSksZS5zdGFydCYmZS5zdGFydCgpLGUucG9zdE1lc3NhZ2UoT2JqZWN0LmFzc2lnbih7aWQ6b30sciksaSl9KX1mdW5jdGlvbiBVKCl7cmV0dXJuIG5ldyBBcnJheSg0KS5maWxsKDApLm1hcCgoKT0+TWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpKk51bWJlci5NQVhfU0FGRV9JTlRFR0VSKS50b1N0cmluZygxNikpLmpvaW4oIi0iKX1jb25zdCBXPWFzeW5jKCk9PldlYkFzc2VtYmx5LnZhbGlkYXRlKG5ldyBVaW50OEFycmF5KFswLDk3LDExNSwxMDksMSwwLDAsMCwxLDUsMSw5NiwwLDEsMTIzLDMsMiwxLDAsMTAsMTAsMSw4LDAsNjUsMCwyNTMsMTUsMjUzLDk4LDExXSkpLGs9ImVhZ2VyIix4PSJsYXp5IixqPXtzc3c6WyJzaW1kIl0sbWluaW1hcDI6WyJzaW1kIl19LHQ9e3Rvb2xzOltdLGNvbmZpZzp7fSxmaWxlczpbXSxiYXNlOnt9LGZzOnt9LGFzeW5jIGluaXQoKXtpZih0LnRvb2xzLmxlbmd0aD09PTApdGhyb3ciRXhwZWN0aW5nIGF0IGxlYXN0IDEgdG9vbC4iO2lmKG5ldyBTZXQodC50b29scy5tYXAocj0+YCR7ci50b29sfS8ke3IucHJvZ3JhbXx8ci50b29sfWApKS5zaXplIT09dC50b29scy5sZW5ndGgpdGhyb3ciRm91bmQgZHVwbGljYXRlIHRvb2xzOyBjYW4gb25seSBoYXZlIGVhY2ggdG9vbC9wcm9ncmFtIGNvbWJpbmF0aW9uIGF0IG1vc3Qgb25jZS4iO2lmKHQuYmFzZT10LnRvb2xzLmZpbmQocj0+ci5yZWluaXQhPT0hMCksIXQuYmFzZSl0aHJvdyJDb3VsZCBub3QgZmluZCBhIHRvb2wgd2l0aCBgcmVpbml0OiBmYWxzZWAgdG8gdXNlIGFzIHRoZSBiYXNlIG1vZHVsZS4gVG8gZml4IHRoaXMgaXNzdWUsIGluY2x1ZGUgdGhlIHRvb2wgYGJhc2UvMS4wLjBgIHdoZW4gaW5pdGlhbGl6aW5nIEFpb2xpLiI7cmV0dXJuIHQuYmFzZS5pc0Jhc2VNb2R1bGU9ITAsYXdhaXQgdGhpcy5fc2V0dXAodC5iYXNlKSxhd2FpdCB0aGlzLl9pbml0TW9kdWxlcygpLHQuX2xvZygiUmVhZHkiKSwhMH0sYXN5bmMgX2luaXRNb2R1bGVzKCl7YXdhaXQgUHJvbWlzZS5hbGwodC50b29scy5tYXAodGhpcy5fc2V0dXApKSxhd2FpdCB0aGlzLl9zZXR1cEZTKCl9LG1vdW50KGU9W10pe2NvbnN0IHI9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyRGF0YX1gLGk9YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7dC5jb25maWcuZGlyTW91bnRlZH1gO2xldCBzPVtdLG89W10sYT1bXTshQXJyYXkuaXNBcnJheShlKSYmIShlIGluc3RhbmNlb2YgRmlsZUxpc3QpJiYoZT1bZV0pLHQuX2xvZyhgTW91bnRpbmcgJHtlLmxlbmd0aH0gZmlsZXNgKTtmb3IobGV0IG4gb2YgZSl7aWYobiBpbnN0YW5jZW9mIEZpbGV8fChuPT1udWxsP3ZvaWQgMDpuLmRhdGEpaW5zdGFuY2VvZiBCbG9iJiZuLm5hbWV8fHR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmbi5uYW1lKXR5cGVvZihuPT1udWxsP3ZvaWQgMDpuLmRhdGEpPT0ic3RyaW5nIiYmKG4uZGF0YT1uZXcgQmxvYihbbi5kYXRhXSx7dHlwZToidGV4dC9wbGFpbiJ9KSkscy5wdXNoKG4pO2Vsc2UgaWYobi5uYW1lJiZuLnVybClvLnB1c2gobik7ZWxzZSBpZih0eXBlb2Ygbj09InN0cmluZyImJm4uc3RhcnRzV2l0aCgiaHR0cCIpKW49e3VybDpuLG5hbWU6bi5zcGxpdCgiLy8iKS5wb3AoKS5yZXBsYWNlKC9cLy9nLCItIil9LG8ucHVzaChuKTtlbHNlIHRocm93J0Nhbm5vdCBtb3VudCBmaWxlKHMpIHNwZWNpZmllZC4gTXVzdCBiZSBhIEZpbGUsIEJsb2IsIGEgVVJMIHN0cmluZywgb3IgeyBuYW1lOiAiZmlsZS50eHQiLCBkYXRhOiAic3RyaW5nIiB9Lic7YS5wdXNoKG4ubmFtZSl9dHJ5e3QuZnMudW5tb3VudChpKX1jYXRjaHt9Zm9yKGxldCBuIG9mIG8pdC5mcy5jcmVhdGVMYXp5RmlsZShyLG4ubmFtZSxuLnVybCwhMCwhMCk7cmV0dXJuIHQuZmlsZXM9dC5maWxlcy5jb25jYXQocyksdC5iYXNlLm1vZHVsZS5GUy5tb3VudCh0LmJhc2UubW9kdWxlLldPUktFUkZTLHtmaWxlczp0LmZpbGVzLmZpbHRlcihuPT5uIGluc3RhbmNlb2YgRmlsZSksYmxvYnM6dC5maWxlcy5maWx0ZXIobj0+KG49PW51bGw/dm9pZCAwOm4uZGF0YSlpbnN0YW5jZW9mIEJsb2IpfSxpKSxzLm1hcChuPT57Y29uc3QgYz1gJHtpfS8ke24ubmFtZX1gLGw9YCR7cn0vJHtuLm5hbWV9YDt0cnl7dC5mcy51bmxpbmsobCl9Y2F0Y2h7fXQuX2xvZyhgQ3JlYXRpbmcgc3ltbGluazogJHtsfSAtLT4gJHtjfWApLHQuZnMuc3ltbGluayhjLGwpfSksYS5tYXAobj0+YCR7cn0vJHtufWApfSxhc3luYyBleGVjKGUscj1udWxsKXtpZih0Ll9sb2coYEV4ZWN1dGluZyAlYyR7ZX0lYyBhcmdzPSR7cn1gLCJjb2xvcjpkYXJrYmx1ZTsgZm9udC13ZWlnaHQ6Ym9sZCIsIiIpLCFlKXRocm93IkV4cGVjdGluZyBhIGNvbW1hbmQiO2xldCBpPWU7cj09bnVsbCYmKHI9ZS5zcGxpdCgiICIpLGk9ci5zaGlmdCgpKTtjb25zdCBzPXQudG9vbHMuZmluZChhPT57dmFyIGM7bGV0IG49aTtyZXR1cm4oKGM9YT09bnVsbD92b2lkIDA6YS5mZWF0dXJlcyk9PW51bGw/dm9pZCAwOmMuc2ltZCk9PT0hMCYmKG49YCR7bn0tc2ltZGApLGEucHJvZ3JhbT09bn0pO2lmKHM9PW51bGwpdGhyb3dgUHJvZ3JhbSAke2l9IG5vdCBmb3VuZC5gO3Muc3Rkb3V0PSIiLHMuc3RkZXJyPSIiLHMubG9hZGluZz09eCYmKHMubG9hZGluZz1rLGF3YWl0IHRoaXMuX2luaXRNb2R1bGVzKCkpO3RyeXtzLm1vZHVsZS5jYWxsTWFpbihyKX1jYXRjaChhKXtjb25zb2xlLmVycm9yKGEpfXRyeXtzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzFdKSxzLm1vZHVsZS5GUy5jbG9zZShzLm1vZHVsZS5GUy5zdHJlYW1zWzJdKX1jYXRjaHt9cy5tb2R1bGUuRlMuc3RyZWFtc1sxXT1zLm1vZHVsZS5GUy5vcGVuKCIvZGV2L3N0ZG91dCIsInciKSxzLm1vZHVsZS5GUy5zdHJlYW1zWzJdPXMubW9kdWxlLkZTLm9wZW4oIi9kZXYvc3RkZXJyIiwidyIpO2xldCBvPXtzdGRvdXQ6cy5zdGRvdXQsc3RkZXJyOnMuc3RkZXJyfTtyZXR1cm4gdC5jb25maWcucHJpbnRJbnRlcmxlYXZlZCYmKG89cy5zdGRvdXQpLHMucmVpbml0PT09ITAmJmF3YWl0IHRoaXMucmVpbml0KHMudG9vbCksb30sY2F0KGUpe3JldHVybiB0Ll9maWxlb3AoImNhdCIsZSl9LGxzKGUpe3JldHVybiB0Ll9maWxlb3AoImxzIixlKX0sZG93bmxvYWQoZSl7cmV0dXJuIHQuX2ZpbGVvcCgiZG93bmxvYWQiLGUpfSxwd2QoKXtyZXR1cm4gdC5mcy5jd2QoKX0sY2QoZSl7Zm9yKGxldCByIG9mIHQudG9vbHMpIXIubW9kdWxlfHxyLm1vZHVsZS5GUy5jaGRpcihlKX0sbWtkaXIoZSl7cmV0dXJuIHQuZnMubWtkaXIoZSksITB9LHJlYWQoe3BhdGg6ZSxsZW5ndGg6cixmbGFnOmk9InIiLG9mZnNldDpzPTAscG9zaXRpb246bz0wfSl7Y29uc3QgYT10LmZzLm9wZW4oZSxpKSxuPW5ldyBVaW50OEFycmF5KHIpO3JldHVybiB0LmZzLnJlYWQoYSxuLHMscixvKSx0LmZzLmNsb3NlKGEpLG59LHdyaXRlKHtwYXRoOmUsYnVmZmVyOnIsZmxhZzppPSJ3KyIsb2Zmc2V0OnM9MCxwb3NpdGlvbjpvPTB9KXtjb25zdCBhPXQuZnMub3BlbihlLGkpO3QuZnMud3JpdGUoYSxyLHMsci5sZW5ndGgsbyksdC5mcy5jbG9zZShhKX0sYXN5bmMgcmVpbml0KGUpe2NvbnN0IHI9dC50b29scy5maW5kKHM9PnMudG9vbD09ZSksaT10LmJhc2UubW9kdWxlLkZTLmN3ZCgpO09iamVjdC5hc3NpZ24ocixyLmNvbmZpZyksci5yZWFkeT0hMSxhd2FpdCB0aGlzLmluaXQoKSxyLmlzQmFzZU1vZHVsZSYmdGhpcy5tb3VudCgpLHRoaXMuY2QoaSl9LF9zdGRpblR4dDoiIixfc3RkaW5QdHI6MCxnZXQgc3RkaW4oKXtyZXR1cm4gdC5fc3RkaW5UeHR9LHNldCBzdGRpbihlPSIiKXt0Ll9sb2coYFNldHRpbmcgc3RkaW4gdG8gJWMke2V9JWNgLCJjb2xvcjpkYXJrYmx1ZSIsIiIpLHQuX3N0ZGluVHh0PWUsdC5fc3RkaW5QdHI9MH0sYXN5bmMgX3NldHVwKGUpe2lmKGUucmVhZHkpcmV0dXJuO2lmKHQuX2xvZyhgU2V0dGluZyB1cCAke2UudG9vbH0gKGJhc2UgPSAke2UuaXNCYXNlTW9kdWxlPT09ITB9KS4uLmApLGUuY29uZmlnPU9iamVjdC5hc3NpZ24oe30sZSksZS51cmxQcmVmaXh8fChlLnVybFByZWZpeD1gJHt0LmNvbmZpZy51cmxDRE59LyR7ZS50b29sfS8ke2UudmVyc2lvbn1gKSxlLnByb2dyYW18fChlLnByb2dyYW09ZS50b29sKSxlLmZlYXR1cmVzfHwoZS5mZWF0dXJlcz17fSwoaltlLnByb2dyYW1dfHxbXSkuaW5jbHVkZXMoInNpbWQiKSYmKGF3YWl0IFcoKT8oZS5wcm9ncmFtKz0iLXNpbWQiLGUuZmVhdHVyZXMuc2ltZD0hMCk6dC5fbG9nKGBXZWJBc3NlbWJseSBTSU1EIGlzIG5vdCBzdXBwb3J0ZWQgaW4gdGhpcyBicm93c2VyOyB3aWxsIGxvYWQgbm9uLVNJTUQgdmVyc2lvbiBvZiAke2UucHJvZ3JhbX0uYCkpKSxlLmlzQmFzZU1vZHVsZSYmKGUubG9hZGluZz1rKSxlLmxvYWRpbmc9PT14KXt0Ll9sb2coYFdpbGwgbGF6eS1sb2FkICR7ZS50b29sfTsgc2tpcHBpbmcgaW5pdGlhbGl6YXRpb24uYCk7cmV0dXJufXNlbGYuaW1wb3J0U2NyaXB0cyhgJHtlLnVybFByZWZpeH0vJHtlLnByb2dyYW19LmpzYCksZS5tb2R1bGU9YXdhaXQgTW9kdWxlKHt0aGlzUHJvZ3JhbTplLnByb2dyYW0sbG9jYXRlRmlsZTooaSxzKT0+YCR7ZS51cmxQcmVmaXh9LyR7aX1gLHN0ZGluOigpPT50Ll9zdGRpblB0cjx0LnN0ZGluLmxlbmd0aD90LnN0ZGluLmNoYXJDb2RlQXQodC5fc3RkaW5QdHIrKyk6KHQuc3RkaW49IiIsbnVsbCkscHJpbnQ6aT0+e3QuY29uZmlnLnByaW50U3RyZWFtP3Bvc3RNZXNzYWdlKHt0eXBlOiJiaW93YXNtIix2YWx1ZTp7c3Rkb3V0Oml9fSk6ZS5zdGRvdXQrPWkrYApgfSxwcmludEVycjppPT57Y29uc3Qgcz10LmNvbmZpZy5wcmludEludGVybGVhdmVkPyJzdGRvdXQiOiJzdGRlcnIiO3QuY29uZmlnLnByaW50U3RyZWFtP3Bvc3RNZXNzYWdlKHt0eXBlOiJiaW93YXNtIix2YWx1ZTp7W3NdOml9fSk6ZVtzXSs9aStgCmB9fSk7Y29uc3Qgcj1lLm1vZHVsZS5GUztlLmlzQmFzZU1vZHVsZT8odC5fbG9nKGBTZXR0aW5nIHVwICR7ZS50b29sfSB3aXRoIGJhc2UgbW9kdWxlIGZpbGVzeXN0ZW0uLi5gKSxyLm1rZGlyKHQuY29uZmlnLmRpclNoYXJlZCw1MTEpLHIubWtkaXIoYCR7dC5jb25maWcuZGlyU2hhcmVkfS8ke3QuY29uZmlnLmRpckRhdGF9YCw1MTEpLHIubWtkaXIoYCR7dC5jb25maWcuZGlyU2hhcmVkfS8ke3QuY29uZmlnLmRpck1vdW50ZWR9YCw1MTEpLHIuY2hkaXIoYCR7dC5jb25maWcuZGlyU2hhcmVkfS8ke3QuY29uZmlnLmRpckRhdGF9YCksdC5mcz1yKToodC5fbG9nKGBTZXR0aW5nIHVwICR7ZS50b29sfSB3aXRoIGZpbGVzeXN0ZW0uLi5gKSxyLm1rZGlyKHQuY29uZmlnLmRpclNoYXJlZCksci5tb3VudChlLm1vZHVsZS5QUk9YWUZTLHtyb290OnQuY29uZmlnLmRpclNoYXJlZCxmczp0LmZzfSx0LmNvbmZpZy5kaXJTaGFyZWQpLHIuY2hkaXIodC5mcy5jd2QoKSkpLGUuc3Rkb3V0PSIiLGUuc3RkZXJyPSIiLGUucmVhZHk9ITB9LGFzeW5jIF9zZXR1cEZTKCl7Y29uc3QgZT10LmZzO2ZvcihsZXQgciBvZiB0LnRvb2xzKXtpZighci5yZWFkeSljb250aW51ZTtjb25zdCBpPXIubW9kdWxlLkZTLHM9YC8ke3IudG9vbH1gLG89YCR7dC5jb25maWcuZGlyU2hhcmVkfSR7c31gOyFpLmFuYWx5emVQYXRoKHMpLmV4aXN0c3x8ZS5hbmFseXplUGF0aChvKS5leGlzdHN8fCh0Ll9sb2coYE1vdW50aW5nICR7c30gb250byAke3QuYmFzZS50b29sfSBmaWxlc3lzdGVtIGF0ICR7b31gKSxlLm1rZGlyKG8pLGUubW91bnQodC5iYXNlLm1vZHVsZS5QUk9YWUZTLHtyb290OnMsZnM6aX0sbykpfX0sX2ZpbGVvcChlLHIpe3QuX2xvZyhgUnVubmluZyAke2V9ICR7cn1gKTtjb25zdCBpPXQuZnMuYW5hbHl6ZVBhdGgocik7aWYoIWkuZXhpc3RzKXJldHVybiB0Ll9sb2coYEZpbGUgJHtyfSBub3QgZm91bmQuYCksITE7c3dpdGNoKGUpe2Nhc2UiY2F0IjpyZXR1cm4gdC5mcy5yZWFkRmlsZShyLHtlbmNvZGluZzoidXRmOCJ9KTtjYXNlImxzIjpyZXR1cm4gdC5mcy5pc0ZpbGUoaS5vYmplY3QubW9kZSk/dC5mcy5zdGF0KHIpOnQuZnMucmVhZGRpcihyKTtjYXNlImRvd25sb2FkIjpjb25zdCBzPW5ldyBCbG9iKFt0aGlzLmNhdChyKV0pO3JldHVybiBVUkwuY3JlYXRlT2JqZWN0VVJMKHMpfXJldHVybiExfSxfbG9nKGUpe2lmKCF0LmNvbmZpZy5kZWJ1ZylyZXR1cm47bGV0IHI9Wy4uLmFyZ3VtZW50c107ci5zaGlmdCgpLGNvbnNvbGUubG9nKGAlY1tXZWJXb3JrZXJdJWMgJHtlfWAsImZvbnQtd2VpZ2h0OmJvbGQiLCIiLC4uLnIpfX07dyh0KX0pKCk7Cg==",P=typeof window<"u"&&window.Blob&&new Blob([atob(_)],{type:"text/javascript;charset=utf-8"});function M(){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 N={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 ${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({},N,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 M;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 x=n(3629);class L{static getAvailableScales(){return Object.entries(this.scales).map((([e,t])=>e))}static getScale(e){return(0,x.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,x.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,x.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,x.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,x.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,s,i,l){let u=e.toList();t&&(u=u.map((e=>I.clean(e).replace(/\-/g,""))));const d=e.length;r??=o.Column.string("Clusters",d).init("0"),r.type!=o.COLUMN_TYPE.STRING&&(r=r.convertTo(o.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 $(["base/1.0.0",{tool:"kalign",version:R.b9,reinit:!0}]),y=o.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!==s?` --gpo ${s}`:""}${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 o=await g.cat(k);if(!o){const e=F(r,1);throw new Error(e)}const c=new a.m(o).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=o.SEMTYPE.MACROMOLECULE,y}function F(e,t){const n=[],r=/^.+ERROR : (.+)$/gm;let o;for(;null!=(o=r.exec(e))&&(void 0===t||n.length<t);)n.push(o[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 o=t[e];return o.length>25&&(o=o.slice(0,25)+"..."),r.divText(`"${o}"${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,ZY:()=>u});var r=n(4328),o=n(6082),s=n(2003),i=n(608),a=n(4139),c=n(6723);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(),f=e.length;u??=o.Column.int("Clusters",f).init(0),u.type!=o.COLUMN_TYPE.STRING&&(u=u.convertTo(o.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 o=g.indexOf(r),s=e.get(t);s&&((b[o]??=[]).push({ID:t.toString(),HELM:s}),(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=o.Column.fromStrings(t,v);return A.meta.units=s.Hi.SEPARATOR,A.setTag(s.gp.separator,a.J.SEPARATOR),A.setTag(s.gp.aligned,"SEQ.MSA"),A.setTag(s.gp.alphabet,s.YI.UN),A.setTag(s.gp.alphabetIsMultichar,"true"),A.semType=o.SEMTYPE.MACROMOLECULE,A}async function p(e,t,n,o,s,i){const a={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)},l=`/align?method=${n}&gap_open=${o}&gap_extend=${s}`,u=window.performance.now(),d=await r.dapi.docker.dockerContainers.fetchProxy(e,l,a),h=window.performance.now();c._package.logger.debug(`Bio: requestAlignedObjects() dockerContainers.fetchProxy(), ET: ${h-u} ms`);const p="application/json"===d.headers.get("content-type");if(!d.ok&&p){const e=await d.json(),t=e["pepsea-error"];if(t)throw new Error(`PepSeA error: ${t}`);const n=e["datagrok-error"];if(n)throw new Error(`Datagrok error: ${n}`);throw new Error(d.statusText)}if(!d.ok&&!p){const e=await d.text();throw new Error(`Error: ${e}`)}if(!p){const e=await d.text();throw new Error(`Error: PepSeA expected JSON response, got '${e}'.`)}const m=await d.json();if("pepsea-stderr"in m){const e=m["pepsea-stderr"];i?.warning(e)}return m}},3890:(e,t,n)=>{"use strict";n.d(t,{aS:()=>a,wz:()=>i}),n(6082),n(7389),n(4328);var r=n(1991),o=n.n(r);n(6723);const s=60;function i(e,t,n=s,r="\n"){const o=[];for(let s=0;s<t.length;s++){const i=e.map((e=>e.get(s).toString())).join("|"),c=a(t.getSplitted(s),n);o.push(`>${i}${r}`);for(const e of c)o.push(`${e}${r}`)}return"".concat(...o)}function a(e,t=s){let n=0;const r=e.length,i=[];for(;n<r;){const r=o().count(n).take(Math.min(e.length-n,t)).map((t=>e.getOriginal(t))).toArray(),s=r.map((e=>e.length>1?`[${e}]`:e)).reduce(((e,t)=>e+t),"");i.push(s),n+=r.length}return i}},8754:(e,t,n)=>{"use strict";n.d(t,{V:()=>u});var r=n(4328),o=n(6077),s=n(2003),i=n(8312),a=n(5553),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 o,a;r.isHelm()?o=t:(a=t.name,t.name=`__${a}`,o=r.convert(s.Hi.HELM),o.name=a,e.columns.add(o,!1));try{m=await n.helmToAtomicLevel(o,!0,!0,d)}finally{o!==t&&(e.columns.remove(o.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,o.C4)(e,t,d,h,p)}if(m.molCol){const o=(0,l.qj)(e,t.name);m.molCol.name=o,e.columns.add(m.molCol,!0),await(0,a.Qc)(t,m.molCol,d,h,p,n),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)}function o(e,t,n,r,o){const s=()=>{const o=e.col(t);o&&(o.width=n),r&&(e.props.rowHeight=r)};if(o)return void s();const i=e.onAfterDrawOverlay.subscribe((()=>{i.unsubscribe(),setTimeout((()=>{s()}))}))}n.d(t,{Kd:()=>o,Ku:()=>r}),n(4328),n(6082)},250:(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),o=(n(1757),n(1991),n(1858),n(2003)),s=n(4326);n(8070),n(7602);var i=n(439),a=n(6882);n(6723);var c,l,u,d=n(6307);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===s.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===s.fH.full)for(const[e,t]of Object.entries(this._freqs)){const e=t.plotValue/this.sumPlotValue;this.sumPlotValueForHeight+=e}}calcScreen(e,t,n,o,a,c,l,u,d){const h=o===s.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,o]of m){const n=h*o.plotValue/this.sumPlotValue;o.bounds=new r.Rect((e-t)*u*c,p,l*u,n),p+=n}}render(e,t,n,r,s,c,l){for(const[u,d]of Object.entries(this._freqs))if(u!==i._S){const i=(0,o.zS)(u,l),h=d.bounds,p=h.left;let m=a.S$;c&&(m=c.getMonomerTextColor(s,u)),e.resetTransform(),e.strokeStyle="lightgray",e.lineWidth=1,e.rect(p,h.top,h.width,h.height),e.fillStyle=m,e.textAlign="left",e.font=t;const f=e.measureText(i);e.setTransform(h.width/f.width,0,0,h.height/r,p,h.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.maxMonomerLetters="maxMonomerLetters",e.showPositionLabels="showPositionLabels",e.positionMarginState="positionMarginState",e.positionMargin="positionMargin",e.filterSource="filterSource"}(l||(l={})),s.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,o){let s=0,i=-1;for(;-1!=(i=n.findNext(i,!0));){const e=t.getSplitted(i),n=o.pos,a=n<e.length?e.getCanonical(n):null;null!==a&&a===r&&s++}return s}r.JsViewer},1687:(e,t,n)=>{"use strict";n.d(t,{_i:()=>T,AR:()=>C});var r=n(7389),o=n(6082),s=n(4328),i=n(1991),a=n.n(i),c=n(1858),l=n(2003),u=n(8070),d=n(7602),h=n(4954),p=n(4574),m=n(1757),f=n.n(m),g=n(9124),y=n(9192),b=n(4870),w=n(6723);class v extends p.O{seqHelper;emptyProps=new p.n("",void 0,w._package.logger);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,void 0,w._package.logger)}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),o=this._filterPanel;o.innerText="error",o.classList.add("d4-error"),r.tooltip.bind(o,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.Ku)(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.Ku)(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,o){this.props=e,this.filterId=t,this.dataFrameId=n,this.columnName=r,this.bitset=o}}class C extends p.n{separator;constructor(e,t,n){super(e,!1,n),this.separator=t,this.readOnly=!0}}class T extends o.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=++T.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(o.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(o.debounce(this.bioFilter.onChanged,this.debounceTime).subscribe(this.bioFilterOnChangedDebounced.bind(this))),this.viewSubs.push(s.events.onResetFilterRequest.subscribe(this.grokEventsOnResetFilterRequest.bind(this))),this.viewSubs.push(s.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=o.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())}`:"")),s.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("",void 0,w._package.logger);substructureInput;get type(){return"FastaBioFilter"}constructor(){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{window.setTimeout((()=>{this.props=new p.n(e,void 0,w._package.logger),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 C("",void 0,w._package.logger);substructureInput;separatorInput;colSeparator="";get type(){return"SeparatorBioFilter"}constructor(e){super(),this.substructureInput=r.input.string("",{value:"",onValueChanged:e=>{this.props=new C(e,this.props.separator,w._package.logger),setTimeout((()=>{this._propsChanging||this.onChanged.next()}))},placeholder:"Substructure"}),this.separatorInput=r.input.string("",{value:this.colSeparator=e,onValueChanged:e=>{const t=e||"";this.props=new C(this.props.substructure,t,w._package.logger),setTimeout((()=>{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 C("",void 0,w._package.logger)}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()}}},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},9713:e=>{"use strict";e.exports=rxjs.operators},7389:e=>{"use strict";e.exports=ui},1991:e=>{"use strict";e.exports=wu},8343:(e,t,n)=>{"use strict";const{normalizeIPv6:r,normalizeIPv4:o,removeDotSegments:s,recomposeAuthority:i,normalizeComponentEncoding:a}=n(4834),c=n(343);function l(e,t,n,r){const o={};return r||(e=p(u(e,n),n),t=p(u(t,n),n)),!(n=n||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=s(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=s(t.path||""),o.query=t.query):(t.path?("/"===t.path.charAt(0)?o.path=s(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=s(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}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),o=[],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&&o.push(n.scheme,":");const l=i(n);if(void 0!==l&&("suffix"!==r.reference&&o.push("//"),o.push(l),n.path&&"/"!==n.path.charAt(0)&&o.push("/")),void 0!==n.path){let e=n.path;r.absolutePath||a&&a.absolutePath||(e=s(e)),void 0===l&&(e=e.replace(/^\/\//u,"/%2F")),o.push(e)}return void 0!==n.query&&o.push("?",n.query),void 0!==n.fragment&&o.push("#",n.fragment),o.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),s={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(s.scheme=l[1],s.userinfo=l[3],s.host=l[4],s.port=parseInt(l[5],10),s.path=l[6]||"",s.query=l[7],s.fragment=l[8],isNaN(s.port)&&(s.port=l[5]),s.host){const e=o(s.host);if(!1===e.isIPV4){const t=r(e.host);s.host=t.host.toLowerCase(),a=t.isIPV6}else s.host=e.host,a=!0}void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",n.reference&&"suffix"!==n.reference&&n.reference!==s.reference&&(s.error=s.error||"URI is not a "+n.reference+" reference.");const e=c[(n.scheme||s.scheme||"").toLowerCase()];if(!(n.unicodeSupport||e&&e.unicodeSupport)&&s.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}(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(e){s.error=s.error||"Host's domain name can not be converted to ASCII: "+e}(!e||e&&!e.skipNormalize)&&(i&&void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),i&&void 0!==s.host&&(s.host=unescape(s.host)),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),e&&e.parse&&e.parse(s,n)}else s.error=s.error||"URI can not be parsed.";return s}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}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\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 o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(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:o,serialize:s},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:o,serialize:s},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 o=`${n}:${t.nid||e.nid}`,s=c[o];e.path=void 0,s&&(e=s.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(),o=`${n}:${t.nid||r}`,s=c[o];s&&(e=s.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),o=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function s(e){if(l(e,".")<3)return{host:e,isIPV4:!1};const t=e.match(o)||[],[n]=t;return n?{host:c(n,"."),isIPV4:!0}:{host:e,isIPV4:!1}}function i(e,t=!1){let n="",o=!0;for(const t of e){if(void 0===r[t])return;"0"!==t&&!0===o&&(o=!1),o||(n+=t)}return t&&0===n.length&&(n="0"),n}function a(e){if(l(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const n={error:!1,address:"",zone:""},r=[],o=[];let s=!1,a=!1,c=!1;function l(){if(o.length){if(!1===s){const e=i(o);if(void 0===e)return n.error=!0,!1;r.push(e)}o.length=0}return!0}for(let i=0;i<e.length;i++){const u=e[i];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!l())break;s=!0}else o.push(u);else{if(!0===a&&(c=!0),!l())break;if(t++,r.push(":"),t>7){n.error=!0;break}i-1>=0&&":"===e[i-1]&&(a=!0)}}return o.length&&(s?n.zone=o.join(""):c?r.push(o.join("")):r.push(i(o))),n.address=r.join(""),n}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+="%"+t.zone,n+="%25"+t.zone),{host:e,escapedHost:n,isIPV6:!0}}}function c(e,t){let n="",r=!0;const o=e.length;for(let s=0;s<o;s++){const i=e[s];"0"===i&&r?(s+1<=o&&e[s+1]===t||s+1===o)&&(n+=i,r=!1):(r=i===t,n+=i)}return n}function l(e,t){let n=0;for(let r=0;r<e.length;r++)e[r]===t&&n++;return n}const u=/^\.\.?\//u,d=/^\/\.(?:\/|$)/u,h=/^\/\.\.(?:\/|$)/u,p=/^\/?(?:.|\n)*?(?=\/|$)/u;e.exports={recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);const r=s(n);if(r.isIPV4)n=r.host;else{const t=a(r.host);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.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(u))e=e.replace(u,"");else if(e.match(d))e=e.replace(d,"/");else if(e.match(h))e=e.replace(h,"/"),t.pop();else if("."===e||".."===e)e="";else{const n=e.match(p);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:a,stringArrayToHexStripped:i}},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 o=t[r];if(void 0!==o)return o.exports;var s=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(s.exports,s,s.exports,n),s.loaded=!0,s.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 o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].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:()=>_e,initAutoTests:()=>Me,test:()=>Pe,tests:()=>t.CN});var e=n(6082),t=n(8070);(0,t.L1)("_first",(()=>{(0,t.t6)("_first",(async()=>{}))}));var o=n(8924),s=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 s.e,!0),(0,t.E3)(e instanceof i.A,!0)}()})),(0,t.t6)("testPaletteAA",(async()=>{await async function(){const e=o.X.Lesk,n=o.X.RasMol,r=o.X.GrokGroups;(0,t.E3)(e instanceof s.e,!0),(0,t.E3)(n instanceof s.e,!0),(0,t.E3)(r instanceof s.e,!0),(0,t.E3)(e instanceof o.X,!0),(0,t.E3)(n instanceof o.X,!0),(0,t.E3)(r instanceof o.X,!0)}()})),(0,t.t6)("testPalettePtMe",(async()=>{const e=o.X.GrokGroups.get("MeNle"),n=o.X.GrokGroups.get("MeA"),r=o.X.GrokGroups.get("MeG"),s=o.X.GrokGroups.get("MeF"),i=o.X.GrokGroups.get("L"),a=o.X.GrokGroups.get("A"),c=o.X.GrokGroups.get("G"),l=o.X.GrokGroups.get("F");(0,t.E3)(e,i),(0,t.E3)(n,a),(0,t.E3)(r,c),(0,t.E3)(s,l)}))}));var a=n(4328),c=n(2003),l=n(8312);class u{units;aligned;alphabet;alphabetSize;alphabetIsMultichar;separator;constructor(e,t,n,r,o,s){this.units=e,this.aligned=t,this.alphabet=n,this.alphabetSize=r,this.alphabetIsMultichar=o,this.separator=s}}async function d(t,n){const r=(await t()).getCol(n),o=await a.functions.call("Bio:detectMacromolecule",{col:r});if(o&&(r.semType=o),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,o,s,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,s),(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=o.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,o,s,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,o),(0,t.E3)(h.getTag(c.gp.aligned),s),(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,s),(0,t.E3)(m.alphabet,i))}async function f(e,t,n){const r=await e(),o=[];for(const s of r.columns.names())if(s in t){const r=t[s];try{await h(e,s,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}catch(e){const t=e.toString();o.push(`Positive col '${s}' failed: ${t}`)}}else try{await d(e,s)}catch(e){const t=e.toString();o.push(`Negative col '${s}' failed: ${t}`)}if(o.length>0)throw new Error(o.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[o,s]of Object.entries(r))(0,t.t6)(`csvData2-${o}`,(async()=>{const t=(i=o,async()=>{const t=r[i].csv,n=e.DataFrame.fromCsv(t);return await a.data.detectSemanticTypes(n),n});var i;for(const e of s.neg??[])await d(t,e);for(const[e,r]of Object.entries(s.pos??{}))await h(t,e,n,r.units,r.aligned,r.alphabet,r.alphabetSize,r.alphabetIsMultichar,r.separator)}));const o=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"},s={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",fasta_negative_words:"System:AppData/Bio/tests/fasta_negative_words.csv"},i={};function g(e,t=y){return async()=>(e in i||(i[e]=(async()=>await t(s[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=o[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.t6)("samplesFastaNegativeWords",(async()=>{await f(g("fasta_negative_words"),{},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"},o=t=>async()=>{const n=r[t],o=e.DataFrame.fromCsv(n);return await a.data.detectSemanticTypes(o),o};(0,t.t6)("fastaDnaWeak1",(async()=>{await d(o("fastaDnaWeak1"),"colName")})),(0,t.t6)("fastaDnaWeak1LikelyName",(async()=>{await h(o("fastaDnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.DNA,4,!1)})),(0,t.t6)("fastaRnaWeak1",(async()=>{await d(o("fastaRnaWeak1"),"colName")})),(0,t.t6)("fastaRnaWeak1LikelyName",(async()=>{await h(o("fastaRnaWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.RNA,4,!1)})),(0,t.t6)("fastaPtWeak1",(async()=>{await d(o("fastaPtWeak1"),"colName")})),(0,t.t6)("fastaPtWeak1LikelyName",(async()=>{await h(o("fastaPtWeak1LikelyName"),"seq",n,c.Hi.FASTA,"SEQ.MSA",c.YI.PT,20,!1)})),(0,t.t6)("fastaUn1",(async()=>{await d(o("fastaUn1"),"colName")})),(0,t.t6)("fastaUn1LikelyName",(async()=>{await d(o("fastaUn1LikelyName"),"seq")})),(0,t.t6)("fastaUn2LikelyName",(async()=>{await d(o("fastaUn2LikelyName"),"protein")})),(0,t.t6)("fastaUnMsa1LikelyName",(async()=>{await d(o("fastaUnMsa1LikelyName"),"seq")}))})),(0,t.L1)("detectorsBenchmark",(()=>{let n,r;async function o(o,i,a,l,u,d){return await async function(o){const h=await(async()=>{const t=function(t,n,r,o,s){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,s)},l=Array(o);for(let e=0;e<o;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 s(n),n})(),p=Date.now(),m=s(h),f=Date.now();(function(e,r){const o=n.getSeqHandler(e);(0,t.E3)(e.semType===r.semType,!0),(0,t.E3)(o.notation===r.notation,!0),(0,t.E3)(o.alphabet===r.alphabet,!0),(0,t.E3)(o.separator===r.separator,!0)})(m,{semType:e.SEMTYPE.MACROMOLECULE,notation:i,alphabet:a,separator:d});const g=f-p;if(g>o){const e=`ET ${g} ms is more than max allowed ${o} ms.`;throw console.error(e),new Error(e)}return console.log(`ET ${g} ms is OK.`),g}(o)}function s(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 o=e.Column.fromStrings("seq",["ACGT","ACGT","ACGT"]);await r.prepare({col:o}).call()})),(0,t.t6)("fastaDnaShorts50Few50",(async()=>{await o(20,c.Hi.FASTA,c.YI.DNA,50,50)})),(0,t.t6)("fastaDnaShorts50Many1E6",(async()=>{await o(20,c.Hi.FASTA,c.YI.DNA,50,1e6)})),(0,t.t6)("fastaDnaLong1e6Few50",(async()=>{await o(20,c.Hi.FASTA,c.YI.DNA,1e6,50)})),(0,t.t6)("separatorDnaShorts50Few50",(async()=>{await o(20,c.Hi.SEPARATOR,c.YI.DNA,50,50,"/")})),(0,t.t6)("separatorDnaShorts50Many1E6",(async()=>{await o(20,c.Hi.SEPARATOR,c.YI.DNA,50,1e6,"/")})),(0,t.t6)("separatorDnaLong1e6Few50",(async()=>{await o(20,c.Hi.SEPARATOR,c.YI.DNA,1e6,50,"/")}))}));var g=n(608),y=n(1619);async function b(n,r){const o=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(o);const s=e.DataFrame.fromCsv(r),i=o.getCol("seq");(0,t.E3)(i.semType,e.SEMTYPE.MACROMOLECULE);const c=s.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,o,s,i,l,u){const d=e.DataFrame.fromCsv(r);await a.data.detectSemanticTypes(d);const h=e.DataFrame.fromCsv(o).getCol("seq"),p=d.getCol("seq");(0,t.E3)(p.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(p.meta.units,s),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 b("seq\nFWRWYVKHP\nYNRWYVKHP\nMWRSWYCKHP","seq\nFWR-WYVKHP\nYNR-WYVKHP\nMWRSWYCKHP")})),(0,t.t6)("isCorrectLong",(async()=>{await b("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 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:8e4,skipReason:"Fails in docker"}),(0,t.t6)("isCorrectHelmLong",(async()=>{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:8e4,skipReason:"Fails in docker"}),(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 w=n(1991),v=n.n(w),A=n(7278),E=n(6718),C=n(6642);async function T(t){const n=await async function(e){return await _e.files.readAsText(e)}(t),r=e.DataFrame.fromCsv(n);return r.name=t.replace(".csv",""),r}async function S(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,(s=o=a.rendererBack)&&void 0!==s.onRendered&&void 0!==s.invalidate&&void 0!==s.awaitRendered?o:null);c&&await c.awaitRendered()}}var o,s}var _=n(4139),P=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)(v().count(0).take(r.length).map((e=>r.getOriginal(e))).toArray(),n)}async function N(e,n){const r=(0,A.qp)(e);console.debug(`Bio: tests: splitters: src=${JSON.stringify(e)}, res=${JSON.stringify(r)} .`),(0,t.J6)(v().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"]],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"]],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"]],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 N(r[0],r[1])})),(0,t.t6)("helm2",(async()=>{await N(o[0],o[1])})),(0,t.t6)("helm3-multichar",(async()=>{await N(s[0],s[1])})),(0,t.t6)("testHelm1",(async()=>{await N(i[0],i[1])})),(0,t.t6)("testHelm2",(async()=>{await N(a[0],a[1])})),(0,t.t6)("testHelm3",(async()=>{await N(c[0],c[1])}))})),(0,t.L1)("splitters",(()=>{let n,r,o;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),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,_.gN);const o=await a.functions.call("Bio:splitToMonomersTopMenu",{table:e,sequence:n});(0,t.E3)(o.columns.names().includes("17"),!0),await a.data.detectSemanticTypes(o);const s=a.shell.addTableView(o);await S(s.grid),(0,t.E3)(s.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"),o=await a.functions.call("Bio:getHelmMonomers",{sequence:r}),s=n.filter((e=>!o.includes(e))),i=o.filter((e=>!n.includes(e)));if(s.length>0||i.length){const e=[];throw s.length>0&&e.push(`Missed monomers ${JSON.stringify(s)}.`),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,E.pj)(),n=(0,P.ub)()})),(0,t.Pl)((async()=>{await(0,P.Eu)(n)})),(0,t.t6)("default",(async()=>{await(0,P.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,o=e.getSummaryObj();for(const e in r)r[e]||delete r[e];for(const e in o)o[e]||delete o[e];if(0==Object.keys(r).length&&0!=Object.keys(o).length)throw new Error("Expected empty monomer lib, actual is not.");if(0!=Object.keys(r).length&&0==Object.keys(o).length)throw new Error("Expected non-empty monomer lib, actual is empty.");try{(0,t.Xk)(o,r),(0,t.Xk)(r,o)}catch(e){throw new Error(`Expected monomer lib ${JSON.stringify(r)} does not match actual ${JSON.stringify(o)}.`)}}(e.getMonomerLib(),$.VV)})),(0,t.t6)("empty",(async()=>{const n=await(0,P.ub)(),r=await e.getFileManager();let o=r.getValidLibraryPaths();0===o.length&&(o=await r.getValidLibraryPathsAsynchronously()),n.exclude=o,n.explicit=[],await(0,P.Eu)(n),await e.loadMonomerLib(!0);const s=e.getMonomerLib().getPolymerTypes();(0,t.E3)(0===s.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(),o=r.getMonomer(n.polymerType,n.symbol);(0,t.E3)(null===o,!0,`Unexpectedly found monomer '${n.symbol}' `);const s=r.override({[n.polymerType]:{[n.symbol]:n}},"test").getMonomer(n.polymerType,n.symbol);s&&(s.lib=void 0),(0,t.Xk)(s,n)}))}));var x=n(7389),L=n(1757),I=n.n(L),R=n(1858),O=n(6873),k=n(5433);async function G(n,r){const o=n(),s=e.DataFrame.fromColumns(o);await a.data.detectSemanticTypes(s);const i=Date.now(),c=(s.columns.byName("MSA"),a.shell.addTableView(s));await S(c.grid),(0,t.E3)(c.grid.dataFrame.id,s.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 G(O.dW,"Long sequences")})),(0,t.t6)("many sequence performance",(async()=>{await G(O.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),o=r.getCol("Sequence"),s=await a.functions.call("Bio:detectMacromolecule",{col:o});s&&(o.semType=s);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await S(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=o.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),o=r.getCol("sequence"),s=await a.functions.call("Bio:detectMacromolecule",{col:o});s&&(o.semType=s);const i=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await S(i.grid),(0,t.E3)(i.grid.dataFrame.id,r.id);const c=o.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=_.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]),o=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await S(o.grid),(0,t.E3)(o.grid.dataFrame.id,r.id);const s=n.getTag(e.TAGS.CELL_RENDERER);(0,t.E3)(s,_.uF.MACROMOLECULE_DIFFERENCE)}()})),(0,t.t6)("afterMsa",(async()=>{await async function(){const r=await a.dapi.files.readAsText("System:AppData/Bio/samples/FASTA.fasta"),o=(await a.functions.call("Bio:importFasta",{fileContent:r}))[0],s=o.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:s});i&&(s.semType=i);const l=a.shell.addTableView(o);await a.data.detectSemanticTypes(o),console.log("Bio: tests/renderers/afterMsa, table view"),await S(l.grid),(0,t.E3)(l.grid.dataFrame.id,o.id),console.log(`Bio: tests/renderers/afterMsa, src before test semType="${s.semType}", units="${s.meta.units}", cell.renderer="${s.getTag(e.TAGS.CELL_RENDERER)}"`),(0,t.E3)(s.semType,e.SEMTYPE.MACROMOLECULE),(0,t.E3)(s.meta.units,c.Hi.FASTA),(0,t.E3)(s.getTag(c.gp.aligned),"SEQ"),(0,t.E3)(s.getTag(c.gp.alphabet),c.YI.PT),(0,t.E3)(s.getTag(e.TAGS.CELL_RENDERER),"sequence");const u=await(0,y.D)({col:s},n);await S(l.grid),(0,t.E3)(l.grid.dataFrame.id,o.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"),o=e.DataFrame.fromCsv(r),s=o.getCol("sequence"),i=await a.functions.call("Bio:detectMacromolecule",{col:s});i&&(s.semType=i);const l=a.shell.addTableView(o);await a.data.detectSemanticTypes(o);const u=await(0,k.r)(s,n,c.Hi.SEPARATOR,"/");await S(l.grid),(0,t.E3)(l.grid.dataFrame.id,o.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"),o=a.shell.addTableView(r);await S(o.grid),await r.meta.detectSemanticTypes(),await a.data.detectSemanticTypes(r);const s=r.getCol("sequence"),i=n.getSeqHandler(s).convert(c.Hi.HELM);r.columns.add(i),await S(o.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=_.uF.MACROMOLECULE_DIFFERENCE;const r=e.DataFrame.fromColumns([n]);a.shell.addTableView(r),await(0,t.cb)(100);const o=n.getTag(e.TAGS.CELL_RENDERER);if("MacromoleculeDifference"!==o)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 '${o}' instead of correct 'MacromoleculeDifference'.`)}()})),(0,t.t6)("scatterPlotTooltip",(async()=>{await async function(){const n=e.DataFrame.fromCsv(r);n.currentRowIdx=0;const o=a.shell.addTableView(n);await n.meta.detectSemanticTypes(),await a.data.detectSemanticTypes(n);const s=n.plot.scatter({x:"x",y:"y"});o.dockManager.dock(s,e.DOCK_TYPE.RIGHT,null),await Promise.all([(0,t.PE)(s.onAfterDrawScene,(()=>{}),(()=>{s.invalidateCanvas()}),1e3),S(o.grid,500)]);const i=s.root.getBoundingClientRect(),c=s.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=I()(s.root).find("canvas").get()[0];await(0,t.PE)(e.debounce((0,R.fromEvent)(u,"mousemove"),200),(()=>{_e.logger.debug(`Test: event, currentRowIdx=${n.currentRowIdx}`),(0,t.E3)(I()(x.tooltip.root).find("div table.d4-row-tooltip-table tr td canvas").length,1),(0,t.E3)(s.hitTest(c.x,c.y),1)}),(()=>{u.dispatchEvent(l)}),500),await S(o.grid,500)}()}),{skipReason:"GROK-17450"});const r="seq,x,y\nACGGTGTCGT,0,0\nCGGTATCCCT,1,0\nCTCGGCATGC,2,0\n"}));var D=n(6882);(0,t.L1)("renderers: monomerPlacer",(()=>{let n,r;(0,t.gM)((async()=>{n=await(0,E.pj)(),r=await(0,P.ub)(),await n.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(r),await n.loadMonomerLib(!0)}));const o={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:190},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(o))(0,t.t6)(`getPosition-${n}`,(async()=>{const t=e.DataFrame.fromCsv(r.csv);await a.data.detectSemanticTypes(t);const n=t.getCol("seq"),o=new D.Jy(null,n,_e.logger,3,(()=>({font:"12px monospace",fontCharWidth:7,separatorWidth:12,monomerToShort:c.zS})));await o.init();const s=r.testList;for(let e=0;e<n.length;++e)o.getCellMonomerLengths(e,1e4);const i=[];for(const[e,t]of v().enumerate(s)){const t={pos:o.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 s=[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,D.Bb)(s,n.x);(0,t.E3)(e,n.tgt)}));const l={mono1:{src:{csv:"seq\nm1/m2/m3/m4/m5/m6/m7/m8/m9\nn1/m2/n3/m4/n5/m6/n7/m8/n9\nm1/n2/m3/n4/m5/n6/m7/n8/m9\n"},tgt:{lengths:[5,31,57,83,109,135,161,187,213,239]}},monoWithGaps:{src:{csv:"seq\nm1/m2/m3/m4/m5/m6//m8/m9\nn1/m2/n3/m4/n5/m6//m8/n9\nm1/n2/m3/n4/m5/n6/m7/n8/m9\n"},tgt:{lengths:[5,31,57,83,109,135,161,187,213,239]}},monoWithGapColumn:{src:{csv:"seq\nm1/m2/m3/m4/m5/m6//m8/m9\nn1/m2/n3/m4/n5/m6//m8/n9\nm1/n2/m3/n4/m5///n8/m9\n"},tgt:{lengths:[5,31,57,83,109,135,161,180,206,232]}}};for(const[n,r]of Object.entries(l))(0,t.t6)(`getCellMonomerLengths-${n}`,(async()=>{const n=e.DataFrame.fromCsv(r.src.csv);await a.data.detectSemanticTypes(n);const o=n.getCol("seq"),s=new D.Jy(null,o,_e.logger,3,(()=>({fontCharWidth:7,font:"12px monospace",separatorWidth:12,monomerToShort:c.zS})));await s.init();const i=s.getCellMonomerLengths(0,1e3)[1];(0,t.J6)(i,r.tgt.lengths)}))})),(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 o={[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}$$$$"},s=new Set(Object.values(c.gp));async function i(t){const n=o[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(o){const s=n.getSeqHandler(o).convert(e,r);return(0,t.E3)(s.meta.units,e),s}}async function d(e,r,o){const a=(await i(e)).getCol("seq"),l=r(a),u=(await i(o)).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(!s.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 H=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 o(e){const o=new H.m(e),s=o.descriptionsArray,i=o.sequencesArray;(0,t.J6)([s,i],[n,r])}(0,t.t6)("testNormalFormatting",(async()=>{o(">description:1\nMDYKETLLMPKTDFPMRGGLPNKEPQIQEKW\n\n>description:2\nMIEVFLFGIVLGLIPITLAGLFVTAYLQYRRGDQLDL\n\n>description:3\nMMELVLKTIIGPIVVGVVLRIVDKWLNKDK\n\n>description:4\nMDRTDEVSNHTHDKPTLTWFEEIFEEYHSPFHN\n")})),(0,t.t6)("testExtraSpaces",(async()=>{o(">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()=>{o(">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 F=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 o={[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 s;!function(e){e.test1="test1",e.test2="test2"}(s||(s={}));const i={[s.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"},[s.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,s=10){const i=o[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,F.aS)(l,s),d=o[r].tgt;(0,t.J6)(u,d)}async function u(r){const o=e.DataFrame.fromCsv(r.srcCsv),s=o.getCol(r.seqCol);s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=c.Hi.FASTA;const i=r.idCols.map((e=>o.getCol(e))),a=n.getSeqHandler(s),l=(0,F.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[s.test1])})),(0,t.t6)("saveAsFastaTest2",(async()=>{u(i[s.test2])}))}));var V=n(4152),U=n(439);const Y=U._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,A.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 o=(0,A.vZ)(r,5,c.J9);(0,t.Xk)(o.freq,{A:4,C:5,G:3,T:6}),(0,t.E3)(o.sameLength,!0)}(r)})),(0,t.t6)("testGetAlphabetSimilarity",(async()=>{await async function(){const e={A:2041,C:3015,G:3015,T:2048,[Y]: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 o=e.DataFrame.fromCsv(r).col("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA;const s=(0,c.SM)(o,n);(0,t.E3)(s 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 o=(0,c.SM)(r,n);(0,t.E3)(o 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 s=(0,c.SM)(r,n);(0,t.E3)(s instanceof o.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 o=(0,c.SM)(r,n);(0,t.E3)(o instanceof V.$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])),o=n.map((e=>(0,c.zS)(e,3)));(0,t.J6)(o,r)}))}));var B=n(250);const W=U._S;function j(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),o=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.MSA");const i=await n.plot.fromType("WebLogo");await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{o.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500,"Layout calculate timeout");const l=i.positions,u=[new B.Ue(0,"1",{A:new B.Tc(2),[W]:new B.Tc(3)}),new B.Ue(1,"2",{T:new B.Tc(5)}),new B.Ue(2,"3",{C:new B.Tc(5)}),new B.Ue(3,"4",{[W]:new B.Tc(5)}),new B.Ue(4,"5",{G:new B.Tc(5)}),new B.Ue(5,"6",{[W]:new B.Tc(3),C:new B.Tc(2)}),new B.Ue(6,"7",{T:new B.Tc(5)}),new B.Ue(7,"8",{T:new B.Tc(5)}),new B.Ue(8,"9",{G:new B.Tc(5)}),new B.Ue(9,"10",{C:new B.Tc(5)}),new B.Ue(10,"11",{[W]:new B.Tc(5)}),new B.Ue(11,"12",{[W]:new B.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),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"),n.filter.init((e=>e>2)),n.filter.fireChanged();const s=await n.plot.fromType("WebLogo",{shrinkEmptyTail:!0});await(0,t.PE)(s.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(s.root,e.DOCK_TYPE.DOWN)}),500);const i=s.positions,l=[new B.Ue(0,"1",{[W]:new B.Tc(3)}),new B.Ue(1,"2",{T:new B.Tc(3)}),new B.Ue(2,"3",{[W]:new B.Tc(3)}),new B.Ue(3,"4",{[W]:new B.Tc(3)}),new B.Ue(4,"5",{C:new B.Tc(3)}),new B.Ue(5,"6",{[W]:new B.Tc(2),C:new B.Tc(1)}),new B.Ue(6,"7",{G:new B.Tc(3)}),new B.Ue(7,"8",{T:new B.Tc(3)}),new B.Ue(8,"9",{[W]:new B.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 s.awaitRendered()})),(0,t.t6)("positions with skipEmptyPositions option",(async()=>{const n=e.DataFrame.fromCsv(r),o=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.MSA");const i=await n.plot.fromType("WebLogo",{skipEmptyPositions:!0});await(0,t.PE)(i.onLayoutCalculated,(()=>{}),(()=>{o.dockManager.dock(i.root,e.DOCK_TYPE.DOWN)}),500);const l=i.positions,u=[new B.Ue(0,"1",{A:new B.Tc(2),[W]:new B.Tc(3)}),new B.Ue(1,"2",{T:new B.Tc(5)}),new B.Ue(2,"3",{C:new B.Tc(5)}),new B.Ue(4,"5",{G:new B.Tc(5)}),new B.Ue(5,"6",{[W]:new B.Tc(3),C:new B.Tc(2)}),new B.Ue(6,"7",{T:new B.Tc(5)}),new B.Ue(7,"8",{T:new B.Tc(5)}),new B.Ue(8,"9",{G:new B.Tc(5)}),new B.Ue(9,"10",{C:new B.Tc(5)})];(0,t.E3)(l.length,u.length);for(let e=0;e<l.length;e++)j(l[e],u[e]);await i.awaitRendered()})),(0,t.t6)("count sequences for monomer at position",(async()=>{const o=function(t,n,r){const o=e.DataFrame.fromCsv(t),s=o.getCol("seq");return s.semType=e.SEMTYPE.MACROMOLECULE,s.meta.units=n,s.setTag(c.gp.alphabet,r),s.setTag(c.gp.aligned,"SEQ.MSA"),o}(r,c.Hi.FASTA,c.YI.DNA),s=o.getCol("seq"),i=a.shell.addTableView(o),l=await o.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 B.Ue(2,"3",{C:new B.Tc(5)}),new B.Ue(4,"5",{G:new B.Tc(5)}),new B.Ue(5,"6",{[W]:new B.Tc(3),C:new B.Tc(2)}),new B.Ue(6,"7",{T:new B.Tc(5)})];(0,t.E3)(u.length,d.length);for(let e=0;e<u.length;e++)j(u[e],d[e]);const h=u[1],p=n.getSeqHandler(s),m=(0,B.eN)(o,p,o.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),o=await n.plot.fromType("WebLogo");await(0,t.PE)(o.onLayoutCalculated,(()=>{}),(()=>{r.dockManager.dock(o.root,e.DOCK_TYPE.DOWN)}),500),o.positions,await o.awaitRendered()}))})),(0,t.L1)("WebLogo.project",(()=>{(0,t.t6)("fasta",(async()=>{const n="Tests.Bio.WebLogo-project.fasta",r=await _e.files.readCsv("tests/filter_FASTA.csv"),o=r.name,s=r.getCol("fasta");await a.data.detectSemanticTypes(r);const i=a.shell.addTableView(r),c=await r.plot.fromType("WebLogo",{sequenceColumnName:s.name});i.dockManager.dock(c),await c.awaitRendered(),await S(i.grid),await async function(t,n,r,o){const s=e.Project.create(),i=r.saveLayout();s.name=t,s.addChild(n),s.addChild(i),await a.dapi.layouts.save(r.saveLayout()),await a.dapi.tables.uploadDataFrame(o),await a.dapi.tables.save(n),await a.dapi.projects.save(s)}(n,r.getTableInfo(),i,r),a.shell.closeAll(),await(0,t.cb)(500),await a.dapi.projects.open(n);const l=a.shell.getTableView(o),u=v()(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 S(i.grid),await d.awaitRendered()}),{skipReason:"depends on 1.18"})})),(0,t.L1)("WebLogo.layout",(()=>{(0,t.t6)("fasta",(async()=>{const e=await _e.files.readCsv("tests/filter_FASTA.csv"),n=e.getCol("fasta");await a.data.detectSemanticTypes(e);const r=a.shell.addTableView(e),o=await e.plot.fromType("WebLogo",{sequenceColumnName:n.name});r.dockManager.dock(o),await(0,t.cb)(2*B.VN.render),await o.awaitRendered(),await S(r.grid);const s=r.saveLayout();s.toJson(),r.loadLayout(s),await(0,t.cb)(2*B.VN.render),await o.awaitRendered(),await S(r.grid);const i=v()(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 K=n(966);function q(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 o=e.DataFrame.fromCsv(r).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");const[s,i]=(0,K.l)(o,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(s,!0)})),(0,t.t6)("testMsaNegHelm",(async()=>{const o=e.DataFrame.fromCsv(r).getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.HELM,o.setTag(c.gp.alphabetIsMultichar,"true");const[s,i]=(0,K.l)(o,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(s,!1)})),(0,t.t6)("testMsaNegUN",(async()=>{const o=e.DataFrame.fromCsv(r).getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,"UN"),o.setTag(c.gp.alphabetSize,"11"),o.setTag(c.gp.alphabetIsMultichar,"true"),o.setTag(c.gp.aligned,"SEQ");const[s,i]=(0,K.l)(o,"Test",n,[c.Hi.FASTA],[c.YI.DNA,c.YI.RNA,c.YI.PT]);(0,t.E3)(s,!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 _e.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n);await a.data.detectSemanticTypes(r);const o=a.shell.addTableView(r),s=o.dataFrame.getCol("MSA");(0,t.E3)(s.semType,e.SEMTYPE.MACROMOLECULE);const i=await o.dataFrame.plot.fromType("Sequence Similarity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),o.dockManager.dock(i,e.DOCK_TYPE.RIGHT,null,"Similarity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==q(o,"Sequence Similarity Search")),"Sequence Similarity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.targetColumn)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"),o.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 _e.files.readAsText("tests/sample_MSA_data.csv"),r=e.DataFrame.fromCsv(n),o=a.shell.addTableView(r);await a.data.detectSemanticTypes(r);const s=o.dataFrame.getCol("MSA");(0,t.E3)(s.semType,e.SEMTYPE.MACROMOLECULE);const i=await o.dataFrame.plot.fromType("Sequence Diversity Search");let c=!1;if(i.computeCompleted.subscribe((e=>{e&&(c=!0)})),o.dockManager.dock(i,e.DOCK_TYPE.DOWN,null,"Diversity"),await i.renderPromise,await(0,t.bk)((()=>void 0!==q(o,"Sequence Diversity Search")),"Sequence Diversity Search viewer has not been created",100),!i.initialized)throw new Error("The viewer is not initialized.");if(!i.targetColumn)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),Z=n(4574);(0,t.L1)("bio-substructure-filters",(async()=>{let n,r,o;async function s(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,_e.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,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),await r.loadMonomerLib(!0)})),(0,t.t6)("fasta",(async()=>{const e=await T("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const r=new z._i(n,_e.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 Z.n("MD",void 0,_e.logger)}),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 T("tests/filter_MSA.csv"),r=new z._i(n,_e.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",void 0,_e.logger)}),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",void 0,_e.logger)}),5e3,"testEvent onRowsFiltered"),(0,t.E3)(r.dataFrame.filter.trueCount,0),await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{n.props=new z.AR("meI-hHis","-",_e.logger)}),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()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e="Bio tests: substructureFilters/helm-dialog",r=await T("tests/filter_HELM.csv"),o=a.shell.addTableView(r);await a.data.detectSemanticTypes(r),await r.meta.detectSemanticTypes(),_e.logger.debug(`${e}, filter attaching.`);const s=new z._i(n,_e.logger);s.attach(r);const i=x.dialog("Test filters").add(s.root).show();await s.awaitRendered();try{const n=s.bioFilter;(0,t.E3)(null!==s.bioFilter,!0,"bioFilter is not created"),_e.logger.debug(`${e}, filter 1 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.n("PEPTIDE1{A.C}$$$$V2.0",void 0,_e.logger)}),2e4),_e.logger.debug(`${e}, filter 1 changed.`),(0,t.E3)(s.dataFrame.filter.trueCount,1),(0,t.E3)(s.dataFrame.filter.toBinaryString(),"0001"),_e.logger.debug(`${e}, filter 2 change awaiting...`),await(0,t.PE)(r.onRowsFiltered,(()=>{}),(()=>{n.props=new Z.n("PEPTIDE1{C}$$$$V2.0",void 0,_e.logger)}),2e4),setTimeout((()=>o.grid.invalidate()),500),await S(o.grid),await(0,t.cb)(1e3),_e.logger.debug(`${e}, filter 2 changed.`),(0,t.E3)(s.dataFrame.filter.trueCount,2),(0,t.E3)(s.dataFrame.filter.toBinaryString(),"1001")}finally{i.close()}await s.awaitRendered(),await(0,t.cb)(3e3)}}),{}),(0,t.t6)("helm-view",(async()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e=await T("tests/filter_HELM.csv");e.getCol("HELM string"),await a.data.detectSemanticTypes(e);const t=a.shell.addTableView(e);t.getFiltersGroup(),await S(t.grid)}})),(0,t.t6)("sync-fasta",(async()=>{const e=await _e.files.readCsv("tests/filter_FASTA.csv");await a.data.detectSemanticTypes(e);const n=await s("fasta",e),r=await s("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 o=n.bioFilter,s=r.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{o.props=new Z.n("MD",void 0,_e.logger)}),1e4,"await onRowsFiltered"),(0,t.E3)(e.filter.trueCount,3),await n.awaitRendered(),(0,t.E3)(s.props.substructure,"MD")}finally{n.detach(),r.detach()}await Promise.all([n.awaitRendered(),r.awaitRendered()])})),(0,t.t6)("sync-msa",(async()=>{const e=await _e.files.readCsv("tests/filter_MSA.csv");await a.data.detectSemanticTypes(e);const n="hHis-Aca",r=await s("MSA",e),o=await s("MSA",e);await Promise.all([r.awaitRendered(),o.awaitRendered()]);try{(0,t.E3)(!!r.bioFilter,!0),(0,t.E3)(!!o.bioFilter,!0),(0,t.E3)(r.bioFilter.type,"SeparatorBioFilter"),(0,t.E3)(o.bioFilter.type,"SeparatorBioFilter");const s=r.bioFilter,i=o.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{s.props=new z.AR(n,"-",_e.logger)}),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(),o.detach()}await Promise.all([r.awaitRendered(),o.awaitRendered()])})),(0,t.t6)("sync-helm",(async()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e=await _e.files.readCsv("tests/filter_HELM.csv");await a.data.detectSemanticTypes(e);const n=a.shell.addTableView(e),r="PEPTIDE1{A.C}$$$$V2.0",o=1,i=await s("HELM string",e),c=await s("HELM string",e),l=x.dialog("Test filters").add(i.root).add(c.root).show();await Promise.all([i.awaitRendered(),c.awaitRendered()]);try{(0,t.E3)(!!i.bioFilter,!0),(0,t.E3)(!!c.bioFilter,!0),(0,t.E3)(i.bioFilter.type,"HelmBioFilter"),(0,t.E3)(c.bioFilter.type,"HelmBioFilter");const s=i.bioFilter,a=c.bioFilter;await(0,t.PE)(e.onRowsFiltered,(()=>{}),(()=>{s.props=new Z.n(r,void 0,_e.logger)}),6e4,"await onRowsFiltered"),await S(n.grid),_e.logger.debug("Bio tests: substructureFilters/sync-helm, before changed event"),await(0,t.cb)(2*i.debounceTime),_e.logger.debug("Bio tests: substructureFilters/sync-helm, after changed event"),(0,t.E3)(e.filter.trueCount,o),await i.awaitRendered(),(0,t.E3)(a.props.substructure,r)}finally{i.detach(),c.detach(),l.close()}await Promise.all([i.awaitRendered(),c.awaitRendered()]),await S(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),o="seq1",s="CGGCTG",i=n.getCol("trueSeq1").toList(),c="seq2",l="GCATT",u=n.getCol("trueSeq2").toList(),d=[{type:"Bio:bioSubstructureFilter",columnName:o},{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 S(r.grid);const p=h.filters[0],m=h.filters[1];(0,t.E3)(p.column.name,o),(0,t.E3)(m.column.name,c);const f=p.bioFilter,g=m.bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new Z.n(s,void 0,_e.logger)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n("",void 0,_e.logger)}),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 Z.n("",void 0,_e.logger)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n(l,void 0,_e.logger)}),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 Z.n("",void 0,_e.logger)}),1e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n("",void 0,_e.logger)}),1e3,"testEvent onRowsFiltered on neither"),(0,t.E3)(n.filter.trueCount,n.rowCount),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{f.props=new Z.n(s,void 0,_e.logger)}),5e3),await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{g.props=new Z.n(l,void 0,_e.logger)}),5e3,"testEvent onRowsFiltered on both");const y=v().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(),S(r.grid)])}),{skipReason:"Inconsistent behavior of test"}),(0,t.t6)("reset-fasta",(async()=>{const n=await T("tests/filter_FASTA.csv"),r=a.shell.addTableView(n);await a.data.detectSemanticTypes(n),await n.meta.detectSemanticTypes();const o="MD",s=await n.plot.fromType(e.VIEWER.FILTERS,{filters:[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}]});r.dockManager.dock(s,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await S(r.grid);const i=s.filters[0].bioFilter;await(0,t.PE)(n.onRowsFiltered,(()=>{}),(()=>{i.props=new Z.n(o,void 0,_e.logger)}),1e3,"testEvent onRowsFiltered"),(0,t.E3)(n.filter.trueCount,3),(0,t.E3)(i.props.substructure,o),(0,t.E3)(i.substructureInput.value,o),I()(s.root).find('i[name="icon-arrow-rotate-left"]')[0].click(),await(0,t.cb)(100),await S(r.grid),(0,t.E3)(i.props.substructure,""),(0,t.E3)(i.substructureInput.value,"")})),(0,t.t6)("reopen",(async()=>{const n=await _e.files.readCsv("tests/filter_FASTA.csv"),r=a.shell.addTableView(n);await a.data.detectSemanticTypes(n),await n.meta.detectSemanticTypes();const o=[{type:"Bio:bioSubstructureFilter",columnName:"fasta"}],s=await n.plot.fromType(e.VIEWER.FILTERS,{filters:o});r.dockManager.dock(s,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await S(r.grid),s.close(),await S(r.grid);const i=await n.plot.fromType(e.VIEWER.FILTERS,{filters:o});r.dockManager.dock(i,e.DOCK_TYPE.LEFT),await(0,t.cb)(100),await S(r.grid)}),{})}));var X=n(8152);class Q{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 J=n(9192);(0,t.L1)("PepSeA",(()=>{(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,X.GD)(n.getCol("HELM"),"msa(HELM)"),o=n.getCol("MSA");for(let e=0;e<r.length;++e)(0,t.E3)(r.get(e)==o.get(e),!0)}),{timeout:6e4,stressTest:!0,skipReason:"Fails in docker"}),(0,t.t6)("stderr",(async()=>{const n=new Q,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'),o=await(0,X.GD)(r.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n),s=r.getCol("MSA");(0,t.J6)(o.toList(),s.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,skipReason:"Fails in docker"}),(0,t.t6)("error",(async()=>{const n=new Q;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,X.GD)(t.getCol("HELM"),"msa(HELM)",void 0,void 0,void 0,void 0,n)}catch(e){const[t,r]=(0,J.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")}),{skipReason:"Fails in docker"})})),(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 T("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 ee="seq\nACGTCACGTC\nCAGTGTCAGTGT\nTTCAACTTCAAC",te="seq\nAC-GT-CTAC-GT-CT\nCAC-T-GTCAC-T-GT\nACCGTACTACCGTACT",ne="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 re,oe;(0,t.L1)("SeqHandler",(()=>{let n;async function r(t){const r=e.DataFrame.fromCsv(t);await a.data.detectSemanticTypes(r);const o=n.getSeqHandler(r.getCol("seq"));return[r,o]}(0,t.gM)((async()=>{n=await(0,l.Q)()})),(0,t.t6)("Seq-Fasta",(async()=>{const[e,n]=await r(ee);(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(te);(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(ee);(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(te);(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(ne);(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(ne);(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(ee);await a.data.detectSemanticTypes(r);const o=r.getCol("seq"),s=n.getSeqHandler(o),i=o.version,c=n.getSeqHandler(o),l=o.version;(0,t.E3)(i,l,"Unexpected column version changed"),(0,t.E3)(s,c,"Unexpected SeqHandler object changed"),r.rows.addNew(["TACCCCTTCAAC"]);const u=n.getSeqHandler(o),d=o.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"),o.set(1,"CAGTGTCCCCGT");const h=n.getSeqHandler(o),p=o.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"),o.setTag("testTag","testValue");const m=n.getSeqHandler(o),f=o.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")}))})),(oe=re||(re={})).fasta="fasta",oe.fastaMsa="fastaMsa",oe.separator="separator",oe.separatorMsa="separatorMsa",oe.helm="helm",(0,t.L1)("SeqHandler: splitted",(()=>{let n;(0,t.gM)((async()=>{n=await(0,l.Q)()})),U.b9[c.Hi.FASTA],U.b9[c.Hi.HELM];const r=U.b9[c.Hi.SEPARATOR],o={[re.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"]]}},[re.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"]]}},[re.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"]]}},[re.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]]}},[re.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}$$$$,\nPEPTIDE1{meI.hHis.Aca.Cys_SEt.T.dK.Thr_PO3H2.T.dK}|PEPTIDE2{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"],["meI","hHis","Aca","Cys_SEt","T","dK","Thr_PO3H2","T","dK","Thr_PO3H2"]]}}};for(const[r,s]of Object.entries(o))(0,t.t6)(`${r}`,(async()=>{const r=e.DataFrame.fromCsv(s.src.csv).getCol("seq"),o=await a.functions.call("Bio:detectMacromolecule",{col:r});o&&(r.semType=o),(0,t.E3)(r.semType,e.SEMTYPE.MACROMOLECULE);const i=n.getSeqHandler(r);(0,t.E3)(i.notation,s.tgt.notation),(0,t.E3)(i.separator===s.tgt.separator,!0);const c=v().count(0).take(i.length).map((e=>{const t=i.getSplitted(e);return v().count(0).take(t.length).map((e=>t.getOriginal(e))).toArray()})).toArray();(0,t.J6)(c,s.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:c.YI.UN,positionNames:{tag:null,start:"4",end:"7"}}};for(const[o,s]of Object.entries(r))(0,t.t6)(`${o}-idx`,(async()=>{const r=e.DataFrame.fromCsv(s.srcCsv).getCol("seq"),o=await a.functions.call("Bio:detectMacromolecule",{col:r});o&&(r.semType=o);const i=n.getSeqHandler(r).getRegion(s.startIdx,s.endIdx,"regSeq"),l=e.DataFrame.fromCsv(s.tgtCsv).getCol("seq");(0,t.E3)(r.meta.units,s.units),(0,t.E3)(i.meta.units,s.units),(0,t.E3)(r.getTag(c.gp.alphabet),s.alphabet),(0,t.E3)(i.getTag(c.gp.alphabet),s.alphabet),(0,t.J6)(i.toList(),l.toList())})),s.positionNames&&(0,t.t6)(`${o}-positionNames`,(async()=>{const n=e.DataFrame.fromCsv(s.srcCsv).getCol("seq");s.positionNames.tag&&n.setTag(c.gp.positionNames,s.positionNames.tag);const r=await a.functions.call("Bio:detectMacromolecule",{col:n});r&&(n.semType=r);const o=await a.functions.call("Bio:getRegion",{sequence:n,start:s.positionNames.start,end:s.positionNames.end}),i=e.DataFrame.fromCsv(s.tgtCsv).getCol("seq");(0,t.E3)(n.meta.units,s.units),(0,t.E3)(o.meta.units,s.units),(0,t.E3)(n.getTag(c.gp.alphabet),s.alphabet),(0,t.E3)(o.getTag(c.gp.alphabet),s.alphabet),(0,t.J6)(o.toList(),i.toList())}))})),(0,t.L1)("SeqHandler: getHelm",(()=>{let n,r,o;(0,t.gM)((async()=>{n=await(0,l.Q)(),r=await(0,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),await r.loadMonomerLib(!0)}));const s={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(s))(0,t.t6)(e,(async()=>{await i(n.src.seq,n.src.notation,n.src.separator,n.tgt.helm)}));async function i(r,o,s,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.getValue(0)).helm;(0,t.E3)(d,i)}}));var se=n(6956);class ie{constructor(e){const t=e.split(se.xe).filter((e=>e));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 o=r[t],s=e.split(":"),i={monomerIdx:parseInt(s[0])-1,rGroupId:parseInt(s[1].slice(1))};n.push({polymerId:o,bond:i})})),e.push(n)})),e}}var ae=n(8438);class ce{simplePolymer;isNucleotideSequence=!1;constructor(e){this.simplePolymer=e,this.polymerType=this.getPolymerType(),this.isNucleotideSequence="RNA"===this.polymerType,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=>{if(this.isNucleotideSequence){const t=e.split(/\(|\)/).filter((e=>!!e)).map((e=>(0,ae.D)(e)));n.push(...t),t.forEach(((e,t)=>r.push(t%3==1?"Branch":"Backbone")))}else n.push((0,ae.D)(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],o=t[n+1];e.push([{monomerIdx:r,rGroupId:2},{monomerIdx:o,rGroupId:1}])}for(let t=0;t<n.length;t++){const r=n[t],o=r-1;e.push([{monomerIdx:o,rGroupId:3},{monomerIdx:r,rGroupId:1}])}return e}}class le{helmString;constructor(e){this.helmString=e;const t=this.helmString.split(se.pk),n=t[0].split(se.xe);this.simplePolymers=n.map((e=>new ce(e))),this.connectionList=new ie(t[1]),this.bondData=this.getBondData(),this.bondedRGroupsMap=this.getBondedRGroupsMap()}bondData;simplePolymers;connectionList;bondedRGroupsMap;getBondedRGroupsMap(){const e=this.simplePolymers.map((e=>e.monomers.length)).reduce(((e,t)=>e+t),0),t=Array.from({length:e},(()=>[]));return this.bondData.forEach((e=>{e.forEach((e=>{const n=e.monomerIdx,r=e.rGroupId;t[n].push(r)}))})),t}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(),o=e[n.id];this.shiftBondMonomerIds(o,r),t.push(...r)})),this.connectionList.getConnectionData().forEach((n=>{const r=[];n.forEach((t=>{const n=e[t.polymerId],o=t.bond;o.monomerIdx+=n,r.push(o)})),t.push(r)})),t}}(0,t.L1)("helm",(()=>{const e={"single-linear":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T.[meI]}$$$$"},tgt:{simplePolymers:[6],connections:[],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],connections:[[["PEPTIDE1",3,"R3"],["PEPTIDE1",8,"R3"]]],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],connections:[[["PEPTIDE1",2,"R3"],["PEPTIDE1",7,"R3"]]],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,1:R3-6:R3$$$"},tgt:{simplePolymers:[6],connections:[[["PEPTIDE1",1,"R3"],["PEPTIDE1",6,"R3"]]],bondedRGroups:[2,2,2,2,2,2]}},"two-separated-5-1":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz].T}|PEPTIDE2{[meI]}$$$$"},tgt:{simplePolymers:[5,1],connections:[],bondedRGroups:[1,2,2,2,1,0]}},"two-separated-1-5":{src:{helm:"PEPTIDE1{[meI]}|PEPTIDE2{R.F.Y.[GGaz].T}$$$$"},tgt:{simplePolymers:[1,5],connections:[],bondedRGroups:[0,1,2,2,2,1]}},"two-separated-4-2":{src:{helm:"PEPTIDE1{R.F.Y.[GGaz]}|PEPTIDE2{T.[meI]}$$$$"},tgt:{simplePolymers:[4,2],connections:[],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],connections:[[["PEPTIDE1",5,"R2"],["PEPTIDE2",1,"R1"]]],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],connections:[[["PEPTIDE1",4,"R2"],["PEPTIDE2",1,"R1"]]],bondedRGroups:[1,2,2,2,2,1]}},"two-cyclized-1-9":{src:{helm:"PEPTIDE1{[meI]}|PEPTIDE2{R.F.[GGaz].T.G.H.F.Y.P}$PEPTIDE2,PEPTIDE2,3:R3-9:R2|PEPTIDE2,PEPTIDE1,3:R4-1:R1$$$V2.0"},tgt:{simplePolymers:[1,9],connections:[[["PEPTIDE2",3,"R3"],["PEPTIDE2",9,"R2"]],[["PEPTIDE2",3,"R4"],["PEPTIDE1",1,"R1"]]],bondedRGroups:[1,1,2,4,2,2,2,2,2,1]}}};for(const[n,{src:r,tgt:o}]of Object.entries(e))(0,t.t6)(n,(async()=>{const e=new le(r.helm),n=e.simplePolymers.map((e=>e.monomers.length)),s=n.reduce(((e,t)=>e+t),0);(0,t.J6)(n,o.simplePolymers);const i=e.connectionList.getConnectionData().map((e=>[[e[0].polymerId,e[0].bond.monomerIdx+1,`R${e[0].bond.rGroupId}`],[e[1].polymerId,e[1].bond.monomerIdx+1,`R${e[1].bond.rGroupId}`]]));(0,t.J6)(i,o.connections);const a=v().count(0).take(e.bondedRGroupsMap.length).map((t=>e.bondedRGroupsMap[t].length)).toArray();(0,t.E3)(s,a.length)}))}));var ue=n(6077),de=n(6717);const he=new e.FileSource("System:AppData/Bio"),pe={"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"}},me="molfile(sequence)";function fe(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 o,s,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 o=e.getCol(me),s=n.getCol(me),i=v()(o.values()).map((e=>fe(e))).toArray(),c=v()(s.values()).map((e=>fe(e))).toArray();(0,t.J6)(i,c)}(0,t.gM)((async()=>{d=await(0,de.j)(),i=await(0,l.Q)(),o=await(0,E.pj)(),s=await(0,P.ub)(),await o.loadMonomerLibForTests(),u=o.getMonomerLib();for(const[t,o]of Object.entries(pe))o.inPath,n[t]=e.DataFrame.fromCsv((await he.readAsText(o.inPath)).replace(/\n$/,"")),await a.data.detectSemanticTypes(n[t]),r[t]=e.DataFrame.fromCsv((await he.readAsText(o.outPath)).replace(/\n$/,""))})),(0,t.Pl)((async()=>{await(0,P.Eu)(s),await o.loadMonomerLib(!0)}));for(const[e,o]of Object.entries(pe))(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),o=await(0,ue.C4)(e,r,u,i,d);return o.warnings.length>0&&_e.logger.warning(`_toAtomicLevel() warnings ${o.warnings.join("\n")}`),o.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 _e.files.readAsText("tests/to-atomic-level-pt-fasta-2.mol"),r=e.DataFrame.fromCsv("seq\nAR"),o=r.getCol("seq");o.semType=e.SEMTYPE.MACROMOLECULE,o.meta.units=c.Hi.FASTA,o.setTag(c.gp.alphabet,c.YI.PT),i.getSeqHandler(o);const s=await g(r,"seq");(0,t.E3)(fe(s.get(0)),fe(n))}))}));var ge=n(8754);(0,t.L1)("toAtomicLevel-ui",(()=>{let n,r,o,s,i;(0,t.gM)((async()=>{o=await(0,l.Q)(),i=await(0,de.j)(),n=await(0,E.pj)(),r=await(0,P.ub)(),await n.loadMonomerLibForTests(),s=n.getMonomerLib()})),(0,t.Pl)((async()=>{await(0,P.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)}));if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length)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,ge.V)(n.dataFrame,n,r,!1,s,o,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 ye=n(6863);async function be(t,n){const r=e.DataFrame.fromCsv(t),o=r.col("seq"),s=await a.functions.call("Bio:detectMacromolecule",{col:o});return s&&(o.semType=s),await a.data.detectSemanticTypes(r),n.getSeqHandler(o)}function we(e,n,r,o){const s=r(e,n);(0,t.E3)(Number(s.toFixed(3)),Number(o.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]],o={F:0,W:1,R:2,Y:3},s="FWRWY",i="FWRWW",a="FWY",c="FWRWY",u="FWY",d="FWRRRRY";(0,t.t6)("protein-distance-function",(async()=>{const e=(await be("seq\nFWRWYVKHPFWRWYVKHP\nYNRWYVKHPYNRWYVKHP\nMWRSWYCKHPMWRSWYCKHP",n)).getDistanceFunctionName();(0,t.E3)(e,ye.Z.LEVENSHTEIN)})),(0,t.t6)("DNA-distance-function",(async()=>{const e=(await be("seq\nATAACGATAACG\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ye.Z.LEVENSHTEIN)})),(0,t.t6)("MSA-distance-function",(async()=>{const e=(await be("seq\nATAACATAAC\nATCGAATCGA\nATCGAATCGA",n)).getDistanceFunctionName();(0,t.E3)(e,ye.Z.HAMMING)})),(0,t.t6)("levenstein-sub",(async()=>{const e=ye.V[ye.Z.LEVENSHTEIN]();we(s,i,e,.2)})),(0,t.t6)("levenstein-del",(async()=>{const e=ye.V[ye.Z.LEVENSHTEIN]();we(a,c,e,.4)})),(0,t.t6)("hamming",(async()=>{const e=ye.V[ye.Z.HAMMING]();we(a,c,e,.6)})),(0,t.t6)("needleman-blosum62",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});we(s,i,e,-6)})),(0,t.t6)("needleman-blosum62-del",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({gapOpen:8,gapExtend:2});we(a,c,e,-3.667)})),(0,t.t6)("needleman-custom-sub",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:1});we(s,i,e,.2)})),(0,t.t6)("needleman-custom-del",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:1});we(a,c,e,.667)})),(0,t.t6)("needleman-custom-zero-extend",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:0});we(u,d,e,.333)})),(0,t.t6)("needleman-custom-half-extend",(async()=>{const e=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:2,gapExtend:1});we(u,d,e,1.667)})),(0,t.t6)("needleman-custom-same-extend",(async()=>{const t=ye.V[ye.Z.NEEDLEMANN_WUNSCH]({scoringMatrix:r,alphabetIndexes:o,gapOpen:1,gapExtend:1});e.Test.isInBenchmark?we(Array(1e3).fill(u).join(""),Array(1e3).fill(d).join(""),t,1.333):we(u,d,t,1.333)}),{benchmark:!0})}));var ve=n(684);async function Ae(e,n,r,o,s,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(o),similarity:s,methodName:n,similarityMetric:c,preprocessingFunction:l,options:{[`${ve.vb}`]:!0},demo:!1});(0,t.E3)(null!=u,!0),await(0,t.bk)((()=>{const e=Array.from(u.root.getElementsByClassName("scatter_plot_link"));return!e.length||e[0].innerText.toLowerCase()===`${i} cliffs`}),"incorrect cliffs link",3e3)}var Ee=n(2780),Ce=n(9039),Te=n(9124);async function Se(n,r,o){const s=n.getCol(o);n.name="seqSpaceDf";const i=await a.functions.call("Bio:detectMacromolecule",{col:s});i&&(s.semType=i);const c=e.Func.find({package:"Bio",name:"macromoleculePreprocessingFunction"})[0];if(!c)throw new Error("Preprocessing function not found");await a.functions.call("Bio:sequenceSpaceTopMenu",{table:n,molecules:n.col(o),methodName:r,similarityMetric:ye.Z.LEVENSHTEIN,plotEmbeddings:!0,preprocessingFunction:c,options:{[ve.vb]:!0}});const l=a.shell.tableView(n.name),u=Array.from(l?.viewers??[])[1];(0,t.E3)(null!=u)}(0,t.L1)("activityCliffs",(async()=>{let n,r,o;const s=e.Func.find({name:"macromoleculePreprocessingFunction",package:"Bio"})[0],i=e.Func.find({name:"helmPreprocessingFunction",package:"Bio"})[0];(0,t.gM)((async()=>{e.Func.find({package:"Helm",name:"getHelmHelper"}).length&&(n=await(0,Te.b2)()),r=await(0,E.pj)(),o=await(0,P.ub)(),await r.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(o),await r.loadMonomerLib(!0)})),(0,t.t6)("activityCliffsOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_with_random_motif_1600.csv",tgt:{cliffCount:64}}:{fileName:"tests/100_3_clustests.csv",tgt:{cliffCount:3}},n=await T(t.fileName);a.shell.addTableView(n),await Ae(n,Ce.c.UMAP,"sequence","Activity",90,t.tgt.cliffCount,ye.Z.LEVENSHTEIN,s)}),{benchmark:!0,skipReason:"Fails"}),(0,t.t6)("activityCliffsWithEmptyRows",(async()=>{const e=await T("tests/100_3_clustests_empty_vals.csv");a.shell.addTableView(e),await Ae(e,Ce.c.UMAP,"sequence","Activity",90,3,ye.Z.LEVENSHTEIN,s)})),(0,t.t6)("Helm",(async()=>{if(e.Func.find({package:"Helm",name:"getHelmHelper"}).length){const e=await _e.files.readCsv("samples/HELM_50.csv");a.shell.addTableView(e),await Ae(e,Ce.c.UMAP,"HELM","Activity",65,20,Ee.aT.Tanimoto,i)}}))})),(0,t.L1)("sequenceSpace",(async()=>{let n,r,o,s;(0,t.t6)("sequenceSpaceOpens",(async()=>{const t=e.Test.isInBenchmark?{fileName:"tests/peptides_with_random_motif_1600.csv"}:{fileName:"tests/100_3_clustests.csv"};n=await T(t.fileName),r=a.shell.addTableView(n),await Se(n,Ce.c.UMAP,"sequence")}),{benchmark:!0}),(0,t.t6)("sequenceSpaceWithEmptyRows",(async()=>{o=await T("tests/100_3_clustests_empty_vals.csv"),s=a.shell.addTableView(o),await Se(o,Ce.c.UMAP,"sequence")}))})),(0,t.L1)("Scoring",(()=>{const n="sequence",r="expected_similarity",o="expected_identity",s=e.DataFrame.fromCsv(`${n},${r},${o}\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.691,0.53\nPEPTIDE1{[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal]}$$$$V2.0,0.37,0.0`),i=s.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,E.pj)(),d=await(0,P.ub)(),await u.loadMonomerLibForTests()})),(0,t.Pl)((async()=>{await(0,P.Eu)(d),await u.loadMonomerLib(!0)})),(0,t.t6)("Identity",(async()=>{const e=await a.functions.call("Bio:sequenceIdentityScoring",{table:s,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const r=e.get(n),i=s.get(o,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:s,macromolecule:i,reference:"PEPTIDE1{Iva.Gly_allyl.gGlu.Pqa.D-Dip.dH.hHis.4Abz.D-aHyp.D-Dap.Y.Iva}$$$$"});(0,t.E3)(v().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:s,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)(v().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:s,macromolecule:i,reference:l});for(let n=0;n<e.length;n++){const o=e.get(n),i=s.get(r,n);(0,t.Wj)(o,i,.01,`Wrong similarity score for sequence at position ${n}`)}}))}));const _e=new e.Package;async function Pe(n,r,o,s){const i=await(0,t.N$)({category:n,test:r,testContext:o,stressTest:s});return e.DataFrame.fromObjects(i)}async function Me(){await(0,t.Xb)(_e,_e.getModule("package-test.js"))}})(),bio_test=r})();
|
|
8
8
|
//# sourceMappingURL=package-test.js.map
|