/*! For license information please see dx-diagram.min.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.DevExpress=e():(t.DevExpress=t.DevExpress||{},t.DevExpress.diagram=e())}(this,(()=>(()=>{"use strict";var t={9279:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Browser=void 0;var n=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="IE",r="Win",s={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 a={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"},c="(?:/|\\s*)?",u="(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?",h="(?:"+u+")?",p={Safari:"applewebkit(?:.*?(?:version/"+u+"[\\.\\w\\d]*?(?:\\s+mobile/\\S*)?\\s+safari))?",Chrome:"(?:chrome|crios)(?!frame)"+c+h,Mozilla:"mozilla(?:.*rv:"+h+".*Gecko)?",Netscape:"(?:netscape|navigator)\\d*/?\\s*"+h,Firefox:"firefox"+c+h,Opera:"(?:opera|\\sopr)"+c+h,Opera10:"opera.*\\s*version"+c+h,IE:"msie\\s*"+h,Edge:"edge"+c+h},l=null,d=-1,f=0;f=0){if("IE"===l&&d>=11&&"Safari"===y)continue;"Opera10"===(l=y)&&(l="Opera");var m="trident"+c+h;d=t.GetBrowserVersion(e,g,m,t.getIECompatibleVersionString()),"Mozilla"===l&&d>=11&&(l="IE")}}l||(l=i);var v=-1!==d;v||(d=s[l]);var P=null,C=Number.MAX_VALUE;for(var S in a)if(Object.prototype.hasOwnProperty.call(a,S)){var x="!"===S.substr(0,1),b=e.indexOf((x?S.substr(1):S).toLowerCase());b>=0&&(b0;"WinPhone"===P&&d<9&&(d=Math.floor(t.getVersionFromTrident(e,"trident"+c+h))),!n&&"IE"===l&&d>7&&document.documentMode0},t.hasMsMaxTouchPoints=function(){return navigator.msMaxTouchPoints>0},t.hasNavigator=function(){return"undefined"!=typeof navigator},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.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.getVersionFromMatches=function(t){var e=-1,n="";return t&&(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;i{Object.defineProperty(e,"__esModule",{value:!0}),e.EmptyBatchUpdatableObject=e.BatchUpdatableObject=void 0;var n=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.prototype.resetOccurredEvents=function(){this.occurredEvents=0},t.prototype.isLocked=function(){return 0!==this.suspendUpdateCount},t}();e.BatchUpdatableObject=n;var o=function(){function t(){}return t.prototype.beginUpdate=function(){},t.prototype.endUpdate=function(){},t}();e.EmptyBatchUpdatableObject=o},7820:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Flag=void 0;var n=function(){function t(t){void 0===t&&(t=0),this.value=t}return t.prototype.get=function(t){return(this.value&t)===t},t.prototype.set=function(t,e){return(this.value&t)===t!==e&&(e?this.value|=t:this.value^=t),this},t.prototype.add=function(t){this.value|=t},t.prototype.anyOf=function(){for(var t=[],e=0;e{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedMinMax=e.ExtendedMax=e.ExtendedMin=e.MinMaxNumber=e.MinMax=void 0;var o=n(655),i=function(t,e){this.minElement=t,this.maxElement=e};e.MinMax=i;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),Object.defineProperty(e.prototype,"length",{get:function(){return this.maxElement-this.minElement},enumerable:!1,configurable:!0}),e}(i);e.MinMaxNumber=r;var s=function(t,e){this.minElement=t,this.minValue=e};e.ExtendedMin=s;var a=function(t,e){this.maxElement=t,this.maxValue=e};e.ExtendedMax=a;var c=function(t){function e(e,n,o,i){var r=t.call(this,e,o)||this;return r.minValue=n,r.maxValue=i,r}return o.__extends(e,t),e}(i);e.ExtendedMinMax=c},9291:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UnitConverter=void 0;var n=function(){function t(){}return t.hundredthsOfMillimeterToTwipsRound=function(t){return Math.round(1440*t/2540)},t.documentsToTwips=function(t){return 24*t/5},t.pixelsToTwips=function(e){return Math.round(t.pixelsToTwipsF(e))},t.pixelsToTwipsCustomDpi=function(e,n){return Math.round(t.pixelsToTwipsFCustomDpi(e,n))},t.inchesToTwips=function(e){return Math.round(t.inchesToTwipsF(e))},t.pointsToTwips=function(e){return Math.round(t.pointsToTwipsF(e))},t.picasToTwips=function(e){return Math.round(1440*e/t.PICAS_PER_INCH)},t.centimetersToTwips=function(e){return Math.round(t.centimetersToTwipsF(e))},t.pixelsToTwipsF=function(e){return 1440*e/t.DPI},t.pixelsToTwipsFCustomDpi=function(t,e){return 1440*t/e},t.inchesToTwipsF=function(t){return 1440*t},t.pointsToTwipsF=function(t){return 20*t},t.centimetersToTwipsF=function(e){return 1440*e/t.CENTIMETERS_PER_INCH},t.twipsToDegrees=function(t){return t/6e4},t.twipsToRadians=function(t){return t/6e4*Math.PI/180},t.degreesToTwips=function(t){return 6e4*t},t.radiansToTwips=function(t){return 6e4*t/Math.PI*180},t.radiansToDegrees=function(t){return t/Math.PI*180},t.twipsToFD=function(t){return Math.round(2048*t/1875)},t.fdToTwips=function(t){return Math.round(1875*t/2048)},t.emuToTwips=function(t){return t/635},t.twipsToPixels=function(e){return Math.round(t.twipsToPixelsF(e))},t.inchesToPixels=function(e){return Math.round(t.DPI*e)},t.centimeterToPixel=function(t){return Math.round(this.centimeterToPixelF(t))},t.centimeterToPixelF=function(e){return e*t.DPI/t.CENTIMETERS_PER_INCH},t.millimetersToPixel=function(e){return Math.round(e/(t.CENTIMETERS_PER_INCH/t.DPI)/10)},t.pointsToPixels=function(e){return Math.round(e*t.DPI/72)},t.pointsToPixelsF=function(e){return e*t.DPI/72},t.twipsToPixelsF=function(e){return e*t.DPI/1440},t.pixelsToPoints=function(e){return Math.round(72*e/t.DPI)},t.pixelsToPointsF=function(e){return 72*e/t.DPI},t.twipsToPoints=function(t){return Math.round(this.twipsToPointsF(t))},t.twipsToPointsF=function(t){return t/20},t.twipsToInches=function(t){return t/1440},t.pixelsToInches=function(e){return e/t.DPI},t.twipsToCentimeters=function(e){return e*t.CENTIMETERS_PER_INCH/1440},t.pixelToCentimeters=function(e){return e*t.CENTIMETERS_PER_INCH/t.DPI},t.twipsToHundredthsOfMillimeter=function(t){return Math.round(127*t/72)},t.pixelsToHundredthsOfMillimeter=function(e){return Math.round(2540*e/t.DPI)},t.hundredthsOfMillimeterToTwips=function(t){return 15*t/127},t.twipsToEmu=function(t){return 635*t},t.twipsToDegree=function(t){return t/6e4},t.DPI=96,t.CENTIMETERS_PER_INCH=2.54,t.PICAS_PER_INCH=6,t}();e.UnitConverter=n},5596:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Metrics=void 0;var n=function(){function t(){}return t.euclideanDistance=function(t,e){var n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)},t.manhattanDistance=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},t}();e.Metrics=n},4125:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Offsets=void 0;var n=function(){function t(t,e,n,o){this.left=t,this.right=e,this.top=n,this.bottom=o}return t.empty=function(){return new t(0,0,0,0)},Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.left+this.right},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.top+this.bottom},enumerable:!1,configurable:!0}),t.fromNumber=function(e){return new t(e,e,e,e)},t.fromOffsets=function(e){return new t(e.left,e.right,e.top,e.bottom)},t.fromSide=function(e,n){return new t(e,e,n,n)},t.prototype.normalize=function(){return this.left=Math.max(0,this.left),this.right=Math.max(0,this.right),this.top=Math.max(0,this.top),this.bottom=Math.max(0,this.bottom),this},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.isEmpty=function(){return 0===this.left&&0===this.right&&0===this.top&&0===this.bottom},t.prototype.offset=function(t){return this.left+=t.left,this.right+=t.right,this.top+=t.top,this.bottom+=t.bottom,this},t.prototype.multiply=function(t,e,n,o){switch(arguments.length){case 1:return this.left*=t,this.right*=t,this.top*=t,this.bottom*=t,this;case 2:return this.left*=t,this.right*=t,this.top*=e,this.bottom*=e,this;case 4:return this.left*=t,this.right*=e,this.top*=n,this.bottom*=o,this}return this},t.prototype.clone=function(){return new t(this.left,this.right,this.top,this.bottom)},t.prototype.copyFrom=function(t){this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom},t.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.right===t.right&&this.left===t.left},t.prototype.applyConverter=function(t){return this.left=t(this.left),this.right=t(this.right),this.top=t(this.top),this.bottom=t(this.bottom),this},t}();e.Offsets=n},8900:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Point=void 0;var n=function(){function t(t,e){this.x=t,this.y=e}return t.zero=function(){return new t(0,0)},t.fromNumber=function(e){return new t(e,e)},t.prototype.isZero=function(){return 0===this.x&&0===this.y},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.offset=function(t,e){return this.x+=t,this.y+=e,this},t.prototype.offsetByPoint=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.multiply=function(t,e){return this.x*=t,this.y*=e,this},t.prototype.negative=function(){return this.x*=-1,this.y*=-1,this},t.prototype.applyConverter=function(t){return this.x=t(this.x),this.y=t(this.y),this},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.xComparer=function(t,e){return t.x-e.x},t.yComparer=function(t,e){return t.y-e.y},t.equals=function(t,e){return t.x===e.x&&t.y===e.y},t}();e.Point=n},8011:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RectangleDeviation=e.HitTestDeviation=e.Rectangle=void 0;var o,i=n(7820),r=n(1104),s=n(8860),a=n(8900),c=n(6353),u=function(){function t(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}return Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return t.center(this)},enumerable:!1,configurable:!0}),t.prototype.createRectangle=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.createSize=function(){return new c.Size(this.width,this.height)},t.prototype.createPosition=function(){return new a.Point(this.x,this.y)},t.prototype.createVerticalInterval=function(){return new s.FixedInterval(this.y,this.height)},t.prototype.createHorizontalInterval=function(){return new s.FixedInterval(this.x,this.width)},t.fromGeometry=function(e,n){return new t(e.x,e.y,n.width,n.height)},t.fromPoints=function(e,n){return new t(Math.min(e.x,n.x),Math.min(e.y,n.y),Math.abs(e.x-n.x),Math.abs(e.y-n.y))},t.fromPositions=function(e,n,o,i){return new t(Math.min(e,o),Math.min(n,i),Math.abs(o-e),Math.abs(i-n))},t.fromCenter=function(e,n){return new t(e.x-n,e.y-n,2*n,2*n)},t.prototype.isCollapsed=function(){return 0===this.width||0===this.height},t.prototype.isEmpty=function(){return 0===this.x&&0===this.y&&0===this.width&&0===this.height},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.setPosition=function(t){return this.x=t.x,this.y=t.y,this},t.prototype.setSize=function(t){return this.width=t.width,this.height=t.height,this},t.prototype.setGeomerty=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},t.prototype.moveRectangle=function(t,e){return this.x+=t,this.y+=e,this},t.prototype.moveRectangleByPoint=function(t){return this.x+=t.x,this.y+=t.y,this},t.prototype.resize=function(t,e){return this.width+=t,this.height+=e,this},t.prototype.nonNegativeSize=function(){return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this},t.prototype.multiply=function(t,e){return this.x*=t,this.y*=e,this.width*=t,this.height*=e,this},t.prototype.equals=function(e){return t.equals(this,e)},t.prototype.clone=function(){var e=new t(0,0,0,0);return e.copyFrom(this),e},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},t.prototype.containsPoint=function(e){return t.containsPoint(this,e)},t.prototype.containsRectangle=function(t){return this.x<=t.x&&this.right>=t.right&&this.y<=t.y&&this.bottom>=t.bottom},t.prototype.inflate=function(t,e){return void 0===e&&(e=t),this.x-=t,this.y-=e,this.width+=2*t,this.height+=2*e,this},t.prototype.applyOffsetsInside=function(t){return this.x+=t.left,this.y+=t.top,this.width-=t.left+t.right,this.height-=t.top+t.bottom,this},t.prototype.applyNormalizedOffsetsInside=function(t){var e=Math.max(0,t.left),n=e+Math.max(0,t.right);0!==n&&(n<=this.width?(this.x+=e,this.width-=n):(this.x+=this.width*(e/n),this.width=0));var o=Math.max(0,t.top),i=o+Math.max(0,t.bottom);return 0!==i&&(i<=this.height?(this.y+=o,this.height-=i):(this.y+=this.height*(o/i),this.height=0)),this},t.prototype.applyOffsetsOutside=function(t){return this.x-=t.left,this.y-=t.top,this.width+=t.left+t.right,this.height+=t.top+t.bottom,this},t.prototype.applyConverter=function(t){return this.x=t(this.x),this.y=t(this.y),this.width=t(this.width),this.height=t(this.height),this},t.getHorizIntersection=function(t,e){return r.IntervalAlgorithms.getIntersection(new s.FixedInterval(t.x,t.width),new s.FixedInterval(e.x,e.width))},t.getVertIntersection=function(t,e){return r.IntervalAlgorithms.getIntersection(new s.FixedInterval(t.y,t.height),new s.FixedInterval(e.y,e.height))},t.getIntersection=function(e,n){var o=r.IntervalAlgorithms.getIntersection(new s.FixedInterval(e.x,e.width),new s.FixedInterval(n.x,n.width));if(!o)return null;var i=r.IntervalAlgorithms.getIntersection(new s.FixedInterval(e.y,e.height),new s.FixedInterval(n.y,n.height));return i?new t(o.start,i.start,o.length,i.length):null},t.getHorNonCollapsedIntersection=function(e,n){var o=t.getHorizIntersection(e,n);return o&&!o.isCollapsed()?o:null},t.getVertNonCollapsedIntersection=function(e,n){var o=t.getVertIntersection(e,n);return o&&!o.isCollapsed()?o:null},t.getNonCollapsedIntersection=function(e,n){var o=t.getIntersection(e,n);return o&&!o.isCollapsed()?o:null},t.areIntersected=function(t,e){return!(t.x>e.x+e.width||e.x>t.x+t.width||t.y>e.y+e.height||e.y>t.y+t.height)},t.union=function(e,n){var o=Math.max(e.x+e.width,n.x+n.width),i=Math.max(e.y+e.height,n.y+n.height),r=Math.min(e.x,n.x),s=Math.min(e.y,n.y);return new t(r,s,o-r,i-s)},t.equals=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},t.center=function(t){return new a.Point(t.x+t.width/2,t.y+t.height/2)},t.containsPoint=function(t,e){var n=t.x+t.width,o=t.y+t.height;return e.y>=t.y&&o>=e.y&&e.x>=t.x&&n>=e.x},t}();e.Rectangle=u,function(t){t[t.None=0]="None",t[t.Top=1]="Top",t[t.Bottom=2]="Bottom",t[t.Left=4]="Left",t[t.Right=8]="Right"}(o=e.HitTestDeviation||(e.HitTestDeviation={}));var h=function(){function t(t,e){this.initRectangle=t,this.initPoint=e,this.deviation=new i.Flag(o.None)}return t.prototype.calcDeviation=function(){return this.initPoint.xthis.initRectangle.right&&this.deviation.set(o.Right,!0),this.initPoint.ythis.initRectangle.bottom&&this.deviation.set(o.Bottom,!0),this},t.prototype.calcAdditionalParams=function(){return this.insidePoint=this.initPoint.clone(),this.offsetToInside=new a.Point(0,0),this.deviation.get(o.Left)?(this.insidePoint.x=this.initRectangle.x,this.offsetToInside.x=this.insidePoint.x-this.initPoint.x):this.deviation.get(o.Right)&&(this.insidePoint.x=this.initRectangle.right,this.offsetToInside.x=this.initPoint.x-this.insidePoint.x),this.deviation.get(o.Top)?(this.insidePoint.y=this.initRectangle.y,this.offsetToInside.y=this.insidePoint.y-this.initPoint.y):this.deviation.get(o.Bottom)&&(this.insidePoint.y=this.initRectangle.bottom,this.offsetToInside.y=this.initPoint.y-this.insidePoint.y),this},t}();e.RectangleDeviation=h},1335:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Segment=void 0;var o=n(8679),i=n(5596),r=n(8900),s=n(8011),a=function(){function t(t,e){this.startPoint=t,this.endPoint=e}return Object.defineProperty(t.prototype,"length",{get:function(){return i.Metrics.euclideanDistance(this.startPoint,this.endPoint)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xLength",{get:function(){return Math.abs(this.endPoint.x-this.startPoint.x)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yLength",{get:function(){return Math.abs(this.endPoint.y-this.startPoint.y)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"center",{get:function(){return new r.Point(this.startPoint.x+(this.endPoint.x-this.startPoint.x)/2,this.startPoint.y+(this.endPoint.y-this.startPoint.y)/2)},enumerable:!1,configurable:!0}),t.prototype.isIntersected=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.containsPoint=function(t,e){return void 0===e&&(e=1e-7),this.startPoint.equals(t)||this.endPoint.equals(t)||o.MathUtils.numberCloseTo(this.length,i.Metrics.euclideanDistance(this.startPoint,t)+i.Metrics.euclideanDistance(this.endPoint,t),e)},t.prototype.isIntersectedByRect=function(e){if(s.Rectangle.containsPoint(e,this.startPoint)||s.Rectangle.containsPoint(e,this.endPoint))return!0;var n=e.x,o=e.x+e.width,i=e.y,a=e.y+e.height;return this.isIntersected(new t(new r.Point(n,i),new r.Point(n,a)))||this.isIntersected(new t(new r.Point(o,i),new r.Point(o,a)))||this.isIntersected(new t(new r.Point(n,i),new r.Point(o,i)))||this.isIntersected(new t(new r.Point(n,a),new r.Point(o,a)))},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}();e.Segment=a},6353:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Size=void 0;var n=function(){function t(t,e){this.width=t,this.height=e}return t.empty=function(){return new t(0,0)},t.fromNumber=function(e){return new t(e,e)},t.initByCommonAction=function(e){var n=function(t){return t.width},o=function(t){return t.height};return new t(e(n,o),e(o,n))},t.prototype.isEmpty=function(){return 0===this.width&&0===this.height},t.prototype.toString=function(){return JSON.stringify(this)},t.prototype.nonNegativeSize=function(){return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this},t.prototype.offset=function(t,e){return this.width=this.width+t,this.height=this.height+e,this},t.prototype.multiply=function(t,e){return this.width*=t,this.height*=e,this},t.prototype.equals=function(t){return this.width===t.width&&this.height===t.height},t.prototype.clone=function(){return new t(this.width,this.height)},t.prototype.copyFrom=function(t){this.width=t.width,this.height=t.height},t.prototype.applyConverter=function(t){return this.width=t(this.width),this.height=t(this.height),this},t.equals=function(t,e){return t.width===e.width&&t.height===e.height},t}();e.Size=n},9716:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Vector=void 0;var n=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return Object.defineProperty(t.prototype,"length",{get:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},enumerable:!1,configurable:!0}),t.fromPoints=function(e,n){return new t(n.x-e.x,n.y-e.y)},t.fromSegment=function(e){return new t(e.endPoint.x-e.startPoint.x,e.endPoint.y-e.startPoint.y)},t.prototype.normalize=function(){var t=this.length;return 0!==t&&(this.x/=t,this.y/=t),this},t.prototype.negative=function(){return this.x*=-1,this.y*=-1,this},Object.defineProperty(t,"axisX",{get:function(){return new t(1,0)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"axisY",{get:function(){return new t(0,1)},enumerable:!1,configurable:!0}),t.angleBetween=function(e,n){var o=t.scalarProduct(e,n)/(e.length*n.length);return Math.acos(o)},t.scalarProduct=function(t,e){return t.x*e.x+t.y*e.y},t}();e.Vector=n},1104:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntervalAlgorithms=void 0;var o=n(2940),i=n(2400),r=n(8860),s=n(6102),a=function(){function t(){}return t.oneConstainsOtherArraysOfInterval=function(t,e){for(var n=o.ListUtils.deepCopy(e),i=n.pop();i;){if(!o.ListUtils.unsafeAnyOf(t,(function(t){return t.containsInterval(i)})))return!1;i=n.pop()}return!0},t.getIntersection=function(e,n){return t.getIntersectionTemplate(e,n,e)},t.getIntersectionTemplate=function(t,e,n){var o=Math.max(t.start,e.start),i=Math.min(t.end,e.end);return o>i?null:n.makeByStartEnd(o,i)},t.getIntersectionNonNullLength=function(e,n){return t.getIntersectionNonNullLengthTemplate(e,n,e)},t.getIntersectionNonNullLengthTemplate=function(e,n,o){var i=t.getIntersectionTemplate(e,n,o);return i&&i.length?i:null},t.getIntersectionsTwoArraysOfInterval=function(e,n){return t.getIntersectionsTwoArraysOfIntervalTemplate(e,n,e[0])},t.getIntersectionsTwoArraysOfIntervalTemplate=function(e,n,o){for(var i=[],r=e.length,s=n.length,a=0,c=0,u=e[a],h=n[c],p=null;ap.end)break;var y=t.getIntersectionTemplate(f,p,o);y&&(y.length||a(f,p.length,y.start))&&c.add(l)}return c.getIntervals()},t.handleAffectedObjects=function(e,n,o,s){void 0===s&&(s=function(t){return i.SearchUtils.normedInterpolationIndexOf(e,(function(t){return t.interval.start}),t)});for(var a=new r.FixedInterval(0,0),c=0,u=n;ch.end)break;var f=t.getIntersectionTemplate(d,h,a);f&&o(l,p,h,f)}},t.getMergedIntervals=function(e,n){return t.getMergedIntervalsTemplate(e,n,e[0])},t.getMergedIntervalsTemplate=function(t,e,n){if(t.length<2)return t.length>0?[n.makeByStartLength(t[0].start,t[0].length)]:[];for(var o=e?[].concat(t).sort((function(t,e){return t.start-e.start})):t,i=[],r=0,s=void 0;s=o[r];){var a=s.start,c=s.end;for(++r;void 0!==(s=o[r])&&s.start<=c;r++)s.end>c&&(c=s.end);i.push(n.makeByStartEnd(a,c))}return i},t.reflectIntervals=function(e,n){return t.reflectIntervalsTemplate(e,n,n)},t.reflectIntervalsTemplate=function(e,n,i){if(!e.length)return[i.makeByStartLength(n.start,n.length)];var r=o.ListUtils.last(e).end,s=o.ListUtils.reducedMap(e,(function(o,r){return t.getIntersectionNonNullLengthTemplate(i.makeByStartEnd(e[r-1].end,o.start),n,i)}),1);return n.startr&&s.push(i.makeByStartEnd(r,n.end)),s},t.reflectionOfPointOnInterval=function(t,e,n){return(t-e.start)/e.length*n.length+n.start},t}();e.IntervalAlgorithms=a},7814:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConstInterval=void 0;var n=function(){function t(){}return Object.defineProperty(t.prototype,"center",{get:function(){return this.start+this.length/2},enumerable:!1,configurable:!0}),t.prototype.isNormalized=function(){return this.end>=this.start},t.prototype.isCollapsed=function(){return 0===this.length},t.prototype.equals=function(t){return this.start===t.start&&this.end===t.end},t.isCollapsed=function(t){return!t[1]&&t[0].isCollapsed()},t.prototype.containsInterval=function(t){return this.start<=t.start&&this.end>=t.end},t.prototype.containsIntervalWithoutEnd=function(t){return this.start<=t.start&&this.end>t.end},t.prototype.contains=function(t){return this.start<=t&&t{Object.defineProperty(e,"__esModule",{value:!0}),e.FixedInterval=void 0;var o=n(655),i=function(t){function e(e,n){var o=t.call(this)||this;return o.start=e,o.length=n,o}return o.__extends(e,t),Object.defineProperty(e.prototype,"end",{get:function(){return this.start+this.length},set:function(t){this.length=t-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"center",{get:function(){return this.start+this.length/2},enumerable:!1,configurable:!0}),e.prototype.copyFrom=function(t){this.start=t.start,this.length=t.length},e.prototype.equals=function(t){return t&&this.start===t.start&&this.length===t.length},e.prototype.clone=function(){return new e(this.start,this.length)},e.prototype.makeByStartEnd=function(t,n){return new e(t,n-t)},e.prototype.makeByStartLength=function(t,n){return new e(t,n)},e.prototype.makeByLengthEnd=function(t,n){return new e(n-t,t)},e.fromPositions=function(t,n){return new e(t,n-t)},e.makeByConstInterval=function(t){return new e(t.start,t.length)},e.prototype.expand=function(t){var e=Math.max(t.end,this.end);return this.start=Math.min(t.start,this.start),this.end=e,this},e}(n(8678).MutableInterval);e.FixedInterval=i},8678:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MutableInterval=void 0;var o=n(655),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.normalizeLength=function(){return this.length<0&&(this.length=0),this},e}(n(7814).ConstInterval);e.MutableInterval=i},6102:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SparseIntervalsCollector=void 0;var o=n(448),i=function(){function t(t){this.intervals=[],this.template=t}return t.prototype.add=function(t){this.curr&&this.curr.end===t?this.curr.length++:(this.curr=this.template.makeByStartLength(t,1),this.intervals.push(this.curr))},t.prototype.getIntervals=function(){return new o.SparseIntervals(this.intervals)},t}();e.SparseIntervalsCollector=i},448:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SparseIntervals=void 0;var o=n(8094),i=n(510),r=function(){function t(t){void 0===t&&(t=[]),this.list=t,this._count=0,this._numIntervals=0;for(var e=0,n=t;e{Object.defineProperty(e,"__esModule",{value:!0}),e.SparseIntervalsIterator=void 0;var n=function(){function t(t){this.sparseIntervals=t,this.intervalIndex=-1}return Object.defineProperty(t.prototype,"isStarted",{get:function(){return!!this.curr},enumerable:!1,configurable:!0}),t.prototype.moveNext=function(){return this.curr&&this.posInInterval+1=this.curr.start?(this.posInInterval--,this.index--,this.initObject(),!0):(this.isStarted||(this.intervalIndex=this.sparseIntervals.numIntervals),this.intervalIndex-1>=0&&(this.intervalIndex--,this.curr=this.sparseIntervals.getInterval(this.intervalIndex),this.posInInterval=Math.max(this.curr.length-1,this.curr.start),this.index=this.curr.start,this.initObject(),!0))},t.prototype.initObject=function(){},t}();e.SparseIntervalsIterator=n},510:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SparseObjectsIterator=void 0;var o=n(655),i=function(t){function e(e,n){var o=t.call(this,e)||this;return o.objects=n,o}return o.__extends(e,t),e.prototype.initObject=function(){this.obj=this.objects[this.index]},e}(n(8094).SparseIntervalsIterator);e.SparseObjectsIterator=i},6477:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Base64Utils=void 0;var o=n(2674),i=n(4633),r=function(){function t(){}return t.normalizeToDataUrl=function(e,n){return t.checkPrependDataUrl(e)||(e=t.prependByDataUrl(e,n)),e},t.prependByDataUrl=function(t,e){return"data:"+e+";base64,"+t},t.checkPrependDataUrl=function(e){return t.dataUrl.test(e)},t.deleteDataUrlPrefix=function(e){return e.replace(t.dataUrl,"")},t.getUint8Array=function(t){for(var e=(t=atob(t)).length,n=new Uint8Array(e);e--;)n[e]=t.charCodeAt(e);return n},t.fromArrayBuffer=function(t){for(var e=[],n=new Uint8Array(t),o=n.byteLength,i=0;i{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorUtils=void 0;var o=n(49),i=function(){function t(){}return t.getAlpha=function(t){return t>>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.fromArgbNumber=function(t,e,n,o){return t<<24|e<<16|n<<8|o},t.fromRgbaString=function(t,e){void 0===e&&(e=255);var n=t.replace(/ +/g,"").match(/(rgba?)|(\d+(\.\d+)?%?)|(\.\d+)/g);if(n&&n.length>3){for(var o=[],i=1,r=void 0;r=n[i];i++){var s=-1!==r.indexOf("%")?Math.round(2.55*parseFloat(r)):parseInt(r);if(s<0||s>255)return null;o.push(s)}if(0===t.indexOf("rgba")){if(isNaN(o[3])||o[3]<0||o[3]>1)return null;o[3]<=1&&(o[3]=Math.round(255*o[3]))}else if(o[3])return null;return(255&o[0])<<16|(255&o[1])<<8|255&o[2]|(255&(o.length>3?o[3]:e))<<24}return null},t.fromHashString=function(e,n){return void 0===n&&(n=255),t.isHashColorString(e)?("#"===e.charAt(0)&&(e=e.substr(1)),3===e.length&&(e=o.StringUtils.repeat(e.charAt(0),2)+o.StringUtils.repeat(e.charAt(1),2)+o.StringUtils.repeat(e.charAt(2),2)),parseInt(e,16)|n<<24):null},t.fromColorName=function(e,n){void 0===n&&(n=255);var o=t.colorNames[e.toLowerCase()];return o?t.fromHashString(o,n):null},t.fromString=function(e,n){void 0===n&&(n=255);var o=t.fromRgbaString(e,n);if(null!==o)return o;var i=t.fromHashString(e,n);return null!==i?i:t.fromColorName(e,n)},t.colorToHash=function(e){return"#"+t.redPartToString(e)+t.greenPartToString(e)+t.bluePartToString(e)},t.stringToHash=function(t){var e=this.fromString(t);return null!==e?this.colorToHash(e):null},t.isHashColorString=function(t){return/^#?([0-9a-f]{6})$/i.test(t)||/^#?([0-9a-f]{3})$/i.test(t)},t.isKnownColorName=function(e){return!!t.colorNames[e.toLowerCase()]},t.isGray=function(e){var n=t.getRed(e);return n===t.getGreen(e)&&n===t.getBlue(e)},t.DARK_COLOR=-16777216,t.LIGHT_COLOR=-1,t.colorNames={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",feldspar:"#d19275",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#00ff00",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslateblue:"#8470ff",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",violetred:"#d02090",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",windowtext:"#000000"},t}();e.ColorUtils=i},2491:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.numberToStringHex=e.numberToStringBin=e.isOdd=e.isEven=e.isNonNullString=e.isString=e.isNumber=e.boolToString=e.boolToInt=e.isDefined=void 0;var o=n(49);e.isDefined=function(t){return null!=t},e.boolToInt=function(t){return t?1:0},e.boolToString=function(t){return t?"1":"0"},e.isNumber=function(t){return"number"==typeof t},e.isString=function(t){return"string"==typeof t},e.isNonNullString=function(t){return!!t},e.isEven=function(t){return t%2!=0},e.isOdd=function(t){return t%2==0},e.numberToStringBin=function(t,e){return void 0===e&&(e=0),o.StringUtils.padLeft(t.toString(2),e,"0")},e.numberToStringHex=function(t,e){return void 0===e&&(e=0),o.StringUtils.padLeft(t.toString(16),e,"0")}},4170:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Equals=e.Comparers=void 0;var n=function(){function t(){}return t.number=function(t,e){return t-e},t.string=function(t,e){return t===e?0:t>e?1:-1},t.stringIgnoreCase=function(t,e){return(t=t.toLowerCase())===(e=e.toLowerCase())?0:t>e?1:-1},t}();e.Comparers=n;var o=function(){function t(){}return t.simpleType=function(t,e){return t===e},t.object=function(t,e){return t&&e&&(t===e||t.equals(e))},t}();e.Equals=o},6907:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DomUtils=void 0;var o=n(9279),i=n(2491),r=n(8679),s=n(49),a=function(){function t(){}return t.clearInnerHtml=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},t.setStylePosition=function(t,e){t.left=r.MathUtils.round(e.x,3)+"px",t.top=r.MathUtils.round(e.y,3)+"px"},t.setStyleSize=function(t,e){t.width=r.MathUtils.round(e.width,3)+"px",t.height=r.MathUtils.round(e.height,3)+"px"},t.setStyleSizeAndPosition=function(e,n){t.setStylePosition(e,n),t.setStyleSize(e,n)},t.hideNode=function(t){if(t){var e=t.parentNode;e&&e.removeChild(t)}},t.isHTMLElementNode=function(t){return t.nodeType===Node.ELEMENT_NODE},t.isTextNode=function(t){return t.nodeType===Node.TEXT_NODE},t.isElementNode=function(t){return t.nodeType===Node.ELEMENT_NODE},t.isHTMLTableRowElement=function(t){return"TR"===t.tagName},t.isItParent=function(t,e){if(!t||!e)return!1;for(;e;){if(e===t)return!0;if("BODY"===e.tagName)return!1;e=e.parentNode}return!1},t.getParentByTagName=function(t,e){for(e=e.toUpperCase();t;){if("BODY"===t.tagName)return null;if(t.tagName===e)return t;t=t.parentNode}return null},t.getDocumentScrollTop=function(){var e=o.Browser.IE&&"hidden"===t.getCurrentStyle(document.body).overflow&&document.body.scrollTop>0;return o.Browser.WebKitFamily||o.Browser.Edge||e?o.Browser.MacOSMobilePlatform?window.pageYOffset:o.Browser.WebKitFamily&&document.documentElement.scrollTop||document.body.scrollTop:document.documentElement.scrollTop},t.getDocumentScrollLeft=function(){var e=o.Browser.IE&&"hidden"===t.getCurrentStyle(document.body).overflow&&document.body.scrollLeft>0;return o.Browser.Edge||e?document.body?document.body.scrollLeft:document.documentElement.scrollLeft:o.Browser.WebKitFamily?document.documentElement.scrollLeft||document.body.scrollLeft:document.documentElement.scrollLeft},t.getCurrentStyle=function(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=[],r=window.frameElement;!(e=document.defaultView.getComputedStyle(t,null));)n.push([r,r.style.display]),r.style.setProperty("display","block","important"),r="BODY"===r.tagName?r.ownerDocument.defaultView.frameElement:r.parentNode;e=function(t){if("object"!=typeof t||!i.isDefined(t))return t;var e={};for(var n in t)e[n]=t[n];return e}(e);for(var s=void 0,a=0;s=n[a];a++)s[0].style.display=s[1];document.body.offsetWidth}return e}return window.getComputedStyle(t,null)},t.setFocus=function(t){function e(){try{t.focus(),o.Browser.IE&&document.activeElement!==t&&t.focus()}catch(t){}}o.Browser.MacOSMobilePlatform?e():setTimeout((function(){e()}),100)},t.hasClassName=function(t,e){try{var n=e.split(" "),o=t.classList;if(o){for(var i=n.length-1;i>=0;i--)if(!o.contains(n[i]))return!1}else{var r=t.getAttribute&&t.getAttribute("class");if(!r)return!1;var s=r.split(" ");for(i=n.length-1;i>=0;i--)if(s.indexOf(n[i])<0)return!1}return!0}catch(t){return!1}},t.addClassName=function(e,n){if(!t.hasClassName(e,n)){var o=e.getAttribute&&e.getAttribute("class");e.setAttribute("class",""===o?n:o+" "+n)}},t.removeClassName=function(t,e){var n=" "+(t.getAttribute&&t.getAttribute("class"))+" ",o=n.replace(" "+e+" "," ");n.length!==o.length&&t.setAttribute("class",s.StringUtils.trim(o))},t.toggleClassName=function(e,n,o){void 0===o?t.hasClassName(e,n)?t.removeClassName(e,n):t.addClassName(e,n):o?t.addClassName(e,n):t.removeClassName(e,n)},t.pxToInt=function(t){return c(t,parseInt)},t.pxToFloat=function(t){return c(t,parseFloat)},t.getAbsolutePositionY=function(e){function n(e){return Math.round(e.getBoundingClientRect().top+t.getDocumentScrollTop())}return e?o.Browser.IE?function(e){return o.Browser.IE&&null===e.parentNode?0:e.getBoundingClientRect().top+t.getDocumentScrollTop()}(e):o.Browser.Firefox&&o.Browser.Version>=3?n(e):o.Browser.NetscapeFamily&&(!o.Browser.Firefox||o.Browser.Version<3)?function(e){for(var n=u(e,!1),i=!0;null!=e;){if(n+=e.offsetTop,i||null==e.offsetParent||(n-=e.scrollTop),!i&&o.Browser.Firefox){var r=t.getCurrentStyle(e);"DIV"===e.tagName&&"visible"!==r.overflow&&(n+=t.pxToInt(r.borderTopWidth))}i=!1,e=e.offsetParent}return n}(e):o.Browser.WebKitFamily||o.Browser.Edge?n(e):function(t){for(var e=0,n=!0;null!=t;)e+=t.offsetTop,n||null==t.offsetParent||(e-=t.scrollTop),n=!1,t=t.offsetParent;return e}(e):0},t.getAbsolutePositionX=function(e){function n(e){return Math.round(e.getBoundingClientRect().left+t.getDocumentScrollLeft())}return e?o.Browser.IE?function(e){return o.Browser.IE&&null===e.parentNode?0:e.getBoundingClientRect().left+t.getDocumentScrollLeft()}(e):o.Browser.Firefox&&o.Browser.Version>=3?n(e):o.Browser.Opera&&o.Browser.Version<=12?function(t){for(var e=!0,n=u(t,!0);null!=t;)n+=t.offsetLeft,e||(n-=t.scrollLeft),t=t.offsetParent,e=!1;return n+=document.body.scrollLeft}(e):o.Browser.NetscapeFamily&&(!o.Browser.Firefox||o.Browser.Version<3)?function(e){for(var n=u(e,!0),i=!0;null!=e;){if(n+=e.offsetLeft,i||null==e.offsetParent||(n-=e.scrollLeft),!i&&o.Browser.Firefox){var r=t.getCurrentStyle(e);"DIV"===e.tagName&&"visible"!==r.overflow&&(n+=t.pxToInt(r.borderLeftWidth))}i=!1,e=e.offsetParent}return n}(e):o.Browser.WebKitFamily||o.Browser.Edge?n(e):function(t){for(var e=0,n=!0;null!=t;)e+=t.offsetLeft,n||null==t.offsetParent||(e-=t.scrollLeft),n=!1,t=t.offsetParent;return e}(e):0},t.isInteractiveControl=function(t){return["A","INPUT","SELECT","OPTION","TEXTAREA","BUTTON","IFRAME"].indexOf(t.tagName)>-1},t.getClearClientHeight=function(e){return e.offsetHeight-(t.getTopBottomPaddings(e)+t.getVerticalBordersWidth(e))},t.getTopBottomPaddings=function(e,n){var o=n||t.getCurrentStyle(e);return t.pxToInt(o.paddingTop)+t.pxToInt(o.paddingBottom)},t.getVerticalBordersWidth=function(e,n){i.isDefined(n)||(n=o.Browser.IE&&9!==o.Browser.MajorVersion&&window.getComputedStyle?window.getComputedStyle(e):t.getCurrentStyle(e));var r=0;return"none"!==n.borderTopStyle&&(r+=t.pxToFloat(n.borderTopWidth)),"none"!==n.borderBottomStyle&&(r+=t.pxToFloat(n.borderBottomWidth)),r},t.getNodes=function(t,e){for(var n=t.all||t.getElementsByTagName("*"),o=[],i=0;i=9||o.Browser.Edge?e.textContent:e.innerText},t.html2PlainTextFilter=null,t.verticalScrollBarWidth=void 0,t}();function c(t,e){var n=0;if(i.isDefined(t)&&""!==t)try{var o=t.indexOf("px");o>-1&&(n=e(t.substr(0,o)))}catch(t){}return n}function u(t,e){for(var n=0,o=!0;null!=t&&"BODY"!==t.tagName;){var i=a.getCurrentStyle(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}e.DomUtils=a},9712:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeUtils=void 0;var n=function(){function t(){}return t.encodeHtml=function(t){return t.replace(/&/g,"&").replace(//g,">")},t.decodeHtml=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")},t.prepareTextForRequest=function(t){return t.replace(/%/g,"%25").replace(/&/g,"%26amp;").replace(/\+/g,"%2B").replace(//g,"%26gt;").replace(/"/g,"%26quot;")},t.prepareTextForCallBackRequest=function(t){return t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},t.decodeViaTextArea=function(t){var e=document.createElement("TEXTAREA");return e.innerHTML=t,e.value},t}();e.EncodeUtils=n},3714:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EvtUtils=void 0;var o=n(9279),i=n(2491),r=n(6907),s=n(1632),a=function(){function t(){}return t.preventEvent=function(t){t.cancelable&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},t.getEventSource=function(e){return i.isDefined(e)?t.getEventSourceCore(e):null},t.getEventSourceByPosition=function(e){if(!i.isDefined(e))return null;if(!document.elementFromPoint)return t.getEventSourceCore(e);var n=t.getEventX(e)-(t.clientEventRequiresDocScrollCorrection()?r.DomUtils.getDocumentScrollLeft():0),o=t.getEventY(e)-(t.clientEventRequiresDocScrollCorrection()?r.DomUtils.getDocumentScrollTop():0);return void 0===n||void 0===o?t.getEventSourceCore(e):document.elementFromPoint(n,o)},t.getEventSourceCore=function(t){return t.srcElement?t.srcElement:t.target},t.getMouseWheelEventName=function(){return o.Browser.Safari?"mousewheel":o.Browser.NetscapeFamily&&o.Browser.MajorVersion<17?"DOMMouseScroll":"wheel"},t.isLeftButtonPressed=function(e){return!!s.TouchUtils.isTouchEvent(e)||!!(e=o.Browser.IE&&i.isDefined(event)?event:e)&&(o.Browser.IE&&o.Browser.Version<11?!!o.Browser.MSTouchUI||e.button%2==1:o.Browser.WebKitFamily?"pointermove"===e.type||"pointerenter"===e.type||"pointerleave"===e.type?1===e.buttons:1===e.which:o.Browser.NetscapeFamily||o.Browser.Edge||o.Browser.IE&&o.Browser.Version>=11?t.isMoveEventName(e.type)?1===e.buttons:1===e.which:!o.Browser.Opera||0===e.button)},t.isMoveEventName=function(e){return e===s.TouchUtils.touchMouseMoveEventName||e===t.getMoveEventName()},t.getMoveEventName=function(){return window.PointerEvent?"pointermove":o.Browser.TouchUI?"touchmove":"mousemove"},t.preventEventAndBubble=function(e){t.preventEvent(e),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},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 s.TouchUtils.isTouchEvent(e)?s.TouchUtils.getEventX(e):e.clientX+(t.clientEventRequiresDocScrollCorrection()?r.DomUtils.getDocumentScrollLeft():0)},t.getEventY=function(e){return s.TouchUtils.isTouchEvent(e)?s.TouchUtils.getEventY(e):e.clientY+(t.clientEventRequiresDocScrollCorrection()?r.DomUtils.getDocumentScrollTop():0)},t.cancelBubble=function(t){t.cancelBubble=!0},t.getWheelDelta=function(t){var e;return e=o.Browser.NetscapeFamily&&o.Browser.MajorVersion<17?-t.detail:o.Browser.Safari?t.wheelDelta:-t.deltaY,o.Browser.Opera&&o.Browser.Version<9&&(e=-e),e},t}();e.EvtUtils=a},2674:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FileUtils=void 0;var o=n(9279),i=n(6477),r=n(2491),s=function(){function t(){}return t.loadJavascriptFile=function(t,e){var n,o=document.getElementsByTagName("head")[0];if(!o){o=document.createElement("head");var i=document.getElementsByTagName("body")[0];null===(n=i.parentNode)||void 0===n||n.insertBefore(o,i)}var r=document.createElement("script");return r.onload=e,r.src=t,o.appendChild(r),{htmlScriptElement:r}},t.startDownloadFileLocal=function(t,e){if(t instanceof ArrayBuffer&&(t=i.Base64Utils.fromArrayBuffer(t)),r.isString(t)&&(t=i.Base64Utils.getFileFromBase64(t)),window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(t,e);else{var n=document.createElement("a"),o=URL.createObjectURL(t);n.href=o,n.download=e,document.body.appendChild(n),n.click(),setTimeout((function(){document.body.removeChild(n),window.URL.revokeObjectURL(o)}),0)}},t.createFile=function(t,e,n){var i;if(o.Browser.IE||o.Browser.Edge&&o.Browser.MajorVersion<86){var r=new Blob(t,n);return r.lastModifiedDate=null!==(i=null==n?void 0:n.lastModified)&&void 0!==i?i:Date.now(),r.name=e,r}return new File(t,e,n)},t.isFile=function(t){return o.Browser.IE||o.Browser.Edge&&o.Browser.MajorVersion<86?t instanceof File||t instanceof Blob&&r.isDefined(t.name):t instanceof File},t}();e.FileUtils=s},2153:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.KeyCode=e.ModifierKey=e.KeyUtils=void 0;var o,i,r=n(9279),s=n(9712),a=n(49),c=function(){function t(){}return t.getKeyModifiers=function(t){var e=0;return t.altKey&&(e|=o.Alt),t.ctrlKey&&(e|=o.Ctrl),t.shiftKey&&(e|=o.Shift),t.metaKey&&(e|=o.Meta),e},t.getShortcutCode=function(t,e,n,i,r){var s=t;return s|=e?o.Ctrl:0,s|=n?o.Shift:0,s|=i?o.Alt:0,s|=r?o.Meta:0},t.getShortcutCodeByEvent=function(e){return t.getShortcutCode(t.getEventKeyCode(e),e.ctrlKey,e.shiftKey,e.altKey,!!r.Browser.MacOSPlatform&&e.metaKey)},t.getEventKeyCode=function(t){return r.Browser.NetscapeFamily||r.Browser.Opera?t.which:t.keyCode},t.parseShortcutString=function(e){if(!e)return 0;var n=!1,o=!1,r=!1,c=!1,u=null,h=e.toString().split("+");if(h.length>0)for(var p=0;p{Object.defineProperty(e,"__esModule",{value:!0}),e.ListUtils=void 0;var o=n(6799),i=n(4170),r=function(){function t(){}return t.remove=function(t,e){var n=t.indexOf(e,0);n>=0&&t.splice(n,1)},t.removeBy=function(t,e){for(var n=t.length,o=0;o0;t--)n.push(e);return n},t.initByCallback=function(t,e){for(var n=[],o=0;o=n;o--)e(o)},t.reducedMap=function(t,e,n,o){void 0===n&&(n=0),void 0===o&&(o=t.length);for(var i=[],r=n;r=o;i--)if(e(t[i],i))return i;return-1},t.elementBy=function(e,n,o,i){void 0===o&&(o=0),void 0===i&&(i=e.length);var r=t.indexBy(e,n,o,i);return r<0?null:e[r]},t.reverseElementBy=function(e,n,o,i){void 0===o&&(o=e.length-1),void 0===i&&(i=0);var r=t.reverseIndexBy(e,n,o,i);return r<0?null:e[r]},t.last=function(t){return t[t.length-1]},t.setLast=function(t,e){return t[t.length-1]=e},t.incLast=function(t){return++t[t.length-1]},t.decLast=function(t){return--t[t.length-1]},t.equals=function(e,n){return e.length===n.length&&t.allOf2(e,n,(function(t,e){return t.equals(e)}))},t.equalsByReference=function(t,e){var n=t.length;if(n!==t.length)return!1;for(var o=0;o=0;n--)e===t[n]?t.splice(n,1):e=t[n];return t},t.forEach=function(t,e,n,o){void 0===n&&(n=0),void 0===o&&(o=t.length);for(var i=n;i=o;i--)e(t[i],i)},t.reverseIndexOf=function(t,e,n,o){void 0===n&&(n=t.length-1),void 0===o&&(o=0);for(var i=n;i>=o;i--)if(t[i]===e)return i;return-1},t.accumulate=function(t,e,n,o,i){void 0===o&&(o=0),void 0===i&&(i=t.length);for(var r=e,s=o;s=o;i--)if(e(t[i],i))return!0;return!1},t.unsafeReverseAnyOf=function(t,e,n,o){void 0===n&&(n=t.length-1),void 0===o&&(o=0);for(var i=n;i>=o;i--){var r=e(t[i],i);if(r)return r}return null},t.anyOf2=function(t,e,n,o,i){void 0===o&&(o=0),void 0===i&&(i=t.length);for(var r=o;rs&&(s=u,r=c)}return new o.ExtendedMax(r,s)},t.minMaxExtended=function(t,e,n,i){if(void 0===n&&(n=0),void 0===i&&(i=t.length),0===t.length)return null;for(var r=t[n],s=r,a=e(r),c=a,u=n+1;uc&&(c=p,s=h)}return new o.ExtendedMinMax(r,a,s,c)},t.minByCmp=function(t,e,n,o){if(void 0===n&&(n=0),void 0===o&&(o=t.length),0===t.length)return null;for(var i=t[n],r=n+1;r0&&(i=s)}return i},t.minMaxByCmp=function(t,e,n,i){if(void 0===n&&(n=0),void 0===i&&(i=t.length),0===t.length)return null;for(var r=t[n],s=r,a=n+1;a0?s=c:u<0&&(r=c)}return new o.MinMax(r,s)},t}();e.ListUtils=r},8679:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=void 0;var o=n(2940),i=function(){function t(){}return t.round=function(e,n){void 0===n&&(n=0);var o=t.powFactor[n];return Math.round(e*o)/o},t.numberCloseTo=function(t,e,n){return void 0===n&&(n=1e-5),Math.abs(t-e)n?n:t{var n,o,i,r;Object.defineProperty(e,"__esModule",{value:!0}),e.MimeTypeUtils=e.DxMimeType=e.ImageWebpMimeType=e.ImageWbmpMimeType=e.ImageIcoMimeType=e.ImageTiffMimeType=e.ImageSvgMimeType=e.ImagePjpegMimeType=e.ImageJpegMimeType=e.ImageGifMimeType=e.ImagePngMimeType=e.DocmMimeType=e.HtmlMimeType=e.PlainTextMimeType=e.RtfMimeType=e.OpenXmlMimeType=void 0,e.OpenXmlMimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document",e.RtfMimeType="application/rtf",e.PlainTextMimeType="text/plain",e.HtmlMimeType="text/html",e.DocmMimeType="application/vnd.ms-word.document.macroEnabled.12",e.ImagePngMimeType="image/png",e.ImageGifMimeType="image/gif",e.ImageJpegMimeType="image/jpeg",e.ImagePjpegMimeType="image/pjpeg",e.ImageSvgMimeType="image/svg+xml",e.ImageTiffMimeType="image/tiff",e.ImageIcoMimeType="image/vnd.microsoft.icon",e.ImageWbmpMimeType="image/vnd.wap.wbmp",e.ImageWebpMimeType="image/webp",function(t){t[t.Unknown=0]="Unknown",t[t.OpenXml=1]="OpenXml",t[t.Rtf=2]="Rtf",t[t.PlainText=3]="PlainText",t[t.Docm=4]="Docm",t[t.Png=5]="Png",t[t.Gif=6]="Gif",t[t.Jpeg=7]="Jpeg",t[t.Pjpeg=8]="Pjpeg",t[t.Svg=9]="Svg",t[t.Tiff=10]="Tiff",t[t.Ico=11]="Ico",t[t.Wbmp=12]="Wbmp",t[t.Webp=13]="Webp",t[t.Html=14]="Html"}(r=e.DxMimeType||(e.DxMimeType={}));var s=function(){function t(){}return t.stringTypeToExtension=function(e){var n=t.stringTypeToTypeMap[e];return void 0===n?"":t.typeToExtensionMap[n]},t.typeToExtension=function(e){var n=t.typeToExtensionMap[e];return null!=n?n:""},t.extensionToType=function(e){"."!==(e=e.toLowerCase())[0]&&(e+=".");var n=t.extensionToTypeMap[e];return null!=n?n:r.Unknown},t.typeToStringType=function(e){var n=t.typeToStringTypeMap[e];return null!=n?n:""},t.stringTypeToType=function(e){var n=t.stringTypeToTypeMap[e];return void 0===n?r.Unknown:n},t.stringTypeToTypeMap=((n={})[e.OpenXmlMimeType]=r.OpenXml,n[e.RtfMimeType]=r.Rtf,n[e.PlainTextMimeType]=r.PlainText,n[e.DocmMimeType]=r.Docm,n[e.HtmlMimeType]=r.Html,n[e.ImagePngMimeType]=r.Png,n[e.ImageGifMimeType]=r.Gif,n[e.ImageJpegMimeType]=r.Jpeg,n[e.ImagePjpegMimeType]=r.Pjpeg,n[e.ImageSvgMimeType]=r.Svg,n[e.ImageTiffMimeType]=r.Tiff,n[e.ImageIcoMimeType]=r.Ico,n[e.ImageWbmpMimeType]=r.Wbmp,n[e.ImageWebpMimeType]=r.Webp,n),t.typeToStringTypeMap=((o={})[r.Unknown]=void 0,o[r.OpenXml]=e.OpenXmlMimeType,o[r.Rtf]=e.RtfMimeType,o[r.PlainText]=e.PlainTextMimeType,o[r.Docm]=e.DocmMimeType,o[r.Html]=e.HtmlMimeType,o[r.Png]=e.ImagePngMimeType,o[r.Gif]=e.ImageGifMimeType,o[r.Jpeg]=e.ImageJpegMimeType,o[r.Pjpeg]=e.ImagePjpegMimeType,o[r.Svg]=e.ImageSvgMimeType,o[r.Tiff]=e.ImageTiffMimeType,o[r.Ico]=e.ImageIcoMimeType,o[r.Wbmp]=e.ImageWbmpMimeType,o[r.Webp]=e.ImageWebpMimeType,o),t.typeToExtensionMap=((i={})[r.Unknown]=void 0,i[r.OpenXml]=".docx",i[r.Rtf]=".rtf",i[r.PlainText]=".txt",i[r.Docm]=".docm",i[r.Html]=".html",i[r.Png]=".png",i[r.Gif]=".gif",i[r.Jpeg]=".jpeg",i[r.Pjpeg]=".pjpeg",i[r.Svg]=".svg",i[r.Tiff]=".tiff",i[r.Ico]=".ico",i[r.Wbmp]=".wbmp",i[r.Webp]=".webp",i),t.extensionToTypeMap={".docx":r.OpenXml,".rtf":r.Rtf,".txt":r.PlainText,".docm":r.Docm,".html":r.Html,".htm":r.Html,".png":r.Png,".gif":r.Gif,".jpeg":r.Jpeg,".pjpeg":r.Pjpeg,".svg":r.Svg,".tiff":r.Tiff,".ico":r.Ico,".wbmp":r.Wbmp,".webp":r.Webp},t}();e.MimeTypeUtils=s},2400:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SearchUtils=void 0;var n=function(){function t(){}return t.binaryIndexOf=function(t,e,n,o){void 0===n&&(n=0),void 0===o&&(o=-2);var i=0===n;for(-2===o&&(o=t.length-1);n<=o;){var r=n+(o-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.normedInterpolationIndexOf=function(t,e,n,o,i){void 0===o&&(o=0),void 0===i&&(i=-2),-2===i&&(i=t.length-1);var r=t[Math.min(o,i)];if(void 0===r||ns&&nu){if(n<(s=e(t[o=c+1])))return c}else{if(!(n{Object.defineProperty(e,"__esModule",{value:!0}),e.StringUtils=void 0;var n=function(){function t(){}return t.isAlpha=function(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"},t.isDigit=function(t){return t>="0"&&t<="9"},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.atLeastOneSymbolInUpperCase=function(e){for(var n=0,o=void 0;o=e[n];n++)if(t.stringInUpperCase(o)&&!t.stringInLowerCase(o))return!0;return!1},t.getSymbolFromEnd=function(t,e){return t[t.length-e]},t.trim=function(e,n){if(void 0===n)return t.trimInternal(e,!0,!0);var o=n.join("");return e.replace(new RegExp("(^["+o+"]*)|(["+o+"]*$)","g"),"")},t.trimStart=function(e,n){if(void 0===n)return t.trimInternal(e,!0,!1);var o=n.join("");return e.replace(new RegExp("^["+o+"]*","g"),"")},t.trimEnd=function(e,n){if(void 0===n)return t.trimInternal(e,!1,!0);var o=n.join("");return e.replace(new RegExp("["+o+"]*$","g"),"")},t.getDecimalSeparator=function(){return 1.1.toLocaleString().substr(1,1)},t.repeat=function(t,e){return new Array(e<=0?0:e+1).join(t)},t.isNullOrEmpty=function(t){return!t||!t.length},t.padLeft=function(e,n,o){return t.repeat(o,Math.max(0,n-e.length))+e},t.trimInternal=function(t,e,n){var o=t.length;if(!o)return t;if(o<764833){var i=t;return e&&(i=i.replace(/^\s+/,"")),n&&(i=i.replace(/\s+$/,"")),i}var r=0;if(n)for(;o>0&&/\s/.test(t[o-1]);)o--;if(e&&o>0)for(;r{Object.defineProperty(e,"__esModule",{value:!0}),e.TouchUtils=void 0;var o=n(9279),i=n(2491),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 o.Browser.WebKitTouchUI&&i.isDefined(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.TouchUtils=r},7097:(t,e,n)=>{n(8091).polyfill()},8091:t=>{function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var n=Object(t),o=1;o{n.r(e)},5656:function(t,e,n){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])},o(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}),e.ApiController=void 0;var r,s=n(1772),a=n(6031),c=n(4867),u=n(3607),h=function(t){function e(e,n,o){var i=t.call(this)||this;return i.events=e,i.model=o,i.selection=n,i}return i(e,t),e.prototype.notifySelectionChanged=function(t){this.isUpdateLocked()?this.registerOccurredEvent(r.SelectionChanged):this.raiseSelectionChanged()},e.prototype.notifyToolboxDragStart=function(){this.events.raise("notifyToolboxItemDragStart")},e.prototype.notifyToolboxDragEnd=function(){this.events.raise("notifyToolboxItemDragEnd")},e.prototype.notifyToolboxDraggingMouseMove=function(){},e.prototype.notifyClick=function(t){var e=this;this.tryRaiseUserAction(t,(function(t){return e.events.raise("notifyItemClick",t)}))},e.prototype.notifyDblClick=function(t){var e=this;this.tryRaiseUserAction(t,(function(t){return e.events.raise("notifyItemDblClick",t)}))},e.prototype.createNativeItem=function(t){return t&&this.cleanupNativeItem(t.toNative(this.model.units))},e.prototype.createNativeShape=function(t){return this.createNativeItem(t)},e.prototype.createNativeConnector=function(t){return this.createNativeItem(t)},e.prototype.convertUnit=function(t){return c.ModelUtils.getlUnitValue(this.model.units,t)},e.prototype.convertPoint=function(t){return new u.Point(this.convertUnit(t.x),this.convertUnit(t.y))},e.prototype.convertSize=function(t){return new u.Size(this.convertUnit(t.width),this.convertUnit(t.height))},e.prototype.cleanupNativeItem=function(t){var e=this.dataSource;return e&&(e.isAutoGeneratedKey(t.fromKey)&&(t.fromKey=void 0),e.isAutoGeneratedKey(t.key)&&(t.key=void 0),e.isAutoGeneratedKey(t.toKey)&&(t.toKey=void 0)),t},e.prototype.setDataSource=function(t){this.dataSource=t},e.prototype.tryRaiseUserAction=function(t,e){var n=this;if(this.isUserAction(t)){var o=this.model.findItem(t.source.key);o&&this.events.raise1((function(t){return e(n.createNativeItem(o))}))}},e.prototype.isUserAction=function(t){return t.source&&(t.source.type===a.MouseEventElementType.Shape||t.source.type===a.MouseEventElementType.ShapeExpandButton||t.source.type===a.MouseEventElementType.ShapeParameterBox||t.source.type===a.MouseEventElementType.ShapeResizeBox||t.source.type===a.MouseEventElementType.ShapeConnectionPoint||t.source.type===a.MouseEventElementType.Connector||t.source.type===a.MouseEventElementType.ConnectorPoint||t.source.type===a.MouseEventElementType.ConnectorSide||t.source.type===a.MouseEventElementType.ConnectorOrthogonalSide||t.source.type===a.MouseEventElementType.ConnectorText)},e.prototype.onUpdateUnlocked=function(t){t&r.SelectionChanged&&this.raiseSelectionChanged()},e.prototype.raiseSelectionChanged=function(){var t=this,e=this.selection.getKeys().map((function(e){return t.createNativeItem(t.model.findItem(e))}));this.events.raise1((function(t){return t.notifySelectionChanged(e)}))},e}(s.BatchUpdatableObject);e.ApiController=h,function(t){t[t.SelectionChanged=1]="SelectionChanged"}(r||(r={}))},7185:function(t,e,n){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])},o(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}),e.NativeConnector=e.NativeShape=e.NativeItem=void 0;var r=n(4867),s=function(){function t(t,e){this.id=t,this.key=e,this.unitsApplied=!1}return t.prototype.applyUnits=function(t){this.unitsApplied||void 0===t||(this.applyUnitsCore(t),this.unitsApplied=!0)},t}();e.NativeItem=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.applyUnitsCore=function(t){this.position.x=r.ModelUtils.getlUnitValue(t,this.position.x),this.position.y=r.ModelUtils.getlUnitValue(t,this.position.y),this.size.width=r.ModelUtils.getlUnitValue(t,this.size.width),this.size.height=r.ModelUtils.getlUnitValue(t,this.size.height)},e}(s);e.NativeShape=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.applyUnitsCore=function(t){this.points.forEach((function(e){e.x=r.ModelUtils.getlUnitValue(t,e.x),e.y=r.ModelUtils.getlUnitValue(t,e.y)}))},e}(s);e.NativeConnector=c},8906:function(t,e,n){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])},o(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}),e.AutoLayoutCommandBase=void 0;var r=n(4867),s=n(9741),a=n(5503),c=n(7959),u=n(8675),h=n(8011),p=n(7626),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){var n=this;this.control.history.beginTransaction();var o=this.getAffectedShapes(),i=this.getAffectedConnectors(),s=this.createLayoutSettings(),a=r.ModelUtils.getGraphInfoByItems(this.control.model,o,i,!1);if(a.length){var c,l=this.control.model,d=u.GeometryUtils.getCommonRectangle(u.Utils.flatten(a.map((function(t){return t.graph.items.map((function(t){return l.findItem(t.key)}))}))).concat(a.map((function(t){return t.container}))).filter((function(t){return t})).map((function(t){return t.rectangle})));this.control.history.addAndRedo(new p.ScrollIntoViewOnUndoHistoryItem(this.control.view,d)),a.forEach((function(t){var e=n.createLayout(s,t.graph),a=r.ModelUtils.getNonGraphItems(n.control.model,t.container,e.nodeToLayout,o,i),u=r.ModelUtils.applyLayout(n.control.history,n.control.model,t.container,t.graph,e,a,s,n.control.settings.snapToGrid,n.control.settings.gridSize,!1);c=c&&h.Rectangle.union(c,u)||u})),r.ModelUtils.tryUpdateModelRectangle(this.control.history),this.control.history.addAndRedo(new p.ScrollIntoViewOnRedoHistoryItem(this.control.view,c))}return this.control.history.endTransaction(),!0},e.prototype.getAffectedShapes=function(){return this.control.selection.isEmpty()?this.control.model.items.filter((function(t){return t instanceof a.Shape&&!t.locked})):this.control.selection.getSelectedShapes(!1,!0)},e.prototype.getAffectedConnectors=function(){return this.control.selection.isEmpty()?this.control.model.items.filter((function(t){return t instanceof c.Connector&&!t.locked})):this.control.selection.getSelectedConnectors(!1,!0)},e}(s.SimpleCommandBase);e.AutoLayoutCommandBase=l},30:function(t,e,n){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])},o(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}),e.AutoLayoutLayeredHorizontalCommand=void 0;var r=n(8906),s=n(1256),a=n(8710),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var t=new a.LayoutSettings;return t.orientation=a.DataLayoutOrientation.Horizontal,t},e.prototype.createLayout=function(t,e){return new s.SugiyamaLayoutBuilder(t,e).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutLayeredHorizontalCommand=c},7826:function(t,e,n){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])},o(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}),e.AutoLayoutLayeredHorizontalRightToLeftCommand=void 0;var r=n(8710),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var e=t.prototype.createLayoutSettings.call(this);return e.direction=r.LogicalDirectionKind.Backward,e},e}(n(30).AutoLayoutLayeredHorizontalCommand);e.AutoLayoutLayeredHorizontalRightToLeftCommand=s},554:function(t,e,n){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])},o(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}),e.AutoLayoutLayeredVerticalBottomToTopCommand=void 0;var r=n(8710),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var e=t.prototype.createLayoutSettings.call(this);return e.direction=r.LogicalDirectionKind.Backward,e},e}(n(9427).AutoLayoutLayeredVerticalCommand);e.AutoLayoutLayeredVerticalBottomToTopCommand=s},9427:function(t,e,n){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])},o(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}),e.AutoLayoutLayeredVerticalCommand=void 0;var r=n(8906),s=n(1256),a=n(8710),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var t=new a.LayoutSettings;return t.orientation=a.DataLayoutOrientation.Vertical,t},e.prototype.createLayout=function(t,e){return new s.SugiyamaLayoutBuilder(t,e).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutLayeredVerticalCommand=c},7004:function(t,e,n){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])},o(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}),e.AutoLayoutTreeHorizontalCommand=void 0;var r=n(8906),s=n(9533),a=n(8710),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var t=this.control.settings.snapToGrid?this.control.settings.gridSize:void 0,e=new a.TreeLayoutSettings(t);return e.orientation=a.DataLayoutOrientation.Horizontal,e},e.prototype.createLayout=function(t,e){return new s.TreeLayoutBuilder(t,e).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutTreeHorizontalCommand=c},5010:function(t,e,n){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])},o(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}),e.AutoLayoutTreeHorizontalRightToLeftCommand=void 0;var r=n(8710),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var e=t.prototype.createLayoutSettings.call(this);return e.direction=r.LogicalDirectionKind.Backward,e},e}(n(7004).AutoLayoutTreeHorizontalCommand);e.AutoLayoutTreeHorizontalRightToLeftCommand=s},2217:function(t,e,n){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])},o(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}),e.AutoLayoutTreeVerticalBottomToTopCommand=void 0;var r=n(8710),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var e=t.prototype.createLayoutSettings.call(this);return e.direction=r.LogicalDirectionKind.Backward,e},e}(n(375).AutoLayoutTreeVerticalCommand);e.AutoLayoutTreeVerticalBottomToTopCommand=s},375:function(t,e,n){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])},o(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}),e.AutoLayoutTreeVerticalCommand=void 0;var r=n(8906),s=n(9533),a=n(8710),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createLayoutSettings=function(){var t=this.control.settings.snapToGrid?this.control.settings.gridSize:void 0,e=new a.TreeLayoutSettings(t);return e.orientation=a.DataLayoutOrientation.Vertical,e},e.prototype.createLayout=function(t,e){return new s.TreeLayoutBuilder(t,e).build()},e}(r.AutoLayoutCommandBase);e.AutoLayoutTreeVerticalCommand=c},4982:function(t,e,n){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])},o(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}),e.ClipboardCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.setClipboardData=function(t){this.control.render&&this.control.render.input.setClipboardData(t),e.clipboardData=t},e.prototype.getClipboardData=function(t){this.control.render&&this.isPasteSupportedByBrowser()?this.control.render.input.getClipboardData(t):t(e.clipboardData)},e.prototype.isPasteSupportedByBrowser=function(){return this.control.render&&this.control.render.input.isPasteSupportedByBrowser()},e}(n(9741).SimpleCommandBase);e.ClipboardCommand=r},5827:function(t,e,n){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])},o(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}),e.CopySelectionCommand=void 0;var r=n(5885),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(!0)},e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.executeCore=function(t){var e=(new r.Exporter).exportItems(this.control.selection.getSelectedItems(!0,!0));return this.setClipboardData(e),!0},e}(n(4982).ClipboardCommand);e.CopySelectionCommand=s},2664:function(t,e,n){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])},o(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}),e.CutSelectionCommand=void 0;var r=n(5885),s=n(4867),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.control.selection.getSelectedItems();return t.prototype.isEnabled.call(this)&&e.length&&(e.length>1||this.permissionsProvider.canDeleteItems(e))},e.prototype.executeCore=function(t){var e=new r.Exporter,n=this.control.selection.getSelectedItems(!0,!0),o=e.exportItems(n);return this.permissionsProvider.beginDeleteItems(n),this.setClipboardData(o),s.ModelUtils.deleteSelection(this.control.history,this.control.model,this.control.selection),this.permissionsProvider.endDeleteItems(),!0},Object.defineProperty(e.prototype,"isPermissionsRequired",{get:function(){return!0},enumerable:!1,configurable:!0}),e}(n(4982).ClipboardCommand);e.CutSelectionCommand=a},4200:function(t,e,n){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])},o(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}),e.PasteSelectionCommand=void 0;var r=n(8900),s=n(7688),a=n(5503),c=n(7959),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getEventPositionOffset=function(t,e){var n=t.reduce((function(t,e){var n=e instanceof a.Shape?e.position.x:e instanceof c.Connector?e.getMinX():Number.MAX_VALUE,o=e instanceof a.Shape?e.position.y:e instanceof c.Connector?e.getMinY():Number.MAX_VALUE;return(o{Object.defineProperty(e,"__esModule",{value:!0}),e.CommandBase=void 0;var n=function(){function t(t){this.control=t}return t.prototype.execute=function(t){this.isPermissionsRequired&&this.permissionsProvider.lockPermissions();var e=this.getState();if(this.isPermissionsRequired&&this.permissionsProvider.unlockPermissions(),!e.enabled)return!1;this.control.beginUpdate();var n=!1;return n=this.isPermissionsRequired?this.executeWithPermissions(e,t):this.executeCore(e,t),this.control.endUpdate(),n&&this.updateControlState(),n},t.prototype.executeWithPermissions=function(t,e){var n=!1;return this.permissionsProvider.beginStorePermissions(),this.control.history.beginTransaction(),n=this.executeCore(t,e),this.permissionsProvider.isStoredPermissionsGranted()||(this.permissionsProvider.lockPermissions(),this.control.history.undoTransaction(),this.permissionsProvider.unlockPermissions(),n=!1),this.control.history.endTransaction(),this.permissionsProvider.endStorePermissions(),n},t.prototype.updateControlState=function(){this.lockInputPositionUpdating()||this.control.selection.inputPosition.reset(),this.lockUIUpdating()||this.control.barManager.updateItemsState()},Object.defineProperty(t.prototype,"permissionsProvider",{get:function(){return this.control&&this.control.permissionsProvider},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPermissionsRequired",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.lockUIUpdating=function(){return!1},t.prototype.lockInputPositionUpdating=function(){return!1},t}();e.CommandBase=n},7156:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CommandManager=e.DiagramCommand=void 0;var o,i=n(264),r=n(6679),s=n(3614),a=n(6596),c=n(4845),u=n(4378),h=n(7607),p=n(3411),l=n(7480),d=n(4077),f=n(6106),y=n(1649),g=n(3166),m=n(8700),v=n(2301),P=n(7306),C=n(2452),S=n(2153),x=n(375),b=n(4503),I=n(7550),w=n(7649),_=n(1813),T=n(3690),O=n(2276),M=n(1203),E=n(5827),D=n(2664),A=n(4200),R=n(1239),L=n(4624),N=n(3591),z=n(30),j=n(5925),U=n(4522),k=n(9538),B=n(125),H=n(7004),K=n(9427),V=n(9031),F=n(6049),W=n(4999),G=n(4419),Z=n(8016),q=n(72),X=n(6619),Y=n(7795),J=n(9970),Q=n(4281),$=n(437),tt=n(5830),et=n(9158),nt=n(962),ot=n(4643),it=n(4681),rt=n(2217),st=n(5010),at=n(554),ct=n(7826),ut=n(7717);!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",t[t.StrokeStyle=75]="StrokeStyle",t[t.StrokeWidth=76]="StrokeWidth",t[t.AutoLayoutTreeVerticalBottomToTop=77]="AutoLayoutTreeVerticalBottomToTop",t[t.AutoLayoutTreeHorizontalRightToLeft=78]="AutoLayoutTreeHorizontalRightToLeft",t[t.AutoLayoutLayeredVerticalBottomToTop=79]="AutoLayoutLayeredVerticalBottomToTop",t[t.AutoLayoutLayeredHorizontalRightToLeft=80]="AutoLayoutLayeredHorizontalRightToLeft",t[t.Zoom25=81]="Zoom25",t[t.Zoom50=82]="Zoom50",t[t.Zoom75=83]="Zoom75",t[t.Zoom100=84]="Zoom100",t[t.Zoom125=85]="Zoom125",t[t.Zoom150=86]="Zoom150",t[t.Zoom200=87]="Zoom200",t[t.AutoZoomToContent=88]="AutoZoomToContent",t[t.AutoZoomToWidth=89]="AutoZoomToWidth",t[t.ZoomLevelInPercentage=90]="ZoomLevelInPercentage",t[t.ConnectorRoutingMode=91]="ConnectorRoutingMode"}(o=e.DiagramCommand||(e.DiagramCommand={}));var ht=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,D.CutSelectionCommand,S.KeyCode.Key_x|S.ModifierKey.Ctrl,S.KeyCode.Key_x|S.ModifierKey.Meta,S.KeyCode.Delete|S.ModifierKey.Shift),this.createCommand(t,o.Copy,E.CopySelectionCommand,S.KeyCode.Key_c|S.ModifierKey.Ctrl,S.KeyCode.Key_c|S.ModifierKey.Meta,S.KeyCode.Insert|S.ModifierKey.Ctrl),this.createCommand(t,o.Paste,A.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,R.ImportBPMNCommand),this.createCommand(t,o.ImportXML,tt.ImportXMLCommand),this.createCommand(t,o.Export,c.ExportCommand),this.createCommand(t,o.ExportSvg,O.ExportSvgCommand),this.createCommand(t,o.ExportPng,T.ExportPngCommand),this.createCommand(t,o.ExportJpg,M.ExportJpgCommand),this.createCommand(t,o.BindDocument,k.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,h.ToggleFontItalicCommand,S.ModifierKey.Ctrl|S.KeyCode.Key_i,S.ModifierKey.Meta|S.KeyCode.Key_i),this.createCommand(t,o.Underline,p.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,g.ChangeStrokeColorCommand),this.createCommand(t,o.StrokeStyle,ot.ChangeStrokeStyleCommand),this.createCommand(t,o.StrokeWidth,it.ChangeStrokeWidthCommand),this.createCommand(t,o.TextLeftAlign,m.TextLeftAlignCommand),this.createCommand(t,o.TextCenterAlign,m.TextCenterAlignCommand),this.createCommand(t,o.TextRightAlign,m.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,L.SendToBackCommand),this.createCommand(t,o.MoveLeft,j.MoveLeftCommand,S.ModifierKey.Ctrl|S.KeyCode.Left,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Left),this.createCommand(t,o.MoveRight,j.MoveRightCommand,S.ModifierKey.Ctrl|S.KeyCode.Right,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Right),this.createCommand(t,o.MoveUp,j.MoveUpCommand,S.ModifierKey.Ctrl|S.KeyCode.Up,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Up),this.createCommand(t,o.MoveDown,j.MoveDownCommand,S.ModifierKey.Ctrl|S.KeyCode.Down,S.ModifierKey.Ctrl|S.ModifierKey.Shift|S.KeyCode.Down),this.createCommand(t,o.MoveStepLeft,j.MoveStepLeftCommand,S.KeyCode.Left,S.ModifierKey.Shift|S.KeyCode.Left),this.createCommand(t,o.MoveStepRight,j.MoveStepRightCommand,S.KeyCode.Right,S.ModifierKey.Shift|S.KeyCode.Right),this.createCommand(t,o.MoveStepUp,j.MoveStepUpCommand,S.KeyCode.Up,S.ModifierKey.Shift|S.KeyCode.Up),this.createCommand(t,o.MoveStepDown,j.MoveStepDownCommand,S.KeyCode.Down,S.ModifierKey.Shift|S.KeyCode.Down),this.createCommand(t,o.CloneLeft,W.CloneLeftCommand,S.ModifierKey.Alt|S.KeyCode.Left,S.ModifierKey.Alt|S.ModifierKey.Shift|S.KeyCode.Left),this.createCommand(t,o.CloneRight,W.CloneRightCommand,S.ModifierKey.Alt|S.KeyCode.Right,S.ModifierKey.Alt|S.ModifierKey.Shift|S.KeyCode.Right),this.createCommand(t,o.CloneUp,W.CloneUpCommand,S.ModifierKey.Alt|S.KeyCode.Up,S.ModifierKey.Alt|S.ModifierKey.Shift|S.KeyCode.Up),this.createCommand(t,o.CloneDown,W.CloneDownCommand,S.ModifierKey.Alt|S.KeyCode.Down,S.ModifierKey.Alt|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,x.AutoLayoutTreeVerticalCommand),this.createCommand(t,o.AutoLayoutFlow,z.AutoLayoutLayeredHorizontalCommand),this.createCommand(t,o.Units,G.ChangeUnitsCommand),this.createCommand(t,o.ViewUnits,G.ChangeViewUnitsCommand),this.createCommand(t,o.PageSize,_.ChangePageSizeCommand),this.createCommand(t,o.PageLandscape,w.ChangePageLandscapeCommand),this.createCommand(t,o.PageColor,Z.ChangePageColorCommand),this.createCommand(t,o.GridSize,I.ChangeGridSizeCommand),this.createCommand(t,o.ShowGrid,q.ChangeShowGridCommand),this.createCommand(t,o.SnapToGrid,b.ChangeSnapToGridCommand),this.createCommand(t,o.ZoomLevel,U.ChangeZoomLevelCommand),this.createCommand(t,o.ZoomLevelInPercentage,U.ChangeZoomLevelInPercentageCommand),this.createCommand(t,o.AutoLayoutTreeVertical,x.AutoLayoutTreeVerticalCommand),this.createCommand(t,o.AutoLayoutTreeVerticalBottomToTop,rt.AutoLayoutTreeVerticalBottomToTopCommand),this.createCommand(t,o.AutoLayoutTreeHorizontal,H.AutoLayoutTreeHorizontalCommand),this.createCommand(t,o.AutoLayoutTreeHorizontalRightToLeft,st.AutoLayoutTreeHorizontalRightToLeftCommand),this.createCommand(t,o.AutoLayoutLayeredVertical,K.AutoLayoutLayeredVerticalCommand),this.createCommand(t,o.AutoLayoutLayeredVerticalBottomToTop,at.AutoLayoutLayeredVerticalBottomToTopCommand),this.createCommand(t,o.AutoLayoutLayeredHorizontal,z.AutoLayoutLayeredHorizontalCommand),this.createCommand(t,o.AutoLayoutLayeredHorizontalRightToLeft,ct.AutoLayoutLayeredHorizontalRightToLeftCommand),this.createCommand(t,o.Fullscreen,X.ToggleFullscreenCommand,S.KeyCode.F11),this.createCommand(t,o.ToggleSimpleView,Y.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,U.FitToScreenCommand),this.createCommand(t,o.FitToWidth,U.FitToWidthCommand),this.createCommand(t,o.SwitchAutoZoom,U.SwitchAutoZoomCommand),this.createCommand(t,o.ToggleAutoZoom,U.ToggleAutoZoomCommand),this.createCommand(t,o.ZoomLevelItems,U.ChangeZoomLevelItemsCommand),this.createCommand(t,o.GridSizeItems,I.ChangeGridSizeItemsCommand),this.createCommand(t,o.PageSizeItems,_.ChangePageSizeItemsCommand),this.createCommand(t,o.Zoom25,U.ChangeZoomLevelTo25Command),this.createCommand(t,o.Zoom50,U.ChangeZoomLevelTo50Command),this.createCommand(t,o.Zoom75,U.ChangeZoomLevelTo75Command),this.createCommand(t,o.Zoom100,U.ChangeZoomLevelTo100Command),this.createCommand(t,o.Zoom125,U.ChangeZoomLevelTo125Command),this.createCommand(t,o.Zoom150,U.ChangeZoomLevelTo150Command),this.createCommand(t,o.Zoom200,U.ChangeZoomLevelTo200Command),this.createCommand(t,o.AutoZoomToContent,U.ToggleAutoZoomToContentCommand),this.createCommand(t,o.AutoZoomToWidth,U.ToggleAutoZoomToWidthCommand),this.createCommand(t,o.ConnectorRoutingMode,ut.ChangeConnectorRoutingModeCommand)}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.processShortcut=function(t){var e=this.shortcutsToCommand[t];return!!e&&e.execute()},t.prototype.processPaste=function(t){var e=this.getCommand(o.Paste);return e&&e.isEnabled()&&e.execute(t),!0},t.prototype.notifySelectionChanged=function(t){this.lastCommandsChain=[]},t.prototype.notifyScrollPositionChanged=function(){},t.prototype.createCommand=function(t,e,n){for(var o=[],i=3;i{Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleCommandState=void 0;var n=function(t,e,n,o,i){this.visible=!0,this.denyUpdateValue=!1,this.enabled=t,this.value=e,this.items=o,this.visible=i,this.defaultValue=n};e.SimpleCommandState=n},264:function(t,e,n){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])},o(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}),e.DeleteCommand=void 0;var r=n(4867),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.control.selection.getSelectedItems();return t.prototype.isEnabled.call(this)&&e.length&&(e.length>1||this.permissionsProvider.canDeleteItems(e))},e.prototype.executeCore=function(t){var e=this.control.selection.getSelectedItems(!0,!0);return this.permissionsProvider.beginDeleteItems(e),r.ModelUtils.deleteSelection(this.control.history,this.control.model,this.control.selection),this.permissionsProvider.endDeleteItems(),!0},Object.defineProperty(e.prototype,"isPermissionsRequired",{get:function(){return!0},enumerable:!1,configurable:!0}),e}(n(9741).SimpleCommandBase);e.DeleteCommand=s},3614:function(t,e,n){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])},o(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}),e.RedoCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t){return this.control.beginUpdateCanvas(),this.permissionsProvider.lockPermissions(),this.control.history.redo(),this.permissionsProvider.unlockPermissions(),this.control.endUpdateCanvas(),!0},e.prototype.isEnabled=function(){return t.prototype.isEnabled.call(this)&&this.control.history.canRedo()},e}(n(9741).SimpleCommandBase);e.RedoCommand=r},2452:function(t,e,n){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])},o(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}),e.SelectAllCommand=void 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.prototype.executeCore=function(t,e){var n=[];return this.control.model.iterateItems((function(t){return n.push(t.key)})),this.control.selection.set(n),!0},e}(n(9741).SimpleCommandBase);e.SelectAllCommand=r},6679:function(t,e,n){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])},o(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}),e.UndoCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t){return this.control.beginUpdateCanvas(),this.permissionsProvider.lockPermissions(),this.control.history.undo(),this.permissionsProvider.unlockPermissions(),this.control.endUpdateCanvas(),!0},e.prototype.isEnabled=function(){return t.prototype.isEnabled.call(this)&&this.control.history.canUndo()},e}(n(9741).SimpleCommandBase);e.UndoCommand=r},9538:function(t,e,n){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])},o(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}),e.BindDocumentCommand=void 0;var r=n(3503),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.executeCore=function(t,e){if(!e||!Array.isArray(e.nodeDataSource))throw Error("Format exception");return this.performImportData(e),this.control.updateLayout(!0),!0},e.prototype.performImportData=function(t){var e=this.control.createDocumentDataSource(t.nodeDataSource,t.edgeDataSource,t.dataParameters,t.nodeDataImporter,t.edgeDataImporter);this.control.beginUpdateCanvas(),this.permissionsProvider.lockPermissions();var n=new r.DataLayoutParameters(this.control.settings,t.layoutParameters);e.createModelItems(this.control.history,this.control.model,this.control.shapeDescriptionManager,this.control.selection,n,this.control.settings.snapToGrid,this.control.settings.gridSize,this.control.measurer),this.permissionsProvider.unlockPermissions(),this.control.endUpdateCanvas()},e}(n(9741).SimpleCommandBase);e.BindDocumentCommand=s},125:function(t,e,n){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])},o(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}),e.UnbindDocumentCommand=void 0;var r=n(4867),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.executeCore=function(t){return this.permissionsProvider.lockPermissions(),this.control.deleteDocumentDataSource(),r.ModelUtils.deleteAllItems(this.control.history,this.control.model,this.control.selection),this.control.history.clear(),this.permissionsProvider.unlockPermissions(),!0},e}(n(9741).SimpleCommandBase);e.UnbindDocumentCommand=s},4845:function(t,e,n){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])},o(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}),e.ExportCommand=void 0;var r=n(5885),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){return e((new r.Exporter).export(this.control.model)),!0},e}(n(1081).ExportImportCommandBase);e.ExportCommand=s},4012:function(t,e,n){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])},o(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}),e.ExportImageCommand=void 0;var r=n(8693),s=n(3872),a=n(1081),c=n(5885),u=n(1114),h=n(1733),p=n(6078),l=n(7176),d=function(t){function e(e){var n=t.call(this,e)||this;return n.exporter=new c.Exporter,n}return i(e,t),e.prototype.isEnabled=function(){return!l.ImageCache.instance.hasNonLoadedImages()},e.prototype.executeCore=function(t,e){var n=this;try{var o=this.getExportManager();this.getExportFunc()(this.control.model.size.clone(),this.control.model.pageColor,o,(function(t){e(t,n.getExtension()),n.tryDispose()}),this.control.settings.useCanvgForExportToImage)}catch(t){throw this.tryDispose(),t}return!0},e.prototype.getExportManager=function(){var t=this.getOrCreateMeasurer(),e=this.control.render&&this.control.render.items||this.createItemsManager(t);return this.exportManager||(this.exportManager=new s.CanvasExportManager(e.itemsContainer,t,this.control.instanceId))},e.prototype.createItemsManager=function(t){this.svgElement=u.RenderHelper.createSvgElement(document.body,!0);var e=new r.CanvasItemsManager(this.svgElement,1,new p.ExportDOMManipulator(t),this.control.instanceId);return this.control.modelManipulator.onModelChanged.add(e),this.control.modelManipulator.commitItemsCreateChanges(),e},e.prototype.tryDispose=function(){this.svgElement&&(document.body.removeChild(this.svgElement),delete this.svgElement),this.tempMeasurer&&(this.tempMeasurer.clean(),this.tempMeasurer=void 0),this.exportManager=void 0},e.prototype.getOrCreateMeasurer=function(){return this.control.measurer||(this.tempMeasurer=new h.TextMeasurer(document.body))},e}(a.ExportImportCommandBase);e.ExportImageCommand=d},1081:function(t,e,n){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])},o(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}),e.ExportImportCommandBase=void 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(9741).SimpleCommandBase);e.ExportImportCommandBase=r},1203:function(t,e,n){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])},o(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}),e.ExportJpgCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getExtension=function(){return"jpg"},e.prototype.getExportFunc=function(){return this.exporter.exportJpg},e}(n(4012).ExportImageCommand);e.ExportJpgCommand=r},3690:function(t,e,n){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])},o(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}),e.ExportPngCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getExtension=function(){return"png"},e.prototype.getExportFunc=function(){return this.exporter.exportPng},e}(n(4012).ExportImageCommand);e.ExportPngCommand=r},2276:function(t,e,n){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])},o(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}),e.ExportSvgCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getExtension=function(){return"svg"},e.prototype.getExportFunc=function(){return this.exporter.exportSvg},e}(n(4012).ExportImageCommand);e.ExportSvgCommand=r},1239:function(t,e,n){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])},o(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}),e.ImportBPMNCommand=void 0;var r=n(5941),s=n(4867),a=n(4145),c=n(8900),u=n(7959),h=n(9603),p=n(3477),l=n(1256),d=n(8710),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){var n=new r.BPMNImporter(e).import();return this.updateModel(n),!0},e.prototype.updateModel=function(t){var e=this,n={},o=[],i=[];this.control.history.beginTransaction(),t.items.forEach((function(t){var i=new a.AddShapeHistoryItem(e.getShapeDescription(t.type),new c.Point(0,0),t.text,t.key);e.control.history.addAndRedo(i),n[t.key]=i.shapeKey;var r=e.control.model.findShape(i.shapeKey);o.push(r)})),t.edges.forEach((function(t){var o=e.control.model.findShape(n[t.from]),r=e.control.model.findShape(n[t.to]),s=new h.AddConnectorHistoryItem([o.getConnectionPointPosition(0),r.getConnectionPointPosition(0)]);e.control.history.addAndRedo(s);var a=e.control.model.findConnector(s.connectorKey);e.control.history.addAndRedo(new p.AddConnectionHistoryItem(a,o,0,u.ConnectorPosition.Begin)),e.control.history.addAndRedo(new p.AddConnectionHistoryItem(a,r,0,u.ConnectorPosition.End)),i.push(a)}));var r=new d.LayoutSettings;s.ModelUtils.getGraphInfoByItems(this.control.model,o,i).forEach((function(t){var n=new l.SugiyamaLayoutBuilder(r,t.graph).build(),a=s.ModelUtils.getNonGraphItems(e.control.model,t.container,n.nodeToLayout,o,i);s.ModelUtils.applyLayout(e.control.history,e.control.model,void 0,t.graph,n,a,r,e.control.settings.snapToGrid,e.control.settings.gridSize,!1)})),s.ModelUtils.tryUpdateModelRectangle(this.control.history),this.control.history.endTransaction()},e.prototype.getShapeDescription=function(t){return this.control.shapeDescriptionManager.get(t)},e}(n(1081).ExportImportCommandBase);e.ImportBPMNCommand=f},6596:function(t,e,n){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])},o(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}),e.ImportCommand=void 0;var r=n(2406),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){this.permissionsProvider.lockPermissions();var n=e.data?e.data:e,o=new r.Importer(this.control.shapeDescriptionManager,n);if(!0===e.keepExistingItems)o.importItemsData(this.control.model),this.control.importItemsData();else{var i=o.import();this.control.importModel(i)}return this.permissionsProvider.unlockPermissions(),!0},e}(n(1081).ExportImportCommandBase);e.ImportCommand=s},5830:function(t,e,n){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])},o(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}),e.ImportXMLCommand=void 0;var r=n(780),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){var n=new r.XmlImporter(this.control.shapeDescriptionManager,e).import();return this.control.importModel(n),!0},e}(n(1081).ExportImportCommandBase);e.ImportXMLCommand=s},4999:function(t,e,n){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])},o(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}),e.CloneDownCommand=e.CloneUpCommand=e.CloneRightCommand=e.CloneLeftCommand=e.CloneCommand=void 0;var r=n(4867),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.control.selection.getSelectedItems();return t.prototype.isEnabled.call(this)&&e.length&&e.length>0&&this.permissionsProvider.canAddItems(e)},e.prototype.executeCore=function(t,e){var n=r.ModelUtils.createRectangle(this.control.selection.getSelectedItems());return r.ModelUtils.cloneSelectionToOffset(this.control.history,this.control.model,void 0,this.control.selection,this.getOffsetX(n),this.getOffsetY(n)),!0},Object.defineProperty(e.prototype,"isPermissionsRequired",{get:function(){return!0},enumerable:!1,configurable:!0}),e.prototype.getOffsetX=function(t){return 0},e.prototype.getOffsetY=function(t){return 0},e}(n(9741).SimpleCommandBase);e.CloneCommand=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetX=function(t){return-t.width},e}(s);e.CloneLeftCommand=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetX=function(t){return t.width},e}(s);e.CloneRightCommand=c;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetY=function(t){return-t.height},e}(s);e.CloneUpCommand=u;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getOffsetY=function(t){return t.height},e}(s);e.CloneDownCommand=h},5925:function(t,e,n){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])},o(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}),e.MoveStepDownCommand=e.MoveDownCommand=e.MoveStepUpCommand=e.MoveUpCommand=e.MoveStepRightCommand=e.MoveRightCommand=e.MoveStepLeftCommand=e.MoveLeftCommand=e.MoveCommand=void 0;var r=n(8900),s=n(4867),a=n(9291),c=n(9741),u=n(4742),h=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,e){var n=this;this.control.history.beginTransaction();var o=this.control.selection,i=new u.SelectionDragHelper(this.control.history,this.control.model,this.permissionsProvider,new r.Point(0,0),o.getSelectedItems(!0));return i.initDraggingShapes(o.getSelectedShapes(!1,!0),!1),i.initDraggingConnectors(o.getSelectedConnectors(!1,!0),!1),i.move(!1,(function(t){return n.getPosition(t)}),(function(){}),(function(){})),i.finish(),s.ModelUtils.tryUpdateModelRectangle(this.control.history,(function(t,e){return i.onTryUpdateModelSize(t,e)})),this.control.history.endTransaction(),!0},Object.defineProperty(e.prototype,"isPermissionsRequired",{get:function(){return!0},enumerable:!1,configurable:!0}),e}(c.SimpleCommandBase);e.MoveCommand=h;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.clone().offset(-a.UnitConverter.pixelsToTwips(1),0)},e}(h);e.MoveLeftCommand=p;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.settings.snapToGrid?new r.Point(s.ModelUtils.getSnappedPos(this.control.model,this.control.settings.gridSize,t.x-(this.control.settings.gridSize/2+2),!0),t.y):t.clone().offset(-this.control.settings.gridSize,0)},e}(h);e.MoveStepLeftCommand=l;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.clone().offset(a.UnitConverter.pixelsToTwips(1),0)},e}(h);e.MoveRightCommand=d;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.settings.snapToGrid?new r.Point(s.ModelUtils.getSnappedPos(this.control.model,this.control.settings.gridSize,t.x+(this.control.settings.gridSize/2+2),!0),t.y):t.clone().offset(this.control.settings.gridSize,0)},e}(h);e.MoveStepRightCommand=f;var y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.clone().offset(0,-a.UnitConverter.pixelsToTwips(1))},e}(h);e.MoveUpCommand=y;var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.settings.snapToGrid?new r.Point(t.x,s.ModelUtils.getSnappedPos(this.control.model,this.control.settings.gridSize,t.y-(this.control.settings.gridSize/2+2),!1)):t.clone().offset(0,-this.control.settings.gridSize)},e}(h);e.MoveStepUpCommand=g;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return t.clone().offset(0,a.UnitConverter.pixelsToTwips(1))},e}(h);e.MoveDownCommand=m;var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getPosition=function(t){return this.control.settings.snapToGrid?new r.Point(t.x,s.ModelUtils.getSnappedPos(this.control.model,this.control.settings.gridSize,t.y+(this.control.settings.gridSize/2+2),!1)):t.clone().offset(0,this.control.settings.gridSize)},e}(h);e.MoveStepDownCommand=v},7550:function(t,e,n){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])},o(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}),e.ChangeGridSizeItemsCommand=e.ChangeGridSizeCommand=void 0;var r=n(9741),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.getModelUnit(this.control.settings.gridSize)},e.prototype.executeCore=function(t,e){return this.control.settings.gridSize=this.getModelUnitTwipsValue(e),!0},e.prototype.getItems=function(){var t=this;return this.control.settings.gridSizeItems.map((function(e){return{value:t.getModelUnit(e),text:t.getViewUnitText(e)}}))},e}(r.SimpleCommandBase);e.ChangeGridSizeCommand=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){var t=this;return this.control.settings.gridSizeItems.map((function(e){return t.getModelUnit(e)}))},e.prototype.executeCore=function(t,e){var n=this;return this.control.settings.gridSizeItems=e.map((function(t){return n.getModelUnitTwipsValue(t)})),!0},e}(r.SimpleCommandBase);e.ChangeGridSizeItemsCommand=a},8016:function(t,e,n){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])},o(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}),e.ChangePageColorCommand=void 0;var r=n(3499),s=n(7195),a=n(6613),c=n(13),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return c.ColorUtils.colorToHash(this.control.model.pageColor)},e.prototype.getDefaultValue=function(){return c.ColorUtils.colorToHash(a.DiagramModel.defaultPageColor)},e.prototype.createHistoryItems=function(t){return[new s.ChangePageColorHistoryItem(c.ColorUtils.fromString(t))]},e}(r.ChangePagePropertyCommand);e.ChangePageColorCommand=u},7649:function(t,e,n){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])},o(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}),e.ChangePageLandscapeCommand=void 0;var r=n(3499),s=n(1380),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return this.control.model.pageLandscape},e.prototype.createHistoryItems=function(t){return[new s.ChangePageLandscapeHistoryItem(t)]},e}(r.ChangePagePropertyCommand);e.ChangePageLandscapeCommand=a},3499:function(t,e,n){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])},o(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}),e.ChangePagePropertyCommand=void 0;var r=n(4867),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){var n=this;return this.control.history.beginTransaction(),this.createHistoryItems(e).forEach((function(t){n.control.history.addAndRedo(t)})),r.ModelUtils.tryUpdateModelRectangle(this.control.history),this.control.history.endTransaction(),!0},e.prototype.getItems=function(){return null},e}(n(9741).SimpleCommandBase);e.ChangePagePropertyCommand=s},1813:function(t,e,n){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])},o(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}),e.ChangePageSizeItemsCommand=e.ChangePageSizeCommand=void 0;var r=n(3499),s=n(6353),a=n(1044),c=n(9741),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return this.getModelUnitSize(this.control.model.pageSize)},e.prototype.createHistoryItems=function(t){return[new a.ChangePageSizeHistoryItem(new s.Size(this.getModelUnitTwipsValue(t.width),this.getModelUnitTwipsValue(t.height)))]},e.prototype.getItems=function(){var t=this;return this.control.settings.pageSizeItems.map((function(e){return{value:t.getModelUnitSize(e.size),text:e.text.replace("{width}",t.getViewUnitText(e.size.width)).replace("{height}",t.getViewUnitText(e.size.height))}}))},e.prototype.getModelUnitSize=function(t){return new s.Size(this.getModelUnit(t.width),this.getModelUnit(t.height))},e}(r.ChangePagePropertyCommand);e.ChangePageSizeCommand=u;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){return!0},e.prototype.getValue=function(){var t=this;return this.control.settings.pageSizeItems.map((function(e){return{size:new s.Size(t.getModelUnit(e.width),t.getModelUnit(e.height)),text:e.text}}))},e.prototype.executeCore=function(t,e){var n=this;return this.control.settings.pageSizeItems=e.map((function(t){return{size:new s.Size(n.getModelUnitTwipsValue(t.width),n.getModelUnitTwipsValue(t.height)),text:t.text}})),!0},e}(c.SimpleCommandBase);e.ChangePageSizeItemsCommand=h},72:function(t,e,n){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])},o(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}),e.ChangeShowGridCommand=void 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.prototype.executeCore=function(t,e){var n=void 0===e?!this.control.settings.showGrid:!!e;return this.control.settings.showGrid!==n&&(this.control.settings.showGrid=n,!0)},e.prototype.getValue=function(){return this.control.settings.showGrid},e}(n(9741).SimpleCommandBase);e.ChangeShowGridCommand=r},4503:function(t,e,n){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])},o(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}),e.ChangeSnapToGridCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(t,e){var n=void 0===e?!this.control.settings.snapToGrid:!!e;return this.control.settings.snapToGrid!==n&&(this.control.settings.snapToGrid=n,!0)},e.prototype.getValue=function(){return this.control.settings.snapToGrid},e}(n(9741).SimpleCommandBase);e.ChangeSnapToGridCommand=r},4419:function(t,e,n){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])},o(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}),e.ChangeViewUnitsCommand=e.ChangeUnitsCommand=void 0;var r=n(3499),s=n(7479),a=n(9741),c=n(6224),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.control.model.units},e.prototype.createHistoryItems=function(t){return[new s.ChangeUnitsHistoryItem(t)]},e.prototype.getItems=function(){return Object.keys(c.DiagramLocalizationService.unitItems).map((function(t){return{value:parseInt(t),text:c.DiagramLocalizationService.unitItems[t]}}))},e}(r.ChangePagePropertyCommand);e.ChangeUnitsCommand=u;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.control.settings.viewUnits},e.prototype.executeCore=function(t,e){return this.control.settings.viewUnits=e,!0},e.prototype.getItems=function(){return Object.keys(c.DiagramLocalizationService.unitItems).map((function(t){return{value:parseInt(t),text:c.DiagramLocalizationService.unitItems[t]}}))},e}(a.SimpleCommandBase);e.ChangeViewUnitsCommand=h},4522:function(t,e,n){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])},o(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}),e.ToggleAutoZoomCommand=e.ToggleAutoZoomToWidthCommand=e.ToggleAutoZoomToContentCommand=e.SwitchAutoZoomCommand=e.FitToWidthCommand=e.FitToScreenCommand=e.ChangeZoomLevelItemsCommand=e.ChangeZoomLevelTo200Command=e.ChangeZoomLevelTo150Command=e.ChangeZoomLevelTo125Command=e.ChangeZoomLevelTo100Command=e.ChangeZoomLevelTo75Command=e.ChangeZoomLevelTo50Command=e.ChangeZoomLevelTo25Command=e.ChangeZoomLevelInPercentageCommand=e.ChangeZoomLevelCommand=void 0;var r=n(9741),s=n(240),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.control.view.getZoom()},e.prototype.executeCore=function(t,e){return this.control.settings.zoomLevel=e,this.control.settings.autoZoom=s.AutoZoomMode.Disabled,this.control.updateLayout(!0),!0},e.prototype.getItems=function(){return this.control.settings.zoomLevelItems.map((function(t){return{value:t,text:100*t+"%"}}))},e}(r.SimpleCommandBase);e.ChangeZoomLevelCommand=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.executeCore=function(e,n){return t.prototype.executeCore.call(this,e,n/100)},e.prototype.getValue=function(){return 100*this.control.view.getZoom()},e}(a);e.ChangeZoomLevelInPercentageCommand=c;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return this.control.view.getZoom()===this.exactValue},e.prototype.executeCore=function(e,n){return t.prototype.executeCore.call(this,e,this.exactValue),!0},e.prototype.getItems=function(){},e}(a),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=.25,e}return i(e,t),e}(u);e.ChangeZoomLevelTo25Command=h;var p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=.5,e}return i(e,t),e}(u);e.ChangeZoomLevelTo50Command=p;var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=.75,e}return i(e,t),e}(u);e.ChangeZoomLevelTo75Command=l;var d=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=1,e}return i(e,t),e}(u);e.ChangeZoomLevelTo100Command=d;var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=1.25,e}return i(e,t),e}(u);e.ChangeZoomLevelTo125Command=f;var y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=1.5,e}return i(e,t),e}(u);e.ChangeZoomLevelTo150Command=y;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.exactValue=2,e}return i(e,t),e}(u);e.ChangeZoomLevelTo200Command=g;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.control.settings.zoomLevelItems},e.prototype.executeCore=function(t,e){return this.control.settings.zoomLevelItems=e,!0},e}(r.SimpleCommandBase);e.ChangeZoomLevelItemsCommand=m;var v=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.render},e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.executeCore=function(t){var e=this.getZoomLevel();return this.control.settings.zoomLevel=e,this.control.settings.autoZoom=s.AutoZoomMode.Disabled,this.control.updateLayout(!0),!0},e}(r.SimpleCommandBase),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getZoomLevel=function(){return this.control.render.view.getActualAutoZoomLevel(s.AutoZoomMode.FitContent)},e}(v);e.FitToScreenCommand=P;var C=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getZoomLevel=function(){return this.control.render.view.getActualAutoZoomLevel(s.AutoZoomMode.FitToWidth)},e}(v);e.FitToWidthCommand=C;var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.control.settings.autoZoom},e.prototype.executeCore=function(t,e){return e=parseInt(e),this.control.settings.autoZoom!==e&&(e===s.AutoZoomMode.Disabled&&(this.control.settings.zoomLevel=this.control.view.getZoom()),this.control.settings.autoZoom=e,this.control.updateLayout(!0),!0)},e}(r.SimpleCommandBase);e.SwitchAutoZoomCommand=S;var x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return this.control.settings.autoZoom===s.AutoZoomMode.FitContent},e.prototype.executeCore=function(e,n){return t.prototype.executeCore.call(this,e,s.AutoZoomMode.FitContent)},e}(S);e.ToggleAutoZoomToContentCommand=x;var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return this.control.settings.autoZoom===s.AutoZoomMode.FitToWidth},e.prototype.executeCore=function(e,n){return t.prototype.executeCore.call(this,e,s.AutoZoomMode.FitToWidth)},e}(S);e.ToggleAutoZoomToWidthCommand=b;var I=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.render},e.prototype.isEnabledInReadOnlyMode=function(){return!0},e.prototype.getValue=function(){return this.control.settings.autoZoom},e.prototype.executeCore=function(t,e){var n;return n=void 0===e?this.control.settings.autoZoom===s.AutoZoomMode.Disabled?s.AutoZoomMode.FitContent:s.AutoZoomMode.Disabled:e?s.AutoZoomMode.FitContent:s.AutoZoomMode.Disabled,this.control.settings.autoZoom!==n&&(n||(this.control.settings.zoomLevel=this.control.view.getZoom()),this.control.settings.autoZoom=n,this.control.updateLayout(!0),!0)},e}(r.SimpleCommandBase);e.ToggleAutoZoomCommand=I},6619:function(t,e,n){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])},o(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}),e.ToggleFullscreenCommand=void 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.prototype.getValue=function(){return this.control.settings.fullscreen},e.prototype.executeCore=function(t,e){var n="boolean"==typeof e?e:!t.value;return this.control.settings.fullscreen!==n&&(this.control.settings.fullscreen=!t.value,this.control.notifyToggleFullscreen(this.control.settings.fullscreen)),!0},e}(n(9741).SimpleCommandBase);e.ToggleFullscreenCommand=r},9970:function(t,e,n){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])},o(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}),e.ToggleReadOnlyCommand=void 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.prototype.getValue=function(){return this.control.settings.readOnly},e.prototype.executeCore=function(t,e){return"boolean"==typeof e?this.control.settings.readOnly=e:void 0===e&&(this.control.settings.readOnly=!t.value),!0},e}(n(9741).SimpleCommandBase);e.ToggleReadOnlyCommand=r},7795:function(t,e,n){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])},o(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}),e.ToggleSimpleViewCommand=void 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.prototype.getValue=function(){return this.control.settings.simpleView},e.prototype.executeCore=function(t,e){return"boolean"==typeof e?this.control.settings.simpleView=e:void 0===e&&(this.control.settings.simpleView=!t.value),this.control.updateLayout(!0),!0},e}(n(9741).SimpleCommandBase);e.ToggleSimpleViewCommand=r},3591:function(t,e,n){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])},o(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}),e.BringToFrontCommand=void 0;var r=n(5982),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.control.selection.getSelectedItems();return t.prototype.isEnabled.call(this)&&e.length>0&&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;i0},e}(n(9741).SimpleCommandBase);e.ChangeConnectorPropertyCommand=s},7717:function(t,e,n){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])},o(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}),e.ChangeConnectorRoutingModeCommand=void 0;var r=n(9741),s=n(240),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getValue=function(){return this.control.settings.connectorRoutingMode},e.prototype.executeCore=function(t,e){var n=void 0!==e?e:s.ConnectorRoutingMode.None;return this.control.settings.connectorRoutingMode=n,!0},e}(r.SimpleCommandBase);e.ChangeConnectorRoutingModeCommand=a},1307:function(t,e,n){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])},o(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}),e.ChangeLockedCommand=void 0;var r=n(4867),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this,n=this.control.selection.getSelectedItems(!0),o=!1;return n.forEach((function(t){t.locked!==e.getLockState()&&(o=!0)})),t.prototype.isEnabled.call(this)&&o},e.prototype.executeCore=function(t,e){return r.ModelUtils.changeSelectionLocked(this.control.history,this.control.model,this.control.selection,this.getLockState()),!0},e}(n(9741).SimpleCommandBase);e.ChangeLockedCommand=s},9031:function(t,e,n){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])},o(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}),e.LockCommand=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.getLockState=function(){return!0},e}(n(1307).ChangeLockedCommand);e.LockCommand=r},4624:function(t,e,n){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])},o(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}),e.SendToBackCommand=void 0;var r=n(5982),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.isEnabled=function(){var e=this.control.selection.getSelectedItems();return t.prototype.isEnabled.call(this)&&e.length>0&&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(i{Object.defineProperty(e,"__esModule",{value:!0}),e.DataLayoutParameters=e.DataLayoutType=void 0;var o,i=n(8710),r=n(9533),s=n(1256);!function(t){t[t.Tree=0]="Tree",t[t.Sugiyama=1]="Sugiyama"}(o=e.DataLayoutType||(e.DataLayoutType={}));var a=function(){function t(t,e){this.sizeSettings=t,e&&(void 0!==e.type&&(this.layoutType=e.type,this.layoutSettings=this.layoutType===o.Sugiyama?new i.LayoutSettings:new i.TreeLayoutSettings),void 0!==e.orientation&&(this.layoutSettings.orientation=e.orientation),this.skipPointIndices=e.skipPointIndices,this.autoSizeEnabled=e.autoSizeEnabled)}return Object.defineProperty(t.prototype,"needAutoLayout",{get:function(){return void 0!==this.layoutType},enumerable:!1,configurable:!0}),t.prototype.getLayoutBuilder=function(t){return this.layoutType===o.Tree?new r.TreeLayoutBuilder(this.layoutSettings,t):new s.SugiyamaLayoutBuilder(this.layoutSettings,t)},t}();e.DataLayoutParameters=a},4225:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataSource=void 0;var o=n(9291),i=n(8900),r=n(6353),s=n(3477),a=n(9603),c=n(4145),u=n(8930),h=n(4629),p=n(8236),l=n(5144),d=n(9559),f=n(7443),y=n(8210),g=n(6516),m=n(5982),v=n(4634),P=n(926),C=n(7959),S=n(4867),x=n(2259),b=n(4246),I=n(8675),w=n(13),_=n(4914),T=n(8396),O=n(3490),M=n(5035),E=n(5558),D=n(58),A=function(){function t(t,e,n,o,i,r){if(this.key=t,this.nodes=[],this.edges=[],this.autoGeneratedDataKeys={},this.addInternalKeyOnInsert=!1,this.useNodeParentId=!1,this.useNodeContainerId=!1,this.useNodeChildren=!1,this.useNodeItems=!1,this.canUseAutoSize=!1,this.canUpdateEdgeDataSource=!1,this.containers=null,null==t)throw new Error("DataSource key must be specified");this.key=t.toString(),this.loadParameters(o||{}),this.nodeDataImporter=this.createNodeDataImporter(i),this.edgeDataImporter=this.createEdgeDataImporter(r),this.nodeDataSource=e||[],this.edgeDataSource=n||[],this.canUpdateEdgeDataSource=!!n,this.fetchData()}return t.prototype.loadParameters=function(t){this.addInternalKeyOnInsert=!!t.addInternalKeyOnInsert},t.prototype.isAutoGeneratedKey=function(t){return t&&!!this.autoGeneratedDataKeys[t]},t.prototype.createNodeDataImporter=function(t){var e=new M.DataSourceNodeDataImporter;return t&&this.assignNodeDataImporterProperties(t,e),e},t.prototype.createEdgeDataImporter=function(t){var e=new M.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.getCustomData&&(e.getCustomData=t.getCustomData),t.setCustomData&&(e.setCustomData=t.setCustomData),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.nodes=[],this.edges=[],this.autoGeneratedDataKeys={},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.canUseAutoSize=void 0===this.nodeDataImporter.getWidth&&void 0!==this.nodeDataImporter.getText,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.refetchData=function(t,e){var n=this;this.nodeDataSource=t||this.nodeDataSource,this.edgeDataSource=e||this.edgeDataSource;var o=this.nodes.slice(),i=this.edges.slice();return this.fetchData(),{nodes:this.getItemChanges(o,this.nodes,(function(t,e){return t.key===e.key||t.dataObj===e.dataObj})),edges:this.getItemChanges(i,this.edges,(function(t,e){return n.useNodeParentId||n.useNodeItems?t.key===e.key||t.from===e.from&&t.to===e.to:t.key===e.key||t.dataObj===e.dataObj}))}},t.prototype.getItemChanges=function(t,e,n){var o=this,i=t.filter((function(t){return o.containsItem(e,t,n)})),r=t.filter((function(t){return!o.containsItem(e,t,n)})),s=e.filter((function(e){return!o.containsItem(t,e,n)}));return{remained:i.map((function(t){return t.key})),remainedNewKeys:i.map((function(t){var o;return null===(o=e.find((function(e){return n(t,e)})))||void 0===o?void 0:o.key})),removed:r.map((function(t){return t.key})),added:s.map((function(t){return t.key}))}},t.prototype.containsItem=function(t,e,n){var o=!1;return t.forEach((function(t){!o&&n(t,e)&&(o=!0)})),o},t.prototype.useEdgesArray=function(){return Array.isArray(this.edgeDataSource)&&(this.edgeDataSource.length||!(this.useNodeParentId||this.useNodeItems))},t.prototype.addNode=function(t,e,n,o){var i=this,r=this.nodeDataImporter.getChildren&&this.nodeDataImporter.getChildren(t),s=r&&Array.isArray(r)&&r.length,a=s||this.isContainer(this.nodeDataImporter.getKey(t)),c=this.nodeDataImporter.getType&&this.nodeDataImporter.getType(t)||a&&x.ShapeTypes.VerticalContainer||x.ShapeTypes.Rectangle,u=this.nodeDataImporter.getText&&(this.nodeDataImporter.getText(t)||""),h=this.addNodeInternal(t,c,u,e,n,o);if(this.assignNodeProperties(h,t),s&&r.forEach((function(e){i.addNode(e,void 0,h.key,t)})),this.useNodeItems){var p=this.nodeDataImporter.getItems(t);Array.isArray(p)&&p.length&&p.forEach((function(e){var r=i.addNode(e,t,n,o);i.addEdgeInternal(void 0,h.key,r.key)}))}return h},t.prototype.addNodeEdgesByParentId=function(t){if(this.useNodeParentId){var e=this.nodeDataImporter.getParentKey(t.dataObj);if(null!=e)this.findNode(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,i,r){var s=this.nodeDataImporter.getKey(t),a=null!=s?s:S.ModelUtils.getGuidItemKey(),c=new E.DataSourceNodeItem(this.key,a,t,e,n,o,i,r);return this.nodes.push(c),null==s&&(s=a,this.autoGeneratedDataKeys[a]=!0),c},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),i=null!=o?o:S.ModelUtils.getGuidItemKey(),r=new E.DataSourceEdgeItem(this.key,i,t,e,n);return this.edges.push(r),null==o&&(o=i,this.autoGeneratedDataKeys[i]=!0),r},t.prototype.assignItemProperties=function(t,e,n){if(n.getCustomData&&(t.customData=I.ObjectUtils.cloneObject(n.getCustomData(e))),n.getLocked&&(t.locked=n.getLocked(e)),n.getStyle){var o=n.getStyle(e);t.style="string"==typeof o?_.Data.cssTextToObject(o):o}if(n.getStyleText){o=n.getStyleText(e);t.styleText="string"==typeof o?_.Data.cssTextToObject(o):o}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){if(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){var n=this.edgeDataImporter.getText(e);if(t.texts={},"object"==typeof n){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var i=parseFloat(o),r=n[o];isNaN(i)||"string"!=typeof r||""===r||(i=Math.min(1,Math.max(0,i)),t.texts[i]=r)}}else"string"==typeof n&&""!==n&&(t.texts[C.CONNECTOR_DEFAULT_TEXT_POSITION]=n)}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 e(t)},t.prototype.createModelItems=function(t,e,n,o,r,s,a,c){var u=this;this.beginChangesNotification(),t.clear(),t.beginTransaction(),S.ModelUtils.deleteAllItems(t,e,o),e.initializeKeyCounter();var h=s?Math.max(1,Math.floor(2e3/a))*a:2e3,p=0,l=0,d={},f=[],y=[];this.nodes.forEach((function(y){var g=new i.Point(l++*h,p*h),m=u.createShapeByNode(t,e,o,n,y,g,r,s,a,c);void 0!==y.key&&(d[y.key]=m.key),l>4&&(l=0,p++),f.push(m)})),this.nodes.forEach((function(n){if(void 0!==n.containerKey&&null!==n.containerKey){var o=d[n.key],i=e.findShape(o),r=d[n.containerKey],s=e.findShape(r);s&&S.ModelUtils.insertToContainer(t,e,i,s)}})),this.edges.forEach((function(n){var i=e.findShape(d[n.to]),r=e.findShape(d[n.from]),s=u.createConnectorByEdge(t,e,o,n,r,i);s&&(y.push(s),S.ModelUtils.updateConnectorContainer(t,e,s))})),r.needAutoLayout&&this.applyLayout(t,e,f,y,r,s,a),S.ModelUtils.tryUpdateModelRectangle(t),t.endTransaction(!0),this.endChangesNotification(!0)},t.prototype.updateModelItems=function(t,e,n,o,r,s,a,c,u,h,p,l){var d=this;this.beginChangesNotification(),t.beginTransaction();var f=[],y=[],g=[],m=u.nodes.removed.map((function(t){return e.findShapeByDataKey(t)})).filter((function(t){return t}));m.forEach((function(t){t.attachedConnectors.forEach((function(e){e.beginItem&&e.beginItem!==t&&y.push(e.beginItem),e.endItem&&e.endItem!==t&&y.push(e.endItem)}))})),S.ModelUtils.deleteItems(t,e,o,m,!0);var v=u.edges.removed.map((function(t){return e.findConnectorByDataKey(t)})).filter((function(t){return t}));v.forEach((function(t){t.beginItem&&y.push(t.beginItem),t.endItem&&y.push(t.endItem)})),S.ModelUtils.deleteItems(t,e,o,v,!0),y=this.purgeLayoutShapes(y,m),(a||[]).forEach((function(s){if(-1!==u.nodes.remained.indexOf(s)){var a=d.findNode(s);if(a){var c=e.findShapeByDataKey(s);if(c){var g=c.position.clone();d.changeShapeByDataItem(t,e,c,a,g),d.changeItemByDataItem(t,c,a)}else c=d.createShapeByNode(t,e,o,n,a,new i.Point(0,0),r,h,p,l);d.updateShapeContainer(t,e,c,a),y.push(c),f.push(c)}}})),u.nodes.remained.forEach((function(t,n){var o=e.findShapeByDataKey(t);o&&(o.dataKey=u.nodes.remainedNewKeys[n])})),u.nodes.added.forEach((function(s){var a=d.findNode(s),c=d.createShapeByNode(t,e,o,n,a,new i.Point(0,0),r,h,p,l);d.updateShapeContainer(t,e,c,a),y.push(c)})),u.edges.added.forEach((function(n){var i=d.findEdge(n),r=e.findShapeByDataKey(i.from),s=e.findShapeByDataKey(i.to),a=d.createConnectorByEdge(t,e,o,i,r,s);a&&(S.ModelUtils.updateConnectorContainer(t,e,a),g.push(a))}));var P=a||[];u.edges.remained.forEach((function(t){var e=d.findEdge(t);!e||-1===u.nodes.added.indexOf(e.from)&&-1===u.nodes.added.indexOf(e.to)||P.push(t)})),P.forEach((function(n){if(-1!==u.edges.remained.indexOf(n)){var i=d.findEdge(n);if(i){var r=e.findShapeByDataKey(i.from),s=e.findShapeByDataKey(i.to),a=e.findConnectorByDataKey(n);a?(d.changeConnectorPointsByDataItem(t,a,d.getConnectorPointsByEdge(e,i,r,s,!1)),d.changeConnectorByDataItem(t,e,a,r,s,i),d.changeItemByDataItem(t,a,i)):a=d.createConnectorByEdge(t,e,o,i,r,s),a&&(S.ModelUtils.updateConnectorContainer(t,e,a),g.push(a),f.push(a))}}})),u.edges.remained.forEach((function(t,n){var o=e.findConnectorByDataKey(t);o&&(o.dataKey=u.edges.remainedNewKeys[n])})),f.length&&c&&f.forEach((function(t){t.hasTemplate&&c(t)})),r.needAutoLayout&&(y.length||g.length)&&this.applyLayout(t,e,y,g,r,h,p),S.ModelUtils.tryUpdateModelRectangle(t),t.endTransaction(!s),this.endChangesNotification(!1)},t.prototype.purgeLayoutShapes=function(t,e){var n=e.reduce((function(t,e){return(t[e.key]=!0)&&t}),{});return t.reduce((function(t,e){return void 0===t.keySet[e.key]&&void 0===n[e.key]&&(t.uniqueShapes.push(e),t.keySet[e.key]=!0),t}),{uniqueShapes:[],keySet:{}}).uniqueShapes},t.prototype.applyShapeAutoSize=function(t,e,n,i,s,a){if(i.description.enableText){var c=i.textRectangle.createSize(),u=i.size,p=c.width-u.width,l=c.height-u.height,d=i.getMaxWidth(n.shapeMaxWidth),f=i.getMaxHeight(n.shapeMaxHeight),y=function(t,e){return"number"==typeof t?o.UnitConverter.twipsToPixelsF(t+(e?p:l)):void 0},g=O.getOptimalTextRectangle(i.text,i.styleText,b.TextOwner.Shape,e,c.clone().applyConverter(o.UnitConverter.twipsToPixelsF),i.description.keepRatioOnAutoSize,y(i.getMinWidth(n.shapeMinWidth),!0),y(d,!0),y(i.getMinHeight(n.shapeMinHeight),!1),y(f,!1)).clone().applyConverter(o.UnitConverter.pixelsToTwips);if(!g.equals(c)){var m=i.description.getSizeByText(g,i);s&&a&&(m=new r.Size(Math.min(a*Math.ceil(m.width/a),d||Number.MAX_VALUE),Math.min(a*Math.ceil(m.height/a),f||Number.MAX_VALUE))),t.addAndRedo(new h.ResizeShapeHistoryItem(i.key,i.position,m))}}},t.prototype.applyLayout=function(t,e,n,o,i,r,s){S.ModelUtils.getGraphInfoByItems(e,n,o).forEach((function(a){var c=i.getLayoutBuilder(a.graph).build(),u=S.ModelUtils.getNonGraphItems(e,a.container,c.nodeToLayout,n,o);S.ModelUtils.applyLayout(t,e,a.container,a.graph,c,u,i.layoutSettings,r,s,i.skipPointIndices)}))},t.prototype.changeItemByDataItem=function(t,e,n){if(void 0===n.customData||I.ObjectUtils.compareObjects(n.customData,e.customData)||t.addAndRedo(new d.ChangeCustomDataHistoryItem(e.key,n.customData)),void 0!==n.zIndex&&n.zIndex!==e.zIndex&&t.addAndRedo(new m.ChangeZindexHistoryItem(e,n.zIndex)),void 0!==n.style)for(var o in n.style){if(Object.prototype.hasOwnProperty.call(n.style,o))(r=this.getPreparedStyleValue(n.style[o],T.isColorProperty(o)))!==e.style[o]&&t.addAndRedo(new v.ChangeStyleHistoryItem(e.key,o,r))}var i=e.style.getDefaultInstance();if(e.style.forEach((function(o){n.style&&void 0===n.style[o]&&e.style[o]!==i[o]&&t.addAndRedo(new v.ChangeStyleHistoryItem(e.key,o,i[o]))})),void 0!==n.styleText)for(var o in n.styleText){var r;if(Object.prototype.hasOwnProperty.call(n.styleText,o))(r=this.getPreparedStyleValue(n.styleText[o],T.isColorProperty(o)))!==e.styleText[o]&&t.addAndRedo(new P.ChangeStyleTextHistoryItem(e.key,o,r))}var s=e.styleText.getDefaultInstance();e.styleText.forEach((function(o){n.styleText&&void 0===n.styleText[o]&&e.styleText[o]!==s[o]&&t.addAndRedo(new P.ChangeStyleTextHistoryItem(e.key,o,s[o]))})),void 0!==n.locked&&n.locked!==e.locked&&t.addAndRedo(new f.ChangeLockedHistoryItem(e,n.locked))},t.prototype.getPreparedStyleValue=function(t,e){if(e){var n=w.ColorUtils.stringToHash(t);null!==n&&(t=n)}return t},t.prototype.createShapeByNode=function(t,e,n,o,i,r,s,a,u,h){var p=new c.AddShapeHistoryItem(o.get(i.type),r,"",i.key);t.addAndRedo(p);var l=e.findShape(p.shapeKey);return S.ModelUtils.updateNewShapeProperties(t,n,p.shapeKey),this.changeShapeByDataItem(t,e,l,i,r),this.changeItemByDataItem(t,l,i),h&&this.canUseAutoSize&&s.autoSizeEnabled&&this.applyShapeAutoSize(t,h,s.sizeSettings,l,a,u),l},t.prototype.changeShapeByDataItem=function(t,e,n,o,i){var r=!1;void 0!==o.left&&(i.x=S.ModelUtils.getTwipsValue(e.units,o.left)),void 0!==o.top&&(i.y=S.ModelUtils.getTwipsValue(e.units,o.top)),r=S.ModelUtils.setShapePosition(t,e,n,i,!1)||r,void 0!==o.type&&(r=S.ModelUtils.changeShapeType(t,e,n,o.type)||r);var s=n.size.clone();void 0!==o.width&&(s.width=S.ModelUtils.getTwipsValue(e.units,o.width)),void 0!==o.height&&(s.height=S.ModelUtils.getTwipsValue(e.units,o.height)),(r=S.ModelUtils.setShapeSize(t,e,n,i,s)||r)&&S.ModelUtils.updateShapeAttachedConnectors(t,e,n),void 0!==o.text&&o.text!==n.text&&t.addAndRedo(new g.ChangeShapeTextHistoryItem(n,o.text)),void 0!==o.image&&o.image!==n.image.actualUrl&&t.addAndRedo(new y.ChangeShapeImageHistoryItem(n,o.image))},t.prototype.updateShapeContainer=function(t,e,n,o){var i=void 0!==o.containerKey?e.findShapeByDataKey(o.containerKey):void 0;i!==n.container&&(i?S.ModelUtils.insertToContainer(t,e,n,i):S.ModelUtils.removeFromContainer(t,e,n))},t.prototype.getConnectorPointsByEdge=function(t,e,n,o,i){var r=[],s=this.createModelPointFromDataSourceEdgeItemPoints(t.units,e);if(s&&s.length>1)for(var a=s.length-1,c=0;c<=a;c++){var u=s[c];if(null!==u)r.push(u);else{if(!n&&!o)return;0===c&&n?r.push(n.position.clone()):c===a&&o&&r.push(o.position.clone())}}else i&&(n&&r.push(n.position.clone()),o&&r.push(o.position.clone()));return r},t.prototype.createModelPointFromDataSourceEdgeItemPoints=function(t,e){var n=this,o=[];if(Array.isArray(e.points))return e.points.forEach((function(e){return o.push(n.isValidDataSourceEdgeItemPoint(e)?n.createModelPoint(t,e):null)})),o},t.prototype.createModelPoint=function(t,e){return new i.Point(S.ModelUtils.getTwipsValue(t,e.x),S.ModelUtils.getTwipsValue(t,e.y))},t.prototype.isValidDataSourceEdgeItemPoint=function(t){return null!=t&&void 0!==t.x&&void 0!==t.y&&null!==t.x&&null!==t.y},t.prototype.createConnectorByEdge=function(t,e,n,o,i,r){var s,c=o.key,u=this.getConnectorPointsByEdge(e,o,i,r,!0);if(u&&u.length>1){var h=new a.AddConnectorHistoryItem(u,c);t.addAndRedo(h),s=e.findConnector(h.connectorKey),S.ModelUtils.updateNewConnectorProperties(t,n,h.connectorKey),this.changeConnectorByDataItem(t,e,s,i,r,o),this.changeItemByDataItem(t,s,o)}return s},t.prototype.changeConnectorByDataItem=function(t,e,n,o,i,r){var a=void 0!==r.fromPointIndex?r.fromPointIndex:n.beginConnectionPointIndex;n.beginItem===o&&n.beginConnectionPointIndex===a||(n.beginItem&&t.addAndRedo(new u.DeleteConnectionHistoryItem(n,C.ConnectorPosition.Begin)),o&&t.addAndRedo(new s.AddConnectionHistoryItem(n,o,a,C.ConnectorPosition.Begin)));var c=void 0!==r.toPointIndex?r.toPointIndex:n.endConnectionPointIndex;if(n.endItem===i&&n.endConnectionPointIndex===c||(n.endItem&&t.addAndRedo(new u.DeleteConnectionHistoryItem(n,C.ConnectorPosition.End)),i&&t.addAndRedo(new s.AddConnectionHistoryItem(n,i,c,C.ConnectorPosition.End))),S.ModelUtils.updateConnectorAttachedPoints(t,e,n),void 0!==r.texts&&!this.compareTexts(r,n))for(var h in n.texts.forEach((function(e){t.addAndRedo(new l.ChangeConnectorTextHistoryItem(n,e.position,void 0))})),r.texts)if(Object.prototype.hasOwnProperty.call(r.texts,h)){var d=parseFloat(h);t.addAndRedo(new l.ChangeConnectorTextHistoryItem(n,d,r.texts[h]))}void 0!==r.lineOption&&r.lineOption!==n.properties.lineOption&&t.addAndRedo(new p.ChangeConnectorPropertyHistoryItem(n.key,"lineOption",r.lineOption)),void 0!==r.startLineEnding&&r.startLineEnding!==n.properties.startLineEnding&&t.addAndRedo(new p.ChangeConnectorPropertyHistoryItem(n.key,"startLineEnding",r.startLineEnding)),void 0!==r.endLineEnding&&r.endLineEnding!==n.properties.endLineEnding&&t.addAndRedo(new p.ChangeConnectorPropertyHistoryItem(n.key,"endLineEnding",r.endLineEnding))},t.prototype.changeConnectorPointsByDataItem=function(t,e,n){n&&n.length>1&&n.join(",")!==e.points.join(",")&&t.addAndRedo(new D.ReplaceConnectorPointsHistoryItem(e.key,n))},t.prototype.compareTexts=function(t,e){var n=t.texts||{},o=Object.keys(n).length===e.getTextCount();if(o)for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=parseFloat(i);this.compareStrings(e.getText(r),n[i])||(o=!1)}return o},t.prototype.compareStrings=function(t,e){return"string"==typeof t&&"string"==typeof e?t===e:this.isEmptyString(t)&&this.isEmptyString(e)},t.prototype.isEmptyString=function(t){return""===t||null==t},t}();e.DataSource=A},5558:function(t,e,n){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])},o(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}),e.DataSourceEdgeItem=e.DataSourceNodeItem=e.DataSourceItem=void 0;var r=n(7959),s=function(t,e,n){this.sourceKey=t,this.key=e,this.dataObj=n};e.DataSourceItem=s;var a=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}(s);e.DataSourceNodeItem=a;var c=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),Object.defineProperty(e.prototype,"text",{get:function(){return this.texts&&this.texts[r.CONNECTOR_DEFAULT_TEXT_POSITION]},enumerable:!1,configurable:!0}),e}(s);e.DataSourceEdgeItem=c},8717:function(t,e,n){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])},o(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}),e.DocumentDataSource=e.UpdateNodeKeyRelatedObjectsStackAction=e.UpdateNodeKeyRelatedObjectsStackItem=void 0;var r=n(2259),s=n(5503),a=n(7959),c=n(4225),u=n(4867),h=n(4914),p=n(8675),l=n(49),d=n(8679),f=function(t,e){this.shape=t,this.nodeObj=e};e.UpdateNodeKeyRelatedObjectsStackItem=f;var y=function(t,e){this.kind=t,this.nodeObj=e};e.UpdateNodeKeyRelatedObjectsStackAction=y;var g=function(t){function e(e,n,o,i,r,s){var a=t.call(this,"Document",n,o,i,r,s)||this;return a.changesListener=e,a.nodeInsertingLockCount=0,a.updateNodeKeyRelatedObjectsCount=0,a.updateNodeKeyRelatedObjectsStack=[],a.updateNodeKeyRelatedObjectsStackActions=[],a}return i(e,t),e.prototype.updateItemsByModel=function(t){var e=this;this.beginChangesNotification();var n={inserts:[],updates:[],deletes:[]};this.deleteNodes(t,n),t.items.forEach((function(o){o instanceof s.Shape&&e.updateNode(t,o,n)})),t.items.forEach((function(t){t instanceof s.Shape&&e.updateNodeObjectConnectedProperties(t,e.findNode(t.dataKey),e.changesListener)})),this.applyDelayedNodeNotifications(n),this.deleteEdges(t),t.items.forEach((function(n){n instanceof a.Connector&&e.updateEdge(t,n)})),this.endChangesNotification(!1)},e.prototype.applyDelayedNodeNotifications=function(t){var e=this;t.deletes.forEach((function(t){e.beginChangesNotification(),e.changesListener.notifyNodeRemoved.call(e.changesListener,t[0],t[1].dataObj,(function(t,n){e.endChangesNotification(!1)}),(function(t){e.endChangesNotification(!1)}))})),t.inserts.forEach((function(t){e.beginChangesNotification(),e.beginNodeInserting(),e.changesListener.notifyNodeInserted.call(e.changesListener,t[1].dataObj,(function(n){e.updateNodeObjectKey(t[0],t[1],n),e.endNodeInserting(),e.endChangesNotification(!1)}),(function(t){e.endNodeInserting(),e.endChangesNotification(!1)}))})),t.updates.forEach((function(t){e.beginChangesNotification(),e.changesListener.notifyNodeUpdated.call(e.changesListener,e.nodeDataImporter.getKey(t[1].dataObj||t[1].key),t[1].dataObj,(function(t,n){e.endChangesNotification(!1)}),(function(t){e.endChangesNotification(!1)}))}))},e.prototype.isItemObjectModified=function(t,e,n){var o=n.setLocked&&e.locked!==t.locked||n.setZIndex&&e.zIndex!==t.zIndex||n.setCustomData&&!p.ObjectUtils.compareObjects(e.customData,t.customData);if(!o&&n.setStyle){var i=t.style.getDefaultInstance();t.style.forEach((function(n){t.style[n]!==i[n]&&t.style[n]!==(e.style&&e.style[n])&&(o=!0)}))}if(!o&&n.setStyleText){var r=t.styleText.getDefaultInstance();t.styleText.forEach((function(n){t.styleText[n]!==r[n]&&t.styleText[n]!==(e.styleText&&e.styleText[n])&&(o=!0)}))}return o},e.prototype.setDataObjectKeyRelatedProperty=function(t,e,n,o){(o||void 0===this.autoGeneratedDataKeys[n])&&t(e,n)},e.prototype.updateItemObjectProperties=function(t,e,n){if(n.setCustomData&&(t.customData=p.ObjectUtils.cloneObject(e.customData),t.dataObj&&void 0!==t.customData&&n.setCustomData(t.dataObj,e.customData)),n.setLocked&&(t.locked=e.locked,t.dataObj&&void 0!==t.locked&&n.setLocked(t.dataObj,e.locked)),n.setStyle){var o=e.style.toObject();t.style=o,t.dataObj&&void 0!==t.style&&n.setStyle(t.dataObj,h.Data.objectToCssText(o))}if(n.setStyleText){var i=e.styleText.toObject();t.styleText=i,t.dataObj&&void 0!==t.styleText&&n.setStyleText(t.dataObj,h.Data.objectToCssText(i))}n.setZIndex&&(t.zIndex=e.zIndex,t.dataObj&&void 0!==t.zIndex&&n.setZIndex(t.dataObj,e.zIndex))},e.prototype.deleteItems=function(t,e,n,o){t.slice().forEach((function(t){if(void 0!==t.key&&null!==t.key&&!e(t.key)){var i=n(t),r=i.indexOf(t.dataObj);i.splice(r,1),o(t,r>-1)}}))},e.prototype.updateNode=function(t,e,n){var o=this.findNode(e.dataKey);if(o)this.isNodeObjectModified(e,o,t.units)?(this.updateNodeObjectProperties(e,o,t.units),this.updateNodeObjectConnectedProperties(e,o),n.updates.push([e,o])):this.updateNodeObjectConnectedProperties(e,o,this.changesListener);else{var i={};void 0!==e.dataKey&&null!==e.dataKey&&this.nodeDataImporter.setKey(i,e.dataKey),o=this.addNodeInternal(i,e.description.key,e.text),this.nodeDataSource.push(o.dataObj),this.setDataObjectKeyRelatedProperty(this.nodeDataImporter.setKey,i,o.key,this.addInternalKeyOnInsert),this.updateNodeObjectProperties(e,o,t.units),this.updateNodeObjectConnectedProperties(e,o),this.updateNodeObjectKey(e,o,o.dataObj),n.inserts.push([e,o])}},e.prototype.areImageUrlsEqual=function(t,e){return t===e||l.StringUtils.isNullOrEmpty(t)&&l.StringUtils.isNullOrEmpty(e)},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)||this.nodeDataImporter.setImage&&!this.areImageUrlsEqual(e.image,t.image.actualUrl)||this.nodeDataImporter.setLeft&&!d.MathUtils.numberCloseTo(e.left,u.ModelUtils.getlUnitValue(n,t.position.x))||this.nodeDataImporter.setTop&&!d.MathUtils.numberCloseTo(e.top,u.ModelUtils.getlUnitValue(n,t.position.y))||this.nodeDataImporter.setWidth&&!d.MathUtils.numberCloseTo(e.width,u.ModelUtils.getlUnitValue(n,t.size.width))||this.nodeDataImporter.setHeight&&!d.MathUtils.numberCloseTo(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.actualUrl,this.nodeDataImporter.setImage(e.dataObj,void 0===t.image.actualUrl?null:t.image.actualUrl)),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.getParentItemKey(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.getParentItemKey(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.IsNodeParentIdMode=function(){return this.useNodeParentId&&void 0!==this.nodeDataImporter.setParentKey},e.prototype.IsNodeItemsMode=function(){return this.useNodeItems&&void 0!==this.nodeDataImporter.setItems},e.prototype.updateNodeObjectParentKey=function(t,e,n){var o=this.nodeDataImporter.getParentKey(t.dataObj),i=e?this.nodeDataImporter.getKey(e.dataObj):void 0;o===i||this.isRootParentKey(o)&&this.isRootParentKey(i)||(this.setDataObjectKeyRelatedProperty(this.nodeDataImporter.setParentKey,t.dataObj,i,!1),n&&(this.isInUpdateNodeKeyRelatedObjects()?this.addToUpdateNodeKeyRelatedObjectsStackAction("shape",t):this.updateNodeObjectContainerOrParentKeyInternal(t,n)))},e.prototype.updateNodeObjectParentKeyInternal=function(t,e){var n=this;this.beginChangesNotification(),e.notifyNodeUpdated.call(e,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,(function(t,e){n.endChangesNotification(!1)}),(function(t){n.endChangesNotification(!1)}))},e.prototype.updateNodeObjectContainerKey=function(t,e,n){var o=this.nodeDataImporter.getContainerKey(t.dataObj),i=e?this.nodeDataImporter.getKey(e.dataObj):void 0;o===i||this.isRootParentKey(o)&&this.isRootParentKey(i)||(this.setDataObjectKeyRelatedProperty(this.nodeDataImporter.setContainerKey,t.dataObj,i,!1),n&&(this.isInUpdateNodeKeyRelatedObjects()?this.addToUpdateNodeKeyRelatedObjectsStackAction("shape",t):this.updateNodeObjectContainerOrParentKeyInternal(t,n)))},e.prototype.updateNodeObjectContainerOrParentKeyInternal=function(t,e){var n=this;this.beginChangesNotification(),e.notifyNodeUpdated.call(e,this.nodeDataImporter.getKey(t.dataObj)||t.key,t.dataObj,(function(t,e){n.endChangesNotification(!1)}),(function(t){n.endChangesNotification(!1)}))},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(!1)}),(function(t){o.endChangesNotification(!1)})))}},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(!1)}),(function(t){o.endChangesNotification(!1)})))}},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),i=!1;if(null!=o&&o!==e.key&&(delete this.autoGeneratedDataKeys[e.key],e.key=o,i=!0),t.dataKey=e.key,e.dataObj!==n){var r=this.getNodeArray(e),s=r.indexOf(e.dataObj);r.splice(s,1,n),e.dataObj=n}i&&this.updateNodeKeyRelatedObjects(t,e)},e.prototype.updateNodeKeyRelatedObjects=function(t,e){var n=this;if(this.isInNodeInserting())this.addToUpdateNodeKeyRelatedObjectsStack(t,e);else{if(this.useNodeParentId&&void 0!==this.nodeDataImporter.setParentKey)this.getChildItems(t).forEach((function(t){var o=n.findNode(t.dataKey);o&&n.updateNodeObjectParentKey(o,e,n.changesListener)}));this.useNodeContainerId&&void 0!==this.nodeDataImporter.setContainerKey&&t.children.forEach((function(t){var o=t instanceof s.Shape?n.findNode(t.dataKey):void 0;o&&n.updateNodeObjectContainerKey(o,e,n.changesListener)})),this.useEdgesArray()&&t.attachedConnectors.forEach((function(o){var i=n.findEdge(o.dataKey);i&&(t===o.beginItem&&n.updateEdgeObjectFromProperty(e,i,n.changesListener),t===o.endItem&&n.updateEdgeObjectToProperty(e,i,n.changesListener))}))}},e.prototype.deleteNodes=function(t,e){var n=this;this.deleteItems(this.nodes,(function(e){return t.findShapeByDataKey(e)}),(function(t){return n.getNodeArray(t)}),(function(t,o){var i=t.dataObj&&n.nodeDataImporter.getKey(t.dataObj)||t.key,r=n.findNode(i);r&&n.nodes.splice(n.nodes.indexOf(r),1),o&&e.deletes.push([i,t])}))},e.prototype.getParentItem=function(t){for(var e=0;e0},e.prototype.addToUpdateNodeKeyRelatedObjectsStack=function(t,e){var n=new f(t,e);this.updateNodeKeyRelatedObjectsStack.push(n)},e.prototype.raiseNodeInsertingStack=function(){for(this.beginUpdateNodeKeyRelatedObjects();this.updateNodeKeyRelatedObjectsStack.length>0;){var t=this.updateNodeKeyRelatedObjectsStack[0];this.updateNodeKeyRelatedObjects(t.shape,t.nodeObj),this.updateNodeKeyRelatedObjectsStack.splice(0,1),t.shape.description.hasTemplate&&t.nodeObj&&this.changesListener.reloadInsertedItem(t.nodeObj.key)}this.endUpdateNodeKeyRelatedObjects()},e.prototype.beginUpdateNodeKeyRelatedObjects=function(){this.updateNodeKeyRelatedObjectsCount++},e.prototype.endUpdateNodeKeyRelatedObjects=function(){this.updateNodeKeyRelatedObjectsCount--,0===this.updateNodeKeyRelatedObjectsCount&&this.raiseUpdateNodeKeyRelatedObjectsStack()},e.prototype.isInUpdateNodeKeyRelatedObjects=function(){return this.updateNodeKeyRelatedObjectsCount>0},e.prototype.addToUpdateNodeKeyRelatedObjectsStackAction=function(t,e){for(var n=new y(t,e),o=0;o0;){var t=this.updateNodeKeyRelatedObjectsStackActions[0];switch(t.kind){case"shape":this.updateNodeObjectContainerOrParentKeyInternal(t.nodeObj,this.changesListener);break;case"edge":this.updateEdgeObjectFromOrToPropertyInternal(t.nodeObj,this.changesListener)}this.updateNodeKeyRelatedObjectsStackActions.splice(0,1)}},e.prototype.beginChangesNotification=function(){this.changesListener.beginChangesNotification()},e.prototype.endChangesNotification=function(t){this.changesListener.endChangesNotification(t)},e}(c.DataSource);e.DocumentDataSource=g},9463:(t,e)=>{var n;Object.defineProperty(e,"__esModule",{value:!0}),e.Diagnostics=void 0,function(t){t[t.Disabled=0]="Disabled",t[t.Console=1]="Console",t[t.Document=2]="Document"}(n||(n={}));var o=function(){function t(){}return t.beginAverage=function(t){this.enableLogsAndTimers&&(this.lastAverageGroupName=t)},t.endAverage=function(){this.enableLogsAndTimers&&(this.lastAverageGroupName=null)},t.tryLogAverage=function(t){var e=this;if(this.lastAverageGroupName!==t){var n=Object.keys(this.timers).map((function(t){return e.timers[t]})).filter((function(e){return e.groupName===t}));if(!n.filter((function(t){return!t.endTime})).length){var o=n.reduce((function(t,e){return t+(e.endTime-e.startTime)}),0)/n.length;this.log("average: "+o)}}},t.timer=function(t){this.enableLogsAndTimers&&(this.lastCreatedTimer={message:t,startTime:performance.now(),groupName:this.lastAverageGroupName})},t.endTimer=function(){var t=this;if(this.enableLogsAndTimers){var e=this.lastCreatedTimer,n=setTimeout((function(){e.endTime=performance.now(),t.showMessage('timer "'+e.message+'": '+(e.endTime-e.startTime)),e.groupName&&t.tryLogAverage(e.groupName)}),0);this.timers[n]=e,this.lastCreatedTimer=null}},t.logPerfInfo=function(){var t=document.querySelector(".dxdi-control > svg").querySelectorAll("*").length,e=performance.memory;this.log("nodes: "+t.toLocaleString()+(e?" memory: ":"")+(e?e.usedJSHeapSize.toLocaleString():""))},t.log=function(t){this.showMessage(t)},t.showMessage=function(e){switch(t.mode){case n.Console:console.log(e);break;case n.Document:var o=this.getElement().value;if(this.lastMessage===e){var i=o.indexOf("\r\n");i<0&&(i=o.indexOf("\n"));var r=o.substr(0,i);/( \()([0-9]+)(\))$/.test(r)?r=r.replace(/( \()([0-9]+)(\))$/,(function(t,e,n,o){return e+ ++n+o})):r+=" (1)",this.getElement().value=r+o.substr(i)}else this.getElement().value=e+"\r\n"+o,this.lastMessage=e}},t.getElement=function(){var t=this;if(!this.el){this.el=document.createElement("textarea"),this.el.style.top="0px",this.el.style.right="0px",this.el.style.position="fixed",this.el.style.background="transparent",this.el.style.fontSize="11px",this.el.style.fontFamily="monospace",this.el.style.overflow="auto",this.el.style.width="400px",document.body.appendChild(this.el);var e=document.createElement("button");e.innerHTML="x",e.addEventListener("click",(function(){t.el.value="",t.lastMessage=""})),e.style.top="0px",e.style.right="400px",e.style.position="fixed",e.style.opacity="0.1",document.body.appendChild(e)}return this.el},t.mode=n.Document,t.optimizeUsingRAF=!0,t.optimizeLayers=!0,t.timers={},t.enableLogsAndTimers=!1,t}();e.Diagnostics=o},2106:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramControl=void 0;var o=n(8900),i=n(1118),r=n(7156),s=n(82),a=n(6613),c=n(9021),u=n(1864),h=n(2230),p=n(8098),l=n(8397),d=n(8717),f=n(240),y=n(6879),g=n(6734),m=n(4867),v=n(3298),P=n(8675),C=n(5656),S=n(7176),x=n(2883),b=n(5714),I=n(1733),w=n(7959),_=n(3503),T=n(6214),O=n(3500),M=n(3607),E=n(8679),D=function(){function t(){this.updateLockCount=0,this.shouldUpdateItemsByModel=!1,this.reloadContentNeeded=!1,this.reloadContentParameters=new T.ReloadContentParameters,this.reloadContentByExternalChangesParameters=new T.ReloadContentParameters,this.instanceId=E.MathUtils.generateGuid(),this.settings=new f.DiagramSettings,this.shapeDescriptionManager=new l.ShapeDescriptionManager,this.shapeDescriptionManager.onShapeDecriptionChanged.add(this),this.model=new a.DiagramModel,this.selection=new c.Selection(this.model),this.onNativeAction=new P.EventDispatcher,this.apiController=new C.ApiController(this.onNativeAction,this.selection,this.model),this.permissionsProvider=new x.PermissionsProvider(this.apiController),this.permissionsProvider.onRequestOperation.add(this),this.routingModel=new b.ConnectorRoutingModel,this.modelManipulator=new i.ModelManipulator(this.model,this.routingModel,this.permissionsProvider,this.shapeDescriptionManager),this.modelManipulator.onModelChanged.add(this.permissionsProvider),this.history=new u.History(this.modelManipulator,this),this.barManager=new h.BarManager(this),this.view=new g.ViewController(this.settings,this.barManager),this.commandManager=new r.CommandManager(this),this.eventManager=new s.EventManager(this),this.settings.onReadOnlyChanged.add(this.eventManager.mouseHandler),this.settings.onReadOnlyChanged.add(this.eventManager.visualizersManager),this.selection.onChanged.add(this.barManager),this.selection.onChanged.add(this.apiController),this.selection.onChanged.add(this.permissionsProvider),this.modelManipulator.commitItemsCreateChanges(),this.history.onChanged.add(this),this.toolboxManager=new v.ToolboxManager(this.shapeDescriptionManager),this.settings.onConnectorRoutingModeChanged.add(this.routingModel),S.ImageCache.instance.onReadyStateChanged.add(this)}return Object.defineProperty(t.prototype,"operationSettings",{get:function(){return this.permissionsProvider.operationSettings},enumerable:!1,configurable:!0}),t.prototype.cleanMarkup=function(t){t=t||function(t){O.RenderUtils.removeElement(t)},this.toolboxManager.clean(t),this.barManager.clean(),this.render&&(this.settings.onZoomChanged.remove(this.render.view),this.settings.onViewChanged.remove(this.render.page),this.settings.onViewChanged.remove(this.render.view),this.settings.onReadOnlyChanged.remove(this.render),this.settings.onReadOnlyChanged.remove(this.render.selection),this.eventManager.cleanToolboxes(this.settings.onReadOnlyChanged),this.eventManager.onTextInputOperation.remove(this.render.input),this.eventManager.onTextInputOperation.remove(this.render.items),this.eventManager.onTextInputOperation.remove(this.render.selection),this.eventManager.onMouseOperation.remove(this.render.items),this.eventManager.onMouseOperation.remove(this.render.selection),this.eventManager.onMouseOperation.remove(this.render.view),this.eventManager.onMouseOperation.remove(this.render),this.eventManager.onVisualizersUpdate.remove(this.render.selection),this.modelManipulator.onModelSizeChanged.remove(this.render.view),this.modelManipulator.onModelSizeChanged.remove(this.render.page),this.modelManipulator.onModelChanged.remove(this.render.items),this.modelManipulator.onModelChanged.remove(this.render.page),this.modelManipulator.onModelChanged.remove(this.render.selection),this.selection.onChanged.remove(this.render.selection),this.selection.onChanged.remove(this.render.items),this.render.clean(t),this.render=void 0),this.measurer&&this.measurer instanceof I.TextMeasurer&&this.measurer.clean()},t.prototype.dispose=function(){S.ImageCache.instance.onReadyStateChanged.remove(this)},t.prototype.createDocument=function(t,e,n){this.measurer||this.initMeasurer(t),this.render?this.render.replaceParent(t,e):(this.render=new p.RenderManager(t,this.eventManager,this.measurer,{pageColor:this.model.pageColor,modelSize:this.model.size,pageLandscape:this.model.pageLandscape,pageSize:this.model.pageSize,simpleView:this.settings.simpleView,readOnly:this.settings.readOnly,contextMenuEnabled:this.settings.contextMenuEnabled,gridSize:this.settings.gridSize,gridVisible:this.settings.showGrid,zoomLevel:this.settings.zoomLevel,autoZoom:this.settings.autoZoom,rectangle:this.model.getRectangle(!0)},this.instanceId,e,n),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.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.onTextInputOperation.add(this),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.selection.onChanged.add(this.render.items),this.render.update(!1),this.render.onNewModel(this.model.items),this.modelManipulator.commitItemsCreateChanges(),this.view.initialize(this.render.view),this.settings.zoomLevelWasChanged&&this.raiseCanvasViewActualZoomChanged(),this.selection.raiseSelectionChanged())},t.prototype.createToolbox=function(t,e,n,o){var i=this.toolboxManager.create(t,this.settings.readOnly,!0,e,n,this.getToolboxAllowedShapeTypes.bind(this),this.instanceId,o);this.settings.onReadOnlyChanged.add(i),i.onDragOperation.add(this),i.onDragOperation.add(this.apiController),this.eventManager.registerToolbox(i)},t.prototype.createContextToolbox=function(t,e,n,o,i){this.cleanContextToolbox(),this.contextToolbox=this.toolboxManager.create(t,this.settings.readOnly,!1,e,n,this.getToolboxAllowedShapeTypes.bind(this),this.instanceId,o),this.contextToolbox.onClickOperation.add(this),this.contextToolboxOnClick=i},t.prototype.getToolboxAllowedShapeTypes=function(t){var e=this,n=[];return this.permissionsProvider.beginUpdateUI(),t.forEach((function(t){e.permissionsProvider.canAddShapeFromToolbox(t)&&n.push(t)})),this.permissionsProvider.endUpdateUI(),n},t.prototype.cleanContextToolbox=function(){this.contextToolbox&&(this.toolboxManager.clean(void 0,this.contextToolbox),this.contextToolbox=void 0,this.contextToolboxOnClick=void 0)},t.prototype.refreshToolbox=function(t){this.permissionsProvider.clearCache(y.DiagramModelOperation.AddShapeFromToolbox),this.toolboxManager.refresh(t)},t.prototype.applyToolboxFilter=function(t,e){return this.toolboxManager.applyFilter(t,e)},t.prototype.notifyToolboxClick=function(t){this.contextToolboxOnClick&&this.contextToolboxOnClick(t)},t.prototype.initMeasurer=function(t){this.measurer=new I.TextMeasurer(t)},t.prototype.onDimensionChanged=function(){M.Browser.TouchUI||this.updateLayout(!0)},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.registerBar=function(t){this.barManager.registerBar(t)},t.prototype.updateBarItemsState=function(t,e){this.barManager.updateBarItemsState(t,e)},t.prototype.getCommand=function(t){return this.commandManager.getCommand(t)},t.prototype.getNativeItemByKey=function(t){var e=this.model.findItem(t);return e&&this.apiController.createNativeItem(e)},t.prototype.getNativeItemByDataKey=function(t){var e=this.model.findItemByDataKey(t);return e&&this.apiController.createNativeItem(e)},t.prototype.getNativeItems=function(){var t=this;return this.model.items.map((function(e){return t.apiController.createNativeItem(e)}))},t.prototype.getNativeSelectedItems=function(){var t=this;return this.selection.getKeys().map((function(e){return t.apiController.createNativeItem(t.model.findItem(e))}))},t.prototype.setSelectedItems=function(t){this.selection.set(t)},t.prototype.scrollToItems=function(t){var e=this,n=P.GeometryUtils.getCommonRectangle(t.map((function(t){return e.model.findItem(t).rectangle})));this.view.scrollIntoView(n)},t.prototype.setInitialStyleProperties=function(t){this.selection.inputPosition.setInitialStyleProperties(t)},t.prototype.setInitialTextStyleProperties=function(t){this.selection.inputPosition.setInitialTextStyleProperties(t)},t.prototype.setInitialConnectorProperties=function(t){this.selection.inputPosition.setInitialConnectorProperties(t)},t.prototype.addCustomShapes=function(t){var e=this;t.forEach((function(t){t.apiController=e.apiController,t.defaultWidth&&(t.defaultWidth=m.ModelUtils.getTwipsValue(e.model.units,t.defaultWidth)),t.defaultHeight&&(t.defaultHeight=m.ModelUtils.getTwipsValue(e.model.units,t.defaultHeight)),t.minWidth&&(t.minWidth=m.ModelUtils.getTwipsValue(e.model.units,t.minWidth)),t.minHeight&&(t.minHeight=m.ModelUtils.getTwipsValue(e.model.units,t.minHeight)),t.maxWidth&&(t.maxWidth=m.ModelUtils.getTwipsValue(e.model.units,t.maxWidth)),t.maxHeight&&(t.maxHeight=m.ModelUtils.getTwipsValue(e.model.units,t.maxHeight)),e.shapeDescriptionManager.registerCustomShape(t)}))},t.prototype.removeCustomShapes=function(t){var e=this;t.forEach((function(t){e.shapeDescriptionManager.unregisterCustomShape(t)}))},t.prototype.removeAllCustomShapes=function(){this.shapeDescriptionManager.unregisterAllCustomShapes()},t.prototype.importModel=function(t){t.units=this.model.units,this.model=t,this.model.initializeKeyCounter(),this.apiController.model=t,this.onImportData()},t.prototype.importItemsData=function(){this.onImportData()},t.prototype.onImportData=function(){this.render&&(this.render.clear(),this.render.onNewModel(this.model.items)),this.permissionsProvider.clearCache(),this.selection.initialize(this.model),this.modelManipulator.initialize(this.model,this.routingModel),this.history.clear(),this.eventManager.initialize(),this.modelManipulator.commitPageChanges(),this.modelManipulator.commitItemsCreateChanges(),this.notifyViewChanged(),this.notifyHistoryChanged()},t.prototype.createDocumentDataSource=function(t,e,n,o,i){return this.documentDataSource=new d.DocumentDataSource(this,t,e,n,o,i),this.apiController.setDataSource(this.documentDataSource),this.documentDataSource},t.prototype.deleteDocumentDataSource=function(){this.apiController.setDataSource(null),delete this.documentDataSource},t.prototype.applyShapeSizeSettings=function(t){this.settings.applyShapeSizeSettings(t,this.model.units)},t.prototype.applyOperationSettings=function(t){this.permissionsProvider.operationSettings.applySettings(t)},t.prototype.beginUpdateCanvas=function(){this.render&&(this.render.items.beginUpdate(),this.render.selection.beginUpdate())},t.prototype.endUpdateCanvas=function(){this.render&&(this.render.items.endUpdate(),this.render.selection.endUpdate())},t.prototype.beginUpdate=function(){this.barManager.beginUpdate(),this.apiController.beginUpdate(),this.eventManager.beginUpdate()},t.prototype.endUpdate=function(){this.barManager.endUpdate(),this.apiController.endUpdate(),this.eventManager.endUpdate()},t.prototype.notifyEdgeInserted=function(t,e,n){this.onEdgeInserted?this.onEdgeInserted(t,e,n):e(t)},t.prototype.notifyEdgeUpdated=function(t,e,n,o){this.onEdgeUpdated?this.onEdgeUpdated(t,e,n,o):n(t,e)},t.prototype.notifyEdgeRemoved=function(t,e,n,o){this.onEdgeUpdated?this.onEdgeRemoved(t,e,n,o):n(t,e)},t.prototype.notifyNodeInserted=function(t,e,n){this.onNodeInserted?this.onNodeInserted(t,e,n):e(t)},t.prototype.notifyNodeUpdated=function(t,e,n,o){this.onNodeUpdated?this.onNodeUpdated(t,e,n,o):n(t,e)},t.prototype.notifyNodeRemoved=function(t,e,n,o){this.onNodeRemoved?this.onNodeRemoved(t,e,n,o):n(t,e)},t.prototype.reloadInsertedItem=function(t){this.settings.reloadInsertedItemRequired&&this.reloadContent(t)},t.prototype.reloadContent=function(t,e,n,o){if(this.documentDataSource){this.isChangesLocked()&&(this.reloadContentNeeded=!0);var i=!0===o||void 0===o&&!this.reloadContentNeeded,r=i?this.reloadContentByExternalChangesParameters:this.reloadContentParameters;r.add(t,e,n),this.isChangesLocked()||(this.reloadContentCore(r,i),this.barManager.updateItemsState())}},t.prototype.reloadContentCore=function(t,e){var n=this,o=t.getData&&t.getData(),i=this.documentDataSource.refetchData(o&&o.nodeDataSource,o&&o.edgeDataSource);this.beginUpdateCanvas(),this.permissionsProvider.lockPermissions(),this.documentDataSource.updateModelItems(this.history,this.model,this.shapeDescriptionManager,this.selection,new _.DataLayoutParameters(this.settings,t.layoutParameters),e,t.dataKeys,(function(t){n.modelManipulator.commitItemUpdateChanges(t)}),i,this.settings.snapToGrid,this.settings.gridSize,this.measurer),this.permissionsProvider.unlockPermissions(),this.endUpdateCanvas(),t.clear()},t.prototype.notifyHistoryChanged=function(){this.documentDataSource?(this.shouldUpdateItemsByModel=!0,this.settings.readOnly||this.notifyDataChanges()):this.raiseOnChanged()},t.prototype.notifyViewChanged=function(){this.settings.notifyViewChanged()},t.prototype.notifyToolboxDragStart=function(t){this.render.notifyToolboxDragStart(t),this.onToolboxDragStart&&this.onToolboxDragStart()},t.prototype.notifyToolboxDragEnd=function(t){this.render.notifyToolboxDragEnd(t),this.onToolboxDragEnd&&this.onToolboxDragEnd()},t.prototype.notifyToolboxDraggingMouseMove=function(t){this.render&&this.render.notifyToolboxDraggingMouseMove(t)},t.prototype.notifyTextInputStart=function(t,e,n,o){this.onTextInputStart&&this.onTextInputStart()},t.prototype.notifyTextInputEnd=function(t,e){this.onTextInputEnd&&this.onTextInputEnd()},t.prototype.notifyTextInputPermissionsCheck=function(t,e){},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 i=m.ModelUtils.createRectangle(this.selection.getSelectedItems(!0)),r=this.render.getEventPointByModelPoint(i.createPosition()),s=this.render.view.getAbsoluteSize(i.createSize());n={x:r.x,y:r.y,width:s.width,height:s.height}}if(t)this.contextMenuPosition=new o.Point(t.x,t.y),this.onShowContextMenu(t.x,t.y,n);else if(e){var a=this.render.getEventPointByModelPoint(e);this.contextMenuPosition=a.clone(),this.onShowContextMenu(a.x,a.y,n)}}},t.prototype.notifyHideContextMenu=function(){this.onHideContextMenu&&this.render&&this.onHideContextMenu()},t.prototype.notifyShowContextToolbox=function(t,e,n,o,i){if(this.onShowContextToolbox&&this.render){var r=this.render.getEventPointByModelPoint(t);this.onShowContextToolbox(r.x,r.y,n,o,i),this.render.view.notifyShowContextToolbox()}},t.prototype.notifyHideContextToolbox=function(){this.onHideContextToolbox&&this.render&&(this.onHideContextToolbox(),this.render.view.notifyHideContextToolbox()),this.cleanContextToolbox()},t.prototype.notifyShapeDescriptionChanged=function(t){this.modelManipulator.updateShapeDescription(t)},t.prototype.notifyImageCacheReadyStateChanged=function(t){this.barManager.updateItemsState()},t.prototype.raiseCanvasViewActualZoomChanged=function(){this.render.view.raiseActualZoomChanged()},t.prototype.notifyRequestOperation=function(t,e){this.requestOperationByDataSource(t,e)||this.onRequestOperation&&this.onRequestOperation(t,e)},t.prototype.requestOperationByDataSource=function(t,e){if(!this.documentDataSource||!this.documentDataSource.IsNodeParentIdMode()&&!this.documentDataSource.IsNodeItemsMode())return!1;if(t===y.DiagramModelOperation.ChangeConnection){var n=e,o=n.shape&&this.model.findItem(n.shape.id),i=n.connector&&this.model.findItem(n.connector.id);if(!o||!i)return;if(n.position===w.ConnectorPosition.End)for(var r=0;r0},t.prototype.beginChangesNotification=function(){this.isChangesLocked()||this.changesLockChanged&&this.changesLockChanged(!0),this.updateLockCount++},t.prototype.endChangesNotification=function(t){var e=this;this.updateLockCount--,this.isChangesLocked()||(this.changesLockChanged(!1),t||setTimeout((function(){e.notifyReloadContent(),e.notifyDataChanges()}),0))},t.prototype.changesLockChanged=function(t){t?this.lockedReadOnly=this.settings.readOnly:t=this.lockedReadOnly,this.commandManager.getCommand(r.DiagramCommand.ToggleReadOnly).execute(t)},t.prototype.notifyDataChanges=function(){this.isChangesLocked()||(this.shouldUpdateItemsByModel&&(this.documentDataSource.updateItemsByModel(this.model),this.shouldUpdateItemsByModel=!1),this.raiseOnChanged())},t.prototype.notifyReloadContent=function(){this.reloadContentNeeded&&(this.reloadContentParameters.empty||this.reloadContentCore(this.reloadContentParameters,!1),this.reloadContentByExternalChangesParameters.empty||this.reloadContentCore(this.reloadContentByExternalChangesParameters,!0),this.reloadContentNeeded=!1)},t.prototype.raiseOnChanged=function(){this.onChanged&&this.onChanged()},t}();e.DiagramControl=D},5383:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PageOrientation=e.DiagramUnit=void 0,function(t){t[t.In=0]="In",t[t.Cm=1]="Cm",t[t.Px=2]="Px"}(e.DiagramUnit||(e.DiagramUnit={})),function(t){t[t.Portrait=0]="Portrait",t[t.Landscape=1]="Landscape"}(e.PageOrientation||(e.PageOrientation={}))},9946:function(t,e,n){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])},o(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}),e.ContextMenuHandler=void 0;var r=n(8675),s=n(6031),a=n(2153),c=n(1772),u=n(9279),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.contextMenuVisible=!1,e.textInputStarted=!1,e.canHideContextMenu=!0,e.onVisibilityChanged=new r.EventDispatcher,e}return i(e,t),e.prototype.onMouseDown=function(t){t.button===s.MouseButton.Left&&t.source.type!==s.MouseEventElementType.Undefined&&this.hideContextMenu()},e.prototype.onMouseUp=function(t){(!u.Browser.MacOSPlatform||u.Browser.MacOSPlatform&&this.canHideContextMenu)&&this.hideContextMenu(),this.canHideContextMenu=!0},e.prototype.onContextMenu=function(t){u.Browser.MacOSPlatform&&(this.canHideContextMenu=!1),this.showContextMenu(t.eventPoint,t.modelPoint)},e.prototype.onFocus=function(t){},e.prototype.onBlur=function(t){},e.prototype.onTextInputFocus=function(t){},e.prototype.onTextInputBlur=function(t){},e.prototype.onLongTouch=function(t){},e.prototype.onKeyDown=function(t){t.keyCode===a.KeyCode.Esc&&this.hideContextMenu()},e.prototype.onShortcut=function(t){this.hideContextMenu()},e.prototype.showContextMenu=function(t,e){var n=this;this.textInputStarted||window.setTimeout((function(){n.onVisibilityChanged.raise1((function(n){return n.notifyShowContextMenu(t,e)})),n.contextMenuVisible=!0}),1)},e.prototype.hideContextMenu=function(){var t=this;this.contextMenuVisible&&window.setTimeout((function(){t.onVisibilityChanged.raise1((function(t){return t.notifyHideContextMenu()})),t.contextMenuVisible=!1}),1)},e.prototype.notifyDragStart=function(t){},e.prototype.notifyDragEnd=function(t){},e.prototype.notifyDragScrollStart=function(){},e.prototype.notifyDragScrollEnd=function(){},e.prototype.notifyShowContextToolbox=function(t,e,n,o,i){},e.prototype.notifyHideContextToolbox=function(){},e.prototype.notifyTextInputStart=function(t,e,n,o){this.textInputStarted=!0},e.prototype.notifyTextInputEnd=function(t,e){this.textInputStarted=!1},e.prototype.notifyTextInputPermissionsCheck=function(t,e){},e.prototype.onUpdateUnlocked=function(t){},e}(c.BatchUpdatableObject);e.ContextMenuHandler=h},151:function(t,e,n){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])},o(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}),e.ContextMenuTouchHandler=void 0;var r=n(6031),s=n(9946),a=n(4867),c=function(t){function e(e){var n=t.call(this)||this;return n.selection=e,n.contextToolboxVisible=!1,n.selection.onChanged.add(n),n}return i(e,t),e.prototype.onMouseDown=function(t){void 0===t.source.key&&this.hideContextMenu()},e.prototype.onMouseUp=function(t){},e.prototype.onFocus=function(t){var e=this;setTimeout((function(){e.showContextMenuAtSelection()}),1)},e.prototype.onBlur=function(t){var e=this;setTimeout((function(){e.hideContextMenu()}),1)},e.prototype.onTextInputFocus=function(t){var e=this;setTimeout((function(){e.hideContextMenu()}),1)},e.prototype.onTextInputBlur=function(t){var e=this;setTimeout((function(){e.showContextMenuAtSelection()}),1)},e.prototype.onLongTouch=function(t){t.source.type===r.MouseEventElementType.Document&&this.showContextMenuAtEmptySelection(t.modelPoint)},e.prototype.onKeyDown=function(t){},e.prototype.onShortcut=function(t){},e.prototype.getSelectedItems=function(){return this.selection.getSelectedItems(!0)},e.prototype.showContextMenuAtSelection=function(){if(!this.contextToolboxVisible){var t=this.getSelectedItems();0!==t.length&&this.showContextMenu(void 0,a.ModelUtils.createRectangle(t).createPosition())}},e.prototype.showContextMenuAtEmptySelection=function(t){this.contextToolboxVisible||0===this.getSelectedItems().length&&this.showContextMenu(void 0,t)},e.prototype.notifyDragStart=function(t){this.hideContextMenu()},e.prototype.notifyDragEnd=function(t){this.showContextMenuAtSelection()},e.prototype.notifySelectionChanged=function(t){this.isUpdateLocked()?this.registerOccurredEvent(1):this.raiseSelectionChanged()},e.prototype.raiseSelectionChanged=function(){0!==this.getSelectedItems().length?this.showContextMenuAtSelection():this.hideContextMenu()},e.prototype.onUpdateUnlocked=function(t){1&t&&this.raiseSelectionChanged()},e.prototype.notifyShowContextToolbox=function(t,e,n,o,i){this.contextToolboxVisible=!0,this.hideContextMenu()},e.prototype.notifyHideContextToolbox=function(){this.contextToolboxVisible=!1,this.showContextMenuAtSelection()},e}(s.ContextMenuHandler);e.ContextMenuTouchHandler=c},4426:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContextToolboxHandler=void 0;var o=n(6031),i=n(8675),r=n(2153),s=n(9279),a=function(){function t(){this.contextToolboxVisible=!1,this.onVisibilityChanged=new i.EventDispatcher}return t.prototype.onMouseDown=function(t){t.source.type!==o.MouseEventElementType.Undefined&&this.hideContextToolbox()},t.prototype.onMouseUp=function(t){t.source.type===o.MouseEventElementType.Undefined&&s.Browser.TouchUI||this.hideContextToolbox()},t.prototype.onFocus=function(t){},t.prototype.onBlur=function(t){},t.prototype.onKeyDown=function(t){t.keyCode===r.KeyCode.Esc&&this.hideContextToolbox()},t.prototype.onShortcut=function(t){this.hideContextToolbox()},t.prototype.showContextToolbox=function(t,e,n,o,i,r){this.onVisibilityChanged.raise1((function(r){return r.notifyShowContextToolbox(t,e,n,o,i)})),this.contextToolboxVisible=!0,this.contextToolboxCancelCallback=r},t.prototype.hideContextToolbox=function(t){this.contextToolboxVisible&&(this.onVisibilityChanged.raise1((function(t){return t.notifyHideContextToolbox()})),this.contextToolboxCancelCallback&&(t||this.contextToolboxCancelCallback(),this.contextToolboxCancelCallback=void 0),this.contextToolboxVisible=!1)},t}();e.ContextToolboxHandler=a},6031:function(t,e,n){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])},o(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}),e.DiagramClipboardEvent=e.DiagramKeyboardEvent=e.DiagramContextMenuEvent=e.DiagramWheelEvent=e.DiagramMouseEvent=e.DiagramMouseEventBase=e.DiagramMouseEventTouch=e.DiagramFocusEvent=e.DiagramEvent=e.ResizeEventSource=e.MouseEventSource=e.MouseEventElementType=e.MouseButton=void 0;var r,s=n(2153);!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.Undefined=0]="Undefined",t[t.Background=1]="Background",t[t.Document=2]="Document",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"}(r=e.MouseEventElementType||(e.MouseEventElementType={}));var a=function(){function t(t,e,n){this.type=t,this.key=e,this.value=n}return Object.defineProperty(t.prototype,"isConnector",{get:function(){return this.type===r.Connector||this.type===r.ConnectorText},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isShape",{get:function(){return this.type===r.Shape||this.type===r.ShapeConnectionPoint},enumerable:!1,configurable:!0}),t}();e.MouseEventSource=a,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 c=function(t){this.modifiers=t};e.DiagramEvent=c;var u=function(t){function e(e){var n=t.call(this,s.ModifierKey.None)||this;return n.inputText=e,n}return i(e,t),e}(c);e.DiagramFocusEvent=u;var h=function(t,e){this.offsetPoint=t,this.modelPoint=e};e.DiagramMouseEventTouch=h;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}(c);e.DiagramMouseEventBase=p;var l=function(t){function e(e,n,o,i,r,s,a){void 0===s&&(s=[]);var c=t.call(this,e,o,i,r)||this;return c.button=n,c.touches=s,c.isTouchMode=a,c.scrollX=0,c.scrollY=0,c}return i(e,t),e}(p);e.DiagramMouseEvent=l;var d=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=d;var f=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}(c);e.DiagramContextMenuEvent=f;var y=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}(c);e.DiagramKeyboardEvent=y;var g=function(t){function e(e){var n=t.call(this,s.ModifierKey.None)||this;return n.clipboardData=e,n}return i(e,t),e}(c);e.DiagramClipboardEvent=g},82:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventManager=void 0;var o=n(5689),i=n(8675),r=n(8376),s=n(9946),a=n(151),c=n(7733),u=n(7459),h=n(4426),p=n(9279),l=n(2153),d=function(){function t(t){this.onMouseOperation=new i.EventDispatcher,this.onTextInputOperation=new i.EventDispatcher,this.toolboxes=[],this.control=t,this.visualizersManager=i.EventUtils.isTouchMode()?new u.VisualizerTouchManager(t.selection,t.model,this,t.settings):new c.VisualizerManager(t.selection,t.model,this,t.settings),this.onMouseOperation.add(this.visualizersManager),this.contextMenuHandler=p.Browser.TouchUI?new a.ContextMenuTouchHandler(t.selection):new s.ContextMenuHandler,this.contextMenuHandler.onVisibilityChanged.add(t),this.onMouseOperation.add(this.contextMenuHandler),this.onTextInputOperation.add(this.contextMenuHandler),this.contextToolboxHandler=new h.ContextToolboxHandler,this.contextToolboxHandler.onVisibilityChanged.add(t),this.contextToolboxHandler.onVisibilityChanged.add(this.contextMenuHandler),this.mouseHandler=new o.MouseHandler(t.history,t.selection,t.model,this,t.settings.readOnly,t.view,this.visualizersManager,this.contextToolboxHandler,t.shapeDescriptionManager,t.settings,t.permissionsProvider),this.textInputHandler=new r.TextInputHandler(t),this.visualizersManager.onVisualizersUpdate.add(this.mouseHandler)}return Object.defineProperty(t.prototype,"onVisualizersUpdate",{get:function(){return this.visualizersManager.onVisualizersUpdate},enumerable:!1,configurable:!0}),t.prototype.registerToolbox=function(t){this.toolboxes.push(t)},t.prototype.cleanToolboxes=function(t){this.toolboxes.forEach((function(e){t.remove(e)})),this.toolboxes=[]},t.prototype.initialize=function(){this.visualizersManager.initialize(this.control.model),this.mouseHandler.initialize(this.control.model),this.textInputHandler.reset()},t.prototype.beginUpdate=function(t){this.contextMenuHandler.beginUpdate(),this.visualizersManager.beginUpdate()},t.prototype.endUpdate=function(){this.contextMenuHandler.endUpdate(),this.visualizersManager.endUpdate()},t.prototype.onMouseDown=function(t){this.mouseHandler.onMouseDown(t),this.contextMenuHandler.onMouseDown(t),this.visualizersManager.onMouseDown(t),this.contextToolboxHandler.onMouseDown(t)},t.prototype.onMouseMove=function(t){this.processDragging(t),this.mouseHandler.onMouseMove(t)},t.prototype.onMouseUp=function(t){this.contextToolboxHandler.onMouseUp(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),this.control.apiController.notifyDblClick(t)},t.prototype.onClick=function(t){this.mouseHandler.onMouseClick(t),this.control.apiController.notifyClick(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.contextToolboxHandler.onBlur(t),this.visualizersManager.onBlur(t)},t.prototype.onFocus=function(t){this.contextMenuHandler.onFocus(t),this.contextToolboxHandler.onFocus(t),this.visualizersManager.onFocus(t)},t.prototype.onKeyDown=function(t){var e=t.getShortcutCode();this.onShortcut(e)?(this.visualizersManager.updateConnectionPoints(),this.contextMenuHandler.onShortcut(t),this.contextToolboxHandler.onShortcut(t),t.preventDefault=!0):this.isShortcutForFocusInput(e)&&(t.preventDefault=!0),this.contextMenuHandler.onKeyDown(t),this.contextToolboxHandler.onKeyDown(t),this.mouseHandler.onKeyDown(t)},t.prototype.onKeyUp=function(t){this.mouseHandler.onKeyUp(t)},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.isShortcutForFocusInput=function(t){return t===l.KeyCode.Delete||t===(l.KeyCode.Delete|l.ModifierKey.Ctrl)||t===(l.KeyCode.Delete|l.ModifierKey.Meta)||t===l.KeyCode.Backspace||t===(l.KeyCode.Backspace|l.ModifierKey.Ctrl)||t===(l.KeyCode.Backspace|l.ModifierKey.Shift)||t===(l.KeyCode.Backspace|l.ModifierKey.Meta)||t===l.KeyCode.Home||t===l.KeyCode.End||t===l.KeyCode.Up||t===(l.KeyCode.Up|l.ModifierKey.Ctrl)||t===(l.KeyCode.Up|l.ModifierKey.Meta)||t===l.KeyCode.Down||t===(l.KeyCode.Down|l.ModifierKey.Ctrl)||t===(l.KeyCode.Down|l.ModifierKey.Meta)||t===l.KeyCode.Left||t===(l.KeyCode.Left|l.ModifierKey.Ctrl)||t===(l.KeyCode.Left|l.ModifierKey.Meta)||t===l.KeyCode.Right||t===(l.KeyCode.Right|l.ModifierKey.Ctrl)||t===(l.KeyCode.Right|l.ModifierKey.Meta)},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!==e?(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(),this.control.barManager.updateItemsState()},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(),this.control.barManager.updateItemsState()},t.prototype.raiseTextInputStart=function(t,e,n,o){this.onTextInputOperation.raise("notifyTextInputStart",t,e,n,o)},t.prototype.raiseTextInputEnd=function(t,e){this.onTextInputOperation.raise("notifyTextInputEnd",t,e)},t.prototype.raiseTextInputPermissionsCheck=function(t,e){this.onTextInputOperation.raise("notifyTextInputPermissionsCheck",t,e)},t.prototype.canFinishTextEditing=function(){return this.textInputHandler.canFinishTextEditing()},t}();e.EventManager=d},5689:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MouseHandler=void 0;var o=n(3250),i=n(6031),r=n(8900),s=n(4867),a=n(8032),c=n(7286),u=n(8502),h=n(2153),p=n(8675),l=function(){function t(t,e,n,o,i,r,s,a,c,u,h){this.history=t,this.selection=e,this.model=n,this.eventManager=o,this.readOnly=i,this.view=r,this.visualizerManager=s,this.contextToolboxHandler=a,this.shapeDescriptionManager=c,this.settings=u,this.permissionsProvider=h,this.finishStateLock=0,this.initialize(n),this.selection.onChanged.add(this)}return t.prototype.initialize=function(t){this.model=t,this.allowMultipleSelection=!0,this.allowCopyDiagramItems=!0,this.allowSnapToCellOnDragDiagramItem=!0,this.allowSnapToCellOnDragPoint=!0,this.allowSnapToCellOnResizeShape=!0,this.allowFixedDrag=!0,this.allowZoomOnWheel=!0,this.allowScrollPage=!0,this.shouldScrollPage=!1,this.copyDiagramItemsByCtrlAndShift=!1,this.startScrollingPageByCtrl=!1,this.initializeDefaultState()},t.prototype.initializeDefaultState=function(){this.defaultState=this.readOnly?p.EventUtils.isTouchMode()?new a.MouseHandlerDefaultReadOnlyTouchState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.shapeDescriptionManager,this.settings):new c.MouseHandlerDefaultReadOnlyState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.shapeDescriptionManager,this.settings):p.EventUtils.isTouchMode()?new u.MouseHandlerDefaultTouchState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.shapeDescriptionManager,this.settings):new o.MouseHandlerDefaultState(this,this.history,this.selection,this.model,this.view,this.visualizerManager,this.shapeDescriptionManager,this.settings),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)},t.prototype.onMouseClick=function(t){this.state.onMouseClick(t)},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.onKeyDown=function(t){this.state.onKeyDown(t)},t.prototype.onKeyUp=function(t){this.state.onKeyUp(t)},t.prototype.showContextToolbox=function(t,e,n,o,i,r){this.contextToolboxHandler.showContextToolbox(t,e,n,o,i,r)},t.prototype.hideContextToolbox=function(t){this.contextToolboxHandler.hideContextToolbox(t)},t.prototype.canScrollPage=function(t){return this.startScrollingPageByCtrl?!!this.hasCtrlModifier(t.modifiers)&&(!this.copyDiagramItemsByCtrlAndShift||!t.source.isConnector&&!t.source.isShape):this.allowScrollPage&&this.shouldScrollPage},t.prototype.canMultipleSelection=function(t){return this.allowMultipleSelection&&this.hasCtrlOrShiftModifier(t.modifiers)},t.prototype.canCopySelectedItems=function(t){return!!this.allowCopyDiagramItems&&(this.copyDiagramItemsByCtrlAndShift?this.hasCtrlAndShiftModifier(t.modifiers):this.hasAltModifier(t.modifiers))},t.prototype.canCalculateFixedPosition=function(t){return!(!this.allowFixedDrag||!this.hasShiftModifier(t.modifiers))&&(!this.copyDiagramItemsByCtrlAndShift||!this.hasCtrlModifier(t.modifiers))},t.prototype.canStartZoomOnWheel=function(t){return this.allowZoomOnWheel&&this.hasCtrlModifier(t.modifiers)},t.prototype.canFinishZoomOnWheel=function(t){return this.allowZoomOnWheel&&!this.hasCtrlModifier(t.modifiers)},t.prototype.onStartScrollPageByKeyboard=function(t){this.canStartScrollingPageByKeyboard(t)&&(this.raiseDragScrollStart(),this.shouldScrollPage=!0)},t.prototype.onFinishScrollPageByKeyboard=function(t){this.canEndScrollingPageByKeyboard(t)&&this.finishScrollingPage()},t.prototype.onFinishScrollPageByMouse=function(t){this.canEndScrollingPage(t)&&this.finishScrollingPage()},t.prototype.finishScrollingPage=function(){this.shouldScrollPage=!1,this.raiseDragScrollEnd(),this.switchToDefaultState()},t.prototype.hasCtrlOrShiftModifier=function(t){return this.hasCtrlModifier(t)||this.hasShiftModifier(t)},t.prototype.hasCtrlAndShiftModifier=function(t){return this.hasCtrlModifier(t)&&this.hasShiftModifier(t)},t.prototype.hasCtrlModifier=function(t){return(t&h.ModifierKey.Ctrl)>0},t.prototype.hasAltModifier=function(t){return(t&h.ModifierKey.Alt)>0},t.prototype.hasShiftModifier=function(t){return(t&h.ModifierKey.Shift)>0},t.prototype.canStartScrollingPageByKeyboard=function(t){return!this.startScrollingPageByCtrl&&!this.shouldScrollPage&&t.keyCode===h.KeyCode.Space},t.prototype.canEndScrollingPageByKeyboard=function(t){return!this.startScrollingPageByCtrl&&t.keyCode===h.KeyCode.Space},t.prototype.canEndScrollingPage=function(t){return!this.startScrollingPageByCtrl||this.hasCtrlModifier(t.modifiers)},t.prototype.getSnappedPointOnDragDiagramItem=function(t,e,n,o,i){var s=this.getSnapToCellOnDragDiagramItem(t);return new r.Point(this.getSnappedPos(this.getFixedXPosition(t,e,n,i),!0,s),this.getSnappedPos(this.getFixedYPosition(t,e,o,i),!1,s))},t.prototype.getSnappedPointOnDragPoint=function(t,e,n){var o=this.getSnapToCellOnDragPoint(t),i=this.getSnappedPos(e.x,!0,o),s=this.getSnappedPos(e.y,!1,o);return void 0===n||Math.pow(e.x-i,2)+Math.pow(e.y-s,2)1&&t===i.MouseButton.Left&&this.selection.remove(e)},t.prototype.changeSingleSelection=function(t){this.selection.hasKey(t)||this.selection.set([t])},t.prototype.notifySelectionChanged=function(t){this.pressedDiagramItemKey&&!this.selection.hasKey(this.pressedDiagramItemKey)&&(this.pressedDiagramItemKey=void 0,this.pressedDiagramItemInSelection=!1)},t.prototype.raiseDragStart=function(t){this.eventManager.onDocumentDragStart(t)},t.prototype.raiseDragEnd=function(t){this.eventManager.onDocumentDragEnd(t)},t.prototype.raiseDragScrollStart=function(){this.eventManager.onDocumentDragScrollStart()},t.prototype.raiseDragScrollEnd=function(){this.eventManager.onDocumentDragScrollEnd()},t.prototype.raiseClick=function(t){this.eventManager.onDocumentClick(t)},t.prototype.beginStorePermissions=function(){this.permissionsProvider.beginStorePermissions()},t.prototype.endStorePermissions=function(){this.permissionsProvider.endStorePermissions()},t.prototype.isStoredPermissionsGranted=function(){return this.permissionsProvider.isStoredPermissionsGranted()},t.prototype.lockPermissions=function(){this.permissionsProvider.lockPermissions()},t.prototype.unlockPermissions=function(){this.permissionsProvider.unlockPermissions()},t.prototype.canPerformChangeConnection=function(t,e){var n=!0;return t?n=this.permissionsProvider.canChangeConnection(t,e.item,e.oldItem,e.position,e.connectionPointIndex):e.item&&(n=this.permissionsProvider.canChangeConnection(void 0,e.item,e.oldItem,e.position,e.connectionPointIndex)),n},t.prototype.canPerformChangeConnectionOnUpdateUI=function(t,e){this.permissionsProvider.beginUpdateUI();var n=this.canPerformChangeConnection(t,e);return this.permissionsProvider.endUpdateUI(),n},t.prototype.canFinishTextEditing=function(){return this.eventManager.canFinishTextEditing()},t.prototype.restartState=function(){this.state&&!this.finishStateLock&&(this.finishStateLock++,this.state.finish(),this.finishStateLock--),this.state.start()},t.prototype.switchToDefaultState=function(){this.switchState(this.defaultState)},t.prototype.switchState=function(t){this.newState=t,this.state&&!this.finishStateLock&&(this.finishStateLock++,this.state.finish(),this.finishStateLock--),this.newState&&(this.state=this.newState,this.state.start(),this.newState=void 0)},t.prototype.addInteractingItem=function(t,e){this.permissionsProvider.addInteractingItem(t,e)},t.prototype.clearInteractingItems=function(){this.permissionsProvider.clearInteractingItems()},t.prototype.notifyReadOnlyChanged=function(t){this.readOnly=t,this.initializeDefaultState()},t.prototype.notifySelectionRectShow=function(t){},t.prototype.notifySelectionRectHide=function(){},t.prototype.notifyResizeInfoShow=function(t,e){},t.prototype.notifyResizeInfoHide=function(){},t.prototype.notifyConnectionPointsShow=function(t,e,n,o){this.state.onConnectionPointsShow(t,e)},t.prototype.notifyConnectionPointsHide=function(){},t.prototype.notifyConnectionTargetShow=function(t,e){this.state.onConnectionTargetShow(t,e)},t.prototype.notifyConnectionTargetHide=function(){},t.prototype.notifyContainerTargetShow=function(t,e){},t.prototype.notifyContainerTargetHide=function(){},t.prototype.notifyExtensionLinesShow=function(t){},t.prototype.notifyExtensionLinesHide=function(){},t}();e.MouseHandler=l},5627:function(t,e,n){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])},o(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}),e.MouseHandlerCreateConnectorState=void 0;var r=n(7959),s=n(3477),a=n(9603),c=n(3742),u=n(7060),h=n(4297),p=n(4145),l=n(4867),d=n(8930),f=n(9143),y=function(t){function e(e,n,o,i,r,s,a){var c=t.call(this,e,n,o,i)||this;return c.shapeDescriptionManager=r,c.selection=s,c.connectionPointIndex=a,c}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.onMouseUp=function(e){this.connector&&!this.connector.endItem&&this.createNewShapeAtConnectorEnd(e),t.prototype.onMouseUp.call(this,e)},e.prototype.onApplyChanges=function(e){var n=this.getSnappedPoint(e,e.modelPoint);if(this.connector)t.prototype.onApplyChanges.call(this,e);else{var o=new a.AddConnectorHistoryItem([this.connectedItem.getConnectionPointPosition(this.connectionPointIndex,n),n]);this.history.addAndRedo(o),this.connector=this.model.findConnector(o.connectorKey),this.handler.addInteractingItem(this.connector),this.history.addAndRedo(new s.AddConnectionHistoryItem(this.connector,this.connectedItem,this.connectionPointIndex,r.ConnectorPosition.Begin)),l.ModelUtils.updateNewConnectorProperties(this.history,this.selection,this.connector.key)}},e.prototype.checkStoredPermissionsOnFinish=function(){this.connector&&this.connector.endItem&&t.prototype.checkStoredPermissionsOnFinish.call(this)},e.prototype.onFinishWithChanges=function(){t.prototype.onFinishWithChanges.call(this),this.history.addAndRedo(new h.SetSelectionHistoryItem(this.selection,[this.connector.key]))},e.prototype.createNewShapeAtConnectorEnd=function(t){var e=this,n=this.connector&&this.connector.beginItem;if(n)if(!this.connector||this.handler.canPerformChangeConnection(this.connector,{position:r.ConnectorPosition.End,connectionPointIndex:-1})){var o=this.getNewShapeSide(this.connector),i=this.getSnappedPoint(t,t.modelPoint),a=this.shapeDescriptionManager.getCategoryByDescription(n.description);this.handler.showContextToolbox(i,(function(n){var r=n.clone();r.position=i.clone();var s=e.getNewShapePosition(r,o);return e.handler.getSnappedPointOnDragPoint(t,s)}),o,a,(function(n){if(n){e.handler.beginStorePermissions(),e.history.beginTransaction();var a=new p.AddShapeHistoryItem(e.shapeDescriptionManager.get(n),i);e.history.addAndRedo(a);var c=e.model.findShape(a.shapeKey),u=e.targetItem&&e.model.findNearestContainer(e.targetItem.key);u&&l.ModelUtils.insertToContainer(e.history,e.model,c,u);var d=e.getNewShapePosition(c,o);l.ModelUtils.setShapePosition(e.history,e.model,c,e.getSnappedPoint(t,d)),l.ModelUtils.updateNewShapeProperties(e.history,e.selection,c.key),e.history.addAndRedo(new s.AddConnectionHistoryItem(e.connector,c,c.getConnectionPointIndexForSide(o),r.ConnectorPosition.End)),u&&l.ModelUtils.updateConnectorContainer(e.history,e.model,e.connector),l.ModelUtils.updateShapeAttachedConnectors(e.history,e.model,c),e.handler.isStoredPermissionsGranted()?(e.handler.tryUpdateModelSize(),e.history.addAndRedo(new h.SetSelectionHistoryItem(e.selection,[c.key]))):(e.handler.lockPermissions(),e.history.undoTransaction(),e.handler.unlockPermissions(),e.checkNewConnectorPermissions()),e.history.endTransaction(),e.handler.endStorePermissions(),e.handler.hideContextToolbox(!0)}}),(function(){e.checkNewConnectorPermissions()}))}else this.cancelChanges()},e.prototype.checkNewConnectorPermissions=function(){this.connector&&!this.handler.canPerformChangeConnection(this.connector,{position:r.ConnectorPosition.End,connectionPointIndex:-1})&&(this.handler.lockPermissions(),this.history.beginTransaction(),this.history.addAndRedo(new h.SetSelectionHistoryItem(this.selection,[])),this.connector.beginItem&&this.history.addAndRedo(new d.DeleteConnectionHistoryItem(this.connector,r.ConnectorPosition.Begin)),this.connector.endItem&&this.history.addAndRedo(new d.DeleteConnectionHistoryItem(this.connector,r.ConnectorPosition.End)),this.history.addAndRedo(new f.DeleteConnectorHistoryItem(this.connector.key)),this.history.endTransaction(),this.handler.unlockPermissions())},e.prototype.getNewShapePosition=function(t,e){switch(e){case c.ConnectionPointSide.North:return t.position.clone().offset(-t.size.width/2,0);case c.ConnectionPointSide.South:return t.position.clone().offset(-t.size.width/2,-t.size.height);case c.ConnectionPointSide.East:return t.position.clone().offset(-t.size.width,-t.size.height/2);case c.ConnectionPointSide.West:return t.position.clone().offset(0,-t.size.height/2)}},e.prototype.getNewShapeSide=function(t){var n=t.getRenderPoints();return e.getNewShapeSideByConnectorPoints(n[n.length-1],n[n.length-2])},e.prototype.getSourceItem=function(){return this.connectedItem},e.getNewShapeSideByConnectorPoints=function(t,e){return t.x===e.x?t.y>e.y?c.ConnectionPointSide.North:c.ConnectionPointSide.South:t.x>e.x?t.y===e.y?c.ConnectionPointSide.West:t.y>e.y?Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?c.ConnectionPointSide.West:c.ConnectionPointSide.North:Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?c.ConnectionPointSide.West:c.ConnectionPointSide.South:t.y===e.y?c.ConnectionPointSide.East:t.y>e.y?Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?c.ConnectionPointSide.East:c.ConnectionPointSide.North:Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?c.ConnectionPointSide.East:c.ConnectionPointSide.South},e}(u.MouseHandlerMoveConnectorPointStateBase);e.MouseHandlerCreateConnectorState=y},7286:function(t,e,n){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])},o(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}),e.MouseHandlerDefaultReadOnlyState=void 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.canExpandContainerOnMouseDown=function(t){return!1},e.prototype.canClearSelectionOnMouseDown=function(){return!1},e.prototype.canSelectOnMouseUp=function(t){return!0},e.prototype.canClearSelectionOnMouseUp=function(){return!0},e.prototype.updateConnectionsOnMouseMove=function(t){},e}(n(8213).MouseHandlerDefaultStateBase);e.MouseHandlerDefaultReadOnlyState=r},8032:function(t,e,n){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])},o(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}),e.MouseHandlerDefaultReadOnlyTouchState=void 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.canExpandContainerOnMouseDown=function(t){return!1},e.prototype.canClearSelectionOnMouseDown=function(){return!0},e.prototype.canSelectOnMouseUp=function(t){return!this.inSelection(t)},e.prototype.canClearSelectionOnMouseUp=function(){return!1},e}(n(7286).MouseHandlerDefaultReadOnlyState);e.MouseHandlerDefaultReadOnlyTouchState=r},3250:function(t,e,n){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])},o(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}),e.MouseHandlerDefaultState=void 0;var r=n(6031),s=n(4402),a=n(5609),c=n(481),u=n(4908),h=n(5627),p=n(5209),l=n(6918),d=n(5391),f=n(8213),y=n(9979),g=n(7959),m=n(5168),v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.finish=function(){this.visualizerManager.resetConnectionPoints(),t.prototype.finish.call(this)},e.prototype.onMouseDownCore=function(e){this.handler.canScrollPage(e)?this.startScrolling(e):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ConnectorText?(this.handler.changeSingleSelection(e.source.key),this.handler.switchState(new d.MouseHandlerMoveConnectorTextState(this.handler,this.history,this.model))):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ShapeResizeBox?this.handler.switchState(new a.MouseHandlerResizeShapeState(this.handler,this.history,this.model,this.selection,this.visualizerManager,this.settings)):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ShapeParameterBox?this.handler.switchState(new u.MouseHandlerDragParameterPointState(this.handler,this.history,this.model)):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ConnectorPoint?this.handler.switchState(new s.MouseHandlerMoveConnectorPointState(this.handler,this.history,this.model,this.visualizerManager)):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ConnectorSide?this.handler.switchState(new c.MouseHandlerMoveConnectorSideState(this.handler,this.history,this.model)):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ConnectorOrthogonalSide?this.handler.switchState(new p.MouseHandlerMoveConnectorOrthogonalSideState(this.handler,this.history,this.model)):e.button===r.MouseButton.Left&&e.source.type===r.MouseEventElementType.ShapeConnectionPoint?this.handler.switchState(new h.MouseHandlerCreateConnectorState(this.handler,this.history,this.model,this.visualizerManager,this.shapeDescriptionManager,this.selection)):t.prototype.onMouseDownCore.call(this,e)},e.prototype.onDragDiagramItemOnMouseDown=function(e){this.handler.canAddDiagramItemToSelection(e)?e.source.isShape?this.handler.switchState(new y.MouseHandlerMoveShapeState(this.handler,this.history,this.model,this.selection,this.visualizerManager)):e.source.isConnector&&this.handler.switchState(new m.MouseHandlerMoveConnectorState(this.handler,this.history,this.model,this.selection,this.visualizerManager)):t.prototype.onDragDiagramItemOnMouseDown.call(this,e)},e.prototype.onDragStart=function(t){this.handler.switchState(new l.MouseHandlerBeforeToolboxDraggingState(this.handler,this.history,this.model,this.selection,this.visualizerManager,this.shapeDescriptionManager)),this.handler.state.onDragStart(t)},e.prototype.onMouseMoveCore=function(e){this.updateConnectionsOnMouseMove(e),t.prototype.onMouseMoveCore.call(this,e)},e.prototype.onMouseUp=function(e){this.handler.canRemoveDiagramItemToSelection(e)?this.handler.removeDiagramItemFromSelection(e.button,e.source.key):t.prototype.onMouseUp.call(this,e)},e.prototype.updateConnectionsOnMouseMove=function(t){var e=this.model.findItem(t.source.key);this.visualizerManager.updateConnections(e,t.source.type,t.source.value)},e.prototype.canDragObjectOnMouseDown=function(t){return!0},e.prototype.canExpandContainerOnMouseDown=function(t){return!0},e.prototype.canClearSelectionOnMouseDown=function(){return!1},e.prototype.canSelectOnMouseUp=function(t){return!1},e.prototype.canClearSelectionOnMouseUp=function(){return!0},e.prototype.onConnectionPointsShow=function(t,e){var n=this,o=this.model.findShape(t);o&&e.forEach((function(t,e){t.allowed=n.handler.canPerformChangeConnectionOnUpdateUI(void 0,{item:o,position:g.ConnectorPosition.Begin,connectionPointIndex:e})}))},e}(f.MouseHandlerDefaultStateBase);e.MouseHandlerDefaultState=v},8213:function(t,e,n){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])},o(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}),e.MouseHandlerDefaultStateBase=void 0;var r=n(5434),s=n(6031),a=n(5752),c=n(4869),u=n(7189),h=n(9582),p=n(9291),l=n(8461),d=function(t){function e(e,n,o,i,r,s,a,c){var u=t.call(this,e)||this;return u.history=n,u.selection=o,u.model=i,u.view=r,u.visualizerManager=s,u.shapeDescriptionManager=a,u.settings=c,u}return i(e,t),e.prototype.onKeyDown=function(t){this.handler.onStartScrollPageByKeyboard(t)},e.prototype.onKeyUp=function(t){this.handler.onFinishScrollPageByKeyboard(t)},e.prototype.onMouseDown=function(t){this.handler.canFinishTextEditing()&&(this.onMouseDownCore(t),this.handler.state!==this&&this.handler.state.onMouseDown(t))},e.prototype.onMouseDownCore=function(t){this.handler.canScrollPage(t)?this.startScrolling(t):this.hasDiagramItem(t)&&this.canDragObjectOnMouseDown(t.source.key)?this.onDragDiagramItemOnMouseDown(t):t.button===s.MouseButton.Left&&t.source.type===s.MouseEventElementType.ShapeExpandButton&&this.canExpandContainerOnMouseDown(t.source.key)?this.onShapeExpandBtnMouseDown(t):(!this.hasDiagramItem(t)&&this.canClearSelectionOnMouseDown()&&this.clearSelection(),this.startPoint=t.modelPoint)},e.prototype.onDragDiagramItemOnMouseDown=function(t){this.replaceSelection(t)},e.prototype.onMouseMove=function(t){this.onMouseMoveCore(t),this.handler.state!==this&&(this.handler.state.onMouseDown(this.handler.mouseDownEvent),this.handler.state.onMouseMove(t))},e.prototype.onMouseMoveCore=function(t){this.startPoint&&(Math.abs(this.startPoint.x-t.modelPoint.x)>e.startLimit||Math.abs(this.startPoint.y-t.modelPoint.y)>e.startLimit)&&(this.processOnMouseMoveAfterLimit(t),this.startPoint=void 0)},e.prototype.processOnMouseMoveAfterLimit=function(t){t.isTouchMode?t.touches.length>1?this.startZooming(t):this.startScrolling(t):this.startSelection(t)},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)||t.source.type===s.MouseEventElementType.Connector&&this.canSelectOnMouseUp(t.source.key)||t.source.type===s.MouseEventElementType.ShapeExpandButton&&this.canSelectOnMouseUp(t.source.key)?this.replaceSelection(t):this.startPoint&&this.canClearSelectionOnMouseUp()&&this.clearSelection(),this.startPoint=void 0},e.prototype.onMouseWheel=function(t){return!!this.handler.canStartZoomOnWheel(t)&&(this.handler.switchState(new u.MouseHandlerZoomOnWheelState(this.handler,this.settings,this.view)),this.handler.state.onMouseWheel(t),!0)},e.prototype.onLongTouch=function(t){this.replaceMultipleSelection(t.source.key)},e.prototype.finish=function(){this.startPoint=void 0},e.prototype.startSelection=function(t){t.button===s.MouseButton.Left&&this.handler.switchState(new c.MouseHandlerSelectionState(this.handler,this.selection,this.visualizerManager))},e.prototype.startScrolling=function(t){t.button===s.MouseButton.Left&&(this.handler.raiseDragScrollStart(),this.handler.switchState(new h.MouseHandlerScrollingState(this.handler,this.view,this.selection)))},e.prototype.startZooming=function(t){this.handler.switchState(new l.MouseHandlerZoomOnPinchState(this.handler,this.selection,this.settings,this.view))},e.prototype.inSelection=function(t){return this.selection.hasKey(t)},e.prototype.hasDiagramItem=function(t){return t.source.isShape||t.source.isConnector},e.prototype.onShapeExpandBtnMouseDown=function(t){this.handler.addDiagramItemToSelection(t),this.handler.switchState(new a.MouseHandlerToggleShapeExpandedState(this.handler,this.history,this.model,this.selection))},e.prototype.replaceSelection=function(t){this.handler.canMultipleSelection(t)?this.replaceMultipleSelection(t.source.key):this.handler.changeSingleSelection(t.source.key)},e.prototype.replaceMultipleSelection=function(t){this.selection.hasKey(t)?this.selection.remove(t):this.selection.add(t)},e.prototype.clearSelection=function(){this.selection.set([])},e.startLimit=p.UnitConverter.pixelsToTwips(1),e}(r.MouseHandlerStateBase);e.MouseHandlerDefaultStateBase=d},8502:function(t,e,n){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])},o(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}),e.MouseHandlerDefaultTouchState=void 0;var r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.updateConnectionsOnMouseMove=function(t){},e.prototype.canDragObjectOnMouseDown=function(t){return this.inSelection(t)},e.prototype.canExpandContainerOnMouseDown=function(t){return!0},e.prototype.canClearSelectionOnMouseDown=function(){return!0},e.prototype.canSelectOnMouseUp=function(t){return!this.inSelection(t)},e.prototype.canClearSelectionOnMouseUp=function(){return!1},e}(n(3250).MouseHandlerDefaultState);e.MouseHandlerDefaultTouchState=r},1717:function(t,e,n){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])},o(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}),e.MouseHandlerDragDiagramItemStateBase=e.DraggingConnector=void 0;var r=n(4867),s=n(6879),a=n(6031),c=n(8816),u=n(4742),h=function(t){this.connector=t,this.startPoints=t.points.map((function(t){return t.clone()})),this.startRenderContext=t.tryCreateRenderPointsContext()};e.DraggingConnector=h;var p=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n)||this;return s.model=o,s.selection=i,s.visualizerManager=r,s.startScrollLeft=0,s.startScrollTop=0,s}return i(e,t),e.prototype.finish=function(){var e;null===(e=this.dragHelper)||void 0===e||e.finish(),this.visualizerManager.resetExtensionLines(),this.visualizerManager.resetContainerTarget(),this.visualizerManager.resetConnectionTarget(),this.visualizerManager.resetConnectionPoints(),t.prototype.finish.call(this)},e.prototype.onMouseDown=function(e){this.handler.addDiagramItemToSelection(e),this.shouldClone=this.handler.canCopySelectedItems(e),this.startPoint=e.modelPoint,this.initDrag(),this.lockInitDrag=!1,t.prototype.onMouseDown.call(this,e)},e.prototype.onMouseMove=function(t){if(this.mouseMoveEvent=t,t.button!==a.MouseButton.Left)return this.cancelChanges(),void this.handler.switchToDefaultState();this.canApplyChangesOnMouseMove(this.startPoint,t.modelPoint)&&(this.handler.canCopySelectedItems(t)&&(this.lockInitDrag||(this.cancelChanges(),this.shouldClone=!0,this.copySelection(),this.initDrag(),this.lockInitDrag=!0)),this.onApplyChanges(t),this.onAfterApplyChanges(),this.updateContainers(t))},e.prototype.updateContainers=function(t){this.visualizerManager.setExtensionLines(this.selection.getSelectedShapes(!1,!0));var e=r.ModelUtils.findContainerByEventKey(this.model,this.selection,t.source.key);e&&this.allowInsertToContainer(t,e)?this.visualizerManager.setContainerTarget(e,t.source.type):this.visualizerManager.resetContainerTarget()},e.prototype.onMouseUp=function(e){t.prototype.onMouseUp.call(this,e),this.handler.canRemoveDiagramItemToSelection(e)&&this.handler.canMultipleSelection(e)&&this.handler.removeDiagramItemFromSelection(e.button,e.source.key)},e.prototype.onApplyChanges=function(t){var e=this;this.calculateFixedPosition(t),this.dragHelper.move(this.shouldClone,(function(n){return e.getSnappedPoint(t,n)}),(function(){e.visualizerManager.resetConnectionTarget(),e.visualizerManager.resetConnectionPoints()}),(function(t,n){e.visualizerManager.setConnectionTarget(t,a.MouseEventElementType.Shape),e.visualizerManager.setConnectionPoints(t,a.MouseEventElementType.Shape,n,!0)}));var n=r.ModelUtils.findContainerByEventKey(this.model,this.selection,t.source.key);n&&this.allowInsertToContainer(t,n)?r.ModelUtils.insertSelectionToContainer(this.history,this.model,this.selection,n):r.ModelUtils.removeSelectionFromContainer(this.history,this.model,this.selection),this.handler.tryUpdateModelSize((function(t,n){return e.dragHelper.onTryUpdateModelSize(t,n)}))},e.prototype.getDraggingElementKeys=function(){return this.dragHelper.draggingShapes.map((function(t){return t.shape.key})).concat(this.dragHelper.draggingConnectors.map((function(t){return t.connector.key})))},e.prototype.getSnappedPoint=function(t,e){return this.handler.getSnappedPointOnDragDiagramItem(t,e,this.fixedX,this.fixedY,this.startPoint)},e.prototype.initDrag=function(){this.dragHelper=new u.SelectionDragHelper(this.history,this.model,this.handler.permissionsProvider,this.startPoint,this.selection.getSelectedItems(!0)),this.initDraggingShapes(),this.areValidDraggingShapes?(this.initDraggingConnectors(),this.areValidDraggingConnectors||this.handler.switchToDefaultState()):this.handler.switchToDefaultState()},e.prototype.initDraggingShapes=function(){this.dragHelper.initDraggingShapes(this.selection.getSelectedShapes(!1,!0),this.shouldClone)},e.prototype.initDraggingConnectors=function(){this.dragHelper.initDraggingConnectors(this.selection.getSelectedConnectors(!1,!0),this.shouldClone)},e.prototype.copySelection=function(){var t=this;r.ModelUtils.cloneSelectionToOffset(this.history,this.model,(function(e){var n=t.model.findItem(e);n&&t.handler.addInteractingItem(n,s.DiagramModelOperation.AddShape)}),this.selection,0,0)},e.prototype.calculateFixedPosition=function(t){(this.fixedX=!1,this.fixedY=!1,this.handler.canCalculateFixedPosition(t))&&(Math.abs(this.startPoint.x-t.modelPoint.x)e.dragStartLimit||Math.abs(t.y-n.y)>e.dragStartLimit},e.prototype.onAfterApplyChanges=function(){this.modified||this.handler.raiseDragStart(this.getDraggingElementKeys()),this.modified=!0,this.mouseDownPoint=void 0},e.prototype.onMouseDown=function(t){this.mouseDownPoint=t.modelPoint.clone()},e.prototype.onMouseMove=function(t){this.mouseMoveEvent=t,t.button!==s.MouseButton.Left?(this.cancelChanges(),this.handler.switchToDefaultState()):t.button===s.MouseButton.Left&&this.canApplyChangesOnMouseMove(this.mouseDownPoint,t.modelPoint)&&(this.onApplyChanges(t),this.onAfterApplyChanges())},e.prototype.onKeyDown=function(t){!this.mouseMoveEvent||16!==t.keyCode&&17!==t.keyCode&&18!==t.keyCode||this.performMouseMoveEvent(t.modifiers)},e.prototype.onKeyUp=function(t){!this.mouseMoveEvent||16!==t.keyCode&&17!==t.keyCode&&18!==t.keyCode||this.performMouseMoveEvent(t.modifiers)},e.prototype.onMouseUp=function(t){this.mouseDownPoint=void 0,this.mouseMoveEvent=void 0,this.handler.switchToDefaultState()},e.prototype.performMouseMoveEvent=function(t){this.mouseMoveEvent.modifiers=t,this.onMouseMove(this.mouseMoveEvent)},e.prototype.start=function(){this.handler.beginStorePermissions(),this.history.beginTransaction()},e.prototype.finish=function(){this.checkStoredPermissionsOnFinish(),this.modified?(this.onFinishWithChanges(),this.modified=!1,this.history.endTransaction(),this.handler.raiseDragEnd(this.getDraggingElementKeys())):this.history.endTransaction(),this.handler.endStorePermissions(),this.handler.clearInteractingItems()},e.prototype.checkStoredPermissionsOnFinish=function(){this.handler.isStoredPermissionsGranted()||(this.cancelChanges(),this.modified=!1)},e.prototype.onFinishWithChanges=function(){},e.prototype.cancelChanges=function(){this.handler.lockPermissions(),this.history.undoTransaction(),this.handler.unlockPermissions(),this.modified&&this.handler.raiseDragEnd(this.getDraggingElementKeys()),this.modified=!1},e.prototype.getSnappedPoint=function(t,e){return this.handler.getSnappedPointOnDragPoint(t,e)},e.dragStartLimit=a.UnitConverter.pixelsToTwips(4),e}(r.MouseHandlerCancellableState);e.MouseHandlerDraggingState=c},5209:function(t,e,n){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])},o(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}),e.MouseHandlerMoveConnectorOrthogonalSideState=void 0;var r=n(8900),s=n(7959),a=n(3742),c=n(4867),u=n(8816),h=n(8675),p=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.model=o,i.canCreatePoints=!0,i}return i(e,t),e.prototype.saveSidePoints=function(t,e){var n=this,o=this.connector.getRenderPoints(!0);this.isHorizontal=o[t].y===o[e].y,this.iterateRenderPoints(o,t,!1,(function(t,e){-1!==t.pointIndex&&(n.leftPointIndex=t.pointIndex),n.leftRenderPointIndex=e}),(function(e){return!h.GeometryUtils.arePointsOfOrthogonalLine(o[t],e,n.isHorizontal)})),this.iterateRenderPoints(o,this.leftRenderPointIndex,!0,(function(t,e){-1!==t.pointIndex&&(n.rightPointIndex=t.pointIndex),n.rightRenderPointIndex=e}),(function(e){return!h.GeometryUtils.arePointsOfOrthogonalLine(o[t],e,n.isHorizontal)}))},e.prototype.iterateRenderPoints=function(t,e,n,o,i){for(var r=e;n?r=0;n?r++:r--){var s=t[r];if(i&&i(s,r))break;o(s,r)}},e.prototype.onMouseDown=function(e){this.startPoint=e.modelPoint,this.connector=this.model.findConnector(e.source.key),this.handler.addInteractingItem(this.connector);var n=e.source.value.split("_");this.saveSidePoints(parseInt(n[0]),parseInt(n[1])),t.prototype.onMouseDown.call(this,e)},e.prototype.shouldCreatePoint=function(t){if(!this.canCreatePoints)return!1;if(t&&(void 0===this.leftPointIndex||0===this.leftPointIndex))return!0;if(!t&&(void 0===this.rightPointIndex||this.rightPointIndex===this.connector.points.length-1))return!0;var e=this.connector.getRenderPoints(!0);return!(!t||this.connector.points[this.leftPointIndex].equals(e[this.leftRenderPointIndex]))||!t&&!this.connector.points[this.rightPointIndex].equals(e[this.rightRenderPointIndex])},e.prototype.onApplyChanges=function(t){var e=this;if(this.shouldCreatePoint(!0)||this.shouldCreatePoint(!1)){var n=this.connector.getRenderPoints(!0),o=n[this.leftRenderPointIndex],i=n[this.rightRenderPointIndex];if(this.shouldCreatePoint(!0)){var s=new r.Point(o.x,o.y);0===this.leftPointIndex?(this.leftPointIndex=1,this.correctEdgePoint(s,i,this.connector.beginItem,this.connector.beginConnectionPointIndex)):void 0===this.leftPointIndex&&this.iterateRenderPoints(n,this.leftRenderPointIndex,!0,(function(t){-1!==t.pointIndex&&(e.leftPointIndex=t.pointIndex)}),(function(){return void 0!==e.leftPointIndex})),c.ModelUtils.addConnectorPoint(this.history,this.connector.key,this.leftPointIndex,s),void 0!==this.rightPointIndex&&this.rightPointIndex++}if(this.shouldCreatePoint(!1)){n=this.connector.getRenderPoints(!0);var a=new r.Point(i.x,i.y);this.rightPointIndex===this.connector.points.length-1?(this.correctEdgePoint(a,o,this.connector.endItem,this.connector.endConnectionPointIndex),this.rightPointIndex--):void 0===this.rightPointIndex&&this.iterateRenderPoints(n,this.rightRenderPointIndex,!1,(function(t){-1!==t.pointIndex&&(e.rightPointIndex=t.pointIndex)}),(function(){return e.rightPointIndex===e.leftPointIndex})),this.rightPointIndex++,c.ModelUtils.addConnectorPoint(this.history,this.connector.key,this.rightPointIndex,a)}}this.canCreatePoints=!1;var u=this.getSnappedPoint(t,t.modelPoint);c.ModelUtils.moveConnectorRightAnglePoints(this.history,this.connector,this.leftPointIndex,this.rightPointIndex,this.isHorizontal?void 0:u.x,this.isHorizontal?u.y:void 0),this.handler.tryUpdateModelSize()},e.prototype.onFinishWithChanges=function(){c.ModelUtils.deleteConnectorUnnecessaryPoints(this.history,this.connector),c.ModelUtils.fixConnectorBeginEndConnectionIndex(this.history,this.connector),this.handler.tryUpdateModelSize()},e.prototype.correctEdgePoint=function(t,e,n,o){var i=0;if(n){var r=n.getConnectionPointSideByIndex(o),c=n.rectangle;switch(i=s.Connector.minOffset,r){case a.ConnectionPointSide.South:i+=c.bottom-t.y;break;case a.ConnectionPointSide.North:i+=t.y-c.y;break;case a.ConnectionPointSide.East:i+=c.right-t.x;break;case a.ConnectionPointSide.West:i+=t.x-c.x}}this.isHorizontal?t.x>e.x?t.x-=Math.min(i,t.x-e.x):t.x+=Math.min(i,e.x-t.x):t.y>e.y?t.y-=Math.min(i,t.y-e.y):t.y+=Math.min(i,e.y-t.y)},e.prototype.getDraggingElementKeys=function(){return[this.connector.key]},e}(u.MouseHandlerDraggingState);e.MouseHandlerMoveConnectorOrthogonalSideState=p},4402:function(t,e,n){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])},o(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}),e.MouseHandlerMoveConnectorPointState=void 0;var r=n(8900),s=n(7060),a=n(7959),c=n(4867),u=n(4612),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onMouseDown=function(e){this.connector=this.model.findConnector(e.source.key),this.pointIndex=parseInt(e.source.value),0===this.pointIndex?this.pointPosition=a.ConnectorPosition.Begin:this.pointIndex===this.connector.points.length-1&&(this.pointPosition=a.ConnectorPosition.End),this.handler.addInteractingItem(this.connector),t.prototype.onMouseDown.call(this,e)},e.prototype.onApplyChanges=function(e){this.connector.properties.lineOption===u.ConnectorLineOption.Orthogonal&&0!==this.pointIndex&&this.pointIndex!==this.connector.points.length-1||t.prototype.onApplyChanges.call(this,e)},e.prototype.onFinishWithChanges=function(){t.prototype.onFinishWithChanges.call(this),c.ModelUtils.deleteConnectorUnnecessaryPoints(this.history,this.connector),this.handler.tryUpdateModelSize()},e.prototype.getSnappedPoint=function(t,e){var n=this.connector.points,o=this.pointIndex;if(00||this.dragHelper.draggingConnectors.length>0:!!this.dragHelper.draggingConnectors.length&&(this.dragHelper.draggingShapes.length?r.ModelUtils.canMoveConnector(this.dragHelper.selectedItems,this.dragHelper.draggingConnectors[this.dragHelper.draggingConnectorsIndexByKey[this.handler.mouseDownEvent.source.key]].connector):!this.dragHelper.draggingConnectors.some((function(e){return!r.ModelUtils.canMoveConnector(t.dragHelper.selectedItems,e.connector)})))},enumerable:!1,configurable:!0}),e}(n(1717).MouseHandlerDragDiagramItemStateBase);e.MouseHandlerMoveConnectorState=s},5391:function(t,e,n){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])},o(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}),e.MouseHandlerMoveConnectorTextState=void 0;var r=n(8816),s=n(45),a=n(5144),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},9979:function(t,e,n){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])},o(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}),e.MouseHandlerMoveShapeState=void 0;var r=function(t){function e(e,n,o,i,r){var s=t.call(this,e,n,o,i,r)||this;return s.model=o,s.selection=i,s.visualizerManager=r,s}return i(e,t),Object.defineProperty(e.prototype,"areValidDraggingShapes",{get:function(){return this.shouldClone||this.dragHelper.draggingShapes.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"areValidDraggingConnectors",{get:function(){return!0},enumerable:!1,configurable:!0}),e}(n(1717).MouseHandlerDragDiagramItemStateBase);e.MouseHandlerMoveShapeState=r},5609:function(t,e,n){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])},o(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}),e.MouseHandlerResizeShapeState=void 0;var r=n(6353),s=n(8900),a=n(6031),c=n(8816),u=n(4867),h=n(6794),p=n(6879),l=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,a.settings=s,a.startScrollLeft=0,a.startScrollTop=0,a.rotation=0,a}return i(e,t),e.prototype.finish=function(){this.visualizerManager.resetResizeInfo(),this.visualizerManager.resetExtensionLines(),t.prototype.finish.call(this)},e.prototype.onMouseDown=function(e){var n=this,o=parseInt(e.source.value);this.resizeEventSource=o,this.startPoint=e.modelPoint,this.lockH=o===a.ResizeEventSource.ResizeBox_S||o===a.ResizeEventSource.ResizeBox_N,this.lockV=o===a.ResizeEventSource.ResizeBox_E||o===a.ResizeEventSource.ResizeBox_W,this.sideH=o===a.ResizeEventSource.ResizeBox_E||o===a.ResizeEventSource.ResizeBox_NE||o===a.ResizeEventSource.ResizeBox_SE,this.sideV=o===a.ResizeEventSource.ResizeBox_SE||o===a.ResizeEventSource.ResizeBox_S||o===a.ResizeEventSource.ResizeBox_SW,this.shapes=this.selection.getSelectedShapes(),0!==this.shapes.length?(this.shapes.forEach((function(t){n.handler.addInteractingItem(t,p.DiagramModelOperation.ResizeShape),n.handler.addInteractingItem(t,p.DiagramModelOperation.MoveShape)})),this.connectors=this.selection.getSelectedConnectors(),this.startRectangle=u.ModelUtils.createRectangle(this.shapes),this.startShapeSizes=this.shapes.map((function(t){return t.size.clone()})),this.startShapePositions=this.shapes.map((function(t){return t.position.clone()})),this.startConnectorPoints=this.connectors.map((function(t){return t.points.map((function(t){return t.clone()}))})),t.prototype.onMouseDown.call(this,e)):this.handler.switchToDefaultState()},e.prototype.onMouseMove=function(e){t.prototype.onMouseMove.call(this,e);var n=this.selection.getSelectedShapes();this.visualizerManager.setExtensionLines(n)},e.prototype.onApplyChanges=function(t){var e=this,n=u.ModelUtils.createRectangle(this.shapes),o=1===this.shapes.length?this.shapes[0].getMinWidth(this.settings.shapeMinWidth):h.ShapeMinDimension,i=1===this.shapes.length?this.shapes[0].getMinHeight(this.settings.shapeMinHeight):h.ShapeMinDimension,a=1===this.shapes.length?this.shapes[0].getMaxWidth(this.settings.shapeMaxWidth):void 0,c=1===this.shapes.length?this.shapes[0].getMaxHeight(this.settings.shapeMaxHeight):void 0,p=this.getSize(t,n.createPosition(),this.startRectangle.createSize(),o,i,a,c,this.handler.lockAspectRatioOnShapeResize(t)),l=this.getPosition(t,p,this.startRectangle.createSize(),this.startRectangle.createPosition()),d=p.width/this.startRectangle.width,f=p.height/this.startRectangle.height;this.shapes.forEach((function(t,n){var o=e.startShapeSizes[n].width*(t.allowResizeHorizontally?d:1);o=e.getNormalizedSize(o,t.getMinWidth(e.settings.shapeMinWidth),t.getMaxWidth(e.settings.shapeMaxWidth));var i=e.startShapeSizes[n].height*(t.allowResizeVertically?f:1);i=e.getNormalizedSize(i,t.getMinHeight(e.settings.shapeMinHeight),t.getMaxHeight(e.settings.shapeMaxHeight));var a=t.allowResizeHorizontally?l.x+(e.startShapePositions[n].x-e.startRectangle.x)*d:e.startShapePositions[n].x,c=t.allowResizeVertically?l.y+(e.startShapePositions[n].y-e.startRectangle.y)*f:e.startShapePositions[n].y;u.ModelUtils.setShapeSize(e.history,e.model,t,new s.Point(a,c),new r.Size(o,i))})),this.connectors.forEach((function(t,n){for(var o=t.beginItem?1:0,i=t.endItem?t.points.length-2:t.points.length-1,r=o;r<=i;r++){var a=new s.Point(l.x+(e.startConnectorPoints[n][r].x-e.startRectangle.x)*d,l.y+(e.startConnectorPoints[n][r].y-e.startRectangle.y)*f);u.ModelUtils.moveConnectorPoint(e.history,t,r,a)}})),this.selection.getSelectedShapes(!1,!0).forEach((function(t){u.ModelUtils.updateShapeAttachedConnectors(e.history,e.model,t)})),this.tryUpdateModelSize(),this.visualizerManager.setResizeInfo(this.shapes)},e.prototype.tryUpdateModelSize=function(){var t=this;this.handler.tryUpdateModelSize((function(e,n){t.startShapePositions.forEach((function(t){t.x+=e,t.y+=n})),t.startConnectorPoints.forEach((function(t){t.forEach((function(t){t.x+=e,t.y+=n}))})),t.startRectangle.x+=e,t.startRectangle.y+=n,t.startPoint.x+=e,t.startPoint.y+=n}))},e.prototype.getDraggingElementKeys=function(){return this.shapes.map((function(t){return t.key}))},e.prototype.getNormalizedSize=function(t,e,n){return void 0!==e&&(t=Math.max(t,e)),void 0!==n&&(t=Math.min(t,n)),t},e.prototype.getSize=function(t,e,n,o,i,s,a,c){var u,h,p=t.modelPoint.x-(this.startScrollLeft-t.scrollX)-this.startPoint.x,l=t.modelPoint.y-(this.startScrollTop-t.scrollY)-this.startPoint.y,d=p*Math.cos(this.rotation)- -l*Math.sin(this.rotation),f=-(p*Math.sin(this.rotation)+-l*Math.cos(this.rotation));return f=!this.sideV&&f>0?Math.min(n.height+1,f):f,d=!this.sideH&&d>0?Math.min(n.width+1,d):d,this.lockH||this.lockV||!c?(d=this.lockH?0:d,f=this.lockV?0:f,u=this.getNormalizedSize(this.sideH?n.width+d:n.width-d,o,s),h=this.getNormalizedSize(this.sideV?n.height+f:n.height-f,i,a)):Math.abs(d)>Math.abs(f)?(u=this.getNormalizedSize(this.sideH?n.width+d:n.width-d,o,s),h=n.height*(u/n.width)):(h=this.getNormalizedSize(this.sideV?n.height+f:n.height-f,i,a),u=n.width*(h/n.height)),this.lockH||(u=this.getSnappedPosition(t,e.x+u,!0)-e.x),this.lockV||(h=this.getSnappedPosition(t,e.y+h,!1)-e.y),new r.Size(u,h)},e.prototype.getPosition=function(t,e,n,o){var i=o.x,r=o.y;if(this.resizeEventSource===a.ResizeEventSource.ResizeBox_N||this.resizeEventSource===a.ResizeEventSource.ResizeBox_NE||this.resizeEventSource===a.ResizeEventSource.ResizeBox_NW){r+=n.height-e.height;var c=this.getSnappedPosition(t,r,!1);e.height+=r-c,r=c}if(this.resizeEventSource===a.ResizeEventSource.ResizeBox_W||this.resizeEventSource===a.ResizeEventSource.ResizeBox_NW||this.resizeEventSource===a.ResizeEventSource.ResizeBox_SW){i+=n.width-e.width;var u=this.getSnappedPosition(t,i,!0);e.width+=i-u,i=u}return new s.Point(i,r)},e.prototype.getSnappedPosition=function(t,e,n){return this.handler.getSnappedPositionOnResizeShape(t,e,n)},e}(c.MouseHandlerDraggingState);e.MouseHandlerResizeShapeState=l},9582:function(t,e,n){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])},o(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}),e.MouseHandlerScrollingState=void 0;var r=n(5434),s=n(6031),a=n(8900),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.onKeyUp=function(t){this.handler.onFinishScrollPageByKeyboard(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.clone().offset(o.x,o.y),this.currentPoint=n}else this.handler.onFinishScrollPageByMouse(t)},e.prototype.onMouseUp=function(t){t.button===s.MouseButton.Left&&this.handler.onFinishScrollPageByMouse(t),this.handler.switchToDefaultState()},e.prototype.cancelChanges=function(){this.currentPoint&&this.view.scrollBy(this.lastOffset.clone().multiply(-1,-1))},e.prototype.finish=function(){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},4869:function(t,e,n){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])},o(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}),e.MouseHandlerSelectionState=void 0;var r=n(6031),s=n(8011),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.fromPoints(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(5434).MouseHandlerCancellableState);e.MouseHandlerSelectionState=a},5434:function(t,e,n){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])},o(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}),e.MouseHandlerCancellableState=e.MouseHandlerStateBase=void 0;var r=n(2153),s=function(){function t(t){this.handler=t}return t.prototype.start=function(){},t.prototype.finish=function(){},t.prototype.onMouseClick=function(t){},t.prototype.onMouseDblClick=function(t){this.handler.switchToDefaultState()},t.prototype.onMouseDown=function(t){},t.prototype.onMouseUp=function(t){},t.prototype.onMouseMove=function(t){},t.prototype.onMouseWheel=function(t){return!1},t.prototype.onDragStart=function(t){},t.prototype.onDragEnd=function(t){},t.prototype.onShortcut=function(t){return!1},t.prototype.onKeyDown=function(t){},t.prototype.onKeyUp=function(t){},t.prototype.onConnectionPointsShow=function(t,e){},t.prototype.onConnectionTargetShow=function(t,e){},t}();e.MouseHandlerStateBase=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.onShortcut=function(t){return t===r.KeyCode.Esc&&(this.cancelChanges(),this.handler.switchToDefaultState(),!0)},e}(s);e.MouseHandlerCancellableState=a},5752:function(t,e,n){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])},o(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}),e.MouseHandlerToggleShapeExpandedState=void 0;var r=n(5434),s=n(442),a=n(4867),c=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.history=n,r.model=o,r.selection=i,r}return i(e,t),e.prototype.onMouseUp=function(t){var e=this.model.findShape(t.source.key);e&&!e.isLocked&&(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),a.ModelUtils.updateSelection(this.history,this.selection),this.handler.tryUpdateModelSize(),this.history.endTransaction(),this.handler.raiseClick([e.key])),this.handler.switchToDefaultState()},e}(r.MouseHandlerStateBase);e.MouseHandlerToggleShapeExpandedState=c},6918:function(t,e,n){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])},o(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}),e.MouseHandlerToolboxDraggingState=e.MouseHandlerBeforeToolboxDraggingState=void 0;var r=n(6031),s=n(8900),a=n(4145),c=n(4297),u=n(8816),h=n(1704),p=n(4867),l=n(5434),d=n(6879),f=function(t){function e(e,n,o,i,r,s){var a=t.call(this,e)||this;return a.history=n,a.model=o,a.selection=i,a.visualizerManager=r,a.shapeDescriptionManager=s,a.isModelEmpty=0===o.items.length,a}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 y(this.handler,this.history,this.model,this.selection,this.visualizerManager,this.shapeDescriptionManager,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}(l.MouseHandlerCancellableState);e.MouseHandlerBeforeToolboxDraggingState=f;var y=function(t){function e(e,n,o,i,r,s,a){var c=t.call(this,e,n)||this;return c.model=o,c.selection=i,c.visualizerManager=r,c.shapeDescriptionManager=s,a||(c.updatePageSizeTimer=setTimeout((function(){c.processAndRemoveUpdatePageSizeTimer()}),300)),c}return i(e,t),e.prototype.cancelChanges=function(){this.tryRemoveUpdatePageSizeTimer(),t.prototype.cancelChanges.call(this)},e.prototype.tryRemoveUpdatePageSizeTimer=function(){void 0!==this.updatePageSizeTimer&&(clearTimeout(this.updatePageSizeTimer),delete this.updatePageSizeTimer)},e.prototype.processAndRemoveUpdatePageSizeTimer=function(){void 0!==this.updatePageSizeTimer&&(this.handler.tryUpdateModelSize(),delete this.updatePageSizeTimer)},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=p.ModelUtils.findContainerByEventKey(this.model,this.selection,e.source.key);o&&this.allowInsertToContainer(e,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(t.source.type===r.MouseEventElementType.Undefined){if(this.dragging.onCaptured(!1),void 0!==this.shapeKey&&!this.deleteHistoryItem){var n=this.model.findShape(this.shapeKey);p.ModelUtils.detachConnectors(this.history,n),p.ModelUtils.removeFromContainer(this.history,this.model,n),this.deleteHistoryItem=new h.DeleteShapeHistoryItem(this.shapeKey,!0),this.history.addAndRedo(this.deleteHistoryItem)}}else{if(this.dragging.onCaptured(!0),void 0===this.shapeKey){this.startPoint=t.modelPoint,this.shapeKey=this.insertToolboxItem(t);var o=this.model.findShape(this.shapeKey);o&&this.handler.addInteractingItem(o,d.DiagramModelOperation.AddShape)}this.deleteHistoryItem&&(this.history.undoTransactionTo(this.deleteHistoryItem),delete this.deleteHistoryItem);var i=this.getPosition(t,this.startShapePosition);n=this.model.findShape(this.shapeKey);p.ModelUtils.setShapePosition(this.history,this.model,n,i),p.ModelUtils.updateMovingShapeConnections(this.history,n,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)}),(function(t){return e.handler.addInteractingItem(t)})),p.ModelUtils.updateShapeAttachedConnectors(this.history,this.model,n);var s=p.ModelUtils.findContainerByEventKey(this.model,this.selection,t.source.key);n&&s&&this.allowInsertToContainer(t,n,s)?p.ModelUtils.insertToContainer(this.history,this.model,n,s):p.ModelUtils.removeFromContainer(this.history,this.model,n),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.deleteHistoryItem||this.history.addAndRedo(new c.SetSelectionHistoryItem(this.selection,[this.shapeKey]))},e.prototype.onDragStart=function(t){this.dragging=t,this.connectorsWithoutBeginItemInfo=p.ModelUtils.getConnectorsWithoutBeginItemInfo(this.model),this.connectorsWithoutEndItemInfo=p.ModelUtils.getConnectorsWithoutEndItemInfo(this.model)},e.prototype.onDragEnd=function(t){void 0!==this.shapeKey&&t.source.type===r.MouseEventElementType.Undefined&&this.cancelChanges(),this.handler.switchToDefaultState()},e.prototype.finish=function(){this.visualizerManager.resetExtensionLines(),this.visualizerManager.resetContainerTarget(),this.visualizerManager.resetConnectionTarget(),this.visualizerManager.resetConnectionPoints(),this.processAndRemoveUpdatePageSizeTimer(),this.dragging.onFinishDragging(),t.prototype.finish.call(this)},e.prototype.insertToolboxItem=function(t){var e=this.shapeDescriptionManager.get(this.dragging.data);this.startShapePosition=this.getSnappedPoint(t,new s.Point(t.modelPoint.x-e.defaultSize.width/2,t.modelPoint.y-e.defaultSize.height/2));var n=new a.AddShapeHistoryItem(e,this.startShapePosition);return this.history.addAndRedo(n),p.ModelUtils.updateNewShapeProperties(this.history,this.selection,n.shapeKey),n.shapeKey},e.prototype.allowInsertToContainer=function(t,e,n){return!this.handler.canMultipleSelection(t)&&(n&&n.expanded&&p.ModelUtils.canInsertToContainer(this.model,e,n))},e.prototype.getPosition=function(t,e){return this.getSnappedPoint(t,new s.Point(e.x+t.modelPoint.x-this.startPoint.x,e.y+t.modelPoint.y-this.startPoint.y))},e}(u.MouseHandlerDraggingState);e.MouseHandlerToolboxDraggingState=y},8461:function(t,e,n){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])},o(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}),e.MouseHandlerZoomOnPinchState=void 0;var r=n(240),s=n(8900),a=n(9582),c=n(5596),u=function(t){function e(e,n,o,i){var r=t.call(this,e,i,n)||this;return r.selection=n,r.settings=o,r.view=i,r}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.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},e.prototype.getTouchDistance=function(t){var e=new s.Point(t.touches[0].offsetPoint.x,t.touches[0].offsetPoint.y),n=new s.Point(t.touches[1].offsetPoint.x,t.touches[1].offsetPoint.y);return c.Metrics.euclideanDistance(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 s.Point((e(t.touches[0]).x+e(t.touches[1]).x)/2,(e(t.touches[0]).y+e(t.touches[1]).y)/2)},e}(a.MouseHandlerScrollingState);e.MouseHandlerZoomOnPinchState=u},7189:function(t,e,n){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])},o(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}),e.MouseHandlerZoomOnWheelState=void 0;var r=n(5434),s=n(6031),a=n(240),c=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.settings=n,i.view=o,i}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),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){return!!this.handler.canFinishZoomOnWheel(t)&&(this.handler.switchToDefaultState(),!0)},e.prototype.start=function(){t.prototype.start.call(this),this.settings.zoomLevel=this.view.getZoom(),this.settings.autoZoom=a.AutoZoomMode.Disabled},e}(r.MouseHandlerStateBase);e.MouseHandlerZoomOnWheelState=c},8376:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextInputHandler=void 0;var o=n(6516),i=n(6031),r=n(2153),s=n(5503),a=n(7959),c=n(5144),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&&this.canFinishTextEditing()){this.control.beginUpdate(),this.textInputItem=t;var n=!0;if(this.textInputItem instanceof s.Shape){var o=this.textInputItem.textEditRectangle;(n=this.control.permissionsProvider.canChangeShapeText(this.textInputItem))&&this.control.eventManager.raiseTextInputStart(this.textInputItem,this.textInputItem.text,o.createPosition(),o.createSize())}else this.textInputItem instanceof a.Connector&&(this.textInputPosition=e,(n=this.control.permissionsProvider.canChangeConnectorText(this.textInputItem,this.textInputPosition))&&this.control.eventManager.raiseTextInputStart(this.textInputItem,this.textInputItem.getText(this.textInputPosition),this.textInputItem.getTextPoint(this.textInputPosition)));n||(delete this.textInputItem,this.control.endUpdate())}},t.prototype.endTextInput=function(t){var e=this.textInputItem;delete this.textInputItem,this.control.eventManager.raiseTextInputEnd(e,t),this.control.endUpdate(),this.control.barManager.updateItemsState()},t.prototype.raiseTextInputPermissionsCheck=function(t){this.control.eventManager.raiseTextInputPermissionsCheck(this.textInputItem,t)},t.prototype.applyTextInput=function(t,e){if(this.canFinishTextEditing(t)){var n=this.textInputItem,i=this.textInputPosition;this.endTextInput(e),n instanceof s.Shape?n.text!==t&&this.control.history.addAndRedo(new o.ChangeShapeTextHistoryItem(n,t)):n instanceof a.Connector&&n.getText(i)!==t&&this.control.history.addAndRedo(new c.ChangeConnectorTextHistoryItem(n,i,t))}},t.prototype.canFinishTextEditing=function(t){var e=!0;if(this.isTextInputActive()){var n=t||this.getTextInputElementValue();this.textInputItem instanceof s.Shape?e=this.control.permissionsProvider.canApplyShapeTextChange(this.textInputItem,n):this.textInputItem instanceof a.Connector&&(e=this.control.permissionsProvider.canApplyConnectorTextChange(this.textInputItem,this.textInputPosition,n)),this.raiseTextInputPermissionsCheck(e)}return e},t.prototype.getTextInputElementValue=function(){return this.control.render?this.control.render.input.getTextInputElementValue():""},t.prototype.cancelTextInput=function(){this.raiseTextInputPermissionsCheck(!0),this.endTextInput(!0)},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){var e=this;setTimeout((function(){e.processDblClick(t)}),10)},t.prototype.onKeyDown=function(t){this.isTextInputActive()&&(13===t.keyCode&&this.hasCtrlModifier(t.modifiers)&&(t.preventDefault=!0,this.applyTextInput(t.inputText,!0)),27===t.keyCode&&this.cancelTextInput())},t.prototype.onBlur=function(t){this.isTextInputActive()&&this.applyTextInput(t.inputText)},t.prototype.onFocus=function(t){},t.prototype.reset=function(){delete this.textInputItem},t.prototype.hasCtrlModifier=function(t){return(t&r.ModifierKey.Ctrl)>0},t}();e.TextInputHandler=u},3541:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectionPointsVisualizer=e.ConnectionPointInfo=void 0;var n=function(t,e){this.point=t,this.side=e,this.allowed=!0};e.ConnectionPointInfo=n;var o=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.points=e,this.pointIndex=n,this.outsideRectangle=o,this.raiseShow())},t.prototype.setPointIndex=function(t){0<=t&&t{Object.defineProperty(e,"__esModule",{value:!0}),e.ExtensionLinesVisualizer=e.ExtensionLine=e.ExtensionLineType=void 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 n=function(t,e,n){this.type=t,this.segment=e,this.text=n};e.ExtensionLine=n;var o=function(){function t(t){this.dispatcher=t,this.lines=[],this.lineIndexByType={}}return t.prototype.addSegment=function(t,e,o){var i=this.lineIndexByType[t];if(void 0===i){var r=new n(t,e,o),s=this.lines.push(r);this.lineIndexByType[r.type]=s-1,this.raiseShow()}else if(e.length{Object.defineProperty(e,"__esModule",{value:!0}),e.ResizeInfoVisualizer=void 0;var n=function(){function t(t){this.dispatcher=t}return t.prototype.set=function(t,e){this.point=t,this.text=e,this.raiseShow()},t.prototype.reset=function(){void 0!==this.point&&(this.point=void 0,this.text=void 0,this.raiseHide())},t.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1((function(e){return e.notifyResizeInfoShow(t.point,t.text)}))},t.prototype.raiseHide=function(){this.dispatcher.raise1((function(t){return t.notifyResizeInfoHide()}))},t}();e.ResizeInfoVisualizer=n},4753:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRectVisualizer=void 0;var n=function(){function t(t){this.dispatcher=t}return t.prototype.setRectangle=function(t){this.rect=t,this.raiseShow()},t.prototype.reset=function(){this.rect=void 0,this.raiseHide()},t.prototype.raiseShow=function(){var t=this;this.dispatcher.raise1((function(e){return e.notifySelectionRectShow(t.rect)}))},t.prototype.raiseHide=function(){this.dispatcher.raise1((function(t){return t.notifySelectionRectHide()}))},t}();e.SelectionRectVisualizer=n},3785:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TargetVisualizerBase=void 0;var n=function(){function t(t){this.dispatcher=t}return t.prototype.getKey=function(){return this.key},t.prototype.setTargetRect=function(t,e,n){this.key!==t&&(this.key=t,this.targetRect=e,this.targetStrokeWidth=n,this.raiseShow())},t.prototype.reset=function(){"-1"!==this.key&&(this.key="-1",this.targetRect=void 0,this.targetStrokeWidth=0,this.raiseHide())},t}();e.TargetVisualizerBase=n},7733:function(t,e,n){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])},o(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}),e.VisualizerManager=void 0;var r=n(3702),s=n(9198),a=n(371),c=n(6031),u=n(3541),h=n(5503),p=n(8675),l=n(1335),d=n(8900),f=n(4e3),y=n(4867),g=n(6569),m=n(4753),v=n(1772),P=n(6224),C=function(t){function e(e,n,o,i,c){void 0===c&&(c=i.readOnly);var h=t.call(this)||this;return h.selection=e,h.model=n,h.eventManager=o,h.settings=i,h.readOnly=c,h.onVisualizersUpdate=new p.EventDispatcher,h.connectionPointsVisualizer=new u.ConnectionPointsVisualizer(h.onVisualizersUpdate),h.connectionPointsVisualizer=new u.ConnectionPointsVisualizer(h.onVisualizersUpdate),h.connectionTargetVisualizer=new r.ConnectionTargetVisualizer(h.onVisualizersUpdate),h.containerTargetVisualizer=new s.ContainerTargetVisualizer(h.onVisualizersUpdate),h.extensionLinesVisualizer=new a.ExtensionLinesVisualizer(h.onVisualizersUpdate),h.resizeInfoVisualizer=new g.ResizeInfoVisualizer(h.onVisualizersUpdate),h.selectionRectangleVisualizer=new m.SelectionRectVisualizer(h.onVisualizersUpdate),h}return i(e,t),e.prototype.initialize=function(t){this.model=t},e.prototype.onMouseDown=function(t){},e.prototype.onMouseUp=function(t){},e.prototype.onMouseEnter=function(t){},e.prototype.onMouseLeave=function(t){this.resetConnectionPoints(),this.resetConnectionTarget(),this.resetExtensionLines(),this.resetContainerTarget(),this.resetResizeInfo(),this.resetSelectionRectangle()},e.prototype.onBlur=function(t){},e.prototype.onFocus=function(t){},e.prototype.updateConnections=function(t,e,n){var o=-1;n&&e===c.MouseEventElementType.ShapeConnectionPoint&&(o=parseInt(n));var i=t&&(!t.allowResizeHorizontally&&!t.allowResizeVertically||t.isLocked);this.setConnectionPoints(t,e,o,i)},e.prototype.setConnectionPoints=function(t,e,n,o){if(this.eventManager.isFocused())if(!t||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=t.getConnectionPoints();this.connectionPointsVisualizer.setPoints(i,s.map((function(e){return new u.ConnectionPointInfo(e,t.getConnectionPointSide(e))})),n,r&&!o&&t.rectangle)}},e.prototype.setConnectionPointIndex=function(t){this.connectionPointsVisualizer.setPointIndex(t)},e.prototype.updateConnectionPoints=function(){void 0!==this.model.findItem(this.connectionPointsVisualizer.getKey())?this.connectionPointsVisualizer.update():this.connectionPointsVisualizer.reset()},e.prototype.resetConnectionPoints=function(){this.connectionPointsVisualizer.reset()},e.prototype.setConnectionTarget=function(t,e){!t||e!==c.MouseEventElementType.Shape&&e!==c.MouseEventElementType.ShapeConnectionPoint?this.connectionTargetVisualizer.reset():this.connectionTargetVisualizer.setTargetRect(t.key,t.rectangle,t.strokeWidth)},e.prototype.resetConnectionTarget=function(){this.connectionTargetVisualizer.reset()},e.prototype.setContainerTarget=function(t,e){t&&!t.isLocked&&e===c.MouseEventElementType.Shape&&t.enableChildren?this.containerTargetVisualizer.setTargetRect(t.key,t.rectangle,t.strokeWidth):this.containerTargetVisualizer.reset()},e.prototype.resetContainerTarget=function(){this.containerTargetVisualizer.reset()},e.prototype.setExtensionLines=function(t){var e=this;if(this.eventManager.isFocused()){this.extensionLinesVisualizer.reset();var n=y.ModelUtils.createRectangle(t.filter((function(t){return t})));this.addPageExtensionLines(n),this.model.items.forEach((function(o){t.indexOf(o)>-1||o instanceof h.Shape&&e.addShapeExtensionLines(o,n)}))}},e.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;op.right&&(n=e.x,i=p.right,s=n-f.CanvasSelectionManager.extensionLineOffset,u=i+y+f.CanvasSelectionManager.extensionLineOffset),e.bottomp.bottom&&(o=e.y,r=p.bottom,c=o-f.CanvasSelectionManager.extensionLineOffset,h=r+y+f.CanvasSelectionManager.extensionLineOffset),void 0!==s&&void 0!==u){var m=this.getViewUnitText(Math.abs(n-i));if(e.center.y===p.center.y){var v=new l.Segment(new d.Point(s,e.center.y),new d.Point(u,p.center.y));this.extensionLinesVisualizer.addSegment(s>u?a.ExtensionLineType.VerticalCenterAfter:a.ExtensionLineType.VerticalCenterBefore,v,g?m:""),g=!1}if(e.y===p.y){v=new l.Segment(new d.Point(s,e.y),new d.Point(u,p.y));this.extensionLinesVisualizer.addSegment(s>u?a.ExtensionLineType.TopToTopAfter:a.ExtensionLineType.TopToTopBefore,v,g?m:"")}if(e.bottom===p.bottom){v=new l.Segment(new d.Point(s,e.bottom+y),new d.Point(u,p.bottom+y));this.extensionLinesVisualizer.addSegment(s>u?a.ExtensionLineType.BottomToBottomAfter:a.ExtensionLineType.BottomToBottomBefore,v,g?m:"")}if(e.y===p.bottom){v=new l.Segment(new d.Point(s,e.y),new d.Point(u,p.bottom+y));this.extensionLinesVisualizer.addSegment(s>u?a.ExtensionLineType.TopToBottomAfter:a.ExtensionLineType.TopToBottomBefore,v,g?m:"")}if(e.bottom===p.y){v=new l.Segment(new d.Point(s,e.bottom+y),new d.Point(u,p.y));this.extensionLinesVisualizer.addSegment(s>u?a.ExtensionLineType.BottomToTopAfter:a.ExtensionLineType.BottomToTopBefore,v,g?m:"")}}if(void 0!==c&&void 0!==h){m=this.getViewUnitText(Math.abs(o-r));if(e.center.x===p.center.x){v=new l.Segment(new d.Point(e.center.x,c),new d.Point(p.center.x,h));this.extensionLinesVisualizer.addSegment(c>h?a.ExtensionLineType.HorizontalCenterBelow:a.ExtensionLineType.HorizontalCenterAbove,v,g?m:""),g=!1}if(e.x===p.x){v=new l.Segment(new d.Point(e.x,c),new d.Point(p.x,h));this.extensionLinesVisualizer.addSegment(c>h?a.ExtensionLineType.LeftToLeftBelow:a.ExtensionLineType.LeftToLeftAbove,v,g?m:"")}if(e.right===p.right){v=new l.Segment(new d.Point(e.right+y,c),new d.Point(p.right+y,h));this.extensionLinesVisualizer.addSegment(c>h?a.ExtensionLineType.RightToRightBelow:a.ExtensionLineType.RightToRightAbove,v,g?m:"")}if(e.x===p.right){v=new l.Segment(new d.Point(e.x,c),new d.Point(p.right+y,h));this.extensionLinesVisualizer.addSegment(c>h?a.ExtensionLineType.LeftToRightBelow:a.ExtensionLineType.LeftToRightAbove,v,g?m:"")}if(e.right===p.x){v=new l.Segment(new d.Point(e.right+y,c),new d.Point(p.x,h));this.extensionLinesVisualizer.addSegment(c>h?a.ExtensionLineType.RightToLeftBelow:a.ExtensionLineType.RightToLeftAbove,v,g?m:"")}}},e.prototype.resetExtensionLines=function(){this.extensionLinesVisualizer.reset()},e.prototype.setResizeInfo=function(t){var e=y.ModelUtils.createRectangle(t),n=new d.Point(e.center.x,e.bottom+f.CanvasSelectionManager.resizeInfoOffset),o=this.getViewUnitText(e.width)+" x "+this.getViewUnitText(e.height);this.resizeInfoVisualizer.set(n,o)},e.prototype.resetResizeInfo=function(){this.resizeInfoVisualizer.reset()},e.prototype.setSelectionRectangle=function(t){this.selectionRectangleVisualizer.setRectangle(t)},e.prototype.resetSelectionRectangle=function(){this.selectionRectangleVisualizer.reset()},e.prototype.getViewUnitText=function(t){return y.ModelUtils.getUnitText(this.settings.viewUnits,P.DiagramLocalizationService.unitItems,P.DiagramLocalizationService.formatUnit,t)},e.prototype.notifyReadOnlyChanged=function(t){this.readOnly=t,this.readOnly&&(this.resetConnectionPoints(),this.resetConnectionTarget(),this.resetExtensionLines(),this.resetContainerTarget(),this.resetResizeInfo(),this.resetSelectionRectangle())},e.prototype.notifyDragStart=function(t){},e.prototype.notifyDragEnd=function(t){},e.prototype.notifyDragScrollStart=function(){},e.prototype.notifyDragScrollEnd=function(){},e.prototype.onUpdateUnlocked=function(t){},e}(v.BatchUpdatableObject);e.VisualizerManager=C},7459:function(t,e,n){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])},o(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}),e.VisualizerTouchManager=void 0;var r=n(7733),s=n(6031),a=function(t){function e(e,n,o,i,r){void 0===r&&(r=i.readOnly);var s=t.call(this,e,n,o,i,r)||this;return e.onChanged.add(s),s}return i(e,t),e.prototype.onBlur=function(t){var e=this;setTimeout((function(){e.hideConnections()}),1)},e.prototype.onFocus=function(t){var e=this;setTimeout((function(){e.showConnections()}),1)},e.prototype.hideConnections=function(){this.readOnly||this.resetConnectionPoints()},e.prototype.showConnections=function(){if(!this.readOnly&&this.needShowConnections()){var t=this.selection.getSelectedShapes();1===t.length&&this.setConnectionPoints(t[0],s.MouseEventElementType.ShapeConnectionPoint,-1,!t[0].allowResizeHorizontally&&!t[0].allowResizeVertically||t[0].isLocked)}},e.prototype.needShowConnections=function(){var t=this.selection.getSelectedItems(),e=this.selection.getSelectedShapes();return 1===t.length&&1===e.length},e.prototype.notifySelectionChanged=function(t){this.isUpdateLocked()?this.registerOccurredEvent(1):this.raiseSelectionChanged()},e.prototype.raiseSelectionChanged=function(){this.needShowConnections()?this.showConnections():this.hideConnections()},e.prototype.onUpdateUnlocked=function(t){1&t&&this.raiseSelectionChanged()},e.prototype.notifyDragStart=function(t){this.hideConnections()},e.prototype.notifyDragEnd=function(t){this.showConnections()},e}(r.VisualizerManager);e.VisualizerTouchManager=a},3477:function(t,e,n){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])},o(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}),e.SetConnectionPointIndexHistoryItem=e.AddConnectionHistoryItem=void 0;var r=n(4412),s=n(7959),a=function(t){function e(e,n,o,i){var r=t.call(this)||this;return r.connectorKey=e.key,r.itemKey=n.key,r.connectionPointIndex=o,r.position=i,r}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey),n=t.model.findItem(this.itemKey);t.addConnection(e,n,this.connectionPointIndex,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.deleteConnection(e,this.position)},e}(r.HistoryItem);e.AddConnectionHistoryItem=a;var c=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e.key,i.connectionPointIndex=n,i.position=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldConnectionPointIndex=this.position===s.ConnectorPosition.Begin?e.beginConnectionPointIndex:e.endConnectionPointIndex,t.setConnectionPointIndex(e,this.connectionPointIndex,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.setConnectionPointIndex(e,this.oldConnectionPointIndex,this.position)},e}(r.HistoryItem);e.SetConnectionPointIndexHistoryItem=c},9603:function(t,e,n){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])},o(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}),e.AddConnectorHistoryItem=void 0;var r=n(4412),s=n(7959),a=function(t){function e(e,n,o){var i=t.call(this)||this;return i.points=e,i.dataKey=n,i.renderPointsContext=o,i}return i(e,t),e.prototype.redo=function(t){var e=new s.Connector(this.points);void 0!==this.dataKey&&(e.dataKey=this.dataKey),void 0!==this.renderPointsContext&&e.replaceRenderPoints(this.renderPointsContext),t.addConnector(e,this.connectorKey),this.connectorKey=e.key},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.deleteConnector(e)},e}(r.HistoryItem);e.AddConnectorHistoryItem=a},4430:function(t,e,n){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])},o(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}),e.AddConnectorPointHistoryItem=void 0;var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e,i.pointIndex=n,i.point=o,i}return i(e,t),e.prototype.redo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);this.renderContext=n.tryCreateRenderPointsContext(),t.addDeleteConnectorPoint(n,(function(t){t.addPoint(e.pointIndex,e.point),t.onAddPoint(e.pointIndex,e.point)}))},e.prototype.undo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);t.addDeleteConnectorPoint(n,(function(t){t.deletePoint(e.pointIndex),t.replaceRenderPoints(e.renderContext)}))},e}(n(4412).HistoryItem);e.AddConnectorPointHistoryItem=r},4145:function(t,e,n){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])},o(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}),e.AddShapeHistoryItem=void 0;var r=n(4412),s=n(5503),a=function(t){function e(e,n,o,i){var r=t.call(this)||this;return r.shapeDescription=e,r.position=n,r.text=o,r.dataKey=i,r}return i(e,t),e.prototype.redo=function(t){var e=new s.Shape(this.shapeDescription,this.position);"string"==typeof this.text&&(e.text=this.text),void 0!==this.dataKey&&(e.dataKey=this.dataKey),t.addShape(e,this.shapeKey),this.shapeKey=e.key},e.prototype.undo=function(t){t.deleteShape(t.model.findShape(this.shapeKey),!0)},e}(r.HistoryItem);e.AddShapeHistoryItem=a},58:function(t,e,n){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])},o(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}),e.ReplaceConnectorPointsHistoryItem=e.ChangeConnectorPointsHistoryItem=e.UpdateConnectorPointsHistoryItem=void 0;var r=function(t){function e(e,n){var o=t.call(this)||this;return o.connectorKey=e,o.newPoints=n,o}return i(e,t),e.prototype.redo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);this.oldRenderContext=n.tryCreateRenderPointsContext(),this.oldPoints=n.points.map((function(t){return t.clone()})),t.changeConnectorPoints(n,(function(t){t.points=e.newPoints,e.updateRenderPoints(t)}))},e.prototype.undo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);t.changeConnectorPoints(n,(function(t){t.points=e.oldPoints,t.replaceRenderPoints(e.oldRenderContext)}))},e}(n(4412).HistoryItem);e.UpdateConnectorPointsHistoryItem=r;var s=function(t){function e(e,n,o){var i=t.call(this,e,n)||this;return i.connectorKey=e,i.newPoints=n,i.newRenderContext=o,i}return i(e,t),e.prototype.updateRenderPoints=function(t){t.replaceRenderPoints(this.newRenderContext)},e}(r);e.ChangeConnectorPointsHistoryItem=s;var a=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.connectorKey=e,o.newPoints=n,o}return i(e,t),e.prototype.updateRenderPoints=function(t){t.clearRenderPoints()},e}(r);e.ReplaceConnectorPointsHistoryItem=a},329:function(t,e,n){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])},o(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}),e.ChangeShapeParametersHistoryItem=void 0;var r=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e,o.parameters=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldParameters=e.parameters.clone(),t.changeShapeParameters(e,this.parameters)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeParameters(e,this.oldParameters)},e}(n(4412).HistoryItem);e.ChangeShapeParametersHistoryItem=r},56:function(t,e,n){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])},o(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}),e.ChangeShapeTypeHistoryItem=void 0;var r=n(6629),s=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e.key,o.newType=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldType=e.description.key,this.oldParameters=e.parameters.clone(),t.updateShapeType(e,this.newType,new r.ShapeParameters)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.updateShapeType(e,this.oldType,this.oldParameters)},e}(n(4412).HistoryItem);e.ChangeShapeTypeHistoryItem=s},8930:function(t,e,n){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])},o(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}),e.DeleteConnectionHistoryItem=void 0;var r=n(4412),s=n(7959),a=function(t){function e(e,n){var o=t.call(this)||this;return o.connectorKey=e.key,o.position=n,o.itemKey=e.getExtremeItem(o.position).key,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldConnectionPointIndex=this.position===s.ConnectorPosition.Begin?e.beginConnectionPointIndex:e.endConnectionPointIndex,t.deleteConnection(e,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey),n=t.model.findItem(this.itemKey);t.addConnection(e,n,this.oldConnectionPointIndex,this.position)},e}(r.HistoryItem);e.DeleteConnectionHistoryItem=a},9143:function(t,e,n){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])},o(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}),e.DeleteConnectorHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.connectorKey=e,n}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.connector=e.clone(),t.deleteConnector(e)},e.prototype.undo=function(t){t.addConnector(this.connector,this.connector.key)},e}(n(4412).HistoryItem);e.DeleteConnectorHistoryItem=r},1704:function(t,e,n){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])},o(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}),e.DeleteShapeHistoryItem=void 0;var r=function(t){function e(e,n){void 0===n&&(n=!0);var o=t.call(this)||this;return o.shapeKey=e,o.allowed=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.shape=e.clone(),t.deleteShape(e,this.allowed)},e.prototype.undo=function(t){t.addShape(this.shape,this.shape.key)},e}(n(4412).HistoryItem);e.DeleteShapeHistoryItem=r},3849:function(t,e,n){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])},o(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}),e.ImportConnectorHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.connector=e,n}return i(e,t),e.prototype.redo=function(t){this.connectorKey=this.connector.key,t.insertConnector(this.connector)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.removeConnector(e)},e}(n(4412).HistoryItem);e.ImportConnectorHistoryItem=r},4383:function(t,e,n){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])},o(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}),e.ImportShapeHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.shape=e,n}return i(e,t),e.prototype.redo=function(t){this.shapeKey=this.shape.key,t.insertShape(this.shape)},e.prototype.undo=function(t){t.removeShape(t.model.findShape(this.shapeKey),!0)},e}(n(4412).HistoryItem);e.ImportShapeHistoryItem=r},9310:function(t,e,n){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])},o(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}),e.InsertToContainerHistoryItem=void 0;var r=function(t){function e(e,n){var o=t.call(this)||this;return o.containerKey=n.key,o.itemKey=e.key,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey),n=t.model.findShape(this.containerKey);t.insertToContainer(e,n)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.removeFromContainer(e)},e}(n(4412).HistoryItem);e.InsertToContainerHistoryItem=r},8338:function(t,e,n){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])},o(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}),e.MoveConnectorRightAnglePointsHistoryItem=e.MoveConnectorPointHistoryItem=void 0;var r=n(8900),s=n(4412),a=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e,i.pointIndex=n,i.newPoint=o,i}return i(e,t),e.prototype.redo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);this.oldPoint=n.points[this.pointIndex].clone(),this.renderContext=n.tryCreateRenderPointsContext(),t.moveConnectorPoint(n,this.pointIndex,(function(t){t.movePoint(e.pointIndex,e.newPoint),t.onMovePoint(e.pointIndex,e.newPoint)}))},e.prototype.undo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);t.moveConnectorPoint(n,this.pointIndex,(function(t){t.movePoint(e.pointIndex,e.oldPoint),t.replaceRenderPoints(e.renderContext)}))},e}(s.HistoryItem);e.MoveConnectorPointHistoryItem=a;var c=function(t){function e(e,n,o,i,r){var s=t.call(this)||this;return s.connectorKey=e,s.beginPointIndex=n,s.lastPointIndex=o,s.newX=i,s.newY=r,s.oldPoints=[],s}return i(e,t),e.prototype.redo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);this.renderContext=n.tryCreateRenderPointsContext(),this.oldPoints=n.points.slice(this.beginPointIndex,this.lastPointIndex+1).map((function(t){return t.clone()}));var o=[];t.changeConnectorPoints(n,(function(t){for(var n=e.beginPointIndex;n<=e.lastPointIndex;n++){var i=new r.Point(void 0===e.newX?t.points[n].x:e.newX,void 0===e.newY?t.points[n].y:e.newY);o.push(i),t.movePoint(n,i)}t.onMovePoints(e.beginPointIndex,e.lastPointIndex,o)}))},e.prototype.undo=function(t){var e=this,n=t.model.findConnector(this.connectorKey);t.changeConnectorPoints(n,(function(t){for(var n=e.beginPointIndex;n<=e.lastPointIndex;n++)t.movePoint(n,e.oldPoints[n-e.beginPointIndex]);t.replaceRenderPoints(e.renderContext)}))},e}(s.HistoryItem);e.MoveConnectorRightAnglePointsHistoryItem=c},4160:function(t,e,n){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])},o(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}),e.MoveShapeHistoryItem=void 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(4412).HistoryItem);e.MoveShapeHistoryItem=r},9753:function(t,e,n){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])},o(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}),e.RemoveFromContainerHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.itemKey=e.key,n}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.containerKey=e.container&&e.container.key,t.removeFromContainer(e)},e.prototype.undo=function(t){var e=t.model.findContainer(this.containerKey),n=t.model.findItem(this.itemKey);t.insertToContainer(n,e)},e}(n(4412).HistoryItem);e.RemoveFromContainerHistoryItem=r},4629:function(t,e,n){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])},o(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}),e.ResizeShapeHistoryItem=void 0;var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.shapeKey=e,i.position=n,i.size=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldPosition=e.position.clone(),this.oldSize=e.size.clone(),t.resizeShape(e,this.position,this.size)},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.resizeShape(e,this.oldPosition,this.oldSize)},e}(n(4412).HistoryItem);e.ResizeShapeHistoryItem=r},7626:function(t,e,n){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])},o(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}),e.ScrollIntoViewOnUndoHistoryItem=e.ScrollIntoViewOnRedoHistoryItem=void 0;var r=n(4412),s=function(t){function e(e,n){var o=t.call(this)||this;return o.view=e,o.rectangle=n,o.view=e,o.rectangle=n.clone(),o}return i(e,t),e.prototype.redo=function(t){this.view.scrollIntoView(this.rectangle)},e.prototype.undo=function(t){},e}(r.HistoryItem);e.ScrollIntoViewOnRedoHistoryItem=s;var a=function(t){function e(e,n){var o=t.call(this)||this;return o.view=e,o.rectangle=n,o.view=e,o.rectangle=n.clone(),o}return i(e,t),e.prototype.redo=function(t){},e.prototype.undo=function(t){this.view.scrollIntoView(this.rectangle)},e}(r.HistoryItem);e.ScrollIntoViewOnUndoHistoryItem=a},4297:function(t,e,n){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])},o(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}),e.SetSelectionHistoryItem=void 0;var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.selectedKeys=n,i.selection=e,i.forceChange=o,i}return i(e,t),e.prototype.redo=function(){this.oldSelection=this.selection.getKeys().slice(0),this.selection.set(this.selectedKeys,this.forceChange)},e.prototype.undo=function(){this.selection.set(this.oldSelection,this.forceChange)},e}(n(4412).HistoryItem);e.SetSelectionHistoryItem=r},1864:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.History=void 0;var o=n(4412),i=n(8675),r=function(){function t(t,e){this.modelManipulator=t,this.diagram=e,this.historyItems=[],this.currentIndex=-1,this.incrementalId=-1,this.transactionLevel=-1,this.unmodifiedIndex=-1,this.currTransactionId=0,this.onChanged=new i.EventDispatcher}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.startDataSyncItem&&(this.startDataSyncItem.undo(this.modelManipulator),this.startDataSyncItem=void 0),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 e=this.transaction.historyItems.length;if(e>0){var n=e>1?this.transaction:this.transaction.historyItems.pop();t?this.addDataSyncItem(n):this.addInternal(n)}e>0&&!t&&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(){this.diagram.beginUpdateCanvas();for(var t=this.transaction.historyItems;t.length;)t.pop().undo(this.modelManipulator);this.diagram.endUpdateCanvas()},t.prototype.undoTransactionTo=function(t){this.diagram.beginUpdateCanvas();for(var e=this.transaction.historyItems;e.length;){var n=e.pop();if(n.undo(this.modelManipulator),n===t)break}this.diagram.endUpdateCanvas()},t.prototype.raiseChanged=function(){-1===this.transactionLevel&&this.onChanged.raise("notifyHistoryChanged")},t.MAX_HISTORY_ITEM_COUNT=100,t}();e.History=r},4412:function(t,e){var n,o=this&&this.__extends||(n=function(t,e){return n=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])},n(t,e)},function(t,e){function o(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)});Object.defineProperty(e,"__esModule",{value:!0}),e.CompositionHistoryItem=e.HistoryItem=void 0;var i=function(){function t(){this.uniqueId=-1}return t.prototype.changeModified=function(){return!0},t.prototype.getName=function(){return this.constructor.name},t}();e.HistoryItem=i;var r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.historyItems=[],e.dataSyncItems=[],e}return o(e,t),e.prototype.changeModified=function(){for(var t,e=0;t=this.historyItems[e];e++)if(t.changeModified())return!0;return!1},e.prototype.redo=function(t){for(var e,n=0;e=this.historyItems[n];n++)e.redo(t)},e.prototype.undo=function(t){for(var e,n=this.dataSyncItems.length-1;e=this.dataSyncItems[n];n--)e.undo(t);this.dataSyncItems=[];for(n=this.historyItems.length-1;e=this.historyItems[n];n--)e.undo(t)},e.prototype.add=function(t){if(null==t)throw new Error("cannot be null");this.historyItems.push(t)},e}(i);e.CompositionHistoryItem=r},7195:function(t,e,n){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])},o(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}),e.ChangePageColorHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return i(e,t),e.prototype.redo=function(t){this.oldValue=t.model.pageColor,t.changePageColor(this.value)},e.prototype.undo=function(t){t.changePageColor(this.oldValue)},e}(n(4412).HistoryItem);e.ChangePageColorHistoryItem=r},1380:function(t,e,n){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])},o(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}),e.ChangePageLandscapeHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return i(e,t),e.prototype.redo=function(t){this.oldValue=t.model.pageLandscape,t.changePageLandscape(this.value)},e.prototype.undo=function(t){t.changePageLandscape(this.oldValue)},e}(n(4412).HistoryItem);e.ChangePageLandscapeHistoryItem=r},1044:function(t,e,n){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])},o(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}),e.ChangePageSizeHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.size=e,n}return i(e,t),e.prototype.redo=function(t){this.oldSize=t.model.pageSize,t.changePageSize(this.size)},e.prototype.undo=function(t){t.changePageSize(this.oldSize)},e}(n(4412).HistoryItem);e.ChangePageSizeHistoryItem=r},7479:function(t,e,n){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])},o(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}),e.ChangeUnitsHistoryItem=void 0;var r=function(t){function e(e){var n=t.call(this)||this;return n.units=e,n}return i(e,t),e.prototype.redo=function(t){this.oldUnits=t.model.units,t.model.units=this.units},e.prototype.undo=function(t){t.model.units=this.oldUnits},e}(n(4412).HistoryItem);e.ChangeUnitsHistoryItem=r},1729:function(t,e,n){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])},o(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}),e.ModelResizeHistoryItem=void 0;var r=n(4412),s=n(4125),a=n(6353),c=function(t){function e(e){var n=t.call(this)||this;return n.offset=e,n}return i(e,t),e.prototype.redo=function(t){this.oldSize=t.model.size.clone(),this.backOffset=new s.Offsets(-this.offset.left,-this.offset.right,-this.offset.top,-this.offset.bottom);var e=Math.max(this.oldSize.width+this.offset.left+this.offset.right,t.model.pageWidth),n=Math.max(this.oldSize.height+this.offset.top+this.offset.bottom,t.model.pageHeight);t.changeModelSize(new a.Size(e,n),this.offset)},e.prototype.undo=function(t){t.changeModelSize(this.oldSize,this.backOffset)},e}(r.HistoryItem);e.ModelResizeHistoryItem=c},4518:function(t,e,n){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])},o(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}),e.UpdatePositionsOnPageResizeHistoryItem=void 0;var r=n(7959),s=n(5503),a=function(t){function e(e){var n=t.call(this)||this;return n.offset=e,n}return i(e,t),e.prototype.redo=function(t){var e=this;t.model.iterateItems((function(n){n instanceof s.Shape&&t.moveShape(n,e.applyOffset(n.position,e.offset.x,e.offset.y)),n instanceof r.Connector&&t.changeConnectorPoints(n,(function(t){return t.updatePointsOnPageResize(e.offset.x,e.offset.y)}))}))},e.prototype.undo=function(t){var e=this;t.model.iterateItems((function(n){n instanceof s.Shape&&t.moveShape(n,e.applyOffset(n.position,-e.offset.x,-e.offset.y)),n instanceof r.Connector&&t.changeConnectorPoints(n,(function(t){return t.updatePointsOnPageResize(-e.offset.x,-e.offset.y)}))}))},e.prototype.applyOffset=function(t,e,n){return t.clone().offset(e,n)},e}(n(4412).HistoryItem);e.UpdatePositionsOnPageResizeHistoryItem=a},8236:function(t,e,n){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])},o(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}),e.ChangeConnectorPropertyHistoryItem=void 0;var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e,i.propertyName=n,i.value=o,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldValue=e.properties[this.propertyName],t.changeConnectorProperty(e,this.propertyName,this.value)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorProperty(e,this.propertyName,this.oldValue)},e}(n(4412).HistoryItem);e.ChangeConnectorPropertyHistoryItem=r},5144:function(t,e,n){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])},o(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}),e.ChangeConnectorTextHistoryItem=void 0;var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connectorKey=e.key,i.text=o,i.position=n,i}return i(e,t),e.prototype.redo=function(t){var e=t.model.findConnector(this.connectorKey);this.oldText=e.getText(this.position),t.changeConnectorText(e,this.text,this.position)},e.prototype.undo=function(t){var e=t.model.findConnector(this.connectorKey);t.changeConnectorText(e,this.oldText,this.position)},e}(n(4412).HistoryItem);e.ChangeConnectorTextHistoryItem=r},45:function(t,e,n){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])},o(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}),e.ChangeConnectorTextPositionHistoryItem=void 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(4412).HistoryItem);e.ChangeConnectorTextPositionHistoryItem=r},9559:function(t,e,n){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])},o(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}),e.ChangeCustomDataHistoryItem=void 0;var r=n(4412),s=n(8675),a=function(t){function e(e,n){var o=t.call(this)||this;return o.itemKey=e,o.customData=s.ObjectUtils.cloneObject(n),o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldCustomData=s.ObjectUtils.cloneObject(e.customData),t.changeCustomData(e,this.customData)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeCustomData(e,this.oldCustomData)},e}(r.HistoryItem);e.ChangeCustomDataHistoryItem=a},7443:function(t,e,n){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])},o(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}),e.ChangeLockedHistoryItem=void 0;var r=function(t){function e(e,n){var o=t.call(this)||this;return o.itemKey=e.key,o.locked=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldLocked=e.locked,t.changeLocked(e,this.locked)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeLocked(e,this.oldLocked)},e}(n(4412).HistoryItem);e.ChangeLockedHistoryItem=r},8210:function(t,e,n){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])},o(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}),e.ChangeShapeImageHistoryItem=void 0;var r=n(4412),s=n(6617),a=function(t){function e(e,n){var o=t.call(this)||this;return o.shapeKey=e.key,o.imageUrl=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findShape(this.shapeKey);this.oldImage=e.image,t.changeShapeImage(e,new s.ImageInfo(this.imageUrl))},e.prototype.undo=function(t){var e=t.model.findShape(this.shapeKey);t.changeShapeImage(e,this.oldImage)},e}(r.HistoryItem);e.ChangeShapeImageHistoryItem=a},6516:function(t,e,n){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])},o(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}),e.ChangeShapeTextHistoryItem=void 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(4412).HistoryItem);e.ChangeShapeTextHistoryItem=r},5982:function(t,e,n){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])},o(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}),e.ChangeZindexHistoryItem=void 0;var r=function(t){function e(e,n){var o=t.call(this)||this;return o.itemKey=e.key,o.zIndex=n,o}return i(e,t),e.prototype.redo=function(t){var e=t.model.findItem(this.itemKey);this.oldZIndex=e.zIndex,t.changeZIndex(e,this.zIndex)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeZIndex(e,this.oldZIndex)},e}(n(4412).HistoryItem);e.ChangeZindexHistoryItem=r},442:function(t,e,n){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])},o(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}),e.ToggleShapeExpandedHistoryItem=void 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(4412).HistoryItem);e.ToggleShapeExpandedHistoryItem=r},4634:function(t,e,n){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])},o(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}),e.ChangeStyleHistoryItem=void 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(3259).ChangeStyleHistoryItemBase);e.ChangeStyleHistoryItem=r},3259:function(t,e,n){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])},o(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}),e.ChangeStyleHistoryItemBase=void 0;var r=function(t){function e(e,n,o){var i=t.call(this)||this;return i.itemKey=e,i.styleProperty=n,i.styleValue=o,i}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(4412).HistoryItem);e.ChangeStyleHistoryItemBase=r},926:function(t,e,n){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])},o(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}),e.ChangeStyleTextHistoryItem=void 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.styleText[this.styleProperty],t.changeStyleText(e,this.styleProperty,this.styleValue)},e.prototype.undo=function(t){var e=t.model.findItem(this.itemKey);t.changeStyleText(e,this.styleProperty,this.oldStyleValue)},e}(n(3259).ChangeStyleHistoryItemBase);e.ChangeStyleTextHistoryItem=r},7176:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageCache=e.CacheImageInfo=void 0;var o=n(6477),i=n(6617),r=n(8675),s=function(){function t(t,e,n,i,r){this._base64=void 0!==t?o.Base64Utils.normalizeToDataUrl(t,"image/png"):void 0,this.actualId=e,this._referenceInfo=i,this._isLoaded=void 0!==r&&r,this.imageUrl=n}return Object.defineProperty(t.prototype,"isLoaded",{get:function(){return this._referenceInfo?this._referenceInfo._isLoaded:this._isLoaded},set:function(t){this._isLoaded=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64",{get:function(){return this._base64},set:function(t){this._base64=o.Base64Utils.normalizeToDataUrl(t,"image/png")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"referenceInfo",{get:function(){return this._referenceInfo},set:function(t){this._referenceInfo=t,this._base64=void 0,this._isLoaded=void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._referenceInfo?this.referenceInfo._isLoading:this._isLoading},enumerable:!1,configurable:!0}),t.prototype.startLoading=function(){this._referenceInfo?this._referenceInfo.startLoading():this._isLoading=!0},t.prototype.finalizeLoading=function(){this._referenceInfo?this._referenceInfo.finalizeLoading():this._isLoading=!1},t}();e.CacheImageInfo=s;var a=function(){function t(){this.emptyImageId=0,this.lastActualId=0,this.onReadyStateChanged=new r.EventDispatcher,this.cache=[],this.nonLoadedImages=[],this.createUnloadedInfoByBase64(i.ImageInfo.transparentOnePixelImage).isLoaded=!0}return t.prototype.reset=function(){this.cache.splice(1),this.nonLoadedImages=[],this.lastActualId=1},Object.defineProperty(t.prototype,"emptyImage",{get:function(){return this.cache[this.emptyImageId]},enumerable:!1,configurable:!0}),t.prototype.getImageData=function(t){return this.cache[t]},t.prototype.createUnloadedInfoByUrl=function(t){var e=this.findInfoByUrl(t);return e||this.registerImageData(new s(void 0,this.getNextActualId(),t))},t.prototype.createUnloadedInfoByBase64=function(t){var e=this.findInfoByBase64(t);return e||this.registerImageData(new s(t,this.getNextActualId()))},t.prototype.createUnloadedInfoByShapeImageInfo=function(t){var e=t.exportUrl;return o.Base64Utils.checkPrependDataUrl(e)?this.createUnloadedInfoByBase64(e):this.createUnloadedInfoByUrl(e)},t.prototype.registerImageData=function(t){var e=this.cache[t.actualId];return e||(e=t),void 0!==t.actualId&&(this.cache[t.actualId]=e),0!==t.actualId&&(this.nonLoadedImages.push(t),1===this.nonLoadedImages.length&&this.raiseReadyStateChanged(!1)),e},t.prototype.loadAllImages=function(t){var e=this;this.cache.forEach((function(n){e.emptyImageId===n.actualId||n.isLoaded||n.isLoading||t.load(n)}))},t.prototype.finalizeLoading=function(t,e){t.finalizeLoading(),t.isLoaded=!0;var n=this.nonLoadedImages.indexOf(t);if(this.nonLoadedImages.splice(n,1),0===this.nonLoadedImages.length&&this.raiseReadyStateChanged(!0),!t.referenceInfo&&e.base64){var i=o.Base64Utils.normalizeToDataUrl(e.base64,"image/png");this.cache.forEach((function(e){var n=e.base64===i&&e!==t&&e.isLoaded;return n&&(t.referenceInfo=e.referenceInfo?e.referenceInfo:e),n})),t.base64=i}},t.prototype.hasNonLoadedImages=function(){return 0!==this.nonLoadedImages.length},t.prototype.getNextActualId=function(){return this.lastActualId++},t.prototype.findInfoByBase64=function(t){return t=o.Base64Utils.normalizeToDataUrl(t,"image/png"),this.findInfoCore((function(e){return e.base64===t}))},t.prototype.findInfoByUrl=function(t){return this.findInfoCore((function(e){return e.imageUrl===t}))},t.prototype.findInfoCore=function(t){var e;return this.cache.forEach((function(n){t(n)&&(e=n)})),e},t.prototype.raiseReadyStateChanged=function(t){this.onReadyStateChanged.raise1((function(e){return e.notifyImageCacheReadyStateChanged(t)}))},t.instance=new t,t}();e.ImageCache=a},6617:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageInfo=void 0;var o=n(6477),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:!1,configurable:!0}),Object.defineProperty(t.prototype,"unableToLoad",{get:function(){return this.loadFailed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderUrl",{get:function(){return this.base64||""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"exportUrl",{get:function(){return this.base64?this.base64:this.url},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"actualUrl",{get:function(){return this.url?this.url:this.base64},enumerable:!1,configurable:!0}),Object.defineProperty(t,"transparentOnePixelImage",{get:function(){return this.transparentWhiteImage1_1},enumerable:!1,configurable:!0}),t.prototype.loadBase64Content=function(t){this.base64=o.Base64Utils.normalizeToDataUrl(t,"image/png")},t.prototype.setUnableToLoadFlag=function(){this.loadFailed=!0},t.transparentWhiteImage1_1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAANSURBVBhXY/j///9/AAn7A/0FQ0XKAAAAAElFTkSuQmCC",t}();e.ImageInfo=i},590:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImageLoader=void 0;var o=n(7176),i=function(){function t(t){this.loadedCallback=t}return t.prototype.load=function(t){t.isLoaded?this.loadedCallback(t):t.isLoading||this.loadInner(t)},t.prototype.loadInner=function(t){var e=this;return t.imageUrl?this.loadPictureByUrl(t,(function(){return e.finalizeLoading(t,t)})):t.base64&&this.loadPictureByBase64(t,(function(){return e.finalizeLoading(t,t)})),t},t.prototype.finalizeLoading=function(t,e){e||(e=o.ImageCache.instance.getImageData(t.actualId)),e.isLoaded||o.ImageCache.instance.finalizeLoading(e,t),this.loadedCallback(e)},t.prototype.loadPictureByBase64=function(t,e){var n=new Image;n.onload=function(){e(t)},n.src=t.base64},t.prototype.loadPictureByUrl=function(t,e){var n=this,o=new XMLHttpRequest;try{o.onload=function(){var i=new FileReader;i.onloadend=function(){t.base64=i.result,n.loadPictureByBase64(t,(function(t){return e(t)}))},i.readAsDataURL(o.response)},o.onerror=function(){return e(t)},o.onloadend=function(){404===o.status&&e(t)},o.open("GET",t.imageUrl,!0),o.responseType="blob",t.startLoading(),o.send()}catch(t){}},t}();e.ImageLoader=i},5941:function(t,e,n){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])},o(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}),e.BPMNNode=e.BPMNImporter=void 0;var r=n(213),s=n(2259),a=n(8217),c=n(6572),u=function(){function t(t){this.doc=c.ImportUtils.createDocument(t),this.graph=new r.Graph([],[])}return t.prototype.import=function(){for(var t=void 0,e=0;t=this.doc.children[e];e++)"DEFINITIONS"===t.nodeName.toUpperCase()&&this.onDefinitionsElement(t);return this.validate(),this.graph},t.prototype.validate=function(){var t={};this.graph.nodes.forEach((function(e){return t[e]=!0}));for(var e=0,n=void 0;n=this.graph.edges[e];e++)t[n.from]&&t[n.to]||(this.graph.edges.splice(e,1),e--)},t.prototype.onDefinitionsElement=function(t){this.dataSourceKey=t.getAttribute("id");for(var e=void 0,n=0;e=t.children[n];n++)"PROCESS"===e.nodeName.toUpperCase()&&this.onProcessElement(e)},t.prototype.onProcessElement=function(t){for(var e=void 0,n=0;e=t.children[n];n++)switch(e.nodeName.toUpperCase()){case"STARTEVENT":this.onStartEventElement(e);break;case"SEQUENCEFLOW":this.onSequenceFlowElement(e);break;case"SCRIPTTASK":this.onScriptTaskElement(e);break;case"USERTASK":this.onUserTaskElement(e);break;case"SERVICETASK":this.onServiceTaskElement(e);break;case"SENDTASK":this.onSendTaskElement(e);break;case"EXCLUSIVEGATEWAY":this.onExclusiveGateway(e);break;case"ENDEVENT":this.onEndEventGateway(e)}},t.prototype.onStartEventElement=function(t){var e=this.createNode(t);e.type=s.ShapeTypes.Ellipse,e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onSequenceFlowElement=function(t){var e=t.getAttribute("sourceRef"),n=t.getAttribute("targetRef"),o=this.createEdge(t,e,n);t.hasAttribute("name")&&(o.text=t.getAttribute("name")),this.graph.addEdge(o)},t.prototype.onScriptTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onUserTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onServiceTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onSendTaskElement=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),this.graph.addNode(e)},t.prototype.onExclusiveGateway=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),e.type=s.ShapeTypes.Decision,this.graph.addNode(e)},t.prototype.onEndEventGateway=function(t){var e=this.createNode(t);e.text=t.getAttribute("name"),e.type=s.ShapeTypes.Ellipse,this.graph.addNode(e)},t.prototype.createNode=function(t){return new h(this.dataSourceKey,t.getAttribute("id"))},t.prototype.createEdge=function(t,e,n){return new p(this.dataSourceKey,t.getAttribute("id"),e,n)},t}();e.BPMNImporter=u;var h=function(t,e){this.sourceKey=t,this.key=e,this.type=s.ShapeTypes.Rectangle};e.BPMNNode=h;var p=function(t){function e(e,n,o,i){var r=t.call(this,n,o,i)||this;return r.sourceKey=e,r}return i(e,t),e}(a.Edge)},5885:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Exporter=void 0;var o=n(5503),i=n(7959),r=n(8675),s=function(){function t(){}return t.prototype.export=function(t){var e={page:{},connectors:[],shapes:[]};return e.page={width:t.size.width,height:t.size.height,pageColor:t.pageColor,pageWidth:t.pageSize.width,pageHeight:t.pageSize.height,pageLandscape:t.pageLandscape},this.exportItemsCore(t.items,e),JSON.stringify(e)},t.prototype.exportItems=function(t){var e={connectors:[],shapes:[]};return this.exportItemsCore(t,e),JSON.stringify(e)},t.prototype.exportItemsCore=function(t,e){var n=this;t.forEach((function(t){if(t instanceof o.Shape)e.shapes.push(n.exportShape(t));else if(t instanceof i.Connector){var r=n.exportConnector(t);t.beginItem&&(r.beginItemKey=t.beginItem.key,r.beginConnectionPointIndex=t.beginConnectionPointIndex),t.endItem&&(r.endItemKey=t.endItem.key,r.endConnectionPointIndex=t.endConnectionPointIndex),e.connectors.push(r)}}))},t.prototype.exportItem=function(t){return{key:t.key,dataKey:t.dataKey,customData:r.ObjectUtils.cloneObject(t.customData),locked:t.locked,zIndex:t.zIndex}},t.prototype.exportShape=function(t){var e=this.exportItem(t);e.type=t.description.key,e.text=t.text,t.image.isEmpty||(e.imageUrl=t.image.exportUrl),e.x=t.position.x,e.y=t.position.y,e.width=t.size.width,e.height=t.size.height;var n=t.parameters.toObject();n&&(e.parameters=n);var o=t.style.toObject();o&&(e.style=o);var i=t.styleText.toObject();return i&&(e.styleText=i),t.children.length&&(e.childKeys=t.children.map((function(t){return t.key}))),t.expanded||(e.expanded=!1),t.expandedSize&&(e.expandedWidth=t.expandedSize.width,e.expandedHeight=t.expandedSize.height),e},t.prototype.exportConnector=function(t){var e=this.exportItem(t);e.points=t.points.map((function(t){return{x:t.x,y:t.y}}));var n=t.texts.toObject();n&&(e.texts=n);var o=t.properties.toObject();o&&(e.properties=o);var i=t.style.toObject();i&&(e.style=i);var r=t.styleText.toObject();r&&(e.styleText=r);var s=t.tryCreateRenderPointsContext();return s&&(e.context=s.toObject()),e},t.prototype.exportSvg=function(t,e,n,o){n.exportSvgImage(t,e,o)},t.prototype.exportPng=function(t,e,n,o,i){n.exportPngImage(t,e,o,i)},t.prototype.exportJpg=function(t,e,n,o,i){n.exportJpgImage(t,e,o,i)},t}();e.Exporter=s},6572:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImportUtils=void 0;var n=function(){function t(){}return t.parseJSON=function(t){if(!t||""===t)return{};try{return JSON.parse(t)}catch(t){return{}}},t.createDocument=function(t){return(new DOMParser).parseFromString(t,"application/xml")},t}();e.ImportUtils=n},2406:function(t,e,n){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])},o(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}),e.Importer=void 0;var r=n(5503),s=n(8675),a=n(6353),c=n(8900),u=n(8397),h=n(7959),p=n(6617),l=n(8577),d=n(6572),f=n(13),y=n(1510),g=function(t){function e(e,n){var o=t.call(this,e)||this;return o.obj=d.ImportUtils.parseJSON(n),o}return i(e,t),e.prototype.getObject=function(){return this.obj},e.prototype.getPageObject=function(t){return t.page},e.prototype.getShapeObjects=function(t){return t.shapes},e.prototype.getConnectorObjects=function(t){return t.connectors},e.prototype.importPageSettings=function(t,e){e&&(this.assert(e.width,"number"),this.assert(e.height,"number"),"number"==typeof e.width&&(t.size.width=e.width),"number"==typeof e.height&&(t.size.height=e.height),"number"==typeof e.pageColor?t.pageColor=e.pageColor:"string"==typeof e.pageColor&&(t.pageColor=f.ColorUtils.fromString(e.pageColor)),"number"==typeof e.pageWidth&&(t.pageSize.width=e.pageWidth),"number"==typeof e.pageHeight&&(t.pageSize.height=e.pageHeight),"boolean"==typeof e.pageLandscape&&(t.pageLandscape=e.pageLandscape))},e.prototype.importShape=function(t){this.assert(t.key,"string"),this.assert(t.x,"number"),this.assert(t.y,"number"),this.assert(t.type,"string");var e=t.type,n=this.shapeDescriptionManager.get(e),o=new c.Point(t.x,t.y),i=new r.Shape(n||u.ShapeDescriptionManager.default,o);return i.key=t.key,"string"!=typeof t.dataKey&&"number"!=typeof t.dataKey||(i.dataKey=t.dataKey),"object"==typeof t.customData&&(i.customData=s.ObjectUtils.cloneObject(t.customData)),"boolean"==typeof t.locked&&(i.locked=t.locked),"number"==typeof t.width&&(i.size.width=t.width),"number"==typeof t.height&&(i.size.height=t.height),"string"==typeof t.text&&(i.text=t.text),"string"==typeof t.imageUrl&&(i.image=new p.ImageInfo(t.imageUrl)),t.parameters&&(i.parameters.fromObject(t.parameters),i.description.normalizeParameters(i,i.parameters)),t.style&&i.style.fromObject(t.style),t.styleText&&i.styleText.fromObject(t.styleText),"number"==typeof t.zIndex&&(i.zIndex=t.zIndex),Array.isArray(t.childKeys)&&(i.childKeys=t.childKeys.slice()),"boolean"==typeof t.expanded&&(i.expanded=t.expanded),"number"==typeof t.expandedWidth&&"number"==typeof t.expandedHeight&&(i.expandedSize=new a.Size(t.expandedWidth,t.expandedHeight)),i},e.prototype.importShapeChildren=function(t,e){return[]},e.prototype.importConnector=function(t){var e=this;if(this.assert(t.key,"string"),!Array.isArray(t.points))throw Error("Invalid Format");var n=t.points.map((function(t){return e.assert(t.x,"number"),e.assert(t.y,"number"),new c.Point(t.x,t.y)})),o=new h.Connector(n);return o.key=t.key,"string"!=typeof t.dataKey&&"number"!=typeof t.dataKey||(o.dataKey=t.dataKey),"object"==typeof t.customData&&(o.customData=s.ObjectUtils.cloneObject(t.customData)),"boolean"==typeof t.locked&&(o.locked=t.locked),o.endConnectionPointIndex="number"==typeof t.endConnectionPointIndex?t.endConnectionPointIndex:-1,o.beginConnectionPointIndex="number"==typeof t.beginConnectionPointIndex?t.beginConnectionPointIndex:-1,void 0!==t.endItemKey&&this.assert(t.endItemKey,"string"),void 0!==t.beginItemKey&&this.assert(t.beginItemKey,"string"),o.endItemKey=t.endItemKey,o.beginItemKey=t.beginItemKey,t.texts&&o.texts.fromObject(t.texts),t.properties&&o.properties.fromObject(t.properties),t.style&&o.style.fromObject(t.style),t.styleText&&o.styleText.fromObject(t.styleText),"number"==typeof t.zIndex&&(o.zIndex=t.zIndex),void 0!==t.context&&o.replaceRenderPoints(y.ConnectorRenderPointsContext.fromObject(t.context),!1),o},e}(l.ImporterBase);e.Importer=g},8577:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImporterBase=void 0;var o=n(6613),i=n(5503),r=function(){function t(t){this.shapeDescriptionManager=t}return t.prototype.import=function(){var t=new o.DiagramModel,e=this.getObject();this.importPageSettings(t,this.getPageObject(e));for(var n=this.importShapes(this.getShapeObjects(e)),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=this.shapeDescriptionManager.get(i),a=new s.Shape(r||u.ShapeDescriptionManager.default,n);a.key=this.getItemKey(t);var c=t.getAttribute("Size"),h=this.getSize(c);h&&(a.size=h);var p=t.getAttribute("Content");if("string"==typeof p)a.text=p;else{var l=t.getAttribute("Header");"string"==typeof l&&(a.text=l)}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?c.ShapeTypes.VerticalContainer:c.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(f.UnitConverter.pixelsToTwips(e[0]),f.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 p.Point(f.UnitConverter.pixelsToTwips(e[0]),f.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.ColorUtils.colorToHash(e)},e.shapeTypes={"BasicShapes.Rectangle":c.ShapeTypes.Rectangle,"BasicShapes.Ellipse":c.ShapeTypes.Ellipse,"BasicShapes.Triangle":c.ShapeTypes.Triangle,"BasicShapes.Pentagon":c.ShapeTypes.Pentagon,"BasicShapes.Hexagon":c.ShapeTypes.Hexagon,"BasicShapes.Octagon":c.ShapeTypes.Octagon,"BasicShapes.Diamond":c.ShapeTypes.Diamond,"BasicShapes.Cross":c.ShapeTypes.Cross,"BasicShapes.Star5":c.ShapeTypes.Star,"BasicFlowchartShapes.StartEnd":c.ShapeTypes.Terminator,"BasicFlowchartShapes.Data":c.ShapeTypes.Data,"BasicFlowchartShapes.Database":c.ShapeTypes.Database,"BasicFlowchartShapes.ExternalData":c.ShapeTypes.StoredData,"BasicFlowchartShapes.Process":c.ShapeTypes.Process,"BasicFlowchartShapes.Decision":c.ShapeTypes.Decision,"BasicFlowchartShapes.Subprocess":c.ShapeTypes.PredefinedProcess,"BasicFlowchartShapes.Document":c.ShapeTypes.Document,"BasicFlowchartShapes.Custom1":c.ShapeTypes.ManualInput,"BasicFlowchartShapes.Custom2":c.ShapeTypes.ManualOperation,"ArrowShapes.SimpleArrow":c.ShapeTypes.ArrowLeft,"ArrowShapes.SimpleDoubleArrow":c.ShapeTypes.ArrowLeftRight},e}(a.ImporterBase);e.XmlImporter=y},5227:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutBuilder=void 0;var o=n(8710),i=function(){function t(t,e){this.settings=t,this.graph=e}return t.prototype.getBreadthNodeSizeCore=function(t,e){var n=this.settings.orientation===o.DataLayoutOrientation.Vertical?t.size.width:t.size.height;return e||(n+=this.settings.orientation===o.DataLayoutOrientation.Vertical?t.margin.left+t.margin.right:t.margin.top+t.margin.bottom),n},t.prototype.getDepthNodeSizeCore=function(t){return this.settings.orientation===o.DataLayoutOrientation.Horizontal?t.size.width+t.margin.left+t.margin.right:t.size.height+t.margin.top+t.margin.bottom},t.prototype.chooseDirectionValue=function(t,e){return this.settings.direction===o.LogicalDirectionKind.Forward?t:e},t.prototype.getDirectionValue=function(t){return this.settings.direction===o.LogicalDirectionKind.Forward?t:-t},t.prototype.getComponentOffset=function(t){var e=t.getRectangle(!0);return(this.settings.orientation===o.DataLayoutOrientation.Vertical?e.width:e.height)+this.settings.componentSpacing},t.prototype.setComponentOffset=function(t,e){return this.settings.orientation===o.DataLayoutOrientation.Vertical?t.offsetNodes(e):t.offsetNodes(0,e)},t}();e.LayoutBuilder=i},1256:function(t,e,n){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])},o(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}),e.EdgeOnLayer=e.NodeOnLayer=e.SugiyamaNodesOrderer=e.SugiyamaLayerDistributor=e.SugiyamaLayoutBuilder=void 0;var r=n(5227),s=n(213),a=n(617),c=n(8217),u=n(701),h=n(2400),p=n(8900),l=n(8710),d=n(8119),f=n(7959),y=n(7309),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.build=function(){var t=this,e=0,n=new d.GraphLayout,o=new v;return this.graph.getConnectedComponents().forEach((function(i){var r=y.CycleRemover.removeCycles(i),s=m.getLayers(r.graph),a=o.orderNodes(r.graph,s),c=Object.keys(r.removedEdges).map((function(t){return i.getEdge(t)})),u=o.assignAbsCoordinates(a),h=t.createInfoGraphLayout(u,r.reversedEdges,c);n.extend(t.setComponentOffset(h,e)),e+=t.getComponentOffset(h)})),n},e.prototype.createInfoGraphLayout=function(t,e,n){for(var o=this,i=new p.Point(0,0),r=t.items,s=new u.HashSet(r.map((function(t){return t.layer})).sort((function(t,e){return t-e}))),a=this.getAbsOffsetInfo(t.items),c={},h=0,f=Number.MAX_SAFE_INTEGER||Number.MAX_VALUE,y=Number.MIN_SAFE_INTEGER||Number.MAX_VALUE,g=function(t){var e=s.item(t),n=0;r.filter((function(t){return t.layer===e})).sort((function(t,e){return t.position-e.position})).forEach((function(t){var e=o.getDepthNodeSize(t),r=o.chooseDirectionValue(0,e),s=o.getAbsPosition(t.position,o.getBreadthNodeSize(t),a);i=o.setBreadth(i,s);var u=o.setDepthOffset(i,-r);if(c[t.key]=u,!t.isDummy){var h=o.settings.orientation===l.DataLayoutOrientation.Horizontal?u.y:u.x;f=Math.min(f,h),y=Math.max(y,h+o.getBreadthNodeSize(t)),n=Math.max(n,o.getDepthNodeSize(t))}})),h+=n,i=m.setBreadth(i,0),i=m.setDepthOffset(i,m.getDirectionValue(n+m.settings.layerSpacing))},m=this,v=0;v=1)y.push(r),y.push({from:i.from,to:r.to}),y.push({from:r.from,to:i.to});else if(d.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 g=l.position===d.position&&0===d.position?[c,u]:[u,c];g.forEach((function(t){return y.push(t)})),g.forEach((function(t){y.push({from:t.from,to:i.to}),y.push({from:i.from,to:t.to})}))}y.push(i);for(var m=0,v=void 0;v=y[m];m++){var P=l.key+"_"+v.from,C=d.key+"_"+v.to;if(h[P]!==f.ConnectorPosition.End&&h[C]!==f.ConnectorPosition.Begin){e.addEdge(new a.EdgeLayout(o.key,v.from,v.to)),h[P]=f.ConnectorPosition.Begin,h[C]=f.ConnectorPosition.End;break}}}}))},e.prototype.getDirectEdgeLayout=function(){return this.settings.orientation===l.DataLayoutOrientation.Horizontal?this.settings.direction===l.LogicalDirectionKind.Forward?{from:1,to:3}:{from:3,to:1}:this.settings.direction===l.LogicalDirectionKind.Forward?{from:2,to:0}:{from:0,to:2}},e.prototype.getDiffLevelEdgeLayout=function(t){return this.settings.orientation===l.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===l.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=x(t.position);o(t,e),n[e]%1!=0&&o(t,e+1)}));var i={},r=0;return Object.keys(n).sort((function(t,e){return parseFloat(t)-parseFloat(e)})).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===l.DataLayoutOrientation.Vertical?new p.Point(e,t.y):new p.Point(t.x,e)},e.prototype.setDepthOffset=function(t,e){return this.settings.orientation===l.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=x(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=g;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)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]-=n);return e},t}();e.SugiyamaLayerDistributor=m;var v=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===C.BottomLeft||o===C.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})),a=new u.HashSet;s.length;){var c=s.item(0),h=this.getBlock(t,c,n,o).filter((function(t){return a.tryPush(t.key)}));i.push(h),h.forEach((function(t){return s.remove(t)}))}return i.sort((function(t,e){var n=t.reduce((function(t,e){return e.positiono.position?1:-1;var i=e.reduce((function(t,e){return e.positioni.position?1:-1:n.layer>i.layer?1:-1})),i},t.prototype.getBlock=function(t,e,n,o){var i=[],r=null;do{r&&(e=o===C.TopLeft||o===C.TopRight?t.getNode(r.from):t.getNode(r.to)),i.push(e),r=n[e.key]}while(r);return i},t.prototype.resolveMedianConflicts=function(t,e,n,o){var i=this,r={},s=function(s){if(!Object.prototype.hasOwnProperty.call(e,s))return"continue";var a,c,u=e[s];o!==C.TopRight&&o!==C.BottomRight||(u=u.slice(0).sort((function(t,e){return e.position-t.position}))),u.forEach((function(e){var s=n[e.key];if(s){var u=o===C.TopLeft||o===C.TopRight?s.from:s.to,h=t.getNode(u).position;i.checkMedianConfict(a,c,h,o)?r[e.key]=null:(a=void 0===a?h:Math.min(a,h),c=void 0===c?h:Math.max(c,h),r[e.key]=s)}else r[e.key]=null}))};for(var a in e)s(a);return r},t.prototype.checkMedianConfict=function(t,e,n,o){return void 0!==t&&void 0!==e&&(o===C.TopLeft||o===C.BottomLeft?e>=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===C.TopLeft||e===C.BottomLeft)return Math.floor(t/2)-1;if(e===C.TopRight||e===C.BottomRight)return Math.floor(t/2);throw new Error("Invalid Operation")},t.prototype.getActualAdjacentEdges=function(t,e,n){return n===C.TopLeft||n===C.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=v;var P=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=P;var C,S=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:!1,configurable:!0}),t}();function x(t){return Math.trunc?Math.trunc(t):isFinite(t)?t-t%1||(t<0?-0:0===t?t:0):t}e.EdgeOnLayer=S,function(t){t[t.TopLeft=0]="TopLeft",t[t.TopRight=1]="TopRight",t[t.BottomLeft=2]="BottomLeft",t[t.BottomRight=3]="BottomRight"}(C||(C={}))},9533:function(t,e,n){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])},o(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}),e.TreeLayoutBuilder=void 0;var r=n(8119),s=n(5148),a=n(617),c=n(8675),u=n(8900),h=n(5227),p=n(8217),l=n(3742),d=n(8710),f=n(213),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.nodeToLevel={},e.levelDepthSize={},e}return i(e,t),e.prototype.build=function(){var t=this,e=new r.GraphLayout,n=0;return this.graph.getConnectedComponents().forEach((function(o){for(var i=s.Tree.createSpanningTree(o),r=t.processTree(i),a=t.getComponentOffset(r);r.nodeKeys.length=0}))).length){var i=this.getMaxDepthSize(e);this.levelDepthSize[n]=i,this.preProcessTree(t,[].concat.apply([],e.map((function(e){return t.getChildren(e)}))),n+1)}},e.prototype.loadNodes=function(t,e,n){return n?t.getChildren(n.info).map((function(t){return e.hasNode(t.key)?void 0:e.addNode(new a.NodeLayout(t,u.Point.zero()))})).filter((function(t){return t})):[e.addNode(new a.NodeLayout(t.root,u.Point.zero()))]},e.prototype.processTree=function(t){var e=this,n=new r.GraphLayout;if(this.preProcessTree(t,[t.root],0),this.processLevel(t,n,0,new c.Range(0),0),this.settings.direction===d.LogicalDirectionKind.Backward){var o=Object.keys(this.levelDepthSize).map((function(t){return e.levelDepthSize[t]})),i=o.reduce((function(t,e){return t+e}),0)+(o.length-1)*this.settings.layerSpacing;n.forEachNode((function(t){return e.setDepthPos(t,e.getDepthPos(t)+i)}))}return n},e.prototype.processLevel=function(t,e,n,o,i,r){var s,a=this,u=this.addNodes(t,e,i,r),h=r?this.graph.getAdjacentEdges(r.key,p.ConnectionMode.Outgoing):[],l=this.getDirectionValue(this.levelDepthSize[i]),d=this.getDirectionValue(this.settings.layerSpacing);if(u.forEach((function(r){var u=c.Range.fromLength(s?s.to+a.settings.columnSpacing:o.from,a.getBreadthNodeSizeCore(r.info));r.position=a.getNodePosition(u.from,n,l).clone().offset(r.info.margin.left,r.info.margin.top),a.processLevel(t,e,n+l+d,u,i+1,r),a.updateEdgeConnections(e,h,r),o.extend(u),s=u})),r&&u.length){var f=u[u.length-1],y=new c.Range(this.getBreadthPos(u[0]),this.getBreadthPos(f)+this.getBreadthNodeSizeCore(f.info,!0));this.alignParent(r,y,o)}},e.prototype.addNodes=function(t,e,n,o){var i=this;return 0===n?[e.addNode(new a.NodeLayout(t.root,u.Point.zero()))]:t.getChildren(o.info).reduce((function(t,o){return i.nodeToLevel[o.key]!==n||e.hasNode(o.key)||t.push(e.addNode(new a.NodeLayout(o,u.Point.zero()))),t}),[])},e.prototype.getMaxDepthSize=function(t){var e=this;return t.reduce((function(t,n){return Math.max(t,e.getDepthNodeSizeCore(n))}),0)},e.prototype.getNodePosition=function(t,e,n){return this.settings.direction===d.LogicalDirectionKind.Forward?this.settings.orientation===d.DataLayoutOrientation.Vertical?new u.Point(t,e):new u.Point(e,t):this.settings.orientation===d.DataLayoutOrientation.Vertical?new u.Point(t,e+n):new u.Point(e+n,t)},e.prototype.updateEdgeConnections=function(t,e,n){var o=this;e.filter((function(t){return t.to===n.key})).forEach((function(e){var n=o.getBeginEdgeIndex(),i=o.getEndEdgeIndex();t.addEdge(new a.EdgeLayout(e.key,n,i))}))},e.prototype.getBeginEdgeIndex=function(){return this.settings.direction===d.LogicalDirectionKind.Forward?this.isVertical()?l.ConnectionPointSide.South:l.ConnectionPointSide.East:this.isVertical()?l.ConnectionPointSide.North:l.ConnectionPointSide.West},e.prototype.getEndEdgeIndex=function(){return this.settings.direction===d.LogicalDirectionKind.Forward?this.isVertical()?l.ConnectionPointSide.North:l.ConnectionPointSide.West:this.isVertical()?l.ConnectionPointSide.South:l.ConnectionPointSide.East},e.prototype.alignParent=function(t,e,n){if(this.settings.alignment===d.Alignment.Center){var o=e.from+e.length/2-this.getBreadthNodeSizeCore(t.info,!0)/2;this.settings.orientation===d.DataLayoutOrientation.Vertical?(t.position.x=Math.max(n.from+t.info.margin.left,o),t.position.x=Math.min(n.to-t.info.size.width-t.info.margin.right,t.position.x)):(t.position.y=Math.max(n.from+t.info.margin.top,o),t.position.y=Math.min(n.to-t.info.size.height-t.info.margin.bottom,t.position.y))}},e.prototype.getDepthPos=function(t){return this.settings.orientation===d.DataLayoutOrientation.Vertical?t.position.y:t.position.x},e.prototype.getBreadthPos=function(t){return this.settings.orientation===d.DataLayoutOrientation.Vertical?t.position.x:t.position.y},e.prototype.setDepthPos=function(t,e){this.settings.orientation===d.DataLayoutOrientation.Vertical?t.position.y=e:t.position.x=e},e.prototype.isVertical=function(){return this.settings.orientation===d.DataLayoutOrientation.Vertical},e}(h.LayoutBuilder);e.TreeLayoutBuilder=y},213:function(t,e,n){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])},o(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}),e.GraphIterator=e.FastGraph=e.Graph=void 0;var r=n(8217),s=n(5503),a=n(2400),c=n(701),u=function(){function t(t,e){this.nodeMap={},this.edgeMap={},this.nodes=[],this.edges=[],this.onInit(),t.forEach(this.addNode.bind(this)),e.forEach(this.addEdge.bind(this))}return Object.defineProperty(t.prototype,"items",{get:function(){return this.nodes.map(this.getNode.bind(this))},enumerable:!1,configurable:!0}),t.prototype.onInit=function(){},t.prototype.addEdge=function(t){this.edgeMap[t.key]=t,this.edges.push(t)},t.prototype.addNode=function(t){this.nodeMap[t.key]=t,this.nodes.push(t.key)},t.prototype.getNode=function(t){return this.nodeMap[t]},t.prototype.getEdge=function(t){return this.edgeMap[t]},t.prototype.isEmpty=function(){return!this.nodes.length&&!this.edges.length},t.prototype.getAdjacentEdges=function(t,e){return void 0===e&&(e=r.ConnectionMode.OutgoingAndIncoming),this.edges.filter((function(n){return e&r.ConnectionMode.Incoming&&n.to===t||e&r.ConnectionMode.Outgoing&&n.from===t}))},t}(),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.cast=function(t,n){var o=this;return new e(this.nodes.map((function(e){return t(o.getNode(e))})),this.edges.map((function(t){return n?n(t):t})))},e.prototype.getConnectedComponents=function(){var t=this.createIterator(r.ConnectionMode.OutgoingAndIncoming);t.visitEachEdgeOnce=!0;for(var n=[],o=function(o){var r=[],s=[];t.onNode=function(t){return r.push(t)},t.onEdge=function(t){return s.push(t)},t.iterate(i.nodes[o]),r.length&&n.push(new e(r,s))},i=this,s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.GraphInfo=void 0;var o=n(1755),i=function(){function t(t,e){this.container=t,this.sourceGraph=e}return Object.defineProperty(t.prototype,"graph",{get:function(){return this._graph||(this._graph=this.getNodeInfoGraph())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"level",{get:function(){return void 0!==this._level?this._level:this._level=this.getLevel()},enumerable:!1,configurable:!0}),t.prototype.getNodeInfoGraph=function(){return this.sourceGraph.cast(o.LayoutUtils.shapeToLayout)},t.prototype.getLevel=function(){var t=0;return this.container&&(t=this.getContainerLevel(this.container)),t},t.prototype.getContainerLevel=function(t){var e=1,n=t.container;return n&&(e+=this.getContainerLevel(n)),e},t}();e.GraphInfo=i},8119:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GraphLayout=void 0;var o=n(8675),i=n(617),r=function(){function t(){this.nodeKeys=[],this.nodeToLayout={},this.edgeToPosition={}}return t.prototype.forEachNode=function(t){var e=this;this.nodeKeys.forEach((function(n){return t(e.nodeToLayout[n],n)}))},t.prototype.reduce=function(t,e){var n=this;return this.nodeKeys.reduce((function(e,o,i){return t(e,n.nodeToLayout[o],i)}),e)},t.prototype.addNode=function(t){if(this.nodeToLayout[t.key])throw Error("Node layout is already registered");return this.nodeKeys.push(t.key),this.nodeToLayout[t.key]=t,t},t.prototype.hasNode=function(t){return!!this.nodeToLayout[t]},t.prototype.addEdge=function(t){if(this.edgeToPosition[t.key])throw Error("Edge layout is already registered");this.edgeToPosition[t.key]=t},t.prototype.getRectangle=function(t){var e=this;return o.GeometryUtils.getCommonRectangle(this.nodeKeys.map((function(t){return e.nodeToLayout[t].rectangle})))},t.prototype.offsetNodes=function(e,n){var o=this;void 0===e&&(e=0),void 0===n&&(n=0);var r=new t;return this.nodeKeys.forEach((function(t){var s=o.nodeToLayout[t];r.addNode(new i.NodeLayout(s.info,s.position.clone().offset(e,n)))})),r.copyEdges(this),r},t.prototype.extend=function(t){var e=this;t.forEachNode((function(t){return e.addNode(t)})),this.copyEdges(t)},t.prototype.copyEdges=function(t){var e=this;Object.keys(t.edgeToPosition).forEach((function(n){var o=t.edgeToPosition[n];e.addEdge(new i.EdgeLayout(o.key,o.beginIndex,o.endIndex))}))},t}();e.GraphLayout=r},8710:function(t,e,n){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])},o(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}),e.Alignment=e.DataLayoutOrientation=e.LogicalDirectionKind=e.TreeLayoutSettings=e.LayoutSettings=void 0;var r=n(7959),s=function(t){this.orientation=c.Vertical,this.direction=a.Forward;var e=t&&2*t>r.Connector.minOffset?2*t:r.Connector.minOffset;this.columnSpacing=e,this.layerSpacing=2*e,this.containerPadding=2*e,this.componentSpacing=2*e};e.LayoutSettings=s;var a,c,u,h=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=h,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={}))},1755:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutUtils=void 0;var o=n(617),i=function(){function t(){}return t.shapeToLayout=function(t){var e=new o.Margin(0),n=t.rectangle;t.attachedConnectors.filter((function(t){return!t.beginItem||!t.endItem})).forEach((function(t){var o=t.rectangle;e.left=Math.max(e.left,n.x-o.x),e.right=Math.max(e.right,o.right-n.right),e.top=Math.max(e.top,n.y-o.y),e.bottom=Math.max(e.bottom,o.bottom-n.bottom)}));var i=new o.NodeInfo(t.key,e,t.size.clone());return i.connectionPoints=t.description.getConnectionPoints(),i},t}();e.LayoutUtils=i},617:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Margin=e.EdgeLayout=e.NodeLayout=e.NodeInfo=void 0;var o=n(8011),i=function(t,e,n,o){void 0===o&&(o=[]),this.key=t,this.margin=e,this.size=n,this.connectionPoints=o};e.NodeInfo=i;var r=function(){function t(t,e){this.info=t,this.position=e}return Object.defineProperty(t.prototype,"key",{get:function(){return this.info.key},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rectangle",{get:function(){return o.Rectangle.fromGeometry(this.position,this.info.size)},enumerable:!1,configurable:!0}),t}();e.NodeLayout=r;var s=function(t,e,n){this.key=t,this.beginIndex=e,this.endIndex=n};e.EdgeLayout=s;var a=function(){function t(t,e,n,o){void 0===e&&(e=t),void 0===n&&(n=t),void 0===o&&(o=t),this.top=t,this.right=e,this.bottom=n,this.left=o}return t.empty=function(){return new t(0)},t}();e.Margin=a},8217:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectionMode=e.PositionInfo=e.Edge=void 0;var n=function(){function t(t,e,n,o){void 0===o&&(o=1),this.weight=o,this.key=t,this.from=e,this.to=n}return t.prototype.getHashKey=function(){return this.from+"_"+this.to},t.prototype.reverse=function(){return new t(this.key,this.to,this.from,this.weight)},t}();e.Edge=n;var o=function(t,e){this.item=t,this.position=e};e.PositionInfo=o,function(t){t[t.Outgoing=1]="Outgoing",t[t.Incoming=2]="Incoming",t[t.OutgoingAndIncoming=3]="OutgoingAndIncoming"}(e.ConnectionMode||(e.ConnectionMode={}))},5148:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Tree=void 0;var o=n(8217),i=function(){function t(t,e){var n=this;this.childToParent={},this.root=t,this.parentToChildren=e;var o=function(t){if(!Object.prototype.hasOwnProperty.call(e,t))return"continue";e[t].forEach((function(e){return n.childToParent[e.key]=t}))};for(var i in e)o(i)}return t.prototype.getChildren=function(t){return t&&this.parentToChildren[t.key]?this.parentToChildren[t.key]:[]},t.prototype.hasChildren=function(t){return this.parentToChildren[t.key]&&this.parentToChildren[t.key].length>0},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.inc{Object.defineProperty(e,"__esModule",{value:!0}),e.CycleRemover=void 0;var o=n(213),i=n(8217),r=n(701),s=function(){function t(){}return t.removeCycles=function(t){var e=this.getFeedbackSet(t);return this.reverseEdges(t,e)},t.getFeedbackSet=function(t){for(var e=this,n={},o=this.getNonTrivialStronglyConnectedComponents(t);o.length;)o.forEach((function(t){var o=e.getMaxCyclicEdges(t);o.forEach((function(t){return delete n[t.reverse().getHashKey()]})),o.forEach((function(t){return n[t.getHashKey()]=!0}))})),o=this.getNonTrivialStronglyConnectedComponents(this.reverseEdges(t,n).graph);return n},t.getMaxCyclicEdges=function(t){var e={},n={},o={},s=[],a=[],c=t.createIterator(i.ConnectionMode.Outgoing);c.visitEachEdgeOnce=!1,c.onNode=function(t){n[t.key]=!0},c.skipNode=function(t){if(n[t.key]){for(var i=[],r=0;ro[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={},h=0;h0;)this.pickNext(t,e[0],e[1]);return e},t.prototype.pickLinear=function(t){for(var e,n,o=t.length-1,i=0,r=t.length-1,s=0,a=t.length-2,c=void 0;c=t[a];a--)c.rect.x>t[i].rect.x?i=a:c.rect.rightt[s].rect.y?s=a:c.rect.bottomMath.abs(t[r].rect.bottom-t[s].rect.y)?o>i?(e=t.splice(o,1)[0],n=t.splice(i,1)[0]):(n=t.splice(i,1)[0],e=t.splice(o,1)[0]):r>s?(e=t.splice(r,1)[0],n=t.splice(s,1)[0]):(n=t.splice(s,1)[0],e=t.splice(r,1)[0]),[new u(e.rect.clone(),[e]),new u(n.rect.clone(),[n])]},t.prototype.pickNext=function(t,e,n){for(var o,i,s,a=p(e.rect.width,e.rect.height,e.nodes.length+1),c=p(n.rect.width,n.rect.height,n.nodes.length+1),u=t.length-1,h=void 0;h=t[u];u--){var d=new r.Rectangle(Math.min(e.rect.x,h.rect.x),Math.min(e.rect.y,h.rect.y),0,0);d.width=Math.max(e.rect.right,h.rect.right)-d.x,d.height=Math.max(e.rect.bottom,h.rect.bottom)-d.y;var f=Math.abs(p(d.width,d.height,e.nodes.length+2)-a),y=new r.Rectangle(Math.min(n.rect.x,h.rect.x),Math.min(n.rect.y,h.rect.y),0,0);y.width=Math.max(n.rect.right,h.rect.right)-y.x,y.height=Math.max(n.rect.bottom,h.rect.bottom)-y.y;var g=Math.abs(p(y.width,y.height,n.nodes.length+2)-c);(!i||!o||Math.abs(g-f){Object.defineProperty(e,"__esModule",{value:!0}),e.HashSet=void 0;var n=function(){function t(t,e){var n=this;void 0===t&&(t=[]),void 0===e&&(e=function(t){return t.toString()}),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;o{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramLocalizationService=void 0;var o=n(2259),i=n(5383),r=function(){function t(){}return t.unitItems={},t.formatUnit=function(t){return t.toString()},t.shapeTexts={},t}();e.DiagramLocalizationService=r,r.unitItems[i.DiagramUnit.In]="in",r.unitItems[i.DiagramUnit.Cm]="cm",r.unitItems[i.DiagramUnit.Px]="px",r.shapeTexts[o.ShapeTypes.Text]="Text",r.shapeTexts[o.ShapeTypes.Rectangle]="Rectangle",r.shapeTexts[o.ShapeTypes.Ellipse]="Ellipse",r.shapeTexts[o.ShapeTypes.Cross]="Cross",r.shapeTexts[o.ShapeTypes.Triangle]="Triangle",r.shapeTexts[o.ShapeTypes.Diamond]="Diamond",r.shapeTexts[o.ShapeTypes.Heart]="Heart",r.shapeTexts[o.ShapeTypes.Pentagon]="Pentagon",r.shapeTexts[o.ShapeTypes.Hexagon]="Hexagon",r.shapeTexts[o.ShapeTypes.Octagon]="Octagon",r.shapeTexts[o.ShapeTypes.Star]="Star",r.shapeTexts[o.ShapeTypes.ArrowLeft]="Left Arrow",r.shapeTexts[o.ShapeTypes.ArrowUp]="Up Arrow",r.shapeTexts[o.ShapeTypes.ArrowRight]="Right Arrow",r.shapeTexts[o.ShapeTypes.ArrowDown]="Down Arrow",r.shapeTexts[o.ShapeTypes.ArrowUpDown]="Up Down Arrow",r.shapeTexts[o.ShapeTypes.ArrowLeftRight]="Left Right Arrow",r.shapeTexts[o.ShapeTypes.Process]="Process",r.shapeTexts[o.ShapeTypes.Decision]="Decision",r.shapeTexts[o.ShapeTypes.Terminator]="Terminator",r.shapeTexts[o.ShapeTypes.PredefinedProcess]="Predefined Process",r.shapeTexts[o.ShapeTypes.Document]="Document",r.shapeTexts[o.ShapeTypes.MultipleDocuments]="Multiple Documents",r.shapeTexts[o.ShapeTypes.ManualInput]="Manual Input",r.shapeTexts[o.ShapeTypes.Preparation]="Preparation",r.shapeTexts[o.ShapeTypes.Data]="Data",r.shapeTexts[o.ShapeTypes.Database]="Database",r.shapeTexts[o.ShapeTypes.HardDisk]="Hard Disk",r.shapeTexts[o.ShapeTypes.InternalStorage]="Internal Storage",r.shapeTexts[o.ShapeTypes.PaperTape]="Paper Tape",r.shapeTexts[o.ShapeTypes.ManualOperation]="Manual Operation",r.shapeTexts[o.ShapeTypes.Delay]="Delay",r.shapeTexts[o.ShapeTypes.StoredData]="Stored Data",r.shapeTexts[o.ShapeTypes.Display]="Display",r.shapeTexts[o.ShapeTypes.Merge]="Merge",r.shapeTexts[o.ShapeTypes.Connector]="Connector",r.shapeTexts[o.ShapeTypes.Or]="Or",r.shapeTexts[o.ShapeTypes.SummingJunction]="Summing Junction",r.shapeTexts[o.ShapeTypes.Container]="Container",r.shapeTexts[o.ShapeTypes.VerticalContainer]="Vertical Container",r.shapeTexts[o.ShapeTypes.HorizontalContainer]="Horizontal Container",r.shapeTexts[o.ShapeTypes.Card]="Person's Name",r.shapeTexts[o.ShapeTypes.CardWithImageOnLeft]="Card with Image on the Left",r.shapeTexts[o.ShapeTypes.CardWithImageOnTop]="Card with Image on the Top",r.shapeTexts[o.ShapeTypes.CardWithImageOnRight]="Card with Image on the Right"},6879:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramModelOperation=e.ModelOperationSettings=void 0;var n=function(){function t(){this._addShape=!0,this._addShapeFromToolbox=!0,this._deleteShape=!0,this._deleteConnector=!0,this._changeConnection=!0,this._changeConnectorPoints=!0,this._changeShapeText=!0,this._changeConnectorText=!0,this._resizeShape=!0,this._moveShape=!0}return Object.defineProperty(t.prototype,"addShape",{get:function(){return this._addShape},set:function(t){t!==this._addShape&&(this._addShape=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"addShapeFromToolbox",{get:function(){return this._addShapeFromToolbox},set:function(t){t!==this._addShapeFromToolbox&&(this._addShapeFromToolbox=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deleteShape",{get:function(){return this._deleteShape},set:function(t){t!==this._deleteShape&&(this._deleteShape=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deleteConnector",{get:function(){return this._deleteConnector},set:function(t){t!==this._deleteConnector&&(this._deleteConnector=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changeConnection",{get:function(){return this._changeConnection},set:function(t){t!==this._changeConnection&&(this._changeConnection=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changeConnectorPoints",{get:function(){return this._changeConnectorPoints},set:function(t){t!==this._changeConnectorPoints&&(this._changeConnectorPoints=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changeShapeText",{get:function(){return this._changeShapeText},set:function(t){t!==this._changeShapeText&&(this._changeShapeText=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"changeConnectorText",{get:function(){return this._changeConnectorText},set:function(t){t!==this._changeConnectorText&&(this._changeConnectorText=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"resizeShape",{get:function(){return this._resizeShape},set:function(t){t!==this._resizeShape&&(this._resizeShape=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"moveShape",{get:function(){return this._moveShape},set:function(t){t!==this._moveShape&&(this._moveShape=t)},enumerable:!1,configurable:!0}),t.prototype.applySettings=function(t){t&&("boolean"==typeof t.addShape&&(this.addShape=t.addShape),"boolean"==typeof t.addShapeFromToolbox&&(this.addShapeFromToolbox=t.addShapeFromToolbox),"boolean"==typeof t.deleteShape&&(this.deleteShape=t.deleteShape),"boolean"==typeof t.deleteConnector&&(this.deleteConnector=t.deleteConnector),"boolean"==typeof t.changeConnection&&(this.changeConnection=t.changeConnection),"boolean"==typeof t.changeConnectorPoints&&(this.changeConnectorPoints=t.changeConnectorPoints),"boolean"==typeof t.changeShapeText&&(this.changeShapeText=t.changeShapeText),"boolean"==typeof t.changeConnectorText&&(this.changeConnectorText=t.changeConnectorText),"boolean"==typeof t.resizeShape&&(this.resizeShape=t.resizeShape),"boolean"==typeof t.moveShape&&(this.moveShape=t.moveShape))},t}();e.ModelOperationSettings=n,function(t){t[t.AddShape=0]="AddShape",t[t.AddShapeFromToolbox=1]="AddShapeFromToolbox",t[t.DeleteShape=2]="DeleteShape",t[t.DeleteConnector=3]="DeleteConnector",t[t.ChangeConnection=4]="ChangeConnection",t[t.ChangeConnectorPoints=5]="ChangeConnectorPoints",t[t.BeforeChangeShapeText=6]="BeforeChangeShapeText",t[t.ChangeShapeText=7]="ChangeShapeText",t[t.BeforeChangeConnectorText=8]="BeforeChangeConnectorText",t[t.ChangeConnectorText=9]="ChangeConnectorText",t[t.ResizeShape=10]="ResizeShape",t[t.MoveShape=11]="MoveShape"}(e.DiagramModelOperation||(e.DiagramModelOperation={}))},7228:function(t,e,n){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])},o(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}),e.ConnectionPoint=void 0;var r=n(8900),s=n(3742),a=function(t){function e(e,n,o){void 0===o&&(o=s.ConnectionPointSide.Undefined);var i=t.call(this,e,n)||this;return i.side=o,i}return i(e,t),e.prototype.offset=function(e,n){return t.prototype.offset.call(this,e,n),this.side=s.ConnectionPointSide.Undefined,this},e.prototype.multiply=function(e,n){return t.prototype.multiply.call(this,e,n),this.side=s.ConnectionPointSide.Undefined,this},e.prototype.clone=function(){return new e(this.x,this.y,this.side)},e.prototype.toPoint=function(){return new r.Point(this.x,this.y)},e}(r.Point);e.ConnectionPoint=a},5800:function(t,e,n){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])},o(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}),e.ConnectorPointsCalculator=void 0;var r=n(7595),s=n(4717),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},7595:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorPointsCalculatorBase=void 0;var n=function(t){this.connector=t};e.ConnectorPointsCalculatorBase=n},2342:function(t,e,n){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])},o(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}),e.ConnectorPointsOrthogonalCalculator=void 0;var r=n(8011),s=n(3742),a=n(7595),c=n(1686),u=n(1774),h=n(993),p=n(2290),l=n(7369),d=n(4717),f=n(4867),y=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 h.ConnectorPointsOrthogonalNorthSideCalculator(n),n.sideCalculators[s.ConnectionPointSide.East]=new p.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:!1,configurable:!0}),Object.defineProperty(e.prototype,"endRect",{get:function(){return this.connector.endItem?this.connector.endItem.rectangle:void 0},enumerable:!1,configurable:!0}),e.prototype.getPoints=function(){var t=this.connector.points.map((function(t,e){return new d.ConnectorRenderPoint(t.x,t.y,e)}));f.ModelUtils.skipUnnecessaryRenderPoints(t,!0);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,h=a.getCorrectOriginPoint(t[e],u),p=t[e+1];if(2===t.length&&a.isOnSidePoint(h,p)&&a.isDirectConnectionAllowed(i,h,p)){a.getDirectConnectionPoints(h,p).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)})),this.addMiddlePoints(t,e,n)}return f.ModelUtils.skipUnnecessaryRenderPoints(t,!0),t},e.prototype.getSideCalculator=function(t){return this.sideCalculators[t]},e.prototype.getPointSide=function(t,e){if(0===e&&this.connector.beginItem){var n=this.connector.beginConnectionPointIndex;return this.connector.beginItem.getConnectionPointSideByIndex(n,t[1])}if(e===t.length-1&&this.connector.endItem){n=this.connector.endConnectionPointIndex;return this.connector.endItem.getConnectionPointSideByIndex(n,t[t.length-2])}return s.ConnectionPointSide.Undefined},e.prototype.addMiddlePoints=function(t,e,n){for(var o=e;o0&&(a=u[0]),a},e.prototype.createPointsRect=function(t,e){var n=r.Rectangle.fromPoints(t,e);return n.width>0&&(n=n.clone().inflate(-1,0)),n.height>0&&(n=n.clone().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 0this.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.clone().offset(this.getMinOffset(),0)];case r.ConnectionPointSide.South:return e.xn.y?[]:[e.clone().offset(this.getMinOffset(),0)]:e.x>this.endRect.right?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.clone().offset(this.getMinOffset(),0)];case r.ConnectionPointSide.East:return[e.clone().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.clone().offset(i,0)];case r.ConnectionPointSide.North:return n.xn.y?[e.clone().offset(this.getMinOffset(),0)]:[];case r.ConnectionPointSide.South:return n.xthis.endRect.center.y;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.clone().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},993:function(t,e,n){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])},o(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}),e.ConnectorPointsOrthogonalNorthSideCalculator=void 0;var r=n(3742),s=n(1816),a=n(4717),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.y&&(t=t.clone().offset(0,e.y-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.clone().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.clone().offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return[e.clone().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.clone().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.clone().offset(0,-this.getMinOffset())]:[];case r.ConnectionPointSide.North:return[e.clone().offset(0,-this.getMinOffset())];case r.ConnectionPointSide.South:var i=-this.getMinOffset();return this.beginRect.ythis.endRect.center.x;return this.getScaleableAsideOffsetPoints(e,n,o,!0,i)}return[e.clone().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{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorPointsOrthogonalSideCalculatorBase=void 0;var o=n(8011),i=n(3742),r=n(7959),s=function(){function t(t){this.parent=t}return Object.defineProperty(t.prototype,"connector",{get:function(){return this.parent.connector},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beginRect",{get:function(){return this.parent.beginRect},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endRect",{get:function(){return this.parent.endRect},enumerable:!1,configurable:!0}),t.prototype.getBeginOffsetPoints=function(t,e,n,o){if(e=this.getCorrectOriginPoint(e,o),t!==i.ConnectionPointSide.Undefined){if(this.isBeginEndSame())return this.getSameShapeOffsetPoints(t,e,n,o);if(this.isBeginEndOverlappedPoints(e,n))return this.getOverlappedPointsOffsetPoints(t,e,n,o);if(this.isBeginEndOverlapped())return this.getBeginOverlappedShapeOffsetPoints(t,e,n,o)}else if(this.isOriginRectContainsTargetPoint(o,n))return this.getOverlappedPointsOffsetPoints(t,e,n,o);return this.isOnSidePoint(e,n)?this.getBeginOnSideOffsetPoints(t,e,n,o):this.getBeginOffSideOffsetPoints(t,e,n,o)},t.prototype.getEndOffsetPoints=function(t,e,n,o){if(e=this.getCorrectOriginPoint(e,o),t!==i.ConnectionPointSide.Undefined){if(this.isBeginEndSame())return this.getSameShapeOffsetPoints(t,e,n,o);if(this.isBeginEndOverlappedPoints(n,e))return this.getOverlappedPointsOffsetPoints(t,e,n,o);if(this.isBeginEndOverlapped())return this.getEndOverlappedShapeOffsetPoints(t,e,n,o)}else if(this.isOriginRectContainsTargetPoint(o,n))return this.getOverlappedPointsOffsetPoints(t,e,n,o);return this.isOnSidePoint(e,n)?this.getEndOnSideOffsetPoints(t,e,n,o):this.getEndOffSideOffsetPoints(t,e,n,o)},t.prototype.getSide=function(t,e){return Math.abs(e.x-t.x)>Math.abs(e.y-t.y)?e.x>t.x?i.ConnectionPointSide.East:i.ConnectionPointSide.West:e.y>t.y?i.ConnectionPointSide.South:i.ConnectionPointSide.North},t.prototype.getSideCalculator=function(t,e){return this.parent.getSideCalculator(this.getSide(t,e))},t.prototype.getMinOffset=function(){return r.Connector.minOffset},t.prototype.isBeginEndSame=function(){return this.connector.beginItem===this.connector.endItem},t.prototype.isBeginEndOverlapped=function(){return this.beginRect&&this.endRect&&o.Rectangle.areIntersected(this.beginRect,this.endRect)},t.prototype.isBeginEndOverlappedX=function(){return this.beginRect&&this.endRect&&!!o.Rectangle.getHorizIntersection(this.beginRect,this.endRect)},t.prototype.isBeginEndOverlappedY=function(){return this.beginRect&&this.endRect&&!!o.Rectangle.getVertIntersection(this.beginRect,this.endRect)},t.prototype.isBeginEndOverlappedPoints=function(t,e){return this.beginRect&&this.endRect&&(this.beginRect.containsPoint(e)||this.endRect.containsPoint(t))},t.prototype.isOriginRectContainsTargetPoint=function(t,e){return t&&e&&t.containsPoint(e)},t}();e.ConnectorPointsOrthogonalSideCalculatorBase=s},1774:function(t,e,n){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])},o(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}),e.ConnectorPointsOrthogonalSouthSideCalculator=void 0;var r=n(3742),s=n(1816),a=n(4717),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.clone().offset(0,this.getMinOffset())]:e.y>this.endRect.bottom?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!1):[e.clone().offset(0,this.getMinOffset())];case r.ConnectionPointSide.West:return e.ythis.endRect.bottom?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):[e.clone().offset(0,this.getMinOffset())];case r.ConnectionPointSide.South:return[e.clone().offset(0,this.getMinOffset())];case r.ConnectionPointSide.North:return this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),e.xn.x?[e.clone().offset(0,this.getMinOffset())]:[];case r.ConnectionPointSide.South:return[e.clone().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.clone().offset(0,i)]}},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[e.clone().offset(0,this.getScaleableOffsetY(e,n,!1))]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[e.clone().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.clone().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.clone().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},1686:function(t,e,n){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])},o(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}),e.ConnectorPointsOrthogonalUndefinedSideCalculator=void 0;var r=n(1816),s=n(4717),a=function(t){function e(e){return t.call(this,e)||this}return i(e,t),e.prototype.getCorrectOriginPoint=function(t,e){return t},e.prototype.getSameShapeOffsetPoints=function(t,e,n,o){return[]},e.prototype.getOverlappedPointsOffsetPoints=function(t,e,n,o){return[]},e.prototype.getBeginOverlappedShapeOffsetPoints=function(t,e,n,o){return[]},e.prototype.getEndOverlappedShapeOffsetPoints=function(t,e,n,o){return[]},e.prototype.getBeginOnSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.getEndOnSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.getBeginOffSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.getEndOffSideOffsetPoints=function(t,e,n,o){return[]},e.prototype.isOnSidePoint=function(t,e){return!0},e.prototype.isDirectConnectionAllowed=function(t,e,n){var o=this.getSideCalculator(e,n);return void 0===o||o.isDirectConnectionAllowed(t,e,n)},e.prototype.getDirectConnectionPoints=function(t,e){var n=Math.abs(e.x-t.x),o=Math.abs(e.y-t.y);if(n>o){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},7369:function(t,e,n){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])},o(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}),e.ConnectorPointsOrthogonalWestSideCalculator=void 0;var r=n(3742),s=n(1816),a=n(4717),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.x&&(t=t.clone().offset(e.x-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.clone().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.clone().offset(this.getMinOffset(),0)];case r.ConnectionPointSide.West:return[e.clone().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.clone().offset(-this.getMinOffset(),0)]:e.xe.x?this.getAsideOffsetPoints(e,n,o,this.getMinOffset(),this.getMinOffset(),!0):e.y>n.y?[e.clone().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.clone().offset(-this.getScaleableOffsetX(e,!0),0)]},e.prototype.getAsideOffsetPoints=function(t,e,n,o,i,r){var s=[];return void 0!==n&&(void 0===r&&(r=e.y0&&n<2*this.getMinOffset())return n/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.yo*n?i/n:i>n-o*n?(n-i)/n:o},n.prototype.getTextRectangle=function(t){return a.Rectangle.fromGeometry(this.getTextPoint(t),new u.Size(0,0))},n.prototype.changeRoutingStrategy=function(t){this.routingStrategy=t,this.invalidateRenderPoints()},n.prototype.clearRoutingStrategy=function(){delete this.routingStrategy,delete this.renderPoints,delete this.renderPointsWithoutSkipped,delete this.lockCreateRenderPoints,delete this.actualRoutingMode,delete this.shouldInvalidateRenderPoints,this.invalidateRenderPoints()},n.prototype.getCustomRenderPoints=function(t){void 0===t&&(t=!1);var e=this.getRenderPoints(t),n=[];return e.forEach((function(t,o){o>0&&o2,m.ConnectorRoutingMode.AllShapesOnly):this.invalidateRenderPoints()},n.prototype.onMovePoint=function(t,e){this.shouldChangeRenderPoints?(0!==t&&t!==this.points.length-1||(this.lockCreateRenderPoints=!1),this.replaceRenderPointsCore(this.routingStrategy.onMovePoint(this.points,t,e,this.renderPoints),this.lockCreateRenderPoints,m.ConnectorRoutingMode.AllShapesOnly)):this.invalidateRenderPoints()},n.prototype.onMovePoints=function(t,e,n){this.shouldChangeRenderPoints?(0!==t&&e!==this.points.length-1||(this.lockCreateRenderPoints=!1),this.replaceRenderPointsCore(this.routingStrategy.onMovePoints(this.points,t,e,n,this.renderPoints),this.lockCreateRenderPoints,m.ConnectorRoutingMode.AllShapesOnly)):this.invalidateRenderPoints()},n.prototype.replaceRenderPoints=function(t,e){void 0!==t?(this.replaceRenderPointsCore(t.renderPoints,t.lockCreateRenderPoints,t.actualRoutingMode),void 0!==e&&(this.shouldInvalidateRenderPoints=e)):this.invalidateRenderPoints()},n.prototype.clearRenderPoints=function(){this.changeRenderPoints(void 0),this.lockCreateRenderPoints=!1,this.actualRoutingMode=void 0,this.invalidateRenderPoints()},n.prototype.unlockCreateRenderPoints=function(){this.lockCreateRenderPoints=!1},n.prototype.replaceRenderPointsCore=function(t,e,n){this.changeRenderPoints(t),this.lockCreateRenderPoints=e,this.actualRoutingMode=n,this.invalidateRenderPoints()},n.prototype.changeRenderPoints=function(t){this.renderPoints=t,this.renderPointsWithoutSkipped=t?this.renderPoints.filter((function(t){return!t.skipped})):void 0},n.prototype.getCalculator=function(){return this.properties.lineOption===I.ConnectorLineOption.Straight?new S.ConnectorPointsCalculator(this):new x.ConnectorPointsOrthogonalCalculator(this)},n.prototype.invalidateRenderPoints=function(){this.shouldInvalidateRenderPoints=!0},n.prototype.createPrimitives=function(t){var e=[],n=this.getRenderPoints(),o=new f.PathPrimitive(n.map((function(t,e){return 0===e?new f.PathPrimitiveMoveToCommand(t.x,t.y):new f.PathPrimitiveLineToCommand(t.x,t.y)})),this.style);return e.push(o),e=(e=e.concat(this.createLineEndingPrimitives(n,o))).concat(this.createTextPrimitives(t))},n.prototype.createLineEndingPrimitives=function(t,e){var n=[];t.length>1&&[{strategy:this.createLineEndingStrategy(this.properties.startLineEnding),point1:t[0],point2:t[1]},{strategy:this.createLineEndingStrategy(this.properties.endLineEnding),point1:t[t.length-1],point2:t[t.length-2]}].forEach((function(t){var o=t.strategy;if(o.hasCommands()){var i=e;o.needCreateSeparatePrimitive()&&n.push(i=o.createPrimitive()),i.commands=i.commands.concat(o.createCommands(t.point1,t.point2))}}));return n},n.prototype.createLineEndingStrategy=function(t){switch(t){case I.ConnectorLineEnding.None:return new b.ConnectorLineEndingNoneStrategy(this.style);case I.ConnectorLineEnding.Arrow:return new b.ConnectorLineEndingArrowStrategy(this.style);case I.ConnectorLineEnding.OutlinedTriangle:return new b.ConnectorLineEndingOutlinedTriangleStrategy(this.style);case I.ConnectorLineEnding.FilledTriangle:return new b.ConnectorLineEndingFilledTriangleStrategy(this.style);default:return new b.ConnectorLineEndingStrategy(this.style)}},n.prototype.createSelectorPrimitives=function(){var t=[],e=this.getRenderPoints();return t.push(new f.PathPrimitive(e.map((function(t,e){return 0===e?new f.PathPrimitiveMoveToCommand(t.x,t.y):new f.PathPrimitiveLineToCommand(t.x,t.y)})),null,"selector")),t},n.prototype.createTextPrimitives=function(t){var e=this;if(!this.enableText)return[];var n=[];return this.texts.forEach((function(o){var i=e.getText(o.position);if(i&&""!==i){var r=e.getTextPoint(o.position);n=n.concat([new y.TextPrimitive(r.x,r.y,i,d.TextOwner.Connector,void 0,void 0,void 0,e.styleText,!0,null,h.PAGE_BG_TEXTFLOOR_FILTER_IDPREFIX+t,void 0,(function(t){g.RenderUtils.setElementEventData(t,l.MouseEventElementType.ConnectorText,e.key,o.position)}))])}})),n},n.prototype.getExtremeItem=function(t){return t===r.Begin?this.beginItem:t===r.End?this.endItem:null},n.prototype.getExtremeConnectionPointIndex=function(t){return t===r.Begin?this.beginConnectionPointIndex:t===r.End?this.endConnectionPointIndex:-1},n.prototype.getMinX=function(){return this.getRenderPoints().map((function(t){return t.x})).reduce((function(t,e){return Math.min(t,e)}),Number.MAX_VALUE)},n.prototype.getMinY=function(){return this.getRenderPoints().map((function(t){return t.y})).reduce((function(t,e){return Math.min(t,e)}),Number.MAX_VALUE)},n.prototype.getConnectionPoints=function(){return[]},n.prototype.getConnectionPointSide=function(t,e){return P.ConnectionPointSide.Undefined},n.prototype.getSegments=function(){var t=[],e=this.getRenderPoints();return e.forEach((function(n,o){o>0&&t.push(new c.Segment(e[o-1],n))})),t},n.prototype.intersectedByRect=function(t){return this.getSegments().some((function(e){return e.isIntersectedByRect(t)}))},n.prototype.toNative=function(t){var e=new p.NativeConnector(this.key,this.dataKey);return e.fromKey=this.beginItem&&this.beginItem.dataKey,e.toKey=this.endItem&&this.endItem.dataKey,e.texts=this.texts.map((function(t){return t})).sort((function(t,e){return t.position-e.position})).map((function(t){return t.value})),e.fromId=this.beginItem&&this.beginItem.key,e.fromPointIndex=this.beginConnectionPointIndex,e.toId=this.endItem&&this.endItem.key,e.toPointIndex=this.endConnectionPointIndex,e.points=this.points.map((function(t){return t.clone()})),e.applyUnits(t),e},n.minOffset=s.UnitConverter.pixelsToTwips(24),n.minTextHeight=s.UnitConverter.pixelsToTwips(12),n}(P.DiagramItem);e.Connector=T},5454:function(t,e,n){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])},o(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}),e.ConnectorLineEndingFilledTriangleStrategy=e.ConnectorLineEndingOutlinedTriangleStrategy=e.ConnectorLineEndingArrowStrategy=e.ConnectorLineEndingNoneStrategy=e.ConnectorLineEndingStrategy=void 0;var r=n(8675),s=n(7724),a=function(){function t(t){this.style=t}return t.prototype.hasCommands=function(){return!0},t.prototype.needCreateSeparatePrimitive=function(){return!1},t.prototype.createPrimitive=function(){return new s.PathPrimitive([],this.getStyle(),this.getCssClass())},t.prototype.createCommands=function(t,e){return[]},t.prototype.getStyle=function(){var t=this.style.clone();return t.resetStrokeDashArray(),t},t.prototype.getCssClass=function(){},t}();e.ConnectorLineEndingStrategy=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.hasCommands=function(){return!1},e}(a);e.ConnectorLineEndingNoneStrategy=c;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"arrowHeight",{get:function(){return 6*this.style.strokeWidth},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"arrowWidth",{get:function(){return 2*this.style.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.needCreateSeparatePrimitive=function(){return!this.style.isDefaultStrokeDashArray()},e.prototype.createCommands=function(t,e){var n=this.getArrowPoints(t,e),o=[new s.PathPrimitiveMoveToCommand(n.point1.x,n.point1.y),new s.PathPrimitiveLineToCommand(t.x,t.y),new s.PathPrimitiveLineToCommand(n.point2.x,n.point2.y)];return this.style.isDefaultStrokeDashArray()||(o=o.concat([new s.PathPrimitiveMoveToCommand(t.x,t.y),new s.PathPrimitiveLineToCommand(n.point3.x,n.point3.y)])),o},e.prototype.getArrowPoints=function(t,e){var n,o=this.arrowHeight;t.x===e.x&&((n=Math.abs(t.y-e.y)){var n,o;Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorProperties=e.DEFAULT_CONNECTOR_ENDLINEENDING=e.DEFAULT_CONNECTOR_STARTLINEENDING=e.DEFAULT_CONNECTOR_LINEOPTION=e.ConnectorLineEnding=e.ConnectorLineOption=void 0,function(t){t[t.Straight=0]="Straight",t[t.Orthogonal=1]="Orthogonal"}(n=e.ConnectorLineOption||(e.ConnectorLineOption={})),function(t){t[t.None=0]="None",t[t.Arrow=1]="Arrow",t[t.OutlinedTriangle=2]="OutlinedTriangle",t[t.FilledTriangle=3]="FilledTriangle"}(o=e.ConnectorLineEnding||(e.ConnectorLineEnding={})),e.DEFAULT_CONNECTOR_LINEOPTION=n.Orthogonal,e.DEFAULT_CONNECTOR_STARTLINEENDING=o.None,e.DEFAULT_CONNECTOR_ENDLINEENDING=o.Arrow;var i=function(){function t(){this.lineOption=e.DEFAULT_CONNECTOR_LINEOPTION,this.startLineEnding=e.DEFAULT_CONNECTOR_STARTLINEENDING,this.endLineEnding=e.DEFAULT_CONNECTOR_ENDLINEENDING}return t.prototype.clone=function(){var e=new t;return e.lineOption=this.lineOption,e.startLineEnding=this.startLineEnding,e.endLineEnding=this.endLineEnding,e},t.prototype.forEach=function(t){for(var e in this)Object.prototype.hasOwnProperty.call(this,e)&&t(e)},t.prototype.toObject=function(){var t={},n=!1;return this.lineOption!==e.DEFAULT_CONNECTOR_LINEOPTION&&(t.lineOption=this.lineOption,n=!0),this.startLineEnding!==e.DEFAULT_CONNECTOR_STARTLINEENDING&&(t.startLineEnding=this.startLineEnding,n=!0),this.endLineEnding!==e.DEFAULT_CONNECTOR_ENDLINEENDING&&(t.endLineEnding=this.endLineEnding,n=!0),n?t:null},t.prototype.fromObject=function(t){"number"==typeof t.lineOption&&(this.lineOption=t.lineOption),"number"==typeof t.startLineEnding&&(this.startLineEnding=t.startLineEnding),"number"==typeof t.endLineEnding&&(this.endLineEnding=t.endLineEnding)},t}();e.ConnectorProperties=i},4717:function(t,e,n){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])},o(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}),e.ConnectorRenderPoint=void 0;var r=function(t){function e(e,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=!1);var r=t.call(this,e,n)||this;return r.pointIndex=o,r.skipped=i,r}return i(e,t),e.prototype.offset=function(e,n){return t.prototype.offset.call(this,e,n),this.pointIndex=-1,this.skipped=!1,this},e.prototype.multiply=function(e,n){return t.prototype.multiply.call(this,e,n),this.pointIndex=-1,this.skipped=!1,this},e.prototype.clone=function(){return new e(this.x,this.y,this.pointIndex,this.skipped)},e.equal=function(t,e){return t.equals(e)&&t.pointIndex===e.pointIndex&&t.skipped===e.skipped},e.prototype.toObject=function(){return{x:this.x,y:this.y,pointIndex:this.pointIndex,skipped:this.skipped}},e.fromObject=function(t){return new e(t.x,t.y,t.pointIndex,t.skipped)},e}(n(8900).Point);e.ConnectorRenderPoint=r},4351:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorTexts=e.ConnectorText=void 0;var n=function(t,e){this.position=t,this.value=e};e.ConnectorText=n;var o=function(){function t(){this.items={}}return t.prototype.get=function(t){return this.items[t]},t.prototype.set=function(t,e){this.items[t]=e},t.prototype.remove=function(t){delete this.items[t]},t.prototype.map=function(t){var e=[];return this.forEach((function(n){return e.push(t(n))})),e},t.prototype.forEach=function(t){for(var e in this.items)Object.prototype.hasOwnProperty.call(this.items,e)&&t(this.items[e])},t.prototype.count=function(){return Object.keys(this.items).length},t.prototype.clone=function(){var e=new t;return this.forEach((function(t){e.set(t.position,new n(t.position,t.value))})),e},t.prototype.toObject=function(){var t={},e=!1;return this.forEach((function(n){t[n.position]=n.value,e=!0})),e?t:null},t.prototype.fromObject=function(t){for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e)){var o=parseFloat(e);isNaN(o)||"string"!=typeof t[e]||this.set(o,new n(o,t[e]))}},t}();e.ConnectorTexts=o},3975:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AStarCalculator=void 0;var n=function(){function t(){}return t.calculate=function(t){if(t)for(var e=this.start(t);e;)e=e(t)},t.start=function(e){return e.start(),e.shouldStartContinue?t.startContinue:t.finishWithPath},t.startContinue=function(e){return e.startContinue(),e.shouldFinish?t.finishWithPath:t.endContinue},t.endContinue=function(e){return e.endContinue(),e.shouldStartContinue?t.startContinue:t.finishWithoutPath},t.finishWithPath=function(t){t.finishWithPath()},t.finishWithoutPath=function(t){t.finishWithoutPath()},t}();e.AStarCalculator=n},2180:function(t,e,n){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])},o(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}),e.AStarContext=e.AStarContextBase=void 0;var r=n(3225),s=n(1039),a=n(684),c=n(1335),u=n(5074),h=n(8675),p=function(){function t(t,e,n){this.startPosition=t,this.targetPosition=e,this.maxStepsCount=n,this.prohibitedPoints={}}return Object.defineProperty(t.prototype,"shouldStartContinue",{get:function(){return this.updatableSet.count>0&&this.stepsCountn){var i=t.generalSet;i.remove(o),o.parent=t.currentNode,o.penalty=n,i.enqueue(o)}t.openNode=o})),this.stepsCount++},t.prototype.finishWithPath=function(){this.path=this.currentNode.getPath()},t.prototype.finishWithoutPath=function(){this.path=[]},t}();e.AStarContextBase=p;var l=function(t){function e(e,n,o,i,r,s){var a=t.call(this,n,o,1e4)||this;return a.routingContext=e,a.startPosition=n,a.targetPosition=o,a.prohibitedSegments=i,a.grid=r,a.metrics=s,a}return i(e,t),e.prototype.addProhibitedPoint=function(t){this.prohibitedPoints[t.x+"_"+t.y]=t},e.prototype.getNeighborPoints=function(t){var e=this;return this.grid.getNeighborPoints(t).filter((function(t){return e.allowPoint(t)}))},e.prototype.getDistance=function(t,e){return this.metrics.distance(t,e)},e.prototype.getPenalty=function(t,e){var n=t.parent,o=t.position,i=this.getTurnDirection(n?h.GeometryUtils.createAngle(n.position,o,e):0),r=this.getDistance(o,e),s=new c.Segment(o,e).center;return t.penalty+this.metrics.penalty(r,s,i,this.getIntersectedItems(s))},e.prototype.allowPoint=function(t){return!(t.x+"_"+t.y in this.prohibitedPoints)&&(!this.prohibitedSegments||this.prohibitedSegments.allowPoint(t))},e.prototype.getTurnDirection=function(t){return u.RightAngleConnectorRoutingMathOperations.getTurnDirection(t)},e.prototype.getIntersectedItems=function(t){var e=this,n=this.routingContext.shapeMargins;return this.routingContext.getIntersectedItems(t,n).filter((function(t){return e.hasOneShapeConnection(t)||!e.itemContainsConnectionPoints(t)}))},e.prototype.itemContainsConnectionPoints=function(t){var e=t.rectangle;return e.containsPoint(this.routingContext.beginPoint)&&e.containsPoint(this.routingContext.endPoint)},e.prototype.hasOneShapeConnection=function(t){var e=t.getConnectionPoints();return this.isConnectionPoint(e,this.routingContext.beginPoint)&&this.isConnectionPoint(e,this.routingContext.endPoint)},e.prototype.isConnectionPoint=function(t,e){return t.filter((function(t){return t.equals(e)})).length>0},e}(p);e.AStarContext=l},9927:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IntersectedShapeZone=e.AStarMetrics=e.IntersectedShapesMetrics=e.TurnDirectionMetrics=e.IntersectedShapeMetrics=e.RightAngleTurnDirection=void 0;var o,i=n(8900),r=n(5596);!function(t){t[t.Straight=0]="Straight",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.Backwards=3]="Backwards"}(o=e.RightAngleTurnDirection||(e.RightAngleTurnDirection={}));var s=function(){function t(t,e){this.description=t,this.shapeMargin=e}return t.prototype.penalty=function(t,e,n,o){var i=o.rectangle;if(i.containsPoint(n))return t+this.description.shape*e;var r=this.createRelativeMarginPenalty(n,i,this.shapeMargin);return r>0?t+this.description.margin*r*e:t},t.prototype.createRelativeMarginPenalty=function(t,e,n){var o=this.isTopPosition(t,e,n),s=this.isLeftPosition(t,e,n),a=this.isBottomPosition(t,e,n),c=this.isRightPosition(t,e,n);if(o){if(s){var u=(l=e.clone().inflate(n)).createPosition(),h=e.createPosition(),p=r.Metrics.euclideanDistance(h,u);return 1-r.Metrics.euclideanDistance(h,t)/p}if(c){var l=e.clone().inflate(n),d=new i.Point(l.right,l.y),f=new i.Point(e.right,e.y),y=r.Metrics.euclideanDistance(f,d);return 1-r.Metrics.euclideanDistance(f,t)/y}return 1-(e.y-t.y)/n}if(a){if(s){l=e.clone().inflate(n);var g=new i.Point(l.x,l.bottom),m=new i.Point(e.x,e.bottom),v=r.Metrics.euclideanDistance(m,g);return 1-r.Metrics.euclideanDistance(m,t)/v}if(c){l=e.clone().inflate(n);var P=new i.Point(l.right,l.bottom),C=new i.Point(e.right,e.bottom),S=r.Metrics.euclideanDistance(C,P);return 1-r.Metrics.euclideanDistance(C,t)/S}return 1-(t.y-e.bottom)/n}return s?1-(e.x-t.x)/n:c?1-(t.x-e.right)/n:0},t.prototype.isTopPosition=function(t,e,n){return t.x>e.x-n&&t.xe.y-n&&t.ye.x-n&&t.xe.bottom&&t.ye.x-n&&t.xe.y-n&&t.ye.right&&t.xe.y-n&&t.y{Object.defineProperty(e,"__esModule",{value:!0}),e.AStarNode=void 0;var n=function(){function t(t,e){this.position=t,this.distance=e,this.penalty=0}return Object.defineProperty(t.prototype,"key",{get:function(){return this.distance+this.penalty},enumerable:!1,configurable:!0}),t.prototype.getPath=function(){for(var t=[],e=this;void 0!==e;)t.splice(0,0,e.position),e=e.parent;return t},t}();e.AStarNode=n},3225:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SortedQueues=void 0;var o=n(2400),i=function(){function t(t){this.getKey=t,this._itemsArrays={},this._sortedKeys=[]}return Object.defineProperty(t.prototype,"sortedKeys",{get:function(){return this._sortedKeys},enumerable:!1,configurable:!0}),t.prototype.getQueue=function(t){return this._itemsArrays[t]},t.prototype.enqueue=function(t){var e=this.getKey(t);void 0===this._itemsArrays[e]?(this._itemsArrays[e]=[t],this.addSortedKey(e)):this._itemsArrays[e].push(t)},t.prototype.remove=function(t){var e=this.getKey(t),n=this._itemsArrays[e];void 0!==n&&(n.length?n[0]===t?(n.shift(),n.length||this.removeCore(e)):this._itemsArrays[e]=n.filter((function(e){return e!==t})):this.removeCore(e))},t.prototype.dequeueMin=function(){if(this._sortedKeys.length){var t=this._sortedKeys[0],e=this._itemsArrays[t],n=e.shift();return e.length||this.removeCore(t),n}},t.prototype.removeCore=function(t){delete this._itemsArrays[t],this.removeSortedKey(t)},t.prototype.removeSortedKey=function(t){var e=o.SearchUtils.binaryIndexOf(this._sortedKeys,(function(e){return e-t}));e>=0&&this.sortedKeys.splice(e,1)},t.prototype.addSortedKey=function(t){var e=o.SearchUtils.binaryIndexOf(this._sortedKeys,(function(e){return e-t}));e<0&&this._sortedKeys.splice(-(e+1),0,t)},t}();e.SortedQueues=i},1039:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UniqueAStarNodePositions=void 0;var n=function(){function t(t){void 0===t&&(t=function(t){return t.toString()}),this.getKey=t,this.items={},this.length=0}return Object.defineProperty(t.prototype,"count",{get:function(){return this.length},enumerable:!1,configurable:!0}),t.prototype.getNode=function(t){var e=this.items[this.getKey(t)];return void 0!==e?e.node:void 0},t.prototype.add=function(t,e){var n=this.getKey(t);void 0===this.items[n]&&(this.length++,this.items[n]={position:t,node:e})},t.prototype.remove=function(t){var e=this.getKey(t);void 0!==this.items[e]&&(this.length--,delete this.items[e])},t}();e.UniqueAStarNodePositions=n},1768:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorProhibitedSegments=void 0;var n=function(){function t(){this.segments=[],this.exludedPoints={}}return t.prototype.addSegment=function(t){this.segments.push(t)},t.prototype.addExludedPoint=function(t){this.exludedPoints[t.x+"_"+t.y]=!0},t.prototype.allowPoint=function(t){if(!(t.x+"_"+t.y in this.exludedPoints))for(var e=0;e{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorRenderPointsContext=void 0;var o=n(4717),i=function(){function t(t,e,n){this.renderPoints=t,this.lockCreateRenderPoints=e,this.actualRoutingMode=n}return t.prototype.toObject=function(){return{actualRoutingMode:this.actualRoutingMode,lockCreateRenderPoints:this.lockCreateRenderPoints,renderPoints:this.renderPoints.map((function(t){return t.toObject()}))}},t.fromObject=function(e){return new t(e.renderPoints.map((function(t){return o.ConnectorRenderPoint.fromObject(t)})),e.lockCreateRenderPoints,e.actualRoutingMode)},t}();e.ConnectorRenderPointsContext=i},2868:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorRenderSegment=void 0;var o=n(1335),i=n(1768),r=function(){function t(t,e,n,o){this.startInfo=t,this.endInfo=e,this.startPointIndex=n,this.previousCustomSegment=o}return Object.defineProperty(t.prototype,"startPathPoint",{get:function(){return this.startInfo instanceof o.Segment?this.startInfo.endPoint:this.startInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endPathPoint",{get:function(){return this.endInfo instanceof o.Segment?this.endInfo.startPoint:this.endInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startPoint",{get:function(){return this.startInfo instanceof o.Segment?this.startInfo.startPoint:this.startInfo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endPoint",{get:function(){return this.endInfo instanceof o.Segment?this.endInfo.endPoint:this.endInfo},enumerable:!1,configurable:!0}),t.prototype.createGridPoints=function(){var t=[];return this.endInfo instanceof o.Segment?(t.push(this.endInfo.startPoint),t.push(this.endInfo.endPoint)):t.push(this.endInfo),t},t.prototype.createProhibitedSegments=function(){if(this.startInfo instanceof o.Segment){var t=this.createProhibitedSegmentsCore(this.startInfo);return this.endInfo instanceof o.Segment&&(t.addSegment(this.endInfo),t.addExludedPoint(this.endInfo.startPoint)),this.previousCustomSegment&&t.addSegment(this.previousCustomSegment),t}return this.endInfo instanceof o.Segment?((t=this.createProhibitedSegmentsCore(this.endInfo)).addExludedPoint(this.endInfo.startPoint),this.previousCustomSegment&&t.addSegment(this.previousCustomSegment),t):this.previousCustomSegment?this.createProhibitedSegmentsCore(this.previousCustomSegment):void 0},t.prototype.createProhibitedSegmentsCore=function(t){var e=new i.ConnectorProhibitedSegments;return e.addSegment(t),e},t}();e.ConnectorRenderSegment=r},5714:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorRoutingModel=e.ConnectorRoutingPenaltyDescription=void 0;var o=n(240),i=n(5503),r=n(7959),s=n(4612),a=n(3597),c=function(){this.shape=20,this.margin=2,this.turnBack=20,this.turnLeft=3.1,this.turnRight=3};e.ConnectorRoutingPenaltyDescription=c;var u=function(){function t(){this.connectorRoutingMode=o.ConnectorRoutingMode.AllShapesOnly,this.shapeMargins=r.Connector.minOffset,this.shouldReverseConnections=!0,this.shouldResizeConnections=!0,this.penaltyDescription=new c}return t.prototype.initialize=function(t){this.model=t},t.prototype.createStrategy=function(t){if(void 0!==this.model&&this.connectorRoutingMode!==o.ConnectorRoutingMode.None&&t===s.ConnectorLineOption.Orthogonal)return new a.RightAngleConnectorRoutingStrategy(this)},t.prototype.getItems=function(){return this.getShapes()},t.prototype.notifyConnectorRoutingModeChanged=function(t){this.connectorRoutingMode=t},t.prototype.getShapes=function(){return void 0===this.model||void 0===this.connectorRoutingMode||this.connectorRoutingMode===o.ConnectorRoutingMode.None?[]:this.model.items.filter((function(t){return t instanceof i.Shape}))},t}();e.ConnectorRoutingModel=u},1254:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RoutingGrid=void 0;var o=n(2400),i=function(){function t(t,e,n){this.verticalGridLines=t,this.horizontalGridLines=e,this.createPoint=n}return t.create=function(e,n,o){var i=this,r=[],s=[],a={},c={};return n.forEach((function(t){i.addLine(t.x,r,a),i.addLine(t.right,r,a),i.addLine(t.y,s,c),i.addLine(t.bottom,s,c)})),e.forEach((function(t){i.addLine(t.x,r,a),i.addLine(t.y,s,c)})),r.sort((function(t,e){return t-e})),s.sort((function(t,e){return t-e})),new t(r,s,o)},t.addLine=function(t,e,n){n[t]||(e.push(t),n[t]=!0)},t.prototype.getNeighborPoints=function(t){var e=[];if(!(this.horizontalGridLines&&this.horizontalGridLines.length&&this.verticalGridLines&&this.verticalGridLines.length))return e;var n=o.SearchUtils.binaryIndexOf(this.verticalGridLines,(function(e){return e-t.x}));n<0?(n=~n,this.isValidArrayIndex(this.verticalGridLines,n)&&e.push(this.createPoint(this.verticalGridLines[n],t.y))):this.isValidArrayIndex(this.verticalGridLines,n+1)&&e.push(this.createPoint(this.verticalGridLines[n+1],t.y)),this.isValidArrayIndex(this.verticalGridLines,n-1)&&e.push(this.createPoint(this.verticalGridLines[n-1],t.y));var i=o.SearchUtils.binaryIndexOf(this.horizontalGridLines,(function(e){return e-t.y}));return i<0?(i=~i,this.isValidArrayIndex(this.horizontalGridLines,i)&&e.push(this.createPoint(t.x,this.horizontalGridLines[i]))):this.isValidArrayIndex(this.horizontalGridLines,i+1)&&e.push(this.createPoint(t.x,this.horizontalGridLines[i+1])),this.isValidArrayIndex(this.horizontalGridLines,i-1)&&e.push(this.createPoint(t.x,this.horizontalGridLines[i-1])),e},t.prototype.isValidArrayIndex=function(t,e){return t&&e>=0&&e{Object.defineProperty(e,"__esModule",{value:!0}),e.RightAngleConnectorRoutingContext=e.IntersectingItemsByPointsContext=e.CuttingItemsContext=void 0;var o=n(8900),i=n(1335),r=n(9716),s=n(3742),a=n(5074),c=n(2868),u=n(1254),h=n(4867),p=n(9927),l=n(2180),d=n(3975),f=n(8675),y=n(1057),g=function(){function t(){this.cuttingItemKeys=[]}return Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.cuttingItemKeys.length},enumerable:!1,configurable:!0}),t.prototype.registerShape=function(t,e,n){return!!f.GeometryUtils.areSegmentsCutRectangle(n,e)&&(this.cuttingItemKeys.push(t),!0)},t}();e.CuttingItemsContext=g;var m=function(){function t(t){this.routingModel=t,this.trees={}}return t.prototype.getItems=function(t,e){return this.getOrCreateTree(e).search(t)},t.prototype.getOrCreateTree=function(t){if(!this.trees[t]){this.trees[t]=new y.RTree;for(var e=this.routingModel.getItems(),n=0,o=void 0;o=e[n];n++)this.trees[t].insert(t?o.rectangle.inflate(t,t):o.rectangle,o)}return this.trees[t]},t}();e.IntersectingItemsByPointsContext=m;var v=function(){function t(t,e,n,o,i,r,s){this.routingModel=t,this.points=e,this.supportRenderPoints=n,this.beginConnectionShape=o,this.endConnectionShape=i,this.beginConnectionSide=this.getConnectionSide(this.beginConnectionShape,r,this.beginPoint),this.endConnectionSide=this.getConnectionSide(this.endConnectionShape,s,this.endPoint),this.ignorableItemKeys={},this.cuttingShapesContext=new g,this.intersectedItemsByPointsContext=new m(this.routingModel),this.isInvalidRenderSegments=!0}return Object.defineProperty(t.prototype,"shapeMargins",{get:function(){return this.routingModel.shapeMargins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beginPoint",{get:function(){return this.points[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endPoint",{get:function(){return this.points[this.points.length-1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasIntersecting",{get:function(){return!this.cuttingShapesContext.isEmpty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shouldCreateRenderPoints",{get:function(){return this.isInvalidRenderSegments||!this.isSmallPath&&(this.hasIntersecting||this.isReversedStartConnection||this.isReversedEndConnection)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beginPathPoint",{get:function(){return this.beginConnectionSegment instanceof i.Segment?this.beginConnectionSegment.startPoint:this.beginConnectionSegment},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endPathPoint",{get:function(){return this.endConnectionSegment instanceof i.Segment?this.endConnectionSegment.endPoint:this.endConnectionSegment},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReversedStartConnection",{get:function(){if(!this.beginConnectionShape||this.beginConnectionSide===s.ConnectionPointSide.Undefined)return!1;var t=this.beginConnectionSegment;return!(t instanceof o.Point)&&this.isReversedConnectionSegment(this.supportSegments[0],t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReversedEndConnection",{get:function(){if(!this.endConnectionShape||this.endConnectionSide===s.ConnectionPointSide.Undefined)return!1;var t=this.endConnectionSegment;return!(t instanceof o.Point)&&this.isReversedConnectionSegment(this.supportSegments[this.supportSegments.length-1],t)},enumerable:!1,configurable:!0}),t.prototype.isReversedConnectionSegment=function(t,e){return r.Vector.scalarProduct(r.Vector.fromSegment(t),r.Vector.fromPoints(e.startPoint,e.endPoint))<=0},Object.defineProperty(t.prototype,"isSmallPath",{get:function(){var t=2*this.routingModel.shapeMargins;return Math.abs(this.beginPathPoint.x-this.endPathPoint.x)0?new o.Point(e.startPoint.x,e.startPoint.y):t.beginConnectionSegment,i=0?new i.Segment(this.points[e].clone(),new o.Point(t.x,t.y)):void 0},t.prototype.shouldCreateSegment=function(t,e){return!t.equals(e)||e.pointIndex>0},t.prototype.isPathNormal=function(t){return t===s.ConnectionPointSide.Undefined||a.RightAngleConnectorRoutingMathOperations.isSegmentNormal(new i.Segment(this.beginPoint,this.endPoint),t===s.ConnectionPointSide.East||t===s.ConnectionPointSide.West)},t.prototype.registerIgnorableShape=function(t){this.ignorableItemKeys[t.key]=!0},t.prototype.isConnectedByStart=function(t){return this.beginConnectionShape&&this.beginConnectionShape.key===t.key&&this.beginConnectionSide!==s.ConnectionPointSide.Undefined},t.prototype.isConnectedByEnd=function(t){return this.endConnectionShape&&this.endConnectionShape.key===t.key&&this.endConnectionSide!==s.ConnectionPointSide.Undefined},t.prototype.getConnectionSide=function(t,e,n){return t?t.getConnectionPointSideByIndex(e,n):s.ConnectionPointSide.Undefined},t.prototype.shapeContainsOtherConnection=function(t,e,n){if(!t)return!1;var o=t.rectangle;return o.containsPoint(n)&&(!e||!e.rectangle.equals(o))},t.prototype.createBeginConnectionSegment=function(t,e){if(this.beginConnectionSide===s.ConnectionPointSide.Undefined)return this.createBeginConnectionSegmentCore(t);if(!e||!this.routingModel.shouldReverseConnections){var n=this.createBeginConnectionSegmentCore(t);if(n instanceof o.Point||!this.routingModel.shouldResizeConnections)return n;for(var i=n.startPoint,r=n.endPoint,a=t;this.hasIntersectedItemsByPoint(r,i,this.beginConnectionShape);)a/=2,r=(n=this.createBeginConnectionSegmentCore(a)).endPoint;return n}if(!this.endConnectionShape)return this.createBeginConnectionSegmentCore(-t);if(this.isPathNormal(this.endConnectionSide))return this.createBeginConnectionSegmentCore(-t);var c=this.createBeginConnectionSegmentCore(-2*t);return this.isEndConnectionRectanleLineIntersected(c,!1,!0)?this.createBeginConnectionSegmentCore(t):this.createBeginConnectionSegmentCore(-t)},t.prototype.hasIntersectedItemsByPoint=function(t,e,n){return this.getIntersectedItems(t,0).some((function(t){return t.key!==n.key&&!t.rectangle.containsPoint(e)}))},t.prototype.createEndConnectionSegment=function(t,e){if(this.endConnectionSide===s.ConnectionPointSide.Undefined)return this.createEndConnectionSegmentCore(t);if(!e||!this.routingModel.shouldReverseConnections){var n=this.createEndConnectionSegmentCore(t);if(n instanceof o.Point||!this.routingModel.shouldResizeConnections)return n;for(var i=n.endPoint,r=n.startPoint,a=t;this.hasIntersectedItemsByPoint(r,i,this.endConnectionShape);)a/=2,r=(n=this.createEndConnectionSegmentCore(a)).startPoint;return n}if(!this.beginConnectionShape)return this.createEndConnectionSegmentCore(-t);if(this.isPathNormal(this.beginConnectionSide))return this.createEndConnectionSegmentCore(-t);var c=this.createEndConnectionSegmentCore(-2*t);return this.isBeginConnectionRectanleLineIntersected(c,!0,!1)?this.createEndConnectionSegmentCore(t):this.createEndConnectionSegmentCore(-t)},t.prototype.createBeginConnectionSegmentCore=function(t){return a.RightAngleConnectorRoutingMathOperations.createBeginConnectionSegment(this.beginConnectionSide,this.beginPoint,t,(function(t,e){return new o.Point(t,e)}))},t.prototype.createEndConnectionSegmentCore=function(t){return a.RightAngleConnectorRoutingMathOperations.createEndConnectionSegment(this.endConnectionSide,this.endPoint,t,(function(t,e){return new o.Point(t,e)}))},t.prototype.isBeginConnectionRectanleLineIntersected=function(t,e,n){return a.RightAngleConnectorRoutingMathOperations.isConnectionRectanleLineIntersected(this.beginConnectionShape.rectangle,t,this.beginConnectionSide,e,n,(function(t,e){return new o.Point(t,e)}))},t.prototype.isEndConnectionRectanleLineIntersected=function(t,e,n){return a.RightAngleConnectorRoutingMathOperations.isConnectionRectanleLineIntersected(this.endConnectionShape.rectangle,t,this.endConnectionSide,e,n,(function(t,e){return new o.Point(t,e)}))},t.prototype.isIgnorableItem=function(t){return t.key in this.ignorableItemKeys},t.prototype.createExtendedShapesBounds=function(){var t=this;return this.routingModel.getItems().map((function(e){return e.rectangle.clone().inflate(t.routingModel.shapeMargins)}))},t.prototype.createGrid=function(){return u.RoutingGrid.create(this.createGridPoints(),this.createExtendedShapesBounds(),(function(t,e){return new o.Point(t,e)}))},t}();e.RightAngleConnectorRoutingContext=v},5074:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RightAngleConnectorRoutingMathOperations=void 0;var o=n(1335),i=n(8679),r=n(9927),s=n(8675),a=n(3742),c=function(){function t(){}return t.createUnionSegments=function(t,e){for(var n=[],i=t[0].startPoint,r=t[0].endPoint,s=1;s{Object.defineProperty(e,"__esModule",{value:!0}),e.RightAngleConnectorRoutingStrategy=void 0;var o=n(1335),i=n(4717),r=n(1794),s=n(4867),a=function(){function t(t){this.model=t}return t.prototype.createRenderPoints=function(t,e,n,o,i,s,a){if(e.length>1){var c=new r.RightAngleConnectorRoutingContext(this.model,t,e,n,o,i,s);if(c.initialize(a),c.shouldCreateRenderPoints)return this.createRenderPointsCore(c)}},t.prototype.clone=function(){return new t(this.model)},t.prototype.onAddPoint=function(t,e,n,r){var a=r.map((function(t){return new i.ConnectorRenderPoint(t.x,t.y,t.pointIndex)})),c=s.ModelUtils.findFirstPointIndex(a,(function(t){return t.equals(n)}));if(0===c)return a.splice(1,0,new i.ConnectorRenderPoint(n.x,n.y,e)),s.ModelUtils.validateRenderPointIndexes(t,a,2);var u=a.length-1;if(c===u)return a.splice(u,0,new i.ConnectorRenderPoint(n.x,n.y,e)),a[u+1].pointIndex=e+1,a;if(c>0){var h=a[c];return a[c]=new i.ConnectorRenderPoint(h.x,h.y,e,h.skipped),s.ModelUtils.validateRenderPointIndexes(t,a,c+1)}var p=new o.Segment(a[0],a[1]),l=new i.ConnectorRenderPoint(n.x,n.y);return p.containsPoint(l)?(a.splice(1,0,new i.ConnectorRenderPoint(l.x,l.y,-1)),a.splice(2,0,new i.ConnectorRenderPoint(l.x,l.y,e)),s.ModelUtils.validateRenderPointIndexes(t,a,3)):new o.Segment(a[u-1],a[u]).containsPoint(l)?(a.splice(u,0,new i.ConnectorRenderPoint(l.x,l.y,e)),a.splice(u+1,0,new i.ConnectorRenderPoint(l.x,l.y,-1)),a[u+2].pointIndex=e+1,a):r},t.prototype.onDeletePoint=function(t,e,n){var o=n.map((function(t){return new i.ConnectorRenderPoint(t.x,t.y,t.pointIndex)})),r=this.getRenderPointIndexByPointIndex(o,e);if(1===r){var a=o[0],c=o[1];return a.equals(c)?(o.splice(1,1),s.ModelUtils.validateRenderPointIndexes(t,o,1)):(o[1]=new i.ConnectorRenderPoint(c.x,c.y,-1,c.skipped),s.ModelUtils.validateRenderPointIndexes(t,o,2))}if(2===r){a=o[1];var u=o[2];return a.equals(u)?(o.splice(1,2),s.ModelUtils.validateRenderPointIndexes(t,o,1)):(o[2]=new i.ConnectorRenderPoint(u.x,u.y,-1,u.skipped),s.ModelUtils.validateRenderPointIndexes(t,o,3))}var h=o.length-1;if(r===h-1){var p=o[h-1],l=o[h];return p.equals(l)?(o.splice(h-1,1),s.ModelUtils.validateRenderPointIndexes(t,o,h-1)):(o[h-1]=new i.ConnectorRenderPoint(p.x,p.y,-1,p.skipped),s.ModelUtils.validateRenderPointIndexes(t,o,h))}if(r===h-2){var d=o[h-2];l=o[h-1];return d.equals(l)?(o.splice(h-2,2),s.ModelUtils.validateRenderPointIndexes(t,o,h-2)):(o[h-2]=new i.ConnectorRenderPoint(d.x,d.y,-1,d.skipped),s.ModelUtils.validateRenderPointIndexes(t,o,h-1))}var f=o[r];return o[r]=new i.ConnectorRenderPoint(f.x,f.y,-1,f.skipped),s.ModelUtils.validateRenderPointIndexes(t,o,r+1)},t.prototype.onMovePoint=function(t,e,n,o){if(0===e||e===t.length-1)return o;var r=o.map((function(t){return new i.ConnectorRenderPoint(t.x,t.y,t.pointIndex)}));return this.onMovePointCore(r,e,n),s.ModelUtils.skipUnnecessaryRightAngleRenderPoints(r),r},t.prototype.onMovePoints=function(t,e,n,o,r){if(0===e||n===t.length-1)return r;for(var a=r.map((function(t){return new i.ConnectorRenderPoint(t.x,t.y,t.pointIndex)})),c=e;c<=n;c++)this.onMovePointCore(a,c,o[c-e]);return s.ModelUtils.skipUnnecessaryRightAngleRenderPoints(a),a},t.prototype.onMovePointCore=function(t,e,n){var o=this.getRenderPointIndexByPointIndex(t,e);if(o>=0){var r=t[o];t[o]=new i.ConnectorRenderPoint(n.x,n.y,e,r.skipped)}},t.prototype.createRenderPointsCore=function(t){var e,n=[],o=-1,i=-1;t.setup();var r=t.renderSegments,s=r[r.length-1].endPoint,a=t.points;do{this.registerCustomPoints(n,a,i+2,r[o+1].startPointIndex-1),i=(e=r[++o]).startPointIndex,this.registerRenderPoints(n,t.createRoutedPoints(e.startInfo,e.endInfo,e.createProhibitedSegments()),i)}while(!e.endPoint.equals(s));return t.validateRenderPoints(n),n},t.prototype.getRenderPointIndexByPointIndex=function(t,e){return s.ModelUtils.findFirstPointIndex(t,(function(t){return t.pointIndex===e}))},t.prototype.registerRenderPoints=function(t,e,n){var o=this;e.forEach((function(i,r){var s=0===r?n:r===e.length-1?n+1:-1;o.registerPoint(t,i,s)}))},t.prototype.registerCustomPoints=function(t,e,n,o){for(var i=n;i<=o;i++)this.registerPoint(t,e[i],i)},t.prototype.registerPoint=function(t,e,n){t.push(new i.ConnectorRenderPoint(e.x,e.y,n))},t}();e.RightAngleConnectorRoutingStrategy=a},3742:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramItem=e.DEFAULT_ZINDEX=e.ConnectionPointSide=void 0;var o,i=n(8011),r=n(5596),s=n(8675),a=n(1552);!function(t){t[t.Undefined=-1]="Undefined",t[t.North=0]="North",t[t.East=1]="East",t[t.South=2]="South",t[t.West=3]="West"}(o=e.ConnectionPointSide||(e.ConnectionPointSide={})),e.DEFAULT_ZINDEX=0;var c=function(){function t(){this.key=void 0,this.dataKey=void 0,this.customData=void 0,this.attachedConnectors=[],this.zIndex=e.DEFAULT_ZINDEX,this.locked=!1,this.container=void 0,this.style=new a.Style,this.styleText=new a.TextStyle}return t.prototype.assign=function(t){t.key=this.key,t.dataKey=this.dataKey,t.customData=s.ObjectUtils.cloneObject(this.customData),t.locked=this.locked,t.attachedConnectors=this.attachedConnectors.slice(),t.style=this.style.clone(),t.styleText=this.styleText.clone(),t.zIndex=this.zIndex,t.container=this.container},t.prototype.getConnectionPointPosition=function(t,e){return this.getConnectionPoint(t,e).toPoint()},t.prototype.getConnectionPoint=function(t,e){t<0&&e&&(t=this.getNearestConnectionPoint(e));var n=this.getConnectionPoints();return n[t]||n[0]},t.prototype.getNearestConnectionPoint=function(t){var e,n=Number.MAX_VALUE;return this.getConnectionPoints().forEach((function(o,i){var s=r.Metrics.euclideanDistance(o,t);se[n].y||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:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowEditText",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTemplate",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableChildren",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isLocked",{get:function(){return this.locked||this.container&&this.container.isLocked},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowResizeHorizontally",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowResizeVertically",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeWidth",{get:function(){return this.style.strokeWidth},enumerable:!1,configurable:!0}),t.prototype.intersectedByRect=function(t){return i.Rectangle.areIntersected(this.rectangle,t)},t}();e.DiagramItem=c},4742:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DraggingConnector=e.SelectionDragHelper=void 0;var o=n(9716),i=n(58),r=n(1510),s=n(4867),a=n(4717),c=n(6879),u=function(){function t(t,e,n,o,i){var r=this;this.history=t,this.model=e,this.permissionsProvider=n,this.startPoint=o,this.draggingShapes=[],this.draggingConnectors=[],this.selectedItems={},this.draggingConnectorsIndexByKey={},i.forEach((function(t){return r.selectedItems[t.key]=t}))}return t.prototype.initDraggingShapes=function(t,e){var n=this;this.draggingShapes=t.map((function(t){return new p(t)})),e||this.draggingShapes.forEach((function(t){return n.permissionsProvider.addInteractingItem(t.shape,c.DiagramModelOperation.MoveShape)}))},t.prototype.initDraggingConnectors=function(t,e){var n=this;this.draggingConnectors=[],this.draggingConnectorsIndexByKey={},t.forEach((function(t){return n.registerConnector(t)})),e||this.draggingShapes.forEach((function(t){var e=t.shape.attachedConnectors;e&&e.forEach((function(t){n.containsDraggingConnectorByKey(t.key)||n.registerConnector(t)}))})),this.modelConnectorsWithoutBeginItemInfo=this.createModelConnectorsWithoutBeginItemInfo(),this.modelConnectorsWithoutEndItemInfo=this.createModelConnectorsWithoutEndItemInfo()},t.prototype.move=function(t,e,n,i){var r=this;if(this.draggingShapes.length){var s=this.draggingShapes.map((function(t){return t.shape}));this.draggingShapes.forEach((function(t){for(var o=t.shape;o.container;){if(-1!==s.indexOf(o.container))return!1;o=o.container}r.moveShape(t,e,n,i)}));var a=this.draggingShapes[0],c=o.Vector.fromPoints(a.startPosition.clone(),a.shape.position.clone());(c.x||c.y)&&this.draggingConnectors.forEach((function(e){return r.moveConnectorCore(e.connector,e.startPoints,e.startRenderContext,c,t)}))}else this.draggingConnectors.forEach((function(n){return r.moveConnector(n,t,e)}))},t.prototype.containsDraggingConnectorByKey=function(t){return void 0!==this.draggingConnectorsIndexByKey[t]},t.prototype.onTryUpdateModelSize=function(t,e){this.modelConnectorsWithoutBeginItemInfo.forEach((function(n){n.point.x+=t,n.point.y+=e})),this.modelConnectorsWithoutEndItemInfo.forEach((function(n){n.point.x+=t,n.point.y+=e}))},t.prototype.finish=function(){this.draggingConnectors.forEach((function(t){return t.connector.unlockCreateRenderPoints()}))},t.prototype.moveConnector=function(t,e,n){var i=t.startPoints,r=o.Vector.fromPoints(i[0].clone(),n(i[0]).clone());(r.x||r.y)&&this.moveConnectorCore(t.connector,i,t.startRenderContext,r,e)},t.prototype.moveConnectorCore=function(t,e,n,o,i){i||s.ModelUtils.canMoveConnector(this.selectedItems,t)?this.offsetConnector(t,e,n,o):this.changeConnector(t)},t.prototype.moveShape=function(t,e,n,o){var i=this,r=t.shape,a=e(t.startPosition);s.ModelUtils.setShapePosition(this.history,this.model,r,a),s.ModelUtils.updateMovingShapeConnections(this.history,r,this.modelConnectorsWithoutBeginItemInfo,this.modelConnectorsWithoutEndItemInfo,n,o,(function(t){return i.permissionsProvider.addInteractingItem(t)})),this.draggingConnectors.filter((function(t){return!!i.selectedItems[t.connector.key]})).length||s.ModelUtils.updateShapeAttachedConnectors(this.history,this.model,r)},t.prototype.offsetConnector=function(t,e,n,o){var r=this,s=e.map((function(t){return r.offsetPoint(t,o)}));s[0].equals(t.points[0])||this.history.addAndRedo(new i.ChangeConnectorPointsHistoryItem(t.key,s,this.offsetRenderContext(n,o)))},t.prototype.offsetRenderContext=function(t,e){var n=this;if(void 0!==t)return new r.ConnectorRenderPointsContext(t.renderPoints.map((function(t){var o=n.offsetPoint(t,e);return new a.ConnectorRenderPoint(o.x,o.y,t.pointIndex,t.skipped)})),!0,t.actualRoutingMode)},t.prototype.offsetPoint=function(t,e){var n=o.Vector.fromPoints(t,this.startPoint);return this.startPoint.clone().offset(e.x-n.x,e.y-n.y)},t.prototype.changeConnector=function(t){s.ModelUtils.tryRemoveConnectorIntermediatePoints(this.history,t),s.ModelUtils.updateConnectorAttachedPoints(this.history,this.model,t)},t.prototype.registerConnector=function(t){this.draggingConnectorsIndexByKey[t.key]=this.draggingConnectors.push(new h(t))-1},t.prototype.createModelConnectorsWithoutBeginItemInfo=function(){var t=this;return this.model.findConnectorsCore((function(e){return!e.beginItem&&!t.containsDraggingConnectorByKey(e.key)})).map((function(t){return{connector:t,point:t.points[0].clone()}}))},t.prototype.createModelConnectorsWithoutEndItemInfo=function(){var t=this;return this.model.findConnectorsCore((function(e){return!e.endItem&&!t.containsDraggingConnectorByKey(e.key)})).map((function(t){return{connector:t,point:t.points[t.points.length-1].clone()}}))},t}();e.SelectionDragHelper=u;var h=function(t){this.connector=t,this.startPoints=t.points.map((function(t){return t.clone()})),this.startRenderContext=t.tryCreateRenderPointsContext()};e.DraggingConnector=h;var p=function(t){this.shape=t,this.startPosition=t.position.clone()}},6613:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramModel=void 0;var o=n(5503),i=n(7959),r=n(8675),s=n(8011),a=n(6353),c=n(8900),u=n(7176),h=n(13),p=n(5383),l=n(4867),d=function(){function t(e){void 0===e&&(e=new a.Size(8391,11906)),this.items=[],this.itemIndexByKey={},this.keyCounter=0,this.pageSize=new a.Size(8391,11906),this.pageLandscape=!1,this.pageColor=t.defaultPageColor,this.units=p.DiagramUnit.In,this.snapStartPoint=new c.Point(0,0),this.pageSize=e,this.size=this.pageSize.clone(),this.rectangle=s.Rectangle.fromGeometry(new c.Point(0,0),new a.Size(0,0)),this.initializeKeyCounter()}return Object.defineProperty(t.prototype,"pageWidth",{get:function(){return this.pageLandscape?this.pageSize.height:this.pageSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageHeight",{get:function(){return this.pageLandscape?this.pageSize.width:this.pageSize.height},enumerable:!1,configurable:!0}),t.prototype.getRectangle=function(t){return t&&(this.rectangle=l.ModelUtils.createRectangle(this.items)),this.rectangle},t.prototype.pushItem=function(t){var e=this.items.push(t);this.itemIndexByKey[t.key]=e-1,t instanceof o.Shape&&!t.image.isEmpty&&this.cacheShapeImage(t)},t.prototype.removeItem=function(t){var e=this.getItemIndex(t);delete this.itemIndexByKey[t.key],this.items.splice(e,1),this.updateIndicesHash(e)},t.prototype.updateIndicesHash=function(t){for(var e=t;e{Object.defineProperty(e,"__esModule",{value:!0}),e.ItemChange=e.ItemChangeType=void 0,function(t){t[t.Create=0]="Create",t[t.UpdateProperties=1]="UpdateProperties",t[t.UpdateStructure=2]="UpdateStructure",t[t.Update=3]="Update",t[t.Remove=4]="Remove",t[t.UpdateClassName=5]="UpdateClassName"}(e.ItemChangeType||(e.ItemChangeType={}));var n=function(){function t(t,e,n){void 0===n&&(n=!0),this.item=t,this.type=e,this.isValid=n}return Object.defineProperty(t.prototype,"key",{get:function(){return this.item.key},enumerable:!1,configurable:!0}),t}();e.ItemChange=n},1118:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ModelManipulator=void 0;var o=n(4125),i=n(6353),r=n(9463),s=n(7176),a=n(590),c=n(6879),u=n(8675),h=n(7959),p=n(2004),l=n(4867),d=function(){function t(t,e,n,o){this.onModelChanged=new u.EventDispatcher,this.onModelSizeChanged=new u.EventDispatcher,this.initializeCore(t,e),this.permissionsProvider=n,this.descriptionManager=o,this.imageLoader=new a.ImageLoader(this.updateShapeImage.bind(this))}return t.prototype.initialize=function(t,e){this.initializeCore(t,e),this.model.loadAllImages(this.imageLoader),this.updateModelSize()},t.prototype.initializeCore=function(t,e){var n=this;this.model=t,this.routingModel=e,this.routingModel&&(this.routingModel.initialize(t),t.iterateItems((function(t){if(t instanceof h.Connector){var e=n.routingModel.createStrategy(t.properties.lineOption);e?t.changeRoutingStrategy(e):t.invalidateRenderPoints()}})))},t.prototype.commitPageChanges=function(){this.raisePageSizeChanged(this.model.pageSize.clone(),this.model.pageLandscape),this.raiseModelSizeChanged(this.model.size.clone()),this.raisePageColorChanged(this.model.pageColor),this.raiseModelRectangleChanged(l.ModelUtils.createRectangle(this.model.items))},t.prototype.commitItemsCreateChanges=function(){r.Diagnostics.timer("new model: model changes"),this.commitItemsChangesCore(p.ItemChangeType.Create,this.model.items),r.Diagnostics.endTimer()},t.prototype.commitItemUpdateChanges=function(t){this.commitItemsChangesCore(p.ItemChangeType.UpdateStructure,[t])},t.prototype.commitItemsChangesCore=function(t,e){var n=[];e.forEach((function(e){n.push(new p.ItemChange(e,t))})),n.length&&this.raiseModelChanged(n)},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&&(-1===e.children.indexOf(t)&&e.children.push(t),t.container=e,this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.Update)]))},t.prototype.removeFromContainer=function(t){if(t.container){var e=t.container.children.indexOf(t);t.container.children.splice(e,1),t.container=void 0,this.raiseModelChanged([new p.ItemChange(t,p.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,o){void 0!==o?e[n]=o:delete e[n],this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateProperties)])},t.prototype.changeZIndex=function(t,e){t.zIndex=e,this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.Update)])},t.prototype.changeLocked=function(t,e){t.locked=e,this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateClassName)])},t.prototype.changeCustomData=function(t,e){t.customData=u.ObjectUtils.cloneObject(e),this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateStructure)])},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){this.model.pushItem(t);var e=this.permissionsProvider.canAddItems([t]);return this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.Create,e)]),this.model.loadAllImages(this.imageLoader),t},t.prototype.resizeShape=function(t,e,n){t.position=e,t.size=n;var o=this.permissionsProvider.isStoredPermissionsGranted(),i=this.getInteractingItem(t,c.DiagramModelOperation.ResizeShape);if(i){var r=i.size.clone(),s=t.size.clone();s.equals(r)||(o=this.permissionsProvider.canResizeShapes([{shape:t,size:s,oldSize:r}]))}var a=this.getInteractingItem(t,c.DiagramModelOperation.MoveShape);if(a){var u=a.position.clone(),h=t.position.clone();h.equals(u)||(o=this.permissionsProvider.canMoveShapes([{shape:t,position:h,oldPosition:u}]))}this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateProperties,o)])},t.prototype.moveShape=function(t,e){t.position=e;var n=this.permissionsProvider.isStoredPermissionsGranted();this.getInteractingItem(t,c.DiagramModelOperation.AddShape)&&(n=this.permissionsProvider.canAddItems([t]));var o=this.getInteractingItem(t,c.DiagramModelOperation.MoveShape);if(o){var i=o.position.clone(),r=t.position.clone();r.equals(i)||(n=this.permissionsProvider.canMoveShapes([{shape:t,position:r,oldPosition:i}]))}this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateProperties,n)])},t.prototype.changeShapeParameters=function(t,e){t.parameters.forEach((function(t){var n=e.get(t.key);n&&(t.value=n.value)})),this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateProperties)])},t.prototype.changeShapeText=function(t,e){t.text=e,this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateStructure)])},t.prototype.changeShapeImage=function(t,e){t.image=e;var n=s.ImageCache.instance.createUnloadedInfoByShapeImageInfo(e);this.imageLoader.load(n),this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateStructure)])},t.prototype.changeShapeExpanded=function(t,e){t.expanded=e,t.toggleExpandedSize(),this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateStructure)])},t.prototype.deleteShape=function(t,e){if(t.attachedConnectors.length)throw Error("A removing shape should not contain existing connectors.");this.removeShape(t,e)},t.prototype.removeShape=function(t,e){this.model.removeItem(t),this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.Remove,e)])},t.prototype.updateShapeImage=function(t){if(t.imageUrl){var e=this.model.findShapesByImageUrl(t.imageUrl);e.forEach((function(e){t.base64?e.image.loadBase64Content(t.base64):e.image.setUnableToLoadFlag()})),this.commitItemsChangesCore(p.ItemChangeType.UpdateStructure,e)}},t.prototype.updateShapeDescription=function(t){var e=this.model.findShapesByDescription(t);this.commitItemsChangesCore(p.ItemChangeType.UpdateProperties,e)},t.prototype.updateShapeType=function(t,e,n){var o=this.descriptionManager.get(e);t.description=o,t.parameters=n,o.createParameters(n),this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.UpdateStructure)])},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){this.model.pushItem(t);var e=this.routingModel.createStrategy(t.properties.lineOption);e?t.changeRoutingStrategy(e):t.clearRoutingStrategy();var n=this.permissionsProvider.canAddItems([t]);return this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.Create,n)]),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);var e=this.permissionsProvider.canDeleteItems([t]);this.raiseModelChanged([new p.ItemChange(t,p.ItemChangeType.Remove,e)])},t.prototype.addDeleteConnectorPoint=function(t,e){var n=this.getConnectorInteractingPoints(t);e(t),this.addDeleteConnectorPointCore(t,n)},t.prototype.moveConnectorPoint=function(t,e,n){n(t),this.moveConnectorPointCore(t,e)},t.prototype.changeConnectorPoints=function(t,e){var n=this;e(t),t.points.forEach((function(e,o){return n.moveConnectorPointCore(t,o)}))},t.prototype.moveConnectorPointCore=function(t,e){var n=this.getInteractingItem(t),o=this.permissionsProvider.isStoredPermissionsGranted();if(n){var i=0{Object.defineProperty(e,"__esModule",{value:!0}),e.ModelUtils=void 0;var o=n(9291),i=n(5596),r=n(8900),s=n(8011),a=n(6353),c=n(9716),u=n(8679),h=n(5383),p=n(3477),l=n(9603),d=n(4430),f=n(4145),y=n(58),g=n(329),m=n(8930),v=n(9143),P=n(1704),C=n(9310),S=n(8338),x=n(4160),b=n(9753),I=n(4629),w=n(4297),_=n(1729),T=n(4518),O=n(8236),M=n(5144),E=n(9559),D=n(7443),A=n(4634),R=n(926),L=n(213),N=n(7819),z=n(8217),j=n(8675),U=n(7959),k=n(4612),B=n(4717),H=n(1510),K=n(5503),V=n(56),F=function(){function t(){}return t.setShapePosition=function(e,n,o,i,r){if(void 0===r&&(r=!0),!o.position.equals(i)){var s=i.clone().offset(-o.position.x,-o.position.y);return e.addAndRedo(new x.MoveShapeHistoryItem(o.key,i)),r&&o.children.forEach((function(o){if(o instanceof K.Shape){var i=o.position.clone().offset(s.x,s.y);t.setShapePosition(e,n,o,i)}})),!0}return!1},t.setShapeSize=function(t,e,n,o,i){return(!n.size.equals(i)||!n.position.equals(o))&&(t.addAndRedo(new I.ResizeShapeHistoryItem(n.key,o,i)),!0)},t.addConnectorPoint=function(t,e,n,o){t.addAndRedo(new d.AddConnectorPointHistoryItem(e,n,o))},t.deleteConnectorCustomPoints=function(t,e){if(e.points.length>2){var n=e.tryCreateRenderPointsContext();if(e.properties.lineOption!==k.ConnectorLineOption.Straight&&n){var o=e.points[0].clone(),i=e.points[e.points.length-1].clone();t.addAndRedo(new y.ChangeConnectorPointsHistoryItem(e.key,[o,i],new H.ConnectorRenderPointsContext([new B.ConnectorRenderPoint(o.x,o.y,0),new B.ConnectorRenderPoint(i.x,i.y,1)],!1,n.actualRoutingMode)))}else t.addAndRedo(new y.ReplaceConnectorPointsHistoryItem(e.key,[e.points[0].clone(),e.points[e.points.length-1].clone()]))}},t.deleteConnectorUnnecessaryPoints=function(e,n){var o=n.getRenderPoints(!0).map((function(t){return t.clone()}));if(n.properties.lineOption===k.ConnectorLineOption.Straight){var i=t.createUnnecessaryRenderPoints(o.filter((function(t){return!t.skipped})).map((function(t){return t.clone()})),n.skippedRenderPoints,(function(e){return t.findFirstPointIndex(o,(function(t){return B.ConnectorRenderPoint.equal(t,e)}))}));Object.keys(i).length&&e.addAndRedo(new y.ReplaceConnectorPointsHistoryItem(n.key,t.createNecessaryPoints(n.points.map((function(t){return t.clone()})),i)))}else{var r=n.tryCreateRenderPointsContext(!0),s=o.filter((function(t){return!t.skipped})).map((function(t){return t.clone()}));i=t.createUnnecessaryRightAngleRenderPoints(s,n.skippedRenderPoints,(function(e){return t.findFirstPointIndex(o,(function(t){return B.ConnectorRenderPoint.equal(t,e)}))}));if(Object.keys(i).length){var a=t.createNecessaryPoints(n.points.map((function(t){return t.clone()})),i),c=new H.ConnectorRenderPointsContext(t.validateRenderPointIndexes(a,s,0),r.lockCreateRenderPoints,r.actualRoutingMode);e.addAndRedo(new y.ChangeConnectorPointsHistoryItem(n.key,a,c))}}},t.fixConnectorBeginEndConnectionIndex=function(t,e){if(e.beginItem&&-1===e.beginConnectionPointIndex){var n=e.beginItem.getNearestConnectionPoint(e.points[0]);t.addAndRedo(new p.SetConnectionPointIndexHistoryItem(e,n,U.ConnectorPosition.Begin))}if(e.endItem&&-1===e.endConnectionPointIndex){var o=e.endItem.getNearestConnectionPoint(e.points[e.points.length-1]);t.addAndRedo(new p.SetConnectionPointIndexHistoryItem(e,o,U.ConnectorPosition.End))}},t.skipUnnecessaryRenderPoints=function(e,n){j.GeometryUtils.removeUnnecessaryPoints(e,(function(o,i){return t.removeUnnecessaryPoint(e,o,i,n)}),(function(t){return void 0!==t&&!t.skipped})),e[0].skipped=!1,e[e.length-1].skipped=!1},t.skipUnnecessaryRightAngleRenderPoints=function(e,n){j.GeometryUtils.removeUnnecessaryRightAnglePoints(e,(function(o,i){return t.removeUnnecessaryPoint(e,o,i,n)}),(function(t){return void 0!==t&&!t.skipped})),e[0].skipped=!1,e[e.length-1].skipped=!1},t.createUnnecessaryRenderPoints=function(e,n,o,i){void 0===i&&(i=function(t){return!0});var r={};return j.GeometryUtils.removeUnnecessaryPoints(e,(function(n,s){return t.collectNotSkippedRenderPoints(r,e,n,s,o,i)})),t.collectSkippedRenderPoints(r,n,o,i),r},t.createUnnecessaryRightAngleRenderPoints=function(e,n,o,i){void 0===i&&(i=function(t){return!0});var r={};return j.GeometryUtils.removeUnnecessaryRightAnglePoints(e,(function(n,s){return t.collectNotSkippedRenderPoints(r,e,n,s,o,i)})),t.collectSkippedRenderPoints(r,n,o,i),r},t.createNecessaryPoints=function(t,e){var n=this,o=[],i=t.length-1;return t.forEach((function(t,r){(0===r||r===i||n.isNecessaryPoint(t,r,e))&&o.push(t.clone())})),o},t.isNecessaryPoint=function(t,e,n){return!Object.keys(n).some((function(o){var i=n[o];return i.pointIndex===e&&j.GeometryUtils.areDuplicatedPoints(t,i)}))},t.collectSkippedRenderPoints=function(t,e,n,o){void 0===o&&(o=function(t){return!0}),e&&e.forEach((function(e){if(o(e)){var i=n(e);void 0===t[i]&&(t[i]=e)}}))},t.collectNotSkippedRenderPoints=function(t,e,n,o,i,r){if(void 0===r&&(r=function(t){return!0}),r(n)){var s=i(n);if(void 0===t[s])return t[s]=n,n.skipped=!0,e.splice(o,1),!0}return!1},t.removeUnnecessaryPoint=function(t,e,n,o){return o&&-1===e.pointIndex?(t.splice(n,1),!0):(e.skipped=!0,!1)},t.validateRenderPointIndexes=function(t,e,n){var o=this,i=e.map((function(e,i){return new B.ConnectorRenderPoint(e.x,e.y,i>=n&&e.pointIndex>=0?o.findFirstPointIndex(t,(function(t){return t.equals(e)})):e.pointIndex,e.skipped)}));return i[0].skipped=!1,i[i.length-1].skipped=!1,i},t.findFirstPointIndex=function(t,e){if(!t||!e)return-1;for(var n=0;n-1?(r(e,o),o!==n.connector.beginConnectionPointIndex&&n.connector.beginItem&&t.addAndRedo(new m.DeleteConnectionHistoryItem(n.connector,U.ConnectorPosition.Begin)),s(n.connector),t.addAndRedo(new p.AddConnectionHistoryItem(n.connector,e,o,U.ConnectorPosition.Begin))):n.connector.beginItem&&(t.addAndRedo(new m.DeleteConnectionHistoryItem(n.connector,U.ConnectorPosition.Begin)),t.addAndRedo(new S.MoveConnectorPointHistoryItem(n.connector.key,0,n.point)))})),o.forEach((function(n){var o=a.getMovingShapeConnectionPointIndex(e,n.point);e.rectangle.containsPoint(n.point)||o>-1?(r(e,o),o!==n.connector.endConnectionPointIndex&&n.connector.endItem&&t.addAndRedo(new m.DeleteConnectionHistoryItem(n.connector,U.ConnectorPosition.End)),s(n.connector),t.addAndRedo(new p.AddConnectionHistoryItem(n.connector,e,o,U.ConnectorPosition.End))):n.connector.endItem&&(t.addAndRedo(new m.DeleteConnectionHistoryItem(n.connector,U.ConnectorPosition.End)),t.addAndRedo(new S.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,r){i.Metrics.euclideanDistance(e,t)0;){var n=e.attachedConnectors[0];t.addAndRedo(new m.DeleteConnectionHistoryItem(n,n.beginItem===e?U.ConnectorPosition.Begin:U.ConnectorPosition.End))}t.endTransaction()},t.deleteShape=function(t,e){var n=t.modelManipulator.permissionsProvider.canDeleteItems([e]);t.beginTransaction(),this.detachConnectors(t,e),t.addAndRedo(new P.DeleteShapeHistoryItem(e.key,n)),t.endTransaction()},t.deleteConnector=function(t,e){t.beginTransaction(),e.beginItem&&t.addAndRedo(new m.DeleteConnectionHistoryItem(e,U.ConnectorPosition.Begin)),e.endItem&&t.addAndRedo(new m.DeleteConnectionHistoryItem(e,U.ConnectorPosition.End)),t.addAndRedo(new v.DeleteConnectorHistoryItem(e.key)),t.endTransaction()},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.changeSelectionLocked=function(e,n,o,i){e.beginTransaction(),o.getSelectedItems(!0).forEach((function(t){e.addAndRedo(new D.ChangeLockedHistoryItem(t,i))})),t.updateSelection(e,o),e.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 R.ChangeStyleTextHistoryItem(o,e,n.styleText[e]))})),n.style.forEach((function(e){n.style[e]!==i.style[e]&&t.addAndRedo(new A.ChangeStyleHistoryItem(o,e,n.style[e]))}))},t.updateSelection=function(t,e){t.addAndRedo(new w.SetSelectionHistoryItem(e,e.getKeys(),!0))},t.cloneShapeToOffset=function(t,e,n,o,i){t.beginTransaction();var r=n.position.clone().offset(o,i),s=new f.AddShapeHistoryItem(n.description,r,n.text);t.addAndRedo(s);var a=s.shapeKey;return t.addAndRedo(new I.ResizeShapeHistoryItem(a,r,n.size.clone())),t.addAndRedo(new E.ChangeCustomDataHistoryItem(a,j.ObjectUtils.cloneObject(n.customData))),t.addAndRedo(new g.ChangeShapeParametersHistoryItem(a,n.parameters.clone())),this.copyStylesToItem(t,e,n,a),t.endTransaction(),a},t.applyOffsetToConnectorRenderPointsContext=function(t,e,n){return t&&t.renderPoints?new H.ConnectorRenderPointsContext(t.renderPoints.map((function(t){return t.clone().offset(e,n)})),!0,t.actualRoutingMode):void 0},t.cloneConnectorToOffset=function(t,e,n,o,i,r,s){t.beginTransaction();var a=n.points.map((function(t){return t.clone().offset(r,s)})),c=new l.AddConnectorHistoryItem(a,void 0,this.applyOffsetToConnectorRenderPointsContext(n.tryCreateRenderPointsContext(),r,s));t.addAndRedo(c);var u=c.connectorKey,h=e.findConnector(u);if(n.properties.forEach((function(e){n.properties[e]!==h.properties[e]&&t.addAndRedo(new O.ChangeConnectorPropertyHistoryItem(u,e,n.properties[e]))})),o){var d=e.findShape(o);t.addAndRedo(new p.AddConnectionHistoryItem(h,d,n.beginConnectionPointIndex,U.ConnectorPosition.Begin))}if(i){var f=e.findShape(i);t.addAndRedo(new p.AddConnectionHistoryItem(h,f,n.endConnectionPointIndex,U.ConnectorPosition.End))}return n.texts.clone().forEach((function(e){t.addAndRedo(new M.ChangeConnectorTextHistoryItem(h,e.position,e.value))})),this.copyStylesToItem(t,e,n,u),t.endTransaction(),u},t.cloneSelectionToOffset=function(e,n,o,i,r,s){var a=this;e.beginTransaction();var c={},u=[];i.getSelectedShapes().forEach((function(t){var i=a.cloneShapeToOffset(e,n,t,r,s);c[t.key]=i,u.push(i),o&&o(i)})),i.getSelectedConnectors().forEach((function(t){var i=t.beginItem?c[t.beginItem.key]:null,h=t.endItem?c[t.endItem.key]:null,p=a.cloneConnectorToOffset(e,n,t,i,h,r,s);u.push(p),o&&o(p)})),e.addAndRedo(new w.SetSelectionHistoryItem(i,u)),t.tryUpdateModelRectangle(e),e.endTransaction()},t.findContainerByEventKey=function(e,n,o){var i=e.findContainer(o);if(i&&!i.isLocked)return i;var r=e.findShape(o);return r&&r.container&&!n.hasKey(r.key)?t.findContainerByEventKey(e,n,r.container.key):void 0},t.canInsertToContainer=function(t,e,n){return e!==n&&!(e instanceof K.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 K.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 b.RemoveFromContainerHistoryItem(n)),n.attachedConnectors.forEach((function(e){e.container&&t.addAndRedo(new b.RemoveFromContainerHistoryItem(e))}))),t.addAndRedo(new C.InsertToContainerHistoryItem(n,o)),this.updateAttachedConnectorsContainer(t,e,n),t.endTransaction())}},t.removeFromContainer=function(t,e,n){n.container&&(t.beginTransaction(),t.addAndRedo(new b.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 b.RemoveFromContainerHistoryItem(i)),o.updateAttachedConnectorsContainer(t,e,i))})),t.endTransaction()},t.getConnectorContainer=function(t){if(t.beginItem&&t.endItem){for(var e={},n=t.beginItem.container;n;)e[n.key]=!0,n=n.container;for(var o=t.endItem.container;o;){if(void 0!==e[o.key])return o;o=o.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 C.InsertToContainerHistoryItem(n,o)):n.container&&t.addAndRedo(new b.RemoveFromContainerHistoryItem(n))},t.updateNewShapeProperties=function(t,e,n){e.inputPosition.getDefaultStyle().forEach((function(o){t.addAndRedo(new A.ChangeStyleHistoryItem(n,o,e.inputPosition.getDefaultStylePropertyValue(o)))})),e.inputPosition.getDefaultTextStyle().forEach((function(o){t.addAndRedo(new R.ChangeStyleTextHistoryItem(n,o,e.inputPosition.getDefaultTextStylePropertyValue(o)))}))},t.updateNewConnectorProperties=function(t,e,n){e.inputPosition.getDefaultConnectorProperties().forEach((function(o){t.addAndRedo(new O.ChangeConnectorPropertyHistoryItem(n,o,e.inputPosition.getDefaultConnectorPropertyValue(o)))})),e.inputPosition.getDefaultStyle().forEach((function(o){t.addAndRedo(new A.ChangeStyleHistoryItem(n,o,e.inputPosition.getDefaultStylePropertyValue(o)))})),e.inputPosition.getDefaultTextStyle().forEach((function(o){t.addAndRedo(new R.ChangeStyleTextHistoryItem(n,o,e.inputPosition.getDefaultTextStylePropertyValue(o)))}))},t.applyLayout=function(t,e,n,o,i,r,s,a,c,u){t.beginTransaction();var h=this.getOccupiedRectangles(r,n);return i=this.offsetLayoutToFreeSpace(i,n&&n.clientRectangle,h,s.containerPadding),a&&this.adjustLayoutToSnapGrid(e,i,c),n&&this.resizeContainerOnLayout(t,e,i,n,s.containerPadding),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)})),u),t.endTransaction(),i.getRectangle(!0)},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 K.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(new s.Rectangle(o.right,o.y,1,1)),n.push(new s.Rectangle(o.right,o.bottom,1,1))}return n},t.offsetLayoutToFreeSpace=function(t,e,n,o){var i=t.getRectangle(!0),r=j.GeometryUtils.findFreeSpace(n,i.createSize().offset(o,o).nonNegativeSize(),!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.x:0,u=e?e.y:Math.max(0,i.y);return t.offsetNodes(c+o,u+o)},t.resizeContainerOnLayout=function(e,n,o,i,r){var s=o.getRectangle(!0),c=i.children.filter((function(t){return t instanceof K.Shape?-1===o.nodeKeys.indexOf(t.key):!!(t instanceof U.Connector&&t.beginItem&&t.endItem)&&(-1===o.nodeKeys.indexOf(t.beginItem.key)&&-1===o.nodeKeys.indexOf(t.endItem.key))})).map((function(t){return t.rectangle})),u=c.map((function(t){return t.right})).reduce((function(t,e){return Math.max(t,e)}),s.right),h=c.map((function(t){return t.bottom})).reduce((function(t,e){return Math.max(t,e)}),s.bottom),p=i.rectangle.width+u+r-i.rectangle.right,l=i.rectangle.height+h+r-i.rectangle.bottom;t.setShapeSize(e,n,i,i.position,new a.Size(p,l)),t.updateShapeAttachedConnectors(e,n,i)},t.applyLayoutToNodes=function(t,e,n,o){var i=this,r=o.reduce((function(t,e){return t[e.key]=t}),{});n.forEachNode((function(n,o){var s=e.findShape(o);i.applyLayoutToNode(t,e,s,n.position,r)}))},t.applyLayoutToNode=function(e,n,o,i,r){var s=this,a=i.clone().offset(-o.position.x,-o.position.y);t.setShapePosition(e,n,o,i,!1),0===a.x&&0===a.y||(o.attachedConnectors.filter((function(t){return!r[t.key]})).forEach((function(t){s.updateConnectorAttachedPoints(e,n,t);for(var o=t.beginItem?1:0,i=t.endItem?t.points.length-2:t.points.length-1,r=o;r<=i;r++)s.moveConnectorPoint(e,t,r,t.points[r].offset(a.x,a.y))})),n.getChildren(o).forEach((function(t){if(t instanceof K.Shape){var o=t.position.clone().offset(a.x,a.y);s.applyLayoutToNode(e,n,t,o,r)}})))},t.applyLayoutToConnectors=function(t,e,n,o,i){var r=this;o.filter((function(t){return t.beginItem||t.endItem})).forEach((function(o){var s=n.edgeToPosition[o.key];if(o.beginItem&&o.endItem&&!i&&s){var a=o.beginItem.getConnectionPointIndexForSide(s.beginIndex);a!==o.beginConnectionPointIndex&&t.addAndRedo(new p.SetConnectionPointIndexHistoryItem(o,a,U.ConnectorPosition.Begin));var c=o.endItem.getConnectionPointIndexForSide(s.endIndex);c!==o.endConnectionPointIndex&&t.addAndRedo(new p.SetConnectionPointIndexHistoryItem(o,c,U.ConnectorPosition.End))}r.updateConnectorAttachedPoints(t,e,o),s&&r.deleteConnectorCustomPoints(t,o)}))},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,o){void 0===o&&(o=!0);var i={};[].concat(e).concat(n).forEach((function(t){var e=t.container&&t.container.key;i[e]||(i[e]=[]),i[e].push(t)}));var r=[];for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var a=s&&t.findContainer(s);if(!a||a.expanded&&!t.findItemCollapsedContainer(a)){var c=a&&a.key,u=this.getGraphByItems(t,i[s],c,!o),h=!1;(u.nodes.length>1||u.nodes.length&&(o||a&&i[a.container&&a.container.key]))&&(h=!0),h&&r.push(new N.GraphInfo(a,u))}}return r.sort((function(t,e){return e.level-t.level}))},t.getGraphByItems=function(t,e,n,o){var i=this,r=new L.Graph([],[]),s={};return e.forEach((function(t){i.extendByConnectedComponents(t,r,n,s,o)})),r.nodes.sort((function(e,n){return t.getItemIndex(t.findItem(e))-t.getItemIndex(t.findItem(n))})),r.edges.sort((function(e,n){return t.getItemIndex(t.findItem(e.key))-t.getItemIndex(t.findItem(n.key))})),r.edges=r.edges.filter((function(t){return r.getNode(t.from)&&r.getNode(t.to)})),r},t.extendByConnectedComponents=function(t,e,n,o,i){var r=this;!t||i&&t.locked||o[t.key]||(o[t.key]=!0,!(t instanceof U.Connector&&(t.container&&t.container.key)===n&&t.beginItem)||t.beginItem.locked&&i||!t.endItem||t.endItem.locked&&i||t.beginItem===t.endItem?t instanceof K.Shape&&(t.container&&t.container.key)===n&&(e.addNode(t),t.attachedConnectors.forEach((function(t){return r.extendByConnectedComponents(t,e,n,o,i)}))):(e.addEdge(new z.Edge(t.key,t.beginItem&&t.beginItem.key,t.endItem&&t.endItem.key)),this.extendByConnectedComponents(t.beginItem,e,n,o,i),this.extendByConnectedComponents(t.endItem,e,n,o,i)))},t.getlUnitValue=function(t,e){switch(t){case h.DiagramUnit.Cm:return o.UnitConverter.twipsToCentimeters(e);case h.DiagramUnit.In:return o.UnitConverter.twipsToInches(e);case h.DiagramUnit.Px:return o.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 h.DiagramUnit.Cm:case h.DiagramUnit.In:return n(+s.toFixed(i))+r;case h.DiagramUnit.Px:return n(+s.toFixed(0))+r}},t.getTwipsValue=function(t,e){switch(t){case h.DiagramUnit.Cm:return o.UnitConverter.centimetersToTwips(e);case h.DiagramUnit.In:return o.UnitConverter.inchesToTwips(e);case h.DiagramUnit.Px:return o.UnitConverter.pixelsToTwips(e)}},t.getGuidItemKey=function(){return u.MathUtils.generateGuid()},t.createSelectedItems=function(t){var e={};return t.getSelectedItems(!0).forEach((function(t){return e[t.key]=t})),e},t.canMoveConnector=function(t,e){var n=e.beginItem,o=e.endItem;return n||o?!!t[e.key]&&(n===o?!!t[n.key]:n?o?!!t[n.key]&&!!t[o.key]:!!t[n.key]:!!t[o.key]):!e.isLocked},t.createRectangle=function(t){return j.GeometryUtils.getCommonRectangle(t.map((function(t){return t.rectangle})))},t.changeShapeType=function(t,e,n,o){if(n.description.key===o)return!1;t.beginTransaction();var i=n.getConnectionPoints(),r=i.map((function(t){return n.getConnectionPointSide(t)}));t.addAndRedo(new V.ChangeShapeTypeHistoryItem(n,o));for(var s=n.getConnectionPoints(),a=s.map((function(t){return n.getConnectionPointSide(t)})),c=0,u=void 0;u=n.attachedConnectors[c];c++)u.beginItem===n&&this.updateConnectionIndexByNewShapeType(t,u,U.ConnectorPosition.Begin,u.beginConnectionPointIndex,i,r,s,a),u.endItem===n&&this.updateConnectionIndexByNewShapeType(t,u,U.ConnectorPosition.End,u.endConnectionPointIndex,i,r,s,a),this.updateConnectorAttachedPoints(t,e,u);return t.endTransaction(),!0},t.updateConnectionIndexByNewShapeType=function(t,e,n,o,i,r,s,a){if(!(o<0)){var c=r[o],u=i[o];if(!(oa)&&(o.index=s,o.distance=a)}return o}),{distance:Number.MAX_SAFE_INTEGER,index:-1}).index},t.connectionPointActionSize=o.UnitConverter.pixelsToTwips(8),t}();e.ModelUtils=F},6469:function(t,e,n){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])},o(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}),e.AddShapeEventArgs=e.AddShapeRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.shape=n,o}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.AddShape},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeShape(this.shape),this.apiController.convertPoint(this.shape.position))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"addShape"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.shape&&this.shape.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.shape===t.shape&&this.shape.position.equals(t.shape.position))},e}(s.RequestedEntity);e.AddShapeRequestedEntity=a;var c=function(t){function e(e,n){var o=t.call(this)||this;return o.shape=e,o.position=n,o}return i(e,t),e}(s.PermissionRequestEventArgs);e.AddShapeEventArgs=c},1110:function(t,e,n){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])},o(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}),e.AddShapeFromToolboxEventArgs=e.AddShapeFromToolboxRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.shapeType=n,o}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.AddShapeFromToolbox},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.shapeType)},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"addShapeFromToolbox"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+this.shapeType},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&this.shapeType===t.shapeType},e}(s.RequestedEntity);e.AddShapeFromToolboxRequestedEntity=a;var c=function(t){function e(e){var n=t.call(this)||this;return n.shapeType=e,n}return i(e,t),e}(s.PermissionRequestEventArgs);e.AddShapeFromToolboxEventArgs=c},4829:function(t,e,n){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])},o(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}),e.BeforeChangeConnectorTextEventArgs=e.BeforeChangeConnectorTextRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.connector=n,i.position=o,i}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.BeforeChangeConnectorText},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeConnector(this.connector),this.position,this.connector.texts.map((function(t){return t})).sort((function(t,e){return t.position-e.position})).indexOf(this.connector.texts.get(this.position)))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"changeConnectorText"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return"before"+this.settingsKey+"_"+(this.connector&&this.connector.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.connector===t.connector&&this.position===t.position&&this.connector.texts.get(this.position)===t.connector.texts.get(t.position))},e}(s.RequestedEntity);e.BeforeChangeConnectorTextRequestedEntity=a;var c=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connector=e,i.position=n,i.index=o,i}return i(e,t),e}(s.PermissionRequestEventArgs);e.BeforeChangeConnectorTextEventArgs=c},2345:function(t,e,n){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])},o(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}),e.BeforeChangeShapeTextEventArgs=e.BeforeChangeShapeTextRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.shape=n,o}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.BeforeChangeShapeText},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeShape(this.shape))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"changeShapeText"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return"before"+this.settingsKey+"_"+(this.shape&&this.shape.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.shape===t.shape&&this.shape.text===t.shape.text)},e}(s.RequestedEntity);e.BeforeChangeShapeTextRequestedEntity=a;var c=function(t){function e(e){var n=t.call(this)||this;return n.shape=e,n}return i(e,t),e}(s.PermissionRequestEventArgs);e.BeforeChangeShapeTextEventArgs=c},6466:function(t,e,n){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])},o(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}),e.ChangeConnectionEventArgs=e.ChangeConnectionRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n,o,i,r,s){var a=t.call(this,e)||this;return a.connector=n,a.shape=o,a.oldShape=i,a.position=r,a.connectionPointIndex=s,a}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.ChangeConnection},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeConnector(this.connector),this.apiController.createNativeShape(this.shape),this.apiController.createNativeShape(this.oldShape),this.position,this.connectionPointIndex)},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"changeConnection"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.connector&&this.connector.key)+"_"+this.position},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){if(t instanceof e){var n=!this.connector&&!t.connector||this.connector&&t.connector&&this.connector===t.connector,o=!this.shape&&!t.shape||this.shape&&t.shape&&this.shape===t.shape,i=!this.oldShape&&!t.oldShape||this.oldShape&&t.oldShape&&this.oldShape===t.oldShape;return o&&i&&n&&this.position===t.position&&this.connectionPointIndex===t.connectionPointIndex}return!1},e}(s.RequestedEntity);e.ChangeConnectionRequestedEntity=a;var c=function(t){function e(e,n,o,i,r){var s=t.call(this)||this;return s.connector=e,s.shape=n,s.oldShape=o,s.position=i,s.connectionPointIndex=r,s}return i(e,t),e}(s.PermissionRequestEventArgs);e.ChangeConnectionEventArgs=c},6354:function(t,e,n){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])},o(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}),e.ChangeConnectorPointsEventArgs=e.ChangeConnectorPointsRequestedEntity=void 0;var r=n(6879),s=n(8532),a=n(8675),c=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.connector=n,r.oldPoints=o,r.points=i,r}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.ChangeConnectorPoints},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){var t=this;return new u(this.apiController.createNativeConnector(this.connector),this.oldPoints.map((function(e){return t.apiController.convertPoint(e)})),this.points.map((function(e){return t.apiController.convertPoint(e)})))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"changeConnectorPoints"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.connector&&this.connector.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.connector===t.connector&&a.GeometryUtils.arePointsEqual(this.oldPoints,t.oldPoints)&&a.GeometryUtils.arePointsEqual(this.points,t.points))},e}(s.RequestedEntity);e.ChangeConnectorPointsRequestedEntity=c;var u=function(t){function e(e,n,o){var i=t.call(this)||this;return i.connector=e,i.oldPoints=n,i.points=o,i}return i(e,t),e}(s.PermissionRequestEventArgs);e.ChangeConnectorPointsEventArgs=u},2249:function(t,e,n){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])},o(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}),e.ChangeConnectorTextEventArgs=e.ChangeConnectorTextRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.connector=n,r.position=o,r.text=i,r}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.ChangeConnectorText},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeConnector(this.connector),this.position,this.connector.texts.map((function(t){return t})).sort((function(t,e){return t.position-e.position})).indexOf(this.connector.texts.get(this.position)),this.text)},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"changeConnectorText"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.connector&&this.connector.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.connector===t.connector&&this.position===t.position&&this.text===t.text)},e}(s.RequestedEntity);e.ChangeConnectorTextRequestedEntity=a;var c=function(t){function e(e,n,o,i){var r=t.call(this)||this;return r.connector=e,r.position=n,r.index=o,r.text=i,r}return i(e,t),e}(s.PermissionRequestEventArgs);e.ChangeConnectorTextEventArgs=c},5560:function(t,e,n){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])},o(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}),e.ChangeShapeTextEventArgs=e.ChangeShapeTextRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n,o){var i=t.call(this,e)||this;return i.shape=n,i.text=o,i}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.ChangeShapeText},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeShape(this.shape),this.text)},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"changeShapeText"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.shape&&this.shape.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.shape===t.shape&&this.text===t.text)},e}(s.RequestedEntity);e.ChangeShapeTextRequestedEntity=a;var c=function(t){function e(e,n){var o=t.call(this)||this;return o.shape=e,o.text=n,o}return i(e,t),e}(s.PermissionRequestEventArgs);e.ChangeShapeTextEventArgs=c},6580:function(t,e,n){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])},o(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}),e.DeleteConnectorEventArgs=e.DeleteConnectorRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.connector=n,o}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.DeleteConnector},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeConnector(this.connector))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"deleteConnector"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.connector&&this.connector.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&this.connector===t.connector},e}(s.RequestedEntity);e.DeleteConnectorRequestedEntity=a;var c=function(t){function e(e){var n=t.call(this)||this;return n.connector=e,n}return i(e,t),e}(s.PermissionRequestEventArgs);e.DeleteConnectorEventArgs=c},8825:function(t,e,n){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])},o(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}),e.DeleteShapeEventArgs=e.DeleteShapeRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n){var o=t.call(this,e)||this;return o.shape=n,o}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.DeleteShape},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeShape(this.shape))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"deleteShape"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.shape&&this.shape.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&this.shape===t.shape},e}(s.RequestedEntity);e.DeleteShapeRequestedEntity=a;var c=function(t){function e(e){var n=t.call(this)||this;return n.shape=e,n}return i(e,t),e}(s.PermissionRequestEventArgs);e.DeleteShapeEventArgs=c},4864:function(t,e,n){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])},o(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}),e.MoveShapeEventArgs=e.MoveShapeRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.shape=n,r.oldPosition=o,r.position=i,r}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.MoveShape},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeShape(this.shape),this.apiController.convertPoint(this.oldPosition),this.apiController.convertPoint(this.position))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"moveShape"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.shape&&this.shape.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.shape===t.shape&&this.oldPosition.equals(t.oldPosition)&&this.position.equals(t.position))},e}(s.RequestedEntity);e.MoveShapeRequestedEntity=a;var c=function(t){function e(e,n,o){var i=t.call(this)||this;return i.shape=e,i.oldPosition=n,i.position=o,i}return i(e,t),e}(s.PermissionRequestEventArgs);e.MoveShapeEventArgs=c},8532:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PermissionRequestEventArgs=e.RequestedEntity=void 0;var n=function(){function t(t){this.apiController=t}return Object.defineProperty(t.prototype,"allowed",{get:function(){return this.eventArgs.allowed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"updateUI",{get:function(){return this.eventArgs.updateUI},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"eventArgs",{get:function(){return this._eventArgs||(this._eventArgs=this.createEventArgs()),this._eventArgs},enumerable:!1,configurable:!0}),t}();e.RequestedEntity=n;var o=function(){this.allowed=!0,this.updateUI=!1};e.PermissionRequestEventArgs=o},3214:function(t,e,n){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])},o(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}),e.ResizeShapeEventArgs=e.ResizeShapeRequestedEntity=void 0;var r=n(6879),s=n(8532),a=function(t){function e(e,n,o,i){var r=t.call(this,e)||this;return r.shape=n,r.oldSize=o,r.size=i,r}return i(e,t),Object.defineProperty(e.prototype,"operation",{get:function(){return r.DiagramModelOperation.ResizeShape},enumerable:!1,configurable:!0}),e.prototype.createEventArgs=function(){return new c(this.apiController.createNativeShape(this.shape),this.apiController.convertSize(this.oldSize),this.apiController.convertSize(this.size))},Object.defineProperty(e.prototype,"settingsKey",{get:function(){return"resizeShape"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"storageKey",{get:function(){return this.settingsKey+"_"+(this.shape&&this.shape.key)},enumerable:!1,configurable:!0}),e.prototype.equals=function(t){return t instanceof e&&(this.shape===t.shape&&this.oldSize.equals(t.oldSize)&&this.size.equals(t.size))},e}(s.RequestedEntity);e.ResizeShapeRequestedEntity=a;var c=function(t){function e(e,n,o){var i=t.call(this)||this;return i.shape=e,i.oldSize=n,i.size=o,i}return i(e,t),e}(s.PermissionRequestEventArgs);e.ResizeShapeEventArgs=c},2883:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PermissionsProvider=void 0;var o=n(5503),i=n(8675),r=n(6879),s=n(7959),a=n(6469),c=n(8825),u=n(6580),h=n(1110),p=n(6466),l=n(6354),d=n(2345),f=n(4829),y=n(5560),g=n(2249),m=n(9187),v=n(3214),P=n(4864),C=function(){function t(t){this.onRequestOperation=new i.EventDispatcher,this.cache=[],this.permissionsLockCount=0,this.requestDeleteItems={},this.updateUICount=0,this.apiController=t,this.operationSettings=new r.ModelOperationSettings,this.storage=new m.PermissionsProviderStorage}return t.prototype.notifySelectionChanged=function(t){this.clearCache()},t.prototype.notifyModelChanged=function(t){this.clearCache()},t.prototype.notifyPageColorChanged=function(t){},t.prototype.notifyPageSizeChanged=function(t,e){},t.prototype.clearCache=function(t){this.cache=void 0!==t?this.cache.filter((function(e){return e.operation!==t})):[]},t.prototype.canDeleteItems=function(t){var e=this,n=!0;return t.forEach((function(t){var i;t instanceof o.Shape&&(i=new c.DeleteShapeRequestedEntity(e.apiController,t)),t instanceof s.Connector&&(i=new u.DeleteConnectorRequestedEntity(e.apiController,t)),n=n&&e.requestOperation(i)})),n},t.prototype.canAddItems=function(t){var e=this,n=!0;return t.forEach((function(t){t instanceof o.Shape&&(n=n&&e.requestOperation(new a.AddShapeRequestedEntity(e.apiController,t))),t instanceof s.Connector&&(n=(n=n&&e.canChangeConnection(t,t.beginItem,void 0,s.ConnectorPosition.Begin,t.beginConnectionPointIndex))&&e.canChangeConnection(t,t.endItem,void 0,s.ConnectorPosition.End,t.endConnectionPointIndex))})),n},t.prototype.canAddShapeFromToolbox=function(t){return this.requestOperation(new h.AddShapeFromToolboxRequestedEntity(this.apiController,t))},t.prototype.canChangeConnection=function(t,e,n,i,r){return!(!t||!this.requestDeleteItems[t.key])||(!(null==e||e instanceof o.Shape)||this.requestOperation(new p.ChangeConnectionRequestedEntity(this.apiController,t,e,n,i,r)))},t.prototype.canChangeConnectorPoints=function(t,e,n){return!(!t||!this.requestDeleteItems[t.key])||this.requestOperation(new l.ChangeConnectorPointsRequestedEntity(this.apiController,t,e,n))},t.prototype.canChangeShapeText=function(t){return this.requestOperation(new d.BeforeChangeShapeTextRequestedEntity(this.apiController,t))},t.prototype.canChangeConnectorText=function(t,e){return this.requestOperation(new f.BeforeChangeConnectorTextRequestedEntity(this.apiController,t,e))},t.prototype.canApplyShapeTextChange=function(t,e){return this.requestOperation(new y.ChangeShapeTextRequestedEntity(this.apiController,t,e))},t.prototype.canApplyConnectorTextChange=function(t,e,n){return this.requestOperation(new g.ChangeConnectorTextRequestedEntity(this.apiController,t,e,n))},t.prototype.canResizeShapes=function(t){var e=this,n=!0;return t.forEach((function(t){n=n&&e.requestOperation(new v.ResizeShapeRequestedEntity(e.apiController,t.shape,t.oldSize,t.size))})),n},t.prototype.canMoveShapes=function(t){var e=this,n=!0;return t.forEach((function(t){n=n&&e.requestOperation(new P.MoveShapeRequestedEntity(e.apiController,t.shape,t.oldPosition,t.position))})),n},t.prototype.requestOperation=function(t){var e,n=!0;if(!this.permissionsLockCount&&(this.updateUICount>0&&this.cache.forEach((function(n){n.equals(t)&&(e=n)})),e?n=e.allowed:(this.requestOperationCore(t),this.updateUICount>0&&this.cache.push(t),n=t.allowed),0===this.updateUICount&&this.storage.needStorePermissions()))return this.storage.storePermission(t.storageKey,n),this.storage.isStoredPermissionsGranted();return n},t.prototype.requestOperationCore=function(t){t.eventArgs.allowed=this.operationSettings[t.settingsKey],t.eventArgs.updateUI=this.updateUICount>0,t.allowed&&this.onRequestOperation.raise("notifyRequestOperation",t.operation,t.eventArgs)},t.prototype.lockPermissions=function(){this.permissionsLockCount++},t.prototype.unlockPermissions=function(){this.permissionsLockCount--},t.prototype.beginDeleteItems=function(t){var e=this;t.forEach((function(t){return e.requestDeleteItems[t.key]=t}))},t.prototype.endDeleteItems=function(){this.requestDeleteItems={}},t.prototype.beginUpdateUI=function(){this.updateUICount++},t.prototype.endUpdateUI=function(){this.updateUICount--},t.prototype.addInteractingItem=function(t,e){this.storage.addInteractingItem(t,e)},t.prototype.getInteractingItem=function(t,e){return this.storage.getInteractingItem(t,e)},t.prototype.getInteractingItemCount=function(){return this.storage.getInteractingItemCount()},t.prototype.clearInteractingItems=function(){this.storage.clearInteractingItems()},t.prototype.beginStorePermissions=function(){this.storage.beginStorePermissions()},t.prototype.endStorePermissions=function(){this.storage.endStorePermissions()},t.prototype.isStoredPermissionsGranted=function(){return this.permissionsLockCount>0||this.storage.isStoredPermissionsGranted()},t}();e.PermissionsProvider=C},9187:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PermissionsProviderStorage=void 0;var o=n(5503),i=n(7959),r=function(){function t(){this.interactingItems={},this.storedPermissions={}}return t.prototype.addInteractingItem=function(t,e){var n=this.getInteractingItemKey(t,e);void 0===this.interactingItems[n]&&(t instanceof o.Shape||t instanceof i.Connector)&&(this.interactingItems[n]=t.clone())},t.prototype.getInteractingItem=function(t,e){var n=this.getInteractingItemKey(t,e);return this.interactingItems[n]},t.prototype.getInteractingItemCount=function(){return Object.keys(this.interactingItems).length},t.prototype.clearInteractingItems=function(){this.interactingItems={}},t.prototype.getInteractingItemKey=function(t,e){return t.key+(void 0!==e?"_"+e.toString():"")},t.prototype.needStorePermissions=function(){return this.storePermissions},t.prototype.beginStorePermissions=function(){this.storePermissions=!0},t.prototype.endStorePermissions=function(){this.storePermissions=!1,this.storedPermissions={}},t.prototype.isStoredPermissionsGranted=function(){for(var t=Object.keys(this.storedPermissions),e=!0,n=0;ne.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===h.ConnectionPointSide.East?n.x-=r:s===h.ConnectionPointSide.West&&(n.x+=r)}else t.prototype.processConnectionPoint.call(this,e,n)},e}(c.ArrowVerticalShapeDescription);e.ArrowDownShapeDescription=p},4493:function(t,e,n){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])},o(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}),e.ArrowHorizontalShapeDescription=e.ArrowVerticalLineHeightParameterName=e.ArrowVerticalTriangleWidthParameterName=void 0;var r=n(6794),s=n(6353),a=n(6629),c=n(3742);e.ArrowVerticalTriangleWidthParameterName="tw",e.ArrowVerticalLineHeightParameterName="lh";var u=function(t){function n(){return t.call(this,new s.Size(r.ShapeDefaultDimension,.375*r.ShapeDefaultDimension))||this}return i(n,t),Object.defineProperty(n.prototype,"keepRatioOnAutoSize",{get:function(){return!1},enumerable:!1,configurable:!0}),n.prototype.createParameters=function(t){t.addRangeIfNotExists([new a.ShapeParameter(e.ArrowVerticalTriangleWidthParameterName,Math.sqrt(Math.pow(this.defaultSize.height,2)-Math.pow(this.defaultSize.height/2,2))),new a.ShapeParameter(e.ArrowVerticalLineHeightParameterName,this.defaultSize.height/3)])},n.prototype.normalizeParameters=function(t,n){this.changeParameterValue(n,e.ArrowVerticalTriangleWidthParameterName,(function(e){return Math.max(0,Math.min(t.size.width,e.value))})),this.changeParameterValue(n,e.ArrowVerticalLineHeightParameterName,(function(e){return Math.max(0,Math.min(t.size.height,e.value))}))},n.prototype.processConnectionPoint=function(t,n){var o=(t.size.height-t.parameters.get(e.ArrowVerticalLineHeightParameterName).value)/2,i=t.getConnectionPointSide(n);i===c.ConnectionPointSide.North?n.y+=o:i===c.ConnectionPointSide.South&&(n.y-=o)},n.prototype.getTextRectangle=function(t){return t.rectangle.clone().inflate(-r.ShapeTextPadding,-r.ShapeTextPadding)},n.prototype.getSizeByText=function(t,e){return t.clone().offset(2*r.ShapeTextPadding,2*r.ShapeTextPadding)},n}(r.ShapeDescription);e.ArrowHorizontalShapeDescription=u},8800:function(t,e,n){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])},o(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}),e.ArrowLeftRightShapeDescription=void 0;var r=n(7724),s=n(4493),a=n(1852),c=n(8900),u=n(2259),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeTypes.ArrowLeftRight},enumerable:!1,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.x,o=e.y,i=e.right,a=e.bottom,c=e.height,u=e.center.y,h=t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value,p=(c-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2,l=t.normalizeX(n+h),d=t.normalizeY(o+p),f=t.normalizeX(i-h),y=t.normalizeY(a-p);return[new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(n,u),new r.PathPrimitiveLineToCommand(l,o),new r.PathPrimitiveLineToCommand(l,d),new r.PathPrimitiveLineToCommand(f,d),new r.PathPrimitiveLineToCommand(f,o),new r.PathPrimitiveLineToCommand(i,u),new r.PathPrimitiveLineToCommand(f,a),new r.PathPrimitiveLineToCommand(f,y),new r.PathPrimitiveLineToCommand(l,y),new r.PathPrimitiveLineToCommand(l,a),new r.PathPrimitiveClosePathCommand],t.style)]},e.prototype.normalizeParameters=function(t,e){this.changeParameterValue(e,s.ArrowVerticalTriangleWidthParameterName,(function(e){return Math.max(0,Math.min(t.size.width/2-2*t.strokeWidth,e.value))})),this.changeParameterValue(e,s.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,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}(s.ArrowHorizontalShapeDescription);e.ArrowLeftRightShapeDescription=h},6023:function(t,e,n){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])},o(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}),e.ArrowLeftShapeDescription=void 0;var r=n(7724),s=n(4493),a=n(1852),c=n(8900),u=n(2259),h=n(3742),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeTypes.ArrowLeft},enumerable:!1,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.x,o=e.y,i=e.right,a=e.bottom,c=e.height,u=e.center.y,h=t.parameters.get(s.ArrowVerticalTriangleWidthParameterName).value,p=(c-t.parameters.get(s.ArrowVerticalLineHeightParameterName).value)/2,l=t.normalizeX(n+h),d=t.normalizeY(o+p),f=t.normalizeY(a-p);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.xe.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===h.ConnectionPointSide.North?n.y+=r:a===h.ConnectionPointSide.South&&(n.y-=r)}else t.prototype.processConnectionPoint.call(this,e,n)},e}(s.ArrowHorizontalShapeDescription);e.ArrowRightShapeDescription=p},9089:function(t,e,n){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])},o(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}),e.ArrowUpDownShapeDescription=void 0;var r=n(7724),s=n(1852),a=n(8900),c=n(731),u=n(2259),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeTypes.ArrowUpDown},enumerable:!1,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.x,o=e.y,i=e.right,s=e.bottom,a=e.width,u=e.center.x,h=(a-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2,p=t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value,l=t.normalizeX(n+h),d=t.normalizeY(o+p),f=t.normalizeX(i-h),y=t.normalizeY(s-p);return[new r.PathPrimitive([new r.PathPrimitiveMoveToCommand(u,o),new r.PathPrimitiveLineToCommand(i,d),new r.PathPrimitiveLineToCommand(f,d),new r.PathPrimitiveLineToCommand(f,y),new r.PathPrimitiveLineToCommand(i,y),new r.PathPrimitiveLineToCommand(u,s),new r.PathPrimitiveLineToCommand(n,y),new r.PathPrimitiveLineToCommand(l,y),new r.PathPrimitiveLineToCommand(l,d),new r.PathPrimitiveLineToCommand(n,d),new r.PathPrimitiveClosePathCommand],t.style)]},e.prototype.normalizeParameters=function(t,e){this.changeParameterValue(e,c.ArrowVerticalTriangleHeightParameterName,(function(e){return Math.max(0,Math.min(t.size.height/2-2*t.strokeWidth,e.value))})),this.changeParameterValue(e,c.ArrowVerticalLineWidthParameterName,(function(e){return Math.max(0,Math.min(t.size.width,e.value))}))},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}(c.ArrowVerticalShapeDescription);e.ArrowUpDownShapeDescription=h},8327:function(t,e,n){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])},o(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}),e.ArrowUpShapeDescription=void 0;var r=n(7724),s=n(1852),a=n(8900),c=n(731),u=n(2259),h=n(3742),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),Object.defineProperty(e.prototype,"key",{get:function(){return u.ShapeTypes.ArrowUp},enumerable:!1,configurable:!0}),e.prototype.createShapePrimitives=function(t){var e=t.rectangle,n=e.x,o=e.y,i=e.right,s=e.bottom,a=e.width,u=e.center.x,h=(a-t.parameters.get(c.ArrowVerticalLineWidthParameterName).value)/2,p=t.parameters.get(c.ArrowVerticalTriangleHeightParameterName).value,l=t.normalizeX(n+h),d=t.normalizeY(o+p),f=t.normalizeX(i-h);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.y,i=n.right,r=n.width,s=n.height,a=this.getActualBottom(o,n.bottom,r,s),c=n.center.x,p=o+(a-o)/2,l=s/r,d=Math.PI-this.angle,f=o+r/2*Math.tan(d/2)*l,y=t.parameters.get(e.StarConvexParameterName).value,g=this.getInnerPointDistance(c,c,i,p,o,f),m=this.getInnerPointPos(c,c,i,y,g),v=this.getInnerPointPos(p,o,f,y,g);return[new u.ShapeParameterPoint("c",new h.Point(m,v))]},n.prototype.processConnectionPoint=function(n,o){if(t.prototype.processConnectionPoint.call(this,n,o),n.getConnectionPointSide(o)===p.ConnectionPointSide.South){var i=n.rectangle,r=i.y,s=i.right,a=i.width,c=i.height,u=this.getActualBottom(r,i.bottom,a,c),h=i.center.x,l=r+(u-r)/2,d=c/a,f=Math.PI-this.angle,y=r+a/2*Math.tan(f/2)*d,g=n.parameters.get(e.StarConvexParameterName).value,m=this.getInnerPointDistance(h,h,s,l,r,y);o.y=this.getInnerPointPos(l,u,u,g,m)}},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 r{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeDescription=e.ShapeTextPadding=e.ShapeDefaultSize=e.ShapeMinDimension=e.ShapeDefaultDimension=void 0;var o=n(9291),i=n(6353),r=n(6224),s=n(4246),a=n(4716),c=n(9416),u=n(8675),h=n(7228),p=n(3742);e.ShapeDefaultDimension=1440,e.ShapeMinDimension=360,e.ShapeDefaultSize=new i.Size(e.ShapeDefaultDimension,e.ShapeDefaultDimension),e.ShapeTextPadding=o.UnitConverter.pixelsToTwips(10);var l=function(){function t(t,n){void 0===t&&(t=e.ShapeDefaultSize.clone()),this.defaultSize=t,this.hasDefaultText=n,this.onChanged=new u.EventDispatcher,this.connectionPoints=this.createConnectionPoints()}return Object.defineProperty(t.prototype,"enableText",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowEditText",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableImage",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"allowEditImage",{get:function(){return!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTemplate",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"enableChildren",{get:function(){return!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxSize",{get:function(){return this.defaultSize},enumerable:!1,configurable:!0}),t.prototype.getTitle=function(){return r.DiagramLocalizationService.shapeTexts[this.key]},t.prototype.getDefaultText=function(){return this.hasDefaultText?r.DiagramLocalizationService.shapeTexts[this.key]:""},t.prototype.getDefaultImageUrl=function(){return""},t.prototype.getConnectionPoints=function(){return this.connectionPoints},t.prototype.createConnectionPoints=function(){return[new h.ConnectionPoint(.5,0,p.ConnectionPointSide.North),new h.ConnectionPoint(1,.5,p.ConnectionPointSide.East),new h.ConnectionPoint(.5,1,p.ConnectionPointSide.South),new h.ConnectionPoint(0,.5,p.ConnectionPointSide.West)]},t.prototype.processConnectionPoint=function(t,e){},t.prototype.getConnectionPointIndexForItem=function(t,e){return e},t.prototype.getConnectionPointIndexForSide=function(t){return t},t.getConnectionPointSideByGeometry=function(t){return t.x>=t.y&&(t.x>0||t.y>0)?t.x<.5||1-t.x>=t.y?p.ConnectionPointSide.North:p.ConnectionPointSide.East:t.x>.5||1-t.x<=t.y?p.ConnectionPointSide.South:p.ConnectionPointSide.West},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){return t.size},t.prototype.getCollapsedSize=function(t){return t.size},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,n){var o=[];return o=o.concat(this.createShapePrimitives(t,n)),this.enableImage&&(o=o.concat(this.createImagePrimitives(t,n))),this.enableText&&(o=o.concat(this.createTextPrimitives(t,n))),o},t.prototype.createImagePrimitives=function(t,e){return[]},t.prototype.createTextPrimitives=function(e,n){if(void 0===e.text||""===e.text)return[];var o=this.getTextRectangle(e);return[new c.TextPrimitive(o.x,o.y,e.text,s.TextOwner.Shape,o.width,o.height,t.textSpacing,e.styleText,!1,this.getTextClipPathId(n),void 0,this.getTextAngle())]},t.prototype.getTextClipPathId=function(t){},t.prototype.getTextAngle=function(){return c.TextAngle.Angle0deg},t.prototype.getClientRectangle=function(t){return t.rectangle},t.prototype.getTextEditRectangle=function(t){return this.getTextRectangle(t)},t.prototype.createSelectorPrimitives=function(t){return[new a.RectanglePrimitive(t.position.x,t.position.y,t.size.width,t.size.height,null,"selector")]},t.prototype.raiseShapeDescriptionChanged=function(t){this.onChanged.raise1((function(e){return e.notifyShapeDescriptionChanged(t)}))},t.textSpacing=o.UnitConverter.pixelsToTwips(2),t}();e.ShapeDescription=l},8397:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeDescriptionManager=void 0;var o=n(5331),i=n(6825),r=n(9144),s=n(4941),a=n(6242),c=n(6508),u=n(9089),h=n(6599),p=n(8327),l=n(2281),d=n(5303),f=n(7768),y=n(8628),g=n(1561),m=n(1669),v=n(8761),P=n(2953),C=n(1412),S=n(8772),x=n(4958),b=n(8800),I=n(6023),w=n(2117),_=n(3525),T=n(2850),O=n(4112),M=n(1314),E=n(1034),D=n(2751),A=n(8110),R=n(1643),L=n(9229),N=n(4810),z=n(3046),j=n(2650),U=n(2019),k=n(6182),B=n(6688),H=n(5759),K=n(944),V=n(2816),F=n(2259),W=n(7552),G=n(8675),Z=n(3107),q=function(){function t(){this.descriptions={},this.descriptionTypes={},this.descriptionCategories={},this.onShapeDecriptionChanged=new G.EventDispatcher,this.register(new m.TextShapeDescription,F.ShapeCategories.General),this.register(new g.RectangleShapeDescription,F.ShapeCategories.General),this.register(new f.EllipseShapeDescription,F.ShapeCategories.General),this.register(new l.CrossShapeDescription,F.ShapeCategories.General),this.register(new w.TriangleShapeDescription,F.ShapeCategories.General),this.register(new d.DiamondShapeDescription,F.ShapeCategories.General),this.register(new y.HeartShapeDescription,F.ShapeCategories.General),this.register(new v.PentagonShapeDescription,F.ShapeCategories.General),this.register(new P.HexagonShapeDescription,F.ShapeCategories.General),this.register(new C.OctagonShapeDescription,F.ShapeCategories.General),this.register(new S.StarShapeDescription,F.ShapeCategories.General),this.register(new p.ArrowUpShapeDescription,F.ShapeCategories.General),this.register(new x.ArrowDownShapeDescription,F.ShapeCategories.General),this.register(new I.ArrowLeftShapeDescription,F.ShapeCategories.General),this.register(new h.ArrowRightShapeDescription,F.ShapeCategories.General),this.register(new u.ArrowUpDownShapeDescription,F.ShapeCategories.General),this.register(new b.ArrowLeftRightShapeDescription,F.ShapeCategories.General),this.register(new o.ProcessShapeDescription,F.ShapeCategories.Flowchart),this.register(new i.DecisionShapeDescription,F.ShapeCategories.Flowchart),this.register(new a.TerminatorShapeDescription,F.ShapeCategories.Flowchart),this.register(new c.PredefinedProcessShapeDescription,F.ShapeCategories.Flowchart),this.register(new _.DocumentShapeDescription,F.ShapeCategories.Flowchart),this.register(new T.MultipleDocumentsShapeDescription,F.ShapeCategories.Flowchart),this.register(new r.ManualInputShapeDescription,F.ShapeCategories.Flowchart),this.register(new O.PreparationShapeDescription,F.ShapeCategories.Flowchart),this.register(new s.DataShapeDescription,F.ShapeCategories.Flowchart),this.register(new E.DatabaseShapeDescription,F.ShapeCategories.Flowchart),this.register(new M.HardDiskShapeDescription,F.ShapeCategories.Flowchart),this.register(new D.InternalStorageShapeDescription,F.ShapeCategories.Flowchart),this.register(new A.PaperTapeShapeDescription,F.ShapeCategories.Flowchart),this.register(new R.ManualOperationShapeDescription,F.ShapeCategories.Flowchart),this.register(new L.DelayShapeDescription,F.ShapeCategories.Flowchart),this.register(new N.StoredDataShapeDescription,F.ShapeCategories.Flowchart),this.register(new j.DisplayShapeDescription,F.ShapeCategories.Flowchart),this.register(new z.MergeShapeDescription,F.ShapeCategories.Flowchart),this.register(new W.ConnectorShapeDescription,F.ShapeCategories.Flowchart),this.register(new U.OrShapeDescription,F.ShapeCategories.Flowchart),this.register(new k.SummingJunctionShapeDescription,F.ShapeCategories.Flowchart),this.register(new Z.CardWithImageOnLeftDescription,F.ShapeCategories.OrgChart),this.register(new Z.CardWithImageOnRightDescription,F.ShapeCategories.OrgChart),this.register(new V.CardWithImageOnTopDescription,F.ShapeCategories.OrgChart),this.register(new H.VerticalContainerDescription,F.ShapeCategories.Containers),this.register(new K.HorizontalContainerDescription,F.ShapeCategories.Containers)}return Object.defineProperty(t,"default",{get:function(){return t.defaultInstance},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultContainer",{get:function(){return t.defaultContainerInstance},enumerable:!1,configurable:!0}),t.prototype.get=function(t){return this.descriptions[t]},t.prototype.getTypesByCategory=function(t){return this.descriptionTypes[t]||[]},t.prototype.getCategoryByType=function(t){return this.descriptionCategories[t]},t.prototype.getCategoryByDescription=function(t){return this.getCategoryByType(t.key)},t.prototype.register=function(t,e,n){if(void 0===n&&(n=t.key),void 0!==this.descriptions[n])throw Error("Description key is duplicated");this.descriptions[n]=t,this.descriptionTypes[e]||(this.descriptionTypes[e]=[]),this.descriptionTypes[e].push(n),this.descriptionCategories[n]=e,t.onChanged.add(this)},t.prototype.registerCustomShape=function(t){if(void 0===t.type)throw Error("Custom shape type is not defined");if(void 0!==this.descriptions[t.type])throw Error("Custom shape type is duplicated");var e=t.baseType&&this.descriptions[t.baseType];t.minWidth>t.maxWidth&&(t.maxWidth=t.minWidth),t.minHeight>t.maxHeight&&(t.maxHeight=t.minHeight),this.register(new B.CustomShapeDescription(t,e),t.category||F.ShapeCategories.Custom)},t.prototype.unregisterCustomShape=function(t){var e=this.descriptions[t];if(e instanceof B.CustomShapeDescription){e.onChanged.remove(this);var n=this.descriptionCategories[t];delete this.descriptions[t],delete this.descriptionCategories[t];var o=this.descriptionTypes[n].indexOf(t);this.descriptionTypes[n].splice(o,1),0===this.descriptionTypes[n].length&&delete this.descriptionTypes[n]}},t.prototype.unregisterAllCustomShapes=function(){var t=this;Object.keys(this.descriptions).forEach((function(e){t.unregisterCustomShape(e)}))},t.prototype.notifyShapeDescriptionChanged=function(t){this.onShapeDecriptionChanged.raise1((function(e){return e.notifyShapeDescriptionChanged(t)}))},t.defaultInstance=new g.RectangleShapeDescription,t.defaultContainerInstance=new H.VerticalContainerDescription,t}();e.ShapeDescriptionManager=q},4083:function(t,e,n){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])},o(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}),e.ShapeWithImageDescription=e.SHAPE_IMAGE_CLASSNAMES=e.ShapeDefaultSize=e.ShapeDefaultDimension=void 0;var r=n(6794),s=n(8011),a=n(6353),c=n(8900),u=n(9291),h=n(1995),p=n(4716),l=n(5329),d=n(3500),f=n(4593),y=n(6411);e.ShapeDefaultDimension=1440,e.ShapeDefaultSize=new a.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 g=function(t){function n(n,o){void 0===n&&(n=e.ShapeDefaultSize.clone());var i=t.call(this,n,o)||this;return i.hasDefaultText=o,i.defaultIconSize=480,i}return i(n,t),Object.defineProperty(n.prototype,"enableImage",{get:function(){return!0},enumerable:!1,configurable:!0}),n.prototype.getImageMargin=function(t){return t?u.UnitConverter.pixelsToTwips(2):u.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=d.RenderUtils.generateSvgElementId("clipImage");return[].concat([new l.GroupPrimitive(i,e.SHAPE_IMAGE_CLASSNAMES.IMAGE,void 0,r),new f.ClipPathPrimitive(r,[new p.RectanglePrimitive(o.x,o.y,o.width,o.height)])])}return i},n.prototype.createImagePlaceholder=function(t){return[]},n.prototype.createLoadedImagePrimitives=function(t,o){return[new h.ImagePrimitive(t.x,t.y,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[y.ShapeImageIndicator.createLoadingIndicatorPrimitives(n.x,n.y,this.defaultIconSize,u.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 l.GroupPrimitive([])},n.prototype.createWarningPrimitive=function(t){return new l.GroupPrimitive([])},n.prototype.getIconPlacementRectangle=function(t){var e=s.Rectangle.fromGeometry(new c.Point(t.x,t.y),new a.Size(this.defaultIconSize,this.defaultIconSize));return e.width{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeParameterPoint=void 0;var n=function(t,e){this.key=t,this.point=e};e.ShapeParameterPoint=n},6629:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeParameters=e.ShapeParameter=void 0;var n=function(t,e){this.key=t,this.value=e};e.ShapeParameter=n;var o=function(){function t(){this.items={}}return t.prototype.addIfNotExists=function(t){t.key in this.items||this.set(t)},t.prototype.set=function(t){this.items[t.key]=t},t.prototype.addRangeIfNotExists=function(t){for(var e=0;e{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeType=e.ShapeTypes=e.ShapeCategories=void 0;var n=function(){function t(){}return t.General="general",t.Flowchart="flowchart",t.OrgChart="orgChart",t.Containers="containers",t.Custom="custom",t}();e.ShapeCategories=n;var o=function(){function t(){}return t.Text="text",t.Rectangle="rectangle",t.Ellipse="ellipse",t.Cross="cross",t.Triangle="triangle",t.Diamond="diamond",t.Heart="heart",t.Pentagon="pentagon",t.Hexagon="hexagon",t.Octagon="octagon",t.Star="star",t.ArrowLeft="arrowLeft",t.ArrowUp="arrowTop",t.ArrowRight="arrowRight",t.ArrowDown="arrowBottom",t.ArrowUpDown="arrowNorthSouth",t.ArrowLeftRight="arrowEastWest",t.Process="process",t.Decision="decision",t.Terminator="terminator",t.PredefinedProcess="predefinedProcess",t.Document="document",t.MultipleDocuments="multipleDocuments",t.ManualInput="manualInput",t.Preparation="preparation",t.Data="data",t.Database="database",t.HardDisk="hardDisk",t.InternalStorage="internalStorage",t.PaperTape="paperTape",t.ManualOperation="manualOperation",t.Delay="delay",t.StoredData="storedData",t.Display="display",t.Merge="merge",t.Connector="connector",t.Or="or",t.SummingJunction="summingJunction",t.Container="container",t.VerticalContainer="verticalContainer",t.HorizontalContainer="horizontalContainer",t.Card="card",t.CardWithImageOnLeft="cardWithImageOnLeft",t.CardWithImageOnTop="cardWithImageOnTop",t.CardWithImageOnRight="cardWithImageOnRight",t}();e.ShapeTypes=o,function(t){t[t.text=0]="text",t[t.rectangle=1]="rectangle",t[t.ellipse=2]="ellipse",t[t.cross=3]="cross",t[t.triangle=4]="triangle",t[t.diamond=5]="diamond",t[t.heart=6]="heart",t[t.pentagon=7]="pentagon",t[t.hexagon=8]="hexagon",t[t.octagon=9]="octagon",t[t.star=10]="star",t[t.arrowLeft=11]="arrowLeft",t[t.arrowTop=12]="arrowTop",t[t.arrowRight=13]="arrowRight",t[t.arrowBottom=14]="arrowBottom",t[t.arrowNorthSouth=15]="arrowNorthSouth",t[t.arrowEastWest=16]="arrowEastWest",t[t.process=17]="process",t[t.decision=18]="decision",t[t.terminator=19]="terminator",t[t.predefinedProcess=20]="predefinedProcess",t[t.document=21]="document",t[t.multipleDocuments=22]="multipleDocuments",t[t.manualInput=23]="manualInput",t[t.preparation=24]="preparation",t[t.data=25]="data",t[t.database=26]="database",t[t.hardDisk=27]="hardDisk",t[t.internalStorage=28]="internalStorage",t[t.paperTape=29]="paperTape",t[t.manualOperation=30]="manualOperation",t[t.delay=31]="delay",t[t.storedData=32]="storedData",t[t.display=33]="display",t[t.merge=34]="merge",t[t.connector=35]="connector",t[t.or=36]="or",t[t.summingJunction=37]="summingJunction",t[t.verticalContainer=38]="verticalContainer",t[t.horizontalContainer=39]="horizontalContainer",t[t.cardWithImageOnLeft=40]="cardWithImageOnLeft",t[t.cardWithImageOnTop=41]="cardWithImageOnTop",t[t.cardWithImageOnRight=42]="cardWithImageOnRight"}(e.ShapeType||(e.ShapeType={}))},1552:function(t,e,n){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])},o(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}),e.EmptyStyle=e.StrokeStyle=e.TextAlignment=e.TextStyle=e.Style=e.DEFAULT_STROKE_DASHARRAY=e.DEFAULT_STROKE_WIDTH=e.StyleBase=void 0;var r=n(13),s=n(8396),a=n(9291),c=function(){function t(){this.createDefaultProperties()}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)Object.prototype.hasOwnProperty.call(this,e)&&t(e)},Object.defineProperty(t.prototype,"strokeWidthPx",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeWidth",{get:function(){return a.UnitConverter.pixelsToTwips(this.strokeWidthPx)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeOffset",{get:function(){return.5},enumerable:!1,configurable:!0}),t.prototype.toHash=function(){var t=this.toObject();return t?Object.keys(t).map((function(e){return e+"|"+t[e]})).join(""):""},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(Object.prototype.hasOwnProperty.call(t,e)){var n=s.isColorProperty(e)?r.ColorUtils.stringToHash(t[e]):t[e];this[e]=n}},t}();e.StyleBase=c,e.DEFAULT_STROKE_WIDTH=2,e.DEFAULT_STROKE_DASHARRAY="";var u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return i(n,t),n.prototype.createInstance=function(){return new n},n.prototype.createDefaultProperties=function(){this.fill="#ffffff",this.stroke="#000000",this["stroke-width"]=e.DEFAULT_STROKE_WIDTH.toString(),this["stroke-dasharray"]=e.DEFAULT_STROKE_DASHARRAY},n.prototype.getDefaultInstance=function(){return n.defaultInstance},n.prototype.isDefaultStrokeDashArray=function(){return this["stroke-dasharray"]===e.DEFAULT_STROKE_DASHARRAY},n.prototype.resetStrokeDashArray=function(){this["stroke-dasharray"]=e.DEFAULT_STROKE_DASHARRAY},Object.defineProperty(n.prototype,"strokeWidthPx",{get:function(){return parseInt(this["stroke-width"])},enumerable:!1,configurable:!0}),n.defaultInstance=new n,n}(c);e.Style=u;var h,p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.createDefaultProperties=function(){this.fill="#000000",this["font-family"]="Arial",this["font-size"]="10pt",this["font-weight"]="",this["font-style"]="",this["text-decoration"]="",this["text-anchor"]="middle"},e.prototype.getDefaultInstance=function(){return e.defaultInstance},e.prototype.getAlignment=function(){switch(this["text-anchor"]){case"left":return h.Left;case"right":return h.Right;default:return h.Center}},e.defaultInstance=new e,e}(c);e.TextStyle=p,function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center"}(h=e.TextAlignment||(e.TextAlignment={}));var l=function(t){function e(e,n){var o=t.call(this)||this;return o._strokeWidthPx=e,o._strokeOffset=n,o}return i(e,t),e.prototype.createInstance=function(){return new e},e.prototype.createDefaultProperties=function(){},e.prototype.getDefaultInstance=function(){return p.defaultInstance},Object.defineProperty(e.prototype,"strokeWidthPx",{get:function(){return this._strokeWidthPx||0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strokeOffset",{get:function(){return this._strokeOffset||0},enumerable:!1,configurable:!0}),e.default1pxInstance=new e(1,.5),e.default1pxNegativeOffsetInstance=new e(1,-.5),e.default2pxInstance=new e(2),e}(u);e.StrokeStyle=l;var d=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.createDefaultProperties=function(){},e.prototype.getDefaultInstance=function(){return p.defaultInstance},e.defaultInstance=new e,e}(u);e.EmptyStyle=d},6214:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReloadContentParameters=void 0;var n=function(){function t(){this.isEmpty=!0}return t.prototype.add=function(t,e,n){void 0!==t&&(void 0===this._dataKeys&&(this._dataKeys=[]),Array.isArray(t)?this._dataKeys=this._dataKeys.concat(t):this._dataKeys.push(t)),this._getData=this._getData||e,this._layoutParameters=this._layoutParameters||n,this.isEmpty=!1},t.prototype.clear=function(){this.isEmpty=!0,this._dataKeys=void 0,this._getData=void 0,this._layoutParameters=void 0},Object.defineProperty(t.prototype,"empty",{get:function(){return this.isEmpty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataKeys",{get:function(){return this._dataKeys},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getData",{get:function(){return this._getData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layoutParameters",{get:function(){return this._layoutParameters},enumerable:!1,configurable:!0}),t}();e.ReloadContentParameters=n},6557:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AutoScrollController=void 0;var o=n(1114),i=n(6907),r=n(6353),s=n(8675),a=function(){function t(t,e,n,o){this.scroll=t,this.svgElement=e,this.view=n,this.dom=o,this.leftButtonPressed=!1,this.scrollDragging=!1,this.scrollTimer=-1,this.scrollBarWidth=i.DomUtils.getVerticalScrollBarWidth()}return t.prototype.onMouseMove=function(t,e){this.clearScrollTimer(),s.EventUtils.isLeftButtonPressed(t)||(this.leftButtonPressed=!1),this.canAutoScroll()&&this.changeScrollPosition(t,e,!1)},t.prototype.onMouseDown=function(t){this.leftButtonPressed=!!s.EventUtils.isLeftButtonPressed(t)},t.prototype.onMouseUp=function(t){this.clearScrollTimer(),this.leftButtonPressed=!1},t.prototype.onMouseEnter=function(t){var e=this;s.EventUtils.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,s=!1;if(!this.view.isAutoScrollLocked()){var a=this.scroll.getScrollContainer(),c=t.pageX-i.DomUtils.getAbsolutePositionX(a),u=t.pageY-i.DomUtils.getAbsolutePositionY(a),h=this.scroll.getSize(),p=new r.Size(parseFloat(this.svgElement.style.width),parseFloat(this.svgElement.style.height)),l=h.width;h.width-1&&(window.clearTimeout(this.scrollTimer),this.scrollTimer=-1)},t.prototype.getScrollingOffset=function(t){var e=Math.pow((40-t)/5,2);return Math.round(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(o.svgNS,"svg");return n.className.baseVal="dxdi-canvas"+(e?" export":""),t.appendChild(n),n},t}();e.AutoScrollController=a},3872:function(t,e,n){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])},o(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)}),r=this&&this.__awaiter||function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{c(o.next(t))}catch(t){r(t)}}function a(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]0)return"\n"+n}}},e.prototype.checkSelector=function(t){for(var n=0;nt}))[0];this.itemGroupContainers[o][t]=this.createAndChangePrimitiveElement(new a.GroupPrimitive([],null,t),n,this.itemGroupContainers[o][i])}return this.itemGroupContainers[o][t]},n.prototype.getItemSelectorGroupContainer=function(t,e){var n=void 0!==e?this.getItemSelectorParent(t,e):this.itemSelectorsContainer,o=e||"Main";if(void 0===this.itemSelectorGroupContainers[o]||void 0===this.itemSelectorGroupContainers[o][t]){void 0===this.itemSelectorGroupContainers[o]&&(this.itemSelectorGroupContainers[o]=[]);var i=Object.keys(this.itemSelectorGroupContainers[o]).map((function(t){return+t})).sort((function(t,e){return t-e})).filter((function(e){return e>t}))[0];this.itemSelectorGroupContainers[o][t]=this.createAndChangePrimitiveElement(new a.GroupPrimitive([],null,t),n,this.itemSelectorGroupContainers[o][i])}return this.itemSelectorGroupContainers[o][t]},n.prototype.getItemParent=function(t,e){return void 0!==e?this.itemChildElements[e]:this.getItemGroupContainer(t)},n.prototype.getItemSelectorParent=function(t,e){return void 0!==e?this.itemChildElements[e]:this.getItemSelectorGroupContainer(t)},n.prototype.notifySelectionChanged=function(t){var e=this,n=d.ModelUtils.createSelectedItems(t),o=[];this.populateItems(o,n,this.selectedItems),this.populateItems(o,this.selectedItems,n),this.selectedItems=n,o.forEach((function(t){t instanceof h.Connector&&!e.pendingRemoveChanges[t.key]&&e.applyOrPostponeChanges([new r.ItemChange(t,r.ItemChangeType.UpdateClassName,!0)])}))},n.prototype.populateItems=function(t,e,n){Object.keys(e).forEach((function(o){n[o]||t.push(e[o])}))},n}(l.CanvasManager);e.CanvasItemsManager=f},916:function(t,e,n){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])},o(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}),e.CanvasManager=void 0;var r=n(2004),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pendingChanges={},e.pendingRemoveChanges={},e.updatesLock=0,e}return i(e,t),e.prototype.beginUpdate=function(){this.updatesLock++},e.prototype.endUpdate=function(){this.updatesLock--,0===this.updatesLock&&this.applyPendingChanges()},e.prototype.getPendingChanges=function(){var t=this;return Object.keys(this.pendingChanges).map((function(e){return t.pendingChanges[e]}))},e.prototype.getPendingRemoveChanges=function(){var t=this;return Object.keys(this.pendingRemoveChanges).map((function(e){return t.pendingRemoveChanges[e]}))},e.prototype.applyPendingChanges=function(){var t=this.getPendingRemoveChanges();t.length&&(this.applyChangesCore(t),this.pendingRemoveChanges={});var e=this.getPendingChanges();e.length&&(this.applyChangesCore(e),this.pendingChanges={})},e.prototype.applyChangesCore=function(t){var e=this,n=[];t.forEach((function(t){e.applyChange(t)||n.push(t)})),n.length&&n.length!==t.length&&this.applyChangesCore(n)},e.prototype.postponeChanges=function(t){var e=this;t.forEach((function(t){if(t.type===r.ItemChangeType.Remove)e.pendingRemoveChanges[t.key]=t,delete e.pendingChanges[t.key];else if(e.pendingChanges[t.key])t.type===r.ItemChangeType.Create?e.pendingChanges[t.key]=t:t.type===r.ItemChangeType.UpdateStructure?e.pendingChanges[t.key].type===r.ItemChangeType.UpdateProperties&&(e.pendingChanges[t.key]=t):t.type===r.ItemChangeType.UpdateProperties?e.pendingChanges[t.key].type===r.ItemChangeType.Update&&(e.pendingChanges[t.key]=t):t.type===r.ItemChangeType.UpdateClassName&&e.pendingChanges[t.key].type===r.ItemChangeType.UpdateClassName&&(e.pendingChanges[t.key]=t);else{if(e.pendingRemoveChanges[t.key]&&t.type!==r.ItemChangeType.Create)throw new Error("Incorrect model changes sequence.");e.pendingChanges[t.key]=t}}))},e.prototype.applyOrPostponeChanges=function(t){0===this.updatesLock?this.applyChangesCore(t):this.postponeChanges(t)},e.prototype.notifyModelChanged=function(t){this.applyOrPostponeChanges(t)},e.prototype.notifyPageColorChanged=function(t){},e.prototype.notifyPageSizeChanged=function(t,e){},e}(n(7716).CanvasManagerBase);e.CanvasManager=s},7716:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasManagerBase=e.PAGE_BG_TEXTFLOOR_FILTER_IDPREFIX=void 0;var o=n(3360),i=n(9291);e.PAGE_BG_TEXTFLOOR_FILTER_IDPREFIX="page-text-flood";var r=function(){function t(t,e,n){this.elements={},this.instanceId=n,this.actualZoom=t,this.dom=e}return t.prototype.createAndChangePrimitivesElements=function(t,e){var n=this;t.forEach((function(t){n.createAndChangePrimitiveElement(t,e)}))},t.prototype.createPrimitiveElement=function(t,e,n){return this.dom.createElement(t,e,n)},t.prototype.createAndChangePrimitiveElement=function(t,e,n){var o=this.createPrimitiveElement(t,e,n);return this.dom.changeByPrimitive(o,t),o},t.prototype.changePrimitiveElement=function(t,e){this.dom.changeByPrimitive(e,t)},t.prototype.getOrCreateElement=function(t,e,n,o){var i=t&&this.elements[t]||(this.elements[t]=this.createPrimitiveElement(e,n,o));return this.changePrimitiveElement(e,i),i},t.prototype.createTextFloodFilter=function(t,n,i,r){this.getOrCreateElement(n,new o.TextFloodFilterPrimitive(e.PAGE_BG_TEXTFLOOR_FILTER_IDPREFIX+t,r),i)},t.prototype.getAbsoluteSize=function(t){return t.clone().applyConverter(i.UnitConverter.twipsToPixelsF).clone().multiply(this.actualZoom,this.actualZoom)},t}();e.CanvasManagerBase=r},6043:function(t,e,n){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])},o(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}),e.CanvasPageManager=void 0;var r=n(1552),s=n(4716),a=n(7724),c=n(1932),u=n(4593),h=n(7716),p=n(6353),l=n(8900),d=n(3500),f=n(13),y=n(9291),g=function(t){function e(e,n,o,i){var r=t.call(this,n.zoomLevel,o,i)||this;return r.snapPoint=new l.Point(0,0),r.gridPatternId=d.RenderUtils.generateSvgElementId("gridPattern"),r.pagesGridPatternId=d.RenderUtils.generateSvgElementId("pagesGridPattern"),r.pagesGridClipId=d.RenderUtils.generateSvgElementId("pagesGridClip"),r.pageColor=n.pageColor,r.modelSize=n.modelSize,r.simpleView=n.simpleView,r.gridSize=n.gridSize,r.gridVisible=n.gridVisible,r.pageSize=n.pageLandscape?new p.Size(n.pageSize.height,n.pageSize.width):n.pageSize,r.canvasViewOffset=new l.Point(0,0),r.initContainers(e),r}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 r.Style;e.fill=f.ColorUtils.colorToHash(t),this.getOrCreateElement("page-bg",new s.RectanglePrimitive(0,0,"100%","100%",e,"page"),this.backgroundContainer),this.createTextFloodFilter(this.instanceId,"page-bg-textflood-filter",this.backgroundContainer,t)},e.prototype.redrawGrid=function(){this.updateGridElements(),this.updatePagesGridElements()},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(){var t=this,e=new s.RectanglePrimitive("0","0","100%","100%",null,"grid",null,(function(e){e.style.setProperty("fill",d.RenderUtils.getUrlPathById(t.gridPatternId))})),n=this.getGridRectElement(e);if(this.gridVisible){n.style.display="",this.changePrimitiveElement(e,n);for(var o=y.UnitConverter.twipsToPixelsF(this.gridSize)*this.actualZoom,i=[0,1,2,3,4].map((function(t){return Math.round(o*t)})),r=[new a.PathPrimitiveMoveToCommand(i[4].toString(),"0"),new a.PathPrimitiveLineToCommand(i[4].toString(),i[4].toString()),new a.PathPrimitiveLineToCommand("0",i[4].toString())],u=[],h=1;h<=3;h++)u.push(new a.PathPrimitiveMoveToCommand(i[h].toString(),"0")),u.push(new a.PathPrimitiveLineToCommand(i[h].toString(),i[4].toString()));for(h=1;h<=3;h++)u.push(new a.PathPrimitiveMoveToCommand("0",i[h].toString())),u.push(new a.PathPrimitiveLineToCommand(i[4].toString(),i[h].toString()));var p=4*o,f=this.simpleView?this.canvasViewOffset:l.Point.zero(),g=new c.PatternPrimitive(this.gridPatternId,[this.createGridPathPrimitive(r,"grid-outer-line"),this.createGridPathPrimitive(u,"grid-inner-line")],this.createGridPatternPrimitivePosition(f.x,this.snapPoint.x,p),this.createGridPatternPrimitivePosition(f.y,this.snapPoint.y,p),p.toString(),p.toString());this.changePrimitiveElement(g,this.getGridPatternElement(g))}else n.style.display="none"},e.prototype.createGridPatternPrimitivePosition=function(t,e,n){return(((t+e*this.actualZoom)%n-n)%n).toString()},e.prototype.createGridPathPrimitive=function(t,e){return new a.PathPrimitive(t,r.StrokeStyle.default1pxNegativeOffsetInstance,e)},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(){var t=this,e=this.getAbsoluteSize(this.pageSize),n=new s.RectanglePrimitive("0","0","100%","100%",null,"grid-page",this.pagesGridClipId,(function(e){e.style.setProperty("fill",d.RenderUtils.getUrlPathById(t.pagesGridPatternId)),e.style.setProperty("display",t.simpleView?"none":"")}));if(this.getPagesGridRectElement(n),!this.simpleView){var o=this.modelSize.clone().multiply(this.actualZoom,this.actualZoom),i=[new a.PathPrimitiveMoveToCommand((e.width-1).toString(),"0"),new a.PathPrimitiveLineToCommand((e.width-1).toString(),(e.height-1).toString()),new a.PathPrimitiveLineToCommand("0",(e.height-1).toString())],r=new c.PatternPrimitive(this.pagesGridPatternId,[new a.PathPrimitive(i,null,"pages-grid-line")],0,0,e.width.toString(),e.height.toString());this.changePrimitiveElement(r,this.getPagesGridPatternElement(r));var h=new u.ClipPathPrimitive(this.pagesGridClipId,[new s.RectanglePrimitive(0,0,(y.UnitConverter.twipsToPixelsF(o.width)-4).toString(),(y.UnitConverter.twipsToPixelsF(o.height)-4).toString())]);this.changePrimitiveElement(h,this.getPagesGridClipPathElement(h))}},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.clone().applyConverter(y.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 p.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=g},4e3:function(t,e,n){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])},o(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}),e.CanvasSelectionManager=e.ACTIVE_SELECTION_CSSCLASS=e.SELECTION_ELEMENT_CLASSNAMES=void 0;var r=n(7716),s=n(5329),a=n(3500),c=n(6031),u=n(3742),h=n(8675),p=n(8900),l=n(371),d=n(5503),f=n(7959),y=n(4612),g=n(4716),m=n(7724),v=n(9416),P=n(418),C=n(1552),S=n(9291),x=n(4246),b=n(9279),I=n(6907),w=n(8693),_=n(916),T=n(5596),O=n(8679),M=n(4867),E="-1";e.SELECTION_ELEMENT_CLASSNAMES={SELECTION_RECTANGLE:"selection-rect",CONNECTION_POINT:"connection-point",ACTIVE:"active",CONTAINER_TARGET:"container-target",CONNECTION_TARGET:"connection-target",EXTENSION_LINE:"extension-line",CONNECTION_MARK:"connection-mark",SELECTION_MARK:"selection-mark",LOCKED_SELECTION_MARK:"locked-selection-mark",ITEMS_SELECTION_RECT:"items-selection-rect",CONNECTOR_MULTI_SELECTION:"connector-multi-selection",CONNECTOR_SELECTION:"connector-selection",CONNECTOR_POINT_MARK:"connector-point-mark",CONNECTOR_SELECTION_MASK:"connector-selection-mask",CONNECTOR_SIDE_MARK:"connector-side-mark",ITEM_SELECTION_RECT:"item-selection-rect",ITEM_MULTI_SELECTION:"item-multi-selection-rect"},e.ACTIVE_SELECTION_CSSCLASS="dxdi-active-selection";var D=function(t){function n(e,n,o,i,r){var s=t.call(this,n,i,r)||this;return s.readOnly=o,s.connectionPointElements=[],s.extensionLineElements=[],s.selectionMap={},s.parentContainer=e,s.initializeContainerElements(e),s}return i(n,t),n.prototype.initializeContainerElements=function(t){this.itemSelectionContainer=this.createAndChangePrimitiveElement(new s.GroupPrimitive([],null),t),this.visualizersContainer=this.createAndChangePrimitiveElement(new s.GroupPrimitive([],null),t),this.selectionMarksContainer=this.createAndChangePrimitiveElement(new s.GroupPrimitive([],null),t)},n.prototype.clear=function(){a.RenderUtils.removeContent(this.itemSelectionContainer),a.RenderUtils.removeContent(this.selectionMarksContainer),a.RenderUtils.removeContent(this.visualizersContainer),this.selectionRectElement=void 0,this.resizeInfoElement=void 0,this.connectionPointElements=[],this.connectionTargetElement=void 0,this.containerTargetElement=void 0,this.extensionLineElements=[],this.selectionMap={}},n.prototype.showSelectionRect=function(t){I.DomUtils.addClassName(this.parentContainer,e.ACTIVE_SELECTION_CSSCLASS);var n=new g.RectanglePrimitive(t.x,t.y,t.width,t.height,C.StrokeStyle.default1pxInstance,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_RECTANGLE),o=this.getSelectionRectElement(n);this.changePrimitiveElement(n,o)},n.prototype.hideSelectionRect=function(){I.DomUtils.removeClassName(this.parentContainer,e.ACTIVE_SELECTION_CSSCLASS),void 0!==this.selectionRectElement&&this.dom.changeByFunc(this.selectionRectElement,(function(t){return t.style.display="none"}))},n.prototype.getSelectionRectElement=function(t){return void 0!==this.selectionRectElement?this.dom.changeByFunc(this.selectionRectElement,(function(t){return t.style.display=""})):this.selectionRectElement=this.createPrimitiveElement(t,this.visualizersContainer),this.selectionRectElement},n.prototype.showResizeInfo=function(t,e){var o=new g.RectanglePrimitive(t.x,t.y,0,0,C.StrokeStyle.default1pxInstance),i=new s.GroupPrimitive([o,new v.TextPrimitive(t.x,t.y,e,x.TextOwner.Resize)],"resize-info"),r=this.getResizeInfoElement(i);this.changePrimitiveElement(i,r);var a=this.dom.measurer.measureTextLine(e,null,x.TextOwner.Resize).applyConverter(S.UnitConverter.pixelsToTwips);o.width=a.width+2*n.resizeInfoTextOffset,o.height=a.height+2*n.resizeInfoTextOffset,o.x=t.x-a.width/2-n.resizeInfoTextOffset,o.y=t.y-a.height/2-n.resizeInfoTextOffset,this.changePrimitiveElement(i,r)},n.prototype.hideResizeInfo=function(){void 0!==this.resizeInfoElement&&this.dom.changeByFunc(this.resizeInfoElement,(function(t){return t.style.display="none"}))},n.prototype.getResizeInfoElement=function(t){return void 0!==this.resizeInfoElement?this.dom.changeByFunc(this.resizeInfoElement,(function(t){return t.style.display=""})):this.resizeInfoElement=this.createPrimitiveElement(t,this.visualizersContainer),this.resizeInfoElement},n.prototype.getConnectionPointClassName=function(t,n){var o=e.SELECTION_ELEMENT_CLASSNAMES.CONNECTION_POINT;return t&&(o+=" "+e.SELECTION_ELEMENT_CLASSNAMES.ACTIVE),n||(o+=" "+w.NOT_VALID_CSSCLASS),o},n.prototype.showConnectionPoint=function(t,o,i,r,s,a){this.showConnectionPointCore(2*t,o.x,o.y,n.connectionPointLargeSize,n.connectionPointLargeSize,c.MouseEventElementType.ShapeConnectionPoint,i,r,e.SELECTION_ELEMENT_CLASSNAMES.CONNECTION_POINT+" selector"+(a?"":" "+w.NOT_VALID_CSSCLASS)),this.showConnectionPointCore(2*t+1,o.x,o.y,n.connectionPointSmallSize,n.connectionPointSmallSize,c.MouseEventElementType.ShapeConnectionPoint,i,r,this.getConnectionPointClassName(s,a))},n.prototype.showConnectionPointCore=function(t,e,n,o,i,r,s,c,u){var h=new P.EllipsePrimitive(e,n,o,i,null,u,(function(t){return a.RenderUtils.setElementEventData(t,r,s,c)})),p=this.getConnectionPointElement(h,t);this.changePrimitiveElement(h,p)},n.prototype.hideConnectionPoints=function(){for(var t=0;t1,r=t.getSelectedShapes(!0).filter((function(t){return e.selectionCanBeDrawn(t)})),s=t.getSelectedConnectors(!0).filter((function(t){return e.selectionCanBeDrawn(t)}));if(r.forEach((function(t){return e.getOrCreateShapeSelection(t,o).onSelectionChanged(i)})),s.forEach((function(t){return e.getOrCreateConnectorSelection(t,o).onSelectionChanged(i)})),i){var a=n.length>0?n[0].strokeWidth:0,c={};n.filter((function(t){return!t.isLocked})).forEach((function(t){return c[t.key]=t.rectangle})),this.getOrCreateMultipleSelection(o).onSelectionChanged(!!r.filter((function(t){return!t.isLocked})).length,a,c)}this.hideOutdatedSelection(o)},n.prototype.applyChangesCore=function(e){t.prototype.applyChangesCore.call(this,e);var n=this.getMultipleSelection();n&&n.onModelChanged()},n.prototype.applyChange=function(t){var e=this.getMultipleSelection();t.item instanceof d.Shape?this.updateShapeSelection(t.item,e):t.item instanceof f.Connector&&this.updateConnectorSelection(t.item,e)},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.clone().multiply(this.actualZoom,this.actualZoom))},n.prototype.notifySelectionRectHide=function(){this.hideSelectionRect()},n.prototype.notifyResizeInfoShow=function(t,e){this.showResizeInfo(t.clone().multiply(this.actualZoom,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.clone().multiply(r.actualZoom,r.actualZoom);if(i)switch(e.side){case u.ConnectionPointSide.North:a.y=i.y*r.actualZoom-n.connectionPointShift;break;case u.ConnectionPointSide.South:a.y=i.bottom*r.actualZoom+n.connectionPointShift;break;case u.ConnectionPointSide.West:a.x=i.x*r.actualZoom-n.connectionPointShift;break;case u.ConnectionPointSide.East:a.x=i.right*r.actualZoom+n.connectionPointShift}r.showConnectionPoint(s,a,t,s,s===o,e.allowed)}))},n.prototype.notifyConnectionPointsHide=function(){this.hideConnectionPoints()},n.prototype.notifyConnectionTargetShow=function(t,e){if(e.allowed){var o=n.correctSelectionRect(e.rect.clone().multiply(this.actualZoom,this.actualZoom),e.strokeWidth,n.connectionTargetBorderWidth,this.actualZoom,0);this.showConnectionTarget(0,o)}},n.prototype.notifyConnectionTargetHide=function(){this.hideConnectionTarget()},n.prototype.notifyContainerTargetShow=function(t,e){var o=n.correctSelectionRect(e.rect.clone().multiply(this.actualZoom,this.actualZoom),e.strokeWidth,n.connectionTargetBorderWidth,this.actualZoom,0);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.clone().multiply(e.actualZoom,e.actualZoom),t.segment.endPoint.clone().multiply(e.actualZoom,e.actualZoom),t.text)}))},n.prototype.notifyExtensionLinesHide=function(){this.hideExtensionLines()},n.prototype.notifyDragStart=function(t){this.dom.changeByFunc(this.selectionMarksContainer,(function(t){return t.style.display="none"}))},n.prototype.notifyDragEnd=function(t){this.dom.changeByFunc(this.selectionMarksContainer,(function(t){return t.style.display=""}))},n.prototype.notifyDragScrollStart=function(){},n.prototype.notifyDragScrollEnd=function(){},n.prototype.notifyTextInputStart=function(t,e,n,o){this.dom.changeByFunc(this.visualizersContainer,(function(t){return t.style.display="none"}))},n.prototype.notifyTextInputEnd=function(t,e){this.dom.changeByFunc(this.visualizersContainer,(function(t){return t.style.display=""}))},n.prototype.notifyTextInputPermissionsCheck=function(t,e){},n.correctSelectionRect=function(t,e,o,i,r){void 0===r&&(r=n.selectionOffset);var s=S.UnitConverter.twipsToPixels(e)%2!=S.UnitConverter.twipsToPixels(o)%2,a=Math.ceil(e/2*i);t=t.clone().inflate(a,a);var c=Math.floor(o/2);if(t.x-=c,t.y-=c,t.width+=o,t.height+=o,s){var u=n.evenOddSelectionCorrection*(S.UnitConverter.twipsToPixels(o)%2==1?-1:1);t=t.clone().moveRectangle(u,u)}return t.clone().inflate(r,r)},n.selectionMarkSize=S.UnitConverter.pixelsToTwips(10),n.lockedSelectionMarkSize=S.UnitConverter.pixelsToTwips(8),n.selectionOffset=S.UnitConverter.pixelsToTwips(2),n.selectionRectLineWidth=S.UnitConverter.pixelsToTwips(1),n.multiSelectionRectLineWidth=S.UnitConverter.pixelsToTwips(1),n.connectionPointSmallSize=S.UnitConverter.pixelsToTwips(5),n.connectionPointLargeSize=S.UnitConverter.pixelsToTwips(12),n.connectionPointShift=S.UnitConverter.pixelsToTwips(16),n.connectionTargetBorderWidth=S.UnitConverter.pixelsToTwips(2),n.geomertyMarkSize=S.UnitConverter.pixelsToTwips(8),n.connectorPointMarkSize=S.UnitConverter.pixelsToTwips(6),n.connectorSideMarkSize=S.UnitConverter.pixelsToTwips(6),n.extensionLineWidth=S.UnitConverter.pixelsToTwips(1),n.extensionLineOffset=S.UnitConverter.pixelsToTwips(1),n.extensionLineEndingSize=S.UnitConverter.pixelsToTwips(6),n.resizeInfoOffset=S.UnitConverter.pixelsToTwips(16),n.resizeInfoTextOffset=S.UnitConverter.pixelsToTwips(2),n.resizeInfoLineWidth=S.UnitConverter.pixelsToTwips(1),n.evenOddSelectionCorrection=S.UnitConverter.pixelsToTwips(1),n}(_.CanvasManager);e.CanvasSelectionManager=D;var A=function(){function t(t,e,n,o,i,r){this.rectsContainer=t,this.marksContainer=e,this.key=n,this.zoomLevel=o,this.readOnly=i,this.dom=r,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*D.selectionMarkSize,r=o&&t.width>3*D.selectionMarkSize,s=n||o;s&&this.drawSelectionMark(0,new p.Point(t.x,t.y),D.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_NW,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),r&&!b.Browser.TouchUI&&this.drawSelectionMark(1,new p.Point(t.x+t.width/2,t.y),D.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_N,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),s&&this.drawSelectionMark(2,new p.Point(t.right,t.y),D.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_NE,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),i&&!b.Browser.TouchUI&&this.drawSelectionMark(3,new p.Point(t.right,t.y+t.height/2),D.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),D.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_SE,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),r&&!b.Browser.TouchUI&&this.drawSelectionMark(5,new p.Point(t.x+t.width/2,t.bottom),D.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_S,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),s&&this.drawSelectionMark(6,new p.Point(t.x,t.bottom),D.selectionMarkSize,c.MouseEventElementType.ShapeResizeBox,c.ResizeEventSource.ResizeBox_SW,e.SELECTION_ELEMENT_CLASSNAMES.SELECTION_MARK),i&&!b.Browser.TouchUI&&this.drawSelectionMark(7,new p.Point(t.x,t.y+t.height/2),D.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 g.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 g.RectanglePrimitive(t.x,t.y,t.width,t.height,C.StrokeStyle.default1pxInstance,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((function(t){return n.appendChild(t)})),this.elements[t]=o),this.updatedElements[t]=!0,this.dom.changeByPrimitive(o,e),o},t}(),R=function(t){function e(e,n,o,i,r,s,a,c){var u=t.call(this,e,n,o,i,r,s)||this;return u.isLocked=a,u.rectangle=c,u}return i(e,t),e.prototype.onSelectionChanged=function(t){this.isMultipleSelection!==t&&(this.isMultipleSelection=t,this.redraw())},e.prototype.isLockedRender=function(){return this.isLocked&&!this.readOnly},e.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)},e}(A),L=function(t){function n(e,n,o,i,r){var s=t.call(this,e,n,"-1",o,i,r)||this;return s.rectangles={},s}return i(n,t),n.prototype.onModelItemChanged=function(t,e){t in this.rectangles&&(this.rectangles[t]=e)},n.prototype.onModelChanged=function(){this.redraw()},n.prototype.onSelectionChanged=function(t,e,n){this.needDrawSelectionMarks=t,this.strokeWidth=e,this.rectangles=n,this.redraw()},n.prototype.redrawCore=function(){var t=this,n=Object.keys(this.rectangles);if(n.length){var o=h.GeometryUtils.getCommonRectangle(n.map((function(e){return t.rectangles[e]}))).clone().multiply(this.zoomLevel,this.zoomLevel),i=D.correctSelectionRect(o,this.strokeWidth,D.selectionRectLineWidth,this.zoomLevel);this.drawSelectionRect(i,c.MouseEventElementType.SelectionRect,e.SELECTION_ELEMENT_CLASSNAMES.ITEMS_SELECTION_RECT),this.needDrawSelectionMarks&&this.drawSelectionMarks(o,!0,!0)}},n}(A),N=function(t){function n(e,n,o,i,r,s,a,c,u,h,p,l){var d=t.call(this,e,n,s,o,i,r,a,c)||this;return d.style=u,d.allowResizeHorizontally=h,d.allowResizeVertically=p,d.shapeParameterPoints=l,d}return i(n,t),n.prototype.onModelChanged=function(t,e,n,o,i,r){this.isLocked=t,this.rectangle=e,this.style=n,this.allowResizeHorizontally=o,this.allowResizeVertically=i,this.shapeParameterPoints=r,this.redraw()},n.prototype.redrawCore=function(){var t=this.rectangle.clone().multiply(this.zoomLevel,this.zoomLevel);this.isLockedRender()?this.drawLockedSelection(t):this.drawUnlockedSelection(t)},n.prototype.drawLockedSelection=function(t){this.drawLockedSelectionMark(0,new p.Point(t.x,t.y),D.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK),this.drawLockedSelectionMark(1,new p.Point(t.right,t.y),D.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK),this.drawLockedSelectionMark(2,new p.Point(t.right,t.bottom),D.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK),this.drawLockedSelectionMark(3,new p.Point(t.x,t.bottom),D.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK)},n.prototype.drawUnlockedSelection=function(t){var n=D.correctSelectionRect(t,this.style.strokeWidth,D.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.clone().multiply(t.zoomLevel,t.zoomLevel);t.drawShapeParameterPoint(o,n,e.key)}))},n.prototype.drawShapeParameterPoint=function(t,e,n){var o=this,i=D.geomertyMarkSize,r=new g.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}(R),z=function(t){function n(e,n,o,i,r,s,a,c,u,h,p,l,d,f,y){var g=t.call(this,e,n,s,o,i,r,a,c)||this;return g.renderPoints=u,g.style=h,g.styleText=p,g.enableText=l,g.texts=d,g.points=f,g.lineType=y,g}return i(n,t),n.prototype.onModelChanged=function(t,e,n,o,i,r,s,a,c){this.isLocked=t,this.rectangle=e,this.renderPoints=n,this.style=o,this.styleText=i,this.enableText=r,this.texts=s,this.points=a,this.lineType=c,this.redraw()},n.prototype.redrawCore=function(){this.isLockedRender()?this.drawLockedSelection():this.drawUnlockedSelection()},n.prototype.drawLockedSelection=function(){var t=this;this.renderPoints.forEach((function(n,o){t.drawLockedSelectionMark(o,n,D.lockedSelectionMarkSize,e.SELECTION_ELEMENT_CLASSNAMES.LOCKED_SELECTION_MARK)}))},n.prototype.drawUnlockedSelection=function(){this.drawConnectorSelection(),this.isMultipleSelection||this.readOnly||this.drawConnectorSelectionMarks()},n.prototype.drawConnectorSelection=function(){var t=[],n=[],o=this.isMultipleSelection?e.SELECTION_ELEMENT_CLASSNAMES.CONNECTOR_MULTI_SELECTION:e.SELECTION_ELEMENT_CLASSNAMES.CONNECTOR_SELECTION;this.populateSelectionPrimitiveCommands(t,n);var i=new m.PathPrimitive(t.concat(n.reverse()),C.StrokeStyle.default1pxInstance,o);this.getOrCreateElement("CS",i,this.rectsContainer)},n.prototype.populateSelectionPrimitiveCommands=function(t,e){for(var n,o,i,r,s=this.texts,a=this.styleText.getAlignment(),c=this.createNotSkippedRenderPoints(),u=this.zoomLevel,p=this.style.strokeWidthPx,l=this.getSelectionOffset(p),d=p%2==0,f=c[0],y=0,g=1,v=void 0;v=c[g];g++){var P=c[g+1];if(void 0===n){if(o=T.Metrics.euclideanDistance(f,v),O.MathUtils.numberCloseTo(o,0))continue;n=h.GeometryUtils.getSelectionOffsetPoint(f,v,o).multiply(l,l)}if(P){if(r=T.Metrics.euclideanDistance(v,P),O.MathUtils.numberCloseTo(r,0))continue;i=h.GeometryUtils.getSelectionOffsetPoint(v,P,r).multiply(l,l)}var C=n.x,S=n.y,x=-C,b=-S,I=i&&i.x,w=i&&i.y,_=i&&-i.x,M=i&&-i.y;for(d&&(x>0?x-=D.evenOddSelectionCorrection:C>0&&(C-=D.evenOddSelectionCorrection),b>0?b-=D.evenOddSelectionCorrection:S>0&&(S-=D.evenOddSelectionCorrection),_>0?_-=D.evenOddSelectionCorrection:I>0&&(I-=D.evenOddSelectionCorrection),M>0?M-=D.evenOddSelectionCorrection:w>0&&(w-=D.evenOddSelectionCorrection));s[y]&&s[y].pointIndex<=g;){var E=s[y],A=this.getConnectorSelectionTextSize(E.text,l),R=h.GeometryUtils.getSelectionTextStartEndPoints(f,v,o,E.point,A,a);s[y].pointIndexn}if(this.lineType===y.ConnectorLineOption.Orthogonal){var o=0===e.pointIndex,i=h.GeometryUtils.areDuplicatedPoints(this.points[this.points.length-1],t);if(o&&i)return T.Metrics.euclideanDistance(t,e)>2*f.Connector.minOffset;if(!o&&i||o&&!i)return T.Metrics.euclideanDistance(t,e)>f.Connector.minOffset;n=D.selectionMarkSize+D.connectorSideMarkSize;return T.Metrics.euclideanDistance(t,e)>n}return!1},n}(R)},9757:function(t,e,n){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])},o(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}),e.CanvasViewManager=e.CROP_OFFSET=e.CANVAS_SCROLL_PADDING=e.CANVAS_MIN_PADDING=void 0;var r=n(7716),s=n(240),a=n(8675),c=n(4125),u=n(6353),h=n(8900),p=n(5329),l=n(4593),d=n(4716),f=n(3500),y=n(3281),g=n(1552),m=n(6907),v=n(9291);e.CANVAS_MIN_PADDING=8,e.CANVAS_SCROLL_PADDING=18,e.CROP_OFFSET=40;var P="dxdi-drag-scroll",C="dxdi-drag-item",S=function(t){function n(e,n,o,i,r,s,u,p,l){var d=t.call(this,i,p,l)||this;return d.svgElement=n,d.paddings=new c.Offsets(0,0,0,0),d.scroll=new h.Point(0,0),d.crop=c.Offsets.empty(),d.lockAutoZoom=!1,d.autoScrollLocker=0,d.pageClipPathId=f.RenderUtils.generateSvgElementId("page-clip"),d.pageShadowId=f.RenderUtils.generateSvgElementId("page-shadow"),d.onViewChanged=new a.EventDispatcher,e.onScroll.add(d),o=o.clone().applyConverter(v.UnitConverter.twipsToPixelsF),d.scrollView=e,d.modelSize=o,d.simpleView=s,d.fixedZoomLevel=i,d.autoZoom=r,d.crop=d.rectangleToCrop(u,o),d.updateElements(o.clone().multiply(i,i),h.Point.zero(),s),d.getOrCreateElement("shadow",new y.ShadowFilterPrimitive(d.pageShadowId),d.svgElement),d.containerSize=e.getSize(),d}return i(n,t),n.prototype.adjust=function(t,e){var n;t||(t={vertical:!1,horizontal:!1},n=c.Offsets.empty()),this.containerSize=this.scrollView.getSize(),this.adjustCore(this.modelSize,this.fixedZoomLevel,this.autoZoom,this.simpleView,this.crop,t,this.containerSize,n,e),this.tryNormalizePaddings()},n.prototype.notifyModelSizeChanged=function(t,e){t=t.clone().applyConverter(v.UnitConverter.twipsToPixelsF);var n={horizontal:!e,vertical:!e};this.adjustCore(t,this.fixedZoomLevel,this.autoZoom,this.simpleView,this.crop,n,this.containerSize,e&&e.clone().applyConverter(v.UnitConverter.twipsToPixelsF)),this.modelSize=t},n.prototype.notifyModelRectangleChanged=function(t){var e=this.rectangleToCrop(t,this.modelSize);this.crop&&this.crop.equals(e)||(this.simpleView&&this.adjustCore(this.modelSize,this.fixedZoomLevel,this.autoZoom,this.simpleView,e,{horizontal:!1,vertical:!1},this.containerSize,c.Offsets.empty()),this.crop=e)},n.prototype.notifySnapPointPositionChanged=function(t){},n.prototype.notifyZoomChanged=function(t,e){this.adjustCore(this.modelSize,t,e,this.simpleView,this.crop,{horizontal:!1,vertical:!1},this.containerSize),this.fixedZoomLevel=t,this.autoZoom=e},n.prototype.notifyViewChanged=function(t){this.adjustCore(this.modelSize,this.fixedZoomLevel,this.autoZoom,t,this.crop,{vertical:!0,horizontal:!0},this.containerSize),this.simpleView=t},n.prototype.notifyGridChanged=function(t,e){},n.prototype.notifyDragStart=function(t){this.lockAutoZoom=!0,m.DomUtils.addClassName(this.svgElement,C)},n.prototype.notifyDragEnd=function(t){this.lockAutoZoom=!1,m.DomUtils.removeClassName(this.svgElement,C),this.adjustAfterDragEnd()},n.prototype.adjustAfterDragEnd=function(){this.autoZoom&&!this.autoZoomLocked&&this.adjust({horizontal:!0,vertical:this.autoZoom===s.AutoZoomMode.FitContent},this.autoZoom===s.AutoZoomMode.FitToWidth)},n.prototype.notifyShowContextToolbox=function(){this.autoZoomLocked=!0},n.prototype.notifyHideContextToolbox=function(){this.autoZoomLocked=!1,this.adjustAfterDragEnd()},n.prototype.notifyDragScrollStart=function(){m.DomUtils.addClassName(this.svgElement,P)},n.prototype.notifyDragScrollEnd=function(){m.DomUtils.removeClassName(this.svgElement,P)},n.prototype.notifyScrollChanged=function(t){this.scroll=t()},n.prototype.checkFitToCanvas=function(t){t=t||this.containerSize;var n=this.scrollView.getScrollBarWidth();t=t.clone().offset(2*-e.CANVAS_MIN_PADDING,2*-e.CANVAS_MIN_PADDING).nonNegativeSize();var o=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop).clone().multiply(this.actualZoom,this.actualZoom),i=this.checkScrollBars(t,n,o,c.Offsets.empty());return{vertical:(t=t.clone().offset(i.vertical?-n:0,i.horizontal?-n:0).nonNegativeSize()).height>=o.height,horizontal:t.width>=o.width}},n.prototype.rectangleToCrop=function(t,e){var n=t.clone().applyConverter(v.UnitConverter.twipsToPixelsF);return new c.Offsets(this.correctCrop(n.x),this.correctCrop(e.width-n.right),this.correctCrop(n.y),this.correctCrop(e.height-n.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.raiseActualZoomChanged())},n.prototype.getActualAutoZoomLevel=function(t){if(t===s.AutoZoomMode.Disabled)return this.actualZoom;var e=this.containerSize,n=this.scrollView.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 0===t.width||0===t.height?1: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.raiseActualZoomChanged=function(){var t=this;this.onViewChanged.raise1((function(e){return e.notifyActualZoomChanged(t.actualZoom)}))},n.prototype.tryNormalizePaddings=function(){var t=this.scrollView.getScrollBarWidth(),e=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop).clone().multiply(this.actualZoom,this.actualZoom),n=new h.Point(this.paddings.left,this.paddings.top),o=new u.Size(this.paddings.right,this.paddings.bottom),i=this.getTailSpace(n,this.scroll,e,this.containerSize,t);i.equals(o)||this.applyChanges(new c.Offsets(n.x,i.width,n.y,i.height),e,this.simpleView,this.crop.clone().multiply(this.actualZoom))},n.prototype.scrollBy=function(t){var e,n,o,i=this.scroll,r=this.containerSize,s=this.scrollView.getScrollBarWidth(),a=this.getActualModelSizeWithoutZoom(this.modelSize,this.simpleView,this.crop).clone().multiply(this.actualZoom,this.actualZoom),p=this.checkScrollBars(r,s,a,this.paddings),l=new h.Point(this.paddings.left,this.paddings.top),d=new u.Size(this.paddings.right,this.paddings.bottom);return i=(e=this.changeScrollByOffset(l,i,d,a,t,r,p)).scroll,t=e.offset,l=(n=this.changeTranslateByOffset(l,d,t,p)).translate,t=n.offset,l=(o=this.cropHiddenHead(l,i)).translate,i=o.scroll,d=this.getTailSpace(l,i,a,r,s),this.applyChanges(new c.Offsets(l.x,d.width,l.y,d.height),a,this.simpleView,this.crop.clone().multiply(this.actualZoom),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.scrollView.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.clone().offset(-n.horizontal,-n.vertical).nonNegativeSize():t},n.prototype.setScrollTo=function(t,n){var o=this.containerSize,i=this.getVisibileAreaAbsShift(),r=t.clone().applyConverter(v.UnitConverter.twipsToPixelsF).clone().multiply(this.actualZoom,this.actualZoom).clone().offset(i.x,i.y),s=this.scroll;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)),this.setScroll(s)},n.prototype.scrollIntoView=function(t){t=t.clone().applyConverter(v.UnitConverter.twipsToPixelsF).multiply(this.actualZoom,this.actualZoom).moveRectangle(this.paddings.left,this.paddings.top);var n=this.scroll,o=this.containerSize;if(!(t.x>=n.x&&t.y>=n.y&&t.right<=n.x+o.width&&t.bottom<=n.y+o.height)){var i=n.clone();t.xn.x+o.width&&(i.x=Math.min(t.x-e.CANVAS_SCROLL_PADDING,t.right+e.CANVAS_SCROLL_PADDING-o.width)),t.yv&&(y.x=v,g.x=0),s.right<0&&m.width>v&&(m.width=v,g.x>d.width&&(g.x=d.width)),s.top<0&&y.y>P&&(y.y=P,g.y=0),s.bottom<0&&m.height>P&&(m.height=P,g.y>d.height&&(g.y=d.height))}var C=new c.Offsets(y.x,m.width,y.y,m.height);this.applyChanges(C,d,i,f,g)},n.prototype.applyChanges=function(t,e,n,o,i){var r=this,s=new h.Point(t.left,t.top);n&&o&&(s=s.clone().offset(-o.left,-o.top)),this.updateElements(e,s,n),this.setSvgSize(e.width+t.horizontal,e.height+t.vertical),this.onViewChanged.raise1((function(t){return t.notifyViewAdjusted(new h.Point(s.x,s.y))})),i&&(this.lockAutoScroll(),i&&this.dom.changeByFunc(this.scrollView,(function(t){t.setScroll(i.x,i.y),r.unlockAutoScroll()})),this.scroll=i),this.paddings=t},n.prototype.isAutoScrollLocked=function(){return 0!==this.autoScrollLocker},n.prototype.lockAutoScroll=function(){this.autoScrollLocker++},n.prototype.unlockAutoScroll=function(){this.autoScrollLocker--},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(),a=n.clone(),h=Math.max(i.width+a.x-(s.x+o.width),e.CANVAS_MIN_PADDING),p=Math.max(i.height+a.y-(s.y+o.height),e.CANVAS_MIN_PADDING),l=this.checkScrollBars(i,r,o,new c.Offsets(s.x,h,s.y,p));return l.vertical&&(h=Math.max(e.CANVAS_MIN_PADDING,h-r)),l.horizontal&&(p=Math.max(e.CANVAS_MIN_PADDING,p-r)),new u.Size(h,p)},n.prototype.getActualOffset=function(t,e,n){return new c.Offsets(-(e.left-t.left)+n.left,-(e.right-t.right)+n.right,-(e.top-t.top)+n.top,-(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.clone().applyConverter(v.UnitConverter.pixelsToTwips)},n.prototype.getAbsolutePoint=function(t,e,n){var o=this.getVisibileAreaAbsShift(e),i=t.clone().multiply(this.actualZoom,this.actualZoom).clone().applyConverter(v.UnitConverter.twipsToPixelsF).clone().offset(o.x,o.y);if(n){if(i.x<0||i.y<0)return null;var r=this.containerSize;if(i.x>r.width||i.y>r.height)return null}return i},n}(r.CanvasManagerBase);e.CanvasViewManager=S},6078:function(t,e,n){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])},o(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}),e.ExportDOMManipulator=e.DOMManipulator=void 0;var r=n(9463),s=function(){function t(t){this.measurer=t,this.queue=[]}return t.prototype.createElement=function(t,e,n){return t.createElement((function(t){null!=e&&(void 0!==n?e.insertBefore(t,n):e.appendChild(t))}))},t.prototype.changeChildrenByPrimitives=function(t,e){var n=this;t.forEach((function(t,o){var i=e.childNodes[o];n.changeByPrimitive(i,t)}))},t.prototype.changeByFunc=function(t,e){this.doChange(t,e)},t.prototype.changeByPrimitive=function(t,e){this.doChange(t,e)},t.prototype.cancelAnimation=function(){void 0!==this.rafId&&(cancelAnimationFrame(this.rafId),this.queue=[])},t.prototype.doChange=function(t,e){r.Diagnostics.optimizeUsingRAF?(this.queue.push([t,e]),this.requestAnimation()):this.doChangeSync(t,e)},t.prototype.doChangeSync=function(t,e){"function"==typeof e?e(t):e.applyElementProperties(t,this.measurer)},t.prototype.requestAnimation=function(){var t=this;if(!this.rafRequested){this.rafRequested=!0;var e=function(){t.queue.splice(0,2e3).forEach((function(e){return t.doChangeSync(e[0],e[1])})),t.queue.length?t.rafId=requestAnimationFrame(e):(t.rafRequested=!1,t.rafId=void 0)};this.rafId=requestAnimationFrame(e)}},t}();e.DOMManipulator=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.doChange=function(t,e){this.doChangeSync(t,e)},e}(s);e.ExportDOMManipulator=a},741:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InputManager=void 0;var o=n(2153),i=n(6907),r=n(3500),s=n(6031),a=n(5503),c=n(7959),u=n(3714),h=n(4246),p=n(9279),l=n(9291),d=n(1114),f=n(3490),y=n(8675),g="dxdi-text-input",m=function(){function t(t,e,n,o,i,r){this.mainElement=t,this.layoutPointResolver=e,this.eventManager=n,this.textMeasurer=o,this.actualZoom=i,this.focusElementsParent=r,this.focused=!1,this.focusLocked=!1,this.createInputElements(this.mainElement,this.focusElementsParent)}return t.prototype.detachEvents=function(){this.detachInputElementEvents(),this.detachTextInputElementEvents()},t.prototype.isFocused=function(){return this.focused},t.prototype.captureFocus=function(t){t&&document.activeElement===this.textInputElement?y.HtmlFocusUtils.focusWithPreventScroll(this.textInputElement||this.inputElement):y.HtmlFocusUtils.focusWithPreventScroll(this.inputElement)},t.prototype.clear=function(){this.setInputElementFocusHandlerMode(!1)},t.prototype.setClipboardData=function(t){this.clipboardInputElement.value=t,y.HtmlFocusUtils.focusWithPreventScroll(this.clipboardInputElement),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()})):p.Browser.IE&&(this.clipboardInputElement.value="",y.HtmlFocusUtils.focusWithPreventScroll(this.clipboardInputElement),this.clipboardInputElement.select(),document.execCommand("Paste"),t(this.clipboardInputElement.value),this.captureFocus())},t.prototype.isPasteSupportedByBrowser=function(){return p.Browser.IE||p.Browser.WebKitFamily&&navigator&&void 0!==navigator.clipboard},t.prototype.createInputElements=function(t,e){this.createFocusInputElement(e||t),this.createTextInputElement(t),this.createClipboardInputElement(e||t),this.attachInputElementEvents()},t.prototype.setInputElementFocusHandlerMode=function(t){this.textInputElementContainer.setAttribute("class","dxdi-text-input-container"),t&&this.captureFocus()},t.prototype.setInputElementTextInputMode=function(t,e,n,o,i,r){this.textInputElementContainer.setAttribute("class","dxdi-text-input-container "+i),this.textInputElement.value=t,this.setTextInputElementBounds(e,n,r),this.setTextInputElementStyle(o),this.updateTextInputPadding();var s=this.textInputElement||this.inputElement;y.HtmlFocusUtils.focusWithPreventScroll(s),s.select&&s.select()},t.prototype.setTextInputElementBounds=function(t,e,n){this.savedTextInputPosition=t,this.savedTextInputSize=e,this.savedTextInputAngle=n;var o=this.layoutPointResolver.getAbsolutePoint(t,!0);this.textInputElementContainer.style.left=o.x+"px",this.textInputElementContainer.style.top=o.y+"px",this.textInputElementContainer.style.width=e&&e.width+"px"||"0px",this.textInputElementContainer.style.height=e&&e.height+"px"||"0px";var i=[];this.textInputElementContainer.style.transform="",1!==this.actualZoom&&i.push("scale("+this.actualZoom+")"),n&&i.push("rotate("+n+"deg)"),this.textInputElementContainer.style.transform=i.join(" "),this.textInputElement.style.width=e&&e.width+"px"||"",this.textInputElement.style.height=e&&e.height+"px"||"auto"},t.prototype.setTextInputElementStyle=function(t){this.savedTextInputStyle=t,r.RenderUtils.applyStyleToElement(t,this.textInputElement)},t.prototype.createFocusInputElement=function(t){this.inputElement=document.createElement("textarea"),this.inputElement.readOnly=p.Browser.TouchUI,this.inputElement.setAttribute("class","dxdi-focus-input"),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.onInputKeyPressHandler=this.onInputKeyPress.bind(this),this.onInputKeyUpHandler=this.onInputKeyUp.bind(this),this.onPasteHandler=this.onPaste.bind(this),d.RenderHelper.addEventListener(this.inputElement,"blur",this.onInputBlurHandler),d.RenderHelper.addEventListener(this.inputElement,"focus",this.onInputFocusHandler),d.RenderHelper.addEventListener(this.inputElement,"keydown",this.onInputKeyDownHandler),d.RenderHelper.addEventListener(this.inputElement,"keypress",this.onInputKeyPressHandler),d.RenderHelper.addEventListener(this.inputElement,"keyup",this.onInputKeyUpHandler),d.RenderHelper.addEventListener(this.inputElement,"paste",this.onPasteHandler)},t.prototype.detachInputElementEvents=function(){d.RenderHelper.removeEventListener(this.inputElement,"blur",this.onInputBlurHandler),d.RenderHelper.removeEventListener(this.inputElement,"focus",this.onInputFocusHandler),d.RenderHelper.removeEventListener(this.inputElement,"keydown",this.onInputKeyDownHandler),d.RenderHelper.removeEventListener(this.inputElement,"keypress",this.onInputKeyPressHandler),d.RenderHelper.removeEventListener(this.inputElement,"keyup",this.onInputKeyUpHandler),d.RenderHelper.removeEventListener(this.inputElement,"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("textarea"),this.textInputElement.setAttribute("class",g),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.onTextInputMouseWheelHandler=this.onTextInputMouseWheel.bind(this),this.onTextInputMouseUpHandler=this.onTextInputMouseUp.bind(this),this.onTextInputKeyUpHandler=this.onTextInputKeyUp.bind(this),this.onTextInputChangeHandler=this.onTextInputChange.bind(this),d.RenderHelper.addEventListener(this.textInputElement,"mousewheel",this.onTextInputMouseWheelHandler),d.RenderHelper.addEventListener(this.textInputElement,"mouseup",this.onTextInputMouseUpHandler),d.RenderHelper.addEventListener(this.textInputElement,"blur",this.onTextInputBlurHandler),d.RenderHelper.addEventListener(this.textInputElement,"focus",this.onTextInputFocusHandler),d.RenderHelper.addEventListener(this.textInputElement,"keydown",this.onTextInputKeyDownHandler),d.RenderHelper.addEventListener(this.textInputElement,"keyup",this.onTextInputKeyUpHandler),d.RenderHelper.addEventListener(this.textInputElement,"change",this.onTextInputChangeHandler)},t.prototype.detachTextInputElementEvents=function(){d.RenderHelper.removeEventListener(this.textInputElement,"mousewheel",this.onTextInputMouseWheelHandler),d.RenderHelper.removeEventListener(this.textInputElement,"mouseup",this.onTextInputMouseUpHandler),d.RenderHelper.removeEventListener(this.textInputElement,"blur",this.onTextInputBlurHandler),d.RenderHelper.removeEventListener(this.textInputElement,"focus",this.onTextInputFocusHandler),d.RenderHelper.removeEventListener(this.textInputElement,"keydown",this.onTextInputKeyDownHandler),d.RenderHelper.removeEventListener(this.textInputElement,"keyup",this.onTextInputKeyUpHandler),d.RenderHelper.removeEventListener(this.textInputElement,"change",this.onTextInputChangeHandler)},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,i.DomUtils.removeClassName(this.mainElement,"focused"))},t.prototype.focusControl=function(){this.focused=!0,this.focusLocked=!1,i.DomUtils.addClassName(this.mainElement,"focused")},t.prototype.updateTextInputPadding=function(){var t=this.textInputElement.value;if(this.savedTextInputSize){n=this.textMeasurer.measureWords(t,this.savedTextInputStyle,h.TextOwner.Shape),o=f.getTextHeight(t,this.savedTextInputSize.width,n,!0);var e=Math.max(0,.5*(this.savedTextInputSize.height-o));this.textInputElement.style.paddingTop=Math.ceil(e)+"px",this.textInputElement.style.height=Math.floor(this.savedTextInputSize.height)+"px"}else{var n=this.textMeasurer.measureWords(" ",this.savedTextInputStyle,h.TextOwner.Connector),o=f.getLineHeight(n)*((f.textToParagraphs(t).length||1)+1);this.textInputElement.style.height=Math.ceil(o)+"px"}},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.onInputKeyPress=function(t){!t.preventDefault||p.Browser.Safari&&"KeyV"===t.code||t.preventDefault()},t.prototype.onInputKeyUp=function(t){var e=this;r.raiseEvent(t,this.getDiagramKeyboardEvent(t),(function(t){return e.eventManager.onKeyUp(t)}))},t.prototype.onTextInputBlur=function(t){var e=this;if(this.eventManager.canFinishTextEditing())this.blurControl(),r.raiseEvent(t,this.getDiagramFocusEvent(t),(function(t){return e.eventManager.onTextInputBlur(t)}));else{var n=u.EvtUtils.getEventSource(t);document.activeElement!==n&&n.focus()}},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.onTextInputKeyUp=function(t){this.updateTextInputPadding()},t.prototype.onTextInputChange=function(t){this.updateTextInputPadding()},t.prototype.onPaste=function(t){var e=this;r.raiseEvent(t,this.getDiagramClipboardEvent(t),(function(t){return e.eventManager.onPaste(t)}))},t.prototype.onTextInputMouseWheel=function(t){this.mouseWheelHandler&&this.mouseWheelHandler(t)},t.prototype.onTextInputMouseUp=function(t){t.stopPropagation&&t.stopPropagation(),u.EvtUtils.cancelBubble(t)},t.prototype.getDiagramKeyboardEvent=function(t){return new s.DiagramKeyboardEvent(o.KeyUtils.getKeyModifiers(t),o.KeyUtils.getEventKeyCode(t),this.textInputElement.value)},t.prototype.getTextInputElementValue=function(){return this.textInputElement.value},t.prototype.getDiagramFocusEvent=function(t){return new s.DiagramFocusEvent(t.target.value)},t.prototype.getDiagramClipboardEvent=function(t){var e,n=t.clipboardData||t.originalEvent&&t.originalEvent.clipboardData;return e=void 0!==n?n.getData("text/plain"):window.clipboardData.getData("Text"),new s.DiagramClipboardEvent(e)},t.prototype.isTextInputElement=function(t){return"string"==typeof t.className&&t.className.indexOf(g)>-1},t.prototype.lockFocus=function(){var t=this;this.focusLocked=!0,setTimeout((function(){return t.focusLocked=!1}),10)},t.prototype.notifyViewAdjusted=function(t){},t.prototype.notifyActualZoomChanged=function(t){this.actualZoom=t,this.savedTextInputPosition&&this.savedTextInputSize&&this.setTextInputElementBounds(this.savedTextInputPosition,this.savedTextInputSize,this.savedTextInputAngle)},t.prototype.notifyTextInputStart=function(t,e,n,o){var i,r="";t instanceof a.Shape?(r="shape-text",i=t.textAngle):t instanceof c.Connector&&(r="connector-text"),o=o&&o.clone().applyConverter(l.UnitConverter.twipsToPixels),this.setInputElementTextInputMode(e,n,o,t.styleText,r,i)},t.prototype.notifyTextInputEnd=function(t,e){this.setInputElementFocusHandlerMode(e)},t.prototype.notifyTextInputPermissionsCheck=function(t,e){},t}();e.InputManager=m},4246:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextOwner=void 0,function(t){t[t.Shape=0]="Shape",t[t.Connector=1]="Connector",t[t.ExtensionLine=2]="ExtensionLine",t[t.Resize=3]="Resize"}(e.TextOwner||(e.TextOwner={}))},1733:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextMeasurer=void 0;var o=n(6353),i=n(3500),r=n(5503),s=n(7959),a=n(4246),c=n(1114),u=n(3490),h=function(){function t(t){this.cache={},this.fontSizeCache={},this.containers={},this.parent=t,this.createNodes()}return t.prototype.measureWords=function(t,e,n){var o=this,i={words:{},fontSize:-1},r="string"==typeof t?this.splitToWords(t,!1):t.reduce((function(t,e){return t.concat(o.splitToWords(e,!1))}),[]);r.push(" ");var s=this.getStyleHash(e,n),a=this.tryLoadWordsToMeasurer(r,e,s,n,void 0,void 0,void 0,void 0,i);if(a){var c=this.containers[n];this.putElementsInDOM(c,a),this.beforeMeasureInDOM(),this.measureElementsInDOM(a,i),this.afterMeasureInDOM()}return i},t.prototype.measureTextLine=function(t,e,n){var o=this.measureWords(t,e,n);return u.getTextLineSize(t,o)},t.prototype.onNewModel=function(t,e){var n=this;e.changeByFunc(null,(function(){return n.onNewModelCore(t)}))},t.prototype.onNewModelCore=function(t){var e=t.filter((function(t){return t instanceof r.Shape})),n=t.filter((function(t){return t instanceof s.Connector})),o=this.tryLoadShapeTexts(e),i=this.tryLoadConnectorTexts(n);(o||i)&&(o&&this.putElementsInDOM(this.containers[a.TextOwner.Shape],o),i&&this.putElementsInDOM(this.containers[a.TextOwner.Connector],i),this.beforeMeasureInDOM(),o&&this.measureElementsInDOM(o),i&&this.measureElementsInDOM(i),this.afterMeasureInDOM())},t.prototype.replaceParent=function(t){this.parent!==t&&(this.mainElement.parentNode&&t.appendChild(this.mainElement),this.parent=t)},t.prototype.clean=function(){i.RenderUtils.removeElement(this.mainElement)},t.prototype.tryLoadShapeTexts=function(t){var e=this,n={},o=[],i=[],r=[];return t.forEach((function(t){var s=e.getStyleHash(t.styleText,a.TextOwner.Shape);e.tryLoadWordsToMeasurer(e.splitToWords(t.text,!0),t.styleText,s,a.TextOwner.Shape,n,o,i,r)})),o.length?{elements:o,hashes:i,styleHashes:r}:null},t.prototype.tryLoadConnectorTexts=function(t){var e=this,n={},o=[],i=[],r=[];return t.forEach((function(t){var s=t.texts.map((function(t){return t.value})).reduce((function(t,n){return t.concat(e.splitToWords(n,!1))}),[]);if(s.length){s.push(" ");var c=e.getStyleHash(t.styleText,a.TextOwner.Connector);e.tryLoadWordsToMeasurer(s,t.styleText,c,a.TextOwner.Connector,n,o,i,r)}})),o.length?{elements:o,hashes:i,styleHashes:r}:null},t.prototype.tryLoadWordsToMeasurer=function(t,e,n,o,i,r,s,a,c){var u=this,h=[];return r=r||[],s=s||[],a=a||[],i=i||{},t.forEach((function(t){return u.tryLoadWordToMeasurer(t,e,n,o,i,r,s,a,h,c)})),r.length?{elements:r,hashes:s,styleHashes:a,newWords:h}:null},t.prototype.putElementsInDOM=function(t,e){for(t.parentNode&&t.parentNode.removeChild(t);t.firstChild;)t.removeChild(t.firstChild);e.elements.forEach((function(e){return t.appendChild(e)})),this.svgElement.appendChild(t)},t.prototype.measureElementsInDOM=function(t,e){for(var n=t.hashes,o=t.elements,i=t.newWords,r=n.length,s=0;s{Object.defineProperty(e,"__esModule",{value:!0}),e.PrimitiveObject=void 0;var o=n(9291),i=function(){function t(t){this.style=t}return Object.defineProperty(t.prototype,"strokeWidthPx",{get:function(){return this.style?this.style.strokeWidthPx:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"strokeOffset",{get:function(){return this.style?this.style.strokeOffset:0},enumerable:!1,configurable:!0}),t.prototype.getUnitVaue=function(t){return"number"==typeof t?o.UnitConverter.twipsToPixels(t).toString():t},t.prototype.setUnitAttribute=function(t,e,n){null!=n&&t.setAttribute(e,this.getUnitVaue(n))},t.prototype.setPositionCorrectionAttribute=function(t){var e=this.strokeWidthPx%2==1?"translate("+this.strokeOffset+", "+this.strokeOffset+")":"";t.setAttribute("transform",e)},t}();e.PrimitiveObject=i},4716:function(t,e,n){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])},o(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}),e.RectanglePrimitive=void 0;var r=n(1114),s=function(t){function e(e,n,o,i,r,s,a,c){var u=t.call(this,r,s,a,c)||this;return u.x=e,u.y=n,u.width=o,u.height=i,u}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"rect")},e.prototype.applyElementProperties=function(e,n){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),this.setPositionCorrectionAttribute(e),t.prototype.applyElementProperties.call(this,e,n)},e}(n(4178).SvgPrimitive);e.RectanglePrimitive=s},4538:function(t,e,n){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])},o(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}),e.RoundedRectanglePrimitive=void 0;var r=n(1114),s=function(t){function e(e,n,o,i,r,s,a,c,u,h){void 0===r&&(r=0),void 0===s&&(s=0);var p=t.call(this,e,n,o,i,a,c,u,h)||this;return p.x=e,p.y=n,p.width=o,p.height=i,p.rx=r,p.ry=s,p}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"rect")},e.prototype.applyElementProperties=function(e,n){this.setUnitAttribute(e,"rx",this.rx),this.setUnitAttribute(e,"ry",this.ry),t.prototype.applyElementProperties.call(this,e,n)},e}(n(4716).RectanglePrimitive);e.RoundedRectanglePrimitive=s},3281:function(t,e,n){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])},o(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}),e.ShadowFilterPrimitive=void 0;var r=n(4628),s=n(1114),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},1248:function(t,e,n){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])},o(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}),e.SvgElementPrimitive=void 0;var r=n(1114),s=function(t){function e(e,n,o,i,r,s,a,c,u){var h=t.call(this,null,c,void 0,u)||this;return h.x=e,h.y=n,h.width=o,h.height=i,h.createContent=r,h.destroyContent=s,h.data=a,h}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(r.svgNS,"svg")},e.prototype.applyElementProperties=function(e,n){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.setUnitAttribute(e,"width",this.width),this.setUnitAttribute(e,"height",this.height),this.setPositionCorrectionAttribute(e),t.prototype.applyElementProperties.call(this,e,n)},e.prototype.createCustomContent=function(t){this.createContent&&this.createContent(t,this.data)},e.prototype.destroyCustomContent=function(t){this.destroyContent&&this.destroyContent(t)},e}(n(4178).SvgPrimitive);e.SvgElementPrimitive=s},3360:function(t,e,n){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])},o(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}),e.TextFloodFilterPrimitive=e.TextFilterPrimitive=void 0;var r=n(1114),s=n(4628),a=n(6613),c=n(13),u=function(t){function e(e,n,o,i,r){void 0===n&&(n="-0.05"),void 0===o&&(o="-0.05"),void 0===i&&(i="1.1"),void 0===r&&(r="1.1");var s=t.call(this,e,n,o,i,r)||this;return s.id=e,s.x=n,s.y=o,s.width=i,s.height=r,s}return i(e,t),e.prototype.createChildElements=function(t){var e=document.createElementNS(r.svgNS,"feFlood");t.appendChild(e);var n=document.createElementNS(r.svgNS,"feComposite");n.setAttribute("in","SourceGraphic"),n.setAttribute("operator","atop"),t.appendChild(n)},e}(s.FilterPrimitive);e.TextFilterPrimitive=u;var h=function(t){function e(e,n,o,i,r,s){void 0===o&&(o="-0.05"),void 0===i&&(i="-0.05"),void 0===r&&(r="1.1"),void 0===s&&(s="1.1");var a=t.call(this,e,o,i,r,s)||this;return a.id=e,a.floodColor=n,a.x=o,a.y=i,a.width=r,a.height=s,a}return i(e,t),e.prototype.applyChildrenProperties=function(t){for(var e=void 0,n=0;e=t.childNodes[n];n++)if(e.nodeName&&"FEFLOOD"===e.nodeName.toUpperCase()){this.prepareFEFloodNode(e);break}},e.prototype.prepareFEFloodNode=function(t){var e=c.ColorUtils.colorToHash(this.floodColor);t.setAttribute("flood-color",e),t.setAttribute("class","text-filter-flood"),this.floodColor!==a.DiagramModel.defaultPageColor?t.style.setProperty("flood-color",e):t.style.setProperty("flood-color","")},e}(u);e.TextFloodFilterPrimitive=h},9416:function(t,e,n){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])},o(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}),e.TextPrimitive270degRenderHelper=e.TextPrimitive180degRenderHelper=e.TextPrimitive90degRenderHelper=e.TextPrimitiveRenderHelper=e.TextPrimitive=e.TextAngle=void 0;var r,s=n(9291),a=n(1114),c=n(4178),u=n(3500),h=n(3490);!function(t){t[t.Angle0deg=0]="Angle0deg",t[t.Angle90deg=90]="Angle90deg",t[t.Angle180deg=180]="Angle180deg",t[t.Angle270deg=270]="Angle270deg"}(r=e.TextAngle||(e.TextAngle={}));var p=function(t){function e(e,n,o,i,r,s,a,c,u,p,l,d,f){var y=t.call(this,c,"",p,f)||this;return y.x=e,y.y=n,y.text=o,y.owner=i,y.textWidth=r,y.textHeight=s,y.textSpacing=a,y.reverseTextAhchor=u,y.angle=d,y.filterId=l,y.textSegmens=h.textToParagraphs(y.text),y.renderHelper=y.createRenderHelper(),void 0!==y.textWidth&&void 0!==y.textWidth&&(y.x=y.renderHelper.getTextX(y.x),y.y=y.renderHelper.getTextY(y.y)),y}return i(e,t),e.prototype.createMainElement=function(){return document.createElementNS(a.svgNS,"text")},e.prototype.applyElementProperties=function(e,n){this.setUnitAttribute(e,"x",this.x),this.setUnitAttribute(e,"y",this.y),this.filterId&&e.setAttribute("filter",u.RenderUtils.getUrlPathById(this.filterId)),t.prototype.applyElementProperties.call(this,e,n),e.getAttribute("appliedText")!==this.text||e.getAttribute("appliedSize")!==(this.fitToSize&&this.fitToSize.toString())?(this.createTSpanElements(e,n),e.setAttribute("appliedText",this.text),e.setAttribute("appliedSize",this.fitToSize&&this.fitToSize.toString())):this.prepareTSpanElements(e),this.renderHelper.prepareMainElement(e,this.x,this.y)},e.prototype.createTSpanElements=function(t,e){var n=this;u.RenderUtils.removeContent(t),this.textSegmens.forEach((function(o,i){if(!o&&n.textSegmens.length>1)n.createTSpanElement(t).textContent=" ";else if(n.fitToSize){var r=h.textToWords(o),a=h.wordsByLines(s.UnitConverter.twipsToPixels(n.fitToSize),r,(function(){return e.measureWords(r,n.style,n.owner)}));if(a.forEach((function(e){n.createTSpanElement(t).textContent=e})),!a.length)n.createTSpanElement(t).textContent=" "}else{n.createTSpanElement(t).textContent=o}}));var o=t.firstChild;o&&this.prepareFirstTSpanElement(o,t.childNodes.length)},e.prototype.createTSpanElement=function(t){var e=document.createElementNS(a.svgNS,"tspan");return t.appendChild(e),this.prepareTSpanElement(e),e},e.prototype.prepareTSpanElements=function(t){for(var e=0;e{Object.defineProperty(e,"__esModule",{value:!0}),e.RenderHelper=e.svgNS=void 0;var o=n(9463);e.svgNS="http://www.w3.org/2000/svg";var i=function(){function t(){}return t.createSvgElement=function(t,n){void 0===n&&(n=!1);var o=document.createElementNS(e.svgNS,"svg");return o.className.baseVal="dxdi-canvas"+(n?" export":""),t&&t.appendChild(o),o},t.createMainElement=function(t,e){void 0===e&&(e=!1);var n=document.createElement("div");return n.setAttribute("class","dxdi-control"+(e?" measurer":"")),o.Diagnostics.optimizeLayers&&(n.style.transform="translateZ(0)"),t&&t.appendChild(n),n},t.addEventListener=function(t,e,n){t.addEventListener(e,n)},t.removeEventListener=function(t,e,n){t.removeEventListener(e,n)},t}();e.RenderHelper=i},8098:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RenderManager=e.DBL_CLICK_TIMEOUT=e.LONG_TOUCH_TIMEOUT=void 0;var o=n(6031),i=n(3714),r=n(6907),s=n(8900),a=n(2153),c=n(9279),u=n(3500),h=n(8693),p=n(7376),l=n(240),d=n(741),f=n(6043),y=n(9757),g=n(4e3),m=n(6557),v=n(1733),P=n(1114),C=n(6078),S=n(8675),x="dxdi-touch-action";e.LONG_TOUCH_TIMEOUT=500,e.DBL_CLICK_TIMEOUT=500;var b=function(){function t(t,e,n,o,i,r,s){this.moveLocked=!1,this.lockMouseMoveTimer=-1,this.lastClickElement=void 0,this.longTouchTimer=void 0,this.dblTouchTimer=void 0,this.pointers={};var a=P.RenderHelper.createMainElement(t),c=P.RenderHelper.createSvgElement(a);this.instanceId=i,this.scroll=r||new p.NativeScrollView(t),this.measurer=n,this.dom=new C.DOMManipulator(this.measurer),this.view=new y.CanvasViewManager(this.scroll,c,o.modelSize,o.zoomLevel,o.autoZoom,o.simpleView,o.rectangle,this.dom,this.instanceId),this.input=new d.InputManager(a,this.view,e,this.measurer,o.zoomLevel,s),this.items=new h.CanvasItemsManager(this.view.canvasElement,o.zoomLevel,this.dom,this.instanceId),this.page=new f.CanvasPageManager(this.view.pageElement,o,this.dom,this.instanceId),this.selection=new g.CanvasSelectionManager(this.view.canvasElement,o.zoomLevel,o.readOnly,this.dom,this.instanceId),this.contextMenuEnabled=o.contextMenuEnabled,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.autoScroll=new m.AutoScrollController(this.scroll,c,this.view,this.dom),this.attachEvents(c),this.mainElement=a,this.svgElement=c,this.events=e,this.notifyReadOnlyChanged(o.readOnly)}return t.prototype.clean=function(t){this.killLockMouseMoveTimer(),this.clearLastMouseDownEvent(),this.detachEvents(this.svgElement),this.scroll.detachEvents(),this.input.detachEvents(),this.dom.cancelAnimation(),t&&t(this.mainElement)},t.prototype.replaceParent=function(t,e){this.mainElement&&this.mainElement.parentNode!==t&&t.appendChild(this.mainElement),e&&e!==this.scroll&&(this.scroll&&this.scroll.detachEvents(),this.scroll=e),this.measurer instanceof v.TextMeasurer&&this.measurer.replaceParent(t)},t.prototype.update=function(t){this.view.adjust({horizontal:!t,vertical:!t}),this.page.redraw()},t.prototype.onNewModel=function(t){this.measurer.onNewModel(t,this.dom)},t.prototype.clear=function(){this.items.clear(),this.selection.clear(),this.input.clear()},t.prototype.attachPointerEvents=function(t){r.DomUtils.addClassName(t,x),P.RenderHelper.addEventListener(t,"pointerdown",this.onPointerDownHandler),P.RenderHelper.addEventListener(c.Browser.TouchUI?t:document,"pointerup",this.onPointerUpHandler),P.RenderHelper.addEventListener(c.Browser.TouchUI?t:document,"pointermove",this.onPointerMoveHandler),P.RenderHelper.addEventListener(t,"pointercancel",this.onPointerCancelHandler),P.RenderHelper.addEventListener(t,"pointerleave",this.onPointerLeaveHandler)},t.prototype.detachPointerEvents=function(t){P.RenderHelper.removeEventListener(t,"pointerdown",this.onPointerDownHandler),P.RenderHelper.removeEventListener(c.Browser.TouchUI?t:document,"pointerup",this.onPointerUpHandler),P.RenderHelper.removeEventListener(c.Browser.TouchUI?t:document,"pointermove",this.onPointerMoveHandler),P.RenderHelper.removeEventListener(t,"pointercancel",this.onPointerCancelHandler),P.RenderHelper.removeEventListener(t,"pointerleave",this.onPointerLeaveHandler),r.DomUtils.removeClassName(t,x)},t.prototype.attachMouseTouchEvents=function(t){P.RenderHelper.addEventListener(t,this.mouseDownEventName,this.onMouseDownHandler),P.RenderHelper.addEventListener(document,this.mouseMoveEventName,this.onMouseMoveHandler),P.RenderHelper.addEventListener(document,this.mouseUpEventName,this.onMouseUpHandler)},t.prototype.detachMouseTouchEvents=function(t){P.RenderHelper.removeEventListener(t,this.mouseDownEventName,this.onMouseDownHandler),P.RenderHelper.removeEventListener(document,this.mouseMoveEventName,this.onMouseMoveHandler),P.RenderHelper.removeEventListener(document,this.mouseUpEventName,this.onMouseUpHandler)},t.prototype.attachEvents=function(t){this.mouseDownEventName=c.Browser.TouchUI?"touchstart":"mousedown",this.mouseMoveEventName=c.Browser.TouchUI?"touchmove":"mousemove",this.mouseUpEventName=c.Browser.TouchUI?"touchend":"mouseup",this.onPointerDownHandler=this.onPointerDown.bind(this),this.onPointerUpHandler=this.onPointerUp.bind(this),this.onPointerMoveHandler=this.onPointerMove.bind(this),this.onPointerCancelHandler=this.onPointerCancel.bind(this),this.onPointerLeaveHandler=this.onPointerLeave.bind(this),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.onOrientationChangeHandler=this.onOrientationChange.bind(this),this.onMouseClickHandler=this.onMouseClick.bind(this),S.EventUtils.isPointerEvents()?this.attachPointerEvents(t):(this.attachMouseTouchEvents(t),P.RenderHelper.addEventListener(t,"mouseenter",this.onMouseEnterHandler),P.RenderHelper.addEventListener(t,"mouseleave",this.onMouseLeaveHandler)),P.RenderHelper.addEventListener(t,"wheel",this.onMouseWheelHandler),P.RenderHelper.addEventListener(t,"dblclick",this.onMouseDblClickHandler),P.RenderHelper.addEventListener(t,"click",this.onMouseClickHandler),P.RenderHelper.addEventListener(t,"contextmenu",this.onContextMenuHandler),P.RenderHelper.addEventListener(window,"resize",this.onWindowResizelHandler),P.RenderHelper.addEventListener(window,"orientationchange",this.onOrientationChangeHandler),this.input.mouseWheelHandler=this.onMouseWheelHandler},t.prototype.detachEvents=function(t){S.EventUtils.isPointerEvents()?this.detachPointerEvents(t):(this.detachMouseTouchEvents(t),P.RenderHelper.removeEventListener(t,"mouseenter",this.onMouseEnterHandler),P.RenderHelper.removeEventListener(t,"mouseleave",this.onMouseLeaveHandler)),P.RenderHelper.removeEventListener(t,"wheel",this.onMouseWheelHandler),P.RenderHelper.removeEventListener(t,"dblclick",this.onMouseDblClickHandler),P.RenderHelper.removeEventListener(t,"contextmenu",this.onContextMenuHandler),P.RenderHelper.removeEventListener(t,"click",this.onMouseClickHandler),P.RenderHelper.removeEventListener(window,"resize",this.onWindowResizelHandler),P.RenderHelper.removeEventListener(window,"orientationchange",this.onOrientationChangeHandler)},t.prototype.setPointerPosition=function(t){this.pointers[t.pointerId]={clientX:t.clientX,clientY:t.clientY}},t.prototype.clearPointerPosition=function(t){delete this.pointers[t.pointerId]},t.prototype.onPointerDown=function(t){this.setPointerPosition(t),this.getPointerCount()>2&&(this.pointers={}),this.onMouseDown(t)},t.prototype.onPointerUp=function(t){this.clearPointerPosition(t),this.onMouseUp(t)},t.prototype.onPointerMove=function(t){(c.Browser.TouchUI&&!S.EventUtils.isMousePointer(t)||S.EventUtils.isLeftButtonPressed(t))&&this.setPointerPosition(t),this.onMouseMove(t)},t.prototype.onPointerCancel=function(t){this.clearPointerPosition(t)},t.prototype.onPointerLeave=function(t){S.EventUtils.isMousePointer(t)&&this.onMouseLeave(t),this.clearPointerPosition(t)},t.prototype.onMouseDown=function(t){var e=this;return this.lockMouseMove(),this.input.lockFocus(),this.autoScroll.onMouseDown(t),this.lastDownMouseEvent=this.createDiagramMouseEvent(t),u.raiseEvent(t,this.lastDownMouseEvent,(function(t){return e.events.onMouseDown(t)})),this.events.canFinishTextEditing()&&this.input.captureFocus(),S.EventUtils.isTouchEvent(t)&&this.processTouchDown(t),i.EvtUtils.preventEventAndBubble(t),!1},t.prototype.onMouseMove=function(t){var e=this;this.moveLocked||(this.autoScroll.onMouseMove(t,(function(){return e.onMouseMoveCore(t)})),this.onMouseMoveCore(t),c.Browser.IE&&this.lockMouseMove(),S.EventUtils.isTouchEvent(t)&&this.processTouchMove(t))},t.prototype.onMouseMoveCore=function(t){var e=this;u.raiseEvent(t,this.createDiagramMouseEvent(t),(function(t){return e.events.onMouseMove(t)}))},t.prototype.onMouseUp=function(t){var e=this;this.lockMouseMove();var n=this.createDiagramMouseEvent(t);u.raiseEvent(t,n,(function(t){return e.events.onMouseUp(t)})),this.autoScroll.onMouseUp(t),n.source.type!==o.MouseEventElementType.Undefined&&this.input.captureFocus(!0),S.EventUtils.isTouchEvent(t)&&this.processTouchUp(t)},t.prototype.onMouseEnter=function(t){var e=this;this.autoScroll.onMouseEnter(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;S.EventUtils.isTouchEvent(t)?S.EventUtils.isMousePointer(t)||this.input.captureFocus():u.raiseEvent(t,this.createActualMouseClickEvent(t),(function(t){return e.events.onClick(t)}))},t.prototype.createActualMouseClickEvent=function(t){return this.lastDownMouseEvent?new o.DiagramMouseEvent(this.lastDownMouseEvent.modifiers,this.lastDownMouseEvent.button,this.lastDownMouseEvent.offsetPoint.clone(),this.lastDownMouseEvent.modelPoint.clone(),this.lastDownMouseEvent.source,this.createDiagramMouseEventTouches(t)):this.createDiagramMouseEvent(t)},t.prototype.onContextMenu=function(t){var e=this;if(this.contextMenuEnabled)return 1!==t.buttons&&u.raiseEvent(t,this.createDiagramContextMenuEvent(t),(function(t){return e.events.onContextMenu(t)})),this.input.captureFocus(),i.EvtUtils.preventEventAndBubble(t)},t.prototype.processTouchDown=function(t){var n=this;this.touchDownPoint=this.getTouchPointFromEvent(t),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(e){var n=this.getTouchPointFromEvent(e);this.touchDownPoint&&n&&(Math.abs(this.touchDownPoint.x-n.x)>t.touchPositionLimit||Math.abs(this.touchDownPoint.y-n.y)>t.touchPositionLimit)&&(this.resetLongTouch(),this.resetDblClick())},t.prototype.getPointers=function(){var t=this;return Object.keys(this.pointers).map((function(e){return t.pointers[e]}))},t.prototype.getPointerCount=function(){return Object.keys(this.pointers).length},t.prototype.getTouchPointFromEvent=function(t){var e,n=t.touches;if(n&&n.length>0)e=new s.Point(n[0].clientX,n[0].clientY);else{var o=this.getPointers();o.length&&(e=new s.Point(o[0].clientX,o[0].clientY))}return e},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.EvtUtils.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(),this.touchDownPoint=void 0},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.onOrientationChange=function(){var t=this;setTimeout((function(){return t.onWindowResize()}),100)},t.prototype.onWindowResize=function(){var t={horizontal:!1,vertical:!1};if(this.view.autoZoom!==l.AutoZoomMode.Disabled)t.horizontal=!0,t.vertical=!0;else{var e=this.view.checkFitToCanvas(),n=this.view.checkFitToCanvas(this.scroll.getSize());t={horizontal:e.horizontal!==n.horizontal||n.horizontal,vertical:e.vertical!==n.vertical||n.vertical}}this.view.adjust(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){r.DomUtils.toggleClassName(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.notifyToolboxDragStart=function(t){this.onMouseEnter(t)},t.prototype.notifyToolboxDragEnd=function(t){t&&S.EventUtils.isPointerEvents()&&this.onMouseUp(t)},t.prototype.notifyToolboxDraggingMouseMove=function(t){this.onMouseMove(t)},t.prototype.createDiagramMouseEvent=function(t){var e=a.KeyUtils.getKeyModifiers(t),n=function(t){return c.Browser.MSTouchUI?2!==t.button:S.EventUtils.isLeftButtonPressed(t)}(t)?o.MouseButton.Left:o.MouseButton.Right,i=this.getOffsetPointByEvent(t),r=this.getModelPoint(i),s=S.EventUtils.isTouchEvent(t),u=this.getEventSource(t,s),h=this.createDiagramMouseEventTouches(t);return new o.DiagramMouseEvent(e,n,i,r,u,h,s)},t.prototype.createDiagramMouseEventTouches=function(t){var e=[];if(t.touches)for(var n=0;n{Object.defineProperty(e,"__esModule",{value:!0}),e.NativeScrollView=void 0;var o=n(8675),i=n(6353),r=n(8900),s=n(6907),a=n(1114),c=function(){function t(t){this.onScroll=new o.EventDispatcher,this.scrollBarWidth=s.DomUtils.getVerticalScrollBarWidth(),this.mainElement=t,this.attachEvents()}return t.prototype.attachEvents=function(){var t=this;this.onScrollHandler=function(){return t.onScroll.raise1((function(e){return e.notifyScrollChanged((function(){return t.getScroll()}))}))},a.RenderHelper.addEventListener(this.mainElement,"scroll",this.onScrollHandler)},t.prototype.detachEvents=function(){a.RenderHelper.removeEventListener(this.mainElement,"scroll",this.onScrollHandler)},t.prototype.getScrollContainer=function(){return this.mainElement},t.prototype.setScroll=function(t,e){var n=this;this.mainElement.style.overflow="scroll",this.mainElement.scrollLeft=t,this.mainElement.scrollTop=e,this.mainElement.style.overflow="",this.onScroll.raise1((function(t){return t.notifyScrollChanged((function(){return n.getScroll()}))}))},t.prototype.offsetScroll=function(t,e){var n=this;t&&(this.mainElement.scrollLeft+=t),e&&(this.mainElement.scrollTop+=e),this.onScroll.raise1((function(t){return t.notifyScrollChanged((function(){return n.getScroll()}))}))},t.prototype.getScroll=function(){return new r.Point(this.mainElement.scrollLeft,this.mainElement.scrollTop)},t.prototype.getSize=function(){var t=this.mainElement.getBoundingClientRect();return new i.Size(Math.floor(t.width),Math.floor(t.height))},t.prototype.getScrollBarWidth=function(){return this.scrollBarWidth},t}();e.NativeScrollView=c},6411:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShapeImageIndicator=void 0;var o=n(418),i=n(7724),r=n(5329),s=n(9279),a=n(4716),c=n(9291),u=function(){function t(t,e,n,o,i){this.x=t,this.y=e,this.size=n,this.borderThickness=o,this.className=i,this.animationStarted=!1}return t.createLoadingIndicatorPrimitives=function(e,n,o,i,r){return new t(e,n,o,i,r).createLoadingIndicatorPrimitive()},t.createUserIconPrimitives=function(e,n,o,i,r){return new t(e,n,o,i,r).createUserIconPrimitive()},t.createWarningIconPrimitives=function(e,n,o,i){return new t(e,n,o,void 0,i).createWarningIconPrimitive()},t.prototype.rotate=function(t,e,n,o){if(this.animationStarted){var i="rotate("+Math.round(o)%1080/3+" "+e+" "+n+")";t.setAttribute("transform",i),this.animationRequestId=requestAnimationFrame(function(o){this.rotate(t,e,n,o)}.bind(this))}},t.prototype.onApplyLoadingIndicatorElementProperties=function(t){var e=[c.UnitConverter.twipsToPixelsF(this.x+this.size/2),c.UnitConverter.twipsToPixelsF(this.y+this.size/2)],n=e[0],o=e[1];s.Browser.IE?(this.animationRequestId=requestAnimationFrame(function(e){this.rotate(t,n,o,e)}.bind(this)),this.animationStarted=!0):t.style.setProperty("transform-origin",n+"px "+o+"px")},t.prototype.center=function(){return[c.UnitConverter.twipsToPixelsF(this.x+this.size/2),c.UnitConverter.twipsToPixelsF(this.y+this.size/2)]},t.prototype.createLoadingIndicatorPrimitive=function(){var t=this.center(),e=t[0],n=t[1],s=c.UnitConverter.twipsToPixelsF(this.size/2-this.borderThickness/2);return new r.GroupPrimitive([new o.EllipsePrimitive(e+"",n+"",s+"",s+""),new i.PathPrimitive([new i.PathPrimitiveMoveToCommand(e+s+"",n+""),new i.PathPrimitiveArcToCommand(s+"",s+"",0,!1,!1,e+"",n-s+"")])],this.className,void 0,void 0,this.onApplyLoadingIndicatorElementProperties.bind(this),this.onBeforeDispose.bind(this))},t.prototype.createUserIconPrimitive=function(){var t=this.center(),e=t[0],n=t[1],s=c.UnitConverter.twipsToPixelsF(this.size/2-this.borderThickness/2),a=c.UnitConverter.twipsToPixelsF(this.size);return new r.GroupPrimitive([new o.EllipsePrimitive(e+"",n+"",s+"",s+"",void 0,"dxdi-background"),new o.EllipsePrimitive(e+"",n-a/8+"",a/8+"",a/8+""),new i.PathPrimitive([new i.PathPrimitiveMoveToCommand(e+"",n+a/16+""),new i.PathPrimitiveCubicCurveToCommand(e+.1375*a+"",n+a/16+"",e+a/4+"",n+.11875*a+"",e+a/4+"",n+.1875*a+""),new i.PathPrimitiveLineToCommand(e+a/4+"",n+a/4+""),new i.PathPrimitiveLineToCommand(e-a/4+"",n+a/4+""),new i.PathPrimitiveLineToCommand(e-a/4+"",n+.1875*a+""),new i.PathPrimitiveCubicCurveToCommand(e-a/4+"",n+.11875*a+"",e-.1375*a+"",n+a/16+"",e+"",n+a/16+""),new i.PathPrimitiveClosePathCommand])],this.className)},t.prototype.createWarningIconPrimitive=function(){var t=this.center(),e=t[0],n=t[1],i=c.UnitConverter.twipsToPixelsF(this.size/2)-1,s=c.UnitConverter.twipsToPixelsF(this.size/8);return new r.GroupPrimitive([new o.EllipsePrimitive(e+"",n+"",i+"",i+""),new a.RectanglePrimitive(e-s/2+.5+"",n+i-c.UnitConverter.twipsToPixelsF(this.size/4)+"",s+"",s+""),new a.RectanglePrimitive(e-s/2+.5+"",n-i+c.UnitConverter.twipsToPixelsF(this.size/4)-s+"",s+"",i+"")],this.className)},t.prototype.onBeforeDispose=function(){this.animationRequestId&&cancelAnimationFrame(this.animationRequestId),this.animationStarted=!1},t}();e.ShapeImageIndicator=u},4724:function(t,e,n){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])},o(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}),e.IconToolbox=void 0;var r=n(4602),s=n(1114),a=n(5503),c=n(9291),u=n(8900),h=n(1669),p=n(1552),l=n(6688),d=n(4716),f=function(t){function e(e,n,o,i,r,s,a,c,u){var h=t.call(this,e,n,o,i,r,s)||this;return h.options=a,h.measurer=c,h.instanceId=u,h}return i(e,t),e.prototype.createElements=function(t,e){var n=document.createElementNS(s.svgNS,"svg");n.className.baseVal="dxdi-canvas",t.appendChild(n),this.drawShapeIcons(n,e,this.options.toolboxWidth||n.getBoundingClientRect().width)},e.prototype.drawShapeIcons=function(t,e,n){var o=this,i=p.DEFAULT_STROKE_WIDTH,r=n-2*i,s=this.options.shapeIconSize;!s&&this.options.shapeIconSpacing&&this.options.shapeIconCountInRow&&(s=Math.floor((r-(this.options.shapeIconCountInRow-1)*this.options.shapeIconSpacing)/this.options.shapeIconCountInRow)),s||(s=32);var a=s=Math.max(s,this.options.shapeIconSpacing/2),u=this.options.shapeIconCountInRow;if(!u)for(u=1;a1?(r-s*u)/(u-1):0,l=i,d=i,f=c.UnitConverter.pixelsToTwips(s);e.forEach((function(e,n){n>0&&n%u==0&&(l=i,d+=s+h);var r=o.shapeDescriptionManager.get(e),a=o.createShape(r,l,d,s<26);o.updateShapeIconBounds(a,s);var p=o.drawShape(t,a);o.drawSelector(p,c.UnitConverter.pixelsToTwips(l),c.UnitConverter.pixelsToTwips(d),f),l+=s+h})),t.style.height=d+s+i+"px",t.style.width=n+"px"},e.prototype.drawShape=function(t,e){var n=this,o=e.description.createPrimitives(e,this.instanceId,!0),i=document.createElementNS(s.svgNS,"g");if(i.setAttribute("data-tb-type",e.description.key.toString()),i.setAttribute("class","toolbox-item"),i.setAttribute("title",e.description.getTitle()),this.options.shapeIconAttributes)for(var r in this.options.shapeIconAttributes)Object.prototype.hasOwnProperty.call(this.options.shapeIconAttributes,r)&&i.setAttribute(r,this.options.shapeIconAttributes[r]);return t.appendChild(i),o.forEach((function(t){var e=t.createElement((function(t){return i.appendChild(t)}));t.applyElementProperties(e,n.measurer)})),i},e.prototype.drawSelector=function(t,e,n,o){var i=this,r=new d.RectanglePrimitive(e,n,o,o,void 0,"selector");r.createElement((function(e){r.applyElementProperties(e,i.measurer),t.appendChild(e)}))},e.prototype.createShape=function(t,e,n,o){var i=c.UnitConverter.pixelsToTwips(e),r=c.UnitConverter.pixelsToTwips(n),s=new a.Shape(t,new u.Point(i,r),!0);return this.needResetShapeText(t)?s.text="":o&&(s.text="T"),s},e.prototype.needResetShapeText=function(t){return!(t instanceof h.TextShapeDescription)&&!(t instanceof l.CustomShapeDescription&&t.baseDescription instanceof h.TextShapeDescription)},e.prototype.updateShapeIconBounds=function(t,e){var n=c.UnitConverter.pixelsToTwips(e);if(t.size.height=t.size.width*t.getToolboxHeightToWidthRatio(),t.size.width>t.size.height){var o=t.size.height/t.size.width;t.size.width=n,t.size.height=n*o,t.position.y=t.position.y+(n-t.size.height)/2,t.parameters.forEach((function(e){e.value=e.value*n/t.description.defaultSize.width}))}else if(t.size.width{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramDraggingEvent=e.ToolboxDraggingObject=e.Toolbox=void 0;var o,i=n(8675),r=n(8900),s=n(3714),a=n(4914),c=n(6907),u=n(9279),h=n(1114),p=n(8693),l="dxdi-toolbox",d="dxdi-tb-start-drag-flag",f=function(){function t(t,e,n,r,s,a){this.readOnly=e,this.allowDragging=n,this.shapeDescriptionManager=r,this.shapeTypes=s,this.getAllowedShapeTypes=a,this.dragPrepareTimeout=-1,this.dragState=o.None,this.emulateDragEvents=u.Browser.WebKitTouchUI,this.onDragOperation=new i.EventDispatcher,this.onClickOperation=new i.EventDispatcher,t&&(this.mainElement=this.createMainElement(t),this.attachHandlers(this.mainElement))}return t.prototype.clean=function(t){this.detachHandlers(this.mainElement),t&&t(this.mainElement)},t.prototype.createMainElement=function(t){var e=document.createElement("div");return e.classList.add(l),u.Browser.AndroidMobilePlatform&&e.classList.add("dxdi-nodrag"),e.draggable=!0,this.emulateDragEvents&&(e.tabIndex=0),t.appendChild(e),e},t.prototype.attachHandlers=function(t){this.onElementMouseDownHandler=this.onElementMouseDown.bind(this),this.onElementMouseUpHandler=this.onElementMouseUp.bind(this),this.onMouseDownHandler=this.onMouseDown.bind(this),this.onMouseMoveHandler=this.onMouseMove.bind(this),this.onMouseUpHandler=this.onMouseUp.bind(this),this.onDragStartHandler=this.onDragStart.bind(this),this.onTouchMoveHandler=this.onTouchMove.bind(this),this.emulateDragEvents||h.RenderHelper.addEventListener(t,"dragstart",this.onDragStartHandler),i.EventUtils.isPointerEvents()?(this.mouseDownEventName="pointerdown",this.mouseMoveEventName="pointermove",this.mouseUpEventName="pointerup"):(this.mouseDownEventName=u.Browser.TouchUI?"touchstart":"mousedown",this.mouseMoveEventName=u.Browser.TouchUI?"touchmove":"mousemove",this.mouseUpEventName=u.Browser.TouchUI?"touchend":"mouseup"),h.RenderHelper.addEventListener(t,"touchmove",this.onTouchMoveHandler),h.RenderHelper.addEventListener(t,this.mouseDownEventName,this.onElementMouseDownHandler),h.RenderHelper.addEventListener(t,this.mouseUpEventName,this.onElementMouseUpHandler),h.RenderHelper.addEventListener(t,this.mouseDownEventName,this.onMouseDownHandler),h.RenderHelper.addEventListener(document,this.mouseMoveEventName,this.onMouseMoveHandler),h.RenderHelper.addEventListener(document,this.mouseUpEventName,this.onMouseUpHandler)},t.prototype.detachHandlers=function(t){this.emulateDragEvents||h.RenderHelper.removeEventListener(t,"dragstart",this.onDragStartHandler),h.RenderHelper.removeEventListener(t,"touchmove",this.onTouchMoveHandler),h.RenderHelper.removeEventListener(t,this.mouseDownEventName,this.onElementMouseDownHandler),h.RenderHelper.removeEventListener(t,this.mouseUpEventName,this.onElementMouseUpHandler),h.RenderHelper.removeEventListener(t,this.mouseDownEventName,this.onMouseDownHandler),h.RenderHelper.removeEventListener(document,this.mouseMoveEventName,this.onMouseMoveHandler),h.RenderHelper.removeEventListener(document,this.mouseUpEventName,this.onMouseUpHandler)},t.prototype.render=function(t){this.mainElement.childNodes&&(this.mainElement.innerHTML="");var e=this.shapeTypes;return e=this.getAllowedShapeTypes?this.getAllowedShapeTypes(e):e,(e=t?e.filter(t):e).length&&this.createElements(this.mainElement,e),!!e.length},t.prototype.createDraggingObject=function(t){var e=new g;return e.data=t,e.onFinishDragging=this.resetDragState.bind(this),e.onCaptured=this.capture.bind(this),new y(e)},t.prototype.getDragShapeType=function(t){for(;t&&!c.DomUtils.hasClassName(t,l);){if(t.getAttribute&&t.getAttribute("data-tb-type"))return t.getAttribute("data-tb-type");t=t.parentNode}},t.prototype.getTouchPointFromEvent=function(t){var e,n=t.touches;return n&&n.length>0?e=new r.Point(n[0].clientX,n[0].clientY):t.clientX&&t.clientY&&(e=new r.Point(t.clientX,t.clientY)),e},t.prototype.onElementMouseDown=function(t){this.mouseDownShapeType=this.getDragShapeType(s.EvtUtils.getEventSource(t)),this.touchDownPoint=this.getTouchPointFromEvent(t)},t.prototype.onElementMouseUp=function(t){var e=this.getDragShapeType(s.EvtUtils.getEventSource(t));e&&e===this.mouseDownShapeType&&this.onClickOperation.raise("notifyToolboxClick",e),this.mouseDownShapeType=void 0,this.touchDownPoint=void 0},t.prototype.onMouseDown=function(t){this.setDragState(o.Prepare,t),u.Browser.TouchUI&&i.EventUtils.isMousePointer(t)&&this.setDragState(o.Start,t)},t.prototype.onDragStart=function(t){this.setDragState(o.Start,t),t.preventDefault()},t.prototype.onTouchMove=function(t){this.draggingObject&&t.preventDefault()},t.prototype.isLeftButtonPressed=function(t){return s.EvtUtils.isLeftButtonPressed(t)||"pointermove"===t.type&&u.Browser.TouchUI&&u.Browser.MacOSMobilePlatform&&i.EventUtils.isMousePointer(t)},t.prototype.onMouseMove=function(t){if(u.Browser.TouchUI&&u.Browser.MacOSMobilePlatform){var e=this.getTouchPointFromEvent(t);if(this.touchDownPoint&&e&&this.touchDownPoint.x===e.x&&this.touchDownPoint.y===e.y)return}this.setDragState(this.isLeftButtonPressed(t)?o.Dragging:o.None,t),i.EventUtils.isPointerEvents()&&this.raiseDraggingMouseMove(t)},t.prototype.onMouseUp=function(t){this.setDragState(o.None,t)},t.prototype.updateDraggingElementPosition=function(t,e){var n=this.draggingObject.element,o=t-n.offsetWidth/2,i=e-n.offsetHeight/2;a.SetAbsoluteX(n,o),a.SetAbsoluteY(n,i)},t.prototype.setDragState=function(t,e){if(!this.readOnly&&this.allowDragging&&!(t===o.None&&t===this.dragState||(this.dragPrepareTimeout>-1&&(clearTimeout(this.dragPrepareTimeout),this.dragPrepareTimeout=-1,this.dragPrepareEvent=void 0),t-this.dragState>1||t!==o.None&&t{Object.defineProperty(e,"__esModule",{value:!0}),e.ToolboxManager=void 0;var o=n(5947),i=n(4724),r=n(1733),s=n(8679),a=function(){function t(t){this.shapeDescriptionManager=t,this.toolboxes=[],this.measurers={}}return t.prototype.create=function(t,e,n,r,s,a,c,u){var h=Array.isArray(s)?s:this.shapeDescriptionManager.getTypesByCategory(s),p=r?new o.TextToolbox(t,e,n,this.shapeDescriptionManager,h,a):new i.IconToolbox(t,e,n,this.shapeDescriptionManager,h,a,u,this.getOrCreateMeasurer(t),c);return p.render(),this.toolboxes.push(p),p},t.prototype.clean=function(t,e){var n=this;if(e)e.clean(t),this.toolboxes.splice(this.toolboxes.indexOf(e),1),Object.keys(this.measurers).forEach((function(t){n.measurers[t]===e.measurer&&delete n.measurers[t]}));else{for(var o=0;o-1||n===t)&&e.render()}))},t.prototype.applyFilter=function(t,e){var n=this;return this.toolboxes.reduce((function(o,i,r){return(!e||Array.isArray(e)&&e.indexOf(r)>-1||r===e)&&i.render((function(e){return n.searchFilter(e,t,r)}))&&o.push(r),o}),[])},t.prototype.searchFilter=function(t,e,n,o){if(!e||o&&-1===o.indexOf(n))return!0;e=e.toLowerCase();var i=this.shapeDescriptionManager.get(t);return i.getTitle().toLowerCase().indexOf(e)>-1||i.getDefaultText().toLowerCase().indexOf(e)>-1},t.prototype.getOrCreateMeasurer=function(t){var e=t.getAttribute("data-dxdiMeasurerID");return e&&this.measurers[e]||(e=s.MathUtils.generateGuid(),this.measurers[e]=new r.TextMeasurer(t),t.setAttribute("data-dxdiMeasurerID",e)),this.measurers[e]},t}();e.ToolboxManager=a},3500:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.raiseEvent=e.RenderUtils=void 0;var o=n(6031),i=n(8679),r=function(){function t(){}return t.updateSvgElementSize=function(t,e,n,o){t.style.width=e+"px",t.style.height=n+"px",t.setAttribute("viewBox","0 0 "+e+" "+n),o&&(t.setAttribute("width",e.toString()),t.setAttribute("height",n.toString()))},t.removeElement=function(t){t&&t.parentNode&&t.parentNode.removeChild(t)},t.removeContent=function(t){for(;t&&t.firstChild;)t.removeChild(t.firstChild)},t.setElementEventData=function(t,e,n,i){e!==o.MouseEventElementType.Undefined&&(t.setAttribute("data-type",e.toString()),void 0!==n&&t.setAttribute("data-key",n.toString()),void 0!==i&&t.setAttribute("data-value",i.toString()))},t.getElementEventData=function(t){if(t.getAttribute&&t.getAttribute("data-type"))return new o.MouseEventSource(parseInt(t.getAttribute("data-type")),t.getAttribute("data-key"),t.getAttribute("data-value"));var e=t.getAttribute&&t.getAttribute("class");return"dxdi-page"===e||"dxdi-main"===e?new o.MouseEventSource(o.MouseEventElementType.Document):void 0},t.getHtmlElementStylePropertyName=function(t){switch(t){case"fill":return"color";case"text-anchor":return"text-align"}return t},t.getTextAnchorValue=function(t,e){if(void 0===e&&(e=!1),e){if("start"===t)return"end";if("end"===t)return"start"}return t},t.getStrokeDasharrayValue=function(t,e){if(e){var n=t&&t.toString();return(n?n.split(/[\s,]+/):[]).map((function(t){return parseInt(t)/2*e})).join(",")}return t},t.applyStyleToElement=function(t,e,n){var o=this;void 0===n&&(n=!1);var i=t.getDefaultInstance();t.forEach((function(r){var s=t[r],a=e instanceof HTMLElement?o.getHtmlElementStylePropertyName(r):r;if(void 0!==s&&""!==s&&s!==i[r]){switch(r){case"text-anchor":s=o.getTextAnchorValue(s,n);break;case"stroke-dasharray":s=o.getStrokeDasharrayValue(s,parseInt(t["stroke-width"]))}e.style.setProperty(a,s)}else e.style.setProperty(a,"")}))},t.generateSvgElementId=function(t){return t+"_"+i.MathUtils.generateGuid()},t.getUrlPathById=function(t){return"url(#"+t+")"},t}();e.RenderUtils=r,e.raiseEvent=function(t,e,n){n(e),e.preventDefault&&t.preventDefault()}},5401:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InputPosition=void 0;var o=n(6823),i=n(4914),r=function(){function t(t){this.selection=t,this.initialProperties=new o.InputPositionProperties(this.selection),this.defaultProperties=new o.InputPositionProperties(this.selection,this.initialProperties,!0),this.currentProperties=new o.InputPositionProperties(this.selection,this.defaultProperties)}return t.prototype.initialize=function(){this.reset(),this.defaultProperties.reset()},t.prototype.reset=function(){this.currentProperties.reset()},t.prototype.getDefaultConnectorProperties=function(){return this.defaultProperties.getConnectorProperties()},t.prototype.getDefaultConnectorPropertyValue=function(t){return this.defaultProperties.getConnectorPropertyValue(t)},t.prototype.getCurrentConnectorPropertyValue=function(t){return this.currentProperties.getConnectorPropertyValue(t)},t.prototype.setConnectorPropertyValue=function(t,e){this.currentProperties.setConnectorPropertyValue(t,e),this.selection.isEmpty(!0)&&this.defaultProperties.setConnectorPropertyValue(t,e)},t.prototype.setInitialConnectorProperties=function(t){for(var e in this.defaultProperties.reset(),this.currentProperties.reset(),t)Object.prototype.hasOwnProperty.call(t,e)&&this.initialProperties.setConnectorPropertyValue(e,t[e])},t.prototype.getDefaultStyle=function(){return this.defaultProperties.getStyle()},t.prototype.getDefaultStylePropertyValue=function(t){return this.defaultProperties.getStylePropertyValue(t)},t.prototype.getDefaultTextStyle=function(){return this.defaultProperties.getTextStyle()},t.prototype.getDefaultTextStylePropertyValue=function(t){return this.defaultProperties.getTextStylePropertyValue(t)},t.prototype.getCurrentStylePropertyValue=function(t){return this.currentProperties.getStylePropertyValue(t)},t.prototype.getCurrentTextStylePropertyValue=function(t){return this.currentProperties.getTextStylePropertyValue(t)},t.prototype.setStylePropertyValue=function(t,e){this.currentProperties.setStylePropertyValue(t,e),this.selection.isEmpty(!0)&&this.defaultProperties.setStylePropertyValue(t,e)},t.prototype.setTextStylePropertyValue=function(t,e){this.currentProperties.setTextStylePropertyValue(t,e),this.selection.isEmpty(!0)&&this.defaultProperties.setTextStylePropertyValue(t,e)},t.prototype.setInitialStyleProperties=function(t){this.defaultProperties.reset(),this.currentProperties.reset();var e="string"==typeof t?i.Data.cssTextToObject(t):t;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.initialProperties.setStylePropertyValue(n,e[n])},t.prototype.setInitialTextStyleProperties=function(t){this.defaultProperties.reset(),this.currentProperties.reset();var e="string"==typeof t?i.Data.cssTextToObject(t):t;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.initialProperties.setTextStylePropertyValue(n,e[n])},t.prototype.notifySelectionChanged=function(t){this.reset()},t}();e.InputPosition=r},6823:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InputPositionProperties=void 0;var o=n(4612),i=n(1552),r=function(){function t(t,e,n){this.selection=t,this.baseProperties=e,this.disableMergingStyles=n,this.selection=t}return t.prototype.reset=function(){this.connectorProperties=null,this.style=null,this.textStyle=null},t.prototype.getConnectorProperties=function(){return this.connectorProperties||(this.connectorProperties=this.baseProperties?this.baseProperties.getConnectorProperties().clone():new o.ConnectorProperties,this.updateConnectorProperties(this.connectorProperties)),this.connectorProperties},t.prototype.getConnectorPropertyValue=function(t){return this.getConnectorProperties()[t]},t.prototype.setConnectorPropertyValue=function(t,e){this.getConnectorProperties()[t]=e},t.prototype.getStyle=function(){return this.style||(this.style=this.baseProperties?this.baseProperties.getStyle().clone():new i.Style,this.disableMergingStyles||this.updateStyle(this.style,"style")),this.style},t.prototype.getStylePropertyValue=function(t){return this.getStyle()[t]},t.prototype.setStylePropertyValue=function(t,e){this.getStyle()[t]=e},t.prototype.getTextStyle=function(){return this.textStyle||(this.textStyle=this.baseProperties?this.baseProperties.getTextStyle().clone():new i.TextStyle,this.disableMergingStyles||this.updateStyle(this.textStyle,"styleText")),this.textStyle},t.prototype.getTextStylePropertyValue=function(t){return this.getTextStyle()[t]},t.prototype.setTextStylePropertyValue=function(t,e){this.getTextStyle()[t]=e},t.prototype.updateConnectorProperties=function(t){var e=this,n=this.selection.getSelectedConnectors(!0);t.forEach((function(o){e.updatePropertyValue(t,n,(function(t){return t.properties}),o)}))},t.prototype.updateStyle=function(t,e){var n=this,o=this.selection.getSelectedItems(!0);t.forEach((function(i){n.updatePropertyValue(t,o,(function(t){return t[e]}),i)}))},t.prototype.updatePropertyValue=function(t,e,n,o){var i,r=!1;e.forEach((function(t){var e=n(t)[o];if(void 0===i&&void 0!==e)i=e,r=!0;else if(r&&i!==e)return void(i=void 0)})),r&&(t[o]=i)},t}();e.InputPositionProperties=r},9021:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Selection=void 0;var o=n(8675),i=n(5401),r=n(5503),s=n(7959),a=n(4914),c=function(){function t(t){this.onChanged=new o.EventDispatcher,this.inputPosition=new i.InputPosition(this),this.onChanged.add(this.inputPosition),this.initialize(t)}return t.prototype.initialize=function(t){this.model=t,this.keys=[],this.inputPosition.initialize()},t.prototype.add=function(t){this.keys.indexOf(t)<0&&(this.keys.push(t),this.raiseSelectionChanged())},t.prototype.remove=function(t){this.keys.indexOf(t)>=0&&(this.keys.splice(this.keys.indexOf(t),1),this.raiseSelectionChanged())},t.prototype.clear=function(){this.keys.length>0&&(this.keys=[],this.raiseSelectionChanged())},t.prototype.set=function(t,e){!e&&a.Data.ArrayEqual(t,this.keys)||(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(e){return e&&(t||!e.isLocked)}))}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)},t.prototype.raiseSelectionChanged=function(){this.onChanged.raise("notifySelectionChanged",this)},t}();e.Selection=c},240:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectorRoutingMode=e.AutoZoomMode=e.DiagramSettings=void 0;var o,i,r=n(8675),s=n(6353),a=n(5383),c=n(4867),u=function(){function t(){this.onZoomChanged=new r.EventDispatcher,this.onViewChanged=new r.EventDispatcher,this.onReadOnlyChanged=new r.EventDispatcher,this.onConnectorRoutingModeChanged=new r.EventDispatcher,this._zoomLevel=1,this._zoomLevelWasChanged=!1,this._zoomLevelItems=[.5,.75,1,1.25,1.5,2,3],this._simpleView=!1,this._fullscreen=!1,this._readOnly=!1,this._autoZoom=o.Disabled,this._snapToGrid=!0,this._showGrid=!0,this._contextMenuEnabled=!0,this._gridSize=180,this._gridSizeItems=[90,180,360,720],this._pageSizeItems=[{size:new s.Size(12240,15840),text:"US-Letter ({width} x {height})"},{size:new s.Size(12240,20160),text:"US-Legal ({width} x {height})"},{size:new s.Size(15817,24491),text:"US-Tabloid ({width} x {height})"},{size:new s.Size(47679,67408),text:"A0 ({width} x {height})"},{size:new s.Size(33676,47679),text:"A1 ({width} x {height})"},{size:new s.Size(23811,33676),text:"A2 ({width} x {height})"},{size:new s.Size(16838,23811),text:"A3 ({width} x {height})"},{size:new s.Size(11906,16838),text:"A4 ({width} x {height})"},{size:new s.Size(8391,11906),text:"A5 ({width} x {height})"},{size:new s.Size(5953,8391),text:"A6 ({width} x {height})"},{size:new s.Size(4195,5953),text:"A7 ({width} x {height})"}],this._viewUnits=a.DiagramUnit.In,this._connectorRoutingMode=i.AllShapesOnly,this._reloadInsertedItemRequired=!1,this._useCanvgForExportToImage=!0}return Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){var n=this;(e=t.correctZoomLevel(e))!==this._zoomLevel&&(this._zoomLevel=e,this._zoomLevelWasChanged=!0,this.onZoomChanged.raise1((function(t){return t.notifyZoomChanged(e,n._autoZoom)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevelWasChanged",{get:function(){return this._zoomLevelWasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevelItems",{get:function(){return this._zoomLevelItems},set:function(e){(e=e.map((function(e){return t.correctZoomLevel(e)})))!==this._zoomLevelItems&&(this._zoomLevelItems=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"autoZoom",{get:function(){return this._autoZoom},set:function(t){var e=this;t!==this._autoZoom&&(this._autoZoom=t,this.onZoomChanged.raise1((function(n){return n.notifyZoomChanged(e._zoomLevel,t)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"simpleView",{get:function(){return this._simpleView},set:function(t){t!==this._simpleView&&(this._simpleView=t,this.notifyViewChanged())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this._readOnly},set:function(t){t!==this._readOnly&&(this._readOnly=t,this.onReadOnlyChanged.raise1((function(e){return e.notifyReadOnlyChanged(t)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fullscreen",{get:function(){return this._fullscreen},set:function(t){this._fullscreen=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"snapToGrid",{get:function(){return this._snapToGrid},set:function(t){this._snapToGrid=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"showGrid",{get:function(){return this._showGrid},set:function(t){var e=this;t!==this._showGrid&&(this._showGrid=t,this.onViewChanged.raise1((function(t){return t.notifyGridChanged(e.showGrid,e.gridSize)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"contextMenuEnabled",{get:function(){return this._contextMenuEnabled},set:function(t){this._contextMenuEnabled=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gridSize",{get:function(){return this._gridSize},set:function(t){var e=this;t!==this._gridSize&&(this._gridSize=t,this.onViewChanged.raise1((function(t){return t.notifyGridChanged(e.showGrid,e.gridSize)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gridSizeItems",{get:function(){return this._gridSizeItems},set:function(t){t!==this._gridSizeItems&&(this._gridSizeItems=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageSizeItems",{get:function(){return this._pageSizeItems},set:function(t){t!==this._pageSizeItems&&(this._pageSizeItems=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewUnits",{get:function(){return this._viewUnits},set:function(t){this._viewUnits=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"connectorRoutingMode",{get:function(){return this._connectorRoutingMode},set:function(t){t!==this._connectorRoutingMode&&(this._connectorRoutingMode=t,this.onConnectorRoutingModeChanged.raise1((function(e){return e.notifyConnectorRoutingModeChanged(t)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"reloadInsertedItemRequired",{get:function(){return this._reloadInsertedItemRequired},set:function(t){this._reloadInsertedItemRequired=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useCanvgForExportToImage",{get:function(){return this._useCanvgForExportToImage},set:function(t){this._useCanvgForExportToImage=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shapeMinWidth",{get:function(){return this._shapeMinWidth},set:function(t){this._shapeMinWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shapeMinHeight",{get:function(){return this._shapeMinHeight},set:function(t){this._shapeMinHeight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shapeMaxWidth",{get:function(){return this._shapeMaxWidth},set:function(t){this._shapeMaxWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shapeMaxHeight",{get:function(){return this._shapeMaxHeight},set:function(t){this._shapeMaxHeight=t},enumerable:!1,configurable:!0}),t.prototype.applyShapeSizeSettings=function(t,e){t&&("number"==typeof t.shapeMaxHeight&&(this.shapeMaxHeight=c.ModelUtils.getTwipsValue(e,t.shapeMaxHeight)),"number"==typeof t.shapeMinHeight&&(this.shapeMinHeight=c.ModelUtils.getTwipsValue(e,t.shapeMinHeight)),"number"==typeof t.shapeMaxWidth&&(this.shapeMaxWidth=c.ModelUtils.getTwipsValue(e,t.shapeMaxWidth)),"number"==typeof t.shapeMinWidth&&(this.shapeMinWidth=c.ModelUtils.getTwipsValue(e,t.shapeMinWidth)))},t.prototype.notifyViewChanged=function(){var t=this;this.onViewChanged.raise1((function(e){return e.notifyViewChanged(t._simpleView)}))},t.correctZoomLevel=function(t){return Math.min(10,Math.max(t,.01))},t}();e.DiagramSettings=u,function(t){t[t.Disabled=0]="Disabled",t[t.FitContent=1]="FitContent",t[t.FitToWidth=2]="FitToWidth"}(o=e.AutoZoomMode||(e.AutoZoomMode={})),function(t){t[t.None=0]="None",t[t.AllShapesOnly=2]="AllShapesOnly"}(i=e.ConnectorRoutingMode||(e.ConnectorRoutingMode={}))},2230:function(t,e,n){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])},o(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}),e.BarManager=void 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.clean=function(){var t=this;this.bars.forEach((function(e){return e.onChanged.remove(t)})),this.bars=[]},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=0,n=void 0;n=this.bars[e];e++)this.updateBarItemsState(n,t)},e.prototype.updateBarItemsState=function(t,e){if(!this.isUpdateLocked()){if(this.control.permissionsProvider.beginUpdateUI(),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{Object.defineProperty(e,"__esModule",{value:!0}),e.EventUtils=e.HtmlFocusUtils=e.ObjectUtils=e.GeometryUtils=e.Utils=e.EventDispatcher=e.Range=e.LineEquation=void 0,n(7097);var o=n(6353),i=n(8900),r=n(8011),s=n(2400),a=n(5596),c=n(8679),u=n(9716),h=n(1335),p=n(1552),l=n(9279),d=n(3714),f=function(){function t(t,e,n){this.aParam=t,this.bParam=e,this.cParam=n}return t.fromPoints=function(e,n,o){return void 0===o&&(o=1e-5),v.areDuplicatedPoints(e,n,o)?void 0:new t(n.y-e.y,e.x-n.x,n.x*e.y-e.x*n.y)},t.prototype.getPointIntersection=function(t,e){void 0===e&&(e=1e-5);var n=this.aParam,o=this.bParam,i=this.cParam,r=t.aParam,s=t.bParam,a=t.cParam,u=r*o-n*s;if(c.MathUtils.numberCloseTo(u,0,e))return null;if(0===n){var h=(s*i-a*o)/(o*r);return this.createPoint(h,-i/o)}var p=(a*n-i*r)/u;return this.createPoint((-o*p-i)/n,p)},t.prototype.containsPoint=function(t,e){return void 0===e&&(e=1e-5),c.MathUtils.numberCloseTo(this.aParam*t.x+this.bParam*t.y+this.cParam,0,e)},t.prototype.createPoint=function(t,e,n){return void 0===n&&(n=1e-5),new i.Point(c.MathUtils.numberCloseTo(t,0,n)?0:t,c.MathUtils.numberCloseTo(e,0,n)?0:e)},t}();e.LineEquation=f;var y=function(){function t(t,e){this.from=t,this.to=void 0!==e?e:t}return Object.defineProperty(t.prototype,"length",{get:function(){return Math.abs(this.to-this.from)},enumerable:!1,configurable:!0}),t.prototype.extend=function(t){this.from=Math.min(t.from,this.from),this.to=Math.max(t.to,this.to)},t.prototype.includes=function(t){return t>=this.from&&t<=this.to},t.fromLength=function(e,n){return new t(e,e+n)},t}();e.Range=y;var g=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=0,n=void 0;n=this.listeners[e];e++)if(n===t){this.listeners.splice(e,1);break}},t.prototype.raise=function(t){for(var e=[],n=1;n0)d=f;else if(0===f)return new i.Point(r[d],a[l])}return null},t.checkRect=function(t,e,n,o,i,r,s){for(var a=0,c=0,u=n.length-2,h=o;h0)o.filter((function(t){return 1===p.length?!t.containsPoint(p[0].startPoint)&&!t.containsPoint(p[0].endPoint):t!==p[0]&&t!==p[1]})).some((function(t){return s.isIntersected(t)}))&&!i&&(i=!0);return r||(r=!0),"continue"}if(!u&&h){i||(i=!0,r&&(r=!1));var l=o.filter((function(t){return t.containsPoint(c)}));if(l.length>0)o.filter((function(t){return 1===l.length?!t.containsPoint(l[0].startPoint)&&!t.containsPoint(l[0].endPoint):t!==l[0]&&t!==l[1]})).some((function(t){return s.isIntersected(t)}))&&!r&&(r=!0);return"continue"}var d=o.filter((function(t){return t.containsPoint(a)})),f=o.filter((function(t){return t.containsPoint(c)}));if(2===d.length&&2===f.length)return{value:!0};if(1===d.length&&1===f.length&&d[0]!==f[0])return{value:!0};r||1!==f.length||d.length||(r=!0),i||1!==d.length||f.length||(i=!0,r&&(r=!1))}},a=0;a2;){var a=this.getNextPoint(e,s,1,o),c=this.getNextPoint(e,s,-1,o);c&&a&&!t.isRightAngleCorner(c,r,a,i)&&n(r,s)||s++}},t.removeDuplicatedPoints=function(e,n,o,i){void 0===o&&(o=function(t){return void 0!==t}),void 0===i&&(i=1e-5);for(var r,s=0;(r=e[s])&&e.length>2;){var a=this.getNextPoint(e,s,1,o);if(a&&t.areDuplicatedPoints(r,a,i)){var c=s===e.length-2?s:s+1;if(n(e[c],c))continue}s++}},t.removeNotCornersPoints=function(e,n,o,i){void 0===o&&(o=function(t){return void 0!==t}),void 0===i&&(i=1e-5);for(var r,s=0;(r=e[s])&&e.length>2;){var a=this.getNextPoint(e,s,1,o),c=this.getNextPoint(e,s,-1,o);c&&a&&!t.isCorner(c,r,a,i)&&n(r,s)||s++}},t.removeBackwardPoints=function(e,n,o,i){void 0===o&&(o=function(t){return void 0!==t}),void 0===i&&(i=1e-5);for(var r,s=0;(r=e[s])&&e.length>2;){var a=this.getNextPoint(e,s,1,o),c=this.getNextPoint(e,s,-1,o);c&&a&&t.isBackwardPoint(c,r,a,i)&&n(r,s)||s++}},t.isRightAngleCorner=function(e,n,o,i){return void 0===i&&(i=1e-5),c.MathUtils.numberCloseTo(t.createAngle(e,n,o),Math.PI/2,i)||c.MathUtils.numberCloseTo(t.createAngle(e,n,o),Math.PI,i)||c.MathUtils.numberCloseTo(t.createAngle(e,n,o),3*Math.PI/2,i)},t.isCorner=function(e,n,o,i){return void 0===i&&(i=1e-5),!c.MathUtils.numberCloseTo(t.createAngle(e,n,o),0,i)},t.areDuplicatedPoints=function(t,e,n){return void 0===n&&(n=1e-5),c.MathUtils.numberCloseTo(t.x,e.x,n)&&c.MathUtils.numberCloseTo(t.y,e.y,n)},t.isBackwardPoint=function(e,n,o,i){return void 0===i&&(i=1e-5),c.MathUtils.numberCloseTo(t.createAngle(e,n,o),Math.PI,i)},t.createAngle=function(t,e,n){var o=u.Vector.fromPoints(e,n),i=u.Vector.fromPoints(t,e),r=o.x,s=o.y,a=i.x,c=i.y,h=Math.atan2(r*c-a*s,r*a+s*c);return h<0?2*Math.PI+h:h},t.getNextPoint=function(t,e,n,o){for(var i,r=e+n;i=t[r];){if(o(i))return i;r+=n}},t.addSelectedLinesTo=function(t,e,n,o,i,r,s,a,u,h,p,l,d,f){void 0===f&&(f=1e-5);var y=e.y-t.y,g=n.y-e.y,m=t.x-e.x,v=e.x-n.x,P=y*v-g*m;if(!c.MathUtils.numberCloseTo(P,0,f)){var C=y*(t.x+o)+m*(t.y+i),S=g*(e.x+a)+v*(e.y+u);l((v*C-m*S)/P,(y*S-g*C)/P);var x=y*(t.x+r)+m*(t.y+s),b=g*(e.x+h)+v*(e.y+p);d((v*x-m*b)/P,(y*b-g*x)/P)}},t.getSelectionOffsetPoint=function(t,e,n){return new i.Point((t.y-e.y)/n,(e.x-t.x)/n)},t.getSelectionTextStartEndPoints=function(t,e,n,o,r,s){var a=(e.x-t.x)/n,c=(e.y-t.y)/n,u=r.width*a+r.height*c;switch(s){case p.TextAlignment.Left:return[o,new i.Point(o.x+a*u,o.y+c*u)];case p.TextAlignment.Right:return[new i.Point(o.x-a*u,o.y-c*u),o];default:return[new i.Point(o.x-.5*a*u,o.y-.5*c*u),new i.Point(o.x+.5*a*u,o.y+.5*c*u)]}},t.getPathLength=function(t){var e,n=0;return t.forEach((function(t){void 0!==e&&(n+=a.Metrics.euclideanDistance(t,e)),e=t})),n},t.getPathPointByPosition=function(t,e){if(!t.length)throw new Error("Invalid points");if(0>e||e>1)throw new Error("Invalid relative position");var n=this.getPathLength(t);if(t.length<=2&&0===n||0===e)return[t[0],0];for(var o=n*e,r=0,s=1;s=o){var u=o-r,h=(t[s].x-t[s-1].x)/c,p=(t[s].y-t[s-1].y)/c;return[new i.Point(t[s-1].x+h*u,t[s-1].y+p*u),s]}r+=c}return[t[t.length-1],t.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(t,e){if(!t.length)throw new Error("Invalid points");if(1===t.length)return t[0];for(var n,o=Number.MAX_VALUE,i=1;i=y&&y>=-Math.PI/2?(g*=v?1:-1,m*=v?1:-1):-Math.PI/2>=y&&y>=-Math.PI&&(g*=v?-1:1,m*=v?1:-1),n=e.clone().offset(g,m)}}return n},t.getPathPositionByPoint=function(t,e,n){void 0===n&&(n=100),e=this.getPathPointByPoint(t,e);for(var o=this.getPathLength(t),i=0,r=1;ro.top&&(r=-s.top-o.top+1),s.left<0&&-s.left>o.left&&(i=-s.left-o.left+1)),t.style.setProperty("left",i+"px","important"),t.style.setProperty("top",r+"px","important")}}if(t.focus({preventScroll:!0}),e){var a=this.getHtmlScrollPosition();P.compareObjects(n,a)||this.setHtmlScrollPosition(n),t.style.setProperty("left","-1000px","important"),t.style.setProperty("top","-1000px","important")}}catch(t){}},t.getHtmlScrollPosition=function(){return{pos:this.getDocumentScrollPosition(window,document),iframePos:window.top!==window&&this.getDocumentScrollPosition(window.top,window.top.document)}},t.getDocumentScrollPosition=function(t,e){return{left:t.pageXOffset||e.documentElement.scrollLeft||e.body.scrollLeft,top:t.pageYOffset||e.documentElement.scrollTop||e.body.scrollTop}},t.setHtmlScrollPosition=function(t){this.setDocumentScrollPosition(document,t.pos),window.top!==window&&t.iframePos&&this.setDocumentScrollPosition(window.top.document,t.iframePos)},t.setDocumentScrollPosition=function(t,e){t.documentElement.scrollTop=e.top,t.documentElement.scrollLeft=e.left,t.body.scrollTop=e.top,t.body.scrollLeft=e.left},t}();e.HtmlFocusUtils=C;var S=function(){function t(){}return t.isLeftButtonPressed=function(t){return d.EvtUtils.isLeftButtonPressed(t)},t.isPointerEvents=function(){return window.PointerEvent},t.isMousePointer=function(t){return this.isPointerEvents()&&(t.pointerType&&"mouse"===t.pointerType||l.Browser.Firefox&&"click"===t.type)},t.isTouchMode=function(){return l.Browser.TouchUI||window.navigator&&window.navigator.maxTouchPoints>0},t.isTouchEvent=function(e){return l.Browser.TouchUI||!t.isMousePointer(e)},t}();e.EventUtils=S},4914:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Data=e.SetAbsoluteY=e.SetAbsoluteX=void 0;var o=n(6907),i=n(2491);function r(t){return!isNaN(parseFloat(t))&&isFinite(t)}function s(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=o.DomUtils.getCurrentStyle(t).position,e}(t);"static"===n.style.position&&(n.style.position="absolute");t.parentNode.appendChild(n);var i=e?o.DomUtils.getAbsolutePositionX(n):o.DomUtils.getAbsolutePositionY(n);return t.parentNode.removeChild(n),Math.round(i)}(e,n),t}e.SetAbsoluteX=function(t,e){t.style.left=s(e,t,!0)+"px"},e.SetAbsoluteY=function(t,e){t.style.top=s(e,t,!1)+"px"};var a=function(){function t(){}return t.ArrayInsert=function(t,e,n){if(0<=n&&nn;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=o(e,c,n);if(0===u)return c;u<0?r=c+1:a=c-1}return-(r+1)},t.ArrayFlatten=function(t){var e=[];return t.forEach((function(t){e=e.concat(t)})),e},t.GetDistinctArray=function(e){for(var n=[],o=0;o{Object.defineProperty(e,"__esModule",{value:!0}),e.isColorProperty=void 0;var n={stroke:!0,fill:!0};e.isColorProperty=function(t){return n[t]}},3490:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getLineHeight=e.getTextHeight=e.getTextLineSize=e.getOptimalTextRectangle=e.TEXTRECT_RATIO_EPS=e.textToParagraphs=e.textToWords=e.wordsByLines=e.LINE_HEIGHT=void 0;var o=n(8675),i=n(6353),r=n(4914),s=/\s/gm;function a(t,e,n){if(1===e.length)return e;for(var o=n(),i=o.words[" "].width,r=[],s=0,a=-1,c=0;ct?(a=r.push(u)-1,s=h):(s+=i+h,r[a]+=" "+u)}return r}function c(t){return t.split(s).filter((function(t){return t.length}))}function u(t){return t.split("\n")}e.LINE_HEIGHT=1.05,e.wordsByLines=a,e.textToWords=c,e.textToParagraphs=u,e.TEXTRECT_RATIO_EPS=1.2;var h=1;function p(t,e,n){var o=t<1?1/t:t,i=e<1?1/e:e,r=o/i;return(r<1?1/r:r)<=n?0:i>o?1:-1}function l(t,e,n,o){return d(y(t,e,n,!1),o)}function d(t,e){return[r.Data.byRange(t,e.from,e.to),t<=e.to]}function f(t,e){return c(t).reduce((function(t,n,o){var i=e.words[n];return t.width+=i.width,t.height=Math.max(t.height,i.height),o>0&&(t.width+=e.words[" "].width),t}),new i.Size(0,0))}function y(t,e,n,o){var i=Array.isArray(t)?t:u(t);return!o||i.length&&(1!==i.length||i[0].length)?i.reduce((function(t,o){return t+a(e,c(o),(function(){return n})).length}),0)*g(n):g(n)}function g(t){return t.fontSize*e.LINE_HEIGHT}e.getOptimalTextRectangle=function(t,n,s,a,c,g,m,v,P,C){if(void 0===m&&(m=0),void 0===v&&(v=Number.MAX_SAFE_INTEGER||Number.MAX_VALUE),void 0===P&&(P=0),void 0===C&&(C=Number.MAX_SAFE_INTEGER||Number.MAX_VALUE),!t)return new i.Size(r.Data.byRange(c.width,m,v),r.Data.byRange(c.height,P,C));if(m>v||P>C)throw new Error("Min size cannot exceed max size");if(m===v&&P===C)return new i.Size(m,P);var S=a.measureWords(t,n,s),x=u(t),b=Object.keys(S.words).reduce((function(t,e){return Math.max(t,S.words[e].width)}),0),I=new o.Range(r.Data.byRange(Math.max(c.width,b),m,v),v),w=new o.Range(r.Data.byRange(c.height,P,C),C);if(b<=c.width&&y(x,c.width,S,!1)<=c.height&&I.includes(c.width)&&w.includes(c.height))return c;var _=c.width/c.height;return function(t,n,o,s,a,c){for(var u,y,g=t.reduce((function(t,e){return Math.max(t,f(e,n).width)}),0),m=new i.Size(0,0),v=new i.Size(0,0),P=0,C=0,S=0;S<5;S++){if(0===S)v.width=d(g,s)[0];else{if(!(Math.abs(P)>h))break;v.width=d(m.width+P,s)[0]}if(u=l(t,v.width,n,a),v.height=u[0],y=u[1],0===S&&(C=(m=v.clone()).width/m.height/o),0===S&&!y)break;var x=v.width/v.height,b=x/o;if(0===S)P=(v.width/b-v.width)/2;else if(y){if(!p(o,x,e.TEXTRECT_RATIO_EPS)){m=v.clone(),C=b;break}if(!(p(C,b,1)<0))break;m=v.clone(),C=b,P=(v.width/b-v.width)/2,b<1&&(P/=2)}else P/=2}c&&(m.height=r.Data.byRange(m.width/o,m.height,a.to));return m}(x,S,_,I,w,g)},e.getTextLineSize=f,e.getTextHeight=y,e.getLineHeight=g},6734:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ViewController=void 0;var o=n(7156),i=Math.log(.05),r=Math.log(3),s=h(1),a=[o.DiagramCommand.ZoomLevel,o.DiagramCommand.ZoomLevelInPercentage,o.DiagramCommand.Zoom100,o.DiagramCommand.Zoom125,o.DiagramCommand.Zoom200,o.DiagramCommand.Zoom25,o.DiagramCommand.Zoom50,o.DiagramCommand.Zoom75],c=[o.DiagramCommand.SwitchAutoZoom,o.DiagramCommand.ToggleAutoZoom,o.DiagramCommand.AutoZoomToContent,o.DiagramCommand.AutoZoomToWidth],u=function(){function t(t,e){this.settings=t,this.bars=e,t.onZoomChanged.add(this),this.autoZoom=t.autoZoom}return t.prototype.initialize=function(t){this.view=t,this.view.onViewChanged.add(this)},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.scrollIntoView=function(t){this.view&&this.view.scrollIntoView(t)},t.prototype.normalize=function(){this.view.tryNormalizePaddings()},t.prototype.getNextStepZoom=function(t){var e=this.getNearestCurrentZoomStep(),n=t?1:-1,o=Math.min(39,Math.max(0,e+n));if(o!==s){var a=i+(r-i)*o/39;return Math.exp(a)}return 1},t.prototype.getNearestCurrentZoomStep=function(){return h(this.getZoom())},t.prototype.getZoom=function(){return this.view?this.view.actualZoom:this.settings.zoomLevel},t.prototype.resetScroll=function(){this.view.adjust({horizontal:!0,vertical:!0})},t.prototype.notifyViewAdjusted=function(t){},t.prototype.notifyActualZoomChanged=function(t){this.bars.updateItemsState(a)},t.prototype.notifyZoomChanged=function(t,e){this.autoZoom!==e&&(this.autoZoom=e,this.bars.updateItemsState(c))},t}();function h(t){var e=Math.log(t);return Math.round(39*(e-i)/(r-i))}e.ViewController=u},3607:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagramModelOperation=e.Diagnostics=e.RenderHelper=e.DiagramLocalizationService=e.NativeConnector=e.NativeShape=e.ShapeType=e.ColorUtils=e.PageOrientation=e.ConnectorPosition=e.ConnectorLineOption=e.ConnectorLineEnding=e.AutoZoomMode=e.Browser=e.UnitConverter=e.EventDispatcher=e.DataLayoutOrientation=e.DataLayoutType=e.ShapeCategories=e.ShapeTypes=e.DiagramUnit=e.default=e.DiagramControl=e.DiagramCommand=e.Point=e.Size=void 0;var o=n(7156);Object.defineProperty(e,"DiagramCommand",{enumerable:!0,get:function(){return o.DiagramCommand}});var i=n(2106);Object.defineProperty(e,"DiagramControl",{enumerable:!0,get:function(){return i.DiagramControl}}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return i.DiagramControl}});var r=n(6353);Object.defineProperty(e,"Size",{enumerable:!0,get:function(){return r.Size}});var s=n(8900);Object.defineProperty(e,"Point",{enumerable:!0,get:function(){return s.Point}});var a=n(8675);Object.defineProperty(e,"EventDispatcher",{enumerable:!0,get:function(){return a.EventDispatcher}});var c=n(2259);Object.defineProperty(e,"ShapeTypes",{enumerable:!0,get:function(){return c.ShapeTypes}}),Object.defineProperty(e,"ShapeCategories",{enumerable:!0,get:function(){return c.ShapeCategories}}),Object.defineProperty(e,"ShapeType",{enumerable:!0,get:function(){return c.ShapeType}});var u=n(9291);Object.defineProperty(e,"UnitConverter",{enumerable:!0,get:function(){return u.UnitConverter}});var h=n(9279);Object.defineProperty(e,"Browser",{enumerable:!0,get:function(){return h.Browser}});var p=n(240);Object.defineProperty(e,"AutoZoomMode",{enumerable:!0,get:function(){return p.AutoZoomMode}});var l=n(3503);Object.defineProperty(e,"DataLayoutType",{enumerable:!0,get:function(){return l.DataLayoutType}});var d=n(8710);Object.defineProperty(e,"DataLayoutOrientation",{enumerable:!0,get:function(){return d.DataLayoutOrientation}}),n(8721);var f=n(4612);Object.defineProperty(e,"ConnectorLineEnding",{enumerable:!0,get:function(){return f.ConnectorLineEnding}}),Object.defineProperty(e,"ConnectorLineOption",{enumerable:!0,get:function(){return f.ConnectorLineOption}});var y=n(13);Object.defineProperty(e,"ColorUtils",{enumerable:!0,get:function(){return y.ColorUtils}});var g=n(9463);Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return g.Diagnostics}});var m=n(7185);Object.defineProperty(e,"NativeShape",{enumerable:!0,get:function(){return m.NativeShape}}),Object.defineProperty(e,"NativeConnector",{enumerable:!0,get:function(){return m.NativeConnector}});var v=n(6224);Object.defineProperty(e,"DiagramLocalizationService",{enumerable:!0,get:function(){return v.DiagramLocalizationService}});var P=n(1114);Object.defineProperty(e,"RenderHelper",{enumerable:!0,get:function(){return P.RenderHelper}});var C=n(5383);Object.defineProperty(e,"DiagramUnit",{enumerable:!0,get:function(){return C.DiagramUnit}}),Object.defineProperty(e,"PageOrientation",{enumerable:!0,get:function(){return C.PageOrientation}});var S=n(6879);Object.defineProperty(e,"DiagramModelOperation",{enumerable:!0,get:function(){return S.DiagramModelOperation}});var x=n(7959);Object.defineProperty(e,"ConnectorPosition",{enumerable:!0,get:function(){return x.ConnectorPosition}})},655:(t,e,n)=>{n.r(e),n.d(e,{__assign:()=>r,__asyncDelegator:()=>S,__asyncGenerator:()=>C,__asyncValues:()=>x,__await:()=>P,__awaiter:()=>h,__classPrivateFieldGet:()=>T,__classPrivateFieldSet:()=>O,__createBinding:()=>l,__decorate:()=>a,__exportStar:()=>d,__extends:()=>i,__generator:()=>p,__importDefault:()=>_,__importStar:()=>w,__makeTemplateObject:()=>b,__metadata:()=>u,__param:()=>c,__read:()=>y,__rest:()=>s,__spread:()=>g,__spreadArray:()=>v,__spreadArrays:()=>m,__values:()=>f});var 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)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},o(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,o=arguments.length;n=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s}function c(t,e){return function(n,o){e(n,o,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function h(t,e,n,o){return new(n||(n=Promise))((function(i,r){function s(t){try{c(o.next(t))}catch(t){r(t)}}function a(t){try{c(o.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))}function p(t,e){var n,o,i,r,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,o&&(i=2&r[0]?o.return:r[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,o=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function g(){for(var t=[],e=0;e1||a(t,e)}))})}function a(t,e){try{(n=i[t](e)).value instanceof P?Promise.resolve(n.value.v).then(c,u):h(r[0][2],n)}catch(t){h(r[0][3],t)}var n}function c(t){a("next",t)}function u(t){a("throw",t)}function h(t,e){t(e),r.shift(),r.length&&a(r[0][0],r[0][1])}}function S(t){var e,n;return e={},o("next"),o("throw",(function(t){throw t})),o("return"),e[Symbol.iterator]=function(){return this},e;function o(o,i){e[o]=t[o]?function(e){return(n=!n)?{value:P(t[o](e)),done:"return"===o}:i?i(e):e}:i}}function x(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=f(t),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,i){(function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)})(o,i,(e=t[n](e)).done,e.value)}))}}}function b(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var I=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function w(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&l(e,t,n);return I(e,t),e}function _(t){return t&&t.__esModule?t:{default:t}}function T(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function O(t,e,n,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,n):i?i.value=n:e.set(t,n),n}}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var r=e[o]={exports:{}};return t[o].call(r.exports,r,r.exports,n),r.exports}return n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n(3607)})()));