UNPKG

@syncfusion/ej2-diagrams

Version:

Feature-rich diagram control to create diagrams like flow charts, organizational charts, mind maps, and BPMN diagrams. Its rich feature set includes built-in shapes, editing, serializing, exporting, printing, overview, data binding, and automatic layouts.

10 lines 1.55 MB
/*! * filename: ej2-diagrams.umd.min.js * version : 32.1.21 * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-navigations")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-data","@syncfusion/ej2-navigations"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Popups,t.ej2Data,t.ej2Navigations)}(this,function(Q,V,y,v,b){"use strict";S.prototype.isEmpty=function(){return 0===this.height&&0===this.width},S.prototype.clone=function(){return new S(this.width,this.height)};var U=S;function S(t,e){this.width=t,this.height=e}w=function(t,e){return(w=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var w,x,t=function(t,e){function i(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},I=function(t,e,i,n){var r,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;0<=s;s--)(r=t[s])&&(a=(o<3?r(a):3<o?r(e,i,a):r(e,i))||a);return 3<o&&a&&Object.defineProperty(e,i,a),a},K=(x=V.ChildProperty,t(C,x),C.equals=function(t,e){return t===e||!(!t||!e||t&&e&&(t.x!==e.x||t.y!==e.y))},C.isEmptyPoint=function(t){return!t.x||!t.y},C.transform=function(t,e,i){var n={x:0,y:0};return n.x=Math.round(100*(t.x+i*Math.cos(e*Math.PI/180)))/100,n.y=Math.round(100*(t.y+i*Math.sin(e*Math.PI/180)))/100,n},C.findLength=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},C.findAngle=function(t,e){e=180*(e=Math.atan2(e.y-t.y,e.x-t.x))/Math.PI;return(e%=360)<0&&(e+=360),e},C.distancePoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},C.getLengthFromListOfPoints=function(t){for(var e=0,i=0;i<t.length-1;i++)e+=this.distancePoints(t[parseInt(i.toString(),10)],t[i+1]);return e},C.adjustPoint=function(t,e,i,n){var r,o=i?{x:t.x,y:t.y}:{x:e.x,y:e.y};return t.x===e.x?t.y<e.y&&i||t.y>e.y&&!i?o.y+=n:o.y-=n:t.y===e.y?t.x<e.x&&i||t.x>e.x&&!i?o.x+=n:o.x-=n:o=i?(r=this.findAngle(t,e),this.transform(t,r,n)):(r=this.findAngle(e,t),this.transform(e,r,n)),o},C.direction=function(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?t.x<e.x?"Right":"Left":t.y<e.y?"Bottom":"Top"},C.prototype.getClassName=function(){return"Point"},I([V.Property(0)],C.prototype,"x",void 0),I([V.Property(0)],C.prototype,"y",void 0),C);function C(){return null!==x&&x.apply(this,arguments)||this}function A(t){var e,i=[],n=T(t);if(0<n.length)for(var r=0;r<n.length;r++){var o=n[parseInt(r.toString(),10)],a="";switch((a=o[0]).toLowerCase()){case"m":for(e=1;e<o.length;e++)i.push({command:a,x:o[parseInt(e.toString(),10)],y:o[e+1]}),e+=1,"m"===a?a="l":"M"===a&&(a="L");break;case"l":case"t":for(e=1;e<o.length;e++)i.push({command:a,x:o[parseInt(e.toString(),10)],y:o[e+1]}),e+=1;break;case"h":for(e=1;e<o.length;e++)i.push({command:a,x:o[parseInt(e.toString(),10)]});break;case"v":for(e=1;e<o.length;e++)i.push({command:a,y:o[parseInt(e.toString(),10)]});break;case"z":i.push({command:a});break;case"c":for(e=1;e<o.length;e++)i.push({command:a,x1:o[parseInt(e.toString(),10)],y1:o[e+1],x2:o[e+2],y2:o[e+3],x:o[e+4],y:o[e+5]}),e+=5;break;case"s":for(e=1;e<o.length;e++)i.push({command:a,x2:o[parseInt(e.toString(),10)],y2:o[e+1],x:o[e+2],y:o[e+3]}),e+=3;break;case"q":for(e=1;e<o.length;e++)i.push({command:a,x1:o[parseInt(e.toString(),10)],y1:o[e+1],x:o[e+2],y:o[e+3]}),e+=3;break;case"a":for(e=1;e<o.length;e++)i.push({command:a,r1:o[parseInt(e.toString(),10)],r2:o[e+1],angle:o[e+2],largeArc:o[e+3],sweep:o[e+4],x:o[e+5],y:o[e+6]}),e+=6}}return i}function T(t){for(var e=/([a-z]+)|([+-]?(?:\d+\.?\d*|\.\d+))/gi,i=[],n=[],r={},o=(e.lastIndex=0,!1),r=e.exec(t);r;)o="e"===r[1]||(r[1]?i="zm"===r[1].toLowerCase()?(i.length&&n.push(i),n.push(["Z"]),[r[1].substring(1,2)]):(i.length&&n.push(i),[r[1]]):(i.length||(i=[]),o||i.push(Number(r[2]))),!1),r=e.exec(t);return i.length&&n.push(i),n}function O(t,e,i){for(var n,r="",o=[{x:0+t,y:0},{x:0+i-t,y:0},{x:0+i,y:0+t},{x:0+i,y:0+e-t},{x:0+i-t,y:0+e},{x:0+t,y:0+e},{x:0,y:0+e-t},{x:0,y:0+t}],a=[{x:0+i,y:0},{x:0+i,y:0+e},{x:0,y:0+e},{x:0,y:0}],s=0,r="M"+o[0].x+" "+o[0].y,h=0;h<o.length;h+=2)r+="L"+(n=o[h+1]).x+" "+n.y,n=o[h+2]||o[0],r+="Q"+a[parseInt(s.toString(),10)].x+" "+a[parseInt(s.toString(),10)].y+" "+n.x+" "+n.y,s++;return r}function L(t){for(var e,i="",i="M"+t[0].x+" "+t[0].y,n=1;n<t.length;n++)i+="L"+(e=t[parseInt(n.toString(),10)]).x+" "+e.y;return i+="Z"}function E(t){for(var e=0;e<t.length;e++)t[parseInt(e.toString(),10)].x=Math.round(t[parseInt(e.toString(),10)].x),t[parseInt(e.toString(),10)].y=Math.round(t[parseInt(e.toString(),10)].y);for(var i,n="",n="M"+t[0].x+" "+t[0].y,r=1;r<t.length;r++)n+="L"+(i=t[parseInt(r.toString(),10)]).x+" "+i.y;return n}function z(t){for(var e,i,n,r,o,a,s=[],h=0,d=0,l=0,c=t.length;l<c;++l){var p,g,u=t[l],m=u.command,f=("y1"in u&&(r=u.y1),"y2"in u&&(a=u.y2),"x1"in u&&(n=u.x1),"x2"in u&&(o=u.x2),"x"in u&&(h=u.x),"y"in u&&(d=u.y),s[s.length-1]);switch(m){case"M":s.push({command:"M",x:h,y:d});break;case"L":s.push({command:"L",x0:e,y0:i,x:h,y:d});break;case"H":s.push({command:"L",x0:e,y0:i,x:h,y:i});break;case"V":s.push({command:"L",x0:e,y0:i,x:e,y:d});break;case"C":s.push({command:"C",x0:e,y0:i,x1:n,y1:r,x2:o,y2:a,x:h,y:d});break;case"S":f&&(p=void 0,g={x:2*e-(p="C"===f.command||"S"===f.command?{x:f.x2,y:f.y2}:{x:e,y:i}).x,y:2*i-p.y},s.push({command:"C",x0:e,y0:i,x1:g.x,y1:g.y,x2:o,y2:a,x:h,y:d}));break;case"Q":s.push({command:"Q",x0:e,y0:i,x1:n,y1:r,x:h,y:d});break;case"T":f&&(p=void 0,g={x:2*e-(p="Q"===f.command?{x:f.x1,y:f.y1}:{x:e,y:i}).x,y:2*i-p.y},s.push({command:"Q",x0:e,y0:i,x1:g.x,y1:g.y,x:h,y:d}));break;case"A":var y=u;y.command="A",s.push(y);break;case"Z":case"z":s.push({command:"Z"}),h=e,d=i}e=h,i=d}return s}function j(t,e,i,n,r,o,a,s){for(var h,d,l,c,p=0,g=0,u=0,m=t.length;u<m;++u){var f=t[u],y=f.command;"x"in f&&(p=f.x),"y"in f&&(g=f.y),"y1"in f&&(d=f.y1),"y2"in f&&(c=f.y2),"x1"in f&&(h=f.x1),"x2"in f&&(l=f.x2),n?(void 0!==p&&(p=F(p,e,r,a)),void 0!==g&&(g=F(g,i,o,s)),void 0!==h&&(h=F(h,e,r,a)),void 0!==d&&(d=F(d,i,o,s)),void 0!==l&&(l=F(l,e,r,a)),void 0!==c&&(c=F(c,i,o,s))):(void 0!==p&&(p=Number((p+e).toFixed(2))),void 0!==g&&(g=Number((g+i).toFixed(2))),void 0!==h&&(h=Number((h+e).toFixed(2))),void 0!==d&&(d=Number((d+i).toFixed(2))),void 0!==l&&(l=Number((l+e).toFixed(2))),void 0!==c&&(c=Number((c+i).toFixed(2)))),(y=H(f,y,{x:p,y:g,x1:h,y1:d,x2:l,y2:c,r1:f.r1,r2:f.r2},n,e,i))&&(t[u]=y)}return tt(t)}function H(t,e,i,n,r,o){switch(e){case"M":case"L":t.x=i.x,t.y=i.y;break;case"H":t.x=i.x;break;case"V":t.y=i.y;break;case"C":t.x=i.x,t.y=i.y,t.x1=i.x1,t.y1=i.y1,t.x2=i.x2,t.y2=i.y2;break;case"S":t.x=i.x,t.y=i.y,t.x2=i.x2,t.y2=i.y2;break;case"Q":t.x=i.x,t.y=i.y,t.x1=i.x1,t.y1=i.y1;break;case"T":t.x=i.x,t.y=i.y;break;case"A":var a=i.r1,s=i.r2;n&&(i.r1=a*=r,i.r2=s*=o),t.x=i.x,t.y=i.y,t.r1=i.r1,t.r2=i.r2;break;case"z":case"Z":t={command:"Z"}}return t}function F(t,e,i,n){return t!==i?t=n!==i?t*e-(Number(i)*e-Number(i))+(n-Number(i)):Number(t)*e-(Number(i)*e-Number(i)):n!==i&&(t=n),Number(t.toFixed(2))}function Y(t){for(var e,i,n,r,o,a,s=0,h=0,d=0,l=t.length;d<l;++d){var c=t[parseInt(d.toString(),10)],p=c.command;if(/[MLHVCSQTA]/.test(p))"x"in c&&(c.x=s=c.x),"y"in c&&(c.y=h=c.y);else{"x1"in c&&(c.x1=n=s+c.x1),"x2"in c&&(c.x2=o=s+c.x2),"y1"in c&&(c.y1=r=h+c.y1),"y2"in c&&(c.y2=a=h+c.y2),"x"in c&&(c.x=s+=c.x),"y"in c&&(c.y=h+=c.y);var g=void 0;switch(p){case"m":case"M":g={command:"M",x:s,y:h};break;case"l":case"L":g={command:"L",x:s,y:h};break;case"h":case"H":g={command:"H",x:s};break;case"v":case"V":g={command:"V",y:h};break;case"c":case"C":g={command:"C",x:s,y:h,x1:n,y1:r,x2:o,y2:a};break;case"s":case"S":g={command:"S",x:s,y:h,x2:o,y2:a};break;case"q":case"Q":g={command:"Q",x:s,y:h,x1:n,y1:r};break;case"t":case"T":g={command:"T",x:s,y:h};break;case"a":case"A":(g={command:"A",x:s,y:h}).r1=c.r1,g.r2=c.r2,g.angle=c.angle,g.largeArc=c.largeArc,g.sweep=c.sweep;break;case"z":case"Z":g={command:"Z"},s=e,h=i,g=t[parseInt(d.toString(),10)]}g&&(t[parseInt(d.toString(),10)]=g)}"M"!==p&&"m"!==p||(e=s,i=h)}return t}function tt(t){for(var e="",i=0;i<t.length;i++)e+=0===i?et(t[parseInt(i.toString(),10)]):" "+et(t[parseInt(i.toString(),10)]);return e}function et(t){var e="";switch(t.command){case"Z":case"z":e=t.command;break;case"M":case"m":case"L":case"l":e=t.command+" "+t.x+" "+t.y;break;case"C":case"c":e=t.command+" "+t.x1+" "+t.y1+" "+t.x2+" "+t.y2+" "+t.x+" "+t.y;break;case"Q":case"q":e=t.command+" "+t.x1+" "+t.y1+" "+t.x+" "+t.y;break;case"A":case"a":var i=t.command,n=t.angle,r=t.largeArc?"1":"0",o=t.sweep?"1":"0",e=i+" "+t.r1+" "+t.r2+" "+n+" "+r+" "+o+" "+t.x+" "+t.y;break;case"H":case"h":e=t.command+" "+t.x;break;case"V":case"v":e=t.command+" "+t.y;break;case"S":case"s":e=t.command+" "+t.x2+" "+t.y2+" "+t.x+" "+t.y;break;case"T":case"t":e=t.command+" "+t.x+" "+t.y}return e}Object.defineProperty(it.prototype,"left",{get:function(){return this.x},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"right",{get:function(){return this.x+this.width},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"top",{get:function(){return this.y},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"topLeft",{get:function(){return{x:this.left,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"topRight",{get:function(){return{x:this.right,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"bottomLeft",{get:function(){return{x:this.left,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"bottomRight",{get:function(){return{x:this.right,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"middleLeft",{get:function(){return{x:this.left,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"middleRight",{get:function(){return{x:this.right,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"topCenter",{get:function(){return{x:this.x+this.width/2,y:this.top}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"bottomCenter",{get:function(){return{x:this.x+this.width/2,y:this.bottom}},enumerable:!0,configurable:!0}),Object.defineProperty(it.prototype,"center",{get:function(){return{x:this.x+this.width/2,y:this.y+this.height/2}},enumerable:!0,configurable:!0}),it.prototype.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},it.prototype.uniteRect=function(t){var e=Math.max((isNaN(this.right)||this.x===Number.MAX_VALUE?t:this).right,t.right),i=Math.max((isNaN(this.bottom)||this.y===Number.MAX_VALUE?t:this).bottom,t.bottom);return this.x=Math.min(this.left,t.left),this.y=Math.min(this.top,t.top),this.width=e-this.x,this.height=i-this.y,this},it.prototype.unitePoint=function(t){var e,i,n;this.x===Number.MAX_VALUE?(this.x=t.x,this.y=t.y):(e=Math.min(this.left,t.x),i=Math.min(this.top,t.y),n=Math.max(this.right,t.x),t=Math.max(this.bottom,t.y),this.x=e,this.y=i,this.width=n-this.x,this.height=t-this.y)},it.prototype.Inflate=function(t){return this.x-=t,this.y-=t,this.width+=2*t,this.height+=2*t,this},it.prototype.intersects=function(t){return!(this.right<t.left||this.left>t.right||this.top>t.bottom||this.bottom<t.top)},it.prototype.containsRect=function(t){return this.left<=t.left&&this.right>=t.right&&this.top<=t.top&&this.bottom>=t.bottom},it.prototype.containsPoint=function(t,e){return this.left-(e=void 0===e?0:e)<=t.x&&this.right+e>=t.x&&this.top-e<=t.y&&this.bottom+e>=t.y},it.toBounds=function(t){for(var e=new it,i=0,n=t;i<n.length;i++){var r=n[i];e.unitePoint(r)}return e},it.empty=new it(Number.MAX_VALUE,Number.MIN_VALUE,0,0);var B=it;function it(t,e,i,n){this.x=Number.MAX_VALUE,this.y=Number.MAX_VALUE,this.width=0,void(this.height=0)===t||void 0===e?(t=e=Number.MAX_VALUE,i=n=0):(void 0===i&&(i=0),void 0===n&&(n=0)),this.x=t,this.y=e,this.width=i,this.height=n}(t=Q.MatrixTypes||(Q.MatrixTypes={}))[t.Identity=0]="Identity",t[t.Translation=1]="Translation",t[t.Scaling=2]="Scaling",t[t.Unknown=4]="Unknown";var nt=function(t,e,i,n,r,o,a){this.m11=t,this.m12=e,this.m21=i,this.m22=n,this.offsetX=r,this.offsetY=o,this.type=a};function k(){return new nt(1,0,0,1,0,0,Q.MatrixTypes.Identity)}function N(t,e){t=function(t,e,i){{var n,r;i=t.type===(Q.MatrixTypes.Translation|Q.MatrixTypes.Scaling)?(e=(e*=t.m11)+t.offsetX,(i*=t.m22)+t.offsetY):(n=i*t.m21+t.offsetX,r=e*t.m12+t.offsetY,e=(e*=t.m11)+n,(i*=t.m22)+r)}return{x:e,y:i}}(t,e.x,e.y);return{x:Math.round(100*t.x)/100,y:Math.round(100*t.y)/100}}function rt(t,e){for(var i=[],n=0,r=e;n<r.length;n++){var o=r[n];i.push(N(t,o))}return i}function ot(t,e,i,n){var r,o;ht(t,(t=.017453292519943295*(e%=360),e=i||0,i=n||0,n=k(),r=Math.sin(t),t=Math.cos(t),o=e*(1-t)+i*r,i=i*(1-t)-e*r,n.type=Q.MatrixTypes.Unknown,dt(n,t,r,-r,t,o,i),n))}function at(t,e,i,n,r){ht(t,(t=e,e=i,i=n=void 0===n?0:n,n=r=void 0===r?0:r,(r=k()).type=i||n?Q.MatrixTypes.Scaling|Q.MatrixTypes.Translation:Q.MatrixTypes.Scaling,dt(r,t,0,0,e,i-t*i,n-e*n),r))}function st(t,e,i){t.offsetX+=e,t.offsetY+=i,t.type|=Q.MatrixTypes.Translation}function ht(t,e){var i=t.type,n=e.type;if(i===Q.MatrixTypes.Identity)lt(t,e),t.type=e.type;else if(i!==Q.MatrixTypes.Translation){var r=i<<4|n;switch(r){case 50:return t.m11*=e.m11,t.m22*=e.m22,t.offsetX*=e.m11,void(t.offsetY*=e.m22);case 51:return t.m11*=e.m11,t.m22*=e.m22,t.offsetX=e.m11*t.offsetX+e.offsetX,void(t.offsetY=e.m22*t.offsetY+e.offsetY);case 52:break;default:switch(r){case 66:case 67:case 68:break;default:return}}i=k();dt(i,t.m11*e.m11+t.m12*e.m21,t.m11*e.m12+t.m12*e.m22,t.m21*e.m11+t.m22*e.m21,t.m21*e.m12+t.m22*e.m22,t.offsetX*e.m11+t.offsetY*e.m21+e.offsetX,t.offsetX*e.m12+t.offsetY*e.m22+e.offsetY),i.m21||i.m12?i.type=Q.MatrixTypes.Unknown:((i.m11&&1!==i.m11||i.m22&&1!==i.m22)&&(i.type=Q.MatrixTypes.Scaling),(i.offsetX||i.offsetY)&&(i.type|=Q.MatrixTypes.Translation),(i.type&(Q.MatrixTypes.Translation|Q.MatrixTypes.Scaling))===Q.MatrixTypes.Identity&&(i.type=Q.MatrixTypes.Identity),i.type=Q.MatrixTypes.Scaling|Q.MatrixTypes.Translation),lt(t,i),t.type=i.type}else{var i=t.offsetX,o=t.offsetY;t.offsetX=i*e.m11+o*e.m21+e.offsetX,t.offsetY=i*e.m12+o*e.m22+e.offsetY,n===Q.MatrixTypes.Unknown?t.type=Q.MatrixTypes.Unknown:t.type=Q.MatrixTypes.Translation|Q.MatrixTypes.Scaling}}function dt(t,e,i,n,r,o,a){t.m11=e,t.m12=i,t.m21=n,t.m22=r,t.offsetX=o,t.offsetY=a}function lt(t,e){t.m11=e.m11,t.m12=e.m12,t.m21=e.m21,t.m22=e.m22,t.offsetX=e.offsetX,t.offsetY=e.offsetY,t.type=e.type}function Z(){for(var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="",n=0;n<5;n++)"undefined"!=typeof window&&"crypto"in window&&"getRandomValues"in crypto&&(t=new Uint32Array(1),t=(window.msCrypto||window.crypto).getRandomValues(t)[0]%(e.length-1)),0===n&&t<10?n--:i+=e.substring(t,t+1);return i}function ct(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?V.compile(document.querySelector(e).innerHTML.trim()):V.compile(e)}catch(t){return V.compile(e)}}function pt(t){new B;var e=t.offsetY-t.actualSize.height*t.pivot.y,i=t.offsetY+t.actualSize.height*(1-t.pivot.y),n=t.offsetX-t.actualSize.width*t.pivot.x,t=t.offsetX+t.actualSize.width*(1-t.pivot.x);return B.toBounds([{x:n,y:e},{x:t,y:e},{x:n,y:i},{x:t,y:i}])}function gt(t){new B;var e,i=pt(t),n=i.middleLeft,r=i.topCenter,o=i.bottomCenter,a=i.middleRight,s=i.topLeft,h=i.topRight,d=i.bottomLeft,i=i.bottomRight;return t.corners={topLeft:s,topCenter:r,topRight:h,middleLeft:n,middleRight:a,bottomLeft:d,bottomCenter:o,bottomRight:i},0===t.rotateAngle&&0===t.parentTransform||(ot(e=k(),t.rotateAngle+t.parentTransform,t.offsetX,t.offsetY),t.corners.topLeft=s=N(e,s),t.corners.topCenter=N(e,r),t.corners.topRight=h=N(e,h),t.corners.middleLeft=N(e,n),t.corners.middleRight=N(e,a),t.corners.bottomLeft=d=N(e,d),t.corners.bottomCenter=N(e,o),t.corners.bottomRight=i=N(e,i)),r=B.toBounds([s,h,d,i]),t.corners.left=r.left,t.corners.right=r.right,t.corners.top=r.top,t.corners.bottom=r.bottom,t.corners.center=r.center,t.corners.width=r.width,t.corners.height=r.height,r}function J(t,e,i,n){var r={},o="properties";if(t){i=t.propName;for(var a=t[o]||t,s=[],h=[],d=((s=s.concat(Object.keys(a))).push("version"),i&&(h=(a=Tt(e))?a(i):[],s=s.concat(h)),ut(i)),l=0,c=s=s.concat(d);l<c.length;l++){var p=c[l];"historyManager"!==p&&("wrapper"!==p?t[""+p]&&t.hasOwnProperty("observers")||(t[""+p]instanceof Array?r[""+p]=mt((-1===d.indexOf(p)&&t[o]?t[o]:t)[""+p],e):t[""+p]instanceof Array==!1&&t[""+p]instanceof HTMLElement?r[""+p]=t[""+p].cloneNode(!0).innerHTML:t[""+p]instanceof Array==!1&&t[""+p]instanceof Object?r[""+p]=J((-1===d.indexOf(p)&&t[o]?t[o]:t)[""+p],void 0):r[""+p]=t[""+p]):t[""+p]&&(r[""+p]={actualSize:{width:t[""+p].actualSize.width,height:t[""+p].actualSize.height},offsetX:t[""+p].offsetX,offsetY:t[""+p].offsetY}))}}return r}function ut(t){switch(t){case"nodes":case"children":return["inEdges","outEdges","parentId","processId","nodeId","umlIndex","isPhase","isLane"];case"connectors":return["parentId"];case"annotation":case"annotations":return["nodeId"];case"shape":return["hasHeader"];case"layers":return["objectZIndex"]}return[]}function mt(t,e,i,n){if(t)for(var r=[],o=0;o<t.length;o++)!(t[parseInt(o.toString(),10)]instanceof Array)&&t[parseInt(o.toString(),10)]instanceof Object?r.push(J(t[parseInt(o.toString(),10)],e)):r.push(t[parseInt(o.toString(),10)]);return r}function ft(t,e){var i="properties";if(t){e=e||{properties:{}};for(var n=0,r=Object.keys(t);n<r.length;n++){var o,a=r[n];t[""+a]instanceof Array?(o=yt(t[""+a],e[i][""+a]),e[i][""+a]&&e[i][""+a].length||(e[""+a]=o)):t[""+a]instanceof Array==!1&&t[""+a]instanceof HTMLElement?e[""+a]=t[""+a].cloneNode(!0).innerHtml:t[""+a]instanceof Array==!1&&t[""+a]instanceof Object?((o=ft(t[""+a],e[i][""+a]))[i]&&!Object.keys(o[i]).length&&delete o[i],e[""+a]=o):e[""+a]=(void 0!==e[i][""+a]?e:t)[""+a]}}return e}function yt(t,e){var i=[],n=!1;(e=e||[]).length||(n=!0);for(var r,o=0;o<t.length;o++)t[parseInt(o.toString(),10)]instanceof Array?(yt(t[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]),n&&i.push(yt)):t[parseInt(o.toString(),10)]instanceof Object?(r=ft(t[parseInt(o.toString(),10)],e[parseInt(o.toString(),10)]),n&&i.push(r)):i.push(t[parseInt(o.toString(),10)]);return i}function vt(t){var e="";switch(t){case"Center":e="center";break;case"Left":e="left";break;case"Right":e="right";break;case"Justify":e="justify"}return e}function bt(t){var e="";switch(t){case"Wrap":e="breakall";break;case"NoWrap":e="keepall";break;case"WrapWithOverflow":e="normal";break;case"LineThrough":e="line-through"}return e}var St=document.createElement("canvas").getContext("2d");function wt(t,e){return St.font=(e.bold?"bold":"normal")+" "+e.fontSize+"px "+e.fontFamily,St.measureText(t).width}function xt(t,e){return(t+e)/2}function It(t,e){for(var i=0,n=0,r=0,o="",a=t.length,s=0;0<r&&(i=n),n=Math.floor(xt(i,a)),(r=wt(o+=t.substr(i,n),e))<=e.width;);for(o=o.substr(0,i),s=i;s<a;s++)if((r=wt(o+=t[parseInt(s.toString(),10)],e))>=e.width){t=t.substr(0,o.length-1);break}return"Ellipsis"===e.textOverflow?(t=t.substr(0,t.length-3),t+="..."):t=t.substr(0,t.length),t}function Ct(t,e){if("NoWrap"===e&&"PreserveAll"===t)return"pre";var i="";switch(t){case"CollapseAll":i="nowrap";break;case"CollapseSpace":i="pre-line";break;case"PreserveAll":i="pre-wrap"}return i}function Pt(t,e){var i=k(),e=(ot(i,e,0,0),N(i,{x:0,y:0})),n=N(i,{x:t.width,y:0}),r=N(i,{x:0,y:t.height}),i=N(i,{x:t.width,y:t.height}),t=Math.min(e.x,n.x,r.x,i.x),o=Math.min(e.y,n.y,r.y,i.y),a=Math.max(e.x,n.x,r.x,i.x),e=Math.max(e.y,n.y,r.y,i.y);return new U(a-t,e-o)}function Dt(t,e,i,n){var r;return 0!==t?(ot(r=k(),t,e,i),N(r,n)):n}function At(t,e){return{x:t.x+e.desiredSize.width*e.pivot.x,y:t.y+e.desiredSize.height*e.pivot.y}}function Tt(t){return t=void 0!==t&&"string"==typeof t?V.getValue(t,window):t}function Ot(t){if(t)switch(t.type){case"Linear":return Zt;case"Radial":return Qt;default:return Zt}return Zt}Mt=function(t,e){return(Mt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Mt,Lt,I=function(t,e){function i(){this.constructor=t}Mt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,n){var r,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;0<=s;s--)(r=t[s])&&(a=(o<3?r(a):3<o?r(e,i,a):r(e,i))||a);return 3<o&&a&&Object.defineProperty(e,i,a),a},Et=function(t,e,i,n){this.left=t,this.right=e,this.top=i,this.bottom=n},zt=(Lt=V.ChildProperty,I(kt,Lt),t([V.Property(0)],kt.prototype,"left",void 0),t([V.Property(0)],kt.prototype,"right",void 0),t([V.Property(0)],kt.prototype,"top",void 0),t([V.Property(0)],kt.prototype,"bottom",void 0),kt);function kt(){return null!==Lt&&Lt.apply(this,arguments)||this}Bt=V.ChildProperty,I(Rt,Bt),t([V.Property(45)],Rt.prototype,"angle",void 0),t([V.Property(5)],Rt.prototype,"distance",void 0),t([V.Property(.7)],Rt.prototype,"opacity",void 0),t([V.Property("lightgrey")],Rt.prototype,"color",void 0);var Bt,Nt=Rt;function Rt(){return null!==Bt&&Bt.apply(this,arguments)||this}jt=V.ChildProperty,I(Wt,jt),Wt.prototype.getClassName=function(){return"Stop"},t([V.Property("")],Wt.prototype,"color",void 0),t([V.Property(0)],Wt.prototype,"offset",void 0),t([V.Property(1)],Wt.prototype,"opacity",void 0);var jt,Ht=Wt;function Wt(){return null!==jt&&jt.apply(this,arguments)||this}_t=V.ChildProperty,I(Yt,_t),t([V.Collection([],Ht)],Yt.prototype,"stops",void 0),t([V.Property("None")],Yt.prototype,"type",void 0),t([V.Property("")],Yt.prototype,"id",void 0);var _t,Ft=Yt;function Yt(){return null!==_t&&_t.apply(this,arguments)||this}I(Xt,Vt=Ft),t([V.Property(0)],Xt.prototype,"x1",void 0),t([V.Property(0)],Xt.prototype,"x2",void 0),t([V.Property(0)],Xt.prototype,"y1",void 0),t([V.Property(0)],Xt.prototype,"y2",void 0),t([V.Property(0)],Xt.prototype,"cx",void 0),t([V.Property(0)],Xt.prototype,"cy",void 0),t([V.Property(0)],Xt.prototype,"fx",void 0),t([V.Property(0)],Xt.prototype,"fy",void 0),t([V.Property(50)],Xt.prototype,"r",void 0);var Vt,Ut=Xt;function Xt(){return null!==Vt&&Vt.apply(this,arguments)||this}I(qt,Gt=Ft),t([V.Property(0)],qt.prototype,"x1",void 0),t([V.Property(0)],qt.prototype,"x2",void 0),t([V.Property(0)],qt.prototype,"y1",void 0),t([V.Property(0)],qt.prototype,"y2",void 0);var Gt,Zt=qt;function qt(){return null!==Gt&&Gt.apply(this,arguments)||this}I(Jt,Kt=Ft),t([V.Property(0)],Jt.prototype,"cx",void 0),t([V.Property(0)],Jt.prototype,"cy",void 0),t([V.Property(0)],Jt.prototype,"fx",void 0),t([V.Property(0)],Jt.prototype,"fy",void 0),t([V.Property(50)],Jt.prototype,"r",void 0);var Kt,Qt=Jt;function Jt(){return null!==Kt&&Kt.apply(this,arguments)||this}$t=V.ChildProperty,I(ee,$t),t([V.Property("white")],ee.prototype,"fill",void 0),t([V.Property("black")],ee.prototype,"strokeColor",void 0),t([V.Property("")],ee.prototype,"strokeDashArray",void 0),t([V.Property(1)],ee.prototype,"strokeWidth",void 0),t([V.Property(1)],ee.prototype,"opacity",void 0),t([V.ComplexFactory(Ot)],ee.prototype,"gradient",void 0);var $t,te=ee;function ee(){return null!==$t&&$t.apply(this,arguments)||this}I(re,ie=te),t([V.Property("transparent")],re.prototype,"fill",void 0);var ie,ne=re;function re(){return null!==ie&&ie.apply(this,arguments)||this}I(se,oe=te),t([V.Property("black")],se.prototype,"color",void 0),t([V.Property("Arial")],se.prototype,"fontFamily",void 0),t([V.Property(12)],se.prototype,"fontSize",void 0),t([V.Property(!1)],se.prototype,"italic",void 0),t([V.Property(!1)],se.prototype,"bold",void 0),t([V.Property("CollapseSpace")],se.prototype,"whiteSpace",void 0),t([V.Property("WrapWithOverflow")],se.prototype,"textWrapping",void 0),t([V.Property("Center")],se.prototype,"textAlign",void 0),t([V.Property("None")],se.prototype,"textDecoration",void 0),t([V.Property("Wrap")],se.prototype,"textOverflow",void 0),t([V.Property("transparent")],se.prototype,"fill",void 0);var oe,ae=se;function se(){return null!==oe&&oe.apply(this,arguments)||this}he=V.ChildProperty,I(de,he),t([V.Property("white")],de.prototype,"fill",void 0),t([V.Property("Wrap")],de.prototype,"textOverflow",void 0),t([V.Property(1)],de.prototype,"strokeWidth",void 0),t([V.ComplexFactory(Ot)],de.prototype,"gradient",void 0),t([V.Property(1)],de.prototype,"opacity",void 0),t([V.Property(!1)],de.prototype,"italic",void 0),t([V.Property("")],de.prototype,"strokeDashArray",void 0),t([V.Property("black")],de.prototype,"color",void 0),t([V.Property(12)],de.prototype,"fontSize",void 0),t([V.Property("Arial")],de.prototype,"fontFamily",void 0),t([V.Property("CollapseSpace")],de.prototype,"whiteSpace",void 0),t([V.Property("Center")],de.prototype,"textAlign",void 0),t([V.Property("None")],de.prototype,"textDecoration",void 0),t([V.Property(!1)],de.prototype,"bold",void 0),t([V.Property("black")],de.prototype,"strokeColor",void 0),t([V.Property("WrapWithOverflow")],de.prototype,"textWrapping",void 0);var he,I=de;function de(){return null!==he&&he.apply(this,arguments)||this}(t=Q.BlazorAction||(Q.BlazorAction={}))[t.Default=0]="Default",t[t.expandNode=2]="expandNode",t[t.interaction=4]="interaction",t[t.GroupingInProgress=8]="GroupingInProgress",t[t.GroupClipboardInProcess=16]="GroupClipboardInProcess",t[t.ClearObject=32]="ClearObject",(t=Q.FlipDirection||(Q.FlipDirection={}))[t.Horizontal=1]="Horizontal",t[t.Vertical=2]="Vertical",t[t.Both=3]="Both",t[t.None=0]="None",(t=Q.PortVisibility||(Q.PortVisibility={}))[t.Visible=1]="Visible",t[t.Hidden=2]="Hidden",t[t.Hover=4]="Hover",t[t.Connect=8]="Connect",(t=Q.SnapConstraints||(Q.SnapConstraints={}))[t.None=0]="None",t[t.ShowHorizontalLines=1]="ShowHorizontalLines",t[t.ShowVerticalLines=2]="ShowVerticalLines",t[t.ShowLines=3]="ShowLines",t[t.SnapToHorizontalLines=4]="SnapToHorizontalLines",t[t.SnapToVerticalLines=8]="SnapToVerticalLines",t[t.SnapToLines=12]="SnapToLines",t[t.SnapToObject=16]="SnapToObject",t[t.All=31]="All",(t=Q.SelectorConstraints||(Q.SelectorConstraints={}))[t.None=1]="None",t[t.ConnectorSourceThumb=2]="ConnectorSourceThumb",t[t.ConnectorTargetThumb=4]="ConnectorTargetThumb",t[t.ResizeSouthEast=8]="ResizeSouthEast",t[t.ResizeSouthWest=16]="ResizeSouthWest",t[t.ResizeNorthEast=32]="ResizeNorthEast",t[t.ResizeNorthWest=64]="ResizeNorthWest",t[t.ResizeEast=128]="ResizeEast",t[t.ResizeWest=256]="ResizeWest",t[t.ResizeSouth=512]="ResizeSouth",t[t.ResizeNorth=1024]="ResizeNorth",t[t.Rotate=2048]="Rotate",t[t.UserHandle=4096]="UserHandle",t[t.ToolTip=8192]="ToolTip",t[t.ResizeAll=2046]="ResizeAll",t[t.All=16382]="All",(t=Q.ConnectionPointOrigin||(Q.ConnectionPointOrigin={})).SamePoint="SamePoint",t.DifferentPoint="DifferentPoint",(t=Q.ChildArrangement||(Q.ChildArrangement={})).Linear="Linear",t.Nonlinear="Nonlinear",(t=Q.ConnectorConstraints||(Q.ConnectorConstraints={}))[t.None=1]="None",t[t.Select=2]="Select",t[t.Delete=4]="Delete",t[t.Drag=8]="Drag",t[t.DragSourceEnd=16]="DragSourceEnd",t[t.DragTargetEnd=32]="DragTargetEnd",t[t.DragSegmentThumb=64]="DragSegmentThumb",t[t.AllowDrop=128]="AllowDrop",t[t.Bridging=256]="Bridging",t[t.BridgeObstacle=512]="BridgeObstacle",t[t.InheritBridging=1024]="InheritBridging",t[t.PointerEvents=2048]="PointerEvents",t[t.Tooltip=4096]="Tooltip",t[t.InheritTooltip=8192]="InheritTooltip",t[t.Interaction=4218]="Interaction",t[t.ReadOnly=16384]="ReadOnly",t[t.LineRouting=32768]="LineRouting",t[t.InheritLineRouting=65536]="InheritLineRouting",t[t.ConnectToNearByNode=131072]="ConnectToNearByNode",t[t.ConnectToNearByPort=262144]="ConnectToNearByPort",t[t.ConnectToNearByElement=393216]="ConnectToNearByElement",t[t.InheritSegmentThumbShape=524288]="InheritSegmentThumbShape",t[t.InheritSegmentThumbSize=1048576]="InheritSegmentThumbSize",t[t.Default=2043454]="Default",(t=Q.AnnotationConstraints||(Q.AnnotationConstraints={}))[t.ReadOnly=2]="ReadOnly",t[t.InheritReadOnly=4]="InheritReadOnly",t[t.Select=8]="Select",t[t.Drag=16]="Drag",t[t.Resize=32]="Resize",t[t.Rotate=64]="Rotate",t[t.Tooltip=128]="Tooltip",t[t.Interaction=120]="Interaction",t[t.None=0]="None",(t=Q.NodeConstraints||(Q.NodeConstraints={}))[t.None=0]="None",t[t.Select=2]="Select",t[t.Drag=4]="Drag",t[t.Rotate=8]="Rotate",t[t.Shadow=16]="Shadow",t[t.PointerEvents=32]="PointerEvents",t[t.Delete=64]="Delete",t[t.InConnect=128]="InConnect",t[t.OutConnect=256]="OutConnect",t[t.Individual=512]="Individual",t[t.Expandable=1024]="Expandable",t[t.AllowDrop=2048]="AllowDrop",t[t.Inherit=78]="Inherit",t[t.ResizeNorthEast=4096]="ResizeNorthEast",t[t.ResizeEast=8192]="ResizeEast",t[t.ResizeSouthEast=16384]="ResizeSouthEast",t[t.ResizeSouth=32768]="ResizeSouth",t[t.ResizeSouthWest=65536]="ResizeSouthWest",t[t.ResizeWest=131072]="ResizeWest",t[t.ResizeNorthWest=262144]="ResizeNorthWest",t[t.ResizeNorth=524288]="ResizeNorth",t[t.Resize=1044480]="Resize",t[t.AspectRatio=1048576]="AspectRatio",t[t.Tooltip=2097152]="Tooltip",t[t.InheritTooltip=4194304]="InheritTooltip",t[t.ReadOnly=8388608]="ReadOnly",t[t.HideThumbs=16777216]="HideThumbs",t[t.AllowMovingOutsideLane=33554432]="AllowMovingOutsideLane",t[t.Default=5240814]="Default",(t=Q.ElementAction||(Q.ElementAction={}))[t.None=0]="None",t[t.ElementIsPort=2]="ElementIsPort",t[t.ElementIsGroup=4]="ElementIsGroup",t[t.HorizontalLaneHeader=8]="HorizontalLaneHeader",(t=Q.ThumbsConstraints||(Q.ThumbsConstraints={}))[t.Rotate=2]="Rotate",t[t.ConnectorSource=4]="ConnectorSource",t[t.ConnectorTarget=8]="ConnectorTarget",t[t.ResizeNorthEast=16]="ResizeNorthEast",t[t.ResizeEast=32]="ResizeEast",t[t.ResizeSouthEast=64]="ResizeSouthEast",t[t.ResizeSouth=128]="ResizeSouth",t[t.ResizeSouthWest=256]="ResizeSouthWest",t[t.ResizeWest=512]="ResizeWest",t[t.ResizeNorthWest=1024]="ResizeNorthWest",t[t.ResizeNorth=2048]="ResizeNorth",t[t.Default=4094]="Default",(t=Q.DiagramConstraints||(Q.DiagramConstraints={}))[t.None=1]="None",t[t.Bridging=2]="Bridging",t[t.UndoRedo=4]="UndoRedo",t[t.Tooltip=8]="Tooltip",t[t.UserInteraction=16]="UserInteraction",t[t.ApiUpdate=32]="ApiUpdate",t[t.PageEditable=48]="PageEditable",t[t.Zoom=64]="Zoom",t[t.PanX=128]="PanX",t[t.PanY=256]="PanY",t[t.Pan=384]="Pan",t[t.ZoomTextEdit=512]="ZoomTextEdit",t[t.Virtualization=1024]="Virtualization",t[t.LineRouting=2048]="LineRouting",t[t.AvoidLineOverlapping=4096]="AvoidLineOverlapping",t[t.RestrictNegativeAxisDragDrop=8192]="RestrictNegativeAxisDragDrop",t[t.AutomaticPortCreation=16384]="AutomaticPortCreation",t[t.Default=500]="Default",(t=Q.DiagramTools||(Q.DiagramTools={}))[t.None=0]="None",t[t.SingleSelect=1]="SingleSelect",t[t.MultipleSelect=2]="MultipleSelect",t[t.ZoomPan=4]="ZoomPan",t[t.DrawOnce=8]="DrawOnce",t[t.ContinuousDraw=16]="ContinuousDraw",t[t.Default=3]="Default",(t=Q.Transform||(Q.Transform={}))[t.Self=1]="Self",t[t.Parent=2]="Parent",(t=Q.RenderMode||(Q.RenderMode={}))[t.Canvas=0]="Canvas",t[t.Svg=1]="Svg",(t=Q.KeyModifiers||(Q.KeyModifiers={}))[t.None=0]="None",t[t.Control=1]="Control",t[t.Meta=1]="Meta",t[t.Alt=2]="Alt",t[t.Shift=4]="Shift",(t=Q.Keys||(Q.Keys={}))[t.None=null]="None",t[t.Number0=0]="Number0",t[t.Number1=1]="Number1",t[t.Number2=2]="Number2",t[t.Number3=3]="Number3",t[t.Number4=4]="Number4",t[t.Number5=5]="Number5",t[t.Number6=6]="Number6",t[t.Number7=7]="Number7",t[t.Number8=8]="Number8",t[t.Number9=9]="Number9",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.Left=37]="Left",t[t.Up=38]="Up",t[t.Right=39]="Right",t[t.Down=40]="Down",t[t.Escape=27]="Escape",t[t.Space=32]="Space",t[t.PageUp=33]="PageUp",t[t.PageDown=34]="PageDown",t[t.End=35]="End",t[t.Home=36]="Home",t[t.Delete=46]="Delete",t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.BackSpace=8]="BackSpace",t[t.F1=112]="F1",t[t.F2=113]="F2",t[t.F3=114]="F3",t[t.F4=115]="F4",t[t.F5=116]="F5",t[t.F6=117]="F6",t[t.F7=118]="F7",t[t.F8=119]="F8",t[t.F9=120]="F9",t[t.F10=121]="F10",t[t.F11=122]="F11",t[t.F12=123]="F12",t[t.Star=56]="Star",t[t.Plus=187]="Plus",t[t.Minus=189]="Minus",t[t.BracketLeft=219]="BracketLeft",t[t.BracketRight=221]="BracketRight",(t=Q.DiagramAction||(Q.DiagramAction={}))[t.Render=2]="Render",t[t.PublicMethod=4]="PublicMethod",t[t.ToolAction=8]="ToolAction",t[t.UndoRedo=16]="UndoRedo",t[t.TextEdit=32]="TextEdit",t[t.Group=64]="Group",t[t.Clear=128]="Clear",t[t.PreventClearSelection=256]="PreventClearSelection",t[t.Interactions=512]="Interactions",t[t.PreventHistory=1024]="PreventHistory",t[t.PreventIconsUpdate=2048]="PreventIconsUpdate",t[t.PreventCollectionChangeOnDragOver=4096]="PreventCollectionChangeOnDragOver",t[t.PreventZIndexOnDragging=8192]="PreventZIndexOnDragging",t[t.isGroupDragging=16384]="isGroupDragging",t[t.DragUsingMouse=32768]="DragUsingMouse",t[t.DecoratorPropertyChange=65536]="DecoratorPropertyChange",t[t.PreventLaneContainerUpdate=131072]="PreventLaneContainerUpdate",(t=Q.RendererAction||(Q.RendererAction={}))[t.None=2]="None",t[t.DrawSelectorBorder=4]="DrawSelectorBorder",t[t.PreventRenderSelector=8]="PreventRenderSelector",(t=Q.RealAction||(Q.RealAction={}))[t.None=0]="None",t[t.PreventDrag=2]="PreventDrag",t[t.PreventScale=4]="PreventScale",t[t.PreventDataInit=8]="PreventDataInit",t[t.hScrollbarMoved=16]="hScrollbarMoved",t[t.vScrollbarMoved=32]="vScrollbarMoved",t[t.AnimationClick=64]="AnimationClick",t[t.EnableGroupAction=128]="EnableGroupAction",t[t.PanInProgress=256]="PanInProgress",t[t.OverViewAction=512]="OverViewAction",(t=Q.ScrollActions||(Q.ScrollActions={}))[t.None=0]="None",t[t.PropertyChange=1024]="PropertyChange",t[t.Interaction=2048]="Interaction",(t=Q.NoOfSegments||(Q.NoOfSegments={}))[t.Zero=0]="Zero",t[t.One=1]="One",t[t.Two=2]="Two",t[t.Three=3]="Three",t[t.Four=4]="Four",t[t.Five=5]="Five",(t=Q.DiagramEvent||(Q.DiagramEvent={}))[t.collectionChange=0]="collectionChange",t[t.rotateChange=1]="rotateChange",t[t.positionChange=2]="positionChange",t[t.propertyChange=3]="propertyChange",t[t.selectionChange=4]="selectionChange",t[t.sizeChange=5]="sizeChange",t[t.drop=6]="drop",t[t.sourcePointChange=7]="sourcePointChange",t[t.targetPointChange=8]="targetPointChange",t[t.connectionChange=9]="connectionChange",t[t.animationComplete=10]="animationComplete",t[t.click=11]="click",t[t.doubleClick=12]="doubleClick",t[t.scrollChange=13]="scrollChange",t[t.dragEnter=14]="dragEnter",t[t.dragLeave=15]="dragLeave",t[t.dragOver=16]="dragOver",t[t.textEdit=17]="textEdit",t[t.paletteSelectionChange=18]="paletteSelectionChange",t[t.historyChange=19]="historyChange",t[t.mouseEnter=20]="mouseEnter",t[t.mouseLeave=21]="mouseLeave",t[t.mouseOver=22]="mouseOver",t[t.expandStateChange=23]="expandStateChange",t[t.segmentCollectionChange=24]="segmentCollectionChange",t[t.commandExecute=25]="commandExecute",t[t.historyStateChange=26]="historyStateChange",t[t.onUserHandleMouseDown=27]="onUserHandleMouseDown",t[t.onUserHandleMouseUp=28]="onUserHandleMouseUp",t[t.onUserHandleMouseEnter=29]="onUserHandleMouseEnter",t[t.onUserHandleMouseLeave=30]="onUserHandleMouseLeave",t[t.onImageLoad=31]="onImageLoad",t[t.onDoBindingInit=32]="onDoBindingInit",t[t.keyUp=33]="keyUp",t[t.keyDown=34]="keyDown",t[t.fixedUserHandleClick=35]="fixedUserHandleClick",t[t.elementDraw=36]="elementDraw",t[t.mouseWheel=37]="mouseWheel",t[t.segmentChange=38]="segmentChange",t[t.onFixedUserHandleMouseDown=39]="onFixedUserHandleMouseDown",t[t.onFixedUserHandleMouseUp=40]="onFixedUserHandleMouseUp",t[t.onFixedUserHandleMouseEnter=41]="onFixedUserHandleMouseEnter",t[t.onFixedUserHandleMouseLeave=42]="onFixedUserHandleMouseLeave",t[t.loaded=43]="loaded",t[t.layoutUpdated=44]="layoutUpdated",t[t.diagramImporting=45]="diagramImporting",t[t.diagramExporting=46]="diagramExporting",(t=Q.PortConstraints||(Q.PortConstraints={}))[t.None=1]="None",t[t.Drag=2]="Drag",t[t.Draw=4]="Draw",t[t.InConnect=8]="InConnect",t[t.OutConnect=16]="OutConnect",t[t.ToolTip=32]="ToolTip",t[t.InheritTooltip=64]="InheritTooltip",t[t.Default=24]="Default";var le="contextMenuClick",ce="contextMenuOpen",pe="contextMenuBeforeItemRender",ge=((t=Q.ControlPointsVisibility||(Q.ControlPointsVisibility={}))[t.None=1]="None",t[t.Source=2]="Source",t[t.Target=4]="Target",t[t.Intermediate=8]="Intermediate",t[t.All=14]="All",(t=Q.BezierSmoothness||(Q.BezierSmoothness={}))[t.None=0]="None",t[t.SymmetricAngle=2]="SymmetricAngle",t[t.SymmetricDistance=4]="SymmetricDistance",t[t.Default=6]="Default",ue.prototype.setOffsetWithRespectToBounds=function(t,e,i){this.unitMode=i,this.position={x:t,y:e}},ue.prototype.getAbsolutePosition=function(t){if(void 0!==this.position)return"Absolute"===this.unitMode?this.position:{x:this.position.x*t.width,y:this.position.y*t.height}},Object.defineProperty(ue.prototype,"outerBounds",{get:function(){return this.floatingBounds||this.bounds},set:function(t){this.floatingBounds=t},enumerable:!0,configurable:!0}),ue.prototype.measure=function(t,e,i){var n=void 0!==this.width?this.width:(t.width||0)-this.margin.left-this.margin.right,r=void 0!==this.height?this.height:(t.height||0)-this.margin.top-this.margin.bottom;return this.id&&0===r&&this.elementActions&Q.ElementAction.HorizontalLaneHeader&&(r=this.actualSize.height),this.desiredSize=new U(n,r),this.isCalculateDesiredSize&&(this.desiredSize=this.validateDesiredSize(this.desiredSize,t)),this.desiredSize},ue.prototype.arrange=function(t){return this.actualSize=t,this.updateBounds(),this.actualSize},ue.prototype.updateBounds=function(){this.bounds=gt(this)},ue.prototype.validateDesiredSize=function(t,e){return!this.isRectElement||this.width||this.minWidth||this.maxWidth||(t.width=50),!this.isRectElement||this.height||this.minHeight||this.maxHeight||(t.height=50),(void 0===t||void 0!==this.width&&void 0!==this.height)&&((t=t||new U).width=void 0===this.width?(e.width||0)-this.margin.left-this.margin.right:this.width,t.height=void 0===this.height?(e.height||0)-this.margin.top-this.margin.bottom:this.height),void 0!==this.minWidth&&(t.width=Math.max(t.width,this.minWidth)),void 0!==this.minHeight&&(t.height=Math.max(t.height,this.minHeight)),void 0!==this.maxWidth&&0!==this.maxWidth&&(t.width=Math.min(t.width,this.maxWidth)),void 0!==this.maxHeight&&0!==this.maxHeight&&(t.height=Math.min(t.height,this.maxHeight)),t},ue);function ue(){this.pivot={x:.5,y:.5},this.isDirt=!0,this.isExport=!1,this.exportScaleValue={x:0,y:0},this.exportScaleOffset={x:0,y:0},this.canApplyStyle=!0,this.visible=!0,this.offsetX=0,this.offsetY=0,this.cornerRadius=0,this.minHeight=void 0,this.minWidth=void 0,this.maxWidth=void 0,this.maxHeight=void 0,this.width=void 0,this.height=void 0,this.rotateAngle=0,this.margin={left:0,right:0,top:0,bottom:0},this.connectionDirection="Auto",this.horizontalAlignment="Auto",this.verticalAlignment="Auto",this.flip=Q.FlipDirection.None,this.flipMode="All",this.relativeMode="Point",this.transform=Q.Transform.Self|Q.Transform.Parent,this.style={fill:"white",strokeColor:"black",opacity:1,strokeWidth:1},this.desiredSize=new U,this.actualSize=new U,this.parentTransform=0,this.preventContainer=!1,this.isSvgRender=!1,this.bounds=new B(0,0,0,0),this.shadow=null,this.description="",this.staticSize=!1,this.shapeType="",this.isRectElement=!1,this.isCalculateDesiredSize=!0,this.flipOffset={x:0,y:0},this.elementActions=Q.ElementAction.None,this.inversedAlignment=!0,this.position=void 0,this.unitMode=void 0,this.float=!1,this.floatingBounds=void 0}me=function(t,e){return(me=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}me(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(ve,fe=ge),ve.prototype.hasChildren=function(){return void 0!==this.children&&0<this.children.length},ve.prototype.measure=function(t,e,i){var n,r=this.desiredBounds=void 0;if(this.hasChildren()){for(var o,a=0;a<this.children.length;a++){"Stretch"!==(n=this.children[parseInt(a.toString(),10)]).horizontalAlignment||t.width||(t.width=n.bounds.width),"Stretch"!==n.verticalAlignment||t.height||(t.height=n.bounds.height);var s="Stretch"===n.horizontalAlignment||"Stretch"===n.verticalAlignment;(this.measureChildren||s||n instanceof ve&&void 0!==n.measureChildren)&&n.measure(t,e,i),s=this.GetChildrenBounds(n),"Stretch"!==n.horizontalAlignment&&"Stretch"!==n.verticalAlignment?void 0===this.desiredBounds?this.desiredBounds=s:this.desiredBounds.uniteRect(s):!this.actualSize||this.actualSize.width||this.actualSize.height||n.preventContainer||"Stretch"!==n.horizontalAlignment||"Stretch"!==n.verticalAlignment||(void 0===this.desiredBounds?this.desiredBounds=n.bounds:this.desiredBounds.uniteRect(n.bounds))}void 0!==this.desiredBounds&&0!==this.rotateAngle&&(o={x:this.desiredBounds.x+this.desiredBounds.width*this.pivot.x,y:this.desiredBounds.y+this.desiredBounds.height*this.pivot.y},o=Dt(this.rotateAngle,void 0,void 0,o),this.desiredBounds.x=o.x-this.desiredBounds.width*this.pivot.x,this.desiredBounds.y=o.y-this.desiredBounds.height*this.pivot.y),void 0!==this.desiredBounds&&(this.desiredBounds.width+=this.padding.left+this.padding.right,this.desiredBounds.height+=this.padding.top+this.padding.bottom,this.desiredBounds.x-=this.padding.left,this.desiredBounds.y-=this.padding.top),this.desiredBounds&&(r=new U(this.desiredBounds.width,this.desiredBounds.height))}return r=this.validateDesiredSize(r,t),this.stretchChildren(r),this.desiredSize=r},ve.prototype.arrange=function(t){var e=this.desiredBounds;if(e){this.offsetX,this.offsetY;if(this.offsetX=e.x+e.width*this.pivot.x,this.offsetY=e.y+e.height*this.pivot.y,this.hasChildren())for(var i=0;i<this.children.length;i++){var n,r=!1;"Stretch"===(n=this.children[parseInt(i.toString(),10)]).horizontalAlignment&&(n.offsetX=this.offsetX,n.parentTransform=this.parentTransform+this.rotateAngle,this.flip&&this.elementActions&Q.ElementAction.ElementIsGroup&&(n.parentTransform=this.flip===Q.FlipDirection.Horizontal||this.flip===Q.FlipDirection.Vertical?-n.parentTransform:n.parentTransform),r=!0),"Stretch"===n.verticalAlignment&&(n.offsetY=this.offsetY,n.parentTransform=this.parentTransform+this.rotateAngle,r=!0),(r||this.measureChildren||n instanceof ve&&void 0!==n.measureChildren)&&n.arrange(n.desiredSize),0===i?(r=n.outerBounds,this.outerBounds=new B(r.x,r.y,r.width,r.height)):this.outerBounds.uniteRect(n.outerBounds)}}return this.actualSize=t,this.updateBounds(),this.prevRotateAngle=this.rotateAngle,t},ve.prototype.stretchChildren=function(t){if(this.hasChildren())for(var e=0,i=this.children;e<i.length;e++){var n=i[e];"Stretch"!==n.horizontalAlignment&&void 0!==n.desiredSize.width||(n.desiredSize.width=t.width-n.margin.left-n.margin.right),"Stretch"!==n.verticalAlignment&&void 0!==n.desiredSize.height||(n.desiredSize.height=t.height-n.margin.top-n.margin.bottom),n instanceof ve&&n.stretchChildren(n.desiredSize)}},ve.prototype.applyPadding=function(t){t.width+=this.padding.left+this.padding.right,t.height+=this.padding.top+this.padding.bottom},ve.prototype.findChildOffsetFromCenter=function(t,e){var i=At({x:e.x-t.desiredSize.width/2,y:e.y-t.desiredSize.height/2},t),i=Dt(t.rotateAngle,e.x,e.y,i);i=Dt(this.rotateAngle+this.parentTransform,this.offsetX,this.offsetY,i),t.offsetX=i.x,t.offsetY=i.y},ve.prototype.GetChildrenBounds=function(t){var e=t.desiredSize.clone(),i=(t.rotateAngle,this.rotateAngle,t.offsetX),n=t.offsetY,i=i-e.width*t.pivot.x,n=n-e.height*t.pivot.y,r=i+e.width,e=n+e.height,o={x:i,y:n},n={x:r,y:n},i={x:i,y:e},r={x:r,y:e},o=Dt(t.rotateAngle,t.offsetX,t.offsetY,o),n=Dt(t.rotateAngle,t.offsetX,t.offsetY,n),i=Dt(t.rotateAngle,t.offsetX,t.offsetY,i),r=Dt(t.rotateAngle,t.offsetX,t.offsetY,r);return 0!==this.rotateAngle&&(o=Dt(-this.rotateAngle,void 0,void 0,o),n=Dt(-this.rotateAngle,void 0,void 0,n),i=Dt(-this.rotateAngle,void 0,void 0,i),r=Dt(-this.rotateAngle,void 0,void 0,r)),B.toBounds([o,n,i,r])};var me,fe,ye=ve;function ve(){var t=null!==fe&&fe.apply(this,arguments)||this;return t.padding=new Et(0,0,0,0),t.desiredBounds=void 0,t.measureChildren=!0,t.prevRotateAngle=0,t}be=function(t,e){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};(function(t,e){function i(){this.constructor=t}be(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)})(we,Se=ge),Object.defineProperty(we.prototype,"content",{get:function(){return this.textContent},set:function(t){this.textContent!==t&&(this.textContent=t,this.isDirt=!0,this.doWrap=!0)},enumerable:!0,configurable:!0}),Object.defineProperty(we.prototype,"childNodes",{get:function(){return this.textNodes},set:function(t){this.textNodes=t},enumerable:!0,configurable:!0}),Object.defineProperty(we.prototype,"wrapBounds",{get:function(){return this.textWrapBounds},set:function(t){this.textWrapBounds=t},enumerable:!0,configurable:!0}),we.prototype.refreshTextElement=function(){this.isDirt=!0},we.prototype.measure=function(t){var e=this.isDirt&&this.canMeasure?function(t,e,i){var n,r=new U(0,0),o=function(t,e){e={fill:t.style.fill,stroke:t.style.strokeColor,angle:t.rotateAngle+t.parentTransform,pivotX:t.pivot.x,pivotY:t.pivot.y,strokeWidth:t.style.strokeWidth,dashArray:t.style.strokeDashArray,opacity:t.style.opacity,shadow:t.shadow,gradient:t.style.gradient,visible:t.visible,id:t.id,description:t.description,width:e||t.actualSize.width,height:t.actualSize.height,x:t.offsetX-t.actualSize.width*t.pivot.x+.5,y:t.offsetY-t.actualSize.height*t.pivot.y+.5};return e.fontSize=t.style.fontSize,e.fontFamily=t.style.fontFamily,e.textOverflow=t.style.textOverflow,e.textDecoration=t.style.textDecoration,e.doWrap=t.doWrap,e.whiteSpace=Ct(t.style.whiteSpace,t.style.textWrapping),e.content=t.content,e.textWrapping=t.style.textWrapping,e.breakWord=bt(t.style.textWrapping),e.textAlign=vt(t.style.textAlign),e.color=t.style.color,e.italic=t.style.italic,e.bold=t.style.bold,e.dashArray="",e.strokeWidth=0,e.fill="",e}(t,e);t.childNodes=i=function(t,e,i){var n,r=[],o=0,a=e||t.content;if("nowrap"!==t.whiteSpace&&"pre"!==t.whiteSpace)if("breakall"===t.breakWord)for(n="",n+=a[0],o=0;o<a.length;o++){var s;(s=wt(n,t))>=t.width&&0<n.length?(r[r.length]={text:n,x:0,dy:0,width:s},n=""):(-1<(n+=a[o+1]||"").indexOf("\n")&&(r[r.length]={text:n,x:0,dy:0,width:wt(n,t)},n=""),s=wt(n,t),Math.ceil(s)+2>=t.width&&0<n.length&&(r[r.length]={text:n,x:0,dy:0,width:s},n=""),o===a.length-1&&0<n.length&&(r[r.length]={text:n,x:0,dy:0,width:s},n=""))}else r=function(t,e,i){var n,r,o,a,s=[],h="",d=0,l=0,c="nowrap"!==t.whiteSpace,p=(e||t.content).split("\n");for(d=0;d<p.length;d++)for(n="NoWrap"!==t.textWrapping?p[parseInt(d.toString(),10)].split(" "):[p[parseInt(d.toString(),10)]],l=0;l<n.length;l++){h+=((0!==l||1===n.length)&&c&&0<h.length?" ":"")+n[parseInt(l.toString(),10)];var g=wt(r=n[l+1]?h+" "+n[l+1]:h,t);Math.floor(g)>(i||t.width)-2&&0<h.length?(s[s.length]={text:h,x:0,dy:0,width:r===h?g:h===a?o:wt(h,t)},h=""):l===n.length-1&&(s[s.length]={text:h,x:0,dy:0,width:g},h=""),a=r,o=g}return s}(t,e,i);else r[r.length]={text:a,x:0,dy:0,width:wt(a,t)};return r}(o,i,t.isLaneOrientation?e:void 0),t.wrapBounds=n=function(t,e){var i,n,r={x:0,width:0},o=0;for(o=0;o<e.length;o++)i=e[parseInt(o.toString(),10)].width,n=i,i="left"===t.textAlign||"justify"===t.textAlign?0:"center"===t.textAlign?i>t.width&&("Ellipsis"===t.textOverflow||"Clip"===t.textOverflow)?0:-i/2:"right"===t.textAlign?-i:1<e.length?0:-i/2,e[parseInt(o.toString(),10)].dy=1.2*t.fontSize,e[parseInt(o.toString(),10)].x=i,r.x=Math.min(r.x,i),r.width=Math.max(r.width,n);return r}(o,i),r.width=n.width,t.wrapBounds.width>=e&&"Wrap"!==o.textOverflow&&(r.width=e);return r.height=i.length*t.style.fontSize*1.2,r}(this,(this.style,this.content,this.isLaneOrientation?t.height:this.width||t.width)):this.desiredSize;return void 0===this.width||void 0===this.height?this.desiredSize=new U(e.width,e.height):this.desiredSize=new U(this.width,this.height),this.desiredSize=this.validateDesiredSize(this.desiredSize,t),this.desiredSize},we.prototype.arrange=function(t){return t.width===this.actualSize.width&&t.height===this.actualSize.height&&!this.isDirt||(this.doWrap=!0),this.actualSize=t,this.updateBounds(),this.isDirt=!1,this.actualSize};var be,Se,X=we;function we(){var t=Se.call(this)||this;return t.textContent="",t.canMeasure=!0,t.rotationReference="Parent",t.isLaneOrientation=!1,t.canConsiderBounds=!0,t.annotationVisibility="Visible",t.hyperlink={color:"blue"},t.doWrap=!0,t.textNodes=[],t.style={color:"black",fill:"transparent",strokeColor:"black",strokeWidth:1,fontFamily:"Arial",fontSize:12,whiteSpace:"CollapseSpace",textWrapping:"WrapWithOverflow",textAlign:"Center",italic:!1,bold:!1,textDecoration:"None",strokeDashArray:"",opacity:5,gradient:null,textOverflow:"Wrap"},t.style.fill="transparent",t.style.strokeColor="transparent",t}xe=function(t,e){return(xe=Object.setPro