@codingame/monaco-vscode-markdown-language-features-default-extension 36.2.6 → 37.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +237 -23
- package/package.json +2 -2
- package/resources/abnfDiagram-VCTEODGH-MFZBS7QV.js +1 -0
- package/resources/architecture-7GRP2DOG-KMESPJ5A.js +1 -0
- package/resources/architectureDiagram-5GKGNRK7-MTTZPDNG.js +36 -0
- package/resources/blockDiagram-NRAW4CY4-UDRMVB5I.js +129 -0
- package/resources/c4Diagram-UCG6FXSJ-CNUYFC6N.js +38 -0
- package/resources/chunk-2KBWIZHB.js +14 -0
- package/resources/chunk-3CEAP2V5.js +1 -0
- package/resources/chunk-43RBMH4Y.js +1 -0
- package/resources/chunk-4AUIAGYT.js +1 -0
- package/resources/chunk-4PRM3W7S.js +88 -0
- package/resources/chunk-5DJUZA4F.js +1 -0
- package/resources/chunk-6LQNQPBM.js +1 -0
- package/resources/chunk-A3DHMJKP.js +1 -0
- package/resources/chunk-ATDVZUJ2.js +231 -0
- package/resources/chunk-CBQW2LLN.js +1 -0
- package/resources/chunk-CCQNES6G.js +1 -0
- package/resources/chunk-CD5RYVNW.js +1 -0
- package/resources/chunk-CQFFNO72.js +1 -0
- package/resources/chunk-EWILYK3H.js +1 -0
- package/resources/chunk-EWVD6AUZ.js +15 -0
- package/resources/chunk-EXFMYL6U.js +1 -0
- package/resources/chunk-FH3BATM5.js +1 -0
- package/resources/chunk-FK4OKHO7.js +178 -0
- package/resources/chunk-FZLE27CN.js +1 -0
- package/resources/chunk-HRJ5UBVC.js +1 -0
- package/resources/chunk-IEMKBRIG.js +339 -0
- package/resources/chunk-IRNO36C3.js +1 -0
- package/resources/chunk-J4SQIVOP.js +1 -0
- package/resources/chunk-JAORNH2M.js +2 -0
- package/resources/chunk-JBQZ5UCE.js +1 -0
- package/resources/chunk-JFI5BOLY.js +1 -0
- package/resources/chunk-JXCTOEX6.js +1 -0
- package/resources/chunk-K2JFJOPP.js +1 -0
- package/resources/chunk-LK6KML2S.js +10 -0
- package/resources/chunk-MNHOAW4R.js +3 -0
- package/resources/chunk-NLCJ5AKJ.js +132 -0
- package/resources/chunk-OOJM4CTU.js +1 -0
- package/resources/chunk-R7CM4BQN.js +2 -0
- package/resources/chunk-RBL2QVA3.js +1 -0
- package/resources/chunk-SNGMH3JW.js +2 -0
- package/resources/chunk-TGD3YKTU.js +32 -0
- package/resources/chunk-TGYBLZFN.js +1 -0
- package/resources/chunk-U3E5RSXE.js +62 -0
- package/resources/chunk-U7TCJVVP.js +1 -0
- package/resources/chunk-WSHCWW4Q.js +2 -0
- package/resources/chunk-WVYKIHVG.js +1 -0
- package/resources/chunk-XCMS6RVA.js +1 -0
- package/resources/chunk-XM54GAH3.js +206 -0
- package/resources/chunk-YICKNY6Y.js +1 -0
- package/resources/chunk-YNKYB66X.js +257 -0
- package/resources/chunk-ZMBQGVIF.js +1 -0
- package/resources/chunk-ZNREFWKG.js +1 -0
- package/resources/chunk-ZU7JKVUR.js +168 -0
- package/resources/chunk-ZYRITDEB.js +72 -0
- package/resources/classDiagram-DTDB5LWJ-TBJLBGTZ.js +1 -0
- package/resources/codicon-R6HEZFPR.ttf +0 -0
- package/resources/cose-bilkent-JH36ORCC-7TCRTQWC.js +1 -0
- package/resources/cynefin-OW5HDTMX-QMEUXFXO.js +1 -0
- package/resources/cynefinDiagram-5FMLGOSQ-J745EYTI.js +62 -0
- package/resources/dagre-3AP2YEHR-CUFPL4A5.js +4 -0
- package/resources/diagram-S7CK7UJ4-SC5AFKXH.js +30 -0
- package/resources/diagram-UQ7AKVKN-3O7WQJXE.js +41 -0
- package/resources/diagram-VSXAHHWV-SN3VCCS5.js +3 -0
- package/resources/diagram-VX7I27RA-7PQJWMN5.js +24 -0
- package/resources/diagram-Z3DM3KII-QZ45TJFK.js +24 -0
- package/resources/ebnfDiagram-PWID7BFC-CBJPGG56.js +1 -0
- package/resources/editor.css.txt +1 -1
- package/resources/editor.js +137 -3431
- package/resources/editor.ts +587 -46
- package/resources/erDiagram-SSCWMZ5O-TUKYG42P.js +99 -0
- package/resources/eventmodeling-NTZA5JFV-MGOPW7BD.js +1 -0
- package/resources/extension.js +179 -172
- package/resources/extension.js.map +4 -4
- package/resources/flowDiagram-A5DVABFB-M6K5X26V.js +1 -0
- package/resources/ganttDiagram-EL5Y4UJY-JCSKUU2V.js +292 -0
- package/resources/gitGraph-4MIJSDKK-ITDCTFJT.js +1 -0
- package/resources/gitGraphDiagram-WWUBYQGX-RXRB5JA2.js +106 -0
- package/resources/index.js +3 -3
- package/resources/index2.js +17 -17
- package/resources/info-A6RAGUB7-VXIEHQAI.js +1 -0
- package/resources/infoDiagram-RXCK75RN-2T6V4JS2.js +2 -0
- package/resources/ishikawaDiagram-5VMMS53U-6WC4IGXZ.js +70 -0
- package/resources/journeyDiagram-EYS64GPL-PZQYT6UF.js +139 -0
- package/resources/kanban-definition-3QL26DDD-VYBV345J.js +89 -0
- package/resources/katex-QJ7O5CJ5.js +1 -0
- package/resources/linkPresentationProvider.ts +179 -0
- package/resources/markdown.css.txt +39 -0
- package/resources/markdownEditor.css.txt +13 -0
- package/resources/mermaid.core-S5KCHHL2.js +18 -0
- package/resources/mindmap-definition-FBJOCRG2-H3I5F4WB.js +96 -0
- package/resources/package.json +1 -1
- package/resources/package.nls.json +1 -1
- package/resources/package.schema.json +1 -1
- package/resources/packet-AYTQ26CC-WLFKOXIZ.js +1 -0
- package/resources/pegDiagram-XKGWAZYB-HUV4U5RU.js +1 -0
- package/resources/pie-WAS4IAKB-GZIMD664.js +1 -0
- package/resources/pieDiagram-E7YTZNPT-XOJEVCEO.js +39 -0
- package/resources/pre.js +1 -1
- package/resources/preview-dark.svg +1 -1
- package/resources/preview-light.svg +1 -1
- package/resources/quadrantDiagram-AXDQQJYC-YPPZYAGP.js +7 -0
- package/resources/radar-RG4KPBEZ-URG5LVGS.js +1 -0
- package/resources/railroad-74A4TZTK-3ZMXCKLP.js +1 -0
- package/resources/railroad-abnf-HS5TGJTU-LBR5MV33.js +1 -0
- package/resources/railroad-ebnf-LZEXJU2U-YEVF3EJR.js +1 -0
- package/resources/railroad-peg-WCYAUIDC-CV774YSK.js +1 -0
- package/resources/railroadDiagram-O6MQD6OU-YZF7JNDT.js +1 -0
- package/resources/requirementDiagram-EFPCY7ZU-PZ7BYTDZ.js +84 -0
- package/resources/sankeyDiagram-P5KCCOFB-3P5DWREA.js +40 -0
- package/resources/sequenceDiagram-WJ2MYXX4-O52K5NPU.js +162 -0
- package/resources/sizeCapture-X5ZJPWSS-PRFE7SKK.js +1 -0
- package/resources/stateDiagram-HBIQ2CUA-KDPYCQOT.js +1 -0
- package/resources/stateDiagram-v2-4QOOHH4V-QBQE56JB.js +1 -0
- package/resources/swimlanes-XN3QIQJK-YCLJ3KIH.js +1 -0
- package/resources/swimlanesDiagram-VK2B7HYN-RS7VRH6T.js +8 -0
- package/resources/syntaxHighlighter.ts +2 -2
- package/resources/timeline-definition-24CTP7MA-GQ3MCHCF.js +120 -0
- package/resources/treeView-Q6P3EWNA-UEXUSAGC.js +1 -0
- package/resources/treemap-WGGIJYW6-NFXJPDAT.js +1 -0
- package/resources/tsconfig.json +1 -1
- package/resources/vennDiagram-4TSXK5OY-PNMXQJF6.js +34 -0
- package/resources/wardley-WFR3VGLG-MQ6DEZYA.js +1 -0
- package/resources/wardleyDiagram-VM6X3IG4-46KJTB57.js +78 -0
- package/resources/xychartDiagram-S5SC5T6Z-NSN5W7VL.js +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as j}from"./chunk-IEMKBRIG.js";import{b as V,h as it}from"./chunk-3CEAP2V5.js";import{a as W}from"./chunk-6LQNQPBM.js";import{a as $,c as pt}from"./chunk-OOJM4CTU.js";var q=$((k,K)=>{(function(C,v){typeof k=="object"&&typeof K=="object"?K.exports=v():typeof define=="function"&&define.amd?define([],v):typeof k=="object"?k.layoutBase=v():C.layoutBase=v()})(k,function(){return(function(N){var C={};function v(n){if(C[n])return C[n].exports;var e=C[n]={i:n,l:!1,exports:{}};return N[n].call(e.exports,e,e.exports,v),e.l=!0,e.exports}return v.m=N,v.c=C,v.i=function(n){return n},v.d=function(n,e,t){v.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},v.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return v.d(e,"a",e),e},v.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},v.p="",v(v.s=26)})([(function(N,C,v){"use strict";function n(){}n.QUALITY=1,n.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,n.DEFAULT_INCREMENTAL=!1,n.DEFAULT_ANIMATION_ON_LAYOUT=!0,n.DEFAULT_ANIMATION_DURING_LAYOUT=!1,n.DEFAULT_ANIMATION_PERIOD=50,n.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,n.DEFAULT_GRAPH_MARGIN=15,n.NODE_DIMENSIONS_INCLUDE_LABELS=!1,n.SIMPLE_NODE_SIZE=40,n.SIMPLE_NODE_HALF_SIZE=n.SIMPLE_NODE_SIZE/2,n.EMPTY_COMPOUND_NODE_SIZE=40,n.MIN_EDGE_LENGTH=1,n.WORLD_BOUNDARY=1e6,n.INITIAL_WORLD_BOUNDARY=n.WORLD_BOUNDARY/1e3,n.WORLD_CENTER_X=1200,n.WORLD_CENTER_Y=900,N.exports=n}),(function(N,C,v){"use strict";var n=v(2),e=v(8),t=v(9);function r(u,s,p){n.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=u,this.target=s}r.prototype=Object.create(n.prototype);for(var a in n)r[a]=n[a];r.prototype.getSource=function(){return this.source},r.prototype.getTarget=function(){return this.target},r.prototype.isInterGraph=function(){return this.isInterGraph},r.prototype.getLength=function(){return this.length},r.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},r.prototype.getBendpoints=function(){return this.bendpoints},r.prototype.getLca=function(){return this.lca},r.prototype.getSourceInLca=function(){return this.sourceInLca},r.prototype.getTargetInLca=function(){return this.targetInLca},r.prototype.getOtherEnd=function(u){if(this.source===u)return this.target;if(this.target===u)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(u,s){for(var p=this.getOtherEnd(u),i=s.getGraphManager().getRoot();;){if(p.getOwner()==s)return p;if(p.getOwner()==i)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var u=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),u),this.isOverlapingSourceAndTarget||(this.lengthX=u[0]-u[2],this.lengthY=u[1]-u[3],Math.abs(this.lengthX)<1&&(this.lengthX=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},r.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=t.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=t.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},N.exports=r}),(function(N,C,v){"use strict";function n(e){this.vGraphObject=e}N.exports=n}),(function(N,C,v){"use strict";var n=v(2),e=v(10),t=v(13),r=v(0),a=v(16),u=v(4);function s(i,h,l,d){l==null&&d==null&&(d=h),n.call(this,d),i.graphManager!=null&&(i=i.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=d,this.edges=[],this.graphManager=i,l!=null&&h!=null?this.rect=new t(h.x,h.y,l.width,l.height):this.rect=new t}s.prototype=Object.create(n.prototype);for(var p in n)s[p]=n[p];s.prototype.getEdges=function(){return this.edges},s.prototype.getChild=function(){return this.child},s.prototype.getOwner=function(){return this.owner},s.prototype.getWidth=function(){return this.rect.width},s.prototype.setWidth=function(i){this.rect.width=i},s.prototype.getHeight=function(){return this.rect.height},s.prototype.setHeight=function(i){this.rect.height=i},s.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},s.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},s.prototype.getCenter=function(){return new u(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},s.prototype.getLocation=function(){return new u(this.rect.x,this.rect.y)},s.prototype.getRect=function(){return this.rect},s.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},s.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},s.prototype.setRect=function(i,h){this.rect.x=i.x,this.rect.y=i.y,this.rect.width=h.width,this.rect.height=h.height},s.prototype.setCenter=function(i,h){this.rect.x=i-this.rect.width/2,this.rect.y=h-this.rect.height/2},s.prototype.setLocation=function(i,h){this.rect.x=i,this.rect.y=h},s.prototype.moveBy=function(i,h){this.rect.x+=i,this.rect.y+=h},s.prototype.getEdgeListToNode=function(i){var h=[],l,d=this;return d.edges.forEach(function(y){if(y.target==i){if(y.source!=d)throw"Incorrect edge source!";h.push(y)}}),h},s.prototype.getEdgesBetween=function(i){var h=[],l,d=this;return d.edges.forEach(function(y){if(!(y.source==d||y.target==d))throw"Incorrect edge source and/or target";(y.target==i||y.source==i)&&h.push(y)}),h},s.prototype.getNeighborsList=function(){var i=new Set,h=this;return h.edges.forEach(function(l){if(l.source==h)i.add(l.target);else{if(l.target!=h)throw"Incorrect incidency!";i.add(l.source)}}),i},s.prototype.withChildren=function(){var i=new Set,h,l;if(i.add(this),this.child!=null)for(var d=this.child.getNodes(),y=0;y<d.length;y++)h=d[y],l=h.withChildren(),l.forEach(function(T){i.add(T)});return i},s.prototype.getNoOfChildren=function(){var i=0,h;if(this.child==null)i=1;else for(var l=this.child.getNodes(),d=0;d<l.length;d++)h=l[d],i+=h.getNoOfChildren();return i==0&&(i=1),i},s.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},s.prototype.calcEstimatedSize=function(){return this.child==null?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},s.prototype.scatter=function(){var i,h,l=-r.INITIAL_WORLD_BOUNDARY,d=r.INITIAL_WORLD_BOUNDARY;i=r.WORLD_CENTER_X+a.nextDouble()*(d-l)+l;var y=-r.INITIAL_WORLD_BOUNDARY,T=r.INITIAL_WORLD_BOUNDARY;h=r.WORLD_CENTER_Y+a.nextDouble()*(T-y)+y,this.rect.x=i,this.rect.y=h},s.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var i=this.getChild();if(i.updateBounds(!0),this.rect.x=i.getLeft(),this.rect.y=i.getTop(),this.setWidth(i.getRight()-i.getLeft()),this.setHeight(i.getBottom()-i.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var h=i.getRight()-i.getLeft(),l=i.getBottom()-i.getTop();this.labelWidth>h&&(this.rect.x-=(this.labelWidth-h)/2,this.setWidth(this.labelWidth)),this.labelHeight>l&&(this.labelPos=="center"?this.rect.y-=(this.labelHeight-l)/2:this.labelPos=="top"&&(this.rect.y-=this.labelHeight-l),this.setHeight(this.labelHeight))}}},s.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},s.prototype.transform=function(i){var h=this.rect.x;h>r.WORLD_BOUNDARY?h=r.WORLD_BOUNDARY:h<-r.WORLD_BOUNDARY&&(h=-r.WORLD_BOUNDARY);var l=this.rect.y;l>r.WORLD_BOUNDARY?l=r.WORLD_BOUNDARY:l<-r.WORLD_BOUNDARY&&(l=-r.WORLD_BOUNDARY);var d=new u(h,l),y=i.inverseTransformPoint(d);this.setLocation(y.x,y.y)},s.prototype.getLeft=function(){return this.rect.x},s.prototype.getRight=function(){return this.rect.x+this.rect.width},s.prototype.getTop=function(){return this.rect.y},s.prototype.getBottom=function(){return this.rect.y+this.rect.height},s.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},N.exports=s}),(function(N,C,v){"use strict";function n(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.setX=function(e){this.x=e},n.prototype.setY=function(e){this.y=e},n.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},n.prototype.getCopy=function(){return new n(this.x,this.y)},n.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},N.exports=n}),(function(N,C,v){"use strict";var n=v(2),e=v(10),t=v(0),r=v(6),a=v(3),u=v(1),s=v(13),p=v(12),i=v(11);function h(d,y,T){n.call(this,T),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=d,y!=null&&y instanceof r?this.graphManager=y:y!=null&&y instanceof Layout&&(this.graphManager=y.graphManager)}h.prototype=Object.create(n.prototype);for(var l in n)h[l]=n[l];h.prototype.getNodes=function(){return this.nodes},h.prototype.getEdges=function(){return this.edges},h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getParent=function(){return this.parent},h.prototype.getLeft=function(){return this.left},h.prototype.getRight=function(){return this.right},h.prototype.getTop=function(){return this.top},h.prototype.getBottom=function(){return this.bottom},h.prototype.isConnected=function(){return this.isConnected},h.prototype.add=function(d,y,T){if(y==null&&T==null){var c=d;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(c)>-1)throw"Node already in graph!";return c.owner=this,this.getNodes().push(c),c}else{var D=d;if(!(this.getNodes().indexOf(y)>-1&&this.getNodes().indexOf(T)>-1))throw"Source or target not in graph!";if(!(y.owner==T.owner&&y.owner==this))throw"Both owners must be this graph!";return y.owner!=T.owner?null:(D.source=y,D.target=T,D.isInterGraph=!1,this.getEdges().push(D),y.edges.push(D),T!=y&&T.edges.push(D),D)}},h.prototype.remove=function(d){var y=d;if(d instanceof a){if(y==null)throw"Node is null!";if(!(y.owner!=null&&y.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var T=y.edges.slice(),c,D=T.length,E=0;E<D;E++)c=T[E],c.isInterGraph?this.graphManager.remove(c):c.source.owner.remove(c);var O=this.nodes.indexOf(y);if(O==-1)throw"Node not in owner node list!";this.nodes.splice(O,1)}else if(d instanceof u){var c=d;if(c==null)throw"Edge is null!";if(!(c.source!=null&&c.target!=null))throw"Source and/or target is null!";if(!(c.source.owner!=null&&c.target.owner!=null&&c.source.owner==this&&c.target.owner==this))throw"Source and/or target owner is invalid!";var o=c.source.edges.indexOf(c),g=c.target.edges.indexOf(c);if(!(o>-1&&g>-1))throw"Source and/or target doesn't know this edge!";c.source.edges.splice(o,1),c.target!=c.source&&c.target.edges.splice(g,1);var O=c.source.owner.getEdges().indexOf(c);if(O==-1)throw"Not in owner's edge list!";c.source.owner.getEdges().splice(O,1)}},h.prototype.updateLeftTop=function(){for(var d=e.MAX_VALUE,y=e.MAX_VALUE,T,c,D,E=this.getNodes(),O=E.length,o=0;o<O;o++){var g=E[o];T=g.getTop(),c=g.getLeft(),d>T&&(d=T),y>c&&(y=c)}return d==e.MAX_VALUE?null:(E[0].getParent().paddingLeft!=null?D=E[0].getParent().paddingLeft:D=this.margin,this.left=y-D,this.top=d-D,new p(this.left,this.top))},h.prototype.updateBounds=function(d){for(var y=e.MAX_VALUE,T=-e.MAX_VALUE,c=e.MAX_VALUE,D=-e.MAX_VALUE,E,O,o,g,f,L=this.nodes,A=L.length,I=0;I<A;I++){var m=L[I];d&&m.child!=null&&m.updateBounds(),E=m.getLeft(),O=m.getRight(),o=m.getTop(),g=m.getBottom(),y>E&&(y=E),T<O&&(T=O),c>o&&(c=o),D<g&&(D=g)}var R=new s(y,c,T-y,D-c);y==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),L[0].getParent().paddingLeft!=null?f=L[0].getParent().paddingLeft:f=this.margin,this.left=R.x-f,this.right=R.x+R.width+f,this.top=R.y-f,this.bottom=R.y+R.height+f},h.calculateBounds=function(d){for(var y=e.MAX_VALUE,T=-e.MAX_VALUE,c=e.MAX_VALUE,D=-e.MAX_VALUE,E,O,o,g,f=d.length,L=0;L<f;L++){var A=d[L];E=A.getLeft(),O=A.getRight(),o=A.getTop(),g=A.getBottom(),y>E&&(y=E),T<O&&(T=O),c>o&&(c=o),D<g&&(D=g)}var I=new s(y,c,T-y,D-c);return I},h.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},h.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},h.prototype.calcEstimatedSize=function(){for(var d=0,y=this.nodes,T=y.length,c=0;c<T;c++){var D=y[c];d+=D.calcEstimatedSize()}return d==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=d/Math.sqrt(this.nodes.length),this.estimatedSize},h.prototype.updateConnected=function(){var d=this;if(this.nodes.length==0){this.isConnected=!0;return}var y=new i,T=new Set,c=this.nodes[0],D,E,O=c.withChildren();for(O.forEach(function(I){y.push(I),T.add(I)});y.length!==0;){c=y.shift(),D=c.getEdges();for(var o=D.length,g=0;g<o;g++){var f=D[g];if(E=f.getOtherEndInGraph(c,this),E!=null&&!T.has(E)){var L=E.withChildren();L.forEach(function(I){y.push(I),T.add(I)})}}}if(this.isConnected=!1,T.size>=this.nodes.length){var A=0;T.forEach(function(I){I.owner==d&&A++}),A==this.nodes.length&&(this.isConnected=!0)}},N.exports=h}),(function(N,C,v){"use strict";var n,e=v(1);function t(r){n=v(5),this.layout=r,this.graphs=[],this.edges=[]}t.prototype.addRoot=function(){var r=this.layout.newGraph(),a=this.layout.newNode(null),u=this.add(r,a);return this.setRootGraph(u),this.rootGraph},t.prototype.add=function(r,a,u,s,p){if(u==null&&s==null&&p==null){if(r==null)throw"Graph is null!";if(a==null)throw"Parent node is null!";if(this.graphs.indexOf(r)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(r),r.parent!=null)throw"Already has a parent!";if(a.child!=null)throw"Already has a child!";return r.parent=a,a.child=r,r}else{p=u,s=a,u=r;var i=s.getOwner(),h=p.getOwner();if(!(i!=null&&i.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(h!=null&&h.getGraphManager()==this))throw"Target not in this graph mgr!";if(i==h)return u.isInterGraph=!1,i.add(u,s,p);if(u.isInterGraph=!0,u.source=s,u.target=p,this.edges.indexOf(u)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(u),!(u.source!=null&&u.target!=null))throw"Edge source and/or target is null!";if(!(u.source.edges.indexOf(u)==-1&&u.target.edges.indexOf(u)==-1))throw"Edge already in source and/or target incidency list!";return u.source.edges.push(u),u.target.edges.push(u),u}},t.prototype.remove=function(r){if(r instanceof n){var a=r;if(a.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(a==this.rootGraph||a.parent!=null&&a.parent.graphManager==this))throw"Invalid parent node!";var u=[];u=u.concat(a.getEdges());for(var s,p=u.length,i=0;i<p;i++)s=u[i],a.remove(s);var h=[];h=h.concat(a.getNodes());var l;p=h.length;for(var i=0;i<p;i++)l=h[i],a.remove(l);a==this.rootGraph&&this.setRootGraph(null);var d=this.graphs.indexOf(a);this.graphs.splice(d,1),a.parent=null}else if(r instanceof e){if(s=r,s==null)throw"Edge is null!";if(!s.isInterGraph)throw"Not an inter-graph edge!";if(!(s.source!=null&&s.target!=null))throw"Source and/or target is null!";if(!(s.source.edges.indexOf(s)!=-1&&s.target.edges.indexOf(s)!=-1))throw"Source and/or target doesn't know this edge!";var d=s.source.edges.indexOf(s);if(s.source.edges.splice(d,1),d=s.target.edges.indexOf(s),s.target.edges.splice(d,1),!(s.source.owner!=null&&s.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(s.source.owner.getGraphManager().edges.indexOf(s)==-1)throw"Not in owner graph manager's edge list!";var d=s.source.owner.getGraphManager().edges.indexOf(s);s.source.owner.getGraphManager().edges.splice(d,1)}},t.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},t.prototype.getGraphs=function(){return this.graphs},t.prototype.getAllNodes=function(){if(this.allNodes==null){for(var r=[],a=this.getGraphs(),u=a.length,s=0;s<u;s++)r=r.concat(a[s].getNodes());this.allNodes=r}return this.allNodes},t.prototype.resetAllNodes=function(){this.allNodes=null},t.prototype.resetAllEdges=function(){this.allEdges=null},t.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},t.prototype.getAllEdges=function(){if(this.allEdges==null){for(var r=[],a=this.getGraphs(),u=a.length,s=0;s<a.length;s++)r=r.concat(a[s].getEdges());r=r.concat(this.edges),this.allEdges=r}return this.allEdges},t.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},t.prototype.setAllNodesToApplyGravitation=function(r){if(this.allNodesToApplyGravitation!=null)throw"assert failed";this.allNodesToApplyGravitation=r},t.prototype.getRoot=function(){return this.rootGraph},t.prototype.setRootGraph=function(r){if(r.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=r,r.parent==null&&(r.parent=this.layout.newNode("Root node"))},t.prototype.getLayout=function(){return this.layout},t.prototype.isOneAncestorOfOther=function(r,a){if(!(r!=null&&a!=null))throw"assert failed";if(r==a)return!0;var u=r.getOwner(),s;do{if(s=u.getParent(),s==null)break;if(s==a)return!0;if(u=s.getOwner(),u==null)break}while(!0);u=a.getOwner();do{if(s=u.getParent(),s==null)break;if(s==r)return!0;if(u=s.getOwner(),u==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,a,u,s,p,i=this.getAllEdges(),h=i.length,l=0;l<h;l++){if(r=i[l],a=r.source,u=r.target,r.lca=null,r.sourceInLca=a,r.targetInLca=u,a==u){r.lca=a.getOwner();continue}for(s=a.getOwner();r.lca==null;){for(r.targetInLca=u,p=u.getOwner();r.lca==null;){if(p==s){r.lca=p;break}if(p==this.rootGraph)break;if(r.lca!=null)throw"assert failed";r.targetInLca=p.getParent(),p=r.targetInLca.getOwner()}if(s==this.rootGraph)break;r.lca==null&&(r.sourceInLca=s.getParent(),s=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,a){if(r==a)return r.getOwner();var u=r.getOwner();do{if(u==null)break;var s=a.getOwner();do{if(s==null)break;if(s==u)return s;s=s.getParent().getOwner()}while(!0);u=u.getParent().getOwner()}while(!0);return u},t.prototype.calcInclusionTreeDepths=function(r,a){r==null&&a==null&&(r=this.rootGraph,a=1);for(var u,s=r.getNodes(),p=s.length,i=0;i<p;i++)u=s[i],u.inclusionTreeDepth=a,u.child!=null&&this.calcInclusionTreeDepths(u.child,a+1)},t.prototype.includesInvalidEdge=function(){for(var r,a=this.edges.length,u=0;u<a;u++)if(r=this.edges[u],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},N.exports=t}),(function(N,C,v){"use strict";var n=v(0);function e(){}for(var t in n)e[t]=n[t];e.MAX_ITERATIONS=2500,e.DEFAULT_EDGE_LENGTH=50,e.DEFAULT_SPRING_STRENGTH=.45,e.DEFAULT_REPULSION_STRENGTH=4500,e.DEFAULT_GRAVITY_STRENGTH=.4,e.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,e.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,e.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,e.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,e.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,e.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,e.COOLING_ADAPTATION_FACTOR=.33,e.ADAPTATION_LOWER_NODE_LIMIT=1e3,e.ADAPTATION_UPPER_NODE_LIMIT=5e3,e.MAX_NODE_DISPLACEMENT_INCREMENTAL=100,e.MAX_NODE_DISPLACEMENT=e.MAX_NODE_DISPLACEMENT_INCREMENTAL*3,e.MIN_REPULSION_DIST=e.DEFAULT_EDGE_LENGTH/10,e.CONVERGENCE_CHECK_PERIOD=100,e.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,e.MIN_EDGE_LENGTH=1,e.GRID_CALCULATION_CHECK_PERIOD=10,N.exports=e}),(function(N,C,v){"use strict";var n=v(12);function e(){}e.calcSeparationAmount=function(t,r,a,u){if(!t.intersects(r))throw"assert failed";var s=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,s),a[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),a[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?a[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(a[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?a[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(a[1]+=Math.min(t.getY()-r.getY(),r.getBottom()-t.getBottom()));var p=Math.abs((r.getCenterY()-t.getCenterY())/(r.getCenterX()-t.getCenterX()));r.getCenterY()===t.getCenterY()&&r.getCenterX()===t.getCenterX()&&(p=1);var i=p*a[0],h=a[1]/p;a[0]<h?h=a[0]:i=a[1],a[0]=-1*s[0]*(h/2+u),a[1]=-1*s[1]*(i/2+u)},e.decideDirectionsForOverlappingNodes=function(t,r,a){t.getCenterX()<r.getCenterX()?a[0]=-1:a[0]=1,t.getCenterY()<r.getCenterY()?a[1]=-1:a[1]=1},e.getIntersection2=function(t,r,a){var u=t.getCenterX(),s=t.getCenterY(),p=r.getCenterX(),i=r.getCenterY();if(t.intersects(r))return a[0]=u,a[1]=s,a[2]=p,a[3]=i,!0;var h=t.getX(),l=t.getY(),d=t.getRight(),y=t.getX(),T=t.getBottom(),c=t.getRight(),D=t.getWidthHalf(),E=t.getHeightHalf(),O=r.getX(),o=r.getY(),g=r.getRight(),f=r.getX(),L=r.getBottom(),A=r.getRight(),I=r.getWidthHalf(),m=r.getHeightHalf(),R=!1,w=!1;if(u===p){if(s>i)return a[0]=u,a[1]=l,a[2]=p,a[3]=L,!1;if(s<i)return a[0]=u,a[1]=T,a[2]=p,a[3]=o,!1}else if(s===i){if(u>p)return a[0]=h,a[1]=s,a[2]=g,a[3]=i,!1;if(u<p)return a[0]=d,a[1]=s,a[2]=O,a[3]=i,!1}else{var F=t.height/t.width,Y=r.height/r.width,x=(i-s)/(p-u),M=void 0,G=void 0,S=void 0,P=void 0,_=void 0,U=void 0;if(-F===x?u>p?(a[0]=y,a[1]=T,R=!0):(a[0]=d,a[1]=l,R=!0):F===x&&(u>p?(a[0]=h,a[1]=l,R=!0):(a[0]=c,a[1]=T,R=!0)),-Y===x?p>u?(a[2]=f,a[3]=L,w=!0):(a[2]=g,a[3]=o,w=!0):Y===x&&(p>u?(a[2]=O,a[3]=o,w=!0):(a[2]=A,a[3]=L,w=!0)),R&&w)return!1;if(u>p?s>i?(M=this.getCardinalDirection(F,x,4),G=this.getCardinalDirection(Y,x,2)):(M=this.getCardinalDirection(-F,x,3),G=this.getCardinalDirection(-Y,x,1)):s>i?(M=this.getCardinalDirection(-F,x,1),G=this.getCardinalDirection(-Y,x,3)):(M=this.getCardinalDirection(F,x,2),G=this.getCardinalDirection(Y,x,4)),!R)switch(M){case 1:P=l,S=u+-E/x,a[0]=S,a[1]=P;break;case 2:S=c,P=s+D*x,a[0]=S,a[1]=P;break;case 3:P=T,S=u+E/x,a[0]=S,a[1]=P;break;case 4:S=y,P=s+-D*x,a[0]=S,a[1]=P;break}if(!w)switch(G){case 1:U=o,_=p+-m/x,a[2]=_,a[3]=U;break;case 2:_=A,U=i+I*x,a[2]=_,a[3]=U;break;case 3:U=L,_=p+m/x,a[2]=_,a[3]=U;break;case 4:_=f,U=i+-I*x,a[2]=_,a[3]=U;break}}return!1},e.getCardinalDirection=function(t,r,a){return t>r?a:1+a%4},e.getIntersection=function(t,r,a,u){if(u==null)return this.getIntersection2(t,r,a);var s=t.x,p=t.y,i=r.x,h=r.y,l=a.x,d=a.y,y=u.x,T=u.y,c=void 0,D=void 0,E=void 0,O=void 0,o=void 0,g=void 0,f=void 0,L=void 0,A=void 0;return E=h-p,o=s-i,f=i*p-s*h,O=T-d,g=l-y,L=y*d-l*T,A=E*g-O*o,A===0?null:(c=(o*L-g*f)/A,D=(O*f-E*L)/A,new n(c,D))},e.angleOfVector=function(t,r,a,u){var s=void 0;return t!==a?(s=Math.atan((u-r)/(a-t)),a<t?s+=Math.PI:u<r&&(s+=this.TWO_PI)):u<r?s=this.ONE_AND_HALF_PI:s=this.HALF_PI,s},e.doIntersect=function(t,r,a,u){var s=t.x,p=t.y,i=r.x,h=r.y,l=a.x,d=a.y,y=u.x,T=u.y,c=(i-s)*(T-d)-(y-l)*(h-p);if(c===0)return!1;var D=((T-d)*(y-s)+(l-y)*(T-p))/c,E=((p-h)*(y-s)+(i-s)*(T-p))/c;return 0<D&&D<1&&0<E&&E<1},e.HALF_PI=.5*Math.PI,e.ONE_AND_HALF_PI=1.5*Math.PI,e.TWO_PI=2*Math.PI,e.THREE_PI=3*Math.PI,N.exports=e}),(function(N,C,v){"use strict";function n(){}n.sign=function(e){return e>0?1:e<0?-1:0},n.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},n.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},N.exports=n}),(function(N,C,v){"use strict";function n(){}n.MAX_VALUE=2147483647,n.MIN_VALUE=-2147483648,N.exports=n}),(function(N,C,v){"use strict";var n=(function(){function s(p,i){for(var h=0;h<i.length;h++){var l=i[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return function(p,i,h){return i&&s(p.prototype,i),h&&s(p,h),p}})();function e(s,p){if(!(s instanceof p))throw new TypeError("Cannot call a class as a function")}var t=function(p){return{value:p,next:null,prev:null}},r=function(p,i,h,l){return p!==null?p.next=i:l.head=i,h!==null?h.prev=i:l.tail=i,i.prev=p,i.next=h,l.length++,i},a=function(p,i){var h=p.prev,l=p.next;return h!==null?h.next=l:i.head=l,l!==null?l.prev=h:i.tail=h,p.prev=p.next=null,i.length--,p},u=(function(){function s(p){var i=this;e(this,s),this.length=0,this.head=null,this.tail=null,p?.forEach(function(h){return i.push(h)})}return n(s,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(i,h){return r(h.prev,t(i),h,this)}},{key:"insertAfter",value:function(i,h){return r(h,t(i),h.next,this)}},{key:"insertNodeBefore",value:function(i,h){return r(h.prev,i,h,this)}},{key:"insertNodeAfter",value:function(i,h){return r(h,i,h.next,this)}},{key:"push",value:function(i){return r(this.tail,t(i),null,this)}},{key:"unshift",value:function(i){return r(null,t(i),this.head,this)}},{key:"remove",value:function(i){return a(i,this)}},{key:"pop",value:function(){return a(this.tail,this).value}},{key:"popNode",value:function(){return a(this.tail,this)}},{key:"shift",value:function(){return a(this.head,this).value}},{key:"shiftNode",value:function(){return a(this.head,this)}},{key:"get_object_at",value:function(i){if(i<=this.length()){for(var h=1,l=this.head;h<i;)l=l.next,h++;return l.value}}},{key:"set_object_at",value:function(i,h){if(i<=this.length()){for(var l=1,d=this.head;l<i;)d=d.next,l++;d.value=h}}}]),s})();N.exports=u}),(function(N,C,v){"use strict";function n(e,t,r){this.x=null,this.y=null,e==null&&t==null&&r==null?(this.x=0,this.y=0):typeof e=="number"&&typeof t=="number"&&r==null?(this.x=e,this.y=t):e.constructor.name=="Point"&&t==null&&r==null&&(r=e,this.x=r.x,this.y=r.y)}n.prototype.getX=function(){return this.x},n.prototype.getY=function(){return this.y},n.prototype.getLocation=function(){return new n(this.x,this.y)},n.prototype.setLocation=function(e,t,r){e.constructor.name=="Point"&&t==null&&r==null?(r=e,this.setLocation(r.x,r.y)):typeof e=="number"&&typeof t=="number"&&r==null&&(parseInt(e)==e&&parseInt(t)==t?this.move(e,t):(this.x=Math.floor(e+.5),this.y=Math.floor(t+.5)))},n.prototype.move=function(e,t){this.x=e,this.y=t},n.prototype.translate=function(e,t){this.x+=e,this.y+=t},n.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},n.prototype.toString=function(){return new n().constructor.name+"[x="+this.x+",y="+this.y+"]"},N.exports=n}),(function(N,C,v){"use strict";function n(e,t,r,a){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&a!=null&&(this.x=e,this.y=t,this.width=r,this.height=a)}n.prototype.getX=function(){return this.x},n.prototype.setX=function(e){this.x=e},n.prototype.getY=function(){return this.y},n.prototype.setY=function(e){this.y=e},n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},n.prototype.getRight=function(){return this.x+this.width},n.prototype.getBottom=function(){return this.y+this.height},n.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},n.prototype.getCenterX=function(){return this.x+this.width/2},n.prototype.getMinX=function(){return this.getX()},n.prototype.getMaxX=function(){return this.getX()+this.width},n.prototype.getCenterY=function(){return this.y+this.height/2},n.prototype.getMinY=function(){return this.getY()},n.prototype.getMaxY=function(){return this.getY()+this.height},n.prototype.getWidthHalf=function(){return this.width/2},n.prototype.getHeightHalf=function(){return this.height/2},N.exports=n}),(function(N,C,v){"use strict";var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};function e(){}e.lastID=0,e.createID=function(t){return e.isPrimitive(t)?t:(t.uniqueID!=null||(t.uniqueID=e.getString(),e.lastID++),t.uniqueID)},e.getString=function(t){return t==null&&(t=e.lastID),"Object#"+t},e.isPrimitive=function(t){var r=typeof t>"u"?"undefined":n(t);return t==null||r!="object"&&r!="function"},N.exports=e}),(function(N,C,v){"use strict";function n(l){if(Array.isArray(l)){for(var d=0,y=Array(l.length);d<l.length;d++)y[d]=l[d];return y}else return Array.from(l)}var e=v(0),t=v(6),r=v(3),a=v(1),u=v(5),s=v(4),p=v(17),i=v(27);function h(l){i.call(this),this.layoutQuality=e.QUALITY,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=e.DEFAULT_INCREMENTAL,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new t(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,l!=null&&(this.isRemoteUse=l)}h.RANDOM_SEED=1,h.prototype=Object.create(i.prototype),h.prototype.getGraphManager=function(){return this.graphManager},h.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},h.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},h.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},h.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},h.prototype.newGraph=function(l){return new u(null,this.graphManager,l)},h.prototype.newNode=function(l){return new r(this.graphManager,l)},h.prototype.newEdge=function(l){return new a(null,null,l)},h.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},h.prototype.runLayout=function(){this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters();var l;return this.checkLayoutSuccess()?l=!1:l=this.layout(),e.ANIMATE==="during"?!1:(l&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,l)},h.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},h.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,d=this.graphManager.getAllEdges(),y=0;y<d.length;y++)l=d[y];for(var T,c=this.graphManager.getRoot().getNodes(),y=0;y<c.length;y++)T=c[y];this.update(this.graphManager.getRoot())}},h.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var d=l;if(d.getChild()!=null)for(var y=d.getChild().getNodes(),T=0;T<y.length;T++)update(y[T]);if(d.vGraphObject!=null){var c=d.vGraphObject;c.update(d)}}else if(l instanceof a){var D=l;if(D.vGraphObject!=null){var E=D.vGraphObject;E.update(D)}}else if(l instanceof u){var O=l;if(O.vGraphObject!=null){var o=O.vGraphObject;o.update(O)}}},h.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=e.QUALITY,this.animationDuringLayout=e.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=e.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=e.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=e.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=e.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=e.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},h.prototype.transform=function(l){if(l==null)this.transform(new s(0,0));else{var d=new p,y=this.graphManager.getRoot().updateLeftTop();if(y!=null){d.setWorldOrgX(l.x),d.setWorldOrgY(l.y),d.setDeviceOrgX(y.x),d.setDeviceOrgY(y.y);for(var T=this.getAllNodes(),c,D=0;D<T.length;D++)c=T[D],c.transform(d)}}},h.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var d,y,T=l.getNodes(),c=0;c<T.length;c++)d=T[c],y=d.getChild(),y==null||y.getNodes().length==0?d.scatter():(this.positionNodesRandomly(y),d.updateBounds())},h.prototype.getFlatForest=function(){for(var l=[],d=!0,y=this.graphManager.getRoot().getNodes(),T=!0,c=0;c<y.length;c++)y[c].getChild()!=null&&(T=!1);if(!T)return l;var D=new Set,E=[],O=new Map,o=[];for(o=o.concat(y);o.length>0&&d;){for(E.push(o[0]);E.length>0&&d;){var g=E[0];E.splice(0,1),D.add(g);for(var f=g.getEdges(),c=0;c<f.length;c++){var L=f[c].getOtherEnd(g);if(O.get(g)!=L)if(!D.has(L))E.push(L),O.set(L,g);else{d=!1;break}}}if(!d)l=[];else{var A=[].concat(n(D));l.push(A);for(var c=0;c<A.length;c++){var I=A[c],m=o.indexOf(I);m>-1&&o.splice(m,1)}D=new Set,O=new Map}}return l},h.prototype.createDummyNodesForBendpoints=function(l){for(var d=[],y=l.source,T=this.graphManager.calcLowestCommonAncestor(l.source,l.target),c=0;c<l.bendpoints.length;c++){var D=this.newNode(null);D.setRect(new Point(0,0),new Dimension(1,1)),T.add(D);var E=this.newEdge(null);this.graphManager.add(E,y,D),d.add(D),y=D}var E=this.newEdge(null);return this.graphManager.add(E,y,l.target),this.edgeToDummyNodes.set(l,d),l.isInterGraph()?this.graphManager.remove(l):T.remove(l),d},h.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(n(this.edgeToDummyNodes.keys())).concat(l);for(var d=0;d<l.length;d++){var y=l[d];if(y.bendpoints.length>0){for(var T=this.edgeToDummyNodes.get(y),c=0;c<T.length;c++){var D=T[c],E=new s(D.getCenterX(),D.getCenterY()),O=y.bendpoints.get(c);O.x=E.x,O.y=E.y,D.getOwner().remove(D)}this.graphManager.add(y,y.source,y.target)}}},h.transform=function(l,d,y,T){if(y!=null&&T!=null){var c=d;if(l<=50){var D=d/y;c-=(d-D)/50*(50-l)}else{var E=d*T;c+=(E-d)/50*(l-50)}return c}else{var O,o;return l<=50?(O=9*d/500,o=d/10):(O=9*d/50,o=-8*d),O*l+o}},h.findCenterOfTree=function(l){var d=[];d=d.concat(l);var y=[],T=new Map,c=!1,D=null;(d.length==1||d.length==2)&&(c=!0,D=d[0]);for(var E=0;E<d.length;E++){var O=d[E],o=O.getNeighborsList().size;T.set(O,O.getNeighborsList().size),o==1&&y.push(O)}var g=[];for(g=g.concat(y);!c;){var f=[];f=f.concat(g),g=[];for(var E=0;E<d.length;E++){var O=d[E],L=d.indexOf(O);L>=0&&d.splice(L,1);var A=O.getNeighborsList();A.forEach(function(R){if(y.indexOf(R)<0){var w=T.get(R),F=w-1;F==1&&g.push(R),T.set(R,F)}})}y=y.concat(g),(d.length==1||d.length==2)&&(c=!0,D=d[0])}return D},h.prototype.setGraphManager=function(l){this.graphManager=l},N.exports=h}),(function(N,C,v){"use strict";function n(){}n.seed=1,n.x=0,n.nextDouble=function(){return n.x=Math.sin(n.seed++)*1e4,n.x-Math.floor(n.x)},N.exports=n}),(function(N,C,v){"use strict";var n=v(4);function e(t,r){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}e.prototype.getWorldOrgX=function(){return this.lworldOrgX},e.prototype.setWorldOrgX=function(t){this.lworldOrgX=t},e.prototype.getWorldOrgY=function(){return this.lworldOrgY},e.prototype.setWorldOrgY=function(t){this.lworldOrgY=t},e.prototype.getWorldExtX=function(){return this.lworldExtX},e.prototype.setWorldExtX=function(t){this.lworldExtX=t},e.prototype.getWorldExtY=function(){return this.lworldExtY},e.prototype.setWorldExtY=function(t){this.lworldExtY=t},e.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},e.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t},e.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},e.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t},e.prototype.getDeviceExtX=function(){return this.ldeviceExtX},e.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t},e.prototype.getDeviceExtY=function(){return this.ldeviceExtY},e.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t},e.prototype.transformX=function(t){var r=0,a=this.lworldExtX;return a!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/a),r},e.prototype.transformY=function(t){var r=0,a=this.lworldExtY;return a!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/a),r},e.prototype.inverseTransformX=function(t){var r=0,a=this.ldeviceExtX;return a!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/a),r},e.prototype.inverseTransformY=function(t){var r=0,a=this.ldeviceExtY;return a!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/a),r},e.prototype.inverseTransformPoint=function(t){var r=new n(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},N.exports=e}),(function(N,C,v){"use strict";function n(i){if(Array.isArray(i)){for(var h=0,l=Array(i.length);h<i.length;h++)l[h]=i[h];return l}else return Array.from(i)}var e=v(15),t=v(7),r=v(0),a=v(8),u=v(9);function s(){e.call(this),this.useSmartIdealEdgeLengthCalculation=t.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=t.DEFAULT_EDGE_LENGTH,this.springConstant=t.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=t.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=t.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=t.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*t.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=t.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=t.MAX_ITERATIONS}s.prototype=Object.create(e.prototype);for(var p in e)s[p]=e[p];s.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=t.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},s.prototype.calcIdealEdgeLengths=function(){for(var i,h,l,d,y,T,c=this.getGraphManager().getAllEdges(),D=0;D<c.length;D++)i=c[D],i.idealLength=this.idealEdgeLength,i.isInterGraph&&(l=i.getSource(),d=i.getTarget(),y=i.getSourceInLca().getEstimatedSize(),T=i.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(i.idealLength+=y+T-2*r.SIMPLE_NODE_SIZE),h=i.getLca().getInclusionTreeDepth(),i.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+d.getInclusionTreeDepth()-2*h))},s.prototype.initSpringEmbedder=function(){var i=this.getAllNodes().length;this.incremental?(i>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-t.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT_INCREMENTAL):(i>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(i-t.ADAPTATION_LOWER_NODE_LIMIT)/(t.ADAPTATION_UPPER_NODE_LIMIT-t.ADAPTATION_LOWER_NODE_LIMIT)*(1-t.COOLING_ADAPTATION_FACTOR)):this.coolingFactor=1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=t.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},s.prototype.calcSpringForces=function(){for(var i=this.getAllEdges(),h,l=0;l<i.length;l++)h=i[l],this.calcSpringForce(h,h.idealLength)},s.prototype.calcRepulsionForces=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,d,y,T,c=this.getAllNodes(),D;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&i&&this.updateGrid(),D=new Set,l=0;l<c.length;l++)y=c[l],this.calculateRepulsionForceOfANode(y,D,i,h),D.add(y);else for(l=0;l<c.length;l++)for(y=c[l],d=l+1;d<c.length;d++)T=c[d],y.getOwner()==T.getOwner()&&this.calcRepulsionForce(y,T)},s.prototype.calcGravitationalForces=function(){for(var i,h=this.getAllNodesToApplyGravitation(),l=0;l<h.length;l++)i=h[l],this.calcGravitationalForce(i)},s.prototype.moveNodes=function(){for(var i=this.getAllNodes(),h,l=0;l<i.length;l++)h=i[l],h.move()},s.prototype.calcSpringForce=function(i,h){var l=i.getSource(),d=i.getTarget(),y,T,c,D;if(this.uniformLeafNodeSizes&&l.getChild()==null&&d.getChild()==null)i.updateLengthSimple();else if(i.updateLength(),i.isOverlapingSourceAndTarget)return;y=i.getLength(),y!=0&&(T=this.springConstant*(y-h),c=T*(i.lengthX/y),D=T*(i.lengthY/y),l.springForceX+=c,l.springForceY+=D,d.springForceX-=c,d.springForceY-=D)},s.prototype.calcRepulsionForce=function(i,h){var l=i.getRect(),d=h.getRect(),y=new Array(2),T=new Array(4),c,D,E,O,o,g,f;if(l.intersects(d)){a.calcSeparationAmount(l,d,y,t.DEFAULT_EDGE_LENGTH/2),g=2*y[0],f=2*y[1];var L=i.noOfChildren*h.noOfChildren/(i.noOfChildren+h.noOfChildren);i.repulsionForceX-=L*g,i.repulsionForceY-=L*f,h.repulsionForceX+=L*g,h.repulsionForceY+=L*f}else this.uniformLeafNodeSizes&&i.getChild()==null&&h.getChild()==null?(c=d.getCenterX()-l.getCenterX(),D=d.getCenterY()-l.getCenterY()):(a.getIntersection(l,d,T),c=T[2]-T[0],D=T[3]-T[1]),Math.abs(c)<t.MIN_REPULSION_DIST&&(c=u.sign(c)*t.MIN_REPULSION_DIST),Math.abs(D)<t.MIN_REPULSION_DIST&&(D=u.sign(D)*t.MIN_REPULSION_DIST),E=c*c+D*D,O=Math.sqrt(E),o=this.repulsionConstant*i.noOfChildren*h.noOfChildren/E,g=o*c/O,f=o*D/O,i.repulsionForceX-=g,i.repulsionForceY-=f,h.repulsionForceX+=g,h.repulsionForceY+=f},s.prototype.calcGravitationalForce=function(i){var h,l,d,y,T,c,D,E;h=i.getOwner(),l=(h.getRight()+h.getLeft())/2,d=(h.getTop()+h.getBottom())/2,y=i.getCenterX()-l,T=i.getCenterY()-d,c=Math.abs(y)+i.getWidth()/2,D=Math.abs(T)+i.getHeight()/2,i.getOwner()==this.graphManager.getRoot()?(E=h.getEstimatedSize()*this.gravityRangeFactor,(c>E||D>E)&&(i.gravitationForceX=-this.gravityConstant*y,i.gravitationForceY=-this.gravityConstant*T)):(E=h.getEstimatedSize()*this.compoundGravityRangeFactor,(c>E||D>E)&&(i.gravitationForceX=-this.gravityConstant*y*this.compoundGravityConstant,i.gravitationForceY=-this.gravityConstant*T*this.compoundGravityConstant))},s.prototype.isConverged=function(){var i,h=!1;return this.totalIterations>this.maxIterations/3&&(h=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),i=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,i||h},s.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},s.prototype.calcNoOfChildrenForAllNodes=function(){for(var i,h=this.graphManager.getAllNodes(),l=0;l<h.length;l++)i=h[l],i.noOfChildren=i.getNoOfChildren()},s.prototype.calcGrid=function(i){var h=0,l=0;h=parseInt(Math.ceil((i.getRight()-i.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((i.getBottom()-i.getTop())/this.repulsionRange));for(var d=new Array(h),y=0;y<h;y++)d[y]=new Array(l);for(var y=0;y<h;y++)for(var T=0;T<l;T++)d[y][T]=new Array;return d},s.prototype.addNodeToGrid=function(i,h,l){var d=0,y=0,T=0,c=0;d=parseInt(Math.floor((i.getRect().x-h)/this.repulsionRange)),y=parseInt(Math.floor((i.getRect().width+i.getRect().x-h)/this.repulsionRange)),T=parseInt(Math.floor((i.getRect().y-l)/this.repulsionRange)),c=parseInt(Math.floor((i.getRect().height+i.getRect().y-l)/this.repulsionRange));for(var D=d;D<=y;D++)for(var E=T;E<=c;E++)this.grid[D][E].push(i),i.setGridCoordinates(d,y,T,c)},s.prototype.updateGrid=function(){var i,h,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),i=0;i<l.length;i++)h=l[i],this.addNodeToGrid(h,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},s.prototype.calculateRepulsionForceOfANode=function(i,h,l,d){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||d){var y=new Set;i.surrounding=new Array;for(var T,c=this.grid,D=i.startX-1;D<i.finishX+2;D++)for(var E=i.startY-1;E<i.finishY+2;E++)if(!(D<0||E<0||D>=c.length||E>=c[0].length)){for(var O=0;O<c[D][E].length;O++)if(T=c[D][E][O],!(i.getOwner()!=T.getOwner()||i==T)&&!h.has(T)&&!y.has(T)){var o=Math.abs(i.getCenterX()-T.getCenterX())-(i.getWidth()/2+T.getWidth()/2),g=Math.abs(i.getCenterY()-T.getCenterY())-(i.getHeight()/2+T.getHeight()/2);o<=this.repulsionRange&&g<=this.repulsionRange&&y.add(T)}}i.surrounding=[].concat(n(y))}for(D=0;D<i.surrounding.length;D++)this.calcRepulsionForce(i,i.surrounding[D])},s.prototype.calcRepulsionRange=function(){return 0},N.exports=s}),(function(N,C,v){"use strict";var n=v(1),e=v(7);function t(a,u,s){n.call(this,a,u,s),this.idealLength=e.DEFAULT_EDGE_LENGTH}t.prototype=Object.create(n.prototype);for(var r in n)t[r]=n[r];N.exports=t}),(function(N,C,v){"use strict";var n=v(3);function e(r,a,u,s){n.call(this,r,a,u,s),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}e.prototype=Object.create(n.prototype);for(var t in n)e[t]=n[t];e.prototype.setGridCoordinates=function(r,a,u,s){this.startX=r,this.finishX=a,this.startY=u,this.finishY=s},N.exports=e}),(function(N,C,v){"use strict";function n(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}n.prototype.getWidth=function(){return this.width},n.prototype.setWidth=function(e){this.width=e},n.prototype.getHeight=function(){return this.height},n.prototype.setHeight=function(e){this.height=e},N.exports=n}),(function(N,C,v){"use strict";var n=v(14);function e(){this.map={},this.keys=[]}e.prototype.put=function(t,r){var a=n.createID(t);this.contains(a)||(this.map[a]=r,this.keys.push(t))},e.prototype.contains=function(t){var r=n.createID(t);return this.map[t]!=null},e.prototype.get=function(t){var r=n.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},N.exports=e}),(function(N,C,v){"use strict";var n=v(14);function e(){this.set={}}e.prototype.add=function(t){var r=n.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[n.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[n.createID(t)]==t},e.prototype.isEmpty=function(){return this.size()===0},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAllTo=function(t){for(var r=Object.keys(this.set),a=r.length,u=0;u<a;u++)t.push(this.set[r[u]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,a=0;a<r;a++){var u=t[a];this.add(u)}},N.exports=e}),(function(N,C,v){"use strict";var n=(function(){function a(u,s){for(var p=0;p<s.length;p++){var i=s[p];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(u,i.key,i)}}return function(u,s,p){return s&&a(u.prototype,s),p&&a(u,p),u}})();function e(a,u){if(!(a instanceof u))throw new TypeError("Cannot call a class as a function")}var t=v(11),r=(function(){function a(u,s){e(this,a),(s!==null||s!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;u instanceof t?p=u.size():p=u.length,this._quicksort(u,0,p-1)}return n(a,[{key:"_quicksort",value:function(s,p,i){if(p<i){var h=this._partition(s,p,i);this._quicksort(s,p,h),this._quicksort(s,h+1,i)}}},{key:"_partition",value:function(s,p,i){for(var h=this._get(s,p),l=p,d=i;;){for(;this.compareFunction(h,this._get(s,d));)d--;for(;this.compareFunction(this._get(s,l),h);)l++;if(l<d)this._swap(s,l,d),l++,d--;else return d}}},{key:"_get",value:function(s,p){return s instanceof t?s.get_object_at(p):s[p]}},{key:"_set",value:function(s,p,i){s instanceof t?s.set_object_at(p,i):s[p]=i}},{key:"_swap",value:function(s,p,i){var h=this._get(s,p);this._set(s,p,this._get(s,i)),this._set(s,i,h)}},{key:"_defaultCompareFunction",value:function(s,p){return p>s}}]),a})();N.exports=r}),(function(N,C,v){"use strict";var n=(function(){function r(a,u){for(var s=0;s<u.length;s++){var p=u[s];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(a,p.key,p)}}return function(a,u,s){return u&&r(a.prototype,u),s&&r(a,s),a}})();function e(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}var t=(function(){function r(a,u){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=a,this.sequence2=u,this.match_score=s,this.mismatch_penalty=p,this.gap_penalty=i,this.iMax=a.length+1,this.jMax=u.length+1,this.grid=new Array(this.iMax);for(var h=0;h<this.iMax;h++){this.grid[h]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[h][l]=0}this.tracebackGrid=new Array(this.iMax);for(var d=0;d<this.iMax;d++){this.tracebackGrid[d]=new Array(this.jMax);for(var y=0;y<this.jMax;y++)this.tracebackGrid[d][y]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return n(r,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var u=1;u<this.jMax;u++)this.grid[0][u]=this.grid[0][u-1]+this.gap_penalty,this.tracebackGrid[0][u]=[!1,!1,!0];for(var s=1;s<this.iMax;s++)this.grid[s][0]=this.grid[s-1][0]+this.gap_penalty,this.tracebackGrid[s][0]=[!1,!0,!1];for(var p=1;p<this.iMax;p++)for(var i=1;i<this.jMax;i++){var h=void 0;this.sequence1[p-1]===this.sequence2[i-1]?h=this.grid[p-1][i-1]+this.match_score:h=this.grid[p-1][i-1]+this.mismatch_penalty;var l=this.grid[p-1][i]+this.gap_penalty,d=this.grid[p][i-1]+this.gap_penalty,y=[h,l,d],T=this.arrayAllMaxIndexes(y);this.grid[p][i]=y[T[0]],this.tracebackGrid[p][i]=[T.includes(0),T.includes(1),T.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var u=[];for(u.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});u[0];){var s=u[0],p=this.tracebackGrid[s.pos[0]][s.pos[1]];p[0]&&u.push({pos:[s.pos[0]-1,s.pos[1]-1],seq1:this.sequence1[s.pos[0]-1]+s.seq1,seq2:this.sequence2[s.pos[1]-1]+s.seq2}),p[1]&&u.push({pos:[s.pos[0]-1,s.pos[1]],seq1:this.sequence1[s.pos[0]-1]+s.seq1,seq2:"-"+s.seq2}),p[2]&&u.push({pos:[s.pos[0],s.pos[1]-1],seq1:"-"+s.seq1,seq2:this.sequence2[s.pos[1]-1]+s.seq2}),s.pos[0]===0&&s.pos[1]===0&&this.alignments.push({sequence1:s.seq1,sequence2:s.seq2}),u.shift()}return this.alignments}},{key:"getAllIndexes",value:function(u,s){for(var p=[],i=-1;(i=u.indexOf(s,i+1))!==-1;)p.push(i);return p}},{key:"arrayAllMaxIndexes",value:function(u){return this.getAllIndexes(u,Math.max.apply(null,u))}}]),r})();N.exports=t}),(function(N,C,v){"use strict";var n=function(){};n.FDLayout=v(18),n.FDLayoutConstants=v(7),n.FDLayoutEdge=v(19),n.FDLayoutNode=v(20),n.DimensionD=v(21),n.HashMap=v(22),n.HashSet=v(23),n.IGeometry=v(8),n.IMath=v(9),n.Integer=v(10),n.Point=v(12),n.PointD=v(4),n.RandomSeed=v(16),n.RectangleD=v(13),n.Transform=v(17),n.UniqueIDGeneretor=v(14),n.Quicksort=v(24),n.LinkedList=v(11),n.LGraphObject=v(2),n.LGraph=v(5),n.LEdge=v(1),n.LGraphManager=v(6),n.LNode=v(3),n.Layout=v(15),n.LayoutConstants=v(0),n.NeedlemanWunsch=v(25),N.exports=n}),(function(N,C,v){"use strict";function n(){this.listeners=[]}var e=n.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var a=this.listeners.length;a>=0;a--){var u=this.listeners[a];u.event===t&&u.callback===r&&this.listeners.splice(a,1)}},e.emit=function(t,r){for(var a=0;a<this.listeners.length;a++){var u=this.listeners[a];t===u.event&&u.callback(r)}},N.exports=n})])})});var J=$((Z,z)=>{(function(C,v){typeof Z=="object"&&typeof z=="object"?z.exports=v(q()):typeof define=="function"&&define.amd?define(["layout-base"],v):typeof Z=="object"?Z.coseBase=v(q()):C.coseBase=v(C.layoutBase)})(Z,function(N){return(function(C){var v={};function n(e){if(v[e])return v[e].exports;var t=v[e]={i:e,l:!1,exports:{}};return C[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=C,n.c=v,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)})([(function(C,v){C.exports=N}),(function(C,v,n){"use strict";var e=n(0).FDLayoutConstants;function t(){}for(var r in e)t[r]=e[r];t.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,t.DEFAULT_RADIAL_SEPARATION=e.DEFAULT_EDGE_LENGTH,t.DEFAULT_COMPONENT_SEPERATION=60,t.TILE=!0,t.TILING_PADDING_VERTICAL=10,t.TILING_PADDING_HORIZONTAL=10,t.TREE_REDUCTION_ON_INCREMENTAL=!1,C.exports=t}),(function(C,v,n){"use strict";var e=n(0).FDLayoutEdge;function t(a,u,s){e.call(this,a,u,s)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];C.exports=t}),(function(C,v,n){"use strict";var e=n(0).LGraph;function t(a,u,s){e.call(this,a,u,s)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];C.exports=t}),(function(C,v,n){"use strict";var e=n(0).LGraphManager;function t(a){e.call(this,a)}t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];C.exports=t}),(function(C,v,n){"use strict";var e=n(0).FDLayoutNode,t=n(0).IMath;function r(u,s,p,i){e.call(this,u,s,p,i)}r.prototype=Object.create(e.prototype);for(var a in e)r[a]=e[a];r.prototype.move=function(){var u=this.graphManager.getLayout();this.displacementX=u.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=u.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementX=u.coolingFactor*u.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>u.coolingFactor*u.maxNodeDisplacement&&(this.displacementY=u.coolingFactor*u.maxNodeDisplacement*t.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),u.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},r.prototype.propogateDisplacementToChildren=function(u,s){for(var p=this.getChild().getNodes(),i,h=0;h<p.length;h++)i=p[h],i.getChild()==null?(i.moveBy(u,s),i.displacementX+=u,i.displacementY+=s):i.propogateDisplacementToChildren(u,s)},r.prototype.setPred1=function(u){this.pred1=u},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(u){this.next=u},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(u){this.processed=u},r.prototype.isProcessed=function(){return processed},C.exports=r}),(function(C,v,n){"use strict";var e=n(0).FDLayout,t=n(4),r=n(3),a=n(5),u=n(2),s=n(1),p=n(0).FDLayoutConstants,i=n(0).LayoutConstants,h=n(0).Point,l=n(0).PointD,d=n(0).Layout,y=n(0).Integer,T=n(0).IGeometry,c=n(0).LGraph,D=n(0).Transform;function E(){e.call(this),this.toBeTiled={}}E.prototype=Object.create(e.prototype);for(var O in e)E[O]=e[O];E.prototype.newGraphManager=function(){var o=new t(this);return this.graphManager=o,o},E.prototype.newGraph=function(o){return new r(null,this.graphManager,o)},E.prototype.newNode=function(o){return new a(this.graphManager,o)},E.prototype.newEdge=function(o){return new u(null,null,o)},E.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(s.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=s.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=s.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=p.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=p.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=p.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=p.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=p.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=p.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/p.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=p.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},E.prototype.layout=function(){var o=i.DEFAULT_CREATE_BENDS_AS_NEEDED;return o&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},E.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(s.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var g=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(I){return g.has(I)});this.graphManager.setAllNodesToApplyGravitation(f)}}else{var o=this.getFlatForest();if(o.length>0)this.positionNodesRadially(o);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var g=new Set(this.getAllNodes()),f=this.nodesWithGravity.filter(function(L){return g.has(L)});this.graphManager.setAllNodesToApplyGravitation(f),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%p.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 o=new Set(this.getAllNodes()),g=this.nodesWithGravity.filter(function(A){return o.has(A)});this.graphManager.setAllNodesToApplyGravitation(g),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=p.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=p.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var f=!this.isTreeGrowing&&!this.isGrowthFinished,L=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(f,L),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},E.prototype.getPositionsData=function(){for(var o=this.graphManager.getAllNodes(),g={},f=0;f<o.length;f++){var L=o[f].rect,A=o[f].id;g[A]={id:A,x:L.getCenterX(),y:L.getCenterY(),w:L.width,h:L.height}}return g},E.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var o=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!o;)o=this.tick();this.graphManager.updateBounds()}},E.prototype.calculateNodesToApplyGravitationTo=function(){var o=[],g,f=this.graphManager.getGraphs(),L=f.length,A;for(A=0;A<L;A++)g=f[A],g.updateConnected(),g.isConnected||(o=o.concat(g.getNodes()));return o},E.prototype.createBendpoints=function(){var o=[];o=o.concat(this.graphManager.getAllEdges());var g=new Set,f;for(f=0;f<o.length;f++){var L=o[f];if(!g.has(L)){var A=L.getSource(),I=L.getTarget();if(A==I)L.getBendpoints().push(new l),L.getBendpoints().push(new l),this.createDummyNodesForBendpoints(L),g.add(L);else{var m=[];if(m=m.concat(A.getEdgeListToNode(I)),m=m.concat(I.getEdgeListToNode(A)),!g.has(m[0])){if(m.length>1){var R;for(R=0;R<m.length;R++){var w=m[R];w.getBendpoints().push(new l),this.createDummyNodesForBendpoints(w)}}m.forEach(function(F){g.add(F)})}}}if(g.size==o.length)break}},E.prototype.positionNodesRadially=function(o){for(var g=new h(0,0),f=Math.ceil(Math.sqrt(o.length)),L=0,A=0,I=0,m=new l(0,0),R=0;R<o.length;R++){R%f==0&&(I=0,A=L,R!=0&&(A+=s.DEFAULT_COMPONENT_SEPERATION),L=0);var w=o[R],F=d.findCenterOfTree(w);g.x=I,g.y=A,m=E.radialLayout(w,F,g),m.y>L&&(L=Math.floor(m.y)),I=Math.floor(m.x+s.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(i.WORLD_CENTER_X-m.x/2,i.WORLD_CENTER_Y-m.y/2))},E.radialLayout=function(o,g,f){var L=Math.max(this.maxDiagonalInTree(o),s.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(g,null,0,359,0,L);var A=c.calculateBounds(o),I=new D;I.setDeviceOrgX(A.getMinX()),I.setDeviceOrgY(A.getMinY()),I.setWorldOrgX(f.x),I.setWorldOrgY(f.y);for(var m=0;m<o.length;m++){var R=o[m];R.transform(I)}var w=new l(A.getMaxX(),A.getMaxY());return I.inverseTransformPoint(w)},E.branchRadialLayout=function(o,g,f,L,A,I){var m=(L-f+1)/2;m<0&&(m+=180);var R=(m+f)%360,w=R*T.TWO_PI/360,F=Math.cos(w),Y=A*Math.cos(w),x=A*Math.sin(w);o.setCenter(Y,x);var M=[];M=M.concat(o.getEdges());var G=M.length;g!=null&&G--;for(var S=0,P=M.length,_,U=o.getEdgesBetween(g);U.length>1;){var X=U[0];U.splice(0,1);var B=M.indexOf(X);B>=0&&M.splice(B,1),P--,G--}g!=null?_=(M.indexOf(U[0])+1)%P:_=0;for(var b=Math.abs(L-f)/G,H=_;S!=G;H=++H%P){var et=M[H].getOtherEnd(o);if(et!=g){var rt=(f+S*b)%360,ct=(rt+b)%360;E.branchRadialLayout(et,o,rt,ct,A+I,I),S++}}},E.maxDiagonalInTree=function(o){for(var g=y.MIN_VALUE,f=0;f<o.length;f++){var L=o[f],A=L.getDiagonal();A>g&&(g=A)}return g},E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},E.prototype.groupZeroDegreeMembers=function(){var o=this,g={};this.memberGroups={},this.idToDummyNode={};for(var f=[],L=this.graphManager.getAllNodes(),A=0;A<L.length;A++){var I=L[A],m=I.getParent();this.getNodeDegreeWithChildren(I)===0&&(m.id==null||!this.getToBeTiled(m))&&f.push(I)}for(var A=0;A<f.length;A++){var I=f[A],R=I.getParent().id;typeof g[R]>"u"&&(g[R]=[]),g[R]=g[R].concat(I)}Object.keys(g).forEach(function(w){if(g[w].length>1){var F="DummyCompound_"+w;o.memberGroups[F]=g[w];var Y=g[w][0].getParent(),x=new a(o.graphManager);x.id=F,x.paddingLeft=Y.paddingLeft||0,x.paddingRight=Y.paddingRight||0,x.paddingBottom=Y.paddingBottom||0,x.paddingTop=Y.paddingTop||0,o.idToDummyNode[F]=x;var M=o.getGraphManager().add(o.newGraph(),x),G=Y.getChild();G.add(x);for(var S=0;S<g[w].length;S++){var P=g[w][S];G.remove(P),M.add(P)}}})},E.prototype.clearCompounds=function(){var o={},g={};this.performDFSOnCompounds();for(var f=0;f<this.compoundOrder.length;f++)g[this.compoundOrder[f].id]=this.compoundOrder[f],o[this.compoundOrder[f].id]=[].concat(this.compoundOrder[f].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[f].getChild()),this.compoundOrder[f].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(o,g)},E.prototype.clearZeroDegreeMembers=function(){var o=this,g=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(f){var L=o.idToDummyNode[f];g[f]=o.tileNodes(o.memberGroups[f],L.paddingLeft+L.paddingRight),L.rect.width=g[f].width,L.rect.height=g[f].height})},E.prototype.repopulateCompounds=function(){for(var o=this.compoundOrder.length-1;o>=0;o--){var g=this.compoundOrder[o],f=g.id,L=g.paddingLeft,A=g.paddingTop;this.adjustLocations(this.tiledMemberPack[f],g.rect.x,g.rect.y,L,A)}},E.prototype.repopulateZeroDegreeMembers=function(){var o=this,g=this.tiledZeroDegreePack;Object.keys(g).forEach(function(f){var L=o.idToDummyNode[f],A=L.paddingLeft,I=L.paddingTop;o.adjustLocations(g[f],L.rect.x,L.rect.y,A,I)})},E.prototype.getToBeTiled=function(o){var g=o.id;if(this.toBeTiled[g]!=null)return this.toBeTiled[g];var f=o.getChild();if(f==null)return this.toBeTiled[g]=!1,!1;for(var L=f.getNodes(),A=0;A<L.length;A++){var I=L[A];if(this.getNodeDegree(I)>0)return this.toBeTiled[g]=!1,!1;if(I.getChild()==null){this.toBeTiled[I.id]=!1;continue}if(!this.getToBeTiled(I))return this.toBeTiled[g]=!1,!1}return this.toBeTiled[g]=!0,!0},E.prototype.getNodeDegree=function(o){for(var g=o.id,f=o.getEdges(),L=0,A=0;A<f.length;A++){var I=f[A];I.getSource().id!==I.getTarget().id&&(L=L+1)}return L},E.prototype.getNodeDegreeWithChildren=function(o){var g=this.getNodeDegree(o);if(o.getChild()==null)return g;for(var f=o.getChild().getNodes(),L=0;L<f.length;L++){var A=f[L];g+=this.getNodeDegreeWithChildren(A)}return g},E.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},E.prototype.fillCompexOrderByDFS=function(o){for(var g=0;g<o.length;g++){var f=o[g];f.getChild()!=null&&this.fillCompexOrderByDFS(f.getChild().getNodes()),this.getToBeTiled(f)&&this.compoundOrder.push(f)}},E.prototype.adjustLocations=function(o,g,f,L,A){g+=L,f+=A;for(var I=g,m=0;m<o.rows.length;m++){var R=o.rows[m];g=I;for(var w=0,F=0;F<R.length;F++){var Y=R[F];Y.rect.x=g,Y.rect.y=f,g+=Y.rect.width+o.horizontalPadding,Y.rect.height>w&&(w=Y.rect.height)}f+=w+o.verticalPadding}},E.prototype.tileCompoundMembers=function(o,g){var f=this;this.tiledMemberPack=[],Object.keys(o).forEach(function(L){var A=g[L];f.tiledMemberPack[L]=f.tileNodes(o[L],A.paddingLeft+A.paddingRight),A.rect.width=f.tiledMemberPack[L].width,A.rect.height=f.tiledMemberPack[L].height})},E.prototype.tileNodes=function(o,g){var f=s.TILING_PADDING_VERTICAL,L=s.TILING_PADDING_HORIZONTAL,A={rows:[],rowWidth:[],rowHeight:[],width:0,height:g,verticalPadding:f,horizontalPadding:L};o.sort(function(R,w){return R.rect.width*R.rect.height>w.rect.width*w.rect.height?-1:R.rect.width*R.rect.height<w.rect.width*w.rect.height?1:0});for(var I=0;I<o.length;I++){var m=o[I];A.rows.length==0?this.insertNodeToRow(A,m,0,g):this.canAddHorizontal(A,m.rect.width,m.rect.height)?this.insertNodeToRow(A,m,this.getShortestRowIndex(A),g):this.insertNodeToRow(A,m,A.rows.length,g),this.shiftToLastRow(A)}return A},E.prototype.insertNodeToRow=function(o,g,f,L){var A=L;if(f==o.rows.length){var I=[];o.rows.push(I),o.rowWidth.push(A),o.rowHeight.push(0)}var m=o.rowWidth[f]+g.rect.width;o.rows[f].length>0&&(m+=o.horizontalPadding),o.rowWidth[f]=m,o.width<m&&(o.width=m);var R=g.rect.height;f>0&&(R+=o.verticalPadding);var w=0;R>o.rowHeight[f]&&(w=o.rowHeight[f],o.rowHeight[f]=R,w=o.rowHeight[f]-w),o.height+=w,o.rows[f].push(g)},E.prototype.getShortestRowIndex=function(o){for(var g=-1,f=Number.MAX_VALUE,L=0;L<o.rows.length;L++)o.rowWidth[L]<f&&(g=L,f=o.rowWidth[L]);return g},E.prototype.getLongestRowIndex=function(o){for(var g=-1,f=Number.MIN_VALUE,L=0;L<o.rows.length;L++)o.rowWidth[L]>f&&(g=L,f=o.rowWidth[L]);return g},E.prototype.canAddHorizontal=function(o,g,f){var L=this.getShortestRowIndex(o);if(L<0)return!0;var A=o.rowWidth[L];if(A+o.horizontalPadding+g<=o.width)return!0;var I=0;o.rowHeight[L]<f&&L>0&&(I=f+o.verticalPadding-o.rowHeight[L]);var m;o.width-A>=g+o.horizontalPadding?m=(o.height+I)/(A+g+o.horizontalPadding):m=(o.height+I)/o.width,I=f+o.verticalPadding;var R;return o.width<g?R=(o.height+I)/g:R=(o.height+I)/o.width,R<1&&(R=1/R),m<1&&(m=1/m),m<R},E.prototype.shiftToLastRow=function(o){var g=this.getLongestRowIndex(o),f=o.rowWidth.length-1,L=o.rows[g],A=L[L.length-1],I=A.width+o.horizontalPadding;if(o.width-o.rowWidth[f]>I&&g!=f){L.splice(-1,1),o.rows[f].push(A),o.rowWidth[g]=o.rowWidth[g]-I,o.rowWidth[f]=o.rowWidth[f]+I,o.width=o.rowWidth[instance.getLongestRowIndex(o)];for(var m=Number.MIN_VALUE,R=0;R<L.length;R++)L[R].height>m&&(m=L[R].height);g>0&&(m+=o.verticalPadding);var w=o.rowHeight[g]+o.rowHeight[f];o.rowHeight[g]=m,o.rowHeight[f]<A.height+o.verticalPadding&&(o.rowHeight[f]=A.height+o.verticalPadding);var F=o.rowHeight[g]+o.rowHeight[f];o.height+=F-w,this.shiftToLastRow(o)}},E.prototype.tilingPreLayout=function(){s.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},E.prototype.tilingPostLayout=function(){s.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},E.prototype.reduceTrees=function(){for(var o=[],g=!0,f;g;){var L=this.graphManager.getAllNodes(),A=[];g=!1;for(var I=0;I<L.length;I++)f=L[I],f.getEdges().length==1&&!f.getEdges()[0].isInterGraph&&f.getChild()==null&&(A.push([f,f.getEdges()[0],f.getOwner()]),g=!0);if(g==!0){for(var m=[],R=0;R<A.length;R++)A[R][0].getEdges().length==1&&(m.push(A[R]),A[R][0].getOwner().remove(A[R][0]));o.push(m),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=o},E.prototype.growTree=function(o){for(var g=o.length,f=o[g-1],L,A=0;A<f.length;A++)L=f[A],this.findPlaceforPrunedNode(L),L[2].add(L[0]),L[2].add(L[1],L[1].source,L[1].target);o.splice(o.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},E.prototype.findPlaceforPrunedNode=function(o){var g,f,L=o[0];L==o[1].source?f=o[1].target:f=o[1].source;var A=f.startX,I=f.finishX,m=f.startY,R=f.finishY,w=0,F=0,Y=0,x=0,M=[w,Y,F,x];if(m>0)for(var G=A;G<=I;G++)M[0]+=this.grid[G][m-1].length+this.grid[G][m].length-1;if(I<this.grid.length-1)for(var G=m;G<=R;G++)M[1]+=this.grid[I+1][G].length+this.grid[I][G].length-1;if(R<this.grid[0].length-1)for(var G=A;G<=I;G++)M[2]+=this.grid[G][R+1].length+this.grid[G][R].length-1;if(A>0)for(var G=m;G<=R;G++)M[3]+=this.grid[A-1][G].length+this.grid[A][G].length-1;for(var S=y.MAX_VALUE,P,_,U=0;U<M.length;U++)M[U]<S?(S=M[U],P=1,_=U):M[U]==S&&P++;if(P==3&&S==0)M[0]==0&&M[1]==0&&M[2]==0?g=1:M[0]==0&&M[1]==0&&M[3]==0?g=0:M[0]==0&&M[2]==0&&M[3]==0?g=3:M[1]==0&&M[2]==0&&M[3]==0&&(g=2);else if(P==2&&S==0){var X=Math.floor(Math.random()*2);M[0]==0&&M[1]==0?X==0?g=0:g=1:M[0]==0&&M[2]==0?X==0?g=0:g=2:M[0]==0&&M[3]==0?X==0?g=0:g=3:M[1]==0&&M[2]==0?X==0?g=1:g=2:M[1]==0&&M[3]==0?X==0?g=1:g=3:X==0?g=2:g=3}else if(P==4&&S==0){var X=Math.floor(Math.random()*4);g=X}else g=_;g==0?L.setCenter(f.getCenterX(),f.getCenterY()-f.getHeight()/2-p.DEFAULT_EDGE_LENGTH-L.getHeight()/2):g==1?L.setCenter(f.getCenterX()+f.getWidth()/2+p.DEFAULT_EDGE_LENGTH+L.getWidth()/2,f.getCenterY()):g==2?L.setCenter(f.getCenterX(),f.getCenterY()+f.getHeight()/2+p.DEFAULT_EDGE_LENGTH+L.getHeight()/2):L.setCenter(f.getCenterX()-f.getWidth()/2-p.DEFAULT_EDGE_LENGTH-L.getWidth()/2,f.getCenterY())},C.exports=E}),(function(C,v,n){"use strict";var e={};e.layoutBase=n(0),e.CoSEConstants=n(1),e.CoSEEdge=n(2),e.CoSEGraph=n(3),e.CoSEGraphManager=n(4),e.CoSELayout=n(6),e.CoSENode=n(5),C.exports=e})])})});var nt=$((Q,tt)=>{(function(C,v){typeof Q=="object"&&typeof tt=="object"?tt.exports=v(J()):typeof define=="function"&&define.amd?define(["cose-base"],v):typeof Q=="object"?Q.cytoscapeCoseBilkent=v(J()):C.cytoscapeCoseBilkent=v(C.coseBase)})(Q,function(N){return(function(C){var v={};function n(e){if(v[e])return v[e].exports;var t=v[e]={i:e,l:!1,exports:{}};return C[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=C,n.c=v,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)})([(function(C,v){C.exports=N}),(function(C,v,n){"use strict";var e=n(0).layoutBase.LayoutConstants,t=n(0).layoutBase.FDLayoutConstants,r=n(0).CoSEConstants,a=n(0).CoSELayout,u=n(0).CoSENode,s=n(0).layoutBase.PointD,p=n(0).layoutBase.DimensionD,i={ready:function(){},stop:function(){},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 h(T,c){var D={};for(var E in T)D[E]=T[E];for(var E in c)D[E]=c[E];return D}function l(T){this.options=h(i,T),d(this.options)}var d=function(c){c.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=c.nodeRepulsion),c.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=c.idealEdgeLength),c.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=c.edgeElasticity),c.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=c.nestingFactor),c.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=c.gravity),c.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=c.numIter),c.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=c.gravityRange),c.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=c.gravityCompound),c.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=c.gravityRangeCompound),c.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=c.initialEnergyOnIncremental),c.quality=="draft"?e.QUALITY=0:c.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=c.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!c.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=c.animate,r.TILE=c.tile,r.TILING_PADDING_VERTICAL=typeof c.tilingPaddingVertical=="function"?c.tilingPaddingVertical.call():c.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof c.tilingPaddingHorizontal=="function"?c.tilingPaddingHorizontal.call():c.tilingPaddingHorizontal};l.prototype.run=function(){var T,c,D=this.options,E=this.idToLNode={},O=this.layout=new a,o=this;o.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var g=O.newGraphManager();this.gm=g;var f=this.options.eles.nodes(),L=this.options.eles.edges();this.root=g.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(f),O);for(var A=0;A<L.length;A++){var I=L[A],m=this.idToLNode[I.data("source")],R=this.idToLNode[I.data("target")];if(m!==R&&m.getEdgesBetween(R).length==0){var w=g.add(O.newEdge(),m,R);w.id=I.id()}}var F=function(M,G){typeof M=="number"&&(M=G);var S=M.data("id"),P=o.idToLNode[S];return{x:P.getRect().getCenterX(),y:P.getRect().getCenterY()}},Y=function x(){for(var M=function(){D.fit&&D.cy.fit(D.eles,D.padding),T||(T=!0,o.cy.one("layoutready",D.ready),o.cy.trigger({type:"layoutready",layout:o}))},G=o.options.refresh,S,P=0;P<G&&!S;P++)S=o.stopped||o.layout.tick();if(S){O.checkLayoutSuccess()&&!O.isSubLayout&&O.doPostLayout(),O.tilingPostLayout&&O.tilingPostLayout(),O.isLayoutFinished=!0,o.options.eles.nodes().positions(F),M(),o.cy.one("layoutstop",o.options.stop),o.cy.trigger({type:"layoutstop",layout:o}),c&&cancelAnimationFrame(c),T=!1;return}var _=o.layout.getPositionsData();D.eles.nodes().positions(function(U,X){if(typeof U=="number"&&(U=X),!U.isParent()){for(var B=U.id(),b=_[B],H=U;b==null&&(b=_[H.data("parent")]||_["DummyCompound_"+H.data("parent")],_[B]=b,H=H.parent()[0],H!=null););return b!=null?{x:b.x,y:b.y}:{x:U.position("x"),y:U.position("y")}}}),M(),c=requestAnimationFrame(x)};return O.addListener("layoutstarted",function(){o.options.animate==="during"&&(c=requestAnimationFrame(Y))}),O.runLayout(),this.options.animate!=="during"&&(o.options.eles.nodes().not(":parent").layoutPositions(o,o.options,F),T=!1),this},l.prototype.getTopMostNodes=function(T){for(var c={},D=0;D<T.length;D++)c[T[D].id()]=!0;var E=T.filter(function(O,o){typeof O=="number"&&(O=o);for(var g=O.parent()[0];g!=null;){if(c[g.id()])return!1;g=g.parent()[0]}return!0});return E},l.prototype.processChildrenList=function(T,c,D){for(var E=c.length,O=0;O<E;O++){var o=c[O],g=o.children(),f,L=o.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(o.outerWidth()!=null&&o.outerHeight()!=null?f=T.add(new u(D.graphManager,new s(o.position("x")-L.w/2,o.position("y")-L.h/2),new p(parseFloat(L.w),parseFloat(L.h)))):f=T.add(new u(this.graphManager)),f.id=o.data("id"),f.paddingLeft=parseInt(o.css("padding")),f.paddingTop=parseInt(o.css("padding")),f.paddingRight=parseInt(o.css("padding")),f.paddingBottom=parseInt(o.css("padding")),this.options.nodeDimensionsIncludeLabels&&o.isParent()){var A=o.boundingBox({includeLabels:!0,includeNodes:!1}).w,I=o.boundingBox({includeLabels:!0,includeNodes:!1}).h,m=o.css("text-halign");f.labelWidth=A,f.labelHeight=I,f.labelPos=m}if(this.idToLNode[o.data("id")]=f,isNaN(f.rect.x)&&(f.rect.x=0),isNaN(f.rect.y)&&(f.rect.y=0),g!=null&&g.length>0){var R;R=D.getGraphManager().add(D.newGraph(),f),this.processChildrenList(R,g,D)}}},l.prototype.stop=function(){return this.stopped=!0,this};var y=function(c){c("layout","cose-bilkent",l)};typeof cytoscape<"u"&&y(cytoscape),C.exports=y})])})});var st=pt(nt(),1);j.use(st.default);function ot(N,C){N.forEach(v=>{let n={id:v.id,labelText:v.label,height:v.height,width:v.width,padding:v.padding??0};Object.keys(v).forEach(e=>{["id","label","height","width","padding","x","y"].includes(e)||(n[e]=v[e])}),C.add({group:"nodes",data:n,position:{x:v.x??0,y:v.y??0}})})}W(ot,"addNodes");function at(N,C){N.forEach(v=>{let n={id:v.id,source:v.start,target:v.end};Object.keys(v).forEach(e=>{["id","start","end"].includes(e)||(n[e]=v[e])}),C.add({group:"edges",data:n})})}W(at,"addEdges");function ht(N){return new Promise(C=>{let v=it("body").append("div").attr("id","cy").attr("style","display:none"),n=j({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});v.remove(),ot(N.nodes,n),at(N.edges,n),n.nodes().forEach(function(t){t.layoutDimensions=()=>{let r=t.data();return{w:r.width,h:r.height}}});let e={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};n.layout(e).run(),n.ready(t=>{V.info("Cytoscape ready",t),C(n)})})}W(ht,"createCytoscapeInstance");function lt(N){return N.nodes().map(C=>{let v=C.data(),n=C.position(),e={id:v.id,x:n.x,y:n.y};return Object.keys(v).forEach(t=>{t!=="id"&&(e[t]=v[t])}),e})}W(lt,"extractPositionedNodes");function ut(N){return N.edges().map(C=>{let v=C.data(),n=C._private.rscratch,e={id:v.id,source:v.source,target:v.target,startX:n.startX,startY:n.startY,midX:n.midX,midY:n.midY,endX:n.endX,endY:n.endY};return Object.keys(v).forEach(t=>{["id","source","target"].includes(t)||(e[t]=v[t])}),e})}W(ut,"extractPositionedEdges");async function gt(N,C){V.debug("Starting cose-bilkent layout algorithm");try{ft(N);let v=await ht(N),n=lt(v),e=ut(v);return V.debug(`Layout completed: ${n.length} nodes, ${e.length} edges`),{nodes:n,edges:e}}catch(v){throw V.error("Error in cose-bilkent layout algorithm:",v),v}}W(gt,"executeCoseBilkentLayout");function ft(N){if(!N)throw new Error("Layout data is required");if(!N.config)throw new Error("Configuration is required in layout data");if(!N.rootNode)throw new Error("Root node is required");if(!N.nodes||!Array.isArray(N.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(N.edges))throw new Error("Edges array is required in layout data");return!0}W(ft,"validateLayoutData");var dt=W(async(N,C,{insertCluster:v,insertEdge:n,insertEdgeLabel:e,insertMarkers:t,insertNode:r,log:a,positionEdgeLabel:u},{algorithm:s})=>{let p={},i={},h=C.select("g");t(h,N.markers,N.type,N.diagramId);let l=h.insert("g").attr("class","subgraphs"),d=h.insert("g").attr("class","edgePaths"),y=h.insert("g").attr("class","edgeLabels"),T=h.insert("g").attr("class","nodes");a.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(N.nodes.map(async E=>{if(E.isGroup){let O={...E};i[E.id]=O,p[E.id]=O,await v(l,E)}else{let O={...E};p[E.id]=O;let o=await r(T,E,{config:N.config,dir:N.direction||"TB"}),g=o.node().getBBox();O.width=g.width,O.height=g.height,O.domId=o,a.debug(`Node ${E.id} dimensions: ${g.width}x${g.height}`)}})),a.debug("Running cose-bilkent layout algorithm");let c={...N,nodes:N.nodes.map(E=>{let O=p[E.id];return{...E,width:O.width,height:O.height}})},D=await gt(c,N.config);a.debug("Positioning nodes based on layout results"),D.nodes.forEach(E=>{let O=p[E.id];O?.domId&&(O.domId.attr("transform",`translate(${E.x}, ${E.y})`),O.x=E.x,O.y=E.y,a.debug(`Positioned node ${O.id} at center (${E.x}, ${E.y})`))}),D.edges.forEach(E=>{let O=N.edges.find(o=>o.id===E.id);O&&(O.points=[{x:E.startX,y:E.startY},{x:E.midX,y:E.midY},{x:E.endX,y:E.endY}])}),a.debug("Inserting and positioning edges"),await Promise.all(N.edges.map(async E=>{let O=await e(y,E),o=p[E.start??""],g=p[E.end??""];if(o&&g){let f=D.edges.find(L=>L.id===E.id);if(f){a.debug("APA01 positionedEdge",f);let L={...E},A=n(d,L,i,N.type,o,g,N.diagramId);u(L,A)}else{let L={...E,points:[{x:o.x||0,y:o.y||0},{x:g.x||0,y:g.y||0}]},A=n(d,L,i,N.type,o,g,N.diagramId);u(L,A)}}})),a.debug("Cose-bilkent rendering completed")},"render"),Tt=dt;export{Tt as render};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,b as r}from"./chunk-ZMBQGVIF.js";import"./chunk-FK4OKHO7.js";import"./chunk-OOJM4CTU.js";export{e as CynefinModule,r as createCynefinServices};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import{a as yt}from"./chunk-J4SQIVOP.js";import{a as ut}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import{a as pt}from"./chunk-WVYKIHVG.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import"./chunk-FK4OKHO7.js";import{o as X}from"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{O as rt,T as it,U as st,V as ct,W as lt,X as dt,Y as ft,Z as mt,i as Q,k as at,u as O}from"./chunk-NLCJ5AKJ.js";import{b as E}from"./chunk-3CEAP2V5.js";import{a as r}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var xt=r(()=>({domains:new Map,transitions:[]}),"createDefaultData"),G=xt(),St=r(()=>G.domains,"getDomains"),Mt=r(()=>G.transitions,"getTransitions"),zt=r(t=>{if(t)for(let e of t){let n=e.domain,o=(e.items??[]).map(c=>({label:c.label}));G.domains.set(n,{name:n,items:o})}},"setDomains"),Lt=r(t=>{t&&(G.transitions=t.filter(e=>e.from===e.to?(E.warn(`Cynefin: self-loop transition on domain "${e.from}" is not meaningful and will be skipped.`),!1):!0).map(e=>({from:e.from,to:e.to,label:e.label||void 0})))},"setTransitions"),Nt=r(()=>X({...at.cynefin,...O().cynefin}),"getConfig"),Pt=r(()=>{it(),G=xt()},"clear"),j={getDomains:St,getTransitions:Mt,setDomains:zt,setTransitions:Lt,getConfig:Nt,clear:Pt,setAccTitle:st,getAccTitle:ct,setDiagramTitle:ft,getDiagramTitle:mt,getAccDescription:dt,setAccDescription:lt},It=r(t=>{yt(t,j),j.setDomains(t.domains),j.setTransitions(t.transitions)},"populate"),Wt={parse:r(async t=>{let e=await ut("cynefin",t);E.debug(e),It(e)},"parse")};function H(t){let e=t+1831565813|0;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}r(H,"seededRandom");function gt(t){let e=0;for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);e=(e<<5)-e+o,e|=0}return e}r(gt,"hashString");function $t(t,e){return typeof t=="number"&&Number.isFinite(t)&&t!==0?t:gt(e)}r($t,"resolveSeed");function bt(t,e,n,o){let c=t/2,m=o??t*.015,v=7,W=e/v,d=[];for(let a=0;a<=v;a++){let p=H(n+a*17)*m*2-m;d.push({x:c+p,y:a*W})}let D=`M${d[0].x},${d[0].y}`;for(let a=0;a<d.length-1;a++){let p=d[a],s=d[a+1],f=(p.y+s.y)/2,b=a%2===0?1:-1,h=m*1.5*b*H(n+a*31+7),R=p.x+h,F=f,V=s.x-h;D+=` C${R},${F} ${V},${f} ${s.x},${s.y}`}return D}r(bt,"generateFoldPath");function wt(t,e,n,o){let c=e/2,m=o??e*.015,v=7,W=t/v,d=[];for(let a=0;a<=v;a++){let p=H(n+a*23)*m*2-m;d.push({x:a*W,y:c+p})}let D=`M${d[0].x},${d[0].y}`;for(let a=0;a<d.length-1;a++){let p=d[a],s=d[a+1],f=(p.x+s.x)/2,b=a%2===0?1:-1,h=m*1.5*b*H(n+a*37+11),R=f,F=p.y+h,V=f,z=s.y-h;D+=` C${R},${F} ${V},${z} ${s.x},${s.y}`}return D}r(wt,"generateHorizontalBoundary");function Ct(t,e){let n=t/2,o=e*.5,c=e,m=t*.03;return[`M${n},${o}`,`C${n+m},${o+(c-o)*.2}`,`${n-m*1.5},${o+(c-o)*.55}`,`${n+m*.5},${o+(c-o)*.75}`,`C${n-m},${o+(c-o)*.85}`,`${n+m*.3},${o+(c-o)*.95}`,`${n},${c}`].join(" ")}r(Ct,"generateCliffPath");function vt(t,e,n,o){return[`M${t-n},${e}`,`A${n},${o} 0 1,1 ${t+n},${e}`,`A${n},${o} 0 1,1 ${t-n},${e}`,"Z"].join(" ")}r(vt,"generateConfusionPath");var ht={complex:{model:"Probe \u2192 Sense \u2192 Respond",practice:"Emergent Practices"},complicated:{model:"Sense \u2192 Analyse \u2192 Respond",practice:"Good Practices"},clear:{model:"Sense \u2192 Categorise \u2192 Respond",practice:"Best Practices"},chaotic:{model:"Act \u2192 Sense \u2192 Respond",practice:"Novel Practices"},confusion:{model:"",practice:"Disorder"}},Rt=r((t,e)=>{let n=t/2,o=e/2;return{complex:{cx:n/2,cy:o/2,x:0,y:0,w:n,h:o},complicated:{cx:n+n/2,cy:o/2,x:n,y:0,w:n,h:o},chaotic:{cx:n/2,cy:o+o/2,x:0,y:o,w:n,h:o},clear:{cx:n+n/2,cy:o+o/2,x:n,y:o,w:n,h:o},confusion:{cx:n,cy:o,x:n*.7,y:o*.7,w:n*.6,h:o*.6}}},"getDomainLayouts"),Ft=r(()=>{let t=Q(),e=O();return X(t,e.themeVariables).cynefin},"getCynefinDomainColors"),Z=3,Vt=r((t,e,n,o)=>{let c=o.db,m=c.getDomains(),v=c.getTransitions(),W=c.getDiagramTitle(),d=c.getAccTitle(),D=c.getAccDescription(),a=c.getConfig(),p=Ft();E.debug("Rendering Cynefin diagram");let s=a.width,f=a.height,b=a.padding,h=a.showDomainDescriptions,R=a.boundaryAmplitude,F=s+b*2,V=f+b*2,z={complex:p.complexBg,complicated:p.complicatedBg,clear:p.clearBg,chaotic:p.chaoticBg,confusion:p.confusionBg},k=pt(e);rt(k,V,F,a.useMaxWidth??!0),k.attr("viewBox",`0 0 ${F} ${V}`),d&&k.append("title").text(d),D&&k.append("desc").text(D);let T=k.append("g").attr("transform",`translate(${b}, ${b})`),_=Rt(s,f),J=$t(a.seed,e),Dt=T.append("g").attr("class","cynefin-backgrounds"),q=["complex","complicated","chaotic","clear"];for(let l of q){let i=_[l];Dt.append("rect").attr("class","cynefinDomain").attr("x",i.x).attr("y",i.y).attr("width",i.w).attr("height",i.h).attr("fill",z[l]).attr("fill-opacity",.4).attr("stroke","none")}let U=T.append("g").attr("class","cynefin-boundaries");U.append("path").attr("class","cynefinBoundary").attr("d",bt(s,f,J,R)).attr("fill","none"),U.append("path").attr("class","cynefinBoundary").attr("d",wt(s,f,J+100,R)).attr("fill","none"),U.append("path").attr("class","cynefinCliff").attr("d",Ct(s,f)).attr("fill","none");let kt=s*.15,Tt=f*.15;T.append("path").attr("class","cynefinConfusion").attr("d",vt(s/2,f/2,kt,Tt)).attr("fill",z.confusion).attr("fill-opacity",.5);let K=T.append("g").attr("class","cynefin-labels");for(let l of q){let i=_[l];K.append("text").attr("class","cynefinDomainLabel").attr("x",i.cx).attr("y",h?i.cy-30:i.cy).attr("text-anchor","middle").attr("dominant-baseline","middle").text(l.charAt(0).toUpperCase()+l.slice(1))}if(K.append("text").attr("class","cynefinDomainLabel").attr("x",s/2).attr("y",h?f/2-10:f/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text("Confusion"),h){let l=T.append("g").attr("class","cynefin-subtitles");for(let i of q){let u=_[i],y=ht[i];l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy-10).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.model),l.append("text").attr("class","cynefinSubtitle").attr("x",u.cx).attr("y",u.cy+5).attr("text-anchor","middle").attr("dominant-baseline","middle").text(y.practice)}l.append("text").attr("class","cynefinSubtitle").attr("x",s/2).attr("y",f/2+8).attr("text-anchor","middle").attr("dominant-baseline","middle").text(ht.confusion.practice)}let tt=T.append("g").attr("class","cynefin-items"),A=26,et=10,At=["complex","complicated","chaotic","clear","confusion"];for(let l of At){let i=m.get(l);if(!i||i.items.length===0)continue;let u=_[l],y=l==="confusion",L=i.items,N=0;y&&i.items.length>Z&&(N=i.items.length-Z,L=i.items.slice(0,Z));let B;if(y){let g=h?22:14;B=u.cy+g}else B=u.cy+(h?25:15);if([...L].forEach((g,S)=>{let w=B+S*(A+4),M=tt.append("g"),P=M.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(g.label),$=g.label.length*7,x=P.node();if(x&&typeof x.getBBox=="function"){let Y=x.getBBox();Y.width>0&&($=Y.width)}let C=$+et*2,I=u.cx-C/2;M.attr("transform",`translate(${I}, ${w})`),M.insert("rect","text").attr("class","cynefinItem").attr("x",0).attr("y",0).attr("width",C).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.95),P.attr("x",C/2).attr("y",A/2)}),N>0){let g=B+L.length*(A+4),S=`+${N} more`,w=tt.append("g"),M=w.append("text").attr("class","cynefinItemText").attr("x",0).attr("y",A/2).attr("text-anchor","middle").attr("dominant-baseline","central").text(S),P=S.length*7,$=M.node();if($&&typeof $.getBBox=="function"){let I=$.getBBox();I.width>0&&(P=I.width)}let x=P+et*2,C=u.cx-x/2;w.attr("transform",`translate(${C}, ${g})`),w.insert("rect","text").attr("class","cynefinItemOverflow").attr("x",0).attr("y",0).attr("width",x).attr("height",A).attr("rx",4).attr("ry",4).attr("fill",z[l]).attr("fill-opacity",.6),M.attr("x",x/2).attr("y",A/2)}}if(v.length>0){let l=k.select("defs").empty()?k.append("defs"):k.select("defs"),i=`cynefin-arrow-${e}`;l.append("marker").attr("id",i).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","cynefinArrowHead");let u=T.append("g").attr("class","cynefin-arrows");v.forEach(y=>{let L=_[y.from],N=_[y.to];if(!L||!N)return;if(y.from===y.to){E.warn(`Cynefin renderer: skipping self-loop on domain "${y.from}"`);return}let B=L.cx,g=L.cy,S=N.cx,w=N.cy,M=(B+S)/2,P=(g+w)/2,$=S-B,x=w-g,C=Math.sqrt($*$+x*x),I=C*.15,Y=-x/C,Bt=$/C,nt=M+Y*I,ot=P+Bt*I;u.append("path").attr("class","cynefinArrowLine").attr("d",`M${B},${g} Q${nt},${ot} ${S},${w}`).attr("fill","none").attr("marker-end",`url(#${i})`),y.label&&u.append("text").attr("class","cynefinArrowLabel").attr("x",nt).attr("y",ot-6).attr("text-anchor","middle").attr("dominant-baseline","auto").text(y.label)})}W&&T.append("text").attr("class","cynefinTitle").attr("x",s/2).attr("y",-b/2).attr("text-anchor","middle").attr("dominant-baseline","middle").text(W)},"draw"),_t={draw:Vt},Et=r(()=>{let t=Q(),e=O();return X(t,e.themeVariables).cynefin},"getCynefinTheme"),Ht=r(()=>{let t=Et();return`
|
|
2
|
+
.cynefinDomain {
|
|
3
|
+
stroke: none;
|
|
4
|
+
}
|
|
5
|
+
.cynefinDomainLabel {
|
|
6
|
+
font-size: ${t.domainFontSize}px;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
fill: ${t.labelColor};
|
|
9
|
+
}
|
|
10
|
+
.cynefinSubtitle {
|
|
11
|
+
font-size: ${t.itemFontSize-1}px;
|
|
12
|
+
fill: ${t.textColor};
|
|
13
|
+
font-style: italic;
|
|
14
|
+
}
|
|
15
|
+
.cynefinItem {
|
|
16
|
+
fill-opacity: 0.95;
|
|
17
|
+
stroke: ${t.boundaryColor};
|
|
18
|
+
stroke-width: 1;
|
|
19
|
+
}
|
|
20
|
+
.cynefinItemText {
|
|
21
|
+
font-size: ${t.itemFontSize}px;
|
|
22
|
+
fill: ${t.textColor};
|
|
23
|
+
}
|
|
24
|
+
.cynefinItemOverflow {
|
|
25
|
+
fill-opacity: 0.6;
|
|
26
|
+
stroke: ${t.boundaryColor};
|
|
27
|
+
stroke-width: 1;
|
|
28
|
+
stroke-dasharray: 3 2;
|
|
29
|
+
}
|
|
30
|
+
.cynefinBoundary {
|
|
31
|
+
stroke: ${t.boundaryColor};
|
|
32
|
+
stroke-width: ${t.boundaryWidth};
|
|
33
|
+
stroke-dasharray: 6 3;
|
|
34
|
+
}
|
|
35
|
+
.cynefinCliff {
|
|
36
|
+
stroke: ${t.cliffColor};
|
|
37
|
+
stroke-width: ${t.cliffWidth};
|
|
38
|
+
}
|
|
39
|
+
.cynefinConfusion {
|
|
40
|
+
stroke: ${t.boundaryColor};
|
|
41
|
+
stroke-width: 1.5;
|
|
42
|
+
stroke-dasharray: 4 2;
|
|
43
|
+
}
|
|
44
|
+
.cynefinArrowLine {
|
|
45
|
+
stroke: ${t.arrowColor};
|
|
46
|
+
stroke-width: ${t.arrowWidth};
|
|
47
|
+
fill: none;
|
|
48
|
+
}
|
|
49
|
+
.cynefinArrowHead {
|
|
50
|
+
fill: ${t.arrowColor};
|
|
51
|
+
stroke: none;
|
|
52
|
+
}
|
|
53
|
+
.cynefinArrowLabel {
|
|
54
|
+
font-size: ${t.itemFontSize-1}px;
|
|
55
|
+
fill: ${t.textColor};
|
|
56
|
+
}
|
|
57
|
+
.cynefinTitle {
|
|
58
|
+
font-size: ${t.domainFontSize+2}px;
|
|
59
|
+
font-weight: bold;
|
|
60
|
+
fill: ${t.labelColor};
|
|
61
|
+
}
|
|
62
|
+
`},"styles"),Gt=Ht,Zt={parser:Wt,db:j,renderer:_t,styles:Gt};export{Zt as diagram};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as H}from"./chunk-JXCTOEX6.js";import{a as O,b as A,c as E,d as D,e as Y,f as x,g as _}from"./chunk-A3DHMJKP.js";import{C as k}from"./chunk-2KBWIZHB.js";import{a as I}from"./chunk-RBL2QVA3.js";import{f as N,g as M,h as G}from"./chunk-LK6KML2S.js";import{a as v,c as B,e as S}from"./chunk-CBQW2LLN.js";import{b as P}from"./chunk-U3E5RSXE.js";import"./chunk-EWILYK3H.js";import"./chunk-XCMS6RVA.js";import"./chunk-ZYRITDEB.js";import"./chunk-4AUIAGYT.js";import"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{_ as R}from"./chunk-NLCJ5AKJ.js";import{b as p}from"./chunk-3CEAP2V5.js";import{a as m}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var J=m((t,e,r)=>Math.max(e,Math.min(r,t)),"clamp"),T=m((t="TB")=>{switch(t){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),U=m(t=>t==="flowchart"||t==="flowchart-v2"||t==="stateDiagram"||t==="er"||t==="classDiagram","shouldMergeSelfLoopSegments"),K=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],Q=m((t,e,r,d,n)=>{let f=[],h=new Set;if(r.forEach(({start:s,end:o})=>{s!==d&&h.add(s),o!==d&&h.add(o)}),h.forEach(s=>{let o=t.node(s);typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)}),f.length===0&&r.forEach(({edge:s})=>{(s.points??[]).forEach(o=>{typeof o?.x=="number"&&typeof o?.y=="number"&&f.push(o)})}),f.length===0)return T(n);let g=f.reduce((s,o)=>({x:s.x+o.x/f.length,y:s.y+o.y/f.length}),{x:0,y:0}),l=g.x-e.x,i=g.y-e.y;return Math.abs(l)>Math.abs(i)?l>0?"right":"left":Math.abs(i)>0?i>0?"bottom":"top":T(n)},"getSelfLoopSide"),V=m((t,e="top",r=0,d=0)=>{let n=t.x,f=t.y-r,h=t.width/2,g=t.height/2,l=Math.max(36,Math.min(100,t.width*.8)),i=J(Math.max(d,t.width*.35),36,l),s=J(Math.min(t.width,t.height)*.45,24,48);switch(e){case"bottom":{let o=f+g;return[{x:n-i/2,y:o},{x:n-i/2,y:o+s},{x:n+i/2,y:o+s},{x:n+i/2,y:o}]}case"right":{let o=n+h;return[{x:o,y:f-i/2},{x:o+s,y:f-i/2},{x:o+s,y:f+i/2},{x:o,y:f+i/2}]}case"left":{let o=n-h;return[{x:o,y:f-i/2},{x:o-s,y:f-i/2},{x:o-s,y:f+i/2},{x:o,y:f+i/2}]}default:{let o=f-g;return[{x:n-i/2,y:o},{x:n-i/2,y:o-s},{x:n+i/2,y:o-s},{x:n+i/2,y:o}]}}},"getSelfLoopPoints"),Z=m((t,e,r="top",d=0,n={})=>{let h=t.x,g=t.y-d,l=n.width??0,i=n.height??0;switch(r){case"bottom":return{x:h,y:Math.max(...e.map(s=>s.y))+i/2+4};case"right":return{x:Math.max(...e.map(s=>s.x))+l/2+4,y:g};case"left":return{x:Math.min(...e.map(s=>s.x))-l/2-4,y:g};default:return{x:h,y:Math.min(...e.map(s=>s.y))-i/2-4}}},"getSelfLoopLabelPosition"),F=m((t,e=0,{mergeSelfLoops:r=!0}={})=>{let d=new Map,n=[],f=t.graph()?.rankdir;return t.edges().forEach(h=>{let g=t.edge(h);if(r&&g.selfLoop){let l=g.selfLoop.id;d.has(l)||d.set(l,[]),d.get(l).push({edge:g,start:h.v,end:h.w})}else n.push({edge:g,start:h.v,end:h.w})}),d.forEach(h=>{if(h.length!==3){h.forEach(u=>n.push(u));return}h.sort((u,w)=>u.edge.selfLoop.order-w.edge.selfLoop.order);let[g,l,i]=h,s=g.edge.originalEdge??l.edge.originalEdge??i.edge.originalEdge??l.edge,o=t.node(s.start);if(!o){h.forEach(u=>n.push(u));return}let a={width:l.edge.width,height:l.edge.height},L=Q(t,o,h,s.start,f),b=V(o,L,e,a.width??0),y=Z(o,b,L,e,a),c={...l.edge,...s,id:s.id,points:b,start:s.start,end:s.end,x:y.x,y:y.y,width:a.width,height:a.height,labelStyle:l.edge.labelStyle,fromCluster:g.edge.fromCluster??l.edge.fromCluster??i.edge.fromCluster,toCluster:g.edge.toCluster??l.edge.toCluster??i.edge.toCluster};delete c.selfLoop,delete c.originalEdge,n.push({edge:c,start:c.start,end:c.end})}),n},"getEdgesToRender"),W=m(async({element:t,graph:e,diagramType:r,id:d,parentCluster:n,siteConfig:f})=>{let h=e.graph().rankdir;p.trace("Dir in recursive render - dir:",h);let{clusters:g,edgePaths:l,edgeLabels:i,nodes:s,rootGroups:o}=O(t,{edgePathsClass:"edgePaths"});e.nodes()?p.info("Recursive render XXX",e.nodes()):p.info("No nodes found for",e),e.edges().length>0&&p.info("Recursive edges",e.edge(e.edges()[0]));let a=U(r);await Promise.all(e.nodes().map(async function(y){let c=e.node(y);if(n!==void 0){let u=JSON.parse(JSON.stringify(n.clusterData));p.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,y,`
|
|
3
|
+
data=`,u.height,`
|
|
4
|
+
Parent cluster`,n.height),e.setNode(n.id,u),e.parent(y)||(p.trace("Setting parent",y,n.id),e.setParent(y,n.id,u))}if(p.info("(Insert) Node XXX"+y+": "+JSON.stringify(e.node(y))),c?.clusterNode){p.info("Cluster identified XBX",y,c.width,e.node(y));let{ranksep:u,nodesep:w}=e.graph();c.graph.setGraph({...c.graph.graph(),ranksep:u+25,nodesep:w});let X=await oe({element:s,graph:c.graph,diagramType:r,id:d,parentCluster:e.node(y),siteConfig:f}),C=X.elem;P(c,C),c.diff=X.diff||0,p.info("New compound node after recursive render XAX",y,"width",c.width,"height",c.height),B(C,c)}else e.children(y).length>0?(p.trace("Cluster - the non recursive path XBX",y,c.id,c,c.width,"Graph:",e),p.trace(D(c.id,e)),E.set(c.id,{id:D(c.id,e),node:c})):(p.trace("Node - the non recursive path XAX",y,s,e.node(y),h),await A(s,e.node(y),{config:f,dir:h}))})),await m(async()=>{let y=e.edges().map(async function(c){let u=e.edge(c.v,c.w,c.name);if(p.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),p.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(e.edge(c))),p.info("Fix",E,"ids:",c.v,c.w,"Translating: ",E.get(c.v),E.get(c.w)),a&&u.selfLoop){if(u.selfLoop.order!==1)return;let w={...u.originalEdge,...u,id:u.selfLoop.id,startLabelLeft:u.originalEdge?.startLabelLeft??u.startLabelLeft,startLabelRight:u.originalEdge?.startLabelRight??u.startLabelRight,endLabelLeft:u.originalEdge?.endLabelLeft??u.endLabelLeft,endLabelRight:u.originalEdge?.endLabelRight??u.endLabelRight};await N(i,w),u.width=w.width,u.height=w.height,u.labelStyle=w.labelStyle;return}await N(i,u)});await Promise.all(y)},"processEdges")();let{subGraphTitleTotalMargin:b}=v(f);return{elem:o,graph:e,groups:{clusters:g,edgePaths:l,edgeLabels:i,nodes:s,rootGroups:o},diagramType:r,id:d,mergeSelfLoops:a,subGraphTitleTotalMargin:b}},"measureDagreGraph"),j=m(t=>{p.info("############################################# XXX"),p.info("### Layout ### XXX"),p.info("############################################# XXX"),H(t)},"runDagreGraphLayout"),$=m((t,e,r)=>{let d=t.node(e);if(!d)return;let n={...d};return d?.clusterNode?n.y=(d.y??0)+r:t.children(e).length>0?n.height=(d.height??0)+r:n.y=(d.y??0)+r/2,n},"normalizeDagreNode"),z=m((t,e)=>{K.forEach(r=>{e[r]!==void 0&&(t[r]=e[r])})},"applyDagreNodeLayout"),ee=m((t,e,r,d)=>({...t,start:t.start??e,end:t.end??r,points:(t.points??[]).map(n=>({...n,y:typeof n.y=="number"?n.y+d:n.y}))}),"normalizeDagreEdge"),te=m((t,e)=>{let{graph:r,mergeSelfLoops:d,subGraphTitleTotalMargin:n=0}=e,f=new Map(t.nodes.map(g=>[g.id,g]));x(r).forEach(g=>{let l=$(r,g,n);if(!l)return;z(r.node(g),l);let i=f.get(g);i&&z(i,l)});let h=n/2;return t.edges=F(r,h,{mergeSelfLoops:d}).map(({edge:g,start:l,end:i})=>ee(g,l,i,h)),t},"applyDagreLayoutResult"),re=m(async({elem:t,graph:e,groups:{clusters:r,edgePaths:d},diagramType:n,id:f,mergeSelfLoops:h,subGraphTitleTotalMargin:g})=>{let l=0;await Promise.all(x(e).map(async function(o){let a=e.node(o);if(p.info("Position XBX => "+o+": ("+a.x,","+a.y,") width: ",a.width," height: ",a.height),a?.clusterNode)a.y+=g,p.info("A tainted cluster node XBX1",o,a.id,a.width,a.height,a.x,a.y,e.parent(o)),E.get(a.id).node=a,S(a);else if(e.children(o).length>0){p.info("A pure cluster node XBX1",o,a.id,a.x,a.y,a.width,a.height,e.parent(o)),a.height+=g,e.node(a.parentId);let L=a?.padding/2||0,b=a?.labelBBox?.height||0,y=b-L||0;p.debug("OffsetY",y,"labelHeight",b,"halfPadding",L),await I(r,a),E.get(a.id).node=a}else{let L=e.node(a.parentId);a.y+=g/2,p.info("A regular node XBX1 - using the padding",a.id,"parent",a.parentId,a.width,a.height,a.x,a.y,"offsetY",a.offsetY,"parent",L,L?.offsetY,a),S(a)}}));let i=g/2;return F(e,i,{mergeSelfLoops:h}).forEach(function({edge:o,start:a,end:L}){p.info("Edge "+a+" -> "+L+": "+JSON.stringify(o),o),o.points.forEach(u=>u.y+=i);let b=e.node(a),y=e.node(L),c=G(d,o,E,n,b,y,f);M(o,c)}),e.nodes().forEach(function(o){let a=e.node(o);p.info(o,a.type,a.diff),a.isGroup&&(l=a.diff)}),p.warn("Returning from recursive render XAX",t,l),{elem:t,diff:l}},"paintDagreLayoutCore"),oe=m(async t=>{let e=await W(t);return j(e.graph),await re(e)},"renderDagreSubgraph"),q=m(t=>{let e=new k({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:t.config?.nodeSpacing||t.nodeSpacing||t.config?.flowchart?.nodeSpacing,ranksep:t.config?.rankSpacing||t.rankSpacing||t.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return t.nodes.forEach(r=>{e.setNode(r.id,{...r}),r.parentId&&e.setParent(r.id,r.parentId)}),p.debug("Edges:",t.edges),t.edges.forEach(r=>{if(r.start===r.end){let d=r.start,n=d+"---"+d+"---1",f=d+"---"+d+"---2",h=e.node(d);e.setNode(n,{domId:n,id:n,parentId:h.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),e.setParent(n,h.parentId),e.setNode(f,{domId:f,id:f,parentId:h.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),e.setParent(f,h.parentId);let g=structuredClone(r),l=structuredClone(r),i=structuredClone(r),s=structuredClone(r);l.originalEdge=g,l.selfLoop={id:g.id,order:0},i.originalEdge=g,i.selfLoop={id:g.id,order:1},s.originalEdge=g,s.selfLoop={id:g.id,order:2},l.label="",l.arrowTypeEnd="none",l.endLabelLeft="",l.endLabelRight="",l.startLabelLeft="",l.id=d+"-cyclic-special-1",i.startLabelRight="",i.startLabelLeft="",i.endLabelLeft="",i.endLabelRight="",i.arrowTypeStart="none",i.arrowTypeEnd="none",i.id=d+"-cyclic-special-mid",s.label="",s.startLabelRight="",s.startLabelLeft="",s.arrowTypeStart="none",h.isGroup&&(l.fromCluster=d,s.toCluster=d),s.id=d+"-cyclic-special-2",s.arrowTypeStart="none",e.setEdge(d,n,l,d+"-cyclic-special-0"),e.setEdge(n,f,i,d+"-cyclic-special-1"),e.setEdge(f,d,s,d+"-cyclic-special-2")}else e.setEdge(r.start,r.end,{...r},r.id)}),Y(e),{graph:e}},"prepareLayoutForDagre"),ne=m(async(t,{element:e,preparedLayout:r})=>{let d=r??q(t),n=R(),f=await W({element:e,graph:d.graph,diagramType:t.type,id:t.diagramId,parentCluster:void 0,siteConfig:n});return d.measuredLayout=f,f},"measureDagreLayout"),ae=m((t,e)=>{let r=e.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return j(r.graph),te(t,r),r},"runDagreLayoutCore"),ie=m((t,{measure:e})=>x(e.graph).map(r=>e.graph.node(r)).filter(Boolean),"getDagrePaintNodes"),se=m((t,e,{measure:r})=>t?r.graph.node(t):void 0,"getDagreEdgeNode"),xe=_({prepareLayout:q,measureLayout:ne,runLayoutCore:ae,paintOptions:{clusterDb:E,getNodes:ie,getEdgeNode:se,skipNode:m((t,{measure:e})=>!e.graph.hasNode(t.id),"skipNode"),isCluster:m((t,{measure:e})=>e.graph.hasNode(t.id)&&(e.graph.children(t.id)??[]).length>0,"isCluster")}});export{te as applyDagreLayoutResult,F as getEdgesToRender,ne as measureDagreLayout,q as prepareLayoutForDagre,xe as render,ae as runDagreLayoutCore};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{a as z}from"./chunk-HRJ5UBVC.js";import{a as O}from"./chunk-J4SQIVOP.js";import{a as G}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import{a as H}from"./chunk-WVYKIHVG.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import"./chunk-FK4OKHO7.js";import{b as W,d as X}from"./chunk-4AUIAGYT.js";import{o as y}from"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{H as N,O as A,T as E,U as L,V as D,W as _,X as M,Y as S,Z as R,k,u as I}from"./chunk-NLCJ5AKJ.js";import{b as C}from"./chunk-3CEAP2V5.js";import{a as f}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var q=/[─━│┃└┗├┣]/,U=/[└┗├┣]/,re=/[─━]/,Y=/^[\s│┃]+$/,P=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,F=/^\s*%%/,ne=" ";function j(r){return r.some(t=>q.test(t))}f(j,"isBoxDrawingFormat");function J(r){for(let t of r){let e=U.exec(t);if(e?.index&&e.index>0)return e.index}return 4}f(J,"inferSegmentWidth");function K(r,t){return r.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{let s=parseInt(n,10),i=t.get(s);return i?`line ${i}`:e})}f(K,"remapErrorLines");function Q(r){let t=r.split(`
|
|
2
|
+
`),e=new Map,n=-1;for(let[p,c]of t.entries())if(c.trim()==="treeView-beta"){n=p;break}if(n===-1)return{text:r,lineMap:e};let s=[];for(let p=n+1;p<t.length;p++){let c=t[p];c.trim()===""||F.test(c)||P.test(c)||Y.test(c)||s.push(c.replace(/\t/g," "))}if(!j(s))return{text:r,lineMap:e};let i=J(s),o=[],a=0;for(let p=0;p<=n;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=n+1;p<t.length;p++){let c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if(F.test(c)){o.push(c),a++,e.set(a,h);continue}if(P.test(c)){o.push(c),a++,e.set(a,h);continue}if(Y.test(c))continue;let l=c.replace(/\t/g," "),m=U.exec(l);if(m?.index!==void 0){let g=m.index,w=Math.round(g/i)+1,u=g+1;for(;u<l.length&&re.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;let v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node \u2014 expected a filename or directory name after the box-drawing prefix`);let te=ne.repeat(w);o.push(te+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(q.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use \u251C\u2500\u2500 or \u2514\u2500\u2500 prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
|
|
3
|
+
`),lineMap:e}}f(Q,"preprocessBoxDrawing");var x=new z(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=f(()=>{x.reset(),E()},"clear"),oe=f(()=>x.records.stack[0],"getRoot"),se=f(()=>x.records.cnt,"getCount"),ae=k.treeView,ce=f(()=>y(ae,I().treeView),"getConfig"),le=f((r,t,e,n,s,i)=>{for(;r<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();let o={id:x.records.cnt++,level:r,name:t,nodeType:e,icon:s,cssClass:n,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:D,getAccDescription:M,getDiagramTitle:R,setAccDescription:_,setAccTitle:L,setDiagramTitle:S},B=de,he=f(r=>{O(r,B);for(let t of r.nodes){let e=typeof t.indent=="number"?t.indent:0,n=t.name,s=n.endsWith("/");s&&(n=n.slice(0,-1));let i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?N(c,I()):void 0;B.addNode(e,n,i,o,p,d)}},"populate"),pe={parse:f(async r=>{let{text:t,lineMap:e}=Q(r);try{let n=await G("treeView",t);C.debug(n),he(n)}catch(n){throw e.size>0&&n instanceof Error&&(n.message=K(n.message,e)),n}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function ee(r,t){let e=t?.filenameIcons?.[r];if(e)return e;let n=r.lastIndexOf(".");if(n>0){let s=r.substring(n).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}f(ee,"detectIcon");function T(r,t){return r.includes(":")?r:r in b.icons||!t?`${b.prefix}:${r}`:`${t}:${r}`}f(T,"qualifyIcon");function $(r,t){if(r.icon!=="none"){if(r.icon)return T(r.icon,t.defaultIconPack);if(t.showIcons){if(r.nodeType==="file"){let e=ee(r.name,t);if(e==="none")return;if(e)return T(e,t.defaultIconPack)}return`${b.prefix}:${r.nodeType==="directory"?"folder":"file"}`}}}f($,"getNodeIcon");W([{name:b.prefix,icons:b}]);var V=14,fe=4,ge=16,ue=f(async(r,t)=>{let e=[],n=f(i=>{let o=$(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(n)},"collect");n(r);let s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await X(i,{height:V,width:V})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),me=f((r,t,e,n,s,i)=>{let o=n.append("g"),a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);let p=V+fe,c=$(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${r+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");let h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:m}=h.node().getBBox(),g=l+s.paddingY*2,w=r+s.paddingX+(d?p:0);h.attr("x",w),h.attr("y",t+g/2);let u=w+m,v=m+s.paddingX*2+(d?p:0);return e.BBox={x:r,y:t,width:v,height:g},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",r).attr("y",t+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+g/2}},"positionLabel"),Z=f((r,t,e,n,s,i)=>r.append("line").attr("x1",t).attr("y1",e).attr("x2",n).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),we=f((r,t,e,n)=>{let s=0,i=0,o=[],a=f((d,h,l,m)=>{let g=m*(l.rowIndent+l.paddingX),w=me(g,s,h,d,l,n);o.push(w);let{height:u,width:v}=h.BBox;Z(d,g-l.rowIndent,s+u/2,g,s+u/2,l.lineThickness),i=Math.max(i,g+v),s+=u},"drawNode"),p=f((d,h=0)=>{a(r,d,e,h),d.children.forEach(w=>{p(w,h+1)});let{x:l,y:m,height:g}=d.BBox;if(d.children.length){let{y:w,height:u}=d.children[d.children.length-1].BBox;Z(r,l+e.paddingX,m+g,l+e.paddingX,w+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);let c=o.filter(d=>d.node.description);if(c.length>0){let h=Math.max(...o.map(l=>l.labelRightEdge))+ge;for(let l of c){let g=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+g.width+e.paddingX)}}for(let d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){let h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){let l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=f(async(r,t,e,n)=>{C.debug(`Rendering treeView diagram
|
|
4
|
+
`+r);let s=n.db,i=s.getRoot(),o=s.getConfig(),a=H(t),p=a.append("g");p.attr("class","tree-view");let c=await ue(i,o),{totalHeight:d,totalWidth:h}=we(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),A(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ce={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ie=f(({treeView:r})=>{let{labelFontSize:t,labelColor:e,lineColor:n,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=y(Ce,r);return`
|
|
5
|
+
.treeView-node-label {
|
|
6
|
+
font-size: ${t};
|
|
7
|
+
fill: ${e};
|
|
8
|
+
white-space: pre;
|
|
9
|
+
}
|
|
10
|
+
.treeView-node-dir {
|
|
11
|
+
font-weight: bold;
|
|
12
|
+
}
|
|
13
|
+
.treeView-node-line {
|
|
14
|
+
stroke: ${n};
|
|
15
|
+
}
|
|
16
|
+
.treeView-node-icon {
|
|
17
|
+
color: ${s};
|
|
18
|
+
}
|
|
19
|
+
.treeView-node-description {
|
|
20
|
+
font-size: ${t};
|
|
21
|
+
fill: ${i};
|
|
22
|
+
font-style: italic;
|
|
23
|
+
white-space: pre;
|
|
24
|
+
}
|
|
25
|
+
.treeView-highlight-bg {
|
|
26
|
+
fill: ${o};
|
|
27
|
+
stroke: ${a};
|
|
28
|
+
stroke-width: 1;
|
|
29
|
+
}
|
|
30
|
+
`},"styles"),ye=Ie,De={db:B,renderer:be,parser:pe,styles:ye};export{De as diagram};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import{a as F}from"./chunk-J4SQIVOP.js";import{a as D}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import{a as E}from"./chunk-WVYKIHVG.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import"./chunk-FK4OKHO7.js";import{o as y}from"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{O as L,T,U as S,V as k,W as O,X as R,Y as I,Z as _,i as A,k as M,u as b}from"./chunk-NLCJ5AKJ.js";import{b as C}from"./chunk-3CEAP2V5.js";import{a as i}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},w=32,P={axes:[],curves:[],options:x},g=structuredClone(P),U=M.radar,X=i(()=>y({...U,...b().radar}),"getConfig"),z=i(()=>g.axes,"getAxes"),K=i(()=>g.curves,"getCurves"),N=i(()=>g.options,"getOptions"),Y=i(a=>{g.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),Z=i(a=>{g.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:q(t.entries)}))},"setCurves"),q=i(a=>{if(a[0].axis==null)return a.map(e=>e.value);let t=z();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{let r=a.find(n=>n.axis?.$refText===e.name);if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),J=i(a=>{let t=a.reduce((e,r)=>(e[r.name]=r,e),{});g.options={showLegend:t.showLegend?.value??x.showLegend,ticks:t.ticks?.value??x.ticks,max:t.max?.value??x.max,min:t.min?.value??x.min,graticule:t.graticule?.value??x.graticule},g.options.ticks>w&&(C.warn(`Radar diagram ticks (${g.options.ticks}) exceeds maximum allowed (${w}). Using ${w} instead.`),g.options.ticks=w)},"setOptions"),Q=i(()=>{T(),g=structuredClone(P)},"clear"),$={getAxes:z,getCurves:K,getOptions:N,setAxes:Y,setCurves:Z,setOptions:J,getConfig:X,clear:Q,setAccTitle:S,getAccTitle:k,setDiagramTitle:I,getDiagramTitle:_,getAccDescription:R,setAccDescription:O},tt=i(a=>{F(a,$);let{axes:t,curves:e,options:r}=a;$.setAxes(t),$.setCurves(e),$.setOptions(r)},"populate"),et={parse:i(async a=>{let t=await D("radar",a);C.debug(t),tt(t)},"parse")},at=i((a,t,e,r)=>{let n=r.db,l=n.getAxes(),c=n.getCurves(),s=n.getOptions(),o=n.getConfig(),d=n.getDiagramTitle(),p=E(t),u=rt(p,o),m=s.max??Math.max(...c.map(f=>Math.max(...f.entries))),h=s.min,v=Math.min(o.width,o.height)/2;nt(u,l,v,s.ticks,s.graticule),st(u,l,v,o),G(u,l,c,h,m,s.graticule,o),V(u,c,s.showLegend,o),u.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-o.height/2-o.marginTop)},"draw"),rt=i((a,t)=>{let e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,n={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return L(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`).attr("overflow","visible"),a.append("g").attr("transform",`translate(${n.x}, ${n.y})`)},"drawFrame"),nt=i((a,t,e,r,n)=>{if(n==="circle")for(let l=0;l<r;l++){let c=e*(l+1)/r;a.append("circle").attr("r",c).attr("class","radarGraticule")}else if(n==="polygon"){let l=t.length;for(let c=0;c<r;c++){let s=e*(c+1)/r,o=t.map((d,p)=>{let u=2*p*Math.PI/l-Math.PI/2,m=s*Math.cos(u),h=s*Math.sin(u);return`${m},${h}`}).join(" ");a.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),st=i((a,t,e,r)=>{let n=t.length;for(let l=0;l<n;l++){let c=t[l].label,s=2*l*Math.PI/n-Math.PI/2,o=Math.cos(s),d=Math.sin(s);a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*o).attr("y2",e*r.axisScaleFactor*d).attr("class","radarAxisLine");let p=o>.01?"start":o<-.01?"end":"middle",u=d>.01?"hanging":d<-.01?"auto":"central",m=4;a.append("text").text(c).attr("x",e*r.axisLabelFactor*o+m*o).attr("y",e*r.axisLabelFactor*d+m*d).attr("text-anchor",p).attr("dominant-baseline",u).attr("class","radarAxisLabel")}},"drawAxes");function G(a,t,e,r,n,l,c){let s=t.length,o=Math.min(c.width,c.height)/2;e.forEach((d,p)=>{if(d.entries.length!==s)return;let u=d.entries.map((m,h)=>{let v=2*Math.PI*h/s-Math.PI/2,f=B(m,r,n,o),H=f*Math.cos(v),j=f*Math.sin(v);return{x:H,y:j}});l==="circle"?a.append("path").attr("d",W(u,c.curveTension)).attr("class",`radarCurve-${p}`):l==="polygon"&&a.append("polygon").attr("points",u.map(m=>`${m.x},${m.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}i(G,"drawCurves");function B(a,t,e,r){let n=Math.min(Math.max(a,t),e);return r*(n-t)/(e-t)}i(B,"relativeRadius");function W(a,t){let e=a.length,r=`M${a[0].x},${a[0].y}`;for(let n=0;n<e;n++){let l=a[(n-1+e)%e],c=a[n],s=a[(n+1)%e],o=a[(n+2)%e],d={x:c.x+(s.x-l.x)*t,y:c.y+(s.y-l.y)*t},p={x:s.x-(o.x-c.x)*t,y:s.y-(o.y-c.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${s.x},${s.y}`}return`${r} Z`}i(W,"closedRoundCurve");function V(a,t,e,r){if(!e)return;let n=(r.width/2+r.marginRight)*3/4,l=-(r.height/2+r.marginTop)*3/4,c=20;t.forEach((s,o)=>{let d=a.append("g").attr("transform",`translate(${n}, ${l+o*c})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${o}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}i(V,"drawLegend");var ot={draw:at},it=i((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){let n=a[`cScale${r}`];e+=`
|
|
2
|
+
.radarCurve-${r} {
|
|
3
|
+
color: ${n};
|
|
4
|
+
fill: ${n};
|
|
5
|
+
fill-opacity: ${t.curveOpacity};
|
|
6
|
+
stroke: ${n};
|
|
7
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
+
}
|
|
9
|
+
.radarLegendBox-${r} {
|
|
10
|
+
fill: ${n};
|
|
11
|
+
fill-opacity: ${t.curveOpacity};
|
|
12
|
+
stroke: ${n};
|
|
13
|
+
}
|
|
14
|
+
`}return e},"genIndexStyles"),lt=i(a=>{let t=A(),e=b(),r=y(t,e.themeVariables),n=y(r.radar,a);return{themeVariables:r,radarOptions:n}},"buildRadarStyleOptions"),ct=i(({radar:a}={})=>{let{themeVariables:t,radarOptions:e}=lt(a);return`
|
|
15
|
+
.radarTitle {
|
|
16
|
+
font-size: ${t.fontSize};
|
|
17
|
+
color: ${t.titleColor};
|
|
18
|
+
dominant-baseline: hanging;
|
|
19
|
+
text-anchor: middle;
|
|
20
|
+
}
|
|
21
|
+
.radarAxisLine {
|
|
22
|
+
stroke: ${e.axisColor};
|
|
23
|
+
stroke-width: ${e.axisStrokeWidth};
|
|
24
|
+
}
|
|
25
|
+
.radarAxisLabel {
|
|
26
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
27
|
+
color: ${e.axisColor};
|
|
28
|
+
}
|
|
29
|
+
.radarGraticule {
|
|
30
|
+
fill: ${e.graticuleColor};
|
|
31
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
32
|
+
stroke: ${e.graticuleColor};
|
|
33
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
34
|
+
}
|
|
35
|
+
.radarLegendText {
|
|
36
|
+
text-anchor: start;
|
|
37
|
+
font-size: ${e.legendFontSize}px;
|
|
38
|
+
dominant-baseline: hanging;
|
|
39
|
+
}
|
|
40
|
+
${it(t,e)}
|
|
41
|
+
`},"styles"),vt={parser:et,db:$,renderer:ot,styles:ct};export{vt as diagram};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as V}from"./chunk-J4SQIVOP.js";import{a as j}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import{f as X}from"./chunk-FK4OKHO7.js";import{i as w,l as G,o as L}from"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{H as v,T as D,U as N,V as C,W as O,X as I,Y as W,Z as H,_ as M,ca as U,k as $,u as b}from"./chunk-NLCJ5AKJ.js";import{b as f,h as _}from"./chunk-3CEAP2V5.js";import{a as o}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var Y="position frame",z="frame positioned",k="position relation",K="relation positioned",we=o(function(e){f.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){q(),D()},"clear");function q(){E={}}o(q,"reset");var Se=$.eventmodeling,Me=o(()=>L({...Se,...b().eventmodeling}),"getConfig"),E={};function J(){let e=ke,{ast:n}=E,t=A();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,r)=>{let a=re(i,n.dataEntities,t);e=P(e,{$kind:Y,index:r,frame:i,textProps:a});let d;ce(i)?(f.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=P(e,{$kind:k,index:r,frame:i,sourceFrame:l})})):e=P(e,{$kind:k,index:r,frame:i})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}o(J,"getState");function Q(e){E.ast=e}o(Q,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function A(){return s}o(A,"getDiagramProps");var ke={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function Z(e){let n=e.split(".");if(n.length===2)return n[0]}o(Z,"extractNamespace");function ee(e){let n=e.split(".");return n.length===2?n[1]:e}o(ee,"extractName");function te(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(te,"findSwimlaneByNamespace");function y(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{let r=Number.parseInt(i);return r>n&&r<t}).map(i=>Number.parseInt(i)))+1}o(y,"findNextAvailableIndex");function ne(e,n){let t=Z(e.entityIdentifier),i=te(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:y(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:y(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:y(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(ne,"calculateSwimlaneProps");function ie(e){let{themeVariables:n}=b();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(ie,"calculateEntityVisualProps");function re(e,n,t){let i=b(),r=v(ee(e.entityIdentifier)??"",i),a,d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"},c=`<b>${w(r,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(a=e.dataInlineValue,a=a.substring(a.indexOf("{")+1),a=a.substring(0,a.lastIndexOf("}")-1),a=v(a,i),a=w(a,t.textMaxWidth,d),a=a.replaceAll(" "," ")),e.dataReference){let p=n.find(S=>S.name===e.dataReference?.$refText);p&&(a=p.dataBlockValue,a=a.substring(a.indexOf(`{
|
|
2
|
+
`)+2),a=a.substring(0,a.lastIndexOf("}")-1),a=v(a,i),a=w(a,t.textMaxWidth,d),a=a.replaceAll(" "," "),a+="<br/>")}let m=a!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${a}</code>`);let x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=G(c,x),h=m?u.width/3:u.width,g={content:c,width:h,height:u.height};return f.debug(`[${e.name}] ${e.entityIdentifier} text`,g),g}o(re,"calculateTextProps");function ae(e,n){let t=n,i=ie(t.frame),r={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:z,frame:t.frame,index:t.index,visual:i,dimension:r,textProps:t.textProps}]}o(ae,"decidePositionFrame");function oe(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(oe,"calculateX");function se(e,n){let t=[...e.map(i=>i.r),n];return Math.max(...t)}o(se,"calculateMaxRight");function R(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(R,"sortedSwimlanesArray");function de(e,n){let t=n,i=ne(t.frame,e.swimlanes),r;i.index in e.swimlanes?r=e.swimlanes[i.index]:r={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=oe(r,d,a),m=c+l.width+s.boxPadding,x=se(Object.values(e.swimlanes),m);r.r=c+l.width,r.maxHeight=Math.max(r.maxHeight,l.height),r.height=Math.max(s.swimlaneMinHeight,r.maxHeight)+2*s.swimlanePadding;let u={x:c,y:s.swimlanePadding+r.y,r:m,dimension:l,leftSibling:!1,swimlane:r,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${r.index}`]:r},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},g=R(h.swimlanes);g.length>0&&(g[0].y=0);for(let p=1;p<g.length;p++){let S=g[p],T=g[p-1];S.y=T.y+T.height+s.swimlaneGap}return h}o(de,"evolveFramePositioned");function le(e,n){return e===0&&n.sourceFrames.length===0}o(le,"isFirstFrame");function ce(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(ce,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function me(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){let r=e[i];if(r.swimlane.index!==n)return r}}o(me,"findBoxByLineIndex");function ue(e,n){let t=n;if(X(t.frame)||le(t.index,t.frame))return[];let i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let r;return t.sourceFrame?r=F(e.boxes,t.sourceFrame):r=me(e.boxes,i.swimlane.index,t.index-1),r===void 0?[]:[{$kind:K,frame:t.frame,index:t.index,sourceBox:r,targetBox:i}]}o(ue,"decidePositionRelation");function xe(e,n){let t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(xe,"evolveRelationPositioned");var Fe={[Y]:ae,[k]:ue},Be={[z]:de,[K]:xe};function fe(e,n){let t=Fe[n.$kind];if(t==null)return[];let i=t(e,n);return f.debug("decided events",i),i}o(fe,"decide");function ge(e,n){let t=n.reduce((i,r)=>{let a=Be[r.$kind];return a==null?i:a(i,r)},e);return f.debug("evolve events",{state:e,newState:t,events:n}),t}o(ge,"evolve");function P(e,n){let t=fe(e,n);return ge(e,t)}o(P,"dispatch");var B={getConfig:Me,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:N,getAccTitle:C,getAccDescription:I,setAccDescription:O,setDiagramTitle:W,getDiagramTitle:H,setAst:Q,getDiagramProps:A,getState:J},Ee={parse:o(async e=>{let n=await j("eventmodeling",e);f.debug(n),B.setAst(n),V(n,B)},"parse")},Ae=M(),Re=Ae?.eventmodeling;function he(e,n){return t=>{let i=t.swimlane.y+n.swimlanePadding,r=e.append("g").attr("class","em-box");r.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),r.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(he,"renderD3Box");function pe(e,n){return e>n}o(pe,"dirUpwards");function be(e,n,t,i){return r=>{let a=r.sourceBox.swimlane.y+n.swimlanePadding,d=r.targetBox.swimlane.y+n.swimlanePadding,l=pe(a,d),c=r.sourceBox.x+r.sourceBox.dimension.width*2/3,m=r.targetBox.x+r.targetBox.dimension.width/3,x,u;f.debug(`rendering relation up=${l} for `,{sourceBox:r.sourceBox,targetBox:r.targetBox}),l?(x=a,u=d+r.targetBox.dimension.height):(x=a+r.sourceBox.dimension.height,u=d);let h=i.emRelationStroke??r.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",r.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(be,"renderD3Relation");function ve(e,n,t,i){return r=>{let a=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";a.append("rect").attr("x",0).attr("y",r.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",r.height).attr("fill",d).attr("stroke",l),a.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",r.y+30).text(r.label)}}o(ve,"renderD3Swimlane");var Te=o(function(e,n,t,i){if(f.debug("in eventmodeling renderer",e+`
|
|
3
|
+
`,"id:",n,t),!Re)throw new Error("EventModeling config not found");let r=i.db,{themeVariables:a,eventmodeling:d}=M(),l=_(`[id="${n}"]`),c=r.getDiagramProps(),m=r.getState(),x=`em-arrowhead-${n}`,u=a.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ve(l,m.maxR,c,a)),m.boxes.forEach(he(l,c)),m.relations.forEach(be(l,c,x,a)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),U(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),$e={draw:Te},De=o(e=>"","getStyles"),Ne=De,Le={parser:Ee,db:B,renderer:$e,styles:Ne};export{Le as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as ue}from"./chunk-J4SQIVOP.js";import{a as ye}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import{a as he}from"./chunk-WVYKIHVG.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import"./chunk-FK4OKHO7.js";import{a as fe}from"./chunk-TGYBLZFN.js";import{c as me,d as $}from"./chunk-XCMS6RVA.js";import{o as I}from"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{O as ae,T as le,U as se,V as re,W as ne,X as oe,Y as ie,Z as ce,i as ee,k as te,u as R}from"./chunk-NLCJ5AKJ.js";import{b as H,h as V,j as N,k as pe,l as de,m as B}from"./chunk-3CEAP2V5.js";import{a as h}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var ge=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=se,this.getAccTitle=re,this.setDiagramTitle=ie,this.getDiagramTitle=ce,this.getAccDescription=oe,this.setAccDescription=ne}static{h(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){let r=te,s=R();return I({...r.treemap,...s.treemap??{}})}addNode(r,s){this.nodes.push(r),this.levels.set(r,s),s===0&&(this.outerNodes.push(r),this.root??=r)}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,s){let i=this.classes.get(r)??{id:r,styles:[],textStyles:[]},c=s.replace(/\\,/g,"\xA7\xA7\xA7").replace(/,/g,";").replace(/§§§/g,",").split(";");c&&c.forEach(l=>{me(l)&&(i?.textStyles?i.textStyles.push(l):i.textStyles=[l]),i?.styles?i.styles.push(l):i.styles=[l]}),this.classes.set(r,i)}getClasses(){return this.classes}getStylesForClass(r){return this.classes.get(r)?.styles??[]}clear(){le(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function Se(r){if(!r.length)return[];let s=[],i=[];return r.forEach(c=>{let l={name:c.name,children:c.type==="Leaf"?void 0:[]};for(l.classSelector=c?.classSelector,c?.cssCompiledStyles&&(l.cssCompiledStyles=c.cssCompiledStyles),c.type==="Leaf"&&c.value!==void 0&&(l.value=c.value);i.length>0&&i[i.length-1].level>=c.level;)i.pop();if(i.length===0)s.push(l);else{let n=i[i.length-1].node;n.children?n.children.push(l):n.children=[l]}c.type!=="Leaf"&&i.push({node:l,level:c.level})}),s}h(Se,"buildHierarchy");var Fe=h((r,s)=>{ue(r,s);let i=[];for(let n of r.TreemapRows??[])n.$type==="ClassDefStatement"&&s.addClass(n.className??"",n.styleText??"");for(let n of r.TreemapRows??[]){let d=n.item;if(!d)continue;let m=n.indent?parseInt(n.indent):0,k=Ne(d),a=d.classSelector?s.getStylesForClass(d.classSelector):[],A=a.length>0?a:void 0,b={level:m,name:k,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:A};i.push(b)}let c=Se(i),l=h((n,d)=>{for(let m of n)s.addNode(m,d),m.children&&m.children.length>0&&l(m.children,d+1)},"addNodesRecursively");l(c,0)},"populate"),Ne=h(r=>r.name?String(r.name):"","getItemName"),xe={parser:{yy:void 0},parse:h(async r=>{try{let i=await ye("treemap",r);H.debug("Treemap AST:",i);let c=xe.parser?.yy;if(!(c instanceof ge))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Fe(i,c)}catch(s){throw H.error("Error parsing treemap:",s),s}},"parse")},ze=10,z=10,M=25,Ae=h((r,s,i,c)=>{let l=c.db,n=l.getConfig(),d=n.padding??ze,m=l.getDiagramTitle(),k=l.getRoot(),{themeVariables:a}=R();if(!k)return;let A=m?30:0,b=he(s),Y=n.nodeWidth?n.nodeWidth*z:960,j=n.nodeHeight?n.nodeHeight*z:500,O=Y,U=j+A;b.attr("viewBox",`0 0 ${O} ${U}`),ae(b,U,O,n.useMaxWidth);let v;try{let e=n.valueFormat||",";if(e==="$0,0")v=h(t=>"$"+N(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),o=t?t[0]:"";v=h(f=>"$"+N(","+o)(f),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);v=h(o=>"$"+N(t||"")(o),"valueFormat")}else v=N(e)}catch(e){H.error("Error creating format function:",e),v=N(",")}let P=B().range(["transparent",a.cScale0,a.cScale1,a.cScale2,a.cScale3,a.cScale4,a.cScale5,a.cScale6,a.cScale7,a.cScale8,a.cScale9,a.cScale10,a.cScale11]),be=B().range(["transparent",a.cScalePeer0,a.cScalePeer1,a.cScalePeer2,a.cScalePeer3,a.cScalePeer4,a.cScalePeer5,a.cScalePeer6,a.cScalePeer7,a.cScalePeer8,a.cScalePeer9,a.cScalePeer10,a.cScalePeer11]),W=B().range([a.cScaleLabel0,a.cScaleLabel1,a.cScaleLabel2,a.cScaleLabel3,a.cScaleLabel4,a.cScaleLabel5,a.cScaleLabel6,a.cScaleLabel7,a.cScaleLabel8,a.cScaleLabel9,a.cScaleLabel10,a.cScaleLabel11]);m&&b.append("text").attr("x",O/2).attr("y",A/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(m);let q=b.append("g").attr("transform",`translate(0, ${A})`).attr("class","treemapContainer"),ve=pe(k).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),J=de().size([Y,j]).paddingTop(e=>e.children&&e.children.length>0?M+z:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?z:0).paddingRight(e=>e.children&&e.children.length>0?z:0).paddingBottom(e=>e.children&&e.children.length>0?z:0).round(!0)(ve),Ce=J.descendants().filter(e=>e.children&&e.children.length>0),D=q.selectAll(".treemapSection").data(Ce).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",M).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),D.append("clipPath").attr("id",(e,t)=>`clip-section-${s}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",M),D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>P(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>be(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";let t=$({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),D.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",M/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,t)=>`url(#clip-section-${s}-${t})`).attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=V(this),o=e.data.name;t.text(o);let f=e.x1-e.x0,y=6,u;n.showValues!==!1&&e.value?u=f-10-30-10-y:u=f-y-6;let p=Math.max(15,u),w=t.node();if(w.getComputedTextLength()>p){let T=o;for(;T.length>0;){if(T=o.substring(0,T.length-1),T.length===0){t.text("..."),w.getComputedTextLength()>p&&t.text("");break}if(t.text(T+"..."),w.getComputedTextLength()<=p)break}}}),n.showValues!==!1&&D.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",M/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?v(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";let t="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+W(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")});let K=J.leaves(),S=K.length>20,we=S?16:38,E=S?14:28,L=S?4:8,F=S?4:6,G=S?2:4,Q=S?8:10,X=S?1:2,_=q.selectAll(".treemapLeafGroup").data(K).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);_.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("style",e=>$({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?P(e.parent.data.name):P(e.data.name)).attr("stroke-width",3),_.append("clipPath").attr("id",(e,t)=>`clip-${s}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),_.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{let t=`text-anchor: middle; dominant-baseline: middle; font-size: ${we}px;fill:`+W(e.data.name)+";",o=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+o.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${s}-${t})`).text(e=>e.data.name).each(function(e){let t=V(this),o=e.x1-e.x0,f=e.y1-e.y0,y=t.node(),u=o-2*G,C=f-2*G;if(u<Q||C<Q){t.style("display","none");return}let p=parseInt(t.style("font-size"),10),w=.6;for(;y.getComputedTextLength()>u&&p>L;)p--,t.style("font-size",`${p}px`);let g=Math.max(F,Math.min(E,Math.round(p*w))),x=p+X+g;for(;x>C&&p>L&&(p--,g=Math.max(F,Math.min(E,Math.round(p*w))),!(g<F&&p===L));)t.style("font-size",`${p}px`),x=p+X+g,g<=F&&x>C;t.style("font-size",`${p}px`),S?(p<L||C<L)&&t.style("display","none"):(y.getComputedTextLength()>u||p<L||C<p)&&t.style("display","none")}),n.showValues!==!1&&_.append("text").attr("class","treemapValue").attr("x",t=>(t.x1-t.x0)/2).attr("y",function(t){return(t.y1-t.y0)/2}).attr("style",t=>{let o=`text-anchor: middle; dominant-baseline: hanging; font-size: ${E}px;fill:`+W(t.data.name)+";",f=$({cssCompiledStyles:t.data.cssCompiledStyles});return o+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(t,o)=>`url(#clip-${s}-${o})`).text(t=>t.value?v(t.value):"").each(function(t){let o=V(this),f=this.parentNode;if(!f){o.style("display","none");return}let y=V(f).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){o.style("display","none");return}let u=parseFloat(y.style("font-size")),p=Math.max(F,Math.min(E,Math.round(u*.6)));o.style("font-size",`${p}px`);let g=(t.y1-t.y0)/2+u/2+X;o.attr("y",g);let x=t.x1-t.x0,Z=t.y1-t.y0-4,Le=x-2*G;o.node().getComputedTextLength()>Le||g+p>Z||p<F?o.style("display","none"):o.style("display",null)});let Te=n.diagramPadding??8;fe(b,Te,"flowchart",n?.useMaxWidth||!1)},"draw"),Pe=h(function(r,s){return s.db.getClasses()},"getClasses"),De={draw:Ae,getClasses:Pe},Ve={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},Me=h(({treemap:r}={})=>{let s=ee(),i=R(),c=I(s,i.themeVariables),l=I(Ve,r),n=l.titleColor??c.titleColor,d=l.labelColor??c.textColor,m=l.valueColor??c.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${l.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${l.sectionStrokeWidth};
|
|
5
|
+
fill: ${l.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${l.leafStrokeColor};
|
|
9
|
+
stroke-width: ${l.leafStrokeWidth};
|
|
10
|
+
fill: ${l.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${d};
|
|
14
|
+
font-size: ${l.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${m};
|
|
18
|
+
font-size: ${l.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${n};
|
|
22
|
+
font-size: ${l.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),ke=Me,Ue={parser:xe,get db(){return new ge},renderer:De,styles:ke};export{Ue as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as z}from"./chunk-J4SQIVOP.js";import{a as E}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import{a as P}from"./chunk-WVYKIHVG.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import"./chunk-FK4OKHO7.js";import{o as u}from"./chunk-JAORNH2M.js";import"./chunk-JBQZ5UCE.js";import{O as x,T as y,U as $,V as B,W as C,X as S,Y as D,Z as T,k as w,u as v}from"./chunk-NLCJ5AKJ.js";import{b}from"./chunk-3CEAP2V5.js";import{a as h}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var N=w.packet,F=class{constructor(){this.packet=[],this.setAccTitle=$,this.getAccTitle=B,this.setDiagramTitle=D,this.getDiagramTitle=T,this.getAccDescription=S,this.setAccDescription=C}static{h(this,"PacketDB")}getConfig(){let t=u({...N,...v().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){y(),this.packet=[]}},L=1e4,M=h((t,e)=>{z(t,e);let a=-1,o=[],n=1,{bitsPerRow:l}=e.getConfig();for(let{start:r,end:s,bits:d,label:c}of t.blocks){if(r!==void 0&&s!==void 0&&s<r)throw new Error(`Packet block ${r} - ${s} is invalid. End must be greater than start.`);if(r??=a+1,r!==a+1)throw new Error(`Packet block ${r} - ${s??r} is not contiguous. It should start from ${a+1}.`);if(d===0)throw new Error(`Packet block ${r} is invalid. Cannot have a zero bit field.`);for(s??=r+(d??1)-1,d??=s-r+1,a=s,b.debug(`Packet block ${r} - ${a} with label ${c}`);o.length<=l+1&&e.getPacket().length<L;){let[p,i]=Y({start:r,end:s,bits:d,label:c},n,l);if(o.push(p),p.end+1===n*l&&(e.pushWord(o),o=[],n++),!i)break;({start:r,end:s,bits:d,label:c}=i)}}e.pushWord(o)},"populate"),Y=h((t,e,a)=>{if(t.start===void 0)throw new Error("start should have been set during first phase");if(t.end===void 0)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*a)return[t,void 0];let o=e*a-1,n=e*a;return[{start:t.start,end:o,label:t.label,bits:o-t.start},{start:n,end:t.end,label:t.label,bits:t.end-n}]},"getNextFittingBlock"),A={parser:{yy:void 0},parse:h(async t=>{let e=await E("packet",t),a=A.parser?.yy;if(!(a instanceof F))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");b.debug(e),M(e,a)},"parse")},I=h((t,e,a,o)=>{let n=o.db,l=n.getConfig(),{rowHeight:r,paddingY:s,bitWidth:d,bitsPerRow:c}=l,p=n.getPacket(),i=n.getDiagramTitle(),f=r+s,g=f*(p.length+1)-(i?0:r),k=d*c+2,m=P(e);m.attr("viewBox",`0 0 ${k} ${g}`),x(m,g,k,l.useMaxWidth);for(let[W,_]of p.entries())O(m,_,W,l);m.append("text").text(i).attr("x",k/2).attr("y",g-f/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),O=h((t,e,a,{rowHeight:o,paddingX:n,paddingY:l,bitWidth:r,bitsPerRow:s,showBits:d})=>{let c=t.append("g"),p=a*(o+l)+l;for(let i of e){let f=i.start%s*r+1,g=(i.end-i.start+1)*r-n;if(c.append("rect").attr("x",f).attr("y",p).attr("width",g).attr("height",o).attr("class","packetBlock"),c.append("text").attr("x",f+g/2).attr("y",p+o/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(i.label),!d)continue;let k=i.end===i.start,m=p-2;c.append("text").attr("x",f+(k?g/2:0)).attr("y",m).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(i.start),k||c.append("text").attr("x",f+g).attr("y",m).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(i.end)}},"drawWord"),j={draw:I},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},H=h(({packet:t}={})=>{let e=u(G,t);return`
|
|
2
|
+
.packetByte {
|
|
3
|
+
font-size: ${e.byteFontSize};
|
|
4
|
+
}
|
|
5
|
+
.packetByte.start {
|
|
6
|
+
fill: ${e.startByteColor};
|
|
7
|
+
}
|
|
8
|
+
.packetByte.end {
|
|
9
|
+
fill: ${e.endByteColor};
|
|
10
|
+
}
|
|
11
|
+
.packetLabel {
|
|
12
|
+
fill: ${e.labelColor};
|
|
13
|
+
font-size: ${e.labelFontSize};
|
|
14
|
+
}
|
|
15
|
+
.packetTitle {
|
|
16
|
+
fill: ${e.titleColor};
|
|
17
|
+
font-size: ${e.titleFontSize};
|
|
18
|
+
}
|
|
19
|
+
.packetBlock {
|
|
20
|
+
stroke: ${e.blockStrokeColor};
|
|
21
|
+
stroke-width: ${e.blockStrokeWidth};
|
|
22
|
+
fill: ${e.blockFillColor};
|
|
23
|
+
}
|
|
24
|
+
`},"styles"),V={parser:A,get db(){return new F},renderer:j,styles:H};export{V as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,b as p,c as f}from"./chunk-4PRM3W7S.js";import{a as i}from"./chunk-J4SQIVOP.js";import{b as l}from"./chunk-MNHOAW4R.js";import"./chunk-ZMBQGVIF.js";import"./chunk-WVYKIHVG.js";import"./chunk-5DJUZA4F.js";import"./chunk-YICKNY6Y.js";import"./chunk-R7CM4BQN.js";import{b as m}from"./chunk-SNGMH3JW.js";import"./chunk-EXFMYL6U.js";import"./chunk-WSHCWW4Q.js";import"./chunk-ZNREFWKG.js";import"./chunk-FZLE27CN.js";import"./chunk-CD5RYVNW.js";import"./chunk-JFI5BOLY.js";import"./chunk-IRNO36C3.js";import"./chunk-43RBMH4Y.js";import"./chunk-K2JFJOPP.js";import"./chunk-CCQNES6G.js";import"./chunk-FK4OKHO7.js";import"./chunk-NLCJ5AKJ.js";import{b as o}from"./chunk-3CEAP2V5.js";import{a as t}from"./chunk-6LQNQPBM.js";import"./chunk-OOJM4CTU.js";var c=m().RailroadEbnf.parser.LangiumParser,s=t(e=>{let r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{let r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),u=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},u(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),u(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{i(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),P={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");let r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new l(r);let a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},$={parser:P,db:n,renderer:f,styles:p};export{$ as diagram};
|