function _i(j){return j&&j.__esModule&&Object.prototype.hasOwnProperty.call(j,"default")?j.default:j}var Re={},wi={get exports(){return Re},set exports(j){Re=j}};(function(j,m){(function(x,_){j.exports=_()})(window,function(){return function(x){var _={};function T(k){if(_[k])return _[k].exports;var g=_[k]={i:k,l:!1,exports:{}};return x[k].call(g.exports,g,g.exports,T),g.l=!0,g.exports}return T.m=x,T.c=_,T.d=function(k,g,h){T.o(k,g)||Object.defineProperty(k,g,{enumerable:!0,get:h})},T.r=function(k){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(k,"__esModule",{value:!0})},T.t=function(k,g){if(1&g&&(k=T(k)),8&g||4&g&&typeof k=="object"&&k&&k.__esModule)return k;var h=Object.create(null);if(T.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:k}),2&g&&typeof k!="string")for(var a in k)T.d(h,a,function(C){return k[C]}.bind(null,a));return h},T.n=function(k){var g=k&&k.__esModule?function(){return k.default}:function(){return k};return T.d(g,"a",g),g},T.o=function(k,g){return Object.prototype.hasOwnProperty.call(k,g)},T.p="",T(T.s=1)}([function(x,_,T){var k,g;k=[T(2)],(g=function(h){function a(t){if(a.is(t,"function"))return C?t():h.on("raphael.DOMload",t);if(a.is(t,dt))return a._engine.create[J](a,t.splice(0,3+a.is(t[0],ct))).add(t);var e=Array.prototype.slice.call(arguments,0);if(a.is(e[e.length-1],"function")){var i=e.pop();return C?i.call(a._engine.create[J](a,e)):h.on("raphael.DOMload",function(){i.call(a._engine.create[J](a,e))})}return a._engine.create[J](a,arguments)}a.version="2.3.0",a.eve=h;var C,Q,ot=/[, ]+/,E={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},vt=/\{(\d+)\}/g,W="hasOwnProperty",V={doc:document,win:window},wt={was:Object.prototype[W].call(V.win,"Raphael"),is:V.win.Raphael},St=function(){this.ca=this.customAttributes={}},J="apply",U="concat",ht="ontouchstart"in window||window.TouchEvent||window.DocumentTouch&&document instanceof DocumentTouch,tt="",R=" ",B=String,G="split",$="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[G](R),xt={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},nt=B.prototype.toLowerCase,K=Math,rt=K.max,et=K.min,gt=K.abs,Bt=K.pow,Lt=K.PI,ct="number",dt="array",Ot=Object.prototype.toString,u=(a._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),o={NaN:1,Infinity:1,"-Infinity":1},s=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,c=K.round,y=parseFloat,w=parseInt,b=B.prototype.toUpperCase,M=a._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},A=a._availableAnimAttrs={blur:ct,"clip-rect":"csv",cx:ct,cy:ct,fill:"colour","fill-opacity":ct,"font-size":ct,height:ct,opacity:ct,path:"path",r:ct,rx:ct,ry:ct,stroke:"colour","stroke-opacity":ct,"stroke-width":ct,transform:"transform",width:ct,x:ct,y:ct},Y=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,Z={hs:1,rg:1},it=/,?([achlmqrstvxz]),?/gi,ft=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,yt=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,pt=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,kt=(a._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),Ct=function(t,e){return y(t)-y(e)},bt=function(t){return t},at=a._rectPath=function(t,e,i,r,n){return n?[["M",t+n,e],["l",i-2*n,0],["a",n,n,0,0,1,n,n],["l",0,r-2*n],["a",n,n,0,0,1,-n,n],["l",2*n-i,0],["a",n,n,0,0,1,-n,-n],["l",0,2*n-r],["a",n,n,0,0,1,n,-n],["z"]]:[["M",t,e],["l",i,0],["l",0,r],["l",-i,0],["z"]]},Pt=function(t,e,i,r){return r==null&&(r=i),[["M",t,e],["m",0,-r],["a",i,r,0,1,1,0,2*r],["a",i,r,0,1,1,0,-2*r],["z"]]},Mt=a._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return Pt(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return Pt(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return at(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return at(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return at(e.x,e.y,e.width,e.height)},set:function(t){var e=t._getBBox();return at(e.x,e.y,e.width,e.height)}},Et=a.mapPath=function(t,e){if(!e)return t;var i,r,n,l,p,f,d;for(n=0,p=(t=_e(t)).length;n
',(At=Ht.firstChild).style.behavior="url(#default#VML)",!At||typeof At.adj!="object")return a.type=tt;Ht=null}function $t(t){if(typeof t=="function"||Object(t)!==t)return t;var e=new t.constructor;for(var i in t)t[W](i)&&(e[i]=$t(t[i]));return e}a.svg=!(a.vml=a.type=="VML"),a._Paper=St,a.fn=Q=St.prototype=a.prototype,a._id=0,a.is=function(t,e){return(e=nt.call(e))=="finite"?!o[W](+t):e=="array"?t instanceof Array:e=="null"&&t===null||e==typeof t&&t!==null||e=="object"&&t===Object(t)||e=="array"&&Array.isArray&&Array.isArray(t)||Ot.call(t).slice(8,-1).toLowerCase()==e},a.angle=function(t,e,i,r,n,l){if(n==null){var p=t-i,f=e-r;return p||f?(180+180*K.atan2(-f,-p)/Lt+360)%360:0}return a.angle(t,e,n,l)-a.angle(i,r,n,l)},a.rad=function(t){return t%360*Lt/180},a.deg=function(t){return Math.round(180*t/Lt%360*1e3)/1e3},a.snapTo=function(t,e,i){if(i=a.is(i,"finite")?i:10,a.is(t,dt)){for(var r=t.length;r--;)if(gt(t[r]-e)<=i)return t[r]}else{var n=e%(t=+t);if(nt-i)return e-n+t}return e};var jt,ye;a.createUUID=(jt=/[xy]/g,ye=function(t){var e=16*K.random()|0;return(t=="x"?e:3&e|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(jt,ye).toUpperCase()}),a.setWindow=function(t){h("raphael.setWindow",a,V.win,t),V.win=t,V.doc=V.win.document,a._engine.initWin&&a._engine.initWin(V.win)};var Kt=function(t){if(a.vml){var e,i=/^\s+|\s+$/g;try{var r=new ActiveXObject("htmlfile");r.write(""),r.close(),e=r.body}catch{e=createPopup().document.body}var n=e.createTextRange();Kt=Nt(function(p){try{e.style.color=B(p).replace(i,tt);var f=n.queryCommandValue("ForeColor");return"#"+("000000"+(f=(255&f)<<16|65280&f|(16711680&f)>>>16).toString(16)).slice(-6)}catch{return"none"}})}else{var l=V.doc.createElement("i");l.title="Raphaël Colour Picker",l.style.display="none",V.doc.body.appendChild(l),Kt=Nt(function(p){return l.style.color=p,V.doc.defaultView.getComputedStyle(l,tt).getPropertyValue("color")})}return Kt(t)},ne=function(){return"hsb("+[this.h,this.s,this.b]+")"},se=function(){return"hsl("+[this.h,this.s,this.l]+")"},me=function(){return this.hex},oe=function(t,e,i){if(e==null&&a.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,e=t.g,t=t.r),e==null&&a.is(t,"string")){var r=a.getRGB(t);t=r.r,e=r.g,i=r.b}return(t>1||e>1||i>1)&&(t/=255,e/=255,i/=255),[t,e,i]},Ce=function(t,e,i,r){var n={r:t*=255,g:e*=255,b:i*=255,hex:a.rgb(t,e,i),toString:me};return a.is(r,"finite")&&(n.opacity=r),n};function Nt(t,e,i){return function r(){var n=Array.prototype.slice.call(arguments,0),l=n.join("␀"),p=r.cache=r.cache||{},f=r.count=r.count||[];return p[W](l)?(function(d,v){for(var L=0,q=d.length;L=1e3&&delete p[f.shift()],f.push(l),p[l]=t[J](e,n),i?i(p[l]):p[l])}}a.color=function(t){var e;return a.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(e=a.hsb2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):a.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(e=a.hsl2rgb(t),t.r=e.r,t.g=e.g,t.b=e.b,t.hex=e.hex):(a.is(t,"string")&&(t=a.getRGB(t)),a.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(e=a.rgb2hsl(t),t.h=e.h,t.s=e.s,t.l=e.l,e=a.rgb2hsb(t),t.v=e.b):(t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1),t.toString=me,t},a.hsb2rgb=function(t,e,i,r){var n,l,p,f,d;return this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(i=t.b,e=t.s,r=t.o,t=t.h),f=(d=i*e)*(1-gt((t=(t*=360)%360/60)%2-1)),n=l=p=i-d,Ce(n+=[d,f,0,0,f,d][t=~~t],l+=[f,d,d,f,0,0][t],p+=[0,0,f,d,d,f][t],r)},a.hsl2rgb=function(t,e,i,r){var n,l,p,f,d;return this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(i=t.l,e=t.s,t=t.h),(t>1||e>1||i>1)&&(t/=360,e/=100,i/=100),f=(d=2*e*(i<.5?i:1-i))*(1-gt((t=(t*=360)%360/60)%2-1)),n=l=p=i-d/2,Ce(n+=[d,f,0,0,f,d][t=~~t],l+=[f,d,d,f,0,0][t],p+=[0,0,f,d,d,f][t],r)},a.rgb2hsb=function(t,e,i){var r,n;return t=(i=oe(t,e,i))[0],e=i[1],i=i[2],{h:(((n=(r=rt(t,e,i))-et(t,e,i))==0?null:r==t?(e-i)/n:r==e?(i-t)/n+2:(t-e)/n+4)+360)%6*60/360,s:n==0?0:n/r,b:r,toString:ne}},a.rgb2hsl=function(t,e,i){var r,n,l,p;return t=(i=oe(t,e,i))[0],e=i[1],i=i[2],r=((n=rt(t,e,i))+(l=et(t,e,i)))/2,{h:(((p=n-l)==0?null:n==t?(e-i)/p:n==e?(i-t)/p+2:(t-e)/p+4)+360)%6*60/360,s:p==0?0:r<.5?p/(2*r):p/(2-2*r),l:r,toString:se}},a._path2string=function(){return this.join(",").replace(it,"$1")},a._preload=function(t,e){var i=V.doc.createElement("img");i.style.cssText="position:absolute;left:-9999em;top:-9999em",i.onload=function(){e.call(this),this.onload=null,V.doc.body.removeChild(this)},i.onerror=function(){V.doc.body.removeChild(this)},V.doc.body.appendChild(i),i.src=t};function Vt(){return this.hex}function ae(t,e){for(var i=[],r=0,n=t.length;n-2*!e>r;r+=2){var l=[{x:+t[r-2],y:+t[r-1]},{x:+t[r],y:+t[r+1]},{x:+t[r+2],y:+t[r+3]},{x:+t[r+4],y:+t[r+5]}];e?r?n-4==r?l[3]={x:+t[0],y:+t[1]}:n-2==r&&(l[2]={x:+t[0],y:+t[1]},l[3]={x:+t[2],y:+t[3]}):l[0]={x:+t[n-2],y:+t[n-1]}:n-4==r?l[3]=l[2]:r||(l[0]={x:+t[r],y:+t[r+1]}),i.push(["C",(-l[0].x+6*l[1].x+l[2].x)/6,(-l[0].y+6*l[1].y+l[2].y)/6,(l[1].x+6*l[2].x-l[3].x)/6,(l[1].y+6*l[2].y-l[3].y)/6,l[2].x,l[2].y])}return i}a.getRGB=Nt(function(t){if(!t||(t=B(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Vt};if(t=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:Vt};!Z[W](t.toLowerCase().substring(0,2))&&t.charAt()!="#"&&(t=Kt(t));var e,i,r,n,l,p,f=t.match(u);return f?(f[2]&&(r=w(f[2].substring(5),16),i=w(f[2].substring(3,5),16),e=w(f[2].substring(1,3),16)),f[3]&&(r=w((l=f[3].charAt(3))+l,16),i=w((l=f[3].charAt(2))+l,16),e=w((l=f[3].charAt(1))+l,16)),f[4]&&(p=f[4][G](Y),e=y(p[0]),p[0].slice(-1)=="%"&&(e*=2.55),i=y(p[1]),p[1].slice(-1)=="%"&&(i*=2.55),r=y(p[2]),p[2].slice(-1)=="%"&&(r*=2.55),f[1].toLowerCase().slice(0,4)=="rgba"&&(n=y(p[3])),p[3]&&p[3].slice(-1)=="%"&&(n/=100)),f[5]?(p=f[5][G](Y),e=y(p[0]),p[0].slice(-1)=="%"&&(e*=2.55),i=y(p[1]),p[1].slice(-1)=="%"&&(i*=2.55),r=y(p[2]),p[2].slice(-1)=="%"&&(r*=2.55),(p[0].slice(-3)=="deg"||p[0].slice(-1)=="°")&&(e/=360),f[1].toLowerCase().slice(0,4)=="hsba"&&(n=y(p[3])),p[3]&&p[3].slice(-1)=="%"&&(n/=100),a.hsb2rgb(e,i,r,n)):f[6]?(p=f[6][G](Y),e=y(p[0]),p[0].slice(-1)=="%"&&(e*=2.55),i=y(p[1]),p[1].slice(-1)=="%"&&(i*=2.55),r=y(p[2]),p[2].slice(-1)=="%"&&(r*=2.55),(p[0].slice(-3)=="deg"||p[0].slice(-1)=="°")&&(e/=360),f[1].toLowerCase().slice(0,4)=="hsla"&&(n=y(p[3])),p[3]&&p[3].slice(-1)=="%"&&(n/=100),a.hsl2rgb(e,i,r,n)):((f={r:e,g:i,b:r,toString:Vt}).hex="#"+(16777216|r|i<<8|e<<16).toString(16).slice(1),a.is(n,"finite")&&(f.opacity=n),f)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:Vt}},a),a.hsb=Nt(function(t,e,i){return a.hsb2rgb(t,e,i).hex}),a.hsl=Nt(function(t,e,i){return a.hsl2rgb(t,e,i).hex}),a.rgb=Nt(function(t,e,i){function r(n){return n+.5|0}return"#"+(16777216|r(i)|r(e)<<8|r(t)<<16).toString(16).slice(1)}),a.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},i=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),i.hex},a.getColor.reset=function(){delete this.start},a.parsePathString=function(t){if(!t)return null;var e=Ut(t);if(e.arr)return qt(e.arr);var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[];return a.is(t,dt)&&a.is(t[0],dt)&&(r=qt(t)),r.length||B(t).replace(ft,function(n,l,p){var f=[],d=l.toLowerCase();if(p.replace(pt,function(v,L){L&&f.push(+L)}),d=="m"&&f.length>2&&(r.push([l][U](f.splice(0,2))),d="l",l=l=="m"?"l":"L"),d=="r")r.push([l][U](f));else for(;f.length>=i[d]&&(r.push([l][U](f.splice(0,i[d]))),i[d]););}),r.toString=a._path2string,e.arr=qt(r),r},a.parseTransformString=Nt(function(t){if(!t)return null;var e=[];return a.is(t,dt)&&a.is(t[0],dt)&&(e=qt(t)),e.length||B(t).replace(yt,function(i,r,n){var l=[];nt.call(r),n.replace(pt,function(p,f){f&&l.push(+f)}),e.push([r][U](l))}),e.toString=a._path2string,e},this,function(t){if(!t)return t;for(var e=[],i=0;i1?1:d<0?0:d)/2,L=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],q=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],P=0,S=0;S<12;S++){var X=v*L[S]+v,z=he(X,t,i,n,p),N=he(X,e,r,l,f),O=z*z+N*N;P+=q[S]*K.sqrt(O)}return v*P}function ve(t,e,i,r,n,l,p,f){if(!(rt(t,i) rt(n,p)||rt(e,r) rt(l,f))){var d=(t-i)*(l-f)-(e-r)*(n-p);if(d){var v=((t*r-e*i)*(n-p)-(t-i)*(n*f-l*p))/d,L=((t*r-e*i)*(l-f)-(e-r)*(n*f-l*p))/d,q=+v.toFixed(2),P=+L.toFixed(2);if(!(q<+et(t,i).toFixed(2)||q>+rt(t,i).toFixed(2)||q<+et(n,p).toFixed(2)||q>+rt(n,p).toFixed(2)||P<+et(e,r).toFixed(2)||P>+rt(e,r).toFixed(2)||P<+et(l,f).toFixed(2)||P>+rt(l,f).toFixed(2)))return{x:v,y:L}}}}function le(t,e,i){var r=a.bezierBBox(t),n=a.bezierBBox(e);if(!a.isBBoxIntersect(r,n))return i?0:[];for(var l=Yt.apply(0,t),p=Yt.apply(0,e),f=rt(~~(l/5),1),d=rt(~~(p/5),1),v=[],L=[],q={},P=i?0:[],S=0;S =0&&st<=1.001&&ut>=0&&ut<=1.001&&(i?P++:P.push({x:lt.x,y:lt.y,t1:et(st,1),t2:et(ut,1)}))}}return P}function be(t,e,i){t=a._path2curve(t),e=a._path2curve(e);for(var r,n,l,p,f,d,v,L,q,P,S=i?0:[],X=0,z=t.length;X I||O =t.x&&e<=t.x2&&i>=t.y&&i<=t.y2},a.isBBoxIntersect=function(t,e){var i=a.isPointInsideBBox;return i(e,t.x,t.y)||i(e,t.x2,t.y)||i(e,t.x,t.y2)||i(e,t.x2,t.y2)||i(t,e.x,e.y)||i(t,e.x2,e.y)||i(t,e.x,e.y2)||i(t,e.x2,e.y2)||(t.x e.x||e.x t.x)&&(t.y e.y||e.y t.y)},a.pathIntersection=function(t,e){return be(t,e)},a.pathIntersectionNumber=function(t,e){return be(t,e,1)},a.isPointInsidePath=function(t,e,i){var r=a.pathBBox(t);return a.isPointInsideBBox(r,e,i)&&be(t,[["M",e,i],["H",r.x2+10]],1)%2==1},a._removedFactory=function(t){return function(){h("raphael.log",null,"Raphaël: you are calling to method “"+t+"” of removed object",t)}};var Wt=a.pathBBox=function(t){var e=Ut(t);if(e.bbox)return $t(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var i,r=0,n=0,l=[],p=[],f=0,d=(t=_e(t)).length;f 1&&(i*=O=K.sqrt(O),r*=O);var I=i*i,H=r*r,F=(l==p?-1:1)*K.sqrt(gt((I*H-I*N*N-H*z*z)/(I*N*N+H*z*z))),D=F*i*N/r+(t+f)/2,lt=F*-r*z/i+(e+d)/2,st=K.asin(((e-lt)/r).toFixed(9)),ut=K.asin(((d-lt)/r).toFixed(9));(st=t ut&&(st-=2*Lt),!p&&ut>st&&(ut-=2*Lt)}var pe=ut-st;if(gt(pe)>q){var Be=ut,zt=f,Rt=d;ut=st+q*(p&&ut>st?1:-1),f=D+i*K.cos(ut),d=lt+r*K.sin(ut),S=Ae(f,d,i,r,n,0,p,zt,Rt,[ut,Be,D,lt])}pe=ut-st;var de=K.cos(st),xe=K.sin(st),Oe=K.cos(ut),Qt=K.sin(ut),ie=K.tan(pe/4),Me=4/3*i*ie,ni=4/3*r*ie,si=[t,e],ge=[t+Me*xe,e-ni*de],oi=[f+Me*Qt,d-ni*Oe],ai=[f,d];if(ge[0]=2*si[0]-ge[0],ge[1]=2*si[1]-ge[1],v)return[ge,oi,ai][U](S);for(var hi=[],It=0,bi=(S=[ge,oi,ai][U](S).join()[G](",")).length;It "1e12"&&(P=.5),gt(S)>"1e12"&&(S=.5),P>0&&P<1&&(d=Jt(t,e,i,r,n,l,p,f,P),z.push(d.x),X.push(d.y)),S>0&&S<1&&(d=Jt(t,e,i,r,n,l,p,f,S),z.push(d.x),X.push(d.y)),v=l-2*r+e-(f-2*l+r),q=e-r,P=(-(L=2*(r-e)-2*(l-r))+K.sqrt(L*L-4*v*q))/2/v,S=(-L-K.sqrt(L*L-4*v*q))/2/v,gt(P)>"1e12"&&(P=.5),gt(S)>"1e12"&&(S=.5),P>0&&P<1&&(d=Jt(t,e,i,r,n,l,p,f,P),z.push(d.x),X.push(d.y)),S>0&&S<1&&(d=Jt(t,e,i,r,n,l,p,f,S),z.push(d.x),X.push(d.y)),{min:{x:et[J](0,z),y:et[J](0,X)},max:{x:rt[J](0,z),y:rt[J](0,X)}}}),_e=a._path2curve=Nt(function(t,e){var i=!e&&Ut(t);if(!e&&i.curve)return qt(i.curve);for(var r=ue(t),n=e&&ue(e),l={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},p={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},f=function(F,D,lt){var st,ut;if(!F)return["C",D.x,D.y,D.x,D.y,D.x,D.y];switch(!(F[0]in{T:1,Q:1})&&(D.qx=D.qy=null),F[0]){case"M":D.X=F[1],D.Y=F[2];break;case"A":F=["C"][U](Ae[J](0,[D.x,D.y][U](F.slice(1))));break;case"S":lt=="C"||lt=="S"?(st=2*D.x-D.bx,ut=2*D.y-D.by):(st=D.x,ut=D.y),F=["C",st,ut][U](F.slice(1));break;case"T":lt=="Q"||lt=="T"?(D.qx=2*D.x-D.qx,D.qy=2*D.y-D.qy):(D.qx=D.x,D.qy=D.y),F=["C"][U](Zt(D.x,D.y,D.qx,D.qy,F[1],F[2]));break;case"Q":D.qx=F[1],D.qy=F[2],F=["C"][U](Zt(D.x,D.y,F[1],F[2],F[3],F[4]));break;case"L":F=["C"][U](ce(D.x,D.y,F[1],F[2]));break;case"H":F=["C"][U](ce(D.x,D.y,F[1],D.y));break;case"V":F=["C"][U](ce(D.x,D.y,D.x,F[1]));break;case"Z":F=["C"][U](ce(D.x,D.y,D.X,D.Y))}return F},d=function(F,D){if(F[D].length>7){F[D].shift();for(var lt=F[D];lt.length;)L[D]="A",n&&(q[D]="A"),F.splice(D++,0,["C"][U](lt.splice(0,6)));F.splice(D,1),z=rt(r.length,n&&n.length||0)}},v=function(F,D,lt,st,ut){F&&D&&F[ut][0]=="M"&&D[ut][0]!="M"&&(D.splice(ut,0,["M",st.x,st.y]),lt.bx=0,lt.by=0,lt.x=F[ut][1],lt.y=F[ut][2],z=rt(r.length,n&&n.length||0))},L=[],q=[],P="",S="",X=0,z=rt(r.length,n&&n.length||0);X .01;)I=Yt(v,L,q,P,S,X,z,N,F+=(I r){if(e&&!q.start){if(L+=["C"+(v=qe(l,p,f[1],f[2],f[3],f[4],f[5],f[6],r-P)).start.x,v.start.y,v.m.x,v.m.y,v.x,v.y],n)return L;q.start=L,L=["M"+v.x,v.y+"C"+v.n.x,v.n.y,v.end.x,v.end.y,f[5],f[6]].join(),P+=d,l=+f[5],p=+f[6];continue}if(!t&&!e)return{x:(v=qe(l,p,f[1],f[2],f[3],f[4],f[5],f[6],r-P)).x,y:v.y,alpha:v.alpha}}P+=d,l=+f[5],p=+f[6]}L+=f.shift()+f}return q.end=L,(v=t?P:e?q:a.findDotsAtSegment(l,p,f[0],f[1],f[2],f[3],f[4],f[5],1)).alpha&&(v={x:v.x,y:v.y,alpha:v.alpha}),v}},Ge=ze(1),Ie=ze(),He=ze(0,1);a.getTotalLength=Ge,a.getPointAtLength=Ie,a.getSubpath=function(t,e,i){if(this.getTotalLength(t)-i<1e-6)return He(t,e).end;var r=He(t,i,1);return e?He(r,e).end:r},_t.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():Ge(t)},_t.getPointAtLength=function(t){var e=this.getPath();if(e)return Ie(e,t)},_t.getPath=function(){var t,e=a._getPath[this.type];if(this.type!="text"&&this.type!="set")return e&&(t=e(this)),t},_t.getSubpath=function(t,e){var i=this.getPath();if(i)return a.getSubpath(i,t,e)};var Dt=a.easing_formulas={linear:function(t){return t},"<":function(t){return Bt(t,1.7)},">":function(t){return Bt(t,.48)},"<>":function(t){var e=.48-t/1.04,i=K.sqrt(.1734+e*e),r=i-e,n=-i-e,l=Bt(gt(r),1/3)*(r<0?-1:1)+Bt(gt(n),1/3)*(n<0?-1:1)+.5;return 3*(1-l)*l*l+l*l*l},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:Bt(2,-10*t)*K.sin(2*Lt*(t-.075)/.3)+1},bounce:function(t){var e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375}};Dt.easeIn=Dt["ease-in"]=Dt["<"],Dt.easeOut=Dt["ease-out"]=Dt[">"],Dt.easeInOut=Dt["ease-in-out"]=Dt["<>"],Dt["back-in"]=Dt.backIn,Dt["back-out"]=Dt.backOut;var mt=[],Je=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},De=function(){for(var t=+new Date,e=0;e 1&&!i.next){for(n in L)L[W](n)&&(S[n]=i.totalOrigin[n]);i.el.attr(S),we(i.anim,i.el,i.anim.percents[0],null,i.totalOrigin,i.repeat-1)}i.next&&!i.stop&&we(i.anim,i.el,i.next,null,i.totalOrigin,i.repeat)}}}mt.length&&Je(De)},Ue=function(t){return t>255?255:t<0?0:t};function vi(t,e,i,r,n,l){var p=3*e,f=3*(r-e)-p,d=1-p-f,v=3*i,L=3*(n-i)-v,q=1-v-L;function P(S){return((d*S+f)*S+p)*S}return function(S,X){var z=function(N,O){var I,H,F,D,lt,st;for(F=N,st=0;st<8;st++){if(D=P(F)-N,gt(D) H)return H;for(;I D?I=F:H=F,F=(H-I)/2+I}return F}(S,X);return((q*z+L)*z+v)*z}(t,1/(200*l))}function Ft(t,e){var i=[],r={};if(this.ms=e,this.times=1,t){for(var n in t)t[W](n)&&(r[y(n)]=t[n],i.push(y(n)));i.sort(Ct)}this.anim=r,this.top=i[i.length-1],this.percents=i}function we(t,e,i,r,n,l){i=y(i);var p,f,d,v,L,q,P=t.ms,S={},X={},z={};if(r)for(O=0,I=mt.length;Or*t.top){i=t.percents[O],L=t.percents[O-1]||0,P=P/t.top*(i-L),v=t.percents[O+1],p=t.anim[i];break}r&&e.attr(t.anim[t.percents[O]])}if(p){if(f)f.initstatus=r,f.start=new Date-f.ms*r;else{for(var H in p)if(p[W](H)&&(A[W](H)||e.paper.customAttributes[W](H)))switch(S[H]=e.attr(H),S[H]==null&&(S[H]=M[H]),X[H]=p[H],A[H]){case ct:z[H]=(X[H]-S[H])/P;break;case"colour":S[H]=a.getRGB(S[H]);var F=a.getRGB(X[H]);z[H]={r:(F.r-S[H].r)/P,g:(F.g-S[H].g)/P,b:(F.b-S[H].b)/P};break;case"path":var D=_e(S[H],X[H]),lt=D[1];for(S[H]=D[0],z[H]=[],O=0,I=S[H].length;Of&&(f=v)}!t[f+="%"].callback&&(t[f].callback=r)}return new Ft(t,e)},_t.animate=function(t,e,i,r){if(this.removed)return r&&r.call(this),this;var n=t instanceof Ft?t:a.animation(t,e,i,r);return we(n,this,n.percents[0],null,this.attr()),this},_t.setTime=function(t,e){return t&&e!=null&&this.status(t,et(e,t.ms)/t.ms),this},_t.status=function(t,e){var i,r,n=[],l=0;if(e!=null)return we(t,this,-1,et(e,1)),this;for(i=mt.length;l1)for(var R=0,B=tt.length;R.5)-1;V(y-.5,2)+V(w-.5,2)>.25&&(w=E.sqrt(.25-V(y-.5,2))*Pt+.5)&&w!=.5&&(w=w.toFixed(5)-1e-5*Pt)}return J})).split(/\s*\-\s*/),s=="linear"){var Z=o.shift();if(Z=-Q(Z),isNaN(Z))return null;var it=[0,0,E.cos(h.rad(Z)),E.sin(h.rad(Z))],ft=1/(vt(W(it[2]),W(it[3]))||1);it[2]*=ft,it[3]*=ft,it[2]<0&&(it[0]=-it[2],it[2]=0),it[3]<0&&(it[1]=-it[3],it[3]=0)}var yt=h._parseDots(o);if(!yt)return null;if(c=c.replace(/[\(\)\s,\xb0#]/g,"_"),u.gradient&&c!=u.gradient.id&&(M.defs.removeChild(u.gradient),delete u.gradient),!u.gradient){Y=B(s+"Gradient",{id:c}),u.gradient=Y,B(Y,s=="radial"?{fx:y,fy:w}:{x1:it[0],y1:it[1],x2:it[2],y2:it[3],gradientTransform:u.matrix.invert()}),M.defs.appendChild(Y);for(var pt=0,kt=yt.length;pt 1?at.opacity/100:at.opacity});case"stroke":at=h.getRGB(b),s.setAttribute(w,at.hex),w=="stroke"&&at[a]("opacity")&&B(s,{"stroke-opacity":at.opacity>1?at.opacity/100:at.opacity}),w=="stroke"&&u._.arrows&&("startString"in u._.arrows&&nt(u,u._.arrows.startString),"endString"in u._.arrows&&nt(u,u._.arrows.endString,1));break;case"gradient":(u.type=="circle"||u.type=="ellipse"||C(b).charAt()!="r")&&G(u,b);break;case"opacity":c.gradient&&!c[a]("stroke-opacity")&&B(s,{"stroke-opacity":b>1?b/100:b});case"fill-opacity":if(c.gradient){(Pt=h._g.doc.getElementById(s.getAttribute("fill").replace(/^url\(#|\)$/g,J)))&&(Mt=Pt.getElementsByTagName("stop"),B(Mt[Mt.length-1],{"stop-opacity":b}));break}default:w=="font-size"&&(b=ot(b,10)+"px");var Et=w.replace(/(\-.)/g,function(At){return At.substring(1).toUpperCase()});s.style[Et]=b,u._.dirty=1,s.setAttribute(w,b)}}gt(u,o),s.style.visibility=y},gt=function(u,o){if(u.type=="text"&&(o[a]("text")||o[a]("font")||o[a]("font-size")||o[a]("x")||o[a]("y"))){var s=u.attrs,c=u.node,y=c.firstChild?ot(h._g.doc.defaultView.getComputedStyle(c.firstChild,J).getPropertyValue("font-size"),10):10;if(o[a]("text")){for(s.text=o.text;c.firstChild;)c.removeChild(c.firstChild);for(var w,b=C(o.text).split(` `),M=[],A=0,Y=b.length;A "));var se=Kt.getBoundingClientRect();A.W=y.w=(se.right-se.left)/100,A.H=y.h=(se.bottom-se.top)/100,A.X=y.x,A.Y=y.y+A.H/2,("x"in s||"y"in s)&&(A.path.v=h.format("m{0},{1}l{2},{1}",E(y.x*$),E(y.y*$),E(y.x*$)+1));for(var me=["x","y","text","font","font-family","font-weight","font-style","font-size"],oe=0,Ce=me.length;oe .25&&(pt=ot.sqrt(.25-y(yt-.5,2))*(2*(pt>.5)-1)+.5),b=yt+J+pt),U})).split(/\s*\-\s*/),w=="linear"){var M=s.shift();if(M=-Q(M),isNaN(M))return null}var A=h._parseDots(s);if(!A)return null;if(o=o.shape||o.node,A.length){o.removeChild(c),c.on=!0,c.method="none",c.color=A[0].color,c.color2=A[A.length-1].color;for(var Y=[],Z=0,it=A.length;Z ')}}catch{et=function(c){return s.createElement("<"+c+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},h._engine.initWin(h._g.win),h._engine.create=function(){var o=h._getContainer.apply(0,arguments),s=o.container,c=o.height,y=o.width,w=o.x,b=o.y;if(!s)throw new Error("VML container not found.");var M=new h._Paper,A=M.canvas=h._g.doc.createElement("div"),Y=A.style;return w=w||0,b=b||0,y=y||512,c=c||342,M.width=y,M.height=c,y==+y&&(y+="px"),c==+c&&(c+="px"),M.coordsize=216e5+J+216e5,M.coordorigin="0 0",M.span=h._g.doc.createElement("span"),M.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",A.appendChild(M.span),Y.cssText=h.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",y,c),s==1?(h._g.doc.body.appendChild(A),Y.left=w+"px",Y.top=b+"px",Y.position="absolute"):s.firstChild?s.insertBefore(A,s.firstChild):s.appendChild(A),M.renderfix=function(){},M},h.prototype.clear=function(){h.eve("raphael.clear",this),this.canvas.innerHTML=U,this.span=h._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},h.prototype.remove=function(){for(var o in h.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[o]=typeof this[o]=="function"?h._removedFactory(o):null;return!0};var Ot=h.st;for(var u in dt)dt[a](u)&&!Ot[a](u)&&(Ot[u]=function(o){return function(){var s=arguments;return this.forEach(function(c){c[o].apply(c,s)})}}(u))}}.apply(_,k))===void 0||(x.exports=g)}])})})(wi);var ki=_i(Re);const Bi={x:0,y:0,"text-margin":10,"font-size":14,"font-color":"black","line-width":3,"line-length":50,"line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block",class:"flowchart",scale:1,symbols:{start:{},end:{},condition:{},inputoutput:{},operation:{},subroutine:{},parallel:{}}},Ci=(j,m,x,_,T,k,g,h)=>{const a={x:null,y:null,onLine1:!1,onLine2:!1},C=(h-k)*(x-j)-(g-T)*(_-m);if(C===0)return a;const Q=m-k,ot=j-T,E=(g-T)*Q-(h-k)*ot,vt=(x-j)*Q-(_-m)*ot,W=E/C,V=vt/C;return a.x=j+W*(x-j),a.y=m+W*(_-m),W>0&&W<1&&(a.onLine1=!0),V>0&&V<1&&(a.onLine2=!0),a},ci=(j,m,x)=>{let _="M{0},{1}";for(let C=2;C<2*x.length+2;C+=2)_+=` L{${C}},{${C+1}}`;const T=[m.x,m.y];for(let C=0;C {let T="M{0},{1}";for(let Q=2;Q<2*x.length+2;Q+=2)T+=` L{${Q}},{${Q+1}}`;const k=[m.x,m.y];for(let Q=0;Q vt.x?(W-=j.options["text-margin"]/2,ot="end"):W+=j.options["text-margin"]/2,V-=j.options["text-margin"]):(W+=j.options["text-margin"]/2,V+=j.options["text-margin"],m.y>vt.y&&(V-=j.options["text-margin"]*2)),Q.attr({"text-anchor":ot,"font-size":j.options["font-size"],fill:j.options["font-color"],x:W,y:V}),h&&Q.attr({font:h}),a&&Q.attr({"font-family":a}),C&&Q.attr({"font-weight":C})}return g};class re{constructor(m,x,_){this.leftLines=[],this.rightLines=[],this.topLines=[],this.bottomLines=[],this.chart=m,this.group=this.chart.paper.set(),this.symbol=_,this.connectedTo=[],this.symbolType=x.symbolType,this.flowstate=x.flowstate||"future",this.lineStyle=x.lineStyle??{},this.key=x.key??"",this.next_direction=x.next&&x.direction_next?x.direction_next:void 0,this.text=this.chart.paper.text(0,0,x.text||""),x.key&&(this.text.node.id=`${x.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")});const T=this.getAttr("font"),k=this.getAttr("font-family"),g=this.getAttr("font-weight");T&&this.text.attr({font:T}),k&&this.text.attr({"font-family":k}),g&&this.text.attr({"font-weight":g}),x.link&&this.text.attr("href",x.link),x.target&&this.text.attr("target",x.target),x.function&&(this.text.attr({cursor:"pointer"}),this.text.node.addEventListener("click",a=>{window[x.function](a,x)},!1));const h=this.getAttr("maxWidth");if(h){const a=x.text.split(" ");let C="";for(let Q=0;Q h?C+=` ${ot}`:C+=` ${ot}`}this.text.attr("text",C.substring(1))}if(this.group.push(this.text),_){const a=this.getAttr("text-margin");_.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*a,height:this.text.getBBox().height+2*a}),x.link&&_.attr("href",x.link),x.target&&_.attr("target",x.target),_.node.setAttribute("class",this.getAttr("class")),x.function&&(_.node.addEventListener("click",C=>{window[x.function](C,x)},!1),_.attr({cursor:"pointer"})),x.key&&(_.node.id=x.key),this.group.push(_),_.insertBefore(this.text),this.text.attr({y:_.getBBox().height/2}),this.initialize()}}getAttr(m){if(!this.chart)return;const x=this.chart.options?this.chart.options[m]:void 0,_=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][m]:void 0;if(this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]){const T=this.chart.options.flowstate[this.flowstate][m];if(T)return T}return _||x}initialize(){this.group.transform(`t${this.getAttr("line-width")},${this.getAttr("line-width")}`),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height}getCenter(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}}getX(){return this.group.getBBox().x}getY(){return this.group.getBBox().y}shiftX(m){this.group.transform(`t${this.getX()+m},${this.getY()}`)}setX(m){this.group.transform(`t${m},${this.getY()}`)}shiftY(m){this.group.transform(`$t${this.getX()},${this.getY()+m}`)}setY(m){this.group.transform(`t${this.getX()},${m}`)}getTop(){const m=this.getY();return{x:this.getX()+this.width/2,y:m}}getBottom(){const m=this.getY()+this.height;return{x:this.getX()+this.width/2,y:m}}getLeft(){const m=this.getY()+this.group.getBBox().height/2;return{x:this.getX(),y:m}}getRight(){const m=this.getY()+this.group.getBBox().height/2;return{x:this.getX()+this.group.getBBox().width,y:m}}render(){if(this.next){const m=this.getAttr("line-length");if(this.next_direction==="right"){const x=this.getRight();if(!this.next.isPositioned){this.next.setY(x.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+m);const _=()=>{let T=!1,k;for(let g=0;g this.next.getCenter().y&&h<=this.next.width/2){T=!0;break}}if(T){if(this.next.symbolType==="end")return;this.next.setX(k.getX()+k.width+m),_()}};_(),this.next.isPositioned=!0,this.next.render()}}else if(this.next_direction==="left"){const x=this.getLeft();if(!this.next.isPositioned){this.next.setY(x.y-this.next.height/2),this.next.shiftX(-(this.group.getBBox().x+this.width+m));const _=()=>{let T=!1,k;for(let g=0;g this.next.getCenter().y&&h<=this.next.width/2){T=!0;break}}if(T){if(this.next.symbolType==="end")return;this.next.setX(k.getX()+k.width+m),_()}};_(),this.next.isPositioned=!0,this.next.render()}}else{const x=this.getBottom();this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+m),this.next.setX(x.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}}renderLines(){this.next&&(this.next_direction?this.drawLineTo(this.next,this.getAttr("arrow-text")||"",this.next_direction):this.drawLineTo(this.next,this.getAttr("arrow-text")||""))}drawLineTo(m,x,_){this.connectedTo.indexOf(m)<0&&this.connectedTo.push(m);const T=this.getCenter().x,k=this.getCenter().y,g=this.getRight(),h=this.getBottom(),a=this.getTop(),C=this.getLeft(),Q=m.getCenter().x,ot=m.getCenter().y,E=m.getTop(),vt=m.getRight(),W=m.getLeft(),V=T===Q,wt=k===ot,St=k ot||this===m,U=T>Q,ht=T tt&&(tt=E.x)}else if((!_||_==="bottom")&&ht){const $=Math.max(m.topLines.length,this.bottomLines.length)*10;R=Xt(this.chart,h,[{x:h.x,y:h.y+B/2-$},{x:h.x+(h.x-E.x)/2,y:h.y+B/2-$},{x:h.x+(h.x-E.x)/2,y:E.y-B/2-$},{x:E.x,y:E.y-B/2-$},{x:E.x,y:E.y}],x),this.bottomLines.push(R),m.topLines.push(R),this.bottomStart=!0,m.topEnd=!0,tt=h.x+(h.x-E.x)/2}else if(_&&_==="right"&&U){const $=Math.max(m.topLines.length,this.rightLines.length)*10;R=Xt(this.chart,g,[{x:g.x+B/2,y:g.y},{x:g.x+B/2,y:E.y-B/2-$},{x:E.x,y:E.y-B/2-$},{x:E.x,y:E.y}],x),this.rightLines.push(R),m.topLines.push(R),this.rightStart=!0,m.topEnd=!0,tt=g.x+B/2}else if(_&&_==="right"&&ht){const $=Math.max(m.topLines.length,this.rightLines.length)*10;R=Xt(this.chart,g,[{x:E.x,y:g.y-$},{x:E.x,y:E.y-$}],x),this.rightLines.push(R),m.topLines.push(R),this.rightStart=!0,m.topEnd=!0,tt=g.x+B/2}else if(_&&_==="bottom"&&V&&J){const $=Math.max(m.topLines.length,this.bottomLines.length)*10;R=Xt(this.chart,h,[{x:h.x,y:h.y+B/2-$},{x:g.x+B/2,y:h.y+B/2-$},{x:g.x+B/2,y:E.y-B/2-$},{x:E.x,y:E.y-B/2-$},{x:E.x,y:E.y}],x),this.bottomLines.push(R),m.topLines.push(R),this.bottomStart=!0,m.topEnd=!0,tt=h.x+B/2}else if(_==="left"&&V&&J){let $=C.x-B/2;W.xy?(M=["L",b.x+G*2,c],K.splice(Ot+1,0,M),M=["C",b.x+G*2,c,b.x,c-G*4,b.x-G*2,c],K.splice(Ot+2,0,M),R.attr("path",K)):(M=["L",b.x-G*2,c],K.splice(Ot+1,0,M),M=["C",b.x-G*2,c,b.x,c-G*4,b.x+G*2,c],K.splice(Ot+2,0,M),R.attr("path",K)):c>w?(M=["L",s,b.y+G*2],K.splice(Ot+1,0,M),M=["C",s,b.y+G*2,s+G*4,b.y,s,b.y-G*2],K.splice(Ot+2,0,M),R.attr("path",K)):(M=["L",s,b.y-G*2],K.splice(Ot+1,0,M),M=["C",s,b.y-G*2,s+G*4,b.y,s,b.y+G*2],K.splice(Ot+2,0,M),R.attr("path",K)),Ot+=2}}}}this.chart.lines.push(R),(this.chart.minXFromSymbols===void 0||this.chart.minXFromSymbols>C.x)&&(this.chart.minXFromSymbols=C.x)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&tt>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=tt)}}class Xe extends re{constructor(m,x={}){super(m,x),this.yes_annotation=x.yes_annotation,this.no_annotation=x.no_annotation,this.textMargin=this.getAttr("text-margin"),this.params=x.params||{};let{direction_yes:_,direction_no:T}=x;!T&&_==="right"?T="bottom":!_&&T==="bottom"&&(_="right"),this.yes_direction=_||"bottom",this.no_direction=T||"right",this.text.attr({x:this.textMargin*2});let k=this.text.getBBox().width+3*this.textMargin;k+=k/2;let g=this.text.getBBox().height+2*this.textMargin;g+=g/2,g=Math.max(k*.5,g);const h=k/4,a=g/4;this.text.attr({x:h+this.textMargin/2});const C={x:h,y:a},Q=[{x:h-k/4,y:a+g/4},{x:h-k/4+k/2,y:a+g/4+g/2},{x:h-k/4+k,y:a+g/4},{x:h-k/4+k/2,y:a+g/4-g/2},{x:h-k/4,y:a+g/4}],ot=ci(m,C,Q);ot.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),x.link&&ot.attr("href",x.link),x.target&&ot.attr("target",x.target),x.key&&(ot.node.id=x.key),ot.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:ot.getBBox().height/2}),this.group.push(ot),ot.insertBefore(this.text),this.initialize()}render(){this.yes_direction&&(this[`${this.yes_direction}_symbol`]=this.yes_symbol),this.no_direction&&(this[`${this.no_direction}_symbol`]=this.no_symbol);const m=this.getAttr("line-length");if(this.bottom_symbol){const x=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+m),this.bottom_symbol.setX(x.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){const x=this.getRight();if(!this.right_symbol.isPositioned){this.right_symbol.setY(x.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+m);const _=()=>{let T=!1,k;for(let g=0;g this.right_symbol.getCenter().y&&h<=this.right_symbol.width/2){T=!0;break}}if(T){if(this.right_symbol.symbolType==="end")return;this.right_symbol.setX(k.getX()+k.width+m),_()}};_(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}if(this.left_symbol){const x=this.getLeft();if(!this.left_symbol.isPositioned){this.left_symbol.setY(x.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+m));const _=()=>{let T=!1,k;for(let g=0;g this.left_symbol.getCenter().y&&h<=this.left_symbol.width/2){T=!0;break}}if(T){if(this.left_symbol.symbolType==="end")return;this.left_symbol.setX(k.getX()+k.width+m),_()}};_(),this.left_symbol.isPositioned=!0,this.left_symbol.render()}}}renderLines(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.yes_annotation||this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.no_annotation||this.getAttr("no-text"),this.no_direction)}}class Ai extends re{constructor(m,x={}){const _=m.paper.rect(0,0,0,0,20);super(m,{text:"End",...x},_)}}class Si extends re{constructor(m,x={}){super(m,x),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:this.textMargin*3});const _=this.text.getBBox().width+4*this.textMargin,T=this.text.getBBox().height+2*this.textMargin,k=this.textMargin,g=T/2,h={x:k,y:g},a=[{x:k-this.textMargin,y:T},{x:k-this.textMargin+_,y:T},{x:k-this.textMargin+_+2*this.textMargin,y:0},{x:k-this.textMargin+2*this.textMargin,y:0},{x:k,y:g}],C=ci(m,h,a);C.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),x.link&&C.attr("href",x.link),x.target&&C.attr("target",x.target),x.key&&(C.node.id=x.key),C.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:C.getBBox().height/2}),this.group.push(C),C.insertBefore(this.text),this.initialize()}getLeft(){const m=this.getY()+this.group.getBBox().height/2;return{x:this.getX()+this.textMargin,y:m}}getRight(){const m=this.getY()+this.group.getBBox().height/2;return{x:this.getX()+this.group.getBBox().width-this.textMargin,y:m}}}class Li extends re{constructor(m,x={}){const _=m.paper.rect(0,0,0,0,0);super(m,{text:"End",...x},_)}}class Ne extends re{constructor(m,x={}){const _=m.paper.rect(0,0,0,0);super(m,x,_),this.textMargin=this.getAttr("text-margin"),this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top",this.params=x.params||{},x.direction_next==="path1"&&!x[x.direction_next]&&x.next&&(x[x.direction_next]=x.next),x.direction_next==="path2"&&!x[x.direction_next]&&x.next&&(x[x.direction_next]=x.next),x.direction_next==="path3"&&!x[x.direction_next]&&x.next&&(x[x.direction_next]=x.next),x.path1&&x.direction_path1&&x.path2&&!x.direction_path2&&x.path3&&!x.direction_path3?x.direction_path1==="right"?(this.path2_direction="bottom",this.path1_direction="right",this.path3_direction="top"):x.direction_path1==="top"?(this.path2_direction="right",this.path1_direction="top",this.path3_direction="bottom"):x.direction_path1==="left"?(this.path2_direction="right",this.path1_direction="left",this.path3_direction="bottom"):(this.path2_direction="right",this.path1_direction="bottom",this.path3_direction="top"):x.path1&&!x.direction_path1&&x.path2&&x.direction_path2&&x.path3&&!x.direction_path3?x.direction_path2==="right"?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top"):x.direction_path2==="left"?(this.path1_direction="bottom",this.path2_direction="left",this.path3_direction="right"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):x.path1&&!x.direction_path1&&x.path2&&!x.direction_path2&&x.path3&&x.direction_path3?x.direction_path2==="right"?(this.path1_direction="bottom",this.path2_direction="top",this.path3_direction="right"):x.direction_path2==="left"?(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=x.direction_path1,this.path2_direction=x.direction_path2,this.path3_direction=x.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()}render(){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);const m=this.getAttr("line-length");if(this.bottom_symbol){const x=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+m),this.bottom_symbol.setX(x.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.top_symbol){const x=this.getTop();this.top_symbol.isPositioned||(this.top_symbol.shiftY(this.getY()-this.top_symbol.height-m),this.top_symbol.setX(x.x+this.top_symbol.width),this.top_symbol.isPositioned=!0,this.top_symbol.render())}if(this.left_symbol){const x=this.getLeft();if(!this.left_symbol.isPositioned){this.left_symbol.setY(x.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+m));const _=()=>{let T=!1,k;for(let g=0;g this.left_symbol.getCenter().y&&h<=this.left_symbol.width/2){T=!0;break}}if(T){if(this.left_symbol.symbolType==="end")return;this.left_symbol.setX(k.getX()+k.width+m),_()}};_(),this.left_symbol.isPositioned=!0,this.left_symbol.render()}}if(this.right_symbol){const x=this.getRight();if(!this.right_symbol.isPositioned){this.right_symbol.setY(x.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+m);const _=()=>{let T=!1,k;for(let g=0;g this.right_symbol.getCenter().y&&h<=this.right_symbol.width/2){T=!0;break}}if(T){if(this.right_symbol.symbolType==="end")return;this.right_symbol.setX(k.getX()+k.width+m),_()}};_(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}}renderLines(){this.path1_symbol&&this.drawLineTo(this.path1_symbol,"",this.path1_direction),this.path2_symbol&&this.drawLineTo(this.path2_symbol,"",this.path2_direction),this.path3_symbol&&this.drawLineTo(this.path3_symbol,"",this.path3_direction)}}class Oi extends re{constructor(m,x={}){const _=m.paper.rect(0,0,0,0,20);x.text=x.text||"Start",super(m,x,_)}}class Mi extends re{constructor(m,x={}){const _=m.paper.rect(0,0,0,0);super(m,x,_),_.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});const T=m.paper.rect(0,0,0,0);T.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")}),x.key&&(T.node.id=x.key+"i");const k=this.getAttr("font"),g=this.getAttr("font-family"),h=this.getAttr("font-weight");k&&T.attr({font:k}),g&&T.attr({"font-family":g}),h&&T.attr({"font-weight":h}),x.link&&T.attr("href",x.link),x.target&&T.attr("target",x.target),this.group.push(T),T.insertBefore(this.text),this.initialize()}}const Fe=(j,...m)=>{if(m.length===0)return j;const x=m.shift();return Object.keys(x).forEach(_=>{typeof j[_]=="object"&&!Array.isArray(j[_])&&typeof x[_]=="object"&&!Array.isArray(x[_])?Fe(j[_],x[_]):typeof x[_]=="object"?Array.isArray(x[_])?j[_]=[...x[_]]:j[_]={...x[_]}:j[_]=x[_]}),Fe(j,...m)};class Pi{constructor(m,x){this.symbols=[],this.lines=[],this.start=null,this.minXFromSymbols=0,this.maxXFromLine=0,this.paper=new ki(m),this.options=Fe(x,Bi)}handle(m){return this.symbols.indexOf(m)<=-1&&this.symbols.push(m),m instanceof Xe?(m.yes=x=>(m.yes_symbol=x,m.no_symbol&&(m.pathOk=!0),this.handle(x)),m.no=x=>(m.no_symbol=x,m.yes_symbol&&(m.pathOk=!0),this.handle(x))):m instanceof Ne?(m.path1=x=>(m.path1_symbol=x,m.path2_symbol&&(m.pathOk=!0),this.handle(x)),m.path2=x=>(m.path2_symbol=x,m.path3_symbol&&(m.pathOk=!0),this.handle(x)),m.path3=x=>(m.path3_symbol=x,m.path1_symbol&&(m.pathOk=!0),this.handle(x))):m.then=x=>(m.next=x,m.pathOk=!0,this.handle(x)),m}startWith(m){return this.start=m,this.handle(m)}render(){let m=0,x=0,_=0,T=0,k=0,g=0,h;this.symbols.forEach(W=>{W.width>m&&(m=W.width),W.height>x&&(x=W.height)}),this.symbols.forEach(W=>{W.shiftX(this.options.x+(m-W.width)/2+this.options["line-width"]),W.shiftY(this.options.y+(x-W.height)/2+this.options["line-width"])}),this.start.render(),this.symbols.forEach(W=>{W.renderLines()}),_=this.maxXFromLine;let a,C;this.symbols.forEach(W=>{const V=W.getX();a=V+W.width,C=W.getY()+W.height,V _&&(_=a),C>T&&(T=C)});for(let W=0;W _&&(_=V),wt>T&&(T=wt)}const Q=this.options.scale,ot=this.options["line-width"];this.minXFromSymbols ({symbols:{},start:null,diagram:null,draw(j,m={}){this.diagram&&this.diagram.clean();const x=new Pi(j,m);this.diagram=x;const _={},T=g=>{if(_[g.key])return _[g.key];switch(g.symbolType){case"start":_[g.key]=new Oi(x,g);break;case"end":_[g.key]=new Ai(x,g);break;case"operation":_[g.key]=new Li(x,g);break;case"inputoutput":_[g.key]=new Si(x,g);break;case"subroutine":_[g.key]=new Mi(x,g);break;case"condition":_[g.key]=new Xe(x,g);break;case"parallel":_[g.key]=new Ne(x,g);break;default:throw new Error(`Unknown symbol type ${g.symbolType}!`)}return _[g.key]},k=(g,h,a)=>{const C=T(g);return this.start===g?x.startWith(C):h&&a&&!h.pathOk&&(h instanceof Xe?(a.yes===g&&h.yes(C),a.no===g&&h.no(C)):h instanceof Ne?(a.path1===g&&h.path1(C),a.path2===g&&h.path2(C),a.path3===g&&h.path3(C)):h.then(C)),C.pathOk||(C instanceof Xe?(g.yes&&k(g.yes,C,g),g.no&&k(g.no,C,g)):C instanceof Ne?(g.path1&&k(g.path1,C,g),g.path2&&k(g.path2,C,g),g.path3&&k(g.path3,C,g)):g.next&&k(g.next,C,g)),C};k(this.start),x.render()},clean(){var j;(j=this.diagram)==null||j.clean()},options(){var j;return((j=this.diagram)==null?void 0:j.options)||{}}}),Xi=j=>{const m=[];let x=0;for(let _=1,{length:T}=j;_ ")<0&&k.indexOf("=>")<0&&k.indexOf("@>")<0?(m[_-1]+=` ${k}`,m.splice(_,1),T--):_++}return m},Ni=j=>{const m=j.indexOf("(")+1,x=j.indexOf(")");return m>=0&&x>=0?j.substring(m,x):"{}"},Ti=j=>{const m=j.indexOf("(")+1,x=j.indexOf(")");return m>=0&&x>=0?j.substring(m,x):""},Ee=(j,m)=>{const x=j.indexOf("(")+1,_=j.indexOf(")");return x>=0&&_>=0?m.symbols[j.substring(0,x-1)]:m.symbols[j]},$i=j=>{const m=j.indexOf("(")+1,x=j.indexOf(")");let _=j.substring(m,x);_.indexOf(",")>0&&(_=_.substring(0,_.indexOf(",")));const T=_.split("@");return T.length>1&&m>=0&&x>=0?T[1]:""},qi=(j="")=>{const m=Ei(),x=Xi(j.trim());for(;x.length>0;){let T=x.splice(0,1)[0].trim();if(T.indexOf("=>")>=0){const k=T.split("=>"),g={key:k[0].replace(/\(.*\)/,""),symbolType:k[1],text:null,link:null,target:null,flowstate:null,function:null,lineStyle:{},params:{}},h=k[0].match(/\((.*)\)/);if(h&&h.length>1){const a=h[1].split(",");for(let C=0;C =0&&(_=g.symbolType.split(": "),g.symbolType=_.shift(),g.text=_.join(": ")),g.text&&g.text.indexOf(":$")>=0?(_=g.text.split(":$"),g.text=_.shift(),g.function=_.join(":$")):g.symbolType.indexOf(":$")>=0?(_=g.symbolType.split(":$"),g.symbolType=_.shift(),g.function=_.join(":$")):g.text&&g.text.indexOf(":>")>=0?(_=g.text.split(":>"),g.text=_.shift(),g.link=_.join(":>")):g.symbolType.indexOf(":>")>=0&&(_=g.symbolType.split(":>"),g.symbolType=_.shift(),g.link=_.join(":>")),g.symbolType.indexOf(` `)>=0&&(g.symbolType=g.symbolType.split(` `)[0]),g.link){const a=g.link.indexOf("[")+1,C=g.link.indexOf("]");a>=0&&C>=0&&(g.target=g.link.substring(a,C),g.link=g.link.substring(0,a-1))}if(g.text&&g.text.indexOf("|")>=0){const a=g.text.split("|");g.flowstate=a.pop().trim(),g.text=a.join("|")}m.symbols[g.key]=g}else if(T.indexOf("->")>=0){let k=$i(T);k&&(T=T.replace("@"+k,""));const g=T.split("->");for(let h=0,a=g.length;h{let V="next";const wt=W.indexOf("(")+1,St=W.indexOf(")");return wt>=0&&St>=0&&(V=C.substring(wt,St),V.indexOf(",")<0&&V!=="yes"&&V!=="no"&&(V=`next, ${V}`)),V})(C);const E=Ee(C,m);let vt=null;if(ot.indexOf(",")>=0){const W=ot.split(",");ot=W[0],vt=W[1].trim()}if(k&&(ot=="yes"||ot=="true"?E.yes_annotation=k:E.no_annotation=k,k=null),m.start||(m.start=E),h+1")>=0){const k=T.split("@>");for(let g=0,h=k.length;g