import{aK as at,aL as Nt,_ as S,l as z,j as Dt,U as mt,L as Ot,d as ot,E as At,O as It,z as tt,i as et,$ as Ct,a0 as Rt,a1 as xt}from"./index-BPLBgC-p.js";import{c as pt}from"./cytoscape.esm-D4GKE1yY.js";var dt={exports:{}},it={exports:{}},nt={exports:{}},ut;function Mt(){return ut||(ut=1,function(I,w){(function(m,y){I.exports=y()})(at,function(){return function(f){var m={};function y(r){if(m[r])return m[r].exports;var t=m[r]={i:r,l:!1,exports:{}};return f[r].call(t.exports,t,t.exports,y),t.l=!0,t.exports}return y.m=f,y.c=m,y.i=function(r){return r},y.d=function(r,t,e){y.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:e})},y.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return y.d(t,"a",t),t},y.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},y.p="",y(y.s=26)}([function(f,m,y){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,f.exports=r},function(f,m,y){var r=y(2),t=y(8),e=y(9);function i(g,a,v){r.call(this,v),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=v,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 v=this.getOtherEnd(g),n=a.getGraphManager().getRoot();;){if(v.getOwner()==a)return v;if(v.getOwner()==n)break;v=v.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)},f.exports=i},function(f,m,y){function r(t){this.vGraphObject=t}f.exports=r},function(f,m,y){var r=y(2),t=y(10),e=y(13),i=y(0),o=y(16),g=y(4);function a(n,c,l,E){l==null&&E==null&&(E=c),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,l!=null&&c!=null?this.rect=new e(c.x,c.y,l.width,l.height):this.rect=new e}a.prototype=Object.create(r.prototype);for(var v in r)a[v]=r[v];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,c){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=c.width,this.rect.height=c.height},a.prototype.setCenter=function(n,c){this.rect.x=n-this.rect.width/2,this.rect.y=c-this.rect.height/2},a.prototype.setLocation=function(n,c){this.rect.x=n,this.rect.y=c},a.prototype.moveBy=function(n,c){this.rect.x+=n,this.rect.y+=c},a.prototype.getEdgeListToNode=function(n){var c=[],l=this;return l.edges.forEach(function(E){if(E.target==n){if(E.source!=l)throw"Incorrect edge source!";c.push(E)}}),c},a.prototype.getEdgesBetween=function(n){var c=[],l=this;return l.edges.forEach(function(E){if(!(E.source==l||E.target==l))throw"Incorrect edge source and/or target";(E.target==n||E.source==n)&&c.push(E)}),c},a.prototype.getNeighborsList=function(){var n=new Set,c=this;return c.edges.forEach(function(l){if(l.source==c)n.add(l.target);else{if(l.target!=c)throw"Incorrect incidency!";n.add(l.source)}}),n},a.prototype.withChildren=function(){var n=new Set,c,l;if(n.add(this),this.child!=null)for(var E=this.child.getNodes(),T=0;Tc&&(this.rect.x-=(this.labelWidth-c)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),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 c=this.rect.x;c>i.WORLD_BOUNDARY?c=i.WORLD_BOUNDARY:c<-i.WORLD_BOUNDARY&&(c=-i.WORLD_BOUNDARY);var l=this.rect.y;l>i.WORLD_BOUNDARY?l=i.WORLD_BOUNDARY:l<-i.WORLD_BOUNDARY&&(l=-i.WORLD_BOUNDARY);var E=new g(c,l),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()},f.exports=a},function(f,m,y){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},f.exports=r},function(f,m,y){var r=y(2),t=y(10),e=y(0),i=y(6),o=y(3),g=y(1),a=y(13),v=y(12),n=y(11);function c(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)}c.prototype=Object.create(r.prototype);for(var l in r)c[l]=r[l];c.prototype.getNodes=function(){return this.nodes},c.prototype.getEdges=function(){return this.edges},c.prototype.getGraphManager=function(){return this.graphManager},c.prototype.getParent=function(){return this.parent},c.prototype.getLeft=function(){return this.left},c.prototype.getRight=function(){return this.right},c.prototype.getTop=function(){return this.top},c.prototype.getBottom=function(){return this.bottom},c.prototype.isConnected=function(){return this.isConnected},c.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)}},c.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&&h>-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(h,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)}},c.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 v(this.left,this.top))},c.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,h,u,p=this.nodes,A=p.length,C=0;Cd&&(T=d),Ds&&(L=s),Od&&(T=d),Ds&&(L=s),O=this.nodes.length){var A=0;D.forEach(function(C){C.owner==E&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},f.exports=c},function(f,m,y){var r,t=y(1);function e(i){r=y(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,v){if(g==null&&a==null&&v==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{v=g,a=o,g=i;var n=a.getOwner(),c=v.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(c!=null&&c.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==c)return g.isInterGraph=!1,n.add(g,a,v);if(g.isInterGraph=!0,g.source=a,g.target=v,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,v=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 v=Math.abs((i.getCenterY()-e.getCenterY())/(i.getCenterX()-e.getCenterX()));i.getCenterY()===e.getCenterY()&&i.getCenterX()===e.getCenterX()&&(v=1);var n=v*o[0],c=o[1]/v;o[0]n)return o[0]=g,o[1]=l,o[2]=v,o[3]=p,!1;if(av)return o[0]=c,o[1]=a,o[2]=h,o[3]=n,!1;if(gv?(o[0]=T,o[1]=D,x=!0):(o[0]=E,o[1]=l,x=!0):U===M&&(g>v?(o[0]=c,o[1]=l,x=!0):(o[0]=L,o[1]=D,x=!0)),-X===M?v>g?(o[2]=u,o[3]=p,_=!0):(o[2]=h,o[3]=s,_=!0):X===M&&(v>g?(o[2]=N,o[3]=s,_=!0):(o[2]=A,o[3]=p,_=!0)),x&&_)return!1;if(g>v?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=l,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=v+-R/M,o[2]=k,o[3]=H;break;case 2:k=A,H=n+C*M,o[2]=k,o[3]=H;break;case 3:H=p,k=v+R/M,o[2]=k,o[3]=H;break;case 4:k=u,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,v=e.y,n=i.x,c=i.y,l=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,h=void 0,u=void 0,p=void 0,A=void 0;return d=c-v,s=a-n,u=n*v-a*c,N=D-E,h=l-T,p=T*E-l*D,A=d*h-N*s,A===0?null:(L=(s*p-h*u)/A,O=(N*u-d*p)/A,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)},f.exports=r},function(f,m,y){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,f.exports=r},function(f,m,y){var r=function(){function a(v,n){for(var c=0;c"u"?"undefined":r(e);return e==null||i!="object"&&i!="function"},f.exports=t},function(f,m,y){function r(l){if(Array.isArray(l)){for(var E=0,T=Array(l.length);E0&&E;){for(d.push(s[0]);d.length>0&&E;){var h=d[0];d.splice(0,1),O.add(h);for(var u=h.getEdges(),L=0;L-1&&s.splice(R,1)}O=new Set,N=new Map}}return l},c.prototype.createDummyNodesForBendpoints=function(l){for(var E=[],T=l.source,D=this.graphManager.calcLowestCommonAncestor(l.source,l.target),L=0;L0){for(var D=this.edgeToDummyNodes.get(T),L=0;L=0&&E.splice(p,1);var A=N.getNeighborsList();A.forEach(function(x){if(T.indexOf(x)<0){var _=D.get(x),U=_-1;U==1&&h.push(x),D.set(x,U)}})}T=T.concat(h),(E.length==1||E.length==2)&&(L=!0,O=E[0])}return O},c.prototype.setGraphManager=function(l){this.graphManager=l},f.exports=c},function(f,m,y){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)},f.exports=r},function(f,m,y){var r=y(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},f.exports=t},function(f,m,y){function r(n){if(Array.isArray(n)){for(var c=0,l=Array(n.length);ce.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(),c,l=0;l0&&arguments[0]!==void 0?arguments[0]:!0,c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,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,l=0;ld||O>d)&&(n.gravitationForceX=-this.gravityConstant*T,n.gravitationForceY=-this.gravityConstant*D)):(d=c.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,c=!1;return this.totalIterations>this.maxIterations/3&&(c=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement=L.length||d>=L[0].length)){for(var N=0;Na}}]),o}();f.exports=i},function(f,m,y){var r=function(){function i(o,g){for(var a=0;a2&&arguments[2]!==void 0?arguments[2]:1,v=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=v,this.gap_penalty=n,this.iMax=o.length+1,this.jMax=g.length+1,this.grid=new Array(this.iMax);for(var c=0;c=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 v=this.getChild().getNodes(),n,c=0;c0)this.positionNodesRadially(s);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var h=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(p){return h.has(p)});this.graphManager.setAllNodesToApplyGravitation(u),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%v.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()),h=this.nodesWithGravity.filter(function(A){return s.has(A)});this.graphManager.setAllNodesToApplyGravitation(h),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=v.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=v.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var u=!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(u,p),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},d.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),h={},u=0;u1){var x;for(x=0;xp&&(p=Math.floor(R.y)),C=Math.floor(R.x+a.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-R.x/2,n.WORLD_CENTER_Y-R.y/2))},d.radialLayout=function(s,h,u){var p=Math.max(this.maxDiagonalInTree(s),a.DEFAULT_RADIAL_SEPARATION);d.branchRadialLayout(h,null,0,359,0,p);var A=L.calculateBounds(s),C=new O;C.setDeviceOrgX(A.getMinX()),C.setDeviceOrgY(A.getMinY()),C.setWorldOrgX(u.x),C.setWorldOrgY(u.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--}h!=null?Y=(M.indexOf(k[0])+1)%b:Y=0;for(var B=Math.abs(p-u)/G,$=Y;F!=G;$=++$%b){var K=M[$].getOtherEnd(s);if(K!=h){var Q=(u+F*B)%360,J=(Q+B)%360;d.branchRadialLayout(K,s,Q,J,A+C,C),F++}}},d.maxDiagonalInTree=function(s){for(var h=T.MIN_VALUE,u=0;uh&&(h=A)}return h},d.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},d.prototype.groupZeroDegreeMembers=function(){var s=this,h={};this.memberGroups={},this.idToDummyNode={};for(var u=[],p=this.graphManager.getAllNodes(),A=0;A"u"&&(h[x]=[]),h[x]=h[x].concat(C)}Object.keys(h).forEach(function(_){if(h[_].length>1){var U="DummyCompound_"+_;s.memberGroups[U]=h[_];var X=h[_][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 h=this.compoundOrder[s],u=h.id,p=h.paddingLeft,A=h.paddingTop;this.adjustLocations(this.tiledMemberPack[u],h.rect.x,h.rect.y,p,A)}},d.prototype.repopulateZeroDegreeMembers=function(){var s=this,h=this.tiledZeroDegreePack;Object.keys(h).forEach(function(u){var p=s.idToDummyNode[u],A=p.paddingLeft,C=p.paddingTop;s.adjustLocations(h[u],p.rect.x,p.rect.y,A,C)})},d.prototype.getToBeTiled=function(s){var h=s.id;if(this.toBeTiled[h]!=null)return this.toBeTiled[h];var u=s.getChild();if(u==null)return this.toBeTiled[h]=!1,!1;for(var p=u.getNodes(),A=0;A0)return this.toBeTiled[h]=!1,!1;if(C.getChild()==null){this.toBeTiled[C.id]=!1;continue}if(!this.getToBeTiled(C))return this.toBeTiled[h]=!1,!1}return this.toBeTiled[h]=!0,!0},d.prototype.getNodeDegree=function(s){s.id;for(var h=s.getEdges(),u=0,p=0;p_&&(_=X.rect.height)}u+=_+s.verticalPadding}},d.prototype.tileCompoundMembers=function(s,h){var u=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(p){var A=h[p];u.tiledMemberPack[p]=u.tileNodes(s[p],A.paddingLeft+A.paddingRight),A.rect.width=u.tiledMemberPack[p].width,A.rect.height=u.tiledMemberPack[p].height})},d.prototype.tileNodes=function(s,h){var u=a.TILING_PADDING_VERTICAL,p=a.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:h,verticalPadding:u,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[u]=R,s.width0&&(x+=s.verticalPadding);var _=0;x>s.rowHeight[u]&&(_=s.rowHeight[u],s.rowHeight[u]=x,_=s.rowHeight[u]-_),s.height+=_,s.rows[u].push(h)},d.prototype.getShortestRowIndex=function(s){for(var h=-1,u=Number.MAX_VALUE,p=0;pu&&(h=p,u=s.rowWidth[p]);return h},d.prototype.canAddHorizontal=function(s,h,u){var p=this.getShortestRowIndex(s);if(p<0)return!0;var A=s.rowWidth[p];if(A+s.horizontalPadding+h<=s.width)return!0;var C=0;s.rowHeight[p]0&&(C=u+s.verticalPadding-s.rowHeight[p]);var R;s.width-A>=h+s.horizontalPadding?R=(s.height+C)/(A+h+s.horizontalPadding):R=(s.height+C)/s.width,C=u+s.verticalPadding;var x;return s.widthC&&h!=u){p.splice(-1,1),s.rows[u].push(A),s.rowWidth[h]=s.rowWidth[h]-C,s.rowWidth[u]=s.rowWidth[u]+C,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var R=Number.MIN_VALUE,x=0;xR&&(R=p[x].height);h>0&&(R+=s.verticalPadding);var _=s.rowHeight[h]+s.rowHeight[u];s.rowHeight[h]=R,s.rowHeight[u]0)for(var F=A;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[A-1][F].length+this.grid[A][F].length-1;for(var b=T.MAX_VALUE,Y,k,H=0;H0){var x;x=O.getGraphManager().add(O.newGraph(),u),this.processChildrenList(x,h,O)}}},l.prototype.stop=function(){return this.stopped=!0,this};var T=function(L){L("layout","cose-bilkent",l)};typeof cytoscape<"u"&&T(cytoscape),m.exports=T}])})})(dt);var St=dt.exports;const Gt=Nt(St);var st=function(){var I=S(function(O,d,N,s){for(N=N||{},s=O.length;s--;N[O[s]]=d);return N},"o"),w=[1,4],f=[1,13],m=[1,12],y=[1,15],r=[1,16],t=[1,20],e=[1,19],i=[6,7,8],o=[1,26],g=[1,24],a=[1,25],v=[6,7,11],n=[1,6,13,15,16,19,22],c=[1,33],l=[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,h,u,p,A){var C=p.length-1;switch(u){case 6:case 7:return h;case 8:h.getLogger().trace("Stop NL ");break;case 9:h.getLogger().trace("Stop EOF ");break;case 11:h.getLogger().trace("Stop NL2 ");break;case 12:h.getLogger().trace("Stop EOF2 ");break;case 15:h.getLogger().info("Node: ",p[C].id),h.addNode(p[C-1].length,p[C].id,p[C].descr,p[C].type);break;case 16:h.getLogger().trace("Icon: ",p[C]),h.decorateNode({icon:p[C]});break;case 17:case 21:h.decorateNode({class:p[C]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",p[C].id),h.addNode(0,p[C].id,p[C].descr,p[C].type);break;case 20:h.decorateNode({icon:p[C]});break;case 25:h.getLogger().trace("node found ..",p[C-2]),this.$={id:p[C-1],descr:p[C-1],type:h.getType(p[C-2],p[C])};break;case 26:this.$={id:p[C],descr:p[C],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",p[C-3]),this.$={id:p[C-3],descr:p[C-1],type:h.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:f,7:[1,10],9:9,12:11,13:m,14:14,15:y,16:r,17:17,18:18,19:t,22:e},I(i,[2,3]),{1:[2,2]},I(i,[2,4]),I(i,[2,5]),{1:[2,6],6:f,12:21,13:m,14:14,15:y,16:r,17:17,18:18,19:t,22:e},{6:f,9:22,12:11,13:m,14:14,15:y,16:r,17:17,18:18,19:t,22:e},{6:o,7:g,10:23,11:a},I(v,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:t,22:e}),I(v,[2,18]),I(v,[2,19]),I(v,[2,20]),I(v,[2,21]),I(v,[2,23]),I(v,[2,24]),I(v,[2,26],{19:[1,30]}),{20:[1,31]},{6:o,7:g,10:32,11:a},{1:[2,7],6:f,12:21,13:m,14:14,15:y,16:r,17:17,18:18,19:t,22:e},I(n,[2,14],{7:c,11:l}),I(E,[2,8]),I(E,[2,9]),I(E,[2,10]),I(v,[2,15]),I(v,[2,16]),I(v,[2,17]),{20:[1,35]},{21:[1,36]},I(n,[2,13],{7:c,11:l}),I(E,[2,11]),I(E,[2,12]),{21:[1,37]},I(v,[2,25]),I(v,[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],h=[],u=[null],p=[],A=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>"u"&&(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,u.length=u.length-V,p.length=p.length-V}S(k,"popStack");function H(){var V;return V=h.pop()||M.lex()||U,typeof V!="number"&&(V instanceof Array&&(h=V,V=h.pop()),V=N.symbols_[V]||V),V}S(H,"lex");for(var P,B,$,K,Q={},J,j,gt,q;;){if(B=s[s.length-1],this.defaultActions[B]?$=this.defaultActions[B]:((P===null||typeof P>"u")&&(P=H()),$=A[B]&&A[B][P]),typeof $>"u"||!$.length||!$[0]){var rt="";q=[];for(J in A[B])this.terminals_[J]&&J>_&&q.push("'"+this.terminals_[J]+"'");M.showPosition?rt="Parse error on line "+(R+1)+`: `+M.showPosition()+` Expecting `+q.join(", ")+", got '"+(this.terminals_[P]||P)+"'":rt="Parse error on line "+(R+1)+": Unexpected "+(P==U?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(rt,{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),u.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.$=u[u.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],u,p].concat(X)),typeof K<"u")return K;j&&(s=s.slice(0,-1*j*2),u=u.slice(0,-1*j),p=p.slice(0,-1*j)),s.push(this.productions_[$[1]][0]),u.push(Q.$),p.push(Q._$),gt=A[s[s.length-2]][s[s.length-1]],s.push(gt);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 h=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 u=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===h.length?this.yylloc.first_column:0)+h[h.length-s.length].length-s[0].length:this.yylloc.first_column-N},this.options.ranges&&(this.yylloc.range=[u[0],u[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,h,u;if(this.options.backtrack_lexer&&(u={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&&(u.yylloc.range=this.yylloc.range.slice(0))),h=d[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.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 u)this[p]=u[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,h;this._more||(this.yytext="",this.match="");for(var u=this._currentRules(),p=0;pN[0].length)){if(N=s,h=p,this.options.backtrack_lexer){if(d=this.test_match(s,u[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,u[h]),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,h,u){switch(h){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}();st.parser=st;var _t=st,Z=[],vt=0,ht={},Ft=S(()=>{Z=[],vt=0,ht={}},"clear"),bt=S(function(I){for(let w=Z.length-1;w>=0;w--)if(Z[w].levelZ.length>0?Z[0]:null,"getMindmap"),Pt=S((I,w,f,m)=>{var i,o;z.info("addNode",I,w,f,m);const y=ot();let r=((i=y.mindmap)==null?void 0:i.padding)??tt.mindmap.padding;switch(m){case W.ROUNDED_RECT:case W.RECT:case W.HEXAGON:r*=2}const t={id:vt++,nodeId:et(w,y),level:I,descr:et(f,y),type:m,children:[],width:((o=y.mindmap)==null?void 0:o.maxNodeWidth)??tt.mindmap.maxNodeWidth,padding:r},e=bt(I);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},Yt=S((I,w)=>{switch(z.debug("In get type",I,w),I){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"),Xt=S((I,w)=>{ht[I]=w},"setElementForId"),kt=S(I=>{if(!I)return;const w=ot(),f=Z[Z.length-1];I.icon&&(f.icon=et(I.icon,w)),I.class&&(f.class=et(I.class,w))},"decorateNode"),Ht=S(I=>{switch(I){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"),$t=S(()=>z,"getLogger"),Wt=S(I=>ht[I],"getElementById"),Bt={clear:Ft,addNode:Pt,getMindmap:Ut,nodeType:W,getType:Yt,setElementForId:Xt,decorateNode:kt,type2Str:Ht,getLogger:$t,getElementById:Wt},Vt=Bt,Zt=12,Qt=S(function(I,w,f,m){w.append("path").attr("id","node-"+f.id).attr("class","node-bkg node-"+I.type2Str(f.type)).attr("d",`M0 ${f.height-5} v${-f.height+2*5} q0,-5 5,-5 h${f.width-2*5} q5,0 5,5 v${f.height-5} H0 Z`),w.append("line").attr("class","node-line-"+m).attr("x1",0).attr("y1",f.height).attr("x2",f.width).attr("y2",f.height)},"defaultBkg"),jt=S(function(I,w,f){w.append("rect").attr("id","node-"+f.id).attr("class","node-bkg node-"+I.type2Str(f.type)).attr("height",f.height).attr("width",f.width)},"rectBkg"),zt=S(function(I,w,f){const m=f.width,y=f.height,r=.15*m,t=.25*m,e=.35*m,i=.2*m;w.append("path").attr("id","node-"+f.id).attr("class","node-bkg node-"+I.type2Str(f.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*y*.35} a${i},${i} 1 0,1 ${-1*m*.15},${1*y*.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*y*.35} a${i},${i} 1 0,1 ${m*.1},${-1*y*.65} H0 V0 Z`)},"cloudBkg"),Kt=S(function(I,w,f){const m=f.width,y=f.height,r=.15*m;w.append("path").attr("id","node-"+f.id).attr("class","node-bkg node-"+I.type2Str(f.type)).attr("d",`M0 0 a${r},${r} 1 0,0 ${m*.25},${-1*y*.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*y*.1} a${r},${r} 1 0,0 ${m*.15},${1*y*.33} a${r*.8},${r*.8} 1 0,0 0,${1*y*.34} a${r},${r} 1 0,0 ${-1*m*.15},${1*y*.33} a${r},${r} 1 0,0 ${-1*m*.25},${y*.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*y*.15} a${r},${r} 1 0,0 ${-1*m*.1},${-1*y*.33} a${r*.8},${r*.8} 1 0,0 0,${-1*y*.34} a${r},${r} 1 0,0 ${m*.1},${-1*y*.33} H0 V0 Z`)},"bangBkg"),Jt=S(function(I,w,f){w.append("circle").attr("id","node-"+f.id).attr("class","node-bkg node-"+I.type2Str(f.type)).attr("r",f.width/2)},"circleBkg");function yt(I,w,f,m,y){return I.insert("polygon",":first-child").attr("points",m.map(function(r){return r.x+","+r.y}).join(" ")).attr("transform","translate("+(y.width-w)/2+", "+f+")")}S(yt,"insertPolygonShape");var qt=S(function(I,w,f){const m=f.height,r=m/4,t=f.width-f.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}];yt(w,t,m,e,f)},"hexagonBkg"),te=S(function(I,w,f){w.append("rect").attr("id","node-"+f.id).attr("class","node-bkg node-"+I.type2Str(f.type)).attr("height",f.height).attr("rx",f.padding).attr("ry",f.padding).attr("width",f.width)},"roundedRectBkg"),ee=S(async function(I,w,f,m,y){const r=y.htmlLabels,t=m%(Zt-1),e=w.append("g");f.section=t;let i="section-"+t;t<0&&(i+=" section-root"),e.attr("class",(f.class?f.class+" ":"")+"mindmap-node "+i);const o=e.append("g"),g=e.append("g"),a=f.descr.replace(/()/g,` `);await mt(g,a,{useHtmlLabels:r,width:f.width,classes:"mindmap-node-label"},y),r||g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");const v=g.node().getBBox(),[n]=Ot(y.fontSize);if(f.height=v.height+n*1.1*.5+f.padding,f.width=v.width+2*f.padding,f.icon)if(f.type===I.nodeType.CIRCLE)f.height+=50,f.width+=50,e.append("foreignObject").attr("height","50px").attr("width",f.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+t+" "+f.icon),g.attr("transform","translate("+f.width/2+", "+(f.height/2-1.5*f.padding)+")");else{f.width+=50;const c=f.height;f.height=Math.max(c,60);const l=Math.abs(f.height-c);e.append("foreignObject").attr("width","60px").attr("height",f.height).attr("style","text-align: center;margin-top:"+l/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+t+" "+f.icon),g.attr("transform","translate("+(25+f.width/2)+", "+(l/2+f.padding/2)+")")}else if(r){const c=(f.width-v.width)/2,l=(f.height-v.height)/2;g.attr("transform","translate("+c+", "+l+")")}else{const c=f.width/2,l=f.padding/2;g.attr("transform","translate("+c+", "+l+")")}switch(f.type){case I.nodeType.DEFAULT:Qt(I,o,f,t);break;case I.nodeType.ROUNDED_RECT:te(I,o,f,t);break;case I.nodeType.RECT:jt(I,o,f,t);break;case I.nodeType.CIRCLE:o.attr("transform","translate("+f.width/2+", "+ +f.height/2+")"),Jt(I,o,f,t);break;case I.nodeType.CLOUD:zt(I,o,f,t);break;case I.nodeType.BANG:Kt(I,o,f,t);break;case I.nodeType.HEXAGON:qt(I,o,f,t);break}return I.setElementForId(f.id,e),f.height},"drawNode"),re=S(function(I,w){const f=I.getElementById(w.id),m=w.x||0,y=w.y||0;f.attr("transform","translate("+m+","+y+")")},"positionNode");pt.use(Gt);async function lt(I,w,f,m,y){await ee(I,w,f,m,y),f.children&&await Promise.all(f.children.map((r,t)=>lt(I,w,r,m<0?t:m,y)))}S(lt,"drawNodes");function Et(I,w){w.edges().map((f,m)=>{const y=f.data();if(f[0]._private.bodyBounds){const r=f[0]._private.rscratch;z.trace("Edge: ",m,y),I.insert("path").attr("d",`M ${r.startX},${r.startY} L ${r.midX},${r.midY} L${r.endX},${r.endY} `).attr("class","edge section-edge-"+y.section+" edge-depth-"+y.depth)}})}S(Et,"drawEdges");function ct(I,w,f,m){w.add({group:"nodes",data:{id:I.id.toString(),labelText:I.descr,height:I.height,width:I.width,level:m,nodeId:I.id,padding:I.padding,type:I.type},position:{x:I.x,y:I.y}}),I.children&&I.children.forEach(y=>{ct(y,w,f,m+1),w.add({group:"edges",data:{id:`${I.id}_${y.id}`,source:I.id,target:y.id,depth:m,section:y.section}})})}S(ct,"addNodes");function Lt(I,w){return new Promise(f=>{const m=Dt("body").append("div").attr("id","cy").attr("style","display:none"),y=pt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),ct(I,y,w,0),y.nodes().forEach(function(r){r.layoutDimensions=()=>{const t=r.data();return{w:t.width,h:t.height}}}),y.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),y.ready(r=>{z.info("Ready",r),f(y)})})}S(Lt,"layoutMindmap");function Tt(I,w){w.nodes().map((f,m)=>{const y=f.data();y.x=f.position().x,y.y=f.position().y,re(I,y);const r=I.getElementById(y.nodeId);z.info("Id:",m,"Position: (",f.position().x,", ",f.position().y,")",y),r.attr("transform",`translate(${f.position().x-y.width/2}, ${f.position().y-y.height/2})`),r.attr("attr",`apa-${m})`)})}S(Tt,"positionNodes");var ie=S(async(I,w,f,m)=>{var a,v;z.debug(`Rendering mindmap diagram `+I);const y=m.db,r=y.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"),await lt(y,o,r,-1,t);const g=await Lt(r,t);Et(i,g),Tt(y,g),It(void 0,e,((a=t.mindmap)==null?void 0:a.padding)??tt.mindmap.padding,((v=t.mindmap)==null?void 0:v.useMaxWidth)??tt.mindmap.useMaxWidth)},"draw"),ne={draw:ie},se=S(I=>{let w="";for(let f=0;f` .edge { stroke-width: 3; } ${se(I)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${I.git0}; } .section-root text { fill: ${I.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"),oe=ae,ce={db:Vt,renderer:ne,parser:_t,styles:oe};export{ce as diagram};