0||i>0||null!=o){var h=this.getModel(),u=t+n,d=e+i;if(null==s&&null==(s=this.getCurrentRoot())&&(s=h.getRoot()),null!=s)for(var p=h.getChildCount(s),m=0;m=t&&y.y+y.height<=d&&y.y>=e&&y.x+y.width<=u;f&&r.push(c),f&&!a||this.getCells(t,e,n,i,c,r,o,l,a)}}}return r},mxGraph.prototype.getCellsBeyond=function(t,e,n,i,s){var r=[];if((i||s)&&(null==n&&(n=this.getDefaultParent()),null!=n))for(var o=this.model.getChildCount(n),l=0;l=t)&&(!s||h.y>=e)&&r.push(a)}return r},mxGraph.prototype.findTreeRoots=function(t,e,n){e=null!=e&&e,n=null!=n&&n;var i=[];if(null!=t){for(var s=this.getModel(),r=s.getChildCount(t),o=null,l=0,a=0;a0||!n&&0==p&&d>0)&&i.push(h);var c=n?p-d:d-p;c>l&&(l=c,o=h)}}0==i.length&&null!=o&&i.push(o)}return i},mxGraph.prototype.traverse=function(t,e,n,i,s,r){if(null!=n&&null!=t&&(e=null==e||e,r=null!=r&&r,!(s=s||new mxDictionary).get(t))){s.put(t,!0);var o=n(t,i);if(null==o||o){var l=this.model.getEdgeCount(t);if(l>0)for(var a=0;a0?i.cells[0]:null;i.cells.length>1&&i.clear();var r=null!=s?this.model.getParent(s):this.getDefaultParent(),o=this.model.getChildCount(r);if(null==s&&o>0){var l=this.model.getChildAt(r,0);this.setSelectionCell(l)}else if(null!=s&&!e||null==this.view.getState(r)||null==this.model.getGeometry(r)){if(null!=s&&n){if(this.model.getChildCount(s)>0){l=this.model.getChildAt(s,0);this.setSelectionCell(l)}}else if(o>0){var a=r.getIndex(s);if(t){a++;l=this.model.getChildAt(r,a%o);this.setSelectionCell(l)}else{var h=--a<0?o-1:a;l=this.model.getChildAt(r,h);this.setSelectionCell(l)}}}else this.getCurrentRoot()!=r&&this.setSelectionCell(r)},mxGraph.prototype.selectAll=function(t,e){t=t||this.getDefaultParent();var n=e?this.model.filterDescendants(mxUtils.bind(this,(function(e){return e!=t&&null!=this.view.getState(e)})),t):this.model.getChildren(t);null!=n&&this.setSelectionCells(n)},mxGraph.prototype.selectVertices=function(t,e){this.selectCells(!0,!1,t,e)},mxGraph.prototype.selectEdges=function(t){this.selectCells(!1,!0,t)},mxGraph.prototype.selectCells=function(t,e,n,i){n=n||this.getDefaultParent();var s=mxUtils.bind(this,(function(n){return null!=this.view.getState(n)&&((i||0==this.model.getChildCount(n))&&this.model.isVertex(n)&&t&&!this.model.isEdge(this.model.getParent(n))||this.model.isEdge(n)&&e)})),r=this.model.filterDescendants(s,n);null!=r&&this.setSelectionCells(r)},mxGraph.prototype.selectCellForEvent=function(t,e){var n=this.isCellSelected(t);this.isToggleEvent(e)?n?this.removeSelectionCell(t):this.addSelectionCell(t):n&&1==this.getSelectionCount()||this.setSelectionCell(t)},mxGraph.prototype.selectCellsForEvent=function(t,e){this.isToggleEvent(e)?this.addSelectionCells(t):this.setSelectionCells(t)},mxGraph.prototype.createHandler=function(t){var e=null;if(null!=t)if(this.model.isEdge(t.cell)){var n=t.getVisibleTerminalState(!0),i=t.getVisibleTerminalState(!1),s=this.getCellGeometry(t.cell),r=this.view.getEdgeStyle(t,null!=s?s.points:null,n,i);e=this.createEdgeHandler(t,r)}else e=this.createVertexHandler(t);return e},mxGraph.prototype.createVertexHandler=function(t){return new mxVertexHandler(t)},mxGraph.prototype.createEdgeHandler=function(t,e){return e==mxEdgeStyle.Loop||e==mxEdgeStyle.ElbowConnector||e==mxEdgeStyle.SideToSide||e==mxEdgeStyle.TopToBottom?this.createElbowEdgeHandler(t):e==mxEdgeStyle.SegmentConnector||e==mxEdgeStyle.OrthConnector?this.createEdgeSegmentHandler(t):new mxEdgeHandler(t)},mxGraph.prototype.createEdgeSegmentHandler=function(t){return new mxEdgeSegmentHandler(t)},mxGraph.prototype.createElbowEdgeHandler=function(t){return new mxElbowEdgeHandler(t)},mxGraph.prototype.addMouseListener=function(t){null==this.mouseListeners&&(this.mouseListeners=[]),this.mouseListeners.push(t)},mxGraph.prototype.removeMouseListener=function(t){if(null!=this.mouseListeners)for(var e=0;e0){this.outline.getView().scale!=p&&(this.outline.getView().scale=p,t=!0);var m=this.outline.getView();m.currentRoot!=this.source.getView().currentRoot&&m.setCurrentRoot(this.source.getView().currentRoot);var c=this.source.view.translate,g=c.x+this.source.panDx,x=c.y+this.source.panDy,y=this.getOutlineOffset(p);null!=y&&(g+=y.x,x+=y.y),i.x<0&&(g-=i.x),i.y<0&&(x-=i.y),m.translate.x==g&&m.translate.y==x||(m.translate.x=g,m.translate.y=x,t=!0);var f=m.translate,v=(p=this.source.getView().scale)/m.scale,C=1/m.scale,E=this.source.container;this.bounds=new mxRectangle((f.x-c.x-this.source.panDx)/C,(f.y-c.y-this.source.panDy)/C,E.clientWidth/v,E.clientHeight/v),this.bounds.x+=this.source.container.scrollLeft*m.scale/p,this.bounds.y+=this.source.container.scrollTop*m.scale/p,(S=this.selectionBorder.bounds).x==this.bounds.x&&S.y==this.bounds.y&&S.width==this.bounds.width&&S.height==this.bounds.height||(this.selectionBorder.bounds=this.bounds,this.selectionBorder.redraw());var S=this.sizer.bounds,b=new mxRectangle(this.bounds.x+this.bounds.width-S.width/2,this.bounds.y+this.bounds.height-S.height/2,S.width,S.height);S.x==b.x&&S.y==b.y&&S.width==b.width&&S.height==b.height||(this.sizer.bounds=b,"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw()),t&&this.outline.view.revalidate()}}},mxOutline.prototype.mouseDown=function(t,e){if(this.enabled&&this.showViewport){var n=mxEvent.isMouseEvent(e.getEvent())?0:this.source.tolerance,i=this.source.allowHandleBoundsCheck&&(mxClient.IS_IE||n>0)?new mxRectangle(e.getGraphX()-n,e.getGraphY()-n,2*n,2*n):null;this.zoom=e.isSource(this.sizer)||null!=i&&mxUtils.intersects(shape.bounds,i),this.startX=e.getX(),this.startY=e.getY(),this.active=!0,this.source.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.source.container)?(this.dx0=this.source.container.scrollLeft,this.dy0=this.source.container.scrollTop):(this.dx0=0,this.dy0=0)}e.consume()},mxOutline.prototype.mouseMove=function(t,e){if(this.active){this.selectionBorder.node.style.display=this.showViewport?"":"none",this.sizer.node.style.display=this.selectionBorder.node.style.display;var n=this.getTranslateForEvent(e),i=n.x,s=n.y,r=null;if(this.zoom){var o=this.source.container;s=i/(o.clientWidth/o.clientHeight),r=new mxRectangle(this.bounds.x,this.bounds.y,Math.max(1,this.bounds.width+i),Math.max(1,this.bounds.height+s)),this.selectionBorder.bounds=r,this.selectionBorder.redraw()}else{var l=this.outline.getView().scale;r=new mxRectangle(this.bounds.x+i,this.bounds.y+s,this.bounds.width,this.bounds.height),this.selectionBorder.bounds=r,this.selectionBorder.redraw(),i/=l,i*=this.source.getView().scale,s/=l,s*=this.source.getView().scale,this.source.panGraph(-i-this.dx0,-s-this.dy0)}var a=this.sizer.bounds;this.sizer.bounds=new mxRectangle(r.x+r.width-a.width/2,r.y+r.height-a.height/2,a.width,a.height),"hidden"!=this.sizer.node.style.visibility&&this.sizer.redraw(),e.consume()}},mxOutline.prototype.getTranslateForEvent=function(t){return new mxPoint(t.getX()-this.startX,t.getY()-this.startY)},mxOutline.prototype.mouseUp=function(t,e){if(this.active){var n=this.getTranslateForEvent(e),i=n.x,s=n.y;if(Math.abs(i)>0||Math.abs(s)>0){if(this.zoom){var r=this.selectionBorder.bounds.width,o=this.source.getView().scale;this.source.zoomTo(Math.max(this.minScale,o-i*o/r),!1)}else if(!this.source.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.source.container)){this.source.panGraph(0,0),i/=this.outline.getView().scale,s/=this.outline.getView().scale;var l=this.source.getView().translate;this.source.getView().setTranslate(l.x-i,l.y-s)}this.update(),e.consume()}this.index=null,this.active=!1}},mxOutline.prototype.destroy=function(){null!=this.source&&(this.source.removeListener(this.panHandler),this.source.removeListener(this.refreshHandler),this.source.getModel().removeListener(this.updateHandler),this.source.getView().removeListener(this.updateHandler),mxEvent.removeListener(this.source.container,"scroll",this.updateHandler),this.source=null),null!=this.outline&&(this.outline.removeMouseListener(this),this.outline.destroy(),this.outline=null),null!=this.selectionBorder&&(this.selectionBorder.destroy(),this.selectionBorder=null),null!=this.sizer&&(this.sizer.destroy(),this.sizer=null)},__mxOutput.mxOutline=void 0!==mxOutline?mxOutline:void 0,mxMultiplicity.prototype.type=null,mxMultiplicity.prototype.attr=null,mxMultiplicity.prototype.value=null,mxMultiplicity.prototype.source=null,mxMultiplicity.prototype.min=null,mxMultiplicity.prototype.max=null,mxMultiplicity.prototype.validNeighbors=null,mxMultiplicity.prototype.validNeighborsAllowed=!0,mxMultiplicity.prototype.countError=null,mxMultiplicity.prototype.typeError=null,mxMultiplicity.prototype.check=function(t,e,n,i,s,r){var o="";(this.source&&this.checkTerminal(t,n,e)||!this.source&&this.checkTerminal(t,i,e))&&(null!=this.countError&&(this.source&&(0==this.max||s>=this.max)||!this.source&&(0==this.max||r>=this.max))&&(o+=this.countError+"\n"),null!=this.validNeighbors&&null!=this.typeError&&this.validNeighbors.length>0&&(this.checkNeighbors(t,e,n,i)||(o+=this.typeError+"\n")));return o.length>0?o:null},mxMultiplicity.prototype.checkNeighbors=function(t,e,n,i){for(var s=t.model.getValue(n),r=t.model.getValue(i),o=!this.validNeighborsAllowed,l=this.validNeighbors,a=0;a0){var n=this.getGraph().getModel();n.beginUpdate();try{for(var i=null,s=0;s1||null!=s.points&&s.points.length>0||null==i.getTerminal(n,!0)||null==i.getTerminal(n,!1)||this.graph.allowDanglingEdges||this.graph.isCloneEvent(e.getEvent())&&this.graph.isCellsCloneable())?this.start(n,e.getX(),e.getY()):this.delayedSelection&&(this.cell=n),this.cellWasClicked=!0,this.consumeMouseEvent(mxEvent.MOUSE_DOWN,e)}}},mxGraphHandler.prototype.getGuideStates=function(){var t=this.graph.getDefaultParent(),e=this.graph.getModel(),n=mxUtils.bind(this,(function(t){return null!=this.graph.view.getState(t)&&e.isVertex(t)&&null!=e.getGeometry(t)&&!e.getGeometry(t).relative}));return this.graph.view.getCellStates(e.filterDescendants(n,t))},mxGraphHandler.prototype.getCells=function(t){return!this.delayedSelection&&this.graph.isCellMovable(t)?[t]:this.graph.getMovableCells(this.graph.getSelectionCells())},mxGraphHandler.prototype.getPreviewBounds=function(t){var e=this.getBoundingBox(t);if(null!=e){if(e.width=Math.max(0,e.width-1),e.height=Math.max(0,e.height-1),e.width0)for(var n=this.graph.getModel(),i=0;i=2)&&e!=(this.target||r))}))}},mxGraphHandler.prototype.addStates=function(t,e){var n=this.graph.view.getState(t),i=0;if(null!=n&&null==e.get(t)){e.put(t,n),i++;for(var s=this.graph.model.getChildCount(t),r=0;r=this.cellCount&&!this.livePreviewActive&&this.allowLivePreview?this.cloning&&this.livePreviewActive||(this.livePreviewActive=!0,this.livePreviewUsed=!0):this.livePreviewUsed||null!=this.shape||(this.shape=this.createPreviewShape(this.bounds))},mxGraphHandler.prototype.mouseMove=function(t,e){var n=this.graph;if(e.isConsumed()||!n.isMouseDown||null==this.cell||null==this.first||null==this.bounds||this.suspended){if((this.isMoveEnabled()||this.isCloneEnabled())&&this.updateCursor&&!e.isConsumed()&&(null!=e.getState()||null!=e.sourceState)&&!n.isMouseDown){var i=n.getCursorForMouseEvent(e);null==i&&n.isEnabled()&&n.isCellMovable(e.getCell())&&(i=n.getModel().isEdge(e.getCell())?mxConstants.CURSOR_MOVABLE_EDGE:mxConstants.CURSOR_MOVABLE_VERTEX),null!=i&&null!=e.sourceState&&e.sourceState.setCursor(i)}}else{if(mxEvent.isMultiTouchEvent(e.getEvent()))return void this.reset();var s=this.getDelta(e),r=n.tolerance;if(null!=this.shape||this.livePreviewActive||Math.abs(s.x)>r||Math.abs(s.y)>r){null==this.highlight&&(this.highlight=new mxCellHighlight(this.graph,mxConstants.DROP_TARGET_COLOR,3));var o=n.isCloneEvent(e.getEvent())&&n.isCellsCloneable()&&this.isCloneEnabled(),l=n.isGridEnabledEvent(e.getEvent()),a=e.getCell(),h=!0,u=null;this.cloning=o,n.isDropEnabled()&&this.highlightEnabled&&(u=n.getDropTarget(this.cells,e.getEvent(),a,o));var d=n.getView().getState(u),p=!1;if(null!=d&&(o||this.isValidDropTarget(u,e)))this.target!=u&&(this.target=u,this.setHighlightColor(mxConstants.DROP_TARGET_COLOR)),p=!0;else if(this.target=null,this.connectOnDrop&&null!=a&&1==this.cells.length&&n.getModel().isVertex(a)&&n.isCellConnectable(a)&&null!=(d=n.getView().getState(a))){var m=null==n.getEdgeValidationError(null,this.cell,a)?mxConstants.VALID_COLOR:mxConstants.INVALID_CONNECT_TARGET_COLOR;this.setHighlightColor(m),p=!0}null!=d&&p?this.highlight.highlight(d):this.highlight.hide(),null!=this.guide&&this.useGuidesForEvent(e)?(s=this.guide.move(this.bounds,s,l,o),h=!1):s=this.graph.snapDelta(s,this.bounds,!l,!1,!1),null!=this.guide&&h&&this.guide.hide(),n.isConstrainedEvent(e.getEvent())&&(Math.abs(s.x)>Math.abs(s.y)?s.y=0:s.x=0),this.checkPreview(),this.currentDx==s.x&&this.currentDy==s.y||(this.currentDx=s.x,this.currentDy=s.y,this.updatePreview())}this.updateHint(e),this.consumeMouseEvent(mxEvent.MOUSE_MOVE,e),mxEvent.consume(e.getEvent())}},mxGraphHandler.prototype.updatePreview=function(t){this.livePreviewUsed&&!t?null!=this.cells&&(this.setHandlesVisibleForCells(this.graph.selectionCellsHandler.getHandledSelectionCells(),!1),this.updateLivePreview(this.currentDx,this.currentDy)):this.updatePreviewShape()},mxGraphHandler.prototype.updatePreviewShape=function(){null!=this.shape&&null!=this.pBounds&&(this.shape.bounds=new mxRectangle(Math.round(this.pBounds.x+this.currentDx),Math.round(this.pBounds.y+this.currentDy),this.pBounds.width,this.pBounds.height),this.shape.redraw())},mxGraphHandler.prototype.updateLivePreview=function(t,e){if(!this.suspended){var n=[];if(null!=this.allCells&&this.allCells.visit(mxUtils.bind(this,(function(i,s){var r=this.graph.view.getState(s.cell);if(r!=s&&(s.destroy(),null!=r?this.allCells.put(s.cell,r):this.allCells.remove(s.cell),s=r),null!=s){var o=s.clone();n.push([s,o]),null!=s.shape&&(null==s.shape.originalPointerEvents&&(s.shape.originalPointerEvents=s.shape.pointerEvents),s.shape.pointerEvents=!1,null!=s.text&&(null==s.text.originalPointerEvents&&(s.text.originalPointerEvents=s.text.pointerEvents),s.text.pointerEvents=!1)),this.graph.model.isVertex(s.cell)&&(s.x+=t,s.y+=e,this.cloning?null!=s.text&&(s.text.updateBoundingBox(),null!=s.text.boundingBox&&(s.text.boundingBox.x+=t,s.text.boundingBox.y+=e),null!=s.text.unrotatedBoundingBox&&(s.text.unrotatedBoundingBox.x+=t,s.text.unrotatedBoundingBox.y+=e)):(s.view.graph.cellRenderer.redraw(s,!0),s.view.invalidate(s.cell),s.invalid=!1,null!=s.control&&null!=s.control.node&&(s.control.node.style.visibility="hidden")))}}))),0==n.length)this.reset();else{for(var i=this.graph.view.scale,s=0;sthis.graph.tolerance||Math.abs(this.dy)>this.graph.tolerance,!n&&this.active&&this.fireEvent(new mxEventObject(mxEvent.PAN_START,"event",e))}(this.active||this.panningTrigger)&&e.consume()},mxPanningHandler.prototype.mouseUp=function(t,e){if(this.active){if(null!=this.dx&&null!=this.dy){if(!this.graph.useScrollbarsForPanning||!mxUtils.hasScrollbars(this.graph.container)){var n=this.graph.getView().scale,i=this.graph.getView().translate;this.graph.panGraph(0,0),this.panGraph(i.x+this.dx/n,i.y+this.dy/n)}e.consume()}this.fireEvent(new mxEventObject(mxEvent.PAN_END,"event",e))}this.reset()},mxPanningHandler.prototype.zoomGraph=function(t){var e=Math.round(this.initialScale*t.scale*100)/100;null!=this.minScale&&(e=Math.max(this.minScale,e)),null!=this.maxScale&&(e=Math.min(this.maxScale,e)),this.graph.view.scale!=e&&(this.graph.zoomTo(e),mxEvent.consume(t))},mxPanningHandler.prototype.reset=function(){this.panningTrigger=!1,this.mouseDownEvent=null,this.active=!1,this.dx=null,this.dy=null},mxPanningHandler.prototype.panGraph=function(t,e){this.graph.getView().setTranslate(t,e)},mxPanningHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.forcePanningHandler),this.graph.removeListener(this.gestureHandler),mxEvent.removeListener(document,"mouseup",this.mouseUpListener)},__mxOutput.mxPanningHandler=void 0!==mxPanningHandler?mxPanningHandler:void 0,mxPopupMenuHandler.prototype=new mxPopupMenu,mxPopupMenuHandler.prototype.constructor=mxPopupMenuHandler,mxPopupMenuHandler.prototype.graph=null,mxPopupMenuHandler.prototype.selectOnPopup=!0,mxPopupMenuHandler.prototype.clearSelectionOnBackground=!0,mxPopupMenuHandler.prototype.triggerX=null,mxPopupMenuHandler.prototype.triggerY=null,mxPopupMenuHandler.prototype.screenX=null,mxPopupMenuHandler.prototype.screenY=null,mxPopupMenuHandler.prototype.init=function(){mxPopupMenu.prototype.init.apply(this),mxEvent.addGestureListeners(this.div,mxUtils.bind(this,(function(t){this.graph.tooltipHandler.hide()})))},mxPopupMenuHandler.prototype.isSelectOnPopup=function(t){return this.selectOnPopup},mxPopupMenuHandler.prototype.mouseDown=function(t,e){this.isEnabled()&&!mxEvent.isMultiTouchEvent(e.getEvent())&&(this.hideMenu(),this.triggerX=e.getGraphX(),this.triggerY=e.getGraphY(),this.screenX=mxEvent.getMainEvent(e.getEvent()).screenX,this.screenY=mxEvent.getMainEvent(e.getEvent()).screenY,this.popupTrigger=this.isPopupTrigger(e),this.inTolerance=!0)},mxPopupMenuHandler.prototype.mouseMove=function(t,e){this.inTolerance&&null!=this.screenX&&null!=this.screenY&&(Math.abs(mxEvent.getMainEvent(e.getEvent()).screenX-this.screenX)>this.graph.tolerance||Math.abs(mxEvent.getMainEvent(e.getEvent()).screenY-this.screenY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxPopupMenuHandler.prototype.mouseUp=function(t,e){if(this.popupTrigger&&this.inTolerance&&null!=this.triggerX&&null!=this.triggerY){var n=this.getCellForPopupEvent(e);this.graph.isEnabled()&&this.isSelectOnPopup(e)&&null!=n&&!this.graph.isCellSelected(n)?this.graph.setSelectionCell(n):this.clearSelectionOnBackground&&null==n&&this.graph.clearSelection(),this.graph.tooltipHandler.hide();var i=mxUtils.getScrollOrigin();this.popup(e.getX()+i.x+1,e.getY()+i.y+1,n,e.getEvent()),e.consume()}this.popupTrigger=!1,this.inTolerance=!1},mxPopupMenuHandler.prototype.getCellForPopupEvent=function(t){return t.getCell()},mxPopupMenuHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),this.graph.removeListener(this.gestureHandler),mxPopupMenu.prototype.destroy.apply(this)},__mxOutput.mxPopupMenuHandler=void 0!==mxPopupMenuHandler?mxPopupMenuHandler:void 0,mxUtils.extend(mxCellMarker,mxEventSource),mxCellMarker.prototype.graph=null,mxCellMarker.prototype.enabled=!0,mxCellMarker.prototype.hotspot=mxConstants.DEFAULT_HOTSPOT,mxCellMarker.prototype.hotspotEnabled=!1,mxCellMarker.prototype.validColor=null,mxCellMarker.prototype.invalidColor=null,mxCellMarker.prototype.currentColor=null,mxCellMarker.prototype.validState=null,mxCellMarker.prototype.markedState=null,mxCellMarker.prototype.setEnabled=function(t){this.enabled=t},mxCellMarker.prototype.isEnabled=function(){return this.enabled},mxCellMarker.prototype.setHotspot=function(t){this.hotspot=t},mxCellMarker.prototype.getHotspot=function(){return this.hotspot},mxCellMarker.prototype.setHotspotEnabled=function(t){this.hotspotEnabled=t},mxCellMarker.prototype.isHotspotEnabled=function(){return this.hotspotEnabled},mxCellMarker.prototype.hasValidState=function(){return null!=this.validState},mxCellMarker.prototype.getValidState=function(){return this.validState},mxCellMarker.prototype.getMarkedState=function(){return this.markedState},mxCellMarker.prototype.reset=function(){this.validState=null,null!=this.markedState&&(this.markedState=null,this.unmark())},mxCellMarker.prototype.process=function(t){var e=null;return this.isEnabled()&&(e=this.getState(t),this.setCurrentState(e,t)),e},mxCellMarker.prototype.setCurrentState=function(t,e,n){var i=null!=t&&this.isValidState(t);n=null!=n?n:this.getMarkerColor(e.getEvent(),t,i),this.validState=i?t:null,t==this.markedState&&n==this.currentColor||(this.currentColor=n,null!=t&&null!=this.currentColor?(this.markedState=t,this.mark()):null!=this.markedState&&(this.markedState=null,this.unmark()))},mxCellMarker.prototype.markCell=function(t,e){var n=this.graph.getView().getState(t);null!=n&&(this.currentColor=null!=e?e:this.validColor,this.markedState=n,this.mark())},mxCellMarker.prototype.mark=function(){this.highlight.setHighlightColor(this.currentColor),this.highlight.highlight(this.markedState),this.fireEvent(new mxEventObject(mxEvent.MARK,"state",this.markedState))},mxCellMarker.prototype.unmark=function(){this.mark()},mxCellMarker.prototype.isValidState=function(t){return!0},mxCellMarker.prototype.getMarkerColor=function(t,e,n){return n?this.validColor:this.invalidColor},mxCellMarker.prototype.getState=function(t){var e=this.graph.getView(),n=this.getCell(t),i=this.getStateToMark(e.getState(n));return null!=i&&this.intersects(i,t)?i:null},mxCellMarker.prototype.getCell=function(t){return t.getCell()},mxCellMarker.prototype.getStateToMark=function(t){return t},mxCellMarker.prototype.intersects=function(t,e){return!this.hotspotEnabled||mxUtils.intersectsHotspot(t,e.getGraphX(),e.getGraphY(),this.hotspot,mxConstants.MIN_HOTSPOT_SIZE,mxConstants.MAX_HOTSPOT_SIZE)},mxCellMarker.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getModel().removeListener(this.resetHandler),this.highlight.destroy()},__mxOutput.mxCellMarker=void 0!==mxCellMarker?mxCellMarker:void 0,mxUtils.extend(mxSelectionCellsHandler,mxEventSource),mxSelectionCellsHandler.prototype.graph=null,mxSelectionCellsHandler.prototype.enabled=!0,mxSelectionCellsHandler.prototype.refreshHandler=null,mxSelectionCellsHandler.prototype.maxHandlers=100,mxSelectionCellsHandler.prototype.handlers=null,mxSelectionCellsHandler.prototype.isEnabled=function(){return this.enabled},mxSelectionCellsHandler.prototype.setEnabled=function(t){this.enabled=t},mxSelectionCellsHandler.prototype.getHandler=function(t){return this.handlers.get(t)},mxSelectionCellsHandler.prototype.isHandled=function(t){return null!=this.getHandler(t)},mxSelectionCellsHandler.prototype.reset=function(){this.handlers.visit((function(t,e){e.reset.apply(e)}))},mxSelectionCellsHandler.prototype.getHandledSelectionCells=function(){return this.graph.getSelectionCells()},mxSelectionCellsHandler.prototype.refresh=function(){var t=this.handlers;this.handlers=new mxDictionary;for(var e=mxUtils.sortCells(this.getHandledSelectionCells(),!1),n=0;nthis.graph.tolerance||Math.abs(e.getGraphY()-this.first.y)>this.graph.tolerance)&&this.updateCurrentState(e,r),null!=this.first){var o=null,l=r;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint?(o=this.constraintHandler.currentConstraint,l=this.constraintHandler.currentPoint.clone()):null!=this.previous&&!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&(Math.abs(this.previous.getCenterX()-r.x)0?this.waypoints[0]:l;null!=(c=this.getSourcePerimeterPoint(this.previous,m,e))&&(a=c)}}if(null==this.currentState&&this.movePreviewAway){var c=a;if(null!=this.edgeState&&this.edgeState.absolutePoints.length>=2){var g=this.edgeState.absolutePoints[this.edgeState.absolutePoints.length-2];null!=g&&(c=g)}var x=l.x-c.x,y=l.y-c.y,f=Math.sqrt(x*x+y*y);if(0==f)return;this.originalPoint=l.clone(),l.x-=4*x/f,l.y-=4*y/f}else this.originalPoint=null;if(null==this.shape){x=Math.abs(e.getGraphX()-this.first.x),y=Math.abs(e.getGraphY()-this.first.y);(x>this.graph.tolerance||y>this.graph.tolerance)&&(this.shape=this.createShape(),null!=this.edgeState&&this.shape.apply(this.edgeState),this.updateCurrentState(e,r))}if(null!=this.shape){if(null!=this.edgeState)this.shape.points=this.edgeState.absolutePoints;else{var v=[a];null!=this.waypoints&&(v=v.concat(this.waypoints)),v.push(l),this.shape.points=v}this.drawPreview()}null!=this.cursor&&(this.graph.container.style.cursor=this.cursor),mxEvent.consume(e.getEvent()),e.consume()}else this.isEnabled()&&this.graph.isEnabled()?this.previous!=this.currentState&&null==this.edgeState?(this.destroyIcons(),null!=this.currentState&&null==this.error&&null==this.constraintHandler.currentConstraint&&(this.icons=this.createIcons(this.currentState),null==this.icons&&(this.currentState.setCursor(mxConstants.CURSOR_CONNECT),e.consume())),this.previous=this.currentState):this.previous!=this.currentState||null==this.currentState||null!=this.icons||this.graph.isMouseDown||e.consume():this.constraintHandler.reset();if(!this.graph.isMouseDown&&null!=this.currentState&&null!=this.icons){for(var C=!1,E=e.getSource(),S=0;S0?this.waypoints[this.waypoints.length-1]:new mxPoint(this.previous.getCenterX(),this.previous.getCenterY()),o=s(i.getPerimeterBounds(t),this.edgeState,r,!1);null!=o&&(n=o)}else n=new mxPoint(t.getCenterX(),t.getCenterY());return n},mxConnectionHandler.prototype.getSourcePerimeterPoint=function(t,e,n){var i=null,s=t.view,r=s.getPerimeterFunction(t),o=new mxPoint(t.getCenterX(),t.getCenterY());if(null!=r){var l=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),a=-l*(Math.PI/180);0!=l&&(e=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(a),Math.sin(a),o));var h=r(s.getPerimeterBounds(t),t,e,!1);null!=h&&(0!=l&&(h=mxUtils.getRotatedPoint(new mxPoint(h.x,h.y),Math.cos(-a),Math.sin(-a),o)),i=h)}else i=o;return i},mxConnectionHandler.prototype.updateIcons=function(t,e,n){},mxConnectionHandler.prototype.isStopEvent=function(t){return null!=t.getState()},mxConnectionHandler.prototype.addWaypointForEvent=function(t){var e=mxUtils.convertPoint(this.graph.container,t.getX(),t.getY()),n=Math.abs(e.x-this.first.x),i=Math.abs(e.y-this.first.y);if(null!=this.waypoints||this.mouseDownCounter>1&&(n>this.graph.tolerance||i>this.graph.tolerance)){null==this.waypoints&&(this.waypoints=[]);var s=this.graph.view.scale;e=new mxPoint(this.graph.snap(t.getGraphX()/s)*s,this.graph.snap(t.getGraphY()/s)*s);this.waypoints.push(e)}},mxConnectionHandler.prototype.checkConstraints=function(t,e){return null==t||null==e||null==t.point||null==e.point||!t.point.equals(e.point)||t.dx!=e.dx||t.dy!=e.dy||t.perimeter!=e.perimeter},mxConnectionHandler.prototype.mouseUp=function(t,e){if(!e.isConsumed()&&this.isConnecting()){if(this.waypointsEnabled&&!this.isStopEvent(e))return this.addWaypointForEvent(e),void e.consume();var n=this.sourceConstraint,i=this.constraintHandler.currentConstraint,s=null!=this.previous?this.previous.cell:null,r=null;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&null!=this.currentState&&(r=this.currentState.cell),null!=this.error||null!=s&&null!=r&&s==r&&!this.checkConstraints(n,i)?(null!=this.previous&&null!=this.marker.validState&&this.previous.cell==this.marker.validState.cell&&this.graph.selectCellForEvent(this.marker.source,e.getEvent()),null!=this.error&&this.error.length>0&&this.graph.validationAlert(this.error)):this.connect(s,r,e.getEvent(),e.getCell()),this.destroyIcons(),e.consume()}null!=this.first&&this.reset()},mxConnectionHandler.prototype.reset=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.cursor&&null!=this.graph.container&&(this.graph.container.style.cursor=""),this.destroyIcons(),this.marker.reset(),this.constraintHandler.reset(),this.originalPoint=null,this.currentPoint=null,this.edgeState=null,this.previous=null,this.error=null,this.sourceConstraint=null,this.mouseDownCounter=0,this.first=null,this.fireEvent(new mxEventObject(mxEvent.RESET))},mxConnectionHandler.prototype.drawPreview=function(){this.updatePreview(null==this.error),this.shape.redraw()},mxConnectionHandler.prototype.updatePreview=function(t){this.shape.strokewidth=this.getEdgeWidth(t),this.shape.stroke=this.getEdgeColor(t)},mxConnectionHandler.prototype.getEdgeColor=function(t){return t?mxConstants.VALID_COLOR:mxConstants.INVALID_COLOR},mxConnectionHandler.prototype.getEdgeWidth=function(t){return t?3:1},mxConnectionHandler.prototype.connect=function(t,e,n,i){if(null!=e||this.isCreateTarget(n)||this.graph.allowDanglingEdges){var s=this.graph.getModel(),r=!1,o=null;s.beginUpdate();try{if(null!=t&&null==e&&!this.graph.isIgnoreTerminalEvent(n)&&this.isCreateTarget(n)&&null!=(e=this.createTargetVertex(n,t))){if(i=this.graph.getDropTarget([e],n,i),r=!0,null!=i&&this.graph.getModel().isEdge(i))i=this.graph.getDefaultParent();else{var l=this.graph.getView().getState(i);if(null!=l)(d=s.getGeometry(e)).x-=l.origin.x,d.y-=l.origin.y}this.graph.addCell(e,i)}var a=this.graph.getDefaultParent();null!=t&&null!=e&&s.getParent(t)==s.getParent(e)&&s.getParent(s.getParent(t))!=s.getRoot()&&(a=s.getParent(t),null!=t.geometry&&t.geometry.relative&&null!=e.geometry&&e.geometry.relative&&(a=s.getParent(a)));var h=null,u=null;if(null!=this.edgeState&&(h=this.edgeState.cell.value,u=this.edgeState.cell.style),null!=(o=this.insertEdge(a,null,h,t,e,u))){this.graph.setConnectionConstraint(o,t,!0,this.sourceConstraint),this.graph.setConnectionConstraint(o,e,!1,this.constraintHandler.currentConstraint),null!=this.edgeState&&s.setGeometry(o,this.edgeState.cell.geometry);a=s.getParent(t);if(this.isInsertBefore(o,t,e,n,i)){for(var d=t;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=o.parent;)d=this.graph.model.getParent(d);null!=d&&null!=d.parent&&d.parent==o.parent&&s.add(a,o,d.parent.getIndex(d))}var p=s.getGeometry(o);if(null==p&&((p=new mxGeometry).relative=!0,s.setGeometry(o,p)),null!=this.waypoints&&this.waypoints.length>0){var m=this.graph.view.scale,c=this.graph.view.translate;p.points=[];for(var g=0;g0){var a=this.graph.view.getState(e);if(null!=a){var h=a.x/r-s.x,u=a.y/r-s.y;Math.abs(h-n.x)<=l&&(n.x=Math.round(h)),Math.abs(u-n.y)<=l&&(n.y=Math.round(u))}}}return i},mxConnectionHandler.prototype.getAlignmentTolerance=function(t){return this.graph.isGridEnabled()?this.graph.gridSize/2:this.graph.tolerance},mxConnectionHandler.prototype.createEdge=function(t,e,n,i){var s=null;if(null!=this.factoryMethod&&(s=this.factoryMethod(e,n,i)),null==s){(s=new mxCell(t||"")).setEdge(!0),s.setStyle(i);var r=new mxGeometry;r.relative=!0,s.setGeometry(r)}return s},mxConnectionHandler.prototype.destroy=function(){this.graph.removeMouseListener(this),null!=this.shape&&(this.shape.destroy(),this.shape=null),null!=this.marker&&(this.marker.destroy(),this.marker=null),null!=this.constraintHandler&&(this.constraintHandler.destroy(),this.constraintHandler=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getView().removeListener(this.changeHandler),this.changeHandler=null),null!=this.drillHandler&&(this.graph.removeListener(this.drillHandler),this.graph.getView().removeListener(this.drillHandler),this.drillHandler=null),null!=this.escapeHandler&&(this.graph.removeListener(this.escapeHandler),this.escapeHandler=null)},__mxOutput.mxConnectionHandler=void 0!==mxConnectionHandler?mxConnectionHandler:void 0,mxConstraintHandler.prototype.pointImage=new mxImage(mxClient.imageBasePath+"/point.gif",5,5),mxConstraintHandler.prototype.graph=null,mxConstraintHandler.prototype.enabled=!0,mxConstraintHandler.prototype.highlightColor=mxConstants.DEFAULT_VALID_COLOR,mxConstraintHandler.prototype.isEnabled=function(){return this.enabled},mxConstraintHandler.prototype.setEnabled=function(t){this.enabled=t},mxConstraintHandler.prototype.reset=function(){if(null!=this.focusIcons){for(var t=0;ta||Math.abs(l)>a)&&(null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(s,r),e.consume())}},mxRubberband.prototype.createShape=function(){null==this.sharedDiv&&(this.sharedDiv=document.createElement("div"),this.sharedDiv.className="mxRubberband",mxUtils.setOpacity(this.sharedDiv,this.defaultOpacity)),this.graph.container.appendChild(this.sharedDiv);var t=this.sharedDiv;return mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut&&(this.sharedDiv=null),t},mxRubberband.prototype.isActive=function(t,e){return null!=this.div&&"none"!=this.div.style.display},mxRubberband.prototype.mouseUp=function(t,e){var n=this.isActive();this.reset(),n&&(this.execute(e.getEvent()),e.consume())},mxRubberband.prototype.execute=function(t){var e=new mxRectangle(this.x,this.y,this.width,this.height);this.graph.selectRegion(e,t)},mxRubberband.prototype.reset=function(){if(null!=this.div)if(mxClient.IS_SVG&&(!mxClient.IS_IE||document.documentMode>=10)&&this.fadeOut){var t=this.div;mxUtils.setPrefixedStyle(t.style,"transition","all 0.2s linear"),t.style.pointerEvents="none",t.style.opacity=0,window.setTimeout((function(){t.parentNode.removeChild(t)}),200)}else this.div.parentNode.removeChild(this.div);mxEvent.removeGestureListeners(document,null,this.dragHandler,this.dropHandler),this.dragHandler=null,this.dropHandler=null,this.currentX=0,this.currentY=0,this.first=null,this.div=null},mxRubberband.prototype.update=function(t,e){this.currentX=t,this.currentY=e,this.repaint()},mxRubberband.prototype.repaint=function(){if(null!=this.div){var t=this.currentX-this.graph.panDx,e=this.currentY-this.graph.panDy;this.x=Math.min(this.first.x,t),this.y=Math.min(this.first.y,e),this.width=Math.max(this.first.x,t)-this.x,this.height=Math.max(this.first.y,e)-this.y;var n=mxClient.IS_VML?this.graph.panDx:0,i=mxClient.IS_VML?this.graph.panDy:0;this.div.style.left=this.x+n+"px",this.div.style.top=this.y+i+"px",this.div.style.width=Math.max(1,this.width)+"px",this.div.style.height=Math.max(1,this.height)+"px"}},mxRubberband.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),this.graph.removeListener(this.forceRubberbandHandler),this.graph.removeListener(this.panHandler),this.reset(),null!=this.sharedDiv&&(this.sharedDiv=null))},__mxOutput.mxRubberband=void 0!==mxRubberband?mxRubberband:void 0,mxHandle.prototype.cursor="default",mxHandle.prototype.image=null,mxHandle.prototype.ignoreGrid=!1,mxHandle.prototype.getPosition=function(t){},mxHandle.prototype.setPosition=function(t,e,n){},mxHandle.prototype.execute=function(t){},mxHandle.prototype.copyStyle=function(t){this.graph.setCellStyles(t,this.state.style[t],[this.state.cell])},mxHandle.prototype.processEvent=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=new mxPoint(t.getGraphX()/e-n.x,t.getGraphY()/e-n.y);null!=this.shape&&null!=this.shape.bounds&&(i.x-=this.shape.bounds.width/e/4,i.y-=this.shape.bounds.height/e/4);var s=-mxUtils.toRadians(this.getRotation()),r=-mxUtils.toRadians(this.getTotalRotation())-s;i=this.flipPoint(this.rotatePoint(this.snapPoint(this.rotatePoint(i,s),this.ignoreGrid||!this.graph.isGridEnabledEvent(t.getEvent())),r)),this.setPosition(this.state.getPaintBounds(),i,t),this.redraw()},mxHandle.prototype.positionChanged=function(){null!=this.state.text&&this.state.text.apply(this.state),null!=this.state.shape&&this.state.shape.apply(this.state),this.graph.cellRenderer.redraw(this.state,!0)},mxHandle.prototype.getRotation=function(){return null!=this.state.shape?this.state.shape.getRotation():0},mxHandle.prototype.getTotalRotation=function(){return null!=this.state.shape?this.state.shape.getShapeRotation():0},mxHandle.prototype.init=function(){var t=this.isHtmlRequired();null!=this.image?(this.shape=new mxImageShape(new mxRectangle(0,0,this.image.width,this.image.height),this.image.src),this.shape.preserveImageAspect=!1):null==this.shape&&(this.shape=this.createShape(t)),this.initShape(t)},mxHandle.prototype.createShape=function(t){return new mxRectangleShape(new mxRectangle(0,0,mxConstants.HANDLE_SIZE,mxConstants.HANDLE_SIZE),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxHandle.prototype.initShape=function(t){t&&this.shape.isHtmlAllowed()?(this.shape.dialect=mxConstants.DIALECT_STRICTHTML,this.shape.init(this.graph.container)):(this.shape.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,null!=this.cursor&&this.shape.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(this.shape.node,this.graph,this.state),this.shape.node.style.cursor=this.cursor},mxHandle.prototype.redraw=function(){if(null!=this.shape&&null!=this.state.shape){var t=this.getPosition(this.state.getPaintBounds());if(null!=t){var e=mxUtils.toRadians(this.getTotalRotation());t=this.rotatePoint(this.flipPoint(t),e);var n=this.graph.view.scale,i=this.graph.view.translate;this.shape.bounds.x=Math.floor((t.x+i.x)*n-this.shape.bounds.width/2),this.shape.bounds.y=Math.floor((t.y+i.y)*n-this.shape.bounds.height/2),this.shape.redraw()}}},mxHandle.prototype.isHtmlRequired=function(){return null!=this.state.text&&this.state.text.node.parentNode==this.graph.container},mxHandle.prototype.rotatePoint=function(t,e){var n=this.state.getCellBounds(),i=new mxPoint(n.getCenterX(),n.getCenterY()),s=Math.cos(e),r=Math.sin(e);return mxUtils.getRotatedPoint(t,s,r,i)},mxHandle.prototype.flipPoint=function(t){if(null!=this.state.shape){var e=this.state.getCellBounds();this.state.shape.flipH&&(t.x=2*e.x+e.width-t.x),this.state.shape.flipV&&(t.y=2*e.y+e.height-t.y)}return t},mxHandle.prototype.snapPoint=function(t,e){return e||(t.x=this.graph.snap(t.x),t.y=this.graph.snap(t.y)),t},mxHandle.prototype.setVisible=function(t){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display=t?"":"none")},mxHandle.prototype.reset=function(){this.setVisible(!0),this.state.style=this.graph.getCellStyle(this.state.cell),this.positionChanged()},mxHandle.prototype.destroy=function(){null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxHandle=void 0!==mxHandle?mxHandle:void 0,mxVertexHandler.prototype.graph=null,mxVertexHandler.prototype.state=null,mxVertexHandler.prototype.singleSizer=!1,mxVertexHandler.prototype.index=null,mxVertexHandler.prototype.allowHandleBoundsCheck=!0,mxVertexHandler.prototype.handleImage=null,mxVertexHandler.prototype.handlesVisible=!0,mxVertexHandler.prototype.tolerance=0,mxVertexHandler.prototype.rotationEnabled=!1,mxVertexHandler.prototype.parentHighlightEnabled=!1,mxVertexHandler.prototype.rotationRaster=!0,mxVertexHandler.prototype.rotationCursor="crosshair",mxVertexHandler.prototype.livePreview=!1,mxVertexHandler.prototype.movePreviewToFront=!1,mxVertexHandler.prototype.manageSizers=!1,mxVertexHandler.prototype.constrainGroupByChildren=!1,mxVertexHandler.prototype.rotationHandleVSpacing=-16,mxVertexHandler.prototype.horizontalOffset=0,mxVertexHandler.prototype.verticalOffset=0,mxVertexHandler.prototype.init=function(){if(this.graph=this.state.view.graph,this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.selectionBorder=this.createSelectionShape(this.bounds),this.selectionBorder.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.selectionBorder.pointerEvents=!1,this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.selectionBorder.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(this.selectionBorder.node,this.graph,this.state),this.graph.isCellMovable(this.state.cell)&&this.selectionBorder.setCursor(mxConstants.CURSOR_MOVABLE_VERTEX),mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()=2&&this.state.height>=2){var e=0;t&&(this.singleSizer||(this.sizers.push(this.createSizer("nw-resize",e++)),this.sizers.push(this.createSizer("n-resize",e++)),this.sizers.push(this.createSizer("ne-resize",e++)),this.sizers.push(this.createSizer("w-resize",e++)),this.sizers.push(this.createSizer("e-resize",e++)),this.sizers.push(this.createSizer("sw-resize",e++)),this.sizers.push(this.createSizer("s-resize",e++))),this.sizers.push(this.createSizer("se-resize",e++)));var n=this.graph.model.getGeometry(this.state.cell);null==n||n.relative||this.graph.isSwimlane(this.state.cell)||!this.graph.isLabelMovable(this.state.cell)||(this.labelShape=this.createSizer(mxConstants.CURSOR_LABEL_HANDLE,mxEvent.LABEL_HANDLE,mxConstants.LABEL_HANDLE_SIZE,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}else this.graph.isCellMovable(this.state.cell)&&!this.graph.isCellResizable(this.state.cell)&&this.state.width<2&&this.state.height<2&&(this.labelShape=this.createSizer(mxConstants.CURSOR_MOVABLE_VERTEX,mxEvent.LABEL_HANDLE,null,mxConstants.LABEL_HANDLE_FILLCOLOR),this.sizers.push(this.labelShape))}this.isRotationHandleVisible()&&(this.rotationShape=this.createSizer(this.rotationCursor,mxEvent.ROTATION_HANDLE,mxConstants.HANDLE_SIZE+3,mxConstants.HANDLE_FILLCOLOR),this.sizers.push(this.rotationShape)),this.customHandles=this.createCustomHandles(),this.redraw(),this.constrainGroupByChildren&&this.updateMinBounds()},mxVertexHandler.prototype.isRotationHandleVisible=function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(mxGraphHandler.prototype.maxCells<=0||this.graph.getSelectionCount()0&&(this.minBounds=this.graph.view.getBounds(t),null!=this.minBounds)){var e=this.state.view.scale,n=this.state.view.translate;this.minBounds.x-=this.state.x,this.minBounds.y-=this.state.y,this.minBounds.x/=e,this.minBounds.y/=e,this.minBounds.width/=e,this.minBounds.height/=e,this.x0=this.state.x/e-n.x,this.y0=this.state.y/e-n.y}},mxVertexHandler.prototype.getSelectionBounds=function(t){return new mxRectangle(Math.round(t.x),Math.round(t.y),Math.round(t.width),Math.round(t.height))},mxVertexHandler.prototype.createParentHighlightShape=function(t){return this.createSelectionShape(t)},mxVertexHandler.prototype.createSelectionShape=function(t){var e=new mxRectangleShape(mxRectangle.fromRectangle(t),null,this.getSelectionColor());return e.strokewidth=this.getSelectionStrokeWidth(),e.isDashed=this.isSelectionDashed(),e},mxVertexHandler.prototype.getSelectionColor=function(){return mxConstants.VERTEX_SELECTION_COLOR},mxVertexHandler.prototype.getSelectionStrokeWidth=function(){return mxConstants.VERTEX_SELECTION_STROKEWIDTH},mxVertexHandler.prototype.isSelectionDashed=function(){return mxConstants.VERTEX_SELECTION_DASHED},mxVertexHandler.prototype.createSizer=function(t,e,n,i){var s=new mxRectangle(0,0,n=n||mxConstants.HANDLE_SIZE,n),r=this.createSizerShape(s,e,i);return r.isHtmlAllowed()&&null!=this.state.text&&this.state.text.node.parentNode==this.graph.container?(r.bounds.height-=1,r.bounds.width-=1,r.dialect=mxConstants.DIALECT_STRICTHTML,r.init(this.graph.container)):(r.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_MIXEDHTML:mxConstants.DIALECT_SVG,r.init(this.graph.getView().getOverlayPane())),mxEvent.redirectMouseEvents(r.node,this.graph,this.state),this.graph.isEnabled()&&r.setCursor(t),this.isSizerVisible(e)||(r.visible=!1),r},mxVertexHandler.prototype.isSizerVisible=function(t){return!0},mxVertexHandler.prototype.createSizerShape=function(t,e,n){if(null!=this.handleImage){var i=new mxImageShape(t=new mxRectangle(t.x,t.y,this.handleImage.width,this.handleImage.height),this.handleImage.src);return i.preserveImageAspect=!1,i}return e==mxEvent.ROTATION_HANDLE?new mxEllipse(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR):new mxRectangleShape(t,n||mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)},mxVertexHandler.prototype.moveSizerTo=function(t,e,n){null!=t&&(t.bounds.x=Math.floor(e-t.bounds.width/2),t.bounds.y=Math.floor(n-t.bounds.height/2),null!=t.node&&"none"!=t.node.style.display&&t.redraw())},mxVertexHandler.prototype.getHandleForEvent=function(t){var e=mxEvent.isMouseEvent(t.getEvent())?1:this.tolerance,n=this.allowHandleBoundsCheck&&(mxClient.IS_IE||e>0)?new mxRectangle(t.getGraphX()-e,t.getGraphY()-e,2*e,2*e):null,i=mxUtils.bind(this,(function(e){var i=null!=e&&e.constructor!=mxImageShape&&this.allowHandleBoundsCheck?e.strokewidth+e.svgStrokeTolerance:null,s=null!=i?new mxRectangle(t.getGraphX()-Math.floor(i/2),t.getGraphY()-Math.floor(i/2),i,i):n;return null!=e&&(t.isSource(e)||null!=s&&mxUtils.intersects(e.bounds,s)&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility)}));if(i(this.rotationShape))return mxEvent.ROTATION_HANDLE;if(i(this.labelShape))return mxEvent.LABEL_HANDLE;if(null!=this.sizers)for(var s=0;s=0;s--)if(i(this.customHandles[s].shape))return mxEvent.CUSTOM_HANDLE-s;return null},mxVertexHandler.prototype.isCustomHandleEvent=function(t){return!0},mxVertexHandler.prototype.mouseDown=function(t,e){if(!e.isConsumed()&&this.graph.isEnabled()){var n=this.getHandleForEvent(e);null!=n&&(this.start(e.getGraphX(),e.getGraphY(),n),e.consume())}},mxVertexHandler.prototype.isLivePreviewBorder=function(){return null!=this.state.shape&&null==this.state.shape.fill&&null==this.state.shape.stroke},mxVertexHandler.prototype.start=function(t,e,n){if(null!=this.selectionBorder)if(this.livePreviewActive=this.livePreview&&0==this.graph.model.getChildCount(this.state.cell),this.inTolerance=!0,this.childOffsetX=0,this.childOffsetY=0,this.index=n,this.startX=t,this.startY=e,this.index<=mxEvent.CUSTOM_HANDLE&&this.isGhostPreview())this.ghostPreview=this.createGhostPreview();else{var i=this.state.view.graph.model,s=i.getParent(this.state.cell);if(this.state.view.currentRoot!=s&&(i.isVertex(s)||i.isEdge(s))&&(this.parentState=this.state.view.graph.view.getState(s)),this.selectionBorder.node.style.display=n==mxEvent.ROTATION_HANDLE?"inline":"none",this.livePreviewActive&&!this.isLivePreviewBorder()||(this.preview=this.createSelectionShape(this.bounds),mxClient.IS_SVG&&0!=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")||null==this.state.text||this.state.text.node.parentNode!=this.graph.container?(this.preview.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,this.preview.init(this.graph.view.getOverlayPane())):(this.preview.dialect=mxConstants.DIALECT_STRICTHTML,this.preview.init(this.graph.container))),n==mxEvent.ROTATION_HANDLE){var r=this.getRotationHandlePosition(),o=r.x-this.state.getCenterX(),l=r.y-this.state.getCenterY();this.startAngle=0!=o?180*Math.atan(l/o)/Math.PI+90:0,this.startDist=Math.sqrt(o*o+l*l)}if(this.livePreviewActive){this.hideSizers(),n==mxEvent.ROTATION_HANDLE?this.rotationShape.node.style.display="":n==mxEvent.LABEL_HANDLE?this.labelShape.node.style.display="":null!=this.sizers&&null!=this.sizers[n]?this.sizers[n].node.style.display="":n<=mxEvent.CUSTOM_HANDLE&&null!=this.customHandles&&this.customHandles[mxEvent.CUSTOM_HANDLE-n].setVisible(!0);var a=this.graph.getEdges(this.state.cell);this.edgeHandlers=[];for(var h=0;hthis.graph.tolerance||Math.abs(t.getGraphY()-this.startY)>this.graph.tolerance)&&(this.inTolerance=!1)},mxVertexHandler.prototype.updateHint=function(t){},mxVertexHandler.prototype.removeHint=function(){},mxVertexHandler.prototype.roundAngle=function(t){return Math.round(10*t)/10},mxVertexHandler.prototype.roundLength=function(t){return Math.round(100*t)/100},mxVertexHandler.prototype.mouseMove=function(t,e){e.isConsumed()||null==this.index?this.graph.isMouseDown||null==this.getHandleForEvent(e)||e.consume(!1):(this.checkTolerance(e),this.inTolerance||(this.index<=mxEvent.CUSTOM_HANDLE?null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].active=!0,null!=this.ghostPreview?(this.ghostPreview.apply(this.state),this.ghostPreview.strokewidth=this.getSelectionStrokeWidth()/this.ghostPreview.scale/this.ghostPreview.scale,this.ghostPreview.isDashed=this.isSelectionDashed(),this.ghostPreview.stroke=this.getSelectionColor(),this.ghostPreview.redraw(),null!=this.selectionBounds&&(this.selectionBorder.node.style.display="none")):(this.movePreviewToFront&&this.moveToFront(),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged())):this.index==mxEvent.LABEL_HANDLE?this.moveLabel(e):(this.index==mxEvent.ROTATION_HANDLE?this.rotateVertex(e):this.resizeVertex(e),this.updateHint(e))),e.consume())},mxVertexHandler.prototype.isGhostPreview=function(){return this.state.view.graph.model.getChildCount(this.state.cell)>0},mxVertexHandler.prototype.moveLabel=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.graph.view.translate,i=this.graph.view.scale;this.graph.isGridEnabledEvent(t.getEvent())&&(e.x=(this.graph.snap(e.x/i-n.x)+n.x)*i,e.y=(this.graph.snap(e.y/i-n.y)+n.y)*i);var s=null!=this.rotationShape?this.sizers.length-2:this.sizers.length-1;this.moveSizerTo(this.sizers[s],e.x,e.y)},mxVertexHandler.prototype.rotateVertex=function(t){var e=new mxPoint(t.getGraphX(),t.getGraphY()),n=this.state.x+this.state.width/2-e.x,i=this.state.y+this.state.height/2-e.y;if(this.currentAlpha=0!=n?180*Math.atan(i/n)/Math.PI+90:i<0?180:0,n>0&&(this.currentAlpha-=180),this.currentAlpha-=this.startAngle,this.rotationRaster&&this.graph.isGridEnabledEvent(t.getEvent())){n=e.x-this.state.getCenterX(),i=e.y-this.state.getCenterY();var s=Math.sqrt(n*n+i*i);s-this.startDist<2?raster=15:s-this.startDist<25?raster=5:raster=1,this.currentAlpha=Math.round(this.currentAlpha/raster)*raster}else this.currentAlpha=this.roundAngle(this.currentAlpha);this.selectionBorder.rotation=this.currentAlpha,this.selectionBorder.redraw(),this.livePreviewActive&&this.redrawHandles()},mxVertexHandler.prototype.resizeVertex=function(t){var e=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),n=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),i=new mxPoint(t.getGraphX(),t.getGraphY()),s=this.graph.view.translate,r=this.graph.view.scale,o=Math.cos(-n),l=Math.sin(-n),a=l*(c=i.x-this.startX)+o*(g=i.y-this.startY);c=o*c-l*g,g=a;var h=this.graph.getCellGeometry(this.state.cell);if(this.unscaledBounds=this.union(h,c/r,g/r,this.index,this.graph.isGridEnabledEvent(t.getEvent()),1,new mxPoint(0,0),this.isConstrainedEvent(t),this.isCenteredEvent(this.state,t)),!h.relative){var u=this.graph.getMaximumGraphBounds();if(null!=u&&null!=this.parentState&&((u=mxRectangle.fromRectangle(u)).x-=(this.parentState.x-s.x*r)/r,u.y-=(this.parentState.y-s.y*r)/r),this.graph.isConstrainChild(this.state.cell)){var d=this.graph.getCellContainmentArea(this.state.cell);if(null!=d){var p=this.graph.getOverlap(this.state.cell);p>0&&((d=mxRectangle.fromRectangle(d)).x-=d.width*p,d.y-=d.height*p,d.width+=2*d.width*p,d.height+=2*d.height*p),null==u?u=d:(u=mxRectangle.fromRectangle(u)).intersect(d)}}null!=u&&(this.unscaledBounds.xu.x+u.width&&(this.unscaledBounds.width-=this.unscaledBounds.x+this.unscaledBounds.width-u.x-u.width),this.unscaledBounds.y+this.unscaledBounds.height>u.y+u.height&&(this.unscaledBounds.height-=this.unscaledBounds.y+this.unscaledBounds.height-u.y-u.height))}var m=this.bounds;this.bounds=new mxRectangle((null!=this.parentState?this.parentState.x:s.x*r)+this.unscaledBounds.x*r,(null!=this.parentState?this.parentState.y:s.y*r)+this.unscaledBounds.y*r,this.unscaledBounds.width*r,this.unscaledBounds.height*r),h.relative&&null!=this.parentState&&(this.bounds.x+=this.state.x-this.parentState.x,this.bounds.y+=this.state.y-this.parentState.y),o=Math.cos(n),l=Math.sin(n);var c,g,x=new mxPoint(this.bounds.getCenterX(),this.bounds.getCenterY()),y=o*(c=x.x-e.x)-l*(g=x.y-e.y)-c,f=l*c+o*g-g,v=this.bounds.x-this.state.x,C=this.bounds.y-this.state.y,E=o*v-l*C,S=l*v+o*C;this.bounds.x+=y,this.bounds.y+=f,this.unscaledBounds.x=this.roundLength(this.unscaledBounds.x+y/r),this.unscaledBounds.y=this.roundLength(this.unscaledBounds.y+f/r),this.unscaledBounds.width=this.roundLength(this.unscaledBounds.width),this.unscaledBounds.height=this.roundLength(this.unscaledBounds.height),this.graph.isCellCollapsed(this.state.cell)||0==y&&0==f?(this.childOffsetX=0,this.childOffsetY=0):(this.childOffsetX=this.state.x-this.bounds.x+E,this.childOffsetY=this.state.y-this.bounds.y+S),m.equals(this.bounds)||(this.livePreviewActive&&this.updateLivePreview(t),null!=this.preview?this.drawPreview():this.updateParentHighlight())},mxVertexHandler.prototype.updateLivePreview=function(t){var e=this.graph.view.scale,n=this.graph.view.translate,i=this.state.clone();this.state.x=this.bounds.x,this.state.y=this.bounds.y,this.state.origin=new mxPoint(this.state.x/e-n.x,this.state.y/e-n.y),this.state.width=this.bounds.width,this.state.height=this.bounds.height;var s=this.state.absoluteOffset;s=new mxPoint(s.x,s.y),this.state.absoluteOffset.x=0,this.state.absoluteOffset.y=0;var r=this.graph.getCellGeometry(this.state.cell);if(null!=r){var o=r.offset||this.EMPTY_POINT;null==o||r.relative||(this.state.absoluteOffset.x=this.state.view.scale*o.x,this.state.absoluteOffset.y=this.state.view.scale*o.y),this.state.view.updateVertexLabelOffset(this.state)}this.state.view.graph.cellRenderer.redraw(this.state,!0),this.state.view.invalidate(this.state.cell),this.state.invalid=!1,this.state.view.validate(),this.redrawHandles(),this.movePreviewToFront&&this.moveToFront(),null!=this.state.control&&null!=this.state.control.node&&(this.state.control.node.style.visibility="hidden"),this.state.setState(i)},mxVertexHandler.prototype.moveToFront=function(){(null!=this.state.text&&null!=this.state.text.node&&null!=this.state.text.node.nextSibling||null!=this.state.shape&&null!=this.state.shape.node&&null!=this.state.shape.node.nextSibling&&(null==this.state.text||this.state.shape.node.nextSibling!=this.state.text.node))&&(null!=this.state.shape&&null!=this.state.shape.node&&this.state.shape.node.parentNode.appendChild(this.state.shape.node),null!=this.state.text&&null!=this.state.text.node&&this.state.text.node.parentNode.appendChild(this.state.text.node))},mxVertexHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.state){var n=new mxPoint(e.getGraphX(),e.getGraphY()),i=this.index;this.index=null,null==this.ghostPreview&&(this.state.view.invalidate(this.state.cell,!1,!1),this.state.view.validate()),this.graph.getModel().beginUpdate();try{if(i<=mxEvent.CUSTOM_HANDLE){if(null!=this.customHandles){var s=this.state.view.graph.getCellStyle(this.state.cell);this.customHandles[mxEvent.CUSTOM_HANDLE-i].active=!1,this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute(e),null!=this.customHandles&&null!=this.customHandles[mxEvent.CUSTOM_HANDLE-i]&&(this.state.style=s,this.customHandles[mxEvent.CUSTOM_HANDLE-i].positionChanged())}}else if(i==mxEvent.ROTATION_HANDLE)if(null!=this.currentAlpha){var r=this.currentAlpha-(this.state.style[mxConstants.STYLE_ROTATION]||0);0!=r&&this.rotateCell(this.state.cell,r)}else this.rotateClick();else{var o=this.graph.isGridEnabledEvent(e.getEvent()),l=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),a=Math.cos(-l),h=Math.sin(-l),u=n.x-this.startX,d=n.y-this.startY,p=h*u+a*d;u=a*u-h*d,d=p;var m=this.graph.view.scale,c=this.isRecursiveResize(this.state,e);this.resizeCell(this.state.cell,this.roundLength(u/m),this.roundLength(d/m),i,o,this.isConstrainedEvent(e),c)}}finally{this.graph.getModel().endUpdate()}e.consume(),this.reset(),this.redrawHandles()}},mxVertexHandler.prototype.isRecursiveResize=function(t,e){return this.graph.isRecursiveResize(this.state)},mxVertexHandler.prototype.rotateClick=function(){},mxVertexHandler.prototype.rotateCell=function(t,e,n){if(0!=e){var i=this.graph.getModel();if(i.isVertex(t)||i.isEdge(t)){if(!i.isEdge(t)){var s=(this.graph.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATION]||0)+e;this.graph.setCellStyles(mxConstants.STYLE_ROTATION,s,[t])}var r=this.graph.getCellGeometry(t);if(null!=r){var o=this.graph.getCellGeometry(n);if(null==o||i.isEdge(n)||((r=r.clone()).rotate(e,new mxPoint(o.width/2,o.height/2)),i.setGeometry(t,r)),i.isVertex(t)&&!r.relative||i.isEdge(t))for(var l=i.getChildCount(t),a=0;a4?(y+=n,y=s?this.graph.snap(y/r)*r:Math.round(y/r)*r):i<3&&(x+=n,x=s?this.graph.snap(x/r)*r:Math.round(x/r)*r),0==i||3==i||5==i?(c+=e,c=s?this.graph.snap(c/r)*r:Math.round(c/r)*r):2!=i&&4!=i&&7!=i||(g+=e,g=s?this.graph.snap(g/r)*r:Math.round(g/r)*r);var C=g-c,E=y-x;if(l){var S=this.graph.getCellGeometry(this.state.cell);if(null!=S){var b=S.width/S.height;1==i||2==i||7==i||6==i?C=E*b:E=C/b,0==i&&(c=g-C,x=y-E)}}if(a){var T=f-(c+(C+=C-p)/2),w=v-(x+(E+=E-m)/2);c+=T,x+=w,g+=T,y+=w}C<0&&(c+=C,C=Math.abs(C)),E<0&&(x+=E,E=Math.abs(E));var L=new mxRectangle(c+o.x*r,x+o.y*r,C,E);return null!=this.minBounds&&(L.width=Math.max(L.width,this.minBounds.x*r+this.minBounds.width*r+Math.max(0,this.x0*r-L.x)),L.height=Math.max(L.height,this.minBounds.y*r+this.minBounds.height*r+Math.max(0,this.y0*r-L.y))),L},mxVertexHandler.prototype.redraw=function(t){this.selectionBounds=this.getSelectionBounds(this.state),this.bounds=new mxRectangle(this.selectionBounds.x,this.selectionBounds.y,this.selectionBounds.width,this.selectionBounds.height),this.drawPreview(),t||this.redrawHandles()},mxVertexHandler.prototype.getHandlePadding=function(){var t=new mxPoint(0,0),e=this.tolerance;return null!=this.sizers&&this.sizers.length>0&&null!=this.sizers[0]&&(this.bounds.width<2*this.sizers[0].bounds.width+2*e||this.bounds.height<2*this.sizers[0].bounds.height+2*e)&&(e/=2,t.x=this.sizers[0].bounds.width+e,t.y=this.sizers[0].bounds.height+e),t},mxVertexHandler.prototype.getSizerBounds=function(){return this.bounds},mxVertexHandler.prototype.redrawHandles=function(){var t=this.getSizerBounds(),e=this.tolerance;if(this.horizontalOffset=0,this.verticalOffset=0,null!=this.customHandles)for(var n=0;n0&&null!=this.sizers[0]){if(null==this.index&&this.manageSizers&&this.sizers.length>=8){var s=this.getHandlePadding();this.horizontalOffset=s.x,this.verticalOffset=s.y,0==this.horizontalOffset&&0==this.verticalOffset||((t=new mxRectangle(t.x,t.y,t.width,t.height)).x-=this.horizontalOffset/2,t.width+=this.horizontalOffset,t.y-=this.verticalOffset/2,t.height+=this.verticalOffset),this.sizers.length>=8&&(t.width<2*this.sizers[0].bounds.width+2*e||t.height<2*this.sizers[0].bounds.height+2*e?(this.sizers[0].node.style.display="none",this.sizers[2].node.style.display="none",this.sizers[5].node.style.display="none",this.sizers[7].node.style.display="none"):this.handlesVisible&&(this.sizers[0].node.style.display="",this.sizers[2].node.style.display="",this.sizers[5].node.style.display="",this.sizers[7].node.style.display=""))}var r=t.x+t.width,o=t.y+t.height;if(this.singleSizer)this.moveSizerTo(this.sizers[0],r,o);else{var l=t.x+t.width/2,a=t.y+t.height/2;if(this.sizers.length>=8){var h=["nw-resize","n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize"],u=mxUtils.toRadians(this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(u),p=Math.sin(u),m=Math.round(4*u/Math.PI),c=new mxPoint(t.getCenterX(),t.getCenterY()),g=mxUtils.getRotatedPoint(new mxPoint(t.x,t.y),d,p,c);this.moveSizerTo(this.sizers[0],g.x,g.y),this.sizers[0].setCursor(h[mxUtils.mod(0+m,h.length)]),g.x=l,g.y=t.y,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[1],g.x,g.y),this.sizers[1].setCursor(h[mxUtils.mod(1+m,h.length)]),g.x=r,g.y=t.y,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[2],g.x,g.y),this.sizers[2].setCursor(h[mxUtils.mod(2+m,h.length)]),g.x=t.x,g.y=a,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[3],g.x,g.y),this.sizers[3].setCursor(h[mxUtils.mod(7+m,h.length)]),g.x=r,g.y=a,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[4],g.x,g.y),this.sizers[4].setCursor(h[mxUtils.mod(3+m,h.length)]),g.x=t.x,g.y=o,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[5],g.x,g.y),this.sizers[5].setCursor(h[mxUtils.mod(6+m,h.length)]),g.x=l,g.y=o,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[6],g.x,g.y),this.sizers[6].setCursor(h[mxUtils.mod(5+m,h.length)]),g.x=r,g.y=o,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[7],g.x,g.y),this.sizers[7].setCursor(h[mxUtils.mod(4+m,h.length)]),g.x=l+this.state.absoluteOffset.x,g.y=a+this.state.absoluteOffset.y,g=mxUtils.getRotatedPoint(g,d,p,c),this.moveSizerTo(this.sizers[8],g.x,g.y)}else this.state.width>=2&&this.state.height>=2?this.moveSizerTo(this.sizers[0],l+this.state.absoluteOffset.x,a+this.state.absoluteOffset.y):this.moveSizerTo(this.sizers[0],this.state.x,this.state.y)}}if(null!=this.rotationShape){u=mxUtils.toRadians(null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),d=Math.cos(u),p=Math.sin(u),c=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),g=mxUtils.getRotatedPoint(this.getRotationHandlePosition(),d,p,c);null!=this.rotationShape.node&&(this.moveSizerTo(this.rotationShape,g.x,g.y),this.rotationShape.node.style.visibility=this.state.view.graph.isEditing()||!this.handlesVisible?"hidden":"")}if(null!=this.selectionBorder&&(this.selectionBorder.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0")),null!=this.edgeHandlers)for(n=0;n0)?new mxRectangle(t.getGraphX()-n,t.getGraphY()-n,2*n,2*n):null,s=null;function o(e){if(null!=e&&null!=e.node&&"none"!=e.node.style.display&&"hidden"!=e.node.style.visibility&&(t.isSource(e)||null!=i&&mxUtils.intersects(e.bounds,i))){var n=t.getGraphX()-e.bounds.getCenterX(),r=t.getGraphY()-e.bounds.getCenterY(),o=n*n+r*r;if(null==s||o<=s)return s=o,!0}return!1}if(null!=this.customHandles&&this.isCustomHandleEvent(t))for(var r=this.customHandles.length-1;r>=0;r--)if(o(this.customHandles[r].shape))return mxEvent.CUSTOM_HANDLE-r;if((t.isSource(this.state.text)||o(this.labelShape))&&(e=mxEvent.LABEL_HANDLE),null!=this.bends)for(r=0;rmxEvent.VIRTUAL_HANDLE&&null!=this.customHandles)for(var r=0;r0&&this.isSnapToTerminalsEvent(t)){function h(t){if(null!=t){var e=t.x;Math.abs(i.x-e)0&&nmxEvent.VIRTUAL_HANDLE&&(r[this.index-1]=o)}return null!=l?l:r},mxEdgeHandler.prototype.isOutlineConnectEvent=function(t){var e=mxUtils.getOffset(this.graph.container),n=t.getEvent(),i=mxEvent.getClientX(n),s=mxEvent.getClientY(n),r=document.documentElement,o=(window.pageXOffset||r.scrollLeft)-(r.clientLeft||0),l=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),a=this.currentPoint.x-this.graph.container.scrollLeft+e.x-o,h=this.currentPoint.y-this.graph.container.scrollTop+e.y-l;return this.outlineConnect&&!mxEvent.isShiftDown(t.getEvent())&&(t.isSource(this.marker.highlight.shape)||mxEvent.isAltDown(t.getEvent())&&null!=t.getState()||this.marker.highlight.isHighlightAt(i,s)||(a!=i||h!=s)&&null==t.getState()&&this.marker.highlight.isHighlightAt(a,h))},mxEdgeHandler.prototype.updatePreviewState=function(t,e,n,i,s){var r=this.isSource?n:this.state.getVisibleTerminalState(!0),o=this.isTarget?n:this.state.getVisibleTerminalState(!1),l=this.graph.getConnectionConstraint(t,r,!0),a=this.graph.getConnectionConstraint(t,o,!1),h=this.constraintHandler.currentConstraint;if(null==h&&s&&(null!=n?(i.isSource(this.marker.highlight.shape)&&(e=new mxPoint(i.getGraphX(),i.getGraphY())),h=this.graph.getOutlineConstraint(e,n,i),this.constraintHandler.setFocus(i,n,this.isSource),this.constraintHandler.currentConstraint=h,this.constraintHandler.currentPoint=e):h=new mxConnectionConstraint),this.outlineConnect&&null!=this.marker.highlight&&null!=this.marker.highlight.shape){var u=this.graph.view.scale;null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(this.marker.highlight.shape.stroke=s?mxConstants.OUTLINE_HIGHLIGHT_COLOR:"transparent",this.marker.highlight.shape.strokewidth=mxConstants.OUTLINE_HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint()):this.marker.hasValidState()&&(this.marker.highlight.shape.stroke=this.graph.isCellConnectable(i.getCell())&&this.marker.getValidState()!=i.getState()?"transparent":mxConstants.DEFAULT_VALID_COLOR,this.marker.highlight.shape.strokewidth=mxConstants.HIGHLIGHT_STROKEWIDTH/u/u,this.marker.highlight.repaint())}this.isSource?l=h:this.isTarget&&(a=h),(this.isSource||this.isTarget)&&(null!=h&&null!=h.point?(t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X]=h.point.x,t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y]=h.point.y):(delete t.style[this.isSource?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X],delete t.style[this.isSource?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y])),t.setVisibleTerminalState(r,!0),t.setVisibleTerminalState(o,!1),this.isSource&&null==r||t.view.updateFixedTerminalPoint(t,r,!0,l),this.isTarget&&null==o||t.view.updateFixedTerminalPoint(t,o,!1,a),(this.isSource||this.isTarget)&&null==n&&(t.setAbsoluteTerminalPoint(e,this.isSource),null==this.marker.getMarkedState()&&(this.error=this.graph.allowDanglingEdges?null:"")),t.view.updatePoints(t,this.points,r,o),t.view.updateFloatingTerminalPoints(t,r,o)},mxEdgeHandler.prototype.mouseMove=function(t,e){if(null!=this.index&&null!=this.marker){if(this.currentPoint=this.getPointForEvent(e),this.error=null,!this.graph.isIgnoreTerminalEvent(e.getEvent())&&mxEvent.isShiftDown(e.getEvent())&&null!=this.snapPoint&&(Math.abs(this.snapPoint.x-this.currentPoint.x)mxEvent.VIRTUAL_HANDLE)null!=this.customHandles&&(this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].processEvent(e),this.customHandles[mxEvent.CUSTOM_HANDLE-this.index].positionChanged(),null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="none"));else if(this.isLabel)this.label.x=this.currentPoint.x,this.label.y=this.currentPoint.y;else{this.points=this.getPreviewPoints(this.currentPoint,e);var n=this.isSource||this.isTarget?this.getPreviewTerminalState(e):null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&null!=this.constraintHandler.currentPoint)this.currentPoint=this.constraintHandler.currentPoint.clone();else if(this.outlineConnect){var i=!(!this.isSource&&!this.isTarget)&&this.isOutlineConnectEvent(e);i?n=this.marker.highlight.state:null!=n&&n!=e.getState()&&this.graph.isCellConnectable(e.getCell())&&null!=this.marker.highlight.shape&&(this.marker.highlight.shape.stroke="transparent",this.marker.highlight.repaint(),n=null)}null==n||this.isCellEnabled(n.cell)||(n=null,this.marker.reset());var s=this.clonePreviewState(this.currentPoint,null!=n?n.cell:null);this.updatePreviewState(s,this.currentPoint,n,e,i);var r=null==this.error?this.marker.validColor:this.marker.invalidColor;this.setPreviewColor(r),this.abspoints=s.absolutePoints,this.active=!0,this.updateHint(e,this.currentPoint)}this.drawPreview(),mxEvent.consume(e.getEvent()),e.consume()}else mxClient.IS_IE&&null!=this.getHandleForEvent(e)&&e.consume(!1)},mxEdgeHandler.prototype.mouseUp=function(t,e){if(null!=this.index&&null!=this.marker){null!=this.shape&&null!=this.shape.node&&(this.shape.node.style.display="");var n=this.state.cell,i=this.index;if(this.index=null,e.getX()!=this.startX||e.getY()!=this.startY){var s=!this.graph.isIgnoreTerminalEvent(e.getEvent())&&this.graph.isCloneEvent(e.getEvent())&&this.cloneEnabled&&this.graph.isCellsCloneable();if(null!=this.error)this.error.length>0&&this.graph.validationAlert(this.error);else if(i<=mxEvent.CUSTOM_HANDLE&&i>mxEvent.VIRTUAL_HANDLE){if(null!=this.customHandles){(o=this.graph.getModel()).beginUpdate();try{this.customHandles[mxEvent.CUSTOM_HANDLE-i].execute(e),null!=this.shape&&null!=this.shape.node&&(this.shape.apply(this.state),this.shape.redraw())}finally{o.endUpdate()}}}else if(this.isLabel)this.moveLabel(this.state,this.label.x,this.label.y);else if(this.isSource||this.isTarget){var r=null;if(null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus&&(r=this.constraintHandler.currentFocus.cell),null==r&&this.marker.hasValidState()&&null!=this.marker.highlight&&null!=this.marker.highlight.shape&&"transparent"!=this.marker.highlight.shape.stroke&&"white"!=this.marker.highlight.shape.stroke&&(r=this.marker.validState.cell),null!=r){var o,l=(o=this.graph.getModel()).getParent(n);o.beginUpdate();try{if(s){var a=o.getGeometry(n);s=this.graph.cloneCell(n);o.add(l,s,o.getChildCount(l)),null!=a&&(a=a.clone(),o.setGeometry(s,a));var h=o.getTerminal(n,!this.isSource);this.graph.connectCell(s,h,!this.isSource),n=s}n=this.connect(n,r,this.isSource,s,e)}finally{o.endUpdate()}}else if(this.graph.isAllowDanglingEdges()){var u=this.abspoints[this.isSource?0:this.abspoints.length-1];u.x=this.roundLength(u.x/this.graph.view.scale-this.graph.view.translate.x),u.y=this.roundLength(u.y/this.graph.view.scale-this.graph.view.translate.y);var d=this.graph.getView().getState(this.graph.getModel().getParent(n));null!=d&&(u.x-=d.origin.x,u.y-=d.origin.y),u.x-=this.graph.panDx/this.graph.view.scale,u.y-=this.graph.panDy/this.graph.view.scale,n=this.changeTerminalPoint(n,u,this.isSource,s)}}else this.active?n=this.changePoints(n,this.points,s):(this.graph.getView().invalidate(this.state.cell),this.graph.getView().validate(this.state.cell))}else this.graph.isToggleEvent(e.getEvent())&&this.graph.selectCellForEvent(this.state.cell,e.getEvent());null!=this.marker&&(this.reset(),n!=this.state.cell&&this.graph.setSelectionCell(n)),e.consume()}},mxEdgeHandler.prototype.reset=function(){if(this.active&&this.refresh(),this.error=null,this.index=null,this.label=null,this.points=null,this.snapPoint=null,this.isLabel=!1,this.isSource=!1,this.isTarget=!1,this.active=!1,this.livePreview&&null!=this.sizers)for(var t=0;t0&&e0&&null!=n){null==this.points&&(this.points=[]);for(var i=1;i0&&this.graph.isLabelMovable(t),null!=this.bends&&this.bends.length>0){var i=this.abspoints.length-1,s=this.abspoints[0],r=s.x,o=s.y;e=this.bends[0].bounds,this.bends[0].bounds=new mxRectangle(Math.floor(r-e.width/2),Math.floor(o-e.height/2),e.width,e.height),this.bends[0].fill=this.getHandleFillColor(0),this.bends[0].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[0].bounds);var l=this.abspoints[i],a=l.x,h=l.y,u=this.bends.length-1;e=this.bends[u].bounds,this.bends[u].bounds=new mxRectangle(Math.floor(a-e.width/2),Math.floor(h-e.height/2),e.width,e.height),this.bends[u].fill=this.getHandleFillColor(u),this.bends[u].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[u].bounds),this.redrawInnerBends(s,l)}if(null!=this.abspoints&&null!=this.virtualBends&&this.virtualBends.length>0)for(var d=this.abspoints[0],p=0;p1?(t=i[1],e=i[i.length-2]):null!=n.points&&n.points.length>0&&(s=i[0]),s=null==s?new mxPoint(t.x+(e.x-t.x)/2,t.y+(e.y-t.y)/2):new mxPoint(this.graph.getView().scale*(s.x+this.graph.getView().translate.x+this.state.origin.x),this.graph.getView().scale*(s.y+this.graph.getView().translate.y+this.state.origin.y));var r=this.bends[1].bounds,o=r.width,l=r.height,a=new mxRectangle(Math.round(s.x-o/2),Math.round(s.y-l/2),o,l);this.manageLabelHandle?this.checkLabelHandle(a):null==this.handleImage&&this.labelShape.visible&&mxUtils.intersects(a,this.labelShape.bounds)&&(o=mxConstants.HANDLE_SIZE+3,l=mxConstants.HANDLE_SIZE+3,a=new mxRectangle(Math.floor(s.x-o/2),Math.floor(s.y-l/2),o,l)),this.bends[1].bounds=a,this.bends[1].redraw(),this.manageLabelHandle&&this.checkLabelHandle(this.bends[1].bounds)},__mxOutput.mxElbowEdgeHandler=void 0!==mxElbowEdgeHandler?mxElbowEdgeHandler:void 0,mxUtils.extend(mxEdgeSegmentHandler,mxElbowEdgeHandler),mxEdgeSegmentHandler.prototype.getCurrentPoints=function(){var t=this.state.absolutePoints;if(null!=t){var e=Math.max(1,this.graph.view.scale);if(2==t.length||3==t.length&&(Math.abs(t[0].x-t[1].x)0){var l=this.abspoints,a=l[0],h=l[1];o=[];for(var u=2;u1){var i=!1;if(4==n.length&&0==Math.round(n[1].x-n[2].x)&&0==Math.round(n[1].y-n[2].y))if(i=!0,0==Math.round(n[0].y-n[n.length-1].y)){var s=n[0].x+(n[n.length-1].x-n[0].x)/2;n[1]=new mxPoint(s,n[1].y),n[2]=new mxPoint(s,n[2].y)}else{var r=n[0].y+(n[n.length-1].y-n[0].y)/2;n[1]=new mxPoint(n[1].x,r),n[2]=new mxPoint(n[2].x,r)}for(var o=0;o0){null==this.div&&this.init();var i=mxUtils.getScrollOrigin();this.div.style.zIndex=this.zIndex,this.div.style.left=e+i.x+"px",this.div.style.top=n+mxConstants.TOOLTIP_VERTICAL_OFFSET+i.y+"px",mxUtils.isNode(t)?(this.div.innerHTML="",this.div.appendChild(t)):this.div.innerHTML=t.replace(/\n/g,"
"),this.div.style.visibility="",mxUtils.fit(this.div)}},mxTooltipHandler.prototype.destroy=function(){this.destroyed||(this.graph.removeMouseListener(this),mxEvent.release(this.div),null!=this.div&&null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.destroyed=!0,this.div=null)},__mxOutput.mxTooltipHandler=void 0!==mxTooltipHandler?mxTooltipHandler:void 0,mxUtils.extend(mxCellTracker,mxCellMarker),mxCellTracker.prototype.mouseDown=function(t,e){},mxCellTracker.prototype.mouseMove=function(t,e){this.isEnabled()&&this.process(e)},mxCellTracker.prototype.mouseUp=function(t,e){},mxCellTracker.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,this.graph.removeMouseListener(this),mxCellMarker.prototype.destroy.apply(this))},__mxOutput.mxCellTracker=void 0!==mxCellTracker?mxCellTracker:void 0,mxCellHighlight.prototype.keepOnTop=!1,mxCellHighlight.prototype.graph=null,mxCellHighlight.prototype.state=null,mxCellHighlight.prototype.spacing=2,mxCellHighlight.prototype.resetHandler=null,mxCellHighlight.prototype.setHighlightColor=function(t){this.highlightColor=t,null!=this.shape&&(this.shape.stroke=t)},mxCellHighlight.prototype.drawHighlight=function(){this.shape=this.createShape(),this.repaint(),this.keepOnTop||this.shape.node.parentNode.firstChild==this.shape.node||this.shape.node.parentNode.insertBefore(this.shape.node,this.shape.node.parentNode.firstChild)},mxCellHighlight.prototype.createShape=function(){var t=this.graph.cellRenderer.createShape(this.state);return t.svgStrokeTolerance=this.graph.tolerance,t.points=this.state.absolutePoints,t.apply(this.state),t.stroke=this.highlightColor,t.opacity=this.opacity,t.isDashed=this.dashed,t.isShadow=!1,t.dialect=this.graph.dialect!=mxConstants.DIALECT_SVG?mxConstants.DIALECT_VML:mxConstants.DIALECT_SVG,t.init(this.graph.getView().getOverlayPane()),mxEvent.redirectMouseEvents(t.node,this.graph,this.state),this.graph.dialect!=mxConstants.DIALECT_SVG?t.pointerEvents=!1:t.svgPointerEvents="stroke",t},mxCellHighlight.prototype.getStrokeWidth=function(t){return this.strokeWidth},mxCellHighlight.prototype.repaint=function(){null!=this.state&&null!=this.shape&&(this.shape.scale=this.state.view.scale,this.graph.model.isEdge(this.state.cell)?(this.shape.strokewidth=this.getStrokeWidth(),this.shape.points=this.state.absolutePoints,this.shape.outline=!1):(this.shape.bounds=new mxRectangle(this.state.x-this.spacing,this.state.y-this.spacing,this.state.width+2*this.spacing,this.state.height+2*this.spacing),this.shape.rotation=Number(this.state.style[mxConstants.STYLE_ROTATION]||"0"),this.shape.strokewidth=this.getStrokeWidth()/this.state.view.scale,this.shape.outline=!0),null!=this.state.shape&&this.shape.setCursor(this.state.shape.getCursor()),(mxClient.IS_QUIRKS||8==document.documentMode)&&("transparent"==this.shape.stroke?(this.shape.stroke="white",this.shape.opacity=1):this.shape.opacity=this.opacity),this.shape.redraw())},mxCellHighlight.prototype.hide=function(){this.highlight(null)},mxCellHighlight.prototype.highlight=function(t){this.state!=t&&(null!=this.shape&&(this.shape.destroy(),this.shape=null),this.state=t,null!=this.state&&this.drawHighlight())},mxCellHighlight.prototype.isHighlightAt=function(t,e){var n=!1;if(null!=this.shape&&null!=document.elementFromPoint&&!mxClient.IS_QUIRKS)for(var i=document.elementFromPoint(t,e);null!=i;){if(i==this.shape.node){n=!0;break}i=i.parentNode}return n},mxCellHighlight.prototype.destroy=function(){this.graph.getView().removeListener(this.resetHandler),this.graph.getView().removeListener(this.repaintHandler),this.graph.getModel().removeListener(this.repaintHandler),null!=this.shape&&(this.shape.destroy(),this.shape=null)},__mxOutput.mxCellHighlight=void 0!==mxCellHighlight?mxCellHighlight:void 0,mxDefaultKeyHandler.prototype.editor=null,mxDefaultKeyHandler.prototype.handler=null,mxDefaultKeyHandler.prototype.bindAction=function(t,e,n){var i=mxUtils.bind(this,(function(){this.editor.execute(e)}));n?this.handler.bindControlKey(t,i):this.handler.bindKey(t,i)},mxDefaultKeyHandler.prototype.destroy=function(){this.handler.destroy(),this.handler=null},__mxOutput.mxDefaultKeyHandler=void 0!==mxDefaultKeyHandler?mxDefaultKeyHandler:void 0,mxDefaultPopupMenu.prototype.imageBasePath=null,mxDefaultPopupMenu.prototype.config=null,mxDefaultPopupMenu.prototype.createMenu=function(t,e,n,i){if(null!=this.config){var s=this.createConditions(t,n,i),r=this.config.firstChild;this.addItems(t,e,n,i,s,r,null)}},mxDefaultPopupMenu.prototype.addItems=function(t,e,n,i,s,r,o){for(var l=!1;null!=r;){if("add"==r.nodeName){var a=r.getAttribute("if");if(null==a||s[a]){var h=r.getAttribute("as");h=mxResources.get(h)||h;var u=mxUtils.eval(mxUtils.getTextContent(r)),d=r.getAttribute("action"),p=r.getAttribute("icon"),m=r.getAttribute("iconCls"),c=r.getAttribute("enabled-if"),g=null==c||s[c];l&&(e.addSeparator(o),l=!1),null!=p&&this.imageBasePath&&(p=this.imageBasePath+p);var x=this.addAction(e,t,h,p,u,d,n,o,m,g);this.addItems(t,e,n,i,s,r.firstChild,x)}}else"separator"==r.nodeName&&(l=!0);r=r.nextSibling}},mxDefaultPopupMenu.prototype.addAction=function(t,e,n,i,s,r,o,l,a,h){return t.addItem(n,i,(function(t){"function"==typeof s&&s.call(e,e,o,t),null!=r&&e.execute(r,o,t)}),l,a,h)},mxDefaultPopupMenu.prototype.createConditions=function(t,e,n){var i=t.graph.getModel(),s=i.getChildCount(e),r=[];r.nocell=null==e,r.ncells=t.graph.getSelectionCount()>1,r.notRoot=i.getRoot()!=i.getParent(t.graph.getDefaultParent()),r.cell=null!=e;var o=null!=e&&1==t.graph.getSelectionCount();r.nonEmpty=o&&s>0,r.expandable=o&&t.graph.isCellFoldable(e,!1),r.collapsable=o&&t.graph.isCellFoldable(e,!0),r.validRoot=o&&t.graph.isValidRoot(e),r.emptyValidRoot=r.validRoot&&0==s,r.swimlane=o&&t.graph.isSwimlane(e);for(var l=this.config.getElementsByTagName("condition"),a=0;a0&&this.editor.execute(n)}));return this.toolbar.addItem(t,e,s,i)},mxDefaultToolbar.prototype.addSeparator=function(t){t=t||mxClient.imageBasePath+"/separator.gif",this.toolbar.addSeparator(t)},mxDefaultToolbar.prototype.addCombo=function(){return this.toolbar.addCombo()},mxDefaultToolbar.prototype.addActionCombo=function(t){return this.toolbar.addActionCombo(t)},mxDefaultToolbar.prototype.addActionOption=function(t,e,n){var i=mxUtils.bind(this,(function(){this.editor.execute(n)}));this.addOption(t,e,i)},mxDefaultToolbar.prototype.addOption=function(t,e,n){return this.toolbar.addOption(t,e,n)},mxDefaultToolbar.prototype.addMode=function(t,e,n,i,s){var r=mxUtils.bind(this,(function(){this.editor.setMode(n),null!=s&&s(this.editor)}));return this.toolbar.addSwitchMode(t,e,r,i)},mxDefaultToolbar.prototype.addPrototype=function(t,e,n,i,s,r){var o=mxUtils.bind(this,(function(){return"function"==typeof n?n():null!=n?this.editor.graph.cloneCell(n):null})),l=mxUtils.bind(this,(function(t,e){"function"==typeof s?s(this.editor,o(),t,e):this.drop(o(),t,e),this.toolbar.resetMode(),mxEvent.consume(t)})),a=this.toolbar.addMode(t,e,l,i,null,r);return this.installDropHandler(a,(function(t,e,n){l(e,n)})),a},mxDefaultToolbar.prototype.drop=function(t,e,n){var i=this.editor.graph,s=i.getModel();if(null!=n&&!s.isEdge(n)&&this.connectOnDrop&&i.isCellConnectable(n))this.connect(t,e,n);else{for(;null!=n&&!i.isValidDropTarget(n,[t],e);)n=s.getParent(n);this.insert(t,e,n)}},mxDefaultToolbar.prototype.insert=function(t,e,n){var i=this.editor.graph;if(i.canImportCell(t)){var s=mxEvent.getClientX(e),r=mxEvent.getClientY(e),o=mxUtils.convertPoint(i.container,s,r);return i.isSplitEnabled()&&i.isSplitTarget(n,[t],e)?i.splitEdge(n,[t],null,o.x,o.y):this.editor.addVertex(n,t,o.x,o.y)}return null},mxDefaultToolbar.prototype.connect=function(t,e,n){var i=this.editor.graph,s=i.getModel();if(null!=n&&i.isCellConnectable(t)&&i.isEdgeValid(null,n,t)){var r=null;s.beginUpdate();try{var o=s.getGeometry(n),l=s.getGeometry(t).clone();l.x=o.x+(o.width-l.width)/2,l.y=o.y+(o.height-l.height)/2;var a=this.spacing*i.gridSize,h=20*s.getDirectedEdgeCount(n,!0);this.editor.horizontalFlow?l.x+=(l.width+o.width)/2+a+h:l.y+=(l.height+o.height)/2+a+h,t.setGeometry(l);var u=s.getParent(n);if(i.addCell(t,u),i.constrainChild(t),r=this.editor.createEdge(n,t),null==s.getGeometry(r)){var d=new mxGeometry;d.relative=!0,s.setGeometry(r,d)}i.addEdge(r,u,n,t)}finally{s.endUpdate()}i.setSelectionCells([t,r]),i.scrollCellToVisible(t)}},mxDefaultToolbar.prototype.installDropHandler=function(t,e){var n=document.createElement("img");n.setAttribute("src",t.getAttribute("src"));var i=mxUtils.bind(this,(function(s){n.style.width=2*t.offsetWidth+"px",n.style.height=2*t.offsetHeight+"px",mxUtils.makeDraggable(t,this.editor.graph,e,n),mxEvent.removeListener(n,"load",i)}));mxClient.IS_IE?i():mxEvent.addListener(n,"load",i)},mxDefaultToolbar.prototype.destroy=function(){null!=this.resetHandler&&(this.editor.graph.removeListener("dblclick",this.resetHandler),this.editor.removeListener("escape",this.resetHandler),this.resetHandler=null),null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null)},__mxOutput.mxDefaultToolbar=void 0!==mxDefaultToolbar?mxDefaultToolbar:void 0,mxLoadResources?mxResources.add(mxClient.basePath+"/resources/editor"):mxClient.defaultBundles.push(mxClient.basePath+"/resources/editor"),mxEditor.prototype=new mxEventSource,mxEditor.prototype.constructor=mxEditor,mxEditor.prototype.askZoomResource="none"!=mxClient.language?"askZoom":"",mxEditor.prototype.lastSavedResource="none"!=mxClient.language?"lastSaved":"",mxEditor.prototype.currentFileResource="none"!=mxClient.language?"currentFile":"",mxEditor.prototype.propertiesResource="none"!=mxClient.language?"properties":"",mxEditor.prototype.tasksResource="none"!=mxClient.language?"tasks":"",mxEditor.prototype.helpResource="none"!=mxClient.language?"help":"",mxEditor.prototype.outlineResource="none"!=mxClient.language?"outline":"",mxEditor.prototype.outline=null,mxEditor.prototype.graph=null,mxEditor.prototype.graphRenderHint=null,mxEditor.prototype.toolbar=null,mxEditor.prototype.status=null,mxEditor.prototype.popupHandler=null,mxEditor.prototype.undoManager=null,mxEditor.prototype.keyHandler=null,mxEditor.prototype.actions=null,mxEditor.prototype.dblClickAction="edit",mxEditor.prototype.swimlaneRequired=!1,mxEditor.prototype.disableContextMenu=!0,mxEditor.prototype.insertFunction=null,mxEditor.prototype.forcedInserting=!1,mxEditor.prototype.templates=null,mxEditor.prototype.defaultEdge=null,mxEditor.prototype.defaultEdgeStyle=null,mxEditor.prototype.defaultGroup=null,mxEditor.prototype.groupBorderSize=null,mxEditor.prototype.filename=null,mxEditor.prototype.linefeed="
",mxEditor.prototype.postParameterName="xml",mxEditor.prototype.escapePostData=!0,mxEditor.prototype.urlPost=null,mxEditor.prototype.urlImage=null,mxEditor.prototype.horizontalFlow=!1,mxEditor.prototype.layoutDiagram=!1,mxEditor.prototype.swimlaneSpacing=0,mxEditor.prototype.maintainSwimlanes=!1,mxEditor.prototype.layoutSwimlanes=!1,mxEditor.prototype.cycleAttributeValues=null,mxEditor.prototype.cycleAttributeIndex=0,mxEditor.prototype.cycleAttributeName="fillColor",mxEditor.prototype.tasks=null,mxEditor.prototype.tasksWindowImage=null,mxEditor.prototype.tasksTop=20,mxEditor.prototype.help=null,mxEditor.prototype.helpWindowImage=null,mxEditor.prototype.urlHelp=null,mxEditor.prototype.helpWidth=300,mxEditor.prototype.helpHeight=260,mxEditor.prototype.propertiesWidth=240,mxEditor.prototype.propertiesHeight=null,mxEditor.prototype.movePropertiesDialog=!1,mxEditor.prototype.validating=!1,mxEditor.prototype.modified=!1,mxEditor.prototype.isModified=function(){return this.modified},mxEditor.prototype.setModified=function(t){this.modified=t},mxEditor.prototype.addActions=function(){this.addAction("save",(function(t){t.save()})),this.addAction("print",(function(t){new mxPrintPreview(t.graph,1).open()})),this.addAction("show",(function(t){mxUtils.show(t.graph,null,10,10)})),this.addAction("exportImage",(function(t){var e=t.getUrlImage();if(null==e||mxClient.IS_LOCAL)t.execute("show");else{var n=mxUtils.getViewXml(t.graph,1),i=mxUtils.getXml(n,"\n");mxUtils.submit(e,t.postParameterName+"="+encodeURIComponent(i),document,"_blank")}})),this.addAction("refresh",(function(t){t.graph.refresh()})),this.addAction("cut",(function(t){t.graph.isEnabled()&&mxClipboard.cut(t.graph)})),this.addAction("copy",(function(t){t.graph.isEnabled()&&mxClipboard.copy(t.graph)})),this.addAction("paste",(function(t){t.graph.isEnabled()&&mxClipboard.paste(t.graph)})),this.addAction("delete",(function(t){t.graph.isEnabled()&&t.graph.removeCells()})),this.addAction("group",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCell(t.groupCells())})),this.addAction("ungroup",(function(t){t.graph.isEnabled()&&t.graph.setSelectionCells(t.graph.ungroupCells())})),this.addAction("removeFromParent",(function(t){t.graph.isEnabled()&&t.graph.removeCellsFromParent()})),this.addAction("undo",(function(t){t.graph.isEnabled()&&t.undo()})),this.addAction("redo",(function(t){t.graph.isEnabled()&&t.redo()})),this.addAction("zoomIn",(function(t){t.graph.zoomIn()})),this.addAction("zoomOut",(function(t){t.graph.zoomOut()})),this.addAction("actualSize",(function(t){t.graph.zoomActual()})),this.addAction("fit",(function(t){t.graph.fit()})),this.addAction("showProperties",(function(t,e){t.showProperties(e)})),this.addAction("selectAll",(function(t){t.graph.isEnabled()&&t.graph.selectAll()})),this.addAction("selectNone",(function(t){t.graph.isEnabled()&&t.graph.clearSelection()})),this.addAction("selectVertices",(function(t){t.graph.isEnabled()&&t.graph.selectVertices()})),this.addAction("selectEdges",(function(t){t.graph.isEnabled()&&t.graph.selectEdges()})),this.addAction("edit",(function(t,e){t.graph.isEnabled()&&t.graph.isCellEditable(e)&&t.graph.startEditingAtCell(e)})),this.addAction("toBack",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!0)})),this.addAction("toFront",(function(t,e){t.graph.isEnabled()&&t.graph.orderCells(!1)})),this.addAction("enterGroup",(function(t,e){t.graph.enterGroup(e)})),this.addAction("exitGroup",(function(t){t.graph.exitGroup()})),this.addAction("home",(function(t){t.graph.home()})),this.addAction("selectPrevious",(function(t){t.graph.isEnabled()&&t.graph.selectPreviousCell()})),this.addAction("selectNext",(function(t){t.graph.isEnabled()&&t.graph.selectNextCell()})),this.addAction("selectParent",(function(t){t.graph.isEnabled()&&t.graph.selectParentCell()})),this.addAction("selectChild",(function(t){t.graph.isEnabled()&&t.graph.selectChildCell()})),this.addAction("collapse",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!0)})),this.addAction("collapseAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!0,!1,e)}})),this.addAction("expand",(function(t){t.graph.isEnabled()&&t.graph.foldCells(!1)})),this.addAction("expandAll",(function(t){if(t.graph.isEnabled()){var e=t.graph.getChildVertices();t.graph.foldCells(!1,!1,e)}})),this.addAction("bold",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD)})),this.addAction("italic",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC)})),this.addAction("underline",(function(t){t.graph.isEnabled()&&t.graph.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE)})),this.addAction("alignCellsLeft",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_LEFT)})),this.addAction("alignCellsCenter",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_CENTER)})),this.addAction("alignCellsRight",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_RIGHT)})),this.addAction("alignCellsTop",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_TOP)})),this.addAction("alignCellsMiddle",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_MIDDLE)})),this.addAction("alignCellsBottom",(function(t){t.graph.isEnabled()&&t.graph.alignCells(mxConstants.ALIGN_BOTTOM)})),this.addAction("alignFontLeft",(function(t){t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT)})),this.addAction("alignFontCenter",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER)})),this.addAction("alignFontRight",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_RIGHT)})),this.addAction("alignFontTop",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP)})),this.addAction("alignFontMiddle",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)})),this.addAction("alignFontBottom",(function(t){t.graph.isEnabled()&&t.graph.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_BOTTOM)})),this.addAction("zoom",(function(t){var e=100*t.graph.getView().scale,n=parseFloat(mxUtils.prompt(mxResources.get(t.askZoomResource)||t.askZoomResource,e))/100;isNaN(n)||t.graph.getView().setScale(n)})),this.addAction("toggleTasks",(function(t){null!=t.tasks?t.tasks.setVisible(!t.tasks.isVisible()):t.showTasks()})),this.addAction("toggleHelp",(function(t){null!=t.help?t.help.setVisible(!t.help.isVisible()):t.showHelp()})),this.addAction("toggleOutline",(function(t){null==t.outline?t.showOutline():t.outline.setVisible(!t.outline.isVisible())})),this.addAction("toggleConsole",(function(t){mxLog.setVisible(!mxLog.isVisible())}))},mxEditor.prototype.configure=function(t){null!=t&&(new mxCodec(t.ownerDocument).decode(t,this),this.resetHistory())},mxEditor.prototype.resetFirstTime=function(){document.cookie="mxgraph=seen; expires=Fri, 27 Jul 2001 02:47:11 UTC; path=/"},mxEditor.prototype.resetHistory=function(){this.lastSnapshot=(new Date).getTime(),this.undoManager.clear(),this.ignoredChanges=0,this.setModified(!1)},mxEditor.prototype.addAction=function(t,e){this.actions[t]=e},mxEditor.prototype.execute=function(t,e,n){var i=this.actions[t];if(null!=i)try{var s=arguments;s[0]=this,i.apply(this,s)}catch(e){throw mxUtils.error("Cannot execute "+t+": "+e.message,280,!0),e}else mxUtils.error("Cannot find action "+t,280,!0)},mxEditor.prototype.addTemplate=function(t,e){this.templates[t]=e},mxEditor.prototype.getTemplate=function(t){return this.templates[t]},mxEditor.prototype.createGraph=function(){var t=new mxGraph(null,null,this.graphRenderHint);return t.setTooltips(!0),t.setPanning(!0),this.installDblClickHandler(t),this.installUndoHandler(t),this.installDrillHandler(t),this.installChangeHandler(t),this.installInsertHandler(t),t.popupMenuHandler.factoryMethod=mxUtils.bind(this,(function(t,e,n){return this.createPopupMenu(t,e,n)})),t.connectionHandler.factoryMethod=mxUtils.bind(this,(function(t,e){return this.createEdge(t,e)})),this.createSwimlaneManager(t),this.createLayoutManager(t),t},mxEditor.prototype.createSwimlaneManager=function(t){var e=new mxSwimlaneManager(t,!1);return e.isHorizontal=mxUtils.bind(this,(function(){return this.horizontalFlow})),e.isEnabled=mxUtils.bind(this,(function(){return this.maintainSwimlanes})),e},mxEditor.prototype.createLayoutManager=function(t){var e=new mxLayoutManager(t),n=this;return e.getLayout=function(e){var i=null,s=n.graph.getModel();return null!=s.getParent(e)&&(n.layoutSwimlanes&&t.isSwimlane(e)?(null==n.swimlaneLayout&&(n.swimlaneLayout=n.createSwimlaneLayout()),i=n.swimlaneLayout):n.layoutDiagram&&(t.isValidRoot(e)||null==s.getParent(s.getParent(e)))&&(null==n.diagramLayout&&(n.diagramLayout=n.createDiagramLayout()),i=n.diagramLayout)),i},e},mxEditor.prototype.setGraphContainer=function(t){null==this.graph.container&&(this.graph.init(t),this.rubberband=new mxRubberband(this.graph),this.disableContextMenu&&mxEvent.disableContextMenu(t),mxClient.IS_QUIRKS&&new mxDivResizer(t))},mxEditor.prototype.installDblClickHandler=function(t){t.addListener(mxEvent.DOUBLE_CLICK,mxUtils.bind(this,(function(e,n){var i=n.getProperty("cell");null!=i&&t.isEnabled()&&null!=this.dblClickAction&&(this.execute(this.dblClickAction,i),n.consume())})))},mxEditor.prototype.installUndoHandler=function(t){var e=mxUtils.bind(this,(function(t,e){var n=e.getProperty("edit");this.undoManager.undoableEditHappened(n)}));t.getModel().addListener(mxEvent.UNDO,e),t.getView().addListener(mxEvent.UNDO,e);var n=function(e,n){var i=n.getProperty("edit").changes;t.setSelectionCells(t.getSelectionCellsForChanges(i))};this.undoManager.addListener(mxEvent.UNDO,n),this.undoManager.addListener(mxEvent.REDO,n)},mxEditor.prototype.installDrillHandler=function(t){var e=mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.ROOT))}));t.getView().addListener(mxEvent.DOWN,e),t.getView().addListener(mxEvent.UP,e)},mxEditor.prototype.installChangeHandler=function(t){var e=mxUtils.bind(this,(function(e,n){this.setModified(!0),1==this.validating&&t.validateGraph();for(var i=n.getProperty("edit").changes,s=0;s "+e.convertValueToString(n)+t),n=e.getModel().getParent(n);return this.getRootTitle()+t},mxEditor.prototype.getRootTitle=function(){var t=this.graph.getModel().getRoot();return this.graph.convertValueToString(t)},mxEditor.prototype.undo=function(){this.undoManager.undo()},mxEditor.prototype.redo=function(){this.undoManager.redo()},mxEditor.prototype.groupCells=function(){var t=null!=this.groupBorderSize?this.groupBorderSize:this.graph.gridSize;return this.graph.groupCells(this.createGroup(),t)},mxEditor.prototype.createGroup=function(){return this.graph.getModel().cloneCell(this.defaultGroup)},mxEditor.prototype.open=function(t){if(null!=t){var e=mxUtils.load(t).getXml();this.readGraphModel(e.documentElement),this.filename=t,this.fireEvent(new mxEventObject(mxEvent.OPEN,"filename",t))}},mxEditor.prototype.readGraphModel=function(t){new mxCodec(t.ownerDocument).decode(t,this.graph.getModel()),this.resetHistory()},mxEditor.prototype.save=function(t,e){if(null!=(t=t||this.getUrlPost())&&t.length>0){var n=this.writeGraphModel(e);this.postDiagram(t,n),this.setModified(!1)}this.fireEvent(new mxEventObject(mxEvent.SAVE,"url",t))},mxEditor.prototype.postDiagram=function(t,e){this.escapePostData&&(e=encodeURIComponent(e)),mxUtils.post(t,this.postParameterName+"="+e,mxUtils.bind(this,(function(n){this.fireEvent(new mxEventObject(mxEvent.POST,"request",n,"url",t,"data",e))})))},mxEditor.prototype.writeGraphModel=function(t){t=null!=t?t:this.linefeed;var e=(new mxCodec).encode(this.graph.getModel());return mxUtils.getXml(e,t)},mxEditor.prototype.getUrlPost=function(){return this.urlPost},mxEditor.prototype.getUrlImage=function(){return this.urlImage},mxEditor.prototype.swapStyles=function(t,e){var n=this.graph.getStylesheet().styles[e];this.graph.getView().getStylesheet().putCellStyle(e,this.graph.getStylesheet().styles[t]),this.graph.getStylesheet().putCellStyle(t,n),this.graph.refresh()},mxEditor.prototype.showProperties=function(t){if(null==(t=t||this.graph.getSelectionCell())&&null==(t=this.graph.getCurrentRoot())&&(t=this.graph.getModel().getRoot()),null!=t){this.graph.stopEditing(!0);var e=mxUtils.getOffset(this.graph.container),n=e.x+10,i=e.y;if(null==this.properties||this.movePropertiesDialog){var s=this.graph.getCellBounds(t);null!=s&&(n+=s.x+Math.min(200,s.width),i+=s.y)}else n=this.properties.getX(),i=this.properties.getY();this.hideProperties();var r=this.createProperties(t);null!=r&&(this.properties=new mxWindow(mxResources.get(this.propertiesResource)||this.propertiesResource,r,n,i,this.propertiesWidth,this.propertiesHeight,!1),this.properties.setVisible(!0))}},mxEditor.prototype.isPropertiesVisible=function(){return null!=this.properties},mxEditor.prototype.createProperties=function(t){var e=this.graph.getModel(),n=e.getValue(t);if(mxUtils.isNode(n)){var i=new mxForm("properties");i.addText("ID",t.getId()).setAttribute("readonly","true");var s=null,r=null,o=null,l=null,a=null;e.isVertex(t)&&null!=(s=e.getGeometry(t))&&(r=i.addText("top",s.y),o=i.addText("left",s.x),l=i.addText("width",s.width),a=i.addText("height",s.height));for(var h=e.getStyle(t),u=i.addText("Style",h||""),d=n.attributes,p=[],m=0;m0?e.setStyle(t,u.value):e.setStyle(t,null);for(var n=0;n0&&this.graph.isSwimlane(t)?this.cycleAttributeValues[this.cycleAttributeIndex++%this.cycleAttributeValues.length]:null},mxEditor.prototype.cycleAttribute=function(t){if(null!=this.cycleAttributeName){var e=this.consumeCycleAttribute(t);null!=e&&t.setStyle(t.getStyle()+";"+this.cycleAttributeName+"="+e)}},mxEditor.prototype.addVertex=function(t,e,n,i){for(var s=this.graph.getModel();null!=t&&!this.graph.isValidDropTarget(t);)t=s.getParent(t);t=null!=t?t:this.graph.getSwimlaneAt(n,i);var r=this.graph.getView().scale,o=s.getGeometry(e),l=s.getGeometry(t);if(this.graph.isSwimlane(e)&&!this.graph.swimlaneNesting)t=null;else{if(null==t&&this.swimlaneRequired)return null;if(null!=t&&null!=l){var a=this.graph.getView().getState(t);if(null!=a){if(n-=a.origin.x*r,i-=a.origin.y*r,this.graph.isConstrainedMoving){var h=o.width,u=o.height,d=a.x+a.width;n+h>d&&(n-=n+h-d),i+u>(d=a.y+a.height)&&(i-=i+u-d)}}else null!=l&&(n-=l.x*r,i-=l.y*r)}}(o=o.clone()).x=this.graph.snap(n/r-this.graph.getView().translate.x-this.graph.gridSize/2),o.y=this.graph.snap(i/r-this.graph.getView().translate.y-this.graph.gridSize/2),e.setGeometry(o),null==t&&(t=this.graph.getDefaultParent()),this.cycleAttribute(e),this.fireEvent(new mxEventObject(mxEvent.BEFORE_ADD_VERTEX,"vertex",e,"parent",t)),s.beginUpdate();try{null!=(e=this.graph.addCell(e,t))&&(this.graph.constrainChild(e),this.fireEvent(new mxEventObject(mxEvent.ADD_VERTEX,"vertex",e)))}finally{s.endUpdate()}return null!=e&&(this.graph.setSelectionCell(e),this.graph.scrollCellToVisible(e),this.fireEvent(new mxEventObject(mxEvent.AFTER_ADD_VERTEX,"vertex",e))),e},mxEditor.prototype.destroy=function(){this.destroyed||(this.destroyed=!0,null!=this.tasks&&this.tasks.destroy(),null!=this.outline&&this.outline.destroy(),null!=this.properties&&this.properties.destroy(),null!=this.keyHandler&&this.keyHandler.destroy(),null!=this.rubberband&&this.rubberband.destroy(),null!=this.toolbar&&this.toolbar.destroy(),null!=this.graph&&this.graph.destroy(),this.status=null,this.templates=null)},__mxOutput.mxEditor=void 0!==mxEditor?mxEditor:void 0;var mxCodecRegistry={codecs:[],aliases:[],register:function(t){if(null!=t){var e=t.getName();mxCodecRegistry.codecs[e]=t;var n=mxUtils.getFunctionName(t.template.constructor);n!=e&&mxCodecRegistry.addAlias(n,e)}return t},addAlias:function(t,e){mxCodecRegistry.aliases[t]=e},getCodec:function(t){var e=null;if(null!=t){var n=mxUtils.getFunctionName(t),i=mxCodecRegistry.aliases[n];if(null!=i&&(n=i),null==(e=mxCodecRegistry.codecs[n]))try{e=new mxObjectCodec(new t),mxCodecRegistry.register(e)}catch(t){}}return e}},codec;function mxCodec(t){this.document=t||mxUtils.createXmlDocument(),this.objects=[]}function mxObjectCodec(t,e,n,i){for(var s in this.template=t,this.exclude=null!=e?e:[],this.idrefs=null!=n?n:[],this.mapping=null!=i?i:[],this.reverse=new Object,this.mapping)this.reverse[this.mapping[s]]=s}__mxOutput.mxCodecRegistry=void 0!==mxCodecRegistry?mxCodecRegistry:void 0,mxCodec.prototype.document=null,mxCodec.prototype.objects=null,mxCodec.prototype.elements=null,mxCodec.prototype.encodeDefaults=!1,mxCodec.prototype.putObject=function(t,e){return this.objects[t]=e,e},mxCodec.prototype.getObject=function(t){var e=null;if(null!=t&&null==(e=this.objects[t])&&null==(e=this.lookup(t))){var n=this.getElementById(t);null!=n&&(e=this.decode(n))}return e},mxCodec.prototype.lookup=function(t){return null},mxCodec.prototype.getElementById=function(t){return this.updateElements(),this.elements[t]},mxCodec.prototype.updateElements=function(){null==this.elements&&(this.elements=new Object,null!=this.document.documentElement&&this.addElement(this.document.documentElement))},mxCodec.prototype.addElement=function(t){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var e=t.getAttribute("id");if(null!=e)if(null==this.elements[e])this.elements[e]=t;else if(this.elements[e]!=t)throw new Error(e+": Duplicate ID")}for(t=t.firstChild;null!=t;)this.addElement(t),t=t.nextSibling},mxCodec.prototype.getId=function(t){var e=null;return null!=t&&null==(e=this.reference(t))&&t instanceof mxCell&&null==(e=t.getId())&&0==(e=mxCellPath.create(t)).length&&(e="root"),e},mxCodec.prototype.reference=function(t){return null},mxCodec.prototype.encode=function(t){var e=null;if(null!=t&&null!=t.constructor){var n=mxCodecRegistry.getCodec(t.constructor);null!=n?e=n.encode(this,t):mxUtils.isNode(t)?e=mxUtils.importNode(this.document,t,!0):mxLog.warn("mxCodec.encode: No codec for "+mxUtils.getFunctionName(t.constructor))}return e},mxCodec.prototype.decode=function(t,e){this.updateElements();var n=null;if(null!=t&&t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=null;try{i=window[t.nodeName]}catch(t){}var s=mxCodecRegistry.getCodec(i);null!=s?n=s.decode(this,t,e):(n=t.cloneNode(!0)).removeAttribute("as")}return n},mxCodec.prototype.encodeCell=function(t,e,n){if(e.appendChild(this.encode(t)),null==n||n)for(var i=t.getChildCount(),s=0;s=0},mxObjectCodec.prototype.isReference=function(t,e,n,i){return mxUtils.indexOf(this.idrefs,e)>=0},mxObjectCodec.prototype.encode=function(t,e){var n=t.document.createElement(this.getName());return e=this.beforeEncode(t,e,n),this.encodeObject(t,e,n),this.afterEncode(t,e,n)},mxObjectCodec.prototype.encodeObject=function(t,e,n){for(var i in t.setAttribute(n,"id",t.getId(e)),e){var s=i,r=e[s];null==r||this.isExcluded(e,s,r,!0)||(mxUtils.isInteger(s)&&(s=null),this.encodeValue(t,e,s,r,n))}},mxObjectCodec.prototype.encodeValue=function(t,e,n,i,s){if(null!=i){if(this.isReference(e,n,i,!0)){var r=t.getId(i);if(null==r)return void mxLog.warn("mxObjectCodec.encode: No ID for "+this.getName()+"."+n+"="+i);i=r}var o=this.template[n];(null==n||t.encodeDefaults||o!=i)&&(n=this.getAttributeName(n),this.writeAttribute(t,e,n,i,s))}},mxObjectCodec.prototype.writeAttribute=function(t,e,n,i,s){"object"!=typeof i?this.writePrimitiveAttribute(t,e,n,i,s):this.writeComplexAttribute(t,e,n,i,s)},mxObjectCodec.prototype.writePrimitiveAttribute=function(t,e,n,i,s){if(i=this.convertAttributeToXml(t,e,n,i,s),null==n){var r=t.document.createElement("add");"function"==typeof i?r.appendChild(t.document.createTextNode(i)):t.setAttribute(r,"value",i),s.appendChild(r)}else"function"!=typeof i&&t.setAttribute(s,n,i)},mxObjectCodec.prototype.writeComplexAttribute=function(t,e,n,i,s){var r=t.encode(i);null!=r?(null!=n&&r.setAttribute("as",n),s.appendChild(r)):mxLog.warn("mxObjectCodec.encode: No node for "+this.getName()+"."+n+": "+i)},mxObjectCodec.prototype.convertAttributeToXml=function(t,e,n,i){return this.isBooleanAttribute(t,e,n,i)&&(i=1==i?"1":"0"),i},mxObjectCodec.prototype.isBooleanAttribute=function(t,e,n,i){return void 0===i.length&&(1==i||0==i)},mxObjectCodec.prototype.convertAttributeFromXml=function(t,e,n){var i=e.value;return this.isNumericAttribute(t,e,n)&&(i=parseFloat(i),!isNaN(i)&&isFinite(i)||(i=0)),i},mxObjectCodec.prototype.isNumericAttribute=function(t,e,n){return n.constructor==mxGeometry&&("x"==e.name||"y"==e.name||"width"==e.name||"height"==e.name)||n.constructor==mxPoint&&("x"==e.name||"y"==e.name)||mxUtils.isNumeric(e.value)},mxObjectCodec.prototype.beforeEncode=function(t,e,n){return e},mxObjectCodec.prototype.afterEncode=function(t,e,n){return n},mxObjectCodec.prototype.decode=function(t,e,n){var i=e.getAttribute("id"),s=t.objects[i];return null==s&&(s=n||this.cloneTemplate(),null!=i&&t.putObject(i,s)),e=this.beforeDecode(t,e,s),this.decodeNode(t,e,s),this.afterDecode(t,e,s)},mxObjectCodec.prototype.decodeNode=function(t,e,n){null!=e&&(this.decodeAttributes(t,e,n),this.decodeChildren(t,e,n))},mxObjectCodec.prototype.decodeAttributes=function(t,e,n){var i=e.attributes;if(null!=i)for(var s=0;s0&&(i=null),i},mxObjectCodec.prototype.addObjectValue=function(t,e,n,i){null!=n&&n!=i&&(null!=e&&e.length>0?t[e]=n:t.push(n))},mxObjectCodec.prototype.processInclude=function(t,e,n){if("include"==e.nodeName){var i=e.getAttribute("name");if(null!=i)try{var s=mxUtils.load(i).getDocumentElement();null!=s&&t.decode(s,n)}catch(t){}return!0}return!1},mxObjectCodec.prototype.beforeDecode=function(t,e,n){return e},mxObjectCodec.prototype.afterDecode=function(t,e,n){return n},__mxOutput.mxObjectCodec=void 0!==mxObjectCodec?mxObjectCodec:void 0,mxCodecRegistry.register((codec=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]),codec.isCellCodec=function(){return!0},codec.isNumericAttribute=function(t,e,n){return"value"!==e.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)},codec.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&"value"==e&&n.nodeType==mxConstants.NODETYPE_ELEMENT},codec.afterEncode=function(t,e,n){if(null!=e.value&&e.value.nodeType==mxConstants.NODETYPE_ELEMENT){var i=n;(n=mxUtils.importNode(t.document,e.value,!0)).appendChild(i);var s=i.getAttribute("id");n.setAttribute("id",s),i.removeAttribute("id")}return n},codec.beforeDecode=function(t,e,n){var i=e.cloneNode(!0),s=this.getName();if(e.nodeName!=s){var r=e.getElementsByTagName(s)[0];null!=r&&r.parentNode==e?(mxUtils.removeWhitespace(r,!0),mxUtils.removeWhitespace(r,!1),r.parentNode.removeChild(r),i=r):i=null,n.value=e.cloneNode(!0);var o=n.value.getAttribute("id");null!=o&&(n.setId(o),n.value.removeAttribute("id"))}else n.setId(e.getAttribute("id"));if(null!=i)for(var l=0;l=0},t.isExcluded=function(t,e,n,i){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||i&&null!=n&&("previous"==e||"parent"==e)&&!t.model.contains(n)},t.afterEncode=function(t,e,n){return this.isReference(e,"child",e.child,!0)?n.setAttribute("child",t.getId(e.child)):t.encodeCell(e.child,n),n},t.beforeDecode=function(t,e,n){if(null!=e.firstChild&&e.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT){var i=(e=e.cloneNode(!0)).firstChild;n.child=t.decodeCell(i,!1);var s=i.nextSibling;for(i.parentNode.removeChild(i),i=s;null!=i;){if(s=i.nextSibling,i.nodeType==mxConstants.NODETYPE_ELEMENT){var r=i.getAttribute("id");null==t.lookup(r)&&t.decodeCell(i)}i.parentNode.removeChild(i),i=s}}else{var o=e.getAttribute("child");n.child=t.getObject(o)}return e},t.afterDecode=function(t,e,n){return null!=n.child&&(null!=n.child.parent&&null!=n.previous&&n.child.parent!=n.previous&&(n.previous=n.child.parent),n.child.parent=n.previous,n.previous=n.parent,n.previousIndex=n.index),n},t}()),__mxOutput.mxChildChangeCodec="undefined"!=typeof mxChildChangeCodec?mxChildChangeCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxTerminalChange,["model","previous"],["cell","terminal"]);return t.afterDecode=function(t,e,n){return n.previous=n.terminal,n},t}()),__mxOutput.mxTerminalChangeCodec="undefined"!=typeof mxTerminalChangeCodec?mxTerminalChangeCodec:void 0;var mxGenericChangeCodec=function(t,e){var n=new mxObjectCodec(t,["model","previous"],["cell"]);return n.afterDecode=function(t,n,i){return mxUtils.isNode(i.cell)&&(i.cell=t.decodeCell(i.cell,!1)),i.previous=i[e],i},n};mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange,"value")),mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange,"style")),mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange,"geometry")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange,"collapsed")),mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange,"visible")),mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange,"value")),__mxOutput.mxGenericChangeCodec=void 0!==mxGenericChangeCodec?mxGenericChangeCodec:void 0,mxCodecRegistry.register(new mxObjectCodec(new mxGraph,["graphListeners","eventListeners","view","container","cellRenderer","editor","selection"])),__mxOutput.mxGraphCodec="undefined"!=typeof mxGraphCodec?mxGraphCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxGraphView);return t.encode=function(t,e){return this.encodeCell(t,e,e.graph.getModel().getRoot())},t.encodeCell=function(t,e,n){var i=e.graph.getModel(),s=e.getState(n),r=i.getParent(n);if(null==r||null!=s){var o=i.getChildCount(n),l=e.graph.getCellGeometry(n),a=null;if(r==i.getRoot()?a="layer":null==r?a="graph":i.isEdge(n)?a="edge":o>0&&null!=l?a="group":i.isVertex(n)&&(a="vertex"),null!=a){var h=t.document.createElement(a);if(null!=e.graph.getLabel(n)&&(h.setAttribute("label",e.graph.getLabel(n)),e.graph.isHtmlLabel(n)&&h.setAttribute("html",!0)),null==r){var u=e.getGraphBounds();null!=u&&(h.setAttribute("x",Math.round(u.x)),h.setAttribute("y",Math.round(u.y)),h.setAttribute("width",Math.round(u.width)),h.setAttribute("height",Math.round(u.height))),h.setAttribute("scale",e.scale)}else if(null!=s&&null!=l){for(var d in s.style){var p=s.style[d];"function"==typeof p&&"object"==typeof p&&(p=mxStyleRegistry.getName(p)),null!=p&&"function"!=typeof p&&"object"!=typeof p&&h.setAttribute(d,p)}var m=s.absolutePoints;if(null!=m&&m.length>0){var c=Math.round(m[0].x)+","+Math.round(m[0].y);for(d=1;d0&&n.appendChild(r)}}return n},t.getStringValue=function(t,e){var n=typeof e;return"function"==n?e=mxStyleRegistry.getName(e):"object"==n&&(e=null),e},t.decode=function(t,e,n){var i=n||new this.template.constructor,s=e.getAttribute("id");for(null!=s&&(t.objects[s]=i),e=e.firstChild;null!=e;){if(!this.processInclude(t,e,i)&&"add"==e.nodeName){var r=e.getAttribute("as");if(null!=r){var o=e.getAttribute("extend"),l=null!=o?mxUtils.clone(i.styles[o]):null;null==l&&(null!=o&&mxLog.warn("mxStylesheetCodec.decode: stylesheet "+o+" not found to extend"),l=new Object);for(var a=e.firstChild;null!=a;){if(a.nodeType==mxConstants.NODETYPE_ELEMENT){var h=a.getAttribute("as");if("add"==a.nodeName){var u=mxUtils.getTextContent(a),d=null;null!=u&&u.length>0&&mxStylesheetCodec.allowEval?d=mxUtils.eval(u):(d=a.getAttribute("value"),mxUtils.isNumeric(d)&&(d=parseFloat(d))),null!=d&&(l[h]=d)}else"remove"==a.nodeName&&delete l[h]}a=a.nextSibling}i.putCellStyle(r,l)}}e=e.nextSibling}return i},t}());mxStylesheetCodec.allowEval=!0,__mxOutput.mxStylesheetCodec=void 0!==mxStylesheetCodec?mxStylesheetCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultKeyHandler);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n)for(n.editor,e=e.firstChild;null!=e;){if(!this.processInclude(t,e,n)&&"add"==e.nodeName){var i=e.getAttribute("as"),s=e.getAttribute("action"),r=e.getAttribute("control");n.bindAction(i,s,r)}e=e.nextSibling}return n},t}()),__mxOutput.mxDefaultKeyHandlerCodec="undefined"!=typeof mxDefaultKeyHandlerCodec?mxDefaultKeyHandlerCodec:void 0;var mxDefaultToolbarCodec=mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultToolbar);return t.encode=function(t,e){return null},t.decode=function(t,e,n){if(null!=n){var i=n.editor;for(e=e.firstChild;null!=e;){if(e.nodeType==mxConstants.NODETYPE_ELEMENT&&!this.processInclude(t,e,n))if("separator"==e.nodeName)n.addSeparator();else if("br"==e.nodeName)n.toolbar.addBreak();else if("hr"==e.nodeName)n.toolbar.addLine();else if("add"==e.nodeName){var s=e.getAttribute("as");s=mxResources.get(s)||s;var r=e.getAttribute("icon"),o=e.getAttribute("pressedIcon"),l=e.getAttribute("action"),a=e.getAttribute("mode"),h=e.getAttribute("template"),u="0"!=e.getAttribute("toggle"),d=mxUtils.getTextContent(e),p=null;if(null!=l)p=n.addItem(s,r,l,o);else if(null!=a){var m=mxDefaultToolbarCodec.allowEval?mxUtils.eval(d):null;p=n.addMode(s,r,a,o,m)}else if(null!=h||null!=d&&d.length>0){var c=i.templates[h],g=e.getAttribute("style");null!=c&&null!=g&&(c=i.graph.cloneCell(c)).setStyle(g);var x=null;null!=d&&d.length>0&&mxDefaultToolbarCodec.allowEval&&(x=mxUtils.eval(d)),p=n.addPrototype(s,r,c,o,x,u)}else{var y=mxUtils.getChildNodes(e);if(y.length>0)if(null==r)for(var f=n.addActionCombo(s),v=0;v0&&p.setAttribute("id",L)}}e=e.nextSibling}}return n},t}());return mxDefaultToolbarCodec.allowEval=!0,__mxOutput.mxDefaultToolbarCodec=void 0!==mxDefaultToolbarCodec?mxDefaultToolbarCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxDefaultPopupMenu);return t.encode=function(t,e){return null},t.decode=function(t,e,n){var i=e.getElementsByTagName("include")[0];return null!=i?this.processInclude(t,i,n):null!=n&&(n.config=e),n},t}()),__mxOutput.mxDefaultPopupMenuCodec="undefined"!=typeof mxDefaultPopupMenuCodec?mxDefaultPopupMenuCodec:void 0,mxCodecRegistry.register(function(){var t=new mxObjectCodec(new mxEditor,["modified","lastSnapshot","ignoredChanges","undoManager","graphContainer","toolbarContainer"]);return t.afterDecode=function(t,e,n){var i=e.getAttribute("defaultEdge");null!=i&&(e.removeAttribute("defaultEdge"),n.defaultEdge=n.templates[i]);var s=e.getAttribute("defaultGroup");return null!=s&&(e.removeAttribute("defaultGroup"),n.defaultGroup=n.templates[s]),n},t.decodeChild=function(t,e,n){if("Array"==e.nodeName){if("templates"==e.getAttribute("as"))return void this.decodeTemplates(t,e,n)}else if("ui"==e.nodeName)return void this.decodeUi(t,e,n);mxObjectCodec.prototype.decodeChild.apply(this,arguments)},t.decodeUi=function(t,e,n){for(var i=e.firstChild;null!=i;){if("add"==i.nodeName){var s=i.getAttribute("as"),r=i.getAttribute("element"),o=i.getAttribute("style"),l=null;if(null!=r)null!=(l=document.getElementById(r))&&null!=o&&(l.style.cssText+=";"+o);else{var a=parseInt(i.getAttribute("x")),h=parseInt(i.getAttribute("y")),u=i.getAttribute("width"),d=i.getAttribute("height");(l=document.createElement("div")).style.cssText=o,new mxWindow(mxResources.get(s)||s,l,a,h,u,d,!1,!0).setVisible(!0)}"graph"==s?n.setGraphContainer(l):"toolbar"==s?n.setToolbarContainer(l):"title"==s?n.setTitleContainer(l):"status"==s?n.setStatusContainer(l):"map"==s&&n.setMapContainer(l)}else"resource"==i.nodeName?mxResources.add(i.getAttribute("basename")):"stylesheet"==i.nodeName&&mxClient.link("stylesheet",i.getAttribute("name"));i=i.nextSibling}},t.decodeTemplates=function(t,e,n){null==n.templates&&(n.templates=[]);for(var i=mxUtils.getChildNodes(e),s=0;s"true"==mxUtils.getValue(t,BpmnStyleIdentifier.IS_INSTANTIATING,"false"),convertDefaultValue=t=>"default"==t?void 0:t,updateStroke=(t,e)=>(e&&(t=setStyle(t,mxConstants.STYLE_STROKECOLOR,e.color,convertDefaultValue),t=setStyle(t,mxConstants.STYLE_STROKE_OPACITY,e.opacity,ensureOpacityValue),t=setStyle(t,mxConstants.STYLE_STROKEWIDTH,e.width,ensureStrokeWidthValue)),t),setStyle=(t,e,n,i=(t=>t))=>null==n?t:mxUtils.setStyle(t,e,i(n)),setStyleFlag=(t,e,n,i)=>null==i?t:mxUtils.setStyleFlag(t,e,n,i),updateFont=(t,e)=>(e&&(t=setStyle(t,mxConstants.STYLE_FONTCOLOR,e.color,convertDefaultValue),t=setStyle(t,mxConstants.STYLE_FONTSIZE,e.size),t=setStyle(t,mxConstants.STYLE_FONTFAMILY,e.family),t=setStyleFlag(t,mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_BOLD,e.isBold),t=setStyleFlag(t,mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_ITALIC,e.isItalic),t=setStyleFlag(t,mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_UNDERLINE,e.isUnderline),t=setStyleFlag(t,mxConstants.STYLE_FONTSTYLE,mxConstants.FONT_STRIKETHROUGH,e.isStrikeThrough),t=setStyle(t,mxConstants.STYLE_TEXT_OPACITY,e.opacity,ensureOpacityValue)),t),convertDirection=t=>{switch(t){case"right-to-left":return mxConstants.DIRECTION_WEST;case"bottom-to-top":return mxConstants.DIRECTION_NORTH;case"top-to-bottom":return mxConstants.DIRECTION_SOUTH;default:return mxConstants.DIRECTION_EAST}},updateFill=(t,e)=>{const n=e.color;if(n){const e=isFillColorGradient(n),i=e?n.startColor:n;t=setStyle(t,mxConstants.STYLE_FILLCOLOR,i,convertDefaultValue),e?(t=mxUtils.setStyle(t,mxConstants.STYLE_GRADIENTCOLOR,n.endColor),t=mxUtils.setStyle(t,mxConstants.STYLE_GRADIENT_DIRECTION,convertDirection(n.direction))):"default"===n&&(t=mxUtils.setStyle(t,mxConstants.STYLE_GRADIENTCOLOR,void 0),t=mxUtils.setStyle(t,mxConstants.STYLE_GRADIENT_DIRECTION,void 0)),(t.includes(exports.ShapeBpmnElementKind.POOL)||t.includes(exports.ShapeBpmnElementKind.LANE))&&(t=setStyle(t,mxConstants.STYLE_SWIMLANE_FILLCOLOR,i,convertDefaultValue))}return t=setStyle(t,mxConstants.STYLE_FILL_OPACITY,e.opacity,ensureOpacityValue)},isShapeStyleUpdate=t=>t&&"object"==typeof t&&"fill"in t,isFillColorGradient=t=>t&&"object"==typeof t,arrowDefaultSize=12;class StyleConfigurator{constructor(t){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"specificFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new MapWithDefault([[exports.FlowKind.SEQUENCE_FLOW,t=>{t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_BLOCK_THIN}],[exports.FlowKind.MESSAGE_FLOW,t=>{t[mxConstants.STYLE_DASHED]=!0,t[mxConstants.STYLE_DASH_PATTERN]="8 5",t[mxConstants.STYLE_STARTARROW]=mxConstants.ARROW_OVAL,t[mxConstants.STYLE_STARTSIZE]=8,t[mxConstants.STYLE_STARTFILL]=!0,t[BpmnStyleIdentifier.EDGE_START_FILL_COLOR]=StyleDefault.MESSAGE_FLOW_MARKER_START_FILL_COLOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_BLOCK_THIN,t[mxConstants.STYLE_ENDFILL]=!0,t[BpmnStyleIdentifier.EDGE_END_FILL_COLOR]=StyleDefault.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[exports.FlowKind.ASSOCIATION_FLOW,t=>{t[mxConstants.STYLE_DASHED]=!0,t[mxConstants.STYLE_DASH_PATTERN]="1 2",t[mxConstants.STYLE_STARTSIZE]=arrowDefaultSize}]])}),Object.defineProperty(this,"specificSequenceFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new MapWithDefault([[exports.SequenceFlowKind.DEFAULT,t=>{t[mxConstants.STYLE_STARTARROW]=MarkerIdentifier.ARROW_DASH}],[exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY,t=>{t[mxConstants.STYLE_STARTARROW]=mxConstants.ARROW_DIAMOND_THIN,t[mxConstants.STYLE_STARTSIZE]=18,t[mxConstants.STYLE_STARTFILL]=!0,t[BpmnStyleIdentifier.EDGE_START_FILL_COLOR]=StyleDefault.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]])}),Object.defineProperty(this,"specificAssociationFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new MapWithDefault([[exports.AssociationDirectionKind.NONE,t=>{}],[exports.AssociationDirectionKind.ONE,t=>{t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_OPEN_THIN}],[exports.AssociationDirectionKind.BOTH,t=>{t[mxConstants.STYLE_STARTARROW]=mxConstants.ARROW_OPEN_THIN,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_OPEN_THIN}]])})}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){const t=this.getStylesheet().getDefaultVertexStyle();configureCommonDefaultStyle(t),t[mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[mxConstants.STYLE_ARCSIZE]=StyleDefault.SHAPE_ARC_SIZE}configurePoolStyle(){const t={};t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_SWIMLANE,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STARTSIZE]=StyleDefault.POOL_LABEL_SIZE,t[mxConstants.STYLE_FILLCOLOR]=StyleDefault.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.POOL,t)}configureLaneStyle(){const t={};t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_SWIMLANE,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_SWIMLANE_LINE]=0,t[mxConstants.STYLE_STARTSIZE]=StyleDefault.LANE_LABEL_SIZE,t[mxConstants.STYLE_FILLCOLOR]=StyleDefault.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.LANE,t)}configureEventStyles(){ShapeUtil.eventKinds().forEach((t=>{const e={};e[mxConstants.STYLE_SHAPE]=t,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.EllipsePerimeter,e[mxConstants.STYLE_STROKEWIDTH]=t==exports.ShapeBpmnElementKind.EVENT_END?StyleDefault.STROKE_WIDTH_THICK:StyleDefault.STROKE_WIDTH_THIN,e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)}))}configureTextAnnotationStyle(){const t={};t[mxConstants.STYLE_SHAPE]=exports.ShapeBpmnElementKind.TEXT_ANNOTATION,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_LEFT,t[mxConstants.STYLE_SPACING_LEFT]=5,t[mxConstants.STYLE_FILLCOLOR]=StyleDefault.TEXT_ANNOTATION_FILL_COLOR,t[mxConstants.STYLE_STROKEWIDTH]=StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[mxConstants.STYLE_ROUNDED]=!0,t[mxConstants.STYLE_DASHED]=!0,t[mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",t[mxConstants.STYLE_STROKEWIDTH]=StyleDefault.STROKE_WIDTH_THIN,t[mxConstants.STYLE_FILLCOLOR]=StyleDefault.GROUP_FILL_COLOR,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_TOP,this.putCellStyle(exports.ShapeBpmnElementKind.GROUP,t)}configureActivityStyles(){ShapeUtil.activityKinds().forEach((t=>{const e={};e[mxConstants.STYLE_SHAPE]=t,e[mxConstants.STYLE_ROUNDED]=!0,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,e[mxConstants.STYLE_STROKEWIDTH]=t==exports.ShapeBpmnElementKind.CALL_ACTIVITY?StyleDefault.STROKE_WIDTH_THICK:StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(t,e)}))}configureGatewayStyles(){ShapeUtil.gatewayKinds().forEach((t=>{const e={};e[mxConstants.STYLE_SHAPE]=t,e[mxConstants.STYLE_PERIMETER]=mxPerimeter.RhombusPerimeter,e[mxConstants.STYLE_STROKEWIDTH]=StyleDefault.STROKE_WIDTH_THIN,e[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_TOP,e[mxConstants.STYLE_LABEL_POSITION]=mxConstants.ALIGN_LEFT,e[mxConstants.STYLE_VERTICAL_LABEL_POSITION]=mxConstants.ALIGN_TOP,this.putCellStyle(t,e)}))}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();configureCommonDefaultStyle(t),t[mxConstants.STYLE_SHAPE]=BpmnStyleIdentifier.EDGE,t[mxConstants.STYLE_ENDSIZE]=arrowDefaultSize,t[mxConstants.STYLE_STROKEWIDTH]=1.5,t[mxConstants.STYLE_ROUNDED]=!0,t[mxConstants.STYLE_ARCSIZE]=5,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_BOTTOM,delete t[mxConstants.STYLE_ENDARROW]}configureEdgeStyles(t,e){t.forEach((t=>{const n={};e.get(t)(n),this.graph.getStylesheet().putCellStyle(t.toString(),n)}))}configureFlowStyles(){this.configureEdgeStyles(Object.values(exports.FlowKind),this.specificFlowStyles),this.configureEdgeStyles(Object.values(exports.SequenceFlowKind),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(exports.AssociationDirectionKind),this.specificAssociationFlowStyles)}}function configureCommonDefaultStyle(t){t[mxConstants.STYLE_FONTFAMILY]=StyleDefault.DEFAULT_FONT_FAMILY,t[mxConstants.STYLE_FONTSIZE]=StyleDefault.DEFAULT_FONT_SIZE,t[mxConstants.STYLE_FONTCOLOR]=StyleDefault.DEFAULT_FONT_COLOR,t[mxConstants.STYLE_FILLCOLOR]=StyleDefault.DEFAULT_FILL_COLOR,t[mxConstants.STYLE_STROKECOLOR]=StyleDefault.DEFAULT_STROKE_COLOR,t[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=mxConstants.NONE,t[mxConstants.STYLE_WHITE_SPACE]="wrap"}class MapWithDefault extends Map{get(t){var e;return null!==(e=super.get(t))&&void 0!==e?e:()=>{}}}function computeScaledIconSize(t,e,n,i){let s,r;t.heightt.setIconOriginForIconCentered(),shapeConfig:{x:e,y:n,width:i,height:s,strokeWidth:r.strokewidth||mxUtils.getValue(r.style,mxConstants.STYLE_STROKEWIDTH,StyleDefault.STROKE_WIDTH_THIN)},iconStyleConfig:{isFilled:l,fillColor:r.fill||mxUtils.getValue(r.style,mxConstants.STYLE_FILLCOLOR,StyleDefault.DEFAULT_FILL_COLOR),strokeColor:r.stroke||mxUtils.getValue(r.style,mxConstants.STYLE_STROKECOLOR,StyleDefault.DEFAULT_STROKE_COLOR),strokeWidth:a,margin:mxUtils.getValue(r.style,mxConstants.STYLE_MARGIN,StyleDefault.DEFAULT_MARGIN)}}}class IconPainter{paintEmptyIcon(){}newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:n,shapeConfig:i,iconStyleConfig:s},r){return new BpmnCanvas({canvas:t,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:s,ratioFromParent:e,setIconOriginFunct:n}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;n.rect(0,0,i,s),n.fillAndStroke();const{iconStyleConfig:r}=t;r.isFilled&&n.setStrokeColor(r.fillColor),n.begin(),n.moveTo(0,0),n.lineTo(.5*i,.6*s),n.lineTo(i,0),n.moveTo(0,s),n.lineTo(i/3,.45*s),n.moveTo(i,s),n.lineTo(2*i/3,.45*s),n.stroke()}paintCircleIcon(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;i>0&&s>0&&n.ellipse(0,0,i,s),t.iconStyleConfig.isFilled?n.fillAndStroke():n.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintAsteriskIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});drawVerticalLine(t,e),e.fillAndStroke(),drawVerticalLine(t,e),e.rotateOnIconCenter(60),e.fillAndStroke(),drawVerticalLine(t,e),e.rotateOnIconCenter(240),e.fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0})}),{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});IconPainter.paintGearIconBackground(e),e.translateIconOrigin(14,14),IconPainter.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();IconPainter.paintGearInnerCircle(t,24.8,39)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();IconPainter.paintGearInnerCircle(t,39.2,55.8),t.begin(),IconPainter.paintGearInnerCircle(t,39.2,55.8)}static paintGearInnerCircle(t,e,n){const i=13.5;t.moveTo(e,n),t.arcTo(i,i,0,1,1,e+27,n),t.arcTo(i,i,0,0,1,e,n),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),i=e.width,s=e.height;n.roundrect(0,0,i,s,2,2),n.stroke(),n.begin(),n.moveTo(i/2,s/4),n.lineTo(i/2,3*s/4),n.close(),n.moveTo(i/4,s/2),n.lineTo(3*i/4,s/2),n.close(),n.fillAndStroke()}paintLoopIcon(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const n=this.newBpmnCanvas(t,{width:22.49,height:21.62});n.begin(),n.moveTo(5.5,19.08),n.arcTo(8,8,0,1,1,10.5,21.08),n.stroke(),n.begin(),n.moveTo(7.5,14.08),n.lineTo(5.75,19.08),n.lineTo(0,17.08),n.close(),n.fillAndStroke()}paintSequentialMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:s}=t;i.setFillColor(s.strokeColor);const r=e.width,o=e.height/5;n.rect(0,0,r,o),n.fill(),n.rect(0,2*o,r,o),n.fill(),n.rect(0,4*o,r,o),n.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},n=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:s}=t;i.setFillColor(s.strokeColor);const r=e.width/5,o=e.height;n.begin(),n.rect(0,0,r,o),n.fill(),n.rect(2*r,0,r,o),n.fill(),n.rect(4*r,0,r,o),n.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}function drawVerticalLine(t,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class IconPainterProvider{static get(){return this.instance}static set(t){this.instance=t}}Object.defineProperty(IconPainterProvider,"instance",{enumerable:!0,configurable:!0,writable:!0,value:new IconPainter});class EventShape extends mxgraph.mxEllipse{constructor(){super(void 0,void 0,void 0),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:IconPainterProvider.get()}),Object.defineProperty(this,"iconPainters",{enumerable:!0,configurable:!0,writable:!0,value:new Map([[exports.ShapeBpmnEventDefinitionKind.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{ratioFromParent:.5}))],[exports.ShapeBpmnEventDefinitionKind.TERMINATE,t=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6}))],[exports.ShapeBpmnEventDefinitionKind.TIMER,t=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(5)}))],[exports.ShapeBpmnEventDefinitionKind.SIGNAL,t=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:StyleDefault.STROKE_WIDTH_THIN.valueOf()}),setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(4)}))],[exports.ShapeBpmnEventDefinitionKind.LINK,t=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.ERROR,t=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},t),{ratioFromParent:.7,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.CANCEL,t=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{ratioFromParent:.78}))],[exports.ShapeBpmnEventDefinitionKind.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:StyleDefault.STROKE_WIDTH_THIN.valueOf()})}))],[exports.ShapeBpmnEventDefinitionKind.CONDITIONAL,t=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1.5})}))]])}),Object.defineProperty(this,"withFilledIcon",{enumerable:!0,configurable:!0,writable:!0,value:!1})}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,isFilled:this.withFilledIcon});EventShape.setDashedOuterShapePattern(r,mxUtils.getValue(this.style,BpmnStyleIdentifier.IS_INTERRUPTING,void 0)),this.paintOuterShape(r),EventShape.restoreOriginalOuterShapePattern(r),this.paintInnerShape(r)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s}}){super.paintVertexShape(t,e,n,i,s)}paintInnerShape(t){var e;(null!==(e=this.iconPainters.get(mxUtils.getValue(this.style,BpmnStyleIdentifier.EVENT_DEFINITION_KIND,exports.ShapeBpmnEventDefinitionKind.NONE)))&&void 0!==e?e:()=>this.iconPainter.paintEmptyIcon())(t)}static setDashedOuterShapePattern(t,e){t.canvas.save(),"false"===e&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class EndEventShape extends EventShape{constructor(){super(),this.withFilledIcon=!0}}class IntermediateEventShape extends EventShape{paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s,strokeWidth:r}}){t.ellipse(e,n,i,s),t.fillAndStroke();const o=1.5*r;t.ellipse(.02*i+o+e,.02*s+o+n,.96*i-2*o,.96*s-2*o),t.stroke()}}class ThrowIntermediateEventShape extends IntermediateEventShape{constructor(){super(),this.withFilledIcon=!0}}class GatewayShape extends mxgraph.mxRhombus{constructor(){super(...arguments),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:IconPainterProvider.get()})}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this});this.paintOuterShape(r),this.paintInnerShape(r)}paintOuterShape({canvas:t,shapeConfig:{x:e,y:n,width:i,height:s}}){super.paintVertexShape(t,e,n,i,s)}}class ExclusiveGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class ParallelGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class InclusiveGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.62,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!1,strokeWidth:StyleDefault.STROKE_WIDTH_THICK.valueOf()})}))}}class ComplexGatewayShape extends GatewayShape{paintInnerShape(t){this.iconPainter.paintAsteriskIcon(Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class EventBasedGatewayShape extends GatewayShape{paintInnerShape(t){t=Object.assign(Object.assign({},t),{iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.55})),getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},t),{ratioFromParent:.45}));const e=Object.assign(Object.assign({},t),{ratioFromParent:.3});mxUtils.getValue(this.style,BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND,exports.ShapeBpmnEventBasedGatewayKind.Exclusive)==exports.ShapeBpmnEventBasedGatewayKind.Parallel?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const referenceOrderedMarkers=[exports.ShapeBpmnMarkerKind.LOOP,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL,exports.ShapeBpmnMarkerKind.COMPENSATION,exports.ShapeBpmnMarkerKind.EXPAND,exports.ShapeBpmnMarkerKind.ADHOC];function orderActivityMarkers(t){const e=referenceOrderedMarkers.filter((e=>t.includes(e)));return t.filter((t=>!e.includes(t))).forEach((t=>e.push(t))),e}function paintEnvelopeIcon(t,e){IconPainterProvider.get().paintEnvelopeIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:e})}))}class BaseActivityShape extends mxRectangleShape{constructor(){super(void 0,void 0,void 0),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:IconPainterProvider.get()})}paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s),this.paintMarkerIcons(buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const e=mxUtils.getValue(this.style,BpmnStyleIdentifier.MARKERS,void 0);e&&orderActivityMarkers(e.split(",")).forEach(((e,n,i)=>{switch((t=Object.assign(Object.assign({},t),{setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,n+1)})).canvas.save(),e){case exports.ShapeBpmnMarkerKind.LOOP:this.iconPainter.paintLoopIcon(t);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case exports.ShapeBpmnMarkerKind.EXPAND:this.iconPainter.paintExpandIcon(t)}t.canvas.restore()}))}getMarkerIconOriginFunction(t,e){let n;return n=1===t?t=>t.setIconOriginForIconBottomCentered():t=>{t.setIconOriginForIconBottomCentered();const n=Math.pow(-1,e)*(StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);t.translateIconOrigin(n,0)},n}}class BaseTaskShape extends BaseActivityShape{paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s),this.paintTaskIcon(buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this}))}}class TaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class ServiceTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class UserTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},t),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ReceiveTaskShape extends BaseTaskShape{paintTaskIcon(t){if(!getBpmnIsInstantiating(this.style))return void paintEnvelopeIcon(t,!1);const e=Object.assign(Object.assign({},t.shapeConfig),{width:20,height:20});this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:e,iconStyleConfig:Object.assign(Object.assign({},t.iconStyleConfig),{isFilled:!1}),ratioFromParent:void 0,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(4,4)}),e.x+=4,e.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},t),{shapeConfig:e,ratioFromParent:.65,setIconOriginFunct:t=>t.setIconOriginForIconCentered()}))}}class SendTaskShape extends BaseTaskShape{paintTaskIcon(t){paintEnvelopeIcon(t,!0)}}class ManualTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},t),{ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class ScriptTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},t),{ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}))}}class CallActivityShape extends BaseActivityShape{paintForeground(t,e,n,i,s){super.paintForeground(t,e,n,i,s);const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this});switch(mxUtils.getValue(this.style,BpmnStyleIdentifier.GLOBAL_TASK_KIND,void 0)){case exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon(Object.assign(Object.assign({},r),{ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},r),{ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},r),{setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon(Object.assign(Object.assign({},r),{ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class SubProcessShape extends BaseActivityShape{paintBackground(t,e,n,i,s){const r=mxUtils.getValue(this.style,BpmnStyleIdentifier.SUB_PROCESS_KIND,void 0);if(t.save(),r===exports.ShapeBpmnSubProcessKind.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,n,i,s),r===exports.ShapeBpmnSubProcessKind.TRANSACTION){const r=StyleDefault.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,o=StyleDefault.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;t.roundrect(e+r,n+r,i-2*r,s-2*r,o,o),t.stroke()}t.restore()}}class BusinessRuleTaskShape extends BaseTaskShape{paintTaskIcon(t){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},t),{ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)}))}}class TextAnnotationShape extends mxRectangleShape{paintForeground(t,e,n,i,s){t.begin(),t.moveTo(e+StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n),t.lineTo(e,n),t.lineTo(e,n+s),t.lineTo(e+StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n+s),t.stroke()}paintBackground(t,e,n,i,s){t.save(),t.setStrokeColor("none"),super.paintBackground(t,e,n,i,s),t.restore()}}class MessageFlowIconShape extends mxRectangleShape{constructor(t,e,n,i){super(t,e,n,i),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:IconPainterProvider.get()})}paintVertexShape(t,e,n,i,s){const r=buildPaintParameter({canvas:t,x:e,y:n,width:i,height:s,shape:this,ratioFromParent:1,isFilled:"false"==mxUtils.getValue(this.style,BpmnStyleIdentifier.IS_INITIATING,"true")});this.iconPainter.paintEnvelopeIcon(r)}}function computeAllBpmnClassNamesOfCell(t,e){return computeAllBpmnClassNames(t.style,e)}function computeAllBpmnClassNames(t,e){const n=[],i=t.split(";"),s=i[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",ShapeUtil.isActivity(s)),r.set("bpmn-type-container",ShapeUtil.isPoolOrLane(s)),r.set("bpmn-type-event",ShapeUtil.isEvent(s)),r.set("bpmn-type-flow",isFlowKind(s)),r.set("bpmn-type-gateway",ShapeUtil.isGateway(s)),r.set("bpmn-type-task",ShapeUtil.isTask(s)),[...r].filter((([,t])=>t)).forEach((([t])=>n.push(t))),n.push(computeBpmnBaseClassName(s)),i.map((t=>{const e=t.split("=");return[e[0],e[1]]})).forEach((([t,e])=>{switch(t){case BpmnStyleIdentifier.EVENT_DEFINITION_KIND:n.push(`bpmn-event-def-${e}`);break;case BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND:n.push(`bpmn-gateway-kind-${e.toLowerCase()}`);break;case BpmnStyleIdentifier.IS_INITIATING:n.push("true"==e?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break;case BpmnStyleIdentifier.SUB_PROCESS_KIND:n.push(`bpmn-sub-process-${e.toLowerCase()}`);break;case BpmnStyleIdentifier.GLOBAL_TASK_KIND:n.push(computeBpmnBaseClassName(e))}})),e&&n.push("bpmn-label"),n}function isFlowKind(t){return Object.values(exports.FlowKind).map((t=>t)).includes(t)}function computeBpmnBaseClassName(t){return t?"bpmn-"+t.replace(/([A-Z])/g,(t=>"-"+t[0].toLowerCase())):""}class MxGraphCustomOverlay extends mxgraph.mxCellOverlay{constructor(t,e){super(null,"",e.position.horizontalAlign,e.position.verticalAlign,null,"default"),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.style=e.style}getBounds(t){const e=t.view.graph.getModel().isEdge(t.cell),n=t.view.scale;let i;return e?i=this.computeEdgeBounds(t):(i=new mxPoint,this.align==mxConstants.ALIGN_LEFT?i.x=t.x:this.align==mxConstants.ALIGN_CENTER?i.x=t.x+t.width/2:i.x=t.x+t.width,this.verticalAlign==mxConstants.ALIGN_TOP?i.y=t.y:this.verticalAlign==mxConstants.ALIGN_MIDDLE?i.y=t.y+t.height/2:i.y=t.y+t.height),new mxRectangle(Math.round(i.x-(0*this.defaultOverlap-this.offset.x)*n),Math.round(i.y-(0*this.defaultOverlap-this.offset.y)*n),0*n,0*n)}computeEdgeBounds(t){const e=t.absolutePoints;if(this.align==mxConstants.ALIGN_LEFT)return e[0];if(this.align==mxConstants.ALIGN_CENTER){if(e.length%2==1)return e[Math.floor(e.length/2)];{const t=e.length/2,n=e[t-1],i=e[t];return new mxPoint(n.x+(i.x-n.x)/2,n.y+(i.y-n.y)/2)}}return e[e.length-1]}}class OverlayBadgeShape extends mxgraph.mxText{constructor(t,e,n){super(t,e,void 0,void 0,n.font.color,void 0,n.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,n.fill.color,n.stroke.color),this.fillOpacity=n.fill.opacity,this.strokewidth=n.stroke.width}}class BpmnConnector extends mxgraph.mxConnector{constructor(t,e,n){super(t,e,n)}paintEdgeShape(t,e){const n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),null!=n&&(t.setFillColor(mxUtils.getValue(this.style,BpmnStyleIdentifier.EDGE_START_FILL_COLOR,this.stroke)),n()),null!=i&&(t.setFillColor(mxUtils.getValue(this.style,BpmnStyleIdentifier.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const n=getPointerEventsValue(t);setPointerEventsValue(t,"stroke"),this.paintLine(t,e,this.isRounded),setPointerEventsValue(t,n)}}function getPointerEventsValue(t){return t instanceof mxSvgCanvas2D?t.pointerEventsValue:null}function setPointerEventsValue(t,e){t instanceof mxSvgCanvas2D&&(t.pointerEventsValue=e)}class ShapeConfigurator{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_END,EndEventShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_START,EventShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW,ThrowIntermediateEventShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH,IntermediateEventShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.EVENT_BOUNDARY,IntermediateEventShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_COMPLEX,ComplexGatewayShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED,EventBasedGatewayShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,ExclusiveGatewayShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE,InclusiveGatewayShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.GATEWAY_PARALLEL,ParallelGatewayShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.SUB_PROCESS,SubProcessShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.CALL_ACTIVITY,CallActivityShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK,TaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SERVICE,ServiceTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_USER,UserTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_RECEIVE,ReceiveTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SEND,SendTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_MANUAL,ManualTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_SCRIPT,ScriptTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TASK_BUSINESS_RULE,BusinessRuleTaskShape),mxCellRenderer.registerShape(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,TextAnnotationShape),mxCellRenderer.registerShape(BpmnStyleIdentifier.EDGE,BpmnConnector),mxCellRenderer.registerShape(BpmnStyleIdentifier.MESSAGE_FLOW_ICON,MessageFlowIconShape)}initMxSvgCanvasPrototype(){mxSvgCanvas2D.prototype.getTextCss=function(){const t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection;let n="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: none; ";(t.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(n+="font-weight: bold; "),(t.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(n+="font-style: italic; ");const i=[];return(t.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(n+="text-decoration: "+i.join(" ")+"; "),n}}initMxShapePrototype(){mxgraph.mxShape.prototype.createSvgCanvas=function(){var t;const e=new mxSvgCanvas2D(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const n=this.getSvgScreenOffset();if(0!=n?this.node.setAttribute("transform","translate("+n+","+n+")"):this.node.removeAttribute("transform"),null===(t=this.state)||void 0===t?void 0:t.cell){let t=computeAllBpmnClassNamesOfCell(this.state.cell,this.dialect===mxConstants.DIALECT_STRICTHTML);const e=this.state.style[BpmnStyleIdentifier.EXTRA_CSS_CLASSES];"string"==typeof e&&(t=t.concat(e.split(","))),this.node.setAttribute("class",t.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(t){return Math.round(parseFloat(t))}),e}}initMxCellRendererCreateCellOverlays(){mxCellRenderer.prototype.createCellOverlays=function(t){const e=t.view.graph.getCellOverlays(t.cell);let n=null;if(null!=e){n=new mxgraph.mxDictionary;for(const i of e){const e=null!=t.overlays?t.overlays.remove(i):null;if(null!=e){n.put(i,e);continue}let s;i instanceof MxGraphCustomOverlay?s=new OverlayBadgeShape(i.label,new mxRectangle(0,0,0,0),i.style):(s=new mxgraph.mxImageShape(new mxRectangle(0,0,0,0),i.image.src),s.preserveImageAspect=!1),s.dialect=t.view.graph.dialect,s.overlay=i,this.initializeOverlay(t,s),this.installCellOverlayListeners(t,i,s),null!=i.cursor&&(s.node.style.cursor=i.cursor),s instanceof OverlayBadgeShape&&(s.node.classList.add("overlay-badge"),s.node.setAttribute("data-bpmn-id",t.cell.id)),n.put(i,s)}}null!=t.overlays&&t.overlays.visit((function(t,e){e.destroy()})),t.overlays=n}}}class MarkerConfigurator{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){mxgraph.mxMarker.addMarker(MarkerIdentifier.ARROW_DASH,((t,e,n,i,s,r,o,l,a)=>{const h=s*(o+a+4),u=r*(o+a+4);return function(){t.begin(),t.moveTo(i.x-h/2-u/2,i.y-u/2+h/2),t.lineTo(i.x+u/2-3*h/2,i.y-3*u/2-h/2),t.stroke()}}))}}var freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeGlobal$1=freeGlobal,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal$1||freeSelf||Function("return this")(),root$1=root,Symbol=root$1.Symbol,Symbol$1=Symbol,objectProto$1=Object.prototype,hasOwnProperty=objectProto$1.hasOwnProperty,nativeObjectToString$1=objectProto$1.toString,symToStringTag$1=Symbol$1?Symbol$1.toStringTag:void 0;function getRawTag(t){var e=hasOwnProperty.call(t,symToStringTag$1),n=t[symToStringTag$1];try{t[symToStringTag$1]=void 0;var i=!0}catch(t){}var s=nativeObjectToString$1.call(t);return i&&(e?t[symToStringTag$1]=n:delete t[symToStringTag$1]),s}var objectProto=Object.prototype,nativeObjectToString=objectProto.toString;function objectToString(t){return nativeObjectToString.call(t)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=Symbol$1?Symbol$1.toStringTag:void 0;function baseGetTag(t){return null==t?void 0===t?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(t)?getRawTag(t):objectToString(t)}function isObjectLike(t){return null!=t&&"object"==typeof t}var symbolTag="[object Symbol]";function isSymbol(t){return"symbol"==typeof t||isObjectLike(t)&&baseGetTag(t)==symbolTag}var reWhitespace=/\s/;function trimmedEndIndex(t){for(var e=t.length;e--&&reWhitespace.test(t.charAt(e)););return e}var reTrimStart=/^\s+/;function baseTrim(t){return t?t.slice(0,trimmedEndIndex(t)+1).replace(reTrimStart,""):t}function isObject(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var NAN=NaN,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsOctal=/^0o[0-7]+$/i,freeParseInt=parseInt;function toNumber$2(t){if("number"==typeof t)return t;if(isSymbol(t))return NAN;if(isObject(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=isObject(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=baseTrim(t);var n=reIsBinary.test(t);return n||reIsOctal.test(t)?freeParseInt(t.slice(2),n?2:8):reIsBadHex.test(t)?NAN:+t}var now=function(){return root$1.Date.now()},now$1=now,FUNC_ERROR_TEXT$1="Expected a function",nativeMax=Math.max,nativeMin=Math.min;function debounce(t,e,n){var i,s,r,o,l,a,h=0,u=!1,d=!1,p=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT$1);function m(e){var n=i,r=s;return i=s=void 0,h=e,o=t.apply(r,n)}function c(t){var n=t-a;return void 0===a||n>=e||n<0||d&&t-h>=r}function g(){var t=now$1();if(c(t))return x(t);l=setTimeout(g,function(t){var n=e-(t-a);return d?nativeMin(n,r-(t-h)):n}(t))}function x(t){return l=void 0,p&&i?m(t):(i=s=void 0,o)}function y(){var t=now$1(),n=c(t);if(i=arguments,s=this,a=t,n){if(void 0===l)return function(t){return h=t,l=setTimeout(g,e),u?m(t):o}(a);if(d)return clearTimeout(l),l=setTimeout(g,e),m(a)}return void 0===l&&(l=setTimeout(g,e)),o}return e=toNumber$2(e)||0,isObject(n)&&(u=!!n.leading,r=(d="maxWait"in n)?nativeMax(toNumber$2(n.maxWait)||0,e):r,p="trailing"in n?!!n.trailing:p),y.cancel=function(){void 0!==l&&clearTimeout(l),h=0,i=a=s=l=void 0},y.flush=function(){return void 0===l?o:x(now$1())},y}var FUNC_ERROR_TEXT="Expected a function";function throttle(t,e,n){var i=!0,s=!0;if("function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);return isObject(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),debounce(t,e,{leading:i,maxWait:e,trailing:s})}const zoomFactorIn=1.25,zoomFactorOut=1/zoomFactorIn;class BpmnGraph extends mxgraph.mxGraph{constructor(t){super(t),Object.defineProperty(this,"currentZoomLevel",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.zoomFactor=zoomFactorIn,this.container&&(this.container.style.cursor="default")}createGraphView(){return new BpmnGraphView(this)}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,e,n,i,s,r,o){const l=super.fit(t,e,n,i,s,r,o);return this.setCurrentZoomLevel(l),l}setCurrentZoomLevel(t){this.currentZoomLevel=null!=t?t:this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const e=null==t?void 0:t.type;if(null==e||e==exports.FitType.None)return;const n=ensurePositiveValue(null==t?void 0:t.margin);if(e!=exports.FitType.Center){let t=!1,i=!1;switch(e){case exports.FitType.Horizontal:i=!0;break;case exports.FitType.Vertical:t=!0}this.fit(this.border,!1,n,!0,t,i)}else{const t=3,e=this.getGraphBounds(),i=this.container.clientWidth-n,s=this.container.clientHeight-n,r=e.width/this.view.scale,o=e.height/this.view.scale,l=Math.min(t,Math.min(i/r,s/o));this.setCurrentZoomLevel(l),this.view.scaleAndTranslate(l,(n+i-r*l)/(2*l)-e.x/this.view.scale,(n+s-o*l)/(2*l)-e.y/this.view.scale)}}registerMouseWheelZoomListeners(t){t=ensureValidZoomConfiguration(t),mxEvent.addMouseWheelListener(debounce(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),mxEvent.addMouseWheelListener(throttle(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,e,n){if(n){const[t,n]=this.getEventRelativeCoordinates(e),[i,s,r]=this.getScaleAndTranslationDeltas(t,n);this.view.scaleAndTranslate(i,this.view.translate.x+s,this.view.translate.y+r),mxEvent.consume(e)}else this.currentZoomLevel*=t?zoomFactorIn:zoomFactorOut}createMouseWheelZoomListener(t){return(e,n)=>{if(mxEvent.isConsumed(e))return;const i=e;i.ctrlKey&&!i.altKey&&!i.shiftKey&&!i.metaKey&&this.manageMouseWheelZoomEvent(n,i,t)}}getEventRelativeCoordinates(t){const e=this.container.getBoundingClientRect();return[t.clientX-e.left,t.clientY-e.top]}getScaleAndTranslationDeltas(t,e){const[n,i]=this.calculateFactorAndScale(),[s,r]=this.calculateTranslationDeltas(n,i,2*t,2*e);return[i,s,r]}calculateTranslationDeltas(t,e,n,i){if(t>1){const s=(t-1)/(2*e);n*=-s,i*=-s}else{const e=(1/t-1)/(2*this.view.scale);n*=e,i*=e}return[n,i]}calculateFactorAndScale(){const t=Math.round(100*this.currentZoomLevel)/100;return[t/this.view.scale,t]}}class BpmnGraphView extends mxgraph.mxGraphView{getFloatingTerminalPoint(t,e,n,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,n,i);const s=t.absolutePoints;return i?s[1]:s[s.length-2]}}class GraphConfigurator{constructor(t){Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.graph=new BpmnGraph(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new StyleConfigurator(this.graph).configureStyles(),(new ShapeConfigurator).configureShapes(),(new MarkerConfigurator).configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var e;const n=this.graph.panningHandler;(null===(e=null==t?void 0:t.navigation)||void 0===e?void 0:e.enabled)?(n.addListener(mxEvent.PAN_START,this.getPanningHandler("grab")),n.addListener(mxEvent.PAN_END,this.getPanningHandler("default")),n.usePopupTrigger=!1,n.isForcePanningEvent=t=>mxEvent.isLeftMouseButton(t.getEvent())||mxEvent.isMultiTouchEvent(t.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(t.navigation.zoom)):(this.graph.setPanning(!1),n.setPinchEnabled(!1),n.isForcePanningEvent=t=>!1)}getPanningHandler(t){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=t)}}}class Flow{constructor(t,e,n,i,s){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"kind",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"sourceRefId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"targetRefId",{enumerable:!0,configurable:!0,writable:!0,value:s})}}class SequenceFlow extends Flow{constructor(t,e,n,i,s=exports.SequenceFlowKind.NORMAL){super(t,e,exports.FlowKind.SEQUENCE_FLOW,n,i),Object.defineProperty(this,"sequenceFlowKind",{enumerable:!0,configurable:!0,writable:!0,value:s})}}class MessageFlow extends Flow{constructor(t,e,n,i){super(t,e,exports.FlowKind.MESSAGE_FLOW,n,i)}}class AssociationFlow extends Flow{constructor(t,e,n,i,s=exports.AssociationDirectionKind.NONE){super(t,e,exports.FlowKind.ASSOCIATION_FLOW,n,i),Object.defineProperty(this,"associationDirectionKind",{enumerable:!0,configurable:!0,writable:!0,value:s})}}class CoordinatesTranslator{constructor(t){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t})}computeRelativeCoordinates(t,e){const n=this.getTranslateForRoot(t),i=e.x+n.x,s=e.y+n.y;return new mxPoint(i,s)}getTranslateForRoot(t){const e=this.graph.getModel(),n=new mxPoint(0,0);for(;null!=t;){const i=e.getGeometry(t);null!=i&&(n.x-=i.x,n.y-=i.y),t=e.getParent(t)}return n}computeEdgeCenter(t){const e=t.geometry.points,n=e[0],i=e[e.length-1];if(null!=n&&null!=i){const t=i.x-n.x,e=i.y-n.y;return new mxPoint(n.x+t/2,n.y+e/2)}}}class Shape{constructor(t,e,n,i,s){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bpmnElement",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"bounds",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"isHorizontal",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:{}})}}class ShapeBpmnElement{constructor(t,e,n,i,s=!1){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"kind",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"parentId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"instantiate",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"incomingIds",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"outgoingIds",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}class ShapeBpmnActivity extends ShapeBpmnElement{constructor(t,e,n,i,s,r=[]){super(t,e,n,i,s),Object.defineProperty(this,"markers",{enumerable:!0,configurable:!0,writable:!0,value:r})}}class ShapeBpmnCallActivity extends ShapeBpmnActivity{constructor(t,e,n,i,s,r){super(t,e,exports.ShapeBpmnElementKind.CALL_ACTIVITY,i,void 0,s),Object.defineProperty(this,"callActivityKind",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"globalTaskKind",{enumerable:!0,configurable:!0,writable:!0,value:r})}}class ShapeBpmnSubProcess extends ShapeBpmnActivity{constructor(t,e,n,i,s){n==exports.ShapeBpmnSubProcessKind.AD_HOC&&!s.includes(exports.ShapeBpmnMarkerKind.ADHOC)&&s.push(exports.ShapeBpmnMarkerKind.ADHOC),super(t,e,exports.ShapeBpmnElementKind.SUB_PROCESS,i,void 0,s),Object.defineProperty(this,"subProcessKind",{enumerable:!0,configurable:!0,writable:!0,value:n})}}class ShapeBpmnEvent extends ShapeBpmnElement{constructor(t,e,n,i,s){super(t,e,n,s),Object.defineProperty(this,"eventDefinitionKind",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class ShapeBpmnStartEvent extends ShapeBpmnEvent{constructor(t,e,n,i,s){super(t,e,exports.ShapeBpmnElementKind.EVENT_START,n,i),Object.defineProperty(this,"isInterrupting",{enumerable:!0,configurable:!0,writable:!0,value:s})}}class ShapeBpmnBoundaryEvent extends ShapeBpmnEvent{constructor(t,e,n,i,s=!0){super(t,e,exports.ShapeBpmnElementKind.EVENT_BOUNDARY,n,i),Object.defineProperty(this,"isInterrupting",{enumerable:!0,configurable:!0,writable:!0,value:s})}}class ShapeBpmnEventBasedGateway extends ShapeBpmnElement{constructor(t,e,n,i,s=exports.ShapeBpmnEventBasedGatewayKind.None){super(t,e,exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED,n,i),Object.defineProperty(this,"gatewayKind",{enumerable:!0,configurable:!0,writable:!0,value:s})}}class StyleComputer{constructor(t){var e;Object.defineProperty(this,"ignoreBpmnColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.ignoreBpmnColors=null===(e=null==t?void 0:t.ignoreBpmnColors)||void 0===e||e}computeStyle(t,e){const n=[t.bpmnElement.kind];let i;t instanceof Shape?i=this.computeShapeStyleValues(t):(n.push(...StyleComputer.computeEdgeBaseStyles(t)),i=this.computeEdgeStyleValues(t));const s=this.computeFontStyleValues(t),r=StyleComputer.computeLabelStyleValues(t,e);return n.concat(toArrayOfMxGraphStyleEntries([...i,...s,...r])).join(";")}computeShapeStyleValues(t){const e=new Map,n=t.bpmnElement;if(n instanceof ShapeBpmnEvent?StyleComputer.computeEventShapeStyle(n,e):n instanceof ShapeBpmnActivity?StyleComputer.computeActivityShapeStyle(n,e):ShapeUtil.isPoolOrLane(n.kind)?e.set(mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):n instanceof ShapeBpmnEventBasedGateway&&(e.set(BpmnStyleIdentifier.IS_INSTANTIATING,String(n.instantiate)),e.set(BpmnStyleIdentifier.EVENT_BASED_GATEWAY_KIND,String(n.gatewayKind))),!this.ignoreBpmnColors){const i=t.extensions,s=i.fillColor;s&&(e.set(mxConstants.STYLE_FILLCOLOR,s),ShapeUtil.isPoolOrLane(n.kind)&&e.set(mxConstants.STYLE_SWIMLANE_FILLCOLOR,s)),i.strokeColor&&e.set(mxConstants.STYLE_STROKECOLOR,i.strokeColor)}return e}static computeEventShapeStyle(t,e){e.set(BpmnStyleIdentifier.EVENT_DEFINITION_KIND,t.eventDefinitionKind),(t instanceof ShapeBpmnBoundaryEvent||t instanceof ShapeBpmnStartEvent&&void 0!==t.isInterrupting)&&e.set(BpmnStyleIdentifier.IS_INTERRUPTING,String(t.isInterrupting))}static computeActivityShapeStyle(t,e){t instanceof ShapeBpmnSubProcess?e.set(BpmnStyleIdentifier.SUB_PROCESS_KIND,t.subProcessKind):t.kind===exports.ShapeBpmnElementKind.TASK_RECEIVE?e.set(BpmnStyleIdentifier.IS_INSTANTIATING,String(t.instantiate)):t instanceof ShapeBpmnCallActivity&&e.set(BpmnStyleIdentifier.GLOBAL_TASK_KIND,t.globalTaskKind);const n=t.markers;n.length>0&&e.set(BpmnStyleIdentifier.MARKERS,n.join(","))}static computeEdgeBaseStyles(t){const e=[],n=t.bpmnElement;return n instanceof SequenceFlow&&e.push(n.sequenceFlowKind),n instanceof AssociationFlow&&e.push(n.associationDirectionKind),e}computeEdgeStyleValues(t){const e=new Map;if(!this.ignoreBpmnColors){const n=t.extensions;n.strokeColor&&e.set(mxConstants.STYLE_STROKECOLOR,n.strokeColor)}return e}computeFontStyleValues(t){var e,n;const i=new Map,s=null===(e=t.label)||void 0===e?void 0:e.font;if(s&&(i.set(mxConstants.STYLE_FONTFAMILY,s.name),i.set(mxConstants.STYLE_FONTSIZE,s.size),i.set(mxConstants.STYLE_FONTSTYLE,getFontStyleValue(s))),!this.ignoreBpmnColors){const e=null===(n=t.label)||void 0===n?void 0:n.extensions;(null==e?void 0:e.color)&&i.set(mxConstants.STYLE_FONTCOLOR,e.color)}return i}static computeLabelStyleValues(t,e){const n=new Map,i=t.bpmnElement;return e?(n.set(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP),t.bpmnElement.kind!=exports.ShapeBpmnElementKind.TEXT_ANNOTATION&&n.set(mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),t instanceof Shape&&(n.set(mxConstants.STYLE_LABEL_WIDTH,e.width+1),n.set(mxConstants.STYLE_LABEL_POSITION,"ignore"),n.set(mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE))):t instanceof Shape&&(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity&&i.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!i.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)&&n.set(mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_TOP),n}computeMessageFlowIconStyle(t){const e=[];return e.push(["shape",BpmnStyleIdentifier.MESSAGE_FLOW_ICON]),e.push([BpmnStyleIdentifier.IS_INITIATING,String(t.messageVisibleKind===exports.MessageVisibleKind.INITIATING)]),this.ignoreBpmnColors||t.extensions.strokeColor&&e.push([mxConstants.STYLE_STROKECOLOR,t.extensions.strokeColor]),toArrayOfMxGraphStyleEntries(e).join(";")}}function getFontStyleValue(t){let e=0;return t.isBold&&(e+=mxConstants.FONT_BOLD),t.isItalic&&(e+=mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=mxConstants.FONT_UNDERLINE),e}function toArrayOfMxGraphStyleEntries(t){return t.filter((([,t])=>t&&"undefined"!=t)).map((([t,e])=>`${t}=${e}`))}class BpmnRenderer{constructor(t,e,n){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"coordinatesTranslator",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"styleComputer",{enumerable:!0,configurable:!0,writable:!0,value:n})}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(e)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:n,otherFlowNodes:i,boundaryEvents:s,edges:r}){this.graph.batchUpdate((()=>{this.graph.getModel().clear(),this.insertShapes(t),this.insertShapes(e),this.insertShapes(n),this.insertShapes(i),this.insertShapes(s),this.insertEdges(r)}))}insertShapes(t){t.forEach((t=>this.insertShape(t)))}getParent(t){const e=this.getCell(t.parentId);return null!=e?e:this.graph.getDefaultParent()}insertShape(t){var e;const n=t.bpmnElement,i=this.getParent(n),s=t.bounds;let r=null===(e=t.label)||void 0===e?void 0:e.bounds;r=ShapeUtil.isPoolOrLane(n.kind)?void 0:r;const o=this.styleComputer.computeStyle(t,r);this.insertVertex(i,n.id,n.name,s,r,o)}insertEdges(t){t.forEach((t=>{var e;const n=t.bpmnElement,i=this.graph.getDefaultParent(),s=this.getCell(n.sourceRefId),r=this.getCell(n.targetRefId),o=null===(e=t.label)||void 0===e?void 0:e.bounds,l=this.styleComputer.computeStyle(t,o),a=this.graph.insertEdge(i,n.id,n.name,s,r,l);if(this.insertWaypoints(t.waypoints,a),o){a.geometry.width=o.width,a.geometry.height=o.height;const t=this.coordinatesTranslator.computeEdgeCenter(a);if(t){a.geometry.relative=!1;const e=this.coordinatesTranslator.computeRelativeCoordinates(a.parent,new mxPoint(o.x,o.y)),n=e.x+o.width/2-t.x,i=e.y-t.y;a.geometry.offset=new mxPoint(n,i)}}this.insertMessageFlowIconIfNeeded(t,a)}))}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof MessageFlow&&t.messageVisibleKind!==exports.MessageVisibleKind.NONE){const n=this.graph.insertVertex(e,messageFlowIconId(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));n.geometry.relative=!0,n.geometry.offset=new mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map((t=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new mxPoint(t.x,t.y)))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,n,i,s,r){const o=this.coordinatesTranslator.computeRelativeCoordinates(t,new mxPoint(i.x,i.y)),l=this.graph.insertVertex(t,e,n,o.x,o.y,i.width,i.height,r);if(s){const t=s.x-i.x,e=s.y-i.y;l.geometry.offset=new mxPoint(t,e)}return l}}function newBpmnRenderer(t,e){return new BpmnRenderer(t,new CoordinatesTranslator(t),new StyleComputer(e))}function messageFlowIconId(t){return`messageFlowIcon_of_${t}`}var validator$2={},util$3={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+e+"]["+(e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*",i=new RegExp("^"+n+"$");t.isExist=function(t){return void 0!==t},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,n){if(e){const i=Object.keys(e),s=i.length;for(let r=0;r5&&"xml"===i)return getErrorObject("InvalidXml","XML declaration allowed only at the start of the document.",getLineNumberForPosition(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function readCommentAndCDATA(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let n=1;for(e+=8;e"===t[e]&&(n--,0===n))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}validator$2.validate=function(t,e){e=Object.assign({},defaultOptions$2,e);const n=[];let i=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let r=0;r"!==t[r]&&" "!==t[r]&&"\t"!==t[r]&&"\n"!==t[r]&&"\r"!==t[r];r++)a+=t[r];if(a=a.trim(),"/"===a[a.length-1]&&(a=a.substring(0,a.length-1),r--),!validateTagName(a)){let e;return e=0===a.trim().length?"Invalid space after '<'.":"Tag '"+a+"' is an invalid name.",getErrorObject("InvalidTag",e,getLineNumberForPosition(t,r))}const h=readAttributeStr(t,r);if(!1===h)return getErrorObject("InvalidAttr","Attributes for '"+a+"' have open quote.",getLineNumberForPosition(t,r));let u=h.value;if(r=h.index,"/"===u[u.length-1]){const n=r-u.length;u=u.substring(0,u.length-1);const s=validateAttributeString(u,e);if(!0!==s)return getErrorObject(s.err.code,s.err.msg,getLineNumberForPosition(t,n+s.err.line));i=!0}else if(l){if(!h.tagClosed)return getErrorObject("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",getLineNumberForPosition(t,r));if(u.trim().length>0)return getErrorObject("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",getLineNumberForPosition(t,o));{const e=n.pop();if(a!==e.tagName){let n=getLineNumberForPosition(t,e.tagStartPos);return getErrorObject("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+a+"'.",getLineNumberForPosition(t,o))}0==n.length&&(s=!0)}}else{const l=validateAttributeString(u,e);if(!0!==l)return getErrorObject(l.err.code,l.err.msg,getLineNumberForPosition(t,r-u.length+l.err.line));if(!0===s)return getErrorObject("InvalidXml","Multiple possible root nodes found.",getLineNumberForPosition(t,r));-1!==e.unpairedTags.indexOf(a)||n.push({tagName:a,tagStartPos:o}),i=!0}for(r++;r