UNPKG

markdown-flow-ui

Version:

A React UI library for rendering markdown with interactive flow components, typewriter effects, and plugin support

9 lines (8 loc) 40.9 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-CbHAb2u0.js"),oe=require("./init-CHZsXQcr.js"),he=require("./ordinal-CPpcdEvZ.js"),Bt=require("./linear-DpjffQGn.js");function le(i,t,e){i=+i,t=+t,e=(a=arguments.length)<2?(t=i,i=0,1):a<3?1:+e;for(var s=-1,a=Math.max(0,Math.ceil((t-i)/e))|0,o=new Array(a);++s<a;)o[s]=i+s*e;return o}function yt(){var i=he.ordinal().unknown(void 0),t=i.domain,e=i.range,s=0,a=1,o,g,m=!1,p=0,k=0,v=.5;delete i.unknown;function w(){var _=t().length,E=a<s,D=E?a:s,P=E?s:a;o=(P-D)/Math.max(1,_-p+k*2),m&&(o=Math.floor(o)),D+=(P-D-o*(_-p))*v,g=o*(1-p),m&&(D=Math.round(D),g=Math.round(g));var M=le(_).map(function(y){return D+o*y});return e(E?M.reverse():M)}return i.domain=function(_){return arguments.length?(t(_),w()):t()},i.range=function(_){return arguments.length?([s,a]=_,s=+s,a=+a,w()):[s,a]},i.rangeRound=function(_){return[s,a]=_,s=+s,a=+a,m=!0,w()},i.bandwidth=function(){return g},i.step=function(){return o},i.round=function(_){return arguments.length?(m=!!_,w()):m},i.padding=function(_){return arguments.length?(p=Math.min(1,k=+_),w()):p},i.paddingInner=function(_){return arguments.length?(p=Math.min(1,_),w()):p},i.paddingOuter=function(_){return arguments.length?(k=+_,w()):k},i.align=function(_){return arguments.length?(v=Math.max(0,Math.min(1,_)),w()):v},i.copy=function(){return yt(t(),[s,a]).round(m).paddingInner(p).paddingOuter(k).align(v)},oe.initRange.apply(w(),arguments)}var _t=(function(){var i=n.__name(function(O,h,u,x){for(u=u||{},x=O.length;x--;u[O[x]]=h);return u},"o"),t=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],o=[1,6],g=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],p=[1,25],k=[1,26],v=[1,28],w=[1,29],_=[1,30],E=[1,31],D=[1,32],P=[1,33],M=[1,34],y=[1,35],S=[1,36],c=[1,37],W=[1,43],z=[1,42],U=[1,47],X=[1,50],l=[1,10,12,14,16,18,19,21,23,34,35,36],L=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],C=[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],T=[1,64],$={trace:n.__name(function(){},"trace"),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:n.__name(function(h,u,x,d,A,r,at){var f=r.length-1;switch(A){case 5:d.setOrientation(r[f]);break;case 9:d.setDiagramTitle(r[f].text.trim());break;case 12:d.setLineData({text:"",type:"text"},r[f]);break;case 13:d.setLineData(r[f-1],r[f]);break;case 14:d.setBarData({text:"",type:"text"},r[f]);break;case 15:d.setBarData(r[f-1],r[f]);break;case 16:this.$=r[f].trim(),d.setAccTitle(this.$);break;case 17:case 18:this.$=r[f].trim(),d.setAccDescription(this.$);break;case 19:this.$=r[f-1];break;case 20:this.$=[Number(r[f-2]),...r[f]];break;case 21:this.$=[Number(r[f])];break;case 22:d.setXAxisTitle(r[f]);break;case 23:d.setXAxisTitle(r[f-1]);break;case 24:d.setXAxisTitle({type:"text",text:""});break;case 25:d.setXAxisBand(r[f]);break;case 26:d.setXAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 27:this.$=r[f-1];break;case 28:this.$=[r[f-2],...r[f]];break;case 29:this.$=[r[f]];break;case 30:d.setYAxisTitle(r[f]);break;case 31:d.setYAxisTitle(r[f-1]);break;case 32:d.setYAxisTitle({type:"text",text:""});break;case 33:d.setYAxisRangeData(Number(r[f-2]),Number(r[f]));break;case 37:this.$={text:r[f],type:"text"};break;case 38:this.$={text:r[f],type:"text"};break;case 39:this.$={text:r[f],type:"markdown"};break;case 40:this.$=r[f];break;case 41:this.$=r[f-1]+""+r[f];break}},"anonymous"),table:[i(t,e,{3:1,4:2,7:4,5:s,34:a,35:o,36:g}),{1:[3]},i(t,e,{4:2,7:4,3:8,5:s,34:a,35:o,36:g}),i(t,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:a,35:o,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]},i(m,[2,34]),i(m,[2,35]),i(m,[2,36]),{1:[2,1]},i(t,e,{4:2,7:4,3:21,5:s,34:a,35:o,36:g}),{1:[2,3]},i(m,[2,5]),i(t,[2,7],{4:22,34:a,35:o,36:g}),{11:23,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:39,13:38,24:W,27:z,29:40,30:41,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:45,15:44,27:U,33:46,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:49,17:48,24:X,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{11:52,17:51,24:X,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},{20:[1,53]},{22:[1,54]},i(l,[2,18]),{1:[2,2]},i(l,[2,8]),i(l,[2,9]),i(L,[2,37],{40:55,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c}),i(L,[2,38]),i(L,[2,39]),i(C,[2,40]),i(C,[2,42]),i(C,[2,43]),i(C,[2,44]),i(C,[2,45]),i(C,[2,46]),i(C,[2,47]),i(C,[2,48]),i(C,[2,49]),i(C,[2,50]),i(C,[2,51]),i(l,[2,10]),i(l,[2,22],{30:41,29:56,24:W,27:z}),i(l,[2,24]),i(l,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},i(l,[2,11]),i(l,[2,30],{33:60,27:U}),i(l,[2,32]),{31:[1,61]},i(l,[2,12]),{17:62,24:X},{25:63,27:T},i(l,[2,14]),{17:65,24:X},i(l,[2,16]),i(l,[2,17]),i(C,[2,41]),i(l,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},i(l,[2,31]),{27:[1,69]},i(l,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},i(l,[2,15]),i(l,[2,26]),i(l,[2,27]),{11:59,32:72,37:24,38:p,39:k,40:27,41:v,42:w,43:_,44:E,45:D,46:P,47:M,48:y,49:S,50:c},i(l,[2,33]),i(l,[2,19]),{25:73,27:T},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n.__name(function(h,u){if(u.recoverable)this.trace(h);else{var x=new Error(h);throw x.hash=u,x}},"parseError"),parse:n.__name(function(h){var u=this,x=[0],d=[],A=[null],r=[],at=this.table,f="",lt=0,Et=0,se=2,Mt=1,ne=r.slice.call(arguments,1),R=Object.create(this.lexer),Y={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(Y.yy[dt]=this.yy[dt]);R.setInput(h,Y.yy),Y.yy.lexer=R,Y.yy.parser=this,typeof R.yylloc>"u"&&(R.yylloc={});var ft=R.yylloc;r.push(ft);var ae=R.options&&R.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function re(V){x.length=x.length-2*V,A.length=A.length-V,r.length=r.length-V}n.__name(re,"popStack");function It(){var V;return V=d.pop()||R.lex()||Mt,typeof V!="number"&&(V instanceof Array&&(d=V,V=d.pop()),V=u.symbols_[V]||V),V}n.__name(It,"lex");for(var I,H,B,pt,q={},ct,F,Vt,ut;;){if(H=x[x.length-1],this.defaultActions[H]?B=this.defaultActions[H]:((I===null||typeof I>"u")&&(I=It()),B=at[H]&&at[H][I]),typeof B>"u"||!B.length||!B[0]){var mt="";ut=[];for(ct in at[H])this.terminals_[ct]&&ct>se&&ut.push("'"+this.terminals_[ct]+"'");R.showPosition?mt="Parse error on line "+(lt+1)+`: `+R.showPosition()+` Expecting `+ut.join(", ")+", got '"+(this.terminals_[I]||I)+"'":mt="Parse error on line "+(lt+1)+": Unexpected "+(I==Mt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(mt,{text:R.match,token:this.terminals_[I]||I,line:R.yylineno,loc:ft,expected:ut})}if(B[0]instanceof Array&&B.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+I);switch(B[0]){case 1:x.push(I),A.push(R.yytext),r.push(R.yylloc),x.push(B[1]),I=null,Et=R.yyleng,f=R.yytext,lt=R.yylineno,ft=R.yylloc;break;case 2:if(F=this.productions_[B[1]][1],q.$=A[A.length-F],q._$={first_line:r[r.length-(F||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(F||1)].first_column,last_column:r[r.length-1].last_column},ae&&(q._$.range=[r[r.length-(F||1)].range[0],r[r.length-1].range[1]]),pt=this.performAction.apply(q,[f,Et,lt,Y.yy,B[1],A,r].concat(ne)),typeof pt<"u")return pt;F&&(x=x.slice(0,-1*F*2),A=A.slice(0,-1*F),r=r.slice(0,-1*F)),x.push(this.productions_[B[1]][0]),A.push(q.$),r.push(q._$),Vt=at[x[x.length-2]][x[x.length-1]],x.push(Vt);break;case 3:return!0}}return!0},"parse")},Lt=(function(){var O={EOF:1,parseError:n.__name(function(u,x){if(this.yy.parser)this.yy.parser.parseError(u,x);else throw new Error(u)},"parseError"),setInput:n.__name(function(h,u){return this.yy=u||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},"setInput"),input:n.__name(function(){var h=this._input[0];this.yytext+=h,this.yyleng++,this.offset++,this.match+=h,this.matched+=h;var u=h.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),h},"input"),unput:n.__name(function(h){var u=h.length,x=h.split(/(?:\r\n?|\n)/g);this._input=h+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;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),x.length-1&&(this.yylineno-=x.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:x?(x.length===d.length?this.yylloc.first_column:0)+d[d.length-x.length].length-x[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n.__name(function(){return this._more=!0,this},"more"),reject:n.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n.__name(function(h){this.unput(this.match.slice(h))},"less"),pastInput:n.__name(function(){var h=this.matched.substr(0,this.matched.length-this.match.length);return(h.length>20?"...":"")+h.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n.__name(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,"")},"upcomingInput"),showPosition:n.__name(function(){var h=this.pastInput(),u=new Array(h.length+1).join("-");return h+this.upcomingInput()+` `+u+"^"},"showPosition"),test_match:n.__name(function(h,u){var x,d,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))),d=h[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+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],x=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var r in A)this[r]=A[r];return!1}return!1},"test_match"),next:n.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var h,u,x,d;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),r=0;r<A.length;r++)if(x=this._input.match(this.rules[A[r]]),x&&(!u||x[0].length>u[0].length)){if(u=x,d=r,this.options.backtrack_lexer){if(h=this.test_match(x,A[r]),h!==!1)return h;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(h=this.test_match(u,A[d]),h!==!1?h:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n.__name(function(){var u=this.next();return u||this.lex()},"lex"),begin:n.__name(function(u){this.conditionStack.push(u)},"begin"),popState:n.__name(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n.__name(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:n.__name(function(u){this.begin(u)},"pushState"),stateStackSize:n.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n.__name(function(u,x,d,A){switch(d){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 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),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,/^(?:xychart\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,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],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:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return O})();$.lexer=Lt;function N(){this.yy={}}return n.__name(N,"Parser"),N.prototype=$,$.Parser=N,new N})();_t.parser=_t;var ce=_t;function bt(i){return i.type==="bar"}n.__name(bt,"isBarPlot");function Ct(i){return i.type==="band"}n.__name(Ct,"isBandAxisData");function j(i){return i.type==="linear"}n.__name(j,"isLinearAxisData");var G,Ot=(G=class{constructor(t){this.parentGroup=t}getMaxDimension(t,e){if(!this.parentGroup)return{width:t.reduce((o,g)=>Math.max(g.length,o),0)*e,height:e};const s={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",e);for(const o of t){const g=n.computeDimensionOfText(a,1,o),m=g?g.width:o.length*e,p=g?g.height:e;s.width=Math.max(s.width,m),s.height=Math.max(s.height,p)}return a.remove(),s}},n.__name(G,"TextDimensionCalculatorWithFont"),G),Wt=.7,zt=.2,Q,Ft=(Q=class{constructor(t,e,s,a){this.axisConfig=t,this.title=e,this.textDimensionCalculator=s,this.axisThemeConfig=a,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(){Wt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Wt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let e=t.height;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=zt*t.width;this.outerPadding=Math.min(s.width/2,a);const o=s.height+this.axisConfig.labelPadding*2;this.labelTextHeight=s.height,o<=e&&(e-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=e&&(e-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-e}calculateSpaceIfDrawnVertical(t){let e=t.width;if(this.axisConfig.showAxisLine&&e>this.axisConfig.axisLineWidth&&(e-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),a=zt*t.height;this.outerPadding=Math.min(s.height/2,a);const o=s.width+this.axisConfig.labelPadding*2;o<=e&&(e-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&e>=this.axisConfig.tickLength&&(this.showTick=!0,e-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,a<=e&&(e-=a,this.showTitle=!0)}this.boundingRect.width=t.width-e,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 e=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${e},${this.boundingRect.y} L ${e},${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(e=>({text:e.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(e),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const e=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 ${e},${this.getScaleValue(s)} L ${e-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 e=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),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 e=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)},${e} L ${this.getScaleValue(s)},${e+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 e=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},${e} L ${this.boundingRect.x+this.boundingRect.width},${e}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(e=>({text:e.toString(),x:this.getScaleValue(e),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 e=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${e+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${e+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():[]}},n.__name(Q,"BaseAxis"),Q),K,ue=(K=class extends Ft{constructor(t,e,s,a,o){super(t,a,o,e),this.categories=s,this.scale=yt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=yt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),n.log.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n.__name(K,"BandAxis"),K),Z,ge=(Z=class extends Ft{constructor(t,e,s,a,o){super(t,a,o,e),this.domain=s,this.scale=Bt.linear().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Bt.linear().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n.__name(Z,"LinearAxis"),Z);function At(i,t,e,s){const a=new Ot(s);return Ct(i)?new ue(t,e,i.categories,i.title,a):new ge(t,e,[i.min,i.max],i.title,a)}n.__name(At,"getAxis");var J,xe=(J=class{constructor(t,e,s,a){this.textDimensionCalculator=t,this.chartConfig=e,this.chartData=s,this.chartThemeConfig=a,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 e=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(e.width,t.width),a=e.height+2*this.chartConfig.titlePadding;return e.width<=s&&e.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=a,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}},n.__name(J,"ChartTitle"),J);function Xt(i,t,e,s){const a=new Ot(s);return new xe(a,i,t,e)}n.__name(Xt,"getChartTitleComponent");var tt,de=(tt=class{constructor(t,e,s,a,o){this.plotData=t,this.xAxis=e,this.yAxis=s,this.orientation=a,this.plotIndex=o}getDrawableElement(){const t=this.plotData.data.map(s=>[this.xAxis.getScaleValue(s[0]),this.yAxis.getScaleValue(s[1])]);let e;return this.orientation==="horizontal"?e=n.line().y(s=>s[0]).x(s=>s[1])(t):e=n.line().x(s=>s[0]).y(s=>s[1])(t),e?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:e,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},n.__name(tt,"LinePlot"),tt),et,fe=(et=class{constructor(t,e,s,a,o,g){this.barData=t,this.boundingRect=e,this.xAxis=s,this.yAxis=a,this.orientation=o,this.plotIndex=g}getDrawableElement(){const t=this.barData.data.map(o=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:this.boundingRect.x,y:o[0]-a,height:s,width:o[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(o=>({x:o[0]-a,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n.__name(et,"BarPlot"),et),it,pe=(it=class{constructor(t,e,s){this.chartConfig=t,this.chartData=e,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,e){this.xAxis=t,this.yAxis=e}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[e,s]of this.chartData.plots.entries())switch(s.type){case"line":{const a=new de(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...a.getDrawableElement())}break;case"bar":{const a=new fe(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,e);t.push(...a.getDrawableElement())}break}return t}},n.__name(it,"BasePlot"),it);function Nt(i,t,e){return new pe(i,t,e)}n.__name(Nt,"getPlotComponent");var st,me=(st=class{constructor(t,e,s,a){this.chartConfig=t,this.chartData=e,this.componentStore={title:Xt(t,e,s,a),plot:Nt(t,e,s),xAxis:At(e.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},a),yAxis:At(e.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,s=0,a=0,o=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),g=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:o,height:g});t-=m.width,e-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),a=m.height,e-=m.height,this.componentStore.xAxis.setAxisPosition("bottom"),m=this.componentStore.xAxis.calculateSpace({width:t,height:e}),e-=m.height,this.componentStore.yAxis.setAxisPosition("left"),m=this.componentStore.yAxis.calculateSpace({width:t,height:e}),s=m.width,t-=m.width,t>0&&(o+=t,t=0),e>0&&(g+=e,e=0),this.componentStore.plot.calculateSpace({width:o,height:g}),this.componentStore.plot.setBoundingBoxXY({x:s,y:a}),this.componentStore.xAxis.setRange([s,s+o]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:a+g}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(p=>bt(p))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,e=this.chartConfig.height,s=0,a=0,o=0,g=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),m=Math.floor(e*this.chartConfig.plotReservedSpacePercent/100),p=this.componentStore.plot.calculateSpace({width:g,height:m});t-=p.width,e-=p.height,p=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:e}),s=p.height,e-=p.height,this.componentStore.xAxis.setAxisPosition("left"),p=this.componentStore.xAxis.calculateSpace({width:t,height:e}),t-=p.width,a=p.width,this.componentStore.yAxis.setAxisPosition("top"),p=this.componentStore.yAxis.calculateSpace({width:t,height:e}),e-=p.height,o=s+p.height,t>0&&(g+=t,t=0),e>0&&(m+=e,e=0),this.componentStore.plot.calculateSpace({width:g,height:m}),this.componentStore.plot.setBoundingBoxXY({x:a,y:o}),this.componentStore.yAxis.setRange([a,a+g]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:s}),this.componentStore.xAxis.setRange([o,o+m]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some(k=>bt(k))&&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 e of Object.values(this.componentStore))t.push(...e.getDrawableElements());return t}},n.__name(st,"Orchestrator"),st),nt,ye=(nt=class{static build(t,e,s,a){return new me(t,e,s,a).getDrawableElement()}},n.__name(nt,"XYChartBuilder"),nt),rt=0,Yt,ot=Tt(),ht=kt(),b=Rt(),wt=ht.plotColorPalette.split(",").map(i=>i.trim()),gt=!1,St=!1;function kt(){const i=n.getThemeVariables3(),t=n.getConfig();return n.cleanAndMerge(i.xyChart,t.themeVariables.xyChart)}n.__name(kt,"getChartDefaultThemeConfig");function Tt(){const i=n.getConfig();return n.cleanAndMerge(n.defaultConfig_default.xyChart,i.xyChart)}n.__name(Tt,"getChartDefaultConfig");function Rt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n.__name(Rt,"getChartDefaultData");function xt(i){const t=n.getConfig();return n.sanitizeText(i.trim(),t)}n.__name(xt,"textSanitizer");function Ht(i){Yt=i}n.__name(Ht,"setTmpSVGG");function Ut(i){i==="horizontal"?ot.chartOrientation="horizontal":ot.chartOrientation="vertical"}n.__name(Ut,"setOrientation");function $t(i){b.xAxis.title=xt(i.text)}n.__name($t,"setXAxisTitle");function Dt(i,t){b.xAxis={type:"linear",title:b.xAxis.title,min:i,max:t},gt=!0}n.__name(Dt,"setXAxisRangeData");function qt(i){b.xAxis={type:"band",title:b.xAxis.title,categories:i.map(t=>xt(t.text))},gt=!0}n.__name(qt,"setXAxisBand");function jt(i){b.yAxis.title=xt(i.text)}n.__name(jt,"setYAxisTitle");function Gt(i,t){b.yAxis={type:"linear",title:b.yAxis.title,min:i,max:t},St=!0}n.__name(Gt,"setYAxisRangeData");function Qt(i){const t=Math.min(...i),e=Math.max(...i),s=j(b.yAxis)?b.yAxis.min:1/0,a=j(b.yAxis)?b.yAxis.max:-1/0;b.yAxis={type:"linear",title:b.yAxis.title,min:Math.min(s,t),max:Math.max(a,e)}}n.__name(Qt,"setYAxisRangeFromPlotData");function vt(i){let t=[];if(i.length===0)return t;if(!gt){const e=j(b.xAxis)?b.xAxis.min:1/0,s=j(b.xAxis)?b.xAxis.max:-1/0;Dt(Math.min(e,1),Math.max(s,i.length))}if(St||Qt(i),Ct(b.xAxis)&&(t=b.xAxis.categories.map((e,s)=>[e,i[s]])),j(b.xAxis)){const e=b.xAxis.min,s=b.xAxis.max,a=(s-e)/(i.length-1),o=[];for(let g=e;g<=s;g+=a)o.push(`${g}`);t=o.map((g,m)=>[g,i[m]])}return t}n.__name(vt,"transformDataWithoutCategory");function Pt(i){return wt[i===0?0:i%wt.length]}n.__name(Pt,"getPlotColorFromPalette");function Kt(i,t){const e=vt(t);b.plots.push({type:"line",strokeFill:Pt(rt),strokeWidth:2,data:e}),rt++}n.__name(Kt,"setLineData");function Zt(i,t){const e=vt(t);b.plots.push({type:"bar",fill:Pt(rt),data:e}),rt++}n.__name(Zt,"setBarData");function Jt(){if(b.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return b.title=n.getDiagramTitle(),ye.build(ot,b,ht,Yt)}n.__name(Jt,"getDrawableElem");function te(){return ht}n.__name(te,"getChartThemeConfig");function ee(){return ot}n.__name(ee,"getChartConfig");function ie(){return b}n.__name(ie,"getXYChartData");var _e=n.__name(function(){n.clear(),rt=0,ot=Tt(),b=Rt(),ht=kt(),wt=ht.plotColorPalette.split(",").map(i=>i.trim()),gt=!1,St=!1},"clear"),be={getDrawableElem:Jt,clear:_e,setAccTitle:n.setAccTitle,getAccTitle:n.getAccTitle,setDiagramTitle:n.setDiagramTitle,getDiagramTitle:n.getDiagramTitle,getAccDescription:n.getAccDescription,setAccDescription:n.setAccDescription,setOrientation:Ut,setXAxisTitle:$t,setXAxisRangeData:Dt,setXAxisBand:qt,setYAxisTitle:jt,setYAxisRangeData:Gt,setLineData:Kt,setBarData:Zt,setTmpSVGG:Ht,getChartThemeConfig:te,getChartConfig:ee,getXYChartData:ie},Ae=n.__name((i,t,e,s)=>{const a=s.db,o=a.getChartThemeConfig(),g=a.getChartConfig(),m=a.getXYChartData().plots[0].data.map(y=>y[1]);function p(y){return y==="top"?"text-before-edge":"middle"}n.__name(p,"getDominantBaseLine");function k(y){return y==="left"?"start":y==="right"?"end":"middle"}n.__name(k,"getTextAnchor");function v(y){return`translate(${y.x}, ${y.y}) rotate(${y.rotation||0})`}n.__name(v,"getTextTransformation"),n.log.debug(`Rendering xychart chart `+i);const w=n.selectSvgElement(t),_=w.append("g").attr("class","main"),E=_.append("rect").attr("width",g.width).attr("height",g.height).attr("class","background");n.configureSvgSize(w,g.height,g.width,!0),w.attr("viewBox",`0 0 ${g.width} ${g.height}`),E.attr("fill",o.backgroundColor),a.setTmpSVGG(w.append("g").attr("class","mermaid-tmp-group"));const D=a.getDrawableElem(),P={};function M(y){let S=_,c="";for(const[W]of y.entries()){let z=_;W>0&&P[c]&&(z=P[c]),c+=y[W],S=P[c],S||(S=P[c]=z.append("g").attr("class",y[W]))}return S}n.__name(M,"getGroup");for(const y of D){if(y.data.length===0)continue;const S=M(y.groupTexts);switch(y.type){case"rect":if(S.selectAll("rect").data(y.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),g.showDataLabel)if(g.chartOrientation==="horizontal"){let c=function(l,L){const{data:C,label:T}=l;return L*T.length*W<=C.width-10};n.__name(c,"fitsHorizontally");const W=.7,z=y.data.map((l,L)=>({data:l,label:m[L].toString()})).filter(l=>l.data.width>0&&l.data.height>0),U=z.map(l=>{const{data:L}=l;let C=L.height*.7;for(;!c(l,C)&&C>0;)C-=1;return C}),X=Math.floor(Math.min(...U));S.selectAll("text").data(z).enter().append("text").attr("x",l=>l.data.x+l.data.width-10).attr("y",l=>l.data.y+l.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${X}px`).text(l=>l.label)}else{let c=function(l,L,C){const{data:T,label:$}=l,N=L*$.length*.7,O=T.x+T.width/2,h=O-N/2,u=O+N/2,x=h>=T.x&&u<=T.x+T.width,d=T.y+C+L<=T.y+T.height;return x&&d};n.__name(c,"fitsInBar");const W=10,z=y.data.map((l,L)=>({data:l,label:m[L].toString()})).filter(l=>l.data.width>0&&l.data.height>0),U=z.map(l=>{const{data:L,label:C}=l;let T=L.width/(C.length*.7);for(;!c(l,T,W)&&T>0;)T-=1;return T}),X=Math.floor(Math.min(...U));S.selectAll("text").data(z).enter().append("text").attr("x",l=>l.data.x+l.data.width/2).attr("y",l=>l.data.y+W).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${X}px`).text(l=>l.label)}break;case"text":S.selectAll("text").data(y.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>p(c.verticalPos)).attr("text-anchor",c=>k(c.horizontalPos)).attr("transform",c=>v(c)).text(c=>c.text);break;case"path":S.selectAll("path").data(y.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),we={draw:Ae},Ce={parser:ce,db:be,renderer:we};exports.diagram=Ce; //# sourceMappingURL=xychartDiagram-FDP5SA34-Bq4ywbxg.js.map