// flowchart.js, v1.17.1 // Copyright (c)2022 Adriano Raiano (adrai). // Distributed under MIT license // http://adrai.github.io/flowchart.js !function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i(require("Raphael"));else if("function"==typeof define&&define.amd)define(["Raphael"],i);else{var e=i("object"==typeof exports?require("Raphael"):t.Raphael);for(var s in e)("object"==typeof exports?exports:t)[s]=e[s]}}(this,function(t){return function(t){function i(s){if(e[s])return e[s].exports;var n=e[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}var e={};return i.m=t,i.c=e,i.p="",i(0)}([function(t,i,e){e(9);var s=e(4);e(15);var n={parse:s};"undefined"!=typeof window&&(window.flowchart=n),t.exports=n},function(t,i){function e(t,i){if(!t||"function"==typeof t)return i;var s={};for(var n in i)s[n]=i[n];for(n in t)t[n]&&("object"==typeof s[n]?s[n]=e(s[n],t[n]):s[n]=t[n]);return s}function s(t,i){if("function"==typeof Object.create)t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});else{t.super_=i;var e=function(){};e.prototype=i.prototype,t.prototype=new e,t.prototype.constructor=t}}t.exports={defaults:e,inherits:s}},function(t,i,e){function s(t,i,e){this.chart=t,this.group=this.chart.paper.set(),this.symbol=e,this.connectedTo=[],this.symbolType=i.symbolType,this.flowstate=i.flowstate||"future",this.lineStyle=i.lineStyle||{},this.key=i.key||"",this.leftLines=[],this.rightLines=[],this.topLines=[],this.bottomLines=[],this.params=i.params,this.next_direction=i.next&&i.direction_next?i.direction_next:void 0,this.text=this.chart.paper.text(0,0,i.text),i.key&&(this.text.node.id=i.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var s=this.getAttr("font"),n=this.getAttr("font-family"),o=this.getAttr("font-weight");s&&this.text.attr({font:s}),n&&this.text.attr({"font-family":n}),o&&this.text.attr({"font-weight":o}),i.link&&this.text.attr("href",i.link),i.function&&(this.text.attr({cursor:"pointer"}),this.text.node.addEventListener("click",function(t){window[i.function](t,i)},!1)),i.target&&this.text.attr("target",i.target);var h=this.getAttr("maxWidth");if(h){for(var r=i.text.split(" "),a="",l=0,p=r.length;lh?"\n"+y:" "+y}this.text.attr("text",a.substring(1))}if(this.group.push(this.text),e){var x=this.getAttr("text-margin");e.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*x,height:this.text.getBBox().height+2*x}),e.node.setAttribute("class",this.getAttr("class"));var g=this.getAttr("roundness");isNaN(g)||(e.node.setAttribute("ry",g),e.node.setAttribute("rx",g)),i.link&&e.attr("href",i.link),i.target&&e.attr("target",i.target),i.function&&(e.node.addEventListener("click",function(t){window[i.function](t,i)},!1),e.attr({cursor:"pointer"})),i.key&&(e.node.id=i.key),this.group.push(e),e.insertBefore(this.text),this.text.attr({y:e.getBBox().height/2}),this.initialize()}}var n=e(3),o=n.drawLine,h=n.checkLineIntersection;s.prototype.getAttr=function(t){if(this.chart){var i,e=this.chart.options?this.chart.options[t]:void 0,s=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][t]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(i=this.chart.options.flowstate[this.flowstate][t]),i||s||e}},s.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},s.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},s.prototype.getX=function(){return this.group.getBBox().x},s.prototype.getY=function(){return this.group.getBBox().y},s.prototype.shiftX=function(t){this.group.transform("t"+(this.getX()+t)+","+this.getY())},s.prototype.setX=function(t){this.group.transform("t"+t+","+this.getY())},s.prototype.shiftY=function(t){this.group.transform("t"+this.getX()+","+(this.getY()+t))},s.prototype.setY=function(t){this.group.transform("t"+this.getX()+","+t)},s.prototype.getTop=function(){var t=this.getY(),i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getBottom=function(){var t=this.getY()+this.height,i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX();return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width;return{x:i,y:t}},s.prototype.render=function(){if(this.next){var t=this,i=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();this.next.isPositioned||(this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+i),function e(){for(var s,n=!1,o=0,h=t.chart.symbols.length;ot.next.getCenter().y&&r<=t.next.width/2){n=!0;break}}if(n){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else if("left"===this.next_direction){var s=this.getLeft();this.next.isPositioned||(this.next.setY(s.y-this.next.height/2),this.next.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,n=!1,o=0,h=t.chart.symbols.length;ot.next.getCenter().y&&r<=t.next.width/2){n=!0;break}}if(n){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else{var n=this.getBottom();this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+i),this.next.setX(n.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},s.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,this.getAttr("arrow-text")||"",this.next_direction):this.drawLineTo(this.next,this.getAttr("arrow-text")||""))},s.prototype.drawLineTo=function(t,i,e){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var s,n,r=this.getCenter().x,a=this.getCenter().y,l=this.getRight(),p=this.getBottom(),y=this.getTop(),x=this.getLeft(),g=t.getCenter().x,f=t.getCenter().y,c=t.getTop(),d=t.getRight(),m=t.getLeft(),u=r===g,b=a===f,_=af||this===t,w=r>g,L=rk&&(k=c.x);else n=10*Math.max(t.topLines.length,this.bottomLines.length),s=this.leftEnd&&v?o(this.chart,p,[{x:p.x,y:p.y+B/2-n},{x:p.x+(p.x-c.x)/2,y:p.y+B/2-n},{x:p.x+(p.x-c.x)/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i):o(this.chart,p,[{x:p.x,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x+(p.x-c.x)/2;else n=10*Math.max(t.topLines.length,this.rightLines.length),s=o(this.chart,l,[{x:l.x+B/2,y:l.y-n},{x:l.x+B/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else n=10*Math.max(t.topLines.length,this.rightLines.length),s=o(this.chart,l,[{x:l.x+B/2,y:l.y-n},{x:l.x+B/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else 0===t.rightLines.length&&0===this.leftLines.length?s=o(this.chart,x,d,i):(n=10*Math.max(t.rightLines.length,this.leftLines.length),s=o(this.chart,l,[{x:l.x,y:l.y-n},{x:l.x,y:d.y-n},{x:d.x,y:d.y-n},{x:d.x,y:d.y}],i)),this.leftLines.push(s),t.rightLines.push(s),this.leftStart=!0,t.rightEnd=!0,k=d.x;else 0===t.leftLines.length&&0===this.rightLines.length?s=o(this.chart,l,m,i):(n=10*Math.max(t.leftLines.length,this.rightLines.length),s=o(this.chart,l,[{x:l.x,y:l.y-n},{x:l.x,y:m.y-n},{x:m.x,y:m.y-n},{x:m.x,y:m.y}],i)),this.rightLines.push(s),t.leftLines.push(s),this.rightStart=!0,t.leftEnd=!0,k=m.x;else 0===t.topLines.length&&0===this.bottomLines.length?s=o(this.chart,p,c,i):(n=10*Math.max(t.topLines.length,this.bottomLines.length),s=o(this.chart,p,[{x:c.x,y:c.y-n},{x:c.x,y:c.y}],i)),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x;if(this.lineStyle[t.key]&&s&&s.attr(this.lineStyle[t.key]),s){for(var O=0,X=this.chart.lines.length;OW?(J=["L",q.x+2*A,I],C.splice(N+1,0,J),J=["C",q.x+2*A,I,q.x,I-4*A,q.x-2*A,I],C.splice(N+2,0,J),s.attr("path",C)):(J=["L",q.x-2*A,I],C.splice(N+1,0,J),J=["C",q.x-2*A,I,q.x,I-4*A,q.x+2*A,I],C.splice(N+2,0,J),s.attr("path",C)):I>Q?(J=["L",G,q.y+2*A],C.splice(N+1,0,J),J=["C",G,q.y+2*A,G+4*A,q.y,G,q.y-2*A],C.splice(N+2,0,J),s.attr("path",C)):(J=["L",G,q.y-2*A],C.splice(N+1,0,J),J=["C",G,q.y-2*A,G+4*A,q.y,G,q.y+2*A],C.splice(N+2,0,J),s.attr("path",C)),N+=2}}}this.chart.lines.push(s),(void 0===this.chart.minXFromSymbols||this.chart.minXFromSymbols>x.x)&&(this.chart.minXFromSymbols=x.x)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&k>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=k)},t.exports=s},function(t,i){function e(t,i,e){var s,n,o="M{0},{1}";for(s=2,n=2*e.length+2;sd.x?i.x-(i.x-d.x)/2:d.x-(d.x-i.x)/2,u=i.y>d.y?i.y-(i.y-d.y)/2:d.y-(d.y-i.y)/2,c?(m-=g.getBBox().width/2,u-=t.options["text-margin"]):(m+=t.options["text-margin"],u-=g.getBBox().height/2)):(m=i.x,u=i.y,c?(i.x>d.x?(m-=t.options["text-margin"]/2,f="end"):m+=t.options["text-margin"]/2,u-=t.options["text-margin"]):(m+=t.options["text-margin"]/2,u+=t.options["text-margin"],i.y>d.y&&(u-=2*t.options["text-margin"]))),g.attr({"text-anchor":f,"font-size":t.options["font-size"],fill:t.options["font-color"],x:m,y:u}),l&&g.attr({font:l}),p&&g.attr({"font-family":p}),y&&g.attr({"font-weight":y})}return a}function n(t,i,e,s,n,o,h,r){var a,l,p,y,x,g={x:null,y:null,onLine1:!1,onLine2:!1};return a=(r-o)*(e-t)-(h-n)*(s-i),0===a?g:(l=i-o,p=t-n,y=(h-n)*l-(r-o)*p,x=(e-t)*l-(s-i)*p,l=y/a,p=x/a,g.x=t+l*(e-t),g.y=i+l*(s-i),l>0&&l<1&&(g.onLine1=!0),p>0&&p<1&&(g.onLine2=!0),g)}t.exports={drawPath:e,drawLine:s,checkLineIntersection:n}},function(t,i,e){function s(t){function i(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):"{}"}function e(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):""}function s(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?f.symbols[t.substring(0,i-1)]:f.symbols[t]}function x(t){var i="next",e=t.indexOf("(")+1,s=t.indexOf(")");return e>=0&&s>=0&&(i=F.substring(e,s),i.indexOf(",")<0&&"yes"!==i&&"no"!==i&&(i="next, "+i)),i}function g(t){var i=t.indexOf("(")+1,e=t.indexOf(")"),s=t.substring(i,e);s.indexOf(",")>0&&(s=s.substring(0,s.indexOf(",")));var n=s.split("@");if(n.length>1)return i>=0&&e>=0?n[1]:""}t=t||"",t=t.trim();for(var f={symbols:{},start:null,drawSVG:function(t,i){function e(t){if(g[t.key])return g[t.key];switch(t.symbolType){case"start":g[t.key]=new o(x,t);break;case"end":g[t.key]=new h(x,t);break;case"operation":g[t.key]=new r(x,t);break;case"inputoutput":g[t.key]=new a(x,t);break;case"subroutine":g[t.key]=new l(x,t);break;case"condition":g[t.key]=new p(x,t);break;case"parallel":g[t.key]=new y(x,t);break;default:return new Error("Wrong symbol type!")}return g[t.key]}var s=this;this.diagram&&this.diagram.clean();var x=new n(t,i);this.diagram=x;var g={};!function t(i,n,o){var h=e(i);return s.start===i?x.startWith(h):n&&o&&!n.pathOk&&(n instanceof p?(o.yes===i&&n.yes(h),o.no===i&&n.no(h)):n instanceof y?(o.path1===i&&n.path1(h),o.path2===i&&n.path2(h),o.path3===i&&n.path3(h)):n.then(h)),h.pathOk?h:(h instanceof p?(i.yes&&t(i.yes,h,i),i.no&&t(i.no,h,i)):h instanceof y?(i.path1&&t(i.path1,h,i),i.path2&&t(i.path2,h,i),i.path3&&t(i.path3,h,i)):i.next&&t(i.next,h,i),h)}(this.start),x.render()},clean:function(){this.diagram.clean()},options:function(){return this.diagram.options}},c=[],d=0,m=1,u=t.length;m")<0&&w.indexOf("=>")<0&&w.indexOf("@>")<0?(c[_-1]+="\n"+w,c.splice(_,1),v--):_++}for(;c.length>0;){var L=c.splice(0,1)[0].trim();if(L.indexOf("=>")>=0){var k=L.split("=>"),B={key:k[0].replace(/\(.*\)/,""),symbolType:k[1],text:null,link:null,target:null,flowstate:null,function:null,lineStyle:{},params:{}},A=k[0].match(/\((.*)\)/);if(A&&A.length>1)for(var M=A[1].split(","),O=0;O=0&&(T=B.symbolType.split(": "),B.symbolType=T.shift(),B.text=T.join(": ")),B.text&&B.text.indexOf(":$")>=0?(T=B.text.split(":$"),B.text=T.shift(),B.function=T.join(":$")):B.symbolType.indexOf(":$")>=0?(T=B.symbolType.split(":$"),B.symbolType=T.shift(),B.function=T.join(":$")):B.text&&B.text.indexOf(":>")>=0?(T=B.text.split(":>"),B.text=T.shift(),B.link=T.join(":>")):B.symbolType.indexOf(":>")>=0&&(T=B.symbolType.split(":>"),B.symbolType=T.shift(),B.link=T.join(":>")),B.symbolType.indexOf("\n")>=0&&(B.symbolType=B.symbolType.split("\n")[0]),B.link){var S=B.link.indexOf("[")+1,C=B.link.indexOf("]");S>=0&&C>=0&&(B.target=B.link.substring(S,C),B.link=B.link.substring(0,S-1))}if(B.text&&B.text.indexOf("|")>=0){var Y=B.text.split("|");B.flowstate=Y.pop().trim(),B.text=Y.join("|")}f.symbols[B.key]=B}else if(L.indexOf("->")>=0){var P=g(L);P&&(L=L.replace("@"+P,""));for(var j=L.split("->"),E=0,z=j.length;E=0){var G=N.split(",");N=G[0],V=G[1].trim()}if(P&&("condition"===$.symbolType?"yes"===N||"true"===N?$.yes_annotation=P:$.no_annotation=P:"parallel"===$.symbolType&&("path1"===N?$.path1_annotation=P:"path2"===N?$.path2_annotation=P:"path3"===N&&($.path3_annotation=P)),P=null),f.start||(f.start=$),E+1")>=0)for(var W=L.split("@>"),Q=0,q=W.length;Qt.right_symbol.getCenter().y&&r<=t.right_symbol.width/2){n=!0;break}}if(n){if("end"===t.right_symbol.symbolType)return;t.right_symbol.setX(s.getX()+s.width+i),e()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}if(this.left_symbol){var n=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(n.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,n=!1,o=0,h=t.chart.symbols.length;ot.left_symbol.getCenter().y&&r<=t.left_symbol.width/2){n=!0;break}}if(n){if("end"===t.left_symbol.symbolType)return;t.left_symbol.setX(s.getX()+s.width+i),e()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}},s.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.yes_annotation?this.yes_annotation:this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.no_annotation?this.no_annotation:this.getAttr("no-text"),this.no_direction)},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e),this.path1_annotation=i.path1_annotation||"",this.path2_annotation=i.path2_annotation||"",this.path3_annotation=i.path3_annotation||"",this.textMargin=this.getAttr("text-margin"),this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top",this.params=i.params,"path1"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path2"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path3"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),i.path1&&i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path1?(this.path2_direction="bottom",this.path1_direction="right",this.path3_direction="top"):"top"===i.direction_path1?(this.path2_direction="right",this.path1_direction="top",this.path3_direction="bottom"):"left"===i.direction_path1?(this.path2_direction="right",this.path1_direction="left",this.path3_direction="bottom"):(this.path2_direction="right",this.path1_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="left",this.path3_direction="right"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="top",this.path3_direction="right"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="left"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):(this.path1_direction=i.direction_path1,this.path2_direction=i.direction_path2,this.path3_direction=i.direction_path3),this.path1_direction=this.path1_direction||"bottom",this.path2_direction=this.path2_direction||"right",this.path3_direction=this.path3_direction||"top",this.initialize()}var n=e(2),o=e(1).inherits;o(s,n),s.prototype.render=function(){this.path1_direction&&(this[this.path1_direction+"_symbol"]=this.path1_symbol),this.path2_direction&&(this[this.path2_direction+"_symbol"]=this.path2_symbol),this.path3_direction&&(this[this.path3_direction+"_symbol"]=this.path3_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var i=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(i.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.top_symbol){var e=this.getTop();this.top_symbol.isPositioned||(this.top_symbol.shiftY(this.getY()-this.top_symbol.height-t),this.top_symbol.setX(e.x+this.top_symbol.width),this.top_symbol.isPositioned=!0,this.top_symbol.render())}var s=this;if(this.left_symbol){var n=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(n.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+t)),function i(){for(var e,n=!1,o=0,h=s.chart.symbols.length;os.left_symbol.getCenter().y&&r<=s.left_symbol.width/2){n=!0;break}}if(n){if("end"===s.left_symbol.symbolType)return;s.left_symbol.setX(e.getX()+e.width+t),i()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}if(this.right_symbol){var o=this.getRight();this.right_symbol.isPositioned||(this.right_symbol.setY(o.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t),function i(){for(var e,n=!1,o=0,h=s.chart.symbols.length;os.right_symbol.getCenter().y&&r<=s.right_symbol.width/2){n=!0;break}}if(n){if("end"===s.right_symbol.symbolType)return;s.right_symbol.setX(e.getX()+e.width+t),i()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}},s.prototype.renderLines=function(){this.path1_symbol&&this.drawLineTo(this.path1_symbol,this.path1_annotation,this.path1_direction),this.path2_symbol&&this.drawLineTo(this.path2_symbol,this.path2_annotation,this.path2_direction),this.path3_symbol&&this.drawLineTo(this.path3_symbol,this.path3_annotation,this.path3_direction)},t.exports=s},function(t,i,e){function s(t,i){i=i||{},this.paper=new n(t),this.options=o(i,h),this.symbols=[],this.lines=[],this.start=null}var n=e(16),o=e(1).defaults,h=e(8),r=e(5),a=e(6);s.prototype.handle=function(t){this.symbols.indexOf(t)<=-1&&this.symbols.push(t);var i=this;return t instanceof r?(t.yes=function(e){return t.yes_symbol=e,t.no_symbol&&(t.pathOk=!0),i.handle(e)},t.no=function(e){return t.no_symbol=e,t.yes_symbol&&(t.pathOk=!0),i.handle(e)}):t instanceof a?(t.path1=function(e){return t.path1_symbol=e,t.path2_symbol&&(t.pathOk=!0),i.handle(e)},t.path2=function(e){return t.path2_symbol=e,t.path3_symbol&&(t.pathOk=!0),i.handle(e)},t.path3=function(e){return t.path3_symbol=e,t.path1_symbol&&(t.pathOk=!0),i.handle(e)}):t.then=function(e){return t.next=e,t.pathOk=!0,i.handle(e)},t},s.prototype.startWith=function(t){return this.start=t,this.handle(t)},s.prototype.render=function(){var t,i,e=0,s=0,n=0,o=0,h=0,r=0,a=0,l=0;for(n=0,o=this.symbols.length;ne&&(e=t.width),t.height>s&&(s=t.height);for(n=0,o=this.symbols.length;nh&&(h=p),y>r&&(r=y)}for(n=0,o=this.lines.length;nh&&(h=g),f>r&&(r=f)}var c=this.options.scale,d=this.options["line-width"];this.minXFromSymbols>>0;if(0===e)return-1;var s=0;if(arguments.length>0&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s)))),s>=e)return-1;for(var n=s>=0?s:Math.max(e-Math.abs(s),0);n>>0;if(0===e)return-1;var s=e;arguments.length>1&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s))));for(var n=s>=0?Math.min(s,e-1):e-Math.abs(s);n>=0;n--)if(n in i&&i[n]===t)return n;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"End",n.call(this,t,i,e)}var n=e(2),o=e(1).inherits;o(s,n),t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,o=this.textMargin,h=s/2,a={x:o,y:h},l=[{x:o-this.textMargin,y:s},{x:o-this.textMargin+e,y:s},{x:o-this.textMargin+e+2*this.textMargin,y:0},{x:o-this.textMargin+2*this.textMargin,y:0},{x:o,y:h}],p=r(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),o=e(1).inherits,h=e(3),r=h.drawPath;o(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e)}var n=e(2),o=e(1).inherits;o(s,n),t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"Start",n.call(this,t,i,e)}var n=e(2),o=e(1).inherits;o(s,n),t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e),e.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var s=t.paper.rect(0,0,0,0);s.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),i.key&&(s.node.id=i.key+"i");var o=this.getAttr("font"),h=this.getAttr("font-family"),r=this.getAttr("font-weight");o&&s.attr({font:o}),h&&s.attr({"font-family":h}),r&&s.attr({"font-weight":r}),i.link&&s.attr("href",i.link),i.target&&s.attr("target",i.target),this.group.push(s),s.insertBefore(this.text),this.initialize()}var n=e(2),o=e(1).inherits;o(s,n),t.exports=s},function(t,i,e){if("undefined"!=typeof jQuery){var s=e(4);!function(t){function i(t,i){return t==i||Array.isArray(i)&&(i.includes(t)||i.includes(Number(t)))}var e={init:function(i){return this.each(function(){var e=t(this); this.chart=s(e.text()),e.html(""),this.chart.drawSVG(this,i)})},setFlowStateByParam:function(t,e,s){return this.each(function(){var n=this.chart,o=["next","yes","no","path1","path2","path3"];for(var h in n.symbols)if(n.symbols.hasOwnProperty(h)){var r=n.symbols[h],a=r.params[t];if(i(a,e)){r.flowstate=s;for(var l=0;l