@codragraph/cli 2.1.1 → 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 +12 -9
- package/dist/cli/ai-context.js +1 -1
- package/dist/cli/analyze.js +19 -2
- package/dist/cli/index.js +2 -1
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +3 -1
- package/dist/cli/setup.js +36 -19
- package/dist/cli/status.d.ts +13 -0
- package/dist/cli/status.js +99 -0
- package/dist/config/ignore-service.js +2 -0
- package/dist/core/graphstore/cgdb-row-source.js +3 -2
- package/dist/core/group/bridge-db.js +42 -10
- package/dist/core/run-analyze.d.ts +20 -0
- package/dist/core/run-analyze.js +201 -0
- package/dist/core/search/hybrid-search.js +11 -3
- package/dist/mcp/resources.js +2 -2
- package/dist/server/api.d.ts +14 -2
- package/dist/server/api.js +90 -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/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 +3 -1
- package/scripts/build.js +62 -4
- package/scripts/patch-tree-sitter-swift.cjs +0 -1
- package/skills/codragraph-cli.md +1 -1
- 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,231 @@
|
|
|
1
|
+
import{m as Zt}from"./chunk-TBF5ZNIQ-DL5stGM1.js";import{y as Qt}from"./chunk-RWUO3TPN-BgRTY0_k.js";import{m as d,p as _,q as w,P as te,U as ee,s as se,e as ie,l as re,a as ae,h as ne,n as oe,an as le,C as K,o as ce}from"./index-BgeqpYgd.js";var Ct=function(){var t=d(function(F,n,o,g){for(o=o||{},g=F.length;g--;o[F[g]]=n);return o},"o"),e=[1,2],s=[1,3],a=[1,4],i=[2,4],l=[1,9],h=[1,11],y=[1,16],u=[1,17],S=[1,18],m=[1,19],b=[1,33],D=[1,20],O=[1,21],I=[1,22],R=[1,23],E=[1,24],p=[1,26],x=[1,27],v=[1,28],B=[1,29],j=[1,30],G=[1,31],P=[1,32],it=[1,35],rt=[1,36],at=[1,37],nt=[1,38],J=[1,34],f=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],ot=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],vt=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],mt={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"-->":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"-->",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:d(function(F,n,o,g,k,r,L){var c=r.length-1;switch(k){case 3:return g.setRootDoc(r[c]),r[c];case 4:this.$=[];break;case 5:r[c]!="nl"&&(r[c-1].push(r[c]),this.$=r[c-1]);break;case 6:case 7:this.$=r[c];break;case 8:this.$="nl";break;case 12:this.$=r[c];break;case 13:let ht=r[c-1];ht.description=g.trimColon(r[c]),this.$=ht;break;case 14:this.$={stmt:"relation",state1:r[c-2],state2:r[c]};break;case 15:let dt=g.trimColon(r[c]);this.$={stmt:"relation",state1:r[c-3],state2:r[c-1],description:dt};break;case 19:this.$={stmt:"state",id:r[c-3],type:"default",description:"",doc:r[c-1]};break;case 20:var z=r[c],V=r[c-2].trim();if(r[c].match(":")){var ct=r[c].split(":");z=ct[0],V=[V,ct[1]]}this.$={stmt:"state",id:z,type:"default",description:V};break;case 21:this.$={stmt:"state",id:r[c-3],type:"default",description:r[c-5],doc:r[c-1]};break;case 22:this.$={stmt:"state",id:r[c],type:"fork"};break;case 23:this.$={stmt:"state",id:r[c],type:"join"};break;case 24:this.$={stmt:"state",id:r[c],type:"choice"};break;case 25:this.$={stmt:"state",id:g.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[c-1].trim(),note:{position:r[c-2].trim(),text:r[c].trim()}};break;case 29:this.$=r[c].trim(),g.setAccTitle(this.$);break;case 30:case 31:this.$=r[c].trim(),g.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[c-3],url:r[c-2],tooltip:r[c-1]};break;case 33:this.$={stmt:"click",id:r[c-3],url:r[c-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[c-1].trim(),classes:r[c].trim()};break;case 36:this.$={stmt:"style",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 37:this.$={stmt:"applyClass",id:r[c-1].trim(),styleClass:r[c].trim()};break;case 38:g.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:g.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:g.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:g.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[c].trim(),type:"default",description:""};break;case 46:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break;case 47:this.$={stmt:"state",id:r[c-2].trim(),classes:[r[c].trim()],type:"default",description:""};break}},"anonymous"),table:[{3:1,4:e,5:s,6:a},{1:[3]},{3:5,4:e,5:s,6:a},{3:6,4:e,5:s,6:a},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],i,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:l,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:u,19:S,22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:y,17:u,19:S,22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,7]),t(f,[2,8]),t(f,[2,9]),t(f,[2,10]),t(f,[2,11]),t(f,[2,12],{14:[1,40],15:[1,41]}),t(f,[2,16]),{18:[1,42]},t(f,[2,18],{20:[1,43]}),{23:[1,44]},t(f,[2,22]),t(f,[2,23]),t(f,[2,24]),t(f,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(f,[2,28]),{34:[1,49]},{36:[1,50]},t(f,[2,31]),{13:51,24:b,57:J},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(ot,[2,44],{58:[1,56]}),t(ot,[2,45],{58:[1,57]}),t(f,[2,38]),t(f,[2,39]),t(f,[2,40]),t(f,[2,41]),t(f,[2,6]),t(f,[2,13]),{13:58,24:b,57:J},t(f,[2,17]),t(vt,i,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(f,[2,29]),t(f,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(f,[2,14],{14:[1,71]}),{4:l,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:u,19:S,21:[1,72],22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(f,[2,34]),t(f,[2,35]),t(f,[2,36]),t(f,[2,37]),t(ot,[2,46]),t(ot,[2,47]),t(f,[2,15]),t(f,[2,19]),t(vt,i,{7:78}),t(f,[2,26]),t(f,[2,27]),{5:[1,79]},{5:[1,80]},{4:l,5:h,8:8,9:10,10:12,11:13,12:14,13:15,16:y,17:u,19:S,21:[1,81],22:m,24:b,25:D,26:O,27:I,28:R,29:E,32:25,33:p,35:x,37:v,38:B,41:j,45:G,48:P,51:it,52:rt,53:at,54:nt,57:J},t(f,[2,32]),t(f,[2,33]),t(f,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:d(function(F,n){if(n.recoverable)this.trace(F);else{var o=new Error(F);throw o.hash=n,o}},"parseError"),parse:d(function(F){var n=this,o=[0],g=[],k=[null],r=[],L=this.table,c="",z=0,V=0,ct=0,ht=2,dt=1,Vt=r.slice.call(arguments,1),T=Object.create(this.lexer),U={yy:{}};for(var St in this.yy)Object.prototype.hasOwnProperty.call(this.yy,St)&&(U.yy[St]=this.yy[St]);T.setInput(F,U.yy),U.yy.lexer=T,U.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var kt=T.yylloc;r.push(kt);var Xt=T.options&&T.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ht(A){o.length=o.length-2*A,k.length=k.length-A,r.length=r.length-A}d(Ht,"popStack");function Lt(){var A;return A=g.pop()||T.lex()||dt,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=n.symbols_[A]||A),A}d(Lt,"lex");for(var $,_t,M,N,we,Tt,X={},ut,Y,It,pt;;){if(M=o[o.length-1],this.defaultActions[M]?N=this.defaultActions[M]:(($===null||typeof $>"u")&&($=Lt()),N=L[M]&&L[M][$]),typeof N>"u"||!N.length||!N[0]){var bt="";pt=[];for(ut in L[M])this.terminals_[ut]&&ut>ht&&pt.push("'"+this.terminals_[ut]+"'");T.showPosition?bt="Parse error on line "+(z+1)+`:
|
|
2
|
+
`+T.showPosition()+`
|
|
3
|
+
Expecting `+pt.join(", ")+", got '"+(this.terminals_[$]||$)+"'":bt="Parse error on line "+(z+1)+": Unexpected "+($==dt?"end of input":"'"+(this.terminals_[$]||$)+"'"),this.parseError(bt,{text:T.match,token:this.terminals_[$]||$,line:T.yylineno,loc:kt,expected:pt})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+$);switch(N[0]){case 1:o.push($),k.push(T.yytext),r.push(T.yylloc),o.push(N[1]),$=null,_t?($=_t,_t=null):(V=T.yyleng,c=T.yytext,z=T.yylineno,kt=T.yylloc,ct>0);break;case 2:if(Y=this.productions_[N[1]][1],X.$=k[k.length-Y],X._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},Xt&&(X._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]]),Tt=this.performAction.apply(X,[c,V,z,U.yy,N[1],k,r].concat(Vt)),typeof Tt<"u")return Tt;Y&&(o=o.slice(0,-1*Y*2),k=k.slice(0,-1*Y),r=r.slice(0,-1*Y)),o.push(this.productions_[N[1]][0]),k.push(X.$),r.push(X._$),It=L[o[o.length-2]][o[o.length-1]],o.push(It);break;case 3:return!0}}return!0},"parse")},Jt=function(){var F={EOF:1,parseError:d(function(n,o){if(this.yy.parser)this.yy.parser.parseError(n,o);else throw new Error(n)},"parseError"),setInput:d(function(n,o){return this.yy=o||this.yy||{},this._input=n,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:d(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var o=n.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:d(function(n){var o=n.length,g=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var k=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),g.length-1&&(this.yylineno-=g.length-1);var r=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:g?(g.length===k.length?this.yylloc.first_column:0)+k[k.length-g.length].length-g[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(n){this.unput(this.match.slice(n))},"less"),pastInput:d(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var n=this.pastInput(),o=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
+
`+o+"^"},"showPosition"),test_match:d(function(n,o){var g,k,r;if(this.options.backtrack_lexer&&(r={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&&(r.yylloc.range=this.yylloc.range.slice(0))),k=n[0].match(/(?:\r\n?|\n).*/g),k&&(this.yylineno+=k.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,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(n[0].length),this.matched+=n[0],g=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var L in r)this[L]=r[L];return!1}return!1},"test_match"),next:d(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,o,g,k;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),L=0;L<r.length;L++)if(g=this._input.match(this.rules[r[L]]),g&&(!o||g[0].length>o[0].length)){if(o=g,k=L,this.options.backtrack_lexer){if(n=this.test_match(g,r[L]),n!==!1)return n;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(n=this.test_match(o,r[k]),n!==!1?n:!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:d(function(){var n=this.next();return n||this.lex()},"lex"),begin:d(function(n){this.conditionStack.push(n)},"begin"),popState:d(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:d(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:d(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:d(function(n){this.begin(n)},"pushState"),stateStackSize:d(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:d(function(n,o,g,k){switch(g){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:return 51;case 5:return 52;case 6:return 53;case 7:return 54;case 8:break;case 9:break;case 10:return 5;case 11:break;case 12:break;case 13:break;case 14:break;case 15:return this.pushState("SCALE"),17;case 16:return 18;case 17:this.popState();break;case 18:return this.begin("acc_title"),33;case 19:return this.popState(),"acc_title_value";case 20:return this.begin("acc_descr"),35;case 21:return this.popState(),"acc_descr_value";case 22:this.begin("acc_descr_multiline");break;case 23:this.popState();break;case 24:return"acc_descr_multiline_value";case 25:return this.pushState("CLASSDEF"),41;case 26:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 27:return this.popState(),this.pushState("CLASSDEFID"),42;case 28:return this.popState(),43;case 29:return this.pushState("CLASS"),48;case 30:return this.popState(),this.pushState("CLASS_STYLE"),49;case 31:return this.popState(),50;case 32:return this.pushState("STYLE"),45;case 33:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 34:return this.popState(),47;case 35:return this.pushState("SCALE"),17;case 36:return 18;case 37:this.popState();break;case 38:this.pushState("STATE");break;case 39:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),25;case 40:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),26;case 41:return this.popState(),o.yytext=o.yytext.slice(0,-10).trim(),27;case 42:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),25;case 43:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),26;case 44:return this.popState(),o.yytext=o.yytext.slice(0,-10).trim(),27;case 45:return 51;case 46:return 52;case 47:return 53;case 48:return 54;case 49:this.pushState("STATE_STRING");break;case 50:return this.pushState("STATE_ID"),"AS";case 51:return this.popState(),"ID";case 52:this.popState();break;case 53:return"STATE_DESCR";case 54:return 19;case 55:this.popState();break;case 56:return this.popState(),this.pushState("struct"),20;case 57:break;case 58:return this.popState(),21;case 59:break;case 60:return this.begin("NOTE"),29;case 61:return this.popState(),this.pushState("NOTE_ID"),59;case 62:return this.popState(),this.pushState("NOTE_ID"),60;case 63:this.popState(),this.pushState("FLOATING_NOTE");break;case 64:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 65:break;case 66:return"NOTE_TEXT";case 67:return this.popState(),"ID";case 68:return this.popState(),this.pushState("NOTE_TEXT"),24;case 69:return this.popState(),o.yytext=o.yytext.substr(2).trim(),31;case 70:return this.popState(),o.yytext=o.yytext.slice(0,-8).trim(),31;case 71:return 6;case 72:return 6;case 73:return 16;case 74:return 57;case 75:return 24;case 76:return o.yytext=o.yytext.trim(),14;case 77:return 15;case 78:return 28;case 79:return 58;case 80:return 5;case 81:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[12,13],inclusive:!1},struct:{rules:[12,13,25,29,32,38,45,46,47,48,57,58,59,60,74,75,76,77,78,79],inclusive:!1},FLOATING_NOTE_ID:{rules:[67],inclusive:!1},FLOATING_NOTE:{rules:[64,65,66],inclusive:!1},NOTE_TEXT:{rules:[69,70],inclusive:!1},NOTE_ID:{rules:[68],inclusive:!1},NOTE:{rules:[61,62,63],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[34],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[33],inclusive:!1},CLASS_STYLE:{rules:[31],inclusive:!1},CLASS:{rules:[30],inclusive:!1},CLASSDEFID:{rules:[28],inclusive:!1},CLASSDEF:{rules:[26,27],inclusive:!1},acc_descr_multiline:{rules:[23,24],inclusive:!1},acc_descr:{rules:[21],inclusive:!1},acc_title:{rules:[19],inclusive:!1},SCALE:{rules:[16,17,36,37],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[51],inclusive:!1},STATE_STRING:{rules:[52,53],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[12,13,39,40,41,42,43,44,49,50,54,55,56],inclusive:!1},ID:{rules:[12,13],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,15,18,20,22,25,29,32,35,38,56,60,71,72,73,74,75,76,77,79,80,81],inclusive:!0}}};return F}();mt.lexer=Jt;function lt(){this.yy={}}return d(lt,"Parser"),lt.prototype=mt,mt.Parser=lt,new lt}();Ct.parser=Ct;var Ye=Ct,Z="state",H="root",Dt="relation",he="classDef",de="style",ue="applyClass",et="default",Ft="divider",Yt="fill:none",Gt="fill: #333",Pt="markdown",Wt="normal",Et="rect",$t="rectWithTitle",pe="stateStart",ye="stateEnd",At="divider",Nt="roundedWithTitle",fe="note",ge="noteGroup",st="statediagram",me="state",Se=`${st}-${me}`,jt="transition",ke="note",_e="note-edge",Te=`${jt} ${_e}`,be=`${st}-${ke}`,Ee="cluster",$e=`${st}-${Ee}`,Ce="cluster-alt",De=`${st}-${Ce}`,zt="parent",Ut="note",xe="state",xt="----",ve=`${xt}${Ut}`,Ot=`${xt}${zt}`,Mt=d((t,e="TB")=>{if(!t.doc)return e;let s=e;for(let a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir"),Le=d(function(t,e){return e.db.getClasses()},"getClasses"),Ie=d(async function(t,e,s,a){_.info("REF0:"),_.info("Drawing state diagram (v2)",e);let{securityLevel:i,state:l,layout:h}=w();a.db.extract(a.db.getRootDocV2());let y=a.db.getData(),u=Zt(e,i);y.type=a.type,y.layoutAlgorithm=h,y.nodeSpacing=(l==null?void 0:l.nodeSpacing)||50,y.rankSpacing=(l==null?void 0:l.rankSpacing)||50,w().look==="neo"?y.markers=["barbNeo"]:y.markers=["barb"],y.diagramId=e,await te(y,u);let S=8;try{(typeof a.db.getLinks=="function"?a.db.getLinks():new Map).forEach((m,b)=>{var x;let D=typeof b=="string"?b:typeof(b==null?void 0:b.id)=="string"?b.id:"";if(!D){_.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(b));return}let O=(x=u.node())==null?void 0:x.querySelectorAll("g"),I;if(O==null||O.forEach(v=>{var B;((B=v.textContent)==null?void 0:B.trim())===D&&(I=v)}),!I){_.warn("⚠️ Could not find node matching text:",D);return}let R=I.parentNode;if(!R){_.warn("⚠️ Node has no parent, cannot wrap:",D);return}let E=document.createElementNS("http://www.w3.org/2000/svg","a"),p=m.url.replace(/^"+|"+$/g,"");if(E.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p),E.setAttribute("target","_blank"),m.tooltip){let v=m.tooltip.replace(/^"+|"+$/g,"");E.setAttribute("title",v)}R.replaceChild(E,I),E.appendChild(I),_.info("🔗 Wrapped node in <a> tag for:",D,m.url)})}catch(m){_.error("❌ Error injecting clickable links:",m)}ee.insertTitle(u,"statediagramTitleText",(l==null?void 0:l.titleTopMargin)??25,a.db.getDiagramTitle()),Qt(u,S,st,(l==null?void 0:l.useMaxWidth)??!0)},"draw"),Ge={getClasses:Le,draw:Ie,getDir:Mt},ft=new Map,W=0;function gt(t="",e=0,s="",a=xt){let i=s!==null&&s.length>0?`${a}${s}`:"";return`${xe}-${t}${i}-${e}`}d(gt,"stateDomId");var Ae=d((t,e,s,a,i,l,h,y)=>{_.trace("items",e),e.forEach(u=>{switch(u.stmt){case Z:tt(t,u,s,a,i,l,h,y);break;case et:tt(t,u,s,a,i,l,h,y);break;case Dt:{tt(t,u.state1,s,a,i,l,h,y),tt(t,u.state2,s,a,i,l,h,y);let S=h==="neo",m={id:"edge"+W,start:u.state1.id,end:u.state2.id,arrowhead:"normal",arrowTypeEnd:S?"arrow_barb_neo":"arrow_barb",style:Yt,labelStyle:"",label:K.sanitizeText(u.description??"",w()),arrowheadStyle:Gt,labelpos:"c",labelType:Pt,thickness:Wt,classes:jt,look:h};i.push(m),W++}break}})},"setupDoc"),wt=d((t,e="TB")=>{let s=e;if(t.doc)for(let a of t.doc)a.stmt==="dir"&&(s=a.value);return s},"getDir");function Q(t,e,s){if(!e.id||e.id==="</join></fork>"||e.id==="</choice>")return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(i=>{let l=s.get(i);l&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...l.styles])}));let a=t.find(i=>i.id===e.id);a?Object.assign(a,e):t.push(e)}d(Q,"insertOrUpdateNode");function Kt(t){var e;return((e=t==null?void 0:t.classes)==null?void 0:e.join(" "))??""}d(Kt,"getClassesFromDbInfo");function qt(t){return(t==null?void 0:t.styles)??[]}d(qt,"getStylesFromDbInfo");var tt=d((t,e,s,a,i,l,h,y)=>{var O,I,R;let u=e.id,S=s.get(u),m=Kt(S),b=qt(S),D=w();if(_.info("dataFetcher parsedItem",e,S,b),u!=="root"){let E=Et;e.start===!0?E=pe:e.start===!1&&(E=ye),e.type!==et&&(E=e.type),ft.get(u)||ft.set(u,{id:u,shape:E,description:K.sanitizeText(u,D),cssClasses:`${m} ${Se}`,cssStyles:b});let p=ft.get(u);e.description&&(Array.isArray(p.description)?(p.shape=$t,p.description.push(e.description)):(O=p.description)!=null&&O.length&&p.description.length>0?(p.shape=$t,p.description===u?p.description=[e.description]:p.description=[p.description,e.description]):(p.shape=Et,p.description=e.description),p.description=K.sanitizeTextOrArray(p.description,D)),((I=p.description)==null?void 0:I.length)===1&&p.shape===$t&&(p.type==="group"?p.shape=Nt:p.shape=Et),!p.type&&e.doc&&(_.info("Setting cluster for XCX",u,wt(e)),p.type="group",p.isGroup=!0,p.dir=wt(e),p.shape=e.type===Ft?At:Nt,p.cssClasses=`${p.cssClasses} ${$e} ${l?De:""}`);let x={labelStyle:"",shape:p.shape,label:p.description,cssClasses:p.cssClasses,cssCompiledStyles:[],cssStyles:p.cssStyles,id:u,dir:p.dir,domId:gt(u,W),type:p.type,isGroup:p.type==="group",padding:8,rx:10,ry:10,look:h,labelType:"markdown"};if(x.shape===At&&(x.label=""),t&&t.id!=="root"&&(_.trace("Setting node ",u," to be child of its parent ",t.id),x.parentId=t.id),x.centerLabel=!0,e.note){let v={labelStyle:"",shape:fe,label:e.note.text,labelType:"markdown",cssClasses:be,cssStyles:[],cssCompiledStyles:[],id:u+ve+"-"+W,domId:gt(u,W,Ut),type:p.type,isGroup:p.type==="group",padding:(R=D.flowchart)==null?void 0:R.padding,look:h,position:e.note.position},B=u+Ot,j={labelStyle:"",shape:ge,label:e.note.text,cssClasses:p.cssClasses,cssStyles:[],id:u+Ot,domId:gt(u,W,zt),type:"group",isGroup:!0,padding:16,look:h,position:e.note.position};W++,j.id=B,v.parentId=B,Q(a,j,y),Q(a,v,y),Q(a,x,y);let G=u,P=v.id;e.note.position==="left of"&&(G=v.id,P=u),i.push({id:G+"-"+P,start:G,end:P,arrowhead:"none",arrowTypeEnd:"",style:Yt,labelStyle:"",classes:Te,arrowheadStyle:Gt,labelpos:"c",labelType:Pt,thickness:Wt,look:h})}else Q(a,x,y)}e.doc&&(_.trace("Adding nodes children "),Ae(e,e.doc,s,a,i,!l,h,y))},"dataFetcher"),Ne=d(()=>{ft.clear(),W=0},"reset"),C={START_NODE:"[*]",START_TYPE:"start",END_NODE:"[*]",END_TYPE:"end",COLOR_KEYWORD:"color",FILL_KEYWORD:"fill",BG_FILL:"bgFill",STYLECLASS_SEP:","},Rt=d(()=>new Map,"newClassesList"),Bt=d(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),yt=d(t=>JSON.parse(JSON.stringify(t)),"clone"),q,Pe=(q=class{constructor(e){this.version=e,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=Rt(),this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.getAccTitle=se,this.setAccTitle=ie,this.getAccDescription=re,this.setAccDescription=ae,this.setDiagramTitle=ne,this.getDiagramTitle=oe,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this)}extract(e){this.clear(!0);for(let i of Array.isArray(e)?e:e.doc)switch(i.stmt){case Z:this.addState(i.id.trim(),i.type,i.doc,i.description,i.note);break;case Dt:this.addRelation(i.state1,i.state2,i.description);break;case he:this.addStyleClass(i.id.trim(),i.classes);break;case de:this.handleStyleDef(i);break;case ue:this.setCssClass(i.id.trim(),i.styleClass);break;case"click":this.addLink(i.id,i.url,i.tooltip);break}let s=this.getStates(),a=w();Ne(),tt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,!0,a.look,this.classes);for(let i of this.nodes)if(Array.isArray(i.label)){if(i.description=i.label.slice(1),i.isGroup&&i.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${i.id}]`);i.label=i.label[0]}}handleStyleDef(e){let s=e.id.trim().split(","),a=e.styleClass.split(",");for(let i of s){let l=this.getState(i);if(!l){let h=i.trim();this.addState(h),l=this.getState(h)}l&&(l.styles=a.map(h=>{var y;return(y=h.replace(/;/g,""))==null?void 0:y.trim()}))}}setRootDoc(e){_.info("Setting root doc",e),this.rootDoc=e,this.version===1?this.extract(e):this.extract(this.getRootDocV2())}docTranslator(e,s,a){if(s.stmt===Dt){this.docTranslator(e,s.state1,!0),this.docTranslator(e,s.state2,!1);return}if(s.stmt===Z&&(s.id===C.START_NODE?(s.id=e.id+(a?"_start":"_end"),s.start=a):s.id=s.id.trim()),s.stmt!==H&&s.stmt!==Z||!s.doc)return;let i=[],l=[];for(let h of s.doc)if(h.type===Ft){let y=yt(h);y.doc=yt(l),i.push(y),l=[]}else l.push(h);if(i.length>0&&l.length>0){let h={stmt:Z,id:le(),type:"divider",doc:yt(l)};i.push(yt(h)),s.doc=i}s.doc.forEach(h=>this.docTranslator(s,h,!0))}getRootDocV2(){return this.docTranslator({id:H,stmt:H},{id:H,stmt:H,doc:this.rootDoc},!0),{id:H,doc:this.rootDoc}}addState(e,s=et,a=void 0,i=void 0,l=void 0,h=void 0,y=void 0,u=void 0){let S=e==null?void 0:e.trim();if(!this.currentDocument.states.has(S))_.info("Adding state ",S,i),this.currentDocument.states.set(S,{stmt:Z,id:S,descriptions:[],type:s,doc:a,note:l,classes:[],styles:[],textStyles:[]});else{let m=this.currentDocument.states.get(S);if(!m)throw new Error(`State not found: ${S}`);m.doc||(m.doc=a),m.type||(m.type=s)}if(i&&(_.info("Setting state description",S,i),(Array.isArray(i)?i:[i]).forEach(m=>this.addDescription(S,m.trim()))),l){let m=this.currentDocument.states.get(S);if(!m)throw new Error(`State not found: ${S}`);m.note=l,m.note.text=K.sanitizeText(m.note.text,w())}h&&(_.info("Setting state classes",S,h),(Array.isArray(h)?h:[h]).forEach(m=>this.setCssClass(S,m.trim()))),y&&(_.info("Setting state styles",S,y),(Array.isArray(y)?y:[y]).forEach(m=>this.setStyle(S,m.trim()))),u&&(_.info("Setting state styles",S,y),(Array.isArray(u)?u:[u]).forEach(m=>this.setTextStyle(S,m.trim())))}clear(e){this.nodes=[],this.edges=[],this.documents={root:Bt()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=Rt(),e||(this.links=new Map,ce())}getState(e){return this.currentDocument.states.get(e)}getStates(){return this.currentDocument.states}logDocuments(){_.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(e,s,a){this.links.set(e,{url:s,tooltip:a}),_.warn("Adding link",e,s,a)}getLinks(){return this.links}startIdIfNeeded(e=""){return e===C.START_NODE?(this.startEndCount++,`${C.START_TYPE}${this.startEndCount}`):e}startTypeIfNeeded(e="",s=et){return e===C.START_NODE?C.START_TYPE:s}endIdIfNeeded(e=""){return e===C.END_NODE?(this.startEndCount++,`${C.END_TYPE}${this.startEndCount}`):e}endTypeIfNeeded(e="",s=et){return e===C.END_NODE?C.END_TYPE:s}addRelationObjs(e,s,a=""){let i=this.startIdIfNeeded(e.id.trim()),l=this.startTypeIfNeeded(e.id.trim(),e.type),h=this.startIdIfNeeded(s.id.trim()),y=this.startTypeIfNeeded(s.id.trim(),s.type);this.addState(i,l,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.addState(h,y,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:K.sanitizeText(a,w())})}addRelation(e,s,a){if(typeof e=="object"&&typeof s=="object")this.addRelationObjs(e,s,a);else if(typeof e=="string"&&typeof s=="string"){let i=this.startIdIfNeeded(e.trim()),l=this.startTypeIfNeeded(e),h=this.endIdIfNeeded(s.trim()),y=this.endTypeIfNeeded(s);this.addState(i,l),this.addState(h,y),this.currentDocument.relations.push({id1:i,id2:h,relationTitle:a?K.sanitizeText(a,w()):void 0})}}addDescription(e,s){var l;let a=this.currentDocument.states.get(e),i=s.startsWith(":")?s.replace(":","").trim():s;(l=a==null?void 0:a.descriptions)==null||l.push(K.sanitizeText(i,w()))}cleanupLabel(e){return e.startsWith(":")?e.slice(2).trim():e.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(e,s=""){this.classes.has(e)||this.classes.set(e,{id:e,styles:[],textStyles:[]});let a=this.classes.get(e);s&&a&&s.split(C.STYLECLASS_SEP).forEach(i=>{let l=i.replace(/([^;]*);/,"$1").trim();if(RegExp(C.COLOR_KEYWORD).exec(i)){let h=l.replace(C.FILL_KEYWORD,C.BG_FILL).replace(C.COLOR_KEYWORD,C.FILL_KEYWORD);a.textStyles.push(h)}a.styles.push(l)})}getClasses(){return this.classes}setCssClass(e,s){e.split(",").forEach(a=>{var l;let i=this.getState(a);if(!i){let h=a.trim();this.addState(h),i=this.getState(h)}(l=i==null?void 0:i.classes)==null||l.push(s)})}setStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.styles)==null||i.push(s)}setTextStyle(e,s){var a,i;(i=(a=this.getState(e))==null?void 0:a.textStyles)==null||i.push(s)}getDirectionStatement(){return this.rootDoc.find(e=>e.stmt==="dir")}getDirection(){var e;return((e=this.getDirectionStatement())==null?void 0:e.value)??"TB"}setDirection(e){let s=this.getDirectionStatement();s?s.value=e:this.rootDoc.unshift({stmt:"dir",value:e})}trimColon(e){return e.startsWith(":")?e.slice(1).trim():e.trim()}getData(){let e=w();return{nodes:this.nodes,edges:this.edges,other:{},config:e,direction:Mt(this.getRootDocV2())}}getConfig(){return w().state}},d(q,"StateDB"),q.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},q),Oe=d(t=>`
|
|
7
|
+
defs [id$="-barbEnd"] {
|
|
8
|
+
fill: ${t.transitionColor};
|
|
9
|
+
stroke: ${t.transitionColor};
|
|
10
|
+
}
|
|
11
|
+
g.stateGroup text {
|
|
12
|
+
fill: ${t.nodeBorder};
|
|
13
|
+
stroke: none;
|
|
14
|
+
font-size: 10px;
|
|
15
|
+
}
|
|
16
|
+
g.stateGroup text {
|
|
17
|
+
fill: ${t.textColor};
|
|
18
|
+
stroke: none;
|
|
19
|
+
font-size: 10px;
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
g.stateGroup .state-title {
|
|
23
|
+
font-weight: bolder;
|
|
24
|
+
fill: ${t.stateLabelColor};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
g.stateGroup rect {
|
|
28
|
+
fill: ${t.mainBkg};
|
|
29
|
+
stroke: ${t.nodeBorder};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
g.stateGroup line {
|
|
33
|
+
stroke: ${t.lineColor};
|
|
34
|
+
stroke-width: ${t.strokeWidth||1};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.transition {
|
|
38
|
+
stroke: ${t.transitionColor};
|
|
39
|
+
stroke-width: ${t.strokeWidth||1};
|
|
40
|
+
fill: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.stateGroup .composit {
|
|
44
|
+
fill: ${t.background};
|
|
45
|
+
border-bottom: 1px
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.stateGroup .alt-composit {
|
|
49
|
+
fill: #e0e0e0;
|
|
50
|
+
border-bottom: 1px
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.state-note {
|
|
54
|
+
stroke: ${t.noteBorderColor};
|
|
55
|
+
fill: ${t.noteBkgColor};
|
|
56
|
+
|
|
57
|
+
text {
|
|
58
|
+
fill: ${t.noteTextColor};
|
|
59
|
+
stroke: none;
|
|
60
|
+
font-size: 10px;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.stateLabel .box {
|
|
65
|
+
stroke: none;
|
|
66
|
+
stroke-width: 0;
|
|
67
|
+
fill: ${t.mainBkg};
|
|
68
|
+
opacity: 0.5;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.edgeLabel .label rect {
|
|
72
|
+
fill: ${t.labelBackgroundColor};
|
|
73
|
+
opacity: 0.5;
|
|
74
|
+
}
|
|
75
|
+
.edgeLabel {
|
|
76
|
+
background-color: ${t.edgeLabelBackground};
|
|
77
|
+
p {
|
|
78
|
+
background-color: ${t.edgeLabelBackground};
|
|
79
|
+
}
|
|
80
|
+
rect {
|
|
81
|
+
opacity: 0.5;
|
|
82
|
+
background-color: ${t.edgeLabelBackground};
|
|
83
|
+
fill: ${t.edgeLabelBackground};
|
|
84
|
+
}
|
|
85
|
+
text-align: center;
|
|
86
|
+
}
|
|
87
|
+
.edgeLabel .label text {
|
|
88
|
+
fill: ${t.transitionLabelColor||t.tertiaryTextColor};
|
|
89
|
+
}
|
|
90
|
+
.label div .edgeLabel {
|
|
91
|
+
color: ${t.transitionLabelColor||t.tertiaryTextColor};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.stateLabel text {
|
|
95
|
+
fill: ${t.stateLabelColor};
|
|
96
|
+
font-size: 10px;
|
|
97
|
+
font-weight: bold;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.node circle.state-start {
|
|
101
|
+
fill: ${t.specialStateColor};
|
|
102
|
+
stroke: ${t.specialStateColor};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.node .fork-join {
|
|
106
|
+
fill: ${t.specialStateColor};
|
|
107
|
+
stroke: ${t.specialStateColor};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.node circle.state-end {
|
|
111
|
+
fill: ${t.innerEndBackground};
|
|
112
|
+
stroke: ${t.background};
|
|
113
|
+
stroke-width: 1.5
|
|
114
|
+
}
|
|
115
|
+
.end-state-inner {
|
|
116
|
+
fill: ${t.compositeBackground||t.background};
|
|
117
|
+
// stroke: ${t.background};
|
|
118
|
+
stroke-width: 1.5
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.node rect {
|
|
122
|
+
fill: ${t.stateBkg||t.mainBkg};
|
|
123
|
+
stroke: ${t.stateBorder||t.nodeBorder};
|
|
124
|
+
stroke-width: ${t.strokeWidth||1}px;
|
|
125
|
+
}
|
|
126
|
+
.node polygon {
|
|
127
|
+
fill: ${t.mainBkg};
|
|
128
|
+
stroke: ${t.stateBorder||t.nodeBorder};;
|
|
129
|
+
stroke-width: ${t.strokeWidth||1}px;
|
|
130
|
+
}
|
|
131
|
+
[id$="-barbEnd"] {
|
|
132
|
+
fill: ${t.lineColor};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.statediagram-cluster rect {
|
|
136
|
+
fill: ${t.compositeTitleBackground};
|
|
137
|
+
stroke: ${t.stateBorder||t.nodeBorder};
|
|
138
|
+
stroke-width: ${t.strokeWidth||1}px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.cluster-label, .nodeLabel {
|
|
142
|
+
color: ${t.stateLabelColor};
|
|
143
|
+
// line-height: 1;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.statediagram-cluster rect.outer {
|
|
147
|
+
rx: 5px;
|
|
148
|
+
ry: 5px;
|
|
149
|
+
}
|
|
150
|
+
.statediagram-state .divider {
|
|
151
|
+
stroke: ${t.stateBorder||t.nodeBorder};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.statediagram-state .title-state {
|
|
155
|
+
rx: 5px;
|
|
156
|
+
ry: 5px;
|
|
157
|
+
}
|
|
158
|
+
.statediagram-cluster.statediagram-cluster .inner {
|
|
159
|
+
fill: ${t.compositeBackground||t.background};
|
|
160
|
+
}
|
|
161
|
+
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
162
|
+
fill: ${t.altBackground?t.altBackground:"#efefef"};
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.statediagram-cluster .inner {
|
|
166
|
+
rx:0;
|
|
167
|
+
ry:0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.statediagram-state rect.basic {
|
|
171
|
+
rx: 5px;
|
|
172
|
+
ry: 5px;
|
|
173
|
+
}
|
|
174
|
+
.statediagram-state rect.divider {
|
|
175
|
+
stroke-dasharray: 10,10;
|
|
176
|
+
fill: ${t.altBackground?t.altBackground:"#efefef"};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.note-edge {
|
|
180
|
+
stroke-dasharray: 5;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.statediagram-note rect {
|
|
184
|
+
fill: ${t.noteBkgColor};
|
|
185
|
+
stroke: ${t.noteBorderColor};
|
|
186
|
+
stroke-width: 1px;
|
|
187
|
+
rx: 0;
|
|
188
|
+
ry: 0;
|
|
189
|
+
}
|
|
190
|
+
.statediagram-note rect {
|
|
191
|
+
fill: ${t.noteBkgColor};
|
|
192
|
+
stroke: ${t.noteBorderColor};
|
|
193
|
+
stroke-width: 1px;
|
|
194
|
+
rx: 0;
|
|
195
|
+
ry: 0;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.statediagram-note text {
|
|
199
|
+
fill: ${t.noteTextColor};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.statediagram-note .nodeLabel {
|
|
203
|
+
color: ${t.noteTextColor};
|
|
204
|
+
}
|
|
205
|
+
.statediagram .edgeLabel {
|
|
206
|
+
color: red; // ${t.noteTextColor};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
[id$="-dependencyStart"], [id$="-dependencyEnd"] {
|
|
210
|
+
fill: ${t.lineColor};
|
|
211
|
+
stroke: ${t.lineColor};
|
|
212
|
+
stroke-width: ${t.strokeWidth||1};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.statediagramTitleText {
|
|
216
|
+
text-anchor: middle;
|
|
217
|
+
font-size: 18px;
|
|
218
|
+
fill: ${t.textColor};
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
[data-look="neo"].statediagram-cluster rect {
|
|
222
|
+
fill: ${t.mainBkg};
|
|
223
|
+
stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};
|
|
224
|
+
stroke-width: ${t.strokeWidth??1};
|
|
225
|
+
}
|
|
226
|
+
[data-look="neo"].statediagram-cluster rect.outer {
|
|
227
|
+
rx: ${t.radius}px;
|
|
228
|
+
ry: ${t.radius}px;
|
|
229
|
+
filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}
|
|
230
|
+
}
|
|
231
|
+
`,"getStyles"),We=Oe;export{Ye as Y,Pe as _,We as g,Ge as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as y}from"./chunk-HN6EAY2L-BBnyTNdB.js";import{Z as f,T as Y,N as ot,b as x,D,d as q,l as ie,J as m,a as O,s as b,y as L,f as Ne,c as Ee,Q as R,O as ae,t as rt,K as ue,e as T,X as I,R as z,g as it,n as j,h as at,i as ut,j as dt}from"./chunk-H3VCZNTA-Cx5XV_aC.js";import{m as d,bv as X,bw as st,aV as ct}from"./index-BgeqpYgd.js";function E(e,n,t,o){var r;do r=ie(o);while(e.hasNode(r));return t.dummy=n,e.setNode(r,t),r}d(E,"addDummyNode");function Oe(e){var n=new y().setGraph(e.graph());return f(e.nodes(),function(t){n.setNode(t,e.node(t))}),f(e.edges(),function(t){var o=n.edge(t.v,t.w)||{weight:0,minlen:1},r=e.edge(t);n.setEdge(t.v,t.w,{weight:o.weight+r.weight,minlen:Math.max(o.minlen,r.minlen)})}),n}d(Oe,"simplify");function de(e){var n=new y({multigraph:e.isMultigraph()}).setGraph(e.graph());return f(e.nodes(),function(t){e.children(t).length||n.setNode(t,e.node(t))}),f(e.edges(),function(t){n.setEdge(t,e.edge(t))}),n}d(de,"asNonCompoundGraph");function H(e,n){var t=e.x,o=e.y,r=n.x-t,i=n.y-o,a=e.width/2,u=e.height/2;if(!r&&!i)throw new Error("Not possible to find intersection inside of the rectangle");var s,c;return Math.abs(i)*a>Math.abs(r)*u?(i<0&&(u=-u),s=u*r/i,c=u):(r<0&&(a=-a),s=a,c=a*i/r),{x:t+s,y:o+c}}d(H,"intersectRect");function S(e){var n=m(O(se(e)+1),function(){return[]});return f(e.nodes(),function(t){var o=e.node(t),r=o.rank;b(r)||(n[r][o.order]=t)}),n}d(S,"buildLayerMatrix");function Ie(e){var n=L(m(e.nodes(),function(t){return e.node(t).rank}));f(e.nodes(),function(t){var o=e.node(t);Ne(o,"rank")&&(o.rank-=n)})}d(Ie,"normalizeRanks");function Pe(e){var n=L(m(e.nodes(),function(i){return e.node(i).rank})),t=[];f(e.nodes(),function(i){var a=e.node(i).rank-n;t[a]||(t[a]=[]),t[a].push(i)});var o=0,r=e.graph().nodeRankFactor;f(t,function(i,a){b(i)&&a%r!==0?--o:o&&f(i,function(u){e.node(u).rank+=o})})}d(Pe,"removeEmptyRanks");function K(e,n,t,o){var r={width:0,height:0};return arguments.length>=4&&(r.rank=t,r.order=o),E(e,"border",r,n)}d(K,"addBorderNode");function se(e){return x(m(e.nodes(),function(n){var t=e.node(n).rank;if(!b(t))return t}))}d(se,"maxRank");function Ce(e,n){var t={lhs:[],rhs:[]};return f(e,function(o){n(o)?t.lhs.push(o):t.rhs.push(o)}),t}d(Ce,"partition");function Le(e,n){var t=Ee();try{return n()}finally{console.log(e+" time: "+(Ee()-t)+"ms")}}d(Le,"time");function _e(e,n){return n()}d(_e,"notime");function Re(e){function n(t){var o=e.children(t),r=e.node(t);if(o.length&&f(o,n),Object.prototype.hasOwnProperty.call(r,"minRank")){r.borderLeft=[],r.borderRight=[];for(var i=r.minRank,a=r.maxRank+1;i<a;++i)Z(e,"borderLeft","_bl",t,r,i),Z(e,"borderRight","_br",t,r,i)}}d(n,"dfs"),f(e.children(),n)}d(Re,"addBorderSegments");function Z(e,n,t,o,r,i){var a={width:0,height:0,rank:i,borderType:n},u=r[n][i-1],s=E(e,"border",a,t);r[n][i]=s,e.setParent(s,o),u&&e.setEdge(u,s,{weight:1})}d(Z,"addBorderNode");function Te(e){var n=e.graph().rankdir.toLowerCase();(n==="lr"||n==="rl")&&ce(e)}d(Te,"adjust");function je(e){var n=e.graph().rankdir.toLowerCase();(n==="bt"||n==="rl")&&Se(e),(n==="lr"||n==="rl")&&(Me(e),ce(e))}d(je,"undo");function ce(e){f(e.nodes(),function(n){Q(e.node(n))}),f(e.edges(),function(n){Q(e.edge(n))})}d(ce,"swapWidthHeight");function Q(e){var n=e.width;e.width=e.height,e.height=n}d(Q,"swapWidthHeightOne");function Se(e){f(e.nodes(),function(n){M(e.node(n))}),f(e.edges(),function(n){var t=e.edge(n);f(t.points,M),Object.prototype.hasOwnProperty.call(t,"y")&&M(t)})}d(Se,"reverseY");function M(e){e.y=-e.y}d(M,"reverseYOne");function Me(e){f(e.nodes(),function(n){G(e.node(n))}),f(e.edges(),function(n){var t=e.edge(n);f(t.points,G),Object.prototype.hasOwnProperty.call(t,"x")&&G(t)})}d(Me,"swapXY");function G(e){var n=e.x;e.x=e.y,e.y=n}d(G,"swapXYOne");var N,ft=(N=class{constructor(){var n={};n._next=n._prev=n,this._sentinel=n}dequeue(){var n=this._sentinel,t=n._prev;if(t!==n)return U(t),t}enqueue(n){var t=this._sentinel;n._prev&&n._next&&U(n),n._next=t._next,t._next._prev=n,t._next=n,n._prev=t}toString(){for(var n=[],t=this._sentinel,o=t._prev;o!==t;)n.push(JSON.stringify(o,Ge)),o=o._prev;return"["+n.join(", ")+"]"}},d(N,"List"),N);function U(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}d(U,"unlink");function Ge(e,n){if(e!=="_next"&&e!=="_prev")return n}d(Ge,"filterOutLinks");var ht=st(1);function Be(e,n){if(e.nodeCount()<=1)return[];var t=Ve(e,n||ht),o=Fe(t.graph,t.buckets,t.zeroIdx);return R(m(o,function(r){return e.outEdges(r.v,r.w)}))}d(Be,"greedyFAS");function Fe(e,n,t){for(var o=[],r=n[n.length-1],i=n[0],a;e.nodeCount();){for(;a=i.dequeue();)B(e,n,t,a);for(;a=r.dequeue();)B(e,n,t,a);if(e.nodeCount()){for(var u=n.length-2;u>0;--u)if(a=n[u].dequeue(),a){o=o.concat(B(e,n,t,a,!0));break}}}return o}d(Fe,"doGreedyFAS");function B(e,n,t,o,r){var i=r?[]:void 0;return f(e.inEdges(o.v),function(a){var u=e.edge(a),s=e.node(a.v);r&&i.push({v:a.v,w:a.w}),s.out-=u,$(n,t,s)}),f(e.outEdges(o.v),function(a){var u=e.edge(a),s=a.w,c=e.node(s);c.in-=u,$(n,t,c)}),e.removeNode(o.v),i}d(B,"removeNode");function Ve(e,n){var t=new y,o=0,r=0;f(e.nodes(),function(u){t.setNode(u,{v:u,in:0,out:0})}),f(e.edges(),function(u){var s=t.edge(u.v,u.w)||0,c=n(u),h=s+c;t.setEdge(u.v,u.w,h),r=Math.max(r,t.node(u.v).out+=c),o=Math.max(o,t.node(u.w).in+=c)});var i=O(r+o+3).map(function(){return new ft}),a=o+1;return f(t.nodes(),function(u){$(i,a,t.node(u))}),{graph:t,buckets:i,zeroIdx:a}}d(Ve,"buildState");function $(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}d($,"assignBucket");function Ye(e){var n=e.graph().acyclicer==="greedy"?Be(e,t(e)):De(e);f(n,function(o){var r=e.edge(o);e.removeEdge(o),r.forwardName=o.name,r.reversed=!0,e.setEdge(o.w,o.v,r,ie("rev"))});function t(o){return function(r){return o.edge(r).weight}}d(t,"weightFn")}d(Ye,"run");function De(e){var n=[],t={},o={};function r(i){Object.prototype.hasOwnProperty.call(o,i)||(o[i]=!0,t[i]=!0,f(e.outEdges(i),function(a){Object.prototype.hasOwnProperty.call(t,a.w)?n.push(a):r(a.w)}),delete t[i])}return d(r,"dfs"),f(e.nodes(),r),n}d(De,"dfsFAS");function $e(e){f(e.edges(),function(n){var t=e.edge(n);if(t.reversed){e.removeEdge(n);var o=t.forwardName;delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,o)}})}d($e,"undo");function qe(e){e.graph().dummyChains=[],f(e.edges(),function(n){ze(e,n)})}d(qe,"run");function ze(e,n){var t=n.v,o=e.node(t).rank,r=n.w,i=e.node(r).rank,a=n.name,u=e.edge(n),s=u.labelRank;if(i!==o+1){e.removeEdge(n);var c=void 0,h,g;for(g=0,++o;o<i;++g,++o)u.points=[],c={width:0,height:0,edgeLabel:u,edgeObj:n,rank:o},h=E(e,"edge",c,"_d"),o===s&&(c.width=u.width,c.height=u.height,c.dummy="edge-label",c.labelpos=u.labelpos),e.setEdge(t,h,{weight:u.weight},a),g===0&&e.graph().dummyChains.push(h),t=h;e.setEdge(t,r,{weight:u.weight},a)}}d(ze,"normalizeEdge");function Ae(e){f(e.graph().dummyChains,function(n){var t=e.node(n),o=t.edgeLabel,r;for(e.setEdge(t.edgeObj,o);t.dummy;)r=e.successors(n)[0],e.removeNode(n),o.points.push({x:t.x,y:t.y}),t.dummy==="edge-label"&&(o.x=t.x,o.y=t.y,o.width=t.width,o.height=t.height),n=r,t=e.node(n)})}d(Ae,"undo");function A(e){var n={};function t(o){var r=e.node(o);if(Object.prototype.hasOwnProperty.call(n,o))return r.rank;n[o]=!0;var i=L(m(e.outEdges(o),function(a){return t(a.w)-e.edge(a).minlen}));return(i===Number.POSITIVE_INFINITY||i===void 0||i===null)&&(i=0),r.rank=i}d(t,"dfs"),f(e.sources(),t)}d(A,"longestPath");function P(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}d(P,"slack");function fe(e){var n=new y({directed:!1}),t=e.nodes()[0],o=e.nodeCount();n.setNode(t,{});for(var r,i;Je(n,e)<o;)r=We(n,e),i=n.hasNode(r.v)?P(e,r):-P(e,r),Xe(n,e,i);return n}d(fe,"feasibleTree");function Je(e,n){function t(o){f(n.nodeEdges(o),function(r){var i=r.v,a=o===i?r.w:i;!e.hasNode(a)&&!P(n,r)&&(e.setNode(a,{}),e.setEdge(o,a,{}),t(a))})}return d(t,"dfs"),f(e.nodes(),t),e.nodeCount()}d(Je,"tightTree");function We(e,n){return ae(n.edges(),function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return P(n,t)})}d(We,"findMinSlackEdge");function Xe(e,n,t){f(e.nodes(),function(o){n.node(o).rank+=t})}d(Xe,"shiftRanks");He.CycleException=_;function He(e){var n={},t={},o=[];function r(i){if(Object.prototype.hasOwnProperty.call(t,i))throw new _;Object.prototype.hasOwnProperty.call(n,i)||(t[i]=!0,n[i]=!0,f(e.predecessors(i),r),delete t[i],o.push(i))}if(d(r,"visit"),f(e.sinks(),r),rt(n)!==e.nodeCount())throw new _;return o}d(He,"topsort");function _(){}d(_,"CycleException");_.prototype=new Error;function he(e,n,t){ct(n)||(n=[n]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),r=[],i={};return f(n,function(a){if(!e.hasNode(a))throw new Error("Graph does not have node: "+a);ge(e,a,t==="post",i,o,r)}),r}d(he,"dfs");function ge(e,n,t,o,r,i){Object.prototype.hasOwnProperty.call(o,n)||(o[n]=!0,t||i.push(n),f(r(n),function(a){ge(e,a,t,o,r,i)}),t&&i.push(n))}d(ge,"doDfs");function Ke(e,n){return he(e,n,"post")}d(Ke,"postorder");function Ze(e,n){return he(e,n,"pre")}d(Ze,"preorder");k.initLowLimValues=W;k.initCutValues=J;k.calcCutValue=le;k.leaveEdge=ve;k.enterEdge=me;k.exchangeEdges=we;function k(e){e=Oe(e),A(e);var n=fe(e);W(n),J(n,e);for(var t,o;t=ve(n);)o=me(n,e,t),we(n,e,t,o)}d(k,"networkSimplex");function J(e,n){var t=Ke(e,e.nodes());t=t.slice(0,t.length-1),f(t,function(o){Qe(e,n,o)})}d(J,"initCutValues");function Qe(e,n,t){var o=e.node(t),r=o.parent;e.edge(t,r).cutvalue=le(e,n,t)}d(Qe,"assignCutValue");function le(e,n,t){var o=e.node(t),r=o.parent,i=!0,a=n.edge(t,r),u=0;return a||(i=!1,a=n.edge(r,t)),u=a.weight,f(n.nodeEdges(t),function(s){var c=s.v===t,h=c?s.w:s.v;if(h!==r){var g=c===i,l=n.edge(s).weight;if(u+=g?l:-l,en(e,t,h)){var p=e.edge(t,h).cutvalue;u+=g?-p:p}}}),u}d(le,"calcCutValue");function W(e,n){arguments.length<2&&(n=e.nodes()[0]),pe(e,{},1,n)}d(W,"initLowLimValues");function pe(e,n,t,o,r){var i=t,a=e.node(o);return n[o]=!0,f(e.neighbors(o),function(u){Object.prototype.hasOwnProperty.call(n,u)||(t=pe(e,n,t,u,o))}),a.low=i,a.lim=t++,r?a.parent=r:delete a.parent,t}d(pe,"dfsAssignLowLim");function ve(e){return ue(e.edges(),function(n){return e.edge(n).cutvalue<0})}d(ve,"leaveEdge");function me(e,n,t){var o=t.v,r=t.w;n.hasEdge(o,r)||(o=t.w,r=t.v);var i=e.node(o),a=e.node(r),u=i,s=!1;i.lim>a.lim&&(u=a,s=!0);var c=T(n.edges(),function(h){return s===ee(e,e.node(h.v),u)&&s!==ee(e,e.node(h.w),u)});return ae(c,function(h){return P(n,h)})}d(me,"enterEdge");function we(e,n,t,o){var r=t.v,i=t.w;e.removeEdge(r,i),e.setEdge(o.v,o.w,{}),W(e),J(e,n),Ue(e,n)}d(we,"exchangeEdges");function Ue(e,n){var t=ue(e.nodes(),function(r){return!n.node(r).parent}),o=Ze(e,t);o=o.slice(1),f(o,function(r){var i=e.node(r).parent,a=n.edge(r,i),u=!1;a||(a=n.edge(i,r),u=!0),n.node(r).rank=n.node(i).rank+(u?a.minlen:-a.minlen)})}d(Ue,"updateRanks");function en(e,n,t){return e.hasEdge(n,t)}d(en,"isTreeEdge");function ee(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}d(ee,"isDescendant");function nn(e){switch(e.graph().ranker){case"network-simplex":ne(e);break;case"tight-tree":tn(e);break;case"longest-path":gt(e);break;default:ne(e)}}d(nn,"rank");var gt=A;function tn(e){A(e),fe(e)}d(tn,"tightTreeRanker");function ne(e){k(e)}d(ne,"networkSimplexRanker");function on(e){var n=E(e,"root",{},"_root"),t=rn(e),o=x(I(t))-1,r=2*o+1;e.graph().nestingRoot=n,f(e.edges(),function(a){e.edge(a).minlen*=r});var i=an(e)+1;f(e.children(),function(a){be(e,n,r,i,o,t,a)}),e.graph().nodeRankFactor=r}d(on,"run");function be(e,n,t,o,r,i,a){var u=e.children(a);if(!u.length){a!==n&&e.setEdge(n,a,{weight:0,minlen:t});return}var s=K(e,"_bt"),c=K(e,"_bb"),h=e.node(a);e.setParent(s,a),h.borderTop=s,e.setParent(c,a),h.borderBottom=c,f(u,function(g){be(e,n,t,o,r,i,g);var l=e.node(g),p=l.borderTop?l.borderTop:g,v=l.borderBottom?l.borderBottom:g,w=l.borderTop?o:2*o,C=p!==v?1:r-i[a]+1;e.setEdge(s,p,{weight:w,minlen:C,nestingEdge:!0}),e.setEdge(v,c,{weight:w,minlen:C,nestingEdge:!0})}),e.parent(a)||e.setEdge(n,s,{weight:0,minlen:r+i[a]})}d(be,"dfs");function rn(e){var n={};function t(o,r){var i=e.children(o);i&&i.length&&f(i,function(a){t(a,r+1)}),n[o]=r}return d(t,"dfs"),f(e.children(),function(o){t(o,1)}),n}d(rn,"treeDepths");function an(e){return z(e.edges(),function(n,t){return n+e.edge(t).weight},0)}d(an,"sumWeights");function un(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,f(e.edges(),function(t){var o=e.edge(t);o.nestingEdge&&e.removeEdge(t)})}d(un,"cleanup");function dn(e,n,t){var o={},r;f(t,function(i){for(var a=e.parent(i),u,s;a;){if(u=e.parent(a),u?(s=o[u],o[u]=a):(s=r,r=a),s&&s!==a){n.setEdge(s,a);return}a=u}})}d(dn,"addSubgraphConstraints");function sn(e,n,t){var o=cn(e),r=new y({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(i){return e.node(i)});return f(e.nodes(),function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(r.setNode(i),r.setParent(i,u||o),f(e[t](i),function(s){var c=s.v===i?s.w:s.v,h=r.edge(c,i),g=b(h)?0:h.weight;r.setEdge(c,i,{weight:e.edge(s).weight+g})}),Object.prototype.hasOwnProperty.call(a,"minRank")&&r.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))}),r}d(sn,"buildLayerGraph");function cn(e){for(var n;e.hasNode(n=ie("_root")););return n}d(cn,"createRootNode");function fn(e,n){for(var t=0,o=1;o<n.length;++o)t+=hn(e,n[o-1],n[o]);return t}d(fn,"crossCount");function hn(e,n,t){for(var o=it(t,m(t,function(c,h){return h})),r=R(m(n,function(c){return j(m(e.outEdges(c),function(h){return{pos:o[h.w],weight:e.edge(h).weight}}),"pos")})),i=1;i<t.length;)i<<=1;var a=2*i-1;i-=1;var u=m(new Array(a),function(){return 0}),s=0;return f(r.forEach(function(c){var h=c.pos+i;u[h]+=c.weight;for(var g=0;h>0;)h%2&&(g+=u[h+1]),h=h-1>>1,u[h]+=c.weight;s+=c.weight*g})),s}d(hn,"twoLayerCrossCount");function gn(e){var n={},t=T(e.nodes(),function(u){return!e.children(u).length}),o=x(m(t,function(u){return e.node(u).rank})),r=m(O(o+1),function(){return[]});function i(u){if(!Ne(n,u)){n[u]=!0;var s=e.node(u);r[s.rank].push(u),f(e.successors(u),i)}}d(i,"dfs");var a=j(t,function(u){return e.node(u).rank});return f(a,i),r}d(gn,"initOrder");function ln(e,n){return m(n,function(t){var o=e.inEdges(t);if(o.length){var r=z(o,function(i,a){var u=e.edge(a),s=e.node(a.v);return{sum:i.sum+u.weight*s.order,weight:i.weight+u.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}d(ln,"barycenter");function pn(e,n){var t={};f(e,function(r,i){var a=t[r.v]={indegree:0,in:[],out:[],vs:[r.v],i};b(r.barycenter)||(a.barycenter=r.barycenter,a.weight=r.weight)}),f(n.edges(),function(r){var i=t[r.v],a=t[r.w];!b(i)&&!b(a)&&(a.indegree++,i.out.push(t[r.w]))});var o=T(t,function(r){return!r.indegree});return vn(o)}d(pn,"resolveConflicts");function vn(e){var n=[];function t(i){return function(a){a.merged||(b(a.barycenter)||b(i.barycenter)||a.barycenter>=i.barycenter)&&mn(i,a)}}d(t,"handleIn");function o(i){return function(a){a.in.push(i),--a.indegree===0&&e.push(a)}}for(d(o,"handleOut");e.length;){var r=e.pop();n.push(r),f(r.in.reverse(),t(r)),f(r.out,o(r))}return m(T(n,function(i){return!i.merged}),function(i){return Y(i,["vs","i","barycenter","weight"])})}d(vn,"doResolveConflicts");function mn(e,n){var t=0,o=0;e.weight&&(t+=e.barycenter*e.weight,o+=e.weight),n.weight&&(t+=n.barycenter*n.weight,o+=n.weight),e.vs=n.vs.concat(e.vs),e.barycenter=t/o,e.weight=o,e.i=Math.min(n.i,e.i),n.merged=!0}d(mn,"mergeEntries");function wn(e,n){var t=Ce(e,function(h){return Object.prototype.hasOwnProperty.call(h,"barycenter")}),o=t.lhs,r=j(t.rhs,function(h){return-h.i}),i=[],a=0,u=0,s=0;o.sort(bn(!!n)),s=te(i,r,s),f(o,function(h){s+=h.vs.length,i.push(h.vs),a+=h.barycenter*h.weight,u+=h.weight,s=te(i,r,s)});var c={vs:R(i)};return u&&(c.barycenter=a/u,c.weight=u),c}d(wn,"sort");function te(e,n,t){for(var o;n.length&&(o=D(n)).i<=t;)n.pop(),e.push(o.vs),t++;return t}d(te,"consumeUnsortable");function bn(e){return function(n,t){return n.barycenter<t.barycenter?-1:n.barycenter>t.barycenter?1:e?t.i-n.i:n.i-t.i}}d(bn,"compareWithBias");function ye(e,n,t,o){var r=e.children(n),i=e.node(n),a=i?i.borderLeft:void 0,u=i?i.borderRight:void 0,s={};a&&(r=T(r,function(v){return v!==a&&v!==u}));var c=ln(e,r);f(c,function(v){if(e.children(v.v).length){var w=ye(e,v.v,t,o);s[v.v]=w,Object.prototype.hasOwnProperty.call(w,"barycenter")&&kn(v,w)}});var h=pn(c,t);yn(h,s);var g=wn(h,o);if(a&&(g.vs=R([a,g.vs,u]),e.predecessors(a).length)){var l=e.node(e.predecessors(a)[0]),p=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+l.order+p.order)/(g.weight+2),g.weight+=2}return g}d(ye,"sortSubgraph");function yn(e,n){f(e,function(t){t.vs=R(t.vs.map(function(o){return n[o]?n[o].vs:o}))})}d(yn,"expandSubgraphs");function kn(e,n){b(e.barycenter)?(e.barycenter=n.barycenter,e.weight=n.weight):(e.barycenter=(e.barycenter*e.weight+n.barycenter*n.weight)/(e.weight+n.weight),e.weight+=n.weight)}d(kn,"mergeBarycenters");function xn(e){var n=se(e),t=oe(e,O(1,n+1),"inEdges"),o=oe(e,O(n-1,-1,-1),"outEdges"),r=gn(e);re(e,r);for(var i=Number.POSITIVE_INFINITY,a,u=0,s=0;s<4;++u,++s){En(u%2?t:o,u%4>=2),r=S(e);var c=fn(e,r);c<i&&(s=0,a=at(r),i=c)}re(e,a)}d(xn,"order");function oe(e,n,t){return m(n,function(o){return sn(e,o,t)})}d(oe,"buildLayerGraphs");function En(e,n){var t=new y;f(e,function(o){var r=o.graph().root,i=ye(o,r,t,n);f(i.vs,function(a,u){o.node(a).order=u}),dn(o,t,i.vs)})}d(En,"sweepLayerGraphs");function re(e,n){f(n,function(t){f(t,function(o,r){e.node(o).order=r})})}d(re,"assignOrder");function Nn(e){var n=In(e);f(e.graph().dummyChains,function(t){for(var o=e.node(t),r=o.edgeObj,i=On(e,n,r.v,r.w),a=i.path,u=i.lca,s=0,c=a[s],h=!0;t!==r.w;){if(o=e.node(t),h){for(;(c=a[s])!==u&&e.node(c).maxRank<o.rank;)s++;c===u&&(h=!1)}if(!h){for(;s<a.length-1&&e.node(c=a[s+1]).minRank<=o.rank;)s++;c=a[s]}e.setParent(t,c),t=e.successors(t)[0]}})}d(Nn,"parentDummyChains");function On(e,n,t,o){var r=[],i=[],a=Math.min(n[t].low,n[o].low),u=Math.max(n[t].lim,n[o].lim),s,c;s=t;do s=e.parent(s),r.push(s);while(s&&(n[s].low>a||u>n[s].lim));for(c=s,s=o;(s=e.parent(s))!==c;)i.push(s);return{path:r.concat(i.reverse()),lca:c}}d(On,"findPath");function In(e){var n={},t=0;function o(r){var i=t;f(e.children(r),o),n[r]={low:i,lim:t++}}return d(o,"dfs"),f(e.children(),o),n}d(In,"postorder");function Pn(e,n){var t={};function o(r,i){var a=0,u=0,s=r.length,c=D(i);return f(i,function(h,g){var l=Ln(e,h),p=l?e.node(l).order:s;(l||h===c)&&(f(i.slice(u,g+1),function(v){f(e.predecessors(v),function(w){var C=e.node(w),xe=C.order;(xe<a||p<xe)&&!(C.dummy&&e.node(v).dummy)&&ke(t,w,v)})}),u=g+1,a=p)}),i}return d(o,"visitLayer"),z(n,o),t}d(Pn,"findType1Conflicts");function Cn(e,n){var t={};function o(i,a,u,s,c){var h;f(O(a,u),function(g){h=i[g],e.node(h).dummy&&f(e.predecessors(h),function(l){var p=e.node(l);p.dummy&&(p.order<s||p.order>c)&&ke(t,l,h)})})}d(o,"scan");function r(i,a){var u=-1,s,c=0;return f(a,function(h,g){if(e.node(h).dummy==="border"){var l=e.predecessors(h);l.length&&(s=e.node(l[0]).order,o(a,c,g,u,s),c=g,u=s)}o(a,c,a.length,s,i.length)}),a}return d(r,"visitLayer"),z(n,r),t}d(Cn,"findType2Conflicts");function Ln(e,n){if(e.node(n).dummy)return ue(e.predecessors(n),function(t){return e.node(t).dummy})}d(Ln,"findOtherInnerSegmentNode");function ke(e,n,t){if(n>t){var o=n;n=t,t=o}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var r=e[n];Object.defineProperty(r,t,{enumerable:!0,configurable:!0,value:!0,writable:!0})}d(ke,"addConflict");function _n(e,n,t){if(n>t){var o=n;n=t,t=o}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],t)}d(_n,"hasConflict");function Rn(e,n,t,o){var r={},i={},a={};return f(n,function(u){f(u,function(s,c){r[s]=s,i[s]=s,a[s]=c})}),f(n,function(u){var s=-1;f(u,function(c){var h=o(c);if(h.length){h=j(h,function(w){return a[w]});for(var g=(h.length-1)/2,l=Math.floor(g),p=Math.ceil(g);l<=p;++l){var v=h[l];i[c]===c&&s<a[v]&&!_n(t,c,v)&&(i[v]=c,i[c]=r[c]=r[v],s=a[v])}}})}),{root:r,align:i}}d(Rn,"verticalAlignment");function Tn(e,n,t,o,r){var i={},a=jn(e,n,t,r),u=r?"borderLeft":"borderRight";function s(g,l){for(var p=a.nodes(),v=p.pop(),w={};v;)w[v]?g(v):(w[v]=!0,p.push(v),p=p.concat(l(v))),v=p.pop()}d(s,"iterate");function c(g){i[g]=a.inEdges(g).reduce(function(l,p){return Math.max(l,i[p.v]+a.edge(p))},0)}d(c,"pass1");function h(g){var l=a.outEdges(g).reduce(function(v,w){return Math.min(v,i[w.w]-a.edge(w))},Number.POSITIVE_INFINITY),p=e.node(g);l!==Number.POSITIVE_INFINITY&&p.borderType!==u&&(i[g]=Math.max(i[g],l))}return d(h,"pass2"),s(c,a.predecessors.bind(a)),s(h,a.successors.bind(a)),f(o,function(g){i[g]=i[t[g]]}),i}d(Tn,"horizontalCompaction");function jn(e,n,t,o){var r=new y,i=e.graph(),a=Fn(i.nodesep,i.edgesep,o);return f(n,function(u){var s;f(u,function(c){var h=t[c];if(r.setNode(h),s){var g=t[s],l=r.edge(g,h);r.setEdge(g,h,Math.max(a(e,c,s),l||0))}s=c})}),r}d(jn,"buildBlockGraph");function Sn(e,n){return ae(I(n),function(t){var o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY;return ut(t,function(i,a){var u=Vn(e,a)/2;o=Math.max(i+u,o),r=Math.min(i-u,r)}),o-r})}d(Sn,"findSmallestWidthAlignment");function Mn(e,n){var t=I(n),o=L(t),r=x(t);f(["u","d"],function(i){f(["l","r"],function(a){var u=i+a,s=e[u],c;if(s!==n){var h=I(s);c=a==="l"?o-L(h):r-x(h),c&&(e[u]=q(s,function(g){return g+c}))}})})}d(Mn,"alignCoordinates");function Gn(e,n){return q(e.ul,function(t,o){if(n)return e[n.toLowerCase()][o];var r=j(m(e,o));return(r[1]+r[2])/2})}d(Gn,"balance");function Bn(e){var n=S(e),t=X(Pn(e,n),Cn(e,n)),o={},r;f(["u","d"],function(a){r=a==="u"?n:I(n).reverse(),f(["l","r"],function(u){u==="r"&&(r=m(r,function(g){return I(g).reverse()}));var s=(a==="u"?e.predecessors:e.successors).bind(e),c=Rn(e,r,t,s),h=Tn(e,r,c.root,c.align,u==="r");u==="r"&&(h=q(h,function(g){return-g})),o[a+u]=h})});var i=Sn(e,o);return Mn(o,i),Gn(o,e.graph().align)}d(Bn,"positionX");function Fn(e,n,t){return function(o,r,i){var a=o.node(r),u=o.node(i),s=0,c;if(s+=a.width/2,Object.prototype.hasOwnProperty.call(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":c=-a.width/2;break;case"r":c=a.width/2;break}if(c&&(s+=t?c:-c),c=0,s+=(a.dummy?n:e)/2,s+=(u.dummy?n:e)/2,s+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":c=u.width/2;break;case"r":c=-u.width/2;break}return c&&(s+=t?c:-c),c=0,s}}d(Fn,"sep");function Vn(e,n){return e.node(n).width}d(Vn,"width");function Yn(e){e=de(e),Dn(e),dt(Bn(e),function(n,t){e.node(t).x=n})}d(Yn,"position");function Dn(e){var n=S(e),t=e.graph().ranksep,o=0;f(n,function(r){var i=x(m(r,function(a){return e.node(a).height}));f(r,function(a){e.node(a).y=o+i/2}),o+=i+t})}d(Dn,"positionY");function lt(e,n){var t=n&&n.debugTiming?Le:_e;t("layout",()=>{var o=t(" buildLayoutGraph",()=>zn(e));t(" runLayout",()=>$n(o,t)),t(" updateInputGraph",()=>qn(e,o))})}d(lt,"layout");function $n(e,n){n(" makeSpaceForEdgeLabels",()=>An(e)),n(" removeSelfEdges",()=>et(e)),n(" acyclic",()=>Ye(e)),n(" nestingGraph.run",()=>on(e)),n(" rank",()=>nn(de(e))),n(" injectEdgeLabelProxies",()=>Jn(e)),n(" removeEmptyRanks",()=>Pe(e)),n(" nestingGraph.cleanup",()=>un(e)),n(" normalizeRanks",()=>Ie(e)),n(" assignRankMinMax",()=>Wn(e)),n(" removeEdgeLabelProxies",()=>Xn(e)),n(" normalize.run",()=>qe(e)),n(" parentDummyChains",()=>Nn(e)),n(" addBorderSegments",()=>Re(e)),n(" order",()=>xn(e)),n(" insertSelfEdges",()=>nt(e)),n(" adjustCoordinateSystem",()=>Te(e)),n(" position",()=>Yn(e)),n(" positionSelfEdges",()=>tt(e)),n(" removeBorderNodes",()=>Un(e)),n(" normalize.undo",()=>Ae(e)),n(" fixupEdgeLabelCoords",()=>Zn(e)),n(" undoCoordinateSystem",()=>je(e)),n(" translateGraph",()=>Hn(e)),n(" assignNodeIntersects",()=>Kn(e)),n(" reversePoints",()=>Qn(e)),n(" acyclic.undo",()=>$e(e))}d($n,"runLayout");function qn(e,n){f(e.nodes(),function(t){var o=e.node(t),r=n.node(t);o&&(o.x=r.x,o.y=r.y,n.children(t).length&&(o.width=r.width,o.height=r.height))}),f(e.edges(),function(t){var o=e.edge(t),r=n.edge(t);o.points=r.points,Object.prototype.hasOwnProperty.call(r,"x")&&(o.x=r.x,o.y=r.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}d(qn,"updateInputGraph");var pt=["nodesep","edgesep","ranksep","marginx","marginy"],vt={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},mt=["acyclicer","ranker","rankdir","align"],wt=["width","height"],bt={width:0,height:0},yt=["minlen","weight","width","height","labeloffset"],kt={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},xt=["labelpos"];function zn(e){var n=new y({multigraph:!0,compound:!0}),t=V(e.graph());return n.setGraph(X({},vt,F(t,pt),Y(t,mt))),f(e.nodes(),function(o){var r=V(e.node(o));n.setNode(o,ot(F(r,wt),bt)),n.setParent(o,e.parent(o))}),f(e.edges(),function(o){var r=V(e.edge(o));n.setEdge(o,X({},kt,F(r,yt),Y(r,xt)))}),n}d(zn,"buildLayoutGraph");function An(e){var n=e.graph();n.ranksep/=2,f(e.edges(),function(t){var o=e.edge(t);o.minlen*=2,o.labelpos.toLowerCase()!=="c"&&(n.rankdir==="TB"||n.rankdir==="BT"?o.width+=o.labeloffset:o.height+=o.labeloffset)})}d(An,"makeSpaceForEdgeLabels");function Jn(e){f(e.edges(),function(n){var t=e.edge(n);if(t.width&&t.height){var o=e.node(n.v),r=e.node(n.w),i={rank:(r.rank-o.rank)/2+o.rank,e:n};E(e,"edge-proxy",i,"_ep")}})}d(Jn,"injectEdgeLabelProxies");function Wn(e){var n=0;f(e.nodes(),function(t){var o=e.node(t);o.borderTop&&(o.minRank=e.node(o.borderTop).rank,o.maxRank=e.node(o.borderBottom).rank,n=x(n,o.maxRank))}),e.graph().maxRank=n}d(Wn,"assignRankMinMax");function Xn(e){f(e.nodes(),function(n){var t=e.node(n);t.dummy==="edge-proxy"&&(e.edge(t.e).labelRank=t.rank,e.removeNode(n))})}d(Xn,"removeEdgeLabelProxies");function Hn(e){var n=Number.POSITIVE_INFINITY,t=0,o=Number.POSITIVE_INFINITY,r=0,i=e.graph(),a=i.marginx||0,u=i.marginy||0;function s(c){var h=c.x,g=c.y,l=c.width,p=c.height;n=Math.min(n,h-l/2),t=Math.max(t,h+l/2),o=Math.min(o,g-p/2),r=Math.max(r,g+p/2)}d(s,"getExtremes"),f(e.nodes(),function(c){s(e.node(c))}),f(e.edges(),function(c){var h=e.edge(c);Object.prototype.hasOwnProperty.call(h,"x")&&s(h)}),n-=a,o-=u,f(e.nodes(),function(c){var h=e.node(c);h.x-=n,h.y-=o}),f(e.edges(),function(c){var h=e.edge(c);f(h.points,function(g){g.x-=n,g.y-=o}),Object.prototype.hasOwnProperty.call(h,"x")&&(h.x-=n),Object.prototype.hasOwnProperty.call(h,"y")&&(h.y-=o)}),i.width=t-n+a,i.height=r-o+u}d(Hn,"translateGraph");function Kn(e){f(e.edges(),function(n){var t=e.edge(n),o=e.node(n.v),r=e.node(n.w),i,a;t.points?(i=t.points[0],a=t.points[t.points.length-1]):(t.points=[],i=r,a=o),t.points.unshift(H(o,i)),t.points.push(H(r,a))})}d(Kn,"assignNodeIntersects");function Zn(e){f(e.edges(),function(n){var t=e.edge(n);if(Object.prototype.hasOwnProperty.call(t,"x"))switch((t.labelpos==="l"||t.labelpos==="r")&&(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset;break}})}d(Zn,"fixupEdgeLabelCoords");function Qn(e){f(e.edges(),function(n){var t=e.edge(n);t.reversed&&t.points.reverse()})}d(Qn,"reversePointsForReversedEdges");function Un(e){f(e.nodes(),function(n){if(e.children(n).length){var t=e.node(n),o=e.node(t.borderTop),r=e.node(t.borderBottom),i=e.node(D(t.borderLeft)),a=e.node(D(t.borderRight));t.width=Math.abs(a.x-i.x),t.height=Math.abs(r.y-o.y),t.x=i.x+t.width/2,t.y=o.y+t.height/2}}),f(e.nodes(),function(n){e.node(n).dummy==="border"&&e.removeNode(n)})}d(Un,"removeBorderNodes");function et(e){f(e.edges(),function(n){if(n.v===n.w){var t=e.node(n.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}d(et,"removeSelfEdges");function nt(e){var n=S(e);f(n,function(t){var o=0;f(t,function(r,i){var a=e.node(r);a.order=i+o,f(a.selfEdges,function(u){E(e,"selfedge",{width:u.label.width,height:u.label.height,rank:a.rank,order:i+ ++o,e:u.e,label:u.label},"_se")}),delete a.selfEdges})})}d(nt,"insertSelfEdges");function tt(e){f(e.nodes(),function(n){var t=e.node(n);if(t.dummy==="selfedge"){var o=e.node(t.e.v),r=o.x+o.width/2,i=o.y,a=t.x-r,u=o.height/2;e.setEdge(t.e,t.label),e.removeNode(n),t.label.points=[{x:r+2*a/3,y:i-u},{x:r+5*a/6,y:i-u},{x:r+a,y:i},{x:r+5*a/6,y:i+u},{x:r+2*a/3,y:i+u}],t.label.x=t.x,t.label.y=t.y}})}d(tt,"positionSelfEdges");function F(e,n){return q(Y(e,n),Number)}d(F,"selectNumberAttrs");function V(e){var n={};return f(e,function(t,o){n[o.toLowerCase()]=t}),n}d(V,"canonicalize");export{lt as f};
|