@codragraph/cli 2.1.0 → 2.1.4
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/README.md +62 -21
- package/dist/_shared/cgdb/schema-constants.d.ts +2 -2
- package/dist/_shared/cgdb/schema-constants.d.ts.map +1 -1
- package/dist/_shared/cgdb/schema-constants.js +3 -0
- package/dist/_shared/cgdb/schema-constants.js.map +1 -1
- package/dist/_shared/feature-clusters.d.ts +99 -0
- package/dist/_shared/feature-clusters.d.ts.map +1 -0
- package/dist/_shared/feature-clusters.js +2 -0
- package/dist/_shared/feature-clusters.js.map +1 -0
- package/dist/_shared/graph/types.d.ts +16 -2
- package/dist/_shared/graph/types.d.ts.map +1 -1
- package/dist/_shared/index.d.ts +1 -0
- package/dist/_shared/index.d.ts.map +1 -1
- package/dist/_shared/index.js.map +1 -1
- package/dist/_shared/pipeline.d.ts +1 -1
- package/dist/_shared/pipeline.d.ts.map +1 -1
- package/dist/cli/ai-context.js +4 -0
- package/dist/cli/analyze.js +46 -26
- package/dist/cli/index.js +39 -1
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +3 -1
- package/dist/cli/setup.js +42 -21
- package/dist/cli/status.d.ts +13 -0
- package/dist/cli/status.js +99 -0
- package/dist/cli/tool.d.ts +25 -0
- package/dist/cli/tool.js +74 -0
- package/dist/config/ignore-service.js +2 -0
- package/dist/config/supported-languages.d.ts +3 -3
- package/dist/config/supported-languages.js +3 -3
- package/dist/core/cgdb/cgdb-adapter.js +19 -3
- package/dist/core/cgdb/csv-generator.js +33 -2
- package/dist/core/cgdb/schema.d.ts +2 -1
- package/dist/core/cgdb/schema.js +55 -0
- package/dist/core/embeddings/embedder.js +4 -2
- package/dist/core/graphstore/cgdb-row-source.js +3 -2
- package/dist/core/graphstore/index.d.ts +1 -1
- package/dist/core/graphstore/index.js +1 -1
- package/dist/core/group/bridge-db.js +42 -10
- package/dist/core/group/service.d.ts +16 -0
- package/dist/core/group/service.js +360 -0
- package/dist/core/ingestion/emit-references.d.ts +1 -1
- package/dist/core/ingestion/emit-references.js +1 -1
- package/dist/core/ingestion/feature-cluster-processor.d.ts +62 -0
- package/dist/core/ingestion/feature-cluster-processor.js +626 -0
- package/dist/core/ingestion/finalize-orchestrator.js +1 -1
- package/dist/core/ingestion/model/registration-table.js +1 -0
- package/dist/core/ingestion/model/resolve.d.ts +2 -2
- package/dist/core/ingestion/model/resolve.js +3 -3
- package/dist/core/ingestion/model/semantic-model.d.ts +1 -1
- package/dist/core/ingestion/model/semantic-model.js +1 -1
- package/dist/core/ingestion/model/symbol-table.d.ts +1 -1
- package/dist/core/ingestion/model/symbol-table.js +1 -1
- package/dist/core/ingestion/pipeline-phases/feature-clusters.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/feature-clusters.js +88 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +1 -0
- package/dist/core/ingestion/pipeline-phases/index.js +1 -0
- package/dist/core/ingestion/pipeline.d.ts +4 -0
- package/dist/core/ingestion/pipeline.js +9 -5
- package/dist/core/run-analyze.d.ts +21 -0
- package/dist/core/run-analyze.js +213 -6
- package/dist/core/search/hybrid-search.js +11 -3
- package/dist/mcp/core/embedder.js +5 -2
- package/dist/mcp/local/local-backend.d.ts +12 -0
- package/dist/mcp/local/local-backend.js +381 -3
- package/dist/mcp/resources.js +139 -0
- package/dist/mcp/tools.js +174 -2
- package/dist/server/api.d.ts +14 -2
- package/dist/server/api.js +206 -7
- package/dist/server/mcp-http.d.ts +22 -0
- package/dist/server/mcp-http.js +21 -2
- package/dist/server/web-dashboard.d.ts +28 -0
- package/dist/server/web-dashboard.js +61 -0
- package/dist/storage/repo-manager.d.ts +6 -1
- package/dist/storage/repo-manager.js +5 -1
- package/dist/types/pipeline.d.ts +2 -0
- package/dist/web/assets/agent-D5lb0zXz.js +1089 -0
- package/dist/web/assets/architectureDiagram-EMZXCZ2Q-CZtc99v_.js +36 -0
- package/dist/web/assets/blockDiagram-IGV67L2C-BtoUp-6Y.js +132 -0
- package/dist/web/assets/c4Diagram-DFAF54RM-C4Hl3J2U.js +10 -0
- package/dist/web/assets/chunk-3GS5O3IE-DkUjU0WD.js +231 -0
- package/dist/web/assets/chunk-3YCYZ6SJ-CQkVgT_z.js +1 -0
- package/dist/web/assets/chunk-7RZVMHOQ-BitYcNVR.js +338 -0
- package/dist/web/assets/chunk-AEOMTBSW-BgTIXPsY.js +1 -0
- package/dist/web/assets/chunk-H3VCZNTA-Cx5XV_aC.js +13 -0
- package/dist/web/assets/chunk-HN6EAY2L-BBnyTNdB.js +1 -0
- package/dist/web/assets/chunk-KSICW3F5-BYzvDLNI.js +15 -0
- package/dist/web/assets/chunk-O5ABG6QK-dHwHzA6n.js +1 -0
- package/dist/web/assets/chunk-PK6DOVAG-CvsEnugt.js +206 -0
- package/dist/web/assets/chunk-RWUO3TPN-BgRTY0_k.js +1 -0
- package/dist/web/assets/chunk-TBF5ZNIQ-DL5stGM1.js +1 -0
- package/dist/web/assets/chunk-TU3PZOEN-RLyvLcv-.js +1 -0
- package/dist/web/assets/classDiagram-PPOCWD7C-DTr8QIOf.js +1 -0
- package/dist/web/assets/classDiagram-v2-23LJLIIU-DTr8QIOf.js +1 -0
- package/dist/web/assets/context-builder-22jU3V56.js +16 -0
- package/dist/web/assets/cose-bilkent-PNC4W37J-DVhePRYg.js +1 -0
- package/dist/web/assets/dagre-E77IOHMT-Dzx0A6ZU.js +4 -0
- package/dist/web/assets/diagram-H7BISOXX-CC9pRew1.js +43 -0
- package/dist/web/assets/diagram-JC5VWROH-Bau_i9tf.js +24 -0
- package/dist/web/assets/diagram-LXUTUG65-D9_FM2Gt.js +10 -0
- package/dist/web/assets/diagram-WEHSV5V5-BMlayouL.js +24 -0
- package/dist/web/assets/erDiagram-GCSMX5X6-C3dhDFA8.js +85 -0
- package/dist/web/assets/flowDiagram-OTCZ4VVT-CWSFWmhr.js +162 -0
- package/dist/web/assets/ganttDiagram-MUNLMDZQ-D3a67Yol.js +292 -0
- package/dist/web/assets/gitGraphDiagram-3HKGZ4G3-7jmry-vM.js +106 -0
- package/dist/web/assets/index-BgeqpYgd.js +1415 -0
- package/dist/web/assets/index-CT0GtFLZ.css +1 -0
- package/dist/web/assets/infoDiagram-MN7RKWGX-G7lhP0Ib.js +2 -0
- package/dist/web/assets/ishikawaDiagram-YMYX4NHK-DUoJvNP2.js +70 -0
- package/dist/web/assets/journeyDiagram-SO5T7YLQ-RMFPNNqz.js +139 -0
- package/dist/web/assets/kanban-definition-LJHFXRCJ-BzpDs1K9.js +89 -0
- package/dist/web/assets/katex-GD7MH7QM-DBQvrix-.js +261 -0
- package/dist/web/assets/mindmap-definition-2EUWGEK5-Bk0O4roa.js +96 -0
- package/dist/web/assets/pieDiagram-3IATQBI2-DKU7kpgS.js +30 -0
- package/dist/web/assets/quadrantDiagram-E256RVCF-BY0TGWCS.js +7 -0
- package/dist/web/assets/requirementDiagram-M5DCFWZL-DLHOVTSv.js +84 -0
- package/dist/web/assets/sankeyDiagram-L3NBLAOT-DVMj5rX2.js +10 -0
- package/dist/web/assets/sequenceDiagram-ZOUHS735-CJC73bV-.js +157 -0
- package/dist/web/assets/stateDiagram-MLPALWAM-BCFyESls.js +1 -0
- package/dist/web/assets/stateDiagram-v2-B5LQ5ZB2-DahzzIca.js +1 -0
- package/dist/web/assets/timeline-definition-5SPVSISX-TRSDRgPw.js +120 -0
- package/dist/web/assets/vennDiagram-IE5QUKF5-DNy7HRBM.js +34 -0
- package/dist/web/assets/wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js +161 -0
- package/dist/web/assets/wardleyDiagram-XU3VSMPF-BP-r1xzR.js +20 -0
- package/dist/web/assets/xychartDiagram-ZHJ5623Y-Dr9r7a35.js +7 -0
- package/dist/web/codragraph-logo-512.png +0 -0
- package/dist/web/codragraph-logo.png +0 -0
- package/dist/web/favicon.png +0 -0
- package/dist/web/index.html +36 -0
- package/hooks/claude/codragraph-hook.cjs +24 -9
- package/hooks/claude/pre-tool-use.sh +6 -1
- package/package.json +15 -4
- package/scripts/build.js +75 -16
- package/scripts/patch-tree-sitter-swift.cjs +0 -1
- package/skills/codragraph-cli.md +17 -1
- package/skills/codragraph-guide.md +6 -2
- package/skills/codragraph-onboarding.md +2 -2
- package/vendor/leiden/index.cjs +272 -285
- package/vendor/leiden/utils.cjs +264 -274
- package/dist/_shared/lbug/schema-constants.d.ts +0 -16
- package/dist/_shared/lbug/schema-constants.d.ts.map +0 -1
- package/dist/_shared/lbug/schema-constants.js +0 -67
- package/dist/_shared/lbug/schema-constants.js.map +0 -1
- package/dist/core/graphstore/lbug-row-source.d.ts +0 -19
- package/dist/core/graphstore/lbug-row-source.js +0 -141
- package/dist/core/lbug/content-read.d.ts +0 -46
- package/dist/core/lbug/content-read.js +0 -64
- package/dist/core/lbug/csv-generator.d.ts +0 -29
- package/dist/core/lbug/csv-generator.js +0 -492
- package/dist/core/lbug/lbug-adapter.d.ts +0 -176
- package/dist/core/lbug/lbug-adapter.js +0 -1320
- package/dist/core/lbug/pool-adapter.d.ts +0 -93
- package/dist/core/lbug/pool-adapter.js +0 -550
- package/dist/core/lbug/schema.d.ts +0 -62
- package/dist/core/lbug/schema.js +0 -502
- package/dist/mcp/core/lbug-adapter.d.ts +0 -5
- package/dist/mcp/core/lbug-adapter.js +0 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as $}from"./chunk-7RZVMHOQ-BitYcNVR.js";import{m as O,p as j,i as st,r as at,a6 as V}from"./index-BgeqpYgd.js";var Z=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L():typeof define=="function"&&define.amd?define([],L):typeof C=="object"?C.layoutBase=L():m.layoutBase=L()},"webpackUniversalModuleDefinition")(C,function(){return function(m){var L={};function N(i){if(L[i])return L[i].exports;var e=L[i]={i,l:!1,exports:{}};return m[i].call(e.exports,e,e.exports,N),e.l=!0,e.exports}return O(N,"__webpack_require__"),N.m=m,N.c=L,N.i=function(i){return i},N.d=function(i,e,t){N.o(i,e)||Object.defineProperty(i,e,{configurable:!1,enumerable:!0,get:t})},N.n=function(i){var e=i&&i.__esModule?O(function(){return i.default},"getDefault"):O(function(){return i},"getModuleExports");return N.d(e,"a",e),e},N.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},N.p="",N(N.s=26)}([function(m,L,N){function i(){}O(i,"LayoutConstants"),i.QUALITY=1,i.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,i.DEFAULT_INCREMENTAL=!1,i.DEFAULT_ANIMATION_ON_LAYOUT=!0,i.DEFAULT_ANIMATION_DURING_LAYOUT=!1,i.DEFAULT_ANIMATION_PERIOD=50,i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,i.DEFAULT_GRAPH_MARGIN=15,i.NODE_DIMENSIONS_INCLUDE_LABELS=!1,i.SIMPLE_NODE_SIZE=40,i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2,i.EMPTY_COMPOUND_NODE_SIZE=40,i.MIN_EDGE_LENGTH=1,i.WORLD_BOUNDARY=1e6,i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3,i.WORLD_CENTER_X=1200,i.WORLD_CENTER_Y=900,m.exports=i},function(m,L,N){var i=N(2),e=N(8),t=N(9);function r(a,o,p){i.call(this,p),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=p,this.bendpoints=[],this.source=a,this.target=o}O(r,"LEdge"),r.prototype=Object.create(i.prototype);for(var h in i)r[h]=i[h];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(a){if(this.source===a)return this.target;if(this.target===a)return this.source;throw"Node is not incident with this edge"},r.prototype.getOtherEndInGraph=function(a,o){for(var p=this.getOtherEnd(a),n=o.getGraphManager().getRoot();;){if(p.getOwner()==o)return p;if(p.getOwner()==n)break;p=p.getOwner().getParent()}return null},r.prototype.updateLength=function(){var a=new Array(4);this.isOverlapingSourceAndTarget=e.getIntersection(this.target.getRect(),this.source.getRect(),a),this.isOverlapingSourceAndTarget||(this.lengthX=a[0]-a[2],this.lengthY=a[1]-a[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)},m.exports=r},function(m,L,N){function i(e){this.vGraphObject=e}O(i,"LGraphObject"),m.exports=i},function(m,L,N){var i=N(2),e=N(10),t=N(13),r=N(0),h=N(16),a=N(4);function o(n,g,l,f){l==null&&f==null&&(f=g),i.call(this,f),n.graphManager!=null&&(n=n.graphManager),this.estimatedSize=e.MIN_VALUE,this.inclusionTreeDepth=e.MAX_VALUE,this.vGraphObject=f,this.edges=[],this.graphManager=n,l!=null&&g!=null?this.rect=new t(g.x,g.y,l.width,l.height):this.rect=new t}O(o,"LNode"),o.prototype=Object.create(i.prototype);for(var p in i)o[p]=i[p];o.prototype.getEdges=function(){return this.edges},o.prototype.getChild=function(){return this.child},o.prototype.getOwner=function(){return this.owner},o.prototype.getWidth=function(){return this.rect.width},o.prototype.setWidth=function(n){this.rect.width=n},o.prototype.getHeight=function(){return this.rect.height},o.prototype.setHeight=function(n){this.rect.height=n},o.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},o.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},o.prototype.getCenter=function(){return new a(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},o.prototype.getLocation=function(){return new a(this.rect.x,this.rect.y)},o.prototype.getRect=function(){return this.rect},o.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},o.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},o.prototype.setRect=function(n,g){this.rect.x=n.x,this.rect.y=n.y,this.rect.width=g.width,this.rect.height=g.height},o.prototype.setCenter=function(n,g){this.rect.x=n-this.rect.width/2,this.rect.y=g-this.rect.height/2},o.prototype.setLocation=function(n,g){this.rect.x=n,this.rect.y=g},o.prototype.moveBy=function(n,g){this.rect.x+=n,this.rect.y+=g},o.prototype.getEdgeListToNode=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(f.target==n){if(f.source!=l)throw"Incorrect edge source!";g.push(f)}}),g},o.prototype.getEdgesBetween=function(n){var g=[],l=this;return l.edges.forEach(function(f){if(!(f.source==l||f.target==l))throw"Incorrect edge source and/or target";(f.target==n||f.source==n)&&g.push(f)}),g},o.prototype.getNeighborsList=function(){var n=new Set,g=this;return g.edges.forEach(function(l){if(l.source==g)n.add(l.target);else{if(l.target!=g)throw"Incorrect incidency!";n.add(l.source)}}),n},o.prototype.withChildren=function(){var n=new Set,g,l;if(n.add(this),this.child!=null)for(var f=this.child.getNodes(),E=0;E<f.length;E++)g=f[E],l=g.withChildren(),l.forEach(function(y){n.add(y)});return n},o.prototype.getNoOfChildren=function(){var n=0,g;if(this.child==null)n=1;else for(var l=this.child.getNodes(),f=0;f<l.length;f++)g=l[f],n+=g.getNoOfChildren();return n==0&&(n=1),n},o.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},o.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)},o.prototype.scatter=function(){var n,g,l=-r.INITIAL_WORLD_BOUNDARY,f=r.INITIAL_WORLD_BOUNDARY;n=r.WORLD_CENTER_X+h.nextDouble()*(f-l)+l;var E=-r.INITIAL_WORLD_BOUNDARY,y=r.INITIAL_WORLD_BOUNDARY;g=r.WORLD_CENTER_Y+h.nextDouble()*(y-E)+E,this.rect.x=n,this.rect.y=g},o.prototype.updateBounds=function(){if(this.getChild()==null)throw"assert failed";if(this.getChild().getNodes().length!=0){var n=this.getChild();if(n.updateBounds(!0),this.rect.x=n.getLeft(),this.rect.y=n.getTop(),this.setWidth(n.getRight()-n.getLeft()),this.setHeight(n.getBottom()-n.getTop()),r.NODE_DIMENSIONS_INCLUDE_LABELS){var g=n.getRight()-n.getLeft(),l=n.getBottom()-n.getTop();this.labelWidth>g&&(this.rect.x-=(this.labelWidth-g)/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))}}},o.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==e.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},o.prototype.transform=function(n){var g=this.rect.x;g>r.WORLD_BOUNDARY?g=r.WORLD_BOUNDARY:g<-r.WORLD_BOUNDARY&&(g=-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 f=new a(g,l),E=n.inverseTransformPoint(f);this.setLocation(E.x,E.y)},o.prototype.getLeft=function(){return this.rect.x},o.prototype.getRight=function(){return this.rect.x+this.rect.width},o.prototype.getTop=function(){return this.rect.y},o.prototype.getBottom=function(){return this.rect.y+this.rect.height},o.prototype.getParent=function(){return this.owner==null?null:this.owner.getParent()},m.exports=o},function(m,L,N){function i(e,t){e==null&&t==null?(this.x=0,this.y=0):(this.x=e,this.y=t)}O(i,"PointD"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.setX=function(e){this.x=e},i.prototype.setY=function(e){this.y=e},i.prototype.getDifference=function(e){return new DimensionD(this.x-e.x,this.y-e.y)},i.prototype.getCopy=function(){return new i(this.x,this.y)},i.prototype.translate=function(e){return this.x+=e.width,this.y+=e.height,this},m.exports=i},function(m,L,N){var i=N(2),e=N(10),t=N(0),r=N(6),h=N(3),a=N(1),o=N(13),p=N(12),n=N(11);function g(f,E,y){i.call(this,y),this.estimatedSize=e.MIN_VALUE,this.margin=t.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=f,E!=null&&E instanceof r?this.graphManager=E:E!=null&&E instanceof Layout&&(this.graphManager=E.graphManager)}O(g,"LGraph"),g.prototype=Object.create(i.prototype);for(var l in i)g[l]=i[l];g.prototype.getNodes=function(){return this.nodes},g.prototype.getEdges=function(){return this.edges},g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getParent=function(){return this.parent},g.prototype.getLeft=function(){return this.left},g.prototype.getRight=function(){return this.right},g.prototype.getTop=function(){return this.top},g.prototype.getBottom=function(){return this.bottom},g.prototype.isConnected=function(){return this.isConnected},g.prototype.add=function(f,E,y){if(E==null&&y==null){var d=f;if(this.graphManager==null)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(d)>-1)throw"Node already in graph!";return d.owner=this,this.getNodes().push(d),d}else{var A=f;if(!(this.getNodes().indexOf(E)>-1&&this.getNodes().indexOf(y)>-1))throw"Source or target not in graph!";if(!(E.owner==y.owner&&E.owner==this))throw"Both owners must be this graph!";return E.owner!=y.owner?null:(A.source=E,A.target=y,A.isInterGraph=!1,this.getEdges().push(A),E.edges.push(A),y!=E&&y.edges.push(A),A)}},g.prototype.remove=function(f){var E=f;if(f instanceof h){if(E==null)throw"Node is null!";if(!(E.owner!=null&&E.owner==this))throw"Owner graph is invalid!";if(this.graphManager==null)throw"Owner graph manager is invalid!";for(var y=E.edges.slice(),d,A=y.length,v=0;v<A;v++)d=y[v],d.isInterGraph?this.graphManager.remove(d):d.source.owner.remove(d);var I=this.nodes.indexOf(E);if(I==-1)throw"Node not in owner node list!";this.nodes.splice(I,1)}else if(f instanceof a){var d=f;if(d==null)throw"Edge is null!";if(!(d.source!=null&&d.target!=null))throw"Source and/or target is null!";if(!(d.source.owner!=null&&d.target.owner!=null&&d.source.owner==this&&d.target.owner==this))throw"Source and/or target owner is invalid!";var s=d.source.edges.indexOf(d),u=d.target.edges.indexOf(d);if(!(s>-1&&u>-1))throw"Source and/or target doesn't know this edge!";d.source.edges.splice(s,1),d.target!=d.source&&d.target.edges.splice(u,1);var I=d.source.owner.getEdges().indexOf(d);if(I==-1)throw"Not in owner's edge list!";d.source.owner.getEdges().splice(I,1)}},g.prototype.updateLeftTop=function(){for(var f=e.MAX_VALUE,E=e.MAX_VALUE,y,d,A,v=this.getNodes(),I=v.length,s=0;s<I;s++){var u=v[s];y=u.getTop(),d=u.getLeft(),f>y&&(f=y),E>d&&(E=d)}return f==e.MAX_VALUE?null:(v[0].getParent().paddingLeft!=null?A=v[0].getParent().paddingLeft:A=this.margin,this.left=E-A,this.top=f-A,new p(this.left,this.top))},g.prototype.updateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,A=-e.MAX_VALUE,v,I,s,u,c,_=this.nodes,T=_.length,w=0;w<T;w++){var D=_[w];f&&D.child!=null&&D.updateBounds(),v=D.getLeft(),I=D.getRight(),s=D.getTop(),u=D.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),A<u&&(A=u)}var M=new o(E,d,y-E,A-d);E==e.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),_[0].getParent().paddingLeft!=null?c=_[0].getParent().paddingLeft:c=this.margin,this.left=M.x-c,this.right=M.x+M.width+c,this.top=M.y-c,this.bottom=M.y+M.height+c},g.calculateBounds=function(f){for(var E=e.MAX_VALUE,y=-e.MAX_VALUE,d=e.MAX_VALUE,A=-e.MAX_VALUE,v,I,s,u,c=f.length,_=0;_<c;_++){var T=f[_];v=T.getLeft(),I=T.getRight(),s=T.getTop(),u=T.getBottom(),E>v&&(E=v),y<I&&(y=I),d>s&&(d=s),A<u&&(A=u)}var w=new o(E,d,y-E,A-d);return w},g.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},g.prototype.getEstimatedSize=function(){if(this.estimatedSize==e.MIN_VALUE)throw"assert failed";return this.estimatedSize},g.prototype.calcEstimatedSize=function(){for(var f=0,E=this.nodes,y=E.length,d=0;d<y;d++){var A=E[d];f+=A.calcEstimatedSize()}return f==0?this.estimatedSize=t.EMPTY_COMPOUND_NODE_SIZE:this.estimatedSize=f/Math.sqrt(this.nodes.length),this.estimatedSize},g.prototype.updateConnected=function(){var f=this;if(this.nodes.length==0){this.isConnected=!0;return}var E=new n,y=new Set,d=this.nodes[0],A,v,I=d.withChildren();for(I.forEach(function(w){E.push(w),y.add(w)});E.length!==0;){d=E.shift(),A=d.getEdges();for(var s=A.length,u=0;u<s;u++){var c=A[u];if(v=c.getOtherEndInGraph(d,this),v!=null&&!y.has(v)){var _=v.withChildren();_.forEach(function(w){E.push(w),y.add(w)})}}}if(this.isConnected=!1,y.size>=this.nodes.length){var T=0;y.forEach(function(w){w.owner==f&&T++}),T==this.nodes.length&&(this.isConnected=!0)}},m.exports=g},function(m,L,N){var i,e=N(1);function t(r){i=N(5),this.layout=r,this.graphs=[],this.edges=[]}O(t,"LGraphManager"),t.prototype.addRoot=function(){var r=this.layout.newGraph(),h=this.layout.newNode(null),a=this.add(r,h);return this.setRootGraph(a),this.rootGraph},t.prototype.add=function(r,h,a,o,p){if(a==null&&o==null&&p==null){if(r==null)throw"Graph is null!";if(h==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(h.child!=null)throw"Already has a child!";return r.parent=h,h.child=r,r}else{p=a,o=h,a=r;var n=o.getOwner(),g=p.getOwner();if(!(n!=null&&n.getGraphManager()==this))throw"Source not in this graph mgr!";if(!(g!=null&&g.getGraphManager()==this))throw"Target not in this graph mgr!";if(n==g)return a.isInterGraph=!1,n.add(a,o,p);if(a.isInterGraph=!0,a.source=o,a.target=p,this.edges.indexOf(a)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(a),!(a.source!=null&&a.target!=null))throw"Edge source and/or target is null!";if(!(a.source.edges.indexOf(a)==-1&&a.target.edges.indexOf(a)==-1))throw"Edge already in source and/or target incidency list!";return a.source.edges.push(a),a.target.edges.push(a),a}},t.prototype.remove=function(r){if(r instanceof i){var h=r;if(h.getGraphManager()!=this)throw"Graph not in this graph mgr";if(!(h==this.rootGraph||h.parent!=null&&h.parent.graphManager==this))throw"Invalid parent node!";var a=[];a=a.concat(h.getEdges());for(var o,p=a.length,n=0;n<p;n++)o=a[n],h.remove(o);var g=[];g=g.concat(h.getNodes());var l;p=g.length;for(var n=0;n<p;n++)l=g[n],h.remove(l);h==this.rootGraph&&this.setRootGraph(null);var f=this.graphs.indexOf(h);this.graphs.splice(f,1),h.parent=null}else if(r instanceof e){if(o=r,o==null)throw"Edge is null!";if(!o.isInterGraph)throw"Not an inter-graph edge!";if(!(o.source!=null&&o.target!=null))throw"Source and/or target is null!";if(!(o.source.edges.indexOf(o)!=-1&&o.target.edges.indexOf(o)!=-1))throw"Source and/or target doesn't know this edge!";var f=o.source.edges.indexOf(o);if(o.source.edges.splice(f,1),f=o.target.edges.indexOf(o),o.target.edges.splice(f,1),!(o.source.owner!=null&&o.source.owner.getGraphManager()!=null))throw"Edge owner graph or owner graph manager is null!";if(o.source.owner.getGraphManager().edges.indexOf(o)==-1)throw"Not in owner graph manager's edge list!";var f=o.source.owner.getGraphManager().edges.indexOf(o);o.source.owner.getGraphManager().edges.splice(f,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=[],h=this.getGraphs(),a=h.length,o=0;o<a;o++)r=r.concat(h[o].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=[],h=this.getGraphs(),a=h.length,o=0;o<h.length;o++)r=r.concat(h[o].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,h){if(!(r!=null&&h!=null))throw"assert failed";if(r==h)return!0;var a=r.getOwner(),o;do{if(o=a.getParent(),o==null)break;if(o==h)return!0;if(a=o.getOwner(),a==null)break}while(!0);a=h.getOwner();do{if(o=a.getParent(),o==null)break;if(o==r)return!0;if(a=o.getOwner(),a==null)break}while(!0);return!1},t.prototype.calcLowestCommonAncestors=function(){for(var r,h,a,o,p,n=this.getAllEdges(),g=n.length,l=0;l<g;l++){if(r=n[l],h=r.source,a=r.target,r.lca=null,r.sourceInLca=h,r.targetInLca=a,h==a){r.lca=h.getOwner();continue}for(o=h.getOwner();r.lca==null;){for(r.targetInLca=a,p=a.getOwner();r.lca==null;){if(p==o){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(o==this.rootGraph)break;r.lca==null&&(r.sourceInLca=o.getParent(),o=r.sourceInLca.getOwner())}if(r.lca==null)throw"assert failed"}},t.prototype.calcLowestCommonAncestor=function(r,h){if(r==h)return r.getOwner();var a=r.getOwner();do{if(a==null)break;var o=h.getOwner();do{if(o==null)break;if(o==a)return o;o=o.getParent().getOwner()}while(!0);a=a.getParent().getOwner()}while(!0);return a},t.prototype.calcInclusionTreeDepths=function(r,h){r==null&&h==null&&(r=this.rootGraph,h=1);for(var a,o=r.getNodes(),p=o.length,n=0;n<p;n++)a=o[n],a.inclusionTreeDepth=h,a.child!=null&&this.calcInclusionTreeDepths(a.child,h+1)},t.prototype.includesInvalidEdge=function(){for(var r,h=this.edges.length,a=0;a<h;a++)if(r=this.edges[a],this.isOneAncestorOfOther(r.source,r.target))return!0;return!1},m.exports=t},function(m,L,N){var i=N(0);function e(){}O(e,"FDLayoutConstants");for(var t in i)e[t]=i[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,m.exports=e},function(m,L,N){var i=N(12);function e(){}O(e,"IGeometry"),e.calcSeparationAmount=function(t,r,h,a){if(!t.intersects(r))throw"assert failed";var o=new Array(2);this.decideDirectionsForOverlappingNodes(t,r,o),h[0]=Math.min(t.getRight(),r.getRight())-Math.max(t.x,r.x),h[1]=Math.min(t.getBottom(),r.getBottom())-Math.max(t.y,r.y),t.getX()<=r.getX()&&t.getRight()>=r.getRight()?h[0]+=Math.min(r.getX()-t.getX(),t.getRight()-r.getRight()):r.getX()<=t.getX()&&r.getRight()>=t.getRight()&&(h[0]+=Math.min(t.getX()-r.getX(),r.getRight()-t.getRight())),t.getY()<=r.getY()&&t.getBottom()>=r.getBottom()?h[1]+=Math.min(r.getY()-t.getY(),t.getBottom()-r.getBottom()):r.getY()<=t.getY()&&r.getBottom()>=t.getBottom()&&(h[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 n=p*h[0],g=h[1]/p;h[0]<g?g=h[0]:n=h[1],h[0]=-1*o[0]*(g/2+a),h[1]=-1*o[1]*(n/2+a)},e.decideDirectionsForOverlappingNodes=function(t,r,h){t.getCenterX()<r.getCenterX()?h[0]=-1:h[0]=1,t.getCenterY()<r.getCenterY()?h[1]=-1:h[1]=1},e.getIntersection2=function(t,r,h){var a=t.getCenterX(),o=t.getCenterY(),p=r.getCenterX(),n=r.getCenterY();if(t.intersects(r))return h[0]=a,h[1]=o,h[2]=p,h[3]=n,!0;var g=t.getX(),l=t.getY(),f=t.getRight(),E=t.getX(),y=t.getBottom(),d=t.getRight(),A=t.getWidthHalf(),v=t.getHeightHalf(),I=r.getX(),s=r.getY(),u=r.getRight(),c=r.getX(),_=r.getBottom(),T=r.getRight(),w=r.getWidthHalf(),D=r.getHeightHalf(),M=!1,R=!1;if(a===p){if(o>n)return h[0]=a,h[1]=l,h[2]=p,h[3]=_,!1;if(o<n)return h[0]=a,h[1]=y,h[2]=p,h[3]=s,!1}else if(o===n){if(a>p)return h[0]=g,h[1]=o,h[2]=u,h[3]=n,!1;if(a<p)return h[0]=f,h[1]=o,h[2]=I,h[3]=n,!1}else{var F=t.height/t.width,S=r.height/r.width,x=(n-o)/(p-a),G=void 0,b=void 0,P=void 0,U=void 0,Y=void 0,B=void 0;if(-F===x?a>p?(h[0]=E,h[1]=y,M=!0):(h[0]=f,h[1]=l,M=!0):F===x&&(a>p?(h[0]=g,h[1]=l,M=!0):(h[0]=d,h[1]=y,M=!0)),-S===x?p>a?(h[2]=c,h[3]=_,R=!0):(h[2]=u,h[3]=s,R=!0):S===x&&(p>a?(h[2]=I,h[3]=s,R=!0):(h[2]=T,h[3]=_,R=!0)),M&&R)return!1;if(a>p?o>n?(G=this.getCardinalDirection(F,x,4),b=this.getCardinalDirection(S,x,2)):(G=this.getCardinalDirection(-F,x,3),b=this.getCardinalDirection(-S,x,1)):o>n?(G=this.getCardinalDirection(-F,x,1),b=this.getCardinalDirection(-S,x,3)):(G=this.getCardinalDirection(F,x,2),b=this.getCardinalDirection(S,x,4)),!M)switch(G){case 1:U=l,P=a+-v/x,h[0]=P,h[1]=U;break;case 2:P=d,U=o+A*x,h[0]=P,h[1]=U;break;case 3:U=y,P=a+v/x,h[0]=P,h[1]=U;break;case 4:P=E,U=o+-A*x,h[0]=P,h[1]=U;break}if(!R)switch(b){case 1:B=s,Y=p+-D/x,h[2]=Y,h[3]=B;break;case 2:Y=T,B=n+w*x,h[2]=Y,h[3]=B;break;case 3:B=_,Y=p+D/x,h[2]=Y,h[3]=B;break;case 4:Y=c,B=n+-w*x,h[2]=Y,h[3]=B;break}}return!1},e.getCardinalDirection=function(t,r,h){return t>r?h:1+h%4},e.getIntersection=function(t,r,h,a){if(a==null)return this.getIntersection2(t,r,h);var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=void 0,A=void 0,v=void 0,I=void 0,s=void 0,u=void 0,c=void 0,_=void 0,T=void 0;return v=g-p,s=o-n,c=n*p-o*g,I=y-f,u=l-E,_=E*f-l*y,T=v*u-I*s,T===0?null:(d=(s*_-u*c)/T,A=(I*c-v*_)/T,new i(d,A))},e.angleOfVector=function(t,r,h,a){var o=void 0;return t!==h?(o=Math.atan((a-r)/(h-t)),h<t?o+=Math.PI:a<r&&(o+=this.TWO_PI)):a<r?o=this.ONE_AND_HALF_PI:o=this.HALF_PI,o},e.doIntersect=function(t,r,h,a){var o=t.x,p=t.y,n=r.x,g=r.y,l=h.x,f=h.y,E=a.x,y=a.y,d=(n-o)*(y-f)-(E-l)*(g-p);if(d===0)return!1;var A=((y-f)*(E-o)+(l-E)*(y-p))/d,v=((p-g)*(E-o)+(n-o)*(y-p))/d;return 0<A&&A<1&&0<v&&v<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,m.exports=e},function(m,L,N){function i(){}O(i,"IMath"),i.sign=function(e){return e>0?1:e<0?-1:0},i.floor=function(e){return e<0?Math.ceil(e):Math.floor(e)},i.ceil=function(e){return e<0?Math.floor(e):Math.ceil(e)},m.exports=i},function(m,L,N){function i(){}O(i,"Integer"),i.MAX_VALUE=2147483647,i.MIN_VALUE=-2147483648,m.exports=i},function(m,L,N){var i=function(){function o(p,n){for(var g=0;g<n.length;g++){var l=n[g];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(p,l.key,l)}}return O(o,"defineProperties"),function(p,n,g){return n&&o(p.prototype,n),g&&o(p,g),p}}();function e(o,p){if(!(o instanceof p))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=O(function(o){return{value:o,next:null,prev:null}},"nodeFrom"),r=O(function(o,p,n,g){return o!==null?o.next=p:g.head=p,n!==null?n.prev=p:g.tail=p,p.prev=o,p.next=n,g.length++,p},"add"),h=O(function(o,p){var n=o.prev,g=o.next;return n!==null?n.next=g:p.head=g,g!==null?g.prev=n:p.tail=n,o.prev=o.next=null,p.length--,o},"_remove"),a=function(){function o(p){var n=this;e(this,o),this.length=0,this.head=null,this.tail=null,p==null||p.forEach(function(g){return n.push(g)})}return O(o,"LinkedList"),i(o,[{key:"size",value:O(function(){return this.length},"size")},{key:"insertBefore",value:O(function(p,n){return r(n.prev,t(p),n,this)},"insertBefore")},{key:"insertAfter",value:O(function(p,n){return r(n,t(p),n.next,this)},"insertAfter")},{key:"insertNodeBefore",value:O(function(p,n){return r(n.prev,p,n,this)},"insertNodeBefore")},{key:"insertNodeAfter",value:O(function(p,n){return r(n,p,n.next,this)},"insertNodeAfter")},{key:"push",value:O(function(p){return r(this.tail,t(p),null,this)},"push")},{key:"unshift",value:O(function(p){return r(null,t(p),this.head,this)},"unshift")},{key:"remove",value:O(function(p){return h(p,this)},"remove")},{key:"pop",value:O(function(){return h(this.tail,this).value},"pop")},{key:"popNode",value:O(function(){return h(this.tail,this)},"popNode")},{key:"shift",value:O(function(){return h(this.head,this).value},"shift")},{key:"shiftNode",value:O(function(){return h(this.head,this)},"shiftNode")},{key:"get_object_at",value:O(function(p){if(p<=this.length()){for(var n=1,g=this.head;n<p;)g=g.next,n++;return g.value}},"get_object_at")},{key:"set_object_at",value:O(function(p,n){if(p<=this.length()){for(var g=1,l=this.head;g<p;)l=l.next,g++;l.value=n}},"set_object_at")}]),o}();m.exports=a},function(m,L,N){function i(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)}O(i,"Point"),i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.getLocation=function(){return new i(this.x,this.y)},i.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)))},i.prototype.move=function(e,t){this.x=e,this.y=t},i.prototype.translate=function(e,t){this.x+=e,this.y+=t},i.prototype.equals=function(e){if(e.constructor.name=="Point"){var t=e;return this.x==t.x&&this.y==t.y}return this==e},i.prototype.toString=function(){return new i().constructor.name+"[x="+this.x+",y="+this.y+"]"},m.exports=i},function(m,L,N){function i(e,t,r,h){this.x=0,this.y=0,this.width=0,this.height=0,e!=null&&t!=null&&r!=null&&h!=null&&(this.x=e,this.y=t,this.width=r,this.height=h)}O(i,"RectangleD"),i.prototype.getX=function(){return this.x},i.prototype.setX=function(e){this.x=e},i.prototype.getY=function(){return this.y},i.prototype.setY=function(e){this.y=e},i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},i.prototype.getRight=function(){return this.x+this.width},i.prototype.getBottom=function(){return this.y+this.height},i.prototype.intersects=function(e){return!(this.getRight()<e.x||this.getBottom()<e.y||e.getRight()<this.x||e.getBottom()<this.y)},i.prototype.getCenterX=function(){return this.x+this.width/2},i.prototype.getMinX=function(){return this.getX()},i.prototype.getMaxX=function(){return this.getX()+this.width},i.prototype.getCenterY=function(){return this.y+this.height/2},i.prototype.getMinY=function(){return this.getY()},i.prototype.getMaxY=function(){return this.getY()+this.height},i.prototype.getWidthHalf=function(){return this.width/2},i.prototype.getHeightHalf=function(){return this.height/2},m.exports=i},function(m,L,N){var i=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(){}O(e,"UniqueIDGeneretor"),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":i(t);return t==null||r!="object"&&r!="function"},m.exports=e},function(m,L,N){function i(l){if(Array.isArray(l)){for(var f=0,E=Array(l.length);f<l.length;f++)E[f]=l[f];return E}else return Array.from(l)}O(i,"_toConsumableArray");var e=N(0),t=N(6),r=N(3),h=N(1),a=N(5),o=N(4),p=N(17),n=N(27);function g(l){n.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)}O(g,"Layout"),g.RANDOM_SEED=1,g.prototype=Object.create(n.prototype),g.prototype.getGraphManager=function(){return this.graphManager},g.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},g.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},g.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},g.prototype.newGraphManager=function(){var l=new t(this);return this.graphManager=l,l},g.prototype.newGraph=function(l){return new a(null,this.graphManager,l)},g.prototype.newNode=function(l){return new r(this.graphManager,l)},g.prototype.newEdge=function(l){return new h(null,null,l)},g.prototype.checkLayoutSuccess=function(){return this.graphManager.getRoot()==null||this.graphManager.getRoot().getNodes().length==0||this.graphManager.includesInvalidEdge()},g.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)},g.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},g.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var l,f=this.graphManager.getAllEdges(),E=0;E<f.length;E++)l=f[E];for(var y,d=this.graphManager.getRoot().getNodes(),E=0;E<d.length;E++)y=d[E];this.update(this.graphManager.getRoot())}},g.prototype.update=function(l){if(l==null)this.update2();else if(l instanceof r){var f=l;if(f.getChild()!=null)for(var E=f.getChild().getNodes(),y=0;y<E.length;y++)update(E[y]);if(f.vGraphObject!=null){var d=f.vGraphObject;d.update(f)}}else if(l instanceof h){var A=l;if(A.vGraphObject!=null){var v=A.vGraphObject;v.update(A)}}else if(l instanceof a){var I=l;if(I.vGraphObject!=null){var s=I.vGraphObject;s.update(I)}}},g.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)},g.prototype.transform=function(l){if(l==null)this.transform(new o(0,0));else{var f=new p,E=this.graphManager.getRoot().updateLeftTop();if(E!=null){f.setWorldOrgX(l.x),f.setWorldOrgY(l.y),f.setDeviceOrgX(E.x),f.setDeviceOrgY(E.y);for(var y=this.getAllNodes(),d,A=0;A<y.length;A++)d=y[A],d.transform(f)}}},g.prototype.positionNodesRandomly=function(l){if(l==null)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var f,E,y=l.getNodes(),d=0;d<y.length;d++)f=y[d],E=f.getChild(),E==null||E.getNodes().length==0?f.scatter():(this.positionNodesRandomly(E),f.updateBounds())},g.prototype.getFlatForest=function(){for(var l=[],f=!0,E=this.graphManager.getRoot().getNodes(),y=!0,d=0;d<E.length;d++)E[d].getChild()!=null&&(y=!1);if(!y)return l;var A=new Set,v=[],I=new Map,s=[];for(s=s.concat(E);s.length>0&&f;){for(v.push(s[0]);v.length>0&&f;){var u=v[0];v.splice(0,1),A.add(u);for(var c=u.getEdges(),d=0;d<c.length;d++){var _=c[d].getOtherEnd(u);if(I.get(u)!=_)if(!A.has(_))v.push(_),I.set(_,u);else{f=!1;break}}}if(!f)l=[];else{var T=[].concat(i(A));l.push(T);for(var d=0;d<T.length;d++){var w=T[d],D=s.indexOf(w);D>-1&&s.splice(D,1)}A=new Set,I=new Map}}return l},g.prototype.createDummyNodesForBendpoints=function(l){for(var f=[],E=l.source,y=this.graphManager.calcLowestCommonAncestor(l.source,l.target),d=0;d<l.bendpoints.length;d++){var A=this.newNode(null);A.setRect(new Point(0,0),new Dimension(1,1)),y.add(A);var v=this.newEdge(null);this.graphManager.add(v,E,A),f.add(A),E=A}var v=this.newEdge(null);return this.graphManager.add(v,E,l.target),this.edgeToDummyNodes.set(l,f),l.isInterGraph()?this.graphManager.remove(l):y.remove(l),f},g.prototype.createBendpointsFromDummyNodes=function(){var l=[];l=l.concat(this.graphManager.getAllEdges()),l=[].concat(i(this.edgeToDummyNodes.keys())).concat(l);for(var f=0;f<l.length;f++){var E=l[f];if(E.bendpoints.length>0){for(var y=this.edgeToDummyNodes.get(E),d=0;d<y.length;d++){var A=y[d],v=new o(A.getCenterX(),A.getCenterY()),I=E.bendpoints.get(d);I.x=v.x,I.y=v.y,A.getOwner().remove(A)}this.graphManager.add(E,E.source,E.target)}}},g.transform=function(l,f,E,y){if(E!=null&&y!=null){var d=f;if(l<=50){var A=f/E;d-=(f-A)/50*(50-l)}else{var v=f*y;d+=(v-f)/50*(l-50)}return d}else{var I,s;return l<=50?(I=9*f/500,s=f/10):(I=9*f/50,s=-8*f),I*l+s}},g.findCenterOfTree=function(l){var f=[];f=f.concat(l);var E=[],y=new Map,d=!1,A=null;(f.length==1||f.length==2)&&(d=!0,A=f[0]);for(var v=0;v<f.length;v++){var I=f[v],s=I.getNeighborsList().size;y.set(I,I.getNeighborsList().size),s==1&&E.push(I)}var u=[];for(u=u.concat(E);!d;){var c=[];c=c.concat(u),u=[];for(var v=0;v<f.length;v++){var I=f[v],_=f.indexOf(I);_>=0&&f.splice(_,1);var T=I.getNeighborsList();T.forEach(function(M){if(E.indexOf(M)<0){var R=y.get(M),F=R-1;F==1&&u.push(M),y.set(M,F)}})}E=E.concat(u),(f.length==1||f.length==2)&&(d=!0,A=f[0])}return A},g.prototype.setGraphManager=function(l){this.graphManager=l},m.exports=g},function(m,L,N){function i(){}O(i,"RandomSeed"),i.seed=1,i.x=0,i.nextDouble=function(){return i.x=Math.sin(i.seed++)*1e4,i.x-Math.floor(i.x)},m.exports=i},function(m,L,N){var i=N(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}O(e,"Transform"),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,h=this.lworldExtX;return h!=0&&(r=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/h),r},e.prototype.transformY=function(t){var r=0,h=this.lworldExtY;return h!=0&&(r=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/h),r},e.prototype.inverseTransformX=function(t){var r=0,h=this.ldeviceExtX;return h!=0&&(r=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/h),r},e.prototype.inverseTransformY=function(t){var r=0,h=this.ldeviceExtY;return h!=0&&(r=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/h),r},e.prototype.inverseTransformPoint=function(t){var r=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return r},m.exports=e},function(m,L,N){function i(n){if(Array.isArray(n)){for(var g=0,l=Array(n.length);g<n.length;g++)l[g]=n[g];return l}else return Array.from(n)}O(i,"_toConsumableArray");var e=N(15),t=N(7),r=N(0),h=N(8),a=N(9);function o(){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}O(o,"FDLayout"),o.prototype=Object.create(e.prototype);for(var p in e)o[p]=e[p];o.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=[]},o.prototype.calcIdealEdgeLengths=function(){for(var n,g,l,f,E,y,d=this.getGraphManager().getAllEdges(),A=0;A<d.length;A++)n=d[A],n.idealLength=this.idealEdgeLength,n.isInterGraph&&(l=n.getSource(),f=n.getTarget(),E=n.getSourceInLca().getEstimatedSize(),y=n.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(n.idealLength+=E+y-2*r.SIMPLE_NODE_SIZE),g=n.getLca().getInclusionTreeDepth(),n.idealLength+=t.DEFAULT_EDGE_LENGTH*t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(l.getInclusionTreeDepth()+f.getInclusionTreeDepth()-2*g))},o.prototype.initSpringEmbedder=function(){var n=this.getAllNodes().length;this.incremental?(n>t.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*t.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(n-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):(n>t.ADAPTATION_LOWER_NODE_LIMIT?this.coolingFactor=Math.max(t.COOLING_ADAPTATION_FACTOR,1-(n-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()},o.prototype.calcSpringForces=function(){for(var n=this.getAllEdges(),g,l=0;l<n.length;l++)g=n[l],this.calcSpringForce(g,g.idealLength)},o.prototype.calcRepulsionForces=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l,f,E,y,d=this.getAllNodes(),A;if(this.useFRGridVariant)for(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&n&&this.updateGrid(),A=new Set,l=0;l<d.length;l++)E=d[l],this.calculateRepulsionForceOfANode(E,A,n,g),A.add(E);else for(l=0;l<d.length;l++)for(E=d[l],f=l+1;f<d.length;f++)y=d[f],E.getOwner()==y.getOwner()&&this.calcRepulsionForce(E,y)},o.prototype.calcGravitationalForces=function(){for(var n,g=this.getAllNodesToApplyGravitation(),l=0;l<g.length;l++)n=g[l],this.calcGravitationalForce(n)},o.prototype.moveNodes=function(){for(var n=this.getAllNodes(),g,l=0;l<n.length;l++)g=n[l],g.move()},o.prototype.calcSpringForce=function(n,g){var l=n.getSource(),f=n.getTarget(),E,y,d,A;if(this.uniformLeafNodeSizes&&l.getChild()==null&&f.getChild()==null)n.updateLengthSimple();else if(n.updateLength(),n.isOverlapingSourceAndTarget)return;E=n.getLength(),E!=0&&(y=this.springConstant*(E-g),d=y*(n.lengthX/E),A=y*(n.lengthY/E),l.springForceX+=d,l.springForceY+=A,f.springForceX-=d,f.springForceY-=A)},o.prototype.calcRepulsionForce=function(n,g){var l=n.getRect(),f=g.getRect(),E=new Array(2),y=new Array(4),d,A,v,I,s,u,c;if(l.intersects(f)){h.calcSeparationAmount(l,f,E,t.DEFAULT_EDGE_LENGTH/2),u=2*E[0],c=2*E[1];var _=n.noOfChildren*g.noOfChildren/(n.noOfChildren+g.noOfChildren);n.repulsionForceX-=_*u,n.repulsionForceY-=_*c,g.repulsionForceX+=_*u,g.repulsionForceY+=_*c}else this.uniformLeafNodeSizes&&n.getChild()==null&&g.getChild()==null?(d=f.getCenterX()-l.getCenterX(),A=f.getCenterY()-l.getCenterY()):(h.getIntersection(l,f,y),d=y[2]-y[0],A=y[3]-y[1]),Math.abs(d)<t.MIN_REPULSION_DIST&&(d=a.sign(d)*t.MIN_REPULSION_DIST),Math.abs(A)<t.MIN_REPULSION_DIST&&(A=a.sign(A)*t.MIN_REPULSION_DIST),v=d*d+A*A,I=Math.sqrt(v),s=this.repulsionConstant*n.noOfChildren*g.noOfChildren/v,u=s*d/I,c=s*A/I,n.repulsionForceX-=u,n.repulsionForceY-=c,g.repulsionForceX+=u,g.repulsionForceY+=c},o.prototype.calcGravitationalForce=function(n){var g,l,f,E,y,d,A,v;g=n.getOwner(),l=(g.getRight()+g.getLeft())/2,f=(g.getTop()+g.getBottom())/2,E=n.getCenterX()-l,y=n.getCenterY()-f,d=Math.abs(E)+n.getWidth()/2,A=Math.abs(y)+n.getHeight()/2,n.getOwner()==this.graphManager.getRoot()?(v=g.getEstimatedSize()*this.gravityRangeFactor,(d>v||A>v)&&(n.gravitationForceX=-this.gravityConstant*E,n.gravitationForceY=-this.gravityConstant*y)):(v=g.getEstimatedSize()*this.compoundGravityRangeFactor,(d>v||A>v)&&(n.gravitationForceX=-this.gravityConstant*E*this.compoundGravityConstant,n.gravitationForceY=-this.gravityConstant*y*this.compoundGravityConstant))},o.prototype.isConverged=function(){var n,g=!1;return this.totalIterations>this.maxIterations/3&&(g=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),n=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,n||g},o.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},o.prototype.calcNoOfChildrenForAllNodes=function(){for(var n,g=this.graphManager.getAllNodes(),l=0;l<g.length;l++)n=g[l],n.noOfChildren=n.getNoOfChildren()},o.prototype.calcGrid=function(n){var g=0,l=0;g=parseInt(Math.ceil((n.getRight()-n.getLeft())/this.repulsionRange)),l=parseInt(Math.ceil((n.getBottom()-n.getTop())/this.repulsionRange));for(var f=new Array(g),E=0;E<g;E++)f[E]=new Array(l);for(var E=0;E<g;E++)for(var y=0;y<l;y++)f[E][y]=new Array;return f},o.prototype.addNodeToGrid=function(n,g,l){var f=0,E=0,y=0,d=0;f=parseInt(Math.floor((n.getRect().x-g)/this.repulsionRange)),E=parseInt(Math.floor((n.getRect().width+n.getRect().x-g)/this.repulsionRange)),y=parseInt(Math.floor((n.getRect().y-l)/this.repulsionRange)),d=parseInt(Math.floor((n.getRect().height+n.getRect().y-l)/this.repulsionRange));for(var A=f;A<=E;A++)for(var v=y;v<=d;v++)this.grid[A][v].push(n),n.setGridCoordinates(f,E,y,d)},o.prototype.updateGrid=function(){var n,g,l=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),n=0;n<l.length;n++)g=l[n],this.addNodeToGrid(g,this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},o.prototype.calculateRepulsionForceOfANode=function(n,g,l,f){if(this.totalIterations%t.GRID_CALCULATION_CHECK_PERIOD==1&&l||f){var E=new Set;n.surrounding=new Array;for(var y,d=this.grid,A=n.startX-1;A<n.finishX+2;A++)for(var v=n.startY-1;v<n.finishY+2;v++)if(!(A<0||v<0||A>=d.length||v>=d[0].length)){for(var I=0;I<d[A][v].length;I++)if(y=d[A][v][I],!(n.getOwner()!=y.getOwner()||n==y)&&!g.has(y)&&!E.has(y)){var s=Math.abs(n.getCenterX()-y.getCenterX())-(n.getWidth()/2+y.getWidth()/2),u=Math.abs(n.getCenterY()-y.getCenterY())-(n.getHeight()/2+y.getHeight()/2);s<=this.repulsionRange&&u<=this.repulsionRange&&E.add(y)}}n.surrounding=[].concat(i(E))}for(A=0;A<n.surrounding.length;A++)this.calcRepulsionForce(n,n.surrounding[A])},o.prototype.calcRepulsionRange=function(){return 0},m.exports=o},function(m,L,N){var i=N(1),e=N(7);function t(h,a,o){i.call(this,h,a,o),this.idealLength=e.DEFAULT_EDGE_LENGTH}O(t,"FDLayoutEdge"),t.prototype=Object.create(i.prototype);for(var r in i)t[r]=i[r];m.exports=t},function(m,L,N){var i=N(3);function e(r,h,a,o){i.call(this,r,h,a,o),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=[]}O(e,"FDLayoutNode"),e.prototype=Object.create(i.prototype);for(var t in i)e[t]=i[t];e.prototype.setGridCoordinates=function(r,h,a,o){this.startX=r,this.finishX=h,this.startY=a,this.finishY=o},m.exports=e},function(m,L,N){function i(e,t){this.width=0,this.height=0,e!==null&&t!==null&&(this.height=t,this.width=e)}O(i,"DimensionD"),i.prototype.getWidth=function(){return this.width},i.prototype.setWidth=function(e){this.width=e},i.prototype.getHeight=function(){return this.height},i.prototype.setHeight=function(e){this.height=e},m.exports=i},function(m,L,N){var i=N(14);function e(){this.map={},this.keys=[]}O(e,"HashMap"),e.prototype.put=function(t,r){var h=i.createID(t);this.contains(h)||(this.map[h]=r,this.keys.push(t))},e.prototype.contains=function(t){return i.createID(t),this.map[t]!=null},e.prototype.get=function(t){var r=i.createID(t);return this.map[r]},e.prototype.keySet=function(){return this.keys},m.exports=e},function(m,L,N){var i=N(14);function e(){this.set={}}O(e,"HashSet"),e.prototype.add=function(t){var r=i.createID(t);this.contains(r)||(this.set[r]=t)},e.prototype.remove=function(t){delete this.set[i.createID(t)]},e.prototype.clear=function(){this.set={}},e.prototype.contains=function(t){return this.set[i.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),h=r.length,a=0;a<h;a++)t.push(this.set[r[a]])},e.prototype.size=function(){return Object.keys(this.set).length},e.prototype.addAll=function(t){for(var r=t.length,h=0;h<r;h++){var a=t[h];this.add(a)}},m.exports=e},function(m,L,N){var i=function(){function h(a,o){for(var p=0;p<o.length;p++){var n=o[p];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}return O(h,"defineProperties"),function(a,o,p){return o&&h(a.prototype,o),p&&h(a,p),a}}();function e(h,a){if(!(h instanceof a))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=N(11),r=function(){function h(a,o){e(this,h),(o!==null||o!==void 0)&&(this.compareFunction=this._defaultCompareFunction);var p=void 0;a instanceof t?p=a.size():p=a.length,this._quicksort(a,0,p-1)}return O(h,"Quicksort"),i(h,[{key:"_quicksort",value:O(function(a,o,p){if(o<p){var n=this._partition(a,o,p);this._quicksort(a,o,n),this._quicksort(a,n+1,p)}},"_quicksort")},{key:"_partition",value:O(function(a,o,p){for(var n=this._get(a,o),g=o,l=p;;){for(;this.compareFunction(n,this._get(a,l));)l--;for(;this.compareFunction(this._get(a,g),n);)g++;if(g<l)this._swap(a,g,l),g++,l--;else return l}},"_partition")},{key:"_get",value:O(function(a,o){return a instanceof t?a.get_object_at(o):a[o]},"_get")},{key:"_set",value:O(function(a,o,p){a instanceof t?a.set_object_at(o,p):a[o]=p},"_set")},{key:"_swap",value:O(function(a,o,p){var n=this._get(a,o);this._set(a,o,this._get(a,p)),this._set(a,p,n)},"_swap")},{key:"_defaultCompareFunction",value:O(function(a,o){return o>a},"_defaultCompareFunction")}]),h}();m.exports=r},function(m,L,N){var i=function(){function r(h,a){for(var o=0;o<a.length;o++){var p=a[o];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}return O(r,"defineProperties"),function(h,a,o){return a&&r(h.prototype,a),o&&r(h,o),h}}();function e(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}O(e,"_classCallCheck");var t=function(){function r(h,a){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1;e(this,r),this.sequence1=h,this.sequence2=a,this.match_score=o,this.mismatch_penalty=p,this.gap_penalty=n,this.iMax=h.length+1,this.jMax=a.length+1,this.grid=new Array(this.iMax);for(var g=0;g<this.iMax;g++){this.grid[g]=new Array(this.jMax);for(var l=0;l<this.jMax;l++)this.grid[g][l]=0}this.tracebackGrid=new Array(this.iMax);for(var f=0;f<this.iMax;f++){this.tracebackGrid[f]=new Array(this.jMax);for(var E=0;E<this.jMax;E++)this.tracebackGrid[f][E]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return O(r,"NeedlemanWunsch"),i(r,[{key:"getScore",value:O(function(){return this.score},"getScore")},{key:"getAlignments",value:O(function(){return this.alignments},"getAlignments")},{key:"computeGrids",value:O(function(){for(var h=1;h<this.jMax;h++)this.grid[0][h]=this.grid[0][h-1]+this.gap_penalty,this.tracebackGrid[0][h]=[!1,!1,!0];for(var a=1;a<this.iMax;a++)this.grid[a][0]=this.grid[a-1][0]+this.gap_penalty,this.tracebackGrid[a][0]=[!1,!0,!1];for(var o=1;o<this.iMax;o++)for(var p=1;p<this.jMax;p++){var n=void 0;this.sequence1[o-1]===this.sequence2[p-1]?n=this.grid[o-1][p-1]+this.match_score:n=this.grid[o-1][p-1]+this.mismatch_penalty;var g=this.grid[o-1][p]+this.gap_penalty,l=this.grid[o][p-1]+this.gap_penalty,f=[n,g,l],E=this.arrayAllMaxIndexes(f);this.grid[o][p]=f[E[0]],this.tracebackGrid[o][p]=[E.includes(0),E.includes(1),E.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]},"computeGrids")},{key:"alignmentTraceback",value:O(function(){var h=[];for(h.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});h[0];){var a=h[0],o=this.tracebackGrid[a.pos[0]][a.pos[1]];o[0]&&h.push({pos:[a.pos[0]-1,a.pos[1]-1],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),o[1]&&h.push({pos:[a.pos[0]-1,a.pos[1]],seq1:this.sequence1[a.pos[0]-1]+a.seq1,seq2:"-"+a.seq2}),o[2]&&h.push({pos:[a.pos[0],a.pos[1]-1],seq1:"-"+a.seq1,seq2:this.sequence2[a.pos[1]-1]+a.seq2}),a.pos[0]===0&&a.pos[1]===0&&this.alignments.push({sequence1:a.seq1,sequence2:a.seq2}),h.shift()}return this.alignments},"alignmentTraceback")},{key:"getAllIndexes",value:O(function(h,a){for(var o=[],p=-1;(p=h.indexOf(a,p+1))!==-1;)o.push(p);return o},"getAllIndexes")},{key:"arrayAllMaxIndexes",value:O(function(h){return this.getAllIndexes(h,Math.max.apply(null,h))},"arrayAllMaxIndexes")}]),r}();m.exports=t},function(m,L,N){var i=O(function(){},"layoutBase");i.FDLayout=N(18),i.FDLayoutConstants=N(7),i.FDLayoutEdge=N(19),i.FDLayoutNode=N(20),i.DimensionD=N(21),i.HashMap=N(22),i.HashSet=N(23),i.IGeometry=N(8),i.IMath=N(9),i.Integer=N(10),i.Point=N(12),i.PointD=N(4),i.RandomSeed=N(16),i.RectangleD=N(13),i.Transform=N(17),i.UniqueIDGeneretor=N(14),i.Quicksort=N(24),i.LinkedList=N(11),i.LGraphObject=N(2),i.LGraph=N(5),i.LEdge=N(1),i.LGraphManager=N(6),i.LNode=N(3),i.Layout=N(15),i.LayoutConstants=N(0),i.NeedlemanWunsch=N(25),m.exports=i},function(m,L,N){function i(){this.listeners=[]}O(i,"Emitter");var e=i.prototype;e.addListener=function(t,r){this.listeners.push({event:t,callback:r})},e.removeListener=function(t,r){for(var h=this.listeners.length;h>=0;h--){var a=this.listeners[h];a.event===t&&a.callback===r&&this.listeners.splice(h,1)}},e.emit=function(t,r){for(var h=0;h<this.listeners.length;h++){var a=this.listeners[h];t===a.event&&a.callback(r)}},m.exports=i}])})}),Q=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Z()):typeof define=="function"&&define.amd?define(["layout-base"],L):typeof C=="object"?C.coseBase=L(Z()):m.coseBase=L(m.layoutBase)},"webpackUniversalModuleDefinition")(C,function(m){return function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=7)}([function(L,N){L.exports=m},function(L,N,i){var e=i(0).FDLayoutConstants;function t(){}O(t,"CoSEConstants");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,L.exports=t},function(L,N,i){var e=i(0).FDLayoutEdge;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEEdge"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).LGraph;function t(h,a,o){e.call(this,h,a,o)}O(t,"CoSEGraph"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).LGraphManager;function t(h){e.call(this,h)}O(t,"CoSEGraphManager"),t.prototype=Object.create(e.prototype);for(var r in e)t[r]=e[r];L.exports=t},function(L,N,i){var e=i(0).FDLayoutNode,t=i(0).IMath;function r(a,o,p,n){e.call(this,a,o,p,n)}O(r,"CoSENode"),r.prototype=Object.create(e.prototype);for(var h in e)r[h]=e[h];r.prototype.move=function(){var a=this.graphManager.getLayout();this.displacementX=a.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=a.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementX=a.coolingFactor*a.maxNodeDisplacement*t.sign(this.displacementX)),Math.abs(this.displacementY)>a.coolingFactor*a.maxNodeDisplacement&&(this.displacementY=a.coolingFactor*a.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),a.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(a,o){for(var p=this.getChild().getNodes(),n,g=0;g<p.length;g++)n=p[g],n.getChild()==null?(n.moveBy(a,o),n.displacementX+=a,n.displacementY+=o):n.propogateDisplacementToChildren(a,o)},r.prototype.setPred1=function(a){this.pred1=a},r.prototype.getPred1=function(){return pred1},r.prototype.getPred2=function(){return pred2},r.prototype.setNext=function(a){this.next=a},r.prototype.getNext=function(){return next},r.prototype.setProcessed=function(a){this.processed=a},r.prototype.isProcessed=function(){return processed},L.exports=r},function(L,N,i){var e=i(0).FDLayout,t=i(4),r=i(3),h=i(5),a=i(2),o=i(1),p=i(0).FDLayoutConstants,n=i(0).LayoutConstants,g=i(0).Point,l=i(0).PointD,f=i(0).Layout,E=i(0).Integer,y=i(0).IGeometry,d=i(0).LGraph,A=i(0).Transform;function v(){e.call(this),this.toBeTiled={}}O(v,"CoSELayout"),v.prototype=Object.create(e.prototype);for(var I in e)v[I]=e[I];v.prototype.newGraphManager=function(){var s=new t(this);return this.graphManager=s,s},v.prototype.newGraph=function(s){return new r(null,this.graphManager,s)},v.prototype.newNode=function(s){return new h(this.graphManager,s)},v.prototype.newEdge=function(s){return new a(null,null,s)},v.prototype.initParameters=function(){e.prototype.initParameters.call(this,arguments),this.isSubLayout||(o.DEFAULT_EDGE_LENGTH<10?this.idealEdgeLength=10:this.idealEdgeLength=o.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=o.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)},v.prototype.layout=function(){var s=n.DEFAULT_CREATE_BENDS_AS_NEEDED;return s&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},v.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(o.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(_){return s.has(_)});this.graphManager.setAllNodesToApplyGravitation(u)}}else{var c=this.getFlatForest();if(c.length>0)this.positionNodesRadially(c);else{this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(w){return s.has(w)});this.graphManager.setAllNodesToApplyGravitation(u),this.positionNodesRandomly()}}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},v.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 s=new Set(this.getAllNodes()),u=this.nodesWithGravity.filter(function(T){return s.has(T)});this.graphManager.setAllNodesToApplyGravitation(u),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 c=!this.isTreeGrowing&&!this.isGrowthFinished,_=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(c,_),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},v.prototype.getPositionsData=function(){for(var s=this.graphManager.getAllNodes(),u={},c=0;c<s.length;c++){var _=s[c].rect,T=s[c].id;u[T]={id:T,x:_.getCenterX(),y:_.getCenterY(),w:_.width,h:_.height}}return u},v.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var s=!1;if(p.ANIMATE==="during")this.emit("layoutstarted");else{for(;!s;)s=this.tick();this.graphManager.updateBounds()}},v.prototype.calculateNodesToApplyGravitationTo=function(){var s=[],u,c=this.graphManager.getGraphs(),_=c.length,T;for(T=0;T<_;T++)u=c[T],u.updateConnected(),u.isConnected||(s=s.concat(u.getNodes()));return s},v.prototype.createBendpoints=function(){var s=[];s=s.concat(this.graphManager.getAllEdges());var u=new Set,c;for(c=0;c<s.length;c++){var _=s[c];if(!u.has(_)){var T=_.getSource(),w=_.getTarget();if(T==w)_.getBendpoints().push(new l),_.getBendpoints().push(new l),this.createDummyNodesForBendpoints(_),u.add(_);else{var D=[];if(D=D.concat(T.getEdgeListToNode(w)),D=D.concat(w.getEdgeListToNode(T)),!u.has(D[0])){if(D.length>1){var M;for(M=0;M<D.length;M++){var R=D[M];R.getBendpoints().push(new l),this.createDummyNodesForBendpoints(R)}}D.forEach(function(F){u.add(F)})}}}if(u.size==s.length)break}},v.prototype.positionNodesRadially=function(s){for(var u=new g(0,0),c=Math.ceil(Math.sqrt(s.length)),_=0,T=0,w=0,D=new l(0,0),M=0;M<s.length;M++){M%c==0&&(w=0,T=_,M!=0&&(T+=o.DEFAULT_COMPONENT_SEPERATION),_=0);var R=s[M],F=f.findCenterOfTree(R);u.x=w,u.y=T,D=v.radialLayout(R,F,u),D.y>_&&(_=Math.floor(D.y)),w=Math.floor(D.x+o.DEFAULT_COMPONENT_SEPERATION)}this.transform(new l(n.WORLD_CENTER_X-D.x/2,n.WORLD_CENTER_Y-D.y/2))},v.radialLayout=function(s,u,c){var _=Math.max(this.maxDiagonalInTree(s),o.DEFAULT_RADIAL_SEPARATION);v.branchRadialLayout(u,null,0,359,0,_);var T=d.calculateBounds(s),w=new A;w.setDeviceOrgX(T.getMinX()),w.setDeviceOrgY(T.getMinY()),w.setWorldOrgX(c.x),w.setWorldOrgY(c.y);for(var D=0;D<s.length;D++){var M=s[D];M.transform(w)}var R=new l(T.getMaxX(),T.getMaxY());return w.inverseTransformPoint(R)},v.branchRadialLayout=function(s,u,c,_,T,w){var D=(_-c+1)/2;D<0&&(D+=180);var M=(D+c)%360,R=M*y.TWO_PI/360,F=T*Math.cos(R),S=T*Math.sin(R);s.setCenter(F,S);var x=[];x=x.concat(s.getEdges());var G=x.length;u!=null&&G--;for(var b=0,P=x.length,U,Y=s.getEdgesBetween(u);Y.length>1;){var B=Y[0];Y.splice(0,1);var k=x.indexOf(B);k>=0&&x.splice(k,1),P--,G--}u!=null?U=(x.indexOf(Y[0])+1)%P:U=0;for(var H=Math.abs(_-c)/G,W=U;b!=G;W=++W%P){var q=x[W].getOtherEnd(s);if(q!=u){var z=(c+b*H)%360,ot=(z+H)%360;v.branchRadialLayout(q,s,z,ot,T+w,w),b++}}},v.maxDiagonalInTree=function(s){for(var u=E.MIN_VALUE,c=0;c<s.length;c++){var _=s[c],T=_.getDiagonal();T>u&&(u=T)}return u},v.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},v.prototype.groupZeroDegreeMembers=function(){var s=this,u={};this.memberGroups={},this.idToDummyNode={};for(var c=[],_=this.graphManager.getAllNodes(),T=0;T<_.length;T++){var w=_[T],D=w.getParent();this.getNodeDegreeWithChildren(w)===0&&(D.id==null||!this.getToBeTiled(D))&&c.push(w)}for(var T=0;T<c.length;T++){var w=c[T],M=w.getParent().id;typeof u[M]>"u"&&(u[M]=[]),u[M]=u[M].concat(w)}Object.keys(u).forEach(function(R){if(u[R].length>1){var F="DummyCompound_"+R;s.memberGroups[F]=u[R];var S=u[R][0].getParent(),x=new h(s.graphManager);x.id=F,x.paddingLeft=S.paddingLeft||0,x.paddingRight=S.paddingRight||0,x.paddingBottom=S.paddingBottom||0,x.paddingTop=S.paddingTop||0,s.idToDummyNode[F]=x;var G=s.getGraphManager().add(s.newGraph(),x),b=S.getChild();b.add(x);for(var P=0;P<u[R].length;P++){var U=u[R][P];b.remove(U),G.add(U)}}})},v.prototype.clearCompounds=function(){var s={},u={};this.performDFSOnCompounds();for(var c=0;c<this.compoundOrder.length;c++)u[this.compoundOrder[c].id]=this.compoundOrder[c],s[this.compoundOrder[c].id]=[].concat(this.compoundOrder[c].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[c].getChild()),this.compoundOrder[c].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(s,u)},v.prototype.clearZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(c){var _=s.idToDummyNode[c];u[c]=s.tileNodes(s.memberGroups[c],_.paddingLeft+_.paddingRight),_.rect.width=u[c].width,_.rect.height=u[c].height})},v.prototype.repopulateCompounds=function(){for(var s=this.compoundOrder.length-1;s>=0;s--){var u=this.compoundOrder[s],c=u.id,_=u.paddingLeft,T=u.paddingTop;this.adjustLocations(this.tiledMemberPack[c],u.rect.x,u.rect.y,_,T)}},v.prototype.repopulateZeroDegreeMembers=function(){var s=this,u=this.tiledZeroDegreePack;Object.keys(u).forEach(function(c){var _=s.idToDummyNode[c],T=_.paddingLeft,w=_.paddingTop;s.adjustLocations(u[c],_.rect.x,_.rect.y,T,w)})},v.prototype.getToBeTiled=function(s){var u=s.id;if(this.toBeTiled[u]!=null)return this.toBeTiled[u];var c=s.getChild();if(c==null)return this.toBeTiled[u]=!1,!1;for(var _=c.getNodes(),T=0;T<_.length;T++){var w=_[T];if(this.getNodeDegree(w)>0)return this.toBeTiled[u]=!1,!1;if(w.getChild()==null){this.toBeTiled[w.id]=!1;continue}if(!this.getToBeTiled(w))return this.toBeTiled[u]=!1,!1}return this.toBeTiled[u]=!0,!0},v.prototype.getNodeDegree=function(s){for(var u=s.id,c=s.getEdges(),_=0,T=0;T<c.length;T++){var w=c[T];w.getSource().id!==w.getTarget().id&&(_=_+1)}return _},v.prototype.getNodeDegreeWithChildren=function(s){var u=this.getNodeDegree(s);if(s.getChild()==null)return u;for(var c=s.getChild().getNodes(),_=0;_<c.length;_++){var T=c[_];u+=this.getNodeDegreeWithChildren(T)}return u},v.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},v.prototype.fillCompexOrderByDFS=function(s){for(var u=0;u<s.length;u++){var c=s[u];c.getChild()!=null&&this.fillCompexOrderByDFS(c.getChild().getNodes()),this.getToBeTiled(c)&&this.compoundOrder.push(c)}},v.prototype.adjustLocations=function(s,u,c,_,T){u+=_,c+=T;for(var w=u,D=0;D<s.rows.length;D++){var M=s.rows[D];u=w;for(var R=0,F=0;F<M.length;F++){var S=M[F];S.rect.x=u,S.rect.y=c,u+=S.rect.width+s.horizontalPadding,S.rect.height>R&&(R=S.rect.height)}c+=R+s.verticalPadding}},v.prototype.tileCompoundMembers=function(s,u){var c=this;this.tiledMemberPack=[],Object.keys(s).forEach(function(_){var T=u[_];c.tiledMemberPack[_]=c.tileNodes(s[_],T.paddingLeft+T.paddingRight),T.rect.width=c.tiledMemberPack[_].width,T.rect.height=c.tiledMemberPack[_].height})},v.prototype.tileNodes=function(s,u){var c=o.TILING_PADDING_VERTICAL,_=o.TILING_PADDING_HORIZONTAL,T={rows:[],rowWidth:[],rowHeight:[],width:0,height:u,verticalPadding:c,horizontalPadding:_};s.sort(function(M,R){return M.rect.width*M.rect.height>R.rect.width*R.rect.height?-1:M.rect.width*M.rect.height<R.rect.width*R.rect.height?1:0});for(var w=0;w<s.length;w++){var D=s[w];T.rows.length==0?this.insertNodeToRow(T,D,0,u):this.canAddHorizontal(T,D.rect.width,D.rect.height)?this.insertNodeToRow(T,D,this.getShortestRowIndex(T),u):this.insertNodeToRow(T,D,T.rows.length,u),this.shiftToLastRow(T)}return T},v.prototype.insertNodeToRow=function(s,u,c,_){var T=_;if(c==s.rows.length){var w=[];s.rows.push(w),s.rowWidth.push(T),s.rowHeight.push(0)}var D=s.rowWidth[c]+u.rect.width;s.rows[c].length>0&&(D+=s.horizontalPadding),s.rowWidth[c]=D,s.width<D&&(s.width=D);var M=u.rect.height;c>0&&(M+=s.verticalPadding);var R=0;M>s.rowHeight[c]&&(R=s.rowHeight[c],s.rowHeight[c]=M,R=s.rowHeight[c]-R),s.height+=R,s.rows[c].push(u)},v.prototype.getShortestRowIndex=function(s){for(var u=-1,c=Number.MAX_VALUE,_=0;_<s.rows.length;_++)s.rowWidth[_]<c&&(u=_,c=s.rowWidth[_]);return u},v.prototype.getLongestRowIndex=function(s){for(var u=-1,c=Number.MIN_VALUE,_=0;_<s.rows.length;_++)s.rowWidth[_]>c&&(u=_,c=s.rowWidth[_]);return u},v.prototype.canAddHorizontal=function(s,u,c){var _=this.getShortestRowIndex(s);if(_<0)return!0;var T=s.rowWidth[_];if(T+s.horizontalPadding+u<=s.width)return!0;var w=0;s.rowHeight[_]<c&&_>0&&(w=c+s.verticalPadding-s.rowHeight[_]);var D;s.width-T>=u+s.horizontalPadding?D=(s.height+w)/(T+u+s.horizontalPadding):D=(s.height+w)/s.width,w=c+s.verticalPadding;var M;return s.width<u?M=(s.height+w)/u:M=(s.height+w)/s.width,M<1&&(M=1/M),D<1&&(D=1/D),D<M},v.prototype.shiftToLastRow=function(s){var u=this.getLongestRowIndex(s),c=s.rowWidth.length-1,_=s.rows[u],T=_[_.length-1],w=T.width+s.horizontalPadding;if(s.width-s.rowWidth[c]>w&&u!=c){_.splice(-1,1),s.rows[c].push(T),s.rowWidth[u]=s.rowWidth[u]-w,s.rowWidth[c]=s.rowWidth[c]+w,s.width=s.rowWidth[instance.getLongestRowIndex(s)];for(var D=Number.MIN_VALUE,M=0;M<_.length;M++)_[M].height>D&&(D=_[M].height);u>0&&(D+=s.verticalPadding);var R=s.rowHeight[u]+s.rowHeight[c];s.rowHeight[u]=D,s.rowHeight[c]<T.height+s.verticalPadding&&(s.rowHeight[c]=T.height+s.verticalPadding);var F=s.rowHeight[u]+s.rowHeight[c];s.height+=F-R,this.shiftToLastRow(s)}},v.prototype.tilingPreLayout=function(){o.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},v.prototype.tilingPostLayout=function(){o.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},v.prototype.reduceTrees=function(){for(var s=[],u=!0,c;u;){var _=this.graphManager.getAllNodes(),T=[];u=!1;for(var w=0;w<_.length;w++)c=_[w],c.getEdges().length==1&&!c.getEdges()[0].isInterGraph&&c.getChild()==null&&(T.push([c,c.getEdges()[0],c.getOwner()]),u=!0);if(u==!0){for(var D=[],M=0;M<T.length;M++)T[M][0].getEdges().length==1&&(D.push(T[M]),T[M][0].getOwner().remove(T[M][0]));s.push(D),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=s},v.prototype.growTree=function(s){for(var u=s.length,c=s[u-1],_,T=0;T<c.length;T++)_=c[T],this.findPlaceforPrunedNode(_),_[2].add(_[0]),_[2].add(_[1],_[1].source,_[1].target);s.splice(s.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},v.prototype.findPlaceforPrunedNode=function(s){var u,c,_=s[0];_==s[1].source?c=s[1].target:c=s[1].source;var T=c.startX,w=c.finishX,D=c.startY,M=c.finishY,R=0,F=0,S=0,x=0,G=[R,S,F,x];if(D>0)for(var b=T;b<=w;b++)G[0]+=this.grid[b][D-1].length+this.grid[b][D].length-1;if(w<this.grid.length-1)for(var b=D;b<=M;b++)G[1]+=this.grid[w+1][b].length+this.grid[w][b].length-1;if(M<this.grid[0].length-1)for(var b=T;b<=w;b++)G[2]+=this.grid[b][M+1].length+this.grid[b][M].length-1;if(T>0)for(var b=D;b<=M;b++)G[3]+=this.grid[T-1][b].length+this.grid[T][b].length-1;for(var P=E.MAX_VALUE,U,Y,B=0;B<G.length;B++)G[B]<P?(P=G[B],U=1,Y=B):G[B]==P&&U++;if(U==3&&P==0)G[0]==0&&G[1]==0&&G[2]==0?u=1:G[0]==0&&G[1]==0&&G[3]==0?u=0:G[0]==0&&G[2]==0&&G[3]==0?u=3:G[1]==0&&G[2]==0&&G[3]==0&&(u=2);else if(U==2&&P==0){var k=Math.floor(Math.random()*2);G[0]==0&&G[1]==0?k==0?u=0:u=1:G[0]==0&&G[2]==0?k==0?u=0:u=2:G[0]==0&&G[3]==0?k==0?u=0:u=3:G[1]==0&&G[2]==0?k==0?u=1:u=2:G[1]==0&&G[3]==0?k==0?u=1:u=3:k==0?u=2:u=3}else if(U==4&&P==0){var k=Math.floor(Math.random()*4);u=k}else u=Y;u==0?_.setCenter(c.getCenterX(),c.getCenterY()-c.getHeight()/2-p.DEFAULT_EDGE_LENGTH-_.getHeight()/2):u==1?_.setCenter(c.getCenterX()+c.getWidth()/2+p.DEFAULT_EDGE_LENGTH+_.getWidth()/2,c.getCenterY()):u==2?_.setCenter(c.getCenterX(),c.getCenterY()+c.getHeight()/2+p.DEFAULT_EDGE_LENGTH+_.getHeight()/2):_.setCenter(c.getCenterX()-c.getWidth()/2-p.DEFAULT_EDGE_LENGTH-_.getWidth()/2,c.getCenterY())},L.exports=v},function(L,N,i){var e={};e.layoutBase=i(0),e.CoSEConstants=i(1),e.CoSEEdge=i(2),e.CoSEGraph=i(3),e.CoSEGraphManager=i(4),e.CoSELayout=i(6),e.CoSENode=i(5),L.exports=e}])})}),ht=V((C,X)=>{O(function(m,L){typeof C=="object"&&typeof X=="object"?X.exports=L(Q()):typeof define=="function"&&define.amd?define(["cose-base"],L):typeof C=="object"?C.cytoscapeCoseBilkent=L(Q()):m.cytoscapeCoseBilkent=L(m.coseBase)},"webpackUniversalModuleDefinition")(C,function(m){return function(L){var N={};function i(e){if(N[e])return N[e].exports;var t=N[e]={i:e,l:!1,exports:{}};return L[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return O(i,"__webpack_require__"),i.m=L,i.c=N,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.n=function(e){var t=e&&e.__esModule?O(function(){return e.default},"getDefault"):O(function(){return e},"getModuleExports");return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(L,N){L.exports=m},function(L,N,i){var e=i(0).layoutBase.LayoutConstants,t=i(0).layoutBase.FDLayoutConstants,r=i(0).CoSEConstants,h=i(0).CoSELayout,a=i(0).CoSENode,o=i(0).layoutBase.PointD,p=i(0).layoutBase.DimensionD,n={ready:O(function(){},"ready"),stop:O(function(){},"stop"),quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function g(y,d){var A={};for(var v in y)A[v]=y[v];for(var v in d)A[v]=d[v];return A}O(g,"extend");function l(y){this.options=g(n,y),f(this.options)}O(l,"_CoSELayout");var f=O(function(y){y.nodeRepulsion!=null&&(r.DEFAULT_REPULSION_STRENGTH=t.DEFAULT_REPULSION_STRENGTH=y.nodeRepulsion),y.idealEdgeLength!=null&&(r.DEFAULT_EDGE_LENGTH=t.DEFAULT_EDGE_LENGTH=y.idealEdgeLength),y.edgeElasticity!=null&&(r.DEFAULT_SPRING_STRENGTH=t.DEFAULT_SPRING_STRENGTH=y.edgeElasticity),y.nestingFactor!=null&&(r.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=t.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=y.nestingFactor),y.gravity!=null&&(r.DEFAULT_GRAVITY_STRENGTH=t.DEFAULT_GRAVITY_STRENGTH=y.gravity),y.numIter!=null&&(r.MAX_ITERATIONS=t.MAX_ITERATIONS=y.numIter),y.gravityRange!=null&&(r.DEFAULT_GRAVITY_RANGE_FACTOR=t.DEFAULT_GRAVITY_RANGE_FACTOR=y.gravityRange),y.gravityCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_STRENGTH=t.DEFAULT_COMPOUND_GRAVITY_STRENGTH=y.gravityCompound),y.gravityRangeCompound!=null&&(r.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=t.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=y.gravityRangeCompound),y.initialEnergyOnIncremental!=null&&(r.DEFAULT_COOLING_FACTOR_INCREMENTAL=t.DEFAULT_COOLING_FACTOR_INCREMENTAL=y.initialEnergyOnIncremental),y.quality=="draft"?e.QUALITY=0:y.quality=="proof"?e.QUALITY=2:e.QUALITY=1,r.NODE_DIMENSIONS_INCLUDE_LABELS=t.NODE_DIMENSIONS_INCLUDE_LABELS=e.NODE_DIMENSIONS_INCLUDE_LABELS=y.nodeDimensionsIncludeLabels,r.DEFAULT_INCREMENTAL=t.DEFAULT_INCREMENTAL=e.DEFAULT_INCREMENTAL=!y.randomize,r.ANIMATE=t.ANIMATE=e.ANIMATE=y.animate,r.TILE=y.tile,r.TILING_PADDING_VERTICAL=typeof y.tilingPaddingVertical=="function"?y.tilingPaddingVertical.call():y.tilingPaddingVertical,r.TILING_PADDING_HORIZONTAL=typeof y.tilingPaddingHorizontal=="function"?y.tilingPaddingHorizontal.call():y.tilingPaddingHorizontal},"getUserOptions");l.prototype.run=function(){var y,d,A=this.options;this.idToLNode={};var v=this.layout=new h,I=this;I.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var s=v.newGraphManager();this.gm=s;var u=this.options.eles.nodes(),c=this.options.eles.edges();this.root=s.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(u),v);for(var _=0;_<c.length;_++){var T=c[_],w=this.idToLNode[T.data("source")],D=this.idToLNode[T.data("target")];if(w!==D&&w.getEdgesBetween(D).length==0){var M=s.add(v.newEdge(),w,D);M.id=T.id()}}var R=O(function(S,x){typeof S=="number"&&(S=x);var G=S.data("id"),b=I.idToLNode[G];return{x:b.getRect().getCenterX(),y:b.getRect().getCenterY()}},"getPositions"),F=O(function S(){for(var x=O(function(){A.fit&&A.cy.fit(A.eles,A.padding),y||(y=!0,I.cy.one("layoutready",A.ready),I.cy.trigger({type:"layoutready",layout:I}))},"afterReposition"),G=I.options.refresh,b,P=0;P<G&&!b;P++)b=I.stopped||I.layout.tick();if(b){v.checkLayoutSuccess()&&!v.isSubLayout&&v.doPostLayout(),v.tilingPostLayout&&v.tilingPostLayout(),v.isLayoutFinished=!0,I.options.eles.nodes().positions(R),x(),I.cy.one("layoutstop",I.options.stop),I.cy.trigger({type:"layoutstop",layout:I}),d&&cancelAnimationFrame(d),y=!1;return}var U=I.layout.getPositionsData();A.eles.nodes().positions(function(Y,B){if(typeof Y=="number"&&(Y=B),!Y.isParent()){for(var k=Y.id(),H=U[k],W=Y;H==null&&(H=U[W.data("parent")]||U["DummyCompound_"+W.data("parent")],U[k]=H,W=W.parent()[0],W!=null););return H!=null?{x:H.x,y:H.y}:{x:Y.position("x"),y:Y.position("y")}}}),x(),d=requestAnimationFrame(S)},"iterateAnimated");return v.addListener("layoutstarted",function(){I.options.animate==="during"&&(d=requestAnimationFrame(F))}),v.runLayout(),this.options.animate!=="during"&&(I.options.eles.nodes().not(":parent").layoutPositions(I,I.options,R),y=!1),this},l.prototype.getTopMostNodes=function(y){for(var d={},A=0;A<y.length;A++)d[y[A].id()]=!0;var v=y.filter(function(I,s){typeof I=="number"&&(I=s);for(var u=I.parent()[0];u!=null;){if(d[u.id()])return!1;u=u.parent()[0]}return!0});return v},l.prototype.processChildrenList=function(y,d,A){for(var v=d.length,I=0;I<v;I++){var s=d[I],u=s.children(),c,_=s.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if(s.outerWidth()!=null&&s.outerHeight()!=null?c=y.add(new a(A.graphManager,new o(s.position("x")-_.w/2,s.position("y")-_.h/2),new p(parseFloat(_.w),parseFloat(_.h)))):c=y.add(new a(this.graphManager)),c.id=s.data("id"),c.paddingLeft=parseInt(s.css("padding")),c.paddingTop=parseInt(s.css("padding")),c.paddingRight=parseInt(s.css("padding")),c.paddingBottom=parseInt(s.css("padding")),this.options.nodeDimensionsIncludeLabels&&s.isParent()){var T=s.boundingBox({includeLabels:!0,includeNodes:!1}).w,w=s.boundingBox({includeLabels:!0,includeNodes:!1}).h,D=s.css("text-halign");c.labelWidth=T,c.labelHeight=w,c.labelPos=D}if(this.idToLNode[s.data("id")]=c,isNaN(c.rect.x)&&(c.rect.x=0),isNaN(c.rect.y)&&(c.rect.y=0),u!=null&&u.length>0){var M;M=A.getGraphManager().add(A.newGraph(),c),this.processChildrenList(M,u,A)}}},l.prototype.stop=function(){return this.stopped=!0,this};var E=O(function(y){y("layout","cose-bilkent",l)},"register");typeof cytoscape<"u"&&E(cytoscape),L.exports=E}])})}),lt=at(ht());$.use(lt.default);function K(C,X){C.forEach(m=>{let L={id:m.id,labelText:m.label,height:m.height,width:m.width,padding:m.padding??0};Object.keys(m).forEach(N=>{["id","label","height","width","padding","x","y"].includes(N)||(L[N]=m[N])}),X.add({group:"nodes",data:L,position:{x:m.x??0,y:m.y??0}})})}O(K,"addNodes");function J(C,X){C.forEach(m=>{let L={id:m.id,source:m.start,target:m.end};Object.keys(m).forEach(N=>{["id","start","end"].includes(N)||(L[N]=m[N])}),X.add({group:"edges",data:L})})}O(J,"addEdges");function tt(C){return new Promise(X=>{let m=st("body").append("div").attr("id","cy").attr("style","display:none"),L=$({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});m.remove(),K(C.nodes,L),J(C.edges,L),L.nodes().forEach(function(i){i.layoutDimensions=()=>{let e=i.data();return{w:e.width,h:e.height}}});let N={name:"cose-bilkent",quality:"proof",styleEnabled:!1,animate:!1};L.layout(N).run(),L.ready(i=>{j.info("Cytoscape ready",i),X(L)})})}O(tt,"createCytoscapeInstance");function et(C){return C.nodes().map(X=>{let m=X.data(),L=X.position(),N={id:m.id,x:L.x,y:L.y};return Object.keys(m).forEach(i=>{i!=="id"&&(N[i]=m[i])}),N})}O(et,"extractPositionedNodes");function rt(C){return C.edges().map(X=>{let m=X.data(),L=X._private.rscratch,N={id:m.id,source:m.source,target:m.target,startX:L.startX,startY:L.startY,midX:L.midX,midY:L.midY,endX:L.endX,endY:L.endY};return Object.keys(m).forEach(i=>{["id","source","target"].includes(i)||(N[i]=m[i])}),N})}O(rt,"extractPositionedEdges");async function it(C,X){j.debug("Starting cose-bilkent layout algorithm");try{nt(C);let m=await tt(C),L=et(m),N=rt(m);return j.debug(`Layout completed: ${L.length} nodes, ${N.length} edges`),{nodes:L,edges:N}}catch(m){throw j.error("Error in cose-bilkent layout algorithm:",m),m}}O(it,"executeCoseBilkentLayout");function nt(C){if(!C)throw new Error("Layout data is required");if(!C.config)throw new Error("Configuration is required in layout data");if(!C.rootNode)throw new Error("Root node is required");if(!C.nodes||!Array.isArray(C.nodes))throw new Error("No nodes found in layout data");if(!Array.isArray(C.edges))throw new Error("Edges array is required in layout data");return!0}O(nt,"validateLayoutData");var gt=O(async(C,X,{insertCluster:m,insertEdge:L,insertEdgeLabel:N,insertMarkers:i,insertNode:e,log:t,positionEdgeLabel:r},{algorithm:h})=>{let a={},o={},p=X.select("g");i(p,C.markers,C.type,C.diagramId);let n=p.insert("g").attr("class","subgraphs"),g=p.insert("g").attr("class","edgePaths"),l=p.insert("g").attr("class","edgeLabels"),f=p.insert("g").attr("class","nodes");t.debug("Inserting nodes into DOM for dimension calculation"),await Promise.all(C.nodes.map(async d=>{if(d.isGroup){let A={...d};o[d.id]=A,a[d.id]=A,await m(n,d)}else{let A={...d};a[d.id]=A;let v=await e(f,d,{config:C.config,dir:C.direction||"TB"}),I=v.node().getBBox();A.width=I.width,A.height=I.height,A.domId=v,t.debug(`Node ${d.id} dimensions: ${I.width}x${I.height}`)}})),t.debug("Running cose-bilkent layout algorithm");let E={...C,nodes:C.nodes.map(d=>{let A=a[d.id];return{...d,width:A.width,height:A.height}})},y=await it(E,C.config);t.debug("Positioning nodes based on layout results"),y.nodes.forEach(d=>{let A=a[d.id];A!=null&&A.domId&&(A.domId.attr("transform",`translate(${d.x}, ${d.y})`),A.x=d.x,A.y=d.y,t.debug(`Positioned node ${A.id} at center (${d.x}, ${d.y})`))}),y.edges.forEach(d=>{let A=C.edges.find(v=>v.id===d.id);A&&(A.points=[{x:d.startX,y:d.startY},{x:d.midX,y:d.midY},{x:d.endX,y:d.endY}])}),t.debug("Inserting and positioning edges"),await Promise.all(C.edges.map(async d=>{await N(l,d);let A=a[d.start??""],v=a[d.end??""];if(A&&v){let I=y.edges.find(s=>s.id===d.id);if(I){t.debug("APA01 positionedEdge",I);let s={...d},u=L(g,s,o,C.type,A,v,C.diagramId);r(s,u)}else{let s={...d,points:[{x:A.x||0,y:A.y||0},{x:v.x||0,y:v.y||0}]},u=L(g,s,o,C.type,A,v,C.diagramId);r(s,u)}}})),t.debug("Cose-bilkent rendering completed")},"render"),dt=gt;export{dt as render};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{f as Y}from"./chunk-3YCYZ6SJ-CQkVgT_z.js";import{m as G}from"./chunk-HN6EAY2L-BBnyTNdB.js";import{m as w,bz as M,bA as $,bB as j,bC as H,p as a,q as _,bD as q,bE as W,aw as z,bF as Q,aD as Z,ax as D,av as K,bG as U,bH as V}from"./index-BgeqpYgd.js";import{s as S,_ as ee,J}from"./chunk-H3VCZNTA-Cx5XV_aC.js";function X(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:k(e),edges:P(e)};return S(e.graph())||(n.value=ee(e.graph())),n}w(X,"write");function k(e){return J(e.nodes(),function(n){var r=e.node(n),d=e.parent(n),l={v:n};return S(r)||(l.value=r),S(d)||(l.parent=d),l})}w(k,"writeNodes");function P(e){return J(e.edges(),function(n){var r=e.edge(n),d={v:n.v,w:n.w};return S(n.name)||(d.name=n.name),S(r)||(d.value=r),d})}w(P,"writeEdges");var c=new Map,E=new Map,B=new Map,re=w(()=>{E.clear(),B.clear(),c.clear()},"clear"),I=w((e,n)=>{let r=E.get(n)||[];return a.trace("In isDescendant",n," ",e," = ",r.includes(e)),r.includes(e)},"isDescendant"),ne=w((e,n)=>{let r=E.get(n)||[];return a.info("Descendants of ",n," is ",r),a.info("Edge is ",e),e.v===n||e.w===n?!1:r?r.includes(e.v)||I(e.v,n)||I(e.w,n)||r.includes(e.w):(a.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),A=w((e,n,r,d)=>{a.warn("Copying children of ",e,"root",d,"data",n.node(e),d);let l=n.children(e)||[];e!==d&&l.push(e),a.warn("Copying (nodes) clusterId",e,"nodes",l),l.forEach(o=>{if(n.children(o).length>0)A(o,n,r,d);else{let i=n.node(o);a.info("cp ",o," to ",d," with parent ",e),r.setNode(o,i),d!==n.parent(o)&&(a.warn("Setting parent",o,n.parent(o)),r.setParent(o,n.parent(o))),e!==d&&o!==e?(a.debug("Setting parent",o,e),r.setParent(o,e)):(a.info("In copy ",e,"root",d,"data",n.node(e),d),a.debug("Not Setting parent for node=",o,"cluster!==rootId",e!==d,"node!==clusterId",o!==e));let s=n.edges(o);a.debug("Copying Edges",s),s.forEach(u=>{a.info("Edge",u);let b=n.edge(u.v,u.w,u.name);a.info("Edge data",b,d);try{ne(u,d)?(a.info("Copying as ",u.v,u.w,b,u.name),r.setEdge(u.v,u.w,b,u.name),a.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):a.info("Skipping copy of edge ",u.v,"-->",u.w," rootId: ",d," clusterId:",e)}catch(N){a.error(N)}})}a.debug("Removing node",o),n.removeNode(o)})},"copy"),R=w((e,n)=>{let r=n.children(e),d=[...r];for(let l of r)B.set(l,e),d=[...d,...R(l,n)];return d},"extractDescendants"),te=w((e,n,r)=>{let d=e.edges().filter(s=>s.v===n||s.w===n),l=e.edges().filter(s=>s.v===r||s.w===r),o=d.map(s=>({v:s.v===n?r:s.v,w:s.w===n?n:s.w})),i=l.map(s=>({v:s.v,w:s.w}));return o.filter(s=>i.some(u=>s.v===u.v&&s.w===u.w))},"findCommonEdges"),x=w((e,n,r)=>{let d=n.children(e);if(a.trace("Searching children of id ",e,d),d.length<1)return e;let l;for(let o of d){let i=x(o,n,r),s=te(n,r,i);if(i)if(s.length>0)l=i;else return i}return l},"findNonClusterChild"),O=w(e=>!c.has(e)||!c.get(e).externalConnections?e:c.has(e)?c.get(e).id:e,"getAnchorId"),ae=w((e,n)=>{if(!e||n>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");e.nodes().forEach(function(r){e.children(r).length>0&&(a.warn("Cluster identified",r," Replacement id in edges: ",x(r,e,r)),E.set(r,R(r,e)),c.set(r,{id:x(r,e,r),clusterData:e.node(r)}))}),e.nodes().forEach(function(r){let d=e.children(r),l=e.edges();d.length>0?(a.debug("Cluster identified",r,E),l.forEach(o=>{let i=I(o.v,r),s=I(o.w,r);i^s&&(a.warn("Edge: ",o," leaves cluster ",r),a.warn("Descendants of XXX ",r,": ",E.get(r)),c.get(r).externalConnections=!0)})):a.debug("Not a cluster ",r,E)});for(let r of c.keys()){let d=c.get(r).id,l=e.parent(d);l!==r&&c.has(l)&&!c.get(l).externalConnections&&(c.get(r).id=l)}e.edges().forEach(function(r){let d=e.edge(r);a.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),a.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(e.edge(r)));let l=r.v,o=r.w;if(a.warn("Fix XXX",c,"ids:",r.v,r.w,"Translating: ",c.get(r.v)," --- ",c.get(r.w)),c.get(r.v)||c.get(r.w)){if(a.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),l=O(r.v),o=O(r.w),e.removeEdge(r.v,r.w,r.name),l!==r.v){let i=e.parent(l);c.get(i).externalConnections=!0,d.fromCluster=r.v}if(o!==r.w){let i=e.parent(o);c.get(i).externalConnections=!0,d.toCluster=r.w}a.warn("Fix Replacing with XXX",l,o,r.name),e.setEdge(l,o,d,r.name)}}),a.warn("Adjusted Graph",X(e)),T(e,0),a.trace(c)},"adjustClustersAndEdges"),T=w((e,n)=>{var l,o;if(a.warn("extractor - ",n,X(e),e.children("D")),n>10){a.error("Bailing out");return}let r=e.nodes(),d=!1;for(let i of r){let s=e.children(i);d=d||s.length>0}if(!d){a.debug("Done, no node has children",e.nodes());return}a.debug("Nodes = ",r,n);for(let i of r)if(a.debug("Extracting node",i,c,c.has(i)&&!c.get(i).externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",n),!c.has(i))a.debug("Not a cluster",i,n);else if(!c.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){a.warn("Cluster without external connections, without a parent and with children",i,n);let s=e.graph().rankdir==="TB"?"LR":"TB";(o=(l=c.get(i))==null?void 0:l.clusterData)!=null&&o.dir&&(s=c.get(i).clusterData.dir,a.warn("Fixing dir",c.get(i).clusterData.dir,s));let u=new G({multigraph:!0,compound:!0}).setGraph({rankdir:s,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});a.warn("Old graph before copy",X(e)),A(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:c.get(i).clusterData,label:c.get(i).label,graph:u}),a.warn("New graph after copy node: (",i,")",X(u)),a.debug("Old graph after copy",X(e))}else a.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!c.get(i).externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),n),a.debug(c);r=e.nodes(),a.warn("New list of nodes",r);for(let i of r){let s=e.node(i);a.warn(" Now next level",i,s),s!=null&&s.clusterNode&&T(s.graph,n+1)}},"extractor"),F=w((e,n)=>{if(n.length===0)return[];let r=Object.assign([],n);return n.forEach(d=>{let l=e.children(d),o=F(e,l);r=[...r,...o]}),r},"sorter"),ie=w(e=>F(e,e.children()),"sortNodesByHierarchy"),L=w(async(e,n,r,d,l,o)=>{a.warn("Graph in recursive render:XAX",X(n),l);let i=n.graph().rankdir;a.trace("Dir in recursive render - dir:",i);let s=e.insert("g").attr("class","root");n.nodes()?a.info("Recursive render XXX",n.nodes()):a.info("No nodes found for",n),n.edges().length>0&&a.info("Recursive edges",n.edge(n.edges()[0]));let u=s.insert("g").attr("class","clusters"),b=s.insert("g").attr("class","edgePaths"),N=s.insert("g").attr("class","edgeLabels"),p=s.insert("g").attr("class","nodes");await Promise.all(n.nodes().map(async function(g){let t=n.node(g);if(l!==void 0){let f=JSON.parse(JSON.stringify(l.clusterData));a.trace(`Setting data for parent cluster XXX
|
|
2
|
+
Node.id = `,g,`
|
|
3
|
+
data=`,f.height,`
|
|
4
|
+
Parent cluster`,l.height),n.setNode(l.id,f),n.parent(g)||(a.trace("Setting parent",g,l.id),n.setParent(g,l.id,f))}if(a.info("(Insert) Node XXX"+g+": "+JSON.stringify(n.node(g))),t==null?void 0:t.clusterNode){a.info("Cluster identified XBX",g,t.width,n.node(g));let{ranksep:f,nodesep:v}=n.graph();t.graph.setGraph({...t.graph.graph(),ranksep:f+25,nodesep:v});let m=await L(p,t.graph,r,d,n.node(g),o),C=m.elem;q(t,C),t.diff=m.diff||0,a.info("New compound node after recursive render XAX",g,"width",t.width,"height",t.height),W(C,t)}else n.children(g).length>0?(a.trace("Cluster - the non recursive path XBX",g,t.id,t,t.width,"Graph:",n),a.trace(x(t.id,n)),c.set(t.id,{id:x(t.id,n),node:t})):(a.trace("Node - the non recursive path XAX",g,p,n.node(g),i),await z(p,n.node(g),{config:o,dir:i}))})),await w(async()=>{let g=n.edges().map(async function(t){let f=n.edge(t.v,t.w,t.name);a.info("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),a.info("Edge "+t.v+" -> "+t.w+": ",t," ",JSON.stringify(n.edge(t))),a.info("Fix",c,"ids:",t.v,t.w,"Translating: ",c.get(t.v),c.get(t.w)),await Q(N,f)});await Promise.all(g)},"processEdges")(),a.info("Graph before layout:",JSON.stringify(X(n))),a.info("############################################# XXX"),a.info("### Layout ### XXX"),a.info("############################################# XXX"),Y(n),a.info("Graph after layout:",JSON.stringify(X(n)));let h=0,{subGraphTitleTotalMargin:y}=Z(o);return await Promise.all(ie(n).map(async function(g){var f;let t=n.node(g);if(a.info("Position XBX => "+g+": ("+t.x,","+t.y,") width: ",t.width," height: ",t.height),t==null?void 0:t.clusterNode)t.y+=y,a.info("A tainted cluster node XBX1",g,t.id,t.width,t.height,t.x,t.y,n.parent(g)),c.get(t.id).node=t,D(t);else if(n.children(g).length>0){a.info("A pure cluster node XBX1",g,t.id,t.x,t.y,t.width,t.height,n.parent(g)),t.height+=y,n.node(t.parentId);let v=(t==null?void 0:t.padding)/2||0,m=((f=t==null?void 0:t.labelBBox)==null?void 0:f.height)||0,C=m-v||0;a.debug("OffsetY",C,"labelHeight",m,"halfPadding",v),await K(u,t),c.get(t.id).node=t}else{let v=n.node(t.parentId);t.y+=y/2,a.info("A regular node XBX1 - using the padding",t.id,"parent",t.parentId,t.width,t.height,t.x,t.y,"offsetY",t.offsetY,"parent",v,v==null?void 0:v.offsetY,t),D(t)}})),n.edges().forEach(function(g){let t=n.edge(g);a.info("Edge "+g.v+" -> "+g.w+": "+JSON.stringify(t),t),t.points.forEach(C=>C.y+=y/2);let f=n.node(g.v);var v=n.node(g.w);let m=U(b,t,c,r,f,v,d);V(t,m)}),n.nodes().forEach(function(g){let t=n.node(g);a.info(g,t.type,t.diff),t.isGroup&&(h=t.diff)}),a.warn("Returning from recursive render XAX",s,h),{elem:s,diff:h}},"recursiveRender"),ge=w(async(e,n)=>{var o,i,s,u,b,N;let r=new G({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:((o=e.config)==null?void 0:o.nodeSpacing)||((s=(i=e.config)==null?void 0:i.flowchart)==null?void 0:s.nodeSpacing)||e.nodeSpacing,ranksep:((u=e.config)==null?void 0:u.rankSpacing)||((N=(b=e.config)==null?void 0:b.flowchart)==null?void 0:N.rankSpacing)||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),d=n.select("g");M(d,e.markers,e.type,e.diagramId),$(),j(),H(),re(),e.nodes.forEach(p=>{r.setNode(p.id,{...p}),p.parentId&&r.setParent(p.id,p.parentId)}),a.debug("Edges:",e.edges),e.edges.forEach(p=>{if(p.start===p.end){let h=p.start,y=h+"---"+h+"---1",g=h+"---"+h+"---2",t=r.node(h);r.setNode(y,{domId:y,id:y,parentId:t.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(y,t.parentId),r.setNode(g,{domId:g,id:g,parentId:t.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,t.parentId);let f=structuredClone(p),v=structuredClone(p),m=structuredClone(p);f.label="",f.arrowTypeEnd="none",f.id=h+"-cyclic-special-1",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=h+"-cyclic-special-mid",m.label="",t.isGroup&&(f.fromCluster=h,m.toCluster=h),m.id=h+"-cyclic-special-2",m.arrowTypeStart="none",r.setEdge(h,y,f,h+"-cyclic-special-0"),r.setEdge(y,g,v,h+"-cyclic-special-1"),r.setEdge(g,h,m,h+"-cyc<lic-special-2")}else r.setEdge(p.start,p.end,{...p},p.id)}),a.warn("Graph at first:",JSON.stringify(X(r))),ae(r),a.warn("Graph after XAX:",JSON.stringify(X(r)));let l=_();await L(d,r,e.type,e.diagramId,void 0,l)},"render");export{ge as render};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{c as S}from"./chunk-AEOMTBSW-BgTIXPsY.js";import{d as I}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{a as E,l as F,n as z,h as P,s as R,e as B,m as o,a7 as D,o as W,L as v,y as G,O as w,p as V,ac as _,b as j}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var x={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},b={axes:[],curves:[],options:x},h=structuredClone(b),H=G.radar,U=o(()=>v({...H,...w().radar}),"getConfig"),M=o(()=>h.axes,"getAxes"),Z=o(()=>h.curves,"getCurves"),q=o(()=>h.options,"getOptions"),J=o(a=>{h.axes=a.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),K=o(a=>{h.curves=a.map(t=>({name:t.name,label:t.label??t.name,entries:N(t.entries)}))},"setCurves"),N=o(a=>{if(a[0].axis==null)return a.map(e=>e.value);let t=M();if(t.length===0)throw new Error("Axes must be populated before curves for reference entries");return t.map(e=>{let r=a.find(i=>{var n;return((n=i.axis)==null?void 0:n.$refText)===e.name});if(r===void 0)throw new Error("Missing entry for axis "+e.label);return r.value})},"computeCurveEntries"),Q=o(a=>{var e,r,i,n,l;let t=a.reduce((s,c)=>(s[c.name]=c,s),{});h.options={showLegend:((e=t.showLegend)==null?void 0:e.value)??x.showLegend,ticks:((r=t.ticks)==null?void 0:r.value)??x.ticks,max:((i=t.max)==null?void 0:i.value)??x.max,min:((n=t.min)==null?void 0:n.value)??x.min,graticule:((l=t.graticule)==null?void 0:l.value)??x.graticule}},"setOptions"),X=o(()=>{W(),h=structuredClone(b)},"clear"),f={getAxes:M,getCurves:Z,getOptions:q,setAxes:J,setCurves:K,setOptions:Q,getConfig:U,clear:X,setAccTitle:B,getAccTitle:R,setDiagramTitle:P,getDiagramTitle:z,getAccDescription:F,setAccDescription:E},Y=o(a=>{S(a,f);let{axes:t,curves:e,options:r}=a;f.setAxes(t),f.setCurves(e),f.setOptions(r)},"populate"),tt={parse:o(async a=>{let t=await I("radar",a);V.debug(t),Y(t)},"parse")},et=o((a,t,e,r)=>{let i=r.db,n=i.getAxes(),l=i.getCurves(),s=i.getOptions(),c=i.getConfig(),d=i.getDiagramTitle(),p=D(t),g=at(p,c),u=s.max??Math.max(...l.map(y=>Math.max(...y.entries))),m=s.min,$=Math.min(c.width,c.height)/2;rt(g,n,$,s.ticks,s.graticule),it(g,n,$,c),C(g,n,l,m,u,s.graticule,c),k(g,l,s.showLegend,c),g.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),at=o((a,t)=>{let e=t.width+t.marginLeft+t.marginRight,r=t.height+t.marginTop+t.marginBottom,i={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return j(a,r,e,t.useMaxWidth??!0),a.attr("viewBox",`0 0 ${e} ${r}`),a.append("g").attr("transform",`translate(${i.x}, ${i.y})`)},"drawFrame"),rt=o((a,t,e,r,i)=>{if(i==="circle")for(let n=0;n<r;n++){let l=e*(n+1)/r;a.append("circle").attr("r",l).attr("class","radarGraticule")}else if(i==="polygon"){let n=t.length;for(let l=0;l<r;l++){let s=e*(l+1)/r,c=t.map((d,p)=>{let g=2*p*Math.PI/n-Math.PI/2,u=s*Math.cos(g),m=s*Math.sin(g);return`${u},${m}`}).join(" ");a.append("polygon").attr("points",c).attr("class","radarGraticule")}}},"drawGraticule"),it=o((a,t,e,r)=>{let i=t.length;for(let n=0;n<i;n++){let l=t[n].label,s=2*n*Math.PI/i-Math.PI/2;a.append("line").attr("x1",0).attr("y1",0).attr("x2",e*r.axisScaleFactor*Math.cos(s)).attr("y2",e*r.axisScaleFactor*Math.sin(s)).attr("class","radarAxisLine"),a.append("text").text(l).attr("x",e*r.axisLabelFactor*Math.cos(s)).attr("y",e*r.axisLabelFactor*Math.sin(s)).attr("class","radarAxisLabel")}},"drawAxes");function C(a,t,e,r,i,n,l){let s=t.length,c=Math.min(l.width,l.height)/2;e.forEach((d,p)=>{if(d.entries.length!==s)return;let g=d.entries.map((u,m)=>{let $=2*Math.PI*m/s-Math.PI/2,y=L(u,r,i,c),A=y*Math.cos($),O=y*Math.sin($);return{x:A,y:O}});n==="circle"?a.append("path").attr("d",T(g,l.curveTension)).attr("class",`radarCurve-${p}`):n==="polygon"&&a.append("polygon").attr("points",g.map(u=>`${u.x},${u.y}`).join(" ")).attr("class",`radarCurve-${p}`)})}o(C,"drawCurves");function L(a,t,e,r){let i=Math.min(Math.max(a,t),e);return r*(i-t)/(e-t)}o(L,"relativeRadius");function T(a,t){let e=a.length,r=`M${a[0].x},${a[0].y}`;for(let i=0;i<e;i++){let n=a[(i-1+e)%e],l=a[i],s=a[(i+1)%e],c=a[(i+2)%e],d={x:l.x+(s.x-n.x)*t,y:l.y+(s.y-n.y)*t},p={x:s.x-(c.x-l.x)*t,y:s.y-(c.y-l.y)*t};r+=` C${d.x},${d.y} ${p.x},${p.y} ${s.x},${s.y}`}return`${r} Z`}o(T,"closedRoundCurve");function k(a,t,e,r){if(!e)return;let i=(r.width/2+r.marginRight)*3/4,n=-(r.height/2+r.marginTop)*3/4,l=20;t.forEach((s,c)=>{let d=a.append("g").attr("transform",`translate(${i}, ${n+c*l})`);d.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${c}`),d.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(s.label)})}o(k,"drawLegend");var st={draw:et},nt=o((a,t)=>{let e="";for(let r=0;r<a.THEME_COLOR_LIMIT;r++){let i=a[`cScale${r}`];e+=`
|
|
2
|
+
.radarCurve-${r} {
|
|
3
|
+
color: ${i};
|
|
4
|
+
fill: ${i};
|
|
5
|
+
fill-opacity: ${t.curveOpacity};
|
|
6
|
+
stroke: ${i};
|
|
7
|
+
stroke-width: ${t.curveStrokeWidth};
|
|
8
|
+
}
|
|
9
|
+
.radarLegendBox-${r} {
|
|
10
|
+
fill: ${i};
|
|
11
|
+
fill-opacity: ${t.curveOpacity};
|
|
12
|
+
stroke: ${i};
|
|
13
|
+
}
|
|
14
|
+
`}return e},"genIndexStyles"),lt=o(a=>{let t=_(),e=w(),r=v(t,e.themeVariables),i=v(r.radar,a);return{themeVariables:r,radarOptions:i}},"buildRadarStyleOptions"),ot=o(({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
|
+
dominant-baseline: middle;
|
|
27
|
+
text-anchor: middle;
|
|
28
|
+
font-size: ${e.axisLabelFontSize}px;
|
|
29
|
+
color: ${e.axisColor};
|
|
30
|
+
}
|
|
31
|
+
.radarGraticule {
|
|
32
|
+
fill: ${e.graticuleColor};
|
|
33
|
+
fill-opacity: ${e.graticuleOpacity};
|
|
34
|
+
stroke: ${e.graticuleColor};
|
|
35
|
+
stroke-width: ${e.graticuleStrokeWidth};
|
|
36
|
+
}
|
|
37
|
+
.radarLegendText {
|
|
38
|
+
text-anchor: start;
|
|
39
|
+
font-size: ${e.legendFontSize}px;
|
|
40
|
+
dominant-baseline: hanging;
|
|
41
|
+
}
|
|
42
|
+
${nt(t,e)}
|
|
43
|
+
`},"styles"),ut={parser:tt,db:f,renderer:st,styles:ot};export{ut as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{c as v}from"./chunk-AEOMTBSW-BgTIXPsY.js";import{d as C}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{m as f,L as m,a7 as P,b as z,p as w,e as F,s as S,h as W,n as D,l as E,a as T,y as L,O as A,o as R}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var M=L.packet,u,y=(u=class{constructor(){this.packet=[],this.setAccTitle=F,this.getAccTitle=S,this.setDiagramTitle=W,this.getDiagramTitle=D,this.getAccDescription=E,this.setAccDescription=T}getConfig(){let t=m({...M,...A().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){R(),this.packet=[]}},f(u,"PacketDB"),u),O=1e4,Y=f((e,t)=>{v(e,t);let s=-1,r=[],l=1,{bitsPerRow:n}=t.getConfig();for(let{start:a,end:o,bits:c,label:d}of e.blocks){if(a!==void 0&&o!==void 0&&o<a)throw new Error(`Packet block ${a} - ${o} is invalid. End must be greater than start.`);if(a??(a=s+1),a!==s+1)throw new Error(`Packet block ${a} - ${o??a} is not contiguous. It should start from ${s+1}.`);if(c===0)throw new Error(`Packet block ${a} is invalid. Cannot have a zero bit field.`);for(o??(o=a+(c??1)-1),c??(c=o-a+1),s=o,w.debug(`Packet block ${a} - ${s} with label ${d}`);r.length<=n+1&&t.getPacket().length<O;){let[p,i]=H({start:a,end:o,bits:c,label:d},l,n);if(r.push(p),p.end+1===l*n&&(t.pushWord(r),r=[],l++),!i)break;({start:a,end:o,bits:c,label:d}=i)}}t.pushWord(r)},"populate"),H=f((e,t,s)=>{if(e.start===void 0)throw new Error("start should have been set during first phase");if(e.end===void 0)throw new Error("end should have been set during first phase");if(e.start>e.end)throw new Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*s)return[e,void 0];let r=t*s-1,l=t*s;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:l,end:e.end,label:e.label,bits:e.end-l}]},"getNextFittingBlock"),$={parser:{yy:void 0},parse:f(async e=>{var r;let t=await C("packet",e),s=(r=$.parser)==null?void 0:r.yy;if(!(s instanceof y))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.");w.debug(t),Y(t,s)},"parse")},N=f((e,t,s,r)=>{let l=r.db,n=l.getConfig(),{rowHeight:a,paddingY:o,bitWidth:c,bitsPerRow:d}=n,p=l.getPacket(),i=l.getDiagramTitle(),b=a+o,h=b*(p.length+1)-(i?0:a),k=c*d+2,g=P(t);g.attr("viewBox",`0 0 ${k} ${h}`),z(g,h,k,n.useMaxWidth);for(let[x,B]of p.entries())j(g,B,x,n);g.append("text").text(i).attr("x",k/2).attr("y",h-b/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),j=f((e,t,s,{rowHeight:r,paddingX:l,paddingY:n,bitWidth:a,bitsPerRow:o,showBits:c})=>{let d=e.append("g"),p=s*(r+n)+n;for(let i of t){let b=i.start%o*a+1,h=(i.end-i.start+1)*a-l;if(d.append("rect").attr("x",b).attr("y",p).attr("width",h).attr("height",r).attr("class","packetBlock"),d.append("text").attr("x",b+h/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(i.label),!c)continue;let k=i.end===i.start,g=p-2;d.append("text").attr("x",b+(k?h/2:0)).attr("y",g).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",k?"middle":"start").text(i.start),k||d.append("text").attr("x",b+h).attr("y",g).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(i.end)}},"drawWord"),q={draw:N},G={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},I=f(({packet:e}={})=>{let t=m(G,e);return`
|
|
2
|
+
.packetByte {
|
|
3
|
+
font-size: ${t.byteFontSize};
|
|
4
|
+
}
|
|
5
|
+
.packetByte.start {
|
|
6
|
+
fill: ${t.startByteColor};
|
|
7
|
+
}
|
|
8
|
+
.packetByte.end {
|
|
9
|
+
fill: ${t.endByteColor};
|
|
10
|
+
}
|
|
11
|
+
.packetLabel {
|
|
12
|
+
fill: ${t.labelColor};
|
|
13
|
+
font-size: ${t.labelFontSize};
|
|
14
|
+
}
|
|
15
|
+
.packetTitle {
|
|
16
|
+
fill: ${t.titleColor};
|
|
17
|
+
font-size: ${t.titleFontSize};
|
|
18
|
+
}
|
|
19
|
+
.packetBlock {
|
|
20
|
+
stroke: ${t.blockStrokeColor};
|
|
21
|
+
stroke-width: ${t.blockStrokeWidth};
|
|
22
|
+
fill: ${t.blockFillColor};
|
|
23
|
+
}
|
|
24
|
+
`},"styles"),K={parser:$,get db(){return new y},renderer:q,styles:I};export{K as diagram};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{c as B}from"./chunk-AEOMTBSW-BgTIXPsY.js";import{d as V}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{s as u}from"./chunk-TU3PZOEN-RLyvLcv-.js";import{h as v,e as y,a as T,n as $,l as C,s as X,m as i,L as b,p as f,a7 as A,b as L,O as N,y as z,o as D}from"./index-BgeqpYgd.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var o=new u(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",children:[]}]})),I=i(()=>{o.reset(),D()},"clear"),R=i(()=>o.records.stack[0],"getRoot"),W=i(()=>o.records.cnt,"getCount"),F=z.treeView,H=i(()=>b(F,N().treeView),"getConfig"),M=i((e,t)=>{for(;e<=o.records.stack[o.records.stack.length-1].level;)o.records.stack.pop();let a={id:o.records.cnt++,level:e,name:t,children:[]};o.records.stack[o.records.stack.length-1].children.push(a),o.records.stack.push(a)},"addNode"),O={clear:I,addNode:M,getRoot:R,getCount:W,getConfig:H,getAccTitle:X,getAccDescription:C,getDiagramTitle:$,setAccDescription:T,setAccTitle:y,setDiagramTitle:v},x=O,S=i(e=>{B(e,x),e.nodes.map(t=>x.addNode(t.indent?parseInt(t.indent):0,t.name))},"populate"),Y={parse:i(async e=>{let t=await V("treeView",e);f.debug(t),S(t)},"parse")},j=i((e,t,a,s,l)=>{let c=s.append("text").text(a.name).attr("dominant-baseline","middle").attr("class","treeView-node-label"),{height:g,width:r}=c.node().getBBox(),d=g+l.paddingY*2,n=r+l.paddingX*2;c.attr("x",e+l.paddingX),c.attr("y",t+d/2),a.BBox={x:e,y:t,width:n,height:d}},"positionLabel"),k=i((e,t,a,s,l,c)=>e.append("line").attr("x1",t).attr("y1",a).attr("x2",s).attr("y2",l).attr("stroke-width",c).attr("class","treeView-node-line"),"positionLine"),q=i((e,t,a)=>{let s=0,l=0,c=i((r,d,n,p)=>{let w=p*(n.rowIndent+n.paddingX);j(w,s,d,r,n);let{height:h,width:m}=d.BBox;k(r,w-n.rowIndent,s+h/2,w,s+h/2,n.lineThickness),l=Math.max(l,w+m),s+=h},"drawNode"),g=i((r,d=0)=>{c(e,r,a,d),r.children.forEach(h=>{g(h,d+1)});let{x:n,y:p,height:w}=r.BBox;if(r.children.length){let{y:h,height:m}=r.children[r.children.length-1].BBox;k(e,n+a.paddingX,p+w,n+a.paddingX,h+m/2+a.lineThickness/2,a.lineThickness)}},"processNode");return g(t),{totalHeight:s,totalWidth:l}},"drawTree"),E=i((e,t,a,s)=>{f.debug(`Rendering treeView diagram
|
|
2
|
+
`+e);let l=s.db,c=l.getRoot(),g=l.getConfig(),r=A(t),d=r.append("g");d.attr("class","tree-view");let{totalHeight:n,totalWidth:p}=q(d,c,g);r.attr("viewBox",`-${g.lineThickness/2} 0 ${p} ${n}`),L(r,n,p,g.useMaxWidth)},"draw"),J={draw:E},P=J,U={labelFontSize:"16px",labelColor:"black",lineColor:"black"},_=i(({treeView:e})=>{let{labelFontSize:t,labelColor:a,lineColor:s}=b(U,e);return`
|
|
3
|
+
.treeView-node-label {
|
|
4
|
+
font-size: ${t};
|
|
5
|
+
fill: ${a};
|
|
6
|
+
}
|
|
7
|
+
.treeView-node-line {
|
|
8
|
+
stroke: ${s};
|
|
9
|
+
}
|
|
10
|
+
`},"styles"),G=_,ae={db:x,renderer:P,parser:Y,styles:G};export{ae as diagram};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{c as se}from"./chunk-AEOMTBSW-BgTIXPsY.js";import{d as re}from"./wardley-RL74JXVD-BCRCBASE-B-eZEzf9.js";import{m,ac as ie,O as j,L as I,a7 as ne,b as oe,aM as F,p as O,aa as E,aN as ce,aO as de,aP as $,i as H,e as pe,s as he,h as me,n as ye,l as fe,a as ue,y as Se,aQ as ge,o as xe}from"./index-BgeqpYgd.js";import{y as be}from"./chunk-RWUO3TPN-BgRTY0_k.js";import"./chunk-H3VCZNTA-Cx5XV_aC.js";var w,Y=(w=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=pe,this.getAccTitle=he,this.setDiagramTitle=me,this.getDiagramTitle=ye,this.getAccDescription=fe,this.setAccDescription=ue}getNodes(){return this.nodes}getConfig(){let r=Se,i=j();return I({...r.treemap,...i.treemap??{}})}addNode(r,i){this.nodes.push(r),this.levels.set(r,i),i===0&&(this.outerNodes.push(r),this.root??(this.root=r))}getRoot(){return{name:"",children:this.outerNodes}}addClass(r,i){let l=this.classes.get(r)??{id:r,styles:[],textStyles:[]},n=i.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");n&&n.forEach(s=>{ge(s)&&(l!=null&&l.textStyles?l.textStyles.push(s):l.textStyles=[s]),l!=null&&l.styles?l.styles.push(s):l.styles=[s]}),this.classes.set(r,l)}getClasses(){return this.classes}getStylesForClass(r){var i;return((i=this.classes.get(r))==null?void 0:i.styles)??[]}clear(){xe(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},m(w,"TreeMapDB"),w);function _(d){if(!d.length)return[];let r=[],i=[];return d.forEach(l=>{let n={name:l.name,children:l.type==="Leaf"?void 0:[]};for(n.classSelector=l==null?void 0:l.classSelector,l!=null&&l.cssCompiledStyles&&(n.cssCompiledStyles=l.cssCompiledStyles),l.type==="Leaf"&&l.value!==void 0&&(n.value=l.value);i.length>0&&i[i.length-1].level>=l.level;)i.pop();if(i.length===0)r.push(n);else{let s=i[i.length-1].node;s.children?s.children.push(n):s.children=[n]}l.type!=="Leaf"&&i.push({node:n,level:l.level})}),r}m(_,"buildHierarchy");var Ce=m((d,r)=>{se(d,r);let i=[];for(let s of d.TreemapRows??[])s.$type==="ClassDefStatement"&&r.addClass(s.className??"",s.styleText??"");for(let s of d.TreemapRows??[]){let p=s.item;if(!p)continue;let h=s.indent?parseInt(s.indent):0,N=$e(p),a=p.classSelector?r.getStylesForClass(p.classSelector):[],L=a.length>0?a:void 0,b={level:h,name:N,type:p.$type,value:p.value,classSelector:p.classSelector,cssCompiledStyles:L};i.push(b)}let l=_(i),n=m((s,p)=>{for(let h of s)r.addNode(h,p),h.children&&h.children.length>0&&n(h.children,p+1)},"addNodesRecursively");n(l,0)},"populate"),$e=m(d=>d.name?String(d.name):"","getItemName"),K={parser:{yy:void 0},parse:m(async d=>{var r;try{let i=await re("treemap",d);O.debug("Treemap AST:",i);let l=(r=K.parser)==null?void 0:r.yy;if(!(l instanceof Y))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.");Ce(i,l)}catch(i){throw O.error("Error parsing treemap:",i),i}},"parse")},ve=10,v=10,P=25,we=m((d,r,i,l)=>{let n=l.db,s=n.getConfig(),p=s.padding??ve,h=n.getDiagramTitle(),N=n.getRoot(),{themeVariables:a}=j();if(!N)return;let L=h?30:0,b=ne(r),G=s.nodeWidth?s.nodeWidth*v:960,U=s.nodeHeight?s.nodeHeight*v:500,B=G,q=U+L;b.attr("viewBox",`0 0 ${B} ${q}`),oe(b,q,B,s.useMaxWidth);let C;try{let e=s.valueFormat||",";if(e==="$0,0")C=m(t=>"$"+F(",")(t),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){let t=/\.\d+/.exec(e),c=t?t[0]:"";C=m(y=>"$"+F(","+c)(y),"valueFormat")}else if(e.startsWith("$")){let t=e.substring(1);C=m(c=>"$"+F(t||"")(c),"valueFormat")}else C=F(e)}catch(e){O.error("Error creating format function:",e),C=F(",")}let T=E().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]),Z=E().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]),A=E().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]);h&&b.append("text").attr("x",B/2).attr("y",L/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);let J=b.append("g").attr("transform",`translate(0, ${L})`).attr("class","treemapContainer"),ee=ce(N).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),Q=de().size([G,U]).paddingTop(e=>e.children&&e.children.length>0?P+v:0).paddingInner(p).paddingLeft(e=>e.children&&e.children.length>0?v:0).paddingRight(e=>e.children&&e.children.length>0?v:0).paddingBottom(e=>e.children&&e.children.length>0?v:0).round(!0)(ee),te=Q.descendants().filter(e=>e.children&&e.children.length>0),M=J.selectAll(".treemapSection").data(te).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);M.append("rect").attr("width",e=>e.x1-e.x0).attr("height",P).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),M.append("clipPath").attr("id",(e,t)=>`clip-section-${r}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",P),M.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=>T(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>Z(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(";")}),M.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",P/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";let t="dominant-baseline: middle; font-size: 12px; fill:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;let t=H(this),c=e.data.name;t.text(c);let y=e.x1-e.x0,S=6,g;s.showValues!==!1&&e.value?g=y-10-30-10-S:g=y-S-6;let u=Math.max(15,g),f=t.node();if(f.getComputedTextLength()>u){let o=c;for(;o.length>0;){if(o=c.substring(0,o.length-1),o.length===0){t.text("..."),f.getComputedTextLength()>u&&t.text("");break}if(t.text(o+"..."),f.getComputedTextLength()<=u)break}}}),s.showValues!==!1&&M.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",P/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?C(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:"+A(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")});let ae=Q.leaves(),D=J.selectAll(".treemapLeafGroup").data(ae).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})`);D.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?T(e.parent.data.name):T(e.data.name)).attr("style",e=>$({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?T(e.parent.data.name):T(e.data.name)).attr("stroke-width",3),D.append("clipPath").attr("id",(e,t)=>`clip-${r}-${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)),D.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: 38px;fill:"+A(e.data.name)+";",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.data.name).each(function(e){let t=H(this),c=e.x1-e.x0,y=e.y1-e.y0,S=t.node(),g=4,u=c-2*g,f=y-2*g;if(u<10||f<10){t.style("display","none");return}let o=parseInt(t.style("font-size"),10),x=8,k=28,W=.6,z=6,V=2;for(;S.getComputedTextLength()>u&&o>x;)o--,t.style("font-size",`${o}px`);let R=Math.max(z,Math.min(k,Math.round(o*W))),X=o+V+R;for(;X>f&&o>x&&(o--,R=Math.max(z,Math.min(k,Math.round(o*W))),!(R<z&&o===x));)t.style("font-size",`${o}px`),X=o+V+R;t.style("font-size",`${o}px`),(S.getComputedTextLength()>u||o<x||f<o)&&t.style("display","none")}),s.showValues!==!1&&D.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>{let t="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+A(e.data.name)+";",c=$({cssCompiledStyles:e.data.cssCompiledStyles});return t+c.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,t)=>`url(#clip-${r}-${t})`).text(e=>e.value?C(e.value):"").each(function(e){let t=H(this),c=this.parentNode;if(!c){t.style("display","none");return}let y=H(c).select(".treemapLabel");if(y.empty()||y.style("display")==="none"){t.style("display","none");return}let S=parseFloat(y.style("font-size")),g=28,u=.6,f=6,o=2,x=Math.max(f,Math.min(g,Math.round(S*u)));t.style("font-size",`${x}px`);let k=(e.y1-e.y0)/2+S/2+o;t.attr("y",k);let W=e.x1-e.x0,z=e.y1-e.y0-4,V=W-8;t.node().getComputedTextLength()>V||k+x>z||x<f?t.style("display","none"):t.style("display",null)});let le=s.diagramPadding??8;be(b,le,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),Le=m(function(d,r){return r.db.getClasses()},"getClasses"),Te={draw:we,getClasses:Le},Me={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},ke=m(({treemap:d}={})=>{let r=ie(),i=j(),l=I(r,i.themeVariables),n=I(Me,d),s=n.titleColor??l.titleColor,p=n.labelColor??l.textColor,h=n.valueColor??l.textColor;return`
|
|
2
|
+
.treemapNode.section {
|
|
3
|
+
stroke: ${n.sectionStrokeColor};
|
|
4
|
+
stroke-width: ${n.sectionStrokeWidth};
|
|
5
|
+
fill: ${n.sectionFillColor};
|
|
6
|
+
}
|
|
7
|
+
.treemapNode.leaf {
|
|
8
|
+
stroke: ${n.leafStrokeColor};
|
|
9
|
+
stroke-width: ${n.leafStrokeWidth};
|
|
10
|
+
fill: ${n.leafFillColor};
|
|
11
|
+
}
|
|
12
|
+
.treemapLabel {
|
|
13
|
+
fill: ${p};
|
|
14
|
+
font-size: ${n.labelFontSize};
|
|
15
|
+
}
|
|
16
|
+
.treemapValue {
|
|
17
|
+
fill: ${h};
|
|
18
|
+
font-size: ${n.valueFontSize};
|
|
19
|
+
}
|
|
20
|
+
.treemapTitle {
|
|
21
|
+
fill: ${s};
|
|
22
|
+
font-size: ${n.titleFontSize};
|
|
23
|
+
}
|
|
24
|
+
`},"getStyles"),ze=ke,We={parser:K,get db(){return new Y},renderer:Te,styles:ze};export{We as diagram};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import{m as Ft}from"./chunk-TBF5ZNIQ-DL5stGM1.js";import{y as Yt}from"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as y,e as Pt,s as zt,a as Ut,l as Zt,h as Gt,n as Kt,q as st,p as D,o as Wt,J as jt,R as Xt,u as Qt,v as qt,g as Jt,P as Ht,i as Vt,U as te}from"./index-BgeqpYgd.js";var bt=function(){var s=y(function(k,a,n,r){for(n=n||{},r=k.length;r--;n[k[r]]=a);return n},"o"),i=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52],o=[1,10],c=[1,11],l=[1,12],h=[1,13],p=[1,23],u=[1,24],E=[1,25],W=[1,26],j=[1,27],O=[1,19],rt=[1,28],w=[1,29],$=[1,20],S=[1,18],R=[1,21],B=[1,22],at=[1,36],nt=[1,37],lt=[1,38],ot=[1,39],ct=[1,40],F=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,48,50,51,52,65,66,67,68,69],N=[1,45],A=[1,46],Y=[1,55],P=[40,48,50,51,52,70,71],z=[1,66],U=[1,64],I=[1,61],Z=[1,65],G=[1,67],X=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,51,52,65,66,67,68,69],gt=[65,66,67,68,69],mt=[1,84],kt=[1,83],Et=[1,81],Tt=[1,82],Ot=[6,10,42,47],v=[6,10,13,41,42,47,48,49],Q=[1,92],q=[1,91],J=[1,90],K=[19,58],St=[1,101],Nt=[1,100],ht=[19,58,60,62],ut={trace:y(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,DECIMAL_NUM:51,ENTITY_ONE:52,attribute:53,attributeType:54,attributeName:55,attributeKeyTypeList:56,attributeComment:57,ATTRIBUTE_WORD:58,attributeKeyType:59,",":60,ATTRIBUTE_KEY:61,COMMENT:62,cardinality:63,relType:64,ZERO_OR_ONE:65,ZERO_OR_MORE:66,ONE_OR_MORE:67,ONLY_ONE:68,MD_PARENT:69,NON_IDENTIFYING:70,IDENTIFYING:71,WORD:72,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",51:"DECIMAL_NUM",52:"ENTITY_ONE",58:"ATTRIBUTE_WORD",60:",",61:"ATTRIBUTE_KEY",62:"COMMENT",65:"ZERO_OR_ONE",66:"ZERO_OR_MORE",67:"ONE_OR_MORE",68:"ONLY_ONE",69:"MD_PARENT",70:"NON_IDENTIFYING",71:"IDENTIFYING",72:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[11,1],[11,1],[11,1],[18,1],[18,2],[53,2],[53,3],[53,3],[53,4],[54,1],[55,1],[56,1],[56,3],[59,1],[57,1],[12,3],[63,1],[63,1],[63,1],[63,1],[63,1],[64,1],[64,1],[14,1],[14,1],[14,1]],performAction:y(function(k,a,n,r,d,t,b){var e=t.length-1;switch(d){case 1:break;case 2:this.$=[];break;case 3:t[e-1].push(t[e]),this.$=t[e-1];break;case 4:case 5:this.$=t[e];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(t[e-4]),r.addEntity(t[e-2]),r.addRelationship(t[e-4],t[e],t[e-2],t[e-3]);break;case 9:r.addEntity(t[e-8]),r.addEntity(t[e-4]),r.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),r.setClass([t[e-8]],t[e-6]),r.setClass([t[e-4]],t[e-2]);break;case 10:r.addEntity(t[e-6]),r.addEntity(t[e-2]),r.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),r.setClass([t[e-6]],t[e-4]);break;case 11:r.addEntity(t[e-6]),r.addEntity(t[e-4]),r.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),r.setClass([t[e-4]],t[e-2]);break;case 12:r.addEntity(t[e-3]),r.addAttributes(t[e-3],t[e-1]);break;case 13:r.addEntity(t[e-5]),r.addAttributes(t[e-5],t[e-1]),r.setClass([t[e-5]],t[e-3]);break;case 14:r.addEntity(t[e-2]);break;case 15:r.addEntity(t[e-4]),r.setClass([t[e-4]],t[e-2]);break;case 16:r.addEntity(t[e]);break;case 17:r.addEntity(t[e-2]),r.setClass([t[e-2]],t[e]);break;case 18:r.addEntity(t[e-6],t[e-4]),r.addAttributes(t[e-6],t[e-1]);break;case 19:r.addEntity(t[e-8],t[e-6]),r.addAttributes(t[e-8],t[e-1]),r.setClass([t[e-8]],t[e-3]);break;case 20:r.addEntity(t[e-5],t[e-3]);break;case 21:r.addEntity(t[e-7],t[e-5]),r.setClass([t[e-7]],t[e-2]);break;case 22:r.addEntity(t[e-3],t[e-1]);break;case 23:r.addEntity(t[e-5],t[e-3]),r.setClass([t[e-5]],t[e]);break;case 24:case 25:this.$=t[e].trim(),r.setAccTitle(this.$);break;case 26:case 27:this.$=t[e].trim(),r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=t[e-3],r.addClass(t[e-2],t[e-1]);break;case 37:case 38:case 59:case 67:this.$=[t[e]];break;case 39:case 40:this.$=t[e-2].concat([t[e]]);break;case 41:this.$=t[e-2],r.setClass(t[e-1],t[e]);break;case 42:this.$=t[e-3],r.addCssStyles(t[e-2],t[e-1]);break;case 43:this.$=[t[e]];break;case 44:t[e-2].push(t[e]),this.$=t[e-2];break;case 46:this.$=t[e-1]+t[e];break;case 54:case 79:case 80:this.$=t[e].replace(/"/g,"");break;case 55:case 56:case 57:case 58:case 81:this.$=t[e];break;case 60:t[e].push(t[e-1]),this.$=t[e];break;case 61:this.$={type:t[e-1],name:t[e]};break;case 62:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 63:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 64:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 65:case 66:case 69:this.$=t[e];break;case 68:t[e-2].push(t[e]),this.$=t[e-2];break;case 70:this.$=t[e].replace(/"/g,"");break;case 71:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 72:this.$=r.Cardinality.ZERO_OR_ONE;break;case 73:this.$=r.Cardinality.ZERO_OR_MORE;break;case 74:this.$=r.Cardinality.ONE_OR_MORE;break;case 75:this.$=r.Cardinality.ONLY_ONE;break;case 76:this.$=r.Cardinality.MD_PARENT;break;case 77:this.$=r.Identification.NON_IDENTIFYING;break;case 78:this.$=r.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(i,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:o,24:c,26:l,28:h,29:14,30:15,31:16,32:17,33:p,34:u,35:E,36:W,37:j,40:O,43:rt,44:w,48:$,50:S,51:R,52:B},s(i,[2,7],{1:[2,1]}),s(i,[2,3]),{9:30,11:9,22:o,24:c,26:l,28:h,29:14,30:15,31:16,32:17,33:p,34:u,35:E,36:W,37:j,40:O,43:rt,44:w,48:$,50:S,51:R,52:B},s(i,[2,5]),s(i,[2,6]),s(i,[2,16],{12:31,63:35,15:[1,32],17:[1,33],20:[1,34],65:at,66:nt,67:lt,68:ot,69:ct}),{23:[1,41]},{25:[1,42]},{27:[1,43]},s(i,[2,27]),s(i,[2,28]),s(i,[2,29]),s(i,[2,30]),s(i,[2,31]),s(F,[2,54]),s(F,[2,55]),s(F,[2,56]),s(F,[2,57]),s(F,[2,58]),s(i,[2,32]),s(i,[2,33]),s(i,[2,34]),s(i,[2,35]),{16:44,40:N,41:A},{16:47,40:N,41:A},{16:48,40:N,41:A},s(i,[2,4]),{11:49,40:O,48:$,50:S,51:R,52:B},{16:50,40:N,41:A},{18:51,19:[1,52],53:53,54:54,58:Y},{11:56,40:O,48:$,50:S,51:R,52:B},{64:57,70:[1,58],71:[1,59]},s(P,[2,72]),s(P,[2,73]),s(P,[2,74]),s(P,[2,75]),s(P,[2,76]),s(i,[2,24]),s(i,[2,25]),s(i,[2,26]),{13:z,38:60,41:U,42:I,45:62,46:63,48:Z,49:G},s(X,[2,37]),s(X,[2,38]),{16:68,40:N,41:A,42:I},{13:z,38:69,41:U,42:I,45:62,46:63,48:Z,49:G},{13:[1,70],15:[1,71]},s(i,[2,17],{63:35,12:72,17:[1,73],42:I,65:at,66:nt,67:lt,68:ot,69:ct}),{19:[1,74]},s(i,[2,14]),{18:75,19:[2,59],53:53,54:54,58:Y},{55:76,58:[1,77]},{58:[2,65]},{21:[1,78]},{63:79,65:at,66:nt,67:lt,68:ot,69:ct},s(gt,[2,77]),s(gt,[2,78]),{6:mt,10:kt,39:80,42:Et,47:Tt},{40:[1,85],41:[1,86]},s(Ot,[2,43],{46:87,13:z,41:U,48:Z,49:G}),s(v,[2,45]),s(v,[2,50]),s(v,[2,51]),s(v,[2,52]),s(v,[2,53]),s(i,[2,41],{42:I}),{6:mt,10:kt,39:88,42:Et,47:Tt},{14:89,40:Q,50:q,72:J},{16:93,40:N,41:A},{11:94,40:O,48:$,50:S,51:R,52:B},{18:95,19:[1,96],53:53,54:54,58:Y},s(i,[2,12]),{19:[2,60]},s(K,[2,61],{56:97,57:98,59:99,61:St,62:Nt}),s([19,58,61,62],[2,66]),s(i,[2,22],{15:[1,103],17:[1,102]}),s([40,48,50,51,52],[2,71]),s(i,[2,36]),{13:z,41:U,45:104,46:63,48:Z,49:G},s(i,[2,47]),s(i,[2,48]),s(i,[2,49]),s(X,[2,39]),s(X,[2,40]),s(v,[2,46]),s(i,[2,42]),s(i,[2,8]),s(i,[2,79]),s(i,[2,80]),s(i,[2,81]),{13:[1,105],42:I},{13:[1,107],15:[1,106]},{19:[1,108]},s(i,[2,15]),s(K,[2,62],{57:109,60:[1,110],62:Nt}),s(K,[2,63]),s(ht,[2,67]),s(K,[2,70]),s(ht,[2,69]),{18:111,19:[1,112],53:53,54:54,58:Y},{16:113,40:N,41:A},s(Ot,[2,44],{46:87,13:z,41:U,48:Z,49:G}),{14:114,40:Q,50:q,72:J},{16:115,40:N,41:A},{14:116,40:Q,50:q,72:J},s(i,[2,13]),s(K,[2,64]),{59:117,61:St},{19:[1,118]},s(i,[2,20]),s(i,[2,23],{17:[1,119],42:I}),s(i,[2,11]),{13:[1,120],42:I},s(i,[2,10]),s(ht,[2,68]),s(i,[2,18]),{18:121,19:[1,122],53:53,54:54,58:Y},{14:123,40:Q,50:q,72:J},{19:[1,124]},s(i,[2,21]),s(i,[2,9]),s(i,[2,19])],defaultActions:{55:[2,65],75:[2,60]},parseError:y(function(k,a){if(a.recoverable)this.trace(k);else{var n=new Error(k);throw n.hash=a,n}},"parseError"),parse:y(function(k){var a=this,n=[0],r=[],d=[null],t=[],b=this.table,e="",V=0,At=0,Lt=0,Dt=2,It=1,Mt=t.slice.call(arguments,1),_=Object.create(this.lexer),C={yy:{}};for(var yt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,yt)&&(C.yy[yt]=this.yy[yt]);_.setInput(k,C.yy),C.yy.lexer=_,C.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var dt=_.yylloc;t.push(dt);var wt=_.options&&_.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Bt(g){n.length=n.length-2*g,d.length=d.length-g,t.length=t.length-g}y(Bt,"popStack");function $t(){var g;return g=r.pop()||_.lex()||It,typeof g!="number"&&(g instanceof Array&&(r=g,g=r.pop()),g=a.symbols_[g]||g),g}y($t,"lex");for(var f,pt,x,m,le,_t,L={},tt,T,Rt,et;;){if(x=n[n.length-1],this.defaultActions[x]?m=this.defaultActions[x]:((f===null||typeof f>"u")&&(f=$t()),m=b[x]&&b[x][f]),typeof m>"u"||!m.length||!m[0]){var ft="";et=[];for(tt in b[x])this.terminals_[tt]&&tt>Dt&&et.push("'"+this.terminals_[tt]+"'");_.showPosition?ft="Parse error on line "+(V+1)+`:
|
|
2
|
+
`+_.showPosition()+`
|
|
3
|
+
Expecting `+et.join(", ")+", got '"+(this.terminals_[f]||f)+"'":ft="Parse error on line "+(V+1)+": Unexpected "+(f==It?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(ft,{text:_.match,token:this.terminals_[f]||f,line:_.yylineno,loc:dt,expected:et})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+x+", token: "+f);switch(m[0]){case 1:n.push(f),d.push(_.yytext),t.push(_.yylloc),n.push(m[1]),f=null,pt?(f=pt,pt=null):(At=_.yyleng,e=_.yytext,V=_.yylineno,dt=_.yylloc,Lt>0);break;case 2:if(T=this.productions_[m[1]][1],L.$=d[d.length-T],L._$={first_line:t[t.length-(T||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(T||1)].first_column,last_column:t[t.length-1].last_column},wt&&(L._$.range=[t[t.length-(T||1)].range[0],t[t.length-1].range[1]]),_t=this.performAction.apply(L,[e,At,V,C.yy,m[1],d,t].concat(Mt)),typeof _t<"u")return _t;T&&(n=n.slice(0,-1*T*2),d=d.slice(0,-1*T),t=t.slice(0,-1*T)),n.push(this.productions_[m[1]][0]),d.push(L.$),t.push(L._$),Rt=b[n[n.length-2]][n[n.length-1]],n.push(Rt);break;case 3:return!0}}return!0},"parse")},vt=function(){var k={EOF:1,parseError:y(function(a,n){if(this.yy.parser)this.yy.parser.parseError(a,n);else throw new Error(a)},"parseError"),setInput:y(function(a,n){return this.yy=n||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:y(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var n=a.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:y(function(a){var n=a.length,r=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var t=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===d.length?this.yylloc.first_column:0)+d[d.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[t[0],t[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:y(function(){return this._more=!0,this},"more"),reject:y(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:y(function(a){this.unput(this.match.slice(a))},"less"),pastInput:y(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:y(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:y(function(){var a=this.pastInput(),n=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
|
5
|
+
`+n+"^"},"showPosition"),test_match:y(function(a,n){var r,d,t;if(this.options.backtrack_lexer&&(t={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(t.yylloc.range=this.yylloc.range.slice(0))),d=a[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length},this.yytext+=a[0],this.match+=a[0],this.matches=a,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(a[0].length),this.matched+=a[0],r=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var b in t)this[b]=t[b];return!1}return!1},"test_match"),next:y(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,n,r,d;this._more||(this.yytext="",this.match="");for(var t=this._currentRules(),b=0;b<t.length;b++)if(r=this._input.match(this.rules[t[b]]),r&&(!n||r[0].length>n[0].length)){if(n=r,d=b,this.options.backtrack_lexer){if(a=this.test_match(r,t[b]),a!==!1)return a;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(a=this.test_match(n,t[d]),a!==!1?a:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:y(function(){var a=this.next();return a||this.lex()},"lex"),begin:y(function(a){this.conditionStack.push(a)},"begin"),popState:y(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:y(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:y(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:y(function(a){this.begin(a)},"pushState"),stateStackSize:y(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:y(function(a,n,r,d){switch(r){case 0:return this.begin("acc_title"),24;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),26;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return 33;case 8:return 34;case 9:return 35;case 10:return 36;case 11:return 10;case 12:break;case 13:return 8;case 14:return 50;case 15:return 72;case 16:return 4;case 17:return this.begin("block"),17;case 18:return 49;case 19:return 49;case 20:return 42;case 21:return 15;case 22:return 13;case 23:break;case 24:return 61;case 25:return 58;case 26:return 58;case 27:return 62;case 28:break;case 29:return this.popState(),19;case 30:return n.yytext[0];case 31:return 20;case 32:return 21;case 33:return this.begin("style"),44;case 34:return this.popState(),10;case 35:break;case 36:return 13;case 37:return 42;case 38:return 49;case 39:return this.begin("style"),37;case 40:return 43;case 41:return 65;case 42:return 67;case 43:return 67;case 44:return 67;case 45:return 65;case 46:return 65;case 47:return 66;case 48:return 66;case 49:return 66;case 50:return 66;case 51:return 66;case 52:return 67;case 53:return 66;case 54:return 67;case 55:return 68;case 56:return 68;case 57:return 51;case 58:return 68;case 59:return 68;case 60:return 68;case 61:return 52;case 62:return 48;case 63:return 68;case 64:return 65;case 65:return 66;case 66:return 67;case 67:return 69;case 68:return 70;case 69:return 71;case 70:return 71;case 71:return 70;case 72:return 70;case 73:return 70;case 74:return 41;case 75:return 47;case 76:return 40;case 77:return n.yytext[0];case 78:return 6}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:[0-9]+\.[0-9]+)/i,/^(?:1(?=\s+[A-Za-z_"']))/i,/^(?:1(?=\s+[0-9]))/i,/^(?:1(?=(--|\.\.|\.-|-\.)))/i,/^(?:1\b)/i,/^(?:[0-9]+)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:u(?=[\.\-\|]))/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*|\.)+)/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,74,75],inclusive:!1},acc_descr_multiline:{rules:[5,6],inclusive:!1},acc_descr:{rules:[3],inclusive:!1},acc_title:{rules:[1],inclusive:!1},block:{rules:[23,24,25,26,27,28,29,30],inclusive:!1},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,76,77,78],inclusive:!0}}};return k}();ut.lexer=vt;function H(){this.yy={}}return y(H,"Parser"),H.prototype=ut,ut.Parser=H,new H}();bt.parser=bt;var ee=bt,M,se=(M=class{constructor(){this.entities=new Map,this.relationships=[],this.classes=new Map,this.direction="TB",this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"},this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"},this.setAccTitle=Pt,this.getAccTitle=zt,this.setAccDescription=Ut,this.getAccDescription=Zt,this.setDiagramTitle=Gt,this.getDiagramTitle=Kt,this.getConfig=y(()=>st().er,"getConfig"),this.clear(),this.addEntity=this.addEntity.bind(this),this.addAttributes=this.addAttributes.bind(this),this.addRelationship=this.addRelationship.bind(this),this.setDirection=this.setDirection.bind(this),this.addCssStyles=this.addCssStyles.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.setAccTitle=this.setAccTitle.bind(this),this.setAccDescription=this.setAccDescription.bind(this)}addEntity(i,o=""){var c;return this.entities.has(i)?!((c=this.entities.get(i))!=null&&c.alias)&&o&&(this.entities.get(i).alias=o,D.info(`Add alias '${o}' to entity '${i}'`)):(this.entities.set(i,{id:`entity-${i}-${this.entities.size}`,label:i,attributes:[],alias:o,shape:"erBox",look:st().look??"default",cssClasses:"default",cssStyles:[],labelType:"markdown"}),D.info("Added new entity :",i)),this.entities.get(i)}getEntity(i){return this.entities.get(i)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(i,o){let c=this.addEntity(i),l;for(l=o.length-1;l>=0;l--)o[l].keys||(o[l].keys=[]),o[l].comment||(o[l].comment=""),c.attributes.push(o[l]),D.debug("Added attribute ",o[l].name)}addRelationship(i,o,c,l){let h=this.entities.get(i),p=this.entities.get(c);if(!h||!p)return;let u={entityA:h.id,roleA:o,entityB:p.id,relSpec:l};this.relationships.push(u),D.debug("Added new relationship :",u)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(i){this.direction=i}getCompiledStyles(i){let o=[];for(let c of i){let l=this.classes.get(c);l!=null&&l.styles&&(o=[...o,...l.styles??[]].map(h=>h.trim())),l!=null&&l.textStyles&&(o=[...o,...l.textStyles??[]].map(h=>h.trim()))}return o}addCssStyles(i,o){for(let c of i){let l=this.entities.get(c);if(!o||!l)return;for(let h of o)l.cssStyles.push(h)}}addClass(i,o){i.forEach(c=>{let l=this.classes.get(c);l===void 0&&(l={id:c,styles:[],textStyles:[]},this.classes.set(c,l)),o&&o.forEach(function(h){if(/color/.exec(h)){let p=h.replace("fill","bgFill");l.textStyles.push(p)}l.styles.push(h)})})}setClass(i,o){for(let c of i){let l=this.entities.get(c);if(l)for(let h of o)l.cssClasses+=" "+h}}clear(){this.entities=new Map,this.classes=new Map,this.relationships=[],Wt()}getData(){let i=[],o=[],c=st(),l=0;for(let p of this.entities.keys()){let u=this.entities.get(p);u&&(u.cssCompiledStyles=this.getCompiledStyles(u.cssClasses.split(" ")),u.colorIndex=l++,i.push(u))}let h=0;for(let p of this.relationships){let u={id:jt(p.entityA,p.entityB,{prefix:"id",counter:h++}),type:"normal",curve:"basis",start:p.entityA,end:p.entityB,label:p.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:p.relSpec.cardB.toLowerCase(),arrowTypeEnd:p.relSpec.cardA.toLowerCase(),pattern:p.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:c.look,labelType:"markdown"};o.push(u)}return{nodes:i,edges:o,other:{},config:c,direction:"TB"}}},y(M,"ErDB"),M),xt={};qt(xt,{draw:()=>ie});var ie=y(async function(s,i,o,c){D.info("REF0:"),D.info("Drawing er diagram (unified)",i);let{securityLevel:l,er:h,layout:p}=st(),u=c.db.getData(),E=Ft(i,l);u.type=c.type,u.layoutAlgorithm=Jt(p),u.config.flowchart.nodeSpacing=(h==null?void 0:h.nodeSpacing)||140,u.config.flowchart.rankSpacing=(h==null?void 0:h.rankSpacing)||80,u.direction=c.db.getDirection();let{config:W}=u,{look:j}=W;j==="neo"?u.markers=["only_one_neo","zero_or_one_neo","one_or_more_neo","zero_or_more_neo"]:u.markers=["only_one","zero_or_one","one_or_more","zero_or_more"],u.diagramId=i,await Ht(u,E),u.layoutAlgorithm==="elk"&&E.select(".edges").lower();let O=E.selectAll('[id*="-background"]');Array.from(O).length>0&&O.each(function(){let w=Vt(this),$=w.attr("id").replace("-background",""),S=E.select(`#${CSS.escape($)}`);if(!S.empty()){let R=S.attr("transform");w.attr("transform",R)}}),te.insertTitle(E,"erDiagramTitleText",(h==null?void 0:h.titleTopMargin)??25,c.db.getDiagramTitle()),Yt(E,8,"erDiagram",(h==null?void 0:h.useMaxWidth)??!0)},"draw"),Ct=y((s,i)=>{let o=Qt,c=o(s,"r"),l=o(s,"g"),h=o(s,"b");return Xt(c,l,h,i)},"fade"),it=new Set(["redux-color","redux-dark-color"]),re=y(s=>{let{theme:i,look:o,bkgColorArray:c,borderColorArray:l}=s;if(!it.has(i))return"";let h=(c==null?void 0:c.length)>0,p="";for(let u=0;u<s.THEME_COLOR_LIMIT;u++)p+=`
|
|
7
|
+
|
|
8
|
+
[data-look="${o}"][data-color-id="color-${u}"].node path {
|
|
9
|
+
stroke: ${l[u]};
|
|
10
|
+
${h?`fill: ${c[u]};`:""}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[data-look="${o}"][data-color-id="color-${u}"].node rect {
|
|
14
|
+
stroke: ${l[u]};
|
|
15
|
+
${h?`fill: ${c[u]};`:""}
|
|
16
|
+
}
|
|
17
|
+
`;return p},"genColor"),ae=y(s=>{let{look:i,theme:o,erEdgeLabelBackground:c,strokeWidth:l}=s;return`
|
|
18
|
+
${re(s)}
|
|
19
|
+
.entityBox {
|
|
20
|
+
fill: ${s.mainBkg};
|
|
21
|
+
stroke: ${s.nodeBorder};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.relationshipLabelBox {
|
|
25
|
+
fill: ${s.tertiaryColor};
|
|
26
|
+
opacity: 0.7;
|
|
27
|
+
background-color: ${s.tertiaryColor};
|
|
28
|
+
rect {
|
|
29
|
+
opacity: 0.5;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.labelBkg {
|
|
34
|
+
background-color: ${it.has(o)&&c?c:Ct(s.tertiaryColor,.5)};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.edgeLabel {
|
|
38
|
+
background-color: ${it.has(o)&&c?c:s.edgeLabelBackground};
|
|
39
|
+
}
|
|
40
|
+
.edgeLabel .label rect {
|
|
41
|
+
fill: ${it.has(o)&&c?c:s.edgeLabelBackground};
|
|
42
|
+
}
|
|
43
|
+
.edgeLabel .label text {
|
|
44
|
+
fill: ${s.textColor};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.edgeLabel .label {
|
|
48
|
+
fill: ${s.nodeBorder};
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.label {
|
|
53
|
+
font-family: ${s.fontFamily};
|
|
54
|
+
color: ${s.nodeTextColor||s.textColor};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.edge-pattern-dashed {
|
|
58
|
+
stroke-dasharray: 8,8;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.node rect,
|
|
62
|
+
.node circle,
|
|
63
|
+
.node ellipse,
|
|
64
|
+
.node polygon
|
|
65
|
+
{
|
|
66
|
+
fill: ${s.mainBkg};
|
|
67
|
+
stroke: ${s.nodeBorder};
|
|
68
|
+
stroke-width: ${i==="neo"?l:"1px"};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.relationshipLine {
|
|
72
|
+
stroke: ${s.lineColor};
|
|
73
|
+
stroke-width: ${i==="neo"?l:"1px"};
|
|
74
|
+
fill: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.marker {
|
|
78
|
+
fill: none !important;
|
|
79
|
+
stroke: ${s.lineColor} !important;
|
|
80
|
+
stroke-width: 1;
|
|
81
|
+
}
|
|
82
|
+
[data-look=neo].labelBkg {
|
|
83
|
+
background-color: ${Ct(s.tertiaryColor,.5)};
|
|
84
|
+
}
|
|
85
|
+
`},"getStyles"),ne=ae,ue={parser:ee,get db(){return new se},renderer:xt,styles:ne};export{ue as diagram};
|