import{_,l as Q,c as st,K as Et,a3 as Lt,H as it,i as J,a4 as Tt,a5 as Nt,a6 as mt,d as Dt,ad as Ot,M as At}from"./mermaid-vendor-DB77lfsV.js";import{c as ft}from"./cytoscape.esm-CfBqOv7Q.js";import{g as It}from"./react-vendor-DEwriMA6.js";import"./feature-graph-c3KAmzq6.js";import"./graph-vendor-B-X5JegA.js";import"./ui-vendor-CeCm8EER.js";import"./utils-vendor-BysuhMZA.js";var tt={exports:{}},et={exports:{}},rt={exports:{}},Ct=rt.exports,ct;function Rt(){return ct||(ct=1,function(C,M){(function(D,y){C.exports=y()})(Ct,function(){return function(u){var D={};function y(r){if(D[r])return D[r].exports;var t=D[r]={i:r,l:!1,exports:{}};return u[r].call(t.exports,t,t.exports,y),t.l=!0,t.exports}return y.m=u,y.c=D,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(u,D,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,u.exports=r},function(u,D,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)},u.exports=i},function(u,D,y){function r(t){this.vGraphObject=t}u.exports=r},function(u,D,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()},u.exports=a},function(u,D,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},u.exports=r},function(u,D,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,m){r.call(this,m),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,m){if(T==null&&m==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(m)>-1))throw"Source or target not in graph!";if(!(T.owner==m.owner&&T.owner==this))throw"Both owners must be this graph!";return T.owner!=m.owner?null:(O.source=T,O.target=m,O.isInterGraph=!1,this.getEdges().push(O),T.edges.push(O),m!=T&&m.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 m=T.edges.slice(),L,O=m.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,m,L,O,d=this.getNodes(),N=d.length,s=0;sm&&(E=m),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,m=-t.MAX_VALUE,L=t.MAX_VALUE,O=-t.MAX_VALUE,d,N,s,h,f,p=this.nodes,A=p.length,I=0;Id&&(T=d),ms&&(L=s),Od&&(T=d),ms&&(L=s),O=this.nodes.length){var A=0;m.forEach(function(I){I.owner==E&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},u.exports=c},function(u,D,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]=m,x=!0):(o[0]=E,o[1]=l,x=!0):U===w&&(g>v?(o[0]=c,o[1]=l,x=!0):(o[0]=L,o[1]=m,x=!0)),-X===w?v>g?(o[2]=f,o[3]=p,G=!0):(o[2]=h,o[3]=s,G=!0):X===w&&(v>g?(o[2]=N,o[3]=s,G=!0):(o[2]=A,o[3]=p,G=!0)),x&&G)return!1;if(g>v?a>n?(S=this.getCardinalDirection(U,w,4),F=this.getCardinalDirection(X,w,2)):(S=this.getCardinalDirection(-U,w,3),F=this.getCardinalDirection(-X,w,1)):a>n?(S=this.getCardinalDirection(-U,w,1),F=this.getCardinalDirection(-X,w,3)):(S=this.getCardinalDirection(U,w,2),F=this.getCardinalDirection(X,w,4)),!x)switch(S){case 1:Y=l,b=g+-d/w,o[0]=b,o[1]=Y;break;case 2:b=L,Y=a+O*w,o[0]=b,o[1]=Y;break;case 3:Y=m,b=g+d/w,o[0]=b,o[1]=Y;break;case 4:b=T,Y=a+-O*w,o[0]=b,o[1]=Y;break}if(!G)switch(F){case 1:H=s,k=v+-R/w,o[2]=k,o[3]=H;break;case 2:k=A,H=n+I*w,o[2]=k,o[3]=H;break;case 3:H=p,k=v+R/w,o[2]=k,o[3]=H;break;case 4:k=f,H=n+-I*w,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,m=g.y,L=void 0,O=void 0,d=void 0,N=void 0,s=void 0,h=void 0,f=void 0,p=void 0,A=void 0;return d=c-v,s=a-n,f=n*v-a*c,N=m-E,h=l-T,p=T*E-l*m,A=d*h-N*s,A===0?null:(L=(s*p-h*f)/A,O=(N*f-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)},u.exports=r},function(u,D,y){function r(){}r.MAX_VALUE=2147483647,r.MIN_VALUE=-2147483648,u.exports=r},function(u,D,y){var r=function(){function a(v,n){for(var c=0;c"u"?"undefined":r(e);return e==null||i!="object"&&i!="function"},u.exports=t},function(u,D,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 f=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,m=this.graphManager.calcLowestCommonAncestor(l.source,l.target),L=0;L0){for(var m=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 G=m.get(x),U=G-1;U==1&&h.push(x),m.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},u.exports=c},function(u,D,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)},u.exports=r},function(u,D,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},u.exports=t},function(u,D,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,m,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*m)):(d=c.getEstimatedSize()*this.compoundGravityRangeFactor,(L>d||O>d)&&(n.gravitationForceX=-this.gravityConstant*T*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*m*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}();u.exports=i},function(u,D,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()),f=this.nodesWithGravity.filter(function(p){return h.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%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 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(),h={},f=0;f1){var x;for(x=0;xp&&(p=Math.floor(R.y)),I=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,f){var p=Math.max(this.maxDiagonalInTree(s),a.DEFAULT_RADIAL_SEPARATION);d.branchRadialLayout(h,null,0,359,0,p);var A=L.calculateBounds(s),I=new O;I.setDeviceOrgX(A.getMinX()),I.setDeviceOrgY(A.getMinY()),I.setWorldOrgX(f.x),I.setWorldOrgY(f.y);for(var R=0;R1;){var H=k[0];k.splice(0,1);var P=w.indexOf(H);P>=0&&w.splice(P,1),b--,S--}h!=null?Y=(w.indexOf(k[0])+1)%b:Y=0;for(var B=Math.abs(p-f)/S,$=Y;F!=S;$=++$%b){var j=w[$].getOtherEnd(s);if(j!=h){var V=(f+F*B)%360,z=(V+B)%360;d.branchRadialLayout(j,s,V,z,A+I,I),F++}}},d.maxDiagonalInTree=function(s){for(var h=T.MIN_VALUE,f=0;fh&&(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 f=[],p=this.graphManager.getAllNodes(),A=0;A"u"&&(h[x]=[]),h[x]=h[x].concat(I)}Object.keys(h).forEach(function(G){if(h[G].length>1){var U="DummyCompound_"+G;s.memberGroups[U]=h[G];var X=h[G][0].getParent(),w=new o(s.graphManager);w.id=U,w.paddingLeft=X.paddingLeft||0,w.paddingRight=X.paddingRight||0,w.paddingBottom=X.paddingBottom||0,w.paddingTop=X.paddingTop||0,s.idToDummyNode[U]=w;var S=s.getGraphManager().add(s.newGraph(),w),F=X.getChild();F.add(w);for(var b=0;b=0;s--){var h=this.compoundOrder[s],f=h.id,p=h.paddingLeft,A=h.paddingTop;this.adjustLocations(this.tiledMemberPack[f],h.rect.x,h.rect.y,p,A)}},d.prototype.repopulateZeroDegreeMembers=function(){var s=this,h=this.tiledZeroDegreePack;Object.keys(h).forEach(function(f){var p=s.idToDummyNode[f],A=p.paddingLeft,I=p.paddingTop;s.adjustLocations(h[f],p.rect.x,p.rect.y,A,I)})},d.prototype.getToBeTiled=function(s){var h=s.id;if(this.toBeTiled[h]!=null)return this.toBeTiled[h];var f=s.getChild();if(f==null)return this.toBeTiled[h]=!1,!1;for(var p=f.getNodes(),A=0;A0)return this.toBeTiled[h]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[h]=!1,!1}return this.toBeTiled[h]=!0,!0},d.prototype.getNodeDegree=function(s){s.id;for(var h=s.getEdges(),f=0,p=0;pG&&(G=X.rect.height)}f+=G+s.verticalPadding}},d.prototype.tileCompoundMembers=function(s,h){var f=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(p){var A=h[p];f.tiledMemberPack[p]=f.tileNodes(s[p],A.paddingLeft+A.paddingRight),A.rect.width=f.tiledMemberPack[p].width,A.rect.height=f.tiledMemberPack[p].height})},d.prototype.tileNodes=function(s,h){var f=a.TILING_PADDING_VERTICAL,p=a.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:h,verticalPadding:f,horizontalPadding:p};s.sort(function(x,G){return x.rect.width*x.rect.height>G.rect.width*G.rect.height?-1:x.rect.width*x.rect.height0&&(R+=s.horizontalPadding),s.rowWidth[f]=R,s.width0&&(x+=s.verticalPadding);var G=0;x>s.rowHeight[f]&&(G=s.rowHeight[f],s.rowHeight[f]=x,G=s.rowHeight[f]-G),s.height+=G,s.rows[f].push(h)},d.prototype.getShortestRowIndex=function(s){for(var h=-1,f=Number.MAX_VALUE,p=0;pf&&(h=p,f=s.rowWidth[p]);return h},d.prototype.canAddHorizontal=function(s,h,f){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 I=0;s.rowHeight[p]0&&(I=f+s.verticalPadding-s.rowHeight[p]);var R;s.width-A>=h+s.horizontalPadding?R=(s.height+I)/(A+h+s.horizontalPadding):R=(s.height+I)/s.width,I=f+s.verticalPadding;var x;return s.widthI&&h!=f){p.splice(-1,1),s.rows[f].push(A),s.rowWidth[h]=s.rowWidth[h]-I,s.rowWidth[f]=s.rowWidth[f]+I,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 G=s.rowHeight[h]+s.rowHeight[f];s.rowHeight[h]=R,s.rowHeight[f]0)for(var F=A;F<=I;F++)S[0]+=this.grid[F][R-1].length+this.grid[F][R].length-1;if(I0)for(var F=R;F<=x;F++)S[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(),f),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),D.exports=T}])})}(tt)),tt.exports}var Gt=St();const _t=It(Gt);var at=function(){var C=_(function(O,d,N,s){for(N=N||{},s=O.length;s--;N[O[s]]=d);return N},"o"),M=[1,4],u=[1,13],D=[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:_(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:_(function(d,N,s,h,f,p,A){var I=p.length-1;switch(f){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[I].id),h.addNode(p[I-1].length,p[I].id,p[I].descr,p[I].type);break;case 16:h.getLogger().trace("Icon: ",p[I]),h.decorateNode({icon:p[I]});break;case 17:case 21:h.decorateNode({class:p[I]});break;case 18:h.getLogger().trace("SPACELIST");break;case 19:h.getLogger().trace("Node: ",p[I].id),h.addNode(0,p[I].id,p[I].descr,p[I].type);break;case 20:h.decorateNode({icon:p[I]});break;case 25:h.getLogger().trace("node found ..",p[I-2]),this.$={id:p[I-1],descr:p[I-1],type:h.getType(p[I-2],p[I])};break;case 26:this.$={id:p[I],descr:p[I],type:h.nodeType.DEFAULT};break;case 27:h.getLogger().trace("node found ..",p[I-3]),this.$={id:p[I-3],descr:p[I-1],type:h.getType(p[I-2],p[I])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:M},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:M},{6:u,7:[1,10],9:9,12:11,13:D,14:14,15:y,16:r,17:17,18:18,19:t,22:e},C(i,[2,3]),{1:[2,2]},C(i,[2,4]),C(i,[2,5]),{1:[2,6],6:u,12:21,13:D,14:14,15:y,16:r,17:17,18:18,19:t,22:e},{6:u,9:22,12:11,13:D,14:14,15:y,16:r,17:17,18:18,19:t,22:e},{6:o,7:g,10:23,11:a},C(v,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:t,22:e}),C(v,[2,18]),C(v,[2,19]),C(v,[2,20]),C(v,[2,21]),C(v,[2,23]),C(v,[2,24]),C(v,[2,26],{19:[1,30]}),{20:[1,31]},{6:o,7:g,10:32,11:a},{1:[2,7],6:u,12:21,13:D,14:14,15:y,16:r,17:17,18:18,19:t,22:e},C(n,[2,14],{7:c,11:l}),C(E,[2,8]),C(E,[2,9]),C(E,[2,10]),C(v,[2,15]),C(v,[2,16]),C(v,[2,17]),{20:[1,35]},{21:[1,36]},C(n,[2,13],{7:c,11:l}),C(E,[2,11]),C(E,[2,12]),{21:[1,37]},C(v,[2,25]),C(v,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:_(function(d,N){if(N.recoverable)this.trace(d);else{var s=new Error(d);throw s.hash=N,s}},"parseError"),parse:_(function(d){var N=this,s=[0],h=[],f=[null],p=[],A=this.table,I="",R=0,x=0,G=2,U=1,X=p.slice.call(arguments,1),w=Object.create(this.lexer),S={yy:{}};for(var F in this.yy)Object.prototype.hasOwnProperty.call(this.yy,F)&&(S.yy[F]=this.yy[F]);w.setInput(d,S.yy),S.yy.lexer=w,S.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var b=w.yylloc;p.push(b);var Y=w.options&&w.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function k(W){s.length=s.length-2*W,f.length=f.length-W,p.length=p.length-W}_(k,"popStack");function H(){var W;return W=h.pop()||w.lex()||U,typeof W!="number"&&(W instanceof Array&&(h=W,W=h.pop()),W=N.symbols_[W]||W),W}_(H,"lex");for(var P,B,$,j,V={},z,Z,lt,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 nt="";q=[];for(z in A[B])this.terminals_[z]&&z>G&&q.push("'"+this.terminals_[z]+"'");w.showPosition?nt="Parse error on line "+(R+1)+`: `+w.showPosition()+` Expecting `+q.join(", ")+", got '"+(this.terminals_[P]||P)+"'":nt="Parse error on line "+(R+1)+": Unexpected "+(P==U?"end of input":"'"+(this.terminals_[P]||P)+"'"),this.parseError(nt,{text:w.match,token:this.terminals_[P]||P,line:w.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(w.yytext),p.push(w.yylloc),s.push($[1]),P=null,x=w.yyleng,I=w.yytext,R=w.yylineno,b=w.yylloc;break;case 2:if(Z=this.productions_[$[1]][1],V.$=f[f.length-Z],V._$={first_line:p[p.length-(Z||1)].first_line,last_line:p[p.length-1].last_line,first_column:p[p.length-(Z||1)].first_column,last_column:p[p.length-1].last_column},Y&&(V._$.range=[p[p.length-(Z||1)].range[0],p[p.length-1].range[1]]),j=this.performAction.apply(V,[I,x,R,S.yy,$[1],f,p].concat(X)),typeof j<"u")return j;Z&&(s=s.slice(0,-1*Z*2),f=f.slice(0,-1*Z),p=p.slice(0,-1*Z)),s.push(this.productions_[$[1]][0]),f.push(V.$),p.push(V._$),lt=A[s[s.length-2]][s[s.length-1]],s.push(lt);break;case 3:return!0}}return!0},"parse")},m=function(){var O={EOF:1,parseError:_(function(N,s){if(this.yy.parser)this.yy.parser.parseError(N,s);else throw new Error(N)},"parseError"),setInput:_(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:_(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:_(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 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===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=[f[0],f[0]+this.yyleng-N]),this.yyleng=this.yytext.length,this},"unput"),more:_(function(){return this._more=!0,this},"more"),reject:_(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:_(function(d){this.unput(this.match.slice(d))},"less"),pastInput:_(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:_(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:_(function(){var d=this.pastInput(),N=new Array(d.length+1).join("-");return d+this.upcomingInput()+` `+N+"^"},"showPosition"),test_match:_(function(d,N){var s,h,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))),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 f)this[p]=f[p];return!1}return!1},"test_match"),next:_(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 f=this._currentRules(),p=0;pN[0].length)){if(N=s,h=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[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:_(function(){var N=this.next();return N||this.lex()},"lex"),begin:_(function(N){this.conditionStack.push(N)},"begin"),popState:_(function(){var N=this.conditionStack.length-1;return N>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:_(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:_(function(N){return N=this.conditionStack.length-1-Math.abs(N||0),N>=0?this.conditionStack[N]:"INITIAL"},"topState"),pushState:_(function(N){this.begin(N)},"pushState"),stateStackSize:_(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:_(function(N,s,h,f){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=m;function L(){this.yy={}}return _(L,"Parser"),L.prototype=T,T.Parser=L,new L}();at.parser=at;var Ft=at,bt={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},K,Ut=(K=class{constructor(){this.nodes=[],this.count=0,this.elements={},this.getLogger=this.getLogger.bind(this),this.nodeType=bt,this.clear(),this.getType=this.getType.bind(this),this.getMindmap=this.getMindmap.bind(this),this.getElementById=this.getElementById.bind(this),this.getParent=this.getParent.bind(this),this.getMindmap=this.getMindmap.bind(this),this.addNode=this.addNode.bind(this),this.decorateNode=this.decorateNode.bind(this)}clear(){this.nodes=[],this.count=0,this.elements={}}getParent(M){for(let u=this.nodes.length-1;u>=0;u--)if(this.nodes[u].level0?this.nodes[0]:null}addNode(M,u,D,y){var o,g;Q.info("addNode",M,u,D,y);const r=st();let t=((o=r.mindmap)==null?void 0:o.padding)??it.mindmap.padding;switch(y){case this.nodeType.ROUNDED_RECT:case this.nodeType.RECT:case this.nodeType.HEXAGON:t*=2;break}const e={id:this.count++,nodeId:J(u,r),level:M,descr:J(D,r),type:y,children:[],width:((g=r.mindmap)==null?void 0:g.maxNodeWidth)??it.mindmap.maxNodeWidth,padding:t},i=this.getParent(M);if(i)i.children.push(e),this.nodes.push(e);else if(this.nodes.length===0)this.nodes.push(e);else throw new Error(`There can be only one root. No parent could be found for ("${e.descr}")`)}getType(M,u){switch(Q.debug("In get type",M,u),M){case"[":return this.nodeType.RECT;case"(":return u===")"?this.nodeType.ROUNDED_RECT:this.nodeType.CLOUD;case"((":return this.nodeType.CIRCLE;case")":return this.nodeType.CLOUD;case"))":return this.nodeType.BANG;case"{{":return this.nodeType.HEXAGON;default:return this.nodeType.DEFAULT}}setElementForId(M,u){this.elements[M]=u}getElementById(M){return this.elements[M]}decorateNode(M){if(!M)return;const u=st(),D=this.nodes[this.nodes.length-1];M.icon&&(D.icon=J(M.icon,u)),M.class&&(D.class=J(M.class,u))}type2Str(M){switch(M){case this.nodeType.DEFAULT:return"no-border";case this.nodeType.RECT:return"rect";case this.nodeType.ROUNDED_RECT:return"rounded-rect";case this.nodeType.CIRCLE:return"circle";case this.nodeType.CLOUD:return"cloud";case this.nodeType.BANG:return"bang";case this.nodeType.HEXAGON:return"hexgon";default:return"no-border"}}getLogger(){return Q}},_(K,"MindmapDB"),K),Pt=12,Yt=_(function(C,M,u,D){M.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.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`),M.append("line").attr("class","node-line-"+D).attr("x1",0).attr("y1",u.height).attr("x2",u.width).attr("y2",u.height)},"defaultBkg"),Xt=_(function(C,M,u){M.append("rect").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("height",u.height).attr("width",u.width)},"rectBkg"),kt=_(function(C,M,u){const D=u.width,y=u.height,r=.15*D,t=.25*D,e=.35*D,i=.2*D;M.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("d",`M0 0 a${r},${r} 0 0,1 ${D*.25},${-1*D*.1} a${e},${e} 1 0,1 ${D*.4},${-1*D*.1} a${t},${t} 1 0,1 ${D*.35},${1*D*.2} a${r},${r} 1 0,1 ${D*.15},${1*y*.35} a${i},${i} 1 0,1 ${-1*D*.15},${1*y*.65} a${t},${r} 1 0,1 ${-1*D*.25},${D*.15} a${e},${e} 1 0,1 ${-1*D*.5},0 a${r},${r} 1 0,1 ${-1*D*.25},${-1*D*.15} a${r},${r} 1 0,1 ${-1*D*.1},${-1*y*.35} a${i},${i} 1 0,1 ${D*.1},${-1*y*.65} H0 V0 Z`)},"cloudBkg"),Ht=_(function(C,M,u){const D=u.width,y=u.height,r=.15*D;M.append("path").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("d",`M0 0 a${r},${r} 1 0,0 ${D*.25},${-1*y*.1} a${r},${r} 1 0,0 ${D*.25},0 a${r},${r} 1 0,0 ${D*.25},0 a${r},${r} 1 0,0 ${D*.25},${1*y*.1} a${r},${r} 1 0,0 ${D*.15},${1*y*.33} a${r*.8},${r*.8} 1 0,0 0,${1*y*.34} a${r},${r} 1 0,0 ${-1*D*.15},${1*y*.33} a${r},${r} 1 0,0 ${-1*D*.25},${y*.15} a${r},${r} 1 0,0 ${-1*D*.25},0 a${r},${r} 1 0,0 ${-1*D*.25},0 a${r},${r} 1 0,0 ${-1*D*.25},${-1*y*.15} a${r},${r} 1 0,0 ${-1*D*.1},${-1*y*.33} a${r*.8},${r*.8} 1 0,0 0,${-1*y*.34} a${r},${r} 1 0,0 ${D*.1},${-1*y*.33} H0 V0 Z`)},"bangBkg"),$t=_(function(C,M,u){M.append("circle").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("r",u.width/2)},"circleBkg");function pt(C,M,u,D,y){return C.insert("polygon",":first-child").attr("points",D.map(function(r){return r.x+","+r.y}).join(" ")).attr("transform","translate("+(y.width-M)/2+", "+u+")")}_(pt,"insertPolygonShape");var Bt=_(function(C,M,u){const D=u.height,r=D/4,t=u.width-u.padding+2*r,e=[{x:r,y:0},{x:t-r,y:0},{x:t,y:-D/2},{x:t-r,y:-D},{x:r,y:-D},{x:0,y:-D/2}];pt(M,t,D,e,u)},"hexagonBkg"),Wt=_(function(C,M,u){M.append("rect").attr("id","node-"+u.id).attr("class","node-bkg node-"+C.type2Str(u.type)).attr("height",u.height).attr("rx",u.padding).attr("ry",u.padding).attr("width",u.width)},"roundedRectBkg"),Vt=_(async function(C,M,u,D,y){const r=y.htmlLabels,t=D%(Pt-1),e=M.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,` `);await Ot(g,a,{useHtmlLabels:r,width:u.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]=At(y.fontSize);if(u.height=v.height+n*1.1*.5+u.padding,u.width=v.width+2*u.padding,u.icon)if(u.type===C.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 c=u.height;u.height=Math.max(c,60);const l=Math.abs(u.height-c);e.append("foreignObject").attr("width","60px").attr("height",u.height).attr("style","text-align: center;margin-top:"+l/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)+", "+(l/2+u.padding/2)+")")}else if(r){const c=(u.width-v.width)/2,l=(u.height-v.height)/2;g.attr("transform","translate("+c+", "+l+")")}else{const c=u.width/2,l=u.padding/2;g.attr("transform","translate("+c+", "+l+")")}switch(u.type){case C.nodeType.DEFAULT:Yt(C,o,u,t);break;case C.nodeType.ROUNDED_RECT:Wt(C,o,u,t);break;case C.nodeType.RECT:Xt(C,o,u,t);break;case C.nodeType.CIRCLE:o.attr("transform","translate("+u.width/2+", "+ +u.height/2+")"),$t(C,o,u,t);break;case C.nodeType.CLOUD:kt(C,o,u,t);break;case C.nodeType.BANG:Ht(C,o,u,t);break;case C.nodeType.HEXAGON:Bt(C,o,u,t);break}return C.setElementForId(u.id,e),u.height},"drawNode"),Zt=_(function(C,M){const u=C.getElementById(M.id),D=M.x||0,y=M.y||0;u.attr("transform","translate("+D+","+y+")")},"positionNode");ft.use(_t);async function ot(C,M,u,D,y){await Vt(C,M,u,D,y),u.children&&await Promise.all(u.children.map((r,t)=>ot(C,M,r,D<0?t:D,y)))}_(ot,"drawNodes");function dt(C,M){M.edges().map((u,D)=>{const y=u.data();if(u[0]._private.bodyBounds){const r=u[0]._private.rscratch;Q.trace("Edge: ",D,y),C.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)}})}_(dt,"drawEdges");function ht(C,M,u,D){M.add({group:"nodes",data:{id:C.id.toString(),labelText:C.descr,height:C.height,width:C.width,level:D,nodeId:C.id,padding:C.padding,type:C.type},position:{x:C.x,y:C.y}}),C.children&&C.children.forEach(y=>{ht(y,M,u,D+1),M.add({group:"edges",data:{id:`${C.id}_${y.id}`,source:C.id,target:y.id,depth:D,section:y.section}})})}_(ht,"addNodes");function vt(C,M){return new Promise(u=>{const D=Dt("body").append("div").attr("id","cy").attr("style","display:none"),y=ft({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});D.remove(),ht(C,y,M,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=>{Q.info("Ready",r),u(y)})})}_(vt,"layoutMindmap");function yt(C,M){M.nodes().map((u,D)=>{const y=u.data();y.x=u.position().x,y.y=u.position().y,Zt(C,y);const r=C.getElementById(y.nodeId);Q.info("id:",D,"Position: (",u.position().x,", ",u.position().y,")",y),r.attr("transform",`translate(${u.position().x-y.width/2}, ${u.position().y-y.height/2})`),r.attr("attr",`apa-${D})`)})}_(yt,"positionNodes");var Qt=_(async(C,M,u,D)=>{var a,v;Q.debug(`Rendering mindmap diagram `+C);const y=D.db,r=y.getMindmap();if(!r)return;const t=st();t.htmlLabels=!1;const e=Et(M),i=e.append("g");i.attr("class","mindmap-edges");const o=e.append("g");o.attr("class","mindmap-nodes"),await ot(y,o,r,-1,t);const g=await vt(r,t);dt(i,g),yt(y,g),Lt(void 0,e,((a=t.mindmap)==null?void 0:a.padding)??it.mindmap.padding,((v=t.mindmap)==null?void 0:v.useMaxWidth)??it.mindmap.useMaxWidth)},"draw"),jt={draw:Qt},zt=_(C=>{let M="";for(let u=0;u` .edge { stroke-width: 3; } ${zt(C)} .section-root rect, .section-root path, .section-root circle, .section-root polygon { fill: ${C.git0}; } .section-root text { fill: ${C.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"),qt=Kt,ae={get db(){return new Ut},renderer:jt,parser:Ft,styles:qt};export{ae as diagram};