From c5dfea73d2e5771cad94cc8aca74e522cca49dd5 Mon Sep 17 00:00:00 2001 From: Process Analytics Bot <62586190+process-analytics-bot@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:23:58 +0200 Subject: [PATCH] chore(deps): bump bpmn-visualization from 0.38.0 to 0.38.1 (#240) --- inst/htmlwidgets/bpmnVisualizationR.yaml | 2 +- .../lib/bpmn-visualization/bpmn-visualization.min.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inst/htmlwidgets/bpmnVisualizationR.yaml b/inst/htmlwidgets/bpmnVisualizationR.yaml index 4552c4c..7d88bde 100644 --- a/inst/htmlwidgets/bpmnVisualizationR.yaml +++ b/inst/htmlwidgets/bpmnVisualizationR.yaml @@ -14,6 +14,6 @@ dependencies: - name: "bpmn-visualization" - version: "0.38.0" + version: "0.38.1" src: htmlwidgets/lib/bpmn-visualization/ script: bpmn-visualization.min.js diff --git a/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js b/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js index 4d3f501..920977f 100644 --- a/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js +++ b/inst/htmlwidgets/lib/bpmn-visualization/bpmn-visualization.min.js @@ -1,2 +1,2 @@ -/* bpmn-visualization v0.38.0 | Copyright (c) 2020-2023, Bonitasoft SA | Apache 2.0 license */ -var bpmnvisu=function(exports){"use strict";var FitType,ZoomType,ShapeBpmnElementKind,ShapeBpmnCallActivityKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventDefinitionKind,ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind;function convertEmptyStringAndObject(t,e){return""===t?e?{}:void 0:t}function ensureIsArray(t,e=!1){return null==t?[]:(Array.isArray(t)?t:[t]).map((t=>convertEmptyStringAndObject(t,e))).filter(Boolean)}function filter(t,e,n){let i="";return(null==n?void 0:n.startingWith)?i=i.concat(`^(${n.startingWith}).*`):(null==n?void 0:n.notStartingWith)&&(i=i.concat(`^(?!(${n.notStartingWith})).*`)),i=i.concat(`${e}$`),t.filter((t=>(null==n?void 0:n.ignoreCase)?new RegExp(i,"i").test(t):new RegExp(i).test(t)))}exports.FitType=void 0,FitType=exports.FitType||(exports.FitType={}),FitType.None="None",FitType.HorizontalVertical="HorizontalVertical",FitType.Horizontal="Horizontal",FitType.Vertical="Vertical",FitType.Center="Center",exports.ZoomType=void 0,ZoomType=exports.ZoomType||(exports.ZoomType={}),ZoomType.In="in",ZoomType.Out="out",exports.ShapeBpmnElementKind=void 0,ShapeBpmnElementKind=exports.ShapeBpmnElementKind||(exports.ShapeBpmnElementKind={}),ShapeBpmnElementKind.LANE="lane",ShapeBpmnElementKind.POOL="pool",ShapeBpmnElementKind.CALL_ACTIVITY="callActivity",ShapeBpmnElementKind.SUB_PROCESS="subProcess",ShapeBpmnElementKind.TASK="task",ShapeBpmnElementKind.TASK_USER="userTask",ShapeBpmnElementKind.TASK_SERVICE="serviceTask",ShapeBpmnElementKind.TASK_RECEIVE="receiveTask",ShapeBpmnElementKind.TASK_SEND="sendTask",ShapeBpmnElementKind.TASK_MANUAL="manualTask",ShapeBpmnElementKind.TASK_SCRIPT="scriptTask",ShapeBpmnElementKind.TASK_BUSINESS_RULE="businessRuleTask",ShapeBpmnElementKind.GLOBAL_TASK="globalTask",ShapeBpmnElementKind.GLOBAL_TASK_USER="globalUserTask",ShapeBpmnElementKind.GLOBAL_TASK_MANUAL="globalManualTask",ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT="globalScriptTask",ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",ShapeBpmnElementKind.GROUP="group",ShapeBpmnElementKind.TEXT_ANNOTATION="textAnnotation",ShapeBpmnElementKind.GATEWAY_PARALLEL="parallelGateway",ShapeBpmnElementKind.GATEWAY_EXCLUSIVE="exclusiveGateway",ShapeBpmnElementKind.GATEWAY_INCLUSIVE="inclusiveGateway",ShapeBpmnElementKind.GATEWAY_EVENT_BASED="eventBasedGateway",ShapeBpmnElementKind.GATEWAY_COMPLEX="complexGateway",ShapeBpmnElementKind.EVENT_START="startEvent",ShapeBpmnElementKind.EVENT_END="endEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",ShapeBpmnElementKind.EVENT_BOUNDARY="boundaryEvent",exports.ShapeBpmnCallActivityKind=void 0,ShapeBpmnCallActivityKind=exports.ShapeBpmnCallActivityKind||(exports.ShapeBpmnCallActivityKind={}),ShapeBpmnCallActivityKind.CALLING_PROCESS="process",ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK="global task",exports.ShapeBpmnEventBasedGatewayKind=void 0,ShapeBpmnEventBasedGatewayKind=exports.ShapeBpmnEventBasedGatewayKind||(exports.ShapeBpmnEventBasedGatewayKind={}),ShapeBpmnEventBasedGatewayKind.Exclusive="Exclusive",ShapeBpmnEventBasedGatewayKind.None="None",ShapeBpmnEventBasedGatewayKind.Parallel="Parallel",exports.ShapeBpmnEventDefinitionKind=void 0,ShapeBpmnEventDefinitionKind=exports.ShapeBpmnEventDefinitionKind||(exports.ShapeBpmnEventDefinitionKind={}),ShapeBpmnEventDefinitionKind.NONE="none",ShapeBpmnEventDefinitionKind.TERMINATE="terminate",ShapeBpmnEventDefinitionKind.CANCEL="cancel",ShapeBpmnEventDefinitionKind.COMPENSATION="compensate",ShapeBpmnEventDefinitionKind.CONDITIONAL="conditional",ShapeBpmnEventDefinitionKind.ERROR="error",ShapeBpmnEventDefinitionKind.ESCALATION="escalation",ShapeBpmnEventDefinitionKind.LINK="link",ShapeBpmnEventDefinitionKind.MESSAGE="message",ShapeBpmnEventDefinitionKind.SIGNAL="signal",ShapeBpmnEventDefinitionKind.TIMER="timer",exports.ShapeBpmnMarkerKind=void 0,ShapeBpmnMarkerKind=exports.ShapeBpmnMarkerKind||(exports.ShapeBpmnMarkerKind={}),ShapeBpmnMarkerKind.ADHOC="adhoc",ShapeBpmnMarkerKind.COMPENSATION="compensation",ShapeBpmnMarkerKind.EXPAND="expand",ShapeBpmnMarkerKind.LOOP="loop",ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL="parallel multi instance",ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",exports.ShapeBpmnSubProcessKind=void 0,ShapeBpmnSubProcessKind=exports.ShapeBpmnSubProcessKind||(exports.ShapeBpmnSubProcessKind={}),ShapeBpmnSubProcessKind.AD_HOC="ad_hoc",ShapeBpmnSubProcessKind.EMBEDDED="embedded",ShapeBpmnSubProcessKind.EVENT="event",ShapeBpmnSubProcessKind.TRANSACTION="transaction";class ShapeUtil{static isEvent(t){return isKindOf(EVENT_KINDS,t)}static eventKinds(){return[...EVENT_KINDS]}static isBoundaryEvent(t){return exports.ShapeBpmnElementKind.EVENT_BOUNDARY===t}static isStartEvent(t){return exports.ShapeBpmnElementKind.EVENT_START===t}static isCallActivity(t){return exports.ShapeBpmnElementKind.CALL_ACTIVITY===t}static isSubProcess(t){return exports.ShapeBpmnElementKind.SUB_PROCESS===t}static canHaveNoneEvent(t){return exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===t||exports.ShapeBpmnElementKind.EVENT_END===t||exports.ShapeBpmnElementKind.EVENT_START===t}static isActivity(t){return isKindOf(ACTIVITY_KINDS,t)}static activityKinds(){return[...ACTIVITY_KINDS]}static isWithDefaultSequenceFlow(t){return FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS.includes(t)}static isTask(t){return isKindOf(TASK_KINDS,t)}static taskKinds(){return[...TASK_KINDS]}static gatewayKinds(){return[...GATEWAY_KINDS]}static isGateway(t){return isKindOf(GATEWAY_KINDS,t)}static flowNodeKinds(){return Object.values(exports.ShapeBpmnElementKind).filter((t=>!ShapeUtil.isPoolOrLane(t)))}static isPoolOrLane(t){return t==exports.ShapeBpmnElementKind.POOL||t==exports.ShapeBpmnElementKind.LANE}}function filterKind(t,e){return filter(Object.values(exports.ShapeBpmnElementKind),t,e)}function isKindOf(t,e){return Object.values(t).map((t=>t)).includes(e)}const EVENT_KINDS=filterKind("Event"),GATEWAY_KINDS=filterKind("Gateway"),TASK_KINDS=filterKind("Task",{ignoreCase:!0,notStartingWith:"global"}),ACTIVITY_KINDS=[...TASK_KINDS,exports.ShapeBpmnElementKind.CALL_ACTIVITY,exports.ShapeBpmnElementKind.SUB_PROCESS],FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS=[...ACTIVITY_KINDS,exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_COMPLEX],eventDefinitionKinds=Object.values(exports.ShapeBpmnEventDefinitionKind).filter((t=>t!=exports.ShapeBpmnEventDefinitionKind.NONE));var AssociationDirectionKind,FlowKind,MessageVisibleKind,SequenceFlowKind;function ensureInRange(t,e,n,i){const s=null!=t?t:i;return Math.min(Math.max(s,e),n)}function ensurePositiveValue(t){return Math.max(t||0,0)}function ensureValidZoomConfiguration(t){const e=null!=t?t:{};return e.debounceDelay=ensureInRange(e.debounceDelay,0,100,50),e.throttleDelay=ensureInRange(e.throttleDelay,0,100,50),e}function ensureOpacityValue(t){return"default"==t?void 0:ensureInRange(t,0,100,100)}function ensureStrokeWidthValue(t){return"default"==t?void 0:ensureInRange(t,1,50,1)}exports.AssociationDirectionKind=void 0,AssociationDirectionKind=exports.AssociationDirectionKind||(exports.AssociationDirectionKind={}),AssociationDirectionKind.NONE="None",AssociationDirectionKind.ONE="One",AssociationDirectionKind.BOTH="Both",exports.FlowKind=void 0,FlowKind=exports.FlowKind||(exports.FlowKind={}),FlowKind.SEQUENCE_FLOW="sequenceFlow",FlowKind.MESSAGE_FLOW="messageFlow",FlowKind.ASSOCIATION_FLOW="association",exports.MessageVisibleKind=void 0,MessageVisibleKind=exports.MessageVisibleKind||(exports.MessageVisibleKind={}),MessageVisibleKind.NONE="none",MessageVisibleKind.INITIATING="initiating",MessageVisibleKind.NON_INITIATING="non_initiating",exports.SequenceFlowKind=void 0,SequenceFlowKind=exports.SequenceFlowKind||(exports.SequenceFlowKind={}),SequenceFlowKind.NORMAL="normal",SequenceFlowKind.DEFAULT="default",SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",SequenceFlowKind.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var build={exports:{}};(function(module){!function(t,e){module.exports?module.exports=e():t.mxgraph=e()}(commonjsGlobal,(function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.2.2",IS_IE:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:null!=navigator.userAgent&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:null!=navigator.userAgent&&navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!=typeof InstallTrigger,IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,n,i){if(n=n||document,mxClient.IS_IE6)n.write('');else{var s=n.createElement("link");s.setAttribute("rel",t),s.setAttribute("href",e),s.setAttribute("charset","UTF-8"),s.setAttribute("type","text/css"),i&&s.setAttribute("id",i),n.getElementsByTagName("head")[0].appendChild(s)}},loadResources:function(t,e){var n=mxClient.defaultBundles.length;function i(){0==--n&&t()}for(var s=0;s<\/script>')}},node;"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&mxBasePath.length>0?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&mxImageBasePath.length>0?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(node=document.createElement("style"),node.type="text/css",node.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(node)):document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||null==module.exports)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=void 0!==mxClient?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var n=document.createElement("tbody"),i=document.createElement("tr"),s=document.createElement("td");s.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",s.appendChild(mxLog.textarea),i.appendChild(s),n.appendChild(i),i=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),i.appendChild(mxLog.td),n.appendChild(i),e.appendChild(n),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var r=0,o=0;if("number"==typeof window.innerWidth?(r=window.innerHeight,o=window.innerWidth):(r=document.documentElement.clientHeight||document.body.clientHeight,o=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,o-320),Math.max(0,r-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement(),a=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a),mxLog.window.addListener(mxEvent.MAXIMIZE,a),mxLog.window.addListener(mxEvent.NORMALIZE,a),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var n=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var n=e.indexOf("-");n>0&&(e=e.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var i=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e),r=function(){if(null!=s)if(n)mxUtils.get(s,(function(t){mxResources.parse(t.getText()),n()}),(function(){n()}));else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()};if(null!=i)if(n)mxUtils.get(i,(function(t){mxResources.parse(t.getText()),r()}),(function(){r()}));else try{var o=mxUtils.load(i);o.isReady()&&mxResources.parse(o.getText()),r()}catch(t){}else r()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),n=0;n0){var s=e[n].substring(0,i),r=e[n].length;13==e[n].charCodeAt(r-1)&&r--;var o=e[n].substring(i+1,r);this.resourcesEncoded?(o=o.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[s]=unescape(o)):mxResources.resources[s]=o}}},get:function(t,e,n){var i=mxResources.resources[t];return null==i&&(i=n),null!=i&&null!=e&&(i=mxResources.replacePlaceholders(i,e)),i},replacePlaceholders:function(t,e){for(var n=[],i=null,s=0;s=0&&i0?window.setTimeout(l,s):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(l,s)}else t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=void 0!==mxEffects?mxEffects:void 0;var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i=9&&document.documentMode<10&&(prefix="ms"),function(t,e,n){t[e]=n,null!=prefix&&e.length>0&&(t[e=prefix+e.substring(0,1).toUpperCase()+e.substring(1)]=n)}),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){var s=mxUtils.findNode(t,e,n);if(null!=s)return s;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var n=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");n>0&&(e=e.substring(0,n))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n=0;)e.splice(i,1),n=t,i=mxUtils.indexOf(e,t);for(var s in e)e[s]==t&&(delete e[s],n=t);return n},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==n||t.getAttribute(n)==i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,n):t.importNode(e,n)},importNodeImplementation:function(t,e,n){switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var s=0;s0)for(s=0;s/g,">"),(null==e||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var n="";if(mxClient.IS_IE||mxClient.IS_IE11)n=mxUtils.getPrettyXml(t,"","","");else if(null!=window.XMLSerializer){n=(new XMLSerializer).serializeToString(t)}else null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||" ",n=n.replace(/\n/g,e)},getPrettyXml:function(t,e,n,i,s){var r=[];if(null!=t)if(e=null!=e?e:" ",n=null!=n?n:"",i=null!=i?i:"\n",null!=t.namespaceURI&&t.namespaceURI!=s&&(s=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)r.push(mxUtils.getPrettyXml(t.documentElement,e,n,i,s));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){if(null!=(l=t.firstChild))for(;null!=l;)r.push(mxUtils.getPrettyXml(l,e,n,i,s)),l=l.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){(o=mxUtils.getTextContent(t)).length>0&&r.push(n+"\x3c!--"+o+"--\x3e"+i)}else if(t.nodeType==mxConstants.NODETYPE_TEXT){(o=mxUtils.trim(mxUtils.getTextContent(t))).length>0&&r.push(n+mxUtils.htmlEntities(o,!1)+i)}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var o;(o=mxUtils.getTextContent(t)).length>0&&r.push(n+""+i);null!=l;)r.push(mxUtils.getPrettyXml(l,e,n+e,i,s)),l=l.nextSibling;r.push(n+""+i)}else r.push(" />"+i)}return r.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],n=[];return function t(i){if(1!=i.length||"BR"!=i[0].nodeName&&"\n"!=i[0].innerHTML)for(var s=0;s"==r.innerHTML.toLowerCase()?n.push("\n"):(3===r.nodeType||4===r.nodeType?r.nodeValue.length>0&&n.push(r.nodeValue):8!==r.nodeType&&r.childNodes.length>0&&t(r.childNodes),s=0&&n.push("\n"))}}(t),n.join("")},replaceTrailingNewlines:function(t,e){for(var n="";t.length>0&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i0&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(s),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(n),n},writeln:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var n=null,i=0;il&&(t.style.left=Math.max(r,l-i)+"px");var a=parseInt(t.offsetTop),h=parseInt(t.offsetHeight),u=o+e.height;a+h>u&&(t.style.top=Math.max(o,u-h)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,n,i,s,r,o){var l=new mxXmlRequest(t,null,"GET"),a=l.setRequestHeaders;return o&&(l.setRequestHeaders=function(t,e){for(var n in a.apply(this,arguments),o)t.setRequestHeader(n,o[n])}),null!=i&&l.setBinary(i),l.send(e,n,s,r),l},getAll:function(t,e,n){for(var i=t.length,s=[],r=0,o=function(){0==r&&null!=n&&n(),r++},l=0;l299?o():(s[n]=t,0==--i&&e(s))}),o)}(t[l],l);0==i&&e(s)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n),i},getNumber:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n||0),Number(i)},getColor:function(t,e,n){var i=null!=t?t[e]:null;return null==i?i=n:i==mxConstants.NONE&&(i=null),i},clone:function(t,e,n){n=null!=n&&n;var i=null;if(null!=t&&"function"==typeof t.constructor)for(var s in i=new t.constructor,t)s!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,s)<0)&&(n||"object"!=typeof t[s]?i[s]=t[s]:i[s]=mxUtils.clone(t[s]));return i},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n [Function]\n";else if("object"==typeof t[n]){e+=n+" => ["+mxUtils.getFunctionName(t[n].constructor)+"]\n"}else e+=n+" = "+t[n]+"\n"}catch(t){e+=n+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,s,r,o,l,a){if(l-=t,a-=e,0===n||0===i)return z;var h=o,u=s;n=Math.abs(n),i=Math.abs(i);var d,p=-l/2,m=-a/2,c=Math.cos(u*Math.PI/180),g=Math.sin(u*Math.PI/180),x=c*p+g*m,y=-1*g*p+c*m,f=x*x,v=y*y,C=n*n,E=i*i,S=f/C+v/E;if(S>1)n=Math.sqrt(S)*n,i=Math.sqrt(S)*i,d=0;else{var b=1;r===h&&(b=-1),d=b*Math.sqrt((C*E-C*v-E*f)/(C*v+E*f))}var T=d*n*y/i,w=-1*d*i*x/n,L=c*T-g*w+l/2,O=g*T+c*w+a/2,I=Math.atan2((y-w)/i,(x-T)/n)-Math.atan2(0,1),A=I>=0?I:2*Math.PI+I,P=(I=Math.atan2((-y-w)/i,(-x-T)/n)-Math.atan2((y-w)/i,(x-T)/n))>=0?I:2*Math.PI+I;0==h&&P>0?P-=2*Math.PI:0!=h&&P<0&&(P+=2*Math.PI);for(var _=2*P/Math.PI,R=Math.ceil(_<0?-1*_:_),M=P/R,N=8/3*Math.sin(M/4)*Math.sin(M/4)/Math.sin(M/2),H=c*n,D=c*i,G=g*n,U=g*i,V=Math.cos(A),B=Math.sin(A),F=-N*(H*B+U*V),k=-N*(G*B-D*V),Y=0,j=0,z=[],W=0;W45?(a=1,l>=135&&(a=2)):l<-45&&(a=3,l<=-135&&(a=2)),r.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:o|=mxConstants.DIRECTION_MASK_EAST;break;case 2:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:o|=mxConstants.DIRECTION_MASK_WEST}if(r.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_WEST;break;case 1:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:o|=mxConstants.DIRECTION_MASK_EAST;break;case 3:o|=mxConstants.DIRECTION_MASK_SOUTH}if(r.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:o|=mxConstants.DIRECTION_MASK_WEST;break;case 2:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:o|=mxConstants.DIRECTION_MASK_EAST}if(r.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_EAST;break;case 1:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:o|=mxConstants.DIRECTION_MASK_WEST;break;case 3:o|=mxConstants.DIRECTION_MASK_NORTH}return o},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,n){var i=-1;if(t.absolutePoints.length>0)for(var s=t.absolutePoints[0],r=null,o=1;oa.distSq)&&(i=a)}}return null!=i?i.p:null},rectangleIntersectsSegment:function(t,e,n){var i=t.y,s=t.x,r=i+t.height,o=s+t.width,l=e.x,a=n.x;if(e.x>n.x&&(l=n.x,a=e.x),a>o&&(a=o),la)return!1;var h=e.y,u=n.y,d=n.x-e.x;if(Math.abs(d)>1e-7){var p=(n.y-e.y)/d,m=e.y-p*e.x;h=p*l+m,u=p*a+m}if(h>u){var c=u;u=h,h=c}return u>r&&(u=r),hu)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,s=e.width,r=e.height;if(s<=0||r<=0||n<=0||i<=0)return!1;var o=t.x,l=t.y,a=e.x,h=e.y;return r+=h,n+=o,i+=l,((s+=a)o)&&(rl)&&(na)&&(ih)},intersectsHotspot:function(t,e,n,i,s,r){if(s=null!=s?s:0,r=null!=r?r:0,(i=null!=i?i:1)>0){var o=t.getCenterX(),l=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;u>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(l=t.y+u/2,h=u):(o=t.x+u/2,a=u)),a=Math.max(s,a*i),h=Math.max(s,h*i),r>0&&(a=Math.min(a,r),h=Math.min(h,r));var d=new mxRectangle(o-a/2,l-h/2,a,h),p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=p){var m=Math.cos(-p),c=Math.sin(-p),g=(o=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,n),m,c,o));e=g.x,n=g.y}return mxUtils.contains(d,e,n)}return!0},getOffset:function(t,e){for(var n=0,i=0,s=!1,r=t,o=document.body,l=document.documentElement;null!=r&&r!=o&&r!=l&&!s;){var a=mxUtils.getCurrentStyle(r);null!=a&&(s=s||"fixed"==a.position),r=r.parentNode}if(!e&&!s){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);n+=h.x,i+=h.y}var u=t.getBoundingClientRect();return null!=u&&(n+=u.left,i+=u.top),new mxPoint(n,i)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,s=i.body,r=i.documentElement,o=new mxPoint,l=!1;null!=t&&t!=s&&t!=r;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(l=l||"fixed"==a.position),t=e?t.parentNode:null}if(!l&&n){var h=mxUtils.getDocumentScrollOrigin(i);o.x+=h.x,o.y+=h.y}return o},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1),s=mxUtils.getOffset(t);return s.x-=i.x,s.y-=i.y,new mxPoint(e-s.x,n-s.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,n,i,s,r,o,l){var a=(l-r)*(n-t)-(o-s)*(i-e),h=((o-s)*(e-r)-(l-r)*(t-s))/a,u=((n-t)*(e-r)-(i-e)*(t-s))/a;return h>=0&&h<=1&&u>=0&&u<=1?new mxPoint(t+h*(n-t),e+h*(i-e)):null},ptSegDistSq:function(t,e,n,i,s,r){var o,l=(s-=t)*(n-=t)+(r-=e)*(i-=e);o=l<=0||(l=(s=n-s)*n+(r=i-r)*i)<=0?0:l*l/(n*n+i*i);var a=s*s+r*r-o;return a<0&&(a=0),a},ptLineDist:function(t,e,n,i,s,r){return Math.abs((i-e)*s-(n-t)*r+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,s,r){var o=(s-=t)*(i-=e)-(r-=e)*(n-=t);return 0==o&&(o=s*n+r*i)>0&&(o=(s-=n)*n+(r-=i)*i)<0&&(o=0),o<0?-1:o>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,s,r){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=e>=100?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=e>=100?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=null==e||e;var n=new mxDictionary;return t.sort((function(t,i){var s=n.get(t);null==s&&(s=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),n.put(t,s));var r=n.get(i);null==r&&(r=mxCellPath.create(i).split(mxCellPath.PATH_SEPARATOR),n.put(i,r));var o=mxCellPath.compare(s,r);return 0==o?0:o>0==e?1:-1})),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i0&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),s=0;s=0&&e.push(n[i]);return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&e.length>0){t.beginUpdate();try{for(var s=0;s0);if(null==t||0==t.length)i&&(t=e+"="+n+";");else if(t.substring(0,e.length+1)==e+"="){var s=t.indexOf(";");t=i?e+"="+n+(s<0?";":t.substring(s)):s<0||s==t.length-1?"":t.substring(s+1)}else{var r=t.indexOf(";"+e+"=");if(r<0){if(i){var o=";"==t.charAt(t.length-1)?"":";";t=t+o+e+"="+n+";"}}else{s=t.indexOf(";",r+1);t=i?t.substring(0,r+1)+e+"="+n+(s<0?";":t.substring(s)):t.substring(0,r)+(s<0?";":t.substring(s))}}return t},setCellStyleFlags:function(t,e,n,i,s){if(null!=e&&e.length>0){t.beginUpdate();try{for(var r=0;r=0?t.substring(o):"")}}return t},getAlignmentAsPoint:function(t,e){var n=-.5,i=-.5;return t==mxConstants.ALIGN_LEFT?n=0:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_TOP?i=0:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i,s){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var r=document.createElement("div");if(r.style.fontFamily=n,r.style.fontSize=Math.round(e)+"px",r.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=s){(s&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(r.style.fontWeight="bold"),(s&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(r.style.fontStyle="italic");var o=[];(s&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(s&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),o.length>0&&(r.style.textDecoration=o.join(" "))}r.style.position="absolute",r.style.visibility="hidden",r.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",r.style.zoom="1",null!=i?(r.style.width=i+"px",r.style.whiteSpace="normal"):r.style.whiteSpace="nowrap",r.innerHTML=t,document.body.appendChild(r);var l=new mxRectangle(0,0,r.offsetWidth,r.offsetHeight);return document.body.removeChild(r),l},getViewXml:function(t,e,n,i,s){(i=null!=i?i:0,s=null!=s?s:0,e=null!=e?e:1,null==n)&&(n=[t.getModel().getRoot()]);var r=t.getView(),o=null,l=r.isEventsEnabled();r.setEventsEnabled(!1);var a=r.drawPane,h=r.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(r.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.drawPane),r.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.overlayPane)):(r.drawPane=r.drawPane.cloneNode(!1),r.canvas.appendChild(r.drawPane),r.overlayPane=r.overlayPane.cloneNode(!1),r.canvas.appendChild(r.overlayPane));var u=r.getTranslate();r.translate=new mxPoint(i,s);var d=new mxTemporaryCellStates(t.getView(),e,n);try{o=(new mxCodec).encode(t.getView())}finally{d.destroy(),r.translate=u,r.canvas.removeChild(r.drawPane),r.canvas.removeChild(r.overlayPane),r.drawPane=a,r.overlayPane=h,r.setEventsEnabled(l)}return o},getScaleForPageCount:function(t,e,n,i){if(t<1)return 1;i=null!=i?i:0;var s=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i,r=n.height-2*i,o=e.getGraphBounds().clone(),l=e.getView().getScale();o.width/=l,o.height/=l;var a=o.width,h=a/o.height/(s/r),u=Math.sqrt(t),d=Math.sqrt(h),p=u*d,m=u/d;if(p<1&&m>t){var c=m/t;m=t,p/=c}if(m<1&&p>t){c=p/t;p=t,m/=c}for(var g=Math.ceil(p)*Math.ceil(m),x=0;g>t;){var y=Math.floor(p)/p,f=Math.floor(m)/m;1==y&&(y=Math.floor(p-1)/p),1==f&&(f=Math.floor(m-1)/m);c=1;if(p*=c=y>f?y:f,m*=c,g=Math.ceil(p)*Math.ceil(m),++x>10)break}return.99999*(s*p/a)},show:function(t,e,n,i,s,r){(n=null!=n?n:0,i=null!=i?i:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]>",u=document.getElementsByTagName("base"),d=0;d";for(d=0;d ',h+='
',h+=t.container.innerHTML,h+="
",e.writeln(h),e.close()}else{e.writeln("");for(u=document.getElementsByTagName("base"),d=0;d .commit-tease, .user-profile-mini-avatar, .avatar, .vcard-details, .signup-prompt-bg { display: none !IMPORTANT; } '),e.close();var c=e.createElement("div");c.position="absolute",c.overflow="hidden",c.style.width=s+"px",c.style.height=r+"px";var g=e.createElement("div");g.style.position="absolute",g.style.left=l+"px",g.style.top=a+"px";for(var x=t.container.firstChild,y=null;null!=x;){var f=x.cloneNode(!0);x==t.view.drawPane.ownerSVGElement?(c.appendChild(f),y=f):g.appendChild(f),x=x.nextSibling}e.body.appendChild(c),null!=g.firstChild&&e.body.appendChild(g),null!=y&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+l+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var n=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(n,500):n()},popup:function(t,e){if(e){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px",(s=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),n.appendChild(s),(i=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),i.setVisible(!0)}else{var i,s;if(mxClient.IS_NS)(i=window.open()).document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),i.document.body.appendChild(s)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var s=document.createElement("div");s.style.padding="20px";var r=document.createElement("img");r.setAttribute("src",i||mxUtils.errorImage),r.setAttribute("valign","bottom"),r.style.verticalAlign="middle",s.appendChild(r),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),mxUtils.write(s,t);var o=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,s,(o-e)/2,l/4,e,null,!1,!0);if(n){mxUtils.br(s);var h=document.createElement("p"),u=document.createElement("button");mxClient.IS_IE?u.style.cssText="float:right":u.setAttribute("style","float:right"),mxEvent.addListener(u,"click",(function(t){a.destroy()})),mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(u),s.appendChild(h),mxUtils.br(s),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,n,i,s,r,o,l,a,h){var u=new mxDragSource(t,n);return u.dragOffset=new mxPoint(null!=s?s:0,null!=r?r:mxConstants.TOOLTIP_VERTICAL_OFFSET),u.autoscroll=o,u.setGuidesEnabled(!1),null!=a&&(u.highlightDropTargets=a),null!=h&&(u.getDropTarget=h),u.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=i&&(u.createDragElement=function(){return i.cloneNode(!0)},l&&(u.createPreviewElement=function(t){var e=i.cloneNode(!0),n=parseInt(e.style.width),s=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(s*t.view.scale)+"px",e})),u}},prefix;__mxOutput.mxUtils=void 0!==mxUtils?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var n=e[0];mxEvent.removeListener(t,n.name,n.f)}},addGestureListeners:function(t,e,n,i){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=n&&mxEvent.addListener(t,"touchmove",n),null!=i&&mxEvent.addListener(t,"touchend",i))},removeGestureListeners:function(t,e,n,i){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=n&&mxEvent.removeListener(t,"touchmove",n),null!=i&&mxEvent.removeListener(t,"touchend",i))},redirectMouseEvents:function(t,e,n,i,s,r,o){var l=function(t){return"function"==typeof n?n(t):n};mxEvent.addGestureListeners(t,(function(t){null!=i?i(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l(t)))}),(function(t){null!=s?s(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,l(t)))}),(function(t){null!=r?r(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,l(t)))})),mxEvent.addListener(t,"dblclick",(function(t){if(null!=o)o(t);else if(!mxEvent.isConsumed(t)){var n=l(t);e.dblClick(t,null!=n?n.cell:null)}}))},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i.2&&(t(e,i<0,!0),n=e.scale)})),mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}else{var i=[],s=0,r=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(t){mxEvent.isMouseEvent(t)||null==t.pointerId||i.push(t)})),mxUtils.bind(this,(function(e){if(!mxEvent.isMouseEvent(e)&&2==i.length){for(var n=0;nmxEvent.PINCH_THRESHOLD||h>mxEvent.PINCH_THRESHOLD){var u=i[0].clientX+(i[1].clientX-i[0].clientX)/2,d=i[0].clientY+(i[1].clientY-i[0].clientY)/2;t(i[0],a>h?o>s:l>r,!0,u,d),s=o,r=l}}})),mxUtils.bind(this,(function(t){i=[],s=0,r=0})))}mxEvent.addListener(e,"wheel",(function(e){null==e&&(e=window.event),e.ctrlKey&&e.preventDefault(),e.deltaY,(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5)&&t(e,0==e.deltaY?-e.deltaX>0:-e.deltaY>0)}))}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){return t.preventDefault&&t.preventDefault(),!1}))},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&t.touches.length>1},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return!("buttons"in t)||"mousedown"!=t.type&&"mousemove"!=t.type?"which"in t?1===t.which:1===t.button:1==t.buttons},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,n){n=null==n||n,(e=null==e||e)&&(t.preventDefault?(n&&t.stopPropagation(),t.preventDefault()):n&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10},updateListener,updateListenerList;function mxXmlRequest(t,e,n,i,s,r){this.url=t,this.params=e,this.method=n||"POST",this.async=null==i||i,this.username=s,this.password=r}__mxOutput.mxEvent=void 0!==mxEvent?mxEvent:void 0,mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,n,i){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,(function(){this.isReady()&&(t(this),this.request.onreadystatechange=null)}))),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||document.documentMode>9)&&window.XMLHttpRequest&&null!=n&&null!=i&&(this.request.timeout=n,this.request.ontimeout=i),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var n=null;(t=t||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var i=t.createElement("form");i.setAttribute("method",this.method),i.setAttribute("action",this.url),null!=e&&i.setAttribute("target",e),i.style.display="none",i.style.visibility="hidden";for(var s=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),r=0;r0){var l=s[r].substring(0,o),a=s[r].substring(o+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",l),mxUtils.write(h,a),i.appendChild(h)}}t.body.appendChild(i),i.submit(),null!=i.parentNode&&i.parentNode.removeChild(i),null!=n&&(window.onbeforeunload=n)},__mxOutput.mxXmlRequest=void 0!==mxXmlRequest?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var n=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(n)),n},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var n=mxClipboard.insertCount*mxClipboard.STEPSIZE,i=t.getDefaultParent();e=t.importCells(e,n,n,i),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,n,i,s,r,o,l,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(n,i,s,r,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),(null==l||l)&&this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,n){this.src=t,this.width=e,this.height=n}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var n=mxUtils.getCurrentStyle(t);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)}))),this.resize()}}function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,(function(t){this.mouseDown(t)}))),mxEvent.addListener(t,"dragstart",(function(t){mxEvent.consume(t)})),this.eventConsumer=function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n!=mxEvent.MOUSE_DOWN&&i.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}__mxOutput.mxClipboard=void 0!==mxClipboard?mxClipboard:void 0,mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,n,i,s){s=null!=s?s:"mxWindow",this.div=document.createElement("div"),this.div.className=s,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=s,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.height=i+"px"),this.table.style.height=i+"px");var r=document.createElement("tbody"),o=document.createElement("tr");this.title=document.createElement("td"),this.title.className=s+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),o.appendChild(this.title),r.appendChild(o),o=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=s+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=s+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),o.appendChild(this.td),r.appendChild(o),this.table.appendChild(r),this.div.appendChild(this.table);var l=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,l),mxEvent.addGestureListeners(this.table,l),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var n=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=n}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(null==navigator.userAgent||navigator.userAgent.indexOf("Presto/2.5")<0)&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}var i=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",i))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,n=null,i=null,s=null,r=mxUtils.bind(this,(function(t){this.activate(),e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.div.offsetWidth,s=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){if(null!=e&&null!=n){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setSize(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}})),l=mxUtils.bind(this,(function(t){null!=e&&null!=n&&(e=null,n=null,mxEvent.removeGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}));mxEvent.addGestureListeners(this.resize,r,o,l),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,n=null,i=mxUtils.bind(this,(function(i){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=n),this.table.style.height=n,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",i));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",n=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",i))}mxEvent.consume(i)}));mxEvent.addGestureListeners(this.minimize,i)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,n=null,i=null,s=null,r=null,o=mxUtils.bind(this,(function(o){if(this.activate(),"none"!=this.maximize.style.display){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=r,this.div.style.left=e+"px",this.div.style.top=n+"px",!mxClient.IS_QUIRKS)this.div.style.height=i,this.div.style.width=s,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=i,this.table.style.width=s,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",o))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",r=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),n=parseInt(this.div.style.top),i=this.table.style.height,s=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=l-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=l-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",o))}mxEvent.consume(o)}}));mxEvent.addGestureListeners(this.maximize,o),mxEvent.addListener(this.title,"dblclick",o)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.getX(),s=this.getY(),r=mxUtils.bind(this,(function(t){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setLocation(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)}))),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)})))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=void 0!==mxWindow?mxWindow:void 0,mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");n.appendChild(i),i=document.createElement("td");var s=document.createElement("button");mxUtils.write(s,mxResources.get("ok")||"OK"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){t()})),s=document.createElement("button"),mxUtils.write(s,mxResources.get("cancel")||"Cancel"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){e()})),n.appendChild(i),this.body.appendChild(n)},mxForm.prototype.addText=function(t,e,n){var i=document.createElement("input");return i.setAttribute("type",n||"text"),i.value=e,this.addField(t,i)},mxForm.prototype.addCheckbox=function(t,e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(t,n),e&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(t,e,n){var i=document.createElement("textarea");return mxClient.IS_NS&&n--,i.setAttribute("rows",n||2),i.value=e,this.addField(t,i)},mxForm.prototype.addCombo=function(t,e,n){var i=document.createElement("select");return null!=n&&i.setAttribute("size",n),e&&i.setAttribute("multiple","true"),this.addField(t,i)},mxForm.prototype.addOption=function(t,e,n,i){var s=document.createElement("option");mxUtils.writeln(s,e),s.setAttribute("value",n),i&&s.setAttribute("selected",i),t.appendChild(s)},mxForm.prototype.addField=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");return mxUtils.write(i,t),n.appendChild(i),(i=document.createElement("td")).appendChild(e),n.appendChild(i),this.body.appendChild(n),e},__mxOutput.mxForm=void 0!==mxForm?mxForm:void 0,mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=void 0!==mxImage?mxImage:void 0,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),n=parseInt(this.div.style.left),i=parseInt(this.div.style.right),s=parseInt(this.div.style.top),r=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(i)&&n>=0&&i>=0&&t-i-n>0&&(this.div.style.width=t-i-n+"px"),this.resizeHeight&&!isNaN(s)&&!isNaN(r)&&s>=0&&r>=0&&e-s-r>0&&(this.div.style.height=e-s-r+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=void 0!==mxDivResizer?mxDivResizer:void 0,mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.previewOffset=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,n,i){return t.getCellAt(e,n)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var n=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=mxUtils.getOffset(t.container),r=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&n>=s.x-r.x&&i>=s.y-r.y&&n<=s.x-r.x+t.container.offsetWidth&&i<=s.y-r.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,i+=this.dragOffset.y);var s=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=n+s.x+"px",this.dragElement.style.top=i+s.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,n=this.currentGraph.view.translate,i=this.currentPoint.x/e-n.x,s=this.currentPoint.y/e-n.y;this.drop(this.currentGraph,t,this.currentDropTarget,i,s)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var n=mxUtils.getOffset(t.container),i=mxUtils.getScrollOrigin(t.container),s=mxEvent.getClientX(e)-n.x+i.x-t.panDx,r=mxEvent.getClientY(e)-n.y+i.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(s,r,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,s,r,e);var o=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(o)}if(null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),a=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var h=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),u=new mxPoint(s,r);a=!1,s=(u=this.currentGuide.move(h,u,l,!0)).x,r=u.y}else if(l){var d=t.view.scale,p=t.view.translate,m=t.gridSize/2;s=(t.snap(s/d-p.x-m)+p.x)*d,r=(t.snap(r/d-p.y-m)+p.y)*d}null!=this.currentGuide&&a&&this.currentGuide.hide(),null!=this.previewOffset&&(s+=this.previewOffset.x,r+=this.previewOffset.y),this.previewElement.style.left=Math.round(s)+"px",this.previewElement.style.top=Math.round(r)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(s,r)},mxDragSource.prototype.drop=function(t,e,n,i,s){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},__mxOutput.mxDragSource=void 0!==mxDragSource?mxDragSource:void 0,mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,n,i,s,r){var o=document.createElement(null!=e?"img":"button"),l=s||(null!=r?"mxToolbarMode":"mxToolbarItem");o.className=l,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n));var a=mxUtils.bind(this,(function(t){null!=i?o.setAttribute("src",e):o.style.backgroundColor=""}));return mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){if(null!=i?o.setAttribute("src",i):o.style.backgroundColor="gray",null!=r){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o){this.currentImg=o,this.menu.factoryMethod=r;var n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight);this.menu.popup(n.x,n.y,null,t),this.menu.isMenuShowing()&&(o.className=l+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=l,this.currentImg=null})}}})),null,a),mxEvent.addListener(o,"mouseout",a),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=t||"mxToolbarCombo",e.appendChild(n),this.container.appendChild(e),n},mxToolbar.prototype.addActionCombo=function(t,e){var n=document.createElement("select");return n.className=e||"mxToolbarCombo",this.addOption(n,t,null),mxEvent.addListener(n,"change",(function(t){var e=n.options[n.selectedIndex];n.selectedIndex=0,null!=e.funct&&e.funct(t)})),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(t,e,n){var i=document.createElement("option");return mxUtils.writeln(i,e),"function"==typeof n?i.funct=n:i.setAttribute("value",n),t.appendChild(i),i},mxToolbar.prototype.addSwitchMode=function(t,e,n,i,s){var r=document.createElement("img");return r.initialClassName=s||"mxToolbarMode",r.className=r.initialClassName,r.setAttribute("src",e),r.altIcon=i,null!=t&&r.setAttribute("title",t),mxEvent.addListener(r,"click",mxUtils.bind(this,(function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=r),this.selectedMode=r,null!=(e=r.altIcon)?(r.altIcon=r.getAttribute("src"),r.setAttribute("src",e)):r.className=r.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()}))),this.container.appendChild(r),null==this.defaultMode&&(this.defaultMode=r,this.selectMode(r),n()),r},mxToolbar.prototype.addMode=function(t,e,n,i,s,r){r=null==r||r;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=s||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=i,null!=t&&o.setAttribute("title",t),this.enabled&&r&&(mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!1}))),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!0}))),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var n;if(null!=this.selectedMode)null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!t&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,null!=this.menu&&this.menu.destroy()},__mxOutput.mxToolbar=void 0!==mxToolbar?mxToolbar:void 0,mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length-1;t>=0;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&this.dx0&&this.dy0&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,mxUrlConverter.prototype.baseUrl=null,mxUrlConverter.prototype.baseDomain=null,mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host,this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");t>0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=void 0!==mxUrlConverter?mxUrlConverter:void 0,mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,__mxOutput.mxPanningManager=void 0!==mxPanningManager?mxPanningManager:void 0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t},mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())},mxPopupMenu.prototype.addItem=function(t,e,n,i,s,r,o,l){i=i||this,this.itemCount++,i.willAddSeparator&&(i.containsItems&&this.addSeparator(i,!0),i.willAddSeparator=!1),i.containsItems=!0;var a=document.createElement("tr");a.className="mxPopupMenuItem";var h=document.createElement("td");if(h.className="mxPopupMenuIcon",null!=e){var u=document.createElement("img");u.src=e,h.appendChild(u)}else if(null!=s){var d=document.createElement("div");d.className=s,h.appendChild(d)}if(a.appendChild(h),this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),mxUtils.write(p,t),p.align="left",a.appendChild(p);var m=document.createElement("td");m.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),m.style.paddingRight="6px",m.style.textAlign="right",a.appendChild(m),null==i.div&&this.createSubmenu(i)}if(i.tbody.appendChild(a),0!=o&&0!=r){var c=null;mxEvent.addGestureListeners(a,mxUtils.bind(this,(function(t){this.eventReceiver=a,i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(c=document.selection.createRange()),mxEvent.consume(t)})),mxUtils.bind(this,(function(t){i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),this.autoExpand&&null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),l||(a.className="mxPopupMenuItemHover")})),mxUtils.bind(this,(function(t){if(this.eventReceiver==a){if(i.activeRow!=a&&this.hideMenu(),null!=c){try{c.select()}catch(t){}c=null}null!=n&&n(t)}this.eventReceiver=null,mxEvent.consume(t)}))),l||mxEvent.addListener(a,"mouseout",mxUtils.bind(this,(function(t){a.className="mxPopupMenuItem"})))}return a},mxPopupMenu.prototype.addCheckmark=function(t,e){var n=t.firstChild.nextSibling;n.style.backgroundImage="url('"+e+"')",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table"),t.table.className="mxPopupMenu",t.tbody=document.createElement("tbody"),t.table.appendChild(t.tbody),t.div=document.createElement("div"),t.div.className="mxPopupMenu",t.div.style.position="absolute",t.div.style.display="inline",t.div.style.zIndex=this.zIndex,t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage),td=t.firstChild.nextSibling.nextSibling,td.appendChild(e)},mxPopupMenu.prototype.showSubmenu=function(t,e){if(null!=e.div){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px",e.div.style.top=t.div.offsetTop+e.offsetTop+"px",document.body.appendChild(e.div);var n=parseInt(e.div.offsetLeft),i=parseInt(e.div.offsetWidth),s=mxUtils.getDocumentScrollOrigin(document),r=document.body,o=document.documentElement;n+i>s.x+(r.clientWidth||o.clientWidth)&&(e.div.style.left=Math.max(0,t.div.offsetLeft-i+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var n=document.createElement("tr"),i=document.createElement("td");i.className="mxPopupMenuIcon",i.style.padding="0 0 0 0px",n.appendChild(i);var s=document.createElement("td");s.style.padding="0 0 0 0px",s.setAttribute("colSpan","2");var r=document.createElement("hr");r.setAttribute("size","1"),s.appendChild(r),n.appendChild(s),t.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(t,e,n,i){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,i),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=void 0!==mxPopupMenu?mxPopupMenu:void 0,mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=void 0!==mxAutoSaveManager?mxAutoSaveManager:void 0,mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=void 0!==mxAnimation?mxAnimation:void 0,mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,n){var i=this.graph.getView().getState(t),s=null;if(null!=i&&(s=this.getDelta(i),this.graph.getModel().isVertex(t)&&(0!=s.x||0!=s.y))){var r=this.graph.view.getTranslate(),o=this.graph.view.getScale();s.x+=r.x*o,s.y+=r.y*o,e.moveState(i,-s.x/this.ease,-s.y/this.ease)}if(n&&!this.stopRecursion(i,s))for(var l=this.graph.getModel().getChildCount(t),a=0;a2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,n,i,s){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,n,i,s,r,o,l,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=l?l:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,n,i){this.addOp(this.quadOp,t,e,n,i)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,n,i,s,r){this.addOp(this.curveOp,t,e,n,i,s,r)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,n,i,s,r,o){var l=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,n,i,s,r,o);if(null!=l)for(var a=0;a0}(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.foAltText="[Object]",mxSvgCanvas2D.prototype.foOffset=0,mxSvgCanvas2D.prototype.textOffset=0,mxSvgCanvas2D.prototype.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var n=this.root.ownerDocument.createElement(t);return null!=e&&n.setAttribute("xmlns",e),n},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,n,i,s,r,o,l,a,h,u,d,p){return null!=r?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m=this.getAlternateText(t,e,n,i,s,r,o,l,a,h,u,d,p),c=this.state;if(null!=m&&c.fontSize>0){var g=l==mxConstants.ALIGN_TOP?1:l==mxConstants.ALIGN_BOTTOM?0:.3,x=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",y=this.createElement("text");y.setAttribute("x",Math.round(e+c.dx)),y.setAttribute("y",Math.round(n+c.dy+g*c.fontSize)),y.setAttribute("fill",c.fontColor||"black"),y.setAttribute("font-family",c.fontFamily),y.setAttribute("font-size",Math.round(c.fontSize)+"px"),"start"!=x&&y.setAttribute("text-anchor",x),(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold"),(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");var f=[];return(c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline"),(c.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&f.push("line-through"),f.length>0&&y.setAttribute("text-decoration",f.join(" ")),mxUtils.write(y,m),y}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,n,i,s){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+n,e=e.toLowerCase()+"-"+i;var r=null;if(null==s||s==mxConstants.DIRECTION_SOUTH)r="s";else if(s==mxConstants.DIRECTION_EAST)r="e";else{var o=t;t=e,e=o,s==mxConstants.DIRECTION_NORTH?r="s":s==mxConstants.DIRECTION_WEST&&(r="e")}return"mx-gradient-"+t+"-"+e+"-"+r},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,n,i,s){var r=this.createGradientId(t,e,n,i,s),o=this.gradients[r];if(null==o){var l=this.root.ownerSVGElement,a=0,h=r+"-"+a;if(null!=l)for(o=l.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=l;)h=r+"-"+a++,o=l.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,n,i,s)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(o):l.appendChild(o)),this.gradients[r]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,n,i,s){var r=this.createElement("linearGradient");r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2","0%"),r.setAttribute("y2","0%"),null==s||s==mxConstants.DIRECTION_SOUTH?r.setAttribute("y2","100%"):s==mxConstants.DIRECTION_EAST?r.setAttribute("x2","100%"):s==mxConstants.DIRECTION_NORTH?r.setAttribute("y1","100%"):s==mxConstants.DIRECTION_WEST&&r.setAttribute("x1","100%");var o=n<1?";stop-opacity:"+n:"",l=this.createElement("stop");return l.setAttribute("offset","0%"),l.setAttribute("style","stop-color:"+t+o),r.appendChild(l),o=i<1?";stop-opacity:"+i:"",(l=this.createElement("stop")).setAttribute("offset","100%"),l.setAttribute("style","stop-color:"+e+o),r.appendChild(l),r},mxSvgCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.setAttribute("d",this.path.join(" "))}t&&null!=i.fillColor?this.updateFill():this.styleEnabled||("ellipse"==n.nodeName&&mxClient.IS_FF?n.setAttribute("fill","transparent"):n.setAttribute("fill","none"),t=!1),e&&null!=i.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=i.transform&&i.transform.length>0&&n.setAttribute("transform",i.transform),i.shadow&&this.root.appendChild(this.createShadow(n)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents?n.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||n.setAttribute("pointer-events","none"),("rect"!=n.nodeName&&"path"!=n.nodeName&&"ellipse"!=n.nodeName||"none"!=n.getAttribute("fill")&&"transparent"!=n.getAttribute("fill")||"none"!=n.getAttribute("stroke")||"none"!=n.getAttribute("pointer-events"))&&this.root.appendChild(n),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var n=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+n+"#"+e+")")}else this.node.setAttribute("fill","url(#"+e+")")}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var n=this.state.dashPattern.split(" ");if(n.length>0)for(var i=0;i0&&this.node.setAttribute("rx",this.format(s*this.state.scale)),r>0&&this.node.setAttribute("ry",this.format(r*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,n,i){var s=this.state,r=this.createElement("ellipse");r.setAttribute("cx",this.format((t+n/2+s.dx)*s.scale)),r.setAttribute("cy",this.format((e+i/2+s.dy)*s.scale)),r.setAttribute("rx",n/2*s.scale),r.setAttribute("ry",i/2*s.scale),this.node=r},mxSvgCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){s=this.converter.convert(s),r=null==r||r,o=null!=o&&o,l=null!=l&&l;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",s):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",s),r||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var u=this.state.transform||"";if(o||l){var d=1,p=1,m=0,c=0;o&&(d=-1,m=-n-2*t),l&&(p=-1,c=-i-2*e),u+="scale("+d+","+p+")translate("+m*a.scale+","+c*a.scale+")"}u.length>0&&h.setAttribute("transform",u),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("",5)+1)),""==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var n=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),i=n.createElement("body");n.documentElement.appendChild(i);var s=document.createElement("div");s.innerHTML=t;for(var r=s.firstChild;null!=r;){var o=r.nextSibling;i.appendChild(n.adoptNode(r)),r=o}return i.innerHTML}var l=document.createElement("textarea");l.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=l.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement;var n=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var i=document.createElement("div"),s=i.cloneNode(!1);this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e),s.appendChild(i),n.appendChild(s)}else n.innerHTML=e;return n},mxSvgCanvas2D.prototype.updateText=function(t,e,n,i,s,r,o,l,a,h,u){null!=u&&null!=u.firstChild&&null!=u.firstChild.firstChild&&this.updateTextNodes(t,e,n,i,s,r,o,l,a,h,u.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c){var g=this.createElement("g"),x=this.createElement("foreignObject");if(x.setAttribute("style","overflow: visible; text-align: left;"),x.setAttribute("pointer-events","none"),m.ownerDocument!=document&&(m=mxUtils.importNodeImplementation(x.ownerDocument,m,!0)),x.appendChild(m),g.appendChild(x),this.updateTextNodes(t,e,n,i,r,o,l,h,u,d,g),this.root.ownerDocument!=document){var y=this.createAlternateContent(x,t,e,n,i,s,r,o,l,a,h,u,d);if(null!=y){x.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var f=this.createElement("switch");f.appendChild(x),f.appendChild(y),g.appendChild(f)}}c.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,n,i,s,r,o,l,a,h,u){var d=this.state.scale;mxSvgCanvas2D.createCss(n+2,i,s,r,o,l,a,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(r==mxConstants.ALIGN_TOP?"flex-start":r==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(s==mxConstants.ALIGN_LEFT?"flex-start":s==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),d,mxUtils.bind(this,(function(n,i,s,r,o){t+=this.state.dx,e+=this.state.dy;var l=u.firstChild,a=l.firstChild,p=a.firstChild,m=p.firstChild,c=(this.rotateHtml?this.state.rotation:0)+(null!=h?h:0),g=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=d?"scale("+d+")":"");m.setAttribute("style",o),p.setAttribute("style",r),l.setAttribute("width",Math.ceil(1/Math.min(1,d)*100)+"%"),l.setAttribute("height",Math.ceil(1/Math.min(1,d)*100)+"%");var x=Math.round(e+i);x<0?l.setAttribute("y",x):(l.removeAttribute("y"),s+="padding-top: "+x+"px; "),a.setAttribute("style",s+"margin-left: "+Math.round(t+n)+"px;"),""!=(g+=0!=c?"rotate("+c+" "+t+" "+e+")":"")?u.setAttribute("transform",g):u.removeAttribute("transform"),1!=this.state.alpha?u.setAttribute("opacity",this.state.alpha):u.removeAttribute("opacity")})))},mxSvgCanvas2D.createCss=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(n==mxConstants.ALIGN_LEFT?"left":n==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",c=mxUtils.getAlignmentAsPoint(n,i),g="overflow: hidden; ",x="width: 1px; ",y="height: 1px; ",f=c.x*t,v=c.y*e;o?(x="width: "+Math.round(t)+"px; ",m+="max-height: "+Math.round(e)+"px; ",v=0):"fill"==r?(u+="width: 100%; height: 100%; ",m+=(x="width: "+Math.round(t)+"px; ")+(y="height: "+Math.round(e)+"px; ")):"width"==r?(u+="width: 100%; ",m+=x="width: "+Math.round(t)+"px; ",v=0,e>0&&(m+="max-height: "+Math.round(e)+"px; ")):(g="",v=0);var C="";null!=l&&(C+="background-color: "+l+"; "),null!=a&&(C+="border: 1px solid "+a+"; "),""==g||o?u+=C:m+=C,s&&t>0?(u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",x="width: "+Math.round(t)+"px; ",""!=g&&"fill"!=r&&(v=0)):(u+="white-space: nowrap; ",""==g&&(f=0)),p(f,v,h+x+y,m+g,u,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,n="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"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; ");var 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},mxSvgCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s)if(d=null!=d?d:0,this.foEnabled&&"html"==a){var m=this.createDiv(s);null!=m&&(null!=p&&m.setAttribute("dir",p),this.addForeignObject(t,e,n,i,s,r,o,l,a,h,u,d,p,m,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,n,i,s,r,o,l,h,u,d,p)},mxSvgCanvas2D.prototype.createClip=function(t,e,n,i){for(var s="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(i=Math.round(i)),r=0,o=s+"-"+r;null!=document.getElementById(o);)o=s+"-"+ ++r;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var l=this.createElement("rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",n),l.setAttribute("height",i),clip.appendChild(l),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,h,u,d){u=null!=u?u:0;var p=this.state,m=p.fontSize,c=this.createElement("g"),g=p.transform||"";if(this.updateFont(c),this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none"),0!=u&&(g+="rotate("+u+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"),null!=d&&c.setAttribute("direction",d),h&&n>0&&i>0){var x=t,y=e;r==mxConstants.ALIGN_CENTER?x-=n/2:r==mxConstants.ALIGN_RIGHT&&(x-=n),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?y-=i/2:o==mxConstants.ALIGN_BOTTOM&&(y-=i));var f=this.createClip(x*p.scale-2,y*p.scale-2,n*p.scale+4,i*p.scale+4);if(null!=this.defs?this.defs.appendChild(f):this.root.appendChild(f),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)c.setAttribute("clip-path","url(#"+f.getAttribute("id")+")");else{var v=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c.setAttribute("clip-path","url("+v+"#"+f.getAttribute("id")+")")}}var C=r==mxConstants.ALIGN_RIGHT?"end":r==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=C&&c.setAttribute("text-anchor",C),this.styleEnabled&&m==mxConstants.DEFAULT_FONTSIZE||c.setAttribute("font-size",m*p.scale+"px"),g.length>0&&c.setAttribute("transform",g),p.alpha<1&&c.setAttribute("opacity",p.alpha);var E=s.split("\n"),S=Math.round(m*mxConstants.LINE_HEIGHT),b=m+(E.length-1)*S;y=e+m-1;if(o==mxConstants.ALIGN_MIDDLE)y-="fill"==a?i/2:(this.matchHtmlAlignment&&h&&i>0?Math.min(b,i):b)/2;else if(o==mxConstants.ALIGN_BOTTOM){if("fill"==a)y-=i;else y-=(this.matchHtmlAlignment&&h&&i>0?Math.min(b,i):b)+1}for(var T=0;T0&&mxUtils.trim(E[T]).length>0){var w=this.createElement("text");w.setAttribute("x",this.format(t*p.scale)+this.textOffset),w.setAttribute("y",this.format(y*p.scale)+this.textOffset),mxUtils.write(w,E[T]),c.appendChild(w)}y+=S}this.root.appendChild(c),this.addTextBackground(c,s,t,e,n,"fill"==a?i:b,r,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var n=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&t.setAttribute("text-decoration",n.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,n,i,s,r,o,l,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var u=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,i*h.scale,(s-2)*h.scale,(r+2)*h.scale);else if(null!=t.getBBox&&this.root.ownerDocument==document)try{u=t.getBBox();var d=mxClient.IS_IE&&mxClient.IS_SVG;u=new mxRectangle(u.x,u.y+(d?0:1),u.width,u.height+(d?1:0))}catch(t){}if(null==u||0==u.width||0==u.height){var p=document.createElement("div");p.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,p.style.fontSize=h.fontSize+"px",p.style.fontFamily=h.fontFamily,p.style.whiteSpace="nowrap",p.style.position="absolute",p.style.visibility="hidden",p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",p.style.zoom="1",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(p.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(p.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),p.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(p);s=p.offsetWidth,r=p.offsetHeight;p.parentNode.removeChild(p),o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,(i+2)*h.scale,s*h.scale,(r+1)*h.scale)}if(null!=u){var m=this.createElement("rect");m.setAttribute("fill",h.fontBackgroundColor||"none"),m.setAttribute("stroke",h.fontBorderColor||"none"),m.setAttribute("x",Math.floor(u.x-1)),m.setAttribute("y",Math.floor(u.y-1)),m.setAttribute("width",Math.ceil(u.width+2)),m.setAttribute("height",Math.ceil(u.height));var c=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c),this.root.ownerDocument==document&&1==mxUtils.mod(c,2)&&m.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(m,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=void 0!==mxSvgCanvas2D?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,i.strokeWidth*i.scale/this.vmlScale))+"px",i.shadow&&this.root.appendChild(this.createShadow(n,t&&null!=i.fillColor,e&&null!=i.strokeColor)),e&&null!=i.strokeColor?(n.stroked="true",n.strokecolor=i.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),t&&null!=i.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var n=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?n-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?n+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?n-=180+("y"==this.root.style.flip?-180:0):n+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),e.angle=mxUtils.mod(n,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");e.length>0&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,n){var i=this.state,s=-i.rotation*(Math.PI/180),r=Math.cos(s),o=Math.sin(s),l=i.shadowDx*i.scale,a=i.shadowDy*i.scale;"x"==this.root.style.flip?l*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(l*r-a*o)+"px",h.style.marginTop=Math.round(l*o+a*r)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(h.path=this.path.join(" ")+" e",h.style.width=this.root.style.width,h.style.height=this.root.style.height,h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),n?(h.strokecolor=i.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,n,i,s){e&&n?t+=180:e?this.root.style.flip="x":n&&(this.root.style.flip="y"),(e?!n:n)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=i,this.state.rotationCy=s},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,n,i){var s=this.state,r=(this.lastX+s.dx)*s.scale,o=(this.lastY+s.dy)*s.scale,l=(t+s.dx)*s.scale,a=(e+s.dy)*s.scale,h=(n+s.dx)*s.scale,u=(i+s.dy)*s.scale,d=r+2/3*(l-r),p=o+2/3*(a-o),m=h+2/3*(l-h),c=u+2/3*(a-u);this.path.push("c "+this.format(d)+" "+this.format(p)+" "+this.format(m)+" "+this.format(c)+" "+this.format(h)+" "+this.format(u)),this.lastX=h/s.scale-s.dx,this.lastY=u/s.scale-s.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,n,i,s){var r=this.state,o=this.createVmlElement(t);return o.style.position="absolute",o.style.left=this.format((e+r.dx)*r.scale)+"px",o.style.top=this.format((n+r.dy)*r.scale)+"px",o.style.width=this.format(i*r.scale)+"px",o.style.height=this.format(s*r.scale)+"px",o},mxVmlCanvas2D.prototype.rect=function(t,e,n,i){this.node=this.createRect("rect",t,e,n,i)},mxVmlCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){this.node=this.createRect("roundrect",t,e,n,i),this.node.setAttribute("arcsize",Math.max(100*s/n,100*r/i)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,n,i){this.node=this.createRect("oval",t,e,n,i)},mxVmlCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){var a=null;if(r){(a=this.createRect("rect",t,e,n,i)).stroked="false";var h=this.createVmlElement("fill");h.aspect=r?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=s,a.appendChild(h)}else(a=this.createRect("image",t,e,n,i)).src=s;o&&l?a.style.rotation="180":o?a.style.flip="x":l&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,n,i){var s=this.createElement("div"),r=this.state,o="";if(null!=r.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(r.fontBackgroundColor)+";"),null!=r.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(r.fontBorderColor)+";"),mxUtils.isNode(t))s.appendChild(t);else if("fill"!=i&&"width"!=i){var l=this.createElement("div");l.style.cssText=o,l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",l.style.textDecoration="inherit",l.innerHTML=t,s.appendChild(l)}else s.style.cssText=o,s.innerHTML=t;var a=s.style;return a.fontSize=r.fontSize/this.vmlScale+"px",a.fontFamily=r.fontFamily,a.color=r.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?r.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(r.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(r.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(r.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),s},mxVmlCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s){var m=this.state;if("html"==a){if(null!=m.rotation){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x,e=c.y}8!=document.documentMode||mxClient.IS_EM?(t*=m.scale,e*=m.scale):(t+=m.dx,e+=m.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&(e-=1));var g=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=m.scale;var x=this.createElement("div");x.style.position="relative",x.style.display="inline";var y=mxUtils.getAlignmentAsPoint(r,o),f=y.x,v=y.y,C=this.createDiv(s,r,o,h),E=this.createElement("div");if(null!=p&&C.setAttribute("dir",p),l&&n>0){if(u||(C.style.width=Math.round(n)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(P=C).firstChild&&"DIV"==P.firstChild.nodeName&&(P.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var S=m.rotation+(d||0);if(this.rotateHtml&&0!=S?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?g.appendChild(E):(x.appendChild(E),g.appendChild(x))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",g.appendChild(C)):(x.appendChild(C),g.appendChild(x)),"DIV"!=this.root.nodeName){var b=this.createVmlElement("rect");b.stroked="false",b.filled="false",b.appendChild(g),this.root.appendChild(b)}else this.root.appendChild(g);if(u?(C.style.overflow="hidden",C.style.width=Math.round(n)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(i)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.height=Math.max(0,i)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.maxHeight=Math.max(0,i)+1+"px"),this.rotateHtml&&0!=S){var T=S*(Math.PI/180),w=parseFloat(parseFloat(Math.cos(T)).toFixed(8)),L=parseFloat(parseFloat(Math.sin(-T)).toFixed(8));(T%=2*Math.PI)<0&&(T+=2*Math.PI),(T%=Math.PI)>Math.PI/2&&(T=Math.PI-T);var O=Math.cos(T),I=Math.sin(T);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",x.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var A=C;null!=A.firstChild&&"DIV"==A.firstChild.nodeName&&(A=A.firstChild);var P=A.offsetWidth+3,_=A.offsetHeight;u?(n=Math.min(n,P),_=Math.min(_,i)):n=P,l&&(C.style.width=n+"px"),mxClient.IS_QUIRKS&&(u||"width"==h)&&_>i&&(_=i,C.style.height=_+"px");var R=((i=_)-i*O+n*-I)/2-L*n*(f+.5)+w*i*(v+.5),M=(n-n*O+i*-I)/2+w*n*(f+.5)+L*i*(v+.5);if("group"==g.nodeName&&"DIV"==this.root.nodeName){var N=this.createElement("div");N.style.display="inline-block",N.style.position="absolute",N.style.left=this.format(t+(M-n/2)*m.scale)+"px",N.style.top=this.format(e+(R-i/2)*m.scale)+"px",g.parentNode.appendChild(N),N.appendChild(g)}else{var H=8!=document.documentMode||mxClient.IS_EM?m.scale:1;g.style.left=this.format(t+(M-n/2)*H)+"px",g.style.top=this.format(e+(R-i/2)*H)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+w+", M12="+L+", M21="+-L+", M22="+w+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+100*this.state.alpha+")");var D=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),n=C.offsetWidth;_=C.offsetHeight;mxClient.IS_QUIRKS&&u&&_>i&&(_=i,C.style.height=_+"px"),i=_,C.style.visibility="",D.appendChild(C),g.style.left=this.format(t+n*f*this.state.scale)+"px",g.style.top=this.format(e+i*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),x.style.left=100*f+"%",x.style.top=100*v+"%"}else this.plainText(t,e,n,i,mxUtils.htmlEntities(s,!1),r,o,l,a,h,u,d,p)}},mxVmlCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m=this.state;t=(t+m.dx)*m.scale,e=(e+m.dy)*m.scale;var c=this.createVmlElement("shape");c.style.width="1px",c.style.height="1px",c.stroked="false";var g=this.createVmlElement("fill");g.color=m.fontColor,g.opacity=100*m.alpha+"%",c.appendChild(g);var x=this.createVmlElement("path");x.textpathok="true",x.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),c.appendChild(x);var y=this.createVmlElement("textpath");y.style.cssText="v-text-align:"+r,y.style.align=r,y.style.fontFamily=m.fontFamily,y.string=s,y.on="true";var f=m.fontSize*m.scale/this.vmlScale;y.style.fontSize=f+"px",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(y.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(y.style.fontStyle="italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(y.style.textDecoration="underline");var v=f+(s.split("\n").length-1)*f*mxConstants.LINE_HEIGHT,C=0,E=0;if(o==mxConstants.ALIGN_BOTTOM?E=-v/2:o!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=d){c.style.rotation=d;var S=d*(Math.PI/180);C=Math.sin(S)*E,E=Math.cos(S)*E}c.appendChild(y),c.style.left=this.format(t-C)+"px",c.style.top=this.format(e+E)+"px",this.root.appendChild(c)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=void 0!==mxVmlCanvas2D?mxVmlCanvas2D:void 0,mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,n,i){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=t&&null!=e){var s=this.graph.getView().scale,r=this.getGuideTolerance(n)*s,o=t.clone();o.x+=e.x,o.y+=e.y;var l=!1,a=null,h=null,u=!1,d=null,p=null,m=r,c=r,g=o.x,x=o.x+o.width,y=o.getCenterX(),f=o.y,v=o.y+o.height,C=o.getCenterY();function I(n,i,s){var r=!1;s&&Math.abs(n-y)0&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(""!=t.tagUrn){var n=Math.max(1,Math.round(this.bounds.width)),i=Math.max(1,Math.round(this.bounds.height));t.coordsize=n*this.vmlScale+","+i*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var s=this.scale;return e.translate(-Math.round(this.bounds.x/s),-Math.round(this.bounds.y/s)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var n=this.fill,i=this.gradient,s="0",r={east:0,south:1,west:2,north:3},o=null!=this.direction?r[this.direction]:0;if(null!=this.gradientDirection&&(o=mxUtils.mod(o+r[this.gradientDirection]-1,4)),1==o){s="1";var l=n;n=i,i=l}else if(2==o){l=n;n=i,i=l}else 3==o&&(s="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+i+"', gradientType='"+s+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px","CSS1Compat"==document.compatMode&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var n=t.gradients[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e=!1;if(null!=t&&this.outline){var n=t.stroke;t.stroke=function(){e=!0,n.apply(this,arguments)};var i=t.fillAndStroke;t.fillAndStroke=function(){e=!0,i.apply(this,arguments)}}var s=this.scale,r=this.bounds.x/s,o=this.bounds.y/s,l=this.bounds.width/s,a=this.bounds.height/s;if(this.isPaintBoundsInverted()){var h=(l-a)/2;r+=h,o-=h;var u=l;l=a,a=u}this.updateTransform(t,r,o,l,a),this.configureCanvas(t,r,o,l,a);var d=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var p=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)d=this.createTransparentSvgRectangle(p.x,p.y,p.width,p.height),this.node.appendChild(d);else{var m=t.createRect("rect",p.x/s,p.y/s,p.width/s,p.height/s);m.appendChild(t.createTransparentFill()),m.stroked="false",t.root.appendChild(m)}}if(null!=this.stencil)this.stencil.drawShape(t,this,r,o,l,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var c=[],g=0;g0){o=null==o||o;var l=e[e.length-1];if(s&&n){var a=(e=e.slice())[0],h=new mxPoint(l.x+(a.x-l.x)/2,l.y+(a.y-l.y)/2);e.splice(0,0,h)}var u=e[0],d=1;for(o?t.moveTo(u.x,u.y):t.lineTo(u.x,u.y);d<(s?e.length:e.length-1);){var p=e[mxUtils.mod(d,e.length)],m=u.x-p.x,c=u.y-p.y;if(n&&(0!=m||0!=c)&&(null==r||mxUtils.indexOf(r,d-1)<0)){var g=Math.sqrt(m*m+c*c),x=m*Math.min(i,g/2)/g,y=c*Math.min(i,g/2)/g,f=p.x+x,v=p.y+y;t.lineTo(f,v);for(var C=e[mxUtils.mod(d+1,e.length)];d0&&t.height>0)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,n,i){var s=document.createElementNS(mxConstants.NS_SVG,"rect");return s.setAttribute("x",t),s.setAttribute("y",e),s.setAttribute("width",n),s.setAttribute("height",i),s.setAttribute("fill","none"),s.setAttribute("stroke","none"),s.setAttribute("pointer-events","all"),s},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var n=t[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=void 0!==mxShape?mxShape:void 0,mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&e.length>0){this.constraints=[];for(var n=0;n0&&r>0)for(var u=o.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,u,l,a,h),u=u.nextSibling},mxStencil.prototype.computeAspect=function(t,e,n,i,s,r){var o=e,l=n,a=i/this.w0,h=s/this.h0,u=r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH;if(u){h=i/this.h0,a=s/this.w0;var d=(i-s)/2;o+=d,l-=d}return"fixed"==this.aspect&&(a=h=Math.min(a,h),u?(o+=(s-this.w0*a)/2,l+=(i-this.h0*h)/2):(o+=(i-this.w0*a)/2,l+=(s-this.h0*h)/2)),new mxRectangle(o,l,a,h)},mxStencil.prototype.drawNode=function(t,e,n,i,s,r){var o=n.nodeName,l=i.x,a=i.y,h=i.width,u=i.height,d=Math.min(h,u);if("save"==o)t.save();else if("restore"==o)t.restore();else if(r){if("path"==o){t.begin();var p=!0;if("1"==n.getAttribute("rounded")){p=!1;for(var m=Number(n.getAttribute("arcSize")),c=0,g=[],x=n.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var y=x.nodeName;if("move"!=y&&"line"!=y){p=!0;break}"move"!=y&&0!=g.length||g.push([]),g[g.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*h,a+Number(x.getAttribute("y"))*u)),c++}x=x.nextSibling}if(!p&&c>0)for(var f=0;f0&&V.push(Number(U[f])*d);G=V.join(" "),t.setDashPattern(G)}}else"strokecolor"==o?t.setStrokeColor(n.getAttribute("color")):"linecap"==o?t.setLineCap(n.getAttribute("cap")):"linejoin"==o?t.setLineJoin(n.getAttribute("join")):"miterlimit"==o?t.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==o?t.setFillColor(n.getAttribute("color")):"alpha"==o||"fillalpha"==o||"strokealpha"==o?t.setAlpha(n.getAttribute("alpha")):"fontcolor"==o?t.setFontColor(n.getAttribute("color")):"fontstyle"==o?t.setFontStyle(n.getAttribute("style")):"fontfamily"==o?t.setFontFamily(n.getAttribute("family")):"fontsize"==o&&t.setFontSize(Number(n.getAttribute("size"))*d);!s||"fillstroke"!=o&&"fill"!=o&&"stroke"!=o||(s=!1,t.setShadow(!1))}},__mxOutput.mxStencil=void 0!==mxStencil?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=void 0!==mxStencilRegistry?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,n,i,s,r,o,l,a,h){var u=mxMarker.markers[n];return null!=u?u(t,e,n,i,s,r,o,l,a,h):null}};function mxActor(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxCloud(t,e,n,i){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRectangleShape(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxDoubleEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRhombus(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxPolyline(t,e,n){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxArrow(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.spacing=null!=r?r:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=r?r:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c,g,x,y,f,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=s?s:"black",this.align=null!=n?n:mxConstants.ALIGN_CENTER,this.valign=null!=i?i:mxConstants.ALIGN_MIDDLE,this.family=null!=r?r:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=l?l:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||2),this.spacingTop=this.spacing+parseInt(h||0),this.spacingRight=this.spacing+parseInt(u||0),this.spacingBottom=this.spacing+parseInt(d||0),this.spacingLeft=this.spacing+parseInt(p||0),this.horizontal=null==m||m,this.background=c,this.border=g,this.wrap=null!=x&&x,this.clipped=null!=y&&y,this.overflow=null!=f?f:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,n,i){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=n?n:1,this.vertical=null!=i?i:this.vertical}function mxImageShape(t,e,n,i,s){mxShape.call(this),this.bounds=t,this.image=e,this.fill=n,this.stroke=i,this.strokewidth=null!=s?s:1,this.shadow=!1}function mxLabel(t,e,n,i){mxRectangleShape.call(this,t,e,n,i)}function mxCylinder(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxConnector(t,e,n){mxPolyline.call(this,t,e,n)}function mxSwimlane(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,n,i,s,r){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=n?n:0,this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.border=null!=r?r:0}function mxPartitionLayout(t,e,n,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=n||0,this.border=i||0}function mxCompactTreeLayout(t,e,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=n&&n}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,n){mxGraphLayout.call(this,t),this.layouts=e,this.master=n}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=t,this.ids=[];for(var e=0;e0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxSwimlaneModel(t,e,n,i,s){t.getGraph(),this.tightenToSource=s,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var r=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,r);for(var o=0;o0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,n,i,s,r){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=n,this.orientation=i,this.initialX=s,this.parallelEdgeSpacing=r}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}!function(){function t(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();m.x-=d,m.y-=p;var c=i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return s.x+=-r*c-d,s.y+=-o*c-p,function(){e.begin(),e.moveTo(m.x,m.y),e.lineTo(m.x-r-o/t,m.y-o+r/t),i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(m.x-3*r/4,m.y-3*o/4),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.close(),u?e.fillAndStroke():e.stroke()}}}function e(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();return m.x-=d,m.y-=p,s.x+=2*-d,s.y+=2*-p,function(){e.begin(),e.moveTo(m.x-r-o/t,m.y-o+r/t),e.lineTo(m.x,m.y),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.stroke()}}}function n(t,e,n,i,s,r,o,l,a,h){var u=n==mxConstants.ARROW_DIAMOND?.7071:.9862,d=s*a*u,p=r*a*u;s*=o+a,r*=o+a;var m=i.clone();m.x-=d,m.y-=p,i.x+=-s-d,i.y+=-r-p;var c=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(m.x,m.y),t.lineTo(m.x-s/2-r/c,m.y+s/c-r/2),t.lineTo(m.x-s,m.y-r),t.lineTo(m.x-s/2+r/c,m.y-r/2-s/c),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",(function(t,e,n,i,s,r,o,l,a,h){var u=o/2,d=i.clone();return i.x-=s*u,i.y-=r*u,function(){t.ellipse(d.x-u,d.y-u,o,o),h?t.fillAndStroke():t.stroke()}})),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),__mxOutput.mxMarker=void 0!==mxMarker?mxMarker:void 0,mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,n,i,s){var r=i/3;t.moveTo(0,s),t.curveTo(0,3*s/5,0,2*s/5,i/2,2*s/5),t.curveTo(i/2-r,2*s/5,i/2-r,0,i/2,0),t.curveTo(i/2+r,0,i/2+r,2*s/5,i/2,2*s/5),t.curveTo(i,2*s/5,i,3*s/5,i,s),t.close()},__mxOutput.mxActor=void 0!==mxActor?mxActor:void 0,mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,n,i,s){t.moveTo(.25*i,.25*s),t.curveTo(.05*i,.25*s,0,.5*s,.16*i,.55*s),t.curveTo(0,.66*s,.18*i,.9*s,.31*i,.8*s),t.curveTo(.4*i,s,.7*i,s,.8*i,.8*s),t.curveTo(i,.8*s,i,.6*s,.875*i,.5*s),t.curveTo(i,.3*s,.8*i,.1*s,.625*i,.2*s),t.curveTo(.5*i,.05*s,.3*i,.05*s,.25*i,.25*s),t.close()},__mxOutput.mxCloud=void 0!==mxCloud?mxCloud:void 0,mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,n,i,s){var r=!0;if(null!=this.style&&(r="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),r||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(r||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var o=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))o=Math.min(i/2,Math.min(s/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(i*l,s*l)}t.roundrect(e,n,i,s,o,o)}else t.rect(e,n,i,s);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,n,i,s){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,n,i,s){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,n,i,s,this.getArcSize(i+this.strokewidth,s+this.strokewidth))},__mxOutput.mxRectangleShape=void 0!==mxRectangleShape?mxRectangleShape:void 0,mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},__mxOutput.mxEllipse=void 0!==mxEllipse?mxEllipse:void 0,mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,n,i,s){if(!this.outline){var r=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(i/5,s/5)));e+=r,n+=r,s-=2*r,(i-=2*r)>0&&s>0&&t.ellipse(e,n,i,s),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=void 0!==mxDoubleEllipse?mxDoubleEllipse:void 0,mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,s){var r=i/2,o=s/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+r,n),new mxPoint(e+i,n+o),new mxPoint(e+r,n+s),new mxPoint(e,n+o)],this.isRounded,l,!0),t.fillAndStroke()},__mxOutput.mxRhombus=void 0!==mxRhombus?mxRhombus:void 0,mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var n=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=n},mxPolyline.prototype.paintLine=function(t,e,n){var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,n,i,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var n=e[0],i=e.length;t.moveTo(n.x,n.y);for(var s=1;s2&&t.setMiterLimit(1.42),t.begin();var O=C,I=S;if(l&&!o)this.paintMarker(t,e[0].x,e[0].y,C,S,u,i,r,h,!0);else{var A=e[0].x+T/2+h*C,P=e[0].y+w/2+h*S,_=e[0].x-T/2+h*C,R=e[0].y-w/2+h*S;o?(t.moveTo(A,P),L.push((function(){t.lineTo(_,R)}))):(t.moveTo(_,R),t.lineTo(A,P))}for(var M=0,N=0,H=0,D=0;D=0;D--)L[D]();o?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),p&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),l&&!o&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,O,I,u,i,r,h,!0),t.stroke(),t.end()),a&&!o&&(t.begin(),this.paintMarker(t,m.x,m.y,-C,-S,d,s,r,h,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,n,i,s,r,o,l,a,h){var u=l/o,d=l*s/2,p=-l*i/2,m=(a+r)*i,c=(a+r)*s;h?t.moveTo(e-d+m,n-p+c):t.lineTo(e-d+m,n-p+c),t.lineTo(e-d/u+m,n-p/u+c),t.lineTo(e+a*i,n+a*s),t.lineTo(e+d/u+m,n+p/u+c),t.lineTo(e+d+m,n+p+c)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=void 0!==mxArrowConnector?mxArrowConnector:void 0,mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var n=this.scale,i=this.bounds.x/n,s=this.bounds.y/n,r=this.bounds.width/n,o=this.bounds.height/n;if(this.updateTransform(t,i,s,r,o),this.configureCanvas(t,i,s,r,o),e)t.updateText(i,s,r,o,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var l=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,a=l||t instanceof mxVmlCanvas2D?"html":"",h=this.value;l||"html"!=a||(h=mxUtils.htmlEntities(h,!1)),"html"!=a||mxUtils.isNode(this.value)||(h=mxUtils.replaceTrailingNewlines(h,"

")),h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==a?h.replace(/\n/g,"
"):h;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||l||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(i,s,r,o,h,this.align,this.valign,this.wrap,a,this.overflow,this.clipped,this.getTextRotation(),u)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if("DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML){var t=this.createCanvas();null!=t&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=t&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=null==t.ownerSVGElement?this.node.firstChild.firstChild:t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&n==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_MIDDLE)){var s=null,r=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)r=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,s="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else{var l=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale;else{null!=l&&(this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l),t=l);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var u=a.getElementsByTagName("div");u.length>0&&(a=u[u.length-1]),s=a.offsetWidth+2,u=this.node.getElementsByTagName("div"),this.clipped&&(s=Math.min(h,s)),u.length>1&&(u[u.length-2].style.width=s+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale}}null!=s&&null!=r&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,s,r))}if(null!=this.boundingBox)if(0!=e){var d=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=d.x,this.boundingBox.y+=d.y,this.boundingBox.width=d.width,this.boundingBox.height=d.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,n,i,s){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var n=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(e+="text-decoration: "+n.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),n="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",i=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,n,i,this.scale,mxUtils.bind(this,(function(t,e,n,i,s,r){var o=this.getTextRotation(),l=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=l&&(l="transform-origin: 0 0; transform: "+l+"; "),""==r?(n+=i,i="display:inline-block; min-width: 100%; "+l):(i+=l,mxClient.IS_SF&&(i+="-webkit-clip-path: content-box;")),this.opacity<100&&(s+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",n);var a=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="
"+a+"
"),this.node.firstChild.firstChild.setAttribute("style",s),this.node.firstChild.setAttribute("style",i)})))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,n=this.margin.x,i=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-n+"% "+100*-i+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*n+"%,"+100*i+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*n+"%,"+100*i+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(n*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-i*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e='
'+(e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e)+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,n=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var s=0,r=0,o=null!=this.state?this.state.view.textDiv:null,l=this.node;if(null!=o){o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,s=a,this.clipped&&(s=Math.min(s,this.bounds.width)),o.style.width=s+"px"):o.style.whiteSpace="nowrap",null!=(l=o).firstChild&&"DIV"==l.firstChild.nodeName&&(l=l.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(s=l.offsetWidth+this.textWidthPadding,o.style.width=s+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(r+=3)}else null!=l.firstChild&&"DIV"==l.firstChild.nodeName&&(r=(l=l.firstChild).offsetHeight);s=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));a=this.bounds.width/i;var h=this.bounds.height/i;"fill"==this.overflow?(r=h,s=a):"width"==this.overflow&&(r=l.scrollHeight,s=a),this.offsetWidth=s,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&h>0)?(h=Math.min(h,r),t.height=Math.round(h)+"px"):h=r,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(s=Math.min(a,s)),a=s,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),d=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),p=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));(u%=2*Math.PI)<0&&(u+=2*Math.PI),(u%=Math.PI)>Math.PI/2&&(u=Math.PI-u);var m=Math.cos(u),c=Math.sin(-u),g=a*-(e+.5),x=h*-(n+.5),y=(h-h*m+a*c)/2+p*g-d*x,f=(a-a*m+h*c)/2-d*g-p*x;if(0!=u){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12="+p+", M21="+-p+", M22="+d+", sizingMethod='auto expand')";null!=t.filter&&t.filter.length>0?t.filter+=" "+v:t.filter=v}n=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?n-=1:this.valign==mxConstants.ALIGN_BOTTOM?n+=2:n+=1),t.zoom=i,t.left=Math.round(this.bounds.x+f-a/2)+"px",t.top=Math.round(this.bounds.y+y-h/2+n)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=e&&(this.node.style.backgroundColor=e),null!=n&&(this.node.style.border="1px solid "+n);else{var i="";null!=e&&(i+="background-color:"+mxUtils.htmlEntities(e)+";"),null!=n&&(i+="border:1px solid "+mxUtils.htmlEntities(n)+";"),t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var r=this.textDirection;r==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(r=this.getAutoDirection()),r==mxConstants.TEXT_DIRECTION_LTR||r==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",r):s[s.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var n=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),e.textDecoration=n.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var n=Math.max(0,Math.round(this.bounds.width/this.scale)),i=Math.max(0,Math.round(this.bounds.height/this.scale)),s=t.style;if(this.clipped?(s.overflow="hidden",mxClient.IS_QUIRKS?s.width=n+"px":(s.maxHeight=i+"px",s.maxWidth=n+"px")):"fill"==this.overflow?(s.width=n+1+"px",s.height=i+1+"px",s.overflow="hidden"):"width"==this.overflow&&(s.width=n+1+"px",s.maxHeight=i+1+"px",s.overflow="hidden"),this.wrap&&n>0){if(s.wordWrap=mxConstants.WORD_WRAP,s.whiteSpace="normal",s.width=n+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var r=t;null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild,"break-word"==t.style.wordWrap&&(r.style.width="100%"));var o=r.offsetWidth;if(0==o){var l=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),o=r.offsetWidth,t.style.visibility="",l.appendChild(t)}o+=3,this.clipped&&(o=Math.min(o,n)),s.width=o+"px"}}else s.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},__mxOutput.mxText=void 0!==mxText?mxText:void 0,mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,.5*s),new mxPoint(0,s)],this.isRounded,r,!0)},__mxOutput.mxTriangle=void 0!==mxTriangle?mxTriangle:void 0,mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*i,0),new mxPoint(.75*i,0),new mxPoint(i,.5*s),new mxPoint(.75*i,s),new mxPoint(.25*i,s),new mxPoint(0,.5*s)],this.isRounded,r,!0)},__mxOutput.mxHexagon=void 0!==mxHexagon?mxHexagon:void 0,mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,n,i,s){if(t.begin(),this.vertical){var r=e+i/2;t.moveTo(r,n),t.lineTo(r,n+s)}else{r=n+s/2;t.moveTo(e,r),t.lineTo(e+i,r)}t.stroke()},__mxOutput.mxLine=void 0!==mxLine?mxLine:void 0,mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,n,i,s){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,n,i,s){if(null!=this.image){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=r&&(t.setFillColor(r),t.setStrokeColor(o),t.rect(e,n,i,s),t.fillAndStroke()),t.image(e,n,i,s,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,n,i,s),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var n=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,i=document.createElement(n?mxClient.VML_PREFIX+":image":"img");i.setAttribute("border","0"),i.style.position="absolute",i.src=this.image;var s=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=s,this.flipH&&this.flipV?s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?s+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),i.style.filter!=s&&(i.style.filter=s),"image"==i.nodeName?i.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(i.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(i.style,"transform",""),i.style.width=this.node.style.width,i.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(i)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=void 0!==mxImageShape?mxImageShape:void 0,mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,n,i,s){this.paintImage(t,e,n,i,s),this.paintIndicator(t,e,n,i,s),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,n,i,s){if(null!=this.image){var r=this.getImageBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:s==mxConstants.ALIGN_RIGHT?t+=n-o-a:t+=a,r==mxConstants.ALIGN_TOP?e+=a:r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.paintIndicator=function(t,e,n,i,s){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,n,i,s),this.indicator.paint(t);else if(null!=this.indicatorImage){var r=this.getIndicatorBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return s==mxConstants.ALIGN_RIGHT?t+=n-o-a:s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:t+=a,r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:r==mxConstants.ALIGN_TOP?e+=a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=void 0!==mxLabel?mxLabel:void 0,mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,n,i,s,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,n,i){return Math.min(this.maxHeight,Math.round(i/5))},mxCylinder.prototype.redrawPath=function(t,e,n,i,s,r){var o=this.getCylinderSize(e,n,i,s);(r&&null!=this.fill||!r&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),r||(t.stroke(),t.begin())),r||(t.moveTo(0,o),t.curveTo(0,-o/3,i,-o/3,i,o),t.lineTo(i,s-o),t.curveTo(i,s+o/3,0,s+o/3,0,s-o),t.close())},__mxOutput.mxCylinder=void 0!==mxCylinder?mxCylinder:void 0,mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=n&&n(),null!=i&&i()},mxConnector.prototype.createMarker=function(t,e,n){var i=null,s=e.length,r=mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=n?e[1]:e[s-2],l=n?e[0]:e[s-1];if(null!=r&&null!=o&&null!=l){for(var a=1;a0)for(var l=0;lt.weightedValue?-1:e.weightedValueh)break;l=m}}}var c=s.getIndex(t);c=Math.max(0,o-(o>c?1:0)),i.add(s,t,c)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),n=e.getGeometry(t);null!=this.graph.container&&(null==n&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return n},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),n=e.getChildCount(t),i=[],s=0;si.x>0?1:-1:n.y==i.y?0:n.y>i.y>0?1:-1}))),i},mxStackLayout.prototype.snap=function(t){if(null!=this.gridSize&&this.gridSize>0&&(t=Math.max(t,this.gridSize))/this.gridSize>1){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(null!=t){var e=this.getParentSize(t),n=this.isHorizontal(),i=this.graph.getModel(),s=null;null!=e&&(s=n?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),s-=2*this.border;var r=this.x0+this.border+this.marginLeft,o=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var l=this.graph.getCellStyle(t),a=mxUtils.getNumber(l,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),n==h&&(s-=a),h?o+=a:r+=a}i.beginUpdate();try{for(var u=0,d=null,p=0,m=null,c=this.getLayoutCells(t),g=0;gthis.wrap||!n&&d.y+d.height+y.height+2*this.spacing>this.wrap)&&(d=null,n?o+=u+this.spacing:r+=u+this.spacing,u=0),u=Math.max(u,n?y.height:y.width);var f=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(x);f=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=d){var C=p+this.spacing+Math.floor(f/2);n?y.x=this.snap((this.allowGaps?Math.max(C,y.x):C)-this.marginLeft)+this.marginLeft:y.y=this.snap((this.allowGaps?Math.max(C,y.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(n?y.x=this.allowGaps&&y.x>r?Math.max(this.snap(y.x-this.marginLeft)+this.marginLeft,r):r:y.y=this.allowGaps&&y.y>o?Math.max(this.snap(y.y-this.marginTop)+this.marginTop,o):o);n?y.y=o:y.x=r,this.fill&&null!=s&&(n?y.height=s:y.width=s),n?y.width=this.snap(y.width):y.height=this.snap(y.height),this.setChildGeometry(x,y),m=x,d=y,p=n?d.x+d.width+Math.floor(f/2):d.y+d.height+Math.floor(f/2)}}this.resizeParent&&null!=e&&null!=d&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,d):this.resizeLast&&null!=e&&null!=d&&null!=m&&(n?d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft:d.height=e.height-d.y-this.spacing-this.marginBottom,this.setChildGeometry(m,d))}finally{i.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var n=this.graph.getCellGeometry(t);null!=n&&e.x==n.x&&e.y==n.y&&e.width==n.width&&e.height==n.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,n){var i=this.isHorizontal(),s=this.graph.getModel(),r=e.clone();if(i){var o=n.x+n.width+this.marginRight+this.border;this.resizeParentMax?r.width=Math.max(r.width,o):r.width=o}else{o=n.y+n.height+this.marginBottom+this.border;this.resizeParentMax?r.height=Math.max(r.height,o):r.height=o}e.x==r.x&&e.y==r.y&&e.width==r.width&&e.height==r.height||s.setGeometry(t,r)},__mxOutput.mxStackLayout=void 0!==mxStackLayout?mxStackLayout:void 0,mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),s=i.getParent(t);if(null!=t&&null!=s){var r=0,o=0,l=i.getChildCount(s);for(r=0;re)break;o=u}}var d=s.getIndex(t);d=Math.max(0,r-(r>d?1:0)),i.add(s,t,d)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),n=this.graph.getModel(),i=n.getGeometry(t);null!=this.graph.container&&(null==i&&n.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=i){for(var s=[],r=n.getChildCount(t),o=0;o0){var h=this.border,u=this.border,d=e?i.height:i.width;d-=2*this.border;var p=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;d-=e?p.height:p.width,h+=p.width,u+=p.height;var m=this.border+(a-1)*this.spacing,c=e?(i.width-h-m)/a:(i.height-u-m)/a;if(c>0){n.beginUpdate();try{for(o=0;o0)this.root=t;else{var i=this.graph.findTreeRoots(t,!0,this.invert);if(i.length>0)for(var s=0;s0){this.root=i[s];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);n.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var r=this.graph.gridSize,o=r;if(!this.moveTree){var l=this.getVertexBounds(this.root);null!=l&&(r=l.x,o=l.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,r,o):this.verticalLayout(this.node,null,r,o))){var u=0,d=0;h.x<0&&(u=Math.abs(r-h.x)),h.y<0&&(d=Math.abs(o-h.y)),0==u&&0==d||this.moveNode(this.node,u,d),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,n.setGeometry(t,a))}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,n){t.x+=e,t.y+=n,this.apply(t);for(var i=t.child;null!=i;)this.moveNode(i,e,n),i=i.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var n=new mxDictionary;e.sort((function(e,i){var s=e.getTerminal(e.getTerminal(!1)==t),r=n.get(s);null==r&&(r=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),n.put(s,r));var o=i.getTerminal(i.getTerminal(!1)==t),l=n.get(o);return null==l&&(l=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),n.put(o,l)),mxCellPath.compare(r,l)}))},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var n=t.child;null!=n;)this.setCellHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var n=mxCellPath.create(t),i=null;if(null!=t&&null==this.visited[n]&&!this.isVertexIgnored(t)){this.visited[n]=t,i=this.createNode(t);var s=this.graph.getModel(),r=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),l=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a0)if(t<0)o=t*i/n-e;else if(t>0){o=t*r/s-e}else o=-e;else if(st+n){o=(n+t)*r/s-(e+i)}else o=r-(e+i);return o>0?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,n,i,s,r){var o=s+i.dx-e,l=0;l=0==i.dx?i.dy:o*i.dy/i.dx;var a=this.createLine(o,l,i.next);return t.next=this.createLine(0,r+i.dy-l-n,a),a},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var n=this.getVertexBounds(t);return null!=n&&(this.isHorizontal()?(e.width=n.height,e.height=n.width):(e.width=n.width,e.height=n.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var n=this.graph.getModel(),i=t.cell,s=n.getGeometry(i);if(null!=i&&null!=s){if(this.isVertexMovable(i)&&(s=this.setVertexLocation(i,t.x,t.y),this.resizeParent)){var r=n.getParent(i),o=mxCellPath.create(r);null==this.parentsChanged[o]&&(this.parentsChanged[o]=r)}e=null==e?new mxRectangle(s.x,s.y,s.width,s.height):new mxRectangle(Math.min(e.x,s.x),Math.min(e.y,s.y),Math.max(e.x+e.width,s.x+s.width),Math.max(e.y+e.height,s.y+s.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,n){var i=new Object;return i.dx=t,i.dy=e,i.next=n,i},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,n=t.cell,i=0,s=[];null!=e;){i++;var r=e.x;this.horizontal&&(r=e.y),s.push(new WeightedCellSorter(e,r)),e=e.next}s.sort(WeightedCellSorter.prototype.compare);var o=t.width,l=(i+1)*this.prefHozEdgeSep;o>l+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/i,h=a/2;o>l+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var u=this.minEdgeJetty-this.prefVertEdgeOff,d=this.getVertexBounds(n);e=t.child;for(var p=0;pi/2&&(u-=this.prefVertEdgeOff),h+=a}},__mxOutput.mxCompactTreeLayout=void 0!==mxCompactTreeLayout?mxCompactTreeLayout:void 0,mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var n=null,i=this.getVertexBounds(this.root);for(var s in this.centerX=i.x+i.width/2,this.centerY=i.y+i.height/2,this.visited){var r=this.getVertexBounds(this.visited[s]);(n=null!=n?n:r.clone()).add(r)}this.calcRowDims([this.node],0);for(var o=0,l=0,a=0;a=0;a--){var y=this.row[a];for(m=0;m0){var E=C/v;if(E>c.theta&&m0){var b=y[m-1].theta;c.theta=Math.max(E,b+Math.PI/10)}}}}for(a=0;athis.maxDistanceLimit)continue;o1&&this.layout(s)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var n=[],i=mxUtils.bind(this,(function(t){if(!this.isEdgeIgnored(t)){var e=this.getEdgeId(t);null!=e&&(null==n[e]&&(n[e]=[]),n[e].push(t))}}));if(null!=e)for(var s=0;si?i+"-"+n:n+"-"+i)+s}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],n=this.graph.getView(),i=this.graph.getModel(),s=i.getGeometry(n.getVisibleTerminal(e,!0)),r=i.getGeometry(n.getVisibleTerminal(e,!1));if(s==r)for(var o=s.x+s.width+this.spacing,l=s.y+s.height/2,a=0;a0){o=h+d/2,l=u+p/2;var c=p*this.spacing/m,g=d*this.spacing/m;o+=c*(t.length-1)/2,l-=g*(t.length-1)/2;for(a=0;a0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=void 0!==mxGraphHierarchyEdge?mxGraphHierarchyEdge:void 0,mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),s=0;s0&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var u=new mxGraphHierarchyEdge(a),d=0;d0;){var s;d=(h=t[0]).connectsAsTarget,s=h.connectsAsSource;var r=!0,o=this.SOURCESCANSTARTRANK;for(e=0;e1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o0&&null==this.edgeMapper.get(u[0])&&2*d.length>=u.length){for(var p=new mxGraphHierarchyEdge(u),m=0;m=0;n--)n==this.ranksPerGroup.length-1?s[n]=0:s[n]=r[n+1]+1,r[n]=s[n]+this.ranksPerGroup[n];this.maxRank=r[0];var o=this.vertexMapper.getValues();for(n=0;n0;){var l,a;l=(i=t[0]).connectsAsTarget,a=i.connectsAsSource;var h=!0,u=r[0];for(n=0;nr[i.swimlaneIndex]&&(u=r[i.swimlaneIndex]),i.temp[0]=u,null!=a)for(n=0;n1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o0;)y%2&&(n+=x[y+1]),++x[y=y-1>>1]}return n},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var n=!0,i=0;n&&i++<10;){var s=t%2==1&&i%2==1;n=!1;for(var r=0;ry[T]&&S++,g[E]f[T]&&S++,x[E]=0;i--)this.medianRank(i,n);else for(i=1;it.medianValue?-1:e.medianValue0&&h<=a;){var u=e.shift(),d=u.cell,p=u.weightedValue,m=parseInt(u.rankIndex),c=d.getNextLayerConnectedCells(p),g=d.getPreviousLayerConnectedCells(p),x=c.length,y=g.length,f=this.medianXValue(c,p+1),v=this.medianXValue(g,p-1),C=x+y,E=d.getGeneralPurposeVariable(p),S=E;C>0&&(S=(f*x+v*y)/C);var b=!1;if(SE+1){if(m==i[p].length-1)d.setGeneralPurposeVariable(p,S),b=!0;else{var L=i[p][m+1],O=L.getGeneralPurposeVariable(p);(O=O-L.width/2-this.intraCellSpacing-d.width/2)>S?(d.setGeneralPurposeVariable(p,S),b=!0):O>d.getGeneralPurposeVariable(p)+1&&(d.setGeneralPurposeVariable(p,O),b=!0)}}if(b){for(s=0;s0;n--)this.rankMedianPosition(n-1,e,n);else for(n=0;n0?this.medianXValue(a,n):h.getGeneralPurposeVariable(t));for(var d=0,p=-1e8,m=s[o].rankIndex-1;m>=0;){if(null!=(y=r[i[m].id])){var c=y.cell;y.visited?(p=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+h.width/2,m=-1):(d+=c.width+this.intraCellSpacing,m--)}}var g=0,x=1e8;for(m=s[o].rankIndex+1;m=p&&u<=x?h.setGeneralPurposeVariable(t,u):ux&&(h.setGeneralPurposeVariable(t,x),this.currentXDelta+=u-x),s[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var n=0,i=0;i=0;n--)n0&&this.rankCoordinates(n,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,n){for(var i=n.ranks[t],s=0,r=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,l=0;l=0;s--){for(var r=0,o=e.ranks[s],l=this.initialX,a=!1,h=0;hthis.widestRankValue&&(this.widestRankValue=l,this.widestRank=s),this.rankWidths[s]=l}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[s]=n;var m=r/2+i/2+this.interRankCellSpacing;i=r,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+=m:n-=m;for(h=0;hs.minRank+1;a--){var g;c==(g=s.getX(a-1))||this.repositionValid(e,s,a-1,c)?(m[a-s.minRank-2]=c,d++):(m[a-s.minRank-2]=s.getX(a-1),c=g)}if(d>l||u>l)if(d>=u)for(a=s.maxRank-2;a>s.minRank;a--)s.setX(a,m[a-s.minRank-1]);else if(u>d)for(a=s.minRank+2;al){if(r==s.length-1)return!0;var u=s[r+1],d=u.getGeneralPurposeVariable(n);return(d=d-u.width/2-this.intraCellSpacing-e.width/2)>=i}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n-1&&o0){for(var a=[],h=0;hf+2*this.prefHozEdgeSep&&(d+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);var v=(p-d)/m,C=d+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff;for(h=0;hm/2&&(E-=this.prefVertEdgeOff);for(var T=0;T0?-e:-e+this.parallelEdgeSpacing,s++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,n=t.x[0]-t.width/2,i=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],i),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],i+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,n,i):this.layout.setVertexLocation(e,i,n),this.limitX=Math.max(this.limitX,n+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=void 0!==mxCoordinateAssignment?mxCoordinateAssignment:void 0,mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),n=new Object,i=mxUtils.clone(e.vertexMapper,null,!0),s=null;if(null!=e.roots){var r=e.roots;s=[];for(var o=0;o0&&n.push(l);var p=h-u;p>r&&(r=p,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o=0&&(s=this.traverse(m,e,u[p],i,s,r,o))}}}return s},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxHierarchicalLayout=void 0!==mxHierarchicalLayout?mxHierarchicalLayout:void 0,mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,mxSwimlaneLayout.prototype.parentBorder=30,mxSwimlaneLayout.prototype.intraCellSpacing=30,mxSwimlaneLayout.prototype.interRankCellSpacing=100,mxSwimlaneLayout.prototype.interHierarchySpacing=60,mxSwimlaneLayout.prototype.parallelEdgeSpacing=10,mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxSwimlaneLayout.prototype.fineTuning=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,mxSwimlaneLayout.prototype.model=null,mxSwimlaneLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.edgeSourceTermCache=null,mxHierarchicalLayout.prototype.edgesTargetTermCache=null,mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxSwimlaneLayout.prototype.getModel=function(){return this.model},mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=n.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e;for(var i=[],s=0;s0&&n.push(l);var c=h-u;c>r&&(r=c,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o0&&null!=t){for(var i=Object(),s=0;s=this.swimlanes.length||(x>l||(!e||g)&&x==l)&&(s=this.traverse(c,e,d[m],i,s,r,o,x))}}}return s},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxSwimlaneLayout=void 0!==mxSwimlaneLayout?mxSwimlaneLayout:void 0,mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t},mxGraphModel.prototype.createRoot=function(){var t=new mxCell;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var n=null;if(null!=t){n=[];for(var i=0;i0){var i=t,s=mxCellPath.create(i);if(n.length=0;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,n){var i=this.getParent(t);if(null!=e)e==i&&i.getIndex(t)==n||e.insert(t,n);else if(null!=i){var s=i.getIndex(t);i.remove(s)}var r=this.contains(e),o=this.contains(i);return r&&!o?this.cellAdded(t):o&&!r&&this.cellRemoved(t),i},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,n){e=null!=e&&e,n=null!=n&&n;for(var i=this.getChildCount(t),s=[],r=0;r=0&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var n=this.getEdgeIndex(t);n>=0&&this.edges.splice(n,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var n=this.getValue(),i=null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(t):null;return null!=i?i:e},mxCell.prototype.setAttribute=function(t,e){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=void 0!==mxCell?mxCell:void 0,mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var n=mxUtils.toRadians(t),i=Math.cos(n),s=Math.sin(n);if(!this.relative){var r=new mxPoint(this.getCenterX(),this.getCenterY()),o=mxUtils.getRotatedPoint(r,i,s,e);this.x=Math.round(o.x-this.width/2),this.y=Math.round(o.y-this.height/2)}if(null!=this.sourcePoint){o=mxUtils.getRotatedPoint(this.sourcePoint,i,s,e);this.sourcePoint.x=Math.round(o.x),this.sourcePoint.y=Math.round(o.y)}if(null!=this.targetPoint){o=mxUtils.getRotatedPoint(this.targetPoint,i,s,e);this.targetPoint.x=Math.round(o.x),this.targetPoint.y=Math.round(o.y)}if(null!=this.points)for(var l=0;l1&&(e=e.substring(0,i-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var n=t;if(null!=e)for(var i=e.split(mxCellPath.PATH_SEPARATOR),s=0;se[s]?1:-1;else i=(r=parseInt(t[s]))==(o=parseInt(e[s]))?0:r>o?1:-1;break}0==i&&((r=t.length)!=(o=e.length)&&(i=r>o?1:-1));return i}};__mxOutput.mxCellPath=void 0!==mxCellPath?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,n,i){var s=t.getCenterX(),r=t.getCenterY(),o=n.x-s,l=n.y-r,a=Math.atan2(l,o),h=new mxPoint(0,0),u=Math.PI,d=Math.PI/2-a,p=Math.atan2(t.height,t.width);return a<-u+p||a>u-p?(h.x=t.x,h.y=r-t.width*Math.tan(a)/2):a<-p?(h.y=t.y,h.x=s-t.height*Math.tan(d)/2):a=t.x&&n.x<=t.x+t.width?h.x=n.x:n.y>=t.y&&n.y<=t.y+t.height&&(h.y=n.y),n.xt.x+t.width&&(h.x=t.x+t.width),n.yt.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width/2,l=t.height/2,a=s+o,h=r+l,u=n.x,d=n.y,p=parseInt(u-a),m=parseInt(d-h);if(0==p&&0!=m)return new mxPoint(a,h+l*m/Math.abs(m));if(0==p&&0==m)return new mxPoint(u,d);if(i){if(d>=r&&d<=r+t.height){var c=d-h,g=Math.sqrt(o*o*(1-c*c/(l*l)))||0;return u<=s&&(g=-g),new mxPoint(a+g,d)}if(u>=s&&u<=s+t.width){g=u-a,c=Math.sqrt(l*l*(1-g*g/(o*o)))||0;return d<=r&&(c=-c),new mxPoint(u,h+c)}}var x=m/p,y=h-x*a,f=o*o*x*x+l*l,v=-2*a*f,C=o*o*x*x*a*a+l*l*a*a-o*o*l*l,E=Math.sqrt(v*v-4*f*C),S=(-v+E)/(2*f),b=(-v-E)/(2*f),T=x*S+y,w=x*b+y,L=0,O=0;return Math.sqrt(Math.pow(S-u,2)+Math.pow(T-d,2))d?r:r+l);if(h==d)return new mxPoint(a>u?s:s+o,h);var p=a,m=h;return i&&(u>=s&&u<=s+o?p=u:d>=r&&d<=r+l&&(m=d)),u-f&&yMath.PI-f)v=i&&(r&&n.x>=p.x&&n.x<=c.x||!r&&n.y>=p.y&&n.y<=c.y)?r?new mxPoint(n.x,p.y):new mxPoint(p.x,n.y):s==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(y)/2,l+h):s==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(y)/2,l):s==mxConstants.DIRECTION_WEST?new mxPoint(o+a,l+h/2+a*Math.tan(y)/2):new mxPoint(o,l+h/2-a*Math.tan(y)/2);else{if(i){var C=new mxPoint(u,d);n.y>=l&&n.y<=l+h?(C.x=r?u:s==mxConstants.DIRECTION_WEST?o+a:o,C.y=n.y):n.x>=o&&n.x<=o+a&&(C.x=n.x,C.y=r?s==mxConstants.DIRECTION_NORTH?l+h:l:d),g=n.x-C.x,x=n.y-C.y,u=C.x,d=C.y}v=r&&n.x<=o+a/2||!r&&n.y<=l+h/2?mxUtils.intersection(n.x,n.y,u,d,p.x,p.y,m.x,m.y):mxUtils.intersection(n.x,n.y,u,d,m.x,m.y,c.x,c.y)}return null==v&&(v=new mxPoint(u,d)),v},HexagonPerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width,l=t.height,a=t.getCenterX(),h=t.getCenterY(),u=n.x,d=n.y,p=u-a,m=d-h,c=-Math.atan2(m,p),g=Math.PI,x=Math.PI/2,y=new mxPoint(a,h),f=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((ur+l||u>s+o&&ds+o&&d>r+l)&&(i=!1),i){if(v){if(u==a){if(d<=r)return new mxPoint(a,r);if(d>=r+l)return new mxPoint(a,r+l)}else if(us+o){if(d==r+l/4)return new mxPoint(s+o,r+l/4);if(d==r+3*l/4)return new mxPoint(s+o,r+3*l/4)}else if(u==s){if(dh)return new mxPoint(s,r+3*l/4)}else if(u==s+o){if(dh)return new mxPoint(s+o,r+3*l/4)}if(d==r)return new mxPoint(a,r);if(d==r+l)return new mxPoint(a,r+l);ur+l/4&&dr+3*l/4&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l))):u>a&&(d>r+l/4&&dr+3*l/4&&(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))))}else{if(d==h){if(u<=s)return new mxPoint(s,r+l/2);if(u>=s+o)return new mxPoint(s+o,r+l/2)}else if(dr+l){if(u==s+o/4)return new mxPoint(s+o/4,r+l);if(u==s+3*o/4)return new mxPoint(s+3*o/4,r+l)}else if(d==r){if(ua)return new mxPoint(s+3*o/4,r)}else if(d==r+l){if(uh)return new mxPoint(s+3*o/4,r+l)}if(u==s)return new mxPoint(s,h);if(u==s+o)return new mxPoint(s+o,h);ds+o/4&&us+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r+l)):d>h&&(u>s+o/4&&us+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)))}var S=a,b=h;u>=s&&u<=s+o?(S=u,b=d=r&&d<=r+l&&(b=d,S=u-T?(C=new mxPoint(s+o,r),E=new mxPoint(s+o,r+l)):c>T&&cx&&cg-T&&c<=g||c<-g+T&&c>=-g?(C=new mxPoint(s,r),E=new mxPoint(s,r+l)):c<-T&&c>-x?(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))):c<-x&&c>-g+T&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l)))}else{var T;if(c==(T=Math.atan2(l/2,o/4)))return new mxPoint(s+Math.floor(.75*o),r);if(c==g-T)return new mxPoint(s+Math.floor(.25*o),r);if(c==g||c==-g)return new mxPoint(s,r+Math.floor(.5*l));if(0==c)return new mxPoint(s+o,r+Math.floor(.5*l));if(c==-T)return new mxPoint(s+Math.floor(.75*o),r+l);if(c==-g+T)return new mxPoint(s+Math.floor(.25*o),r+l);c>0&&cT&&cg-T&&c-T?(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)):c<-T&&c>-g+T?(C=new mxPoint(s,r+l),E=new mxPoint(s+o,r+l)):c<-g+T&&c>-g&&(C=new mxPoint(s-Math.floor(.25*o),r),E=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)))}y=mxUtils.intersection(a,h,n.x,n.y,C.x,C.y,E.x,E.y)}return null==y?new mxPoint(a,h):y}};function mxPrintPreview(t,e,n,i,s,r,o,l,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=i?i:0,this.pageFormat=mxRectangle.fromRectangle(null!=n?n:t.pageFormat),this.title=null!=l?l:"Printer-friendly version",this.x0=null!=s?s:0,this.y0=null!=r?r:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,n){this.view=t,this.cell=e,this.style=null!=n?n:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,n){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,(function(){this.graph.isEditing()&&this.resize()})),this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler),this.changeHandler=mxUtils.bind(this,(function(t){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}__mxOutput.mxPerimeter=void 0!==mxPerimeter?mxPerimeter:void 0,mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='':8==document.documentMode?t='':document.documentMode>8&&(t='\x3c!--[if IE]>0&&l.writeln(a),mxClient.IS_VML?l.writeln(''):("CSS1Compat"===document.compatMode&&l.writeln(""),l.writeln("")),l.writeln(""),this.writeHead(l,t),l.writeln(" "),l.writeln('')}var h=this.graph.getGraphBounds().clone(),u=this.graph.getView().getScale(),d=u/this.scale,p=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=p.x*this.scale,this.y0-=p.y*this.scale,h.width+=h.x,h.height+=h.y,h.x=0,h.y=0,this.border=0);var m=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom,h.width/=d,h.height/=d;var g=Math.max(1,Math.ceil((h.width+this.x0)/m)),x=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=g*x;var y=mxUtils.bind(this,(function(){if(this.pageSelector&&(x>1||g>1)){var t=this.createPageSelector(x,g);if(l.body.appendChild(t),mxClient.IS_IE&&null==l.documentMode||5==l.documentMode||8==l.documentMode||7==l.documentMode){t.style.position="absolute";var e=function(){t.style.top=(l.body.scrollTop||l.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()})),mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}})),f=mxUtils.bind(this,(function(t,e){if(null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(n||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))l.writeln(t.outerHTML),t.parentNode.removeChild(t);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var i=l.createElement("div");i.innerHTML=t.outerHTML,i=i.getElementsByTagName("div")[0],l.body.appendChild(i),t.parentNode.removeChild(t)}else t.parentNode.removeChild(t),l.body.appendChild(t);(n||e)&&this.addPageBreak(l)})),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var n=this.wnd.document,i=n.createElement("table");i.className="mxPageSelector",i.setAttribute("border","0");for(var s=n.createElement("tbody"),r=0;r0&&s.height>0&&!mxUtils.intersects(C,s))return}}y.apply(this,arguments)}}var E=null;try{var S=[this.getRoot()];E=new mxTemporaryCellStates(o,n,S,null,mxUtils.bind(this,(function(t){return this.getLinkForCellState(t)})))}finally{if(mxClient.IS_IE)o.overlayPane.innerHTML="",o.canvas.style.overflow="hidden",o.canvas.style.position="relative",o.canvas.style.top=this.marginTop+"px",o.canvas.style.width=r.width+"px",o.canvas.style.height=r.height+"px";else for(var b=s.firstChild;null!=b;){var T=b.nextSibling,w=b.nodeName.toLowerCase();"svg"==w?(b.style.overflow="hidden",b.style.position="relative",b.style.top=this.marginTop+"px",b.setAttribute("width",r.width),b.setAttribute("height",r.height),b.style.width="",b.style.height=""):"default"!=b.style.cursor&&"div"!=w&&b.parentNode.removeChild(b),b=T}if(this.printBackgroundImage){var L=s.getElementsByTagName("svg");L.length>0&&(L[0].style.position="absolute")}o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(g),this.graph.container=l,this.graph.cellRenderer.redraw=y,o.canvas=a,o.backgroundPane=h,o.drawPane=u,o.overlayPane=d,o.translate=x,E.destroy(),o.setEventsEnabled(c)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,n){var i=this.graph.backgroundImage;if(null!=i){var s=document.createElement("img");s.style.position="absolute",s.style.marginLeft=Math.round(e*this.scale)+"px",s.style.marginTop=Math.round(n*this.scale)+"px",s.setAttribute("width",Math.round(this.scale*i.width)),s.setAttribute("height",Math.round(this.scale*i.height)),s.src=i.src,t.insertBefore(s,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=void 0!==mxPrintPreview?mxPrintPreview:void 0,mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var n=e;if(null!=t&&t.length>0){var i=t.split(";");n=null!=n&&";"!=t.charAt(0)?mxUtils.clone(n):new Object;for(var s=0;s=0){var l=r.substring(0,o),a=r.substring(o+1);a==mxConstants.NONE?delete n[l]:mxUtils.isNumeric(a)?n[l]=parseFloat(a):n[l]=a}else{var h=this.styles[r];if(null!=h)for(var l in h)n[l]=h[l]}}}return n},__mxOutput.mxStylesheet=void 0!==mxStylesheet?mxStylesheet:void 0,mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var n=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=n.x,e.y=n.y,e.width=this.shape.stencil.w0*n.width,e.height=this.shape.stencil.h0*n.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e=0},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],n=0;n0&&null!=t[0]||null!=e&&e.length>0&&null!=e[0]){var n=new mxSelectionChange(this,t,e);n.execute();var i=new mxUndoableEdit(this,!1);i.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var n=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(n=mxUtils.replaceTrailingNewlines(n,"

")),n.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,(function(t){this.graph.stopEditing(!1),mxEvent.consume(t)}))),mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){this.blurEnabled&&this.focusLost(t)}))),mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))})));var e=mxUtils.bind(this,(function(e){null!=this.editingCell&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,t.innerHTML="")}));mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var n=mxUtils.bind(this,(function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)}));mxEvent.addListener(t,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",n),mxEvent.addListener(t,"cut",n),mxEvent.addListener(t,"paste",n);var i=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",s=mxUtils.bind(this,(function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null,this.resize()})),0))}));mxEvent.addListener(t,i,s),mxEvent.addListener(window,"resize",s),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",s),mxEvent.addListener(t,"DOMNodeInserted",s)):(mxEvent.addListener(t,"cut",s),mxEvent.addListener(t,"paste",s))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(i=null!=t.text&&null==this.align?t.text.margin:null)&&(i=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=s){var r=(parseFloat(s)+2)*n;this.bounds.width=r,this.bounds.x+=i.x*r}}else{var o=mxRectangle.fromRectangle(t),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&l==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,null!=s&&(o.width=parseFloat(s)*n),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*n,u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+h,d=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+h,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+h;l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);o=new mxRectangle(o.x+m,o.y+u,o.width-(l==mxConstants.ALIGN_CENTER&&null==s?m+d:0),o.height-(a==mxConstants.ALIGN_MIDDLE?u+p:0))}this.bounds=new mxRectangle(o.x+t.absoluteOffset.x,o.y+t.absoluteOffset.y,o.width,o.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";r=Math.round(this.bounds.width/(document.documentMode,n))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=r+"px",this.textarea.scrollWidth>r&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=r+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var c=this.textarea.scrollWidth,g=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5))/n))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-i.y*(this.bounds.height-(g+.5)*n)+g*(n-1)*0+1*Math.abs(i.y+.5))/n))+"px",this.textarea.style.width=Math.round(c*n)+"px",this.textarea.style.height=Math.round(g*n)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-i.y*(this.bounds.height-(g+.5)*n)+g*(n-1)*0+1*Math.abs(i.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-i.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-i.y*(this.bounds.height-4)+(-1==i.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/n)+"px",this.textarea.style.height=Math.round(this.bounds.height/n)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/n)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=n:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")"+(null==i?"":" translate("+100*i.x+"%,"+100*i.y+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(null!=e){var n=mxUtils.getCurrentStyle(e);null!=n&&(t="absolute"==n.position)}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,null==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var n=this.graph.getView().getState(t);if(null!=n){this.graph.getView().scale;var i=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),r=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(i*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(n),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(i)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=s,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=r;var u=this.textDirection=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);u==mxConstants.TEXT_DIRECTION_AUTO&&(null==n||null==n.text||n.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(n.text.value)||(u=n.text.getAutoDirection())),u==mxConstants.TEXT_DIRECTION_LTR||u==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",u):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(n,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,null!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(n.cell)||"fill"!=n.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),n=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=n||null!=this.align)){this.prepareTextarea();var i=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=i&&this.applyValue(e,i),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=this.getMinimumSize(t),s=i.width,r=i.height,o=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])o=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var l=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*n,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+l,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+l,u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+l,d=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+l;o=new mxRectangle(t.x,t.y,Math.max(s,t.width-d-h),Math.max(r,t.height-a-u));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,e?(o.x=t.absoluteOffset.x,o.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(t.text.boundingBox.x>0&&(o.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(o.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(o.x=Math.min(o.x,t.text.boundingBox.x),o.y=Math.min(o.y,t.text.boundingBox.y)),o.x+=d,o.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(o.width=Math.max(s,t.text.boundingBox.width),o.height=Math.max(r,t.text.boundingBox.height)):(o.width=Math.max(o.width,t.text.boundingBox.width),o.height=Math.max(o.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);c==mxConstants.ALIGN_LEFT?o.x-=t.width:c==mxConstants.ALIGN_RIGHT&&(o.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?o.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(o.y+=t.height)}}return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=void 0!==mxCellEditor?mxCellEditor:void 0,mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(null!=t.style){var n=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=n)e=new mxShape(n);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){null!=t.shape&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],n=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],i=0;i=0)return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,n){var i=n==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(null!=i){var s=t.view.graph,r=i[e],o=null;if("inherit"==r?o=s.model.getParent(t.cell):"swimlane"==r?(i[e]=n==mxConstants.STYLE_STROKECOLOR||n==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",o=null!=s.model.getTerminal(t.cell,!1)?s.model.getTerminal(t.cell,!1):t.cell,o=s.getSwimlane(o),n=s.swimlaneIndicatorColorAttribute):"indicated"==r&&null!=t.shape?i[e]=t.shape.indicatorColor:n!=mxConstants.STYLE_FILLCOLOR&&r==mxConstants.STYLE_FILLCOLOR&&null!=t.shape?i[e]=t.style[mxConstants.STYLE_FILLCOLOR]:n!=mxConstants.STYLE_STROKECOLOR&&r==mxConstants.STYLE_STROKECOLOR&&null!=t.shape&&(i[e]=t.style[mxConstants.STYLE_STROKECOLOR]),null!=o){var l=s.getView().getState(o);if(i[e]=null,null!=l){var a=n==mxConstants.STYLE_FONTCOLOR?l.text:l.shape;i[e]=null!=a&&"indicatorColor"!=e?a[e]:l.style[n]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var n=t.view.graph;if(n.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||null==t.style[mxConstants.STYLE_FONTSIZE]){var i=n.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,n.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],n.isWrapping(t.cell)&&n.isHtmlLabel(t.cell),n.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=i?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var s=!1,r=function(e){var i=t;if(mxClient.IS_TOUCH||s){var r=mxEvent.getClientX(e),o=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,o);i=n.view.getState(n.getCellAt(l.x,l.y))}return i};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),s=n.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e))),s=!1)}))),n.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.dblClick(e,t.cell),mxEvent.consume(e))})))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),n=null;if(null!=e){n=new mxDictionary;for(var i=0;i0)?this.createLabel(t,i):null==t.text||null!=i&&0!=i.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=n.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=i||t.text.isWrapping!=s||t.text.overflow!=l||t.text.isClipping!=r||t.text.scale!=h||t.text.dialect!=o||null==t.text.bounds||!t.text.bounds.equals(a)){t.text.dialect=o,t.text.value=i,t.text.bounds=a,t.text.scale=h,t.text.wrap=s,t.text.clipped=r,t.text.overflow=l;var u=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=u}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function n(n,i,s){return"spacingTop"==i||"spacingRight"==i||"spacingBottom"==i||"spacingLeft"==i?parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[i]||s):e[n]!=(t.style[i]||s)}return n("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||n("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||n("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||n("color",mxConstants.STYLE_FONTCOLOR,"black")||n("align",mxConstants.STYLE_ALIGN,"")||n("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||n("spacing",mxConstants.STYLE_SPACING,2)||n("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||n("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||n("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||n("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||n("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||n("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||n("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||n("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||n("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,n=t.view.scale,i=e.getModel().isEdge(t.cell),s=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(i){var r=t.text.getSpacing();s.x+=r.x*n,s.y+=r.y*n;var o=e.getCellGeometry(t.cell);null!=o&&(s.width=Math.max(0,o.width*n),s.height=Math.max(0,o.height*n))}else{if(t.text.isPaintBoundsInverted()){var l=s.x;s.x=s.y,s.y=l}s.x+=t.x,s.y+=t.y,s.width=Math.max(1,t.width),s.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var a=(t.width-t.height)/2;s.x+=a,s.y-=a;l=s.width;s.width=s.height,s.height=l}if(null!=t.shape){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE&&(s=t.shape.getLabelBounds(s))}var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=d&&(s.width=parseFloat(d)*n),i||this.rotateLabelBounds(t,s),s},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var n=t.view.scale,i=t.text.getSpacing();e.x+=i.x*n,e.y+=i.y*n;var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(s==mxConstants.ALIGN_CENTER&&null==o?t.text.spacingLeft*n+t.text.spacingRight*n:0)),e.height=Math.max(0,e.height-(r==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*n+t.text.spacingBottom*n:0))}var l=t.text.getTextRotation();if(0!=l&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var u=l*(Math.PI/180),d=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(a,h));e.x=d.x,e.y=d.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),null!=t.overlays){var n=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),i=mxUtils.toRadians(n),s=Math.cos(i),r=Math.sin(i);t.overlays.visit((function(i,o){var l=o.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&null!=t.shape&&0!=n){var a=l.getCenterX(),h=l.getCenterY(),u=mxUtils.getRotatedPoint(new mxPoint(a,h),s,r,new mxPoint(t.getCenterX(),t.getCenterY()));a=u.x,h=u.y,l.x=Math.round(a-l.width/2),l.y=Math.round(h-l.height/2)}!e&&null!=o.bounds&&o.scale==t.view.scale&&o.bounds.equals(l)||(o.bounds=l,o.scale=t.view.scale,o.redraw())}))}},mxCellRenderer.prototype.redrawControl=function(t,e){var n=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=n){var i=this.getControlBounds(t,n.width,n.height),s=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),r=t.view.scale;!e&&t.control.scale==r&&t.control.bounds.equals(i)&&t.control.rotation==s||(t.control.rotation=s,t.control.bounds=i,t.control.scale=r,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,n){if(null!=t.control){var i=t.view.scale,s=t.getCenterX(),r=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(s=t.x+e*i,r=t.y+n*i,null!=t.shape)){var o=t.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var l=(t.width-t.height)/2;s+=l,r-=l}if(0!=o){var a=mxUtils.toRadians(o),h=Math.cos(a),u=Math.sin(a),d=mxUtils.getRotatedPoint(new mxPoint(s,r),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));s=d.x,r=d.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(s-e/2*i),Math.round(r-n/2*i),Math.round(e*i),Math.round(n*i))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,n){for(var i=this.getShapesForState(t),s=0;s0?i[0]:null)&&(y=a.transformControlPoint(t,y),mxUtils.contains(e,y.x,y.y)&&(y=null));var u=0,d=0,p=0,m=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH?(u=a.getRoutingCenterX(e),d=c):(p=a.getRoutingCenterY(e),m=c),null==y||y.xe.x+e.width?null!=y?(u=y.x,m=Math.max(Math.abs(p-y.y),m)):g==mxConstants.DIRECTION_NORTH?p=e.y-2*d:g==mxConstants.DIRECTION_SOUTH?p=e.y+e.height+2*d:u=g==mxConstants.DIRECTION_EAST?e.x-2*m:e.x+e.width+2*m:null!=y&&(u=a.getRoutingCenterX(e),d=Math.max(Math.abs(u-y.x),m),p=y.y,m=0),s.push(new mxPoint(u-d,p-m)),s.push(new mxPoint(u+d,p+m))}}else if(null!=i&&i.length>0)for(var x=0;x0?i[0]:null,o=!1,l=!1;if(null!=e&&null!=n)if(null!=r){var a=Math.min(e.x,n.x),h=Math.max(e.x+e.width,n.x+n.width),u=Math.min(e.y,n.y),d=Math.max(e.y+e.height,n.y+n.height);o=(r=t.view.transformControlPoint(t,r)).yd,l=r.xh}else{if(!(o=(a=Math.max(e.x,n.x))==(h=Math.min(e.x+e.width,n.x+n.width))))l=(u=Math.max(e.y,n.y))==(d=Math.min(e.y+e.height,n.y+n.height))}l||!o&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,n,i,s):mxEdgeStyle.TopToBottom(t,e,n,i,s)},SideToSide:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.x,n.x),d=Math.min(e.x+e.width,n.x+n.width),p=null!=o?o.x:Math.round(d+(u-d)/2),m=r.getRoutingCenterY(e),c=r.getRoutingCenterY(n);if(null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(m=o.y),o.y>=n.y&&o.y<=n.y+n.height&&(c=o.y)),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),mxUtils.contains(n,p,c)||mxUtils.contains(e,p,c)||s.push(new mxPoint(p,c)),1==s.length)if(null!=o)mxUtils.contains(n,p,o.y)||mxUtils.contains(e,p,o.y)||s.push(new mxPoint(p,o.y));else{var g=Math.max(e.y,n.y),x=Math.min(e.y+e.height,n.y+n.height);s.push(new mxPoint(p,g+(x-g)/2))}}},TopToBottom:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.y,n.y),d=Math.min(e.y+e.height,n.y+n.height),p=r.getRoutingCenterX(e);null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(p=o.x);var m=null!=o?o.y:Math.round(d+(u-d)/2);if(mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),p=null!=o&&o.x>=n.x&&o.x<=n.x+n.width?o.x:r.getRoutingCenterX(n),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),1==s.length)if(null!=o&&1==s.length)mxUtils.contains(n,o.x,m)||mxUtils.contains(e,o.x,m)||s.push(new mxPoint(o.x,m));else{var c=Math.max(e.x,n.x),g=Math.min(e.x+e.width,n.x+n.width);s.push(new mxPoint(c+(g-c)/2,m))}}},SegmentConnector:function(t,e,n,i,s){var r=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),o=mxEdgeStyle.scaleCellState(e,t.view.scale),l=mxEdgeStyle.scaleCellState(n,t.view.scale),a=s.length>0?s[0]:null,h=!0,u=null;function d(e){return e.x=Math.round(e.x*t.view.scale*10)/10,e.y=Math.round(e.y*t.view.scale*10)/10,(null==a||Math.abs(a.x-e.x)>=1||Math.abs(a.y-e.y)>=Math.max(1,t.view.scale))&&(s.push(e),a=e),a}var p=r[0];null==p&&null!=o?p=new mxPoint(t.view.getRoutingCenterX(o),t.view.getRoutingCenterY(o)):null!=p&&(p=p.clone());var m=r.length-1;if(null!=i&&i.length>0){for(var c=[],g=0;g=f.y&&S.y<=f.y+f.height,L=null!=f&&S.x>=f.x&&S.x<=f.x+f.width;if(C=T||null==v&&w,E=b||null==v&&L,0==g&&(C&&E||b&&T));else{if(null!=v&&!T&&!b&&(w||L)){h=!w;break}if(E||C){h=C,1==g&&(h=c.length%2==0?C:E);break}}f=l,null!=(v=r[m])&&(f=null),S=c[c.length-1],b&&T&&(c=c.slice(1))}h&&(null!=r[0]&&r[0].y!=u.y||null==r[0]&&null!=o&&(u.yo.y+o.height))?d(new mxPoint(p.x,u.y)):!h&&(null!=r[0]&&r[0].x!=u.x||null==r[0]&&null!=o&&(u.xo.x+o.width))&&d(new mxPoint(u.x,p.y)),h?p.y=u.y:p.x=u.x;for(g=0;gl.y+l.height))?d(new mxPoint(p.x,u.y)):!h&&(null!=r[m]&&r[m].x!=u.x||null==r[m]&&null!=l&&(u.xl.x+l.width))&&d(new mxPoint(u.x,p.y))),null==r[0]&&null!=o)for(;s.length>1&&null!=s[1]&&mxUtils.contains(o,s[1].x,s[1].y);)s.splice(1,1);if(null==r[m]&&null!=l)for(;s.length>1&&null!=s[s.length-1]&&mxUtils.contains(l,s[s.length-1].x,s[s.length-1].y);)s.splice(s.length-1,1);null!=y&&null!=s[s.length-1]&&Math.abs(y.x-s[s.length-1].x)<=1&&Math.abs(y.y-s[s.length-1].y)<=1&&(s.splice(s.length-1,1),null!=s[s.length-1]&&(Math.abs(s[s.length-1].x-y.x)<1&&(s[s.length-1].x=y.x),Math.abs(s[s.length-1].y-y.y)<1&&(s[s.length-1].y=y.y)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(t,e){var n=mxUtils.getValue(t.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));if("auto"==n)if(mxUtils.getValue(t.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){var i=mxUtils.getNumber(t.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);n=Math.max(2,Math.ceil((i+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else n=2*mxEdgeStyle.orthBuffer;return n},scalePointArray:function(t,e){var n=[];if(null!=t)for(var i=0;i0||o||l)mxEdgeStyle.SegmentConnector(t,e,n,i,s);else{var w,L=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],O=0;if(null!=h)if(L[0]=mxUtils.getPortConstraints(h,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(O=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0)))m=(w=mxUtils.getBoundingBox(new mxRectangle(m,c,g,x),O)).x,c=w.y,g=w.width,x=w.height;if(null!=u)if(L[1]=mxUtils.getPortConstraints(u,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(O=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0)))y=(w=mxUtils.getBoundingBox(new mxRectangle(y,f,v,C),O)).x,f=w.y,v=w.width,C=w.height;for(var I=[0,0],A=[[m,c,g,x],[y,f,v,C]],P=[E,S],_=0;_<2;_++)mxEdgeStyle.limits[_][1]=A[_][0]-P[_],mxEdgeStyle.limits[_][2]=A[_][1]-P[_],mxEdgeStyle.limits[_][4]=A[_][0]+A[_][2]+P[_],mxEdgeStyle.limits[_][8]=A[_][1]+A[_][3]+P[_];var R,M=A[0][0]+A[0][2]/2,N=A[0][1]+A[0][3]/2,H=A[1][0]+A[1][2]/2,D=N-(A[1][1]+A[1][3]/2),G=0;(R=M-H)<0?G=D<0?2:1:D<=0&&(G=3,0==R&&(G=2));var U=null;null!=h&&(U=d);var V=[[.5,.5],[.5,.5]];for(_=0;_<2;_++)null!=U&&(V[_][0]=(U.x-A[_][0])/A[_][2],Math.abs(U.x-A[_][0])<=1?I[_]=mxConstants.DIRECTION_MASK_WEST:Math.abs(U.x-A[_][0]-A[_][2])<=1&&(I[_]=mxConstants.DIRECTION_MASK_EAST),V[_][1]=(U.y-A[_][1])/A[_][3],Math.abs(U.y-A[_][1])<=1?I[_]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(U.y-A[_][1]-A[_][3])<=1&&(I[_]=mxConstants.DIRECTION_MASK_SOUTH)),U=null,null!=u&&(U=p);var B=A[0][1]-(A[1][1]+A[1][3]),F=A[0][0]-(A[1][0]+A[1][2]),k=A[1][1]-(A[0][1]+A[0][3]),Y=A[1][0]-(A[0][0]+A[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(F-b,0),mxEdgeStyle.vertexSeperations[2]=Math.max(B-b,0),mxEdgeStyle.vertexSeperations[4]=Math.max(k-b,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Y-b,0);var j=[],z=[],W=[];z[0]=F>=Y?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,W[0]=B>=k?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,z[1]=mxUtils.reversePortConstraints(z[0]),W[1]=mxUtils.reversePortConstraints(W[0]);var K=F>=Y?F:Y,X=B>=k?B:k,Z=[[0,0],[0,0]],q=!1;for(_=0;_<2;_++)0==I[_]&&(0==(z[_]&L[_])&&(z[_]=mxUtils.reversePortConstraints(z[_])),0==(W[_]&L[_])&&(W[_]=mxUtils.reversePortConstraints(W[_])),Z[_][0]=W[_],Z[_][1]=z[_]);X>0&&K>0&&((z[0]&L[0])>0&&(W[1]&L[1])>0?(Z[0][0]=z[0],Z[0][1]=W[0],Z[1][0]=W[1],Z[1][1]=z[1],q=!0):(W[0]&L[0])>0&&(z[1]&L[1])>0&&(Z[0][0]=W[0],Z[0][1]=z[0],Z[1][0]=z[1],Z[1][1]=W[1],q=!0)),X>0&&!q&&(Z[0][0]=W[0],Z[0][1]=z[0],Z[1][0]=W[1],Z[1][1]=z[1],q=!0),K>0&&!q&&(Z[0][0]=z[0],Z[0][1]=W[0],Z[1][0]=z[1],Z[1][1]=W[1],q=!0);for(_=0;_<2;_++)0==I[_]&&(0==(Z[_][0]&L[_])&&(Z[_][0]=Z[_][1]),j[_]=Z[_][0]&L[_],j[_]|=(Z[_][1]&L[_])<<8,j[_]|=(Z[1-_][_]&L[_])<<16,j[_]|=(Z[1-_][1-_]&L[_])<<24,0==(15&j[_])&&(j[_]=j[_]<<8),0==(3840&j[_])&&(j[_]=15&j[_]|j[_]>>8),0==(983040&j[_])&&(j[_]=65535&j[_]|(251658240&j[_])>>8),I[_]=15&j[_],L[_]!=mxConstants.DIRECTION_MASK_WEST&&L[_]!=mxConstants.DIRECTION_MASK_NORTH&&L[_]!=mxConstants.DIRECTION_MASK_EAST&&L[_]!=mxConstants.DIRECTION_MASK_SOUTH||(I[_]=L[_]));var $=I[0]==mxConstants.DIRECTION_MASK_EAST?3:I[0],Q=I[1]==mxConstants.DIRECTION_MASK_EAST?3:I[1];($-=G)<1&&($+=4),(Q-=G)<1&&(Q+=4);var J=mxEdgeStyle.routePatterns[$-1][Q-1];switch(mxEdgeStyle.wayPoints1[0][0]=A[0][0],mxEdgeStyle.wayPoints1[0][1]=A[0][1],I[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=E,mxEdgeStyle.wayPoints1[0][1]+=V[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=V[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]+=A[0][3]+E;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=A[0][2]+E,mxEdgeStyle.wayPoints1[0][1]+=V[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=V[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]-=E}var tt=0,et=(I[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,nt=et,it=0;for(_=0;_4&&(rt-=4);var ot=mxEdgeStyle.dirVectors[rt-1];(it=rt%2>0?0:1)!=et&&(tt++,mxEdgeStyle.wayPoints1[tt][0]=mxEdgeStyle.wayPoints1[tt-1][0],mxEdgeStyle.wayPoints1[tt][1]=mxEdgeStyle.wayPoints1[tt-1][1]);var lt=(J[_]&mxEdgeStyle.TARGET_MASK)>0,at=(J[_]&mxEdgeStyle.SOURCE_MASK)>0,ht=(J[_]&mxEdgeStyle.SIDE_MASK)>>5;(ht<<=G)>15&&(ht>>=4);var ut=(J[_]&mxEdgeStyle.CENTER_MASK)>0;if((at||lt)&&ht<9){var dt=0,pt=at?0:1;if(dt=ut&&0==it?A[pt][0]+V[pt][0]*A[pt][2]:ut?A[pt][1]+V[pt][1]*A[pt][3]:mxEdgeStyle.limits[pt][ht],0==it){var mt=(dt-mxEdgeStyle.wayPoints1[tt][0])*ot[0];mt>0&&(mxEdgeStyle.wayPoints1[tt][0]+=ot[0]*mt)}else{var ct=(dt-mxEdgeStyle.wayPoints1[tt][1])*ot[1];ct>0&&(mxEdgeStyle.wayPoints1[tt][1]+=ot[1]*ct)}}else ut&&(mxEdgeStyle.wayPoints1[tt][0]+=ot[0]*Math.abs(mxEdgeStyle.vertexSeperations[rt]/2),mxEdgeStyle.wayPoints1[tt][1]+=ot[1]*Math.abs(mxEdgeStyle.vertexSeperations[rt]/2));tt>0&&mxEdgeStyle.wayPoints1[tt][it]==mxEdgeStyle.wayPoints1[tt-1][it]?tt--:et=it}for(_=0;_<=tt;_++){if(_==tt)if((((I[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1)==nt?0:1)!=(tt+1)%2)break;s.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[_][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[_][1]*t.view.scale*10)/10))}for(var gt=1;gt0)for(var n=this.graph.getModel(),i=0;i0||o.height>0){s=new mxPoint(e.x,e.y);var l=!1,a=!1;this.graph.model.isVertex(t.cell)&&(l=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(l=1==mxUtils.getValue(t.style,"stencilFlipH",0)||l,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y)),null!=(s=r(o,t,s,n))&&(l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y))}}null==s&&(s=this.getPoint(t))}return s},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,n){var i=t.absolutePoints,s=null;if(null!=i&&i.length>=2){var r=i.length;s=i[n?Math.min(1,r-1):Math.max(0,r-2)]}return null==s&&null!=e&&(s=new mxPoint(e.getCenterX(),e.getCenterY())),s},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var n=this.graph.getModel(),i=n.getTerminal(t,e),s=i;null!=i&&i!=this.currentRoot;)this.graph.isCellVisible(s)&&!this.isCellCollapsed(i)||(s=i),i=n.getParent(i);return null==s||n.contains(s)&&n.getParent(s)!=n.getRoot()&&s!=this.currentRoot||(s=null),s},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,n=e[0],i=e[e.length-1];if(n.x!=i.x||n.y!=i.y){var s=i.x-n.x,r=i.y-n.y;t.terminalDistance=Math.sqrt(s*s+r*r)}else t.terminalDistance=0;var o=0,l=[],a=n;if(null!=a){for(var h=a.x,u=a.y,d=h,p=u,m=1;m=Math.round(a+l)&&h1){for(var r=t.length,o=t.segments,l=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n),u=0,d=0,p=0,m=2;mg&&(L=g);var O=Math.sqrt(mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n));return-1==mxUtils.relativeCcw(l.x,l.y,a.x,a.y,e,n)&&(O=-O),new mxPoint((r/2-p-L)/r*-2,O/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&e.length>0&&null!=t.segments){var n=this.graph.getCellGeometry(t.cell);if(n.relative){var i=this.getPoint(t,n);null!=i&&(t.absoluteOffset=i)}else{var s=e[0],r=e[e.length-1];if(null!=s&&null!=r){var o=r.x-s.x,l=r.y-s.y,a=0,h=0,u=n.offset;null!=u&&(a=u.x,h=u.y);var d=s.x+o/2+a*this.scale,p=s.y+l/2+h*this.scale;t.absoluteOffset.x=d,t.absoluteOffset.y=p}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var n=null;return null!=t&&(n=this.states.get(t),e&&(null==n||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==n?(n=this.createState(t),this.states.put(t,n)):n.style=this.graph.getCellStyle(t))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(null==t)return this.states;for(var e=[],n=0;ns&&n.x>s+2&&n.x<=i)return!0;var r=this.graph.container.offsetHeight,o=this.graph.container.clientHeight;return r>o&&n.y>o+2&&n.y<=r},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(null!=e){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))));var n=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(e)||(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e)),n=e.pointerId)})),mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||null!=n&&e.pointerId!=n||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e)),n=null}))),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.dblClick(e)})));t.addMouseListener({mouseDown:function(e,n){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,(function(n){null!=t.tooltipHandler&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(n)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&!mxEvent.isConsumed(n)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(n,function(n){var i=null;if(mxClient.IS_TOUCH){var s=mxEvent.getClientX(n),r=mxEvent.getClientY(n),o=mxUtils.convertPoint(e,s,r);i=t.view.getState(t.getCellAt(o.x,o.y))}return i}(n)))})),this.endHandler=mxUtils.bind(this,(function(e){this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(e)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(null!=t&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds(),n=e.x+e.width+this.graph.border,i=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(n,i)}));mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var n=this.graph.container.offsetWidth,i=this.graph.container.offsetHeight;this.canvas.style.width=n")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var n=new mxDictionary,i=[],s=mxUtils.bind(this,(function(t){if(!n.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))n.put(t,!0),i.push(t);else for(var e=this.model.getChildCount(t),r=0;r=0){t.overlays.splice(n,1),0==t.overlays.length&&(t.overlays=null);var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(null!=e){t.overlays=null;var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n);for(var i=0;i0){var s=new mxCellOverlay(n=null!=n?n:this.warningImage,""+e+"");return i&&s.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,n){this.isEnabled()&&this.setSelectionCell(t)}))),this.addCellOverlay(t,s)}return this.removeCellOverlays(t),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,n){this.model.beginUpdate();try{var i=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",i,"event",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,n){this.model.beginUpdate();try{this.model.setValue(t,e),n&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),n=t.getCell(),i=new mxEventObject(mxEvent.CLICK,"event",e,"cell",n);if(t.isConsumed()&&i.consume(),this.fireEvent(i),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()){if(null!=n){if(this.isTransparentClickEvent(e)){var s=!1,r=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);return!(s=s||e)||e||t.cell!=n&&this.model.isAncestor(t.cell,n)})));null!=r&&(n=r)}}else if(this.isSwimlaneSelectionEnabled()&&!(null==(n=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()))||this.isToggleEvent(e)&&mxEvent.isAltDown(e))){for(var o=n,l=[];null!=o;){o=this.model.getParent(o);var a=this.view.getState(o);this.isSwimlane(o)&&null!=a&&l.push(o)}if(l.length>0){(l=l.reverse()).splice(0,0,n),l.push(n);for(var h=0;h=s.scrollLeft&&e>=s.scrollTop&&t<=s.scrollLeft+s.clientWidth&&e<=s.scrollTop+s.clientHeight){var r=s.scrollLeft+s.clientWidth-t;if(r0&&u.height>0){e&&null!=u.x&&null!=u.y&&((u=u.clone()).width+=u.x,u.height+=u.y,u.x=0,u.y=0);var d=this.view.scale,p=u.width/d,m=u.height/d;null!=this.backgroundImage&&(p=Math.max(p,this.backgroundImage.width-u.x/d),m=Math.max(m,this.backgroundImage.height-u.y/d));var c=(e?t:2*t)+n+1;a-=c,h-=c;var g=s?h/m:r?a/p:Math.min(a/p,h/m);if(null!=this.minFitScale&&(g=Math.max(g,this.minFitScale)),null!=this.maxFitScale&&(g=Math.min(g,this.maxFitScale)),!i)return g;if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var x=this.getGraphBounds();null!=x.x&&(this.container.scrollLeft=x.x),null!=x.y&&(this.container.scrollTop=x.y)}else{var y=null!=u.x?Math.floor(this.view.translate.x-u.x/d+t/g+n/2):t,f=null!=u.y?Math.floor(this.view.translate.y-u.y/d+t/g+n/2):t;this.view.scaleAndTranslate(g,y,f)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(null!=this.container){var e=this.getBorder(),n=Math.max(0,t.x)+t.width+2*e,i=Math.max(0,t.y)+t.height+2*e;if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),i=Math.max(i,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,i),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var s=this.getPreferredPageSize(t,Math.max(1,n),Math.max(1,i));null!=s&&(n=s.width*this.view.scale,i=s.height*this.view.scale)}if(null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),i=Math.max(i,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n),i=Math.ceil(i),this.dialect==mxConstants.DIALECT_SVG){var r=this.view.getDrawPane().ownerSVGElement;null!=r&&(r.style.minWidth=Math.max(1,n)+"px",r.style.minHeight=Math.max(1,i)+"px",r.style.width="100%",r.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,i)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,i)+"px");this.updatePageBreaks(this.pageBreaksVisible,n,i)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.view.scale,s=this.view.translate,r=this.pageFormat,o=i*this.pageScale,l=new mxRectangle(0,0,r.width*o,r.height*o),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),l.x=Math.floor((a.x-s.x*i)/l.width)*l.width+s.x*i,l.y=Math.floor((a.y-s.y*i)/l.height)*l.height+s.y*i,a.width=Math.ceil((a.width+(a.x-l.x))/l.width)*l.width,a.height=Math.ceil((a.height+(a.y-l.y))/l.height)*l.height;var h=(t=t&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(a.height/l.height)+1:0,u=t?Math.ceil(a.width/l.width)+1:0,d=(u-1)*l.width,p=(h-1)*l.height;null==this.horizontalPageBreaks&&h>0&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&u>0&&(this.verticalPageBreaks=[]);var m=mxUtils.bind(this,(function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:u,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+n*l.height)),new mxPoint(Math.round(l.x+d),Math.round(l.y+n*l.height))]:[new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y)),new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y+p))];if(null!=t[n])t[n].points=i,t[n].redraw();else{var s=new mxPolyline(i,this.pageBreakColor);s.dialect=this.dialect,s.pointerEvents=!1,s.isDashed=this.pageBreakDashed,s.init(this.view.backgroundPane),s.redraw(),t[n]=s}}for(n=e;n0&&";base64,"!=n.substring(i-7,i+1)&&(n=n.substring(0,i)+";base64,"+n.substring(i+1))}t[mxConstants.STYLE_IMAGE]=n}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n0){var s=this.getCurrentCellStyle(n[0]);i=mxUtils.getValue(s,t,e)?0:1,this.setCellStyles(t,i,n)}return i},mxGraph.prototype.setCellStyles=function(t,e,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,n){this.setCellStyleFlags(t,e,null,n)},mxGraph.prototype.setCellStyleFlags=function(t,e,n,i){if(null!=(i=i||this.getSelectionCells())&&i.length>0){if(null==n){var s=this.getCurrentCellStyle(i[0]);n=!((parseInt(s[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,i,t,e,n)}},mxGraph.prototype.alignCells=function(t,e,n){if(null==e&&(e=this.getSelectionCells()),null!=e&&e.length>1){if(null==n)for(var i=0;i1&&null!=i){var s=this.model.getParent(t);null==s&&(s=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var r=this.model.getChildCount(s);this.cellsAdded([t],s,r,null,null,!1,!1,!1),r=this.model.getChildCount(t),this.cellsAdded(n,t,r,null,null,!1,!1,!1),this.cellsMoved(n,-i.x,-i.y,!1,!1,!1),this.cellsResized([t],[i],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",n))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&t.length>0){var n=this.model.getParent(t[0]);e.push(t[0]);for(var i=1;i0){this.model.beginUpdate();try{for(var n=0;n0){i=i.slice();var s=this.model.getParent(t[n]),r=this.model.getChildCount(s);this.cellsAdded(i,s,r,null,null,!0),e=e.concat(i);for(var o=0;o0&&e.push(t[n]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),n=this.model.getChildCount(e);this.cellsAdded(t,e,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,n,i,s,r,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,n=null!=n&&n,i=null!=i?i:0,s=null!=s?s:0,r=null!=r?r:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var l=t.length-1;l>=0;l--){var a=this.getCellGeometry(t[l]);if(null!=a){var h=this.getChildCells(t[l]);if(null!=h&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,!0);if(null!=u&&u.width>0&&u.height>0){var d=this.isSwimlane(t[l])?this.getActualStartSize(t[l],!0):new mxRectangle;a=a.clone(),n&&(a.x=Math.round(a.x+u.x-e-d.x-o),a.y=Math.round(a.y+u.y-e-d.y-i)),a.width=Math.round(u.width+2*e+d.x+o+s+d.width),a.height=Math.round(u.height+2*e+d.y+i+r+d.height),this.model.setGeometry(t[l],a),this.moveCells(h,e+d.x-u.x+o,e+d.y-u.y+i)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&t.length>0)for(var n=0;n0){var a=this.view.scale,h=this.view.translate;s=this.model.cloneCells(t,!0,n);for(l=0;lthis.model.getChildCount(e)&&n--,this.model.add(e,t[d],n+d),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[d],!0),(null==l||l)&&this.isExtendParentsOnAdd(t[d])&&this.isExtendParent(t[d])&&this.extendParent(t[d]),(null==o||o)&&this.constrainChild(t[d]),null!=i&&this.cellConnected(t[d],i,!0),null!=s&&this.cellConnected(t[d],s,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",n,"source",i,"target",s,"absolute",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var n=this.model.getChildCount(t),i=0;i0){var e=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var i=new mxDictionary,s=0;s0){this.model.beginUpdate();try{for(var n=0;n0){this.model.beginUpdate();try{for(var s=0;s0&&(s.height=Math.max(s.height,o))}}e.alternateBounds=new mxRectangle(0,0,s.width,s.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var l=mxUtils.toRadians(i[mxConstants.STYLE_ROTATION]||0);if(0!=l){var a=e.alternateBounds.getCenterX()-e.getCenterX(),h=e.alternateBounds.getCenterY()-e.getCenterY(),u=Math.cos(l),d=Math.sin(l),p=u*a-d*h,m=d*a+u*h;e.alternateBounds.x+=p-a,e.alternateBounds.y+=m-h}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(null!=t)for(var n=0;n0){this.isHtmlLabel(i.cell)||(h=mxUtils.htmlEntities(h,!1)),h=h.replace(/\n/g,"
");var u=mxUtils.getSizeForString(h,r,s[mxConstants.STYLE_FONTFAMILY],e,s[mxConstants.STYLE_FONTSTYLE]),d=u.width+o,p=u.height+l;if(!mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,!0)){var m=p;p=d,d=m}this.gridEnabled&&(d=this.snap(d+this.gridSize/2),p=this.snap(p+this.gridSize/2)),n=new mxRectangle(0,0,d,p)}else{var c=4*this.gridSize;n=new mxRectangle(0,0,c,c)}}}return n},mxGraph.prototype.resizeCell=function(t,e,n){return this.resizeCells([t],[e],n)[0]},mxGraph.prototype.resizeCells=function(t,e,n){n=null!=n?n:this.isRecursiveResize(),this.model.beginUpdate();try{var i=this.cellsResized(t,e,n);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,n){n=null!=n&&n;var i=[];if(null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var s=0;s0&&((o=mxRectangle.fromRectangle(o)).x-=o.width*l,o.y-=o.height*l,o.width+=2*o.width*l,o.height+=2*o.height*l),null==s?s=o:(s=mxRectangle.fromRectangle(s)).intersect(o)}}if(null!=s){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),u=0;us.width&&(p=n.width-s.width,n.width-=p),d.x+d.width>s.x+s.width&&(p-=d.x+d.width-s.x-s.width-p);var m=0;n.height>s.height&&(m=n.height-s.height,n.height-=m),d.y+d.height>s.y+s.height&&(m-=d.y+d.height-s.y-s.height-m),d.x0&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,n){if(null!=e.shape){var i=this.view.getPerimeterBounds(e),s=e.style[mxConstants.STYLE_DIRECTION];if(s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){i.x+=i.width/2-i.height/2,i.y+=i.height/2-i.width/2;var r=i.width;i.width=i.height,i.height=r}var o=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=o){var l=Math.cos(-o),a=Math.sin(-o),h=new mxPoint(i.getCenterX(),i.getCenterY());t=mxUtils.getRotatedPoint(t,l,a,h)}var u=1,d=1,p=0,m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(c=1==mxUtils.getValue(e.style,"stencilFlipH",0)||c,g=1==mxUtils.getValue(e.style,"stencilFlipV",0)||g),s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){r=c;c=g,g=r}c&&(u=-1,p=-i.width),g&&(d=-1,m=-i.height)}return t=new mxPoint((t.x-i.x)*u-p+i.x,(t.y-i.y)*d-m+i.y),new mxConnectionConstraint(new mxPoint(0==i.width?0:Math.round(1e3*(t.x-i.x)/i.width)/1e3,0==i.height?0:Math.round(1e3*(t.y-i.y)/i.height)/1e3),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,n){var i=null,s=t.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=s){var r=t.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=r&&(i=new mxPoint(parseFloat(s),parseFloat(r)))}var o=!1,l=0,a=0;return null!=i&&(o=mxUtils.getValue(t.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),a=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,a=isFinite(a)?a:0),new mxConnectionConstraint(i,o,null,l,a)},mxGraph.prototype.setConnectionConstraint=function(t,e,n,i){if(null!=i){this.model.beginUpdate();try{null==i||null==i.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=i.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,i.point.x,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,i.point.y,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,i.dx,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,i.dy,[t]),i.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,n){n=null==n||n;var i=null;if(null!=t&&null!=e.point){var s=this.view.getPerimeterBounds(t),r=new mxPoint(s.getCenterX(),s.getCenterY()),o=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=o&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(o==mxConstants.DIRECTION_NORTH?l+=270:o==mxConstants.DIRECTION_WEST?l+=180:o==mxConstants.DIRECTION_SOUTH&&(l+=90),o!=mxConstants.DIRECTION_NORTH&&o!=mxConstants.DIRECTION_SOUTH||s.rotate90());var a=this.view.scale;i=new mxPoint(s.x+e.point.x*s.width+e.dx*a,s.y+e.point.y*s.height+e.dy*a);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var u=0,d=0;90==l?d=1:180==l?u=-1:270==l&&(d=-1),i=mxUtils.getRotatedPoint(i,u,d,r)}i=this.view.getPerimeterPoint(t,i,!1)}else if(h+=l,this.getModel().isVertex(t.cell)){var p=1==t.style[mxConstants.STYLE_FLIPH],m=1==t.style[mxConstants.STYLE_FLIPV];if(null!=t.shape&&null!=t.shape.stencil&&(p=1==mxUtils.getValue(t.style,"stencilFlipH",0)||p,m=1==mxUtils.getValue(t.style,"stencilFlipV",0)||m),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){var c=p;p=m,m=c}p&&(i.x=2*s.getCenterX()-i.x),m&&(i.y=2*s.getCenterY()-i.y)}if(0!=h&&null!=i){var g=mxUtils.toRadians(h);u=Math.cos(g),d=Math.sin(g);i=mxUtils.getRotatedPoint(i,u,d,r)}}return n&&null!=i&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),i},mxGraph.prototype.connectCell=function(t,e,n,i){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);this.cellConnected(t,e,n,i),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,n,i){if(null!=t){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);if(this.setConnectionConstraint(t,e,n,i),this.isPortsEnabled()){var r=null;this.isPort(e)&&(r=e.getId(),e=this.getTerminalForPort(e,n));var o=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(o,r,[t])}this.model.setTerminal(t,e,n),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,n=this.view.translate,i=new mxDictionary,s=0;s0)for(var a=new mxRectangle(l[0].x,l[0].y,0,0),h=1;h=0&&(r.x+=a.x,r.y+=a.y))}else if(r=mxRectangle.fromRectangle(s),this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(r.x+=a.x,r.y+=a.y);null!=r&&null!=s.offset&&(r.x+=s.offset.x,r.y+=s.offset.y);var d=this.getCurrentCellStyle(t[i]);if(null!=r){var p=mxUtils.getValue(d,mxConstants.STYLE_ROTATION,0);0!=p&&(r=mxUtils.getBoundingBox(r,p))}}null!=r&&(null==n?n=mxRectangle.fromRectangle(r):n.add(r))}}return n},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,n,i,s){var r=this.view.translate,o=this.view.scale;if(!n&&this.gridEnabled){var l=this.gridSize*o*.5;if(!i){var a=e.x-(this.snap(e.x/o-r.x)+r.x)*o;Math.abs(t.x-a)o&&(d=0),c>l&&(p=0),this.view.setTranslate(Math.floor(d/2-a.x),Math.floor(p/2-a.y)),this.container.scrollLeft=(m-o)/2,this.container.scrollTop=(c-l)/2}else this.view.setTranslate(t?Math.floor(h.x-a.x*u+d*n/u):h.x,e?Math.floor(h.y-a.y*u+p*i/u):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var n=Math.round(this.view.scale*t*100)/100,i=this.view.getState(this.getSelectionCell());if(t=n/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=i){var s=new mxRectangle(i.x*t,i.y*t,i.width*t,i.height*t);this.view.scale=n,this.scrollRectToVisible(s)||(this.view.revalidate(),this.view.setScale(n))}else{var r=mxUtils.hasScrollbars(this.container);if(e&&!r){var o,l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1)l*=-(o=(t-1)/(2*n)),a*=-o;else l*=o=(1/t-1)/(2*this.view.scale),a*=o;this.view.scaleAndTranslate(n,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x,u=this.view.translate.y,d=this.container.scrollLeft,p=this.container.scrollTop;if(this.view.setScale(n),r){l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-h)*this.view.scale+Math.round(d*t+l),this.container.scrollTop=(this.view.translate.y-u)*this.view.scale+Math.round(p*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var n=Math.min(this.container.scrollWidth,t.x+t.width),i=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=n-t.x,t.height=i-t.y,e<1){var s=t.height/e,r=(s-t.height)/2;t.height=s;var o=Math.min(t.y,r);t.y=t.y-o,i=Math.min(this.container.scrollHeight,t.y+t.height),t.height=i-t.y}else{var l=t.width*e,a=(l-t.width)/2;t.width=l;var h=Math.min(t.x,a);t.x=t.x-h,n=Math.min(this.container.scrollWidth,t.x+t.width),t.width=n-t.x}var u=this.container.clientWidth/t.width,d=this.view.scale*u;mxUtils.hasScrollbars(this.container)?(this.view.setScale(d),this.container.scrollLeft=Math.round(t.x*u),this.container.scrollTop=Math.round(t.y*u)):this.view.scaleAndTranslate(d,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var n=-this.view.translate.x,i=-this.view.translate.y,s=this.view.getState(t);if(null!=s){var r=new mxRectangle(n+s.x,i+s.y,s.width,s.height);if(e&&null!=this.container){var o=this.container.clientWidth,l=this.container.clientHeight;r.x=r.getCenterX()-o/2,r.width=o,r.y=r.getCenterY()-l/2,r.height=l}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(r)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var n=this.container.offsetWidth,i=this.container.offsetHeight,s=Math.min(n,t.width),r=Math.min(i,t.height);if(mxUtils.hasScrollbars(this.container)){var o=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var l=o.scrollLeft-t.x,a=Math.max(l-o.scrollLeft,0);l>0?o.scrollLeft-=l+2:(l=t.x+s-o.scrollLeft-o.clientWidth)>0&&(o.scrollLeft+=l+2);var h=o.scrollTop-t.y,u=Math.max(0,h-o.scrollTop);h>0?o.scrollTop-=h+2:(h=t.y+r-o.scrollTop-o.clientHeight)>0&&(o.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==u||this.view.setTranslate(a,u)}else{var d=-this.view.translate.x,p=-this.view.translate.y,m=this.view.scale;t.x+s>d+n&&(this.view.translate.x-=(t.x+s-n-d)/m,e=!0),t.y+r>p+i&&(this.view.translate.y-=(t.y+r-i-p)/m,e=!0),t.x1||1==s.length&&s[0]!=t)&&(i+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var r=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(n,!1,t);if(null!=this.multiplicities)for(var l=0;l0?i:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,n){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var n=!0,i=this.model.getChildCount(t),s=0;s")):this.setCellWarning(r,null),n=n&&null==l}var a="";this.isCellCollapsed(t)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),a.length>0||!n?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),n=this.model.getDirectedEdgeCount(t,!1),i=this.model.getValue(t),s="";if(null!=this.multiplicities)for(var r=0;ro.max||eo.max||n0?s:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(null!=t&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var n=this.getCurrentCellStyle(t);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){return"wrap"==this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){return"hidden"==this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,e,n,i){var s=null;if(null!=t){if(null==t.control||e!=t.control.node&&e.parentNode!=t.control.node||(s=this.collapseExpandResource,s=mxUtils.htmlEntities(mxResources.get(s)||s).replace(/\\n/g,"
")),null==s&&null!=t.overlays&&t.overlays.visit((function(t,n){null!=s||e!=n.node&&e.parentNode!=n.node||(s=n.overlay.toString())})),null==s){var r=this.selectionCellsHandler.getHandler(t.cell);null!=r&&"function"==typeof r.getTooltipForNode&&(s=r.getTooltipForNode(e))}null==s&&(s=this.getTooltipForCell(t.cell))}return s},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t,e){var n=new mxRectangle,i=this.getCurrentCellStyle(t,e),s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)?n.height=s:n.width=s,n},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0),i=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0),s=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0)?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var r=mxUtils.mod(s,2);return n&&1==r&&(s+=2),i&&0==r&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var n=new mxRectangle;if(this.isSwimlane(t,e)){var i=this.getCurrentCellStyle(t,e),s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),r=this.getSwimlaneDirection(i);r==mxConstants.DIRECTION_NORTH?n.y=s:r==mxConstants.DIRECTION_WEST?n.x=s:r==mxConstants.DIRECTION_SOUTH?n.height=s:n.width=s}return n},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(null!=t){var n=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),i=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=n==mxConstants.NONE&&i==mxConstants.NONE&&null==this.getImage(t)}return e},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t,e){return null!=t&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)&&this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||null!=e&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellCloneable(t)})))},mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canExportCell(t)})))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canImportCell(t)})))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellDeletable(t)})))},mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){return 0!=this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATABLE]},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellMovable(t)})))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,n){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return null==t&&this.allowDanglingEdges||null!=t&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(null!=this.cellEditor){var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellFoldable(t,e)})))},mxGraph.prototype.isCellFoldable=function(t,e){var n=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,n){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,n)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,n){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var i=this.model.getTerminal(t,!0),s=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],i)&&!this.model.isAncestor(e[0],s)}return!1},mxGraph.prototype.getDropTarget=function(t,e,n,i){if(!this.isSwimlaneNesting())for(var s=0;s=0;o--){var l=this.model.getChildAt(n,o),a=this.getCellAt(t,e,l,i,s,r);if(null!=a)return a;if(this.isCellVisible(l)&&(s&&this.model.isEdge(l)||i&&this.model.isVertex(l))){var h=this.view.getState(l);if(null!=h&&(null==r||!r(h,t,e))&&this.intersects(h,t,e))return l}}return null},mxGraph.prototype.intersects=function(t,e,n){if(null!=t){var i=t.absolutePoints;if(null!=i)for(var s=this.tolerance*this.tolerance,r=i[0],o=1;o0&&e>0&&e>s.width*r)return!0;if(s.height>0&&n>0&&n>s.height*r)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,n){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,n=null!=n&&n;for(var i=this.model.getChildCells(t,e,n),s=[],r=0;r0||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++;r0)||getErrorObject("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):getErrorObject("InvalidXml","Start tag expected.",1)};const doubleQuote='"',singleQuote="'";function readAttributeStr(t,e){let n="",i="",s=!1;for(;e"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const validAttrStrRegxp=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function validateAttributeString(t,e){const n=util$2.getAllMatches(t,validAttrStrRegxp),i={};for(let t=0;t!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}},buildOptions$1=function(t){return Object.assign({},defaultOptions$1,t)};OptionsBuilder.buildOptions=buildOptions$1,OptionsBuilder.defaultOptions=defaultOptions$1;class XmlNode{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var xmlNode$1=XmlNode;const util$1=util$3;function readDocType$1(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&isEntity(t,e))e+=7,[entityName,val,e]=readEntityExp(t,e+1),-1===val.indexOf("&")&&(n[validateEntityName(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(s&&isElement(t,e))e+=8;else if(s&&isAttlist(t,e))e+=8;else if(s&&isNotation(t,e))e+=9;else{if(!isComment)throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}function readEntityExp(t,e){let n="";for(;e0&&s&&"."!==n[2])return t;if(!e.leadingZeros&&r.length>0&&!s&&"."!==n[1])return t;{const i=Number(n),a=""+i;return-1!==a.search(/[eE]/)||l?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===a&&""===o||a===o||s&&a==="-"+o?i:t:r?o===a||s+o===a?i:t:n===a||n===s+a?i:t}}return t}}function trimZeros(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}var strnum=toNumber$1;const util=util$3,xmlNode=xmlNode$1,readDocType=DocTypeReader,toNumber=strnum;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,util.nameRegexp);let OrderedObjParser$1=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=addExternalEntities,this.parseXml=parseXml,this.parseTextData=parseTextData,this.resolveNameSpace=resolveNameSpace,this.buildAttributesMap=buildAttributesMap,this.isItStopNode=isItStopNode,this.replaceEntitiesValue=replaceEntitiesValue$1,this.readStopNodeData=readStopNodeData,this.saveTextToParentTag=saveTextToParentTag,this.addChild=addChild}};function addExternalEntities(t){const e=Object.keys(t);for(let n=0;n0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return parseValue(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?parseValue(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function resolveNameSpace(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const attrsRegx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function buildAttributesMap(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=util.getAllMatches(t,attrsRegx),i=n.length,s={};for(let t=0;t",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,s));const l=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: `);let a=0;l&&-1!==this.options.unpairedTags.indexOf(l)?(a=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):a=s.lastIndexOf("."),s=s.substring(0,a),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=readTagExp(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new xmlNode(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=findClosingIndex(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=readDocType(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=findClosingIndex(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);if(i=this.saveTextToParentTag(i,n,s),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,s,!0,!1,!0);null==t&&(t=""),n.add(this.options.textNodeName,t)}r=e+2}else{let o=readTagExp(t,r,this.options.removeNSPrefix),l=o.tagName,a=o.tagExp,h=o.attrExpPresent,u=o.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const d=n;if(d&&-1!==this.options.unpairedTags.indexOf(d.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),l!==e.tagname&&(s+=s?"."+l:l),this.isItStopNode(this.options.stopNodes,s,l)){let e="";if(a.length>0&&a.lastIndexOf("/")===a.length-1)r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new xmlNode(l);l!==a&&h&&(i[":@"]=this.buildAttributesMap(a,s,l)),e&&(e=this.parseTextData(e,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s)}else{if(a.length>0&&a.lastIndexOf("/")===a.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),a=l):a=a.substr(0,a.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const t=new xmlNode(l);l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s,l)),this.addChild(n,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new xmlNode(l);this.tagsNodeStack.push(n),l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s,l)),this.addChild(n,t,s),n=t}i="",r=u}}else i+=t[r]}return e.child};function addChild(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const replaceEntitiesValue$1=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function saveTextToParentTag(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function isItStopNode(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function tagExpWithClosingIndex(t,e,n=">"){let i,s="";for(let r=e;r",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1]){n=findClosingIndex(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=findClosingIndex(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=findClosingIndex(t,"]]>",n,"StopNode is not closed.")-2}else{const i=readTagExp(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex}}}function parseValue(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&toNumber(t,n)}return util.isExist(t)?t:""}var OrderedObjParser_1=OrderedObjParser$1,node2json={};function prettify$1(t,e){return compress(t,e)}function compress(t,e,n){let i;const s={};for(let r=0;r0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function propName$1(t){const e=Object.keys(t);for(let t=0;t0&&(n=EOL),arrToStr(t,e,"",n)}function arrToStr(t,e,n,i){let s="",r=!1;for(let o=0;o`,r=!1;continue}if(a===e.commentPropName){s+=i+`\x3c!--${l[a][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===a[0]){const t=attr_to_str(l[":@"],e),n="?xml"===a?"":i;let o=l[a][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${a}${o}${t}?>`,r=!0;continue}let u=i;""!==u&&(u+=e.indentBy);const d=i+`<${a}${attr_to_str(l[":@"],e)}`,p=arrToStr(l[a],e,h,u);-1!==e.unpairedTags.indexOf(a)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=d+`>${p}${i}`:(s+=d+">",p&&""!==i&&(p.includes("/>")||p.includes("`):s+=d+"/>",r=!0}return s}function propName(t){const e=Object.keys(t);for(let t=0;t0&&e.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Builder(t){this.options=Object.assign({},defaultOptions,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=isAttribute),this.processTextOrObjNode=processTextOrObjNode,this.options.format?(this.indentate=indentate,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function processTextOrObjNode(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function indentate(t){return this.options.indentBy.repeat(t)}function isAttribute(t){return!!t.startsWith(this.options.attributeNamePrefix)&&t.substr(this.attrPrefixLen)}Builder.prototype.build=function(t){return this.options.preserveOrder?buildFromOrderedJs(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Builder.prototype.j2x=function(t,e){let n="",i="";for(let s in t)if(void 0===t[s]);else if(null===t[s])"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){const r=this.isAttribute(s);if(r)n+=this.buildAttrPairStr(r,""+t[s]);else if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const n=t[s].length;let r="";for(let o=0;o"+t+s:!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(i)+"<"+e+n+r+this.tagEndChar+t+this.indentate(i)+s}},Builder.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class BpmnXmlParser{constructor(t){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2jOptions",{enumerable:!0,configurable:!0,writable:!0,value:{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e)=>this.processAttribute(e)}}),Object.defineProperty(this,"xmlParser",{enumerable:!0,configurable:!0,writable:!0,value:new fxp.XMLParser(this.x2jOptions)})}parse(t){let e;try{e=this.xmlParser.parse(t)}catch(t){throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}processAttribute(t){var e;for(const e of entitiesReplacements)t=t.replace(e.regex,e.val);return(null===(e=this.options)||void 0===e?void 0:e.additionalXmlAttributeProcessor)&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class JsonParsingWarning{}class ParsingMessageCollector{warning(t){const e=t.getMessage();console.warn(`[bv-parser] ${e.template}`,...e.arguments)}}class GroupUnknownCategoryValueWarning extends JsonParsingWarning{constructor(t,e){super(),Object.defineProperty(this,"groupBpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"categoryValueRef",{enumerable:!0,configurable:!0,writable:!0,value:e})}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class ShapeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),Object.defineProperty(this,"bpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t})}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class EdgeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),Object.defineProperty(this,"bpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t})}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class LabelStyleMissingFontWarning extends JsonParsingWarning{constructor(t,e){super(),Object.defineProperty(this,"shapeOrEdgeId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"labelStyleId",{enumerable:!0,configurable:!0,writable:!0,value:e})}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class LaneUnknownFlowNodeRefWarning extends JsonParsingWarning{constructor(t,e){super(),Object.defineProperty(this,"laneId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowNodeRef",{enumerable:!0,configurable:!0,writable:!0,value:e})}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class BoundaryEventNotAttachedToActivityWarning extends JsonParsingWarning{constructor(t,e,n){super(),Object.defineProperty(this,"bpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"attachedToRef",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"attachedToKind",{enumerable:!0,configurable:!0,writable:!0,value:n})}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToRef,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class ConvertedElements{constructor(){Object.defineProperty(this,"poolsById",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"poolsByProcessRef",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"messageFlows",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"flowNodes",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"lanes",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sequenceFlows",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"associationFlows",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"eventDefinitionsOfDefinitions",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"globalTasks",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"categoryValues",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const buildShapeBpmnGroup=(t,e,n,i)=>{const s=t.findCategoryValue(n.categoryValueRef);if(s)return new ShapeBpmnElement(n.id,s.value,exports.ShapeBpmnElementKind.GROUP,i);e.warning(new GroupUnknownCategoryValueWarning(n.id,n.categoryValueRef))};class CollaborationConverter{constructor(t,e){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parsingMessageCollector",{enumerable:!0,configurable:!0,writable:!0,value:e})}deserialize(t){ensureIsArray(t).forEach((t=>this.parseCollaboration(t)))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerPool(new ShapeBpmnElement(t.id,t.name,exports.ShapeBpmnElementKind.POOL),t.processRef)))}buildMessageFlows(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerMessageFlow(new MessageFlow(t.id,t.name,t.sourceRef,t.targetRef))))}buildGroups(t){ensureIsArray(t).forEach((t=>{const e=buildShapeBpmnGroup(this.convertedElements,this.parsingMessageCollector,t);e&&this.convertedElements.registerFlowNode(e)}))}}const computeSubProcessKind=(t,e)=>{switch(t){case"adHocSubProcess":return exports.ShapeBpmnSubProcessKind.AD_HOC;case"transaction":return exports.ShapeBpmnSubProcessKind.TRANSACTION;default:return e.triggeredByEvent?exports.ShapeBpmnSubProcessKind.EVENT:exports.ShapeBpmnSubProcessKind.EMBEDDED}},orderedFlowNodeBpmnTypes=["adHocSubProcess","transaction"].concat(ShapeUtil.flowNodeKinds().filter((t=>t!=exports.ShapeBpmnElementKind.EVENT_BOUNDARY))).concat([exports.ShapeBpmnElementKind.EVENT_BOUNDARY]);function getShapeBpmnElementKind(t){return["adHocSubProcess","transaction"].includes(t)?exports.ShapeBpmnElementKind.SUB_PROCESS:t}class ProcessConverter{constructor(t,e){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parsingMessageCollector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"defaultSequenceFlowIds",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"elementsWithoutParentByProcessId",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"callActivitiesCallingProcess",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}deserialize(t){ensureIsArray(t).forEach((t=>this.parseProcess(t))),ensureIsArray(t).forEach((t=>this.assignParentOfProcessElementsCalledByCallActivity(t.id))),this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const n=this.convertedElements.findPoolByProcessRef(t);n&&(n.parentId=e.id),this.elementsWithoutParentByProcessId.get(t).forEach((t=>{t.parentId=e.id}))}}assignIncomingAndOutgoingIdsFromFlows(){const t=(t,e,n)=>{var i,s;const r=null!==(s=null!==(i=this.convertedElements.findFlowNode(t))&&void 0!==i?i:this.convertedElements.findLane(t))&&void 0!==s?s:this.convertedElements.findPoolById(t);r&&!r[e].includes(n)&&r[e].push(n)};this.convertedElements.getFlows().forEach((e=>{t(e.sourceRefId,"outgoingIds",e.id),t(e.targetRefId,"incomingIds",e.id)}))}parseProcess(t){const e=t.id,n=this.convertedElements.findPoolByProcessRef(e);n&&!n.name&&this.convertedElements.registerPool(new ShapeBpmnElement(n.id,t.name,exports.ShapeBpmnElementKind.POOL),e),this.buildProcessInnerElements(t,null==n?void 0:n.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]),orderedFlowNodeBpmnTypes.forEach((n=>this.buildFlowNodeBpmnElements(t[n],getShapeBpmnElementKind(n),e,t.id,n))),this.buildLaneBpmnElements(t[exports.ShapeBpmnElementKind.LANE],e,t.id),this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),this.buildAssociationFlows(t.association)}buildFlowNodeBpmnElements(t,e,n,i,s){ensureIsArray(t).forEach((t=>{let r;if(ShapeUtil.isEvent(e))r=this.buildShapeBpmnEvent(t,e,n);else if(ShapeUtil.isActivity(e))r=this.buildShapeBpmnActivity(t,e,n,s);else if(e==exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED){const e=t;r=new ShapeBpmnEventBasedGateway(t.id,e.name,n,e.instantiate,exports.ShapeBpmnEventBasedGatewayKind[e.eventGatewayType])}else if(e==exports.ShapeBpmnElementKind.GROUP)r=buildShapeBpmnGroup(this.convertedElements,this.parsingMessageCollector,t,n);else{const i=e===exports.ShapeBpmnElementKind.TEXT_ANNOTATION?t.text:t.name;r=new ShapeBpmnElement(t.id,i,e,n,t.instantiate)}const o=t.default;ShapeUtil.isWithDefaultSequenceFlow(e)&&o&&this.defaultSequenceFlowIds.push(o),r&&(this.convertedElements.registerFlowNode(r),n||this.elementsWithoutParentByProcessId.get(i).push(r),r.incomingIds=ensureIsArray(t.incoming),r.outgoingIds=ensureIsArray(t.outgoing))}))}buildShapeBpmnActivity(t,e,n,i){const s=buildMarkers(t);return ShapeUtil.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,n,computeSubProcessKind(i,t),s):ShapeUtil.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,n,s):new ShapeBpmnActivity(t.id,t.name,e,n,t.instantiate,s)}buildShapeBpmnCallActivity(t,e,n){const i=this.convertedElements.findGlobalTask(t.calledElement);if(!i){const i=new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_PROCESS,e,n);return this.callActivitiesCallingProcess.set(t.calledElement,i),i}return new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK,e,n,i)}buildShapeBpmnEvent(t,e,n){const i=this.getEventDefinitions(t),s=i.map((t=>t.counter)).reduce(((t,e)=>t+e),0);if(0==s&&ShapeUtil.canHaveNoneEvent(e))return new ShapeBpmnEvent(t.id,t.name,e,exports.ShapeBpmnEventDefinitionKind.NONE,n);if(1==s){const s=i[0].kind;return ShapeUtil.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):ShapeUtil.isStartEvent(e)?new ShapeBpmnStartEvent(t.id,t.name,s,n,t.isInterrupting):new ShapeBpmnEvent(t.id,t.name,e,s,n)}}buildShapeBpmnBoundaryEvent(t,e){const n=this.convertedElements.findFlowNode(t.attachedToRef);if(ShapeUtil.isActivity(null==n?void 0:n.kind))return new ShapeBpmnBoundaryEvent(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new BoundaryEventNotAttachedToActivityWarning(t.id,t.attachedToRef,null==n?void 0:n.kind))}getEventDefinitions(t){const e=new Map;return eventDefinitionKinds.forEach((n=>{const i=ensureIsArray(t[n+"EventDefinition"],!0).length;e.set(n,i)})),ensureIsArray(t.eventDefinitionRef).forEach((t=>{const n=this.convertedElements.findEventDefinitionOfDefinition(t);e.set(n,e.get(n)+1)})),Array.from(e.keys()).map((t=>({kind:t,counter:e.get(t)}))).filter((t=>t.counter>0))}buildShapeBpmnSubProcess(t,e,n,i){const s=new ShapeBpmnSubProcess(t.id,t.name,n,e,i);return this.buildProcessInnerElements(t,t.id),s}buildLaneSetBpmnElements(t,e,n){ensureIsArray(t).forEach((t=>this.buildLaneBpmnElements(t.lane,e,n)))}buildLaneBpmnElements(t,e,n){ensureIsArray(t).forEach((t=>{var i;const s=new ShapeBpmnElement(t.id,t.name,exports.ShapeBpmnElementKind.LANE,e);this.convertedElements.registerLane(s),e||this.elementsWithoutParentByProcessId.get(n).push(s),this.assignParentOfLaneFlowNodes(t),(null===(i=t.childLaneSet)||void 0===i?void 0:i.lane)&&this.buildLaneBpmnElements(t.childLaneSet.lane,t.id,n)}))}assignParentOfLaneFlowNodes(t){ensureIsArray(t.flowNodeRef).forEach((e=>{const n=this.convertedElements.findFlowNode(e),i=t.id;n?ShapeUtil.isBoundaryEvent(n.kind)||(n.parentId=i):this.parsingMessageCollector.warning(new LaneUnknownFlowNodeRefWarning(i,e))}))}buildSequenceFlows(t){ensureIsArray(t).forEach((t=>{const e=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new SequenceFlow(t.id,t.name,t.sourceRef,t.targetRef,e))}))}buildAssociationFlows(t){ensureIsArray(t).forEach((t=>{const e=t.associationDirection;this.convertedElements.registerAssociationFlow(new AssociationFlow(t.id,void 0,t.sourceRef,t.targetRef,e))}))}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return exports.SequenceFlowKind.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&ShapeUtil.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return ShapeUtil.isActivity(e.kind)?exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY:exports.SequenceFlowKind.CONDITIONAL_FROM_GATEWAY}return exports.SequenceFlowKind.NORMAL}}const buildMarkers=t=>{const e=[],n=t.standardLoopCharacteristics,i=ensureIsArray(t.multiInstanceLoopCharacteristics,!0)[0];return n||""===n?e.push(exports.ShapeBpmnMarkerKind.LOOP):i&&e.push(i.isSequential?exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL),e};class Bounds{constructor(t,e,n,i){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class Edge{constructor(t,e,n,i,s=exports.MessageVisibleKind.NONE){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,"waypoints",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"messageVisibleKind",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:{}})}}class Waypoint{constructor(t,e){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:e})}}class Label{constructor(t,e){Object.defineProperty(this,"font",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bounds",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:{}})}}class Font{constructor(t,e,n,i,s,r){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"isBold",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isItalic",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"isUnderline",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"isStrikeThrough",{enumerable:!0,configurable:!0,writable:!0,value:r})}}class DiagramConverter{constructor(t,e){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parsingMessageCollector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"convertedFonts",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}deserialize(t){const e=[],n=[],i=[],s=[],r=ensureIsArray(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const t=r.BPMNPlane,o=this.deserializeEdges(t.BPMNEdge),l=this.deserializeShapes(t.BPMNShape);e.push(...l.flowNodes),n.push(...l.lanes),i.push(...l.pools),s.push(...o)}return{flowNodes:e,lanes:n,pools:i,edges:s}}deserializeFonts(t){this.convertedFonts=new Map,ensureIsArray(t).forEach((t=>ensureIsArray(t.Font).forEach((e=>this.convertedFonts.set(t.id,new Font(e.name,e.size,e.isBold,e.isItalic,e.isUnderline,e.isStrikeThrough))))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return ensureIsArray(t).forEach((t=>{this.deserializeShapeAndStoreIfFound(t,e.flowNodes,(t=>this.convertedElements.findFlowNode(t)))||this.deserializeShapeAndStoreIfFound(t,e.lanes,(t=>this.convertedElements.findLane(t)))||this.deserializeShapeAndStoreIfFound(t,e.pools,(t=>this.convertedElements.findPoolById(t)))||this.parsingMessageCollector.warning(new ShapeUnknownBpmnElementWarning(t.bpmnElement))})),e}deserializeShapeAndStoreIfFound(t,e,n){const i=this.deserializeShape(t,n);return!!i&&(e.push(i),!0)}deserializeShape(t,e){var n;const i=e(t.bpmnElement);if(i){const e=DiagramConverter.deserializeBounds(t);let s;(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity&&i.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!t.isExpanded&&i.markers.push(exports.ShapeBpmnMarkerKind.EXPAND),ShapeUtil.isPoolOrLane(i.kind)&&(s=null===(n=t.isHorizontal)||void 0===n||n);const r=t.BPMNLabel,o=this.deserializeLabel(r,t.id),l=new Shape(t.id,i,e,o,s);return DiagramConverter.setColorExtensionsOnShape(l,t),l}}static setColorExtensionsOnShape(t,e){"background-color"in e?t.extensions.fillColor=e["background-color"]:"fill"in e&&(t.extensions.fillColor=e.fill),"border-color"in e?t.extensions.strokeColor=e["border-color"]:"stroke"in e&&(t.extensions.strokeColor=e.stroke)}static deserializeBounds(t){const e=t.Bounds;if(e)return new Bounds(e.x,e.y,e.width,e.height)}deserializeEdges(t){return ensureIsArray(t).map((t=>{const e=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!e)return void this.parsingMessageCollector.warning(new EdgeUnknownBpmnElementWarning(t.bpmnElement));const n=this.deserializeWaypoints(t.waypoint),i=this.deserializeLabel(t.BPMNLabel,t.id),s=t.messageVisibleKind?t.messageVisibleKind:exports.MessageVisibleKind.NONE,r=new Edge(t.id,e,n,i,s);return DiagramConverter.setColorExtensionsOnEdge(r,t),r})).filter(Boolean)}static setColorExtensionsOnEdge(t,e){"border-color"in e?t.extensions.strokeColor=e["border-color"]:"stroke"in e&&(t.extensions.strokeColor=e.stroke)}deserializeWaypoints(t){return ensureIsArray(t).map((t=>new Waypoint(t.x,t.y)))}deserializeLabel(t,e){if(t&&"object"==typeof t){const n=this.findFont(t.labelStyle,e),i=DiagramConverter.deserializeBounds(t),s=new Label(n,i);if("color"in t)return s.extensions.color=t.color,s;if(n||i)return s}}findFont(t,e){let n;return t&&(n=this.convertedFonts.get(t),n||this.parsingMessageCollector.warning(new LabelStyleMissingFontWarning(e,t))),n}}class EventDefinitionConverter{constructor(t){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t})}deserialize(t){eventDefinitionKinds.forEach((e=>{ensureIsArray(t[e+"EventDefinition"],!0).forEach((t=>this.convertedElements.registerEventDefinitionsOfDefinition(t.id,e)))}))}}class GlobalTaskConverter{constructor(t){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t})}deserialize(t){this.parseGlobalTasks(t.globalTask,exports.ShapeBpmnElementKind.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){ensureIsArray(t).forEach((t=>this.convertedElements.registerGlobalTask(t.id,e)))}}class CategoryConverter{constructor(t){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t})}deserialize(t){ensureIsArray(t.category).forEach((t=>ensureIsArray(t.categoryValue).forEach((t=>this.convertedElements.registerCategoryValue(t.id,t.value)))))}}class BpmnJsonParser{constructor(t,e,n,i,s,r){Object.defineProperty(this,"categoryConverter",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"collaborationConverter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventDefinitionConverter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"globalTaskConverter",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"processConverter",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"diagramConverter",{enumerable:!0,configurable:!0,writable:!0,value:r})}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function newBpmnJsonParser(t){const e=new ConvertedElements;return new BpmnJsonParser(new CategoryConverter(e),new CollaborationConverter(e,t),new EventDefinitionConverter(e),new GlobalTaskConverter(e),new ProcessConverter(e,t),new DiagramConverter(e,t))}class BpmnParser{constructor(t,e){Object.defineProperty(this,"jsonParser",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"xmlParser",{enumerable:!0,configurable:!0,writable:!0,value:e})}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function newBpmnParser(t){return new BpmnParser(newBpmnJsonParser(new ParsingMessageCollector),new BpmnXmlParser(t))}class CssRegistry{constructor(){Object.defineProperty(this,"classNamesByBpmnId",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"clear",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.classNamesByBpmnId.clear()}}),Object.defineProperty(this,"addClassNames",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>this.updateClassNames(t,e,((t,e)=>t.add(e)))}),Object.defineProperty(this,"removeClassNames",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>this.updateClassNames(t,e,((t,e)=>t.delete(e)))}),Object.defineProperty(this,"toggleClassNames",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>(this.updateClassNames(t,e,((t,e)=>t.has(e)?t.delete(e):t.add(e))),e&&e.length>0)})}getClassNames(t){var e;return Array.from(null!==(e=this.classNamesByBpmnId.get(t))&&void 0!==e?e:[])}getBpmnIds(){return Array.from(this.classNamesByBpmnId.keys())}removeAllClassNames(t){const e=this.getOrInitializeClassNames(t),n=e.size;return e.clear(),e.sizen(i,t))),i.size!=s}getOrInitializeClassNames(t){let e=this.classNamesByBpmnId.get(t);return null==e&&(e=new Set,this.classNamesByBpmnId.set(t,e)),e}}class StyleManager{constructor(t,e){Object.defineProperty(this,"cssRegistry",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"stylesCache",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}clear(){this.stylesCache.clear()}resetAllStyles(){for(const t of this.stylesCache.keys()){const e=this.stylesCache.get(t);this.resetStyle(t,e)}}resetStyleIfIsStored(t){const e=this.stylesCache.get(t);e&&this.resetStyle(t,e)}resetStyle(t,e){const n=this.model.getCell(t),i=this.cssRegistry.getClassNames(t),s=setStyle(e,BpmnStyleIdentifier.EXTRA_CSS_CLASSES,i.join(","));this.model.setStyle(n,s),this.stylesCache.delete(t)}ensureStyleIsStored(t){const e=t.getId();this.stylesCache.has(e)||this.stylesCache.set(e,t.getStyle())}}class OverlayConverter{constructor(){Object.defineProperty(this,"overlayPositions",{enumerable:!0,configurable:!0,writable:!0,value:new Map([["start",{horizontalAlign:"left",verticalAlign:"top"}],["middle",{horizontalAlign:"center",verticalAlign:"top"}],["end",{horizontalAlign:"right",verticalAlign:"top"}],["top-left",{horizontalAlign:"left",verticalAlign:"top"}],["top-right",{horizontalAlign:"right",verticalAlign:"top"}],["top-center",{horizontalAlign:"center",verticalAlign:"top"}],["bottom-left",{horizontalAlign:"left",verticalAlign:"bottom"}],["bottom-right",{horizontalAlign:"right",verticalAlign:"bottom"}],["bottom-center",{horizontalAlign:"center",verticalAlign:"bottom"}],["middle-left",{horizontalAlign:"left",verticalAlign:"middle"}],["middle-right",{horizontalAlign:"right",verticalAlign:"middle"}]])})}convert(t){return{position:this.convertPosition(t),style:OverlayConverter.convertStyle(t)}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:StyleDefault.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:StyleDefault.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:StyleDefault.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:StyleDefault.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},n=t.style,i=Object.assign({},e);return n?(this.convertFill(i,n.fill),this.convertStroke(i,n.stroke),this.convertFont(i,n.font),i):i}static convertFill(t,e){var n,i;e&&(t.fill.color=null!==(n=e.color)&&void 0!==n?n:t.fill.color,t.fill.opacity=null!==(i=e.opacity)&&void 0!==i?i:t.fill.opacity)}static convertStroke(t,e){var n,i;e&&(t.stroke.color=null!==(n=e.color)&&void 0!==n?n:t.stroke.color,t.stroke.width=null!==(i=e.width)&&void 0!==i?i:t.stroke.width)}static convertFont(t,e){var n,i;e&&(t.font.color=null!==(n=e.color)&&void 0!==n?n:t.font.color,t.font.size=null!==(i=e.size)&&void 0!==i?i:t.font.size)}}function newGraphCellUpdater(t,e){return new GraphCellUpdater(t,new OverlayConverter,new StyleManager(e,t.getModel()))}class GraphCellUpdater{constructor(t,e,n){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"overlayConverter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"styleManager",{enumerable:!0,configurable:!0,writable:!0,value:n})}clear(){this.styleManager.clear()}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(messageFlowIconId(t),e)}updateAndRefreshCssClassesOfElement(t,e){const n=this.graph.getModel(),i=n.getCell(t);if(!i)return;this.styleManager.ensureStyleIsStored(i);let s=i.getStyle();s=setStyle(s,BpmnStyleIdentifier.EXTRA_CSS_CLASSES,e.join(",")),n.setStyle(i,s)}addOverlays(t,e){const n=this.graph.getModel().getCell(t);n&&ensureIsArray(e).forEach((t=>{const e=new MxGraphCustomOverlay(t.label,this.overlayConverter.convert(t));this.graph.addCellOverlay(n,e)}))}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}updateStyle(t,e){if(!e)return;const n=this.graph.getModel(),i=withCellIdsOfMessageFlowIcons(t).map((t=>n.getCell(t))).filter(Boolean);0!=i.length&&this.graph.batchUpdate((()=>{for(const t of i){this.styleManager.ensureStyleIsStored(t);let n=t.getStyle();n=setStyle(n,mxConstants.STYLE_OPACITY,e.opacity,ensureOpacityValue),n=updateStroke(n,e.stroke),n=updateFont(n,e.font),isShapeStyleUpdate(e)&&(n=updateFill(n,e.fill)),this.graph.model.setStyle(t,n)}}))}resetStyle(t){this.graph.batchUpdate((()=>{if(0==t.length)this.styleManager.resetAllStyles();else for(const e of withCellIdsOfMessageFlowIcons(t))this.styleManager.resetStyleIfIsStored(e)}))}}function withCellIdsOfMessageFlowIcons(t){const e=ensureIsArray(t);return e.concat(e.map((t=>messageFlowIconId(t))))}class BpmnQuerySelectors{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}function newBpmnElementsRegistry(t,e){const n=new CssRegistry;return new BpmnElementsRegistry(t,new HtmlElementRegistry(e.container,new BpmnQuerySelectors),n,newGraphCellUpdater(e,n))}class BpmnElementsRegistry{constructor(t,e,n,i){Object.defineProperty(this,"bpmnModelRegistry",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"htmlElementRegistry",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cssRegistry",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"graphCellUpdater",{enumerable:!0,configurable:!0,writable:!0,value:i}),this.bpmnModelRegistry.registerOnLoadCallback((()=>{this.cssRegistry.clear(),this.graphCellUpdater.clear()}))}getElementsByIds(t){return ensureIsArray(t).map((t=>this.bpmnModelRegistry.getBpmnSemantic(t))).filter(Boolean).map((t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)})))}getElementsByKinds(t){return ensureIsArray(t).map((t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map((t=>({htmlElement:t,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(t.getAttribute("data-bpmn-id"))}))))).reduce(((t,e)=>(t.push(...e),t)),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames)}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames)}removeAllCssClasses(t){if(t)ensureIsArray(t).forEach((t=>{const e=this.cssRegistry.removeAllClassNames(t);this.updateCellIfChanged(e,t)}));else{const t=this.cssRegistry.getBpmnIds();this.cssRegistry.clear(),t.forEach((t=>this.updateCellIfChanged(!0,t)))}}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames)}updateCssClasses(t,e,n){const i=ensureIsArray(e);ensureIsArray(t).forEach((t=>this.updateCellIfChanged(n(t,i),t)))}updateCellIfChanged(t,e){if(t){const t=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,t)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}updateStyle(t,e){this.graphCellUpdater.updateStyle(t,e)}resetStyle(t){this.graphCellUpdater.resetStyle(ensureIsArray(t))}}class HtmlElementRegistry{constructor(t,e){Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"querySelectors",{enumerable:!0,configurable:!0,writable:!0,value:e})}getBpmnHtmlElement(t){return this.container.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(computeBpmnBaseClassName(t));return[...this.container.querySelectorAll(e)]}}class ModelFiltering{filter(t,e){const n=[],i=[];if(ensureIsArray(null==e?void 0:e.pools).filter((t=>t&&Object.keys(t).length)).forEach((t=>t.id?n.push(t.id):t.name&&i.push(t.name))),0==n.length&&0==i.length)return t;const{filteredPools:s,filteredPoolIds:r}=filterPools(t,n,i),o=[...n,...r],{filteredLanes:l,filteredLaneIds:a,filteredFlowNodes:h,filteredFlowNodeIds:u}=filterLanesAndFlowNodes(t.lanes,t.flowNodes,o),d=filterEdges(t.edges,[...o,...a,...u]);if(0==s.length&&0==l.length&&0==h.length&&0==d.length){let t=n.length>0?` for ids [${n}]`:"";const e=t?" and":"";throw t+=i.length>0?`${e} for names [${i}]`:"",new Error("No matching pools"+t)}return{lanes:l,flowNodes:h,pools:s,edges:d}}}function filterPools(t,e,n){const i=t.pools.filter((t=>e.includes(t.bpmnElement.id)||n.includes(t.bpmnElement.name))),s=i.map((t=>t.bpmnElement.id));return{filteredPools:i,filteredPoolIds:s}}function filterLanesAndFlowNodes(t,e,n){const{filteredLanes:i,filteredLaneIds:s}=filterLanes(t,n),{filteredLanes:r,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}=filterFlowNodes(e,[...n,...s],t);return i.push(...r),s.push(...o),{filteredLanes:i,filteredLaneIds:s,filteredFlowNodes:l,filteredFlowNodeIds:a}}function filterLanes(t,e){const n=t.filter((t=>e.includes(t.bpmnElement.parentId))),i=n.map((t=>t.bpmnElement.id));if(n.length>0){const{filteredLanes:e,filteredLaneIds:s}=filterLanes(t,i);n.push(...e),i.push(...s)}return{filteredLanes:n,filteredLaneIds:i}}function filterFlowNodes(t,e,n){const i=t.filter((t=>e.includes(t.bpmnElement.parentId)));if(0===i.length)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const s=i.map((t=>t.bpmnElement.id)),{filteredLanes:r,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}=filterLanesAndFlowNodes(n,t,s);return i.push(...l),s.push(...a),{filteredLanes:r,filteredLaneIds:o,filteredFlowNodes:i,filteredFlowNodeIds:s}}function filterEdges(t,e){return t.filter((t=>e.includes(t.bpmnElement.sourceRefId)&&e.includes(t.bpmnElement.targetRefId)))}class BpmnModelRegistry{constructor(){Object.defineProperty(this,"searchableModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onLoadCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}load(t,e){var n;const i=(new ModelFiltering).filter(t,e);return this.searchableModel=new SearchableModel(i),null===(n=this.onLoadCallback)||void 0===n||n.call(this),toRenderedModel(i)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){var e;const n=null===(e=this.searchableModel)||void 0===e?void 0:e.elementById(t);if(!n)return;const i=n.bpmnElement,s=i instanceof ShapeBpmnElement,r={id:t,name:i.name,isShape:s,kind:i.kind};return i instanceof Flow?(r.sourceRefId=i.sourceRefId,r.targetRefId=i.targetRefId):(r.incomingIds=i.incomingIds,r.outgoingIds=i.outgoingIds),r}}function toRenderedModel(t){const e=t.flowNodes.filter((t=>{const e=t.bpmnElement;return ShapeUtil.isSubProcess(e.kind)&&e.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)})).map((t=>t.bpmnElement.id)),n=[],i=[],s=[];return t.flowNodes.forEach((t=>{const r=t.bpmnElement.kind;ShapeUtil.isSubProcess(r)?n.push(t):ShapeUtil.isBoundaryEvent(r)?i.push(t):e.includes(t.bpmnElement.parentId)||s.push(t)})),{boundaryEvents:i,edges:t.edges,lanes:t.lanes,otherFlowNodes:s,pools:t.pools,subprocesses:n}}class SearchableModel{constructor(t){Object.defineProperty(this,"elements",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach((t=>this.elements.set(t.bpmnElement.id,t)))}elementById(t){return this.elements.get(t)}}function htmlElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}class Navigation{constructor(t){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t})}fit(t){this.graph.customFit(t)}zoom(t){"in"==t?this.graph.zoomIn():this.graph.zoomOut()}}const libVersion="0.38.0",version=()=>({lib:libVersion,dependencies:new Map([["mxGraph",mxClient.VERSION]])});class BpmnVisualization{constructor(t){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"navigation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bpmnElementsRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bpmnModelRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parserOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rendererOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.rendererOptions=null==t?void 0:t.renderer;const e=new GraphConfigurator(htmlElement(null==t?void 0:t.container));this.graph=e.configure(t),this.navigation=new Navigation(this.graph),this.bpmnModelRegistry=new BpmnModelRegistry,this.bpmnElementsRegistry=newBpmnElementsRegistry(this.bpmnModelRegistry,this.graph),this.parserOptions=null==t?void 0:t.parser}load(t,e){const n=newBpmnParser(this.parserOptions).parse(t),i=this.bpmnModelRegistry.load(n,null==e?void 0:e.modelFilter);newBpmnRenderer(this.graph,this.rendererOptions).render(i,null==e?void 0:e.fit)}getVersion(){return version()}}return exports.BpmnCanvas=BpmnCanvas,exports.BpmnElementsRegistry=BpmnElementsRegistry,exports.BpmnStyleIdentifier=BpmnStyleIdentifier,exports.BpmnVisualization=BpmnVisualization,exports.IconPainter=IconPainter,exports.IconPainterProvider=IconPainterProvider,exports.MarkerIdentifier=MarkerIdentifier,exports.ShapeUtil=ShapeUtil,exports.StyleConfigurator=StyleConfigurator,exports.StyleDefault=StyleDefault,exports.mxgraph=mxgraph,exports}({}); +/* bpmn-visualization v0.38.1 | Copyright (c) 2020-2023, Bonitasoft SA | Apache 2.0 license */ +var bpmnvisu=function(exports){"use strict";var FitType,ZoomType,ShapeBpmnElementKind,ShapeBpmnCallActivityKind,ShapeBpmnEventBasedGatewayKind,ShapeBpmnEventDefinitionKind,ShapeBpmnMarkerKind,ShapeBpmnSubProcessKind;function convertEmptyStringAndObject(t,e){return""===t?e?{}:void 0:t}function ensureIsArray(t,e=!1){return null==t?[]:(Array.isArray(t)?t:[t]).map((t=>convertEmptyStringAndObject(t,e))).filter(Boolean)}function filter(t,e,n){let i="";return(null==n?void 0:n.startingWith)?i=i.concat(`^(${n.startingWith}).*`):(null==n?void 0:n.notStartingWith)&&(i=i.concat(`^(?!(${n.notStartingWith})).*`)),i=i.concat(`${e}$`),t.filter((t=>(null==n?void 0:n.ignoreCase)?new RegExp(i,"i").test(t):new RegExp(i).test(t)))}exports.FitType=void 0,FitType=exports.FitType||(exports.FitType={}),FitType.None="None",FitType.HorizontalVertical="HorizontalVertical",FitType.Horizontal="Horizontal",FitType.Vertical="Vertical",FitType.Center="Center",exports.ZoomType=void 0,ZoomType=exports.ZoomType||(exports.ZoomType={}),ZoomType.In="in",ZoomType.Out="out",exports.ShapeBpmnElementKind=void 0,ShapeBpmnElementKind=exports.ShapeBpmnElementKind||(exports.ShapeBpmnElementKind={}),ShapeBpmnElementKind.LANE="lane",ShapeBpmnElementKind.POOL="pool",ShapeBpmnElementKind.CALL_ACTIVITY="callActivity",ShapeBpmnElementKind.SUB_PROCESS="subProcess",ShapeBpmnElementKind.TASK="task",ShapeBpmnElementKind.TASK_USER="userTask",ShapeBpmnElementKind.TASK_SERVICE="serviceTask",ShapeBpmnElementKind.TASK_RECEIVE="receiveTask",ShapeBpmnElementKind.TASK_SEND="sendTask",ShapeBpmnElementKind.TASK_MANUAL="manualTask",ShapeBpmnElementKind.TASK_SCRIPT="scriptTask",ShapeBpmnElementKind.TASK_BUSINESS_RULE="businessRuleTask",ShapeBpmnElementKind.GLOBAL_TASK="globalTask",ShapeBpmnElementKind.GLOBAL_TASK_USER="globalUserTask",ShapeBpmnElementKind.GLOBAL_TASK_MANUAL="globalManualTask",ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT="globalScriptTask",ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",ShapeBpmnElementKind.GROUP="group",ShapeBpmnElementKind.TEXT_ANNOTATION="textAnnotation",ShapeBpmnElementKind.GATEWAY_PARALLEL="parallelGateway",ShapeBpmnElementKind.GATEWAY_EXCLUSIVE="exclusiveGateway",ShapeBpmnElementKind.GATEWAY_INCLUSIVE="inclusiveGateway",ShapeBpmnElementKind.GATEWAY_EVENT_BASED="eventBasedGateway",ShapeBpmnElementKind.GATEWAY_COMPLEX="complexGateway",ShapeBpmnElementKind.EVENT_START="startEvent",ShapeBpmnElementKind.EVENT_END="endEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",ShapeBpmnElementKind.EVENT_BOUNDARY="boundaryEvent",exports.ShapeBpmnCallActivityKind=void 0,ShapeBpmnCallActivityKind=exports.ShapeBpmnCallActivityKind||(exports.ShapeBpmnCallActivityKind={}),ShapeBpmnCallActivityKind.CALLING_PROCESS="process",ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK="global task",exports.ShapeBpmnEventBasedGatewayKind=void 0,ShapeBpmnEventBasedGatewayKind=exports.ShapeBpmnEventBasedGatewayKind||(exports.ShapeBpmnEventBasedGatewayKind={}),ShapeBpmnEventBasedGatewayKind.Exclusive="Exclusive",ShapeBpmnEventBasedGatewayKind.None="None",ShapeBpmnEventBasedGatewayKind.Parallel="Parallel",exports.ShapeBpmnEventDefinitionKind=void 0,ShapeBpmnEventDefinitionKind=exports.ShapeBpmnEventDefinitionKind||(exports.ShapeBpmnEventDefinitionKind={}),ShapeBpmnEventDefinitionKind.NONE="none",ShapeBpmnEventDefinitionKind.TERMINATE="terminate",ShapeBpmnEventDefinitionKind.CANCEL="cancel",ShapeBpmnEventDefinitionKind.COMPENSATION="compensate",ShapeBpmnEventDefinitionKind.CONDITIONAL="conditional",ShapeBpmnEventDefinitionKind.ERROR="error",ShapeBpmnEventDefinitionKind.ESCALATION="escalation",ShapeBpmnEventDefinitionKind.LINK="link",ShapeBpmnEventDefinitionKind.MESSAGE="message",ShapeBpmnEventDefinitionKind.SIGNAL="signal",ShapeBpmnEventDefinitionKind.TIMER="timer",exports.ShapeBpmnMarkerKind=void 0,ShapeBpmnMarkerKind=exports.ShapeBpmnMarkerKind||(exports.ShapeBpmnMarkerKind={}),ShapeBpmnMarkerKind.ADHOC="adhoc",ShapeBpmnMarkerKind.COMPENSATION="compensation",ShapeBpmnMarkerKind.EXPAND="expand",ShapeBpmnMarkerKind.LOOP="loop",ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL="parallel multi instance",ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",exports.ShapeBpmnSubProcessKind=void 0,ShapeBpmnSubProcessKind=exports.ShapeBpmnSubProcessKind||(exports.ShapeBpmnSubProcessKind={}),ShapeBpmnSubProcessKind.AD_HOC="ad_hoc",ShapeBpmnSubProcessKind.EMBEDDED="embedded",ShapeBpmnSubProcessKind.EVENT="event",ShapeBpmnSubProcessKind.TRANSACTION="transaction";class ShapeUtil{static isEvent(t){return isKindOf(EVENT_KINDS,t)}static eventKinds(){return[...EVENT_KINDS]}static isBoundaryEvent(t){return exports.ShapeBpmnElementKind.EVENT_BOUNDARY===t}static isStartEvent(t){return exports.ShapeBpmnElementKind.EVENT_START===t}static isCallActivity(t){return exports.ShapeBpmnElementKind.CALL_ACTIVITY===t}static isSubProcess(t){return exports.ShapeBpmnElementKind.SUB_PROCESS===t}static canHaveNoneEvent(t){return exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===t||exports.ShapeBpmnElementKind.EVENT_END===t||exports.ShapeBpmnElementKind.EVENT_START===t}static isActivity(t){return isKindOf(ACTIVITY_KINDS,t)}static activityKinds(){return[...ACTIVITY_KINDS]}static isWithDefaultSequenceFlow(t){return FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS.includes(t)}static isTask(t){return isKindOf(TASK_KINDS,t)}static taskKinds(){return[...TASK_KINDS]}static gatewayKinds(){return[...GATEWAY_KINDS]}static isGateway(t){return isKindOf(GATEWAY_KINDS,t)}static flowNodeKinds(){return Object.values(exports.ShapeBpmnElementKind).filter((t=>!ShapeUtil.isPoolOrLane(t)))}static isPoolOrLane(t){return t==exports.ShapeBpmnElementKind.POOL||t==exports.ShapeBpmnElementKind.LANE}}function filterKind(t,e){return filter(Object.values(exports.ShapeBpmnElementKind),t,e)}function isKindOf(t,e){return Object.values(t).map((t=>t)).includes(e)}const EVENT_KINDS=filterKind("Event"),GATEWAY_KINDS=filterKind("Gateway"),TASK_KINDS=filterKind("Task",{ignoreCase:!0,notStartingWith:"global"}),ACTIVITY_KINDS=[...TASK_KINDS,exports.ShapeBpmnElementKind.CALL_ACTIVITY,exports.ShapeBpmnElementKind.SUB_PROCESS],FLOW_NODE_WITH_DEFAULT_SEQUENCE_FLOW_KINDS=[...ACTIVITY_KINDS,exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_COMPLEX],eventDefinitionKinds=Object.values(exports.ShapeBpmnEventDefinitionKind).filter((t=>t!=exports.ShapeBpmnEventDefinitionKind.NONE));var AssociationDirectionKind,FlowKind,MessageVisibleKind,SequenceFlowKind;function ensureInRange(t,e,n,i){const s=null!=t?t:i;return Math.min(Math.max(s,e),n)}function ensurePositiveValue(t){return Math.max(t||0,0)}function ensureValidZoomConfiguration(t){const e=null!=t?t:{};return e.debounceDelay=ensureInRange(e.debounceDelay,0,100,50),e.throttleDelay=ensureInRange(e.throttleDelay,0,100,50),e}function ensureOpacityValue(t){return"default"==t?void 0:ensureInRange(t,0,100,100)}function ensureStrokeWidthValue(t){return"default"==t?void 0:ensureInRange(t,1,50,1)}exports.AssociationDirectionKind=void 0,AssociationDirectionKind=exports.AssociationDirectionKind||(exports.AssociationDirectionKind={}),AssociationDirectionKind.NONE="None",AssociationDirectionKind.ONE="One",AssociationDirectionKind.BOTH="Both",exports.FlowKind=void 0,FlowKind=exports.FlowKind||(exports.FlowKind={}),FlowKind.SEQUENCE_FLOW="sequenceFlow",FlowKind.MESSAGE_FLOW="messageFlow",FlowKind.ASSOCIATION_FLOW="association",exports.MessageVisibleKind=void 0,MessageVisibleKind=exports.MessageVisibleKind||(exports.MessageVisibleKind={}),MessageVisibleKind.NONE="none",MessageVisibleKind.INITIATING="initiating",MessageVisibleKind.NON_INITIATING="non_initiating",exports.SequenceFlowKind=void 0,SequenceFlowKind=exports.SequenceFlowKind||(exports.SequenceFlowKind={}),SequenceFlowKind.NORMAL="normal",SequenceFlowKind.DEFAULT="default",SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",SequenceFlowKind.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var build={exports:{}};(function(module){!function(t,e){module.exports?module.exports=e():t.mxgraph=e()}(commonjsGlobal,(function(){return function(opts){for(var name in opts)this[name]=opts[name];var __mxOutput={},mxClient={VERSION:"4.2.2",IS_IE:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0,IS_IE6:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE 6")>=0,IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:null!=navigator.userAgent&&navigator.userAgent.indexOf("MSIE")>=0&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&navigator.userAgent.indexOf("Mozilla/")>=0&&navigator.userAgent.indexOf("MSIE")<0&&navigator.userAgent.indexOf("Edge/")<0,IS_OP:null!=navigator.userAgent&&(navigator.userAgent.indexOf("Opera/")>=0||navigator.userAgent.indexOf("OPR/")>=0),IS_OT:null!=navigator.userAgent&&navigator.userAgent.indexOf("Presto/")>=0&&navigator.userAgent.indexOf("Presto/2.4.")<0&&navigator.userAgent.indexOf("Presto/2.3.")<0&&navigator.userAgent.indexOf("Presto/2.2.")<0&&navigator.userAgent.indexOf("Presto/2.1.")<0&&navigator.userAgent.indexOf("Presto/2.0.")<0&&navigator.userAgent.indexOf("Presto/1.")<0,IS_SF:/Apple Computer, Inc/.test(navigator.vendor),IS_ANDROID:navigator.appVersion.indexOf("Android")>=0,IS_IOS:/iP(hone|od|ad)/.test(navigator.platform),IS_GC:/Google Inc/.test(navigator.vendor),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:"undefined"!=typeof InstallTrigger,IS_MT:navigator.userAgent.indexOf("Firefox/")>=0&&navigator.userAgent.indexOf("Firefox/1.")<0&&navigator.userAgent.indexOf("Firefox/2.")<0||navigator.userAgent.indexOf("Iceweasel/")>=0&&navigator.userAgent.indexOf("Iceweasel/1.")<0&&navigator.userAgent.indexOf("Iceweasel/2.")<0||navigator.userAgent.indexOf("SeaMonkey/")>=0&&navigator.userAgent.indexOf("SeaMonkey/1.")<0||navigator.userAgent.indexOf("Iceape/")>=0&&navigator.userAgent.indexOf("Iceape/1.")<0,IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||navigator.userAgent.indexOf("Opera/")>=0,IS_WIN:navigator.appVersion.indexOf("Win")>0,IS_MAC:navigator.appVersion.indexOf("Mac")>0,IS_CHROMEOS:/\bCrOS\b/.test(navigator.appVersion),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(navigator.appVersion.indexOf("Mac")>0),IS_LOCAL:document.location.href.indexOf("http://")<0&&document.location.href.indexOf("https://")<0,defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(t,e,n,i){if(n=n||document,mxClient.IS_IE6)n.write('');else{var s=n.createElement("link");s.setAttribute("rel",t),s.setAttribute("href",e),s.setAttribute("charset","UTF-8"),s.setAttribute("type","text/css"),i&&s.setAttribute("id",i),n.getElementsByTagName("head")[0].appendChild(s)}},loadResources:function(t,e){var n=mxClient.defaultBundles.length;function i(){0==--n&&t()}for(var s=0;s<\/script>')}},node;"undefined"==typeof mxLoadResources&&(mxLoadResources=!0),"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1),"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt"),"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0),"undefined"!=typeof mxBasePath&&mxBasePath.length>0?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".","undefined"!=typeof mxImageBasePath&&mxImageBasePath.length>0?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images","undefined"!=typeof mxLanguage&&null!=mxLanguage?mxClient.language=mxLanguage:mxClient.language=mxClient.IS_IE?navigator.userLanguage:navigator.language,"undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxClient.defaultLanguage=mxDefaultLanguage:mxClient.defaultLanguage="en",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css"),"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages),mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(null!=document.namespaces&&(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office"))),mxClient.IS_QUIRKS&&document.styleSheets.length>=30?(node=document.createElement("style"),node.type="text/css",node.styleSheet.cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",document.getElementsByTagName("head")[0].appendChild(node)):document.createStyleSheet().cssText=mxClient.VML_PREFIX+"\\:*{behavior:url(#default#VML)}"+mxClient.OFFICE_PREFIX+"\\:*{behavior:url(#default#VML)}",mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/explorer.css"))),(mxForceIncludes||null==module.exports)&&(mxClient.include(mxClient.basePath+"/js/util/mxLog.js"),mxClient.include(mxClient.basePath+"/js/util/mxObjectIdentity.js"),mxClient.include(mxClient.basePath+"/js/util/mxDictionary.js"),mxClient.include(mxClient.basePath+"/js/util/mxResources.js"),mxClient.include(mxClient.basePath+"/js/util/mxPoint.js"),mxClient.include(mxClient.basePath+"/js/util/mxRectangle.js"),mxClient.include(mxClient.basePath+"/js/util/mxEffects.js"),mxClient.include(mxClient.basePath+"/js/util/mxUtils.js"),mxClient.include(mxClient.basePath+"/js/util/mxConstants.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventObject.js"),mxClient.include(mxClient.basePath+"/js/util/mxMouseEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxEventSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxEvent.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlRequest.js"),mxClient.include(mxClient.basePath+"/js/util/mxClipboard.js"),mxClient.include(mxClient.basePath+"/js/util/mxWindow.js"),mxClient.include(mxClient.basePath+"/js/util/mxForm.js"),mxClient.include(mxClient.basePath+"/js/util/mxImage.js"),mxClient.include(mxClient.basePath+"/js/util/mxDivResizer.js"),mxClient.include(mxClient.basePath+"/js/util/mxDragSource.js"),mxClient.include(mxClient.basePath+"/js/util/mxToolbar.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoableEdit.js"),mxClient.include(mxClient.basePath+"/js/util/mxUndoManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxUrlConverter.js"),mxClient.include(mxClient.basePath+"/js/util/mxPanningManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/util/mxAutoSaveManager.js"),mxClient.include(mxClient.basePath+"/js/util/mxAnimation.js"),mxClient.include(mxClient.basePath+"/js/util/mxMorphing.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageBundle.js"),mxClient.include(mxClient.basePath+"/js/util/mxImageExport.js"),mxClient.include(mxClient.basePath+"/js/util/mxAbstractCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxXmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxSvgCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxVmlCanvas2D.js"),mxClient.include(mxClient.basePath+"/js/util/mxGuide.js"),mxClient.include(mxClient.basePath+"/js/shape/mxShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencil.js"),mxClient.include(mxClient.basePath+"/js/shape/mxStencilRegistry.js"),mxClient.include(mxClient.basePath+"/js/shape/mxMarker.js"),mxClient.include(mxClient.basePath+"/js/shape/mxActor.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCloud.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRectangleShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxDoubleEllipse.js"),mxClient.include(mxClient.basePath+"/js/shape/mxRhombus.js"),mxClient.include(mxClient.basePath+"/js/shape/mxPolyline.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrow.js"),mxClient.include(mxClient.basePath+"/js/shape/mxArrowConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxText.js"),mxClient.include(mxClient.basePath+"/js/shape/mxTriangle.js"),mxClient.include(mxClient.basePath+"/js/shape/mxHexagon.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLine.js"),mxClient.include(mxClient.basePath+"/js/shape/mxImageShape.js"),mxClient.include(mxClient.basePath+"/js/shape/mxLabel.js"),mxClient.include(mxClient.basePath+"/js/shape/mxCylinder.js"),mxClient.include(mxClient.basePath+"/js/shape/mxConnector.js"),mxClient.include(mxClient.basePath+"/js/shape/mxSwimlane.js"),mxClient.include(mxClient.basePath+"/js/layout/mxGraphLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxStackLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxPartitionLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompactTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxRadialTreeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxFastOrganicLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCircleLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxParallelEdgeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxCompositeLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/mxEdgeLabelLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphAbstractHierarchyCell.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyNode.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyEdge.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxGraphHierarchyModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/model/mxSwimlaneModel.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxHierarchicalLayoutStage.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMedianHybridCrossingReduction.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxMinimumCycleRemover.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxCoordinateAssignment.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/stage/mxSwimlaneOrdering.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxHierarchicalLayout.js"),mxClient.include(mxClient.basePath+"/js/layout/hierarchical/mxSwimlaneLayout.js"),mxClient.include(mxClient.basePath+"/js/model/mxGraphModel.js"),mxClient.include(mxClient.basePath+"/js/model/mxCell.js"),mxClient.include(mxClient.basePath+"/js/model/mxGeometry.js"),mxClient.include(mxClient.basePath+"/js/model/mxCellPath.js"),mxClient.include(mxClient.basePath+"/js/view/mxPerimeter.js"),mxClient.include(mxClient.basePath+"/js/view/mxPrintPreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxStylesheet.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellState.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphSelectionModel.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellEditor.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellRenderer.js"),mxClient.include(mxClient.basePath+"/js/view/mxEdgeStyle.js"),mxClient.include(mxClient.basePath+"/js/view/mxStyleRegistry.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraphView.js"),mxClient.include(mxClient.basePath+"/js/view/mxGraph.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellOverlay.js"),mxClient.include(mxClient.basePath+"/js/view/mxOutline.js"),mxClient.include(mxClient.basePath+"/js/view/mxMultiplicity.js"),mxClient.include(mxClient.basePath+"/js/view/mxLayoutManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxSwimlaneManager.js"),mxClient.include(mxClient.basePath+"/js/view/mxTemporaryCellStates.js"),mxClient.include(mxClient.basePath+"/js/view/mxCellStatePreview.js"),mxClient.include(mxClient.basePath+"/js/view/mxConnectionConstraint.js"),mxClient.include(mxClient.basePath+"/js/handler/mxGraphHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPanningHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxPopupMenuHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellMarker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxSelectionCellsHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConnectionHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxConstraintHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxRubberband.js"),mxClient.include(mxClient.basePath+"/js/handler/mxHandle.js"),mxClient.include(mxClient.basePath+"/js/handler/mxVertexHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxElbowEdgeHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxEdgeSegmentHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxTooltipHandler.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellTracker.js"),mxClient.include(mxClient.basePath+"/js/handler/mxCellHighlight.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultKeyHandler.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultPopupMenu.js"),mxClient.include(mxClient.basePath+"/js/editor/mxDefaultToolbar.js"),mxClient.include(mxClient.basePath+"/js/editor/mxEditor.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodecRegistry.js"),mxClient.include(mxClient.basePath+"/js/io/mxCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxObjectCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxCellCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxModelCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxRootChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxChildChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxTerminalChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGenericChangeCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxGraphViewCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxStylesheetCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultKeyHandlerCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultToolbarCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxDefaultPopupMenuCodec.js"),mxClient.include(mxClient.basePath+"/js/io/mxEditorCodec.js")),__mxOutput.mxClient=void 0!==mxClient?mxClient:void 0;var mxLog={consoleName:"Console",TRACE:!1,DEBUG:!0,WARN:!0,buffer:"",init:function(){if(null==mxLog.window&&null!=document.body){var t=mxLog.consoleName+" - mxGraph "+mxClient.VERSION,e=document.createElement("table");e.setAttribute("width","100%"),e.setAttribute("height","100%");var n=document.createElement("tbody"),i=document.createElement("tr"),s=document.createElement("td");s.style.verticalAlign="top",mxLog.textarea=document.createElement("textarea"),mxLog.textarea.setAttribute("wrap","off"),mxLog.textarea.setAttribute("readOnly","true"),mxLog.textarea.style.height="100%",mxLog.textarea.style.resize="none",mxLog.textarea.value=mxLog.buffer,mxClient.IS_NS&&"BackCompat"!=document.compatMode?mxLog.textarea.style.width="99%":mxLog.textarea.style.width="100%",s.appendChild(mxLog.textarea),i.appendChild(s),n.appendChild(i),i=document.createElement("tr"),mxLog.td=document.createElement("td"),mxLog.td.style.verticalAlign="top",mxLog.td.setAttribute("height","30px"),i.appendChild(mxLog.td),n.appendChild(i),e.appendChild(n),mxLog.addButton("Info",(function(t){mxLog.info()})),mxLog.addButton("DOM",(function(t){var e=mxUtils.getInnerHtml(document.body);mxLog.debug(e)})),mxLog.addButton("Trace",(function(t){mxLog.TRACE=!mxLog.TRACE,mxLog.TRACE?mxLog.debug("Tracing enabled"):mxLog.debug("Tracing disabled")})),mxLog.addButton("Copy",(function(t){try{mxUtils.copy(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Show",(function(t){try{mxUtils.popup(mxLog.textarea.value)}catch(t){mxUtils.alert(t)}})),mxLog.addButton("Clear",(function(t){mxLog.textarea.value=""}));var r=0,o=0;if("number"==typeof window.innerWidth?(r=window.innerHeight,o=window.innerWidth):(r=document.documentElement.clientHeight||document.body.clientHeight,o=document.body.clientWidth),mxLog.window=new mxWindow(t,e,Math.max(0,o-320),Math.max(0,r-210),300,160),mxLog.window.setMaximizable(!0),mxLog.window.setScrollable(!1),mxLog.window.setResizable(!0),mxLog.window.setClosable(!0),mxLog.window.destroyOnClose=!1,(mxClient.IS_NS||mxClient.IS_IE)&&!mxClient.IS_GC&&!mxClient.IS_SF&&"BackCompat"!=document.compatMode||11==document.documentMode){var l=mxLog.window.getElement(),a=function(t,e){mxLog.textarea.style.height=Math.max(0,l.offsetHeight-70)+"px"};mxLog.window.addListener(mxEvent.RESIZE_END,a),mxLog.window.addListener(mxEvent.MAXIMIZE,a),mxLog.window.addListener(mxEvent.NORMALIZE,a),mxLog.textarea.style.height="92px"}}},info:function(){mxLog.writeln(mxUtils.toString(navigator))},addButton:function(t,e){var n=document.createElement("button");mxUtils.write(n,t),mxEvent.addListener(n,"click",e),mxLog.td.appendChild(n)},isVisible:function(){return null!=mxLog.window&&mxLog.window.isVisible()},show:function(){mxLog.setVisible(!0)},setVisible:function(t){null==mxLog.window&&mxLog.init(),null!=mxLog.window&&mxLog.window.setVisible(t)},enter:function(t){if(mxLog.TRACE)return mxLog.writeln("Entering "+t),(new Date).getTime()},leave:function(t,e){if(mxLog.TRACE){var n=0!=e?" ("+((new Date).getTime()-e)+" ms)":"";mxLog.writeln("Leaving "+t+n)}},debug:function(){mxLog.DEBUG&&mxLog.writeln.apply(this,arguments)},warn:function(){mxLog.WARN&&mxLog.writeln.apply(this,arguments)},write:function(){for(var t="",e=0;e=0&&(mxLog.textarea.style.visibility="hidden",mxLog.textarea.style.visibility="visible"),mxLog.textarea.scrollTop=mxLog.textarea.scrollHeight):mxLog.buffer+=t},writeln:function(){for(var t="",e=0;e=0},getDefaultBundle:function(t,e){return mxResources.loadDefaultBundle||!mxResources.isLanguageSupported(e)?t+mxResources.extension:null},getSpecialBundle:function(t,e){if(null==mxClient.languages||!this.isLanguageSupported(e)){var n=e.indexOf("-");n>0&&(e=e.substring(0,n))}return mxResources.loadSpecialBundle&&mxResources.isLanguageSupported(e)&&e!=mxClient.defaultLanguage?t+"_"+e+mxResources.extension:null},add:function(t,e,n){if((e=null!=e?e:null!=mxClient.language?mxClient.language.toLowerCase():mxConstants.NONE)!=mxConstants.NONE){var i=mxResources.getDefaultBundle(t,e),s=mxResources.getSpecialBundle(t,e),r=function(){if(null!=s)if(n)mxUtils.get(s,(function(t){mxResources.parse(t.getText()),n()}),(function(){n()}));else try{var t=mxUtils.load(s);t.isReady()&&mxResources.parse(t.getText())}catch(t){}else null!=n&&n()};if(null!=i)if(n)mxUtils.get(i,(function(t){mxResources.parse(t.getText()),r()}),(function(){r()}));else try{var o=mxUtils.load(i);o.isReady()&&mxResources.parse(o.getText()),r()}catch(t){}else r()}},parse:function(t){if(null!=t)for(var e=t.split("\n"),n=0;n0){var s=e[n].substring(0,i),r=e[n].length;13==e[n].charCodeAt(r-1)&&r--;var o=e[n].substring(i+1,r);this.resourcesEncoded?(o=o.replace(/\\(?=u[a-fA-F\d]{4})/g,"%"),mxResources.resources[s]=unescape(o)):mxResources.resources[s]=o}}},get:function(t,e,n){var i=mxResources.resources[t];return null==i&&(i=n),null!=i&&null!=e&&(i=mxResources.replacePlaceholders(i,e)),i},replacePlaceholders:function(t,e){for(var n=[],i=null,s=0;s=0&&i0?window.setTimeout(l,s):(t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t))};window.setTimeout(l,s)}else t.style.visibility="hidden",n&&t.parentNode&&t.parentNode.removeChild(t)}};__mxOutput.mxEffects=void 0!==mxEffects?mxEffects:void 0;var mxUtils={errorResource:"none"!=mxClient.language?"error":"",closeResource:"none"!=mxClient.language?"close":"",errorImage:mxClient.imageBasePath+"/error.gif",removeCursors:function(t){null!=t.style&&(t.style.cursor="");var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i=9&&document.documentMode<10&&(prefix="ms"),function(t,e,n){t[e]=n,null!=prefix&&e.length>0&&(t[e=prefix+e.substring(0,1).toUpperCase()+e.substring(1)]=n)}),hasScrollbars:function(t){var e=mxUtils.getCurrentStyle(t);return null!=e&&("scroll"==e.overflow||"auto"==e.overflow)},bind:function(t,e){return function(){return e.apply(t,arguments)}},eval:function(expr){var result=null;if(expr.indexOf("function")>=0)try{eval("var _mxJavaScriptExpression="+expr),result=_mxJavaScriptExpression,_mxJavaScriptExpression=null}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}else try{result=eval(expr)}catch(t){mxLog.warn(t.message+" while evaluating "+expr)}return result},findNode:function(t,e,n){if(t.nodeType==mxConstants.NODETYPE_ELEMENT){var i=t.getAttribute(e);if(null!=i&&i==n)return t}for(t=t.firstChild;null!=t;){var s=mxUtils.findNode(t,e,n);if(null!=s)return s;t=t.nextSibling}return null},getFunctionName:function(t){var e=null;if(null!=t)if(null!=t.name)e=t.name;else if(e=mxUtils.trim(t.toString()),/^function\s/.test(e)){var n=(e=mxUtils.ltrim(e.substring(9))).indexOf("(");n>0&&(e=e.substring(0,n))}return e},indexOf:function(t,e){if(null!=t&&null!=e)for(var n=0;n=0;)e.splice(i,1),n=t,i=mxUtils.indexOf(e,t);for(var s in e)e[s]==t&&(delete e[s],n=t);return n},isNode:function(t,e,n,i){return!(null==t||isNaN(t.nodeType)||null!=e&&t.nodeName.toLowerCase()!=e.toLowerCase())&&(null==n||t.getAttribute(n)==i)},isAncestorNode:function(t,e){for(var n=e;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},getChildNodes:function(t,e){e=e||mxConstants.NODETYPE_ELEMENT;for(var n=[],i=t.firstChild;null!=i;)i.nodeType==e&&n.push(i),i=i.nextSibling;return n},importNode:function(t,e,n){return mxClient.IS_IE&&(null==document.documentMode||document.documentMode<10)?mxUtils.importNodeImplementation(t,e,n):t.importNode(e,n)},importNodeImplementation:function(t,e,n){switch(e.nodeType){case 1:var i=t.createElement(e.nodeName);if(e.attributes&&e.attributes.length>0)for(var s=0;s0)for(s=0;s/g,">"),(null==e||e)&&(t=t.replace(/\n/g," ")),t},isVml:function(t){return null!=t&&"urn:schemas-microsoft-com:vml"==t.tagUrn},getXml:function(t,e){var n="";if(mxClient.IS_IE||mxClient.IS_IE11)n=mxUtils.getPrettyXml(t,"","","");else if(null!=window.XMLSerializer){n=(new XMLSerializer).serializeToString(t)}else null!=t.xml&&(n=t.xml.replace(/\r\n\t[\t]*/g,"").replace(/>\r\n/g,">").replace(/\r\n/g,"\n"));return e=e||" ",n=n.replace(/\n/g,e)},getPrettyXml:function(t,e,n,i,s){var r=[];if(null!=t)if(e=null!=e?e:" ",n=null!=n?n:"",i=null!=i?i:"\n",null!=t.namespaceURI&&t.namespaceURI!=s&&(s=t.namespaceURI,null==t.getAttribute("xmlns")&&t.setAttribute("xmlns",t.namespaceURI)),t.nodeType==mxConstants.NODETYPE_DOCUMENT)r.push(mxUtils.getPrettyXml(t.documentElement,e,n,i,s));else if(t.nodeType==mxConstants.NODETYPE_DOCUMENT_FRAGMENT){if(null!=(l=t.firstChild))for(;null!=l;)r.push(mxUtils.getPrettyXml(l,e,n,i,s)),l=l.nextSibling}else if(t.nodeType==mxConstants.NODETYPE_COMMENT){(o=mxUtils.getTextContent(t)).length>0&&r.push(n+"\x3c!--"+o+"--\x3e"+i)}else if(t.nodeType==mxConstants.NODETYPE_TEXT){(o=mxUtils.trim(mxUtils.getTextContent(t))).length>0&&r.push(n+mxUtils.htmlEntities(o,!1)+i)}else if(t.nodeType==mxConstants.NODETYPE_CDATA){var o;(o=mxUtils.getTextContent(t)).length>0&&r.push(n+""+i);null!=l;)r.push(mxUtils.getPrettyXml(l,e,n+e,i,s)),l=l.nextSibling;r.push(n+""+i)}else r.push(" />"+i)}return r.join("")},extractTextWithWhitespace:function(t){var e=["BLOCKQUOTE","DIV","H1","H2","H3","H4","H5","H6","OL","P","PRE","TABLE","UL"],n=[];return function t(i){if(1!=i.length||"BR"!=i[0].nodeName&&"\n"!=i[0].innerHTML)for(var s=0;s"==r.innerHTML.toLowerCase()?n.push("\n"):(3===r.nodeType||4===r.nodeType?r.nodeValue.length>0&&n.push(r.nodeValue):8!==r.nodeType&&r.childNodes.length>0&&t(r.childNodes),s=0&&n.push("\n"))}}(t),n.join("")},replaceTrailingNewlines:function(t,e){for(var n="";t.length>0&&"\n"==t.charAt(t.length-1);)t=t.substring(0,t.length-1),n+=e;return t+n},getTextContent:function(t){return mxClient.IS_IE&&void 0!==t.innerText?t.innerText:null!=t?t[void 0===t.textContent?"text":"textContent"]:""},setTextContent:function(t,e){void 0!==t.innerText?t.innerText=e:t[void 0===t.textContent?"text":"textContent"]=e},getInnerHtml:mxClient.IS_IE?function(t){return null!=t?t.innerHTML:""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},getOuterHtml:mxClient.IS_IE?function(t){if(null!=t){if(null!=t.outerHTML)return t.outerHTML;var e=[];e.push("<"+t.nodeName);var n=t.attributes;if(null!=n)for(var i=0;i0&&(e.push(" "),e.push(n[i].nodeName),e.push('="'),e.push(s),e.push('"'))}return 0==t.innerHTML.length?e.push("/>"):(e.push(">"),e.push(t.innerHTML),e.push("")),e.join("")}return""}:function(t){return null!=t?(new XMLSerializer).serializeToString(t):""},write:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&t.appendChild(n),n},writeln:function(t,e){var n=t.ownerDocument.createTextNode(e);return null!=t&&(t.appendChild(n),t.appendChild(document.createElement("br"))),n},br:function(t,e){e=e||1;for(var n=null,i=0;il&&(t.style.left=Math.max(r,l-i)+"px");var a=parseInt(t.offsetTop),h=parseInt(t.offsetHeight),u=o+e.height;a+h>u&&(t.style.top=Math.max(o,u-h)+"px")},load:function(t){var e=new mxXmlRequest(t,null,"GET",!1);return e.send(),e},get:function(t,e,n,i,s,r,o){var l=new mxXmlRequest(t,null,"GET"),a=l.setRequestHeaders;return o&&(l.setRequestHeaders=function(t,e){for(var n in a.apply(this,arguments),o)t.setRequestHeader(n,o[n])}),null!=i&&l.setBinary(i),l.send(e,n,s,r),l},getAll:function(t,e,n){for(var i=t.length,s=[],r=0,o=function(){0==r&&null!=n&&n(),r++},l=0;l299?o():(s[n]=t,0==--i&&e(s))}),o)}(t[l],l);0==i&&e(s)},post:function(t,e,n,i){return new mxXmlRequest(t,e).send(n,i)},submit:function(t,e,n,i){return new mxXmlRequest(t,e).simulate(n,i)},loadInto:function(t,e,n){mxClient.IS_IE?e.onreadystatechange=function(){4==e.readyState&&n()}:e.addEventListener("load",n,!1),e.load(t)},getValue:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n),i},getNumber:function(t,e,n){var i=null!=t?t[e]:null;return null==i&&(i=n||0),Number(i)},getColor:function(t,e,n){var i=null!=t?t[e]:null;return null==i?i=n:i==mxConstants.NONE&&(i=null),i},clone:function(t,e,n){n=null!=n&&n;var i=null;if(null!=t&&"function"==typeof t.constructor)for(var s in i=new t.constructor,t)s!=mxObjectIdentity.FIELD_NAME&&(null==e||mxUtils.indexOf(e,s)<0)&&(n||"object"!=typeof t[s]?i[s]=t[s]:i[s]=mxUtils.clone(t[s]));return i},equalPoints:function(t,e){if(null==t&&null!=e||null!=t&&null==e||null!=t&&null!=e&&t.length!=e.length)return!1;if(null!=t&&null!=e)for(var n=0;n [Function]\n";else if("object"==typeof t[n]){e+=n+" => ["+mxUtils.getFunctionName(t[n].constructor)+"]\n"}else e+=n+" = "+t[n]+"\n"}catch(t){e+=n+"="+t.message}return e},toRadians:function(t){return Math.PI*t/180},toDegree:function(t){return 180*t/Math.PI},arcToCurves:function(t,e,n,i,s,r,o,l,a){if(l-=t,a-=e,0===n||0===i)return z;var h=o,u=s;n=Math.abs(n),i=Math.abs(i);var d,p=-l/2,m=-a/2,c=Math.cos(u*Math.PI/180),g=Math.sin(u*Math.PI/180),x=c*p+g*m,y=-1*g*p+c*m,f=x*x,v=y*y,C=n*n,E=i*i,S=f/C+v/E;if(S>1)n=Math.sqrt(S)*n,i=Math.sqrt(S)*i,d=0;else{var b=1;r===h&&(b=-1),d=b*Math.sqrt((C*E-C*v-E*f)/(C*v+E*f))}var T=d*n*y/i,w=-1*d*i*x/n,L=c*T-g*w+l/2,O=g*T+c*w+a/2,I=Math.atan2((y-w)/i,(x-T)/n)-Math.atan2(0,1),A=I>=0?I:2*Math.PI+I,P=(I=Math.atan2((-y-w)/i,(-x-T)/n)-Math.atan2((y-w)/i,(x-T)/n))>=0?I:2*Math.PI+I;0==h&&P>0?P-=2*Math.PI:0!=h&&P<0&&(P+=2*Math.PI);for(var _=2*P/Math.PI,R=Math.ceil(_<0?-1*_:_),M=P/R,N=8/3*Math.sin(M/4)*Math.sin(M/4)/Math.sin(M/2),H=c*n,D=c*i,G=g*n,U=g*i,V=Math.cos(A),B=Math.sin(A),F=-N*(H*B+U*V),k=-N*(G*B-D*V),Y=0,j=0,z=[],W=0;W45?(a=1,l>=135&&(a=2)):l<-45&&(a=3,l<=-135&&(a=2)),r.indexOf(mxConstants.DIRECTION_NORTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 1:o|=mxConstants.DIRECTION_MASK_EAST;break;case 2:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 3:o|=mxConstants.DIRECTION_MASK_WEST}if(r.indexOf(mxConstants.DIRECTION_WEST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_WEST;break;case 1:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 2:o|=mxConstants.DIRECTION_MASK_EAST;break;case 3:o|=mxConstants.DIRECTION_MASK_SOUTH}if(r.indexOf(mxConstants.DIRECTION_SOUTH)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 1:o|=mxConstants.DIRECTION_MASK_WEST;break;case 2:o|=mxConstants.DIRECTION_MASK_NORTH;break;case 3:o|=mxConstants.DIRECTION_MASK_EAST}if(r.indexOf(mxConstants.DIRECTION_EAST)>=0)switch(a){case 0:o|=mxConstants.DIRECTION_MASK_EAST;break;case 1:o|=mxConstants.DIRECTION_MASK_SOUTH;break;case 2:o|=mxConstants.DIRECTION_MASK_WEST;break;case 3:o|=mxConstants.DIRECTION_MASK_NORTH}return o},reversePortConstraints:function(t){var e=0;return e=(t&mxConstants.DIRECTION_MASK_WEST)<<3,e|=(t&mxConstants.DIRECTION_MASK_NORTH)<<1,e|=(t&mxConstants.DIRECTION_MASK_SOUTH)>>1,e|=(t&mxConstants.DIRECTION_MASK_EAST)>>3},findNearestSegment:function(t,e,n){var i=-1;if(t.absolutePoints.length>0)for(var s=t.absolutePoints[0],r=null,o=1;oa.distSq)&&(i=a)}}return null!=i?i.p:null},rectangleIntersectsSegment:function(t,e,n){var i=t.y,s=t.x,r=i+t.height,o=s+t.width,l=e.x,a=n.x;if(e.x>n.x&&(l=n.x,a=e.x),a>o&&(a=o),la)return!1;var h=e.y,u=n.y,d=n.x-e.x;if(Math.abs(d)>1e-7){var p=(n.y-e.y)/d,m=e.y-p*e.x;h=p*l+m,u=p*a+m}if(h>u){var c=u;u=h,h=c}return u>r&&(u=r),hu)},contains:function(t,e,n){return t.x<=e&&t.x+t.width>=e&&t.y<=n&&t.y+t.height>=n},intersects:function(t,e){var n=t.width,i=t.height,s=e.width,r=e.height;if(s<=0||r<=0||n<=0||i<=0)return!1;var o=t.x,l=t.y,a=e.x,h=e.y;return r+=h,n+=o,i+=l,((s+=a)o)&&(rl)&&(na)&&(ih)},intersectsHotspot:function(t,e,n,i,s,r){if(s=null!=s?s:0,r=null!=r?r:0,(i=null!=i?i:1)>0){var o=t.getCenterX(),l=t.getCenterY(),a=t.width,h=t.height,u=mxUtils.getValue(t.style,mxConstants.STYLE_STARTSIZE)*t.view.scale;u>0&&(mxUtils.getValue(t.style,mxConstants.STYLE_HORIZONTAL,!0)?(l=t.y+u/2,h=u):(o=t.x+u/2,a=u)),a=Math.max(s,a*i),h=Math.max(s,h*i),r>0&&(a=Math.min(a,r),h=Math.min(h,r));var d=new mxRectangle(o-a/2,l-h/2,a,h),p=mxUtils.toRadians(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION)||0);if(0!=p){var m=Math.cos(-p),c=Math.sin(-p),g=(o=new mxPoint(t.getCenterX(),t.getCenterY()),mxUtils.getRotatedPoint(new mxPoint(e,n),m,c,o));e=g.x,n=g.y}return mxUtils.contains(d,e,n)}return!0},getOffset:function(t,e){for(var n=0,i=0,s=!1,r=t,o=document.body,l=document.documentElement;null!=r&&r!=o&&r!=l&&!s;){var a=mxUtils.getCurrentStyle(r);null!=a&&(s=s||"fixed"==a.position),r=r.parentNode}if(!e&&!s){var h=mxUtils.getDocumentScrollOrigin(t.ownerDocument);n+=h.x,i+=h.y}var u=t.getBoundingClientRect();return null!=u&&(n+=u.left,i+=u.top),new mxPoint(n,i)},getDocumentScrollOrigin:function(t){if(mxClient.IS_QUIRKS)return new mxPoint(t.body.scrollLeft,t.body.scrollTop);var e=t.defaultView||t.parentWindow;return new mxPoint(null!=e&&void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,null!=e&&void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)},getScrollOrigin:function(t,e,n){e=null!=e&&e,n=null==n||n;for(var i=null!=t?t.ownerDocument:document,s=i.body,r=i.documentElement,o=new mxPoint,l=!1;null!=t&&t!=s&&t!=r;){isNaN(t.scrollLeft)||isNaN(t.scrollTop)||(o.x+=t.scrollLeft,o.y+=t.scrollTop);var a=mxUtils.getCurrentStyle(t);null!=a&&(l=l||"fixed"==a.position),t=e?t.parentNode:null}if(!l&&n){var h=mxUtils.getDocumentScrollOrigin(i);o.x+=h.x,o.y+=h.y}return o},convertPoint:function(t,e,n){var i=mxUtils.getScrollOrigin(t,!1),s=mxUtils.getOffset(t);return s.x-=i.x,s.y-=i.y,new mxPoint(e-s.x,n-s.y)},ltrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("^["+e+"]+","g"),""):null},rtrim:function(t,e){return e=e||"\\s",null!=t?t.replace(new RegExp("["+e+"]+$","g"),""):null},trim:function(t,e){return mxUtils.ltrim(mxUtils.rtrim(t,e),e)},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)&&("string"!=typeof t||t.toLowerCase().indexOf("0x")<0)},isInteger:function(t){return String(parseInt(t))===String(t)},mod:function(t,e){return(t%e+e)%e},intersection:function(t,e,n,i,s,r,o,l){var a=(l-r)*(n-t)-(o-s)*(i-e),h=((o-s)*(e-r)-(l-r)*(t-s))/a,u=((n-t)*(e-r)-(i-e)*(t-s))/a;return h>=0&&h<=1&&u>=0&&u<=1?new mxPoint(t+h*(n-t),e+h*(i-e)):null},ptSegDistSq:function(t,e,n,i,s,r){var o,l=(s-=t)*(n-=t)+(r-=e)*(i-=e);o=l<=0||(l=(s=n-s)*n+(r=i-r)*i)<=0?0:l*l/(n*n+i*i);var a=s*s+r*r-o;return a<0&&(a=0),a},ptLineDist:function(t,e,n,i,s,r){return Math.abs((i-e)*s-(n-t)*r+n*e-i*t)/Math.sqrt((i-e)*(i-e)+(n-t)*(n-t))},relativeCcw:function(t,e,n,i,s,r){var o=(s-=t)*(i-=e)-(r-=e)*(n-=t);return 0==o&&(o=s*n+r*i)>0&&(o=(s-=n)*n+(r-=i)*i)<0&&(o=0),o<0?-1:o>0?1:0},animateChanges:function(t,e){mxEffects.animateChanges.apply(this,arguments)},cascadeOpacity:function(t,e,n){mxEffects.cascadeOpacity.apply(this,arguments)},fadeOut:function(t,e,n,i,s,r){mxEffects.fadeOut.apply(this,arguments)},setOpacity:function(t,e){mxUtils.isVml(t)?t.style.filter=e>=100?"":"alpha(opacity="+e/5+")":mxClient.IS_IE&&(void 0===document.documentMode||document.documentMode<9)?t.style.filter=e>=100?"":"alpha(opacity="+e+")":t.style.opacity=e/100},createImage:function(t){var e=null;return mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?((e=document.createElement(mxClient.VML_PREFIX+":image")).setAttribute("src",t),e.style.borderStyle="none"):((e=document.createElement("img")).setAttribute("src",t),e.setAttribute("border","0")),e},sortCells:function(t,e){e=null==e||e;var n=new mxDictionary;return t.sort((function(t,i){var s=n.get(t);null==s&&(s=mxCellPath.create(t).split(mxCellPath.PATH_SEPARATOR),n.put(t,s));var r=n.get(i);null==r&&(r=mxCellPath.create(i).split(mxCellPath.PATH_SEPARATOR),n.put(i,r));var o=mxCellPath.compare(s,r);return 0==o?0:o>0==e?1:-1})),t},getStylename:function(t){if(null!=t){var e=t.split(";")[0];if(e.indexOf("=")<0)return e}return""},getStylenames:function(t){var e=[];if(null!=t)for(var n=t.split(";"),i=0;i0&&";"!=t.charAt(t.length-1)&&(t+=";"),t+=e),t},removeStylename:function(t,e){var n=[];if(null!=t)for(var i=t.split(";"),s=0;s=0&&e.push(n[i]);return e.join(";")},setCellStyles:function(t,e,n,i){if(null!=e&&e.length>0){t.beginUpdate();try{for(var s=0;s0);if(null==t||0==t.length)i&&(t=e+"="+n+";");else if(t.substring(0,e.length+1)==e+"="){var s=t.indexOf(";");t=i?e+"="+n+(s<0?";":t.substring(s)):s<0||s==t.length-1?"":t.substring(s+1)}else{var r=t.indexOf(";"+e+"=");if(r<0){if(i){var o=";"==t.charAt(t.length-1)?"":";";t=t+o+e+"="+n+";"}}else{s=t.indexOf(";",r+1);t=i?t.substring(0,r+1)+e+"="+n+(s<0?";":t.substring(s)):t.substring(0,r)+(s<0?";":t.substring(s))}}return t},setCellStyleFlags:function(t,e,n,i,s){if(null!=e&&e.length>0){t.beginUpdate();try{for(var r=0;r=0?t.substring(o):"")}}return t},getAlignmentAsPoint:function(t,e){var n=-.5,i=-.5;return t==mxConstants.ALIGN_LEFT?n=0:t==mxConstants.ALIGN_RIGHT&&(n=-1),e==mxConstants.ALIGN_TOP?i=0:e==mxConstants.ALIGN_BOTTOM&&(i=-1),new mxPoint(n,i)},getSizeForString:function(t,e,n,i,s){e=null!=e?e:mxConstants.DEFAULT_FONTSIZE,n=null!=n?n:mxConstants.DEFAULT_FONTFAMILY;var r=document.createElement("div");if(r.style.fontFamily=n,r.style.fontSize=Math.round(e)+"px",r.style.lineHeight=Math.round(e*mxConstants.LINE_HEIGHT)+"px",null!=s){(s&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(r.style.fontWeight="bold"),(s&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(r.style.fontStyle="italic");var o=[];(s&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&o.push("underline"),(s&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&o.push("line-through"),o.length>0&&(r.style.textDecoration=o.join(" "))}r.style.position="absolute",r.style.visibility="hidden",r.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",r.style.zoom="1",null!=i?(r.style.width=i+"px",r.style.whiteSpace="normal"):r.style.whiteSpace="nowrap",r.innerHTML=t,document.body.appendChild(r);var l=new mxRectangle(0,0,r.offsetWidth,r.offsetHeight);return document.body.removeChild(r),l},getViewXml:function(t,e,n,i,s){(i=null!=i?i:0,s=null!=s?s:0,e=null!=e?e:1,null==n)&&(n=[t.getModel().getRoot()]);var r=t.getView(),o=null,l=r.isEventsEnabled();r.setEventsEnabled(!1);var a=r.drawPane,h=r.overlayPane;t.dialect==mxConstants.DIALECT_SVG?(r.drawPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.drawPane),r.overlayPane=document.createElementNS(mxConstants.NS_SVG,"g"),r.canvas.appendChild(r.overlayPane)):(r.drawPane=r.drawPane.cloneNode(!1),r.canvas.appendChild(r.drawPane),r.overlayPane=r.overlayPane.cloneNode(!1),r.canvas.appendChild(r.overlayPane));var u=r.getTranslate();r.translate=new mxPoint(i,s);var d=new mxTemporaryCellStates(t.getView(),e,n);try{o=(new mxCodec).encode(t.getView())}finally{d.destroy(),r.translate=u,r.canvas.removeChild(r.drawPane),r.canvas.removeChild(r.overlayPane),r.drawPane=a,r.overlayPane=h,r.setEventsEnabled(l)}return o},getScaleForPageCount:function(t,e,n,i){if(t<1)return 1;i=null!=i?i:0;var s=(n=null!=n?n:mxConstants.PAGE_FORMAT_A4_PORTRAIT).width-2*i,r=n.height-2*i,o=e.getGraphBounds().clone(),l=e.getView().getScale();o.width/=l,o.height/=l;var a=o.width,h=a/o.height/(s/r),u=Math.sqrt(t),d=Math.sqrt(h),p=u*d,m=u/d;if(p<1&&m>t){var c=m/t;m=t,p/=c}if(m<1&&p>t){c=p/t;p=t,m/=c}for(var g=Math.ceil(p)*Math.ceil(m),x=0;g>t;){var y=Math.floor(p)/p,f=Math.floor(m)/m;1==y&&(y=Math.floor(p-1)/p),1==f&&(f=Math.floor(m-1)/m);c=1;if(p*=c=y>f?y:f,m*=c,g=Math.ceil(p)*Math.ceil(m),++x>10)break}return.99999*(s*p/a)},show:function(t,e,n,i,s,r){(n=null!=n?n:0,i=null!=i?i:0,null==e)?e=window.open().document:e.open();9==document.documentMode&&e.writeln('\x3c!--[if IE]>",u=document.getElementsByTagName("base"),d=0;d";for(d=0;d ',h+='
',h+=t.container.innerHTML,h+="
",e.writeln(h),e.close()}else{e.writeln("");for(u=document.getElementsByTagName("base"),d=0;d .commit-tease, .user-profile-mini-avatar, .avatar, .vcard-details, .signup-prompt-bg { display: none !IMPORTANT; } '),e.close();var c=e.createElement("div");c.position="absolute",c.overflow="hidden",c.style.width=s+"px",c.style.height=r+"px";var g=e.createElement("div");g.style.position="absolute",g.style.left=l+"px",g.style.top=a+"px";for(var x=t.container.firstChild,y=null;null!=x;){var f=x.cloneNode(!0);x==t.view.drawPane.ownerSVGElement?(c.appendChild(f),y=f):g.appendChild(f),x=x.nextSibling}e.body.appendChild(c),null!=g.firstChild&&e.body.appendChild(g),null!=y&&(y.style.minWidth="",y.style.minHeight="",y.firstChild.setAttribute("transform","translate("+l+","+a+")"))}return mxUtils.removeCursors(e.body),e},printScreen:function(t){var e=window.open();t.getGraphBounds(),mxUtils.show(t,e.document);var n=function(){e.focus(),e.print(),e.close()};mxClient.IS_GC?e.setTimeout(n,500):n()},popup:function(t,e){if(e){var n=document.createElement("div");n.style.overflow="scroll",n.style.width="636px",n.style.height="460px",(s=document.createElement("pre")).innerHTML=mxUtils.htmlEntities(t,!1).replace(/\n/g,"
").replace(/ /g," "),n.appendChild(s),(i=new mxWindow("Popup Window",n,document.body.clientWidth/2-320,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight)/2-240,640,480,!1,!0)).setClosable(!0),i.setVisible(!0)}else{var i,s;if(mxClient.IS_NS)(i=window.open()).document.writeln("
"+mxUtils.htmlEntities(t)+"").replace(/ /g," "),i.document.body.appendChild(s)}},alert:function(t){alert(t)},prompt:function(t,e){return prompt(t,null!=e?e:"")},confirm:function(t){return confirm(t)},error:function(t,e,n,i){var s=document.createElement("div");s.style.padding="20px";var r=document.createElement("img");r.setAttribute("src",i||mxUtils.errorImage),r.setAttribute("valign","bottom"),r.style.verticalAlign="middle",s.appendChild(r),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),s.appendChild(document.createTextNode(" ")),mxUtils.write(s,t);var o=document.body.clientWidth,l=document.body.clientHeight||document.documentElement.clientHeight,a=new mxWindow(mxResources.get(mxUtils.errorResource)||mxUtils.errorResource,s,(o-e)/2,l/4,e,null,!1,!0);if(n){mxUtils.br(s);var h=document.createElement("p"),u=document.createElement("button");mxClient.IS_IE?u.style.cssText="float:right":u.setAttribute("style","float:right"),mxEvent.addListener(u,"click",(function(t){a.destroy()})),mxUtils.write(u,mxResources.get(mxUtils.closeResource)||mxUtils.closeResource),h.appendChild(u),s.appendChild(h),mxUtils.br(s),a.setClosable(!0)}return a.setVisible(!0),a},makeDraggable:function(t,e,n,i,s,r,o,l,a,h){var u=new mxDragSource(t,n);return u.dragOffset=new mxPoint(null!=s?s:0,null!=r?r:mxConstants.TOOLTIP_VERTICAL_OFFSET),u.autoscroll=o,u.setGuidesEnabled(!1),null!=a&&(u.highlightDropTargets=a),null!=h&&(u.getDropTarget=h),u.getGraphForEvent=function(t){return"function"==typeof e?e(t):e},null!=i&&(u.createDragElement=function(){return i.cloneNode(!0)},l&&(u.createPreviewElement=function(t){var e=i.cloneNode(!0),n=parseInt(e.style.width),s=parseInt(e.style.height);return e.style.width=Math.round(n*t.view.scale)+"px",e.style.height=Math.round(s*t.view.scale)+"px",e})),u}},prefix;__mxOutput.mxUtils=void 0!==mxUtils?mxUtils:void 0;var mxConstants={DEFAULT_HOTSPOT:.3,MIN_HOTSPOT_SIZE:8,MAX_HOTSPOT_SIZE:0,RENDERING_HINT_EXACT:"exact",RENDERING_HINT_FASTER:"faster",RENDERING_HINT_FASTEST:"fastest",DIALECT_SVG:"svg",DIALECT_VML:"vml",DIALECT_MIXEDHTML:"mixedHtml",DIALECT_PREFERHTML:"preferHtml",DIALECT_STRICTHTML:"strictHtml",NS_SVG:"http://www.w3.org/2000/svg",NS_XHTML:"http://www.w3.org/1999/xhtml",NS_XLINK:"http://www.w3.org/1999/xlink",SHADOWCOLOR:"gray",VML_SHADOWCOLOR:"gray",SHADOW_OFFSET_X:2,SHADOW_OFFSET_Y:3,SHADOW_OPACITY:1,NODETYPE_ELEMENT:1,NODETYPE_ATTRIBUTE:2,NODETYPE_TEXT:3,NODETYPE_CDATA:4,NODETYPE_ENTITY_REFERENCE:5,NODETYPE_ENTITY:6,NODETYPE_PROCESSING_INSTRUCTION:7,NODETYPE_COMMENT:8,NODETYPE_DOCUMENT:9,NODETYPE_DOCUMENTTYPE:10,NODETYPE_DOCUMENT_FRAGMENT:11,NODETYPE_NOTATION:12,TOOLTIP_VERTICAL_OFFSET:16,DEFAULT_VALID_COLOR:"#00FF00",DEFAULT_INVALID_COLOR:"#FF0000",OUTLINE_HIGHLIGHT_COLOR:"#00FF00",OUTLINE_HIGHLIGHT_STROKEWIDTH:5,HIGHLIGHT_STROKEWIDTH:3,HIGHLIGHT_SIZE:2,HIGHLIGHT_OPACITY:100,CURSOR_MOVABLE_VERTEX:"move",CURSOR_MOVABLE_EDGE:"move",CURSOR_LABEL_HANDLE:"default",CURSOR_TERMINAL_HANDLE:"pointer",CURSOR_BEND_HANDLE:"crosshair",CURSOR_VIRTUAL_BEND_HANDLE:"crosshair",CURSOR_CONNECT:"pointer",HIGHLIGHT_COLOR:"#00FF00",CONNECT_TARGET_COLOR:"#0000FF",INVALID_CONNECT_TARGET_COLOR:"#FF0000",DROP_TARGET_COLOR:"#0000FF",VALID_COLOR:"#00FF00",INVALID_COLOR:"#FF0000",EDGE_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_COLOR:"#00FF00",VERTEX_SELECTION_STROKEWIDTH:1,EDGE_SELECTION_STROKEWIDTH:1,VERTEX_SELECTION_DASHED:!0,EDGE_SELECTION_DASHED:!0,GUIDE_COLOR:"#FF0000",GUIDE_STROKEWIDTH:1,OUTLINE_COLOR:"#0099FF",OUTLINE_STROKEWIDTH:mxClient.IS_IE?2:3,HANDLE_SIZE:6,LABEL_HANDLE_SIZE:4,HANDLE_FILLCOLOR:"#00FF00",HANDLE_STROKECOLOR:"black",LABEL_HANDLE_FILLCOLOR:"yellow",CONNECT_HANDLE_FILLCOLOR:"#0000FF",LOCKED_HANDLE_FILLCOLOR:"#FF0000",OUTLINE_HANDLE_FILLCOLOR:"#00FFFF",OUTLINE_HANDLE_STROKECOLOR:"#0033FF",DEFAULT_FONTFAMILY:"Arial,Helvetica",DEFAULT_FONTSIZE:11,DEFAULT_TEXT_DIRECTION:"",LINE_HEIGHT:1.2,WORD_WRAP:"normal",ABSOLUTE_LINE_HEIGHT:!1,DEFAULT_FONTSTYLE:0,DEFAULT_STARTSIZE:40,DEFAULT_MARKERSIZE:6,DEFAULT_IMAGESIZE:24,ENTITY_SEGMENT:30,RECTANGLE_ROUNDING_FACTOR:.15,LINE_ARCSIZE:20,ARROW_SPACING:0,ARROW_WIDTH:30,ARROW_SIZE:30,PAGE_FORMAT_A4_PORTRAIT:new mxRectangle(0,0,827,1169),PAGE_FORMAT_A4_LANDSCAPE:new mxRectangle(0,0,1169,827),PAGE_FORMAT_LETTER_PORTRAIT:new mxRectangle(0,0,850,1100),PAGE_FORMAT_LETTER_LANDSCAPE:new mxRectangle(0,0,1100,850),NONE:"none",STYLE_PERIMETER:"perimeter",STYLE_SOURCE_PORT:"sourcePort",STYLE_TARGET_PORT:"targetPort",STYLE_PORT_CONSTRAINT:"portConstraint",STYLE_PORT_CONSTRAINT_ROTATION:"portConstraintRotation",STYLE_SOURCE_PORT_CONSTRAINT:"sourcePortConstraint",STYLE_TARGET_PORT_CONSTRAINT:"targetPortConstraint",STYLE_OPACITY:"opacity",STYLE_FILL_OPACITY:"fillOpacity",STYLE_STROKE_OPACITY:"strokeOpacity",STYLE_TEXT_OPACITY:"textOpacity",STYLE_TEXT_DIRECTION:"textDirection",STYLE_OVERFLOW:"overflow",STYLE_ORTHOGONAL:"orthogonal",STYLE_EXIT_X:"exitX",STYLE_EXIT_Y:"exitY",STYLE_EXIT_DX:"exitDx",STYLE_EXIT_DY:"exitDy",STYLE_EXIT_PERIMETER:"exitPerimeter",STYLE_ENTRY_X:"entryX",STYLE_ENTRY_Y:"entryY",STYLE_ENTRY_DX:"entryDx",STYLE_ENTRY_DY:"entryDy",STYLE_ENTRY_PERIMETER:"entryPerimeter",STYLE_WHITE_SPACE:"whiteSpace",STYLE_ROTATION:"rotation",STYLE_FILLCOLOR:"fillColor",STYLE_POINTER_EVENTS:"pointerEvents",STYLE_SWIMLANE_FILLCOLOR:"swimlaneFillColor",STYLE_MARGIN:"margin",STYLE_GRADIENTCOLOR:"gradientColor",STYLE_GRADIENT_DIRECTION:"gradientDirection",STYLE_STROKECOLOR:"strokeColor",STYLE_SEPARATORCOLOR:"separatorColor",STYLE_STROKEWIDTH:"strokeWidth",STYLE_ALIGN:"align",STYLE_VERTICAL_ALIGN:"verticalAlign",STYLE_LABEL_WIDTH:"labelWidth",STYLE_LABEL_POSITION:"labelPosition",STYLE_VERTICAL_LABEL_POSITION:"verticalLabelPosition",STYLE_IMAGE_ASPECT:"imageAspect",STYLE_IMAGE_ALIGN:"imageAlign",STYLE_IMAGE_VERTICAL_ALIGN:"imageVerticalAlign",STYLE_GLASS:"glass",STYLE_IMAGE:"image",STYLE_IMAGE_WIDTH:"imageWidth",STYLE_IMAGE_HEIGHT:"imageHeight",STYLE_IMAGE_BACKGROUND:"imageBackground",STYLE_IMAGE_BORDER:"imageBorder",STYLE_FLIPH:"flipH",STYLE_FLIPV:"flipV",STYLE_NOLABEL:"noLabel",STYLE_NOEDGESTYLE:"noEdgeStyle",STYLE_LABEL_BACKGROUNDCOLOR:"labelBackgroundColor",STYLE_LABEL_BORDERCOLOR:"labelBorderColor",STYLE_LABEL_PADDING:"labelPadding",STYLE_INDICATOR_SHAPE:"indicatorShape",STYLE_INDICATOR_IMAGE:"indicatorImage",STYLE_INDICATOR_COLOR:"indicatorColor",STYLE_INDICATOR_STROKECOLOR:"indicatorStrokeColor",STYLE_INDICATOR_GRADIENTCOLOR:"indicatorGradientColor",STYLE_INDICATOR_SPACING:"indicatorSpacing",STYLE_INDICATOR_WIDTH:"indicatorWidth",STYLE_INDICATOR_HEIGHT:"indicatorHeight",STYLE_INDICATOR_DIRECTION:"indicatorDirection",STYLE_SHADOW:"shadow",STYLE_SEGMENT:"segment",STYLE_ENDARROW:"endArrow",STYLE_STARTARROW:"startArrow",STYLE_ENDSIZE:"endSize",STYLE_STARTSIZE:"startSize",STYLE_SWIMLANE_LINE:"swimlaneLine",STYLE_ENDFILL:"endFill",STYLE_STARTFILL:"startFill",STYLE_DASHED:"dashed",STYLE_DASH_PATTERN:"dashPattern",STYLE_FIX_DASH:"fixDash",STYLE_ROUNDED:"rounded",STYLE_CURVED:"curved",STYLE_ARCSIZE:"arcSize",STYLE_ABSOLUTE_ARCSIZE:"absoluteArcSize",STYLE_SOURCE_PERIMETER_SPACING:"sourcePerimeterSpacing",STYLE_TARGET_PERIMETER_SPACING:"targetPerimeterSpacing",STYLE_PERIMETER_SPACING:"perimeterSpacing",STYLE_SPACING:"spacing",STYLE_SPACING_TOP:"spacingTop",STYLE_SPACING_LEFT:"spacingLeft",STYLE_SPACING_BOTTOM:"spacingBottom",STYLE_SPACING_RIGHT:"spacingRight",STYLE_HORIZONTAL:"horizontal",STYLE_DIRECTION:"direction",STYLE_ANCHOR_POINT_DIRECTION:"anchorPointDirection",STYLE_ELBOW:"elbow",STYLE_FONTCOLOR:"fontColor",STYLE_FONTFAMILY:"fontFamily",STYLE_FONTSIZE:"fontSize",STYLE_FONTSTYLE:"fontStyle",STYLE_ASPECT:"aspect",STYLE_AUTOSIZE:"autosize",STYLE_FOLDABLE:"foldable",STYLE_EDITABLE:"editable",STYLE_BACKGROUND_OUTLINE:"backgroundOutline",STYLE_BENDABLE:"bendable",STYLE_MOVABLE:"movable",STYLE_RESIZABLE:"resizable",STYLE_RESIZE_WIDTH:"resizeWidth",STYLE_RESIZE_HEIGHT:"resizeHeight",STYLE_ROTATABLE:"rotatable",STYLE_CLONEABLE:"cloneable",STYLE_DELETABLE:"deletable",STYLE_SHAPE:"shape",STYLE_EDGE:"edgeStyle",STYLE_JETTY_SIZE:"jettySize",STYLE_SOURCE_JETTY_SIZE:"sourceJettySize",STYLE_TARGET_JETTY_SIZE:"targetJettySize",STYLE_LOOP:"loopStyle",STYLE_ORTHOGONAL_LOOP:"orthogonalLoop",STYLE_ROUTING_CENTER_X:"routingCenterX",STYLE_ROUTING_CENTER_Y:"routingCenterY",FONT_BOLD:1,FONT_ITALIC:2,FONT_UNDERLINE:4,FONT_STRIKETHROUGH:8,SHAPE_RECTANGLE:"rectangle",SHAPE_ELLIPSE:"ellipse",SHAPE_DOUBLE_ELLIPSE:"doubleEllipse",SHAPE_RHOMBUS:"rhombus",SHAPE_LINE:"line",SHAPE_IMAGE:"image",SHAPE_ARROW:"arrow",SHAPE_ARROW_CONNECTOR:"arrowConnector",SHAPE_LABEL:"label",SHAPE_CYLINDER:"cylinder",SHAPE_SWIMLANE:"swimlane",SHAPE_CONNECTOR:"connector",SHAPE_ACTOR:"actor",SHAPE_CLOUD:"cloud",SHAPE_TRIANGLE:"triangle",SHAPE_HEXAGON:"hexagon",ARROW_CLASSIC:"classic",ARROW_CLASSIC_THIN:"classicThin",ARROW_BLOCK:"block",ARROW_BLOCK_THIN:"blockThin",ARROW_OPEN:"open",ARROW_OPEN_THIN:"openThin",ARROW_OVAL:"oval",ARROW_DIAMOND:"diamond",ARROW_DIAMOND_THIN:"diamondThin",ALIGN_LEFT:"left",ALIGN_CENTER:"center",ALIGN_RIGHT:"right",ALIGN_TOP:"top",ALIGN_MIDDLE:"middle",ALIGN_BOTTOM:"bottom",DIRECTION_NORTH:"north",DIRECTION_SOUTH:"south",DIRECTION_EAST:"east",DIRECTION_WEST:"west",TEXT_DIRECTION_DEFAULT:"",TEXT_DIRECTION_AUTO:"auto",TEXT_DIRECTION_LTR:"ltr",TEXT_DIRECTION_RTL:"rtl",DIRECTION_MASK_NONE:0,DIRECTION_MASK_WEST:1,DIRECTION_MASK_NORTH:2,DIRECTION_MASK_SOUTH:4,DIRECTION_MASK_EAST:8,DIRECTION_MASK_ALL:15,ELBOW_VERTICAL:"vertical",ELBOW_HORIZONTAL:"horizontal",EDGESTYLE_ELBOW:"elbowEdgeStyle",EDGESTYLE_ENTITY_RELATION:"entityRelationEdgeStyle",EDGESTYLE_LOOP:"loopEdgeStyle",EDGESTYLE_SIDETOSIDE:"sideToSideEdgeStyle",EDGESTYLE_TOPTOBOTTOM:"topToBottomEdgeStyle",EDGESTYLE_ORTHOGONAL:"orthogonalEdgeStyle",EDGESTYLE_SEGMENT:"segmentEdgeStyle",PERIMETER_ELLIPSE:"ellipsePerimeter",PERIMETER_RECTANGLE:"rectanglePerimeter",PERIMETER_RHOMBUS:"rhombusPerimeter",PERIMETER_HEXAGON:"hexagonPerimeter",PERIMETER_TRIANGLE:"trianglePerimeter"};function mxEventObject(t){this.name=t,this.properties=[];for(var e=1;e0;){var n=e[0];mxEvent.removeListener(t,n.name,n.f)}},addGestureListeners:function(t,e,n,i){null!=e&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.addListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.addListener(t,"touchstart",e),null!=n&&mxEvent.addListener(t,"touchmove",n),null!=i&&mxEvent.addListener(t,"touchend",i))},removeGestureListeners:function(t,e,n,i){null!=e&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerdown":"mousedown",e),null!=n&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointermove":"mousemove",n),null!=i&&mxEvent.removeListener(t,mxClient.IS_POINTER?"pointerup":"mouseup",i),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(null!=e&&mxEvent.removeListener(t,"touchstart",e),null!=n&&mxEvent.removeListener(t,"touchmove",n),null!=i&&mxEvent.removeListener(t,"touchend",i))},redirectMouseEvents:function(t,e,n,i,s,r,o){var l=function(t){return"function"==typeof n?n(t):n};mxEvent.addGestureListeners(t,(function(t){null!=i?i(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(t,l(t)))}),(function(t){null!=s?s(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(t,l(t)))}),(function(t){null!=r?r(t):mxEvent.isConsumed(t)||e.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(t,l(t)))})),mxEvent.addListener(t,"dblclick",(function(t){if(null!=o)o(t);else if(!mxEvent.isConsumed(t)){var n=l(t);e.dblClick(t,null!=n?n.cell:null)}}))},release:function(t){try{if(null!=t){mxEvent.removeAllListeners(t);var e=t.childNodes;if(null!=e)for(var n=e.length,i=0;i.2&&(t(e,i<0,!0),n=e.scale)})),mxEvent.addListener(e,"gestureend",(function(t){mxEvent.consume(t)}))}else{var i=[],s=0,r=0;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(t){mxEvent.isMouseEvent(t)||null==t.pointerId||i.push(t)})),mxUtils.bind(this,(function(e){if(!mxEvent.isMouseEvent(e)&&2==i.length){for(var n=0;nmxEvent.PINCH_THRESHOLD||h>mxEvent.PINCH_THRESHOLD){var u=i[0].clientX+(i[1].clientX-i[0].clientX)/2,d=i[0].clientY+(i[1].clientY-i[0].clientY)/2;t(i[0],a>h?o>s:l>r,!0,u,d),s=o,r=l}}})),mxUtils.bind(this,(function(t){i=[],s=0,r=0})))}mxEvent.addListener(e,"wheel",(function(e){null==e&&(e=window.event),e.ctrlKey&&e.preventDefault(),e.deltaY,(Math.abs(e.deltaX)>.5||Math.abs(e.deltaY)>.5)&&t(e,0==e.deltaY?-e.deltaX>0:-e.deltaY>0)}))}},disableContextMenu:function(t){mxEvent.addListener(t,"contextmenu",(function(t){return t.preventDefault&&t.preventDefault(),!1}))},getSource:function(t){return null!=t.srcElement?t.srcElement:t.target},isConsumed:function(t){return null!=t.isConsumed&&t.isConsumed},isTouchEvent:function(t){return null!=t.pointerType?"touch"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_TOUCH:null!=t.mozInputSource?5==t.mozInputSource:0==t.type.indexOf("touch")},isPenEvent:function(t){return null!=t.pointerType?"pen"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_PEN:null!=t.mozInputSource?2==t.mozInputSource:0==t.type.indexOf("pen")},isMultiTouchEvent:function(t){return null!=t.type&&0==t.type.indexOf("touch")&&null!=t.touches&&t.touches.length>1},isMouseEvent:function(t){return null!=t.pointerType?"mouse"==t.pointerType||t.pointerType===t.MSPOINTER_TYPE_MOUSE:null!=t.mozInputSource?1==t.mozInputSource:0==t.type.indexOf("mouse")},isLeftMouseButton:function(t){return!("buttons"in t)||"mousedown"!=t.type&&"mousemove"!=t.type?"which"in t?1===t.which:1===t.button:1==t.buttons},isMiddleMouseButton:function(t){return"which"in t?2===t.which:4===t.button},isRightMouseButton:function(t){return"which"in t?3===t.which:2===t.button},isPopupTrigger:function(t){return mxEvent.isRightMouseButton(t)||mxClient.IS_MAC&&mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)&&!mxEvent.isMetaDown(t)&&!mxEvent.isAltDown(t)},isShiftDown:function(t){return null!=t&&t.shiftKey},isAltDown:function(t){return null!=t&&t.altKey},isControlDown:function(t){return null!=t&&t.ctrlKey},isMetaDown:function(t){return null!=t&&t.metaKey},getMainEvent:function(t){return"touchstart"!=t.type&&"touchmove"!=t.type||null==t.touches||null==t.touches[0]?"touchend"==t.type&&null!=t.changedTouches&&null!=t.changedTouches[0]&&(t=t.changedTouches[0]):t=t.touches[0],t},getClientX:function(t){return mxEvent.getMainEvent(t).clientX},getClientY:function(t){return mxEvent.getMainEvent(t).clientY},consume:function(t,e,n){n=null==n||n,(e=null==e||e)&&(t.preventDefault?(n&&t.stopPropagation(),t.preventDefault()):n&&(t.cancelBubble=!0)),t.isConsumed=!0,t.preventDefault||(t.returnValue=!1)},LABEL_HANDLE:-1,ROTATION_HANDLE:-2,CUSTOM_HANDLE:-100,VIRTUAL_HANDLE:-1e5,MOUSE_DOWN:"mouseDown",MOUSE_MOVE:"mouseMove",MOUSE_UP:"mouseUp",ACTIVATE:"activate",RESIZE_START:"resizeStart",RESIZE:"resize",RESIZE_END:"resizeEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",PAN_START:"panStart",PAN:"pan",PAN_END:"panEnd",MINIMIZE:"minimize",NORMALIZE:"normalize",MAXIMIZE:"maximize",HIDE:"hide",SHOW:"show",CLOSE:"close",DESTROY:"destroy",REFRESH:"refresh",SIZE:"size",SELECT:"select",FIRED:"fired",FIRE_MOUSE_EVENT:"fireMouseEvent",GESTURE:"gesture",TAP_AND_HOLD:"tapAndHold",GET:"get",RECEIVE:"receive",CONNECT:"connect",DISCONNECT:"disconnect",SUSPEND:"suspend",RESUME:"resume",MARK:"mark",ROOT:"root",POST:"post",OPEN:"open",SAVE:"save",BEFORE_ADD_VERTEX:"beforeAddVertex",ADD_VERTEX:"addVertex",AFTER_ADD_VERTEX:"afterAddVertex",DONE:"done",EXECUTE:"execute",EXECUTED:"executed",BEGIN_UPDATE:"beginUpdate",START_EDIT:"startEdit",END_UPDATE:"endUpdate",END_EDIT:"endEdit",BEFORE_UNDO:"beforeUndo",UNDO:"undo",REDO:"redo",CHANGE:"change",NOTIFY:"notify",LAYOUT_CELLS:"layoutCells",CLICK:"click",SCALE:"scale",TRANSLATE:"translate",SCALE_AND_TRANSLATE:"scaleAndTranslate",UP:"up",DOWN:"down",ADD:"add",REMOVE:"remove",CLEAR:"clear",ADD_CELLS:"addCells",CELLS_ADDED:"cellsAdded",MOVE_CELLS:"moveCells",CELLS_MOVED:"cellsMoved",RESIZE_CELLS:"resizeCells",CELLS_RESIZED:"cellsResized",TOGGLE_CELLS:"toggleCells",CELLS_TOGGLED:"cellsToggled",ORDER_CELLS:"orderCells",CELLS_ORDERED:"cellsOrdered",REMOVE_CELLS:"removeCells",CELLS_REMOVED:"cellsRemoved",GROUP_CELLS:"groupCells",UNGROUP_CELLS:"ungroupCells",REMOVE_CELLS_FROM_PARENT:"removeCellsFromParent",FOLD_CELLS:"foldCells",CELLS_FOLDED:"cellsFolded",ALIGN_CELLS:"alignCells",LABEL_CHANGED:"labelChanged",CONNECT_CELL:"connectCell",CELL_CONNECTED:"cellConnected",SPLIT_EDGE:"splitEdge",FLIP_EDGE:"flipEdge",START_EDITING:"startEditing",EDITING_STARTED:"editingStarted",EDITING_STOPPED:"editingStopped",ADD_OVERLAY:"addOverlay",REMOVE_OVERLAY:"removeOverlay",UPDATE_CELL_SIZE:"updateCellSize",ESCAPE:"escape",DOUBLE_CLICK:"doubleClick",START:"start",RESET:"reset",PINCH_THRESHOLD:10},updateListener,updateListenerList;function mxXmlRequest(t,e,n,i,s,r){this.url=t,this.params=e,this.method=n||"POST",this.async=null==i||i,this.username=s,this.password=r}__mxOutput.mxEvent=void 0!==mxEvent?mxEvent:void 0,mxXmlRequest.prototype.url=null,mxXmlRequest.prototype.params=null,mxXmlRequest.prototype.method=null,mxXmlRequest.prototype.async=null,mxXmlRequest.prototype.binary=!1,mxXmlRequest.prototype.withCredentials=!1,mxXmlRequest.prototype.username=null,mxXmlRequest.prototype.password=null,mxXmlRequest.prototype.request=null,mxXmlRequest.prototype.decodeSimulateValues=!1,mxXmlRequest.prototype.isBinary=function(){return this.binary},mxXmlRequest.prototype.setBinary=function(t){this.binary=t},mxXmlRequest.prototype.getText=function(){return this.request.responseText},mxXmlRequest.prototype.isReady=function(){return 4==this.request.readyState},mxXmlRequest.prototype.getDocumentElement=function(){var t=this.getXml();return null!=t?t.documentElement:null},mxXmlRequest.prototype.getXml=function(){var t=this.request.responseXML;return(document.documentMode>=9||null==t||null==t.documentElement)&&(t=mxUtils.parseXml(this.request.responseText)),t},mxXmlRequest.prototype.getStatus=function(){return null!=this.request?this.request.status:null},mxXmlRequest.prototype.create=window.XMLHttpRequest?function(){var t=new XMLHttpRequest;return this.isBinary()&&t.overrideMimeType&&t.overrideMimeType("text/plain; charset=x-user-defined"),t}:"undefined"!=typeof ActiveXObject?function(){return new ActiveXObject("Microsoft.XMLHTTP")}:void 0,mxXmlRequest.prototype.send=function(t,e,n,i){this.request=this.create(),null!=this.request&&(null!=t&&(this.request.onreadystatechange=mxUtils.bind(this,(function(){this.isReady()&&(t(this),this.request.onreadystatechange=null)}))),this.request.open(this.method,this.url,this.async,this.username,this.password),this.setRequestHeaders(this.request,this.params),window.XMLHttpRequest&&this.withCredentials&&(this.request.withCredentials="true"),!mxClient.IS_QUIRKS&&(null==document.documentMode||document.documentMode>9)&&window.XMLHttpRequest&&null!=n&&null!=i&&(this.request.timeout=n,this.request.ontimeout=i),this.request.send(this.params))},mxXmlRequest.prototype.setRequestHeaders=function(t,e){null!=e&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded")},mxXmlRequest.prototype.simulate=function(t,e){var n=null;(t=t||document)==document&&(n=window.onbeforeunload,window.onbeforeunload=null);var i=t.createElement("form");i.setAttribute("method",this.method),i.setAttribute("action",this.url),null!=e&&i.setAttribute("target",e),i.style.display="none",i.style.visibility="hidden";for(var s=this.params.indexOf("&")>0?this.params.split("&"):this.params.split(),r=0;r0){var l=s[r].substring(0,o),a=s[r].substring(o+1);this.decodeSimulateValues&&(a=decodeURIComponent(a));var h=t.createElement("textarea");h.setAttribute("wrap","off"),h.setAttribute("name",l),mxUtils.write(h,a),i.appendChild(h)}}t.body.appendChild(i),i.submit(),null!=i.parentNode&&i.parentNode.removeChild(i),null!=n&&(window.onbeforeunload=n)},__mxOutput.mxXmlRequest=void 0!==mxXmlRequest?mxXmlRequest:void 0;var mxClipboard={STEPSIZE:10,insertCount:1,cells:null,setCells:function(t){mxClipboard.cells=t},getCells:function(){return mxClipboard.cells},isEmpty:function(){return null==mxClipboard.getCells()},cut:function(t,e){return e=mxClipboard.copy(t,e),mxClipboard.insertCount=0,mxClipboard.removeCells(t,e),e},removeCells:function(t,e){t.removeCells(e)},copy:function(t,e){e=e||t.getSelectionCells();var n=t.getExportableCells(t.model.getTopmostCells(e));return mxClipboard.insertCount=1,mxClipboard.setCells(t.cloneCells(n)),n},paste:function(t){var e=null;if(!mxClipboard.isEmpty()){e=t.getImportableCells(mxClipboard.getCells());var n=mxClipboard.insertCount*mxClipboard.STEPSIZE,i=t.getDefaultParent();e=t.importCells(e,n,n,i),mxClipboard.insertCount++,t.setSelectionCells(e)}return e}};function mxWindow(t,e,n,i,s,r,o,l,a,h){null!=e&&(o=null==o||o,this.content=e,this.init(n,i,s,r,h),this.installMaximizeHandler(),this.installMinimizeHandler(),this.installCloseHandler(),this.setMinimizable(o),this.setTitle(t),(null==l||l)&&this.installMoveHandler(),null!=a&&null!=a.parentNode?a.parentNode.replaceChild(this.div,a):document.body.appendChild(this.div))}function mxForm(t){this.table=document.createElement("table"),this.table.className=t,this.body=document.createElement("tbody"),this.table.appendChild(this.body)}function mxImage(t,e,n){this.src=t,this.width=e,this.height=n}function mxDivResizer(t,e){if("div"==t.nodeName.toLowerCase()){null==e&&(e=window),this.div=t;var n=mxUtils.getCurrentStyle(t);null!=n&&(this.resizeWidth="auto"==n.width,this.resizeHeight="auto"==n.height),mxEvent.addListener(e,"resize",mxUtils.bind(this,(function(t){this.handlingResize||(this.handlingResize=!0,this.resize(),this.handlingResize=!1)}))),this.resize()}}function mxDragSource(t,e){this.element=t,this.dropHandler=e,mxEvent.addGestureListeners(t,mxUtils.bind(this,(function(t){this.mouseDown(t)}))),mxEvent.addListener(t,"dragstart",(function(t){mxEvent.consume(t)})),this.eventConsumer=function(t,e){var n=e.getProperty("eventName"),i=e.getProperty("event");n!=mxEvent.MOUSE_DOWN&&i.consume()}}function mxToolbar(t){this.container=t}function mxUndoableEdit(t,e){this.source=t,this.changes=[],this.significant=null==e||e}function mxUndoManager(t){this.size=null!=t?t:100,this.clear()}__mxOutput.mxClipboard=void 0!==mxClipboard?mxClipboard:void 0,mxWindow.prototype=new mxEventSource,mxWindow.prototype.constructor=mxWindow,mxWindow.prototype.closeImage=mxClient.imageBasePath+"/close.gif",mxWindow.prototype.minimizeImage=mxClient.imageBasePath+"/minimize.gif",mxWindow.prototype.normalizeImage=mxClient.imageBasePath+"/normalize.gif",mxWindow.prototype.maximizeImage=mxClient.imageBasePath+"/maximize.gif",mxWindow.prototype.resizeImage=mxClient.imageBasePath+"/resize.gif",mxWindow.prototype.visible=!1,mxWindow.prototype.minimumSize=new mxRectangle(0,0,50,40),mxWindow.prototype.destroyOnClose=!0,mxWindow.prototype.contentHeightCorrection=8==document.documentMode||7==document.documentMode?6:2,mxWindow.prototype.title=null,mxWindow.prototype.content=null,mxWindow.prototype.init=function(t,e,n,i,s){s=null!=s?s:"mxWindow",this.div=document.createElement("div"),this.div.className=s,this.div.style.left=t+"px",this.div.style.top=e+"px",this.table=document.createElement("table"),this.table.className=s,mxClient.IS_POINTER&&(this.div.style.touchAction="none"),null!=n&&(mxClient.IS_QUIRKS||(this.div.style.width=n+"px"),this.table.style.width=n+"px"),null!=i&&(mxClient.IS_QUIRKS||(this.div.style.height=i+"px"),this.table.style.height=i+"px");var r=document.createElement("tbody"),o=document.createElement("tr");this.title=document.createElement("td"),this.title.className=s+"Title",this.buttons=document.createElement("div"),this.buttons.style.position="absolute",this.buttons.style.display="inline-block",this.buttons.style.right="4px",this.buttons.style.top="5px",this.title.appendChild(this.buttons),o.appendChild(this.title),r.appendChild(o),o=document.createElement("tr"),this.td=document.createElement("td"),this.td.className=s+"Pane",7==document.documentMode&&(this.td.style.height="100%"),this.contentWrapper=document.createElement("div"),this.contentWrapper.className=s+"Pane",this.contentWrapper.style.width="100%",this.contentWrapper.appendChild(this.content),(mxClient.IS_QUIRKS||"DIV"!=this.content.nodeName.toUpperCase())&&(this.contentWrapper.style.height="100%"),this.td.appendChild(this.contentWrapper),o.appendChild(this.td),r.appendChild(o),this.table.appendChild(r),this.div.appendChild(this.table);var l=mxUtils.bind(this,(function(t){this.activate()}));mxEvent.addGestureListeners(this.title,l),mxEvent.addGestureListeners(this.table,l),this.hide()},mxWindow.prototype.setTitle=function(t){for(var e=this.title.firstChild;null!=e;){var n=e.nextSibling;e.nodeType==mxConstants.NODETYPE_TEXT&&e.parentNode.removeChild(e),e=n}mxUtils.write(this.title,t||""),this.title.appendChild(this.buttons)},mxWindow.prototype.setScrollable=function(t){(null==navigator.userAgent||navigator.userAgent.indexOf("Presto/2.5")<0)&&(this.contentWrapper.style.overflow=t?"auto":"hidden")},mxWindow.prototype.activate=function(){if(mxWindow.activeWindow!=this){var t=mxUtils.getCurrentStyle(this.getElement()),e=null!=t?t.zIndex:3;if(mxWindow.activeWindow){var n=mxWindow.activeWindow.getElement();null!=n&&null!=n.style&&(n.style.zIndex=e)}var i=mxWindow.activeWindow;this.getElement().style.zIndex=parseInt(e)+1,mxWindow.activeWindow=this,this.fireEvent(new mxEventObject(mxEvent.ACTIVATE,"previousWindow",i))}},mxWindow.prototype.getElement=function(){return this.div},mxWindow.prototype.fit=function(){mxUtils.fit(this.div)},mxWindow.prototype.isResizable=function(){return null!=this.resize&&"none"!=this.resize.style.display},mxWindow.prototype.setResizable=function(t){if(t)if(null==this.resize){this.resize=document.createElement("img"),this.resize.style.position="absolute",this.resize.style.bottom="2px",this.resize.style.right="2px",this.resize.setAttribute("src",this.resizeImage),this.resize.style.cursor="nw-resize";var e=null,n=null,i=null,s=null,r=mxUtils.bind(this,(function(t){this.activate(),e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.div.offsetWidth,s=this.div.offsetHeight,mxEvent.addGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_START,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){if(null!=e&&null!=n){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setSize(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.RESIZE,"event",t)),mxEvent.consume(t)}})),l=mxUtils.bind(this,(function(t){null!=e&&null!=n&&(e=null,n=null,mxEvent.removeGestureListeners(document,null,o,l),this.fireEvent(new mxEventObject(mxEvent.RESIZE_END,"event",t)),mxEvent.consume(t))}));mxEvent.addGestureListeners(this.resize,r,o,l),this.div.appendChild(this.resize)}else this.resize.style.display="inline";else null!=this.resize&&(this.resize.style.display="none")},mxWindow.prototype.setSize=function(t,e){t=Math.max(this.minimumSize.width,t),e=Math.max(this.minimumSize.height,e),mxClient.IS_QUIRKS||(this.div.style.width=t+"px",this.div.style.height=e+"px"),this.table.style.width=t+"px",this.table.style.height=e+"px",mxClient.IS_QUIRKS||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px")},mxWindow.prototype.setMinimizable=function(t){this.minimize.style.display=t?"":"none"},mxWindow.prototype.getMinimumSize=function(){return new mxRectangle(0,0,0,this.title.offsetHeight)},mxWindow.prototype.installMinimizeHandler=function(){this.minimize=document.createElement("img"),this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.minimize.style.cursor="pointer",this.minimize.style.marginLeft="2px",this.minimize.style.display="none",this.buttons.appendChild(this.minimize);var t=!1,e=null,n=null,i=mxUtils.bind(this,(function(i){if(this.activate(),t)t=!1,this.minimize.setAttribute("src",this.minimizeImage),this.minimize.setAttribute("title","Minimize"),this.contentWrapper.style.display="",this.maximize.style.display=e,mxClient.IS_QUIRKS||(this.div.style.height=n),this.table.style.height=n,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",i));else{t=!0,this.minimize.setAttribute("src",this.normalizeImage),this.minimize.setAttribute("title","Normalize"),this.contentWrapper.style.display="none",e=this.maximize.style.display,this.maximize.style.display="none",n=this.table.style.height;var s=this.getMinimumSize();s.height>0&&(mxClient.IS_QUIRKS||(this.div.style.height=s.height+"px"),this.table.style.height=s.height+"px"),s.width>0&&(mxClient.IS_QUIRKS||(this.div.style.width=s.width+"px"),this.table.style.width=s.width+"px"),null!=this.resize&&(this.resize.style.visibility="hidden"),this.fireEvent(new mxEventObject(mxEvent.MINIMIZE,"event",i))}mxEvent.consume(i)}));mxEvent.addGestureListeners(this.minimize,i)},mxWindow.prototype.setMaximizable=function(t){this.maximize.style.display=t?"":"none"},mxWindow.prototype.installMaximizeHandler=function(){this.maximize=document.createElement("img"),this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.maximize.style.cursor="default",this.maximize.style.marginLeft="2px",this.maximize.style.cursor="pointer",this.maximize.style.display="none",this.buttons.appendChild(this.maximize);var t=!1,e=null,n=null,i=null,s=null,r=null,o=mxUtils.bind(this,(function(o){if(this.activate(),"none"!=this.maximize.style.display){if(t){if(t=!1,this.maximize.setAttribute("src",this.maximizeImage),this.maximize.setAttribute("title","Maximize"),this.contentWrapper.style.display="",this.minimize.style.display=r,this.div.style.left=e+"px",this.div.style.top=n+"px",!mxClient.IS_QUIRKS)this.div.style.height=i,this.div.style.width=s,"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.table.style.height=i,this.table.style.width=s,null!=this.resize&&(this.resize.style.visibility=""),this.fireEvent(new mxEventObject(mxEvent.NORMALIZE,"event",o))}else{t=!0,this.maximize.setAttribute("src",this.normalizeImage),this.maximize.setAttribute("title","Normalize"),this.contentWrapper.style.display="",r=this.minimize.style.display,this.minimize.style.display="none",e=parseInt(this.div.style.left),n=parseInt(this.div.style.top),i=this.table.style.height,s=this.table.style.width,this.div.style.left="0px",this.div.style.top="0px";var l=Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0);if(mxClient.IS_QUIRKS||(this.div.style.width=document.body.clientWidth-2+"px",this.div.style.height=l-2+"px"),this.table.style.width=document.body.clientWidth-2+"px",this.table.style.height=l-2+"px",null!=this.resize&&(this.resize.style.visibility="hidden"),!mxClient.IS_QUIRKS)"auto"!=mxUtils.getCurrentStyle(this.contentWrapper).overflow&&null==this.resize||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px");this.fireEvent(new mxEventObject(mxEvent.MAXIMIZE,"event",o))}mxEvent.consume(o)}}));mxEvent.addGestureListeners(this.maximize,o),mxEvent.addListener(this.title,"dblclick",o)},mxWindow.prototype.installMoveHandler=function(){this.title.style.cursor="move",mxEvent.addGestureListeners(this.title,mxUtils.bind(this,(function(t){var e=mxEvent.getClientX(t),n=mxEvent.getClientY(t),i=this.getX(),s=this.getY(),r=mxUtils.bind(this,(function(t){var r=mxEvent.getClientX(t)-e,o=mxEvent.getClientY(t)-n;this.setLocation(i+r,s+o),this.fireEvent(new mxEventObject(mxEvent.MOVE,"event",t)),mxEvent.consume(t)})),o=mxUtils.bind(this,(function(t){mxEvent.removeGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_END,"event",t)),mxEvent.consume(t)}));mxEvent.addGestureListeners(document,null,r,o),this.fireEvent(new mxEventObject(mxEvent.MOVE_START,"event",t)),mxEvent.consume(t)}))),mxClient.IS_POINTER&&(this.title.style.touchAction="none")},mxWindow.prototype.setLocation=function(t,e){this.div.style.left=t+"px",this.div.style.top=e+"px"},mxWindow.prototype.getX=function(){return parseInt(this.div.style.left)},mxWindow.prototype.getY=function(){return parseInt(this.div.style.top)},mxWindow.prototype.installCloseHandler=function(){this.closeImg=document.createElement("img"),this.closeImg.setAttribute("src",this.closeImage),this.closeImg.setAttribute("title","Close"),this.closeImg.style.marginLeft="2px",this.closeImg.style.cursor="pointer",this.closeImg.style.display="none",this.buttons.appendChild(this.closeImg),mxEvent.addGestureListeners(this.closeImg,mxUtils.bind(this,(function(t){this.fireEvent(new mxEventObject(mxEvent.CLOSE,"event",t)),this.destroyOnClose?this.destroy():this.setVisible(!1),mxEvent.consume(t)})))},mxWindow.prototype.setImage=function(t){this.image=document.createElement("img"),this.image.setAttribute("src",t),this.image.setAttribute("align","left"),this.image.style.marginRight="4px",this.image.style.marginLeft="0px",this.image.style.marginTop="-2px",this.title.insertBefore(this.image,this.title.firstChild)},mxWindow.prototype.setClosable=function(t){this.closeImg.style.display=t?"":"none"},mxWindow.prototype.isVisible=function(){return null!=this.div&&"none"!=this.div.style.display},mxWindow.prototype.setVisible=function(t){null!=this.div&&this.isVisible()!=t&&(t?this.show():this.hide())},mxWindow.prototype.show=function(){this.div.style.display="",this.activate();var t=mxUtils.getCurrentStyle(this.contentWrapper);mxClient.IS_QUIRKS||"auto"!=t.overflow&&null==this.resize||"none"==this.contentWrapper.style.display||(this.contentWrapper.style.height=this.div.offsetHeight-this.title.offsetHeight-this.contentHeightCorrection+"px"),this.fireEvent(new mxEventObject(mxEvent.SHOW))},mxWindow.prototype.hide=function(){this.div.style.display="none",this.fireEvent(new mxEventObject(mxEvent.HIDE))},mxWindow.prototype.destroy=function(){this.fireEvent(new mxEventObject(mxEvent.DESTROY)),null!=this.div&&(mxEvent.release(this.div),this.div.parentNode.removeChild(this.div),this.div=null),this.title=null,this.content=null,this.contentWrapper=null},__mxOutput.mxWindow=void 0!==mxWindow?mxWindow:void 0,mxForm.prototype.table=null,mxForm.prototype.body=!1,mxForm.prototype.getTable=function(){return this.table},mxForm.prototype.addButtons=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");n.appendChild(i),i=document.createElement("td");var s=document.createElement("button");mxUtils.write(s,mxResources.get("ok")||"OK"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){t()})),s=document.createElement("button"),mxUtils.write(s,mxResources.get("cancel")||"Cancel"),i.appendChild(s),mxEvent.addListener(s,"click",(function(){e()})),n.appendChild(i),this.body.appendChild(n)},mxForm.prototype.addText=function(t,e,n){var i=document.createElement("input");return i.setAttribute("type",n||"text"),i.value=e,this.addField(t,i)},mxForm.prototype.addCheckbox=function(t,e){var n=document.createElement("input");return n.setAttribute("type","checkbox"),this.addField(t,n),e&&(n.checked=!0),n},mxForm.prototype.addTextarea=function(t,e,n){var i=document.createElement("textarea");return mxClient.IS_NS&&n--,i.setAttribute("rows",n||2),i.value=e,this.addField(t,i)},mxForm.prototype.addCombo=function(t,e,n){var i=document.createElement("select");return null!=n&&i.setAttribute("size",n),e&&i.setAttribute("multiple","true"),this.addField(t,i)},mxForm.prototype.addOption=function(t,e,n,i){var s=document.createElement("option");mxUtils.writeln(s,e),s.setAttribute("value",n),i&&s.setAttribute("selected",i),t.appendChild(s)},mxForm.prototype.addField=function(t,e){var n=document.createElement("tr"),i=document.createElement("td");return mxUtils.write(i,t),n.appendChild(i),(i=document.createElement("td")).appendChild(e),n.appendChild(i),this.body.appendChild(n),e},__mxOutput.mxForm=void 0!==mxForm?mxForm:void 0,mxImage.prototype.src=null,mxImage.prototype.width=null,mxImage.prototype.height=null,__mxOutput.mxImage=void 0!==mxImage?mxImage:void 0,mxDivResizer.prototype.resizeWidth=!0,mxDivResizer.prototype.resizeHeight=!0,mxDivResizer.prototype.handlingResize=!1,mxDivResizer.prototype.resize=function(){var t=this.getDocumentWidth(),e=this.getDocumentHeight(),n=parseInt(this.div.style.left),i=parseInt(this.div.style.right),s=parseInt(this.div.style.top),r=parseInt(this.div.style.bottom);this.resizeWidth&&!isNaN(n)&&!isNaN(i)&&n>=0&&i>=0&&t-i-n>0&&(this.div.style.width=t-i-n+"px"),this.resizeHeight&&!isNaN(s)&&!isNaN(r)&&s>=0&&r>=0&&e-s-r>0&&(this.div.style.height=e-s-r+"px")},mxDivResizer.prototype.getDocumentWidth=function(){return document.body.clientWidth},mxDivResizer.prototype.getDocumentHeight=function(){return document.body.clientHeight},__mxOutput.mxDivResizer=void 0!==mxDivResizer?mxDivResizer:void 0,mxDragSource.prototype.element=null,mxDragSource.prototype.dropHandler=null,mxDragSource.prototype.dragOffset=null,mxDragSource.prototype.dragElement=null,mxDragSource.prototype.previewElement=null,mxDragSource.prototype.previewOffset=null,mxDragSource.prototype.enabled=!0,mxDragSource.prototype.currentGraph=null,mxDragSource.prototype.currentDropTarget=null,mxDragSource.prototype.currentPoint=null,mxDragSource.prototype.currentGuide=null,mxDragSource.prototype.currentHighlight=null,mxDragSource.prototype.autoscroll=!0,mxDragSource.prototype.guidesEnabled=!0,mxDragSource.prototype.gridEnabled=!0,mxDragSource.prototype.highlightDropTargets=!0,mxDragSource.prototype.dragElementZIndex=100,mxDragSource.prototype.dragElementOpacity=70,mxDragSource.prototype.checkEventSource=!0,mxDragSource.prototype.isEnabled=function(){return this.enabled},mxDragSource.prototype.setEnabled=function(t){this.enabled=t},mxDragSource.prototype.isGuidesEnabled=function(){return this.guidesEnabled},mxDragSource.prototype.setGuidesEnabled=function(t){this.guidesEnabled=t},mxDragSource.prototype.isGridEnabled=function(){return this.gridEnabled},mxDragSource.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxDragSource.prototype.getGraphForEvent=function(t){return null},mxDragSource.prototype.getDropTarget=function(t,e,n,i){return t.getCellAt(e,n)},mxDragSource.prototype.createDragElement=function(t){return this.element.cloneNode(!0)},mxDragSource.prototype.createPreviewElement=function(t){return null},mxDragSource.prototype.isActive=function(){return null!=this.mouseMoveHandler},mxDragSource.prototype.reset=function(){null!=this.currentGraph&&(this.dragExit(this.currentGraph),this.currentGraph=null),this.removeDragElement(),this.removeListeners(),this.stopDrag()},mxDragSource.prototype.mouseDown=function(t){this.enabled&&!mxEvent.isConsumed(t)&&null==this.mouseMoveHandler&&(this.startDrag(t),this.mouseMoveHandler=mxUtils.bind(this,this.mouseMove),this.mouseUpHandler=mxUtils.bind(this,this.mouseUp),mxEvent.addGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),mxClient.IS_TOUCH&&!mxEvent.isMouseEvent(t)&&(this.eventSource=mxEvent.getSource(t),mxEvent.addGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler)))},mxDragSource.prototype.startDrag=function(t){this.dragElement=this.createDragElement(t),this.dragElement.style.position="absolute",this.dragElement.style.zIndex=this.dragElementZIndex,mxUtils.setOpacity(this.dragElement,this.dragElementOpacity),this.checkEventSource&&mxClient.IS_SVG&&(this.dragElement.style.pointerEvents="none")},mxDragSource.prototype.stopDrag=function(){this.removeDragElement()},mxDragSource.prototype.removeDragElement=function(){null!=this.dragElement&&(null!=this.dragElement.parentNode&&this.dragElement.parentNode.removeChild(this.dragElement),this.dragElement=null)},mxDragSource.prototype.getElementForEvent=function(t){return mxEvent.isTouchEvent(t)||mxEvent.isPenEvent(t)?document.elementFromPoint(mxEvent.getClientX(t),mxEvent.getClientY(t)):mxEvent.getSource(t)},mxDragSource.prototype.graphContainsEvent=function(t,e){var n=mxEvent.getClientX(e),i=mxEvent.getClientY(e),s=mxUtils.getOffset(t.container),r=mxUtils.getScrollOrigin(),o=this.getElementForEvent(e);if(this.checkEventSource)for(;null!=o&&o!=t.container;)o=o.parentNode;return null!=o&&n>=s.x-r.x&&i>=s.y-r.y&&n<=s.x-r.x+t.container.offsetWidth&&i<=s.y-r.y+t.container.offsetHeight},mxDragSource.prototype.mouseMove=function(t){var e=this.getGraphForEvent(t);if(null==e||this.graphContainsEvent(e,t)||(e=null),e!=this.currentGraph&&(null!=this.currentGraph&&this.dragExit(this.currentGraph,t),this.currentGraph=e,null!=this.currentGraph&&this.dragEnter(this.currentGraph,t)),null!=this.currentGraph&&this.dragOver(this.currentGraph,t),null==this.dragElement||null!=this.previewElement&&"visible"==this.previewElement.style.visibility)null!=this.dragElement&&(this.dragElement.style.visibility="hidden");else{var n=mxEvent.getClientX(t),i=mxEvent.getClientY(t);null==this.dragElement.parentNode&&document.body.appendChild(this.dragElement),this.dragElement.style.visibility="visible",null!=this.dragOffset&&(n+=this.dragOffset.x,i+=this.dragOffset.y);var s=mxUtils.getDocumentScrollOrigin(document);this.dragElement.style.left=n+s.x+"px",this.dragElement.style.top=i+s.y+"px"}mxEvent.consume(t)},mxDragSource.prototype.mouseUp=function(t){if(null!=this.currentGraph){if(null!=this.currentPoint&&(null==this.previewElement||"hidden"!=this.previewElement.style.visibility)){var e=this.currentGraph.view.scale,n=this.currentGraph.view.translate,i=this.currentPoint.x/e-n.x,s=this.currentPoint.y/e-n.y;this.drop(this.currentGraph,t,this.currentDropTarget,i,s)}this.dragExit(this.currentGraph),this.currentGraph=null}this.stopDrag(),this.removeListeners(),mxEvent.consume(t)},mxDragSource.prototype.removeListeners=function(){null!=this.eventSource&&(mxEvent.removeGestureListeners(this.eventSource,null,this.mouseMoveHandler,this.mouseUpHandler),this.eventSource=null),mxEvent.removeGestureListeners(document,null,this.mouseMoveHandler,this.mouseUpHandler),this.mouseMoveHandler=null,this.mouseUpHandler=null},mxDragSource.prototype.dragEnter=function(t,e){t.isMouseDown=!0,t.isMouseTrigger=mxEvent.isMouseEvent(e),this.previewElement=this.createPreviewElement(t),null!=this.previewElement&&this.checkEventSource&&mxClient.IS_SVG&&(this.previewElement.style.pointerEvents="none"),this.isGuidesEnabled()&&null!=this.previewElement&&(this.currentGuide=new mxGuide(t,t.graphHandler.getGuideStates())),this.highlightDropTargets&&(this.currentHighlight=new mxCellHighlight(t,mxConstants.DROP_TARGET_COLOR)),t.addListener(mxEvent.FIRE_MOUSE_EVENT,this.eventConsumer)},mxDragSource.prototype.dragExit=function(t,e){this.currentDropTarget=null,this.currentPoint=null,t.isMouseDown=!1,t.removeListener(this.eventConsumer),null!=this.previewElement&&(null!=this.previewElement.parentNode&&this.previewElement.parentNode.removeChild(this.previewElement),this.previewElement=null),null!=this.currentGuide&&(this.currentGuide.destroy(),this.currentGuide=null),null!=this.currentHighlight&&(this.currentHighlight.destroy(),this.currentHighlight=null)},mxDragSource.prototype.dragOver=function(t,e){var n=mxUtils.getOffset(t.container),i=mxUtils.getScrollOrigin(t.container),s=mxEvent.getClientX(e)-n.x+i.x-t.panDx,r=mxEvent.getClientY(e)-n.y+i.y-t.panDy;if(t.autoScroll&&(null==this.autoscroll||this.autoscroll)&&t.scrollPointToVisible(s,r,t.autoExtend),null!=this.currentHighlight&&t.isDropEnabled()){this.currentDropTarget=this.getDropTarget(t,s,r,e);var o=t.getView().getState(this.currentDropTarget);this.currentHighlight.highlight(o)}if(null!=this.previewElement){null==this.previewElement.parentNode&&(t.container.appendChild(this.previewElement),this.previewElement.style.zIndex="3",this.previewElement.style.position="absolute");var l=this.isGridEnabled()&&t.isGridEnabledEvent(e),a=!0;if(null!=this.currentGuide&&this.currentGuide.isEnabledForEvent(e)){var h=new mxRectangle(0,0,parseInt(this.previewElement.style.width),parseInt(this.previewElement.style.height)),u=new mxPoint(s,r);a=!1,s=(u=this.currentGuide.move(h,u,l,!0)).x,r=u.y}else if(l){var d=t.view.scale,p=t.view.translate,m=t.gridSize/2;s=(t.snap(s/d-p.x-m)+p.x)*d,r=(t.snap(r/d-p.y-m)+p.y)*d}null!=this.currentGuide&&a&&this.currentGuide.hide(),null!=this.previewOffset&&(s+=this.previewOffset.x,r+=this.previewOffset.y),this.previewElement.style.left=Math.round(s)+"px",this.previewElement.style.top=Math.round(r)+"px",this.previewElement.style.visibility="visible"}this.currentPoint=new mxPoint(s,r)},mxDragSource.prototype.drop=function(t,e,n,i,s){this.dropHandler.apply(this,arguments),"hidden"!=t.container.style.visibility&&t.container.focus()},__mxOutput.mxDragSource=void 0!==mxDragSource?mxDragSource:void 0,mxToolbar.prototype=new mxEventSource,mxToolbar.prototype.constructor=mxToolbar,mxToolbar.prototype.container=null,mxToolbar.prototype.enabled=!0,mxToolbar.prototype.noReset=!1,mxToolbar.prototype.updateDefaultMode=!0,mxToolbar.prototype.addItem=function(t,e,n,i,s,r){var o=document.createElement(null!=e?"img":"button"),l=s||(null!=r?"mxToolbarMode":"mxToolbarItem");o.className=l,o.setAttribute("src",e),null!=t&&(null!=e?o.setAttribute("title",t):mxUtils.write(o,t)),this.container.appendChild(o),null!=n&&(mxEvent.addListener(o,"click",n),mxClient.IS_TOUCH&&mxEvent.addListener(o,"touchend",n));var a=mxUtils.bind(this,(function(t){null!=i?o.setAttribute("src",e):o.style.backgroundColor=""}));return mxEvent.addGestureListeners(o,mxUtils.bind(this,(function(t){if(null!=i?o.setAttribute("src",i):o.style.backgroundColor="gray",null!=r){null==this.menu&&(this.menu=new mxPopupMenu,this.menu.init());var e=this.currentImg;if(this.menu.isMenuShowing()&&this.menu.hideMenu(),e!=o){this.currentImg=o,this.menu.factoryMethod=r;var n=new mxPoint(o.offsetLeft,o.offsetTop+o.offsetHeight);this.menu.popup(n.x,n.y,null,t),this.menu.isMenuShowing()&&(o.className=l+"Selected",this.menu.hideMenu=function(){mxPopupMenu.prototype.hideMenu.apply(this),o.className=l,this.currentImg=null})}}})),null,a),mxEvent.addListener(o,"mouseout",a),o},mxToolbar.prototype.addCombo=function(t){var e=document.createElement("div");e.style.display="inline",e.className="mxToolbarComboContainer";var n=document.createElement("select");return n.className=t||"mxToolbarCombo",e.appendChild(n),this.container.appendChild(e),n},mxToolbar.prototype.addActionCombo=function(t,e){var n=document.createElement("select");return n.className=e||"mxToolbarCombo",this.addOption(n,t,null),mxEvent.addListener(n,"change",(function(t){var e=n.options[n.selectedIndex];n.selectedIndex=0,null!=e.funct&&e.funct(t)})),this.container.appendChild(n),n},mxToolbar.prototype.addOption=function(t,e,n){var i=document.createElement("option");return mxUtils.writeln(i,e),"function"==typeof n?i.funct=n:i.setAttribute("value",n),t.appendChild(i),i},mxToolbar.prototype.addSwitchMode=function(t,e,n,i,s){var r=document.createElement("img");return r.initialClassName=s||"mxToolbarMode",r.className=r.initialClassName,r.setAttribute("src",e),r.altIcon=i,null!=t&&r.setAttribute("title",t),mxEvent.addListener(r,"click",mxUtils.bind(this,(function(t){var e;null!=(e=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",e)):this.selectedMode.className=this.selectedMode.initialClassName,this.updateDefaultMode&&(this.defaultMode=r),this.selectedMode=r,null!=(e=r.altIcon)?(r.altIcon=r.getAttribute("src"),r.setAttribute("src",e)):r.className=r.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT)),n()}))),this.container.appendChild(r),null==this.defaultMode&&(this.defaultMode=r,this.selectMode(r),n()),r},mxToolbar.prototype.addMode=function(t,e,n,i,s,r){r=null==r||r;var o=document.createElement(null!=e?"img":"button");return o.initialClassName=s||"mxToolbarMode",o.className=o.initialClassName,o.setAttribute("src",e),o.altIcon=i,null!=t&&o.setAttribute("title",t),this.enabled&&r&&(mxEvent.addListener(o,"click",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!1}))),mxEvent.addListener(o,"dblclick",mxUtils.bind(this,(function(t){this.selectMode(o,n),this.noReset=!0}))),null==this.defaultMode&&(this.defaultMode=o,this.defaultFunction=n,this.selectMode(o,n))),this.container.appendChild(o),o},mxToolbar.prototype.selectMode=function(t,e){if(this.selectedMode!=t){var n;if(null!=this.selectedMode)null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName;this.selectedMode=t,null!=(n=this.selectedMode.altIcon)?(this.selectedMode.altIcon=this.selectedMode.getAttribute("src"),this.selectedMode.setAttribute("src",n)):this.selectedMode.className=this.selectedMode.initialClassName+"Selected",this.fireEvent(new mxEventObject(mxEvent.SELECT,"function",e))}},mxToolbar.prototype.resetMode=function(t){!t&&this.noReset||this.selectedMode==this.defaultMode||this.selectMode(this.defaultMode,this.defaultFunction)},mxToolbar.prototype.addSeparator=function(t){return this.addItem(null,t,null)},mxToolbar.prototype.addBreak=function(){mxUtils.br(this.container)},mxToolbar.prototype.addLine=function(){var t=document.createElement("hr");t.style.marginRight="6px",t.setAttribute("size","1"),this.container.appendChild(t)},mxToolbar.prototype.destroy=function(){mxEvent.release(this.container),this.container=null,this.defaultMode=null,this.defaultFunction=null,this.selectedMode=null,null!=this.menu&&this.menu.destroy()},__mxOutput.mxToolbar=void 0!==mxToolbar?mxToolbar:void 0,mxUndoableEdit.prototype.source=null,mxUndoableEdit.prototype.changes=null,mxUndoableEdit.prototype.significant=null,mxUndoableEdit.prototype.undone=!1,mxUndoableEdit.prototype.redone=!1,mxUndoableEdit.prototype.isEmpty=function(){return 0==this.changes.length},mxUndoableEdit.prototype.isSignificant=function(){return this.significant},mxUndoableEdit.prototype.add=function(t){this.changes.push(t)},mxUndoableEdit.prototype.notify=function(){},mxUndoableEdit.prototype.die=function(){},mxUndoableEdit.prototype.undo=function(){if(!this.undone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length-1;t>=0;t--){var e=this.changes[t];null!=e.execute?e.execute():null!=e.undo&&e.undo(),this.source.fireEvent(new mxEventObject(mxEvent.EXECUTED,"change",e))}this.undone=!0,this.redone=!1,this.source.fireEvent(new mxEventObject(mxEvent.END_EDIT))}this.notify()},mxUndoableEdit.prototype.redo=function(){if(!this.redone){this.source.fireEvent(new mxEventObject(mxEvent.START_EDIT));for(var t=this.changes.length,e=0;e0},mxUndoManager.prototype.undo=function(){for(;this.indexOfNextAdd>0;){var t=this.history[--this.indexOfNextAdd];if(t.undo(),t.isSignificant()){this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",t));break}}},mxUndoManager.prototype.canRedo=function(){return this.indexOfNextAdd0&&this.size==this.history.length&&this.history.shift(),this.history.push(t),this.indexOfNextAdd=this.history.length,this.fireEvent(new mxEventObject(mxEvent.ADD,"edit",t))},mxUndoManager.prototype.trim=function(){if(this.history.length>this.indexOfNextAdd)for(var t=this.history.splice(this.indexOfNextAdd,this.history.length-this.indexOfNextAdd),e=0;e0&&this.dx0&&this.dy0&&(this.defs=n.getElementsByTagName("defs")[0]),null==this.defs&&(this.defs=this.createElement("defs"),null!=n.firstChild?n.insertBefore(this.defs,n.firstChild):n.appendChild(this.defs)),this.styleEnabled&&this.defs.appendChild(this.createStyle()))}mxUrlConverter.prototype.enabled=!0,mxUrlConverter.prototype.baseUrl=null,mxUrlConverter.prototype.baseDomain=null,mxUrlConverter.prototype.updateBaseUrl=function(){this.baseDomain=location.protocol+"//"+location.host,this.baseUrl=this.baseDomain+location.pathname;var t=this.baseUrl.lastIndexOf("/");t>0&&(this.baseUrl=this.baseUrl.substring(0,t+1))},mxUrlConverter.prototype.isEnabled=function(){return this.enabled},mxUrlConverter.prototype.setEnabled=function(t){this.enabled=t},mxUrlConverter.prototype.getBaseUrl=function(){return this.baseUrl},mxUrlConverter.prototype.setBaseUrl=function(t){this.baseUrl=t},mxUrlConverter.prototype.getBaseDomain=function(){return this.baseDomain},mxUrlConverter.prototype.setBaseDomain=function(t){this.baseDomain=t},mxUrlConverter.prototype.isRelativeUrl=function(t){return null!=t&&"//"!=t.substring(0,2)&&"http://"!=t.substring(0,7)&&"https://"!=t.substring(0,8)&&"data:image"!=t.substring(0,10)&&"file://"!=t.substring(0,7)},mxUrlConverter.prototype.convert=function(t){return this.isEnabled()&&this.isRelativeUrl(t)&&(null==this.getBaseUrl()&&this.updateBaseUrl(),t="/"==t.charAt(0)?this.getBaseDomain()+t:this.getBaseUrl()+t),t},__mxOutput.mxUrlConverter=void 0!==mxUrlConverter?mxUrlConverter:void 0,mxPanningManager.prototype.damper=1/6,mxPanningManager.prototype.delay=10,mxPanningManager.prototype.handleMouseOut=!0,mxPanningManager.prototype.border=0,__mxOutput.mxPanningManager=void 0!==mxPanningManager?mxPanningManager:void 0,mxPopupMenu.prototype=new mxEventSource,mxPopupMenu.prototype.constructor=mxPopupMenu,mxPopupMenu.prototype.submenuImage=mxClient.imageBasePath+"/submenu.gif",mxPopupMenu.prototype.zIndex=10006,mxPopupMenu.prototype.factoryMethod=null,mxPopupMenu.prototype.useLeftButtonForPopup=!1,mxPopupMenu.prototype.enabled=!0,mxPopupMenu.prototype.itemCount=0,mxPopupMenu.prototype.autoExpand=!1,mxPopupMenu.prototype.smartSeparators=!1,mxPopupMenu.prototype.labels=!0,mxPopupMenu.prototype.init=function(){this.table=document.createElement("table"),this.table.className="mxPopupMenu",this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.div=document.createElement("div"),this.div.className="mxPopupMenu",this.div.style.display="inline",this.div.style.zIndex=this.zIndex,this.div.appendChild(this.table),mxEvent.disableContextMenu(this.div)},mxPopupMenu.prototype.isEnabled=function(){return this.enabled},mxPopupMenu.prototype.setEnabled=function(t){this.enabled=t},mxPopupMenu.prototype.isPopupTrigger=function(t){return t.isPopupTrigger()||this.useLeftButtonForPopup&&mxEvent.isLeftMouseButton(t.getEvent())},mxPopupMenu.prototype.addItem=function(t,e,n,i,s,r,o,l){i=i||this,this.itemCount++,i.willAddSeparator&&(i.containsItems&&this.addSeparator(i,!0),i.willAddSeparator=!1),i.containsItems=!0;var a=document.createElement("tr");a.className="mxPopupMenuItem";var h=document.createElement("td");if(h.className="mxPopupMenuIcon",null!=e){var u=document.createElement("img");u.src=e,h.appendChild(u)}else if(null!=s){var d=document.createElement("div");d.className=s,h.appendChild(d)}if(a.appendChild(h),this.labels){var p=document.createElement("td");p.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),mxUtils.write(p,t),p.align="left",a.appendChild(p);var m=document.createElement("td");m.className="mxPopupMenuItem"+(null==r||r?"":" mxDisabled"),m.style.paddingRight="6px",m.style.textAlign="right",a.appendChild(m),null==i.div&&this.createSubmenu(i)}if(i.tbody.appendChild(a),0!=o&&0!=r){var c=null;mxEvent.addGestureListeners(a,mxUtils.bind(this,(function(t){this.eventReceiver=a,i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),null==document.selection||!mxClient.IS_QUIRKS&&8!=document.documentMode||(c=document.selection.createRange()),mxEvent.consume(t)})),mxUtils.bind(this,(function(t){i.activeRow!=a&&i.activeRow!=i&&(null!=i.activeRow&&null!=i.activeRow.div.parentNode&&this.hideSubmenu(i),this.autoExpand&&null!=a.div&&(this.showSubmenu(i,a),i.activeRow=a)),l||(a.className="mxPopupMenuItemHover")})),mxUtils.bind(this,(function(t){if(this.eventReceiver==a){if(i.activeRow!=a&&this.hideMenu(),null!=c){try{c.select()}catch(t){}c=null}null!=n&&n(t)}this.eventReceiver=null,mxEvent.consume(t)}))),l||mxEvent.addListener(a,"mouseout",mxUtils.bind(this,(function(t){a.className="mxPopupMenuItem"})))}return a},mxPopupMenu.prototype.addCheckmark=function(t,e){var n=t.firstChild.nextSibling;n.style.backgroundImage="url('"+e+"')",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="2px 50%"},mxPopupMenu.prototype.createSubmenu=function(t){t.table=document.createElement("table"),t.table.className="mxPopupMenu",t.tbody=document.createElement("tbody"),t.table.appendChild(t.tbody),t.div=document.createElement("div"),t.div.className="mxPopupMenu",t.div.style.position="absolute",t.div.style.display="inline",t.div.style.zIndex=this.zIndex,t.div.appendChild(t.table);var e=document.createElement("img");e.setAttribute("src",this.submenuImage),td=t.firstChild.nextSibling.nextSibling,td.appendChild(e)},mxPopupMenu.prototype.showSubmenu=function(t,e){if(null!=e.div){e.div.style.left=t.div.offsetLeft+e.offsetLeft+e.offsetWidth-1+"px",e.div.style.top=t.div.offsetTop+e.offsetTop+"px",document.body.appendChild(e.div);var n=parseInt(e.div.offsetLeft),i=parseInt(e.div.offsetWidth),s=mxUtils.getDocumentScrollOrigin(document),r=document.body,o=document.documentElement;n+i>s.x+(r.clientWidth||o.clientWidth)&&(e.div.style.left=Math.max(0,t.div.offsetLeft-i+(mxClient.IS_IE?6:-6))+"px"),mxUtils.fit(e.div)}},mxPopupMenu.prototype.addSeparator=function(t,e){if(t=t||this,this.smartSeparators&&!e)t.willAddSeparator=!0;else if(null!=t.tbody){t.willAddSeparator=!1;var n=document.createElement("tr"),i=document.createElement("td");i.className="mxPopupMenuIcon",i.style.padding="0 0 0 0px",n.appendChild(i);var s=document.createElement("td");s.style.padding="0 0 0 0px",s.setAttribute("colSpan","2");var r=document.createElement("hr");r.setAttribute("size","1"),s.appendChild(r),n.appendChild(s),t.tbody.appendChild(n)}},mxPopupMenu.prototype.popup=function(t,e,n,i){if(null!=this.div&&null!=this.tbody&&null!=this.factoryMethod){for(this.div.style.left=t+"px",this.div.style.top=e+"px";null!=this.tbody.firstChild;)mxEvent.release(this.tbody.firstChild),this.tbody.removeChild(this.tbody.firstChild);this.itemCount=0,this.factoryMethod(this,n,i),this.itemCount>0&&(this.showMenu(),this.fireEvent(new mxEventObject(mxEvent.SHOW)))}},mxPopupMenu.prototype.isMenuShowing=function(){return null!=this.div&&this.div.parentNode==document.body},mxPopupMenu.prototype.showMenu=function(){document.documentMode>=9&&(this.div.style.filter="none"),document.body.appendChild(this.div),mxUtils.fit(this.div)},mxPopupMenu.prototype.hideMenu=function(){null!=this.div&&(null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.hideSubmenu(this),this.containsItems=!1,this.fireEvent(new mxEventObject(mxEvent.HIDE)))},mxPopupMenu.prototype.hideSubmenu=function(t){null!=t.activeRow&&(this.hideSubmenu(t.activeRow),null!=t.activeRow.div.parentNode&&t.activeRow.div.parentNode.removeChild(t.activeRow.div),t.activeRow=null)},mxPopupMenu.prototype.destroy=function(){null!=this.div&&(mxEvent.release(this.div),null!=this.div.parentNode&&this.div.parentNode.removeChild(this.div),this.div=null)},__mxOutput.mxPopupMenu=void 0!==mxPopupMenu?mxPopupMenu:void 0,mxAutoSaveManager.prototype=new mxEventSource,mxAutoSaveManager.prototype.constructor=mxAutoSaveManager,mxAutoSaveManager.prototype.graph=null,mxAutoSaveManager.prototype.autoSaveDelay=10,mxAutoSaveManager.prototype.autoSaveThrottle=2,mxAutoSaveManager.prototype.autoSaveThreshold=5,mxAutoSaveManager.prototype.ignoredChanges=0,mxAutoSaveManager.prototype.lastSnapshot=0,mxAutoSaveManager.prototype.enabled=!0,mxAutoSaveManager.prototype.changeHandler=null,mxAutoSaveManager.prototype.isEnabled=function(){return this.enabled},mxAutoSaveManager.prototype.setEnabled=function(t){this.enabled=t},mxAutoSaveManager.prototype.setGraph=function(t){null!=this.graph&&this.graph.getModel().removeListener(this.changeHandler),this.graph=t,null!=this.graph&&this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)},mxAutoSaveManager.prototype.save=function(){},mxAutoSaveManager.prototype.graphModelChanged=function(t){var e=((new Date).getTime()-this.lastSnapshot)/1e3;e>this.autoSaveDelay||this.ignoredChanges>=this.autoSaveThreshold&&e>this.autoSaveThrottle?(this.save(),this.reset()):this.ignoredChanges++},mxAutoSaveManager.prototype.reset=function(){this.lastSnapshot=(new Date).getTime(),this.ignoredChanges=0},mxAutoSaveManager.prototype.destroy=function(){this.setGraph(null)},__mxOutput.mxAutoSaveManager=void 0!==mxAutoSaveManager?mxAutoSaveManager:void 0,mxAnimation.prototype=new mxEventSource,mxAnimation.prototype.constructor=mxAnimation,mxAnimation.prototype.delay=null,mxAnimation.prototype.thread=null,mxAnimation.prototype.isRunning=function(){return null!=this.thread},mxAnimation.prototype.startAnimation=function(){null==this.thread&&(this.thread=window.setInterval(mxUtils.bind(this,this.updateAnimation),this.delay))},mxAnimation.prototype.updateAnimation=function(){this.fireEvent(new mxEventObject(mxEvent.EXECUTE))},mxAnimation.prototype.stopAnimation=function(){null!=this.thread&&(window.clearInterval(this.thread),this.thread=null,this.fireEvent(new mxEventObject(mxEvent.DONE)))},__mxOutput.mxAnimation=void 0!==mxAnimation?mxAnimation:void 0,mxMorphing.prototype=new mxAnimation,mxMorphing.prototype.constructor=mxMorphing,mxMorphing.prototype.graph=null,mxMorphing.prototype.steps=null,mxMorphing.prototype.step=0,mxMorphing.prototype.ease=null,mxMorphing.prototype.cells=null,mxMorphing.prototype.updateAnimation=function(){mxAnimation.prototype.updateAnimation.apply(this,arguments);var t=new mxCellStatePreview(this.graph);if(null!=this.cells)for(var e=0;e=this.steps)&&this.stopAnimation()},mxMorphing.prototype.show=function(t){t.show()},mxMorphing.prototype.animateCell=function(t,e,n){var i=this.graph.getView().getState(t),s=null;if(null!=i&&(s=this.getDelta(i),this.graph.getModel().isVertex(t)&&(0!=s.x||0!=s.y))){var r=this.graph.view.getTranslate(),o=this.graph.view.getScale();s.x+=r.x*o,s.y+=r.y*o,e.moveState(i,-s.x/this.ease,-s.y/this.ease)}if(n&&!this.stopRecursion(i,s))for(var l=this.graph.getModel().getChildCount(t),a=0;a2))for(var t=this.state,e=2;e0&&(this.state=this.states.pop())},mxAbstractCanvas2D.prototype.setLink=function(t){},mxAbstractCanvas2D.prototype.scale=function(t){this.state.scale*=t,this.state.strokeWidth*=t},mxAbstractCanvas2D.prototype.translate=function(t,e){this.state.dx+=t,this.state.dy+=e},mxAbstractCanvas2D.prototype.rotate=function(t,e,n,i,s){},mxAbstractCanvas2D.prototype.setAlpha=function(t){this.state.alpha=t},mxAbstractCanvas2D.prototype.setFillAlpha=function(t){this.state.fillAlpha=t},mxAbstractCanvas2D.prototype.setStrokeAlpha=function(t){this.state.strokeAlpha=t},mxAbstractCanvas2D.prototype.setFillColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fillColor=t,this.state.gradientColor=null},mxAbstractCanvas2D.prototype.setGradient=function(t,e,n,i,s,r,o,l,a){var h=this.state;h.fillColor=t,h.gradientFillAlpha=null!=l?l:1,h.gradientColor=e,h.gradientAlpha=null!=a?a:1,h.gradientDirection=o},mxAbstractCanvas2D.prototype.setStrokeColor=function(t){t==mxConstants.NONE&&(t=null),this.state.strokeColor=t},mxAbstractCanvas2D.prototype.setStrokeWidth=function(t){this.state.strokeWidth=t},mxAbstractCanvas2D.prototype.setDashed=function(t,e){this.state.dashed=t,this.state.fixDash=e},mxAbstractCanvas2D.prototype.setDashPattern=function(t){this.state.dashPattern=t},mxAbstractCanvas2D.prototype.setLineCap=function(t){this.state.lineCap=t},mxAbstractCanvas2D.prototype.setLineJoin=function(t){this.state.lineJoin=t},mxAbstractCanvas2D.prototype.setMiterLimit=function(t){this.state.miterLimit=t},mxAbstractCanvas2D.prototype.setFontColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontColor=t},mxAbstractCanvas2D.prototype.setFontBackgroundColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBackgroundColor=t},mxAbstractCanvas2D.prototype.setFontBorderColor=function(t){t==mxConstants.NONE&&(t=null),this.state.fontBorderColor=t},mxAbstractCanvas2D.prototype.setFontSize=function(t){this.state.fontSize=parseFloat(t)},mxAbstractCanvas2D.prototype.setFontFamily=function(t){this.state.fontFamily=t},mxAbstractCanvas2D.prototype.setFontStyle=function(t){null==t&&(t=0),this.state.fontStyle=t},mxAbstractCanvas2D.prototype.setShadow=function(t){this.state.shadow=t},mxAbstractCanvas2D.prototype.setShadowColor=function(t){t==mxConstants.NONE&&(t=null),this.state.shadowColor=t},mxAbstractCanvas2D.prototype.setShadowAlpha=function(t){this.state.shadowAlpha=t},mxAbstractCanvas2D.prototype.setShadowOffset=function(t,e){this.state.shadowDx=t,this.state.shadowDy=e},mxAbstractCanvas2D.prototype.begin=function(){this.lastX=0,this.lastY=0,this.path=[]},mxAbstractCanvas2D.prototype.moveTo=function(t,e){this.addOp(this.moveOp,t,e)},mxAbstractCanvas2D.prototype.lineTo=function(t,e){this.addOp(this.lineOp,t,e)},mxAbstractCanvas2D.prototype.quadTo=function(t,e,n,i){this.addOp(this.quadOp,t,e,n,i)},mxAbstractCanvas2D.prototype.curveTo=function(t,e,n,i,s,r){this.addOp(this.curveOp,t,e,n,i,s,r)},mxAbstractCanvas2D.prototype.arcTo=function(t,e,n,i,s,r,o){var l=mxUtils.arcToCurves(this.lastX,this.lastY,t,e,n,i,s,r,o);if(null!=l)for(var a=0;a0}(),mxSvgCanvas2D.prototype.node=null,mxSvgCanvas2D.prototype.matchHtmlAlignment=!0,mxSvgCanvas2D.prototype.textEnabled=!0,mxSvgCanvas2D.prototype.foEnabled=!0,mxSvgCanvas2D.prototype.foAltText="[Object]",mxSvgCanvas2D.prototype.foOffset=0,mxSvgCanvas2D.prototype.textOffset=0,mxSvgCanvas2D.prototype.imageOffset=0,mxSvgCanvas2D.prototype.strokeTolerance=0,mxSvgCanvas2D.prototype.minStrokeWidth=1,mxSvgCanvas2D.prototype.refCount=0,mxSvgCanvas2D.prototype.lineHeightCorrection=1,mxSvgCanvas2D.prototype.pointerEventsValue="all",mxSvgCanvas2D.prototype.fontMetricsPadding=10,mxSvgCanvas2D.prototype.cacheOffsetSize=!0,mxSvgCanvas2D.prototype.format=function(t){return parseFloat(parseFloat(t).toFixed(2))},mxSvgCanvas2D.prototype.getBaseUrl=function(){var t=window.location.href,e=t.lastIndexOf("#");return e>0&&(t=t.substring(0,e)),t},mxSvgCanvas2D.prototype.reset=function(){mxAbstractCanvas2D.prototype.reset.apply(this,arguments),this.gradients=[]},mxSvgCanvas2D.prototype.createStyle=function(t){var e=this.createElement("style");return e.setAttribute("type","text/css"),mxUtils.write(e,"svg{font-family:"+mxConstants.DEFAULT_FONTFAMILY+";font-size:"+mxConstants.DEFAULT_FONTSIZE+";fill:none;stroke-miterlimit:10}"),e},mxSvgCanvas2D.prototype.createElement=function(t,e){if(null!=this.root.ownerDocument.createElementNS)return this.root.ownerDocument.createElementNS(e||mxConstants.NS_SVG,t);var n=this.root.ownerDocument.createElement(t);return null!=e&&n.setAttribute("xmlns",e),n},mxSvgCanvas2D.prototype.getAlternateText=function(t,e,n,i,s,r,o,l,a,h,u,d,p){return null!=r?this.foAltText:null},mxSvgCanvas2D.prototype.createAlternateContent=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m=this.getAlternateText(t,e,n,i,s,r,o,l,a,h,u,d,p),c=this.state;if(null!=m&&c.fontSize>0){var g=l==mxConstants.ALIGN_TOP?1:l==mxConstants.ALIGN_BOTTOM?0:.3,x=o==mxConstants.ALIGN_RIGHT?"end":o==mxConstants.ALIGN_LEFT?"start":"middle",y=this.createElement("text");y.setAttribute("x",Math.round(e+c.dx)),y.setAttribute("y",Math.round(n+c.dy+g*c.fontSize)),y.setAttribute("fill",c.fontColor||"black"),y.setAttribute("font-family",c.fontFamily),y.setAttribute("font-size",Math.round(c.fontSize)+"px"),"start"!=x&&y.setAttribute("text-anchor",x),(c.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&y.setAttribute("font-weight","bold"),(c.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&y.setAttribute("font-style","italic");var f=[];return(c.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&f.push("underline"),(c.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&f.push("line-through"),f.length>0&&y.setAttribute("text-decoration",f.join(" ")),mxUtils.write(y,m),y}return null},mxSvgCanvas2D.prototype.createGradientId=function(t,e,n,i,s){"#"==t.charAt(0)&&(t=t.substring(1)),"#"==e.charAt(0)&&(e=e.substring(1)),t=t.toLowerCase()+"-"+n,e=e.toLowerCase()+"-"+i;var r=null;if(null==s||s==mxConstants.DIRECTION_SOUTH)r="s";else if(s==mxConstants.DIRECTION_EAST)r="e";else{var o=t;t=e,e=o,s==mxConstants.DIRECTION_NORTH?r="s":s==mxConstants.DIRECTION_WEST&&(r="e")}return"mx-gradient-"+t+"-"+e+"-"+r},mxSvgCanvas2D.prototype.getSvgGradient=function(t,e,n,i,s){var r=this.createGradientId(t,e,n,i,s),o=this.gradients[r];if(null==o){var l=this.root.ownerSVGElement,a=0,h=r+"-"+a;if(null!=l)for(o=l.ownerDocument.getElementById(h);null!=o&&o.ownerSVGElement!=l;)h=r+"-"+a++,o=l.ownerDocument.getElementById(h);else h="id"+ ++this.refCount;null==o&&((o=this.createSvgGradient(t,e,n,i,s)).setAttribute("id",h),null!=this.defs?this.defs.appendChild(o):l.appendChild(o)),this.gradients[r]=o}return o.getAttribute("id")},mxSvgCanvas2D.prototype.createSvgGradient=function(t,e,n,i,s){var r=this.createElement("linearGradient");r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2","0%"),r.setAttribute("y2","0%"),null==s||s==mxConstants.DIRECTION_SOUTH?r.setAttribute("y2","100%"):s==mxConstants.DIRECTION_EAST?r.setAttribute("x2","100%"):s==mxConstants.DIRECTION_NORTH?r.setAttribute("y1","100%"):s==mxConstants.DIRECTION_WEST&&r.setAttribute("x1","100%");var o=n<1?";stop-opacity:"+n:"",l=this.createElement("stop");return l.setAttribute("offset","0%"),l.setAttribute("style","stop-color:"+t+o),r.appendChild(l),o=i<1?";stop-opacity:"+i:"",(l=this.createElement("stop")).setAttribute("offset","100%"),l.setAttribute("style","stop-color:"+e+o),r.appendChild(l),r},mxSvgCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("path"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.setAttribute("d",this.path.join(" "))}t&&null!=i.fillColor?this.updateFill():this.styleEnabled||("ellipse"==n.nodeName&&mxClient.IS_FF?n.setAttribute("fill","transparent"):n.setAttribute("fill","none"),t=!1),e&&null!=i.strokeColor?this.updateStroke():this.styleEnabled||n.setAttribute("stroke","none"),null!=i.transform&&i.transform.length>0&&n.setAttribute("transform",i.transform),i.shadow&&this.root.appendChild(this.createShadow(n)),this.strokeTolerance>0&&!t&&this.root.appendChild(this.createTolerance(n)),this.pointerEvents?n.setAttribute("pointer-events",this.pointerEventsValue):this.pointerEvents||null!=this.originalRoot||n.setAttribute("pointer-events","none"),("rect"!=n.nodeName&&"path"!=n.nodeName&&"ellipse"!=n.nodeName||"none"!=n.getAttribute("fill")&&"transparent"!=n.getAttribute("fill")||"none"!=n.getAttribute("stroke")||"none"!=n.getAttribute("pointer-events"))&&this.root.appendChild(n),this.node=null}},mxSvgCanvas2D.prototype.updateFill=function(){var t=this.state;if((t.alpha<1||t.fillAlpha<1)&&this.node.setAttribute("fill-opacity",t.alpha*t.fillAlpha),null!=t.fillColor)if(null!=t.gradientColor){var e=this.getSvgGradient(String(t.fillColor),String(t.gradientColor),t.gradientFillAlpha,t.gradientAlpha,t.gradientDirection);if(this.root.ownerDocument==document&&this.useAbsoluteIds){var n=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");this.node.setAttribute("fill","url("+n+"#"+e+")")}else this.node.setAttribute("fill","url(#"+e+")")}else this.node.setAttribute("fill",String(t.fillColor).toLowerCase())},mxSvgCanvas2D.prototype.getCurrentStrokeWidth=function(){return Math.max(this.minStrokeWidth,Math.max(.01,this.format(this.state.strokeWidth*this.state.scale)))},mxSvgCanvas2D.prototype.updateStroke=function(){var t=this.state;this.node.setAttribute("stroke",String(t.strokeColor).toLowerCase()),(t.alpha<1||t.strokeAlpha<1)&&this.node.setAttribute("stroke-opacity",t.alpha*t.strokeAlpha);var e=this.getCurrentStrokeWidth();1!=e&&this.node.setAttribute("stroke-width",e),"path"==this.node.nodeName&&this.updateStrokeAttributes(),t.dashed&&this.node.setAttribute("stroke-dasharray",this.createDashPattern((t.fixDash?1:t.strokeWidth)*t.scale))},mxSvgCanvas2D.prototype.updateStrokeAttributes=function(){var t=this.state;if(null!=t.lineJoin&&"miter"!=t.lineJoin&&this.node.setAttribute("stroke-linejoin",t.lineJoin),null!=t.lineCap){var e=t.lineCap;"flat"==e&&(e="butt"),"butt"!=e&&this.node.setAttribute("stroke-linecap",e)}null==t.miterLimit||this.styleEnabled&&10==t.miterLimit||this.node.setAttribute("stroke-miterlimit",t.miterLimit)},mxSvgCanvas2D.prototype.createDashPattern=function(t){var e=[];if("string"==typeof this.state.dashPattern){var n=this.state.dashPattern.split(" ");if(n.length>0)for(var i=0;i0&&this.node.setAttribute("rx",this.format(s*this.state.scale)),r>0&&this.node.setAttribute("ry",this.format(r*this.state.scale))},mxSvgCanvas2D.prototype.ellipse=function(t,e,n,i){var s=this.state,r=this.createElement("ellipse");r.setAttribute("cx",this.format((t+n/2+s.dx)*s.scale)),r.setAttribute("cy",this.format((e+i/2+s.dy)*s.scale)),r.setAttribute("rx",n/2*s.scale),r.setAttribute("ry",i/2*s.scale),this.node=r},mxSvgCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){s=this.converter.convert(s),r=null==r||r,o=null!=o&&o,l=null!=l&&l;var a=this.state;t+=a.dx,e+=a.dy;var h=this.createElement("image");h.setAttribute("x",this.format(t*a.scale)+this.imageOffset),h.setAttribute("y",this.format(e*a.scale)+this.imageOffset),h.setAttribute("width",this.format(n*a.scale)),h.setAttribute("height",this.format(i*a.scale)),null==h.setAttributeNS?h.setAttribute("xlink:href",s):h.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",s),r||h.setAttribute("preserveAspectRatio","none"),(a.alpha<1||a.fillAlpha<1)&&h.setAttribute("opacity",a.alpha*a.fillAlpha);var u=this.state.transform||"";if(o||l){var d=1,p=1,m=0,c=0;o&&(d=-1,m=-n-2*t),l&&(p=-1,c=-i-2*e),u+="scale("+d+","+p+")translate("+m*a.scale+","+c*a.scale+")"}u.length>0&&h.setAttribute("transform",u),this.pointerEvents||h.setAttribute("pointer-events","none"),this.root.appendChild(h)},mxSvgCanvas2D.prototype.convertHtml=function(t){if(this.useDomParser){var e=(new DOMParser).parseFromString(t,"text/html");null!=e&&("",5)+1)),""==t.substring(t.length-7,t.length)&&(t=t.substring(0,t.length-7)))}else{if(null!=document.implementation&&null!=document.implementation.createDocument){var n=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),i=n.createElement("body");n.documentElement.appendChild(i);var s=document.createElement("div");s.innerHTML=t;for(var r=s.firstChild;null!=r;){var o=r.nextSibling;i.appendChild(n.adoptNode(r)),r=o}return i.innerHTML}var l=document.createElement("textarea");l.innerHTML=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(//g,">"),t=l.value.replace(/&/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/
/g,"
").replace(/
/g,"
").replace(/(]+)>/gm,"$1 />")}return t},mxSvgCanvas2D.prototype.createDiv=function(t){var e=t;if(mxUtils.isNode(e)||(e="
"+this.convertHtml(e)+"
"),mxClient.IS_IE||mxClient.IS_IE11||!document.createElementNS)return mxUtils.isNode(e)&&(e="
"+mxUtils.getXml(e)+"
"),e='
'+e+"
",mxUtils.parseXml(e).documentElement;var n=document.createElementNS("http://www.w3.org/1999/xhtml","div");if(mxUtils.isNode(e)){var i=document.createElement("div"),s=i.cloneNode(!1);this.root.ownerDocument!=document?i.appendChild(e.cloneNode(!0)):i.appendChild(e),s.appendChild(i),n.appendChild(s)}else n.innerHTML=e;return n},mxSvgCanvas2D.prototype.updateText=function(t,e,n,i,s,r,o,l,a,h,u){null!=u&&null!=u.firstChild&&null!=u.firstChild.firstChild&&this.updateTextNodes(t,e,n,i,s,r,o,l,a,h,u.firstChild)},mxSvgCanvas2D.prototype.addForeignObject=function(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c){var g=this.createElement("g"),x=this.createElement("foreignObject");if(x.setAttribute("style","overflow: visible; text-align: left;"),x.setAttribute("pointer-events","none"),m.ownerDocument!=document&&(m=mxUtils.importNodeImplementation(x.ownerDocument,m,!0)),x.appendChild(m),g.appendChild(x),this.updateTextNodes(t,e,n,i,r,o,l,h,u,d,g),this.root.ownerDocument!=document){var y=this.createAlternateContent(x,t,e,n,i,s,r,o,l,a,h,u,d);if(null!=y){x.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var f=this.createElement("switch");f.appendChild(x),f.appendChild(y),g.appendChild(f)}}c.appendChild(g)},mxSvgCanvas2D.prototype.updateTextNodes=function(t,e,n,i,s,r,o,l,a,h,u){var d=this.state.scale;mxSvgCanvas2D.createCss(n+2,i,s,r,o,l,a,null!=this.state.fontBackgroundColor?this.state.fontBackgroundColor:null,null!=this.state.fontBorderColor?this.state.fontBorderColor:null,"display: flex; align-items: unsafe "+(r==mxConstants.ALIGN_TOP?"flex-start":r==mxConstants.ALIGN_BOTTOM?"flex-end":"center")+"; justify-content: unsafe "+(s==mxConstants.ALIGN_LEFT?"flex-start":s==mxConstants.ALIGN_RIGHT?"flex-end":"center")+"; ",this.getTextCss(),d,mxUtils.bind(this,(function(n,i,s,r,o){t+=this.state.dx,e+=this.state.dy;var l=u.firstChild,a=l.firstChild,p=a.firstChild,m=p.firstChild,c=(this.rotateHtml?this.state.rotation:0)+(null!=h?h:0),g=(0!=this.foOffset?"translate("+this.foOffset+" "+this.foOffset+")":"")+(1!=d?"scale("+d+")":"");m.setAttribute("style",o),p.setAttribute("style",r),l.setAttribute("width",Math.ceil(1/Math.min(1,d)*100)+"%"),l.setAttribute("height",Math.ceil(1/Math.min(1,d)*100)+"%");var x=Math.round(e+i);x<0?l.setAttribute("y",x):(l.removeAttribute("y"),s+="padding-top: "+x+"px; "),a.setAttribute("style",s+"margin-left: "+Math.round(t+n)+"px;"),""!=(g+=0!=c?"rotate("+c+" "+t+" "+e+")":"")?u.setAttribute("transform",g):u.removeAttribute("transform"),1!=this.state.alpha?u.setAttribute("opacity",this.state.alpha):u.removeAttribute("opacity")})))},mxSvgCanvas2D.createCss=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m="box-sizing: border-box; font-size: 0; text-align: "+(n==mxConstants.ALIGN_LEFT?"left":n==mxConstants.ALIGN_RIGHT?"right":"center")+"; ",c=mxUtils.getAlignmentAsPoint(n,i),g="overflow: hidden; ",x="width: 1px; ",y="height: 1px; ",f=c.x*t,v=c.y*e;o?(x="width: "+Math.round(t)+"px; ",m+="max-height: "+Math.round(e)+"px; ",v=0):"fill"==r?(u+="width: 100%; height: 100%; ",m+=(x="width: "+Math.round(t)+"px; ")+(y="height: "+Math.round(e)+"px; ")):"width"==r?(u+="width: 100%; ",m+=x="width: "+Math.round(t)+"px; ",v=0,e>0&&(m+="max-height: "+Math.round(e)+"px; ")):(g="",v=0);var C="";null!=l&&(C+="background-color: "+l+"; "),null!=a&&(C+="border: 1px solid "+a+"; "),""==g||o?u+=C:m+=C,s&&t>0?(u+="white-space: normal; word-wrap: "+mxConstants.WORD_WRAP+"; ",x="width: "+Math.round(t)+"px; ",""!=g&&"fill"!=r&&(v=0)):(u+="white-space: nowrap; ",""==g&&(f=0)),p(f,v,h+x+y,m+g,u,g)},mxSvgCanvas2D.prototype.getTextCss=function(){var t=this.state,e=mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT*this.lineHeightCorrection,n="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: "+(this.pointerEvents?this.pointerEventsValue:"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; ");var 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},mxSvgCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s)if(d=null!=d?d:0,this.foEnabled&&"html"==a){var m=this.createDiv(s);null!=m&&(null!=p&&m.setAttribute("dir",p),this.addForeignObject(t,e,n,i,s,r,o,l,a,h,u,d,p,m,this.root))}else this.plainText(t+this.state.dx,e+this.state.dy,n,i,s,r,o,l,h,u,d,p)},mxSvgCanvas2D.prototype.createClip=function(t,e,n,i){for(var s="mx-clip-"+(t=Math.round(t))+"-"+(e=Math.round(e))+"-"+(n=Math.round(n))+"-"+(i=Math.round(i)),r=0,o=s+"-"+r;null!=document.getElementById(o);)o=s+"-"+ ++r;clip=this.createElement("clipPath"),clip.setAttribute("id",o);var l=this.createElement("rect");return l.setAttribute("x",t),l.setAttribute("y",e),l.setAttribute("width",n),l.setAttribute("height",i),clip.appendChild(l),clip},mxSvgCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,h,u,d){u=null!=u?u:0;var p=this.state,m=p.fontSize,c=this.createElement("g"),g=p.transform||"";if(this.updateFont(c),this.pointerEvents||null!=this.originalRoot||c.setAttribute("pointer-events","none"),0!=u&&(g+="rotate("+u+","+this.format(t*p.scale)+","+this.format(e*p.scale)+")"),null!=d&&c.setAttribute("direction",d),h&&n>0&&i>0){var x=t,y=e;r==mxConstants.ALIGN_CENTER?x-=n/2:r==mxConstants.ALIGN_RIGHT&&(x-=n),"fill"!=a&&(o==mxConstants.ALIGN_MIDDLE?y-=i/2:o==mxConstants.ALIGN_BOTTOM&&(y-=i));var f=this.createClip(x*p.scale-2,y*p.scale-2,n*p.scale+4,i*p.scale+4);if(null!=this.defs?this.defs.appendChild(f):this.root.appendChild(f),mxClient.IS_CHROMEAPP||mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE||this.root.ownerDocument!=document)c.setAttribute("clip-path","url(#"+f.getAttribute("id")+")");else{var v=this.getBaseUrl().replace(/([\(\)])/g,"\\$1");c.setAttribute("clip-path","url("+v+"#"+f.getAttribute("id")+")")}}var C=r==mxConstants.ALIGN_RIGHT?"end":r==mxConstants.ALIGN_CENTER?"middle":"start";"start"!=C&&c.setAttribute("text-anchor",C),this.styleEnabled&&m==mxConstants.DEFAULT_FONTSIZE||c.setAttribute("font-size",m*p.scale+"px"),g.length>0&&c.setAttribute("transform",g),p.alpha<1&&c.setAttribute("opacity",p.alpha);var E=s.split("\n"),S=Math.round(m*mxConstants.LINE_HEIGHT),b=m+(E.length-1)*S;y=e+m-1;if(o==mxConstants.ALIGN_MIDDLE)y-="fill"==a?i/2:(this.matchHtmlAlignment&&h&&i>0?Math.min(b,i):b)/2;else if(o==mxConstants.ALIGN_BOTTOM){if("fill"==a)y-=i;else y-=(this.matchHtmlAlignment&&h&&i>0?Math.min(b,i):b)+1}for(var T=0;T0&&mxUtils.trim(E[T]).length>0){var w=this.createElement("text");w.setAttribute("x",this.format(t*p.scale)+this.textOffset),w.setAttribute("y",this.format(y*p.scale)+this.textOffset),mxUtils.write(w,E[T]),c.appendChild(w)}y+=S}this.root.appendChild(c),this.addTextBackground(c,s,t,e,n,"fill"==a?i:b,r,o,a)},mxSvgCanvas2D.prototype.updateFont=function(t){var e=this.state;t.setAttribute("fill",e.fontColor),this.styleEnabled&&e.fontFamily==mxConstants.DEFAULT_FONTFAMILY||t.setAttribute("font-family",e.fontFamily),(e.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&t.setAttribute("font-weight","bold"),(e.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&t.setAttribute("font-style","italic");var n=[];(e.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(e.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&t.setAttribute("text-decoration",n.join(" "))},mxSvgCanvas2D.prototype.addTextBackground=function(t,e,n,i,s,r,o,l,a){var h=this.state;if(null!=h.fontBackgroundColor||null!=h.fontBorderColor){var u=null;if("fill"==a||"width"==a)o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,i*h.scale,(s-2)*h.scale,(r+2)*h.scale);else if(null!=t.getBBox&&this.root.ownerDocument==document)try{u=t.getBBox();var d=mxClient.IS_IE&&mxClient.IS_SVG;u=new mxRectangle(u.x,u.y+(d?0:1),u.width,u.height+(d?1:0))}catch(t){}if(null==u||0==u.width||0==u.height){var p=document.createElement("div");p.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?h.fontSize*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,p.style.fontSize=h.fontSize+"px",p.style.fontFamily=h.fontFamily,p.style.whiteSpace="nowrap",p.style.position="absolute",p.style.visibility="hidden",p.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",p.style.zoom="1",(h.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(p.style.fontWeight="bold"),(h.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(p.style.fontStyle="italic"),e=mxUtils.htmlEntities(e,!1),p.innerHTML=e.replace(/\n/g,"
"),document.body.appendChild(p);s=p.offsetWidth,r=p.offsetHeight;p.parentNode.removeChild(p),o==mxConstants.ALIGN_CENTER?n-=s/2:o==mxConstants.ALIGN_RIGHT&&(n-=s),l==mxConstants.ALIGN_MIDDLE?i-=r/2:l==mxConstants.ALIGN_BOTTOM&&(i-=r),u=new mxRectangle((n+1)*h.scale,(i+2)*h.scale,s*h.scale,(r+1)*h.scale)}if(null!=u){var m=this.createElement("rect");m.setAttribute("fill",h.fontBackgroundColor||"none"),m.setAttribute("stroke",h.fontBorderColor||"none"),m.setAttribute("x",Math.floor(u.x-1)),m.setAttribute("y",Math.floor(u.y-1)),m.setAttribute("width",Math.ceil(u.width+2)),m.setAttribute("height",Math.ceil(u.height));var c=null!=h.fontBorderColor?Math.max(1,this.format(h.scale)):0;m.setAttribute("stroke-width",c),this.root.ownerDocument==document&&1==mxUtils.mod(c,2)&&m.setAttribute("transform","translate(0.5, 0.5)"),t.insertBefore(m,t.firstChild)}}},mxSvgCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxSvgCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxSvgCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxSvgCanvas2D=void 0!==mxSvgCanvas2D?mxSvgCanvas2D:void 0;var mxVmlCanvas2D=function(t){mxAbstractCanvas2D.call(this),this.root=t};function mxGuide(t,e){this.graph=t,this.setStates(e)}function mxShape(t){this.stencil=t,this.initStyles()}function mxStencil(t){this.desc=t,this.parseDescription(),this.parseConstraints()}mxUtils.extend(mxVmlCanvas2D,mxAbstractCanvas2D),mxVmlCanvas2D.prototype.node=null,mxVmlCanvas2D.prototype.textEnabled=!0,mxVmlCanvas2D.prototype.moveOp="m",mxVmlCanvas2D.prototype.lineOp="l",mxVmlCanvas2D.prototype.curveOp="c",mxVmlCanvas2D.prototype.closeOp="x",mxVmlCanvas2D.prototype.rotatedHtmlBackground="",mxVmlCanvas2D.prototype.vmlScale=1,mxVmlCanvas2D.prototype.createElement=function(t){return document.createElement(t)},mxVmlCanvas2D.prototype.createVmlElement=function(t){return this.createElement(mxClient.VML_PREFIX+":"+t)},mxVmlCanvas2D.prototype.addNode=function(t,e){var n=this.node,i=this.state;if(null!=n){if("shape"==n.nodeName){if(!(null!=this.path&&this.path.length>0))return;n.path=this.path.join(" ")+" e",n.style.width=this.root.style.width,n.style.height=this.root.style.height,n.coordsize=parseInt(n.style.width)+" "+parseInt(n.style.height)}n.strokeweight=this.format(Math.max(1,i.strokeWidth*i.scale/this.vmlScale))+"px",i.shadow&&this.root.appendChild(this.createShadow(n,t&&null!=i.fillColor,e&&null!=i.strokeColor)),e&&null!=i.strokeColor?(n.stroked="true",n.strokecolor=i.strokeColor):n.stroked="false",n.appendChild(this.createStroke()),t&&null!=i.fillColor?n.appendChild(this.createFill()):!this.pointerEvents||"shape"==n.nodeName&&this.path[this.path.length-1]!=this.closeOp?n.filled="false":n.appendChild(this.createTransparentFill()),this.root.appendChild(n)}},mxVmlCanvas2D.prototype.createTransparentFill=function(){var t=this.createVmlElement("fill");return t.src=mxClient.imageBasePath+"/transparent.gif",t.type="tile",t},mxVmlCanvas2D.prototype.createFill=function(){var t=this.state,e=this.createVmlElement("fill");if(e.color=t.fillColor,null!=t.gradientColor){e.type="gradient",e.method="none",e.color2=t.gradientColor;var n=180-t.rotation;t.gradientDirection==mxConstants.DIRECTION_WEST?n-=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_EAST?n+=90+("x"==this.root.style.flip?180:0):t.gradientDirection==mxConstants.DIRECTION_NORTH?n-=180+("y"==this.root.style.flip?-180:0):n+="y"==this.root.style.flip?-180:0,"x"!=this.root.style.flip&&"y"!=this.root.style.flip||(n*=-1),e.angle=mxUtils.mod(n,360),e.opacity=t.alpha*t.gradientFillAlpha*100+"%",e.setAttribute(mxClient.OFFICE_PREFIX+":opacity2",t.alpha*t.gradientAlpha*100+"%")}else(t.alpha<1||t.fillAlpha<1)&&(e.opacity=t.alpha*t.fillAlpha*100+"%");return e},mxVmlCanvas2D.prototype.createStroke=function(){var t=this.state,e=this.createVmlElement("stroke");return e.endcap=t.lineCap||"flat",e.joinstyle=t.lineJoin||"miter",e.miterlimit=t.miterLimit||"10",(t.alpha<1||t.strokeAlpha<1)&&(e.opacity=t.alpha*t.strokeAlpha*100+"%"),t.dashed&&(e.dashstyle=this.getVmlDashStyle()),e},mxVmlCanvas2D.prototype.getVmlDashStyle=function(){var t="dash";if("string"==typeof this.state.dashPattern){var e=this.state.dashPattern.split(" ");e.length>0&&1==e[0]&&(t="0 2")}return t},mxVmlCanvas2D.prototype.createShadow=function(t,e,n){var i=this.state,s=-i.rotation*(Math.PI/180),r=Math.cos(s),o=Math.sin(s),l=i.shadowDx*i.scale,a=i.shadowDy*i.scale;"x"==this.root.style.flip?l*=-1:"y"==this.root.style.flip&&(a*=-1);var h=t.cloneNode(!0);return h.style.marginLeft=Math.round(l*r-a*o)+"px",h.style.marginTop=Math.round(l*o+a*r)+"px",8==document.documentMode&&(h.strokeweight=t.strokeweight,"shape"==t.nodeName&&(h.path=this.path.join(" ")+" e",h.style.width=this.root.style.width,h.style.height=this.root.style.height,h.coordsize=parseInt(t.style.width)+" "+parseInt(t.style.height))),n?(h.strokecolor=i.shadowColor,h.appendChild(this.createShadowStroke())):h.stroked="false",e?h.appendChild(this.createShadowFill()):h.filled="false",h},mxVmlCanvas2D.prototype.createShadowFill=function(){var t=this.createVmlElement("fill");return t.color=this.state.shadowColor,t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.createShadowStroke=function(){var t=this.createStroke();return t.opacity=this.state.alpha*this.state.shadowAlpha*100+"%",t},mxVmlCanvas2D.prototype.rotate=function(t,e,n,i,s){e&&n?t+=180:e?this.root.style.flip="x":n&&(this.root.style.flip="y"),(e?!n:n)&&(t*=-1),this.root.style.rotation=t,this.state.rotation=this.state.rotation+t,this.state.rotationCx=i,this.state.rotationCy=s},mxVmlCanvas2D.prototype.begin=function(){mxAbstractCanvas2D.prototype.begin.apply(this,arguments),this.node=this.createVmlElement("shape"),this.node.style.position="absolute"},mxVmlCanvas2D.prototype.quadTo=function(t,e,n,i){var s=this.state,r=(this.lastX+s.dx)*s.scale,o=(this.lastY+s.dy)*s.scale,l=(t+s.dx)*s.scale,a=(e+s.dy)*s.scale,h=(n+s.dx)*s.scale,u=(i+s.dy)*s.scale,d=r+2/3*(l-r),p=o+2/3*(a-o),m=h+2/3*(l-h),c=u+2/3*(a-u);this.path.push("c "+this.format(d)+" "+this.format(p)+" "+this.format(m)+" "+this.format(c)+" "+this.format(h)+" "+this.format(u)),this.lastX=h/s.scale-s.dx,this.lastY=u/s.scale-s.dy},mxVmlCanvas2D.prototype.createRect=function(t,e,n,i,s){var r=this.state,o=this.createVmlElement(t);return o.style.position="absolute",o.style.left=this.format((e+r.dx)*r.scale)+"px",o.style.top=this.format((n+r.dy)*r.scale)+"px",o.style.width=this.format(i*r.scale)+"px",o.style.height=this.format(s*r.scale)+"px",o},mxVmlCanvas2D.prototype.rect=function(t,e,n,i){this.node=this.createRect("rect",t,e,n,i)},mxVmlCanvas2D.prototype.roundrect=function(t,e,n,i,s,r){this.node=this.createRect("roundrect",t,e,n,i),this.node.setAttribute("arcsize",Math.max(100*s/n,100*r/i)+"%")},mxVmlCanvas2D.prototype.ellipse=function(t,e,n,i){this.node=this.createRect("oval",t,e,n,i)},mxVmlCanvas2D.prototype.image=function(t,e,n,i,s,r,o,l){var a=null;if(r){(a=this.createRect("rect",t,e,n,i)).stroked="false";var h=this.createVmlElement("fill");h.aspect=r?"atmost":"ignore",h.rotate="true",h.type="frame",h.src=s,a.appendChild(h)}else(a=this.createRect("image",t,e,n,i)).src=s;o&&l?a.style.rotation="180":o?a.style.flip="x":l&&(a.style.flip="y"),(this.state.alpha<1||this.state.fillAlpha<1)&&(a.style.filter+="alpha(opacity="+this.state.alpha*this.state.fillAlpha*100+")"),this.root.appendChild(a)},mxVmlCanvas2D.prototype.createDiv=function(t,e,n,i){var s=this.createElement("div"),r=this.state,o="";if(null!=r.fontBackgroundColor&&(o+="background-color:"+mxUtils.htmlEntities(r.fontBackgroundColor)+";"),null!=r.fontBorderColor&&(o+="border:1px solid "+mxUtils.htmlEntities(r.fontBorderColor)+";"),mxUtils.isNode(t))s.appendChild(t);else if("fill"!=i&&"width"!=i){var l=this.createElement("div");l.style.cssText=o,l.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",l.style.zoom="1",l.style.textDecoration="inherit",l.innerHTML=t,s.appendChild(l)}else s.style.cssText=o,s.innerHTML=t;var a=s.style;return a.fontSize=r.fontSize/this.vmlScale+"px",a.fontFamily=r.fontFamily,a.color=r.fontColor,a.verticalAlign="top",a.textAlign=e||"left",a.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?r.fontSize*mxConstants.LINE_HEIGHT/this.vmlScale+"px":mxConstants.LINE_HEIGHT,(r.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(a.fontWeight="bold"),(r.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(a.fontStyle="italic"),(r.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(a.textDecoration="underline"),s},mxVmlCanvas2D.prototype.text=function(t,e,n,i,s,r,o,l,a,h,u,d,p){if(this.textEnabled&&null!=s){var m=this.state;if("html"==a){if(null!=m.rotation){var c=this.rotatePoint(t,e,m.rotation,m.rotationCx,m.rotationCy);t=c.x,e=c.y}8!=document.documentMode||mxClient.IS_EM?(t*=m.scale,e*=m.scale):(t+=m.dx,e+=m.dy,"fill"!=h&&o==mxConstants.ALIGN_TOP&&(e-=1));var g=8!=document.documentMode||mxClient.IS_EM?this.createElement("div"):this.createVmlElement("group");g.style.position="absolute",g.style.display="inline",g.style.left=this.format(t)+"px",g.style.top=this.format(e)+"px",g.style.zoom=m.scale;var x=this.createElement("div");x.style.position="relative",x.style.display="inline";var y=mxUtils.getAlignmentAsPoint(r,o),f=y.x,v=y.y,C=this.createDiv(s,r,o,h),E=this.createElement("div");if(null!=p&&C.setAttribute("dir",p),l&&n>0){if(u||(C.style.width=Math.round(n)+"px"),C.style.wordWrap=mxConstants.WORD_WRAP,C.style.whiteSpace="normal","break-word"==C.style.wordWrap)null!=(P=C).firstChild&&"DIV"==P.firstChild.nodeName&&(P.firstChild.style.width="100%")}else C.style.whiteSpace="nowrap";var S=m.rotation+(d||0);if(this.rotateHtml&&0!=S?(E.style.display="inline",E.style.zoom="1",E.appendChild(C),8!=document.documentMode||mxClient.IS_EM||"DIV"==this.root.nodeName?g.appendChild(E):(x.appendChild(E),g.appendChild(x))):8!=document.documentMode||mxClient.IS_EM?(C.style.display="inline",g.appendChild(C)):(x.appendChild(C),g.appendChild(x)),"DIV"!=this.root.nodeName){var b=this.createVmlElement("rect");b.stroked="false",b.filled="false",b.appendChild(g),this.root.appendChild(b)}else this.root.appendChild(g);if(u?(C.style.overflow="hidden",C.style.width=Math.round(n)+"px",mxClient.IS_QUIRKS||(C.style.maxHeight=Math.round(i)+"px")):"fill"==h?(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.height=Math.max(0,i)+1+"px"):"width"==h&&(C.style.overflow="hidden",C.style.width=Math.max(0,n)+1+"px",C.style.maxHeight=Math.max(0,i)+1+"px"),this.rotateHtml&&0!=S){var T=S*(Math.PI/180),w=parseFloat(parseFloat(Math.cos(T)).toFixed(8)),L=parseFloat(parseFloat(Math.sin(-T)).toFixed(8));(T%=2*Math.PI)<0&&(T+=2*Math.PI),(T%=Math.PI)>Math.PI/2&&(T=Math.PI-T);var O=Math.cos(T),I=Math.sin(T);8!=document.documentMode||mxClient.IS_EM||(C.style.display="inline-block",E.style.display="inline-block",x.style.display="inline-block"),C.style.visibility="hidden",C.style.position="absolute",document.body.appendChild(C);var A=C;null!=A.firstChild&&"DIV"==A.firstChild.nodeName&&(A=A.firstChild);var P=A.offsetWidth+3,_=A.offsetHeight;u?(n=Math.min(n,P),_=Math.min(_,i)):n=P,l&&(C.style.width=n+"px"),mxClient.IS_QUIRKS&&(u||"width"==h)&&_>i&&(_=i,C.style.height=_+"px");var R=((i=_)-i*O+n*-I)/2-L*n*(f+.5)+w*i*(v+.5),M=(n-n*O+i*-I)/2+w*n*(f+.5)+L*i*(v+.5);if("group"==g.nodeName&&"DIV"==this.root.nodeName){var N=this.createElement("div");N.style.display="inline-block",N.style.position="absolute",N.style.left=this.format(t+(M-n/2)*m.scale)+"px",N.style.top=this.format(e+(R-i/2)*m.scale)+"px",g.parentNode.appendChild(N),N.appendChild(g)}else{var H=8!=document.documentMode||mxClient.IS_EM?m.scale:1;g.style.left=this.format(t+(M-n/2)*H)+"px",g.style.top=this.format(e+(R-i/2)*H)+"px"}E.style.filter="progid:DXImageTransform.Microsoft.Matrix(M11="+w+", M12="+L+", M21="+-L+", M22="+w+", sizingMethod='auto expand')",E.style.backgroundColor=this.rotatedHtmlBackground,this.state.alpha<1&&(E.style.filter+="alpha(opacity="+100*this.state.alpha+")"),E.appendChild(C),C.style.position="",C.style.visibility=""}else if(8!=document.documentMode||mxClient.IS_EM){C.style.verticalAlign="top",this.state.alpha<1&&(g.style.filter="alpha(opacity="+100*this.state.alpha+")");var D=C.parentNode;C.style.visibility="hidden",document.body.appendChild(C),n=C.offsetWidth;_=C.offsetHeight;mxClient.IS_QUIRKS&&u&&_>i&&(_=i,C.style.height=_+"px"),i=_,C.style.visibility="",D.appendChild(C),g.style.left=this.format(t+n*f*this.state.scale)+"px",g.style.top=this.format(e+i*v*this.state.scale)+"px"}else this.state.alpha<1&&(C.style.filter="alpha(opacity="+100*this.state.alpha+")"),x.style.left=100*f+"%",x.style.top=100*v+"%"}else this.plainText(t,e,n,i,mxUtils.htmlEntities(s,!1),r,o,l,a,h,u,d,p)}},mxVmlCanvas2D.prototype.plainText=function(t,e,n,i,s,r,o,l,a,h,u,d,p){var m=this.state;t=(t+m.dx)*m.scale,e=(e+m.dy)*m.scale;var c=this.createVmlElement("shape");c.style.width="1px",c.style.height="1px",c.stroked="false";var g=this.createVmlElement("fill");g.color=m.fontColor,g.opacity=100*m.alpha+"%",c.appendChild(g);var x=this.createVmlElement("path");x.textpathok="true",x.v="m "+this.format(0)+" "+this.format(0)+" l "+this.format(1)+" "+this.format(0),c.appendChild(x);var y=this.createVmlElement("textpath");y.style.cssText="v-text-align:"+r,y.style.align=r,y.style.fontFamily=m.fontFamily,y.string=s,y.on="true";var f=m.fontSize*m.scale/this.vmlScale;y.style.fontSize=f+"px",(m.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(y.style.fontWeight="bold"),(m.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(y.style.fontStyle="italic"),(m.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&(y.style.textDecoration="underline");var v=f+(s.split("\n").length-1)*f*mxConstants.LINE_HEIGHT,C=0,E=0;if(o==mxConstants.ALIGN_BOTTOM?E=-v/2:o!=mxConstants.ALIGN_MIDDLE&&(E=v/2),null!=d){c.style.rotation=d;var S=d*(Math.PI/180);C=Math.sin(S)*E,E=Math.cos(S)*E}c.appendChild(y),c.style.left=this.format(t-C)+"px",c.style.top=this.format(e+E)+"px",this.root.appendChild(c)},mxVmlCanvas2D.prototype.stroke=function(){this.addNode(!1,!0)},mxVmlCanvas2D.prototype.fill=function(){this.addNode(!0,!1)},mxVmlCanvas2D.prototype.fillAndStroke=function(){this.addNode(!0,!0)},__mxOutput.mxVmlCanvas2D=void 0!==mxVmlCanvas2D?mxVmlCanvas2D:void 0,mxGuide.prototype.graph=null,mxGuide.prototype.states=null,mxGuide.prototype.horizontal=!0,mxGuide.prototype.vertical=!0,mxGuide.prototype.guideX=null,mxGuide.prototype.guideY=null,mxGuide.prototype.rounded=!1,mxGuide.prototype.tolerance=2,mxGuide.prototype.setStates=function(t){this.states=t},mxGuide.prototype.isEnabledForEvent=function(t){return!0},mxGuide.prototype.getGuideTolerance=function(t){return t&&this.graph.gridEnabled?this.graph.gridSize/2:this.tolerance},mxGuide.prototype.createGuideShape=function(t){var e=new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH);return e.isDashed=!0,e},mxGuide.prototype.isStateIgnored=function(t){return!1},mxGuide.prototype.move=function(t,e,n,i){if(null!=this.states&&(this.horizontal||this.vertical)&&null!=t&&null!=e){var s=this.graph.getView().scale,r=this.getGuideTolerance(n)*s,o=t.clone();o.x+=e.x,o.y+=e.y;var l=!1,a=null,h=null,u=!1,d=null,p=null,m=r,c=r,g=o.x,x=o.x+o.width,y=o.getCenterX(),f=o.y,v=o.y+o.height,C=o.getCenterY();function I(n,i,s){var r=!1;s&&Math.abs(n-y)0&&null!=t[0]){this.bounds=new mxRectangle(Number(t[0].x),Number(t[0].y),1,1);for(var e=1;e0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)&&this.bounds.width>0&&this.bounds.height>0},mxShape.prototype.createVmlGroup=function(){var t=document.createElement(mxClient.VML_PREFIX+":group");return t.style.position="absolute",t.style.width=this.node.style.width,t.style.height=this.node.style.height,t},mxShape.prototype.redrawShape=function(){var t=this.createCanvas();null!=t&&(t.pointerEvents=this.pointerEvents,this.beforePaint(t),this.paint(t),this.afterPaint(t),this.node!=t.root&&this.node.insertAdjacentHTML("beforeend",t.root.outerHTML),"DIV"==this.node.nodeName&&8==document.documentMode&&(this.node.style.filter="",mxUtils.addTransparentBackgroundFilter(this.node)),this.destroyCanvas(t))},mxShape.prototype.createCanvas=function(){var t=null;return null!=this.node.ownerSVGElement?t=this.createSvgCanvas():mxClient.IS_VML&&(this.updateVmlContainer(),t=this.createVmlCanvas()),null!=t&&this.outline&&(t.setStrokeWidth(this.strokewidth),t.setStrokeColor(this.stroke),null!=this.isDashed&&t.setDashed(this.isDashed),t.setStrokeWidth=function(){},t.setStrokeColor=function(){},t.setFillColor=function(){},t.setGradient=function(){},t.setDashed=function(){},t.text=function(){}),t},mxShape.prototype.createSvgCanvas=function(){var t=new mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;var e=this.getSvgScreenOffset();return 0!=e?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(t){return Math.round(parseFloat(t))}),t},mxShape.prototype.createVmlCanvas=function(){var t=8==document.documentMode&&this.isParseVml()?this.createVmlGroup():this.node,e=new mxVmlCanvas2D(t);if(""!=t.tagUrn){var n=Math.max(1,Math.round(this.bounds.width)),i=Math.max(1,Math.round(this.bounds.height));t.coordsize=n*this.vmlScale+","+i*this.vmlScale,e.scale(this.vmlScale),e.vmlScale=this.vmlScale}var s=this.scale;return e.translate(-Math.round(this.bounds.x/s),-Math.round(this.bounds.y/s)),e},mxShape.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px";var t=Math.max(1,Math.round(this.bounds.width)),e=Math.max(1,Math.round(this.bounds.height));this.node.style.width=t+"px",this.node.style.height=e+"px",this.node.style.overflow="visible"},mxShape.prototype.redrawHtmlShape=function(){this.updateHtmlBounds(this.node),this.updateHtmlFilters(this.node),this.updateHtmlColors(this.node)},mxShape.prototype.updateHtmlFilters=function(t){var e="";if(this.opacity<100&&(e+="alpha(opacity="+this.opacity+")"),this.isShadow&&(e+="progid:DXImageTransform.Microsoft.dropShadow (OffX='"+Math.round(mxConstants.SHADOW_OFFSET_X*this.scale)+"', OffY='"+Math.round(mxConstants.SHADOW_OFFSET_Y*this.scale)+"', Color='"+mxConstants.VML_SHADOWCOLOR+"')"),null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=mxConstants.NONE){var n=this.fill,i=this.gradient,s="0",r={east:0,south:1,west:2,north:3},o=null!=this.direction?r[this.direction]:0;if(null!=this.gradientDirection&&(o=mxUtils.mod(o+r[this.gradientDirection]-1,4)),1==o){s="1";var l=n;n=i,i=l}else if(2==o){l=n;n=i,i=l}else 3==o&&(s="1");e+="progid:DXImageTransform.Microsoft.gradient(startColorStr='"+n+"', endColorStr='"+i+"', gradientType='"+s+"')"}t.style.filter=e},mxShape.prototype.updateHtmlColors=function(t){var e=this.stroke;null!=e&&e!=mxConstants.NONE?(t.style.borderColor=e,this.isDashed?t.style.borderStyle="dashed":this.strokewidth>0&&(t.style.borderStyle="solid"),t.style.borderWidth=Math.max(1,Math.ceil(this.strokewidth*this.scale))+"px"):t.style.borderWidth="0px",null!=(e=this.outline?null:this.fill)&&e!=mxConstants.NONE?(t.style.backgroundColor=e,t.style.backgroundImage="none"):this.pointerEvents?t.style.backgroundColor="transparent":8==document.documentMode?mxUtils.addTransparentBackgroundFilter(t):this.setTransparentBackgroundImage(t)},mxShape.prototype.updateHtmlBounds=function(t){var e=document.documentMode>=9?0:Math.ceil(this.strokewidth*this.scale);t.style.borderWidth=Math.max(1,e)+"px",t.style.overflow="hidden",t.style.left=Math.round(this.bounds.x-e/2)+"px",t.style.top=Math.round(this.bounds.y-e/2)+"px","CSS1Compat"==document.compatMode&&(e=-e),t.style.width=Math.round(Math.max(0,this.bounds.width+e))+"px",t.style.height=Math.round(Math.max(0,this.bounds.height+e))+"px"},mxShape.prototype.destroyCanvas=function(t){if(t instanceof mxSvgCanvas2D){for(var e in t.gradients){var n=t.gradients[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)+1)}this.releaseSvgGradients(this.oldGradients),this.oldGradients=t.gradients}},mxShape.prototype.beforePaint=function(t){},mxShape.prototype.afterPaint=function(t){},mxShape.prototype.paint=function(t){var e=!1;if(null!=t&&this.outline){var n=t.stroke;t.stroke=function(){e=!0,n.apply(this,arguments)};var i=t.fillAndStroke;t.fillAndStroke=function(){e=!0,i.apply(this,arguments)}}var s=this.scale,r=this.bounds.x/s,o=this.bounds.y/s,l=this.bounds.width/s,a=this.bounds.height/s;if(this.isPaintBoundsInverted()){var h=(l-a)/2;r+=h,o-=h;var u=l;l=a,a=u}this.updateTransform(t,r,o,l,a),this.configureCanvas(t,r,o,l,a);var d=null;if(null==this.stencil&&null==this.points&&this.shapePointerEvents||null!=this.stencil&&this.stencilPointerEvents){var p=this.createBoundingBox();if(this.dialect==mxConstants.DIALECT_SVG)d=this.createTransparentSvgRectangle(p.x,p.y,p.width,p.height),this.node.appendChild(d);else{var m=t.createRect("rect",p.x/s,p.y/s,p.width/s,p.height/s);m.appendChild(t.createTransparentFill()),m.stroked="false",t.root.appendChild(m)}}if(null!=this.stencil)this.stencil.drawShape(t,this,r,o,l,a);else if(t.setStrokeWidth(this.strokewidth),null!=this.points){for(var c=[],g=0;g0){o=null==o||o;var l=e[e.length-1];if(s&&n){var a=(e=e.slice())[0],h=new mxPoint(l.x+(a.x-l.x)/2,l.y+(a.y-l.y)/2);e.splice(0,0,h)}var u=e[0],d=1;for(o?t.moveTo(u.x,u.y):t.lineTo(u.x,u.y);d<(s?e.length:e.length-1);){var p=e[mxUtils.mod(d,e.length)],m=u.x-p.x,c=u.y-p.y;if(n&&(0!=m||0!=c)&&(null==r||mxUtils.indexOf(r,d-1)<0)){var g=Math.sqrt(m*m+c*c),x=m*Math.min(i,g/2)/g,y=c*Math.min(i,g/2)/g,f=p.x+x,v=p.y+y;t.lineTo(f,v);for(var C=e[mxUtils.mod(d+1,e.length)];d0&&t.height>0)return this.boundingBox=new mxRectangle(t.x,t.y,t.width,t.height),void this.boundingBox.grow(this.strokewidth*this.scale/2)}catch(t){}if(null!=this.bounds){var e=this.createBoundingBox();if(null!=e){this.augmentBoundingBox(e);var n=this.getShapeRotation();0!=n&&(e=mxUtils.getBoundingBox(e,n))}this.boundingBox=e}},mxShape.prototype.createBoundingBox=function(){var t=this.bounds.clone();return(null!=this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)||this.isPaintBoundsInverted())&&t.rotate90(),t},mxShape.prototype.augmentBoundingBox=function(t){this.isShadow&&(t.width+=Math.ceil(mxConstants.SHADOW_OFFSET_X*this.scale),t.height+=Math.ceil(mxConstants.SHADOW_OFFSET_Y*this.scale)),t.grow(this.strokewidth*this.scale/2)},mxShape.prototype.isPaintBoundsInverted=function(){return null==this.stencil&&(this.direction==mxConstants.DIRECTION_NORTH||this.direction==mxConstants.DIRECTION_SOUTH)},mxShape.prototype.getRotation=function(){return null!=this.rotation?this.rotation:0},mxShape.prototype.getTextRotation=function(){var t=this.getRotation();return 1!=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,1)&&(t+=mxText.prototype.verticalTextRotation),t},mxShape.prototype.getShapeRotation=function(){var t=this.getRotation();return null!=this.direction&&(this.direction==mxConstants.DIRECTION_NORTH?t+=270:this.direction==mxConstants.DIRECTION_WEST?t+=180:this.direction==mxConstants.DIRECTION_SOUTH&&(t+=90)),t},mxShape.prototype.createTransparentSvgRectangle=function(t,e,n,i){var s=document.createElementNS(mxConstants.NS_SVG,"rect");return s.setAttribute("x",t),s.setAttribute("y",e),s.setAttribute("width",n),s.setAttribute("height",i),s.setAttribute("fill","none"),s.setAttribute("stroke","none"),s.setAttribute("pointer-events","all"),s},mxShape.prototype.setTransparentBackgroundImage=function(t){t.style.backgroundImage="url('"+mxClient.imageBasePath+"/transparent.gif')"},mxShape.prototype.releaseSvgGradients=function(t){if(null!=t)for(var e in t){var n=t[e];null!=n&&(n.mxRefCount=(n.mxRefCount||0)-1,0==n.mxRefCount&&null!=n.parentNode&&n.parentNode.removeChild(n))}},mxShape.prototype.destroy=function(){null!=this.node&&(mxEvent.release(this.node),null!=this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null),this.releaseSvgGradients(this.oldGradients),this.oldGradients=null},__mxOutput.mxShape=void 0!==mxShape?mxShape:void 0,mxUtils.extend(mxStencil,mxShape),mxStencil.defaultLocalized=!1,mxStencil.allowEval=!1,mxStencil.prototype.desc=null,mxStencil.prototype.constraints=null,mxStencil.prototype.aspect=null,mxStencil.prototype.w0=null,mxStencil.prototype.h0=null,mxStencil.prototype.bgNode=null,mxStencil.prototype.fgNode=null,mxStencil.prototype.strokewidth=null,mxStencil.prototype.parseDescription=function(){this.fgNode=this.desc.getElementsByTagName("foreground")[0],this.bgNode=this.desc.getElementsByTagName("background")[0],this.w0=Number(this.desc.getAttribute("w")||100),this.h0=Number(this.desc.getAttribute("h")||100);var t=this.desc.getAttribute("aspect");this.aspect=null!=t?t:"variable";var e=this.desc.getAttribute("strokewidth");this.strokewidth=null!=e?e:"1"},mxStencil.prototype.parseConstraints=function(){var t=this.desc.getElementsByTagName("connections")[0];if(null!=t){var e=mxUtils.getChildNodes(t);if(null!=e&&e.length>0){this.constraints=[];for(var n=0;n0&&r>0)for(var u=o.firstChild;null!=u;)u.nodeType==mxConstants.NODETYPE_ELEMENT&&this.drawNode(t,e,u,l,a,h),u=u.nextSibling},mxStencil.prototype.computeAspect=function(t,e,n,i,s,r){var o=e,l=n,a=i/this.w0,h=s/this.h0,u=r==mxConstants.DIRECTION_NORTH||r==mxConstants.DIRECTION_SOUTH;if(u){h=i/this.h0,a=s/this.w0;var d=(i-s)/2;o+=d,l-=d}return"fixed"==this.aspect&&(a=h=Math.min(a,h),u?(o+=(s-this.w0*a)/2,l+=(i-this.h0*h)/2):(o+=(i-this.w0*a)/2,l+=(s-this.h0*h)/2)),new mxRectangle(o,l,a,h)},mxStencil.prototype.drawNode=function(t,e,n,i,s,r){var o=n.nodeName,l=i.x,a=i.y,h=i.width,u=i.height,d=Math.min(h,u);if("save"==o)t.save();else if("restore"==o)t.restore();else if(r){if("path"==o){t.begin();var p=!0;if("1"==n.getAttribute("rounded")){p=!1;for(var m=Number(n.getAttribute("arcSize")),c=0,g=[],x=n.firstChild;null!=x;){if(x.nodeType==mxConstants.NODETYPE_ELEMENT){var y=x.nodeName;if("move"!=y&&"line"!=y){p=!0;break}"move"!=y&&0!=g.length||g.push([]),g[g.length-1].push(new mxPoint(l+Number(x.getAttribute("x"))*h,a+Number(x.getAttribute("y"))*u)),c++}x=x.nextSibling}if(!p&&c>0)for(var f=0;f0&&V.push(Number(U[f])*d);G=V.join(" "),t.setDashPattern(G)}}else"strokecolor"==o?t.setStrokeColor(n.getAttribute("color")):"linecap"==o?t.setLineCap(n.getAttribute("cap")):"linejoin"==o?t.setLineJoin(n.getAttribute("join")):"miterlimit"==o?t.setMiterLimit(Number(n.getAttribute("limit"))):"fillcolor"==o?t.setFillColor(n.getAttribute("color")):"alpha"==o||"fillalpha"==o||"strokealpha"==o?t.setAlpha(n.getAttribute("alpha")):"fontcolor"==o?t.setFontColor(n.getAttribute("color")):"fontstyle"==o?t.setFontStyle(n.getAttribute("style")):"fontfamily"==o?t.setFontFamily(n.getAttribute("family")):"fontsize"==o&&t.setFontSize(Number(n.getAttribute("size"))*d);!s||"fillstroke"!=o&&"fill"!=o&&"stroke"!=o||(s=!1,t.setShadow(!1))}},__mxOutput.mxStencil=void 0!==mxStencil?mxStencil:void 0;var mxStencilRegistry={stencils:{},addStencil:function(t,e){mxStencilRegistry.stencils[t]=e},getStencil:function(t){return mxStencilRegistry.stencils[t]}};__mxOutput.mxStencilRegistry=void 0!==mxStencilRegistry?mxStencilRegistry:void 0;var mxMarker={markers:[],addMarker:function(t,e){mxMarker.markers[t]=e},createMarker:function(t,e,n,i,s,r,o,l,a,h){var u=mxMarker.markers[n];return null!=u?u(t,e,n,i,s,r,o,l,a,h):null}};function mxActor(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxCloud(t,e,n,i){mxActor.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRectangleShape(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxDoubleEllipse(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxRhombus(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxPolyline(t,e,n){mxShape.call(this),this.points=t,this.stroke=e,this.strokewidth=null!=n?n:1}function mxArrow(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.spacing=null!=r?r:mxConstants.ARROW_SPACING,this.endSize=null!=o?o:mxConstants.ARROW_SIZE}function mxArrowConnector(t,e,n,i,s,r,o){mxShape.call(this),this.points=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1,this.arrowWidth=null!=s?s:mxConstants.ARROW_WIDTH,this.arrowSpacing=null!=r?r:mxConstants.ARROW_SPACING,this.startSize=mxConstants.ARROW_SIZE/5,this.endSize=mxConstants.ARROW_SIZE/5}function mxText(t,e,n,i,s,r,o,l,a,h,u,d,p,m,c,g,x,y,f,v,C){mxShape.call(this),this.value=t,this.bounds=e,this.color=null!=s?s:"black",this.align=null!=n?n:mxConstants.ALIGN_CENTER,this.valign=null!=i?i:mxConstants.ALIGN_MIDDLE,this.family=null!=r?r:mxConstants.DEFAULT_FONTFAMILY,this.size=null!=o?o:mxConstants.DEFAULT_FONTSIZE,this.fontStyle=null!=l?l:mxConstants.DEFAULT_FONTSTYLE,this.spacing=parseInt(a||2),this.spacingTop=this.spacing+parseInt(h||0),this.spacingRight=this.spacing+parseInt(u||0),this.spacingBottom=this.spacing+parseInt(d||0),this.spacingLeft=this.spacing+parseInt(p||0),this.horizontal=null==m||m,this.background=c,this.border=g,this.wrap=null!=x&&x,this.clipped=null!=y&&y,this.overflow=null!=f?f:"visible",this.labelPadding=null!=v?v:0,this.textDirection=C,this.rotation=0,this.updateMargin()}function mxTriangle(){mxActor.call(this)}function mxHexagon(){mxActor.call(this)}function mxLine(t,e,n,i){mxShape.call(this),this.bounds=t,this.stroke=e,this.strokewidth=null!=n?n:1,this.vertical=null!=i?i:this.vertical}function mxImageShape(t,e,n,i,s){mxShape.call(this),this.bounds=t,this.image=e,this.fill=n,this.stroke=i,this.strokewidth=null!=s?s:1,this.shadow=!1}function mxLabel(t,e,n,i){mxRectangleShape.call(this,t,e,n,i)}function mxCylinder(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxConnector(t,e,n){mxPolyline.call(this,t,e,n)}function mxSwimlane(t,e,n,i){mxShape.call(this),this.bounds=t,this.fill=e,this.stroke=n,this.strokewidth=null!=i?i:1}function mxGraphLayout(t){this.graph=t}function WeightedCellSorter(t,e){this.cell=t,this.weightedValue=e}function mxStackLayout(t,e,n,i,s,r){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=null!=n?n:0,this.x0=null!=i?i:0,this.y0=null!=s?s:0,this.border=null!=r?r:0}function mxPartitionLayout(t,e,n,i){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.spacing=n||0,this.border=i||0}function mxCompactTreeLayout(t,e,n){mxGraphLayout.call(this,t),this.horizontal=null==e||e,this.invert=null!=n&&n}function mxRadialTreeLayout(t){mxCompactTreeLayout.call(this,t,!1)}function mxFastOrganicLayout(t){mxGraphLayout.call(this,t)}function mxCircleLayout(t,e){mxGraphLayout.call(this,t),this.radius=null!=e?e:100}function mxParallelEdgeLayout(t){mxGraphLayout.call(this,t)}function mxCompositeLayout(t,e,n){mxGraphLayout.call(this,t),this.layouts=e,this.master=n}function mxEdgeLabelLayout(t,e){mxGraphLayout.call(this,t)}function mxGraphAbstractHierarchyCell(){this.x=[],this.y=[],this.temp=[]}function mxGraphHierarchyNode(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.cell=t,this.id=mxObjectIdentity.get(t),this.connectsAsTarget=[],this.connectsAsSource=[]}function mxGraphHierarchyEdge(t){mxGraphAbstractHierarchyCell.apply(this,arguments),this.edges=t,this.ids=[];for(var e=0;e0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxSwimlaneModel(t,e,n,i,s){t.getGraph(),this.tightenToSource=s,this.roots=n,this.parent=i,this.vertexMapper=new mxDictionary,this.edgeMapper=new mxDictionary,this.maxRank=0;var r=[];null==e&&(e=this.graph.getChildVertices(i)),this.maxRank=this.SOURCESCANSTARTRANK,this.createInternalCells(t,e,r);for(var o=0;o0){var d=u[0],p=t.getVisibleTerminal(d,!1),m=this.vertexMapper.get(p);r[o]==m&&(p=t.getVisibleTerminal(d,!0),m=this.vertexMapper.get(p)),null!=m&&r[o]!=m&&(h.target=m,0==m.connectsAsTarget.length&&(m.connectsAsTarget=[]),mxUtils.indexOf(m.connectsAsTarget,h)<0&&m.connectsAsTarget.push(h))}}r[o].temp[0]=1}}function mxHierarchicalLayoutStage(){}function mxMedianHybridCrossingReduction(t){this.layout=t}function MedianCellSorter(){}function mxMinimumCycleRemover(t){this.layout=t}function mxCoordinateAssignment(t,e,n,i,s,r){this.layout=t,this.intraCellSpacing=e,this.interRankCellSpacing=n,this.orientation=i,this.initialX=s,this.parallelEdgeSpacing=r}function mxSwimlaneOrdering(t){this.layout=t}function mxHierarchicalLayout(t,e,n){mxGraphLayout.call(this,t),this.orientation=null!=e?e:mxConstants.DIRECTION_NORTH,this.deterministic=null==n||n}!function(){function t(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();m.x-=d,m.y-=p;var c=i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN?1:3/4;return s.x+=-r*c-d,s.y+=-o*c-p,function(){e.begin(),e.moveTo(m.x,m.y),e.lineTo(m.x-r-o/t,m.y-o+r/t),i!=mxConstants.ARROW_CLASSIC&&i!=mxConstants.ARROW_CLASSIC_THIN||e.lineTo(m.x-3*r/4,m.y-3*o/4),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.close(),u?e.fillAndStroke():e.stroke()}}}function e(t){return t=null!=t?t:2,function(e,n,i,s,r,o,l,a,h,u){var d=r*h*1.118,p=o*h*1.118;r*=l+h,o*=l+h;var m=s.clone();return m.x-=d,m.y-=p,s.x+=2*-d,s.y+=2*-p,function(){e.begin(),e.moveTo(m.x-r-o/t,m.y-o+r/t),e.lineTo(m.x,m.y),e.lineTo(m.x+o/t-r,m.y-o-r/t),e.stroke()}}}function n(t,e,n,i,s,r,o,l,a,h){var u=n==mxConstants.ARROW_DIAMOND?.7071:.9862,d=s*a*u,p=r*a*u;s*=o+a,r*=o+a;var m=i.clone();m.x-=d,m.y-=p,i.x+=-s-d,i.y+=-r-p;var c=n==mxConstants.ARROW_DIAMOND?2:3.4;return function(){t.begin(),t.moveTo(m.x,m.y),t.lineTo(m.x-s/2-r/c,m.y+s/c-r/2),t.lineTo(m.x-s,m.y-r),t.lineTo(m.x-s/2+r/c,m.y-r/2-s/c),t.close(),h?t.fillAndStroke():t.stroke()}}mxMarker.addMarker("classic",t(2)),mxMarker.addMarker("classicThin",t(3)),mxMarker.addMarker("block",t(2)),mxMarker.addMarker("blockThin",t(3)),mxMarker.addMarker("open",e(2)),mxMarker.addMarker("openThin",e(3)),mxMarker.addMarker("oval",(function(t,e,n,i,s,r,o,l,a,h){var u=o/2,d=i.clone();return i.x-=s*u,i.y-=r*u,function(){t.ellipse(d.x-u,d.y-u,o,o),h?t.fillAndStroke():t.stroke()}})),mxMarker.addMarker("diamond",n),mxMarker.addMarker("diamondThin",n)}(),__mxOutput.mxMarker=void 0!==mxMarker?mxMarker:void 0,mxUtils.extend(mxActor,mxShape),mxActor.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s),t.fillAndStroke()},mxActor.prototype.redrawPath=function(t,e,n,i,s){var r=i/3;t.moveTo(0,s),t.curveTo(0,3*s/5,0,2*s/5,i/2,2*s/5),t.curveTo(i/2-r,2*s/5,i/2-r,0,i/2,0),t.curveTo(i/2+r,0,i/2+r,2*s/5,i/2,2*s/5),t.curveTo(i,2*s/5,i,3*s/5,i,s),t.close()},__mxOutput.mxActor=void 0!==mxActor?mxActor:void 0,mxUtils.extend(mxCloud,mxActor),mxCloud.prototype.redrawPath=function(t,e,n,i,s){t.moveTo(.25*i,.25*s),t.curveTo(.05*i,.25*s,0,.5*s,.16*i,.55*s),t.curveTo(0,.66*s,.18*i,.9*s,.31*i,.8*s),t.curveTo(.4*i,s,.7*i,s,.8*i,.8*s),t.curveTo(i,.8*s,i,.6*s,.875*i,.5*s),t.curveTo(i,.3*s,.8*i,.1*s,.625*i,.2*s),t.curveTo(.5*i,.05*s,.3*i,.05*s,.25*i,.25*s),t.close()},__mxOutput.mxCloud=void 0!==mxCloud?mxCloud:void 0,mxUtils.extend(mxRectangleShape,mxShape),mxRectangleShape.prototype.isHtmlAllowed=function(){var t=!0;return null!=this.style&&(t="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),!this.isRounded&&!this.glass&&0==this.rotation&&(t||null!=this.fill&&this.fill!=mxConstants.NONE)},mxRectangleShape.prototype.paintBackground=function(t,e,n,i,s){var r=!0;if(null!=this.style&&(r="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1")),r||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE){if(r||null!=this.fill&&this.fill!=mxConstants.NONE||(t.pointerEvents=!1),this.isRounded){var o=0;if("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0))o=Math.min(i/2,Math.min(s/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2));else{var l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100;o=Math.min(i*l,s*l)}t.roundrect(e,n,i,s,o,o)}else t.rect(e,n,i,s);t.fillAndStroke()}},mxRectangleShape.prototype.isRoundable=function(t,e,n,i,s){return!0},mxRectangleShape.prototype.paintForeground=function(t,e,n,i,s){this.glass&&!this.outline&&null!=this.fill&&this.fill!=mxConstants.NONE&&this.paintGlassEffect(t,e,n,i,s,this.getArcSize(i+this.strokewidth,s+this.strokewidth))},__mxOutput.mxRectangleShape=void 0!==mxRectangleShape?mxRectangleShape:void 0,mxUtils.extend(mxEllipse,mxShape),mxEllipse.prototype.paintVertexShape=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},__mxOutput.mxEllipse=void 0!==mxEllipse?mxEllipse:void 0,mxUtils.extend(mxDoubleEllipse,mxShape),mxDoubleEllipse.prototype.vmlScale=10,mxDoubleEllipse.prototype.paintBackground=function(t,e,n,i,s){t.ellipse(e,n,i,s),t.fillAndStroke()},mxDoubleEllipse.prototype.paintForeground=function(t,e,n,i,s){if(!this.outline){var r=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(i/5,s/5)));e+=r,n+=r,s-=2*r,(i-=2*r)>0&&s>0&&t.ellipse(e,n,i,s),t.stroke()}},mxDoubleEllipse.prototype.getLabelBounds=function(t){var e=mxUtils.getValue(this.style,mxConstants.STYLE_MARGIN,Math.min(3+this.strokewidth,Math.min(t.width/5/this.scale,t.height/5/this.scale)))*this.scale;return new mxRectangle(t.x+e,t.y+e,t.width-2*e,t.height-2*e)},__mxOutput.mxDoubleEllipse=void 0!==mxDoubleEllipse?mxDoubleEllipse:void 0,mxUtils.extend(mxRhombus,mxShape),mxRhombus.prototype.isRoundable=function(){return!0},mxRhombus.prototype.paintVertexShape=function(t,e,n,i,s){var r=i/2,o=s/2,l=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,[new mxPoint(e+r,n),new mxPoint(e+i,n+o),new mxPoint(e+r,n+s),new mxPoint(e,n+o)],this.isRounded,l,!0),t.fillAndStroke()},__mxOutput.mxRhombus=void 0!==mxRhombus?mxRhombus:void 0,mxUtils.extend(mxPolyline,mxShape),mxPolyline.prototype.getRotation=function(){return 0},mxPolyline.prototype.getShapeRotation=function(){return 0},mxPolyline.prototype.isPaintBoundsInverted=function(){return!1},mxPolyline.prototype.paintEdgeShape=function(t,e){var n=t.pointerEventsValue;t.pointerEventsValue="stroke",null==this.style||1!=this.style[mxConstants.STYLE_CURVED]?this.paintLine(t,e,this.isRounded):this.paintCurvedLine(t,e),t.pointerEventsValue=n},mxPolyline.prototype.paintLine=function(t,e,n){var i=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;t.begin(),this.addPoints(t,e,n,i,!1),t.stroke()},mxPolyline.prototype.paintCurvedLine=function(t,e){t.begin();var n=e[0],i=e.length;t.moveTo(n.x,n.y);for(var s=1;s2&&t.setMiterLimit(1.42),t.begin();var O=C,I=S;if(l&&!o)this.paintMarker(t,e[0].x,e[0].y,C,S,u,i,r,h,!0);else{var A=e[0].x+T/2+h*C,P=e[0].y+w/2+h*S,_=e[0].x-T/2+h*C,R=e[0].y-w/2+h*S;o?(t.moveTo(A,P),L.push((function(){t.lineTo(_,R)}))):(t.moveTo(_,R),t.lineTo(A,P))}for(var M=0,N=0,H=0,D=0;D=0;D--)L[D]();o?(t.end(),t.stroke()):(t.close(),t.fillAndStroke()),t.setShadow(!1),t.setMiterLimit(4),p&&t.setLineJoin("flat"),e.length>2&&(t.setMiterLimit(4),l&&!o&&(t.begin(),this.paintMarker(t,e[0].x,e[0].y,O,I,u,i,r,h,!0),t.stroke(),t.end()),a&&!o&&(t.begin(),this.paintMarker(t,m.x,m.y,-C,-S,d,s,r,h,!0),t.stroke(),t.end()))}},mxArrowConnector.prototype.paintMarker=function(t,e,n,i,s,r,o,l,a,h){var u=l/o,d=l*s/2,p=-l*i/2,m=(a+r)*i,c=(a+r)*s;h?t.moveTo(e-d+m,n-p+c):t.lineTo(e-d+m,n-p+c),t.lineTo(e-d/u+m,n-p/u+c),t.lineTo(e+a*i,n+a*s),t.lineTo(e+d/u+m,n+p/u+c),t.lineTo(e+d+m,n+p+c)},mxArrowConnector.prototype.isArrowRounded=function(){return this.isRounded},mxArrowConnector.prototype.getStartArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEndArrowWidth=function(){return mxConstants.ARROW_WIDTH},mxArrowConnector.prototype.getEdgeWidth=function(){return mxConstants.ARROW_WIDTH/3},mxArrowConnector.prototype.isOpenEnded=function(){return!1},mxArrowConnector.prototype.isMarkerStart=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE},mxArrowConnector.prototype.isMarkerEnd=function(){return mxUtils.getValue(this.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE},__mxOutput.mxArrowConnector=void 0!==mxArrowConnector?mxArrowConnector:void 0,mxUtils.extend(mxText,mxShape),mxText.prototype.baseSpacingTop=0,mxText.prototype.baseSpacingBottom=0,mxText.prototype.baseSpacingLeft=0,mxText.prototype.baseSpacingRight=0,mxText.prototype.replaceLinefeeds=!0,mxText.prototype.verticalTextRotation=-90,mxText.prototype.ignoreClippedStringSize=!0,mxText.prototype.ignoreStringSize=!1,mxText.prototype.textWidthPadding=8!=document.documentMode||mxClient.IS_EM?3:4,mxText.prototype.lastValue=null,mxText.prototype.cacheEnabled=!0,mxText.prototype.isParseVml=function(){return!1},mxText.prototype.isHtmlAllowed=function(){return 8!=document.documentMode||mxClient.IS_EM},mxText.prototype.getSvgScreenOffset=function(){return 0},mxText.prototype.checkBounds=function(){return!isNaN(this.scale)&&isFinite(this.scale)&&this.scale>0&&null!=this.bounds&&!isNaN(this.bounds.x)&&!isNaN(this.bounds.y)&&!isNaN(this.bounds.width)&&!isNaN(this.bounds.height)},mxText.prototype.paint=function(t,e){var n=this.scale,i=this.bounds.x/n,s=this.bounds.y/n,r=this.bounds.width/n,o=this.bounds.height/n;if(this.updateTransform(t,i,s,r,o),this.configureCanvas(t,i,s,r,o),e)t.updateText(i,s,r,o,this.align,this.valign,this.wrap,this.overflow,this.clipped,this.getTextRotation(),this.node);else{var l=mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML,a=l||t instanceof mxVmlCanvas2D?"html":"",h=this.value;l||"html"!=a||(h=mxUtils.htmlEntities(h,!1)),"html"!=a||mxUtils.isNode(this.value)||(h=mxUtils.replaceTrailingNewlines(h,"

")),h=!mxUtils.isNode(this.value)&&this.replaceLinefeeds&&"html"==a?h.replace(/\n/g,"
"):h;var u=this.textDirection;u!=mxConstants.TEXT_DIRECTION_AUTO||l||(u=this.getAutoDirection()),u!=mxConstants.TEXT_DIRECTION_LTR&&u!=mxConstants.TEXT_DIRECTION_RTL&&(u=null),t.text(i,s,r,o,h,this.align,this.valign,this.wrap,a,this.overflow,this.clipped,this.getTextRotation(),u)}},mxText.prototype.redraw=function(){if(this.visible&&this.checkBounds()&&this.cacheEnabled&&this.lastValue==this.value&&(mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML))if("DIV"!=this.node.nodeName||!this.isHtmlAllowed()&&mxClient.IS_VML){var t=this.createCanvas();null!=t&&null!=t.updateText?(t.pointerEvents=this.pointerEvents,this.paint(t,!0),this.destroyCanvas(t),this.updateBoundingBox()):mxShape.prototype.redraw.apply(this,arguments)}else mxClient.IS_SVG?this.redrawHtmlShapeWithCss3():(this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()),this.updateBoundingBox();else mxShape.prototype.redraw.apply(this,arguments),mxUtils.isNode(this.value)||this.dialect==mxConstants.DIALECT_STRICTHTML?this.lastValue=this.value:this.lastValue=null},mxText.prototype.resetStyles=function(){mxShape.prototype.resetStyles.apply(this,arguments),this.color="black",this.align=mxConstants.ALIGN_CENTER,this.valign=mxConstants.ALIGN_MIDDLE,this.family=mxConstants.DEFAULT_FONTFAMILY,this.size=mxConstants.DEFAULT_FONTSIZE,this.fontStyle=mxConstants.DEFAULT_FONTSTYLE,this.spacing=2,this.spacingTop=2,this.spacingRight=2,this.spacingBottom=2,this.spacingLeft=2,this.horizontal=!0,delete this.background,delete this.border,this.textDirection=mxConstants.DEFAULT_TEXT_DIRECTION,delete this.margin},mxText.prototype.apply=function(t){var e=this.spacing;mxShape.prototype.apply.apply(this,arguments),null!=this.style&&(this.fontStyle=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSTYLE,this.fontStyle),this.family=mxUtils.getValue(this.style,mxConstants.STYLE_FONTFAMILY,this.family),this.size=mxUtils.getValue(this.style,mxConstants.STYLE_FONTSIZE,this.size),this.color=mxUtils.getValue(this.style,mxConstants.STYLE_FONTCOLOR,this.color),this.align=mxUtils.getValue(this.style,mxConstants.STYLE_ALIGN,this.align),this.valign=mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_ALIGN,this.valign),this.spacing=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING,this.spacing)),this.spacingTop=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_TOP,this.spacingTop-e))+this.spacing,this.spacingRight=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_RIGHT,this.spacingRight-e))+this.spacing,this.spacingBottom=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_BOTTOM,this.spacingBottom-e))+this.spacing,this.spacingLeft=parseInt(mxUtils.getValue(this.style,mxConstants.STYLE_SPACING_LEFT,this.spacingLeft-e))+this.spacing,this.horizontal=mxUtils.getValue(this.style,mxConstants.STYLE_HORIZONTAL,this.horizontal),this.background=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,this.background),this.border=mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_BORDERCOLOR,this.border),this.textDirection=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION),this.opacity=mxUtils.getValue(this.style,mxConstants.STYLE_TEXT_OPACITY,100),this.updateMargin()),this.flipV=null,this.flipH=null},mxText.prototype.getAutoDirection=function(){var t=/[A-Za-z\u05d0-\u065f\u066a-\u06ef\u06fa-\u07ff\ufb1d-\ufdff\ufe70-\ufefc]/.exec(this.value);return null!=t&&t.length>0&&t[0]>"z"?mxConstants.TEXT_DIRECTION_RTL:mxConstants.TEXT_DIRECTION_LTR},mxText.prototype.getContentNode=function(){var t=this.node;return null!=t&&(t=null==t.ownerSVGElement?this.node.firstChild.firstChild:t.firstChild.firstChild.firstChild.firstChild.firstChild),t},mxText.prototype.updateBoundingBox=function(){var t=this.node;this.boundingBox=this.bounds.clone();var e=this.getTextRotation(),n=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER):null,i=null!=this.style?mxUtils.getValue(this.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE):null;if(!(this.ignoreStringSize||null==t||"fill"==this.overflow||this.clipped&&this.ignoreClippedStringSize&&n==mxConstants.ALIGN_CENTER&&i==mxConstants.ALIGN_MIDDLE)){var s=null,r=null;if(null!=t.ownerSVGElement)if(null!=t.firstChild&&null!=t.firstChild.firstChild&&"foreignObject"==t.firstChild.firstChild.nodeName)r=(t=t.firstChild.firstChild.firstChild.firstChild).offsetHeight*this.scale,s="width"==this.overflow?this.boundingBox.width:t.offsetWidth*this.scale;else try{var o=t.getBBox();return void("string"==typeof this.value&&0==mxUtils.trim(this.value)||0==o.width&&0==o.height?this.boundingBox=null:this.boundingBox=new mxRectangle(o.x,o.y,o.width,o.height))}catch(t){}else{var l=null!=this.state?this.state.view.textDiv:null;if(null!=this.offsetWidth&&null!=this.offsetHeight)s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale;else{null!=l&&(this.updateFont(l),this.updateSize(l,!1),this.updateInnerHtml(l),t=l);var a=t;if(8!=document.documentMode||mxClient.IS_EM)null!=a.firstChild&&"DIV"==a.firstChild.nodeName&&(a=a.firstChild);else{var h=Math.round(this.bounds.width/this.scale);if(this.wrap&&h>0){if(t.style.wordWrap=mxConstants.WORD_WRAP,t.style.whiteSpace="normal","break-word"!=t.style.wordWrap){var u=a.getElementsByTagName("div");u.length>0&&(a=u[u.length-1]),s=a.offsetWidth+2,u=this.node.getElementsByTagName("div"),this.clipped&&(s=Math.min(h,s)),u.length>1&&(u[u.length-2].style.width=s+"px")}}else t.style.whiteSpace="nowrap"}this.offsetWidth=a.offsetWidth+this.textWidthPadding,this.offsetHeight=a.offsetHeight,s=this.offsetWidth*this.scale,r=this.offsetHeight*this.scale}}null!=s&&null!=r&&(this.boundingBox=new mxRectangle(this.bounds.x,this.bounds.y,s,r))}if(null!=this.boundingBox)if(0!=e){var d=mxUtils.getBoundingBox(new mxRectangle(this.margin.x*this.boundingBox.width,this.margin.y*this.boundingBox.height,this.boundingBox.width,this.boundingBox.height),e,new mxPoint(0,0));this.unrotatedBoundingBox=mxRectangle.fromRectangle(this.boundingBox),this.unrotatedBoundingBox.x+=this.margin.x*this.unrotatedBoundingBox.width,this.unrotatedBoundingBox.y+=this.margin.y*this.unrotatedBoundingBox.height,this.boundingBox.x+=d.x,this.boundingBox.y+=d.y,this.boundingBox.width=d.width,this.boundingBox.height=d.height}else this.boundingBox.x+=this.margin.x*this.boundingBox.width,this.boundingBox.y+=this.margin.y*this.boundingBox.height,this.unrotatedBoundingBox=null},mxText.prototype.getShapeRotation=function(){return 0},mxText.prototype.getTextRotation=function(){return null!=this.state&&null!=this.state.shape?this.state.shape.getTextRotation():0},mxText.prototype.isPaintBoundsInverted=function(){return!this.horizontal&&null!=this.state&&this.state.view.graph.model.isVertex(this.state.cell)},mxText.prototype.configureCanvas=function(t,e,n,i,s){mxShape.prototype.configureCanvas.apply(this,arguments),t.setFontColor(this.color),t.setFontBackgroundColor(this.background),t.setFontBorderColor(this.border),t.setFontFamily(this.family),t.setFontSize(this.size),t.setFontStyle(this.fontStyle)},mxText.prototype.updateVmlContainer=function(){this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width="1px",this.node.style.height="1px",this.node.style.overflow="visible"},mxText.prototype.getHtmlValue=function(){var t=this.value;return this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t},mxText.prototype.getTextCss=function(){var t=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e="display: inline-block; font-size: "+this.size+"px; font-family: "+this.family+"; color: "+this.color+"; line-height: "+t+"; pointer-events: "+(this.pointerEvents?"all":"none")+"; ";(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&(e+="font-weight: bold; "),(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&(e+="font-style: italic; ");var n=[];return(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),n.length>0&&(e+="text-decoration: "+n.join(" ")+"; "),e},mxText.prototype.redrawHtmlShape=function(){if(mxClient.IS_SVG)this.redrawHtmlShapeWithCss3();else{var t=this.node.style;t.whiteSpace="normal",t.overflow="",t.width="",t.height="",this.updateValue(),this.updateFont(this.node),this.updateSize(this.node,null==this.state||null==this.state.view.textDiv),this.offsetWidth=null,this.offsetHeight=null,mxClient.IS_IE&&(null==document.documentMode||document.documentMode<=8)?this.updateHtmlFilter():this.updateHtmlTransform()}},mxText.prototype.redrawHtmlShapeWithCss3=function(){var t=Math.max(0,Math.round(this.bounds.width/this.scale)),e=Math.max(0,Math.round(this.bounds.height/this.scale)),n="position: absolute; left: "+Math.round(this.bounds.x)+"px; top: "+Math.round(this.bounds.y)+"px; pointer-events: none; ",i=this.getTextCss();mxSvgCanvas2D.createCss(t+2,e,this.align,this.valign,this.wrap,this.overflow,this.clipped,null!=this.background?mxUtils.htmlEntities(this.background):null,null!=this.border?mxUtils.htmlEntities(this.border):null,n,i,this.scale,mxUtils.bind(this,(function(t,e,n,i,s,r){var o=this.getTextRotation(),l=(1!=this.scale?"scale("+this.scale+") ":"")+(0!=o?"rotate("+o+"deg) ":"")+(0!=this.margin.x||0!=this.margin.y?"translate("+100*this.margin.x+"%,"+100*this.margin.y+"%)":"");""!=l&&(l="transform-origin: 0 0; transform: "+l+"; "),""==r?(n+=i,i="display:inline-block; min-width: 100%; "+l):(i+=l,mxClient.IS_SF&&(i+="-webkit-clip-path: content-box;")),this.opacity<100&&(s+="opacity: "+this.opacity/100+"; "),this.node.setAttribute("style",n);var a=mxUtils.isNode(this.value)?this.value.outerHTML:this.getHtmlValue();null==this.node.firstChild&&(this.node.innerHTML="
"+a+"
"),this.node.firstChild.firstChild.setAttribute("style",s),this.node.firstChild.setAttribute("style",i)})))},mxText.prototype.updateHtmlTransform=function(){var t=this.getTextRotation(),e=this.node.style,n=this.margin.x,i=this.margin.y;0!=t?(mxUtils.setPrefixedStyle(e,"transformOrigin",100*-n+"% "+100*-i+"%"),mxUtils.setPrefixedStyle(e,"transform","translate("+100*n+"%,"+100*i+"%) scale("+this.scale+") rotate("+t+"deg)")):(mxUtils.setPrefixedStyle(e,"transformOrigin","0% 0%"),mxUtils.setPrefixedStyle(e,"transform","scale("+this.scale+") translate("+100*n+"%,"+100*i+"%)")),e.left=Math.round(this.bounds.x-Math.ceil(n*("fill"!=this.overflow&&"width"!=this.overflow?3:1)))+"px",e.top=Math.round(this.bounds.y-i*("fill"!=this.overflow?3:1))+"px",this.opacity<100?e.opacity=this.opacity/100:e.opacity=""},mxText.prototype.updateInnerHtml=function(t){if(mxUtils.isNode(this.value))t.innerHTML=this.value.outerHTML;else{var e=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(e=mxUtils.htmlEntities(e,!1)),e=mxUtils.replaceTrailingNewlines(e,"
 
"),e='
'+(e=this.replaceLinefeeds?e.replace(/\n/g,"
"):e)+"
",t.innerHTML=e}},mxText.prototype.updateHtmlFilter=function(){var t=this.node.style,e=this.margin.x,n=this.margin.y,i=this.scale;mxUtils.setOpacity(this.node,this.opacity);var s=0,r=0,o=null!=this.state?this.state.view.textDiv:null,l=this.node;if(null!=o){o.style.overflow="",o.style.height="",o.style.width="",this.updateFont(o),this.updateSize(o,!1),this.updateInnerHtml(o);var a=Math.round(this.bounds.width/this.scale);this.wrap&&a>0?(o.style.whiteSpace="normal",o.style.wordWrap=mxConstants.WORD_WRAP,s=a,this.clipped&&(s=Math.min(s,this.bounds.width)),o.style.width=s+"px"):o.style.whiteSpace="nowrap",null!=(l=o).firstChild&&"DIV"==l.firstChild.nodeName&&(l=l.firstChild,this.wrap&&"break-word"==o.style.wordWrap&&(l.style.width="100%")),!this.clipped&&this.wrap&&a>0&&(s=l.offsetWidth+this.textWidthPadding,o.style.width=s+"px"),r=l.offsetHeight+2,mxClient.IS_QUIRKS&&null!=this.border&&this.border!=mxConstants.NONE&&(r+=3)}else null!=l.firstChild&&"DIV"==l.firstChild.nodeName&&(r=(l=l.firstChild).offsetHeight);s=l.offsetWidth+this.textWidthPadding,this.clipped&&(r=Math.min(r,this.bounds.height));a=this.bounds.width/i;var h=this.bounds.height/i;"fill"==this.overflow?(r=h,s=a):"width"==this.overflow&&(r=l.scrollHeight,s=a),this.offsetWidth=s,this.offsetHeight=r,mxClient.IS_QUIRKS&&(this.clipped||"width"==this.overflow&&h>0)?(h=Math.min(h,r),t.height=Math.round(h)+"px"):h=r,"fill"!=this.overflow&&"width"!=this.overflow&&(this.clipped&&(s=Math.min(a,s)),a=s,(mxClient.IS_QUIRKS&&this.clipped||this.wrap)&&(t.width=Math.round(a)+"px")),h*=i,a*=i;var u=this.getTextRotation()*(Math.PI/180),d=parseFloat(parseFloat(Math.cos(u)).toFixed(8)),p=parseFloat(parseFloat(Math.sin(-u)).toFixed(8));(u%=2*Math.PI)<0&&(u+=2*Math.PI),(u%=Math.PI)>Math.PI/2&&(u=Math.PI-u);var m=Math.cos(u),c=Math.sin(-u),g=a*-(e+.5),x=h*-(n+.5),y=(h-h*m+a*c)/2+p*g-d*x,f=(a-a*m+h*c)/2-d*g-p*x;if(0!=u){var v="progid:DXImageTransform.Microsoft.Matrix(M11="+d+", M12="+p+", M21="+-p+", M22="+d+", sizingMethod='auto expand')";null!=t.filter&&t.filter.length>0?t.filter+=" "+v:t.filter=v}n=0;"fill"!=this.overflow&&mxClient.IS_QUIRKS&&(this.valign==mxConstants.ALIGN_TOP?n-=1:this.valign==mxConstants.ALIGN_BOTTOM?n+=2:n+=1),t.zoom=i,t.left=Math.round(this.bounds.x+f-a/2)+"px",t.top=Math.round(this.bounds.y+y-h/2+n)+"px"},mxText.prototype.updateValue=function(){if(mxUtils.isNode(this.value))this.node.innerHTML="",this.node.appendChild(this.value);else{var t=this.value;this.dialect!=mxConstants.DIALECT_STRICTHTML&&(t=mxUtils.htmlEntities(t,!1)),t=mxUtils.replaceTrailingNewlines(t,"

"),t=this.replaceLinefeeds?t.replace(/\n/g,"
"):t;var e=null!=this.background&&this.background!=mxConstants.NONE?this.background:null,n=null!=this.border&&this.border!=mxConstants.NONE?this.border:null;if("fill"==this.overflow||"width"==this.overflow)null!=e&&(this.node.style.backgroundColor=e),null!=n&&(this.node.style.border="1px solid "+n);else{var i="";null!=e&&(i+="background-color:"+mxUtils.htmlEntities(e)+";"),null!=n&&(i+="border:1px solid "+mxUtils.htmlEntities(n)+";"),t='
'+t+"
"}this.node.innerHTML=t;var s=this.node.getElementsByTagName("div");if(s.length>0){var r=this.textDirection;r==mxConstants.TEXT_DIRECTION_AUTO&&this.dialect!=mxConstants.DIALECT_STRICTHTML&&(r=this.getAutoDirection()),r==mxConstants.TEXT_DIRECTION_LTR||r==mxConstants.TEXT_DIRECTION_RTL?s[s.length-1].setAttribute("dir",r):s[s.length-1].removeAttribute("dir")}}},mxText.prototype.updateFont=function(t){var e=t.style;e.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?this.size*mxConstants.LINE_HEIGHT+"px":mxConstants.LINE_HEIGHT,e.fontSize=this.size+"px",e.fontFamily=this.family,e.verticalAlign="top",e.color=this.color,(this.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?e.fontWeight="bold":e.fontWeight="",(this.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?e.fontStyle="italic":e.fontStyle="";var n=[];(this.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&n.push("underline"),(this.fontStyle&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&n.push("line-through"),e.textDecoration=n.join(" "),this.align==mxConstants.ALIGN_CENTER?e.textAlign="center":this.align==mxConstants.ALIGN_RIGHT?e.textAlign="right":e.textAlign="left"},mxText.prototype.updateSize=function(t,e){var n=Math.max(0,Math.round(this.bounds.width/this.scale)),i=Math.max(0,Math.round(this.bounds.height/this.scale)),s=t.style;if(this.clipped?(s.overflow="hidden",mxClient.IS_QUIRKS?s.width=n+"px":(s.maxHeight=i+"px",s.maxWidth=n+"px")):"fill"==this.overflow?(s.width=n+1+"px",s.height=i+1+"px",s.overflow="hidden"):"width"==this.overflow&&(s.width=n+1+"px",s.maxHeight=i+1+"px",s.overflow="hidden"),this.wrap&&n>0){if(s.wordWrap=mxConstants.WORD_WRAP,s.whiteSpace="normal",s.width=n+"px",e&&"fill"!=this.overflow&&"width"!=this.overflow){var r=t;null!=r.firstChild&&"DIV"==r.firstChild.nodeName&&(r=r.firstChild,"break-word"==t.style.wordWrap&&(r.style.width="100%"));var o=r.offsetWidth;if(0==o){var l=t.parentNode;t.style.visibility="hidden",document.body.appendChild(t),o=r.offsetWidth,t.style.visibility="",l.appendChild(t)}o+=3,this.clipped&&(o=Math.min(o,n)),s.width=o+"px"}}else s.whiteSpace="nowrap"},mxText.prototype.updateMargin=function(){this.margin=mxUtils.getAlignmentAsPoint(this.align,this.valign)},mxText.prototype.getSpacing=function(){return new mxPoint(this.align==mxConstants.ALIGN_CENTER?(this.spacingLeft-this.spacingRight)/2:this.align==mxConstants.ALIGN_RIGHT?-this.spacingRight-this.baseSpacingRight:this.spacingLeft+this.baseSpacingLeft,this.valign==mxConstants.ALIGN_MIDDLE?(this.spacingTop-this.spacingBottom)/2:this.valign==mxConstants.ALIGN_BOTTOM?-this.spacingBottom-this.baseSpacingBottom:this.spacingTop+this.baseSpacingTop)},__mxOutput.mxText=void 0!==mxText?mxText:void 0,mxUtils.extend(mxTriangle,mxActor),mxTriangle.prototype.isRoundable=function(){return!0},mxTriangle.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(0,0),new mxPoint(i,.5*s),new mxPoint(0,s)],this.isRounded,r,!0)},__mxOutput.mxTriangle=void 0!==mxTriangle?mxTriangle:void 0,mxUtils.extend(mxHexagon,mxActor),mxHexagon.prototype.redrawPath=function(t,e,n,i,s){var r=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(t,[new mxPoint(.25*i,0),new mxPoint(.75*i,0),new mxPoint(i,.5*s),new mxPoint(.75*i,s),new mxPoint(.25*i,s),new mxPoint(0,.5*s)],this.isRounded,r,!0)},__mxOutput.mxHexagon=void 0!==mxHexagon?mxHexagon:void 0,mxUtils.extend(mxLine,mxShape),mxLine.prototype.vertical=!1,mxLine.prototype.paintVertexShape=function(t,e,n,i,s){if(t.begin(),this.vertical){var r=e+i/2;t.moveTo(r,n),t.lineTo(r,n+s)}else{r=n+s/2;t.moveTo(e,r),t.lineTo(e+i,r)}t.stroke()},__mxOutput.mxLine=void 0!==mxLine?mxLine:void 0,mxUtils.extend(mxImageShape,mxRectangleShape),mxImageShape.prototype.preserveImageAspect=!0,mxImageShape.prototype.getSvgScreenOffset=function(){return 0},mxImageShape.prototype.apply=function(t){mxShape.prototype.apply.apply(this,arguments),this.fill=null,this.stroke=null,this.gradient=null,null!=this.style&&(this.preserveImageAspect=1==mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_ASPECT,1),this.flipH=this.flipH||1==mxUtils.getValue(this.style,"imageFlipH",0),this.flipV=this.flipV||1==mxUtils.getValue(this.style,"imageFlipV",0))},mxImageShape.prototype.isHtmlAllowed=function(){return!this.preserveImageAspect},mxImageShape.prototype.createHtml=function(){var t=document.createElement("div");return t.style.position="absolute",t},mxImageShape.prototype.isRoundable=function(t,e,n,i,s){return!1},mxImageShape.prototype.paintVertexShape=function(t,e,n,i,s){if(null!=this.image){var r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,null),o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null);null!=r&&(t.setFillColor(r),t.setStrokeColor(o),t.rect(e,n,i,s),t.fillAndStroke()),t.image(e,n,i,s,this.image,this.preserveImageAspect,!1,!1),null!=(o=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,null))&&(t.setShadow(!1),t.setStrokeColor(o),t.rect(e,n,i,s),t.stroke())}else mxRectangleShape.prototype.paintBackground.apply(this,arguments)},mxImageShape.prototype.redrawHtmlShape=function(){if(this.node.style.left=Math.round(this.bounds.x)+"px",this.node.style.top=Math.round(this.bounds.y)+"px",this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px",this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px",this.node.innerHTML="",null!=this.image){var t=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),e=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor=t,this.node.style.borderColor=e;var n=mxClient.IS_IE6||(null==document.documentMode||document.documentMode<=8)&&0!=this.rotation,i=document.createElement(n?mxClient.VML_PREFIX+":image":"img");i.setAttribute("border","0"),i.style.position="absolute",i.src=this.image;var s=this.opacity<100?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=s,this.flipH&&this.flipV?s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?s+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(s+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"),i.style.filter!=s&&(i.style.filter=s),"image"==i.nodeName?i.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(i.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(i.style,"transform",""),i.style.width=this.node.style.width,i.style.height=this.node.style.height,this.node.style.backgroundImage="",this.node.appendChild(i)}else this.setTransparentBackgroundImage(this.node)},__mxOutput.mxImageShape=void 0!==mxImageShape?mxImageShape:void 0,mxUtils.extend(mxLabel,mxRectangleShape),mxLabel.prototype.imageSize=mxConstants.DEFAULT_IMAGESIZE,mxLabel.prototype.spacing=2,mxLabel.prototype.indicatorSize=10,mxLabel.prototype.indicatorSpacing=2,mxLabel.prototype.init=function(t){mxShape.prototype.init.apply(this,arguments),null!=this.indicatorShape&&(this.indicator=new this.indicatorShape,this.indicator.dialect=this.dialect,this.indicator.init(this.node))},mxLabel.prototype.redraw=function(){null!=this.indicator&&(this.indicator.fill=this.indicatorColor,this.indicator.stroke=this.indicatorStrokeColor,this.indicator.gradient=this.indicatorGradientColor,this.indicator.direction=this.indicatorDirection,this.indicator.redraw()),mxShape.prototype.redraw.apply(this,arguments)},mxLabel.prototype.isHtmlAllowed=function(){return mxRectangleShape.prototype.isHtmlAllowed.apply(this,arguments)&&null==this.indicatorColor&&null==this.indicatorShape},mxLabel.prototype.paintForeground=function(t,e,n,i,s){this.paintImage(t,e,n,i,s),this.paintIndicator(t,e,n,i,s),mxRectangleShape.prototype.paintForeground.apply(this,arguments)},mxLabel.prototype.paintImage=function(t,e,n,i,s){if(null!=this.image){var r=this.getImageBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.image,!1,!1,!1)}},mxLabel.prototype.getImageBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_WIDTH,mxConstants.DEFAULT_IMAGESIZE),l=mxUtils.getNumber(this.style,mxConstants.STYLE_IMAGE_HEIGHT,mxConstants.DEFAULT_IMAGESIZE),a=mxUtils.getNumber(this.style,mxConstants.STYLE_SPACING,this.spacing)+5;return s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:s==mxConstants.ALIGN_RIGHT?t+=n-o-a:t+=a,r==mxConstants.ALIGN_TOP?e+=a:r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.paintIndicator=function(t,e,n,i,s){if(null!=this.indicator)this.indicator.bounds=this.getIndicatorBounds(e,n,i,s),this.indicator.paint(t);else if(null!=this.indicatorImage){var r=this.getIndicatorBounds(e,n,i,s);t.image(r.x,r.y,r.width,r.height,this.indicatorImage,!1,!1,!1)}},mxLabel.prototype.getIndicatorBounds=function(t,e,n,i){var s=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_ALIGN,mxConstants.ALIGN_LEFT),r=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE),o=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_WIDTH,this.indicatorSize),l=mxUtils.getNumber(this.style,mxConstants.STYLE_INDICATOR_HEIGHT,this.indicatorSize),a=this.spacing+5;return s==mxConstants.ALIGN_RIGHT?t+=n-o-a:s==mxConstants.ALIGN_CENTER?t+=(n-o)/2:t+=a,r==mxConstants.ALIGN_BOTTOM?e+=i-l-a:r==mxConstants.ALIGN_TOP?e+=a:e+=(i-l)/2,new mxRectangle(t,e,o,l)},mxLabel.prototype.redrawHtmlShape=function(){for(mxRectangleShape.prototype.redrawHtmlShape.apply(this,arguments);this.node.hasChildNodes();)this.node.removeChild(this.node.lastChild);if(null!=this.image){var t=document.createElement("img");t.style.position="relative",t.setAttribute("border","0");var e=this.getImageBounds(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height);e.x-=this.bounds.x,e.y-=this.bounds.y,t.style.left=Math.round(e.x)+"px",t.style.top=Math.round(e.y)+"px",t.style.width=Math.round(e.width)+"px",t.style.height=Math.round(e.height)+"px",t.src=this.image,this.node.appendChild(t)}},__mxOutput.mxLabel=void 0!==mxLabel?mxLabel:void 0,mxUtils.extend(mxCylinder,mxShape),mxCylinder.prototype.maxHeight=40,mxCylinder.prototype.svgStrokeTolerance=0,mxCylinder.prototype.paintVertexShape=function(t,e,n,i,s){t.translate(e,n),t.begin(),this.redrawPath(t,e,n,i,s,!1),t.fillAndStroke(),this.outline&&null!=this.style&&0!=mxUtils.getValue(this.style,mxConstants.STYLE_BACKGROUND_OUTLINE,0)||(t.setShadow(!1),t.begin(),this.redrawPath(t,e,n,i,s,!0),t.stroke())},mxCylinder.prototype.getCylinderSize=function(t,e,n,i){return Math.min(this.maxHeight,Math.round(i/5))},mxCylinder.prototype.redrawPath=function(t,e,n,i,s,r){var o=this.getCylinderSize(e,n,i,s);(r&&null!=this.fill||!r&&null==this.fill)&&(t.moveTo(0,o),t.curveTo(0,2*o,i,2*o,i,o),r||(t.stroke(),t.begin())),r||(t.moveTo(0,o),t.curveTo(0,-o/3,i,-o/3,i,o),t.lineTo(i,s-o),t.curveTo(i,s+o/3,0,s+o/3,0,s-o),t.close())},__mxOutput.mxCylinder=void 0!==mxCylinder?mxCylinder:void 0,mxUtils.extend(mxConnector,mxPolyline),mxConnector.prototype.updateBoundingBox=function(){this.useSvgBoundingBox=null!=this.style&&1==this.style[mxConstants.STYLE_CURVED],mxShape.prototype.updateBoundingBox.apply(this,arguments)},mxConnector.prototype.paintEdgeShape=function(t,e){var n=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);mxPolyline.prototype.paintEdgeShape.apply(this,arguments),t.setFillColor(this.stroke),t.setShadow(!1),t.setDashed(!1),null!=n&&n(),null!=i&&i()},mxConnector.prototype.createMarker=function(t,e,n){var i=null,s=e.length,r=mxUtils.getValue(this.style,n?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW),o=n?e[1]:e[s-2],l=n?e[0]:e[s-1];if(null!=r&&null!=o&&null!=l){for(var a=1;a0)for(var l=0;lt.weightedValue?-1:e.weightedValueh)break;l=m}}}var c=s.getIndex(t);c=Math.max(0,o-(o>c?1:0)),i.add(s,t,c)}},mxStackLayout.prototype.getParentSize=function(t){var e=this.graph.getModel(),n=e.getGeometry(t);null!=this.graph.container&&(null==n&&e.isLayer(t)||t==this.graph.getView().currentRoot)&&(n=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));return n},mxStackLayout.prototype.getLayoutCells=function(t){for(var e=this.graph.getModel(),n=e.getChildCount(t),i=[],s=0;si.x>0?1:-1:n.y==i.y?0:n.y>i.y>0?1:-1}))),i},mxStackLayout.prototype.snap=function(t){if(null!=this.gridSize&&this.gridSize>0&&(t=Math.max(t,this.gridSize))/this.gridSize>1){var e=t%this.gridSize;t+=e>this.gridSize/2?this.gridSize-e:-e}return t},mxStackLayout.prototype.execute=function(t){if(null!=t){var e=this.getParentSize(t),n=this.isHorizontal(),i=this.graph.getModel(),s=null;null!=e&&(s=n?e.height-this.marginTop-this.marginBottom:e.width-this.marginLeft-this.marginRight),s-=2*this.border;var r=this.x0+this.border+this.marginLeft,o=this.y0+this.border+this.marginTop;if(this.graph.isSwimlane(t)){var l=this.graph.getCellStyle(t),a=mxUtils.getNumber(l,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE),h=1==mxUtils.getValue(l,mxConstants.STYLE_HORIZONTAL,!0);null!=e&&(a=h?Math.min(a,e.height):Math.min(a,e.width)),n==h&&(s-=a),h?o+=a:r+=a}i.beginUpdate();try{for(var u=0,d=null,p=0,m=null,c=this.getLayoutCells(t),g=0;gthis.wrap||!n&&d.y+d.height+y.height+2*this.spacing>this.wrap)&&(d=null,n?o+=u+this.spacing:r+=u+this.spacing,u=0),u=Math.max(u,n?y.height:y.width);var f=0;if(!this.borderCollapse){var v=this.graph.getCellStyle(x);f=mxUtils.getNumber(v,mxConstants.STYLE_STROKEWIDTH,1)}if(null!=d){var C=p+this.spacing+Math.floor(f/2);n?y.x=this.snap((this.allowGaps?Math.max(C,y.x):C)-this.marginLeft)+this.marginLeft:y.y=this.snap((this.allowGaps?Math.max(C,y.y):C)-this.marginTop)+this.marginTop}else this.keepFirstLocation||(n?y.x=this.allowGaps&&y.x>r?Math.max(this.snap(y.x-this.marginLeft)+this.marginLeft,r):r:y.y=this.allowGaps&&y.y>o?Math.max(this.snap(y.y-this.marginTop)+this.marginTop,o):o);n?y.y=o:y.x=r,this.fill&&null!=s&&(n?y.height=s:y.width=s),n?y.width=this.snap(y.width):y.height=this.snap(y.height),this.setChildGeometry(x,y),m=x,d=y,p=n?d.x+d.width+Math.floor(f/2):d.y+d.height+Math.floor(f/2)}}this.resizeParent&&null!=e&&null!=d&&!this.graph.isCellCollapsed(t)?this.updateParentGeometry(t,e,d):this.resizeLast&&null!=e&&null!=d&&null!=m&&(n?d.width=e.width-d.x-this.spacing-this.marginRight-this.marginLeft:d.height=e.height-d.y-this.spacing-this.marginBottom,this.setChildGeometry(m,d))}finally{i.endUpdate()}}},mxStackLayout.prototype.setChildGeometry=function(t,e){var n=this.graph.getCellGeometry(t);null!=n&&e.x==n.x&&e.y==n.y&&e.width==n.width&&e.height==n.height||this.graph.getModel().setGeometry(t,e)},mxStackLayout.prototype.updateParentGeometry=function(t,e,n){var i=this.isHorizontal(),s=this.graph.getModel(),r=e.clone();if(i){var o=n.x+n.width+this.marginRight+this.border;this.resizeParentMax?r.width=Math.max(r.width,o):r.width=o}else{o=n.y+n.height+this.marginBottom+this.border;this.resizeParentMax?r.height=Math.max(r.height,o):r.height=o}e.x==r.x&&e.y==r.y&&e.width==r.width&&e.height==r.height||s.setGeometry(t,r)},__mxOutput.mxStackLayout=void 0!==mxStackLayout?mxStackLayout:void 0,mxPartitionLayout.prototype=new mxGraphLayout,mxPartitionLayout.prototype.constructor=mxPartitionLayout,mxPartitionLayout.prototype.horizontal=null,mxPartitionLayout.prototype.spacing=null,mxPartitionLayout.prototype.border=null,mxPartitionLayout.prototype.resizeVertices=!0,mxPartitionLayout.prototype.isHorizontal=function(){return this.horizontal},mxPartitionLayout.prototype.moveCell=function(t,e,n){var i=this.graph.getModel(),s=i.getParent(t);if(null!=t&&null!=s){var r=0,o=0,l=i.getChildCount(s);for(r=0;re)break;o=u}}var d=s.getIndex(t);d=Math.max(0,r-(r>d?1:0)),i.add(s,t,d)}},mxPartitionLayout.prototype.execute=function(t){var e=this.isHorizontal(),n=this.graph.getModel(),i=n.getGeometry(t);null!=this.graph.container&&(null==i&&n.isLayer(t)||t==this.graph.getView().currentRoot)&&(i=new mxRectangle(0,0,this.graph.container.offsetWidth-1,this.graph.container.offsetHeight-1));if(null!=i){for(var s=[],r=n.getChildCount(t),o=0;o0){var h=this.border,u=this.border,d=e?i.height:i.width;d-=2*this.border;var p=this.graph.isSwimlane(t)?this.graph.getStartSize(t):new mxRectangle;d-=e?p.height:p.width,h+=p.width,u+=p.height;var m=this.border+(a-1)*this.spacing,c=e?(i.width-h-m)/a:(i.height-u-m)/a;if(c>0){n.beginUpdate();try{for(o=0;o0)this.root=t;else{var i=this.graph.findTreeRoots(t,!0,this.invert);if(i.length>0)for(var s=0;s0){this.root=i[s];break}}else this.root=e;if(null!=this.root){if(this.resizeParent?this.parentsChanged=new Object:this.parentsChanged=null,this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(a=this.graph.getCellGeometry(t))&&(this.parentX=a.x,this.parentY=a.y);n.beginUpdate();try{if(this.visited=new Object,this.node=this.dfs(this.root,t),this.alignRanks&&(this.maxRankHeight=[],this.findRankHeights(this.node,0),this.setCellHeights(this.node,0)),null!=this.node){this.layout(this.node);var r=this.graph.gridSize,o=r;if(!this.moveTree){var l=this.getVertexBounds(this.root);null!=l&&(r=l.x,o=l.y)}var a,h=null;if(null!=(h=this.isHorizontal()?this.horizontalLayout(this.node,r,o):this.verticalLayout(this.node,null,r,o))){var u=0,d=0;h.x<0&&(u=Math.abs(r-h.x)),h.y<0&&(d=Math.abs(o-h.y)),0==u&&0==d||this.moveNode(this.node,u,d),this.resizeParent&&this.adjustParents(),this.edgeRouting&&this.localEdgeProcessing(this.node)}if(null!=this.parentX&&null!=this.parentY)null!=(a=this.graph.getCellGeometry(t))&&((a=a.clone()).x=this.parentX,a.y=this.parentY,n.setGeometry(t,a))}}finally{n.endUpdate()}}},mxCompactTreeLayout.prototype.moveNode=function(t,e,n){t.x+=e,t.y+=n,this.apply(t);for(var i=t.child;null!=i;)this.moveNode(i,e,n),i=i.next},mxCompactTreeLayout.prototype.sortOutgoingEdges=function(t,e){var n=new mxDictionary;e.sort((function(e,i){var s=e.getTerminal(e.getTerminal(!1)==t),r=n.get(s);null==r&&(r=mxCellPath.create(s).split(mxCellPath.PATH_SEPARATOR),n.put(s,r));var o=i.getTerminal(i.getTerminal(!1)==t),l=n.get(o);return null==l&&(l=mxCellPath.create(o).split(mxCellPath.PATH_SEPARATOR),n.put(o,l)),mxCellPath.compare(r,l)}))},mxCompactTreeLayout.prototype.findRankHeights=function(t,e){(null==this.maxRankHeight[e]||this.maxRankHeight[e]t.height&&(t.height=this.maxRankHeight[e]);for(var n=t.child;null!=n;)this.setCellHeights(n,e+1),n=n.next},mxCompactTreeLayout.prototype.dfs=function(t,e){var n=mxCellPath.create(t),i=null;if(null!=t&&null==this.visited[n]&&!this.isVertexIgnored(t)){this.visited[n]=t,i=this.createNode(t);var s=this.graph.getModel(),r=null,o=this.graph.getEdges(t,e,this.invert,!this.invert,!1,!0),l=this.graph.getView();this.sortEdges&&this.sortOutgoingEdges(t,o);for(var a=0;a0)if(t<0)o=t*i/n-e;else if(t>0){o=t*r/s-e}else o=-e;else if(st+n){o=(n+t)*r/s-(e+i)}else o=r-(e+i);return o>0?o:0},mxCompactTreeLayout.prototype.bridge=function(t,e,n,i,s,r){var o=s+i.dx-e,l=0;l=0==i.dx?i.dy:o*i.dy/i.dx;var a=this.createLine(o,l,i.next);return t.next=this.createLine(0,r+i.dy-l-n,a),a},mxCompactTreeLayout.prototype.createNode=function(t){var e=new Object;e.cell=t,e.x=0,e.y=0,e.width=0,e.height=0;var n=this.getVertexBounds(t);return null!=n&&(this.isHorizontal()?(e.width=n.height,e.height=n.width):(e.width=n.width,e.height=n.height)),e.offsetX=0,e.offsetY=0,e.contour=new Object,e},mxCompactTreeLayout.prototype.apply=function(t,e){var n=this.graph.getModel(),i=t.cell,s=n.getGeometry(i);if(null!=i&&null!=s){if(this.isVertexMovable(i)&&(s=this.setVertexLocation(i,t.x,t.y),this.resizeParent)){var r=n.getParent(i),o=mxCellPath.create(r);null==this.parentsChanged[o]&&(this.parentsChanged[o]=r)}e=null==e?new mxRectangle(s.x,s.y,s.width,s.height):new mxRectangle(Math.min(e.x,s.x),Math.min(e.y,s.y),Math.max(e.x+e.width,s.x+s.width),Math.max(e.y+e.height,s.y+s.height))}return e},mxCompactTreeLayout.prototype.createLine=function(t,e,n){var i=new Object;return i.dx=t,i.dy=e,i.next=n,i},mxCompactTreeLayout.prototype.adjustParents=function(){var t=[];for(var e in this.parentsChanged)t.push(this.parentsChanged[e]);this.arrangeGroups(mxUtils.sortCells(t,!0),this.groupPadding,this.groupPaddingTop,this.groupPaddingRight,this.groupPaddingBottom,this.groupPaddingLeft)},mxCompactTreeLayout.prototype.localEdgeProcessing=function(t){this.processNodeOutgoing(t);for(var e=t.child;null!=e;)this.localEdgeProcessing(e),e=e.next},mxCompactTreeLayout.prototype.processNodeOutgoing=function(t){for(var e=t.child,n=t.cell,i=0,s=[];null!=e;){i++;var r=e.x;this.horizontal&&(r=e.y),s.push(new WeightedCellSorter(e,r)),e=e.next}s.sort(WeightedCellSorter.prototype.compare);var o=t.width,l=(i+1)*this.prefHozEdgeSep;o>l+2*this.prefHozEdgeSep&&(o-=2*this.prefHozEdgeSep);var a=o/i,h=a/2;o>l+2*this.prefHozEdgeSep&&(h+=this.prefHozEdgeSep);var u=this.minEdgeJetty-this.prefVertEdgeOff,d=this.getVertexBounds(n);e=t.child;for(var p=0;pi/2&&(u-=this.prefVertEdgeOff),h+=a}},__mxOutput.mxCompactTreeLayout=void 0!==mxCompactTreeLayout?mxCompactTreeLayout:void 0,mxUtils.extend(mxRadialTreeLayout,mxCompactTreeLayout),mxRadialTreeLayout.prototype.angleOffset=.5,mxRadialTreeLayout.prototype.rootx=0,mxRadialTreeLayout.prototype.rooty=0,mxRadialTreeLayout.prototype.levelDistance=120,mxRadialTreeLayout.prototype.nodeDistance=10,mxRadialTreeLayout.prototype.autoRadius=!1,mxRadialTreeLayout.prototype.sortEdges=!1,mxRadialTreeLayout.prototype.rowMinX=[],mxRadialTreeLayout.prototype.rowMaxX=[],mxRadialTreeLayout.prototype.rowMinCenX=[],mxRadialTreeLayout.prototype.rowMaxCenX=[],mxRadialTreeLayout.prototype.rowRadi=[],mxRadialTreeLayout.prototype.row=[],mxRadialTreeLayout.prototype.isVertexIgnored=function(t){return mxGraphLayout.prototype.isVertexIgnored.apply(this,arguments)||0==this.graph.getConnections(t).length},mxRadialTreeLayout.prototype.execute=function(t,e){this.parent=t,this.useBoundingBox=!1,this.edgeRouting=!1,mxCompactTreeLayout.prototype.execute.apply(this,arguments);var n=null,i=this.getVertexBounds(this.root);for(var s in this.centerX=i.x+i.width/2,this.centerY=i.y+i.height/2,this.visited){var r=this.getVertexBounds(this.visited[s]);(n=null!=n?n:r.clone()).add(r)}this.calcRowDims([this.node],0);for(var o=0,l=0,a=0;a=0;a--){var y=this.row[a];for(m=0;m0){var E=C/v;if(E>c.theta&&m0){var b=y[m-1].theta;c.theta=Math.max(E,b+Math.PI/10)}}}}for(a=0;athis.maxDistanceLimit)continue;o1&&this.layout(s)}}finally{this.graph.model.endUpdate()}},mxParallelEdgeLayout.prototype.findParallels=function(t,e){var n=[],i=mxUtils.bind(this,(function(t){if(!this.isEdgeIgnored(t)){var e=this.getEdgeId(t);null!=e&&(null==n[e]&&(n[e]=[]),n[e].push(t))}}));if(null!=e)for(var s=0;si?i+"-"+n:n+"-"+i)+s}return null},mxParallelEdgeLayout.prototype.layout=function(t){var e=t[0],n=this.graph.getView(),i=this.graph.getModel(),s=i.getGeometry(n.getVisibleTerminal(e,!0)),r=i.getGeometry(n.getVisibleTerminal(e,!1));if(s==r)for(var o=s.x+s.width+this.spacing,l=s.y+s.height/2,a=0;a0){o=h+d/2,l=u+p/2;var c=p*this.spacing/m,g=d*this.spacing/m;o+=c*(t.length-1)/2,l-=g*(t.length-1)/2;for(a=0;a0?this.edges[0]:null},__mxOutput.mxGraphHierarchyEdge=void 0!==mxGraphHierarchyEdge?mxGraphHierarchyEdge:void 0,mxGraphHierarchyModel.prototype.maxRank=null,mxGraphHierarchyModel.prototype.vertexMapper=null,mxGraphHierarchyModel.prototype.edgeMapper=null,mxGraphHierarchyModel.prototype.ranks=null,mxGraphHierarchyModel.prototype.roots=null,mxGraphHierarchyModel.prototype.parent=null,mxGraphHierarchyModel.prototype.dfsCount=0,mxGraphHierarchyModel.prototype.SOURCESCANSTARTRANK=1e8,mxGraphHierarchyModel.prototype.tightenToSource=!1,mxGraphHierarchyModel.prototype.createInternalCells=function(t,e,n){for(var i=t.getGraph(),s=0;s0&&null==this.edgeMapper.get(a[0])&&2*h.length>=a.length){for(var u=new mxGraphHierarchyEdge(a),d=0;d0;){var s;d=(h=t[0]).connectsAsTarget,s=h.connectsAsSource;var r=!0,o=this.SOURCESCANSTARTRANK;for(e=0;e1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o0&&null==this.edgeMapper.get(u[0])&&2*d.length>=u.length){for(var p=new mxGraphHierarchyEdge(u),m=0;m=0;n--)n==this.ranksPerGroup.length-1?s[n]=0:s[n]=r[n+1]+1,r[n]=s[n]+this.ranksPerGroup[n];this.maxRank=r[0];var o=this.vertexMapper.getValues();for(n=0;n0;){var l,a;l=(i=t[0]).connectsAsTarget,a=i.connectsAsSource;var h=!0,u=r[0];for(n=0;nr[i.swimlaneIndex]&&(u=r[i.swimlaneIndex]),i.temp[0]=u,null!=a)for(n=0;n1){i.maxRank=e.maxRank,i.minRank=n.maxRank,i.temp=[],i.x=[],i.y=[];for(var o=i.minRank+1;o0;)y%2&&(n+=x[y+1]),++x[y=y-1>>1]}return n},mxMedianHybridCrossingReduction.prototype.transpose=function(t,e){for(var n=!0,i=0;n&&i++<10;){var s=t%2==1&&i%2==1;n=!1;for(var r=0;ry[T]&&S++,g[E]f[T]&&S++,x[E]=0;i--)this.medianRank(i,n);else for(i=1;it.medianValue?-1:e.medianValue0&&h<=a;){var u=e.shift(),d=u.cell,p=u.weightedValue,m=parseInt(u.rankIndex),c=d.getNextLayerConnectedCells(p),g=d.getPreviousLayerConnectedCells(p),x=c.length,y=g.length,f=this.medianXValue(c,p+1),v=this.medianXValue(g,p-1),C=x+y,E=d.getGeneralPurposeVariable(p),S=E;C>0&&(S=(f*x+v*y)/C);var b=!1;if(SE+1){if(m==i[p].length-1)d.setGeneralPurposeVariable(p,S),b=!0;else{var L=i[p][m+1],O=L.getGeneralPurposeVariable(p);(O=O-L.width/2-this.intraCellSpacing-d.width/2)>S?(d.setGeneralPurposeVariable(p,S),b=!0):O>d.getGeneralPurposeVariable(p)+1&&(d.setGeneralPurposeVariable(p,O),b=!0)}}if(b){for(s=0;s0;n--)this.rankMedianPosition(n-1,e,n);else for(n=0;n0?this.medianXValue(a,n):h.getGeneralPurposeVariable(t));for(var d=0,p=-1e8,m=s[o].rankIndex-1;m>=0;){if(null!=(y=r[i[m].id])){var c=y.cell;y.visited?(p=c.getGeneralPurposeVariable(t)+c.width/2+this.intraCellSpacing+d+h.width/2,m=-1):(d+=c.width+this.intraCellSpacing,m--)}}var g=0,x=1e8;for(m=s[o].rankIndex+1;m=p&&u<=x?h.setGeneralPurposeVariable(t,u):ux&&(h.setGeneralPurposeVariable(t,x),this.currentXDelta+=u-x),s[o].visited=!0}},mxCoordinateAssignment.prototype.calculatedWeightedValue=function(t,e){for(var n=0,i=0;i=0;n--)n0&&this.rankCoordinates(n,t,e)},mxCoordinateAssignment.prototype.rankCoordinates=function(t,e,n){for(var i=n.ranks[t],s=0,r=this.initialX+(this.widestRankValue-this.rankWidths[t])/2,o=!1,l=0;l=0;s--){for(var r=0,o=e.ranks[s],l=this.initialX,a=!1,h=0;hthis.widestRankValue&&(this.widestRankValue=l,this.widestRank=s),this.rankWidths[s]=l}1==a&&mxLog.warn("At least one cell has no bounds"),this.rankY[s]=n;var m=r/2+i/2+this.interRankCellSpacing;i=r,this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_WEST?n+=m:n-=m;for(h=0;hs.minRank+1;a--){var g;c==(g=s.getX(a-1))||this.repositionValid(e,s,a-1,c)?(m[a-s.minRank-2]=c,d++):(m[a-s.minRank-2]=s.getX(a-1),c=g)}if(d>l||u>l)if(d>=u)for(a=s.maxRank-2;a>s.minRank;a--)s.setX(a,m[a-s.minRank-1]);else if(u>d)for(a=s.minRank+2;al){if(r==s.length-1)return!0;var u=s[r+1],d=u.getGeneralPurposeVariable(n);return(d=d-u.width/2-this.intraCellSpacing-e.width/2)>=i}return!0},mxCoordinateAssignment.prototype.setCellLocations=function(t,e){this.rankTopY=[],this.rankBottomY=[];for(var n=0;n-1&&o0){for(var a=[],h=0;hf+2*this.prefHozEdgeSep&&(d+=this.prefHozEdgeSep,p-=this.prefHozEdgeSep);var v=(p-d)/m,C=d+v/2,E=this.minEdgeJetty-this.prefVertEdgeOff;for(h=0;hm/2&&(E-=this.prefVertEdgeOff);for(var T=0;T0?-e:-e+this.parallelEdgeSpacing,s++}t.temp[0]=101207}},mxCoordinateAssignment.prototype.setVertexLocation=function(t){var e=t.cell,n=t.x[0]-t.width/2,i=t.y[0]-t.height/2;this.rankTopY[t.minRank]=Math.min(this.rankTopY[t.minRank],i),this.rankBottomY[t.minRank]=Math.max(this.rankBottomY[t.minRank],i+t.height),this.orientation==mxConstants.DIRECTION_NORTH||this.orientation==mxConstants.DIRECTION_SOUTH?this.layout.setVertexLocation(e,n,i):this.layout.setVertexLocation(e,i,n),this.limitX=Math.max(this.limitX,n+t.width)},mxCoordinateAssignment.prototype.processReversedEdge=function(t,e){},__mxOutput.mxCoordinateAssignment=void 0!==mxCoordinateAssignment?mxCoordinateAssignment:void 0,mxSwimlaneOrdering.prototype=new mxHierarchicalLayoutStage,mxSwimlaneOrdering.prototype.constructor=mxSwimlaneOrdering,mxSwimlaneOrdering.prototype.layout=null,mxSwimlaneOrdering.prototype.execute=function(t){var e=this.layout.getModel(),n=new Object,i=mxUtils.clone(e.vertexMapper,null,!0),s=null;if(null!=e.roots){var r=e.roots;s=[];for(var o=0;o0&&n.push(l);var p=h-u;p>r&&(r=p,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxHierarchicalLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o=0&&(s=this.traverse(m,e,u[p],i,s,r,o))}}}return s},mxHierarchicalLayout.prototype.cycleStage=function(t){new mxMinimumCycleRemover(this).execute(t)},mxHierarchicalLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxHierarchicalLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxHierarchicalLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxHierarchicalLayout=void 0!==mxHierarchicalLayout?mxHierarchicalLayout:void 0,mxSwimlaneLayout.prototype=new mxGraphLayout,mxSwimlaneLayout.prototype.constructor=mxSwimlaneLayout,mxSwimlaneLayout.prototype.roots=null,mxSwimlaneLayout.prototype.swimlanes=null,mxSwimlaneLayout.prototype.dummyVertexWidth=50,mxSwimlaneLayout.prototype.resizeParent=!1,mxSwimlaneLayout.prototype.maintainParentLocation=!1,mxSwimlaneLayout.prototype.moveParent=!1,mxSwimlaneLayout.prototype.parentBorder=30,mxSwimlaneLayout.prototype.intraCellSpacing=30,mxSwimlaneLayout.prototype.interRankCellSpacing=100,mxSwimlaneLayout.prototype.interHierarchySpacing=60,mxSwimlaneLayout.prototype.parallelEdgeSpacing=10,mxSwimlaneLayout.prototype.orientation=mxConstants.DIRECTION_NORTH,mxSwimlaneLayout.prototype.fineTuning=!0,mxSwimlaneLayout.prototype.tightenToSource=!0,mxSwimlaneLayout.prototype.disableEdgeStyle=!0,mxSwimlaneLayout.prototype.traverseAncestors=!0,mxSwimlaneLayout.prototype.model=null,mxSwimlaneLayout.prototype.edgesCache=null,mxHierarchicalLayout.prototype.edgeSourceTermCache=null,mxHierarchicalLayout.prototype.edgesTargetTermCache=null,mxHierarchicalLayout.prototype.edgeStyle=mxHierarchicalEdgeStyle.POLYLINE,mxSwimlaneLayout.prototype.getModel=function(){return this.model},mxSwimlaneLayout.prototype.execute=function(t,e){this.parent=t;var n=this.graph.model;if(this.edgesCache=new mxDictionary,this.edgeSourceTermCache=new mxDictionary,this.edgesTargetTermCache=new mxDictionary,!(null==e||e.length<1)){if(null==t&&(t=n.getParent(e[0])),this.parentX=null,this.parentY=null,t!=this.root&&null!=n.isVertex(t)&&this.maintainParentLocation)null!=(l=this.graph.getCellGeometry(t))&&(this.parentX=l.x,this.parentY=l.y);this.swimlanes=e;for(var i=[],s=0;s0&&n.push(l);var c=h-u;c>r&&(r=c,s=l)}}0==n.length&&null!=s&&n.push(s)}return n},mxSwimlaneLayout.prototype.getEdges=function(t){var e=this.edgesCache.get(t);if(null!=e)return e;for(var n=this.graph.model,i=[],s=this.graph.isCellCollapsed(t),r=n.getChildCount(t),o=0;o0&&null!=t){for(var i=Object(),s=0;s=this.swimlanes.length||(x>l||(!e||g)&&x==l)&&(s=this.traverse(c,e,d[m],i,s,r,o,x))}}}return s},mxSwimlaneLayout.prototype.cycleStage=function(t){new mxSwimlaneOrdering(this).execute(t)},mxSwimlaneLayout.prototype.layeringStage=function(){this.model.initialRank(),this.model.fixRanks()},mxSwimlaneLayout.prototype.crossingStage=function(t){new mxMedianHybridCrossingReduction(this).execute(t)},mxSwimlaneLayout.prototype.placementStage=function(t,e){var n=new mxCoordinateAssignment(this,this.intraCellSpacing,this.interRankCellSpacing,this.orientation,t,this.parallelEdgeSpacing);return n.fineTuning=this.fineTuning,n.execute(e),n.limitX+this.interHierarchySpacing},__mxOutput.mxSwimlaneLayout=void 0!==mxSwimlaneLayout?mxSwimlaneLayout:void 0,mxGraphModel.prototype=new mxEventSource,mxGraphModel.prototype.constructor=mxGraphModel,mxGraphModel.prototype.root=null,mxGraphModel.prototype.cells=null,mxGraphModel.prototype.maintainEdgeParent=!0,mxGraphModel.prototype.ignoreRelativeEdgeParent=!0,mxGraphModel.prototype.createIds=!0,mxGraphModel.prototype.prefix="",mxGraphModel.prototype.postfix="",mxGraphModel.prototype.nextId=0,mxGraphModel.prototype.currentEdit=null,mxGraphModel.prototype.updateLevel=0,mxGraphModel.prototype.endingUpdate=!1,mxGraphModel.prototype.clear=function(){this.setRoot(this.createRoot())},mxGraphModel.prototype.isCreateIds=function(){return this.createIds},mxGraphModel.prototype.setCreateIds=function(t){this.createIds=t},mxGraphModel.prototype.createRoot=function(){var t=new mxCell;return t.insert(new mxCell),t},mxGraphModel.prototype.getCell=function(t){return null!=this.cells?this.cells[t]:null},mxGraphModel.prototype.filterCells=function(t,e){var n=null;if(null!=t){n=[];for(var i=0;i0){var i=t,s=mxCellPath.create(i);if(n.length=0;e--)this.cellRemoved(this.getChildAt(t,e));null!=this.cells&&null!=t.getId()&&delete this.cells[t.getId()]}},mxGraphModel.prototype.parentForCellChanged=function(t,e,n){var i=this.getParent(t);if(null!=e)e==i&&i.getIndex(t)==n||e.insert(t,n);else if(null!=i){var s=i.getIndex(t);i.remove(s)}var r=this.contains(e),o=this.contains(i);return r&&!o?this.cellAdded(t):o&&!r&&this.cellRemoved(t),i},mxGraphModel.prototype.getChildCount=function(t){return null!=t?t.getChildCount():0},mxGraphModel.prototype.getChildAt=function(t,e){return null!=t?t.getChildAt(e):null},mxGraphModel.prototype.getChildren=function(t){return null!=t?t.children:null},mxGraphModel.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraphModel.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraphModel.prototype.getChildCells=function(t,e,n){e=null!=e&&e,n=null!=n&&n;for(var i=this.getChildCount(t),s=[],r=0;r=0&&null!=(e=this.getChildAt(t))&&(this.children.splice(t,1),e.setParent(null)),e},mxCell.prototype.removeFromParent=function(){if(null!=this.parent){var t=this.parent.getIndex(this);this.parent.remove(t)}},mxCell.prototype.getEdgeCount=function(){return null==this.edges?0:this.edges.length},mxCell.prototype.getEdgeIndex=function(t){return mxUtils.indexOf(this.edges,t)},mxCell.prototype.getEdgeAt=function(t){return null==this.edges?null:this.edges[t]},mxCell.prototype.insertEdge=function(t,e){return null!=t&&(t.removeFromTerminal(e),t.setTerminal(this,e),(null==this.edges||t.getTerminal(!e)!=this||mxUtils.indexOf(this.edges,t)<0)&&(null==this.edges&&(this.edges=[]),this.edges.push(t))),t},mxCell.prototype.removeEdge=function(t,e){if(null!=t){if(t.getTerminal(!e)!=this&&null!=this.edges){var n=this.getEdgeIndex(t);n>=0&&this.edges.splice(n,1)}t.setTerminal(null,e)}return t},mxCell.prototype.removeFromTerminal=function(t){var e=this.getTerminal(t);null!=e&&e.removeEdge(this,t)},mxCell.prototype.hasAttribute=function(t){var e=this.getValue();return null!=e&&e.nodeType==mxConstants.NODETYPE_ELEMENT&&e.hasAttribute?e.hasAttribute(t):null!=e.getAttribute(t)},mxCell.prototype.getAttribute=function(t,e){var n=this.getValue(),i=null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT?n.getAttribute(t):null;return null!=i?i:e},mxCell.prototype.setAttribute=function(t,e){var n=this.getValue();null!=n&&n.nodeType==mxConstants.NODETYPE_ELEMENT&&n.setAttribute(t,e)},mxCell.prototype.clone=function(){var t=mxUtils.clone(this,this.mxTransient);return t.setValue(this.cloneValue()),t},mxCell.prototype.cloneValue=function(){var t=this.getValue();return null!=t&&("function"==typeof t.clone?t=t.clone():isNaN(t.nodeType)||(t=t.cloneNode(!0))),t},__mxOutput.mxCell=void 0!==mxCell?mxCell:void 0,mxGeometry.prototype=new mxRectangle,mxGeometry.prototype.constructor=mxGeometry,mxGeometry.prototype.TRANSLATE_CONTROL_POINTS=!0,mxGeometry.prototype.alternateBounds=null,mxGeometry.prototype.sourcePoint=null,mxGeometry.prototype.targetPoint=null,mxGeometry.prototype.points=null,mxGeometry.prototype.offset=null,mxGeometry.prototype.relative=!1,mxGeometry.prototype.swap=function(){if(null!=this.alternateBounds){var t=new mxRectangle(this.x,this.y,this.width,this.height);this.x=this.alternateBounds.x,this.y=this.alternateBounds.y,this.width=this.alternateBounds.width,this.height=this.alternateBounds.height,this.alternateBounds=t}},mxGeometry.prototype.getTerminalPoint=function(t){return t?this.sourcePoint:this.targetPoint},mxGeometry.prototype.setTerminalPoint=function(t,e){return e?this.sourcePoint=t:this.targetPoint=t,t},mxGeometry.prototype.rotate=function(t,e){var n=mxUtils.toRadians(t),i=Math.cos(n),s=Math.sin(n);if(!this.relative){var r=new mxPoint(this.getCenterX(),this.getCenterY()),o=mxUtils.getRotatedPoint(r,i,s,e);this.x=Math.round(o.x-this.width/2),this.y=Math.round(o.y-this.height/2)}if(null!=this.sourcePoint){o=mxUtils.getRotatedPoint(this.sourcePoint,i,s,e);this.sourcePoint.x=Math.round(o.x),this.sourcePoint.y=Math.round(o.y)}if(null!=this.targetPoint){o=mxUtils.getRotatedPoint(this.targetPoint,i,s,e);this.targetPoint.x=Math.round(o.x),this.targetPoint.y=Math.round(o.y)}if(null!=this.points)for(var l=0;l1&&(e=e.substring(0,i-1)),e},getParentPath:function(t){if(null!=t){var e=t.lastIndexOf(mxCellPath.PATH_SEPARATOR);if(e>=0)return t.substring(0,e);if(t.length>0)return""}return null},resolve:function(t,e){var n=t;if(null!=e)for(var i=e.split(mxCellPath.PATH_SEPARATOR),s=0;se[s]?1:-1;else i=(r=parseInt(t[s]))==(o=parseInt(e[s]))?0:r>o?1:-1;break}0==i&&((r=t.length)!=(o=e.length)&&(i=r>o?1:-1));return i}};__mxOutput.mxCellPath=void 0!==mxCellPath?mxCellPath:void 0;var mxPerimeter={RectanglePerimeter:function(t,e,n,i){var s=t.getCenterX(),r=t.getCenterY(),o=n.x-s,l=n.y-r,a=Math.atan2(l,o),h=new mxPoint(0,0),u=Math.PI,d=Math.PI/2-a,p=Math.atan2(t.height,t.width);return a<-u+p||a>u-p?(h.x=t.x,h.y=r-t.width*Math.tan(a)/2):a<-p?(h.y=t.y,h.x=s-t.height*Math.tan(d)/2):a=t.x&&n.x<=t.x+t.width?h.x=n.x:n.y>=t.y&&n.y<=t.y+t.height&&(h.y=n.y),n.xt.x+t.width&&(h.x=t.x+t.width),n.yt.y+t.height&&(h.y=t.y+t.height)),h},EllipsePerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width/2,l=t.height/2,a=s+o,h=r+l,u=n.x,d=n.y,p=parseInt(u-a),m=parseInt(d-h);if(0==p&&0!=m)return new mxPoint(a,h+l*m/Math.abs(m));if(0==p&&0==m)return new mxPoint(u,d);if(i){if(d>=r&&d<=r+t.height){var c=d-h,g=Math.sqrt(o*o*(1-c*c/(l*l)))||0;return u<=s&&(g=-g),new mxPoint(a+g,d)}if(u>=s&&u<=s+t.width){g=u-a,c=Math.sqrt(l*l*(1-g*g/(o*o)))||0;return d<=r&&(c=-c),new mxPoint(u,h+c)}}var x=m/p,y=h-x*a,f=o*o*x*x+l*l,v=-2*a*f,C=o*o*x*x*a*a+l*l*a*a-o*o*l*l,E=Math.sqrt(v*v-4*f*C),S=(-v+E)/(2*f),b=(-v-E)/(2*f),T=x*S+y,w=x*b+y,L=0,O=0;return Math.sqrt(Math.pow(S-u,2)+Math.pow(T-d,2))d?r:r+l);if(h==d)return new mxPoint(a>u?s:s+o,h);var p=a,m=h;return i&&(u>=s&&u<=s+o?p=u:d>=r&&d<=r+l&&(m=d)),u-f&&yMath.PI-f)v=i&&(r&&n.x>=p.x&&n.x<=c.x||!r&&n.y>=p.y&&n.y<=c.y)?r?new mxPoint(n.x,p.y):new mxPoint(p.x,n.y):s==mxConstants.DIRECTION_NORTH?new mxPoint(o+a/2+h*Math.tan(y)/2,l+h):s==mxConstants.DIRECTION_SOUTH?new mxPoint(o+a/2-h*Math.tan(y)/2,l):s==mxConstants.DIRECTION_WEST?new mxPoint(o+a,l+h/2+a*Math.tan(y)/2):new mxPoint(o,l+h/2-a*Math.tan(y)/2);else{if(i){var C=new mxPoint(u,d);n.y>=l&&n.y<=l+h?(C.x=r?u:s==mxConstants.DIRECTION_WEST?o+a:o,C.y=n.y):n.x>=o&&n.x<=o+a&&(C.x=n.x,C.y=r?s==mxConstants.DIRECTION_NORTH?l+h:l:d),g=n.x-C.x,x=n.y-C.y,u=C.x,d=C.y}v=r&&n.x<=o+a/2||!r&&n.y<=l+h/2?mxUtils.intersection(n.x,n.y,u,d,p.x,p.y,m.x,m.y):mxUtils.intersection(n.x,n.y,u,d,m.x,m.y,c.x,c.y)}return null==v&&(v=new mxPoint(u,d)),v},HexagonPerimeter:function(t,e,n,i){var s=t.x,r=t.y,o=t.width,l=t.height,a=t.getCenterX(),h=t.getCenterY(),u=n.x,d=n.y,p=u-a,m=d-h,c=-Math.atan2(m,p),g=Math.PI,x=Math.PI/2,y=new mxPoint(a,h),f=null!=e?mxUtils.getValue(e.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST,v=f==mxConstants.DIRECTION_NORTH||f==mxConstants.DIRECTION_SOUTH,C=new mxPoint,E=new mxPoint;if((ur+l||u>s+o&&ds+o&&d>r+l)&&(i=!1),i){if(v){if(u==a){if(d<=r)return new mxPoint(a,r);if(d>=r+l)return new mxPoint(a,r+l)}else if(us+o){if(d==r+l/4)return new mxPoint(s+o,r+l/4);if(d==r+3*l/4)return new mxPoint(s+o,r+3*l/4)}else if(u==s){if(dh)return new mxPoint(s,r+3*l/4)}else if(u==s+o){if(dh)return new mxPoint(s+o,r+3*l/4)}if(d==r)return new mxPoint(a,r);if(d==r+l)return new mxPoint(a,r+l);ur+l/4&&dr+3*l/4&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l))):u>a&&(d>r+l/4&&dr+3*l/4&&(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))))}else{if(d==h){if(u<=s)return new mxPoint(s,r+l/2);if(u>=s+o)return new mxPoint(s+o,r+l/2)}else if(dr+l){if(u==s+o/4)return new mxPoint(s+o/4,r+l);if(u==s+3*o/4)return new mxPoint(s+3*o/4,r+l)}else if(d==r){if(ua)return new mxPoint(s+3*o/4,r)}else if(d==r+l){if(uh)return new mxPoint(s+3*o/4,r+l)}if(u==s)return new mxPoint(s,h);if(u==s+o)return new mxPoint(s+o,h);ds+o/4&&us+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r-Math.floor(.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r+l)):d>h&&(u>s+o/4&&us+3*o/4&&(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)))}var S=a,b=h;u>=s&&u<=s+o?(S=u,b=d=r&&d<=r+l&&(b=d,S=u-T?(C=new mxPoint(s+o,r),E=new mxPoint(s+o,r+l)):c>T&&cx&&cg-T&&c<=g||c<-g+T&&c>=-g?(C=new mxPoint(s,r),E=new mxPoint(s,r+l)):c<-T&&c>-x?(C=new mxPoint(s+Math.floor(1.5*o),r+Math.floor(.5*l)),E=new mxPoint(s,r+Math.floor(1.25*l))):c<-x&&c>-g+T&&(C=new mxPoint(s-Math.floor(.5*o),r+Math.floor(.5*l)),E=new mxPoint(s+o,r+Math.floor(1.25*l)))}else{var T;if(c==(T=Math.atan2(l/2,o/4)))return new mxPoint(s+Math.floor(.75*o),r);if(c==g-T)return new mxPoint(s+Math.floor(.25*o),r);if(c==g||c==-g)return new mxPoint(s,r+Math.floor(.5*l));if(0==c)return new mxPoint(s+o,r+Math.floor(.5*l));if(c==-T)return new mxPoint(s+Math.floor(.75*o),r+l);if(c==-g+T)return new mxPoint(s+Math.floor(.25*o),r+l);c>0&&cT&&cg-T&&c-T?(C=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)),E=new mxPoint(s+Math.floor(1.25*o),r)):c<-T&&c>-g+T?(C=new mxPoint(s,r+l),E=new mxPoint(s+o,r+l)):c<-g+T&&c>-g&&(C=new mxPoint(s-Math.floor(.25*o),r),E=new mxPoint(s+Math.floor(.5*o),r+Math.floor(1.5*l)))}y=mxUtils.intersection(a,h,n.x,n.y,C.x,C.y,E.x,E.y)}return null==y?new mxPoint(a,h):y}};function mxPrintPreview(t,e,n,i,s,r,o,l,a){this.graph=t,this.scale=null!=e?e:1/t.pageScale,this.border=null!=i?i:0,this.pageFormat=mxRectangle.fromRectangle(null!=n?n:t.pageFormat),this.title=null!=l?l:"Printer-friendly version",this.x0=null!=s?s:0,this.y0=null!=r?r:0,this.borderColor=o,this.pageSelector=null==a||a}function mxStylesheet(){this.styles=new Object,this.putDefaultVertexStyle(this.createDefaultVertexStyle()),this.putDefaultEdgeStyle(this.createDefaultEdgeStyle())}function mxCellState(t,e,n){this.view=t,this.cell=e,this.style=null!=n?n:{},this.origin=new mxPoint,this.absoluteOffset=new mxPoint}function mxGraphSelectionModel(t){this.graph=t,this.cells=[]}function mxSelectionChange(t,e,n){this.selectionModel=t,this.added=null!=e?e.slice():null,this.removed=null!=n?n.slice():null}function mxCellEditor(t){this.graph=t,this.zoomHandler=mxUtils.bind(this,(function(){this.graph.isEditing()&&this.resize()})),this.graph.view.addListener(mxEvent.SCALE,this.zoomHandler),this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.zoomHandler),this.changeHandler=mxUtils.bind(this,(function(t){null!=this.editingCell&&null==this.graph.getView().getState(this.editingCell)&&this.stopEditing(!0)})),this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler)}function mxCellRenderer(){}__mxOutput.mxPerimeter=void 0!==mxPerimeter?mxPerimeter:void 0,mxPrintPreview.prototype.graph=null,mxPrintPreview.prototype.pageFormat=null,mxPrintPreview.prototype.scale=null,mxPrintPreview.prototype.border=0,mxPrintPreview.prototype.marginTop=0,mxPrintPreview.prototype.marginBottom=0,mxPrintPreview.prototype.x0=0,mxPrintPreview.prototype.y0=0,mxPrintPreview.prototype.autoOrigin=!0,mxPrintPreview.prototype.printOverlays=!1,mxPrintPreview.prototype.printControls=!1,mxPrintPreview.prototype.printBackgroundImage=!1,mxPrintPreview.prototype.backgroundColor="#ffffff",mxPrintPreview.prototype.borderColor=null,mxPrintPreview.prototype.title=null,mxPrintPreview.prototype.pageSelector=null,mxPrintPreview.prototype.wnd=null,mxPrintPreview.prototype.targetWindow=null,mxPrintPreview.prototype.pageCount=0,mxPrintPreview.prototype.clipping=!0,mxPrintPreview.prototype.getWindow=function(){return this.wnd},mxPrintPreview.prototype.getDoctype=function(){var t="";return 5==document.documentMode?t='':8==document.documentMode?t='':document.documentMode>8&&(t='\x3c!--[if IE]>0&&l.writeln(a),mxClient.IS_VML?l.writeln(''):("CSS1Compat"===document.compatMode&&l.writeln(""),l.writeln("")),l.writeln(""),this.writeHead(l,t),l.writeln(" "),l.writeln('')}var h=this.graph.getGraphBounds().clone(),u=this.graph.getView().getScale(),d=u/this.scale,p=this.graph.getView().getTranslate();this.autoOrigin||(this.x0-=p.x*this.scale,this.y0-=p.y*this.scale,h.width+=h.x,h.height+=h.y,h.x=0,h.y=0,this.border=0);var m=this.pageFormat.width-2*this.border,c=this.pageFormat.height-2*this.border;this.pageFormat.height+=this.marginTop+this.marginBottom,h.width/=d,h.height/=d;var g=Math.max(1,Math.ceil((h.width+this.x0)/m)),x=Math.max(1,Math.ceil((h.height+this.y0)/c));this.pageCount=g*x;var y=mxUtils.bind(this,(function(){if(this.pageSelector&&(x>1||g>1)){var t=this.createPageSelector(x,g);if(l.body.appendChild(t),mxClient.IS_IE&&null==l.documentMode||5==l.documentMode||8==l.documentMode||7==l.documentMode){t.style.position="absolute";var e=function(){t.style.top=(l.body.scrollTop||l.documentElement.scrollTop)+10+"px"};mxEvent.addListener(this.wnd,"scroll",(function(t){e()})),mxEvent.addListener(this.wnd,"resize",(function(t){e()}))}}})),f=mxUtils.bind(this,(function(t,e){if(null!=this.borderColor&&(t.style.borderColor=this.borderColor,t.style.borderStyle="solid",t.style.borderWidth="1px"),t.style.background=this.backgroundColor,(n||e)&&(t.style.pageBreakAfter="always"),o&&(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE))l.writeln(t.outerHTML),t.parentNode.removeChild(t);else if(mxClient.IS_IE||document.documentMode>=11||mxClient.IS_EDGE){var i=l.createElement("div");i.innerHTML=t.outerHTML,i=i.getElementsByTagName("div")[0],l.body.appendChild(i),t.parentNode.removeChild(t)}else t.parentNode.removeChild(t),l.body.appendChild(t);(n||e)&&this.addPageBreak(l)})),v=this.getCoverPages(this.pageFormat.width,this.pageFormat.height);if(null!=v)for(var C=0;C"),t.writeln(""),t.close(),mxEvent.release(t.body)}}catch(t){}},mxPrintPreview.prototype.writeHead=function(t,e){null!=this.title&&t.writeln(""+this.title+""),mxClient.IS_VML&&t.writeln(''),mxClient.link("stylesheet",mxClient.basePath+"/css/common.css",t),t.writeln('")},mxPrintPreview.prototype.writePostfix=function(t){},mxPrintPreview.prototype.createPageSelector=function(t,e){var n=this.wnd.document,i=n.createElement("table");i.className="mxPageSelector",i.setAttribute("border","0");for(var s=n.createElement("tbody"),r=0;r0&&s.height>0&&!mxUtils.intersects(C,s))return}}y.apply(this,arguments)}}var E=null;try{var S=[this.getRoot()];E=new mxTemporaryCellStates(o,n,S,null,mxUtils.bind(this,(function(t){return this.getLinkForCellState(t)})))}finally{if(mxClient.IS_IE)o.overlayPane.innerHTML="",o.canvas.style.overflow="hidden",o.canvas.style.position="relative",o.canvas.style.top=this.marginTop+"px",o.canvas.style.width=r.width+"px",o.canvas.style.height=r.height+"px";else for(var b=s.firstChild;null!=b;){var T=b.nextSibling,w=b.nodeName.toLowerCase();"svg"==w?(b.style.overflow="hidden",b.style.position="relative",b.style.top=this.marginTop+"px",b.setAttribute("width",r.width),b.setAttribute("height",r.height),b.style.width="",b.style.height=""):"default"!=b.style.cursor&&"div"!=w&&b.parentNode.removeChild(b),b=T}if(this.printBackgroundImage){var L=s.getElementsByTagName("svg");L.length>0&&(L[0].style.position="absolute")}o.overlayPane.parentNode.removeChild(o.overlayPane),this.graph.setEnabled(g),this.graph.container=l,this.graph.cellRenderer.redraw=y,o.canvas=a,o.backgroundPane=h,o.drawPane=u,o.overlayPane=d,o.translate=x,E.destroy(),o.setEventsEnabled(c)}},mxPrintPreview.prototype.getLinkForCellState=function(t){return this.graph.getLinkForCell(t.cell)},mxPrintPreview.prototype.insertBackgroundImage=function(t,e,n){var i=this.graph.backgroundImage;if(null!=i){var s=document.createElement("img");s.style.position="absolute",s.style.marginLeft=Math.round(e*this.scale)+"px",s.style.marginTop=Math.round(n*this.scale)+"px",s.setAttribute("width",Math.round(this.scale*i.width)),s.setAttribute("height",Math.round(this.scale*i.height)),s.src=i.src,t.insertBefore(s,t.firstChild)}},mxPrintPreview.prototype.getCoverPages=function(){return null},mxPrintPreview.prototype.getAppendices=function(){return null},mxPrintPreview.prototype.print=function(t){var e=this.open(t);null!=e&&e.print()},mxPrintPreview.prototype.close=function(){null!=this.wnd&&(this.wnd.close(),this.wnd=null)},__mxOutput.mxPrintPreview=void 0!==mxPrintPreview?mxPrintPreview:void 0,mxStylesheet.prototype.styles,mxStylesheet.prototype.createDefaultVertexStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_RECTANGLE,t[mxConstants.STYLE_PERIMETER]=mxPerimeter.RectanglePerimeter,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_FILLCOLOR]="#C3D9FF",t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#774400",t},mxStylesheet.prototype.createDefaultEdgeStyle=function(){var t=new Object;return t[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_CONNECTOR,t[mxConstants.STYLE_ENDARROW]=mxConstants.ARROW_CLASSIC,t[mxConstants.STYLE_VERTICAL_ALIGN]=mxConstants.ALIGN_MIDDLE,t[mxConstants.STYLE_ALIGN]=mxConstants.ALIGN_CENTER,t[mxConstants.STYLE_STROKECOLOR]="#6482B9",t[mxConstants.STYLE_FONTCOLOR]="#446299",t},mxStylesheet.prototype.putDefaultVertexStyle=function(t){this.putCellStyle("defaultVertex",t)},mxStylesheet.prototype.putDefaultEdgeStyle=function(t){this.putCellStyle("defaultEdge",t)},mxStylesheet.prototype.getDefaultVertexStyle=function(){return this.styles.defaultVertex},mxStylesheet.prototype.getDefaultEdgeStyle=function(){return this.styles.defaultEdge},mxStylesheet.prototype.putCellStyle=function(t,e){this.styles[t]=e},mxStylesheet.prototype.getCellStyle=function(t,e){var n=e;if(null!=t&&t.length>0){var i=t.split(";");n=null!=n&&";"!=t.charAt(0)?mxUtils.clone(n):new Object;for(var s=0;s=0){var l=r.substring(0,o),a=r.substring(o+1);a==mxConstants.NONE?delete n[l]:mxUtils.isNumeric(a)?n[l]=parseFloat(a):n[l]=a}else{var h=this.styles[r];if(null!=h)for(var l in h)n[l]=h[l]}}}return n},__mxOutput.mxStylesheet=void 0!==mxStylesheet?mxStylesheet:void 0,mxCellState.prototype=new mxRectangle,mxCellState.prototype.constructor=mxCellState,mxCellState.prototype.view=null,mxCellState.prototype.cell=null,mxCellState.prototype.style=null,mxCellState.prototype.invalidStyle=!1,mxCellState.prototype.invalid=!0,mxCellState.prototype.origin=null,mxCellState.prototype.absolutePoints=null,mxCellState.prototype.absoluteOffset=null,mxCellState.prototype.visibleSourceState=null,mxCellState.prototype.visibleTargetState=null,mxCellState.prototype.terminalDistance=0,mxCellState.prototype.length=0,mxCellState.prototype.segments=null,mxCellState.prototype.shape=null,mxCellState.prototype.text=null,mxCellState.prototype.unscaledWidth=null,mxCellState.prototype.unscaledHeight=null,mxCellState.prototype.getPerimeterBounds=function(t,e){if(t=t||0,e=null!=e?e:new mxRectangle(this.x,this.y,this.width,this.height),null!=this.shape&&null!=this.shape.stencil&&"fixed"==this.shape.stencil.aspect){var n=this.shape.stencil.computeAspect(this.style,e.x,e.y,e.width,e.height);e.x=n.x,e.y=n.y,e.width=this.shape.stencil.w0*n.width,e.height=this.shape.stencil.h0*n.height}return 0!=t&&e.grow(t),e},mxCellState.prototype.setAbsoluteTerminalPoint=function(t,e){e?(null==this.absolutePoints&&(this.absolutePoints=[]),0==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[0]=t):null==this.absolutePoints?(this.absolutePoints=[],this.absolutePoints.push(null),this.absolutePoints.push(t)):1==this.absolutePoints.length?this.absolutePoints.push(t):this.absolutePoints[this.absolutePoints.length-1]=t},mxCellState.prototype.setCursor=function(t){null!=this.shape&&this.shape.setCursor(t),null!=this.text&&this.text.setCursor(t)},mxCellState.prototype.getVisibleTerminal=function(t){var e=this.getVisibleTerminalState(t);return null!=e?e.cell:null},mxCellState.prototype.getVisibleTerminalState=function(t){return t?this.visibleSourceState:this.visibleTargetState},mxCellState.prototype.setVisibleTerminalState=function(t,e){e?this.visibleSourceState=t:this.visibleTargetState=t},mxCellState.prototype.getCellBounds=function(){return this.cellBounds},mxCellState.prototype.getPaintBounds=function(){return this.paintBounds},mxCellState.prototype.updateCachedBounds=function(){var t=this.view.translate,e=this.view.scale;this.cellBounds=new mxRectangle(this.x/e-t.x,this.y/e-t.y,this.width/e,this.height/e),this.paintBounds=mxRectangle.fromRectangle(this.cellBounds),null!=this.shape&&this.shape.isPaintBoundsInverted()&&this.paintBounds.rotate90()},mxCellState.prototype.setState=function(t){this.view=t.view,this.cell=t.cell,this.style=t.style,this.absolutePoints=t.absolutePoints,this.origin=t.origin,this.absoluteOffset=t.absoluteOffset,this.boundingBox=t.boundingBox,this.terminalDistance=t.terminalDistance,this.segments=t.segments,this.length=t.length,this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this.unscaledWidth=t.unscaledWidth,this.unscaledHeight=t.unscaledHeight},mxCellState.prototype.clone=function(){var t=new mxCellState(this.view,this.cell,this.style);if(null!=this.absolutePoints){t.absolutePoints=[];for(var e=0;e=0},mxGraphSelectionModel.prototype.isEmpty=function(){return 0==this.cells.length},mxGraphSelectionModel.prototype.clear=function(){this.changeSelection(null,this.cells)},mxGraphSelectionModel.prototype.setCell=function(t){null!=t&&this.setCells([t])},mxGraphSelectionModel.prototype.setCells=function(t){if(null!=t){this.singleSelection&&(t=[this.getFirstSelectableCell(t)]);for(var e=[],n=0;n0&&null!=t[0]||null!=e&&e.length>0&&null!=e[0]){var n=new mxSelectionChange(this,t,e);n.execute();var i=new mxUndoableEdit(this,!1);i.add(n),this.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",i))}},mxGraphSelectionModel.prototype.cellAdded=function(t){null==t||this.isSelected(t)||this.cells.push(t)},mxGraphSelectionModel.prototype.cellRemoved=function(t){if(null!=t){var e=mxUtils.indexOf(this.cells,t);e>=0&&this.cells.splice(e,1)}},mxSelectionChange.prototype.execute=function(){var t=mxLog.enter("mxSelectionChange.execute");if(window.status=mxResources.get(this.selectionModel.updatingSelectionResource)||this.selectionModel.updatingSelectionResource,null!=this.removed)for(var e=0;e":"",mxCellEditor.prototype.escapeCancelsEditing=!0,mxCellEditor.prototype.textNode="",mxCellEditor.prototype.zIndex=5,mxCellEditor.prototype.minResize=new mxRectangle(0,20),mxCellEditor.prototype.wordWrapPadding=mxClient.IS_QUIRKS?2:mxClient.IS_IE11?0:1,mxCellEditor.prototype.blurEnabled=!1,mxCellEditor.prototype.initialValue=null,mxCellEditor.prototype.align=null,mxCellEditor.prototype.init=function(){this.textarea=document.createElement("div"),this.textarea.className="mxCellEditor mxPlainTextEditor",this.textarea.contentEditable=!0,mxClient.IS_GC&&(this.textarea.style.minHeight="1em"),this.textarea.style.position=this.isLegacyEditor()?"absolute":"relative",this.installListeners(this.textarea)},mxCellEditor.prototype.applyValue=function(t,e){this.graph.labelChanged(t.cell,e,this.trigger)},mxCellEditor.prototype.setAlign=function(t){null!=this.textarea&&(this.textarea.style.textAlign=t),this.align=t,this.resize()},mxCellEditor.prototype.getInitialValue=function(t,e){var n=mxUtils.htmlEntities(this.graph.getEditingValue(t.cell,e),!1);return mxClient.IS_QUIRKS||8==document.documentMode||9==document.documentMode||10==document.documentMode||(n=mxUtils.replaceTrailingNewlines(n,"

")),n.replace(/\n/g,"
")},mxCellEditor.prototype.getCurrentValue=function(t){return mxUtils.extractTextWithWhitespace(this.textarea.childNodes)},mxCellEditor.prototype.isCancelEditingKeyEvent=function(t){return this.escapeCancelsEditing||mxEvent.isShiftDown(t)||mxEvent.isControlDown(t)||mxEvent.isMetaDown(t)},mxCellEditor.prototype.installListeners=function(t){mxEvent.addListener(t,"dragstart",mxUtils.bind(this,(function(t){this.graph.stopEditing(!1),mxEvent.consume(t)}))),mxEvent.addListener(t,"blur",mxUtils.bind(this,(function(t){this.blurEnabled&&this.focusLost(t)}))),mxEvent.addListener(t,"keydown",mxUtils.bind(this,(function(t){mxEvent.isConsumed(t)||(this.isStopEditingEvent(t)?(this.graph.stopEditing(!1),mxEvent.consume(t)):27==t.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(t)),mxEvent.consume(t)))})));var e=mxUtils.bind(this,(function(e){null!=this.editingCell&&this.clearOnChange&&t.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=e.keyCode&&46!=e.keyCode)&&(this.clearOnChange=!1,t.innerHTML="")}));mxEvent.addListener(t,"keypress",e),mxEvent.addListener(t,"paste",e);var n=mxUtils.bind(this,(function(t){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=this.textarea.innerHTML.length>0):this.clearOnChange=!1)}));mxEvent.addListener(t,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",n),mxEvent.addListener(t,"cut",n),mxEvent.addListener(t,"paste",n);var i=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input",s=mxUtils.bind(this,(function(t){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(t)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,(function(){this.resizeThread=null,this.resize()})),0))}));mxEvent.addListener(t,i,s),mxEvent.addListener(window,"resize",s),document.documentMode>=9?(mxEvent.addListener(t,"DOMNodeRemoved",s),mxEvent.addListener(t,"DOMNodeInserted",s)):(mxEvent.addListener(t,"cut",s),mxEvent.addListener(t,"paste",s))},mxCellEditor.prototype.isStopEditingEvent=function(t){return 113==t.keyCode||this.graph.isEnterStopsCellEditing()&&13==t.keyCode&&!mxEvent.isControlDown(t)&&!mxEvent.isShiftDown(t)},mxCellEditor.prototype.isEventSource=function(t){return mxEvent.getSource(t)==this.textarea},mxCellEditor.prototype.resize=function(){var t=this.graph.getView().getState(this.editingCell);if(null==t)this.stopEditing(!0);else if(null!=this.textarea){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=null;if(this.autoSize&&"fill"!=t.style[mxConstants.STYLE_OVERFLOW]){var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);if(null==(i=null!=t.text&&null==this.align?t.text.margin:null)&&(i=mxUtils.getAlignmentAsPoint(this.align||mxUtils.getValue(t.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER),mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE))),e){if(this.bounds=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y,0,0),null!=s){var r=(parseFloat(s)+2)*n;this.bounds.width=r,this.bounds.x+=i.x*r}}else{var o=mxRectangle.fromRectangle(t),l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&l==mxConstants.ALIGN_CENTER&&a==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,null!=s&&(o.width=parseFloat(s)*n),!t.view.graph.cellRenderer.legacySpacing||"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var h=parseInt(t.style[mxConstants.STYLE_SPACING]||2)*n,u=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+h,d=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+h,p=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+h,m=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+h;l=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),a=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);o=new mxRectangle(o.x+m,o.y+u,o.width-(l==mxConstants.ALIGN_CENTER&&null==s?m+d:0),o.height-(a==mxConstants.ALIGN_MIDDLE?u+p:0))}this.bounds=new mxRectangle(o.x+t.absoluteOffset.x,o.y+t.absoluteOffset.y,o.width,o.height)}if(this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()){this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal";r=Math.round(this.bounds.width/(document.documentMode,n))+this.wordWrapPadding;"relative"!=this.textarea.style.position?(this.textarea.style.width=r+"px",this.textarea.scrollWidth>r&&(this.textarea.style.width=this.textarea.scrollWidth+"px")):this.textarea.style.maxWidth=r+"px"}else this.textarea.style.whiteSpace="nowrap",this.textarea.style.width="";8==document.documentMode&&(this.textarea.style.zoom="1",this.textarea.style.height="auto");var c=this.textarea.scrollWidth,g=this.textarea.scrollHeight;8==document.documentMode?(this.textarea.style.left=Math.max(0,Math.ceil((this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5))/n))+"px",this.textarea.style.top=Math.max(0,Math.ceil((this.bounds.y-i.y*(this.bounds.height-(g+.5)*n)+g*(n-1)*0+1*Math.abs(i.y+.5))/n))+"px",this.textarea.style.width=Math.round(c*n)+"px",this.textarea.style.height=Math.round(g*n)+"px"):mxClient.IS_QUIRKS?(this.textarea.style.left=Math.max(0,Math.ceil(this.bounds.x-i.x*(this.bounds.width-(c+1)*n)+c*(n-1)*0+2*(i.x+.5)))+"px",this.textarea.style.top=Math.max(0,Math.ceil(this.bounds.y-i.y*(this.bounds.height-(g+.5)*n)+g*(n-1)*0+1*Math.abs(i.y+.5)))+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x-i.x*(this.bounds.width-2))+1)+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y-i.y*(this.bounds.height-4)+(-1==i.y?3:0))+1)+"px")}else this.bounds=this.getEditorBounds(t),this.textarea.style.width=Math.round(this.bounds.width/n)+"px",this.textarea.style.height=Math.round(this.bounds.height/n)+"px",8==document.documentMode||mxClient.IS_QUIRKS?(this.textarea.style.left=Math.round(this.bounds.x)+"px",this.textarea.style.top=Math.round(this.bounds.y)+"px"):(this.textarea.style.left=Math.max(0,Math.round(this.bounds.x+1))+"px",this.textarea.style.top=Math.max(0,Math.round(this.bounds.y+1))+"px"),this.graph.isWrapping(t.cell)&&(this.bounds.width>=2||this.bounds.height>=2)&&this.textarea.innerHTML!=this.getEmptyLabelText()?(this.textarea.style.wordWrap=mxConstants.WORD_WRAP,this.textarea.style.whiteSpace="normal","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=Math.round(this.bounds.width/n)+this.wordWrapPadding+"px")):(this.textarea.style.whiteSpace="nowrap","fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&(this.textarea.style.width=""));mxClient.IS_VML?this.textarea.style.zoom=n:(mxUtils.setPrefixedStyle(this.textarea.style,"transformOrigin","0px 0px"),mxUtils.setPrefixedStyle(this.textarea.style,"transform","scale("+n+","+n+")"+(null==i?"":" translate("+100*i.x+"%,"+100*i.y+"%)")))}},mxCellEditor.prototype.focusLost=function(){this.stopEditing(!this.graph.isInvokesStopCellEditing())},mxCellEditor.prototype.getBackgroundColor=function(t){return null},mxCellEditor.prototype.isLegacyEditor=function(){if(mxClient.IS_VML)return!0;var t=!1;if(mxClient.IS_SVG){var e=this.graph.view.getDrawPane().ownerSVGElement;if(null!=e){var n=mxUtils.getCurrentStyle(e);null!=n&&(t="absolute"==n.position)}}return!t},mxCellEditor.prototype.startEditing=function(t,e){this.stopEditing(!0),this.align=null,null==this.textarea&&this.init(),null!=this.graph.tooltipHandler&&this.graph.tooltipHandler.hideTooltip();var n=this.graph.getView().getState(t);if(null!=n){this.graph.getView().scale;var i=mxUtils.getValue(n.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),s=mxUtils.getValue(n.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),r=mxUtils.getValue(n.style,mxConstants.STYLE_FONTCOLOR,"black"),o=mxUtils.getValue(n.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),l=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,a=(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,h=[];(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&h.push("underline"),(mxUtils.getValue(n.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_STRIKETHROUGH)==mxConstants.FONT_STRIKETHROUGH&&h.push("line-through"),this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(i*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT,this.textarea.style.backgroundColor=this.getBackgroundColor(n),this.textarea.style.textDecoration=h.join(" "),this.textarea.style.fontWeight=l?"bold":"normal",this.textarea.style.fontStyle=a?"italic":"",this.textarea.style.fontSize=Math.round(i)+"px",this.textarea.style.zIndex=this.zIndex,this.textarea.style.fontFamily=s,this.textarea.style.textAlign=o,this.textarea.style.outline="none",this.textarea.style.color=r;var u=this.textDirection=mxUtils.getValue(n.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);u==mxConstants.TEXT_DIRECTION_AUTO&&(null==n||null==n.text||n.text.dialect==mxConstants.DIALECT_STRICTHTML||mxUtils.isNode(n.text.value)||(u=n.text.getAutoDirection())),u==mxConstants.TEXT_DIRECTION_LTR||u==mxConstants.TEXT_DIRECTION_RTL?this.textarea.setAttribute("dir",u):this.textarea.removeAttribute("dir"),this.textarea.innerHTML=this.getInitialValue(n,e)||"",this.initialValue=this.textarea.innerHTML,0==this.textarea.innerHTML.length||"
"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=!0):this.clearOnChange=this.textarea.innerHTML==this.getEmptyLabelText(),this.graph.container.appendChild(this.textarea),this.editingCell=t,this.trigger=e,this.textNode=null,null!=n.text&&this.isHideLabel(n)&&(this.textNode=n.text.node,this.textNode.style.visibility="hidden"),this.autoSize&&(this.graph.model.isEdge(n.cell)||"fill"!=n.style[mxConstants.STYLE_OVERFLOW])&&window.setTimeout(mxUtils.bind(this,(function(){this.resize()})),0),this.resize();try{this.textarea.focus(),this.isSelectText()&&this.textarea.innerHTML.length>0&&(this.textarea.innerHTML!=this.getEmptyLabelText()||!this.clearOnChange)&&document.execCommand("selectAll",!1,null)}catch(t){}}},mxCellEditor.prototype.isSelectText=function(){return this.selectText},mxCellEditor.prototype.clearSelection=function(){var t=null;window.getSelection?t=window.getSelection():document.selection&&(t=document.selection),null!=t&&(t.empty?t.empty():t.removeAllRanges&&t.removeAllRanges())},mxCellEditor.prototype.stopEditing=function(t){if(t=t||!1,null!=this.editingCell){null!=this.textNode&&(this.textNode.style.visibility="visible",this.textNode=null);var e=t?null:this.graph.view.getState(this.editingCell),n=this.initialValue;if(this.initialValue=null,this.editingCell=null,this.trigger=null,this.bounds=null,this.textarea.blur(),this.clearSelection(),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.textarea.innerHTML="",this.clearOnChange=!1),null!=e&&(this.textarea.innerHTML!=n||null!=this.align)){this.prepareTextarea();var i=this.getCurrentValue(e);this.graph.getModel().beginUpdate();try{null!=i&&this.applyValue(e,i),null!=this.align&&this.graph.setCellStyles(mxConstants.STYLE_ALIGN,this.align,[e.cell])}finally{this.graph.getModel().endUpdate()}}mxEvent.release(this.textarea),this.textarea=null,this.align=null}},mxCellEditor.prototype.prepareTextarea=function(){null!=this.textarea.lastChild&&"BR"==this.textarea.lastChild.nodeName&&this.textarea.removeChild(this.textarea.lastChild)},mxCellEditor.prototype.isHideLabel=function(t){return!0},mxCellEditor.prototype.getMinimumSize=function(t){var e=this.graph.getView().scale;return new mxRectangle(0,0,null==t.text?30:t.text.size*e+20,"left"==this.textarea.style.textAlign?120:40)},mxCellEditor.prototype.getEditorBounds=function(t){var e=this.graph.getModel().isEdge(t.cell),n=this.graph.getView().scale,i=this.getMinimumSize(t),s=i.width,r=i.height,o=null;if(!e&&t.view.graph.cellRenderer.legacySpacing&&"fill"==t.style[mxConstants.STYLE_OVERFLOW])o=t.shape.getLabelBounds(mxRectangle.fromRectangle(t));else{var l=parseInt(t.style[mxConstants.STYLE_SPACING]||0)*n,a=(parseInt(t.style[mxConstants.STYLE_SPACING_TOP]||0)+mxText.prototype.baseSpacingTop)*n+l,h=(parseInt(t.style[mxConstants.STYLE_SPACING_RIGHT]||0)+mxText.prototype.baseSpacingRight)*n+l,u=(parseInt(t.style[mxConstants.STYLE_SPACING_BOTTOM]||0)+mxText.prototype.baseSpacingBottom)*n+l,d=(parseInt(t.style[mxConstants.STYLE_SPACING_LEFT]||0)+mxText.prototype.baseSpacingLeft)*n+l;o=new mxRectangle(t.x,t.y,Math.max(s,t.width-d-h),Math.max(r,t.height-a-u));var p=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),m=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);if(o=null!=t.shape&&p==mxConstants.ALIGN_CENTER&&m==mxConstants.ALIGN_MIDDLE?t.shape.getLabelBounds(o):o,e?(o.x=t.absoluteOffset.x,o.y=t.absoluteOffset.y,null!=t.text&&null!=t.text.boundingBox&&(t.text.boundingBox.x>0&&(o.x=t.text.boundingBox.x),t.text.boundingBox.y>0&&(o.y=t.text.boundingBox.y))):null!=t.text&&null!=t.text.boundingBox&&(o.x=Math.min(o.x,t.text.boundingBox.x),o.y=Math.min(o.y,t.text.boundingBox.y)),o.x+=d,o.y+=a,null!=t.text&&null!=t.text.boundingBox&&(e?(o.width=Math.max(s,t.text.boundingBox.width),o.height=Math.max(r,t.text.boundingBox.height)):(o.width=Math.max(o.width,t.text.boundingBox.width),o.height=Math.max(o.height,t.text.boundingBox.height))),this.graph.getModel().isVertex(t.cell)){var c=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER);c==mxConstants.ALIGN_LEFT?o.x-=t.width:c==mxConstants.ALIGN_RIGHT&&(o.x+=t.width);var g=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);g==mxConstants.ALIGN_TOP?o.y-=t.height:g==mxConstants.ALIGN_BOTTOM&&(o.y+=t.height)}}return new mxRectangle(Math.round(o.x),Math.round(o.y),Math.round(o.width),Math.round(o.height))},mxCellEditor.prototype.getEmptyLabelText=function(t){return this.emptyLabelText},mxCellEditor.prototype.getEditingCell=function(){return this.editingCell},mxCellEditor.prototype.destroy=function(){null!=this.textarea&&(mxEvent.release(this.textarea),null!=this.textarea.parentNode&&this.textarea.parentNode.removeChild(this.textarea),this.textarea=null),null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null),this.zoomHandler&&(this.graph.view.removeListener(this.zoomHandler),this.zoomHandler=null)},__mxOutput.mxCellEditor=void 0!==mxCellEditor?mxCellEditor:void 0,mxCellRenderer.defaultShapes=new Object,mxCellRenderer.prototype.defaultEdgeShape=mxConnector,mxCellRenderer.prototype.defaultVertexShape=mxRectangleShape,mxCellRenderer.prototype.defaultTextShape=mxText,mxCellRenderer.prototype.legacyControlPosition=!0,mxCellRenderer.prototype.legacySpacing=!0,mxCellRenderer.prototype.antiAlias=!0,mxCellRenderer.prototype.minSvgStrokeWidth=1,mxCellRenderer.prototype.forceControlClickHandler=!1,mxCellRenderer.registerShape=function(t,e){mxCellRenderer.defaultShapes[t]=e},mxCellRenderer.registerShape(mxConstants.SHAPE_RECTANGLE,mxRectangleShape),mxCellRenderer.registerShape(mxConstants.SHAPE_ELLIPSE,mxEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_RHOMBUS,mxRhombus),mxCellRenderer.registerShape(mxConstants.SHAPE_CYLINDER,mxCylinder),mxCellRenderer.registerShape(mxConstants.SHAPE_CONNECTOR,mxConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_ACTOR,mxActor),mxCellRenderer.registerShape(mxConstants.SHAPE_TRIANGLE,mxTriangle),mxCellRenderer.registerShape(mxConstants.SHAPE_HEXAGON,mxHexagon),mxCellRenderer.registerShape(mxConstants.SHAPE_CLOUD,mxCloud),mxCellRenderer.registerShape(mxConstants.SHAPE_LINE,mxLine),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW,mxArrow),mxCellRenderer.registerShape(mxConstants.SHAPE_ARROW_CONNECTOR,mxArrowConnector),mxCellRenderer.registerShape(mxConstants.SHAPE_DOUBLE_ELLIPSE,mxDoubleEllipse),mxCellRenderer.registerShape(mxConstants.SHAPE_SWIMLANE,mxSwimlane),mxCellRenderer.registerShape(mxConstants.SHAPE_IMAGE,mxImageShape),mxCellRenderer.registerShape(mxConstants.SHAPE_LABEL,mxLabel),mxCellRenderer.prototype.initializeShape=function(t){t.shape.dialect=t.view.graph.dialect,this.configureShape(t),t.shape.init(t.view.getDrawPane())},mxCellRenderer.prototype.createShape=function(t){var e=null;if(null!=t.style){var n=mxStencilRegistry.getStencil(t.style[mxConstants.STYLE_SHAPE]);if(null!=n)e=new mxShape(n);else e=new(this.getShapeConstructor(t))}return e},mxCellRenderer.prototype.createIndicatorShape=function(t){t.shape.indicatorShape=this.getShape(t.view.graph.getIndicatorShape(t))},mxCellRenderer.prototype.getShape=function(t){return null!=t?mxCellRenderer.defaultShapes[t]:null},mxCellRenderer.prototype.getShapeConstructor=function(t){var e=this.getShape(t.style[mxConstants.STYLE_SHAPE]);return null==e&&(e=t.view.graph.getModel().isEdge(t.cell)?this.defaultEdgeShape:this.defaultVertexShape),e},mxCellRenderer.prototype.configureShape=function(t){t.shape.apply(t),t.shape.image=t.view.graph.getImage(t),t.shape.indicatorColor=t.view.graph.getIndicatorColor(t),t.shape.indicatorStrokeColor=t.style[mxConstants.STYLE_INDICATOR_STROKECOLOR],t.shape.indicatorGradientColor=t.view.graph.getIndicatorGradientColor(t),t.shape.indicatorDirection=t.style[mxConstants.STYLE_INDICATOR_DIRECTION],t.shape.indicatorImage=t.view.graph.getIndicatorImage(t),this.postConfigureShape(t)},mxCellRenderer.prototype.postConfigureShape=function(t){null!=t.shape&&(this.resolveColor(t,"indicatorGradientColor",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"indicatorColor",mxConstants.STYLE_FILLCOLOR),this.resolveColor(t,"gradient",mxConstants.STYLE_GRADIENTCOLOR),this.resolveColor(t,"stroke",mxConstants.STYLE_STROKECOLOR),this.resolveColor(t,"fill",mxConstants.STYLE_FILLCOLOR))},mxCellRenderer.prototype.checkPlaceholderStyles=function(t){if(null!=t.style)for(var e=["inherit","swimlane","indicated"],n=[mxConstants.STYLE_FILLCOLOR,mxConstants.STYLE_STROKECOLOR,mxConstants.STYLE_GRADIENTCOLOR,mxConstants.STYLE_FONTCOLOR],i=0;i=0)return!0;return!1},mxCellRenderer.prototype.resolveColor=function(t,e,n){var i=n==mxConstants.STYLE_FONTCOLOR?t.text:t.shape;if(null!=i){var s=t.view.graph,r=i[e],o=null;if("inherit"==r?o=s.model.getParent(t.cell):"swimlane"==r?(i[e]=n==mxConstants.STYLE_STROKECOLOR||n==mxConstants.STYLE_FONTCOLOR?"#000000":"#ffffff",o=null!=s.model.getTerminal(t.cell,!1)?s.model.getTerminal(t.cell,!1):t.cell,o=s.getSwimlane(o),n=s.swimlaneIndicatorColorAttribute):"indicated"==r&&null!=t.shape?i[e]=t.shape.indicatorColor:n!=mxConstants.STYLE_FILLCOLOR&&r==mxConstants.STYLE_FILLCOLOR&&null!=t.shape?i[e]=t.style[mxConstants.STYLE_FILLCOLOR]:n!=mxConstants.STYLE_STROKECOLOR&&r==mxConstants.STYLE_STROKECOLOR&&null!=t.shape&&(i[e]=t.style[mxConstants.STYLE_STROKECOLOR]),null!=o){var l=s.getView().getState(o);if(i[e]=null,null!=l){var a=n==mxConstants.STYLE_FONTCOLOR?l.text:l.shape;i[e]=null!=a&&"indicatorColor"!=e?a[e]:l.style[n]}}}},mxCellRenderer.prototype.getLabelValue=function(t){return t.view.graph.getLabel(t.cell)},mxCellRenderer.prototype.createLabel=function(t,e){var n=t.view.graph;if(n.getModel().isEdge(t.cell),t.style[mxConstants.STYLE_FONTSIZE]>0||null==t.style[mxConstants.STYLE_FONTSIZE]){var i=n.isHtmlLabel(t.cell)||null!=e&&mxUtils.isNode(e);t.text=new this.defaultTextShape(e,new mxRectangle,t.style[mxConstants.STYLE_ALIGN]||mxConstants.ALIGN_CENTER,n.getVerticalAlign(t),t.style[mxConstants.STYLE_FONTCOLOR],t.style[mxConstants.STYLE_FONTFAMILY],t.style[mxConstants.STYLE_FONTSIZE],t.style[mxConstants.STYLE_FONTSTYLE],t.style[mxConstants.STYLE_SPACING],t.style[mxConstants.STYLE_SPACING_TOP],t.style[mxConstants.STYLE_SPACING_RIGHT],t.style[mxConstants.STYLE_SPACING_BOTTOM],t.style[mxConstants.STYLE_SPACING_LEFT],t.style[mxConstants.STYLE_HORIZONTAL],t.style[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],t.style[mxConstants.STYLE_LABEL_BORDERCOLOR],n.isWrapping(t.cell)&&n.isHtmlLabel(t.cell),n.isLabelClipped(t.cell),t.style[mxConstants.STYLE_OVERFLOW],t.style[mxConstants.STYLE_LABEL_PADDING],mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)),t.text.opacity=mxUtils.getValue(t.style,mxConstants.STYLE_TEXT_OPACITY,100),t.text.dialect=i?mxConstants.DIALECT_STRICTHTML:t.view.graph.dialect,t.text.style=t.style,t.text.state=t,this.initializeLabel(t,t.text);var s=!1,r=function(e){var i=t;if(mxClient.IS_TOUCH||s){var r=mxEvent.getClientX(e),o=mxEvent.getClientY(e),l=mxUtils.convertPoint(n.container,r,o);i=n.view.getState(n.getCellAt(l.x,l.y))}return i};mxEvent.addGestureListeners(t.text.node,mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e,t)),s=n.dialect!=mxConstants.DIALECT_SVG&&"IMG"==mxEvent.getSource(e).nodeName)})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&n.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e,r(e)))})),mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e,r(e))),s=!1)}))),n.nativeDblClickEnabled&&mxEvent.addListener(t.text.node,"dblclick",mxUtils.bind(this,(function(e){this.isLabelEvent(t,e)&&(n.dblClick(e,t.cell),mxEvent.consume(e))})))}},mxCellRenderer.prototype.initializeLabel=function(t,e){mxClient.IS_SVG&&mxClient.NO_FO&&e.dialect!=mxConstants.DIALECT_SVG?e.init(t.view.graph.container):e.init(t.view.getDrawPane())},mxCellRenderer.prototype.createCellOverlays=function(t){var e=t.view.graph.getCellOverlays(t.cell),n=null;if(null!=e){n=new mxDictionary;for(var i=0;i0)?this.createLabel(t,i):null==t.text||null!=i&&0!=i.length||(t.text.destroy(),t.text=null),null!=t.text){e&&(null!=t.text.lastValue&&this.isTextShapeInvalid(t,t.text)&&(t.text.lastValue=null),t.text.resetStyles(),t.text.apply(t),t.text.valign=n.getVerticalAlign(t));var a=this.getLabelBounds(t),h=this.getTextScale(t);if(this.resolveColor(t,"color",mxConstants.STYLE_FONTCOLOR),e||t.text.value!=i||t.text.isWrapping!=s||t.text.overflow!=l||t.text.isClipping!=r||t.text.scale!=h||t.text.dialect!=o||null==t.text.bounds||!t.text.bounds.equals(a)){t.text.dialect=o,t.text.value=i,t.text.bounds=a,t.text.scale=h,t.text.wrap=s,t.text.clipped=r,t.text.overflow=l;var u=t.text.node.style.visibility;this.redrawLabelShape(t.text),t.text.node.style.visibility=u}}},mxCellRenderer.prototype.isTextShapeInvalid=function(t,e){function n(n,i,s){return"spacingTop"==i||"spacingRight"==i||"spacingBottom"==i||"spacingLeft"==i?parseFloat(e[n])-parseFloat(e.spacing)!=(t.style[i]||s):e[n]!=(t.style[i]||s)}return n("fontStyle",mxConstants.STYLE_FONTSTYLE,mxConstants.DEFAULT_FONTSTYLE)||n("family",mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY)||n("size",mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE)||n("color",mxConstants.STYLE_FONTCOLOR,"black")||n("align",mxConstants.STYLE_ALIGN,"")||n("valign",mxConstants.STYLE_VERTICAL_ALIGN,"")||n("spacing",mxConstants.STYLE_SPACING,2)||n("spacingTop",mxConstants.STYLE_SPACING_TOP,0)||n("spacingRight",mxConstants.STYLE_SPACING_RIGHT,0)||n("spacingBottom",mxConstants.STYLE_SPACING_BOTTOM,0)||n("spacingLeft",mxConstants.STYLE_SPACING_LEFT,0)||n("horizontal",mxConstants.STYLE_HORIZONTAL,!0)||n("background",mxConstants.STYLE_LABEL_BACKGROUNDCOLOR)||n("border",mxConstants.STYLE_LABEL_BORDERCOLOR)||n("opacity",mxConstants.STYLE_TEXT_OPACITY,100)||n("textDirection",mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION)},mxCellRenderer.prototype.redrawLabelShape=function(t){t.redraw()},mxCellRenderer.prototype.getTextScale=function(t){return t.view.scale},mxCellRenderer.prototype.getLabelBounds=function(t){var e=t.view.graph,n=t.view.scale,i=e.getModel().isEdge(t.cell),s=new mxRectangle(t.absoluteOffset.x,t.absoluteOffset.y);if(i){var r=t.text.getSpacing();s.x+=r.x*n,s.y+=r.y*n;var o=e.getCellGeometry(t.cell);null!=o&&(s.width=Math.max(0,o.width*n),s.height=Math.max(0,o.height*n))}else{if(t.text.isPaintBoundsInverted()){var l=s.x;s.x=s.y,s.y=l}s.x+=t.x,s.y+=t.y,s.width=Math.max(1,t.width),s.height=Math.max(1,t.height)}if(t.text.isPaintBoundsInverted()){var a=(t.width-t.height)/2;s.x+=a,s.y-=a;l=s.width;s.width=s.height,s.height=l}if(null!=t.shape){var h=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),u=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);h==mxConstants.ALIGN_CENTER&&u==mxConstants.ALIGN_MIDDLE&&(s=t.shape.getLabelBounds(s))}var d=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);return null!=d&&(s.width=parseFloat(d)*n),i||this.rotateLabelBounds(t,s),s},mxCellRenderer.prototype.rotateLabelBounds=function(t,e){if(e.y-=t.text.margin.y*e.height,e.x-=t.text.margin.x*e.width,!this.legacySpacing||"fill"!=t.style[mxConstants.STYLE_OVERFLOW]&&"width"!=t.style[mxConstants.STYLE_OVERFLOW]){var n=t.view.scale,i=t.text.getSpacing();e.x+=i.x*n,e.y+=i.y*n;var s=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),r=mxUtils.getValue(t.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE),o=mxUtils.getValue(t.style,mxConstants.STYLE_LABEL_WIDTH,null);e.width=Math.max(0,e.width-(s==mxConstants.ALIGN_CENTER&&null==o?t.text.spacingLeft*n+t.text.spacingRight*n:0)),e.height=Math.max(0,e.height-(r==mxConstants.ALIGN_MIDDLE?t.text.spacingTop*n+t.text.spacingBottom*n:0))}var l=t.text.getTextRotation();if(0!=l&&null!=t&&t.view.graph.model.isVertex(t.cell)){var a=t.getCenterX(),h=t.getCenterY();if(e.x!=a||e.y!=h){var u=l*(Math.PI/180),d=mxUtils.getRotatedPoint(new mxPoint(e.x,e.y),Math.cos(u),Math.sin(u),new mxPoint(a,h));e.x=d.x,e.y=d.y}}},mxCellRenderer.prototype.redrawCellOverlays=function(t,e){if(this.createCellOverlays(t),null!=t.overlays){var n=mxUtils.mod(mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0),90),i=mxUtils.toRadians(n),s=Math.cos(i),r=Math.sin(i);t.overlays.visit((function(i,o){var l=o.overlay.getBounds(t);if(!t.view.graph.getModel().isEdge(t.cell)&&null!=t.shape&&0!=n){var a=l.getCenterX(),h=l.getCenterY(),u=mxUtils.getRotatedPoint(new mxPoint(a,h),s,r,new mxPoint(t.getCenterX(),t.getCenterY()));a=u.x,h=u.y,l.x=Math.round(a-l.width/2),l.y=Math.round(h-l.height/2)}!e&&null!=o.bounds&&o.scale==t.view.scale&&o.bounds.equals(l)||(o.bounds=l,o.scale=t.view.scale,o.redraw())}))}},mxCellRenderer.prototype.redrawControl=function(t,e){var n=t.view.graph.getFoldingImage(t);if(null!=t.control&&null!=n){var i=this.getControlBounds(t,n.width,n.height),s=this.legacyControlPosition?mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0):t.shape.getTextRotation(),r=t.view.scale;!e&&t.control.scale==r&&t.control.bounds.equals(i)&&t.control.rotation==s||(t.control.rotation=s,t.control.bounds=i,t.control.scale=r,t.control.redraw())}},mxCellRenderer.prototype.getControlBounds=function(t,e,n){if(null!=t.control){var i=t.view.scale,s=t.getCenterX(),r=t.getCenterY();if(!t.view.graph.getModel().isEdge(t.cell)&&(s=t.x+e*i,r=t.y+n*i,null!=t.shape)){var o=t.shape.getShapeRotation();if(this.legacyControlPosition)o=mxUtils.getValue(t.style,mxConstants.STYLE_ROTATION,0);else if(t.shape.isPaintBoundsInverted()){var l=(t.width-t.height)/2;s+=l,r-=l}if(0!=o){var a=mxUtils.toRadians(o),h=Math.cos(a),u=Math.sin(a),d=mxUtils.getRotatedPoint(new mxPoint(s,r),h,u,new mxPoint(t.getCenterX(),t.getCenterY()));s=d.x,r=d.y}}return t.view.graph.getModel().isEdge(t.cell),new mxRectangle(Math.round(s-e/2*i),Math.round(r-n/2*i),Math.round(e*i),Math.round(n*i))}return null},mxCellRenderer.prototype.insertStateAfter=function(t,e,n){for(var i=this.getShapesForState(t),s=0;s0?i[0]:null)&&(y=a.transformControlPoint(t,y),mxUtils.contains(e,y.x,y.y)&&(y=null));var u=0,d=0,p=0,m=0,c=mxUtils.getValue(t.style,mxConstants.STYLE_SEGMENT,h.gridSize)*a.scale,g=mxUtils.getValue(t.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_WEST);g==mxConstants.DIRECTION_NORTH||g==mxConstants.DIRECTION_SOUTH?(u=a.getRoutingCenterX(e),d=c):(p=a.getRoutingCenterY(e),m=c),null==y||y.xe.x+e.width?null!=y?(u=y.x,m=Math.max(Math.abs(p-y.y),m)):g==mxConstants.DIRECTION_NORTH?p=e.y-2*d:g==mxConstants.DIRECTION_SOUTH?p=e.y+e.height+2*d:u=g==mxConstants.DIRECTION_EAST?e.x-2*m:e.x+e.width+2*m:null!=y&&(u=a.getRoutingCenterX(e),d=Math.max(Math.abs(u-y.x),m),p=y.y,m=0),s.push(new mxPoint(u-d,p-m)),s.push(new mxPoint(u+d,p+m))}}else if(null!=i&&i.length>0)for(var x=0;x0?i[0]:null,o=!1,l=!1;if(null!=e&&null!=n)if(null!=r){var a=Math.min(e.x,n.x),h=Math.max(e.x+e.width,n.x+n.width),u=Math.min(e.y,n.y),d=Math.max(e.y+e.height,n.y+n.height);o=(r=t.view.transformControlPoint(t,r)).yd,l=r.xh}else{if(!(o=(a=Math.max(e.x,n.x))==(h=Math.min(e.x+e.width,n.x+n.width))))l=(u=Math.max(e.y,n.y))==(d=Math.min(e.y+e.height,n.y+n.height))}l||!o&&t.style[mxConstants.STYLE_ELBOW]!=mxConstants.ELBOW_VERTICAL?mxEdgeStyle.SideToSide(t,e,n,i,s):mxEdgeStyle.TopToBottom(t,e,n,i,s)},SideToSide:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.x,n.x),d=Math.min(e.x+e.width,n.x+n.width),p=null!=o?o.x:Math.round(d+(u-d)/2),m=r.getRoutingCenterY(e),c=r.getRoutingCenterY(n);if(null!=o&&(o.y>=e.y&&o.y<=e.y+e.height&&(m=o.y),o.y>=n.y&&o.y<=n.y+n.height&&(c=o.y)),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),mxUtils.contains(n,p,c)||mxUtils.contains(e,p,c)||s.push(new mxPoint(p,c)),1==s.length)if(null!=o)mxUtils.contains(n,p,o.y)||mxUtils.contains(e,p,o.y)||s.push(new mxPoint(p,o.y));else{var g=Math.max(e.y,n.y),x=Math.min(e.y+e.height,n.y+n.height);s.push(new mxPoint(p,g+(x-g)/2))}}},TopToBottom:function(t,e,n,i,s){var r=t.view,o=null!=i&&i.length>0?i[0]:null,l=t.absolutePoints,a=l[0],h=l[l.length-1];if(null!=o&&(o=r.transformControlPoint(t,o)),null!=a&&((e=new mxCellState).x=a.x,e.y=a.y),null!=h&&((n=new mxCellState).x=h.x,n.y=h.y),null!=e&&null!=n){var u=Math.max(e.y,n.y),d=Math.min(e.y+e.height,n.y+n.height),p=r.getRoutingCenterX(e);null!=o&&o.x>=e.x&&o.x<=e.x+e.width&&(p=o.x);var m=null!=o?o.y:Math.round(d+(u-d)/2);if(mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),p=null!=o&&o.x>=n.x&&o.x<=n.x+n.width?o.x:r.getRoutingCenterX(n),mxUtils.contains(n,p,m)||mxUtils.contains(e,p,m)||s.push(new mxPoint(p,m)),1==s.length)if(null!=o&&1==s.length)mxUtils.contains(n,o.x,m)||mxUtils.contains(e,o.x,m)||s.push(new mxPoint(o.x,m));else{var c=Math.max(e.x,n.x),g=Math.min(e.x+e.width,n.x+n.width);s.push(new mxPoint(c+(g-c)/2,m))}}},SegmentConnector:function(t,e,n,i,s){var r=mxEdgeStyle.scalePointArray(t.absolutePoints,t.view.scale),o=mxEdgeStyle.scaleCellState(e,t.view.scale),l=mxEdgeStyle.scaleCellState(n,t.view.scale),a=s.length>0?s[0]:null,h=!0,u=null;function d(e){return e.x=Math.round(e.x*t.view.scale*10)/10,e.y=Math.round(e.y*t.view.scale*10)/10,(null==a||Math.abs(a.x-e.x)>=1||Math.abs(a.y-e.y)>=Math.max(1,t.view.scale))&&(s.push(e),a=e),a}var p=r[0];null==p&&null!=o?p=new mxPoint(t.view.getRoutingCenterX(o),t.view.getRoutingCenterY(o)):null!=p&&(p=p.clone());var m=r.length-1;if(null!=i&&i.length>0){for(var c=[],g=0;g=f.y&&S.y<=f.y+f.height,L=null!=f&&S.x>=f.x&&S.x<=f.x+f.width;if(C=T||null==v&&w,E=b||null==v&&L,0==g&&(C&&E||b&&T));else{if(null!=v&&!T&&!b&&(w||L)){h=!w;break}if(E||C){h=C,1==g&&(h=c.length%2==0?C:E);break}}f=l,null!=(v=r[m])&&(f=null),S=c[c.length-1],b&&T&&(c=c.slice(1))}h&&(null!=r[0]&&r[0].y!=u.y||null==r[0]&&null!=o&&(u.yo.y+o.height))?d(new mxPoint(p.x,u.y)):!h&&(null!=r[0]&&r[0].x!=u.x||null==r[0]&&null!=o&&(u.xo.x+o.width))&&d(new mxPoint(u.x,p.y)),h?p.y=u.y:p.x=u.x;for(g=0;gl.y+l.height))?d(new mxPoint(p.x,u.y)):!h&&(null!=r[m]&&r[m].x!=u.x||null==r[m]&&null!=l&&(u.xl.x+l.width))&&d(new mxPoint(u.x,p.y))),null==r[0]&&null!=o)for(;s.length>1&&null!=s[1]&&mxUtils.contains(o,s[1].x,s[1].y);)s.splice(1,1);if(null==r[m]&&null!=l)for(;s.length>1&&null!=s[s.length-1]&&mxUtils.contains(l,s[s.length-1].x,s[s.length-1].y);)s.splice(s.length-1,1);null!=y&&null!=s[s.length-1]&&Math.abs(y.x-s[s.length-1].x)<=1&&Math.abs(y.y-s[s.length-1].y)<=1&&(s.splice(s.length-1,1),null!=s[s.length-1]&&(Math.abs(s[s.length-1].x-y.x)<1&&(s[s.length-1].x=y.x),Math.abs(s[s.length-1].y-y.y)<1&&(s[s.length-1].y=y.y)))},orthBuffer:10,orthPointsFallback:!0,dirVectors:[[-1,0],[0,-1],[1,0],[0,1],[-1,0],[0,-1],[1,0]],wayPoints1:[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],routePatterns:[[[513,2308,2081,2562],[513,1090,514,2184,2114,2561],[513,1090,514,2564,2184,2562],[513,2308,2561,1090,514,2568,2308]],[[514,1057,513,2308,2081,2562],[514,2184,2114,2561],[514,2184,2562,1057,513,2564,2184],[514,1057,513,2568,2308,2561]],[[1090,514,1057,513,2308,2081,2562],[2114,2561],[1090,2562,1057,513,2564,2184],[1090,514,1057,513,2308,2561,2568]],[[2081,2562],[1057,513,1090,514,2184,2114,2561],[1057,513,1090,514,2184,2562,2564],[1057,2561,1090,514,2568,2308]]],inlineRoutePatterns:[[null,[2114,2568],null,null],[null,[514,2081,2114,2568],null,null],[null,[2114,2561],null,null],[[2081,2562],[1057,2114,2568],[2184,2562],null]],vertexSeperations:[],limits:[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]],LEFT_MASK:32,TOP_MASK:64,RIGHT_MASK:128,BOTTOM_MASK:256,LEFT:1,TOP:2,RIGHT:4,BOTTOM:8,SIDE_MASK:480,CENTER_MASK:512,SOURCE_MASK:1024,TARGET_MASK:2048,VERTEX_MASK:3072,getJettySize:function(t,e){var n=mxUtils.getValue(t.style,e?mxConstants.STYLE_SOURCE_JETTY_SIZE:mxConstants.STYLE_TARGET_JETTY_SIZE,mxUtils.getValue(t.style,mxConstants.STYLE_JETTY_SIZE,mxEdgeStyle.orthBuffer));if("auto"==n)if(mxUtils.getValue(t.style,e?mxConstants.STYLE_STARTARROW:mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE){var i=mxUtils.getNumber(t.style,e?mxConstants.STYLE_STARTSIZE:mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE);n=Math.max(2,Math.ceil((i+mxEdgeStyle.orthBuffer)/mxEdgeStyle.orthBuffer))*mxEdgeStyle.orthBuffer}else n=2*mxEdgeStyle.orthBuffer;return n},scalePointArray:function(t,e){var n=[];if(null!=t)for(var i=0;i0||o||l)mxEdgeStyle.SegmentConnector(t,e,n,i,s);else{var w,L=[mxConstants.DIRECTION_MASK_ALL,mxConstants.DIRECTION_MASK_ALL],O=0;if(null!=h)if(L[0]=mxUtils.getPortConstraints(h,t,!0,mxConstants.DIRECTION_MASK_ALL),0!=(O=mxUtils.getValue(h.style,mxConstants.STYLE_ROTATION,0)))m=(w=mxUtils.getBoundingBox(new mxRectangle(m,c,g,x),O)).x,c=w.y,g=w.width,x=w.height;if(null!=u)if(L[1]=mxUtils.getPortConstraints(u,t,!1,mxConstants.DIRECTION_MASK_ALL),0!=(O=mxUtils.getValue(u.style,mxConstants.STYLE_ROTATION,0)))y=(w=mxUtils.getBoundingBox(new mxRectangle(y,f,v,C),O)).x,f=w.y,v=w.width,C=w.height;for(var I=[0,0],A=[[m,c,g,x],[y,f,v,C]],P=[E,S],_=0;_<2;_++)mxEdgeStyle.limits[_][1]=A[_][0]-P[_],mxEdgeStyle.limits[_][2]=A[_][1]-P[_],mxEdgeStyle.limits[_][4]=A[_][0]+A[_][2]+P[_],mxEdgeStyle.limits[_][8]=A[_][1]+A[_][3]+P[_];var R,M=A[0][0]+A[0][2]/2,N=A[0][1]+A[0][3]/2,H=A[1][0]+A[1][2]/2,D=N-(A[1][1]+A[1][3]/2),G=0;(R=M-H)<0?G=D<0?2:1:D<=0&&(G=3,0==R&&(G=2));var U=null;null!=h&&(U=d);var V=[[.5,.5],[.5,.5]];for(_=0;_<2;_++)null!=U&&(V[_][0]=(U.x-A[_][0])/A[_][2],Math.abs(U.x-A[_][0])<=1?I[_]=mxConstants.DIRECTION_MASK_WEST:Math.abs(U.x-A[_][0]-A[_][2])<=1&&(I[_]=mxConstants.DIRECTION_MASK_EAST),V[_][1]=(U.y-A[_][1])/A[_][3],Math.abs(U.y-A[_][1])<=1?I[_]=mxConstants.DIRECTION_MASK_NORTH:Math.abs(U.y-A[_][1]-A[_][3])<=1&&(I[_]=mxConstants.DIRECTION_MASK_SOUTH)),U=null,null!=u&&(U=p);var B=A[0][1]-(A[1][1]+A[1][3]),F=A[0][0]-(A[1][0]+A[1][2]),k=A[1][1]-(A[0][1]+A[0][3]),Y=A[1][0]-(A[0][0]+A[0][2]);mxEdgeStyle.vertexSeperations[1]=Math.max(F-b,0),mxEdgeStyle.vertexSeperations[2]=Math.max(B-b,0),mxEdgeStyle.vertexSeperations[4]=Math.max(k-b,0),mxEdgeStyle.vertexSeperations[3]=Math.max(Y-b,0);var j=[],z=[],W=[];z[0]=F>=Y?mxConstants.DIRECTION_MASK_WEST:mxConstants.DIRECTION_MASK_EAST,W[0]=B>=k?mxConstants.DIRECTION_MASK_NORTH:mxConstants.DIRECTION_MASK_SOUTH,z[1]=mxUtils.reversePortConstraints(z[0]),W[1]=mxUtils.reversePortConstraints(W[0]);var K=F>=Y?F:Y,X=B>=k?B:k,Z=[[0,0],[0,0]],q=!1;for(_=0;_<2;_++)0==I[_]&&(0==(z[_]&L[_])&&(z[_]=mxUtils.reversePortConstraints(z[_])),0==(W[_]&L[_])&&(W[_]=mxUtils.reversePortConstraints(W[_])),Z[_][0]=W[_],Z[_][1]=z[_]);X>0&&K>0&&((z[0]&L[0])>0&&(W[1]&L[1])>0?(Z[0][0]=z[0],Z[0][1]=W[0],Z[1][0]=W[1],Z[1][1]=z[1],q=!0):(W[0]&L[0])>0&&(z[1]&L[1])>0&&(Z[0][0]=W[0],Z[0][1]=z[0],Z[1][0]=z[1],Z[1][1]=W[1],q=!0)),X>0&&!q&&(Z[0][0]=W[0],Z[0][1]=z[0],Z[1][0]=W[1],Z[1][1]=z[1],q=!0),K>0&&!q&&(Z[0][0]=z[0],Z[0][1]=W[0],Z[1][0]=z[1],Z[1][1]=W[1],q=!0);for(_=0;_<2;_++)0==I[_]&&(0==(Z[_][0]&L[_])&&(Z[_][0]=Z[_][1]),j[_]=Z[_][0]&L[_],j[_]|=(Z[_][1]&L[_])<<8,j[_]|=(Z[1-_][_]&L[_])<<16,j[_]|=(Z[1-_][1-_]&L[_])<<24,0==(15&j[_])&&(j[_]=j[_]<<8),0==(3840&j[_])&&(j[_]=15&j[_]|j[_]>>8),0==(983040&j[_])&&(j[_]=65535&j[_]|(251658240&j[_])>>8),I[_]=15&j[_],L[_]!=mxConstants.DIRECTION_MASK_WEST&&L[_]!=mxConstants.DIRECTION_MASK_NORTH&&L[_]!=mxConstants.DIRECTION_MASK_EAST&&L[_]!=mxConstants.DIRECTION_MASK_SOUTH||(I[_]=L[_]));var $=I[0]==mxConstants.DIRECTION_MASK_EAST?3:I[0],Q=I[1]==mxConstants.DIRECTION_MASK_EAST?3:I[1];($-=G)<1&&($+=4),(Q-=G)<1&&(Q+=4);var J=mxEdgeStyle.routePatterns[$-1][Q-1];switch(mxEdgeStyle.wayPoints1[0][0]=A[0][0],mxEdgeStyle.wayPoints1[0][1]=A[0][1],I[0]){case mxConstants.DIRECTION_MASK_WEST:mxEdgeStyle.wayPoints1[0][0]-=E,mxEdgeStyle.wayPoints1[0][1]+=V[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_SOUTH:mxEdgeStyle.wayPoints1[0][0]+=V[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]+=A[0][3]+E;break;case mxConstants.DIRECTION_MASK_EAST:mxEdgeStyle.wayPoints1[0][0]+=A[0][2]+E,mxEdgeStyle.wayPoints1[0][1]+=V[0][1]*A[0][3];break;case mxConstants.DIRECTION_MASK_NORTH:mxEdgeStyle.wayPoints1[0][0]+=V[0][0]*A[0][2],mxEdgeStyle.wayPoints1[0][1]-=E}var tt=0,et=(I[0]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1,nt=et,it=0;for(_=0;_4&&(rt-=4);var ot=mxEdgeStyle.dirVectors[rt-1];(it=rt%2>0?0:1)!=et&&(tt++,mxEdgeStyle.wayPoints1[tt][0]=mxEdgeStyle.wayPoints1[tt-1][0],mxEdgeStyle.wayPoints1[tt][1]=mxEdgeStyle.wayPoints1[tt-1][1]);var lt=(J[_]&mxEdgeStyle.TARGET_MASK)>0,at=(J[_]&mxEdgeStyle.SOURCE_MASK)>0,ht=(J[_]&mxEdgeStyle.SIDE_MASK)>>5;(ht<<=G)>15&&(ht>>=4);var ut=(J[_]&mxEdgeStyle.CENTER_MASK)>0;if((at||lt)&&ht<9){var dt=0,pt=at?0:1;if(dt=ut&&0==it?A[pt][0]+V[pt][0]*A[pt][2]:ut?A[pt][1]+V[pt][1]*A[pt][3]:mxEdgeStyle.limits[pt][ht],0==it){var mt=(dt-mxEdgeStyle.wayPoints1[tt][0])*ot[0];mt>0&&(mxEdgeStyle.wayPoints1[tt][0]+=ot[0]*mt)}else{var ct=(dt-mxEdgeStyle.wayPoints1[tt][1])*ot[1];ct>0&&(mxEdgeStyle.wayPoints1[tt][1]+=ot[1]*ct)}}else ut&&(mxEdgeStyle.wayPoints1[tt][0]+=ot[0]*Math.abs(mxEdgeStyle.vertexSeperations[rt]/2),mxEdgeStyle.wayPoints1[tt][1]+=ot[1]*Math.abs(mxEdgeStyle.vertexSeperations[rt]/2));tt>0&&mxEdgeStyle.wayPoints1[tt][it]==mxEdgeStyle.wayPoints1[tt-1][it]?tt--:et=it}for(_=0;_<=tt;_++){if(_==tt)if((((I[1]&(mxConstants.DIRECTION_MASK_EAST|mxConstants.DIRECTION_MASK_WEST))>0?0:1)==nt?0:1)!=(tt+1)%2)break;s.push(new mxPoint(Math.round(mxEdgeStyle.wayPoints1[_][0]*t.view.scale*10)/10,Math.round(mxEdgeStyle.wayPoints1[_][1]*t.view.scale*10)/10))}for(var gt=1;gt0)for(var n=this.graph.getModel(),i=0;i0||o.height>0){s=new mxPoint(e.x,e.y);var l=!1,a=!1;this.graph.model.isVertex(t.cell)&&(l=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPH,0),a=1==mxUtils.getValue(t.style,mxConstants.STYLE_FLIPV,0),null!=t.shape&&null!=t.shape.stencil&&(l=1==mxUtils.getValue(t.style,"stencilFlipH",0)||l,a=1==mxUtils.getValue(t.style,"stencilFlipV",0)||a),l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y)),null!=(s=r(o,t,s,n))&&(l&&(s.x=2*o.getCenterX()-s.x),a&&(s.y=2*o.getCenterY()-s.y))}}null==s&&(s=this.getPoint(t))}return s},mxGraphView.prototype.getRoutingCenterX=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_X])||0;return t.getCenterX()+e*t.width},mxGraphView.prototype.getRoutingCenterY=function(t){var e=null!=t.style&&parseFloat(t.style[mxConstants.STYLE_ROUTING_CENTER_Y])||0;return t.getCenterY()+e*t.height},mxGraphView.prototype.getPerimeterBounds=function(t,e){return e=null!=e?e:0,null!=t&&(e+=parseFloat(t.style[mxConstants.STYLE_PERIMETER_SPACING]||0)),t.getPerimeterBounds(e*this.scale)},mxGraphView.prototype.getPerimeterFunction=function(t){var e=t.style[mxConstants.STYLE_PERIMETER];if("string"==typeof e){var n=mxStyleRegistry.getValue(e);null==n&&this.isAllowEval()&&(n=mxUtils.eval(e)),e=n}return"function"==typeof e?e:null},mxGraphView.prototype.getNextPoint=function(t,e,n){var i=t.absolutePoints,s=null;if(null!=i&&i.length>=2){var r=i.length;s=i[n?Math.min(1,r-1):Math.max(0,r-2)]}return null==s&&null!=e&&(s=new mxPoint(e.getCenterX(),e.getCenterY())),s},mxGraphView.prototype.getVisibleTerminal=function(t,e){for(var n=this.graph.getModel(),i=n.getTerminal(t,e),s=i;null!=i&&i!=this.currentRoot;)this.graph.isCellVisible(s)&&!this.isCellCollapsed(i)||(s=i),i=n.getParent(i);return null==s||n.contains(s)&&n.getParent(s)!=n.getRoot()&&s!=this.currentRoot||(s=null),s},mxGraphView.prototype.updateEdgeBounds=function(t){var e=t.absolutePoints,n=e[0],i=e[e.length-1];if(n.x!=i.x||n.y!=i.y){var s=i.x-n.x,r=i.y-n.y;t.terminalDistance=Math.sqrt(s*s+r*r)}else t.terminalDistance=0;var o=0,l=[],a=n;if(null!=a){for(var h=a.x,u=a.y,d=h,p=u,m=1;m=Math.round(a+l)&&h1){for(var r=t.length,o=t.segments,l=t.absolutePoints[0],a=t.absolutePoints[1],h=mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n),u=0,d=0,p=0,m=2;mg&&(L=g);var O=Math.sqrt(mxUtils.ptSegDistSq(l.x,l.y,a.x,a.y,e,n));return-1==mxUtils.relativeCcw(l.x,l.y,a.x,a.y,e,n)&&(O=-O),new mxPoint((r/2-p-L)/r*-2,O/this.scale)}}return new mxPoint},mxGraphView.prototype.updateEdgeLabelOffset=function(t){var e=t.absolutePoints;if(t.absoluteOffset.x=t.getCenterX(),t.absoluteOffset.y=t.getCenterY(),null!=e&&e.length>0&&null!=t.segments){var n=this.graph.getCellGeometry(t.cell);if(n.relative){var i=this.getPoint(t,n);null!=i&&(t.absoluteOffset=i)}else{var s=e[0],r=e[e.length-1];if(null!=s&&null!=r){var o=r.x-s.x,l=r.y-s.y,a=0,h=0,u=n.offset;null!=u&&(a=u.x,h=u.y);var d=s.x+o/2+a*this.scale,p=s.y+l/2+h*this.scale;t.absoluteOffset.x=d,t.absoluteOffset.y=p}}}},mxGraphView.prototype.getState=function(t,e){e=e||!1;var n=null;return null!=t&&(n=this.states.get(t),e&&(null==n||this.updateStyle)&&this.graph.isCellVisible(t)&&(null==n?(n=this.createState(t),this.states.put(t,n)):n.style=this.graph.getCellStyle(t))),n},mxGraphView.prototype.isRendering=function(){return this.rendering},mxGraphView.prototype.setRendering=function(t){this.rendering=t},mxGraphView.prototype.isAllowEval=function(){return this.allowEval},mxGraphView.prototype.setAllowEval=function(t){this.allowEval=t},mxGraphView.prototype.getStates=function(){return this.states},mxGraphView.prototype.setStates=function(t){this.states=t},mxGraphView.prototype.getCellStates=function(t){if(null==t)return this.states;for(var e=[],n=0;ns&&n.x>s+2&&n.x<=i)return!0;var r=this.graph.container.offsetHeight,o=this.graph.container.clientHeight;return r>o&&n.y>o+2&&n.y<=r},mxGraphView.prototype.init=function(){this.installListeners();var t=this.graph;t.dialect==mxConstants.DIALECT_SVG?this.createSvg():t.dialect==mxConstants.DIALECT_VML?this.createVml():this.createHtml()},mxGraphView.prototype.installListeners=function(){var t=this.graph,e=t.container;if(null!=e){mxClient.IS_TOUCH&&(mxEvent.addListener(e,"gesturestart",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gesturechange",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))),mxEvent.addListener(e,"gestureend",mxUtils.bind(this,(function(e){t.fireGestureEvent(e),mxEvent.consume(e)}))));var n=null;mxEvent.addGestureListeners(e,mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||(mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_GC||mxClient.IS_OP||mxClient.IS_SF)&&this.isScrollEvent(e)||(t.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(e)),n=e.pointerId)})),mxUtils.bind(this,(function(e){!this.isContainerEvent(e)||null!=n&&e.pointerId!=n||t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(e))})),mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e)),n=null}))),mxEvent.addListener(e,"dblclick",mxUtils.bind(this,(function(e){this.isContainerEvent(e)&&t.dblClick(e)})));t.addMouseListener({mouseDown:function(e,n){t.popupMenuHandler.hideMenu()},mouseMove:function(){},mouseUp:function(){}}),this.moveHandler=mxUtils.bind(this,(function(n){null!=t.tooltipHandler&&t.tooltipHandler.isHideOnHover()&&t.tooltipHandler.hide(),this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(n)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&!mxEvent.isConsumed(n)&&t.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(n,function(n){var i=null;if(mxClient.IS_TOUCH){var s=mxEvent.getClientX(n),r=mxEvent.getClientY(n),o=mxUtils.convertPoint(e,s,r);i=t.view.getState(t.getCellAt(o.x,o.y))}return i}(n)))})),this.endHandler=mxUtils.bind(this,(function(e){this.captureDocumentGesture&&t.isMouseDown&&null!=t.container&&!this.isContainerEvent(e)&&"none"!=t.container.style.display&&"hidden"!=t.container.style.visibility&&t.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(e))})),mxEvent.addGestureListeners(document,null,this.moveHandler,this.endHandler)}},mxGraphView.prototype.createHtml=function(){var t=this.graph.container;if(null!=t&&(this.canvas=this.createHtmlPane("100%","100%"),this.canvas.style.overflow="hidden",this.backgroundPane=this.createHtmlPane("1px","1px"),this.drawPane=this.createHtmlPane("1px","1px"),this.overlayPane=this.createHtmlPane("1px","1px"),this.decoratorPane=this.createHtmlPane("1px","1px"),this.canvas.appendChild(this.backgroundPane),this.canvas.appendChild(this.drawPane),this.canvas.appendChild(this.overlayPane),this.canvas.appendChild(this.decoratorPane),t.appendChild(this.canvas),this.updateContainerStyle(t),mxClient.IS_QUIRKS)){var e=mxUtils.bind(this,(function(t){var e=this.getGraphBounds(),n=e.x+e.width+this.graph.border,i=e.y+e.height+this.graph.border;this.updateHtmlCanvasSize(n,i)}));mxEvent.addListener(window,"resize",e)}},mxGraphView.prototype.updateHtmlCanvasSize=function(t,e){if(null!=this.graph.container){var n=this.graph.container.offsetWidth,i=this.graph.container.offsetHeight;this.canvas.style.width=n")},mxGraph.prototype.createHandlers=function(){this.tooltipHandler=this.createTooltipHandler(),this.tooltipHandler.setEnabled(!1),this.selectionCellsHandler=this.createSelectionCellsHandler(),this.connectionHandler=this.createConnectionHandler(),this.connectionHandler.setEnabled(!1),this.graphHandler=this.createGraphHandler(),this.panningHandler=this.createPanningHandler(),this.panningHandler.panningEnabled=!1,this.popupMenuHandler=this.createPopupMenuHandler()},mxGraph.prototype.createTooltipHandler=function(){return new mxTooltipHandler(this)},mxGraph.prototype.createSelectionCellsHandler=function(){return new mxSelectionCellsHandler(this)},mxGraph.prototype.createConnectionHandler=function(){return new mxConnectionHandler(this)},mxGraph.prototype.createGraphHandler=function(){return new mxGraphHandler(this)},mxGraph.prototype.createPanningHandler=function(){return new mxPanningHandler(this)},mxGraph.prototype.createPopupMenuHandler=function(){return new mxPopupMenuHandler(this)},mxGraph.prototype.createSelectionModel=function(){return new mxGraphSelectionModel(this)},mxGraph.prototype.createStylesheet=function(){return new mxStylesheet},mxGraph.prototype.createGraphView=function(){return new mxGraphView(this)},mxGraph.prototype.createCellRenderer=function(){return new mxCellRenderer},mxGraph.prototype.createCellEditor=function(){return new mxCellEditor(this)},mxGraph.prototype.getModel=function(){return this.model},mxGraph.prototype.getView=function(){return this.view},mxGraph.prototype.getStylesheet=function(){return this.stylesheet},mxGraph.prototype.setStylesheet=function(t){this.stylesheet=t},mxGraph.prototype.getSelectionModel=function(){return this.selectionModel},mxGraph.prototype.setSelectionModel=function(t){this.selectionModel=t},mxGraph.prototype.getSelectionCellsForChanges=function(t,e){for(var n=new mxDictionary,i=[],s=mxUtils.bind(this,(function(t){if(!n.get(t)&&this.model.contains(t))if(this.model.isEdge(t)||this.model.isVertex(t))n.put(t,!0),i.push(t);else for(var e=this.model.getChildCount(t),r=0;r=0){t.overlays.splice(n,1),0==t.overlays.length&&(t.overlays=null);var i=this.view.getState(t);null!=i&&this.cellRenderer.redraw(i),this.fireEvent(new mxEventObject(mxEvent.REMOVE_OVERLAY,"cell",t,"overlay",e))}else e=null}return e},mxGraph.prototype.removeCellOverlays=function(t){var e=t.overlays;if(null!=e){t.overlays=null;var n=this.view.getState(t);null!=n&&this.cellRenderer.redraw(n);for(var i=0;i0){var s=new mxCellOverlay(n=null!=n?n:this.warningImage,""+e+"");return i&&s.addListener(mxEvent.CLICK,mxUtils.bind(this,(function(e,n){this.isEnabled()&&this.setSelectionCell(t)}))),this.addCellOverlay(t,s)}return this.removeCellOverlays(t),null},mxGraph.prototype.startEditing=function(t){this.startEditingAtCell(null,t)},mxGraph.prototype.startEditingAtCell=function(t,e){null!=e&&mxEvent.isMultiTouchEvent(e)||(null==t&&(null==(t=this.getSelectionCell())||this.isCellEditable(t)||(t=null)),null!=t&&(this.fireEvent(new mxEventObject(mxEvent.START_EDITING,"cell",t,"event",e)),this.cellEditor.startEditing(t,e),this.fireEvent(new mxEventObject(mxEvent.EDITING_STARTED,"cell",t,"event",e))))},mxGraph.prototype.getEditingValue=function(t,e){return this.convertValueToString(t)},mxGraph.prototype.stopEditing=function(t){this.cellEditor.stopEditing(t),this.fireEvent(new mxEventObject(mxEvent.EDITING_STOPPED,"cancel",t))},mxGraph.prototype.labelChanged=function(t,e,n){this.model.beginUpdate();try{var i=t.value;this.cellLabelChanged(t,e,this.isAutoSizeCell(t)),this.fireEvent(new mxEventObject(mxEvent.LABEL_CHANGED,"cell",t,"value",e,"old",i,"event",n))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellLabelChanged=function(t,e,n){this.model.beginUpdate();try{this.model.setValue(t,e),n&&this.cellSizeUpdated(t,!1)}finally{this.model.endUpdate()}},mxGraph.prototype.escape=function(t){this.fireEvent(new mxEventObject(mxEvent.ESCAPE,"event",t))},mxGraph.prototype.click=function(t){var e=t.getEvent(),n=t.getCell(),i=new mxEventObject(mxEvent.CLICK,"event",e,"cell",n);if(t.isConsumed()&&i.consume(),this.fireEvent(i),this.isEnabled()&&!mxEvent.isConsumed(e)&&!i.isConsumed()){if(null!=n){if(this.isTransparentClickEvent(e)){var s=!1,r=this.getCellAt(t.graphX,t.graphY,null,null,null,mxUtils.bind(this,(function(t){var e=this.isCellSelected(t.cell);return!(s=s||e)||e||t.cell!=n&&this.model.isAncestor(t.cell,n)})));null!=r&&(n=r)}}else if(this.isSwimlaneSelectionEnabled()&&!(null==(n=this.getSwimlaneAt(t.getGraphX(),t.getGraphY()))||this.isToggleEvent(e)&&mxEvent.isAltDown(e))){for(var o=n,l=[];null!=o;){o=this.model.getParent(o);var a=this.view.getState(o);this.isSwimlane(o)&&null!=a&&l.push(o)}if(l.length>0){(l=l.reverse()).splice(0,0,n),l.push(n);for(var h=0;h=s.scrollLeft&&e>=s.scrollTop&&t<=s.scrollLeft+s.clientWidth&&e<=s.scrollTop+s.clientHeight){var r=s.scrollLeft+s.clientWidth-t;if(r0&&u.height>0){e&&null!=u.x&&null!=u.y&&((u=u.clone()).width+=u.x,u.height+=u.y,u.x=0,u.y=0);var d=this.view.scale,p=u.width/d,m=u.height/d;null!=this.backgroundImage&&(p=Math.max(p,this.backgroundImage.width-u.x/d),m=Math.max(m,this.backgroundImage.height-u.y/d));var c=(e?t:2*t)+n+1;a-=c,h-=c;var g=s?h/m:r?a/p:Math.min(a/p,h/m);if(null!=this.minFitScale&&(g=Math.max(g,this.minFitScale)),null!=this.maxFitScale&&(g=Math.min(g,this.maxFitScale)),!i)return g;if(e)this.view.scale!=g&&this.view.setScale(g);else if(mxUtils.hasScrollbars(this.container)){this.view.setScale(g);var x=this.getGraphBounds();null!=x.x&&(this.container.scrollLeft=x.x),null!=x.y&&(this.container.scrollTop=x.y)}else{var y=null!=u.x?Math.floor(this.view.translate.x-u.x/d+t/g+n/2):t,f=null!=u.y?Math.floor(this.view.translate.y-u.y/d+t/g+n/2):t;this.view.scaleAndTranslate(g,y,f)}}}return this.view.scale},mxGraph.prototype.sizeDidChange=function(){var t=this.getGraphBounds();if(null!=this.container){var e=this.getBorder(),n=Math.max(0,t.x)+t.width+2*e,i=Math.max(0,t.y)+t.height+2*e;if(null!=this.minimumContainerSize&&(n=Math.max(n,this.minimumContainerSize.width),i=Math.max(i,this.minimumContainerSize.height)),this.resizeContainer&&this.doResizeContainer(n,i),this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var s=this.getPreferredPageSize(t,Math.max(1,n),Math.max(1,i));null!=s&&(n=s.width*this.view.scale,i=s.height*this.view.scale)}if(null!=this.minimumGraphSize&&(n=Math.max(n,this.minimumGraphSize.width*this.view.scale),i=Math.max(i,this.minimumGraphSize.height*this.view.scale)),n=Math.ceil(n),i=Math.ceil(i),this.dialect==mxConstants.DIALECT_SVG){var r=this.view.getDrawPane().ownerSVGElement;null!=r&&(r.style.minWidth=Math.max(1,n)+"px",r.style.minHeight=Math.max(1,i)+"px",r.style.width="100%",r.style.height="100%")}else mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,n),Math.max(1,i)):(this.view.canvas.style.minWidth=Math.max(1,n)+"px",this.view.canvas.style.minHeight=Math.max(1,i)+"px");this.updatePageBreaks(this.pageBreaksVisible,n,i)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",t))},mxGraph.prototype.doResizeContainer=function(t,e){null!=this.maximumContainerSize&&(t=Math.min(this.maximumContainerSize.width,t),e=Math.min(this.maximumContainerSize.height,e)),this.container.style.width=Math.ceil(t)+"px",this.container.style.height=Math.ceil(e)+"px"},mxGraph.prototype.updatePageBreaks=function(t,e,n){var i=this.view.scale,s=this.view.translate,r=this.pageFormat,o=i*this.pageScale,l=new mxRectangle(0,0,r.width*o,r.height*o),a=mxRectangle.fromRectangle(this.getGraphBounds());a.width=Math.max(1,a.width),a.height=Math.max(1,a.height),l.x=Math.floor((a.x-s.x*i)/l.width)*l.width+s.x*i,l.y=Math.floor((a.y-s.y*i)/l.height)*l.height+s.y*i,a.width=Math.ceil((a.width+(a.x-l.x))/l.width)*l.width,a.height=Math.ceil((a.height+(a.y-l.y))/l.height)*l.height;var h=(t=t&&Math.min(l.width,l.height)>this.minPageBreakDist)?Math.ceil(a.height/l.height)+1:0,u=t?Math.ceil(a.width/l.width)+1:0,d=(u-1)*l.width,p=(h-1)*l.height;null==this.horizontalPageBreaks&&h>0&&(this.horizontalPageBreaks=[]),null==this.verticalPageBreaks&&u>0&&(this.verticalPageBreaks=[]);var m=mxUtils.bind(this,(function(t){if(null!=t){for(var e=t==this.horizontalPageBreaks?h:u,n=0;n<=e;n++){var i=t==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+n*l.height)),new mxPoint(Math.round(l.x+d),Math.round(l.y+n*l.height))]:[new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y)),new mxPoint(Math.round(l.x+n*l.width),Math.round(l.y+p))];if(null!=t[n])t[n].points=i,t[n].redraw();else{var s=new mxPolyline(i,this.pageBreakColor);s.dialect=this.dialect,s.pointerEvents=!1,s.isDashed=this.pageBreakDashed,s.init(this.view.backgroundPane),s.redraw(),t[n]=s}}for(n=e;n0&&";base64,"!=n.substring(i-7,i+1)&&(n=n.substring(0,i)+";base64,"+n.substring(i+1))}t[mxConstants.STYLE_IMAGE]=n}}return t},mxGraph.prototype.setCellStyle=function(t,e){if(null!=(e=e||this.getSelectionCells())){this.model.beginUpdate();try{for(var n=0;n0){var s=this.getCurrentCellStyle(n[0]);i=mxUtils.getValue(s,t,e)?0:1,this.setCellStyles(t,i,n)}return i},mxGraph.prototype.setCellStyles=function(t,e,n){n=n||this.getSelectionCells(),mxUtils.setCellStyles(this.model,n,t,e)},mxGraph.prototype.toggleCellStyleFlags=function(t,e,n){this.setCellStyleFlags(t,e,null,n)},mxGraph.prototype.setCellStyleFlags=function(t,e,n,i){if(null!=(i=i||this.getSelectionCells())&&i.length>0){if(null==n){var s=this.getCurrentCellStyle(i[0]);n=!((parseInt(s[t]||0)&e)==e)}mxUtils.setCellStyleFlags(this.model,i,t,e,n)}},mxGraph.prototype.alignCells=function(t,e,n){if(null==e&&(e=this.getSelectionCells()),null!=e&&e.length>1){if(null==n)for(var i=0;i1&&null!=i){var s=this.model.getParent(t);null==s&&(s=this.model.getParent(n[0])),this.model.beginUpdate();try{null==this.getCellGeometry(t)&&this.model.setGeometry(t,new mxGeometry);var r=this.model.getChildCount(s);this.cellsAdded([t],s,r,null,null,!1,!1,!1),r=this.model.getChildCount(t),this.cellsAdded(n,t,r,null,null,!1,!1,!1),this.cellsMoved(n,-i.x,-i.y,!1,!1,!1),this.cellsResized([t],[i],!1),this.fireEvent(new mxEventObject(mxEvent.GROUP_CELLS,"group",t,"border",e,"cells",n))}finally{this.model.endUpdate()}}return t},mxGraph.prototype.getCellsForGroup=function(t){var e=[];if(null!=t&&t.length>0){var n=this.model.getParent(t[0]);e.push(t[0]);for(var i=1;i0){this.model.beginUpdate();try{for(var n=0;n0){i=i.slice();var s=this.model.getParent(t[n]),r=this.model.getChildCount(s);this.cellsAdded(i,s,r,null,null,!0),e=e.concat(i);for(var o=0;o0&&e.push(t[n]);return e},mxGraph.prototype.removeCellsAfterUngroup=function(t){this.cellsRemoved(this.addAllEdges(t))},mxGraph.prototype.removeCellsFromParent=function(t){null==t&&(t=this.getSelectionCells()),this.model.beginUpdate();try{var e=this.getDefaultParent(),n=this.model.getChildCount(e);this.cellsAdded(t,e,n,null,null,!0),this.fireEvent(new mxEventObject(mxEvent.REMOVE_CELLS_FROM_PARENT,"cells",t))}finally{this.model.endUpdate()}return t},mxGraph.prototype.updateGroupBounds=function(t,e,n,i,s,r,o){null==t&&(t=this.getSelectionCells()),e=null!=e?e:0,n=null!=n&&n,i=null!=i?i:0,s=null!=s?s:0,r=null!=r?r:0,o=null!=o?o:0,this.model.beginUpdate();try{for(var l=t.length-1;l>=0;l--){var a=this.getCellGeometry(t[l]);if(null!=a){var h=this.getChildCells(t[l]);if(null!=h&&h.length>0){var u=this.getBoundingBoxFromGeometry(h,!0);if(null!=u&&u.width>0&&u.height>0){var d=this.isSwimlane(t[l])?this.getActualStartSize(t[l],!0):new mxRectangle;a=a.clone(),n&&(a.x=Math.round(a.x+u.x-e-d.x-o),a.y=Math.round(a.y+u.y-e-d.y-i)),a.width=Math.round(u.width+2*e+d.x+o+s+d.width),a.height=Math.round(u.height+2*e+d.y+i+r+d.height),this.model.setGeometry(t[l],a),this.moveCells(h,e+d.x-u.x+o,e+d.y-u.y+i)}}}}}finally{this.model.endUpdate()}return t},mxGraph.prototype.getBoundingBox=function(t){var e=null;if(null!=t&&t.length>0)for(var n=0;n0){var a=this.view.scale,h=this.view.translate;s=this.model.cloneCells(t,!0,n);for(l=0;lthis.model.getChildCount(e)&&n--,this.model.add(e,t[d],n+d),this.autoSizeCellsOnAdd&&this.autoSizeCell(t[d],!0),(null==l||l)&&this.isExtendParentsOnAdd(t[d])&&this.isExtendParent(t[d])&&this.extendParent(t[d]),(null==o||o)&&this.constrainChild(t[d]),null!=i&&this.cellConnected(t[d],i,!0),null!=s&&this.cellConnected(t[d],s,!1)}this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",t,"parent",e,"index",n,"source",i,"target",s,"absolute",r))}finally{this.model.endUpdate()}}},mxGraph.prototype.autoSizeCell=function(t,e){if(e=null==e||e)for(var n=this.model.getChildCount(t),i=0;i0){var e=this.view.scale,n=this.view.translate;this.model.beginUpdate();try{for(var i=new mxDictionary,s=0;s0){this.model.beginUpdate();try{for(var n=0;n0){this.model.beginUpdate();try{for(var s=0;s0&&(s.height=Math.max(s.height,o))}}e.alternateBounds=new mxRectangle(0,0,s.width,s.height)}if(null!=e.alternateBounds){e.alternateBounds.x=e.x,e.alternateBounds.y=e.y;var l=mxUtils.toRadians(i[mxConstants.STYLE_ROTATION]||0);if(0!=l){var a=e.alternateBounds.getCenterX()-e.getCenterX(),h=e.alternateBounds.getCenterY()-e.getCenterY(),u=Math.cos(l),d=Math.sin(l),p=u*a-d*h,m=d*a+u*h;e.alternateBounds.x+=p-a,e.alternateBounds.y+=m-h}}}},mxGraph.prototype.addAllEdges=function(t){var e=t.slice();return mxUtils.removeDuplicates(e.concat(this.getAllEdges(t)))},mxGraph.prototype.getAllEdges=function(t){var e=[];if(null!=t)for(var n=0;n0){this.isHtmlLabel(i.cell)||(h=mxUtils.htmlEntities(h,!1)),h=h.replace(/\n/g,"
");var u=mxUtils.getSizeForString(h,r,s[mxConstants.STYLE_FONTFAMILY],e,s[mxConstants.STYLE_FONTSTYLE]),d=u.width+o,p=u.height+l;if(!mxUtils.getValue(s,mxConstants.STYLE_HORIZONTAL,!0)){var m=p;p=d,d=m}this.gridEnabled&&(d=this.snap(d+this.gridSize/2),p=this.snap(p+this.gridSize/2)),n=new mxRectangle(0,0,d,p)}else{var c=4*this.gridSize;n=new mxRectangle(0,0,c,c)}}}return n},mxGraph.prototype.resizeCell=function(t,e,n){return this.resizeCells([t],[e],n)[0]},mxGraph.prototype.resizeCells=function(t,e,n){n=null!=n?n:this.isRecursiveResize(),this.model.beginUpdate();try{var i=this.cellsResized(t,e,n);this.fireEvent(new mxEventObject(mxEvent.RESIZE_CELLS,"cells",t,"bounds",e,"previous",i))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellsResized=function(t,e,n){n=null!=n&&n;var i=[];if(null!=t&&null!=e&&t.length==e.length){this.model.beginUpdate();try{for(var s=0;s0&&((o=mxRectangle.fromRectangle(o)).x-=o.width*l,o.y-=o.height*l,o.width+=2*o.width*l,o.height+=2*o.height*l),null==s?s=o:(s=mxRectangle.fromRectangle(s)).intersect(o)}}if(null!=s){var a=[t];if(!this.isCellCollapsed(t))for(var h=this.model.getDescendants(t),u=0;us.width&&(p=n.width-s.width,n.width-=p),d.x+d.width>s.x+s.width&&(p-=d.x+d.width-s.x-s.width-p);var m=0;n.height>s.height&&(m=n.height-s.height,n.height-=m),d.y+d.height>s.y+s.height&&(m-=d.y+d.height-s.y-s.height-m),d.x0&&((e=e.clone()).points=[],this.model.setGeometry(t,e)),t},mxGraph.prototype.getOutlineConstraint=function(t,e,n){if(null!=e.shape){var i=this.view.getPerimeterBounds(e),s=e.style[mxConstants.STYLE_DIRECTION];if(s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){i.x+=i.width/2-i.height/2,i.y+=i.height/2-i.width/2;var r=i.width;i.width=i.height,i.height=r}var o=mxUtils.toRadians(e.shape.getShapeRotation());if(0!=o){var l=Math.cos(-o),a=Math.sin(-o),h=new mxPoint(i.getCenterX(),i.getCenterY());t=mxUtils.getRotatedPoint(t,l,a,h)}var u=1,d=1,p=0,m=0;if(this.getModel().isVertex(e.cell)){var c=e.style[mxConstants.STYLE_FLIPH],g=e.style[mxConstants.STYLE_FLIPV];if(null!=e.shape&&null!=e.shape.stencil&&(c=1==mxUtils.getValue(e.style,"stencilFlipH",0)||c,g=1==mxUtils.getValue(e.style,"stencilFlipV",0)||g),s==mxConstants.DIRECTION_NORTH||s==mxConstants.DIRECTION_SOUTH){r=c;c=g,g=r}c&&(u=-1,p=-i.width),g&&(d=-1,m=-i.height)}return t=new mxPoint((t.x-i.x)*u-p+i.x,(t.y-i.y)*d-m+i.y),new mxConnectionConstraint(new mxPoint(0==i.width?0:Math.round(1e3*(t.x-i.x)/i.width)/1e3,0==i.height?0:Math.round(1e3*(t.y-i.y)/i.height)/1e3),!1)}return null},mxGraph.prototype.getAllConnectionConstraints=function(t,e){return null!=t&&null!=t.shape&&null!=t.shape.stencil?t.shape.stencil.constraints:null},mxGraph.prototype.getConnectionConstraint=function(t,e,n){var i=null,s=t.style[n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X];if(null!=s){var r=t.style[n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y];null!=r&&(i=new mxPoint(parseFloat(s),parseFloat(r)))}var o=!1,l=0,a=0;return null!=i&&(o=mxUtils.getValue(t.style,n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,!0),l=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX]),a=parseFloat(t.style[n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY]),l=isFinite(l)?l:0,a=isFinite(a)?a:0),new mxConnectionConstraint(i,o,null,l,a)},mxGraph.prototype.setConnectionConstraint=function(t,e,n,i){if(null!=i){this.model.beginUpdate();try{null==i||null==i.point?(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,null,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t])):null!=i.point&&(this.setCellStyles(n?mxConstants.STYLE_EXIT_X:mxConstants.STYLE_ENTRY_X,i.point.x,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_Y:mxConstants.STYLE_ENTRY_Y,i.point.y,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DX:mxConstants.STYLE_ENTRY_DX,i.dx,[t]),this.setCellStyles(n?mxConstants.STYLE_EXIT_DY:mxConstants.STYLE_ENTRY_DY,i.dy,[t]),i.perimeter?this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,null,[t]):this.setCellStyles(n?mxConstants.STYLE_EXIT_PERIMETER:mxConstants.STYLE_ENTRY_PERIMETER,"0",[t]))}finally{this.model.endUpdate()}}},mxGraph.prototype.getConnectionPoint=function(t,e,n){n=null==n||n;var i=null;if(null!=t&&null!=e.point){var s=this.view.getPerimeterBounds(t),r=new mxPoint(s.getCenterX(),s.getCenterY()),o=t.style[mxConstants.STYLE_DIRECTION],l=0;null!=o&&1==mxUtils.getValue(t.style,mxConstants.STYLE_ANCHOR_POINT_DIRECTION,1)&&(o==mxConstants.DIRECTION_NORTH?l+=270:o==mxConstants.DIRECTION_WEST?l+=180:o==mxConstants.DIRECTION_SOUTH&&(l+=90),o!=mxConstants.DIRECTION_NORTH&&o!=mxConstants.DIRECTION_SOUTH||s.rotate90());var a=this.view.scale;i=new mxPoint(s.x+e.point.x*s.width+e.dx*a,s.y+e.point.y*s.height+e.dy*a);var h=t.style[mxConstants.STYLE_ROTATION]||0;if(e.perimeter){if(0!=l){var u=0,d=0;90==l?d=1:180==l?u=-1:270==l&&(d=-1),i=mxUtils.getRotatedPoint(i,u,d,r)}i=this.view.getPerimeterPoint(t,i,!1)}else if(h+=l,this.getModel().isVertex(t.cell)){var p=1==t.style[mxConstants.STYLE_FLIPH],m=1==t.style[mxConstants.STYLE_FLIPV];if(null!=t.shape&&null!=t.shape.stencil&&(p=1==mxUtils.getValue(t.style,"stencilFlipH",0)||p,m=1==mxUtils.getValue(t.style,"stencilFlipV",0)||m),o==mxConstants.DIRECTION_NORTH||o==mxConstants.DIRECTION_SOUTH){var c=p;p=m,m=c}p&&(i.x=2*s.getCenterX()-i.x),m&&(i.y=2*s.getCenterY()-i.y)}if(0!=h&&null!=i){var g=mxUtils.toRadians(h);u=Math.cos(g),d=Math.sin(g);i=mxUtils.getRotatedPoint(i,u,d,r)}}return n&&null!=i&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),i},mxGraph.prototype.connectCell=function(t,e,n,i){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);this.cellConnected(t,e,n,i),this.fireEvent(new mxEventObject(mxEvent.CONNECT_CELL,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}return t},mxGraph.prototype.cellConnected=function(t,e,n,i){if(null!=t){this.model.beginUpdate();try{var s=this.model.getTerminal(t,n);if(this.setConnectionConstraint(t,e,n,i),this.isPortsEnabled()){var r=null;this.isPort(e)&&(r=e.getId(),e=this.getTerminalForPort(e,n));var o=n?mxConstants.STYLE_SOURCE_PORT:mxConstants.STYLE_TARGET_PORT;this.setCellStyles(o,r,[t])}this.model.setTerminal(t,e,n),this.resetEdgesOnConnect&&this.resetEdge(t),this.fireEvent(new mxEventObject(mxEvent.CELL_CONNECTED,"edge",t,"terminal",e,"source",n,"previous",s))}finally{this.model.endUpdate()}}},mxGraph.prototype.disconnectGraph=function(t){if(null!=t){this.model.beginUpdate();try{for(var e=this.view.scale,n=this.view.translate,i=new mxDictionary,s=0;s0)for(var a=new mxRectangle(l[0].x,l[0].y,0,0),h=1;h=0&&(r.x+=a.x,r.y+=a.y))}else if(r=mxRectangle.fromRectangle(s),this.model.isVertex(u)&&mxUtils.indexOf(t,u)>=0)null!=(a=this.getBoundingBoxFromGeometry([u],!1))&&(r.x+=a.x,r.y+=a.y);null!=r&&null!=s.offset&&(r.x+=s.offset.x,r.y+=s.offset.y);var d=this.getCurrentCellStyle(t[i]);if(null!=r){var p=mxUtils.getValue(d,mxConstants.STYLE_ROTATION,0);0!=p&&(r=mxUtils.getBoundingBox(r,p))}}null!=r&&(null==n?n=mxRectangle.fromRectangle(r):n.add(r))}}return n},mxGraph.prototype.refresh=function(t){this.view.clear(t,null==t),this.view.validate(),this.sizeDidChange(),this.fireEvent(new mxEventObject(mxEvent.REFRESH))},mxGraph.prototype.snap=function(t){return this.gridEnabled&&(t=Math.round(t/this.gridSize)*this.gridSize),t},mxGraph.prototype.snapDelta=function(t,e,n,i,s){var r=this.view.translate,o=this.view.scale;if(!n&&this.gridEnabled){var l=this.gridSize*o*.5;if(!i){var a=e.x-(this.snap(e.x/o-r.x)+r.x)*o;Math.abs(t.x-a)o&&(d=0),c>l&&(p=0),this.view.setTranslate(Math.floor(d/2-a.x),Math.floor(p/2-a.y)),this.container.scrollLeft=(m-o)/2,this.container.scrollTop=(c-l)/2}else this.view.setTranslate(t?Math.floor(h.x-a.x*u+d*n/u):h.x,e?Math.floor(h.y-a.y*u+p*i/u):h.y)},mxGraph.prototype.zoom=function(t,e){e=null!=e?e:this.centerZoom;var n=Math.round(this.view.scale*t*100)/100,i=this.view.getState(this.getSelectionCell());if(t=n/this.view.scale,this.keepSelectionVisibleOnZoom&&null!=i){var s=new mxRectangle(i.x*t,i.y*t,i.width*t,i.height*t);this.view.scale=n,this.scrollRectToVisible(s)||(this.view.revalidate(),this.view.setScale(n))}else{var r=mxUtils.hasScrollbars(this.container);if(e&&!r){var o,l=this.container.offsetWidth,a=this.container.offsetHeight;if(t>1)l*=-(o=(t-1)/(2*n)),a*=-o;else l*=o=(1/t-1)/(2*this.view.scale),a*=o;this.view.scaleAndTranslate(n,this.view.translate.x+l,this.view.translate.y+a)}else{var h=this.view.translate.x,u=this.view.translate.y,d=this.container.scrollLeft,p=this.container.scrollTop;if(this.view.setScale(n),r){l=0,a=0;e&&(l=this.container.offsetWidth*(t-1)/2,a=this.container.offsetHeight*(t-1)/2),this.container.scrollLeft=(this.view.translate.x-h)*this.view.scale+Math.round(d*t+l),this.container.scrollTop=(this.view.translate.y-u)*this.view.scale+Math.round(p*t+a)}}}},mxGraph.prototype.zoomToRect=function(t){var e=this.container.clientWidth/t.width/(this.container.clientHeight/t.height);t.x=Math.max(0,t.x),t.y=Math.max(0,t.y);var n=Math.min(this.container.scrollWidth,t.x+t.width),i=Math.min(this.container.scrollHeight,t.y+t.height);if(t.width=n-t.x,t.height=i-t.y,e<1){var s=t.height/e,r=(s-t.height)/2;t.height=s;var o=Math.min(t.y,r);t.y=t.y-o,i=Math.min(this.container.scrollHeight,t.y+t.height),t.height=i-t.y}else{var l=t.width*e,a=(l-t.width)/2;t.width=l;var h=Math.min(t.x,a);t.x=t.x-h,n=Math.min(this.container.scrollWidth,t.x+t.width),t.width=n-t.x}var u=this.container.clientWidth/t.width,d=this.view.scale*u;mxUtils.hasScrollbars(this.container)?(this.view.setScale(d),this.container.scrollLeft=Math.round(t.x*u),this.container.scrollTop=Math.round(t.y*u)):this.view.scaleAndTranslate(d,this.view.translate.x-t.x/this.view.scale,this.view.translate.y-t.y/this.view.scale)},mxGraph.prototype.scrollCellToVisible=function(t,e){var n=-this.view.translate.x,i=-this.view.translate.y,s=this.view.getState(t);if(null!=s){var r=new mxRectangle(n+s.x,i+s.y,s.width,s.height);if(e&&null!=this.container){var o=this.container.clientWidth,l=this.container.clientHeight;r.x=r.getCenterX()-o/2,r.width=o,r.y=r.getCenterY()-l/2,r.height=l}var a=new mxPoint(this.view.translate.x,this.view.translate.y);if(this.scrollRectToVisible(r)){var h=new mxPoint(this.view.translate.x,this.view.translate.y);this.view.translate.x=a.x,this.view.translate.y=a.y,this.view.setTranslate(h.x,h.y)}}},mxGraph.prototype.scrollRectToVisible=function(t){var e=!1;if(null!=t){var n=this.container.offsetWidth,i=this.container.offsetHeight,s=Math.min(n,t.width),r=Math.min(i,t.height);if(mxUtils.hasScrollbars(this.container)){var o=this.container;t.x+=this.view.translate.x,t.y+=this.view.translate.y;var l=o.scrollLeft-t.x,a=Math.max(l-o.scrollLeft,0);l>0?o.scrollLeft-=l+2:(l=t.x+s-o.scrollLeft-o.clientWidth)>0&&(o.scrollLeft+=l+2);var h=o.scrollTop-t.y,u=Math.max(0,h-o.scrollTop);h>0?o.scrollTop-=h+2:(h=t.y+r-o.scrollTop-o.clientHeight)>0&&(o.scrollTop+=h+2),this.useScrollbarsForPanning||0==a&&0==u||this.view.setTranslate(a,u)}else{var d=-this.view.translate.x,p=-this.view.translate.y,m=this.view.scale;t.x+s>d+n&&(this.view.translate.x-=(t.x+s-n-d)/m,e=!0),t.y+r>p+i&&(this.view.translate.y-=(t.y+r-i-p)/m,e=!0),t.x1||1==s.length&&s[0]!=t)&&(i+=(mxResources.get(this.alreadyConnectedResource)||this.alreadyConnectedResource)+"\n")}var r=this.model.getDirectedEdgeCount(e,!0,t),o=this.model.getDirectedEdgeCount(n,!1,t);if(null!=this.multiplicities)for(var l=0;l0?i:null}return this.allowDanglingEdges?null:""},mxGraph.prototype.validateEdge=function(t,e,n){return null},mxGraph.prototype.validateGraph=function(t,e){t=null!=t?t:this.model.getRoot(),e=null!=e?e:new Object;for(var n=!0,i=this.model.getChildCount(t),s=0;s")):this.setCellWarning(r,null),n=n&&null==l}var a="";this.isCellCollapsed(t)&&!n&&(a+=(mxResources.get(this.containsValidationErrorsResource)||this.containsValidationErrorsResource)+"\n"),this.model.isEdge(t)?a+=this.getEdgeValidationError(t,this.model.getTerminal(t,!0),this.model.getTerminal(t,!1))||"":a+=this.getCellValidationError(t)||"";var h=this.validateCell(t,e);return null!=h&&(a+=h),null==this.model.getParent(t)&&this.view.validate(),a.length>0||!n?a:null},mxGraph.prototype.getCellValidationError=function(t){var e=this.model.getDirectedEdgeCount(t,!0),n=this.model.getDirectedEdgeCount(t,!1),i=this.model.getValue(t),s="";if(null!=this.multiplicities)for(var r=0;ro.max||eo.max||n0?s:null},mxGraph.prototype.validateCell=function(t,e){return null},mxGraph.prototype.getBackgroundImage=function(){return this.backgroundImage},mxGraph.prototype.setBackgroundImage=function(t){this.backgroundImage=t},mxGraph.prototype.getFoldingImage=function(t){if(null!=t&&this.foldingEnabled&&!this.getModel().isEdge(t.cell)){var e=this.isCellCollapsed(t.cell);if(this.isCellFoldable(t.cell,!e))return e?this.collapsedImage:this.expandedImage}return null},mxGraph.prototype.convertValueToString=function(t){var e=this.model.getValue(t);if(null!=e){if(mxUtils.isNode(e))return e.nodeName;if("function"==typeof e.toString)return e.toString()}return""},mxGraph.prototype.getLabel=function(t){var e="";if(this.labelsVisible&&null!=t){var n=this.getCurrentCellStyle(t);mxUtils.getValue(n,mxConstants.STYLE_NOLABEL,!1)||(e=this.convertValueToString(t))}return e},mxGraph.prototype.isHtmlLabel=function(t){return this.isHtmlLabels()},mxGraph.prototype.isHtmlLabels=function(){return this.htmlLabels},mxGraph.prototype.setHtmlLabels=function(t){this.htmlLabels=t},mxGraph.prototype.isWrapping=function(t){return"wrap"==this.getCurrentCellStyle(t)[mxConstants.STYLE_WHITE_SPACE]},mxGraph.prototype.isLabelClipped=function(t){return"hidden"==this.getCurrentCellStyle(t)[mxConstants.STYLE_OVERFLOW]},mxGraph.prototype.getTooltip=function(t,e,n,i){var s=null;if(null!=t){if(null==t.control||e!=t.control.node&&e.parentNode!=t.control.node||(s=this.collapseExpandResource,s=mxUtils.htmlEntities(mxResources.get(s)||s).replace(/\\n/g,"
")),null==s&&null!=t.overlays&&t.overlays.visit((function(t,n){null!=s||e!=n.node&&e.parentNode!=n.node||(s=n.overlay.toString())})),null==s){var r=this.selectionCellsHandler.getHandler(t.cell);null!=r&&"function"==typeof r.getTooltipForNode&&(s=r.getTooltipForNode(e))}null==s&&(s=this.getTooltipForCell(t.cell))}return s},mxGraph.prototype.getTooltipForCell=function(t){return null!=t&&null!=t.getTooltip?t.getTooltip():this.convertValueToString(t)},mxGraph.prototype.getLinkForCell=function(t){return null},mxGraph.prototype.getCursorForMouseEvent=function(t){return this.getCursorForCell(t.getCell())},mxGraph.prototype.getCursorForCell=function(t){return null},mxGraph.prototype.getStartSize=function(t,e){var n=new mxRectangle,i=this.getCurrentCellStyle(t,e),s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return mxUtils.getValue(i,mxConstants.STYLE_HORIZONTAL,!0)?n.height=s:n.width=s,n},mxGraph.prototype.getSwimlaneDirection=function(t){var e=mxUtils.getValue(t,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST),n=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPH,0),i=1==mxUtils.getValue(t,mxConstants.STYLE_FLIPV,0),s=mxUtils.getValue(t,mxConstants.STYLE_HORIZONTAL,!0)?0:3;e==mxConstants.DIRECTION_NORTH?s--:e==mxConstants.DIRECTION_WEST?s+=2:e==mxConstants.DIRECTION_SOUTH&&(s+=1);var r=mxUtils.mod(s,2);return n&&1==r&&(s+=2),i&&0==r&&(s+=2),[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST][mxUtils.mod(s,4)]},mxGraph.prototype.getActualStartSize=function(t,e){var n=new mxRectangle;if(this.isSwimlane(t,e)){var i=this.getCurrentCellStyle(t,e),s=parseInt(mxUtils.getValue(i,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE)),r=this.getSwimlaneDirection(i);r==mxConstants.DIRECTION_NORTH?n.y=s:r==mxConstants.DIRECTION_WEST?n.x=s:r==mxConstants.DIRECTION_SOUTH?n.height=s:n.width=s}return n},mxGraph.prototype.getImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_IMAGE]:null},mxGraph.prototype.isTransparentState=function(t){var e=!1;if(null!=t){var n=mxUtils.getValue(t.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),i=mxUtils.getValue(t.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);e=n==mxConstants.NONE&&i==mxConstants.NONE&&null==this.getImage(t)}return e},mxGraph.prototype.getVerticalAlign=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_VERTICAL_ALIGN]||mxConstants.ALIGN_MIDDLE:null},mxGraph.prototype.getIndicatorColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_COLOR]:null},mxGraph.prototype.getIndicatorGradientColor=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_GRADIENTCOLOR]:null},mxGraph.prototype.getIndicatorShape=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_SHAPE]:null},mxGraph.prototype.getIndicatorImage=function(t){return null!=t&&null!=t.style?t.style[mxConstants.STYLE_INDICATOR_IMAGE]:null},mxGraph.prototype.getBorder=function(){return this.border},mxGraph.prototype.setBorder=function(t){this.border=t},mxGraph.prototype.isSwimlane=function(t,e){return null!=t&&this.model.getParent(t)!=this.model.getRoot()&&!this.model.isEdge(t)&&this.getCurrentCellStyle(t,e)[mxConstants.STYLE_SHAPE]==mxConstants.SHAPE_SWIMLANE},mxGraph.prototype.isResizeContainer=function(){return this.resizeContainer},mxGraph.prototype.setResizeContainer=function(t){this.resizeContainer=t},mxGraph.prototype.isEnabled=function(){return this.enabled},mxGraph.prototype.setEnabled=function(t){this.enabled=t},mxGraph.prototype.isEscapeEnabled=function(){return this.escapeEnabled},mxGraph.prototype.setEscapeEnabled=function(t){this.escapeEnabled=t},mxGraph.prototype.isInvokesStopCellEditing=function(){return this.invokesStopCellEditing},mxGraph.prototype.setInvokesStopCellEditing=function(t){this.invokesStopCellEditing=t},mxGraph.prototype.isEnterStopsCellEditing=function(){return this.enterStopsCellEditing},mxGraph.prototype.setEnterStopsCellEditing=function(t){this.enterStopsCellEditing=t},mxGraph.prototype.isCellLocked=function(t){var e=this.model.getGeometry(t);return this.isCellsLocked()||null!=e&&this.model.isVertex(t)&&e.relative},mxGraph.prototype.isCellsLocked=function(){return this.cellsLocked},mxGraph.prototype.setCellsLocked=function(t){this.cellsLocked=t},mxGraph.prototype.getCloneableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellCloneable(t)})))},mxGraph.prototype.isCellCloneable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsCloneable()&&0!=e[mxConstants.STYLE_CLONEABLE]},mxGraph.prototype.isCellsCloneable=function(){return this.cellsCloneable},mxGraph.prototype.setCellsCloneable=function(t){this.cellsCloneable=t},mxGraph.prototype.getExportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canExportCell(t)})))},mxGraph.prototype.canExportCell=function(t){return this.exportEnabled},mxGraph.prototype.getImportableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.canImportCell(t)})))},mxGraph.prototype.canImportCell=function(t){return this.importEnabled},mxGraph.prototype.isCellSelectable=function(t){return this.isCellsSelectable()},mxGraph.prototype.isCellsSelectable=function(){return this.cellsSelectable},mxGraph.prototype.setCellsSelectable=function(t){this.cellsSelectable=t},mxGraph.prototype.getDeletableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellDeletable(t)})))},mxGraph.prototype.isCellDeletable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsDeletable()&&0!=e[mxConstants.STYLE_DELETABLE]},mxGraph.prototype.isCellsDeletable=function(){return this.cellsDeletable},mxGraph.prototype.setCellsDeletable=function(t){this.cellsDeletable=t},mxGraph.prototype.isLabelMovable=function(t){return!this.isCellLocked(t)&&(this.model.isEdge(t)&&this.edgeLabelsMovable||this.model.isVertex(t)&&this.vertexLabelsMovable)},mxGraph.prototype.isCellRotatable=function(t){return 0!=this.getCurrentCellStyle(t)[mxConstants.STYLE_ROTATABLE]},mxGraph.prototype.getMovableCells=function(t){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellMovable(t)})))},mxGraph.prototype.isCellMovable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsMovable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_MOVABLE]},mxGraph.prototype.isCellsMovable=function(){return this.cellsMovable},mxGraph.prototype.setCellsMovable=function(t){this.cellsMovable=t},mxGraph.prototype.isGridEnabled=function(){return this.gridEnabled},mxGraph.prototype.setGridEnabled=function(t){this.gridEnabled=t},mxGraph.prototype.isPortsEnabled=function(){return this.portsEnabled},mxGraph.prototype.setPortsEnabled=function(t){this.portsEnabled=t},mxGraph.prototype.getGridSize=function(){return this.gridSize},mxGraph.prototype.setGridSize=function(t){this.gridSize=t},mxGraph.prototype.getTolerance=function(){return this.tolerance},mxGraph.prototype.setTolerance=function(t){this.tolerance=t},mxGraph.prototype.isVertexLabelsMovable=function(){return this.vertexLabelsMovable},mxGraph.prototype.setVertexLabelsMovable=function(t){this.vertexLabelsMovable=t},mxGraph.prototype.isEdgeLabelsMovable=function(){return this.edgeLabelsMovable},mxGraph.prototype.setEdgeLabelsMovable=function(t){this.edgeLabelsMovable=t},mxGraph.prototype.isSwimlaneNesting=function(){return this.swimlaneNesting},mxGraph.prototype.setSwimlaneNesting=function(t){this.swimlaneNesting=t},mxGraph.prototype.isSwimlaneSelectionEnabled=function(){return this.swimlaneSelectionEnabled},mxGraph.prototype.setSwimlaneSelectionEnabled=function(t){this.swimlaneSelectionEnabled=t},mxGraph.prototype.isMultigraph=function(){return this.multigraph},mxGraph.prototype.setMultigraph=function(t){this.multigraph=t},mxGraph.prototype.isAllowLoops=function(){return this.allowLoops},mxGraph.prototype.setAllowDanglingEdges=function(t){this.allowDanglingEdges=t},mxGraph.prototype.isAllowDanglingEdges=function(){return this.allowDanglingEdges},mxGraph.prototype.setConnectableEdges=function(t){this.connectableEdges=t},mxGraph.prototype.isConnectableEdges=function(){return this.connectableEdges},mxGraph.prototype.setCloneInvalidEdges=function(t){this.cloneInvalidEdges=t},mxGraph.prototype.isCloneInvalidEdges=function(){return this.cloneInvalidEdges},mxGraph.prototype.setAllowLoops=function(t){this.allowLoops=t},mxGraph.prototype.isDisconnectOnMove=function(){return this.disconnectOnMove},mxGraph.prototype.setDisconnectOnMove=function(t){this.disconnectOnMove=t},mxGraph.prototype.isDropEnabled=function(){return this.dropEnabled},mxGraph.prototype.setDropEnabled=function(t){this.dropEnabled=t},mxGraph.prototype.isSplitEnabled=function(){return this.splitEnabled},mxGraph.prototype.setSplitEnabled=function(t){this.splitEnabled=t},mxGraph.prototype.isCellResizable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsResizable()&&!this.isCellLocked(t)&&"0"!=mxUtils.getValue(e,mxConstants.STYLE_RESIZABLE,"1")},mxGraph.prototype.isCellsResizable=function(){return this.cellsResizable},mxGraph.prototype.setCellsResizable=function(t){this.cellsResizable=t},mxGraph.prototype.isTerminalPointMovable=function(t,e){return!0},mxGraph.prototype.isCellBendable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsBendable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_BENDABLE]},mxGraph.prototype.isCellsBendable=function(){return this.cellsBendable},mxGraph.prototype.setCellsBendable=function(t){this.cellsBendable=t},mxGraph.prototype.isCellEditable=function(t){var e=this.getCurrentCellStyle(t);return this.isCellsEditable()&&!this.isCellLocked(t)&&0!=e[mxConstants.STYLE_EDITABLE]},mxGraph.prototype.isCellsEditable=function(){return this.cellsEditable},mxGraph.prototype.setCellsEditable=function(t){this.cellsEditable=t},mxGraph.prototype.isCellDisconnectable=function(t,e,n){return this.isCellsDisconnectable()&&!this.isCellLocked(t)},mxGraph.prototype.isCellsDisconnectable=function(){return this.cellsDisconnectable},mxGraph.prototype.setCellsDisconnectable=function(t){this.cellsDisconnectable=t},mxGraph.prototype.isValidSource=function(t){return null==t&&this.allowDanglingEdges||null!=t&&(!this.model.isEdge(t)||this.connectableEdges)&&this.isCellConnectable(t)},mxGraph.prototype.isValidTarget=function(t){return this.isValidSource(t)},mxGraph.prototype.isValidConnection=function(t,e){return this.isValidSource(t)&&this.isValidTarget(e)},mxGraph.prototype.setConnectable=function(t){this.connectionHandler.setEnabled(t)},mxGraph.prototype.isConnectable=function(){return this.connectionHandler.isEnabled()},mxGraph.prototype.setTooltips=function(t){this.tooltipHandler.setEnabled(t)},mxGraph.prototype.setPanning=function(t){this.panningHandler.panningEnabled=t},mxGraph.prototype.isEditing=function(t){if(null!=this.cellEditor){var e=this.cellEditor.getEditingCell();return null==t?null!=e:t==e}return!1},mxGraph.prototype.isAutoSizeCell=function(t){var e=this.getCurrentCellStyle(t);return this.isAutoSizeCells()||1==e[mxConstants.STYLE_AUTOSIZE]},mxGraph.prototype.isAutoSizeCells=function(){return this.autoSizeCells},mxGraph.prototype.setAutoSizeCells=function(t){this.autoSizeCells=t},mxGraph.prototype.isExtendParent=function(t){return!this.getModel().isEdge(t)&&this.isExtendParents()},mxGraph.prototype.isExtendParents=function(){return this.extendParents},mxGraph.prototype.setExtendParents=function(t){this.extendParents=t},mxGraph.prototype.isExtendParentsOnAdd=function(t){return this.extendParentsOnAdd},mxGraph.prototype.setExtendParentsOnAdd=function(t){this.extendParentsOnAdd=t},mxGraph.prototype.isExtendParentsOnMove=function(){return this.extendParentsOnMove},mxGraph.prototype.setExtendParentsOnMove=function(t){this.extendParentsOnMove=t},mxGraph.prototype.isRecursiveResize=function(t){return this.recursiveResize},mxGraph.prototype.setRecursiveResize=function(t){this.recursiveResize=t},mxGraph.prototype.isConstrainChild=function(t){return this.isConstrainChildren()&&!this.getModel().isEdge(this.getModel().getParent(t))},mxGraph.prototype.isConstrainChildren=function(){return this.constrainChildren},mxGraph.prototype.setConstrainChildren=function(t){this.constrainChildren=t},mxGraph.prototype.isConstrainRelativeChildren=function(){return this.constrainRelativeChildren},mxGraph.prototype.setConstrainRelativeChildren=function(t){this.constrainRelativeChildren=t},mxGraph.prototype.isAllowNegativeCoordinates=function(){return this.allowNegativeCoordinates},mxGraph.prototype.setAllowNegativeCoordinates=function(t){this.allowNegativeCoordinates=t},mxGraph.prototype.getOverlap=function(t){return this.isAllowOverlapParent(t)?this.defaultOverlap:0},mxGraph.prototype.isAllowOverlapParent=function(t){return!1},mxGraph.prototype.getFoldableCells=function(t,e){return this.model.filterCells(t,mxUtils.bind(this,(function(t){return this.isCellFoldable(t,e)})))},mxGraph.prototype.isCellFoldable=function(t,e){var n=this.getCurrentCellStyle(t);return this.model.getChildCount(t)>0&&0!=n[mxConstants.STYLE_FOLDABLE]},mxGraph.prototype.isValidDropTarget=function(t,e,n){return null!=t&&(this.isSplitEnabled()&&this.isSplitTarget(t,e,n)||!this.model.isEdge(t)&&(this.isSwimlane(t)||this.model.getChildCount(t)>0&&!this.isCellCollapsed(t)))},mxGraph.prototype.isSplitTarget=function(t,e,n){if(this.model.isEdge(t)&&null!=e&&1==e.length&&this.isCellConnectable(e[0])&&null==this.getEdgeValidationError(t,this.model.getTerminal(t,!0),e[0])){var i=this.model.getTerminal(t,!0),s=this.model.getTerminal(t,!1);return!this.model.isAncestor(e[0],i)&&!this.model.isAncestor(e[0],s)}return!1},mxGraph.prototype.getDropTarget=function(t,e,n,i){if(!this.isSwimlaneNesting())for(var s=0;s=0;o--){var l=this.model.getChildAt(n,o),a=this.getCellAt(t,e,l,i,s,r);if(null!=a)return a;if(this.isCellVisible(l)&&(s&&this.model.isEdge(l)||i&&this.model.isVertex(l))){var h=this.view.getState(l);if(null!=h&&(null==r||!r(h,t,e))&&this.intersects(h,t,e))return l}}return null},mxGraph.prototype.intersects=function(t,e,n){if(null!=t){var i=t.absolutePoints;if(null!=i)for(var s=this.tolerance*this.tolerance,r=i[0],o=1;o0&&e>0&&e>s.width*r)return!0;if(s.height>0&&n>0&&n>s.height*r)return!0}return!1},mxGraph.prototype.getChildVertices=function(t){return this.getChildCells(t,!0,!1)},mxGraph.prototype.getChildEdges=function(t){return this.getChildCells(t,!1,!0)},mxGraph.prototype.getChildCells=function(t,e,n){t=null!=t?t:this.getDefaultParent(),e=null!=e&&e,n=null!=n&&n;for(var i=this.model.getChildCells(t,e,n),s=[],r=0;r0||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 isFlowKind(t){return Object.values(exports.FlowKind).map((t=>t)).includes(t)}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 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++;r0)||getErrorObject("InvalidXml","Invalid '"+JSON.stringify(n.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):getErrorObject("InvalidXml","Start tag expected.",1)};const doubleQuote='"',singleQuote="'";function readAttributeStr(t,e){let n="",i="",s=!1;for(;e"===t[e]&&""===i){s=!0;break}n+=t[e]}return""===i&&{value:n,index:e,tagClosed:s}}const validAttrStrRegxp=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function validateAttributeString(t,e){const n=util$2.getAllMatches(t,validAttrStrRegxp),i={};for(let t=0;t!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}},buildOptions$1=function(t){return Object.assign({},defaultOptions$1,t)};OptionsBuilder.buildOptions=buildOptions$1,OptionsBuilder.defaultOptions=defaultOptions$1;class XmlNode{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}var xmlNode$1=XmlNode;const util$1=util$3;function readDocType$1(t,e){const n={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let i=1,s=!1,r=!1,o="";for(;e"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,i--):i--,0===i)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&isEntity(t,e))e+=7,[entityName,val,e]=readEntityExp(t,e+1),-1===val.indexOf("&")&&(n[validateEntityName(entityName)]={regx:RegExp(`&${entityName};`,"g"),val});else if(s&&isElement(t,e))e+=8;else if(s&&isAttlist(t,e))e+=8;else if(s&&isNotation(t,e))e+=9;else{if(!isComment)throw new Error("Invalid DOCTYPE");r=!0}i++,o=""}if(0!==i)throw new Error("Unclosed DOCTYPE")}return{entities:n,i:e}}function readEntityExp(t,e){let n="";for(;e0&&s&&"."!==n[2])return t;if(!e.leadingZeros&&r.length>0&&!s&&"."!==n[1])return t;{const i=Number(n),a=""+i;return-1!==a.search(/[eE]/)||l?e.eNotation?i:t:-1!==n.indexOf(".")?"0"===a&&""===o||a===o||s&&a==="-"+o?i:t:r?o===a||s+o===a?i:t:n===a||n===s+a?i:t}}return t}}function trimZeros(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}var strnum=toNumber$1;const util=util$3,xmlNode=xmlNode$1,readDocType=DocTypeReader,toNumber=strnum;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,util.nameRegexp);let OrderedObjParser$1=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"}},this.addExternalEntities=addExternalEntities,this.parseXml=parseXml,this.parseTextData=parseTextData,this.resolveNameSpace=resolveNameSpace,this.buildAttributesMap=buildAttributesMap,this.isItStopNode=isItStopNode,this.replaceEntitiesValue=replaceEntitiesValue$1,this.readStopNodeData=readStopNodeData,this.saveTextToParentTag=saveTextToParentTag,this.addChild=addChild}};function addExternalEntities(t){const e=Object.keys(t);for(let n=0;n0)){o||(t=this.replaceEntitiesValue(t));const i=this.options.tagValueProcessor(e,t,n,s,r);if(null==i)return t;if(typeof i!=typeof t||i!==t)return i;if(this.options.trimValues)return parseValue(t,this.options.parseTagValue,this.options.numberParseOptions);return t.trim()===t?parseValue(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function resolveNameSpace(t){if(this.options.removeNSPrefix){const e=t.split(":"),n="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=n+e[1])}return t}const attrsRegx=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function buildAttributesMap(t,e,n){if(!this.options.ignoreAttributes&&"string"==typeof t){const n=util.getAllMatches(t,attrsRegx),i=n.length,s={};for(let t=0;t",r,"Closing Tag is not closed.");let o=t.substring(r+2,e).trim();if(this.options.removeNSPrefix){const t=o.indexOf(":");-1!==t&&(o=o.substr(t+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(i=this.saveTextToParentTag(i,n,s));const l=s.substring(s.lastIndexOf(".")+1);if(o&&-1!==this.options.unpairedTags.indexOf(o))throw new Error(`Unpaired tag can not be used as closing tag: `);let a=0;l&&-1!==this.options.unpairedTags.indexOf(l)?(a=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):a=s.lastIndexOf("."),s=s.substring(0,a),n=this.tagsNodeStack.pop(),i="",r=e}else if("?"===t[r+1]){let e=readTagExp(t,r,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,n,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new xmlNode(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s,e.tagName)),this.addChild(n,t,s)}r=e.closeIndex+1}else if("!--"===t.substr(r+1,3)){const e=findClosingIndex(t,"--\x3e",r+4,"Comment is not closed.");if(this.options.commentPropName){const o=t.substring(r+4,e-2);i=this.saveTextToParentTag(i,n,s),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}r=e}else if("!D"===t.substr(r+1,2)){const e=readDocType(t,r);this.docTypeEntities=e.entities,r=e.i}else if("!["===t.substr(r+1,2)){const e=findClosingIndex(t,"]]>",r,"CDATA is not closed.")-2,o=t.substring(r+9,e);if(i=this.saveTextToParentTag(i,n,s),this.options.cdataPropName)n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]);else{let t=this.parseTextData(o,n.tagname,s,!0,!1,!0);null==t&&(t=""),n.add(this.options.textNodeName,t)}r=e+2}else{let o=readTagExp(t,r,this.options.removeNSPrefix),l=o.tagName,a=o.tagExp,h=o.attrExpPresent,u=o.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),n&&i&&"!xml"!==n.tagname&&(i=this.saveTextToParentTag(i,n,s,!1));const d=n;if(d&&-1!==this.options.unpairedTags.indexOf(d.tagname)&&(n=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),l!==e.tagname&&(s+=s?"."+l:l),this.isItStopNode(this.options.stopNodes,s,l)){let e="";if(a.length>0&&a.lastIndexOf("/")===a.length-1)r=o.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))r=o.closeIndex;else{const n=this.readStopNodeData(t,l,u+1);if(!n)throw new Error(`Unexpected end of ${l}`);r=n.i,e=n.tagContent}const i=new xmlNode(l);l!==a&&h&&(i[":@"]=this.buildAttributesMap(a,s,l)),e&&(e=this.parseTextData(e,l,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),i.add(this.options.textNodeName,e),this.addChild(n,i,s)}else{if(a.length>0&&a.lastIndexOf("/")===a.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),s=s.substr(0,s.length-1),a=l):a=a.substr(0,a.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const t=new xmlNode(l);l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s,l)),this.addChild(n,t,s),s=s.substr(0,s.lastIndexOf("."))}else{const t=new xmlNode(l);this.tagsNodeStack.push(n),l!==a&&h&&(t[":@"]=this.buildAttributesMap(a,s,l)),this.addChild(n,t,s),n=t}i="",r=u}}else i+=t[r]}return e.child};function addChild(t,e,n){const i=this.options.updateTag(e.tagname,n,e[":@"]);!1===i||("string"==typeof i?(e.tagname=i,t.addChild(e)):t.addChild(e))}const replaceEntitiesValue$1=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function saveTextToParentTag(t,e,n,i){return t&&(void 0===i&&(i=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,n,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function isItStopNode(t,e,n){const i="*."+n;for(const n in t){const s=t[n];if(i===s||e===s)return!0}return!1}function tagExpWithClosingIndex(t,e,n=">"){let i,s="";for(let r=e;r",n,`${e} is not closed`);if(t.substring(n+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(i,n),i:r};n=r}else if("?"===t[n+1]){n=findClosingIndex(t,"?>",n+1,"StopNode is not closed.")}else if("!--"===t.substr(n+1,3)){n=findClosingIndex(t,"--\x3e",n+3,"StopNode is not closed.")}else if("!["===t.substr(n+1,2)){n=findClosingIndex(t,"]]>",n,"StopNode is not closed.")-2}else{const i=readTagExp(t,n,">");if(i){(i&&i.tagName)===e&&"/"!==i.tagExp[i.tagExp.length-1]&&s++,n=i.closeIndex}}}function parseValue(t,e,n){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&toNumber(t,n)}return util.isExist(t)?t:""}var OrderedObjParser_1=OrderedObjParser$1,node2json={};function prettify$1(t,e){return compress(t,e)}function compress(t,e,n){let i;const s={};for(let r=0;r0&&(s[e.textNodeName]=i):void 0!==i&&(s[e.textNodeName]=i),s}function propName$1(t){const e=Object.keys(t);for(let t=0;t0&&(n=EOL),arrToStr(t,e,"",n)}function arrToStr(t,e,n,i){let s="",r=!1;for(let o=0;o`,r=!1;continue}if(a===e.commentPropName){s+=i+`\x3c!--${l[a][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===a[0]){const t=attr_to_str(l[":@"],e),n="?xml"===a?"":i;let o=l[a][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=n+`<${a}${o}${t}?>`,r=!0;continue}let u=i;""!==u&&(u+=e.indentBy);const d=i+`<${a}${attr_to_str(l[":@"],e)}`,p=arrToStr(l[a],e,h,u);-1!==e.unpairedTags.indexOf(a)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=d+`>${p}${i}`:(s+=d+">",p&&""!==i&&(p.includes("/>")||p.includes("`):s+=d+"/>",r=!0}return s}function propName(t){const e=Object.keys(t);for(let t=0;t0&&e.processEntities)for(let n=0;n","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Builder(t){this.options=Object.assign({},defaultOptions,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=isAttribute),this.processTextOrObjNode=processTextOrObjNode,this.options.format?(this.indentate=indentate,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function processTextOrObjNode(t,e,n){const i=this.j2x(t,n+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}function indentate(t){return this.options.indentBy.repeat(t)}function isAttribute(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Builder.prototype.build=function(t){return this.options.preserveOrder?buildFromOrderedJs(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Builder.prototype.j2x=function(t,e){let n="",i="";for(let s in t)if(void 0===t[s])this.isAttribute(s)&&(i+="");else if(null===t[s])this.isAttribute(s)?i+="":"?"===s[0]?i+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)i+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){const r=this.isAttribute(s);if(r)n+=this.buildAttrPairStr(r,""+t[s]);else if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);i+=this.replaceEntitiesValue(e)}else i+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const n=t[s].length;let r="";for(let o=0;o"+t+s}},Builder.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+n+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(i)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+n+">"+s+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class BpmnXmlParser{constructor(t){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2jOptions",{enumerable:!0,configurable:!0,writable:!0,value:{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e)=>this.processAttribute(e)}}),Object.defineProperty(this,"xmlParser",{enumerable:!0,configurable:!0,writable:!0,value:new fxp.XMLParser(this.x2jOptions)})}parse(t){let e;try{e=this.xmlParser.parse(t)}catch(t){throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}processAttribute(t){var e;for(const e of entitiesReplacements)t=t.replace(e.regex,e.val);return(null===(e=this.options)||void 0===e?void 0:e.additionalXmlAttributeProcessor)&&(t=this.options.additionalXmlAttributeProcessor(t)),t}}class JsonParsingWarning{}class ParsingMessageCollector{warning(t){const e=t.getMessage();console.warn(`[bv-parser] ${e.template}`,...e.arguments)}}class GroupUnknownCategoryValueWarning extends JsonParsingWarning{constructor(t,e){super(),Object.defineProperty(this,"groupBpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"categoryValueRef",{enumerable:!0,configurable:!0,writable:!0,value:e})}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class ShapeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),Object.defineProperty(this,"bpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t})}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class EdgeUnknownBpmnElementWarning extends JsonParsingWarning{constructor(t){super(),Object.defineProperty(this,"bpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t})}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class LabelStyleMissingFontWarning extends JsonParsingWarning{constructor(t,e){super(),Object.defineProperty(this,"shapeOrEdgeId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"labelStyleId",{enumerable:!0,configurable:!0,writable:!0,value:e})}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class LaneUnknownFlowNodeRefWarning extends JsonParsingWarning{constructor(t,e){super(),Object.defineProperty(this,"laneId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowNodeRef",{enumerable:!0,configurable:!0,writable:!0,value:e})}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class BoundaryEventNotAttachedToActivityWarning extends JsonParsingWarning{constructor(t,e,n){super(),Object.defineProperty(this,"bpmnElementId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"attachedToRef",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"attachedToKind",{enumerable:!0,configurable:!0,writable:!0,value:n})}getMessage(){return{arguments:[this.bpmnElementId,this.attachedToRef,this.attachedToKind],template:"The boundary event %s must be attached to an activity, and not to %s of kind %s"}}}class ConvertedElements{constructor(){Object.defineProperty(this,"poolsById",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"poolsByProcessRef",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"messageFlows",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"flowNodes",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"lanes",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"sequenceFlows",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"associationFlows",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"eventDefinitionsOfDefinitions",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"globalTasks",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"categoryValues",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const buildShapeBpmnGroup=(t,e,n,i)=>{const s=t.findCategoryValue(n.categoryValueRef);if(s)return new ShapeBpmnElement(n.id,s.value,exports.ShapeBpmnElementKind.GROUP,i);e.warning(new GroupUnknownCategoryValueWarning(n.id,n.categoryValueRef))};class CollaborationConverter{constructor(t,e){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parsingMessageCollector",{enumerable:!0,configurable:!0,writable:!0,value:e})}deserialize(t){ensureIsArray(t).forEach((t=>this.parseCollaboration(t)))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerPool(new ShapeBpmnElement(t.id,t.name,exports.ShapeBpmnElementKind.POOL),t.processRef)))}buildMessageFlows(t){ensureIsArray(t).forEach((t=>this.convertedElements.registerMessageFlow(new MessageFlow(t.id,t.name,t.sourceRef,t.targetRef))))}buildGroups(t){ensureIsArray(t).forEach((t=>{const e=buildShapeBpmnGroup(this.convertedElements,this.parsingMessageCollector,t);e&&this.convertedElements.registerFlowNode(e)}))}}const computeSubProcessKind=(t,e)=>{switch(t){case"adHocSubProcess":return exports.ShapeBpmnSubProcessKind.AD_HOC;case"transaction":return exports.ShapeBpmnSubProcessKind.TRANSACTION;default:return e.triggeredByEvent?exports.ShapeBpmnSubProcessKind.EVENT:exports.ShapeBpmnSubProcessKind.EMBEDDED}},orderedFlowNodeBpmnTypes=["adHocSubProcess","transaction"].concat(ShapeUtil.flowNodeKinds().filter((t=>t!=exports.ShapeBpmnElementKind.EVENT_BOUNDARY))).concat([exports.ShapeBpmnElementKind.EVENT_BOUNDARY]);function getShapeBpmnElementKind(t){return["adHocSubProcess","transaction"].includes(t)?exports.ShapeBpmnElementKind.SUB_PROCESS:t}class ProcessConverter{constructor(t,e){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parsingMessageCollector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"defaultSequenceFlowIds",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"elementsWithoutParentByProcessId",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"callActivitiesCallingProcess",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}deserialize(t){ensureIsArray(t).forEach((t=>this.parseProcess(t))),ensureIsArray(t).forEach((t=>this.assignParentOfProcessElementsCalledByCallActivity(t.id))),this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const n=this.convertedElements.findPoolByProcessRef(t);n&&(n.parentId=e.id),this.elementsWithoutParentByProcessId.get(t).forEach((t=>{t.parentId=e.id}))}}assignIncomingAndOutgoingIdsFromFlows(){const t=(t,e,n)=>{var i,s;const r=null!==(s=null!==(i=this.convertedElements.findFlowNode(t))&&void 0!==i?i:this.convertedElements.findLane(t))&&void 0!==s?s:this.convertedElements.findPoolById(t);r&&!r[e].includes(n)&&r[e].push(n)};this.convertedElements.getFlows().forEach((e=>{t(e.sourceRefId,"outgoingIds",e.id),t(e.targetRefId,"incomingIds",e.id)}))}parseProcess(t){const e=t.id,n=this.convertedElements.findPoolByProcessRef(e);n&&!n.name&&this.convertedElements.registerPool(new ShapeBpmnElement(n.id,t.name,exports.ShapeBpmnElementKind.POOL),e),this.buildProcessInnerElements(t,null==n?void 0:n.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]),orderedFlowNodeBpmnTypes.forEach((n=>this.buildFlowNodeBpmnElements(t[n],getShapeBpmnElementKind(n),e,t.id,n))),this.buildLaneBpmnElements(t[exports.ShapeBpmnElementKind.LANE],e,t.id),this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),this.buildAssociationFlows(t.association)}buildFlowNodeBpmnElements(t,e,n,i,s){ensureIsArray(t).forEach((t=>{let r;if(ShapeUtil.isEvent(e))r=this.buildShapeBpmnEvent(t,e,n);else if(ShapeUtil.isActivity(e))r=this.buildShapeBpmnActivity(t,e,n,s);else if(e==exports.ShapeBpmnElementKind.GATEWAY_EVENT_BASED){const e=t;r=new ShapeBpmnEventBasedGateway(t.id,e.name,n,e.instantiate,exports.ShapeBpmnEventBasedGatewayKind[e.eventGatewayType])}else if(e==exports.ShapeBpmnElementKind.GROUP)r=buildShapeBpmnGroup(this.convertedElements,this.parsingMessageCollector,t,n);else{const i=e===exports.ShapeBpmnElementKind.TEXT_ANNOTATION?t.text:t.name;r=new ShapeBpmnElement(t.id,i,e,n,t.instantiate)}const o=t.default;ShapeUtil.isWithDefaultSequenceFlow(e)&&o&&this.defaultSequenceFlowIds.push(o),r&&(this.convertedElements.registerFlowNode(r),n||this.elementsWithoutParentByProcessId.get(i).push(r),r.incomingIds=ensureIsArray(t.incoming),r.outgoingIds=ensureIsArray(t.outgoing))}))}buildShapeBpmnActivity(t,e,n,i){const s=buildMarkers(t);return ShapeUtil.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,n,computeSubProcessKind(i,t),s):ShapeUtil.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,n,s):new ShapeBpmnActivity(t.id,t.name,e,n,t.instantiate,s)}buildShapeBpmnCallActivity(t,e,n){const i=this.convertedElements.findGlobalTask(t.calledElement);if(!i){const i=new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_PROCESS,e,n);return this.callActivitiesCallingProcess.set(t.calledElement,i),i}return new ShapeBpmnCallActivity(t.id,t.name,exports.ShapeBpmnCallActivityKind.CALLING_GLOBAL_TASK,e,n,i)}buildShapeBpmnEvent(t,e,n){const i=this.getEventDefinitions(t),s=i.map((t=>t.counter)).reduce(((t,e)=>t+e),0);if(0==s&&ShapeUtil.canHaveNoneEvent(e))return new ShapeBpmnEvent(t.id,t.name,e,exports.ShapeBpmnEventDefinitionKind.NONE,n);if(1==s){const s=i[0].kind;return ShapeUtil.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,s):ShapeUtil.isStartEvent(e)?new ShapeBpmnStartEvent(t.id,t.name,s,n,t.isInterrupting):new ShapeBpmnEvent(t.id,t.name,e,s,n)}}buildShapeBpmnBoundaryEvent(t,e){const n=this.convertedElements.findFlowNode(t.attachedToRef);if(ShapeUtil.isActivity(null==n?void 0:n.kind))return new ShapeBpmnBoundaryEvent(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new BoundaryEventNotAttachedToActivityWarning(t.id,t.attachedToRef,null==n?void 0:n.kind))}getEventDefinitions(t){const e=new Map;return eventDefinitionKinds.forEach((n=>{const i=ensureIsArray(t[n+"EventDefinition"],!0).length;e.set(n,i)})),ensureIsArray(t.eventDefinitionRef).forEach((t=>{const n=this.convertedElements.findEventDefinitionOfDefinition(t);e.set(n,e.get(n)+1)})),Array.from(e.keys()).map((t=>({kind:t,counter:e.get(t)}))).filter((t=>t.counter>0))}buildShapeBpmnSubProcess(t,e,n,i){const s=new ShapeBpmnSubProcess(t.id,t.name,n,e,i);return this.buildProcessInnerElements(t,t.id),s}buildLaneSetBpmnElements(t,e,n){ensureIsArray(t).forEach((t=>this.buildLaneBpmnElements(t.lane,e,n)))}buildLaneBpmnElements(t,e,n){ensureIsArray(t).forEach((t=>{var i;const s=new ShapeBpmnElement(t.id,t.name,exports.ShapeBpmnElementKind.LANE,e);this.convertedElements.registerLane(s),e||this.elementsWithoutParentByProcessId.get(n).push(s),this.assignParentOfLaneFlowNodes(t),(null===(i=t.childLaneSet)||void 0===i?void 0:i.lane)&&this.buildLaneBpmnElements(t.childLaneSet.lane,t.id,n)}))}assignParentOfLaneFlowNodes(t){ensureIsArray(t.flowNodeRef).forEach((e=>{const n=this.convertedElements.findFlowNode(e),i=t.id;n?ShapeUtil.isBoundaryEvent(n.kind)||(n.parentId=i):this.parsingMessageCollector.warning(new LaneUnknownFlowNodeRefWarning(i,e))}))}buildSequenceFlows(t){ensureIsArray(t).forEach((t=>{const e=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new SequenceFlow(t.id,t.name,t.sourceRef,t.targetRef,e))}))}buildAssociationFlows(t){ensureIsArray(t).forEach((t=>{const e=t.associationDirection;this.convertedElements.registerAssociationFlow(new AssociationFlow(t.id,void 0,t.sourceRef,t.targetRef,e))}))}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return exports.SequenceFlowKind.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&ShapeUtil.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return ShapeUtil.isActivity(e.kind)?exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY:exports.SequenceFlowKind.CONDITIONAL_FROM_GATEWAY}return exports.SequenceFlowKind.NORMAL}}const buildMarkers=t=>{const e=[],n=t.standardLoopCharacteristics,i=ensureIsArray(t.multiInstanceLoopCharacteristics,!0)[0];return n||""===n?e.push(exports.ShapeBpmnMarkerKind.LOOP):i&&e.push(i.isSequential?exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL),e};class Bounds{constructor(t,e,n,i){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class Edge{constructor(t,e,n,i,s=exports.MessageVisibleKind.NONE){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,"waypoints",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"messageVisibleKind",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:{}})}}class Waypoint{constructor(t,e){Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:e})}}class Label{constructor(t,e){Object.defineProperty(this,"font",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"bounds",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:{}})}}class Font{constructor(t,e,n,i,s,r){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"isBold",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isItalic",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"isUnderline",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"isStrikeThrough",{enumerable:!0,configurable:!0,writable:!0,value:r})}}class DiagramConverter{constructor(t,e){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"parsingMessageCollector",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"convertedFonts",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}deserialize(t){const e=[],n=[],i=[],s=[],r=ensureIsArray(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const t=r.BPMNPlane,o=this.deserializeEdges(t.BPMNEdge),l=this.deserializeShapes(t.BPMNShape);e.push(...l.flowNodes),n.push(...l.lanes),i.push(...l.pools),s.push(...o)}return{flowNodes:e,lanes:n,pools:i,edges:s}}deserializeFonts(t){this.convertedFonts=new Map,ensureIsArray(t).forEach((t=>ensureIsArray(t.Font).forEach((e=>this.convertedFonts.set(t.id,new Font(e.name,e.size,e.isBold,e.isItalic,e.isUnderline,e.isStrikeThrough))))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return ensureIsArray(t).forEach((t=>{this.deserializeShapeAndStoreIfFound(t,e.flowNodes,(t=>this.convertedElements.findFlowNode(t)))||this.deserializeShapeAndStoreIfFound(t,e.lanes,(t=>this.convertedElements.findLane(t)))||this.deserializeShapeAndStoreIfFound(t,e.pools,(t=>this.convertedElements.findPoolById(t)))||this.parsingMessageCollector.warning(new ShapeUnknownBpmnElementWarning(t.bpmnElement))})),e}deserializeShapeAndStoreIfFound(t,e,n){const i=this.deserializeShape(t,n);return!!i&&(e.push(i),!0)}deserializeShape(t,e){var n;const i=e(t.bpmnElement);if(i){const e=DiagramConverter.deserializeBounds(t);let s;(i instanceof ShapeBpmnSubProcess||i instanceof ShapeBpmnCallActivity&&i.callActivityKind===exports.ShapeBpmnCallActivityKind.CALLING_PROCESS)&&!t.isExpanded&&i.markers.push(exports.ShapeBpmnMarkerKind.EXPAND),ShapeUtil.isPoolOrLane(i.kind)&&(s=null===(n=t.isHorizontal)||void 0===n||n);const r=t.BPMNLabel,o=this.deserializeLabel(r,t.id),l=new Shape(t.id,i,e,o,s);return DiagramConverter.setColorExtensionsOnShape(l,t),l}}static setColorExtensionsOnShape(t,e){"background-color"in e?t.extensions.fillColor=e["background-color"]:"fill"in e&&(t.extensions.fillColor=e.fill),"border-color"in e?t.extensions.strokeColor=e["border-color"]:"stroke"in e&&(t.extensions.strokeColor=e.stroke)}static deserializeBounds(t){const e=t.Bounds;if(e)return new Bounds(e.x,e.y,e.width,e.height)}deserializeEdges(t){return ensureIsArray(t).map((t=>{const e=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!e)return void this.parsingMessageCollector.warning(new EdgeUnknownBpmnElementWarning(t.bpmnElement));const n=this.deserializeWaypoints(t.waypoint),i=this.deserializeLabel(t.BPMNLabel,t.id),s=t.messageVisibleKind?t.messageVisibleKind:exports.MessageVisibleKind.NONE,r=new Edge(t.id,e,n,i,s);return DiagramConverter.setColorExtensionsOnEdge(r,t),r})).filter(Boolean)}static setColorExtensionsOnEdge(t,e){"border-color"in e?t.extensions.strokeColor=e["border-color"]:"stroke"in e&&(t.extensions.strokeColor=e.stroke)}deserializeWaypoints(t){return ensureIsArray(t).map((t=>new Waypoint(t.x,t.y)))}deserializeLabel(t,e){if(t&&"object"==typeof t){const n=this.findFont(t.labelStyle,e),i=DiagramConverter.deserializeBounds(t),s=new Label(n,i);if("color"in t)return s.extensions.color=t.color,s;if(n||i)return s}}findFont(t,e){let n;return t&&(n=this.convertedFonts.get(t),n||this.parsingMessageCollector.warning(new LabelStyleMissingFontWarning(e,t))),n}}class EventDefinitionConverter{constructor(t){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t})}deserialize(t){eventDefinitionKinds.forEach((e=>{ensureIsArray(t[e+"EventDefinition"],!0).forEach((t=>this.convertedElements.registerEventDefinitionsOfDefinition(t.id,e)))}))}}class GlobalTaskConverter{constructor(t){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t})}deserialize(t){this.parseGlobalTasks(t.globalTask,exports.ShapeBpmnElementKind.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,exports.ShapeBpmnElementKind.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){ensureIsArray(t).forEach((t=>this.convertedElements.registerGlobalTask(t.id,e)))}}class CategoryConverter{constructor(t){Object.defineProperty(this,"convertedElements",{enumerable:!0,configurable:!0,writable:!0,value:t})}deserialize(t){ensureIsArray(t.category).forEach((t=>ensureIsArray(t.categoryValue).forEach((t=>this.convertedElements.registerCategoryValue(t.id,t.value)))))}}class BpmnJsonParser{constructor(t,e,n,i,s,r){Object.defineProperty(this,"categoryConverter",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"collaborationConverter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"eventDefinitionConverter",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"globalTaskConverter",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"processConverter",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"diagramConverter",{enumerable:!0,configurable:!0,writable:!0,value:r})}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function newBpmnJsonParser(t){const e=new ConvertedElements;return new BpmnJsonParser(new CategoryConverter(e),new CollaborationConverter(e,t),new EventDefinitionConverter(e),new GlobalTaskConverter(e),new ProcessConverter(e,t),new DiagramConverter(e,t))}class BpmnParser{constructor(t,e){Object.defineProperty(this,"jsonParser",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"xmlParser",{enumerable:!0,configurable:!0,writable:!0,value:e})}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function newBpmnParser(t){return new BpmnParser(newBpmnJsonParser(new ParsingMessageCollector),new BpmnXmlParser(t))}class CssRegistry{constructor(){Object.defineProperty(this,"classNamesByBpmnId",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"clear",{enumerable:!0,configurable:!0,writable:!0,value:()=>{this.classNamesByBpmnId.clear()}}),Object.defineProperty(this,"addClassNames",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>this.updateClassNames(t,e,((t,e)=>t.add(e)))}),Object.defineProperty(this,"removeClassNames",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>this.updateClassNames(t,e,((t,e)=>t.delete(e)))}),Object.defineProperty(this,"toggleClassNames",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>(this.updateClassNames(t,e,((t,e)=>t.has(e)?t.delete(e):t.add(e))),e&&e.length>0)})}getClassNames(t){var e;return Array.from(null!==(e=this.classNamesByBpmnId.get(t))&&void 0!==e?e:[])}getBpmnIds(){return Array.from(this.classNamesByBpmnId.keys())}removeAllClassNames(t){const e=this.getOrInitializeClassNames(t),n=e.size;return e.clear(),e.sizen(i,t))),i.size!=s}getOrInitializeClassNames(t){let e=this.classNamesByBpmnId.get(t);return null==e&&(e=new Set,this.classNamesByBpmnId.set(t,e)),e}}class StyleManager{constructor(t,e){Object.defineProperty(this,"cssRegistry",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"stylesCache",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}clear(){this.stylesCache.clear()}resetAllStyles(){for(const t of this.stylesCache.keys()){const e=this.stylesCache.get(t);this.resetStyle(t,e)}}resetStyleIfIsStored(t){const e=this.stylesCache.get(t);e&&this.resetStyle(t,e)}resetStyle(t,e){const n=this.model.getCell(t),i=this.cssRegistry.getClassNames(t),s=setStyle(e,BpmnStyleIdentifier.EXTRA_CSS_CLASSES,i.join(","));this.model.setStyle(n,s),this.stylesCache.delete(t)}ensureStyleIsStored(t){const e=t.getId();this.stylesCache.has(e)||this.stylesCache.set(e,t.getStyle())}}function newGraphCellUpdater(t,e){return new GraphCellUpdater(t,new StyleManager(e,t.getModel()))}class GraphCellUpdater{constructor(t,e){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"styleManager",{enumerable:!0,configurable:!0,writable:!0,value:e})}clear(){this.styleManager.clear()}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(messageFlowIconId(t),e)}updateAndRefreshCssClassesOfElement(t,e){const n=this.graph.getModel(),i=n.getCell(t);if(!i)return;this.styleManager.ensureStyleIsStored(i);let s=i.getStyle();s=setStyle(s,BpmnStyleIdentifier.EXTRA_CSS_CLASSES,e.join(",")),n.setStyle(i,s)}updateStyle(t,e){if(!e)return;const n=this.graph.getModel(),i=withCellIdsOfMessageFlowIcons(t).map((t=>n.getCell(t))).filter(Boolean);0!=i.length&&this.graph.batchUpdate((()=>{for(const t of i){this.styleManager.ensureStyleIsStored(t);let n=t.getStyle();n=setStyle(n,mxConstants.STYLE_OPACITY,e.opacity,ensureOpacityValue),n=updateStroke(n,e.stroke),n=updateFont(n,e.font),isShapeStyleUpdate(e)&&(n=updateFill(n,e.fill)),this.graph.model.setStyle(t,n)}}))}resetStyle(t){this.graph.batchUpdate((()=>{if(t)for(const e of withCellIdsOfMessageFlowIcons(t))this.styleManager.resetStyleIfIsStored(e);else this.styleManager.resetAllStyles()}))}}function withCellIdsOfMessageFlowIcons(t){const e=ensureIsArray(t);return e.concat(e.map((t=>messageFlowIconId(t))))}class BpmnQuerySelectors{element(t){return`svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`svg > g > g > g.${t}:not(.bpmn-label)`}}class OverlayConverter{constructor(){Object.defineProperty(this,"overlayPositions",{enumerable:!0,configurable:!0,writable:!0,value:new Map([["start",{horizontalAlign:"left",verticalAlign:"top"}],["middle",{horizontalAlign:"center",verticalAlign:"top"}],["end",{horizontalAlign:"right",verticalAlign:"top"}],["top-left",{horizontalAlign:"left",verticalAlign:"top"}],["top-right",{horizontalAlign:"right",verticalAlign:"top"}],["top-center",{horizontalAlign:"center",verticalAlign:"top"}],["bottom-left",{horizontalAlign:"left",verticalAlign:"bottom"}],["bottom-right",{horizontalAlign:"right",verticalAlign:"bottom"}],["bottom-center",{horizontalAlign:"center",verticalAlign:"bottom"}],["middle-left",{horizontalAlign:"left",verticalAlign:"middle"}],["middle-right",{horizontalAlign:"right",verticalAlign:"middle"}]])})}convert(t){return{position:this.convertPosition(t),style:OverlayConverter.convertStyle(t)}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:StyleDefault.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:StyleDefault.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:StyleDefault.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:StyleDefault.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:StyleDefault.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:StyleDefault.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},n=t.style,i=Object.assign({},e);return n?(this.convertFill(i,n.fill),this.convertStroke(i,n.stroke),this.convertFont(i,n.font),i):i}static convertFill(t,e){var n,i;e&&(t.fill.color=null!==(n=e.color)&&void 0!==n?n:t.fill.color,t.fill.opacity=null!==(i=e.opacity)&&void 0!==i?i:t.fill.opacity)}static convertStroke(t,e){var n,i;e&&(t.stroke.color=null!==(n=e.color)&&void 0!==n?n:t.stroke.color,t.stroke.width=null!==(i=e.width)&&void 0!==i?i:t.stroke.width)}static convertFont(t,e){var n,i;e&&(t.font.color=null!==(n=e.color)&&void 0!==n?n:t.font.color,t.font.size=null!==(i=e.size)&&void 0!==i?i:t.font.size)}}function createNewOverlaysUpdater(t){return new OverlaysUpdater(t,new OverlayConverter)}class OverlaysUpdater{constructor(t,e){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"overlayConverter",{enumerable:!0,configurable:!0,writable:!0,value:e})}addOverlays(t,e){const n=this.graph.getModel().getCell(t);n&&ensureIsArray(e).forEach((t=>{const e=new MxGraphCustomOverlay(t.label,this.overlayConverter.convert(t));this.graph.addCellOverlay(n,e)}))}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);e&&this.graph.removeCellOverlays(e)}}function createNewOverlaysRegistry(t){return new OverlaysRegistry(createNewOverlaysUpdater(t))}class OverlaysRegistry{constructor(t){Object.defineProperty(this,"overlaysUpdater",{enumerable:!0,configurable:!0,writable:!0,value:t})}addOverlays(t,e){this.overlaysUpdater.addOverlays(t,e)}removeAllOverlays(t){this.overlaysUpdater.removeAllOverlays(t)}}function newBpmnElementsRegistry(t,e){const n=new CssRegistry;return new BpmnElementsRegistry(t,new HtmlElementRegistry(e.container,new BpmnQuerySelectors),n,newGraphCellUpdater(e,n),createNewOverlaysRegistry(e))}class BpmnElementsRegistry{constructor(t,e,n,i,s){Object.defineProperty(this,"bpmnModelRegistry",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"htmlElementRegistry",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cssRegistry",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"graphCellUpdater",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"overlaysRegistry",{enumerable:!0,configurable:!0,writable:!0,value:s}),this.bpmnModelRegistry.registerOnLoadCallback((()=>{this.cssRegistry.clear(),this.graphCellUpdater.clear()}))}getElementsByIds(t){return ensureIsArray(t).map((t=>this.bpmnModelRegistry.getBpmnSemantic(t))).filter(Boolean).map((t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)})))}getElementsByKinds(t){return ensureIsArray(t).map((t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map((t=>({htmlElement:t,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(t.getAttribute("data-bpmn-id"))}))))).reduce(((t,e)=>(t.push(...e),t)),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames)}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames)}removeAllCssClasses(t){if(t)ensureIsArray(t).forEach((t=>{const e=this.cssRegistry.removeAllClassNames(t);this.updateCellIfChanged(e,t)}));else{const t=this.cssRegistry.getBpmnIds();this.cssRegistry.clear(),t.forEach((t=>this.updateCellIfChanged(!0,t)))}}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames)}updateCssClasses(t,e,n){const i=ensureIsArray(e);ensureIsArray(t).forEach((t=>this.updateCellIfChanged(n(t,i),t)))}updateCellIfChanged(t,e){if(t){const t=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,t)}}addOverlays(t,e){this.overlaysRegistry.addOverlays(t,e)}removeAllOverlays(t){this.overlaysRegistry.removeAllOverlays(t)}updateStyle(t,e){this.graphCellUpdater.updateStyle(t,e)}resetStyle(t){this.graphCellUpdater.resetStyle(t)}}class HtmlElementRegistry{constructor(t,e){Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"querySelectors",{enumerable:!0,configurable:!0,writable:!0,value:e})}getBpmnHtmlElement(t){return this.container.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(computeBpmnBaseClassName(t));return[...this.container.querySelectorAll(e)]}}class ModelFiltering{filter(t,e){const n=[],i=[];if(ensureIsArray(null==e?void 0:e.pools).filter((t=>t&&Object.keys(t).length)).forEach((t=>t.id?n.push(t.id):t.name&&i.push(t.name))),0==n.length&&0==i.length)return t;const{filteredPools:s,filteredPoolIds:r}=filterPools(t,n,i),o=[...n,...r],{filteredLanes:l,filteredLaneIds:a,filteredFlowNodes:h,filteredFlowNodeIds:u}=filterLanesAndFlowNodes(t.lanes,t.flowNodes,o),d=filterEdges(t.edges,[...o,...a,...u]);if(0==s.length&&0==l.length&&0==h.length&&0==d.length){let t=n.length>0?` for ids [${n}]`:"";const e=t?" and":"";throw t+=i.length>0?`${e} for names [${i}]`:"",new Error("No matching pools"+t)}return{lanes:l,flowNodes:h,pools:s,edges:d}}}function filterPools(t,e,n){const i=t.pools.filter((t=>e.includes(t.bpmnElement.id)||n.includes(t.bpmnElement.name))),s=i.map((t=>t.bpmnElement.id));return{filteredPools:i,filteredPoolIds:s}}function filterLanesAndFlowNodes(t,e,n){const{filteredLanes:i,filteredLaneIds:s}=filterLanes(t,n),{filteredLanes:r,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}=filterFlowNodes(e,[...n,...s],t);return i.push(...r),s.push(...o),{filteredLanes:i,filteredLaneIds:s,filteredFlowNodes:l,filteredFlowNodeIds:a}}function filterLanes(t,e){const n=t.filter((t=>e.includes(t.bpmnElement.parentId))),i=n.map((t=>t.bpmnElement.id));if(n.length>0){const{filteredLanes:e,filteredLaneIds:s}=filterLanes(t,i);n.push(...e),i.push(...s)}return{filteredLanes:n,filteredLaneIds:i}}function filterFlowNodes(t,e,n){const i=t.filter((t=>e.includes(t.bpmnElement.parentId)));if(0===i.length)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const s=i.map((t=>t.bpmnElement.id)),{filteredLanes:r,filteredLaneIds:o,filteredFlowNodes:l,filteredFlowNodeIds:a}=filterLanesAndFlowNodes(n,t,s);return i.push(...l),s.push(...a),{filteredLanes:r,filteredLaneIds:o,filteredFlowNodes:i,filteredFlowNodeIds:s}}function filterEdges(t,e){return t.filter((t=>e.includes(t.bpmnElement.sourceRefId)&&e.includes(t.bpmnElement.targetRefId)))}class BpmnModelRegistry{constructor(){Object.defineProperty(this,"searchableModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onLoadCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}load(t,e){var n;const i=(new ModelFiltering).filter(t,e);return this.searchableModel=new SearchableModel(i),null===(n=this.onLoadCallback)||void 0===n||n.call(this),toRenderedModel(i)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){var e;const n=null===(e=this.searchableModel)||void 0===e?void 0:e.elementById(t);if(!n)return;const i=n.bpmnElement,s=i instanceof ShapeBpmnElement,r={id:t,name:i.name,isShape:s,kind:i.kind};return i instanceof Flow?(r.sourceRefId=i.sourceRefId,r.targetRefId=i.targetRefId):(r.incomingIds=i.incomingIds,r.outgoingIds=i.outgoingIds),r}}function toRenderedModel(t){const e=t.flowNodes.filter((t=>{const e=t.bpmnElement;return ShapeUtil.isSubProcess(e.kind)&&e.markers.includes(exports.ShapeBpmnMarkerKind.EXPAND)})).map((t=>t.bpmnElement.id)),n=[],i=[],s=[];return t.flowNodes.forEach((t=>{const r=t.bpmnElement.kind;ShapeUtil.isSubProcess(r)?n.push(t):ShapeUtil.isBoundaryEvent(r)?i.push(t):e.includes(t.bpmnElement.parentId)||s.push(t)})),{boundaryEvents:i,edges:t.edges,lanes:t.lanes,otherFlowNodes:s,pools:t.pools,subprocesses:n}}class SearchableModel{constructor(t){Object.defineProperty(this,"elements",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach((t=>this.elements.set(t.bpmnElement.id,t)))}elementById(t){return this.elements.get(t)}}function htmlElement(t){return t instanceof HTMLElement?t:document.getElementById(t)}class Navigation{constructor(t){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:t})}fit(t){this.graph.customFit(t)}zoom(t){"in"==t?this.graph.zoomIn():this.graph.zoomOut()}}const libVersion="0.38.1",version=()=>({lib:libVersion,dependencies:new Map([["mxGraph",mxClient.VERSION]])});class BpmnVisualization{constructor(t){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"navigation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bpmnElementsRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bpmnModelRegistry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parserOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"rendererOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.rendererOptions=null==t?void 0:t.renderer;const e=new GraphConfigurator(htmlElement(null==t?void 0:t.container));this.graph=e.configure(t),this.navigation=new Navigation(this.graph),this.bpmnModelRegistry=new BpmnModelRegistry,this.bpmnElementsRegistry=newBpmnElementsRegistry(this.bpmnModelRegistry,this.graph),this.parserOptions=null==t?void 0:t.parser}load(t,e){const n=newBpmnParser(this.parserOptions).parse(t),i=this.bpmnModelRegistry.load(n,null==e?void 0:e.modelFilter);newBpmnRenderer(this.graph,this.rendererOptions).render(i,null==e?void 0:e.fit)}getVersion(){return version()}}return exports.BpmnCanvas=BpmnCanvas,exports.BpmnElementsRegistry=BpmnElementsRegistry,exports.BpmnStyleIdentifier=BpmnStyleIdentifier,exports.BpmnVisualization=BpmnVisualization,exports.IconPainter=IconPainter,exports.IconPainterProvider=IconPainterProvider,exports.MarkerIdentifier=MarkerIdentifier,exports.ShapeUtil=ShapeUtil,exports.StyleConfigurator=StyleConfigurator,exports.StyleDefault=StyleDefault,exports.mxgraph=mxgraph,exports}({});