orbitchat 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +314 -0
- package/bin/orbitchat.js +435 -0
- package/dist/assets/Tableau10-D7jGxypv-Cyu9clx1.js +1 -0
- package/dist/assets/__vite-browser-external-BIHI7g3E.js +1 -0
- package/dist/assets/api-m_QXEYxU.js +2 -0
- package/dist/assets/arc-hH97QygY-EgRQ19vy.js +1 -0
- package/dist/assets/blockDiagram-c4efeb88-CLLcV2XJ-BlzQog67.js +118 -0
- package/dist/assets/c4Diagram-c83219d4-Bq976NrW-DIPXTaap.js +10 -0
- package/dist/assets/channel-CSC8iKVS-o3Tgkjx3.js +1 -0
- package/dist/assets/classDiagram-beda092f-7G8Y9ObP-CrnhVq3q.js +2 -0
- package/dist/assets/classDiagram-v2-2358418a-CYz_KHej-BnPcDcYV.js +2 -0
- package/dist/assets/clone-vCPXKFeo-DdQ4WIiO.js +1 -0
- package/dist/assets/createText-1719965b-Cbn6MBZp-zrb_KsAx.js +7 -0
- package/dist/assets/edges-96097737-XAH6P1yX-hj5ay2ub.js +4 -0
- package/dist/assets/erDiagram-0228fc6a-Bj5SeSQq-SNOEiwxn.js +51 -0
- package/dist/assets/flowDb-c6c81e3f-CaVKc_SB-DeOFQ2aw.js +10 -0
- package/dist/assets/flowDiagram-50d868cf-BcT1Qv7E-CI_0iUc_.js +4 -0
- package/dist/assets/flowDiagram-v2-4f6560a1-B0fti9Da-D8Np9r9b.js +1 -0
- package/dist/assets/flowchart-elk-definition-6af322e1-CIF5zs_e-CA7galDX.js +139 -0
- package/dist/assets/ganttDiagram-a2739b55-wX4z0bcl-BV5WSU0F.js +257 -0
- package/dist/assets/gitGraphDiagram-82fe8481-BTMrrqSM-BAXm_J1X.js +70 -0
- package/dist/assets/graph-Bc6U-Oet-BbypjADy.js +1 -0
- package/dist/assets/index-5325376f-DCLsNwAa-BxOfAZRl.js +1 -0
- package/dist/assets/index-BKRCw_DF.js +966 -0
- package/dist/assets/index-BbD-jy76.css +1 -0
- package/dist/assets/infoDiagram-8eee0895-CGdieI3d-CeI4A8me.js +7 -0
- package/dist/assets/journeyDiagram-c64418c1-D741T7Vx-D7bBbz5a.js +139 -0
- package/dist/assets/layout-BtHnec7v-DPk8SWBY.js +1 -0
- package/dist/assets/mindmap-definition-8da855dc-DYXCEYTW-C9VeqS3S.js +425 -0
- package/dist/assets/pieDiagram-a8764435-56nwm0bs-OTliuzET.js +35 -0
- package/dist/assets/quadrantDiagram-1e28029f-BPDrTwrc-BeDUiVSw.js +7 -0
- package/dist/assets/requirementDiagram-08caed73-ErOyM087-fZE1bidE.js +52 -0
- package/dist/assets/sankeyDiagram-a04cb91d-Dr_h6k2R-DV92AQzo.js +8 -0
- package/dist/assets/sequenceDiagram-c5b8d532-wtK0ihCE-CMdlx77G.js +122 -0
- package/dist/assets/stateDiagram-1ecb1508-D6rDYnWS-BXgBNGIv.js +1 -0
- package/dist/assets/stateDiagram-v2-c2b004d7-K0flL3uN-DMmV3VwJ.js +1 -0
- package/dist/assets/styles-b4e223ce-CPkoRhK8-B88f_9TS.js +160 -0
- package/dist/assets/styles-ca3715f6-FCD4s0nN-BJNUoxcm.js +207 -0
- package/dist/assets/styles-d45a18b0-7fTS_K4G-BSFqTrx5.js +116 -0
- package/dist/assets/svgDrawCommon-b86b1483-C9ebAubK-DzwEtGVK.js +1 -0
- package/dist/assets/timeline-definition-faaaa080-C-TPmIif-CPB6N7Tu.js +61 -0
- package/dist/assets/xychartDiagram-f5964ef8-Dy6Sev6Z-UG5jLwgB.js +7 -0
- package/dist/index.html +26 -0
- package/package.json +56 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import{u as Yt,l as zt,o as Xt,s as Ht,a as Mt,i as Jt,X as F,U as lt,O as $,n as Kt,ap as Vt}from"./index-BKRCw_DF.js";var mt=function(){var t=function(T,i,r,o){for(r=r||{},o=T.length;o--;r[T[o]]=i);return r},s=[1,2],n=[1,3],c=[1,4],p=[2,4],d=[1,9],y=[1,11],b=[1,15],u=[1,16],_=[1,17],G=[1,18],O=[1,30],j=[1,19],U=[1,20],Y=[1,21],z=[1,22],X=[1,23],H=[1,25],M=[1,26],J=[1,27],K=[1,28],V=[1,29],W=[1,32],q=[1,33],Q=[1,34],Z=[1,35],R=[1,31],l=[1,4,5,15,16,18,20,21,23,24,25,26,27,28,32,34,36,37,41,44,45,46,47,50],tt=[1,4,5,13,14,15,16,18,20,21,23,24,25,26,27,28,32,34,36,37,41,44,45,46,47,50],xt=[4,5,15,16,18,20,21,23,24,25,26,27,28,32,34,36,37,41,44,45,46,47,50],ct={trace:function(){},yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,cssClassStatement:11,idStatement:12,DESCR:13,"-->":14,HIDE_EMPTY:15,scale:16,WIDTH:17,COMPOSIT_STATE:18,STRUCT_START:19,STRUCT_STOP:20,STATE_DESCR:21,AS:22,ID:23,FORK:24,JOIN:25,CHOICE:26,CONCURRENT:27,note:28,notePosition:29,NOTE_TEXT:30,direction:31,acc_title:32,acc_title_value:33,acc_descr:34,acc_descr_value:35,acc_descr_multiline_value:36,classDef:37,CLASSDEF_ID:38,CLASSDEF_STYLEOPTS:39,DEFAULT:40,class:41,CLASSENTITY_IDS:42,STYLECLASS:43,direction_tb:44,direction_bt:45,direction_rl:46,direction_lr:47,eol:48,";":49,EDGE_STATE:50,STYLE_SEPARATOR:51,left_of:52,right_of:53,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",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",30:"NOTE_TEXT",32:"acc_title",33:"acc_title_value",34:"acc_descr",35:"acc_descr_value",36:"acc_descr_multiline_value",37:"classDef",38:"CLASSDEF_ID",39:"CLASSDEF_STYLEOPTS",40:"DEFAULT",41:"class",42:"CLASSENTITY_IDS",43:"STYLECLASS",44:"direction_tb",45:"direction_bt",46:"direction_rl",47:"direction_lr",49:";",50:"EDGE_STATE",51:"STYLE_SEPARATOR",52:"left_of",53:"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,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],[10,3],[10,3],[11,3],[31,1],[31,1],[31,1],[31,1],[48,1],[48,1],[12,1],[12,1],[12,3],[12,3],[29,1],[29,1]],performAction:function(T,i,r,o,h,e,g){var a=e.length-1;switch(h){case 3:return o.setRootDoc(e[a]),e[a];case 4:this.$=[];break;case 5:e[a]!="nl"&&(e[a-1].push(e[a]),this.$=e[a-1]);break;case 6:case 7:this.$=e[a];break;case 8:this.$="nl";break;case 11:this.$=e[a];break;case 12:const B=e[a-1];B.description=o.trimColon(e[a]),this.$=B;break;case 13:this.$={stmt:"relation",state1:e[a-2],state2:e[a]};break;case 14:const ut=o.trimColon(e[a]);this.$={stmt:"relation",state1:e[a-3],state2:e[a-1],description:ut};break;case 18:this.$={stmt:"state",id:e[a-3],type:"default",description:"",doc:e[a-1]};break;case 19:var C=e[a],I=e[a-2].trim();if(e[a].match(":")){var et=e[a].split(":");C=et[0],I=[I,et[1]]}this.$={stmt:"state",id:C,type:"default",description:I};break;case 20:this.$={stmt:"state",id:e[a-3],type:"default",description:e[a-5],doc:e[a-1]};break;case 21:this.$={stmt:"state",id:e[a],type:"fork"};break;case 22:this.$={stmt:"state",id:e[a],type:"join"};break;case 23:this.$={stmt:"state",id:e[a],type:"choice"};break;case 24:this.$={stmt:"state",id:o.getDividerId(),type:"divider"};break;case 25:this.$={stmt:"state",id:e[a-1].trim(),note:{position:e[a-2].trim(),text:e[a].trim()}};break;case 28:this.$=e[a].trim(),o.setAccTitle(this.$);break;case 29:case 30:this.$=e[a].trim(),o.setAccDescription(this.$);break;case 31:case 32:this.$={stmt:"classDef",id:e[a-1].trim(),classes:e[a].trim()};break;case 33:this.$={stmt:"applyClass",id:e[a-1].trim(),styleClass:e[a].trim()};break;case 34:o.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 35:o.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 36:o.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 37:o.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 40:case 41:this.$={stmt:"state",id:e[a].trim(),type:"default",description:""};break;case 42:this.$={stmt:"state",id:e[a-2].trim(),classes:[e[a].trim()],type:"default",description:""};break;case 43:this.$={stmt:"state",id:e[a-2].trim(),classes:[e[a].trim()],type:"default",description:""};break}},table:[{3:1,4:s,5:n,6:c},{1:[3]},{3:5,4:s,5:n,6:c},{3:6,4:s,5:n,6:c},t([1,4,5,15,16,18,21,23,24,25,26,27,28,32,34,36,37,41,44,45,46,47,50],p,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:d,5:y,8:8,9:10,10:12,11:13,12:14,15:b,16:u,18:_,21:G,23:O,24:j,25:U,26:Y,27:z,28:X,31:24,32:H,34:M,36:J,37:K,41:V,44:W,45:q,46:Q,47:Z,50:R},t(l,[2,5]),{9:36,10:12,11:13,12:14,15:b,16:u,18:_,21:G,23:O,24:j,25:U,26:Y,27:z,28:X,31:24,32:H,34:M,36:J,37:K,41:V,44:W,45:q,46:Q,47:Z,50:R},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11],{13:[1,37],14:[1,38]}),t(l,[2,15]),{17:[1,39]},t(l,[2,17],{19:[1,40]}),{22:[1,41]},t(l,[2,21]),t(l,[2,22]),t(l,[2,23]),t(l,[2,24]),{29:42,30:[1,43],52:[1,44],53:[1,45]},t(l,[2,27]),{33:[1,46]},{35:[1,47]},t(l,[2,30]),{38:[1,48],40:[1,49]},{42:[1,50]},t(tt,[2,40],{51:[1,51]}),t(tt,[2,41],{51:[1,52]}),t(l,[2,34]),t(l,[2,35]),t(l,[2,36]),t(l,[2,37]),t(l,[2,6]),t(l,[2,12]),{12:53,23:O,50:R},t(l,[2,16]),t(xt,p,{7:54}),{23:[1,55]},{23:[1,56]},{22:[1,57]},{23:[2,44]},{23:[2,45]},t(l,[2,28]),t(l,[2,29]),{39:[1,58]},{39:[1,59]},{43:[1,60]},{23:[1,61]},{23:[1,62]},t(l,[2,13],{13:[1,63]}),{4:d,5:y,8:8,9:10,10:12,11:13,12:14,15:b,16:u,18:_,20:[1,64],21:G,23:O,24:j,25:U,26:Y,27:z,28:X,31:24,32:H,34:M,36:J,37:K,41:V,44:W,45:q,46:Q,47:Z,50:R},t(l,[2,19],{19:[1,65]}),{30:[1,66]},{23:[1,67]},t(l,[2,31]),t(l,[2,32]),t(l,[2,33]),t(tt,[2,42]),t(tt,[2,43]),t(l,[2,14]),t(l,[2,18]),t(xt,p,{7:68}),t(l,[2,25]),t(l,[2,26]),{4:d,5:y,8:8,9:10,10:12,11:13,12:14,15:b,16:u,18:_,20:[1,69],21:G,23:O,24:j,25:U,26:Y,27:z,28:X,31:24,32:H,34:M,36:J,37:K,41:V,44:W,45:q,46:Q,47:Z,50:R},t(l,[2,20])],defaultActions:{5:[2,1],6:[2,2],44:[2,44],45:[2,45]},parseError:function(T,i){if(i.recoverable)this.trace(T);else{var r=new Error(T);throw r.hash=i,r}},parse:function(T){var i=this,r=[0],o=[],h=[null],e=[],g=this.table,a="",C=0,I=0,et=2,B=1,ut=e.slice.call(arguments,1),f=Object.create(this.lexer),v={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(v.yy[dt]=this.yy[dt]);f.setInput(T,v.yy),v.yy.lexer=f,v.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var pt=f.yylloc;e.push(pt);var jt=f.options&&f.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ut(){var x;return x=o.pop()||f.lex()||B,typeof x!="number"&&(x instanceof Array&&(o=x,x=o.pop()),x=i.symbols_[x]||x),x}for(var S,A,k,yt,L={},st,E,$t,it;;){if(A=r[r.length-1],this.defaultActions[A]?k=this.defaultActions[A]:((S===null||typeof S>"u")&&(S=Ut()),k=g[A]&&g[A][S]),typeof k>"u"||!k.length||!k[0]){var ft="";it=[];for(st in g[A])this.terminals_[st]&&st>et&&it.push("'"+this.terminals_[st]+"'");f.showPosition?ft="Parse error on line "+(C+1)+`:
|
|
2
|
+
`+f.showPosition()+`
|
|
3
|
+
Expecting `+it.join(", ")+", got '"+(this.terminals_[S]||S)+"'":ft="Parse error on line "+(C+1)+": Unexpected "+(S==B?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(ft,{text:f.match,token:this.terminals_[S]||S,line:f.yylineno,loc:pt,expected:it})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+S);switch(k[0]){case 1:r.push(S),h.push(f.yytext),e.push(f.yylloc),r.push(k[1]),S=null,I=f.yyleng,a=f.yytext,C=f.yylineno,pt=f.yylloc;break;case 2:if(E=this.productions_[k[1]][1],L.$=h[h.length-E],L._$={first_line:e[e.length-(E||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(E||1)].first_column,last_column:e[e.length-1].last_column},jt&&(L._$.range=[e[e.length-(E||1)].range[0],e[e.length-1].range[1]]),yt=this.performAction.apply(L,[a,I,C,v.yy,k[1],h,e].concat(ut)),typeof yt<"u")return yt;E&&(r=r.slice(0,-1*E*2),h=h.slice(0,-1*E),e=e.slice(0,-1*E)),r.push(this.productions_[k[1]][0]),h.push(L.$),e.push(L._$),$t=g[r[r.length-2]][r[r.length-1]],r.push($t);break;case 3:return!0}}return!0}},Gt=function(){var T={EOF:1,parseError:function(i,r){if(this.yy.parser)this.yy.parser.parseError(i,r);else throw new Error(i)},setInput:function(i,r){return this.yy=r||this.yy||{},this._input=i,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},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var r=i.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var r=i.length,o=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var h=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var e=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:o?(o.length===h.length?this.yylloc.first_column:0)+h[h.length-o.length].length-o[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),r=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
+
`+r+"^"},test_match:function(i,r){var o,h,e;if(this.options.backtrack_lexer&&(e={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&&(e.yylloc.range=this.yylloc.range.slice(0))),h=i[0].match(/(?:\r\n?|\n).*/g),h&&(this.yylineno+=h.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:h?h[h.length-1].length-h[h.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],o=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),o)return o;if(this._backtrack){for(var g in e)this[g]=e[g];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,r,o,h;this._more||(this.yytext="",this.match="");for(var e=this._currentRules(),g=0;g<e.length;g++)if(o=this._input.match(this.rules[e[g]]),o&&(!r||o[0].length>r[0].length)){if(r=o,h=g,this.options.backtrack_lexer){if(i=this.test_match(o,e[g]),i!==!1)return i;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(i=this.test_match(r,e[h]),i!==!1?i:!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})},lex:function(){var i=this.next();return i||this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},pushState:function(i){this.begin(i)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(i,r,o,h){switch(o){case 0:return 40;case 1:return 44;case 2:return 45;case 3:return 46;case 4:return 47;case 5:break;case 6:break;case 7:return 5;case 8:break;case 9:break;case 10:break;case 11:break;case 12:return this.pushState("SCALE"),16;case 13:return 17;case 14:this.popState();break;case 15:return this.begin("acc_title"),32;case 16:return this.popState(),"acc_title_value";case 17:return this.begin("acc_descr"),34;case 18:return this.popState(),"acc_descr_value";case 19:this.begin("acc_descr_multiline");break;case 20:this.popState();break;case 21:return"acc_descr_multiline_value";case 22:return this.pushState("CLASSDEF"),37;case 23:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 24:return this.popState(),this.pushState("CLASSDEFID"),38;case 25:return this.popState(),39;case 26:return this.pushState("CLASS"),41;case 27:return this.popState(),this.pushState("CLASS_STYLE"),42;case 28:return this.popState(),43;case 29:return this.pushState("SCALE"),16;case 30:return 17;case 31:this.popState();break;case 32:this.pushState("STATE");break;case 33:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),24;case 34:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 35:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),26;case 36:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),24;case 37:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),25;case 38:return this.popState(),r.yytext=r.yytext.slice(0,-10).trim(),26;case 39:return 44;case 40:return 45;case 41:return 46;case 42:return 47;case 43:this.pushState("STATE_STRING");break;case 44:return this.pushState("STATE_ID"),"AS";case 45:return this.popState(),"ID";case 46:this.popState();break;case 47:return"STATE_DESCR";case 48:return 18;case 49:this.popState();break;case 50:return this.popState(),this.pushState("struct"),19;case 51:break;case 52:return this.popState(),20;case 53:break;case 54:return this.begin("NOTE"),28;case 55:return this.popState(),this.pushState("NOTE_ID"),52;case 56:return this.popState(),this.pushState("NOTE_ID"),53;case 57:this.popState(),this.pushState("FLOATING_NOTE");break;case 58:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 59:break;case 60:return"NOTE_TEXT";case 61:return this.popState(),"ID";case 62:return this.popState(),this.pushState("NOTE_TEXT"),23;case 63:return this.popState(),r.yytext=r.yytext.substr(2).trim(),30;case 64:return this.popState(),r.yytext=r.yytext.slice(0,-8).trim(),30;case 65:return 6;case 66:return 6;case 67:return 15;case 68:return 50;case 69:return 23;case 70:return r.yytext=r.yytext.trim(),13;case 71:return 14;case 72:return 27;case 73:return 51;case 74:return 5;case 75:return"INVALID"}},rules:[/^(?: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,/^(?: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;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:!1},struct:{rules:[9,10,22,26,32,39,40,41,42,51,52,53,54,68,69,70,71,72],inclusive:!1},FLOATING_NOTE_ID:{rules:[61],inclusive:!1},FLOATING_NOTE:{rules:[58,59,60],inclusive:!1},NOTE_TEXT:{rules:[63,64],inclusive:!1},NOTE_ID:{rules:[62],inclusive:!1},NOTE:{rules:[55,56,57],inclusive:!1},CLASS_STYLE:{rules:[28],inclusive:!1},CLASS:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[25],inclusive:!1},CLASSDEF:{rules:[23,24],inclusive:!1},acc_descr_multiline:{rules:[20,21],inclusive:!1},acc_descr:{rules:[18],inclusive:!1},acc_title:{rules:[16],inclusive:!1},SCALE:{rules:[13,14,30,31],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[45],inclusive:!1},STATE_STRING:{rules:[46,47],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[9,10,33,34,35,36,37,38,43,44,48,49,50],inclusive:!1},ID:{rules:[9,10],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,50,54,65,66,67,68,69,70,71,73,74,75],inclusive:!0}}};return T}();ct.lexer=Gt;function ht(){this.yy={}}return ht.prototype=ct,ct.Parser=ht,new ht}();mt.parser=mt;const xe=mt,Wt="LR",$e="TB",gt="state",Dt="relation",qt="classDef",Qt="applyClass",Tt="default",Zt="divider",bt="[*]",It="start",Lt=bt,Ot="end",Ct="color",vt="fill",te="bgFill",ee=",";function Rt(){return{}}let Bt=Wt,at=[],N=Rt();const Nt=()=>({relations:[],states:{},documents:{}});let ot={root:Nt()},m=ot.root,w=0,At=0;const se={LINE:0,DOTTED_LINE:1},ie={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3},rt=t=>JSON.parse(JSON.stringify(t)),re=t=>{$.info("Setting root doc",t),at=t},ne=()=>at,nt=(t,s,n)=>{if(s.stmt===Dt)nt(t,s.state1,!0),nt(t,s.state2,!1);else if(s.stmt===gt&&(s.id==="[*]"?(s.id=n?t.id+"_start":t.id+"_end",s.start=n):s.id=s.id.trim()),s.doc){const c=[];let p=[],d;for(d=0;d<s.doc.length;d++)if(s.doc[d].type===Zt){const y=rt(s.doc[d]);y.doc=rt(p),c.push(y),p=[]}else p.push(s.doc[d]);if(c.length>0&&p.length>0){const y={stmt:gt,id:Vt(),type:"divider",doc:rt(p)};c.push(rt(y)),s.doc=c}s.doc.forEach(y=>nt(s,y,!0))}},ae=()=>(nt({id:"root"},{id:"root",doc:at},!0),{id:"root",doc:at}),oe=t=>{let s;t.doc?s=t.doc:s=t,$.info(s),wt(!0),$.info("Extract",s),s.forEach(n=>{switch(n.stmt){case gt:D(n.id.trim(),n.type,n.doc,n.description,n.note,n.classes,n.styles,n.textStyles);break;case Dt:Pt(n.state1,n.state2,n.description);break;case qt:Ft(n.id.trim(),n.classes);break;case Qt:Et(n.id.trim(),n.styleClass);break}})},D=function(t,s=Tt,n=null,c=null,p=null,d=null,y=null,b=null){const u=t==null?void 0:t.trim();m.states[u]===void 0?($.info("Adding state ",u,c),m.states[u]={id:u,descriptions:[],type:s,doc:n,note:p,classes:[],styles:[],textStyles:[]}):(m.states[u].doc||(m.states[u].doc=n),m.states[u].type||(m.states[u].type=s)),c&&($.info("Setting state description",u,c),typeof c=="string"&&kt(u,c.trim()),typeof c=="object"&&c.forEach(_=>kt(u,_.trim()))),p&&(m.states[u].note=p,m.states[u].note.text=lt.sanitizeText(m.states[u].note.text,F())),d&&($.info("Setting state classes",u,d),(typeof d=="string"?[d]:d).forEach(_=>Et(u,_.trim()))),y&&($.info("Setting state styles",u,y),(typeof y=="string"?[y]:y).forEach(_=>ge(u,_.trim()))),b&&($.info("Setting state styles",u,y),(typeof b=="string"?[b]:b).forEach(_=>Se(u,_.trim())))},wt=function(t){ot={root:Nt()},m=ot.root,w=0,N=Rt(),t||Kt()},P=function(t){return m.states[t]},le=function(){return m.states},ce=function(){$.info("Documents = ",ot)},he=function(){return m.relations};function St(t=""){let s=t;return t===bt&&(w++,s=`${It}${w}`),s}function _t(t="",s=Tt){return t===bt?It:s}function ue(t=""){let s=t;return t===Lt&&(w++,s=`${Ot}${w}`),s}function de(t="",s=Tt){return t===Lt?Ot:s}function pe(t,s,n){let c=St(t.id.trim()),p=_t(t.id.trim(),t.type),d=St(s.id.trim()),y=_t(s.id.trim(),s.type);D(c,p,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),D(d,y,s.doc,s.description,s.note,s.classes,s.styles,s.textStyles),m.relations.push({id1:c,id2:d,relationTitle:lt.sanitizeText(n,F())})}const Pt=function(t,s,n){if(typeof t=="object")pe(t,s,n);else{const c=St(t.trim()),p=_t(t),d=ue(s.trim()),y=de(s);D(c,p),D(d,y),m.relations.push({id1:c,id2:d,title:lt.sanitizeText(n,F())})}},kt=function(t,s){const n=m.states[t],c=s.startsWith(":")?s.replace(":","").trim():s;n.descriptions.push(lt.sanitizeText(c,F()))},ye=function(t){return t.substring(0,1)===":"?t.substr(2).trim():t.trim()},fe=()=>(At++,"divider-id-"+At),Ft=function(t,s=""){N[t]===void 0&&(N[t]={id:t,styles:[],textStyles:[]});const n=N[t];s!=null&&s.split(ee).forEach(c=>{const p=c.replace(/([^;]*);/,"$1").trim();if(c.match(Ct)){const d=p.replace(vt,te).replace(Ct,vt);n.textStyles.push(d)}n.styles.push(p)})},me=function(){return N},Et=function(t,s){t.split(",").forEach(function(n){let c=P(n);if(c===void 0){const p=n.trim();D(p),c=P(p)}c.classes.push(s)})},ge=function(t,s){const n=P(t);n!==void 0&&n.textStyles.push(s)},Se=function(t,s){const n=P(t);n!==void 0&&n.textStyles.push(s)},_e=()=>Bt,ke=t=>{Bt=t},Te=t=>t&&t[0]===":"?t.substr(1).trim():t.trim(),Ce={getConfig:()=>F().state,addState:D,clear:wt,getState:P,getStates:le,getRelations:he,getClasses:me,getDirection:_e,addRelation:Pt,getDividerId:fe,setDirection:ke,cleanupLabel:ye,lineType:se,relationType:ie,logDocuments:ce,getRootDoc:ne,setRootDoc:re,getRootDocV2:ae,extract:oe,trimColon:Te,getAccTitle:Jt,setAccTitle:Mt,getAccDescription:Ht,setAccDescription:Xt,addStyleClass:Ft,setCssClass:Et,addDescription:kt,setDiagramTitle:zt,getDiagramTitle:Yt},be=t=>`
|
|
7
|
+
defs #statediagram-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: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.transition {
|
|
38
|
+
stroke: ${t.transitionColor};
|
|
39
|
+
stroke-width: 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 .label text {
|
|
76
|
+
fill: ${t.transitionLabelColor||t.tertiaryTextColor};
|
|
77
|
+
}
|
|
78
|
+
.label div .edgeLabel {
|
|
79
|
+
color: ${t.transitionLabelColor||t.tertiaryTextColor};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.stateLabel text {
|
|
83
|
+
fill: ${t.stateLabelColor};
|
|
84
|
+
font-size: 10px;
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.node circle.state-start {
|
|
89
|
+
fill: ${t.specialStateColor};
|
|
90
|
+
stroke: ${t.specialStateColor};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.node .fork-join {
|
|
94
|
+
fill: ${t.specialStateColor};
|
|
95
|
+
stroke: ${t.specialStateColor};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.node circle.state-end {
|
|
99
|
+
fill: ${t.innerEndBackground};
|
|
100
|
+
stroke: ${t.background};
|
|
101
|
+
stroke-width: 1.5
|
|
102
|
+
}
|
|
103
|
+
.end-state-inner {
|
|
104
|
+
fill: ${t.compositeBackground||t.background};
|
|
105
|
+
// stroke: ${t.background};
|
|
106
|
+
stroke-width: 1.5
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.node rect {
|
|
110
|
+
fill: ${t.stateBkg||t.mainBkg};
|
|
111
|
+
stroke: ${t.stateBorder||t.nodeBorder};
|
|
112
|
+
stroke-width: 1px;
|
|
113
|
+
}
|
|
114
|
+
.node polygon {
|
|
115
|
+
fill: ${t.mainBkg};
|
|
116
|
+
stroke: ${t.stateBorder||t.nodeBorder};;
|
|
117
|
+
stroke-width: 1px;
|
|
118
|
+
}
|
|
119
|
+
#statediagram-barbEnd {
|
|
120
|
+
fill: ${t.lineColor};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.statediagram-cluster rect {
|
|
124
|
+
fill: ${t.compositeTitleBackground};
|
|
125
|
+
stroke: ${t.stateBorder||t.nodeBorder};
|
|
126
|
+
stroke-width: 1px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.cluster-label, .nodeLabel {
|
|
130
|
+
color: ${t.stateLabelColor};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.statediagram-cluster rect.outer {
|
|
134
|
+
rx: 5px;
|
|
135
|
+
ry: 5px;
|
|
136
|
+
}
|
|
137
|
+
.statediagram-state .divider {
|
|
138
|
+
stroke: ${t.stateBorder||t.nodeBorder};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.statediagram-state .title-state {
|
|
142
|
+
rx: 5px;
|
|
143
|
+
ry: 5px;
|
|
144
|
+
}
|
|
145
|
+
.statediagram-cluster.statediagram-cluster .inner {
|
|
146
|
+
fill: ${t.compositeBackground||t.background};
|
|
147
|
+
}
|
|
148
|
+
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
149
|
+
fill: ${t.altBackground?t.altBackground:"#efefef"};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.statediagram-cluster .inner {
|
|
153
|
+
rx:0;
|
|
154
|
+
ry:0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.statediagram-state rect.basic {
|
|
158
|
+
rx: 5px;
|
|
159
|
+
ry: 5px;
|
|
160
|
+
}
|
|
161
|
+
.statediagram-state rect.divider {
|
|
162
|
+
stroke-dasharray: 10,10;
|
|
163
|
+
fill: ${t.altBackground?t.altBackground:"#efefef"};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.note-edge {
|
|
167
|
+
stroke-dasharray: 5;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.statediagram-note rect {
|
|
171
|
+
fill: ${t.noteBkgColor};
|
|
172
|
+
stroke: ${t.noteBorderColor};
|
|
173
|
+
stroke-width: 1px;
|
|
174
|
+
rx: 0;
|
|
175
|
+
ry: 0;
|
|
176
|
+
}
|
|
177
|
+
.statediagram-note rect {
|
|
178
|
+
fill: ${t.noteBkgColor};
|
|
179
|
+
stroke: ${t.noteBorderColor};
|
|
180
|
+
stroke-width: 1px;
|
|
181
|
+
rx: 0;
|
|
182
|
+
ry: 0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.statediagram-note text {
|
|
186
|
+
fill: ${t.noteTextColor};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.statediagram-note .nodeLabel {
|
|
190
|
+
color: ${t.noteTextColor};
|
|
191
|
+
}
|
|
192
|
+
.statediagram .edgeLabel {
|
|
193
|
+
color: red; // ${t.noteTextColor};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
#dependencyStart, #dependencyEnd {
|
|
197
|
+
fill: ${t.lineColor};
|
|
198
|
+
stroke: ${t.lineColor};
|
|
199
|
+
stroke-width: 1;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.statediagramTitleText {
|
|
203
|
+
text-anchor: middle;
|
|
204
|
+
font-size: 18px;
|
|
205
|
+
fill: ${t.textColor};
|
|
206
|
+
}
|
|
207
|
+
`,ve=be;export{ve as A,$e as C,xe as D,Tt as E,Dt as I,gt as _,Zt as t,Ce as v};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import{d as R,O as g,X as v,P as _,r as q,Q as F,v as E,h as C,j as B,H as P,U as z,R as U,S as j,B as V,f as G,Z as Q,g as X}from"./index-BKRCw_DF.js";import{K as Z}from"./graph-Bc6U-Oet-BbypjADy.js";import{b as H}from"./index-5325376f-DCLsNwAa-BxOfAZRl.js";import{t as K}from"./channel-CSC8iKVS-o3Tgkjx3.js";function W(e){return typeof e=="string"?new j([document.querySelectorAll(e)],[document.documentElement]):new j([G(e)],V)}function de(e,o){return!!e.children(o).length}function pe(e){return A(e.v)+":"+A(e.w)+":"+A(e.name)}var J=/:/g;function A(e){return e?String(e).replace(J,"\\:"):""}function Y(e,o){o&&e.attr("style",o)}function be(e,o,c){o&&e.attr("class",o).attr("class",c+" "+e.attr("class"))}function we(e,o){var c=o.graph();if(Q(c)){var l=c.transition;if(X(l))return l(e)}return e}function ee(e,o){var c=e.append("foreignObject").attr("width","100000"),l=c.append("xhtml:div");l.attr("xmlns","http://www.w3.org/1999/xhtml");var i=o.label;switch(typeof i){case"function":l.insert(i);break;case"object":l.insert(function(){return i});break;default:l.html(i)}Y(l,o.labelStyle),l.style("display","inline-block"),l.style("white-space","nowrap");var p=l.node().getBoundingClientRect();return c.attr("width",p.width).attr("height",p.height),c}const I={},te=function(e){const o=Object.keys(e);for(const c of o)I[c]=e[c]},O=async function(e,o,c,l,i,p){const u=l.select(`[id="${c}"]`),n=Object.keys(e);for(const b of n){const r=e[b];let y="default";r.classes.length>0&&(y=r.classes.join(" ")),y=y+" flowchart-label";const f=E(r.styles);let t=r.text!==void 0?r.text:r.id,s;if(g.info("vertex",r,r.labelType),r.labelType==="markdown")g.info("vertex",r,r.labelType);else if(U(v().flowchart.htmlLabels))s=ee(u,{label:t}).node(),s.parentNode.removeChild(s);else{const k=i.createElementNS("http://www.w3.org/2000/svg","text");k.setAttribute("style",f.labelStyle.replace("color:","fill:"));const T=t.split(z.lineBreakRegex);for(const $ of T){const d=i.createElementNS("http://www.w3.org/2000/svg","tspan");d.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),d.setAttribute("dy","1em"),d.setAttribute("x","1"),d.textContent=$,k.appendChild(d)}s=k}let w=0,a="";switch(r.type){case"round":w=5,a="rect";break;case"square":a="rect";break;case"diamond":a="question";break;case"hexagon":a="hexagon";break;case"odd":a="rect_left_inv_arrow";break;case"lean_right":a="lean_right";break;case"lean_left":a="lean_left";break;case"trapezoid":a="trapezoid";break;case"inv_trapezoid":a="inv_trapezoid";break;case"odd_right":a="rect_left_inv_arrow";break;case"circle":a="circle";break;case"ellipse":a="ellipse";break;case"stadium":a="stadium";break;case"subroutine":a="subroutine";break;case"cylinder":a="cylinder";break;case"group":a="rect";break;case"doublecircle":a="doublecircle";break;default:a="rect"}const S=await P(t,v());o.setNode(r.id,{labelStyle:f.labelStyle,shape:a,labelText:S,labelType:r.labelType,rx:w,ry:w,class:y,style:f.style,id:r.id,link:r.link,linkTarget:r.linkTarget,tooltip:p.db.getTooltip(r.id)||"",domId:p.db.lookUpDomId(r.id),haveCallback:r.haveCallback,width:r.type==="group"?500:void 0,dir:r.dir,type:r.type,props:r.props,padding:v().flowchart.padding}),g.info("setNode",{labelStyle:f.labelStyle,labelType:r.labelType,shape:a,labelText:S,rx:w,ry:w,class:y,style:f.style,id:r.id,domId:p.db.lookUpDomId(r.id),width:r.type==="group"?500:void 0,type:r.type,dir:r.dir,props:r.props,padding:v().flowchart.padding})}},M=async function(e,o,c){g.info("abc78 edges = ",e);let l=0,i={},p,u;if(e.defaultStyle!==void 0){const n=E(e.defaultStyle);p=n.style,u=n.labelStyle}for(const n of e){l++;const b="L-"+n.start+"-"+n.end;i[b]===void 0?(i[b]=0,g.info("abc78 new entry",b,i[b])):(i[b]++,g.info("abc78 new entry",b,i[b]));let r=b+"-"+i[b];g.info("abc78 new link id to be used is",b,r,i[b]);const y="LS-"+n.start,f="LE-"+n.end,t={style:"",labelStyle:""};switch(t.minlen=n.length||1,n.type==="arrow_open"?t.arrowhead="none":t.arrowhead="normal",t.arrowTypeStart="arrow_open",t.arrowTypeEnd="arrow_open",n.type){case"double_arrow_cross":t.arrowTypeStart="arrow_cross";case"arrow_cross":t.arrowTypeEnd="arrow_cross";break;case"double_arrow_point":t.arrowTypeStart="arrow_point";case"arrow_point":t.arrowTypeEnd="arrow_point";break;case"double_arrow_circle":t.arrowTypeStart="arrow_circle";case"arrow_circle":t.arrowTypeEnd="arrow_circle";break}let s="",w="";switch(n.stroke){case"normal":s="fill:none;",p!==void 0&&(s=p),u!==void 0&&(w=u),t.thickness="normal",t.pattern="solid";break;case"dotted":t.thickness="normal",t.pattern="dotted",t.style="fill:none;stroke-width:2px;stroke-dasharray:3;";break;case"thick":t.thickness="thick",t.pattern="solid",t.style="stroke-width: 3.5px;fill:none;";break;case"invisible":t.thickness="invisible",t.pattern="solid",t.style="stroke-width: 0;fill:none;";break}if(n.style!==void 0){const a=E(n.style);s=a.style,w=a.labelStyle}t.style=t.style+=s,t.labelStyle=t.labelStyle+=w,n.interpolate!==void 0?t.curve=C(n.interpolate,B):e.defaultInterpolate!==void 0?t.curve=C(e.defaultInterpolate,B):t.curve=C(I.curve,B),n.text===void 0?n.style!==void 0&&(t.arrowheadStyle="fill: #333"):(t.arrowheadStyle="fill: #333",t.labelpos="c"),t.labelType=n.labelType,t.label=await P(n.text.replace(z.lineBreakRegex,`
|
|
2
|
+
`),v()),n.style===void 0&&(t.style=t.style||"stroke: #333; stroke-width: 1.5px;fill:none;"),t.labelStyle=t.labelStyle.replace("color:","fill:"),t.id=r,t.classes="flowchart-link "+y+" "+f,o.setEdge(n.start,n.end,t,l)}},re=function(e,o){return o.db.getClasses()},oe=async function(e,o,c,l){g.info("Drawing flowchart");let i=l.db.getDirection();i===void 0&&(i="TD");const{securityLevel:p,flowchart:u}=v(),n=u.nodeSpacing||50,b=u.rankSpacing||50;let r;p==="sandbox"&&(r=_("#i"+o));const y=p==="sandbox"?_(r.nodes()[0].contentDocument.body):_("body"),f=p==="sandbox"?r.nodes()[0].contentDocument:document,t=new Z({multigraph:!0,compound:!0}).setGraph({rankdir:i,nodesep:n,ranksep:b,marginx:0,marginy:0}).setDefaultEdgeLabel(function(){return{}});let s;const w=l.db.getSubGraphs();g.info("Subgraphs - ",w);for(let d=w.length-1;d>=0;d--)s=w[d],g.info("Subgraph - ",s),l.db.addVertex(s.id,{text:s.title,type:s.labelType},"group",void 0,s.classes,s.dir);const a=l.db.getVertices(),S=l.db.getEdges();g.info("Edges",S);let k=0;for(k=w.length-1;k>=0;k--){s=w[k],W("cluster").append("text");for(let d=0;d<s.nodes.length;d++)g.info("Setting up subgraphs",s.nodes[d],s.id),t.setParent(s.nodes[d],s.id)}await O(a,t,o,y,f,l),await M(S,t);const T=y.select(`[id="${o}"]`),$=y.select("#"+o+" g");if(await H($,t,["point","circle","cross"],"flowchart",o),q.insertTitle(T,"flowchartTitleText",u.titleTopMargin,l.db.getDiagramTitle()),F(t,T,u.diagramPadding,u.useMaxWidth),l.db.indexNodes("subGraph"+k),!u.htmlLabels){const d=f.querySelectorAll('[id="'+o+'"] .edgeLabel .label');for(const x of d){const m=x.getBBox(),h=f.createElementNS("http://www.w3.org/2000/svg","rect");h.setAttribute("rx",0),h.setAttribute("ry",0),h.setAttribute("width",m.width),h.setAttribute("height",m.height),x.insertBefore(h,x.firstChild)}}Object.keys(a).forEach(function(d){const x=a[d];if(x.link){const m=_("#"+o+' [id="'+d+'"]');if(m){const h=f.createElementNS("http://www.w3.org/2000/svg","a");h.setAttributeNS("http://www.w3.org/2000/svg","class",x.classes.join(" ")),h.setAttributeNS("http://www.w3.org/2000/svg","href",x.link),h.setAttributeNS("http://www.w3.org/2000/svg","rel","noopener"),p==="sandbox"?h.setAttributeNS("http://www.w3.org/2000/svg","target","_top"):x.linkTarget&&h.setAttributeNS("http://www.w3.org/2000/svg","target",x.linkTarget);const L=m.insert(function(){return h},":first-child"),N=m.select(".label-container");N&&L.append(function(){return N.node()});const D=m.select(".label");D&&L.append(function(){return D.node()})}}})},ue={setConf:te,addVertices:O,addEdges:M,getClasses:re,draw:oe},le=(e,o)=>{const c=K,l=c(e,"r"),i=c(e,"g"),p=c(e,"b");return R(l,i,p,o)},ae=e=>`.label {
|
|
3
|
+
font-family: ${e.fontFamily};
|
|
4
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
5
|
+
}
|
|
6
|
+
.cluster-label text {
|
|
7
|
+
fill: ${e.titleColor};
|
|
8
|
+
}
|
|
9
|
+
.cluster-label span,p {
|
|
10
|
+
color: ${e.titleColor};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.label text,span,p {
|
|
14
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
15
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.node rect,
|
|
19
|
+
.node circle,
|
|
20
|
+
.node ellipse,
|
|
21
|
+
.node polygon,
|
|
22
|
+
.node path {
|
|
23
|
+
fill: ${e.mainBkg};
|
|
24
|
+
stroke: ${e.nodeBorder};
|
|
25
|
+
stroke-width: 1px;
|
|
26
|
+
}
|
|
27
|
+
.flowchart-label text {
|
|
28
|
+
text-anchor: middle;
|
|
29
|
+
}
|
|
30
|
+
// .flowchart-label .text-outer-tspan {
|
|
31
|
+
// text-anchor: middle;
|
|
32
|
+
// }
|
|
33
|
+
// .flowchart-label .text-inner-tspan {
|
|
34
|
+
// text-anchor: start;
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
.node .katex path {
|
|
38
|
+
fill: #000;
|
|
39
|
+
stroke: #000;
|
|
40
|
+
stroke-width: 1px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.node .label {
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
.node.clickable {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrowheadPath {
|
|
51
|
+
fill: ${e.arrowheadColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.edgePath .path {
|
|
55
|
+
stroke: ${e.lineColor};
|
|
56
|
+
stroke-width: 2.0px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.flowchart-link {
|
|
60
|
+
stroke: ${e.lineColor};
|
|
61
|
+
fill: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edgeLabel {
|
|
65
|
+
background-color: ${e.edgeLabelBackground};
|
|
66
|
+
rect {
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
background-color: ${e.edgeLabelBackground};
|
|
69
|
+
fill: ${e.edgeLabelBackground};
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* For html labels only */
|
|
75
|
+
.labelBkg {
|
|
76
|
+
background-color: ${le(e.edgeLabelBackground,.5)};
|
|
77
|
+
// background-color:
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.cluster rect {
|
|
81
|
+
fill: ${e.clusterBkg};
|
|
82
|
+
stroke: ${e.clusterBorder};
|
|
83
|
+
stroke-width: 1px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.cluster text {
|
|
87
|
+
fill: ${e.titleColor};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.cluster span,p {
|
|
91
|
+
color: ${e.titleColor};
|
|
92
|
+
}
|
|
93
|
+
/* .cluster div {
|
|
94
|
+
color: ${e.titleColor};
|
|
95
|
+
} */
|
|
96
|
+
|
|
97
|
+
div.mermaidTooltip {
|
|
98
|
+
position: absolute;
|
|
99
|
+
text-align: center;
|
|
100
|
+
max-width: 200px;
|
|
101
|
+
padding: 2px;
|
|
102
|
+
font-family: ${e.fontFamily};
|
|
103
|
+
font-size: 12px;
|
|
104
|
+
background: ${e.tertiaryColor};
|
|
105
|
+
border: 1px solid ${e.border2};
|
|
106
|
+
border-radius: 2px;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
z-index: 100;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.flowchartTitleText {
|
|
112
|
+
text-anchor: middle;
|
|
113
|
+
font-size: 18px;
|
|
114
|
+
fill: ${e.textColor};
|
|
115
|
+
}
|
|
116
|
+
`,fe=ae;export{W as Z,pe as b,Y as e,be as f,fe as h,de as p,ee as t,we as u,ue as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aH as o,e as i}from"./index-BKRCw_DF.js";const x=(e,t)=>{const r=e.append("rect");if(r.attr("x",t.x),r.attr("y",t.y),r.attr("fill",t.fill),r.attr("stroke",t.stroke),r.attr("width",t.width),r.attr("height",t.height),t.name&&r.attr("name",t.name),t.rx!==void 0&&r.attr("rx",t.rx),t.ry!==void 0&&r.attr("ry",t.ry),t.attrs!==void 0)for(const a in t.attrs)r.attr(a,t.attrs[a]);return t.class!==void 0&&r.attr("class",t.class),r},c=(e,t)=>{const r={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(e,r).lower()},h=(e,t)=>{const r=t.text.replace(o," "),a=e.append("text");a.attr("x",t.x),a.attr("y",t.y),a.attr("class","legend"),a.style("text-anchor",t.anchor),t.class!==void 0&&a.attr("class",t.class);const s=a.append("tspan");return s.attr("x",t.x+t.textMargin*2),s.text(r),a},y=(e,t,r,a)=>{const s=e.append("image");s.attr("x",t),s.attr("y",r);const n=i.sanitizeUrl(a);s.attr("xlink:href",n)},p=(e,t,r,a)=>{const s=e.append("use");s.attr("x",t),s.attr("y",r);const n=i.sanitizeUrl(a);s.attr("xlink:href",`#${n}`)},d=()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),f=()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0});export{h as d,f as g,y as h,x as l,d as p,c as x,p as y};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{aL as yt,aM as gt,aN as ft,X as mt,O as w,P as V,Q as xt,aO as _t,n as kt}from"./index-BKRCw_DF.js";import{h as Z}from"./arc-hH97QygY-EgRQ19vy.js";var U=function(){var n=function(m,i,o,l){for(o=o||{},l=m.length;l--;o[m[l]]=i);return o},t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],s=[1,10],r=[1,11],a=[1,12],h=[1,13],u=[1,16],y=[1,17],g={trace:function(){},yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:function(m,i,o,l,d,c,x){var _=c.length-1;switch(d){case 1:return c[_-1];case 2:this.$=[];break;case 3:c[_-1].push(c[_]),this.$=c[_-1];break;case 4:case 5:this.$=c[_];break;case 6:case 7:this.$=[];break;case 8:l.getCommonDb().setDiagramTitle(c[_].substr(6)),this.$=c[_].substr(6);break;case 9:this.$=c[_].trim(),l.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=c[_].trim(),l.getCommonDb().setAccDescription(this.$);break;case 12:l.addSection(c[_].substr(8)),this.$=c[_].substr(8);break;case 15:l.addTask(c[_],0,""),this.$=c[_];break;case 16:l.addEvent(c[_].substr(2)),this.$=c[_];break}},table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:s,14:r,16:a,17:h,18:14,19:15,20:u,21:y},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:s,14:r,16:a,17:h,18:14,19:15,20:u,21:y},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:function(m,i){if(i.recoverable)this.trace(m);else{var o=new Error(m);throw o.hash=i,o}},parse:function(m){var i=this,o=[0],l=[],d=[null],c=[],x=this.table,_="",$=0,D=0,O=2,A=1,W=c.slice.call(arguments,1),f=Object.create(this.lexer),k={yy:{}};for(var E in this.yy)Object.prototype.hasOwnProperty.call(this.yy,E)&&(k.yy[E]=this.yy[E]);f.setInput(m,k.yy),k.yy.lexer=f,k.yy.parser=this,typeof f.yylloc>"u"&&(f.yylloc={});var I=f.yylloc;c.push(I);var z=f.options&&f.options.ranges;typeof k.yy.parseError=="function"?this.parseError=k.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function H(){var T;return T=l.pop()||f.lex()||A,typeof T!="number"&&(T instanceof Array&&(l=T,T=l.pop()),T=i.symbols_[T]||T),T}for(var v,P,S,X,L={},B,M,Y,F;;){if(P=o[o.length-1],this.defaultActions[P]?S=this.defaultActions[P]:((v===null||typeof v>"u")&&(v=H()),S=x[P]&&x[P][v]),typeof S>"u"||!S.length||!S[0]){var Q="";F=[];for(B in x[P])this.terminals_[B]&&B>O&&F.push("'"+this.terminals_[B]+"'");f.showPosition?Q="Parse error on line "+($+1)+`:
|
|
2
|
+
`+f.showPosition()+`
|
|
3
|
+
Expecting `+F.join(", ")+", got '"+(this.terminals_[v]||v)+"'":Q="Parse error on line "+($+1)+": Unexpected "+(v==A?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(Q,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:I,expected:F})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+v);switch(S[0]){case 1:o.push(v),d.push(f.yytext),c.push(f.yylloc),o.push(S[1]),v=null,D=f.yyleng,_=f.yytext,$=f.yylineno,I=f.yylloc;break;case 2:if(M=this.productions_[S[1]][1],L.$=d[d.length-M],L._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},z&&(L._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),X=this.performAction.apply(L,[_,D,$,k.yy,S[1],d,c].concat(W)),typeof X<"u")return X;M&&(o=o.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),o.push(this.productions_[S[1]][0]),d.push(L.$),c.push(L._$),Y=x[o[o.length-2]][o[o.length-1]],o.push(Y);break;case 3:return!0}}return!0}},p=function(){var m={EOF:1,parseError:function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},setInput:function(i,o){return this.yy=o||this.yy||{},this._input=i,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},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var o=i.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),i},unput:function(i){var o=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;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),l.length-1&&(this.yylineno-=l.length-1);var c=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:l?(l.length===d.length?this.yylloc.first_column:0)+d[d.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[c[0],c[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),o=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
5
|
+
`+o+"^"},test_match:function(i,o){var l,d,c;if(this.options.backtrack_lexer&&(c={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&&(c.yylloc.range=this.yylloc.range.slice(0))),d=i[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+i[0].length},this.yytext+=i[0],this.match+=i[0],this.matches=i,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(i[0].length),this.matched+=i[0],l=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var x in c)this[x]=c[x];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var i,o,l,d;this._more||(this.yytext="",this.match="");for(var c=this._currentRules(),x=0;x<c.length;x++)if(l=this._input.match(this.rules[c[x]]),l&&(!o||l[0].length>o[0].length)){if(o=l,d=x,this.options.backtrack_lexer){if(i=this.test_match(l,c[x]),i!==!1)return i;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(i=this.test_match(o,c[d]),i!==!1?i:!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})},lex:function(){var i=this.next();return i||this.lex()},begin:function(i){this.conditionStack.push(i)},popState:function(){var i=this.conditionStack.length-1;return i>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(i){return i=this.conditionStack.length-1-Math.abs(i||0),i>=0?this.conditionStack[i]:"INITIAL"},pushState:function(i){this.begin(i)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(i,o,l,d){switch(l){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?::\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return m}();g.lexer=p;function b(){this.yy={}}return b.prototype=g,g.Parser=b,new b}();U.parser=U;const bt=U;let N="",nt=0;const G=[],R=[],j=[],it=()=>_t,rt=function(){G.length=0,R.length=0,N="",j.length=0,kt()},st=function(n){N=n,G.push(n)},at=function(){return G},ot=function(){let n=K();const t=100;let e=0;for(;!n&&e<t;)n=K(),e++;return R.push(...j),R},ct=function(n,t,e){const s={id:nt++,section:N,type:N,task:n,score:t||0,events:e?[e]:[]};j.push(s)},lt=function(n){j.find(t=>t.id===nt-1).events.push(n)},ht=function(n){const t={section:N,type:N,description:n,task:n,classes:[]};R.push(t)},K=function(){const n=function(e){return j[e].processed};let t=!0;for(const[e,s]of j.entries())n(e),t=t&&s.processed;return t},vt={clear:rt,getCommonDb:it,addSection:st,getSections:at,getTasks:ot,addTask:ct,addTaskOrg:ht,addEvent:lt},wt=Object.freeze(Object.defineProperty({__proto__:null,addEvent:lt,addSection:st,addTask:ct,addTaskOrg:ht,clear:rt,default:vt,getCommonDb:it,getSections:at,getTasks:ot},Symbol.toStringTag,{value:"Module"})),$t=12,q=function(n,t){const e=n.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},St=function(n,t){const e=n.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),s=n.append("g");s.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function r(u){const y=Z().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}function a(u){const y=Z().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);u.append("path").attr("class","mouth").attr("d",y).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}function h(u){u.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return t.score>3?r(s):t.score<3?a(s):h(s),e},Et=function(n,t){const e=n.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},dt=function(n,t){const e=t.text.replace(/<br\s*\/?>/gi," "),s=n.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class!==void 0&&s.attr("class",t.class);const r=s.append("tspan");return r.attr("x",t.x+t.textMargin*2),r.text(e),s},It=function(n,t){function e(r,a,h,u,y){return r+","+a+" "+(r+h)+","+a+" "+(r+h)+","+(a+u-y)+" "+(r+h-y*1.2)+","+(a+u)+" "+r+","+(a+u)}const s=n.append("polygon");s.attr("points",e(t.x,t.y,50,20,7)),s.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,dt(n,t)},Mt=function(n,t,e){const s=n.append("g"),r=J();r.x=t.x,r.y=t.y,r.fill=t.fill,r.width=e.width,r.height=e.height,r.class="journey-section section-type-"+t.num,r.rx=3,r.ry=3,q(s,r),ut(e)(t.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+t.num},e,t.colour)};let tt=-1;const Tt=function(n,t,e){const s=t.x+e.width/2,r=n.append("g");tt++,r.append("line").attr("id","task"+tt).attr("x1",s).attr("y1",t.y).attr("x2",s).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),St(r,{cx:s,cy:300+(5-t.score)*30,score:t.score});const a=J();a.x=t.x,a.y=t.y,a.fill=t.fill,a.width=e.width,a.height=e.height,a.class="task task-type-"+t.num,a.rx=3,a.ry=3,q(r,a),t.x+14,ut(e)(t.task,r,a.x,a.y,a.width,a.height,{class:"task"},e,t.colour)},At=function(n,t){q(n,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},Ht=function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},J=function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},ut=function(){function n(r,a,h,u,y,g,p,b){const m=a.append("text").attr("x",h+y/2).attr("y",u+g/2+5).style("font-color",b).style("text-anchor","middle").text(r);s(m,p)}function t(r,a,h,u,y,g,p,b,m){const{taskFontSize:i,taskFontFamily:o}=b,l=r.split(/<br\s*\/?>/gi);for(let d=0;d<l.length;d++){const c=d*i-i*(l.length-1)/2,x=a.append("text").attr("x",h+y/2).attr("y",u).attr("fill",m).style("text-anchor","middle").style("font-size",i).style("font-family",o);x.append("tspan").attr("x",h+y/2).attr("dy",c).text(l[d]),x.attr("y",u+g/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),s(x,p)}}function e(r,a,h,u,y,g,p,b){const m=a.append("switch"),i=m.append("foreignObject").attr("x",h).attr("y",u).attr("width",y).attr("height",g).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");i.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(r),t(r,m,h,u,y,g,p,b),s(i,p)}function s(r,a){for(const h in a)h in a&&r.attr(h,a[h])}return function(r){return r.textPlacement==="fo"?e:r.textPlacement==="old"?n:t}}(),Pt=function(n){n.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")};function pt(n,t){n.each(function(){var e=V(this),s=e.text().split(/(\s+|<br>)/).reverse(),r,a=[],h=1.1,u=e.attr("y"),y=parseFloat(e.attr("dy")),g=e.text(null).append("tspan").attr("x",0).attr("y",u).attr("dy",y+"em");for(let p=0;p<s.length;p++)r=s[s.length-1-p],a.push(r),g.text(a.join(" ").trim()),(g.node().getComputedTextLength()>t||r==="<br>")&&(a.pop(),g.text(a.join(" ").trim()),r==="<br>"?a=[""]:a=[r],g=e.append("tspan").attr("x",0).attr("y",u).attr("dy",h+"em").text(r))})}const Ct=function(n,t,e,s){const r=e%$t-1,a=n.append("g");t.section=r,a.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+r));const h=a.append("g"),u=a.append("g"),y=u.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,t.width).node().getBBox(),g=s.fontSize&&s.fontSize.replace?s.fontSize.replace("px",""):s.fontSize;return t.height=y.height+g*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,u.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),zt(h,t,r),t},Ot=function(n,t,e){const s=n.append("g"),r=s.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(pt,t.width).node().getBBox(),a=e.fontSize&&e.fontSize.replace?e.fontSize.replace("px",""):e.fontSize;return s.remove(),r.height+a*1.1*.5+t.padding},zt=function(n,t,e){n.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),n.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},C={drawRect:q,drawCircle:Et,drawSection:Mt,drawText:dt,drawLabel:It,drawTask:Tt,drawBackgroundRect:At,getTextObj:Ht,getNoteRect:J,initGraphics:Pt,drawNode:Ct,getVirtualNodeHeight:Ot},Lt=function(n,t,e,s){var r,a;const h=mt(),u=h.leftMargin??50;w.debug("timeline",s.db);const y=h.securityLevel;let g;y==="sandbox"&&(g=V("#i"+t));const p=(y==="sandbox"?V(g.nodes()[0].contentDocument.body):V("body")).select("#"+t);p.append("g");const b=s.db.getTasks(),m=s.db.getCommonDb().getDiagramTitle();w.debug("task",b),C.initGraphics(p);const i=s.db.getSections();w.debug("sections",i);let o=0,l=0,d=0,c=0,x=50+u,_=50;c=50;let $=0,D=!0;i.forEach(function(f){const k={number:$,descr:f,section:$,width:150,padding:20,maxHeight:o},E=C.getVirtualNodeHeight(p,k,h);w.debug("sectionHeight before draw",E),o=Math.max(o,E+20)});let O=0,A=0;w.debug("tasks.length",b.length);for(const[f,k]of b.entries()){const E={number:f,descr:k,section:k.section,width:150,padding:20,maxHeight:l},I=C.getVirtualNodeHeight(p,E,h);w.debug("taskHeight before draw",I),l=Math.max(l,I+20),O=Math.max(O,k.events.length);let z=0;for(let H=0;H<k.events.length;H++){const v={descr:k.events[H],section:k.section,number:k.section,width:150,padding:20,maxHeight:50};z+=C.getVirtualNodeHeight(p,v,h)}A=Math.max(A,z)}w.debug("maxSectionHeight before draw",o),w.debug("maxTaskHeight before draw",l),i&&i.length>0?i.forEach(f=>{const k=b.filter(H=>H.section===f),E={number:$,descr:f,section:$,width:200*Math.max(k.length,1)-50,padding:20,maxHeight:o};w.debug("sectionNode",E);const I=p.append("g"),z=C.drawNode(I,E,$,h);w.debug("sectionNode output",z),I.attr("transform",`translate(${x}, ${c})`),_+=o+50,k.length>0&&et(p,k,$,x,_,l,h,O,A,o,!1),x+=200*Math.max(k.length,1),_=c,$++}):(D=!1,et(p,b,$,x,_,l,h,O,A,o,!0));const W=p.node().getBBox();w.debug("bounds",W),m&&p.append("text").text(m).attr("x",W.width/2-u).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),d=D?o+l+150:l+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",u).attr("y1",d).attr("x2",W.width+3*u).attr("y2",d).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),xt(void 0,p,((r=h.timeline)==null?void 0:r.padding)??50,((a=h.timeline)==null?void 0:a.useMaxWidth)??!1)},et=function(n,t,e,s,r,a,h,u,y,g,p){var b;for(const m of t){const i={descr:m.task,section:e,number:e,width:150,padding:20,maxHeight:a};w.debug("taskNode",i);const o=n.append("g").attr("class","taskWrapper"),l=C.drawNode(o,i,e,h).height;if(w.debug("taskHeight after draw",l),o.attr("transform",`translate(${s}, ${r})`),a=Math.max(a,l),m.events){const d=n.append("g").attr("class","lineWrapper");let c=a;r+=100,c=c+Nt(n,m.events,e,s,r,h),r-=100,d.append("line").attr("x1",s+190/2).attr("y1",r+a).attr("x2",s+190/2).attr("y2",r+a+(p?a:g)+y+120).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}s=s+200,p&&!((b=h.timeline)!=null&&b.disableMulticolor)&&e++}r=r-10},Nt=function(n,t,e,s,r,a){let h=0;const u=r;r=r+100;for(const y of t){const g={descr:y,section:e,number:e,width:150,padding:20,maxHeight:50};w.debug("eventNode",g);const p=n.append("g").attr("class","eventWrapper"),b=C.drawNode(p,g,e,a).height;h=h+b,p.attr("transform",`translate(${s}, ${r})`),r=r+10+b}return r=u,h},jt={setConf:()=>{},draw:Lt},Dt=n=>{let t="";for(let e=0;e<n.THEME_COLOR_LIMIT;e++)n["lineColor"+e]=n["lineColor"+e]||n["cScaleInv"+e],yt(n["lineColor"+e])?n["lineColor"+e]=gt(n["lineColor"+e],20):n["lineColor"+e]=ft(n["lineColor"+e],20);for(let e=0;e<n.THEME_COLOR_LIMIT;e++){const s=""+(17-3*e);t+=`
|
|
7
|
+
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
8
|
+
fill: ${n["cScale"+e]};
|
|
9
|
+
}
|
|
10
|
+
.section-${e-1} text {
|
|
11
|
+
fill: ${n["cScaleLabel"+e]};
|
|
12
|
+
}
|
|
13
|
+
.node-icon-${e-1} {
|
|
14
|
+
font-size: 40px;
|
|
15
|
+
color: ${n["cScaleLabel"+e]};
|
|
16
|
+
}
|
|
17
|
+
.section-edge-${e-1}{
|
|
18
|
+
stroke: ${n["cScale"+e]};
|
|
19
|
+
}
|
|
20
|
+
.edge-depth-${e-1}{
|
|
21
|
+
stroke-width: ${s};
|
|
22
|
+
}
|
|
23
|
+
.section-${e-1} line {
|
|
24
|
+
stroke: ${n["cScaleInv"+e]} ;
|
|
25
|
+
stroke-width: 3;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.lineWrapper line{
|
|
29
|
+
stroke: ${n["cScaleLabel"+e]} ;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.disabled, .disabled circle, .disabled text {
|
|
33
|
+
fill: lightgray;
|
|
34
|
+
}
|
|
35
|
+
.disabled text {
|
|
36
|
+
fill: #efefef;
|
|
37
|
+
}
|
|
38
|
+
`}return t},Wt=n=>`
|
|
39
|
+
.edge {
|
|
40
|
+
stroke-width: 3;
|
|
41
|
+
}
|
|
42
|
+
${Dt(n)}
|
|
43
|
+
.section-root rect, .section-root path, .section-root circle {
|
|
44
|
+
fill: ${n.git0};
|
|
45
|
+
}
|
|
46
|
+
.section-root text {
|
|
47
|
+
fill: ${n.gitBranchLabel0};
|
|
48
|
+
}
|
|
49
|
+
.icon-container {
|
|
50
|
+
height:100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
}
|
|
55
|
+
.edge {
|
|
56
|
+
fill: none;
|
|
57
|
+
}
|
|
58
|
+
.eventWrapper {
|
|
59
|
+
filter: brightness(120%);
|
|
60
|
+
}
|
|
61
|
+
`,Bt=Wt,Rt={db:wt,renderer:jt,parser:bt,styles:Bt};export{Rt as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{o as Ft,s as Bt,u as At,l as Nt,i as Ot,a as Xt,O as wt,ab as Vt,c as Ut,n as Yt,ak as nt,ac as kt,af as Ht,aj as Gt,M as Qt,al as xt,x as dt,b as pt}from"./index-BKRCw_DF.js";import{U as jt}from"./createText-1719965b-Cbn6MBZp-zrb_KsAx.js";var et=function(){var e=function(M,h,r,l){for(r=r||{},l=M.length;l--;r[M[l]]=h);return r},t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],c=[1,6],g=[1,7],p=[1,5,10,12,14,16,18,19,21,23,34,35,36],y=[1,25],D=[1,26],S=[1,28],_=[1,29],P=[1,30],E=[1,31],C=[1,32],v=[1,33],d=[1,34],A=[1,35],o=[1,36],T=[1,37],B=[1,43],ot=[1,42],rt=[1,47],U=[1,50],m=[1,10,12,14,16,18,19,21,23,34,35,36],j=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],R=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],lt=[1,64],K={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:function(M,h,r,l,f,a,w){var u=a.length-1;switch(f){case 5:l.setOrientation(a[u]);break;case 9:l.setDiagramTitle(a[u].text.trim());break;case 12:l.setLineData({text:"",type:"text"},a[u]);break;case 13:l.setLineData(a[u-1],a[u]);break;case 14:l.setBarData({text:"",type:"text"},a[u]);break;case 15:l.setBarData(a[u-1],a[u]);break;case 16:this.$=a[u].trim(),l.setAccTitle(this.$);break;case 17:case 18:this.$=a[u].trim(),l.setAccDescription(this.$);break;case 19:this.$=a[u-1];break;case 20:this.$=[Number(a[u-2]),...a[u]];break;case 21:this.$=[Number(a[u])];break;case 22:l.setXAxisTitle(a[u]);break;case 23:l.setXAxisTitle(a[u-1]);break;case 24:l.setXAxisTitle({type:"text",text:""});break;case 25:l.setXAxisBand(a[u]);break;case 26:l.setXAxisRangeData(Number(a[u-2]),Number(a[u]));break;case 27:this.$=a[u-1];break;case 28:this.$=[a[u-2],...a[u]];break;case 29:this.$=[a[u]];break;case 30:l.setYAxisTitle(a[u]);break;case 31:l.setYAxisTitle(a[u-1]);break;case 32:l.setYAxisTitle({type:"text",text:""});break;case 33:l.setYAxisRangeData(Number(a[u-2]),Number(a[u]));break;case 37:this.$={text:a[u],type:"text"};break;case 38:this.$={text:a[u],type:"text"};break;case 39:this.$={text:a[u],type:"markdown"};break;case 40:this.$=a[u];break;case 41:this.$=a[u-1]+""+a[u];break}},table:[e(t,i,{3:1,4:2,7:4,5:s,34:n,35:c,36:g}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,34:n,35:c,36:g}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:n,35:c,36:g}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,34]),e(p,[2,35]),e(p,[2,36]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,34:n,35:c,36:g}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,34:n,35:c,36:g}),{11:23,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},{11:39,13:38,24:B,27:ot,29:40,30:41,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},{11:45,15:44,27:rt,33:46,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},{11:49,17:48,24:U,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},{11:52,17:51,24:U,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},{20:[1,53]},{22:[1,54]},e(m,[2,18]),{1:[2,2]},e(m,[2,8]),e(m,[2,9]),e(j,[2,37],{40:55,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T}),e(j,[2,38]),e(j,[2,39]),e(R,[2,40]),e(R,[2,42]),e(R,[2,43]),e(R,[2,44]),e(R,[2,45]),e(R,[2,46]),e(R,[2,47]),e(R,[2,48]),e(R,[2,49]),e(R,[2,50]),e(R,[2,51]),e(m,[2,10]),e(m,[2,22],{30:41,29:56,24:B,27:ot}),e(m,[2,24]),e(m,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},e(m,[2,11]),e(m,[2,30],{33:60,27:rt}),e(m,[2,32]),{31:[1,61]},e(m,[2,12]),{17:62,24:U},{25:63,27:lt},e(m,[2,14]),{17:65,24:U},e(m,[2,16]),e(m,[2,17]),e(R,[2,41]),e(m,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},e(m,[2,31]),{27:[1,69]},e(m,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},e(m,[2,15]),e(m,[2,26]),e(m,[2,27]),{11:59,32:72,37:24,38:y,39:D,40:27,41:S,42:_,43:P,44:E,45:C,46:v,47:d,48:A,49:o,50:T},e(m,[2,33]),e(m,[2,19]),{25:73,27:lt},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:function(M,h){if(h.recoverable)this.trace(M);else{var r=new Error(M);throw r.hash=h,r}},parse:function(M){var h=this,r=[0],l=[],f=[null],a=[],w=this.table,u="",Y=0,ct=0,$t=2,gt=1,It=a.slice.call(arguments,1),b=Object.create(this.lexer),z={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(z.yy[J]=this.yy[J]);b.setInput(M,z.yy),z.yy.lexer=b,z.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;a.push(q);var zt=b.options&&b.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Wt(){var I;return I=l.pop()||b.lex()||gt,typeof I!="number"&&(I instanceof Array&&(l=I,I=l.pop()),I=h.symbols_[I]||I),I}for(var k,W,L,tt,F={},H,$,ut,G;;){if(W=r[r.length-1],this.defaultActions[W]?L=this.defaultActions[W]:((k===null||typeof k>"u")&&(k=Wt()),L=w[W]&&w[W][k]),typeof L>"u"||!L.length||!L[0]){var it="";G=[];for(H in w[W])this.terminals_[H]&&H>$t&&G.push("'"+this.terminals_[H]+"'");b.showPosition?it="Parse error on line "+(Y+1)+`:
|
|
2
|
+
`+b.showPosition()+`
|
|
3
|
+
Expecting `+G.join(", ")+", got '"+(this.terminals_[k]||k)+"'":it="Parse error on line "+(Y+1)+": Unexpected "+(k==gt?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(it,{text:b.match,token:this.terminals_[k]||k,line:b.yylineno,loc:q,expected:G})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+k);switch(L[0]){case 1:r.push(k),f.push(b.yytext),a.push(b.yylloc),r.push(L[1]),k=null,ct=b.yyleng,u=b.yytext,Y=b.yylineno,q=b.yylloc;break;case 2:if($=this.productions_[L[1]][1],F.$=f[f.length-$],F._$={first_line:a[a.length-($||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-($||1)].first_column,last_column:a[a.length-1].last_column},zt&&(F._$.range=[a[a.length-($||1)].range[0],a[a.length-1].range[1]]),tt=this.performAction.apply(F,[u,ct,Y,z.yy,L[1],f,a].concat(It)),typeof tt<"u")return tt;$&&(r=r.slice(0,-1*$*2),f=f.slice(0,-1*$),a=a.slice(0,-1*$)),r.push(this.productions_[L[1]][0]),f.push(F.$),a.push(F._$),ut=w[r[r.length-2]][r[r.length-1]],r.push(ut);break;case 3:return!0}}return!0}},Mt=function(){var M={EOF:1,parseError:function(h,r){if(this.yy.parser)this.yy.parser.parseError(h,r);else throw new Error(h)},setInput:function(h,r){return this.yy=r||this.yy||{},this._input=h,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},input:function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var r=h.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},unput:function(h){var r=h.length,l=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var f=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),l.length-1&&(this.yylineno-=l.length-1);var a=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:l?(l.length===f.length?this.yylloc.first_column:0)+f[f.length-l.length].length-l[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(h){this.unput(this.match.slice(h))},pastInput:function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var h=this.match;return h.length<20&&(h+=this._input.substr(0,20-h.length)),(h.substr(0,20)+(h.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var h=this.pastInput(),r=new Array(h.length+1).join("-");return h+this.upcomingInput()+`
|
|
5
|
+
`+r+"^"},test_match:function(h,r){var l,f,a;if(this.options.backtrack_lexer&&(a={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&&(a.yylloc.range=this.yylloc.range.slice(0))),f=h[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+h[0].length},this.yytext+=h[0],this.match+=h[0],this.matches=h,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(h[0].length),this.matched+=h[0],l=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var w in a)this[w]=a[w];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,r,l,f;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),w=0;w<a.length;w++)if(l=this._input.match(this.rules[a[w]]),l&&(!r||l[0].length>r[0].length)){if(r=l,f=w,this.options.backtrack_lexer){if(h=this.test_match(l,a[w]),h!==!1)return h;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(h=this.test_match(r,a[f]),h!==!1?h:!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})},lex:function(){var h=this.next();return h||this.lex()},begin:function(h){this.conditionStack.push(h)},popState:function(){var h=this.conditionStack.length-1;return h>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(h){return h=this.conditionStack.length-1-Math.abs(h||0),h>=0?this.conditionStack[h]:"INITIAL"},pushState:function(h){this.begin(h)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(h,r,l,f){switch(l){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 8;case 16:return this.pushState("axis_data"),"X_AXIS";case 17:return this.pushState("axis_data"),"Y_AXIS";case 18:return this.pushState("axis_band_data"),24;case 19:return 31;case 20:return this.pushState("data"),16;case 21:return this.pushState("data"),18;case 22:return this.pushState("data_inner"),24;case 23:return 27;case 24:return this.popState(),26;case 25:this.popState();break;case 26:this.pushState("string");break;case 27:this.popState();break;case 28:return"STR";case 29:return 24;case 30:return 26;case 31:return 43;case 32:return"COLON";case 33:return 44;case 34:return 28;case 35:return 45;case 36:return 46;case 37:return 48;case 38:return 50;case 39:return 47;case 40:return 41;case 41:return 49;case 42:return 42;case 43:break;case 44:return 35;case 45:return 36}},rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[27,28],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:!0}}};return M}();K.lexer=Mt;function Z(){this.yy={}}return Z.prototype=K,K.Parser=Z,new Z}();et.parser=et;const Kt=et;function ft(e){return e.type==="bar"}function St(e){return e.type==="band"}function N(e){return e.type==="linear"}class Ct{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((c,g)=>Math.max(g.length,c),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const c of t){const g=jt(n,1,c),p=g?g.width:c.length*i,y=g?g.height:i;s.width=Math.max(s.width,p),s.height=Math.max(s.height,y)}return n.remove(),s}}const yt=.7,mt=.2;class _t{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){yt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(yt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=mt*t.width;this.outerPadding=Math.min(s.width/2,n);const c=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=mt*t.height;this.outerPadding=Math.min(s.height/2,n);const c=s.width+this.axisConfig.labelPadding*2;c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}}class Zt extends _t{constructor(t,i,s,n,c){super(t,n,c,i),this.categories=s,this.scale=xt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=xt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),wt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)||this.getRange()[0]}}class Jt extends _t{constructor(t,i,s,n,c){super(t,n,c,i),this.domain=s,this.scale=dt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=dt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}}function bt(e,t,i,s){const n=new Ct(s);return St(e)?new Zt(t,i,e.categories,e.title,n):new Jt(t,i,[e.min,e.max],e.title,n)}class qt{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}}function ti(e,t,i,s){const n=new Ct(s);return new qt(n,e,t,i)}class ii{constructor(t,i,s,n,c){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=c}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let i;return this.orientation==="horizontal"?i=pt().y(s=>s[0]).x(s=>s[1])(t):i=pt().x(s=>s[0]).y(s=>s[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}}class ei{constructor(t,i,s,n,c,g){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=c,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]),i=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),s=i/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:this.boundingRect.x,y:n[0]-s,height:i,width:n[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(n=>({x:n[0]-s,y:n[1],width:i,height:this.boundingRect.y+this.boundingRect.height-n[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}}class si{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const n=new ii(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{const n=new ei(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}}function ni(e,t,i){return new si(e,t,i)}class ai{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:ti(t,i,s,n),plot:ni(t,i,s),xAxis:bt(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:bt(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:c,height:g});t-=p.width,i-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=p.height,i-=p.height,this.componentStore.xAxis.setAxisPosition("bottom"),p=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=p.height,this.componentStore.yAxis.setAxisPosition("left"),p=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=p.width,t-=p.width,t>0&&(c+=t,t=0),i>0&&(g+=i,i=0),this.componentStore.plot.calculateSpace({width:c,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.xAxis.setRange([s,s+c]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+g}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(y=>ft(y))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,c=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),y=this.componentStore.plot.calculateSpace({width:g,height:p});t-=y.width,i-=y.height,y=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=y.height,i-=y.height,this.componentStore.xAxis.setAxisPosition("left"),y=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=y.width,n=y.width,this.componentStore.yAxis.setAxisPosition("top"),y=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=y.height,c=s+y.height,t>0&&(g+=t,t=0),i>0&&(p+=i,i=0),this.componentStore.plot.calculateSpace({width:g,height:p}),this.componentStore.plot.setBoundingBoxXY({x:n,y:c}),this.componentStore.yAxis.setRange([n,n+g]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([c,c+p]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:c}),this.chartData.plots.some(D=>ft(D))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}}class hi{static build(t,i,s,n){return new ai(t,i,s,n).getDrawableElement()}}let O=0,Tt,X=Lt(),V=Rt(),x=Dt(),st=V.plotColorPalette.split(",").map(e=>e.trim()),Q=!1,at=!1;function Rt(){const e=Gt(),t=nt();return kt(e.xyChart,t.themeVariables.xyChart)}function Lt(){const e=nt();return kt(Ht.xyChart,e.xyChart)}function Dt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function ht(e){const t=nt();return Qt(e.trim(),t)}function oi(e){Tt=e}function ri(e){e==="horizontal"?X.chartOrientation="horizontal":X.chartOrientation="vertical"}function li(e){x.xAxis.title=ht(e.text)}function Pt(e,t){x.xAxis={type:"linear",title:x.xAxis.title,min:e,max:t},Q=!0}function ci(e){x.xAxis={type:"band",title:x.xAxis.title,categories:e.map(t=>ht(t.text))},Q=!0}function gi(e){x.yAxis.title=ht(e.text)}function ui(e,t){x.yAxis={type:"linear",title:x.yAxis.title,min:e,max:t},at=!0}function xi(e){const t=Math.min(...e),i=Math.max(...e),s=N(x.yAxis)?x.yAxis.min:1/0,n=N(x.yAxis)?x.yAxis.max:-1/0;x.yAxis={type:"linear",title:x.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}function Et(e){let t=[];if(e.length===0)return t;if(!Q){const i=N(x.xAxis)?x.xAxis.min:1/0,s=N(x.xAxis)?x.xAxis.max:-1/0;Pt(Math.min(i,1),Math.max(s,e.length))}if(at||xi(e),St(x.xAxis)&&(t=x.xAxis.categories.map((i,s)=>[i,e[s]])),N(x.xAxis)){const i=x.xAxis.min,s=x.xAxis.max,n=(s-i+1)/e.length,c=[];for(let g=i;g<=s;g+=n)c.push(`${g}`);t=c.map((g,p)=>[g,e[p]])}return t}function vt(e){return st[e===0?0:e%st.length]}function di(e,t){const i=Et(t);x.plots.push({type:"line",strokeFill:vt(O),strokeWidth:2,data:i}),O++}function pi(e,t){const i=Et(t);x.plots.push({type:"bar",fill:vt(O),data:i}),O++}function fi(){if(x.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return x.title=At(),hi.build(X,x,V,Tt)}function yi(){return V}function mi(){return X}const bi=function(){Yt(),O=0,X=Lt(),x=Dt(),V=Rt(),st=V.plotColorPalette.split(",").map(e=>e.trim()),Q=!1,at=!1},Ai={getDrawableElem:fi,clear:bi,setAccTitle:Xt,getAccTitle:Ot,setDiagramTitle:Nt,getDiagramTitle:At,getAccDescription:Bt,setAccDescription:Ft,setOrientation:ri,setXAxisTitle:li,setXAxisRangeData:Pt,setXAxisBand:ci,setYAxisTitle:gi,setYAxisRangeData:ui,setLineData:di,setBarData:pi,setTmpSVGG:oi,getChartThemeConfig:yi,getChartConfig:mi},wi=(e,t,i,s)=>{const n=s.db,c=n.getChartThemeConfig(),g=n.getChartConfig();function p(d){return d==="top"?"text-before-edge":"middle"}function y(d){return d==="left"?"start":d==="right"?"end":"middle"}function D(d){return`translate(${d.x}, ${d.y}) rotate(${d.rotation||0})`}wt.debug(`Rendering xychart chart
|
|
7
|
+
`+e);const S=Vt(t),_=S.append("g").attr("class","main"),P=_.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");Ut(S,g.height,g.width,!0),S.attr("viewBox",`0 0 ${g.width} ${g.height}`),P.attr("fill",c.backgroundColor),n.setTmpSVGG(S.append("g").attr("class","mermaid-tmp-group"));const E=n.getDrawableElem(),C={};function v(d){let A=_,o="";for(const[T]of d.entries()){let B=_;T>0&&C[o]&&(B=C[o]),o+=d[T],A=C[o],A||(A=C[o]=B.append("g").attr("class",d[T]))}return A}for(const d of E){if(d.data.length===0)continue;const A=v(d.groupTexts);switch(d.type){case"rect":A.selectAll("rect").data(d.data).enter().append("rect").attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height).attr("fill",o=>o.fill).attr("stroke",o=>o.strokeFill).attr("stroke-width",o=>o.strokeWidth);break;case"text":A.selectAll("text").data(d.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",o=>o.fill).attr("font-size",o=>o.fontSize).attr("dominant-baseline",o=>p(o.verticalPos)).attr("text-anchor",o=>y(o.horizontalPos)).attr("transform",o=>D(o)).text(o=>o.text);break;case"path":A.selectAll("path").data(d.data).enter().append("path").attr("d",o=>o.path).attr("fill",o=>o.fill?o.fill:"none").attr("stroke",o=>o.strokeFill).attr("stroke-width",o=>o.strokeWidth);break}}},ki={draw:wi},_i={parser:Kt,db:Ai,renderer:ki};export{_i as diagram};
|
package/dist/index.html
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>ORBIT Chat</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
11
|
+
<style>
|
|
12
|
+
* {
|
|
13
|
+
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
16
|
+
<script type="module" crossorigin src="/assets/index-BKRCw_DF.js"></script>
|
|
17
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BbD-jy76.css">
|
|
18
|
+
</head>
|
|
19
|
+
<body>
|
|
20
|
+
<div id="root"></div>
|
|
21
|
+
<!-- Configuration will be injected here by CLI -->
|
|
22
|
+
<script id="orbit-chat-config" type="application/json">
|
|
23
|
+
{}
|
|
24
|
+
</script>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|