@bkm016/basalt 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-x1xss1d7.js → chunk-1vd0f74z.js} +2 -2
- package/{chunk-v9fea96h.js → chunk-2hbfk5xd.js} +2 -2
- package/{chunk-5j1krv9v.js → chunk-2zp1mv3q.js} +1 -1
- package/{chunk-d2j735sd.js → chunk-3ct2tkr8.js} +2 -2
- package/{chunk-c7x1zq39.js → chunk-3x94302m.js} +1 -1
- package/{chunk-gzxnene8.js → chunk-4w17tzp5.js} +2 -2
- package/{chunk-1zdwrgd4.js → chunk-5dfbezv9.js} +1 -1
- package/{chunk-shhrr741.js → chunk-5x1sankd.js} +24 -24
- package/{chunk-pmqtkqsf.js → chunk-71h08f4g.js} +1 -1
- package/{chunk-fm0k0qtz.js → chunk-7afmgncg.js} +2 -2
- package/{chunk-v258nxcz.js → chunk-7nzhdrv9.js} +1 -1
- package/{chunk-zmsgwr3s.js → chunk-7q51n619.js} +1 -1
- package/{chunk-y0m980k3.js → chunk-7tbya5b5.js} +3 -3
- package/{chunk-8tjad3r0.js → chunk-8wc8qdx8.js} +5 -5
- package/{chunk-gp7y0fja.js → chunk-9rmqgc3c.js} +9 -9
- package/{chunk-nbb9trwz.js → chunk-akr0a8nc.js} +2 -2
- package/{chunk-k506w58v.js → chunk-aky4tztg.js} +2 -2
- package/{chunk-8296hw9m.js → chunk-em187cy3.js} +2 -2
- package/{chunk-2esbgxps.js → chunk-ev6yvy5y.js} +5 -5
- package/{chunk-75m78j7x.js → chunk-f3xadvab.js} +2 -2
- package/{chunk-5c9j8qe4.js → chunk-fvn32nzj.js} +26 -26
- package/{chunk-bannb9xm.js → chunk-jk25nt60.js} +1 -1
- package/{chunk-27gntzs5.js → chunk-kp22kaez.js} +1 -1
- package/{chunk-6hssbcgj.js → chunk-nmca5h6m.js} +1 -1
- package/{chunk-d8gtbw9g.js → chunk-pjyn2s97.js} +1 -1
- package/{chunk-rtzqqngy.js → chunk-q7t30zz2.js} +2 -2
- package/{chunk-aefadsy6.js → chunk-r0scgfwx.js} +1 -1
- package/{chunk-hwr56pfj.js → chunk-rmj5b73e.js} +1 -1
- package/{chunk-1qpces5a.js → chunk-vexrrw1b.js} +2 -2
- package/chunk-vkpvcxjr.js +2 -0
- package/{chunk-3cjsd292.js → chunk-whvj83b7.js} +2 -2
- package/{chunk-z55bmysw.js → chunk-xh3vr5vz.js} +1 -1
- package/{chunk-10xzzn07.js → chunk-zggzfa7j.js} +2 -2
- package/compiled.js +3 -3
- package/package.json +1 -1
- package/ui-test-worker.js +13 -13
- package/web/{chunk-shbw6wg8.js → chunk-0b47eyrf.js} +1 -1
- package/web/{chunk-vz5ck6x9.js → chunk-0h0vb6gt.js} +1 -1
- package/web/{chunk-24k0r5aq.js → chunk-0rmkpsgp.js} +1 -1
- package/web/{chunk-3mvr2gwh.js → chunk-0xkyryrq.js} +1 -1
- package/web/{chunk-284a17k8.js → chunk-0z0y25zf.js} +1 -1
- package/web/{chunk-ezkqa7we.js → chunk-1eg9sbbt.js} +1 -1
- package/web/{chunk-raqqscwa.js → chunk-1gbd61z0.js} +1 -1
- package/web/{chunk-s3rdx28k.js → chunk-2s0bmrkv.js} +1 -1
- package/web/{chunk-9re6yttj.js → chunk-2z1rwr28.js} +1 -1
- package/web/{chunk-avwpjsxw.js → chunk-344bq59c.js} +1 -1
- package/web/{chunk-kgerjbn4.js → chunk-3re8y26v.js} +1 -1
- package/web/chunk-3t0211rw.js +1 -0
- package/web/{chunk-q1pkntc6.js → chunk-42e3b9hv.js} +1 -1
- package/web/chunk-44rmrmcn.js +1 -0
- package/web/{chunk-aqm3spxt.js → chunk-4bzqrwr0.js} +89 -89
- package/web/{chunk-5e7ygjdn.js → chunk-4d3a7xs2.js} +1 -1
- package/web/{chunk-2pjdtesn.js → chunk-4jmazh6x.js} +1 -1
- package/web/{chunk-r92sbgwv.js → chunk-4re74xwm.js} +1 -1
- package/web/{chunk-rc2vq9wz.js → chunk-5qtyq3ce.js} +1 -1
- package/web/{chunk-vj6kstpp.js → chunk-5z4jcqct.js} +1 -1
- package/web/{chunk-abbvjt4e.js → chunk-5z6x2n5h.js} +1 -1
- package/web/{chunk-yen2kkn2.js → chunk-6cnek1xh.js} +1 -1
- package/web/chunk-6f5ke0x9.js +1 -0
- package/web/{chunk-vkc149rb.js → chunk-6xaqxcq8.js} +1 -1
- package/web/chunk-7q6wvv2x.js +1 -0
- package/web/{chunk-43jqvsrg.js → chunk-7qsa4p8h.js} +1 -1
- package/web/chunk-8nja0ygy.js +1 -0
- package/web/{chunk-4bry4xds.js → chunk-8y64fkpz.js} +1 -1
- package/web/{chunk-rkj743fg.js → chunk-92ssjk2y.js} +1 -1
- package/web/chunk-9ad7v7bm.js +8 -0
- package/web/{chunk-xdcs8qz3.js → chunk-9cx1be43.js} +1 -1
- package/web/{chunk-jf2ehmvp.js → chunk-9dzxv335.js} +1 -1
- package/web/{chunk-t1xk6hca.js → chunk-9t5dnjaz.js} +2 -2
- package/web/{chunk-h31p43qa.js → chunk-a408enpy.js} +1 -1
- package/web/{chunk-z24vs8q9.js → chunk-a497tykb.js} +1 -1
- package/web/{chunk-qryrg2pq.js → chunk-aqfpnhmt.js} +2 -2
- package/web/{chunk-rrws61wf.js → chunk-b1bgzz66.js} +1 -1
- package/web/{chunk-cwvtraca.js → chunk-b53bfkys.js} +1 -1
- package/web/{chunk-5jbf7n5q.js → chunk-b6k9w215.js} +1 -1
- package/web/{chunk-ctcrk3qn.js → chunk-bhsaj6qq.js} +1 -1
- package/web/chunk-cjfssg3m.js +2 -0
- package/web/{chunk-znvnb9dh.js → chunk-d11v5s7w.js} +1 -1
- package/web/{chunk-ctd8bfg2.js → chunk-df5zx17h.js} +1 -1
- package/web/chunk-e0zre35a.js +1 -0
- package/web/{chunk-3z93efr4.js → chunk-e9twvs9n.js} +1 -1
- package/web/chunk-f2kgtyfp.js +1 -0
- package/web/{chunk-8wye0wbb.js → chunk-f4tacm06.js} +1 -1
- package/web/chunk-f8bn5tzf.js +1 -0
- package/web/chunk-fdp9bsj7.js +1 -0
- package/web/{chunk-8ah6ce1b.js → chunk-fh2vj0wv.js} +1 -1
- package/web/{chunk-5rx8rtsa.js → chunk-gmzqdm7v.js} +1 -1
- package/web/{chunk-fqj9kry9.js → chunk-hvw3gn2a.js} +1 -1
- package/web/{chunk-fy8ey195.js → chunk-khxcn8tt.js} +1 -1
- package/web/{chunk-z760wagr.js → chunk-kmr7r9xj.js} +1 -1
- package/web/chunk-kqqmp1am.js +1 -0
- package/web/{chunk-s3hwejnr.js → chunk-kwccs9f6.js} +1 -1
- package/web/chunk-nbgqbxcy.js +1 -0
- package/web/{chunk-yjv2c45j.js → chunk-ncpnpe9w.js} +1 -1
- package/web/{chunk-g8ee1csm.js → chunk-ne0v8mfb.js} +1 -1
- package/web/{chunk-f078k1ej.js → chunk-ngx2cp8x.js} +1 -1
- package/web/{chunk-xa88zgkr.js → chunk-nvhmq4z5.js} +1 -1
- package/web/chunk-nxcgf7ec.js +1 -0
- package/web/{chunk-anbn2ttv.js → chunk-p0kvmf28.js} +1 -1
- package/web/chunk-p3k7m5nr.js +1 -0
- package/web/{chunk-jzmzhj8z.js → chunk-pggaffrh.js} +1 -1
- package/web/{chunk-zrzq29e6.js → chunk-pjkdrgm0.js} +1 -1
- package/web/{chunk-jmnaq7c1.js → chunk-pws2seas.js} +1 -1
- package/web/{chunk-1z5p7a1h.js → chunk-pz9ps2jm.js} +1 -1
- package/web/chunk-qh15dxav.css +1 -0
- package/web/chunk-qpmbxhh6.js +1 -0
- package/web/chunk-r0rctnxz.js +1 -0
- package/web/chunk-rn3dnqm8.js +1 -0
- package/web/{chunk-jvj66qhs.js → chunk-rvrf0f3h.js} +1 -1
- package/web/{chunk-pk3ap3wh.js → chunk-sfg2wkhe.js} +1 -1
- package/web/{chunk-tn1xzmgx.js → chunk-sspfxp5e.js} +1 -1
- package/web/{chunk-dt8ss97f.js → chunk-t4c8xavd.js} +1 -1
- package/web/{chunk-vny496ba.js → chunk-tdr6x2xc.js} +1 -1
- package/web/chunk-tncvg1nn.js +1 -0
- package/web/{chunk-6qejm5s2.js → chunk-vyp0ns1f.js} +1 -1
- package/web/{chunk-kww4azv5.js → chunk-wnskxerq.js} +1 -1
- package/web/{chunk-9dd1c37b.js → chunk-wvdehm9y.js} +66 -66
- package/web/chunk-x7ahcpj7.js +1 -0
- package/web/chunk-y38bf0wm.js +1 -0
- package/web/{chunk-vjqmnkh2.js → chunk-y56aaba5.js} +1 -1
- package/web/{chunk-mjpjkyd1.js → chunk-ybrf9mhz.js} +1 -1
- package/web/{chunk-8e43yaq3.js → chunk-ye58t45p.js} +3 -3
- package/web/{chunk-dk90px7g.js → chunk-yqbnps3a.js} +1 -1
- package/web/{chunk-bt1m87ck.js → chunk-z1h20s8c.js} +1 -1
- package/web/{chunk-693m9kt7.js → chunk-zj4q9jth.js} +1 -1
- package/web/{chunk-tnv7z83q.js → chunk-zj5k94dk.js} +1 -1
- package/web/{chunk-986z0p48.js → chunk-zqch0sc8.js} +1 -1
- package/web/{chunk-agmkx996.js → chunk-zx8zec24.js} +1 -1
- package/web/index.html +1 -1
- package/chunk-09rj27b2.js +0 -2
- package/web/chunk-0sewdyz1.js +0 -1
- package/web/chunk-21ke27j6.js +0 -1
- package/web/chunk-3t3zwx9j.js +0 -1
- package/web/chunk-5xc9d5ft.js +0 -1
- package/web/chunk-b470hvpk.js +0 -1
- package/web/chunk-fekjj24p.css +0 -1
- package/web/chunk-frjfamx7.js +0 -8
- package/web/chunk-h5p5jsrw.js +0 -1
- package/web/chunk-h9fmr6ch.js +0 -1
- package/web/chunk-jq0pw0k2.js +0 -1
- package/web/chunk-k4cfnvyq.js +0 -1
- package/web/chunk-m29dhjkh.js +0 -1
- package/web/chunk-mj6tee5h.js +0 -1
- package/web/chunk-szcy5z56.js +0 -1
- package/web/chunk-t2hhdg9r.js +0 -1
- package/web/chunk-tj4cmkwe.js +0 -1
- package/web/chunk-v2b5q0n5.js +0 -1
- package/web/chunk-y5x74t89.js +0 -1
- package/web/chunk-yx3dh5hg.js +0 -1
- package/web/chunk-yz4fmtk2.js +0 -1
- package/web/chunk-z5j6x6j8.js +0 -2
- package/web/chunk-z5stjrhc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Se}from"./chunk-aqm3spxt.js";var Fo=Se(function(on,ko){(function(e,r){if(typeof on==="object"&&typeof ko==="object")ko.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof on==="object")on.layoutBase=r();else e.layoutBase=r()})(on,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.i=function(a){return a},r.d=function(a,n,i){if(!r.o(a,n))Object.defineProperty(a,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=28)}([function(t,e,r){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1000,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a},function(t,e,r){var a=r(2),n=r(8),i=r(9);function s(l,u,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=l,this.target=u}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;else if(this.target===l)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(l,u){var f=this.getOtherEnd(l),v=u.getGraphManager().getRoot();while(!0){if(f.getOwner()==u)return f;if(f.getOwner()==v)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var l=[,,,,];if(this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),l),!this.isOverlapingSourceAndTarget){if(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){function a(n){this.vGraphObject=n}t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(13),s=r(0),o=r(16),l=r(5);function u(v,h,c,d){if(c==null&&d==null)d=h;if(a.call(this,d),v.graphManager!=null)v=v.graphManager;if(this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=v,c!=null&&h!=null)this.rect=new i(h.x,h.y,c.width,c.height);else this.rect=new i}u.prototype=Object.create(a.prototype);for(var f in a)u[f]=a[f];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(v){this.rect.width=v},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(v){this.rect.height=v},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(v,h){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=h.width,this.rect.height=h.height},u.prototype.setCenter=function(v,h){this.rect.x=v-this.rect.width/2,this.rect.y=h-this.rect.height/2},u.prototype.setLocation=function(v,h){this.rect.x=v,this.rect.y=h},u.prototype.moveBy=function(v,h){this.rect.x+=v,this.rect.y+=h},u.prototype.getEdgeListToNode=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(g.target==v){if(g.source!=d)throw"Incorrect edge source!";h.push(g)}}),h},u.prototype.getEdgesBetween=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(!(g.source==d||g.target==d))throw"Incorrect edge source and/or target";if(g.target==v||g.source==v)h.push(g)}),h},u.prototype.getNeighborsList=function(){var v=new Set,h=this;return h.edges.forEach(function(c){if(c.source==h)v.add(c.target);else{if(c.target!=h)throw"Incorrect incidency!";v.add(c.source)}}),v},u.prototype.withChildren=function(){var v=new Set,h,c;if(v.add(this),this.child!=null){var d=this.child.getNodes();for(var g=0;g<d.length;g++)h=d[g],c=h.withChildren(),c.forEach(function(y){v.add(y)})}return v},u.prototype.getNoOfChildren=function(){var v=0,h;if(this.child==null)v=1;else{var c=this.child.getNodes();for(var d=0;d<c.length;d++)h=c[d],v+=h.getNoOfChildren()}if(v==0)v=1;return v},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},u.prototype.scatter=function(){var v,h,c=-s.INITIAL_WORLD_BOUNDARY,d=s.INITIAL_WORLD_BOUNDARY;v=s.WORLD_CENTER_X+o.nextDouble()*(d-c)+c;var g=-s.INITIAL_WORLD_BOUNDARY,y=s.INITIAL_WORLD_BOUNDARY;h=s.WORLD_CENTER_Y+o.nextDouble()*(y-g)+g,this.rect.x=v,this.rect.y=h},u.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var h=v.getRight()-v.getLeft(),c=v.getBottom()-v.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(h+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>h)this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(h+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(v){var h=this.rect.x;if(h>s.WORLD_BOUNDARY)h=s.WORLD_BOUNDARY;else if(h<-s.WORLD_BOUNDARY)h=-s.WORLD_BOUNDARY;var c=this.rect.y;if(c>s.WORLD_BOUNDARY)c=s.WORLD_BOUNDARY;else if(c<-s.WORLD_BOUNDARY)c=-s.WORLD_BOUNDARY;var d=new l(h,c),g=v.inverseTransformPoint(d);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},t.exports=u},function(t,e,r){var a=r(0);function n(){}for(var i in a)n[i]=a[i];n.MAX_ITERATIONS=2500,n.DEFAULT_EDGE_LENGTH=50,n.DEFAULT_SPRING_STRENGTH=0.45,n.DEFAULT_REPULSION_STRENGTH=4500,n.DEFAULT_GRAVITY_STRENGTH=0.4,n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,n.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,n.COOLING_ADAPTATION_FACTOR=0.33,n.ADAPTATION_LOWER_NODE_LIMIT=1000,n.ADAPTATION_UPPER_NODE_LIMIT=5000,n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,n.MAX_NODE_DISPLACEMENT=n.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10,n.CONVERGENCE_CHECK_PERIOD=100,n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,n.MIN_EDGE_LENGTH=1,n.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=n},function(t,e,r){function a(n,i){if(n==null&&i==null)this.x=0,this.y=0;else this.x=n,this.y=i}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(n){this.x=n},a.prototype.setY=function(n){this.y=n},a.prototype.getDifference=function(n){return new DimensionD(this.x-n.x,this.y-n.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(n){return this.x+=n.width,this.y+=n.height,this},t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(0),s=r(7),o=r(3),l=r(1),u=r(13),f=r(12),v=r(11);function h(d,g,y){if(a.call(this,y),this.estimatedSize=n.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,g!=null&&g instanceof s)this.graphManager=g;else if(g!=null&&g instanceof Layout)this.graphManager=g.graphManager}h.prototype=Object.create(a.prototype);for(var c in a)h[c]=a[c];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(d,g,y){if(g==null&&y==null){var p=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(p)>-1)throw"Node already in graph!";return p.owner=this,this.getNodes().push(p),p}else{var m=d;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(g.owner==y.owner&&g.owner==this))throw"Both owners must be this graph!";if(g.owner!=y.owner)return null;if(m.source=g,m.target=y,m.isInterGraph=!1,this.getEdges().push(m),g.edges.push(m),y!=g)y.edges.push(m);return m}},h.prototype.remove=function(d){var g=d;if(d instanceof o){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var y=g.edges.slice(),p,m=y.length;for(var b=0;b<m;b++)if(p=y[b],p.isInterGraph)this.graphManager.remove(p);else p.source.owner.remove(p);var E=this.nodes.indexOf(g);if(E==-1)throw"Node not in owner node list!";this.nodes.splice(E,1)}else if(d instanceof l){var p=d;if(p==null)throw"Edge is null!";if(!(p.source!=null&&p.target!=null))throw"Source and/or target is null!";if(!(p.source.owner!=null&&p.target.owner!=null&&p.source.owner==this&&p.target.owner==this))throw"Source and/or target owner is invalid!";var A=p.source.edges.indexOf(p),M=p.target.edges.indexOf(p);if(!(A>-1&&M>-1))throw"Source and/or target doesn't know this edge!";if(p.source.edges.splice(A,1),p.target!=p.source)p.target.edges.splice(M,1);var E=p.source.owner.getEdges().indexOf(p);if(E==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(E,1)}},h.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:g}=n,y,p,m,b=this.getNodes(),E=b.length;for(var A=0;A<E;A++){var M=b[A];if(y=M.getTop(),p=M.getLeft(),d>y)d=y;if(g>p)g=p}if(d==n.MAX_VALUE)return null;if(b[0].getParent().paddingLeft!=null)m=b[0].getParent().paddingLeft;else m=this.margin;return this.left=g-m,this.top=d-m,new f(this.left,this.top)},h.prototype.updateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S,P=this.nodes,N=P.length;for(var R=0;R<N;R++){var I=P[R];if(d&&I.child!=null)I.updateBounds();if(b=I.getLeft(),E=I.getRight(),A=I.getTop(),M=I.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var w=new u(g,p,y-g,m-p);if(g==n.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(P[0].getParent().paddingLeft!=null)S=P[0].getParent().paddingLeft;else S=this.margin;this.left=w.x-S,this.right=w.x+w.width+S,this.top=w.y-S,this.bottom=w.y+w.height+S},h.calculateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S=d.length;for(var P=0;P<S;P++){var N=d[P];if(b=N.getLeft(),E=N.getRight(),A=N.getTop(),M=N.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var R=new u(g,p,y-g,m-p);return R},h.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){var d=0,g=this.nodes,y=g.length;for(var p=0;p<y;p++){var m=g[p];d+=m.calcEstimatedSize()}if(d==0)this.estimatedSize=i.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},h.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new v,y=new Set,p=this.nodes[0],m,b,E=p.withChildren();E.forEach(function(R){g.push(R),y.add(R)});while(g.length!==0){p=g.shift(),m=p.getEdges();var A=m.length;for(var M=0;M<A;M++){var S=m[M];if(b=S.getOtherEndInGraph(p,this),b!=null&&!y.has(b)){var P=b.withChildren();P.forEach(function(R){g.push(R),y.add(R)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var N=0;if(y.forEach(function(R){if(R.owner==d)N++}),N==this.nodes.length)this.isConnected=!0}},t.exports=h},function(t,e,r){var a,n=r(1);function i(s){a=r(6),this.layout=s,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),l=this.add(s,o);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(s,o,l,u,f){if(l==null&&u==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}else{f=l,u=o,l=s;var v=u.getOwner(),h=f.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==h)return l.isInterGraph=!1,v.add(l,u,f);else{if(l.isInterGraph=!0,l.source=u,l.target=f,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}}},i.prototype.remove=function(s){if(s instanceof a){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(o.getEdges());var u,f=l.length;for(var v=0;v<f;v++)u=l[v],o.remove(u);var h=[];h=h.concat(o.getNodes());var c;f=h.length;for(var v=0;v<f;v++)c=h[v],o.remove(c);if(o==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(s instanceof n){if(u=s,u==null)throw"Edge is null!";if(!u.isInterGraph)throw"Not an inter-graph edge!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.edges.indexOf(u)!=-1&&u.target.edges.indexOf(u)!=-1))throw"Source and/or target doesn't know this edge!";var d=u.source.edges.indexOf(u);if(u.source.edges.splice(d,1),d=u.target.edges.indexOf(u),u.target.edges.splice(d,1),!(u.source.owner!=null&&u.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(u.source.owner.getGraphManager().edges.indexOf(u)==-1)throw"Not in owner graph manager's edge list!";var d=u.source.owner.getGraphManager().edges.indexOf(u);u.source.owner.getGraphManager().edges.splice(d,1)}},i.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},i.prototype.getGraphs=function(){return this.graphs},i.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<l;u++)s=s.concat(o[u].getNodes());this.allNodes=s}return this.allNodes},i.prototype.resetAllNodes=function(){this.allNodes=null},i.prototype.resetAllEdges=function(){this.allEdges=null},i.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},i.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<o.length;u++)s=s.concat(o[u].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},i.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},i.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},i.prototype.getRoot=function(){return this.rootGraph},i.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},i.prototype.getLayout=function(){return this.layout},i.prototype.isOneAncestorOfOther=function(s,o){if(!(s!=null&&o!=null))throw"assert failed";if(s==o)return!0;var l=s.getOwner(),u;do{if(u=l.getParent(),u==null)break;if(u==o)return!0;if(l=u.getOwner(),l==null)break}while(!0);l=o.getOwner();do{if(u=l.getParent(),u==null)break;if(u==s)return!0;if(l=u.getOwner(),l==null)break}while(!0);return!1},i.prototype.calcLowestCommonAncestors=function(){var s,o,l,u,f,v=this.getAllEdges(),h=v.length;for(var c=0;c<h;c++){if(s=v[c],o=s.source,l=s.target,s.lca=null,s.sourceInLca=o,s.targetInLca=l,o==l){s.lca=o.getOwner();continue}u=o.getOwner();while(s.lca==null){s.targetInLca=l,f=l.getOwner();while(s.lca==null){if(f==u){s.lca=f;break}if(f==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=f.getParent(),f=s.targetInLca.getOwner()}if(u==this.rootGraph)break;if(s.lca==null)s.sourceInLca=u.getParent(),u=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},i.prototype.calcLowestCommonAncestor=function(s,o){if(s==o)return s.getOwner();var l=s.getOwner();do{if(l==null)break;var u=o.getOwner();do{if(u==null)break;if(u==l)return u;u=u.getParent().getOwner()}while(!0);l=l.getParent().getOwner()}while(!0);return l},i.prototype.calcInclusionTreeDepths=function(s,o){if(s==null&&o==null)s=this.rootGraph,o=1;var l,u=s.getNodes(),f=u.length;for(var v=0;v<f;v++)if(l=u[v],l.inclusionTreeDepth=o,l.child!=null)this.calcInclusionTreeDepths(l.child,o+1)},i.prototype.includesInvalidEdge=function(){var s,o=[],l=this.edges.length;for(var u=0;u<l;u++)if(s=this.edges[u],this.isOneAncestorOfOther(s.source,s.target))o.push(s);for(var u=0;u<o.length;u++)this.remove(o[u]);return!1},t.exports=i},function(t,e,r){var a=r(12);function n(){}n.calcSeparationAmount=function(i,s,o,l){if(!i.intersects(s))throw"assert failed";var u=[,,];if(this.decideDirectionsForOverlappingNodes(i,s,u),o[0]=Math.min(i.getRight(),s.getRight())-Math.max(i.x,s.x),o[1]=Math.min(i.getBottom(),s.getBottom())-Math.max(i.y,s.y),i.getX()<=s.getX()&&i.getRight()>=s.getRight())o[0]+=Math.min(s.getX()-i.getX(),i.getRight()-s.getRight());else if(s.getX()<=i.getX()&&s.getRight()>=i.getRight())o[0]+=Math.min(i.getX()-s.getX(),s.getRight()-i.getRight());if(i.getY()<=s.getY()&&i.getBottom()>=s.getBottom())o[1]+=Math.min(s.getY()-i.getY(),i.getBottom()-s.getBottom());else if(s.getY()<=i.getY()&&s.getBottom()>=i.getBottom())o[1]+=Math.min(i.getY()-s.getY(),s.getBottom()-i.getBottom());var f=Math.abs((s.getCenterY()-i.getCenterY())/(s.getCenterX()-i.getCenterX()));if(s.getCenterY()===i.getCenterY()&&s.getCenterX()===i.getCenterX())f=1;var v=f*o[0],h=o[1]/f;if(o[0]<h)h=o[0];else v=o[1];o[0]=-1*u[0]*(h/2+l),o[1]=-1*u[1]*(v/2+l)},n.decideDirectionsForOverlappingNodes=function(i,s,o){if(i.getCenterX()<s.getCenterX())o[0]=-1;else o[0]=1;if(i.getCenterY()<s.getCenterY())o[1]=-1;else o[1]=1},n.getIntersection2=function(i,s,o){var l=i.getCenterX(),u=i.getCenterY(),f=s.getCenterX(),v=s.getCenterY();if(i.intersects(s))return o[0]=l,o[1]=u,o[2]=f,o[3]=v,!0;var h=i.getX(),c=i.getY(),d=i.getRight(),g=i.getX(),y=i.getBottom(),p=i.getRight(),m=i.getWidthHalf(),b=i.getHeightHalf(),E=s.getX(),A=s.getY(),M=s.getRight(),S=s.getX(),P=s.getBottom(),N=s.getRight(),R=s.getWidthHalf(),I=s.getHeightHalf(),w=!1,x=!1;if(l===f){if(u>v)return o[0]=l,o[1]=c,o[2]=f,o[3]=P,!1;else if(u<v)return o[0]=l,o[1]=y,o[2]=f,o[3]=A,!1}else if(u===v){if(l>f)return o[0]=h,o[1]=u,o[2]=M,o[3]=v,!1;else if(l<f)return o[0]=d,o[1]=u,o[2]=E,o[3]=v,!1}else{var T=i.height/i.width,D=s.height/s.width,C=(v-u)/(f-l),O=void 0,B=void 0,z=void 0,V=void 0,k=void 0,G=void 0;if(-T===C)if(l>f)o[0]=g,o[1]=y,w=!0;else o[0]=d,o[1]=c,w=!0;else if(T===C)if(l>f)o[0]=h,o[1]=c,w=!0;else o[0]=p,o[1]=y,w=!0;if(-D===C)if(f>l)o[2]=S,o[3]=P,x=!0;else o[2]=M,o[3]=A,x=!0;else if(D===C)if(f>l)o[2]=E,o[3]=A,x=!0;else o[2]=N,o[3]=P,x=!0;if(w&&x)return!1;if(l>f)if(u>v)O=this.getCardinalDirection(T,C,4),B=this.getCardinalDirection(D,C,2);else O=this.getCardinalDirection(-T,C,3),B=this.getCardinalDirection(-D,C,1);else if(u>v)O=this.getCardinalDirection(-T,C,1),B=this.getCardinalDirection(-D,C,3);else O=this.getCardinalDirection(T,C,2),B=this.getCardinalDirection(D,C,4);if(!w)switch(O){case 1:V=c,z=l+-b/C,o[0]=z,o[1]=V;break;case 2:z=p,V=u+m*C,o[0]=z,o[1]=V;break;case 3:V=y,z=l+b/C,o[0]=z,o[1]=V;break;case 4:z=g,V=u+-m*C,o[0]=z,o[1]=V;break}if(!x)switch(B){case 1:G=A,k=f+-I/C,o[2]=k,o[3]=G;break;case 2:k=N,G=v+R*C,o[2]=k,o[3]=G;break;case 3:G=P,k=f+I/C,o[2]=k,o[3]=G;break;case 4:k=S,G=v+-R*C,o[2]=k,o[3]=G;break}}return!1},n.getCardinalDirection=function(i,s,o){if(i>s)return o;else return 1+o%4},n.getIntersection=function(i,s,o,l){if(l==null)return this.getIntersection2(i,s,o);var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=void 0,m=void 0,b=void 0,E=void 0,A=void 0,M=void 0,S=void 0,P=void 0,N=void 0;if(b=h-f,A=u-v,S=v*f-u*h,E=y-d,M=c-g,P=g*d-c*y,N=b*M-E*A,N===0)return null;return p=(A*P-M*S)/N,m=(E*S-b*P)/N,new a(p,m)},n.angleOfVector=function(i,s,o,l){var u=void 0;if(i!==o){if(u=Math.atan((l-s)/(o-i)),o<i)u+=Math.PI;else if(l<s)u+=this.TWO_PI}else if(l<s)u=this.ONE_AND_HALF_PI;else u=this.HALF_PI;return u},n.doIntersect=function(i,s,o,l){var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=(v-u)*(y-d)-(g-c)*(h-f);if(p===0)return!1;else{var m=((y-d)*(g-u)+(c-g)*(y-f))/p,b=((f-h)*(g-u)+(v-u)*(y-f))/p;return 0<m&&m<1&&0<b&&b<1}},n.findCircleLineIntersections=function(i,s,o,l,u,f,v){var h=(o-i)*(o-i)+(l-s)*(l-s),c=2*((i-u)*(o-i)+(s-f)*(l-s)),d=(i-u)*(i-u)+(s-f)*(s-f)-v*v,g=c*c-4*h*d;if(g>=0){var y=(-c+Math.sqrt(c*c-4*h*d))/(2*h),p=(-c-Math.sqrt(c*c-4*h*d))/(2*h),m=null;if(y>=0&&y<=1)return[y];if(p>=0&&p<=1)return[p];return m}else return null},n.HALF_PI=0.5*Math.PI,n.ONE_AND_HALF_PI=1.5*Math.PI,n.TWO_PI=2*Math.PI,n.THREE_PI=3*Math.PI,t.exports=n},function(t,e,r){function a(){}a.sign=function(n){if(n>0)return 1;else if(n<0)return-1;else return 0},a.floor=function(n){return n<0?Math.ceil(n):Math.floor(n)},a.ceil=function(n){return n<0?Math.floor(n):Math.ceil(n)},t.exports=a},function(t,e,r){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a},function(t,e,r){var a=function(){function u(f,v){for(var h=0;h<v.length;h++){var c=v[h];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(f,c.key,c)}}return function(f,v,h){if(v)u(f.prototype,v);if(h)u(f,h);return f}}();function n(u,f){if(!(u instanceof f))throw TypeError("Cannot call a class as a function")}var i=function(f){return{value:f,next:null,prev:null}},s=function(f,v,h,c){if(f!==null)f.next=v;else c.head=v;if(h!==null)h.prev=v;else c.tail=v;return v.prev=f,v.next=h,c.length++,v},o=function(f,v){var{prev:h,next:c}=f;if(h!==null)h.next=c;else v.head=c;if(c!==null)c.prev=h;else v.tail=h;return f.prev=f.next=null,v.length--,f},l=function(){function u(f){var v=this;if(n(this,u),this.length=0,this.head=null,this.tail=null,f!=null)f.forEach(function(h){return v.push(h)})}return a(u,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,h){return s(h.prev,i(v),h,this)}},{key:"insertAfter",value:function(v,h){return s(h,i(v),h.next,this)}},{key:"insertNodeBefore",value:function(v,h){return s(h.prev,v,h,this)}},{key:"insertNodeAfter",value:function(v,h){return s(h,v,h.next,this)}},{key:"push",value:function(v){return s(this.tail,i(v),null,this)}},{key:"unshift",value:function(v){return s(null,i(v),this.head,this)}},{key:"remove",value:function(v){return o(v,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(v){if(v<=this.length()){var h=1,c=this.head;while(h<v)c=c.next,h++;return c.value}}},{key:"set_object_at",value:function(v,h){if(v<=this.length()){var c=1,d=this.head;while(c<v)d=d.next,c++;d.value=h}}}]),u}();t.exports=l},function(t,e,r){function a(n,i,s){if(this.x=null,this.y=null,n==null&&i==null&&s==null)this.x=0,this.y=0;else if(typeof n=="number"&&typeof i=="number"&&s==null)this.x=n,this.y=i;else if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.x=s.x,this.y=s.y}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(n,i,s){if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.setLocation(s.x,s.y);else if(typeof n=="number"&&typeof i=="number"&&s==null)if(parseInt(n)==n&&parseInt(i)==i)this.move(n,i);else this.x=Math.floor(n+0.5),this.y=Math.floor(i+0.5)},a.prototype.move=function(n,i){this.x=n,this.y=i},a.prototype.translate=function(n,i){this.x+=n,this.y+=i},a.prototype.equals=function(n){if(n.constructor.name=="Point"){var i=n;return this.x==i.x&&this.y==i.y}return this==n},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=a},function(t,e,r){function a(n,i,s,o){if(this.x=0,this.y=0,this.width=0,this.height=0,n!=null&&i!=null&&s!=null&&o!=null)this.x=n,this.y=i,this.width=s,this.height=o}a.prototype.getX=function(){return this.x},a.prototype.setX=function(n){this.x=n},a.prototype.getY=function(){return this.y},a.prototype.setY=function(n){this.y=n},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(n){if(this.getRight()<n.x)return!1;if(this.getBottom()<n.y)return!1;if(n.getRight()<this.x)return!1;if(n.getBottom()<this.y)return!1;return!0},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},t.exports=a},function(t,e,r){var a=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol==="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function n(){}n.lastID=0,n.createID=function(i){if(n.isPrimitive(i))return i;if(i.uniqueID!=null)return i.uniqueID;return i.uniqueID=n.getString(),n.lastID++,i.uniqueID},n.getString=function(i){if(i==null)i=n.lastID;return"Object#"+i},n.isPrimitive=function(i){var s=typeof i>"u"?"undefined":a(i);return i==null||s!="object"&&s!="function"},t.exports=n},function(t,e,r){function a(c){if(Array.isArray(c)){for(var d=0,g=Array(c.length);d<c.length;d++)g[d]=c[d];return g}else return Array.from(c)}var n=r(0),i=r(7),s=r(3),o=r(1),l=r(6),u=r(5),f=r(17),v=r(29);function h(c){if(v.call(this),this.layoutQuality=n.QUALITY,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=n.DEFAULT_INCREMENTAL,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new i(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}h.RANDOM_SEED=1,h.prototype=Object.create(v.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var c=new i(this);return this.graphManager=c,c},h.prototype.newGraph=function(c){return new l(null,this.graphManager,c)},h.prototype.newNode=function(c){return new s(this.graphManager,c)},h.prototype.newEdge=function(c){return new o(null,null,c)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(n.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},h.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var c,d=this.graphManager.getAllEdges();for(var g=0;g<d.length;g++)c=d[g];var y,p=this.graphManager.getRoot().getNodes();for(var g=0;g<p.length;g++)y=p[g];this.update(this.graphManager.getRoot())}},h.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof s){var d=c;if(d.getChild()!=null){var g=d.getChild().getNodes();for(var y=0;y<g.length;y++)update(g[y])}if(d.vGraphObject!=null){var p=d.vGraphObject;p.update(d)}}else if(c instanceof o){var m=c;if(m.vGraphObject!=null){var b=m.vGraphObject;b.update(m)}}else if(c instanceof l){var E=c;if(E.vGraphObject!=null){var A=E.vGraphObject;A.update(E)}}},h.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=n.QUALITY,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=n.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},h.prototype.transform=function(c){if(c==null)this.transform(new u(0,0));else{var d=new f,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){d.setWorldOrgX(c.x),d.setWorldOrgY(c.y),d.setDeviceOrgX(g.x),d.setDeviceOrgY(g.y);var y=this.getAllNodes(),p;for(var m=0;m<y.length;m++)p=y[m],p.transform(d)}}},h.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,g,y=c.getNodes();for(var p=0;p<y.length;p++)if(d=y[p],g=d.getChild(),g==null)d.scatter();else if(g.getNodes().length==0)d.scatter();else this.positionNodesRandomly(g),d.updateBounds()}},h.prototype.getFlatForest=function(){var c=[],d=!0,g=this.graphManager.getRoot().getNodes(),y=!0;for(var p=0;p<g.length;p++)if(g[p].getChild()!=null)y=!1;if(!y)return c;var m=new Set,b=[],E=new Map,A=[];A=A.concat(g);while(A.length>0&&d){b.push(A[0]);while(b.length>0&&d){var M=b[0];b.splice(0,1),m.add(M);var S=M.getEdges();for(var p=0;p<S.length;p++){var P=S[p].getOtherEnd(M);if(E.get(M)!=P)if(!m.has(P))b.push(P),E.set(P,M);else{d=!1;break}}}if(!d)c=[];else{var N=[].concat(a(m));c.push(N);for(var p=0;p<N.length;p++){var R=N[p],I=A.indexOf(R);if(I>-1)A.splice(I,1)}m=new Set,E=new Map}}return c},h.prototype.createDummyNodesForBendpoints=function(c){var d=[],g=c.source,y=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var p=0;p<c.bendpoints.length;p++){var m=this.newNode(null);m.setRect(new Point(0,0),new Dimension(1,1)),y.add(m);var b=this.newEdge(null);this.graphManager.add(b,g,m),d.add(m),g=m}var b=this.newEdge(null);if(this.graphManager.add(b,g,c.target),this.edgeToDummyNodes.set(c,d),c.isInterGraph())this.graphManager.remove(c);else y.remove(c);return d},h.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(a(this.edgeToDummyNodes.keys())).concat(c);for(var d=0;d<c.length;d++){var g=c[d];if(g.bendpoints.length>0){var y=this.edgeToDummyNodes.get(g);for(var p=0;p<y.length;p++){var m=y[p],b=new u(m.getCenterX(),m.getCenterY()),E=g.bendpoints.get(p);E.x=b.x,E.y=b.y,m.getOwner().remove(m)}this.graphManager.add(g,g.source,g.target)}}},h.transform=function(c,d,g,y){if(g!=null&&y!=null){var p=d;if(c<=50){var m=d/g;p-=(d-m)/50*(50-c)}else{var b=d*y;p+=(b-d)/50*(c-50)}return p}else{var E,A;if(c<=50)E=9*d/500,A=d/10;else E=9*d/50,A=-8*d;return E*c+A}},h.findCenterOfTree=function(c){var d=[];d=d.concat(c);var g=[],y=new Map,p=!1,m=null;if(d.length==1||d.length==2)p=!0,m=d[0];for(var b=0;b<d.length;b++){var E=d[b],A=E.getNeighborsList().size;if(y.set(E,E.getNeighborsList().size),A==1)g.push(E)}var M=[];M=M.concat(g);while(!p){var S=[];S=S.concat(M),M=[];for(var b=0;b<d.length;b++){var E=d[b],P=d.indexOf(E);if(P>=0)d.splice(P,1);var N=E.getNeighborsList();N.forEach(function(w){if(g.indexOf(w)<0){var x=y.get(w),T=x-1;if(T==1)M.push(w);y.set(w,T)}})}if(g=g.concat(M),d.length==1||d.length==2)p=!0,m=d[0]}return m},h.prototype.setGraphManager=function(c){this.graphManager=c},t.exports=h},function(t,e,r){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a},function(t,e,r){var a=r(5);function n(i,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(i){this.lworldExtX=i},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(i){this.lworldExtY=i},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},n.prototype.transformX=function(i){var s=0,o=this.lworldExtX;if(o!=0)s=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/o;return s},n.prototype.transformY=function(i){var s=0,o=this.lworldExtY;if(o!=0)s=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/o;return s},n.prototype.inverseTransformX=function(i){var s=0,o=this.ldeviceExtX;if(o!=0)s=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/o;return s},n.prototype.inverseTransformY=function(i){var s=0,o=this.ldeviceExtY;if(o!=0)s=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/o;return s},n.prototype.inverseTransformPoint=function(i){var s=new a(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return s},t.exports=n},function(t,e,r){function a(v){if(Array.isArray(v)){for(var h=0,c=Array(v.length);h<v.length;h++)c[h]=v[h];return c}else return Array.from(v)}var n=r(15),i=r(4),s=r(0),o=r(8),l=r(9);function u(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}u.prototype=Object.create(n.prototype);for(var f in n)u[f]=n[f];u.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){var v,h,c,d,g,y,p,m=this.getGraphManager().getAllEdges();for(var b=0;b<m.length;b++)if(v=m[b],h=v.idealLength,v.isInterGraph){if(d=v.getSource(),g=v.getTarget(),y=v.getSourceInLca().getEstimatedSize(),p=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)v.idealLength+=y+p-2*s.SIMPLE_NODE_SIZE;c=v.getLca().getInclusionTreeDepth(),v.idealLength+=h*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c)}},u.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;if(this.incremental){if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){var v=this.getAllEdges(),h;for(var c=0;c<v.length;c++)h=v[c],this.calcSpringForce(h,h.idealLength)},u.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,d,g,y,p=this.getAllNodes(),m;if(this.useFRGridVariant){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&v)this.updateGrid();m=new Set;for(c=0;c<p.length;c++)g=p[c],this.calculateRepulsionForceOfANode(g,m,v,h),m.add(g)}else for(c=0;c<p.length;c++){g=p[c];for(d=c+1;d<p.length;d++){if(y=p[d],g.getOwner()!=y.getOwner())continue;this.calcRepulsionForce(g,y)}}},u.prototype.calcGravitationalForces=function(){var v,h=this.getAllNodesToApplyGravitation();for(var c=0;c<h.length;c++)v=h[c],this.calcGravitationalForce(v)},u.prototype.moveNodes=function(){var v=this.getAllNodes(),h;for(var c=0;c<v.length;c++)h=v[c],h.move()},u.prototype.calcSpringForce=function(v,h){var c=v.getSource(),d=v.getTarget(),g,y,p,m;if(this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;if(g=v.getLength(),g==0)return;y=v.edgeElasticity*(g-h),p=y*(v.lengthX/g),m=y*(v.lengthY/g),c.springForceX+=p,c.springForceY+=m,d.springForceX-=p,d.springForceY-=m},u.prototype.calcRepulsionForce=function(v,h){var c=v.getRect(),d=h.getRect(),g=[,,],y=[,,,,],p,m,b,E,A,M,S;if(c.intersects(d)){o.calcSeparationAmount(c,d,g,i.DEFAULT_EDGE_LENGTH/2),M=2*g[0],S=2*g[1];var P=v.noOfChildren*h.noOfChildren/(v.noOfChildren+h.noOfChildren);v.repulsionForceX-=P*M,v.repulsionForceY-=P*S,h.repulsionForceX+=P*M,h.repulsionForceY+=P*S}else{if(this.uniformLeafNodeSizes&&v.getChild()==null&&h.getChild()==null)p=d.getCenterX()-c.getCenterX(),m=d.getCenterY()-c.getCenterY();else o.getIntersection(c,d,y),p=y[2]-y[0],m=y[3]-y[1];if(Math.abs(p)<i.MIN_REPULSION_DIST)p=l.sign(p)*i.MIN_REPULSION_DIST;if(Math.abs(m)<i.MIN_REPULSION_DIST)m=l.sign(m)*i.MIN_REPULSION_DIST;b=p*p+m*m,E=Math.sqrt(b),A=(v.nodeRepulsion/2+h.nodeRepulsion/2)*v.noOfChildren*h.noOfChildren/b,M=A*p/E,S=A*m/E,v.repulsionForceX-=M,v.repulsionForceY-=S,h.repulsionForceX+=M,h.repulsionForceY+=S}},u.prototype.calcGravitationalForce=function(v){var h,c,d,g,y,p,m,b;if(h=v.getOwner(),c=(h.getRight()+h.getLeft())/2,d=(h.getTop()+h.getBottom())/2,g=v.getCenterX()-c,y=v.getCenterY()-d,p=Math.abs(g)+v.getWidth()/2,m=Math.abs(y)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()){if(b=h.getEstimatedSize()*this.gravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g,v.gravitationForceY=-this.gravityConstant*y}else if(b=h.getEstimatedSize()*this.compoundGravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant},u.prototype.isConverged=function(){var v,h=!1;if(this.totalIterations>this.maxIterations/3)h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||h},u.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},u.prototype.calcNoOfChildrenForAllNodes=function(){var v,h=this.graphManager.getAllNodes();for(var c=0;c<h.length;c++)v=h[c],v.noOfChildren=v.getNoOfChildren()},u.prototype.calcGrid=function(v){var h=0,c=0;h=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));var d=Array(h);for(var g=0;g<h;g++)d[g]=Array(c);for(var g=0;g<h;g++)for(var y=0;y<c;y++)d[g][y]=[];return d},u.prototype.addNodeToGrid=function(v,h,c){var d=0,g=0,y=0,p=0;d=parseInt(Math.floor((v.getRect().x-h)/this.repulsionRange)),g=parseInt(Math.floor((v.getRect().width+v.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((v.getRect().y-c)/this.repulsionRange)),p=parseInt(Math.floor((v.getRect().height+v.getRect().y-c)/this.repulsionRange));for(var m=d;m<=g;m++)for(var b=y;b<=p;b++)this.grid[m][b].push(v),v.setGridCoordinates(d,g,y,p)},u.prototype.updateGrid=function(){var v,h,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(v=0;v<c.length;v++)h=c[v],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(v,h,c,d){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var g=new Set;v.surrounding=[];var y,p=this.grid;for(var m=v.startX-1;m<v.finishX+2;m++)for(var b=v.startY-1;b<v.finishY+2;b++)if(!(m<0||b<0||m>=p.length||b>=p[0].length))for(var E=0;E<p[m][b].length;E++){if(y=p[m][b][E],v.getOwner()!=y.getOwner()||v==y)continue;if(!h.has(y)&&!g.has(y)){var A=Math.abs(v.getCenterX()-y.getCenterX())-(v.getWidth()/2+y.getWidth()/2),M=Math.abs(v.getCenterY()-y.getCenterY())-(v.getHeight()/2+y.getHeight()/2);if(A<=this.repulsionRange&&M<=this.repulsionRange)g.add(y)}}v.surrounding=[].concat(a(g))}for(m=0;m<v.surrounding.length;m++)this.calcRepulsionForce(v,v.surrounding[m])},u.prototype.calcRepulsionRange=function(){return 0},t.exports=u},function(t,e,r){var a=r(1),n=r(4);function i(o,l,u){a.call(this,o,l,u),this.idealLength=n.DEFAULT_EDGE_LENGTH,this.edgeElasticity=n.DEFAULT_SPRING_STRENGTH}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];t.exports=i},function(t,e,r){var a=r(3),n=r(4);function i(o,l,u,f){a.call(this,o,l,u,f),this.nodeRepulsion=n.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=[]}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];i.prototype.setGridCoordinates=function(o,l,u,f){this.startX=o,this.finishX=l,this.startY=u,this.finishY=f},t.exports=i},function(t,e,r){function a(n,i){if(this.width=0,this.height=0,n!==null&&i!==null)this.height=i,this.width=n}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},t.exports=a},function(t,e,r){var a=r(14);function n(){this.map={},this.keys=[]}n.prototype.put=function(i,s){var o=a.createID(i);if(!this.contains(o))this.map[o]=s,this.keys.push(i)},n.prototype.contains=function(i){var s=a.createID(i);return this.map[i]!=null},n.prototype.get=function(i){var s=a.createID(i);return this.map[s]},n.prototype.keySet=function(){return this.keys},t.exports=n},function(t,e,r){var a=r(14);function n(){this.set={}}n.prototype.add=function(i){var s=a.createID(i);if(!this.contains(s))this.set[s]=i},n.prototype.remove=function(i){delete this.set[a.createID(i)]},n.prototype.clear=function(){this.set={}},n.prototype.contains=function(i){return this.set[a.createID(i)]==i},n.prototype.isEmpty=function(){return this.size()===0},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAllTo=function(i){var s=Object.keys(this.set),o=s.length;for(var l=0;l<o;l++)i.push(this.set[s[l]])},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAll=function(i){var s=i.length;for(var o=0;o<s;o++){var l=i[o];this.add(l)}},t.exports=n},function(t,e,r){function a(){}a.multMat=function(n,i){var s=[];for(var o=0;o<n.length;o++){s[o]=[];for(var l=0;l<i[0].length;l++){s[o][l]=0;for(var u=0;u<n[0].length;u++)s[o][l]+=n[o][u]*i[u][l]}}return s},a.transpose=function(n){var i=[];for(var s=0;s<n[0].length;s++){i[s]=[];for(var o=0;o<n.length;o++)i[s][o]=n[o][s]}return i},a.multCons=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]*i;return s},a.minusOp=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]-i[o];return s},a.dotProduct=function(n,i){var s=0;for(var o=0;o<n.length;o++)s+=n[o]*i[o];return s},a.mag=function(n){return Math.sqrt(this.dotProduct(n,n))},a.normalize=function(n){var i=[],s=this.mag(n);for(var o=0;o<n.length;o++)i[o]=n[o]/s;return i},a.multGamma=function(n){var i=[],s=0;for(var o=0;o<n.length;o++)s+=n[o];s*=-1/n.length;for(var l=0;l<n.length;l++)i[l]=s+n[l];return i},a.multL=function(n,i,s){var o=[],l=[],u=[];for(var f=0;f<i[0].length;f++){var v=0;for(var h=0;h<i.length;h++)v+=-0.5*i[h][f]*n[h];l[f]=v}for(var c=0;c<s.length;c++){var d=0;for(var g=0;g<s.length;g++)d+=s[c][g]*l[g];u[c]=d}for(var y=0;y<i.length;y++){var p=0;for(var m=0;m<i[0].length;m++)p+=i[y][m]*u[m];o[y]=p}return o},t.exports=a},function(t,e,r){var a=function(){function o(l,u){for(var f=0;f<u.length;f++){var v=u[f];if(v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v)v.writable=!0;Object.defineProperty(l,v.key,v)}}return function(l,u,f){if(u)o(l.prototype,u);if(f)o(l,f);return l}}();function n(o,l){if(!(o instanceof l))throw TypeError("Cannot call a class as a function")}var i=r(11),s=function(){function o(l,u){if(n(this,o),u!==null||u!==void 0)this.compareFunction=this._defaultCompareFunction;var f=void 0;if(l instanceof i)f=l.size();else f=l.length;this._quicksort(l,0,f-1)}return a(o,[{key:"_quicksort",value:function(u,f,v){if(f<v){var h=this._partition(u,f,v);this._quicksort(u,f,h),this._quicksort(u,h+1,v)}}},{key:"_partition",value:function(u,f,v){var h=this._get(u,f),c=f,d=v;while(!0){while(this.compareFunction(h,this._get(u,d)))d--;while(this.compareFunction(this._get(u,c),h))c++;if(c<d)this._swap(u,c,d),c++,d--;else return d}}},{key:"_get",value:function(u,f){if(u instanceof i)return u.get_object_at(f);else return u[f]}},{key:"_set",value:function(u,f,v){if(u instanceof i)u.set_object_at(f,v);else u[f]=v}},{key:"_swap",value:function(u,f,v){var h=this._get(u,f);this._set(u,f,this._get(u,v)),this._set(u,v,h)}},{key:"_defaultCompareFunction",value:function(u,f){return f>u}}]),o}();t.exports=s},function(t,e,r){function a(){}a.svd=function(n){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=n.length,this.n=n[0].length;var i=Math.min(this.m,this.n);this.s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(Math.min(this.m+1,this.n)),this.U=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var dt=0;dt<Ye[0];dt++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.m,i]),this.V=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var dt=0;dt<Ye[0];dt++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.n,this.n]);var s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.n),o=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.m),l=!0,u=!0,f=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m));for(var h=0;h<Math.max(f,v);h++){if(h<f){this.s[h]=0;for(var c=h;c<this.m;c++)this.s[h]=a.hypot(this.s[h],n[c][h]);if(this.s[h]!==0){if(n[h][h]<0)this.s[h]=-this.s[h];for(var d=h;d<this.m;d++)n[d][h]/=this.s[h];n[h][h]+=1}this.s[h]=-this.s[h]}for(var g=h+1;g<this.n;g++){if(function(He,Le){return He&&Le}(h<f,this.s[h]!==0)){var y=0;for(var p=h;p<this.m;p++)y+=n[p][h]*n[p][g];y=-y/n[h][h];for(var m=h;m<this.m;m++)n[m][g]+=y*n[m][h]}s[g]=n[h][g]}if(function(He,Le){return He&&Le}(l,h<f))for(var b=h;b<this.m;b++)this.U[b][h]=n[b][h];if(h<v){s[h]=0;for(var E=h+1;E<this.n;E++)s[h]=a.hypot(s[h],s[E]);if(s[h]!==0){if(s[h+1]<0)s[h]=-s[h];for(var A=h+1;A<this.n;A++)s[A]/=s[h];s[h+1]+=1}if(s[h]=-s[h],function(He,Le){return He&&Le}(h+1<this.m,s[h]!==0)){for(var M=h+1;M<this.m;M++)o[M]=0;for(var S=h+1;S<this.n;S++)for(var P=h+1;P<this.m;P++)o[P]+=s[S]*n[P][S];for(var N=h+1;N<this.n;N++){var R=-s[N]/s[h+1];for(var I=h+1;I<this.m;I++)n[I][N]+=R*o[I]}}if(u)for(var w=h+1;w<this.n;w++)this.V[w][h]=s[w]}}var x=Math.min(this.n,this.m+1);if(f<this.n)this.s[f]=n[f][f];if(this.m<x)this.s[x-1]=0;if(v+1<x)s[v]=n[v][x-1];if(s[x-1]=0,l){for(var T=f;T<i;T++){for(var D=0;D<this.m;D++)this.U[D][T]=0;this.U[T][T]=1}for(var C=f-1;C>=0;C--)if(this.s[C]!==0){for(var O=C+1;O<i;O++){var B=0;for(var z=C;z<this.m;z++)B+=this.U[z][C]*this.U[z][O];B=-B/this.U[C][C];for(var V=C;V<this.m;V++)this.U[V][O]+=B*this.U[V][C]}for(var k=C;k<this.m;k++)this.U[k][C]=-this.U[k][C];this.U[C][C]=1+this.U[C][C];for(var G=0;G<C-1;G++)this.U[G][C]=0}else{for(var J=0;J<this.m;J++)this.U[J][C]=0;this.U[C][C]=1}}if(u)for(var X=this.n-1;X>=0;X--){if(function(He,Le){return He&&Le}(X<v,s[X]!==0))for(var _=X+1;_<i;_++){var Q=0;for(var q=X+1;q<this.n;q++)Q+=this.V[q][X]*this.V[q][_];Q=-Q/this.V[X+1][X];for(var te=X+1;te<this.n;te++)this.V[te][_]+=Q*this.V[te][X]}for(var Z=0;Z<this.n;Z++)this.V[Z][X]=0;this.V[X][X]=1}var U=x-1,W=0,j=Math.pow(2,-52),re=Math.pow(2,-966);while(x>0){var ee=void 0,de=void 0;for(ee=x-2;ee>=-1;ee--){if(ee===-1)break;if(Math.abs(s[ee])<=re+j*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){s[ee]=0;break}}if(ee===x-2)de=4;else{var Ae=void 0;for(Ae=x-1;Ae>=ee;Ae--){if(Ae===ee)break;var Te=(Ae!==x?Math.abs(s[Ae]):0)+(Ae!==ee+1?Math.abs(s[Ae-1]):0);if(Math.abs(this.s[Ae])<=re+j*Te){this.s[Ae]=0;break}}if(Ae===ee)de=3;else if(Ae===x-1)de=1;else de=2,ee=Ae}switch(ee++,de){case 1:{var Ce=s[x-2];s[x-2]=0;for(var ge=x-2;ge>=ee;ge--){var ve=a.hypot(this.s[ge],Ce),ye=this.s[ge]/ve,Ee=Ce/ve;if(this.s[ge]=ve,ge!==ee)Ce=-Ee*s[ge-1],s[ge-1]=ye*s[ge-1];if(u)for(var Pe=0;Pe<this.n;Pe++)ve=ye*this.V[Pe][ge]+Ee*this.V[Pe][x-1],this.V[Pe][x-1]=-Ee*this.V[Pe][ge]+ye*this.V[Pe][x-1],this.V[Pe][ge]=ve}}break;case 2:{var Me=s[ee-1];s[ee-1]=0;for(var Ne=ee;Ne<x;Ne++){var Fe=a.hypot(this.s[Ne],Me),ze=this.s[Ne]/Fe,Ue=Me/Fe;if(this.s[Ne]=Fe,Me=-Ue*s[Ne],s[Ne]=ze*s[Ne],l)for(var ie=0;ie<this.m;ie++)Fe=ze*this.U[ie][Ne]+Ue*this.U[ie][ee-1],this.U[ie][ee-1]=-Ue*this.U[ie][Ne]+ze*this.U[ie][ee-1],this.U[ie][Ne]=Fe}}break;case 3:{var L=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[x-1]),Math.abs(this.s[x-2])),Math.abs(s[x-2])),Math.abs(this.s[ee])),Math.abs(s[ee])),F=this.s[x-1]/L,Y=this.s[x-2]/L,H=s[x-2]/L,K=this.s[ee]/L,se=s[ee]/L,ae=((Y+F)*(Y-F)+H*H)/2,oe=F*H*(F*H),ne=0;if(function(He,Le){return He||Le}(ae!==0,oe!==0)){if(ne=Math.sqrt(ae*ae+oe),ae<0)ne=-ne;ne=oe/(ae+ne)}var ue=(K+F)*(K-F)+ne,be=K*se;for(var fe=ee;fe<x-1;fe++){var le=a.hypot(ue,be),De=ue/le,ce=be/le;if(fe!==ee)s[fe-1]=le;if(ue=De*this.s[fe]+ce*s[fe],s[fe]=De*s[fe]-ce*this.s[fe],be=ce*this.s[fe+1],this.s[fe+1]=De*this.s[fe+1],u)for(var pe=0;pe<this.n;pe++)le=De*this.V[pe][fe]+ce*this.V[pe][fe+1],this.V[pe][fe+1]=-ce*this.V[pe][fe]+De*this.V[pe][fe+1],this.V[pe][fe]=le;if(le=a.hypot(ue,be),De=ue/le,ce=be/le,this.s[fe]=le,ue=De*s[fe]+ce*this.s[fe+1],this.s[fe+1]=-ce*s[fe]+De*this.s[fe+1],be=ce*s[fe+1],s[fe+1]=De*s[fe+1],l&&fe<this.m-1)for(var Ie=0;Ie<this.m;Ie++)le=De*this.U[Ie][fe]+ce*this.U[Ie][fe+1],this.U[Ie][fe+1]=-ce*this.U[Ie][fe]+De*this.U[Ie][fe+1],this.U[Ie][fe]=le}s[x-2]=ue,W=W+1}break;case 4:{if(this.s[ee]<=0){if(this.s[ee]=this.s[ee]<0?-this.s[ee]:0,u)for(var xe=0;xe<=U;xe++)this.V[xe][ee]=-this.V[xe][ee]}while(ee<U){if(this.s[ee]>=this.s[ee+1])break;var me=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=me,u&&ee<this.n-1)for(var Ve=0;Ve<this.n;Ve++)me=this.V[Ve][ee+1],this.V[Ve][ee+1]=this.V[Ve][ee],this.V[Ve][ee]=me;if(l&&ee<this.m-1)for(var Be=0;Be<this.m;Be++)me=this.U[Be][ee+1],this.U[Be][ee+1]=this.U[Be][ee],this.U[Be][ee]=me;ee++}W=0,x--}break}}var Ke={U:this.U,V:this.V,S:this.s};return Ke},a.hypot=function(n,i){var s=void 0;if(Math.abs(n)>Math.abs(i))s=i/n,s=Math.abs(n)*Math.sqrt(1+s*s);else if(i!=0)s=n/i,s=Math.abs(i)*Math.sqrt(1+s*s);else s=0;return s},t.exports=a},function(t,e,r){var a=function(){function s(o,l){for(var u=0;u<l.length;u++){var f=l[u];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(o,f.key,f)}}return function(o,l,u){if(l)s(o.prototype,l);if(u)s(o,u);return o}}();function n(s,o){if(!(s instanceof o))throw TypeError("Cannot call a class as a function")}var i=function(){function s(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;n(this,s),this.sequence1=o,this.sequence2=l,this.match_score=u,this.mismatch_penalty=f,this.gap_penalty=v,this.iMax=o.length+1,this.jMax=l.length+1,this.grid=Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[h][c]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[d][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var l=1;l<this.jMax;l++)this.grid[0][l]=this.grid[0][l-1]+this.gap_penalty,this.tracebackGrid[0][l]=[!1,!1,!0];for(var u=1;u<this.iMax;u++)this.grid[u][0]=this.grid[u-1][0]+this.gap_penalty,this.tracebackGrid[u][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var v=1;v<this.jMax;v++){var h=void 0;if(this.sequence1[f-1]===this.sequence2[v-1])h=this.grid[f-1][v-1]+this.match_score;else h=this.grid[f-1][v-1]+this.mismatch_penalty;var c=this.grid[f-1][v]+this.gap_penalty,d=this.grid[f][v-1]+this.gap_penalty,g=[h,c,d],y=this.arrayAllMaxIndexes(g);this.grid[f][v]=g[y[0]],this.tracebackGrid[f][v]=[y.includes(0),y.includes(1),y.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var l=[];l.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(l[0]){var u=l[0],f=this.tracebackGrid[u.pos[0]][u.pos[1]];if(f[0])l.push({pos:[u.pos[0]-1,u.pos[1]-1],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(f[1])l.push({pos:[u.pos[0]-1,u.pos[1]],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:"-"+u.seq2});if(f[2])l.push({pos:[u.pos[0],u.pos[1]-1],seq1:"-"+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(u.pos[0]===0&&u.pos[1]===0)this.alignments.push({sequence1:u.seq1,sequence2:u.seq2});l.shift()}return this.alignments}},{key:"getAllIndexes",value:function(l,u){var f=[],v=-1;while((v=l.indexOf(u,v+1))!==-1)f.push(v);return f}},{key:"arrayAllMaxIndexes",value:function(l){return this.getAllIndexes(l,Math.max.apply(null,l))}}]),s}();t.exports=i},function(t,e,r){var a=function(){return};a.FDLayout=r(18),a.FDLayoutConstants=r(4),a.FDLayoutEdge=r(19),a.FDLayoutNode=r(20),a.DimensionD=r(21),a.HashMap=r(22),a.HashSet=r(23),a.IGeometry=r(8),a.IMath=r(9),a.Integer=r(10),a.Point=r(12),a.PointD=r(5),a.RandomSeed=r(16),a.RectangleD=r(13),a.Transform=r(17),a.UniqueIDGeneretor=r(14),a.Quicksort=r(25),a.LinkedList=r(11),a.LGraphObject=r(2),a.LGraph=r(6),a.LEdge=r(1),a.LGraphManager=r(7),a.LNode=r(3),a.Layout=r(15),a.LayoutConstants=r(0),a.NeedlemanWunsch=r(27),a.Matrix=r(24),a.SVD=r(26),t.exports=a},function(t,e,r){function a(){this.listeners=[]}var n=a.prototype;n.addListener=function(i,s){this.listeners.push({event:i,callback:s})},n.removeListener=function(i,s){for(var o=this.listeners.length;o>=0;o--){var l=this.listeners[o];if(l.event===i&&l.callback===s)this.listeners.splice(o,1)}},n.emit=function(i,s){for(var o=0;o<this.listeners.length;o++){var l=this.listeners[o];if(i===l.event)l.callback(s)}},t.exports=a}])})});var sr=Se(function(un,zo){(function(e,r){if(typeof un==="object"&&typeof zo==="object")zo.exports=r(Fo());else if(typeof define==="function"&&define.amd)define(["layout-base"],r);else if(typeof un==="object")un.coseBase=r(Fo());else e.coseBase=r(e.layoutBase)})(un,function(t){return(()=>{var e={45:(i,s,o)=>{var l={};l.layoutBase=o(551),l.CoSEConstants=o(806),l.CoSEEdge=o(767),l.CoSEGraph=o(880),l.CoSEGraphManager=o(578),l.CoSELayout=o(765),l.CoSENode=o(991),l.ConstraintHandler=o(902),i.exports=l},806:(i,s,o)=>{var l=o(551).FDLayoutConstants;function u(){}for(var f in l)u[f]=l[f];u.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,u.DEFAULT_COMPONENT_SEPERATION=60,u.TILE=!0,u.TILING_PADDING_VERTICAL=10,u.TILING_PADDING_HORIZONTAL=10,u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0,u.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,u.TREE_REDUCTION_ON_INCREMENTAL=!0,u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL,i.exports=u},767:(i,s,o)=>{var l=o(551).FDLayoutEdge;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},880:(i,s,o)=>{var l=o(551).LGraph;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},578:(i,s,o)=>{var l=o(551).LGraphManager;function u(v){l.call(this,v)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},765:(i,s,o)=>{var l=o(551).FDLayout,u=o(578),f=o(880),v=o(991),h=o(767),c=o(806),d=o(902),g=o(551).FDLayoutConstants,y=o(551).LayoutConstants,p=o(551).Point,m=o(551).PointD,b=o(551).DimensionD,E=o(551).Layout,A=o(551).Integer,M=o(551).IGeometry,S=o(551).LGraph,P=o(551).Transform,N=o(551).LinkedList;function R(){l.call(this),this.toBeTiled={},this.constraints={}}R.prototype=Object.create(l.prototype);for(var I in l)R[I]=l[I];R.prototype.newGraphManager=function(){var w=new u(this);return this.graphManager=w,w},R.prototype.newGraph=function(w){return new f(null,this.graphManager,w)},R.prototype.newNode=function(w){return new v(this.graphManager,w)},R.prototype.newEdge=function(w){return new h(null,null,w)},R.prototype.initParameters=function(){if(l.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},R.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},R.prototype.layout=function(){var w=y.DEFAULT_CREATE_BENDS_AS_NEEDED;if(w)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},R.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){var w=this.getFlatForest();if(w.length>0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(D){return x.has(D)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(O){return x.has(O)});this.graphManager.setAllNodesToApplyGravitation(T)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},R.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)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 w=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(C){return w.has(C)});if(this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},R.prototype.getPositionsData=function(){var w=this.graphManager.getAllNodes(),x={};for(var T=0;T<w.length;T++){var D=w[T].rect,C=w[T].id;x[C]={id:C,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return x},R.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var w=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{while(!w)w=this.tick();this.graphManager.updateBounds()}},R.prototype.moveNodes=function(){var w=this.getAllNodes(),x;for(var T=0;T<w.length;T++)x=w[T],x.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var T=0;T<w.length;T++)x=w[T],x.move()},R.prototype.initConstraintVariables=function(){var w=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var x=this.graphManager.getAllNodes();for(var T=0;T<x.length;T++){var D=x[T];this.idToNodeMap.set(D.id,D)}var C=function q(te){var Z=te.getChild().getNodes(),U,W=0;for(var j=0;j<Z.length;j++)if(U=Z[j],U.getChild()==null){if(w.fixedNodeSet.has(U.id))W+=100}else W+=q(U);return W};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){w.fixedNodeSet.add(Z.nodeId)});var x=this.graphManager.getAllNodes(),D;for(var T=0;T<x.length;T++)if(D=x[T],D.getChild()!=null){var O=C(D);if(O>0)D.fixedNodeWeight=O}}if(this.constraints.relativePlacementConstraint){var B=new Map,z=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(q){w.fixedNodesOnHorizontal.add(q),w.fixedNodesOnVertical.add(q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var V=this.constraints.alignmentConstraint.vertical;for(var T=0;T<V.length;T++)this.dummyToNodeForVerticalAlignment.set("dummy"+T,[]),V[T].forEach(function(te){if(B.set(te,"dummy"+T),w.dummyToNodeForVerticalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnHorizontal.add("dummy"+T)})}if(this.constraints.alignmentConstraint.horizontal){var k=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<k.length;T++)this.dummyToNodeForHorizontalAlignment.set("dummy"+T,[]),k[T].forEach(function(te){if(z.set(te,"dummy"+T),w.dummyToNodeForHorizontalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnVertical.add("dummy"+T)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(q){var te,Z,U;for(U=q.length-1;U>=2*q.length/3;U--)te=Math.floor(Math.random()*(U+1)),Z=q[U],q[U]=q[te],q[te]=Z;return q},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(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(!w.nodesInRelativeHorizontal.includes(te))if(w.nodesInRelativeHorizontal.push(te),w.nodeToRelativeConstraintMapHorizontal.set(te,[]),w.dummyToNodeForVerticalAlignment.has(te))w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(te).getCenterX());if(!w.nodesInRelativeHorizontal.includes(Z))if(w.nodesInRelativeHorizontal.push(Z),w.nodeToRelativeConstraintMapHorizontal.set(Z,[]),w.dummyToNodeForVerticalAlignment.has(Z))w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(Z).getCenterX());w.nodeToRelativeConstraintMapHorizontal.get(te).push({right:Z,gap:q.gap}),w.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:te,gap:q.gap})}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(!w.nodesInRelativeVertical.includes(U))if(w.nodesInRelativeVertical.push(U),w.nodeToRelativeConstraintMapVertical.set(U,[]),w.dummyToNodeForHorizontalAlignment.has(U))w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(U).getCenterY());if(!w.nodesInRelativeVertical.includes(W))if(w.nodesInRelativeVertical.push(W),w.nodeToRelativeConstraintMapVertical.set(W,[]),w.dummyToNodeForHorizontalAlignment.has(W))w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(W)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(W).getCenterY());w.nodeToRelativeConstraintMapVertical.get(U).push({bottom:W,gap:q.gap}),w.nodeToRelativeConstraintMapVertical.get(W).push({top:U,gap:q.gap})}});else{var G=new Map,J=new Map;this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(G.has(te))G.get(te).push(Z);else G.set(te,[Z]);if(G.has(Z))G.get(Z).push(te);else G.set(Z,[te])}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(J.has(U))J.get(U).push(W);else J.set(U,[W]);if(J.has(W))J.get(W).push(U);else J.set(W,[U])}});var X=function(te,Z){var U=[],W=[],j=new N,re=new Set,ee=0;return te.forEach(function(de,Ae){if(!re.has(Ae)){U[ee]=[],W[ee]=!1;var Te=Ae;j.push(Te),re.add(Te),U[ee].push(Te);while(j.length!=0){if(Te=j.shift(),Z.has(Te))W[ee]=!0;var Ce=te.get(Te);Ce.forEach(function(ge){if(!re.has(ge))j.push(ge),re.add(ge),U[ee].push(ge)})}ee++}}),{components:U,isFixed:W}},_=X(G,w.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var Q=X(J,w.fixedNodesOnVertical);this.componentsOnVertical=Q.components,this.fixedComponentsOnVertical=Q.isFixed}}},R.prototype.updateDisplacements=function(){var w=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(Q){var q=w.idToNodeMap.get(Q.nodeId);q.displacementX=0,q.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var x=this.constraints.alignmentConstraint.vertical;for(var T=0;T<x.length;T++){var D=0;for(var C=0;C<x[T].length;C++){if(this.fixedNodeSet.has(x[T][C])){D=0;break}D+=this.idToNodeMap.get(x[T][C]).displacementX}var O=D/x[T].length;for(var C=0;C<x[T].length;C++)this.idToNodeMap.get(x[T][C]).displacementX=O}}if(this.constraints.alignmentConstraint.horizontal){var B=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<B.length;T++){var z=0;for(var C=0;C<B[T].length;C++){if(this.fixedNodeSet.has(B[T][C])){z=0;break}z+=this.idToNodeMap.get(B[T][C]).displacementY}var V=z/B[T].length;for(var C=0;C<B[T].length;C++)this.idToNodeMap.get(B[T][C]).displacementY=V}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForVerticalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Q)[0]).displacementX;else q=w.idToNodeMap.get(Q).displacementX;if(w.nodeToRelativeConstraintMapHorizontal.get(Q).forEach(function(te){if(te.right){var Z=w.nodeToTempPositionMapHorizontal.get(te.right)-w.nodeToTempPositionMapHorizontal.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapHorizontal.get(Q)-w.nodeToTempPositionMapHorizontal.get(te.left)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapHorizontal.set(Q,w.nodeToTempPositionMapHorizontal.get(Q)+q),w.dummyToNodeForVerticalAlignment.has(Q))w.dummyToNodeForVerticalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementX=q});else w.idToNodeMap.get(Q).displacementX=q}}),this.nodesInRelativeVertical.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForHorizontalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(Q)[0]).displacementY;else q=w.idToNodeMap.get(Q).displacementY;if(w.nodeToRelativeConstraintMapVertical.get(Q).forEach(function(te){if(te.bottom){var Z=w.nodeToTempPositionMapVertical.get(te.bottom)-w.nodeToTempPositionMapVertical.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapVertical.get(Q)-w.nodeToTempPositionMapVertical.get(te.top)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapVertical.set(Q,w.nodeToTempPositionMapVertical.get(Q)+q),w.dummyToNodeForHorizontalAlignment.has(Q))w.dummyToNodeForHorizontalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementY=q});else w.idToNodeMap.get(Q).displacementY=q}})}else{for(var T=0;T<this.componentsOnHorizontal.length;T++){var k=this.componentsOnHorizontal[T];if(this.fixedComponentsOnHorizontal[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=0});else this.idToNodeMap.get(k[C]).displacementX=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C])){var X=this.dummyToNodeForVerticalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementX,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementX,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=_});else this.idToNodeMap.get(k[C]).displacementX=_}}for(var T=0;T<this.componentsOnVertical.length;T++){var k=this.componentsOnVertical[T];if(this.fixedComponentsOnVertical[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(Z){w.idToNodeMap.get(Z).displacementY=0});else this.idToNodeMap.get(k[C]).displacementY=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C])){var X=this.dummyToNodeForHorizontalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementY,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementY,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(j){w.idToNodeMap.get(j).displacementY=_});else this.idToNodeMap.get(k[C]).displacementY=_}}}},R.prototype.calculateNodesToApplyGravitationTo=function(){var w=[],x,T=this.graphManager.getGraphs(),D=T.length,C;for(C=0;C<D;C++)if(x=T[C],x.updateConnected(),!x.isConnected)w=w.concat(x.getNodes());return w},R.prototype.createBendpoints=function(){var w=[];w=w.concat(this.graphManager.getAllEdges());var x=new Set,T;for(T=0;T<w.length;T++){var D=w[T];if(!x.has(D)){var C=D.getSource(),O=D.getTarget();if(C==O)D.getBendpoints().push(new m),D.getBendpoints().push(new m),this.createDummyNodesForBendpoints(D),x.add(D);else{var B=[];if(B=B.concat(C.getEdgeListToNode(O)),B=B.concat(O.getEdgeListToNode(C)),!x.has(B[0])){if(B.length>1){var z;for(z=0;z<B.length;z++){var V=B[z];V.getBendpoints().push(new m),this.createDummyNodesForBendpoints(V)}}B.forEach(function(k){x.add(k)})}}}if(x.size==w.length)break}},R.prototype.positionNodesRadially=function(w){var x=new p(0,0),T=Math.ceil(Math.sqrt(w.length)),D=0,C=0,O=0,B=new m(0,0);for(var z=0;z<w.length;z++){if(z%T==0){if(O=0,C=D,z!=0)C+=c.DEFAULT_COMPONENT_SEPERATION;D=0}var V=w[z],k=E.findCenterOfTree(V);if(x.x=O,x.y=C,B=R.radialLayout(V,k,x),B.y>D)D=Math.floor(B.y);O=Math.floor(B.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(y.WORLD_CENTER_X-B.x/2,y.WORLD_CENTER_Y-B.y/2))},R.radialLayout=function(w,x,T){var D=Math.max(this.maxDiagonalInTree(w),c.DEFAULT_RADIAL_SEPARATION);R.branchRadialLayout(x,null,0,359,0,D);var C=S.calculateBounds(w),O=new P;O.setDeviceOrgX(C.getMinX()),O.setDeviceOrgY(C.getMinY()),O.setWorldOrgX(T.x),O.setWorldOrgY(T.y);for(var B=0;B<w.length;B++){var z=w[B];z.transform(O)}var V=new m(C.getMaxX(),C.getMaxY());return O.inverseTransformPoint(V)},R.branchRadialLayout=function(w,x,T,D,C,O){var B=(D-T+1)/2;if(B<0)B+=180;var z=(B+T)%360,V=z*M.TWO_PI/360,k=Math.cos(V),G=C*Math.cos(V),J=C*Math.sin(V);w.setCenter(G,J);var X=[];X=X.concat(w.getEdges());var _=X.length;if(x!=null)_--;var Q=0,q=X.length,te,Z=w.getEdgesBetween(x);while(Z.length>1){var U=Z[0];Z.splice(0,1);var W=X.indexOf(U);if(W>=0)X.splice(W,1);q--,_--}if(x!=null)te=(X.indexOf(Z[0])+1)%q;else te=0;var j=Math.abs(D-T)/_;for(var re=te;Q!=_;re=++re%q){var ee=X[re].getOtherEnd(w);if(ee==x)continue;var de=(T+Q*j)%360,Ae=(de+j)%360;R.branchRadialLayout(ee,w,de,Ae,C+O,O),Q++}},R.maxDiagonalInTree=function(w){var x=A.MIN_VALUE;for(var T=0;T<w.length;T++){var D=w[T],C=D.getDiagonal();if(C>x)x=C}return x},R.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},R.prototype.groupZeroDegreeMembers=function(){var w=this,x={};this.memberGroups={},this.idToDummyNode={};var T=[],D=this.graphManager.getAllNodes();for(var C=0;C<D.length;C++){var O=D[C],B=O.getParent();if(this.getNodeDegreeWithChildren(O)===0&&(B.id==null||!this.getToBeTiled(B)))T.push(O)}for(var C=0;C<T.length;C++){var O=T[C],z=O.getParent().id;if(typeof x[z]>"u")x[z]=[];x[z]=x[z].concat(O)}Object.keys(x).forEach(function(V){if(x[V].length>1){var k="DummyCompound_"+V;w.memberGroups[k]=x[V];var G=x[V][0].getParent(),J=new v(w.graphManager);J.id=k,J.paddingLeft=G.paddingLeft||0,J.paddingRight=G.paddingRight||0,J.paddingBottom=G.paddingBottom||0,J.paddingTop=G.paddingTop||0,w.idToDummyNode[k]=J;var X=w.getGraphManager().add(w.newGraph(),J),_=G.getChild();_.add(J);for(var Q=0;Q<x[V].length;Q++){var q=x[V][Q];_.remove(q),X.add(q)}}})},R.prototype.clearCompounds=function(){var w={},x={};this.performDFSOnCompounds();for(var T=0;T<this.compoundOrder.length;T++)x[this.compoundOrder[T].id]=this.compoundOrder[T],w[this.compoundOrder[T].id]=[].concat(this.compoundOrder[T].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[T].getChild()),this.compoundOrder[T].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(w,x)},R.prototype.clearZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(T){var D=w.idToDummyNode[T];if(x[T]=w.tileNodes(w.memberGroups[T],D.paddingLeft+D.paddingRight),D.rect.width=x[T].width,D.rect.height=x[T].height,D.setCenter(x[T].centerX,x[T].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var C=D.rect.width,O=D.rect.height;if(D.labelWidth){if(D.labelPosHorizontal=="left")D.rect.x-=D.labelWidth,D.setWidth(C+D.labelWidth),D.labelMarginLeft=D.labelWidth;else if(D.labelPosHorizontal=="center"&&D.labelWidth>C)D.rect.x-=(D.labelWidth-C)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-C)/2;else if(D.labelPosHorizontal=="right")D.setWidth(C+D.labelWidth)}if(D.labelHeight){if(D.labelPosVertical=="top")D.rect.y-=D.labelHeight,D.setHeight(O+D.labelHeight),D.labelMarginTop=D.labelHeight;else if(D.labelPosVertical=="center"&&D.labelHeight>O)D.rect.y-=(D.labelHeight-O)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-O)/2;else if(D.labelPosVertical=="bottom")D.setHeight(O+D.labelHeight)}}})},R.prototype.repopulateCompounds=function(){for(var w=this.compoundOrder.length-1;w>=0;w--){var x=this.compoundOrder[w],{id:T,paddingLeft:D,paddingTop:C,labelMarginLeft:O,labelMarginTop:B}=x;this.adjustLocations(this.tiledMemberPack[T],x.rect.x,x.rect.y,D,C,O,B)}},R.prototype.repopulateZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(T){var D=w.idToDummyNode[T],{paddingLeft:C,paddingTop:O,labelMarginLeft:B,labelMarginTop:z}=D;w.adjustLocations(x[T],D.rect.x,D.rect.y,C,O,B,z)})},R.prototype.getToBeTiled=function(w){var x=w.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var T=w.getChild();if(T==null)return this.toBeTiled[x]=!1,!1;var D=T.getNodes();for(var C=0;C<D.length;C++){var O=D[C];if(this.getNodeDegree(O)>0)return this.toBeTiled[x]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},R.prototype.getNodeDegree=function(w){var x=w.id,T=w.getEdges(),D=0;for(var C=0;C<T.length;C++){var O=T[C];if(O.getSource().id!==O.getTarget().id)D=D+1}return D},R.prototype.getNodeDegreeWithChildren=function(w){var x=this.getNodeDegree(w);if(w.getChild()==null)return x;var T=w.getChild().getNodes();for(var D=0;D<T.length;D++){var C=T[D];x+=this.getNodeDegreeWithChildren(C)}return x},R.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},R.prototype.fillCompexOrderByDFS=function(w){for(var x=0;x<w.length;x++){var T=w[x];if(T.getChild()!=null)this.fillCompexOrderByDFS(T.getChild().getNodes());if(this.getToBeTiled(T))this.compoundOrder.push(T)}},R.prototype.adjustLocations=function(w,x,T,D,C,O,B){x+=D+O,T+=C+B;var z=x;for(var V=0;V<w.rows.length;V++){var k=w.rows[V];x=z;var G=0;for(var J=0;J<k.length;J++){var X=k[J];if(X.rect.x=x,X.rect.y=T,x+=X.rect.width+w.horizontalPadding,X.rect.height>G)G=X.rect.height}T+=G+w.verticalPadding}},R.prototype.tileCompoundMembers=function(w,x){var T=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(D){var C=x[D];if(T.tiledMemberPack[D]=T.tileNodes(w[D],C.paddingLeft+C.paddingRight),C.rect.width=T.tiledMemberPack[D].width,C.rect.height=T.tiledMemberPack[D].height,C.setCenter(T.tiledMemberPack[D].centerX,T.tiledMemberPack[D].centerY),C.labelMarginLeft=0,C.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var O=C.rect.width,B=C.rect.height;if(C.labelWidth){if(C.labelPosHorizontal=="left")C.rect.x-=C.labelWidth,C.setWidth(O+C.labelWidth),C.labelMarginLeft=C.labelWidth;else if(C.labelPosHorizontal=="center"&&C.labelWidth>O)C.rect.x-=(C.labelWidth-O)/2,C.setWidth(C.labelWidth),C.labelMarginLeft=(C.labelWidth-O)/2;else if(C.labelPosHorizontal=="right")C.setWidth(O+C.labelWidth)}if(C.labelHeight){if(C.labelPosVertical=="top")C.rect.y-=C.labelHeight,C.setHeight(B+C.labelHeight),C.labelMarginTop=C.labelHeight;else if(C.labelPosVertical=="center"&&C.labelHeight>B)C.rect.y-=(C.labelHeight-B)/2,C.setHeight(C.labelHeight),C.labelMarginTop=(C.labelHeight-B)/2;else if(C.labelPosVertical=="bottom")C.setHeight(B+C.labelHeight)}}})},R.prototype.tileNodes=function(w,x){var T=this.tileNodesByFavoringDim(w,x,!0),D=this.tileNodesByFavoringDim(w,x,!1),C=this.getOrgRatio(T),O=this.getOrgRatio(D),B;if(O<C)B=D;else B=T;return B},R.prototype.getOrgRatio=function(w){var{width:x,height:T}=w,D=x/T;if(D<1)D=1/D;return D},R.prototype.calcIdealRowWidth=function(w,x){var{TILING_PADDING_VERTICAL:T,TILING_PADDING_HORIZONTAL:D}=c,C=w.length,O=0,B=0,z=0;w.forEach(function(Q){if(O+=Q.getWidth(),B+=Q.getHeight(),Q.getWidth()>z)z=Q.getWidth()});var V=O/C,k=B/C,G=Math.pow(T-D,2)+4*(V+D)*(k+T)*C,J=(D-T+Math.sqrt(G))/(2*(V+D)),X;if(x){if(X=Math.ceil(J),X==J)X++}else X=Math.floor(J);var _=X*(V+D)-D;if(z>_)_=z;return _+=D*2,_},R.prototype.tileNodesByFavoringDim=function(w,x,T){var{TILING_PADDING_VERTICAL:D,TILING_PADDING_HORIZONTAL:C,TILING_COMPARE_BY:O}=c,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:D,horizontalPadding:C,centerX:0,centerY:0};if(O)B.idealRowWidth=this.calcIdealRowWidth(w,T);var z=function(q){return q.rect.width*q.rect.height},V=function(q,te){return z(te)-z(q)};w.sort(function(Q,q){var te=V;if(B.idealRowWidth)return te=O,te(Q.id,q.id);return te(Q,q)});var k=0,G=0;for(var J=0;J<w.length;J++){var X=w[J];k+=X.getCenterX(),G+=X.getCenterY()}B.centerX=k/w.length,B.centerY=G/w.length;for(var J=0;J<w.length;J++){var X=w[J];if(B.rows.length==0)this.insertNodeToRow(B,X,0,x);else if(this.canAddHorizontal(B,X.rect.width,X.rect.height)){var _=B.rows.length-1;if(!B.idealRowWidth)_=this.getShortestRowIndex(B);this.insertNodeToRow(B,X,_,x)}else this.insertNodeToRow(B,X,B.rows.length,x);this.shiftToLastRow(B)}return B},R.prototype.insertNodeToRow=function(w,x,T,D){var C=D;if(T==w.rows.length){var O=[];w.rows.push(O),w.rowWidth.push(C),w.rowHeight.push(0)}var B=w.rowWidth[T]+x.rect.width;if(w.rows[T].length>0)B+=w.horizontalPadding;if(w.rowWidth[T]=B,w.width<B)w.width=B;var z=x.rect.height;if(T>0)z+=w.verticalPadding;var V=0;if(z>w.rowHeight[T])V=w.rowHeight[T],w.rowHeight[T]=z,V=w.rowHeight[T]-V;w.height+=V,w.rows[T].push(x)},R.prototype.getShortestRowIndex=function(w){var x=-1,T=Number.MAX_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]<T)x=D,T=w.rowWidth[D];return x},R.prototype.getLongestRowIndex=function(w){var x=-1,T=Number.MIN_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]>T)x=D,T=w.rowWidth[D];return x},R.prototype.canAddHorizontal=function(w,x,T){if(w.idealRowWidth){var D=w.rows.length-1,C=w.rowWidth[D];return C+x+w.horizontalPadding<=w.idealRowWidth}var O=this.getShortestRowIndex(w);if(O<0)return!0;var B=w.rowWidth[O];if(B+w.horizontalPadding+x<=w.width)return!0;var z=0;if(w.rowHeight[O]<T){if(O>0)z=T+w.verticalPadding-w.rowHeight[O]}var V;if(w.width-B>=x+w.horizontalPadding)V=(w.height+z)/(B+x+w.horizontalPadding);else V=(w.height+z)/w.width;z=T+w.verticalPadding;var k;if(w.width<x)k=(w.height+z)/x;else k=(w.height+z)/w.width;if(k<1)k=1/k;if(V<1)V=1/V;return V<k},R.prototype.shiftToLastRow=function(w){var x=this.getLongestRowIndex(w),T=w.rowWidth.length-1,D=w.rows[x],C=D[D.length-1],O=C.width+w.horizontalPadding;if(w.width-w.rowWidth[T]>O&&x!=T){D.splice(-1,1),w.rows[T].push(C),w.rowWidth[x]=w.rowWidth[x]-O,w.rowWidth[T]=w.rowWidth[T]+O,w.width=w.rowWidth[instance.getLongestRowIndex(w)];var B=Number.MIN_VALUE;for(var z=0;z<D.length;z++)if(D[z].height>B)B=D[z].height;if(x>0)B+=w.verticalPadding;var V=w.rowHeight[x]+w.rowHeight[T];if(w.rowHeight[x]=B,w.rowHeight[T]<C.height+w.verticalPadding)w.rowHeight[T]=C.height+w.verticalPadding;var k=w.rowHeight[x]+w.rowHeight[T];w.height+=k-V,this.shiftToLastRow(w)}},R.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},R.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},R.prototype.reduceTrees=function(){var w=[],x=!0,T;while(x){var D=this.graphManager.getAllNodes(),C=[];x=!1;for(var O=0;O<D.length;O++)if(T=D[O],T.getEdges().length==1&&!T.getEdges()[0].isInterGraph&&T.getChild()==null){if(c.PURE_INCREMENTAL){var B=T.getEdges()[0].getOtherEnd(T),z=new b(T.getCenterX()-B.getCenterX(),T.getCenterY()-B.getCenterY());C.push([T,T.getEdges()[0],T.getOwner(),z])}else C.push([T,T.getEdges()[0],T.getOwner()]);x=!0}if(x==!0){var V=[];for(var k=0;k<C.length;k++)if(C[k][0].getEdges().length==1)V.push(C[k]),C[k][0].getOwner().remove(C[k][0]);w.push(V),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=w},R.prototype.growTree=function(w){var x=w.length,T=w[x-1],D;for(var C=0;C<T.length;C++)D=T[C],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);w.splice(w.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},R.prototype.findPlaceforPrunedNode=function(w){var x,T,D=w[0];if(D==w[1].source)T=w[1].target;else T=w[1].source;if(c.PURE_INCREMENTAL)D.setCenter(T.getCenterX()+w[3].getWidth(),T.getCenterY()+w[3].getHeight());else{var C=T.startX,O=T.finishX,B=T.startY,z=T.finishY,V=0,k=0,G=0,J=0,X=[V,G,k,J];if(B>0)for(var _=C;_<=O;_++)X[0]+=this.grid[_][B-1].length+this.grid[_][B].length-1;if(O<this.grid.length-1)for(var _=B;_<=z;_++)X[1]+=this.grid[O+1][_].length+this.grid[O][_].length-1;if(z<this.grid[0].length-1)for(var _=C;_<=O;_++)X[2]+=this.grid[_][z+1].length+this.grid[_][z].length-1;if(C>0)for(var _=B;_<=z;_++)X[3]+=this.grid[C-1][_].length+this.grid[C][_].length-1;var Q=A.MAX_VALUE,q,te;for(var Z=0;Z<X.length;Z++)if(X[Z]<Q)Q=X[Z],q=1,te=Z;else if(X[Z]==Q)q++;if(q==3&&Q==0){if(X[0]==0&&X[1]==0&&X[2]==0)x=1;else if(X[0]==0&&X[1]==0&&X[3]==0)x=0;else if(X[0]==0&&X[2]==0&&X[3]==0)x=3;else if(X[1]==0&&X[2]==0&&X[3]==0)x=2}else if(q==2&&Q==0){var U=Math.floor(Math.random()*2);if(X[0]==0&&X[1]==0)if(U==0)x=0;else x=1;else if(X[0]==0&&X[2]==0)if(U==0)x=0;else x=2;else if(X[0]==0&&X[3]==0)if(U==0)x=0;else x=3;else if(X[1]==0&&X[2]==0)if(U==0)x=1;else x=2;else if(X[1]==0&&X[3]==0)if(U==0)x=1;else x=3;else if(U==0)x=2;else x=3}else if(q==4&&Q==0){var U=Math.floor(Math.random()*4);x=U}else x=te;if(x==0)D.setCenter(T.getCenterX(),T.getCenterY()-T.getHeight()/2-g.DEFAULT_EDGE_LENGTH-D.getHeight()/2);else if(x==1)D.setCenter(T.getCenterX()+T.getWidth()/2+g.DEFAULT_EDGE_LENGTH+D.getWidth()/2,T.getCenterY());else if(x==2)D.setCenter(T.getCenterX(),T.getCenterY()+T.getHeight()/2+g.DEFAULT_EDGE_LENGTH+D.getHeight()/2);else D.setCenter(T.getCenterX()-T.getWidth()/2-g.DEFAULT_EDGE_LENGTH-D.getWidth()/2,T.getCenterY())}},i.exports=R},991:(i,s,o)=>{var l=o(551).FDLayoutNode,u=o(551).IMath;function f(h,c,d,g){l.call(this,h,c,d,g)}f.prototype=Object.create(l.prototype);for(var v in l)f[v]=l[v];f.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement)this.displacementX=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementX);if(Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement)this.displacementY=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(h,c){var d=this.getChild().getNodes(),g;for(var y=0;y<d.length;y++)if(g=d[y],g.getChild()==null)g.displacementX+=h,g.displacementY+=c;else g.propogateDisplacementToChildren(h,c)},f.prototype.move=function(){var h=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),h.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},f.prototype.setPred1=function(h){this.pred1=h},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(h){this.next=h},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(h){this.processed=h},f.prototype.isProcessed=function(){return processed},i.exports=f},902:(i,s,o)=>{function l(d){if(Array.isArray(d)){for(var g=0,y=Array(d.length);g<d.length;g++)y[g]=d[g];return y}else return Array.from(d)}var u=o(806),f=o(551).LinkedList,v=o(551).Matrix,h=o(551).SVD;function c(){}c.handleConstraints=function(d){var g={};g.fixedNodeConstraint=d.constraints.fixedNodeConstraint,g.alignmentConstraint=d.constraints.alignmentConstraint,g.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var y=new Map,p=new Map,m=[],b=[],E=d.getAllNodes(),A=0;for(var M=0;M<E.length;M++){var S=E[M];if(S.getChild()==null)p.set(S.id,A++),m.push(S.getCenterX()),b.push(S.getCenterY()),y.set(S.id,S)}if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(!L.gap&&L.gap!=0)if(L.left)L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.left).getWidth()/2+y.get(L.right).getWidth()/2;else L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.top).getHeight()/2+y.get(L.bottom).getHeight()/2});var P=function(F,Y){return{x:F.x-Y.x,y:F.y-Y.y}},N=function(F){var Y=0,H=0;return F.forEach(function(K){Y+=m[p.get(K)],H+=b[p.get(K)]}),{x:Y/F.size,y:H/F.size}},R=function(F,Y,H,K,se){function ae(ce,pe){var Ie=new Set(ce),xe=!0,me=!1,Ve=void 0;try{for(var Be=pe[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie.add(He)}}catch(Le){me=!0,Ve=Le}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}return Ie}var oe=new Map;F.forEach(function(ce,pe){oe.set(pe,0)}),F.forEach(function(ce,pe){ce.forEach(function(Ie){oe.set(Ie.id,oe.get(Ie.id)+1)})});var ne=new Map,ue=new Map,be=new f;if(oe.forEach(function(ce,pe){if(ce==0){if(be.push(pe),!H)if(Y=="horizontal")ne.set(pe,p.has(pe)?m[p.get(pe)]:K.get(pe));else ne.set(pe,p.has(pe)?b[p.get(pe)]:K.get(pe))}else ne.set(pe,Number.NEGATIVE_INFINITY);if(H)ue.set(pe,new Set([pe]))}),H)se.forEach(function(ce){var pe=[];if(ce.forEach(function(me){if(H.has(me))pe.push(me)}),pe.length>0){var Ie=0;pe.forEach(function(me){if(Y=="horizontal")ne.set(me,p.has(me)?m[p.get(me)]:K.get(me)),Ie+=ne.get(me);else ne.set(me,p.has(me)?b[p.get(me)]:K.get(me)),Ie+=ne.get(me)}),Ie=Ie/pe.length,ce.forEach(function(me){if(!H.has(me))ne.set(me,Ie)})}else{var xe=0;ce.forEach(function(me){if(Y=="horizontal")xe+=p.has(me)?m[p.get(me)]:K.get(me);else xe+=p.has(me)?b[p.get(me)]:K.get(me)}),xe=xe/ce.length,ce.forEach(function(me){ne.set(me,xe)})}});var fe=function(){var pe=be.shift(),Ie=F.get(pe);Ie.forEach(function(xe){if(ne.get(xe.id)<ne.get(pe)+xe.gap)if(H&&H.has(xe.id)){var me=void 0;if(Y=="horizontal")me=p.has(xe.id)?m[p.get(xe.id)]:K.get(xe.id);else me=p.has(xe.id)?b[p.get(xe.id)]:K.get(xe.id);if(ne.set(xe.id,me),me<ne.get(pe)+xe.gap){var Ve=ne.get(pe)+xe.gap-me;ue.get(pe).forEach(function(Be){ne.set(Be,ne.get(Be)-Ve)})}}else ne.set(xe.id,ne.get(pe)+xe.gap);if(oe.set(xe.id,oe.get(xe.id)-1),oe.get(xe.id)==0)be.push(xe.id);if(H)ue.set(xe.id,ae(ue.get(pe),ue.get(xe.id)))})};while(be.length!=0)fe();if(H){var le=new Set;F.forEach(function(ce,pe){if(ce.length==0)le.add(pe)});var De=[];ue.forEach(function(ce,pe){if(le.has(pe)){var Ie=!1,xe=!0,me=!1,Ve=void 0;try{for(var Be=ce[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;if(H.has(He))Ie=!0}}catch(Ye){me=!0,Ve=Ye}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}if(!Ie){var Le=!1,nt=void 0;if(De.forEach(function(Ye,tt){if(Ye.has([].concat(l(ce))[0]))Le=!0,nt=tt}),!Le)De.push(new Set(ce));else ce.forEach(function(Ye){De[nt].add(Ye)})}}}),De.forEach(function(ce,pe){var{POSITIVE_INFINITY:Ie,POSITIVE_INFINITY:xe,NEGATIVE_INFINITY:me,NEGATIVE_INFINITY:Ve}=Number,Be=!0,Ke=!1,He=void 0;try{for(var Le=ce[Symbol.iterator](),nt;!(Be=(nt=Le.next()).done);Be=!0){var Ye=nt.value,tt=void 0;if(Y=="horizontal")tt=p.has(Ye)?m[p.get(Ye)]:K.get(Ye);else tt=p.has(Ye)?b[p.get(Ye)]:K.get(Ye);var dt=ne.get(Ye);if(tt<Ie)Ie=tt;if(tt>me)me=tt;if(dt<xe)xe=dt;if(dt>Ve)Ve=dt}}catch(fr){Ke=!0,He=fr}finally{try{if(!Be&&Le.return)Le.return()}finally{if(Ke)throw He}}var qt=(Ie+me)/2-(xe+Ve)/2,ot=!0,rt=!1,ft=void 0;try{for(var Ft=ce[Symbol.iterator](),xt;!(ot=(xt=Ft.next()).done);ot=!0){var rr=xt.value;ne.set(rr,ne.get(rr)+qt)}}catch(fr){rt=!0,ft=fr}finally{try{if(!ot&&Ft.return)Ft.return()}finally{if(rt)throw ft}}})}return ne},I=function(F){var Y=0,H=0,K=0,se=0;if(F.forEach(function(ue){if(ue.left)m[p.get(ue.left)]-m[p.get(ue.right)]>=0?Y++:H++;else b[p.get(ue.top)]-b[p.get(ue.bottom)]>=0?K++:se++}),Y>H&&K>se)for(var ae=0;ae<p.size;ae++)m[ae]=-1*m[ae],b[ae]=-1*b[ae];else if(Y>H)for(var oe=0;oe<p.size;oe++)m[oe]=-1*m[oe];else if(K>se)for(var ne=0;ne<p.size;ne++)b[ne]=-1*b[ne]},w=function(F){var Y=[],H=new f,K=new Set,se=0;return F.forEach(function(ae,oe){if(!K.has(oe)){Y[se]=[];var ne=oe;H.push(ne),K.add(ne),Y[se].push(ne);while(H.length!=0){ne=H.shift();var ue=F.get(ne);ue.forEach(function(be){if(!K.has(be.id))H.push(be.id),K.add(be.id),Y[se].push(be.id)})}se++}}),Y},x=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(K).push(se),Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},T=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},D=[],C=[],O=!1,B=!1,z=new Set,V=new Map,k=new Map,G=[];if(g.fixedNodeConstraint)g.fixedNodeConstraint.forEach(function(L){z.add(L.nodeId)});if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(L.left){if(V.has(L.left))V.get(L.left).push({id:L.right,gap:L.gap,direction:"horizontal"});else V.set(L.left,[{id:L.right,gap:L.gap,direction:"horizontal"}]);if(!V.has(L.right))V.set(L.right,[])}else{if(V.has(L.top))V.get(L.top).push({id:L.bottom,gap:L.gap,direction:"vertical"});else V.set(L.top,[{id:L.bottom,gap:L.gap,direction:"vertical"}]);if(!V.has(L.bottom))V.set(L.bottom,[])}}),k=x(V),G=w(k);if(u.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(L,F){D[F]=[L.position.x,L.position.y],C[F]=[m[p.get(L.nodeId)],b[p.get(L.nodeId)]]}),O=!0;else if(g.alignmentConstraint)(function(){var L=0;if(g.alignmentConstraint.vertical){var F=g.alignmentConstraint.vertical,Y=function(ne){var ue=new Set;F[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).x;F[ne].forEach(function(le){D[L]=[fe,b[p.get(le)]],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var H=0;H<F.length;H++)Y(H);O=!0}if(g.alignmentConstraint.horizontal){var K=g.alignmentConstraint.horizontal,se=function(ne){var ue=new Set;K[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).y;K[ne].forEach(function(le){D[L]=[m[p.get(le)],fe],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var ae=0;ae<K.length;ae++)se(ae);O=!0}if(g.relativePlacementConstraint)B=!0})();else if(g.relativePlacementConstraint){var J=0,X=0;for(var _=0;_<G.length;_++)if(G[_].length>J)J=G[_].length,X=_;if(J<k.size/2)I(g.relativePlacementConstraint),O=!1,B=!1;else{var Q=new Map,q=new Map,te=[];G[X].forEach(function(L){V.get(L).forEach(function(F){if(F.direction=="horizontal"){if(Q.has(L))Q.get(L).push(F);else Q.set(L,[F]);if(!Q.has(F.id))Q.set(F.id,[]);te.push({left:L,right:F.id})}else{if(q.has(L))q.get(L).push(F);else q.set(L,[F]);if(!q.has(F.id))q.set(F.id,[]);te.push({top:L,bottom:F.id})}})}),I(te),B=!1;var Z=R(Q,"horizontal"),U=R(q,"vertical");G[X].forEach(function(L,F){if(C[F]=[m[p.get(L)],b[p.get(L)]],D[F]=[],Z.has(L))D[F][0]=Z.get(L);else D[F][0]=m[p.get(L)];if(U.has(L))D[F][1]=U.get(L);else D[F][1]=b[p.get(L)]}),O=!0}}if(O){var W=void 0,j=v.transpose(D),re=v.transpose(C);for(var ee=0;ee<j.length;ee++)j[ee]=v.multGamma(j[ee]),re[ee]=v.multGamma(re[ee]);var de=v.multMat(j,v.transpose(re)),Ae=h.svd(de);W=v.multMat(Ae.V,v.transpose(Ae.U));for(var Te=0;Te<p.size;Te++){var Ce=[m[Te],b[Te]],ge=[W[0][0],W[1][0]],ve=[W[0][1],W[1][1]];m[Te]=v.dotProduct(Ce,ge),b[Te]=v.dotProduct(Ce,ve)}if(B)I(g.relativePlacementConstraint)}}if(u.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var ye={x:0,y:0};g.fixedNodeConstraint.forEach(function(L,F){var Y={x:m[p.get(L.nodeId)],y:b[p.get(L.nodeId)]},H=L.position,K=P(H,Y);ye.x+=K.x,ye.y+=K.y}),ye.x/=g.fixedNodeConstraint.length,ye.y/=g.fixedNodeConstraint.length,m.forEach(function(L,F){m[F]+=ye.x}),b.forEach(function(L,F){b[F]+=ye.y}),g.fixedNodeConstraint.forEach(function(L){m[p.get(L.nodeId)]=L.position.x,b[p.get(L.nodeId)]=L.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical){var Ee=g.alignmentConstraint.vertical,Pe=function(F){var Y=new Set;Ee[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=m[p.get(H.values().next().value)];else K=N(Y).x;Y.forEach(function(se){if(!z.has(se))m[p.get(se)]=K})};for(var Me=0;Me<Ee.length;Me++)Pe(Me)}if(g.alignmentConstraint.horizontal){var Ne=g.alignmentConstraint.horizontal,Fe=function(F){var Y=new Set;Ne[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=b[p.get(H.values().next().value)];else K=N(Y).y;Y.forEach(function(se){if(!z.has(se))b[p.get(se)]=K})};for(var ze=0;ze<Ne.length;ze++)Fe(ze)}}if(g.relativePlacementConstraint)(function(){var L=new Map,F=new Map,Y=new Map,H=new Map,K=new Map,se=new Map,ae=new Set,oe=new Set;if(z.forEach(function(vt){ae.add(vt),oe.add(vt)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical){var ne=g.alignmentConstraint.vertical,ue=function(ke){Y.set("dummy"+ke,[]),ne[ke].forEach(function(Ge){if(L.set(Ge,"dummy"+ke),Y.get("dummy"+ke).push(Ge),z.has(Ge))ae.add("dummy"+ke)}),K.set("dummy"+ke,m[p.get(ne[ke][0])])};for(var be=0;be<ne.length;be++)ue(be)}if(g.alignmentConstraint.horizontal){var fe=g.alignmentConstraint.horizontal,le=function(ke){H.set("dummy"+ke,[]),fe[ke].forEach(function(Ge){if(F.set(Ge,"dummy"+ke),H.get("dummy"+ke).push(Ge),z.has(Ge))oe.add("dummy"+ke)}),se.set("dummy"+ke,b[p.get(fe[ke][0])])};for(var De=0;De<fe.length;De++)le(De)}}var ce=new Map,pe=new Map,Ie=function(ke){V.get(ke).forEach(function(Ge){var Vt=void 0,Rt=void 0;if(Ge.direction=="horizontal"){if(Vt=L.get(ke)?L.get(ke):ke,L.get(Ge.id))Rt={id:L.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(ce.has(Vt))ce.get(Vt).push(Rt);else ce.set(Vt,[Rt]);if(!ce.has(Rt.id))ce.set(Rt.id,[])}else{if(Vt=F.get(ke)?F.get(ke):ke,F.get(Ge.id))Rt={id:F.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(pe.has(Vt))pe.get(Vt).push(Rt);else pe.set(Vt,[Rt]);if(!pe.has(Rt.id))pe.set(Rt.id,[])}})},xe=!0,me=!1,Ve=void 0;try{for(var Be=V.keys()[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie(He)}}catch(vt){me=!0,Ve=vt}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}var Le=x(ce),nt=x(pe),Ye=w(Le),tt=w(nt),dt=T(ce),qt=T(pe),ot=[],rt=[];Ye.forEach(function(vt,ke){ot[ke]=[],vt.forEach(function(Ge){if(dt.get(Ge).length==0)ot[ke].push(Ge)})}),tt.forEach(function(vt,ke){rt[ke]=[],vt.forEach(function(Ge){if(qt.get(Ge).length==0)rt[ke].push(Ge)})});var ft=R(ce,"horizontal",ae,K,ot),Ft=R(pe,"vertical",oe,se,rt),xt=function(ke){if(Y.get(ke))Y.get(ke).forEach(function(Ge){m[p.get(Ge)]=ft.get(ke)});else m[p.get(ke)]=ft.get(ke)},rr=!0,fr=!1,ln=void 0;try{for(var wa=ft.keys()[Symbol.iterator](),fn;!(rr=(fn=wa.next()).done);rr=!0){var Ea=fn.value;xt(Ea)}}catch(vt){fr=!0,ln=vt}finally{try{if(!rr&&wa.return)wa.return()}finally{if(fr)throw ln}}var ci=function(ke){if(H.get(ke))H.get(ke).forEach(function(Ge){b[p.get(Ge)]=Ft.get(ke)});else b[p.get(ke)]=Ft.get(ke)},xa=!0,vr=!1,$r=void 0;try{for(var hr=Ft.keys()[Symbol.iterator](),Ta;!(xa=(Ta=hr.next()).done);xa=!0){var Ea=Ta.value;ci(Ea)}}catch(vt){vr=!0,$r=vt}finally{try{if(!xa&&hr.return)hr.return()}finally{if(vr)throw $r}}})()}for(var Ue=0;Ue<E.length;Ue++){var ie=E[Ue];if(ie.getChild()==null)ie.setCenter(m[p.get(ie.id)],b[p.get(ie.id)])}},i.exports=c},551:(i)=>{i.exports=t}},r={};function a(i){var s=r[i];if(s!==void 0)return s.exports;var o=r[i]={exports:{}};return e[i](o,o.exports,a),o.exports}var n=a(45);return n})()})});function Ys(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function fh(t){if(Array.isArray(t))return t}function vh(t){if(Array.isArray(t))return Ys(t)}function Mr(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function hh(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,gf(a.key),a)}}function Lr(t,e,r){return e&&hh(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=fo(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(l){throw l},f:n}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1
|
+
import{Se}from"./chunk-4bzqrwr0.js";var Fo=Se(function(on,ko){(function(e,r){if(typeof on==="object"&&typeof ko==="object")ko.exports=r();else if(typeof define==="function"&&define.amd)define([],r);else if(typeof on==="object")on.layoutBase=r();else e.layoutBase=r()})(on,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.i=function(a){return a},r.d=function(a,n,i){if(!r.o(a,n))Object.defineProperty(a,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(a){var n=a&&a.__esModule?function(){return a.default}:function(){return a};return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=28)}([function(t,e,r){function a(){}a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1000,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a},function(t,e,r){var a=r(2),n=r(8),i=r(9);function s(l,u,f){a.call(this,f),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=f,this.bendpoints=[],this.source=l,this.target=u}s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;else if(this.target===l)return this.source;else throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(l,u){var f=this.getOtherEnd(l),v=u.getGraphManager().getRoot();while(!0){if(f.getOwner()==u)return f;if(f.getOwner()==v)break;f=f.getOwner().getParent()}return null},s.prototype.updateLength=function(){var l=[,,,,];if(this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),l),!this.isOverlapingSourceAndTarget){if(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}},s.prototype.updateLengthSimple=function(){if(this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1)this.lengthX=i.sign(this.lengthX);if(Math.abs(this.lengthY)<1)this.lengthY=i.sign(this.lengthY);this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){function a(n){this.vGraphObject=n}t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(13),s=r(0),o=r(16),l=r(5);function u(v,h,c,d){if(c==null&&d==null)d=h;if(a.call(this,d),v.graphManager!=null)v=v.graphManager;if(this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=v,c!=null&&h!=null)this.rect=new i(h.x,h.y,c.width,c.height);else this.rect=new i}u.prototype=Object.create(a.prototype);for(var f in a)u[f]=a[f];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(v){this.rect.width=v},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(v){this.rect.height=v},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(v,h){this.rect.x=v.x,this.rect.y=v.y,this.rect.width=h.width,this.rect.height=h.height},u.prototype.setCenter=function(v,h){this.rect.x=v-this.rect.width/2,this.rect.y=h-this.rect.height/2},u.prototype.setLocation=function(v,h){this.rect.x=v,this.rect.y=h},u.prototype.moveBy=function(v,h){this.rect.x+=v,this.rect.y+=h},u.prototype.getEdgeListToNode=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(g.target==v){if(g.source!=d)throw"Incorrect edge source!";h.push(g)}}),h},u.prototype.getEdgesBetween=function(v){var h=[],c,d=this;return d.edges.forEach(function(g){if(!(g.source==d||g.target==d))throw"Incorrect edge source and/or target";if(g.target==v||g.source==v)h.push(g)}),h},u.prototype.getNeighborsList=function(){var v=new Set,h=this;return h.edges.forEach(function(c){if(c.source==h)v.add(c.target);else{if(c.target!=h)throw"Incorrect incidency!";v.add(c.source)}}),v},u.prototype.withChildren=function(){var v=new Set,h,c;if(v.add(this),this.child!=null){var d=this.child.getNodes();for(var g=0;g<d.length;g++)h=d[g],c=h.withChildren(),c.forEach(function(y){v.add(y)})}return v},u.prototype.getNoOfChildren=function(){var v=0,h;if(this.child==null)v=1;else{var c=this.child.getNodes();for(var d=0;d<c.length;d++)h=c[d],v+=h.getNoOfChildren()}if(v==0)v=1;return v},u.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},u.prototype.calcEstimatedSize=function(){if(this.child==null)return this.estimatedSize=(this.rect.width+this.rect.height)/2;else return this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize},u.prototype.scatter=function(){var v,h,c=-s.INITIAL_WORLD_BOUNDARY,d=s.INITIAL_WORLD_BOUNDARY;v=s.WORLD_CENTER_X+o.nextDouble()*(d-c)+c;var g=-s.INITIAL_WORLD_BOUNDARY,y=s.INITIAL_WORLD_BOUNDARY;h=s.WORLD_CENTER_Y+o.nextDouble()*(y-g)+g,this.rect.x=v,this.rect.y=h},u.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var v=this.getChild();if(v.updateBounds(!0),this.rect.x=v.getLeft(),this.rect.y=v.getTop(),this.setWidth(v.getRight()-v.getLeft()),this.setHeight(v.getBottom()-v.getTop()),s.NODE_DIMENSIONS_INCLUDE_LABELS){var h=v.getRight()-v.getLeft(),c=v.getBottom()-v.getTop();if(this.labelWidth){if(this.labelPosHorizontal=="left")this.rect.x-=this.labelWidth,this.setWidth(h+this.labelWidth);else if(this.labelPosHorizontal=="center"&&this.labelWidth>h)this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth);else if(this.labelPosHorizontal=="right")this.setWidth(h+this.labelWidth)}if(this.labelHeight){if(this.labelPosVertical=="top")this.rect.y-=this.labelHeight,this.setHeight(c+this.labelHeight);else if(this.labelPosVertical=="center"&&this.labelHeight>c)this.rect.y-=(this.labelHeight-c)/2,this.setHeight(this.labelHeight);else if(this.labelPosVertical=="bottom")this.setHeight(c+this.labelHeight)}}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(v){var h=this.rect.x;if(h>s.WORLD_BOUNDARY)h=s.WORLD_BOUNDARY;else if(h<-s.WORLD_BOUNDARY)h=-s.WORLD_BOUNDARY;var c=this.rect.y;if(c>s.WORLD_BOUNDARY)c=s.WORLD_BOUNDARY;else if(c<-s.WORLD_BOUNDARY)c=-s.WORLD_BOUNDARY;var d=new l(h,c),g=v.inverseTransformPoint(d);this.setLocation(g.x,g.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){if(this.owner==null)return null;return this.owner.getParent()},t.exports=u},function(t,e,r){var a=r(0);function n(){}for(var i in a)n[i]=a[i];n.MAX_ITERATIONS=2500,n.DEFAULT_EDGE_LENGTH=50,n.DEFAULT_SPRING_STRENGTH=0.45,n.DEFAULT_REPULSION_STRENGTH=4500,n.DEFAULT_GRAVITY_STRENGTH=0.4,n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,n.DEFAULT_COOLING_FACTOR_INCREMENTAL=0.3,n.COOLING_ADAPTATION_FACTOR=0.33,n.ADAPTATION_LOWER_NODE_LIMIT=1000,n.ADAPTATION_UPPER_NODE_LIMIT=5000,n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,n.MAX_NODE_DISPLACEMENT=n.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10,n.CONVERGENCE_CHECK_PERIOD=100,n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=0.1,n.MIN_EDGE_LENGTH=1,n.GRID_CALCULATION_CHECK_PERIOD=10,t.exports=n},function(t,e,r){function a(n,i){if(n==null&&i==null)this.x=0,this.y=0;else this.x=n,this.y=i}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(n){this.x=n},a.prototype.setY=function(n){this.y=n},a.prototype.getDifference=function(n){return new DimensionD(this.x-n.x,this.y-n.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(n){return this.x+=n.width,this.y+=n.height,this},t.exports=a},function(t,e,r){var a=r(2),n=r(10),i=r(0),s=r(7),o=r(3),l=r(1),u=r(13),f=r(12),v=r(11);function h(d,g,y){if(a.call(this,y),this.estimatedSize=n.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,g!=null&&g instanceof s)this.graphManager=g;else if(g!=null&&g instanceof Layout)this.graphManager=g.graphManager}h.prototype=Object.create(a.prototype);for(var c in a)h[c]=a[c];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(d,g,y){if(g==null&&y==null){var p=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(p)>-1)throw"Node already in graph!";return p.owner=this,this.getNodes().push(p),p}else{var m=d;if(!(this.getNodes().indexOf(g)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(g.owner==y.owner&&g.owner==this))throw"Both owners must be this graph!";if(g.owner!=y.owner)return null;if(m.source=g,m.target=y,m.isInterGraph=!1,this.getEdges().push(m),g.edges.push(m),y!=g)y.edges.push(m);return m}},h.prototype.remove=function(d){var g=d;if(d instanceof o){if(g==null)throw"Node is null!";if(!(g.owner!=null&&g.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";var y=g.edges.slice(),p,m=y.length;for(var b=0;b<m;b++)if(p=y[b],p.isInterGraph)this.graphManager.remove(p);else p.source.owner.remove(p);var E=this.nodes.indexOf(g);if(E==-1)throw"Node not in owner node list!";this.nodes.splice(E,1)}else if(d instanceof l){var p=d;if(p==null)throw"Edge is null!";if(!(p.source!=null&&p.target!=null))throw"Source and/or target is null!";if(!(p.source.owner!=null&&p.target.owner!=null&&p.source.owner==this&&p.target.owner==this))throw"Source and/or target owner is invalid!";var A=p.source.edges.indexOf(p),M=p.target.edges.indexOf(p);if(!(A>-1&&M>-1))throw"Source and/or target doesn't know this edge!";if(p.source.edges.splice(A,1),p.target!=p.source)p.target.edges.splice(M,1);var E=p.source.owner.getEdges().indexOf(p);if(E==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(E,1)}},h.prototype.updateLeftTop=function(){var{MAX_VALUE:d,MAX_VALUE:g}=n,y,p,m,b=this.getNodes(),E=b.length;for(var A=0;A<E;A++){var M=b[A];if(y=M.getTop(),p=M.getLeft(),d>y)d=y;if(g>p)g=p}if(d==n.MAX_VALUE)return null;if(b[0].getParent().paddingLeft!=null)m=b[0].getParent().paddingLeft;else m=this.margin;return this.left=g-m,this.top=d-m,new f(this.left,this.top)},h.prototype.updateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S,P=this.nodes,N=P.length;for(var R=0;R<N;R++){var I=P[R];if(d&&I.child!=null)I.updateBounds();if(b=I.getLeft(),E=I.getRight(),A=I.getTop(),M=I.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var w=new u(g,p,y-g,m-p);if(g==n.MAX_VALUE)this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom();if(P[0].getParent().paddingLeft!=null)S=P[0].getParent().paddingLeft;else S=this.margin;this.left=w.x-S,this.right=w.x+w.width+S,this.top=w.y-S,this.bottom=w.y+w.height+S},h.calculateBounds=function(d){var g=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,m=-n.MAX_VALUE,b,E,A,M,S=d.length;for(var P=0;P<S;P++){var N=d[P];if(b=N.getLeft(),E=N.getRight(),A=N.getTop(),M=N.getBottom(),g>b)g=b;if(y<E)y=E;if(p>A)p=A;if(m<M)m=M}var R=new u(g,p,y-g,m-p);return R},h.prototype.getInclusionTreeDepth=function(){if(this==this.graphManager.getRoot())return 1;else return this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==n.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){var d=0,g=this.nodes,y=g.length;for(var p=0;p<y;p++){var m=g[p];d+=m.calcEstimatedSize()}if(d==0)this.estimatedSize=i.EMPTY_COMPOUND_NODE_SIZE;else this.estimatedSize=d/Math.sqrt(this.nodes.length);return this.estimatedSize},h.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var g=new v,y=new Set,p=this.nodes[0],m,b,E=p.withChildren();E.forEach(function(R){g.push(R),y.add(R)});while(g.length!==0){p=g.shift(),m=p.getEdges();var A=m.length;for(var M=0;M<A;M++){var S=m[M];if(b=S.getOtherEndInGraph(p,this),b!=null&&!y.has(b)){var P=b.withChildren();P.forEach(function(R){g.push(R),y.add(R)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var N=0;if(y.forEach(function(R){if(R.owner==d)N++}),N==this.nodes.length)this.isConnected=!0}},t.exports=h},function(t,e,r){var a,n=r(1);function i(s){a=r(6),this.layout=s,this.graphs=[],this.edges=[]}i.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),l=this.add(s,o);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(s,o,l,u,f){if(l==null&&u==null&&f==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}else{f=l,u=o,l=s;var v=u.getOwner(),h=f.getOwner();if(!(v!=null&&v.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(v==h)return l.isInterGraph=!1,v.add(l,u,f);else{if(l.isInterGraph=!0,l.source=u,l.target=f,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}}},i.prototype.remove=function(s){if(s instanceof a){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(o.getEdges());var u,f=l.length;for(var v=0;v<f;v++)u=l[v],o.remove(u);var h=[];h=h.concat(o.getNodes());var c;f=h.length;for(var v=0;v<f;v++)c=h[v],o.remove(c);if(o==this.rootGraph)this.setRootGraph(null);var d=this.graphs.indexOf(o);this.graphs.splice(d,1),o.parent=null}else if(s instanceof n){if(u=s,u==null)throw"Edge is null!";if(!u.isInterGraph)throw"Not an inter-graph edge!";if(!(u.source!=null&&u.target!=null))throw"Source and/or target is null!";if(!(u.source.edges.indexOf(u)!=-1&&u.target.edges.indexOf(u)!=-1))throw"Source and/or target doesn't know this edge!";var d=u.source.edges.indexOf(u);if(u.source.edges.splice(d,1),d=u.target.edges.indexOf(u),u.target.edges.splice(d,1),!(u.source.owner!=null&&u.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(u.source.owner.getGraphManager().edges.indexOf(u)==-1)throw"Not in owner graph manager's edge list!";var d=u.source.owner.getGraphManager().edges.indexOf(u);u.source.owner.getGraphManager().edges.splice(d,1)}},i.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},i.prototype.getGraphs=function(){return this.graphs},i.prototype.getAllNodes=function(){if(this.allNodes==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<l;u++)s=s.concat(o[u].getNodes());this.allNodes=s}return this.allNodes},i.prototype.resetAllNodes=function(){this.allNodes=null},i.prototype.resetAllEdges=function(){this.allEdges=null},i.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},i.prototype.getAllEdges=function(){if(this.allEdges==null){var s=[],o=this.getGraphs(),l=o.length;for(var u=0;u<o.length;u++)s=s.concat(o[u].getEdges());s=s.concat(this.edges),this.allEdges=s}return this.allEdges},i.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},i.prototype.setAllNodesToApplyGravitation=function(s){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=s},i.prototype.getRoot=function(){return this.rootGraph},i.prototype.setRootGraph=function(s){if(s.getGraphManager()!=this)throw"Root not in this graph mgr!";if(this.rootGraph=s,s.parent==null)s.parent=this.layout.newNode("Root node")},i.prototype.getLayout=function(){return this.layout},i.prototype.isOneAncestorOfOther=function(s,o){if(!(s!=null&&o!=null))throw"assert failed";if(s==o)return!0;var l=s.getOwner(),u;do{if(u=l.getParent(),u==null)break;if(u==o)return!0;if(l=u.getOwner(),l==null)break}while(!0);l=o.getOwner();do{if(u=l.getParent(),u==null)break;if(u==s)return!0;if(l=u.getOwner(),l==null)break}while(!0);return!1},i.prototype.calcLowestCommonAncestors=function(){var s,o,l,u,f,v=this.getAllEdges(),h=v.length;for(var c=0;c<h;c++){if(s=v[c],o=s.source,l=s.target,s.lca=null,s.sourceInLca=o,s.targetInLca=l,o==l){s.lca=o.getOwner();continue}u=o.getOwner();while(s.lca==null){s.targetInLca=l,f=l.getOwner();while(s.lca==null){if(f==u){s.lca=f;break}if(f==this.rootGraph)break;if(s.lca!=null)throw"assert failed";s.targetInLca=f.getParent(),f=s.targetInLca.getOwner()}if(u==this.rootGraph)break;if(s.lca==null)s.sourceInLca=u.getParent(),u=s.sourceInLca.getOwner()}if(s.lca==null)throw"assert failed"}},i.prototype.calcLowestCommonAncestor=function(s,o){if(s==o)return s.getOwner();var l=s.getOwner();do{if(l==null)break;var u=o.getOwner();do{if(u==null)break;if(u==l)return u;u=u.getParent().getOwner()}while(!0);l=l.getParent().getOwner()}while(!0);return l},i.prototype.calcInclusionTreeDepths=function(s,o){if(s==null&&o==null)s=this.rootGraph,o=1;var l,u=s.getNodes(),f=u.length;for(var v=0;v<f;v++)if(l=u[v],l.inclusionTreeDepth=o,l.child!=null)this.calcInclusionTreeDepths(l.child,o+1)},i.prototype.includesInvalidEdge=function(){var s,o=[],l=this.edges.length;for(var u=0;u<l;u++)if(s=this.edges[u],this.isOneAncestorOfOther(s.source,s.target))o.push(s);for(var u=0;u<o.length;u++)this.remove(o[u]);return!1},t.exports=i},function(t,e,r){var a=r(12);function n(){}n.calcSeparationAmount=function(i,s,o,l){if(!i.intersects(s))throw"assert failed";var u=[,,];if(this.decideDirectionsForOverlappingNodes(i,s,u),o[0]=Math.min(i.getRight(),s.getRight())-Math.max(i.x,s.x),o[1]=Math.min(i.getBottom(),s.getBottom())-Math.max(i.y,s.y),i.getX()<=s.getX()&&i.getRight()>=s.getRight())o[0]+=Math.min(s.getX()-i.getX(),i.getRight()-s.getRight());else if(s.getX()<=i.getX()&&s.getRight()>=i.getRight())o[0]+=Math.min(i.getX()-s.getX(),s.getRight()-i.getRight());if(i.getY()<=s.getY()&&i.getBottom()>=s.getBottom())o[1]+=Math.min(s.getY()-i.getY(),i.getBottom()-s.getBottom());else if(s.getY()<=i.getY()&&s.getBottom()>=i.getBottom())o[1]+=Math.min(i.getY()-s.getY(),s.getBottom()-i.getBottom());var f=Math.abs((s.getCenterY()-i.getCenterY())/(s.getCenterX()-i.getCenterX()));if(s.getCenterY()===i.getCenterY()&&s.getCenterX()===i.getCenterX())f=1;var v=f*o[0],h=o[1]/f;if(o[0]<h)h=o[0];else v=o[1];o[0]=-1*u[0]*(h/2+l),o[1]=-1*u[1]*(v/2+l)},n.decideDirectionsForOverlappingNodes=function(i,s,o){if(i.getCenterX()<s.getCenterX())o[0]=-1;else o[0]=1;if(i.getCenterY()<s.getCenterY())o[1]=-1;else o[1]=1},n.getIntersection2=function(i,s,o){var l=i.getCenterX(),u=i.getCenterY(),f=s.getCenterX(),v=s.getCenterY();if(i.intersects(s))return o[0]=l,o[1]=u,o[2]=f,o[3]=v,!0;var h=i.getX(),c=i.getY(),d=i.getRight(),g=i.getX(),y=i.getBottom(),p=i.getRight(),m=i.getWidthHalf(),b=i.getHeightHalf(),E=s.getX(),A=s.getY(),M=s.getRight(),S=s.getX(),P=s.getBottom(),N=s.getRight(),R=s.getWidthHalf(),I=s.getHeightHalf(),w=!1,x=!1;if(l===f){if(u>v)return o[0]=l,o[1]=c,o[2]=f,o[3]=P,!1;else if(u<v)return o[0]=l,o[1]=y,o[2]=f,o[3]=A,!1}else if(u===v){if(l>f)return o[0]=h,o[1]=u,o[2]=M,o[3]=v,!1;else if(l<f)return o[0]=d,o[1]=u,o[2]=E,o[3]=v,!1}else{var T=i.height/i.width,D=s.height/s.width,C=(v-u)/(f-l),O=void 0,B=void 0,z=void 0,V=void 0,k=void 0,G=void 0;if(-T===C)if(l>f)o[0]=g,o[1]=y,w=!0;else o[0]=d,o[1]=c,w=!0;else if(T===C)if(l>f)o[0]=h,o[1]=c,w=!0;else o[0]=p,o[1]=y,w=!0;if(-D===C)if(f>l)o[2]=S,o[3]=P,x=!0;else o[2]=M,o[3]=A,x=!0;else if(D===C)if(f>l)o[2]=E,o[3]=A,x=!0;else o[2]=N,o[3]=P,x=!0;if(w&&x)return!1;if(l>f)if(u>v)O=this.getCardinalDirection(T,C,4),B=this.getCardinalDirection(D,C,2);else O=this.getCardinalDirection(-T,C,3),B=this.getCardinalDirection(-D,C,1);else if(u>v)O=this.getCardinalDirection(-T,C,1),B=this.getCardinalDirection(-D,C,3);else O=this.getCardinalDirection(T,C,2),B=this.getCardinalDirection(D,C,4);if(!w)switch(O){case 1:V=c,z=l+-b/C,o[0]=z,o[1]=V;break;case 2:z=p,V=u+m*C,o[0]=z,o[1]=V;break;case 3:V=y,z=l+b/C,o[0]=z,o[1]=V;break;case 4:z=g,V=u+-m*C,o[0]=z,o[1]=V;break}if(!x)switch(B){case 1:G=A,k=f+-I/C,o[2]=k,o[3]=G;break;case 2:k=N,G=v+R*C,o[2]=k,o[3]=G;break;case 3:G=P,k=f+I/C,o[2]=k,o[3]=G;break;case 4:k=S,G=v+-R*C,o[2]=k,o[3]=G;break}}return!1},n.getCardinalDirection=function(i,s,o){if(i>s)return o;else return 1+o%4},n.getIntersection=function(i,s,o,l){if(l==null)return this.getIntersection2(i,s,o);var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=void 0,m=void 0,b=void 0,E=void 0,A=void 0,M=void 0,S=void 0,P=void 0,N=void 0;if(b=h-f,A=u-v,S=v*f-u*h,E=y-d,M=c-g,P=g*d-c*y,N=b*M-E*A,N===0)return null;return p=(A*P-M*S)/N,m=(E*S-b*P)/N,new a(p,m)},n.angleOfVector=function(i,s,o,l){var u=void 0;if(i!==o){if(u=Math.atan((l-s)/(o-i)),o<i)u+=Math.PI;else if(l<s)u+=this.TWO_PI}else if(l<s)u=this.ONE_AND_HALF_PI;else u=this.HALF_PI;return u},n.doIntersect=function(i,s,o,l){var{x:u,y:f}=i,{x:v,y:h}=s,{x:c,y:d}=o,{x:g,y}=l,p=(v-u)*(y-d)-(g-c)*(h-f);if(p===0)return!1;else{var m=((y-d)*(g-u)+(c-g)*(y-f))/p,b=((f-h)*(g-u)+(v-u)*(y-f))/p;return 0<m&&m<1&&0<b&&b<1}},n.findCircleLineIntersections=function(i,s,o,l,u,f,v){var h=(o-i)*(o-i)+(l-s)*(l-s),c=2*((i-u)*(o-i)+(s-f)*(l-s)),d=(i-u)*(i-u)+(s-f)*(s-f)-v*v,g=c*c-4*h*d;if(g>=0){var y=(-c+Math.sqrt(c*c-4*h*d))/(2*h),p=(-c-Math.sqrt(c*c-4*h*d))/(2*h),m=null;if(y>=0&&y<=1)return[y];if(p>=0&&p<=1)return[p];return m}else return null},n.HALF_PI=0.5*Math.PI,n.ONE_AND_HALF_PI=1.5*Math.PI,n.TWO_PI=2*Math.PI,n.THREE_PI=3*Math.PI,t.exports=n},function(t,e,r){function a(){}a.sign=function(n){if(n>0)return 1;else if(n<0)return-1;else return 0},a.floor=function(n){return n<0?Math.ceil(n):Math.floor(n)},a.ceil=function(n){return n<0?Math.floor(n):Math.ceil(n)},t.exports=a},function(t,e,r){function a(){}a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a},function(t,e,r){var a=function(){function u(f,v){for(var h=0;h<v.length;h++){var c=v[h];if(c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c)c.writable=!0;Object.defineProperty(f,c.key,c)}}return function(f,v,h){if(v)u(f.prototype,v);if(h)u(f,h);return f}}();function n(u,f){if(!(u instanceof f))throw TypeError("Cannot call a class as a function")}var i=function(f){return{value:f,next:null,prev:null}},s=function(f,v,h,c){if(f!==null)f.next=v;else c.head=v;if(h!==null)h.prev=v;else c.tail=v;return v.prev=f,v.next=h,c.length++,v},o=function(f,v){var{prev:h,next:c}=f;if(h!==null)h.next=c;else v.head=c;if(c!==null)c.prev=h;else v.tail=h;return f.prev=f.next=null,v.length--,f},l=function(){function u(f){var v=this;if(n(this,u),this.length=0,this.head=null,this.tail=null,f!=null)f.forEach(function(h){return v.push(h)})}return a(u,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(v,h){return s(h.prev,i(v),h,this)}},{key:"insertAfter",value:function(v,h){return s(h,i(v),h.next,this)}},{key:"insertNodeBefore",value:function(v,h){return s(h.prev,v,h,this)}},{key:"insertNodeAfter",value:function(v,h){return s(h,v,h.next,this)}},{key:"push",value:function(v){return s(this.tail,i(v),null,this)}},{key:"unshift",value:function(v){return s(null,i(v),this.head,this)}},{key:"remove",value:function(v){return o(v,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(v){if(v<=this.length()){var h=1,c=this.head;while(h<v)c=c.next,h++;return c.value}}},{key:"set_object_at",value:function(v,h){if(v<=this.length()){var c=1,d=this.head;while(c<v)d=d.next,c++;d.value=h}}}]),u}();t.exports=l},function(t,e,r){function a(n,i,s){if(this.x=null,this.y=null,n==null&&i==null&&s==null)this.x=0,this.y=0;else if(typeof n=="number"&&typeof i=="number"&&s==null)this.x=n,this.y=i;else if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.x=s.x,this.y=s.y}a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.getLocation=function(){return new a(this.x,this.y)},a.prototype.setLocation=function(n,i,s){if(n.constructor.name=="Point"&&i==null&&s==null)s=n,this.setLocation(s.x,s.y);else if(typeof n=="number"&&typeof i=="number"&&s==null)if(parseInt(n)==n&&parseInt(i)==i)this.move(n,i);else this.x=Math.floor(n+0.5),this.y=Math.floor(i+0.5)},a.prototype.move=function(n,i){this.x=n,this.y=i},a.prototype.translate=function(n,i){this.x+=n,this.y+=i},a.prototype.equals=function(n){if(n.constructor.name=="Point"){var i=n;return this.x==i.x&&this.y==i.y}return this==n},a.prototype.toString=function(){return new a().constructor.name+"[x="+this.x+",y="+this.y+"]"},t.exports=a},function(t,e,r){function a(n,i,s,o){if(this.x=0,this.y=0,this.width=0,this.height=0,n!=null&&i!=null&&s!=null&&o!=null)this.x=n,this.y=i,this.width=s,this.height=o}a.prototype.getX=function(){return this.x},a.prototype.setX=function(n){this.x=n},a.prototype.getY=function(){return this.y},a.prototype.setY=function(n){this.y=n},a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},a.prototype.getRight=function(){return this.x+this.width},a.prototype.getBottom=function(){return this.y+this.height},a.prototype.intersects=function(n){if(this.getRight()<n.x)return!1;if(this.getBottom()<n.y)return!1;if(n.getRight()<this.x)return!1;if(n.getBottom()<this.y)return!1;return!0},a.prototype.getCenterX=function(){return this.x+this.width/2},a.prototype.getMinX=function(){return this.getX()},a.prototype.getMaxX=function(){return this.getX()+this.width},a.prototype.getCenterY=function(){return this.y+this.height/2},a.prototype.getMinY=function(){return this.getY()},a.prototype.getMaxY=function(){return this.getY()+this.height},a.prototype.getWidthHalf=function(){return this.width/2},a.prototype.getHeightHalf=function(){return this.height/2},t.exports=a},function(t,e,r){var a=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol==="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i};function n(){}n.lastID=0,n.createID=function(i){if(n.isPrimitive(i))return i;if(i.uniqueID!=null)return i.uniqueID;return i.uniqueID=n.getString(),n.lastID++,i.uniqueID},n.getString=function(i){if(i==null)i=n.lastID;return"Object#"+i},n.isPrimitive=function(i){var s=typeof i>"u"?"undefined":a(i);return i==null||s!="object"&&s!="function"},t.exports=n},function(t,e,r){function a(c){if(Array.isArray(c)){for(var d=0,g=Array(c.length);d<c.length;d++)g[d]=c[d];return g}else return Array.from(c)}var n=r(0),i=r(7),s=r(3),o=r(1),l=r(6),u=r(5),f=r(17),v=r(29);function h(c){if(v.call(this),this.layoutQuality=n.QUALITY,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=n.DEFAULT_INCREMENTAL,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new i(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,c!=null)this.isRemoteUse=c}h.RANDOM_SEED=1,h.prototype=Object.create(v.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var c=new i(this);return this.graphManager=c,c},h.prototype.newGraph=function(c){return new l(null,this.graphManager,c)},h.prototype.newNode=function(c){return new s(this.graphManager,c)},h.prototype.newEdge=function(c){return new o(null,null,c)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){if(this.isLayoutFinished=!1,this.tilingPreLayout)this.tilingPreLayout();this.initParameters();var c;if(this.checkLayoutSuccess())c=!1;else c=this.layout();if(n.ANIMATE==="during")return!1;if(c){if(!this.isSubLayout)this.doPostLayout()}if(this.tilingPostLayout)this.tilingPostLayout();return this.isLayoutFinished=!0,c},h.prototype.doPostLayout=function(){if(!this.incremental)this.transform();this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded)this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges();if(!this.isRemoteUse){var c,d=this.graphManager.getAllEdges();for(var g=0;g<d.length;g++)c=d[g];var y,p=this.graphManager.getRoot().getNodes();for(var g=0;g<p.length;g++)y=p[g];this.update(this.graphManager.getRoot())}},h.prototype.update=function(c){if(c==null)this.update2();else if(c instanceof s){var d=c;if(d.getChild()!=null){var g=d.getChild().getNodes();for(var y=0;y<g.length;y++)update(g[y])}if(d.vGraphObject!=null){var p=d.vGraphObject;p.update(d)}}else if(c instanceof o){var m=c;if(m.vGraphObject!=null){var b=m.vGraphObject;b.update(m)}}else if(c instanceof l){var E=c;if(E.vGraphObject!=null){var A=E.vGraphObject;A.update(E)}}},h.prototype.initParameters=function(){if(!this.isSubLayout)this.layoutQuality=n.QUALITY,this.animationDuringLayout=n.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=n.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=n.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=n.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=n.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=n.DEFAULT_UNIFORM_LEAF_NODE_SIZES;if(this.animationDuringLayout)this.animationOnLayout=!1},h.prototype.transform=function(c){if(c==null)this.transform(new u(0,0));else{var d=new f,g=this.graphManager.getRoot().updateLeftTop();if(g!=null){d.setWorldOrgX(c.x),d.setWorldOrgY(c.y),d.setDeviceOrgX(g.x),d.setDeviceOrgY(g.y);var y=this.getAllNodes(),p;for(var m=0;m<y.length;m++)p=y[m],p.transform(d)}}},h.prototype.positionNodesRandomly=function(c){if(c==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else{var d,g,y=c.getNodes();for(var p=0;p<y.length;p++)if(d=y[p],g=d.getChild(),g==null)d.scatter();else if(g.getNodes().length==0)d.scatter();else this.positionNodesRandomly(g),d.updateBounds()}},h.prototype.getFlatForest=function(){var c=[],d=!0,g=this.graphManager.getRoot().getNodes(),y=!0;for(var p=0;p<g.length;p++)if(g[p].getChild()!=null)y=!1;if(!y)return c;var m=new Set,b=[],E=new Map,A=[];A=A.concat(g);while(A.length>0&&d){b.push(A[0]);while(b.length>0&&d){var M=b[0];b.splice(0,1),m.add(M);var S=M.getEdges();for(var p=0;p<S.length;p++){var P=S[p].getOtherEnd(M);if(E.get(M)!=P)if(!m.has(P))b.push(P),E.set(P,M);else{d=!1;break}}}if(!d)c=[];else{var N=[].concat(a(m));c.push(N);for(var p=0;p<N.length;p++){var R=N[p],I=A.indexOf(R);if(I>-1)A.splice(I,1)}m=new Set,E=new Map}}return c},h.prototype.createDummyNodesForBendpoints=function(c){var d=[],g=c.source,y=this.graphManager.calcLowestCommonAncestor(c.source,c.target);for(var p=0;p<c.bendpoints.length;p++){var m=this.newNode(null);m.setRect(new Point(0,0),new Dimension(1,1)),y.add(m);var b=this.newEdge(null);this.graphManager.add(b,g,m),d.add(m),g=m}var b=this.newEdge(null);if(this.graphManager.add(b,g,c.target),this.edgeToDummyNodes.set(c,d),c.isInterGraph())this.graphManager.remove(c);else y.remove(c);return d},h.prototype.createBendpointsFromDummyNodes=function(){var c=[];c=c.concat(this.graphManager.getAllEdges()),c=[].concat(a(this.edgeToDummyNodes.keys())).concat(c);for(var d=0;d<c.length;d++){var g=c[d];if(g.bendpoints.length>0){var y=this.edgeToDummyNodes.get(g);for(var p=0;p<y.length;p++){var m=y[p],b=new u(m.getCenterX(),m.getCenterY()),E=g.bendpoints.get(p);E.x=b.x,E.y=b.y,m.getOwner().remove(m)}this.graphManager.add(g,g.source,g.target)}}},h.transform=function(c,d,g,y){if(g!=null&&y!=null){var p=d;if(c<=50){var m=d/g;p-=(d-m)/50*(50-c)}else{var b=d*y;p+=(b-d)/50*(c-50)}return p}else{var E,A;if(c<=50)E=9*d/500,A=d/10;else E=9*d/50,A=-8*d;return E*c+A}},h.findCenterOfTree=function(c){var d=[];d=d.concat(c);var g=[],y=new Map,p=!1,m=null;if(d.length==1||d.length==2)p=!0,m=d[0];for(var b=0;b<d.length;b++){var E=d[b],A=E.getNeighborsList().size;if(y.set(E,E.getNeighborsList().size),A==1)g.push(E)}var M=[];M=M.concat(g);while(!p){var S=[];S=S.concat(M),M=[];for(var b=0;b<d.length;b++){var E=d[b],P=d.indexOf(E);if(P>=0)d.splice(P,1);var N=E.getNeighborsList();N.forEach(function(w){if(g.indexOf(w)<0){var x=y.get(w),T=x-1;if(T==1)M.push(w);y.set(w,T)}})}if(g=g.concat(M),d.length==1||d.length==2)p=!0,m=d[0]}return m},h.prototype.setGraphManager=function(c){this.graphManager=c},t.exports=h},function(t,e,r){function a(){}a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a},function(t,e,r){var a=r(5);function n(i,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(i){this.lworldExtX=i},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(i){this.lworldExtY=i},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},n.prototype.transformX=function(i){var s=0,o=this.lworldExtX;if(o!=0)s=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/o;return s},n.prototype.transformY=function(i){var s=0,o=this.lworldExtY;if(o!=0)s=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/o;return s},n.prototype.inverseTransformX=function(i){var s=0,o=this.ldeviceExtX;if(o!=0)s=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/o;return s},n.prototype.inverseTransformY=function(i){var s=0,o=this.ldeviceExtY;if(o!=0)s=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/o;return s},n.prototype.inverseTransformPoint=function(i){var s=new a(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return s},t.exports=n},function(t,e,r){function a(v){if(Array.isArray(v)){for(var h=0,c=Array(v.length);h<v.length;h++)c[h]=v[h];return c}else return Array.from(v)}var n=r(15),i=r(4),s=r(0),o=r(8),l=r(9);function u(){n.call(this),this.useSmartIdealEdgeLengthCalculation=i.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=i.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=i.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=i.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=i.MAX_ITERATIONS}u.prototype=Object.create(n.prototype);for(var f in n)u[f]=n[f];u.prototype.initParameters=function(){n.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=i.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},u.prototype.calcIdealEdgeLengths=function(){var v,h,c,d,g,y,p,m=this.getGraphManager().getAllEdges();for(var b=0;b<m.length;b++)if(v=m[b],h=v.idealLength,v.isInterGraph){if(d=v.getSource(),g=v.getTarget(),y=v.getSourceInLca().getEstimatedSize(),p=v.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation)v.idealLength+=y+p-2*s.SIMPLE_NODE_SIZE;c=v.getLca().getInclusionTreeDepth(),v.idealLength+=h*i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(d.getInclusionTreeDepth()+g.getInclusionTreeDepth()-2*c)}},u.prototype.initSpringEmbedder=function(){var v=this.getAllNodes().length;if(this.incremental){if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR));this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(v>i.ADAPTATION_LOWER_NODE_LIMIT)this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(v-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR));else this.coolingFactor=1;this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.displacementThresholdPerNode=3*i.DEFAULT_EDGE_LENGTH/100,this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){var v=this.getAllEdges(),h;for(var c=0;c<v.length;c++)h=v[c],this.calcSpringForce(h,h.idealLength)},u.prototype.calcRepulsionForces=function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,d,g,y,p=this.getAllNodes(),m;if(this.useFRGridVariant){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&v)this.updateGrid();m=new Set;for(c=0;c<p.length;c++)g=p[c],this.calculateRepulsionForceOfANode(g,m,v,h),m.add(g)}else for(c=0;c<p.length;c++){g=p[c];for(d=c+1;d<p.length;d++){if(y=p[d],g.getOwner()!=y.getOwner())continue;this.calcRepulsionForce(g,y)}}},u.prototype.calcGravitationalForces=function(){var v,h=this.getAllNodesToApplyGravitation();for(var c=0;c<h.length;c++)v=h[c],this.calcGravitationalForce(v)},u.prototype.moveNodes=function(){var v=this.getAllNodes(),h;for(var c=0;c<v.length;c++)h=v[c],h.move()},u.prototype.calcSpringForce=function(v,h){var c=v.getSource(),d=v.getTarget(),g,y,p,m;if(this.uniformLeafNodeSizes&&c.getChild()==null&&d.getChild()==null)v.updateLengthSimple();else if(v.updateLength(),v.isOverlapingSourceAndTarget)return;if(g=v.getLength(),g==0)return;y=v.edgeElasticity*(g-h),p=y*(v.lengthX/g),m=y*(v.lengthY/g),c.springForceX+=p,c.springForceY+=m,d.springForceX-=p,d.springForceY-=m},u.prototype.calcRepulsionForce=function(v,h){var c=v.getRect(),d=h.getRect(),g=[,,],y=[,,,,],p,m,b,E,A,M,S;if(c.intersects(d)){o.calcSeparationAmount(c,d,g,i.DEFAULT_EDGE_LENGTH/2),M=2*g[0],S=2*g[1];var P=v.noOfChildren*h.noOfChildren/(v.noOfChildren+h.noOfChildren);v.repulsionForceX-=P*M,v.repulsionForceY-=P*S,h.repulsionForceX+=P*M,h.repulsionForceY+=P*S}else{if(this.uniformLeafNodeSizes&&v.getChild()==null&&h.getChild()==null)p=d.getCenterX()-c.getCenterX(),m=d.getCenterY()-c.getCenterY();else o.getIntersection(c,d,y),p=y[2]-y[0],m=y[3]-y[1];if(Math.abs(p)<i.MIN_REPULSION_DIST)p=l.sign(p)*i.MIN_REPULSION_DIST;if(Math.abs(m)<i.MIN_REPULSION_DIST)m=l.sign(m)*i.MIN_REPULSION_DIST;b=p*p+m*m,E=Math.sqrt(b),A=(v.nodeRepulsion/2+h.nodeRepulsion/2)*v.noOfChildren*h.noOfChildren/b,M=A*p/E,S=A*m/E,v.repulsionForceX-=M,v.repulsionForceY-=S,h.repulsionForceX+=M,h.repulsionForceY+=S}},u.prototype.calcGravitationalForce=function(v){var h,c,d,g,y,p,m,b;if(h=v.getOwner(),c=(h.getRight()+h.getLeft())/2,d=(h.getTop()+h.getBottom())/2,g=v.getCenterX()-c,y=v.getCenterY()-d,p=Math.abs(g)+v.getWidth()/2,m=Math.abs(y)+v.getHeight()/2,v.getOwner()==this.graphManager.getRoot()){if(b=h.getEstimatedSize()*this.gravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g,v.gravitationForceY=-this.gravityConstant*y}else if(b=h.getEstimatedSize()*this.compoundGravityRangeFactor,p>b||m>b)v.gravitationForceX=-this.gravityConstant*g*this.compoundGravityConstant,v.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant},u.prototype.isConverged=function(){var v,h=!1;if(this.totalIterations>this.maxIterations/3)h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2;return v=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,v||h},u.prototype.animate=function(){if(this.animationDuringLayout&&!this.isSubLayout)if(this.notAnimatedIterations==this.animationPeriod)this.update(),this.notAnimatedIterations=0;else this.notAnimatedIterations++},u.prototype.calcNoOfChildrenForAllNodes=function(){var v,h=this.graphManager.getAllNodes();for(var c=0;c<h.length;c++)v=h[c],v.noOfChildren=v.getNoOfChildren()},u.prototype.calcGrid=function(v){var h=0,c=0;h=parseInt(Math.ceil((v.getRight()-v.getLeft())/this.repulsionRange)),c=parseInt(Math.ceil((v.getBottom()-v.getTop())/this.repulsionRange));var d=Array(h);for(var g=0;g<h;g++)d[g]=Array(c);for(var g=0;g<h;g++)for(var y=0;y<c;y++)d[g][y]=[];return d},u.prototype.addNodeToGrid=function(v,h,c){var d=0,g=0,y=0,p=0;d=parseInt(Math.floor((v.getRect().x-h)/this.repulsionRange)),g=parseInt(Math.floor((v.getRect().width+v.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((v.getRect().y-c)/this.repulsionRange)),p=parseInt(Math.floor((v.getRect().height+v.getRect().y-c)/this.repulsionRange));for(var m=d;m<=g;m++)for(var b=y;b<=p;b++)this.grid[m][b].push(v),v.setGridCoordinates(d,g,y,p)},u.prototype.updateGrid=function(){var v,h,c=this.getAllNodes();this.grid=this.calcGrid(this.graphManager.getRoot());for(v=0;v<c.length;v++)h=c[v],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},u.prototype.calculateRepulsionForceOfANode=function(v,h,c,d){if(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&c||d){var g=new Set;v.surrounding=[];var y,p=this.grid;for(var m=v.startX-1;m<v.finishX+2;m++)for(var b=v.startY-1;b<v.finishY+2;b++)if(!(m<0||b<0||m>=p.length||b>=p[0].length))for(var E=0;E<p[m][b].length;E++){if(y=p[m][b][E],v.getOwner()!=y.getOwner()||v==y)continue;if(!h.has(y)&&!g.has(y)){var A=Math.abs(v.getCenterX()-y.getCenterX())-(v.getWidth()/2+y.getWidth()/2),M=Math.abs(v.getCenterY()-y.getCenterY())-(v.getHeight()/2+y.getHeight()/2);if(A<=this.repulsionRange&&M<=this.repulsionRange)g.add(y)}}v.surrounding=[].concat(a(g))}for(m=0;m<v.surrounding.length;m++)this.calcRepulsionForce(v,v.surrounding[m])},u.prototype.calcRepulsionRange=function(){return 0},t.exports=u},function(t,e,r){var a=r(1),n=r(4);function i(o,l,u){a.call(this,o,l,u),this.idealLength=n.DEFAULT_EDGE_LENGTH,this.edgeElasticity=n.DEFAULT_SPRING_STRENGTH}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];t.exports=i},function(t,e,r){var a=r(3),n=r(4);function i(o,l,u,f){a.call(this,o,l,u,f),this.nodeRepulsion=n.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=[]}i.prototype=Object.create(a.prototype);for(var s in a)i[s]=a[s];i.prototype.setGridCoordinates=function(o,l,u,f){this.startX=o,this.finishX=l,this.startY=u,this.finishY=f},t.exports=i},function(t,e,r){function a(n,i){if(this.width=0,this.height=0,n!==null&&i!==null)this.height=i,this.width=n}a.prototype.getWidth=function(){return this.width},a.prototype.setWidth=function(n){this.width=n},a.prototype.getHeight=function(){return this.height},a.prototype.setHeight=function(n){this.height=n},t.exports=a},function(t,e,r){var a=r(14);function n(){this.map={},this.keys=[]}n.prototype.put=function(i,s){var o=a.createID(i);if(!this.contains(o))this.map[o]=s,this.keys.push(i)},n.prototype.contains=function(i){var s=a.createID(i);return this.map[i]!=null},n.prototype.get=function(i){var s=a.createID(i);return this.map[s]},n.prototype.keySet=function(){return this.keys},t.exports=n},function(t,e,r){var a=r(14);function n(){this.set={}}n.prototype.add=function(i){var s=a.createID(i);if(!this.contains(s))this.set[s]=i},n.prototype.remove=function(i){delete this.set[a.createID(i)]},n.prototype.clear=function(){this.set={}},n.prototype.contains=function(i){return this.set[a.createID(i)]==i},n.prototype.isEmpty=function(){return this.size()===0},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAllTo=function(i){var s=Object.keys(this.set),o=s.length;for(var l=0;l<o;l++)i.push(this.set[s[l]])},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.addAll=function(i){var s=i.length;for(var o=0;o<s;o++){var l=i[o];this.add(l)}},t.exports=n},function(t,e,r){function a(){}a.multMat=function(n,i){var s=[];for(var o=0;o<n.length;o++){s[o]=[];for(var l=0;l<i[0].length;l++){s[o][l]=0;for(var u=0;u<n[0].length;u++)s[o][l]+=n[o][u]*i[u][l]}}return s},a.transpose=function(n){var i=[];for(var s=0;s<n[0].length;s++){i[s]=[];for(var o=0;o<n.length;o++)i[s][o]=n[o][s]}return i},a.multCons=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]*i;return s},a.minusOp=function(n,i){var s=[];for(var o=0;o<n.length;o++)s[o]=n[o]-i[o];return s},a.dotProduct=function(n,i){var s=0;for(var o=0;o<n.length;o++)s+=n[o]*i[o];return s},a.mag=function(n){return Math.sqrt(this.dotProduct(n,n))},a.normalize=function(n){var i=[],s=this.mag(n);for(var o=0;o<n.length;o++)i[o]=n[o]/s;return i},a.multGamma=function(n){var i=[],s=0;for(var o=0;o<n.length;o++)s+=n[o];s*=-1/n.length;for(var l=0;l<n.length;l++)i[l]=s+n[l];return i},a.multL=function(n,i,s){var o=[],l=[],u=[];for(var f=0;f<i[0].length;f++){var v=0;for(var h=0;h<i.length;h++)v+=-0.5*i[h][f]*n[h];l[f]=v}for(var c=0;c<s.length;c++){var d=0;for(var g=0;g<s.length;g++)d+=s[c][g]*l[g];u[c]=d}for(var y=0;y<i.length;y++){var p=0;for(var m=0;m<i[0].length;m++)p+=i[y][m]*u[m];o[y]=p}return o},t.exports=a},function(t,e,r){var a=function(){function o(l,u){for(var f=0;f<u.length;f++){var v=u[f];if(v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v)v.writable=!0;Object.defineProperty(l,v.key,v)}}return function(l,u,f){if(u)o(l.prototype,u);if(f)o(l,f);return l}}();function n(o,l){if(!(o instanceof l))throw TypeError("Cannot call a class as a function")}var i=r(11),s=function(){function o(l,u){if(n(this,o),u!==null||u!==void 0)this.compareFunction=this._defaultCompareFunction;var f=void 0;if(l instanceof i)f=l.size();else f=l.length;this._quicksort(l,0,f-1)}return a(o,[{key:"_quicksort",value:function(u,f,v){if(f<v){var h=this._partition(u,f,v);this._quicksort(u,f,h),this._quicksort(u,h+1,v)}}},{key:"_partition",value:function(u,f,v){var h=this._get(u,f),c=f,d=v;while(!0){while(this.compareFunction(h,this._get(u,d)))d--;while(this.compareFunction(this._get(u,c),h))c++;if(c<d)this._swap(u,c,d),c++,d--;else return d}}},{key:"_get",value:function(u,f){if(u instanceof i)return u.get_object_at(f);else return u[f]}},{key:"_set",value:function(u,f,v){if(u instanceof i)u.set_object_at(f,v);else u[f]=v}},{key:"_swap",value:function(u,f,v){var h=this._get(u,f);this._set(u,f,this._get(u,v)),this._set(u,v,h)}},{key:"_defaultCompareFunction",value:function(u,f){return f>u}}]),o}();t.exports=s},function(t,e,r){function a(){}a.svd=function(n){this.U=null,this.V=null,this.s=null,this.m=0,this.n=0,this.m=n.length,this.n=n[0].length;var i=Math.min(this.m,this.n);this.s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(Math.min(this.m+1,this.n)),this.U=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var dt=0;dt<Ye[0];dt++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.m,i]),this.V=function(He){var Le=function nt(Ye){if(Ye.length==0)return 0;else{var tt=[];for(var dt=0;dt<Ye[0];dt++)tt.push(nt(Ye.slice(1)));return tt}};return Le(He)}([this.n,this.n]);var s=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.n),o=function(He){var Le=[];while(He-- >0)Le.push(0);return Le}(this.m),l=!0,u=!0,f=Math.min(this.m-1,this.n),v=Math.max(0,Math.min(this.n-2,this.m));for(var h=0;h<Math.max(f,v);h++){if(h<f){this.s[h]=0;for(var c=h;c<this.m;c++)this.s[h]=a.hypot(this.s[h],n[c][h]);if(this.s[h]!==0){if(n[h][h]<0)this.s[h]=-this.s[h];for(var d=h;d<this.m;d++)n[d][h]/=this.s[h];n[h][h]+=1}this.s[h]=-this.s[h]}for(var g=h+1;g<this.n;g++){if(function(He,Le){return He&&Le}(h<f,this.s[h]!==0)){var y=0;for(var p=h;p<this.m;p++)y+=n[p][h]*n[p][g];y=-y/n[h][h];for(var m=h;m<this.m;m++)n[m][g]+=y*n[m][h]}s[g]=n[h][g]}if(function(He,Le){return He&&Le}(l,h<f))for(var b=h;b<this.m;b++)this.U[b][h]=n[b][h];if(h<v){s[h]=0;for(var E=h+1;E<this.n;E++)s[h]=a.hypot(s[h],s[E]);if(s[h]!==0){if(s[h+1]<0)s[h]=-s[h];for(var A=h+1;A<this.n;A++)s[A]/=s[h];s[h+1]+=1}if(s[h]=-s[h],function(He,Le){return He&&Le}(h+1<this.m,s[h]!==0)){for(var M=h+1;M<this.m;M++)o[M]=0;for(var S=h+1;S<this.n;S++)for(var P=h+1;P<this.m;P++)o[P]+=s[S]*n[P][S];for(var N=h+1;N<this.n;N++){var R=-s[N]/s[h+1];for(var I=h+1;I<this.m;I++)n[I][N]+=R*o[I]}}if(u)for(var w=h+1;w<this.n;w++)this.V[w][h]=s[w]}}var x=Math.min(this.n,this.m+1);if(f<this.n)this.s[f]=n[f][f];if(this.m<x)this.s[x-1]=0;if(v+1<x)s[v]=n[v][x-1];if(s[x-1]=0,l){for(var T=f;T<i;T++){for(var D=0;D<this.m;D++)this.U[D][T]=0;this.U[T][T]=1}for(var C=f-1;C>=0;C--)if(this.s[C]!==0){for(var O=C+1;O<i;O++){var B=0;for(var z=C;z<this.m;z++)B+=this.U[z][C]*this.U[z][O];B=-B/this.U[C][C];for(var V=C;V<this.m;V++)this.U[V][O]+=B*this.U[V][C]}for(var k=C;k<this.m;k++)this.U[k][C]=-this.U[k][C];this.U[C][C]=1+this.U[C][C];for(var G=0;G<C-1;G++)this.U[G][C]=0}else{for(var J=0;J<this.m;J++)this.U[J][C]=0;this.U[C][C]=1}}if(u)for(var X=this.n-1;X>=0;X--){if(function(He,Le){return He&&Le}(X<v,s[X]!==0))for(var _=X+1;_<i;_++){var Q=0;for(var q=X+1;q<this.n;q++)Q+=this.V[q][X]*this.V[q][_];Q=-Q/this.V[X+1][X];for(var te=X+1;te<this.n;te++)this.V[te][_]+=Q*this.V[te][X]}for(var Z=0;Z<this.n;Z++)this.V[Z][X]=0;this.V[X][X]=1}var U=x-1,W=0,j=Math.pow(2,-52),re=Math.pow(2,-966);while(x>0){var ee=void 0,de=void 0;for(ee=x-2;ee>=-1;ee--){if(ee===-1)break;if(Math.abs(s[ee])<=re+j*(Math.abs(this.s[ee])+Math.abs(this.s[ee+1]))){s[ee]=0;break}}if(ee===x-2)de=4;else{var Ae=void 0;for(Ae=x-1;Ae>=ee;Ae--){if(Ae===ee)break;var Te=(Ae!==x?Math.abs(s[Ae]):0)+(Ae!==ee+1?Math.abs(s[Ae-1]):0);if(Math.abs(this.s[Ae])<=re+j*Te){this.s[Ae]=0;break}}if(Ae===ee)de=3;else if(Ae===x-1)de=1;else de=2,ee=Ae}switch(ee++,de){case 1:{var Ce=s[x-2];s[x-2]=0;for(var ge=x-2;ge>=ee;ge--){var ve=a.hypot(this.s[ge],Ce),ye=this.s[ge]/ve,Ee=Ce/ve;if(this.s[ge]=ve,ge!==ee)Ce=-Ee*s[ge-1],s[ge-1]=ye*s[ge-1];if(u)for(var Pe=0;Pe<this.n;Pe++)ve=ye*this.V[Pe][ge]+Ee*this.V[Pe][x-1],this.V[Pe][x-1]=-Ee*this.V[Pe][ge]+ye*this.V[Pe][x-1],this.V[Pe][ge]=ve}}break;case 2:{var Me=s[ee-1];s[ee-1]=0;for(var Ne=ee;Ne<x;Ne++){var Fe=a.hypot(this.s[Ne],Me),ze=this.s[Ne]/Fe,Ue=Me/Fe;if(this.s[Ne]=Fe,Me=-Ue*s[Ne],s[Ne]=ze*s[Ne],l)for(var ie=0;ie<this.m;ie++)Fe=ze*this.U[ie][Ne]+Ue*this.U[ie][ee-1],this.U[ie][ee-1]=-Ue*this.U[ie][Ne]+ze*this.U[ie][ee-1],this.U[ie][Ne]=Fe}}break;case 3:{var L=Math.max(Math.max(Math.max(Math.max(Math.abs(this.s[x-1]),Math.abs(this.s[x-2])),Math.abs(s[x-2])),Math.abs(this.s[ee])),Math.abs(s[ee])),F=this.s[x-1]/L,Y=this.s[x-2]/L,H=s[x-2]/L,K=this.s[ee]/L,se=s[ee]/L,ae=((Y+F)*(Y-F)+H*H)/2,oe=F*H*(F*H),ne=0;if(function(He,Le){return He||Le}(ae!==0,oe!==0)){if(ne=Math.sqrt(ae*ae+oe),ae<0)ne=-ne;ne=oe/(ae+ne)}var ue=(K+F)*(K-F)+ne,be=K*se;for(var fe=ee;fe<x-1;fe++){var le=a.hypot(ue,be),De=ue/le,ce=be/le;if(fe!==ee)s[fe-1]=le;if(ue=De*this.s[fe]+ce*s[fe],s[fe]=De*s[fe]-ce*this.s[fe],be=ce*this.s[fe+1],this.s[fe+1]=De*this.s[fe+1],u)for(var pe=0;pe<this.n;pe++)le=De*this.V[pe][fe]+ce*this.V[pe][fe+1],this.V[pe][fe+1]=-ce*this.V[pe][fe]+De*this.V[pe][fe+1],this.V[pe][fe]=le;if(le=a.hypot(ue,be),De=ue/le,ce=be/le,this.s[fe]=le,ue=De*s[fe]+ce*this.s[fe+1],this.s[fe+1]=-ce*s[fe]+De*this.s[fe+1],be=ce*s[fe+1],s[fe+1]=De*s[fe+1],l&&fe<this.m-1)for(var Ie=0;Ie<this.m;Ie++)le=De*this.U[Ie][fe]+ce*this.U[Ie][fe+1],this.U[Ie][fe+1]=-ce*this.U[Ie][fe]+De*this.U[Ie][fe+1],this.U[Ie][fe]=le}s[x-2]=ue,W=W+1}break;case 4:{if(this.s[ee]<=0){if(this.s[ee]=this.s[ee]<0?-this.s[ee]:0,u)for(var xe=0;xe<=U;xe++)this.V[xe][ee]=-this.V[xe][ee]}while(ee<U){if(this.s[ee]>=this.s[ee+1])break;var me=this.s[ee];if(this.s[ee]=this.s[ee+1],this.s[ee+1]=me,u&&ee<this.n-1)for(var Ve=0;Ve<this.n;Ve++)me=this.V[Ve][ee+1],this.V[Ve][ee+1]=this.V[Ve][ee],this.V[Ve][ee]=me;if(l&&ee<this.m-1)for(var Be=0;Be<this.m;Be++)me=this.U[Be][ee+1],this.U[Be][ee+1]=this.U[Be][ee],this.U[Be][ee]=me;ee++}W=0,x--}break}}var Ke={U:this.U,V:this.V,S:this.s};return Ke},a.hypot=function(n,i){var s=void 0;if(Math.abs(n)>Math.abs(i))s=i/n,s=Math.abs(n)*Math.sqrt(1+s*s);else if(i!=0)s=n/i,s=Math.abs(i)*Math.sqrt(1+s*s);else s=0;return s},t.exports=a},function(t,e,r){var a=function(){function s(o,l){for(var u=0;u<l.length;u++){var f=l[u];if(f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f)f.writable=!0;Object.defineProperty(o,f.key,f)}}return function(o,l,u){if(l)s(o.prototype,l);if(u)s(o,u);return o}}();function n(s,o){if(!(s instanceof o))throw TypeError("Cannot call a class as a function")}var i=function(){function s(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;n(this,s),this.sequence1=o,this.sequence2=l,this.match_score=u,this.mismatch_penalty=f,this.gap_penalty=v,this.iMax=o.length+1,this.jMax=l.length+1,this.grid=Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=Array(this.jMax);for(var c=0;c<this.jMax;c++)this.grid[h][c]=0}this.tracebackGrid=Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=Array(this.jMax);for(var g=0;g<this.jMax;g++)this.tracebackGrid[d][g]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return a(s,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var l=1;l<this.jMax;l++)this.grid[0][l]=this.grid[0][l-1]+this.gap_penalty,this.tracebackGrid[0][l]=[!1,!1,!0];for(var u=1;u<this.iMax;u++)this.grid[u][0]=this.grid[u-1][0]+this.gap_penalty,this.tracebackGrid[u][0]=[!1,!0,!1];for(var f=1;f<this.iMax;f++)for(var v=1;v<this.jMax;v++){var h=void 0;if(this.sequence1[f-1]===this.sequence2[v-1])h=this.grid[f-1][v-1]+this.match_score;else h=this.grid[f-1][v-1]+this.mismatch_penalty;var c=this.grid[f-1][v]+this.gap_penalty,d=this.grid[f][v-1]+this.gap_penalty,g=[h,c,d],y=this.arrayAllMaxIndexes(g);this.grid[f][v]=g[y[0]],this.tracebackGrid[f][v]=[y.includes(0),y.includes(1),y.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var l=[];l.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});while(l[0]){var u=l[0],f=this.tracebackGrid[u.pos[0]][u.pos[1]];if(f[0])l.push({pos:[u.pos[0]-1,u.pos[1]-1],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(f[1])l.push({pos:[u.pos[0]-1,u.pos[1]],seq1:this.sequence1[u.pos[0]-1]+u.seq1,seq2:"-"+u.seq2});if(f[2])l.push({pos:[u.pos[0],u.pos[1]-1],seq1:"-"+u.seq1,seq2:this.sequence2[u.pos[1]-1]+u.seq2});if(u.pos[0]===0&&u.pos[1]===0)this.alignments.push({sequence1:u.seq1,sequence2:u.seq2});l.shift()}return this.alignments}},{key:"getAllIndexes",value:function(l,u){var f=[],v=-1;while((v=l.indexOf(u,v+1))!==-1)f.push(v);return f}},{key:"arrayAllMaxIndexes",value:function(l){return this.getAllIndexes(l,Math.max.apply(null,l))}}]),s}();t.exports=i},function(t,e,r){var a=function(){return};a.FDLayout=r(18),a.FDLayoutConstants=r(4),a.FDLayoutEdge=r(19),a.FDLayoutNode=r(20),a.DimensionD=r(21),a.HashMap=r(22),a.HashSet=r(23),a.IGeometry=r(8),a.IMath=r(9),a.Integer=r(10),a.Point=r(12),a.PointD=r(5),a.RandomSeed=r(16),a.RectangleD=r(13),a.Transform=r(17),a.UniqueIDGeneretor=r(14),a.Quicksort=r(25),a.LinkedList=r(11),a.LGraphObject=r(2),a.LGraph=r(6),a.LEdge=r(1),a.LGraphManager=r(7),a.LNode=r(3),a.Layout=r(15),a.LayoutConstants=r(0),a.NeedlemanWunsch=r(27),a.Matrix=r(24),a.SVD=r(26),t.exports=a},function(t,e,r){function a(){this.listeners=[]}var n=a.prototype;n.addListener=function(i,s){this.listeners.push({event:i,callback:s})},n.removeListener=function(i,s){for(var o=this.listeners.length;o>=0;o--){var l=this.listeners[o];if(l.event===i&&l.callback===s)this.listeners.splice(o,1)}},n.emit=function(i,s){for(var o=0;o<this.listeners.length;o++){var l=this.listeners[o];if(i===l.event)l.callback(s)}},t.exports=a}])})});var sr=Se(function(un,zo){(function(e,r){if(typeof un==="object"&&typeof zo==="object")zo.exports=r(Fo());else if(typeof define==="function"&&define.amd)define(["layout-base"],r);else if(typeof un==="object")un.coseBase=r(Fo());else e.coseBase=r(e.layoutBase)})(un,function(t){return(()=>{var e={45:(i,s,o)=>{var l={};l.layoutBase=o(551),l.CoSEConstants=o(806),l.CoSEEdge=o(767),l.CoSEGraph=o(880),l.CoSEGraphManager=o(578),l.CoSELayout=o(765),l.CoSENode=o(991),l.ConstraintHandler=o(902),i.exports=l},806:(i,s,o)=>{var l=o(551).FDLayoutConstants;function u(){}for(var f in l)u[f]=l[f];u.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,u.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH,u.DEFAULT_COMPONENT_SEPERATION=60,u.TILE=!0,u.TILING_PADDING_VERTICAL=10,u.TILING_PADDING_HORIZONTAL=10,u.TRANSFORM_ON_CONSTRAINT_HANDLING=!0,u.ENFORCE_CONSTRAINTS=!0,u.APPLY_LAYOUT=!0,u.RELAX_MOVEMENT_ON_CONSTRAINTS=!0,u.TREE_REDUCTION_ON_INCREMENTAL=!0,u.PURE_INCREMENTAL=u.DEFAULT_INCREMENTAL,i.exports=u},767:(i,s,o)=>{var l=o(551).FDLayoutEdge;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},880:(i,s,o)=>{var l=o(551).LGraph;function u(v,h,c){l.call(this,v,h,c)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},578:(i,s,o)=>{var l=o(551).LGraphManager;function u(v){l.call(this,v)}u.prototype=Object.create(l.prototype);for(var f in l)u[f]=l[f];i.exports=u},765:(i,s,o)=>{var l=o(551).FDLayout,u=o(578),f=o(880),v=o(991),h=o(767),c=o(806),d=o(902),g=o(551).FDLayoutConstants,y=o(551).LayoutConstants,p=o(551).Point,m=o(551).PointD,b=o(551).DimensionD,E=o(551).Layout,A=o(551).Integer,M=o(551).IGeometry,S=o(551).LGraph,P=o(551).Transform,N=o(551).LinkedList;function R(){l.call(this),this.toBeTiled={},this.constraints={}}R.prototype=Object.create(l.prototype);for(var I in l)R[I]=l[I];R.prototype.newGraphManager=function(){var w=new u(this);return this.graphManager=w,w},R.prototype.newGraph=function(w){return new f(null,this.graphManager,w)},R.prototype.newNode=function(w){return new v(this.graphManager,w)},R.prototype.newEdge=function(w){return new h(null,null,w)},R.prototype.initParameters=function(){if(l.prototype.initParameters.call(this,arguments),!this.isSubLayout){if(c.DEFAULT_EDGE_LENGTH<10)this.idealEdgeLength=10;else this.idealEdgeLength=c.DEFAULT_EDGE_LENGTH;this.useSmartIdealEdgeLengthCalculation=c.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.gravityConstant=g.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=g.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=g.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=g.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1}},R.prototype.initSpringEmbedder=function(){l.prototype.initSpringEmbedder.call(this),this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/g.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=0.04,this.coolingAdjuster=1},R.prototype.layout=function(){var w=y.DEFAULT_CREATE_BENDS_AS_NEEDED;if(w)this.createBendpoints(),this.graphManager.resetAllEdges();return this.level=0,this.classicLayout()},R.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){var w=this.getFlatForest();if(w.length>0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(D){return x.has(D)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}else if(c.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(O){return x.has(O)});this.graphManager.setAllNodesToApplyGravitation(T)}if(Object.keys(this.constraints).length>0)d.handleConstraints(this),this.initConstraintVariables();if(this.initSpringEmbedder(),c.APPLY_LAYOUT)this.runSpringEmbedder();return!0},R.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished)if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.totalIterations%g.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;if(this.coolingCycle++,this.layoutQuality==0)this.coolingAdjuster=this.coolingCycle;else if(this.layoutQuality==1)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 w=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(C){return w.has(C)});if(this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;if(this.afterGrowthIterations%10==0)this.graphManager.updateBounds(),this.updateGrid();if(c.PURE_INCREMENTAL)this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=g.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,D=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,D),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},R.prototype.getPositionsData=function(){var w=this.graphManager.getAllNodes(),x={};for(var T=0;T<w.length;T++){var D=w[T].rect,C=w[T].id;x[C]={id:C,x:D.getCenterX(),y:D.getCenterY(),w:D.width,h:D.height}}return x},R.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var w=!1;if(g.ANIMATE==="during")this.emit("layoutstarted");else{while(!w)w=this.tick();this.graphManager.updateBounds()}},R.prototype.moveNodes=function(){var w=this.getAllNodes(),x;for(var T=0;T<w.length;T++)x=w[T],x.calculateDisplacement();if(Object.keys(this.constraints).length>0)this.updateDisplacements();for(var T=0;T<w.length;T++)x=w[T],x.move()},R.prototype.initConstraintVariables=function(){var w=this;this.idToNodeMap=new Map,this.fixedNodeSet=new Set;var x=this.graphManager.getAllNodes();for(var T=0;T<x.length;T++){var D=x[T];this.idToNodeMap.set(D.id,D)}var C=function q(te){var Z=te.getChild().getNodes(),U,W=0;for(var j=0;j<Z.length;j++)if(U=Z[j],U.getChild()==null){if(w.fixedNodeSet.has(U.id))W+=100}else W+=q(U);return W};if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach(function(Z){w.fixedNodeSet.add(Z.nodeId)});var x=this.graphManager.getAllNodes(),D;for(var T=0;T<x.length;T++)if(D=x[T],D.getChild()!=null){var O=C(D);if(O>0)D.fixedNodeWeight=O}}if(this.constraints.relativePlacementConstraint){var B=new Map,z=new Map;if(this.dummyToNodeForVerticalAlignment=new Map,this.dummyToNodeForHorizontalAlignment=new Map,this.fixedNodesOnHorizontal=new Set,this.fixedNodesOnVertical=new Set,this.fixedNodeSet.forEach(function(q){w.fixedNodesOnHorizontal.add(q),w.fixedNodesOnVertical.add(q)}),this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var V=this.constraints.alignmentConstraint.vertical;for(var T=0;T<V.length;T++)this.dummyToNodeForVerticalAlignment.set("dummy"+T,[]),V[T].forEach(function(te){if(B.set(te,"dummy"+T),w.dummyToNodeForVerticalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnHorizontal.add("dummy"+T)})}if(this.constraints.alignmentConstraint.horizontal){var k=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<k.length;T++)this.dummyToNodeForHorizontalAlignment.set("dummy"+T,[]),k[T].forEach(function(te){if(z.set(te,"dummy"+T),w.dummyToNodeForHorizontalAlignment.get("dummy"+T).push(te),w.fixedNodeSet.has(te))w.fixedNodesOnVertical.add("dummy"+T)})}}if(c.RELAX_MOVEMENT_ON_CONSTRAINTS)this.shuffle=function(q){var te,Z,U;for(U=q.length-1;U>=2*q.length/3;U--)te=Math.floor(Math.random()*(U+1)),Z=q[U],q[U]=q[te],q[te]=Z;return q},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(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(!w.nodesInRelativeHorizontal.includes(te))if(w.nodesInRelativeHorizontal.push(te),w.nodeToRelativeConstraintMapHorizontal.set(te,[]),w.dummyToNodeForVerticalAlignment.has(te))w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(te)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(te,w.idToNodeMap.get(te).getCenterX());if(!w.nodesInRelativeHorizontal.includes(Z))if(w.nodesInRelativeHorizontal.push(Z),w.nodeToRelativeConstraintMapHorizontal.set(Z,[]),w.dummyToNodeForVerticalAlignment.has(Z))w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Z)[0]).getCenterX());else w.nodeToTempPositionMapHorizontal.set(Z,w.idToNodeMap.get(Z).getCenterX());w.nodeToRelativeConstraintMapHorizontal.get(te).push({right:Z,gap:q.gap}),w.nodeToRelativeConstraintMapHorizontal.get(Z).push({left:te,gap:q.gap})}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(!w.nodesInRelativeVertical.includes(U))if(w.nodesInRelativeVertical.push(U),w.nodeToRelativeConstraintMapVertical.set(U,[]),w.dummyToNodeForHorizontalAlignment.has(U))w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(U)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(U,w.idToNodeMap.get(U).getCenterY());if(!w.nodesInRelativeVertical.includes(W))if(w.nodesInRelativeVertical.push(W),w.nodeToRelativeConstraintMapVertical.set(W,[]),w.dummyToNodeForHorizontalAlignment.has(W))w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(W)[0]).getCenterY());else w.nodeToTempPositionMapVertical.set(W,w.idToNodeMap.get(W).getCenterY());w.nodeToRelativeConstraintMapVertical.get(U).push({bottom:W,gap:q.gap}),w.nodeToRelativeConstraintMapVertical.get(W).push({top:U,gap:q.gap})}});else{var G=new Map,J=new Map;this.constraints.relativePlacementConstraint.forEach(function(q){if(q.left){var te=B.has(q.left)?B.get(q.left):q.left,Z=B.has(q.right)?B.get(q.right):q.right;if(G.has(te))G.get(te).push(Z);else G.set(te,[Z]);if(G.has(Z))G.get(Z).push(te);else G.set(Z,[te])}else{var U=z.has(q.top)?z.get(q.top):q.top,W=z.has(q.bottom)?z.get(q.bottom):q.bottom;if(J.has(U))J.get(U).push(W);else J.set(U,[W]);if(J.has(W))J.get(W).push(U);else J.set(W,[U])}});var X=function(te,Z){var U=[],W=[],j=new N,re=new Set,ee=0;return te.forEach(function(de,Ae){if(!re.has(Ae)){U[ee]=[],W[ee]=!1;var Te=Ae;j.push(Te),re.add(Te),U[ee].push(Te);while(j.length!=0){if(Te=j.shift(),Z.has(Te))W[ee]=!0;var Ce=te.get(Te);Ce.forEach(function(ge){if(!re.has(ge))j.push(ge),re.add(ge),U[ee].push(ge)})}ee++}}),{components:U,isFixed:W}},_=X(G,w.fixedNodesOnHorizontal);this.componentsOnHorizontal=_.components,this.fixedComponentsOnHorizontal=_.isFixed;var Q=X(J,w.fixedNodesOnVertical);this.componentsOnVertical=Q.components,this.fixedComponentsOnVertical=Q.isFixed}}},R.prototype.updateDisplacements=function(){var w=this;if(this.constraints.fixedNodeConstraint)this.constraints.fixedNodeConstraint.forEach(function(Q){var q=w.idToNodeMap.get(Q.nodeId);q.displacementX=0,q.displacementY=0});if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var x=this.constraints.alignmentConstraint.vertical;for(var T=0;T<x.length;T++){var D=0;for(var C=0;C<x[T].length;C++){if(this.fixedNodeSet.has(x[T][C])){D=0;break}D+=this.idToNodeMap.get(x[T][C]).displacementX}var O=D/x[T].length;for(var C=0;C<x[T].length;C++)this.idToNodeMap.get(x[T][C]).displacementX=O}}if(this.constraints.alignmentConstraint.horizontal){var B=this.constraints.alignmentConstraint.horizontal;for(var T=0;T<B.length;T++){var z=0;for(var C=0;C<B[T].length;C++){if(this.fixedNodeSet.has(B[T][C])){z=0;break}z+=this.idToNodeMap.get(B[T][C]).displacementY}var V=z/B[T].length;for(var C=0;C<B[T].length;C++)this.idToNodeMap.get(B[T][C]).displacementY=V}}}if(this.constraints.relativePlacementConstraint)if(c.RELAX_MOVEMENT_ON_CONSTRAINTS){if(this.totalIterations%10==0)this.shuffle(this.nodesInRelativeHorizontal),this.shuffle(this.nodesInRelativeVertical);this.nodesInRelativeHorizontal.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForVerticalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForVerticalAlignment.get(Q)[0]).displacementX;else q=w.idToNodeMap.get(Q).displacementX;if(w.nodeToRelativeConstraintMapHorizontal.get(Q).forEach(function(te){if(te.right){var Z=w.nodeToTempPositionMapHorizontal.get(te.right)-w.nodeToTempPositionMapHorizontal.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapHorizontal.get(Q)-w.nodeToTempPositionMapHorizontal.get(te.left)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapHorizontal.set(Q,w.nodeToTempPositionMapHorizontal.get(Q)+q),w.dummyToNodeForVerticalAlignment.has(Q))w.dummyToNodeForVerticalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementX=q});else w.idToNodeMap.get(Q).displacementX=q}}),this.nodesInRelativeVertical.forEach(function(Q){if(!w.fixedNodesOnHorizontal.has(Q)){var q=0;if(w.dummyToNodeForHorizontalAlignment.has(Q))q=w.idToNodeMap.get(w.dummyToNodeForHorizontalAlignment.get(Q)[0]).displacementY;else q=w.idToNodeMap.get(Q).displacementY;if(w.nodeToRelativeConstraintMapVertical.get(Q).forEach(function(te){if(te.bottom){var Z=w.nodeToTempPositionMapVertical.get(te.bottom)-w.nodeToTempPositionMapVertical.get(Q)-q;if(Z<te.gap)q-=te.gap-Z}else{var Z=w.nodeToTempPositionMapVertical.get(Q)-w.nodeToTempPositionMapVertical.get(te.top)+q;if(Z<te.gap)q+=te.gap-Z}}),w.nodeToTempPositionMapVertical.set(Q,w.nodeToTempPositionMapVertical.get(Q)+q),w.dummyToNodeForHorizontalAlignment.has(Q))w.dummyToNodeForHorizontalAlignment.get(Q).forEach(function(te){w.idToNodeMap.get(te).displacementY=q});else w.idToNodeMap.get(Q).displacementY=q}})}else{for(var T=0;T<this.componentsOnHorizontal.length;T++){var k=this.componentsOnHorizontal[T];if(this.fixedComponentsOnHorizontal[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=0});else this.idToNodeMap.get(k[C]).displacementX=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C])){var X=this.dummyToNodeForVerticalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementX,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementX,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForVerticalAlignment.has(k[C]))this.dummyToNodeForVerticalAlignment.get(k[C]).forEach(function(te){w.idToNodeMap.get(te).displacementX=_});else this.idToNodeMap.get(k[C]).displacementX=_}}for(var T=0;T<this.componentsOnVertical.length;T++){var k=this.componentsOnVertical[T];if(this.fixedComponentsOnVertical[T])for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(Z){w.idToNodeMap.get(Z).displacementY=0});else this.idToNodeMap.get(k[C]).displacementY=0;else{var G=0,J=0;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C])){var X=this.dummyToNodeForHorizontalAlignment.get(k[C]);G+=X.length*this.idToNodeMap.get(X[0]).displacementY,J+=X.length}else G+=this.idToNodeMap.get(k[C]).displacementY,J++;var _=G/J;for(var C=0;C<k.length;C++)if(this.dummyToNodeForHorizontalAlignment.has(k[C]))this.dummyToNodeForHorizontalAlignment.get(k[C]).forEach(function(j){w.idToNodeMap.get(j).displacementY=_});else this.idToNodeMap.get(k[C]).displacementY=_}}}},R.prototype.calculateNodesToApplyGravitationTo=function(){var w=[],x,T=this.graphManager.getGraphs(),D=T.length,C;for(C=0;C<D;C++)if(x=T[C],x.updateConnected(),!x.isConnected)w=w.concat(x.getNodes());return w},R.prototype.createBendpoints=function(){var w=[];w=w.concat(this.graphManager.getAllEdges());var x=new Set,T;for(T=0;T<w.length;T++){var D=w[T];if(!x.has(D)){var C=D.getSource(),O=D.getTarget();if(C==O)D.getBendpoints().push(new m),D.getBendpoints().push(new m),this.createDummyNodesForBendpoints(D),x.add(D);else{var B=[];if(B=B.concat(C.getEdgeListToNode(O)),B=B.concat(O.getEdgeListToNode(C)),!x.has(B[0])){if(B.length>1){var z;for(z=0;z<B.length;z++){var V=B[z];V.getBendpoints().push(new m),this.createDummyNodesForBendpoints(V)}}B.forEach(function(k){x.add(k)})}}}if(x.size==w.length)break}},R.prototype.positionNodesRadially=function(w){var x=new p(0,0),T=Math.ceil(Math.sqrt(w.length)),D=0,C=0,O=0,B=new m(0,0);for(var z=0;z<w.length;z++){if(z%T==0){if(O=0,C=D,z!=0)C+=c.DEFAULT_COMPONENT_SEPERATION;D=0}var V=w[z],k=E.findCenterOfTree(V);if(x.x=O,x.y=C,B=R.radialLayout(V,k,x),B.y>D)D=Math.floor(B.y);O=Math.floor(B.x+c.DEFAULT_COMPONENT_SEPERATION)}this.transform(new m(y.WORLD_CENTER_X-B.x/2,y.WORLD_CENTER_Y-B.y/2))},R.radialLayout=function(w,x,T){var D=Math.max(this.maxDiagonalInTree(w),c.DEFAULT_RADIAL_SEPARATION);R.branchRadialLayout(x,null,0,359,0,D);var C=S.calculateBounds(w),O=new P;O.setDeviceOrgX(C.getMinX()),O.setDeviceOrgY(C.getMinY()),O.setWorldOrgX(T.x),O.setWorldOrgY(T.y);for(var B=0;B<w.length;B++){var z=w[B];z.transform(O)}var V=new m(C.getMaxX(),C.getMaxY());return O.inverseTransformPoint(V)},R.branchRadialLayout=function(w,x,T,D,C,O){var B=(D-T+1)/2;if(B<0)B+=180;var z=(B+T)%360,V=z*M.TWO_PI/360,k=Math.cos(V),G=C*Math.cos(V),J=C*Math.sin(V);w.setCenter(G,J);var X=[];X=X.concat(w.getEdges());var _=X.length;if(x!=null)_--;var Q=0,q=X.length,te,Z=w.getEdgesBetween(x);while(Z.length>1){var U=Z[0];Z.splice(0,1);var W=X.indexOf(U);if(W>=0)X.splice(W,1);q--,_--}if(x!=null)te=(X.indexOf(Z[0])+1)%q;else te=0;var j=Math.abs(D-T)/_;for(var re=te;Q!=_;re=++re%q){var ee=X[re].getOtherEnd(w);if(ee==x)continue;var de=(T+Q*j)%360,Ae=(de+j)%360;R.branchRadialLayout(ee,w,de,Ae,C+O,O),Q++}},R.maxDiagonalInTree=function(w){var x=A.MIN_VALUE;for(var T=0;T<w.length;T++){var D=w[T],C=D.getDiagonal();if(C>x)x=C}return x},R.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},R.prototype.groupZeroDegreeMembers=function(){var w=this,x={};this.memberGroups={},this.idToDummyNode={};var T=[],D=this.graphManager.getAllNodes();for(var C=0;C<D.length;C++){var O=D[C],B=O.getParent();if(this.getNodeDegreeWithChildren(O)===0&&(B.id==null||!this.getToBeTiled(B)))T.push(O)}for(var C=0;C<T.length;C++){var O=T[C],z=O.getParent().id;if(typeof x[z]>"u")x[z]=[];x[z]=x[z].concat(O)}Object.keys(x).forEach(function(V){if(x[V].length>1){var k="DummyCompound_"+V;w.memberGroups[k]=x[V];var G=x[V][0].getParent(),J=new v(w.graphManager);J.id=k,J.paddingLeft=G.paddingLeft||0,J.paddingRight=G.paddingRight||0,J.paddingBottom=G.paddingBottom||0,J.paddingTop=G.paddingTop||0,w.idToDummyNode[k]=J;var X=w.getGraphManager().add(w.newGraph(),J),_=G.getChild();_.add(J);for(var Q=0;Q<x[V].length;Q++){var q=x[V][Q];_.remove(q),X.add(q)}}})},R.prototype.clearCompounds=function(){var w={},x={};this.performDFSOnCompounds();for(var T=0;T<this.compoundOrder.length;T++)x[this.compoundOrder[T].id]=this.compoundOrder[T],w[this.compoundOrder[T].id]=[].concat(this.compoundOrder[T].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[T].getChild()),this.compoundOrder[T].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(w,x)},R.prototype.clearZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(T){var D=w.idToDummyNode[T];if(x[T]=w.tileNodes(w.memberGroups[T],D.paddingLeft+D.paddingRight),D.rect.width=x[T].width,D.rect.height=x[T].height,D.setCenter(x[T].centerX,x[T].centerY),D.labelMarginLeft=0,D.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var C=D.rect.width,O=D.rect.height;if(D.labelWidth){if(D.labelPosHorizontal=="left")D.rect.x-=D.labelWidth,D.setWidth(C+D.labelWidth),D.labelMarginLeft=D.labelWidth;else if(D.labelPosHorizontal=="center"&&D.labelWidth>C)D.rect.x-=(D.labelWidth-C)/2,D.setWidth(D.labelWidth),D.labelMarginLeft=(D.labelWidth-C)/2;else if(D.labelPosHorizontal=="right")D.setWidth(C+D.labelWidth)}if(D.labelHeight){if(D.labelPosVertical=="top")D.rect.y-=D.labelHeight,D.setHeight(O+D.labelHeight),D.labelMarginTop=D.labelHeight;else if(D.labelPosVertical=="center"&&D.labelHeight>O)D.rect.y-=(D.labelHeight-O)/2,D.setHeight(D.labelHeight),D.labelMarginTop=(D.labelHeight-O)/2;else if(D.labelPosVertical=="bottom")D.setHeight(O+D.labelHeight)}}})},R.prototype.repopulateCompounds=function(){for(var w=this.compoundOrder.length-1;w>=0;w--){var x=this.compoundOrder[w],{id:T,paddingLeft:D,paddingTop:C,labelMarginLeft:O,labelMarginTop:B}=x;this.adjustLocations(this.tiledMemberPack[T],x.rect.x,x.rect.y,D,C,O,B)}},R.prototype.repopulateZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(T){var D=w.idToDummyNode[T],{paddingLeft:C,paddingTop:O,labelMarginLeft:B,labelMarginTop:z}=D;w.adjustLocations(x[T],D.rect.x,D.rect.y,C,O,B,z)})},R.prototype.getToBeTiled=function(w){var x=w.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var T=w.getChild();if(T==null)return this.toBeTiled[x]=!1,!1;var D=T.getNodes();for(var C=0;C<D.length;C++){var O=D[C];if(this.getNodeDegree(O)>0)return this.toBeTiled[x]=!1,!1;if(O.getChild()==null){this.toBeTiled[O.id]=!1;continue}if(!this.getToBeTiled(O))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},R.prototype.getNodeDegree=function(w){var x=w.id,T=w.getEdges(),D=0;for(var C=0;C<T.length;C++){var O=T[C];if(O.getSource().id!==O.getTarget().id)D=D+1}return D},R.prototype.getNodeDegreeWithChildren=function(w){var x=this.getNodeDegree(w);if(w.getChild()==null)return x;var T=w.getChild().getNodes();for(var D=0;D<T.length;D++){var C=T[D];x+=this.getNodeDegreeWithChildren(C)}return x},R.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},R.prototype.fillCompexOrderByDFS=function(w){for(var x=0;x<w.length;x++){var T=w[x];if(T.getChild()!=null)this.fillCompexOrderByDFS(T.getChild().getNodes());if(this.getToBeTiled(T))this.compoundOrder.push(T)}},R.prototype.adjustLocations=function(w,x,T,D,C,O,B){x+=D+O,T+=C+B;var z=x;for(var V=0;V<w.rows.length;V++){var k=w.rows[V];x=z;var G=0;for(var J=0;J<k.length;J++){var X=k[J];if(X.rect.x=x,X.rect.y=T,x+=X.rect.width+w.horizontalPadding,X.rect.height>G)G=X.rect.height}T+=G+w.verticalPadding}},R.prototype.tileCompoundMembers=function(w,x){var T=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(D){var C=x[D];if(T.tiledMemberPack[D]=T.tileNodes(w[D],C.paddingLeft+C.paddingRight),C.rect.width=T.tiledMemberPack[D].width,C.rect.height=T.tiledMemberPack[D].height,C.setCenter(T.tiledMemberPack[D].centerX,T.tiledMemberPack[D].centerY),C.labelMarginLeft=0,C.labelMarginTop=0,c.NODE_DIMENSIONS_INCLUDE_LABELS){var O=C.rect.width,B=C.rect.height;if(C.labelWidth){if(C.labelPosHorizontal=="left")C.rect.x-=C.labelWidth,C.setWidth(O+C.labelWidth),C.labelMarginLeft=C.labelWidth;else if(C.labelPosHorizontal=="center"&&C.labelWidth>O)C.rect.x-=(C.labelWidth-O)/2,C.setWidth(C.labelWidth),C.labelMarginLeft=(C.labelWidth-O)/2;else if(C.labelPosHorizontal=="right")C.setWidth(O+C.labelWidth)}if(C.labelHeight){if(C.labelPosVertical=="top")C.rect.y-=C.labelHeight,C.setHeight(B+C.labelHeight),C.labelMarginTop=C.labelHeight;else if(C.labelPosVertical=="center"&&C.labelHeight>B)C.rect.y-=(C.labelHeight-B)/2,C.setHeight(C.labelHeight),C.labelMarginTop=(C.labelHeight-B)/2;else if(C.labelPosVertical=="bottom")C.setHeight(B+C.labelHeight)}}})},R.prototype.tileNodes=function(w,x){var T=this.tileNodesByFavoringDim(w,x,!0),D=this.tileNodesByFavoringDim(w,x,!1),C=this.getOrgRatio(T),O=this.getOrgRatio(D),B;if(O<C)B=D;else B=T;return B},R.prototype.getOrgRatio=function(w){var{width:x,height:T}=w,D=x/T;if(D<1)D=1/D;return D},R.prototype.calcIdealRowWidth=function(w,x){var{TILING_PADDING_VERTICAL:T,TILING_PADDING_HORIZONTAL:D}=c,C=w.length,O=0,B=0,z=0;w.forEach(function(Q){if(O+=Q.getWidth(),B+=Q.getHeight(),Q.getWidth()>z)z=Q.getWidth()});var V=O/C,k=B/C,G=Math.pow(T-D,2)+4*(V+D)*(k+T)*C,J=(D-T+Math.sqrt(G))/(2*(V+D)),X;if(x){if(X=Math.ceil(J),X==J)X++}else X=Math.floor(J);var _=X*(V+D)-D;if(z>_)_=z;return _+=D*2,_},R.prototype.tileNodesByFavoringDim=function(w,x,T){var{TILING_PADDING_VERTICAL:D,TILING_PADDING_HORIZONTAL:C,TILING_COMPARE_BY:O}=c,B={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:D,horizontalPadding:C,centerX:0,centerY:0};if(O)B.idealRowWidth=this.calcIdealRowWidth(w,T);var z=function(q){return q.rect.width*q.rect.height},V=function(q,te){return z(te)-z(q)};w.sort(function(Q,q){var te=V;if(B.idealRowWidth)return te=O,te(Q.id,q.id);return te(Q,q)});var k=0,G=0;for(var J=0;J<w.length;J++){var X=w[J];k+=X.getCenterX(),G+=X.getCenterY()}B.centerX=k/w.length,B.centerY=G/w.length;for(var J=0;J<w.length;J++){var X=w[J];if(B.rows.length==0)this.insertNodeToRow(B,X,0,x);else if(this.canAddHorizontal(B,X.rect.width,X.rect.height)){var _=B.rows.length-1;if(!B.idealRowWidth)_=this.getShortestRowIndex(B);this.insertNodeToRow(B,X,_,x)}else this.insertNodeToRow(B,X,B.rows.length,x);this.shiftToLastRow(B)}return B},R.prototype.insertNodeToRow=function(w,x,T,D){var C=D;if(T==w.rows.length){var O=[];w.rows.push(O),w.rowWidth.push(C),w.rowHeight.push(0)}var B=w.rowWidth[T]+x.rect.width;if(w.rows[T].length>0)B+=w.horizontalPadding;if(w.rowWidth[T]=B,w.width<B)w.width=B;var z=x.rect.height;if(T>0)z+=w.verticalPadding;var V=0;if(z>w.rowHeight[T])V=w.rowHeight[T],w.rowHeight[T]=z,V=w.rowHeight[T]-V;w.height+=V,w.rows[T].push(x)},R.prototype.getShortestRowIndex=function(w){var x=-1,T=Number.MAX_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]<T)x=D,T=w.rowWidth[D];return x},R.prototype.getLongestRowIndex=function(w){var x=-1,T=Number.MIN_VALUE;for(var D=0;D<w.rows.length;D++)if(w.rowWidth[D]>T)x=D,T=w.rowWidth[D];return x},R.prototype.canAddHorizontal=function(w,x,T){if(w.idealRowWidth){var D=w.rows.length-1,C=w.rowWidth[D];return C+x+w.horizontalPadding<=w.idealRowWidth}var O=this.getShortestRowIndex(w);if(O<0)return!0;var B=w.rowWidth[O];if(B+w.horizontalPadding+x<=w.width)return!0;var z=0;if(w.rowHeight[O]<T){if(O>0)z=T+w.verticalPadding-w.rowHeight[O]}var V;if(w.width-B>=x+w.horizontalPadding)V=(w.height+z)/(B+x+w.horizontalPadding);else V=(w.height+z)/w.width;z=T+w.verticalPadding;var k;if(w.width<x)k=(w.height+z)/x;else k=(w.height+z)/w.width;if(k<1)k=1/k;if(V<1)V=1/V;return V<k},R.prototype.shiftToLastRow=function(w){var x=this.getLongestRowIndex(w),T=w.rowWidth.length-1,D=w.rows[x],C=D[D.length-1],O=C.width+w.horizontalPadding;if(w.width-w.rowWidth[T]>O&&x!=T){D.splice(-1,1),w.rows[T].push(C),w.rowWidth[x]=w.rowWidth[x]-O,w.rowWidth[T]=w.rowWidth[T]+O,w.width=w.rowWidth[instance.getLongestRowIndex(w)];var B=Number.MIN_VALUE;for(var z=0;z<D.length;z++)if(D[z].height>B)B=D[z].height;if(x>0)B+=w.verticalPadding;var V=w.rowHeight[x]+w.rowHeight[T];if(w.rowHeight[x]=B,w.rowHeight[T]<C.height+w.verticalPadding)w.rowHeight[T]=C.height+w.verticalPadding;var k=w.rowHeight[x]+w.rowHeight[T];w.height+=k-V,this.shiftToLastRow(w)}},R.prototype.tilingPreLayout=function(){if(c.TILE)this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers()},R.prototype.tilingPostLayout=function(){if(c.TILE)this.repopulateZeroDegreeMembers(),this.repopulateCompounds()},R.prototype.reduceTrees=function(){var w=[],x=!0,T;while(x){var D=this.graphManager.getAllNodes(),C=[];x=!1;for(var O=0;O<D.length;O++)if(T=D[O],T.getEdges().length==1&&!T.getEdges()[0].isInterGraph&&T.getChild()==null){if(c.PURE_INCREMENTAL){var B=T.getEdges()[0].getOtherEnd(T),z=new b(T.getCenterX()-B.getCenterX(),T.getCenterY()-B.getCenterY());C.push([T,T.getEdges()[0],T.getOwner(),z])}else C.push([T,T.getEdges()[0],T.getOwner()]);x=!0}if(x==!0){var V=[];for(var k=0;k<C.length;k++)if(C[k][0].getEdges().length==1)V.push(C[k]),C[k][0].getOwner().remove(C[k][0]);w.push(V),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=w},R.prototype.growTree=function(w){var x=w.length,T=w[x-1],D;for(var C=0;C<T.length;C++)D=T[C],this.findPlaceforPrunedNode(D),D[2].add(D[0]),D[2].add(D[1],D[1].source,D[1].target);w.splice(w.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},R.prototype.findPlaceforPrunedNode=function(w){var x,T,D=w[0];if(D==w[1].source)T=w[1].target;else T=w[1].source;if(c.PURE_INCREMENTAL)D.setCenter(T.getCenterX()+w[3].getWidth(),T.getCenterY()+w[3].getHeight());else{var C=T.startX,O=T.finishX,B=T.startY,z=T.finishY,V=0,k=0,G=0,J=0,X=[V,G,k,J];if(B>0)for(var _=C;_<=O;_++)X[0]+=this.grid[_][B-1].length+this.grid[_][B].length-1;if(O<this.grid.length-1)for(var _=B;_<=z;_++)X[1]+=this.grid[O+1][_].length+this.grid[O][_].length-1;if(z<this.grid[0].length-1)for(var _=C;_<=O;_++)X[2]+=this.grid[_][z+1].length+this.grid[_][z].length-1;if(C>0)for(var _=B;_<=z;_++)X[3]+=this.grid[C-1][_].length+this.grid[C][_].length-1;var Q=A.MAX_VALUE,q,te;for(var Z=0;Z<X.length;Z++)if(X[Z]<Q)Q=X[Z],q=1,te=Z;else if(X[Z]==Q)q++;if(q==3&&Q==0){if(X[0]==0&&X[1]==0&&X[2]==0)x=1;else if(X[0]==0&&X[1]==0&&X[3]==0)x=0;else if(X[0]==0&&X[2]==0&&X[3]==0)x=3;else if(X[1]==0&&X[2]==0&&X[3]==0)x=2}else if(q==2&&Q==0){var U=Math.floor(Math.random()*2);if(X[0]==0&&X[1]==0)if(U==0)x=0;else x=1;else if(X[0]==0&&X[2]==0)if(U==0)x=0;else x=2;else if(X[0]==0&&X[3]==0)if(U==0)x=0;else x=3;else if(X[1]==0&&X[2]==0)if(U==0)x=1;else x=2;else if(X[1]==0&&X[3]==0)if(U==0)x=1;else x=3;else if(U==0)x=2;else x=3}else if(q==4&&Q==0){var U=Math.floor(Math.random()*4);x=U}else x=te;if(x==0)D.setCenter(T.getCenterX(),T.getCenterY()-T.getHeight()/2-g.DEFAULT_EDGE_LENGTH-D.getHeight()/2);else if(x==1)D.setCenter(T.getCenterX()+T.getWidth()/2+g.DEFAULT_EDGE_LENGTH+D.getWidth()/2,T.getCenterY());else if(x==2)D.setCenter(T.getCenterX(),T.getCenterY()+T.getHeight()/2+g.DEFAULT_EDGE_LENGTH+D.getHeight()/2);else D.setCenter(T.getCenterX()-T.getWidth()/2-g.DEFAULT_EDGE_LENGTH-D.getWidth()/2,T.getCenterY())}},i.exports=R},991:(i,s,o)=>{var l=o(551).FDLayoutNode,u=o(551).IMath;function f(h,c,d,g){l.call(this,h,c,d,g)}f.prototype=Object.create(l.prototype);for(var v in l)f[v]=l[v];f.prototype.calculateDisplacement=function(){var h=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight)this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight;else this.displacementX+=h.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY+=h.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>h.coolingFactor*h.maxNodeDisplacement)this.displacementX=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementX);if(Math.abs(this.displacementY)>h.coolingFactor*h.maxNodeDisplacement)this.displacementY=h.coolingFactor*h.maxNodeDisplacement*u.sign(this.displacementY);if(this.child&&this.child.getNodes().length>0)this.propogateDisplacementToChildren(this.displacementX,this.displacementY)},f.prototype.propogateDisplacementToChildren=function(h,c){var d=this.getChild().getNodes(),g;for(var y=0;y<d.length;y++)if(g=d[y],g.getChild()==null)g.displacementX+=h,g.displacementY+=c;else g.propogateDisplacementToChildren(h,c)},f.prototype.move=function(){var h=this.graphManager.getLayout();if(this.child==null||this.child.getNodes().length==0)this.moveBy(this.displacementX,this.displacementY),h.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},f.prototype.setPred1=function(h){this.pred1=h},f.prototype.getPred1=function(){return pred1},f.prototype.getPred2=function(){return pred2},f.prototype.setNext=function(h){this.next=h},f.prototype.getNext=function(){return next},f.prototype.setProcessed=function(h){this.processed=h},f.prototype.isProcessed=function(){return processed},i.exports=f},902:(i,s,o)=>{function l(d){if(Array.isArray(d)){for(var g=0,y=Array(d.length);g<d.length;g++)y[g]=d[g];return y}else return Array.from(d)}var u=o(806),f=o(551).LinkedList,v=o(551).Matrix,h=o(551).SVD;function c(){}c.handleConstraints=function(d){var g={};g.fixedNodeConstraint=d.constraints.fixedNodeConstraint,g.alignmentConstraint=d.constraints.alignmentConstraint,g.relativePlacementConstraint=d.constraints.relativePlacementConstraint;var y=new Map,p=new Map,m=[],b=[],E=d.getAllNodes(),A=0;for(var M=0;M<E.length;M++){var S=E[M];if(S.getChild()==null)p.set(S.id,A++),m.push(S.getCenterX()),b.push(S.getCenterY()),y.set(S.id,S)}if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(!L.gap&&L.gap!=0)if(L.left)L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.left).getWidth()/2+y.get(L.right).getWidth()/2;else L.gap=u.DEFAULT_EDGE_LENGTH+y.get(L.top).getHeight()/2+y.get(L.bottom).getHeight()/2});var P=function(F,Y){return{x:F.x-Y.x,y:F.y-Y.y}},N=function(F){var Y=0,H=0;return F.forEach(function(K){Y+=m[p.get(K)],H+=b[p.get(K)]}),{x:Y/F.size,y:H/F.size}},R=function(F,Y,H,K,se){function ae(ce,pe){var Ie=new Set(ce),xe=!0,me=!1,Ve=void 0;try{for(var Be=pe[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie.add(He)}}catch(Le){me=!0,Ve=Le}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}return Ie}var oe=new Map;F.forEach(function(ce,pe){oe.set(pe,0)}),F.forEach(function(ce,pe){ce.forEach(function(Ie){oe.set(Ie.id,oe.get(Ie.id)+1)})});var ne=new Map,ue=new Map,be=new f;if(oe.forEach(function(ce,pe){if(ce==0){if(be.push(pe),!H)if(Y=="horizontal")ne.set(pe,p.has(pe)?m[p.get(pe)]:K.get(pe));else ne.set(pe,p.has(pe)?b[p.get(pe)]:K.get(pe))}else ne.set(pe,Number.NEGATIVE_INFINITY);if(H)ue.set(pe,new Set([pe]))}),H)se.forEach(function(ce){var pe=[];if(ce.forEach(function(me){if(H.has(me))pe.push(me)}),pe.length>0){var Ie=0;pe.forEach(function(me){if(Y=="horizontal")ne.set(me,p.has(me)?m[p.get(me)]:K.get(me)),Ie+=ne.get(me);else ne.set(me,p.has(me)?b[p.get(me)]:K.get(me)),Ie+=ne.get(me)}),Ie=Ie/pe.length,ce.forEach(function(me){if(!H.has(me))ne.set(me,Ie)})}else{var xe=0;ce.forEach(function(me){if(Y=="horizontal")xe+=p.has(me)?m[p.get(me)]:K.get(me);else xe+=p.has(me)?b[p.get(me)]:K.get(me)}),xe=xe/ce.length,ce.forEach(function(me){ne.set(me,xe)})}});var fe=function(){var pe=be.shift(),Ie=F.get(pe);Ie.forEach(function(xe){if(ne.get(xe.id)<ne.get(pe)+xe.gap)if(H&&H.has(xe.id)){var me=void 0;if(Y=="horizontal")me=p.has(xe.id)?m[p.get(xe.id)]:K.get(xe.id);else me=p.has(xe.id)?b[p.get(xe.id)]:K.get(xe.id);if(ne.set(xe.id,me),me<ne.get(pe)+xe.gap){var Ve=ne.get(pe)+xe.gap-me;ue.get(pe).forEach(function(Be){ne.set(Be,ne.get(Be)-Ve)})}}else ne.set(xe.id,ne.get(pe)+xe.gap);if(oe.set(xe.id,oe.get(xe.id)-1),oe.get(xe.id)==0)be.push(xe.id);if(H)ue.set(xe.id,ae(ue.get(pe),ue.get(xe.id)))})};while(be.length!=0)fe();if(H){var le=new Set;F.forEach(function(ce,pe){if(ce.length==0)le.add(pe)});var De=[];ue.forEach(function(ce,pe){if(le.has(pe)){var Ie=!1,xe=!0,me=!1,Ve=void 0;try{for(var Be=ce[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;if(H.has(He))Ie=!0}}catch(Ye){me=!0,Ve=Ye}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}if(!Ie){var Le=!1,nt=void 0;if(De.forEach(function(Ye,tt){if(Ye.has([].concat(l(ce))[0]))Le=!0,nt=tt}),!Le)De.push(new Set(ce));else ce.forEach(function(Ye){De[nt].add(Ye)})}}}),De.forEach(function(ce,pe){var{POSITIVE_INFINITY:Ie,POSITIVE_INFINITY:xe,NEGATIVE_INFINITY:me,NEGATIVE_INFINITY:Ve}=Number,Be=!0,Ke=!1,He=void 0;try{for(var Le=ce[Symbol.iterator](),nt;!(Be=(nt=Le.next()).done);Be=!0){var Ye=nt.value,tt=void 0;if(Y=="horizontal")tt=p.has(Ye)?m[p.get(Ye)]:K.get(Ye);else tt=p.has(Ye)?b[p.get(Ye)]:K.get(Ye);var dt=ne.get(Ye);if(tt<Ie)Ie=tt;if(tt>me)me=tt;if(dt<xe)xe=dt;if(dt>Ve)Ve=dt}}catch(fr){Ke=!0,He=fr}finally{try{if(!Be&&Le.return)Le.return()}finally{if(Ke)throw He}}var qt=(Ie+me)/2-(xe+Ve)/2,ot=!0,rt=!1,ft=void 0;try{for(var Ft=ce[Symbol.iterator](),xt;!(ot=(xt=Ft.next()).done);ot=!0){var rr=xt.value;ne.set(rr,ne.get(rr)+qt)}}catch(fr){rt=!0,ft=fr}finally{try{if(!ot&&Ft.return)Ft.return()}finally{if(rt)throw ft}}})}return ne},I=function(F){var Y=0,H=0,K=0,se=0;if(F.forEach(function(ue){if(ue.left)m[p.get(ue.left)]-m[p.get(ue.right)]>=0?Y++:H++;else b[p.get(ue.top)]-b[p.get(ue.bottom)]>=0?K++:se++}),Y>H&&K>se)for(var ae=0;ae<p.size;ae++)m[ae]=-1*m[ae],b[ae]=-1*b[ae];else if(Y>H)for(var oe=0;oe<p.size;oe++)m[oe]=-1*m[oe];else if(K>se)for(var ne=0;ne<p.size;ne++)b[ne]=-1*b[ne]},w=function(F){var Y=[],H=new f,K=new Set,se=0;return F.forEach(function(ae,oe){if(!K.has(oe)){Y[se]=[];var ne=oe;H.push(ne),K.add(ne),Y[se].push(ne);while(H.length!=0){ne=H.shift();var ue=F.get(ne);ue.forEach(function(be){if(!K.has(be.id))H.push(be.id),K.add(be.id),Y[se].push(be.id)})}se++}}),Y},x=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(K).push(se),Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},T=function(F){var Y=new Map;return F.forEach(function(H,K){Y.set(K,[])}),F.forEach(function(H,K){H.forEach(function(se){Y.get(se.id).push({id:K,gap:se.gap,direction:se.direction})})}),Y},D=[],C=[],O=!1,B=!1,z=new Set,V=new Map,k=new Map,G=[];if(g.fixedNodeConstraint)g.fixedNodeConstraint.forEach(function(L){z.add(L.nodeId)});if(g.relativePlacementConstraint)g.relativePlacementConstraint.forEach(function(L){if(L.left){if(V.has(L.left))V.get(L.left).push({id:L.right,gap:L.gap,direction:"horizontal"});else V.set(L.left,[{id:L.right,gap:L.gap,direction:"horizontal"}]);if(!V.has(L.right))V.set(L.right,[])}else{if(V.has(L.top))V.get(L.top).push({id:L.bottom,gap:L.gap,direction:"vertical"});else V.set(L.top,[{id:L.bottom,gap:L.gap,direction:"vertical"}]);if(!V.has(L.bottom))V.set(L.bottom,[])}}),k=x(V),G=w(k);if(u.TRANSFORM_ON_CONSTRAINT_HANDLING){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>1)g.fixedNodeConstraint.forEach(function(L,F){D[F]=[L.position.x,L.position.y],C[F]=[m[p.get(L.nodeId)],b[p.get(L.nodeId)]]}),O=!0;else if(g.alignmentConstraint)(function(){var L=0;if(g.alignmentConstraint.vertical){var F=g.alignmentConstraint.vertical,Y=function(ne){var ue=new Set;F[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).x;F[ne].forEach(function(le){D[L]=[fe,b[p.get(le)]],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var H=0;H<F.length;H++)Y(H);O=!0}if(g.alignmentConstraint.horizontal){var K=g.alignmentConstraint.horizontal,se=function(ne){var ue=new Set;K[ne].forEach(function(le){ue.add(le)});var be=new Set([].concat(l(ue)).filter(function(le){return z.has(le)})),fe=void 0;if(be.size>0)fe=m[p.get(be.values().next().value)];else fe=N(ue).y;K[ne].forEach(function(le){D[L]=[m[p.get(le)],fe],C[L]=[m[p.get(le)],b[p.get(le)]],L++})};for(var ae=0;ae<K.length;ae++)se(ae);O=!0}if(g.relativePlacementConstraint)B=!0})();else if(g.relativePlacementConstraint){var J=0,X=0;for(var _=0;_<G.length;_++)if(G[_].length>J)J=G[_].length,X=_;if(J<k.size/2)I(g.relativePlacementConstraint),O=!1,B=!1;else{var Q=new Map,q=new Map,te=[];G[X].forEach(function(L){V.get(L).forEach(function(F){if(F.direction=="horizontal"){if(Q.has(L))Q.get(L).push(F);else Q.set(L,[F]);if(!Q.has(F.id))Q.set(F.id,[]);te.push({left:L,right:F.id})}else{if(q.has(L))q.get(L).push(F);else q.set(L,[F]);if(!q.has(F.id))q.set(F.id,[]);te.push({top:L,bottom:F.id})}})}),I(te),B=!1;var Z=R(Q,"horizontal"),U=R(q,"vertical");G[X].forEach(function(L,F){if(C[F]=[m[p.get(L)],b[p.get(L)]],D[F]=[],Z.has(L))D[F][0]=Z.get(L);else D[F][0]=m[p.get(L)];if(U.has(L))D[F][1]=U.get(L);else D[F][1]=b[p.get(L)]}),O=!0}}if(O){var W=void 0,j=v.transpose(D),re=v.transpose(C);for(var ee=0;ee<j.length;ee++)j[ee]=v.multGamma(j[ee]),re[ee]=v.multGamma(re[ee]);var de=v.multMat(j,v.transpose(re)),Ae=h.svd(de);W=v.multMat(Ae.V,v.transpose(Ae.U));for(var Te=0;Te<p.size;Te++){var Ce=[m[Te],b[Te]],ge=[W[0][0],W[1][0]],ve=[W[0][1],W[1][1]];m[Te]=v.dotProduct(Ce,ge),b[Te]=v.dotProduct(Ce,ve)}if(B)I(g.relativePlacementConstraint)}}if(u.ENFORCE_CONSTRAINTS){if(g.fixedNodeConstraint&&g.fixedNodeConstraint.length>0){var ye={x:0,y:0};g.fixedNodeConstraint.forEach(function(L,F){var Y={x:m[p.get(L.nodeId)],y:b[p.get(L.nodeId)]},H=L.position,K=P(H,Y);ye.x+=K.x,ye.y+=K.y}),ye.x/=g.fixedNodeConstraint.length,ye.y/=g.fixedNodeConstraint.length,m.forEach(function(L,F){m[F]+=ye.x}),b.forEach(function(L,F){b[F]+=ye.y}),g.fixedNodeConstraint.forEach(function(L){m[p.get(L.nodeId)]=L.position.x,b[p.get(L.nodeId)]=L.position.y})}if(g.alignmentConstraint){if(g.alignmentConstraint.vertical){var Ee=g.alignmentConstraint.vertical,Pe=function(F){var Y=new Set;Ee[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=m[p.get(H.values().next().value)];else K=N(Y).x;Y.forEach(function(se){if(!z.has(se))m[p.get(se)]=K})};for(var Me=0;Me<Ee.length;Me++)Pe(Me)}if(g.alignmentConstraint.horizontal){var Ne=g.alignmentConstraint.horizontal,Fe=function(F){var Y=new Set;Ne[F].forEach(function(se){Y.add(se)});var H=new Set([].concat(l(Y)).filter(function(se){return z.has(se)})),K=void 0;if(H.size>0)K=b[p.get(H.values().next().value)];else K=N(Y).y;Y.forEach(function(se){if(!z.has(se))b[p.get(se)]=K})};for(var ze=0;ze<Ne.length;ze++)Fe(ze)}}if(g.relativePlacementConstraint)(function(){var L=new Map,F=new Map,Y=new Map,H=new Map,K=new Map,se=new Map,ae=new Set,oe=new Set;if(z.forEach(function(vt){ae.add(vt),oe.add(vt)}),g.alignmentConstraint){if(g.alignmentConstraint.vertical){var ne=g.alignmentConstraint.vertical,ue=function(ke){Y.set("dummy"+ke,[]),ne[ke].forEach(function(Ge){if(L.set(Ge,"dummy"+ke),Y.get("dummy"+ke).push(Ge),z.has(Ge))ae.add("dummy"+ke)}),K.set("dummy"+ke,m[p.get(ne[ke][0])])};for(var be=0;be<ne.length;be++)ue(be)}if(g.alignmentConstraint.horizontal){var fe=g.alignmentConstraint.horizontal,le=function(ke){H.set("dummy"+ke,[]),fe[ke].forEach(function(Ge){if(F.set(Ge,"dummy"+ke),H.get("dummy"+ke).push(Ge),z.has(Ge))oe.add("dummy"+ke)}),se.set("dummy"+ke,b[p.get(fe[ke][0])])};for(var De=0;De<fe.length;De++)le(De)}}var ce=new Map,pe=new Map,Ie=function(ke){V.get(ke).forEach(function(Ge){var Vt=void 0,Rt=void 0;if(Ge.direction=="horizontal"){if(Vt=L.get(ke)?L.get(ke):ke,L.get(Ge.id))Rt={id:L.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(ce.has(Vt))ce.get(Vt).push(Rt);else ce.set(Vt,[Rt]);if(!ce.has(Rt.id))ce.set(Rt.id,[])}else{if(Vt=F.get(ke)?F.get(ke):ke,F.get(Ge.id))Rt={id:F.get(Ge.id),gap:Ge.gap,direction:Ge.direction};else Rt=Ge;if(pe.has(Vt))pe.get(Vt).push(Rt);else pe.set(Vt,[Rt]);if(!pe.has(Rt.id))pe.set(Rt.id,[])}})},xe=!0,me=!1,Ve=void 0;try{for(var Be=V.keys()[Symbol.iterator](),Ke;!(xe=(Ke=Be.next()).done);xe=!0){var He=Ke.value;Ie(He)}}catch(vt){me=!0,Ve=vt}finally{try{if(!xe&&Be.return)Be.return()}finally{if(me)throw Ve}}var Le=x(ce),nt=x(pe),Ye=w(Le),tt=w(nt),dt=T(ce),qt=T(pe),ot=[],rt=[];Ye.forEach(function(vt,ke){ot[ke]=[],vt.forEach(function(Ge){if(dt.get(Ge).length==0)ot[ke].push(Ge)})}),tt.forEach(function(vt,ke){rt[ke]=[],vt.forEach(function(Ge){if(qt.get(Ge).length==0)rt[ke].push(Ge)})});var ft=R(ce,"horizontal",ae,K,ot),Ft=R(pe,"vertical",oe,se,rt),xt=function(ke){if(Y.get(ke))Y.get(ke).forEach(function(Ge){m[p.get(Ge)]=ft.get(ke)});else m[p.get(ke)]=ft.get(ke)},rr=!0,fr=!1,ln=void 0;try{for(var wa=ft.keys()[Symbol.iterator](),fn;!(rr=(fn=wa.next()).done);rr=!0){var Ea=fn.value;xt(Ea)}}catch(vt){fr=!0,ln=vt}finally{try{if(!rr&&wa.return)wa.return()}finally{if(fr)throw ln}}var ci=function(ke){if(H.get(ke))H.get(ke).forEach(function(Ge){b[p.get(Ge)]=Ft.get(ke)});else b[p.get(ke)]=Ft.get(ke)},xa=!0,vr=!1,$r=void 0;try{for(var hr=Ft.keys()[Symbol.iterator](),Ta;!(xa=(Ta=hr.next()).done);xa=!0){var Ea=Ta.value;ci(Ea)}}catch(vt){vr=!0,$r=vt}finally{try{if(!xa&&hr.return)hr.return()}finally{if(vr)throw $r}}})()}for(var Ue=0;Ue<E.length;Ue++){var ie=E[Ue];if(ie.getChild()==null)ie.setCenter(m[p.get(ie.id)],b[p.get(ie.id)])}},i.exports=c},551:(i)=>{i.exports=t}},r={};function a(i){var s=r[i];if(s!==void 0)return s.exports;var o=r[i]={exports:{}};return e[i](o,o.exports,a),o.exports}var n=a(45);return n})()})});function Ys(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,a=Array(e);r<e;r++)a[r]=t[r];return a}function fh(t){if(Array.isArray(t))return t}function vh(t){if(Array.isArray(t))return Ys(t)}function Mr(t,e){if(!(t instanceof e))throw TypeError("Cannot call a class as a function")}function hh(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,gf(a.key),a)}}function Lr(t,e,r){return e&&hh(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function kt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=fo(t))||e){r&&(t=r);var a=0,n=function(){};return{s:n,n:function(){return a>=t.length?{done:!0}:{done:!1,value:t[a++]}},e:function(l){throw l},f:n}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,i=l},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw i}}}}function df(t,e,r){return(e=gf(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ch(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function dh(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var a,n,i,s,o=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(a=i.call(r)).done)&&(o.push(a.value),o.length!==e);l=!0);}catch(f){u=!0,n=f}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return o}}function gh(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ph(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ct(t,e){return fh(t)||dh(t,e)||fo(t,e)||gh()}function Bn(t){return vh(t)||ch(t)||fo(t)||ph()}function yh(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e);if(typeof a!="object")return a;throw TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function gf(t){var e=yh(t,"string");return typeof e=="symbol"?e:e+""}function yt(t){return yt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(t)}function fo(t,e){if(t){if(typeof t=="string")return Ys(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ys(t,e):void 0}}var gt=typeof window>"u"?null:window,Vo=gt?gt.navigator:null;gt&>.document;var mh=yt(""),pf=yt({}),bh=yt(function(){}),wh=typeof HTMLElement>"u"?"undefined":yt(HTMLElement),Ka=function(e){return e&&e.instanceString&&st(e.instanceString)?e.instanceString():null},Re=function(e){return e!=null&&yt(e)==mh},st=function(e){return e!=null&&yt(e)===bh},Je=function(e){return!zt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},We=function(e){return e!=null&&yt(e)===pf&&!Je(e)&&e.constructor===Object},Eh=function(e){return e!=null&&yt(e)===pf},he=function(e){return e!=null&&yt(e)===yt(1)&&!isNaN(e)},yf=function(e){return he(e)&&Math.floor(e)===e},kn=function(e){if(wh==="undefined")return;else return e!=null&&e instanceof HTMLElement},zt=function(e){return Za(e)||mf(e)},Za=function(e){return Ka(e)==="collection"&&e._private.single},mf=function(e){return Ka(e)==="collection"&&!e._private.single},vo=function(e){return Ka(e)==="core"},bf=function(e){return Ka(e)==="stylesheet"},xh=function(e){return Ka(e)==="event"},xr=function(e){if(e===void 0||e===null)return!0;else if(e===""||e.match(/^\s+$/))return!0;return!1},Th=function(e){if(typeof HTMLElement>"u")return!1;else return e instanceof HTMLElement},Ch=function(e){return We(e)&&he(e.x1)&&he(e.x2)&&he(e.y1)&&he(e.y2)},Sh=function(e){return Eh(e)&&st(e.then)},Dh=function(){return Vo&&Vo.userAgent.match(/msie|trident|edge/i)},la=function(e,r){if(!r)r=function(){if(arguments.length===1)return arguments[0];else if(arguments.length===0)return"undefined";var i=[];for(var s=0;s<arguments.length;s++)i.push(arguments[s]);return i.join("$")};var a=function(){var i=this,s=arguments,o,l=r.apply(i,s),u=a.cache;if(!(o=u[l]))o=u[l]=e.apply(i,s);return o};return a.cache={},a},ho=la(function(t){return t.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),Zn=la(function(t){return t.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),wf=la(function(t,e){return t+e[0].toUpperCase()+e.substring(1)},function(t,e){return t+"$"+e}),Go=function(e){if(xr(e))return e;return e.charAt(0).toUpperCase()+e.substring(1)},yr=function(e,r){return e.slice(-1*r.length)===r},pt="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",Ah="rgb[a]?\\(("+pt+"[%]?)\\s*,\\s*("+pt+"[%]?)\\s*,\\s*("+pt+"[%]?)(?:\\s*,\\s*("+pt+"))?\\)",Mh="rgb[a]?\\((?:"+pt+"[%]?)\\s*,\\s*(?:"+pt+"[%]?)\\s*,\\s*(?:"+pt+"[%]?)(?:\\s*,\\s*(?:"+pt+"))?\\)",Lh="hsl[a]?\\(("+pt+")\\s*,\\s*("+pt+"[%])\\s*,\\s*("+pt+"[%])(?:\\s*,\\s*("+pt+"))?\\)",Rh="hsl[a]?\\((?:"+pt+")\\s*,\\s*(?:"+pt+"[%])\\s*,\\s*(?:"+pt+"[%])(?:\\s*,\\s*(?:"+pt+"))?\\)",Ph="\\#[0-9a-fA-F]{3}",Nh="\\#[0-9a-fA-F]{6}",Ef=function(e,r){if(e<r)return-1;else if(e>r)return 1;else return 0},Oh=function(e,r){return-1*Ef(e,r)},Oe=Object.assign!=null?Object.assign.bind(Object):function(t){var e=arguments;for(var r=1;r<e.length;r++){var a=e[r];if(a==null)continue;var n=Object.keys(a);for(var i=0;i<n.length;i++){var s=n[i];t[s]=a[s]}}return t},Ih=function(e){if(!(e.length===4||e.length===7)||e[0]!=="#")return;var r=e.length===4,a,n,i,s=16;if(r)a=parseInt(e[1]+e[1],s),n=parseInt(e[2]+e[2],s),i=parseInt(e[3]+e[3],s);else a=parseInt(e[1]+e[2],s),n=parseInt(e[3]+e[4],s),i=parseInt(e[5]+e[6],s);return[a,n,i]},Bh=function(e){var r,a,n,i,s,o,l,u;function f(d,g,y){if(y<0)y+=1;if(y>1)y-=1;if(y<0.16666666666666666)return d+(g-d)*6*y;if(y<0.5)return g;if(y<0.6666666666666666)return d+(g-d)*(0.6666666666666666-y)*6;return d}var v=new RegExp("^"+Lh+"$").exec(e);if(v){if(a=parseInt(v[1]),a<0)a=(360- -1*a%360)%360;else if(a>360)a=a%360;if(a/=360,n=parseFloat(v[2]),n<0||n>100)return;if(n=n/100,i=parseFloat(v[3]),i<0||i>100)return;if(i=i/100,s=v[4],s!==void 0){if(s=parseFloat(s),s<0||s>1)return}if(n===0)o=l=u=Math.round(i*255);else{var h=i<0.5?i*(1+n):i+n-i*n,c=2*i-h;o=Math.round(255*f(c,h,a+0.3333333333333333)),l=Math.round(255*f(c,h,a)),u=Math.round(255*f(c,h,a-0.3333333333333333))}r=[o,l,u,s]}return r},kh=function(e){var r,a=new RegExp("^"+Ah+"$").exec(e);if(a){r=[];var n=[];for(var i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%")n[i]=!0;if(s=parseFloat(s),n[i])s=s/100*255;if(s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},Fh=function(e){return zh[e.toLowerCase()]},xf=function(e){return(Je(e)?e:null)||Fh(e)||Ih(e)||kh(e)||Bh(e)},zh={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Tf=function(e){var{map:r,keys:a}=e,n=a.length;for(var i=0;i<n;i++){var s=a[i];if(We(s))throw Error("Tried to set map with object key");if(i<a.length-1){if(r[s]==null)r[s]={};r=r[s]}else r[s]=e.value}},Cf=function(e){var{map:r,keys:a}=e,n=a.length;for(var i=0;i<n;i++){var s=a[i];if(We(s))throw Error("Tried to get map with object key");if(r=r[s],r==null)return r}return r},vn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _a(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var di,Uo;function Qa(){if(Uo)return di;Uo=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return di=t,di}var gi,Ho;function Vh(){if(Ho)return gi;Ho=1;var t=typeof vn=="object"&&vn&&vn.Object===Object&&vn;return gi=t,gi}var pi,qo;function _n(){if(qo)return pi;qo=1;var t=Vh(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return pi=r,pi}var yi,Yo;function Gh(){if(Yo)return yi;Yo=1;var t=_n(),e=function(){return t.Date.now()};return yi=e,yi}var mi,Xo;function Uh(){if(Xo)return mi;Xo=1;var t=/\s/;function e(r){var a=r.length;while(a--&&t.test(r.charAt(a)));return a}return mi=e,mi}var bi,Wo;function Hh(){if(Wo)return bi;Wo=1;var t=Uh(),e=/^\s+/;function r(a){return a?a.slice(0,t(a)+1).replace(e,""):a}return bi=r,bi}var wi,$o;function co(){if($o)return wi;$o=1;var t=_n(),e=t.Symbol;return wi=e,wi}var Ei,Ko;function qh(){if(Ko)return Ei;Ko=1;var t=co(),e=Object.prototype,{hasOwnProperty:r,toString:a}=e,n=t?t.toStringTag:void 0;function i(s){var o=r.call(s,n),l=s[n];try{s[n]=void 0;var u=!0}catch(v){}var f=a.call(s);if(u)if(o)s[n]=l;else delete s[n];return f}return Ei=i,Ei}var xi,Zo;function Yh(){if(Zo)return xi;Zo=1;var t=Object.prototype,e=t.toString;function r(a){return e.call(a)}return xi=r,xi}var Ti,_o;function Sf(){if(_o)return Ti;_o=1;var t=co(),e=qh(),r=Yh(),a="[object Null]",n="[object Undefined]",i=t?t.toStringTag:void 0;function s(o){if(o==null)return o===void 0?n:a;return i&&i in Object(o)?e(o):r(o)}return Ti=s,Ti}var Ci,Qo;function Xh(){if(Qo)return Ci;Qo=1;function t(e){return e!=null&&typeof e=="object"}return Ci=t,Ci}var Si,Jo;function Ja(){if(Jo)return Si;Jo=1;var t=Sf(),e=Xh(),r="[object Symbol]";function a(n){return typeof n=="symbol"||e(n)&&t(n)==r}return Si=a,Si}var Di,jo;function Wh(){if(jo)return Di;jo=1;var t=Hh(),e=Qa(),r=Ja(),a=NaN,n=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(r(u))return a;if(e(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=e(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=t(u);var v=i.test(u);return v||s.test(u)?o(u.slice(2),v?2:8):n.test(u)?a:+u}return Di=l,Di}var Ai,eu;function $h(){if(eu)return Ai;eu=1;var t=Qa(),e=Gh(),r=Wh(),a="Expected a function",{max:n,min:i}=Math;function s(o,l,u){var f,v,h,c,d,g,y=0,p=!1,m=!1,b=!0;if(typeof o!="function")throw TypeError(a);if(l=r(l)||0,t(u))p=!!u.leading,m="maxWait"in u,h=m?n(r(u.maxWait)||0,l):h,b="trailing"in u?!!u.trailing:b;function E(x){var T=f,D=v;return f=v=void 0,y=x,c=o.apply(D,T),c}function A(x){return y=x,d=setTimeout(P,l),p?E(x):c}function M(x){var T=x-g,D=x-y,C=l-T;return m?i(C,h-D):C}function S(x){var T=x-g,D=x-y;return g===void 0||T>=l||T<0||m&&D>=h}function P(){var x=e();if(S(x))return N(x);d=setTimeout(P,M(x))}function N(x){if(d=void 0,b&&f)return E(x);return f=v=void 0,c}function R(){if(d!==void 0)clearTimeout(d);y=0,f=g=v=d=void 0}function I(){return d===void 0?c:N(e())}function w(){var x=e(),T=S(x);if(f=arguments,v=this,g=x,T){if(d===void 0)return A(g);if(m)return clearTimeout(d),d=setTimeout(P,l),E(g)}if(d===void 0)d=setTimeout(P,l);return c}return w.cancel=R,w.flush=I,w}return Ai=s,Ai}var Kh=$h(),ja=_a(Kh),Mi=gt?gt.performance:null,Df=Mi&&Mi.now?function(){return Mi.now()}:function(){return Date.now()},Zh=function(){if(gt){if(gt.requestAnimationFrame)return function(t){gt.requestAnimationFrame(t)};else if(gt.mozRequestAnimationFrame)return function(t){gt.mozRequestAnimationFrame(t)};else if(gt.webkitRequestAnimationFrame)return function(t){gt.webkitRequestAnimationFrame(t)};else if(gt.msRequestAnimationFrame)return function(t){gt.msRequestAnimationFrame(t)}}return function(t){if(t)setTimeout(function(){t(Df())},16.666666666666668)}}(),Fn=function(e){return Zh(e)},ir=Df,Fr=9261,Af=65599,ta=5381,Mf=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr,a=r,n;for(;;){if(n=e.next(),n.done)break;a=a*Af+n.value|0}return a},za=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fr;return r*Af+e|0},Va=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ta;return(r<<5)+r+e|0},_h=function(e,r){return e*2097152+r},cr=function(e){return e[0]*2097152+e[1]},hn=function(e,r){return[za(e[0],r[0]),Va(e[1],r[1])]},tu=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){if(n<i)a.value=e[n++];else a.done=!0;return a}};return Mf(s,r)},Gr=function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:function(){if(n<i)a.value=e.charCodeAt(n++);else a.done=!0;return a}};return Mf(s,r)},Lf=function(){return Qh(arguments)},Qh=function(e){var r;for(var a=0;a<e.length;a++){var n=e[a];if(a===0)r=Gr(n);else r=Gr(n,r)}return r};function Jh(t,e,r,a,n){var i=n*Math.PI/180,s=Math.cos(i)*(t-r)-Math.sin(i)*(e-a)+r,o=Math.sin(i)*(t-r)+Math.cos(i)*(e-a)+a;return{x:s,y:o}}var jh=function(e,r,a,n,i,s){return{x:(e-a)*i+a,y:(r-n)*s+n}};function ec(t,e,r){if(r===0)return t;var a=(e.x1+e.x2)/2,n=(e.y1+e.y2)/2,i=e.w/e.h,s=1/i,o=Jh(t.x,t.y,a,n,r),l=jh(o.x,o.y,a,n,i,s);return{x:l.x,y:l.y}}var ru=!0,tc=console.warn!=null,rc=console.trace!=null,go=Number.MAX_SAFE_INTEGER||9007199254740991,Rf=function(){return!0},zn=function(){return!1},au=function(){return 0},po=function(){},it=function(e){throw Error(e)},Pf=function(e){if(e!==void 0)ru=!!e;else return ru},_e=function(e){if(!Pf())return;if(tc)console.warn(e);else if(console.log(e),rc)console.trace()},ac=function(e){return Oe({},e)},Jt=function(e){if(e==null)return e;if(Je(e))return e.slice();else if(We(e))return ac(e);else return e},nc=function(e){return e.slice()},Nf=function(e,r){for(r=e="";e++<36;r+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):"-");return r},ic={},Of=function(){return ic},St=function(e){var r=Object.keys(e);return function(a){var n={};for(var i=0;i<r.length;i++){var s=r[i],o=a==null?void 0:a[s];n[s]=o===void 0?e[s]:o}return n}},Tr=function(e,r,a){for(var n=e.length-1;n>=0;n--)if(e[n]===r)e.splice(n,1)},yo=function(e){e.splice(0,e.length)},sc=function(e,r){for(var a=0;a<r.length;a++){var n=r[a];e.push(n)}},Nt=function(e,r,a){if(a)r=wf(a,r);return e[r]},Qt=function(e,r,a,n){if(a)r=wf(a,r);e[r]=n},oc=function(){function t(){Mr(this,t),this._obj={}}return Lr(t,[{key:"set",value:function(r,a){return this._obj[r]=a,this}},{key:"delete",value:function(r){return this._obj[r]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(r){return this._obj[r]!==void 0}},{key:"get",value:function(r){return this._obj[r]}}])}(),nr=typeof Map<"u"?Map:oc,uc="undefined",lc=function(){function t(e){if(Mr(this,t),this._obj=Object.create(null),this.size=0,e!=null){var r;if(e.instanceString!=null&&e.instanceString()===this.instanceString())r=e.toArray();else r=e;for(var a=0;a<r.length;a++)this.add(r[a])}}return Lr(t,[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(r){var a=this._obj;if(a[r]!==1)a[r]=1,this.size++}},{key:"delete",value:function(r){var a=this._obj;if(a[r]===1)a[r]=0,this.size--}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(r){return this._obj[r]===1}},{key:"toArray",value:function(){var r=this;return Object.keys(this._obj).filter(function(a){return r.has(a)})}},{key:"forEach",value:function(r,a){return this.toArray().forEach(r,a)}}])}(),da=(typeof Set>"u"?"undefined":yt(Set))!==uc?Set:lc,Qn=function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!vo(e)){it("An element must have a core reference and parameters set");return}var n=r.group;if(n==null)if(r.data&&r.data.source!=null&&r.data.target!=null)n="edges";else n="nodes";if(n!=="nodes"&&n!=="edges"){it("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:r.selected?!0:!1,selectable:r.selectable===void 0?!0:r.selectable?!0:!1,locked:r.locked?!0:!1,grabbed:!1,grabbable:r.grabbable===void 0?!0:r.grabbable?!0:!1,pannable:r.pannable===void 0?n==="edges"?!0:!1:r.pannable?!0:!1,active:!1,classes:new da,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null)i.position.x=0;if(i.position.y==null)i.position.y=0;if(r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];if(Je(r.classes))u=r.classes;else if(Re(r.classes))u=r.classes.split(/\s+/);for(var f=0,v=u.length;f<v;f++){var h=u[f];if(!h||h==="")continue;i.classes.add(h)}if(this.createEmitter(),a===void 0||a)this.restore();var c=r.style||r.css;if(c)_e("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(c)},nu=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(a,n,i){var s;if(We(a)&&!zt(a))s=a,a=s.roots||s.root,n=s.visit,i=s.directed;i=arguments.length===2&&!st(n)?n:i,n=st(n)?n:function(){};var o=this._private.cy,l=a=Re(a)?this.filter(a):a,u=[],f=[],v={},h={},c={},d=0,g,y=this.byGroup(),{nodes:p,edges:m}=y;for(var b=0;b<l.length;b++){var E=l[b],A=E.id();if(E.isNode()){if(u.unshift(E),e.bfs)c[A]=!0,f.push(E);h[A]=0}}var M=function(){var x=e.bfs?u.shift():u.pop(),T=x.id();if(e.dfs){if(c[T])return 0;c[T]=!0,f.push(x)}var D=h[T],C=v[T],O=C!=null?C.source():null,B=C!=null?C.target():null,z=C==null?void 0:x.same(O)?B[0]:O[0],V;if(V=n(x,C,z,d++,D),V===!0)return g=x,1;if(V===!1)return 1;var k=x.connectedEdges().filter(function(Q){return(!i||Q.source().same(x))&&m.has(Q)});for(var G=0;G<k.length;G++){var J=k[G],X=J.connectedNodes().filter(function(Q){return!Q.same(x)&&p.has(Q)}),_=X.id();if(X.length!==0&&!c[_]){if(X=X[0],u.push(X),e.bfs)c[_]=!0,f.push(X);v[_]=J,h[_]=h[T]+1}}},S;while(u.length!==0){if(S=M(),S===0)continue;if(S===1)break}var P=o.collection();for(var N=0;N<f.length;N++){var R=f[N],I=v[R.id()];if(I!=null)P.push(I);P.push(R)}return{path:o.collection(P),found:o.collection(g)}}},Ga={breadthFirstSearch:nu({bfs:!0}),depthFirstSearch:nu({dfs:!0})};Ga.bfs=Ga.breadthFirstSearch;Ga.dfs=Ga.depthFirstSearch;var Cn={exports:{}},fc=Cn.exports,iu;function vc(){if(iu)return Cn.exports;return iu=1,function(t,e){(function(){var r,a,n,i,s,o,l,u,f,v,h,c,d,g,y;n=Math.floor,v=Math.min,a=function(p,m){if(p<m)return-1;if(p>m)return 1;return 0},f=function(p,m,b,E,A){var M;if(b==null)b=0;if(A==null)A=a;if(b<0)throw Error("lo must be non-negative");if(E==null)E=p.length;while(b<E)if(M=n((b+E)/2),A(m,p[M])<0)E=M;else b=M+1;return[].splice.apply(p,[b,b-b].concat(m)),m},o=function(p,m,b){if(b==null)b=a;return p.push(m),g(p,0,p.length-1,b)},s=function(p,m){var b,E;if(m==null)m=a;if(b=p.pop(),p.length)E=p[0],p[0]=b,y(p,0,m);else E=b;return E},u=function(p,m,b){var E;if(b==null)b=a;return E=p[0],p[0]=m,y(p,0,b),E},l=function(p,m,b){var E;if(b==null)b=a;if(p.length&&b(p[0],m)<0)E=[p[0],m],m=E[0],p[0]=E[1],y(p,0,b);return m},i=function(p,m){var b,E,A,M,S,P;if(m==null)m=a;M=function(){P=[];for(var N=0,R=n(p.length/2);0<=R?N<R:N>R;0<=R?N++:N--)P.push(N);return P}.apply(this).reverse(),S=[];for(E=0,A=M.length;E<A;E++)b=M[E],S.push(y(p,b,m));return S},d=function(p,m,b){var E;if(b==null)b=a;if(E=p.indexOf(m),E===-1)return;return g(p,0,E,b),y(p,E,b)},h=function(p,m,b){var E,A,M,S,P;if(b==null)b=a;if(A=p.slice(0,m),!A.length)return A;i(A,b),P=p.slice(m);for(M=0,S=P.length;M<S;M++)E=P[M],l(A,E,b);return A.sort(b).reverse()},c=function(p,m,b){var E,A,M,S,P,N,R,I,w;if(b==null)b=a;if(m*10<=p.length){if(M=p.slice(0,m).sort(b),!M.length)return M;A=M[M.length-1],R=p.slice(m);for(S=0,N=R.length;S<N;S++)if(E=R[S],b(E,A)<0)f(M,E,0,null,b),M.pop(),A=M[M.length-1];return M}i(p,b),w=[];for(P=0,I=v(m,p.length);0<=I?P<I:P>I;0<=I?++P:--P)w.push(s(p,b));return w},g=function(p,m,b,E){var A,M,S;if(E==null)E=a;A=p[b];while(b>m){if(S=b-1>>1,M=p[S],E(A,M)<0){p[b]=M,b=S;continue}break}return p[b]=A},y=function(p,m,b){var E,A,M,S,P;if(b==null)b=a;A=p.length,P=m,M=p[m],E=2*m+1;while(E<A){if(S=E+1,S<A&&!(b(p[E],p[S])<0))E=S;p[m]=p[E],m=E,E=2*m+1}return p[m]=M,g(p,P,m,b)},r=function(){p.push=o,p.pop=s,p.replace=u,p.pushpop=l,p.heapify=i,p.updateItem=d,p.nlargest=h,p.nsmallest=c;function p(m){this.cmp=m!=null?m:a,this.nodes=[]}return p.prototype.push=function(m){return o(this.nodes,m,this.cmp)},p.prototype.pop=function(){return s(this.nodes,this.cmp)},p.prototype.peek=function(){return this.nodes[0]},p.prototype.contains=function(m){return this.nodes.indexOf(m)!==-1},p.prototype.replace=function(m){return u(this.nodes,m,this.cmp)},p.prototype.pushpop=function(m){return l(this.nodes,m,this.cmp)},p.prototype.heapify=function(){return i(this.nodes,this.cmp)},p.prototype.updateItem=function(m){return d(this.nodes,m,this.cmp)},p.prototype.clear=function(){return this.nodes=[]},p.prototype.empty=function(){return this.nodes.length===0},p.prototype.size=function(){return this.nodes.length},p.prototype.clone=function(){var m=new p;return m.nodes=this.nodes.slice(0),m},p.prototype.toArray=function(){return this.nodes.slice(0)},p.prototype.insert=p.prototype.push,p.prototype.top=p.prototype.peek,p.prototype.front=p.prototype.peek,p.prototype.has=p.prototype.contains,p.prototype.copy=p.prototype.clone,p}(),function(p,m){return t.exports=m()}(this,function(){return r})}).call(fc)}(Cn),Cn.exports}var Li,su;function hc(){if(su)return Li;return su=1,Li=vc(),Li}var cc=hc(),en=_a(cc),dc=St({root:null,weight:function(e){return 1},directed:!1}),gc={dijkstra:function(e){if(!We(e)){var r=arguments;e={root:r[0],weight:r[1],directed:r[2]}}var a=dc(e),{root:n,weight:i,directed:s}=a,o=this,l=i,u=Re(n)?this.filter(n)[0]:n[0],f={},v={},h={},c=this.byGroup(),{nodes:d,edges:g}=c;g.unmergeBy(function(D){return D.isLoop()});var y=function(C){return f[C.id()]},p=function(C,O){f[C.id()]=O,m.updateItem(C)},m=new en(function(D,C){return y(D)-y(C)});for(var b=0;b<d.length;b++){var E=d[b];f[E.id()]=E.same(u)?0:1/0,m.push(E)}var A=function(C,O){var B=(s?C.edgesTo(O):C.edgesWith(O)).intersect(g),z=1/0,V;for(var k=0;k<B.length;k++){var G=B[k],J=l(G);if(J<z||!V)z=J,V=G}return{edge:V,dist:z}};while(m.size()>0){var M=m.pop(),S=y(M),P=M.id();if(h[P]=S,S===1/0)continue;var N=M.neighborhood().intersect(d);for(var R=0;R<N.length;R++){var I=N[R],w=I.id(),x=A(M,I),T=S+x.dist;if(T<y(I))p(I,T),v[w]={node:M,edge:x.edge}}}return{distanceTo:function(C){var O=Re(C)?d.filter(C)[0]:C[0];return h[O.id()]},pathTo:function(C){var O=Re(C)?d.filter(C)[0]:C[0],B=[],z=O,V=z.id();if(O.length>0){B.unshift(O);while(v[V]){var k=v[V];B.unshift(k.edge),B.unshift(k.node),z=k.node,V=z.id()}}return o.spawn(B)}}}},pc={kruskal:function(e){e=e||function(b){return 1};var r=this.byGroup(),{nodes:a,edges:n}=r,i=a.length,s=Array(i),o=a,l=function(E){for(var A=0;A<s.length;A++){var M=s[A];if(M.has(E))return A}};for(var u=0;u<i;u++)s[u]=this.spawn(a[u]);var f=n.sort(function(b,E){return e(b)-e(E)});for(var v=0;v<f.length;v++){var h=f[v],c=h.source()[0],d=h.target()[0],g=l(c),y=l(d),p=s[g],m=s[y];if(g!==y)o.merge(h),p.merge(m),s.splice(y,1)}return o}},yc=St({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),mc={aStar:function(e){var r=this.cy(),a=yc(e),{root:n,goal:i,heuristic:s,directed:o,weight:l}=a;n=r.collection(n)[0],i=r.collection(i)[0];var u=n.id(),f=i.id(),v={},h={},c={},d=new en(function(V,k){return h[V.id()]-h[k.id()]}),g=new da,y={},p={},m=function(k,G){d.push(k),g.add(G)},b,E,A=function(){b=d.pop(),E=b.id(),g.delete(E)},M=function(k){return g.has(k)};m(n,u),v[u]=0,h[u]=s(n);var S=0;while(d.size()>0){if(A(),S++,E===f){var P=[],N=i,R=f,I=p[R];for(;;){if(P.unshift(N),I!=null)P.unshift(I);if(N=y[R],N==null)break;R=N.id(),I=p[R]}return{found:!0,distance:v[E],path:this.spawn(P),steps:S}}c[E]=!0;var w=b._private.edges;for(var x=0;x<w.length;x++){var T=w[x];if(!this.hasElementWithId(T.id()))continue;if(o&&T.data("source")!==E)continue;var D=T.source(),C=T.target(),O=D.id()!==E?D:C,B=O.id();if(!this.hasElementWithId(B))continue;if(c[B])continue;var z=v[E]+l(T);if(!M(B)){v[B]=z,h[B]=z+s(O),m(O,B),y[B]=b,p[B]=T;continue}if(z<v[B])v[B]=z,h[B]=z+s(O),d.updateItem(O),y[B]=b,p[B]=T}}return{found:!1,distance:void 0,path:void 0,steps:S}}},bc=St({weight:function(e){return 1},directed:!1}),wc={floydWarshall:function(e){var r=this.cy(),a=bc(e),{weight:n,directed:i}=a,s=n,o=this.byGroup(),{nodes:l,edges:u}=o,f=l.length,v=f*f,h=function(J){return l.indexOf(J)},c=function(J){return l[J]},d=Array(v);for(var g=0;g<v;g++){var y=g%f,p=(g-y)/f;if(p===y)d[g]=0;else d[g]=1/0}var m=Array(v),b=Array(v);for(var E=0;E<u.length;E++){var A=u[E],M=A.source()[0],S=A.target()[0];if(M===S)continue;var P=h(M),N=h(S),R=P*f+N,I=s(A);if(d[R]>I)d[R]=I,m[R]=N,b[R]=A;if(!i){var w=N*f+P;if(!i&&d[w]>I)d[w]=I,m[w]=P,b[w]=A}}for(var x=0;x<f;x++)for(var T=0;T<f;T++){var D=T*f+x;for(var C=0;C<f;C++){var O=T*f+C,B=x*f+C;if(d[D]+d[B]<d[O])d[O]=d[D]+d[B],m[O]=m[D]}}var z=function(J){return(Re(J)?r.filter(J):J)[0]},V=function(J){return h(z(J))},k={distance:function(J,X){var _=V(J),Q=V(X);return d[_*f+Q]},path:function(J,X){var _=V(J),Q=V(X),q=c(_);if(_===Q)return q.collection();if(m[_*f+Q]==null)return r.collection();var te=r.collection(),Z=_,U;te.merge(q);while(_!==Q)Z=_,_=m[_*f+Q],U=b[Z*f+_],te.merge(U),te.merge(c(_));return te}};return k}},Ec=St({weight:function(e){return 1},directed:!1,root:null}),xc={bellmanFord:function(e){var r=this,a=Ec(e),{weight:n,directed:i,root:s}=a,o=n,l=this,u=this.cy(),f=this.byGroup(),{edges:v,nodes:h}=f,c=h.length,d=new nr,g=!1,y=[];s=u.collection(s)[0],v.unmergeBy(function(Te){return Te.isLoop()});var p=v.length,m=function(Ce){var ge=d.get(Ce.id());if(!ge)ge={},d.set(Ce.id(),ge);return ge},b=function(Ce){return(Re(Ce)?u.$(Ce):Ce)[0]},E=function(Ce){return m(b(Ce)).dist},A=function(Ce){var ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s,ve=b(Ce),ye=[],Ee=ve;for(;;){if(Ee==null)return r.spawn();var Pe=m(Ee),{edge:Me,pred:Ne}=Pe;if(ye.unshift(Ee[0]),Ee.same(ge)&&ye.length>0)break;if(Me!=null)ye.unshift(Me);Ee=Ne}return l.spawn(ye)};for(var M=0;M<c;M++){var S=h[M],P=m(S);if(S.same(s))P.dist=0;else P.dist=1/0;P.pred=null,P.edge=null}var N=!1,R=function(Ce,ge,ve,ye,Ee,Pe){var Me=ye.dist+Pe;if(Me<Ee.dist&&!ve.same(ye.edge))Ee.dist=Me,Ee.pred=Ce,Ee.edge=ve,N=!0};for(var I=1;I<c;I++){N=!1;for(var w=0;w<p;w++){var x=v[w],T=x.source(),D=x.target(),C=o(x),O=m(T),B=m(D);if(R(T,D,x,O,B,C),!i)R(D,T,x,B,O,C)}if(!N)break}if(N){var z=[];for(var V=0;V<p;V++){var k=v[V],G=k.source(),J=k.target(),X=o(k),_=m(G).dist,Q=m(J).dist;if(_+X<Q||!i&&Q+X<_){if(!g)_e("Graph contains a negative weight cycle for Bellman-Ford"),g=!0;if(e.findNegativeWeightCycles!==!1){var q=[];if(_+X<Q)q.push(G);if(!i&&Q+X<_)q.push(J);var te=q.length;for(var Z=0;Z<te;Z++){var U=q[Z],W=[U];W.push(m(U).edge);var j=m(U).pred;while(W.indexOf(j)===-1)W.push(j),W.push(m(j).edge),j=m(j).pred;W=W.slice(W.indexOf(j));var re=W[0].id(),ee=0;for(var de=2;de<W.length;de+=2)if(W[de].id()<re)re=W[de].id(),ee=de;W=W.slice(ee).concat(W.slice(0,ee)),W.push(W[0]);var Ae=W.map(function(Te){return Te.id()}).join(",");if(z.indexOf(Ae)===-1)y.push(l.spawn(W)),z.push(Ae)}}else break}}}return{distanceTo:E,pathTo:A,hasNegativeWeightCycle:g,negativeWeightCycles:y}}},Tc=Math.sqrt(2),Cc=function(e,r,a){if(a.length===0)it("Karger-Stein must be run on a connected (sub)graph");var n=a[e],i=n[1],s=n[2],o=r[i],l=r[s],u=a;for(var f=u.length-1;f>=0;f--){var v=u[f],h=v[1],c=v[2];if(r[h]===o&&r[c]===l||r[h]===l&&r[c]===o)u.splice(f,1)}for(var d=0;d<u.length;d++){var g=u[d];if(g[1]===l)u[d]=g.slice(),u[d][1]=o;else if(g[2]===l)u[d]=g.slice(),u[d][2]=o}for(var y=0;y<r.length;y++)if(r[y]===l)r[y]=o;return u},Ri=function(e,r,a,n){while(a>n){var i=Math.floor(Math.random()*r.length);r=Cc(i,e,r),a--}return r},Sc={kargerStein:function(){var e=this,r=this.byGroup(),{nodes:a,edges:n}=r;n.unmergeBy(function(B){return B.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/Tc);if(i<2){it("At least 2 nodes are required for Karger-Stein algorithm");return}var u=[];for(var f=0;f<s;f++){var v=n[f];u.push([f,a.indexOf(v.source()),a.indexOf(v.target())])}var h=1/0,c=[],d=Array(i),g=Array(i),y=Array(i),p=function(z,V){for(var k=0;k<i;k++)V[k]=z[k]};for(var m=0;m<=o;m++){for(var b=0;b<i;b++)g[b]=b;var E=Ri(g,u.slice(),i,l),A=E.slice();p(g,y);var M=Ri(g,E,l,2),S=Ri(y,A,l,2);if(M.length<=S.length&&M.length<h)h=M.length,c=M,p(g,d);else if(S.length<=M.length&&S.length<h)h=S.length,c=S,p(y,d)}var P=this.spawn(c.map(function(B){return n[B[0]]})),N=this.spawn(),R=this.spawn(),I=d[0];for(var w=0;w<d.length;w++){var x=d[w],T=a[w];if(x===I)N.merge(T);else R.merge(T)}var D=function(z){var V=e.spawn();return z.forEach(function(k){V.merge(k),k.connectedEdges().forEach(function(G){if(e.contains(G)&&!P.contains(G))V.merge(G)})}),V},C=[D(N),D(R)],O={cut:P,components:C,partition1:N,partition2:R};return O}},Pi,Dc=function(e){return{x:e.x,y:e.y}},Jn=function(e,r,a){return{x:e.x*r+a.x,y:e.y*r+a.y}},If=function(e,r,a){return{x:(e.x-a.x)/r,y:(e.y-a.y)/r}},ra=function(e){return{x:e[0],y:e[1]}},Ac=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0;for(var i=r;i<a;i++){var s=e[i];if(isFinite(s))n=Math.min(s,n)}return n},Mc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0;for(var i=r;i<a;i++){var s=e[i];if(isFinite(s))n=Math.max(s,n)}return n},Lc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0;for(var s=r;s<a;s++){var o=e[s];if(isFinite(o))n+=o,i++}return n/i},Rc=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(n)e=e.slice(r,a);else{if(a<e.length)e.splice(a,e.length-a);if(r>0)e.splice(0,r)}var o=0;for(var l=e.length-1;l>=0;l--){var u=e[l];if(s){if(!isFinite(u))e[l]=-1/0,o++}else e.splice(l,1)}if(i)e.sort(function(h,c){return h-c});var f=e.length,v=Math.floor(f/2);if(f%2!==0)return e[v+1+o];else return(e[v-1+o]+e[v+o])/2},Bf=function(e,r){if(r===0)return e;return Bf(r,e%r)},Pc=function(e){var r=e[0];for(var a=0;a<e.length;a++)if(!yf(e[a]))return 0;else if(a>0)r=Bf(r,e[a]);return r},Nc=function(e){return Math.PI*e/180},cn=function(e,r){return Math.atan2(r,e)-Math.PI/2},mo=Math.log2||function(t){return Math.log(t)/Math.log(2)},bo=function(e){if(e>0)return 1;else if(e<0)return-1;else return 0},Ur=function(e,r){return Math.sqrt(Br(e,r))},Br=function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},Oc=function(e){var r=e.length,a=0;for(var n=0;n<r;n++)a+=e[n];for(var i=0;i<r;i++)e[i]=e[i]/a;return e},bt=function(e,r,a,n){return(1-n)*(1-n)*e+2*(1-n)*n*r+n*n*a},ia=function(e,r,a,n){return{x:bt(e.x,r.x,a.x,n),y:bt(e.y,r.y,a.y,n)}},Ic=function(e,r,a,n){var i={x:r.x-e.x,y:r.y-e.y},s=Ur(e,r),o={x:i.x/s,y:i.y/s};return a=a==null?0:a,n=n!=null?n:a*s,{x:e.x+o.x*n,y:e.y+o.y*n}},Ua=function(e,r,a){return Math.max(e,Math.min(a,r))},Ot=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};else if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};else if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},Bc=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},kc=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},Fc=function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},kf=function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},Sn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},Dn=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=ct(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},ou=function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},wo=function(e,r){if(e.x1>r.x2)return!1;if(r.x1>e.x2)return!1;if(e.x2<r.x1)return!1;if(r.x2<e.x1)return!1;if(e.y2<r.y1)return!1;if(r.y2<e.y1)return!1;if(e.y1>r.y2)return!1;if(r.y1>e.y2)return!1;return!0},mr=function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},uu=function(e,r){return mr(e,r.x,r.y)},Ff=function(e,r){return mr(e,r.x1,r.y1)&&mr(e,r.x2,r.y2)},zc=(Pi=Math.hypot)!==null&&Pi!==void 0?Pi:function(t,e){return Math.sqrt(t*t+e*e)};function Vc(t,e){if(t.length<3)throw Error("Need at least 3 vertices");var r=function(P,N){return{x:P.x+N.x,y:P.y+N.y}},a=function(P,N){return{x:P.x-N.x,y:P.y-N.y}},n=function(P,N){return{x:P.x*N,y:P.y*N}},i=function(P,N){return P.x*N.y-P.y*N.x},s=function(P){var N=zc(P.x,P.y);return N===0?{x:0,y:0}:{x:P.x/N,y:P.y/N}},o=function(P){var N=0;for(var R=0;R<P.length;R++){var I=P[R],w=P[(R+1)%P.length];N+=I.x*w.y-w.x*I.y}return N/2},l=function(P,N,R,I){var w=a(N,P),x=a(I,R),T=i(w,x);if(Math.abs(T)<0.000000001)return r(P,n(w,0.5));var D=i(a(R,P),x)/T;return r(P,n(w,D))},u=t.map(function(S){return{x:S.x,y:S.y}});if(o(u)<0)u.reverse();var f=u.length,v=[];for(var h=0;h<f;h++){var c=u[h],d=u[(h+1)%f],g=a(d,c),y=s({x:g.y,y:-g.x});v.push(y)}var p=v.map(function(S,P){var N=r(u[P],n(S,e)),R=r(u[(P+1)%f],n(S,e));return{p1:N,p2:R}}),m=[];for(var b=0;b<f;b++){var E=p[(b-1+f)%f],A=p[b],M=l(E.p1,E.p2,A.p1,A.p2);m.push(M)}return m}function Gc(t,e,r,a,n,i){var s=Zc(t,e,r,a,n),o=Vc(s,i),l=Ot();return o.forEach(function(u){return kf(l,u.x,u.y)}),l}var zf=function(e,r,a,n,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?Cr(i,s):l,f=i/2,v=s/2;u=Math.min(u,f,v);var h=u!==f,c=u!==v,d;if(h){var g=a-f+u-o,y=n-v-o,p=a+f-u+o,m=y;if(d=br(e,r,a,n,g,y,p,m,!1),d.length>0)return d}if(c){var b=a+f+o,E=n-v+u-o,A=b,M=n+v-u+o;if(d=br(e,r,a,n,b,E,A,M,!1),d.length>0)return d}if(h){var S=a-f+u-o,P=n+v+o,N=a+f-u+o,R=P;if(d=br(e,r,a,n,S,P,N,R,!1),d.length>0)return d}if(c){var I=a-f-o,w=n-v+u-o,x=I,T=n+v-u+o;if(d=br(e,r,a,n,I,w,x,T,!1),d.length>0)return d}var D;{var C=a-f+u,O=n-v+u;if(D=Na(e,r,a,n,C,O,u+o),D.length>0&&D[0]<=C&&D[1]<=O)return[D[0],D[1]]}{var B=a+f-u,z=n-v+u;if(D=Na(e,r,a,n,B,z,u+o),D.length>0&&D[0]>=B&&D[1]<=z)return[D[0],D[1]]}{var V=a+f-u,k=n+v-u;if(D=Na(e,r,a,n,V,k,u+o),D.length>0&&D[0]>=V&&D[1]>=k)return[D[0],D[1]]}{var G=a-f+u,J=n+v-u;if(D=Na(e,r,a,n,G,J,u+o),D.length>0&&D[0]<=G&&D[1]>=J)return[D[0],D[1]]}return[]},Uc=function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),f=Math.max(a,i),v=Math.min(n,s),h=Math.max(n,s);return u-l<=e&&e<=f+l&&v-l<=r&&r<=h+l},Hc=function(e,r,a,n,i,s,o,l,u){var f={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};if(e<f.x1||e>f.x2||r<f.y1||r>f.y2)return!1;else return!0},qc=function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},Yc=function(e,r,a,n,i){var s=0.00001;if(e===0)e=s;r/=e,a/=e,n/=e;var o,l,u,f,v,h,c,d;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,c=r/3,o>0){v=u+Math.sqrt(o),v=v<0?-Math.pow(-v,0.3333333333333333):Math.pow(v,0.3333333333333333),h=u-Math.sqrt(o),h=h<0?-Math.pow(-h,0.3333333333333333):Math.pow(h,0.3333333333333333),i[0]=-c+v+h,c+=(v+h)/2,i[4]=i[2]=-c,c=Math.sqrt(3)*(-h+v)/2,i[3]=c,i[5]=-c;return}if(i[5]=i[3]=0,o===0){d=u<0?-Math.pow(-u,0.3333333333333333):Math.pow(u,0.3333333333333333),i[0]=-c+2*d,i[4]=i[2]=-(d+c);return}l=-l,f=l*l*l,f=Math.acos(u/Math.sqrt(f)),d=2*Math.sqrt(l),i[0]=-c+d*Math.cos(f/3),i[2]=-c+d*Math.cos((f+2*Math.PI)/3),i[4]=-c+d*Math.cos((f+4*Math.PI)/3);return},Xc=function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,f=9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,v=3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,h=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,c=[];Yc(u,f,v,h,c);var d=0.0000001,g=[];for(var y=0;y<6;y+=2)if(Math.abs(c[y+1])<d&&c[y]>=0&&c[y]<=1)g.push(c[y]);g.push(1),g.push(0);var p=-1,m,b,E;for(var A=0;A<g.length;A++)if(m=Math.pow(1-g[A],2)*a+2*(1-g[A])*g[A]*i+g[A]*g[A]*o,b=Math.pow(1-g[A],2)*n+2*(1-g[A])*g[A]*s+g[A]*g[A]*l,E=Math.pow(m-e,2)+Math.pow(b-r,2),p>=0){if(E<p)p=E}else p=E;return p},Wc=function(e,r,a,n,i,s){var o=[e-a,r-n],l=[i-a,s-n],u=l[0]*l[0]+l[1]*l[1],f=o[0]*o[0]+o[1]*o[1],v=o[0]*l[0]+o[1]*l[1],h=v*v/u;if(v<0)return f;if(h>u)return(e-i)*(e-i)+(r-s)*(r-s);return f-h},Bt=function(e,r,a){var n,i,s,o,l,u=0;for(var f=0;f<a.length/2;f++){if(n=a[f*2],i=a[f*2+1],f+1<a.length/2)s=a[(f+1)*2],o=a[(f+1)*2+1];else s=a[(f+1-a.length/2)*2],o=a[(f+1-a.length/2)*2+1];if(n==e&&s==e);else if(n>=e&&e>=s||n<=e&&e<=s){if(l=(e-n)/(s-n)*(o-i)+i,l>r)u++}else continue}if(u%2===0)return!1;else return!0},or=function(e,r,a,n,i,s,o,l,u){var f=Array(a.length),v;if(l[0]!=null)if(v=Math.atan(l[1]/l[0]),l[0]<0)v=v+Math.PI/2;else v=-v-Math.PI/2;else v=l;var h=Math.cos(-v),c=Math.sin(-v);for(var d=0;d<f.length/2;d++)f[d*2]=s/2*(a[d*2]*h-a[d*2+1]*c),f[d*2+1]=o/2*(a[d*2+1]*h+a[d*2]*c),f[d*2]+=n,f[d*2+1]+=i;var g;if(u>0){var y=Gn(f,-u);g=Vn(y)}else g=f;return Bt(e,r,g)},$c=function(e,r,a,n,i,s,o,l){var u=Array(a.length*2);for(var f=0;f<l.length;f++){var v=l[f];u[f*4+0]=v.startX,u[f*4+1]=v.startY,u[f*4+2]=v.stopX,u[f*4+3]=v.stopY;var h=Math.pow(v.cx-e,2)+Math.pow(v.cy-r,2);if(h<=Math.pow(v.radius,2))return!0}return Bt(e,r,u)},Vn=function(e){var r=Array(e.length/2),a,n,i,s,o,l,u,f;for(var v=0;v<e.length/4;v++){if(a=e[v*4],n=e[v*4+1],i=e[v*4+2],s=e[v*4+3],v<e.length/4-1)o=e[(v+1)*4],l=e[(v+1)*4+1],u=e[(v+1)*4+2],f=e[(v+1)*4+3];else o=e[0],l=e[1],u=e[2],f=e[3];var h=br(a,n,i,s,o,l,u,f,!0);r[v*2]=h[0],r[v*2+1]=h[1]}return r},Gn=function(e,r){var a=Array(e.length*2),n,i,s,o;for(var l=0;l<e.length/2;l++){if(n=e[l*2],i=e[l*2+1],l<e.length/2-1)s=e[(l+1)*2],o=e[(l+1)*2+1];else s=e[0],o=e[1];var u=o-i,f=-(s-n),v=Math.sqrt(u*u+f*f),h=u/v,c=f/v;a[l*4]=n+h*r,a[l*4+1]=i+c*r,a[l*4+2]=s+h*r,a[l*4+3]=o+c*r}return a},Kc=function(e,r,a,n,i,s){var o=a-e,l=n-r;o/=i,l/=s;var u=Math.sqrt(o*o+l*l),f=u-1;if(f<0)return[];var v=f/u;return[(a-e)*v+e,(n-r)*v+r]},Vr=function(e,r,a,n,i,s,o){return e-=i,r-=s,e/=a/2+o,r/=n/2+o,e*e+r*r<=1},Na=function(e,r,a,n,i,s,o){var l=[a-e,n-r],u=[e-i,r-s],f=l[0]*l[0]+l[1]*l[1],v=2*(u[0]*l[0]+u[1]*l[1]),h=u[0]*u[0]+u[1]*u[1]-o*o,c=v*v-4*f*h;if(c<0)return[];var d=(-v+Math.sqrt(c))/(2*f),g=(-v-Math.sqrt(c))/(2*f),y=Math.min(d,g),p=Math.max(d,g),m=[];if(y>=0&&y<=1)m.push(y);if(p>=0&&p<=1)m.push(p);if(m.length===0)return[];var b=m[0]*l[0]+e,E=m[0]*l[1]+r;if(m.length>1)if(m[0]==m[1])return[b,E];else{var A=m[1]*l[0]+e,M=m[1]*l[1]+r;return[b,E,A,M]}else return[b,E]},Ni=function(e,r,a){if(r<=e&&e<=a||a<=e&&e<=r)return e;else if(e<=r&&r<=a||a<=r&&r<=e)return r;else return a},br=function(e,r,a,n,i,s,o,l,u){var f=e-i,v=a-e,h=o-i,c=r-s,d=n-r,g=l-s,y=h*c-g*f,p=v*c-d*f,m=g*v-h*d;if(m!==0){var b=y/m,E=p/m,A=0.001,M=0-A,S=1+A;if(M<=b&&b<=S&&M<=E&&E<=S)return[e+b*v,r+b*d];else if(!u)return[];else return[e+b*v,r+b*d]}else if(y===0||p===0){if(Ni(e,a,o)===o)return[o,l];if(Ni(e,a,i)===i)return[i,s];if(Ni(i,o,a)===a)return[a,n];return[]}else return[]},Zc=function(e,r,a,n,i){var s=[],o=n/2,l=i/2,u=r,f=a;s.push({x:u+o*e[0],y:f+l*e[1]});for(var v=1;v<e.length/2;v++)s.push({x:u+o*e[v*2],y:f+l*e[v*2+1]});return s},Ha=function(e,r,a,n,i,s,o,l){var u=[],f,v=Array(a.length),h=!0;if(s==null)h=!1;var c;if(h){for(var d=0;d<v.length/2;d++)v[d*2]=a[d*2]*s+n,v[d*2+1]=a[d*2+1]*o+i;if(l>0){var g=Gn(v,-l);c=Vn(g)}else c=v}else c=a;var y,p,m,b;for(var E=0;E<c.length/2;E++){if(y=c[E*2],p=c[E*2+1],E<c.length/2-1)m=c[(E+1)*2],b=c[(E+1)*2+1];else m=c[0],b=c[1];if(f=br(e,r,n,i,y,p,m,b),f.length!==0)u.push(f[0],f[1])}return u},_c=function(e,r,a,n,i,s,o,l,u){var f=[],v,h=Array(a.length*2);u.forEach(function(m,b){if(b===0)h[h.length-2]=m.startX,h[h.length-1]=m.startY;else h[b*4-2]=m.startX,h[b*4-1]=m.startY;if(h[b*4]=m.stopX,h[b*4+1]=m.stopY,v=Na(e,r,n,i,m.cx,m.cy,m.radius),v.length!==0)f.push(v[0],v[1])});for(var c=0;c<h.length/4;c++)if(v=br(e,r,n,i,h[c*4],h[c*4+1],h[c*4+2],h[c*4+3],!1),v.length!==0)f.push(v[0],v[1]);if(f.length>2){var d=[f[0],f[1]],g=Math.pow(d[0]-e,2)+Math.pow(d[1]-r,2);for(var y=1;y<f.length/2;y++){var p=Math.pow(f[y*2]-e,2)+Math.pow(f[y*2+1]-r,2);if(p<=g)d[0]=f[y*2],d[1]=f[y*2+1],g=p}return d}return f},dn=function(e,r,a){var n=[e[0]-r[0],e[1]-r[1]],i=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=(i-a)/i;if(s<0)s=0.00001;return[r[0]+s*n[0],r[1]+s*n[1]]},Pt=function(e,r){var a=Xs(e,r);return a=Vf(a),a},Vf=function(e){var r,a,n=e.length/2,i=1/0,s=1/0,o=-1/0,l=-1/0;for(var u=0;u<n;u++)r=e[2*u],a=e[2*u+1],i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);var f=2/(o-i),v=2/(l-s);for(var h=0;h<n;h++)r=e[2*h]=e[2*h]*f,a=e[2*h+1]=e[2*h+1]*v,i=Math.min(i,r),o=Math.max(o,r),s=Math.min(s,a),l=Math.max(l,a);if(s<-1)for(var c=0;c<n;c++)a=e[2*c+1]=e[2*c+1]+(-1-s);return e},Xs=function(e,r){var a=1/e*2*Math.PI,n=e%2===0?Math.PI/2+a/2:Math.PI/2;n+=r;var i=Array(e*2),s;for(var o=0;o<e;o++)s=o*a+n,i[2*o]=Math.cos(s),i[2*o+1]=Math.sin(-s);return i},Cr=function(e,r){return Math.min(e/4,r/4,8)},Gf=function(e,r){return Math.min(e/10,r/10,8)},Eo=function(){return 8},Qc=function(e,r,a){return[e-2*r+a,2*(r-e),e]},Ws=function(e,r){return{heightOffset:Math.min(15,0.05*r),widthOffset:Math.min(100,0.25*e),ctrlPtOffsetPct:0.05}};function Oi(t,e){function r(v){var h=[];for(var c=0;c<v.length;c++){var d=v[c],g=v[(c+1)%v.length],y={x:g.x-d.x,y:g.y-d.y},p={x:-y.y,y:y.x},m=Math.sqrt(p.x*p.x+p.y*p.y);h.push({x:p.x/m,y:p.y/m})}return h}function a(v,h){var c=1/0,d=-1/0,g=kt(v),y;try{for(g.s();!(y=g.n()).done;){var p=y.value,m=p.x*h.x+p.y*h.y;c=Math.min(c,m),d=Math.max(d,m)}}catch(b){g.e(b)}finally{g.f()}return{min:c,max:d}}function n(v,h){return!(v.max<h.min||h.max<v.min)}var i=[].concat(Bn(r(t)),Bn(r(e))),s=kt(i),o;try{for(s.s();!(o=s.n()).done;){var l=o.value,u=a(t,l),f=a(e,l);if(!n(u,f))return!1}}catch(v){s.e(v)}finally{s.f()}return!0}var Jc=St({dampingFactor:0.8,precision:0.000001,iterations:200,weight:function(e){return 1}}),jc={pageRank:function(e){var r=Jc(e),{dampingFactor:a,precision:n,iterations:i,weight:s}=r,o=this._private.cy,l=this.byGroup(),{nodes:u,edges:f}=l,v=u.length,h=v*v,c=f.length,d=Array(h),g=Array(v),y=(1-a)/v;for(var p=0;p<v;p++){for(var m=0;m<v;m++){var b=p*v+m;d[b]=0}g[p]=0}for(var E=0;E<c;E++){var A=f[E],M=A.data("source"),S=A.data("target");if(M===S)continue;var P=u.indexOfId(M),N=u.indexOfId(S),R=s(A),I=N*v+P;d[I]+=R,g[P]+=R}var w=1/v+y;for(var x=0;x<v;x++)if(g[x]===0)for(var T=0;T<v;T++){var D=T*v+x;d[D]=w}else for(var C=0;C<v;C++){var O=C*v+x;d[O]=d[O]/g[x]+y}var B=Array(v),z=Array(v),V;for(var k=0;k<v;k++)B[k]=1;for(var G=0;G<i;G++){for(var J=0;J<v;J++)z[J]=0;for(var X=0;X<v;X++)for(var _=0;_<v;_++){var Q=X*v+_;z[X]+=d[Q]*B[_]}Oc(z),V=B,B=z,z=V;var q=0;for(var te=0;te<v;te++){var Z=V[te]-B[te];q+=Z*Z}if(q<n)break}var U={rank:function(j){return j=o.collection(j)[0],B[u.indexOf(j)]}};return U}};var lu=St({root:null,weight:function(e){return 1},directed:!1,alpha:0}),sa={degreeCentralityNormalized:function(e){e=lu(e);var r=this.cy(),a=this.nodes(),n=a.length;if(!e.directed){var i={},s=0;for(var o=0;o<n;o++){var l=a[o];e.root=l;var u=this.degreeCentrality(e);if(s<u.degree)s=u.degree;i[l.id()]=u.degree}return{degree:function(b){if(s===0)return 0;if(Re(b))b=r.filter(b);return i[b.id()]/s}}}else{var f={},v={},h=0,c=0;for(var d=0;d<n;d++){var g=a[d],y=g.id();e.root=g;var p=this.degreeCentrality(e);if(h<p.indegree)h=p.indegree;if(c<p.outdegree)c=p.outdegree;f[y]=p.indegree,v[y]=p.outdegree}return{indegree:function(b){if(h==0)return 0;if(Re(b))b=r.filter(b);return f[b.id()]/h},outdegree:function(b){if(c===0)return 0;if(Re(b))b=r.filter(b);return v[b.id()]/c}}}},degreeCentrality:function(e){e=lu(e);var r=this.cy(),a=this,n=e,{root:i,weight:s,directed:o,alpha:l}=n;if(i=r.collection(i)[0],!o){var u=i.connectedEdges().intersection(a),f=u.length,v=0;for(var h=0;h<u.length;h++)v+=s(u[h]);return{degree:Math.pow(f,1-l)*Math.pow(v,l)}}else{var c=i.connectedEdges(),d=c.filter(function(M){return M.target().same(i)&&a.has(M)}),g=c.filter(function(M){return M.source().same(i)&&a.has(M)}),y=d.length,p=g.length,m=0,b=0;for(var E=0;E<d.length;E++)m+=s(d[E]);for(var A=0;A<g.length;A++)b+=s(g[A]);return{indegree:Math.pow(y,1-l)*Math.pow(m,l),outdegree:Math.pow(p,1-l)*Math.pow(b,l)}}}};sa.dc=sa.degreeCentrality;sa.dcn=sa.degreeCentralityNormalised=sa.degreeCentralityNormalized;var fu=St({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),oa={closenessCentralityNormalized:function(e){var r=fu(e),{harmonic:a,weight:n,directed:i}=r,s=this.cy(),o={},l=0,u=this.nodes(),f=this.floydWarshall({weight:n,directed:i});for(var v=0;v<u.length;v++){var h=0,c=u[v];for(var d=0;d<u.length;d++)if(v!==d){var g=f.distance(c,u[d]);if(a)h+=1/g;else h+=g}if(!a)h=1/h;if(l<h)l=h;o[c.id()]=h}return{closeness:function(p){if(l==0)return 0;if(Re(p))p=s.filter(p)[0].id();else p=p.id();return o[p]/l}}},closenessCentrality:function(e){var r=fu(e),{root:a,weight:n,directed:i,harmonic:s}=r;a=this.filter(a)[0];var o=this.dijkstra({root:a,weight:n,directed:i}),l=0,u=this.nodes();for(var f=0;f<u.length;f++){var v=u[f];if(!v.same(a)){var h=o.distanceTo(v);if(s)l+=1/h;else l+=h}}return s?l:1/l}};oa.cc=oa.closenessCentrality;oa.ccn=oa.closenessCentralityNormalised=oa.closenessCentralityNormalized;var ed=St({weight:null,directed:!1}),$s={betweennessCentrality:function(e){var r=ed(e),{directed:a,weight:n}=r,i=n!=null,s=this.cy(),o=this.nodes(),l={},u={},f=0,v={set:function(b,E){if(u[b]=E,E>f)f=E},get:function(b){return u[b]}};for(var h=0;h<o.length;h++){var c=o[h],d=c.id();if(a)l[d]=c.outgoers().nodes();else l[d]=c.openNeighborhood().nodes();v.set(d,0)}var g=function(){var b=o[y].id(),E=[],A={},M={},S={},P=new en(function(X,_){return S[X]-S[_]});for(var N=0;N<o.length;N++){var R=o[N].id();A[R]=[],M[R]=0,S[R]=1/0}M[b]=1,S[b]=0,P.push(b);while(!P.empty()){var I=P.pop();if(E.push(I),i)for(var w=0;w<l[I].length;w++){var x=l[I][w],T=s.getElementById(I),D=void 0;if(T.edgesTo(x).length>0)D=T.edgesTo(x)[0];else D=x.edgesTo(T)[0];var C=n(D);if(x=x.id(),S[x]>S[I]+C){if(S[x]=S[I]+C,P.nodes.indexOf(x)<0)P.push(x);else P.updateItem(x);M[x]=0,A[x]=[]}if(S[x]==S[I]+C)M[x]=M[x]+M[I],A[x].push(I)}else for(var O=0;O<l[I].length;O++){var B=l[I][O].id();if(S[B]==1/0)P.push(B),S[B]=S[I]+1;if(S[B]==S[I]+1)M[B]=M[B]+M[I],A[B].push(I)}}var z={};for(var V=0;V<o.length;V++)z[o[V].id()]=0;while(E.length>0){var k=E.pop();for(var G=0;G<A[k].length;G++){var J=A[k][G];z[J]=z[J]+M[J]/M[k]*(1+z[k])}if(k!=o[y].id())v.set(k,v.get(k)+z[k])}};for(var y=0;y<o.length;y++)g();var p={betweenness:function(b){var E=s.collection(b).id();return v.get(E)},betweennessNormalized:function(b){if(f==0)return 0;var E=s.collection(b).id();return v.get(E)/f}};return p.betweennessNormalised=p.betweennessNormalized,p}};$s.bc=$s.betweennessCentrality;var td=St({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(t){return 1}]}),rd=function(e){return td(e)},ad=function(e,r){var a=0;for(var n=0;n<r.length;n++)a+=r[n](e);return a},nd=function(e,r,a){for(var n=0;n<r;n++)e[n*r+n]=a},Uf=function(e,r){var a;for(var n=0;n<r;n++){a=0;for(var i=0;i<r;i++)a+=e[i*r+n];for(var s=0;s<r;s++)e[s*r+n]=e[s*r+n]/a}},id=function(e,r,a){var n=Array(a*a);for(var i=0;i<a;i++){for(var s=0;s<a;s++)n[i*a+s]=0;for(var o=0;o<a;o++)for(var l=0;l<a;l++)n[i*a+l]+=e[i*a+o]*r[o*a+l]}return n},sd=function(e,r,a){var n=e.slice(0);for(var i=1;i<a;i++)e=id(e,n,r);return e},od=function(e,r,a){var n=Array(r*r);for(var i=0;i<r*r;i++)n[i]=Math.pow(e[i],a);return Uf(n,r),n},ud=function(e,r,a,n){for(var i=0;i<a;i++){var s=Math.round(e[i]*Math.pow(10,n))/Math.pow(10,n),o=Math.round(r[i]*Math.pow(10,n))/Math.pow(10,n);if(s!==o)return!1}return!0},ld=function(e,r,a,n){var i=[];for(var s=0;s<r;s++){var o=[];for(var l=0;l<r;l++)if(Math.round(e[s*r+l]*1000)/1000>0)o.push(a[l]);if(o.length!==0)i.push(n.collection(o))}return i},fd=function(e,r){for(var a=0;a<e.length;a++)if(!r[a]||e[a].id()!==r[a].id())return!1;return!0},vd=function(e){for(var r=0;r<e.length;r++)for(var a=0;a<e.length;a++)if(r!=a&&fd(e[r],e[a]))e.splice(a,1);return e},vu=function(e){var r=this.nodes(),a=this.edges(),n=this.cy(),i=rd(e),s={};for(var o=0;o<r.length;o++)s[r[o].id()]=o;var l=r.length,u=l*l,f=Array(u),v;for(var h=0;h<u;h++)f[h]=0;for(var c=0;c<a.length;c++){var d=a[c],g=s[d.source().id()],y=s[d.target().id()],p=ad(d,i.attributes);f[g*l+y]+=p,f[y*l+g]+=p}nd(f,l,i.multFactor),Uf(f,l);var m=!0,b=0;while(m&&b<i.maxIterations){if(m=!1,v=sd(f,l,i.expandFactor),f=od(v,l,i.inflateFactor),!ud(f,v,u,4))m=!0;b++}var E=ld(f,l,r,n);return E=vd(E),E},hd={markovClustering:vu,mcl:vu},cd=function(e){return e},Hf=function(e,r){return Math.abs(r-e)},hu=function(e,r,a){return e+Hf(r,a)},cu=function(e,r,a){return e+Math.pow(a-r,2)},dd=function(e){return Math.sqrt(e)},gd=function(e,r,a){return Math.max(e,Hf(r,a))},Sa=function(e,r,a,n,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:cd,o=n,l,u;for(var f=0;f<e;f++)l=r(f),u=a(f),o=i(o,l,u);return s(o)},fa={euclidean:function(e,r,a){if(e>=2)return Sa(e,r,a,0,cu,dd);else return Sa(e,r,a,0,hu)},squaredEuclidean:function(e,r,a){return Sa(e,r,a,0,cu)},manhattan:function(e,r,a){return Sa(e,r,a,0,hu)},max:function(e,r,a){return Sa(e,r,a,-1/0,gd)}};fa["squared-euclidean"]=fa.squaredEuclidean;fa.squaredeuclidean=fa.squaredEuclidean;function jn(t,e,r,a,n,i){var s;if(st(t))s=t;else s=fa[t]||fa.euclidean;if(e===0&&st(t))return s(n,i);else return s(e,r,a,n,i)}var pd=St({k:2,m:2,sensitivityThreshold:0.0001,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),xo=function(e){return pd(e)},Un=function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(v){return a[v]}:function(v){return n[v](a)},l=function(h){return n[h](r)},u=a,f=r;return jn(e,n.length,o,l,u,f)},Ii=function(e,r,a){var n=a.length,i=Array(n),s=Array(n),o=Array(r),l=null;for(var u=0;u<n;u++)i[u]=e.min(a[u]).value,s[u]=e.max(a[u]).value;for(var f=0;f<r;f++){l=[];for(var v=0;v<n;v++)l[v]=Math.random()*(s[v]-i[v])+i[v];o[f]=l}return o},qf=function(e,r,a,n,i){var s=1/0,o=0;for(var l=0;l<r.length;l++){var u=Un(a,e,r[l],n,i);if(u<s)s=u,o=l}return o},Yf=function(e,r,a){var n=[],i=null;for(var s=0;s<r.length;s++)if(i=r[s],a[i.id()]===e)n.push(i);return n},yd=function(e,r,a){return Math.abs(r-e)<=a},md=function(e,r,a){for(var n=0;n<e.length;n++)for(var i=0;i<e[n].length;i++){var s=Math.abs(e[n][i]-r[n][i]);if(s>a)return!1}return!0},bd=function(e,r,a){for(var n=0;n<a;n++)if(e===r[n])return!0;return!1},du=function(e,r){var a=Array(r);if(e.length<50)for(var n=0;n<r;n++){var i=e[Math.floor(Math.random()*e.length)];while(bd(i,a,n))i=e[Math.floor(Math.random()*e.length)];a[n]=i}else for(var s=0;s<r;s++)a[s]=e[Math.floor(Math.random()*e.length)];return a},gu=function(e,r,a){var n=0;for(var i=0;i<r.length;i++)n+=Un("manhattan",r[i],e,a,"kMedoids");return n},wd=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xo(e),s=Array(i.k),o={},l;if(i.testMode)if(typeof i.testCentroids==="number")i.testCentroids,l=Ii(a,i.k,i.attributes);else if(yt(i.testCentroids)==="object")l=i.testCentroids;else l=Ii(a,i.k,i.attributes);else l=Ii(a,i.k,i.attributes);var u=!0,f=0;while(u&&f<i.maxIterations){for(var v=0;v<a.length;v++)n=a[v],o[n.id()]=qf(n,l,i.distance,i.attributes,"kMeans");u=!1;for(var h=0;h<i.k;h++){var c=Yf(h,a,o);if(c.length===0)continue;var d=i.attributes.length,g=l[h],y=Array(d),p=Array(d);for(var m=0;m<d;m++){p[m]=0;for(var b=0;b<c.length;b++)n=c[b],p[m]+=i.attributes[m](n);if(y[m]=p[m]/c.length,!yd(y[m],g[m],i.sensitivityThreshold))u=!0}l[h]=y,s[h]=r.collection(c)}f++}return s},Ed=function(e){var r=this.cy(),a=this.nodes(),n=null,i=xo(e),s=Array(i.k),o,l={},u,f=Array(i.k);if(i.testMode)if(typeof i.testCentroids==="number");else if(yt(i.testCentroids)==="object")o=i.testCentroids;else o=du(a,i.k);else o=du(a,i.k);var v=!0,h=0;while(v&&h<i.maxIterations){for(var c=0;c<a.length;c++)n=a[c],l[n.id()]=qf(n,o,i.distance,i.attributes,"kMedoids");v=!1;for(var d=0;d<o.length;d++){var g=Yf(d,a,l);if(g.length===0)continue;f[d]=gu(o[d],g,i.attributes);for(var y=0;y<g.length;y++)if(u=gu(g[y],g,i.attributes),u<f[d])f[d]=u,o[d]=g[y],v=!0;s[d]=r.collection(g)}h++}return s},xd=function(e,r,a,n,i){var s,o;for(var l=0;l<r.length;l++)for(var u=0;u<e.length;u++)n[l][u]=Math.pow(a[l][u],i.m);for(var f=0;f<e.length;f++)for(var v=0;v<i.attributes.length;v++){s=0,o=0;for(var h=0;h<r.length;h++)s+=n[h][f]*i.attributes[v](r[h]),o+=n[h][f];e[f][v]=s/o}},Td=function(e,r,a,n,i){for(var s=0;s<e.length;s++)r[s]=e[s].slice();var o,l,u,f=2/(i.m-1);for(var v=0;v<a.length;v++)for(var h=0;h<n.length;h++){o=0;for(var c=0;c<a.length;c++)l=Un(i.distance,n[h],a[v],i.attributes,"cmeans"),u=Un(i.distance,n[h],a[c],i.attributes,"cmeans"),o+=Math.pow(l/u,f);e[h][v]=1/o}},Cd=function(e,r,a,n){var i=Array(a.k);for(var s=0;s<i.length;s++)i[s]=[];var o,l;for(var u=0;u<r.length;u++){o=-1/0,l=-1;for(var f=0;f<r[0].length;f++)if(r[u][f]>o)o=r[u][f],l=f;i[l].push(e[u])}for(var v=0;v<i.length;v++)i[v]=n.collection(i[v]);return i},pu=function(e){var r=this.cy(),a=this.nodes(),n=xo(e),i,s,o,l,u;l=Array(a.length);for(var f=0;f<a.length;f++)l[f]=Array(n.k);o=Array(a.length);for(var v=0;v<a.length;v++)o[v]=Array(n.k);for(var h=0;h<a.length;h++){var c=0;for(var d=0;d<n.k;d++)o[h][d]=Math.random(),c+=o[h][d];for(var g=0;g<n.k;g++)o[h][g]=o[h][g]/c}s=Array(n.k);for(var y=0;y<n.k;y++)s[y]=Array(n.attributes.length);u=Array(a.length);for(var p=0;p<a.length;p++)u[p]=Array(n.k);var m=!0,b=0;while(m&&b<n.maxIterations){if(m=!1,xd(s,a,o,u,n),Td(o,l,s,a,n),!md(o,l,n.sensitivityThreshold))m=!0;b++}return i=Cd(a,o,n,r),{clusters:i,degreeOfMembership:o}},Sd={kMeans:wd,kMedoids:Ed,fuzzyCMeans:pu,fcm:pu},Dd=St({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Ad={single:"min",complete:"max"},Md=function(e){var r=Dd(e),a=Ad[r.linkage];if(a!=null)r.linkage=a;return r},yu=function(e,r,a,n,i){var s=0,o=1/0,l,u=i.attributes,f=function(N,R){return jn(i.distance,u.length,function(I){return u[I](N)},function(I){return u[I](R)},N,R)};for(var v=0;v<e.length;v++){var h=e[v].key,c=a[h][n[h]];if(c<o)s=h,o=c}if(i.mode==="threshold"&&o>=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var d=r[s],g=r[n[s]],y;if(i.mode==="dendrogram")y={left:d,right:g,key:d.key};else y={value:d.value.concat(g.value),key:d.key};e[d.index]=y,e.splice(g.index,1),r[d.key]=y;for(var p=0;p<e.length;p++){var m=e[p];if(d.key===m.key)l=1/0;else if(i.linkage==="min"){if(l=a[d.key][m.key],a[d.key][m.key]>a[g.key][m.key])l=a[g.key][m.key]}else if(i.linkage==="max"){if(l=a[d.key][m.key],a[d.key][m.key]<a[g.key][m.key])l=a[g.key][m.key]}else if(i.linkage==="mean")l=(a[d.key][m.key]*d.size+a[g.key][m.key]*g.size)/(d.size+g.size);else if(i.mode==="dendrogram")l=f(m.value,d.value);else l=f(m.value[0],d.value[0]);a[d.key][m.key]=a[m.key][d.key]=l}for(var b=0;b<e.length;b++){var E=e[b].key;if(n[E]===d.key||n[E]===g.key){var A=E;for(var M=0;M<e.length;M++){var S=e[M].key;if(a[E][S]<a[E][A])A=S}n[E]=A}e[b].index=b}return d.key=g.key=d.index=g.index=null,!0},aa=function(e,r,a){if(!e)return;if(e.value)r.push(e.value);else{if(e.left)aa(e.left,r);if(e.right)aa(e.right,r)}},Ks=function(e,r){if(!e)return"";if(e.left&&e.right){var a=Ks(e.left,r),n=Ks(e.right,r),i=r.add({group:"nodes",data:{id:a+","+n}});return r.add({group:"edges",data:{source:a,target:i.id()}}),r.add({group:"edges",data:{source:n,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},Zs=function(e,r,a){if(!e)return[];var n=[],i=[],s=[];if(r===0){if(e.left)aa(e.left,n);if(e.right)aa(e.right,i);return s=n.concat(i),[a.collection(s)]}else if(r===1)if(e.value)return[a.collection(e.value)];else{if(e.left)aa(e.left,n);if(e.right)aa(e.right,i);return[a.collection(n),a.collection(i)]}else if(e.value)return[a.collection(e.value)];else{if(e.left)n=Zs(e.left,r-1,a);if(e.right)i=Zs(e.right,r-1,a);return n.concat(i)}},mu=function(e){var r=this.cy(),a=this.nodes(),n=Md(e),i=n.attributes,s=function(b,E){return jn(n.distance,i.length,function(A){return i[A](b)},function(A){return i[A](E)},b,E)},o=[],l=[],u=[],f=[];for(var v=0;v<a.length;v++){var h={value:n.mode==="dendrogram"?a[v]:[a[v]],key:v,index:v};o[v]=h,f[v]=h,l[v]=[],u[v]=0}for(var c=0;c<o.length;c++)for(var d=0;d<=c;d++){var g=void 0;if(n.mode==="dendrogram")g=c===d?1/0:s(o[c].value,o[d].value);else g=c===d?1/0:s(o[c].value[0],o[d].value[0]);if(l[c][d]=g,l[d][c]=g,g<l[c][u[c]])u[c]=d}var y=yu(o,f,l,u,n);while(y)y=yu(o,f,l,u,n);var p;if(n.mode==="dendrogram"){if(p=Zs(o[0],n.dendrogramDepth,r),n.addDendrogram)Ks(o[0],r)}else p=Array(o.length),o.forEach(function(m,b){m.key=m.index=null,p[b]=r.collection(m.value)});return p},Ld={hierarchicalClustering:mu,hca:mu},Rd=St({distance:"euclidean",preference:"median",damping:0.8,maxIterations:1000,minIterations:100,attributes:[]}),Pd=function(e){var{damping:r,preference:a}=e;if(!(0.5<=r&&r<1))it("Damping must range on [0.5, 1). Got: ".concat(r));var n=["median","mean","min","max"];if(!(n.some(function(i){return i===a})||he(a)))it("Preference must be one of [".concat(n.map(function(i){return"'".concat(i,"'")}).join(", "),"] or a number. Got: ").concat(a));return Rd(e)},Nd=function(e,r,a,n){var i=function(o,l){return n[l](o)};return-jn(e,n.length,function(s){return i(r,s)},function(s){return i(a,s)},r,a)},Od=function(e,r){var a=null;if(r==="median")a=Rc(e);else if(r==="mean")a=Lc(e);else if(r==="min")a=Ac(e);else if(r==="max")a=Mc(e);else a=r;return a},Id=function(e,r,a){var n=[];for(var i=0;i<e;i++)if(r[i*e+i]+a[i*e+i]>0)n.push(i);return n},bu=function(e,r,a){var n=[];for(var i=0;i<e;i++){var s=-1,o=-1/0;for(var l=0;l<a.length;l++){var u=a[l];if(r[i*e+u]>o)s=u,o=r[i*e+u]}if(s>0)n.push(s)}for(var f=0;f<a.length;f++)n[a[f]]=a[f];return n},Bd=function(e,r,a){var n=bu(e,r,a);for(var i=0;i<a.length;i++){var s=[];for(var o=0;o<n.length;o++)if(n[o]===a[i])s.push(o);var l=-1,u=-1/0;for(var f=0;f<s.length;f++){var v=0;for(var h=0;h<s.length;h++)v+=r[s[h]*e+s[f]];if(v>u)l=f,u=v}a[i]=s[l]}return n=bu(e,r,a),n},wu=function(e){var r=this.cy(),a=this.nodes(),n=Pd(e),i={};for(var s=0;s<a.length;s++)i[a[s].id()]=s;var o,l,u,f,v,h;o=a.length,l=o*o,u=Array(l);for(var c=0;c<l;c++)u[c]=-1/0;for(var d=0;d<o;d++)for(var g=0;g<o;g++)if(d!==g)u[d*o+g]=Nd(n.distance,a[d],a[g],n.attributes);f=Od(u,n.preference);for(var y=0;y<o;y++)u[y*o+y]=f;v=Array(l);for(var p=0;p<l;p++)v[p]=0;h=Array(l);for(var m=0;m<l;m++)h[m]=0;var b=Array(o),E=Array(o),A=Array(o);for(var M=0;M<o;M++)b[M]=0,E[M]=0,A[M]=0;var S=Array(o*n.minIterations);for(var P=0;P<S.length;P++)S[P]=0;var N;for(N=0;N<n.maxIterations;N++){for(var R=0;R<o;R++){var I=-1/0,w=-1/0,x=-1,T=0;for(var D=0;D<o;D++)if(b[D]=v[R*o+D],T=h[R*o+D]+u[R*o+D],T>=I)w=I,I=T,x=D;else if(T>w)w=T;for(var C=0;C<o;C++)v[R*o+C]=(1-n.damping)*(u[R*o+C]-I)+n.damping*b[C];v[R*o+x]=(1-n.damping)*(u[R*o+x]-w)+n.damping*b[x]}for(var O=0;O<o;O++){var B=0;for(var z=0;z<o;z++)b[z]=h[z*o+O],E[z]=Math.max(0,v[z*o+O]),B+=E[z];B-=E[O],E[O]=v[O*o+O],B+=E[O];for(var V=0;V<o;V++)h[V*o+O]=(1-n.damping)*Math.min(0,B-E[V])+n.damping*b[V];h[O*o+O]=(1-n.damping)*(B-E[O])+n.damping*b[O]}var k=0;for(var G=0;G<o;G++){var J=h[G*o+G]+v[G*o+G]>0?1:0;S[N%n.minIterations*o+G]=J,k+=J}if(k>0&&(N>=n.minIterations-1||N==n.maxIterations-1)){var X=0;for(var _=0;_<o;_++){A[_]=0;for(var Q=0;Q<n.minIterations;Q++)A[_]+=S[Q*o+_];if(A[_]===0||A[_]===n.minIterations)X++}if(X===o)break}}var q=Id(o,v,h),te=Bd(o,u,q),Z={};for(var U=0;U<q.length;U++)Z[q[U]]=[];for(var W=0;W<a.length;W++){var j=i[a[W].id()],re=te[j];if(re!=null)Z[re].push(a[W])}var ee=Array(q.length);for(var de=0;de<q.length;de++)ee[de]=r.collection(Z[q[de]]);return ee},kd={affinityPropagation:wu,ap:wu},Fd=St({root:void 0,directed:!1}),zd={hierholzer:function(e){if(!We(e)){var r=arguments;e={root:r[0],directed:r[1]}}var a=Fd(e),{root:n,directed:i}=a,s=this,o=!1,l,u,f;if(n)f=Re(n)?this.filter(n)[0].id():n[0].id();var v={},h={},c=s.edges().filter(function(b){return s.has(b.source())&&s.has(b.target())});if(i)s.forEach(function(b){var E=b.id();if(b.isNode()){var A=b.incomers().edges().intersection(c),M=b.outgoers().edges().intersection(c),S=A.length,P=M.length,N=S-P,R=P-S;if(N==1)if(l)o=!0;else l=E;else if(R==1)if(u)o=!0;else u=E;else if(R>1||N>1)o=!0;v[E]=[],M.forEach(function(I){return v[E].push(I.id())})}else h[E]=[void 0,b.target().id()]});else s.forEach(function(b){var E=b.id();if(b.isNode()){var A=b.connectedEdges().intersection(c),M=A.length+A.filter(function(S){return S.isLoop()}).length;if(M%2)if(!l)l=E;else if(!u)u=E;else o=!0;v[E]=[],A.forEach(function(S){return v[E].push(S.id())})}else h[E]=[b.source().id(),b.target().id()]});var d={found:!1,trail:void 0};if(o)return d;else if(u&&l){if(i){if(f&&u!=f)return d;f=u}else if(f&&u!=f&&l!=f)return d;else if(!f)f=u}else if(!f)f=s[0].id();var g=function(E){var A=E,M=[E],S,P,N;while(v[A].length){if(S=v[A].shift(),P=h[S][0],N=h[S][1],A!=N)v[N]=v[N].filter(function(R){return R!=S}),A=N;else if(!i&&A!=P)v[P]=v[P].filter(function(R){return R!=S}),A=P;M.unshift(S),M.unshift(A)}return M},y=[],p=[];p=g(f);while(p.length!=1)if(v[p[0]].length==0)y.unshift(s.getElementById(p.shift())),y.unshift(s.getElementById(p.shift()));else p=g(p.shift()).concat(p);y.unshift(s.getElementById(p.shift()));for(var m in v)if(v[m].length)return d;return d.found=!0,d.trail=this.spawn(y,!0),d}},gn=function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=function(h,c){var d=s.length-1,g=[],y=e.spawn();while(s[d].x!=h||s[d].y!=c)g.push(s.pop().edge),d--;g.push(s.pop().edge),g.forEach(function(p){var m=p.connectedNodes().intersection(e);y.merge(p),m.forEach(function(b){var E=b.id(),A=b.connectedEdges().intersection(e);if(y.merge(b),!r[E].cutVertex)y.merge(A);else y.merge(A.filter(function(M){return M.isLoop()}))})}),i.push(y)},u=function(h,c,d){if(h===d)n+=1;r[c]={id:a,low:a++,cutVertex:!1};var g=e.getElementById(c).connectedEdges().intersection(e);if(g.size()===0)i.push(e.spawn(e.getElementById(c)));else{var y,p,m,b;g.forEach(function(E){if(y=E.source().id(),p=E.target().id(),m=y===c?p:y,m!==d){if(b=E.id(),!o[b])o[b]=!0,s.push({x:c,y:m,edge:E});if(!(m in r)){if(u(h,m,c),r[c].low=Math.min(r[c].low,r[m].low),r[c].id<=r[m].low)r[c].cutVertex=!0,l(c,m)}else r[c].low=Math.min(r[c].low,r[m].id)}})}};e.forEach(function(v){if(v.isNode()){var h=v.id();if(!(h in r))n=0,u(h,h),r[h].cutVertex=n>1}});var f=Object.keys(r).filter(function(v){return r[v].cutVertex}).map(function(v){return e.getElementById(v)});return{cut:e.spawn(f),components:i}},Vd={hopcroftTarjanBiconnected:gn,htbc:gn,htb:gn,hopcroftTarjanBiconnectedComponents:gn},pn=function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=function(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.forEach(function(g){var y=g.target().id();if(y!==u){if(!(y in r))o(y);if(!r[y].explored)r[u].low=Math.min(r[u].low,r[y].low)}}),r[u].index===r[u].low){var v=e.spawn();for(;;){var h=i.pop();if(v.merge(e.getElementById(h)),r[h].low=r[u].index,r[h].explored=!0,h===u)break}var c=v.edgesWith(v),d=v.merge(c);n.push(d),s=s.difference(d)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();if(!(u in r))o(u)}}),{cut:s,components:n}},Gd={tarjanStronglyConnected:pn,tsc:pn,tscc:pn,tarjanStronglyConnectedComponents:pn},Xf={};[Ga,gc,pc,mc,wc,xc,Sc,jc,sa,oa,$s,hd,Sd,Ld,kd,zd,Vd,Gd].forEach(function(t){Oe(Xf,t)});/*!
|