var _extends=Object.assign||function(a){for(var b,c=1;cthis.remove(a),render:()=>this.render(a)};let d={};for(var e in c)d[e]={value:c[e]};let f={ctor:b,id:a,inputs:d,readOnly:!0};return this.loadModule(f),this.refresh(!0),{id:f.id,remove:()=>this.remove(f.id),render:()=>this.render(f.id)}}loadModule(a,b=!1){a.inputs=a.inputs||{},a.outputs=a.outputs||{},a.children=a.children||[];let{ctor:c,id:d,inputs:e,outputs:f,children:g,readOnly:h}=a;if(void 0===this.availableModules[c])return void Logger.warning('Module '+c+' is not bundled! You either forgot to add it to ModuleSystem or it doesn\'t exist!');let j=[];for(var k in this.availableModules[c].Inputs){let a=this.availableModules[c].Inputs[k].defaultValue;e[k]&&(a=e[k].value||a),e[k]={name:k,value:a,pid:d,arrType:this.availableModules[c].Inputs[k].arrType,type:this.availableModules[c].Inputs[k].type},j[k]=this.LinkManager.addInputRef(e[k])}let l=[];for(var k in this.availableModules[c].Outputs)f[k]={name:k,pid:d,arrType:this.availableModules[c].Outputs[k].arrType,type:this.availableModules[c].Outputs[k].type},l[k]=this.LinkManager.addOutputRef(f[k]);this.__addToScene(_extends({},a,{children:[...g],inrefs:j,outrefs:l,key:''+d+d}))}connect(a,b){this.LinkManager.createLink(a,b)}rename(a,b){for(var c in this.metamodules){// only first child let d=this.metamodules[c].children.indexOf(a);-1b);// i < 2 for only change parent }_shuffleKey(a){a.key=a.id+Math.random()%231231}__Factory(a){let b=[];for(var c=0;cthis.resolved[a])}has(a){return this.modules[a]}export(){return Object.keys(this.resolved).map(a=>{let b=this.resolved[a];return{ctor:b.ctor,children:b.children,id:b.id,inputs:b.inputs,outputs:b.outputs,key:b.key,readOnly:b.readOnly}})}}export default ModuleSystem;