!function(t){function e(i){if(n[i])return n[i].exports;var o=n[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=44)}([function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(t,e,n){var i=n(33)("wks"),o=n(20),s=n(4).Symbol,r="function"==typeof s;(t.exports=function(t){return i[t]||(i[t]=r&&s[t]||(r?s:o)("Symbol."+t))}).store=i},function(t,e,n){var i=n(4),o=n(1),s=n(12),r=n(5),a=function(t,e,n){var l,u,c,h=t&a.F,d=t&a.G,p=t&a.S,f=t&a.P,g=t&a.B,m=t&a.W,v=d?o:o[e]||(o[e]={}),y=v.prototype,b=d?i:p?i[e]:(i[e]||{}).prototype;d&&(n=e);for(l in n)(u=!h&&b&&void 0!==b[l])&&l in v||(c=u?b[l]:n[l],v[l]=d&&"function"!=typeof b[l]?n[l]:g&&u?s(c,i):m&&b[l]==c?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):f&&"function"==typeof c?s(Function.call,c):c,f&&((v.virtual||(v.virtual={}))[l]=c,t&a.R&&y&&!y[l]&&r(y,l,c)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){var i=n(7),o=n(28);t.exports=n(8)?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var i=n(0);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i=n(6),o=n(51),s=n(52),r=Object.defineProperty;e.f=n(8)?Object.defineProperty:function(t,e,n){if(i(t),e=s(e,!0),i(n),o)try{return r(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){t.exports=!n(9)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e){t.exports={}},function(t,e,n){var i=n(26);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,o){return t.call(e,n,i,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,n){var i=n(14),o=n(16);t.exports=function(t){return i(o(t))}},function(t,e,n){var i=n(15);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var i=n(18),o=Math.min;t.exports=function(t){return t>0?o(i(t),9007199254740991):0}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},function(t,e,n){var i=n(33)("keys"),o=n(20);t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){var i=n(7).f,o=n(10),s=n(2)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,s)&&i(t,s,{configurable:!0,value:e})}},function(t,e,n){var i=n(16);t.exports=function(t){return Object(i(t))}},function(t,e,n){var i=n(12),o=n(14),s=n(22),r=n(17),a=n(83);t.exports=function(t,e){var n=1==t,l=2==t,u=3==t,c=4==t,h=6==t,d=5==t||h,p=e||a;return function(e,a,f){for(var g,m,v=s(e),y=o(v),b=i(a,f,3),P=r(y.length),_=0,x=n?p(e,P):l?p(e,0):void 0;P>_;_++)if((d||_ in y)&&(g=y[_],m=b(g,_,v),t))if(n)x[_]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return _;case 2:x.push(g)}else if(c)return!1;return h?-1:u||c?c:x}}},function(t,e,n){var i=n(20)("meta"),o=n(0),s=n(10),r=n(7).f,a=0,l=Object.isExtensible||function(){return!0},u=!n(9)(function(){return l(Object.preventExtensions({}))}),c=function(t){r(t,i,{value:{i:"O"+ ++a,w:{}}})},h=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,i)){if(!l(t))return"F";if(!e)return"E";c(t)}return t[i].i},d=function(t,e){if(!s(t,i)){if(!l(t))return!0;if(!e)return!1;c(t)}return t[i].w},p=function(t){return u&&f.NEED&&l(t)&&!s(t,i)&&c(t),t},f=t.exports={KEY:i,NEED:!1,fastKey:h,getWeak:d,onFreeze:p}},function(t,e,n){var i=n(12),o=n(87),s=n(88),r=n(6),a=n(17),l=n(35),u={},c={},e=t.exports=function(t,e,n,h,d){var p,f,g,m,v=d?function(){return t}:l(t),y=i(n,h,e?2:1),b=0;if("function"!=typeof v)throw TypeError(t+" is not iterable!");if(s(v)){for(p=a(t.length);p>b;b++)if((m=e?y(r(f=t[b])[0],f[1]):y(t[b]))===u||m===c)return m}else for(g=v.call(t);!(f=g.next()).done;)if((m=o(g,y,f.value,e))===u||m===c)return m};e.BREAK=u,e.RETURN=c},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(0),o=n(4).document,s=i(o)&&i(o.createElement);t.exports=function(t){return s?o.createElement(t):{}}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){n(55);for(var i=n(4),o=n(5),s=n(11),r=n(2)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l<a.length;l++){var u=a[l],c=i[u],h=c&&c.prototype;h&&!h[r]&&o(h,r,u),s[u]=s.Array}},function(t,e,n){"use strict";var i=n(58),o=n(3),s=n(31),r=n(5),a=n(10),l=n(11),u=n(59),c=n(21),h=n(66),d=n(2)("iterator"),p=!([].keys&&"next"in[].keys()),f=function(){return this};t.exports=function(t,e,n,g,m,v,y){u(n,e,g);var b,P,_,x=function(t){if(!p&&t in S)return S[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},C=e+" Iterator",E="values"==m,j=!1,S=t.prototype,D=S[d]||S["@@iterator"]||m&&S[m],w=D||x(m),I=m?E?x("entries"):w:void 0,A="Array"==e?S.entries||D:D;if(A&&(_=h(A.call(new t)))!==Object.prototype&&_.next&&(c(_,C,!0),i||a(_,d)||r(_,d,f)),E&&D&&"values"!==D.name&&(j=!0,w=function(){return D.call(this)}),i&&!y||!p&&!j&&S[d]||r(S,d,w),l[e]=w,l[C]=f,m)if(b={values:E?w:x("values"),keys:v?w:x("keys"),entries:I},y)for(P in b)P in S||s(S,P,b[P]);else o(o.P+o.F*(p||j),e,b);return b}},function(t,e,n){t.exports=n(5)},function(t,e,n){var i=n(62),o=n(34);t.exports=Object.keys||function(t){return i(t,o)}},function(t,e,n){var i=n(4),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var i=n(70),o=n(2)("iterator"),s=n(11);t.exports=n(1).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||s[i(t)]}},function(t,e,n){"use strict";var i=n(32),o=n(74),s=n(75),r=n(22),a=n(14),l=Object.assign;t.exports=!l||n(9)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||Object.keys(l({},e)).join("")!=i})?function(t,e){for(var n=r(t),l=arguments.length,u=1,c=o.f,h=s.f;l>u;)for(var d,p=a(arguments[u++]),f=c?i(p).concat(c(p)):i(p),g=f.length,m=0;g>m;)h.call(p,d=f[m++])&&(n[d]=p[d]);return n}:l},function(t,e,n){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,n){"use strict";e.__esModule=!0;var i=n(76),o=function(t){return t&&t.__esModule?t:{default:t}}(i);e.default=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,o.default)(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}()},function(t,e,n){(function(){void 0===Math.sgn&&(Math.sgn=function(t){return 0==t?0:t>0?1:-1});var t={subtract:function(t,e){return{x:t.x-e.x,y:t.y-e.y}},dotProduct:function(t,e){return t.x*e.x+t.y*e.y},square:function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},scale:function(t,e){return{x:t.x*e,y:t.y*e}}},n=Math.pow(2,-65),i=function(e,n){for(var i=[],o=s(e,n),a=n.length-1,l=2*a-1,u=r(o,l,i,0),h=t.subtract(e,n[0]),d=t.square(h),p=0,f=0;f<u;f++){h=t.subtract(e,c(n,a,i[f],null,null));var g=t.square(h);g<d&&(d=g,p=i[f])}return h=t.subtract(e,n[a]),g=t.square(h),g<d&&(d=g,p=1),{location:p,distance:d}},o=function(t,e){var n=i(t,e);return{point:c(e,e.length-1,n.location,null,null),location:n.location}},s=function(e,n){for(var i=n.length-1,o=2*i-1,s=[],r=[],a=[],l=[],u=[[1,.6,.3,.1],[.4,.6,.6,.4],[.1,.3,.6,1]],c=0;c<=i;c++)s[c]=t.subtract(n[c],e);for(var c=0;c<=i-1;c++)r[c]=t.subtract(n[c+1],n[c]),r[c]=t.scale(r[c],3);for(var h=0;h<=i-1;h++)for(var d=0;d<=i;d++)a[h]||(a[h]=[]),a[h][d]=t.dotProduct(r[h],s[d]);for(c=0;c<=o;c++)l[c]||(l[c]=[]),l[c].y=0,l[c].x=parseFloat(c)/o;for(var p=i,f=i-1,g=0;g<=p+f;g++){var m=Math.max(0,g-f),v=Math.min(g,p);for(c=m;c<=v;c++)j=g-c,l[c+j].y+=a[j][c]*u[j][c]}return l},r=function(t,e,n,i){var o,s,h=[],d=[],p=[],f=[];switch(a(t,e)){case 0:return 0;case 1:if(i>=64)return n[0]=(t[0].x+t[e].x)/2,1;if(l(t,e))return n[0]=u(t,e),1}c(t,e,.5,h,d),o=r(h,e,p,i+1),s=r(d,e,f,i+1);for(var g=0;g<o;g++)n[g]=p[g];for(var g=0;g<s;g++)n[g+o]=f[g];return o+s},a=function(t,e){var n,i,o=0;n=i=Math.sgn(t[0].y);for(var s=1;s<=e;s++)n=Math.sgn(t[s].y),n!=i&&o++,i=n;return o},l=function(t,e){var i,o,s,r,a,l,u,c,h,d,p,f,g,m,v,y;l=t[0].y-t[e].y,u=t[e].x-t[0].x,c=t[0].x*t[e].y-t[e].x*t[0].y;for(var b=max_distance_below=0,P=1;P<e;P++){var _=l*t[P].x+u*t[P].y+c;_>b?b=_:_<max_distance_below&&(max_distance_below=_)}return p=0,f=1,g=0,m=l,v=u,y=c-b,h=p*v-m*f,d=1/h,o=(f*y-v*g)*d,m=l,v=u,y=c-max_distance_below,h=p*v-m*f,d=1/h,s=(f*y-v*g)*d,r=Math.min(o,s),a=Math.max(o,s),i=a-r,i<n?1:0},u=function(t,e){var n=t[e].x-t[0].x,i=t[e].y-t[0].y,o=t[0].x-0;return 0+(n*(t[0].y-0)-i*o)*(1/(0*n-1*i))*1},c=function(t,e,n,i,o){for(var s=[[]],r=0;r<=e;r++)s[0][r]=t[r];for(var a=1;a<=e;a++)for(var r=0;r<=e-a;r++)s[a]||(s[a]=[]),s[a][r]||(s[a][r]={}),s[a][r].x=(1-n)*s[a-1][r].x+n*s[a-1][r+1].x,s[a][r].y=(1-n)*s[a-1][r].y+n*s[a-1][r+1].y;if(null!=i)for(r=0;r<=e;r++)i[r]=s[r][0];if(null!=o)for(r=0;r<=e;r++)o[r]=s[e-r][r];return s[e][0]},h={},d=function(t){var e=h[t];if(!e){e=[];var n=function(){return function(e){return Math.pow(e,t)}},i=function(){return function(e){return Math.pow(1-e,t)}},o=function(t){return function(e){return t}},s=function(){return function(t){return t}},r=function(){return function(t){return 1-t}},a=function(t){return function(e){for(var n=1,i=0;i<t.length;i++)n*=t[i](e);return n}};e.push(new n);for(var l=1;l<t;l++){for(var u=[new o(t)],c=0;c<t-l;c++)u.push(new s);for(var c=0;c<l;c++)u.push(new r);e.push(new a(u))}e.push(new i),h[t]=e}return e},p=function(t,e){for(var n=d(t.length-1),i=0,o=0,s=0;s<t.length;s++)i+=t[s].x*n[s](e),o+=t[s].y*n[s](e);return{x:i,y:o}},f=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},g=function(t){return t[0].x==t[1].x&&t[0].y==t[1].y},m=function(t,e,n){if(g(t))return{point:t[0],location:e};for(var i=p(t,e),o=0,s=e,r=n>0?1:-1,a=null;o<Math.abs(n);)s+=.005*r,a=p(t,s),o+=f(a,i),i=a;return{point:a,location:s}},v=function(t){if(g(t))return 0;for(var e=p(t,0),n=0,i=0,o=null;i<1;)i+=.005,o=p(t,i),n+=f(o,e),e=o;return n},y=function(t,e,n){return m(t,e,n).point},b=function(t,e,n){return m(t,e,n).location},P=function(t,e){var n=p(t,e),i=p(t.slice(0,t.length-1),e),o=i.y-n.y,s=i.x-n.x;return 0==o?1/0:Math.atan(o/s)},_=function(t,e,n){var i=m(t,e,n);return i.location>1&&(i.location=1),i.location<0&&(i.location=0),P(t,i.location)},x=function(t,e,n,i){i=null==i?0:i;var o=m(t,e,i),s=P(t,o.location),r=Math.atan(-1/s),a=n/2*Math.sin(r),l=n/2*Math.cos(r);return[{x:o.point.x+l,y:o.point.y+a},{x:o.point.x-l,y:o.point.y-a}]},C=this.jsBezier={distanceFromCurve:i,gradientAtPoint:P,gradientAtPointAlongCurveFrom:_,nearestPointOnCurve:o,pointOnCurve:p,pointAlongCurveFrom:y,perpendicularToCurveAt:x,locationAlongCurveFrom:b,getLength:v,version:"0.9.0"};e.jsBezier=C}).call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,n=t.Biltong={version:"0.4.0"};e.Biltong=n;var i=function(t){return"[object Array]"===Object.prototype.toString.call(t)},o=function(t,e,n){return t=i(t)?t:[t.x,t.y],e=i(e)?e:[e.x,e.y],n(t,e)},s=n.gradient=function(t,e){return o(t,e,function(t,e){return e[0]==t[0]?e[1]>t[1]?1/0:-1/0:e[1]==t[1]?e[0]>t[0]?0:-0:(e[1]-t[1])/(e[0]-t[0])})},r=(n.normal=function(t,e){return-1/s(t,e)},n.lineLength=function(t,e){return o(t,e,function(t,e){return Math.sqrt(Math.pow(e[1]-t[1],2)+Math.pow(e[0]-t[0],2))})},n.quadrant=function(t,e){return o(t,e,function(t,e){return e[0]>t[0]?e[1]>t[1]?2:1:e[0]==t[0]?e[1]>t[1]?2:1:e[1]>t[1]?3:4})}),a=(n.theta=function(t,e){return o(t,e,function(t,e){var n=s(t,e),i=Math.atan(n),o=r(t,e);return 4!=o&&3!=o||(i+=Math.PI),i<0&&(i+=2*Math.PI),i})},n.intersects=function(t,e){var n=t.x,i=t.x+t.w,o=t.y,s=t.y+t.h,r=e.x,a=e.x+e.w,l=e.y,u=e.y+e.h;return n<=r&&r<=i&&o<=l&&l<=s||n<=a&&a<=i&&o<=l&&l<=s||n<=r&&r<=i&&o<=u&&u<=s||n<=a&&r<=i&&o<=u&&u<=s||r<=n&&n<=a&&l<=o&&o<=u||r<=i&&i<=a&&l<=o&&o<=u||r<=n&&n<=a&&l<=s&&s<=u||r<=i&&n<=a&&l<=s&&s<=u},n.encloses=function(t,e,n){var i=t.x,o=t.x+t.w,s=t.y,r=t.y+t.h,a=e.x,l=e.x+e.w,u=e.y,c=e.y+e.h,h=function(t,e,i,o){return n?t<=e&&i>=o:t<e&&i>o};return h(i,a,o,l)&&h(s,u,r,c)},[null,[1,-1],[1,1],[-1,1],[-1,-1]]),l=[null,[-1,-1],[-1,1],[1,1],[1,-1]];n.pointOnLine=function(t,e,n){var i=s(t,e),o=r(t,e),u=n>0?a[o]:l[o],c=Math.atan(i),h=Math.abs(n*Math.sin(c))*u[1],d=Math.abs(n*Math.cos(c))*u[0];return{x:t.x+d,y:t.y+h}},n.perpendicularLineTo=function(t,e,n){var i=s(t,e),o=Math.atan(-1/i),r=n/2*Math.sin(o),a=n/2*Math.cos(o);return[{x:e.x+a,y:e.y+r},{x:e.x-a,y:e.y-r}]}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,n={android:navigator.userAgent.toLowerCase().indexOf("android")>-1},i=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),o=0;o<i.length;o++)if(i[o]===t)return!0;return!1},o=function(t){return"string"==typeof t||t.constructor===String?document.getElementById(t):t},s=function(t){return t.srcElement||t.target},r=function(t,e,n,i){if(i){if(void 0!==t.path&&t.path.indexOf)return{path:t.path,end:t.path.indexOf(n)};var o={path:[],end:-1},s=function(t){o.path.push(t),t===n?o.end=o.path.length-1:null!=t.parentNode&&s(t.parentNode)};return s(e),o}return{path:[e],end:1}},a=function(t,e){for(var n=0,i=t.length;n<i&&t[n]!=e;n++);n<t.length&&t.splice(n,1)},l=1,u=function(t,e,n){var i=l++;return t.__ta=t.__ta||{},t.__ta[e]=t.__ta[e]||{},t.__ta[e][i]=n,n.__tauid=i,i},c=function(t,e,n){if(t.__ta&&t.__ta[e]&&delete t.__ta[e][n.__tauid],n.__taExtra){for(var i=0;i<n.__taExtra.length;i++)O(t,n.__taExtra[i][0],n.__taExtra[i][1]);n.__taExtra.length=0}n.__taUnstore&&n.__taUnstore()},h=function(t,e,n,o){if(null==t)return n;var a=t.split(","),l=function(o){l.__tauid=n.__tauid;var u=s(o),c=u,h=r(o,u,e,null!=t);if(-1!=h.end)for(var d=0;d<h.end;d++){c=h.path[d];for(var p=0;p<a.length;p++)i(c,a[p],e)&&n.apply(c,arguments)}};return d(n,o,l),l},d=function(t,e,n){t.__taExtra=t.__taExtra||[],t.__taExtra.push([e,n])},p=function(t,e,n,i){if(b&&_[e]){var o=h(i,t,n,_[e]);k(t,_[e],o,n)}"focus"===e&&null==t.getAttribute("tabindex")&&t.setAttribute("tabindex","1"),k(t,e,h(i,t,n,e),n)},f=function(t,e,n,i){if(null==t.__taSmartClicks){var o=function(e){t.__tad=j(e)},r=function(e){t.__tau=j(e)},l=function(e){if(t.__tad&&t.__tau&&t.__tad[0]===t.__tau[0]&&t.__tad[1]===t.__tau[1])for(var n=0;n<t.__taSmartClicks.length;n++)t.__taSmartClicks[n].apply(s(e),[e])};p(t,"mousedown",o,i),p(t,"mouseup",r,i),p(t,"click",l,i),t.__taSmartClicks=[]}t.__taSmartClicks.push(n),n.__taUnstore=function(){a(t.__taSmartClicks,n)}},g={tap:{touches:1,taps:1},dbltap:{touches:1,taps:2},contextmenu:{touches:2,taps:1}},m=function(t,e){return function(n,o,l,u){if("contextmenu"==o&&P)p(n,o,l,u);else{if(null==n.__taTapHandler){var c=n.__taTapHandler={tap:[],dbltap:[],contextmenu:[],down:!1,taps:0,downSelectors:[]},h=function(o){for(var a=s(o),l=r(o,a,n,null!=u),h=!1,d=0;d<l.end;d++){if(h)return;a=l.path[d];for(var p=0;p<c.downSelectors.length;p++)if(null==c.downSelectors[p]||i(a,c.downSelectors[p],n)){c.down=!0,setTimeout(f,t),setTimeout(m,e),h=!0;break}}},d=function(t){if(c.down){var e,o,a=s(t);c.taps++;var l=A(t);for(var u in g)if(g.hasOwnProperty(u)){var h=g[u];if(h.touches===l&&(1===h.taps||h.taps===c.taps))for(var d=0;d<c[u].length;d++){o=r(t,a,n,null!=c[u][d][1]);for(var p=0;p<o.end;p++)if(e=o.path[p],null==c[u][d][1]||i(e,c[u][d][1],n)){c[u][d][0].apply(e,[t]);break}}}}},f=function(){c.down=!1},m=function(){c.taps=0};p(n,"mousedown",h),p(n,"mouseup",d)}n.__taTapHandler.downSelectors.push(u),n.__taTapHandler[o].push([l,u]),l.__taUnstore=function(){a(n.__taTapHandler[o],l)}}}},v=function(t,e,n,i){for(var o in n.__tamee[t])n.__tamee[t].hasOwnProperty(o)&&n.__tamee[t][o].apply(i,[e])},y=function(){var t=[];return function(e,n,o,r){if(!e.__tamee){e.__tamee={over:!1,mouseenter:[],mouseexit:[]};var a=function(n){var o=s(n);(null==r&&o==e&&!e.__tamee.over||i(o,r,e)&&(null==o.__tamee||!o.__tamee.over))&&(v("mouseenter",n,e,o),o.__tamee=o.__tamee||{},o.__tamee.over=!0,t.push(o))},l=function(n){for(var o=s(n),r=0;r<t.length;r++)o!=t[r]||i(n.relatedTarget||n.toElement,"*",o)||(o.__tamee.over=!1,t.splice(r,1),v("mouseexit",n,e,o))};k(e,"mouseover",h(r,e,a,"mouseover"),a),k(e,"mouseout",h(r,e,l,"mouseout"),l)}o.__taUnstore=function(){delete e.__tamee[n][o.__tauid]},u(e,n,o),e.__tamee[n][o.__tauid]=o}},b="ontouchstart"in document.documentElement,P="onmousedown"in document.documentElement,_={mousedown:"touchstart",mouseup:"touchend",mousemove:"touchmove"},x=function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))}return t}(),C=x>-1&&x<9,E=function(t,e){if(null==t)return[0,0];var n=I(t),i=w(n,0);return[i[e+"X"],i[e+"Y"]]},j=function(t){return null==t?[0,0]:C?[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop]:E(t,"page")},S=function(t){return E(t,"screen")},D=function(t){return E(t,"client")},w=function(t,e){return t.item?t.item(e):t[e]},I=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},A=function(t){return I(t).length},k=function(t,e,n,i){if(u(t,e,n),i.__tauid=n.__tauid,t.addEventListener)t.addEventListener(e,n,!1);else if(t.attachEvent){var o=e+n.__tauid;t["e"+o]=n,t[o]=function(){t["e"+o]&&t["e"+o](window.event)},t.attachEvent("on"+e,t[o])}},O=function(t,e,n){null!=n&&T(t,function(){var i=o(this);if(c(i,e,n),null!=n.__tauid)if(i.removeEventListener)i.removeEventListener(e,n,!1),b&&_[e]&&i.removeEventListener(_[e],n,!1);else if(this.detachEvent){var s=e+n.__tauid;i[s]&&i.detachEvent("on"+e,i[s]),i[s]=null,i["e"+s]=null}n.__taTouchProxy&&O(t,n.__taTouchProxy[1],n.__taTouchProxy[0])})},T=function(t,e){if(null!=t){t="undefined"!=typeof Window&&"unknown"!=typeof t.top&&t==t.top?[t]:"string"!=typeof t&&null==t.tagName&&null!=t.length?t:"string"==typeof t?document.querySelectorAll(t):[t];for(var n=0;n<t.length;n++)e.apply(t[n])}};t.Mottle=function(t){t=t||{};var e=t.clickThreshold||250,i=t.dblClickThreshold||450,s=new y,r=new m(e,i),a=t.smartClicks,l=function(t,e,n,i){null!=n&&T(t,function(){var t=o(this);a&&"click"===e?f(t,0,n,i):"tap"===e||"dbltap"===e||"contextmenu"===e?r(t,e,n,i):"mouseenter"===e||"mouseexit"==e?s(t,e,n,i):p(t,e,n,i)})};this.remove=function(t){return T(t,function(){var t=o(this);if(t.__ta)for(var e in t.__ta)if(t.__ta.hasOwnProperty(e))for(var n in t.__ta[e])t.__ta[e].hasOwnProperty(n)&&O(t,e,t.__ta[e][n]);t.parentNode&&t.parentNode.removeChild(t)}),this},this.on=function(t,e,n,i){var o=arguments[0],s=4==arguments.length?arguments[2]:null,r=arguments[1],a=arguments[arguments.length-1];return l(o,r,a,s),this},this.off=function(t,e,n){return O(t,e,n),this},this.trigger=function(t,e,i,s){var r=P&&("undefined"==typeof MouseEvent||null==i||i.constructor===MouseEvent),a=b&&!P&&_[e]?_[e]:e,l=!(b&&!P&&_[e]),u=j(i),c=S(i),h=D(i);return T(t,function(){var t,d=o(this);i=i||{screenX:c[0],screenY:c[1],clientX:h[0],clientY:h[1]};var p=function(t){s&&(t.payload=s)},f={TouchEvent:function(t){var e=document.createTouch(window,d,0,u[0],u[1],c[0],c[1],h[0],h[1],0,0,0,0),n=document.createTouchList(e),i=document.createTouchList(e),o=document.createTouchList(e);t.initTouchEvent(a,!0,!0,window,null,c[0],c[1],h[0],h[1],!1,!1,!1,!1,n,i,o,1,0)},MouseEvents:function(t){if(t.initMouseEvent(a,!0,!0,window,0,c[0],c[1],h[0],h[1],!1,!1,!1,!1,1,d),n.android){var e=document.createTouch(window,d,0,u[0],u[1],c[0],c[1],h[0],h[1],0,0,0,0);t.touches=t.targetTouches=t.changedTouches=document.createTouchList(e)}}};if(document.createEvent){var g=!l&&!r&&b&&_[e]&&!n.android,m=g?"TouchEvent":"MouseEvents";t=document.createEvent(m),f[m](t),p(t),d.dispatchEvent(t)}else document.createEventObject&&(t=document.createEventObject(),t.eventType=t.eventName=a,t.screenX=c[0],t.screenY=c[1],t.clientX=h[0],t.clientY=h[1],p(t),d.fireEvent("on"+a,t))}),this}},t.Mottle.consume=function(t,e){t.stopPropagation?t.stopPropagation():t.returnValue=!1,!e&&t.preventDefault&&t.preventDefault()},t.Mottle.pageLocation=j,t.Mottle.setForceTouchEvents=function(t){b=t},t.Mottle.setForceMouseEvents=function(t){P=t},t.Mottle.version="0.8.0",e.Mottle=t.Mottle}.call("undefined"==typeof window?this:window),function(){"use strict";var t=this,n=function(t,e,n){return-1===t.indexOf(e)&&(n?t.unshift(e):t.push(e),!0)},i=function(t,e){var n=t.indexOf(e);-1!=n&&t.splice(n,1)},o=function(t,e){for(var n=[],i=0;i<t.length;i++)-1==e.indexOf(t[i])&&n.push(t[i]);return n},s=function(t){return null!=t&&("string"==typeof t||t.constructor==String)},r=function(t){var e=t.getBoundingClientRect(),n=document.body,i=document.documentElement,o=window.pageYOffset||i.scrollTop||n.scrollTop,s=window.pageXOffset||i.scrollLeft||n.scrollLeft,r=i.clientTop||n.clientTop||0,a=i.clientLeft||n.clientLeft||0,l=e.top+o-r,u=e.left+s-a;return{top:Math.round(l),left:Math.round(u)}},a=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),o=0;o<i.length;o++)if(i[o]===t)return!0;return!1},l=function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))}return t}(),u=l>-1&&l<9,c=9==l,h=function(t){if(u)return[t.clientX+document.documentElement.scrollLeft,t.clientY+document.documentElement.scrollTop];var e=p(t),n=d(e,0);return c?[n.pageX||n.clientX,n.pageY||n.clientY]:[n.pageX,n.pageY]},d=function(t,e){return t.item?t.item(e):t[e]},p=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},f={draggable:"katavorio-draggable",droppable:"katavorio-droppable",drag:"katavorio-drag",selected:"katavorio-drag-selected",active:"katavorio-drag-active",hover:"katavorio-drag-hover",noSelect:"katavorio-drag-no-select",ghostProxy:"katavorio-ghost-proxy"},g=["stop","start","drag","drop","over","out","beforeStart"],m=function(){},v=function(){return!0},y=function(t,e,n){for(var i=0;i<t.length;i++)t[i]!=n&&e(t[i])},b=function(t,e,n,i){y(t,function(t){t.setActive(e),e&&t.updatePosition(),n&&t.setHover(i,e)})},P=function(t,e){if(null!=t){t=s(t)||null!=t.tagName||null==t.length?[t]:t;for(var n=0;n<t.length;n++)e.apply(t[n],[t[n]])}},_=function(t){t.stopPropagation?(t.stopPropagation(),t.preventDefault()):t.returnValue=!1},x=function(t,e,n){var i=t.srcElement||t.target;return!a(i,n.getInputFilterSelector(),e)},C=function(t,e,n,i){this.params=e||{},this.el=t,this.params.addClass(this.el,this._class),this.uuid=w();var o=!0;return this.setEnabled=function(t){o=t},this.isEnabled=function(){return o},this.toggleEnabled=function(){o=!o},this.setScope=function(t){this.scopes=t?t.split(/\s+/):[i]},this.addScope=function(t){var e={};P(this.scopes,function(t){e[t]=!0}),P(t?t.split(/\s+/):[],function(t){e[t]=!0}),this.scopes=[];for(var n in e)this.scopes.push(n)},this.removeScope=function(t){var e={};P(this.scopes,function(t){e[t]=!0}),P(t?t.split(/\s+/):[],function(t){delete e[t]}),this.scopes=[];for(var n in e)this.scopes.push(n)},this.toggleScope=function(t){var e={};P(this.scopes,function(t){e[t]=!0}),P(t?t.split(/\s+/):[],function(t){e[t]?delete e[t]:e[t]=!0}),this.scopes=[];for(var n in e)this.scopes.push(n)},this.setScope(e.scope),this.k=e.katavorio,e.katavorio},E=function(){return!0},j=function(){return!1},S=function(t,e,n,i){this._class=n.draggable;var o=C.apply(this,arguments);this.rightButtonCanDrag=this.params.rightButtonCanDrag;var l=[0,0],u=null,c=null,d=[0,0],p=!1,g=!1!==this.params.consumeStartEvent,m=this.el,y=this.params.clone,P=(this.params.scroll,!1!==e.multipleDrop),S=!1,D=!0===e.ghostProxy?E:e.ghostProxy&&"function"==typeof e.ghostProxy?e.ghostProxy:j,A=function(t){return t.cloneNode(!0)},k=e.snapThreshold,O=function(t,e,n,i,o){var s=Math.floor(t[0]/e),r=e*s,a=r+e,l=Math.abs(t[0]-r)<=i?r:Math.abs(a-t[0])<=i?a:t[0],u=Math.floor(t[1]/n),c=n*u,h=c+n;return[l,Math.abs(t[1]-c)<=o?c:Math.abs(h-t[1])<=o?h:t[1]]};this.posses=[],this.posseRoles={},this.toGrid=function(t){if(null==this.params.grid)return t;var e=this.params.grid?this.params.grid[0]/2:k||5,n=this.params.grid?this.params.grid[1]/2:k||5;return O(t,this.params.grid[0],this.params.grid[1],e,n)},this.snap=function(t,e){if(null!=m){t=t||(this.params.grid?this.params.grid[0]:10),e=e||(this.params.grid?this.params.grid[1]:10);var n=this.params.getPosition(m),i=this.params.grid?this.params.grid[0]/2:k,o=this.params.grid?this.params.grid[1]/2:k;this.params.setPosition(m,O(n,t,e,i,o))}},this.setUseGhostProxy=function(t){D=t?E:j};var T,M=function(t){return!1===e.allowNegative?[Math.max(0,t[0]),Math.max(0,t[1])]:t},L=function(t){T="function"==typeof t?t:t?function(t){return M([Math.max(0,Math.min(R.w-this.size[0],t[0])),Math.max(0,Math.min(R.h-this.size[1],t[1]))])}.bind(this):function(t){return M(t)}}.bind(this);L("function"==typeof this.params.constrain?this.params.constrain:this.params.constrain||this.params.containment),this.setConstrain=function(t){L(t)};var F;this.setRevert=function(t){F=t};var N=function(t){return"function"==typeof t?(t._katavorioId=w(),t._katavorioId):t},G={},U=function(t){for(var e in G){var n=G[e],i=n[0](t);if(n[1]&&(i=!i),!i)return!1}return!0},B=this.setFilter=function(e,n){if(e){var i=N(e);G[i]=[function(n){var i,o=n.srcElement||n.target;return s(e)?i=a(o,e,t):"function"==typeof e&&(i=e(n,t)),i},!1!==n]}};this.addFilter=B,this.removeFilter=function(t){var e="function"==typeof t?t._katavorioId:t;delete G[e]};this.clearAllFilters=function(){G={}},this.canDrag=this.params.canDrag||v;var R,H=[],Y=[];this.downListener=function(t){if((this.rightButtonCanDrag||3!==t.which&&2!==t.button)&&this.isEnabled()&&this.canDrag())if(U(t)&&x(t,this.el,this.k)){if(y){m=this.el.cloneNode(!0),m.setAttribute("id",null),m.style.position="absolute";var e=r(this.el);m.style.left=e.left+"px",m.style.top=e.top+"px",document.body.appendChild(m)}else m=this.el;g&&_(t),l=h(t),this.params.bind(document,"mousemove",this.moveListener),this.params.bind(document,"mouseup",this.upListener),o.markSelection(this),o.markPosses(this),this.params.addClass(document.body,n.noSelect),X("beforeStart",{el:this.el,pos:u,e:t,drag:this})}else this.params.consumeFilteredEvents&&_(t)}.bind(this),this.moveListener=function(t){if(l){if(!p){if(!1!==X("start",{el:this.el,pos:u,e:t,drag:this})){if(!l)return;this.mark(!0),p=!0}else this.abort()}if(l){Y.length=0;var e=h(t),n=e[0]-l[0],i=e[1]-l[1],s=this.params.ignoreZoom?1:o.getZoom();n/=s,i/=s,this.moveBy(n,i,t),o.updateSelection(n,i,this),o.updatePosses(n,i,this)}}}.bind(this),this.upListener=function(t){l&&(l=null,this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.params.removeClass(document.body,n.noSelect),this.unmark(t),o.unmarkSelection(this,t),o.unmarkPosses(this,t),this.stop(t),o.notifySelectionDragStop(this,t),o.notifyPosseDragStop(this,t),p=!1,y&&(m&&m.parentNode&&m.parentNode.removeChild(m),m=null),Y.length=0,F&&!0===F(this.el,this.params.getPosition(this.el))&&(this.params.setPosition(this.el,u),X("revert",this.el)))}.bind(this),this.getFilters=function(){return G},this.abort=function(){null!=l&&this.upListener()},this.getDragElement=function(){return m||this.el};var W={start:[],drag:[],stop:[],over:[],out:[],beforeStart:[],revert:[]};e.events.start&&W.start.push(e.events.start),e.events.beforeStart&&W.beforeStart.push(e.events.beforeStart),e.events.stop&&W.stop.push(e.events.stop),e.events.drag&&W.drag.push(e.events.drag),e.events.revert&&W.revert.push(e.events.revert),this.on=function(t,e){W[t]&&W[t].push(e)},this.off=function(t,e){if(W[t]){for(var n=[],i=0;i<W[t].length;i++)W[t][i]!==e&&n.push(W[t][i]);W[t]=n}};var X=function(t,e){var n=null;if(W[t])for(var i=0;i<W[t].length;i++)try{var o=W[t][i](e);null!=o&&(n=o)}catch(t){}return n};this.notifyStart=function(t){X("start",{el:this.el,pos:this.params.getPosition(m),e:t,drag:this})},this.stop=function(t,e){if(e||p){var n=[],i=o.getSelection(),s=this.params.getPosition(m);if(i.length>1)for(var r=0;r<i.length;r++){var a=this.params.getPosition(i[r].el);n.push([i[r].el,{left:a[0],top:a[1]},i[r]])}else n.push([m,{left:s[0],top:s[1]},this]);X("stop",{el:m,pos:z||s,finalPos:s,e:t,drag:this,selection:n})}},this.mark=function(t){u=this.params.getPosition(m),c=this.params.getPosition(m,!0),d=[c[0]-u[0],c[1]-u[1]],this.size=this.params.getSize(m),H=o.getMatchingDroppables(this),b(H,!0,!1,this),this.params.addClass(m,this.params.dragClass||n.drag);var e;e=this.params.getConstrainingRectangle?this.params.getConstrainingRectangle(m):this.params.getSize(m.parentNode),R={w:e[0],h:e[1]},t&&o.notifySelectionDragStart(this)};var z;this.unmark=function(t,i){if(b(H,!1,!0,this),S&&D(this.el)?(z=[m.offsetLeft,m.offsetTop],this.el.parentNode.removeChild(m),m=this.el):z=null,this.params.removeClass(m,this.params.dragClass||n.drag),H.length=0,S=!1,!i){Y.length>0&&z&&e.setPosition(this.el,z),Y.sort(I);for(var o=0;o<Y.length;o++){if(!0===Y[o].drop(this,t))break}}},this.moveBy=function(t,n,i){Y.length=0;var o=this.toGrid([u[0]+t,u[1]+n]),s=T(o,m);if(D(this.el))if(o[0]!=s[0]||o[1]!=s[1]){if(!S){var r=A(this.el);e.addClass(r,f.ghostProxy),this.el.parentNode.appendChild(r),m=r,S=!0}s=o}else S&&(this.el.parentNode.removeChild(m),m=this.el,S=!1);var a={x:s[0],y:s[1],w:this.size[0],h:this.size[1]},l={x:a.x+d[0],y:a.y+d[1],w:a.w,h:a.h},c=null;this.params.setPosition(m,s);for(var h=0;h<H.length;h++){var p={x:H[h].pagePosition[0],y:H[h].pagePosition[1],w:H[h].size[0],h:H[h].size[1]};this.params.intersects(l,p)&&(P||null==c||c==H[h].el)&&H[h].canDrop(this)?(c||(c=H[h].el),Y.push(H[h]),H[h].setHover(this,!0,i)):H[h].isHover()&&H[h].setHover(this,!1,i)}X("drag",{el:this.el,pos:s,e:i,drag:this})},this.destroy=function(){this.params.unbind(this.el,"mousedown",this.downListener),this.params.unbind(document,"mousemove",this.moveListener),this.params.unbind(document,"mouseup",this.upListener),this.downListener=null,this.upListener=null,this.moveListener=null},this.params.bind(this.el,"mousedown",this.downListener),this.params.handle?B(this.params.handle,!1):B(this.params.filter,this.params.filterExclude)},D=function(t,e,n,i){this._class=n.droppable,this.params=e||{},this.rank=e.rank||0,this._activeClass=this.params.activeClass||n.active,this._hoverClass=this.params.hoverClass||n.hover,C.apply(this,arguments);var o=!1;this.allowLoopback=!1!==this.params.allowLoopback,this.setActive=function(t){this.params[t?"addClass":"removeClass"](this.el,this._activeClass)},this.updatePosition=function(){this.position=this.params.getPosition(this.el),this.pagePosition=this.params.getPosition(this.el,!0),this.size=this.params.getSize(this.el)},this.canDrop=this.params.canDrop||function(t){return!0},this.isHover=function(){return o},this.setHover=function(t,e,n){(e||null==this.el._katavorioDragHover||this.el._katavorioDragHover==t.el._katavorio)&&(this.params[e?"addClass":"removeClass"](this.el,this._hoverClass),this.el._katavorioDragHover=e?t.el._katavorio:null,o!==e&&this.params.events[e?"over":"out"]({el:this.el,e:n,drag:t,drop:this}),o=e)},this.drop=function(t,e){return this.params.events.drop({drag:t,e:e,drop:this})},this.destroy=function(){this._class=null,this._activeClass=null,this._hoverClass=null,o=null}},w=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})},I=function(t,e){return t.rank<e.rank?1:t.rank>e.rank?-1:0},A=function(t){return null==t?null:null==(t="string"==typeof t||t.constructor==String?document.getElementById(t):t)?null:(t._katavorio=t._katavorio||w(),t)};t.Katavorio=function(t){var e=[],r={};this._dragsByScope={},this._dropsByScope={};var a=1,l=function(t,e){P(t,function(t){for(var n=0;n<t.scopes.length;n++)e[t.scopes[n]]=e[t.scopes[n]]||[],e[t.scopes[n]].push(t)})},u=function(e,n){var i=0;return P(e,function(e){for(var o=0;o<e.scopes.length;o++)if(n[e.scopes[o]]){var s=t.indexOf(n[e.scopes[o]],e);-1!=s&&(n[e.scopes[o]].splice(s,1),i++)}}),i>0},c=(this.getMatchingDroppables=function(t){for(var e=[],n={},i=0;i<t.scopes.length;i++){var o=this._dropsByScope[t.scopes[i]];if(o)for(var s=0;s<o.length;s++)!o[s].canDrop(t)||n[o[s].uuid]||!o[s].allowLoopback&&o[s].el===t.el||(n[o[s].uuid]=!0,e.push(o[s]))}return e.sort(I),e},function(e){e=e||{};var n,i={events:{}};for(n in t)i[n]=t[n];for(n in e)i[n]=e[n];for(n=0;n<g.length;n++)i.events[g[n]]=e[g[n]]||m;return i.katavorio=this,i}.bind(this)),h=function(t,e){for(var n=0;n<g.length;n++)e[g[n]]&&t.on(g[n],e[g[n]])}.bind(this),d={},p=t.css||{},v=t.scope||"katavorio-drag-scope";for(var b in f)d[b]=f[b];for(var b in p)d[b]=p[b];var _=t.inputFilterSelector||"input,textarea,select,button,option";this.getInputFilterSelector=function(){return _},this.setInputFilterSelector=function(t){return _=t,this},this.draggable=function(e,n){var i=[];return P(e,function(e){if(null!=(e=A(e)))if(null==e._katavorioDrag){var o=c(n);e._katavorioDrag=new S(e,o,d,v),l(e._katavorioDrag,this._dragsByScope),i.push(e._katavorioDrag),t.addClass(e,d.draggable)}else h(e._katavorioDrag,n)}.bind(this)),i},this.droppable=function(e,n){var i=[];return P(e,function(e){if(null!=(e=A(e))){var o=new D(e,c(n),d,v);e._katavorioDrop=e._katavorioDrop||[],e._katavorioDrop.push(o),l(o,this._dropsByScope),i.push(o),t.addClass(e,d.droppable)}}.bind(this)),i},this.select=function(n){return P(n,function(){var n=A(this);n&&n._katavorioDrag&&(r[n._katavorio]||(e.push(n._katavorioDrag),r[n._katavorio]=[n,e.length-1],t.addClass(n,d.selected)))}),this},this.deselect=function(n){return P(n,function(){var n=A(this);if(n&&n._katavorio){if(r[n._katavorio]){for(var i=[],o=0;o<e.length;o++)e[o].el!==n&&i.push(e[o]);e=i,delete r[n._katavorio],t.removeClass(n,d.selected)}}}),this},this.deselectAll=function(){for(var n in r){var i=r[n];t.removeClass(i[0],d.selected)}e.length=0,r={}},this.markSelection=function(t){y(e,function(t){t.mark()},t)},this.markPosses=function(t){t.posses&&P(t.posses,function(e){t.posseRoles[e]&&j[e]&&y(j[e].members,function(t){t.mark()},t)})},this.unmarkSelection=function(t,n){y(e,function(t){t.unmark(n)},t)},this.unmarkPosses=function(t,e){t.posses&&P(t.posses,function(n){t.posseRoles[n]&&j[n]&&y(j[n].members,function(t){t.unmark(e,!0)},t)})},this.getSelection=function(){return e.slice(0)},this.updateSelection=function(t,n,i){y(e,function(e){e.moveBy(t,n)},i)};var x=function(t,e){e.posses&&P(e.posses,function(n){e.posseRoles[n]&&j[n]&&y(j[n].members,function(e){t(e)},e)})};this.updatePosses=function(t,e,n){x(function(n){n.moveBy(t,e)},n)},this.notifyPosseDragStop=function(t,e){x(function(t){t.stop(e,!0)},t)},this.notifySelectionDragStop=function(t,n){y(e,function(t){t.stop(n,!0)},t)},this.notifySelectionDragStart=function(t,n){y(e,function(t){t.notifyStart(n)},t)},this.setZoom=function(t){a=t},this.getZoom=function(){return a};var C=function(t,e,n,i){P(t,function(t){u(t,n),t[i](e),l(t,n)})};P(["set","add","remove","toggle"],function(t){this[t+"Scope"]=function(e,n){C(e._katavorioDrag,n,this._dragsByScope,t+"Scope"),C(e._katavorioDrop,n,this._dropsByScope,t+"Scope")}.bind(this),this[t+"DragScope"]=function(e,n){C(e.constructor===S?e:e._katavorioDrag,n,this._dragsByScope,t+"Scope")}.bind(this),this[t+"DropScope"]=function(e,n){C(e.constructor===D?e:e._katavorioDrop,n,this._dropsByScope,t+"Scope")}.bind(this)}.bind(this)),this.snapToGrid=function(t,e){for(var n in this._dragsByScope)y(this._dragsByScope[n],function(n){n.snap(t,e)})},this.getDragsForScope=function(t){return this._dragsByScope[t]},this.getDropsForScope=function(t){return this._dropsByScope[t]};var E=function(t,n,i){if(t=A(t),t[n]){var o=e.indexOf(t[n]);o>=0&&e.splice(o,1),u(t[n],i)&&P(t[n],function(t){t.destroy()}),delete t[n]}};this.elementRemoved=function(t){this.destroyDraggable(t),this.destroyDroppable(t)},this.destroyDraggable=function(t){E(t,"_katavorioDrag",this._dragsByScope)},this.destroyDroppable=function(t){E(t,"_katavorioDrop",this._dropsByScope)},this.reset=function(){this._dragsByScope={},this._dropsByScope={},e=[],r={},j={}};var j={},w=function(t,e,i){var o=s(e)?e:e.id,r=!!s(e)||!1!==e.active,a=j[o]||function(){var t={name:o,members:[]};return j[o]=t,t}();return P(t,function(t){if(t._katavorioDrag){if(i&&null!=t._katavorioDrag.posseRoles[a.name])return;n(a.members,t._katavorioDrag),n(t._katavorioDrag.posses,a.name),t._katavorioDrag.posseRoles[a.name]=r}}),a};this.addToPosse=function(t,e){for(var n=[],i=1;i<arguments.length;i++)n.push(w(t,arguments[i]));return 1==n.length?n[0]:n},this.setPosse=function(t,e){for(var n=[],i=1;i<arguments.length;i++)n.push(w(t,arguments[i],!0).name);return P(t,function(t){if(t._katavorioDrag){var e=o(t._katavorioDrag.posses,n),i=[];Array.prototype.push.apply(i,t._katavorioDrag.posses);for(var s=0;s<e.length;s++)this.removeFromPosse(t,e[s])}}.bind(this)),1==n.length?n[0]:n},this.removeFromPosse=function(t,e){if(arguments.length<2)throw new TypeError("No posse id provided for remove operation");for(var n=1;n<arguments.length;n++)e=arguments[n],P(t,function(t){if(t._katavorioDrag&&t._katavorioDrag.posses){var n=t._katavorioDrag;P(e,function(t){i(j[t].members,n),i(n.posses,t),delete n.posseRoles[t]})}})},this.removeFromAllPosses=function(t){P(t,function(t){if(t._katavorioDrag&&t._katavorioDrag.posses){var e=t._katavorioDrag;P(e.posses,function(t){i(j[t].members,e)}),e.posses.length=0,e.posseRoles={}}})},this.setPosseState=function(t,e,n){var i=j[e];i&&P(t,function(t){t._katavorioDrag&&t._katavorioDrag.posses&&(t._katavorioDrag.posseRoles[i.name]=n)})}},t.Katavorio.version="0.19.3",e.Katavorio=t.Katavorio}.call("undefined"!=typeof window?window:this),function(){var t=function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=function(t){return"[object Number]"===Object.prototype.toString.call(t)},i=function(t){return"string"==typeof t},o=function(t){return"boolean"==typeof t},s=function(t){return null==t},r=function(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)},a=function(t){return"[object Date]"===Object.prototype.toString.call(t)},l=function(t){return"[object Function]"===Object.prototype.toString.call(t)},u=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},c=this;c.jsPlumbUtil={isArray:t,isString:i,isBoolean:o,isNull:s,isObject:r,isDate:a,isFunction:l,isEmpty:u,isNumber:n,clone:function(e){if(i(e))return""+e;if(o(e))return!!e;if(a(e))return new Date(e.getTime());if(l(e))return e;if(t(e)){for(var n=[],s=0;s<e.length;s++)n.push(this.clone(e[s]));return n}if(r(e)){var u={};for(var c in e)u[c]=this.clone(e[c]);return u}return e},merge:function(e,n,s){var a,l,u={};for(s=s||[],l=0;l<s.length;l++)u[s[l]]=!0;var c=this.clone(e);for(l in n)if(null==c[l])c[l]=n[l];else if(i(n[l])||o(n[l]))u[l]?(a=[],a.push.apply(a,t(c[l])?c[l]:[c[l]]),a.push.apply(a,t(n[l])?n[l]:[n[l]]),c[l]=a):c[l]=n[l];else if(t(n[l]))a=[],t(c[l])&&a.push.apply(a,c[l]),a.push.apply(a,n[l]),c[l]=a;else if(r(n[l])){r(c[l])||(c[l]={});for(var h in n[l])c[l][h]=n[l][h]}return c},replace:function(t,e,n){if(null!=t){var i=t,o=i;return e.replace(/([^\.])+/g,function(t,e,i,s){var r=t.match(/([^\[0-9]+){1}(\[)([0-9+])/),a=i+t.length>=s.length,l=function(){return o[r[1]]||function(){return o[r[1]]=[],o[r[1]]}()};if(a)r?l()[r[3]]=n:o[t]=n;else if(r){var u=l();o=u[r[3]]||function(){return u[r[3]]={},u[r[3]]}()}else o=o[t]||function(){return o[t]={},o[t]}()}),t}},functionChain:function(t,e,n){for(var i=0;i<n.length;i++){var o=n[i][0][n[i][1]].apply(n[i][0],n[i][2]);if(o===e)return o}return t},populate:function(e,n,o){var s=function(t){var e=t.match(/(\${.*?})/g);if(null!=e)for(var i=0;i<e.length;i++){var o=n[e[i].substring(2,e[i].length-1)]||"";null!=o&&(t=t.replace(e[i],o))}return t},a=function(e){if(null!=e){if(i(e))return s(e);if(!l(e)||null!=o&&0!==(e.name||"").indexOf(o)){if(t(e)){for(var u=[],c=0;c<e.length;c++)u.push(a(e[c]));return u}if(r(e)){var h={};for(var d in e)h[d]=a(e[d]);return h}return e}return e(n)}};return a(e)},findWithFunction:function(t,e){if(t)for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1},removeWithFunction:function(t,e){var n=c.jsPlumbUtil.findWithFunction(t,e);return n>-1&&t.splice(n,1),-1!==n},remove:function(t,e){var n=t.indexOf(e);return n>-1&&t.splice(n,1),-1!==n},addWithFunction:function(t,e,n){-1===c.jsPlumbUtil.findWithFunction(t,n)&&t.push(e)},addToList:function(t,e,n,i){var o=t[e];return null==o&&(o=[],t[e]=o),o[i?"unshift":"push"](n),o},suggest:function(t,e,n){return-1===t.indexOf(e)&&(n?t.unshift(e):t.push(e),!0)},extend:function(e,n,i){var o;for(n=t(n)?n:[n],o=0;o<n.length;o++)for(var s in n[o].prototype)n[o].prototype.hasOwnProperty(s)&&(e.prototype[s]=n[o].prototype[s]);var r=function(t,e){return function(){for(o=0;o<n.length;o++)n[o].prototype[t]&&n[o].prototype[t].apply(this,arguments);return e.apply(this,arguments)}};if(arguments.length>2)for(o=2;o<arguments.length;o++)!function(t){for(var n in t)e.prototype[n]=r(n,t[n])}(arguments[o]);return e},uuid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})},logEnabled:!0,log:function(){if(c.jsPlumbUtil.logEnabled&&"undefined"!=typeof console)try{var t=arguments[arguments.length-1];console.log(t)}catch(t){}},wrap:function(t,e,n){return function(){var i=null;try{null!=e&&(i=e.apply(this,arguments))}catch(t){c.jsPlumbUtil.log("jsPlumb function failed : "+t)}if(null!=t&&(null==n||i!==n))try{i=t.apply(this,arguments)}catch(t){c.jsPlumbUtil.log("wrapped function failed : "+t)}return i}}},c.jsPlumbUtil.EventGenerator=function(){var t={},e=!1,n=!1,i={ready:!0},o=[];this.bind=function(e,n,i){var o=function(e){c.jsPlumbUtil.addToList(t,e,n,i),n.__jsPlumb=n.__jsPlumb||{},n.__jsPlumb[c.jsPlumbUtil.uuid()]=e};if("string"==typeof e)o(e);else if(null!=e.length)for(var s=0;s<e.length;s++)o(e[s]);return this},this.fire=function(r,a,l){if(n)o.unshift(arguments);else{if(n=!0,!e&&t[r]){var u=t[r].length,h=0,d=!1,p=null;if(!this.shouldFireEvent||this.shouldFireEvent(r,a,l))for(;!d&&h<u&&!1!==p;){if(i[r])t[r][h].apply(this,[a,l]);else try{p=t[r][h].apply(this,[a,l])}catch(t){c.jsPlumbUtil.log("jsPlumb: fire failed for event "+r+" : "+t)}h++,null!=t&&null!=t[r]||(d=!0)}}n=!1,s()}return this};var s=function(){var t=o.pop();t&&this.fire.apply(this,t)}.bind(this);this.unbind=function(e,n){if(0===arguments.length)t={};else if(1===arguments.length){if("string"==typeof e)delete t[e];else if(e.__jsPlumb){var i;for(var o in e.__jsPlumb)i=e.__jsPlumb[o],c.jsPlumbUtil.remove(t[i]||[],e)}}else 2===arguments.length&&c.jsPlumbUtil.remove(t[e]||[],n);return this},this.getListener=function(e){return t[e]},this.setSuspendEvents=function(t){e=t},this.isSuspendEvents=function(){return e},this.silently=function(t){this.setSuspendEvents(!0);try{t()}catch(t){c.jsPlumbUtil.log("Cannot execute silent function "+t)}this.setSuspendEvents(!1)},this.cleanupListeners=function(){for(var e in t)t[e]=null}},c.jsPlumbUtil.EventGenerator.prototype={cleanup:function(){this.cleanupListeners()}},e.jsPlumbUtil=c.jsPlumbUtil}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this;t.jsPlumbUtil.matchesSelector=function(t,e,n){n=n||t.parentNode;for(var i=n.querySelectorAll(e),o=0;o<i.length;o++)if(i[o]===t)return!0;return!1},t.jsPlumbUtil.consume=function(t,e){t.stopPropagation?t.stopPropagation():t.returnValue=!1,!e&&t.preventDefault&&t.preventDefault()},t.jsPlumbUtil.sizeElement=function(t,e,n,i,o){t&&(t.style.height=o+"px",t.height=o,t.style.width=i+"px",t.width=i,t.style.left=e+"px",t.style.top=n+"px")}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t,n=this,i=[],o=n.jsPlumbUtil,s=function(){return""+(new Date).getTime()},r=function(t){if(t._jsPlumb.paintStyle&&t._jsPlumb.hoverPaintStyle){var e={};y.extend(e,t._jsPlumb.paintStyle),y.extend(e,t._jsPlumb.hoverPaintStyle),delete t._jsPlumb.hoverPaintStyle,e.gradient&&t._jsPlumb.paintStyle.fill&&delete e.gradient,t._jsPlumb.hoverPaintStyle=e}},a=["tap","dbltap","click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu"],l=function(t,e,n,i){var o=t.getAttachedElements();if(o)for(var s=0,r=o.length;s<r;s++)i&&i===o[s]||o[s].setHover(e,!0,n)},u=function(t){return null==t?null:t.split(" ")},c=function(t,e,n){for(var i in e)t[i]=n},h=function(t,e){e=o.isArray(e)||null!=e.length&&!o.isString(e)?e:[e];for(var n=0;n<e.length;n++)try{t.apply(e[n],[e[n]])}catch(t){o.log(".each iteration failed : "+t)}},d=function(t,e,n){if(t.getDefaultType){var i=t.getTypeDescriptor(),s={},r=t.getDefaultType(),a=o.merge({},r);c(s,r,"__default");for(var l=0,u=t._jsPlumb.types.length;l<u;l++){var h=t._jsPlumb.types[l];if("__default"!==h){var d=t._jsPlumb.instance.getType(h,i);null!=d&&(a=o.merge(a,d,["cssClass"]),c(s,d,h))}}e&&(a=o.populate(a,e,"_")),t.applyType(a,n,s),n||t.repaint()}},p=n.jsPlumbUIComponent=function(t){o.EventGenerator.apply(this,arguments);var e=this,n=arguments,i=e.idPrefix,s=i+(new Date).getTime();this._jsPlumb={instance:t._jsPlumb,parameters:t.parameters||{},paintStyle:null,hoverPaintStyle:null,paintStyleInUse:null,hover:!1,beforeDetach:t.beforeDetach,beforeDrop:t.beforeDrop,overlayPlacements:[],hoverClass:t.hoverClass||t._jsPlumb.Defaults.HoverClass,types:[],typeCache:{}},this.cacheTypeItem=function(t,e,n){this._jsPlumb.typeCache[n]=this._jsPlumb.typeCache[n]||{},this._jsPlumb.typeCache[n][t]=e},this.getCachedTypeItem=function(t,e){return this._jsPlumb.typeCache[e]?this._jsPlumb.typeCache[e][t]:null},this.getId=function(){return s};var r=t.overlays||[],a={};if(this.defaultOverlayKeys){for(var l=0;l<this.defaultOverlayKeys.length;l++)Array.prototype.push.apply(r,this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[l]]||[]);for(l=0;l<r.length;l++){var u=y.convertToFullOverlaySpec(r[l]);a[u[1].id]=u}}var c={overlays:a,parameters:t.parameters||{},scope:t.scope||this._jsPlumb.instance.getDefaultScope()};if(this.getDefaultType=function(){return c},this.appendToDefaultType=function(t){for(var e in t)c[e]=t[e]},t.events)for(var h in t.events)e.bind(h,t.events[h]);this.clone=function(){var t=Object.create(this.constructor.prototype);return this.constructor.apply(t,n),t}.bind(this),this.isDetachAllowed=function(t){var e=!0;if(this._jsPlumb.beforeDetach)try{e=this._jsPlumb.beforeDetach(t)}catch(t){o.log("jsPlumb: beforeDetach callback failed",t)}return e},this.isDropAllowed=function(t,e,n,i,s,r,a){var l=this._jsPlumb.instance.checkCondition("beforeDrop",{sourceId:t,targetId:e,scope:n,connection:i,dropEndpoint:s,source:r,target:a});if(this._jsPlumb.beforeDrop)try{l=this._jsPlumb.beforeDrop({sourceId:t,targetId:e,scope:n,connection:i,dropEndpoint:s,source:r,target:a})}catch(t){o.log("jsPlumb: beforeDrop callback failed",t)}return l};var d=[];this.setListenerComponent=function(t){for(var e=0;e<d.length;e++)d[e][3]=t}},f=function(t,e){var n=t._jsPlumb.types[e],i=t._jsPlumb.instance.getType(n,t.getTypeDescriptor());null!=i&&i.cssClass&&t.canvas&&t._jsPlumb.instance.removeClass(t.canvas,i.cssClass)};o.extend(n.jsPlumbUIComponent,o.EventGenerator,{getParameter:function(t){return this._jsPlumb.parameters[t]},setParameter:function(t,e){this._jsPlumb.parameters[t]=e},getParameters:function(){return this._jsPlumb.parameters},setParameters:function(t){this._jsPlumb.parameters=t},getClass:function(){return y.getClass(this.canvas)},hasClass:function(t){return y.hasClass(this.canvas,t)},addClass:function(t){y.addClass(this.canvas,t)},removeClass:function(t){y.removeClass(this.canvas,t)},updateClasses:function(t,e){y.updateClasses(this.canvas,t,e)},setType:function(t,e,n){this.clearTypes(),this._jsPlumb.types=u(t)||[],d(this,e,n)},getType:function(){return this._jsPlumb.types},reapplyTypes:function(t,e){d(this,t,e)},hasType:function(t){return-1!==this._jsPlumb.types.indexOf(t)},addType:function(t,e,n){var i=u(t),o=!1;if(null!=i){for(var s=0,r=i.length;s<r;s++)this.hasType(i[s])||(this._jsPlumb.types.push(i[s]),o=!0);o&&d(this,e,n)}},removeType:function(t,e,n){var i=u(t),o=!1,s=function(t){var e=this._jsPlumb.types.indexOf(t);return-1!==e&&(f(this,e),this._jsPlumb.types.splice(e,1),!0)}.bind(this);if(null!=i){for(var r=0,a=i.length;r<a;r++)o=s(i[r])||o;o&&d(this,e,n)}},clearTypes:function(t,e){for(var n=this._jsPlumb.types.length,i=0;i<n;i++)f(this,0),this._jsPlumb.types.splice(0,1);d(this,t,e)},toggleType:function(t,e,n){var i=u(t);if(null!=i){for(var o=0,s=i.length;o<s;o++){var r=this._jsPlumb.types.indexOf(i[o]);-1!==r?(f(this,r),this._jsPlumb.types.splice(r,1)):this._jsPlumb.types.push(i[o])}d(this,e,n)}},applyType:function(t,e){if(this.setPaintStyle(t.paintStyle,e),this.setHoverPaintStyle(t.hoverPaintStyle,e),t.parameters)for(var n in t.parameters)this.setParameter(n,t.parameters[n]);this._jsPlumb.paintStyleInUse=this.getPaintStyle()},setPaintStyle:function(t,e){this._jsPlumb.paintStyle=t,this._jsPlumb.paintStyleInUse=this._jsPlumb.paintStyle,r(this),e||this.repaint()},getPaintStyle:function(){return this._jsPlumb.paintStyle},setHoverPaintStyle:function(t,e){this._jsPlumb.hoverPaintStyle=t,r(this),e||this.repaint()},getHoverPaintStyle:function(){return this._jsPlumb.hoverPaintStyle},destroy:function(t){(t||null==this.typeId)&&(this.cleanupListeners(),this.clone=null,this._jsPlumb=null)},isHover:function(){return this._jsPlumb.hover},setHover:function(t,e,n){if(this._jsPlumb&&!this._jsPlumb.instance.currentlyDragging&&!this._jsPlumb.instance.isHoverSuspended()){this._jsPlumb.hover=t;var i=t?"addClass":"removeClass";null!=this.canvas&&(null!=this._jsPlumb.instance.hoverClass&&this._jsPlumb.instance[i](this.canvas,this._jsPlumb.instance.hoverClass),null!=this._jsPlumb.hoverClass&&this._jsPlumb.instance[i](this.canvas,this._jsPlumb.hoverClass)),null!=this._jsPlumb.hoverPaintStyle&&(this._jsPlumb.paintStyleInUse=t?this._jsPlumb.hoverPaintStyle:this._jsPlumb.paintStyle,this._jsPlumb.instance.isSuspendDrawing()||(n=n||s(),this.repaint({timestamp:n,recalc:!1}))),this.getAttachedElements&&!e&&l(this,t,s(),this)}}});var g=0,m=function(){var t=g+1;return g++,t},v=n.jsPlumbInstance=function(e){this.version="2.5.7",e&&y.extend(this.Defaults,e),this.logEnabled=this.Defaults.LogEnabled,this._connectionTypes={},this._endpointTypes={},o.EventGenerator.apply(this);var r=this,l=m(),u=r.bind,c={},d=1,f=function(t){if(null==t)return null;if(3===t.nodeType||8===t.nodeType)return{el:t,text:!0};var e=r.getElement(t);return{el:e,id:o.isString(t)&&null==e?t:$(e)}};this.getInstanceIndex=function(){return l},this.setZoom=function(t,e){return d=t,r.fire("zoom",d),e&&r.repaintEverything(),!0},this.getZoom=function(){return d};for(var g in this.Defaults)c[g]=this.Defaults[g];var v,b=[];this.unbindContainer=function(){if(null!=v&&b.length>0)for(var t=0;t<b.length;t++)r.off(v,b[t][0],b[t][1])},this.setContainer=function(t){this.unbindContainer(),t=this.getElement(t),this.select().each(function(e){e.moveParent(t)}),this.selectEndpoints().each(function(e){e.moveParent(t)});var e=v;v=t,b.length=0;for(var n={endpointclick:"endpointClick",endpointdblclick:"endpointDblClick"},i=function(t,e,i){var o=e.srcElement||e.target,s=(o&&o.parentNode?o.parentNode._jsPlumb:null)||(o?o._jsPlumb:null)||(o&&o.parentNode&&o.parentNode.parentNode?o.parentNode.parentNode._jsPlumb:null);if(s){s.fire(t,s,e);var a=i?n[i+t]||t:t;r.fire(a,s.component||s,e)}},o=function(t,e,n){b.push([t,n]),r.on(v,t,e,n)},s=0;s<a.length;s++)!function(t){o(t,".jtk-connector",function(e){i(t,e)}),o(t,".jtk-endpoint",function(e){i(t,e,"endpoint")}),o(t,".jtk-overlay",function(e){i(t,e)})}(a[s]);for(var l in j){var u=j[l].el;u.parentNode===e&&(e.removeChild(u),v.appendChild(u))}},this.getContainer=function(){return v},this.bind=function(t,e){"ready"===t&&_?e():u.apply(r,[t,e])},r.importDefaults=function(t){for(var e in t)r.Defaults[e]=t[e];return t.Container&&r.setContainer(t.Container),r},r.restoreDefaults=function(){return r.Defaults=y.extend({},c),r};var P=null,_=!1,x=[],C={},E={},j={},S={},D={},w={},I=!1,A=[],k=!1,O=null,T=this.Defaults.Scope,M=1,L=function(){return""+M++},F=function(t,e){v?v.appendChild(t):e?this.getElement(e).appendChild(t):this.appendToRoot(t)}.bind(this),N=function(t,e,n,i){if(!k){var o,a=$(t),l=r.getDragManager();l&&(o=l.getElementsForDraggable(a)),null==n&&(n=s());var u=yt({elId:a,offset:e,recalc:!1,timestamp:n});if(o&&u&&u.o)for(var c in o)yt({elId:o[c].id,offset:{left:u.o.left+o[c].offset.left,top:u.o.top+o[c].offset.top},recalc:!1,timestamp:n});if(r.anchorManager.redraw(a,e,n,null,i),o)for(var h in o)r.anchorManager.redraw(o[h].id,e,n,o[h].offset,i,!0)}},G=function(t){return E[t]},U=function(t,e,n,i,s){if(!y.headless){if(null!=e&&e&&y.isDragSupported(t,r)){var a=n||r.Defaults.DragOptions;if(a=y.extend({},a),y.isAlreadyDraggable(t,r))n.force&&r.initDraggable(t,a);else{var l=y.dragEvents.drag,u=y.dragEvents.stop,c=y.dragEvents.start,h=!1;vt(i,t),a[c]=o.wrap(a[c],function(){if(r.setHoverSuspended(!0),r.select({source:t}).addClass(r.elementDraggingClass+" "+r.sourceElementDraggingClass,!0),r.select({target:t}).addClass(r.elementDraggingClass+" "+r.targetElementDraggingClass,!0),r.setConnectionBeingDragged(!0),a.canDrag)return n.canDrag()},!1),a[l]=o.wrap(a[l],function(){var e=r.getUIPosition(arguments,r.getZoom());null!=e&&(N(t,e,null,!0),h&&r.addClass(t,"jtk-dragged"),h=!0)}),a[u]=o.wrap(a[u],function(){for(var t,e=arguments[0].selection,n=0;n<e.length;n++)!function(e){null!=e[1]&&(t=r.getUIPosition([{el:e[2].el,pos:[e[1].left,e[1].top]}]),N(e[2].el,t)),r.removeClass(e[0],"jtk-dragged"),r.select({source:e[2].el}).removeClass(r.elementDraggingClass+" "+r.sourceElementDraggingClass,!0),r.select({target:e[2].el}).removeClass(r.elementDraggingClass+" "+r.targetElementDraggingClass,!0),r.getDragManager().dragEnded(e[2].el)}(e[n]);h=!1,r.setHoverSuspended(!1),r.setConnectionBeingDragged(!1)});var d=$(t);w[d]=!0;var p=w[d];a.disabled=null!=p&&!p,r.initDraggable(t,a),r.getDragManager().register(t),s&&r.fire("elementDraggable",{el:t,options:a})}}}},B=function(t,e){for(var n=t.scope.split(/\s/),i=e.scope.split(/\s/),o=0;o<n.length;o++)for(var s=0;s<i.length;s++)if(i[s]===n[o])return!0;return!1},R=function(t,e){var n=y.extend({},t);for(var i in e)e[i]&&(n[i]=e[i]);return n},H=function(t,e){var n=y.extend({},t);if(e&&y.extend(n,e),n.source&&(n.source.endpoint?n.sourceEndpoint=n.source:n.source=r.getElement(n.source)),n.target&&(n.target.endpoint?n.targetEndpoint=n.target:n.target=r.getElement(n.target)),t.uuids&&(n.sourceEndpoint=G(t.uuids[0]),n.targetEndpoint=G(t.uuids[1])),n.sourceEndpoint&&n.sourceEndpoint.isFull())return void o.log(r,"could not add connection; source endpoint is full");if(n.targetEndpoint&&n.targetEndpoint.isFull())return void o.log(r,"could not add connection; target endpoint is full");if(!n.type&&n.sourceEndpoint&&(n.type=n.sourceEndpoint.connectionType),n.sourceEndpoint&&n.sourceEndpoint.connectorOverlays){n.overlays=n.overlays||[];for(var i=0,s=n.sourceEndpoint.connectorOverlays.length;i<s;i++)n.overlays.push(n.sourceEndpoint.connectorOverlays[i])}n.sourceEndpoint&&n.sourceEndpoint.scope&&(n.scope=n.sourceEndpoint.scope),!n["pointer-events"]&&n.sourceEndpoint&&n.sourceEndpoint.connectorPointerEvents&&(n["pointer-events"]=n.sourceEndpoint.connectorPointerEvents);var a=function(t,e,i){return r.addEndpoint(t,R(e,{anchor:n.anchors?n.anchors[i]:n.anchor,endpoint:n.endpoints?n.endpoints[i]:n.endpoint,paintStyle:n.endpointStyles?n.endpointStyles[i]:n.endpointStyle,hoverPaintStyle:n.endpointHoverStyles?n.endpointHoverStyles[i]:n.endpointHoverStyle}))},l=function(t,e,i,o){if(n[t]&&!n[t].endpoint&&!n[t+"Endpoint"]&&!n.newConnection){var s=$(n[t]),r=i[s];if(r=r?r[o]:null){if(!r.enabled)return!1;var l=null!=r.endpoint&&r.endpoint._jsPlumb?r.endpoint:a(n[t],r.def,e);if(l.isFull())return!1;n[t+"Endpoint"]=l,!n.scope&&r.def.scope&&(n.scope=r.def.scope),r.uniqueEndpoint?r.endpoint?l.finalEndpoint=r.endpoint:(r.endpoint=l,l.setDeleteOnEmpty(!1)):l.setDeleteOnEmpty(!0)}}};return!1!==l("source",0,this.sourceEndpointDefinitions,n.type||"default")&&!1!==l("target",1,this.targetEndpointDefinitions,n.type||"default")?(n.sourceEndpoint&&n.targetEndpoint&&(B(n.sourceEndpoint,n.targetEndpoint)||(n=null)),n):void 0}.bind(r),Y=function(t){var e=r.Defaults.ConnectionType||r.getDefaultConnectionType();t._jsPlumb=r,t.newConnection=Y,t.newEndpoint=X,t.endpointsByUUID=E,t.endpointsByElement=C,t.finaliseConnection=W,t.id="con_"+L();var n=new e(t);return n.isDetachable()&&(n.endpoints[0].initDraggable("_jsPlumbSource"),n.endpoints[1].initDraggable("_jsPlumbTarget")),n},W=r.finaliseConnection=function(t,e,n,i){if(e=e||{},t.suspendedEndpoint||x.push(t),t.pending=null,t.endpoints[0].isTemporarySource=!1,!1!==i&&r.anchorManager.newConnection(t),N(t.source),!e.doNotFireConnectionEvent&&!1!==e.fireEvent){var o={connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]};r.fire("connection",o,n)}},X=function(t,e){var n=r.Defaults.EndpointType||y.Endpoint,i=y.extend({},t);i._jsPlumb=r,i.newConnection=Y,i.newEndpoint=X,i.endpointsByUUID=E,i.endpointsByElement=C,i.fireDetachEvent=et,i.elementId=e||$(i.source);var o=new n(i);return o.id="ep_"+L(),vt(i.elementId,i.source),y.headless||r.getDragManager().endpointAdded(i.source,e),o},z=function(t,e,n){var i=C[t];if(i&&i.length)for(var o=0,s=i.length;o<s;o++){for(var r=0,a=i[o].connections.length;r<a;r++){var l=e(i[o].connections[r]);if(l)return}n&&n(i[o])}},V=function(t,e){return y.each(t,function(t){r.isDragSupported(t)&&(w[r.getAttribute(t,"id")]=e,r.setElementDraggable(t,e))})},q=function(t,e,n){e="block"===e;var i=null;n&&(i=function(t){t.setVisible(e,!0,!0)});var o=f(t);z(o.id,function(t){if(e&&n){var i=t.sourceId===o.id?1:0;t.endpoints[i].isVisible()&&t.setVisible(!0)}else t.setVisible(e)},i)},J=function(t){var e;return y.each(t,function(t){var n=r.getAttribute(t,"id");return e=null!=w[n]&&w[n],e=!e,w[n]=e,r.setDraggable(t,e),e}.bind(this)),e},K=function(t,e){var n=null;e&&(n=function(t){var e=t.isVisible();t.setVisible(!e)}),z(t,function(t){var e=t.isVisible();t.setVisible(!e)},n)},Z=function(t){var e=S[t];return e?{o:e,s:A[t]}:yt({elId:t})},$=function(t,e,n){if(o.isString(t))return t;if(null==t)return null;var i=r.getAttribute(t,"id");return i&&"undefined"!==i||(2===arguments.length&&void 0!==arguments[1]?i=e:(1===arguments.length||3===arguments.length&&!arguments[2])&&(i="jsPlumb_"+l+"_"+L()),n||r.setAttribute(t,"id",i)),i};this.setConnectionBeingDragged=function(t){I=t},this.isConnectionBeingDragged=function(){return I},this.getManagedElements=function(){return j},this.connectorClass="jtk-connector",this.connectorOutlineClass="jtk-connector-outline",this.editableConnectorClass="jtk-connector-editable",this.connectedClass="jtk-connected",this.hoverClass="jtk-hover",this.endpointClass="jtk-endpoint",this.endpointConnectedClass="jtk-endpoint-connected",this.endpointFullClass="jtk-endpoint-full",this.endpointDropAllowedClass="jtk-endpoint-drop-allowed",this.endpointDropForbiddenClass="jtk-endpoint-drop-forbidden",this.overlayClass="jtk-overlay",this.draggingClass="jtk-dragging",this.elementDraggingClass="jtk-element-dragging",this.sourceElementDraggingClass="jtk-source-element-dragging",this.targetElementDraggingClass="jtk-target-element-dragging",this.endpointAnchorClassPrefix="jtk-endpoint-anchor",this.hoverSourceClass="jtk-source-hover",this.hoverTargetClass="jtk-target-hover",this.dragSelectClass="jtk-drag-select",this.Anchors={},this.Connectors={svg:{}},this.Endpoints={svg:{}},this.Overlays={svg:{}},this.ConnectorRenderers={},this.SVG="svg",this.addEndpoint=function(t,e,n){n=n||{};var i=y.extend({},n);y.extend(i,e),i.endpoint=i.endpoint||r.Defaults.Endpoint,i.paintStyle=i.paintStyle||r.Defaults.EndpointStyle;for(var s=[],a=o.isArray(t)||null!=t.length&&!o.isString(t)?t:[t],l=0,u=a.length;l<u;l++){i.source=r.getElement(a[l]),gt(i.source);var c=$(i.source),h=X(i,c),d=vt(c,i.source).info.o;o.addToList(C,c,h),k||h.paint({anchorLoc:h.anchor.compute({xy:[d.left,d.top],wh:A[c],element:h,timestamp:O}),timestamp:O}),s.push(h)}return 1===s.length?s[0]:s},this.addEndpoints=function(t,e,n){for(var i=[],s=0,a=e.length;s<a;s++){var l=r.addEndpoint(t,e[s],n);o.isArray(l)?Array.prototype.push.apply(i,l):i.push(l)}return i},this.animate=function(t,e,n){if(!this.animationSupported)return!1;n=n||{};var i=r.getElement(t),s=$(i),a=y.animEvents.step,l=y.animEvents.complete;n[a]=o.wrap(n[a],function(){r.revalidate(s)}),n[l]=o.wrap(n[l],function(){r.revalidate(s)}),r.doAnimate(i,e,n)},this.checkCondition=function(t,e){var n=r.getListener(t),i=!0;if(n&&n.length>0){var s=Array.prototype.slice.call(arguments,1);try{for(var a=0,l=n.length;a<l;a++)i=i&&n[a].apply(n[a],s)}catch(e){o.log(r,"cannot check condition ["+t+"]"+e)}}return i},this.connect=function(t,e){var n,i=H(t,e);if(i){if(null==i.source&&null==i.sourceEndpoint)return void o.log("Cannot establish connection - source does not exist");if(null==i.target&&null==i.targetEndpoint)return void o.log("Cannot establish connection - target does not exist");gt(i.source),n=Y(i),W(n,i)}return n};var Q=[{el:"source",elId:"sourceId",epDefs:"sourceEndpointDefinitions"},{el:"target",elId:"targetId",epDefs:"targetEndpointDefinitions"}],tt=function(t,e,n,i){var o,s,r,a=Q[n],l=t[a.elId],u=(t[a.el],t.endpoints[n]),c={index:n,originalSourceId:0===n?l:t.sourceId,newSourceId:t.sourceId,originalTargetId:1===n?l:t.targetId,newTargetId:t.targetId,connection:t};if(e.constructor===y.Endpoint)o=e,o.addConnection(t),e=o.element;else if(s=$(e),r=this[a.epDefs][s],s===t[a.elId])o=null;else if(r)for(var h in r){if(!r[h].enabled)return;o=null!=r[h].endpoint&&r[h].endpoint._jsPlumb?r[h].endpoint:this.addEndpoint(e,r[h].def),r[h].uniqueEndpoint&&(r[h].endpoint=o),o.addConnection(t)}else o=t.makeEndpoint(0===n,e,s);return null!=o&&(u.detachFromConnection(t),t.endpoints[n]=o,t[a.el]=o.element,t[a.elId]=o.elementId,c[0===n?"newSourceId":"newTargetId"]=o.elementId,nt(c),i||t.repaint()),c.element=e,c}.bind(this);this.setSource=function(t,e,n){var i=tt(t,e,0,n);this.anchorManager.sourceChanged(i.originalSourceId,i.newSourceId,t,i.el)},this.setTarget=function(t,e,n){var i=tt(t,e,1,n);this.anchorManager.updateOtherEndpoint(i.originalSourceId,i.originalTargetId,i.newTargetId,t)},this.deleteEndpoint=function(t,e,n){var i="string"==typeof t?E[t]:t;return i&&r.deleteObject({endpoint:i,dontUpdateHover:e,deleteAttachedObjects:n}),r},this.deleteEveryEndpoint=function(){var t=r.setSuspendDrawing(!0);for(var e in C){var n=C[e];if(n&&n.length)for(var i=0,o=n.length;i<o;i++)r.deleteEndpoint(n[i],!0)}C={},j={},E={},S={},D={},r.anchorManager.reset();var s=r.getDragManager();return s&&s.reset(),t||r.setSuspendDrawing(!1),r};var et=function(t,e,n){var i=r.Defaults.ConnectionType||r.getDefaultConnectionType(),o=t.constructor===i,s=o?{connection:t,source:t.source,target:t.target,sourceId:t.sourceId,targetId:t.targetId,sourceEndpoint:t.endpoints[0],targetEndpoint:t.endpoints[1]}:t;e&&r.fire("connectionDetached",s,n),r.fire("internal.connectionDetached",s,n),r.anchorManager.connectionDetached(s)},nt=r.fireMoveEvent=function(t,e){r.fire("connectionMoved",t,e)};this.unregisterEndpoint=function(t){t._jsPlumb.uuid&&(E[t._jsPlumb.uuid]=null),r.anchorManager.deleteEndpoint(t);for(var e in C){var n=C[e];if(n){for(var i=[],o=0,s=n.length;o<s;o++)n[o]!==t&&i.push(n[o]);C[e]=i}C[e].length<1&&delete C[e]}};this.deleteConnection=function(t,e){return!(null==t||(e=e||{},!e.force&&!o.functionChain(!0,!1,[[t.endpoints[0],"isDetachAllowed",[t]],[t.endpoints[1],"isDetachAllowed",[t]],[t,"isDetachAllowed",[t]],[r,"checkCondition",["beforeDetach",t]]])))&&(t.setHover(!1),et(t,!t.pending&&!1!==e.fireEvent,e.originalEvent),t.endpoints[0].detachFromConnection(t),t.endpoints[1].detachFromConnection(t),o.removeWithFunction(x,function(e){return t.id===e.id}),t.cleanup(),t.destroy(),!0)},this.deleteEveryConnection=function(t){t=t||{};var e=x.length,n=0;return r.batch(function(){for(var i=0;i<e;i++)n+=r.deleteConnection(x[0],t)?1:0}),n},this.deleteConnectionsForElement=function(t,e){e=e||{},t=r.getElement(t);var n=$(t),i=C[n];if(i&&i.length)for(var o=0,s=i.length;o<s;o++)i[o].deleteEveryConnection(e);return r},this.deleteObject=function(t){var e={endpoints:{},connections:{},endpointCount:0,connectionCount:0},n=!1!==t.deleteAttachedObjects,i=function(n){null!=n&&null==e.connections[n.id]&&(t.dontUpdateHover||null==n._jsPlumb||n.setHover(!1),e.connections[n.id]=n,e.connectionCount++)};t.connection?i(t.connection):function(o){if(null!=o&&null==e.endpoints[o.id]&&(t.dontUpdateHover||null==o._jsPlumb||o.setHover(!1),e.endpoints[o.id]=o,e.endpointCount++,n))for(var s=0;s<o.connections.length;s++){var r=o.connections[s];i(r)}}(t.endpoint);for(var s in e.connections){var a=e.connections[s];if(a._jsPlumb){o.removeWithFunction(x,function(t){return a.id===t.id}),et(a,!1!==t.fireEvent&&!a.pending,t.originalEvent);var l=null==t.deleteAttachedObjects?null:!t.deleteAttachedObjects;a.endpoints[0].detachFromConnection(a,null,l),a.endpoints[1].detachFromConnection(a,null,l),a.cleanup(!0),a.destroy(!0)}}for(var u in e.endpoints){var c=e.endpoints[u];c._jsPlumb&&(r.unregisterEndpoint(c),c.cleanup(!0),c.destroy(!0))}return e},this.draggable=function(t,e){var n;return h(function(t){n=f(t),n.el&&U(n.el,!0,e,n.id,!0)},t),r},this.droppable=function(t,e){var n;return e=e||{},e.allowLoopback=!1,h(function(t){n=f(t),n.el&&r.initDroppable(n.el,e)},t),r};var it=function(t,e,n,i){for(var o=0,s=t.length;o<s;o++)t[o][e].apply(t[o],n);return i(t)},ot=function(t,e,n){for(var i=[],o=0,s=t.length;o<s;o++)i.push([t[o][e].apply(t[o],n),t[o]]);return i},st=function(t,e,n){return function(){return it(t,e,arguments,n)}},rt=function(t,e){return function(){return ot(t,e,arguments)}},at=function(t,e){var n=[];if(t)if("string"==typeof t){if("*"===t)return t;n.push(t)}else if(e)n=t;else if(t.length)for(var i=0,o=t.length;i<o;i++)n.push(f(t[i]).id);else n.push(f(t).id);return n},lt=function(t,e,n){return"*"===t||(t.length>0?-1!==t.indexOf(e):!n)};this.getConnections=function(t,e){t?t.constructor===String&&(t={scope:t}):t={};for(var n=t.scope||r.getDefaultScope(),i=at(n,!0),o=at(t.source),s=at(t.target),a=!e&&i.length>1?{}:[],l=0,u=x.length;l<u;l++){var c=x[l],h=c.proxies&&c.proxies[0]?c.proxies[0].originalEp.elementId:c.sourceId,d=c.proxies&&c.proxies[1]?c.proxies[1].originalEp.elementId:c.targetId;lt(i,c.scope)&&lt(o,h)&&lt(s,d)&&function(t,n){if(!e&&i.length>1){var o=a[t];null==o&&(o=a[t]=[]),o.push(n)}else a.push(n)}(c.scope,c)}return a};var ut=function(t,e){return function(n){for(var i=0,o=t.length;i<o;i++)n(t[i]);return e(t)}},ct=function(t){return function(e){return t[e]}},ht=function(t,e){var n,i,o={length:t.length,each:ut(t,e),get:ct(t)},s=["setHover","removeAllOverlays","setLabel","addClass","addOverlay","removeOverlay","removeOverlays","showOverlay","hideOverlay","showOverlays","hideOverlays","setPaintStyle","setHoverPaintStyle","setSuspendEvents","setParameter","setParameters","setVisible","repaint","addType","toggleType","removeType","removeClass","setType","bind","unbind"],r=["getLabel","getOverlay","isHover","getParameter","getParameters","getPaintStyle","getHoverPaintStyle","isVisible","hasType","getType","isSuspendEvents"];for(n=0,i=s.length;n<i;n++)o[s[n]]=st(t,s[n],e);for(n=0,i=r.length;n<i;n++)o[r[n]]=rt(t,r[n]);return o},dt=function(t){var e=ht(t,dt);return y.extend(e,{setDetachable:st(t,"setDetachable",dt),setReattach:st(t,"setReattach",dt),setConnector:st(t,"setConnector",dt),delete:function(){for(var e=0,n=t.length;e<n;e++)r.deleteConnection(t[e])},isDetachable:rt(t,"isDetachable"),isReattach:rt(t,"isReattach")})},pt=function(t){var e=ht(t,pt);return y.extend(e,{setEnabled:st(t,"setEnabled",pt),setAnchor:st(t,"setAnchor",pt),isEnabled:rt(t,"isEnabled"),deleteEveryConnection:function(){for(var e=0,n=t.length;e<n;e++)t[e].deleteEveryConnection()},delete:function(){for(var e=0,n=t.length;e<n;e++)r.deleteEndpoint(t[e])}})};this.select=function(t){return t=t||{},t.scope=t.scope||"*",dt(t.connections||r.getConnections(t,!0))},this.selectEndpoints=function(t){t=t||{},t.scope=t.scope||"*";var e=!t.element&&!t.source&&!t.target,n=e?"*":at(t.element),i=e?"*":at(t.source),o=e?"*":at(t.target),s=at(t.scope,!0),r=[];for(var a in C){var l=lt(n,a,!0),u=lt(i,a,!0),c="*"!==i,h=lt(o,a,!0),d="*"!==o;if(l||u||h)t:for(var p=0,f=C[a].length;p<f;p++){var g=C[a][p];if(lt(s,g.scope,!0)){var m=c&&i.length>0&&!g.isSource,v=d&&o.length>0&&!g.isTarget;if(m||v)continue t;r.push(g)}}}return pt(r)},this.getAllConnections=function(){return x},this.getDefaultScope=function(){return T},this.getEndpoint=G,this.getEndpoints=function(t){return C[f(t).id]||[]},this.getDefaultEndpointType=function(){return y.Endpoint},this.getDefaultConnectionType=function(){return y.Connection},this.getId=$,this.appendElement=F;var ft=!1;this.isHoverSuspended=function(){return ft},this.setHoverSuspended=function(t){ft=t},this.hide=function(t,e){return q(t,"none",e),r},this.idstamp=L,this.connectorsInitialized=!1,this.registerConnectorType=function(t,e){i.push([t,e])};var gt=function(t){if(!v&&t){var e=r.getElement(t);e.offsetParent&&r.setContainer(e.offsetParent)}},mt=function(){r.Defaults.Container&&r.setContainer(r.Defaults.Container)},vt=r.manage=function(t,e,n){return j[t]||(j[t]={el:e,endpoints:[],connections:[]},j[t].info=yt({elId:t,timestamp:O}),n||r.fire("manageElement",{id:t,info:j[t].info,el:e})),j[t]},yt=this.updateOffset=function(t){var e,n=t.timestamp,i=t.recalc,o=t.offset,s=t.elId;return k&&!n&&(n=O),!i&&n&&n===D[s]?{o:t.offset||S[s],s:A[s]}:(i||!o&&null==S[s]?null!=(e=j[s]?j[s].el:null)&&(A[s]=r.getSize(e),S[s]=r.getOffset(e),D[s]=n):(S[s]=o||S[s],null==A[s]&&null!=(e=j[s].el)&&(A[s]=r.getSize(e)),D[s]=n),S[s]&&!S[s].right&&(S[s].right=S[s].left+A[s][0],S[s].bottom=S[s].top+A[s][1],S[s].width=A[s][0],S[s].height=A[s][1],S[s].centerx=S[s].left+S[s].width/2,S[s].centery=S[s].top+S[s].height/2),{o:S[s],s:A[s]})};this.init=function(){t=n.jsPlumb.getRenderModes();if(!n.jsPlumb.connectorsInitialized){for(var e=0;e<i.length;e++)for(var s=0;s<t.length;s++)!function(t,e,i){n.jsPlumb.Connectors[t][e]=function(){i.apply(this,arguments),n.jsPlumb.ConnectorRenderers[t].apply(this,arguments)},o.extend(n.jsPlumb.Connectors[t][e],[i,n.jsPlumb.ConnectorRenderers[t]])}(t[s],i[e][1],i[e][0]);n.jsPlumb.connectorsInitialized=!0}_||(mt(),r.anchorManager=new n.jsPlumb.AnchorManager({jsPlumbInstance:r}),_=!0,r.fire("ready",r))}.bind(this),this.log=P,this.jsPlumbUIComponent=p,this.makeAnchor=function(){var t,e=function(t,e){if(n.jsPlumb.Anchors[t])return new n.jsPlumb.Anchors[t](e);if(!r.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown anchor type '"+t+"'"}};if(0===arguments.length)return null;var i=arguments[0],s=arguments[1],a=(arguments[2],null);if(i.compute&&i.getOrientation)return i;if("string"==typeof i)a=e(arguments[0],{elementId:s,jsPlumbInstance:r});else if(o.isArray(i))if(o.isArray(i[0])||o.isString(i[0]))2===i.length&&o.isObject(i[1])?o.isString(i[0])?(t=n.jsPlumb.extend({elementId:s,jsPlumbInstance:r},i[1]),a=e(i[0],t)):(t=n.jsPlumb.extend({elementId:s,jsPlumbInstance:r,anchors:i[0]},i[1]),a=new n.jsPlumb.DynamicAnchor(t)):a=new y.DynamicAnchor({anchors:i,selector:null,elementId:s,jsPlumbInstance:r});else{var l={x:i[0],y:i[1],orientation:i.length>=4?[i[2],i[3]]:[0,0],offsets:i.length>=6?[i[4],i[5]]:[0,0],elementId:s,jsPlumbInstance:r,cssClass:7===i.length?i[6]:null};a=new n.jsPlumb.Anchor(l),a.clone=function(){return new n.jsPlumb.Anchor(l)}}return a.id||(a.id="anchor_"+L()),a},this.makeAnchors=function(t,e,i){for(var s=[],a=0,l=t.length;a<l;a++)"string"==typeof t[a]?s.push(n.jsPlumb.Anchors[t[a]]({elementId:e,jsPlumbInstance:i})):o.isArray(t[a])&&s.push(r.makeAnchor(t[a],e,i));return s},this.makeDynamicAnchor=function(t,e){return new n.jsPlumb.DynamicAnchor({anchors:t,selector:e,elementId:null,jsPlumbInstance:r})},this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={};var bt=function(t,e,n,i,o){for(var s=t.target||t.srcElement,r=!1,a=i.getSelector(e,n),l=0;l<a.length;l++)if(a[l]===s){r=!0;break}return o?!r:r},Pt=function(t,e,i,s,a){var l=new p(e),u=e._jsPlumb.EndpointDropHandler({jsPlumb:r,enabled:function(){return t.def.enabled},isFull:function(){var e=r.select({target:t.id}).length;return t.def.maxConnections>0&&e>=t.def.maxConnections},element:t.el,elementId:t.id,isSource:s,isTarget:a,addClass:function(e){r.addClass(t.el,e)},removeClass:function(e){r.removeClass(t.el,e)},onDrop:function(t){t.endpoints[0].anchor.locked=!1},isDropAllowed:function(){return l.isDropAllowed.apply(l,arguments)},isRedrop:function(e){return null!=e.suspendedElement&&null!=e.suspendedEndpoint&&e.suspendedEndpoint.element===t.el},getEndpoint:function(i){var o=t.def.endpoint;if(null==o||null==o._jsPlumb){var s=r.deriveEndpointAndAnchorSpec(i.getType().join(" "),!0),a=s.endpoints?n.jsPlumb.extend(e,{endpoint:t.def.def.endpoint||s.endpoints[1]}):e;s.anchors&&(a=n.jsPlumb.extend(a,{anchor:t.def.def.anchor||s.anchors[1]})),o=r.addEndpoint(t.el,a),o._mtNew=!0}if(e.uniqueEndpoint&&(t.def.endpoint=o),o.setDeleteOnEmpty(!0),i.isDetachable()&&o.initDraggable(),null!=o.anchor.positionFinder){var l=r.getUIPosition(arguments,r.getZoom()),u=r.getOffset(t.el),c=r.getSize(t.el),h=null==l?[0,0]:o.anchor.positionFinder(l,u,c,o.anchor.constructorParams);o.anchor.x=h[0],o.anchor.y=h[1]}return o},maybeCleanup:function(t){t._mtNew&&0===t.connections.length?r.deleteObject({endpoint:t}):delete t._mtNew}}),c=n.jsPlumb.dragEvents.drop;return i.scope=i.scope||e.scope||r.Defaults.Scope,i[c]=o.wrap(i[c],u,!0),a&&(i[n.jsPlumb.dragEvents.over]=function(){return!0}),!1===e.allowLoopback&&(i.canDrop=function(e){return e.getDragElement()._jsPlumbRelatedElement!==t.el}),r.initDroppable(t.el,i,"internal"),u};this.makeTarget=function(t,e,i){var o=n.jsPlumb.extend({_jsPlumb:this},i);n.jsPlumb.extend(o,e);for(var s=o.maxConnections||-1,a=function(t){var e=f(t),i=e.id,a=n.jsPlumb.extend({},o.dropOptions||{}),l=o.connectionType||"default";this.targetEndpointDefinitions[i]=this.targetEndpointDefinitions[i]||{},gt(i),e.el._isJsPlumbGroup&&null==a.rank&&(a.rank=-1);var u={def:n.jsPlumb.extend({},o),uniqueEndpoint:o.uniqueEndpoint,maxConnections:s,enabled:!0};o.createEndpoint&&(u.uniqueEndpoint=!0,u.endpoint=r.addEndpoint(t,u.def),u.endpoint.setDeleteOnEmpty(!1)),e.def=u,this.targetEndpointDefinitions[i][l]=u,Pt(e,o,a,!0===o.isSource,!0),e.el._katavorioDrop[e.el._katavorioDrop.length-1].targetDef=u}.bind(this),l=t.length&&t.constructor!==String?t:[t],u=0,c=l.length;u<c;u++)a(l[u]);return this},this.unmakeTarget=function(t,e){var n=f(t);return r.destroyDroppable(n.el,"internal"),e||delete this.targetEndpointDefinitions[n.id],this},this.makeSource=function(t,e,i){var s=n.jsPlumb.extend({_jsPlumb:this},i);n.jsPlumb.extend(s,e);var a=s.connectionType||"default",l=r.deriveEndpointAndAnchorSpec(a);s.endpoint=s.endpoint||l.endpoints[0],s.anchor=s.anchor||l.anchors[0];for(var u=s.maxConnections||-1,c=s.onMaxConnections,h=function(e){var i=e.id,l=this.getElement(e.el);this.sourceEndpointDefinitions[i]=this.sourceEndpointDefinitions[i]||{},gt(i);var h={def:n.jsPlumb.extend({},s),uniqueEndpoint:s.uniqueEndpoint,maxConnections:u,enabled:!0};s.createEndpoint&&(h.uniqueEndpoint=!0,h.endpoint=r.addEndpoint(t,h.def),h.endpoint.setDeleteOnEmpty(!1)),this.sourceEndpointDefinitions[i][a]=h,e.def=h;var p=n.jsPlumb.dragEvents.stop,f=n.jsPlumb.dragEvents.drag,g=n.jsPlumb.extend({},s.dragOptions||{}),m=g.drag,v=g.stop,y=null,b=!1;g.scope=g.scope||s.scope,g[f]=o.wrap(g[f],function(){m&&m.apply(this,arguments),b=!1}),g[p]=o.wrap(g[p],function(){if(v&&v.apply(this,arguments),this.currentlyDragging=!1,null!=y._jsPlumb){var t=s.anchor||this.Defaults.Anchor,e=y.anchor,n=y.connections[0],o=this.makeAnchor(t,i,this),a=y.element;if(null!=o.positionFinder){var l=r.getOffset(a),u=this.getSize(a),c={left:l.left+e.x*u[0],top:l.top+e.y*u[1]},h=o.positionFinder(c,l,u,o.constructorParams);o.x=h[0],o.y=h[1]}y.setAnchor(o,!0),y.repaint(),this.repaint(y.elementId),null!=n&&this.repaint(n.targetId)}}.bind(this));var P=function(t){if(3!==t.which&&2!==t.button){var h=this.sourceEndpointDefinitions[i][a];if(h.enabled){if(i=this.getId(this.getElement(e.el)),s.filter){if(!1===(o.isString(s.filter)?bt(t,e.el,s.filter,this,s.filterExclude):s.filter(t,e.el)))return}var p=this.select({source:i}).length;if(h.maxConnections>=0&&p>=h.maxConnections)return c&&c({element:e.el,maxConnections:u},t),!1;var f=n.jsPlumb.getPositionOnElement(t,l,d),m={};n.jsPlumb.extend(m,s),m.isTemporarySource=!0,m.anchor=[f[0],f[1],0,0],m.dragOptions=g,h.def.scope&&(m.scope=h.def.scope),y=this.addEndpoint(i,m),b=!0,y.setDeleteOnEmpty(!0),h.uniqueEndpoint&&(h.endpoint?y.finalEndpoint=h.endpoint:(h.endpoint=y,y.setDeleteOnEmpty(!1)));var v=function(){r.off(y.canvas,"mouseup",v),r.off(e.el,"mouseup",v),b&&(b=!1,r.deleteEndpoint(y))};r.on(y.canvas,"mouseup",v),r.on(e.el,"mouseup",v);var P={};if(h.def.extract)for(var _ in h.def.extract){var x=(t.srcElement||t.target).getAttribute(_);x&&(P[h.def.extract[_]]=x)}r.trigger(y.canvas,"mousedown",t,P),o.consume(t)}}}.bind(this);this.on(e.el,"mousedown",P),h.trigger=P,s.filter&&(o.isString(s.filter)||o.isFunction(s.filter))&&r.setDragFilter(e.el,s.filter);var _=n.jsPlumb.extend({},s.dropOptions||{});Pt(e,s,_,!0,!0===s.isTarget)}.bind(this),p=t.length&&t.constructor!==String?t:[t],g=0,m=p.length;g<m;g++)h(f(p[g]));return this},this.unmakeSource=function(t,e,n){var i=f(t);r.destroyDroppable(i.el,"internal");var o=this.sourceEndpointDefinitions[i.id];if(o)for(var s in o)if(null==e||e===s){var a=o[s].trigger;a&&r.off(i.el,"mousedown",a),n||delete this.sourceEndpointDefinitions[i.id][s]}return this},this.unmakeEverySource=function(){for(var t in this.sourceEndpointDefinitions)r.unmakeSource(t,null,!0);return this.sourceEndpointDefinitions={},this};var _t=function(t,e,n){e=o.isArray(e)?e:[e];var i=$(t);n=n||"default";for(var s=0;s<e.length;s++){var r=this[e[s]][i];if(r&&r[n])return r[n].def.scope||this.Defaults.Scope}}.bind(this),xt=function(t,e,n,i){n=o.isArray(n)?n:[n];var s=$(t);i=i||"default";for(var r=0;r<n.length;r++){var a=this[n[r]][s];a&&a[i]&&(a[i].def.scope=e)}}.bind(this);this.getScope=function(t,e){return _t(t,["sourceEndpointDefinitions","targetEndpointDefinitions"])},this.getSourceScope=function(t){return _t(t,"sourceEndpointDefinitions")},this.getTargetScope=function(t){return _t(t,"targetEndpointDefinitions")},this.setScope=function(t,e,n){this.setSourceScope(t,e,n),this.setTargetScope(t,e,n)},this.setSourceScope=function(t,e,n){xt(t,e,"sourceEndpointDefinitions",n),this.setDragScope(t,e)},this.setTargetScope=function(t,e,n){xt(t,e,"targetEndpointDefinitions",n),this.setDropScope(t,e)},this.unmakeEveryTarget=function(){for(var t in this.targetEndpointDefinitions)r.unmakeTarget(t,!0);return this.targetEndpointDefinitions={},this};var Ct=function(t,e,n,i,s){var a,l,u,c="source"===t?this.sourceEndpointDefinitions:this.targetEndpointDefinitions;if(s=s||"default",e.length&&!o.isString(e)){a=[];for(var h=0,d=e.length;h<d;h++)l=f(e[h]),c[l.id]&&c[l.id][s]&&(a[h]=c[l.id][s].enabled,u=i?!a[h]:n,c[l.id][s].enabled=u,r[u?"removeClass":"addClass"](l.el,"jtk-"+t+"-disabled"))}else{l=f(e);var p=l.id;c[p]&&c[p][s]&&(a=c[p][s].enabled,u=i?!a:n,c[p][s].enabled=u,r[u?"removeClass":"addClass"](l.el,"jtk-"+t+"-disabled"))}return a}.bind(this),Et=function(t,e){return o.isString(t)||!t.length?e.apply(this,[t]):t.length?e.apply(this,[t[0]]):void 0}.bind(this);this.toggleSourceEnabled=function(t,e){return Ct("source",t,null,!0,e),this.isSourceEnabled(t,e)},this.setSourceEnabled=function(t,e,n){return Ct("source",t,e,null,n)},this.isSource=function(t,e){return e=e||"default",Et(t,function(t){var n=this.sourceEndpointDefinitions[f(t).id];return null!=n&&null!=n[e]}.bind(this))},this.isSourceEnabled=function(t,e){return e=e||"default",Et(t,function(t){var n=this.sourceEndpointDefinitions[f(t).id];return n&&n[e]&&!0===n[e].enabled}.bind(this))},this.toggleTargetEnabled=function(t,e){return Ct("target",t,null,!0,e),this.isTargetEnabled(t,e)},this.isTarget=function(t,e){return e=e||"default",Et(t,function(t){var n=this.targetEndpointDefinitions[f(t).id];return null!=n&&null!=n[e]}.bind(this))},this.isTargetEnabled=function(t,e){return e=e||"default",Et(t,function(t){var n=this.targetEndpointDefinitions[f(t).id];return n&&n[e]&&!0===n[e].enabled}.bind(this))},this.setTargetEnabled=function(t,e,n){return Ct("target",t,e,null,n)},this.ready=function(t){r.bind("ready",t)};var jt=function(t,e){if("object"==typeof t&&t.length)for(var n=0,i=t.length;n<i;n++)e(t[n]);else e(t);return r};this.repaint=function(t,e,n){return jt(t,function(t){N(t,e,n)})},this.revalidate=function(t,e,n){return jt(t,function(t){var i=n?t:r.getId(t);r.updateOffset({elId:i,recalc:!0,timestamp:e});var o=r.getDragManager();o&&o.updateOffsets(i),r.repaint(t)})},this.repaintEverything=function(){var t,e=s();for(t in C)r.updateOffset({elId:t,recalc:!0,timestamp:e});for(t in C)N(t,null,e);return this},this.removeAllEndpoints=function(t,e,n){n=n||[];var i=function(t){var o,s,a=f(t),l=C[a.id];if(l)for(n.push(a),o=0,s=l.length;o<s;o++)r.deleteEndpoint(l[o],!1);if(delete C[a.id],e&&a.el&&3!==a.el.nodeType&&8!==a.el.nodeType)for(o=0,s=a.el.childNodes.length;o<s;o++)i(a.el.childNodes[o])};return i(t),this};var St=function(t,e){r.removeAllEndpoints(t.id,!0,e);for(var n=r.getDragManager(),i=function(t){n&&n.elementRemoved(t.id),r.anchorManager.clearFor(t.id),r.anchorManager.removeFloatingConnection(t.id),r.isSource(t.el)&&r.unmakeSource(t.el),r.isTarget(t.el)&&r.unmakeTarget(t.el),r.destroyDraggable(t.el),r.destroyDroppable(t.el),delete r.floatingConnections[t.id],delete j[t.id],delete S[t.id],t.el&&(r.removeElement(t.el),t.el._jsPlumb=null)},o=1;o<e.length;o++)i(e[o]);i(t)};this.remove=function(t,e){var n=f(t),i=[];return n.text?n.el.parentNode.removeChild(n.el):n.id&&r.batch(function(){St(n,i)},!1===e),r},this.empty=function(t,e){var n=[],i=function(t,e){var o=f(t);if(o.text)o.el.parentNode.removeChild(o.el);else if(o.el){for(;o.el.childNodes.length>0;)i(o.el.childNodes[0]);e||St(o,n)}};return r.batch(function(){i(t,!0)},!1===e),r},this.reset=function(){r.silently(function(){ft=!1,r.removeAllGroups(),r.removeGroupManager(),r.deleteEveryEndpoint(),r.unbind(),this.targetEndpointDefinitions={},this.sourceEndpointDefinitions={},x.length=0,this.doReset&&this.doReset()}.bind(this))};var Dt=function(t){t.canvas&&t.canvas.parentNode&&t.canvas.parentNode.removeChild(t.canvas),t.cleanup(),t.destroy()};this.clear=function(){r.select().each(Dt),r.selectEndpoints().each(Dt),C={},E={}},this.setDefaultScope=function(t){return T=t,r},this.setDraggable=V,this.deriveEndpointAndAnchorSpec=function(t,e){for(var n=((e?"":"default ")+t).split(/[\s]/),i=null,o=null,s=null,a=null,l=0;l<n.length;l++){var u=r.getType(n[l],"connection");u&&(u.endpoints&&(i=u.endpoints),u.endpoint&&(o=u.endpoint),u.anchors&&(a=u.anchors),u.anchor&&(s=u.anchor))}return{endpoints:i||[o,o],anchors:a||[s,s]}},this.setId=function(t,e,n){var i;o.isString(t)?i=t:(t=this.getElement(t),i=this.getId(t));var s=this.getConnections({source:i,scope:"*"},!0),r=this.getConnections({target:i,scope:"*"},!0);e=""+e,n?t=this.getElement(e):(t=this.getElement(i),this.setAttribute(t,"id",e)),C[e]=C[i]||[];for(var a=0,l=C[e].length;a<l;a++)C[e][a].setElementId(e),C[e][a].setReferenceElement(t);delete C[i],this.sourceEndpointDefinitions[e]=this.sourceEndpointDefinitions[i],delete this.sourceEndpointDefinitions[i],this.targetEndpointDefinitions[e]=this.targetEndpointDefinitions[i],delete this.targetEndpointDefinitions[i],this.anchorManager.changeId(i,e);var u=this.getDragManager();u&&u.changeId(i,e),j[e]=j[i],delete j[i];var c=function(n,i,o){for(var s=0,r=n.length;s<r;s++)n[s].endpoints[i].setElementId(e),n[s].endpoints[i].setReferenceElement(t),n[s][o+"Id"]=e,n[s][o]=t};c(s,0,"source"),c(r,1,"target"),this.repaint(e)},this.setDebugLog=function(t){P=t},this.setSuspendDrawing=function(t,e){var n=k;return k=t,O=t?(new Date).getTime():null,e&&this.repaintEverything(),n},this.isSuspendDrawing=function(){return k},this.getSuspendedAt=function(){return O},this.batch=function(t,e){var n=this.isSuspendDrawing();n||this.setSuspendDrawing(!0);try{t()}catch(t){o.log("Function run while suspended failed",t)}n||this.setSuspendDrawing(!1,!e)},this.doWhileSuspended=this.batch,this.getCachedData=Z,this.timestamp=s,this.show=function(t,e){return q(t,"block",e),r},this.toggleVisible=K,this.toggleDraggable=J,this.addListener=this.bind};o.extend(n.jsPlumbInstance,o.EventGenerator,{setAttribute:function(t,e,n){this.setAttribute(t,e,n)},getAttribute:function(t,e){return this.getAttribute(n.jsPlumb.getElement(t),e)},convertToFullOverlaySpec:function(t){return o.isString(t)&&(t=[t,{}]),t[1].id=t[1].id||o.uuid(),t},registerConnectionType:function(t,e){if(this._connectionTypes[t]=n.jsPlumb.extend({},e),e.overlays){for(var i={},o=0;o<e.overlays.length;o++){var s=this.convertToFullOverlaySpec(e.overlays[o]);i[s[1].id]=s}this._connectionTypes[t].overlays=i}},registerConnectionTypes:function(t){for(var e in t)this.registerConnectionType(e,t[e])},registerEndpointType:function(t,e){if(this._endpointTypes[t]=n.jsPlumb.extend({},e),e.overlays){for(var i={},o=0;o<e.overlays.length;o++){var s=this.convertToFullOverlaySpec(e.overlays[o]);i[s[1].id]=s}this._endpointTypes[t].overlays=i}},registerEndpointTypes:function(t){for(var e in t)this.registerEndpointType(e,t[e])},getType:function(t,e){return"connection"===e?this._connectionTypes[t]:this._endpointTypes[t]},setIdChanged:function(t,e){this.setId(t,e,!0)},setParent:function(t,e){var n=this.getElement(t),i=this.getId(n),o=this.getElement(e),s=this.getId(o),r=this.getDragManager();n.parentNode.removeChild(n),o.appendChild(n),r&&r.setParent(n,i,o,s)},extend:function(t,e,n){var i;if(n)for(i=0;i<n.length;i++)t[n[i]]=e[n[i]];else for(i in e)t[i]=e[i];return t},floatingConnections:{},getFloatingAnchorIndex:function(t){return t.endpoints[0].isFloating()?0:t.endpoints[1].isFloating()?1:-1}}),v.prototype.Defaults={Anchor:"Bottom",Anchors:[null,null],ConnectionsDetachable:!0,ConnectionOverlays:[],Connector:"Bezier",Container:null,DoNotThrowErrors:!1,DragOptions:{},DropOptions:{},Endpoint:"Dot",EndpointOverlays:[],Endpoints:[null,null],EndpointStyle:{fill:"#456"},EndpointStyles:[null,null],EndpointHoverStyle:null,EndpointHoverStyles:[null,null],HoverPaintStyle:null,LabelStyle:{color:"black"},LogEnabled:!1,Overlays:[],MaxConnections:1,PaintStyle:{"stroke-width":4,stroke:"#456"},ReattachConnections:!1,RenderMode:"svg",Scope:"jsPlumb_DefaultScope"};var y=new v;n.jsPlumb=y,y.getInstance=function(t,e){var n=new v(t);if(e)for(var i in e)n[i]=e[i];return n.init(),n},y.each=function(t,e){if(null!=t)if("string"==typeof t)e(y.getElement(t));else if(null!=t.length)for(var n=0;n<t.length;n++)e(y.getElement(t[n]));else e(t)},e.jsPlumb=y}.call("undefined"!=typeof window?window:this),function(){var t=this,e=t.jsPlumbUtil,n=function(t,e){if(null==e)return[0,0];var n=a(e),i=r(n,0);return[i[t+"X"],i[t+"Y"]]},i=n.bind(this,"page"),o=n.bind(this,"screen"),s=n.bind(this,"client"),r=function(t,e){return t.item?t.item(e):t[e]},a=function(t){return t.touches&&t.touches.length>0?t.touches:t.changedTouches&&t.changedTouches.length>0?t.changedTouches:t.targetTouches&&t.targetTouches.length>0?t.targetTouches:[t]},l=function(t){var e={},n=[],i={},o={},s={};this.register=function(r){var a=t.getId(r),l=t.getOffset(r);e[a]||(e[a]=r,n.push(r),i[a]={});var u=function(e){if(e)for(var n=0;n<e.childNodes.length;n++)if(3!==e.childNodes[n].nodeType&&8!==e.childNodes[n].nodeType){var r=jsPlumb.getElement(e.childNodes[n]),c=t.getId(e.childNodes[n],null,!0);if(c&&o[c]&&o[c]>0){var h=t.getOffset(r);i[a][c]={id:c,offset:{left:h.left-l.left,top:h.top-l.top}},s[c]=a}u(e.childNodes[n])}};u(r)},this.updateOffsets=function(e,n){if(null!=e){n=n||{};var o=jsPlumb.getElement(e),r=t.getId(o),a=i[r],l=t.getOffset(o);if(a)for(var u in a)if(a.hasOwnProperty(u)){var c=jsPlumb.getElement(u),h=n[u]||t.getOffset(c);if(null==c.offsetParent&&null!=i[r][u])continue;i[r][u]={id:u,offset:{left:h.left-l.left,top:h.top-l.top}},s[u]=r}}},this.endpointAdded=function(n,r){r=r||t.getId(n);var a=document.body,l=n.parentNode;for(o[r]=o[r]?o[r]+1:1;null!=l&&l!==a;){var u=t.getId(l,null,!0);if(u&&e[u]){var c=t.getOffset(l);if(null==i[u][r]){var h=t.getOffset(n);i[u][r]={id:r,offset:{left:h.left-c.left,top:h.top-c.top}},s[r]=u}break}l=l.parentNode}},this.endpointDeleted=function(t){if(o[t.elementId]&&--o[t.elementId]<=0)for(var e in i)i.hasOwnProperty(e)&&i[e]&&(delete i[e][t.elementId],delete s[t.elementId])},this.changeId=function(t,e){i[e]=i[t],i[t]={},s[e]=s[t],s[t]=null},this.getElementsForDraggable=function(t){return i[t]},this.elementRemoved=function(t){var e=s[t];e&&(delete i[e][t],delete s[t])},this.reset=function(){e={},n=[],i={},o={}},this.dragEnded=function(e){if(null!=e.offsetParent){var n=t.getId(e),i=s[n];i&&this.updateOffsets(i)}},this.setParent=function(e,n,o,r,a){var l=s[n];i[r]||(i[r]={});var u=t.getOffset(o),c=a||t.getOffset(e);l&&i[l]&&delete i[l][n],i[r][n]={id:n,offset:{left:c.left-u.left,top:c.top-u.top}},s[n]=r},this.clearParent=function(t,e){var n=s[e];n&&(delete i[n][e],delete s[e])},this.revalidateParent=function(e,n,i){var o=s[n];if(o){var r={};r[n]=i,this.updateOffsets(o,r),t.revalidate(o)}},this.getDragAncestor=function(e){var n=jsPlumb.getElement(e),i=t.getId(n),o=s[i];return o?jsPlumb.getElement(o):null}},u=function(t){return null==t?null:t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},c=function(t,e,n){e=u(e),void 0!==t.className.baseVal?t.className.baseVal=e:t.className=e;try{for(var i=t.classList;i.length>0;)i.remove(i.item(0));for(var o=0;o<n.length;o++)n[o]&&i.add(n[o])}catch(t){console.log("JSPLUMB: cannot set class list",t)}},h=function(t){return void 0===t.className.baseVal?t.className:t.className.baseVal},d=function(t,n,i){n=null==n?[]:e.isArray(n)?n:n.split(/\s+/),i=null==i?[]:e.isArray(i)?i:i.split(/\s+/);var o=h(t),s=o.split(/\s+/),r=function(t,e){for(var n=0;n<e.length;n++)if(t)-1===s.indexOf(e[n])&&s.push(e[n]);else{var i=s.indexOf(e[n]);-1!==i&&s.splice(i,1)}};r(!0,n),r(!1,i),c(t,s.join(" "),s)};t.jsPlumb.extend(t.jsPlumbInstance.prototype,{headless:!1,pageLocation:i,screenLocation:o,clientLocation:s,getDragManager:function(){return null==this.dragManager&&(this.dragManager=new l(this)),this.dragManager},recalculateOffsets:function(t){this.getDragManager().updateOffsets(t)},createElement:function(t,e,n,i){return this.createElementNS(null,t,e,n,i)},createElementNS:function(t,e,n,i,o){var s,r=null==t?document.createElement(e):document.createElementNS(t,e);n=n||{};for(s in n)r.style[s]=n[s];i&&(r.className=i),o=o||{};for(s in o)r.setAttribute(s,""+o[s]);return r},getAttribute:function(t,e){return null!=t.getAttribute?t.getAttribute(e):null},setAttribute:function(t,e,n){null!=t.setAttribute&&t.setAttribute(e,n)},setAttributes:function(t,e){for(var n in e)e.hasOwnProperty(n)&&t.setAttribute(n,e[n])},appendToRoot:function(t){document.body.appendChild(t)},getRenderModes:function(){return["svg"]},getClass:h,addClass:function(t,e){jsPlumb.each(t,function(t){d(t,e)})},hasClass:function(t,e){return t=jsPlumb.getElement(t),t.classList?t.classList.contains(e):-1!==h(t).indexOf(e)},removeClass:function(t,e){jsPlumb.each(t,function(t){d(t,null,e)})},updateClasses:function(t,e,n){jsPlumb.each(t,function(t){d(t,e,n)})},setClass:function(t,e){null!=e&&jsPlumb.each(t,function(t){c(t,e,e.split(/\s+/))})},setPosition:function(t,e){t.style.left=e.left+"px",t.style.top=e.top+"px"},getPosition:function(t){var e=function(e){var n=t.style[e];return n?n.substring(0,n.length-2):0};return{left:e("left"),top:e("top")}},getStyle:function(t,e){return void 0!==window.getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.currentStyle[e]},getSelector:function(t,e){return 1===arguments.length?null!=t.nodeType?t:document.querySelectorAll(t):t.querySelectorAll(e)},getOffset:function(t,e,n){t=jsPlumb.getElement(t),n=n||this.getContainer();for(var i={left:t.offsetLeft,top:t.offsetTop},o=e||null!=n&&t!==n&&t.offsetParent!==n?t.offsetParent:null,s=function(t){null!=t&&t!==document.body&&(t.scrollTop>0||t.scrollLeft>0)&&(i.left-=t.scrollLeft,i.top-=t.scrollTop)}.bind(this);null!=o;)i.left+=o.offsetLeft,i.top+=o.offsetTop,s(o),o=e?o.offsetParent:o.offsetParent===n?null:o.offsetParent;if(null!=n&&!e&&(n.scrollTop>0||n.scrollLeft>0)){var r=null!=t.offsetParent?this.getStyle(t.offsetParent,"position"):"static",a=this.getStyle(t,"position");"absolute"!==a&&"fixed"!==a&&"absolute"!==r&&"fixed"!==r&&(i.left-=n.scrollLeft,i.top-=n.scrollTop)}return i},getPositionOnElement:function(t,e,n){var i=void 0!==e.getBoundingClientRect?e.getBoundingClientRect():{left:0,top:0,width:0,height:0},o=document.body,s=document.documentElement,r=window.pageYOffset||s.scrollTop||o.scrollTop,a=window.pageXOffset||s.scrollLeft||o.scrollLeft,l=s.clientTop||o.clientTop||0,u=s.clientLeft||o.clientLeft||0,c=i.top+r-l+0*n,h=i.left+a-u+0*n,d=jsPlumb.pageLocation(t),p=i.width||e.offsetWidth*n,f=i.height||e.offsetHeight*n;return[(d[0]-h)/p,(d[1]-c)/f]},getAbsolutePosition:function(t){var e=function(e){var n=t.style[e];if(n)return parseFloat(n.substring(0,n.length-2))};return[e("left"),e("top")]},setAbsolutePosition:function(t,e,n,i){n?this.animate(t,{left:"+="+(e[0]-n[0]),top:"+="+(e[1]-n[1])},i):(t.style.left=e[0]+"px",t.style.top=e[1]+"px")},getSize:function(t){return[t.offsetWidth,t.offsetHeight]},getWidth:function(t){return t.offsetWidth},getHeight:function(t){return t.offsetHeight},getRenderMode:function(){return"svg"}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,n){var i={cssClass:n.cssClass,labelStyle:t.labelStyle,id:"__label",component:t,_jsPlumb:t._jsPlumb.instance},o=e.extend(i,n);return new(e.Overlays[t._jsPlumb.instance.getRenderMode()].Label)(o)},o=function(t,i){var o=null;if(n.isArray(i)){var s=i[0],r=e.extend({component:t,_jsPlumb:t._jsPlumb.instance},i[1]);3===i.length&&e.extend(r,i[2]),o=new(e.Overlays[t._jsPlumb.instance.getRenderMode()][s])(r)}else o=i.constructor===String?new(e.Overlays[t._jsPlumb.instance.getRenderMode()][i])({component:t,_jsPlumb:t._jsPlumb.instance}):i;return o.id=o.id||n.uuid(),t.cacheTypeItem("overlay",o,o.id),t._jsPlumb.overlays[o.id]=o,o};e.OverlayCapableJsPlumbUIComponent=function(e){t.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.overlays={},this._jsPlumb.overlayPositions={},e.label&&(this.getDefaultType().overlays.__label=["Label",{label:e.label,location:e.labelLocation||this.defaultLabelLocation||.5,labelStyle:e.labelStyle||this._jsPlumb.instance.Defaults.LabelStyle,id:"__label"}]),this.setListenerComponent=function(t){if(this._jsPlumb)for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].setListenerComponent(t)}},e.OverlayCapableJsPlumbUIComponent.applyType=function(t,e){if(e.overlays){var n,i={};for(n in e.overlays){var o=t._jsPlumb.overlays[e.overlays[n][1].id];if(o)o.updateFrom(e.overlays[n][1]),i[e.overlays[n][1].id]=!0;else{var s=t.getCachedTypeItem("overlay",e.overlays[n][1].id);null!=s?(s.reattach(t._jsPlumb.instance,t),s.setVisible(!0),s.updateFrom(e.overlays[n][1]),t._jsPlumb.overlays[s.id]=s):s=t.addOverlay(e.overlays[n],!0),i[s.id]=!0}}for(n in t._jsPlumb.overlays)null==i[t._jsPlumb.overlays[n].id]&&t.removeOverlay(t._jsPlumb.overlays[n].id,!0)}},n.extend(e.OverlayCapableJsPlumbUIComponent,t.jsPlumbUIComponent,{setHover:function(t,e){if(this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged())for(var n in this._jsPlumb.overlays)this._jsPlumb.overlays[n][t?"addClass":"removeClass"](this._jsPlumb.instance.hoverClass)},addOverlay:function(t,e){var n=o(this,t);return e||this.repaint(),n},getOverlay:function(t){return this._jsPlumb.overlays[t]},getOverlays:function(){return this._jsPlumb.overlays},hideOverlay:function(t){var e=this.getOverlay(t);e&&e.hide()},hideOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].hide()},showOverlay:function(t){var e=this.getOverlay(t);e&&e.show()},showOverlays:function(){for(var t in this._jsPlumb.overlays)this._jsPlumb.overlays[t].show()},removeAllOverlays:function(t){for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].cleanup&&this._jsPlumb.overlays[e].cleanup();this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null,t||this.repaint()},removeOverlay:function(t,e){var n=this._jsPlumb.overlays[t];n&&(n.setVisible(!1),!e&&n.cleanup&&n.cleanup(),delete this._jsPlumb.overlays[t],this._jsPlumb.overlayPositions&&delete this._jsPlumb.overlayPositions[t])},removeOverlays:function(){for(var t=0,e=arguments.length;t<e;t++)this.removeOverlay(arguments[t])},moveParent:function(t){if(this.bgCanvas&&(this.bgCanvas.parentNode.removeChild(this.bgCanvas),t.appendChild(this.bgCanvas)),this.canvas&&this.canvas.parentNode){this.canvas.parentNode.removeChild(this.canvas),t.appendChild(this.canvas);for(var e in this._jsPlumb.overlays)if(this._jsPlumb.overlays[e].isAppendedAtTopLevel){var n=this._jsPlumb.overlays[e].getElement();n.parentNode.removeChild(n),t.appendChild(n)}}},getLabel:function(){var t=this.getOverlay("__label");return null!=t?t.getLabel():null},getLabelOverlay:function(){return this.getOverlay("__label")},setLabel:function(t){var e=this.getOverlay("__label");if(e)t.constructor===String||t.constructor===Function?e.setLabel(t):(t.label&&e.setLabel(t.label),t.location&&e.setLocation(t.location));else{var n=t.constructor===String||t.constructor===Function?{label:t}:t;e=i(this,n),this._jsPlumb.overlays.__label=e}this._jsPlumb.instance.isSuspendDrawing()||this.repaint()},cleanup:function(t){for(var e in this._jsPlumb.overlays)this._jsPlumb.overlays[e].cleanup(t),this._jsPlumb.overlays[e].destroy(t);t&&(this._jsPlumb.overlays={},this._jsPlumb.overlayPositions=null)},setVisible:function(t){this[t?"showOverlays":"hideOverlays"]()},setAbsoluteOverlayPosition:function(t,e){this._jsPlumb.overlayPositions[t.id]=e},getAbsoluteOverlayPosition:function(t){return this._jsPlumb.overlayPositions?this._jsPlumb.overlayPositions[t.id]:null},_clazzManip:function(t,e,n){if(!n)for(var i in this._jsPlumb.overlays)this._jsPlumb.overlays[i][t+"Class"](e)},addClass:function(t,e){this._clazzManip("add",t,e)},removeClass:function(t,e){this._clazzManip("remove",t,e)}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,e,n){var i=!1;return{drag:function(){if(i)return i=!1,!0;if(e.element){var o=n.getUIPosition(arguments,n.getZoom());null!=o&&n.setPosition(e.element,o),n.repaint(e.element,o),t.paint({anchorPoint:t.anchor.getCurrentLocation({element:t})})}},stopDrag:function(){i=!0}}},o=function(t,e,n,i){var o=e.createElement("div",{position:"absolute"});e.appendElement(o);var s=e.getId(o);e.setPosition(o,n),o.style.width=i[0]+"px",o.style.height=i[1]+"px",e.manage(s,o,!0),t.id=s,t.element=o},s=function(t,n,i,o,s,r,a,l){return a({paintStyle:t,endpoint:i,anchor:new e.FloatingAnchor({reference:n,referenceCanvas:o,jsPlumbInstance:r}),source:s,scope:l})},r=["connectorStyle","connectorHoverStyle","connectorOverlays","connector","connectionType","connectorClass","connectorHoverClass"],a=function(t,e){var n=0;if(null!=e)for(var i=0;i<t.connections.length;i++)if(t.connections[i].sourceId===e||t.connections[i].targetId===e){n=i;break}return t.connections[n]};e.Endpoint=function(t){var l=t._jsPlumb,u=t.newConnection,c=t.newEndpoint;this.idPrefix="_jsplumb_e_",this.defaultLabelLocation=[.5,.5],this.defaultOverlayKeys=["Overlays","EndpointOverlays"],e.OverlayCapableJsPlumbUIComponent.apply(this,arguments),this.appendToDefaultType({connectionType:t.connectionType,maxConnections:null==t.maxConnections?this._jsPlumb.instance.Defaults.MaxConnections:t.maxConnections,paintStyle:t.endpointStyle||t.paintStyle||t.style||this._jsPlumb.instance.Defaults.EndpointStyle||e.Defaults.EndpointStyle,hoverPaintStyle:t.endpointHoverStyle||t.hoverPaintStyle||this._jsPlumb.instance.Defaults.EndpointHoverStyle||e.Defaults.EndpointHoverStyle,connectorStyle:t.connectorStyle,connectorHoverStyle:t.connectorHoverStyle,connectorClass:t.connectorClass,connectorHoverClass:t.connectorHoverClass,connectorOverlays:t.connectorOverlays,connector:t.connector,connectorTooltip:t.connectorTooltip}),this._jsPlumb.enabled=!(!1===t.enabled),this._jsPlumb.visible=!0,this.element=e.getElement(t.source),this._jsPlumb.uuid=t.uuid,this._jsPlumb.floatingEndpoint=null;this._jsPlumb.uuid&&(t.endpointsByUUID[this._jsPlumb.uuid]=this),this.elementId=t.elementId,this.dragProxy=t.dragProxy,this._jsPlumb.connectionCost=t.connectionCost,this._jsPlumb.connectionsDirected=t.connectionsDirected,this._jsPlumb.currentAnchorClass="",this._jsPlumb.events={};var h=!0===t.deleteOnEmpty;this.setDeleteOnEmpty=function(t){h=t};var d=function(){var t=l.endpointAnchorClassPrefix+"-"+this._jsPlumb.currentAnchorClass;this._jsPlumb.currentAnchorClass=this.anchor.getCssClass();var n=l.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");this.removeClass(t),this.addClass(n),e.updateClasses(this.element,n,t)}.bind(this);this.prepareAnchor=function(t){var e=this._jsPlumb.instance.makeAnchor(t,this.elementId,l);return e.bind("anchorChanged",function(t){this.fire("anchorChanged",{endpoint:this,anchor:t}),d()}.bind(this)),e},this.setPreparedAnchor=function(t,e){return this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId),this.anchor=t,d(),e||this._jsPlumb.instance.repaint(this.elementId),this},this.setAnchor=function(t,e){var n=this.prepareAnchor(t);return this.setPreparedAnchor(n,e),this};var p=function(t){if(this.connections.length>0)for(var e=0;e<this.connections.length;e++)this.connections[e].setHover(t,!1);else this.setHover(t)}.bind(this);this.bind("mouseover",function(){p(!0)}),this.bind("mouseout",function(){p(!1)}),t._transient||this._jsPlumb.instance.anchorManager.add(this,this.elementId),this.prepareEndpoint=function(i,o){var s,r=function(t,n){var i=l.getRenderMode();if(e.Endpoints[i][t])return new e.Endpoints[i][t](n);if(!l.Defaults.DoNotThrowErrors)throw{msg:"jsPlumb: unknown endpoint type '"+t+"'"}},a={_jsPlumb:this._jsPlumb.instance,cssClass:t.cssClass,container:t.container,tooltip:t.tooltip,connectorTooltip:t.connectorTooltip,endpoint:this};return n.isString(i)?s=r(i,a):n.isArray(i)?(a=n.merge(i[1],a),s=r(i[0],a)):s=i.clone(),s.clone=function(){return n.isString(i)?r(i,a):n.isArray(i)?(a=n.merge(i[1],a),r(i[0],a)):void 0}.bind(this),s.typeId=o,s},this.setEndpoint=function(t,e){var n=this.prepareEndpoint(t);this.setPreparedEndpoint(n,!0)},this.setPreparedEndpoint=function(t,e){null!=this.endpoint&&(this.endpoint.cleanup(),this.endpoint.destroy()),this.endpoint=t,this.type=this.endpoint.type,this.canvas=this.endpoint.canvas},e.extend(this,t,r),this.isSource=t.isSource||!1,this.isTemporarySource=t.isTemporarySource||!1,this.isTarget=t.isTarget||!1,this.connections=t.connections||[],this.connectorPointerEvents=t["connector-pointer-events"],this.scope=t.scope||l.getDefaultScope(),this.timestamp=null,this.reattachConnections=t.reattach||l.Defaults.ReattachConnections,this.connectionsDetachable=l.Defaults.ConnectionsDetachable,!1!==t.connectionsDetachable&&!1!==t.detachable||(this.connectionsDetachable=!1),this.dragAllowedWhenFull=!1!==t.dragAllowedWhenFull,t.onMaxConnections&&this.bind("maxConnections",t.onMaxConnections),this.addConnection=function(t){this.connections.push(t),this[(this.connections.length>0?"add":"remove")+"Class"](l.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](l.endpointFullClass)},this.detachFromConnection=function(t,e,n){e=null==e?this.connections.indexOf(t):e,e>=0&&(this.connections.splice(e,1),this[(this.connections.length>0?"add":"remove")+"Class"](l.endpointConnectedClass),this[(this.isFull()?"add":"remove")+"Class"](l.endpointFullClass)),!n&&h&&0===this.connections.length&&l.deleteObject({endpoint:this,fireEvent:!1,deleteAttachedObjects:!0!==n})},this.deleteEveryConnection=function(t){for(var e=this.connections.length,n=0;n<e;n++)l.deleteConnection(this.connections[0],t)},this.detachFrom=function(t,e,n){for(var i=[],o=0;o<this.connections.length;o++)this.connections[o].endpoints[1]!==t&&this.connections[o].endpoints[0]!==t||i.push(this.connections[o]);for(var s=0,r=i.length;s<r;s++)l.deleteConnection(i[0]);return this},this.getElement=function(){return this.element},this.setElement=function(i){var o=this._jsPlumb.instance.getId(i),s=this.elementId;return n.removeWithFunction(t.endpointsByElement[this.elementId],function(t){return t.id===this.id}.bind(this)),this.element=e.getElement(i),this.elementId=l.getId(this.element),l.anchorManager.rehomeEndpoint(this,s,this.element),l.dragManager.endpointAdded(this.element),n.addToList(t.endpointsByElement,o,this),this},this.makeInPlaceCopy=function(){var e=this.anchor.getCurrentLocation({element:this}),n=this.anchor.getOrientation(this),i=this.anchor.getCssClass(),o={bind:function(){},compute:function(){return[e[0],e[1]]},getCurrentLocation:function(){return[e[0],e[1]]},getOrientation:function(){return n},getCssClass:function(){return i}};return c({dropOptions:t.dropOptions,anchor:o,source:this.element,paintStyle:this.getPaintStyle(),endpoint:t.hideOnDrag?"Blank":this.endpoint,_transient:!0,scope:this.scope,reference:this})},this.connectorSelector=function(){var t=this.connections[0];return t||(this.connections.length<this._jsPlumb.maxConnections||-1===this._jsPlumb.maxConnections?null:t)},this.setStyle=this.setPaintStyle,this.paint=function(t){t=t||{};var e=t.timestamp,n=!(!1===t.recalc);if(!e||this.timestamp!==e){var i=l.updateOffset({elId:this.elementId,timestamp:e}),o=t.offset?t.offset.o:i.o;if(null!=o){var s=t.anchorPoint,r=t.connectorPaintStyle;if(null==s){var u=t.dimensions||i.s,c={xy:[o.left,o.top],wh:u,element:this,timestamp:e};if(n&&this.anchor.isDynamic&&this.connections.length>0){var h=a(this,t.elementWithPrecedence),d=h.endpoints[0]===this?1:0,p=0===d?h.sourceId:h.targetId,f=l.getCachedData(p),g=f.o,m=f.s;c.index=0===d?1:0,c.connection=h,c.txy=[g.left,g.top],c.twh=m,c.tElement=h.endpoints[d]}s=this.anchor.compute(c)}this.endpoint.compute(s,this.anchor.getOrientation(this),this._jsPlumb.paintStyleInUse,r||this.paintStyleInUse),this.endpoint.paint(this._jsPlumb.paintStyleInUse,this.anchor),this.timestamp=e;for(var v in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(v)){var y=this._jsPlumb.overlays[v];y.isVisible()&&(this._jsPlumb.overlayPlacements[v]=y.draw(this.endpoint,this._jsPlumb.paintStyleInUse),y.paint(this._jsPlumb.overlayPlacements[v]))}}}},this.getTypeDescriptor=function(){return"endpoint"},this.isVisible=function(){return this._jsPlumb.visible},this.repaint=this.paint;var f=!1;this.initDraggable=function(){if(!f&&e.isDragSupported(this.element)){var r,a={id:null,element:null},h=null,d=!1,p=null,g=i(this,a,l),m=t.dragOptions||{},v={},y=e.dragEvents.start,b=e.dragEvents.stop,P=e.dragEvents.drag,_=e.dragEvents.beforeStart,x=function(t){r=t.e.payload||{}},C=function(i){h=this.connectorSelector();var f=!0;this.isEnabled()||(f=!1),null!=h||this.isSource||this.isTemporarySource||(f=!1),!this.isSource||!this.isFull()||null!=h&&this.dragAllowedWhenFull||(f=!1),null==h||h.isDetachable(this)||(f=!1);var m=l.checkCondition(null==h?"beforeDrag":"beforeStartDetach",{endpoint:this,source:this.element,sourceId:this.elementId,connection:h});if(!1===m?f=!1:"object"==typeof m?e.extend(m,r||{}):m=r||{},!1===f)return l.stopDrag&&l.stopDrag(this.canvas),g.stopDrag(),!1;for(var v=0;v<this.connections.length;v++)this.connections[v].setHover(!1);this.addClass("endpointDrag"),l.setConnectionBeingDragged(!0),h&&!this.isFull()&&this.isSource&&(h=null),l.updateOffset({elId:this.elementId});var y=this._jsPlumb.instance.getOffset(this.canvas),b=this.canvas,P=this._jsPlumb.instance.getSize(this.canvas);o(a,l,y,P),l.setAttributes(this.canvas,{dragId:a.id,elId:this.elementId});var _=this.dragProxy||this.endpoint;if(null==this.dragProxy&&null!=this.connectionType){var x=this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);x.endpoints[1]&&(_=x.endpoints[1])}var C=this._jsPlumb.instance.makeAnchor("Center");C.isFloating=!0,this._jsPlumb.floatingEndpoint=s(this.getPaintStyle(),C,_,this.canvas,a.element,l,c,this.scope);var E=this._jsPlumb.floatingEndpoint.anchor;if(null==h)this.setHover(!1,!1),h=u({sourceEndpoint:this,targetEndpoint:this._jsPlumb.floatingEndpoint,source:this.element,target:a.element,anchors:[this.anchor,this._jsPlumb.floatingEndpoint.anchor],paintStyle:t.connectorStyle,hoverPaintStyle:t.connectorHoverStyle,connector:t.connector,overlays:t.connectorOverlays,type:this.connectionType,cssClass:this.connectorClass,hoverClass:this.connectorHoverClass,scope:t.scope,data:m}),h.pending=!0,h.addClass(l.draggingClass),this._jsPlumb.floatingEndpoint.addClass(l.draggingClass),this._jsPlumb.floatingEndpoint.anchor=E,l.fire("connectionDrag",h),l.anchorManager.newConnection(h);else{d=!0,h.setHover(!1);var j=h.endpoints[0].id===this.id?0:1;this.detachFromConnection(h,null,!0);var S=l.getDragScope(b);l.setAttribute(this.canvas,"originalScope",S),l.fire("connectionDrag",h),0===j?(p=[h.source,h.sourceId,b,S],l.anchorManager.sourceChanged(h.endpoints[j].elementId,a.id,h,a.element)):(p=[h.target,h.targetId,b,S],h.target=a.element,h.targetId=a.id,l.anchorManager.updateOtherEndpoint(h.sourceId,h.endpoints[j].elementId,h.targetId,h)),h.suspendedEndpoint=h.endpoints[j],h.suspendedElement=h.endpoints[j].getElement(),h.suspendedElementId=h.endpoints[j].elementId,h.suspendedElementType=0===j?"source":"target",h.suspendedEndpoint.setHover(!1),this._jsPlumb.floatingEndpoint.referenceEndpoint=h.suspendedEndpoint,h.endpoints[j]=this._jsPlumb.floatingEndpoint,h.addClass(l.draggingClass),this._jsPlumb.floatingEndpoint.addClass(l.draggingClass)}l.floatingConnections[a.id]=h,n.addToList(t.endpointsByElement,a.id,this._jsPlumb.floatingEndpoint),l.currentlyDragging=!0}.bind(this),E=function(){if(l.setConnectionBeingDragged(!1),h&&null!=h.endpoints){var t=l.getDropEvent(arguments),e=l.getFloatingAnchorIndex(h);if(h.endpoints[0===e?1:0].anchor.locked=!1,h.removeClass(l.draggingClass),this._jsPlumb&&(h.deleteConnectionNow||h.endpoints[e]===this._jsPlumb.floatingEndpoint)&&d&&h.suspendedEndpoint){0===e?(h.floatingElement=h.source,h.floatingId=h.sourceId,h.floatingEndpoint=h.endpoints[0],h.floatingIndex=0,h.source=p[0],h.sourceId=p[1]):(h.floatingElement=h.target,h.floatingId=h.targetId,h.floatingEndpoint=h.endpoints[1],h.floatingIndex=1,h.target=p[0],h.targetId=p[1]);var n=this._jsPlumb.floatingEndpoint;l.setDragScope(p[2],p[3]),h.endpoints[e]=h.suspendedEndpoint,h.isReattach()||h._forceReattach||h._forceDetach||!l.deleteConnection(h,{originalEvent:t})?(h.setHover(!1),h._forceDetach=null,h._forceReattach=null,this._jsPlumb.floatingEndpoint.detachFromConnection(h),h.suspendedEndpoint.addConnection(h),1===e?l.anchorManager.updateOtherEndpoint(h.sourceId,h.floatingId,h.targetId,h):l.anchorManager.sourceChanged(h.floatingId,h.sourceId,h,h.source),l.repaint(p[1])):l.deleteObject({endpoint:n})}this.deleteAfterDragStop?l.deleteObject({endpoint:this}):this._jsPlumb&&this.paint({recalc:!1}),l.fire("connectionDragStop",h,t),h.pending&&l.fire("connectionAborted",h,t),l.currentlyDragging=!1,h.suspendedElement=null,h.suspendedEndpoint=null,h=null}a&&a.element&&l.remove(a.element,!1,!1),this._jsPlumb&&(this.canvas.style.visibility="visible",this.anchor.locked=!1,this._jsPlumb.floatingEndpoint=null)}.bind(this);m=e.extend(v,m),m.scope=this.scope||m.scope,m[_]=n.wrap(m[_],x,!1),m[y]=n.wrap(m[y],C,!1),m[P]=n.wrap(m[P],g.drag),m[b]=n.wrap(m[b],E),m.multipleDrop=!1,m.canDrag=function(){return this.isSource||this.isTemporarySource||this.connections.length>0}.bind(this),l.initDraggable(this.canvas,m,"internal"),this.canvas._jsPlumbRelatedElement=this.element,f=!0}};var g=t.endpoint||this._jsPlumb.instance.Defaults.Endpoint||e.Defaults.Endpoint;this.setEndpoint(g,!0);var m=t.anchor?t.anchor:t.anchors?t.anchors:l.Defaults.Anchor||"Top";this.setAnchor(m,!0);var v=["default",t.type||""].join(" ");this.addType(v,t.data,!0),this.canvas=this.endpoint.canvas,this.canvas._jsPlumb=this,this.initDraggable();var y=function(i,o,s,r){if(e.isDropSupported(this.element)){var a=t.dropOptions||l.Defaults.DropOptions||e.Defaults.DropOptions;a=e.extend({},a),a.scope=a.scope||this.scope;var u=e.dragEvents.drop,c=e.dragEvents.over,h=e.dragEvents.out,d=this,p=l.EndpointDropHandler({getEndpoint:function(){return d},jsPlumb:l,enabled:function(){return null==s||s.isEnabled()},isFull:function(){return s.isFull()},element:this.element,elementId:this.elementId,isSource:this.isSource,isTarget:this.isTarget,addClass:function(t){d.addClass(t)},removeClass:function(t){d.removeClass(t)},isDropAllowed:function(){return d.isDropAllowed.apply(d,arguments)},reference:r,isRedrop:function(t,e){return t.suspendedEndpoint&&e.reference&&t.suspendedEndpoint.id===e.reference.id}});a[u]=n.wrap(a[u],p,!0),a[c]=n.wrap(a[c],function(){var t=e.getDragObject(arguments),n=l.getAttribute(e.getElement(t),"dragId"),i=l.floatingConnections[n];if(null!=i){var o=l.getFloatingAnchorIndex(i);if(this.isTarget&&0!==o||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===i.suspendedEndpoint.id){var s=l.checkCondition("checkDropAllowed",{sourceEndpoint:i.endpoints[o],targetEndpoint:this,connection:i});this[(s?"add":"remove")+"Class"](l.endpointDropAllowedClass),this[(s?"remove":"add")+"Class"](l.endpointDropForbiddenClass),i.endpoints[o].anchor.over(this.anchor,this)}}}.bind(this)),a[h]=n.wrap(a[h],function(){var t=e.getDragObject(arguments),n=null==t?null:l.getAttribute(e.getElement(t),"dragId"),i=n?l.floatingConnections[n]:null;if(null!=i){var o=l.getFloatingAnchorIndex(i);(this.isTarget&&0!==o||i.suspendedEndpoint&&this.referenceEndpoint&&this.referenceEndpoint.id===i.suspendedEndpoint.id)&&(this.removeClass(l.endpointDropAllowedClass),this.removeClass(l.endpointDropForbiddenClass),i.endpoints[o].anchor.out())}}.bind(this)),l.initDroppable(i,a,"internal",o)}}.bind(this);return this.anchor.isFloating||y(this.canvas,!(t._transient||this.anchor.isFloating),this,t.reference),this},n.extend(e.Endpoint,e.OverlayCapableJsPlumbUIComponent,{setVisible:function(t,e,n){if(this._jsPlumb.visible=t,this.canvas&&(this.canvas.style.display=t?"block":"none"),this[t?"showOverlays":"hideOverlays"](),!e)for(var i=0;i<this.connections.length;i++)if(this.connections[i].setVisible(t),!n){var o=this===this.connections[i].endpoints[0]?1:0;1===this.connections[i].endpoints[o].connections.length&&this.connections[i].endpoints[o].setVisible(t,!0,!0)}},getAttachedElements:function(){return this.connections},applyType:function(t,n){this.setPaintStyle(t.endpointStyle||t.paintStyle,n),this.setHoverPaintStyle(t.endpointHoverStyle||t.hoverPaintStyle,n),null!=t.maxConnections&&(this._jsPlumb.maxConnections=t.maxConnections),t.scope&&(this.scope=t.scope),e.extend(this,t,r),null!=t.cssClass&&this.canvas&&this._jsPlumb.instance.addClass(this.canvas,t.cssClass),e.OverlayCapableJsPlumbUIComponent.applyType(this,t)},isEnabled:function(){return this._jsPlumb.enabled},setEnabled:function(t){this._jsPlumb.enabled=t},cleanup:function(){var t=this._jsPlumb.instance.endpointAnchorClassPrefix+(this._jsPlumb.currentAnchorClass?"-"+this._jsPlumb.currentAnchorClass:"");e.removeClass(this.element,t),this.anchor=null,this.endpoint.cleanup(!0),this.endpoint.destroy(),this.endpoint=null,this._jsPlumb.instance.destroyDraggable(this.canvas,"internal"),this._jsPlumb.instance.destroyDroppable(this.canvas,"internal")},setHover:function(t){this.endpoint&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()&&this.endpoint.setHover(t)},isFull:function(){return 0===this._jsPlumb.maxConnections||!(this.isFloating()||this._jsPlumb.maxConnections<0||this.connections.length<this._jsPlumb.maxConnections)},isFloating:function(){return null!=this.anchor&&this.anchor.isFloating},isConnectedTo:function(t){var e=!1;if(t)for(var n=0;n<this.connections.length;n++)if(this.connections[n].endpoints[1]===t||this.connections[n].endpoints[0]===t){e=!0;break}return e},getConnectionCost:function(){return this._jsPlumb.connectionCost},setConnectionCost:function(t){this._jsPlumb.connectionCost=t},areConnectionsDirected:function(){return this._jsPlumb.connectionsDirected},setConnectionsDirected:function(t){this._jsPlumb.connectionsDirected=t},setElementId:function(t){this.elementId=t,this.anchor.elementId=t},setReferenceElement:function(t){this.element=e.getElement(t)},setDragAllowedWhenFull:function(t){this.dragAllowedWhenFull=t},equals:function(t){return this.anchor.equals(t.anchor)},getUuid:function(){return this._jsPlumb.uuid},computeAnchor:function(t){return this.anchor.compute(t)}}),t.jsPlumbInstance.prototype.EndpointDropHandler=function(t){return function(e){var i=t.jsPlumb;t.removeClass(i.endpointDropAllowedClass),t.removeClass(i.endpointDropForbiddenClass);var o=i.getDropEvent(arguments),s=i.getDragObject(arguments),r=i.getAttribute(s,"dragId"),a=(i.getAttribute(s,"elId"),i.getAttribute(s,"originalScope")),l=i.floatingConnections[r];if(null!=l){var u=null!=l.suspendedEndpoint;if(!u||null!=l.suspendedEndpoint._jsPlumb){var c=t.getEndpoint(l);if(null!=c){if(t.isRedrop(l,t))return l._forceReattach=!0,l.setHover(!1),void(t.maybeCleanup&&t.maybeCleanup(c));var h=i.getFloatingAnchorIndex(l);if(0===h&&!t.isSource||1===h&&!t.isTarget)return void(t.maybeCleanup&&t.maybeCleanup(c));t.onDrop&&t.onDrop(l),a&&i.setDragScope(s,a);var d=t.isFull(e);if(d&&c.fire("maxConnections",{endpoint:this,connection:l,maxConnections:c._jsPlumb.maxConnections},o),!d&&t.enabled()){var p=!0;0===h?(l.floatingElement=l.source,l.floatingId=l.sourceId,l.floatingEndpoint=l.endpoints[0],l.floatingIndex=0,l.source=t.element,l.sourceId=t.elementId):(l.floatingElement=l.target,l.floatingId=l.targetId,l.floatingEndpoint=l.endpoints[1],l.floatingIndex=1,l.target=t.element,l.targetId=t.elementId),u&&l.suspendedEndpoint.id!==c.id&&(l.isDetachAllowed(l)&&l.endpoints[h].isDetachAllowed(l)&&l.suspendedEndpoint.isDetachAllowed(l)&&i.checkCondition("beforeDetach",l)||(p=!1));var f=function(e){l.endpoints[h].detachFromConnection(l),l.suspendedEndpoint&&l.suspendedEndpoint.detachFromConnection(l),l.endpoints[h]=c,c.addConnection(l);var s=c.getParameters();for(var r in s)l.setParameter(r,s[r]);if(u){var a=l.suspendedEndpoint.elementId;i.fireMoveEvent({index:h,originalSourceId:0===h?a:l.sourceId,newSourceId:0===h?c.elementId:l.sourceId,originalTargetId:1===h?a:l.targetId,newTargetId:1===h?c.elementId:l.targetId,originalSourceEndpoint:0===h?l.suspendedEndpoint:l.endpoints[0],newSourceEndpoint:0===h?c:l.endpoints[0],originalTargetEndpoint:1===h?l.suspendedEndpoint:l.endpoints[1],newTargetEndpoint:1===h?c:l.endpoints[1],connection:l},o)}else s.draggable&&i.initDraggable(this.element,t.dragOptions,"internal",i);if(1===h?i.anchorManager.updateOtherEndpoint(l.sourceId,l.floatingId,l.targetId,l):i.anchorManager.sourceChanged(l.floatingId,l.sourceId,l,l.source),l.endpoints[0].finalEndpoint){l.endpoints[0].detachFromConnection(l),l.endpoints[0]=l.endpoints[0].finalEndpoint,l.endpoints[0].addConnection(l)}n.isObject(e)&&l.mergeData(e),i.finaliseConnection(l,null,o,!1),l.setHover(!1)}.bind(this);if(p=p&&t.isDropAllowed(l.sourceId,l.targetId,l.scope,l,c))return f(p),!0;!function(){l.suspendedEndpoint&&(l.endpoints[h]=l.suspendedEndpoint,l.setHover(!1),l._forceDetach=!0,0===h?(l.source=l.suspendedEndpoint.element,l.sourceId=l.suspendedEndpoint.elementId):(l.target=l.suspendedEndpoint.element,l.targetId=l.suspendedEndpoint.elementId),l.suspendedEndpoint.addConnection(l),1===h?i.anchorManager.updateOtherEndpoint(l.sourceId,l.floatingId,l.targetId,l):i.anchorManager.sourceChanged(l.floatingId,l.sourceId,l,l.source),i.repaint(l.sourceId),l._forceDetach=!1)}()}t.maybeCleanup&&t.maybeCleanup(c),i.currentlyDragging=!1}}}}}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,n,i,o,s){if(!t.Defaults.DoNotThrowErrors&&null==e.Connectors[n][i])throw{msg:"jsPlumb: unknown connector type '"+i+"'"};return new e.Connectors[n][i](o,s)},o=function(t,e,n){return t?n.makeAnchor(t,e,n):null},s=function(t,e,i,o){null!=e&&(e._jsPlumbConnections=e._jsPlumbConnections||{},o?delete e._jsPlumbConnections[t.id]:e._jsPlumbConnections[t.id]=!0,n.isEmpty(e._jsPlumbConnections)?i.removeClass(e,i.connectedClass):i.addClass(e,i.connectedClass))};e.Connection=function(t){var i=t.newEndpoint;this.id=t.id,this.connector=null,this.idPrefix="_jsplumb_c_",this.defaultLabelLocation=.5,this.defaultOverlayKeys=["Overlays","ConnectionOverlays"],this.previousConnection=t.previousConnection,this.source=e.getElement(t.source),this.target=e.getElement(t.target),t.sourceEndpoint&&(this.source=t.sourceEndpoint.getElement()),t.targetEndpoint&&(this.target=t.targetEndpoint.getElement()),e.OverlayCapableJsPlumbUIComponent.apply(this,arguments),this.sourceId=this._jsPlumb.instance.getId(this.source),this.targetId=this._jsPlumb.instance.getId(this.target),this.scope=t.scope,this.endpoints=[],this.endpointStyles=[];var o=this._jsPlumb.instance;o.manage(this.sourceId,this.source),o.manage(this.targetId,this.target),this._jsPlumb.visible=!0,this._jsPlumb.editable=!0===t.editable,this._jsPlumb.params={cssClass:t.cssClass,container:t.container,"pointer-events":t["pointer-events"],editorParams:t.editorParams,overlays:t.overlays},this._jsPlumb.lastPaintedAt=null,this.bind("mouseover",function(){this.setHover(!0)}.bind(this)),this.bind("mouseout",function(){this.setHover(!1)}.bind(this)),this.editableRequested=!1!==t.editable,this.setEditable=function(t){return!!this.connector&&this.connector.setEditable(t)},this.isEditable=function(){return!!this.connector&&this.connector.isEditable()},this.isEditing=function(){return!!this.connector&&this.connector.isEditing()},this.makeEndpoint=function(e,n,s,r){return s=s||this._jsPlumb.instance.getId(n),this.prepareEndpoint(o,i,this,r,e?0:1,t,n,s)},t.type&&(t.endpoints=t.endpoints||this._jsPlumb.instance.deriveEndpointAndAnchorSpec(t.type).endpoints);var s=this.makeEndpoint(!0,this.source,this.sourceId,t.sourceEndpoint),r=this.makeEndpoint(!1,this.target,this.targetId,t.targetEndpoint);s&&n.addToList(t.endpointsByElement,this.sourceId,s),r&&n.addToList(t.endpointsByElement,this.targetId,r),this.scope||(this.scope=this.endpoints[0].scope),null!=t.deleteEndpointsOnEmpty&&(this.endpoints[0].setDeleteOnEmpty(t.deleteEndpointsOnEmpty),this.endpoints[1].setDeleteOnEmpty(t.deleteEndpointsOnEmpty));var a=o.Defaults.ConnectionsDetachable;!1===t.detachable&&(a=!1),!1===this.endpoints[0].connectionsDetachable&&(a=!1),!1===this.endpoints[1].connectionsDetachable&&(a=!1);var l=t.reattach||this.endpoints[0].reattachConnections||this.endpoints[1].reattachConnections||o.Defaults.ReattachConnections;this.appendToDefaultType({detachable:a,reattach:l,paintStyle:this.endpoints[0].connectorStyle||this.endpoints[1].connectorStyle||t.paintStyle||o.Defaults.PaintStyle||e.Defaults.PaintStyle,hoverPaintStyle:this.endpoints[0].connectorHoverStyle||this.endpoints[1].connectorHoverStyle||t.hoverPaintStyle||o.Defaults.HoverPaintStyle||e.Defaults.HoverPaintStyle});var u=o.getSuspendedAt();if(!o.isSuspendDrawing()){var c=o.getCachedData(this.sourceId),h=c.o,d=c.s,p=o.getCachedData(this.targetId),f=p.o,g=p.s,m=u||o.timestamp(),v=this.endpoints[0].anchor.compute({xy:[h.left,h.top],wh:d,element:this.endpoints[0],elementId:this.endpoints[0].elementId,txy:[f.left,f.top],twh:g,tElement:this.endpoints[1],timestamp:m});this.endpoints[0].paint({anchorLoc:v,timestamp:m}),v=this.endpoints[1].anchor.compute({xy:[f.left,f.top],wh:g,element:this.endpoints[1],elementId:this.endpoints[1].elementId,txy:[h.left,h.top],twh:d,tElement:this.endpoints[0],timestamp:m}),this.endpoints[1].paint({anchorLoc:v,timestamp:m})}this.getTypeDescriptor=function(){return"connection"},this.getAttachedElements=function(){return this.endpoints},this.isDetachable=function(){return!0===this._jsPlumb.detachable},this.setDetachable=function(t){this._jsPlumb.detachable=!0===t},this.isReattach=function(){return!0===this._jsPlumb.reattach||!0===this.endpoints[0].reattachConnections||!0===this.endpoints[1].reattachConnections},this.setReattach=function(t){this._jsPlumb.reattach=!0===t},this._jsPlumb.cost=t.cost||this.endpoints[0].getConnectionCost(),this._jsPlumb.directed=t.directed,null==t.directed&&(this._jsPlumb.directed=this.endpoints[0].areConnectionsDirected());var y=e.extend({},this.endpoints[1].getParameters());e.extend(y,this.endpoints[0].getParameters()),e.extend(y,this.getParameters()),this.setParameters(y),this.setConnector(this.endpoints[0].connector||this.endpoints[1].connector||t.connector||o.Defaults.Connector||e.Defaults.Connector,!0),t.geometry&&this.connector.setGeometry(t.geometry);var b=null!=t.data&&n.isObject(t.data)?t.data:{};this.getData=function(){return b},this.setData=function(t){b=t||{}},this.mergeData=function(t){b=e.extend(b,t)};var P=["default",this.endpoints[0].connectionType,this.endpoints[1].connectionType,t.type].join(" ");/[^\s]/.test(P)&&this.addType(P,t.data,!0),this.updateConnectedClass()},n.extend(e.Connection,e.OverlayCapableJsPlumbUIComponent,{applyType:function(t,n,i){var o=null;null!=t.connector&&(o=this.getCachedTypeItem("connector",i.connector),null==o&&(o=this.prepareConnector(t.connector,i.connector),this.cacheTypeItem("connector",o,i.connector)),this.setPreparedConnector(o)),null!=t.detachable&&this.setDetachable(t.detachable),null!=t.reattach&&this.setReattach(t.reattach),t.scope&&(this.scope=t.scope),null!=t.cssClass&&this.canvas&&this._jsPlumb.instance.addClass(this.canvas,t.cssClass);var s=null;t.anchor?null==(s=this.getCachedTypeItem("anchors",i.anchor))&&(s=[this._jsPlumb.instance.makeAnchor(t.anchor),this._jsPlumb.instance.makeAnchor(t.anchor)],this.cacheTypeItem("anchors",s,i.anchor)):t.anchors&&null==(s=this.getCachedTypeItem("anchors",i.anchors))&&(s=[this._jsPlumb.instance.makeAnchor(t.anchors[0]),this._jsPlumb.instance.makeAnchor(t.anchors[1])],this.cacheTypeItem("anchors",s,i.anchors)),null!=s&&(this.endpoints[0].anchor=s[0],this.endpoints[1].anchor=s[1],this.endpoints[1].anchor.isDynamic&&this._jsPlumb.instance.repaint(this.endpoints[1].elementId)),e.OverlayCapableJsPlumbUIComponent.applyType(this,t)},addClass:function(t,e){e&&(this.endpoints[0].addClass(t),this.endpoints[1].addClass(t),this.suspendedEndpoint&&this.suspendedEndpoint.addClass(t)),this.connector&&this.connector.addClass(t)},removeClass:function(t,e){e&&(this.endpoints[0].removeClass(t),this.endpoints[1].removeClass(t),this.suspendedEndpoint&&this.suspendedEndpoint.removeClass(t)),this.connector&&this.connector.removeClass(t)},isVisible:function(){return this._jsPlumb.visible},setVisible:function(t){this._jsPlumb.visible=t,this.connector&&this.connector.setVisible(t),this.repaint()},cleanup:function(){this.updateConnectedClass(!0),this.endpoints=null,this.source=null,this.target=null,null!=this.connector&&(this.connector.cleanup(!0),this.connector.destroy(!0)),this.connector=null},updateConnectedClass:function(t){this._jsPlumb&&(s(this,this.source,this._jsPlumb.instance,t),s(this,this.target,this._jsPlumb.instance,t))},setHover:function(e){this.connector&&this._jsPlumb&&!this._jsPlumb.instance.isConnectionBeingDragged()&&(this.connector.setHover(e),t.jsPlumb[e?"addClass":"removeClass"](this.source,this._jsPlumb.instance.hoverSourceClass),t.jsPlumb[e?"addClass":"removeClass"](this.target,this._jsPlumb.instance.hoverTargetClass))},getUuids:function(){return[this.endpoints[0].getUuid(),this.endpoints[1].getUuid()]},getCost:function(){return this._jsPlumb?this._jsPlumb.cost:-1/0},setCost:function(t){this._jsPlumb.cost=t},isDirected:function(){return!0===this._jsPlumb.directed},getConnector:function(){return this.connector},getGeometry:function(){return this.connector?this.connector.getGeometry():null},setGeometry:function(t){this.connector&&this.connector.setGeometry(t)},prepareConnector:function(t,e){var o,s={_jsPlumb:this._jsPlumb.instance,cssClass:(this._jsPlumb.params.cssClass||"")+(this.isEditable()?this._jsPlumb.instance.editableConnectorClass:""),container:this._jsPlumb.params.container,"pointer-events":this._jsPlumb.params["pointer-events"],editable:this.editableRequested},r=this._jsPlumb.instance.getRenderMode();return n.isString(t)?o=i(this._jsPlumb.instance,r,t,s,this):n.isArray(t)&&(o=1===t.length?i(this._jsPlumb.instance,r,t[0],s,this):i(this._jsPlumb.instance,r,t[0],n.merge(t[1],s),this)),null!=e&&(o.typeId=e),o},setPreparedConnector:function(t,e,n,i){var o,s="";if(null!=this.connector&&(o=this.connector,s=o.getClass(),this.connector.cleanup(),this.connector.destroy()),this.connector=t,i&&this.cacheTypeItem("connector",t,i),this.canvas=this.connector.canvas,this.bgCanvas=this.connector.bgCanvas,this.addClass(s),this.canvas&&(this.canvas._jsPlumb=this),this.bgCanvas&&(this.bgCanvas._jsPlumb=this),null!=o)for(var r=this.getOverlays(),a=0;a<r.length;a++)r[a].transfer&&r[a].transfer(this.connector);n||this.setListenerComponent(this.connector),e||this.repaint()},setConnector:function(t,e,n,i){var o=this.prepareConnector(t,i);this.setPreparedConnector(o,e,n,i)},paint:function(t){if(!this._jsPlumb.instance.isSuspendDrawing()&&this._jsPlumb.visible){t=t||{};var e=t.timestamp,n=this.targetId,i=this.sourceId;if(null==e||e!==this._jsPlumb.lastPaintedAt){var o=this._jsPlumb.instance.updateOffset({elId:i}).o,s=this._jsPlumb.instance.updateOffset({elId:n}).o,r=this.endpoints[0],a=this.endpoints[1],l=r.anchor.getCurrentLocation({xy:[o.left,o.top],wh:[o.width,o.height],element:r,timestamp:e}),u=a.anchor.getCurrentLocation({xy:[s.left,s.top],wh:[s.width,s.height],element:a,timestamp:e});this.connector.resetBounds(),this.connector.compute({sourcePos:l,targetPos:u,sourceEndpoint:this.endpoints[0],targetEndpoint:this.endpoints[1],"stroke-width":this._jsPlumb.paintStyleInUse.strokeWidth,sourceInfo:o,targetInfo:s});var c={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(var h in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(h)){var d=this._jsPlumb.overlays[h];d.isVisible()&&(this._jsPlumb.overlayPlacements[h]=d.draw(this.connector,this._jsPlumb.paintStyleInUse,this.getAbsoluteOverlayPosition(d)),c.minX=Math.min(c.minX,this._jsPlumb.overlayPlacements[h].minX),c.maxX=Math.max(c.maxX,this._jsPlumb.overlayPlacements[h].maxX),c.minY=Math.min(c.minY,this._jsPlumb.overlayPlacements[h].minY),c.maxY=Math.max(c.maxY,this._jsPlumb.overlayPlacements[h].maxY))}var p=parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth||1)/2,f=parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth||0),g={xmin:Math.min(this.connector.bounds.minX-(p+f),c.minX),ymin:Math.min(this.connector.bounds.minY-(p+f),c.minY),xmax:Math.max(this.connector.bounds.maxX+(p+f),c.maxX),ymax:Math.max(this.connector.bounds.maxY+(p+f),c.maxY)};this.connector.paint(this._jsPlumb.paintStyleInUse,null,g);for(var m in this._jsPlumb.overlays)if(this._jsPlumb.overlays.hasOwnProperty(m)){var v=this._jsPlumb.overlays[m];v.isVisible()&&v.paint(this._jsPlumb.overlayPlacements[m],g)}}this._jsPlumb.lastPaintedAt=e}},repaint:function(t){t=t||{},this.paint({elId:this.sourceId,recalc:!(!1===t.recalc),timestamp:t.timestamp})},prepareEndpoint:function(t,n,i,s,r,a,l,u){var c;if(s)i.endpoints[r]=s,s.addConnection(i);else{a.endpoints||(a.endpoints=[null,null]);var h=a.endpoints[r]||a.endpoint||t.Defaults.Endpoints[r]||e.Defaults.Endpoints[r]||t.Defaults.Endpoint||e.Defaults.Endpoint;a.endpointStyles||(a.endpointStyles=[null,null]),a.endpointHoverStyles||(a.endpointHoverStyles=[null,null]);var d=a.endpointStyles[r]||a.endpointStyle||t.Defaults.EndpointStyles[r]||e.Defaults.EndpointStyles[r]||t.Defaults.EndpointStyle||e.Defaults.EndpointStyle;null==d.fill&&null!=a.paintStyle&&(d.fill=a.paintStyle.stroke),null==d.outlineStroke&&null!=a.paintStyle&&(d.outlineStroke=a.paintStyle.outlineStroke),null==d.outlineWidth&&null!=a.paintStyle&&(d.outlineWidth=a.paintStyle.outlineWidth);var p=a.endpointHoverStyles[r]||a.endpointHoverStyle||t.Defaults.EndpointHoverStyles[r]||e.Defaults.EndpointHoverStyles[r]||t.Defaults.EndpointHoverStyle||e.Defaults.EndpointHoverStyle;null!=a.hoverPaintStyle&&(null==p&&(p={}),null==p.fill&&(p.fill=a.hoverPaintStyle.stroke));var f=a.anchors?a.anchors[r]:a.anchor?a.anchor:o(t.Defaults.Anchors[r],u,t)||o(e.Defaults.Anchors[r],u,t)||o(t.Defaults.Anchor,u,t)||o(e.Defaults.Anchor,u,t);c=n({paintStyle:d,hoverPaintStyle:p,endpoint:h,connections:[i],uuid:a.uuids?a.uuids[r]:null,anchor:f,source:l,scope:a.scope,reattach:a.reattach||t.Defaults.ReattachConnections,detachable:a.detachable||t.Defaults.ConnectionsDetachable}),null==s&&c.setDeleteOnEmpty(!0),i.endpoints[r]=c,!1===a.drawEndpoints&&c.setVisible(!1,!0,!0)}return c}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumbUtil,n=t.jsPlumb;n.AnchorManager=function(t){var i={},o={},s={},r={},a={HORIZONTAL:"horizontal",VERTICAL:"vertical",DIAGONAL:"diagonal",IDENTITY:"identity"},l=["left","top","right","bottom"],u={},c=this,h={},d=t.jsPlumbInstance,p={},f=function(t,e,n,i,o,s){if(t===e)return{orientation:a.IDENTITY,a:["top","top"]};var r=Math.atan2(i.centery-n.centery,i.centerx-n.centerx),u=Math.atan2(n.centery-i.centery,n.centerx-i.centerx),c=[],h={};!function(t,e){for(var n=0;n<t.length;n++)h[t[n]]={left:[e[n].left,e[n].centery],right:[e[n].right,e[n].centery],top:[e[n].centerx,e[n].top],bottom:[e[n].centerx,e[n].bottom]}}(["source","target"],[n,i]);for(var d=0;d<l.length;d++)for(var p=0;p<l.length;p++)c.push({source:l[d],target:l[p],dist:Biltong.lineLength(h.source[l[d]],h.target[l[p]])});c.sort(function(t,e){return t.dist<e.dist?-1:t.dist>e.dist?1:0});for(var f=c[0].source,g=c[0].target,m=0;m<c.length&&(f=!o.isContinuous||o.isEdgeSupported(c[m].source)?c[m].source:null,g=!s.isContinuous||s.isEdgeSupported(c[m].target)?c[m].target:null,null==f||null==g);m++);return{a:[f,g],theta:r,theta2:u}},g=function(t,e,n,i,o,s,r){for(var a=[],l=e[o?0:1]/(i.length+1),u=0;u<i.length;u++){var c=(u+1)*l,h=s*e[o?1:0];r&&(c=e[o?0:1]-c);var d=o?c:h,p=n[0]+d,f=d/e[0],g=o?h:c,m=n[1]+g,v=g/e[1];a.push([p,m,f,v,i[u][1],i[u][2]])}return a},m=function(t){return function(e,n){var i=!0;return i=t?e[0][0]<n[0][0]:e[0][0]>n[0][0],!1===i?-1:1}},v=function(t,e){return(t[0][0]<0?-Math.PI-t[0][0]:Math.PI-t[0][0])>(e[0][0]<0?-Math.PI-e[0][0]:Math.PI-e[0][0])?1:-1},y={top:function(t,e){return t[0]>e[0]?1:-1},right:m(!0),bottom:m(!0),left:v},b=function(t,e){return t.sort(e)},P=function(t,e){var n=d.getCachedData(t),i=n.s,s=n.o,a=function(e,n,i,s,a,l,u){if(s.length>0)for(var c=b(s,y[e]),h="right"===e||"top"===e,d=g(0,n,i,c,a,l,h),p=function(t,e){o[t.id]=[e[0],e[1],e[2],e[3]],r[t.id]=u},f=0;f<d.length;f++){var m=d[f][4],v=m.endpoints[0].elementId===t,P=m.endpoints[1].elementId===t;v&&p(m.endpoints[0],d[f]),P&&p(m.endpoints[1],d[f])}};a("bottom",i,[s.left,s.top],e.bottom,!0,1,[0,1]),a("top",i,[s.left,s.top],e.top,!0,0,[0,-1]),a("left",i,[s.left,s.top],e.left,!1,0,[-1,0]),a("right",i,[s.left,s.top],e.right,!1,1,[1,0])};this.reset=function(){i={},u={},h={}},this.addFloatingConnection=function(t,e){p[t]=e},this.removeFloatingConnection=function(t){delete p[t]},this.newConnection=function(t){var i=t.sourceId,o=t.targetId,s=t.endpoints,r=!0,a=function(a,l,c,h,d){i===o&&c.isContinuous&&(t._jsPlumb.instance.removeElement(s[1].canvas),r=!1),e.addToList(u,h,[d,l,c.constructor===n.DynamicAnchor])};a(0,s[0],s[0].anchor,o,t),r&&a(0,s[1],s[1].anchor,i,t)};var _=function(t){!function(t,n){if(t){var i=function(t){return t[4]===n};e.removeWithFunction(t.top,i),e.removeWithFunction(t.left,i),e.removeWithFunction(t.bottom,i),e.removeWithFunction(t.right,i)}}(h[t.elementId],t.id)};this.connectionDetached=function(t,n){var i=t.connection||t,o=t.sourceId,s=t.targetId,r=i.endpoints,a=function(t,n,i,o,s){e.removeWithFunction(u[o],function(t){return t[0].id===s.id})};a(0,r[1],r[1].anchor,o,i),a(0,r[0],r[0].anchor,s,i),i.floatingId&&(a(i.floatingIndex,i.floatingEndpoint,i.floatingEndpoint.anchor,i.floatingId,i),_(i.floatingEndpoint)),_(i.endpoints[0]),_(i.endpoints[1]),n||(c.redraw(i.sourceId),i.targetId!==i.sourceId&&c.redraw(i.targetId))},this.add=function(t,n){e.addToList(i,n,t)},this.changeId=function(t,e){u[e]=u[t],i[e]=i[t],delete u[t],delete i[t]},this.getConnectionsFor=function(t){return u[t]||[]},this.getEndpointsFor=function(t){return i[t]||[]},this.deleteEndpoint=function(t){e.removeWithFunction(i[t.elementId],function(e){return e.id===t.id}),_(t)},this.clearFor=function(t){delete i[t],i[t]=[]};var x=function(n,i,o,s,r,a,l,u,c,h,d,p){var f,g,m=-1,v=s.endpoints[l],y=v.id,b=[1,0][l],P=[[i,o],s,r,a,y],_=n[c],x=v._continuousAnchorEdge?n[v._continuousAnchorEdge]:null;if(x){var C=e.findWithFunction(x,function(t){return t[4]===y});if(-1!==C)for(x.splice(C,1),f=0;f<x.length;f++)g=x[f][1],e.addWithFunction(d,g,function(t){return t.id===g.id}),e.addWithFunction(p,x[f][1].endpoints[l],function(t){return t.id===g.endpoints[l].id}),e.addWithFunction(p,x[f][1].endpoints[b],function(t){return t.id===g.endpoints[b].id})}for(f=0;f<_.length;f++)g=_[f][1],1===t.idx&&_[f][3]===a&&-1===m&&(m=f),e.addWithFunction(d,g,function(t){return t.id===g.id}),e.addWithFunction(p,_[f][1].endpoints[l],function(t){return t.id===g.endpoints[l].id}),e.addWithFunction(p,_[f][1].endpoints[b],function(t){return t.id===g.endpoints[b].id});var E=u?-1!==m?m:0:_.length;_.splice(E,0,P),v._continuousAnchorEdge=c};this.updateOtherEndpoint=function(t,i,o,s){var r=e.findWithFunction(u[t],function(t){return t[0].id===s.id}),a=e.findWithFunction(u[i],function(t){return t[0].id===s.id});-1!==r&&(u[t][r][0]=s,u[t][r][1]=s.endpoints[1],u[t][r][2]=s.endpoints[1].anchor.constructor===n.DynamicAnchor),a>-1&&(u[i].splice(a,1),e.addToList(u,o,[s,s.endpoints[0],s.endpoints[0].anchor.constructor===n.DynamicAnchor])),s.updateConnectedClass()},this.sourceChanged=function(t,i,o,s){if(t!==i){o.sourceId=i,o.source=s,e.removeWithFunction(u[t],function(t){return t[0].id===o.id});var r=e.findWithFunction(u[o.targetId],function(t){return t[0].id===o.id});r>-1&&(u[o.targetId][r][0]=o,u[o.targetId][r][1]=o.endpoints[0],u[o.targetId][r][2]=o.endpoints[0].anchor.constructor===n.DynamicAnchor),e.addToList(u,i,[o,o.endpoints[1],o.endpoints[1].anchor.constructor===n.DynamicAnchor]),o.endpoints[1].anchor.isContinuous&&(o.source===o.target?o._jsPlumb.instance.removeElement(o.endpoints[1].canvas):null==o.endpoints[1].canvas.parentNode&&o._jsPlumb.instance.appendElement(o.endpoints[1].canvas)),o.updateConnectedClass()}},this.rehomeEndpoint=function(t,e,n){var o=i[e]||[],s=d.getId(n);if(s!==e){var r=o.indexOf(t);if(r>-1){var a=o.splice(r,1)[0];c.add(a,s)}}for(var l=0;l<t.connections.length;l++)t.connections[l].sourceId===e?c.sourceChanged(e,t.elementId,t.connections[l],t.element):t.connections[l].targetId===e&&(t.connections[l].targetId=t.elementId,t.connections[l].target=t.element,c.updateOtherEndpoint(t.connections[l].sourceId,e,t.elementId,t.connections[l]))},this.redraw=function(t,o,s,r,a,l){if(!d.isSuspendDrawing()){var c=i[t]||[],g=u[t]||[],m=[],v=[],y=[];s=s||d.timestamp(),r=r||{left:0,top:0},o&&(o={left:o.left+r.left,top:o.top+r.top});for(var b=d.updateOffset({elId:t,offset:o,recalc:!1,timestamp:s}),_={},C=0;C<g.length;C++){var E=g[C][0],j=E.sourceId,S=E.targetId,D=E.endpoints[0].anchor.isContinuous,w=E.endpoints[1].anchor.isContinuous;if(D||w){var I=j+"_"+S,A=_[I],k=E.sourceId===t?1:0;D&&!h[j]&&(h[j]={top:[],right:[],bottom:[],left:[]}),w&&!h[S]&&(h[S]={top:[],right:[],bottom:[],left:[]}),t!==S&&d.updateOffset({elId:S,timestamp:s}),t!==j&&d.updateOffset({elId:j,timestamp:s});var O=d.getCachedData(S),T=d.getCachedData(j);S===j&&(D||w)?(x(h[j],-Math.PI/2,0,E,!1,S,0,!1,"top",0,m,v),x(h[S],-Math.PI/2,0,E,!1,j,1,!1,"top",0,m,v)):(A||(A=f(j,S,T.o,O.o,E.endpoints[0].anchor,E.endpoints[1].anchor),_[I]=A),D&&x(h[j],A.theta,0,E,!1,S,0,!1,A.a[0],0,m,v),w&&x(h[S],A.theta2,-1,E,!0,j,1,!0,A.a[1],0,m,v)),D&&e.addWithFunction(y,j,function(t){return t===j}),w&&e.addWithFunction(y,S,function(t){return t===S}),e.addWithFunction(m,E,function(t){return t.id===E.id}),(D&&0===k||w&&1===k)&&e.addWithFunction(v,E.endpoints[k],function(t){return t.id===E.endpoints[k].id})}}for(C=0;C<c.length;C++)0===c[C].connections.length&&c[C].anchor.isContinuous&&(h[t]||(h[t]={top:[],right:[],bottom:[],left:[]}),x(h[t],-Math.PI/2,0,{endpoints:[c[C],c[C]],paint:function(){}},!1,t,0,!1,c[C].anchor.getDefaultFace(),0,m,v),e.addWithFunction(y,t,function(e){return e===t}));for(C=0;C<y.length;C++)P(y[C],h[y[C]]);for(C=0;C<c.length;C++)c[C].paint({timestamp:s,offset:b,dimensions:b.s,recalc:!0!==l});for(C=0;C<v.length;C++){var M=d.getCachedData(v[C].elementId);v[C].paint({timestamp:s,offset:M,dimensions:M.s})}for(C=0;C<g.length;C++){var L=g[C][1];if(L.anchor.constructor===n.DynamicAnchor){L.paint({elementWithPrecedence:t,timestamp:s}),e.addWithFunction(m,g[C][0],function(t){return t.id===g[C][0].id});for(var F=0;F<L.connections.length;F++)L.connections[F]!==g[C][0]&&e.addWithFunction(m,L.connections[F],function(t){return t.id===L.connections[F].id})}else L.anchor.constructor===n.Anchor&&e.addWithFunction(m,g[C][0],function(t){return t.id===g[C][0].id})}var N=p[t];for(N&&N.paint({timestamp:s,recalc:!1,elId:t}),C=0;C<m.length;C++)m[C].paint({elId:t,timestamp:s,recalc:!1,clearEdits:a})}};var C=function(t){e.EventGenerator.apply(this),this.type="Continuous",this.isDynamic=!0,this.isContinuous=!0;for(var n=t.faces||["top","right","bottom","left"],i=!(!1===t.clockwise),a={},l={top:"bottom",right:"left",left:"right",bottom:"top"},u={top:"right",right:"bottom",left:"top",bottom:"left"},c={top:"left",right:"top",left:"bottom",bottom:"right"},h=i?u:c,d=i?c:u,p=t.cssClass||"",f=0;f<n.length;f++)a[n[f]]=!0;this.getDefaultFace=function(){return 0===n.length?"top":n[0]},this.verifyEdge=function(t){return a[t]?t:a[l[t]]?l[t]:a[h[t]]?h[t]:a[d[t]]?d[t]:t},this.isEdgeSupported=function(t){return!0===a[t]},this.compute=function(t){return s[t.element.id]||o[t.element.id]||[0,0]},this.getCurrentLocation=function(t){return s[t.element.id]||o[t.element.id]||[0,0]},this.getOrientation=function(t){return r[t.id]||[0,0]},this.clearUserDefinedLocation=function(){delete s[t.elementId]},this.setUserDefinedLocation=function(e){s[t.elementId]=e},this.getCssClass=function(){return p}};d.continuousAnchorFactory={get:function(t){return new C(t)},clear:function(t){delete s[t],delete o[t]}}},n.Anchor=function(t){this.x=t.x||0,this.y=t.y||0,this.elementId=t.elementId,this.cssClass=t.cssClass||"",this.userDefinedLocation=null,this.orientation=t.orientation||[0,0],this.lastReturnValue=null,this.offsets=t.offsets||[0,0],this.timestamp=null,e.EventGenerator.apply(this),this.compute=function(t){var e=t.xy,n=t.wh,i=t.timestamp;return t.clearUserDefinedLocation&&(this.userDefinedLocation=null),i&&i===this.timestamp?this.lastReturnValue:(null!=this.userDefinedLocation?this.lastReturnValue=this.userDefinedLocation:this.lastReturnValue=[e[0]+this.x*n[0]+this.offsets[0],e[1]+this.y*n[1]+this.offsets[1]],this.timestamp=i,this.lastReturnValue)},this.getCurrentLocation=function(t){return t=t||{},null==this.lastReturnValue||null!=t.timestamp&&this.timestamp!==t.timestamp?this.compute(t):this.lastReturnValue}},e.extend(n.Anchor,e.EventGenerator,{equals:function(t){if(!t)return!1;var e=t.getOrientation(),n=this.getOrientation();return this.x===t.x&&this.y===t.y&&this.offsets[0]===t.offsets[0]&&this.offsets[1]===t.offsets[1]&&n[0]===e[0]&&n[1]===e[1]},getUserDefinedLocation:function(){return this.userDefinedLocation},setUserDefinedLocation:function(t){this.userDefinedLocation=t},clearUserDefinedLocation:function(){this.userDefinedLocation=null},getOrientation:function(){return this.orientation},getCssClass:function(){return this.cssClass}}),n.FloatingAnchor=function(t){n.Anchor.apply(this,arguments);var e=t.reference,i=t.referenceCanvas,o=n.getSize(i),s=null,r=null;this.orientation=null,this.x=0,this.y=0,this.isFloating=!0,this.compute=function(t){var e=t.xy,n=[e[0]+o[0]/2,e[1]+o[1]/2];return r=n,n},this.getOrientation=function(t){if(s)return s;var n=e.getOrientation(t);return[0*Math.abs(n[0])*-1,0*Math.abs(n[1])*-1]},this.over=function(t,e){s=t.getOrientation(e)},this.out=function(){s=null},this.getCurrentLocation=function(t){return null==r?this.compute(t):r}},e.extend(n.FloatingAnchor,n.Anchor);var i=function(t,e,i){return t.constructor===n.Anchor?t:e.makeAnchor(t,i,e)};n.DynamicAnchor=function(t){n.Anchor.apply(this,arguments),this.isDynamic=!0,this.anchors=[],this.elementId=t.elementId,this.jsPlumbInstance=t.jsPlumbInstance;for(var e=0;e<t.anchors.length;e++)this.anchors[e]=i(t.anchors[e],this.jsPlumbInstance,this.elementId);this.getAnchors=function(){return this.anchors},this.locked=!1;var o=this.anchors.length>0?this.anchors[0]:null,s=o,r=this,a=function(t,e,n,i,o){var s=i[0]+t.x*o[0],r=i[1]+t.y*o[1],a=i[0]+o[0]/2,l=i[1]+o[1]/2;return Math.sqrt(Math.pow(e-s,2)+Math.pow(n-r,2))+Math.sqrt(Math.pow(a-s,2)+Math.pow(l-r,2))},l=t.selector||function(t,e,n,i,o){for(var s=n[0]+i[0]/2,r=n[1]+i[1]/2,l=-1,u=1/0,c=0;c<o.length;c++){var h=a(o[c],s,r,t,e);h<u&&(l=c+0,u=h)}return o[l]};this.compute=function(t){var e=t.xy,n=t.wh,i=t.txy,a=t.twh;this.timestamp=t.timestamp;var u=r.getUserDefinedLocation();return null!=u?u:this.locked||null==i||null==a?o.compute(t):(t.timestamp=null,o=l(e,n,i,a,this.anchors),this.x=o.x,this.y=o.y,o!==s&&this.fire("anchorChanged",o),s=o,o.compute(t))},this.getCurrentLocation=function(t){return this.getUserDefinedLocation()||(null!=o?o.getCurrentLocation(t):null)},this.getOrientation=function(t){return null!=o?o.getOrientation(t):[0,0]},this.over=function(t,e){null!=o&&o.over(t,e)},this.out=function(){null!=o&&o.out()},this.getCssClass=function(){return o&&o.getCssClass()||""}},e.extend(n.DynamicAnchor,n.Anchor);var o=function(t,e,i,o,s,r){n.Anchors[s]=function(n){var a=n.jsPlumbInstance.makeAnchor([t,e,i,o,0,0],n.elementId,n.jsPlumbInstance);return a.type=s,r&&r(a,n),a}};o(.5,0,0,-1,"TopCenter"),o(.5,1,0,1,"BottomCenter"),o(0,.5,-1,0,"LeftMiddle"),o(1,.5,1,0,"RightMiddle"),o(.5,0,0,-1,"Top"),o(.5,1,0,1,"Bottom"),o(0,.5,-1,0,"Left"),o(1,.5,1,0,"Right"),o(.5,.5,0,0,"Center"),o(1,0,0,-1,"TopRight"),o(1,1,0,1,"BottomRight"),o(0,0,0,-1,"TopLeft"),o(0,1,0,1,"BottomLeft"),n.Defaults.DynamicAnchors=function(t){return t.jsPlumbInstance.makeAnchors(["TopCenter","RightMiddle","BottomCenter","LeftMiddle"],t.elementId,t.jsPlumbInstance)},n.Anchors.AutoDefault=function(t){var e=t.jsPlumbInstance.makeDynamicAnchor(n.Defaults.DynamicAnchors(t));return e.type="AutoDefault",e};var s=function(t,e){n.Anchors[t]=function(n){var i=n.jsPlumbInstance.makeAnchor(["Continuous",{faces:e}],n.elementId,n.jsPlumbInstance);return i.type=t,i}};n.Anchors.Continuous=function(t){return t.jsPlumbInstance.continuousAnchorFactory.get(t)},s("ContinuousLeft",["left"]),s("ContinuousTop",["top"]),s("ContinuousBottom",["bottom"]),s("ContinuousRight",["right"]),o(0,0,0,0,"Assign",function(t,e){var n=e.position||"Fixed";t.positionFinder=n.constructor===String?e.jsPlumbInstance.AnchorPositionFinders[n]:n,t.constructorParams=e}),t.jsPlumbInstance.prototype.AnchorPositionFinders={Fixed:function(t,e,n){return[(t.left-e.left)/n[0],(t.top-e.top)/n[1]]},Grid:function(t,e,n,i){var o=t.left-e.left,s=t.top-e.top,r=n[0]/i.grid[0],a=n[1]/i.grid[1],l=Math.floor(o/r),u=Math.floor(s/a);return[(l*r+r/2)/n[0],(u*a+a/2)/n[1]]}},n.Anchors.Perimeter=function(t){t=t||{};var e=t.anchorCount||60,n=t.shape;if(!n)throw new Error("no shape supplied to Perimeter Anchor type");var i=function(){for(var t=2*Math.PI/e,n=0,i=[],o=0;o<e;o++){var s=.5+.5*Math.sin(n),r=.5+.5*Math.cos(n);i.push([s,r,0,0]),n+=t}return i},o=function(t){for(var n=e/t.length,i=[],o=function(t,o,s,r,a){n=e*a;for(var l=(s-t)/n,u=(r-o)/n,c=0;c<n;c++)i.push([t+l*c,o+u*c,0,0])},s=0;s<t.length;s++)o.apply(null,t[s]);return i},s=function(t){for(var e=[],n=0;n<t.length;n++)e.push([t[n][0],t[n][1],t[n][2],t[n][3],1/t.length]);return o(e)},r=function(){return s([[0,0,1,0],[1,0,1,1],[1,1,0,1],[0,1,0,0]])},a={Circle:i,Ellipse:i,Diamond:function(){return s([[.5,0,1,.5],[1,.5,.5,1],[.5,1,0,.5],[0,.5,.5,0]])},Rectangle:r,Square:r,Triangle:function(){return s([[.5,0,1,1],[1,1,0,1],[0,1,.5,0]])},Path:function(t){for(var e=t.points,n=[],i=0,s=0;s<e.length-1;s++){var r=Math.sqrt(Math.pow(e[s][2]-e[s][0])+Math.pow(e[s][3]-e[s][1]));i+=r,n.push([e[s][0],e[s][1],e[s+1][0],e[s+1][1],r])}for(var a=0;a<n.length;a++)n[a][4]=n[a][4]/i;return o(n)}};if(!a[n])throw new Error("Shape ["+n+"] is unknown by Perimeter Anchor type");var l=a[n](t);t.rotation&&(l=function(t,e){for(var n=[],i=e/180*Math.PI,o=0;o<t.length;o++){var s=t[o][0]-.5,r=t[o][1]-.5;n.push([s*Math.cos(i)-r*Math.sin(i)+.5,s*Math.sin(i)+r*Math.cos(i)+.5,t[o][2],t[o][3]])}return n}(l,t.rotation));var u=t.jsPlumbInstance.makeDynamicAnchor(l);return u.type="Perimeter",u}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Biltong;e.Segments={AbstractSegment:function(t){this.params=t,this.findClosestPointOnPath=function(t,e){return{d:1/0,x:null,y:null,l:null}},this.getBounds=function(){return{minX:Math.min(t.x1,t.x2),minY:Math.min(t.y1,t.y2),maxX:Math.max(t.x1,t.x2),maxY:Math.max(t.y1,t.y2)}}},Straight:function(t){var n,o,s,r,a,l,u,c=(e.Segments.AbstractSegment.apply(this,arguments),function(){n=Math.sqrt(Math.pow(a-r,2)+Math.pow(u-l,2)),o=i.gradient({x:r,y:l},{x:a,y:u}),s=-1/o});this.type="Straight",this.getLength=function(){return n},this.getGradient=function(){return o},this.getCoordinates=function(){return{x1:r,y1:l,x2:a,y2:u}},this.setCoordinates=function(t){r=t.x1,l=t.y1,a=t.x2,u=t.y2,c()},this.setCoordinates({x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}),this.getBounds=function(){return{minX:Math.min(r,a),minY:Math.min(l,u),maxX:Math.max(r,a),maxY:Math.max(l,u)}},this.pointOnPath=function(t,e){if(0!==t||e){if(1!==t||e){var o=e?t>0?t:n+t:t*n;return i.pointOnLine({x:r,y:l},{x:a,y:u},o)}return{x:a,y:u}}return{x:r,y:l}},this.gradientAtPoint=function(t){return o},this.pointAlongPathFrom=function(t,e,n){var o=this.pointOnPath(t,n),s=e<=0?{x:r,y:l}:{x:a,y:u};return e<=0&&Math.abs(e)>1&&(e*=-1),i.pointOnLine(o,s,e)};var h=function(t,e,n){return n>=Math.min(t,e)&&n<=Math.max(t,e)},d=function(t,e,n){return Math.abs(n-t)<Math.abs(n-e)?t:e};this.findClosestPointOnPath=function(t,e){var c={d:1/0,x:null,y:null,l:null,x1:r,x2:a,y1:l,y2:u};if(0===o)c.y=l,c.x=h(r,a,t)?t:d(r,a,t);else if(o===1/0||o===-1/0)c.x=r,c.y=h(l,u,e)?e:d(l,u,e);else{var p=l-o*r,f=e-s*t,g=(f-p)/(o-s),m=o*g+p;c.x=h(r,a,g)?g:d(r,a,g),c.y=h(l,u,m)?m:d(l,u,m)}var v=i.lineLength([c.x,c.y],[r,l]);return c.d=i.lineLength([t,e],[c.x,c.y]),c.l=v/n,c}},Arc:function(t){var n=(e.Segments.AbstractSegment.apply(this,arguments),function(e,n){return i.theta([t.cx,t.cy],[e,n])}),o=function(t,e){if(t.anticlockwise){var n=t.startAngle<t.endAngle?t.startAngle+s:t.startAngle;return n-Math.abs(n-t.endAngle)*e}var i=t.endAngle<t.startAngle?t.endAngle+s:t.endAngle,o=Math.abs(i-t.startAngle);return t.startAngle+o*e},s=2*Math.PI;this.radius=t.r,this.anticlockwise=t.ac,this.type="Arc",t.startAngle&&t.endAngle?(this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.x1=t.cx+this.radius*Math.cos(t.startAngle),this.y1=t.cy+this.radius*Math.sin(t.startAngle),this.x2=t.cx+this.radius*Math.cos(t.endAngle),this.y2=t.cy+this.radius*Math.sin(t.endAngle)):(this.startAngle=n(t.x1,t.y1),this.endAngle=n(t.x2,t.y2),this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2),this.endAngle<0&&(this.endAngle+=s),this.startAngle<0&&(this.startAngle+=s);var r=this.endAngle<this.startAngle?this.endAngle+s:this.endAngle;this.sweep=Math.abs(r-this.startAngle),this.anticlockwise&&(this.sweep=s-this.sweep);var a=2*Math.PI*this.radius,l=this.sweep/s,u=a*l;this.getLength=function(){return u},this.getBounds=function(){return{minX:t.cx-t.r,maxX:t.cx+t.r,minY:t.cy-t.r,maxY:t.cy+t.r}};var c=function(t){var e=Math.floor(t),n=Math.ceil(t);return t-e<1e-10?e:n-t<1e-10?n:t};this.pointOnPath=function(e,n){if(0===e)return{x:this.x1,y:this.y1,theta:this.startAngle};if(1===e)return{x:this.x2,y:this.y2,theta:this.endAngle};n&&(e/=u);var i=o(this,e),s=t.cx+t.r*Math.cos(i),r=t.cy+t.r*Math.sin(i);return{x:c(s),y:c(r),theta:i}},this.gradientAtPoint=function(e,n){var o=this.pointOnPath(e,n),s=i.normal([t.cx,t.cy],[o.x,o.y]);return this.anticlockwise||s!==1/0&&s!==-1/0||(s*=-1),s},this.pointAlongPathFrom=function(e,n,i){var o=this.pointOnPath(e,i),s=n/a*2*Math.PI,r=this.anticlockwise?-1:1,l=o.theta+r*s;return{x:t.cx+this.radius*Math.cos(l),y:t.cy+this.radius*Math.sin(l)}}},Bezier:function(n){this.curve=[{x:n.x1,y:n.y1},{x:n.cp1x,y:n.cp1y},{x:n.cp2x,y:n.cp2y},{x:n.x2,y:n.y2}];e.Segments.AbstractSegment.apply(this,arguments);this.bounds={minX:Math.min(n.x1,n.x2,n.cp1x,n.cp2x),minY:Math.min(n.y1,n.y2,n.cp1y,n.cp2y),maxX:Math.max(n.x1,n.x2,n.cp1x,n.cp2x),maxY:Math.max(n.y1,n.y2,n.cp1y,n.cp2y)},this.type="Bezier";var i=function(e,n,i){return i&&(n=t.jsBezier.locationAlongCurveFrom(e,n>0?0:1,n)),n};this.pointOnPath=function(e,n){return e=i(this.curve,e,n),t.jsBezier.pointOnCurve(this.curve,e)},this.gradientAtPoint=function(e,n){return e=i(this.curve,e,n),t.jsBezier.gradientAtPoint(this.curve,e)},this.pointAlongPathFrom=function(e,n,o){return e=i(this.curve,e,o),t.jsBezier.pointAlongCurveFrom(this.curve,e,n)},this.getLength=function(){return t.jsBezier.getLength(this.curve)},this.getBounds=function(){return this.bounds}}},e.SegmentRenderer={getPath:function(t){return{Straight:function(){var e=t.getCoordinates();return"M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2},Bezier:function(){var e=t.params;return"M "+e.x1+" "+e.y1+" C "+e.cp1x+" "+e.cp1y+" "+e.cp2x+" "+e.cp2y+" "+e.x2+" "+e.y2},Arc:function(){var e=t.params,n=t.sweep>Math.PI?1:0,i=t.anticlockwise?0:1;return"M"+t.x1+" "+t.y1+" A "+t.radius+" "+e.r+" 0 "+n+","+i+" "+t.x2+" "+t.y2}}[t.type]()}};var o=function(){this.resetBounds=function(){this.bounds={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}},this.resetBounds()};e.Connectors.AbstractConnector=function(t){o.apply(this,arguments);var s=[],r=0,a=[],l=[],u=t.stub||0,c=n.isArray(u)?u[0]:u,h=n.isArray(u)?u[1]:u,d=t.gap||0,p=n.isArray(d)?d[0]:d,f=n.isArray(d)?d[1]:d,g=null,m=!1,v=null,y=null,b=!1!==t.editable&&null!=e.ConnectorEditors&&null!=e.ConnectorEditors[this.type],P=this.setGeometry=function(t,e){m=!e,y=t},_=this.getGeometry=function(){return y};this.getPathData=function(){for(var t="",n=0;n<s.length;n++)t+=e.SegmentRenderer.getPath(s[n]),t+=" ";return t},this.hasBeenEdited=function(){return m},this.isEditing=function(){return null!=this.editor&&this.editor.isActive()},this.setEditable=function(t){return b=!(!t||null==e.ConnectorEditors||null==e.ConnectorEditors[this.type]||null!=this.overrideSetEditable&&!this.overrideSetEditable())&&t},this.isEditable=function(){return b},this.findSegmentForPoint=function(t,e){for(var n={d:1/0,s:null,x:null,y:null,l:null},i=0;i<s.length;i++){var o=s[i].findClosestPointOnPath(t,e);o.d<n.d&&(n.d=o.d,n.l=o.l,n.x=o.x,n.y=o.y,n.s=s[i],n.x1=o.x1,n.x2=o.x2,n.y1=o.y1,n.y2=o.y2,n.index=i)}return n};var x=function(){for(var t=0,e=0;e<s.length;e++){var n=s[e].getLength();l[e]=n/r,a[e]=[t,t+=n/r]}},C=function(t,e){e&&(t=t>0?t/r:(r+t)/r);for(var n=a.length-1,i=1,o=0;o<a.length;o++)if(a[o][1]>=t){n=o,i=1===t?1:0===t?0:(t-a[o][0])/l[o];break}return{segment:s[n],proportion:i,index:n}},E=function(t,n,i){if(i.x1!==i.x2||i.y1!==i.y2){var o=new e.Segments[n](i);s.push(o),r+=o.getLength(),t.updateBounds(o)}},j=function(){r=s.length=a.length=l.length=0};this.setSegments=function(t){g=[],r=0;for(var e=0;e<t.length;e++)g.push(t[e]),r+=t[e].getLength()},this.getLength=function(){return r};var S=function(t){this.strokeWidth=t.strokeWidth;var e=i.quadrant(t.sourcePos,t.targetPos),n=t.targetPos[0]<t.sourcePos[0],o=t.targetPos[1]<t.sourcePos[1],s=t.strokeWidth||1,r=t.sourceEndpoint.anchor.getOrientation(t.sourceEndpoint),a=t.targetEndpoint.anchor.getOrientation(t.targetEndpoint),l=n?t.targetPos[0]:t.sourcePos[0],u=o?t.targetPos[1]:t.sourcePos[1],d=Math.abs(t.targetPos[0]-t.sourcePos[0]),g=Math.abs(t.targetPos[1]-t.sourcePos[1]);if(0===r[0]&&0===r[1]||0===a[0]&&0===a[1]){var m=d>g?0:1,v=[1,0][m];r=[],a=[],r[m]=t.sourcePos[m]>t.targetPos[m]?-1:1,a[m]=t.sourcePos[m]>t.targetPos[m]?1:-1,r[v]=0,a[v]=0}var y=n?d+p*r[0]:p*r[0],b=o?g+p*r[1]:p*r[1],P=n?f*a[0]:d+f*a[0],_=o?f*a[1]:g+f*a[1],x=r[0]*a[0]+r[1]*a[1],C={sx:y,sy:b,tx:P,ty:_,lw:s,xSpan:Math.abs(P-y),ySpan:Math.abs(_-b),mx:(y+P)/2,my:(b+_)/2,so:r,to:a,x:l,y:u,w:d,h:g,segment:e,startStubX:y+r[0]*c,startStubY:b+r[1]*c,endStubX:P+a[0]*h,endStubY:_+a[1]*h,isXGreaterThanStubTimes2:Math.abs(y-P)>c+h,isYGreaterThanStubTimes2:Math.abs(b-_)>c+h,opposite:-1===x,perpendicular:0===x,orthogonal:1===x,sourceAxis:0===r[0]?"y":"x",points:[l,u,d,g,y,b,P,_]};return C.anchorOrientation=C.opposite?"opposite":C.orthogonal?"orthogonal":"perpendicular",C};this.getSegments=function(){return s},this.updateBounds=function(t){var e=t.getBounds();this.bounds.minX=Math.min(this.bounds.minX,e.minX),this.bounds.maxX=Math.max(this.bounds.maxX,e.maxX),this.bounds.minY=Math.min(this.bounds.minY,e.minY),this.bounds.maxY=Math.max(this.bounds.maxY,e.maxY)};return this.pointOnPath=function(t,e){var n=C(t,e);return n.segment&&n.segment.pointOnPath(n.proportion,!1)||[0,0]},this.gradientAtPoint=function(t,e){var n=C(t,e);return n.segment&&n.segment.gradientAtPoint(n.proportion,!1)||0},this.pointAlongPathFrom=function(t,e,n){var i=C(t,n);return i.segment&&i.segment.pointAlongPathFrom(i.proportion,e,!1)||[0,0]},this.compute=function(t){v=S.call(this,t),j(),this._compute(v,t),this.x=v.points[0],this.y=v.points[1],this.w=v.points[2],this.h=v.points[3],this.segment=v.segment,x()},{addSegment:E,prepareCompute:S,sourceStub:c,targetStub:h,maxStub:Math.max(c,h),sourceGap:p,targetGap:f,maxGap:Math.max(p,f),setGeometry:P,getGeometry:_}},n.extend(e.Connectors.AbstractConnector,o),e.Endpoints.AbstractEndpoint=function(t){return o.apply(this,arguments),{compute:this.compute=function(t,e,n,i){var o=this._compute.apply(this,arguments);return this.x=o[0],this.y=o[1],this.w=o[2],this.h=o[3],this.bounds.minX=this.x,this.bounds.minY=this.y,this.bounds.maxX=this.x+this.w,this.bounds.maxY=this.y+this.h,o},cssClass:t.cssClass}},n.extend(e.Endpoints.AbstractEndpoint,o),e.Endpoints.Dot=function(t){this.type="Dot";e.Endpoints.AbstractEndpoint.apply(this,arguments);t=t||{},this.radius=t.radius||10,this.defaultOffset=.5*this.radius,this.defaultInnerRadius=this.radius/3,this._compute=function(t,e,n,i){this.radius=n.radius||this.radius;var o=t[0]-this.radius,s=t[1]-this.radius,r=2*this.radius,a=2*this.radius;if(n.stroke){var l=n.strokeWidth||1;o-=l,s-=l,r+=2*l,a+=2*l}return[o,s,r,a,this.radius]}},n.extend(e.Endpoints.Dot,e.Endpoints.AbstractEndpoint),e.Endpoints.Rectangle=function(t){this.type="Rectangle";e.Endpoints.AbstractEndpoint.apply(this,arguments);t=t||{},this.width=t.width||20,this.height=t.height||20,this._compute=function(t,e,n,i){var o=n.width||this.width,s=n.height||this.height;return[t[0]-o/2,t[1]-s/2,o,s]}},n.extend(e.Endpoints.Rectangle,e.Endpoints.AbstractEndpoint);var s=function(t){e.jsPlumbUIComponent.apply(this,arguments),this._jsPlumb.displayElements=[]};n.extend(s,e.jsPlumbUIComponent,{getDisplayElements:function(){return this._jsPlumb.displayElements},appendDisplayElement:function(t){this._jsPlumb.displayElements.push(t)}}),e.Endpoints.Image=function(i){this.type="Image",s.apply(this,arguments),e.Endpoints.AbstractEndpoint.apply(this,arguments);var o=i.onload,r=i.src||i.url,a=i.cssClass?" "+i.cssClass:"";this._jsPlumb.img=new Image,this._jsPlumb.ready=!1,this._jsPlumb.initialized=!1,this._jsPlumb.deleted=!1,this._jsPlumb.widthToUse=i.width,this._jsPlumb.heightToUse=i.height,this._jsPlumb.endpoint=i.endpoint,this._jsPlumb.img.onload=function(){null!=this._jsPlumb&&(this._jsPlumb.ready=!0,this._jsPlumb.widthToUse=this._jsPlumb.widthToUse||this._jsPlumb.img.width,this._jsPlumb.heightToUse=this._jsPlumb.heightToUse||this._jsPlumb.img.height,o&&o(this))}.bind(this),this._jsPlumb.endpoint.setImage=function(t,e){var n=t.constructor===String?t:t.src;o=e,this._jsPlumb.img.src=n,null!=this.canvas&&this.canvas.setAttribute("src",this._jsPlumb.img.src)}.bind(this),this._jsPlumb.endpoint.setImage(r,o),this._compute=function(t,e,n,i){return this.anchorPoint=t,this._jsPlumb.ready?[t[0]-this._jsPlumb.widthToUse/2,t[1]-this._jsPlumb.heightToUse/2,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse]:[0,0,0,0]},this.canvas=e.createElement("img",{position:"absolute",margin:0,padding:0,outline:0},this._jsPlumb.instance.endpointClass+a),this._jsPlumb.widthToUse&&this.canvas.setAttribute("width",this._jsPlumb.widthToUse),this._jsPlumb.heightToUse&&this.canvas.setAttribute("height",this._jsPlumb.heightToUse),this._jsPlumb.instance.appendElement(this.canvas),this.actuallyPaint=function(t,e,i){if(!this._jsPlumb.deleted){this._jsPlumb.initialized||(this.canvas.setAttribute("src",this._jsPlumb.img.src),this.appendDisplayElement(this.canvas),this._jsPlumb.initialized=!0);var o=this.anchorPoint[0]-this._jsPlumb.widthToUse/2,s=this.anchorPoint[1]-this._jsPlumb.heightToUse/2;n.sizeElement(this.canvas,o,s,this._jsPlumb.widthToUse,this._jsPlumb.heightToUse)}},this.paint=function(e,n){null!=this._jsPlumb&&(this._jsPlumb.ready?this.actuallyPaint(e,n):t.setTimeout(function(){this.paint(e,n)}.bind(this),200))}},n.extend(e.Endpoints.Image,[s,e.Endpoints.AbstractEndpoint],{cleanup:function(t){t&&(this._jsPlumb.deleted=!0,this.canvas&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=null)}}),e.Endpoints.Blank=function(t){e.Endpoints.AbstractEndpoint.apply(this,arguments);this.type="Blank",s.apply(this,arguments),this._compute=function(t,e,n,i){return[t[0],t[1],10,0]};var i=t.cssClass?" "+t.cssClass:"";this.canvas=e.createElement("div",{display:"block",width:"1px",height:"1px",background:"transparent",position:"absolute"},this._jsPlumb.instance.endpointClass+i),this._jsPlumb.instance.appendElement(this.canvas),this.paint=function(t,e){n.sizeElement(this.canvas,this.x,this.y,this.w,this.h)}},n.extend(e.Endpoints.Blank,[e.Endpoints.AbstractEndpoint,s],{cleanup:function(){this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}),e.Endpoints.Triangle=function(t){this.type="Triangle",e.Endpoints.AbstractEndpoint.apply(this,arguments);var n=this;t=t||{},t.width=t.width||55,t.height=t.height||55,this.width=t.width,this.height=t.height,this._compute=function(t,e,i,o){var s=i.width||n.width,r=i.height||n.height;return[t[0]-s/2,t[1]-r/2,s,r]}};var r=e.Overlays.AbstractOverlay=function(t){this.visible=!0,this.isAppendedAtTopLevel=!0,this.component=t.component,this.loc=null==t.location?.5:t.location,this.endpointLoc=null==t.endpointLocation?[.5,.5]:t.endpointLocation,this.visible=!1!==t.visible};r.prototype={cleanup:function(t){t&&(this.component=null,this.canvas=null,this.endpointLoc=null)},reattach:function(t,e){},setVisible:function(t){this.visible=t,this.component.repaint()},isVisible:function(){return this.visible},hide:function(){this.setVisible(!1)},show:function(){this.setVisible(!0)},incrementLocation:function(t){this.loc+=t,this.component.repaint()},setLocation:function(t){this.loc=t,this.component.repaint()},getLocation:function(){return this.loc},updateFrom:function(){}},e.Overlays.Arrow=function(t){this.type="Arrow",r.apply(this,arguments),this.isAppendedAtTopLevel=!1,t=t||{};var o=this;this.length=t.length||20,this.width=t.width||20,this.id=t.id;var s=(t.direction||1)<0?-1:1,a=t.paintStyle||{"stroke-width":1},l=t.foldback||.623;this.computeMaxSize=function(){return 1.5*o.width},this.elementCreated=function(n,i){if(this.path=n,t.events)for(var o in t.events)e.on(n,o,t.events[o])},this.draw=function(t,e){var o,r,u,c,h;if(t.pointAlongPathFrom){if(n.isString(this.loc)||this.loc>1||this.loc<0){var d=parseInt(this.loc,10),p=this.loc<0?1:0;o=t.pointAlongPathFrom(p,d,!1),r=t.pointAlongPathFrom(p,d-s*this.length/2,!1),u=i.pointOnLine(o,r,this.length)}else if(1===this.loc){if(o=t.pointOnPath(this.loc),r=t.pointAlongPathFrom(this.loc,-this.length),u=i.pointOnLine(o,r,this.length),-1===s){var f=u;u=o,o=f}}else if(0===this.loc){if(u=t.pointOnPath(this.loc),r=t.pointAlongPathFrom(this.loc,this.length),o=i.pointOnLine(u,r,this.length),-1===s){var g=u;u=o,o=g}}else o=t.pointAlongPathFrom(this.loc,s*this.length/2),r=t.pointOnPath(this.loc),u=i.pointOnLine(o,r,this.length);c=i.perpendicularLineTo(o,u,this.width),h=i.pointOnLine(o,u,l*this.length);var m={hxy:o,tail:c,cxy:h},v=a.stroke||e.stroke,y=a.fill||e.stroke;return{component:t,d:m,"stroke-width":a.strokeWidth||e.strokeWidth,stroke:v,fill:y,minX:Math.min(o.x,c[0].x,c[1].x),maxX:Math.max(o.x,c[0].x,c[1].x),minY:Math.min(o.y,c[0].y,c[1].y),maxY:Math.max(o.y,c[0].y,c[1].y)}}return{component:t,minX:0,maxX:0,minY:0,maxY:0}}},n.extend(e.Overlays.Arrow,r,{updateFrom:function(t){this.length=t.length||this.length,this.width=t.width||this.width,this.direction=null!=t.direction?t.direction:this.direction,this.foldback=t.foldback||this.foldback}}),e.Overlays.PlainArrow=function(t){t=t||{};var n=e.extend(t,{foldback:1});e.Overlays.Arrow.call(this,n),this.type="PlainArrow"},n.extend(e.Overlays.PlainArrow,e.Overlays.Arrow),e.Overlays.Diamond=function(t){t=t||{};var n=t.length||40,i=e.extend(t,{length:n/2,foldback:2});e.Overlays.Arrow.call(this,i),this.type="Diamond"},n.extend(e.Overlays.Diamond,e.Overlays.Arrow);var a=function(t,e){return(null==t._jsPlumb.cachedDimensions||e)&&(t._jsPlumb.cachedDimensions=t.getDimensions()),t._jsPlumb.cachedDimensions},l=function(t){e.jsPlumbUIComponent.apply(this,arguments),r.apply(this,arguments);var i=this.fire;this.fire=function(){i.apply(this,arguments),this.component&&this.component.fire.apply(this.component,arguments)},this.detached=!1,this.id=t.id,this._jsPlumb.div=null,this._jsPlumb.initialised=!1,this._jsPlumb.component=t.component,this._jsPlumb.cachedDimensions=null,this._jsPlumb.create=t.create,this._jsPlumb.initiallyInvisible=!1===t.visible,this.getElement=function(){if(null==this._jsPlumb.div){var n=this._jsPlumb.div=e.getElement(this._jsPlumb.create(this._jsPlumb.component));n.style.position="absolute",n.className=this._jsPlumb.instance.overlayClass+" "+(this.cssClass?this.cssClass:t.cssClass?t.cssClass:""),this._jsPlumb.instance.appendElement(n),this._jsPlumb.instance.getId(n),this.canvas=n;var i="translate(-50%, -50%)";n.style.webkitTransform=i,n.style.mozTransform=i,n.style.msTransform=i,n.style.oTransform=i,n.style.transform=i,n._jsPlumb=this,!1===t.visible&&(n.style.display="none")}return this._jsPlumb.div},this.draw=function(t,e,i){var o=a(this);if(null!=o&&2===o.length){var s={x:0,y:0};if(i)s={x:i[0],y:i[1]};else if(t.pointOnPath){var r=this.loc,l=!1;(n.isString(this.loc)||this.loc<0||this.loc>1)&&(r=parseInt(this.loc,10),l=!0),s=t.pointOnPath(r,l)}else{var u=this.loc.constructor===Array?this.loc:this.endpointLoc;s={x:u[0]*t.w,y:u[1]*t.h}}var c=s.x-o[0]/2,h=s.y-o[1]/2;return{component:t,d:{minx:c,miny:h,td:o,cxy:s},minX:c,maxX:c+o[0],minY:h,maxY:h+o[1]}}return{minX:0,maxX:0,minY:0,maxY:0}}};n.extend(l,[e.jsPlumbUIComponent,r],{getDimensions:function(){return[1,1]},setVisible:function(t){this._jsPlumb.div&&(this._jsPlumb.div.style.display=t?"block":"none",t&&this._jsPlumb.initiallyInvisible&&(a(this,!0),this.component.repaint(),this._jsPlumb.initiallyInvisible=!1))},clearCachedDimensions:function(){this._jsPlumb.cachedDimensions=null},cleanup:function(t){t?null!=this._jsPlumb.div&&(this._jsPlumb.div._jsPlumb=null,this._jsPlumb.instance.removeElement(this._jsPlumb.div)):(this._jsPlumb&&this._jsPlumb.div&&this._jsPlumb.div.parentNode&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div),this.detached=!0)},reattach:function(t,e){null!=this._jsPlumb.div&&t.getContainer().appendChild(this._jsPlumb.div),this.detached=!1},computeMaxSize:function(){var t=a(this);return Math.max(t[0],t[1])},paint:function(t,e){this._jsPlumb.initialised||(this.getElement(),t.component.appendDisplayElement(this._jsPlumb.div),this._jsPlumb.initialised=!0,this.detached&&this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div)),this._jsPlumb.div.style.left=t.component.x+t.d.minx+"px",this._jsPlumb.div.style.top=t.component.y+t.d.miny+"px"}}),e.Overlays.Custom=function(t){this.type="Custom",l.apply(this,arguments)},n.extend(e.Overlays.Custom,l),e.Overlays.GuideLines=function(){var t=this;t.length=50,t.strokeWidth=5,this.type="GuideLines",r.apply(this,arguments),e.jsPlumbUIComponent.apply(this,arguments),this.draw=function(e,n){var o=e.pointAlongPathFrom(t.loc,t.length/2),s=e.pointOnPath(t.loc),r=i.pointOnLine(o,s,t.length),a=i.perpendicularLineTo(o,r,40),l=i.perpendicularLineTo(r,o,20);return{connector:e,head:o,tail:r,headLine:l,tailLine:a,minX:Math.min(o.x,r.x,l[0].x,l[1].x),minY:Math.min(o.y,r.y,l[0].y,l[1].y),maxX:Math.max(o.x,r.x,l[0].x,l[1].x),maxY:Math.max(o.y,r.y,l[0].y,l[1].y)}}},e.Overlays.Label=function(t){this.labelStyle=t.labelStyle;this.cssClass=null!=this.labelStyle?this.labelStyle.cssClass:null;var n=e.extend({create:function(){return e.createElement("div")}},t);if(e.Overlays.Custom.call(this,n),this.type="Label",this.label=t.label||"",this.labelText=null,this.labelStyle){var i=this.getElement();if(this.labelStyle.font=this.labelStyle.font||"12px sans-serif",i.style.font=this.labelStyle.font,i.style.color=this.labelStyle.color||"black",this.labelStyle.fill&&(i.style.background=this.labelStyle.fill),this.labelStyle.borderWidth>0){var o=this.labelStyle.borderStyle?this.labelStyle.borderStyle:"black";i.style.border=this.labelStyle.borderWidth+"px solid "+o}this.labelStyle.padding&&(i.style.padding=this.labelStyle.padding)}},n.extend(e.Overlays.Label,e.Overlays.Custom,{cleanup:function(t){t&&(this.div=null,this.label=null,this.labelText=null,this.cssClass=null,this.labelStyle=null)},getLabel:function(){return this.label},setLabel:function(t){this.label=t,this.labelText=null,this.clearCachedDimensions(),this.update(),this.component.repaint()},getDimensions:function(){return this.update(),l.prototype.getDimensions.apply(this,arguments)},update:function(){if("function"==typeof this.label){var t=this.label(this);this.getElement().innerHTML=t.replace(/\r\n/g,"<br/>")}else null==this.labelText&&(this.labelText=this.label,this.getElement().innerHTML=this.labelText.replace(/\r\n/g,"<br/>"))},updateFrom:function(t){null!=t.label&&this.setLabel(t.label)}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=function(e){var n=e._mottle;return n||(n=e._mottle=new t.Mottle),n};t.jsPlumb.extend(t.jsPlumbInstance.prototype,{getEventManager:function(){return e(this)},on:function(t,e,n){return this.getEventManager().on.apply(this,arguments),this},off:function(t,e,n){return this.getEventManager().off.apply(this,arguments),this}})}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumbUtil,n=t.jsPlumbInstance,i="stop",o="revert",s="_jsPlumbGroup",r="show",a="hide",l=function(t){function n(t){delete t.proxies;var n,i=u[t.id];null!=i&&(n=function(e){return e.id===t.id},e.removeWithFunction(i.connections.source,n),e.removeWithFunction(i.connections.target,n),delete u[t.id]),null!=(i=c[t.id])&&(n=function(e){return e.id===t.id},e.removeWithFunction(i.connections.source,n),e.removeWithFunction(i.connections.target,n),delete c[t.id])}function i(e,n){for(var i=e.getMembers(),o=0;o<i.length;o++)t[n?r:a](i[o],!0)}function o(e){var n=e.getMembers(),i=t.getConnections({source:n},!0),o=t.getConnections({target:n},!0),s={};e.connections.source.length=0,e.connections.target.length=0;var r=function(t){for(var n=0;n<t.length;n++)s[t[n].id]||(s[t[n].id]=!0,t[n].source._jsPlumbGroup===e?(t[n].target._jsPlumbGroup!==e&&e.connections.source.push(t[n]),u[t[n].id]=e):t[n].target._jsPlumbGroup===e&&(e.connections.target.push(t[n]),c[t[n].id]=e))};r(i),r(o)}var l={},u={},c={},h=this;t.bind("connection",function(t){null!=t.source[s]&&null!=t.target[s]&&t.source[s]===t.target[s]?(u[t.connection.id]=t.source[s],c[t.connection.id]=t.source[s]):(null!=t.source[s]&&(e.suggest(t.source[s].connections.source,t.connection),u[t.connection.id]=t.source[s]),null!=t.target[s]&&(e.suggest(t.target[s].connections.target,t.connection),c[t.connection.id]=t.target[s]))}),t.bind("internal.connectionDetached",function(t){n(t.connection)}),t.bind("connectionMoved",function(t){var e=0===t.index?u:c,n=e[t.connection.id];if(n){var i=n.connections[0===t.index?"source":"target"],o=i.indexOf(t.connection);-1!==o&&i.splice(o,1)}}),this.addGroup=function(e){t.addClass(e.getEl(),"jtk-group-expanded"),l[e.id]=e,e.manager=this,o(e),t.fire("group:add",{group:e})},this.addToGroup=function(e,n,i){if(e=this.getGroup(e)){var o=e.getEl();if(n._isJsPlumbGroup)return;var s=n._jsPlumbGroup;if(s!==e){var r=t.getOffset(n,!0),a=e.collapsed?t.getOffset(o,!0):t.getOffset(e.getDragArea(),!0);null!=s&&(s.remove(n,i),h.updateConnectionsForGroup(s)),e.add(n,i);var l=function(t,n){var i=0===n?1:0;t.each(function(t){t.setVisible(!1),t.endpoints[i].element._jsPlumbGroup===e?(t.endpoints[i].setVisible(!1),h.expandConnection(t,i,e)):(t.endpoints[n].setVisible(!1),h.collapseConnection(t,n,e))})};e.collapsed&&(l(t.select({source:n}),0),l(t.select({target:n}),1));var u=t.getId(n);t.dragManager.setParent(n,u,o,t.getId(o),r);var c={left:r.left-a.left,top:r.top-a.top};t.setPosition(n,c),t.dragManager.revalidateParent(n,u,r),h.updateConnectionsForGroup(e),t.revalidate(u),setTimeout(function(){t.fire("group:addMember",{group:e,el:n})},0)}}},this.removeFromGroup=function(t,e,n){(t=this.getGroup(t))&&t.remove(e,null,n)},this.getGroup=function(t){var n=t;if(e.isString(t)&&null==(n=l[t]))throw new TypeError("No such group ["+t+"]");return n},this.getGroups=function(){var t=[];for(var e in l)t.push(l[e]);return t},this.removeGroup=function(e,n,i,o){e=this.getGroup(e),this.expandGroup(e,!0),e[n?"removeAll":"orphanAll"](i,o),t.remove(e.getEl()),delete l[e.id],delete t._groups[e.id],t.fire("group:remove",{group:e})},this.removeAllGroups=function(t,e,n){for(var i in l)this.removeGroup(l[i],t,e,n)};var d=this.collapseConnection=function(e,n,i){var o,r=i.getEl(),a=t.getId(r),l=e.endpoints[n].elementId,u=e.endpoints[0===n?1:0].element;u[s]&&!u[s].shouldProxy()&&u[s].collapsed||(e.proxies=e.proxies||[],o=e.proxies[n]?e.proxies[n].ep:t.addEndpoint(r,{endpoint:i.getEndpoint(e,n),anchor:i.getAnchor(e,n),parameters:{isProxyEndpoint:!0}}),o.setDeleteOnEmpty(!0),e.proxies[n]={ep:o,originalEp:e.endpoints[n]},0===n?t.anchorManager.sourceChanged(l,a,e,r):(t.anchorManager.updateOtherEndpoint(e.endpoints[0].elementId,l,a,e),e.target=r,e.targetId=a),e.proxies[n].originalEp.detachFromConnection(e,null,!0),o.connections=[e],e.endpoints[n]=o,e.setVisible(!0))};this.collapseGroup=function(e){if(null!=(e=this.getGroup(e))&&!e.collapsed){var n=e.getEl();if(i(e,!1),e.shouldProxy()){var o=function(t,n){for(var i=0;i<t.length;i++){var o=t[i];d(o,n,e)}};o(e.connections.source,0),o(e.connections.target,1)}e.collapsed=!0,t.removeClass(n,"jtk-group-expanded"),t.addClass(n,"jtk-group-collapsed"),t.revalidate(n),t.fire("group:collapse",{group:e})}};var p=this.expandConnection=function(e,n,i){if(null!=e.proxies&&null!=e.proxies[n]){var o=t.getId(i.getEl()),s=e.proxies[n].originalEp.element,r=e.proxies[n].originalEp.elementId;e.endpoints[n]=e.proxies[n].originalEp,0===n?t.anchorManager.sourceChanged(o,r,e,s):(t.anchorManager.updateOtherEndpoint(e.endpoints[0].elementId,o,r,e),e.target=s,e.targetId=r),e.proxies[n].ep.detachFromConnection(e,null),e.proxies[n].originalEp.addConnection(e),delete e.proxies[n]}};this.expandGroup=function(e,n){if(null!=(e=this.getGroup(e))&&e.collapsed){var o=e.getEl();if(i(e,!0),e.shouldProxy()){var s=function(t,n){for(var i=0;i<t.length;i++){var o=t[i];p(o,n,e)}};s(e.connections.source,0),s(e.connections.target,1)}e.collapsed=!1,t.addClass(o,"jtk-group-expanded"),t.removeClass(o,"jtk-group-collapsed"),t.revalidate(o),this.repaintGroup(e),n||t.fire("group:expand",{group:e})}},this.repaintGroup=function(e){e=this.getGroup(e);for(var n=e.getMembers(),i=0;i<n.length;i++)t.revalidate(n[i])},this.updateConnectionsForGroup=o,this.refreshAllGroups=function(){for(var e in l)o(l[e]),t.dragManager.updateOffsets(t.getId(l[e].getEl()))}},u=function(n,r){function a(t){return t.offsetParent}function l(t,e){var i=a(t),o=n.getSize(i),s=n.getSize(t),r=e[0],l=r+s[0],u=e[1],c=u+s[1];return l>0&&r<o[0]&&c>0&&u<o[1]}function u(t){var e=n.getId(t),i=n.getOffset(t);t.parentNode.removeChild(t),n.getContainer().appendChild(t),n.setPosition(t,i),delete t._jsPlumbGroup,d(t),n.dragManager.clearParent(t,e)}function c(t){if(!l(t.el,t.pos)){var e=t.el._jsPlumbGroup;_?n.remove(t.el):u(t.el),e.remove(t.el)}}function h(t){var e=n.getId(t);n.revalidate(t),n.dragManager.revalidateParent(t,e)}function d(t){t._katavorioDrag&&((_||P)&&t._katavorioDrag.off(i,c),_||P||!b||(t._katavorioDrag.off(o,h),t._katavorioDrag.setRevert(null)))}function p(t){t._katavorioDrag&&((_||P)&&t._katavorioDrag.on(i,c),y&&t._katavorioDrag.setConstrain(!0),v&&t._katavorioDrag.setUseGhostProxy(!0),_||P||!b||(t._katavorioDrag.on(o,h),t._katavorioDrag.setRevert(function(t,e){return!l(t,e)})))}var f=this,g=r.el;this.getEl=function(){return g},this.id=r.id||e.uuid(),g._isJsPlumbGroup=!0;var m=this.getDragArea=function(){var t=n.getSelector(g,"[jtk-group-content]");return t&&t.length>0?t[0]:g},v=!0===r.ghost,y=v||!0===r.constrain,b=!1!==r.revert,P=!0===r.orphan,_=!0===r.prune,x=!0===r.dropOverride,C=!1!==r.proxied,E=[];if(this.connections={source:[],target:[],internal:[]},this.getAnchor=function(t,e){return r.anchor||"Continuous"},this.getEndpoint=function(t,e){return r.endpoint||["Dot",{radius:10}]},this.collapsed=!1,!1!==r.draggable){var j={stop:function(t){n.fire("groupDragStop",jsPlumb.extend(t,{group:f}))},scope:"_jsPlumbGroupDrag"};r.dragOptions&&t.jsPlumb.extend(j,r.dragOptions),n.draggable(r.el,j)}!1!==r.droppable&&n.droppable(r.el,{drop:function(t){var e=t.drag.el;if(!e._isJsPlumbGroup){var i=e._jsPlumbGroup;if(i!==f){if(null!=i&&i.overrideDrop(e,f))return;n.getGroupManager().addToGroup(f,e,!1)}}}});var S=function(t,e){for(var n=null==t.nodeType?t:[t],i=0;i<n.length;i++)e(n[i])};this.overrideDrop=function(t,e){return x&&(b||_||P)},this.add=function(t,e){var i=m();S(t,function(t){if(null!=t._jsPlumbGroup){if(t._jsPlumbGroup===f)return;t._jsPlumbGroup.remove(t,!0,e,!1)}t._jsPlumbGroup=f,E.push(t),n.isAlreadyDraggable(t)&&p(t),t.parentNode!==i&&i.appendChild(t),e||n.fire("group:addMember",{group:f,el:t})}),n.getGroupManager().updateConnectionsForGroup(f)},this.remove=function(t,i,o,s){S(t,function(t){if(delete t._jsPlumbGroup,e.removeWithFunction(E,function(e){return e===t}),i)try{f.getDragArea().removeChild(t)}catch(t){jsPlumbUtil.log("Could not remove element from Group "+t)}d(t),o||n.fire("group:removeMember",{group:f,el:t})}),s||n.getGroupManager().updateConnectionsForGroup(f)},this.removeAll=function(t,e){for(var i=0,o=E.length;i<o;i++)f.remove(E[0],t,e,!0);E.length=0,n.getGroupManager().updateConnectionsForGroup(f)},this.orphanAll=function(){for(var t=0;t<E.length;t++)u(E[t]);E.length=0},this.getMembers=function(){return E},g[s]=this,n.bind("elementDraggable",function(t){t.el._jsPlumbGroup===this&&p(t.el)}.bind(this)),this.shouldProxy=function(){return C},n.getGroupManager().addGroup(this)};n.prototype.addGroup=function(t){var e=this;if(e._groups=e._groups||{},null!=e._groups[t.id])throw new TypeError("cannot create Group ["+t.id+"]; a Group with that ID exists");if(null!=t.el[s])throw new TypeError("cannot create Group ["+t.id+"]; the given element is already a Group");var n=new u(e,t);return e._groups[n.id]=n,t.collapsed&&this.collapseGroup(n),n},n.prototype.addToGroup=function(t,e,n){var i=function(e){var i=this.getId(e);this.manage(i,e),this.getGroupManager().addToGroup(t,e,n)}.bind(this);if(Array.isArray(e))for(var o=0;o<e.length;o++)i(e[o]);else i(e)},n.prototype.removeFromGroup=function(t,e,n){this.getGroupManager().removeFromGroup(t,e,n)},n.prototype.removeGroup=function(t,e,n,i){this.getGroupManager().removeGroup(t,e,n,i)},n.prototype.removeAllGroups=function(t,e,n){this.getGroupManager().removeAllGroups(t,e,n)},n.prototype.getGroup=function(t){return this.getGroupManager().getGroup(t)},n.prototype.getGroups=function(){return this.getGroupManager().getGroups()},n.prototype.expandGroup=function(t){this.getGroupManager().expandGroup(t)},n.prototype.collapseGroup=function(t){this.getGroupManager().collapseGroup(t)},n.prototype.repaintGroup=function(t){this.getGroupManager().repaintGroup(t)},n.prototype.toggleGroup=function(t){null!=(t=this.getGroupManager().getGroup(t))&&this.getGroupManager()[t.collapsed?"expandGroup":"collapseGroup"](t)},n.prototype.getGroupManager=function(){var t=this._groupManager;return null==t&&(t=this._groupManager=new l(this)),t},n.prototype.removeGroupManager=function(){delete this._groupManager},n.prototype.getGroupFor=function(t){if(t=this.getElement(t))return t[s]}}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t){this.type="Flowchart",t=t||{},t.stub=null==t.stub?30:t.stub;var n,i,o=e.Connectors.AbstractConnector.apply(this,arguments),s=null==t.midpoint?.5:t.midpoint,r=!0===t.alwaysRespectStubs,a=null,l=null,u=null!=t.cornerRadius?t.cornerRadius:0,c=(t.loopbackRadius,function(t){return t<0?-1:0===t?0:1}),h=function(t,e,n,i){if(a!==e||l!==n){var o=null==a?i.sx:a,s=null==l?i.sy:l,r=o===e?"v":"h",u=c(e-o),h=c(n-s);a=e,l=n,t.push([o,s,e,n,r,u,h])}},d=function(t){return Math.sqrt(Math.pow(t[0]-t[2],2)+Math.pow(t[1]-t[3],2))},p=function(t){var e=[];return e.push.apply(e,t),e},f=function(t,e,n){for(var i,s=null,r=0;r<e.length-1;r++){if(s=s||p(e[r]),i=p(e[r+1]),u>0&&s[4]!==i[4]){var a=Math.min(u,d(s),d(i));s[2]-=s[5]*a,s[3]-=s[6]*a,i[0]+=i[5]*a,i[1]+=i[6]*a;var l=s[6]===i[5]&&1===i[5]||s[6]===i[5]&&0===i[5]&&s[5]!==i[6]||s[6]===i[5]&&-1===i[5],c=i[1]>s[3]?1:-1,h=i[0]>s[2]?1:-1,f=c===h,g=f&&l||!f&&!l?i[0]:s[2],m=f&&l||!f&&!l?s[3]:i[1];o.addSegment(t,"Straight",{x1:s[0],y1:s[1],x2:s[2],y2:s[3]}),o.addSegment(t,"Arc",{r:a,x1:s[2],y1:s[3],x2:i[0],y2:i[1],cx:g,cy:m,ac:l})}else{var v=s[2]===s[0]?0:s[2]>s[0]?n.lw/2:-n.lw/2,y=s[3]===s[1]?0:s[3]>s[1]?n.lw/2:-n.lw/2;o.addSegment(t,"Straight",{x1:s[0]-v,y1:s[1]-y,x2:s[2]+v,y2:s[3]+y})}s=i}null!=i&&o.addSegment(t,"Straight",{x1:i[0],y1:i[1],x2:i[2],y2:i[3]})};this._compute=function(t,e){n=[],a=null,l=null,i=null;var u=function(){return[t.startStubX,t.startStubY,t.endStubX,t.endStubY]},c={perpendicular:u,orthogonal:u,opposite:function(e){var n=t,i="x"===e?0:1,o={x:function(){return 1===n.so[i]&&(n.startStubX>n.endStubX&&n.tx>n.startStubX||n.sx>n.endStubX&&n.tx>n.sx)||-1===n.so[i]&&(n.startStubX<n.endStubX&&n.tx<n.startStubX||n.sx<n.endStubX&&n.tx<n.sx)},y:function(){return 1===n.so[i]&&(n.startStubY>n.endStubY&&n.ty>n.startStubY||n.sy>n.endStubY&&n.ty>n.sy)||-1===n.so[i]&&(n.startStubY<n.endStubY&&n.ty<n.startStubY||n.sy<n.endStubY&&n.ty<n.sy)}};return!r&&o[e]()?{x:[(t.sx+t.tx)/2,t.startStubY,(t.sx+t.tx)/2,t.endStubY],y:[t.startStubX,(t.sy+t.ty)/2,t.endStubX,(t.sy+t.ty)/2]}[e]:[t.startStubX,t.startStubY,t.endStubX,t.endStubY]}},d=c[t.anchorOrientation](t.sourceAxis),p="x"===t.sourceAxis?0:1,g="x"===t.sourceAxis?1:0,m=d[p],v=d[g],y=d[p+2],b=d[g+2];h(n,d[0],d[1],t);var P=t.startStubX+(t.endStubX-t.startStubX)*s,_=t.startStubY+(t.endStubY-t.startStubY)*s,x={x:[0,1],y:[1,0]},C={perpendicular:function(e){var n=t,i={x:[[[1,2,3,4],null,[2,1,4,3]],null,[[4,3,2,1],null,[3,4,1,2]]],y:[[[3,2,1,4],null,[2,3,4,1]],null,[[4,1,2,3],null,[1,4,3,2]]]},o={x:[[n.startStubX,n.endStubX],null,[n.endStubX,n.startStubX]],y:[[n.startStubY,n.endStubY],null,[n.endStubY,n.startStubY]]},s={x:[[P,n.startStubY],[P,n.endStubY]],y:[[n.startStubX,_],[n.endStubX,_]]},r={x:[[n.endStubX,n.startStubY]],y:[[n.startStubX,n.endStubY]]},a={x:[[n.startStubX,n.endStubY],[n.endStubX,n.endStubY]],y:[[n.endStubX,n.startStubY],[n.endStubX,n.endStubY]]},l={x:[[n.startStubX,_],[n.endStubX,_],[n.endStubX,n.endStubY]],y:[[P,n.startStubY],[P,n.endStubY],[n.endStubX,n.endStubY]]},u={x:[n.startStubY,n.endStubY],y:[n.startStubX,n.endStubX]},c=x[e][0],h=x[e][1],d=n.so[c]+1,p=n.to[h]+1,f=-1===n.to[h]&&u[e][1]<u[e][0]||1===n.to[h]&&u[e][1]>u[e][0],g=o[e][d][0],m=o[e][d][1],v=i[e][d][p];return n.segment===v[3]||n.segment===v[2]&&f?s[e]:n.segment===v[2]&&m<g?r[e]:n.segment===v[2]&&m>=g||n.segment===v[1]&&!f?l[e]:n.segment===v[0]||n.segment===v[1]&&f?a[e]:void 0},orthogonal:function(e,n,i,o,s){var r=t,a={x:-1===r.so[0]?Math.min(n,o):Math.max(n,o),y:-1===r.so[1]?Math.min(n,o):Math.max(n,o)}[e];return{x:[[a,i],[a,s],[o,s]],y:[[i,a],[s,a],[s,o]]}[e]},opposite:function(n,i,s,r){var a=t,l={x:"y",y:"x"}[n],u={x:"height",y:"width"}[n],c=a["is"+n.toUpperCase()+"GreaterThanStubTimes2"];if(e.sourceEndpoint.elementId===e.targetEndpoint.elementId){var h=s+(1-e.sourceEndpoint.anchor[l])*e.sourceInfo[u]+o.maxStub;return{x:[[i,h],[r,h]],y:[[h,i],[h,r]]}[n]}return!c||1===a.so[p]&&i>r||-1===a.so[p]&&i<r?{x:[[i,_],[r,_]],y:[[P,i],[P,r]]}[n]:1===a.so[p]&&i<r||-1===a.so[p]&&i>r?{x:[[P,a.sy],[P,a.ty]],y:[[a.sx,_],[a.tx,_]]}[n]:void 0}},E=C[t.anchorOrientation](t.sourceAxis,m,v,y,b);if(E)for(var j=0;j<E.length;j++)h(n,E[j][0],E[j][1],t);h(n,d[2],d[3],t),h(n,t.tx,t.ty,t),f(this,n,t)}};n.extend(i,e.Connectors.AbstractConnector),e.registerConnectorType(i,"Flowchart")}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil;e.Connectors.AbstractBezierConnector=function(t){t=t||{};var n,i=!1!==t.showLoopback,o=(t.curviness,t.margin||5),s=(t.proximityLimit,t.orientation&&"clockwise"===t.orientation),r=t.loopbackRadius||25,a=!1;return this.overrideSetEditable=function(){return!a},this._compute=function(t,e){var l=e.sourcePos,u=e.targetPos,c=Math.abs(l[0]-u[0]),h=Math.abs(l[1]-u[1]);if(i&&e.sourceEndpoint.elementId===e.targetEndpoint.elementId){a=!0;var d=e.sourcePos[0],p=e.sourcePos[1]-o,f=d,g=p-r,m=f-r,v=g-r;c=2*r,h=2*r,t.points[0]=m,t.points[1]=v,t.points[2]=c,t.points[3]=h,n.addSegment(this,"Arc",{loopback:!0,x1:d-m+4,y1:p-v,startAngle:0,endAngle:2*Math.PI,r:r,ac:!s,x2:d-m-4,y2:p-v,cx:f-m,cy:g-v})}else a=!1,this._computeBezier(t,e,l,u,c,h)},n=e.Connectors.AbstractConnector.apply(this,arguments)},n.extend(e.Connectors.AbstractBezierConnector,e.Connectors.AbstractConnector);var i=function(t){t=t||{},this.type="Bezier";var n=e.Connectors.AbstractBezierConnector.apply(this,arguments),i=t.curviness||150;this.getCurviness=function(){return i},this._findControlPoint=function(t,e,n,o,s,r,a){var l=r[0]!==a[0]||r[1]===a[1],u=[];return l?(0===a[0]?u.push(n[0]<e[0]?t[0]+10:t[0]-10):u.push(t[0]+i*a[0]),0===a[1]?u.push(n[1]<e[1]?t[1]+10:t[1]-10):u.push(t[1]+i*r[1])):(0===r[0]?u.push(e[0]<n[0]?t[0]+10:t[0]-10):u.push(t[0]-i*r[0]),0===r[1]?u.push(e[1]<n[1]?t[1]+10:t[1]-10):u.push(t[1]+i*a[1])),u},this._computeBezier=function(t,e,i,o,s,r){var a,l,u=this.getGeometry(),c=i[0]<o[0]?s:0,h=i[1]<o[1]?r:0,d=i[0]<o[0]?0:s,p=i[1]<o[1]?0:r;(this.hasBeenEdited()||this.isEditing())&&null!=u&&null!=u.controlPoints&&null!=u.controlPoints[0]&&null!=u.controlPoints[1]?(a=u.controlPoints[0],l=u.controlPoints[1]):(a=this._findControlPoint([c,h],i,o,e.sourceEndpoint,e.targetEndpoint,t.so,t.to),l=this._findControlPoint([d,p],o,i,e.targetEndpoint,e.sourceEndpoint,t.to,t.so)),n.setGeometry({controlPoints:[a,l]},!0),n.addSegment(this,"Bezier",{x1:c,y1:h,x2:d,y2:p,cp1x:a[0],cp1y:a[1],cp2x:l[0],cp2y:l[1]})}};n.extend(i,e.Connectors.AbstractBezierConnector),e.registerConnectorType(i,"Bezier")}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t,e,n,i){return t<=n&&i<=e?1:t<=n&&e<=i?2:n<=t&&i>=e?3:4},o=function(t,e,n,i,o,s,r,a,l){return a<=l?[t,e]:1===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*s:s),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*r:r)]:[t+-1*s,e+-1*r]:2===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*s:s),e]:i[2]>=1&&o[2]<=0?[t,e+(i[3]<.5?-1*r:r)]:[t+s,e+-1*r]:3===n?i[3]>=1&&o[3]<=0?[t+(i[2]<.5?-1*s:s),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*r:r)]:[t+-1*s,e+-1*r]:4===n?i[3]<=0&&o[3]>=1?[t+(i[2]<.5?-1*s:s),e]:i[2]<=0&&o[2]>=1?[t,e+(i[3]<.5?-1*r:r)]:[t+s,e+-1*r]:void 0},s=function(t){t=t||{},this.type="StateMachine";var n,s=e.Connectors.AbstractBezierConnector.apply(this,arguments),r=t.curviness||10,a=t.margin||5,l=t.proximityLimit||80;t.orientation&&t.orientation;this._computeBezier=function(t,e,u,c,h,d){var p=e.sourcePos[0]<e.targetPos[0]?0:h,f=e.sourcePos[1]<e.targetPos[1]?0:d,g=e.sourcePos[0]<e.targetPos[0]?h:0,m=e.sourcePos[1]<e.targetPos[1]?d:0;0===e.sourcePos[2]&&(p-=a),1===e.sourcePos[2]&&(p+=a),0===e.sourcePos[3]&&(f-=a),1===e.sourcePos[3]&&(f+=a),0===e.targetPos[2]&&(g-=a),1===e.targetPos[2]&&(g+=a),0===e.targetPos[3]&&(m-=a),1===e.targetPos[3]&&(m+=a);var v,y,b,P,_=(p+g)/2,x=(f+m)/2,C=i(p,f,g,m),E=Math.sqrt(Math.pow(g-p,2)+Math.pow(m-f,2)),j=s.getGeometry();(this.hasBeenEdited()||this.isEditing())&&null!=j?(v=j.controlPoints[0][0],b=j.controlPoints[0][1],y=j.controlPoints[1][0],P=j.controlPoints[1][1]):(n=o(_,x,C,e.sourcePos,e.targetPos,r,r,E,l),v=n[0],y=n[0],b=n[1],P=n[1],s.setGeometry({controlPoints:[n,n]},!0)),s.addSegment(this,"Bezier",{x1:g,y1:m,x2:p,y2:f,cp1x:v,cp1y:b,cp2x:y,cp2y:P})}};n.extend(s,e.Connectors.AbstractBezierConnector),e.registerConnectorType(s,"StateMachine")}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=function(t){this.type="Straight";var n=e.Connectors.AbstractConnector.apply(this,arguments);this._compute=function(t,e){n.addSegment(this,"Straight",{x1:t.sx,y1:t.sy,x2:t.startStubX,y2:t.startStubY}),n.addSegment(this,"Straight",{x1:t.startStubX,y1:t.startStubY,x2:t.endStubX,y2:t.endStubY}),n.addSegment(this,"Straight",{x1:t.endStubX,y1:t.endStubY,x2:t.tx,y2:t.ty})}};n.extend(i,e.Connectors.AbstractConnector),e.registerConnectorType(i,"Straight")}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i={"stroke-linejoin":"stroke-linejoin","stroke-dashoffset":"stroke-dashoffset","stroke-linecap":"stroke-linecap"},o={svg:"http://www.w3.org/2000/svg"},s=function(t,e){for(var n in e)t.setAttribute(n,""+e[n])},r=function(t,n){return n=n||{},n.version="1.1",n.xmlns=o.svg,e.createElementNS(o.svg,t,null,null,n)},a=function(t){return"position:absolute;left:"+t[0]+"px;top:"+t[1]+"px"},l=function(t){for(var e=t.querySelectorAll(" defs,linearGradient,radialGradient"),n=0;n<e.length;n++)e[n].parentNode.removeChild(e[n])},u=function(t,e,n,i,o){var s="jsplumb_gradient_"+o._jsPlumb.instance.idstamp();l(t);var a;a=n.gradient.offset?r("radialGradient",{id:s}):r("linearGradient",{id:s,gradientUnits:"userSpaceOnUse"});var u=r("defs");t.appendChild(u),u.appendChild(a);for(var c=0;c<n.gradient.stops.length;c++){var h=1===o.segment||2===o.segment?c:n.gradient.stops.length-1-c,d=n.gradient.stops[h][1],p=r("stop",{offset:Math.floor(100*n.gradient.stops[c][0])+"%","stop-color":d});a.appendChild(p)}var f=n.stroke?"stroke":"fill";e.setAttribute(f,"url(#"+s+")")},c=function(t,e,n,o,s){if(e.setAttribute("fill",n.fill?n.fill:"none"),e.setAttribute("stroke",n.stroke?n.stroke:"none"),n.gradient?u(t,e,n,0,s):(l(t),e.setAttribute("style","")),n.strokeWidth&&e.setAttribute("stroke-width",n.strokeWidth),n.dashstyle&&n.strokeWidth&&!n["stroke-dasharray"]){var r=-1===n.dashstyle.indexOf(",")?" ":",",a=n.dashstyle.split(r),c="";a.forEach(function(t){c+=Math.floor(t*n.strokeWidth)+r}),e.setAttribute("stroke-dasharray",c)}else n["stroke-dasharray"]&&e.setAttribute("stroke-dasharray",n["stroke-dasharray"]);for(var h in i)n[h]&&e.setAttribute(i[h],n[h])},h=function(t,e,n){t.childNodes.length>n?t.insertBefore(e,t.childNodes[n]):t.appendChild(e)};n.svg={node:r,attr:s,pos:a};var d=function(t){var i=t.pointerEventsSpec||"all",o={};e.jsPlumbUIComponent.apply(this,t.originalArgs),this.canvas=null,this.path=null,this.svg=null,this.bgCanvas=null;var l=t.cssClass+" "+(t.originalArgs[0].cssClass||""),u={style:"",width:0,height:0,"pointer-events":i,position:"absolute"};this.svg=r("svg",u),t.useDivWrapper?(this.canvas=e.createElement("div",{position:"absolute"}),n.sizeElement(this.canvas,0,0,1,1),this.canvas.className=l):(s(this.svg,{class:l}),this.canvas=this.svg),t._jsPlumb.appendElement(this.canvas,t.originalArgs[0].parent),t.useDivWrapper&&this.canvas.appendChild(this.svg);var c=[this.canvas];return this.getDisplayElements=function(){return c},this.appendDisplayElement=function(t){c.push(t)},this.paint=function(e,i,r){if(null!=e){var l,u=[this.x,this.y],c=[this.w,this.h];null!=r&&(r.xmin<0&&(u[0]+=r.xmin),r.ymin<0&&(u[1]+=r.ymin),c[0]=r.xmax+(r.xmin<0?-r.xmin:0),c[1]=r.ymax+(r.ymin<0?-r.ymin:0)),t.useDivWrapper?(n.sizeElement(this.canvas,u[0],u[1],c[0],c[1]),u[0]=0,u[1]=0,l=a([0,0])):l=a([u[0],u[1]]),o.paint.apply(this,arguments),s(this.svg,{style:l,width:c[0]||0,height:c[1]||0})}},{renderer:o}};n.extend(d,e.jsPlumbUIComponent,{cleanup:function(t){t||null==this.typeId?(this.canvas&&(this.canvas._jsPlumb=null),this.svg&&(this.svg._jsPlumb=null),this.bgCanvas&&(this.bgCanvas._jsPlumb=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.svg=null,this.canvas=null,this.path=null,this.group=null):(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.bgCanvas&&this.bgCanvas.parentNode&&this.bgCanvas.parentNode.removeChild(this.bgCanvas))},reattach:function(t){var e=t.getContainer();this.canvas&&null==this.canvas.parentNode&&e.appendChild(this.canvas),this.bgCanvas&&null==this.bgCanvas.parentNode&&e.appendChild(this.bgCanvas)},setVisible:function(t){this.canvas&&(this.canvas.style.display=t?"block":"none")}}),e.ConnectorRenderers.svg=function(t){var n=this,i=d.apply(this,[{cssClass:t._jsPlumb.connectorClass+(this.isEditable()?" "+t._jsPlumb.editableConnectorClass:""),originalArgs:arguments,pointerEventsSpec:"none",_jsPlumb:t._jsPlumb}]),o=this.setEditable;this.setEditable=function(t){var n=o.apply(this,[t]);e[n?"addClass":"removeClass"](this.canvas,this._jsPlumb.instance.editableConnectorClass)},i.renderer.paint=function(i,o,a){var l=n.getSegments(),u="",d=[0,0];if(a.xmin<0&&(d[0]=-a.xmin),a.ymin<0&&(d[1]=-a.ymin),l.length>0){u=n.getPathData();var p={d:u,transform:"translate("+d[0]+","+d[1]+")","pointer-events":t["pointer-events"]||"visibleStroke"},f=null;n.x,n.y,n.w,n.h;if(i.outlineStroke){var g=i.outlineWidth||1,m=i.strokeWidth+2*g;f=e.extend({},i),delete f.gradient,f.stroke=i.outlineStroke,f.strokeWidth=m,null==n.bgPath?(n.bgPath=r("path",p),e.addClass(n.bgPath,e.connectorOutlineClass),h(n.svg,n.bgPath,0)):s(n.bgPath,p),c(n.svg,n.bgPath,f,0,n)}null==n.path?(n.path=r("path",p),h(n.svg,n.path,i.outlineStroke?1:0)):s(n.path,p),c(n.svg,n.path,i,0,n)}}},n.extend(e.ConnectorRenderers.svg,d);var p=e.SvgEndpoint=function(t){d.apply(this,[{cssClass:t._jsPlumb.endpointClass,originalArgs:arguments,pointerEventsSpec:"all",useDivWrapper:!0,_jsPlumb:t._jsPlumb}]).renderer.paint=function(t){var n=e.extend({},t);n.outlineStroke&&(n.stroke=n.outlineStroke),null==this.node?(this.node=this.makeNode(n),this.svg.appendChild(this.node)):null!=this.updateNode&&this.updateNode(this.node),c(this.svg,this.node,n,(this.x,this.y,this.w,this.h),this),a(this.node,(this.x,this.y))}.bind(this)};n.extend(p,d),e.Endpoints.svg.Dot=function(){e.Endpoints.Dot.apply(this,arguments),p.apply(this,arguments),this.makeNode=function(t){return r("circle",{cx:this.w/2,cy:this.h/2,r:this.radius})},this.updateNode=function(t){s(t,{cx:this.w/2,cy:this.h/2,r:this.radius})}},n.extend(e.Endpoints.svg.Dot,[e.Endpoints.Dot,p]),e.Endpoints.svg.Rectangle=function(){e.Endpoints.Rectangle.apply(this,arguments),p.apply(this,arguments),this.makeNode=function(t){return r("rect",{width:this.w,height:this.h})},this.updateNode=function(t){s(t,{width:this.w,height:this.h})}},n.extend(e.Endpoints.svg.Rectangle,[e.Endpoints.Rectangle,p]),e.Endpoints.svg.Image=e.Endpoints.Image,e.Endpoints.svg.Blank=e.Endpoints.Blank,e.Overlays.svg.Label=e.Overlays.Label,e.Overlays.svg.Custom=e.Overlays.Custom;var f=function(t,n){t.apply(this,n),e.jsPlumbUIComponent.apply(this,n),this.isAppendedAtTopLevel=!1;this.path=null,this.paint=function(t,e){if(t.component.svg&&e){null==this.path&&(this.path=r("path",{"pointer-events":"all"}),t.component.svg.appendChild(this.path),this.elementCreated&&this.elementCreated(this.path,t.component),this.canvas=t.component.svg);var o=n&&1===n.length?n[0].cssClass||"":"",a=[0,0];e.xmin<0&&(a[0]=-e.xmin),e.ymin<0&&(a[1]=-e.ymin),s(this.path,{d:i(t.d),class:o,stroke:t.stroke?t.stroke:null,fill:t.fill?t.fill:null,transform:"translate("+a[0]+","+a[1]+")"})}};var i=function(t){return isNaN(t.cxy.x)||isNaN(t.cxy.y)?"":"M"+t.hxy.x+","+t.hxy.y+" L"+t.tail[0].x+","+t.tail[0].y+" L"+t.cxy.x+","+t.cxy.y+" L"+t.tail[1].x+","+t.tail[1].y+" L"+t.hxy.x+","+t.hxy.y};this.transfer=function(t){t.canvas&&this.path&&this.path.parentNode&&(this.path.parentNode.removeChild(this.path),t.canvas.appendChild(this.path))}};n.extend(f,[e.jsPlumbUIComponent,e.Overlays.AbstractOverlay],{cleanup:function(t){null!=this.path&&(t?this._jsPlumb.instance.removeElement(this.path):this.path.parentNode&&this.path.parentNode.removeChild(this.path))},reattach:function(t,e){this.path&&e.canvas&&e.canvas.appendChild(this.path)},setVisible:function(t){null!=this.path&&(this.path.style.display=t?"block":"none")}}),e.Overlays.svg.Arrow=function(){f.apply(this,[e.Overlays.Arrow,arguments])},n.extend(e.Overlays.svg.Arrow,[e.Overlays.Arrow,f]),e.Overlays.svg.PlainArrow=function(){f.apply(this,[e.Overlays.PlainArrow,arguments])},n.extend(e.Overlays.svg.PlainArrow,[e.Overlays.PlainArrow,f]),e.Overlays.svg.Diamond=function(){f.apply(this,[e.Overlays.Diamond,arguments])},n.extend(e.Overlays.svg.Diamond,[e.Overlays.Diamond,f]),e.Overlays.svg.GuideLines=function(){var t,n,i=null,o=this;e.Overlays.GuideLines.apply(this,arguments),this.paint=function(e,l){null==i&&(i=r("path"),e.connector.svg.appendChild(i),o.attachListeners(i,e.connector),o.attachListeners(i,o),t=r("path"),e.connector.svg.appendChild(t),o.attachListeners(t,e.connector),o.attachListeners(t,o),n=r("path"),e.connector.svg.appendChild(n),o.attachListeners(n,e.connector),o.attachListeners(n,o));var u=[0,0];l.xmin<0&&(u[0]=-l.xmin),l.ymin<0&&(u[1]=-l.ymin),s(i,{d:a(e.head,e.tail),stroke:"red",fill:null,transform:"translate("+u[0]+","+u[1]+")"}),s(t,{d:a(e.tailLine[0],e.tailLine[1]),stroke:"blue",fill:null,transform:"translate("+u[0]+","+u[1]+")"}),s(n,{d:a(e.headLine[0],e.headLine[1]),stroke:"green",fill:null,transform:"translate("+u[0]+","+u[1]+")"})};var a=function(t,e){return"M "+t.x+","+t.y+" L"+e.x+","+e.y}},n.extend(e.Overlays.svg.GuideLines,e.Overlays.GuideLines)}.call("undefined"!=typeof window?window:this),function(){"use strict";var t=this,e=t.jsPlumb,n=t.jsPlumbUtil,i=t.Katavorio,o=t.Biltong,s=function(t,n){n=n||"main";var s="_katavorio_"+n,r=t[s],a=t.getEventManager();return r||(r=new i({bind:a.on,unbind:a.off,getSize:e.getSize,getConstrainingRectangle:function(t){return[t.parentNode.scrollWidth,t.parentNode.scrollHeight]},getPosition:function(e,n){var i=t.getOffset(e,n,e._katavorioDrag?e.offsetParent:null);return[i.left,i.top]},setPosition:function(t,e){t.style.left=e[0]+"px",t.style.top=e[1]+"px"},addClass:e.addClass,removeClass:e.removeClass,intersects:o.intersects,indexOf:function(t,e){return t.indexOf(e)},scope:t.getDefaultScope(),css:{noSelect:t.dragSelectClass,droppable:"jtk-droppable",draggable:"jtk-draggable",drag:"jtk-drag",selected:"jtk-drag-selected",active:"jtk-drag-active",hover:"jtk-drag-hover",ghostProxy:"jtk-ghost-proxy"}}),r.setZoom(t.getZoom()),t[s]=r,t.bind("zoom",r.setZoom)),r},r=function(t,e){var i=function(i){if(null!=e[i]){if(n.isString(e[i])){var o=e[i].match(/-=/)?-1:1,s=e[i].substring(2);return t[i]+o*s}return e[i]}return t[i]};return[i("left"),i("top")]};e.extend(t.jsPlumbInstance.prototype,{animationSupported:!0,getElement:function(t){return null==t?null:(t="string"==typeof t?t:null!=t.length&&null==t.enctype?t[0]:t,"string"==typeof t?document.getElementById(t):t)},removeElement:function(t){s(this).elementRemoved(t),this.getEventManager().remove(t)},doAnimate:function(t,n,i){i=i||{};var o=this.getOffset(t),s=r(o,n),a=s[0]-o.left,l=s[1]-o.top,u=i.duration||250,c=u/15,h=15/u*a,d=15/u*l,p=0,f=setInterval(function(){e.setPosition(t,{left:o.left+h*(p+1),top:o.top+d*(p+1)}),null!=i.step&&i.step(p,Math.ceil(c)),++p>=c&&(window.clearInterval(f),null!=i.complete&&i.complete())},15)},destroyDraggable:function(t,e){s(this,e).destroyDraggable(t)},destroyDroppable:function(t,e){s(this,e).destroyDroppable(t)},initDraggable:function(t,e,n){s(this,n).draggable(t,e)},initDroppable:function(t,e,n){s(this,n).droppable(t,e)},isAlreadyDraggable:function(t){return null!=t._katavorioDrag},isDragSupported:function(t,e){return!0},isDropSupported:function(t,e){return!0},isElementDraggable:function(t){return t=e.getElement(t),t._katavorioDrag&&t._katavorioDrag.isEnabled()},getDragObject:function(t){return t[0].drag.getDragElement()},getDragScope:function(t){return t._katavorioDrag&&t._katavorioDrag.scopes.join(" ")||""},getDropEvent:function(t){return t[0].e},getUIPosition:function(t,e){var n=t[0].el;if(null==n.offsetParent)return null;var i=t[0].finalPos||t[0].pos,o={left:i[0],top:i[1]};if(n._katavorioDrag&&n.offsetParent!==this.getContainer()){var s=this.getOffset(n.offsetParent);o.left+=s.left,o.top+=s.top}return o},setDragFilter:function(t,e,n){t._katavorioDrag&&t._katavorioDrag.setFilter(e,n)},setElementDraggable:function(t,n){t=e.getElement(t),t._katavorioDrag&&t._katavorioDrag.setEnabled(n)},setDragScope:function(t,e){t._katavorioDrag&&t._katavorioDrag.k.setDragScope(t,e)},setDropScope:function(t,e){t._katavorioDrop&&t._katavorioDrop.length>0&&t._katavorioDrop[0].k.setDropScope(t,e)},addToPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){t=[e.getElement(t)],t.push.apply(t,i),o.addToPosse.apply(o,t)})},setPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){t=[e.getElement(t)],t.push.apply(t,i),o.setPosse.apply(o,t)})},removeFromPosse:function(t,n){var i=Array.prototype.slice.call(arguments,1),o=s(this);e.each(t,function(t){t=[e.getElement(t)],t.push.apply(t,i),o.removeFromPosse.apply(o,t)})},removeFromAllPosses:function(t){var n=s(this);e.each(t,function(t){n.removeFromAllPosses(e.getElement(t))})},setPosseState:function(t,n,i){var o=s(this);e.each(t,function(t){o.setPosseState(e.getElement(t),n,i)})},dragEvents:{start:"start",stop:"stop",drag:"drag",step:"step",over:"over",out:"out",drop:"drop",complete:"complete",beforeStart:"beforeStart"},animEvents:{step:"step",complete:"complete"},stopDrag:function(t){t._katavorioDrag&&t._katavorioDrag.abort()},addToDragSelection:function(t){s(this).select(t)},removeFromDragSelection:function(t){s(this).deselect(t)},clearDragSelection:function(){s(this).deselectAll()},trigger:function(t,e,n,i){this.getEventManager().trigger(t,e,n,i)},doReset:function(){for(var t in this)0===t.indexOf("_katavorio_")&&this[t].reset()}});!function(t){var e=function(){/complete|loaded|interactive/.test(document.readyState)&&void 0!==document.body&&null!=document.body?t():setTimeout(e,9)};e()}(e.init)}.call("undefined"!=typeof window?window:this)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.cache=void 0;var o=n(79),s=i(o),r=n(37),a=i(r),l=n(38),u=i(l),c=function(){function t(){(0,a.default)(this,t),this._caches=null,this.init()}return(0,u.default)(t,[{key:"init",value:function(){this._caches||(this._caches=new s.default)}},{key:"addData",value:function(t,e,n){var i=this._caches.get(t);return i||(i={},this._caches.set(t,i)),i[e]=n,i}},{key:"getData",value:function(t,e){var n=this._caches.get(t);return void 0===e?n:n&&n[e]}},{key:"removeData",value:function(t,e){var n=this._caches.get(t);n||(e?n[e]=void 0:n=void 0)}},{key:"clearData",value:function(){this._caches=new s.default}}]),t}();e.cache=new c},function(t,e,n){var i=n(5);t.exports=function(t,e,n){for(var o in e)n&&t[o]?t[o]=e[o]:i(t,o,e[o]);return t}},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var i=n(0);t.exports=function(t,e){if(!i(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},function(t,e,n){t.exports=n},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(46),s=i(o),r=n(48),a=i(r),l=n(53),u=i(l),c=n(71),h=i(c),d=n(37),p=i(d),f=n(38),g=i(f),m=n(39),v=n(40),y=function(){function t(e,n,i,o,s,r){(0,p.default)(this,t),this._jsPlumb=null,this._container=null,this._id=e,this._name=n,this._x=o,this._y=s,this._clsName=r.class||"",this._data=r&&r.data||{},this._data.nodeId=e,this._data.nodeType=i,this._options=(0,h.default)({removable:!0},r),this._el=null,r&&r.container&&this.appendTo(r.container)}return(0,g.default)(t,[{key:"getId",value:function(){return this._id}},{key:"getData",value:function(){return this._data||{}}},{key:"getPos",value:function(){return{x:this._x,y:this._y}}},{key:"setPlumb",value:function(t){this._jsPlumb=t}},{key:"_px",value:function(t){return t+"px"}},{key:"appendTo",value:function(t){if(!t)return void console.error("node container is null !");var e=this,n=e._options,i=e._px,o=document.createElement("div");if(o.classList.add("window","task",""+e._clsName),o.setAttribute("id",e._id),o.style.left=i(e._x),o.style.top=i(e._y),o.innerHTML=e._name,v.cache.addData(o,"data",this._data),v.cache.addData(o,"node",this),n.removable){var s=document.createElement("div");s.classList.add("remove"),o.append(s)}t.append(o),this._jsPlumb.draggable(o,{grid:[10,10]}),this._el=o}},{key:"addPort",value:function(e){var n=e.position||"Bottom",i=t.anchorPos[n],o=!0,s=!1,r=void 0;try{for(var a,l=(0,u.default)(i);!(o=(a=l.next()).done);o=!0){var c=a.value,h={anchor:c,isSource:!!e.isSource,isTarget:!!e.isTarget,maxConnections:-1,overlays:[t.arrowStyle,["Label",{location:t.labelPos[n],label:e.label||""}]],allowLoopback:!1,dragAllowedWhenFull:e.dragAllowedWhenFull||!0};this._jsPlumb.addEndpoint(this._el,h)}}catch(t){s=!0,r=t}finally{try{!o&&l.return&&l.return()}finally{if(s)throw r}}}},{key:"updatePos",value:function(){var t=this._el;this._x=parseInt(t.style.left.toString().replace("px",""),10),this._y=parseInt(t.style.top.toString().replace("px",""),10)}},{key:"toPlainObj",value:function(){var t=this;t.updatePos();var e=(0,h.default)({},t._data);return e.nodeId=t._id,e.positionX=t._x,e.positionY=t._y,e.className=t._clsName,e.removable=t._options.removable,e}},{key:"dispose",value:function(){var t=this._el;this._jsPlumb.remove(t)}}],[{key:"lineStyle",get:function(){return{lineWidth:5,joinstyle:"round",strokeStyle:"#445566"}}},{key:"labelPos",get:function(){return{TopBottom:[6,2.5,6,-2.5],Bottom:[6,2.5],Top:[6,-2.5]}}},{key:"anchorPos",get:function(){return{TopBottom:["Top","Bottom"],Bottom:["Bottom"],Top:["Top"]}}},{key:"arrowStyle",get:function(){return["Arrow",{location:.7},{foldback:.7,width:12}]}}]),t}(),b=function(){function t(e,n){(0,p.default)(this,t),this._jsPlumb=null,this._container=e,this._nodes=[],this._seedName="flow-chart-node",this._seedId=0,this.init(n)}return(0,g.default)(t,[{key:"nodeId",value:function(){return this._seedName+this._seedId+++(new Date).valueOf()}},{key:"getNodes",value:function(){return this._nodes}},{key:"init",value:function(t){var e=this;this._jsPlumb=m.jsPlumb.getInstance();var n={DragOptions:{cursor:"pointer",zIndex:5e3},PaintStyle:{lineWidth:5,stroke:"#445566"},HoverPaintStyle:{stroke:"#ec9f2e",lineWidth:4},Endpoint:["Dot",{radius:5}],EndpointStyle:{radius:9,fill:"#acd",stroke:"red"},EndpointHoverStyle:{fill:"#ec9f2e",stroke:"#acd"},Anchors:["Bottom"],Connector:["Bezier",{curviness:50}],ConnectionOverlays:[y.arrowStyle]};this._jsPlumb.importDefaults(n),this._container&&(this._container.classList.add("flow-chart-canvas-lkiarest"),t&&t.onNodeClick&&this._container.addEventListener("click",function(n){var i=n.target;i.getAttribute("class").indexOf("task")>=0&&t.onNodeClick.call(e,i.getAttribute("node"))}),this._container.addEventListener("click",function(n){var i=v.cache.getData(n.target.parentElement,"node");if(i&&n.target.getAttribute("class").indexOf("remove")>=0){var o=i.getData(),s=i.getId();i.dispose(),e.removeNode(s),t&&t.onNodeDel&&t.onNodeDel.call(e,o)}n.stopPropagation()}))}},{key:"addNode",value:function(t,e,n,i){var o=i&&i.id||this.nodeId,s=i&&!(0,a.default)(i.nodeType)?i.nodeType:1,r=new y(o,t,s,e,n,i);r.setPlumb(this._jsPlumb),r.appendTo(this._container),this._nodes.push(r);var l=!1,u=!1,c="Bottom";switch(s){case 0:l=!0;break;case 2:u=!0,c="Top";break;default:l=!0,u=!0,c="TopBottom"}return r.addPort({isSource:l,isTarget:u,position:c,dragAllowedWhenFull:!0}),r}},{key:"removeNode",value:function(t){for(var e=this._nodes,n=0,i=e.length;n<i;n++){var o=e[n];if(o.getId()===t)return o.dispose(),e.splice(n,1),o}}},{key:"toJson",value:function(){var t=[];this._nodes.forEach(function(e){t.push(e.toPlainObj())});var e=this._jsPlumb.getConnections().map(function(t){return{connectionId:t.id,pageSourceId:t.sourceId,pageTargetId:t.targetId,anchors:t.endpoints.map(function(t){return t.anchor.type})}});return(0,s.default)({nodes:t,connections:e})}},{key:"fromJson",value:function(t){var e=this;if(!t||""===t)return void console.error("draw from json failed: empty json string");var n=null;try{n=JSON.parse(t)}catch(t){return void console.error("invalid json string",t)}this.clear();var i=n.nodes,o=n.connections;i&&i.forEach(function(t){var n=e.addNode(t.name,t.positionX,t.positionY,{class:t.className,removable:t.removable,id:t.nodeId,nodeType:t.nodeType,data:t});e._jsPlumb.repaint(n.getId())}),o&&o.forEach(function(t){e._jsPlumb.connect({source:t.pageSourceId,target:t.pageTargetId,anchors:t.anchors,deleteEndpointsOnDetach:!1})}),this._jsPlumb.repaintEverything()}},{key:"clear",value:function(){this._nodes&&this._nodes.forEach(function(t){t.dispose()}),this._nodes=[]}},{key:"dispose",value:function(){this.clear(),this._container.off("click"),this._container=null}}],[{key:"ready",value:function(t){m.jsPlumb.ready(t)}}]),t}();e.default=b},function(t,e,n){t.exports={default:n(47),__esModule:!0}},function(t,e,n){var i=n(1),o=i.JSON||(i.JSON={stringify:JSON.stringify});t.exports=function(t){return o.stringify.apply(o,arguments)}},function(t,e,n){t.exports={default:n(49),__esModule:!0}},function(t,e,n){n(50),t.exports=n(1).Number.isNaN},function(t,e,n){var i=n(3);i(i.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){t.exports=!n(8)&&!n(9)(function(){return 7!=Object.defineProperty(n(27)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(0);t.exports=function(t,e){if(!i(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!i(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!i(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports={default:n(54),__esModule:!0}},function(t,e,n){n(29),n(67),t.exports=n(69)},function(t,e,n){"use strict";var i=n(56),o=n(57),s=n(11),r=n(13);t.exports=n(30)(Array,"Array",function(t,e){this._t=r(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):"keys"==e?o(0,n):"values"==e?o(0,t[n]):o(0,[n,t[n]])},"values"),s.Arguments=s.Array,i("keys"),i("values"),i("entries")},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e){t.exports=!0},function(t,e,n){"use strict";var i=n(60),o=n(28),s=n(21),r={};n(5)(r,n(2)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(r,{next:o(1,n)}),s(t,e+" Iterator")}},function(t,e,n){var i=n(6),o=n(61),s=n(34),r=n(19)("IE_PROTO"),a=function(){},l=function(){var t,e=n(27)("iframe"),i=s.length;for(e.style.display="none",n(65).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("<script>document.F=Object<\/script>"),t.close(),l=t.F;i--;)delete l.prototype[s[i]];return l()};t.exports=Object.create||function(t,e){var n;return null!==t?(a.prototype=i(t),n=new a,a.prototype=null,n[r]=t):n=l(),void 0===e?n:o(n,e)}},function(t,e,n){var i=n(7),o=n(6),s=n(32);t.exports=n(8)?Object.defineProperties:function(t,e){o(t);for(var n,r=s(e),a=r.length,l=0;a>l;)i.f(t,n=r[l++],e[n]);return t}},function(t,e,n){var i=n(10),o=n(13),s=n(63)(!1),r=n(19)("IE_PROTO");t.exports=function(t,e){var n,a=o(t),l=0,u=[];for(n in a)n!=r&&i(a,n)&&u.push(n);for(;e.length>l;)i(a,n=e[l++])&&(~s(u,n)||u.push(n));return u}},function(t,e,n){var i=n(13),o=n(17),s=n(64);t.exports=function(t){return function(e,n,r){var a,l=i(e),u=o(l.length),c=s(r,u);if(t&&n!=n){for(;u>c;)if((a=l[c++])!=a)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}}},function(t,e,n){var i=n(18),o=Math.max,s=Math.min;t.exports=function(t,e){return t=i(t),t<0?o(t+e,0):s(t,e)}},function(t,e,n){var i=n(4).document;t.exports=i&&i.documentElement},function(t,e,n){var i=n(10),o=n(22),s=n(19)("IE_PROTO"),r=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),i(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?r:null}},function(t,e,n){"use strict";var i=n(68)(!0);n(30)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=i(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){var i=n(18),o=n(16);t.exports=function(t){return function(e,n){var s,r,a=String(o(e)),l=i(n),u=a.length;return l<0||l>=u?t?"":void 0:(s=a.charCodeAt(l),s<55296||s>56319||l+1===u||(r=a.charCodeAt(l+1))<56320||r>57343?t?a.charAt(l):s:t?a.slice(l,l+2):r-56320+(s-55296<<10)+65536)}}},function(t,e,n){var i=n(6),o=n(35);t.exports=n(1).getIterator=function(t){var e=o(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return i(e.call(t))}},function(t,e,n){var i=n(15),o=n(2)("toStringTag"),s="Arguments"==i(function(){return arguments}()),r=function(t,e){try{return t[e]}catch(t){}};t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=r(e=Object(t),o))?n:s?i(e):"Object"==(a=i(e))&&"function"==typeof e.callee?"Arguments":a}},function(t,e,n){t.exports={default:n(72),__esModule:!0}},function(t,e,n){n(73),t.exports=n(1).Object.assign},function(t,e,n){var i=n(3);i(i.S+i.F,"Object",{assign:n(36)})},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){t.exports={default:n(77),__esModule:!0}},function(t,e,n){n(78);var i=n(1).Object;t.exports=function(t,e,n){return i.defineProperty(t,e,n)}},function(t,e,n){var i=n(3);i(i.S+i.F*!n(8),"Object",{defineProperty:n(7).f})},function(t,e,n){t.exports={default:n(80),__esModule:!0}},function(t,e,n){n(81),n(29),n(82),n(90),n(92),t.exports=n(1).WeakMap},function(t,e){},function(t,e,n){"use strict";var i,o=n(23)(0),s=n(31),r=n(24),a=n(36),l=n(86),u=n(0),c=n(9),h=n(43),d=r.getWeak,p=Object.isExtensible,f=l.ufstore,g={},m=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},v={get:function(t){if(u(t)){var e=d(t);return!0===e?f(h(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return l.def(h(this,"WeakMap"),t,e)}},y=t.exports=n(89)("WeakMap",m,v,l,!0,!0);c(function(){return 7!=(new y).set((Object.freeze||Object)(g),7).get(g)})&&(i=l.getConstructor(m,"WeakMap"),a(i.prototype,v),r.NEED=!0,o(["delete","has","get","set"],function(t){var e=y.prototype,n=e[t];s(e,t,function(e,o){if(u(e)&&!p(e)){this._f||(this._f=new i);var s=this._f[t](e,o);return"set"==t?this:s}return n.call(this,e,o)})}))},function(t,e,n){var i=n(84);t.exports=function(t,e){return new(i(t))(e)}},function(t,e,n){var i=n(0),o=n(85),s=n(2)("species");t.exports=function(t){var e;return o(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!o(e.prototype)||(e=void 0),i(e)&&null===(e=e[s])&&(e=void 0)),void 0===e?Array:e}},function(t,e,n){var i=n(15);t.exports=Array.isArray||function(t){return"Array"==i(t)}},function(t,e,n){"use strict";var i=n(41),o=n(24).getWeak,s=n(6),r=n(0),a=n(42),l=n(25),u=n(23),c=n(10),h=n(43),d=u(5),p=u(6),f=0,g=function(t){return t._l||(t._l=new m)},m=function(){this.a=[]},v=function(t,e){return d(t.a,function(t){return t[0]===e})};m.prototype={get:function(t){var e=v(this,t);if(e)return e[1]},has:function(t){return!!v(this,t)},set:function(t,e){var n=v(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=p(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,s){var u=t(function(t,i){a(t,u,e,"_i"),t._t=e,t._i=f++,t._l=void 0,void 0!=i&&l(i,n,t[s],t)});return i(u.prototype,{delete:function(t){if(!r(t))return!1;var n=o(t);return!0===n?g(h(this,e)).delete(t):n&&c(n,this._i)&&delete n[this._i]},has:function(t){if(!r(t))return!1;var n=o(t);return!0===n?g(h(this,e)).has(t):n&&c(n,this._i)}}),u},def:function(t,e,n){var i=o(s(e),!0);return!0===i?g(t).set(e,n):i[t._i]=n,t},ufstore:g}},function(t,e,n){var i=n(6);t.exports=function(t,e,n,o){try{return o?e(i(n)[0],n[1]):e(n)}catch(e){var s=t.return;throw void 0!==s&&i(s.call(t)),e}}},function(t,e,n){var i=n(11),o=n(2)("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||s[o]===t)}},function(t,e,n){"use strict";var i=n(4),o=n(3),s=n(24),r=n(9),a=n(5),l=n(41),u=n(25),c=n(42),h=n(0),d=n(21),p=n(7).f,f=n(23)(0),g=n(8);t.exports=function(t,e,n,m,v,y){var b=i[t],P=b,_=v?"set":"add",x=P&&P.prototype,C={};return g&&"function"==typeof P&&(y||x.forEach&&!r(function(){(new P).entries().next()}))?(P=e(function(e,n){c(e,P,t,"_c"),e._c=new b,void 0!=n&&u(n,v,e[_],e)}),f("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(t){var e="add"==t||"set"==t;t in x&&(!y||"clear"!=t)&&a(P.prototype,t,function(n,i){if(c(this,P,t),!e&&y&&!h(n))return"get"==t&&void 0;var o=this._c[t](0===n?0:n,i);return e?this:o})}),y||p(P.prototype,"size",{get:function(){return this._c.size}})):(P=m.getConstructor(e,t,v,_),l(P.prototype,n),s.NEED=!0),d(P,t),C[t]=P,o(o.G+o.W+o.F,C),y||m.setStrong(P,t,v),P}},function(t,e,n){n(91)("WeakMap")},function(t,e,n){"use strict";var i=n(3);t.exports=function(t){i(i.S,t,{of:function(){for(var t=arguments.length,e=Array(t);t--;)e[t]=arguments[t];return new this(e)}})}},function(t,e,n){n(93)("WeakMap")},function(t,e,n){"use strict";var i=n(3),o=n(26),s=n(12),r=n(25);t.exports=function(t){i(i.S,t,{from:function(t){var e,n,i,a,l=arguments[1];return o(this),e=void 0!==l,e&&o(l),void 0==t?new this:(n=[],e?(i=0,a=s(l,arguments[2],2),r(t,!1,function(t){n.push(a(t,i++))})):r(t,!1,n.push,n),new this(n))}})}}]);
{'avg_line_length': 221191.0, 'max_line_length': 221191, 'alphanum_fraction': 0.7129901307015204, 'licenses': ['MIT'], 'repository_name': 'lonly197/flowchartjs', 'path': 'lib/js/flowchart.js', 'size': 221191, 'lang': 'JavaScript'}