@nodefony/monitoring-bundle
Version:
1 lines • 23.3 kB
JavaScript
"use strict";(self["webpackChunk_nodefony_monitoring_bundle"]=self["webpackChunk_nodefony_monitoring_bundle"]||[]).push([[6420],{26420:function(t,n,e){e.d(n,{diagram:function(){return X}});var i=e(99702),r=e(26312),s=e(28259),a=(e(74353),e(62559),e(43047),function(){var t=function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},n=[6,8,10,11,12,14,16,17,18],e=[1,9],i=[1,10],r=[1,11],s=[1,12],a=[1,13],o=[1,14],c={trace:function(){},yy:{},symbols_:{error:2,start:3,journey: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,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",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",18:"taskName",19:"taskData"},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,2]],performAction:function(t,n,e,i,r,s,a){var o=s.length-1;switch(r){case 1:return s[o-1];case 2:this.$=[];break;case 3:s[o-1].push(s[o]),this.$=s[o-1];break;case 4:case 5:this.$=s[o];break;case 6:case 7:this.$=[];break;case 8:i.setDiagramTitle(s[o].substr(6)),this.$=s[o].substr(6);break;case 9:this.$=s[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=s[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(s[o].substr(8)),this.$=s[o].substr(8);break;case 13:i.addTask(s[o-1],s[o]),this.$="task";break}},table:[{3:1,4:[1,2]},{1:[3]},t(n,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:i,14:r,16:s,17:a,18:o},t(n,[2,7],{1:[2,1]}),t(n,[2,3]),{9:15,11:e,12:i,14:r,16:s,17:a,18:o},t(n,[2,5]),t(n,[2,6]),t(n,[2,8]),{13:[1,16]},{15:[1,17]},t(n,[2,11]),t(n,[2,12]),{19:[1,18]},t(n,[2,4]),t(n,[2,9]),t(n,[2,10]),t(n,[2,13])],defaultActions:{},parseError:function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},parse:function(t){var n=this,e=[0],i=[],r=[null],s=[],a=this.table,o="",c=0,l=0,h=2,u=1,y=s.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var g=p.yylloc;s.push(g);var x=p.options&&p.options.ranges;function m(){var t;return t=i.pop()||p.lex()||u,"number"!==typeof t&&(t instanceof Array&&(i=t,t=i.pop()),t=n.symbols_[t]||t),t}"function"===typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;var k,_,b,v,w,$,M,T,E={};while(1){if(_=e[e.length-1],this.defaultActions[_]?b=this.defaultActions[_]:(null!==k&&"undefined"!=typeof k||(k=m()),b=a[_]&&a[_][k]),"undefined"===typeof b||!b.length||!b[0]){var S="";for(w in T=[],a[_])this.terminals_[w]&&w>h&&T.push("'"+this.terminals_[w]+"'");S=p.showPosition?"Parse error on line "+(c+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(c+1)+": Unexpected "+(k==u?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:g,expected:T})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+k);switch(b[0]){case 1:e.push(k),r.push(p.yytext),s.push(p.yylloc),e.push(b[1]),k=null,l=p.yyleng,o=p.yytext,c=p.yylineno,g=p.yylloc;break;case 2:if($=this.productions_[b[1]][1],E.$=r[r.length-$],E._$={first_line:s[s.length-($||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-($||1)].first_column,last_column:s[s.length-1].last_column},x&&(E._$.range=[s[s.length-($||1)].range[0],s[s.length-1].range[1]]),v=this.performAction.apply(E,[o,l,c,d.yy,b[1],r,s].concat(y)),"undefined"!==typeof v)return v;$&&(e=e.slice(0,-1*$*2),r=r.slice(0,-1*$),s=s.slice(0,-1*$)),e.push(this.productions_[b[1]][0]),r.push(E.$),s.push(E._$),M=a[e[e.length-2]][e[e.length-1]],e.push(M);break;case 3:return!0}}return!0}},l=function(){var t={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(t,n){return this.yy=n||this.yy||{},this._input=t,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 t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var n=t.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=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),e.length-1&&(this.yylineno-=e.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):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).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},test_match:function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),i=t[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,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(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if(e=this._input.match(this.rules[r[s]]),e&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(t=this.test_match(e,r[s]),!1!==t)return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?(t=this.test_match(n,r[i]),!1!==t&&t):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>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(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(t,n,e,i){switch(e){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 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\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,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/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,19],inclusive:!0}}};return t}();function h(){this.yy={}}return c.lexer=l,h.prototype=c,c.Parser=h,new h}());a.parser=a;const o=a;let c="";const l=[],h=[],u=[],y=function(){l.length=0,h.length=0,c="",u.length=0,(0,i.v)()},p=function(t){c=t,l.push(t)},d=function(){return l},f=function(){let t=k();const n=100;let e=0;while(!t&&e<n)t=k(),e++;return h.push(...u),h},g=function(){const t=[];h.forEach((n=>{n.people&&t.push(...n.people)}));const n=new Set(t);return[...n].sort()},x=function(t,n){const e=n.substr(1).split(":");let i=0,r=[];1===e.length?(i=Number(e[0]),r=[]):(i=Number(e[0]),r=e[1].split(","));const s=r.map((t=>t.trim())),a={section:c,type:c,people:s,task:t,score:i};u.push(a)},m=function(t){const n={section:c,type:c,description:t,task:t,classes:[]};h.push(n)},k=function(){const t=function(t){return u[t].processed};let n=!0;for(const[e,i]of u.entries())t(e),n=n&&i.processed;return n},_=function(){return g()},b={getConfig:()=>(0,i.c)().journey,clear:y,setDiagramTitle:i.q,getDiagramTitle:i.t,setAccTitle:i.s,getAccTitle:i.g,setAccDescription:i.b,getAccDescription:i.a,addSection:p,getSections:d,getTasks:f,addTask:x,addTaskOrg:m,getActors:_},v=t=>`.label {\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n color: ${t.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${t.textColor}\n }\n\n .legend {\n fill: ${t.textColor};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${t.textColor}\n }\n\n .face {\n ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${t.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${t.lineColor};\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${t.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${t.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${t.titleColor};\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n font-size: 12px;\n background: ${t.tertiaryColor};\n border: 1px solid ${t.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .task-type-0, .section-type-0 {\n ${t.fillType0?`fill: ${t.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${t.fillType0?`fill: ${t.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${t.fillType0?`fill: ${t.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${t.fillType0?`fill: ${t.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${t.fillType0?`fill: ${t.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${t.fillType0?`fill: ${t.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${t.fillType0?`fill: ${t.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${t.fillType0?`fill: ${t.fillType7}`:""};\n }\n\n .actor-0 {\n ${t.actor0?`fill: ${t.actor0}`:""};\n }\n .actor-1 {\n ${t.actor1?`fill: ${t.actor1}`:""};\n }\n .actor-2 {\n ${t.actor2?`fill: ${t.actor2}`:""};\n }\n .actor-3 {\n ${t.actor3?`fill: ${t.actor3}`:""};\n }\n .actor-4 {\n ${t.actor4?`fill: ${t.actor4}`:""};\n }\n .actor-5 {\n ${t.actor5?`fill: ${t.actor5}`:""};\n }\n`,w=v,$=function(t,n){return(0,s.d)(t,n)},M=function(t,n){const e=15,i=t.append("circle").attr("cx",n.cx).attr("cy",n.cy).attr("class","face").attr("r",e).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");function a(t){const i=(0,r.JLW)().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(e/2).outerRadius(e/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+n.cx+","+(n.cy+2)+")")}function o(t){const i=(0,r.JLW)().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(e/2).outerRadius(e/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+n.cx+","+(n.cy+7)+")")}function c(t){t.append("line").attr("class","mouth").attr("stroke",2).attr("x1",n.cx-5).attr("y1",n.cy+7).attr("x2",n.cx+5).attr("y2",n.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s.append("circle").attr("cx",n.cx-e/3).attr("cy",n.cy-e/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",n.cx+e/3).attr("cy",n.cy-e/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),n.score>3?a(s):n.score<3?o(s):c(s),i},T=function(t,n){const e=t.append("circle");return e.attr("cx",n.cx),e.attr("cy",n.cy),e.attr("class","actor-"+n.pos),e.attr("fill",n.fill),e.attr("stroke",n.stroke),e.attr("r",n.r),void 0!==e.class&&e.attr("class",e.class),void 0!==n.title&&e.append("title").text(n.title),e},E=function(t,n){return(0,s.f)(t,n)},S=function(t,n){function e(t,n,e,i,r){return t+","+n+" "+(t+e)+","+n+" "+(t+e)+","+(n+i-r)+" "+(t+e-1.2*r)+","+(n+i)+" "+t+","+(n+i)}const i=t.append("polygon");i.attr("points",e(n.x,n.y,50,20,7)),i.attr("class","labelBox"),n.y=n.y+n.labelMargin,n.x=n.x+.5*n.labelMargin,E(t,n)},A=function(t,n,e){const i=t.append("g"),r=(0,s.g)();r.x=n.x,r.y=n.y,r.fill=n.fill,r.width=e.width*n.taskCount+e.diagramMarginX*(n.taskCount-1),r.height=e.height,r.class="journey-section section-type-"+n.num,r.rx=3,r.ry=3,$(i,r),j(e)(n.text,i,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+n.num},e,n.colour)};let C=-1;const I=function(t,n,e){const i=n.x+e.width/2,r=t.append("g");C++;const a=450;r.append("line").attr("id","task"+C).attr("x1",i).attr("y1",n.y).attr("x2",i).attr("y2",a).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),M(r,{cx:i,cy:300+30*(5-n.score),score:n.score});const o=(0,s.g)();o.x=n.x,o.y=n.y,o.fill=n.fill,o.width=e.width,o.height=e.height,o.class="task task-type-"+n.num,o.rx=3,o.ry=3,$(r,o);let c=n.x+14;n.people.forEach((t=>{const e=n.actors[t].color,i={cx:c,cy:n.y,r:7,fill:e,stroke:"#000",title:t,pos:n.actors[t].position};T(r,i),c+=10})),j(e)(n.task,r,o.x,o.y,o.width,o.height,{class:"task"},e,n.colour)},P=function(t,n){(0,s.a)(t,n)},j=function(){function t(t,n,e,r,s,a,o,c){const l=n.append("text").attr("x",e+s/2).attr("y",r+a/2+5).style("font-color",c).style("text-anchor","middle").text(t);i(l,o)}function n(t,n,e,r,s,a,o,c,l){const{taskFontSize:h,taskFontFamily:u}=c,y=t.split(/<br\s*\/?>/gi);for(let p=0;p<y.length;p++){const t=p*h-h*(y.length-1)/2,c=n.append("text").attr("x",e+s/2).attr("y",r).attr("fill",l).style("text-anchor","middle").style("font-size",h).style("font-family",u);c.append("tspan").attr("x",e+s/2).attr("dy",t).text(y[p]),c.attr("y",r+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(c,o)}}function e(t,e,r,s,a,o,c,l){const h=e.append("switch"),u=h.append("foreignObject").attr("x",r).attr("y",s).attr("width",a).attr("height",o).attr("position","fixed"),y=u.append("xhtml:div").style("display","table").style("height","100%").style("width","100%");y.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),n(t,h,r,s,a,o,c,l),i(y,c)}function i(t,n){for(const e in n)e in n&&t.attr(e,n[e])}return function(i){return"fo"===i.textPlacement?e:"old"===i.textPlacement?t:n}}(),L=function(t){t.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")},V={drawRect:$,drawCircle:T,drawSection:A,drawText:E,drawLabel:S,drawTask:I,drawBackgroundRect:P,initGraphics:L},D=function(t){const n=Object.keys(t);n.forEach((function(n){N[n]=t[n]}))},O={};function F(t){const n=(0,i.c)().journey;let e=60;Object.keys(O).forEach((i=>{const r=O[i].color,s={cx:20,cy:e,r:7,fill:r,stroke:"#000",pos:O[i].position};V.drawCircle(t,s);const a={x:40,y:e+7,fill:"#666",text:i,textMargin:5|n.boxTextMargin};V.drawText(t,a),e+=20}))}const N=(0,i.c)().journey,B=N.leftMargin,R=function(t,n,e,s){const a=(0,i.c)().journey,o=(0,i.c)().securityLevel;let c;"sandbox"===o&&(c=(0,r.Ltv)("#i"+n));const l="sandbox"===o?(0,r.Ltv)(c.nodes()[0].contentDocument.body):(0,r.Ltv)("body");z.init();const h=l.select("#"+n);V.initGraphics(h);const u=s.db.getTasks(),y=s.db.getDiagramTitle(),p=s.db.getActors();for(const i in O)delete O[i];let d=0;p.forEach((t=>{O[t]={color:a.actorColours[d%a.actorColours.length],position:d},d++})),F(h),z.insert(0,0,B,50*Object.keys(O).length),q(h,u,0);const f=z.getBounds();y&&h.append("text").text(y).attr("x",B).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const g=f.stopy-f.starty+2*a.diagramMarginY,x=B+f.stopx+2*a.diagramMarginX;(0,i.i)(h,g,x,a.useMaxWidth),h.append("line").attr("x1",B).attr("y1",4*a.height).attr("x2",x-B-4).attr("y2",4*a.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const m=y?70:0;h.attr("viewBox",`${f.startx} -25 ${x} ${g+m}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",g+m+25)},z={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,n,e,i){void 0===t[n]?t[n]=e:t[n]=i(e,t[n])},updateBounds:function(t,n,e,r){const s=(0,i.c)().journey,a=this;let o=0;function c(i){return function(c){o++;const l=a.sequenceItems.length-o+1;a.updateVal(c,"starty",n-l*s.boxMargin,Math.min),a.updateVal(c,"stopy",r+l*s.boxMargin,Math.max),a.updateVal(z.data,"startx",t-l*s.boxMargin,Math.min),a.updateVal(z.data,"stopx",e+l*s.boxMargin,Math.max),"activation"!==i&&(a.updateVal(c,"startx",t-l*s.boxMargin,Math.min),a.updateVal(c,"stopx",e+l*s.boxMargin,Math.max),a.updateVal(z.data,"starty",n-l*s.boxMargin,Math.min),a.updateVal(z.data,"stopy",r+l*s.boxMargin,Math.max))}}this.sequenceItems.forEach(c())},insert:function(t,n,e,i){const r=Math.min(t,e),s=Math.max(t,e),a=Math.min(n,i),o=Math.max(n,i);this.updateVal(z.data,"startx",r,Math.min),this.updateVal(z.data,"starty",a,Math.min),this.updateVal(z.data,"stopx",s,Math.max),this.updateVal(z.data,"stopy",o,Math.max),this.updateBounds(r,a,s,o)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},W=N.sectionFills,Y=N.sectionColours,q=function(t,n,e){const r=(0,i.c)().journey;let s="";const a=2*r.height+r.diagramMarginY,o=e+a;let c=0,l="#CCC",h="black",u=0;for(const[i,y]of n.entries()){if(s!==y.section){l=W[c%W.length],u=c%W.length,h=Y[c%Y.length];let e=0;const a=y.section;for(let t=i;t<n.length;t++){if(n[t].section!=a)break;e+=1}const o={x:i*r.taskMargin+i*r.width+B,y:50,text:y.section,fill:l,num:u,colour:h,taskCount:e};V.drawSection(t,o,r),s=y.section,c++}const e=y.people.reduce(((t,n)=>(O[n]&&(t[n]=O[n]),t)),{});y.x=i*r.taskMargin+i*r.width+B,y.y=o,y.width=r.diagramMarginX,y.height=r.diagramMarginY,y.colour=h,y.fill=l,y.num=u,y.actors=e,V.drawTask(t,y,r),z.insert(y.x,y.y,y.x+y.width+r.taskMargin,450)}},J={setConf:D,draw:R},X={parser:o,db:b,renderer:J,styles:w,init:t=>{J.setConf(t.journey),b.clear()}}},28259:function(t,n,e){e.d(n,{a:function(){return a},b:function(){return l},c:function(){return c},d:function(){return s},e:function(){return u},f:function(){return o},g:function(){return h}});var i=e(62559),r=e(99702);const s=(t,n)=>{const e=t.append("rect");if(e.attr("x",n.x),e.attr("y",n.y),e.attr("fill",n.fill),e.attr("stroke",n.stroke),e.attr("width",n.width),e.attr("height",n.height),n.name&&e.attr("name",n.name),void 0!==n.rx&&e.attr("rx",n.rx),void 0!==n.ry&&e.attr("ry",n.ry),void 0!==n.attrs)for(const i in n.attrs)e.attr(i,n.attrs[i]);return void 0!==n.class&&e.attr("class",n.class),e},a=(t,n)=>{const e={x:n.startx,y:n.starty,width:n.stopx-n.startx,height:n.stopy-n.starty,fill:n.fill,stroke:n.stroke,class:"rect"},i=s(t,e);i.lower()},o=(t,n)=>{const e=n.text.replace(r.J," "),i=t.append("text");i.attr("x",n.x),i.attr("y",n.y),i.attr("class","legend"),i.style("text-anchor",n.anchor),void 0!==n.class&&i.attr("class",n.class);const s=i.append("tspan");return s.attr("x",n.x+2*n.textMargin),s.text(e),i},c=(t,n,e,r)=>{const s=t.append("image");s.attr("x",n),s.attr("y",e);const a=(0,i.Jf)(r);s.attr("xlink:href",a)},l=(t,n,e,r)=>{const s=t.append("use");s.attr("x",n),s.attr("y",e);const a=(0,i.Jf)(r);s.attr("xlink:href",`#${a}`)},h=()=>{const t={x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0};return t},u=()=>{const t={x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0};return t}}}]);