You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
145 KiB
1 line
145 KiB
(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[8257],{10795:function(ee,vt,Et){var R;ee.exports=(R=Et(34355),(()=>{"use strict";var y={658:o=>{o.exports=null!=Object.assign?Object.assign.bind(Object):function(E){for(var t=arguments.length,d=Array(t>1?t-1:0),e=1;e<t;e++)d[e-1]=arguments[e];return d.forEach(function(r){Object.keys(r).forEach(function(l){return E[l]=r[l]})}),E}},548:(o,E,t)=>{var d=function(){function l(g,c){var T=[],f=!0,A=!1,N=void 0;try{for(var D,L=g[Symbol.iterator]();!(f=(D=L.next()).done)&&(T.push(D.value),!c||T.length!==c);f=!0);}catch(et){A=!0,N=et}finally{try{!f&&L.return&&L.return()}finally{if(A)throw N}}return T}return function(g,c){if(Array.isArray(g))return g;if(Symbol.iterator in Object(g))return l(g,c);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),e=t(140).layoutBase.LinkedList,r={getTopMostNodes:function(l){for(var g={},c=0;c<l.length;c++)g[l[c].id()]=!0;return l.filter(function(f,A){"number"==typeof f&&(f=A);for(var N=f.parent()[0];null!=N;){if(g[N.id()])return!1;N=N.parent()[0]}return!0})},connectComponents:function(l,g,c,T){var f=new e,A=new Set,N=[],L=void 0,D=void 0,et=void 0,x=!1,nt=1,dt=[],ct=[],mt=function(){var J=l.collection();ct.push(J);var i=c[0],m=l.collection();m.merge(i).merge(i.descendants().intersection(g)),N.push(i),m.forEach(function(p){f.push(p),A.add(p),J.merge(p)});for(var h=function(){i=f.shift();var I=l.collection();i.neighborhood().nodes().forEach(function(P){g.intersection(i.edgesWith(P)).length>0&&I.merge(P)});for(var w=0;w<I.length;w++){var X=I[w];null==(L=c.intersection(X.union(X.ancestors())))||A.has(L[0])||L.union(L.descendants()).forEach(function(P){f.push(P),A.add(P),J.merge(P),c.has(P)&&N.push(P)})}};0!=f.length;)h();if(J.forEach(function(p){g.intersection(p.connectedEdges()).forEach(function(I){J.has(I.source())&&J.has(I.target())&&J.merge(I)})}),N.length==c.length&&(x=!0),!x||x&&nt>1){D=N[0],et=D.connectedEdges().length,N.forEach(function(p){p.connectedEdges().length<et&&(et=p.connectedEdges().length,D=p)}),dt.push(D.id());var u=l.collection();u.merge(N[0]),N.forEach(function(p){u.merge(p)}),N=[],c=c.difference(u),nt++}};do{mt()}while(!x);return T&&dt.length>0&&T.set("dummy"+(T.size+1),dt),ct},relocateComponent:function(l,g,c){if(!c.fixedNodeConstraint){var T=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY;if("draft"==c.quality){var L=!0,D=!1,et=void 0;try{for(var nt,x=g.nodeIndexes[Symbol.iterator]();!(L=(nt=x.next()).done);L=!0){var dt=nt.value,ct=d(dt,2),mt=ct[0],b=ct[1],J=c.cy.getElementById(mt);if(J){var i=J.boundingBox(),m=g.xCoords[b]-i.w/2,h=g.xCoords[b]+i.w/2,u=g.yCoords[b]-i.h/2,p=g.yCoords[b]+i.h/2;m<T&&(T=m),h>f&&(f=h),u<A&&(A=u),p>N&&(N=p)}}}catch(P){D=!0,et=P}finally{try{!L&&x.return&&x.return()}finally{if(D)throw et}}var I=l.x-(f+T)/2,w=l.y-(N+A)/2;g.xCoords=g.xCoords.map(function(P){return P+I}),g.yCoords=g.yCoords.map(function(P){return P+w})}else{Object.keys(g).forEach(function(P){var _=g[P],lt=_.getRect().x,H=_.getRect().x+_.getRect().width,ht=_.getRect().y,tt=_.getRect().y+_.getRect().height;lt<T&&(T=lt),H>f&&(f=H),ht<A&&(A=ht),tt>N&&(N=tt)});var X=l.x-(f+T)/2,Y=l.y-(N+A)/2;Object.keys(g).forEach(function(P){var _=g[P];_.setCenter(_.getCenterX()+X,_.getCenterY()+Y)})}}},calcBoundingBox:function(l,g,c,T){for(var f=Number.MAX_SAFE_INTEGER,A=Number.MIN_SAFE_INTEGER,N=Number.MAX_SAFE_INTEGER,L=Number.MIN_SAFE_INTEGER,D=void 0,et=void 0,x=void 0,nt=void 0,dt=l.descendants().not(":parent"),ct=dt.length,mt=0;mt<ct;mt++){var b=dt[mt];f>(D=g[T.get(b.id())]-b.width()/2)&&(f=D),A<(et=g[T.get(b.id())]+b.width()/2)&&(A=et),N>(x=c[T.get(b.id())]-b.height()/2)&&(N=x),L<(nt=c[T.get(b.id())]+b.height()/2)&&(L=nt)}var J={};return J.topLeftX=f,J.topLeftY=N,J.width=A-f,J.height=L-N,J},calcParentsWithoutChildren:function(l,g){var c=l.collection();return g.nodes(":parent").forEach(function(T){var f=!1;T.children().forEach(function(A){"none"!=A.css("display")&&(f=!0)}),f||c.merge(T)}),c}};o.exports=r},816:(o,E,t)=>{var d=t(548),e=t(140).CoSELayout,r=t(140).CoSENode,l=t(140).layoutBase.PointD,g=t(140).layoutBase.DimensionD,c=t(140).layoutBase.LayoutConstants,T=t(140).layoutBase.FDLayoutConstants,f=t(140).CoSEConstants,A=function(L,D){var et=L.cy,x=L.eles,nt=x.nodes(),dt=x.edges(),ct=void 0,mt=void 0,b=void 0,J={};L.randomize&&(ct=D.nodeIndexes,mt=D.xCoords,b=D.yCoords);var i=function(P){return"function"==typeof P},m=function(P,_){return i(P)?P(_):P},h=d.calcParentsWithoutChildren(et,x),u=function Y(P,_,lt,H){for(var ht=_.length,tt=0;tt<ht;tt++){var O=_[tt],z=null;0==O.intersection(h).length&&(z=O.children());var Z=void 0,st=O.layoutDimensions({nodeDimensionsIncludeLabels:H.nodeDimensionsIncludeLabels});if(null!=O.outerWidth()&&null!=O.outerHeight())if(H.randomize)if(O.isParent()){var ft=d.calcBoundingBox(O,mt,b,ct);Z=0==O.intersection(h).length?P.add(new r(lt.graphManager,new l(ft.topLeftX,ft.topLeftY),new g(ft.width,ft.height))):P.add(new r(lt.graphManager,new l(ft.topLeftX,ft.topLeftY),new g(parseFloat(st.w),parseFloat(st.h))))}else Z=P.add(new r(lt.graphManager,new l(mt[ct.get(O.id())]-st.w/2,b[ct.get(O.id())]-st.h/2),new g(parseFloat(st.w),parseFloat(st.h))));else Z=P.add(new r(lt.graphManager,new l(O.position("x")-st.w/2,O.position("y")-st.h/2),new g(parseFloat(st.w),parseFloat(st.h))));else Z=P.add(new r(this.graphManager));Z.id=O.data("id"),Z.nodeRepulsion=m(H.nodeRepulsion,O),Z.paddingLeft=parseInt(O.css("padding")),Z.paddingTop=parseInt(O.css("padding")),Z.paddingRight=parseInt(O.css("padding")),Z.paddingBottom=parseInt(O.css("padding")),H.nodeDimensionsIncludeLabels&&(Z.labelWidth=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).w,Z.labelHeight=O.boundingBox({includeLabels:!0,includeNodes:!1,includeOverlays:!1}).h,Z.labelPosVertical=O.css("text-valign"),Z.labelPosHorizontal=O.css("text-halign")),J[O.data("id")]=Z,isNaN(Z.rect.x)&&(Z.rect.x=0),isNaN(Z.rect.y)&&(Z.rect.y=0),null!=z&&z.length>0&&Y(lt.getGraphManager().add(lt.newGraph(),Z),z,lt,H)}},p=function(P,_,lt){for(var H=0,ht=0,tt=0;tt<lt.length;tt++){var O=lt[tt],z=J[O.data("source")],Z=J[O.data("target")];if(z&&Z&&z!==Z&&0==z.getEdgesBetween(Z).length){var st=_.add(P.newEdge(),z,Z);st.id=O.id(),st.idealLength=m(L.idealEdgeLength,O),st.edgeElasticity=m(L.edgeElasticity,O),H+=st.idealLength,ht++}}null!=L.idealEdgeLength&&(ht>0?f.DEFAULT_EDGE_LENGTH=T.DEFAULT_EDGE_LENGTH=H/ht:i(L.idealEdgeLength)?f.DEFAULT_EDGE_LENGTH=T.DEFAULT_EDGE_LENGTH=50:f.DEFAULT_EDGE_LENGTH=T.DEFAULT_EDGE_LENGTH=L.idealEdgeLength,f.MIN_REPULSION_DIST=T.MIN_REPULSION_DIST=T.DEFAULT_EDGE_LENGTH/10,f.DEFAULT_RADIAL_SEPARATION=T.DEFAULT_EDGE_LENGTH)},I=function(P,_){_.fixedNodeConstraint&&(P.constraints.fixedNodeConstraint=_.fixedNodeConstraint),_.alignmentConstraint&&(P.constraints.alignmentConstraint=_.alignmentConstraint),_.relativePlacementConstraint&&(P.constraints.relativePlacementConstraint=_.relativePlacementConstraint)};null!=L.nestingFactor&&(f.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=T.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=L.nestingFactor),null!=L.gravity&&(f.DEFAULT_GRAVITY_STRENGTH=T.DEFAULT_GRAVITY_STRENGTH=L.gravity),null!=L.numIter&&(f.MAX_ITERATIONS=T.MAX_ITERATIONS=L.numIter),null!=L.gravityRange&&(f.DEFAULT_GRAVITY_RANGE_FACTOR=T.DEFAULT_GRAVITY_RANGE_FACTOR=L.gravityRange),null!=L.gravityCompound&&(f.DEFAULT_COMPOUND_GRAVITY_STRENGTH=T.DEFAULT_COMPOUND_GRAVITY_STRENGTH=L.gravityCompound),null!=L.gravityRangeCompound&&(f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=T.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=L.gravityRangeCompound),null!=L.initialEnergyOnIncremental&&(f.DEFAULT_COOLING_FACTOR_INCREMENTAL=T.DEFAULT_COOLING_FACTOR_INCREMENTAL=L.initialEnergyOnIncremental),null!=L.tilingCompareBy&&(f.TILING_COMPARE_BY=L.tilingCompareBy),"proof"==L.quality?c.QUALITY=2:c.QUALITY=0,f.NODE_DIMENSIONS_INCLUDE_LABELS=T.NODE_DIMENSIONS_INCLUDE_LABELS=c.NODE_DIMENSIONS_INCLUDE_LABELS=L.nodeDimensionsIncludeLabels,f.DEFAULT_INCREMENTAL=T.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!L.randomize,f.ANIMATE=T.ANIMATE=c.ANIMATE=L.animate,f.TILE=L.tile,f.TILING_PADDING_VERTICAL="function"==typeof L.tilingPaddingVertical?L.tilingPaddingVertical.call():L.tilingPaddingVertical,f.TILING_PADDING_HORIZONTAL="function"==typeof L.tilingPaddingHorizontal?L.tilingPaddingHorizontal.call():L.tilingPaddingHorizontal,f.DEFAULT_INCREMENTAL=T.DEFAULT_INCREMENTAL=c.DEFAULT_INCREMENTAL=!0,f.PURE_INCREMENTAL=!L.randomize,c.DEFAULT_UNIFORM_LEAF_NODE_SIZES=L.uniformNodeDimensions,"transformed"==L.step&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!1),"enforced"==L.step&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!1),"cose"==L.step&&(f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!1,f.APPLY_LAYOUT=!0),"all"==L.step&&(L.randomize?f.TRANSFORM_ON_CONSTRAINT_HANDLING=!0:f.TRANSFORM_ON_CONSTRAINT_HANDLING=!1,f.ENFORCE_CONSTRAINTS=!0,f.APPLY_LAYOUT=!0),L.fixedNodeConstraint||L.alignmentConstraint||L.relativePlacementConstraint?f.TREE_REDUCTION_ON_INCREMENTAL=!1:f.TREE_REDUCTION_ON_INCREMENTAL=!0;var w=new e,X=w.newGraphManager();return u(X.addRoot(),d.getTopMostNodes(nt),w,L),p(w,X,dt),I(w,L),w.runLayout(),J};o.exports={coseLayout:A}},212:(o,E,t)=>{var d=function(){function L(D,et){for(var x=0;x<et.length;x++){var nt=et[x];nt.enumerable=nt.enumerable||!1,nt.configurable=!0,"value"in nt&&(nt.writable=!0),Object.defineProperty(D,nt.key,nt)}}return function(D,et,x){return et&&L(D.prototype,et),x&&L(D,x),D}}();function e(L,D){if(!(L instanceof D))throw new TypeError("Cannot call a class as a function")}var r=t(658),l=t(548),c=t(657).spectralLayout,f=t(816).coseLayout,A=Object.freeze({quality:"default",randomize:!0,animate:!0,animationDuration:1e3,animationEasing:void 0,fit:!0,padding:30,nodeDimensionsIncludeLabels:!1,uniformNodeDimensions:!1,packComponents:!0,step:"all",samplingType:!0,sampleSize:25,nodeSeparation:75,piTol:1e-7,nodeRepulsion:function(D){return 4500},idealEdgeLength:function(D){return 50},edgeElasticity:function(D){return.45},nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,tilingCompareBy:void 0,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.3,fixedNodeConstraint:void 0,alignmentConstraint:void 0,relativePlacementConstraint:void 0,ready:function(){},stop:function(){}}),N=function(){function L(D){e(this,L),this.options=r({},A,D)}return d(L,[{key:"run",value:function(){var et=this,x=this.options,nt=x.cy,dt=x.eles,ct=[],J=[],i=void 0,m=[];x.fixedNodeConstraint&&(!Array.isArray(x.fixedNodeConstraint)||0==x.fixedNodeConstraint.length)&&(x.fixedNodeConstraint=void 0),x.alignmentConstraint&&(x.alignmentConstraint.vertical&&(!Array.isArray(x.alignmentConstraint.vertical)||0==x.alignmentConstraint.vertical.length)&&(x.alignmentConstraint.vertical=void 0),x.alignmentConstraint.horizontal&&(!Array.isArray(x.alignmentConstraint.horizontal)||0==x.alignmentConstraint.horizontal.length)&&(x.alignmentConstraint.horizontal=void 0)),x.relativePlacementConstraint&&(!Array.isArray(x.relativePlacementConstraint)||0==x.relativePlacementConstraint.length)&&(x.relativePlacementConstraint=void 0),(x.fixedNodeConstraint||x.alignmentConstraint||x.relativePlacementConstraint)&&(x.tile=!1,x.packComponents=!1);var u=void 0,p=!1;if(nt.layoutUtilities&&x.packComponents&&((u=nt.layoutUtilities("get"))||(u=nt.layoutUtilities()),p=!0),dt.nodes().length>0)if(p){var X=l.getTopMostNodes(x.eles.nodes());if((i=l.connectComponents(nt,x.eles,X)).forEach(function(ut){var gt=ut.boundingBox();m.push({x:gt.x1+gt.w/2,y:gt.y1+gt.h/2})}),x.randomize&&i.forEach(function(ut){x.eles=ut,ct.push(c(x))}),"default"==x.quality||"proof"==x.quality){var Y=nt.collection();if(x.tile){var H=0,ht={nodeIndexes:new Map,xCoords:[],yCoords:[]},tt=[];if(i.forEach(function(ut,gt){0==ut.edges().length&&(ut.nodes().forEach(function(xt,Dt){Y.merge(ut.nodes()[Dt]),xt.isParent()||(ht.nodeIndexes.set(ut.nodes()[Dt].id(),H++),ht.xCoords.push(ut.nodes()[0].position().x),ht.yCoords.push(ut.nodes()[0].position().y))}),tt.push(gt))}),Y.length>1){var O=Y.boundingBox();m.push({x:O.x1+O.w/2,y:O.y1+O.h/2}),i.push(Y),ct.push(ht);for(var z=tt.length-1;z>=0;z--)i.splice(tt[z],1),ct.splice(tt[z],1),m.splice(tt[z],1)}}i.forEach(function(ut,gt){x.eles=ut,J.push(f(x,ct[gt])),l.relocateComponent(m[gt],J[gt],x)})}else i.forEach(function(ut,gt){l.relocateComponent(m[gt],ct[gt],x)});var Z=new Set;if(i.length>1){var st=[],ft=dt.filter(function(ut){return"none"==ut.css("display")});i.forEach(function(ut,gt){var xt=void 0;if("draft"==x.quality&&(xt=ct[gt].nodeIndexes),ut.nodes().not(ft).length>0){var Dt={edges:[],nodes:[]},Mt=void 0;ut.nodes().not(ft).forEach(function(Ct){if("draft"==x.quality)if(Ct.isParent()){var At=l.calcBoundingBox(Ct,ct[gt].xCoords,ct[gt].yCoords,xt);Dt.nodes.push({x:At.topLeftX,y:At.topLeftY,width:At.width,height:At.height})}else Mt=xt.get(Ct.id()),Dt.nodes.push({x:ct[gt].xCoords[Mt]-Ct.boundingbox().w/2,y:ct[gt].yCoords[Mt]-Ct.boundingbox().h/2,width:Ct.boundingbox().w,height:Ct.boundingbox().h});else J[gt][Ct.id()]&&Dt.nodes.push({x:J[gt][Ct.id()].getLeft(),y:J[gt][Ct.id()].getTop(),width:J[gt][Ct.id()].getWidth(),height:J[gt][Ct.id()].getHeight()})}),ut.edges().forEach(function(Ct){var At=Ct.source(),Rt=Ct.target();if("none"!=At.css("display")&&"none"!=Rt.css("display"))if("draft"==x.quality){var Ht=xt.get(At.id()),Qt=xt.get(Rt.id()),bt=[],Yt=[];if(At.isParent()){var Xt=l.calcBoundingBox(At,ct[gt].xCoords,ct[gt].yCoords,xt);bt.push(Xt.topLeftX+Xt.width/2),bt.push(Xt.topLeftY+Xt.height/2)}else bt.push(ct[gt].xCoords[Ht]),bt.push(ct[gt].yCoords[Ht]);if(Rt.isParent()){var V=l.calcBoundingBox(Rt,ct[gt].xCoords,ct[gt].yCoords,xt);Yt.push(V.topLeftX+V.width/2),Yt.push(V.topLeftY+V.height/2)}else Yt.push(ct[gt].xCoords[Qt]),Yt.push(ct[gt].yCoords[Qt]);Dt.edges.push({startX:bt[0],startY:bt[1],endX:Yt[0],endY:Yt[1]})}else J[gt][At.id()]&&J[gt][Rt.id()]&&Dt.edges.push({startX:J[gt][At.id()].getCenterX(),startY:J[gt][At.id()].getCenterY(),endX:J[gt][Rt.id()].getCenterX(),endY:J[gt][Rt.id()].getCenterY()})}),Dt.nodes.length>0&&(st.push(Dt),Z.add(gt))}});var it=u.packComponents(st,x.randomize).shifts;if("draft"==x.quality)ct.forEach(function(ut,gt){var xt=ut.xCoords.map(function(Mt){return Mt+it[gt].dx}),Dt=ut.yCoords.map(function(Mt){return Mt+it[gt].dy});ut.xCoords=xt,ut.yCoords=Dt});else{var Pt=0;Z.forEach(function(ut){Object.keys(J[ut]).forEach(function(gt){var xt=J[ut][gt];xt.setCenter(xt.getCenterX()+it[Pt].dx,xt.getCenterY()+it[Pt].dy)}),Pt++})}}}else{var I=x.eles.boundingBox();if(m.push({x:I.x1+I.w/2,y:I.y1+I.h/2}),x.randomize){var w=c(x);ct.push(w)}"default"==x.quality||"proof"==x.quality?(J.push(f(x,ct[0])),l.relocateComponent(m[0],J[0],x)):l.relocateComponent(m[0],ct[0],x)}var Lt=function(gt,xt){if("default"==x.quality||"proof"==x.quality){"number"==typeof gt&&(gt=xt);var Dt=void 0,Mt=void 0,Ct=gt.data("id");return J.forEach(function(Rt){Ct in Rt&&(Dt={x:Rt[Ct].getRect().getCenterX(),y:Rt[Ct].getRect().getCenterY()},Mt=Rt[Ct])}),x.nodeDimensionsIncludeLabels&&(Mt.labelWidth&&("left"==Mt.labelPosHorizontal?Dt.x+=Mt.labelWidth/2:"right"==Mt.labelPosHorizontal&&(Dt.x-=Mt.labelWidth/2)),Mt.labelHeight&&("top"==Mt.labelPosVertical?Dt.y+=Mt.labelHeight/2:"bottom"==Mt.labelPosVertical&&(Dt.y-=Mt.labelHeight/2))),null==Dt&&(Dt={x:gt.position("x"),y:gt.position("y")}),{x:Dt.x,y:Dt.y}}var At=void 0;return ct.forEach(function(Rt){var Ht=Rt.nodeIndexes.get(gt.id());null!=Ht&&(At={x:Rt.xCoords[Ht],y:Rt.yCoords[Ht]})}),null==At&&(At={x:gt.position("x"),y:gt.position("y")}),{x:At.x,y:At.y}};if("default"==x.quality||"proof"==x.quality||x.randomize){var Kt=l.calcParentsWithoutChildren(nt,dt),Ut=dt.filter(function(ut){return"none"==ut.css("display")});x.eles=dt.not(Ut),dt.nodes().not(":parent").not(Ut).layoutPositions(et,x,Lt),Kt.length>0&&Kt.forEach(function(ut){ut.position(Lt(ut))})}else console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}]),L}();o.exports=N},657:(o,E,t)=>{var d=t(548),e=t(140).layoutBase.Matrix,r=t(140).layoutBase.SVD,l=function(c){var T=c.cy,f=c.eles,A=f.nodes(),N=f.nodes(":parent"),L=new Map,D=new Map,et=new Map,x=[],nt=[],dt=[],ct=[],mt=[],b=[],J=[],i=[],h=void 0,u=1e8,p=1e-9,I=c.piTol,w=c.samplingType,X=c.nodeSeparation,Y=void 0,P=function(){for(var q=0,v=0,M=!1;v<Y;){q=Math.floor(Math.random()*h),M=!1;for(var C=0;C<v;C++)if(ct[C]==q){M=!0;break}M||(ct[v]=q,v++)}},_=function(q,v,M){for(var C=[],k=0,G=0,S=0,F=void 0,$=[],ot=0,U=1,at=0;at<h;at++)$[at]=u;for(C[G]=q,$[q]=0;G>=k;){S=C[k++];for(var W=x[S],K=0;K<W.length;K++)$[F=D.get(W[K])]==u&&($[F]=$[S]+1,C[++G]=F);b[S][v]=$[S]*X}if(M){for(var rt=0;rt<h;rt++)b[rt][v]<mt[rt]&&(mt[rt]=b[rt][v]);for(var B=0;B<h;B++)mt[B]>ot&&(ot=mt[B],U=B)}return U},lt=function(q){var v=void 0;if(q){v=Math.floor(Math.random()*h);for(var C=0;C<h;C++)mt[C]=u;for(var k=0;k<Y;k++)ct[k]=v,v=_(v,k,q)}else{P();for(var M=0;M<Y;M++)_(ct[M],M,q,!1)}for(var G=0;G<h;G++)for(var S=0;S<Y;S++)b[G][S]*=b[G][S];for(var F=0;F<Y;F++)J[F]=[];for(var $=0;$<Y;$++)for(var ot=0;ot<Y;ot++)J[$][ot]=b[ct[ot]][$]},H=function(){for(var q=r.svd(J),v=q.S,M=q.U,C=q.V,k=v[0]*v[0]*v[0],G=[],S=0;S<Y;S++){G[S]=[];for(var F=0;F<Y;F++)G[S][F]=0,S==F&&(G[S][F]=v[S]/(v[S]*v[S]+k/(v[S]*v[S])))}i=e.multMat(e.multMat(C,G),e.transpose(M))},ht=function(){for(var q=void 0,v=void 0,M=[],C=[],k=[],G=[],S=0;S<h;S++)M[S]=Math.random(),C[S]=Math.random();M=e.normalize(M),C=e.normalize(C);for(var $=p,ot=p,U=void 0;;){for(var at=0;at<h;at++)k[at]=M[at];if(M=e.multGamma(e.multL(e.multGamma(k),b,i)),q=e.dotProduct(k,M),M=e.normalize(M),$=e.dotProduct(k,M),(U=Math.abs($/ot))<=1+I&&U>=1)break;ot=$}for(var W=0;W<h;W++)k[W]=M[W];for(ot=p;;){for(var K=0;K<h;K++)G[K]=C[K];if(G=e.minusOp(G,e.multCons(k,e.dotProduct(k,G))),C=e.multGamma(e.multL(e.multGamma(G),b,i)),v=e.dotProduct(G,C),C=e.normalize(C),$=e.dotProduct(G,C),(U=Math.abs($/ot))<=1+I&&U>=1)break;ot=$}for(var rt=0;rt<h;rt++)G[rt]=C[rt];nt=e.multCons(k,Math.sqrt(Math.abs(q))),dt=e.multCons(G,Math.sqrt(Math.abs(v)))};d.connectComponents(T,f,d.getTopMostNodes(A),L),N.forEach(function(Q){d.connectComponents(T,f,d.getTopMostNodes(Q.descendants().intersection(f)),L)});for(var tt=0,O=0;O<A.length;O++)A[O].isParent()||D.set(A[O].id(),tt++);var z=!0,Z=!1,st=void 0;try{for(var it,ft=L.keys()[Symbol.iterator]();!(z=(it=ft.next()).done);z=!0){var Pt=it.value;D.set(Pt,tt++)}}catch(Q){Z=!0,st=Q}finally{try{!z&&ft.return&&ft.return()}finally{if(Z)throw st}}for(var Lt=0;Lt<D.size;Lt++)x[Lt]=[];N.forEach(function(Q){for(var q=Q.children().intersection(f);0==q.nodes(":childless").length;)q=q.nodes()[0].children().intersection(f);var v=0,M=q.nodes(":childless")[0].connectedEdges().length;q.nodes(":childless").forEach(function(C,k){C.connectedEdges().length<M&&(M=C.connectedEdges().length,v=k)}),et.set(Q.id(),q.nodes(":childless")[v].id())}),A.forEach(function(Q){var q=void 0;q=Q.isParent()?D.get(et.get(Q.id())):D.get(Q.id()),Q.neighborhood().nodes().forEach(function(v){f.intersection(Q.edgesWith(v)).length>0&&(v.isParent()?x[q].push(et.get(v.id())):x[q].push(v.id()))})});var Kt=function(q){var v=D.get(q),M=void 0;L.get(q).forEach(function(C){M=T.getElementById(C).isParent()?et.get(C):C,x[v].push(M),x[D.get(M)].push(q)})},Ut=!0,ut=!1,gt=void 0;try{for(var Dt,xt=L.keys()[Symbol.iterator]();!(Ut=(Dt=xt.next()).done);Ut=!0)Kt(Dt.value)}catch(Q){ut=!0,gt=Q}finally{try{!Ut&&xt.return&&xt.return()}finally{if(ut)throw gt}}var Ct=void 0;if((h=D.size)>2){Y=h<c.sampleSize?h:c.sampleSize;for(var At=0;At<h;At++)b[At]=[];for(var Rt=0;Rt<Y;Rt++)i[Rt]=[];return"draft"==c.quality||"all"==c.step?(lt(w),H(),ht(),Ct={nodeIndexes:D,xCoords:nt,yCoords:dt}):(D.forEach(function(Q,q){nt.push(T.getElementById(q).position("x")),dt.push(T.getElementById(q).position("y"))}),Ct={nodeIndexes:D,xCoords:nt,yCoords:dt}),Ct}var Ht=D.keys(),Qt=T.getElementById(Ht.next().value),bt=Qt.position(),Yt=Qt.outerWidth();if(nt.push(bt.x),dt.push(bt.y),2==h){var V=T.getElementById(Ht.next().value).outerWidth();nt.push(bt.x+Yt/2+V/2+c.idealEdgeLength),dt.push(bt.y)}return Ct={nodeIndexes:D,xCoords:nt,yCoords:dt}};o.exports={spectralLayout:l}},579:(o,E,t)=>{var d=t(212),e=function(l){!l||l("layout","fcose",d)};typeof cytoscape<"u"&&e(cytoscape),o.exports=e},140:o=>{o.exports=R}},s={};function n(o){var E=s[o];if(void 0!==E)return E.exports;var t=s[o]={exports:{}};return y[o](t,t.exports,n),t.exports}return n(579)})())},34355:function(ee,vt,Et){var R;ee.exports=(R=Et(28432),(()=>{"use strict";var y={45:(o,E,t)=>{var d={};d.layoutBase=t(551),d.CoSEConstants=t(806),d.CoSEEdge=t(767),d.CoSEGraph=t(880),d.CoSEGraphManager=t(578),d.CoSELayout=t(765),d.CoSENode=t(991),d.ConstraintHandler=t(902),o.exports=d},806:(o,E,t)=>{var d=t(551).FDLayoutConstants;function e(){}for(var r in d)e[r]=d[r];e.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,e.DEFAULT_RADIAL_SEPARATION=d.DEFAULT_EDGE_LENGTH,e.DEFAULT_COMPONENT_SEPERATION=60,e.TILE=!0,e.TILING_PADDING_VERTICAL=10,e.TILING_PADDING_HORIZONTAL=10,e.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,e.ENFORCE_CONSTRAINTS=!0,e.APPLY_LAYOUT=!0,e.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,e.TREE_REDUCTION_ON_INCREMENTAL=!0,e.PURE_INCREMENTAL=e.DEFAULT_INCREMENTAL,o.exports=e},767:(o,E,t)=>{var d=t(551).FDLayoutEdge;function e(l,g,c){d.call(this,l,g,c)}for(var r in e.prototype=Object.create(d.prototype),d)e[r]=d[r];o.exports=e},880:(o,E,t)=>{var d=t(551).LGraph;function e(l,g,c){d.call(this,l,g,c)}for(var r in e.prototype=Object.create(d.prototype),d)e[r]=d[r];o.exports=e},578:(o,E,t)=>{var d=t(551).LGraphManager;function e(l){d.call(this,l)}for(var r in e.prototype=Object.create(d.prototype),d)e[r]=d[r];o.exports=e},765:(o,E,t)=>{var d=t(551).FDLayout,e=t(578),r=t(880),l=t(991),g=t(767),c=t(806),T=t(902),f=t(551).FDLayoutConstants,A=t(551).LayoutConstants,N=t(551).Point,L=t(551).PointD,D=t(551).DimensionD,et=t(551).Layout,x=t(551).Integer,nt=t(551).IGeometry,dt=t(551).LGraph,ct=t(551).Transform,mt=t(551).LinkedList;function b(){d.call(this),this.toBeTiled={},this.constraints={}}for(var J in b.prototype=Object.create(d.prototype),d)b[J]=d[J];b.prototype.newGraphManager=function(){var i=new e(this);return this.graphManager=i,i},b.prototype.newGraph=function(i){return new r(null,this.graphManager,i)},b.prototype.newNode=function(i){return new l(this.graphManager,i)},b.prototype.newEdge=function(i){return new g(null,null,i)},b.prototype.initParameters=function(){d.prototype.initParameters.call(this,arguments),this.isSubLayout||(c.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=f.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=f.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=f.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=f.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1)},b.prototype.initSpringEmbedder=function(){d.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/f.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=.04,this.coolingAdjuster=1},b.prototype.layout=function(){return A.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},b.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var m=new Set(this.getAllNodes()),h=this.nodesWithGravity.filter(function(I){return m.has(I)});this.graphManager.setAllNodesToApplyGravitation(h)}}else{var i=this.getFlatForest();i.length>0?this.positionNodesRadially(i):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),m=new Set(this.getAllNodes()),h=this.nodesWithGravity.filter(function(u){return m.has(u)}),this.graphManager.setAllNodesToApplyGravitation(h),this.positionNodesRandomly())}return Object.keys(this.constraints).length>0&&(T.handleConstraints(this),this.initConstraintVariables()),this.initSpringEmbedder(),c.APPLY_LAYOUT&&this.runSpringEmbedder(),!0},b.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%f.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var i=new Set(this.getAllNodes()),m=this.nodesWithGravity.filter(function(p){return i.has(p)});this.graphManager.setAllNodesToApplyGravitation(m),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2:this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),c.PURE_INCREMENTAL?this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100):this.coolingFactor=f.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var h=!this.isTreeGrowing&&!this.isGrowthFinished,u=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(h,u),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},b.prototype.getPositionsData=function(){for(var i=this.graphManager.getAllNodes(),m={},h=0;h<i.length;h++){var u=i[h].rect,p=i[h].id;m[p]={id:p,x:u.getCenterX(),y:u.getCenterY(),w:u.width,h:u.height}}return m},b.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var i=!1;if("during"===f.ANIMATE)this.emit("layoutstarted");else{for(;!i;)i=this.tick();this.graphManager.updateBounds()}},b.prototype.moveNodes=function(){for(var i=this.getAllNodes(),h=0;h<i.length;h++)i[h].calculateDisplacement();for(Object.keys(this.constraints).length>0&&this.updateDisplacements(),h=0;h<i.length;h++)i[h].move()},b.prototype.initConstraintVariables=function(){var i=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;for(var m=this.graphManager.getAllNodes(),h=0;h<m.length;h++){var u=m[h];this.idToNodeMap.set(u.id,u)}var p=function O(z){for(var st,Z=z.getChild().getNodes(),ft=0,it=0;it<Z.length;it++)null==(st=Z[it]).getChild()?i.fixedNodeSet.has(st.id)&&(ft+=100):ft+=O(st);return ft};if(this.constraints.fixedNodeConstraint)for(this.constraints.fixedNodeConstraint.forEach(function(Z){i.fixedNodeSet.add(Z.nodeId)}),m=this.graphManager.getAllNodes(),h=0;h<m.length;h++)if(null!=(u=m[h]).getChild()){var I=p(u);I>0&&(u.fixedNodeWeight=I)}if(this.constraints.relativePlacementConstraint){var w=new Map,X=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(O){i.fixedNodesOnHorizontal.add(O),i.fixedNodesOnVertical.add(O)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var Y=this.constraints.alignmentConstraint.vertical;for(h=0;h<Y.length;h++)this.dummyToNodeForVerticalAlignment.set("dummy"+h,[]),Y[h].forEach(function(z){w.set(z,"dummy"+h),i.dummyToNodeForVerticalAlignment.get("dummy"+h).push(z),i.fixedNodeSet.has(z)&&i.fixedNodesOnHorizontal.add("dummy"+h)})}if(this.constraints.alignmentConstraint.horizontal){var P=this.constraints.alignmentConstraint.horizontal;for(h=0;h<P.length;h++)this.dummyToNodeForHorizontalAlignment.set("dummy"+h,[]),P[h].forEach(function(z){X.set(z,"dummy"+h),i.dummyToNodeForHorizontalAlignment.get("dummy"+h).push(z),i.fixedNodeSet.has(z)&&i.fixedNodesOnVertical.add("dummy"+h)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(O){var z,Z,st;for(st=O.length-1;st>=2*O.length/3;st--)z=Math.floor(Math.random()*(st+1)),Z=O[st],O[st]=O[z],O[z]=Z;return O},this.nodesInRelativeHorizontal=[],this.nodesInRelativeVertical=[],this.nodeToRelativeConstraintMapHorizontal=new Map,this.nodeToRelativeConstraintMapVertical=new Map,this.nodeToTempPositionMapHorizontal=new Map,this.nodeToTempPositionMapVertical=new Map,this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var z=w.has(O.left)?w.get(O.left):O.left,Z=w.has(O.right)?w.get(O.right):O.right;i.nodesInRelativeHorizontal.includes(z)||(i.nodesInRelativeHorizontal.push(z),i.nodeToRelativeConstraintMapHorizontal.set(z,[]),i.dummyToNodeForVerticalAlignment.has(z)?i.nodeToTempPositionMapHorizontal.set(z,i.idToNodeMap.get(i.dummyToNodeForVerticalAlignment.get(z)[0]).getCenterX()):i.nodeToTempPositionMapHorizontal.set(z,i.idToNodeMap.get(z).getCenterX())),i.nodesInRelativeHorizontal.includes(Z)||(i.nodesInRelativeHorizontal.push(Z),i.nodeToRelativeConstraintMapHorizontal.set(Z,[]),i.dummyToNodeForVerticalAlignment.has(Z)?i.nodeToTempPositionMapHorizontal.set(Z,i.idToNodeMap.get(i.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX()):i.nodeToTempPositionMapHorizontal.set(Z,i.idToNodeMap.get(Z).getCenterX())),i.nodeToRelativeConstraintMapHorizontal.get(z).push({right:Z,gap:O.gap}),i.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:z,gap:O.gap})}else{var st=X.has(O.top)?X.get(O.top):O.top,ft=X.has(O.bottom)?X.get(O.bottom):O.bottom;i.nodesInRelativeVertical.includes(st)||(i.nodesInRelativeVertical.push(st),i.nodeToRelativeConstraintMapVertical.set(st,[]),i.dummyToNodeForHorizontalAlignment.has(st)?i.nodeToTempPositionMapVertical.set(st,i.idToNodeMap.get(i.dummyToNodeForHorizontalAlignment.get(st)[0]).getCenterY()):i.nodeToTempPositionMapVertical.set(st,i.idToNodeMap.get(st).getCenterY())),i.nodesInRelativeVertical.includes(ft)||(i.nodesInRelativeVertical.push(ft),i.nodeToRelativeConstraintMapVertical.set(ft,[]),i.dummyToNodeForHorizontalAlignment.has(ft)?i.nodeToTempPositionMapVertical.set(ft,i.idToNodeMap.get(i.dummyToNodeForHorizontalAlignment.get(ft)[0]).getCenterY()):i.nodeToTempPositionMapVertical.set(ft,i.idToNodeMap.get(ft).getCenterY())),i.nodeToRelativeConstraintMapVertical.get(st).push({bottom:ft,gap:O.gap}),i.nodeToRelativeConstraintMapVertical.get(ft).push({top:st,gap:O.gap})}});else{var _=new Map,lt=new Map;this.constraints.relativePlacementConstraint.forEach(function(O){if(O.left){var z=w.has(O.left)?w.get(O.left):O.left,Z=w.has(O.right)?w.get(O.right):O.right;_.has(z)?_.get(z).push(Z):_.set(z,[Z]),_.has(Z)?_.get(Z).push(z):_.set(Z,[z])}else{var st=X.has(O.top)?X.get(O.top):O.top,ft=X.has(O.bottom)?X.get(O.bottom):O.bottom;lt.has(st)?lt.get(st).push(ft):lt.set(st,[ft]),lt.has(ft)?lt.get(ft).push(st):lt.set(ft,[st])}});var H=function(z,Z){var st=[],ft=[],it=new mt,Pt=new Set,Lt=0;return z.forEach(function(Kt,Ut){if(!Pt.has(Ut)){st[Lt]=[],ft[Lt]=!1;var ut=Ut;for(it.push(ut),Pt.add(ut),st[Lt].push(ut);0!=it.length;)ut=it.shift(),Z.has(ut)&&(ft[Lt]=!0),z.get(ut).forEach(function(xt){Pt.has(xt)||(it.push(xt),Pt.add(xt),st[Lt].push(xt))});Lt++}}),{components:st,isFixed:ft}},ht=H(_,i.fixedNodesOnHorizontal);this.componentsOnHorizontal=ht.components,this.fixedComponentsOnHorizontal=ht.isFixed;var tt=H(lt,i.fixedNodesOnVertical);this.componentsOnVertical=tt.components,this.fixedComponentsOnVertical=tt.isFixed}}},b.prototype.updateDisplacements=function(){var i=this;if(this.constraints.fixedNodeConstraint&&this.constraints.fixedNodeConstraint.forEach(function(tt){var O=i.idToNodeMap.get(tt.nodeId);O.displacementX=0,O.displacementY=0}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical)for(var m=this.constraints.alignmentConstraint.vertical,h=0;h<m.length;h++){for(var u=0,p=0;p<m[h].length;p++){if(this.fixedNodeSet.has(m[h][p])){u=0;break}u+=this.idToNodeMap.get(m[h][p]).displacementX}var I=u/m[h].length;for(p=0;p<m[h].length;p++)this.idToNodeMap.get(m[h][p]).displacementX=I}if(this.constraints.alignmentConstraint.horizontal){var w=this.constraints.alignmentConstraint.horizontal;for(h=0;h<w.length;h++){var X=0;for(p=0;p<w[h].length;p++){if(this.fixedNodeSet.has(w[h][p])){X=0;break}X+=this.idToNodeMap.get(w[h][p]).displacementY}var Y=X/w[h].length;for(p=0;p<w[h].length;p++)this.idToNodeMap.get(w[h][p]).displacementY=Y}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.totalIterations%10==0&&(this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical)),this.nodesInRelativeHorizontal.forEach(function(tt){if(!i.fixedNodesOnHorizontal.has(tt)){var O=0;O=i.dummyToNodeForVerticalAlignment.has(tt)?i.idToNodeMap.get(i.dummyToNodeForVerticalAlignment.get(tt)[0]).displacementX:i.idToNodeMap.get(tt).displacementX,i.nodeToRelativeConstraintMapHorizontal.get(tt).forEach(function(z){var Z;z.right?(Z=i.nodeToTempPositionMapHorizontal.get(z.right)-i.nodeToTempPositionMapHorizontal.get(tt)-O)<z.gap&&(O-=z.gap-Z):(Z=i.nodeToTempPositionMapHorizontal.get(tt)-i.nodeToTempPositionMapHorizontal.get(z.left)+O)<z.gap&&(O+=z.gap-Z)}),i.nodeToTempPositionMapHorizontal.set(tt,i.nodeToTempPositionMapHorizontal.get(tt)+O),i.dummyToNodeForVerticalAlignment.has(tt)?i.dummyToNodeForVerticalAlignment.get(tt).forEach(function(z){i.idToNodeMap.get(z).displacementX=O}):i.idToNodeMap.get(tt).displacementX=O}}),this.nodesInRelativeVertical.forEach(function(tt){if(!i.fixedNodesOnHorizontal.has(tt)){var O=0;O=i.dummyToNodeForHorizontalAlignment.has(tt)?i.idToNodeMap.get(i.dummyToNodeForHorizontalAlignment.get(tt)[0]).displacementY:i.idToNodeMap.get(tt).displacementY,i.nodeToRelativeConstraintMapVertical.get(tt).forEach(function(z){var Z;z.bottom?(Z=i.nodeToTempPositionMapVertical.get(z.bottom)-i.nodeToTempPositionMapVertical.get(tt)-O)<z.gap&&(O-=z.gap-Z):(Z=i.nodeToTempPositionMapVertical.get(tt)-i.nodeToTempPositionMapVertical.get(z.top)+O)<z.gap&&(O+=z.gap-Z)}),i.nodeToTempPositionMapVertical.set(tt,i.nodeToTempPositionMapVertical.get(tt)+O),i.dummyToNodeForHorizontalAlignment.has(tt)?i.dummyToNodeForHorizontalAlignment.get(tt).forEach(function(z){i.idToNodeMap.get(z).displacementY=O}):i.idToNodeMap.get(tt).displacementY=O}});else{for(h=0;h<this.componentsOnHorizontal.length;h++){var P=this.componentsOnHorizontal[h];if(this.fixedComponentsOnHorizontal[h])for(p=0;p<P.length;p++)this.dummyToNodeForVerticalAlignment.has(P[p])?this.dummyToNodeForVerticalAlignment.get(P[p]).forEach(function(z){i.idToNodeMap.get(z).displacementX=0}):this.idToNodeMap.get(P[p]).displacementX=0;else{var _=0,lt=0;for(p=0;p<P.length;p++)this.dummyToNodeForVerticalAlignment.has(P[p])?(_+=(H=this.dummyToNodeForVerticalAlignment.get(P[p])).length*this.idToNodeMap.get(H[0]).displacementX,lt+=H.length):(_+=this.idToNodeMap.get(P[p]).displacementX,lt++);var ht=_/lt;for(p=0;p<P.length;p++)this.dummyToNodeForVerticalAlignment.has(P[p])?this.dummyToNodeForVerticalAlignment.get(P[p]).forEach(function(z){i.idToNodeMap.get(z).displacementX=ht}):this.idToNodeMap.get(P[p]).displacementX=ht}}for(h=0;h<this.componentsOnVertical.length;h++)if(P=this.componentsOnVertical[h],this.fixedComponentsOnVertical[h])for(p=0;p<P.length;p++)this.dummyToNodeForHorizontalAlignment.has(P[p])?this.dummyToNodeForHorizontalAlignment.get(P[p]).forEach(function(Z){i.idToNodeMap.get(Z).displacementY=0}):this.idToNodeMap.get(P[p]).displacementY=0;else{for(_=0,lt=0,p=0;p<P.length;p++)if(this.dummyToNodeForHorizontalAlignment.has(P[p])){var H;_+=(H=this.dummyToNodeForHorizontalAlignment.get(P[p])).length*this.idToNodeMap.get(H[0]).displacementY,lt+=H.length}else _+=this.idToNodeMap.get(P[p]).displacementY,lt++;for(ht=_/lt,p=0;p<P.length;p++)this.dummyToNodeForHorizontalAlignment.has(P[p])?this.dummyToNodeForHorizontalAlignment.get(P[p]).forEach(function(it){i.idToNodeMap.get(it).displacementY=ht}):this.idToNodeMap.get(P[p]).displacementY=ht}}},b.prototype.calculateNodesToApplyGravitationTo=function(){var m,p,i=[],h=this.graphManager.getGraphs(),u=h.length;for(p=0;p<u;p++)(m=h[p]).updateConnected(),m.isConnected||(i=i.concat(m.getNodes()));return i},b.prototype.createBendpoints=function(){var i=[];i=i.concat(this.graphManager.getAllEdges());var h,m=new Set;for(h=0;h<i.length;h++){var u=i[h];if(!m.has(u)){var p=u.getSource(),I=u.getTarget();if(p==I)u.getBendpoints().push(new L),u.getBendpoints().push(new L),this.createDummyNodesForBendpoints(u),m.add(u);else{var w=[];if(w=(w=w.concat(p.getEdgeListToNode(I))).concat(I.getEdgeListToNode(p)),!m.has(w[0])){var X;if(w.length>1)for(X=0;X<w.length;X++){var Y=w[X];Y.getBendpoints().push(new L),this.createDummyNodesForBendpoints(Y)}w.forEach(function(P){m.add(P)})}}}if(m.size==i.length)break}},b.prototype.positionNodesRadially=function(i){for(var m=new N(0,0),h=Math.ceil(Math.sqrt(i.length)),u=0,p=0,I=0,w=new L(0,0),X=0;X<i.length;X++){X%h==0&&(I=0,p=u,0!=X&&(p+=c.DEFAULT_COMPONENT_SEPERATION),u=0);var Y=i[X],P=et.findCenterOfTree(Y);m.x=I,m.y=p,(w=b.radialLayout(Y,P,m)).y>u&&(u=Math.floor(w.y)),I=Math.floor(w.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new L(A.WORLD_CENTER_X-w.x/2,A.WORLD_CENTER_Y-w.y/2))},b.radialLayout=function(i,m,h){var u=Math.max(this.maxDiagonalInTree(i),c.DEFAULT_RADIAL_SEPARATION);b.branchRadialLayout(m,null,0,359,0,u);var p=dt.calculateBounds(i),I=new ct;I.setDeviceOrgX(p.getMinX()),I.setDeviceOrgY(p.getMinY()),I.setWorldOrgX(h.x),I.setWorldOrgY(h.y);for(var w=0;w<i.length;w++)i[w].transform(I);var Y=new L(p.getMaxX(),p.getMaxY());return I.inverseTransformPoint(Y)},b.branchRadialLayout=function(i,m,h,u,p,I){var w=(u-h+1)/2;w<0&&(w+=180);var Y=(w+h)%360*nt.TWO_PI/360,_=(Math.cos(Y),p*Math.cos(Y)),lt=p*Math.sin(Y);i.setCenter(_,lt);var H=[],ht=(H=H.concat(i.getEdges())).length;null!=m&&ht--;for(var z,tt=0,O=H.length,Z=i.getEdgesBetween(m);Z.length>1;){var st=Z[0];Z.splice(0,1);var ft=H.indexOf(st);ft>=0&&H.splice(ft,1),O--,ht--}z=null!=m?(H.indexOf(Z[0])+1)%O:0;for(var it=Math.abs(u-h)/ht,Pt=z;tt!=ht;Pt=++Pt%O){var Lt=H[Pt].getOtherEnd(i);if(Lt!=m){var Kt=(h+tt*it)%360,Ut=(Kt+it)%360;b.branchRadialLayout(Lt,i,Kt,Ut,p+I,I),tt++}}},b.maxDiagonalInTree=function(i){for(var m=x.MIN_VALUE,h=0;h<i.length;h++){var p=i[h].getDiagonal();p>m&&(m=p)}return m},b.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},b.prototype.groupZeroDegreeMembers=function(){var i=this,m={};this.memberGroups={},this.idToDummyNode={};for(var h=[],u=this.graphManager.getAllNodes(),p=0;p<u.length;p++){var w=(I=u[p]).getParent();0===this.getNodeDegreeWithChildren(I)&&(null==w.id||!this.getToBeTiled(w))&&h.push(I)}for(p=0;p<h.length;p++){var I,X=(I=h[p]).getParent().id;typeof m[X]>"u"&&(m[X]=[]),m[X]=m[X].concat(I)}Object.keys(m).forEach(function(Y){if(m[Y].length>1){var P="DummyCompound_"+Y;i.memberGroups[P]=m[Y];var _=m[Y][0].getParent(),lt=new l(i.graphManager);lt.id=P,lt.paddingLeft=_.paddingLeft||0,lt.paddingRight=_.paddingRight||0,lt.paddingBottom=_.paddingBottom||0,lt.paddingTop=_.paddingTop||0,i.idToDummyNode[P]=lt;var H=i.getGraphManager().add(i.newGraph(),lt),ht=_.getChild();ht.add(lt);for(var tt=0;tt<m[Y].length;tt++){var O=m[Y][tt];ht.remove(O),H.add(O)}}})},b.prototype.clearCompounds=function(){var i={},m={};this.performDFSOnCompounds();for(var h=0;h<this.compoundOrder.length;h++)m[this.compoundOrder[h].id]=this.compoundOrder[h],i[this.compoundOrder[h].id]=[].concat(this.compoundOrder[h].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[h].getChild()),this.compoundOrder[h].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(i,m)},b.prototype.clearZeroDegreeMembers=function(){var i=this,m=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(h){var u=i.idToDummyNode[h];if(m[h]=i.tileNodes(i.memberGroups[h],u.paddingLeft+u.paddingRight),u.rect.width=m[h].width,u.rect.height=m[h].height,u.setCenter(m[h].centerX,m[h].centerY),u.labelMarginLeft=0,u.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var p=u.rect.width,I=u.rect.height;u.labelWidth&&("left"==u.labelPosHorizontal?(u.rect.x-=u.labelWidth,u.setWidth(p+u.labelWidth),u.labelMarginLeft=u.labelWidth):"center"==u.labelPosHorizontal&&u.labelWidth>p?(u.rect.x-=(u.labelWidth-p)/2,u.setWidth(u.labelWidth),u.labelMarginLeft=(u.labelWidth-p)/2):"right"==u.labelPosHorizontal&&u.setWidth(p+u.labelWidth)),u.labelHeight&&("top"==u.labelPosVertical?(u.rect.y-=u.labelHeight,u.setHeight(I+u.labelHeight),u.labelMarginTop=u.labelHeight):"center"==u.labelPosVertical&&u.labelHeight>I?(u.rect.y-=(u.labelHeight-I)/2,u.setHeight(u.labelHeight),u.labelMarginTop=(u.labelHeight-I)/2):"bottom"==u.labelPosVertical&&u.setHeight(I+u.labelHeight))}})},b.prototype.repopulateCompounds=function(){for(var i=this.compoundOrder.length-1;i>=0;i--){var m=this.compoundOrder[i],h=m.id,u=m.paddingLeft,p=m.paddingTop,I=m.labelMarginLeft,w=m.labelMarginTop;this.adjustLocations(this.tiledMemberPack[h],m.rect.x,m.rect.y,u,p,I,w)}},b.prototype.repopulateZeroDegreeMembers=function(){var i=this,m=this.tiledZeroDegreePack;Object.keys(m).forEach(function(h){var u=i.idToDummyNode[h],p=u.paddingLeft,I=u.paddingTop,w=u.labelMarginLeft,X=u.labelMarginTop;i.adjustLocations(m[h],u.rect.x,u.rect.y,p,I,w,X)})},b.prototype.getToBeTiled=function(i){var m=i.id;if(null!=this.toBeTiled[m])return this.toBeTiled[m];var h=i.getChild();if(null==h)return this.toBeTiled[m]=!1,!1;for(var u=h.getNodes(),p=0;p<u.length;p++){var I=u[p];if(this.getNodeDegree(I)>0)return this.toBeTiled[m]=!1,!1;if(null!=I.getChild()){if(!this.getToBeTiled(I))return this.toBeTiled[m]=!1,!1}else this.toBeTiled[I.id]=!1}return this.toBeTiled[m]=!0,!0},b.prototype.getNodeDegree=function(i){i.id;for(var h=i.getEdges(),u=0,p=0;p<h.length;p++){var I=h[p];I.getSource().id!==I.getTarget().id&&(u+=1)}return u},b.prototype.getNodeDegreeWithChildren=function(i){var m=this.getNodeDegree(i);if(null==i.getChild())return m;for(var h=i.getChild().getNodes(),u=0;u<h.length;u++){var p=h[u];m+=this.getNodeDegreeWithChildren(p)}return m},b.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},b.prototype.fillCompexOrderByDFS=function(i){for(var m=0;m<i.length;m++){var h=i[m];null!=h.getChild()&&this.fillCompexOrderByDFS(h.getChild().getNodes()),this.getToBeTiled(h)&&this.compoundOrder.push(h)}},b.prototype.adjustLocations=function(i,m,h,u,p,I,w){h+=p+w;for(var X=m+=u+I,Y=0;Y<i.rows.length;Y++){var P=i.rows[Y];m=X;for(var _=0,lt=0;lt<P.length;lt++){var H=P[lt];H.rect.x=m,H.rect.y=h,m+=H.rect.width+i.horizontalPadding,H.rect.height>_&&(_=H.rect.height)}h+=_+i.verticalPadding}},b.prototype.tileCompoundMembers=function(i,m){var h=this;this.tiledMemberPack=[],Object.keys(i).forEach(function(u){var p=m[u];if(h.tiledMemberPack[u]=h.tileNodes(i[u],p.paddingLeft+p.paddingRight),p.rect.width=h.tiledMemberPack[u].width,p.rect.height=h.tiledMemberPack[u].height,p.setCenter(h.tiledMemberPack[u].centerX,h.tiledMemberPack[u].centerY),p.labelMarginLeft=0,p.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var I=p.rect.width,w=p.rect.height;p.labelWidth&&("left"==p.labelPosHorizontal?(p.rect.x-=p.labelWidth,p.setWidth(I+p.labelWidth),p.labelMarginLeft=p.labelWidth):"center"==p.labelPosHorizontal&&p.labelWidth>I?(p.rect.x-=(p.labelWidth-I)/2,p.setWidth(p.labelWidth),p.labelMarginLeft=(p.labelWidth-I)/2):"right"==p.labelPosHorizontal&&p.setWidth(I+p.labelWidth)),p.labelHeight&&("top"==p.labelPosVertical?(p.rect.y-=p.labelHeight,p.setHeight(w+p.labelHeight),p.labelMarginTop=p.labelHeight):"center"==p.labelPosVertical&&p.labelHeight>w?(p.rect.y-=(p.labelHeight-w)/2,p.setHeight(p.labelHeight),p.labelMarginTop=(p.labelHeight-w)/2):"bottom"==p.labelPosVertical&&p.setHeight(w+p.labelHeight))}})},b.prototype.tileNodes=function(i,m){var h=this.tileNodesByFavoringDim(i,m,!0),u=this.tileNodesByFavoringDim(i,m,!1),p=this.getOrgRatio(h);return this.getOrgRatio(u)<p?u:h},b.prototype.getOrgRatio=function(i){var u=i.width/i.height;return u<1&&(u=1/u),u},b.prototype.calcIdealRowWidth=function(i,m){var h=c.TILING_PADDING_VERTICAL,u=c.TILING_PADDING_HORIZONTAL,p=i.length,I=0,w=0,X=0;i.forEach(function(tt){I+=tt.getWidth(),w+=tt.getHeight(),tt.getWidth()>X&&(X=tt.getWidth())});var H,Y=I/p,P=w/p,_=Math.pow(h-u,2)+4*(Y+u)*(P+h)*p,lt=(u-h+Math.sqrt(_))/(2*(Y+u));m?(H=Math.ceil(lt))==lt&&H++:H=Math.floor(lt);var ht=H*(Y+u)-u;return X>ht&&(ht=X),ht+=2*u},b.prototype.tileNodesByFavoringDim=function(i,m,h){var u=c.TILING_PADDING_VERTICAL,p=c.TILING_PADDING_HORIZONTAL,I=c.TILING_COMPARE_BY,w={rows:[],rowWidth:[],rowHeight:[],width:0,height:m,verticalPadding:u,horizontalPadding:p,centerX:0,centerY:0};I&&(w.idealRowWidth=this.calcIdealRowWidth(i,h));var X=function(O){return O.rect.width*O.rect.height},Y=function(O,z){return X(z)-X(O)};i.sort(function(tt,O){var z=Y;return w.idealRowWidth?(z=I)(tt.id,O.id):z(tt,O)});for(var P=0,_=0,lt=0;lt<i.length;lt++)P+=(H=i[lt]).getCenterX(),_+=H.getCenterY();for(w.centerX=P/i.length,w.centerY=_/i.length,lt=0;lt<i.length;lt++){var H=i[lt];if(0==w.rows.length)this.insertNodeToRow(w,H,0,m);else if(this.canAddHorizontal(w,H.rect.width,H.rect.height)){var ht=w.rows.length-1;w.idealRowWidth||(ht=this.getShortestRowIndex(w)),this.insertNodeToRow(w,H,ht,m)}else this.insertNodeToRow(w,H,w.rows.length,m);this.shiftToLastRow(w)}return w},b.prototype.insertNodeToRow=function(i,m,h,u){var p=u;if(h==i.rows.length){var I=[];i.rows.push(I),i.rowWidth.push(p),i.rowHeight.push(0)}var w=i.rowWidth[h]+m.rect.width;i.rows[h].length>0&&(w+=i.horizontalPadding),i.rowWidth[h]=w,i.width<w&&(i.width=w);var X=m.rect.height;h>0&&(X+=i.verticalPadding);var Y=0;X>i.rowHeight[h]&&(Y=i.rowHeight[h],i.rowHeight[h]=X,Y=i.rowHeight[h]-Y),i.height+=Y,i.rows[h].push(m)},b.prototype.getShortestRowIndex=function(i){for(var m=-1,h=Number.MAX_VALUE,u=0;u<i.rows.length;u++)i.rowWidth[u]<h&&(m=u,h=i.rowWidth[u]);return m},b.prototype.getLongestRowIndex=function(i){for(var m=-1,h=Number.MIN_VALUE,u=0;u<i.rows.length;u++)i.rowWidth[u]>h&&(m=u,h=i.rowWidth[u]);return m},b.prototype.canAddHorizontal=function(i,m,h){if(i.idealRowWidth){var u=i.rows.length-1;return i.rowWidth[u]+m+i.horizontalPadding<=i.idealRowWidth}var I=this.getShortestRowIndex(i);if(I<0)return!0;var w=i.rowWidth[I];if(w+i.horizontalPadding+m<=i.width)return!0;var Y,P,X=0;return i.rowHeight[I]<h&&I>0&&(X=h+i.verticalPadding-i.rowHeight[I]),Y=i.width-w>=m+i.horizontalPadding?(i.height+X)/(w+m+i.horizontalPadding):(i.height+X)/i.width,X=h+i.verticalPadding,(P=i.width<m?(i.height+X)/m:(i.height+X)/i.width)<1&&(P=1/P),Y<1&&(Y=1/Y),Y<P},b.prototype.shiftToLastRow=function(i){var m=this.getLongestRowIndex(i),h=i.rowWidth.length-1,u=i.rows[m],p=u[u.length-1],I=p.width+i.horizontalPadding;if(i.width-i.rowWidth[h]>I&&m!=h){u.splice(-1,1),i.rows[h].push(p),i.rowWidth[m]=i.rowWidth[m]-I,i.rowWidth[h]=i.rowWidth[h]+I,i.width=i.rowWidth[instance.getLongestRowIndex(i)];for(var w=Number.MIN_VALUE,X=0;X<u.length;X++)u[X].height>w&&(w=u[X].height);m>0&&(w+=i.verticalPadding);var Y=i.rowHeight[m]+i.rowHeight[h];i.rowHeight[m]=w,i.rowHeight[h]<p.height+i.verticalPadding&&(i.rowHeight[h]=p.height+i.verticalPadding);var P=i.rowHeight[m]+i.rowHeight[h];i.height+=P-Y,this.shiftToLastRow(i)}},b.prototype.tilingPreLayout=function(){c.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},b.prototype.tilingPostLayout=function(){c.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},b.prototype.reduceTrees=function(){for(var h,i=[],m=!0;m;){var u=this.graphManager.getAllNodes(),p=[];m=!1;for(var I=0;I<u.length;I++)if(1==(h=u[I]).getEdges().length&&!h.getEdges()[0].isInterGraph&&null==h.getChild()){if(c.PURE_INCREMENTAL){var w=h.getEdges()[0].getOtherEnd(h),X=new D(h.getCenterX()-w.getCenterX(),h.getCenterY()-w.getCenterY());p.push([h,h.getEdges()[0],h.getOwner(),X])}else p.push([h,h.getEdges()[0],h.getOwner()]);m=!0}if(1==m){for(var Y=[],P=0;P<p.length;P++)1==p[P][0].getEdges().length&&(Y.push(p[P]),p[P][0].getOwner().remove(p[P][0]));i.push(Y),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=i},b.prototype.growTree=function(i){for(var u,h=i[i.length-1],p=0;p<h.length;p++)u=h[p],this.findPlaceforPrunedNode(u),u[2].add(u[0]),u[2].add(u[1],u[1].source,u[1].target);i.splice(i.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},b.prototype.findPlaceforPrunedNode=function(i){var m,h,u=i[0];if(h=u==i[1].source?i[1].target:i[1].source,c.PURE_INCREMENTAL)u.setCenter(h.getCenterX()+i[3].getWidth(),h.getCenterY()+i[3].getHeight());else{var p=h.startX,I=h.finishX,w=h.startY,X=h.finishY,H=[0,0,0,0];if(w>0)for(var ht=p;ht<=I;ht++)H[0]+=this.grid[ht][w-1].length+this.grid[ht][w].length-1;if(I<this.grid.length-1)for(ht=w;ht<=X;ht++)H[1]+=this.grid[I+1][ht].length+this.grid[I][ht].length-1;if(X<this.grid[0].length-1)for(ht=p;ht<=I;ht++)H[2]+=this.grid[ht][X+1].length+this.grid[ht][X].length-1;if(p>0)for(ht=w;ht<=X;ht++)H[3]+=this.grid[p-1][ht].length+this.grid[p][ht].length-1;for(var O,z,tt=x.MAX_VALUE,Z=0;Z<H.length;Z++)H[Z]<tt?(tt=H[Z],O=1,z=Z):H[Z]==tt&&O++;if(3==O&&0==tt)0==H[0]&&0==H[1]&&0==H[2]?m=1:0==H[0]&&0==H[1]&&0==H[3]?m=0:0==H[0]&&0==H[2]&&0==H[3]?m=3:0==H[1]&&0==H[2]&&0==H[3]&&(m=2);else if(2==O&&0==tt){var st=Math.floor(2*Math.random());m=0==H[0]&&0==H[1]?0==st?0:1:0==H[0]&&0==H[2]?0==st?0:2:0==H[0]&&0==H[3]?0==st?0:3:0==H[1]&&0==H[2]?0==st?1:2:0==H[1]&&0==H[3]?0==st?1:3:0==st?2:3}else m=4==O&&0==tt?st=Math.floor(4*Math.random()):z;0==m?u.setCenter(h.getCenterX(),h.getCenterY()-h.getHeight()/2-f.DEFAULT_EDGE_LENGTH-u.getHeight()/2):1==m?u.setCenter(h.getCenterX()+h.getWidth()/2+f.DEFAULT_EDGE_LENGTH+u.getWidth()/2,h.getCenterY()):2==m?u.setCenter(h.getCenterX(),h.getCenterY()+h.getHeight()/2+f.DEFAULT_EDGE_LENGTH+u.getHeight()/2):u.setCenter(h.getCenterX()-h.getWidth()/2-f.DEFAULT_EDGE_LENGTH-u.getWidth()/2,h.getCenterY())}},o.exports=b},991:(o,E,t)=>{var d=t(551).FDLayoutNode,e=t(551).IMath;function r(g,c,T,f){d.call(this,g,c,T,f)}for(var l in r.prototype=Object.create(d.prototype),d)r[l]=d[l];r.prototype.calculateDisplacement=function(){var g=this.graphManager.getLayout();null!=this.getChild()&&this.fixedNodeWeight?(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight):(this.displacementX+=g.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=g.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren),Math.abs(this.displacementX)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementY)),this.child&&this.child.getNodes().length>0&&this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},r.prototype.propogateDisplacementToChildren=function(g,c){for(var f,T=this.getChild().getNodes(),A=0;A<T.length;A++)null==(f=T[A]).getChild()?(f.displacementX+=g,f.displacementY+=c):f.propogateDisplacementToChildren(g,c)},r.prototype.move=function(){var g=this.graphManager.getLayout();(null==this.child||0==this.child.getNodes().length)&&(this.moveBy(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY)),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},r.prototype.setPred1=function(g){this.pred1=g},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(g){this.next=g},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(g){this.processed=g},r.prototype.isProcessed=function(){return processed},o.exports=r},902:(o,E,t)=>{function d(T){if(Array.isArray(T)){for(var f=0,A=Array(T.length);f<T.length;f++)A[f]=T[f];return A}return Array.from(T)}var e=t(806),r=t(551).LinkedList,l=t(551).Matrix,g=t(551).SVD;function c(){}c.handleConstraints=function(T){var f={};f.fixedNodeConstraint=T.constraints.fixedNodeConstraint,f.alignmentConstraint=T.constraints.alignmentConstraint,f.relativePlacementConstraint=T.constraints.relativePlacementConstraint;for(var A=new Map,N=new Map,L=[],D=[],et=T.getAllNodes(),x=0,nt=0;nt<et.length;nt++){var dt=et[nt];null==dt.getChild()&&(N.set(dt.id,x++),L.push(dt.getCenterX()),D.push(dt.getCenterY()),A.set(dt.id,dt))}f.relativePlacementConstraint&&f.relativePlacementConstraint.forEach(function(V){!V.gap&&0!=V.gap&&(V.left?V.gap=e.DEFAULT_EDGE_LENGTH+A.get(V.left).getWidth()/2+A.get(V.right).getWidth()/2:V.gap=e.DEFAULT_EDGE_LENGTH+A.get(V.top).getHeight()/2+A.get(V.bottom).getHeight()/2)});var ct=function(Q,q){return{x:Q.x-q.x,y:Q.y-q.y}},mt=function(Q){var q=0,v=0;return Q.forEach(function(M){q+=L[N.get(M)],v+=D[N.get(M)]}),{x:q/Q.size,y:v/Q.size}},b=function(Q,q,v,M,C){function k(W,K){var rt=new Set(W),B=!0,j=!1,Ot=void 0;try{for(var yt,pt=K[Symbol.iterator]();!(B=(yt=pt.next()).done);B=!0){var It=yt.value;rt.add(It)}}catch(Nt){j=!0,Ot=Nt}finally{try{!B&&pt.return&&pt.return()}finally{if(j)throw Ot}}return rt}var G=new Map;Q.forEach(function(W,K){G.set(K,0)}),Q.forEach(function(W,K){W.forEach(function(rt){G.set(rt.id,G.get(rt.id)+1)})});var S=new Map,F=new Map,$=new r;G.forEach(function(W,K){0==W?($.push(K),v||("horizontal"==q?S.set(K,N.has(K)?L[N.get(K)]:M.get(K)):S.set(K,N.has(K)?D[N.get(K)]:M.get(K)))):S.set(K,Number.NEGATIVE_INFINITY),v&&F.set(K,new Set([K]))}),v&&C.forEach(function(W){var K=[];if(W.forEach(function(j){v.has(j)&&K.push(j)}),K.length>0){var rt=0;K.forEach(function(j){"horizontal"==q?(S.set(j,N.has(j)?L[N.get(j)]:M.get(j)),rt+=S.get(j)):(S.set(j,N.has(j)?D[N.get(j)]:M.get(j)),rt+=S.get(j))}),rt/=K.length,W.forEach(function(j){v.has(j)||S.set(j,rt)})}else{var B=0;W.forEach(function(j){B+="horizontal"==q?N.has(j)?L[N.get(j)]:M.get(j):N.has(j)?D[N.get(j)]:M.get(j)}),B/=W.length,W.forEach(function(j){S.set(j,B)})}});for(var ot=function(){var K=$.shift();Q.get(K).forEach(function(B){if(S.get(B.id)<S.get(K)+B.gap)if(v&&v.has(B.id)){var j=void 0;if(j="horizontal"==q?N.has(B.id)?L[N.get(B.id)]:M.get(B.id):N.has(B.id)?D[N.get(B.id)]:M.get(B.id),S.set(B.id,j),j<S.get(K)+B.gap){var Ot=S.get(K)+B.gap-j;F.get(K).forEach(function(pt){S.set(pt,S.get(pt)-Ot)})}}else S.set(B.id,S.get(K)+B.gap);G.set(B.id,G.get(B.id)-1),0==G.get(B.id)&&$.push(B.id),v&&F.set(B.id,k(F.get(K),F.get(B.id)))})};0!=$.length;)ot();if(v){var U=new Set;Q.forEach(function(W,K){0==W.length&&U.add(K)});var at=[];F.forEach(function(W,K){if(U.has(K)){var rt=!1,B=!0,j=!1,Ot=void 0;try{for(var yt,pt=W[Symbol.iterator]();!(B=(yt=pt.next()).done);B=!0){var It=yt.value;v.has(It)&&(rt=!0)}}catch(wt){j=!0,Ot=wt}finally{try{!B&&pt.return&&pt.return()}finally{if(j)throw Ot}}if(!rt){var Nt=!1,St=void 0;at.forEach(function(wt,Gt){wt.has([].concat(d(W))[0])&&(Nt=!0,St=Gt)}),Nt?W.forEach(function(wt){at[St].add(wt)}):at.push(new Set(W))}}}),at.forEach(function(W,K){var rt=Number.POSITIVE_INFINITY,B=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,Ot=Number.NEGATIVE_INFINITY,pt=!0,yt=!1,It=void 0;try{for(var St,Nt=W[Symbol.iterator]();!(pt=(St=Nt.next()).done);pt=!0){var wt=St.value,Gt=void 0;Gt="horizontal"==q?N.has(wt)?L[N.get(wt)]:M.get(wt):N.has(wt)?D[N.get(wt)]:M.get(wt);var zt=S.get(wt);Gt<rt&&(rt=Gt),Gt>j&&(j=Gt),zt<B&&(B=zt),zt>Ot&&(Ot=zt)}}catch(qt){yt=!0,It=qt}finally{try{!pt&&Nt.return&&Nt.return()}finally{if(yt)throw It}}var Wt=(rt+j)/2-(B+Ot)/2,Vt=!0,$t=!1,kt=void 0;try{for(var _t,Zt=W[Symbol.iterator]();!(Vt=(_t=Zt.next()).done);Vt=!0){var jt=_t.value;S.set(jt,S.get(jt)+Wt)}}catch(qt){$t=!0,kt=qt}finally{try{!Vt&&Zt.return&&Zt.return()}finally{if($t)throw kt}}})}return S},J=function(Q){var q=0,v=0,M=0,C=0;if(Q.forEach(function(F){F.left?L[N.get(F.left)]-L[N.get(F.right)]>=0?q++:v++:D[N.get(F.top)]-D[N.get(F.bottom)]>=0?M++:C++}),q>v&&M>C)for(var k=0;k<N.size;k++)L[k]=-1*L[k],D[k]=-1*D[k];else if(q>v)for(var G=0;G<N.size;G++)L[G]=-1*L[G];else if(M>C)for(var S=0;S<N.size;S++)D[S]=-1*D[S]},i=function(Q){var q=[],v=new r,M=new Set,C=0;return Q.forEach(function(k,G){if(!M.has(G)){q[C]=[];var S=G;for(v.push(S),M.add(S),q[C].push(S);0!=v.length;)S=v.shift(),Q.get(S).forEach(function($){M.has($.id)||(v.push($.id),M.add($.id),q[C].push($.id))});C++}}),q},m=function(Q){var q=new Map;return Q.forEach(function(v,M){q.set(M,[])}),Q.forEach(function(v,M){v.forEach(function(C){q.get(M).push(C),q.get(C.id).push({id:M,gap:C.gap,direction:C.direction})})}),q},h=function(Q){var q=new Map;return Q.forEach(function(v,M){q.set(M,[])}),Q.forEach(function(v,M){v.forEach(function(C){q.get(C.id).push({id:M,gap:C.gap,direction:C.direction})})}),q},u=[],p=[],I=!1,w=!1,X=new Set,Y=new Map,P=new Map,_=[];if(f.fixedNodeConstraint&&f.fixedNodeConstraint.forEach(function(V){X.add(V.nodeId)}),f.relativePlacementConstraint&&(f.relativePlacementConstraint.forEach(function(V){V.left?(Y.has(V.left)?Y.get(V.left).push({id:V.right,gap:V.gap,direction:"horizontal"}):Y.set(V.left,[{id:V.right,gap:V.gap,direction:"horizontal"}]),Y.has(V.right)||Y.set(V.right,[])):(Y.has(V.top)?Y.get(V.top).push({id:V.bottom,gap:V.gap,direction:"vertical"}):Y.set(V.top,[{id:V.bottom,gap:V.gap,direction:"vertical"}]),Y.has(V.bottom)||Y.set(V.bottom,[]))}),P=m(Y),_=i(P)),e.TRANSFORM_ON_CONSTRAINT_HANDLING){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>1)f.fixedNodeConstraint.forEach(function(V,Q){u[Q]=[V.position.x,V.position.y],p[Q]=[L[N.get(V.nodeId)],D[N.get(V.nodeId)]]}),I=!0;else if(f.alignmentConstraint)!function(){var V=0;if(f.alignmentConstraint.vertical){for(var Q=f.alignmentConstraint.vertical,q=function(S){var F=new Set;Q[S].forEach(function(U){F.add(U)});var $=new Set([].concat(d(F)).filter(function(U){return X.has(U)})),ot=void 0;ot=$.size>0?L[N.get($.values().next().value)]:mt(F).x,Q[S].forEach(function(U){u[V]=[ot,D[N.get(U)]],p[V]=[L[N.get(U)],D[N.get(U)]],V++})},v=0;v<Q.length;v++)q(v);I=!0}if(f.alignmentConstraint.horizontal){for(var M=f.alignmentConstraint.horizontal,C=function(S){var F=new Set;M[S].forEach(function(U){F.add(U)});var $=new Set([].concat(d(F)).filter(function(U){return X.has(U)})),ot=void 0;ot=$.size>0?L[N.get($.values().next().value)]:mt(F).y,M[S].forEach(function(U){u[V]=[L[N.get(U)],ot],p[V]=[L[N.get(U)],D[N.get(U)]],V++})},k=0;k<M.length;k++)C(k);I=!0}f.relativePlacementConstraint&&(w=!0)}();else if(f.relativePlacementConstraint){for(var lt=0,H=0,ht=0;ht<_.length;ht++)_[ht].length>lt&&(lt=_[ht].length,H=ht);if(lt<P.size/2)J(f.relativePlacementConstraint),I=!1,w=!1;else{var tt=new Map,O=new Map,z=[];_[H].forEach(function(V){Y.get(V).forEach(function(Q){"horizontal"==Q.direction?(tt.has(V)?tt.get(V).push(Q):tt.set(V,[Q]),tt.has(Q.id)||tt.set(Q.id,[]),z.push({left:V,right:Q.id})):(O.has(V)?O.get(V).push(Q):O.set(V,[Q]),O.has(Q.id)||O.set(Q.id,[]),z.push({top:V,bottom:Q.id}))})}),J(z),w=!1;var Z=b(tt,"horizontal"),st=b(O,"vertical");_[H].forEach(function(V,Q){p[Q]=[L[N.get(V)],D[N.get(V)]],u[Q]=[],Z.has(V)?u[Q][0]=Z.get(V):u[Q][0]=L[N.get(V)],st.has(V)?u[Q][1]=st.get(V):u[Q][1]=D[N.get(V)]}),I=!0}}if(I){for(var ft=void 0,it=l.transpose(u),Pt=l.transpose(p),Lt=0;Lt<it.length;Lt++)it[Lt]=l.multGamma(it[Lt]),Pt[Lt]=l.multGamma(Pt[Lt]);var Kt=l.multMat(it,l.transpose(Pt)),Ut=g.svd(Kt);ft=l.multMat(Ut.V,l.transpose(Ut.U));for(var ut=0;ut<N.size;ut++){var gt=[L[ut],D[ut]],xt=[ft[0][0],ft[1][0]],Dt=[ft[0][1],ft[1][1]];L[ut]=l.dotProduct(gt,xt),D[ut]=l.dotProduct(gt,Dt)}w&&J(f.relativePlacementConstraint)}}if(e.ENFORCE_CONSTRAINTS){if(f.fixedNodeConstraint&&f.fixedNodeConstraint.length>0){var Mt={x:0,y:0};f.fixedNodeConstraint.forEach(function(V,Q){var q={x:L[N.get(V.nodeId)],y:D[N.get(V.nodeId)]},v=V.position,M=ct(v,q);Mt.x+=M.x,Mt.y+=M.y}),Mt.x/=f.fixedNodeConstraint.length,Mt.y/=f.fixedNodeConstraint.length,L.forEach(function(V,Q){L[Q]+=Mt.x}),D.forEach(function(V,Q){D[Q]+=Mt.y}),f.fixedNodeConstraint.forEach(function(V){L[N.get(V.nodeId)]=V.position.x,D[N.get(V.nodeId)]=V.position.y})}if(f.alignmentConstraint){if(f.alignmentConstraint.vertical)for(var Ct=f.alignmentConstraint.vertical,At=function(Q){var q=new Set;Ct[Q].forEach(function(C){q.add(C)});var v=new Set([].concat(d(q)).filter(function(C){return X.has(C)})),M=void 0;M=v.size>0?L[N.get(v.values().next().value)]:mt(q).x,q.forEach(function(C){X.has(C)||(L[N.get(C)]=M)})},Rt=0;Rt<Ct.length;Rt++)At(Rt);if(f.alignmentConstraint.horizontal)for(var Ht=f.alignmentConstraint.horizontal,Qt=function(Q){var q=new Set;Ht[Q].forEach(function(C){q.add(C)});var v=new Set([].concat(d(q)).filter(function(C){return X.has(C)})),M=void 0;M=v.size>0?D[N.get(v.values().next().value)]:mt(q).y,q.forEach(function(C){X.has(C)||(D[N.get(C)]=M)})},bt=0;bt<Ht.length;bt++)Qt(bt)}f.relativePlacementConstraint&&function(){var V=new Map,Q=new Map,q=new Map,v=new Map,M=new Map,C=new Map,k=new Set,G=new Set;if(X.forEach(function(Bt){k.add(Bt),G.add(Bt)}),f.alignmentConstraint){if(f.alignmentConstraint.vertical)for(var S=f.alignmentConstraint.vertical,F=function(Tt){q.set("dummy"+Tt,[]),S[Tt].forEach(function(Ft){V.set(Ft,"dummy"+Tt),q.get("dummy"+Tt).push(Ft),X.has(Ft)&&k.add("dummy"+Tt)}),M.set("dummy"+Tt,L[N.get(S[Tt][0])])},$=0;$<S.length;$++)F($);if(f.alignmentConstraint.horizontal)for(var ot=f.alignmentConstraint.horizontal,U=function(Tt){v.set("dummy"+Tt,[]),ot[Tt].forEach(function(Ft){Q.set(Ft,"dummy"+Tt),v.get("dummy"+Tt).push(Ft),X.has(Ft)&&G.add("dummy"+Tt)}),C.set("dummy"+Tt,D[N.get(ot[Tt][0])])},at=0;at<ot.length;at++)U(at)}var W=new Map,K=new Map,rt=function(Tt){Y.get(Tt).forEach(function(Ft){var te=void 0,Jt=void 0;"horizontal"==Ft.direction?(te=V.get(Tt)?V.get(Tt):Tt,Jt=V.get(Ft.id)?{id:V.get(Ft.id),gap:Ft.gap,direction:Ft.direction}:Ft,W.has(te)?W.get(te).push(Jt):W.set(te,[Jt]),W.has(Jt.id)||W.set(Jt.id,[])):(te=Q.get(Tt)?Q.get(Tt):Tt,Jt=Q.get(Ft.id)?{id:Q.get(Ft.id),gap:Ft.gap,direction:Ft.direction}:Ft,K.has(te)?K.get(te).push(Jt):K.set(te,[Jt]),K.has(Jt.id)||K.set(Jt.id,[]))})},B=!0,j=!1,Ot=void 0;try{for(var yt,pt=Y.keys()[Symbol.iterator]();!(B=(yt=pt.next()).done);B=!0)rt(yt.value)}catch(Bt){j=!0,Ot=Bt}finally{try{!B&&pt.return&&pt.return()}finally{if(j)throw Ot}}var Nt=m(W),St=m(K),wt=i(Nt),Gt=i(St),zt=h(W),Wt=h(K),Vt=[],$t=[];wt.forEach(function(Bt,Tt){Vt[Tt]=[],Bt.forEach(function(Ft){0==zt.get(Ft).length&&Vt[Tt].push(Ft)})}),Gt.forEach(function(Bt,Tt){$t[Tt]=[],Bt.forEach(function(Ft){0==Wt.get(Ft).length&&$t[Tt].push(Ft)})});var kt=b(W,"horizontal",k,M,Vt),Zt=b(K,"vertical",G,C,$t),_t=function(Tt){q.get(Tt)?q.get(Tt).forEach(function(Ft){L[N.get(Ft)]=kt.get(Tt)}):L[N.get(Tt)]=kt.get(Tt)},jt=!0,qt=!1,re=void 0;try{for(var se,ie=kt.keys()[Symbol.iterator]();!(jt=(se=ie.next()).done);jt=!0)_t(se.value)}catch(Bt){qt=!0,re=Bt}finally{try{!jt&&ie.return&&ie.return()}finally{if(qt)throw re}}var ce=function(Tt){v.get(Tt)?v.get(Tt).forEach(function(Ft){D[N.get(Ft)]=Zt.get(Tt)}):D[N.get(Tt)]=Zt.get(Tt)},ne=!0,le=!1,he=void 0;try{for(var fe,oe=Zt.keys()[Symbol.iterator]();!(ne=(fe=oe.next()).done);ne=!0)ce(fe.value)}catch(Bt){le=!0,he=Bt}finally{try{!ne&&oe.return&&oe.return()}finally{if(le)throw he}}}()}for(var Yt=0;Yt<et.length;Yt++){var Xt=et[Yt];null==Xt.getChild()&&Xt.setCenter(L[N.get(Xt.id)],D[N.get(Xt.id)])}},o.exports=c},551:o=>{o.exports=R}},s={};function n(o){var E=s[o];if(void 0!==E)return E.exports;var t=s[o]={exports:{}};return y[o](t,t.exports,n),t.exports}return n(45)})())},28432:function(ee){ee.exports=function(vt){var Et={};function R(y){if(Et[y])return Et[y].exports;var s=Et[y]={i:y,l:!1,exports:{}};return vt[y].call(s.exports,s,s.exports,R),s.l=!0,s.exports}return R.m=vt,R.c=Et,R.i=function(y){return y},R.d=function(y,s,n){R.o(y,s)||Object.defineProperty(y,s,{configurable:!1,enumerable:!0,get:n})},R.n=function(y){var s=y&&y.__esModule?function(){return y.default}:function(){return y};return R.d(s,"a",s),s},R.o=function(y,s){return Object.prototype.hasOwnProperty.call(y,s)},R.p="",R(R.s=28)}([function(vt,Et,R){"use strict";function y(){}y.QUALITY=1,y.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,y.DEFAULT_INCREMENTAL=!1,y.DEFAULT_ANIMATION_ON_LAYOUT=!0,y.DEFAULT_ANIMATION_DURING_LAYOUT=!1,y.DEFAULT_ANIMATION_PERIOD=50,y.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,y.DEFAULT_GRAPH_MARGIN=15,y.NODE_DIMENSIONS_INCLUDE_LABELS=!1,y.SIMPLE_NODE_SIZE=40,y.SIMPLE_NODE_HALF_SIZE=y.SIMPLE_NODE_SIZE/2,y.EMPTY_COMPOUND_NODE_SIZE=40,y.MIN_EDGE_LENGTH=1,y.WORLD_BOUNDARY=1e6,y.INITIAL_WORLD_BOUNDARY=y.WORLD_BOUNDARY/1e3,y.WORLD_CENTER_X=1200,y.WORLD_CENTER_Y=900,vt.exports=y},function(vt,Et,R){"use strict";var y=R(2),s=R(8),n=R(9);function a(E,t,d){y.call(this,d),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=d,this.bendpoints=[],this.source=E,this.target=t}for(var o in a.prototype=Object.create(y.prototype),y)a[o]=y[o];a.prototype.getSource=function(){return this.source},a.prototype.getTarget=function(){return this.target},a.prototype.isInterGraph=function(){return this.isInterGraph},a.prototype.getLength=function(){return this.length},a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},a.prototype.getBendpoints=function(){return this.bendpoints},a.prototype.getLca=function(){return this.lca},a.prototype.getSourceInLca=function(){return this.sourceInLca},a.prototype.getTargetInLca=function(){return this.targetInLca},a.prototype.getOtherEnd=function(E){if(this.source===E)return this.target;if(this.target===E)return this.source;throw"Node is not incident with this edge"},a.prototype.getOtherEndInGraph=function(E,t){for(var d=this.getOtherEnd(E),e=t.getGraphManager().getRoot();;){if(d.getOwner()==t)return d;if(d.getOwner()==e)break;d=d.getOwner().getParent()}return null},a.prototype.updateLength=function(){var E=new Array(4);this.isOverlapingSourceAndTarget=s.getIntersection(this.target.getRect(),this.source.getRect(),E),this.isOverlapingSourceAndTarget||(this.lengthX=E[0]-E[2],this.lengthY=E[1]-E[3],Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=n.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=n.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},vt.exports=a},function(vt,Et,R){"use strict";function y(s){this.vGraphObject=s}vt.exports=y},function(vt,Et,R){"use strict";var y=R(2),s=R(10),n=R(13),a=R(0),o=R(16),E=R(5);function t(e,r,l,g){null==l&&null==g&&(g=r),y.call(this,g),null!=e.graphManager&&(e=e.graphManager),this.estimatedSize=s.MIN_VALUE,this.inclusionTreeDepth=s.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=e,this.rect=null!=l&&null!=r?new n(r.x,r.y,l.width,l.height):new n}for(var d in t.prototype=Object.create(y.prototype),y)t[d]=y[d];t.prototype.getEdges=function(){return this.edges},t.prototype.getChild=function(){return this.child},t.prototype.getOwner=function(){return this.owner},t.prototype.getWidth=function(){return this.rect.width},t.prototype.setWidth=function(e){this.rect.width=e},t.prototype.getHeight=function(){return this.rect.height},t.prototype.setHeight=function(e){this.rect.height=e},t.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},t.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},t.prototype.getCenter=function(){return new E(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},t.prototype.getLocation=function(){return new E(this.rect.x,this.rect.y)},t.prototype.getRect=function(){return this.rect},t.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},t.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},t.prototype.setRect=function(e,r){this.rect.x=e.x,this.rect.y=e.y,this.rect.width=r.width,this.rect.height=r.height},t.prototype.setCenter=function(e,r){this.rect.x=e-this.rect.width/2,this.rect.y=r-this.rect.height/2},t.prototype.setLocation=function(e,r){this.rect.x=e,this.rect.y=r},t.prototype.moveBy=function(e,r){this.rect.x+=e,this.rect.y+=r},t.prototype.getEdgeListToNode=function(e){var r=[],g=this;return g.edges.forEach(function(c){if(c.target==e){if(c.source!=g)throw"Incorrect edge source!";r.push(c)}}),r},t.prototype.getEdgesBetween=function(e){var r=[],g=this;return g.edges.forEach(function(c){if(c.source!=g&&c.target!=g)throw"Incorrect edge source and/or target";(c.target==e||c.source==e)&&r.push(c)}),r},t.prototype.getNeighborsList=function(){var e=new Set,r=this;return r.edges.forEach(function(l){if(l.source==r)e.add(l.target);else{if(l.target!=r)throw"Incorrect incidency!";e.add(l.source)}}),e},t.prototype.withChildren=function(){var e=new Set;if(e.add(this),null!=this.child)for(var g=this.child.getNodes(),c=0;c<g.length;c++)g[c].withChildren().forEach(function(T){e.add(T)});return e},t.prototype.getNoOfChildren=function(){var e=0;if(null==this.child)e=1;else for(var l=this.child.getNodes(),g=0;g<l.length;g++)e+=l[g].getNoOfChildren();return 0==e&&(e=1),e},t.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},t.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},t.prototype.scatter=function(){var e,r,l=-a.INITIAL_WORLD_BOUNDARY,g=a.INITIAL_WORLD_BOUNDARY;e=a.WORLD_CENTER_X+o.nextDouble()*(g-l)+l;var c=-a.INITIAL_WORLD_BOUNDARY,T=a.INITIAL_WORLD_BOUNDARY;r=a.WORLD_CENTER_Y+o.nextDouble()*(T-c)+c,this.rect.x=e,this.rect.y=r},t.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var e=this.getChild();if(e.updateBounds(!0),this.rect.x=e.getLeft(),this.rect.y=e.getTop(),this.setWidth(e.getRight()-e.getLeft()),this.setHeight(e.getBottom()-e.getTop()),a.NODE_DIMENSIONS_INCLUDE_LABELS){var r=e.getRight()-e.getLeft(),l=e.getBottom()-e.getTop();this.labelWidth&&("left"==this.labelPosHorizontal?(this.rect.x-=this.labelWidth,this.setWidth(r+this.labelWidth)):"center"==this.labelPosHorizontal&&this.labelWidth>r?(this.rect.x-=(this.labelWidth-r)/2,this.setWidth(this.labelWidth)):"right"==this.labelPosHorizontal&&this.setWidth(r+this.labelWidth)),this.labelHeight&&("top"==this.labelPosVertical?(this.rect.y-=this.labelHeight,this.setHeight(l+this.labelHeight)):"center"==this.labelPosVertical&&this.labelHeight>l?(this.rect.y-=(this.labelHeight-l)/2,this.setHeight(this.labelHeight)):"bottom"==this.labelPosVertical&&this.setHeight(l+this.labelHeight))}}},t.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==s.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},t.prototype.transform=function(e){var r=this.rect.x;r>a.WORLD_BOUNDARY?r=a.WORLD_BOUNDARY:r<-a.WORLD_BOUNDARY&&(r=-a.WORLD_BOUNDARY);var l=this.rect.y;l>a.WORLD_BOUNDARY?l=a.WORLD_BOUNDARY:l<-a.WORLD_BOUNDARY&&(l=-a.WORLD_BOUNDARY);var g=new E(r,l),c=e.inverseTransformPoint(g);this.setLocation(c.x,c.y)},t.prototype.getLeft=function(){return this.rect.x},t.prototype.getRight=function(){return this.rect.x+this.rect.width},t.prototype.getTop=function(){return this.rect.y},t.prototype.getBottom=function(){return this.rect.y+this.rect.height},t.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},vt.exports=t},function(vt,Et,R){"use strict";var y=R(0);function s(){}for(var n in y)s[n]=y[n];s.MAX_ITERATIONS=2500,s.DEFAULT_EDGE_LENGTH=50,s.DEFAULT_SPRING_STRENGTH=.45,s.DEFAULT_REPULSION_STRENGTH=4500,s.DEFAULT_GRAVITY_STRENGTH=.4,s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,s.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,s.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,s.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,s.COOLING_ADAPTATION_FACTOR=.33,s.ADAPTATION_LOWER_NODE_LIMIT=1e3,s.ADAPTATION_UPPER_NODE_LIMIT=5e3,s.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,s.MAX_NODE_DISPLACEMENT=3*s.MAX_NODE_DISPLACEMENT_INCREMENTAL,s.MIN_REPULSION_DIST=s.DEFAULT_EDGE_LENGTH/10,s.CONVERGENCE_CHECK_PERIOD=100,s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,s.MIN_EDGE_LENGTH=1,s.GRID_CALCULATION_CHECK_PERIOD=10,vt.exports=s},function(vt,Et,R){"use strict";function y(s,n){null==s&&null==n?(this.x=0,this.y=0):(this.x=s,this.y=n)}y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.setX=function(s){this.x=s},y.prototype.setY=function(s){this.y=s},y.prototype.getDifference=function(s){return new DimensionD(this.x-s.x,this.y-s.y)},y.prototype.getCopy=function(){return new y(this.x,this.y)},y.prototype.translate=function(s){return this.x+=s.width,this.y+=s.height,this},vt.exports=y},function(vt,Et,R){"use strict";var y=R(2),s=R(10),n=R(0),a=R(7),o=R(3),E=R(1),t=R(13),d=R(12),e=R(11);function r(g,c,T){y.call(this,T),this.estimatedSize=s.MIN_VALUE,this.margin=n.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,null!=c&&c instanceof a?this.graphManager=c:null!=c&&c instanceof Layout&&(this.graphManager=c.graphManager)}for(var l in r.prototype=Object.create(y.prototype),y)r[l]=y[l];r.prototype.getNodes=function(){return this.nodes},r.prototype.getEdges=function(){return this.edges},r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getParent=function(){return this.parent},r.prototype.getLeft=function(){return this.left},r.prototype.getRight=function(){return this.right},r.prototype.getTop=function(){return this.top},r.prototype.getBottom=function(){return this.bottom},r.prototype.isConnected=function(){return this.isConnected},r.prototype.add=function(g,c,T){if(null==c&&null==T){var f=g;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(f)>-1)throw"Node already in graph!";return f.owner=this,this.getNodes().push(f),f}var A=g;if(!(this.getNodes().indexOf(c)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(c.owner!=T.owner||c.owner!=this)throw"Both owners must be this graph!";return c.owner!=T.owner?null:(A.source=c,A.target=T,A.isInterGraph=!1,this.getEdges().push(A),c.edges.push(A),T!=c&&T.edges.push(A),A)},r.prototype.remove=function(g){var c=g;if(g instanceof o){if(null==c)throw"Node is null!";if(null==c.owner||c.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var T=c.edges.slice(),A=T.length,N=0;N<A;N++)(f=T[N]).isInterGraph?this.graphManager.remove(f):f.source.owner.remove(f);if(-1==(L=this.nodes.indexOf(c)))throw"Node not in owner node list!";this.nodes.splice(L,1)}else if(g instanceof E){var f;if(null==(f=g))throw"Edge is null!";if(null==f.source||null==f.target)throw"Source and/or target is null!";if(null==f.source.owner||null==f.target.owner||f.source.owner!=this||f.target.owner!=this)throw"Source and/or target owner is invalid!";var L,D=f.source.edges.indexOf(f),et=f.target.edges.indexOf(f);if(!(D>-1&&et>-1))throw"Source and/or target doesn't know this edge!";if(f.source.edges.splice(D,1),f.target!=f.source&&f.target.edges.splice(et,1),-1==(L=f.source.owner.getEdges().indexOf(f)))throw"Not in owner's edge list!";f.source.owner.getEdges().splice(L,1)}},r.prototype.updateLeftTop=function(){for(var T,f,A,g=s.MAX_VALUE,c=s.MAX_VALUE,N=this.getNodes(),L=N.length,D=0;D<L;D++){var et=N[D];g>(T=et.getTop())&&(g=T),c>(f=et.getLeft())&&(c=f)}return g==s.MAX_VALUE?null:(A=null!=N[0].getParent().paddingLeft?N[0].getParent().paddingLeft:this.margin,this.left=c-A,this.top=g-A,new d(this.left,this.top))},r.prototype.updateBounds=function(g){for(var N,L,D,et,x,c=s.MAX_VALUE,T=-s.MAX_VALUE,f=s.MAX_VALUE,A=-s.MAX_VALUE,nt=this.nodes,dt=nt.length,ct=0;ct<dt;ct++){var mt=nt[ct];g&&null!=mt.child&&mt.updateBounds(),c>(N=mt.getLeft())&&(c=N),T<(L=mt.getRight())&&(T=L),f>(D=mt.getTop())&&(f=D),A<(et=mt.getBottom())&&(A=et)}var b=new t(c,f,T-c,A-f);c==s.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),x=null!=nt[0].getParent().paddingLeft?nt[0].getParent().paddingLeft:this.margin,this.left=b.x-x,this.right=b.x+b.width+x,this.top=b.y-x,this.bottom=b.y+b.height+x},r.calculateBounds=function(g){for(var N,L,D,et,c=s.MAX_VALUE,T=-s.MAX_VALUE,f=s.MAX_VALUE,A=-s.MAX_VALUE,x=g.length,nt=0;nt<x;nt++){var dt=g[nt];c>(N=dt.getLeft())&&(c=N),T<(L=dt.getRight())&&(T=L),f>(D=dt.getTop())&&(f=D),A<(et=dt.getBottom())&&(A=et)}return new t(c,f,T-c,A-f)},r.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},r.prototype.getEstimatedSize=function(){if(this.estimatedSize==s.MIN_VALUE)throw"assert failed";return this.estimatedSize},r.prototype.calcEstimatedSize=function(){for(var g=0,c=this.nodes,T=c.length,f=0;f<T;f++)g+=c[f].calcEstimatedSize();return this.estimatedSize=0==g?n.EMPTY_COMPOUND_NODE_SIZE:g/Math.sqrt(this.nodes.length),this.estimatedSize},r.prototype.updateConnected=function(){var g=this;if(0!=this.nodes.length){var A,N,c=new e,T=new Set,f=this.nodes[0];for(f.withChildren().forEach(function(ct){c.push(ct),T.add(ct)});0!==c.length;)for(var D=(A=(f=c.shift()).getEdges()).length,et=0;et<D;et++)null==(N=A[et].getOtherEndInGraph(f,this))||T.has(N)||N.withChildren().forEach(function(ct){c.push(ct),T.add(ct)});if(this.isConnected=!1,T.size>=this.nodes.length){var dt=0;T.forEach(function(ct){ct.owner==g&&dt++}),dt==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},vt.exports=r},function(vt,Et,R){"use strict";var y,s=R(1);function n(a){y=R(6),this.layout=a,this.graphs=[],this.edges=[]}n.prototype.addRoot=function(){var a=this.layout.newGraph(),o=this.layout.newNode(null),E=this.add(a,o);return this.setRootGraph(E),this.rootGraph},n.prototype.add=function(a,o,E,t,d){if(null==E&&null==t&&null==d){if(null==a)throw"Graph is null!";if(null==o)throw"Parent node is null!";if(this.graphs.indexOf(a)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(a),null!=a.parent)throw"Already has a parent!";if(null!=o.child)throw"Already has a child!";return a.parent=o,o.child=a,a}d=E,E=a;var e=(t=o).getOwner(),r=d.getOwner();if(null==e||e.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==r||r.getGraphManager()!=this)throw"Target not in this graph mgr!";if(e==r)return E.isInterGraph=!1,e.add(E,t,d);if(E.isInterGraph=!0,E.source=t,E.target=d,this.edges.indexOf(E)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(E),null==E.source||null==E.target)throw"Edge source and/or target is null!";if(-1!=E.source.edges.indexOf(E)||-1!=E.target.edges.indexOf(E))throw"Edge already in source and/or target incidency list!";return E.source.edges.push(E),E.target.edges.push(E),E},n.prototype.remove=function(a){if(a instanceof y){var o=a;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(o!=this.rootGraph&&(null==o.parent||o.parent.graphManager!=this))throw"Invalid parent node!";for(var t,E=[],d=(E=E.concat(o.getEdges())).length,e=0;e<d;e++)t=E[e],o.remove(t);var l,r=[];for(d=(r=r.concat(o.getNodes())).length,e=0;e<d;e++)l=r[e],o.remove(l);o==this.rootGraph&&this.setRootGraph(null);var g=this.graphs.indexOf(o);this.graphs.splice(g,1),o.parent=null}else if(a instanceof s){if(null==(t=a))throw"Edge is null!";if(!t.isInterGraph)throw"Not an inter-graph edge!";if(null==t.source||null==t.target)throw"Source and/or target is null!";if(-1==t.source.edges.indexOf(t)||-1==t.target.edges.indexOf(t))throw"Source and/or target doesn't know this edge!";if(g=t.source.edges.indexOf(t),t.source.edges.splice(g,1),g=t.target.edges.indexOf(t),t.target.edges.splice(g,1),null==t.source.owner||null==t.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==t.source.owner.getGraphManager().edges.indexOf(t))throw"Not in owner graph manager's edge list!";g=t.source.owner.getGraphManager().edges.indexOf(t),t.source.owner.getGraphManager().edges.splice(g,1)}},n.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},n.prototype.getGraphs=function(){return this.graphs},n.prototype.getAllNodes=function(){if(null==this.allNodes){for(var a=[],o=this.getGraphs(),E=o.length,t=0;t<E;t++)a=a.concat(o[t].getNodes());this.allNodes=a}return this.allNodes},n.prototype.resetAllNodes=function(){this.allNodes=null},n.prototype.resetAllEdges=function(){this.allEdges=null},n.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},n.prototype.getAllEdges=function(){if(null==this.allEdges){for(var a=[],o=this.getGraphs(),t=(o.length,0);t<o.length;t++)a=a.concat(o[t].getEdges());a=a.concat(this.edges),this.allEdges=a}return this.allEdges},n.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},n.prototype.setAllNodesToApplyGravitation=function(a){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=a},n.prototype.getRoot=function(){return this.rootGraph},n.prototype.setRootGraph=function(a){if(a.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=a,null==a.parent&&(a.parent=this.layout.newNode("Root node"))},n.prototype.getLayout=function(){return this.layout},n.prototype.isOneAncestorOfOther=function(a,o){if(null==a||null==o)throw"assert failed";if(a==o)return!0;for(var t,E=a.getOwner();null!=(t=E.getParent());){if(t==o)return!0;if(null==(E=t.getOwner()))break}for(E=o.getOwner();null!=(t=E.getParent());){if(t==a)return!0;if(null==(E=t.getOwner()))break}return!1},n.prototype.calcLowestCommonAncestors=function(){for(var a,o,E,t,d,e=this.getAllEdges(),r=e.length,l=0;l<r;l++)if(o=(a=e[l]).source,E=a.target,a.lca=null,a.sourceInLca=o,a.targetInLca=E,o!=E){for(t=o.getOwner();null==a.lca;){for(a.targetInLca=E,d=E.getOwner();null==a.lca;){if(d==t){a.lca=d;break}if(d==this.rootGraph)break;if(null!=a.lca)throw"assert failed";a.targetInLca=d.getParent(),d=a.targetInLca.getOwner()}if(t==this.rootGraph)break;null==a.lca&&(a.sourceInLca=t.getParent(),t=a.sourceInLca.getOwner())}if(null==a.lca)throw"assert failed"}else a.lca=o.getOwner()},n.prototype.calcLowestCommonAncestor=function(a,o){if(a==o)return a.getOwner();for(var E=a.getOwner();null!=E;){for(var t=o.getOwner();null!=t;){if(t==E)return t;t=t.getParent().getOwner()}E=E.getParent().getOwner()}return E},n.prototype.calcInclusionTreeDepths=function(a,o){null==a&&null==o&&(a=this.rootGraph,o=1);for(var E,t=a.getNodes(),d=t.length,e=0;e<d;e++)(E=t[e]).inclusionTreeDepth=o,null!=E.child&&this.calcInclusionTreeDepths(E.child,o+1)},n.prototype.includesInvalidEdge=function(){for(var a,o=[],E=this.edges.length,t=0;t<E;t++)a=this.edges[t],this.isOneAncestorOfOther(a.source,a.target)&&o.push(a);for(t=0;t<o.length;t++)this.remove(o[t]);return!1},vt.exports=n},function(vt,Et,R){"use strict";var y=R(12);function s(){}s.calcSeparationAmount=function(n,a,o,E){if(!n.intersects(a))throw"assert failed";var t=new Array(2);this.decideDirectionsForOverlappingNodes(n,a,t),o[0]=Math.min(n.getRight(),a.getRight())-Math.max(n.x,a.x),o[1]=Math.min(n.getBottom(),a.getBottom())-Math.max(n.y,a.y),n.getX()<=a.getX()&&n.getRight()>=a.getRight()?o[0]+=Math.min(a.getX()-n.getX(),n.getRight()-a.getRight()):a.getX()<=n.getX()&&a.getRight()>=n.getRight()&&(o[0]+=Math.min(n.getX()-a.getX(),a.getRight()-n.getRight())),n.getY()<=a.getY()&&n.getBottom()>=a.getBottom()?o[1]+=Math.min(a.getY()-n.getY(),n.getBottom()-a.getBottom()):a.getY()<=n.getY()&&a.getBottom()>=n.getBottom()&&(o[1]+=Math.min(n.getY()-a.getY(),a.getBottom()-n.getBottom()));var d=Math.abs((a.getCenterY()-n.getCenterY())/(a.getCenterX()-n.getCenterX()));a.getCenterY()===n.getCenterY()&&a.getCenterX()===n.getCenterX()&&(d=1);var e=d*o[0],r=o[1]/d;o[0]<r?r=o[0]:e=o[1],o[0]=-1*t[0]*(r/2+E),o[1]=-1*t[1]*(e/2+E)},s.decideDirectionsForOverlappingNodes=function(n,a,o){n.getCenterX()<a.getCenterX()?o[0]=-1:o[0]=1,n.getCenterY()<a.getCenterY()?o[1]=-1:o[1]=1},s.getIntersection2=function(n,a,o){var E=n.getCenterX(),t=n.getCenterY(),d=a.getCenterX(),e=a.getCenterY();if(n.intersects(a))return o[0]=E,o[1]=t,o[2]=d,o[3]=e,!0;var r=n.getX(),l=n.getY(),g=n.getRight(),c=n.getX(),T=n.getBottom(),f=n.getRight(),A=n.getWidthHalf(),N=n.getHeightHalf(),L=a.getX(),D=a.getY(),et=a.getRight(),x=a.getX(),nt=a.getBottom(),dt=a.getRight(),ct=a.getWidthHalf(),mt=a.getHeightHalf(),b=!1,J=!1;if(E===d){if(t>e)return o[0]=E,o[1]=l,o[2]=d,o[3]=nt,!1;if(t<e)return o[0]=E,o[1]=T,o[2]=d,o[3]=D,!1}else if(t===e){if(E>d)return o[0]=r,o[1]=t,o[2]=et,o[3]=e,!1;if(E<d)return o[0]=g,o[1]=t,o[2]=L,o[3]=e,!1}else{var i=n.height/n.width,m=a.height/a.width,h=(e-t)/(d-E),u=void 0,p=void 0,I=void 0,w=void 0,X=void 0,Y=void 0;if(-i===h?E>d?(o[0]=c,o[1]=T,b=!0):(o[0]=g,o[1]=l,b=!0):i===h&&(E>d?(o[0]=r,o[1]=l,b=!0):(o[0]=f,o[1]=T,b=!0)),-m===h?d>E?(o[2]=x,o[3]=nt,J=!0):(o[2]=et,o[3]=D,J=!0):m===h&&(d>E?(o[2]=L,o[3]=D,J=!0):(o[2]=dt,o[3]=nt,J=!0)),b&&J)return!1;if(E>d?t>e?(u=this.getCardinalDirection(i,h,4),p=this.getCardinalDirection(m,h,2)):(u=this.getCardinalDirection(-i,h,3),p=this.getCardinalDirection(-m,h,1)):t>e?(u=this.getCardinalDirection(-i,h,1),p=this.getCardinalDirection(-m,h,3)):(u=this.getCardinalDirection(i,h,2),p=this.getCardinalDirection(m,h,4)),!b)switch(u){case 1:w=l,I=E+-N/h,o[0]=I,o[1]=w;break;case 2:I=f,w=t+A*h,o[0]=I,o[1]=w;break;case 3:w=T,I=E+N/h,o[0]=I,o[1]=w;break;case 4:I=c,w=t+-A*h,o[0]=I,o[1]=w}if(!J)switch(p){case 1:Y=D,X=d+-mt/h,o[2]=X,o[3]=Y;break;case 2:X=dt,Y=e+ct*h,o[2]=X,o[3]=Y;break;case 3:Y=nt,X=d+mt/h,o[2]=X,o[3]=Y;break;case 4:X=x,Y=e+-ct*h,o[2]=X,o[3]=Y}}return!1},s.getCardinalDirection=function(n,a,o){return n>a?o:1+o%4},s.getIntersection=function(n,a,o,E){if(null==E)return this.getIntersection2(n,a,o);var t=n.x,d=n.y,e=a.x,r=a.y,l=o.x,g=o.y,c=E.x,T=E.y,N=void 0,L=void 0,D=void 0,et=void 0,x=void 0,nt=void 0,dt=void 0;return x=e*d-t*r,nt=c*g-l*T,0==(dt=(N=r-d)*(et=l-c)-(L=T-g)*(D=t-e))?null:new y((D*nt-et*x)/dt,(L*x-N*nt)/dt)},s.angleOfVector=function(n,a,o,E){var t=void 0;return n!==o?(t=Math.atan((E-a)/(o-n)),o<n?t+=Math.PI:E<a&&(t+=this.TWO_PI)):t=E<a?this.ONE_AND_HALF_PI:this.HALF_PI,t},s.doIntersect=function(n,a,o,E){var t=n.x,d=n.y,e=a.x,r=a.y,l=o.x,g=o.y,c=E.x,T=E.y,f=(e-t)*(T-g)-(c-l)*(r-d);if(0===f)return!1;var A=((T-g)*(c-t)+(l-c)*(T-d))/f,N=((d-r)*(c-t)+(e-t)*(T-d))/f;return 0<A&&A<1&&0<N&&N<1},s.findCircleLineIntersections=function(n,a,o,E,t,d,e){var r=(o-n)*(o-n)+(E-a)*(E-a),l=2*((n-t)*(o-n)+(a-d)*(E-a)),g=(n-t)*(n-t)+(a-d)*(a-d)-e*e;if(l*l-4*r*g>=0){var T=(-l+Math.sqrt(l*l-4*r*g))/(2*r),f=(-l-Math.sqrt(l*l-4*r*g))/(2*r);return T>=0&&T<=1?[T]:f>=0&&f<=1?[f]:null}return null},s.HALF_PI=.5*Math.PI,s.ONE_AND_HALF_PI=1.5*Math.PI,s.TWO_PI=2*Math.PI,s.THREE_PI=3*Math.PI,vt.exports=s},function(vt,Et,R){"use strict";function y(){}y.sign=function(s){return s>0?1:s<0?-1:0},y.floor=function(s){return s<0?Math.ceil(s):Math.floor(s)},y.ceil=function(s){return s<0?Math.floor(s):Math.ceil(s)},vt.exports=y},function(vt,Et,R){"use strict";function y(){}y.MAX_VALUE=2147483647,y.MIN_VALUE=-2147483648,vt.exports=y},function(vt,Et,R){"use strict";var y=function(){function t(d,e){for(var r=0;r<e.length;r++){var l=e[r];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(d,l.key,l)}}return function(d,e,r){return e&&t(d.prototype,e),r&&t(d,r),d}}();function s(t,d){if(!(t instanceof d))throw new TypeError("Cannot call a class as a function")}var n=function(d){return{value:d,next:null,prev:null}},a=function(d,e,r,l){return null!==d?d.next=e:l.head=e,null!==r?r.prev=e:l.tail=e,e.prev=d,e.next=r,l.length++,e},o=function(d,e){var r=d.prev,l=d.next;return null!==r?r.next=l:e.head=l,null!==l?l.prev=r:e.tail=r,d.prev=d.next=null,e.length--,d},E=function(){function t(d){var e=this;s(this,t),this.length=0,this.head=null,this.tail=null,null!=d&&d.forEach(function(r){return e.push(r)})}return y(t,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(e,r){return a(r.prev,n(e),r,this)}},{key:"insertAfter",value:function(e,r){return a(r,n(e),r.next,this)}},{key:"insertNodeBefore",value:function(e,r){return a(r.prev,e,r,this)}},{key:"insertNodeAfter",value:function(e,r){return a(r,e,r.next,this)}},{key:"push",value:function(e){return a(this.tail,n(e),null,this)}},{key:"unshift",value:function(e){return a(null,n(e),this.head,this)}},{key:"remove",value:function(e){return o(e,this)}},{key:"pop",value:function(){return o(this.tail,this).value}},{key:"popNode",value:function(){return o(this.tail,this)}},{key:"shift",value:function(){return o(this.head,this).value}},{key:"shiftNode",value:function(){return o(this.head,this)}},{key:"get_object_at",value:function(e){if(e<=this.length()){for(var r=1,l=this.head;r<e;)l=l.next,r++;return l.value}}},{key:"set_object_at",value:function(e,r){if(e<=this.length()){for(var l=1,g=this.head;l<e;)g=g.next,l++;g.value=r}}}]),t}();vt.exports=E},function(vt,Et,R){"use strict";function y(s,n,a){this.x=null,this.y=null,null==s&&null==n&&null==a?(this.x=0,this.y=0):"number"==typeof s&&"number"==typeof n&&null==a?(this.x=s,this.y=n):"Point"==s.constructor.name&&null==n&&null==a&&(a=s,this.x=a.x,this.y=a.y)}y.prototype.getX=function(){return this.x},y.prototype.getY=function(){return this.y},y.prototype.getLocation=function(){return new y(this.x,this.y)},y.prototype.setLocation=function(s,n,a){"Point"==s.constructor.name&&null==n&&null==a?(a=s,this.setLocation(a.x,a.y)):"number"==typeof s&&"number"==typeof n&&null==a&&(parseInt(s)==s&&parseInt(n)==n?this.move(s,n):(this.x=Math.floor(s+.5),this.y=Math.floor(n+.5)))},y.prototype.move=function(s,n){this.x=s,this.y=n},y.prototype.translate=function(s,n){this.x+=s,this.y+=n},y.prototype.equals=function(s){if("Point"==s.constructor.name){var n=s;return this.x==n.x&&this.y==n.y}return this==s},y.prototype.toString=function(){return(new y).constructor.name+"[x="+this.x+",y="+this.y+"]"},vt.exports=y},function(vt,Et,R){"use strict";function y(s,n,a,o){this.x=0,this.y=0,this.width=0,this.height=0,null!=s&&null!=n&&null!=a&&null!=o&&(this.x=s,this.y=n,this.width=a,this.height=o)}y.prototype.getX=function(){return this.x},y.prototype.setX=function(s){this.x=s},y.prototype.getY=function(){return this.y},y.prototype.setY=function(s){this.y=s},y.prototype.getWidth=function(){return this.width},y.prototype.setWidth=function(s){this.width=s},y.prototype.getHeight=function(){return this.height},y.prototype.setHeight=function(s){this.height=s},y.prototype.getRight=function(){return this.x+this.width},y.prototype.getBottom=function(){return this.y+this.height},y.prototype.intersects=function(s){return!(this.getRight()<s.x||this.getBottom()<s.y||s.getRight()<this.x||s.getBottom()<this.y)},y.prototype.getCenterX=function(){return this.x+this.width/2},y.prototype.getMinX=function(){return this.getX()},y.prototype.getMaxX=function(){return this.getX()+this.width},y.prototype.getCenterY=function(){return this.y+this.height/2},y.prototype.getMinY=function(){return this.getY()},y.prototype.getMaxY=function(){return this.getY()+this.height},y.prototype.getWidthHalf=function(){return this.width/2},y.prototype.getHeightHalf=function(){return this.height/2},vt.exports=y},function(vt,Et,R){"use strict";var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};function s(){}s.lastID=0,s.createID=function(n){return s.isPrimitive(n)?n:(null!=n.uniqueID||(n.uniqueID=s.getString(),s.lastID++),n.uniqueID)},s.getString=function(n){return null==n&&(n=s.lastID),"Object#"+n},s.isPrimitive=function(n){var a=typeof n>"u"?"undefined":y(n);return null==n||"object"!=a&&"function"!=a},vt.exports=s},function(vt,Et,R){"use strict";function y(l){if(Array.isArray(l)){for(var g=0,c=Array(l.length);g<l.length;g++)c[g]=l[g];return c}return Array.from(l)}var s=R(0),n=R(7),a=R(3),o=R(1),E=R(6),t=R(5),d=R(17),e=R(29);function r(l){e.call(this),this.layoutQuality=s.QUALITY,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=s.DEFAULT_INCREMENTAL,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new n(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=l&&(this.isRemoteUse=l)}r.RANDOM_SEED=1,r.prototype=Object.create(e.prototype),r.prototype.getGraphManager=function(){return this.graphManager},r.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},r.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},r.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},r.prototype.newGraphManager=function(){var l=new n(this);return this.graphManager=l,l},r.prototype.newGraph=function(l){return new E(null,this.graphManager,l)},r.prototype.newNode=function(l){return new a(this.graphManager,l)},r.prototype.newEdge=function(l){return new o(null,null,l)},r.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},r.prototype.runLayout=function(){var l;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),l=!this.checkLayoutSuccess()&&this.layout(),"during"!==s.ANIMATE&&(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},r.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},r.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var g=this.graphManager.getAllEdges(),c=0;c<g.length;c++)g[c];var f=this.graphManager.getRoot().getNodes();for(c=0;c<f.length;c++)f[c];this.update(this.graphManager.getRoot())}},r.prototype.update=function(l){if(null==l)this.update2();else if(l instanceof a){var g=l;if(null!=g.getChild())for(var c=g.getChild().getNodes(),T=0;T<c.length;T++)update(c[T]);null!=g.vGraphObject&&g.vGraphObject.update(g)}else if(l instanceof o){var A=l;null!=A.vGraphObject&&A.vGraphObject.update(A)}else if(l instanceof E){var L=l;null!=L.vGraphObject&&L.vGraphObject.update(L)}},r.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=s.QUALITY,this.animationDuringLayout=s.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=s.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=s.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=s.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=s.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=s.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},r.prototype.transform=function(l){if(null==l)this.transform(new t(0,0));else{var g=new d,c=this.graphManager.getRoot().updateLeftTop();if(null!=c){g.setWorldOrgX(l.x),g.setWorldOrgY(l.y),g.setDeviceOrgX(c.x),g.setDeviceOrgY(c.y);for(var T=this.getAllNodes(),A=0;A<T.length;A++)T[A].transform(g)}}},r.prototype.positionNodesRandomly=function(l){if(null==l)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var g,c,T=l.getNodes(),f=0;f<T.length;f++)null==(c=(g=T[f]).getChild())||0==c.getNodes().length?g.scatter():(this.positionNodesRandomly(c),g.updateBounds())},r.prototype.getFlatForest=function(){for(var l=[],g=!0,c=this.graphManager.getRoot().getNodes(),T=!0,f=0;f<c.length;f++)null!=c[f].getChild()&&(T=!1);if(!T)return l;var A=new Set,N=[],L=new Map,D=[];for(D=D.concat(c);D.length>0&&g;){for(N.push(D[0]);N.length>0&&g;){var et=N[0];N.splice(0,1),A.add(et);var x=et.getEdges();for(f=0;f<x.length;f++){var nt=x[f].getOtherEnd(et);if(L.get(et)!=nt){if(A.has(nt)){g=!1;break}N.push(nt),L.set(nt,et)}}}if(g){var dt=[].concat(y(A));for(l.push(dt),f=0;f<dt.length;f++){var ct=dt[f],mt=D.indexOf(ct);mt>-1&&D.splice(mt,1)}A=new Set,L=new Map}else l=[]}return l},r.prototype.createDummyNodesForBendpoints=function(l){for(var g=[],c=l.source,T=this.graphManager.calcLowestCommonAncestor(l.source,l.target),f=0;f<l.bendpoints.length;f++){var A=this.newNode(null);A.setRect(new Point(0,0),new Dimension(1,1)),T.add(A);var N=this.newEdge(null);this.graphManager.add(N,c,A),g.add(A),c=A}return N=this.newEdge(null),this.graphManager.add(N,c,l.target),this.edgeToDummyNodes.set(l,g),l.isInterGraph()?this.graphManager.remove(l):T.remove(l),g},r.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(y(this.edgeToDummyNodes.keys())).concat(l);for(var g=0;g<l.length;g++){var c=l[g];if(c.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(c),f=0;f<T.length;f++){var A=T[f],N=new t(A.getCenterX(),A.getCenterY()),L=c.bendpoints.get(f);L.x=N.x,L.y=N.y,A.getOwner().remove(A)}this.graphManager.add(c,c.source,c.target)}}},r.transform=function(l,g,c,T){if(null!=c&&null!=T){var f=g;return l<=50?f-=(g-g/c)/50*(50-l):f+=(g*T-g)/50*(l-50),f}var L,D;return l<=50?(L=9*g/500,D=g/10):(L=9*g/50,D=-8*g),L*l+D},r.findCenterOfTree=function(l){var g=[];g=g.concat(l);var c=[],T=new Map,f=!1,A=null;(1==g.length||2==g.length)&&(f=!0,A=g[0]);for(var N=0;N<g.length;N++){var D=(L=g[N]).getNeighborsList().size;T.set(L,L.getNeighborsList().size),1==D&&c.push(L)}var et=[];for(et=et.concat(c);!f;){var x=[];for(x=x.concat(et),et=[],N=0;N<g.length;N++){var L=g[N],nt=g.indexOf(L);nt>=0&&g.splice(nt,1),L.getNeighborsList().forEach(function(b){if(c.indexOf(b)<0){var i=T.get(b)-1;1==i&&et.push(b),T.set(b,i)}})}c=c.concat(et),(1==g.length||2==g.length)&&(f=!0,A=g[0])}return A},r.prototype.setGraphManager=function(l){this.graphManager=l},vt.exports=r},function(vt,Et,R){"use strict";function y(){}y.seed=1,y.x=0,y.nextDouble=function(){return y.x=1e4*Math.sin(y.seed++),y.x-Math.floor(y.x)},vt.exports=y},function(vt,Et,R){"use strict";var y=R(5);function s(n,a){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}s.prototype.getWorldOrgX=function(){return this.lworldOrgX},s.prototype.setWorldOrgX=function(n){this.lworldOrgX=n},s.prototype.getWorldOrgY=function(){return this.lworldOrgY},s.prototype.setWorldOrgY=function(n){this.lworldOrgY=n},s.prototype.getWorldExtX=function(){return this.lworldExtX},s.prototype.setWorldExtX=function(n){this.lworldExtX=n},s.prototype.getWorldExtY=function(){return this.lworldExtY},s.prototype.setWorldExtY=function(n){this.lworldExtY=n},s.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},s.prototype.setDeviceOrgX=function(n){this.ldeviceOrgX=n},s.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},s.prototype.setDeviceOrgY=function(n){this.ldeviceOrgY=n},s.prototype.getDeviceExtX=function(){return this.ldeviceExtX},s.prototype.setDeviceExtX=function(n){this.ldeviceExtX=n},s.prototype.getDeviceExtY=function(){return this.ldeviceExtY},s.prototype.setDeviceExtY=function(n){this.ldeviceExtY=n},s.prototype.transformX=function(n){var a=0,o=this.lworldExtX;return 0!=o&&(a=this.ldeviceOrgX+(n-this.lworldOrgX)*this.ldeviceExtX/o),a},s.prototype.transformY=function(n){var a=0,o=this.lworldExtY;return 0!=o&&(a=this.ldeviceOrgY+(n-this.lworldOrgY)*this.ldeviceExtY/o),a},s.prototype.inverseTransformX=function(n){var a=0,o=this.ldeviceExtX;return 0!=o&&(a=this.lworldOrgX+(n-this.ldeviceOrgX)*this.lworldExtX/o),a},s.prototype.inverseTransformY=function(n){var a=0,o=this.ldeviceExtY;return 0!=o&&(a=this.lworldOrgY+(n-this.ldeviceOrgY)*this.lworldExtY/o),a},s.prototype.inverseTransformPoint=function(n){return new y(this.inverseTransformX(n.x),this.inverseTransformY(n.y))},vt.exports=s},function(vt,Et,R){"use strict";function y(e){if(Array.isArray(e)){for(var r=0,l=Array(e.length);r<e.length;r++)l[r]=e[r];return l}return Array.from(e)}var s=R(15),n=R(4),a=R(0),o=R(8),E=R(9);function t(){s.call(this),this.useSmartIdealEdgeLengthCalculation=n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=n.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=n.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=n.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=n.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=n.MAX_ITERATIONS}for(var d in t.prototype=Object.create(s.prototype),s)t[d]=s[d];t.prototype.initParameters=function(){s.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},t.prototype.calcIdealEdgeLengths=function(){for(var e,r,l,g,c,T,f,A=this.getGraphManager().getAllEdges(),N=0;N<A.length;N++)r=(e=A[N]).idealLength,e.isInterGraph&&(g=e.getSource(),c=e.getTarget(),T=e.getSourceInLca().getEstimatedSize(),f=e.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(e.idealLength+=T+f-2*a.SIMPLE_NODE_SIZE),l=e.getLca().getInclusionTreeDepth(),e.idealLength+=r*n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(g.getInclusionTreeDepth()+c.getInclusionTreeDepth()-2*l))},t.prototype.initSpringEmbedder=function(){var e=this.getAllNodes().length;this.incremental?(e>n.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*n.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(e-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-n.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT_INCREMENTAL):(e>n.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(n.COOLING_ADAPTATION_FACTOR,1-(e-n.ADAPTATION_LOWER_NODE_LIMIT)/(n.ADAPTATION_UPPER_NODE_LIMIT-n.ADAPTATION_LOWER_NODE_LIMIT)*(1-n.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=n.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.displacementThresholdPerNode=3*n.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},t.prototype.calcSpringForces=function(){for(var r,e=this.getAllEdges(),l=0;l<e.length;l++)r=e[l],this.calcSpringForce(r,r.idealLength)},t.prototype.calcRepulsionForces=function(){var l,g,c,T,A,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],f=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&e&&this.updateGrid(),A=new Set,l=0;l<f.length;l++)c=f[l],this.calculateRepulsionForceOfANode(c,A,e,r),A.add(c);else for(l=0;l<f.length;l++)for(c=f[l],g=l+1;g<f.length;g++)T=f[g],c.getOwner()==T.getOwner()&&this.calcRepulsionForce(c,T)},t.prototype.calcGravitationalForces=function(){for(var e,r=this.getAllNodesToApplyGravitation(),l=0;l<r.length;l++)e=r[l],this.calcGravitationalForce(e)},t.prototype.moveNodes=function(){for(var e=this.getAllNodes(),l=0;l<e.length;l++)e[l].move()},t.prototype.calcSpringForce=function(e,r){var c,T,f,A,l=e.getSource(),g=e.getTarget();if(this.uniformLeafNodeSizes&&null==l.getChild()&&null==g.getChild())e.updateLengthSimple();else if(e.updateLength(),e.isOverlapingSourceAndTarget)return;0!=(c=e.getLength())&&(f=(T=e.edgeElasticity*(c-r))*(e.lengthX/c),A=T*(e.lengthY/c),l.springForceX+=f,l.springForceY+=A,g.springForceX-=f,g.springForceY-=A)},t.prototype.calcRepulsionForce=function(e,r){var f,A,N,L,D,et,x,l=e.getRect(),g=r.getRect(),c=new Array(2),T=new Array(4);if(l.intersects(g)){o.calcSeparationAmount(l,g,c,n.DEFAULT_EDGE_LENGTH/2),et=2*c[0],x=2*c[1];var nt=e.noOfChildren*r.noOfChildren/(e.noOfChildren+r.noOfChildren);e.repulsionForceX-=nt*et,e.repulsionForceY-=nt*x,r.repulsionForceX+=nt*et,r.repulsionForceY+=nt*x}else this.uniformLeafNodeSizes&&null==e.getChild()&&null==r.getChild()?(f=g.getCenterX()-l.getCenterX(),A=g.getCenterY()-l.getCenterY()):(o.getIntersection(l,g,T),f=T[2]-T[0],A=T[3]-T[1]),Math.abs(f)<n.MIN_REPULSION_DIST&&(f=E.sign(f)*n.MIN_REPULSION_DIST),Math.abs(A)<n.MIN_REPULSION_DIST&&(A=E.sign(A)*n.MIN_REPULSION_DIST),N=f*f+A*A,L=Math.sqrt(N),et=(D=(e.nodeRepulsion/2+r.nodeRepulsion/2)*e.noOfChildren*r.noOfChildren/N)*f/L,x=D*A/L,e.repulsionForceX-=et,e.repulsionForceY-=x,r.repulsionForceX+=et,r.repulsionForceY+=x},t.prototype.calcGravitationalForce=function(e){var r,l,g,c,T,f,A,N;l=((r=e.getOwner()).getRight()+r.getLeft())/2,g=(r.getTop()+r.getBottom())/2,c=e.getCenterX()-l,T=e.getCenterY()-g,f=Math.abs(c)+e.getWidth()/2,A=Math.abs(T)+e.getHeight()/2,e.getOwner()==this.graphManager.getRoot()?(f>(N=r.getEstimatedSize()*this.gravityRangeFactor)||A>N)&&(e.gravitationForceX=-this.gravityConstant*c,e.gravitationForceY=-this.gravityConstant*T):(f>(N=r.getEstimatedSize()*this.compoundGravityRangeFactor)||A>N)&&(e.gravitationForceX=-this.gravityConstant*c*this.compoundGravityConstant,e.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant)},t.prototype.isConverged=function(){var e,r=!1;return this.totalIterations>this.maxIterations/3&&(r=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),e=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,e||r},t.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},t.prototype.calcNoOfChildrenForAllNodes=function(){for(var e,r=this.graphManager.getAllNodes(),l=0;l<r.length;l++)(e=r[l]).noOfChildren=e.getNoOfChildren()},t.prototype.calcGrid=function(e){var r=0,l=0;r=parseInt(Math.ceil((e.getRight()-e.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((e.getBottom()-e.getTop())/this.repulsionRange));for(var g=new Array(r),c=0;c<r;c++)g[c]=new Array(l);for(c=0;c<r;c++)for(var T=0;T<l;T++)g[c][T]=new Array;return g},t.prototype.addNodeToGrid=function(e,r,l){var g=0,c=0,T=0,f=0;g=parseInt(Math.floor((e.getRect().x-r)/this.repulsionRange)),c=parseInt(Math.floor((e.getRect().width+e.getRect().x-r)/this.repulsionRange)),T=parseInt(Math.floor((e.getRect().y-l)/this.repulsionRange)),f=parseInt(Math.floor((e.getRect().height+e.getRect().y-l)/this.repulsionRange));for(var A=g;A<=c;A++)for(var N=T;N<=f;N++)this.grid[A][N].push(e),e.setGridCoordinates(g,c,T,f)},t.prototype.updateGrid=function(){var e,r,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),e=0;e<l.length;e++)r=l[e],this.addNodeToGrid(r,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},t.prototype.calculateRepulsionForceOfANode=function(e,r,l,g){if(this.totalIterations%n.GRID_CALCULATION_CHECK_PERIOD==1&&l||g){var c=new Set;e.surrounding=new Array;for(var T,f=this.grid,A=e.startX-1;A<e.finishX+2;A++)for(var N=e.startY-1;N<e.finishY+2;N++)if(!(A<0||N<0||A>=f.length||N>=f[0].length))for(var L=0;L<f[A][N].length;L++)if(T=f[A][N][L],e.getOwner()==T.getOwner()&&e!=T&&!r.has(T)&&!c.has(T)){var D=Math.abs(e.getCenterX()-T.getCenterX())-(e.getWidth()/2+T.getWidth()/2),et=Math.abs(e.getCenterY()-T.getCenterY())-(e.getHeight()/2+T.getHeight()/2);D<=this.repulsionRange&&et<=this.repulsionRange&&c.add(T)}e.surrounding=[].concat(y(c))}for(A=0;A<e.surrounding.length;A++)this.calcRepulsionForce(e,e.surrounding[A])},t.prototype.calcRepulsionRange=function(){return 0},vt.exports=t},function(vt,Et,R){"use strict";var y=R(1),s=R(4);function n(o,E,t){y.call(this,o,E,t),this.idealLength=s.DEFAULT_EDGE_LENGTH,this.edgeElasticity=s.DEFAULT_SPRING_STRENGTH}for(var a in n.prototype=Object.create(y.prototype),y)n[a]=y[a];vt.exports=n},function(vt,Et,R){"use strict";var y=R(3),s=R(4);function n(o,E,t,d){y.call(this,o,E,t,d),this.nodeRepulsion=s.DEFAULT_REPULSION_STRENGTH,this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var a in n.prototype=Object.create(y.prototype),y)n[a]=y[a];n.prototype.setGridCoordinates=function(o,E,t,d){this.startX=o,this.finishX=E,this.startY=t,this.finishY=d},vt.exports=n},function(vt,Et,R){"use strict";function y(s,n){this.width=0,this.height=0,null!==s&&null!==n&&(this.height=n,this.width=s)}y.prototype.getWidth=function(){return this.width},y.prototype.setWidth=function(s){this.width=s},y.prototype.getHeight=function(){return this.height},y.prototype.setHeight=function(s){this.height=s},vt.exports=y},function(vt,Et,R){"use strict";var y=R(14);function s(){this.map={},this.keys=[]}s.prototype.put=function(n,a){var o=y.createID(n);this.contains(o)||(this.map[o]=a,this.keys.push(n))},s.prototype.contains=function(n){return y.createID(n),null!=this.map[n]},s.prototype.get=function(n){var a=y.createID(n);return this.map[a]},s.prototype.keySet=function(){return this.keys},vt.exports=s},function(vt,Et,R){"use strict";var y=R(14);function s(){this.set={}}s.prototype.add=function(n){var a=y.createID(n);this.contains(a)||(this.set[a]=n)},s.prototype.remove=function(n){delete this.set[y.createID(n)]},s.prototype.clear=function(){this.set={}},s.prototype.contains=function(n){return this.set[y.createID(n)]==n},s.prototype.isEmpty=function(){return 0===this.size()},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAllTo=function(n){for(var a=Object.keys(this.set),o=a.length,E=0;E<o;E++)n.push(this.set[a[E]])},s.prototype.size=function(){return Object.keys(this.set).length},s.prototype.addAll=function(n){for(var a=n.length,o=0;o<a;o++){var E=n[o];this.add(E)}},vt.exports=s},function(vt,Et,R){"use strict";function y(){}y.multMat=function(s,n){for(var a=[],o=0;o<s.length;o++){a[o]=[];for(var E=0;E<n[0].length;E++){a[o][E]=0;for(var t=0;t<s[0].length;t++)a[o][E]+=s[o][t]*n[t][E]}}return a},y.transpose=function(s){for(var n=[],a=0;a<s[0].length;a++){n[a]=[];for(var o=0;o<s.length;o++)n[a][o]=s[o][a]}return n},y.multCons=function(s,n){for(var a=[],o=0;o<s.length;o++)a[o]=s[o]*n;return a},y.minusOp=function(s,n){for(var a=[],o=0;o<s.length;o++)a[o]=s[o]-n[o];return a},y.dotProduct=function(s,n){for(var a=0,o=0;o<s.length;o++)a+=s[o]*n[o];return a},y.mag=function(s){return Math.sqrt(this.dotProduct(s,s))},y.normalize=function(s){for(var n=[],a=this.mag(s),o=0;o<s.length;o++)n[o]=s[o]/a;return n},y.multGamma=function(s){for(var n=[],a=0,o=0;o<s.length;o++)a+=s[o];a*=-1/s.length;for(var E=0;E<s.length;E++)n[E]=a+s[E];return n},y.multL=function(s,n,a){for(var o=[],E=[],t=[],d=0;d<n[0].length;d++){for(var e=0,r=0;r<n.length;r++)e+=-.5*n[r][d]*s[r];E[d]=e}for(var l=0;l<a.length;l++){for(var g=0,c=0;c<a.length;c++)g+=a[l][c]*E[c];t[l]=g}for(var T=0;T<n.length;T++){for(var f=0,A=0;A<n[0].length;A++)f+=n[T][A]*t[A];o[T]=f}return o},vt.exports=y},function(vt,Et,R){"use strict";var y=function(){function o(E,t){for(var d=0;d<t.length;d++){var e=t[d];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(E,e.key,e)}}return function(E,t,d){return t&&o(E.prototype,t),d&&o(E,d),E}}();function s(o,E){if(!(o instanceof E))throw new TypeError("Cannot call a class as a function")}var n=R(11),a=function(){function o(E,t){s(this,o),(null!==t||void 0!==t)&&(this.compareFunction=this._defaultCompareFunction);var d=void 0;d=E instanceof n?E.size():E.length,this._quicksort(E,0,d-1)}return y(o,[{key:"_quicksort",value:function(t,d,e){if(d<e){var r=this._partition(t,d,e);this._quicksort(t,d,r),this._quicksort(t,r+1,e)}}},{key:"_partition",value:function(t,d,e){for(var r=this._get(t,d),l=d,g=e;;){for(;this.compareFunction(r,this._get(t,g));)g--;for(;this.compareFunction(this._get(t,l),r);)l++;if(!(l<g))return g;this._swap(t,l,g),l++,g--}}},{key:"_get",value:function(t,d){return t instanceof n?t.get_object_at(d):t[d]}},{key:"_set",value:function(t,d,e){t instanceof n?t.set_object_at(d,e):t[d]=e}},{key:"_swap",value:function(t,d,e){var r=this._get(t,d);this._set(t,d,this._get(t,e)),this._set(t,e,r)}},{key:"_defaultCompareFunction",value:function(t,d){return d>t}}]),o}();vt.exports=a},function(vt,Et,R){"use strict";function y(){}y.svd=function(s){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=s.length,this.n=s[0].length;var n=Math.min(this.m,this.n);this.s=function(pt){for(var yt=[];pt-- >0;)yt.push(0);return yt}(Math.min(this.m+1,this.n)),this.U=function It(Nt){if(0==Nt.length)return 0;for(var St=[],wt=0;wt<Nt[0];wt++)St.push(It(Nt.slice(1)));return St}([this.m,n]),this.V=function(pt){return function It(Nt){if(0==Nt.length)return 0;for(var St=[],wt=0;wt<Nt[0];wt++)St.push(It(Nt.slice(1)));return St}(pt)}([this.n,this.n]);for(var a=function(pt){for(var yt=[];pt-- >0;)yt.push(0);return yt}(this.n),o=function(pt){for(var yt=[];pt-- >0;)yt.push(0);return yt}(this.m),E=!0,t=!0,d=Math.min(this.m-1,this.n),e=Math.max(0,Math.min(this.n-2,this.m)),r=0;r<Math.max(d,e);r++){if(r<d){this.s[r]=0;for(var l=r;l<this.m;l++)this.s[r]=y.hypot(this.s[r],s[l][r]);if(0!==this.s[r]){s[r][r]<0&&(this.s[r]=-this.s[r]);for(var g=r;g<this.m;g++)s[g][r]/=this.s[r];s[r][r]+=1}this.s[r]=-this.s[r]}for(var c=r+1;c<this.n;c++){if(function(pt,yt){return pt&&yt}(r<d,0!==this.s[r])){for(var T=0,f=r;f<this.m;f++)T+=s[f][r]*s[f][c];T=-T/s[r][r];for(var A=r;A<this.m;A++)s[A][c]+=T*s[A][r]}a[c]=s[r][c]}if(function(pt,yt){return pt&&yt}(E,r<d))for(var N=r;N<this.m;N++)this.U[N][r]=s[N][r];if(r<e){a[r]=0;for(var L=r+1;L<this.n;L++)a[r]=y.hypot(a[r],a[L]);if(0!==a[r]){a[r+1]<0&&(a[r]=-a[r]);for(var D=r+1;D<this.n;D++)a[D]/=a[r];a[r+1]+=1}if(a[r]=-a[r],function(pt,yt){return pt&&yt}(r+1<this.m,0!==a[r])){for(var et=r+1;et<this.m;et++)o[et]=0;for(var x=r+1;x<this.n;x++)for(var nt=r+1;nt<this.m;nt++)o[nt]+=a[x]*s[nt][x];for(var dt=r+1;dt<this.n;dt++)for(var ct=-a[dt]/a[r+1],mt=r+1;mt<this.m;mt++)s[mt][dt]+=ct*o[mt]}if(t)for(var b=r+1;b<this.n;b++)this.V[b][r]=a[b]}}var J=Math.min(this.n,this.m+1);if(d<this.n&&(this.s[d]=s[d][d]),this.m<J&&(this.s[J-1]=0),e+1<J&&(a[e]=s[e][J-1]),a[J-1]=0,E){for(var i=d;i<n;i++){for(var m=0;m<this.m;m++)this.U[m][i]=0;this.U[i][i]=1}for(var h=d-1;h>=0;h--)if(0!==this.s[h]){for(var u=h+1;u<n;u++){for(var p=0,I=h;I<this.m;I++)p+=this.U[I][h]*this.U[I][u];p=-p/this.U[h][h];for(var w=h;w<this.m;w++)this.U[w][u]+=p*this.U[w][h]}for(var X=h;X<this.m;X++)this.U[X][h]=-this.U[X][h];this.U[h][h]=1+this.U[h][h];for(var Y=0;Y<h-1;Y++)this.U[Y][h]=0}else{for(var P=0;P<this.m;P++)this.U[P][h]=0;this.U[h][h]=1}}if(t)for(var _=this.n-1;_>=0;_--){if(function(pt,yt){return pt&&yt}(_<e,0!==a[_]))for(var lt=_+1;lt<n;lt++){for(var H=0,ht=_+1;ht<this.n;ht++)H+=this.V[ht][_]*this.V[ht][lt];H=-H/this.V[_+1][_];for(var tt=_+1;tt<this.n;tt++)this.V[tt][lt]+=H*this.V[tt][_]}for(var O=0;O<this.n;O++)this.V[O][_]=0;this.V[_][_]=1}for(var z=J-1,st=Math.pow(2,-52),ft=Math.pow(2,-966);J>0;){var it=void 0,Pt=void 0;for(it=J-2;it>=-1&&-1!==it;it--)if(Math.abs(a[it])<=ft+st*(Math.abs(this.s[it])+Math.abs(this.s[it+1]))){a[it]=0;break}if(it===J-2)Pt=4;else{var Lt=void 0;for(Lt=J-1;Lt>=it&&Lt!==it;Lt--){var Kt=(Lt!==J?Math.abs(a[Lt]):0)+(Lt!==it+1?Math.abs(a[Lt-1]):0);if(Math.abs(this.s[Lt])<=ft+st*Kt){this.s[Lt]=0;break}}Lt===it?Pt=3:Lt===J-1?Pt=1:(Pt=2,it=Lt)}switch(it++,Pt){case 1:var Ut=a[J-2];a[J-2]=0;for(var ut=J-2;ut>=it;ut--){var gt=y.hypot(this.s[ut],Ut),xt=this.s[ut]/gt,Dt=Ut/gt;if(this.s[ut]=gt,ut!==it&&(Ut=-Dt*a[ut-1],a[ut-1]=xt*a[ut-1]),t)for(var Mt=0;Mt<this.n;Mt++)gt=xt*this.V[Mt][ut]+Dt*this.V[Mt][J-1],this.V[Mt][J-1]=-Dt*this.V[Mt][ut]+xt*this.V[Mt][J-1],this.V[Mt][ut]=gt}break;case 2:var Ct=a[it-1];a[it-1]=0;for(var At=it;At<J;At++){var Rt=y.hypot(this.s[At],Ct),Ht=this.s[At]/Rt,Qt=Ct/Rt;if(this.s[At]=Rt,Ct=-Qt*a[At],a[At]=Ht*a[At],E)for(var bt=0;bt<this.m;bt++)Rt=Ht*this.U[bt][At]+Qt*this.U[bt][it-1],this.U[bt][it-1]=-Qt*this.U[bt][At]+Ht*this.U[bt][it-1],this.U[bt][At]=Rt}break;case 3:var Yt=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[J-1]),Math.abs(this.s[J-2])),Math.abs(a[J-2])),Math.abs(this.s[it])),Math.abs(a[it])),Xt=this.s[J-1]/Yt,V=this.s[J-2]/Yt,Q=a[J-2]/Yt,q=this.s[it]/Yt,v=a[it]/Yt,M=((V+Xt)*(V-Xt)+Q*Q)/2,C=Xt*Q*(Xt*Q),k=0;(function(pt,yt){return pt||yt})(0!==M,0!==C)&&(k=Math.sqrt(M*M+C),M<0&&(k=-k),k=C/(M+k));for(var G=(q+Xt)*(q-Xt)+k,S=q*v,F=it;F<J-1;F++){var $=y.hypot(G,S),ot=G/$,U=S/$;if(F!==it&&(a[F-1]=$),G=ot*this.s[F]+U*a[F],a[F]=ot*a[F]-U*this.s[F],S=U*this.s[F+1],this.s[F+1]=ot*this.s[F+1],t)for(var at=0;at<this.n;at++)$=ot*this.V[at][F]+U*this.V[at][F+1],this.V[at][F+1]=-U*this.V[at][F]+ot*this.V[at][F+1],this.V[at][F]=$;if(ot=G/($=y.hypot(G,S)),U=S/$,this.s[F]=$,G=ot*a[F]+U*this.s[F+1],this.s[F+1]=-U*a[F]+ot*this.s[F+1],S=U*a[F+1],a[F+1]=ot*a[F+1],E&&F<this.m-1)for(var W=0;W<this.m;W++)$=ot*this.U[W][F]+U*this.U[W][F+1],this.U[W][F+1]=-U*this.U[W][F]+ot*this.U[W][F+1],this.U[W][F]=$}a[J-2]=G;break;case 4:if(this.s[it]<=0&&(this.s[it]=this.s[it]<0?-this.s[it]:0,t))for(var K=0;K<=z;K++)this.V[K][it]=-this.V[K][it];for(;it<z&&!(this.s[it]>=this.s[it+1]);){var rt=this.s[it];if(this.s[it]=this.s[it+1],this.s[it+1]=rt,t&&it<this.n-1)for(var B=0;B<this.n;B++)rt=this.V[B][it+1],this.V[B][it+1]=this.V[B][it],this.V[B][it]=rt;if(E&&it<this.m-1)for(var j=0;j<this.m;j++)rt=this.U[j][it+1],this.U[j][it+1]=this.U[j][it],this.U[j][it]=rt;it++}J--}}return{U:this.U,V:this.V,S:this.s}},y.hypot=function(s,n){var a=void 0;return Math.abs(s)>Math.abs(n)?(a=n/s,a=Math.abs(s)*Math.sqrt(1+a*a)):0!=n?(a=s/n,a=Math.abs(n)*Math.sqrt(1+a*a)):a=0,a},vt.exports=y},function(vt,Et,R){"use strict";var y=function(){function a(o,E){for(var t=0;t<E.length;t++){var d=E[t];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(o,d.key,d)}}return function(o,E,t){return E&&a(o.prototype,E),t&&a(o,t),o}}();function s(a,o){if(!(a instanceof o))throw new TypeError("Cannot call a class as a function")}var n=function(){function a(o,E){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;s(this,a),this.sequence1=o,this.sequence2=E,this.match_score=t,this.mismatch_penalty=d,this.gap_penalty=e,this.iMax=o.length+1,this.jMax=E.length+1,this.grid=new Array(this.iMax);for(var r=0;r<this.iMax;r++){this.grid[r]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[r][l]=0}this.tracebackGrid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.tracebackGrid[g]=new Array(this.jMax);for(var c=0;c<this.jMax;c++)this.tracebackGrid[g][c]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return y(a,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var E=1;E<this.jMax;E++)this.grid[0][E]=this.grid[0][E-1]+this.gap_penalty,this.tracebackGrid[0][E]=[!1,!1,!0];for(var t=1;t<this.iMax;t++)this.grid[t][0]=this.grid[t-1][0]+this.gap_penalty,this.tracebackGrid[t][0]=[!1,!0,!1];for(var d=1;d<this.iMax;d++)for(var e=1;e<this.jMax;e++){var c=[this.sequence1[d-1]===this.sequence2[e-1]?this.grid[d-1][e-1]+this.match_score:this.grid[d-1][e-1]+this.mismatch_penalty,this.grid[d-1][e]+this.gap_penalty,this.grid[d][e-1]+this.gap_penalty],T=this.arrayAllMaxIndexes(c);this.grid[d][e]=c[T[0]],this.tracebackGrid[d][e]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var E=[];for(E.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});E[0];){var t=E[0],d=this.tracebackGrid[t.pos[0]][t.pos[1]];d[0]&&E.push({pos:[t.pos[0]-1,t.pos[1]-1],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),d[1]&&E.push({pos:[t.pos[0]-1,t.pos[1]],seq1:this.sequence1[t.pos[0]-1]+t.seq1,seq2:"-"+t.seq2}),d[2]&&E.push({pos:[t.pos[0],t.pos[1]-1],seq1:"-"+t.seq1,seq2:this.sequence2[t.pos[1]-1]+t.seq2}),0===t.pos[0]&&0===t.pos[1]&&this.alignments.push({sequence1:t.seq1,sequence2:t.seq2}),E.shift()}return this.alignments}},{key:"getAllIndexes",value:function(E,t){for(var d=[],e=-1;-1!==(e=E.indexOf(t,e+1));)d.push(e);return d}},{key:"arrayAllMaxIndexes",value:function(E){return this.getAllIndexes(E,Math.max.apply(null,E))}}]),a}();vt.exports=n},function(vt,Et,R){"use strict";var y=function(){};y.FDLayout=R(18),y.FDLayoutConstants=R(4),y.FDLayoutEdge=R(19),y.FDLayoutNode=R(20),y.DimensionD=R(21),y.HashMap=R(22),y.HashSet=R(23),y.IGeometry=R(8),y.IMath=R(9),y.Integer=R(10),y.Point=R(12),y.PointD=R(5),y.RandomSeed=R(16),y.RectangleD=R(13),y.Transform=R(17),y.UniqueIDGeneretor=R(14),y.Quicksort=R(25),y.LinkedList=R(11),y.LGraphObject=R(2),y.LGraph=R(6),y.LEdge=R(1),y.LGraphManager=R(7),y.LNode=R(3),y.Layout=R(15),y.LayoutConstants=R(0),y.NeedlemanWunsch=R(27),y.Matrix=R(24),y.SVD=R(26),vt.exports=y},function(vt,Et,R){"use strict";function y(){this.listeners=[]}var s=y.prototype;s.addListener=function(n,a){this.listeners.push({event:n,callback:a})},s.removeListener=function(n,a){for(var o=this.listeners.length;o>=0;o--){var E=this.listeners[o];E.event===n&&E.callback===a&&this.listeners.splice(o,1)}},s.emit=function(n,a){for(var o=0;o<this.listeners.length;o++){var E=this.listeners[o];n===E.event&&E.callback(a)}},vt.exports=y}])},58257:(ee,vt,Et)=>{"use strict";Et.r(vt),Et.d(vt,{diagram:()=>q});var R=Et(53420),y=Et(77437),s=Et(50027),n=Et(23854),a=Et(91035),E=(Et(62477),Et(39624)),t=Et(3685),d=Et(32928),e=Et(90574),r=Et(10795),l=Et(31083),g={L:"left",R:"right",T:"top",B:"bottom"},c={L:(0,t.eW)(v=>`${v},${v/2} 0,${v} 0,0`,"L"),R:(0,t.eW)(v=>`0,${v/2} ${v},0 ${v},${v}`,"R"),T:(0,t.eW)(v=>`0,0 ${v},0 ${v/2},${v}`,"T"),B:(0,t.eW)(v=>`${v/2},0 ${v},${v} 0,${v}`,"B")},T={L:(0,t.eW)((v,M)=>v-M+2,"L"),R:(0,t.eW)((v,M)=>v-2,"R"),T:(0,t.eW)((v,M)=>v-M+2,"T"),B:(0,t.eW)((v,M)=>v-2,"B")},f=(0,t.eW)(function(v){return N(v)?"L"===v?"R":"L":"T"===v?"B":"T"},"getOppositeArchitectureDirection"),A=(0,t.eW)(function(v){return"L"===v||"R"===v||"T"===v||"B"===v},"isArchitectureDirection"),N=(0,t.eW)(function(v){return"L"===v||"R"===v},"isArchitectureDirectionX"),L=(0,t.eW)(function(v){return"T"===v||"B"===v},"isArchitectureDirectionY"),D=(0,t.eW)(function(v,M){const C=N(v)&&L(M),k=L(v)&&N(M);return C||k},"isArchitectureDirectionXY"),et=(0,t.eW)(function(v){const M=v[0],C=v[1],k=N(M)&&L(C),G=L(M)&&N(C);return k||G},"isArchitecturePairXY"),x=(0,t.eW)(function(v){return"LL"!==v&&"RR"!==v&&"TT"!==v&&"BB"!==v},"isValidArchitectureDirectionPair"),nt=(0,t.eW)(function(v,M){const C=`${v}${M}`;return x(C)?C:void 0},"getArchitectureDirectionPair"),dt=(0,t.eW)(function([v,M],C){const k=C[0],G=C[1];return N(k)?L(G)?[v+("L"===k?-1:1),M+("T"===G?1:-1)]:[v+("L"===k?-1:1),M]:N(G)?[v+("L"===G?1:-1),M+("T"===k?1:-1)]:[v,M+("T"===k?1:-1)]},"shiftPositionByArchitectureDirectionPair"),ct=(0,t.eW)(function(v){return"LT"===v||"TL"===v?[1,1]:"BL"===v||"LB"===v?[1,-1]:"BR"===v||"RB"===v?[-1,-1]:[-1,1]},"getArchitectureDirectionXYFactors"),mt=(0,t.eW)(function(v,M){return D(v,M)?"bend":N(v)?"horizontal":"vertical"},"getArchitectureDirectionAlignment"),b=(0,t.eW)(function(v){return"service"===v.type},"isArchitectureService"),J=(0,t.eW)(function(v){return"junction"===v.type},"isArchitectureJunction"),i=(0,t.eW)(v=>v.data(),"edgeData"),m=(0,t.eW)(v=>v.data(),"nodeData"),h=t.vZ.architecture,u=new a.A(()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:h,dataStructures:void 0,elements:{}})),p=(0,t.eW)(()=>{u.reset(),(0,t.ZH)()},"clear"),I=(0,t.eW)(function({id:v,icon:M,in:C,title:k,iconText:G}){if(void 0!==u.records.registeredIds[v])throw new Error(`The service id [${v}] is already in use by another ${u.records.registeredIds[v]}`);if(void 0!==C){if(v===C)throw new Error(`The service [${v}] cannot be placed within itself`);if(void 0===u.records.registeredIds[C])throw new Error(`The service [${v}]'s parent does not exist. Please make sure the parent is created before this service`);if("node"===u.records.registeredIds[C])throw new Error(`The service [${v}]'s parent is not a group`)}u.records.registeredIds[v]="node",u.records.nodes[v]={id:v,type:"service",icon:M,iconText:G,title:k,edges:[],in:C}},"addService"),w=(0,t.eW)(()=>Object.values(u.records.nodes).filter(b),"getServices"),X=(0,t.eW)(function({id:v,in:M}){u.records.registeredIds[v]="node",u.records.nodes[v]={id:v,type:"junction",edges:[],in:M}},"addJunction"),Y=(0,t.eW)(()=>Object.values(u.records.nodes).filter(J),"getJunctions"),P=(0,t.eW)(()=>Object.values(u.records.nodes),"getNodes"),_=(0,t.eW)(v=>u.records.nodes[v],"getNode"),lt=(0,t.eW)(function({id:v,icon:M,in:C,title:k}){if(void 0!==u.records.registeredIds[v])throw new Error(`The group id [${v}] is already in use by another ${u.records.registeredIds[v]}`);if(void 0!==C){if(v===C)throw new Error(`The group [${v}] cannot be placed within itself`);if(void 0===u.records.registeredIds[C])throw new Error(`The group [${v}]'s parent does not exist. Please make sure the parent is created before this group`);if("node"===u.records.registeredIds[C])throw new Error(`The group [${v}]'s parent is not a group`)}u.records.registeredIds[v]="group",u.records.groups[v]={id:v,icon:M,title:k,in:C}},"addGroup"),H=(0,t.eW)(()=>Object.values(u.records.groups),"getGroups"),ht=(0,t.eW)(function({lhsId:v,rhsId:M,lhsDir:C,rhsDir:k,lhsInto:G,rhsInto:S,lhsGroup:F,rhsGroup:$,title:ot}){if(!A(C))throw new Error(`Invalid direction given for left hand side of edge ${v}--${M}. Expected (L,R,T,B) got ${C}`);if(!A(k))throw new Error(`Invalid direction given for right hand side of edge ${v}--${M}. Expected (L,R,T,B) got ${k}`);if(void 0===u.records.nodes[v]&&void 0===u.records.groups[v])throw new Error(`The left-hand id [${v}] does not yet exist. Please create the service/group before declaring an edge to it.`);if(void 0===u.records.nodes[M]&&void 0===u.records.groups[v])throw new Error(`The right-hand id [${M}] does not yet exist. Please create the service/group before declaring an edge to it.`);const U=u.records.nodes[v].in,at=u.records.nodes[M].in;if(F&&U&&at&&U==at)throw new Error(`The left-hand id [${v}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);if($&&U&&at&&U==at)throw new Error(`The right-hand id [${M}] is modified to traverse the group boundary, but the edge does not pass through two groups.`);const W={lhsId:v,lhsDir:C,lhsInto:G,lhsGroup:F,rhsId:M,rhsDir:k,rhsInto:S,rhsGroup:$,title:ot};u.records.edges.push(W),u.records.nodes[v]&&u.records.nodes[M]&&(u.records.nodes[v].edges.push(u.records.edges[u.records.edges.length-1]),u.records.nodes[M].edges.push(u.records.edges[u.records.edges.length-1]))},"addEdge"),tt=(0,t.eW)(()=>u.records.edges,"getEdges"),O=(0,t.eW)(()=>{if(void 0===u.records.dataStructures){const v={},M=Object.entries(u.records.nodes).reduce(($,[ot,U])=>($[ot]=U.edges.reduce((at,W)=>{const K=_(W.lhsId)?.in,rt=_(W.rhsId)?.in;if(K&&rt&&K!==rt){const B=mt(W.lhsDir,W.rhsDir);"bend"!==B&&(v[K]??={},v[K][rt]=B,v[rt]??={},v[rt][K]=B)}if(W.lhsId===ot){const B=nt(W.lhsDir,W.rhsDir);B&&(at[B]=W.rhsId)}else{const B=nt(W.rhsDir,W.lhsDir);B&&(at[B]=W.lhsId)}return at},{}),$),{}),C=Object.keys(M)[0],k={[C]:1},G=Object.keys(M).reduce(($,ot)=>ot===C?$:{...$,[ot]:1},{}),S=(0,t.eW)($=>{const ot={[$]:[0,0]},U=[$];for(;U.length>0;){const at=U.shift();if(at){k[at]=1,delete G[at];const W=M[at],[K,rt]=ot[at];Object.entries(W).forEach(([B,j])=>{k[j]||(ot[j]=dt([K,rt],B),U.push(j))})}}return ot},"BFS"),F=[S(C)];for(;Object.keys(G).length>0;)F.push(S(Object.keys(G)[0]));u.records.dataStructures={adjList:M,spatialMaps:F,groupAlignments:v}}return u.records.dataStructures},"getDataStructures"),z=(0,t.eW)((v,M)=>{u.records.elements[v]=M},"setElementForId"),Z=(0,t.eW)(v=>u.records.elements[v],"getElementById"),st={clear:p,setDiagramTitle:t.g2,getDiagramTitle:t.Kr,setAccTitle:t.GN,getAccTitle:t.eu,setAccDescription:t.U$,getAccDescription:t.Mx,addService:I,getServices:w,addJunction:X,getJunctions:Y,getNodes:P,getNode:_,addGroup:lt,getGroups:H,addEdge:ht,getEdges:tt,setElementForId:z,getElementById:Z,getDataStructures:O};function ft(v){const M=(0,t.nV)().architecture;return M?.[v]?M[v]:h[v]}(0,t.eW)(ft,"getConfigField");var it=(0,t.eW)((v,M)=>{(0,n.A)(v,M),v.groups.map(M.addGroup),v.services.map(C=>M.addService({...C,type:"service"})),v.junctions.map(C=>M.addJunction({...C,type:"junction"})),v.edges.map(M.addEdge)},"populateDb"),Pt={parse:(0,t.eW)(function(){var v=(0,R.Z)(function*(M){const C=yield(0,d.Qc)("architecture",M);t.cM.debug(C),it(C,st)});return function(M){return v.apply(this,arguments)}}(),"parse")},Kt=(0,t.eW)(v=>`\n .edge {\n stroke-width: ${v.archEdgeWidth};\n stroke: ${v.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${v.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${v.archGroupBorderColor};\n stroke-width: ${v.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`,"getStyles"),Ut=(0,t.eW)(v=>`<g><rect width="80" height="80" style="fill: #087ebf; stroke-width: 0px;"/>${v}</g>`,"wrapIcon"),ut={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:Ut('<path id="b" data-name="4" d="m20,57.86c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="c" data-name="3" d="m20,45.95c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path id="d" data-name="2" d="m20,34.05c0,3.94,8.95,7.14,20,7.14s20-3.2,20-7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse id="e" data-name="1" cx="40" cy="22.14" rx="20" ry="7.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="20" y1="57.86" x2="20" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="60" y1="57.86" x2="60" y2="22.14" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},server:{body:Ut('<rect x="17.5" y="17.5" width="45" height="45" rx="2" ry="2" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="32.5" x2="62.5" y2="32.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="47.5" x2="62.5" y2="47.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><g><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,25c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,40c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: #fff; stroke-width: 0px;"/><path d="m56.25,55c0,.27-.45.5-1,.5h-10.5c-.55,0-1-.23-1-.5s.45-.5,1-.5h10.5c.55,0,1,.23,1,.5Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="25" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="40" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g><g><circle cx="32.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="27.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/><circle cx="22.5" cy="55" r=".75" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10;"/></g>')},disk:{body:Ut('<rect x="20" y="15" width="40" height="50" rx="1" ry="1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="19.17" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="24" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="56" cy="60.83" rx=".8" ry=".83" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="14" ry="14.58" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><ellipse cx="40" cy="33.75" rx="4" ry="4.17" style="fill: #fff; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m37.51,42.52l-4.83,13.22c-.26.71-1.1,1.02-1.76.64l-4.18-2.42c-.66-.38-.81-1.26-.33-1.84l9.01-10.8c.88-1.05,2.56-.08,2.09,1.2Z" style="fill: #fff; stroke-width: 0px;"/>')},internet:{body:Ut('<circle cx="40" cy="40" r="22.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="40" y1="17.5" x2="40" y2="62.5" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="17.5" y1="40" x2="62.5" y2="40" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m39.99,17.51c-15.28,11.1-15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><path d="m40.01,17.51c15.28,11.1,15.28,33.88,0,44.98" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="30.1" x2="60.25" y2="30.1" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/><line x1="19.75" y1="49.9" x2="60.25" y2="49.9" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},cloud:{body:Ut('<path d="m65,47.5c0,2.76-2.24,5-5,5H20c-2.76,0-5-2.24-5-5,0-1.87,1.03-3.51,2.56-4.36-.04-.21-.06-.42-.06-.64,0-2.6,2.48-4.74,5.65-4.97,1.65-4.51,6.34-7.76,11.85-7.76.86,0,1.69.08,2.5.23,2.09-1.57,4.69-2.5,7.5-2.5,6.1,0,11.19,4.38,12.28,10.17,2.14.56,3.72,2.51,3.72,4.83,0,.03,0,.07-.01.1,2.29.46,4.01,2.48,4.01,4.9Z" style="fill: none; stroke: #fff; stroke-miterlimit: 10; stroke-width: 2px;"/>')},unknown:y.cN,blank:{body:Ut("")}}},gt=(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C){const k=ft("padding"),G=ft("iconSize"),S=G/2,F=G/6,$=F/2;yield Promise.all(C.edges().map(function(){var ot=(0,R.Z)(function*(U){const{source:at,sourceDir:W,sourceArrow:K,sourceGroup:rt,target:B,targetDir:j,targetArrow:Ot,targetGroup:pt,label:yt}=i(U);let{x:It,y:Nt}=U[0].sourceEndpoint();const{x:St,y:wt}=U[0].midpoint();let{x:Gt,y:zt}=U[0].targetEndpoint();const Wt=k+4;if(rt&&(N(W)?It+="L"===W?-Wt:Wt:Nt+="T"===W?-Wt:Wt+18),pt&&(N(j)?Gt+="L"===j?-Wt:Wt:zt+="T"===j?-Wt:Wt+18),!rt&&"junction"===st.getNode(at)?.type&&(N(W)?It+="L"===W?S:-S:Nt+="T"===W?S:-S),!pt&&"junction"===st.getNode(B)?.type&&(N(j)?Gt+="L"===j?S:-S:zt+="T"===j?S:-S),U[0]._private.rscratch){const Vt=M.insert("g");if(Vt.insert("path").attr("d",`M ${It},${Nt} L ${St},${wt} L${Gt},${zt} `).attr("class","edge"),K){const $t=N(W)?T[W](It,F):It-$,kt=L(W)?T[W](Nt,F):Nt-$;Vt.insert("polygon").attr("points",c[W](F)).attr("transform",`translate(${$t},${kt})`).attr("class","arrow")}if(Ot){const $t=N(j)?T[j](Gt,F):Gt-$,kt=L(j)?T[j](zt,F):zt-$;Vt.insert("polygon").attr("points",c[j](F)).attr("transform",`translate(${$t},${kt})`).attr("class","arrow")}if(yt){const $t=D(W,j)?"XY":N(W)?"X":"Y";let kt=0;kt="X"===$t?Math.abs(It-Gt):"Y"===$t?Math.abs(Nt-zt)/1.5:Math.abs(It-Gt)/2;const Zt=Vt.append("g");if(yield(0,s.rw)(Zt,yt,{useHtmlLabels:!1,width:kt,classes:"architecture-service-label"},(0,t.nV)()),Zt.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),"X"===$t)Zt.attr("transform","translate("+St+", "+wt+")");else if("Y"===$t)Zt.attr("transform","translate("+St+", "+wt+") rotate(-90)");else if("XY"===$t){const _t=nt(W,j);if(_t&&et(_t)){const jt=Zt.node().getBoundingClientRect(),[qt,re]=ct(_t);Zt.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*qt*re*45})`);const ie=Zt.node().getBoundingClientRect();Zt.attr("transform",`\n translate(${St}, ${wt-jt.height/2})\n translate(${qt*ie.width/2}, ${re*ie.height/2})\n rotate(${-1*qt*re*45}, 0, ${jt.height/2})\n `)}}}}});return function(U){return ot.apply(this,arguments)}}()))});return function(M,C){return v.apply(this,arguments)}}(),"drawEdges"),xt=(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C){const G=.75*ft("padding"),S=ft("fontSize"),$=ft("iconSize")/2;yield Promise.all(C.nodes().map(function(){var ot=(0,R.Z)(function*(U){const at=m(U);if("group"===at.type){const{h:W,w:K,x1:rt,y1:B}=U.boundingBox();M.append("rect").attr("x",rt+$).attr("y",B+$).attr("width",K).attr("height",W).attr("class","node-bkg");const j=M.append("g");let Ot=rt,pt=B;if(at.icon){const yt=j.append("g");yt.html(`<g>${yield(0,y.s4)(at.icon,{height:G,width:G,fallbackPrefix:ut.prefix})}</g>`),yt.attr("transform","translate("+(Ot+$+1)+", "+(pt+$+1)+")"),Ot+=G,pt+=S/2-1-2}if(at.label){const yt=j.append("g");yield(0,s.rw)(yt,at.label,{useHtmlLabels:!1,width:K,classes:"architecture-service-label"},(0,t.nV)()),yt.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start"),yt.attr("transform","translate("+(Ot+$+4)+", "+(pt+$+2)+")")}}});return function(U){return ot.apply(this,arguments)}}()))});return function(M,C){return v.apply(this,arguments)}}(),"drawGroups"),Dt=(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C,k){for(const G of k){const S=C.append("g"),F=ft("iconSize");if(G.title){const at=S.append("g");yield(0,s.rw)(at,G.title,{useHtmlLabels:!1,width:1.5*F,classes:"architecture-service-label"},(0,t.nV)()),at.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle"),at.attr("transform","translate("+F/2+", "+F+")")}const $=S.append("g");if(G.icon)$.html(`<g>${yield(0,y.s4)(G.icon,{height:F,width:F,fallbackPrefix:ut.prefix})}</g>`);else if(G.iconText){$.html(`<g>${yield(0,y.s4)("blank",{height:F,width:F,fallbackPrefix:ut.prefix})}</g>`);const K=$.append("g").append("foreignObject").attr("width",F).attr("height",F).append("div").attr("class","node-icon-text").attr("style",`height: ${F}px;`).append("div").html(G.iconText),rt=parseInt(window.getComputedStyle(K.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;K.attr("style",`-webkit-line-clamp: ${Math.floor((F-2)/rt)};`)}else $.append("path").attr("class","node-bkg").attr("id","node-"+G.id).attr("d",`M0 ${F} v${-F} q0,-5 5,-5 h${F} q5,0 5,5 v${F} H0 Z`);S.attr("class","architecture-service");const{width:ot,height:U}=S._groups[0][0].getBBox();G.width=ot,G.height=U,M.setElementForId(G.id,S)}return 0});return function(M,C,k){return v.apply(this,arguments)}}(),"drawServices"),Mt=(0,t.eW)(function(v,M,C){C.forEach(k=>{const G=M.append("g"),S=ft("iconSize");G.append("g").append("rect").attr("id","node-"+k.id).attr("fill-opacity","0").attr("width",S).attr("height",S),G.attr("class","architecture-junction");const{width:$,height:ot}=G._groups[0][0].getBBox();G.width=$,G.height=ot,v.setElementForId(k.id,G)})},"drawJunctions");function Ct(v,M){v.forEach(C=>{M.add({group:"nodes",data:{type:"service",id:C.id,icon:C.icon,label:C.title,parent:C.in,width:ft("iconSize"),height:ft("iconSize")},classes:"node-service"})})}function At(v,M){v.forEach(C=>{M.add({group:"nodes",data:{type:"junction",id:C.id,parent:C.in,width:ft("iconSize"),height:ft("iconSize")},classes:"node-junction"})})}function Rt(v,M){M.nodes().map(C=>{const k=m(C);"group"!==k.type&&(k.x=C.position().x,k.y=C.position().y,v.getElementById(k.id).attr("transform","translate("+(k.x||0)+","+(k.y||0)+")"))})}function Ht(v,M){v.forEach(C=>{M.add({group:"nodes",data:{type:"group",id:C.id,icon:C.icon,label:C.title,parent:C.in},classes:"node-group"})})}function Qt(v,M){v.forEach(C=>{const{lhsId:k,rhsId:G,lhsInto:S,lhsGroup:F,rhsInto:$,lhsDir:ot,rhsDir:U,rhsGroup:at,title:W}=C,K=D(C.lhsDir,C.rhsDir)?"segments":"straight",rt={id:`${k}-${G}`,label:W,source:k,sourceDir:ot,sourceArrow:S,sourceGroup:F,sourceEndpoint:"L"===ot?"0 50%":"R"===ot?"100% 50%":"T"===ot?"50% 0":"50% 100%",target:G,targetDir:U,targetArrow:$,targetGroup:at,targetEndpoint:"L"===U?"0 50%":"R"===U?"100% 50%":"T"===U?"50% 0":"50% 100%"};M.add({group:"edges",data:rt,classes:K})})}function bt(v,M,C){const k=(0,t.eW)(($,ot)=>Object.entries($).reduce((U,[at,W])=>{let K=0;const rt=Object.entries(W);if(1===rt.length)return U[at]=rt[0][1],U;for(let B=0;B<rt.length-1;B++)for(let j=B+1;j<rt.length;j++){const[Ot,pt]=rt[B],[yt,It]=rt[j];if(C[Ot]?.[yt]===ot)U[at]??=[],U[at]=[...U[at],...pt,...It];else if("default"===Ot||"default"===yt)U[at]??=[],U[at]=[...U[at],...pt,...It];else{U[`${at}-${K++}`]=pt;U[`${at}-${K++}`]=It}}return U},{}),"flattenAlignments"),G=M.map($=>{const ot={},U={};return Object.entries($).forEach(([at,[W,K]])=>{const rt=v.getNode(at)?.in??"default";ot[K]??={},ot[K][rt]??=[],ot[K][rt].push(at),U[W]??={},U[W][rt]??=[],U[W][rt].push(at)}),{horiz:Object.values(k(ot,"horizontal")).filter(at=>at.length>1),vert:Object.values(k(U,"vertical")).filter(at=>at.length>1)}}),[S,F]=G.reduce(([$,ot],{horiz:U,vert:at})=>[[...$,...U],[...ot,...at]],[[],[]]);return{horizontal:S,vertical:F}}function Yt(v){const M=[],C=(0,t.eW)(G=>`${G[0]},${G[1]}`,"posToStr"),k=(0,t.eW)(G=>G.split(",").map(S=>parseInt(S)),"strToPos");return v.forEach(G=>{const S=Object.fromEntries(Object.entries(G).map(([U,at])=>[C(at),U])),F=[C([0,0])],$={},ot={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};for(;F.length>0;){const U=F.shift();if(U){$[U]=1;const at=S[U];if(at){const W=k(U);Object.entries(ot).forEach(([K,rt])=>{const B=C([W[0]+rt[0],W[1]+rt[1]]),j=S[B];j&&!$[B]&&(F.push(B),M.push({[g[K]]:j,[g[f(K)]]:at,gap:1.5*ft("iconSize")}))})}}}}),M}function Xt(v,M,C,k,G,{spatialMaps:S,groupAlignments:F}){return new Promise($=>{const ot=(0,l.Ys)("body").append("div").attr("id","cy").attr("style","display:none"),U=(0,e.Z)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${ft("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${ft("padding")}px`}}]});ot.remove(),Ht(C,U),Ct(v,U),At(M,U),Qt(k,U);const at=bt(G,S,F),W=Yt(S),K=U.layout({name:"fcose",quality:"proof",styleEnabled:!1,animate:!1,nodeDimensionsIncludeLabels:!1,idealEdgeLength(rt){const[B,j]=rt.connectedNodes(),{parent:Ot}=m(B),{parent:pt}=m(j);return Ot===pt?1.5*ft("iconSize"):.5*ft("iconSize")},edgeElasticity(rt){const[B,j]=rt.connectedNodes(),{parent:Ot}=m(B),{parent:pt}=m(j);return Ot===pt?.45:.001},alignmentConstraint:at,relativePlacementConstraint:W});K.one("layoutstop",()=>{function rt(B,j,Ot,pt){let yt,It;const{x:Nt,y:St}=B,{x:wt,y:Gt}=j;It=(pt-St+(Nt-Ot)*(St-Gt)/(Nt-wt))/Math.sqrt(1+Math.pow((St-Gt)/(Nt-wt),2)),yt=Math.sqrt(Math.pow(pt-St,2)+Math.pow(Ot-Nt,2)-Math.pow(It,2));yt/=Math.sqrt(Math.pow(wt-Nt,2)+Math.pow(Gt-St,2));let Wt=(wt-Nt)*(pt-St)-(Gt-St)*(Ot-Nt);switch(!0){case Wt>=0:Wt=1;break;case Wt<0:Wt=-1}let Vt=(wt-Nt)*(Ot-Nt)+(Gt-St)*(pt-St);switch(!0){case Vt>=0:Vt=1;break;case Vt<0:Vt=-1}return It=Math.abs(It)*Wt,yt*=Vt,{distances:It,weights:yt}}(0,t.eW)(rt,"getSegmentWeights"),U.startBatch();for(const B of Object.values(U.edges()))if(B.data?.()){const{x:j,y:Ot}=B.source().position(),{x:pt,y:yt}=B.target().position();if(j!==pt&&Ot!==yt){const It=B.sourceEndpoint(),Nt=B.targetEndpoint(),{sourceDir:St}=i(B),[wt,Gt]=L(St)?[It.x,Nt.y]:[Nt.x,It.y],{weights:zt,distances:Wt}=rt(It,Nt,wt,Gt);B.style("segment-distances",Wt),B.style("segment-weights",zt)}}U.endBatch(),K.run()}),K.run(),U.ready(rt=>{t.cM.info("Ready",rt),$(U)})})}(0,y.ef)([{name:ut.prefix,icons:ut}]),e.Z.use(r),(0,t.eW)(Ct,"addServices"),(0,t.eW)(At,"addJunctions"),(0,t.eW)(Rt,"positionNodes"),(0,t.eW)(Ht,"addGroups"),(0,t.eW)(Qt,"addEdges"),(0,t.eW)(bt,"getAlignments"),(0,t.eW)(Yt,"getRelativeConstraints"),(0,t.eW)(Xt,"layoutArchitecture");var q={parser:Pt,db:st,renderer:{draw:(0,t.eW)(function(){var v=(0,R.Z)(function*(M,C,k,G){const S=G.db,F=S.getServices(),$=S.getJunctions(),ot=S.getGroups(),U=S.getEdges(),at=S.getDataStructures(),W=(0,E.P)(C),K=W.append("g");K.attr("class","architecture-edges");const rt=W.append("g");rt.attr("class","architecture-services");const B=W.append("g");B.attr("class","architecture-groups"),yield Dt(S,rt,F),Mt(S,rt,$);const j=yield Xt(F,$,ot,U,S,at);yield gt(K,j),yield xt(B,j),Rt(S,j),(0,t.j7)(void 0,W,ft("padding"),ft("useMaxWidth"))});return function(M,C,k,G){return v.apply(this,arguments)}}(),"draw")},styles:Kt}}}]); |