/*! * DevExpress Diagram (dx-diagram.min) * Version: 0.1.49 * Build date: Mon Dec 09 2019 * * Copyright (c) 2012 - 2019 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExpress licensing here: https://www.devexpress.com/Support/EULAs */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.diagram=e():(t.DevExpress=t.DevExpress||{},t.DevExpress.diagram=e())}(window,function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=8)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){this.width=t,this.height=e}return t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.offset=function(e,n){return void 0===e&&(e=0),void 0===n&&(n=0),new t(Math.max(0,this.width+e),Math.max(0,this.height+n))},t.prototype.multiply=function(e,n){return void 0===e&&(e=1),void 0===n&&(n=e),new t(this.width*e,this.height*n)},t.prototype.equals=function(t){return t.width===this.width&&t.height===this.height},t.prototype.transform=function(e){return new t(e(this.width),e(this.height))},t}();e.Size=o;var i=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.offset=function(e,n){return void 0===e&&(e=0),void 0===n&&(n=0),new t(this.x+e,this.y+n)},t.prototype.multiply=function(e,n){return void 0===e&&(e=1),void 0===n&&(n=e),new t(this.x*e,this.y*n)},t.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},t.prototype.transform=function(e){return new t(e(this.x),e(this.y))},t.empty=function(){return new t(0,0)},t.plus=function(e,n){return new t(e.x+n.x,e.y+n.y)},t.minus=function(e,n){return new t(e.x-n.x,e.y-n.y)},t}();e.Point=i;var r=function(){function t(t,e,n,o){this.left=t,this.top=e,this.right=n,this.bottom=o}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.left+this.right},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.top+this.bottom},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this.left,this.top,this.right,this.bottom)},t.prototype.transform=function(e){return new t(e(this.left),e(this.top),e(this.right),e(this.bottom))},t.prototype.offset=function(t,e){var n=this.clone();return e?(n.left+=t.left,n.right+=t.right,n.top+=t.top,n.bottom+=t.bottom):(n.left-=t.left,n.right-=t.right,n.top-=t.top,n.bottom-=t.bottom),n},t.prototype.multiply=function(e,n){return void 0===e&&(e=1),void 0===n&&(n=e),new t(this.left*e,this.top*n,this.right*e,this.bottom*n)},t.prototype.isEmpty=function(){return 0===this.left&&0===this.right&&0===this.top&&0===this.bottom},t.prototype.equals=function(t){return this.left===t.left&&this.top===t.top&&this.right===t.right&&this.bottom===t.bottom},t.prototype.toString=function(){return"left: "+this.left+" top: "+this.top+" right: "+this.right+" bottom: "+this.bottom},t.empty=function(){return new t(0,0,0,0)},t.fromNumber=function(e){return new t(e,e,e,e)},t.fromSide=function(e,n){return new t(e,n,e,n)},t}();e.Offset=r;var s=function(){function t(t,e){this.position=t,this.size=e}return Object.defineProperty(t.prototype,"left",{get:function(){return this.position.x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.position.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.position.x+this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.position.y+this.size.height},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new i(this.position.x+this.size.width/2,this.position.y+this.size.height/2)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.size.width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.size.height},enumerable:!0,configurable:!0}),t.prototype.clone=function(){return new t(this.position.clone(),this.size.clone())},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.contains=function(t){return this.left<=t.x&&t.x<=this.right&&this.top<=t.y&&t.y<=this.bottom},t.prototype.intersectX=function(t){return!(this.left>t.right||t.left>this.right)},t.prototype.intersectY=function(t){return!(this.top>t.bottom||t.top>this.bottom)},t.prototype.intersect=function(t){return this.intersectX(t)&&this.intersectY(t)},t.prototype.inflate=function(e,n){return n=void 0===n?e:n,new t(this.position.offset(-e,-n),this.size.offset(2*e,2*n))},t.prototype.resize=function(e,n){return new t(this.position,this.size.offset(e,n))},t.prototype.offset=function(e,n){return new t(this.position.offset(e,n),this.size)},t.prototype.multiply=function(e){return new t(this.position.multiply(e),this.size.multiply(e))},t.prototype.equals=function(t){return this.left===t.left&&this.top===t.top&&this.width===t.width&&this.height===t.height},t.prototype.transform=function(e){return new t(this.position.transform(e),this.size.transform(e))},t.create=function(e,n,r,s){return new t(new i(e,n),new o(r,s))},t.createByPoints=function(e,n){return t.createByPositions(e.x,e.y,n.x,n.y)},t.createByPositions=function(e,n,o,i){var r=Math.min(e,o),s=Math.min(n,i),a=Math.abs(o-e),c=Math.abs(i-n);return t.create(r,s,a,c)},t}();e.Rectangle=s;var a=function(){function t(t,e){this.startPoint=t,this.endPoint=e}return Object.defineProperty(t.prototype,"distance",{get:function(){return p.getDistance(this.startPoint,this.endPoint)},enumerable:!0,configurable:!0}),t.prototype.intersect=function(t){return!!(this.startPoint.equals(t.startPoint)||this.endPoint.equals(t.startPoint)||this.startPoint.equals(t.endPoint)||this.endPoint.equals(t.endPoint))||this.intersectCore(t)&&t.intersectCore(this)},t.prototype.intersectRect=function(e){var n=e.position,o=new i(e.left,e.bottom),r=new i(e.right,e.top),s=new i(e.right,e.bottom);return e.contains(this.startPoint)||e.contains(this.endPoint)||this.intersect(new t(n,o))||this.intersect(new t(o,s))||this.intersect(new t(s,r))||this.intersect(new t(r,n))},t.prototype.intersectCore=function(t){if(this.startPoint.x===this.endPoint.x){if(this.startPoint.x-t.endPoint.x!=0)return(this.startPoint.x-t.startPoint.x)/(this.startPoint.x-t.endPoint.x)<=0;if(t.endPoint.y-this.endPoint.y!=0)return(t.endPoint.y-this.startPoint.y)/(t.endPoint.y-this.endPoint.y)<=0}if(this.startPoint.y===this.endPoint.y){if(this.startPoint.y-t.endPoint.y!=0)return(this.startPoint.y-t.startPoint.y)/(this.startPoint.y-t.endPoint.y)<=0;if(t.endPoint.x-this.endPoint.x!=0)return(t.endPoint.x-this.startPoint.x)/(t.endPoint.x-this.endPoint.x)<=0}var e=(this.endPoint.y-this.startPoint.y)/(this.endPoint.x-this.startPoint.x),n=this.startPoint.y+(t.startPoint.x-this.startPoint.x)*e,o=this.startPoint.y+(t.endPoint.x-this.startPoint.x)*e,i=t.startPoint.y-n,r=t.endPoint.y-o;return 0===i&&0===r?(this.startPoint.y-n)/(this.endPoint.y-n)<=0||(this.startPoint.y-o)/(this.endPoint.y-o)<=0:0===i||0===r||i/r<0},t.create=function(e,n,o,r){return new t(new i(e,n),new i(o,r))},t.createByPoints=function(e,n){return t.create(e.x,e.y,n.x,n.y)},t}();e.Segment=a;var c=function(){function t(){this.listeners=[]}return t.prototype.add=function(t){if(!t)throw new Error("Not Implemented");this.hasEventListener(t)||this.listeners.push(t)},t.prototype.remove=function(t){for(var e,n=0;e=this.listeners[n];n++)if(e===t){this.listeners.splice(n,1);break}},t.prototype.raise=function(t){for(var e=[],n=1;n>1),s=e(t[r]);if(s<0)n=r+1;else{if(!(s>0))return r;o=r-1}}return i?~n:-1},t.normedBinaryIndexOf=function(e,n,o,i){void 0===o&&(o=0),void 0===i&&(i=-2);var r=t.binaryIndexOf(e,n,o,i);return t.binaryIndexNormalizator(r)},t.binaryIndexNormalizator=function(t){return t<0?~t-1:t},t}();e.Utils=u;var p=function(){function t(){}return t.getCommonRectangle=function(t){if(!t.length)return s.create(0,0,0,0);var e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE;return t.forEach(function(t){e=Math.min(e,t.left),n=Math.max(n,t.right),o=Math.min(o,t.top),i=Math.max(i,t.bottom)}),s.create(e,o,n-e,i-o)},t.findFreeSpace=function(t,e,n,o){var r=[o?o.left:0],s=[o?o.top:0];t.forEach(function(t){r.push(t.left),r.push(t.right),s.push(t.top),s.push(t.bottom)}),r=r.sort(function(t,e){return t-e}).reduce(function(t,e,n){return r[n-1]!==e&&t.push(e)&&t||t},[]);for(var a=(s=s.sort(function(t,e){return t-e}).reduce(function(t,e,n){return s[n-1]!==e&&t.push(e)&&t||t},[])).map(function(t){return r.map(function(t,e){return r[e+1]-t})}),c=function(t,e){for(var n=u.binaryIndexOf(r,function(t){return t-e.left}),o=u.binaryIndexOf(r,function(t){return t-e.right}),i=u.binaryIndexOf(s,function(t){return t-e.top}),c=u.binaryIndexOf(s,function(t){return t-e.bottom}),p=i;p0)d=f;else if(0===f)return new i(r[d],s[l])}return null},t.checkRect=function(t,e,n,o,i,r,s){for(var a=0,c=0,u=n.length-2,p=o;ps.y&&o.y>r.y||o.ys.x&&o.x>r.x||o.xn||n>1)throw new Error("Invalid relative position");var o=this.getPathLength(e);if(e.length<=2&&0===o)return e[0];for(var r=o*n,s=0,a=1;a=r){var u=r-s,p=(e[a].x-e[a-1].x)/c,h=(e[a].y-e[a-1].y)/c;return new i(e[a-1].x+p*u,e[a-1].y+h*u)}s+=c}return e[e.length-1]},t.getLineAngle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},t.getTriangleBeginAngle=function(t,e,n){var o=this.getLineAngle(t,e),i=this.getLineAngle(t,n);return Math.abs(i-o)},t.getTriangleEndAngle=function(t,e,n){var o=this.getLineAngle(t,e),i=this.getLineAngle(n,e);return Math.abs(o-i)},t.getPathPointByPoint=function(e,n){if(!e.length)throw new Error("Invalid points");if(1===e.length)return e[0];for(var o,i=Number.MAX_VALUE,r=1;r=y&&y>=-Math.PI/2?(m*=v?1:-1,g*=v?1:-1):-Math.PI/2>=y&&y>=-Math.PI&&(m*=v?-1:1,g*=v?1:-1),o=n.offset(m,g)}}return o},t.getPathPositionByPoint=function(e,n,o){void 0===o&&(o=100),n=this.getPathPointByPoint(e,n);for(var i=this.getPathLength(e),r=0,s=1;se[n].y?r:t===o.West&&i.xe[n].x?r:n},0)},t.prototype.getConnectionPointSideByIndex=function(t,e){var n=this.getConnectionPoint(t,e);return this.getConnectionPointSide(n,e)},t.prototype.getConnectionPointIndexForSide=function(t){return t},Object.defineProperty(t.prototype,"enableText",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowEditText",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enableChildren",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLocked",{get:function(){return this.locked||this.containerLocked},enumerable:!0,configurable:!0}),t.prototype.intersectedByRect=function(t){return this.rectangle.intersect(t)},t}();e.DiagramItem=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r,s=n(4),a=n(0),c=n(13),u=n(80),p=n(142),h=n(143),l=n(24),d=n(149),f=n(64),y=n(10),m=n(15),g=n(33),v=n(63);!function(t){t[t.Begin=0]="Begin",t[t.End=1]="End"}(r=e.ConnectorPosition||(e.ConnectorPosition={})),e.CONNECTOR_DEFAULT_TEXT_POSITION=.5;var P=function(t){function n(e){var n=t.call(this)||this;if(n.beginConnectionPointIndex=-1,n.endConnectionPointIndex=-1,n.properties=new l.ConnectorProperties,n.points=e.map(function(t){return t.clone()}),e.length<2)throw Error("Points count should be greater than 1");return n.texts=new d.ConnectorTexts,n}return i(n,t),n.prototype.assign=function(e){t.prototype.assign.call(this,e),e.beginItem=this.beginItem,e.beginConnectionPointIndex=this.beginConnectionPointIndex,e.endItem=this.endItem,e.endConnectionPointIndex=this.endConnectionPointIndex,e.properties=this.properties.clone(),e.texts=this.texts.clone()},n.prototype.clone=function(){var t=new n(this.points);return this.assign(t),t},n.prototype.getRenderPoints=function(t){return void 0===t&&(t=!1),void 0===this.renderPoints&&(this.renderPoints=this.getCalculator().getPoints(),this.renderPointsWithoutSkipped=this.renderPoints.filter(function(t){return!t.skipped})),t?this.renderPoints:this.renderPointsWithoutSkipped},n.prototype.getText=function(t){void 0===t&&(t=e.CONNECTOR_DEFAULT_TEXT_POSITION);var n=this.texts.get(t);return n?n.value:""},n.prototype.setText=function(t,n){void 0===n&&(n=e.CONNECTOR_DEFAULT_TEXT_POSITION),t&&""!==t?this.texts.set(n,new d.ConnectorText(n,t)):this.texts.remove(n)},n.prototype.getTextPoint=function(t){var e=this.getRenderPoints();return a.GeometryUtils.getPathPointByPosition(e,t)},n.prototype.getTextPositionByPoint=function(t){var e=this.getRenderPoints(),n=a.GeometryUtils.getPathLength(e),o=a.GeometryUtils.getPathPositionByPoint(e,t),i=c.UnitConverter.pointsToTwips(parseInt(this.styleText["font-size"]));return i>o*n?i/n:i>n-o*n?(n-i)/n:o},n.prototype.getTextRectangle=function(t){return new a.Rectangle(this.getTextPoint(t),new a.Size(0,0))},n.prototype.getCalculator=function(){return this.properties.lineOption===l.ConnectorLineOption.Straight?new p.ConnectorPointsCalculator(this):new h.ConnectorPointsOrthogonalCalculator(this)},n.prototype.invalidateRenderPoints=function(){delete this.renderPoints,delete this.renderPointsWithoutSkipped,this.invalidatePrimitives()},n.prototype.createPrimitives=function(){var t=this,e=[],n=this.getRenderPoints();return n.forEach(function(o,i){i>0&&e.push(t.createSegmentPrimitive(n[i-1],o,t.style,null))}),n.length>1&&(this.properties.startLineEnding!==l.ConnectorLineEnding.None&&(e=e.concat(this.createLineEndingPrimitives(n[0],n[1]))),this.properties.endLineEnding!==l.ConnectorLineEnding.None&&(e=e.concat(this.createLineEndingPrimitives(n[n.length-1],n[n.length-2])))),e.concat(this.createTextPrimitives())},n.prototype.createSelectorPrimitives=function(){var t=this,e=[],n=this.getRenderPoints();return n.forEach(function(o,i){i>0&&e.push(t.createSegmentPrimitive(n[i-1],o,null,"selector"))}),e},n.prototype.createTextPrimitives=function(){var t=this;if(!this.enableText)return[];var e=[];return this.texts.forEach(function(n){var o=t.getText(n.position);if(o&&""!==o){var i=t.getTextPoint(n.position);e=e.concat([new f.TextPrimitive(i.x,i.y,o,void 0,t.styleText,!0,null,g.PAGE_BG_TEXTFLOOR_FILTER_ID,!1,function(e){m.RenderUtils.setElementEventData(e,y.MouseEventElementType.ConnectorText,t.key,n.position)})])}}),e},n.prototype.createSegmentPrimitive=function(t,e,n,o){return new u.LinePrimitive(t.x,t.y,e.x,e.y,n,o)},n.prototype.createLineEndingPrimitives=function(t,e){var o,i=n.arrowHeight;t.x===e.x&&((o=Math.abs(t.y-e.y))0&&e.push(a.Segment.createByPoints(t[o-1],n))}),e},n.prototype.intersectedByRect=function(t){var e=!1;return this.getSegments().forEach(function(n){n.intersectRect(t)&&(e=!0)}),e},n.prototype.toNative=function(){var t=new v.NativeConnector(this.key,this.dataKey);return t.fromKey=this.beginItem&&this.beginItem.dataKey,t.toKey=this.endItem&&this.endItem.dataKey,t.texts=this.texts.map(function(t){return t}).sort(function(t,e){return t.position-e.position}).map(function(t){return t.value}),t},n.arrowHeight=c.UnitConverter.pixelsToTwips(8),n.arrowWidth=c.UnitConverter.pixelsToTwips(2),n.minOffset=c.UnitConverter.pixelsToTwips(18),n.minTextHeight=c.UnitConverter.pixelsToTwips(12),n}(s.DiagramItem);e.Connector=P},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(130),i=n(37),r=n(50),s=n(150),a=n(151),c=n(19),u=n(5),p=n(0),h=n(152),l=n(153),d=n(90),f=n(91),y=n(154),m=n(44),g=n(11),v=n(24),P=n(13),C=n(51),S=n(52),_=n(53),w=n(17),b=n(191),x=n(192),I=n(102),O=n(46),E=n(36),M=n(54),T=n(55),A=n(104),D=n(193),L=n(194),z=n(31),N=function(){function t(){}return t.setShapePosition=function(t,e,n,i){n.position.equals(i)||t.addAndRedo(new o.MoveShapeHistoryItem(n.key,i))},t.setShapeSize=function(t,e,n,o,i){n.size.equals(i)&&n.position.equals(o)||t.addAndRedo(new l.ResizeShapeHistoryItem(n.key,o,i))},t.setConnectorPoint=function(t,e,n,o,i){n.points[o].equals(i)||t.addAndRedo(new r.MoveConnectorPointHistoryItem(n.key,o,i))},t.updateConnectorAttachedPoints=function(t,e,n){t.beginTransaction();var o=n.beginItem&&e.findItemCollapsedContainer(n.beginItem),i=o&&(!n.endItem||!e.isContainerItem(o,n.endItem)),r=n.endItem&&e.findItemCollapsedContainer(n.endItem),s=r&&(!n.beginItem||!e.isContainerItem(r,n.beginItem));i?this.updateConnectorBeginPoint(t,n,o,s&&r||n.endItem,function(t){return o.getConnectionPointIndexForItem(n.beginItem,t)}):this.updateConnectorBeginPoint(t,n,n.beginItem,s&&r||n.endItem),s?this.updateConnectorEndPoint(t,n,r,function(t){return r.getConnectionPointIndexForItem(n.beginItem,t)}):this.updateConnectorEndPoint(t,n,n.endItem),t.endTransaction()},t.updateConnectorBeginPoint=function(t,e,n,o,i){if(n){var s=void 0!==i?i(e.beginConnectionPointIndex):e.beginConnectionPointIndex,a=e.points[1];o&&2===e.points.length&&(a=-1!==e.endConnectionPointIndex?o.getConnectionPointPosition(e.endConnectionPointIndex,p.Point.empty()):o.rectangle.center);var c=n.getConnectionPointPosition(s,a);e.points[0].equals(c)||t.addAndRedo(new r.MoveConnectorPointHistoryItem(e.key,0,c))}},t.updateConnectorEndPoint=function(t,e,n,o){if(n){var i=void 0!==o?o(e.endConnectionPointIndex):e.endConnectionPointIndex,s=n.getConnectionPointPosition(i,e.points[e.points.length-2]);e.points[e.points.length-1].equals(s)||t.addAndRedo(new r.MoveConnectorPointHistoryItem(e.key,e.points.length-1,s))}},t.updateContainerConnectorsAttachedPoints=function(t,e,n,o){var i=this;void 0===o&&(o=n),t.beginTransaction(),e.getChildren(o).forEach(function(r){r instanceof g.Shape&&(r.attachedConnectors.forEach(function(r){var s=r.beginItem&&e.isContainerItem(o,r.beginItem),a=r.endItem&&e.isContainerItem(o,r.endItem);if(s&&!a){var c=e.findItemTopCollapsedContainer(r.beginItem),u=r.endItem&&e.findItemTopCollapsedContainer(r.endItem);c?i.updateConnectorBeginPoint(t,r,c,u||r.endItem,function(t){return n.getConnectionPointIndexForItem(r.beginItem,t)}):i.updateConnectorBeginPoint(t,r,r.beginItem,u||r.endItem)}a&&!s&&((c=e.findItemTopCollapsedContainer(r.endItem))?i.updateConnectorEndPoint(t,r,c,function(t){return n.getConnectionPointIndexForItem(r.endItem,t)}):i.updateConnectorEndPoint(t,r,r.endItem))}),i.updateContainerConnectorsAttachedPoints(t,e,n,r))}),t.endTransaction()},t.getConnectorsWithoutBeginItemInfo=function(t){return t.findConnectorsWithoutBeginItem().map(function(t){return{connector:t,point:t.points[0].clone()}})},t.getConnectorsWithoutEndItemInfo=function(t){return t.findConnectorsWithoutEndItem().map(function(t){return{connector:t,point:t.points[t.points.length-1].clone()}})},t.updateShapeAttachedConnectors=function(e,n,o){o.attachedConnectors.forEach(function(o){t.removeConnectorIntermediatePoints(e,o),t.updateConnectorAttachedPoints(e,n,o)})},t.updateMovingShapeConnections=function(t,e,n,o,s,a){var c=this;s(),n.forEach(function(n){var o=c.getMovingShapeConnectionPointIndex(e,n.point);e.rectangle.contains(n.point)||o>-1?(a(e,o),o!==n.connector.beginConnectionPointIndex&&n.connector.beginItem&&t.addAndRedo(new d.DeleteConnectionHistoryItem(n.connector,u.ConnectorPosition.Begin)),t.addAndRedo(new i.AddConnectionHistoryItem(n.connector,e,o,u.ConnectorPosition.Begin))):n.connector.beginItem&&(t.addAndRedo(new d.DeleteConnectionHistoryItem(n.connector,u.ConnectorPosition.Begin)),t.addAndRedo(new r.MoveConnectorPointHistoryItem(n.connector.key,0,n.point)))}),o.forEach(function(n){var o=c.getMovingShapeConnectionPointIndex(e,n.point);e.rectangle.contains(n.point)||o>-1?(a(e,o),o!==n.connector.endConnectionPointIndex&&n.connector.endItem&&t.addAndRedo(new d.DeleteConnectionHistoryItem(n.connector,u.ConnectorPosition.End)),t.addAndRedo(new i.AddConnectionHistoryItem(n.connector,e,o,u.ConnectorPosition.End))):n.connector.endItem&&(t.addAndRedo(new d.DeleteConnectionHistoryItem(n.connector,u.ConnectorPosition.End)),t.addAndRedo(new r.MoveConnectorPointHistoryItem(n.connector.key,n.connector.points.length-1,n.point)))})},t.getMovingShapeConnectionPointIndex=function(t,e){var n=this,o=-1;return t.getConnectionPoints().forEach(function(t,i){p.GeometryUtils.getDistance(e,t)2;)t.addAndRedo(new h.DeleteConnectorPointHistoryItem(e.key,1));t.endTransaction()}},t.isShapeIntersectConnectorPointsLine=function(t,e){if(!t)return!1;for(var n,o=u.Connector.minOffset-P.UnitConverter.pixelsToTwips(1),i=t.rectangle.inflate(o,o),r=1;r0;){var n=e.attachedConnectors[0];t.addAndRedo(new d.DeleteConnectionHistoryItem(n,n.beginItem===e?u.ConnectorPosition.Begin:u.ConnectorPosition.End))}t.addAndRedo(new f.DeleteShapeHistoryItem(e.key))},t.deleteConnector=function(t,e){e.beginItem&&t.addAndRedo(new d.DeleteConnectionHistoryItem(e,u.ConnectorPosition.Begin)),e.endItem&&t.addAndRedo(new d.DeleteConnectionHistoryItem(e,u.ConnectorPosition.End)),t.addAndRedo(new y.DeleteConnectorHistoryItem(e.key))},t.deleteAllItems=function(t,e,n){this.deleteItems(t,e,n,e.items.slice(),!0)},t.deleteSelection=function(t,e,n){this.deleteItems(t,e,n,n.getSelectedItems())},t.changeChildrenContainerLocked=function(t,e,n,o){var i=this;n instanceof g.Shape&&e.getChildren(n).forEach(function(n){t.addAndRedo(new D.ChangeContainerLockedHistoryItem(n,o)),i.changeChildrenContainerLocked(t,e,n,o)})},t.changeSelectionLocked=function(t,e,n,o){var i=this;t.beginTransaction(),n.getSelectedItems(!0).forEach(function(n){t.addAndRedo(new A.ChangeLockedHistoryItem(n,o)),i.changeChildrenContainerLocked(t,e,n,o)}),t.addAndRedo(new m.SetSelectionHistoryItem(n,n.getKeys())),t.endTransaction()},t.copyStylesToItem=function(t,e,n,o){var i=e.findItem(o);n.styleText.forEach(function(e){n.styleText[e]!==i.styleText[e]&&t.addAndRedo(new E.ChangeStyleTextHistoryItem(o,e,n.styleText[e]))}),n.style.forEach(function(e){n.style[e]!==i.style[e]&&t.addAndRedo(new O.ChangeStyleHistoryItem(o,e,n.style[e]))})},t.cloneShapeToOffset=function(t,e,n,o,i){t.beginTransaction();var r=n.position.offset(o,i),s=new C.AddShapeHistoryItem(n.description.key,r,n.text);t.addAndRedo(s);var a=s.shapeKey;return t.addAndRedo(new l.ResizeShapeHistoryItem(a,r,n.size.clone())),t.addAndRedo(new I.ChangeShapeParametersHistoryItem(a,n.parameters.clone())),this.copyStylesToItem(t,e,n,a),t.endTransaction(),a},t.cloneConnectorToOffset=function(t,e,n,o,r,s,a){t.beginTransaction();var c=n.points.map(function(t){return t.offset(s,a)}),p=new S.AddConnectorHistoryItem(c);t.addAndRedo(p);var h=p.connectorKey,l=e.findConnector(h);if(n.properties.forEach(function(e){n.properties[e]!==l.properties[e]&&t.addAndRedo(new T.ChangeConnectorPropertyHistoryItem(h,e,n.properties[e]))}),o){var d=e.findShape(o);t.addAndRedo(new i.AddConnectionHistoryItem(l,d,n.beginConnectionPointIndex,u.ConnectorPosition.Begin))}if(r){var f=e.findShape(r);t.addAndRedo(new i.AddConnectionHistoryItem(l,f,n.endConnectionPointIndex,u.ConnectorPosition.End))}return n.texts.clone().forEach(function(e){t.addAndRedo(new M.ChangeConnectorTextHistoryItem(l,e.position,e.value))}),this.copyStylesToItem(t,e,n,h),t.endTransaction(),h},t.cloneSelectionToOffset=function(e,n,o,i,r){var s=this;e.beginTransaction();var a={},c=[];o.getSelectedShapes().forEach(function(t){var o=s.cloneShapeToOffset(e,n,t,i,r);a[t.key]=o,c.push(o)}),o.getSelectedConnectors().forEach(function(t){var o=t.beginItem?a[t.beginItem.key]:null,u=t.endItem?a[t.endItem.key]:null,p=s.cloneConnectorToOffset(e,n,t,o,u,i,r);c.push(p)}),e.addAndRedo(new m.SetSelectionHistoryItem(o,c)),t.tryUpdateModelSize(e,n),e.endTransaction()},t.findContainerByEventKey=function(t,e,n){var o=t.findContainer(n);if(o)return o;var i=t.findShape(n);return i&&i.container&&!e.hasKey(i.key)?i.container:void 0},t.canInsertToContainer=function(t,e,n){return e!==n&&!(e instanceof g.Shape&&t.findChild(e,n.key))},t.canInsertSelectionToContainer=function(t,e,n){var o=!0;return e.getSelectedItems().forEach(function(e){e!==n?e instanceof g.Shape&&t.findChild(e,n.key)&&(o=!1):o=!1}),o},t.insertToContainer=function(t,e,n,o){if(!o.enableChildren)throw Error("Inpossible to add children to non-container shape.");if(this.canInsertToContainer(e,n,o)){var i=n.container;i!==o&&(t.beginTransaction(),i&&t.addAndRedo(new x.RemoveFromContainerHistoryItem(n)),t.addAndRedo(new b.InsertToContainerHistoryItem(n,o)),this.updateAttachedConnectorsContainer(t,e,n),t.endTransaction())}},t.removeFromContainer=function(t,e,n){n.container&&(t.beginTransaction(),t.addAndRedo(new x.RemoveFromContainerHistoryItem(n)),this.updateAttachedConnectorsContainer(t,e,n),t.endTransaction())},t.insertSelectionToContainer=function(t,e,n,o){var i=this;t.beginTransaction();var r=n.getSelectedItems();r.filter(function(t){return!t.container||-1===r.indexOf(t.container)}).forEach(function(n){i.insertToContainer(t,e,n,o)}),t.endTransaction()},t.removeSelectionFromContainer=function(t,e,n){var o=this;t.beginTransaction(),n.getSelectedItems().forEach(function(i){i.container&&!n.hasKey(i.container.key)&&(t.addAndRedo(new x.RemoveFromContainerHistoryItem(i)),o.updateAttachedConnectorsContainer(t,e,i))}),t.endTransaction()},t.getConnectorContainer=function(t){if(t.beginItem&&t.endItem&&t.beginItem.container===t.endItem.container)return t.beginItem.container},t.updateAttachedConnectorsContainer=function(t,e,n){var o=this;t.beginTransaction(),n.attachedConnectors.forEach(function(n){o.updateConnectorContainer(t,e,n)}),t.endTransaction()},t.updateConnectorContainer=function(t,e,n){var o=this.getConnectorContainer(n);o?t.addAndRedo(new b.InsertToContainerHistoryItem(n,o)):n.container&&t.addAndRedo(new x.RemoveFromContainerHistoryItem(n))},t.applyLayout=function(t,e,n,o,i,r,s,a,c){t.beginTransaction();var u=this.getOccupiedRectangles(r,n);i=this.offsetLayoutToFreeSpace(i,n&&n.clientRectangle,u,s.columnSpacing),a&&this.adjustLayoutToSnapGrid(e,i,c),n&&this.resizeContainerOnLayout(t,e,i,n,s.columnSpacing),this.applyLayoutToNodes(t,e,i,o.edges.map(function(t){return e.findConnector(t.key)})),this.applyLayoutToConnectors(t,e,i,o.edges.map(function(t){return e.findConnector(t.key)})),t.endTransaction()},t.getNonGraphItems=function(t,e,n,o,i){return(e?t.getChildren(e):t.items.filter(function(t){return!t.container})).filter(function(t){return t instanceof u.Connector?!(t.beginItem&&n[t.beginItem.key]||t.endItem&&n[t.endItem.key]||-1!==i.indexOf(t)):t instanceof g.Shape?!n[t.key]&&-1===o.indexOf(t):void 0})},t.getOccupiedRectangles=function(t,e){var n=t.map(function(t){return t.rectangle});if(e&&n.length){var o=e.clientRectangle;n.push(p.Rectangle.create(o.right,o.top,1,1)),n.push(p.Rectangle.create(o.right,o.bottom,1,1))}return n},t.offsetLayoutToFreeSpace=function(t,e,n,o){var i=t.getRectangle(!0),r=p.GeometryUtils.findFreeSpace(n,i.size.offset(o,o),!1,e);if(r){var s=r.x+o,a=r.y+o;return t.offsetNodes(s,a)}var c=n&&n.length?n.reduce(function(t,e){return e.right>t?e.right:t},0):e?e.left:0,u=e?e.top:Math.max(0,i.top);return t.offsetNodes(c+o,u+o)},t.resizeContainerOnLayout=function(e,n,o,i,r){var s=o.getRectangle(!0),a=i.rectangle.width;i.rectangle.right2;)t.addAndRedo(new h.DeleteConnectorPointHistoryItem(o.key,1))})},t.adjustLayoutToSnapGrid=function(t,e,n){var o=this;e.nodeKeys.forEach(function(i){e.nodeToLayout[i].position.x=o.getSnappedPos(t,n,e.nodeToLayout[i].position.x,!0),e.nodeToLayout[i].position.y=o.getSnappedPos(t,n,e.nodeToLayout[i].position.y,!1)})},t.getGraphInfoByItems=function(t,e,n){var o={};[].concat(e).concat(n).forEach(function(t){var e=t.container&&t.container.key;o[e]||(o[e]=[]),o[e].push(t)});var i=[];for(var r in o)if(o.hasOwnProperty(r)){var s=r&&t.findContainer(r);if(!s||s.expanded){var a=s&&s.key,c=this.getGraphByItems(t,o[r],a);c.nodes.length>1&&i.push(new L.GraphInfo(s,c))}}return i},t.getGraphByItems=function(t,e,n){var o=this,i=new _.Graph([],[]),r={};return e.forEach(function(t){o.extendByConnectedComponents(t,i,n,r)}),i.nodes=i.nodes.sort(function(e,n){return t.getItemIndex(t.findShape(e))-t.getItemIndex(t.findShape(n))}),i},t.extendByConnectedComponents=function(t,e,n,o){var i=this;!t||t.locked||o[t.key]||(o[t.key]=!0,t instanceof u.Connector&&(t.container&&t.container.key)===n&&t.beginItem&&!t.beginItem.locked&&t.endItem&&!t.endItem.locked&&t.beginItem!==t.endItem?(e.addEdge(new z.Edge(t.key,t.beginItem&&t.beginItem.key,t.endItem&&t.endItem.key)),this.extendByConnectedComponents(t.beginItem,e,n,o),this.extendByConnectedComponents(t.endItem,e,n,o)):t instanceof g.Shape&&(t.container&&t.container.key)===n&&(e.addNode(t),t.attachedConnectors.forEach(function(t){return i.extendByConnectedComponents(t,e,n,o)})))},t.getlUnitValue=function(t,e){switch(t){case c.DiagramUnit.Cm:return P.UnitConverter.twipsToCentimeters(e);case c.DiagramUnit.In:return P.UnitConverter.twipsToInches(e);case c.DiagramUnit.Px:return P.UnitConverter.twipsToPixels(e)}},t.getUnitText=function(t,e,n,o,i){void 0===i&&(i=2);var r=e[t]?" "+e[t]:"",s=this.getlUnitValue(t,o);switch(t){case c.DiagramUnit.Cm:case c.DiagramUnit.In:return n(+s.toFixed(i))+r;case c.DiagramUnit.Px:return n(+s.toFixed(0))+r}},t.getTwipsValue=function(t,e){switch(t){case c.DiagramUnit.Cm:return P.UnitConverter.centimetersToTwips(e);case c.DiagramUnit.In:return P.UnitConverter.inchesToTwips(e);case c.DiagramUnit.Px:return P.UnitConverter.pixelsToTwips(e)}},t.getNextItemKey=function(t,e,n){if(!t.length&&void 0===n)return"0";for(var o=t.length-1;o>=0&&null==(n=n||t[o]);o--);for(var i=this.generateNextItemKey(n||"0");!e(i);)i=this.generateNextItemKey(i);return i},t.generateNextItemKey=function(t){for(var e=t.length-1;e>=0;e--){if(!this.isDigit(t[e])){e===t.length-1&&(t+="0");break}var n=t.charCodeAt(e),o=String.fromCharCode(n+1);if(o>"9"&&(o="0",0!==e&&this.isDigit(t[e-1])||(o="1"+o)),t=t.substr(0,e)+o+t.substr(e+1),"0"!==o&&"10"!==o)break;"10"===o&&e--}return t},t.isDigit=function(t){return"0"<=t&&t<="9"},t.getGuidItemKey=function(){return w.CreateGuid()},t.connectionPointActionSize=P.UnitConverter.pixelsToTwips(8),t}();e.ModelUtils=N},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(196),s=n(197),a=n(6),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getState=function(){return new s.SimpleCommandState(this.isEnabled(),this.getValue(),this.getDefaultValue(),this.getItems(),this.isVisible())},e.prototype.isVisible=function(){return!0},e.prototype.isEnabled=function(){return!this.control.settings.readOnly||this.isEnabledInReadOnlyMode()},e.prototype.isEnabledInReadOnlyMode=function(){return!1},e.prototype.getValue=function(){},e.prototype.getDefaultValue=function(){},e.prototype.getItems=function(){},e.prototype.getModelUnit=function(t){return a.ModelUtils.getlUnitValue(this.control.model.units,t)},e.prototype.getModelUnitText=function(t){return a.ModelUtils.getUnitText(this.control.model.units,this.control.settings.unitItems,this.control.settings.formatUnit,t)},e.prototype.getModelUnitTwipsValue=function(t){return a.ModelUtils.getTwipsValue(this.control.model.units,t)},e.prototype.getViewUnit=function(t){return a.ModelUtils.getlUnitValue(this.control.settings.viewUnits,t)},e.prototype.getViewUnitText=function(t){return a.ModelUtils.getUnitText(this.control.settings.viewUnits,this.control.settings.unitItems,this.control.settings.formatUnit,t)},e.prototype.getViewUnitTwipsValue=function(t){return a.ModelUtils.getTwipsValue(this.control.settings.viewUnits,t)},e}(r.CommandBase);e.SimpleCommandBase=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(48);e.DiagramCommand=o.DiagramCommand;var i=n(262);e.DiagramControl=i.DiagramControl;var r=n(0);e.EventDispatcher=r.EventDispatcher;var s=n(1);e.ShapeTypes=s.ShapeTypes,e.ShapeCategories=s.ShapeCategories,e.ShapeType=s.ShapeType;var a=n(13);e.UnitConverter=a.UnitConverter;var c=n(23);e.Browser=c.Browser;var u=n(35);e.AutoZoomMode=u.AutoZoomMode;var p=n(114);e.DataLayoutType=p.DataLayoutType;var h=n(22);e.DataLayoutOrientation=h.DataLayoutOrientation,n(306);var l=n(19);e.DiagramUnit=l.DiagramUnit,e.PageOrientation=l.PageOrientation;var d=n(24);e.ConnectorLineEnding=d.ConnectorLineEnding,e.ConnectorLineOption=d.ConnectorLineOption;var f=n(38);e.ColorHelper=f.ColorHelper;var y=n(63);e.NativeShape=y.NativeShape,e.NativeConnector=y.NativeConnector},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(64),r=n(41),s=n(20),a=n(4),c=n(13),u=n(15),p=n(34);e.ShapeDefaultDimension=1440,e.ShapeDefaultSize=new o.Size(e.ShapeDefaultDimension,e.ShapeDefaultDimension);var h=function(){function t(t,n,o,i){void 0===o&&(o=e.ShapeDefaultSize.clone()),this.title=t,this.defaultText=n,this.defaultSize=o,this.defaultImageUrl=i,this.connectionPoints=this.createConnectionPoints(),this.connectionPointsWhileSelected=this.createConnectionPointsForSelection()}return Object.defineProperty(t.prototype,"enableText",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowEditText",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enableImage",{get:function(){return!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"allowEditImage",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enableChildren",{get:function(){return!1},enumerable:!0,configurable:!0}),t.prototype.getConnectionPoints=function(){return this.connectionPoints},t.prototype.createConnectionPoints=function(){return[new p.ConnectionPoint(.5,0,a.ConnectionPointSide.North),new p.ConnectionPoint(1,.5,a.ConnectionPointSide.East),new p.ConnectionPoint(.5,1,a.ConnectionPointSide.South),new p.ConnectionPoint(0,.5,a.ConnectionPointSide.West)]},t.prototype.getConnectionPointsForSelection=function(){return this.connectionPointsWhileSelected},t.prototype.createConnectionPointsForSelection=function(){return[new p.ConnectionPoint(.5,0,a.ConnectionPointSide.North),new p.ConnectionPoint(1,.5,a.ConnectionPointSide.East),new p.ConnectionPoint(.5,1,a.ConnectionPointSide.South),new p.ConnectionPoint(0,.5,a.ConnectionPointSide.West)]},t.prototype.processConnectionPoint=function(t,e){},t.prototype.getConnectionPointIndexForItem=function(t,e){return e},t.prototype.getConnectionPointIndexForSide=function(t){return t},t.prototype.createParameters=function(t){},t.prototype.normalizeParameters=function(t,e){},t.prototype.modifyParameters=function(t,e,n,o){throw Error("Not implemented")},t.prototype.changeParameterValue=function(t,e,n){var o=t.get(e);o.value=n(o)},t.prototype.getParameterPoints=function(t){return[]},t.prototype.getExpandedSize=function(t,e){return t},t.prototype.getCollapsedSize=function(t){return t},t.prototype.getToolboxHeightToWidthRatio=function(t,e){return e/t},t.prototype.allowResizeHorizontally=function(t){return!0},t.prototype.allowResizeVertically=function(t){return!0},t.prototype.createPrimitives=function(t,e){var n=[];return n=n.concat(this.createShapePrimitives(t,e)),this.enableImage&&(n=n.concat(this.createImagePrimitives(t,e))),this.enableText&&(n=n.concat(this.createTextPrimitives(t,e))),n},t.prototype.createImagePrimitives=function(t,e){return[]},t.prototype.createTextPrimitives=function(t,e){if(void 0===t.text||""===t.text)return[];var n=this.getTextRectangle(t.rectangle,t.parameters),o=!e&&u.RenderUtils.generateSvgElementId("clipText"),a=this.getTextPosition(n,t.styleText["text-anchor"]);return[new i.TextPrimitive(a.x,a.y,t.text,n.width,t.styleText,!1,o,void 0,this.getTextRotated()),new r.ClipPathPrimitive(o,[new s.RectanglePrimitive(n.left,n.top,n.width,n.height)])]},t.prototype.getTextRotated=function(){return!1},t.prototype.getTextRectangle=function(t,e){return t},t.prototype.getClientRectangle=function(t){return t},t.prototype.getTextEditRectangle=function(t,e){return this.getTextRectangle(t,e)},t.prototype.createSelectorPrimitives=function(t){return[new s.RectanglePrimitive(t.position.x,t.position.y,t.size.width,t.size.height,null,"selector")]},t.prototype.getTextPosition=function(e,n){var i=new o.Point(e.left,e.top+e.height/2);return n&&"middle"!==n?"end"===n?i.x=e.left+e.width-t.textSpacing:"start"===n&&(i.x=e.left+t.textSpacing):i.x=e.left+e.width/2,i},t.textSpacing=c.UnitConverter.pixelsToTwips(2),t}();e.ShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(16);!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Middle=4]="Middle"}(e.MouseButton||(e.MouseButton={})),function(t){t[t.Background=0]="Background",t[t.Document=1]="Document",t[t.Undefined=2]="Undefined",t[t.Connector=3]="Connector",t[t.ConnectorPoint=4]="ConnectorPoint",t[t.ConnectorSide=5]="ConnectorSide",t[t.ConnectorOrthogonalSide=6]="ConnectorOrthogonalSide",t[t.ConnectorText=7]="ConnectorText",t[t.Shape=8]="Shape",t[t.ShapeResizeBox=9]="ShapeResizeBox",t[t.ShapeParameterBox=10]="ShapeParameterBox",t[t.SelectionRect=11]="SelectionRect",t[t.ShapeConnectionPoint=12]="ShapeConnectionPoint",t[t.ShapeExpandButton=13]="ShapeExpandButton"}(e.MouseEventElementType||(e.MouseEventElementType={}));var s=function(){return function(t,e,n){this.type=t,this.key=e,this.value=n}}();e.MouseEventSource=s,function(t){t[t.Undefined=0]="Undefined",t[t.ResizeBox_NW=1]="ResizeBox_NW",t[t.ResizeBox_NE=2]="ResizeBox_NE",t[t.ResizeBox_SE=3]="ResizeBox_SE",t[t.ResizeBox_SW=4]="ResizeBox_SW",t[t.ResizeBox_N=5]="ResizeBox_N",t[t.ResizeBox_E=6]="ResizeBox_E",t[t.ResizeBox_S=7]="ResizeBox_S",t[t.ResizeBox_W=8]="ResizeBox_W"}(e.ResizeEventSource||(e.ResizeEventSource={}));var a=function(){return function(t){this.modifiers=t}}();e.DiagramEvent=a;var c=function(t){function e(e){var n=t.call(this,r.ModifierKey.None)||this;return n.inputText=e,n}return i(e,t),e}(a);e.DiagramFocusEvent=c;var u=function(){return function(t,e){this.offsetPoint=t,this.modelPoint=e}}();e.DiagramMouseEventTouch=u;var p=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.offsetPoint=n,r.modelPoint=o,r.source=i,r}return i(e,t),e}(a);e.DiagramMouseEventBase=p;var h=function(t){function e(e,n,o,i,r,s){void 0===s&&(s=[]);var a=t.call(this,e,o,i,r)||this;return a.button=n,a.touches=s,a.scrollX=0,a.scrollY=0,a}return i(e,t),e}(p);e.DiagramMouseEvent=h;var l=function(t){function e(e,n,o,i,r,s){var a=t.call(this,e,i,r,s)||this;return a.deltaX=n,a.deltaY=o,a}return i(e,t),e}(p);e.DiagramWheelEvent=l;var d=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.eventPoint=n,i.modelPoint=o,i}return i(e,t),e}(a);e.DiagramContextMenuEvent=d;var f=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.keyCode=n,i.inputText=o,i}return i(e,t),e.prototype.getShortcutCode=function(){return this.modifiers|this.keyCode},e}(a);e.DiagramKeyboardEvent=f;var y=function(t){function e(e){var n=t.call(this,r.ModifierKey.None)||this;return n.clipboardData=e,n}return i(e,t),e}(a);e.DiagramClipboardEvent=y},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(29),a=n(13),c=n(4),u=n(34),p=n(40),h=n(63),l=function(t){function e(e,n){var o=t.call(this)||this;if(o.description=e,o.childKeys=[],o.expanded=!0,o.expandedSize=void 0,!e)throw Error("Shape type is incorrect");return o.position=n.clone(),o.size=e.defaultSize.clone(),o.text=e.defaultText,o.image=new p.ImageInfo(e.defaultImageUrl),o.parameters=new s.ShapeParameters,e.createParameters(o.parameters),o}return i(e,t),e.prototype.assign=function(e){t.prototype.assign.call(this,e),e.size=this.size.clone(),e.text=this.text,e.image=this.image.clone(),e.parameters=this.parameters.clone(),e.childKeys=this.childKeys.slice(),e.expanded=this.expanded,this.expandedSize&&(e.expandedSize=this.expandedSize.clone())},e.prototype.clone=function(){var t=new e(this.description,this.position.clone());return this.assign(t),t},Object.defineProperty(e.prototype,"enableText",{get:function(){return this.description.enableText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEditText",{get:function(){return this.description.allowEditText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableChildren",{get:function(){return this.description.enableChildren},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enableImage",{get:function(){return this.description.enableImage},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowEditImage",{get:function(){return this.description.allowEditImage},enumerable:!0,configurable:!0}),e.prototype.createPrimitives=function(){return this.description.createPrimitives(this)},e.prototype.createSelectorPrimitives=function(){return this.description.createSelectorPrimitives(this)},e.prototype.normalizeX=function(t){return Math.max(this.position.x,Math.min(t,this.position.x+this.size.width))},e.prototype.normalizeY=function(t){return Math.max(this.position.y,Math.min(t,this.position.y+this.size.height))},e.prototype.getConnectionPoints=function(){var t=this;return this.description.getConnectionPoints().map(function(e){var n=new u.ConnectionPoint(t.position.x+e.x*t.size.width,t.position.y+e.y*t.size.height,e.side);return t.description.processConnectionPoint(t,n),n})},e.prototype.getConnectionPointsForSelection=function(){var t=this;return this.description.getConnectionPointsForSelection().map(function(e){return new u.ConnectionPoint(t.position.x+e.x*t.size.width,t.position.y+e.y*t.size.height,e.side)})},e.prototype.getConnectionPointSide=function(t,e){return t.side!==c.ConnectionPointSide.Undefined?t.side:this.getConnectionPointSideByGeometry(t)},e.prototype.getConnectionPointForSelectionSide=function(t){return t.side!==c.ConnectionPointSide.Undefined?t.side:this.getConnectionPointSideByGeometry(t)},e.prototype.getConnectionPointSideByGeometry=function(t){var e=t.offset(-this.position.x,-this.position.y).multiply(1/this.size.width,1/this.size.height);return e.x>=e.y&&(e.x>0||e.y>0)?e.x<.5||1-e.x>=e.y?c.ConnectionPointSide.North:c.ConnectionPointSide.East:e.x>.5||1-e.x<=e.y?c.ConnectionPointSide.South:c.ConnectionPointSide.West},e.prototype.getConnectionPointIndexForItem=function(t,e){return this.description.getConnectionPointIndexForItem(t,e)},e.prototype.getConnectionPointIndexForSide=function(t){return this.description.getConnectionPointIndexForSide(t)},e.prototype.toggleExpandedSize=function(){this.expanded?(this.size=this.getExpandedSize(),this.expandedSize=void 0):(this.expandedSize=this.size.clone(),this.size=this.getCollapsedSize())},e.prototype.getExpandedSize=function(){return this.description.getExpandedSize(this.size,this.expandedSize)},e.prototype.getCollapsedSize=function(){return this.description.getCollapsedSize(this.size)},e.prototype.getToolboxHeightToWidthRatio=function(){return this.description.getToolboxHeightToWidthRatio(this.size.width,this.size.height)},Object.defineProperty(e.prototype,"allowResizeHorizontally",{get:function(){return this.description.allowResizeHorizontally(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowResizeVertically",{get:function(){return this.description.allowResizeVertically(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rectangle",{get:function(){return new r.Rectangle(this.position,this.size)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clientRectangle",{get:function(){return this.description.getClientRectangle(this.rectangle)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textRectangle",{get:function(){return this.description.getTextRectangle(this.rectangle,this.parameters)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textEditRectangle",{get:function(){return this.description.getTextEditRectangle(this.rectangle,this.parameters)},enumerable:!0,configurable:!0}),e.prototype.toNative=function(){var t=new h.NativeShape(this.key,this.dataKey);return t.type=this.description.key,t.text=this.text,t},e.lineWidth=a.UnitConverter.pixelsToTwips(2),e}(c.DiagramItem);e.Shape=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(10),i=n(39),r=n(0),s=n(17),a=n(16),c=n(23),u=n(15),p=n(62),h=n(82),l=n(134),d=n(35),f=n(135),y=n(136),m=n(138),g=n(87),v=n(141);e.svgNS="http://www.w3.org/2000/svg";e.LONG_TOUCH_TIMEOUT=500,e.DBL_CLICK_TIMEOUT=500;var P=function(){function t(e,n,o){this.moveLocked=!1,this.normalizationRequired=!1,this.lastClickElement=void 0,this.longTouchTimer=void 0,this.dblTouchTimer=void 0;var i=t.createMainElement(e),r=t.createSvgElement(i);this.scroll=o.scrollView||new l.NativeScrollView(i),this.scroll.onScroll.add(this),this.autoScroll=new v.AutoScrollController(this.scroll,i),this.view=new m.CanvasViewManager(this.scroll,r,o.modelSize,o.zoomLevel,o.autoZoom,o.simpleView,o.rectangle),this.input=new f.InputManager(e,i,this.view,n,o.zoomLevel),this.items=new h.CanvasItemsManager(this.view.canvasElement,o.zoomLevel),this.page=new y.CanvasPageManager(this.view.pageElement,o),this.selection=new g.CanvasSelectionManager(this.view.canvasElement,o.zoomLevel,o.readOnly),this.view.onViewChanged.add(this.page),this.view.onViewChanged.add(this.items),this.view.onViewChanged.add(this.selection),this.view.onViewChanged.add(this.input),this.attachEvents(r),this.mainElement=i,this.svgElement=r,this.events=n}return t.prototype.dispose=function(){this.detachEvents(this.svgElement),this.scroll.dispose(),this.input.dispose()},t.prototype.replaceParent=function(t){this.mainElement&&this.mainElement.parentNode!==t&&t.appendChild(this.mainElement),this.input.replaceParent(t)},t.prototype.update=function(t){this.view.update({horizontal:!t,vertical:!t}),this.page.redraw()},t.prototype.clear=function(){this.items.clear(),this.selection.clear()},t.prototype.attachEvents=function(t){this.onMouseDownHandler=this.onMouseDown.bind(this),this.onMouseEnterHandler=this.onMouseEnter.bind(this),this.onMouseLeaveHandler=this.onMouseLeave.bind(this),this.onMouseWheelHandler=this.onMouseWheel.bind(this),this.onMouseDblClickHandler=this.onMouseDblClick.bind(this),this.onContextMenuHandler=this.onContextMenu.bind(this),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.onWindowResizelHandler=this.onWindowResize.bind(this),this.onMouseClickHandler=this.onMouseClick.bind(this),t.addEventListener(p.TouchUIHelper.touchMouseDownEventName,this.onMouseDownHandler),t.addEventListener("mouseenter",this.onMouseEnterHandler),t.addEventListener("mouseleave",this.onMouseLeaveHandler),t.addEventListener("wheel",this.onMouseWheelHandler),t.addEventListener("dblclick",this.onMouseDblClickHandler),t.addEventListener("click",this.onMouseClickHandler),t.addEventListener("contextmenu",this.onContextMenuHandler),document.addEventListener(p.TouchUIHelper.touchMouseMoveEventName,this.onMouseMoveHandler),document.addEventListener(p.TouchUIHelper.touchMouseUpEventName,this.onMouseUpHandler),window.addEventListener("resize",this.onWindowResizelHandler)},t.prototype.detachEvents=function(t){t.removeEventListener(p.TouchUIHelper.touchMouseDownEventName,this.onMouseDownHandler),t.removeEventListener("mouseenter",this.onMouseEnterHandler),t.removeEventListener("mouseleave",this.onMouseLeaveHandler),t.removeEventListener("wheel",this.onMouseWheelHandler),t.removeEventListener("dblclick",this.onMouseDblClickHandler),t.removeEventListener("contextmenu",this.onContextMenuHandler),t.removeEventListener("click",this.onMouseClickHandler),document.removeEventListener(p.TouchUIHelper.touchMouseMoveEventName,this.onMouseMoveHandler),document.removeEventListener(p.TouchUIHelper.touchMouseUpEventName,this.onMouseUpHandler),window.removeEventListener("resize",this.onWindowResizelHandler)},t.prototype.onMouseDown=function(t){var e=this;this.lockMouseMove(),this.input.lockFocus(),this.autoScroll.onMouseDown(t),u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return e.events.onMouseDown(t)}),this.input.captureFocus(),c.Browser.TouchUI&&this.processTouchDown(t);var n=i.Evt.GetEventSource(t),o=n&&n.tagName;if(c.Browser.TouchUI||"img"===o.toLowerCase()||"image"===o.toLowerCase())return i.Evt.PreventEventAndBubble(t)},t.prototype.onMouseMove=function(t){var e=this;if(!this.moveLocked)return this.tryFinishNormalization(t),this.autoScroll.onMouseMove(t,function(){return e.onMouseMoveCore(t)}),this.onMouseMoveCore(t),c.Browser.IE&&this.lockMouseMove(),c.Browser.TouchUI?(this.processTouchMove(t),i.Evt.PreventEventAndBubble(t)):void 0},t.prototype.onMouseMoveCore=function(t){var e=this;u.raiseEvent(t,this.createDiagramMouseEvent(t,c.Browser.TouchUI),function(t){return e.events.onMouseMove(t)})},t.prototype.onMouseUp=function(t){var e=this;this.lockMouseMove(),this.tryFinishNormalization(t);var n=s.GetIsParent(this.mainElement,i.Evt.GetEventSource(t));u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return e.events.onMouseUp(t)}),this.autoScroll.onMouseUp(t),n&&this.input.captureFocus(),c.Browser.TouchUI&&this.processTouchUp(t)},t.prototype.onMouseEnter=function(t){var e=this;this.autoScroll.onMouseEnter(t),this.tryFinishNormalization(t),u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return e.events.onMouseEnter(t)})},t.prototype.onMouseLeave=function(t){var e=this;u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return e.events.onMouseLeave(t)})},t.prototype.onMouseDblClick=function(t){var e=this;u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return e.events.onDblClick(t)})},t.prototype.onMouseClick=function(t){var e=this;u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return e.events.onClick(t)})},t.prototype.onContextMenu=function(t){var e=this;return u.raiseEvent(t,this.createDiagramContextMenuEvent(t),function(t){return e.events.onContextMenu(t)}),this.input.captureFocus(),i.Evt.PreventEventAndBubble(t)},t.prototype.processTouchDown=function(t){var n=this;this.resetLongTouch(),this.longTouchTimer=setTimeout(function(){u.raiseEvent(t,n.createDiagramMouseEvent(t),function(t){return n.events.onLongTouch(t)}),n.resetLongTouch(),n.resetDblClick()},e.LONG_TOUCH_TIMEOUT)},t.prototype.processTouchMove=function(t){this.resetLongTouch(),this.resetDblClick()},t.prototype.processTouchUp=function(t){var n=this;if(void 0!==this.longTouchTimer){u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return n.events.onClick(t)});var o=i.Evt.GetEventSource(t);void 0!==this.dblTouchTimer&&this.lastClickElement===o?(u.raiseEvent(t,this.createDiagramMouseEvent(t),function(t){return n.events.onDblClick(t)}),this.resetDblClick()):(this.resetDblClick(),this.dblTouchTimer=setTimeout(function(){return n.dblTouchTimer=void 0},e.DBL_CLICK_TIMEOUT)),this.lastClickElement=o}this.resetLongTouch()},t.prototype.resetLongTouch=function(){void 0!==this.longTouchTimer&&clearTimeout(this.longTouchTimer),this.longTouchTimer=void 0},t.prototype.resetDblClick=function(){void 0!==this.dblTouchTimer&&clearTimeout(this.dblTouchTimer),this.dblTouchTimer=void 0},t.prototype.onWindowResize=function(){var t={horizontal:!1,vertical:!1};this.view.autoZoom!==d.AutoZoomMode.Disabled?(t.horizontal=!0,t.vertical=!0):t=this.view.checkFitToCanvas(),this.view.update(t)},t.prototype.onMouseWheel=function(t){var e=this;u.raiseEvent(t,this.createDiagramWheelEvent(t),function(t){return e.events.onMouseWheel(t)})},t.prototype.notifyModelSizeChanged=function(t,e){this.view.notifyModelSizeChanged(t,e)},t.prototype.notifyModelRectangleChanged=function(t){this.view.notifyModelRectangleChanged(t)},t.prototype.notifyReadOnlyChanged=function(t){s.ToggleElementClassName(this.mainElement,"dxdi-read-only",t)},t.prototype.notifyDragStart=function(t){},t.prototype.notifyDragEnd=function(t){},t.prototype.notifyDragScrollStart=function(){this.autoScroll.onDragScrollStart()},t.prototype.notifyDragScrollEnd=function(){this.autoScroll.onDragScrollEnd()},t.prototype.createDiagramMouseEvent=function(t,e){var n=a.getKeyModifiers(t),r=function(t){return c.Browser.MSTouchUI?2!=t.button:i.Evt.IsLeftButtonPressed(t)}(t)?o.MouseButton.Left:o.MouseButton.Right,s=this.getOffsetPointByEvent(t),u=this.getModelPoint(s),p=this.getEventSource(t,e),h=this.createDiagramMouseEventTouches(t);return new o.DiagramMouseEvent(n,r,s,u,p,h)},t.prototype.createDiagramMouseEventTouches=function(t){var e=[];if(t.touches)for(var n=0;n0;return o.Browser.WebKitFamily||o.Browser.Edge||t?o.Browser.MacOSMobilePlatform?window.pageYOffset:o.Browser.WebKitFamily&&document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop}function l(t){if("object"!=typeof t||null==t)return t;var e={};for(var n in t)e[n]=t[n];return e}function d(t){if(t.currentStyle)return t.currentStyle;if(document.defaultView&&document.defaultView.getComputedStyle){var e=document.defaultView.getComputedStyle(t,null);if(!e&&o.Browser.Firefox&&window.frameElement){for(var n=[],i=window.frameElement;!(e=document.defaultView.getComputedStyle(t,null));)n.push([i,i.style.display]),p(i,"display","block",!0),i="BODY"==i.tagName?i.ownerDocument.defaultView.frameElement:i.parentNode;e=l(e);for(var r,s=0;r=n[s];s++)p(r[0],"display",r[1],!1);document.body.offsetWidth}return e}return window.getComputedStyle(t,null)}function f(){var t=o.Browser.IE&&"hidden"==d(document.body).overflow&&document.body.scrollLeft>0;return o.Browser.Edge||t?document.body?document.body.scrollLeft:document.documentElement.scrollLeft:o.Browser.WebKitFamily?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft}function y(){try{return document.activeElement}catch(t){return null}}function m(t,e){try{if(t.focus(),o.Browser.IE&&document.activeElement!=t&&t.focus(),e){var n=Selection.GetInfo(t);if(n.startPos==n.endPos)switch(e){case"start":Selection.SetCaretPosition(t,0);break;case"all":Selection.Set(t)}}}catch(t){}}function g(t,e){try{return!!t.className&&-1!=t.className.indexOf(e)}catch(t){return!1}}function v(t,e){t&&"string"==typeof e&&(P(t,e=e.trim())||""===e||(t.className=""===t.className?e:t.className+" "+e))}function P(t,e){try{var n,o=t.classList;if(!o){if(!t.className)return!1;n=t.className.split(" ")}for(var r=e.split(" "),s=r.length-1;s>=0;s--)if(o){if(!o.contains(r[s]))return!1}else if(i.Data.ArrayIndexOf(n,r[s])<0)return!1;return!0}catch(t){return!1}}function C(t,e){if(t){var n=" "+t.className+" ",o=n.replace(" "+e+" "," ");n.length!=o.length&&(t.className=r.Str.Trim(o))}}function S(t){return o.Browser.IE?function(t){return null==t||o.Browser.IE&&null==t.parentNode?0:t.getBoundingClientRect().top+h()}(t):o.Browser.Firefox&&o.Browser.Version>=3?_(t):o.Browser.Opera?function(t){var e=!0;t&&"TR"==t.tagName&&t.cells.length>0&&(t=t.cells[0]);var n=w(t,!1);for(;null!=t;)n+=t.offsetTop,e||(n-=t.scrollTop),t=t.offsetParent,e=!1;return n+=document.body.scrollTop}(t):o.Browser.NetscapeFamily&&(!o.Browser.Firefox||o.Browser.Version<3)?function(t){var e=w(t,!1),n=!0;for(;null!=t;){if(e+=t.offsetTop,n||null==t.offsetParent||(e-=t.scrollTop),!n&&o.Browser.Firefox){var i=d(t);"DIV"==t.tagName&&"visible"!=i.overflow&&(e+=b(i.borderTopWidth))}n=!1,t=t.offsetParent}return e}(t):o.Browser.WebKitFamily||o.Browser.Edge?_(t):function(t){var e=0,n=!0;for(;null!=t;)e+=t.offsetTop,n||null==t.offsetParent||(e-=t.scrollTop),n=!1,t=t.offsetParent;return e}(t)}function _(t){if(null==t)return 0;var e=t.getBoundingClientRect().top+h();return Math.round(e)}function w(t,e){for(var n=0,o=!0;null!=t&&"BODY"!=t.tagName;){var i=d(t);if("absolute"==i.position)break;o||"DIV"!=t.tagName||""!=i.position&&"static"!=i.position||(n-=e?t.scrollLeft:t.scrollTop),t=t.parentNode,o=!1}return n}function b(t){return I(t,parseInt)}function x(t){return I(t,parseFloat)}function I(t,e){var n=0;if(null!=t&&""!=t)try{var o=t.indexOf("px");o>-1&&(n=e(t.substr(0,o)))}catch(t){}return n}function O(t){return o.Browser.IE?function(t){return null==t||o.Browser.IE&&null==t.parentNode?0:t.getBoundingClientRect().left+f()}(t):o.Browser.Firefox&&o.Browser.Version>=3?E(t):o.Browser.Opera?function(t){var e=!0,n=w(t,!0);for(;null!=t;)n+=t.offsetLeft,e||(n-=t.scrollLeft),t=t.offsetParent,e=!1;return n+=document.body.scrollLeft}(t):o.Browser.NetscapeFamily&&(!o.Browser.Firefox||o.Browser.Version<3)?function(t){var e=w(t,!0),n=!0;for(;null!=t;){if(e+=t.offsetLeft,n||null==t.offsetParent||(e-=t.scrollLeft),!n&&o.Browser.Firefox){var i=d(t);"DIV"==t.tagName&&"visible"!=i.overflow&&(e+=b(i.borderLeftWidth))}n=!1,t=t.offsetParent}return e}(t):o.Browser.WebKitFamily||o.Browser.Edge?E(t):function(t){var e=0,n=!0;for(;null!=t;)e+=t.offsetLeft,n||null==t.offsetParent||(e-=t.scrollLeft),n=!1,t=t.offsetParent;return e}(t)}function E(t){if(null==t)return 0;var e=t.getBoundingClientRect().left+f();return Math.round(e)}function M(t,e,n){return t-=function(t,e){var n=function(t){var e=document.createElement("DIV");return e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.position=d(t).position,e}(t);"static"==n.style.position&&(n.style.position="absolute");t.parentNode.appendChild(n);var o=e?O(n):S(n);return t.parentNode.removeChild(n),Math.round(o)}(e,n)}function T(t,e){return D(t.childNodes,e)}function A(t,e){return D(t.all||t.getElementsByTagName("*"),e)}function D(t,e){for(var n=[],o=0;o8?t.style.opacity=e:"object"==typeof t.filters&&t.filters["DXImageTransform.Microsoft.Alpha"]?t.filters.item("DXImageTransform.Microsoft.Alpha").Opacity=100*e:t.style.filter="alpha(opacity="+100*e+")"}function H(t){return t&&K(t)}function K(t){if(!t)return!1;if(!(o.Browser.Firefox&&o.Browser.Version<4)&&t.ownerDocument&&t.ownerDocument.body&&t.ownerDocument.body.compareDocumentPosition)return t.ownerDocument.body.compareDocumentPosition(t)%2==0;if(!o.Browser.Opera&&!(o.Browser.IE&&o.Browser.Version<9)&&t.offsetParent&&t.parentNode.tagName)return!0;for(;null!=t;){if("BODY"==t.tagName)return!0;t=t.parentNode}return!1}function V(t,e){void 0===e&&(e=function(){return!1});for(var n=t;n&&1==n.nodeType;){if(n==t||!e(n)){var o=n.tagName.toUpperCase();if("BODY"==o)return!0;if(-1!==["INPUT","BUTTON","TEXTAREA","SELECT","OPTION"].indexOf(o)&&n.disabled||!F(n,!1)||!W(n,!1))return!1}n=n.parentNode}return!0}function F(t,e){return e?"none"!=d(t).display:"none"!=t.style.display}function W(t,e){return e?"hidden"!=d(t).visibility:"hidden"!=t.style.visibility}function G(t,e){return Z(t,e)+k(t,e)}function Z(t,e){var n=e||d(t);return b(n.paddingTop)+b(n.paddingBottom)}function X(t){u(t=r.Str.DecodeHtmlViaTextArea(t))&&""!==t&&alert(t)}function Y(t,e,n,o,i){var r=t;return r|=e?a.ModifierKey.Ctrl:0,r|=n?a.ModifierKey.Shift:0,r|=o?a.ModifierKey.Alt:0,r|=i?a.ModifierKey.Meta:0}e.setInnerHtmlInternal=j,e.SetElementDisplay=R,e.GetInnerText=function(t){if(o.Browser.Safari&&o.Browser.MajorVersion<=5){var e=(null==N&&((N=document.createElement("DIV")).style.width="0",N.style.height="0",N.style.overflow="visible",R(N,!1,!1,!1),document.body.appendChild(N)),N);j(e,t.innerHTML),R(e,!0,!1,!1);var n=e.innerText;return R(e,!1,!1,!1),n}return o.Browser.NetscapeFamily||o.Browser.WebKitFamily||o.Browser.IE&&o.Browser.Version>=9||o.Browser.Edge?t.textContent:t.innerText},e.GetVerticalScrollBarWidth=function(){if(void 0===z){var t=document.createElement("DIV");t.style.cssText="position: absolute; top: 0px; left: 0px; visibility: hidden; width: 200px; height: 150px; overflow: hidden; box-sizing: content-box",document.body.appendChild(t);var e=document.createElement("P");t.appendChild(e),e.style.cssText="width: 100%; height: 200px;";var n=e.offsetWidth;t.style.overflow="scroll";var o=e.offsetWidth;n==o&&(o=t.clientWidth),z=n-o,document.body.removeChild(t)}return z},e.GetHorizontalBordersWidth=function(t,e){u(e)||(e=o.Browser.IE&&window.getComputedStyle?window.getComputedStyle(t):d(t));var n=0;return"none"!=e.borderLeftStyle&&(n+=x(e.borderLeftWidth)),"none"!=e.borderRightStyle&&(n+=x(e.borderRightWidth)),n},e.GetVerticalBordersWidth=k,e.SetElementVisibility=function(t,e){t&&(t.style.visibility="string"==typeof e?e:e?"visible":"hidden")},e.SetElementFloat=U,e.SetElementOpacity=B,e.CreateGuid=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)})},e.IsUrlContainsClientScript=function(t){return-1!==t.toLowerCase().indexOf("javascript:")},e.IsExistsElement=H,e.IsValidElement=K,e.IsInteractiveControl=function(t){return i.Data.ArrayIndexOf(["A","INPUT","SELECT","OPTION","TEXTAREA","BUTTON","IFRAME"],t.tagName)>-1},e.IsActionElement=function(t){if(!H(t))return!1;var e=parseInt(s.Attr.GetAttribute(t,s.Attr.GetTabIndexAttributeName())),n=!isNaN(e),o=n&&e>-1,i=n&&e<0,r=t.tagName,a=V(t),c=-1!==["BUTTON","SELECT","TEXTAREA","OPTION","IFRAME"].indexOf(r),u="A"===r&&(!!t.href||o),p="INPUT"===r&&"hidden"!==t.type.toLowerCase(),h="INPUT"!==r&&o,l="DIV"==r&&"true"===t.contentEditable;return a&&!i&&(c||u||p||h||l)},e.IsFocusable=V,e.GetElementDisplay=F,e.GetElementVisibility=W,e.GetClearClientHeight=function(t){return t.offsetHeight-G(t)},e.GetTopBottomBordersAndPaddingsSummaryValue=G,e.GetTopBottomPaddings=Z,e.ParseShortcutString=function(t){if(!t)return 0;var e=!1,n=!1,o=!1,i=!1,s=null,c=t.toString().split("+");if(c.length>0)for(var u=0;u720?2*t:720,this.columnSpacing=t&&2*t>r.Connector.minOffset?2*t:r.Connector.minOffset,this.layerSpacing=2*this.columnSpacing}}();e.LayoutSettings=s;var a,c,u,p=function(t){function e(e){var n=t.call(this,e)||this;return n.alignment=u.Center,n.subTreeColumnSpacing=n.componentSpacing/2,n}return i(e,t),e}(s);e.TreeLayoutSettings=p,function(t){t[t.Backward=0]="Backward",t[t.Forward=1]="Forward"}(a=e.LogicalDirectionKind||(e.LogicalDirectionKind={})),function(t){t[t.Horizontal=0]="Horizontal",t[t.Vertical=1]="Vertical"}(c=e.DataLayoutOrientation||(e.DataLayoutOrientation={})),function(t){t[t.Left=0]="Left",t[t.Center=1]="Center"}(u=e.Alignment||(e.Alignment={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){}return t.IdentUserAgent=function(e,n){void 0===n&&(n=!1);var o=["Mozilla","IE","Firefox","Netscape","Safari","Chrome","Opera","Opera10","Edge"],i={Safari:2,Chrome:.1,Mozilla:1.9,Netscape:8,Firefox:2,Opera:9,IE:6,Edge:12};if(e&&0!=e.length){e=e.toLowerCase(),t.indentPlatformMajorVersion(e);try{for(var r,s={Windows:"Win",Macintosh:"Mac","Mac OS":"Mac",Mac_PowerPC:"Mac","cpu os":"MacMobile","cpu iphone os":"MacMobile",Android:"Android","!Windows Phone":"WinPhone","!WPDesktop":"WinPhone","!ZuneWP":"WinPhone"},a="(?:(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?)?",c={Safari:"applewebkit(?:.*?(?:version/(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?[\\.\\w\\d]*?(?:\\s+mobile/\\S*)?\\s+safari))?",Chrome:"(?:chrome|crios)(?!frame)(?:/|\\s*)?"+a,Mozilla:"mozilla(?:.*rv:"+a+".*Gecko)?",Netscape:"(?:netscape|navigator)\\d*/?\\s*"+a,Firefox:"firefox(?:/|\\s*)?"+a,Opera:"(?:opera|sopr)(?:/|\\s*)?"+a,Opera10:"opera.*\\s*version(?:/|\\s*)?"+a,IE:"msie\\s*"+a,Edge:"edge(?:/|\\s*)?"+a},u=-1,p=0;p=0){if("IE"==r&&u>=11&&"Safari"==h)continue;"Opera10"==(r=h)&&(r="Opera");u=t.GetBrowserVersion(e,d,"trident(?:/|\\s*)?(?:(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?)?",t.getIECompatibleVersionString()),"Mozilla"==r&&u>=11&&(r="IE")}}r||(r="IE");var f,y=-1!=u;y||(u=i[r]);var m=Number.MAX_VALUE;for(var g in s)if(s.hasOwnProperty(g)){var v="!"==g.substr(0,1),P=e.indexOf((v?g.substr(1):g).toLowerCase());P>=0&&(P0;"WinPhone"==f&&u<9&&(u=Math.floor(t.getVersionFromTrident(e,"trident(?:/|\\s*)?"+a))),!n&&"IE"==r&&u>7&&document.documentMode0||navigator.msMaxTouchPoints>0},t.fillUserAgentInfo=function(e,n,o,i,r){void 0===r&&(r=!1);for(var s=0;s=15,t.NetscapeFamily=t.Netscape||t.Mozilla||t.Firefox,t.HardwareAcceleration=t.IE&&t.MajorVersion>=9||t.Firefox&&t.MajorVersion>=4||t.AndroidMobilePlatform&&t.Chrome||t.Chrome&&t.MajorVersion>=37||t.Safari&&!t.WindowsPlatform||t.Edge||t.Opera&&t.MajorVersion>=46,t.WebKitTouchUI=t.MacOSMobilePlatform||t.AndroidMobilePlatform;var c=t.IE&&t.MajorVersion>9&&t.WindowsPlatform&&t.UserAgent.toLowerCase().indexOf("touch")>=0;if(t.MSTouchUI=c||t.Edge&&!!window.navigator.maxTouchPoints,t.TouchUI=t.WebKitTouchUI||t.MSTouchUI,t.MobileUI=t.WebKitTouchUI||t.WindowsPhonePlatform,t.AndroidDefaultBrowser=t.AndroidMobilePlatform&&!t.Chrome,t.AndroidChromeBrowser=t.AndroidMobilePlatform&&t.Chrome,r&&(t.SamsungAndroidDevice=r),t.MSTouchUI){var u=t.UserAgent.toLowerCase().indexOf("arm;")>-1;t.VirtualKeyboardSupported=u||t.WindowsPhonePlatform}else t.VirtualKeyboardSupported=t.WebKitTouchUI;t.fillDocumentElementBrowserTypeClassNames(e)},t.indentPlatformMajorVersion=function(e){var n=/(?:(?:windows nt|macintosh|mac os|cpu os|cpu iphone os|android|windows phone|linux) )(\d+)(?:[-0-9_.])*/.exec(e);n&&(t.PlaformMajorVersion=n[1])},t.prototype.GetBrowserVersion=function(e,n,o,i){var r=t.getVersionFromMatches(n);if(i){var s=t.getVersionFromTrident(e,o);if("edge"===i||parseInt(i)===s)return s}return r},t.getVersionFromMatches=function(t){var e=-1,n="";return t[1]&&(n+=t[1],t[2]&&(n+="."+t[2])),""!=n&&(e=parseFloat(n),isNaN(e)&&(e=-1)),e},t.getVersionFromTrident=function(e,n){var o=new RegExp(n,"i").exec(e);return t.getVersionFromMatches(o)+4},t.fillDocumentElementBrowserTypeClassNames=function(e){for(var n="",o=e.concat(["WindowsPlatform","MacOSPlatform","MacOSMobilePlatform","AndroidMobilePlatform","WindowsPhonePlatform","WebKitFamily","WebKitTouchUI","MSTouchUI","TouchUI","AndroidDefaultBrowser"]),i=0;ie.dragStartLimit||Math.abs(this.mouseDownPoint.y-t.modelPoint.y)>e.dragStartLimit)&&(this.onApplyChanges(t),this.modified||this.handler.raiseDragStart(this.getDraggingElementKeys()),this.modified=!0,this.mouseDownPoint=void 0)},e.prototype.cancelChanges=function(){this.history.undoTransaction(),this.modified&&this.handler.raiseDragEnd(this.getDraggingElementKeys()),this.modified=!1},e.prototype.onMouseUp=function(t){this.mouseDownPoint=void 0,this.handler.switchToDefaultState()},e.prototype.start=function(){this.history.beginTransaction()},e.prototype.finish=function(){this.modified?(this.onFinishWithChanges(),this.modified=!1,this.history.endTransaction(),this.handler.raiseDragEnd(this.getDraggingElementKeys())):this.history.endTransaction()},e.prototype.onFinishWithChanges=function(){},e.prototype.getSnappedPoint=function(t,e){return this.handler.getSnappedPoint(t,e)},e.dragStartLimit=a.UnitConverter.pixelsToTwips(4),e}(r.MouseHandlerCancellableState);e.MouseHandlerDraggingState=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(38),s=n(79),a=function(){function t(){}return t.prototype.clone=function(){var t=this,e=this.createInstance();return this.forEach(function(n){e[n]=t[n]}),e},t.prototype.forEach=function(t){for(var e in this)this.hasOwnProperty(e)&&t(e)},t.prototype.toObject=function(){var t=this,e={},n=!1,o=this.getDefaultInstance();return this.forEach(function(i){t[i]!==o[i]&&(e[i]=t[i],n=!0)}),n?e:null},t.prototype.fromObject=function(t){for(var e in t)if(t.hasOwnProperty(e)&&void 0!==this[e]){var n=s.isColorProperty(e)?r.ColorHelper.stringToHash(t[e]):t[e];this[e]=n}},t}();e.StyleBase=a;var c=function(t){function e(e){var n=t.call(this)||this;return e&&Object.keys(e).forEach(function(t){return n[t]=e[t]}),n}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.getDefaultInstance=function(){return u.defaultInstace},e}(a);e.EmptyStyle=c;var u=function(t){function e(){var e=t.call(this)||this;return e.fill="#ffffff",e.stroke="#000000",e}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.getDefaultInstance=function(){return e.defaultInstace},e.defaultInstace=new e,e}(a);e.Style=u;var p=function(t){function e(){var e=t.call(this)||this;return e.fill="#000000",e["font-family"]="Arial",e["font-size"]="10pt",e["font-weight"]="",e["font-style"]="",e["text-decoration"]="",e["text-anchor"]="middle",e}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.getDefaultInstance=function(){return e.defaultInstace},e.defaultInstace=new e,e}(a);e.StyleText=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=function(t){function e(e,n,o,i,r,s){var a=t.call(this,null,n,i,r)||this;return a.zIndex=o,a.onBeforeDispose=s,a.children=e,a}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"g")},e.prototype.applyElementProperties=function(e){(this.zIndex||0===this.zIndex)&&e.style.setProperty("z-index",this.zIndex.toString()),t.prototype.applyElementProperties.call(this,e)},e.prototype.dispose=function(){this.onBeforeDispose&&this.onBeforeDispose(),t.prototype.dispose.call(this)},e}(n(18).SvgPrimitive);e.GroupPrimitive=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){return function(t,e){this.key=t,this.value=e}}();e.ShapeParameter=o;var i=function(){function t(){this.items={}}return t.prototype.add=function(t){this.items[t.key]=t},t.prototype.addRange=function(t){for(var e=0;e>24&255},t.getRed=function(t){return t>>16&255},t.getGreen=function(t){return t>>8&255},t.getBlue=function(t){return 255&t},t.redPartToString=function(e){var n=t.getRed(e).toString(16);return n.length>1?n:"0"+n},t.greenPartToString=function(e){var n=t.getGreen(e).toString(16);return n.length>1?n:"0"+n},t.bluePartToString=function(e){var n=t.getBlue(e).toString(16);return n.length>1?n:"0"+n},t.colorToHash=function(e){return"#"+t.redPartToString(e)+t.greenPartToString(e)+t.bluePartToString(e)},t.hashToColor=function(t,e){return void 0===e&&(e=255),3===(t="#"==t.charAt(0)?t.substr(1):t).length&&(t=o.StringUtils.repeat(t.charAt(0),2)+o.StringUtils.repeat(t.charAt(1),2)+o.StringUtils.repeat(t.charAt(2),2)),parseInt(t,16)|e<<24},t.getActualForeColor=function(e,n){e==t.AUTOMATIC_COLOR&&(e=n==t.AUTOMATIC_COLOR||n==t.NO_COLOR||t.calculateLumaY(n)>=t.DEFAULT_BOUNDARY_LUMA?t.DARK_COLOR:t.LIGHT_COLOR);return t.getCssString(e,!0)},t.getCssString=function(e,n){return e==t.AUTOMATIC_COLOR?t.colorToHash(n?t.DARK_COLOR:t.LIGHT_COLOR):t.getCssStringInternal(e)},t.stringToHash=function(t){return this.colorToHash(this.stringToColor(t))},t.stringToColor=function(e){var n=this.getRGBAByString(e),o="";return n?(255&n[0])<<16|(255&n[1])<<8|255&n[2]|(255&(n.length>3?n[3]:255))<<24:(/^#([0-9a-f]{6})$/i.test(e)||/^#([0-9a-f]{3})$/i.test(e)?o=e:/^[a-z]+$/i.test(e)&&(o=t.colorNames[e.toLowerCase()]),o?t.hashToColor(o):null)},t.getRGBAByString=function(t){var e=t.replace(/ +/g,"").match(/(rgba?)|(\d+(\.\d+)?%?)|(\.\d+)/g);if(e&&e.length>3){for(var n,o=0,i=[];o255)return null;i.push(n)}if(0===t.indexOf("rgba")){if(isNaN(i[3])||i[3]<0||i[3]>1)return null;i[3]<=1&&(i[3]=Math.round(255*i[3]))}else if(i[3])return null;return i}return null},t.IsDarkColor=function(e){return t.calculateLumaY(e)=11?e.type===i.TouchUIHelper.touchMouseMoveEventName?1===e.buttons:1==e.which:!o.Browser.Opera||0==e.button)},t.PreventEventAndBubble=function(e){return t.PreventEvent(e),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,!1},t.clientEventRequiresDocScrollCorrection=function(){var t=o.Browser.Safari&&o.Browser.Version<3,e=o.Browser.MacOSMobilePlatform&&o.Browser.Version<5.1;return o.Browser.AndroidDefaultBrowser||o.Browser.AndroidChromeBrowser||!(t||e)},t.GetEventX=function(e){return i.TouchUIHelper.isTouchEvent(e)?i.TouchUIHelper.getEventX(e):e.clientX+(t.clientEventRequiresDocScrollCorrection()?r.GetDocumentScrollLeft():0)},t.GetEventY=function(e){return i.TouchUIHelper.isTouchEvent(e)?i.TouchUIHelper.getEventY(e):e.clientY+(t.clientEventRequiresDocScrollCorrection()?r.GetDocumentScrollTop():0)},t.CancelBubble=function(t){return t.cancelBubble=!0,!1},t}();e.Evt=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(86),i=function(){function t(t){this.url=void 0,this.base64=void 0,t&&(o.Base64Utils.checkPrependDataUrl(t)?this.base64=t:this.url=t),this.loadFailed=!1}return t.prototype.clone=function(){var e=new t;return e.url=this.url,e.base64=this.base64,e},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return void 0===this.url&&void 0===this.base64},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"unableToLoad",{get:function(){return this.loadFailed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderUrl",{get:function(){return this.base64||""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"exportUrl",{get:function(){return this.base64?this.base64:this.url},enumerable:!0,configurable:!0}),Object.defineProperty(t,"transparentOnePixelImage",{get:function(){return this.transparentWhiteImage1_1},enumerable:!0,configurable:!0}),t.prototype.loadBase64Content=function(t){this.base64=o.Base64Utils.normalize(t)},t.prototype.setUnableToLoadFlag=function(){this.loadFailed=!0},t.transparentWhiteImage1_1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAANSURBVBhXY/j///9/AAn7A/0FQ0XKAAAAAElFTkSuQmCC",t}();e.ImageInfo=i},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=function(t){function e(e,n){var o=t.call(this)||this;return o.id=e,o.children=n,o}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"clipPath")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),t.prototype.applyElementProperties.call(this,e)},e}(n(18).SvgPrimitive);e.ClipPathPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=function(t){function e(e,n,o,i,r,s){var a=t.call(this,r,s)||this;return a.cx=e,a.cy=n,a.rx=o,a.ry=i,a}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"ellipse")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"cx",this.cx),this.setUnitAttribute(e,"cy",this.cy),this.setUnitAttribute(e,"rx",this.rx),this.setUnitAttribute(e,"ry",this.ry),t.prototype.applyElementProperties.call(this,e)},e}(n(18).SvgPrimitive);e.EllipsePrimitive=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(4),i=n(5),r=function(){function t(t){this.parent=t}return Object.defineProperty(t.prototype,"connector",{get:function(){return this.parent.connector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"beginRect",{get:function(){return this.parent.beginRect},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"endRect",{get:function(){return this.parent.endRect},enumerable:!0,configurable:!0}),t.prototype.getBeginOffsetPoints=function(t,e,n,i){if(e=this.getCorrectOriginPoint(e,i),t!==o.ConnectionPointSide.Undefined){if(this.isBeginEndSame())return this.getSameShapeOffsetPoints(t,e,n,i);if(this.isBeginEndOverlappedPoints(e,n))return this.getOverlappedPointsOffsetPoints(t,e,n,i);if(this.isBeginEndOverlapped())return this.getBeginOverlappedShapeOffsetPoints(t,e,n,i)}else if(this.isOriginRectContainsTargetPoint(i,n))return this.getOverlappedPointsOffsetPoints(t,e,n,i);return this.isOnSidePoint(e,n)?this.getBeginOnSideOffsetPoints(t,e,n,i):this.getBeginOffSideOffsetPoints(t,e,n,i)},t.prototype.getEndOffsetPoints=function(t,e,n,i){if(e=this.getCorrectOriginPoint(e,i),t!==o.ConnectionPointSide.Undefined){if(this.isBeginEndSame())return this.getSameShapeOffsetPoints(t,e,n,i);if(this.isBeginEndOverlappedPoints(n,e))return this.getOverlappedPointsOffsetPoints(t,e,n,i);if(this.isBeginEndOverlapped())return this.getEndOverlappedShapeOffsetPoints(t,e,n,i)}else if(this.isOriginRectContainsTargetPoint(i,n))return this.getOverlappedPointsOffsetPoints(t,e,n,i);return this.isOnSidePoint(e,n)?this.getEndOnSideOffsetPoints(t,e,n,i):this.getEndOffSideOffsetPoints(t,e,n,i)},t.prototype.getSide=function(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?e.x>t.x?o.ConnectionPointSide.East:o.ConnectionPointSide.West:e.y>t.y?o.ConnectionPointSide.South:o.ConnectionPointSide.North},t.prototype.getSideCalculator=function(t,e){return this.parent.getSideCalculator(this.getSide(t,e))},t.prototype.getMinOffset=function(){return i.Connector.minOffset},t.prototype.isBeginEndSame=function(){return this.connector.beginItem===this.connector.endItem},t.prototype.isBeginEndOverlapped=function(){return this.beginRect&&this.endRect&&this.beginRect.intersect(this.endRect)},t.prototype.isBeginEndOverlappedX=function(){return this.beginRect&&this.endRect&&this.beginRect.intersectX(this.endRect)},t.prototype.isBeginEndOverlappedY=function(){return this.beginRect&&this.endRect&&this.beginRect.intersectY(this.endRect)},t.prototype.isBeginEndOverlappedPoints=function(t,e){return this.beginRect&&this.endRect&&(this.beginRect.contains(e)||this.endRect.contains(t))},t.prototype.isOriginRectContainsTargetPoint=function(t,e){return t&&t.contains(e)},t}();e.ConnectorPointsOrthogonalSideCalculatorBase=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.selectedKeys=n,o.selection=e,o}return i(e,t),e.prototype.redo=function(){this.oldSelection=this.selection.getKeys().slice(0),this.selection.set(this.selectedKeys)},e.prototype.undo=function(){this.selection.set(this.oldSelection)},e}(n(3).HistoryItem);e.SetSelectionHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(9),s=n(0),a=n(13),c=n(98),u=n(20),p=n(28),h=n(15),l=n(41),d=n(99);e.ShapeDefaultDimension=1440,e.ShapeDefaultSize=new s.Size(e.ShapeDefaultDimension,e.ShapeDefaultDimension),e.SHAPE_IMAGE_CLASSNAMES={IMAGE:"dxdi-image",IMAGE_PLACEHOLDER:"dxdi-image-placeholder",LOADING_INDICATOR:"dxdi-spinner",USER_PIC:"dxdi-user",WARNING_MARK:"dxdi-warning"};var f=function(t){function n(n,o,i,r){void 0===i&&(i=e.ShapeDefaultSize.clone());var s=t.call(this,n,o,i,r)||this;return s.title=n,s.defaultText=o,s.defaultSize=i,s.defaultImageUrl=r,s.defaultIconSize=480,s}return i(n,t),Object.defineProperty(n.prototype,"enableImage",{get:function(){return!0},enumerable:!0,configurable:!0}),n.getImageMargins=function(t){return a.UnitConverter.pixelsToTwips(3)},n.prototype.createImagePrimitives=function(t,n){if(!this.enableImage)return[];var o=this.getImagePlacementRectangle(t.rectangle,n);if(n)return this.createImagePlaceholder(o);var i=[];if(i=t.image.isEmpty||t.image.unableToLoad?i.concat(this.createEmptyImagePrimitives(o,t.image.unableToLoad)):""===t.image.renderUrl?i.concat(this.createLoadingImagePrimitives(o)):i.concat(this.createLoadedImagePrimitives(o,t.image.renderUrl)),""===t.image.renderUrl){var r=h.RenderUtils.generateSvgElementId("clipImage");return[new p.GroupPrimitive(i,e.SHAPE_IMAGE_CLASSNAMES.IMAGE,void 0,r),new l.ClipPathPrimitive(r,[new u.RectanglePrimitive(o.left,o.top,o.width,o.height)])]}return i},n.prototype.createImagePlaceholder=function(t){return[]},n.prototype.createLoadedImagePrimitives=function(t,o){return[new c.ImagePrimitive(t.left,t.top,t.width,t.height,o,n.imageScalingRule,void 0,e.SHAPE_IMAGE_CLASSNAMES.IMAGE)]},n.prototype.createLoadingImagePrimitives=function(t){var n=this.getIconPlacementRectangle(t);return[d.ShapeImageIndicator.createLoadingIndicatorPrimitives(n.left,n.top,this.defaultIconSize,a.UnitConverter.pixelsToTwips(5),e.SHAPE_IMAGE_CLASSNAMES.LOADING_INDICATOR)]},n.prototype.createEmptyImagePrimitives=function(t,e){var n=this.getIconPlacementRectangle(t),o=[];return o=o.concat(this.createEmptyImagePrimitive(n)),e&&(o=o.concat(this.createWarningPrimitive(n))),o},n.prototype.createEmptyImagePrimitive=function(t){return new p.GroupPrimitive([])},n.prototype.createWarningPrimitive=function(t){return new p.GroupPrimitive([])},n.prototype.getIconPlacementRectangle=function(t){var e=new s.Rectangle(new s.Point(t.left,t.top),new s.Size(this.defaultIconSize,this.defaultIconSize));return e.width0?i.position.x=t.right-r.right-n.getImageMargins(e):r.left>0&&(i.position.x+=n.getImageMargins(e)),r.bottom>0?i.position.y=t.bottom-r.bottom-n.getImageMargins(e):i.position.y+=n.getImageMargins(e),(r.top>0||r.bottom>0)&&(i.position.x=i.left+(t.width-i.width)/2),i},n.prototype.getImageSize=function(t,e){var n=this.getRawImageSize(t,e);return this.correctImageSize(n)},n.prototype.getRawImageSize=function(t,e){return new s.Size(0,0)},n.prototype.correctImageSize=function(t){return t.width=Math.max(t.width,0),t.height=Math.max(t.height,0),t},n.prototype.getTextBlockOffset=function(t,e){return s.Offset.empty()},n.imageScalingRule="xMidYMid meet",n}(r.ShapeDescription);e.ShapeWithImageDescription=f},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){return t.call(this,e,n,o)||this}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldStyleValue=e.style[this.styleProperty],t.changeStyle(e,this.styleProperty,this.styleValue)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeStyle(e,this.styleProperty,this.oldStyleValue)},e}(n(103).ChangeStyleHistoryItemBase);e.ChangeStyleHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e}(n(7).SimpleCommandBase);e.ExportImportCommandBase=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o,i=n(129),r=n(198),s=n(199),a=n(200),c=n(201),u=n(202),p=n(203),h=n(204),l=n(205),d=n(206),f=n(207),y=n(208),m=n(209),g=n(210),v=n(211),P=n(212),C=n(213),S=n(16),_=n(214),w=n(217),b=n(218),x=n(219),I=n(221),O=n(223),E=n(225),M=n(226),T=n(227),A=n(228),D=n(229),L=n(232),z=n(235),N=n(236),j=n(237),R=n(238),k=n(239),U=n(240),B=n(242),H=n(243),K=n(244),V=n(245),F=n(246),W=n(247),G=n(248),Z=n(250),X=n(252),Y=n(253),q=n(254),J=n(255),Q=n(256),$=n(257),tt=n(258),et=n(260),nt=n(261);!function(t){t[t.Undo=0]="Undo",t[t.Redo=1]="Redo",t[t.Cut=2]="Cut",t[t.Copy=3]="Copy",t[t.Paste=4]="Paste",t[t.PasteInPosition=5]="PasteInPosition",t[t.SelectAll=6]="SelectAll",t[t.Delete=7]="Delete",t[t.Import=8]="Import",t[t.ImportBPMN=9]="ImportBPMN",t[t.Export=10]="Export",t[t.ExportSvg=11]="ExportSvg",t[t.ExportPng=12]="ExportPng",t[t.ExportJpg=13]="ExportJpg",t[t.BindDocument=14]="BindDocument",t[t.UnbindDocument=15]="UnbindDocument",t[t.Bold=16]="Bold",t[t.Italic=17]="Italic",t[t.Underline=18]="Underline",t[t.FontName=19]="FontName",t[t.FontSize=20]="FontSize",t[t.FontColor=21]="FontColor",t[t.FillColor=22]="FillColor",t[t.StrokeColor=23]="StrokeColor",t[t.TextLeftAlign=24]="TextLeftAlign",t[t.TextCenterAlign=25]="TextCenterAlign",t[t.TextRightAlign=26]="TextRightAlign",t[t.ConnectorLineOption=27]="ConnectorLineOption",t[t.ConnectorStartLineEnding=28]="ConnectorStartLineEnding",t[t.ConnectorEndLineEnding=29]="ConnectorEndLineEnding",t[t.BringToFront=30]="BringToFront",t[t.SendToBack=31]="SendToBack",t[t.MoveLeft=32]="MoveLeft",t[t.MoveStepLeft=33]="MoveStepLeft",t[t.MoveRight=34]="MoveRight",t[t.MoveStepRight=35]="MoveStepRight",t[t.MoveUp=36]="MoveUp",t[t.MoveStepUp=37]="MoveStepUp",t[t.MoveDown=38]="MoveDown",t[t.MoveStepDown=39]="MoveStepDown",t[t.CloneLeft=40]="CloneLeft",t[t.CloneRight=41]="CloneRight",t[t.CloneUp=42]="CloneUp",t[t.CloneDown=43]="CloneDown",t[t.AutoLayoutTree=44]="AutoLayoutTree",t[t.AutoLayoutFlow=45]="AutoLayoutFlow",t[t.AutoLayoutTreeVertical=46]="AutoLayoutTreeVertical",t[t.AutoLayoutTreeHorizontal=47]="AutoLayoutTreeHorizontal",t[t.AutoLayoutLayeredVertical=48]="AutoLayoutLayeredVertical",t[t.AutoLayoutLayeredHorizontal=49]="AutoLayoutLayeredHorizontal",t[t.Lock=50]="Lock",t[t.Unlock=51]="Unlock",t[t.Units=52]="Units",t[t.ViewUnits=53]="ViewUnits",t[t.PageSize=54]="PageSize",t[t.PageLandscape=55]="PageLandscape",t[t.PageColor=56]="PageColor",t[t.GridSize=57]="GridSize",t[t.ShowGrid=58]="ShowGrid",t[t.SnapToGrid=59]="SnapToGrid",t[t.ZoomLevel=60]="ZoomLevel",t[t.Fullscreen=61]="Fullscreen",t[t.ToggleSimpleView=62]="ToggleSimpleView",t[t.ToggleReadOnly=63]="ToggleReadOnly",t[t.EditShapeImage=64]="EditShapeImage",t[t.FitToScreen=65]="FitToScreen",t[t.SwitchAutoZoom=66]="SwitchAutoZoom",t[t.ToggleAutoZoom=67]="ToggleAutoZoom",t[t.FitToWidth=68]="FitToWidth",t[t.ZoomLevelItems=69]="ZoomLevelItems",t[t.GridSizeItems=70]="GridSizeItems",t[t.PageSizeItems=71]="PageSizeItems",t[t.ImportXML=72]="ImportXML",t[t.InsertShapeImage=73]="InsertShapeImage",t[t.DeleteShapeImage=74]="DeleteShapeImage"}(o=e.DiagramCommand||(e.DiagramCommand={}));var ot=function(){function t(t){this.commands={},this.shortcutsToCommand={},this.lastCommandsChain=[],this.executingCommandsChain=[],this.executingCommandCounter=0,this.isPublicApiCall=!1,this.createCommand(t,o.Undo,r.UndoCommand,S.ModifierKey.Ctrl|S.KeyCode.Key_z,S.ModifierKey.Meta|S.KeyCode.Key_z),this.createCommand(t,o.Redo,s.RedoCommand,S.ModifierKey.Ctrl|S.KeyCode.Key_y,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Key_z,S.ModifierKey.Meta|S.ModifierKey.Shift|S.KeyCode.Key_z),this.createCommand(t,o.Cut,A.CutSelectionCommand,S.KeyCode.Key_x|S.ModifierKey.Ctrl,S.KeyCode.Key_x|S.ModifierKey.Meta),this.createCommand(t,o.Copy,T.CopySelectionCommand,S.KeyCode.Key_c|S.ModifierKey.Ctrl,S.KeyCode.Key_c|S.ModifierKey.Meta),this.createCommand(t,o.Paste,D.PasteSelectionCommand),this.createCommand(t,o.PasteInPosition,$.PasteSelectionInPositionCommand),this.createCommand(t,o.SelectAll,C.SelectAllCommand,S.KeyCode.Key_a|S.ModifierKey.Ctrl,S.KeyCode.Key_a|S.ModifierKey.Meta),this.createCommand(t,o.Delete,i.DeleteCommand,S.KeyCode.Delete,S.KeyCode.Backspace),this.createCommand(t,o.Import,a.ImportCommand),this.createCommand(t,o.ImportBPMN,L.ImportBPMNCommand),this.createCommand(t,o.ImportXML,tt.ImportXMLCommand),this.createCommand(t,o.Export,c.ExportCommand),this.createCommand(t,o.ExportSvg,E.ExportSvgCommand),this.createCommand(t,o.ExportPng,O.ExportPngCommand),this.createCommand(t,o.ExportJpg,M.ExportJpgCommand),this.createCommand(t,o.BindDocument,U.BindDocumentCommand),this.createCommand(t,o.UnbindDocument,B.UnbindDocumentCommand),this.createCommand(t,o.Bold,u.ToggleFontBoldCommand,S.ModifierKey.Ctrl|S.KeyCode.Key_b,S.ModifierKey.Meta|S.KeyCode.Key_b),this.createCommand(t,o.Italic,p.ToggleFontItalicCommand,S.ModifierKey.Ctrl|S.KeyCode.Key_i,S.ModifierKey.Meta|S.KeyCode.Key_i),this.createCommand(t,o.Underline,h.ToggleFontUnderlineCommand,S.ModifierKey.Ctrl|S.KeyCode.Key_u,S.ModifierKey.Meta|S.KeyCode.Key_u),this.createCommand(t,o.FontName,l.ChangeFontNameCommand),this.createCommand(t,o.FontSize,d.ChangeFontSizeCommand),this.createCommand(t,o.FontColor,f.ChangeFontColorCommand),this.createCommand(t,o.FillColor,y.ChangeFillColorCommand),this.createCommand(t,o.StrokeColor,m.ChangeStrokeColorCommand),this.createCommand(t,o.TextLeftAlign,g.TextLeftAlignCommand),this.createCommand(t,o.TextCenterAlign,g.TextCenterAlignCommand),this.createCommand(t,o.TextRightAlign,g.TextRightAlignCommand),this.createCommand(t,o.ConnectorLineOption,P.ChangeConnectorLineOptionCommand),this.createCommand(t,o.ConnectorStartLineEnding,v.ChangeConnectorStartLineEndingCommand),this.createCommand(t,o.ConnectorEndLineEnding,v.ChangeConnectorEndLineEndingCommand),this.createCommand(t,o.BringToFront,N.BringToFrontCommand),this.createCommand(t,o.SendToBack,z.SendToBackCommand),this.createCommand(t,o.MoveLeft,R.MoveLeftCommand,S.ModifierKey.Shift|S.KeyCode.Left),this.createCommand(t,o.MoveStepLeft,R.MoveStepLeftCommand,S.KeyCode.Left),this.createCommand(t,o.MoveRight,R.MoveRightCommand,S.ModifierKey.Shift|S.KeyCode.Right),this.createCommand(t,o.MoveStepRight,R.MoveStepRightCommand,S.KeyCode.Right),this.createCommand(t,o.MoveUp,R.MoveUpCommand,S.ModifierKey.Shift|S.KeyCode.Up),this.createCommand(t,o.MoveStepUp,R.MoveStepUpCommand,S.KeyCode.Up),this.createCommand(t,o.MoveDown,R.MoveDownCommand,S.ModifierKey.Shift|S.KeyCode.Down),this.createCommand(t,o.MoveStepDown,R.MoveStepDownCommand,S.KeyCode.Down),this.createCommand(t,o.CloneLeft,W.CloneLeftCommand,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Left),this.createCommand(t,o.CloneRight,W.CloneRightCommand,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Right),this.createCommand(t,o.CloneUp,W.CloneUpCommand,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Up),this.createCommand(t,o.CloneDown,W.CloneDownCommand,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Down),this.createCommand(t,o.Lock,V.LockCommand),this.createCommand(t,o.Unlock,F.UnLockCommand),this.createCommand(t,o.AutoLayoutTree,_.AutoLayoutTreeVerticalCommand),this.createCommand(t,o.AutoLayoutFlow,j.AutoLayoutLayeredHorizontalCommand),this.createCommand(t,o.Units,G.ChangeUnitsCommand),this.createCommand(t,o.ViewUnits,G.ChangeViewUnitsCommand),this.createCommand(t,o.PageSize,I.ChangePageSizeCommand),this.createCommand(t,o.PageLandscape,x.ChangePageLandscapeCommand),this.createCommand(t,o.PageColor,Z.ChangePageColorCommand),this.createCommand(t,o.GridSize,b.ChangeGridSizeCommand),this.createCommand(t,o.ShowGrid,X.ChangeShowGridCommand),this.createCommand(t,o.SnapToGrid,w.ChangeSnapToGridCommand),this.createCommand(t,o.ZoomLevel,k.ChangeZoomLevelCommand),this.createCommand(t,o.AutoLayoutTreeVertical,_.AutoLayoutTreeVerticalCommand),this.createCommand(t,o.AutoLayoutTreeHorizontal,H.AutoLayoutTreeHorizontalCommand),this.createCommand(t,o.AutoLayoutLayeredVertical,K.AutoLayoutLayeredVerticalCommand),this.createCommand(t,o.AutoLayoutLayeredHorizontal,j.AutoLayoutLayeredHorizontalCommand),this.createCommand(t,o.Fullscreen,Y.ToggleFullscreenCommand,S.KeyCode.F11),this.createCommand(t,o.ToggleSimpleView,q.ToggleSimpleViewCommand),this.createCommand(t,o.ToggleReadOnly,J.ToggleReadOnlyCommand),this.createCommand(t,o.InsertShapeImage,et.InsertShapeImageCommand),this.createCommand(t,o.EditShapeImage,Q.EditShapeImageCommand),this.createCommand(t,o.DeleteShapeImage,nt.DeleteShapeImageCommand),this.createCommand(t,o.FitToScreen,k.FitToScreenCommand),this.createCommand(t,o.FitToWidth,k.FitToWidthCommand),this.createCommand(t,o.SwitchAutoZoom,k.SwitchAutoZoomCommand),this.createCommand(t,o.ToggleAutoZoom,k.ToggleAutoZoomCommand),this.createCommand(t,o.ZoomLevelItems,k.ChangeZoomLevelItemsCommand),this.createCommand(t,o.GridSizeItems,b.ChangeGridSizeItemsCommand),this.createCommand(t,o.PageSizeItems,I.ChangePageSizeItemsCommand)}return t.prototype.getCommand=function(t){return this.commands[t]},t.prototype.beforeExecuting=function(t){this.executingCommandsChain.push(t),this.executingCommandCounter++},t.prototype.afterExecuting=function(){this.executingCommandCounter--,0===this.executingCommandCounter&&(this.lastCommandsChain=this.executingCommandsChain,this.executingCommandsChain=[])},t.prototype.assertLastExecutedCommandsChain=function(t){for(var e=[],n=1;n=1)y.push(r),y.push({from:i.from,to:r.to}),y.push({from:r.from,to:i.to});else if(f.position-l.position<=-1)y.push(s),y.push({from:i.from,to:s.to}),y.push({from:s.from,to:i.to});else{var m=l.position===f.position&&0===f.position?[c,u]:[u,c];m.forEach(function(t){return y.push(t)}),m.forEach(function(t){y.push({from:t.from,to:i.to}),y.push({from:i.from,to:t.to})})}y.push(i);for(var g=0,v=void 0;v=y[g];g++){var P=l.key+"_"+v.from,C=f.key+"_"+v.to;if(p[P]!==d.ConnectorPosition.End&&p[C]!==d.ConnectorPosition.Begin){e.addEdge(new a.EdgeLayout(o.key,v.from,v.to)),p[P]=d.ConnectorPosition.Begin,p[C]=d.ConnectorPosition.End;break}}}})},e.prototype.getDirectEdgeLayout=function(){return this.settings.orientation===h.DataLayoutOrientation.Horizontal?this.settings.direction===h.LogicalDirectionKind.Forward?{from:1,to:3}:{from:3,to:1}:this.settings.direction===h.LogicalDirectionKind.Forward?{from:2,to:0}:{from:0,to:2}},e.prototype.getDiffLevelEdgeLayout=function(t){return this.settings.orientation===h.DataLayoutOrientation.Horizontal?t?{from:2,to:0}:{from:0,to:2}:t?{from:3,to:1}:{from:1,to:3}},e.prototype.getSameLevelEdgeLayout=function(t){return this.settings.orientation===h.DataLayoutOrientation.Horizontal?t?{from:0,to:0}:{from:2,to:2}:t?{from:3,to:3}:{from:1,to:1}},e.prototype.getAbsOffsetInfo=function(t){var e=this,n={},o=function(t,o){void 0===n[o]&&(n[o]=e.getBreadthNodeSize(t)),n[o]=Math.max(n[o],e.getBreadthNodeSize(t))};t.forEach(function(t){var e=S(t.position);o(t,e),n[e]%1!=0&&o(t,e+1)});var i={},r=0;return Object.keys(n).sort().forEach(function(t){i[t]={leftOffset:r,width:n[t]},r+=n[t]+e.settings.columnSpacing}),i},e.prototype.setBreadth=function(t,e){return this.settings.orientation===h.DataLayoutOrientation.Vertical?new p.Point(e,t.y):new p.Point(t.x,e)},e.prototype.setDepthOffset=function(t,e){return this.settings.orientation===h.DataLayoutOrientation.Horizontal?new p.Point(t.x+e,t.y):new p.Point(t.x,t.y+e)},e.prototype.getAbsPosition=function(t,e,n){var o=S(t),i=n[o].leftOffset,r=n[o].width;return t%1==0?i+(r-e)/2:i+r-(e-this.settings.columnSpacing)/2},e.prototype.getBreadthNodeSize=function(t){return t.isDummy?0:this.getBreadthNodeSizeCore(this.graph.getNode(t.key))},e.prototype.getDepthNodeSize=function(t){return t.isDummy?0:this.getDepthNodeSizeCore(this.graph.getNode(t.key))},e}(r.LayoutBuilder);e.SugiyamaLayoutBuilder=y;var m=function(){function t(){}return t.getLayers=function(t){var e=this.getFeasibleTree(t);return this.calcNodesLayers(e)},t.getFeasibleTree=function(t){var e=this.initLayerAssignment(t);return t.getSpanningGraph(t.nodes[0],c.ConnectionMode.OutgoingAndIncoming,function(t){return e[t.to]-e[t.from]})},t.initLayerAssignment=function(t){for(var e={},n=0,o={},i=t.nodes.filter(function(e){return!t.getAdjacentEdges(e,c.ConnectionMode.Incoming).length}),r=function(){i.forEach(function(t){e[t]=n,o[t]=!0}),Object.keys(o).forEach(function(n){0===t.getAdjacentEdges(n,c.ConnectionMode.Outgoing).filter(function(t){return void 0===e[t.to]}).length&&delete o[n]});var r={};Object.keys(o).forEach(function(n){t.getAdjacentEdges(n,c.ConnectionMode.Outgoing).map(function(t){return t.to}).filter(function(n){return void 0===e[n]&&t.getAdjacentEdges(n,c.ConnectionMode.Incoming).reduce(function(t,n){return t&&void 0!==e[n.from]},!0)}).forEach(function(t){return r[t]=!0})}),i=Object.keys(r),n++};i.length;)r();return e},t.calcNodesLayers=function(t){var e={},n=Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,o=0,i=t.createIterator(c.ConnectionMode.OutgoingAndIncoming);for(var r in i.visitEachEdgeOnce=!1,i.onNode=function(t){e[t.key]=o,n=Math.min(n,o)},i.skipNode=function(t){return void 0!==e[t.key]},i.skipEdge=function(t){return void 0!==e[t.from]&&void 0!==e[t.to]},i.onEdge=function(t,n){o=n?e[t.from]+1:e[t.to]-1},i.iterate(t.nodes[0]),e)e.hasOwnProperty(r)&&(e[r]-=n);return e},t}();e.SugiyamaLayerDistributor=m;var g=function(){function t(){this.idCounter=-1e4}return t.prototype.orderNodes=function(t,e){for(var n=1,o=this.initGraphInfo(t,e),i=o.items,r=this.initOrder(i),s=this.getNodeToPositionMap(i),a=this.getCrossCount(r,o),c=!0;n<14&&0!=a;){r=this.getNodesOrder(r,o,c);var u=this.getCrossCount(r,o);u1){for(var c=i[t.from],u=1;ut?i[e.key]:t},-2);t.forEach(function(t){var o=e-i[t.key];o>0&&n[t.layer].filter(function(e){return e.position>t.position}).forEach(function(t){return i[t.key]+=o}),i[t.key]=e})}),i},t.prototype.getSortedBlocks=function(t,e,n,o){for(var i=[],r=o===P.BottomLeft||o===P.BottomRight,s=new u.HashSet(e.slice(0).sort(function(t,e){return r?t.layer-e.layer:e.layer-t.layer}),function(t){return t.key});s.length;){var a=s.item(0),c=this.getBlock(t,a,n,o);i.push(c),c.forEach(function(t){return s.remove(t)})}return i.sort(function(t,e){var n=t.reduce(function(t,e){return e.position=n:t<=n)},t.prototype.getMedians=function(t,e,n){var o=this,i={};return e.forEach(function(e){var r=o.getActualAdjacentEdges(t,e,n),s=o.getMedianPosition(r.length,n);i[e.key]=r[s]}),i},t.prototype.getMedianPosition=function(t,e){if(0===t)return-1;if(t%2!=0)return Math.floor(t/2);if(e===P.TopLeft||e===P.BottomLeft)return Math.floor(t/2)-1;if(e===P.TopRight||e===P.BottomRight)return Math.floor(t/2);throw new Error("Invalid Operation")},t.prototype.getActualAdjacentEdges=function(t,e,n){return n===P.TopLeft||n===P.TopRight?t.getAdjacentEdges(e.key,c.ConnectionMode.Incoming).sort(function(e,n){return t.getNode(e.from).position-t.getNode(n.from).position}):t.getAdjacentEdges(e.key,c.ConnectionMode.Outgoing).sort(function(e,n){return t.getNode(e.to).position-t.getNode(n.to).position})},t}();e.SugiyamaNodesOrderer=g;var v=function(){function t(t,e,n,o){this.key=t,this.isDummy=e,this.layer=n,this.position=o}return t.prototype.getHashCode=function(){return this.key.toString()},t}();e.NodeOnLayer=v;var P,C=function(){function t(t,e,n,o,i){this.key=t,this.isDummy=e,this.from=n,this.to=o,this._originFrom=i}return t.prototype.getHashCode=function(){return this.from+"-"+this.to},Object.defineProperty(t.prototype,"originFrom",{get:function(){return void 0!==this._originFrom?this._originFrom:this.from},enumerable:!0,configurable:!0}),t}();function S(t){return Math.trunc?Math.trunc(t):isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t}e.EdgeOnLayer=C,function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(P||(P={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(23),i=n(17),r=function(){function t(){}return t.onEventAttachingToDocument=function(e,n){return!o.Browser.MacOSMobilePlatform||!t.isTouchEventName(e)||(t.documentTouchHandlers[e]||(t.documentTouchHandlers[e]=[]),t.documentTouchHandlers[e].push(n),t.documentEventAttachingAllowed)},t.isTouchEventName=function(t){return o.Browser.WebKitTouchUI&&(t.indexOf("touch")>-1||t.indexOf("gesture")>-1)},t.isTouchEvent=function(t){return!!t&&(o.Browser.WebKitTouchUI&&i.IsExists(t.changedTouches))},t.getEventX=function(t){return o.Browser.IE?t.pageX:t.changedTouches[0].pageX},t.getEventY=function(t){return o.Browser.IE?t.pageY:t.changedTouches[0].pageY},t.touchMouseDownEventName=o.Browser.WebKitTouchUI?"touchstart":o.Browser.Edge&&o.Browser.MSTouchUI&&window.PointerEvent?"pointerdown":"mousedown",t.touchMouseUpEventName=o.Browser.WebKitTouchUI?"touchend":o.Browser.Edge&&o.Browser.MSTouchUI&&window.PointerEvent?"pointerup":"mouseup",t.touchMouseMoveEventName=o.Browser.WebKitTouchUI?"touchmove":o.Browser.Edge&&o.Browser.MSTouchUI&&window.PointerEvent?"pointermove":"mousemove",t.msTouchDraggableClassName="dxMSTouchDraggable",t.documentTouchHandlers={},t.documentEventAttachingAllowed=!0,t}();e.TouchUIHelper=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e){this.id=t,this.key=e}}();e.NativeItem=r;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r);e.NativeShape=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r);e.NativeConnector=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(13),s=n(12),a=n(18),c=n(15),u=function(t){function e(e,n,o,i,r,s,a,c,u,p){var h=t.call(this,r,"",a,p)||this;return h.x=e,h.y=n,h.text=o,h.width=i,h.reverseTextAhchor=s,h.rotated=u,h.filterId=c,h.textSegmens=h.text.split("\n").filter(function(t){return t}),h}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(s.svgNS,"text")},e.prototype.applyElementProperties=function(e){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.filterId&&e.setAttribute("filter",c.RenderUtils.getUrlPathById(this.filterId)),t.prototype.applyElementProperties.call(this,e),e.getAttribute("appliedText")!==this.text||e.getAttribute("appliedWidth")!==(this.width&&this.width.toString())?(this.createTSpanElements(e),e.setAttribute("appliedText",this.text),e.setAttribute("appliedWidth",this.width&&this.width.toString())):this.prepareTSpanElements(e),this.rotated&&(e.setAttribute("class","rotated"),e.style.setProperty("transform-origin",("number"==typeof this.x?r.UnitConverter.twipsToPixels(this.x)+"px":this.x)+" "+("number"==typeof this.y?r.UnitConverter.twipsToPixels(this.y)+"px":this.y)))},e.prototype.createTSpanElements=function(t){var e=this;c.RenderUtils.removeContent(t),this.textSegmens.forEach(function(n,o){var i=e.createTSpanElement(t);if(e.width)for(var r=n.split(" "),s="",a="",u=0;u=e.width&&""!==a?(i.textContent=a,a=s=r[u],(i=e.createTSpanElement(t)).textContent=s):a=s}else i.textContent=n});var n=t.firstChild;n&&this.prepareFirstTSpanElement(n,t.childNodes.length)},e.prototype.createTSpanElement=function(t){var e=document.createElementNS(s.svgNS,"tspan");return t.appendChild(e),this.prepareTSpanElement(e),e},e.prototype.prepareTSpanElements=function(t){for(var e=0;e0&&(o.position.x=o.left+i.left+e.getTextMargins()),i.top>0&&(o.position.y=o.top+i.top+e.getTextMargins()),o.size.width=o.width-i.right-i.left-2*e.getTextMargins(),o.size.height=o.height-i.bottom-i.top-2*e.getTextMargins(),o.position.x+=e.getTextMargins(),o.position.y+=e.getTextMargins(),(i.left>0||i.right>0)&&(o.size.width=Math.max(o.width-e.getTextMargins(),0)),(i.top>0||i.bottom>0)&&(o.size.height=Math.max(o.height-e.getTextMargins(),0)),o},e.prototype.createTextPrimitives=function(e,n){return n?this.createGraphicalTextRepresentation(e.rectangle):t.prototype.createTextPrimitives.call(this,e,n)},e.prototype.createGraphicalTextRepresentation=function(t){var e=s.Rectangle.create(0,0,0,0),n=this.getTextBlockOffset(t,!0);if(n.left>0||n.right>0){var o=n.left>0?t.width/2:0;e.position.x=t.left+o+1.5*a.ShapeWithImageDescription.getImageMargins(!0),e.position.y=t.top+2.5*a.ShapeWithImageDescription.getImageMargins(!0),e.size.width=(n.left||n.right)-2*a.ShapeWithImageDescription.getImageMargins(!0),e.size.height=t.height-4*a.ShapeWithImageDescription.getImageMargins(!0)}else{var i=n.top>0?t.height/2:0;e.position.x=t.left+t.width/2-(t.width/2+1)/2,e.position.y=t.top+i+1.5*a.ShapeWithImageDescription.getImageMargins(!0),e.size.width=t.width/2+1,e.size.height=(n.top||n.bottom)-2*a.ShapeWithImageDescription.getImageMargins(!0)}return this.createTextRepresentationPrimitives(e)},e.prototype.createTextRepresentationPrimitives=function(t){var e=u.UnitConverter.pixelsToTwips(u.UnitConverter.twipsToPixels(t.height/3));return[new h.GroupPrimitive([new p.PathPrimitive([new p.PathPrimitiveMoveToCommand(t.left,t.top),new p.PathPrimitiveLineToCommand(t.left+t.width,t.top)]),new p.PathPrimitive([new p.PathPrimitiveMoveToCommand(t.left,t.top+e),new p.PathPrimitiveLineToCommand(t.left+t.width,t.top+e)]),new p.PathPrimitive([new p.PathPrimitiveMoveToCommand(t.left,t.top+2*e),new p.PathPrimitiveLineToCommand(t.left+.66*t.width,t.top+2*e)])],"dxdi-shape-text")]},e}(a.ShapeWithImageDescription);e.CardBaseDescription=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=function(t){return t.toString()});var n=this;this.items=[],this.map={},this.getHashCode=e,t.forEach(function(t){return n.tryPush(t)})}return t.prototype.tryPush=function(t){var e=this.getHashCode(t);return void 0===this.map[e]&&(this.map[e]=this.items.push(t)-1,!0)},t.prototype.contains=function(t){return void 0!==this.map[this.getHashCode(t)]},t.prototype.forEach=function(t){this.items.forEach(t)},t.prototype.filter=function(t){return this.items.filter(t)},t.prototype.list=function(){return this.items.slice(0)},t.prototype.item=function(t){return this.items[t]},t.prototype.first=function(){return this.items[0]},t.prototype.remove=function(t){var e=this.getHashCode(t),n=this.map[e];if("number"!=typeof n)throw"Item not found";delete this.map[e],this.items.splice(n,1);for(var o=n;on;o--)t[o]=t[o-1];t[n]=e}else t.push(e)},t.ArrayRemove=function(e,n){var o=t.ArrayIndexOf(e,n);o>-1&&t.ArrayRemoveAt(e,o)},t.ArrayRemoveAt=function(t,e){if(e>=0&&e0;)t.pop()},t.ArrayIndexOf=function(t,e,n){if(n){for(o=0;o=0},t.ArrayEqual=function(t,e){var n=t.length;if(n!=e.length)return!1;for(var o=0;on?o=1:t=n?0:o>1),u=i(e,c,n);if(0==u)return c;u<0?r=c+1:a=c-1}return-(r+1)},t.ArrayFlatten=function(t){return[].concat.apply([],t)},t.GetDistinctArray=function(e){for(var n=[],o=0;o1,r=t.getSelectedShapes(!0),s=t.getSelectedConnectors(!0);r.forEach(function(t){return e.getOrCreateShapeSelection(t,o).onSelectionChanged(i)}),s.forEach(function(t){return e.getOrCreateConnectorSelection(t,o).onSelectionChanged(i)}),i&&this.getOrCreateMultipleSelection(o).onSelectionChanged(!!r.length,n),this.hideOutdatedSelection(o)},n.prototype.notifyModelChanged=function(t){var e=this,n=this.getMultipleSelection();t.forEach(function(t){t.item instanceof l.Shape?e.updateShapeSelection(t.item,n):t.item instanceof d.Connector&&e.updateConnectorSelection(t.item,n)}),n&&n.onModelChanged()},n.prototype.notifyPageColorChanged=function(t){},n.prototype.notifyPageSizeChanged=function(t,e){},n.prototype.notifyActualZoomChanged=function(t){var e=this;Object.keys(this.selectionMap).forEach(function(n){return e.selectionMap[n].notifyZoomChanged(t)}),this.actualZoom=t},n.prototype.notifyViewAdjusted=function(t){},n.prototype.notifyReadOnlyChanged=function(t){var e=this;this.readOnly=t,Object.keys(this.selectionMap).forEach(function(n){return e.selectionMap[n].notifyReadOnlyChanged(t)})},n.prototype.notifySelectionRectShow=function(t){this.showSelectionRect(t.multiply(this.actualZoom))},n.prototype.notifySelectionRectHide=function(){this.hideSelectionRect()},n.prototype.notifyResizeInfoShow=function(t,e){this.showResizeInfo(t.multiply(this.actualZoom),e)},n.prototype.notifyResizeInfoHide=function(){this.hideResizeInfo()},n.prototype.notifyConnectionPointsShow=function(t,e,o,i){var r=this;this.hideConnectionPoints(),e.forEach(function(e,s){var a=e.point.multiply(r.actualZoom);if(i)switch(e.side){case u.ConnectionPointSide.North:a.y-=n.connectionPointShift;break;case u.ConnectionPointSide.South:a.y+=n.connectionPointShift;break;case u.ConnectionPointSide.East:a.x+=n.connectionPointShift;break;case u.ConnectionPointSide.West:a.x-=n.connectionPointShift}r.showConnectionPoint(s,a,e.side,t,s,s===o)})},n.prototype.notifyConnectionPointsHide=function(){this.hideConnectionPoints()},n.prototype.notifyConnectionTargetShow=function(t,e){var o=n.correctShapeSelectionRect(e.multiply(this.actualZoom),n.connectionTargetBorderWidth,this.actualZoom);this.showConnectionTarget(0,o)},n.prototype.notifyConnectionTargetHide=function(){this.hideConnectionTarget()},n.prototype.notifyContainerTargetShow=function(t,e){var o=n.correctShapeSelectionRect(e.multiply(this.actualZoom),n.connectionTargetBorderWidth,this.actualZoom);this.showContainerTarget(0,o)},n.prototype.notifyContainerTargetHide=function(){this.hideContainerTarget()},n.prototype.notifyExtensionLinesShow=function(t){var e=this;this.hideExtensionLines(),t.forEach(function(t,n){e.showExtensionLine(n,t.type,t.segment.startPoint.multiply(e.actualZoom),t.segment.endPoint.multiply(e.actualZoom),t.text)})},n.prototype.notifyExtensionLinesHide=function(){this.hideExtensionLines()},n.prototype.notifyDragStart=function(t){this.selectionMarksContainer.style.display="none"},n.prototype.notifyDragEnd=function(t){this.selectionMarksContainer.style.display=""},n.prototype.notifyDragScrollStart=function(){},n.prototype.notifyDragScrollEnd=function(){},n.prototype.notifyTextInputStart=function(t,e,n,o){this.visualizersContainer.style.display="none"},n.prototype.notifyTextInputEnd=function(t){this.visualizersContainer.style.display=""},n.correctShapeSelectionRect=function(t,e,n){var o=Math.ceil(l.Shape.lineWidth/2*n);t=t.inflate(o,o);var i=Math.floor(e/2);return t.position.x-=i,t.position.y-=i,t.size.width+=e,t.size.height+=e,t},n.selectionMarkSize=w.UnitConverter.pixelsToTwips(10),n.lockedSelectionMarkSize=w.UnitConverter.pixelsToTwips(8),n.selectionRectLineWidth=w.UnitConverter.pixelsToTwips(1),n.multiSelectionRectLineWidth=w.UnitConverter.pixelsToTwips(1),n.connectionPointSmallSize=w.UnitConverter.pixelsToTwips(5),n.connectionPointLargeSize=w.UnitConverter.pixelsToTwips(12),n.connectionPointShift=w.UnitConverter.pixelsToTwips(16),n.connectionTargetBorderWidth=w.UnitConverter.pixelsToTwips(2),n.connectorSelectionLineWidth=w.UnitConverter.pixelsToTwips(1),n.connectorSelectionWidth=w.UnitConverter.pixelsToTwips(6),n.geomertyMarkSize=w.UnitConverter.pixelsToTwips(8),n.connectorPointMarkSize=w.UnitConverter.pixelsToTwips(6),n.connectorSideMarkSize=w.UnitConverter.pixelsToTwips(6),n.extensionLineWidth=w.UnitConverter.pixelsToTwips(1),n.extensionLineOffset=w.UnitConverter.pixelsToTwips(1),n.extensionLineEndingSize=w.UnitConverter.pixelsToTwips(6),n.resizeInfoOffset=w.UnitConverter.pixelsToTwips(16),n.resizeInfoTextOffset=w.UnitConverter.pixelsToTwips(2),n.resizeInfoLineWidth=w.UnitConverter.pixelsToTwips(1),n}(r.CanvasManagerBase);e.CanvasSelectionManager=b;var x=function(){function t(t,e,n,o,i){this.rectsContainer=t,this.marksContainer=e,this.key=n,this.zoomLevel=o,this.readOnly=i,this.elements={},this.updatedElements={}}return t.prototype.notifyZoomChanged=function(t){this.zoomLevel!==t&&(this.zoomLevel=t,this.redraw())},t.prototype.notifyReadOnlyChanged=function(t){this.readOnly=t,this.redraw()},t.prototype.destroy=function(){var t=this;Object.keys(this.elements).forEach(function(e){t.elements[e].parentNode.removeChild(t.elements[e]),delete t.elements[e]})},t.prototype.redraw=function(){var t=this;this.updatedElements={},this.redrawCore(),Object.keys(this.elements).filter(function(e){return!t.updatedElements[e]}).forEach(function(e){t.elements[e].parentNode.removeChild(t.elements[e]),delete t.elements[e]}),this.updatedElements={}},t.prototype.drawSelectionMarks=function(t,n,o){if(!this.readOnly){var i=n&&t.height>3*b.selectionMarkSize,r=o&&t.width>3*b.selectionMarkSize,s=n||o;s&&this.drawSelectionMark(0,new p.Point(t.left,t.top),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_NW,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),r&&!_.Browser.TouchUI&&this.drawSelectionMark(1,new p.Point(t.left+t.size.width/2,t.top),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_N,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),s&&this.drawSelectionMark(2,new p.Point(t.right,t.top),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_NE,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),i&&!_.Browser.TouchUI&&this.drawSelectionMark(3,new p.Point(t.right,t.top+t.size.height/2),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_E,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),s&&this.drawSelectionMark(4,new p.Point(t.right,t.bottom),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_SE,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),r&&!_.Browser.TouchUI&&this.drawSelectionMark(5,new p.Point(t.left+t.size.width/2,t.bottom),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_S,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),s&&this.drawSelectionMark(6,new p.Point(t.left,t.bottom),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_SW,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),i&&!_.Browser.TouchUI&&this.drawSelectionMark(7,new p.Point(t.left,t.top+t.size.height/2),b.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_W,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK)}},t.prototype.drawSelectionMark=function(t,e,n,o,i,r){var s=this;this.getOrCreateElement("SM"+t,new y.RectanglePrimitive(e.x-n/2,e.y-n/2,n,n,null,r,void 0,function(t){a.RenderUtils.setElementEventData(t,o,s.key,i)}),this.marksContainer)},t.prototype.drawSelectionRect=function(t,e,n){var o=new y.RectanglePrimitive(t.left,t.top,t.width,t.height,null,n,void 0,function(t){a.RenderUtils.setElementEventData(t,e,"-1",-1)});this.getOrCreateElement("shapeSelection",o,this.rectsContainer)},t.prototype.getOrCreateElement=function(t,e,n){var o=this.elements[t];return o||(o=e.createElement(),this.elements[t]=o,n.appendChild(o)),this.updatedElements[t]=!0,e.applyElementProperties(o),o},t}(),I=function(t){function n(e,n,o,i,r,s,a){var c=t.call(this,e,n,o,i,r)||this;return c.isLocked=s,c.rectangle=a,c}return i(n,t),n.prototype.onSelectionChanged=function(t){this.isMultipleSelection!==t&&(this.isMultipleSelection=t,this.redraw())},n.prototype.redrawCore=function(){var t=this.rectangle.multiply(this.zoomLevel);this.isLockedRender()?this.drawLockedSelection(t):this.drawUnlockedSelection(t)},n.prototype.isLockedRender=function(){return this.isLocked&&!this.readOnly},n.prototype.drawLockedSelection=function(t){this.drawLockedSelectionMark(0,new p.Point(t.left,t.top),b.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK),this.drawLockedSelectionMark(1,new p.Point(t.right,t.top),b.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK),this.drawLockedSelectionMark(2,new p.Point(t.right,t.bottom),b.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK),this.drawLockedSelectionMark(3,new p.Point(t.left,t.bottom),b.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK)},n.prototype.drawLockedSelectionMark=function(t,e,n,o){var i=new m.PathPrimitive([new m.PathPrimitiveMoveToCommand(e.x-n/2,e.y-n/2),new m.PathPrimitiveLineToCommand(e.x+n/2,e.y+n/2),new m.PathPrimitiveMoveToCommand(e.x+n/2,e.y-n/2),new m.PathPrimitiveLineToCommand(e.x-n/2,e.y+n/2)],null,o);this.getOrCreateElement("LSM"+t,i,this.marksContainer)},n}(x),O=function(t){function n(e,n,o,i){var r=t.call(this,e,n,"-1",o,i)||this;return r.items={},r}return i(n,t),n.prototype.onModelItemChanged=function(t,e){t in this.items&&(this.items[t]=e)},n.prototype.onModelChanged=function(){this.redraw()},n.prototype.onSelectionChanged=function(t,e){var n=this;this.containsShapes=t,this.items={},e.forEach(function(t){return n.items[t.key]=t.rectangle}),this.redraw()},n.prototype.redrawCore=function(){var t=this,n=p.GeometryUtils.getCommonRectangle(Object.keys(this.items).map(function(e){return t.items[e]})),o=b.correctShapeSelectionRect(n.multiply(this.zoomLevel),b.selectionRectLineWidth,this.zoomLevel);this.drawSelectionRect(o,c.MouseEventElementType.SelectionRect,e.SELECTION_ELEMENT_CLASSNAMES.ITEMS_SELECTION_RECT),this.containsShapes&&this.drawSelectionMarks(o,!0,!0)},n}(x),E=function(t){function n(e,n,o,i,r,s,a,c,u,p){var h=t.call(this,e,n,r,o,i,s,a)||this;return h.allowResizeHorizontally=c,h.allowResizeVertically=u,h.shapeParameterPoints=p,h}return i(n,t),n.prototype.onModelChanged=function(t,e,n,o,i){this.isLocked=t,this.rectangle=e,this.allowResizeHorizontally=n,this.allowResizeVertically=o,this.shapeParameterPoints=i,this.redraw()},n.prototype.drawUnlockedSelection=function(t){var n=b.correctShapeSelectionRect(t,b.selectionRectLineWidth,this.zoomLevel);this.drawSelectionRect(n,c.MouseEventElementType.SelectionRect,this.isMultipleSelection?e.SELECTION_ELEMENT_CLASSNAMES.ITEM_MULTI_SELECTION:e.SELECTION_ELEMENT_CLASSNAMES.ITEM_SELECTION_RECT),this.isMultipleSelection||this.drawSelectionMarks(t,this.allowResizeHorizontally,this.allowResizeVertically),this.drawShapeParameterPoints()},n.prototype.drawShapeParameterPoints=function(){var t=this;this.readOnly||this.shapeParameterPoints.forEach(function(e,n){var o=e.point.multiply(t.zoomLevel);t.drawShapeParameterPoint(o,n,e.key)})},n.prototype.drawShapeParameterPoint=function(t,e,n){var o=this,i=b.geomertyMarkSize,r=new y.RectanglePrimitive(t.x-i/2,t.y-i/2,i,i,null,"geometry-mark",void 0,function(t){a.RenderUtils.setElementEventData(t,c.MouseEventElementType.ShapeParameterBox,o.key,n)});this.getOrCreateElement("pp"+e.toString(),r,this.marksContainer)},n}(I),M=function(t){function n(e,n,o,i,r,s,a,c,u,p,h,l,d){var f=t.call(this,e,n,r,o,i,s,a)||this;return f.renderPoints=c,f.styleText=u,f.enableText=p,f.texts=h,f.points=l,f.lineType=d,f}return i(n,t),n.prototype.onModelChanged=function(t,e,n,o,i,r,s,a){this.isLocked=t,this.rectangle=e,this.renderPoints=n,this.styleText=o,this.enableText=i,this.texts=r,this.points=s,this.lineType=a,this.redraw()},n.prototype.drawUnlockedSelection=function(t){this.drawConnectorSelection(this.isMultipleSelection?e.SELECTION_ELEMENT_CLASSNAMES.CONNECTOR_MULTI_SELECTION:e.SELECTION_ELEMENT_CLASSNAMES.CONNECTOR_SELECTION),this.isMultipleSelection||this.readOnly||this.drawConnectorSelectionMarks()},n.prototype.drawConnectorSelection=function(t){var n,o,i,r=this,c=this.renderPoints,u=[],p=0,h=0;if(c.forEach(function(t){t=t.multiply(r.zoomLevel),void 0===n?(o=t,u.push(new m.PathPrimitiveMoveToCommand(t.x,t.y))):(u.push(new m.PathPrimitiveLineToCommand(t.x,t.y)),p=Math.max(p,Math.abs(n.x-t.x)),h=Math.max(h,Math.abs(n.y-t.y))),n=t}),i=n,pn}return this.lineType===f.ConnectorLineOption.Orthogonal&&((t.x-e.x==0||Math.abs(t.x-e.x)>d.Connector.minOffset)&&(t.y-e.y==0||Math.abs(t.y-e.y)>d.Connector.minOffset))},n}(I)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.LeftToLeftAbove=0]="LeftToLeftAbove",t[t.LeftToLeftBelow=1]="LeftToLeftBelow",t[t.RightToRightAbove=2]="RightToRightAbove",t[t.RightToRightBelow=3]="RightToRightBelow",t[t.LeftToRightAbove=4]="LeftToRightAbove",t[t.LeftToRightBelow=5]="LeftToRightBelow",t[t.RightToLeftAbove=6]="RightToLeftAbove",t[t.RightToLeftBelow=7]="RightToLeftBelow",t[t.TopToTopBefore=8]="TopToTopBefore",t[t.TopToTopAfter=9]="TopToTopAfter",t[t.BottomToBottomBefore=10]="BottomToBottomBefore",t[t.BottomToBottomAfter=11]="BottomToBottomAfter",t[t.TopToBottomBefore=12]="TopToBottomBefore",t[t.TopToBottomAfter=13]="TopToBottomAfter",t[t.BottomToTopBefore=14]="BottomToTopBefore",t[t.BottomToTopAfter=15]="BottomToTopAfter",t[t.HorizontalCenterAbove=16]="HorizontalCenterAbove",t[t.HorizontalCenterBelow=17]="HorizontalCenterBelow",t[t.VerticalCenterBefore=18]="VerticalCenterBefore",t[t.VerticalCenterAfter=19]="VerticalCenterAfter",t[t.VerticalCenterToPageCenter=20]="VerticalCenterToPageCenter",t[t.HorizontalCenterToPageCenter=21]="HorizontalCenterToPageCenter",t[t.LeftToPageCenter=22]="LeftToPageCenter",t[t.RightToPageCenter=23]="RightToPageCenter",t[t.TopToPageCenter=24]="TopToPageCenter",t[t.BottomToPageCenter=25]="BottomToPageCenter"}(e.ExtensionLineType||(e.ExtensionLineType={}));var o=function(){return function(t,e,n){this.type=t,this.segment=e,this.text=n}}();e.ExtensionLine=o;var i=function(){function t(t){this.dispatcher=t,this.lines=[],this.lineIndexByType={}}return t.prototype.addSegment=function(t,e,n){var i=this.lineIndexByType[t];if(void 0===i){var r=new o(t,e,n),s=this.lines.push(r);this.lineIndexByType[r.type]=s-1,this.raiseShow()}else if(e.distancee.startLimit||Math.abs(this.startPoint.y-t.modelPoint.y)>e.startLimit)&&(this.processOnMouseMoveAfterLimit(t),this.startPoint=void 0)},e.prototype.onMouseUp=function(t){this.onMouseUpCore(t),this.handler.state!==this&&this.handler.state.onMouseUp(t)},e.prototype.onMouseUpCore=function(t){t.source.type===s.MouseEventElementType.Shape&&this.canSelectOnMouseUp(t.source.key)?this.modifySelection(t,t.source.key):t.source.type===s.MouseEventElementType.Connector&&this.canSelectOnMouseUp(t.source.key)?this.modifySelection(t,t.source.key):t.source.type===s.MouseEventElementType.ShapeExpandButton&&this.canSelectOnMouseUp(t.source.key)?this.modifySelection(t,t.source.key):this.startPoint&&this.canClearSelectionOnMouseUp()&&this.clearSelection(),this.startPoint=void 0},e.prototype.onMouseWheel=function(t){return!!(t.modifiers&a.ModifierKey.Ctrl)&&(this.handler.switchState(new p.MouseHandlerZoomOnWheelState(this.handler,this.settings,this.view,this.bars)),this.handler.state.onMouseWheel(t),!0)},e.prototype.onLongTouch=function(t){this.modifySelection(t,t.source.key,!0)},e.prototype.onConnectorMouseDown=function(t){this.modifySelection(t,t.source.key)},e.prototype.onShapeMouseDown=function(t){this.modifySelection(t,t.source.key)},e.prototype.onShapeExpandBtnMouseDown=function(t){this.modifySelection(t,t.source.key),this.handler.switchState(new c.MouseHandlerToggleShapeExpandedState(this.handler,this.history,this.model))},e.prototype.finish=function(){this.startPoint=void 0},e.prototype.startSelection=function(t){this.handler.switchState(new u.MouseHandlerSelectionState(this.handler,this.selection,this.visualizerManager))},e.prototype.startScrolling=function(t){this.handler.switchState(new h.MouseHandlerScrollingState(this.handler,this.view,this.selection))},e.prototype.modifySelection=function(t,e,n){this.isMultipleSelectionModifier(t)||n?this.selection.hasKey(e)?this.selection.remove(e):this.selection.add(e):this.selection.hasKey(e)||this.selection.set([e])},e.prototype.clearSelection=function(){this.selection.set([])},e.prototype.inSelection=function(t){return this.selection.hasKey(t)},e.prototype.isMultipleSelectionModifier=function(t){return t.modifiers&a.ModifierKey.Ctrl||t.modifiers&a.ModifierKey.Shift},e.startLimit=l.UnitConverter.pixelsToTwips(1),e}(r.MouseHandlerStateBase);e.MouseHandlerDefaultStateBase=d},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(32),s=n(10),a=n(0),c=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.view=n,i.selection=o,i.lastOffset=new a.Point(0,0),i}return i(e,t),e.prototype.onMouseDown=function(t){t.preventDefault=!0,this.startPoint=this.getPointByEvent(t)},e.prototype.onMouseMove=function(t){if(t.button===s.MouseButton.Left){var e=this.currentPoint||this.startPoint;t.preventDefault=!0;var n=this.getPointByEvent(t),o=this.view.scrollBy(new a.Point(n.x-e.x,n.y-e.y));this.lastOffset=this.lastOffset.offset(o.x,o.y),this.currentPoint=n}else this.handler.switchToDefaultState()},e.prototype.onMouseUp=function(t){this.handler.switchToDefaultState()},e.prototype.cancelChanges=function(){this.currentPoint&&this.view.scrollBy(this.lastOffset.multiply(-1))},e.prototype.start=function(){this.handler.raiseDragScrollStart(),t.prototype.start.call(this)},e.prototype.finish=function(){this.handler.raiseDragScrollEnd(),this.currentPoint&&this.startPoint&&!this.currentPoint.equals(this.startPoint)||this.selection.set([]),t.prototype.finish.call(this)},e.prototype.getPointByEvent=function(t){return t.offsetPoint},e}(r.MouseHandlerCancellableState);e.MouseHandlerScrollingState=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.canDragObjectOnMouseDown=function(t){return!1},e.prototype.canClearSelectionOnMouseDown=function(){return!1},e.prototype.processOnMouseMoveAfterLimit=function(t){this.startSelection(t)},e.prototype.canSelectOnMouseUp=function(t){return!0},e.prototype.canClearSelectionOnMouseUp=function(){return!0},e}(n(121).MouseHandlerDefaultStateBase);e.MouseHandlerDefaultReadOnlyState=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8),i=function(){function t(){this.contextMenuVisible=!1,this.onVisibilityChanged=new o.EventDispatcher}return t.prototype.onMouseDown=function(t){},t.prototype.onMouseUp=function(t){this.hideContextMenu()},t.prototype.onContextMenu=function(t){this.showContextMenu(t.eventPoint,t.modelPoint)},t.prototype.onFocus=function(t){},t.prototype.onBlur=function(t){},t.prototype.onTextInputFocus=function(t){},t.prototype.onTextInputBlur=function(t){},t.prototype.onLongTouch=function(t){},t.prototype.showContextMenu=function(t,e){this.onVisibilityChanged.raise1(function(n){return n.notifyShowContextMenu(t,e)}),this.contextMenuVisible=!0},t.prototype.hideContextMenu=function(){this.contextMenuVisible&&(this.onVisibilityChanged.raise1(function(t){return t.notifyHideContextMenu()}),this.contextMenuVisible=!1)},t.prototype.notifyDragStart=function(t){},t.prototype.notifyDragEnd=function(t){},t.prototype.notifyDragScrollStart=function(){},t.prototype.notifyDragScrollEnd=function(){},t}();e.ContextMenuHandler=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(287),i=n(288),r=n(88),s=n(8),a=n(19),c=n(10),u=n(289),p=n(11),h=n(0),l=n(87),d=n(6),f=n(290),y=n(291),m=function(){function t(t,e,n,a,c){void 0===c&&(c=a.readOnly),this.selection=t,this.model=e,this.eventManager=n,this.settings=a,this.readOnly=c,this.onVisualizersUpdate=new s.EventDispatcher,this.connectionPointsVisualizer=new u.ConnectionPointsVisualizer(this.onVisualizersUpdate),this.connectionPointsVisualizer=new u.ConnectionPointsVisualizer(this.onVisualizersUpdate),this.connectionTargetVisualizer=new o.ConnectionTargetVisualizer(this.onVisualizersUpdate),this.containerTargetVisualizer=new i.ContainerTargetVisualizer(this.onVisualizersUpdate),this.extensionLinesVisualizer=new r.ExtensionLinesVisualizer(this.onVisualizersUpdate),this.resizeInfoVisualizer=new f.ResizeInfoVisualizer(this.onVisualizersUpdate),this.selectionRectangleVisualizer=new y.SelectionRectVisualizer(this.onVisualizersUpdate)}return t.prototype.initialize=function(t){this.model=t},t.prototype.onMouseDown=function(t){},t.prototype.onMouseUp=function(t){},t.prototype.onMouseEnter=function(t){},t.prototype.onMouseLeave=function(t){this.resetConnectionPoints(),this.resetConnectionTarget(),this.resetExtensionLines(),this.resetContainerTarget(),this.resetResizeInfo(),this.resetSelectionRectangle()},t.prototype.onBlur=function(t){},t.prototype.onFocus=function(t){},t.prototype.updateConnections=function(t,e,n){var o=-1;n&&e===c.MouseEventElementType.ShapeConnectionPoint&&(o=parseInt(n)),this.setConnectionPoints(t,e,o)},t.prototype.setConnectionPoints=function(t,e,n,o){if(this.eventManager.isFocused())if(!t||t.isLocked||e!==c.MouseEventElementType.Shape&&e!==c.MouseEventElementType.ShapeResizeBox&&e!==c.MouseEventElementType.ShapeConnectionPoint||void 0===t)this.connectionPointsVisualizer.reset();else{var i=t.key,r=this.selection.hasKey(i),s=r?t.getConnectionPointsForSelection():t.getConnectionPoints();this.connectionPointsVisualizer.setPoints(i,s.map(function(e){return new u.ConnectionPointInfo(e,r?t.getConnectionPointForSelectionSide(e):t.getConnectionPointSide(e))}),n,r&&!o)}},t.prototype.setConnectionPointIndex=function(t){this.connectionPointsVisualizer.setPointIndex(t)},t.prototype.updateConnectionPoints=function(){void 0!==this.model.findItem(this.connectionPointsVisualizer.getKey())?this.connectionPointsVisualizer.update():this.connectionPointsVisualizer.reset()},t.prototype.resetConnectionPoints=function(){this.connectionPointsVisualizer.reset()},t.prototype.setConnectionTarget=function(t,e){!t||t.isLocked||e!==c.MouseEventElementType.Shape&&e!==c.MouseEventElementType.ShapeConnectionPoint?this.connectionTargetVisualizer.reset():this.connectionTargetVisualizer.setTargetRect(t.key,t.rectangle)},t.prototype.resetConnectionTarget=function(){this.connectionTargetVisualizer.reset()},t.prototype.setContainerTarget=function(t,e){t&&!t.isLocked&&e===c.MouseEventElementType.Shape&&t.enableChildren?this.containerTargetVisualizer.setTargetRect(t.key,t.rectangle):this.containerTargetVisualizer.reset()},t.prototype.resetContainerTarget=function(){this.containerTargetVisualizer.reset()},t.prototype.setExtensionLines=function(t){var e=this;if(this.eventManager.isFocused()){this.extensionLinesVisualizer.reset();var n=a.DiagramModel.getRectangle(t.filter(function(t){return t}));this.addPageExtensionLines(n),this.model.items.forEach(function(o){t.indexOf(o)>-1||o instanceof p.Shape&&e.addShapeExtensionLines(o,n)})}},t.prototype.addPageExtensionLines=function(t){for(var e=Math.round(this.model.size.width/this.model.pageWidth),n=Math.round(this.model.size.height/this.model.pageHeight),o=0;oa.right&&(n=e.left-l.CanvasSelectionManager.extensionLineOffset,i=a.right+c+l.CanvasSelectionManager.extensionLineOffset),e.bottoma.bottom&&(o=e.top-l.CanvasSelectionManager.extensionLineOffset,s=a.bottom+c+l.CanvasSelectionManager.extensionLineOffset),null!=n&&void 0!==i){if(e.center.y===a.center.y){var d=new h.Segment(new h.Point(n,e.center.y),new h.Point(i,a.center.y));this.extensionLinesVisualizer.addSegment(n>i?r.ExtensionLineType.VerticalCenterAfter:r.ExtensionLineType.VerticalCenterBefore,d,u?this.getViewUnitText(d.distance):""),u=!1}if(e.top===a.top){d=new h.Segment(new h.Point(n,e.top),new h.Point(i,a.top));this.extensionLinesVisualizer.addSegment(n>i?r.ExtensionLineType.TopToTopAfter:r.ExtensionLineType.TopToTopBefore,d,u?this.getViewUnitText(d.distance):"")}if(e.bottom===a.bottom){d=new h.Segment(new h.Point(n,e.bottom+c),new h.Point(i,a.bottom+c));this.extensionLinesVisualizer.addSegment(n>i?r.ExtensionLineType.BottomToBottomAfter:r.ExtensionLineType.BottomToBottomBefore,d,u?this.getViewUnitText(d.distance):"")}if(e.top===a.bottom){d=new h.Segment(new h.Point(n,e.top),new h.Point(i,a.bottom+c));this.extensionLinesVisualizer.addSegment(n>i?r.ExtensionLineType.TopToBottomAfter:r.ExtensionLineType.TopToBottomBefore,d,u?this.getViewUnitText(d.distance):"")}if(e.bottom===a.top){d=new h.Segment(new h.Point(n,e.bottom+c),new h.Point(i,a.top));this.extensionLinesVisualizer.addSegment(n>i?r.ExtensionLineType.BottomToTopAfter:r.ExtensionLineType.BottomToTopBefore,d,u?this.getViewUnitText(d.distance):"")}}if(null!=o&&void 0!==s){if(e.center.x===a.center.x){d=new h.Segment(new h.Point(e.center.x,o),new h.Point(a.center.x,s));this.extensionLinesVisualizer.addSegment(o>s?r.ExtensionLineType.HorizontalCenterBelow:r.ExtensionLineType.HorizontalCenterAbove,d,u?this.getViewUnitText(d.distance):""),u=!1}if(e.left===a.left){d=new h.Segment(new h.Point(e.left,o),new h.Point(a.left,s));this.extensionLinesVisualizer.addSegment(o>s?r.ExtensionLineType.LeftToLeftBelow:r.ExtensionLineType.LeftToLeftAbove,d,u?this.getViewUnitText(d.distance):"")}if(e.right===a.right){d=new h.Segment(new h.Point(e.right+c,o),new h.Point(a.right+c,s));this.extensionLinesVisualizer.addSegment(o>s?r.ExtensionLineType.RightToRightBelow:r.ExtensionLineType.RightToRightAbove,d,u?this.getViewUnitText(d.distance):"")}if(e.left===a.right){d=new h.Segment(new h.Point(e.left,o),new h.Point(a.right+c,s));this.extensionLinesVisualizer.addSegment(o>s?r.ExtensionLineType.LeftToRightBelow:r.ExtensionLineType.LeftToRightAbove,d,u?this.getViewUnitText(d.distance):"")}if(e.right===a.left){d=new h.Segment(new h.Point(e.right+c,o),new h.Point(a.left,s));this.extensionLinesVisualizer.addSegment(o>s?r.ExtensionLineType.RightToLeftBelow:r.ExtensionLineType.RightToLeftAbove,d,u?this.getViewUnitText(d.distance):"")}}},t.prototype.resetExtensionLines=function(){this.extensionLinesVisualizer.reset()},t.prototype.setResizeInfo=function(t){var e=a.DiagramModel.getRectangle(t),n=new h.Point(e.center.x,e.bottom+l.CanvasSelectionManager.resizeInfoOffset),o=this.getViewUnitText(e.width)+" x "+this.getViewUnitText(e.height);this.resizeInfoVisualizer.set(n,o)},t.prototype.resetResizeInfo=function(){this.resizeInfoVisualizer.reset()},t.prototype.setSelectionRectangle=function(t){this.selectionRectangleVisualizer.setRectangle(t)},t.prototype.resetSelectionRectangle=function(){this.selectionRectangleVisualizer.reset()},t.prototype.getViewUnitText=function(t){return d.ModelUtils.getUnitText(this.settings.viewUnits,this.settings.unitItems,this.settings.formatUnit,t)},t.prototype.notifyReadOnlyChanged=function(t){this.readOnly=t},t.prototype.notifyDragStart=function(t){},t.prototype.notifyDragEnd=function(t){},t.prototype.notifyDragScrollStart=function(){},t.prototype.notifyDragScrollEnd=function(){},t}();e.VisualizerManager=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this.dispatcher=t}return t.prototype.getKey=function(){return this.key},t.prototype.setTargetRect=function(t,e){this.key!==t&&(this.key=t,this.targetRect=e,this.raiseShow())},t.prototype.reset=function(){"-1"!==this.key&&(this.key="-1",this.targetRect=void 0,this.raiseHide())},t}();e.TargetVisualizerBase=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this.suspendUpdateCount=0,this.occurredEvents=0}return t.prototype.beginUpdate=function(){0===this.suspendUpdateCount&&this.onUpdateLocked(),this.suspendUpdateCount<0?this.suspendUpdateCount--:this.suspendUpdateCount++},t.prototype.endUpdate=function(){if(this.suspendUpdateCount<0?this.suspendUpdateCount++:this.suspendUpdateCount>0&&this.suspendUpdateCount--,!this.isUpdateLocked()){var t=this.occurredEvents;this.occurredEvents=0,this.onUpdateUnlocked(t)}},t.prototype.suspendUpdate=function(){if(this.suspendUpdateCount>0){this.suspendUpdateCount*=-1;var t=this.occurredEvents;this.occurredEvents=0,this.onUpdateUnlocked(t)}},t.prototype.continueUpdate=function(){this.suspendUpdateCount<0&&(this.suspendUpdateCount*=-1)},t.prototype.isUpdateLocked=function(){return this.suspendUpdateCount>0},t.prototype.onUpdateLocked=function(){},t.prototype.registerOccurredEvent=function(t){this.occurredEvents|=t},t}();e.BatchUpdatableObject=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(39),r=n(17),s=n(62),a=n(8),c=function(){function t(t,e,n){this.readonly=e,this.options=n,this.onDragOperation=new o.EventDispatcher,t&&(this.mainElement=this.createMainElement(t),this.attachHandlers(this.mainElement))}return t.prototype.dispose=function(){this.detachHandlers(this.mainElement)},t.prototype.createMainElement=function(t){var e=document.createElement("div");return e.setAttribute("class","dxdi-toolbox"),t.appendChild(e),e},t.prototype.attachHandlers=function(t){this.onMouseDownHandler=this.onMouseDown.bind(this),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),t.addEventListener(s.TouchUIHelper.touchMouseDownEventName,this.onMouseDownHandler),document.addEventListener(s.TouchUIHelper.touchMouseMoveEventName,this.onMouseMoveHandler),document.addEventListener(s.TouchUIHelper.touchMouseUpEventName,this.onMouseUpHandler)},t.prototype.detachHandlers=function(t){t.removeEventListener(s.TouchUIHelper.touchMouseDownEventName,this.onMouseDownHandler),document.removeEventListener(s.TouchUIHelper.touchMouseMoveEventName,this.onMouseMoveHandler),document.removeEventListener(s.TouchUIHelper.touchMouseUpEventName,this.onMouseUpHandler)},t.prototype.render=function(t){this.mainElement.childNodes&&(this.mainElement.innerHTML="");var e=t?this.options.shapeTypes.filter(t):this.options.shapeTypes;return e.length&&this.createElements(this.mainElement,e),!!e.length},t.prototype.createDraggingObject=function(t){var e=this.getDragShapeType(t);if(void 0!==e){var n=new p;return n.data=e,new u(n)}},t.prototype.getDragShapeType=function(t){for(;t&&!r.ElementHasCssClass(t,"dxdi-toolbox");){if(t.getAttribute("data-tb-type"))return t.getAttribute("data-tb-type");t=t.parentNode}},t.prototype.onMouseDown=function(t){if(!this.readonly){this.mouseDownPoint=new o.Point(i.Evt.GetEventX(t),i.Evt.GetEventY(t)),this.draggingObject=this.createDraggingObject(t.target),this.draggingObject&&(this.draggingObject.evt.onFinishDragging=this.finishDragging.bind(this),this.draggingObject.evt.onCaptured=this.capture.bind(this),this.onDragStart());var e=i.Evt.GetEventSource(t),n=e&&e.tagName;return a.Browser.TouchUI||"img"===n.toLowerCase()||"image"===n.toLowerCase()?i.Evt.PreventEventAndBubble(t):void 0}},t.prototype.onMouseMove=function(t){if(i.Evt.IsLeftButtonPressed(t)?this.draggingObject&&(!this.draggingObject.element&&(Math.abs(i.Evt.GetEventX(t)-this.mouseDownPoint.x)>4||Math.abs(i.Evt.GetEventY(t)-this.mouseDownPoint.y)>4)&&(this.draggingObject.element=this.createDraggingElement(this.draggingObject),void 0!==this.draggingObject.captured&&this.capture(this.draggingObject.captured,!0)),this.draggingObject.element&&this.updateDraggingElementPosition(t)):this.finishDragging(),a.Browser.TouchUI)return i.Evt.PreventEventAndBubble(t)},t.prototype.onMouseUp=function(t){this.finishDragging()},t.prototype.updateDraggingElementPosition=function(t){var e=this.draggingObject.element,n=i.Evt.GetEventX(t)-e.offsetWidth/2,o=i.Evt.GetEventY(t)-e.offsetHeight/2;r.SetAbsoluteX(e,n),r.SetAbsoluteY(e,o)},t.prototype.finishDragging=function(){if(this.draggingObject){this.onDragEnd();var t=this.draggingObject.element;t&&t.parentNode.removeChild(t),delete this.draggingObject}},t.prototype.capture=function(t,e){this.draggingObject&&(this.draggingObject.captured!==t||e)&&(this.draggingObject.captured=t,this.draggingObject.element&&r.ToggleElementClassName(this.draggingObject.element,"dxdi-tb-drag-captured",t))},t.prototype.onDragEnd=function(){this.onDragOperation.raise("notifyToolboxDragEnd")},t.prototype.onDragStart=function(){this.onDragOperation.raise("notifyToolboxDragStart")},t.prototype.notifyReadOnlyChanged=function(t){this.readonly=t},t}();e.Toolbox=c;var u=function(){return function(t){this.evt=t}}();e.ToolboxDraggingObject=u;var p=function(){return function(){}}();e.DiagramDraggingEvent=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(6),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){return t.prototype.isEnabled.call(this)&&!this.control.selection.isEmpty()},e.prototype.executeCore=function(t){return r.ModelUtils.deleteSelection(this.control.history,this.control.model,this.control.selection),!0},e}(n(7).SimpleCommandBase);e.DeleteCommand=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e,o.position=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldPosition=e.position.clone(),t.moveShape(e,this.position)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.moveShape(e,this.oldPosition)},e}(n(3).HistoryItem);e.MoveShapeHistoryItem=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){}return t.stringCompare=function(t,e){return t==e?0:t>e?1:-1},t.stringHashCode=function(t){var e=0;if(0===t.length)return e;for(var n=t.length,o=0;o=i;n--,o--)if(t[n]!=e[o])return!1;return!0},t.startsAt=function(t,e){return t.substr(0,e.length)==e},t.stringInLowerCase=function(t){return t.toLowerCase()==t},t.stringInUpperCase=function(t){return t.toUpperCase()==t},t.inStringAtLeastOneSymbolInUpperCase=function(e){for(var n,o=0;n=e[o];o++)if(t.stringInUpperCase(n)&&!t.stringInLowerCase(n))return!0;return!1},t.getSymbolFromEnd=function(t,e){return t[t.length-e]},t.stringTrim=function(t,e){void 0===e&&(e=["\\s"]);var n=e.join("");return t.replace(new RegExp("(^["+n+"]*)|(["+n+"]*$)","g"),"")},t.stringTrimStart=function(t){return t.replace(/(^\s*)/g,"")},t.stringTrimEnd=function(t,e){return void 0===e&&(e="\\s"),t.replace(new RegExp(e+"*$"),"")},t.stringCustomTrim=function(t,e){for(var n=0,o=e;ne?1:-1},t.repeat=function(t,e){for(var n="",o=1;o<=e;o++)n+=t;return n},t.isNullOrEmpty=function(t){return!t||!t.length},t.padLeft=function(e,n,o){return t.mergeStringNTimes(o,Math.max(0,n-e.length))+e},t}();e.StringUtils=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),i=function(){function t(){}return t.TrimStart=function(e){return t.trimInternal(e,!0,!1)},t.TrimEnd=function(e){return t.trimInternal(e,!1,!0)},t.Trim=function(e){return t.trimInternal(e,!0,!0)},t.EncodeHtml=function(e){return t.ApplyReplacement(e,[[/&/g,"&x;"],[/&/g,"&"],[/"/g,""x;"],[/"/g,"""],[/</g,"<x;"],[//g,">"]])},t.trimInternal=function(e,n,o){var i=e.length;if(!i)return e;if(i<764833){var r=e;return n&&(r=r.replace(/^\s+/,"")),o&&(r=r.replace(/\s+$/,"")),r}var s=0;if(o)for(;i>0&&t.whiteSpaces[e.charCodeAt(i-1)];)i--;if(n&&i>0)for(;s=11},t.EmptyObject={},t.RestoreStyleAttribute=function(e,n){return t.RestoreAttributeExtended(e.style,n,e,"saved"+n)},t}();e.Attr=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=n(17),r=function(){function t(t){this.onScroll=new o.EventDispatcher,this.scrollBarWidth=i.GetVerticalScrollBarWidth(),this.mainElement=t,this.attachEvents()}return t.prototype.dispose=function(){this.detachEvents()},t.prototype.attachEvents=function(){var t=this;this.onScrollHandler=function(){return t.onScroll.raise1(function(t){return t.notifyScrollChanged()})},this.mainElement.addEventListener("scroll",this.onScrollHandler)},t.prototype.detachEvents=function(){this.mainElement.removeEventListener("scroll",this.onScrollHandler)},t.prototype.setScroll=function(t,e){this.mainElement.style.overflow="scroll",this.mainElement.scrollLeft=t,this.mainElement.scrollTop=e,this.mainElement.style.overflow=""},t.prototype.offsetScroll=function(t,e){t&&(this.mainElement.scrollLeft+=t),e&&(this.mainElement.scrollTop+=e)},t.prototype.getScroll=function(){return new o.Point(this.mainElement.scrollLeft,this.mainElement.scrollTop)},t.prototype.getSize=function(){var t=this.mainElement.getBoundingClientRect();return new o.Size(Math.floor(t.width),Math.floor(t.height))},t.prototype.getScrollBarWidth=function(){return this.scrollBarWidth},t.prototype.getScrollSize=function(){return new o.Size(this.mainElement.scrollWidth,this.mainElement.scrollHeight)},t}();e.NativeScrollView=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),i=n(8),r=n(15),s=n(10),a=n(11),c=n(5),u=n(39),p=n(16),h=function(){function t(t,e,n,o,i){this.mainElement=e,this.layoutPointResolver=n,this.eventManager=o,this.actualZoom=i,this.focused=!1,this.focusLocked=!1,this.createInputElements(t)}return t.prototype.dispose=function(){this.detachInputElementEvents(),this.detachTextInputElementEvents()},t.prototype.isFocused=function(){return this.focused},t.prototype.captureFocus=function(t,e){var n=t||this.inputElement;n.focus({preventScroll:!0}),e&&window.setTimeout(function(){if(window.getSelection){var t=window.getSelection(),e=document.createRange();e.selectNodeContents(n),t.removeAllRanges(),t.addRange(e)}},100)},t.prototype.setClipboardData=function(t){this.clipboardInputElement.value=t,this.clipboardInputElement.focus({preventScroll:!0}),this.clipboardInputElement.select(),document.execCommand("copy"),this.captureFocus()},t.prototype.getClipboardData=function(t){var e=this;navigator&&navigator.clipboard?navigator.clipboard.readText().then(function(n){t(n),e.captureFocus()}).catch(function(){t(""),e.captureFocus()}):i.Browser.IE&&(this.clipboardInputElement.value="",this.clipboardInputElement.focus({preventScroll:!0}),this.clipboardInputElement.select(),document.execCommand("Paste"),t(this.clipboardInputElement.value),this.captureFocus())},t.prototype.isPasteSupportedByBrowser=function(){return i.Browser.IE||i.Browser.WebKitFamily&&navigator&&void 0!==navigator.clipboard},t.prototype.createInputElements=function(t){this.createInputElement(t),this.createTextInputElement(t),this.createClipboardInputElement(t)},t.prototype.setInputElementFocusHandlerMode=function(){this.textInputElementContainer.setAttribute("class","dxdi-text-input-container"),this.captureFocus()},t.prototype.setInputElementTextInputMode=function(t,e,n,o,r){this.textInputElementContainer.setAttribute("class","dxdi-text-input-container "+r),this.textInputElement.innerText=t,!i.Browser.Firefox||t&&""!==t||(this.textInputElement.innerHTML=" "),this.setTextInputElementBounds(e,n),this.setTextInputElementStyle(o),this.captureFocus(this.textInputElement,!0)},t.prototype.setTextInputElementBounds=function(t,e){var n=this.layoutPointResolver.getAbsolutePoint(t);e=e&&e.transform(i.UnitConverter.twipsToPixels),o.SetAbsoluteX(this.textInputElementContainer,o.GetAbsolutePositionX(this.mainElement)+n.x),o.SetAbsoluteY(this.textInputElementContainer,o.GetAbsolutePositionY(this.mainElement)+n.y),this.textInputElementContainer.style.width=void 0!==e?e.width+"px":"0px",this.textInputElementContainer.style.height=void 0!==e?e.height+"px":"0px",this.textInputElementContainer.style.transform="scale("+this.actualZoom+")",this.textInputElement.style.width=void 0!==e?e.width+"px":"",this.textInputElement.style.height=void 0!==e?e.height+"px":"auto"},t.prototype.setTextInputElementStyle=function(t){r.RenderUtils.applyStyleToElement(t,this.textInputElement)},t.prototype.createInputElement=function(t){this.inputElement=document.createElement("textarea"),this.inputElement.readOnly=!0,this.inputElement.setAttribute("class","dxdi-focus-input"),this.attachInputElementEvents(),t.appendChild(this.inputElement)},t.prototype.attachInputElementEvents=function(){this.onInputBlurHandler=this.onInputBlur.bind(this),this.onInputFocusHandler=this.onInputFocus.bind(this),this.onInputKeyDownHandler=this.onInputKeyDown.bind(this),this.onPasteHandler=this.onPaste.bind(this),this.inputElement.addEventListener("blur",this.onInputBlurHandler),this.inputElement.addEventListener("focus",this.onInputFocusHandler),this.inputElement.addEventListener("keydown",this.onInputKeyDownHandler),this.inputElement.addEventListener("paste",this.onPasteHandler)},t.prototype.detachInputElementEvents=function(){this.inputElement.removeEventListener("blur",this.onInputBlurHandler),this.inputElement.removeEventListener("focus",this.onInputFocusHandler),this.inputElement.removeEventListener("keydown",this.onInputKeyDownHandler),this.inputElement.removeEventListener("paste",this.onPasteHandler)},t.prototype.createTextInputElement=function(t){this.textInputElementContainer=document.createElement("div"),this.textInputElementContainer.setAttribute("class","dxdi-text-input-container"),t.appendChild(this.textInputElementContainer),this.textInputElement=document.createElement("div"),this.textInputElement.setAttribute("class","dxdi-text-input"),this.textInputElement.setAttribute("contenteditable","true"),this.attachTextInputElementEvents(),this.textInputElementContainer.appendChild(this.textInputElement)},t.prototype.attachTextInputElementEvents=function(){this.onTextInputBlurHandler=this.onTextInputBlur.bind(this),this.onTextInputFocusHandler=this.onTextInputFocus.bind(this),this.onTextInputKeyDownHandler=this.onTextInputKeyDown.bind(this),this.textInputElement.addEventListener("blur",this.onTextInputBlurHandler),this.textInputElement.addEventListener("focus",this.onTextInputFocusHandler),this.textInputElement.addEventListener("keydown",this.onTextInputKeyDownHandler)},t.prototype.detachTextInputElementEvents=function(){this.textInputElement.removeEventListener("blur",this.onTextInputBlurHandler),this.textInputElement.removeEventListener("focus",this.onTextInputFocusHandler),this.textInputElement.removeEventListener("keydown",this.onTextInputKeyDownHandler)},t.prototype.createClipboardInputElement=function(t){this.clipboardInputElement=document.createElement("textarea"),this.clipboardInputElement.setAttribute("class","dxdi-clipboard-input"),t.appendChild(this.clipboardInputElement)},t.prototype.blurControl=function(){this.focusLocked||(this.focused=!1,o.RemoveClassNameFromElement(this.mainElement,"focused"))},t.prototype.focusControl=function(){this.focused=!0,this.focusLocked=!1,o.AddClassNameToElement(this.mainElement,"focused")},t.prototype.onInputBlur=function(t){var e=this;this.blurControl(),r.raiseEvent(t,this.getDiagramFocusEvent(t),function(t){return e.eventManager.onBlur(t)})},t.prototype.onInputFocus=function(t){var e=this;this.focusControl(),r.raiseEvent(t,this.getDiagramFocusEvent(t),function(t){return e.eventManager.onFocus(t)})},t.prototype.onInputKeyDown=function(t){var e=this;r.raiseEvent(t,this.getDiagramKeyboardEvent(t),function(t){return e.eventManager.onKeyDown(t)})},t.prototype.onTextInputBlur=function(t){var e=this;this.blurControl(),r.raiseEvent(t,this.getDiagramFocusEvent(t),function(t){return e.eventManager.onTextInputBlur(t)})},t.prototype.onTextInputFocus=function(t){var e=this;this.focusControl(),r.raiseEvent(t,this.getDiagramFocusEvent(t),function(t){return e.eventManager.onTextInputFocus(t)})},t.prototype.onTextInputKeyDown=function(t){var e=this;r.raiseEvent(t,this.getDiagramKeyboardEvent(t),function(t){return e.eventManager.onTextInputKeyDown(t)})},t.prototype.getDiagramKeyboardEvent=function(t){return new s.DiagramKeyboardEvent(p.getKeyModifiers(t),u.Evt.GetKeyCode(t),u.Evt.GetEventSource(t).innerText)},t.prototype.lockFocus=function(){var t=this;this.focusLocked=!0,setTimeout(function(){return t.focusLocked=!1},10)},t.prototype.replaceParent=function(t){this.inputElement&&this.inputElement.parentNode!==t&&t.appendChild(this.inputElement),this.textInputElementContainer&&this.textInputElementContainer.parentNode!==t&&t.appendChild(this.textInputElementContainer),this.clipboardInputElement&&this.clipboardInputElement.parentNode!==t&&t.appendChild(this.clipboardInputElement)},t.prototype.getDiagramFocusEvent=function(t){return new s.DiagramFocusEvent(t.target.innerText)},t.prototype.onPaste=function(t){var e=this;r.raiseEvent(t,this.getDiagramClipboardEvent(t),function(t){return e.eventManager.onPaste(t)})},t.prototype.getDiagramClipboardEvent=function(t){var e;return e=void 0!==t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("Text"),new s.DiagramClipboardEvent(e)},t.prototype.notifyViewAdjusted=function(t){},t.prototype.notifyActualZoomChanged=function(t){this.actualZoom=t},t.prototype.notifyTextInputStart=function(t,e,n,o){var i="";t instanceof a.Shape?i="shape-text":t instanceof c.Connector&&(i="connector-text"),this.setInputElementTextInputMode(e,n,o,t.styleText,i)},t.prototype.notifyTextInputEnd=function(t){this.setInputElementFocusHandlerMode()},t}();e.InputManager=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),s=n(27),a=n(20),c=n(2),u=n(137),p=n(41),h=n(33),l=n(0),d=n(15),f=function(t){function e(e,n){var o=t.call(this,n.zoomLevel)||this;return o.snapPoint=new l.Point(0,0),o.gridPatternId=d.RenderUtils.generateSvgElementId("gridPattern"),o.pagesGridPatternId=d.RenderUtils.generateSvgElementId("pagesGridPattern"),o.pagesGridClipId=d.RenderUtils.generateSvgElementId("pagesGridClip"),o.pageColor=n.pageColor,o.modelSize=n.modelSize,o.simpleView=n.simpleView,o.gridSize=n.gridSize,o.gridVisible=n.gridVisible,o.pageSize=n.pageLandscape?new l.Size(n.pageSize.height,n.pageSize.width):n.pageSize,o.canvasViewOffset=new l.Point(0,0),o.initContainers(e),o}return i(e,t),e.prototype.initContainers=function(t){this.backgroundContainer=t},e.prototype.redraw=function(){this.redrawPage(this.pageColor),this.redrawGrid()},e.prototype.redrawPage=function(t){var e=new s.Style;e.fill=r.ColorHelper.colorToHash(t),this.getOrCreateElement("page-bg",new a.RectanglePrimitive(0,0,"100%","100%",e,"page"),this.backgroundContainer),this.createTextFloodFilter("page-bg-textflood-filter",this.backgroundContainer,t)},e.prototype.redrawGrid=function(){this.updateGridElements(this.gridVisible,r.UnitConverter.twipsToPixelsF(this.gridSize)*this.actualZoom),this.updatePagesGridElements(this.simpleView,this.getAbsoluteSize(this.pageSize))},e.prototype.getGridRectElement=function(t){return void 0===this.gridRectElement&&(this.gridRectElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.gridRectElement},e.prototype.getGridPatternElement=function(t){return void 0===this.gridPatternElement&&(this.gridPatternElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.gridPatternElement},e.prototype.updateGridElements=function(t,e){var n=this,o=new a.RectanglePrimitive("0","0","100%","100%",null,"grid",null,function(t){t.style.setProperty("fill",d.RenderUtils.getUrlPathById(n.gridPatternId))}),i=this.getGridRectElement(o);if(t){i.style.display="",this.changePrimitiveElement(o,i);for(var r=[0,1,2,3,4].map(function(t){return Math.round(e*t)}),s=[new c.PathPrimitiveMoveToCommand(r[4].toString(),"0"),new c.PathPrimitiveLineToCommand(r[4].toString(),r[4].toString()),new c.PathPrimitiveLineToCommand("0",r[4].toString())],p=[],h=1;h<=3;h++)p.push(new c.PathPrimitiveMoveToCommand(r[h].toString(),"0")),p.push(new c.PathPrimitiveLineToCommand(r[h].toString(),r[4].toString()));for(h=1;h<=3;h++)p.push(new c.PathPrimitiveMoveToCommand("0",r[h].toString())),p.push(new c.PathPrimitiveLineToCommand(r[4].toString(),r[h].toString()));var f=4*e,y=this.simpleView?this.canvasViewOffset:l.Point.empty(),m=new u.PatternPrimitive(this.gridPatternId,[new c.PathPrimitive(s,null,"grid-outer-line"),new c.PathPrimitive(p,null,"grid-inner-line")],(((y.x+this.snapPoint.x)%f-f)%f).toString(),(((y.y+this.snapPoint.y)%f-f)%f).toString(),f.toString(),f.toString());this.changePrimitiveElement(m,this.getGridPatternElement(m))}else i.style.display="none"},e.prototype.getPagesGridRectElement=function(t){return this.getOrCreateElement("grid-pages-rect",t,this.backgroundContainer)},e.prototype.getPagesGridClipPathElement=function(t){return void 0===this.pagesGridClipPathElement&&(this.pagesGridClipPathElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.pagesGridClipPathElement},e.prototype.getPagesGridPatternElement=function(t){return void 0===this.pagesGridPatternElement&&(this.pagesGridPatternElement=this.createPrimitiveElement(t,this.backgroundContainer)),this.pagesGridPatternElement},e.prototype.updatePagesGridElements=function(t,e){var n=this,o=new a.RectanglePrimitive("0","0","100%","100%",null,"grid-page",this.pagesGridClipId,function(e){e.style.setProperty("fill",d.RenderUtils.getUrlPathById(n.pagesGridPatternId)),e.style.setProperty("display",t?"none":"")});if(this.getPagesGridRectElement(o),!t){var i=this.modelSize.multiply(this.actualZoom),s=[new c.PathPrimitiveMoveToCommand((e.width-1).toString(),"0"),new c.PathPrimitiveLineToCommand((e.width-1).toString(),(e.height-1).toString()),new c.PathPrimitiveLineToCommand("0",(e.height-1).toString())],h=new u.PatternPrimitive(this.pagesGridPatternId,[new c.PathPrimitive(s,null,"pages-grid-line")],0,0,e.width.toString(),e.height.toString());this.changePrimitiveElement(h,this.getPagesGridPatternElement(h));var l=new p.ClipPathPrimitive(this.pagesGridClipId,[new a.RectanglePrimitive(0,0,(r.UnitConverter.twipsToPixelsF(i.width)-4).toString(),(r.UnitConverter.twipsToPixelsF(i.height)-4).toString())]);this.changePrimitiveElement(l,this.getPagesGridClipPathElement(l))}},e.prototype.notifyModelSizeChanged=function(t,e){this.modelSize=t.clone(),this.redraw()},e.prototype.notifyModelRectangleChanged=function(t){},e.prototype.notifySnapPointPositionChanged=function(t){this.snapPoint=t.transform(r.UnitConverter.twipsToPixelsF),this.redrawGrid()},e.prototype.notifyPageColorChanged=function(t){this.pageColor=t,this.redrawPage(this.pageColor)},e.prototype.notifyModelChanged=function(t){},e.prototype.notifyPageSizeChanged=function(t,e){this.pageSize=e?new l.Size(t.height,t.width):t.clone(),this.redraw()},e.prototype.notifyActualZoomChanged=function(t){this.actualZoom=t,this.redraw()},e.prototype.notifyViewAdjusted=function(t){this.canvasViewOffset.equals(t)||(this.canvasViewOffset=t,this.simpleView&&this.redraw())},e.prototype.notifyViewChanged=function(t){this.simpleView=t,this.redraw()},e.prototype.notifyGridChanged=function(t,e){this.gridVisible=t,this.gridSize=e,this.redraw()},e}(h.CanvasManagerBase);e.CanvasPageManager=f},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=function(t){function e(e,n,o,i,r,s){var a=t.call(this)||this;return a.id=e,a.x=o,a.y=i,a.width=r,a.height=s,a.children=n,a}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"pattern")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),e.setAttribute("patternUnits","userSpaceOnUse"),this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),t.prototype.applyElementProperties.call(this,e)},e}(n(18).SvgPrimitive);e.PatternPrimitive=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(33),s=n(35),a=n(0),c=n(8),u=n(28),p=n(41),h=n(20),l=n(15),d=n(139),f=n(27);e.CANVAS_MIN_PADDING=12,e.CROP_OFFSET=40;var y=function(t){function n(e,n,o,i,r,s,u){var p=t.call(this,i)||this;return p.scroll=e,p.svgElement=n,p.paddings=new a.Offset(0,0,0,0),p.crop=a.Offset.empty(),p.lockAutoZoom=!1,p.pageClipPathId=l.RenderUtils.generateSvgElementId("page-clip"),p.pageShadowId=l.RenderUtils.generateSvgElementId("page-shadow"),p.onViewChanged=new c.EventDispatcher,o=o.transform(c.UnitConverter.twipsToPixelsF),p.modelSize=o,p.simpleView=s,p.fixedZoomLevel=i,p.autoZoom=r,p.crop=p.rectangleToCrop(u,o),p.updateElements(o.multiply(i),a.Point.empty(),s),p.getOrCreateElement("shadow",new d.ShadowFilterPrimitive(p.pageShadowId),p.svgElement),p}return i(n,t),n.prototype.update=function(t){t?this.reset(t.horizontal,t.vertical):this.adjust(this.modelSize,this.fixedZoomLevel,this.autoZoom,this.simpleView,this.crop,a.Offset.empty())},n.prototype.reset=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0),this.adjust(this.modelSize,this.fixedZoomLevel,this.autoZoom,this.simpleView,this.crop,void 0,{horizontal:t,vertical:e})},n.prototype.notifyModelSizeChanged=function(t,e){t=t.transform(c.UnitConverter.twipsToPixelsF),this.adjust(t,this.fixedZoomLevel,this.autoZoom,this.simpleView,this.crop,e&&e.transform(c.UnitConverter.twipsToPixelsF)),this.modelSize=t},n.prototype.notifyModelRectangleChanged=function(t){var e=this.rectangleToCrop(t,this.modelSize,this.crop);this.crop&&this.crop.equals(e)||(this.simpleView&&this.adjust(this.modelSize,this.fixedZoomLevel,this.autoZoom,this.simpleView,e,a.Offset.empty()),this.crop=e)},n.prototype.notifySnapPointPositionChanged=function(t){},n.prototype.notifyZoomChanged=function(t,e){this.adjust(this.modelSize,t,e,this.simpleView,this.crop,void 0,{horizontal:!1,vertical:!1}),this.fixedZoomLevel=t,this.autoZoom=e},n.prototype.notifyViewChanged=function(t){this.adjust(this.modelSize,this.fixedZoomLevel,this.autoZoom,t,this.crop),this.simpleView=t},n.prototype.notifyGridChanged=function(t,e){},n.prototype.notifyDragStart=function(t){this.lockAutoZoom=!0;var e=this.svgElement.getAttribute("class")+" dxdi-drag-item";this.svgElement.setAttribute("class",e)},n.prototype.notifyDragEnd=function(t){this.lockAutoZoom=!1;var e=this.svgElement.getAttribute("class").replace(" dxdi-drag-item","");this.svgElement.setAttribute("class",e),this.autoZoom&&this.update({horizontal:!0,vertical:!0})},n.prototype.notifyDragScrollStart=function(){var t=this.svgElement.getAttribute("class")+" dxdi-drag-scroll";this.svgElement.setAttribute("class",t)},n.prototype.notifyDragScrollEnd=function(){var t=this.svgElement.getAttribute("class").replace(" dxdi-drag-scroll","");this.svgElement.setAttribute("class",t)},n.prototype.checkFitToCanvas=function(){var t=this.scroll.getScrollBarWidth(),n=this.scroll.getSize().offset(2*-e.CANVAS_MIN_PADDING,2*-e.CANVAS_MIN_PADDING),o=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop).multiply(this.actualZoom),i=this.checkScrollBars(n,t,o,a.Offset.empty());return{vertical:(n=n.offset(i.vertical?-t:0,i.horizontal?-t:0)).height>=o.height,horizontal:n.width>=o.width}},n.prototype.rectangleToCrop=function(t,e,n){var o=t.transform(c.UnitConverter.twipsToPixelsF);return new a.Offset(this.correctCrop(o.left),this.correctCrop(o.top),this.correctCrop(e.width-o.right),this.correctCrop(e.height-o.bottom))},n.prototype.correctCrop=function(t){return e.CROP_OFFSET*Math.floor(t/e.CROP_OFFSET)},n.prototype.setActualZoom=function(t){this.actualZoom!==t&&(this.actualZoom=t,this.onViewChanged.raise1(function(e){return e.notifyActualZoomChanged(t)}))},n.prototype.getActualAutoZoomLevel=function(t){if(t===s.AutoZoomMode.Disabled)return this.actualZoom;var e=this.scroll.getSize(),n=this.scroll.getScrollBarWidth(),o=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop);return this.getActualAutoZoom(e,n,o,t)},n.prototype.getActualZoom=function(t,e,n,o,i){return this.lockAutoZoom?this.actualZoom:i===s.AutoZoomMode.Disabled?o:this.getActualAutoZoom(t,e,n,i)},n.prototype.getActualAutoZoom=function(t,n,o,i){return i===s.AutoZoomMode.FitContent?Math.min((t.width-2*e.CANVAS_MIN_PADDING)/o.width,(t.height-2*e.CANVAS_MIN_PADDING)/o.height,1):Math.min((t.width-2*e.CANVAS_MIN_PADDING-n)/o.width,1)},n.prototype.tryNormalizePaddings=function(){var t=this.scroll.getScroll(),e=this.scroll.getSize(),n=this.scroll.getScrollBarWidth(),o=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop).multiply(this.actualZoom),i=new a.Point(this.paddings.left,this.paddings.top),r=new a.Size(this.paddings.right,this.paddings.bottom),s=this.getTailSpace(i,t,o,e,n);s.equals(r)||this.applyChanges(new a.Offset(i.x,i.y,s.width,s.height),o,this.simpleView,this.crop)},n.prototype.scrollBy=function(t){var e,n,o,i=this.scroll.getScroll(),r=this.scroll.getSize(),s=this.scroll.getScrollBarWidth(),c=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop).multiply(this.actualZoom),u=this.checkScrollBars(r,s,c,this.paddings),p=new a.Point(this.paddings.left,this.paddings.top),h=new a.Size(this.paddings.right,this.paddings.bottom);return i=(e=this.changeScrollByOffset(p,i,h,c,t,r,u)).scroll,t=e.offset,p=(n=this.changeTranslateByOffset(p,h,t,u)).translate,t=n.offset,p=(o=this.cropHiddenHead(p,i)).translate,i=o.scroll,h=this.getTailSpace(p,i,c,r,s),this.applyChanges(new a.Offset(p.x,p.y,h.width,h.height),c,this.simpleView,this.crop,i),t},n.prototype.changeScrollByOffset=function(t,e,n,o,i,r,s){var a=e.clone(),c=i.clone();return i.x&&s.horizontal&&(a.x-=c.x=-this.getScrollDeltaByOffset(i.x,e.x,t.x+o.width+n.width,r.width,s.vertical)),i.y&&s.vertical&&(a.y-=c.y=-this.getScrollDeltaByOffset(i.y,e.y,t.y+o.height+n.height,r.height,s.horizontal)),{scroll:a,offset:c}},n.prototype.changeTranslateByOffset=function(t,e,n,o){var i=t.clone(),r=n.clone();return n.x&&!o.horizontal&&(i.x+=r.x=this.getTranslateDeltaByOffset(n.x,i.x,e.width)),n.y&&!o.vertical&&(i.y+=r.y=this.getTranslateDeltaByOffset(n.y,i.y,e.height)),{translate:i,offset:r}},n.prototype.getScrollDeltaByOffset=function(t,e,n,o,i){if(t>0)return-Math.min(e,t);var r=n-(o-(i?this.scroll.getScrollBarWidth():0));return Math.min(r-e,-t)},n.prototype.getTranslateDeltaByOffset=function(t,n,o){return t?t<0?-Math.min(n-e.CANVAS_MIN_PADDING,-t):Math.min(o-e.CANVAS_MIN_PADDING,t):0},n.prototype.getActualModelSizeWithoutZoom=function(t,e,n){return e&&n?t.offset(-n.horizontal,-n.vertical):t},n.prototype.setScrollTo=function(t,n){var o=this.scroll.getSize(),i=this.getVisibileAreaAbsShift(),r=t.transform(c.UnitConverter.twipsToPixelsF).multiply(this.actualZoom).offset(i.x,i.y),s=this.scroll.getScroll();n?(s.x+=r.x-n.x,s.y+=r.y-n.y):(r.x<0&&(s.x+=r.x-e.CANVAS_MIN_PADDING),r.y<0&&(s.y+=r.y-e.CANVAS_MIN_PADDING),r.x>o.width&&(s.x+=r.x-o.width+e.CANVAS_MIN_PADDING),r.y>o.height&&(s.y+=r.y-o.height+e.CANVAS_MIN_PADDING));var a=this.modelSize.multiply(this.actualZoom);s.x=Math.max(0,Math.min(s.x,a.width+this.paddings.horizontal-o.width)),s.y=Math.max(0,Math.min(s.y,a.height+this.paddings.vertical-o.height)),this.scroll.setScroll(s.x,s.y)},n.prototype.updateElements=function(t,e,n){this.updatePageElement(t,e,n),this.updateCanvasElement(e)},n.prototype.updateCanvasElement=function(t){this.canvasElement=this.getOrCreateElement("dxdi-main",new u.GroupPrimitive([],"dxdi-main",null,null,function(e){e.setAttribute("transform","translate("+Math.round(t.x)+", "+Math.round(t.y)+")")}),this.svgElement)},n.prototype.updatePageElement=function(t,e,n){n||this.getOrCreateElement("pageShadowRect",new h.RectanglePrimitive(e.x.toString(),e.y.toString(),t.width.toString(),t.height.toString(),new f.EmptyStyle({filter:l.RenderUtils.getUrlPathById(this.pageShadowId)}),"dxdi-page-shadow"),this.svgElement),this.pageElement=this.getOrCreateElement("page",new u.GroupPrimitive([],"dxdi-page",null,n?"":this.pageClipPathId,function(t){t.setAttribute("transform","translate("+(n?0:Math.round(e.x))+", "+(n?0:Math.round(e.y))+")")}),this.svgElement),this.getOrCreateElement("pageClip",this.createPageClipPathPrimitive(t),this.svgElement)},n.prototype.createPageClipPathPrimitive=function(t){var e=[];return e.push(new h.RectanglePrimitive(0,0,t.width.toString(),t.height.toString())),new p.ClipPathPrimitive(this.pageClipPathId,e)},n.prototype.adjust=function(t,e,n,o,i,r,s){var c=this.scroll.getSize(),u=this.getActualModelSizeWithoutZoom(t,o,i);if(this.lockAutoZoom||!n&&r&&this.modelSize)this.resizeView(u,this.actualZoom,c,o,i,r);else{var p=this.scroll.getScrollBarWidth(),h=this.getActualZoom(c,p,u,e,n);n&&h===this.actualZoom?this.resizeView(u,h,c,o,i,r||a.Offset.empty()):(this.resetView(u,h,c,o,i,s),this.setActualZoom(h))}},n.prototype.resetView=function(t,n,o,i,r,s){var c=t.multiply(n),u=a.Offset.fromNumber(e.CANVAS_MIN_PADDING);!(s=s||{horizontal:!0,vertical:!0}).horizontal&&this.paddings&&(u.left=this.paddings.left,u.right=this.paddings.right),!s.vertical&&this.paddings&&(u.top=this.paddings.top,u.bottom=this.paddings.bottom);var p=this.checkScrollBars(o,this.scroll.getScrollBarWidth(),c,u),h=this.scroll.getScrollBarWidth(),l=s.horizontal||s.vertical?this.scroll.getScroll():void 0;if(s.horizontal){var d=Math.max((o.width-(p.vertical?h:0)-c.width)/2,e.CANVAS_MIN_PADDING);u.left=d,u.right=d,l.x=0}if(s.vertical){var f=Math.max((o.height-(p.horizontal?h:0)-c.height)/2,e.CANVAS_MIN_PADDING);u.top=f,u.bottom=f,l.y=0}this.applyChanges(u,c,i,r.multiply(n),l)},n.prototype.resizeView=function(t,e,n,o,i,r){var s,c,u=this.actualZoom,p=this.simpleView&&this.crop?this.crop.multiply(u):a.Offset.empty(),h=t.multiply(e);r=r.multiply(e);var l=o&&i?i.multiply(e):a.Offset.empty(),d=new a.Point(this.paddings.left,this.paddings.top),f=this.scroll.getScroll();d=(s=this.applyOffset(d,f,p,l,r)).translate,f=s.scroll,d=(c=this.cropHiddenHead(d,f)).translate,f=c.scroll;var y=this.getTailSpace(d,f,h,n,this.scroll.getScrollBarWidth()),m=new a.Offset(d.x,d.y,y.width,y.height);this.applyChanges(m,h,o,l,f)},n.prototype.applyChanges=function(t,e,n,o,i){var r=new a.Point(t.left,t.top);n&&o&&(r=r.offset(-o.left,-o.top)),this.updateElements(e,r,n),this.setSvgSize(e.width+t.horizontal,e.height+t.vertical),this.onViewChanged.raise1(function(t){return t.notifyViewAdjusted(new a.Point(r.x,r.y))}),i&&this.scroll.setScroll(i.x,i.y),this.paddings=t},n.prototype.applyOffset=function(t,n,o,i,r){var s=t.clone(),a=n.clone(),c=this.getActualOffset(o,i,r);return c.left&&(s.x=Math.max(e.CANVAS_MIN_PADDING,s.x-c.left),a.x+=c.left-(t.x-s.x)),c.top&&(s.y=Math.max(e.CANVAS_MIN_PADDING,s.y-c.top),a.y+=c.top-(t.y-s.y)),{translate:s,scroll:a}},n.prototype.cropHiddenHead=function(t,n){var o=n.clone(),i=t.clone();if(o.x&&i.x>e.CANVAS_MIN_PADDING){var r=i.x-Math.max(e.CANVAS_MIN_PADDING,i.x-o.x);i.x-=r,o.x-=r}if(o.y&&i.y>e.CANVAS_MIN_PADDING){r=i.y-Math.max(e.CANVAS_MIN_PADDING,i.y-o.y);i.y-=r,o.y-=r}return{translate:i,scroll:o}},n.prototype.getTailSpace=function(t,n,o,i,r){var s=t.clone(),c=n.clone(),u=Math.max(i.width+c.x-(s.x+o.width),e.CANVAS_MIN_PADDING),p=Math.max(i.height+c.y-(s.y+o.height),e.CANVAS_MIN_PADDING),h=this.checkScrollBars(i,r,o,new a.Offset(s.x,s.y,u,p));return h.vertical&&(u=Math.max(e.CANVAS_MIN_PADDING,u-r)),h.horizontal&&(p=Math.max(e.CANVAS_MIN_PADDING,p-r)),new a.Size(u,p)},n.prototype.getActualOffset=function(t,e,n){return new a.Offset(-(e.left-t.left)+n.left,-(e.top-t.top)+n.top,-(e.right-t.right)+n.right,-(e.bottom-t.bottom)+n.bottom)},n.prototype.checkScrollBars=function(t,e,n,o){var i=t.widthi.width||t.y>i.height)return null;if(o.x<0||o.y<0)return null;if(o.x>this.modelSize.width||o.y>this.modelSize.height)return null}return o.transform(c.UnitConverter.pixelsToTwips)},n.prototype.getAbsolutePoint=function(t,e){var n=this.getVisibileAreaAbsShift(),o=t.transform(c.UnitConverter.twipsToPixelsF).multiply(this.actualZoom).offset(n.x,n.y);if(e){if(o.x<0||o.y<0)return null;var i=this.scroll.getSize();if(o.x>i.width||o.y>i.height)return null}return o},n}(r.CanvasManagerBase);e.CanvasViewManager=y},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(85),s=n(12),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createChildElements=function(t){var e=document.createElementNS(s.svgNS,"feGaussianBlur");e.setAttribute("in","SourceGraphic"),e.setAttribute("stdDeviation","4.6"),t.appendChild(e);var n=document.createElementNS(s.svgNS,"feOffset");n.setAttribute("dx","0"),n.setAttribute("dy","0"),t.appendChild(n);var o=document.createElementNS(s.svgNS,"feMerge");t.appendChild(o);var i=document.createElementNS(s.svgNS,"feMergeNode");o.appendChild(i);var r=document.createElementNS(s.svgNS,"feMergeNode");r.setAttribute("in","SourceGraphic"),o.appendChild(r)},e}(r.FilterPrimitive);e.ShadowFilterPrimitive=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),s=function(t){function e(e,n,o,i,r,s,a){var c=t.call(this,null,o)||this;return c.id=e,c.x=i,c.y=r,c.width=s,c.height=a,c.children=n,c}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"mask")},e.prototype.applyElementProperties=function(e){this.id&&e.setAttribute("id",this.id),this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),t.prototype.applyElementProperties.call(this,e)},e}(n(18).SvgPrimitive);e.MaskPrimitive=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(39),i=n(17),r=n(12),s=function(){function t(t,e){this.scroll=t,this.mainElement=e,this.leftButtonPressed=!1,this.scrollDragging=!1,this.scrollTimer=-1,this.scrollBarWidth=i.GetVerticalScrollBarWidth()}return t.prototype.onMouseMove=function(t,e){this.clearScrollTimer(),o.Evt.IsLeftButtonPressed(t)||(this.leftButtonPressed=!1),this.canAutoScroll()&&this.changeScrollPosition(t,e,!1)},t.prototype.onMouseDown=function(t){this.leftButtonPressed=!!o.Evt.IsLeftButtonPressed(t)},t.prototype.onMouseUp=function(t){this.clearScrollTimer(),this.leftButtonPressed=!1},t.prototype.onMouseEnter=function(t){var e=this;o.Evt.IsLeftButtonPressed(t)&&setTimeout(function(){e.leftButtonPressed=!0},500)},t.prototype.onDragScrollStart=function(){this.scrollDragging=!0},t.prototype.onDragScrollEnd=function(){this.scrollDragging=!1},t.prototype.canAutoScroll=function(){return this.leftButtonPressed&&!this.scrollDragging},t.prototype.changeScrollPosition=function(t,e,n){var o=this,r=t.pageX-i.GetAbsolutePositionX(this.mainElement),s=t.pageY-i.GetAbsolutePositionY(this.mainElement),a=this.scroll.getSize(),c=this.scroll.getScrollSize(),u=a.width;a.width-1&&(window.clearTimeout(this.scrollTimer),this.scrollTimer=-1)},t.prototype.getScrollingOffset=function(t){var e=Math.pow((40-t)/5,2);return Math.min(e,5)},t.createMainElement=function(t){var e=document.createElement("div");return e.setAttribute("class","dxdi-control"),t.appendChild(e),e},t.createSvgElement=function(t,e){void 0===e&&(e=!1);var n=document.createElementNS(r.svgNS,"svg");return n.className.baseVal="dxdi-canvas"+(e?" export":""),t.appendChild(n),n},t}();e.AutoScrollController=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(89),s=n(30),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPoints=function(){return this.connector.points.map(function(t,e){return new s.ConnectorRenderPoint(t.x,t.y,e)})},e}(r.ConnectorPointsCalculatorBase);e.ConnectorPointsCalculator=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(4),a=n(89),c=n(144),u=n(145),p=n(146),h=n(147),l=n(148),d=n(30),f=function(t){function e(e){var n=t.call(this,e)||this;return n.sideCalculators={},n.sideCalculators[s.ConnectionPointSide.Undefined]=new c.ConnectorPointsOrthogonalUndefinedSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.South]=new u.ConnectorPointsOrthogonalSouthSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.North]=new p.ConnectorPointsOrthogonalNorthSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.East]=new h.ConnectorPointsOrthogonalEastSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.West]=new l.ConnectorPointsOrthogonalWestSideCalculator(n),n}return i(e,t),Object.defineProperty(e.prototype,"beginRect",{get:function(){return this.connector.beginItem?this.connector.beginItem.rectangle:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endRect",{get:function(){return this.connector.endItem?this.connector.endItem.rectangle:void 0},enumerable:!0,configurable:!0}),e.prototype.getPoints=function(){var t=this.connector.points.map(function(t,e){return new d.ConnectorRenderPoint(t.x,t.y,e)});this.removeUnnecessaryLinePoints(t);var e=0,n=t.length-1,o=this.getPointSide(t,0),i=this.getPointSide(t,1),r=this.getPointSide(t,t.length-1),s=this.getPointSide(t,t.length-1-1),a=this.getSideCalculator(o),c=this.getSideCalculator(r),u=this.beginRect,p=a.getCorrectOriginPoint(t[e],u),h=t[e+1];if(2===t.length&&a.isOnSidePoint(p,h)&&a.isDirectConnectionAllowed(i,p,h)){a.getDirectConnectionPoints(p,h).forEach(function(o){t.splice(e+1,0,o),e++,n++})}else{var l=a.getBeginOffsetPoints(i,t[e],t[e+1],this.beginRect);l.forEach(function(n){t.splice(e+1,0,n)}),e+=l.length,n+=l.length,c.getEndOffsetPoints(s,t[n],t[n-1],this.endRect).forEach(function(e,o){t.splice(n+o,0,e)});for(var f=e;f0&&(s=c[0]),s},e.prototype.createPointsRect=function(t,e){var n=r.Rectangle.createByPoints(t,e);return n.width>0&&(n=n.inflate(-1,0)),n.height>0&&(n=n.inflate(0,-1)),n},e.prototype.isPriorMiddlePoint=function(t,e,n,o,i){return!(!n||t.x!==n.x&&t.y!==n.y)||!(!i||t.x!==i.x&&t.y!==i.y)},e.prototype.isReturnPoint=function(t,e,n){if(void 0!==e&&void 0!==n){if(t.x===n.x&&(e.yt.y&&t.y>n.y))return!0;if(t.y===n.y&&(e.xt.x&&t.x>n.x))return!0}return!1},e.prototype.isIntermediatePoints=function(t,e){return 0o){var i=Math.min(t.x,e.x)+n/2;return[new s.ConnectorRenderPoint(i,t.y),new s.ConnectorRenderPoint(i,e.y)]}var r=Math.min(t.y,e.y)+o/2;return[new s.ConnectorRenderPoint(t.x,r),new s.ConnectorRenderPoint(e.x,r)]},e}(r.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalUndefinedSideCalculator=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(43),a=n(30),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.yn.x?[]:[e.offset(0,this.getMinOffset())]:e.y>this.endRect.bottom?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.West:return e.ythis.endRect.bottom?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.xn.x?[e.offset(0,this.getMinOffset())]:[];case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:var i=this.getMinOffset();return this.beginRect.bottom>e.y&&(i+=this.beginRect.bottom-e.y),[e.offset(0,i)]}},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[e.offset(0,this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[e.offset(0,this.getScaleableOffsetY(e,n,!0))]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!1);break;case r.ConnectionPointSide.West:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1,!0);break;case r.ConnectionPointSide.South:if(this.isBeginEndOverlappedX())return this.getScaleableAsideOffsetPoints(e,n,o,!1);break;case r.ConnectionPointSide.Undefined:case r.ConnectionPointSide.North:return this.getScaleableAsideOffsetPoints(e,n,o,!1)}return[e.offset(0,this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){if(t===r.ConnectionPointSide.Undefined)return this.getScaleableAsideOffsetPoints(e,n,o,!0);if(this.isBeginEndOverlappedX()){var i=this.beginRect.center.x>this.endRect.center.x;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(0,this.getScaleableOffsetY(e,n,!0))]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.x0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.y>t.y},e.prototype.isDirectConnectionAllowed=function(t,e,n){return t===r.ConnectionPointSide.North||t===r.ConnectionPointSide.Undefined},e.prototype.getDirectConnectionPoints=function(t,e){var n=t.y+(e.y-t.y)/2;return[new a.ConnectorRenderPoint(t.x,n),new a.ConnectorRenderPoint(e.x,n)]},e}(s.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalSouthSideCalculator=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(43),a=n(30),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.y>e.top&&(t=t.offset(0,e.top-t.y)),t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:case r.ConnectionPointSide.West:case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.South:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset())}},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.South:return[e.offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())]}return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return e.y>n.y?e.x>n.x?[]:[e.offset(0,-this.getMinOffset())]:e.yn.y?e.xe.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.xe.y?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.x>n.x?[e.offset(0,-this.getMinOffset())]:[];case r.ConnectionPointSide.North:return[e.offset(0,-this.getMinOffset())];case r.ConnectionPointSide.South:var i=-this.getMinOffset();return this.beginRect.topthis.endRect.center.x;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(0,-this.getScaleableOffsetY(e,n,!0))]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.x0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.isOnSidePoint=function(t,e){return e.ythis.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.South:return e.xn.y?[]:[e.offset(this.getMinOffset(),0)]:e.x>this.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.ye.x&&(i+=this.beginRect.right-e.x),[e.offset(i,0)];case r.ConnectionPointSide.North:return n.xn.y?[e.offset(this.getMinOffset(),0)]:[];case r.ConnectionPointSide.South:return n.xthis.endRect.center.y;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(this.getScaleableOffsetX(e,n,!0),0)]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.y0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.getScaleableOffsetY=function(t,e,n){if(this.beginRect&&this.endRect&&!n&&!this.isBeginEndOverlappedY()){var o=void 0;if((o=e.yt.x},e.prototype.isDirectConnectionAllowed=function(t,e,n){return t===r.ConnectionPointSide.West||t===r.ConnectionPointSide.Undefined},e.prototype.getDirectConnectionPoints=function(t,e){var n=t.x+(e.x-t.x)/2;return[new a.ConnectorRenderPoint(n,t.y),new a.ConnectorRenderPoint(n,e.y)]},e}(s.ConnectorPointsOrthogonalSideCalculatorBase);e.ConnectorPointsOrthogonalEastSideCalculator=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(4),s=n(43),a=n(30),c=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t.x>e.left&&(t=t.offset(e.left-t.x,0)),t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.North:case r.ConnectionPointSide.South:case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)];case r.ConnectionPointSide.East:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset())}},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.East:return[e.offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return[e.offset(-this.getMinOffset(),0)]}return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){switch(t){case r.ConnectionPointSide.North:return e.x>n.x?e.yn.x?e.y>n.y?[]:[e.offset(-this.getMinOffset(),0)]:e.xe.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.y>n.y?[e.offset(-this.getMinOffset(),0)]:[];case r.ConnectionPointSide.South:return n.x>e.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):e.ythis.endRect.center.y;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.offset(-this.getScaleableOffsetX(e,n,!0),0)]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.y0&&o<2*this.getMinOffset())return o/2}return this.getMinOffset()},e.prototype.getScaleableOffsetY=function(t,e,n){if(this.beginRect&&this.endRect&&!n&&!this.isBeginEndOverlappedY()){var o=void 0;if((o=e.ye.position.x+e.size.width-o){var i=e.size.height/2/o,r=(n.x-(e.position.x+e.size.width-o))*i,a=e.getConnectionPointSide(n);a===p.ConnectionPointSide.North?n.y+=r:a===p.ConnectionPointSide.South&&(n.y-=r)}else t.prototype.processConnectionPoint.call(this,e,n)},e}(s.ArrowHorizontalShapeDescription);e.ArrowRightShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(21),a=n(0),c=n(65),u=n(1),p=n(4),h=function(t){function e(){return t.call(this,"Top Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeTypes.ArrowTop},enumerable:!0,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,s=e.bottom,a=e.width,u=(e.height,e.center.x),p=(a-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2,h=t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeX(i-p);return[new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(u,o),new r.PathPrimitiveLineToCommand(i,d),new r.PathPrimitiveLineToCommand(f,d),new r.PathPrimitiveLineToCommand(f,s),new r.PathPrimitiveLineToCommand(l,s),new r.PathPrimitiveLineToCommand(l,d),new r.PathPrimitiveLineToCommand(n,d),new r.PathPrimitiveClosePathCommand],t.style)]},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,c.ArrowVerticalTriangleHeightParameterName,function(t){return t.value+o}),this.changeParameterValue(e,c.ArrowVerticalLineWidthParameterName,function(t){return t.value-2*n}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new s.ShapeParameterPoint("c",new a.Point(t.normalizeX(t.position.x+(t.size.width-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2),t.normalizeY(t.position.y+t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value)))]},e.prototype.processConnectionPoint=function(e,n){var o=e.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value;if(n.y0)&&(r=-r),this.changeParameterValue(n,e.StarConvexParameterName,function(t){return t.value+r}),this.normalizeParameters(t,n)},n.prototype.getParameterPoints=function(t){var n=t.rectangle,o=n.top,i=n.right,r=n.bottom,s=n.width,a=n.height;r=this.getActualBottom(o,r,s,a);var c=n.center.x,h=o+(r-o)/2,l=a/s,d=Math.PI-this.angle,f=o+s/2*Math.tan(d/2)*l,y=t.parameters.get(e.StarConvexParameterName).value,m=this.getInnerPointDistance(c,c,i,h,o,f),g=this.getInnerPointPos(c,c,i,y,m),v=this.getInnerPointPos(h,o,f,y,m);return[new u.ShapeParameterPoint("c",new p.Point(g,v))]},n.prototype.processConnectionPoint=function(n,o){if(t.prototype.processConnectionPoint.call(this,n,o),n.getConnectionPointSide(o)===h.ConnectionPointSide.South){var i=n.rectangle,r=i.top,s=i.right,a=i.bottom,c=i.width,u=i.height;a=this.getActualBottom(r,a,c,u);var p=i.center.x,l=r+(a-r)/2,d=u/c,f=Math.PI-this.angle,y=r+c/2*Math.tan(f/2)*d,m=n.parameters.get(e.StarConvexParameterName).value,g=this.getInnerPointDistance(p,p,s,l,r,y);o.y=this.getInnerPointPos(l,a,a,m,g)}},n.prototype.getInnerPointDistanceByAxis=function(t,e,n){return Math.min(e,n)+Math.abs(e-n)/2-t},n.prototype.getInnerPointPos=function(t,e,n,o,i){var r=Math.min(1,o/i);return t+this.getInnerPointDistanceByAxis(t,e,n)*r},n.prototype.getInnerPointDistance=function(t,e,n,o,i,r){var s=this.getInnerPointDistanceByAxis(t,e,n),a=this.getInnerPointDistanceByAxis(o,i,r);return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))},n.prototype.getActualBottom=function(e,n,o,i){var r=e+t.prototype.calculateHeight.call(this,o)*i/o;return re.position.y+e.size.height-o){var i=e.size.width/2/o,r=(n.y-(e.position.y+e.size.height-o))*i,s=e.getConnectionPointSide(n);s===p.ConnectionPointSide.East?n.x-=r:s===p.ConnectionPointSide.West&&(n.x+=r)}else t.prototype.processConnectionPoint.call(this,e,n)},e}(c.ArrowVerticalShapeDescription);e.ArrowBottomShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),s=n(2),a=n(66),c=n(21),u=n(0),p=n(1),h=function(t){function e(){return t.call(this,"East-West Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return p.ShapeTypes.ArrowEastWest},enumerable:!0,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,r=e.bottom,c=(e.width,e.height),u=e.center.y,p=t.parameters.get(a.ArrowVerticalTriangleWidthParameterName).value,h=(c-t.parameters.get(a.ArrowVerticalLineHeightParameterName).value)/2,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeX(i-p),y=t.normalizeY(r-h);return[new s.PathPrimitive([new s.PathPrimitiveMoveToCommand(n,u),new s.PathPrimitiveLineToCommand(l,o),new s.PathPrimitiveLineToCommand(l,d),new s.PathPrimitiveLineToCommand(f,d),new s.PathPrimitiveLineToCommand(f,o),new s.PathPrimitiveLineToCommand(i,u),new s.PathPrimitiveLineToCommand(f,r),new s.PathPrimitiveLineToCommand(f,y),new s.PathPrimitiveLineToCommand(l,y),new s.PathPrimitiveLineToCommand(l,r),new s.PathPrimitiveClosePathCommand],t.style)]},e.prototype.normalizeParameters=function(t,e){this.changeParameterValue(e,a.ArrowVerticalTriangleWidthParameterName,function(e){return Math.max(0,Math.min(t.size.width/2-2*r.Shape.lineWidth,e.value))}),this.changeParameterValue(e,a.ArrowVerticalLineHeightParameterName,function(e){return Math.max(0,Math.min(t.size.height,e.value))})},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,a.ArrowVerticalTriangleWidthParameterName,function(t){return t.value+n}),this.changeParameterValue(e,a.ArrowVerticalLineHeightParameterName,function(t){return t.value-2*o}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new c.ShapeParameterPoint("c",new u.Point(t.normalizeX(t.position.x+t.parameters.get(a.ArrowVerticalTriangleWidthParameterName).value),t.normalizeY(t.position.y+(t.size.height-t.parameters.get(a.ArrowVerticalLineHeightParameterName).value)/2)))]},e}(a.ArrowHorizontalShapeDescription);e.ArrowEastWestShapeDescription=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),s=n(66),a=n(21),c=n(0),u=n(1),p=n(4),h=function(t){function e(){return t.call(this,"Left Arrow")||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeTypes.ArrowLeft},enumerable:!0,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.left,o=e.top,i=e.right,a=e.bottom,c=(e.width,e.height),u=e.center.y,p=t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value,h=(c-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2,l=t.normalizeX(n+p),d=t.normalizeY(o+h),f=t.normalizeY(a-h);return[new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(n,u),new r.PathPrimitiveLineToCommand(l,o),new r.PathPrimitiveLineToCommand(l,d),new r.PathPrimitiveLineToCommand(i,d),new r.PathPrimitiveLineToCommand(i,f),new r.PathPrimitiveLineToCommand(l,f),new r.PathPrimitiveLineToCommand(l,a),new r.PathPrimitiveClosePathCommand],t.style)]},e.prototype.modifyParameters=function(t,e,n,o){this.changeParameterValue(e,s.ArrowVerticalTriangleWidthParameterName,function(t){return t.value+n}),this.changeParameterValue(e,s.ArrowVerticalLineHeightParameterName,function(t){return t.value-2*o}),this.normalizeParameters(t,e)},e.prototype.getParameterPoints=function(t){return[new a.ShapeParameterPoint("c",new c.Point(t.normalizeX(t.position.x+t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value),t.normalizeY(t.position.y+(t.size.height-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2)))]},e.prototype.processConnectionPoint=function(e,n){var o=e.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value;if(n.x0},t.prototype.iterate=function(t){this.iterateCore(this.root,0,t)},t.createSpanningTree=function(e){var n=t.findRoot(e),i=e.createIterator(o.ConnectionMode.Outgoing),r={};return i.skipEdge=function(t){return void 0===t.to||i.isNodeVisited(t.to)},i.onNode=function(t){return r[t.key]=[]},i.onEdge=function(t){var n=e.getNode(t.to);n&&r[t.from].push(n)},i.iterate(n),new t(e.getNode(n),r)},t.prototype.iterateCore=function(t,e,n){var o=this;n(t,e),this.getChildren(t).forEach(function(t){return o.iterateCore(t,e+1,n)})},t.findRoot=function(t){return t.nodes.reduce(function(e,n){var o=t.getAdjacentEdges(n),i=o.filter(function(t){return t.to===n}).length,r=o.filter(function(t){return t.from===n}).length;return(void 0===e.candidate||0===i&&e.inc>0||0!==e.inc&&e.out-e.inc0)return"\n"+n}}},e.prototype.checkSelector=function(t){for(var n=0;no[t.key]?e:t},t[0]))}),u.list()},t.reverseEdges=function(t,e){var n=new r.HashSet([],function(t){return t.getHashKey()}),i={},s={};return t.edges.forEach(function(t){e[t.getHashKey()]&&(t=t.reverse(),i[t.key]=!0),n.tryPush(t)||(s[t.key]=!0,delete i[t.key])}),{graph:new o.Graph(t.nodes.map(function(e){return t.getNode(e)}),n.list()),reversedEdges:i,removedEdges:s}},t.getNonTrivialStronglyConnectedComponents=function(t){return this.getStronglyConnectedComponents(t).filter(function(t){return t.edges.length})},t.getStronglyConnectedComponents=function(t){for(var e=this,n=[],o=0,r={},s={},a={},c=[],u={},p=0;p0&&this.needSendToBack(e)},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedItems().forEach(function(t){var e=n.control.model.getIntersectItemsMinZIndex(t)-1;n.control.history.addAndRedo(new r.ChangeZindexHistoryItem(t,e))}),this.control.history.endTransaction(),!0},e.prototype.needSendToBack=function(t){for(var e=this,n=function(n){var i=o.control.model.getIntersectItemsMinZIndex(t[n]);if(i0&&this.needBringToFront(e)},e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.control.selection.getSelectedItems().forEach(function(t){var e=n.control.model.getIntersectItemsMaxZIndex(t)+1;n.control.history.addAndRedo(new r.ChangeZindexHistoryItem(t,e))}),this.control.history.endTransaction(),!0},e.prototype.needBringToFront=function(t){for(var e=this,n=function(n){var i=o.control.model.getIntersectItemsMaxZIndex(t[n]);if(i>t[n].zIndex)return{value:!0};if(i===t[n].zIndex){var r=!1;return o.control.model.getIntersectItems(t[n]).filter(function(e){return e.zIndex===t[n].zIndex}).forEach(function(o){e.control.model.getItemIndex(o)>e.control.model.getItemIndex(t[n])&&(r=!0)}),{value:r}}},o=this,i=0;i Children > [ItemKind='DiagramShape']").forEach(function(t){e.push(t)}),this.doc.querySelectorAll("[ItemKind='DiagramRoot'] > Children > [ItemKind='DiagramContainer']").forEach(function(t){e.push(t)}),e},e.prototype.getConnectorObjects=function(t){var e=[];return this.doc.querySelectorAll("[ItemKind='DiagramRoot'] > Children > [ItemKind='DiagramConnector']").forEach(function(t){e.push(t)}),e},e.prototype.importPageSettings=function(t,e){if(e){var n=e.getAttribute("PageSize"),o=this.getSize(n);o&&(t.size=o.clone(),t.pageSize=o.clone())}},e.prototype.importShape=function(t){var e=t.getAttribute("Position"),n=this.getPoint(e),o=t.getAttribute("Shape"),i=this.getShapeType(o),r=p.ShapeDescriptionManager.get(i),a=new s.Shape(r||p.ShapeDescriptionManager.get(u.ShapeTypes.Rectangle),n);a.key=this.getItemKey(t);var c=t.getAttribute("Size"),h=this.getSize(c);h&&(a.size=h);var l=t.getAttribute("Content");if("string"==typeof l)a.text=l;else{var d=t.getAttribute("Header");"string"==typeof d&&(a.text=d)}return this.importStyle(t,a),a},e.prototype.importShapeChildren=function(t,e){var n=[];t.setAttribute("dxDiagram",""),this.doc.querySelectorAll("[dxDiagram] > Children > [ItemKind='DiagramShape']").forEach(function(t){n.push(t)}),this.doc.querySelectorAll("[dxDiagram] > Children > [ItemKind='DiagramContainer']").forEach(function(t){n.push(t)}),t.removeAttribute("dxDiagram");var o=[];if(!n)return o;for(var i=0;i-1?u.ShapeTypes.VerticalContainer:u.ShapeTypes.Rectangle},e.prototype.getItemKey=function(t){return(parseInt(t.tagName.replace("Item",""))-1).toString()},e.prototype.getNumbers=function(t){var e=t.split(",");return e&&e.length?e.map(function(t){return+t}):[]},e.prototype.getSize=function(t){if(t){var e=this.getNumbers(t);if(e.length>=2)return this.assert(e[0],"number"),this.assert(e[1],"number"),new h.Size(c.UnitConverter.pixelsToTwips(e[0]),c.UnitConverter.pixelsToTwips(e[1]))}},e.prototype.getPoint=function(t){if(t){var e=this.getNumbers(t);if(e.length>=2)return this.assert(e[0],"number"),this.assert(e[1],"number"),new h.Point(c.UnitConverter.pixelsToTwips(e[0]),c.UnitConverter.pixelsToTwips(e[1]))}},e.prototype.getColor=function(t){t="#"==t.charAt(0)?t.substr(1):t;var e=parseInt(t,16);return isNaN(e)?void 0:d.ColorHelper.colorToHash(e)},e.shapeTypes={"BasicShapes.Rectangle":u.ShapeTypes.Rectangle,"BasicShapes.Ellipse":u.ShapeTypes.Ellipse,"BasicShapes.Triangle":u.ShapeTypes.Triangle,"BasicShapes.Pentagon":u.ShapeTypes.Pentagon,"BasicShapes.Hexagon":u.ShapeTypes.Hexagon,"BasicShapes.Octagon":u.ShapeTypes.Octagon,"BasicShapes.Diamond":u.ShapeTypes.Diamond,"BasicShapes.Cross":u.ShapeTypes.Cross,"BasicShapes.Star5":u.ShapeTypes.Star,"BasicFlowchartShapes.StartEnd":u.ShapeTypes.Terminator,"BasicFlowchartShapes.Data":u.ShapeTypes.Data,"BasicFlowchartShapes.Database":u.ShapeTypes.Database,"BasicFlowchartShapes.ExternalData":u.ShapeTypes.StoredData,"BasicFlowchartShapes.Process":u.ShapeTypes.Process,"BasicFlowchartShapes.Decision":u.ShapeTypes.Decision,"BasicFlowchartShapes.Subprocess":u.ShapeTypes.PredefinedProcess,"BasicFlowchartShapes.Document":u.ShapeTypes.Document,"BasicFlowchartShapes.Custom1":u.ShapeTypes.ManualInput,"BasicFlowchartShapes.Custom2":u.ShapeTypes.ManualOperation,"ArrowShapes.SimpleArrow":u.ShapeTypes.ArrowLeft,"ArrowShapes.SimpleDoubleArrow":u.ShapeTypes.ArrowEastWest},e}(a.ImporterBase);e.XmlImporter=f},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.getSelectedShape();return t.prototype.isEnabled.call(this)&&e.image.isEmpty},e}(n(77).EditShapeImageCommandBase);e.InsertShapeImageCommand=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.getSelectedShape();return t.prototype.isEnabled.call(this)&&!e.image.isEmpty},e.prototype.executeCore=function(e,n){return t.prototype.executeCore.call(this,e,void 0)},e}(n(77).EditShapeImageCommandBase);e.DeleteShapeImageCommand=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(263),i=n(48),r=n(264),s=n(19),a=n(293),c=n(295),u=n(296),p=n(12),h=n(25),l=n(297),d=n(35),f=n(301),y=n(6),m=n(302),g=n(8),v=n(305),P=function(){function t(){this.processDataChangesNeeded=!1,this.settings=new d.DiagramSettings,this.model=new s.DiagramModel,this.selection=new a.Selection(this.model),this.modelManipulator=new o.ModelManipulator(this.model),this.history=new c.History(this.modelManipulator),this.onNativeAction=new g.EventDispatcher,this.view=new f.ViewController(this.settings),this.commandManager=new i.CommandManager(this),this.barManager=new u.BarManager(this),this.eventManager=new r.EventManager(this),this.selection.onChanged.add(this.barManager),this.selection.onChanged.add(this),this.modelManipulator.onLoad(),this.history.onChanged.add(this),this.toolboxManager=new m.ToolboxManager(this.settings.readOnly),this.settings.onReadOnlyChanged.add(this.toolboxManager),this.apiController=new v.ApiController(this.onNativeAction,this.selection,this.model)}return t.prototype.dispose=function(){this.toolboxManager.dispose(),this.render&&this.render.dispose()},t.prototype.createDocument=function(t){this.render?this.render.replaceParent(t):(this.render=new p.RenderManager(t,this.eventManager,{pageColor:this.model.pageColor,modelSize:this.model.size,pageLandscape:this.model.pageLandscape,pageSize:this.model.pageSize,simpleView:this.settings.simpleView,readOnly:this.settings.readOnly,gridSize:this.settings.gridSize,gridVisible:this.settings.showGrid,zoomLevel:this.settings.zoomLevel,autoZoom:this.settings.autoZoom,rectangle:this.model.getRectangle(!0)}),this.settings.onZoomChanged.add(this.render.view),this.settings.onViewChanged.add(this.render.page),this.settings.onViewChanged.add(this.render.view),this.settings.onReadOnlyChanged.add(this.eventManager.mouseHandler),this.settings.onReadOnlyChanged.add(this.eventManager.visualizersManager),this.settings.onReadOnlyChanged.add(this.render),this.settings.onReadOnlyChanged.add(this.render.selection),this.eventManager.onTextInputOperation.add(this.render.input),this.eventManager.onTextInputOperation.add(this.render.items),this.eventManager.onTextInputOperation.add(this.render.selection),this.eventManager.onMouseOperation.add(this.render.items),this.eventManager.onMouseOperation.add(this.render.selection),this.eventManager.onMouseOperation.add(this.render.view),this.eventManager.onMouseOperation.add(this.render),this.eventManager.onVisualizersUpdate.add(this.render.selection),this.modelManipulator.onModelSizeChanged.add(this.render.view),this.modelManipulator.onModelSizeChanged.add(this.render.page),this.modelManipulator.onModelChanged.add(this.render.items),this.modelManipulator.onModelChanged.add(this.render.page),this.modelManipulator.onModelChanged.add(this.render.selection),this.selection.onChanged.add(this.render.selection),this.render.update(!1),this.modelManipulator.onLoad(),this.view.initialize(this.render.view),this.selection.onLoad())},t.prototype.createToolbox=function(t,e,n,o,i,r){var s=this.toolboxManager.create(t,e,n,o,i,r);this.settings.onReadOnlyChanged.add(s),s.onDragOperation.add(this),this.eventManager.registerToolbox(s)},t.prototype.applyToolboxFilter=function(t,e){return this.toolboxManager.applyFilter(t,e)},t.prototype.updateLayout=function(t){void 0===t&&(t=!1),this.render&&this.render.update(!t)},t.prototype.captureFocus=function(){this.render&&this.render.input.captureFocus()},t.prototype.isFocused=function(){return!this.render||this.render.input.isFocused()},t.prototype.addCustomShapes=function(t){var e=this;t.forEach(function(t){t.defaultWidth&&(t.defaultWidth=y.ModelUtils.getTwipsValue(e.model.units,t.defaultWidth)),t.defaultHeight&&(t.defaultHeight=y.ModelUtils.getTwipsValue(e.model.units,t.defaultHeight)),h.ShapeDescriptionManager.registerCustomShape(t)})},t.prototype.removeCustomShapes=function(t){t.forEach(function(t){h.ShapeDescriptionManager.unregisterCustomShape(t)})},t.prototype.importModel=function(t){this.model=t,this.apiController.model=t,this.importData()},t.prototype.importItemsData=function(){this.model.invalidateItems(),this.importData()},t.prototype.importData=function(){this.render&&this.render.clear(),this.selection.initialize(this.model),this.modelManipulator.load(this.model),this.history.clear(),this.eventManager.initialize(),this.modelManipulator.onLoad()},t.prototype.createDocumentDataSource=function(t,e,n,o){return this.documentDataSource=new l.DocumentDataSource(this,t,e,n,o),this.documentDataSource},t.prototype.deleteDocumentDataSource=function(){delete this.documentDataSource},t.prototype.beginUpdate=function(t){this.barManager.beginUpdate(),t&&this.render&&this.render.items.beginUpdate(),this.apiController.beginUpdate()},t.prototype.endUpdate=function(t){t&&this.render&&this.render.items.endUpdate(),this.barManager.endUpdate(),this.apiController.endUpdate()},t.prototype.notifyEdgeInserted=function(t,e,n){this.onEdgeInserted&&this.onEdgeInserted(t,e,n)},t.prototype.notifyEdgeUpdated=function(t,e,n,o){this.onEdgeUpdated&&this.onEdgeUpdated(t,e,n,o)},t.prototype.notifyEdgeRemoved=function(t,e,n,o){this.onEdgeUpdated&&this.onEdgeRemoved(t,e,n,o)},t.prototype.notifyNodeInserted=function(t,e,n){this.onNodeInserted&&this.onNodeInserted(t,e,n)},t.prototype.notifyNodeUpdated=function(t,e,n,o){this.onNodeUpdated&&this.onNodeUpdated(t,e,n,o)},t.prototype.notifyNodeRemoved=function(t,e,n,o){this.onNodeRemoved&&this.onNodeRemoved(t,e,n,o)},t.prototype.notifySelectionChanged=function(t){this.apiController.onSelectionChanged()},t.prototype.checkProcessDataChanges=function(){this.documentDataSource.isUpdateLocked()?this.processDataChangesNeeded=!0:this.processDataChanges()},t.prototype.processDataChanges=function(t){void 0===t&&(t=!0),(t||this.processDataChangesNeeded)&&(this.documentDataSource.updateItemsByModel(this.model),this.processDataChangesNeeded=!1),this.documentDataSource.isUpdateLocked()||this.raiseOnChanged()},t.prototype.notifyHistoryChanged=function(){this.settings.readOnly||(this.documentDataSource?this.checkProcessDataChanges():this.raiseOnChanged())},t.prototype.raiseOnChanged=function(){this.onChanged&&this.onChanged()},t.prototype.notifyToolboxDragStart=function(){this.onToolboxDragStart&&this.onToolboxDragStart()},t.prototype.notifyToolboxDragEnd=function(){this.onToolboxDragEnd&&this.onToolboxDragEnd()},t.prototype.notifyToggleFullscreen=function(t){this.onToggleFullscreen&&this.onToggleFullscreen(t)},t.prototype.notifyShowContextMenu=function(t,e){if(this.onShowContextMenu&&this.render){var n=void 0;if(this.selection.getSelectedItems(!0).length>0){var o=s.DiagramModel.getRectangle(this.selection.getSelectedItems(!0)),i=this.render.getEventPointByModelPoint(o.position),r=this.render.view.getAbsoluteSize(o.size);n={x:i.x,y:i.y,width:r.width,height:r.height}}if(t)this.onShowContextMenu(t.x,t.y,n);else if(e){var a=this.render.getEventPointByModelPoint(e);this.onShowContextMenu(a.x,a.y,n)}}},t.prototype.notifyHideContextMenu=function(){this.onHideContextMenu&&this.render&&this.onHideContextMenu()},t}();e.DiagramControl=P},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(83),i=n(0),r=n(5),s=n(49),a=n(100),c=function(){function t(t){this.onModelChanged=new i.EventDispatcher,this.onModelSizeChanged=new i.EventDispatcher,this.model=t,this.imageLoader=new a.ImageLoader(this.updateShapeImage.bind(this))}return t.prototype.load=function(t){this.model=t,this.model.loadAllImages(this.imageLoader),this.updateModelSize(),this.raisePageSizeChanged(t.pageSize.clone(),t.pageLandscape),this.raiseModelSizeChanged(t.size.clone()),this.raisePageColorChanged(t.pageColor),this.raiseModelRectangleChanged(i.GeometryUtils.getCommonRectangle(t.items.map(function(t){return t.rectangle})))},t.prototype.onLoad=function(){var t=[];this.model.iterateItems(function(e){t.push(new o.ItemChange(e,o.ItemChangeType.Create))}),this.raiseModelChanged(t)},t.prototype.insertToContainer=function(t,e){if(t.container&&e&&t.container.key!==e.key)throw Error("To insert an item to a container it's necessary to remove it from the current container.");e&&(e.childKeys.push(t.key),t.container=e,this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)]))},t.prototype.removeFromContainer=function(t){if(t.container){var e=t.container.childKeys.indexOf(t.key);t.container.childKeys.splice(e,1),t.container=void 0,this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])}},t.prototype.changeStyle=function(t,e,n){this.changeStyleCore(t,t.style,e,n)},t.prototype.changeStyleText=function(t,e,n){this.changeStyleCore(t,t.styleText,e,n)},t.prototype.changeStyleCore=function(t,e,n,i){void 0!==i?e[n]=i:delete e[n],t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.changeZIndex=function(t,e){t.zIndex=e,this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.changeLocked=function(t,e){t.locked=e,this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.changeContainerLocked=function(t,e){t.containerLocked=e,this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.addShape=function(t,e){if(t.attachedConnectors.length)throw Error("A creating shape should not contain existing connectors.");return t.key=void 0!==e?e:this.model.getNextKey(),this.insertShape(t)},t.prototype.insertShape=function(t){return this.model.pushItem(t),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Create)]),this.model.loadAllImages(this.imageLoader),t},t.prototype.resizeShape=function(t,e,n){t.position=e,t.size=n,t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.moveShape=function(t,e){t.position=e,t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.changeShapeParameters=function(t,e){t.parameters.forEach(function(t){var n=e.get(t.key);n&&(t.value=n.value)}),t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.changeShapeText=function(t,e){t.text=e,t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.changeShapeImage=function(t,e){t.image=e;var n=s.ImageCache.instance.createUnloadedInfoByShapeImageInfo(e);this.imageLoader.load(n),t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.changeShapeExpanded=function(t,e){t.expanded=e,t.toggleExpandedSize(),t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.deleteShape=function(t){if(t.attachedConnectors.length)throw Error("A removing shape should not contain existing connectors.");this.removeShape(t)},t.prototype.removeShape=function(t){this.model.removeItem(t),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Remove)])},t.prototype.updateShapeImage=function(t){if(t.imageUrl){var e=this.model.findShapesByImageUrl(t.imageUrl),n=[];e.forEach(function(e){t.base64?e.image.loadBase64Content(t.base64):e.image.setUnableToLoadFlag(),e.invalidatePrimitives(),n.push(new o.ItemChange(e,o.ItemChangeType.UpdateStructure))}),n.length>0&&this.raiseModelChanged(n)}},t.prototype.addConnector=function(t,e){if(t.beginItem||t.endItem)throw Error("Creating connector should not contain begin/end items");return t.key=void 0!==e?e:this.model.getNextKey(),this.insertConnector(t)},t.prototype.insertConnector=function(t){return this.model.pushItem(t),t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Create)]),t},t.prototype.deleteConnector=function(t){if(t.beginItem||t.endItem)throw Error("Creating connector should not contain begin/end items");this.removeConnector(t)},t.prototype.removeConnector=function(t){this.model.removeItem(t),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Remove)])},t.prototype.moveConnectorPoint=function(t,e,n){t.points[e]=n,t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.addConnectorPoint=function(t,e,n){t.points.splice(e,0,n),t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.deleteConnectorPoint=function(t,e){t.points.splice(e,1),t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.addConnection=function(t,e,n,i){var s=t.getExtremeItem(i),a=t.getExtremeConnectionPointIndex(i);if(s!==e||a!==n){if(s)throw Error("Connector is already connected");e.attachedConnectors.push(t),i===r.ConnectorPosition.Begin?(t.beginItem=e,t.beginConnectionPointIndex=n):(t.endItem=e,t.endConnectionPointIndex=n),t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])}},t.prototype.setConnectionPointIndex=function(t,e,n){if(!t.getExtremeItem(n))throw Error("Connection should be connected");n===r.ConnectorPosition.Begin?t.beginConnectionPointIndex=e:t.endConnectionPointIndex=e,t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.deleteConnection=function(t,e){var n=t.getExtremeItem(e);n&&(n.attachedConnectors.splice(n.attachedConnectors.indexOf(t),1),e===r.ConnectorPosition.Begin?(t.beginItem=null,t.beginConnectionPointIndex=-1):(t.endItem=null,t.endConnectionPointIndex=-1),t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)]))},t.prototype.changeConnectorProperty=function(t,e,n){t.properties[e]=n,t.invalidateRenderPoints(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.changeConnectorText=function(t,e,n){t.setText(e,n),t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.UpdateStructure)])},t.prototype.changeConnectorTextPosition=function(t,e,n){var i=t.getText(e);t.setText(null,e),t.setText(i,n),t.invalidatePrimitives(),this.raiseModelChanged([new o.ItemChange(t,o.ItemChangeType.Update)])},t.prototype.changeModelSize=function(t,e){this.model.size.width=t.width,this.model.size.height=t.height,this.raiseModelSizeChanged(this.model.size.clone(),e),(e.left||e.top)&&(this.model.snapStartPoint=this.model.snapStartPoint.offset(e.left,e.top),this.raiseSnapPointChange(this.model.snapStartPoint))},t.prototype.changePageSize=function(t){this.model.pageSize.equals(t)||(this.model.pageSize=t,this.model.size=new i.Size(this.model.pageWidth,this.model.pageHeight),this.raiseModelSizeChanged(this.model.size.clone()),this.raisePageSizeChanged(this.model.pageSize,this.model.pageLandscape))},t.prototype.changePageLandscape=function(t){this.model.pageLandscape!==t&&(this.model.pageLandscape=t,this.model.pageSize.width!==this.model.pageSize.height&&(this.model.size=new i.Size(this.model.pageWidth,this.model.pageHeight),this.raiseModelSizeChanged(this.model.size.clone()),this.raisePageSizeChanged(this.model.pageSize,this.model.pageLandscape)))},t.prototype.changePageColor=function(t){this.model.pageColor!==t&&(this.model.pageColor=t,this.raisePageColorChanged(t))},t.prototype.changePageProperty=function(t){t(this.model)},t.prototype.getModelSizeUpdateOffset=function(){var t=this.model.getRectangle(!1),e=this.model.getRectangle(!0);e.equals(t)||this.raiseModelRectangleChanged(e);var n=-Math.floor(e.left/this.model.pageWidth),o=-Math.floor(e.top/this.model.pageHeight),r=-Math.floor((this.model.size.width-e.right)/this.model.pageWidth),s=-Math.floor((this.model.size.height-e.bottom)/this.model.pageHeight);return new i.Offset(n*this.model.pageWidth,o*this.model.pageHeight,r*this.model.pageWidth,s*this.model.pageHeight)},t.prototype.updateModelSize=function(){var t=this.getModelSizeUpdateOffset();if(!t.isEmpty()){var e=Math.max(this.model.size.width+t.left+t.right,this.model.pageWidth),n=Math.max(this.model.size.height+t.top+t.bottom,this.model.pageHeight);this.model.size=new i.Size(e,n)}},t.prototype.raiseModelChanged=function(t){this.onModelChanged.raise1(function(e){return e.notifyModelChanged(t)})},t.prototype.raisePageColorChanged=function(t){this.onModelChanged.raise1(function(e){return e.notifyPageColorChanged(t)})},t.prototype.raisePageSizeChanged=function(t,e){this.onModelChanged.raise1(function(n){return n.notifyPageSizeChanged(t,e)})},t.prototype.raiseModelSizeChanged=function(t,e){this.onModelSizeChanged.raise1(function(n){return n.notifyModelSizeChanged(t,e)})},t.prototype.raiseModelRectangleChanged=function(t){this.onModelSizeChanged.raise1(function(e){return e.notifyModelRectangleChanged(t)})},t.prototype.raiseSnapPointChange=function(t){this.onModelSizeChanged.raise1(function(e){return e.notifySnapPointPositionChanged(t)})},t}();e.ModelManipulator=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(265),i=n(0),r=n(284),s=n(124),a=n(8),c=n(286),u=n(125),p=n(292),h=function(){function t(t){this.onMouseOperation=new i.EventDispatcher,this.onTextInputOperation=new i.EventDispatcher,this.toolboxes=[],this.control=t,this.visualizersManager=a.Browser.TouchUI?new p.VisualizerTouchManager(t.selection,t.model,this,t.settings):new u.VisualizerManager(t.selection,t.model,this,t.settings),this.onMouseOperation.add(this.visualizersManager),this.mouseHandler=new o.MouseHandler(t.history,t.selection,t.model,this,t.settings.readOnly,t.view,this.visualizersManager,t.settings,t.barManager,t.onNativeAction),this.textInputHandler=new r.TextInputHandler(t),this.contextMenuHandler=a.Browser.TouchUI?new c.ContextMenuTouchHandler(t.selection):new s.ContextMenuHandler,this.contextMenuHandler.onVisibilityChanged.add(t),this.onMouseOperation.add(this.contextMenuHandler)}return Object.defineProperty(t.prototype,"onVisualizersUpdate",{get:function(){return this.visualizersManager.onVisualizersUpdate},enumerable:!0,configurable:!0}),t.prototype.registerToolbox=function(t){this.toolboxes.push(t)},t.prototype.initialize=function(){this.visualizersManager.initialize(this.control.model),this.mouseHandler.initialize(this.control.model)},t.prototype.onMouseDown=function(t){this.mouseHandler.onMouseDown(t),this.contextMenuHandler.onMouseDown(t),this.visualizersManager.onMouseDown(t)},t.prototype.onMouseMove=function(t){this.processDragging(t),this.mouseHandler.onMouseMove(t)},t.prototype.onMouseUp=function(t){this.mouseHandler.onMouseUp(t),this.contextMenuHandler.onMouseUp(t),this.visualizersManager.onMouseUp(t),this.processDragging(t)},t.prototype.onMouseEnter=function(t){this.visualizersManager.onMouseEnter(t)},t.prototype.onMouseLeave=function(t){this.visualizersManager.onMouseLeave(t)},t.prototype.onDblClick=function(t){this.mouseHandler.onMouseDblClick(t),this.textInputHandler.onDblClick(t)},t.prototype.onClick=function(t){this.mouseHandler.onMouseClick(t)},t.prototype.onContextMenu=function(t){this.contextMenuHandler.onContextMenu(t)},t.prototype.onLongTouch=function(t){this.mouseHandler.onLongTouch(t),this.contextMenuHandler.onLongTouch(t)},t.prototype.onBlur=function(t){this.contextMenuHandler.onBlur(t),this.visualizersManager.onBlur(t)},t.prototype.onFocus=function(t){this.contextMenuHandler.onFocus(t),this.visualizersManager.onFocus(t)},t.prototype.onKeyDown=function(t){var e=t.getShortcutCode();this.onShortcut(e)&&(this.visualizersManager.updateConnectionPoints(),t.preventDefault=!0)},t.prototype.onTextInputBlur=function(t){this.textInputHandler.onBlur(t),this.contextMenuHandler.onTextInputBlur(t)},t.prototype.onTextInputFocus=function(t){this.textInputHandler.onFocus(t),this.contextMenuHandler.onTextInputFocus(t)},t.prototype.onTextInputKeyDown=function(t){this.textInputHandler.onKeyDown(t)},t.prototype.onShortcut=function(t){return!!this.control.commandManager.processShortcut(t)||(!!this.mouseHandler.onShortcut(t)||void 0)},t.prototype.onPaste=function(t){!this.textInputHandler.isTextInputActive()&&this.control.commandManager.processPaste(t.clipboardData)&&(this.visualizersManager.updateConnectionPoints(),t.preventDefault=!0)},t.prototype.onMouseWheel=function(t){this.mouseHandler.onWheel(t)&&(t.preventDefault=!0)},t.prototype.isFocused=function(){return this.control.isFocused()},t.prototype.processDragging=function(t){var e=this.getDraggingEvent();e&&!this.draggingEvent?(this.draggingEvent=e,this.mouseHandler.onDragStart(this.draggingEvent),this.control.captureFocus()):!e&&this.draggingEvent&&(delete this.draggingEvent,this.mouseHandler.onDragEnd(t))},t.prototype.getDraggingEvent=function(){return this.toolboxes.filter(function(t){return t.draggingObject}).map(function(t){return t.draggingObject.evt})[0]},t.prototype.onDocumentDragStart=function(t){this.control.beginUpdate(),this.control.captureFocus(),this.onMouseOperation.raise("notifyDragStart",t)},t.prototype.onDocumentDragEnd=function(t){this.onMouseOperation.raise("notifyDragEnd",t),this.control.endUpdate()},t.prototype.onDocumentDragScrollStart=function(){this.onMouseOperation.raise1(function(t){return t.notifyDragScrollStart()})},t.prototype.onDocumentDragScrollEnd=function(){this.onMouseOperation.raise1(function(t){return t.notifyDragScrollEnd()})},t.prototype.onDocumentClick=function(t){this.control.beginUpdate(),this.control.endUpdate()},t.prototype.raiseTextInputStart=function(t,e,n,o){this.onTextInputOperation.raise("notifyTextInputStart",t,e,n,o)},t.prototype.raiseTextInputEnd=function(t){this.onTextInputOperation.raise("notifyTextInputEnd",t)},t}();e.EventManager=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(117),i=n(10),r=n(0),s=n(16),a=n(6),c=n(78),u=n(8),p=n(281),h=n(123),l=n(282),d=function(){function t(t,e,n,o,i,r,s,a,c,u){this.history=t,this.selection=e,this.model=n,this.eventManager=o,this.readOnly=i,this.view=r,this.visualizerManager=s,this.settings=a,this.bars=c,this.nativeActions=u,this.initialize(n)}return t.prototype.initialize=function(t){this.model=t,this.initializeDefaultState()},t.prototype.initializeDefaultState=function(){this.defaultState=this.readOnly?u.Browser.TouchUI?new p.MouseHandlerDefaultReadOnlyTouchState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.settings,this.bars):new h.MouseHandlerDefaultReadOnlyState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.settings,this.bars):u.Browser.TouchUI?new l.MouseHandlerDefaultTouchState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.settings,this.bars):new o.MouseHandlerDefaultState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.settings,this.bars),this.switchToDefaultState()},t.prototype.onMouseDown=function(t){this.mouseDownEvent=t,this.state.onMouseDown(t)},t.prototype.onMouseMove=function(t){this.state.onMouseMove(t)},t.prototype.onMouseUp=function(t){this.state.onMouseUp(t)},t.prototype.onMouseDblClick=function(t){this.state.onMouseDblClick(t),this.tryRaiseUserAction(t,function(t,e){return t.notifyItemDblClick(e)})},t.prototype.onMouseClick=function(t){this.state.onMouseClick(t),this.tryRaiseUserAction(t,function(t,e){return t.notifyItemClick(e)})},t.prototype.onLongTouch=function(t){if(t.touches&&!(t.touches.length>1)){var e=t.source.key;void 0===e?this.selection.clear():this.selection.hasKey(e)?this.selection.remove(e):this.selection.add(e)}},t.prototype.onShortcut=function(t){return this.state.onShortcut(t)},t.prototype.onWheel=function(t){return this.state.onMouseWheel(t)},t.prototype.onDragStart=function(t){this.state.onDragStart(t)},t.prototype.onDragEnd=function(t){this.state.onDragEnd(t)},t.prototype.getSnappedPos=function(t,e,n){return!this.settings.snapToGrid||t.modifiers&s.ModifierKey.Ctrl?e:a.ModelUtils.getSnappedPos(this.model,this.settings.gridSize,e,n)},t.prototype.getSnappedPoint=function(t,e,n){var o=this.getSnappedPos(t,e.x,!0),i=this.getSnappedPos(t,e.y,!1);return void 0===n?new r.Point(o,i):Math.pow(e.x-o,2)+Math.pow(e.y-i,2)0?Math.min(o.height+1,p):p,u=!this.sideH&&u>0?Math.min(o.width+1,u):u,this.lockH||this.lockV||!this.lockAspectRatio?(u=this.lockH?0:u,p=this.lockV?0:p,i=Math.max(e.minSize,this.sideH?o.width+u:o.width-u),s=Math.max(e.minSize,this.sideV?o.height+p:o.height-p)):Math.abs(u)>Math.abs(p)?(i=this.sideH?Math.max(e.minSize,o.width+u):o.width-u,s=o.height*(i/o.width)):(s=this.sideV?Math.max(e.minSize,o.height+p):o.height-p,i=o.width*(s/o.height)),this.lockH||(i=this.handler.getSnappedPos(t,n.x+i,!0)-n.x),this.lockV||(s=this.handler.getSnappedPos(t,n.y+s,!1)-n.y),new r.Size(i,s)},e.prototype.getPosition=function(t,e,n,o){var i=o.x,a=o.y;if(this.resizeEventSource===s.ResizeEventSource.ResizeBox_N||this.resizeEventSource===s.ResizeEventSource.ResizeBox_NE||this.resizeEventSource===s.ResizeEventSource.ResizeBox_NW){a+=n.height-e.height;var c=this.handler.getSnappedPos(t,a,!1);e.height+=a-c,a=c}if(this.resizeEventSource===s.ResizeEventSource.ResizeBox_W||this.resizeEventSource===s.ResizeEventSource.ResizeBox_NW||this.resizeEventSource===s.ResizeEventSource.ResizeBox_SW){i+=n.width-e.width;var u=this.handler.getSnappedPos(t,i,!0);e.width+=i-u,i=u}return new r.Point(i,a)},e.minSize=360,e}(c.MouseHandlerDraggingState);e.MouseHandlerResizeShapeState=h},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),s=n(119),a=n(50),c=n(6),u=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.onMouseDown=function(e){this.startPoint=e.modelPoint,this.connectorKey=e.source.key,this.pointIndex=parseInt(e.source.value)+1,t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this.getSnappedPoint(t,t.modelPoint);this.pointCreated?this.history.addAndRedo(new a.MoveConnectorPointHistoryItem(this.connectorKey,this.pointIndex,e)):(this.history.addAndRedo(new s.AddConnectorPointHistoryItem(this.connectorKey,this.pointIndex,e)),this.pointCreated=!0),this.handler.tryUpdateModelSize()},e.prototype.onFinishWithChanges=function(){c.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.model.findConnector(this.connectorKey))},e.prototype.getDraggingElementKeys=function(){return[this.connectorKey]},e}(r.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorSideState=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),s=n(102),a=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i.startScrollLeft=0,i.startScrollTop=0,i}return i(e,t),e.prototype.onMouseDown=function(e){this.startPoint=e.modelPoint,this.shape=this.model.findShape(e.source.key),this.parameterPointKey=e.source.value,this.startParameters=this.shape.parameters.clone(),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this.handler.getSnappedPos(t,t.modelPoint.x-this.startPoint.x,!0),n=this.handler.getSnappedPos(t,t.modelPoint.y-this.startPoint.y,!1),o=this.startParameters.clone();this.shape.description.modifyParameters(this.shape,o,e,n),this.history.addAndRedo(new s.ChangeShapeParametersHistoryItem(this.shape.key,o))},e.prototype.getDraggingElementKeys=function(){return[this.shape.key]},e}(r.MouseHandlerDraggingState);e.MouseHandlerDragParameterPointState=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),s=n(37),a=n(52),c=n(118),u=n(44),p=n(55),h=n(46),l=n(36),d=function(t){function e(e,n,o,i,r,s){var a=t.call(this,e,n,o,i)||this;return a.selection=r,a.connectionPointIndex=s,a}return i(e,t),e.prototype.onMouseDown=function(e){void 0===this.connectionPointIndex&&(this.connectionPointIndex=parseInt(e.source.value)),this.connectedItem=this.model.findItem(e.source.key),this.pointIndex=1,this.pointPosition=r.ConnectorPosition.End,t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(e){var n=this,o=this.getSnappedPoint(e,e.modelPoint);if(this.connector)t.prototype.onApplyChanges.call(this,e);else{var i=new a.AddConnectorHistoryItem([this.connectedItem.getConnectionPointPosition(this.connectionPointIndex,o),o]);this.history.addAndRedo(i),this.connector=this.model.findConnector(i.connectorKey),this.connector.properties.forEach(function(t){n.history.addAndRedo(new p.ChangeConnectorPropertyHistoryItem(n.connector.key,t,n.selection.inputPosition.getConnectorPropertyDefaultValue(t)))}),this.connector.style.forEach(function(t){n.history.addAndRedo(new h.ChangeStyleHistoryItem(n.connector.key,t,n.selection.inputPosition.getStylePropertyDefaultValue(t)))}),this.connector.styleText.forEach(function(t){n.history.addAndRedo(new l.ChangeStyleTextHistoryItem(n.connector.key,t,n.selection.inputPosition.getStyleTextPropertyDefaultValue(t)))}),this.history.addAndRedo(new s.AddConnectionHistoryItem(this.connector,this.connectedItem,this.connectionPointIndex,r.ConnectorPosition.Begin))}},e.prototype.onFinishWithChanges=function(){t.prototype.onFinishWithChanges.call(this),this.history.addAndRedo(new u.SetSelectionHistoryItem(this.selection,[this.connector.key]))},e}(c.MouseHandlerMoveConnectorPointStateBase);e.MouseHandlerCreateConnectorState=d},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(5),a=n(26),c=n(119),u=n(50),p=n(6),h=n(4),l=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.onMouseDown=function(e){this.startPoint=e.modelPoint,this.connector=this.model.findConnector(e.source.key);var n=e.source.value.split("_"),o=parseInt(n[0]),i=parseInt(n[1]),r=this.connector.getRenderPoints(!0);this.renderPoint1=r[o].clone(),this.renderPoint2=r[i].clone(),this.isVerticalOrientation=this.renderPoint1.x===this.renderPoint2.x,-1!==this.renderPoint1.pointIndex?(this.pointIndex1=this.renderPoint1.pointIndex,0===this.pointIndex1?(this.pointIndex1++,this.correctEdgePoint(this.renderPoint1,this.renderPoint2,this.connector.beginItem,this.connector.beginConnectionPointIndex)):this.point1=this.connector.points[this.pointIndex1]):this.pointIndex1=this.findPointIndex(r,o,!1)+1,-1!==this.renderPoint2.pointIndex?(this.pointIndex2=this.renderPoint2.pointIndex,this.pointIndex2===this.connector.points.length-1?this.correctEdgePoint(this.renderPoint2,this.renderPoint1,this.connector.endItem,this.connector.endConnectionPointIndex):this.point2=this.connector.points[this.pointIndex2]):this.pointIndex2=this.findPointIndex(r,i,!0),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this;if(!this.pointCreated){var n=void 0,o=void 0;void 0===this.point1&&(this.point1=new r.Point(this.renderPoint1.x,this.renderPoint1.y),this.history.addAndRedo(new c.AddConnectorPointHistoryItem(this.connector.key,this.pointIndex1,this.point1)),n=this.point1,this.pointIndex2++),void 0===this.point2&&(this.point2=new r.Point(this.renderPoint2.x,this.renderPoint2.y),this.history.addAndRedo(new c.AddConnectorPointHistoryItem(this.connector.key,this.pointIndex2,this.point2)),o=this.point2),p.ModelUtils.removeUnnecessaryConnectorPoints(this.history,this.connector,[n,o],function(t){te.y?t.y-=Math.min(i,t.y-e.y):t.y+=Math.min(i,e.y-t.y):t.x>e.x?t.x-=Math.min(i,t.x-e.x):t.x+=Math.min(i,e.x-t.x)},e.prototype.getDraggingElementKeys=function(){return[this.connector.key]},e}(a.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorOrthogonalSideState=l},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=n(25),a=n(0),c=n(51),u=n(44),p=n(46),h=n(36),l=n(26),d=n(91),f=n(6),y=n(32),m=300,g=function(t){function e(e,n,o,i,r){var s=t.call(this,e)||this;return s.history=n,s.model=o,s.selection=i,s.visualizerManager=r,s.isModelEmpty=0===o.items.length,s}return i(e,t),e.prototype.cancelChanges=function(){this.tryRemoveTimer()},e.prototype.onDragStart=function(t){this.dragging=t},e.prototype.onDragEnd=function(t){this.cancelChanges(),this.handler.switchToDefaultState()},e.prototype.onMouseMove=function(t){var e=this;t.source.type>r.MouseEventElementType.Background?(this.tryRemoveTimer(),this.switchToDraggingState(t,!1)):t.source.type!==r.MouseEventElementType.Background||this.isModelEmpty?void 0!==this.nonPageAreaTimer&&this.tryRemoveTimer():(this.savedEvt=t,void 0===this.nonPageAreaTimer&&(this.nonPageAreaTimer=setTimeout(function(){return e.switchToDraggingState(e.savedEvt,!0)},500)))},e.prototype.switchToDraggingState=function(t,e){this.handler.switchState(new v(this.handler,this.history,this.model,this.selection,this.visualizerManager,e)),this.handler.state.onDragStart(this.dragging),this.handler.state.onMouseMove(t)},e.prototype.tryRemoveTimer=function(){void 0!==this.nonPageAreaTimer&&(clearTimeout(this.nonPageAreaTimer),delete this.nonPageAreaTimer)},e.prototype.finish=function(){this.tryRemoveTimer()},e}(y.MouseHandlerCancellableState);e.MouseHandlerBeforeToolboxDraggingState=g;var v=function(t){function e(e,n,o,i,r,s){var a=t.call(this,e,n)||this;return a.model=o,a.selection=i,a.visualizerManager=r,s||(a.updatePageSizeTimer=setTimeout(function(){a.handler.tryUpdateModelSize(),delete a.updatePageSizeTimer},m)),a}return i(e,t),e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e);var n=this.model.findShape(this.shapeKey);if(n){this.visualizerManager.setExtensionLines([n]);var o=f.ModelUtils.findContainerByEventKey(this.model,this.selection,e.source.key);o&&f.ModelUtils.canInsertToContainer(this.model,n,o)?this.visualizerManager.setContainerTarget(o,e.source.type):this.visualizerManager.resetContainerTarget()}},e.prototype.getDraggingElementKeys=function(){return void 0===this.shapeKey?[]:[this.shapeKey]},e.prototype.onApplyChanges=function(t){var e=this;if(void 0===t.source.type)return this.dragging.onCaptured(!1),void(void 0===this.shapeKey||this.deleteHistoryItem||(this.deleteHistoryItem=new d.DeleteShapeHistoryItem(this.shapeKey),this.history.addAndRedo(this.deleteHistoryItem)));this.dragging.onCaptured(!0),void 0===this.shapeKey&&(this.startPoint=t.modelPoint,this.shapeKey=this.insertToolboxItem(t)),this.deleteHistoryItem&&(this.history.undoTransactionTo(this.deleteHistoryItem),delete this.deleteHistoryItem);var n=this.getPosition(t,this.startShapePosition),o=this.model.findShape(this.shapeKey);f.ModelUtils.setShapePosition(this.history,this.model,o,n),f.ModelUtils.updateMovingShapeConnections(this.history,o,this.connectorsWithoutBeginItemInfo,this.connectorsWithoutEndItemInfo,function(){e.visualizerManager.resetConnectionTarget(),e.visualizerManager.resetConnectionPoints()},function(t,n){e.visualizerManager.setConnectionTarget(t,r.MouseEventElementType.Shape),e.visualizerManager.setConnectionPoints(t,r.MouseEventElementType.Shape,n,!0)}),f.ModelUtils.updateShapeAttachedConnectors(this.history,this.model,o);var i=f.ModelUtils.findContainerByEventKey(this.model,this.selection,t.source.key);o&&i&&f.ModelUtils.canInsertToContainer(this.model,o,i)?f.ModelUtils.insertToContainer(this.history,this.model,o,i):f.ModelUtils.removeFromContainer(this.history,this.model,o),void 0===this.updatePageSizeTimer&&this.handler.tryUpdateModelSize(function(t,n){e.connectorsWithoutBeginItemInfo.forEach(function(e){e.point.x+=t,e.point.y+=n}),e.connectorsWithoutEndItemInfo.forEach(function(e){e.point.x+=t,e.point.y+=n})})},e.prototype.onFinishWithChanges=function(){this.history.addAndRedo(new u.SetSelectionHistoryItem(this.selection,[this.shapeKey]))},e.prototype.onDragStart=function(t){this.dragging=t,this.connectorsWithoutBeginItemInfo=f.ModelUtils.getConnectorsWithoutBeginItemInfo(this.model),this.connectorsWithoutEndItemInfo=f.ModelUtils.getConnectorsWithoutEndItemInfo(this.model)},e.prototype.onDragEnd=function(t){void 0!==this.shapeKey&&void 0===t.source.type&&this.cancelChanges(),this.handler.switchToDefaultState()},e.prototype.finish=function(){this.visualizerManager.resetExtensionLines(),this.visualizerManager.resetContainerTarget(),this.visualizerManager.resetConnectionTarget(),this.visualizerManager.resetConnectionPoints(),this.dragging.onFinishDragging(),t.prototype.finish.call(this)},e.prototype.updateShapeProperties=function(t){var e=this;this.selection.inputPosition.stylePropertiesDefault.forEach(function(n){e.history.addAndRedo(new p.ChangeStyleHistoryItem(t,n,e.selection.inputPosition.getStylePropertyDefaultValue(n)))}),this.selection.inputPosition.styleTextPropertiesDefault.forEach(function(n){e.history.addAndRedo(new h.ChangeStyleTextHistoryItem(t,n,e.selection.inputPosition.getStyleTextPropertyValue(n)))})},e.prototype.insertToolboxItem=function(t){var e=s.ShapeDescriptionManager.get(this.dragging.data);this.startShapePosition=this.getSnappedPoint(t,new a.Point(t.modelPoint.x-e.defaultSize.width/2,t.modelPoint.y-e.defaultSize.height/2));var n=new c.AddShapeHistoryItem(this.dragging.data,this.startShapePosition);return this.history.addAndRedo(n),this.updateShapeProperties(n.shapeKey),n.shapeKey},e.prototype.getPosition=function(t,e){return this.getSnappedPoint(t,new a.Point(e.x+t.modelPoint.x-this.startPoint.x,e.y+t.modelPoint.y-this.startPoint.y))},e}(l.MouseHandlerDraggingState);e.MouseHandlerToolboxDraggingState=v},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(26),s=n(274),a=n(54),c=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i}return i(e,t),e.prototype.onMouseDown=function(e){this.connector=this.model.findConnector(e.source.key),this.position=parseFloat(e.source.value),this.text=this.connector.getText(this.position),this.savedText="",t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(t){var e=this.connector.getTextPositionByPoint(t.modelPoint);if(e!=this.position){var n=this.connector.getText(e);""!==n&&n!==this.text&&(this.history.addAndRedo(new a.ChangeConnectorTextHistoryItem(this.connector,e,"")),this.savedText=n),this.history.addAndRedo(new s.ChangeConnectorTextPositionHistoryItem(this.connector,this.position,e)),""!==this.savedText&&this.savedText!==n&&(this.history.addAndRedo(new a.ChangeConnectorTextHistoryItem(this.connector,this.position,this.savedText)),this.savedText=""),this.position=e}},e.prototype.getDraggingElementKeys=function(){return[this.connector.key]},e}(r.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorTextState=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e.key,i.position=n,i.newPosition=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorTextPosition(e,this.position,this.newPosition)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorTextPosition(e,this.newPosition,this.position)},e}(n(3).HistoryItem);e.ChangeConnectorTextPositionHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(32),s=n(276),a=n(6),c=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.history=n,i.model=o,i}return i(e,t),e.prototype.onMouseUp=function(t){var e=this.model.findShape(t.source.key);e&&(this.history.beginTransaction(),this.history.addAndRedo(new s.ToggleShapeExpandedHistoryItem(e)),a.ModelUtils.updateShapeAttachedConnectors(this.history,this.model,e),a.ModelUtils.updateContainerConnectorsAttachedPoints(this.history,this.model,e),this.handler.tryUpdateModelSize(),this.history.endTransaction(),this.handler.raiseClick([e.key])),this.handler.switchToDefaultState()},e}(r.MouseHandlerStateBase);e.MouseHandlerToggleShapeExpandedState=c},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.shapeKey=e.key,n.expanded=e.expanded,n}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeExpanded(e,!this.expanded)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeExpanded(e,this.expanded)},e}(n(3).HistoryItem);e.ToggleShapeExpandedHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=n(0),a=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.selection=n,i.visualizerManager=o,i}return i(e,t),e.prototype.finish=function(){this.handler.raiseDragEnd([]),this.visualizerManager.resetSelectionRectangle(),t.prototype.finish.call(this)},e.prototype.cancelChanges=function(){},e.prototype.onMouseDown=function(t){this.startPoint=t.modelPoint,this.handler.raiseDragStart([])},e.prototype.onMouseMove=function(t){t.button!==r.MouseButton.Left?this.handler.switchToDefaultState():(this.rectangle=s.Rectangle.createByPoints(this.startPoint,t.modelPoint),this.visualizerManager.setSelectionRectangle(this.rectangle))},e.prototype.onMouseUp=function(t){void 0!==this.rectangle?this.selection.selectRect(this.rectangle):this.selection.set([]),this.rectangle=void 0,this.handler.switchToDefaultState()},e}(n(32).MouseHandlerCancellableState);e.MouseHandlerSelectionState=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(32),s=n(10),a=n(16),c=n(8),u=n(48),p=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.settings=n,r.view=o,r.bars=i,r}return i(e,t),e.prototype.onMouseWheel=function(t){return this.trySwitchToDefault(t)?this.handler.state.onMouseWheel(t):(this.settings.zoomLevel=this.view.getNextStepZoom(t.deltaY<0),this.bars.updateItemsState([u.DiagramCommand.ZoomLevel]),t.source.type===s.MouseEventElementType.Background?this.view.resetScroll():(this.view.scrollTo(t.modelPoint,t.offsetPoint),this.view.normalize()),t.preventDefault=!0,!0)},e.prototype.onMouseUp=function(t){this.handler.switchToDefaultState(),this.handler.state.onMouseUp(t)},e.prototype.onMouseDown=function(t){this.handler.switchToDefaultState(),this.handler.state.onMouseDown(t)},e.prototype.onMouseMove=function(t){this.trySwitchToDefault(t)&&this.handler.state.onMouseMove(t)},e.prototype.trySwitchToDefault=function(t){if(!(t.modifiers&a.ModifierKey.Ctrl))return this.handler.switchToDefaultState(),!0},e.prototype.start=function(){t.prototype.start.call(this),this.settings.zoomLevel=this.view.getZoom(),this.settings.autoZoom!==c.AutoZoomMode.Disabled&&(this.settings.autoZoom=c.AutoZoomMode.Disabled,this.bars.updateItemsState([u.DiagramCommand.SwitchAutoZoom,u.DiagramCommand.ToggleAutoZoom]))},e}(r.MouseHandlerStateBase);e.MouseHandlerZoomOnWheelState=p},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(78),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e),this.switchToMoveClonedShapeState(e)},e.prototype.switchToMoveClonedShapeState=function(t){r.MouseHandlerMoveClonedShapeState.isMoveClonedShapeEvent(t)&&(this.cancelChanges(),this.handler.switchToMoveClonedShapeState(this.startPoint),this.handler.onMouseDown(t))},e}(n(280).MouseHandlerMoveShapeOrthogonallyState);e.MouseHandlerMoveShapeState=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(16),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onApplyChanges=function(e){this.calculateFixedPosition(e),t.prototype.onApplyChanges.call(this,e)},e.prototype.getXPosition=function(e,n){return this.fixedX?n:t.prototype.getXPosition.call(this,e,n)},e.prototype.getYPosition=function(e,n){return this.fixedY?n:t.prototype.getYPosition.call(this,e,n)},e.prototype.calculateFixedPosition=function(t){(this.fixedX=!1,this.fixedY=!1,t.modifiers&r.ModifierKey.Shift)&&(Math.abs(this.startPoint.x-t.modelPoint.x)1?this.startZooming(t):this.startScrolling(t)},e.prototype.startZooming=function(t){this.handler.switchState(new s.MouseHandlerZoomOnPinchState(this.handler,this.selection,this.settings,this.view,this.bars))},e.prototype.canSelectOnMouseUp=function(t){return!this.inSelection(t)},e.prototype.canClearSelectionOnMouseUp=function(){return!1},e}(r.MouseHandlerDefaultState);e.MouseHandlerDefaultTouchState=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(35),s=n(48),a=n(0),c=n(122),u=function(t){function e(e,n,o,i,r){var s=t.call(this,e,i,n)||this;return s.selection=n,s.settings=o,s.view=i,s.bars=r,s}return i(e,t),e.prototype.onMouseDown=function(e){t.prototype.onMouseDown.call(this,e),e.touches.length>1&&(this.startDistance=this.getTouchDistance(e),this.startZoomLevel=this.settings.zoomLevel,this.prevDistance=this.startDistance)},e.prototype.onMouseMove=function(e){if(e.touches.length>1){var n=this.getTouchDistance(e);Math.abs(this.prevDistance-n)>1&&(this.settings.zoomLevel=this.startZoomLevel*(n/this.startDistance),this.bars.updateItemsState([s.DiagramCommand.ZoomLevel]),this.view.scrollTo(this.getMiddleLayoutPoint(e),this.getMiddleAbsPoint(e)),this.view.normalize(),this.prevDistance=n)}t.prototype.onMouseMove.call(this,e)},e.prototype.onMouseUp=function(t){0===t.touches.length&&setTimeout(function(){this.handler.switchToDefaultState()}.bind(this),1)},e.prototype.start=function(){t.prototype.start.call(this),this.settings.zoomLevel=this.view.getZoom(),this.settings.autoZoom!==r.AutoZoomMode.Disabled&&(this.settings.autoZoom=r.AutoZoomMode.Disabled,this.bars.updateItemsState([s.DiagramCommand.SwitchAutoZoom,s.DiagramCommand.ToggleAutoZoom]))},e.prototype.getTouchDistance=function(t){var e=new a.Point(t.touches[0].offsetPoint.x,t.touches[0].offsetPoint.y),n=new a.Point(t.touches[1].offsetPoint.x,t.touches[1].offsetPoint.y);return a.GeometryUtils.getDistance(e,n)},e.prototype.getPointByEvent=function(t){return this.getMiddleAbsPoint(t)},e.prototype.getMiddleAbsPoint=function(t){return t.touches.length>1?e.getMiddlePointByEvent(t,function(t){return t.offsetPoint}):t.offsetPoint},e.prototype.getMiddleLayoutPoint=function(t){return t.touches.length>1?e.getMiddlePointByEvent(t,function(t){return t.modelPoint}):t.modelPoint},e.getMiddlePointByEvent=function(t,e){if(t.touches.length>1)return new a.Point((e(t.touches[0]).x+e(t.touches[1]).x)/2,(e(t.touches[0]).y+e(t.touches[1]).y)/2)},e}(c.MouseHandlerScrollingState);e.MouseHandlerZoomOnPinchState=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(285),i=n(10),r=n(16),s=n(11),a=n(5),c=n(54),u=function(){function t(t){this.control=t}return t.prototype.startTextInput=function(t,e){if(!t.isLocked&&t.enableText&&t.allowEditText&&!this.control.settings.readOnly){if(this.control.beginUpdate(),this.textInputItem=t,this.textInputItem instanceof s.Shape){var n=this.textInputItem.textEditRectangle;this.control.eventManager.raiseTextInputStart(this.textInputItem,this.textInputItem.text,n.position,n.size)}this.textInputItem instanceof a.Connector&&(this.textInputPosition=e,this.control.eventManager.raiseTextInputStart(this.textInputItem,this.textInputItem.getText(this.textInputPosition),this.textInputItem.getTextPoint(this.textInputPosition)))}},t.prototype.endTextInput=function(){var t=this.textInputItem;delete this.textInputItem,this.control.eventManager.raiseTextInputEnd(t),this.control.endUpdate()},t.prototype.applyTextInput=function(t){var e=this.textInputItem,n=this.textInputPosition;this.endTextInput(),e instanceof s.Shape?e.text!==t&&this.control.history.addAndRedo(new o.ChangeShapeTextHistoryItem(e,t)):e instanceof a.Connector&&e.getText(n)!==t&&this.control.history.addAndRedo(new c.ChangeConnectorTextHistoryItem(e,n,t))},t.prototype.cancelTextInput=function(){this.endTextInput()},t.prototype.isTextInputActive=function(){return void 0!==this.textInputItem},t.prototype.processDblClick=function(t){if(t.source.type===i.MouseEventElementType.Shape){var e=this.control.model.findShape(t.source.key);this.startTextInput(e)}else if(t.source.type===i.MouseEventElementType.Connector){var n=(o=this.control.model.findConnector(t.source.key)).getTextPositionByPoint(t.modelPoint);this.startTextInput(o,n)}else if(t.source.type===i.MouseEventElementType.ConnectorText){var o=this.control.model.findConnector(t.source.key);n=parseFloat(t.source.value);this.startTextInput(o,n)}},t.prototype.onDblClick=function(t){this.processDblClick(t)},t.prototype.onKeyDown=function(t){this.isTextInputActive()&&(13===t.keyCode&&t.modifiers&r.ModifierKey.Ctrl&&(t.preventDefault=!0,this.applyTextInput(t.inputText)),27===t.keyCode&&this.cancelTextInput())},t.prototype.onBlur=function(t){this.isTextInputActive()&&this.applyTextInput(t.inputText)},t.prototype.onFocus=function(t){},t}();e.TextInputHandler=u},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e.key,o.text=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldText=e.text,t.changeShapeText(e,this.text)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeText(e,this.oldText)},e}(n(3).HistoryItem);e.ChangeShapeTextHistoryItem=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(10),s=n(19),a=function(t){function e(e){var n=t.call(this)||this;return n.selection=e,n.selection.onChanged.add(n),n}return i(e,t),e.prototype.onMouseDown=function(t){},e.prototype.onMouseUp=function(t){},e.prototype.onFocus=function(t){setTimeout(function(){this.showContextMenuAtSelection()}.bind(this),1)},e.prototype.onBlur=function(t){setTimeout(function(){this.isLongTouch||this.hideContextMenu()}.bind(this),1)},e.prototype.onTextInputFocus=function(t){setTimeout(function(){this.hideContextMenu()}.bind(this),1)},e.prototype.onTextInputBlur=function(t){setTimeout(function(){this.showContextMenuAtSelection()}.bind(this),1)},e.prototype.onLongTouch=function(t){t.source.type===r.MouseEventElementType.Document&&this.showContextMenuAtEmptySelection(t.modelPoint)},e.prototype.getSelectedItems=function(){return this.selection.getSelectedItems(!0)},e.prototype.showContextMenuAtSelection=function(){var t=this.getSelectedItems();0!==t.length&&this.showContextMenu(void 0,s.DiagramModel.getRectangle(t).position)},e.prototype.showContextMenuAtEmptySelection=function(t){0===this.getSelectedItems().length&&this.showContextMenu(void 0,t)},e.prototype.notifySelectionChanged=function(t){0!==this.getSelectedItems().length?this.showContextMenuAtSelection():this.hideContextMenu()},e.prototype.notifyDragStart=function(t){this.hideContextMenu()},e.prototype.notifyDragEnd=function(t){this.showContextMenuAtSelection()},e}(n(124).ContextMenuHandler);e.ContextMenuTouchHandler=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.notifyConnectionTargetShow(t.key,t.targetRect)})},e.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.notifyConnectionTargetHide()})},e}(n(126).TargetVisualizerBase);e.ConnectionTargetVisualizer=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1(function(e){return e.notifyContainerTargetShow(t.key,t.targetRect)})},e.prototype.raiseHide=function(){this.dispatcher.raise1(function(t){return t.notifyContainerTargetHide()})},e}(n(126).TargetVisualizerBase);e.ContainerTargetVisualizer=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){return function(t,e){this.point=t,this.side=e}}();e.ConnectionPointInfo=o;var i=function(){function t(t){this.dispatcher=t}return t.prototype.getKey=function(){return this.key},t.prototype.setPoints=function(t,e,n,o){this.key===t&&this.pointIndex===n||(this.key=t,this.isSelected=o,this.points=e,this.pointIndex=n,this.raiseShow())},t.prototype.setPointIndex=function(t){0<=t&&t=0&&(this.keys.splice(this.keys.indexOf(t),1),this.raiseSelectionChanged())},t.prototype.clear=function(){this.keys=[],this.raiseSelectionChanged()},t.prototype.set=function(t){this.keys=t,this.raiseSelectionChanged()},t.prototype.getKeys=function(){return this.keys},t.prototype.getKey=function(t){return this.keys[t]},t.prototype.getSelectedItemsInsideContainers=function(t){var e=this,n=t.slice();return t.forEach(function(t){t instanceof r.Shape&&e.getSelectedItemsInsideContainers(e.model.getChildren(t)).forEach(function(t){-1!==n.indexOf(t)||e.hasKey(t.key)||n.push(t)})}),n},t.prototype.getSelectedItemsCore=function(t){var e=this;return this.keys.map(function(t){return e.model.findItem(t)}).filter(function(e){return e&&(t||!e.isLocked)})},t.prototype.getSelectedItems=function(t,e){return e?this.getSelectedItemsInsideContainers(this.getSelectedItemsCore(t)):this.getSelectedItemsCore(t)},t.prototype.getSelectedShapes=function(t,e){var n=this;if(e){var o=this.getSelectedItemsCore(t);return this.getSelectedItemsInsideContainers(o).map(function(t){return t instanceof r.Shape?t:void 0}).filter(function(t){return t})}return this.keys.map(function(t){return n.model.findShape(t)}).filter(function(e){return e&&(t||!e.isLocked)})},t.prototype.getSelectedConnectors=function(t,e){var n=this;if(e){var o=this.keys.map(function(t){return n.model.findItem(t)});return this.getSelectedItemsInsideContainers(o).map(function(t){return t instanceof s.Connector?t:void 0}).filter(function(t){return t})}return this.keys.map(function(t){return n.model.findConnector(t)}).filter(function(e){return e&&(t||!e.isLocked)})},t.prototype.hasKey=function(t){return this.keys.indexOf(t)>=0},t.prototype.isEmpty=function(t){return!this.getSelectedItems(t).length},t.prototype.selectRect=function(t){var e=[];this.model.iterateItems(function(n){n.intersectedByRect(t)&&e.push(n.key)}),this.set(e),this.raiseSelectionChanged()},t.prototype.onLoad=function(){this.raiseSelectionChanged()},t.prototype.raiseSelectionChanged=function(){this.onChanged.raise("notifySelectionChanged",this)},t}();e.Selection=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(24),i=n(27),r=function(){function t(t){this.selection=t,this.initialize()}return t.prototype.initialize=function(){this.reset(),this.connectorPropertiesDefault=new o.ConnectorProperties,this.stylePropertiesDefault=new i.Style,this.styleTextPropertiesDefault=new i.StyleText},t.prototype.reset=function(){this.connectorPropertiesCurrent=null,this.stylePropertiesCurrent=null,this.styleTextPropertiesCurrent=null},t.prototype.getConnectorProperties=function(){return this.connectorPropertiesCurrent||(this.connectorPropertiesCurrent=this.connectorPropertiesDefault.clone(),this.updateConnectorProperties(this.connectorPropertiesCurrent)),this.connectorPropertiesCurrent},t.prototype.getConnectorPropertyValue=function(t){return this.getConnectorProperties()[t]},t.prototype.getConnectorPropertyDefaultValue=function(t){return this.connectorPropertiesDefault[t]},t.prototype.setConnectorPropertyValue=function(t,e){this.getConnectorProperties()[t]=e,this.connectorPropertiesDefault[t]=e},t.prototype.updateConnectorProperties=function(t){var e=this,n=this.selection.getSelectedConnectors();t.forEach(function(o){e.updatePropertyValue(t,n,function(t){return t.properties},o)})},t.prototype.getStyleProperties=function(){return this.stylePropertiesCurrent||(this.stylePropertiesCurrent=this.stylePropertiesDefault.clone(),this.updateStyleProperties(this.stylePropertiesCurrent,"style")),this.stylePropertiesCurrent},t.prototype.getStyleTextProperties=function(){return this.styleTextPropertiesCurrent||(this.styleTextPropertiesCurrent=this.styleTextPropertiesDefault.clone(),this.updateStyleProperties(this.styleTextPropertiesCurrent,"styleText")),this.styleTextPropertiesCurrent},t.prototype.getStylePropertyValue=function(t){return this.getStyleProperties()[t]},t.prototype.getStylePropertyDefaultValue=function(t){return this.stylePropertiesDefault[t]},t.prototype.getStyleTextPropertyValue=function(t){return this.getStyleTextProperties()[t]},t.prototype.getStyleTextPropertyDefaultValue=function(t){return this.styleTextPropertiesDefault[t]},t.prototype.setStylePropertyValue=function(t,e){this.getStyleProperties()[t]=e,this.stylePropertiesDefault[t]=e},t.prototype.setStyleTextPropertyValue=function(t,e){this.getStyleTextProperties()[t]=e,this.styleTextPropertiesDefault[t]=e},t.prototype.updateStyleProperties=function(t,e){var n=this,o=this.selection.getSelectedItems();t.forEach(function(i){n.updatePropertyValue(t,o,function(t){return t[e]},i)})},t.prototype.updatePropertyValue=function(t,e,n,o){var i=void 0,r=!1;e.forEach(function(t){var e=n(t)[o];if(void 0===i&&null!=e)i=e,r=!0;else if(r&&i!==e)return void(i=void 0)}),r&&(t[o]=i)},t.prototype.notifySelectionChanged=function(t){this.reset()},t}();e.InputPosition=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),i=n(8),r=function(){function t(t){this.historyItems=[],this.currentIndex=-1,this.incrementalId=-1,this.transactionLevel=-1,this.unmodifiedIndex=-1,this.currTransactionId=0,this.onChanged=new i.EventDispatcher,this.modelManipulator=t}return t.prototype.isModified=function(){if(this.unmodifiedIndex==this.currentIndex)return!1;for(var t=Math.min(this.unmodifiedIndex,this.currentIndex),e=Math.max(this.unmodifiedIndex,this.currentIndex),n=t+1;n<=e;n++)if(this.historyItems[n].changeModified())return!0;return!1},t.prototype.undo=function(){this.canUndo()&&(this.historyItems[this.currentIndex].undo(this.modelManipulator),this.currentIndex--,this.raiseChanged())},t.prototype.redo=function(){this.canRedo()&&(this.currentIndex++,this.historyItems[this.currentIndex].redo(this.modelManipulator),this.raiseChanged())},t.prototype.canUndo=function(){return this.currentIndex>=0},t.prototype.canRedo=function(){return this.currentIndex=0)){var t=this.transaction.historyItems.length;t>1?this.addInternal(this.transaction):1==t&&this.addInternal(this.transaction.historyItems.pop()),t>0&&this.raiseChanged(),delete this.transaction}},t.prototype.addAndRedo=function(t){this.add(t),t.redo(this.modelManipulator),this.raiseChanged()},t.prototype.add=function(t){this.transactionLevel>=0?this.transaction.add(t):this.addInternal(t)},t.prototype.addInternal=function(t){this.currentIndex0&&this.currentIndex>e&&(this.historyItems.splice(0,e),this.currentIndex-=e)},t.prototype.getNextId=function(){return this.incrementalId++,this.incrementalId},t.prototype.clear=function(){this.currentIndex=-1,this.unmodifiedIndex=-1,this.incrementalId=-1,this.historyItems=[],delete this.transaction,this.transactionLevel=-1},t.prototype.resetModified=function(){this.unmodifiedIndex=this.currentIndex},t.prototype.getCurrentItemId=function(){if(-1==this.currentIndex)return-1;var t=this.historyItems[this.currentIndex];return-1==t.uniqueId&&(t.uniqueId=this.getNextId()),t.uniqueId},t.prototype.undoTransaction=function(){for(var t=this.transaction.historyItems;t.length;)t.pop().undo(this.modelManipulator);this.raiseChanged()},t.prototype.undoTransactionTo=function(t){for(var e=this.transaction.historyItems;e.length;){var n=e.pop();if(n.undo(this.modelManipulator),n===t)return}this.raiseChanged()},t.prototype.raiseChanged=function(){-1===this.transactionLevel&&this.onChanged.raise("notifyHistoryChanged")},t.MAX_HISTORY_ITEM_COUNT=100,t}();e.History=r},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(t){function e(e){var n=t.call(this)||this;return n.bars=[],n.control=e,n}return i(e,t),e.prototype.registerBar=function(t){this.bars.push(t),t.onChanged.add(this),this.updateBarItemsState(t)},e.prototype.updateItemsState=function(t){if(!this.isUpdateLocked())for(var e,n=0;e=this.bars[n];n++)this.updateBarItemsState(e,t)},e.prototype.updateBarItemsState=function(t,e){if(!this.isUpdateLocked()&&t.isVisible()){var n=void 0;if(e){var o=t.getCommandKeys().reduce(function(t,e){return t[e]=!0,t},{});n=e.filter(function(t){return o[t]})}else n=t.getCommandKeys();for(var i=n.length,r=0;r-1)}})},e.prototype.updateNode=function(t,e){var n=this,o=this.findNode(e.dataKey);if(o)this.isNodeObjectModified(e,o,t.units)?(this.updateNodeObjectProperties(e,o,t.units),this.updateNodeObjectConnectedProperties(e,o),this.beginChangesNotification(),this.changesListener.notifyNodeUpdated.call(this.changesListener,this.nodeDataImporter.getKey(o.dataObj||o.key),o.dataObj,function(t,e){n.endChangesNotification()},function(t){n.endChangesNotification()})):this.updateNodeObjectConnectedProperties(e,o,this.changesListener);else{var i={};o=this.addNodeInternal(i,e.description.key,e.text),this.nodeDataSource.push(o.dataObj),this.nodeDataImporter.setKey(i,o.key),this.updateNodeObjectProperties(e,o,t.units),this.updateNodeObjectConnectedProperties(e,o),this.updateNodeObjectKey(e,o,o.dataObj),this.beginChangesNotification(),this.changesListener.notifyNodeInserted.call(this.changesListener,o.dataObj,function(t){n.updateNodeObjectKey(e,o,t),n.endChangesNotification()},function(t){n.endChangesNotification()})}},e.prototype.isNodeObjectModified=function(t,e,n){return this.isItemObjectModified(t,e,this.nodeDataImporter)||e.type!==t.description.key&&!(void 0===e.type&&t.description.key===r.ShapeTypes.Rectangle)||!this.compareStrings(e.text,t.text)||e.containerKey!==(t.container&&t.container.dataKey)||this.nodeDataImporter.setImage&&e.image!==t.image.url||this.nodeDataImporter.setLeft&&e.left!==u.ModelUtils.getlUnitValue(n,t.position.x)||this.nodeDataImporter.setTop&&e.top!==u.ModelUtils.getlUnitValue(n,t.position.y)||this.nodeDataImporter.setWidth&&e.width!==u.ModelUtils.getlUnitValue(n,t.size.width)||this.nodeDataImporter.setHeight&&e.height!==u.ModelUtils.getlUnitValue(n,t.size.height)},e.prototype.updateNodeObjectProperties=function(t,e,n){if(this.updateItemObjectProperties(e,t,this.nodeDataImporter),this.nodeDataImporter.setType&&(e.type=t.description.key,this.nodeDataImporter.setType(e.dataObj,t.description.key)),this.nodeDataImporter.setText&&(e.text=t.text,this.nodeDataImporter.setText(e.dataObj,t.text)),this.nodeDataImporter.setImage&&(e.image=t.image.url,this.nodeDataImporter.setImage(e.dataObj,t.image.url)),this.nodeDataImporter.setLeft){var o=u.ModelUtils.getlUnitValue(n,t.position.x);e.left=o,this.nodeDataImporter.setLeft(e.dataObj,o)}if(this.nodeDataImporter.setTop){var i=u.ModelUtils.getlUnitValue(n,t.position.y);e.top=i,this.nodeDataImporter.setTop(e.dataObj,i)}if(this.nodeDataImporter.setWidth){var r=u.ModelUtils.getlUnitValue(n,t.size.width);e.width=r,this.nodeDataImporter.setWidth(e.dataObj,r)}if(this.nodeDataImporter.setHeight){var s=u.ModelUtils.getlUnitValue(n,t.size.height);e.height=s,this.nodeDataImporter.setHeight(e.dataObj,s)}},e.prototype.updateNodeObjectConnectedProperties=function(t,e,n){if(this.useNodeParentId&&void 0!==this.nodeDataImporter.setParentKey){var o=this.getParentShapeKey(t),i=this.findNode(o);this.updateNodeObjectParentKey(e,i,n)}if(this.useNodeContainerId&&void 0!==this.nodeDataImporter.setContainerKey){var r=this.getContainerShapeKey(t),s=this.findNode(r);this.updateNodeObjectContainerKey(e,s,n)}if(this.useNodeItems&&void 0!==this.nodeDataImporter.setItems){o=this.getParentShapeKey(t),i=this.findNode(o);this.updateNodeObjectItems(e,i,n)}if(this.useNodeChildren&&void 0!==this.nodeDataImporter.setChildren){r=this.getContainerShapeKey(t),s=this.findNode(r);this.updateNodeObjectChildren(e,s,n)}},e.prototype.updateNodeObjectParentKey=function(t,e,n){var o=this,i=this.nodeDataImporter.getParentKey(t.dataObj),r=e?this.nodeDataImporter.getKey(e.dataObj):void 0;i===r||this.isRootParentKey(i)&&this.isRootParentKey(r)||(this.nodeDataImporter.setParentKey(t.dataObj,r),n&&(this.beginChangesNotification(),n.notifyNodeUpdated.call(n,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,function(t,e){o.endChangesNotification()},function(t){o.endChangesNotification()})))},e.prototype.updateNodeObjectContainerKey=function(t,e,n){var o=this,i=this.nodeDataImporter.getContainerKey(t.dataObj),r=e?this.nodeDataImporter.getKey(e.dataObj):void 0;i===r||this.isRootParentKey(i)&&this.isRootParentKey(r)||(this.nodeDataImporter.setContainerKey(t.dataObj,r),n&&(this.beginChangesNotification(),n.notifyNodeUpdated.call(n,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,function(t,e){o.endChangesNotification()},function(t){o.endChangesNotification()})))},e.prototype.isRootParentKey=function(t){return null==t||!this.findNode(t)},e.prototype.updateNodeObjectItems=function(t,e,n){var o=this;if((e&&t.parentDataObj!==e.dataObj||!e&&t.parentDataObj)&&(!e||!this.checkNodeCyrcleItems(t.dataObj,e.dataObj))){var i=t.parentDataObj?this.nodeDataImporter.getItems(t.parentDataObj):this.nodeDataSource,r=i.indexOf(t.dataObj);i.splice(r,1);var s=e?this.nodeDataImporter.getItems(e.dataObj):this.nodeDataSource;s?s.push(t.dataObj):this.nodeDataImporter.setItems(e.dataObj,[t.dataObj]),t.parentDataObj=e&&e.dataObj,n&&(this.beginChangesNotification(),n.notifyNodeUpdated.call(n,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,function(t,e){o.endChangesNotification()},function(t){o.endChangesNotification()}))}},e.prototype.updateNodeObjectChildren=function(t,e,n){var o=this;if(e&&t.containerDataObj!==e.dataObj||!e&&t.containerDataObj){var i=t.containerDataObj?this.nodeDataImporter.getChildren(t.containerDataObj):this.nodeDataSource,r=i.indexOf(t.dataObj);i.splice(r,1);var s=e?this.nodeDataImporter.getChildren(e.dataObj):this.nodeDataSource;s?s.push(t.dataObj):this.nodeDataImporter.setChildren(e.dataObj,[t.dataObj]),t.containerDataObj=e&&e.dataObj,n&&(this.beginChangesNotification(),n.notifyNodeUpdated.call(n,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,function(t,e){o.endChangesNotification()},function(t){o.endChangesNotification()}))}},e.prototype.checkNodeCyrcleItems=function(t,e){var n=this,o=!1,i=this.nodeDataImporter.getItems(t);return i&&i.forEach(function(t){o=o||t===e||n.checkNodeCyrcleItems(t,e)}),o},e.prototype.updateNodeObjectKey=function(t,e,n){var o=this.nodeDataImporter.getKey(n);if(null!=o&&o!==e.key&&(e.key=o,delete this.nodeKeyMap[e.key],this.nodeKeyMap[o]=e.key),t.dataKey=e.key,e.dataObj!==n){var i=this.getNodeArray(e),r=i.indexOf(e.dataObj);i.splice(r,1,n),e.dataObj=n}},e.prototype.deleteNodes=function(t){var e=this;this.deleteItems(this.nodes,function(e){return t.findShapeByDataKey(e)},function(t){return e.getNodeArray(t)},function(t,n){var o=t.dataObj&&e.nodeDataImporter.getKey(t.dataObj)||t.key,i=e.nodeKeyMap[o];i&&delete e.nodeKeyMap[o];var r=e.findNode(i);r&&e.nodes.splice(e.nodes.indexOf(r),1),n&&(e.beginChangesNotification(),e.changesListener.notifyNodeRemoved.call(e.changesListener,o,t.dataObj,function(t,n){e.endChangesNotification()},function(t){e.endChangesNotification()}))})},e.prototype.getParentShapeKey=function(t){for(var e,n=0;n0},e}(c.DataSource);e.DocumentDataSource=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),i=n(6),r=n(299),s=n(300),a=n(5),c=n(0),u=n(51),p=n(52),h=n(37),l=n(44),d=n(116),f=n(76),y=n(46),m=n(36),g=n(55),v=n(54),P=n(104),C=n(38),S=n(79),_=function(){function t(t,e,n,o,i){if(this.key=t,this.nodes=[],this.edges=[],this.nodeKeyMap={},this.edgeKeyMap={},this.useNodeParentId=!1,this.useNodeContainerId=!1,this.useNodeChildren=!1,this.useNodeItems=!1,this.containers=null,null==t)throw new Error("DataSource key must be specified");this.key=t.toString(),this.nodeDataImporter=this.createNodeDataImporter(o),this.edgeDataImporter=this.createEdgeDataImporter(i),this.nodeDataSource=e||[],this.edgeDataSource=n||[],this.fetchData()}return t.prototype.createNodeDataImporter=function(t){var e=new r.DataSourceNodeDataImporter;return t&&this.assignNodeDataImporterProperties(t,e),e},t.prototype.createEdgeDataImporter=function(t){var e=new r.DataSourceEdgeDataImporter;return t&&this.assignEdgeDataImporterProperties(t,e),e},t.prototype.assignItemDataImporterProperties=function(t,e){t.getKey&&(e.getKey=t.getKey),t.setKey&&(e.setKey=t.setKey),t.getLocked&&(e.getLocked=t.getLocked),t.setLocked&&(e.setLocked=t.setLocked),t.getStyle&&(e.getStyle=t.getStyle),t.setStyle&&(e.setStyle=t.setStyle),t.getStyleText&&(e.getStyleText=t.getStyleText),t.setStyleText&&(e.setStyleText=t.setStyleText),t.getZIndex&&(e.getZIndex=t.getZIndex),t.setZIndex&&(e.setZIndex=t.setZIndex)},t.prototype.assignNodeDataImporterProperties=function(t,e){this.assignItemDataImporterProperties(t,e),t.getType&&(e.getType=t.getType),t.setType&&(e.setType=t.setType),t.getImage&&(e.getImage=t.getImage),t.setImage&&(e.setImage=t.setImage),t.getText&&(e.getText=t.getText),t.setText&&(e.setText=t.setText),t.getLeft&&(e.getLeft=t.getLeft),t.setLeft&&(e.setLeft=t.setLeft),t.getTop&&(e.getTop=t.getTop),t.setTop&&(e.setTop=t.setTop),t.getWidth&&(e.getWidth=t.getWidth),t.setWidth&&(e.setWidth=t.setWidth),t.getHeight&&(e.getHeight=t.getHeight),t.setHeight&&(e.setHeight=t.setHeight),t.getChildren&&(e.getChildren=t.getChildren),t.setChildren&&(e.setChildren=t.setChildren),t.getParentKey&&(e.getParentKey=t.getParentKey),t.setParentKey&&(e.setParentKey=t.setParentKey),t.getItems&&(e.getItems=t.getItems),t.setItems&&(e.setItems=t.setItems),t.getContainerKey&&(e.getContainerKey=t.getContainerKey),t.setContainerKey&&(e.setContainerKey=t.setContainerKey)},t.prototype.assignEdgeDataImporterProperties=function(t,e){this.assignItemDataImporterProperties(t,e),t.getFrom&&(e.getFrom=t.getFrom),t.setFrom&&(e.setFrom=t.setFrom),t.getFromPointIndex&&(e.getFromPointIndex=t.getFromPointIndex),t.setFromPointIndex&&(e.setFromPointIndex=t.setFromPointIndex),t.getTo&&(e.getTo=t.getTo),t.setTo&&(e.setTo=t.setTo),t.getToPointIndex&&(e.getToPointIndex=t.getToPointIndex),t.setToPointIndex&&(e.setToPointIndex=t.setToPointIndex),t.getPoints&&(e.getPoints=t.getPoints),t.setPoints&&(e.setPoints=t.setPoints),t.getText&&(e.getText=t.getText),t.setText&&(e.setText=t.setText),t.getLineOption&&(e.getLineOption=t.getLineOption),t.setLineOption&&(e.setLineOption=t.setLineOption),t.getStartLineEnding&&(e.getStartLineEnding=t.getStartLineEnding),t.setStartLineEnding&&(e.setStartLineEnding=t.setStartLineEnding),t.getEndLineEnding&&(e.getEndLineEnding=t.getEndLineEnding),t.setEndLineEnding&&(e.setEndLineEnding=t.setEndLineEnding)},t.prototype.fetchData=function(){var t=this;if(this.useNodeParentId=void 0!==this.nodeDataImporter.getParentKey,this.useNodeContainerId=void 0!==this.nodeDataImporter.getContainerKey,this.useNodeItems=void 0!==this.nodeDataImporter.getItems,this.useNodeChildren=void 0!==this.nodeDataImporter.getChildren,this.useEdgesArray()&&this.useNodeParentId)throw new Error("You cannot use edges array and parentKey simultaneously.");if(this.useEdgesArray()&&this.useNodeItems)throw new Error("You cannot use edges array and items array simultaneously.");if(this.useNodeParentId&&this.useNodeItems)throw new Error("You cannot use parentKey and items array simultaneously.");if(this.useNodeContainerId&&this.useNodeChildren)throw new Error("You cannot use containerKey and children array simultaneously.");this.nodeDataSource.forEach(function(e){t.addNode(e)}),this.useEdgesArray()?this.edgeDataSource.forEach(function(e){t.addEdge(e)}):this.nodes.forEach(function(e){t.addNodeEdgesByParentId(e)})},t.prototype.isContainer=function(t){var e=this;return!this.containers&&this.useNodeContainerId&&(this.containers=this.nodeDataSource.map(function(t){return e.nodeDataImporter.getContainerKey(t)}).filter(function(t){return null!=t}).reduce(function(t,e){return t[e]=!0,t},{})),this.containers&&this.containers[t]},t.prototype.useEdgesArray=function(){return Array.isArray(this.edgeDataSource)&&(this.edgeDataSource.length||!(this.useNodeParentId||this.useNodeItems))},t.prototype.addNode=function(t,e,n,i){var r=this,s=this.nodeDataImporter.getChildren&&this.nodeDataImporter.getChildren(t),a=s&&Array.isArray(s)&&s.length,c=a||this.isContainer(this.nodeDataImporter.getKey(t)),u=this.nodeDataImporter.getType&&this.nodeDataImporter.getType(t)||c&&o.ShapeTypes.VerticalContainer||o.ShapeTypes.Rectangle,p=this.nodeDataImporter.getText&&(this.nodeDataImporter.getText(t)||""),h=this.addNodeInternal(t,u,p,e,n,i);if(this.assignNodeProperties(h,t),a&&s.forEach(function(e){r.addNode(e,void 0,h.key,t)}),this.useNodeItems){var l=this.nodeDataImporter.getItems(t);Array.isArray(l)&&l.length&&l.forEach(function(e){var o=r.addNode(e,t,n,i);r.addEdgeInternal(void 0,h.key,o.key)})}return h},t.prototype.addNodeEdgesByParentId=function(t){if(this.useNodeParentId){var e=this.nodeDataImporter.getParentKey(t.dataObj);null!=e&&this.addEdgeInternal(void 0,this.getNodeKey(t.dataObj,this.nodeDataImporter.getParentKey),this.getNodeKey(t.dataObj,this.nodeDataImporter.getKey))}},t.prototype.addNodeInternal=function(t,e,n,o,r,a){var c=this.nodeDataImporter.getKey(t),u=null!=c?c:i.ModelUtils.getGuidItemKey(),p=new s.DataSourceNodeItem(this.key,u,t,e,n,o,r,a);return this.nodes.push(p),null==c&&(c=u,this.nodeDataImporter.setKey(t,u)),null!=c&&(this.nodeKeyMap[c]=u),p},t.prototype.addEdge=function(t){var e=this.addEdgeInternal(t,this.getNodeKey(t,this.edgeDataImporter.getFrom),this.getNodeKey(t,this.edgeDataImporter.getTo));return this.assignEdgeProperties(e,t),e},t.prototype.addEdgeInternal=function(t,e,n){var o=t&&this.edgeDataImporter.getKey(t),r=null!=o?o:i.ModelUtils.getGuidItemKey(),a=new s.DataSourceEdgeItem(this.key,r,t,e,n);return this.edges.push(a),null==o&&(o=r,t&&this.edgeDataImporter.setKey(t,r)),null!=o&&(this.edgeKeyMap[o]=r),a},t.prototype.assignItemProperties=function(t,e,n){n.getLocked&&(t.locked=n.getLocked(e)),n.getStyle&&(t.style=n.getStyle(e)),n.getStyleText&&(t.styleText=n.getStyleText(e)),n.getZIndex&&(t.zIndex=n.getZIndex(e))},t.prototype.assignNodeProperties=function(t,e){this.assignItemProperties(t,e,this.nodeDataImporter),this.nodeDataImporter.getImage&&(t.image=this.nodeDataImporter.getImage(e)),this.nodeDataImporter.getLeft&&(t.left=this.nodeDataImporter.getLeft(e)),this.nodeDataImporter.getTop&&(t.top=this.nodeDataImporter.getTop(e)),this.nodeDataImporter.getWidth&&(t.width=this.nodeDataImporter.getWidth(e)),this.nodeDataImporter.getHeight&&(t.height=this.nodeDataImporter.getHeight(e)),this.nodeDataImporter.getContainerKey&&(t.containerKey=this.nodeDataImporter.getContainerKey(e))},t.prototype.assignEdgeProperties=function(t,e){this.assignItemProperties(t,e,this.edgeDataImporter),this.edgeDataImporter.getFromPointIndex&&(t.fromPointIndex=this.edgeDataImporter.getFromPointIndex(e)),this.edgeDataImporter.getToPointIndex&&(t.toPointIndex=this.edgeDataImporter.getToPointIndex(e)),this.edgeDataImporter.getPoints&&(t.points=this.edgeDataImporter.getPoints(e)),this.edgeDataImporter.getText&&(t.text=this.edgeDataImporter.getText(e)),this.edgeDataImporter.getLineOption&&(t.lineOption=this.edgeDataImporter.getLineOption(e)),this.edgeDataImporter.getStartLineEnding&&(t.startLineEnding=this.edgeDataImporter.getStartLineEnding(e)),this.edgeDataImporter.getEndLineEnding&&(t.endLineEnding=this.edgeDataImporter.getEndLineEnding(e))},t.prototype.findNode=function(t){return this.nodes.filter(function(e){return void 0!==t&&e.key===t})[0]},t.prototype.findEdge=function(t){return this.edges.filter(function(e){return void 0!==t&&e.key===t})[0]},t.prototype.getNodeKey=function(t,e){return this.nodeKeyMap[e(t)]},t.prototype.createModelItems=function(e,n,o,i,r,s){t.createModelItems(e,n,o,this,i,!1,!0,r,s)},t.createModelItems=function(e,n,o,r,s,a,u,p,h){var d=0,f=0,y={},m=[],g=[];(e.beginTransaction(),r.nodes.forEach(function(o){var r=new c.Point(2e3*f++,2e3*d),s=t.createShapeByNode(e,n,o,r,a);if(void 0!==o.key&&(y[o.key]=s.key),f>4&&(f=0,d++),m.push(s),void 0!==o.containerKey&&null!==o.containerKey){var u=n.findShape(y[o.containerKey]);u&&i.ModelUtils.insertToContainer(e,n,s,u)}}),r.edges.forEach(function(o){var r=n.findShape(y[o.to]),s=n.findShape(y[o.from]);if(r&&void 0!==s){var c=t.createConnectorByEdge(e,n,o,r,s,a);g.push(c),i.ModelUtils.updateConnectorContainer(e,n,c)}}),void 0!==s)&&i.ModelUtils.getGraphInfoByItems(n,m,g).forEach(function(t){var o=s.getLayoutBuilder(t.graph).build(),r=i.ModelUtils.getNonGraphItems(n,t.container,o.nodeToLayout,m,g);i.ModelUtils.applyLayout(e,n,t.container,t.graph,o,r,s.layoutSettings,p,h)});if(u){var v=g.map(function(t){return t.key}).concat(m.map(function(t){return t.key}));e.addAndRedo(new l.SetSelectionHistoryItem(o,v))}i.ModelUtils.tryUpdateModelSize(e,n),e.endTransaction()},t.createShapeByNode=function(t,e,n,o,r){var s=r?n.key:void 0;void 0!==n.left&&(o.x=i.ModelUtils.getTwipsValue(e.units,n.left)),void 0!==n.top&&(o.y=i.ModelUtils.getTwipsValue(e.units,n.top));var a=new u.AddShapeHistoryItem(n.type,o,n.text,s);t.addAndRedo(a);var c=e.findShape(a.shapeKey),p=c.size.clone();return void 0!==n.width&&(p.width=i.ModelUtils.getTwipsValue(e.units,n.width)),void 0!==n.height&&(p.height=i.ModelUtils.getTwipsValue(e.units,n.height)),i.ModelUtils.setShapeSize(t,e,c,o,p),void 0!==n.image&&t.addAndRedo(new d.ChangeShapeImageHistoryItem(c,n.image)),this.changeItemByDataItem(t,c,n),c},t.createConnectorByEdge=function(t,e,n,o,r,s){var u=s?n.key:void 0,l=Array.isArray(n.points)&&n.points.length>1?n.points.map(function(t){if(void 0!==t.x&&void 0!==t.y)return new c.Point(i.ModelUtils.getTwipsValue(e.units,t.x),i.ModelUtils.getTwipsValue(e.units,t.y))}).filter(function(t){return t}):[r.position.clone(),o.position.clone()],d=new p.AddConnectorHistoryItem(l,u);t.addAndRedo(d);var f=e.findConnector(d.connectorKey),y=void 0!==n.fromPointIndex?n.fromPointIndex:-1;t.addAndRedo(new h.AddConnectionHistoryItem(f,r,y,a.ConnectorPosition.Begin));var m=void 0!==n.toPointIndex?n.toPointIndex:-1;return t.addAndRedo(new h.AddConnectionHistoryItem(f,o,m,a.ConnectorPosition.End)),i.ModelUtils.updateConnectorAttachedPoints(t,e,f),void 0!==n.text&&t.addAndRedo(new v.ChangeConnectorTextHistoryItem(f,a.CONNECTOR_DEFAULT_TEXT_POSITION,n.text)),void 0!==n.lineOption&&t.addAndRedo(new g.ChangeConnectorPropertyHistoryItem(f.key,"lineOption",n.lineOption)),void 0!==n.startLineEnding&&t.addAndRedo(new g.ChangeConnectorPropertyHistoryItem(f.key,"startLineEnding",n.startLineEnding)),void 0!==n.endLineEnding&&t.addAndRedo(new g.ChangeConnectorPropertyHistoryItem(f.key,"endLineEnding",n.endLineEnding)),this.changeItemByDataItem(t,f,n),f},t.changeItemByDataItem=function(t,e,n){if(void 0!==n.locked&&t.addAndRedo(new P.ChangeLockedHistoryItem(e,n.locked)),void 0!==n.zIndex&&t.addAndRedo(new f.ChangeZindexHistoryItem(e,n.zIndex)),void 0!==n.style)for(var o in n.style)if(n.style.hasOwnProperty(o)){var i=S.isColorProperty(o)?C.ColorHelper.stringToHash(n.style[o]):n.style[o];t.addAndRedo(new y.ChangeStyleHistoryItem(e.key,o,i))}if(void 0!==n.styleText)for(var o in n.styleText)if(n.styleText.hasOwnProperty(o)){i=S.isColorProperty(o)?C.ColorHelper.stringToHash(n.styleText[o]):n.styleText[o];t.addAndRedo(new m.ChangeStyleTextHistoryItem(e.key,o,i))}},t}();e.DataSource=_},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(){this.getKey=function(t){return t.id},this.setKey=function(t,e){t.id=e},this.getLocked=void 0,this.setLocked=void 0,this.getStyle=void 0,this.setStyle=void 0,this.getStyleText=void 0,this.setStyleText=void 0,this.getZIndex=void 0,this.setZIndex=void 0}}();e.DataSourceItemDataImporter=r;var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getType=void 0,e.setType=void 0,e.getText=void 0,e.setText=void 0,e.getImage=void 0,e.setImage=void 0,e.getLeft=void 0,e.setLeft=void 0,e.getTop=void 0,e.setTop=void 0,e.getWidth=void 0,e.setWidth=void 0,e.getHeight=void 0,e.setHeight=void 0,e.getChildren=void 0,e.setChildren=void 0,e.getParentKey=void 0,e.setParentKey=void 0,e.getItems=void 0,e.setItems=void 0,e.getContainerKey=void 0,e.setContainerKey=void 0,e}return i(e,t),e}(r);e.DataSourceNodeDataImporter=s;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getFrom=function(t){return t.from},e.setFrom=function(t,e){t.from=e},e.getFromPointIndex=void 0,e.setFromPointIndex=void 0,e.getTo=function(t){return t.to},e.setTo=function(t,e){t.to=e},e.getToPointIndex=void 0,e.setToPointIndex=void 0,e.getPoints=void 0,e.setPoints=void 0,e.getText=void 0,e.setText=void 0,e.getLineOption=void 0,e.setLineOption=void 0,e.getStartLineEnding=void 0,e.setStartLineEnding=void 0,e.getEndLineEnding=void 0,e.setEndLineEnding=void 0,e}return i(e,t),e}(r);e.DataSourceEdgeDataImporter=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(t,e,n){this.sourceKey=t,this.key=e,this.dataObj=n}}();e.DataSourceItem=r;var s=function(t){function e(e,n,o,i,r,s,a,c){var u=t.call(this,e,n,o)||this;return u.type=i,u.text=r,u.parentDataObj=s,u.containerKey=a,u.containerDataObj=c,u}return i(e,t),e}(r);e.DataSourceNodeItem=s;var a=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n,o)||this;return s.sourceKey=e,s.from=i,s.to=r,s}return i(e,t),e}(r);e.DataSourceEdgeItem=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=Math.log(.05),i=Math.log(3),r=40,s=c(1),a=function(){function t(t){this.settings=t}return t.prototype.initialize=function(t){this.view=t},t.prototype.scrollTo=function(t,e){this.view&&this.view.setScrollTo(t,e)},t.prototype.scrollBy=function(t){return!this.view||0===t.x&&0===t.y?t:this.view.scrollBy(t)},t.prototype.normalize=function(){this.view.tryNormalizePaddings()},t.prototype.getNextStepZoom=function(t){var e=this.getNearestCurrentZoomStep(),n=t?1:-1,a=Math.min(r-1,Math.max(0,e+n));if(a!==s){var c=o+(i-o)*a/(r-1);return Math.exp(c)}return 1},t.prototype.getNearestCurrentZoomStep=function(){return c(this.getZoom())},t.prototype.getZoom=function(){return this.view?this.view.actualZoom:this.settings.zoomLevel},t.prototype.resetScroll=function(){this.view.update({horizontal:!0,vertical:!0})},t}();function c(t){var e=Math.log(t);return Math.round((e-o)*(r-1)/(i-o))}e.ViewController=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(303),i=n(304),r=n(25),s=function(){function t(t){this.toolboxes=[],this.readonly=t}return t.prototype.create=function(t,e,n,s,a,c){var u=Array.isArray(a)?a:r.ShapeDescriptionManager.getTypesByCategory(a),p=c?new o.TextToolbox(t,this.readonly,{shapeTypes:u}):new i.IconToolbox(t,this.readonly,{shapeIconSize:e,shapeIconSpacing:n,shapeIconAttributes:s,shapeTypes:u});return p.render(),this.toolboxes.push(p),p},t.prototype.dispose=function(){for(var t=0;t-1},t.prototype.notifyReadOnlyChanged=function(t){this.readonly=t},t}();e.ToolboxManager=s},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(128),s=n(25),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createElements=function(t,e){e.forEach(function(e){var n=s.ShapeDescriptionManager.get(e),o=document.createElement("div");o.setAttribute("class","toolbox-text-item"),o.setAttribute("data-tb-type",e),o.innerHTML=n.defaultText,t.appendChild(o)})},e.prototype.createDraggingElement=function(t){var e=document.createElement("DIV");e.setAttribute("class","dxdi-toolbox-drag-text-item");var n=s.ShapeDescriptionManager.get(t.evt.data);return e.innerHTML=n.defaultText,document.body.appendChild(e),e},e}(r.Toolbox);e.TextToolbox=a},function(t,e,n){"use strict";var o,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var r=n(128),s=n(25),a=n(12),c=n(11),u=n(13),p=n(0),h=n(93),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createElements=function(t,e){var n=document.createElementNS(a.svgNS,"svg");n.className.baseVal="dxdi-canvas",t.appendChild(n),this.drawShapeIcons(n,e,n.getBoundingClientRect().width)},e.prototype.drawShapeIcons=function(t,e,n){var o=this,i=u.UnitConverter.twipsToPixels(c.Shape.lineWidth);n-=2*i;for(var r=1,a=this.options.shapeIconSize;a1?(n-this.options.shapeIconSize*r)/(r-1):0,h=i,l=i;e.forEach(function(e,n){n>0&&n%r==0&&(h=i,l+=o.options.shapeIconSize+p);var a=s.ShapeDescriptionManager.get(e),c=o.createShape(a,h,l);o.updateShapeIconBounds(c),o.drawShape(t,c),h+=o.options.shapeIconSize+p}),t.style.height=l+this.options.shapeIconSize+i+"px"},e.prototype.drawShape=function(t,e){var n=e.description.createPrimitives(e,!0),o=document.createElementNS(a.svgNS,"g");for(var i in o.setAttribute("data-tb-type",e.description.key.toString()),o.setAttribute("class","toolbox-item"),o.setAttribute("title",e.description.title),this.options.shapeIconAttributes)this.options.shapeIconAttributes.hasOwnProperty(i)&&o.setAttribute(i,this.options.shapeIconAttributes[i]);t.appendChild(o),n.forEach(function(t){var e=t.createElement();o.appendChild(e),t.applyElementProperties(e)})},e.prototype.createShape=function(t,e,n){var o=u.UnitConverter.pixelsToTwips(e),i=u.UnitConverter.pixelsToTwips(n),r=new c.Shape(t,new p.Point(o,i));return t instanceof h.TextShapeDescription||(r.text=""),r},e.prototype.updateShapeIconBounds=function(t){var e=u.UnitConverter.pixelsToTwips(this.options.shapeIconSize);if(t.size.height=t.size.width*t.getToolboxHeightToWidthRatio(),t.size.width>t.size.height){var n=t.size.height/t.size.width;t.size.width=e,t.size.height=e*n,t.position.y=t.position.y+(e-t.size.height)/2,t.parameters.forEach(function(n){n.value=n.value*e/t.description.defaultSize.width})}else if(t.size.width