All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.chunks.mermaid.esm.min.mindmap-definition-KLCIANCF.mjs Maven / Gradle / Ivy

Go to download

Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graphs and more.

There is a newer version: 11.4.0
Show newest version
import{a as rs}from"./chunk-WVHPJQMP.mjs";import{d as ts}from"./chunk-KMOJB3TB.mjs";import{k as es}from"./chunk-AC3VT7B7.mjs";import"./chunk-TI4EEUUG.mjs";import{F as ta,N as Ji,X as ra,b as Yt,fa as ji,n as Ki,o as Zi,p as Qi,s as Sr}from"./chunk-NQURTBEV.mjs";import"./chunk-6BY5RJGC.mjs";import{a as f,b as Gn,e as Tl}from"./chunk-GTKDMUJJ.mjs";var Ui=Gn((Pa,Vi)=>{"use strict";f(function(e,r){typeof Pa=="object"&&typeof Vi=="object"?Vi.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Pa=="object"?Pa.layoutBase=r():e.layoutBase=r()},"webpackUniversalModuleDefinition")(Pa,function(){return function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return f(r,"__webpack_require__"),r.m=t,r.c=e,r.i=function(a){return a},r.d=function(a,n,i){r.o(a,n)||Object.defineProperty(a,n,{configurable:!1,enumerable:!0,get:i})},r.n=function(a){var n=a&&a.__esModule?f(function(){return a.default},"getDefault"):f(function(){return a},"getModuleExports");return r.d(n,"a",n),n},r.o=function(a,n){return Object.prototype.hasOwnProperty.call(a,n)},r.p="",r(r.s=26)}([function(t,e,r){"use strict";function a(){}f(a,"LayoutConstants"),a.QUALITY=1,a.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,a.DEFAULT_INCREMENTAL=!1,a.DEFAULT_ANIMATION_ON_LAYOUT=!0,a.DEFAULT_ANIMATION_DURING_LAYOUT=!1,a.DEFAULT_ANIMATION_PERIOD=50,a.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,a.DEFAULT_GRAPH_MARGIN=15,a.NODE_DIMENSIONS_INCLUDE_LABELS=!1,a.SIMPLE_NODE_SIZE=40,a.SIMPLE_NODE_HALF_SIZE=a.SIMPLE_NODE_SIZE/2,a.EMPTY_COMPOUND_NODE_SIZE=40,a.MIN_EDGE_LENGTH=1,a.WORLD_BOUNDARY=1e6,a.INITIAL_WORLD_BOUNDARY=a.WORLD_BOUNDARY/1e3,a.WORLD_CENTER_X=1200,a.WORLD_CENTER_Y=900,t.exports=a},function(t,e,r){"use strict";var a=r(2),n=r(8),i=r(9);function s(l,u,h){a.call(this,h),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=h,this.bendpoints=[],this.source=l,this.target=u}f(s,"LEdge"),s.prototype=Object.create(a.prototype);for(var o in a)s[o]=a[o];s.prototype.getSource=function(){return this.source},s.prototype.getTarget=function(){return this.target},s.prototype.isInterGraph=function(){return this.isInterGraph},s.prototype.getLength=function(){return this.length},s.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},s.prototype.getBendpoints=function(){return this.bendpoints},s.prototype.getLca=function(){return this.lca},s.prototype.getSourceInLca=function(){return this.sourceInLca},s.prototype.getTargetInLca=function(){return this.targetInLca},s.prototype.getOtherEnd=function(l){if(this.source===l)return this.target;if(this.target===l)return this.source;throw"Node is not incident with this edge"},s.prototype.getOtherEndInGraph=function(l,u){for(var h=this.getOtherEnd(l),c=u.getGraphManager().getRoot();;){if(h.getOwner()==u)return h;if(h.getOwner()==c)break;h=h.getOwner().getParent()}return null},s.prototype.updateLength=function(){var l=new Array(4);this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),l),this.isOverlapingSourceAndTarget||(this.lengthX=l[0]-l[2],this.lengthY=l[1]-l[3],Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},s.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=i.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=i.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},t.exports=s},function(t,e,r){"use strict";function a(n){this.vGraphObject=n}f(a,"LGraphObject"),t.exports=a},function(t,e,r){"use strict";var a=r(2),n=r(10),i=r(13),s=r(0),o=r(16),l=r(4);function u(c,v,d,g){d==null&&g==null&&(g=v),a.call(this,g),c.graphManager!=null&&(c=c.graphManager),this.estimatedSize=n.MIN_VALUE,this.inclusionTreeDepth=n.MAX_VALUE,this.vGraphObject=g,this.edges=[],this.graphManager=c,d!=null&&v!=null?this.rect=new i(v.x,v.y,d.width,d.height):this.rect=new i}f(u,"LNode"),u.prototype=Object.create(a.prototype);for(var h in a)u[h]=a[h];u.prototype.getEdges=function(){return this.edges},u.prototype.getChild=function(){return this.child},u.prototype.getOwner=function(){return this.owner},u.prototype.getWidth=function(){return this.rect.width},u.prototype.setWidth=function(c){this.rect.width=c},u.prototype.getHeight=function(){return this.rect.height},u.prototype.setHeight=function(c){this.rect.height=c},u.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},u.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},u.prototype.getCenter=function(){return new l(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},u.prototype.getLocation=function(){return new l(this.rect.x,this.rect.y)},u.prototype.getRect=function(){return this.rect},u.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},u.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},u.prototype.setRect=function(c,v){this.rect.x=c.x,this.rect.y=c.y,this.rect.width=v.width,this.rect.height=v.height},u.prototype.setCenter=function(c,v){this.rect.x=c-this.rect.width/2,this.rect.y=v-this.rect.height/2},u.prototype.setLocation=function(c,v){this.rect.x=c,this.rect.y=v},u.prototype.moveBy=function(c,v){this.rect.x+=c,this.rect.y+=v},u.prototype.getEdgeListToNode=function(c){var v=[],d,g=this;return g.edges.forEach(function(m){if(m.target==c){if(m.source!=g)throw"Incorrect edge source!";v.push(m)}}),v},u.prototype.getEdgesBetween=function(c){var v=[],d,g=this;return g.edges.forEach(function(m){if(!(m.source==g||m.target==g))throw"Incorrect edge source and/or target";(m.target==c||m.source==c)&&v.push(m)}),v},u.prototype.getNeighborsList=function(){var c=new Set,v=this;return v.edges.forEach(function(d){if(d.source==v)c.add(d.target);else{if(d.target!=v)throw"Incorrect incidency!";c.add(d.source)}}),c},u.prototype.withChildren=function(){var c=new Set,v,d;if(c.add(this),this.child!=null)for(var g=this.child.getNodes(),m=0;mv&&(this.rect.x-=(this.labelWidth-v)/2,this.setWidth(this.labelWidth)),this.labelHeight>d&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-d)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-d),this.setHeight(this.labelHeight))}}},u.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},u.prototype.transform=function(c){var v=this.rect.x;v>s.WORLD_BOUNDARY?v=s.WORLD_BOUNDARY:v<-s.WORLD_BOUNDARY&&(v=-s.WORLD_BOUNDARY);var d=this.rect.y;d>s.WORLD_BOUNDARY?d=s.WORLD_BOUNDARY:d<-s.WORLD_BOUNDARY&&(d=-s.WORLD_BOUNDARY);var g=new l(v,d),m=c.inverseTransformPoint(g);this.setLocation(m.x,m.y)},u.prototype.getLeft=function(){return this.rect.x},u.prototype.getRight=function(){return this.rect.x+this.rect.width},u.prototype.getTop=function(){return this.rect.y},u.prototype.getBottom=function(){return this.rect.y+this.rect.height},u.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},t.exports=u},function(t,e,r){"use strict";function a(n,i){n==null&&i==null?(this.x=0,this.y=0):(this.x=n,this.y=i)}f(a,"PointD"),a.prototype.getX=function(){return this.x},a.prototype.getY=function(){return this.y},a.prototype.setX=function(n){this.x=n},a.prototype.setY=function(n){this.y=n},a.prototype.getDifference=function(n){return new DimensionD(this.x-n.x,this.y-n.y)},a.prototype.getCopy=function(){return new a(this.x,this.y)},a.prototype.translate=function(n){return this.x+=n.width,this.y+=n.height,this},t.exports=a},function(t,e,r){"use strict";var a=r(2),n=r(10),i=r(0),s=r(6),o=r(3),l=r(1),u=r(13),h=r(12),c=r(11);function v(g,m,y){a.call(this,y),this.estimatedSize=n.MIN_VALUE,this.margin=i.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=g,m!=null&&m instanceof s?this.graphManager=m:m!=null&&m instanceof Layout&&(this.graphManager=m.graphManager)}f(v,"LGraph"),v.prototype=Object.create(a.prototype);for(var d in a)v[d]=a[d];v.prototype.getNodes=function(){return this.nodes},v.prototype.getEdges=function(){return this.edges},v.prototype.getGraphManager=function(){return this.graphManager},v.prototype.getParent=function(){return this.parent},v.prototype.getLeft=function(){return this.left},v.prototype.getRight=function(){return this.right},v.prototype.getTop=function(){return this.top},v.prototype.getBottom=function(){return this.bottom},v.prototype.isConnected=function(){return this.isConnected},v.prototype.add=function(g,m,y){if(m==null&&y==null){var p=g;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(p)>-1)throw"Node already in graph!";return p.owner=this,this.getNodes().push(p),p}else{var b=g;if(!(this.getNodes().indexOf(m)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(m.owner==y.owner&&m.owner==this))throw"Both owners must be this graph!";return m.owner!=y.owner?null:(b.source=m,b.target=y,b.isInterGraph=!1,this.getEdges().push(b),m.edges.push(b),y!=m&&y.edges.push(b),b)}},v.prototype.remove=function(g){var m=g;if(g instanceof o){if(m==null)throw"Node is null!";if(!(m.owner!=null&&m.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=m.edges.slice(),p,b=y.length,E=0;E-1&&x>-1))throw"Source and/or target doesn't know this edge!";p.source.edges.splice(w,1),p.target!=p.source&&p.target.edges.splice(x,1);var S=p.source.owner.getEdges().indexOf(p);if(S==-1)throw"Not in owner's edge list!";p.source.owner.getEdges().splice(S,1)}},v.prototype.updateLeftTop=function(){for(var g=n.MAX_VALUE,m=n.MAX_VALUE,y,p,b,E=this.getNodes(),S=E.length,w=0;wy&&(g=y),m>p&&(m=p)}return g==n.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?b=E[0].getParent().paddingLeft:b=this.margin,this.left=m-b,this.top=g-b,new h(this.left,this.top))},v.prototype.updateBounds=function(g){for(var m=n.MAX_VALUE,y=-n.MAX_VALUE,p=n.MAX_VALUE,b=-n.MAX_VALUE,E,S,w,x,T,C=this.nodes,D=C.length,L=0;LE&&(m=E),yw&&(p=w),bE&&(m=E),yw&&(p=w),b=this.nodes.length){var D=0;y.forEach(function(L){L.owner==g&&D++}),D==this.nodes.length&&(this.isConnected=!0)}},t.exports=v},function(t,e,r){"use strict";var a,n=r(1);function i(s){a=r(5),this.layout=s,this.graphs=[],this.edges=[]}f(i,"LGraphManager"),i.prototype.addRoot=function(){var s=this.layout.newGraph(),o=this.layout.newNode(null),l=this.add(s,o);return this.setRootGraph(l),this.rootGraph},i.prototype.add=function(s,o,l,u,h){if(l==null&&u==null&&h==null){if(s==null)throw"Graph is null!";if(o==null)throw"Parent node is null!";if(this.graphs.indexOf(s)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(s),s.parent!=null)throw"Already has a parent!";if(o.child!=null)throw"Already has a child!";return s.parent=o,o.child=s,s}else{h=l,u=o,l=s;var c=u.getOwner(),v=h.getOwner();if(!(c!=null&&c.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(v!=null&&v.getGraphManager()==this))throw"Target not in this graph mgr!";if(c==v)return l.isInterGraph=!1,c.add(l,u,h);if(l.isInterGraph=!0,l.source=u,l.target=h,this.edges.indexOf(l)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(l),!(l.source!=null&&l.target!=null))throw"Edge source and/or target is null!";if(!(l.source.edges.indexOf(l)==-1&&l.target.edges.indexOf(l)==-1))throw"Edge already in source and/or target incidency list!";return l.source.edges.push(l),l.target.edges.push(l),l}},i.prototype.remove=function(s){if(s instanceof a){var o=s;if(o.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(o==this.rootGraph||o.parent!=null&&o.parent.graphManager==this))throw"Invalid parent node!";var l=[];l=l.concat(o.getEdges());for(var u,h=l.length,c=0;c=s.getRight()?o[0]+=Math.min(s.getX()-i.getX(),i.getRight()-s.getRight()):s.getX()<=i.getX()&&s.getRight()>=i.getRight()&&(o[0]+=Math.min(i.getX()-s.getX(),s.getRight()-i.getRight())),i.getY()<=s.getY()&&i.getBottom()>=s.getBottom()?o[1]+=Math.min(s.getY()-i.getY(),i.getBottom()-s.getBottom()):s.getY()<=i.getY()&&s.getBottom()>=i.getBottom()&&(o[1]+=Math.min(i.getY()-s.getY(),s.getBottom()-i.getBottom()));var h=Math.abs((s.getCenterY()-i.getCenterY())/(s.getCenterX()-i.getCenterX()));s.getCenterY()===i.getCenterY()&&s.getCenterX()===i.getCenterX()&&(h=1);var c=h*o[0],v=o[1]/h;o[0]c)return o[0]=l,o[1]=d,o[2]=h,o[3]=C,!1;if(uh)return o[0]=v,o[1]=u,o[2]=x,o[3]=c,!1;if(lh?(o[0]=m,o[1]=y,A=!0):(o[0]=g,o[1]=d,A=!0):M===R&&(l>h?(o[0]=v,o[1]=d,A=!0):(o[0]=p,o[1]=y,A=!0)),-P===R?h>l?(o[2]=T,o[3]=C,I=!0):(o[2]=x,o[3]=w,I=!0):P===R&&(h>l?(o[2]=S,o[3]=w,I=!0):(o[2]=D,o[3]=C,I=!0)),A&&I)return!1;if(l>h?u>c?(k=this.getCardinalDirection(M,R,4),B=this.getCardinalDirection(P,R,2)):(k=this.getCardinalDirection(-M,R,3),B=this.getCardinalDirection(-P,R,1)):u>c?(k=this.getCardinalDirection(-M,R,1),B=this.getCardinalDirection(-P,R,3)):(k=this.getCardinalDirection(M,R,2),B=this.getCardinalDirection(P,R,4)),!A)switch(k){case 1:U=d,F=l+-E/R,o[0]=F,o[1]=U;break;case 2:F=p,U=u+b*R,o[0]=F,o[1]=U;break;case 3:U=y,F=l+E/R,o[0]=F,o[1]=U;break;case 4:F=m,U=u+-b*R,o[0]=F,o[1]=U;break}if(!I)switch(B){case 1:G=w,V=h+-O/R,o[2]=V,o[3]=G;break;case 2:V=D,G=c+L*R,o[2]=V,o[3]=G;break;case 3:G=C,V=h+O/R,o[2]=V,o[3]=G;break;case 4:V=T,G=c+-L*R,o[2]=V,o[3]=G;break}}return!1},n.getCardinalDirection=function(i,s,o){return i>s?o:1+o%4},n.getIntersection=function(i,s,o,l){if(l==null)return this.getIntersection2(i,s,o);var u=i.x,h=i.y,c=s.x,v=s.y,d=o.x,g=o.y,m=l.x,y=l.y,p=void 0,b=void 0,E=void 0,S=void 0,w=void 0,x=void 0,T=void 0,C=void 0,D=void 0;return E=v-h,w=u-c,T=c*h-u*v,S=y-g,x=d-m,C=m*g-d*y,D=E*x-S*w,D===0?null:(p=(w*C-x*T)/D,b=(S*T-E*C)/D,new a(p,b))},n.angleOfVector=function(i,s,o,l){var u=void 0;return i!==o?(u=Math.atan((l-s)/(o-i)),o0?1:n<0?-1:0},a.floor=function(n){return n<0?Math.ceil(n):Math.floor(n)},a.ceil=function(n){return n<0?Math.floor(n):Math.ceil(n)},t.exports=a},function(t,e,r){"use strict";function a(){}f(a,"Integer"),a.MAX_VALUE=2147483647,a.MIN_VALUE=-2147483648,t.exports=a},function(t,e,r){"use strict";var a=function(){function u(h,c){for(var v=0;v"u"?"undefined":a(i);return i==null||s!="object"&&s!="function"},t.exports=n},function(t,e,r){"use strict";function a(d){if(Array.isArray(d)){for(var g=0,m=Array(d.length);g0&&g;){for(E.push(w[0]);E.length>0&&g;){var x=E[0];E.splice(0,1),b.add(x);for(var T=x.getEdges(),p=0;p-1&&w.splice(O,1)}b=new Set,S=new Map}}return d},v.prototype.createDummyNodesForBendpoints=function(d){for(var g=[],m=d.source,y=this.graphManager.calcLowestCommonAncestor(d.source,d.target),p=0;p0){for(var y=this.edgeToDummyNodes.get(m),p=0;p=0&&g.splice(C,1);var D=S.getNeighborsList();D.forEach(function(A){if(m.indexOf(A)<0){var I=y.get(A),M=I-1;M==1&&x.push(A),y.set(A,M)}})}m=m.concat(x),(g.length==1||g.length==2)&&(p=!0,b=g[0])}return b},v.prototype.setGraphManager=function(d){this.graphManager=d},t.exports=v},function(t,e,r){"use strict";function a(){}f(a,"RandomSeed"),a.seed=1,a.x=0,a.nextDouble=function(){return a.x=Math.sin(a.seed++)*1e4,a.x-Math.floor(a.x)},t.exports=a},function(t,e,r){"use strict";var a=r(4);function n(i,s){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}f(n,"Transform"),n.prototype.getWorldOrgX=function(){return this.lworldOrgX},n.prototype.setWorldOrgX=function(i){this.lworldOrgX=i},n.prototype.getWorldOrgY=function(){return this.lworldOrgY},n.prototype.setWorldOrgY=function(i){this.lworldOrgY=i},n.prototype.getWorldExtX=function(){return this.lworldExtX},n.prototype.setWorldExtX=function(i){this.lworldExtX=i},n.prototype.getWorldExtY=function(){return this.lworldExtY},n.prototype.setWorldExtY=function(i){this.lworldExtY=i},n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},n.prototype.setDeviceOrgX=function(i){this.ldeviceOrgX=i},n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},n.prototype.setDeviceOrgY=function(i){this.ldeviceOrgY=i},n.prototype.getDeviceExtX=function(){return this.ldeviceExtX},n.prototype.setDeviceExtX=function(i){this.ldeviceExtX=i},n.prototype.getDeviceExtY=function(){return this.ldeviceExtY},n.prototype.setDeviceExtY=function(i){this.ldeviceExtY=i},n.prototype.transformX=function(i){var s=0,o=this.lworldExtX;return o!=0&&(s=this.ldeviceOrgX+(i-this.lworldOrgX)*this.ldeviceExtX/o),s},n.prototype.transformY=function(i){var s=0,o=this.lworldExtY;return o!=0&&(s=this.ldeviceOrgY+(i-this.lworldOrgY)*this.ldeviceExtY/o),s},n.prototype.inverseTransformX=function(i){var s=0,o=this.ldeviceExtX;return o!=0&&(s=this.lworldOrgX+(i-this.ldeviceOrgX)*this.lworldExtX/o),s},n.prototype.inverseTransformY=function(i){var s=0,o=this.ldeviceExtY;return o!=0&&(s=this.lworldOrgY+(i-this.ldeviceOrgY)*this.lworldExtY/o),s},n.prototype.inverseTransformPoint=function(i){var s=new a(this.inverseTransformX(i.x),this.inverseTransformY(i.y));return s},t.exports=n},function(t,e,r){"use strict";function a(c){if(Array.isArray(c)){for(var v=0,d=Array(c.length);vi.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*i.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(c-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-i.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT_INCREMENTAL):(c>i.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(i.COOLING_ADAPTATION_FACTOR,1-(c-i.ADAPTATION_LOWER_NODE_LIMIT)/(i.ADAPTATION_UPPER_NODE_LIMIT-i.ADAPTATION_LOWER_NODE_LIMIT)*(1-i.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=i.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},u.prototype.calcSpringForces=function(){for(var c=this.getAllEdges(),v,d=0;d0&&arguments[0]!==void 0?arguments[0]:!0,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d,g,m,y,p=this.getAllNodes(),b;if(this.useFRGridVariant)for(this.totalIterations%i.GRID_CALCULATION_CHECK_PERIOD==1&&c&&this.updateGrid(),b=new Set,d=0;dE||b>E)&&(c.gravitationForceX=-this.gravityConstant*m,c.gravitationForceY=-this.gravityConstant*y)):(E=v.getEstimatedSize()*this.compoundGravityRangeFactor,(p>E||b>E)&&(c.gravitationForceX=-this.gravityConstant*m*this.compoundGravityConstant,c.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},u.prototype.isConverged=function(){var c,v=!1;return this.totalIterations>this.maxIterations/3&&(v=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),c=this.totalDisplacement=p.length||E>=p[0].length)){for(var S=0;Su},"_defaultCompareFunction")}]),o}();t.exports=s},function(t,e,r){"use strict";var a=function(){function s(o,l){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:1,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;n(this,s),this.sequence1=o,this.sequence2=l,this.match_score=u,this.mismatch_penalty=h,this.gap_penalty=c,this.iMax=o.length+1,this.jMax=l.length+1,this.grid=new Array(this.iMax);for(var v=0;v=0;o--){var l=this.listeners[o];l.event===i&&l.callback===s&&this.listeners.splice(o,1)}},n.emit=function(i,s){for(var o=0;o{"use strict";f(function(e,r){typeof Ba=="object"&&typeof Yi=="object"?Yi.exports=r(Ui()):typeof define=="function"&&define.amd?define(["layout-base"],r):typeof Ba=="object"?Ba.coseBase=r(Ui()):e.coseBase=r(e.layoutBase)},"webpackUniversalModuleDefinition")(Ba,function(t){return function(e){var r={};function a(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return f(a,"__webpack_require__"),a.m=e,a.c=r,a.i=function(n){return n},a.d=function(n,i,s){a.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:s})},a.n=function(n){var i=n&&n.__esModule?f(function(){return n.default},"getDefault"):f(function(){return n},"getModuleExports");return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=7)}([function(e,r){e.exports=t},function(e,r,a){"use strict";var n=a(0).FDLayoutConstants;function i(){}f(i,"CoSEConstants");for(var s in n)i[s]=n[s];i.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,i.DEFAULT_RADIAL_SEPARATION=n.DEFAULT_EDGE_LENGTH,i.DEFAULT_COMPONENT_SEPERATION=60,i.TILE=!0,i.TILING_PADDING_VERTICAL=10,i.TILING_PADDING_HORIZONTAL=10,i.TREE_REDUCTION_ON_INCREMENTAL=!1,e.exports=i},function(e,r,a){"use strict";var n=a(0).FDLayoutEdge;function i(o,l,u){n.call(this,o,l,u)}f(i,"CoSEEdge"),i.prototype=Object.create(n.prototype);for(var s in n)i[s]=n[s];e.exports=i},function(e,r,a){"use strict";var n=a(0).LGraph;function i(o,l,u){n.call(this,o,l,u)}f(i,"CoSEGraph"),i.prototype=Object.create(n.prototype);for(var s in n)i[s]=n[s];e.exports=i},function(e,r,a){"use strict";var n=a(0).LGraphManager;function i(o){n.call(this,o)}f(i,"CoSEGraphManager"),i.prototype=Object.create(n.prototype);for(var s in n)i[s]=n[s];e.exports=i},function(e,r,a){"use strict";var n=a(0).FDLayoutNode,i=a(0).IMath;function s(l,u,h,c){n.call(this,l,u,h,c)}f(s,"CoSENode"),s.prototype=Object.create(n.prototype);for(var o in n)s[o]=n[o];s.prototype.move=function(){var l=this.graphManager.getLayout();this.displacementX=l.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=l.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>l.coolingFactor*l.maxNodeDisplacement&&(this.displacementX=l.coolingFactor*l.maxNodeDisplacement*i.sign(this.displacementX)),Math.abs(this.displacementY)>l.coolingFactor*l.maxNodeDisplacement&&(this.displacementY=l.coolingFactor*l.maxNodeDisplacement*i.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),l.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},s.prototype.propogateDisplacementToChildren=function(l,u){for(var h=this.getChild().getNodes(),c,v=0;v0)this.positionNodesRadially(w);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var x=new Set(this.getAllNodes()),T=this.nodesWithGravity.filter(function(C){return x.has(C)});this.graphManager.setAllNodesToApplyGravitation(T),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},E.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%h.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 w=new Set(this.getAllNodes()),x=this.nodesWithGravity.filter(function(D){return w.has(D)});this.graphManager.setAllNodesToApplyGravitation(x),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=h.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=h.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var T=!this.isTreeGrowing&&!this.isGrowthFinished,C=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(T,C),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var w=this.graphManager.getAllNodes(),x={},T=0;T1){var A;for(A=0;AC&&(C=Math.floor(O.y)),L=Math.floor(O.x+u.DEFAULT_COMPONENT_SEPERATION)}this.transform(new d(c.WORLD_CENTER_X-O.x/2,c.WORLD_CENTER_Y-O.y/2))},E.radialLayout=function(w,x,T){var C=Math.max(this.maxDiagonalInTree(w),u.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(x,null,0,359,0,C);var D=p.calculateBounds(w),L=new b;L.setDeviceOrgX(D.getMinX()),L.setDeviceOrgY(D.getMinY()),L.setWorldOrgX(T.x),L.setWorldOrgY(T.y);for(var O=0;O1;){var $=G[0];G.splice(0,1);var j=k.indexOf($);j>=0&&k.splice(j,1),U--,B--}x!=null?V=(k.indexOf(G[0])+1)%U:V=0;for(var Q=Math.abs(C-T)/B,H=V;F!=B;H=++H%U){var te=k[H].getOtherEnd(w);if(te!=x){var _=(T+F*Q)%360,z=(_+Q)%360;E.branchRadialLayout(te,w,_,z,D+L,L),F++}}},E.maxDiagonalInTree=function(w){for(var x=m.MIN_VALUE,T=0;Tx&&(x=D)}return x},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var w=this,x={};this.memberGroups={},this.idToDummyNode={};for(var T=[],C=this.graphManager.getAllNodes(),D=0;D"u"&&(x[A]=[]),x[A]=x[A].concat(L)}Object.keys(x).forEach(function(I){if(x[I].length>1){var M="DummyCompound_"+I;w.memberGroups[M]=x[I];var P=x[I][0].getParent(),R=new o(w.graphManager);R.id=M,R.paddingLeft=P.paddingLeft||0,R.paddingRight=P.paddingRight||0,R.paddingBottom=P.paddingBottom||0,R.paddingTop=P.paddingTop||0,w.idToDummyNode[M]=R;var k=w.getGraphManager().add(w.newGraph(),R),B=P.getChild();B.add(R);for(var F=0;F=0;w--){var x=this.compoundOrder[w],T=x.id,C=x.paddingLeft,D=x.paddingTop;this.adjustLocations(this.tiledMemberPack[T],x.rect.x,x.rect.y,C,D)}},E.prototype.repopulateZeroDegreeMembers=function(){var w=this,x=this.tiledZeroDegreePack;Object.keys(x).forEach(function(T){var C=w.idToDummyNode[T],D=C.paddingLeft,L=C.paddingTop;w.adjustLocations(x[T],C.rect.x,C.rect.y,D,L)})},E.prototype.getToBeTiled=function(w){var x=w.id;if(this.toBeTiled[x]!=null)return this.toBeTiled[x];var T=w.getChild();if(T==null)return this.toBeTiled[x]=!1,!1;for(var C=T.getNodes(),D=0;D0)return this.toBeTiled[x]=!1,!1;if(L.getChild()==null){this.toBeTiled[L.id]=!1;continue}if(!this.getToBeTiled(L))return this.toBeTiled[x]=!1,!1}return this.toBeTiled[x]=!0,!0},E.prototype.getNodeDegree=function(w){for(var x=w.id,T=w.getEdges(),C=0,D=0;DI&&(I=P.rect.height)}T+=I+w.verticalPadding}},E.prototype.tileCompoundMembers=function(w,x){var T=this;this.tiledMemberPack=[],Object.keys(w).forEach(function(C){var D=x[C];T.tiledMemberPack[C]=T.tileNodes(w[C],D.paddingLeft+D.paddingRight),D.rect.width=T.tiledMemberPack[C].width,D.rect.height=T.tiledMemberPack[C].height})},E.prototype.tileNodes=function(w,x){var T=u.TILING_PADDING_VERTICAL,C=u.TILING_PADDING_HORIZONTAL,D={rows:[],rowWidth:[],rowHeight:[],width:0,height:x,verticalPadding:T,horizontalPadding:C};w.sort(function(A,I){return A.rect.width*A.rect.height>I.rect.width*I.rect.height?-1:A.rect.width*A.rect.height0&&(O+=w.horizontalPadding),w.rowWidth[T]=O,w.width0&&(A+=w.verticalPadding);var I=0;A>w.rowHeight[T]&&(I=w.rowHeight[T],w.rowHeight[T]=A,I=w.rowHeight[T]-I),w.height+=I,w.rows[T].push(x)},E.prototype.getShortestRowIndex=function(w){for(var x=-1,T=Number.MAX_VALUE,C=0;CT&&(x=C,T=w.rowWidth[C]);return x},E.prototype.canAddHorizontal=function(w,x,T){var C=this.getShortestRowIndex(w);if(C<0)return!0;var D=w.rowWidth[C];if(D+w.horizontalPadding+x<=w.width)return!0;var L=0;w.rowHeight[C]0&&(L=T+w.verticalPadding-w.rowHeight[C]);var O;w.width-D>=x+w.horizontalPadding?O=(w.height+L)/(D+x+w.horizontalPadding):O=(w.height+L)/w.width,L=T+w.verticalPadding;var A;return w.widthL&&x!=T){C.splice(-1,1),w.rows[T].push(D),w.rowWidth[x]=w.rowWidth[x]-L,w.rowWidth[T]=w.rowWidth[T]+L,w.width=w.rowWidth[instance.getLongestRowIndex(w)];for(var O=Number.MIN_VALUE,A=0;AO&&(O=C[A].height);x>0&&(O+=w.verticalPadding);var I=w.rowHeight[x]+w.rowHeight[T];w.rowHeight[x]=O,w.rowHeight[T]0)for(var B=D;B<=L;B++)k[0]+=this.grid[B][O-1].length+this.grid[B][O].length-1;if(L0)for(var B=O;B<=A;B++)k[3]+=this.grid[D-1][B].length+this.grid[D][B].length-1;for(var F=m.MAX_VALUE,U,V,G=0;G{"use strict";f(function(e,r){typeof Fa=="object"&&typeof _i=="object"?_i.exports=r($i()):typeof define=="function"&&define.amd?define(["cose-base"],r):typeof Fa=="object"?Fa.cytoscapeCoseBilkent=r($i()):e.cytoscapeCoseBilkent=r(e.coseBase)},"webpackUniversalModuleDefinition")(Fa,function(t){return function(e){var r={};function a(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return f(a,"__webpack_require__"),a.m=e,a.c=r,a.i=function(n){return n},a.d=function(n,i,s){a.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:s})},a.n=function(n){var i=n&&n.__esModule?f(function(){return n.default},"getDefault"):f(function(){return n},"getModuleExports");return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=1)}([function(e,r){e.exports=t},function(e,r,a){"use strict";var n=a(0).layoutBase.LayoutConstants,i=a(0).layoutBase.FDLayoutConstants,s=a(0).CoSEConstants,o=a(0).CoSELayout,l=a(0).CoSENode,u=a(0).layoutBase.PointD,h=a(0).layoutBase.DimensionD,c={ready:f(function(){},"ready"),stop:f(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function v(y,p){var b={};for(var E in y)b[E]=y[E];for(var E in p)b[E]=p[E];return b}f(v,"extend");function d(y){this.options=v(c,y),g(this.options)}f(d,"_CoSELayout");var g=f(function(p){p.nodeRepulsion!=null&&(s.DEFAULT_REPULSION_STRENGTH=i.DEFAULT_REPULSION_STRENGTH=p.nodeRepulsion),p.idealEdgeLength!=null&&(s.DEFAULT_EDGE_LENGTH=i.DEFAULT_EDGE_LENGTH=p.idealEdgeLength),p.edgeElasticity!=null&&(s.DEFAULT_SPRING_STRENGTH=i.DEFAULT_SPRING_STRENGTH=p.edgeElasticity),p.nestingFactor!=null&&(s.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=i.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=p.nestingFactor),p.gravity!=null&&(s.DEFAULT_GRAVITY_STRENGTH=i.DEFAULT_GRAVITY_STRENGTH=p.gravity),p.numIter!=null&&(s.MAX_ITERATIONS=i.MAX_ITERATIONS=p.numIter),p.gravityRange!=null&&(s.DEFAULT_GRAVITY_RANGE_FACTOR=i.DEFAULT_GRAVITY_RANGE_FACTOR=p.gravityRange),p.gravityCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_STRENGTH=i.DEFAULT_COMPOUND_GRAVITY_STRENGTH=p.gravityCompound),p.gravityRangeCompound!=null&&(s.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=i.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=p.gravityRangeCompound),p.initialEnergyOnIncremental!=null&&(s.DEFAULT_COOLING_FACTOR_INCREMENTAL=i.DEFAULT_COOLING_FACTOR_INCREMENTAL=p.initialEnergyOnIncremental),p.quality=="draft"?n.QUALITY=0:p.quality=="proof"?n.QUALITY=2:n.QUALITY=1,s.NODE_DIMENSIONS_INCLUDE_LABELS=i.NODE_DIMENSIONS_INCLUDE_LABELS=n.NODE_DIMENSIONS_INCLUDE_LABELS=p.nodeDimensionsIncludeLabels,s.DEFAULT_INCREMENTAL=i.DEFAULT_INCREMENTAL=n.DEFAULT_INCREMENTAL=!p.randomize,s.ANIMATE=i.ANIMATE=n.ANIMATE=p.animate,s.TILE=p.tile,s.TILING_PADDING_VERTICAL=typeof p.tilingPaddingVertical=="function"?p.tilingPaddingVertical.call():p.tilingPaddingVertical,s.TILING_PADDING_HORIZONTAL=typeof p.tilingPaddingHorizontal=="function"?p.tilingPaddingHorizontal.call():p.tilingPaddingHorizontal},"getUserOptions");d.prototype.run=function(){var y,p,b=this.options,E=this.idToLNode={},S=this.layout=new o,w=this;w.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var x=S.newGraphManager();this.gm=x;var T=this.options.eles.nodes(),C=this.options.eles.edges();this.root=x.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(T),S);for(var D=0;D0){var A;A=b.getGraphManager().add(b.newGraph(),T),this.processChildrenList(A,x,b)}}},d.prototype.stop=function(){return this.stopped=!0,this};var m=f(function(p){p("layout","cose-bilkent",d)},"register");typeof cytoscape<"u"&&m(cytoscape),e.exports=m}])})});var zn=function(){var t=f(function(S,w,x,T){for(x=x||{},T=S.length;T--;x[S[T]]=w);return x},"o"),e=[1,4],r=[1,13],a=[1,12],n=[1,15],i=[1,16],s=[1,20],o=[1,19],l=[6,7,8],u=[1,26],h=[1,24],c=[1,25],v=[6,7,11],d=[1,6,13,15,16,19,22],g=[1,33],m=[1,34],y=[1,6,7,11,13,15,16,19,22],p={trace:f(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:f(function(w,x,T,C,D,L,O){var A=L.length-1;switch(D){case 6:case 7:return C;case 8:C.getLogger().trace("Stop NL ");break;case 9:C.getLogger().trace("Stop EOF ");break;case 11:C.getLogger().trace("Stop NL2 ");break;case 12:C.getLogger().trace("Stop EOF2 ");break;case 15:C.getLogger().info("Node: ",L[A].id),C.addNode(L[A-1].length,L[A].id,L[A].descr,L[A].type);break;case 16:C.getLogger().trace("Icon: ",L[A]),C.decorateNode({icon:L[A]});break;case 17:case 21:C.decorateNode({class:L[A]});break;case 18:C.getLogger().trace("SPACELIST");break;case 19:C.getLogger().trace("Node: ",L[A].id),C.addNode(0,L[A].id,L[A].descr,L[A].type);break;case 20:C.decorateNode({icon:L[A]});break;case 25:C.getLogger().trace("node found ..",L[A-2]),this.$={id:L[A-1],descr:L[A-1],type:C.getType(L[A-2],L[A])};break;case 26:this.$={id:L[A],descr:L[A],type:C.nodeType.DEFAULT};break;case 27:C.getLogger().trace("node found ..",L[A-3]),this.$={id:L[A-3],descr:L[A-1],type:C.getType(L[A-2],L[A])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},{6:r,9:22,12:11,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},{6:u,7:h,10:23,11:c},t(v,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:o}),t(v,[2,18]),t(v,[2,19]),t(v,[2,20]),t(v,[2,21]),t(v,[2,23]),t(v,[2,24]),t(v,[2,26],{19:[1,30]}),{20:[1,31]},{6:u,7:h,10:32,11:c},{1:[2,7],6:r,12:21,13:a,14:14,15:n,16:i,17:17,18:18,19:s,22:o},t(d,[2,14],{7:g,11:m}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(v,[2,15]),t(v,[2,16]),t(v,[2,17]),{20:[1,35]},{21:[1,36]},t(d,[2,13],{7:g,11:m}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(v,[2,25]),t(v,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:f(function(w,x){if(x.recoverable)this.trace(w);else{var T=new Error(w);throw T.hash=x,T}},"parseError"),parse:f(function(w){var x=this,T=[0],C=[],D=[null],L=[],O=this.table,A="",I=0,M=0,P=0,R=2,k=1,B=L.slice.call(arguments,1),F=Object.create(this.lexer),U={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(U.yy[V]=this.yy[V]);F.setInput(w,U.yy),U.yy.lexer=F,U.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var G=F.yylloc;L.push(G);var $=F.options&&F.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function j(ue){T.length=T.length-2*ue,D.length=D.length-ue,L.length=L.length-ue}f(j,"popStack");function Q(){var ue;return ue=C.pop()||F.lex()||k,typeof ue!="number"&&(ue instanceof Array&&(C=ue,ue=C.pop()),ue=x.symbols_[ue]||ue),ue}f(Q,"lex");for(var H,te,_,z,Z,K,ie={},de,re,se,le;;){if(_=T[T.length-1],this.defaultActions[_]?z=this.defaultActions[_]:((H===null||typeof H>"u")&&(H=Q()),z=O[_]&&O[_][H]),typeof z>"u"||!z.length||!z[0]){var ce="";le=[];for(de in O[_])this.terminals_[de]&&de>R&&le.push("'"+this.terminals_[de]+"'");F.showPosition?ce="Parse error on line "+(I+1)+`:
`+F.showPosition()+`
Expecting `+le.join(", ")+", got '"+(this.terminals_[H]||H)+"'":ce="Parse error on line "+(I+1)+": Unexpected "+(H==k?"end of input":"'"+(this.terminals_[H]||H)+"'"),this.parseError(ce,{text:F.match,token:this.terminals_[H]||H,line:F.yylineno,loc:G,expected:le})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+H);switch(z[0]){case 1:T.push(H),D.push(F.yytext),L.push(F.yylloc),T.push(z[1]),H=null,te?(H=te,te=null):(M=F.yyleng,A=F.yytext,I=F.yylineno,G=F.yylloc,P>0&&P--);break;case 2:if(re=this.productions_[z[1]][1],ie.$=D[D.length-re],ie._$={first_line:L[L.length-(re||1)].first_line,last_line:L[L.length-1].last_line,first_column:L[L.length-(re||1)].first_column,last_column:L[L.length-1].last_column},$&&(ie._$.range=[L[L.length-(re||1)].range[0],L[L.length-1].range[1]]),K=this.performAction.apply(ie,[A,M,I,U.yy,z[1],D,L].concat(B)),typeof K<"u")return K;re&&(T=T.slice(0,-1*re*2),D=D.slice(0,-1*re),L=L.slice(0,-1*re)),T.push(this.productions_[z[1]][0]),D.push(ie.$),L.push(ie._$),se=O[T[T.length-2]][T[T.length-1]],T.push(se);break;case 3:return!0}}return!0},"parse")},b=function(){var S={EOF:1,parseError:f(function(x,T){if(this.yy.parser)this.yy.parser.parseError(x,T);else throw new Error(x)},"parseError"),setInput:f(function(w,x){return this.yy=x||this.yy||{},this._input=w,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:f(function(){var w=this._input[0];this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w;var x=w.match(/(?:\r\n?|\n).*/g);return x?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:f(function(w){var x=w.length,T=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-x),this.offset-=x;var C=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),T.length-1&&(this.yylineno-=T.length-1);var D=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:T?(T.length===C.length?this.yylloc.first_column:0)+C[C.length-T.length].length-T[0].length:this.yylloc.first_column-x},this.options.ranges&&(this.yylloc.range=[D[0],D[0]+this.yyleng-x]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(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:f(function(w){this.unput(this.match.slice(w))},"less"),pastInput:f(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var w=this.pastInput(),x=new Array(w.length+1).join("-");return w+this.upcomingInput()+`
`+x+"^"},"showPosition"),test_match:f(function(w,x){var T,C,D;if(this.options.backtrack_lexer&&(D={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&&(D.yylloc.range=this.yylloc.range.slice(0))),C=w[0].match(/(?:\r\n?|\n).*/g),C&&(this.yylineno+=C.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:C?C[C.length-1].length-C[C.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+w[0].length},this.yytext+=w[0],this.match+=w[0],this.matches=w,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(w[0].length),this.matched+=w[0],T=this.performAction.call(this,this.yy,this,x,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),T)return T;if(this._backtrack){for(var L in D)this[L]=D[L];return!1}return!1},"test_match"),next:f(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var w,x,T,C;this._more||(this.yytext="",this.match="");for(var D=this._currentRules(),L=0;Lx[0].length)){if(x=T,C=L,this.options.backtrack_lexer){if(w=this.test_match(T,D[L]),w!==!1)return w;if(this._backtrack){x=!1;continue}else return!1}else if(!this.options.flex)break}return x?(w=this.test_match(x,D[C]),w!==!1?w:!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:f(function(){var x=this.next();return x||this.lex()},"lex"),begin:f(function(x){this.conditionStack.push(x)},"begin"),popState:f(function(){var x=this.conditionStack.length-1;return x>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:f(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:f(function(x){return x=this.conditionStack.length-1-Math.abs(x||0),x>=0?this.conditionStack[x]:"INITIAL"},"topState"),pushState:f(function(x){this.begin(x)},"pushState"),stateStackSize:f(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:f(function(x,T,C,D){var L=D;switch(C){case 0:return x.getLogger().trace("Found comment",T.yytext),6;break;case 1:return 8;case 2:this.begin("CLASS");break;case 3:return this.popState(),16;break;case 4:this.popState();break;case 5:x.getLogger().trace("Begin icon"),this.begin("ICON");break;case 6:return x.getLogger().trace("SPACELINE"),6;break;case 7:return 7;case 8:return 15;case 9:x.getLogger().trace("end icon"),this.popState();break;case 10:return x.getLogger().trace("Exploding node"),this.begin("NODE"),19;break;case 11:return x.getLogger().trace("Cloud"),this.begin("NODE"),19;break;case 12:return x.getLogger().trace("Explosion Bang"),this.begin("NODE"),19;break;case 13:return x.getLogger().trace("Cloud Bang"),this.begin("NODE"),19;break;case 14:return this.begin("NODE"),19;break;case 15:return this.begin("NODE"),19;break;case 16:return this.begin("NODE"),19;break;case 17:return this.begin("NODE"),19;break;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:x.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 25:return x.getLogger().trace("description:",T.yytext),"NODE_DESCR";break;case 26:this.popState();break;case 27:return this.popState(),x.getLogger().trace("node end ))"),"NODE_DEND";break;case 28:return this.popState(),x.getLogger().trace("node end )"),"NODE_DEND";break;case 29:return this.popState(),x.getLogger().trace("node end ...",T.yytext),"NODE_DEND";break;case 30:return this.popState(),x.getLogger().trace("node end (("),"NODE_DEND";break;case 31:return this.popState(),x.getLogger().trace("node end (-"),"NODE_DEND";break;case 32:return this.popState(),x.getLogger().trace("node end (-"),"NODE_DEND";break;case 33:return this.popState(),x.getLogger().trace("node end (("),"NODE_DEND";break;case 34:return this.popState(),x.getLogger().trace("node end (("),"NODE_DEND";break;case 35:return x.getLogger().trace("Long description:",T.yytext),20;break;case 36:return x.getLogger().trace("Long description:",T.yytext),20;break}},"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 S}();p.lexer=b;function E(){this.yy={}}return f(E,"Parser"),E.prototype=p,p.Parser=E,new E}();zn.parser=zn;var as=zn;var Lt=[],ns=0,Vn={},Cl=f(()=>{Lt=[],ns=0,Vn={}},"clear"),Dl=f(function(t){for(let e=Lt.length-1;e>=0;e--)if(Lt[e].levelLt.length>0?Lt[0]:null,"getMindmap"),Ll=f((t,e,r,a)=>{Yt.info("addNode",t,e,r,a);let n=ra(),i=n.mindmap?.padding??Sr.mindmap.padding;switch(a){case _e.ROUNDED_RECT:case _e.RECT:case _e.HEXAGON:i*=2}let s={id:ns++,nodeId:ta(e,n),level:t,descr:ta(r,n),type:a,children:[],width:n.mindmap?.maxNodeWidth??Sr.mindmap.maxNodeWidth,padding:i},o=Dl(t);if(o)o.children.push(s),Lt.push(s);else if(Lt.length===0)Lt.push(s);else throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")')},"addNode"),_e={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Al=f((t,e)=>{switch(Yt.debug("In get type",t,e),t){case"[":return _e.RECT;case"(":return e===")"?_e.ROUNDED_RECT:_e.CLOUD;case"((":return _e.CIRCLE;case")":return _e.CLOUD;case"))":return _e.BANG;case"{{":return _e.HEXAGON;default:return _e.DEFAULT}},"getType"),Ol=f((t,e)=>{Vn[t]=e},"setElementForId"),Ml=f(t=>{if(!t)return;let e=ra(),r=Lt[Lt.length-1];t.icon&&(r.icon=ta(t.icon,e)),t.class&&(r.class=ta(t.class,e))},"decorateNode"),Nl=f(t=>{switch(t){case _e.DEFAULT:return"no-border";case _e.RECT:return"rect";case _e.ROUNDED_RECT:return"rounded-rect";case _e.CIRCLE:return"circle";case _e.CLOUD:return"cloud";case _e.BANG:return"bang";case _e.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Il=f(()=>Yt,"getLogger"),kl=f(t=>Vn[t],"getElementById"),Rl={clear:Cl,addNode:Ll,getMindmap:Sl,nodeType:_e,getType:Al,setElementForId:Ol,decorateNode:Ml,type2Str:Nl,getLogger:Il,getElementById:kl},is=Rl;function qe(t){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(t)}f(qe,"_typeof");function pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}f(pi,"_classCallCheck");function ss(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,a=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[a++]}},"n"),e:f(function(l){throw l},"e"),f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i=!0,s=!1,o;return{s:f(function(){r=r.call(t)},"s"),n:f(function(){var l=r.next();return i=l.done,l},"n"),e:f(function(l){s=!0,o=l},"e"),f:f(function(){try{!i&&r.return!=null&&r.return()}finally{if(s)throw o}},"f")}}f(To,"_createForOfIteratorHelper");var He=typeof window>"u"?null:window,us=He?He.navigator:null;He&&He.document;var Gl=qe(""),Co=qe({}),zl=qe(function(){}),Vl=typeof HTMLElement>"u"?"undefined":qe(HTMLElement),Sa=f(function(e){return e&&e.instanceString&&ze(e.instanceString)?e.instanceString():null},"instanceStr"),ge=f(function(e){return e!=null&&qe(e)==Gl},"string"),ze=f(function(e){return e!=null&&qe(e)===zl},"fn"),Re=f(function(e){return!yt(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},"array"),De=f(function(e){return e!=null&&qe(e)===Co&&!Re(e)&&e.constructor===Object},"plainObject"),Ul=f(function(e){return e!=null&&qe(e)===Co},"object"),oe=f(function(e){return e!=null&&qe(e)===qe(1)&&!isNaN(e)},"number"),Yl=f(function(e){return oe(e)&&Math.floor(e)===e},"integer"),on=f(function(e){if(Vl!=="undefined")return e!=null&&e instanceof HTMLElement},"htmlElement"),yt=f(function(e){return La(e)||Do(e)},"elementOrCollection"),La=f(function(e){return Sa(e)==="collection"&&e._private.single},"element"),Do=f(function(e){return Sa(e)==="collection"&&!e._private.single},"collection"),mi=f(function(e){return Sa(e)==="core"},"core"),So=f(function(e){return Sa(e)==="stylesheet"},"stylesheet"),$l=f(function(e){return Sa(e)==="event"},"event"),rr=f(function(e){return e==null?!0:!!(e===""||e.match(/^\s+$/))},"emptyString"),_l=f(function(e){return typeof HTMLElement>"u"?!1:e instanceof HTMLElement},"domElement"),Hl=f(function(e){return De(e)&&oe(e.x1)&&oe(e.x2)&&oe(e.y1)&&oe(e.y2)},"boundingBox"),Xl=f(function(e){return Ul(e)&&ze(e.then)},"promise"),ql=f(function(){return us&&us.userAgent.match(/msie|trident|edge/i)},"ms"),ga=f(function(e,r){r||(r=f(function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return"undefined";for(var i=[],s=0;sr?1:0},"ascending"),ef=f(function(e,r){return-1*Ao(e,r)},"descending"),Ee=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments,r=1;r1&&(y-=1),y<1/6?g+(m-g)*6*y:y<1/2?m:y<2/3?g+(m-g)*(2/3-y)*6:g}f(h,"hue2rgb");var c=new RegExp("^"+Zl+"$").exec(e);if(c){if(a=parseInt(c[1]),a<0?a=(360- -1*a%360)%360:a>360&&(a=a%360),a/=360,n=parseFloat(c[2]),n<0||n>100||(n=n/100,i=parseFloat(c[3]),i<0||i>100)||(i=i/100,s=c[4],s!==void 0&&(s=parseFloat(s),s<0||s>1)))return;if(n===0)o=l=u=Math.round(i*255);else{var v=i<.5?i*(1+n):i+n-i*n,d=2*i-v;o=Math.round(255*h(d,v,a+1/3)),l=Math.round(255*h(d,v,a)),u=Math.round(255*h(d,v,a-1/3))}r=[o,l,u,s]}return r},"hsl2tuple"),af=f(function(e){var r,a=new RegExp("^"+Wl+"$").exec(e);if(a){r=[];for(var n=[],i=1;i<=3;i++){var s=a[i];if(s[s.length-1]==="%"&&(n[i]=!0),s=parseFloat(s),n[i]&&(s=s/100*255),s<0||s>255)return;r.push(Math.floor(s))}var o=n[1]||n[2]||n[3],l=n[1]&&n[2]&&n[3];if(o&&!l)return;var u=a[4];if(u!==void 0){if(u=parseFloat(u),u<0||u>1)return;r.push(u)}}return r},"rgb2tuple"),nf=f(function(e){return of[e.toLowerCase()]},"colorname2tuple"),sf=f(function(e){return(Re(e)?e:null)||nf(e)||tf(e)||af(e)||rf(e)},"color2tuple"),of={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Oo=f(function(e){for(var r=e.map,a=e.keys,n=a.length,i=0;i=e||T<0||c&&C>=i}f(y,"shouldInvoke");function p(){var x=Un();if(y(x))return b(x);o=setTimeout(p,m(x))}f(p,"timerExpired");function b(x){return o=void 0,v&&a?d(x):(a=n=void 0,s)}f(b,"trailingEdge");function E(){o!==void 0&&clearTimeout(o),u=0,a=l=n=o=void 0}f(E,"cancel");function S(){return o===void 0?s:b(Un())}f(S,"flush");function w(){var x=Un(),T=y(x);if(a=arguments,n=this,l=x,T){if(o===void 0)return g(l);if(c)return clearTimeout(o),o=setTimeout(p,e),d(l)}return o===void 0&&(o=setTimeout(p,e)),s}return f(w,"debounced"),w.cancel=E,w.flush=S,w}f(Hf,"debounce");var En=Hf,Yn=He?He.performance:null,ko=Yn&&Yn.now?function(){return Yn.now()}:function(){return Date.now()},Xf=function(){if(He){if(He.requestAnimationFrame)return function(t){He.requestAnimationFrame(t)};if(He.mozRequestAnimationFrame)return function(t){He.mozRequestAnimationFrame(t)};if(He.webkitRequestAnimationFrame)return function(t){He.webkitRequestAnimationFrame(t)};if(He.msRequestAnimationFrame)return function(t){He.msRequestAnimationFrame(t)}}return function(t){t&&setTimeout(function(){t(ko())},1e3/60)}}(),un=f(function(e){return Xf(e)},"requestAnimationFrame"),_t=ko,Ir=9261,Ro=65599,la=5381,Po=f(function(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ir,a=r,n;n=e.next(),!n.done;)a=a*Ro+n.value|0;return a},"hashIterableInts"),pa=f(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ir;return r*Ro+e|0},"hashInt"),ya=f(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:la;return(r<<5)+r+e|0},"hashIntAlt"),qf=f(function(e,r){return e*2097152+r},"combineHashes"),Zt=f(function(e){return e[0]*2097152+e[1]},"combineHashesArray"),za=f(function(e,r){return[pa(e[0],r[0]),ya(e[1],r[1])]},"hashArrays"),Wf=f(function(e,r){var a={value:0,done:!1},n=0,i=e.length,s={next:f(function(){return n=0&&!(e[n]===r&&(e.splice(n,1),a));n--);},"removeFromArray"),xi=f(function(e){e.splice(0,e.length)},"clearArray"),th=f(function(e,r){for(var a=0;a"u"?"undefined":qe(Set))!==ah?Set:nh,wn=f(function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||r===void 0||!mi(e)){Ve("An element must have a core reference and parameters set");return}var n=r.group;if(n==null&&(r.data&&r.data.source!=null&&r.data.target!=null?n="edges":n="nodes"),n!=="nodes"&&n!=="edges"){Ve("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!r.selected,selectable:r.selectable===void 0?!0:!!r.selectable,locked:!!r.locked,grabbed:!1,grabbable:r.grabbable===void 0?!0:!!r.grabbable,pannable:r.pannable===void 0?n==="edges":!!r.pannable,active:!1,classes:new $r,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null&&(i.position.x=0),i.position.y==null&&(i.position.y=0),r.renderedPosition){var s=r.renderedPosition,o=e.pan(),l=e.zoom();i.position={x:(s.x-o.x)/l,y:(s.y-o.y)/l}}var u=[];Re(r.classes)?u=r.classes:ge(r.classes)&&(u=r.classes.split(/\s+/));for(var h=0,c=u.length;hb?1:0},"defaultCmp"),h=f(function(p,b,E,S,w){var x;if(E==null&&(E=0),w==null&&(w=a),E<0)throw new Error("lo must be non-negative");for(S==null&&(S=p.length);EL;0<=L?D++:D--)C.push(D);return C}.apply(this).reverse(),T=[],S=0,w=x.length;SO;0<=O?++C:--C)A.push(s(p,E));return A},"nsmallest"),m=f(function(p,b,E,S){var w,x,T;for(S==null&&(S=a),w=p[E];E>b;){if(T=E-1>>1,x=p[T],S(w,x)<0){p[E]=x,E=T;continue}break}return p[E]=w},"_siftdown"),y=f(function(p,b,E){var S,w,x,T,C;for(E==null&&(E=a),w=p.length,C=b,x=p[b],S=2*b+1;S0;){var x=b.pop(),T=y(x),C=x.id();if(v[C]=T,T!==1/0)for(var D=x.neighborhood().intersect(g),L=0;L0)for(B.unshift(k);c[U];){var V=c[U];B.unshift(V.edge),B.unshift(V.node),F=V.node,U=F.id()}return o.spawn(B)},"pathTo")}},"dijkstra")},uh={kruskal:f(function(e){e=e||function(E){return 1};for(var r=this.byGroup(),a=r.nodes,n=r.edges,i=a.length,s=new Array(i),o=a,l=f(function(S){for(var w=0;w0;){if(w(),T++,S===h){for(var C=[],D=i,L=h,O=p[L];C.unshift(D),O!=null&&C.unshift(O),D=y[L],D!=null;)L=D.id(),O=p[L];return{found:!0,distance:c[S],path:this.spawn(C),steps:T}}d[S]=!0;for(var A=E._private.edges,I=0;IO&&(g[L]=O,b[L]=D,E[L]=w),!i){var A=D*h+C;!i&&g[A]>O&&(g[A]=O,b[A]=C,E[A]=w)}}}for(var I=0;I1&&arguments[1]!==void 0?arguments[1]:s,Oe=E(ue),Te=[],xe=Oe;;){if(xe==null)return r.spawn();var Se=b(xe),ee=Se.edge,N=Se.pred;if(Te.unshift(xe[0]),xe.same(ye)&&Te.length>0)break;ee!=null&&Te.unshift(ee),xe=N}return l.spawn(Te)},"pathTo"),x=0;x=0;h--){var c=u[h],v=c[1],d=c[2];(r[v]===o&&r[d]===l||r[v]===l&&r[d]===o)&&u.splice(h,1)}for(var g=0;gn;){var i=Math.floor(Math.random()*r.length);r=ph(i,e,r),a--}return r},"contractUntil"),yh={kargerStein:f(function(){var e=this,r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy(function(B){return B.isLoop()});var i=a.length,s=n.length,o=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2)),l=Math.floor(i/gh);if(i<2){Ve("At least 2 nodes are required for Karger-Stein algorithm");return}for(var u=[],h=0;h1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=1/0,i=r;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=-1/0,i=r;i1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=0,i=0,s=r;s1&&arguments[1]!==void 0?arguments[1]:0,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;n?e=e.slice(r,a):(a0&&e.splice(0,r));for(var o=0,l=e.length-1;l>=0;l--){var u=e[l];s?isFinite(u)||(e[l]=-1/0,o++):e.splice(l,1)}i&&e.sort(function(v,d){return v-d});var h=e.length,c=Math.floor(h/2);return h%2!==0?e[c+1+o]:(e[c-1+o]+e[c+o])/2},"median"),Th=f(function(e){return Math.PI*e/180},"deg2rad"),Va=f(function(e,r){return Math.atan2(r,e)-Math.PI/2},"getAngleFromDisp"),Ti=Math.log2||function(t){return Math.log(t)/Math.log(2)},Yo=f(function(e){return e>0?1:e<0?-1:0},"signum"),mr=f(function(e,r){return Math.sqrt(hr(e,r))},"dist"),hr=f(function(e,r){var a=r.x-e.x,n=r.y-e.y;return a*a+n*n},"sqdist"),Ch=f(function(e){for(var r=e.length,a=0,n=0;n=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},"makeBoundingBox"),Sh=f(function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},"copyBoundingBox"),Lh=f(function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},"clearBoundingBox"),Ah=f(function(e,r,a){return{x1:e.x1+r,x2:e.x2+r,y1:e.y1+a,y2:e.y2+a,w:e.w,h:e.h}},"shiftBoundingBox"),$o=f(function(e,r){e.x1=Math.min(e.x1,r.x1),e.x2=Math.max(e.x2,r.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,r.y1),e.y2=Math.max(e.y2,r.y2),e.h=e.y2-e.y1},"updateBoundingBox"),Oh=f(function(e,r,a){e.x1=Math.min(e.x1,r),e.x2=Math.max(e.x2,r),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,a),e.y2=Math.max(e.y2,a),e.h=e.y2-e.y1},"expandBoundingBoxByPoint"),Qa=f(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=r,e.x2+=r,e.y1-=r,e.y2+=r,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBox"),Ja=f(function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],a,n,i,s;if(r.length===1)a=n=i=s=r[0];else if(r.length===2)a=i=r[0],s=n=r[1];else if(r.length===4){var o=At(r,4);a=o[0],n=o[1],i=o[2],s=o[3]}return e.x1-=s,e.x2+=n,e.y1-=a,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},"expandBoundingBoxSides"),ps=f(function(e,r){e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},"assignBoundingBox"),Ci=f(function(e,r){return!(e.x1>r.x2||r.x1>e.x2||e.x2r.y2||r.y1>e.y2)},"boundingBoxesIntersect"),Vr=f(function(e,r,a){return e.x1<=r&&r<=e.x2&&e.y1<=a&&a<=e.y2},"inBoundingBox"),Mh=f(function(e,r){return Vr(e,r.x,r.y)},"pointInBoundingBox"),_o=f(function(e,r){return Vr(e,r.x1,r.y1)&&Vr(e,r.x2,r.y2)},"boundingBoxInBoundingBox"),Ho=f(function(e,r,a,n,i,s,o){var l=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"auto",u=l==="auto"?br(i,s):l,h=i/2,c=s/2;u=Math.min(u,h,c);var v=u!==h,d=u!==c,g;if(v){var m=a-h+u-o,y=n-c-o,p=a+h-u+o,b=y;if(g=jt(e,r,a,n,m,y,p,b,!1),g.length>0)return g}if(d){var E=a+h+o,S=n-c+u-o,w=E,x=n+c-u+o;if(g=jt(e,r,a,n,E,S,w,x,!1),g.length>0)return g}if(v){var T=a-h+u-o,C=n+c+o,D=a+h-u+o,L=C;if(g=jt(e,r,a,n,T,C,D,L,!1),g.length>0)return g}if(d){var O=a-h-o,A=n-c+u-o,I=O,M=n+c-u+o;if(g=jt(e,r,a,n,O,A,I,M,!1),g.length>0)return g}var P;{var R=a-h+u,k=n-c+u;if(P=fa(e,r,a,n,R,k,u+o),P.length>0&&P[0]<=R&&P[1]<=k)return[P[0],P[1]]}{var B=a+h-u,F=n-c+u;if(P=fa(e,r,a,n,B,F,u+o),P.length>0&&P[0]>=B&&P[1]<=F)return[P[0],P[1]]}{var U=a+h-u,V=n+c-u;if(P=fa(e,r,a,n,U,V,u+o),P.length>0&&P[0]>=U&&P[1]>=V)return[P[0],P[1]]}{var G=a-h+u,$=n+c-u;if(P=fa(e,r,a,n,G,$,u+o),P.length>0&&P[0]<=G&&P[1]>=$)return[P[0],P[1]]}return[]},"roundRectangleIntersectLine"),Nh=f(function(e,r,a,n,i,s,o){var l=o,u=Math.min(a,i),h=Math.max(a,i),c=Math.min(n,s),v=Math.max(n,s);return u-l<=e&&e<=h+l&&c-l<=r&&r<=v+l},"inLineVicinity"),Ih=f(function(e,r,a,n,i,s,o,l,u){var h={x1:Math.min(a,o,i)-u,x2:Math.max(a,o,i)+u,y1:Math.min(n,l,s)-u,y2:Math.max(n,l,s)+u};return!(eh.x2||rh.y2)},"inBezierVicinity"),kh=f(function(e,r,a,n){a-=n;var i=r*r-4*e*a;if(i<0)return[];var s=Math.sqrt(i),o=2*e,l=(-r+s)/o,u=(-r-s)/o;return[l,u]},"solveQuadratic"),Rh=f(function(e,r,a,n,i){var s=1e-5;e===0&&(e=s),r/=e,a/=e,n/=e;var o,l,u,h,c,v,d,g;if(l=(3*a-r*r)/9,u=-(27*n)+r*(9*a-2*(r*r)),u/=54,o=l*l*l+u*u,i[1]=0,d=r/3,o>0){c=u+Math.sqrt(o),c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3),v=u-Math.sqrt(o),v=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),i[0]=-d+c+v,d+=(c+v)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-v+c)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,o===0){g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),i[0]=-d+2*g,i[4]=i[2]=-(g+d);return}l=-l,h=l*l*l,h=Math.acos(u/Math.sqrt(h)),g=2*Math.sqrt(l),i[0]=-d+g*Math.cos(h/3),i[2]=-d+g*Math.cos((h+2*Math.PI)/3),i[4]=-d+g*Math.cos((h+4*Math.PI)/3)},"solveCubic"),Ph=f(function(e,r,a,n,i,s,o,l){var u=1*a*a-4*a*i+2*a*o+4*i*i-4*i*o+o*o+n*n-4*n*s+2*n*l+4*s*s-4*s*l+l*l,h=1*9*a*i-3*a*a-3*a*o-6*i*i+3*i*o+9*n*s-3*n*n-3*n*l-6*s*s+3*s*l,c=1*3*a*a-6*a*i+a*o-a*e+2*i*i+2*i*e-o*e+3*n*n-6*n*s+n*l-n*r+2*s*s+2*s*r-l*r,v=1*a*i-a*a+a*e-i*e+n*s-n*n+n*r-s*r,d=[];Rh(u,h,c,v,d);for(var g=1e-7,m=[],y=0;y<6;y+=2)Math.abs(d[y+1])=0&&d[y]<=1&&m.push(d[y]);m.push(1),m.push(0);for(var p=-1,b,E,S,w=0;w=0?Su?(e-i)*(e-i)+(r-s)*(r-s):h-v},"sqdistToFiniteLine"),gt=f(function(e,r,a){for(var n,i,s,o,l,u=0,h=0;h=e&&e>=s||n<=e&&e<=s)l=(e-n)/(s-n)*(o-i)+i,l>r&&u++;else continue;return u%2!==0},"pointInsidePolygonPoints"),Ht=f(function(e,r,a,n,i,s,o,l,u){var h=new Array(a.length),c;l[0]!=null?(c=Math.atan(l[1]/l[0]),l[0]<0?c=c+Math.PI/2:c=-c-Math.PI/2):c=l;for(var v=Math.cos(-c),d=Math.sin(-c),g=0;g0){var y=hn(h,-u);m=fn(y)}else m=h;return gt(e,r,m)},"pointInsidePolygon"),Fh=f(function(e,r,a,n,i,s,o,l){for(var u=new Array(a.length*2),h=0;h=0&&y<=1&&b.push(y),p>=0&&p<=1&&b.push(p),b.length===0)return[];var E=b[0]*l[0]+e,S=b[0]*l[1]+r;if(b.length>1){if(b[0]==b[1])return[E,S];var w=b[1]*l[0]+e,x=b[1]*l[1]+r;return[E,S,w,x]}else return[E,S]},"intersectLineCircle"),_n=f(function(e,r,a){return r<=e&&e<=a||a<=e&&e<=r?e:e<=r&&r<=a||a<=r&&r<=e?r:a},"midOfThree"),jt=f(function(e,r,a,n,i,s,o,l,u){var h=e-i,c=a-e,v=o-i,d=r-s,g=n-r,m=l-s,y=v*d-m*h,p=c*d-g*h,b=m*c-v*g;if(b!==0){var E=y/b,S=p/b,w=.001,x=0-w,T=1+w;return x<=E&&E<=T&&x<=S&&S<=T?[e+E*c,r+E*g]:u?[e+E*c,r+E*g]:[]}else return y===0||p===0?_n(e,a,o)===o?[o,l]:_n(e,a,i)===i?[i,s]:_n(i,o,a)===a?[a,n]:[]:[]},"finiteLinesIntersect"),Ea=f(function(e,r,a,n,i,s,o,l){var u=[],h,c=new Array(a.length),v=!0;s==null&&(v=!1);var d;if(v){for(var g=0;g0){var m=hn(c,-l);d=fn(m)}else d=c}else d=a;for(var y,p,b,E,S=0;S2){for(var g=[h[0],h[1]],m=Math.pow(g[0]-e,2)+Math.pow(g[1]-r,2),y=1;yh&&(h=S)},"set"),get:f(function(E){return u[E]},"get")},v=0;v0?R=P.edgesTo(M)[0]:R=M.edgesTo(P)[0];var k=n(R);M=M.id(),C[M]>C[A]+k&&(C[M]=C[A]+k,D.nodes.indexOf(M)<0?D.push(M):D.updateItem(M),T[M]=0,x[M]=[]),C[M]==C[A]+k&&(T[M]=T[M]+T[A],x[M].push(A))}else for(var B=0;B0;){for(var G=w.pop(),$=0;$0&&o.push(a[l]);o.length!==0&&i.push(n.collection(o))}return i},"assign"),jh=f(function(e,r){for(var a=0;a5&&arguments[5]!==void 0?arguments[5]:rc,o=n,l,u,h=0;h=2?na(e,r,a,0,ws,ac):na(e,r,a,0,Es)},"euclidean"),squaredEuclidean:f(function(e,r,a){return na(e,r,a,0,ws)},"squaredEuclidean"),manhattan:f(function(e,r,a){return na(e,r,a,0,Es)},"manhattan"),max:f(function(e,r,a){return na(e,r,a,-1/0,nc)},"max")};Ur["squared-euclidean"]=Ur.squaredEuclidean;Ur.squaredeuclidean=Ur.squaredEuclidean;function Tn(t,e,r,a,n,i){var s;return ze(t)?s=t:s=Ur[t]||Ur.euclidean,e===0&&ze(t)?s(n,i):s(e,r,a,n,i)}f(Tn,"clusteringDistance");var ic=rt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Si=f(function(e){return ic(e)},"setOptions"),cn=f(function(e,r,a,n,i){var s=i!=="kMedoids",o=s?function(c){return a[c]}:function(c){return n[c](a)},l=f(function(v){return n[v](r)},"getQ"),u=a,h=r;return Tn(e,n.length,o,l,u,h)},"getDist"),Hn=f(function(e,r,a){for(var n=a.length,i=new Array(n),s=new Array(n),o=new Array(r),l=null,u=0;ua)return!1}return!0},"haveMatricesConverged"),uc=f(function(e,r,a){for(var n=0;no&&(o=r[u][h],l=h);i[l].push(e[u])}for(var c=0;c=i.threshold||i.mode==="dendrogram"&&e.length===1)return!1;var g=r[s],m=r[n[s]],y;i.mode==="dendrogram"?y={left:g,right:m,key:g.key}:y={value:g.value.concat(m.value),key:g.key},e[g.index]=y,e.splice(m.index,1),r[g.key]=y;for(var p=0;pa[m.key][b.key]&&(l=a[m.key][b.key])):i.linkage==="max"?(l=a[g.key][b.key],a[g.key][b.key]0&&n.push(i);return n},"findExemplars"),Ls=f(function(e,r,a){for(var n=[],i=0;io&&(s=u,o=r[i*e+u])}s>0&&n.push(s)}for(var h=0;hu&&(l=h,u=c)}a[i]=s[l]}return n=Ls(e,r,a),n},"assign"),As=f(function(e){for(var r=this.cy(),a=this.nodes(),n=xc(e),i={},s=0;s=O?(A=O,O=M,I=P):M>A&&(A=M);for(var R=0;R0?1:0;T[D%n.minIterations*o+G]=$,V+=$}if(V>0&&(D>=n.minIterations-1||D==n.maxIterations-1)){for(var j=0,Q=0;Q1||x>1)&&(o=!0),c[E]=[],b.outgoers().forEach(function(C){C.isEdge()&&c[E].push(C.id())})}else v[E]=[void 0,b.target().id()]}):s.forEach(function(b){var E=b.id();if(b.isNode()){var S=b.degree(!0);S%2&&(l?u?o=!0:u=E:l=E),c[E]=[],b.connectedEdges().forEach(function(w){return c[E].push(w.id())})}else v[E]=[b.source().id(),b.target().id()]});var d={found:!1,trail:void 0};if(o)return d;if(u&&l)if(i){if(h&&u!=h)return d;h=u}else{if(h&&u!=h&&l!=h)return d;h||(h=u)}else h||(h=s[0].id());var g=f(function(E){for(var S=E,w=[E],x,T,C;c[S].length;)x=c[S].shift(),T=v[x][0],C=v[x][1],S!=C?(c[C]=c[C].filter(function(D){return D!=x}),S=C):!i&&S!=T&&(c[T]=c[T].filter(function(D){return D!=x}),S=T),w.unshift(x),w.unshift(S);return w},"walk"),m=[],y=[];for(y=g(h);y.length!=1;)c[y[0]].length==0?(m.unshift(s.getElementById(y.shift())),m.unshift(s.getElementById(y.shift()))):y=g(y.shift()).concat(y);m.unshift(s.getElementById(y.shift()));for(var p in c)if(c[p].length)return d;return d.found=!0,d.trail=this.spawn(m,!0),d},"hierholzer")},$a=f(function(){var e=this,r={},a=0,n=0,i=[],s=[],o={},l=f(function(v,d){for(var g=s.length-1,m=[],y=e.spawn();s[g].x!=v||s[g].y!=d;)m.push(s.pop().edge),g--;m.push(s.pop().edge),m.forEach(function(p){var b=p.connectedNodes().intersection(e);y.merge(p),b.forEach(function(E){var S=E.id(),w=E.connectedEdges().intersection(e);y.merge(E),r[S].cutVertex?y.merge(w.filter(function(x){return x.isLoop()})):y.merge(w)})}),i.push(y)},"buildComponent"),u=f(function c(v,d,g){v===g&&(n+=1),r[d]={id:a,low:a++,cutVertex:!1};var m=e.getElementById(d).connectedEdges().intersection(e);if(m.size()===0)i.push(e.spawn(e.getElementById(d)));else{var y,p,b,E;m.forEach(function(S){y=S.source().id(),p=S.target().id(),b=y===d?p:y,b!==g&&(E=S.id(),o[E]||(o[E]=!0,s.push({x:d,y:b,edge:S})),b in r?r[d].low=Math.min(r[d].low,r[b].id):(c(v,b,d),r[d].low=Math.min(r[d].low,r[b].low),r[d].id<=r[b].low&&(r[d].cutVertex=!0,l(d,b))))})}},"biconnectedSearch");e.forEach(function(c){if(c.isNode()){var v=c.id();v in r||(n=0,u(v,v),r[v].cutVertex=n>1)}});var h=Object.keys(r).filter(function(c){return r[c].cutVertex}).map(function(c){return e.getElementById(c)});return{cut:e.spawn(h),components:i}},"hopcroftTarjanBiconnected"),Mc={hopcroftTarjanBiconnected:$a,htbc:$a,htb:$a,hopcroftTarjanBiconnectedComponents:$a},_a=f(function(){var e=this,r={},a=0,n=[],i=[],s=e.spawn(e),o=f(function l(u){i.push(u),r[u]={index:a,low:a++,explored:!1};var h=e.getElementById(u).connectedEdges().intersection(e);if(h.forEach(function(m){var y=m.target().id();y!==u&&(y in r||l(y),r[y].explored||(r[u].low=Math.min(r[u].low,r[y].low)))}),r[u].index===r[u].low){for(var c=e.spawn();;){var v=i.pop();if(c.merge(e.getElementById(v)),r[v].low=r[u].index,r[v].explored=!0,v===u)break}var d=c.edgesWith(c),g=c.merge(d);n.push(g),s=s.difference(g)}},"stronglyConnectedSearch");return e.forEach(function(l){if(l.isNode()){var u=l.id();u in r||o(u)}}),{cut:s,components:n}},"tarjanStronglyConnected"),Nc={tarjanStronglyConnected:_a,tsc:_a,tscc:_a,tarjanStronglyConnectedComponents:_a},Jo={};[ma,oh,uh,fh,ch,dh,yh,Yh,Br,Fr,ri,tc,dc,Ec,Lc,Oc,Mc,Nc].forEach(function(t){Ee(Jo,t)});var jo=0,eu=1,tu=2,Xt=f(function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=jo,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e=="function"&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))},"api");Xt.prototype={fulfill:f(function(e){return Os(this,eu,"fulfillValue",e)},"fulfill"),reject:f(function(e){return Os(this,tu,"rejectReason",e)},"reject"),then:f(function(e,r){var a=this,n=new Xt;return a.onFulfilled.push(Ns(e,n,"fulfill")),a.onRejected.push(Ns(r,n,"reject")),ru(a),n.proxy},"then")};var Os=f(function(e,r,a,n){return e.state===jo&&(e.state=r,e[a]=n,ru(e)),e},"deliver"),ru=f(function(e){e.state===eu?Ms(e,"onFulfilled",e.fulfillValue):e.state===tu&&Ms(e,"onRejected",e.rejectReason)},"execute"),Ms=f(function(e,r,a){if(e[r].length!==0){var n=e[r];e[r]=[];var i=f(function(){for(var o=0;o0},"animatedImpl")},"animated"),clearQueue:f(function(){return f(function(){var r=this,a=r.length!==void 0,n=a?r:[r],i=this._private.cy||this;if(!i.styleEnabled())return this;for(var s=0;s-1}f(Fv,"listCacheHas");var Gv=Fv;function zv(t,e){var r=this.__data__,a=Dn(r,t);return a<0?(++this.size,r.push([t,e])):r[a][1]=e,this}f(zv,"listCacheSet");var Vv=zv;function Xr(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e-1&&t%1==0&&t0&&this.spawn(n).updateStyle().emit("class"),r},"classes"),addClass:f(function(e){return this.toggleClass(e,!0)},"addClass"),hasClass:f(function(e){var r=this[0];return r!=null&&r._private.classes.has(e)},"hasClass"),toggleClass:f(function(e,r){Re(e)||(e=e.match(/\S+/g)||[]);for(var a=this,n=r===void 0,i=[],s=0,o=a.length;s0&&this.spawn(i).updateStyle().emit("class"),a},"toggleClass"),removeClass:f(function(e){return this.toggleClass(e,!1)},"removeClass"),flashClass:f(function(e,r){var a=this;if(r==null)r=250;else if(r===0)return a;return a.addClass(e),setTimeout(function(){a.removeClass(e)},r),a},"flashClass")};ja.className=ja.classNames=ja.classes;var Ce={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:Xe,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};Ce.variable="(?:[\\w-.]|(?:\\\\"+Ce.metaChar+"))+";Ce.className="(?:[\\w-]|(?:\\\\"+Ce.metaChar+"))+";Ce.value=Ce.string+"|"+Ce.number;Ce.id=Ce.variable;(function(){var t,e,r;for(t=Ce.comparatorOp.split("|"),r=0;r=0)&&e!=="="&&(Ce.comparatorOp+="|\\!"+e)})();var Ie=f(function(){return{checks:[]}},"newQuery"),fe={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},ni=[{selector:":selected",matches:f(function(e){return e.selected()},"matches")},{selector:":unselected",matches:f(function(e){return!e.selected()},"matches")},{selector:":selectable",matches:f(function(e){return e.selectable()},"matches")},{selector:":unselectable",matches:f(function(e){return!e.selectable()},"matches")},{selector:":locked",matches:f(function(e){return e.locked()},"matches")},{selector:":unlocked",matches:f(function(e){return!e.locked()},"matches")},{selector:":visible",matches:f(function(e){return e.visible()},"matches")},{selector:":hidden",matches:f(function(e){return!e.visible()},"matches")},{selector:":transparent",matches:f(function(e){return e.transparent()},"matches")},{selector:":grabbed",matches:f(function(e){return e.grabbed()},"matches")},{selector:":free",matches:f(function(e){return!e.grabbed()},"matches")},{selector:":removed",matches:f(function(e){return e.removed()},"matches")},{selector:":inside",matches:f(function(e){return!e.removed()},"matches")},{selector:":grabbable",matches:f(function(e){return e.grabbable()},"matches")},{selector:":ungrabbable",matches:f(function(e){return!e.grabbable()},"matches")},{selector:":animated",matches:f(function(e){return e.animated()},"matches")},{selector:":unanimated",matches:f(function(e){return!e.animated()},"matches")},{selector:":parent",matches:f(function(e){return e.isParent()},"matches")},{selector:":childless",matches:f(function(e){return e.isChildless()},"matches")},{selector:":child",matches:f(function(e){return e.isChild()},"matches")},{selector:":orphan",matches:f(function(e){return e.isOrphan()},"matches")},{selector:":nonorphan",matches:f(function(e){return e.isChild()},"matches")},{selector:":compound",matches:f(function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()},"matches")},{selector:":loop",matches:f(function(e){return e.isLoop()},"matches")},{selector:":simple",matches:f(function(e){return e.isSimple()},"matches")},{selector:":active",matches:f(function(e){return e.active()},"matches")},{selector:":inactive",matches:f(function(e){return!e.active()},"matches")},{selector:":backgrounding",matches:f(function(e){return e.backgrounding()},"matches")},{selector:":nonbackgrounding",matches:f(function(e){return!e.backgrounding()},"matches")}].sort(function(t,e){return ef(t.selector,e.selector)}),_d=function(){for(var t={},e,r=0;r0&&h.edgeCount>0)return Ne("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(h.edgeCount>1)return Ne("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;h.edgeCount===1&&Ne("The selector `"+e+"` is deprecated.  Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons.  Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},"parse"),Zd=f(function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=f(function(h){return h??""},"clean"),r=f(function(h){return ge(h)?'"'+h+'"':e(h)},"cleanVal"),a=f(function(h){return" "+h+" "},"space"),n=f(function(h,c){var v=h.type,d=h.value;switch(v){case fe.GROUP:{var g=e(d);return g.substring(0,g.length-1)}case fe.DATA_COMPARE:{var m=h.field,y=h.operator;return"["+m+a(e(y))+r(d)+"]"}case fe.DATA_BOOL:{var p=h.operator,b=h.field;return"["+e(p)+b+"]"}case fe.DATA_EXIST:{var E=h.field;return"["+E+"]"}case fe.META_COMPARE:{var S=h.operator,w=h.field;return"[["+w+a(e(S))+r(d)+"]]"}case fe.STATE:return d;case fe.ID:return"#"+d;case fe.CLASS:return"."+d;case fe.PARENT:case fe.CHILD:return i(h.parent,c)+a(">")+i(h.child,c);case fe.ANCESTOR:case fe.DESCENDANT:return i(h.ancestor,c)+" "+i(h.descendant,c);case fe.COMPOUND_SPLIT:{var x=i(h.left,c),T=i(h.subject,c),C=i(h.right,c);return x+(x.length>0?" ":"")+T+C}case fe.TRUE:return""}},"checkToString"),i=f(function(h,c){return h.checks.reduce(function(v,d,g){return v+(c===h&&g===0?"$":"")+n(d,c)},"")},"queryToString"),s="",o=0;o1&&o=0&&(r=r.replace("!",""),c=!0),r.indexOf("@")>=0&&(r=r.replace("@",""),h=!0),(i||o||h)&&(l=!i&&!s?"":""+e,u=""+a),h&&(e=l=l.toLowerCase(),a=u=u.toLowerCase()),r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=e===a;break;case">":v=!0,n=e>a;break;case">=":v=!0,n=e>=a;break;case"<":v=!0,n=e0;){var h=n.shift();e(h),i.add(h.id()),o&&a(n,i,h)}return t}f(Ni,"forEachCompound");function hu(t,e,r){if(r.isParent())for(var a=r._private.children,n=0;n1&&arguments[1]!==void 0?arguments[1]:!0;return Ni(this,t,e,hu)};function cu(t,e,r){if(r.isChild()){var a=r._private.parent;e.has(a.id())||t.push(a)}}f(cu,"addParent");Yr.forEachUp=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ni(this,t,e,cu)};function ng(t,e,r){cu(t,e,r),hu(t,e,r)}f(ng,"addParentAndChildren");Yr.forEachUpAndDown=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return Ni(this,t,e,ng)};Yr.ancestors=Yr.parents;var xa,vu;xa=vu={data:Me.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Me.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Me.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Me.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Me.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Me.removeData({field:"rscratch",triggerEvent:!1}),id:f(function(){var e=this[0];if(e)return e._private.data.id},"id")};xa.attr=xa.data;xa.removeAttr=xa.removeData;var ig=vu,Ln={};function qn(t){return function(e){var r=this;if(e===void 0&&(e=!0),r.length!==0)if(r.isNode()&&!r.removed()){for(var a=0,n=r[0],i=n._private.edges,s=0;se}),minIndegree:Ar("indegree",function(t,e){return te}),minOutdegree:Ar("outdegree",function(t,e){return te})});Ee(Ln,{totalDegree:f(function(e){for(var r=0,a=this.nodes(),n=0;n0,v=c;c&&(h=h[0]);var d=v?h.position():{x:0,y:0};r!==void 0?u.position(e,r+d[e]):i!==void 0&&u.position({x:i.x+d.x,y:i.y+d.y})}else{var g=a.position(),m=o?a.parent():null,y=m&&m.length>0,p=y;y&&(m=m[0]);var b=p?m.position():{x:0,y:0};return i={x:g.x-b.x,y:g.y-b.y},e===void 0?i:i[e]}else if(!s)return;return this},"relativePosition")};Nt.modelPosition=Nt.point=Nt.position;Nt.modelPositions=Nt.points=Nt.positions;Nt.renderedPoint=Nt.renderedPosition;Nt.relativePoint=Nt.relativePosition;var sg=du,Gr,or;Gr=or={};or.renderedBoundingBox=function(t){var e=this.boundingBox(t),r=this.cy(),a=r.zoom(),n=r.pan(),i=e.x1*a+n.x,s=e.x2*a+n.x,o=e.y1*a+n.y,l=e.y2*a+n.y;return{x1:i,x2:s,y1:o,y2:l,w:s-i,h:l-o}};or.dirtyCompoundBoundsCache=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();return!e.styleEnabled()||!e.hasCompoundNodes()?this:(this.forEachUp(function(r){if(r.isParent()){var a=r._private;a.compoundBoundsClean=!1,a.bbCache=null,t||r.emitAndNotify("bounds")}}),this)};or.updateCompoundBounds=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!t&&e.batching())return this;function r(s){if(!s.isParent())return;var o=s._private,l=s.children(),u=s.pstyle("compound-sizing-wrt-labels").value==="include",h={width:{val:s.pstyle("min-width").pfValue,left:s.pstyle("min-width-bias-left"),right:s.pstyle("min-width-bias-right")},height:{val:s.pstyle("min-height").pfValue,top:s.pstyle("min-height-bias-top"),bottom:s.pstyle("min-height-bias-bottom")}},c=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),v=o.position;(c.w===0||c.h===0)&&(c={w:s.pstyle("width").pfValue,h:s.pstyle("height").pfValue},c.x1=v.x-c.w/2,c.x2=v.x+c.w/2,c.y1=v.y-c.h/2,c.y2=v.y+c.h/2);function d(D,L,O){var A=0,I=0,M=L+O;return D>0&&M>0&&(A=L/M*D,I=O/M*D),{biasDiff:A,biasComplementDiff:I}}f(d,"computeBiasValues");function g(D,L,O,A){if(O.units==="%")switch(A){case"width":return D>0?O.pfValue*D:0;case"height":return L>0?O.pfValue*L:0;case"average":return D>0&&L>0?O.pfValue*(D+L)/2:0;case"min":return D>0&&L>0?D>L?O.pfValue*L:O.pfValue*D:0;case"max":return D>0&&L>0?D>L?O.pfValue*D:O.pfValue*L:0;default:return 0}else return O.units==="px"?O.pfValue:0}f(g,"computePaddingValues");var m=h.width.left.value;h.width.left.units==="px"&&h.width.val>0&&(m=m*100/h.width.val);var y=h.width.right.value;h.width.right.units==="px"&&h.width.val>0&&(y=y*100/h.width.val);var p=h.height.top.value;h.height.top.units==="px"&&h.height.val>0&&(p=p*100/h.height.val);var b=h.height.bottom.value;h.height.bottom.units==="px"&&h.height.val>0&&(b=b*100/h.height.val);var E=d(h.width.val-c.w,m,y),S=E.biasDiff,w=E.biasComplementDiff,x=d(h.height.val-c.h,p,b),T=x.biasDiff,C=x.biasComplementDiff;o.autoPadding=g(c.w,c.h,s.pstyle("padding"),s.pstyle("padding-relative-to").value),o.autoWidth=Math.max(c.w,h.width.val),v.x=(-S+c.x1+c.x2+w)/2,o.autoHeight=Math.max(c.h,h.height.val),v.y=(-T+c.y1+c.y2+C)/2}f(r,"update");for(var a=0;ae.x2?n:e.x2,e.y1=ae.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},"updateBounds"),cr=f(function(e,r){return r==null?e:Ot(e,r.x1,r.y1,r.x2,r.y2)},"updateBoundsFromBox"),ia=f(function(e,r,a){return Mt(e,r,a)},"prefixedProperty"),Ha=f(function(e,r,a){if(!r.cy().headless()){var n=r._private,i=n.rstyle,s=i.arrowWidth/2,o=r.pstyle(a+"-arrow-shape").value,l,u;if(o!=="none"){a==="source"?(l=i.srcX,u=i.srcY):a==="target"?(l=i.tgtX,u=i.tgtY):(l=i.midX,u=i.midY);var h=n.arrowBounds=n.arrowBounds||{},c=h[a]=h[a]||{};c.x1=l-s,c.y1=u-s,c.x2=l+s,c.y2=u+s,c.w=c.x2-c.x1,c.h=c.y2-c.y1,Qa(c,1),Ot(e,c.x1,c.y1,c.x2,c.y2)}}},"updateBoundsFromArrow"),Wn=f(function(e,r,a){if(!r.cy().headless()){var n;a?n=a+"-":n="";var i=r._private,s=i.rstyle,o=r.pstyle(n+"label").strValue;if(o){var l=r.pstyle("text-halign"),u=r.pstyle("text-valign"),h=ia(s,"labelWidth",a),c=ia(s,"labelHeight",a),v=ia(s,"labelX",a),d=ia(s,"labelY",a),g=r.pstyle(n+"text-margin-x").pfValue,m=r.pstyle(n+"text-margin-y").pfValue,y=r.isEdge(),p=r.pstyle(n+"text-rotation"),b=r.pstyle("text-outline-width").pfValue,E=r.pstyle("text-border-width").pfValue,S=E/2,w=r.pstyle("text-background-padding").pfValue,x=2,T=c,C=h,D=C/2,L=T/2,O,A,I,M;if(y)O=v-D,A=v+D,I=d-L,M=d+L;else{switch(l.value){case"left":O=v-C,A=v;break;case"center":O=v-D,A=v+D;break;case"right":O=v,A=v+C;break}switch(u.value){case"top":I=d-T,M=d;break;case"center":I=d-L,M=d+L;break;case"bottom":I=d,M=d+T;break}}O+=g-Math.max(b,S)-w-x,A+=g+Math.max(b,S)+w+x,I+=m-Math.max(b,S)-w-x,M+=m+Math.max(b,S)+w+x;var P=a||"main",R=i.labelBounds,k=R[P]=R[P]||{};k.x1=O,k.y1=I,k.x2=A,k.y2=M,k.w=A-O,k.h=M-I;var B=y&&p.strValue==="autorotate",F=p.pfValue!=null&&p.pfValue!==0;if(B||F){var U=B?ia(i.rstyle,"labelAngle",a):p.pfValue,V=Math.cos(U),G=Math.sin(U),$=(O+A)/2,j=(I+M)/2;if(!y){switch(l.value){case"left":$=A;break;case"right":$=O;break}switch(u.value){case"top":j=M;break;case"bottom":j=I;break}}var Q=f(function(de,re){return de=de-$,re=re-j,{x:de*V-re*G+$,y:de*G+re*V+j}},"rotate"),H=Q(O,I),te=Q(O,M),_=Q(A,I),z=Q(A,M);O=Math.min(H.x,te.x,_.x,z.x),A=Math.max(H.x,te.x,_.x,z.x),I=Math.min(H.y,te.y,_.y,z.y),M=Math.max(H.y,te.y,_.y,z.y)}var Z=P+"Rot",K=R[Z]=R[Z]||{};K.x1=O,K.y1=I,K.x2=A,K.y2=M,K.w=A-O,K.h=M-I,Ot(e,O,I,A,M),Ot(i.labelBounds.all,O,I,A,M)}return e}},"updateBoundsFromLabel"),og=f(function(e,r){if(!r.cy().headless()){var a=r.pstyle("outline-opacity").value,n=r.pstyle("outline-width").value;if(a>0&&n>0){var i=r.pstyle("outline-offset").value,s=r.pstyle("shape").value,o=n+i,l=(e.w+o*2)/e.w,u=(e.h+o*2)/e.h,h=0,c=0;["diamond","pentagon","round-triangle"].includes(s)?(l=(e.w+o*2.4)/e.w,c=-o/3.6):["concave-hexagon","rhomboid","right-rhomboid"].includes(s)?l=(e.w+o*2.4)/e.w:s==="star"?(l=(e.w+o*2.8)/e.w,u=(e.h+o*2.6)/e.h,c=-o/3.8):s==="triangle"?(l=(e.w+o*2.8)/e.w,u=(e.h+o*2.4)/e.h,c=-o/1.4):s==="vee"&&(l=(e.w+o*4.4)/e.w,u=(e.h+o*3.8)/e.h,c=-o*.5);var v=e.h*u-e.h,d=e.w*l-e.w;if(Ja(e,[Math.ceil(v/2),Math.ceil(d/2)]),h!=0||c!==0){var g=Ah(e,h,c);$o(e,g)}}}},"updateBoundsFromOutline"),ug=f(function(e,r){var a=e._private.cy,n=a.styleEnabled(),i=a.headless(),s=pt(),o=e._private,l=e.isNode(),u=e.isEdge(),h,c,v,d,g,m,y=o.rstyle,p=l&&n?e.pstyle("bounds-expansion").pfValue:[0],b=f(function(le){return le.pstyle("display").value!=="none"},"isDisplayed"),E=!n||b(e)&&(!u||b(e.source())&&b(e.target()));if(E){var S=0,w=0;n&&r.includeOverlays&&(S=e.pstyle("overlay-opacity").value,S!==0&&(w=e.pstyle("overlay-padding").value));var x=0,T=0;n&&r.includeUnderlays&&(x=e.pstyle("underlay-opacity").value,x!==0&&(T=e.pstyle("underlay-padding").value));var C=Math.max(w,T),D=0,L=0;if(n&&(D=e.pstyle("width").pfValue,L=D/2),l&&r.includeNodes){var O=e.position();g=O.x,m=O.y;var A=e.outerWidth(),I=A/2,M=e.outerHeight(),P=M/2;h=g-I,c=g+I,v=m-P,d=m+P,Ot(s,h,v,c,d),n&&r.includeOutlines&&og(s,e)}else if(u&&r.includeEdges)if(n&&!i){var R=e.pstyle("curve-style").strValue;if(h=Math.min(y.srcX,y.midX,y.tgtX),c=Math.max(y.srcX,y.midX,y.tgtX),v=Math.min(y.srcY,y.midY,y.tgtY),d=Math.max(y.srcY,y.midY,y.tgtY),h-=L,c+=L,v-=L,d+=L,Ot(s,h,v,c,d),R==="haystack"){var k=y.haystackPts;if(k&&k.length===2){if(h=k[0].x,v=k[0].y,c=k[1].x,d=k[1].y,h>c){var B=h;h=c,c=B}if(v>d){var F=v;v=d,d=F}Ot(s,h-L,v-L,c+L,d+L)}}else if(R==="bezier"||R==="unbundled-bezier"||R.endsWith("segments")||R.endsWith("taxi")){var U;switch(R){case"bezier":case"unbundled-bezier":U=y.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":U=y.linePts;break}if(U!=null)for(var V=0;Vc){var te=h;h=c,c=te}if(v>d){var _=v;v=d,d=_}h-=L,c+=L,v-=L,d+=L,Ot(s,h,v,c,d)}if(n&&r.includeEdges&&u&&(Ha(s,e,"mid-source"),Ha(s,e,"mid-target"),Ha(s,e,"source"),Ha(s,e,"target")),n){var z=e.pstyle("ghost").value==="yes";if(z){var Z=e.pstyle("ghost-offset-x").pfValue,K=e.pstyle("ghost-offset-y").pfValue;Ot(s,s.x1+Z,s.y1+K,s.x2+Z,s.y2+K)}}var ie=o.bodyBounds=o.bodyBounds||{};ps(ie,s),Ja(ie,p),Qa(ie,1),n&&(h=s.x1,c=s.x2,v=s.y1,d=s.y2,Ot(s,h-C,v-C,c+C,d+C));var de=o.overlayBounds=o.overlayBounds||{};ps(de,s),Ja(de,p),Qa(de,1);var re=o.labelBounds=o.labelBounds||{};re.all!=null?Lh(re.all):re.all=pt(),n&&r.includeLabels&&(r.includeMainLabels&&Wn(s,e,null),u&&(r.includeSourceLabels&&Wn(s,e,"source"),r.includeTargetLabels&&Wn(s,e,"target")))}return s.x1=wt(s.x1),s.y1=wt(s.y1),s.x2=wt(s.x2),s.y2=wt(s.y2),s.w=wt(s.x2-s.x1),s.h=wt(s.y2-s.y1),s.w>0&&s.h>0&&E&&(Ja(s,p),Qa(s,1)),s},"boundingBoxImpl"),pu=f(function(e){var r=0,a=f(function(s){return(s?1:0)<0&&arguments[0]!==void 0?arguments[0]:Tg,e=arguments.length>1?arguments[1]:void 0,r=0;r=0;o--)s(o);return this};sr.removeAllListeners=function(){return this.removeListener("*")};sr.emit=sr.trigger=function(t,e,r){var a=this.listeners,n=a.length;return this.emitting++,Re(e)||(e=[e]),Cg(this,function(i,s){r!=null&&(a=[{event:s.event,type:s.type,namespace:s.namespace,callback:r}],n=a.length);for(var o=f(function(h){var c=a[h];if(c.type===s.type&&(!c.namespace||c.namespace===s.namespace||c.namespace===xg)&&i.eventMatches(i.context,c,s)){var v=[s];e!=null&&th(v,e),i.beforeEmit(i.context,c,s),c.conf&&c.conf.one&&(i.listeners=i.listeners.filter(function(m){return m!==c}));var d=i.callbackContext(i.context,c,s),g=c.callback.apply(d,v);i.afterEmit(i.context,c,s),g===!1&&(s.stopPropagation(),s.preventDefault())}},"_loop2"),l=0;l1&&!s){var o=this.length-1,l=this[o],u=l._private.data.id;this[o]=void 0,this[e]=l,i.set(u,{ele:l,index:e})}return this.length--,this},"unmergeAt"),unmergeOne:f(function(e){e=e[0];var r=this._private,a=e._private.data.id,n=r.map,i=n.get(a);if(!i)return this;var s=i.index;return this.unmergeAt(s),this},"unmergeOne"),unmerge:f(function(e){var r=this._private.cy;if(!e)return this;if(e&&ge(e)){var a=e;e=r.mutableElements().filter(a)}for(var n=0;n=0;r--){var a=this[r];e(a)&&this.unmergeAt(r)}return this},"unmergeBy"),map:f(function(e,r){for(var a=[],n=this,i=0;ia&&(a=l,n=o)}return{value:a,ele:n}},"max"),min:f(function(e,r){for(var a=1/0,n,i=this,s=0;s=0&&i"u"?"undefined":qe(Symbol))!=e&&qe(Symbol.iterator)!=e;r&&(vn[Symbol.iterator]=function(){var a=this,n={value:void 0,done:!1},i=0,s=this.length;return wo({next:f(function(){return i1&&arguments[1]!==void 0?arguments[1]:!0,a=this[0],n=a.cy();if(n.styleEnabled()&&a){this.cleanStyle();var i=a._private.style[e];return i??(r?n.style().getDefaultProperty(e):null)}},"parsedStyle"),numericStyle:f(function(e){var r=this[0];if(r.cy().styleEnabled()&&r){var a=r.pstyle(e);return a.pfValue!==void 0?a.pfValue:a.value}},"numericStyle"),numericStyleUnits:f(function(e){var r=this[0];if(r.cy().styleEnabled()&&r)return r.pstyle(e).units},"numericStyleUnits"),renderedStyle:f(function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=this[0];if(a)return r.style().getRenderedStyle(a,e)},"renderedStyle"),style:f(function(e,r){var a=this.cy();if(!a.styleEnabled())return this;var n=!1,i=a.style();if(De(e)){var s=e;i.applyBypass(this,s,n),this.emitAndNotify("style")}else if(ge(e))if(r===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,r,n),this.emitAndNotify("style");else if(e===void 0){var l=this[0];return l?i.getRawStyle(l):void 0}return this},"style"),removeStyle:f(function(e){var r=this.cy();if(!r.styleEnabled())return this;var a=!1,n=r.style(),i=this;if(e===void 0)for(var s=0;s0&&e.push(h[0]),e.push(o[0])}return this.spawn(e,!0).filter(t)},"neighborhood"),closedNeighborhood:f(function(e){return this.neighborhood().add(this).filter(e)},"closedNeighborhood"),openNeighborhood:f(function(e){return this.neighborhood(e)},"openNeighborhood")});st.neighbourhood=st.neighborhood;st.closedNeighbourhood=st.closedNeighborhood;st.openNeighbourhood=st.openNeighborhood;Ee(st,{source:xt(f(function(e){var r=this[0],a;return r&&(a=r._private.source||r.cy().collection()),a&&e?a.filter(e):a},"sourceImpl"),"source"),target:xt(f(function(e){var r=this[0],a;return r&&(a=r._private.target||r.cy().collection()),a&&e?a.filter(e):a},"targetImpl"),"target"),sources:Ws({attr:"source"}),targets:Ws({attr:"target"})});function Ws(t){return f(function(r){for(var a=[],n=0;n0);return s},"components"),component:f(function(){var e=this[0];return e.cy().mutableElements().components(e)[0]},"component")});st.componentsOf=st.components;var tt=f(function(e,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){Ve("A collection must have a reference to the core");return}var i=new Ft,s=!1;if(!r)r=[];else if(r.length>0&&De(r[0])&&!La(r[0])){s=!0;for(var o=[],l=new $r,u=0,h=r.length;u0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=r.cy(),n=a._private,i=[],s=[],o,l=0,u=r.length;l0){for(var F=o.length===r.length?r:new tt(a,o),U=0;U0&&arguments[0]!==void 0?arguments[0]:!0,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this,a=[],n={},i=r._private.cy;function s(M){for(var P=M._private.edges,R=0;R0&&(t?O.emitAndNotify("remove"):e&&O.emit("remove"));for(var A=0;A0?A=M:O=M;while(Math.abs(I)>s&&++P=i?b(L,P):R===0?P:S(L,O,O+u)}f(w,"getTForX");var x=!1;function T(){x=!0,(t!==e||r!==a)&&E()}f(T,"precompute");var C=f(function(O){return x||T(),t===e&&r===a?O:O===0?0:O===1?1:y(w(O),e,a)},"f");C.getControlPoints=function(){return[{x:t,y:e},{x:r,y:a}]};var D="generateBezier("+[t,e,r,a]+")";return C.toString=function(){return D},C}f(Rg,"generateCubicBezier");var Pg=function(){function t(a){return-a.tension*a.x-a.friction*a.v}f(t,"springAccelerationForState");function e(a,n,i){var s={x:a.x+i.dx*n,v:a.v+i.dv*n,tension:a.tension,friction:a.friction};return{dx:s.v,dv:t(s)}}f(e,"springEvaluateStateWithDerivative");function r(a,n){var i={dx:a.v,dv:t(a)},s=e(a,n*.5,i),o=e(a,n*.5,s),l=e(a,n,o),u=1/6*(i.dx+2*(s.dx+o.dx)+l.dx),h=1/6*(i.dv+2*(s.dv+o.dv)+l.dv);return a.x=a.x+u*n,a.v=a.v+h*n,a}return f(r,"springIntegrateState"),f(function a(n,i,s){var o={x:-1,v:0,tension:null,friction:null},l=[0],u=0,h=1/1e4,c=16/1e3,v,d,g;for(n=parseFloat(n)||500,i=parseFloat(i)||20,s=s||null,o.tension=n,o.friction=i,v=s!==null,v?(u=a(n,i),d=u/s*c):d=c;g=r(g||o,d),l.push(1+g.x),u+=16,Math.abs(g.x)>h&&Math.abs(g.v)>h;);return v?function(m){return l[m*(l.length-1)|0]}:u},"springRK4Factory")}(),Pe=f(function(e,r,a,n){var i=Rg(e,r,a,n);return function(s,o,l){return s+(o-s)*i(l)}},"cubicBezier"),tn={linear:f(function(e,r,a){return e+(r-e)*a},"linear"),ease:Pe(.25,.1,.25,1),"ease-in":Pe(.42,0,1,1),"ease-out":Pe(0,0,.58,1),"ease-in-out":Pe(.42,0,.58,1),"ease-in-sine":Pe(.47,0,.745,.715),"ease-out-sine":Pe(.39,.575,.565,1),"ease-in-out-sine":Pe(.445,.05,.55,.95),"ease-in-quad":Pe(.55,.085,.68,.53),"ease-out-quad":Pe(.25,.46,.45,.94),"ease-in-out-quad":Pe(.455,.03,.515,.955),"ease-in-cubic":Pe(.55,.055,.675,.19),"ease-out-cubic":Pe(.215,.61,.355,1),"ease-in-out-cubic":Pe(.645,.045,.355,1),"ease-in-quart":Pe(.895,.03,.685,.22),"ease-out-quart":Pe(.165,.84,.44,1),"ease-in-out-quart":Pe(.77,0,.175,1),"ease-in-quint":Pe(.755,.05,.855,.06),"ease-out-quint":Pe(.23,1,.32,1),"ease-in-out-quint":Pe(.86,0,.07,1),"ease-in-expo":Pe(.95,.05,.795,.035),"ease-out-expo":Pe(.19,1,.22,1),"ease-in-out-expo":Pe(1,0,0,1),"ease-in-circ":Pe(.6,.04,.98,.335),"ease-out-circ":Pe(.075,.82,.165,1),"ease-in-out-circ":Pe(.785,.135,.15,.86),spring:f(function(e,r,a){if(a===0)return tn.linear;var n=Pg(e,r,a);return function(i,s,o){return i+(s-i)*n(o)}},"spring"),"cubic-bezier":Pe};function Qs(t,e,r,a,n){if(a===1||e===r)return r;var i=n(e,r,a);return t==null||((t.roundValue||t.color)&&(i=Math.round(i)),t.min!==void 0&&(i=Math.max(i,t.min)),t.max!==void 0&&(i=Math.min(i,t.max))),i}f(Qs,"getEasedValue");function Js(t,e){return t.pfValue!=null||t.value!=null?t.pfValue!=null&&(e==null||e.type.units!=="%")?t.pfValue:t.value:t}f(Js,"getValue");function Or(t,e,r,a,n){var i=n!=null?n.type:null;r<0?r=0:r>1&&(r=1);var s=Js(t,n),o=Js(e,n);if(oe(s)&&oe(o))return Qs(i,s,o,r,a);if(Re(s)&&Re(o)){for(var l=[],u=0;u0?(d==="spring"&&g.push(s.duration),s.easingImpl=tn[d].apply(null,g)):s.easingImpl=tn[d]}var m=s.easingImpl,y;if(s.duration===0?y=1:y=(r-l)/s.duration,s.applying&&(y=s.progress),y<0?y=0:y>1&&(y=1),s.delay==null){var p=s.startPosition,b=s.position;if(b&&n&&!t.locked()){var E={};oa(p.x,b.x)&&(E.x=Or(p.x,b.x,y,m)),oa(p.y,b.y)&&(E.y=Or(p.y,b.y,y,m)),t.position(E)}var S=s.startPan,w=s.pan,x=i.pan,T=w!=null&&a;T&&(oa(S.x,w.x)&&(x.x=Or(S.x,w.x,y,m)),oa(S.y,w.y)&&(x.y=Or(S.y,w.y,y,m)),t.emit("pan"));var C=s.startZoom,D=s.zoom,L=D!=null&&a;L&&(oa(C,D)&&(i.zoom=ba(i.minZoom,Or(C,D,y,m),i.maxZoom)),t.emit("zoom")),(T||L)&&t.emit("viewport");var O=s.style;if(O&&O.length>0&&n){for(var A=0;A=0;T--){var C=x[T];C()}x.splice(0,x.length)},"callbacks"),b=d.length-1;b>=0;b--){var E=d[b],S=E._private;if(S.stopped){d.splice(b,1),S.hooked=!1,S.playing=!1,S.started=!1,p(S.frames);continue}!S.playing&&!S.applying||(S.playing&&S.applying&&(S.applying=!1),S.started||Fg(h,E,t),Bg(h,E,t,c),S.applying&&(S.applying=!1),p(S.frames),S.step!=null&&S.step(t),E.completed()&&(d.splice(b,1),S.hooked=!1,S.playing=!1,S.started=!1,p(S.completes)),m=!0)}return!c&&d.length===0&&g.length===0&&a.push(h),m}f(n,"stepOne");for(var i=!1,s=0;s0?e.notify("draw",r):e.notify("draw")),r.unmerge(a),e.emit("step")}f(js,"stepAll");var Gg={animate:Me.animate(),animation:Me.animation(),animated:Me.animated(),clearQueue:Me.clearQueue(),delay:Me.delay(),delayAnimation:Me.delayAnimation(),stop:Me.stop(),addToAnimationPool:f(function(e){var r=this;r.styleEnabled()&&r._private.aniEles.merge(e)},"addToAnimationPool"),stopAnimationLoop:f(function(){this._private.animationsRunning=!1},"stopAnimationLoop"),startAnimationLoop:f(function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function r(){e._private.animationsRunning&&un(f(function(i){js(i,e),r()},"animationStep"))}f(r,"headlessStep");var a=e.renderer();a&&a.beforeRender?a.beforeRender(f(function(i,s){js(s,e)},"rendererAnimationStep"),a.beforeRenderPriorities.animations):r()},"startAnimationLoop")},zg={qualifierCompare:f(function(e,r){return e==null||r==null?e==null&&r==null:e.sameText(r)},"qualifierCompare"),eventMatches:f(function(e,r,a){var n=r.qualifier;return n!=null?e!==a.target&&La(a.target)&&n.matches(a.target):!0},"eventMatches"),addEventFields:f(function(e,r){r.cy=e,r.target=e},"addEventFields"),callbackContext:f(function(e,r,a){return r.qualifier!=null?a.target:e},"callbackContext")},Wa=f(function(e){return ge(e)?new nr(e):e},"argSelector"),Lu={createEmitter:f(function(){var e=this._private;return e.emitter||(e.emitter=new An(zg,this)),this},"createEmitter"),emitter:f(function(){return this._private.emitter},"emitter"),on:f(function(e,r,a){return this.emitter().on(e,Wa(r),a),this},"on"),removeListener:f(function(e,r,a){return this.emitter().removeListener(e,Wa(r),a),this},"removeListener"),removeAllListeners:f(function(){return this.emitter().removeAllListeners(),this},"removeAllListeners"),one:f(function(e,r,a){return this.emitter().one(e,Wa(r),a),this},"one"),once:f(function(e,r,a){return this.emitter().one(e,Wa(r),a),this},"once"),emit:f(function(e,r){return this.emitter().emit(e,r),this},"emit"),emitAndNotify:f(function(e,r){return this.emit(e),this.notify(e,r),this},"emitAndNotify")};Me.eventAliasesOn(Lu);var si={png:f(function(e){var r=this._private.renderer;return e=e||{},r.png(e)},"png"),jpg:f(function(e){var r=this._private.renderer;return e=e||{},e.bg=e.bg||"#fff",r.jpg(e)},"jpg")};si.jpeg=si.jpg;var rn={layout:f(function(e){var r=this;if(e==null){Ve("Layout options must be specified to make a layout");return}if(e.name==null){Ve("A `name` must be specified to make a layout");return}var a=e.name,n=r.extension("layout",a);if(n==null){Ve("No such layout `"+a+"` found.  Did you forget to import it and `cytoscape.use()` it?");return}var i;ge(e.eles)?i=r.$(e.eles):i=e.eles!=null?e.eles:r.$();var s=new n(Ee({},e,{cy:r,eles:i}));return s},"layout")};rn.createLayout=rn.makeLayout=rn.layout;var Vg={notify:f(function(e,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[e]=a.batchNotifications[e]||this.collection();r!=null&&n.merge(r);return}if(a.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,r)}},"notify"),notifications:f(function(e){var r=this._private;return e===void 0?r.notificationsEnabled:(r.notificationsEnabled=!!e,this)},"notifications"),noNotifications:f(function(e){this.notifications(!1),e(),this.notifications(!0)},"noNotifications"),batching:f(function(){return this._private.batchCount>0},"batching"),startBatch:f(function(){var e=this._private;return e.batchCount==null&&(e.batchCount=0),e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},"startBatch"),endBatch:f(function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(e.batchNotifications).forEach(function(a){var n=e.batchNotifications[a];n.empty()?r.notify(a):r.notify(a,n)})}return this},"endBatch"),batch:f(function(e){return this.startBatch(),e(),this.endBatch(),this},"batch"),batchData:f(function(e){var r=this;return this.batch(function(){for(var a=Object.keys(e),n=0;n0;)r.removeChild(r.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(a){var n=a._private;n.rscratch={},n.rstyle={},n.animation.current=[],n.animation.queue=[]})},"destroyRenderer"),onRender:f(function(e){return this.on("render",e)},"onRender"),offRender:f(function(e){return this.off("render",e)},"offRender")};oi.invalidateDimensions=oi.resize;var an={collection:f(function(e,r){return ge(e)?this.$(e):yt(e)?e.collection():Re(e)?(r||(r={}),new tt(this,e,r.unique,r.removed)):new tt(this)},"collection"),nodes:f(function(e){var r=this.$(function(a){return a.isNode()});return e?r.filter(e):r},"nodes"),edges:f(function(e){var r=this.$(function(a){return a.isEdge()});return e?r.filter(e):r},"edges"),$:f(function(e){var r=this._private.elements;return e?r.filter(e):r.spawnSelf()},"$"),mutableElements:f(function(){return this._private.elements},"mutableElements")};an.elements=an.filter=an.$;var ut={},va="t",Yg="f";ut.apply=function(t){for(var e=this,r=e._private,a=r.cy,n=a.collection(),i=0;i0;if(v||c&&d){var g=void 0;v&&d||v?g=u.properties:d&&(g=u.mappedProperties);for(var m=0;m1&&(S=1),o.color){var x=a.valueMin[0],T=a.valueMax[0],C=a.valueMin[1],D=a.valueMax[1],L=a.valueMin[2],O=a.valueMax[2],A=a.valueMin[3]==null?1:a.valueMin[3],I=a.valueMax[3]==null?1:a.valueMax[3],M=[Math.round(x+(T-x)*S),Math.round(C+(D-C)*S),Math.round(L+(O-L)*S),Math.round(A+(I-A)*S)];i={bypass:a.bypass,name:a.name,value:M,strValue:"rgb("+M[0]+", "+M[1]+", "+M[2]+")"}}else if(o.number){var P=a.valueMin+(a.valueMax-a.valueMin)*S;i=this.parse(a.name,P,a.bypass,v)}else return!1;if(!i)return m(),!1;i.mapping=a,a=i;break}case s.data:{for(var R=a.field.split("."),k=c.data,B=0;B0&&i>0){for(var o={},l=!1,u=0;u0?t.delayAnimation(s).play().promise().then(E):E()}).then(function(){return t.animation({style:o,duration:i,easing:t.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){r.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1})}else a.transitioning&&(this.removeBypasses(t,n),t.emitAndNotify("style"),a.transitioning=!1)};ut.checkTrigger=function(t,e,r,a,n,i){var s=this.properties[e],o=n(s);o!=null&&o(r,a)&&i(s)};ut.checkZOrderTrigger=function(t,e,r,a){var n=this;this.checkTrigger(t,e,r,a,function(i){return i.triggersZOrder},function(){n._private.cy.notify("zorder",t)})};ut.checkBoundsTrigger=function(t,e,r,a){this.checkTrigger(t,e,r,a,function(n){return n.triggersBounds},function(n){t.dirtyCompoundBoundsCache(),t.dirtyBoundingBoxCache(),n.triggersBoundsOfParallelBeziers&&e==="curve-style"&&(r==="bezier"||a==="bezier")&&t.parallelEdges().forEach(function(i){i.isBundledBezier()&&i.dirtyBoundingBoxCache()}),n.triggersBoundsOfConnectedEdges&&e==="display"&&(r==="none"||a==="none")&&t.connectedEdges().forEach(function(i){i.dirtyBoundingBoxCache()})})};ut.checkTriggers=function(t,e,r,a){t.dirtyStyleCache(),this.checkZOrderTrigger(t,e,r,a),this.checkBoundsTrigger(t,e,r,a)};var Na={};Na.applyBypass=function(t,e,r,a){var n=this,i=[],s=!0;if(e==="*"||e==="**"){if(r!==void 0)for(var o=0;on.length?a=a.substr(n.length):a=""}f(o,"removeSelAndBlockFromRemaining");function l(){i.length>s.length?i=i.substr(s.length):i=""}for(f(l,"removePropAndValFromRem");;){var u=a.match(/^\s*$/);if(u)break;var h=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!h){Ne("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=h[0];var c=h[1];if(c!=="core"){var v=new nr(c);if(v.invalid){Ne("Skipping parsing of block: Invalid selector found in string stylesheet: "+c),o();continue}}var d=h[2],g=!1;i=d;for(var m=[];;){var y=i.match(/^\s*$/);if(y)break;var p=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!p){Ne("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d),g=!0;break}s=p[0];var b=p[1],E=p[2],S=e.properties[b];if(!S){Ne("Skipping property: Invalid property name in: "+s),l();continue}var w=r.parse(b,E);if(!w){Ne("Skipping property: Invalid property definition in: "+s),l();continue}m.push({name:b,val:E}),l()}if(g){o();break}r.selector(c);for(var x=0;x=7&&e[0]==="d"&&(h=new RegExp(o.data.regex).exec(e))){if(r)return!1;var v=o.data;return{name:t,value:h,strValue:""+e,mapped:v,field:h[1],bypass:r}}else if(e.length>=10&&e[0]==="m"&&(c=new RegExp(o.mapData.regex).exec(e))){if(r||u.multiple)return!1;var d=o.mapData;if(!(u.color||u.number))return!1;var g=this.parse(t,c[4]);if(!g||g.mapped)return!1;var m=this.parse(t,c[5]);if(!m||m.mapped)return!1;if(g.pfValue===m.pfValue||g.strValue===m.strValue)return Ne("`"+t+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+t+": "+g.strValue+"`"),this.parse(t,g.strValue);if(u.color){var y=g.value,p=m.value,b=y[0]===p[0]&&y[1]===p[1]&&y[2]===p[2]&&(y[3]===p[3]||(y[3]==null||y[3]===1)&&(p[3]==null||p[3]===1));if(b)return!1}return{name:t,value:c,strValue:""+e,mapped:d,field:c[1],fieldMin:parseFloat(c[2]),fieldMax:parseFloat(c[3]),valueMin:g.value,valueMax:m.value,bypass:r}}}if(u.multiple&&a!=="multiple"){var E;if(l?E=e.split(/\s+/):Re(e)?E=e:E=[e],u.evenMultiple&&E.length%2!==0)return null;for(var S=[],w=[],x=[],T="",C=!1,D=0;D0?" ":"")+L.strValue}return u.validate&&!u.validate(S,w)?null:u.singleEnum&&C?S.length===1&&ge(S[0])?{name:t,value:S[0],strValue:S[0],bypass:r}:null:{name:t,value:S,pfValue:x,strValue:T,bypass:r,units:w}}var O=f(function(){for(var z=0;zu.max||u.strictMax&&e===u.max))return null;var R={name:t,value:e,strValue:""+e+(A||""),units:A,bypass:r};return u.unitless||A!=="px"&&A!=="em"?R.pfValue=e:R.pfValue=A==="px"||!A?e:this.getEmSizeInPixels()*e,(A==="ms"||A==="s")&&(R.pfValue=A==="ms"?e:1e3*e),(A==="deg"||A==="rad")&&(R.pfValue=A==="rad"?e:Th(e)),A==="%"&&(R.pfValue=e/100),R}else if(u.propList){var k=[],B=""+e;if(B!=="none"){for(var F=B.split(/\s*,\s*|\s+/),U=0;U0&&o>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((s-2*r)/a.w,(o-2*r)/a.h),l=l>this._private.maxZoom?this._private.maxZoom:l,l=l=a.minZoom&&(a.maxZoom=r),this},"zoomRange"),minZoom:f(function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},"minZoom"),maxZoom:f(function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},"maxZoom"),getZoomedViewport:f(function(e){var r=this._private,a=r.pan,n=r.zoom,i,s,o=!1;if(r.zoomingEnabled||(o=!0),oe(e)?s=e:De(e)&&(s=e.level,e.position!=null?i=xn(e.position,n,a):e.renderedPosition!=null&&(i=e.renderedPosition),i!=null&&!r.panningEnabled&&(o=!0)),s=s>r.maxZoom?r.maxZoom:s,s=sr.maxZoom||!r.zoomingEnabled?s=!0:(r.zoom=l,i.push("zoom"))}if(n&&(!s||!e.cancelOnFailedZoom)&&r.panningEnabled){var u=e.pan;oe(u.x)&&(r.pan.x=u.x,o=!1),oe(u.y)&&(r.pan.y=u.y,o=!1),o||i.push("pan")}return i.length>0&&(i.push("viewport"),this.emit(i.join(" ")),this.notify("viewport")),this},"viewport"),center:f(function(e){var r=this.getCenterPan(e);return r&&(this._private.pan=r,this.emit("pan viewport"),this.notify("viewport")),this},"center"),getCenterPan:f(function(e,r){if(this._private.panningEnabled){if(ge(e)){var a=e;e=this.mutableElements().filter(a)}else yt(e)||(e=this.mutableElements());if(e.length!==0){var n=e.boundingBox(),i=this.width(),s=this.height();r=r===void 0?this._private.zoom:r;var o={x:(i-r*(n.x1+n.x2))/2,y:(s-r*(n.y1+n.y2))/2};return o}}},"getCenterPan"),reset:f(function(){return!this._private.panningEnabled||!this._private.zoomingEnabled?this:(this.viewport({pan:{x:0,y:0},zoom:1}),this)},"reset"),invalidateSize:f(function(){this._private.sizeCache=null},"invalidateSize"),size:f(function(){var e=this._private,r=e.container,a=this;return e.sizeCache=e.sizeCache||(r?function(){var n=a.window().getComputedStyle(r),i=f(function(o){return parseFloat(n.getPropertyValue(o))},"val");return{width:r.clientWidth-i("padding-left")-i("padding-right"),height:r.clientHeight-i("padding-top")-i("padding-bottom")}}():{width:1,height:1})},"size"),width:f(function(){return this.size().width},"width"),height:f(function(){return this.size().height},"height"),extent:f(function(){var e=this._private.pan,r=this._private.zoom,a=this.renderedExtent(),n={x1:(a.x1-e.x)/r,x2:(a.x2-e.x)/r,y1:(a.y1-e.y)/r,y2:(a.y2-e.y)/r};return n.w=n.x2-n.x1,n.h=n.y2-n.y1,n},"extent"),renderedExtent:f(function(){var e=this.width(),r=this.height();return{x1:0,y1:0,x2:e,y2:r,w:e,h:r}},"renderedExtent"),multiClickDebounceTime:f(function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this},"multiClickDebounceTime")};wr.centre=wr.center;wr.autolockNodes=wr.autolock;wr.autoungrabifyNodes=wr.autoungrabify;var Ca={data:Me.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Me.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Me.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Me.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Ca.attr=Ca.data;Ca.removeAttr=Ca.removeData;var Da=f(function(e){var r=this;e=Ee({},e);var a=e.container;a&&!on(a)&&on(a[0])&&(a=a[0]);var n=a?a._cyreg:null;n=n||{},n&&n.cy&&(n.cy.destroy(),n={});var i=n.readies=n.readies||[];a&&(a._cyreg=n),n.cy=r;var s=He!==void 0&&a!==void 0&&!e.headless,o=e;o.layout=Ee({name:s?"grid":"null"},o.layout),o.renderer=Ee({name:s?"canvas":"null"},o.renderer);var l=f(function(g,m,y){return m!==void 0?m:y!==void 0?y:g},"defVal"),u=this._private={container:a,ready:!1,options:o,elements:new tt(this),listeners:[],aniEles:new tt(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,o.zoomingEnabled),userZoomingEnabled:l(!0,o.userZoomingEnabled),panningEnabled:l(!0,o.panningEnabled),userPanningEnabled:l(!0,o.userPanningEnabled),boxSelectionEnabled:l(!0,o.boxSelectionEnabled),autolock:l(!1,o.autolock,o.autolockNodes),autoungrabify:l(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:l(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?s:o.styleEnabled,zoom:oe(o.zoom)?o.zoom:1,pan:{x:De(o.pan)&&oe(o.pan.x)?o.pan.x:0,y:De(o.pan)&&oe(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var h=f(function(g,m){var y=g.some(Xl);if(y)return _r.all(g).then(m);m(g)},"loadExtData");u.styleEnabled&&r.setStyle([]);var c=Ee({},o,o.renderer);r.initRenderer(c);var v=f(function(g,m,y){r.notifications(!1);var p=r.mutableElements();p.length>0&&p.remove(),g!=null&&(De(g)||Re(g))&&r.add(g),r.one("layoutready",function(E){r.notifications(!0),r.emit(E),r.one("load",m),r.emitAndNotify("load")}).one("layoutstop",function(){r.one("done",y),r.emit("done")});var b=Ee({},r._private.options.layout);b.eles=r.elements(),r.layout(b).run()},"setElesAndLayout");h([o.style,o.elements],function(d){var g=d[0],m=d[1];u.styleEnabled&&r.style().append(g),v(m,function(){r.startAnimationLoop(),u.ready=!0,ze(o.ready)&&r.on("ready",o.ready);for(var y=0;y0,l=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),u;if(yt(e.roots))u=e.roots;else if(Re(e.roots)){for(var h=[],c=0;c0;){var P=M(),R=L(P,A);if(R)P.outgoers().filter(function(re){return re.isNode()&&a.has(re)}).forEach(I);else if(R===null){Ne("Detected double maximal shift for node `"+P.id()+"`.  Bailing maximal adjustment due to cycle.  Use `options.maximal: true` only on DAGs.");break}}}D();var k=0;if(e.avoidOverlap)for(var B=0;B0&&p[0].length<=3?xe/2:0),N=2*Math.PI/p[ce].length*ue;return ce===0&&p[0].length===1&&(ee=1),{x:K.x+ee*Math.cos(N),y:K.y+ee*Math.sin(N)}}else{var Se={x:K.x+(ue+1-(ye+1)/2)*Oe,y:(ce+1)*Te};return Se}},"getPosition");return a.nodes().layoutPositions(this,e,de),this};var qg={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:f(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:f(function(e,r){return r},"transform")};function Ou(t){this.options=Ee({},qg,t)}f(Ou,"CircleLayout");Ou.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,i=a.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));for(var s=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=e.sweep===void 0?2*Math.PI-2*Math.PI/i.length:e.sweep,u=l/Math.max(1,i.length-1),h,c=0,v=0;v1&&e.avoidOverlap){c*=1.75;var p=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),E=Math.sqrt(c*c/(p*p+b*b));h=Math.max(E,h)}var S=f(function(x,T){var C=e.startAngle+T*u*(n?1:-1),D=h*Math.cos(C),L=h*Math.sin(C),O={x:o.x+D,y:o.y+L};return O},"getPos");return a.nodes().layoutPositions(this,e,S),this};var Wg={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:f(function(e){return e.degree()},"concentric"),levelWidth:f(function(e){return e.maxDegree()/4},"levelWidth"),animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:f(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:f(function(e,r){return r},"transform")};function Mu(t){this.options=Ee({},Wg,t)}f(Mu,"ConcentricLayout");Mu.prototype.run=function(){for(var t=this.options,e=t,r=e.counterclockwise!==void 0?!e.counterclockwise:e.clockwise,a=t.cy,n=e.eles,i=n.nodes().not(":parent"),s=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()}),o={x:s.x1+s.w/2,y:s.y1+s.h/2},l=[],u=0,h=0;h0){var w=Math.abs(b[0].value-S.value);w>=y&&(b=[],p.push(b))}b.push(S)}var x=u+e.minNodeSpacing;if(!e.avoidOverlap){var T=p.length>0&&p[0].length>1,C=Math.min(s.w,s.h)/2-x,D=C/(p.length+T?1:0);x=Math.min(x,D)}for(var L=0,O=0;O1&&e.avoidOverlap){var P=Math.cos(M)-Math.cos(0),R=Math.sin(M)-Math.sin(0),k=Math.sqrt(x*x/(P*P+R*R));L=Math.max(k,L)}A.r=L,L+=x}if(e.equidistant){for(var B=0,F=0,U=0;U=t.numIter||(rp(a,t),a.temperature=a.temperature*t.coolingFactor,a.temperature=t.animationThreshold&&i(),un(c)}},"frame");h()}else{for(;u;)u=s(l),l++;ro(a,t),o()}return this};kn.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this};kn.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var Zg=f(function(e,r,a){for(var n=a.eles.edges(),i=a.eles.nodes(),s=pt(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:s.w,clientHeight:s.h,boundingBox:s},l=a.eles.components(),u={},h=0;h0){o.graphSet.push(C);for(var h=0;hn.count?0:n.graph},"findLCA"),Jg=f(function t(e,r,a,n){var i=n.graphSet[a];if(-10)var c=n.nodeOverlap*h,v=Math.sqrt(o*o+l*l),d=c*o/v,g=c*l/v;else var m=gn(e,o,l),y=gn(r,-1*o,-1*l),p=y.x-m.x,b=y.y-m.y,E=p*p+b*b,v=Math.sqrt(E),c=(e.nodeRepulsion+r.nodeRepulsion)/E,d=c*p/v,g=c*b/v;e.isLocked||(e.offsetX-=d,e.offsetY-=g),r.isLocked||(r.offsetX+=d,r.offsetY+=g)}},"nodeRepulsion"),ip=f(function(e,r,a,n){if(a>0)var i=e.maxX-r.minX;else var i=r.maxX-e.minX;if(n>0)var s=e.maxY-r.minY;else var s=r.maxY-e.minY;return i>=0&&s>=0?Math.sqrt(i*i+s*s):0},"nodesOverlap"),gn=f(function(e,r,a){var n=e.positionX,i=e.positionY,s=e.height||1,o=e.width||1,l=a/r,u=s/o,h={};return r===0&&0a?(h.x=n,h.y=i+s/2,h):0r&&-1*u<=l&&l<=u?(h.x=n-o/2,h.y=i-o*a/2/r,h):0=u)?(h.x=n+s*r/2/a,h.y=i+s/2,h):(0>a&&(l<=-1*u||l>=u)&&(h.x=n-s*r/2/a,h.y=i-s/2),h)},"findClippingPoint"),sp=f(function(e,r){for(var a=0;aa){var y=r.gravity*d/m,p=r.gravity*g/m;v.offsetX+=y,v.offsetY+=p}}}}},"calculateGravityForces"),up=f(function(e,r){var a=[],n=0,i=-1;for(a.push.apply(a,e.graphSet[0]),i+=e.graphSet[0].length;n<=i;){var s=a[n++],o=e.idToIndex[s],l=e.layoutNodes[o],u=l.children;if(0a)var i={x:a*e/n,y:a*r/n};else var i={x:e,y:r};return i},"limitForce"),hp=f(function t(e,r){var a=e.parentId;if(a!=null){var n=r.layoutNodes[r.idToIndex[a]],i=!1;if((n.maxX==null||e.maxX+n.padRight>n.maxX)&&(n.maxX=e.maxX+n.padRight,i=!0),(n.minX==null||e.minX-n.padLeftn.maxY)&&(n.maxY=e.maxY+n.padBottom,i=!0),(n.minY==null||e.minY-n.padTopp&&(g+=y+r.componentSpacing,d=0,m=0,y=0)}}},"separateComponents"),cp={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:f(function(e){},"position"),sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:f(function(e,r){return!0},"animateFilter"),ready:void 0,stop:void 0,transform:f(function(e,r){return r},"transform")};function Iu(t){this.options=Ee({},cp,t)}f(Iu,"GridLayout");Iu.prototype.run=function(){var t=this.options,e=t,r=t.cy,a=e.eles,n=a.nodes().not(":parent");e.sort&&(n=n.sort(e.sort));var i=pt(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0)a.nodes().layoutPositions(this,e,function($){return{x:i.x1,y:i.y1}});else{var s=n.size(),o=Math.sqrt(s*i.h/i.w),l=Math.round(o),u=Math.round(i.w/i.h*o),h=f(function(j){if(j==null)return Math.min(l,u);var Q=Math.min(l,u);Q==l?l=j:u=j},"small"),c=f(function(j){if(j==null)return Math.max(l,u);var Q=Math.max(l,u);Q==l?l=j:u=j},"large"),v=e.rows,d=e.cols!=null?e.cols:e.columns;if(v!=null&&d!=null)l=v,u=d;else if(v!=null&&d==null)l=v,u=Math.ceil(s/l);else if(v==null&&d!=null)u=d,l=Math.ceil(s/u);else if(u*l>s){var g=h(),m=c();(g-1)*m>=s?h(g-1):(m-1)*g>=s&&c(m-1)}else for(;u*l=s?c(p+1):h(y+1)}var b=i.w/u,E=i.h/l;if(e.condense&&(b=0,E=0),e.avoidOverlap)for(var S=0;S=u&&(P=0,M++)},"moveToNextCell"),k={},B=0;B(P=Bh(t,e,R[k],R[k+1],R[k+2],R[k+3])))return y(T,P),!0}else if(D.edgeType==="bezier"||D.edgeType==="multibezier"||D.edgeType==="self"||D.edgeType==="compound"){for(var R=D.allpts,k=0;k+5(P=Ph(t,e,R[k],R[k+1],R[k+2],R[k+3],R[k+4],R[k+5])))return y(T,P),!0}for(var B=B||C.source,F=F||C.target,U=n.getArrowWidth(L,O),V=[{name:"source",x:D.arrowStartX,y:D.arrowStartY,angle:D.srcArrowAngle},{name:"target",x:D.arrowEndX,y:D.arrowEndY,angle:D.tgtArrowAngle},{name:"mid-source",x:D.midX,y:D.midY,angle:D.midsrcArrowAngle},{name:"mid-target",x:D.midX,y:D.midY,angle:D.midtgtArrowAngle}],k=0;k0&&(p(B),p(F))}f(b,"checkEdge");function E(T,C,D){return Mt(T,C,D)}f(E,"preprop");function S(T,C){var D=T._private,L=v,O;C?O=C+"-":O="",T.boundingBox();var A=D.labelBounds[C||"main"],I=T.pstyle(O+"label").value,M=T.pstyle("text-events").strValue==="yes";if(!(!M||!I)){var P=E(D.rscratch,"labelX",C),R=E(D.rscratch,"labelY",C),k=E(D.rscratch,"labelAngle",C),B=T.pstyle(O+"text-margin-x").pfValue,F=T.pstyle(O+"text-margin-y").pfValue,U=A.x1-L-B,V=A.x2+L-B,G=A.y1-L-F,$=A.y2+L-F;if(k){var j=Math.cos(k),Q=Math.sin(k),H=f(function(de,re){return de=de-P,re=re-R,{x:de*j-re*Q+P,y:de*Q+re*j+R}},"rotate"),te=H(U,G),_=H(U,$),z=H(V,G),Z=H(V,$),K=[te.x+B,te.y+F,z.x+B,z.y+F,Z.x+B,Z.y+F,_.x+B,_.y+F];if(gt(t,e,K))return y(T),!0}else if(Vr(A,t,e))return y(T),!0}}f(S,"checkLabel");for(var w=s.length-1;w>=0;w--){var x=s[w];x.isNode()?p(x)||S(x):b(x)||S(x)||S(x,"source")||S(x,"target")}return o};Tr.getAllInBox=function(t,e,r,a){var n=this.getCachedZSortedEles().interactive,i=[],s=Math.min(t,r),o=Math.max(t,r),l=Math.min(e,a),u=Math.max(e,a);t=s,r=o,e=l,a=u;for(var h=pt({x1:t,y1:e,x2:r,y2:a}),c=0;c0?-(Math.PI-e.ang):Math.PI+e.ang},"invertVec"),mp=f(function(e,r,a,n,i){if(e!==oo?uo(r,e,Pt):yp(Et,Pt),uo(r,a,Et),io=Pt.nx*Et.ny-Pt.ny*Et.nx,so=Pt.nx*Et.nx-Pt.ny*-Et.ny,$t=Math.asin(Math.max(-1,Math.min(1,io))),Math.abs($t)<1e-6){ui=r.x,li=r.y,vr=Nr=0;return}dr=1,nn=!1,so<0?$t<0?$t=Math.PI+$t:($t=Math.PI-$t,dr=-1,nn=!0):$t>0&&(dr=-1,nn=!0),r.radius!==void 0?Nr=r.radius:Nr=n,lr=$t/2,Ka=Math.min(Pt.len/2,Et.len/2),i?(Rt=Math.abs(Math.cos(lr)*Nr/Math.sin(lr)),Rt>Ka?(Rt=Ka,vr=Math.abs(Rt*Math.sin(lr)/Math.cos(lr))):vr=Nr):(Rt=Math.min(Ka,Nr),vr=Math.abs(Rt*Math.sin(lr)/Math.cos(lr))),fi=r.x+Et.nx*Rt,hi=r.y+Et.ny*Rt,ui=fi-Et.ny*vr*dr,li=hi+Et.nx*vr*dr,Bu=r.x+Pt.nx*Rt,Fu=r.y+Pt.ny*Rt,oo=r},"calcCornerArc");function Gu(t,e){e.radius===0?t.lineTo(e.cx,e.cy):t.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}f(Gu,"drawPreparedRoundCorner");function Fi(t,e,r,a){var n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return a===0||e.radius===0?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(mp(t,e,r,a,n),{cx:ui,cy:li,radius:vr,startX:Bu,startY:Fu,stopX:fi,stopY:hi,startAngle:Pt.ang+Math.PI/2*dr,endAngle:Et.ang-Math.PI/2*dr,counterClockwise:nn})}f(Fi,"getRoundCorner");var lt={};lt.findMidptPtsEtc=function(t,e){var r=e.posPts,a=e.intersectionPts,n=e.vectorNormInverse,i,s=t.pstyle("source-endpoint"),o=t.pstyle("target-endpoint"),l=s.units!=null&&o.units!=null,u=f(function(w,x,T,C){var D=C-x,L=T-w,O=Math.sqrt(L*L+D*D);return{x:-D/O,y:L/O}},"recalcVectorNormInverse"),h=t.pstyle("edge-distances").value;switch(h){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(l){var c=this.manualEndptToPx(t.source()[0],s),v=At(c,2),d=v[0],g=v[1],m=this.manualEndptToPx(t.target()[0],o),y=At(m,2),p=y[0],b=y[1],E={x1:d,y1:g,x2:p,y2:b};n=u(d,g,p,b),i=E}else Ne("Edge ".concat(t.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint.  Falling back on edge-distances:intersection (default).")),i=a;break}}return{midptPts:i,vectorNormInverse:n}};lt.findHaystackPoints=function(t){for(var e=0;e0?Math.max(me-be,0):Math.min(me+be,0)},"subDWH"),I=A(L,C),M=A(O,D),P=!1;b===u?p=Math.abs(I)>Math.abs(M)?n:a:b===l||b===o?(p=a,P=!0):(b===i||b===s)&&(p=n,P=!0);var R=p===a,k=R?M:I,B=R?O:L,F=Yo(B),U=!1;!(P&&(S||x))&&(b===o&&B<0||b===l&&B>0||b===i&&B>0||b===s&&B<0)&&(F*=-1,k=F*Math.abs(k),U=!0);var V;if(S){var G=w<0?1+w:w;V=G*k}else{var $=w<0?k:0;V=$+w*F}var j=f(function(me){return Math.abs(me)=Math.abs(k)},"getIsTooClose"),Q=j(V),H=j(Math.abs(k)-Math.abs(V)),te=Q||H;if(te&&!U)if(R){var _=Math.abs(B)<=v/2,z=Math.abs(L)<=d/2;if(_){var Z=(h.x1+h.x2)/2,K=h.y1,ie=h.y2;r.segpts=[Z,K,Z,ie]}else if(z){var de=(h.y1+h.y2)/2,re=h.x1,se=h.x2;r.segpts=[re,de,se,de]}else r.segpts=[h.x1,h.y2]}else{var le=Math.abs(B)<=c/2,ce=Math.abs(O)<=g/2;if(le){var ue=(h.y1+h.y2)/2,ye=h.x1,Oe=h.x2;r.segpts=[ye,ue,Oe,ue]}else if(ce){var Te=(h.x1+h.x2)/2,xe=h.y1,Se=h.y2;r.segpts=[Te,xe,Te,Se]}else r.segpts=[h.x2,h.y1]}else if(R){var ee=h.y1+V+(y?v/2*F:0),N=h.x1,Y=h.x2;r.segpts=[N,ee,Y,ee]}else{var J=h.x1+V+(y?c/2*F:0),q=h.y1,X=h.y2;r.segpts=[J,q,J,X]}if(r.isRound){var ne=t.pstyle("taxi-radius").value,W=t.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ne),r.isArcRadius=new Array(r.segpts.length/2).fill(W)}};lt.tryToCorrectInvalidPoints=function(t,e){var r=t._private.rscratch;if(r.edgeType==="bezier"){var a=e.srcPos,n=e.tgtPos,i=e.srcW,s=e.srcH,o=e.tgtW,l=e.tgtH,u=e.srcShape,h=e.tgtShape,c=e.srcCornerRadius,v=e.tgtCornerRadius,d=e.srcRs,g=e.tgtRs,m=!oe(r.startX)||!oe(r.startY),y=!oe(r.arrowStartX)||!oe(r.arrowStartY),p=!oe(r.endX)||!oe(r.endY),b=!oe(r.arrowEndX)||!oe(r.arrowEndY),E=3,S=this.getArrowWidth(t.pstyle("width").pfValue,t.pstyle("arrow-scale").value)*this.arrowShapeWidth,w=E*S,x=mr({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY}),T=xM.poolIndex()){var P=I;I=M,M=P}var R=D.srcPos=I.position(),k=D.tgtPos=M.position(),B=D.srcW=I.outerWidth(),F=D.srcH=I.outerHeight(),U=D.tgtW=M.outerWidth(),V=D.tgtH=M.outerHeight(),G=D.srcShape=r.nodeShapes[e.getNodeShape(I)],$=D.tgtShape=r.nodeShapes[e.getNodeShape(M)],j=D.srcCornerRadius=I.pstyle("corner-radius").value==="auto"?"auto":I.pstyle("corner-radius").pfValue,Q=D.tgtCornerRadius=M.pstyle("corner-radius").value==="auto"?"auto":M.pstyle("corner-radius").pfValue,H=D.tgtRs=M._private.rscratch,te=D.srcRs=I._private.rscratch;D.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_0){var ie=i,de=hr(ie,kr(r)),re=hr(ie,kr(K)),se=de;if(re2){var le=hr(ie,{x:K[2],y:K[3]});le0){var X=s,ne=hr(X,kr(r)),W=hr(X,kr(q)),ae=ne;if(W2){var me=hr(X,{x:q[2],y:q[3]});me=g||T){y={cp:S,segment:x};break}}if(y)break}var C=y.cp,D=y.segment,L=(g-p)/D.length,O=D.t1-D.t0,A=d?D.t0+O*L:D.t1-O*L;A=ba(0,A,1),e=Pr(C.p0,C.p1,C.p2,A),v=Ep(C.p0,C.p1,C.p2,A);break}case"straight":case"segments":case"haystack":{for(var I=0,M,P,R,k,B=a.allpts.length,F=0;F+3=g));F+=2);var U=g-P,V=U/M;V=ba(0,V,1),e=Dh(R,k,V),v=Uu(R,k);break}}s("labelX",c,e.x),s("labelY",c,e.y),s("labelAutoAngle",c,v)}},"calculateEndProjection");u("source"),u("target"),this.applyLabelDimensions(t)}};zt.applyLabelDimensions=function(t){this.applyPrefixedLabelDimensions(t),t.isEdge()&&(this.applyPrefixedLabelDimensions(t,"source"),this.applyPrefixedLabelDimensions(t,"target"))};zt.applyPrefixedLabelDimensions=function(t,e){var r=t._private,a=this.getLabelText(t,e),n=this.calculateLabelDimensions(t,a),i=t.pstyle("line-height").pfValue,s=t.pstyle("text-wrap").strValue,o=Mt(r.rscratch,"labelWrapCachedLines",e)||[],l=s!=="wrap"?1:Math.max(o.length,1),u=n.height/l,h=u*i,c=n.width,v=n.height+(l-1)*(i-1)*u;Jt(r.rstyle,"labelWidth",e,c),Jt(r.rscratch,"labelWidth",e,c),Jt(r.rstyle,"labelHeight",e,v),Jt(r.rscratch,"labelHeight",e,v),Jt(r.rscratch,"labelLineHeight",e,h)};zt.getLabelText=function(t,e){var r=t._private,a=e?e+"-":"",n=t.pstyle(a+"label").strValue,i=t.pstyle("text-transform").value,s=f(function($,j){return j?(Jt(r.rscratch,$,e,j),j):Mt(r.rscratch,$,e)},"rscratch");if(!n)return"";i=="none"||(i=="uppercase"?n=n.toUpperCase():i=="lowercase"&&(n=n.toLowerCase()));var o=t.pstyle("text-wrap").value;if(o==="wrap"){var l=s("labelKey");if(l!=null&&s("labelWrapKey")===l)return s("labelWrapCachedText");for(var u="\u200B",h=n.split(`
`),c=t.pstyle("text-max-width").pfValue,v=t.pstyle("text-overflow-wrap").value,d=v==="anywhere",g=[],m=/[\s\u200b]+|$/g,y=0;yc){var w=p.matchAll(m),x="",T=0,C=To(w),D;try{for(C.s();!(D=C.n()).done;){var L=D.value,O=L[0],A=p.substring(T,L.index);T=L.index+O.length;var I=x.length===0?A:x+A+O,M=this.calculateLabelDimensions(t,I),P=M.width;P<=c?x+=A+O:(x&&g.push(x),x=A+O)}}catch(G){C.e(G)}finally{C.f()}x.match(/^[\s\u200b]+$/)||g.push(x)}else g.push(p)}s("labelWrapCachedLines",g),n=s("labelWrapCachedText",g.join(`
`)),s("labelWrapKey",l)}else if(o==="ellipsis"){var R=t.pstyle("text-max-width").pfValue,k="",B="\u2026",F=!1;if(this.calculateLabelDimensions(t,n).widthR)break;k+=n[U],U===n.length-1&&(F=!0)}return F||(k+=B),k}return n};zt.getLabelJustification=function(t){var e=t.pstyle("text-justification").strValue,r=t.pstyle("text-halign").strValue;if(e==="auto")if(t.isNode())switch(r){case"left":return"right";case"right":return"left";default:return"center"}else return"center";else return e};zt.calculateLabelDimensions=function(t,e){var r=this,a=r.cy.window(),n=a.document,i=yr(e,t._private.labelDimsKey),s=r.labelDimCache||(r.labelDimCache=[]),o=s[i];if(o!=null)return o;var l=0,u=t.pstyle("font-style").strValue,h=t.pstyle("font-size").pfValue,c=t.pstyle("font-family").strValue,v=t.pstyle("font-weight").strValue,d=this.labelCalcCanvas,g=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=n.createElement("canvas"),g=this.labelCalcCanvasContext=d.getContext("2d");var m=d.style;m.position="absolute",m.left="-9999px",m.top="-9999px",m.zIndex="-1",m.visibility="hidden",m.pointerEvents="none"}g.font="".concat(u," ").concat(v," ").concat(h,"px ").concat(c);for(var y=0,p=0,b=e.split(`
`),E=0;E1&&arguments[1]!==void 0?arguments[1]:!0;if(e.merge(s),o)for(var l=0;l=t.desktopTapThreshold2}var ht=n(N);ke&&(t.hoverData.tapholdCancelled=!0);var Tt=f(function(){var kt=t.hoverData.dragDelta=t.hoverData.dragDelta||[];kt.length===0?(kt.push(pe[0]),kt.push(pe[1])):(kt[0]+=pe[0],kt[1]+=pe[1])},"updateDragDelta");J=!0,a(ve,["mousemove","vmousemove","tapdrag"],N,{x:W[0],y:W[1]});var bt=f(function(){t.data.bgActivePosistion=void 0,t.hoverData.selecting||q.emit({originalEvent:N,type:"boxstart",position:{x:W[0],y:W[1]}}),be[4]=1,t.hoverData.selecting=!0,t.redrawHint("select",!0),t.redraw()},"goIntoBoxMode");if(t.hoverData.which===3){if(ke){var dt={originalEvent:N,type:"cxtdrag",position:{x:W[0],y:W[1]}};he?he.emit(dt):q.emit(dt),t.hoverData.cxtDragged=!0,(!t.hoverData.cxtOver||ve!==t.hoverData.cxtOver)&&(t.hoverData.cxtOver&&t.hoverData.cxtOver.emit({originalEvent:N,type:"cxtdragout",position:{x:W[0],y:W[1]}}),t.hoverData.cxtOver=ve,ve&&ve.emit({originalEvent:N,type:"cxtdragover",position:{x:W[0],y:W[1]}}))}}else if(t.hoverData.dragging){if(J=!0,q.panningEnabled()&&q.userPanningEnabled()){var It;if(t.hoverData.justStartedPan){var Ut=t.hoverData.mdownPos;It={x:(W[0]-Ut[0])*X,y:(W[1]-Ut[1])*X},t.hoverData.justStartedPan=!1}else It={x:pe[0]*X,y:pe[1]*X};q.panBy(It),q.emit("dragpan"),t.hoverData.dragged=!0}W=t.projectIntoViewport(N.clientX,N.clientY)}else if(be[4]==1&&(he==null||he.pannable())){if(ke){if(!t.hoverData.dragging&&q.boxSelectionEnabled()&&(ht||!q.panningEnabled()||!q.userPanningEnabled()))bt();else if(!t.hoverData.selecting&&q.panningEnabled()&&q.userPanningEnabled()){var Ct=i(he,t.hoverData.downs);Ct&&(t.hoverData.dragging=!0,t.hoverData.justStartedPan=!0,be[4]=0,t.data.bgActivePosistion=kr(ae),t.redrawHint("select",!0),t.redraw())}he&&he.pannable()&&he.active()&&he.unactivate()}}else{if(he&&he.pannable()&&he.active()&&he.unactivate(),(!he||!he.grabbed())&&ve!=we&&(we&&a(we,["mouseout","tapdragout"],N,{x:W[0],y:W[1]}),ve&&a(ve,["mouseover","tapdragover"],N,{x:W[0],y:W[1]}),t.hoverData.last=ve),he)if(ke){if(q.boxSelectionEnabled()&&ht)he&&he.grabbed()&&(y(Ge),he.emit("freeon"),Ge.emit("free"),t.dragData.didDrag&&(he.emit("dragfreeon"),Ge.emit("dragfree"))),bt();else if(he&&he.grabbed()&&t.nodeIsDraggable(he)){var $e=!t.dragData.didDrag;$e&&t.redrawHint("eles",!0),t.dragData.didDrag=!0,t.hoverData.draggingEles||g(Ge,{inDragLayer:!0});var Ke={x:0,y:0};if(oe(pe[0])&&oe(pe[1])&&(Ke.x+=pe[0],Ke.y+=pe[1],$e)){var nt=t.hoverData.dragDelta;nt&&oe(nt[0])&&oe(nt[1])&&(Ke.x+=nt[0],Ke.y+=nt[1])}t.hoverData.draggingEles=!0,Ge.silentShift(Ke).emit("position drag"),t.redrawHint("drag",!0),t.redraw()}}else Tt();J=!0}if(be[2]=W[0],be[3]=W[1],J)return N.stopPropagation&&N.stopPropagation(),N.preventDefault&&N.preventDefault(),!1}},"mousemoveHandler"),!1);var L,O,A;t.registerBinding(e,"mouseup",f(function(N){if(!(t.hoverData.which===1&&N.which!==1&&t.hoverData.capture)){var Y=t.hoverData.capture;if(Y){t.hoverData.capture=!1;var J=t.cy,q=t.projectIntoViewport(N.clientX,N.clientY),X=t.selection,ne=t.findNearestElement(q[0],q[1],!0,!1),W=t.dragData.possibleDragElements,ae=t.hoverData.down,me=n(N);if(t.data.bgActivePosistion&&(t.redrawHint("select",!0),t.redraw()),t.hoverData.tapholdCancelled=!0,t.data.bgActivePosistion=void 0,ae&&ae.unactivate(),t.hoverData.which===3){var be={originalEvent:N,type:"cxttapend",position:{x:q[0],y:q[1]}};if(ae?ae.emit(be):J.emit(be),!t.hoverData.cxtDragged){var ve={originalEvent:N,type:"cxttap",position:{x:q[0],y:q[1]}};ae?ae.emit(ve):J.emit(ve)}t.hoverData.cxtDragged=!1,t.hoverData.which=null}else if(t.hoverData.which===1){if(a(ne,["mouseup","tapend","vmouseup"],N,{x:q[0],y:q[1]}),!t.dragData.didDrag&&!t.hoverData.dragged&&!t.hoverData.selecting&&!t.hoverData.isOverThresholdDrag&&(a(ae,["click","tap","vclick"],N,{x:q[0],y:q[1]}),O=!1,N.timeStamp-A<=J.multiClickDebounceTime()?(L&&clearTimeout(L),O=!0,A=null,a(ae,["dblclick","dbltap","vdblclick"],N,{x:q[0],y:q[1]})):(L=setTimeout(function(){O||a(ae,["oneclick","onetap","voneclick"],N,{x:q[0],y:q[1]})},J.multiClickDebounceTime()),A=N.timeStamp)),ae==null&&!t.dragData.didDrag&&!t.hoverData.selecting&&!t.hoverData.dragged&&!n(N)&&(J.$(r).unselect(["tapunselect"]),W.length>0&&t.redrawHint("eles",!0),t.dragData.possibleDragElements=W=J.collection()),ne==ae&&!t.dragData.didDrag&&!t.hoverData.selecting&&ne!=null&&ne._private.selectable&&(t.hoverData.dragging||(J.selectionType()==="additive"||me?ne.selected()?ne.unselect(["tapunselect"]):ne.select(["tapselect"]):me||(J.$(r).unmerge(ne).unselect(["tapunselect"]),ne.select(["tapselect"]))),t.redrawHint("eles",!0)),t.hoverData.selecting){var we=J.collection(t.getAllInBox(X[0],X[1],X[2],X[3]));t.redrawHint("select",!0),we.length>0&&t.redrawHint("eles",!0),J.emit({type:"boxend",originalEvent:N,position:{x:q[0],y:q[1]}});var he=f(function(ke){return ke.selectable()&&!ke.selected()},"eleWouldBeSelected");J.selectionType()==="additive"||me||J.$(r).unmerge(we).unselect(),we.emit("box").stdFilter(he).select().emit("boxselect"),t.redraw()}if(t.hoverData.dragging&&(t.hoverData.dragging=!1,t.redrawHint("select",!0),t.redrawHint("eles",!0),t.redraw()),!X[4]){t.redrawHint("drag",!0),t.redrawHint("eles",!0);var pe=ae&&ae.grabbed();y(W),pe&&(ae.emit("freeon"),W.emit("free"),t.dragData.didDrag&&(ae.emit("dragfreeon"),W.emit("dragfree")))}}X[4]=0,t.hoverData.down=null,t.hoverData.cxtStarted=!1,t.hoverData.draggingEles=!1,t.hoverData.selecting=!1,t.hoverData.isOverThresholdDrag=!1,t.dragData.didDrag=!1,t.hoverData.dragged=!1,t.hoverData.dragDelta=[],t.hoverData.mdownPos=null,t.hoverData.mdownGPos=null}}},"mouseupHandler"),!1);var I=f(function(N){if(!t.scrollingPage){var Y=t.cy,J=Y.zoom(),q=Y.pan(),X=t.projectIntoViewport(N.clientX,N.clientY),ne=[X[0]*J+q.x,X[1]*J+q.y];if(t.hoverData.draggingEles||t.hoverData.dragging||t.hoverData.cxtStarted||C()){N.preventDefault();return}if(Y.panningEnabled()&&Y.userPanningEnabled()&&Y.zoomingEnabled()&&Y.userZoomingEnabled()){N.preventDefault(),t.data.wheelZooming=!0,clearTimeout(t.data.wheelTimeout),t.data.wheelTimeout=setTimeout(function(){t.data.wheelZooming=!1,t.redrawHint("eles",!0),t.redraw()},150);var W;N.deltaY!=null?W=N.deltaY/-250:N.wheelDeltaY!=null?W=N.wheelDeltaY/1e3:W=N.wheelDelta/1e3,W=W*t.wheelSensitivity;var ae=N.deltaMode===1;ae&&(W*=33);var me=Y.zoom()*Math.pow(10,W);N.type==="gesturechange"&&(me=t.gestureStartZoom*N.scale),Y.zoom({level:me,renderedPosition:{x:ne[0],y:ne[1]}}),Y.emit(N.type==="gesturechange"?"pinchzoom":"scrollzoom")}}},"wheelHandler");t.registerBinding(t.container,"wheel",I,!0),t.registerBinding(e,"scroll",f(function(N){t.scrollingPage=!0,clearTimeout(t.scrollingPageTimeout),t.scrollingPageTimeout=setTimeout(function(){t.scrollingPage=!1},250)},"scrollHandler"),!0),t.registerBinding(t.container,"gesturestart",f(function(N){t.gestureStartZoom=t.cy.zoom(),t.hasTouchStarted||N.preventDefault()},"gestureStartHandler"),!0),t.registerBinding(t.container,"gesturechange",function(ee){t.hasTouchStarted||I(ee)},!0),t.registerBinding(t.container,"mouseout",f(function(N){var Y=t.projectIntoViewport(N.clientX,N.clientY);t.cy.emit({originalEvent:N,type:"mouseout",position:{x:Y[0],y:Y[1]}})},"mouseOutHandler"),!1),t.registerBinding(t.container,"mouseover",f(function(N){var Y=t.projectIntoViewport(N.clientX,N.clientY);t.cy.emit({originalEvent:N,type:"mouseover",position:{x:Y[0],y:Y[1]}})},"mouseOverHandler"),!1);var M,P,R,k,B,F,U,V,G,$,j,Q,H,te=f(function(N,Y,J,q){return Math.sqrt((J-N)*(J-N)+(q-Y)*(q-Y))},"distance"),_=f(function(N,Y,J,q){return(J-N)*(J-N)+(q-Y)*(q-Y)},"distanceSq"),z;t.registerBinding(t.container,"touchstart",z=f(function(N){if(t.hasTouchStarted=!0,!!D(N)){b(),t.touchData.capture=!0,t.data.bgActivePosistion=void 0;var Y=t.cy,J=t.touchData.now,q=t.touchData.earlier;if(N.touches[0]){var X=t.projectIntoViewport(N.touches[0].clientX,N.touches[0].clientY);J[0]=X[0],J[1]=X[1]}if(N.touches[1]){var X=t.projectIntoViewport(N.touches[1].clientX,N.touches[1].clientY);J[2]=X[0],J[3]=X[1]}if(N.touches[2]){var X=t.projectIntoViewport(N.touches[2].clientX,N.touches[2].clientY);J[4]=X[0],J[5]=X[1]}if(N.touches[1]){t.touchData.singleTouchMoved=!0,y(t.dragData.touchDragEles);var ne=t.findContainerClientCoords();G=ne[0],$=ne[1],j=ne[2],Q=ne[3],M=N.touches[0].clientX-G,P=N.touches[0].clientY-$,R=N.touches[1].clientX-G,k=N.touches[1].clientY-$,H=0<=M&&M<=j&&0<=R&&R<=j&&0<=P&&P<=Q&&0<=k&&k<=Q;var W=Y.pan(),ae=Y.zoom();B=te(M,P,R,k),F=_(M,P,R,k),U=[(M+R)/2,(P+k)/2],V=[(U[0]-W.x)/ae,(U[1]-W.y)/ae];var me=200,be=me*me;if(F=1){for(var Qe=t.touchData.startPosition=[null,null,null,null,null,null],Ye=0;Ye=t.touchTapThreshold2}if(Y&&t.touchData.cxt){N.preventDefault();var Qe=N.touches[0].clientX-G,Ye=N.touches[0].clientY-$,vt=N.touches[1].clientX-G,Je=N.touches[1].clientY-$,ht=_(Qe,Ye,vt,Je),Tt=ht/F,bt=150,dt=bt*bt,It=1.5,Ut=It*It;if(Tt>=Ut||ht>=dt){t.touchData.cxt=!1,t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ct={originalEvent:N,type:"cxttapend",position:{x:X[0],y:X[1]}};t.touchData.start?(t.touchData.start.unactivate().emit(Ct),t.touchData.start=null):q.emit(Ct)}}if(Y&&t.touchData.cxt){var Ct={originalEvent:N,type:"cxtdrag",position:{x:X[0],y:X[1]}};t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.touchData.start?t.touchData.start.emit(Ct):q.emit(Ct),t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxtDragged=!0;var $e=t.findNearestElement(X[0],X[1],!0,!0);(!t.touchData.cxtOver||$e!==t.touchData.cxtOver)&&(t.touchData.cxtOver&&t.touchData.cxtOver.emit({originalEvent:N,type:"cxtdragout",position:{x:X[0],y:X[1]}}),t.touchData.cxtOver=$e,$e&&$e.emit({originalEvent:N,type:"cxtdragover",position:{x:X[0],y:X[1]}}))}else if(Y&&N.touches[2]&&q.boxSelectionEnabled())N.preventDefault(),t.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,t.touchData.selecting||q.emit({originalEvent:N,type:"boxstart",position:{x:X[0],y:X[1]}}),t.touchData.selecting=!0,t.touchData.didSelect=!0,J[4]=1,!J||J.length===0||J[0]===void 0?(J[0]=(X[0]+X[2]+X[4])/3,J[1]=(X[1]+X[3]+X[5])/3,J[2]=(X[0]+X[2]+X[4])/3+1,J[3]=(X[1]+X[3]+X[5])/3+1):(J[2]=(X[0]+X[2]+X[4])/3,J[3]=(X[1]+X[3]+X[5])/3),t.redrawHint("select",!0),t.redraw();else if(Y&&N.touches[1]&&!t.touchData.didSelect&&q.zoomingEnabled()&&q.panningEnabled()&&q.userZoomingEnabled()&&q.userPanningEnabled()){N.preventDefault(),t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var Ke=t.dragData.touchDragEles;if(Ke){t.redrawHint("drag",!0);for(var nt=0;nt0&&!t.hoverData.draggingEles&&!t.swipePanning&&t.data.bgActivePosistion!=null&&(t.data.bgActivePosistion=void 0,t.redrawHint("select",!0),t.redraw())}},"touchmoveHandler"),!1);var K;t.registerBinding(e,"touchcancel",K=f(function(N){var Y=t.touchData.start;t.touchData.capture=!1,Y&&Y.unactivate()},"touchcancelHandler"));var ie,de,re,se;if(t.registerBinding(e,"touchend",ie=f(function(N){var Y=t.touchData.start,J=t.touchData.capture;if(J)N.touches.length===0&&(t.touchData.capture=!1),N.preventDefault();else return;var q=t.selection;t.swipePanning=!1,t.hoverData.draggingEles=!1;var X=t.cy,ne=X.zoom(),W=t.touchData.now,ae=t.touchData.earlier;if(N.touches[0]){var me=t.projectIntoViewport(N.touches[0].clientX,N.touches[0].clientY);W[0]=me[0],W[1]=me[1]}if(N.touches[1]){var me=t.projectIntoViewport(N.touches[1].clientX,N.touches[1].clientY);W[2]=me[0],W[3]=me[1]}if(N.touches[2]){var me=t.projectIntoViewport(N.touches[2].clientX,N.touches[2].clientY);W[4]=me[0],W[5]=me[1]}Y&&Y.unactivate();var be;if(t.touchData.cxt){if(be={originalEvent:N,type:"cxttapend",position:{x:W[0],y:W[1]}},Y?Y.emit(be):X.emit(be),!t.touchData.cxtDragged){var ve={originalEvent:N,type:"cxttap",position:{x:W[0],y:W[1]}};Y?Y.emit(ve):X.emit(ve)}t.touchData.start&&(t.touchData.start._private.grabbed=!1),t.touchData.cxt=!1,t.touchData.start=null,t.redraw();return}if(!N.touches[2]&&X.boxSelectionEnabled()&&t.touchData.selecting){t.touchData.selecting=!1;var we=X.collection(t.getAllInBox(q[0],q[1],q[2],q[3]));q[0]=void 0,q[1]=void 0,q[2]=void 0,q[3]=void 0,q[4]=0,t.redrawHint("select",!0),X.emit({type:"boxend",originalEvent:N,position:{x:W[0],y:W[1]}});var he=f(function(dt){return dt.selectable()&&!dt.selected()},"eleWouldBeSelected");we.emit("box").stdFilter(he).select().emit("boxselect"),we.nonempty()&&t.redrawHint("eles",!0),t.redraw()}if(Y?.unactivate(),N.touches[2])t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);else if(!N.touches[1]){if(!N.touches[0]){if(!N.touches[0]){t.data.bgActivePosistion=void 0,t.redrawHint("select",!0);var pe=t.dragData.touchDragEles;if(Y!=null){var Ge=Y._private.grabbed;y(pe),t.redrawHint("drag",!0),t.redrawHint("eles",!0),Ge&&(Y.emit("freeon"),pe.emit("free"),t.dragData.didDrag&&(Y.emit("dragfreeon"),pe.emit("dragfree"))),a(Y,["touchend","tapend","vmouseup","tapdragout"],N,{x:W[0],y:W[1]}),Y.unactivate(),t.touchData.start=null}else{var ke=t.findNearestElement(W[0],W[1],!0,!0);a(ke,["touchend","tapend","vmouseup","tapdragout"],N,{x:W[0],y:W[1]})}var ft=t.touchData.startPosition[0]-W[0],Qe=ft*ft,Ye=t.touchData.startPosition[1]-W[1],vt=Ye*Ye,Je=Qe+vt,ht=Je*ne*ne;t.touchData.singleTouchMoved||(Y||X.$(":selected").unselect(["tapunselect"]),a(Y,["tap","vclick"],N,{x:W[0],y:W[1]}),de=!1,N.timeStamp-se<=X.multiClickDebounceTime()?(re&&clearTimeout(re),de=!0,se=null,a(Y,["dbltap","vdblclick"],N,{x:W[0],y:W[1]})):(re=setTimeout(function(){de||a(Y,["onetap","voneclick"],N,{x:W[0],y:W[1]})},X.multiClickDebounceTime()),se=N.timeStamp)),Y!=null&&!t.dragData.didDrag&&Y._private.selectable&&ht"u"){var le=[],ce=f(function(N){return{clientX:N.clientX,clientY:N.clientY,force:1,identifier:N.pointerId,pageX:N.pageX,pageY:N.pageY,radiusX:N.width/2,radiusY:N.height/2,screenX:N.screenX,screenY:N.screenY,target:N.target}},"makeTouch"),ue=f(function(N){return{event:N,touch:ce(N)}},"makePointer"),ye=f(function(N){le.push(ue(N))},"addPointer"),Oe=f(function(N){for(var Y=0;Y0)return G[0]}return null},"getCurveT"),g=Object.keys(v),m=0;m0?d:Ho(i,s,e,r,a,n,o,l)},"intersectLine"),checkPoint:f(function(e,r,a,n,i,s,o,l){l=l==="auto"?br(n,i):l;var u=2*l;if(Ht(e,r,this.points,s,o,n,i-u,[0,-1],a)||Ht(e,r,this.points,s,o,n-u,i,[0,-1],a))return!0;var h=n/2+2*a,c=i/2+2*a,v=[s-h,o-c,s-h,o,s+h,o,s+h,o-c];return!!(gt(e,r,v)||gr(e,r,u,u,s+n/2-l,o+i/2-l,a)||gr(e,r,u,u,s-n/2+l,o+i/2-l,a))},"checkPoint")}};Wt.registerNodeShapes=function(){var t=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",ct(3,0)),this.generateRoundPolygon("round-triangle",ct(3,0)),this.generatePolygon("rectangle",ct(4,0)),t.square=t.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r),this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",ct(5,0)),this.generateRoundPolygon("round-pentagon",ct(5,0)),this.generatePolygon("hexagon",ct(6,0)),this.generateRoundPolygon("round-hexagon",ct(6,0)),this.generatePolygon("heptagon",ct(7,0)),this.generateRoundPolygon("round-heptagon",ct(7,0)),this.generatePolygon("octagon",ct(8,0)),this.generateRoundPolygon("round-octagon",ct(8,0));var a=new Array(20);{var n=ei(5,0),i=ei(5,Math.PI/5),s=.5*(3-Math.sqrt(5));s*=1.57;for(var o=0;o=e.deqFastCost*S)break}else if(u){if(b>=e.deqCost*d||b>=e.deqAvgCost*v)break}else if(E>=e.deqNoDrawCost*Qn)break;var w=e.deq(a,y,m);if(w.length>0)for(var x=0;x0&&(e.onDeqd(a,g),!u&&e.shouldRedraw(a,g,y,m)&&i())},"dequeue"),o=e.priority||wi;n.beforeRender(s,o(a))}},"setupDequeueingImpl")},"setupDequeueing")},xp=function(){function t(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ln;pi(this,t),this.idsByKey=new Ft,this.keyForId=new Ft,this.cachesByLvl=new Ft,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=r}return f(t,"ElementTextureCacheLookup"),yi(t,[{key:"getIdsFor",value:f(function(r){r==null&&Ve("Can not get id list for null key");var a=this.idsByKey,n=this.idsByKey.get(r);return n||(n=new $r,a.set(r,n)),n},"getIdsFor")},{key:"addIdForKey",value:f(function(r,a){r!=null&&this.getIdsFor(r).add(a)},"addIdForKey")},{key:"deleteIdForKey",value:f(function(r,a){r!=null&&this.getIdsFor(r).delete(a)},"deleteIdForKey")},{key:"getNumberOfIdsForKey",value:f(function(r){return r==null?0:this.getIdsFor(r).size},"getNumberOfIdsForKey")},{key:"updateKeyMappingFor",value:f(function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);this.deleteIdForKey(n,a),this.addIdForKey(i,a),this.keyForId.set(a,i)},"updateKeyMappingFor")},{key:"deleteKeyMappingFor",value:f(function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteIdForKey(n,a),this.keyForId.delete(a)},"deleteKeyMappingFor")},{key:"keyHasChangedFor",value:f(function(r){var a=r.id(),n=this.keyForId.get(a),i=this.getKey(r);return n!==i},"keyHasChangedFor")},{key:"isInvalid",value:f(function(r){return this.keyHasChangedFor(r)||this.doesEleInvalidateKey(r)},"isInvalid")},{key:"getCachesAt",value:f(function(r){var a=this.cachesByLvl,n=this.lvls,i=a.get(r);return i||(i=new Ft,a.set(r,i),n.push(r)),i},"getCachesAt")},{key:"getCache",value:f(function(r,a){return this.getCachesAt(a).get(r)},"getCache")},{key:"get",value:f(function(r,a){var n=this.getKey(r),i=this.getCache(n,a);return i!=null&&this.updateKeyMappingFor(r),i},"get")},{key:"getForCachedKey",value:f(function(r,a){var n=this.keyForId.get(r.id()),i=this.getCache(n,a);return i},"getForCachedKey")},{key:"hasCache",value:f(function(r,a){return this.getCachesAt(a).has(r)},"hasCache")},{key:"has",value:f(function(r,a){var n=this.getKey(r);return this.hasCache(n,a)},"has")},{key:"setCache",value:f(function(r,a,n){n.key=r,this.getCachesAt(a).set(r,n)},"setCache")},{key:"set",value:f(function(r,a,n){var i=this.getKey(r);this.setCache(i,a,n),this.updateKeyMappingFor(r)},"set")},{key:"deleteCache",value:f(function(r,a){this.getCachesAt(a).delete(r)},"deleteCache")},{key:"delete",value:f(function(r,a){var n=this.getKey(r);this.deleteCache(n,a)},"_delete")},{key:"invalidateKey",value:f(function(r){var a=this;this.lvls.forEach(function(n){return a.deleteCache(r,n)})},"invalidateKey")},{key:"invalidate",value:f(function(r){var a=r.id(),n=this.keyForId.get(a);this.deleteKeyMappingFor(r);var i=this.doesEleInvalidateKey(r);return i&&this.invalidateKey(n),i||this.getNumberOfIdsForKey(n)===0},"invalidate")}]),t}(),co=25,Za=50,sn=-4,ci=3,Tp=7.99,Cp=8,Dp=1024,Sp=1024,Lp=1024,Ap=.2,Op=.8,Mp=10,Np=.15,Ip=.1,kp=.9,Rp=.9,Pp=100,Bp=1,Rr={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},Fp=rt({getKey:null,doesEleInvalidateKey:ln,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:Fo,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),ca=f(function(e,r){var a=this;a.renderer=e,a.onDequeues=[];var n=Fp(r);Ee(a,n),a.lookup=new xp(n.getKey,n.doesEleInvalidateKey),a.setupDequeueing()},"ElementTextureCache"),We=ca.prototype;We.reasons=Rr;We.getTextureQueue=function(t){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[t]=e.eleImgCaches[t]||[]};We.getRetiredTextureQueue=function(t){var e=this,r=e.eleImgCaches.retired=e.eleImgCaches.retired||{},a=r[t]=r[t]||[];return a};We.getElementQueue=function(){var t=this,e=t.eleCacheQueue=t.eleCacheQueue||new Oa(function(r,a){return a.reqs-r.reqs});return e};We.getElementKeyToQueue=function(){var t=this,e=t.eleKeyToCacheQueue=t.eleKeyToCacheQueue||{};return e};We.getElement=function(t,e,r,a,n){var i=this,s=this.renderer,o=s.cy.zoom(),l=this.lookup;if(!e||e.w===0||e.h===0||isNaN(e.w)||isNaN(e.h)||!t.visible()||t.removed()||!i.allowEdgeTxrCaching&&t.isEdge()||!i.allowParentTxrCaching&&t.isParent())return null;if(a==null&&(a=Math.ceil(Ti(o*r))),a=Tp||a>ci)return null;var u=Math.pow(2,a),h=e.h*u,c=e.w*u,v=s.eleTextBiggerThanMin(t,u);if(!this.isVisible(t,v))return null;var d=l.get(t,a);if(d&&d.invalidated&&(d.invalidated=!1,d.texture.invalidatedWidth-=d.width),d)return d;var g;if(h<=co?g=co:h<=Za?g=Za:g=Math.ceil(h/Za)*Za,h>Lp||c>Sp)return null;var m=i.getTextureQueue(g),y=m[m.length-2],p=f(function(){return i.recycleTexture(g,c)||i.addTexture(g,c)},"addNewTxr");y||(y=m[m.length-1]),y||(y=p()),y.width-y.usedWidtha;O--)D=i.getElement(t,e,r,O,Rr.downscale);L()}else return i.queueElement(t,x.level-1),x;else{var A;if(!E&&!S&&!w)for(var I=a-1;I>=sn;I--){var M=l.get(t,I);if(M){A=M;break}}if(b(A))return i.queueElement(t,a),A;y.context.translate(y.usedWidth,0),y.context.scale(u,u),this.drawElement(y.context,t,e,v,!1),y.context.scale(1/u,1/u),y.context.translate(-y.usedWidth,0)}return d={x:y.usedWidth,texture:y,level:a,scale:u,width:c,height:h,scaledLabelShown:v},y.usedWidth+=Math.ceil(c+Cp),y.eleCaches.push(d),l.set(t,a,d),i.checkTextureFullness(y),d};We.invalidateElements=function(t){for(var e=0;e=Ap*t.width&&this.retireTexture(t)};We.checkTextureFullness=function(t){var e=this,r=e.getTextureQueue(t.height);t.usedWidth/t.width>Op&&t.fullnessChecks>=Mp?ar(r,t):t.fullnessChecks++};We.retireTexture=function(t){var e=this,r=t.height,a=e.getTextureQueue(r),n=this.lookup;ar(a,t),t.retired=!0;for(var i=t.eleCaches,s=0;s=e)return s.retired=!1,s.usedWidth=0,s.invalidatedWidth=0,s.fullnessChecks=0,xi(s.eleCaches),s.context.setTransform(1,0,0,1,0,0),s.context.clearRect(0,0,s.width,s.height),ar(n,s),a.push(s),s}};We.queueElement=function(t,e){var r=this,a=r.getElementQueue(),n=r.getElementKeyToQueue(),i=this.getKey(t),s=n[i];if(s)s.level=Math.max(s.level,e),s.eles.merge(t),s.reqs++,a.updateItem(s);else{var o={eles:t.spawn().merge(t),level:e,reqs:1,key:i};a.push(o),n[i]=o}};We.dequeue=function(t){for(var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=[],i=e.lookup,s=0;s0;s++){var o=r.pop(),l=o.key,u=o.eles[0],h=i.hasCache(u,o.level);if(a[l]=null,h)continue;n.push(o);var c=e.getBoundingBox(u);e.getElement(u,c,t,o.level,Rr.dequeue)}return n};We.removeFromQueue=function(t){var e=this,r=e.getElementQueue(),a=e.getElementKeyToQueue(),n=this.getKey(t),i=a[n];i!=null&&(i.eles.length===1?(i.reqs=Ei,r.updateItem(i),r.pop(),a[n]=null):i.eles.unmerge(t))};We.onDequeue=function(t){this.onDequeues.push(t)};We.offDequeue=function(t){ar(this.onDequeues,t)};We.setupDequeueing=Xu.setupDequeueing({deqRedrawThreshold:Pp,deqCost:Np,deqAvgCost:Ip,deqNoDrawCost:kp,deqFastCost:Rp,deq:f(function(e,r,a){return e.dequeue(r,a)},"deq"),onDeqd:f(function(e,r){for(var a=0;a=zp||r>yn)return null}a.validateLayersElesOrdering(r,t);var l=a.layersByLevel,u=Math.pow(2,r),h=l[r]=l[r]||[],c,v=a.levelIsComplete(r,t),d,g=f(function(){var L=f(function(P){if(a.validateLayersElesOrdering(P,t),a.levelIsComplete(P,t))return d=l[P],!0},"canUseAsTmpLvl"),O=f(function(P){if(!d)for(var R=r+P;da<=R&&R<=yn&&!L(R);R+=P);},"checkLvls");O(1),O(-1);for(var A=h.length-1;A>=0;A--){var I=h[A];I.invalid&&ar(h,I)}},"checkTempLevels");if(!v)g();else return h;var m=f(function(){if(!c){c=pt();for(var L=0;Lqp)return null;var I=a.makeLayer(c,r);if(O!=null){var M=h.indexOf(O)+1;h.splice(M,0,I)}else(L.insert===void 0||L.insert)&&h.unshift(I);return I},"makeLayer");if(a.skipping&&!o)return null;for(var p=null,b=t.length/Gp,E=!o,S=0;S=b||!_o(p.bb,w.boundingBox()))&&(p=y({insert:!0,after:p}),!p))return null;d||E?a.queueLayer(p,w):a.drawEleInLayer(p,w,r,e),p.eles.push(w),T[r]=p}return d||(E?null:h)};at.getEleLevelForLayerLevel=function(t,e){return t};at.drawEleInLayer=function(t,e,r,a){var n=this,i=this.renderer,s=t.context,o=e.boundingBox();o.w===0||o.h===0||!e.visible()||(r=n.getEleLevelForLayerLevel(r,a),i.setImgSmoothing(s,!1),i.drawCachedElement(s,e,null,null,r,Wp),i.setImgSmoothing(s,!0))};at.levelIsComplete=function(t,e){var r=this,a=r.layersByLevel[t];if(!a||a.length===0)return!1;for(var n=0,i=0;i0||s.invalid)return!1;n+=s.eles.length}return n===e.length};at.validateLayersElesOrdering=function(t,e){var r=this.layersByLevel[t];if(r)for(var a=0;a0){e=!0;break}}return e};at.invalidateElements=function(t){var e=this;t.length!==0&&(e.lastInvalidationTime=_t(),!(t.length===0||!e.haveLayers())&&e.updateElementsInLayers(t,f(function(a,n,i){e.invalidateLayer(a)},"invalAssocLayers")))};at.invalidateLayer=function(t){if(this.lastInvalidationTime=_t(),!t.invalid){var e=t.level,r=t.eles,a=this.layersByLevel[e];ar(a,t),t.elesQueue=[],t.invalid=!0,t.replacement&&(t.replacement.invalid=!0);for(var n=0;n3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o=e._private.rscratch;if(!(i&&!e.visible())&&!(o.badLine||o.allpts==null||isNaN(o.allpts[0]))){var l;r&&(l=r,t.translate(-l.x1,-l.y1));var u=i?e.pstyle("opacity").value:1,h=i?e.pstyle("line-opacity").value:1,c=e.pstyle("curve-style").value,v=e.pstyle("line-style").value,d=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,m=e.pstyle("line-outline-width").value,y=e.pstyle("line-outline-color").value,p=u*h,b=u*h,E=f(function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;c==="straight-triangle"?(s.eleStrokeStyle(t,e,P),s.drawEdgeTrianglePath(e,t,o.allpts)):(t.lineWidth=d,t.lineCap=g,s.eleStrokeStyle(t,e,P),s.drawEdgePath(e,t,o.allpts,v),t.lineCap="butt")},"drawLine"),S=f(function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:p;if(t.lineWidth=d+m,t.lineCap=g,m>0)s.colorStrokeStyle(t,y[0],y[1],y[2],P);else{t.lineCap="butt";return}c==="straight-triangle"?s.drawEdgeTrianglePath(e,t,o.allpts):(s.drawEdgePath(e,t,o.allpts,v),t.lineCap="butt")},"drawLineOutline"),w=f(function(){n&&s.drawEdgeOverlay(t,e)},"drawOverlay"),x=f(function(){n&&s.drawEdgeUnderlay(t,e)},"drawUnderlay"),T=f(function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:b;s.drawArrowheads(t,e,P)},"drawArrows"),C=f(function(){s.drawElementText(t,e,null,a)},"drawText");t.lineJoin="round";var D=e.pstyle("ghost").value==="yes";if(D){var L=e.pstyle("ghost-offset-x").pfValue,O=e.pstyle("ghost-offset-y").pfValue,A=e.pstyle("ghost-opacity").value,I=p*A;t.translate(L,O),E(I),T(I),t.translate(-L,-O)}else S();x(),E(),T(),w(),C(),r&&t.translate(l.x1,l.y1)}};var Ku=f(function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(r,a){if(a.visible()){var n=a.pstyle("".concat(e,"-opacity")).value;if(n!==0){var i=this,s=i.usePaths(),o=a._private.rscratch,l=a.pstyle("".concat(e,"-padding")).pfValue,u=2*l,h=a.pstyle("".concat(e,"-color")).value;r.lineWidth=u,o.edgeType==="self"&&!s?r.lineCap="butt":r.lineCap="round",i.colorStrokeStyle(r,h[0],h[1],h[2],n),i.drawEdgePath(a,r,o.allpts,"solid")}}}},"drawEdgeOverlayUnderlay");Kt.drawEdgeOverlay=Ku("overlay");Kt.drawEdgeUnderlay=Ku("underlay");Kt.drawEdgePath=function(t,e,r,a){var n=t._private.rscratch,i=e,s,o=!1,l=this.usePaths(),u=t.pstyle("line-dash-pattern").pfValue,h=t.pstyle("line-dash-offset").pfValue;if(l){var c=r.join("$"),v=n.pathCacheKey&&n.pathCacheKey===c;v?(s=e=n.pathCache,o=!0):(s=e=new Path2D,n.pathCacheKey=c,n.pathCache=s)}if(i.setLineDash)switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(u),i.lineDashOffset=h;break;case"solid":i.setLineDash([]);break}if(!o&&!n.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(r[0],r[1]),n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var d=2;d+35&&arguments[5]!==void 0?arguments[5]:!0,s=this;if(a==null){if(i&&!s.eleTextBiggerThanMin(e))return}else if(a===!1)return;if(e.isNode()){var o=e.pstyle("label");if(!o||!o.value)return;var l=s.getLabelJustification(e);t.textAlign=l,t.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,h=e.pstyle("label"),c=e.pstyle("source-label"),v=e.pstyle("target-label");if(u||(!h||!h.value)&&(!c||!c.value)&&(!v||!v.value))return;t.textAlign="center",t.textBaseline="bottom"}var d=!r,g;r&&(g=r,t.translate(-g.x1,-g.y1)),n==null?(s.drawText(t,e,null,d,i),e.isEdge()&&(s.drawText(t,e,"source",d,i),s.drawText(t,e,"target",d,i))):s.drawText(t,e,n,d,i),r&&t.translate(g.x1,g.y1)};Cr.getFontCache=function(t){var e;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:!0,a=e.pstyle("font-style").strValue,n=e.pstyle("font-size").pfValue+"px",i=e.pstyle("font-family").strValue,s=e.pstyle("font-weight").strValue,o=r?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*o,u=e.pstyle("color").value,h=e.pstyle("text-outline-color").value;t.font=a+" "+s+" "+n+" "+i,t.lineJoin="round",this.colorFillStyle(t,u[0],u[1],u[2],o),this.colorStrokeStyle(t,h[0],h[1],h[2],l)};function jn(t,e,r,a,n){var i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:5,s=arguments.length>6?arguments[6]:void 0;t.beginPath(),t.moveTo(e+i,r),t.lineTo(e+a-i,r),t.quadraticCurveTo(e+a,r,e+a,r+i),t.lineTo(e+a,r+n-i),t.quadraticCurveTo(e+a,r+n,e+a-i,r+n),t.lineTo(e+i,r+n),t.quadraticCurveTo(e,r+n,e,r+n-i),t.lineTo(e,r+i),t.quadraticCurveTo(e,r,e+i,r),t.closePath(),s?t.stroke():t.fill()}f(jn,"roundRect");Cr.getTextAngle=function(t,e){var r,a=t._private,n=a.rscratch,i=e?e+"-":"",s=t.pstyle(i+"text-rotation"),o=Mt(n,"labelAngle",e);return s.strValue==="autorotate"?r=t.isEdge()?o:0:s.strValue==="none"?r=0:r=s.pfValue,r};Cr.drawText=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=e._private,s=i.rscratch,o=n?e.effectiveOpacity():1;if(!(n&&(o===0||e.pstyle("text-opacity").value===0))){r==="main"&&(r=null);var l=Mt(s,"labelX",r),u=Mt(s,"labelY",r),h,c,v=this.getLabelText(e,r);if(v!=null&&v!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(t,e,n);var d=r?r+"-":"",g=Mt(s,"labelWidth",r),m=Mt(s,"labelHeight",r),y=e.pstyle(d+"text-margin-x").pfValue,p=e.pstyle(d+"text-margin-y").pfValue,b=e.isEdge(),E=e.pstyle("text-halign").value,S=e.pstyle("text-valign").value;b&&(E="center",S="center"),l+=y,u+=p;var w;switch(a?w=this.getTextAngle(e,r):w=0,w!==0&&(h=l,c=u,t.translate(h,c),t.rotate(w),l=0,u=0),S){case"top":break;case"center":u+=m/2;break;case"bottom":u+=m;break}var x=e.pstyle("text-background-opacity").value,T=e.pstyle("text-border-opacity").value,C=e.pstyle("text-border-width").pfValue,D=e.pstyle("text-background-padding").pfValue,L=e.pstyle("text-background-shape").strValue,O=L.indexOf("round")===0,A=2;if(x>0||C>0&&T>0){var I=l-D;switch(E){case"left":I-=g;break;case"center":I-=g/2;break}var M=u-m-D,P=g+2*D,R=m+2*D;if(x>0){var k=t.fillStyle,B=e.pstyle("text-background-color").value;t.fillStyle="rgba("+B[0]+","+B[1]+","+B[2]+","+x*o+")",O?jn(t,I,M,P,R,A):t.fillRect(I,M,P,R),t.fillStyle=k}if(C>0&&T>0){var F=t.strokeStyle,U=t.lineWidth,V=e.pstyle("text-border-color").value,G=e.pstyle("text-border-style").value;if(t.strokeStyle="rgba("+V[0]+","+V[1]+","+V[2]+","+T*o+")",t.lineWidth=C,t.setLineDash)switch(G){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"double":t.lineWidth=C/4,t.setLineDash([]);break;case"solid":t.setLineDash([]);break}if(O?jn(t,I,M,P,R,A,"stroke"):t.strokeRect(I,M,P,R),G==="double"){var $=C/2;O?jn(t,I+$,M+$,P-$*2,R-$*2,A,"stroke"):t.strokeRect(I+$,M+$,P-$*2,R-$*2)}t.setLineDash&&t.setLineDash([]),t.lineWidth=U,t.strokeStyle=F}}var j=2*e.pstyle("text-outline-width").pfValue;if(j>0&&(t.lineWidth=j),e.pstyle("text-wrap").value==="wrap"){var Q=Mt(s,"labelWrapCachedLines",r),H=Mt(s,"labelLineHeight",r),te=g/2,_=this.getLabelJustification(e);switch(_==="auto"||(E==="left"?_==="left"?l+=-g:_==="center"&&(l+=-te):E==="center"?_==="left"?l+=-te:_==="right"&&(l+=te):E==="right"&&(_==="center"?l+=te:_==="right"&&(l+=g))),S){case"top":u-=(Q.length-1)*H;break;case"center":case"bottom":u-=(Q.length-1)*H;break}for(var z=0;z0&&t.strokeText(Q[z],l,u),t.fillText(Q[z],l,u),u+=H}else j>0&&t.strokeText(v,l,u),t.fillText(v,l,u);w!==0&&(t.rotate(-w),t.translate(-h,-c))}}};var Jr={};Jr.drawNode=function(t,e,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0,s=this,o,l,u=e._private,h=u.rscratch,c=e.position();if(!(!oe(c.x)||!oe(c.y))&&!(i&&!e.visible())){var v=i?e.effectiveOpacity():1,d=s.usePaths(),g,m=!1,y=e.padding();o=e.width()+2*y,l=e.height()+2*y;var p;r&&(p=r,t.translate(-p.x1,-p.y1));for(var b=e.pstyle("background-image"),E=b.value,S=new Array(E.length),w=new Array(E.length),x=0,T=0;T0&&arguments[0]!==void 0?arguments[0]:I;s.eleFillStyle(t,e,ne)},"setupShapeColor"),z=f(function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:V;s.colorStrokeStyle(t,M[0],M[1],M[2],ne)},"setupBorderColor"),Z=f(function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q;s.colorStrokeStyle(t,$[0],$[1],$[2],ne)},"setupOutlineColor"),K=f(function(ne,W,ae,me){var be=s.nodePathCache=s.nodePathCache||[],ve=Bo(ae==="polygon"?ae+","+me.join(","):ae,""+W,""+ne,""+te),we=be[ve],he,pe=!1;return we!=null?(he=we,pe=!0,h.pathCache=he):(he=new Path2D,be[ve]=h.pathCache=he),{path:he,cacheHit:pe}},"getPath"),ie=e.pstyle("shape").strValue,de=e.pstyle("shape-polygon-points").pfValue;if(d){t.translate(c.x,c.y);var re=K(o,l,ie,de);g=re.path,m=re.cacheHit}var se=f(function(){if(!m){var ne=c;d&&(ne={x:0,y:0}),s.nodeShapes[s.getNodeShape(e)].draw(g||t,ne.x,ne.y,o,l,te,h)}d?t.fill(g):t.fill()},"drawShape"),le=f(function(){for(var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,ae=u.backgrounding,me=0,be=0;be0&&arguments[0]!==void 0?arguments[0]:!1,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:v;s.hasPie(e)&&(s.drawPie(t,e,W),ne&&(d||s.nodeShapes[s.getNodeShape(e)].draw(t,c.x,c.y,o,l,te,h)))},"drawPie"),ue=f(function(){var ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:v,W=(O>0?O:-O)*ne,ae=O>0?0:255;O!==0&&(s.colorFillStyle(t,ae,ae,ae,W),d?t.fill(g):t.fill())},"darken"),ye=f(function(){if(A>0){if(t.lineWidth=A,t.lineCap=k,t.lineJoin=R,t.setLineDash)switch(P){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash(F),t.lineDashOffset=U;break;case"solid":case"double":t.setLineDash([]);break}if(B!=="center"){if(t.save(),t.lineWidth*=2,B==="inside")d?t.clip(g):t.clip();else{var ne=new Path2D;ne.rect(-o/2-A,-l/2-A,o+2*A,l+2*A),ne.addPath(g),t.clip(ne,"evenodd")}d?t.stroke(g):t.stroke(),t.restore()}else d?t.stroke(g):t.stroke();if(P==="double"){t.lineWidth=A/3;var W=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",d?t.stroke(g):t.stroke(),t.globalCompositeOperation=W}t.setLineDash&&t.setLineDash([])}},"drawBorder"),Oe=f(function(){if(G>0){if(t.lineWidth=G,t.lineCap="butt",t.setLineDash)switch(j){case"dotted":t.setLineDash([1,1]);break;case"dashed":t.setLineDash([4,2]);break;case"solid":case"double":t.setLineDash([]);break}var ne=c;d&&(ne={x:0,y:0});var W=s.getNodeShape(e),ae=A;B==="inside"&&(ae=0),B==="outside"&&(ae*=2);var me=(o+ae+(G+H))/o,be=(l+ae+(G+H))/l,ve=o*me,we=l*be,he=s.nodeShapes[W].points,pe;if(d){var Ge=K(ve,we,W,he);pe=Ge.path}if(W==="ellipse")s.drawEllipsePath(pe||t,ne.x,ne.y,ve,we);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(W)){var ke=0,ft=0,Qe=0;W==="round-diamond"?ke=(ae+H+G)*1.4:W==="round-heptagon"?(ke=(ae+H+G)*1.075,Qe=-(ae/2+H+G)/35):W==="round-hexagon"?ke=(ae+H+G)*1.12:W==="round-pentagon"?(ke=(ae+H+G)*1.13,Qe=-(ae/2+H+G)/15):W==="round-tag"?(ke=(ae+H+G)*1.12,ft=(ae/2+G+H)*.07):W==="round-triangle"&&(ke=(ae+H+G)*(Math.PI/2),Qe=-(ae+H/2+G)/Math.PI),ke!==0&&(me=(o+ke)/o,ve=o*me,["round-hexagon","round-tag"].includes(W)||(be=(l+ke)/l,we=l*be)),te=te==="auto"?qo(ve,we):te;for(var Ye=ve/2,vt=we/2,Je=te+(ae+G+H)/2,ht=new Array(he.length/2),Tt=new Array(he.length/2),bt=0;bt0){if(n=n||a.position(),i==null||s==null){var d=a.padding();i=a.width()+2*d,s=a.height()+2*d}o.colorFillStyle(r,h[0],h[1],h[2],u),o.nodeShapes[c].draw(r,n.x,n.y,i+l*2,s+l*2,v),r.fill()}}}},"drawNodeOverlayUnderlay");Jr.drawNodeOverlay=Zu("overlay");Jr.drawNodeUnderlay=Zu("underlay");Jr.hasPie=function(t){return t=t[0],t._private.hasPie};Jr.drawPie=function(t,e,r,a){e=e[0],a=a||e.position();var n=e.cy().style(),i=e.pstyle("pie-size"),s=a.x,o=a.y,l=e.width(),u=e.height(),h=Math.min(l,u)/2,c=0,v=this.usePaths();v&&(s=0,o=0),i.units==="%"?h=h*i.pfValue:i.pfValue!==void 0&&(h=i.pfValue/2);for(var d=1;d<=n.pieBackgroundN;d++){var g=e.pstyle("pie-"+d+"-background-size").value,m=e.pstyle("pie-"+d+"-background-color").value,y=e.pstyle("pie-"+d+"-background-opacity").value*r,p=g/100;p+c>1&&(p=1-c);var b=1.5*Math.PI+2*Math.PI*c,E=2*Math.PI*p,S=b+E;g===0||c>=1||c+p>1||(t.beginPath(),t.moveTo(s,o),t.arc(s,o,h,b,S),t.closePath(),this.colorFillStyle(t,m[0],m[1],m[2],y),t.fill(),c+=p)}};var mt={},iy=100;mt.getPixelRatio=function(){var t=this.data.contexts[0];if(this.forcedPixelRatio!=null)return this.forcedPixelRatio;var e=this.cy.window(),r=t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return(e.devicePixelRatio||1)/r};mt.paintCache=function(t){for(var e=this.paintCaches=this.paintCaches||[],r=!0,a,n=0;ns.minMbLowQualFrames&&(s.motionBlurPxRatio=s.mbPxRBlurry)),s.clearingMotionBlur&&(s.motionBlurPxRatio=1),s.textureDrawLastFrame&&!c&&(h[s.NODE]=!0,h[s.SELECT_BOX]=!0);var b=l.style(),E=l.zoom(),S=n!==void 0?n:E,w=l.pan(),x={x:w.x,y:w.y},T={zoom:E,pan:{x:w.x,y:w.y}},C=s.prevViewport,D=C===void 0||T.zoom!==C.zoom||T.pan.x!==C.pan.x||T.pan.y!==C.pan.y;!D&&!(m&&!g)&&(s.motionBlurPxRatio=1),i&&(x=i),S*=o,x.x*=o,x.y*=o;var L=s.getCachedZSortedEles();function O(re,se,le,ce,ue){var ye=re.globalCompositeOperation;re.globalCompositeOperation="destination-out",s.colorFillStyle(re,255,255,255,s.motionBlurTransparency),re.fillRect(se,le,ce,ue),re.globalCompositeOperation=ye}f(O,"mbclear");function A(re,se){var le,ce,ue,ye;!s.clearingMotionBlur&&(re===u.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]||re===u.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG])?(le={x:w.x*d,y:w.y*d},ce=E*d,ue=s.canvasWidth*d,ye=s.canvasHeight*d):(le=x,ce=S,ue=s.canvasWidth,ye=s.canvasHeight),re.setTransform(1,0,0,1,0,0),se==="motionBlur"?O(re,0,0,ue,ye):!e&&(se===void 0||se)&&re.clearRect(0,0,ue,ye),r||(re.translate(le.x,le.y),re.scale(ce,ce)),i&&re.translate(i.x,i.y),n&&re.scale(n,n)}if(f(A,"setContextTransform"),c||(s.textureDrawLastFrame=!1),c){if(s.textureDrawLastFrame=!0,!s.textureCache){s.textureCache={},s.textureCache.bb=l.mutableElements().boundingBox(),s.textureCache.texture=s.data.bufferCanvases[s.TEXTURE_BUFFER];var I=s.data.bufferContexts[s.TEXTURE_BUFFER];I.setTransform(1,0,0,1,0,0),I.clearRect(0,0,s.canvasWidth*s.textureMult,s.canvasHeight*s.textureMult),s.render({forcedContext:I,drawOnlyNodeLayer:!0,forcedPxRatio:o*s.textureMult});var T=s.textureCache.viewport={zoom:l.zoom(),pan:l.pan(),width:s.canvasWidth,height:s.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}h[s.DRAG]=!1,h[s.NODE]=!1;var M=u.contexts[s.NODE],P=s.textureCache.texture,T=s.textureCache.viewport;M.setTransform(1,0,0,1,0,0),v?O(M,0,0,T.width,T.height):M.clearRect(0,0,T.width,T.height);var R=b.core("outside-texture-bg-color").value,k=b.core("outside-texture-bg-opacity").value;s.colorFillStyle(M,R[0],R[1],R[2],k),M.fillRect(0,0,T.width,T.height);var E=l.zoom();A(M,!1),M.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/o,T.height/T.zoom/o),M.drawImage(P,T.mpan.x,T.mpan.y,T.width/T.zoom/o,T.height/T.zoom/o)}else s.textureOnViewport&&!e&&(s.textureCache=null);var B=l.extent(),F=s.pinching||s.hoverData.dragging||s.swipePanning||s.data.wheelZooming||s.hoverData.draggingEles||s.cy.animated(),U=s.hideEdgesOnViewport&&F,V=[];if(V[s.NODE]=!h[s.NODE]&&v&&!s.clearedForMotionBlur[s.NODE]||s.clearingMotionBlur,V[s.NODE]&&(s.clearedForMotionBlur[s.NODE]=!0),V[s.DRAG]=!h[s.DRAG]&&v&&!s.clearedForMotionBlur[s.DRAG]||s.clearingMotionBlur,V[s.DRAG]&&(s.clearedForMotionBlur[s.DRAG]=!0),h[s.NODE]||r||a||V[s.NODE]){var G=v&&!V[s.NODE]&&d!==1,M=e||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_NODE]:u.contexts[s.NODE]),$=v&&!G?"motionBlur":void 0;A(M,$),U?s.drawCachedNodes(M,L.nondrag,o,B):s.drawLayeredElements(M,L.nondrag,o,B),s.debug&&s.drawDebugPoints(M,L.nondrag),!r&&!v&&(h[s.NODE]=!1)}if(!a&&(h[s.DRAG]||r||V[s.DRAG])){var G=v&&!V[s.DRAG]&&d!==1,M=e||(G?s.data.bufferContexts[s.MOTIONBLUR_BUFFER_DRAG]:u.contexts[s.DRAG]);A(M,v&&!G?"motionBlur":void 0),U?s.drawCachedNodes(M,L.drag,o,B):s.drawCachedElements(M,L.drag,o,B),s.debug&&s.drawDebugPoints(M,L.drag),!r&&!v&&(h[s.DRAG]=!1)}if(s.showFps||!a&&h[s.SELECT_BOX]&&!r){var M=e||u.contexts[s.SELECT_BOX];if(A(M),s.selection[4]==1&&(s.hoverData.selecting||s.touchData.selecting)){var E=s.cy.zoom(),j=b.core("selection-box-border-width").value/E;M.lineWidth=j,M.fillStyle="rgba("+b.core("selection-box-color").value[0]+","+b.core("selection-box-color").value[1]+","+b.core("selection-box-color").value[2]+","+b.core("selection-box-opacity").value+")",M.fillRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]),j>0&&(M.strokeStyle="rgba("+b.core("selection-box-border-color").value[0]+","+b.core("selection-box-border-color").value[1]+","+b.core("selection-box-border-color").value[2]+","+b.core("selection-box-opacity").value+")",M.strokeRect(s.selection[0],s.selection[1],s.selection[2]-s.selection[0],s.selection[3]-s.selection[1]))}if(u.bgActivePosistion&&!s.hoverData.selecting){var E=s.cy.zoom(),Q=u.bgActivePosistion;M.fillStyle="rgba("+b.core("active-bg-color").value[0]+","+b.core("active-bg-color").value[1]+","+b.core("active-bg-color").value[2]+","+b.core("active-bg-opacity").value+")",M.beginPath(),M.arc(Q.x,Q.y,b.core("active-bg-size").pfValue/E,0,2*Math.PI),M.fill()}var H=s.lastRedrawTime;if(s.showFps&&H){H=Math.round(H);var te=Math.round(1e3/H);M.setTransform(1,0,0,1,0,0),M.fillStyle="rgba(255, 0, 0, 0.75)",M.strokeStyle="rgba(255, 0, 0, 0.75)",M.lineWidth=1,M.fillText("1 frame = "+H+" ms = "+te+" fps",0,20);var _=60;M.strokeRect(0,30,250,20),M.fillRect(0,30,250*Math.min(te/_,1),20)}r||(h[s.SELECT_BOX]=!1)}if(v&&d!==1){var z=u.contexts[s.NODE],Z=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_NODE],K=u.contexts[s.DRAG],ie=s.data.bufferCanvases[s.MOTIONBLUR_BUFFER_DRAG],de=f(function(se,le,ce){se.setTransform(1,0,0,1,0,0),ce||!p?se.clearRect(0,0,s.canvasWidth,s.canvasHeight):O(se,0,0,s.canvasWidth,s.canvasHeight);var ue=d;se.drawImage(le,0,0,s.canvasWidth*ue,s.canvasHeight*ue,0,0,s.canvasWidth,s.canvasHeight)},"drawMotionBlur");(h[s.NODE]||V[s.NODE])&&(de(z,Z,V[s.NODE]),h[s.NODE]=!1),(h[s.DRAG]||V[s.DRAG])&&(de(K,ie,V[s.DRAG]),h[s.DRAG]=!1)}s.prevViewport=T,s.clearingMotionBlur&&(s.clearingMotionBlur=!1,s.motionBlurCleared=!0,s.motionBlur=!0),v&&(s.motionBlurTimeout=setTimeout(function(){s.motionBlurTimeout=null,s.clearedForMotionBlur[s.NODE]=!1,s.clearedForMotionBlur[s.DRAG]=!1,s.motionBlur=!1,s.clearingMotionBlur=!c,s.mbFrames=0,h[s.NODE]=!0,h[s.DRAG]=!0,s.redraw()},iy)),e||l.emit("render")};var ur={};ur.drawPolygonPath=function(t,e,r,a,n,i){var s=a/2,o=n/2;t.beginPath&&t.beginPath(),t.moveTo(e+s*i[0],r+o*i[1]);for(var l=1;l0&&s>0){d.clearRect(0,0,i,s),d.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(t.full)d.translate(-a.x1*u,-a.y1*u),d.scale(u,u),this.drawElements(d,g),d.scale(1/u,1/u),d.translate(a.x1*u,a.y1*u);else{var m=e.pan(),y={x:m.x*u,y:m.y*u};u*=e.zoom(),d.translate(y.x,y.y),d.scale(u,u),this.drawElements(d,g),d.scale(1/u,1/u),d.translate(-y.x,-y.y)}t.bg&&(d.globalCompositeOperation="destination-over",d.fillStyle=t.bg,d.rect(0,0,i,s),d.fill())}return v};function sy(t,e){for(var r=atob(t),a=new ArrayBuffer(r.length),n=new Uint8Array(a),i=0;i"u"?"undefined":qe(OffscreenCanvas))!=="undefined")r=new OffscreenCanvas(t,e);else{var a=this.cy.window(),n=a.document;r=n.createElement("canvas"),r.width=t,r.height=e}return r};[Wu,Vt,Kt,zi,Cr,Jr,mt,ur,Ra,ju].forEach(function(t){Ee(Le,t)});var ly=[{name:"null",impl:Pu},{name:"base",impl:Hu},{name:"canvas",impl:oy}],fy=[{type:"layout",extensions:pp},{type:"renderer",extensions:ly}],tl={},rl={};function al(t,e,r){var a=r,n=f(function(C){Ne("Can not register `"+e+"` for `"+t+"` since `"+C+"` already exists in the prototype and can not be overridden")},"overrideErr");if(t==="core"){if(Da.prototype[e])return n(e);Da.prototype[e]=r}else if(t==="collection"){if(tt.prototype[e])return n(e);tt.prototype[e]=r}else if(t==="layout"){for(var i=f(function(C){this.options=C,r.call(this,C),De(this._private)||(this._private={}),this._private.cy=C.cy,this._private.listeners=[],this.createEmitter()},"Layout"),s=i.prototype=Object.create(r.prototype),o=[],l=0;l)/g,`
`);await ts(h,c,{useHtmlLabels:i,width:r.width,classes:"mindmap-node-label"},n),i||h.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");let v=h.node().getBBox(),[d]=es(n.fontSize);if(r.height=v.height+d*1.1*.5+r.padding,r.width=v.width+2*r.padding,r.icon)if(r.type===t.nodeType.CIRCLE)r.height+=50,r.width+=50,o.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),h.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")");else{r.width+=50;let g=r.height;r.height=Math.max(g,60);let m=Math.abs(r.height-g);o.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+m/2+"px;").append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+s+" "+r.icon),h.attr("transform","translate("+(25+r.width/2)+", "+(m/2+r.padding/2)+")")}else if(i){let g=(r.width-v.width)/2,m=(r.height-v.height)/2;h.attr("transform","translate("+g+", "+m+")")}else{let g=r.width/2,m=r.padding/2;h.attr("transform","translate("+g+", "+m+")")}switch(r.type){case t.nodeType.DEFAULT:gy(t,u,r,s);break;case t.nodeType.ROUNDED_RECT:xy(t,u,r,s);break;case t.nodeType.RECT:py(t,u,r,s);break;case t.nodeType.CIRCLE:u.attr("transform","translate("+r.width/2+", "+ +r.height/2+")"),by(t,u,r,s);break;case t.nodeType.CLOUD:yy(t,u,r,s);break;case t.nodeType.BANG:my(t,u,r,s);break;case t.nodeType.HEXAGON:wy(t,u,r,s);break}return t.setElementForId(r.id,o),r.height},"drawNode"),ul=f(function(t,e){let r=t.getElementById(e.id),a=e.x||0,n=e.y||0;r.attr("transform","translate("+a+","+n+")")},"positionNode");qt.use(ll.default);async function fl(t,e,r,a,n){await ol(t,e,r,a,n),r.children&&await Promise.all(r.children.map((i,s)=>fl(t,e,i,a<0?s:a,n)))}f(fl,"drawNodes");function Ty(t,e){e.edges().map((r,a)=>{let n=r.data();if(r[0]._private.bodyBounds){let i=r[0]._private.rscratch;Yt.trace("Edge: ",a,n),t.insert("path").attr("d",`M ${i.startX},${i.startY} L ${i.midX},${i.midY} L${i.endX},${i.endY} `).attr("class","edge section-edge-"+n.section+" edge-depth-"+n.depth)}})}f(Ty,"drawEdges");function hl(t,e,r,a){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:a,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}}),t.children&&t.children.forEach(n=>{hl(n,e,r,a+1),e.add({group:"edges",data:{id:`${t.id}_${n.id}`,source:t.id,target:n.id,depth:a,section:n.section}})})}f(hl,"addNodes");function Cy(t,e){return new Promise(r=>{let a=ji("body").append("div").attr("id","cy").attr("style","display:none"),n=qt({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});a.remove(),hl(t,n,e,0),n.nodes().forEach(function(i){i.layoutDimensions=()=>{let s=i.data();return{w:s.width,h:s.height}}}),n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1}).run(),n.ready(i=>{Yt.info("Ready",i),r(n)})})}f(Cy,"layoutMindmap");function Dy(t,e){e.nodes().map((r,a)=>{let n=r.data();n.x=r.position().x,n.y=r.position().y,ul(t,n);let i=t.getElementById(n.nodeId);Yt.info("Id:",a,"Position: (",r.position().x,", ",r.position().y,")",n),i.attr("transform",`translate(${r.position().x-n.width/2}, ${r.position().y-n.height/2})`),i.attr("attr",`apa-${a})`)})}f(Dy,"positionNodes");var Sy=f(async(t,e,r,a)=>{Yt.debug(`Rendering mindmap diagram
`+t);let n=a.db,i=n.getMindmap();if(!i)return;let s=ra();s.htmlLabels=!1;let o=rs(e),l=o.append("g");l.attr("class","mindmap-edges");let u=o.append("g");u.attr("class","mindmap-nodes"),await fl(n,u,i,-1,s);let h=await Cy(i,s);Ty(l,h),Dy(n,h),Ji(void 0,o,s.mindmap?.padding??Sr.mindmap.padding,s.mindmap?.useMaxWidth??Sr.mindmap.useMaxWidth)},"draw"),cl={draw:Sy};var Ly=f(t=>{let e="";for(let r=0;r`
  .edge {
    stroke-width: 3;
  }
  ${Ly(t)}
  .section-root rect, .section-root path, .section-root circle, .section-root polygon  {
    fill: ${t.git0};
  }
  .section-root text {
    fill: ${t.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"),vl=Ay;var lm={db:is,renderer:cl,parser:as,styles:vl};export{lm as diagram};
/*! Bundled license information:

cytoscape/dist/cytoscape.esm.mjs:
  (*!
  Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
  Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
  Licensed under The MIT License (http://opensource.org/licenses/MIT)
  *)
  (*!
  Event object based on jQuery events, MIT license
  
  https://jquery.org/license/
  https://tldrlegal.com/license/mit-license
  https://github.com/jquery/jquery/blob/master/src/event.js
  *)
  (*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
  (*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License *)
*/




© 2015 - 2024 Weber Informatics LLC | Privacy Policy