var tt=(A,w,u)=>new Promise((m,v)=>{var r=i=>{try{e(u.next(i))}catch(o){v(o)}},t=i=>{try{e(u.throw(i))}catch(o){v(o)}},e=i=>i.done?m(i.value):Promise.resolve(i.value).then(r,t);e((u=u.apply(A,w)).next())});import{_ as S,l as z,j as Dt,ab as mt,L as Ot,d as ot,I as At,a2 as It,D as et,i as rt,a3 as Ct,a4 as Rt,a5 as xt}from"./chart-vendor-e1d59b84.js";import{c as dt}from"./cytoscape.esm-73b8622f.js";import{c as ht,g as Mt}from"./utils-vendor-c35799af.js";import"./vue-vendor-d751b0f5.js";var vt={exports:{}},nt={exports:{}},st={exports:{}},ft;function wt(){return ft||(ft=1,function(A,w){(function(m,v){A.exports=v()})(ht,function(){return function(u){var m={};function v(r){if(m[r])return m[r].exports;var t=m[r]={i:r,l:!1,exports:{}};return u[r].call(t.exports,t,t.exports,v),t.l=!0,t.exports}return v.m=u,v.c=m,v.i=function(r){return r},v.d=function(r,t,e){v.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},v.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return v.d(t,"a",t),t},v.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},v.p="",v(v.s=26)}([function(u,m,v){function r(){}r.QUALITY=1,r.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,r.DEFAULT_INCREMENTAL=!1,r.DEFAULT_ANIMATION_ON_LAYOUT=!0,r.DEFAULT_ANIMATION_DURING_LAYOUT=!1,r.DEFAULT_ANIMATION_PERIOD=50,r.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,r.DEFAULT_GRAPH_MARGIN=15,r.NODE_DIMENSIONS_INCLUDE_LABELS=!1,r.SIMPLE_NODE_SIZE=40,r.SIMPLE_NODE_HALF_SIZE=r.SIMPLE_NODE_SIZE/2,r.EMPTY_COMPOUND_NODE_SIZE=40,r.MIN_EDGE_LENGTH=1,r.WORLD_BOUNDARY=1e6,r.INITIAL_WORLD_BOUNDARY=r.WORLD_BOUNDARY/1e3,r.WORLD_CENTER_X=1200,r.WORLD_CENTER_Y=900,u.exports=r},function(u,m,v){var r=v(2),t=v(8),e=v(9);function i(g,a,y){r.call(this,y),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=y,this.bendpoints=[],this.source=g,this.target=a}i.prototype=Object.create(r.prototype);for(var o in r)i[o]=r[o];i.prototype.getSource=function(){return this.source},i.prototype.getTarget=function(){return this.target},i.prototype.isInterGraph=function(){return this.isInterGraph},i.prototype.getLength=function(){return this.length},i.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},i.prototype.getBendpoints=function(){return this.bendpoints},i.prototype.getLca=function(){return this.lca},i.prototype.getSourceInLca=function(){return this.sourceInLca},i.prototype.getTargetInLca=function(){return this.targetInLca},i.prototype.getOtherEnd=function(g){if(this.source===g)return this.target;if(this.target===g)return this.source;throw"Node is not incident with this edge"},i.prototype.getOtherEndInGraph=function(g,a){for(var y=this.getOtherEnd(g),n=a.getGraphManager().getRoot();;){if(y.getOwner()==a)return y;if(y.getOwner()==n)break;y=y.getOwner().getParent()}return null},i.prototype.updateLength=function(){var g=new Array(4);this.isOverlapingSourceAndTarget=t.getIntersection(this.target.getRect(),this.source.getRect(),g),this.isOverlapingSourceAndTarget||(this.lengthX=g[0]-g[2],this.lengthY=g[1]-g[3],Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},i.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=e.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=e.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},u.exports=i},function(u,m,v){function r(t){this.vGraphObject=t}u.exports=r},function(u,m,v){var r=v(2),t=v(10),e=v(13),i=v(0),o=v(16),g=v(4);function a(n,h,c,E){c==null&&E==null&&(E=h),r.call(this,E),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=t.MIN_VALUE,this.inclusionTreeDepth=t.MAX_VALUE,this.vGraphObject=E,this.edges=[],this.graphManager=n,c!=null&&h!=null?this.rect=new e(h.x,h.y,c.width,c.height):this.rect=new e}a.prototype=Object.create(r.prototype);for(var y in r)a[y]=r[y];a.prototype.getEdges=function(){return this.edges},a.prototype.getChild=function(){return this.child},a.prototype.getOwner=function(){return this.owner},a.prototype.getWidth=function(){return this.rect.width},a.prototype.setWidth=function(n){this.rect.width=n},a.prototype.getHeight=function(){return this.rect.height},a.prototype.setHeight=function(n){this.rect.height=n},a.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},a.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},a.prototype.getCenter=function(){return new g(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},a.prototype.getLocation=function(){return new g(this.rect.x,this.rect.y)},a.prototype.getRect=function(){return this.rect},a.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},a.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},a.prototype.setRect=function(n,h){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=h.width,this.rect.height=h.height},a.prototype.setCenter=function(n,h){this.rect.x=n-this.rect.width/2,this.rect.y=h-this.rect.height/2},a.prototype.setLocation=function(n,h){this.rect.x=n,this.rect.y=h},a.prototype.moveBy=function(n,h){this.rect.x+=n,this.rect.y+=h},a.prototype.getEdgeListToNode=function(n){var h=[],c=this;return c.edges.forEach(function(E){if(E.target==n){if(E.source!=c)throw"Incorrect edge source!";h.push(E)}}),h},a.prototype.getEdgesBetween=function(n){var h=[],c=this;return c.edges.forEach(function(E){if(!(E.source==c||E.target==c))throw"Incorrect edge source and/or target";(E.target==n||E.source==n)&&h.push(E)}),h},a.prototype.getNeighborsList=function(){var n=new Set,h=this;return h.edges.forEach(function(c){if(c.source==h)n.add(c.target);else{if(c.target!=h)throw"Incorrect incidency!";n.add(c.source)}}),n},a.prototype.withChildren=function(){var n=new Set,h,c;if(n.add(this),this.child!=null)for(var E=this.child.getNodes(),T=0;Th&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>c&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-c)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-c),this.setHeight(this.labelHeight))}}},a.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==t.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},a.prototype.transform=function(n){var h=this.rect.x;h>i.WORLD_BOUNDARY?h=i.WORLD_BOUNDARY:h<-i.WORLD_BOUNDARY&&(h=-i.WORLD_BOUNDARY);var c=this.rect.y;c>i.WORLD_BOUNDARY?c=i.WORLD_BOUNDARY:c<-i.WORLD_BOUNDARY&&(c=-i.WORLD_BOUNDARY);var E=new g(h,c),T=n.inverseTransformPoint(E);this.setLocation(T.x,T.y)},a.prototype.getLeft=function(){return this.rect.x},a.prototype.getRight=function(){return this.rect.x+this.rect.width},a.prototype.getTop=function(){return this.rect.y},a.prototype.getBottom=function(){return this.rect.y+this.rect.height},a.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},u.exports=a},function(u,m,v){function r(t,e){t==null&&e==null?(this.x=0,this.y=0):(this.x=t,this.y=e)}r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.setX=function(t){this.x=t},r.prototype.setY=function(t){this.y=t},r.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)},r.prototype.getCopy=function(){return new r(this.x,this.y)},r.prototype.translate=function(t){return this.x+=t.width,this.y+=t.height,this},u.exports=r},function(u,m,v){var r=v(2),t=v(10),e=v(0),i=v(6),o=v(3),g=v(1),a=v(13),y=v(12),n=v(11);function h(E,T,D){r.call(this,D),this.estimatedSize=t.MIN_VALUE,this.margin=e.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=E,T!=null&&T instanceof i?this.graphManager=T:T!=null&&T instanceof Layout&&(this.graphManager=T.graphManager)}h.prototype=Object.create(r.prototype);for(var c in r)h[c]=r[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(E,T,D){if(T==null&&D==null){var L=E;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(L)>-1)throw"Node already in graph!";return L.owner=this,this.getNodes().push(L),L}else{var O=E;if(!(this.getNodes().indexOf(T)>-1&&this.getNodes().indexOf(D)>-1))throw"Source or target not in graph!";if(!(T.owner==D.owner&&T.owner==this))throw"Both owners must be this graph!";return T.owner!=D.owner?null:(O.source=T,O.target=D,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),D!=T&&D.edges.push(O),O)}},h.prototype.remove=function(E){var T=E;if(E instanceof o){if(T==null)throw"Node is null!";if(!(T.owner!=null&&T.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var D=T.edges.slice(),L,O=D.length,d=0;d-1&&l>-1))throw"Source and/or target doesn't know this edge!";L.source.edges.splice(s,1),L.target!=L.source&&L.target.edges.splice(l,1);var N=L.source.owner.getEdges().indexOf(L);if(N==-1)throw"Not in owner's edge list!";L.source.owner.getEdges().splice(N,1)}},h.prototype.updateLeftTop=function(){for(var E=t.MAX_VALUE,T=t.MAX_VALUE,D,L,O,d=this.getNodes(),N=d.length,s=0;sD&&(E=D),T>L&&(T=L)}return E==t.MAX_VALUE?null:(d[0].getParent().paddingLeft!=null?O=d[0].getParent().paddingLeft:O=this.margin,this.left=T-O,this.top=E-O,new y(this.left,this.top))},h.prototype.updateBounds=function(E){for(var T=t.MAX_VALUE,D=-t.MAX_VALUE,L=t.MAX_VALUE,O=-t.MAX_VALUE,d,N,s,l,f,p=this.nodes,I=p.length,C=0;Cd&&(T=d),Ds&&(L=s),Od&&(T=d),Ds&&(L=s),O=this.nodes.length){var I=0;D.forEach(function(C){C.owner==E&&I++}),I==this.nodes.length&&(this.isConnected=!0)}},u.exports=h},function(u,m,v){var r,t=v(1);function e(i){r=v(5),this.layout=i,this.graphs=[],this.edges=[]}e.prototype.addRoot=function(){var i=this.layout.newGraph(),o=this.layout.newNode(null),g=this.add(i,o);return this.setRootGraph(g),this.rootGraph},e.prototype.add=function(i,o,g,a,y){if(g==null&&a==null&&y==null){if(i==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(i)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(i),i.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return i.parent=o,o.child=i,i}else{y=g,a=o,g=i;var n=a.getOwner(),h=y.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==h)return g.isInterGraph=!1,n.add(g,a,y);if(g.isInterGraph=!0,g.source=a,g.target=y,this.edges.indexOf(g)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(g),!(g.source!=null&&g.target!=null))throw"Edge source and/or target is null!";if(!(g.source.edges.indexOf(g)==-1&&g.target.edges.indexOf(g)==-1))throw"Edge already in source and/or target incidency list!";return g.source.edges.push(g),g.target.edges.push(g),g}},e.prototype.remove=function(i){if(i instanceof r){var o=i;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 g=[];g=g.concat(o.getEdges());for(var a,y=g.length,n=0;n=i.getRight()?o[0]+=Math.min(i.getX()-e.getX(),e.getRight()-i.getRight()):i.getX()<=e.getX()&&i.getRight()>=e.getRight()&&(o[0]+=Math.min(e.getX()-i.getX(),i.getRight()-e.getRight())),e.getY()<=i.getY()&&e.getBottom()>=i.getBottom()?o[1]+=Math.min(i.getY()-e.getY(),e.getBottom()-i.getBottom()):i.getY()<=e.getY()&&i.getBottom()>=e.getBottom()&&(o[1]+=Math.min(e.getY()-i.getY(),i.getBottom()-e.getBottom()));var y=Math.abs((i.getCenterY()-e.getCenterY())/(i.getCenterX()-e.getCenterX()));i.getCenterY()===e.getCenterY()&&i.getCenterX()===e.getCenterX()&&(y=1);var n=y*o[0],h=o[1]/y;o[0]n)return o[0]=g,o[1]=c,o[2]=y,o[3]=p,!1;if(ay)return o[0]=h,o[1]=a,o[2]=l,o[3]=n,!1;if(gy?(o[0]=T,o[1]=D,x=!0):(o[0]=E,o[1]=c,x=!0):U===M&&(g>y?(o[0]=h,o[1]=c,x=!0):(o[0]=L,o[1]=D,x=!0)),-X===M?y>g?(o[2]=f,o[3]=p,_=!0):(o[2]=l,o[3]=s,_=!0):X===M&&(y>g?(o[2]=N,o[3]=s,_=!0):(o[2]=I,o[3]=p,_=!0)),x&&_)return!1;if(g>y?a>n?(G=this.getCardinalDirection(U,M,4),F=this.getCardinalDirection(X,M,2)):(G=this.getCardinalDirection(-U,M,3),F=this.getCardinalDirection(-X,M,1)):a>n?(G=this.getCardinalDirection(-U,M,1),F=this.getCardinalDirection(-X,M,3)):(G=this.getCardinalDirection(U,M,2),F=this.getCardinalDirection(X,M,4)),!x)switch(G){case 1:Y=c,b=g+-d/M,o[0]=b,o[1]=Y;break;case 2:b=L,Y=a+O*M,o[0]=b,o[1]=Y;break;case 3:Y=D,b=g+d/M,o[0]=b,o[1]=Y;break;case 4:b=T,Y=a+-O*M,o[0]=b,o[1]=Y;break}if(!_)switch(F){case 1:H=s,k=y+-R/M,o[2]=k,o[3]=H;break;case 2:k=I,H=n+C*M,o[2]=k,o[3]=H;break;case 3:H=p,k=y+R/M,o[2]=k,o[3]=H;break;case 4:k=f,H=n+-C*M,o[2]=k,o[3]=H;break}}return!1},t.getCardinalDirection=function(e,i,o){return e>i?o:1+o%4},t.getIntersection=function(e,i,o,g){if(g==null)return this.getIntersection2(e,i,o);var a=e.x,y=e.y,n=i.x,h=i.y,c=o.x,E=o.y,T=g.x,D=g.y,L=void 0,O=void 0,d=void 0,N=void 0,s=void 0,l=void 0,f=void 0,p=void 0,I=void 0;return d=h-y,s=a-n,f=n*y-a*h,N=D-E,l=c-T,p=T*E-c*D,I=d*l-N*s,I===0?null:(L=(s*p-l*f)/I,O=(N*f-d*p)/I,new r(L,O))},t.angleOfVector=function(e,i,o,g){var a=void 0;return e!==o?(a=Math.atan((g-i)/(o-e)),o0?1:t<0?-1:0},r.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)},r.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)},u.exports=r},function(u,m,v){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,u.exports=r},function(u,m,v){var r=function(){function a(y,n){for(var h=0;h0&&E;){for(d.push(s[0]);d.length>0&&E;){var l=d[0];d.splice(0,1),O.add(l);for(var f=l.getEdges(),L=0;L-1&&s.splice(R,1)}O=new Set,N=new Map}}return c},h.prototype.createDummyNodesForBendpoints=function(c){for(var E=[],T=c.source,D=this.graphManager.calcLowestCommonAncestor(c.source,c.target),L=0;L0){for(var D=this.edgeToDummyNodes.get(T),L=0;L=0&&E.splice(p,1);var I=N.getNeighborsList();I.forEach(function(x){if(T.indexOf(x)<0){var _=D.get(x),U=_-1;U==1&&l.push(x),D.set(x,U)}})}T=T.concat(l),(E.length==1||E.length==2)&&(L=!0,O=E[0])}return O},h.prototype.setGraphManager=function(c){this.graphManager=c},u.exports=h},function(u,m,v){function r(){}r.seed=1,r.x=0,r.nextDouble=function(){return r.x=Math.sin(r.seed++)*1e4,r.x-Math.floor(r.x)},u.exports=r},function(u,m,v){var r=v(4);function t(e,i){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}t.prototype.getWorldOrgX=function(){return this.lworldOrgX},t.prototype.setWorldOrgX=function(e){this.lworldOrgX=e},t.prototype.getWorldOrgY=function(){return this.lworldOrgY},t.prototype.setWorldOrgY=function(e){this.lworldOrgY=e},t.prototype.getWorldExtX=function(){return this.lworldExtX},t.prototype.setWorldExtX=function(e){this.lworldExtX=e},t.prototype.getWorldExtY=function(){return this.lworldExtY},t.prototype.setWorldExtY=function(e){this.lworldExtY=e},t.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},t.prototype.setDeviceOrgX=function(e){this.ldeviceOrgX=e},t.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},t.prototype.setDeviceOrgY=function(e){this.ldeviceOrgY=e},t.prototype.getDeviceExtX=function(){return this.ldeviceExtX},t.prototype.setDeviceExtX=function(e){this.ldeviceExtX=e},t.prototype.getDeviceExtY=function(){return this.ldeviceExtY},t.prototype.setDeviceExtY=function(e){this.ldeviceExtY=e},t.prototype.transformX=function(e){var i=0,o=this.lworldExtX;return o!=0&&(i=this.ldeviceOrgX+(e-this.lworldOrgX)*this.ldeviceExtX/o),i},t.prototype.transformY=function(e){var i=0,o=this.lworldExtY;return o!=0&&(i=this.ldeviceOrgY+(e-this.lworldOrgY)*this.ldeviceExtY/o),i},t.prototype.inverseTransformX=function(e){var i=0,o=this.ldeviceExtX;return o!=0&&(i=this.lworldOrgX+(e-this.ldeviceOrgX)*this.lworldExtX/o),i},t.prototype.inverseTransformY=function(e){var i=0,o=this.ldeviceExtY;return o!=0&&(i=this.lworldOrgY+(e-this.ldeviceOrgY)*this.lworldExtY/o),i},t.prototype.inverseTransformPoint=function(e){var i=new r(this.inverseTransformX(e.x),this.inverseTransformY(e.y));return i},u.exports=t},function(u,m,v){function r(n){if(Array.isArray(n)){for(var h=0,c=Array(n.length);he.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*e.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-e.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT_INCREMENTAL):(n>e.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(e.COOLING_ADAPTATION_FACTOR,1-(n-e.ADAPTATION_LOWER_NODE_LIMIT)/(e.ADAPTATION_UPPER_NODE_LIMIT-e.ADAPTATION_LOWER_NODE_LIMIT)*(1-e.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=e.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},a.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),h,c=0;c0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c,E,T,D,L=this.getAllNodes(),O;if(this.useFRGridVariant)for(this.totalIterations%e.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),O=new Set,c=0;cd||O>d)&&(n.gravitationForceX=-this.gravityConstant*T,n.gravitationForceY=-this.gravityConstant*D)):(d=h.getEstimatedSize()*this.compoundGravityRangeFactor,(L>d||O>d)&&(n.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*D*this.compoundGravityConstant))},a.prototype.isConverged=function(){var n,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement=L.length||d>=L[0].length)){for(var N=0;Na}}]),o}();u.exports=i},function(u,m,v){var r=function(){function i(o,g){for(var a=0;a2&&arguments[2]!==void 0?arguments[2]:1,y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;t(this,i),this.sequence1=o,this.sequence2=g,this.match_score=a,this.mismatch_penalty=y,this.gap_penalty=n,this.iMax=o.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var h=0;h=0;o--){var g=this.listeners[o];g.event===e&&g.callback===i&&this.listeners.splice(o,1)}},t.emit=function(e,i){for(var o=0;og.coolingFactor*g.maxNodeDisplacement&&(this.displacementX=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementX)),Math.abs(this.displacementY)>g.coolingFactor*g.maxNodeDisplacement&&(this.displacementY=g.coolingFactor*g.maxNodeDisplacement*e.sign(this.displacementY)),this.child==null?this.moveBy(this.displacementX,this.displacementY):this.child.getNodes().length==0?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),g.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},i.prototype.propogateDisplacementToChildren=function(g,a){for(var y=this.getChild().getNodes(),n,h=0;h0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var l=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(p){return l.has(p)});this.graphManager.setAllNodesToApplyGravitation(f),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},d.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%y.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged())if(this.prunedNodesAll.length>0)this.isTreeGrowing=!0;else return!0;this.coolingCycle++,this.layoutQuality==0?this.coolingAdjuster=this.coolingCycle: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 s=new Set(this.getAllNodes()),l=this.nodesWithGravity.filter(function(I){return s.has(I)});this.graphManager.setAllNodesToApplyGravitation(l),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=y.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var f=!this.isTreeGrowing&&!this.isGrowthFinished,p=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(f,p),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},d.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),l={},f=0;f1){var x;for(x=0;xp&&(p=Math.floor(R.y)),C=Math.floor(R.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new c(n.WORLD_CENTER_X-R.x/2,n.WORLD_CENTER_Y-R.y/2))},d.radialLayout=function(s,l,f){var p=Math.max(this.maxDiagonalInTree(s),a.DEFAULT_RADIAL_SEPARATION);d.branchRadialLayout(l,null,0,359,0,p);var I=L.calculateBounds(s),C=new O;C.setDeviceOrgX(I.getMinX()),C.setDeviceOrgY(I.getMinY()),C.setWorldOrgX(f.x),C.setWorldOrgY(f.y);for(var R=0;R1;){var H=k[0];k.splice(0,1);var P=M.indexOf(H);P>=0&&M.splice(P,1),b--,G--}l!=null?Y=(M.indexOf(k[0])+1)%b:Y=0;for(var B=Math.abs(p-f)/G,$=Y;F!=G;$=++$%b){var K=M[$].getOtherEnd(s);if(K!=l){var Q=(f+F*B)%360,J=(Q+B)%360;d.branchRadialLayout(K,s,Q,J,I+C,C),F++}}},d.maxDiagonalInTree=function(s){for(var l=T.MIN_VALUE,f=0;fl&&(l=I)}return l},d.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},d.prototype.groupZeroDegreeMembers=function(){var s=this,l={};this.memberGroups={},this.idToDummyNode={};for(var f=[],p=this.graphManager.getAllNodes(),I=0;I1){var U="DummyCompound_"+_;s.memberGroups[U]=l[_];var X=l[_][0].getParent(),M=new o(s.graphManager);M.id=U,M.paddingLeft=X.paddingLeft||0,M.paddingRight=X.paddingRight||0,M.paddingBottom=X.paddingBottom||0,M.paddingTop=X.paddingTop||0,s.idToDummyNode[U]=M;var G=s.getGraphManager().add(s.newGraph(),M),F=X.getChild();F.add(M);for(var b=0;b=0;s--){var l=this.compoundOrder[s],f=l.id,p=l.paddingLeft,I=l.paddingTop;this.adjustLocations(this.tiledMemberPack[f],l.rect.x,l.rect.y,p,I)}},d.prototype.repopulateZeroDegreeMembers=function(){var s=this,l=this.tiledZeroDegreePack;Object.keys(l).forEach(function(f){var p=s.idToDummyNode[f],I=p.paddingLeft,C=p.paddingTop;s.adjustLocations(l[f],p.rect.x,p.rect.y,I,C)})},d.prototype.getToBeTiled=function(s){var l=s.id;if(this.toBeTiled[l]!=null)return this.toBeTiled[l];var f=s.getChild();if(f==null)return this.toBeTiled[l]=!1,!1;for(var p=f.getNodes(),I=0;I0)return this.toBeTiled[l]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[l]=!1,!1}return this.toBeTiled[l]=!0,!0},d.prototype.getNodeDegree=function(s){s.id;for(var l=s.getEdges(),f=0,p=0;p_&&(_=X.rect.height)}f+=_+s.verticalPadding}},d.prototype.tileCompoundMembers=function(s,l){var f=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(p){var I=l[p];f.tiledMemberPack[p]=f.tileNodes(s[p],I.paddingLeft+I.paddingRight),I.rect.width=f.tiledMemberPack[p].width,I.rect.height=f.tiledMemberPack[p].height})},d.prototype.tileNodes=function(s,l){var f=a.TILING_PADDING_VERTICAL,p=a.TILING_PADDING_HORIZONTAL,I={rows:[],rowWidth:[],rowHeight:[],width:0,height:l,verticalPadding:f,horizontalPadding:p};s.sort(function(x,_){return x.rect.width*x.rect.height>_.rect.width*_.rect.height?-1:x.rect.width*x.rect.height<_.rect.width*_.rect.height?1:0});for(var C=0;C0&&(R+=s.horizontalPadding),s.rowWidth[f]=R,s.width0&&(x+=s.verticalPadding);var _=0;x>s.rowHeight[f]&&(_=s.rowHeight[f],s.rowHeight[f]=x,_=s.rowHeight[f]-_),s.height+=_,s.rows[f].push(l)},d.prototype.getShortestRowIndex=function(s){for(var l=-1,f=Number.MAX_VALUE,p=0;pf&&(l=p,f=s.rowWidth[p]);return l},d.prototype.canAddHorizontal=function(s,l,f){var p=this.getShortestRowIndex(s);if(p<0)return!0;var I=s.rowWidth[p];if(I+s.horizontalPadding+l<=s.width)return!0;var C=0;s.rowHeight[p]0&&(C=f+s.verticalPadding-s.rowHeight[p]);var R;s.width-I>=l+s.horizontalPadding?R=(s.height+C)/(I+l+s.horizontalPadding):R=(s.height+C)/s.width,C=f+s.verticalPadding;var x;return s.widthC&&l!=f){p.splice(-1,1),s.rows[f].push(I),s.rowWidth[l]=s.rowWidth[l]-C,s.rowWidth[f]=s.rowWidth[f]+C,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,x=0;xR&&(R=p[x].height);l>0&&(R+=s.verticalPadding);var _=s.rowHeight[l]+s.rowHeight[f];s.rowHeight[l]=R,s.rowHeight[f]0)for(var F=I;F<=C;F++)G[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(C0)for(var F=R;F<=x;F++)G[3]+=this.grid[I-1][F].length+this.grid[I][F].length-1;for(var b=T.MAX_VALUE,Y,k,H=0;H0){var x;x=O.getGraphManager().add(O.newGraph(),f),this.processChildrenList(x,l,O)}}},c.prototype.stop=function(){return this.stopped=!0,this};var T=function(L){L("layout","cose-bilkent",c)};typeof cytoscape!="undefined"&&T(cytoscape),m.exports=T}])})})(vt);var Gt=vt.exports;const _t=Mt(Gt);var at=function(){var A=S(function(O,d,N,s){for(N=N||{},s=O.length;s--;N[O[s]]=d);return N},"o"),w=[1,4],u=[1,13],m=[1,12],v=[1,15],r=[1,16],t=[1,20],e=[1,19],i=[6,7,8],o=[1,26],g=[1,24],a=[1,25],y=[6,7,11],n=[1,6,13,15,16,19,22],h=[1,33],c=[1,34],E=[1,6,7,11,13,15,16,19,22],T={trace:S(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:S(function(d,N,s,l,f,p,I){var C=p.length-1;switch(f){case 6:case 7:return l;case 8:l.getLogger().trace("Stop NL ");break;case 9:l.getLogger().trace("Stop EOF ");break;case 11:l.getLogger().trace("Stop NL2 ");break;case 12:l.getLogger().trace("Stop EOF2 ");break;case 15:l.getLogger().info("Node: ",p[C].id),l.addNode(p[C-1].length,p[C].id,p[C].descr,p[C].type);break;case 16:l.getLogger().trace("Icon: ",p[C]),l.decorateNode({icon:p[C]});break;case 17:case 21:l.decorateNode({class:p[C]});break;case 18:l.getLogger().trace("SPACELIST");break;case 19:l.getLogger().trace("Node: ",p[C].id),l.addNode(0,p[C].id,p[C].descr,p[C].type);break;case 20:l.decorateNode({icon:p[C]});break;case 25:l.getLogger().trace("node found ..",p[C-2]),this.$={id:p[C-1],descr:p[C-1],type:l.getType(p[C-2],p[C])};break;case 26:this.$={id:p[C],descr:p[C],type:l.nodeType.DEFAULT};break;case 27:l.getLogger().trace("node found ..",p[C-3]),this.$={id:p[C-3],descr:p[C-1],type:l.getType(p[C-2],p[C])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:w},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:w},{6:u,7:[1,10],9:9,12:11,13:m,14:14,15:v,16:r,17:17,18:18,19:t,22:e},A(i,[2,3]),{1:[2,2]},A(i,[2,4]),A(i,[2,5]),{1:[2,6],6:u,12:21,13:m,14:14,15:v,16:r,17:17,18:18,19:t,22:e},{6:u,9:22,12:11,13:m,14:14,15:v,16:r,17:17,18:18,19:t,22:e},{6:o,7:g,10:23,11:a},A(y,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:t,22:e}),A(y,[2,18]),A(y,[2,19]),A(y,[2,20]),A(y,[2,21]),A(y,[2,23]),A(y,[2,24]),A(y,[2,26],{19:[1,30]}),{20:[1,31]},{6:o,7:g,10:32,11:a},{1:[2,7],6:u,12:21,13:m,14:14,15:v,16:r,17:17,18:18,19:t,22:e},A(n,[2,14],{7:h,11:c}),A(E,[2,8]),A(E,[2,9]),A(E,[2,10]),A(y,[2,15]),A(y,[2,16]),A(y,[2,17]),{20:[1,35]},{21:[1,36]},A(n,[2,13],{7:h,11:c}),A(E,[2,11]),A(E,[2,12]),{21:[1,37]},A(y,[2,25]),A(y,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:S(function(d,N){if(N.recoverable)this.trace(d);else{var s=new Error(d);throw s.hash=N,s}},"parseError"),parse:S(function(d){var N=this,s=[0],l=[],f=[null],p=[],I=this.table,C="",R=0,x=0,_=2,U=1,X=p.slice.call(arguments,1),M=Object.create(this.lexer),G={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(G.yy[F]=this.yy[F]);M.setInput(d,G.yy),G.yy.lexer=M,G.yy.parser=this,typeof M.yylloc=="undefined"&&(M.yylloc={});var b=M.yylloc;p.push(b);var Y=M.options&&M.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function k(V){s.length=s.length-2*V,f.length=f.length-V,p.length=p.length-V}S(k,"popStack");function H(){var V;return V=l.pop()||M.lex()||U,typeof V!="number"&&(V instanceof Array&&(l=V,V=l.pop()),V=N.symbols_[V]||V),V}S(H,"lex");for(var P,B,$,K,Q={},J,j,ut,q;;){if(B=s[s.length-1],this.defaultActions[B]?$=this.defaultActions[B]:((P===null||typeof P=="undefined")&&(P=H()),$=I[B]&&I[B][P]),typeof $=="undefined"||!$.length||!$[0]){var it="";q=[];for(J in I[B])this.terminals_[J]&&J>_&&q.push("'"+this.terminals_[J]+"'");M.showPosition?it="Parse error on line "+(R+1)+`: `+M.showPosition()+` Expecting `+q.join(", ")+", got '"+(this.terminals_[P]||P)+"'":it="Parse error on line "+(R+1)+": Unexpected "+(P==U?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(it,{text:M.match,token:this.terminals_[P]||P,line:M.yylineno,loc:b,expected:q})}if($[0]instanceof Array&&$.length>1)throw new Error("Parse Error: multiple actions possible at state: "+B+", token: "+P);switch($[0]){case 1:s.push(P),f.push(M.yytext),p.push(M.yylloc),s.push($[1]),P=null,x=M.yyleng,C=M.yytext,R=M.yylineno,b=M.yylloc;break;case 2:if(j=this.productions_[$[1]][1],Q.$=f[f.length-j],Q._$={first_line:p[p.length-(j||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(j||1)].first_column,last_column:p[p.length-1].last_column},Y&&(Q._$.range=[p[p.length-(j||1)].range[0],p[p.length-1].range[1]]),K=this.performAction.apply(Q,[C,x,R,G.yy,$[1],f,p].concat(X)),typeof K!="undefined")return K;j&&(s=s.slice(0,-1*j*2),f=f.slice(0,-1*j),p=p.slice(0,-1*j)),s.push(this.productions_[$[1]][0]),f.push(Q.$),p.push(Q._$),ut=I[s[s.length-2]][s[s.length-1]],s.push(ut);break;case 3:return!0}}return!0},"parse")},D=function(){var O={EOF:1,parseError:S(function(N,s){if(this.yy.parser)this.yy.parser.parseError(N,s);else throw new Error(N)},"parseError"),setInput:S(function(d,N){return this.yy=N||this.yy||{},this._input=d,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:S(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var N=d.match(/(?:\r\n?|\n).*/g);return N?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:S(function(d){var N=d.length,s=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-N),this.offset-=N;var l=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===l.length?this.yylloc.first_column:0)+l[l.length-s.length].length-s[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:S(function(){return this._more=!0,this},"more"),reject:S(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:S(function(d){this.unput(this.match.slice(d))},"less"),pastInput:S(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:S(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:S(function(){var d=this.pastInput(),N=new Array(d.length+1).join("-");return d+this.upcomingInput()+` `+N+"^"},"showPosition"),test_match:S(function(d,N){var s,l,f;if(this.options.backtrack_lexer&&(f={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(f.yylloc.range=this.yylloc.range.slice(0))),l=d[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+d[0].length},this.yytext+=d[0],this.match+=d[0],this.matches=d,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(d[0].length),this.matched+=d[0],s=this.performAction.call(this,this.yy,this,N,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var p in f)this[p]=f[p];return!1}return!1},"test_match"),next:S(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var d,N,s,l;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),p=0;pN[0].length)){if(N=s,l=p,this.options.backtrack_lexer){if(d=this.test_match(s,f[p]),d!==!1)return d;if(this._backtrack){N=!1;continue}else return!1}else if(!this.options.flex)break}return N?(d=this.test_match(N,f[l]),d!==!1?d:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:S(function(){var N=this.next();return N||this.lex()},"lex"),begin:S(function(N){this.conditionStack.push(N)},"begin"),popState:S(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:S(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:S(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:S(function(N){this.begin(N)},"pushState"),stateStackSize:S(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:S(function(N,s,l,f){switch(l){case 0:return N.getLogger().trace("Found comment",s.yytext),6;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;case 4:this.popState();break;case 5:N.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return N.getLogger().trace("SPACELINE"),6;case 7:return 7;case 8:return 15;case 9:N.getLogger().trace("end icon"),this.popState();break;case 10:return N.getLogger().trace("Exploding node"),this.begin("NODE"),19;case 11:return N.getLogger().trace("Cloud"),this.begin("NODE"),19;case 12:return N.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;case 13:return N.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;case 14:return this.begin("NODE"),19;case 15:return this.begin("NODE"),19;case 16:return this.begin("NODE"),19;case 17:return this.begin("NODE"),19;case 18:return 13;case 19:return 22;case 20:return 11;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";case 23:this.popState();break;case 24:N.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return N.getLogger().trace("description:",s.yytext),"NODE_DESCR";case 26:this.popState();break;case 27:return this.popState(),N.getLogger().trace("node end ))"),"NODE_DEND";case 28:return this.popState(),N.getLogger().trace("node end )"),"NODE_DEND";case 29:return this.popState(),N.getLogger().trace("node end ...",s.yytext),"NODE_DEND";case 30:return this.popState(),N.getLogger().trace("node end (("),"NODE_DEND";case 31:return this.popState(),N.getLogger().trace("node end (-"),"NODE_DEND";case 32:return this.popState(),N.getLogger().trace("node end (-"),"NODE_DEND";case 33:return this.popState(),N.getLogger().trace("node end (("),"NODE_DEND";case 34:return this.popState(),N.getLogger().trace("node end (("),"NODE_DEND";case 35:return N.getLogger().trace("Long description:",s.yytext),20;case 36:return N.getLogger().trace("Long description:",s.yytext),20}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:!1},ICON:{rules:[8,9],inclusive:!1},NSTR2:{rules:[22,23],inclusive:!1},NSTR:{rules:[25,26],inclusive:!1},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:!1},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:!0}}};return O}();T.lexer=D;function L(){this.yy={}}return S(L,"Parser"),L.prototype=T,T.Parser=L,new L}();at.parser=at;var Ft=at,Z=[],yt=0,lt={},bt=S(()=>{Z=[],yt=0,lt={}},"clear"),Ut=S(function(A){for(let w=Z.length-1;w>=0;w--)if(Z[w].levelZ.length>0?Z[0]:null,"getMindmap"),Yt=S((A,w,u,m)=>{var i,o,g,a;z.info("addNode",A,w,u,m);const v=ot();let r=(o=(i=v.mindmap)==null?void 0:i.padding)!=null?o:et.mindmap.padding;switch(m){case W.ROUNDED_RECT:case W.RECT:case W.HEXAGON:r*=2}const t={id:yt++,nodeId:rt(w,v),level:A,descr:rt(u,v),type:m,children:[],width:(a=(g=v.mindmap)==null?void 0:g.maxNodeWidth)!=null?a:et.mindmap.maxNodeWidth,padding:r},e=Ut(A);if(e)e.children.push(t),Z.push(t);else if(Z.length===0)Z.push(t);else throw new Error('There can be only one root. No parent could be found for ("'+t.descr+'")')},"addNode"),W={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Xt=S((A,w)=>{switch(z.debug("In get type",A,w),A){case"[":return W.RECT;case"(":return w===")"?W.ROUNDED_RECT:W.CLOUD;case"((":return W.CIRCLE;case")":return W.CLOUD;case"))":return W.BANG;case"{{":return W.HEXAGON;default:return W.DEFAULT}},"getType"),kt=S((A,w)=>{lt[A]=w},"setElementForId"),Ht=S(A=>{if(!A)return;const w=ot(),u=Z[Z.length-1];A.icon&&(u.icon=rt(A.icon,w)),A.class&&(u.class=rt(A.class,w))},"decorateNode"),$t=S(A=>{switch(A){case W.DEFAULT:return"no-border";case W.RECT:return"rect";case W.ROUNDED_RECT:return"rounded-rect";case W.CIRCLE:return"circle";case W.CLOUD:return"cloud";case W.BANG:return"bang";case W.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Wt=S(()=>z,"getLogger"),Bt=S(A=>lt[A],"getElementById"),Vt={clear:bt,addNode:Yt,getMindmap:Pt,nodeType:W,getType:Xt,setElementForId:kt,decorateNode:Ht,type2Str:$t,getLogger:Wt,getElementById:Bt},Zt=Vt,Qt=12,jt=S(function(A,w,u,m){w.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+A.type2Str(u.type)).attr("d",`M0 ${u.height-5} v${-u.height+2*5} q0,-5 5,-5 h${u.width-2*5} q5,0 5,5 v${u.height-5} H0 Z`),w.append("line").attr("class","node-line-"+m).attr("x1",0).attr("y1",u.height).attr("x2",u.width).attr("y2",u.height)},"defaultBkg"),zt=S(function(A,w,u){w.append("rect").attr("id","node-"+u.id).attr("class","node-bkg node-"+A.type2Str(u.type)).attr("height",u.height).attr("width",u.width)},"rectBkg"),Kt=S(function(A,w,u){const m=u.width,v=u.height,r=.15*m,t=.25*m,e=.35*m,i=.2*m;w.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+A.type2Str(u.type)).attr("d",`M0 0 a${r},${r} 0 0,1 ${m*.25},${-1*m*.1} a${e},${e} 1 0,1 ${m*.4},${-1*m*.1} a${t},${t} 1 0,1 ${m*.35},${1*m*.2} a${r},${r} 1 0,1 ${m*.15},${1*v*.35} a${i},${i} 1 0,1 ${-1*m*.15},${1*v*.65} a${t},${r} 1 0,1 ${-1*m*.25},${m*.15} a${e},${e} 1 0,1 ${-1*m*.5},0 a${r},${r} 1 0,1 ${-1*m*.25},${-1*m*.15} a${r},${r} 1 0,1 ${-1*m*.1},${-1*v*.35} a${i},${i} 1 0,1 ${m*.1},${-1*v*.65} H0 V0 Z`)},"cloudBkg"),Jt=S(function(A,w,u){const m=u.width,v=u.height,r=.15*m;w.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+A.type2Str(u.type)).attr("d",`M0 0 a${r},${r} 1 0,0 ${m*.25},${-1*v*.1} a${r},${r} 1 0,0 ${m*.25},0 a${r},${r} 1 0,0 ${m*.25},0 a${r},${r} 1 0,0 ${m*.25},${1*v*.1} a${r},${r} 1 0,0 ${m*.15},${1*v*.33} a${r*.8},${r*.8} 1 0,0 0,${1*v*.34} a${r},${r} 1 0,0 ${-1*m*.15},${1*v*.33} a${r},${r} 1 0,0 ${-1*m*.25},${v*.15} a${r},${r} 1 0,0 ${-1*m*.25},0 a${r},${r} 1 0,0 ${-1*m*.25},0 a${r},${r} 1 0,0 ${-1*m*.25},${-1*v*.15} a${r},${r} 1 0,0 ${-1*m*.1},${-1*v*.33} a${r*.8},${r*.8} 1 0,0 0,${-1*v*.34} a${r},${r} 1 0,0 ${m*.1},${-1*v*.33} H0 V0 Z`)},"bangBkg"),qt=S(function(A,w,u){w.append("circle").attr("id","node-"+u.id).attr("class","node-bkg node-"+A.type2Str(u.type)).attr("r",u.width/2)},"circleBkg");function Et(A,w,u,m,v){return A.insert("polygon",":first-child").attr("points",m.map(function(r){return r.x+","+r.y}).join(" ")).attr("transform","translate("+(v.width-w)/2+", "+u+")")}S(Et,"insertPolygonShape");var te=S(function(A,w,u){const m=u.height,r=m/4,t=u.width-u.padding+2*r,e=[{x:r,y:0},{x:t-r,y:0},{x:t,y:-m/2},{x:t-r,y:-m},{x:r,y:-m},{x:0,y:-m/2}];Et(w,t,m,e,u)},"hexagonBkg"),ee=S(function(A,w,u){w.append("rect").attr("id","node-"+u.id).attr("class","node-bkg node-"+A.type2Str(u.type)).attr("height",u.height).attr("rx",u.padding).attr("ry",u.padding).attr("width",u.width)},"roundedRectBkg"),re=S(function(A,w,u,m,v){return tt(this,null,function*(){const r=v.htmlLabels,t=m%(Qt-1),e=w.append("g");u.section=t;let i="section-"+t;t<0&&(i+=" section-root"),e.attr("class",(u.class?u.class+" ":"")+"mindmap-node "+i);const o=e.append("g"),g=e.append("g"),a=u.descr.replace(/()/g,` `);yield mt(g,a,{useHtmlLabels:r,width:u.width,classes:"mindmap-node-label"},v),r||g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const y=g.node().getBBox(),[n]=Ot(v.fontSize);if(u.height=y.height+n*1.1*.5+u.padding,u.width=y.width+2*u.padding,u.icon)if(u.type===A.nodeType.CIRCLE)u.height+=50,u.width+=50,e.append("foreignObject").attr("height","50px").attr("width",u.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+t+" "+u.icon),g.attr("transform","translate("+u.width/2+", "+(u.height/2-1.5*u.padding)+")");else{u.width+=50;const h=u.height;u.height=Math.max(h,60);const c=Math.abs(u.height-h);e.append("foreignObject").attr("width","60px").attr("height",u.height).attr("style","text-align: center;margin-top:"+c/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+t+" "+u.icon),g.attr("transform","translate("+(25+u.width/2)+", "+(c/2+u.padding/2)+")")}else if(r){const h=(u.width-y.width)/2,c=(u.height-y.height)/2;g.attr("transform","translate("+h+", "+c+")")}else{const h=u.width/2,c=u.padding/2;g.attr("transform","translate("+h+", "+c+")")}switch(u.type){case A.nodeType.DEFAULT:jt(A,o,u,t);break;case A.nodeType.ROUNDED_RECT:ee(A,o,u,t);break;case A.nodeType.RECT:zt(A,o,u,t);break;case A.nodeType.CIRCLE:o.attr("transform","translate("+u.width/2+", "+ +u.height/2+")"),qt(A,o,u,t);break;case A.nodeType.CLOUD:Kt(A,o,u,t);break;case A.nodeType.BANG:Jt(A,o,u,t);break;case A.nodeType.HEXAGON:te(A,o,u,t);break}return A.setElementForId(u.id,e),u.height})},"drawNode"),ie=S(function(A,w){const u=A.getElementById(w.id),m=w.x||0,v=w.y||0;u.attr("transform","translate("+m+","+v+")")},"positionNode");dt.use(_t);function ct(A,w,u,m,v){return tt(this,null,function*(){yield re(A,w,u,m,v),u.children&&(yield Promise.all(u.children.map((r,t)=>ct(A,w,r,m<0?t:m,v))))})}S(ct,"drawNodes");function Lt(A,w){w.edges().map((u,m)=>{const v=u.data();if(u[0]._private.bodyBounds){const r=u[0]._private.rscratch;z.trace("Edge: ",m,v),A.insert("path").attr("d",`M ${r.startX},${r.startY} L ${r.midX},${r.midY} L${r.endX},${r.endY} `).attr("class","edge section-edge-"+v.section+" edge-depth-"+v.depth)}})}S(Lt,"drawEdges");function gt(A,w,u,m){w.add({group:"nodes",data:{id:A.id.toString(),labelText:A.descr,height:A.height,width:A.width,level:m,nodeId:A.id,padding:A.padding,type:A.type},position:{x:A.x,y:A.y}}),A.children&&A.children.forEach(v=>{gt(v,w,u,m+1),w.add({group:"edges",data:{id:`${A.id}_${v.id}`,source:A.id,target:v.id,depth:m,section:v.section}})})}S(gt,"addNodes");function Tt(A,w){return new Promise(u=>{const m=Dt("body").append("div").attr("id","cy").attr("style","display:none"),v=dt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),gt(A,v,w,0),v.nodes().forEach(function(r){r.layoutDimensions=()=>{const t=r.data();return{w:t.width,h:t.height}}}),v.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),v.ready(r=>{z.info("Ready",r),u(v)})})}S(Tt,"layoutMindmap");function Nt(A,w){w.nodes().map((u,m)=>{const v=u.data();v.x=u.position().x,v.y=u.position().y,ie(A,v);const r=A.getElementById(v.nodeId);z.info("Id:",m,"Position: (",u.position().x,", ",u.position().y,")",v),r.attr("transform",`translate(${u.position().x-v.width/2}, ${u.position().y-v.height/2})`),r.attr("attr",`apa-${m})`)})}S(Nt,"positionNodes");var ne=S((A,w,u,m)=>tt(void 0,null,function*(){var a,y,n,h;z.debug(`Rendering mindmap diagram `+A);const v=m.db,r=v.getMindmap();if(!r)return;const t=ot();t.htmlLabels=!1;const e=At(w),i=e.append("g");i.attr("class","mindmap-edges");const o=e.append("g");o.attr("class","mindmap-nodes"),yield ct(v,o,r,-1,t);const g=yield Tt(r,t);Lt(i,g),Nt(v,g),It(void 0,e,(y=(a=t.mindmap)==null?void 0:a.padding)!=null?y:et.mindmap.padding,(h=(n=t.mindmap)==null?void 0:n.useMaxWidth)!=null?h:et.mindmap.useMaxWidth)}),"draw"),se={draw:ne},ae=S(A=>{let w="";for(let u=0;u` .edge { stroke-width: 3; } ${ae(A)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${A.git0}; } .section-root text { fill: ${A.gitBranchLabel0}; } .icon-container { height:100%; display: flex; justify-content: center; align-items: center; } .edge { fill: none; } .mindmap-node-label { dy: 1em; alignment-baseline: middle; text-anchor: middle; dominant-baseline: middle; text-align: center; } `,"getStyles"),he=oe,pe={db:Zt,renderer:se,parser:Ft,styles:he};export{pe as diagram};