bpmn-visualization
Version:
A TypeScript library for visualizing process execution data on BPMN diagrams
1 lines • 101 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("mxgraph"),t=require("lodash.debounce"),n=require("lodash.throttle"),i=require("fast-xml-parser"),s=require("entities");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r,a,l,c,u,p,h,d,m=o(e),T=o(t),g=o(n);function E(e,t=!1){return null==e?[]:(Array.isArray(e)?e:[e]).map((e=>function(e,t){return""===e?t?{}:void 0:e}(e,t))).filter(Boolean)}exports.FitType=void 0,(r=exports.FitType||(exports.FitType={})).None="None",r.HorizontalVertical="HorizontalVertical",r.Horizontal="Horizontal",r.Vertical="Vertical",r.Center="Center",exports.ZoomType=void 0,(a=exports.ZoomType||(exports.ZoomType={})).In="in",a.Out="out",exports.ShapeBpmnElementKind=void 0,(l=exports.ShapeBpmnElementKind||(exports.ShapeBpmnElementKind={})).LANE="lane",l.POOL="pool",l.CALL_ACTIVITY="callActivity",l.SUB_PROCESS="subProcess",l.TASK="task",l.TASK_USER="userTask",l.TASK_SERVICE="serviceTask",l.TASK_RECEIVE="receiveTask",l.TASK_SEND="sendTask",l.TASK_MANUAL="manualTask",l.TASK_SCRIPT="scriptTask",l.TASK_BUSINESS_RULE="businessRuleTask",l.GLOBAL_TASK="globalTask",l.GLOBAL_TASK_USER="globalUserTask",l.GLOBAL_TASK_MANUAL="globalManualTask",l.GLOBAL_TASK_SCRIPT="globalScriptTask",l.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",l.GROUP="group",l.TEXT_ANNOTATION="textAnnotation",l.GATEWAY_PARALLEL="parallelGateway",l.GATEWAY_EXCLUSIVE="exclusiveGateway",l.GATEWAY_INCLUSIVE="inclusiveGateway",l.GATEWAY_EVENT_BASED="eventBasedGateway",l.EVENT_START="startEvent",l.EVENT_END="endEvent",l.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",l.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",l.EVENT_BOUNDARY="boundaryEvent",exports.ShapeBpmnCallActivityKind=void 0,(c=exports.ShapeBpmnCallActivityKind||(exports.ShapeBpmnCallActivityKind={})).CALLING_PROCESS="process",c.CALLING_GLOBAL_TASK="global task",exports.ShapeBpmnEventBasedGatewayKind=void 0,(u=exports.ShapeBpmnEventBasedGatewayKind||(exports.ShapeBpmnEventBasedGatewayKind={})).Exclusive="Exclusive",u.None="None",u.Parallel="Parallel",exports.ShapeBpmnEventDefinitionKind=void 0,(p=exports.ShapeBpmnEventDefinitionKind||(exports.ShapeBpmnEventDefinitionKind={})).NONE="none",p.TERMINATE="terminate",p.CANCEL="cancel",p.COMPENSATION="compensate",p.CONDITIONAL="conditional",p.ERROR="error",p.ESCALATION="escalation",p.LINK="link",p.MESSAGE="message",p.SIGNAL="signal",p.TIMER="timer",exports.ShapeBpmnMarkerKind=void 0,(h=exports.ShapeBpmnMarkerKind||(exports.ShapeBpmnMarkerKind={})).ADHOC="adhoc",h.COMPENSATION="compensation",h.EXPAND="expand",h.LOOP="loop",h.MULTI_INSTANCE_PARALLEL="parallel multi instance",h.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",exports.ShapeBpmnSubProcessKind=void 0,(d=exports.ShapeBpmnSubProcessKind||(exports.ShapeBpmnSubProcessKind={})).EMBEDDED="embedded",d.EVENT="event";class S{static isEvent(e){return f(v,e)}static eventKinds(){return[...v]}static isBoundaryEvent(e){return exports.ShapeBpmnElementKind.EVENT_BOUNDARY===e}static isStartEvent(e){return exports.ShapeBpmnElementKind.EVENT_START===e}static isCallActivity(e){return exports.ShapeBpmnElementKind.CALL_ACTIVITY===e}static isSubProcess(e){return exports.ShapeBpmnElementKind.SUB_PROCESS===e}static canHaveNoneEvent(e){return exports.ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW===e||exports.ShapeBpmnElementKind.EVENT_END===e||exports.ShapeBpmnElementKind.EVENT_START===e}static isActivity(e){return f(A,e)}static activityKinds(){return[...A]}static isWithDefaultSequenceFlow(e){return C.includes(e)}static isTask(e){return f(I,e)}static taskKinds(){return[...I]}static gatewayKinds(){return[...O]}static isGateway(e){return f(O,e)}static flowNodeKinds(){return Object.values(exports.ShapeBpmnElementKind).filter((e=>!S.isPoolOrLane(e)))}static isPoolOrLane(e){return e==exports.ShapeBpmnElementKind.POOL||e==exports.ShapeBpmnElementKind.LANE}}function b(e,t){return function(e,t,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(`${t}$`),e.filter((e=>(null==n?void 0:n.ignoreCase)?new RegExp(i,"i").test(e):new RegExp(i).test(e)))}(Object.values(exports.ShapeBpmnElementKind),e,t)}function f(e,t){return Object.values(e).map((e=>e)).includes(t)}const v=b("Event"),O=b("Gateway"),I=b("Task",{ignoreCase:!0,notStartingWith:"global"}),A=[...I,exports.ShapeBpmnElementKind.CALL_ACTIVITY,exports.ShapeBpmnElementKind.SUB_PROCESS],C=[...A,exports.ShapeBpmnElementKind.GATEWAY_EXCLUSIVE,exports.ShapeBpmnElementKind.GATEWAY_INCLUSIVE],L=Object.values(exports.ShapeBpmnEventDefinitionKind).filter((e=>e!=exports.ShapeBpmnEventDefinitionKind.NONE));var _,y,x,w;exports.AssociationDirectionKind=void 0,(_=exports.AssociationDirectionKind||(exports.AssociationDirectionKind={})).NONE="None",_.ONE="One",_.BOTH="Both",exports.FlowKind=void 0,(y=exports.FlowKind||(exports.FlowKind={})).SEQUENCE_FLOW="sequenceFlow",y.MESSAGE_FLOW="messageFlow",y.ASSOCIATION_FLOW="association",exports.MessageVisibleKind=void 0,(x=exports.MessageVisibleKind||(exports.MessageVisibleKind={})).NONE="none",x.INITIATING="initiating",x.NON_INITIATING="non_initiating",exports.SequenceFlowKind=void 0,(w=exports.SequenceFlowKind||(exports.SequenceFlowKind={})).NORMAL="normal",w.DEFAULT="default",w.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",w.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway";const N=(window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",m.default({}));class P{}Object.defineProperty(P,"EDGE",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.edge"}),Object.defineProperty(P,"EDGE_START_FILL_COLOR",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.edge.startFillColor"}),Object.defineProperty(P,"EDGE_END_FILL_COLOR",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.edge.endFillColor"}),Object.defineProperty(P,"EVENT_BASED_GATEWAY_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.gatewayKind"}),Object.defineProperty(P,"EVENT_DEFINITION_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.eventDefinitionKind"}),Object.defineProperty(P,"GLOBAL_TASK_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.globalTaskKind"}),Object.defineProperty(P,"SUB_PROCESS_KIND",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.subProcessKind"}),Object.defineProperty(P,"IS_INITIATING",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.isInitiating"}),Object.defineProperty(P,"IS_INSTANTIATING",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.isInstantiating"}),Object.defineProperty(P,"IS_INTERRUPTING",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.isInterrupting"}),Object.defineProperty(P,"EXTRA_CSS_CLASSES",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.extra.css.classes"}),Object.defineProperty(P,"MARKERS",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.markers"}),Object.defineProperty(P,"MESSAGE_FLOW_ICON",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.messageFlowIcon"});class R{}var F;Object.defineProperty(R,"ARROW_DASH",{enumerable:!0,configurable:!0,writable:!0,value:"bpmn.dash"}),exports.StyleDefault=void 0,(F=exports.StyleDefault||(exports.StyleDefault={}))[F.STROKE_WIDTH_THIN=2]="STROKE_WIDTH_THIN",F[F.STROKE_WIDTH_THICK=5]="STROKE_WIDTH_THICK",F[F.SHAPE_ACTIVITY_BOTTOM_MARGIN=7]="SHAPE_ACTIVITY_BOTTOM_MARGIN",F[F.SHAPE_ACTIVITY_TOP_MARGIN=7]="SHAPE_ACTIVITY_TOP_MARGIN",F[F.SHAPE_ACTIVITY_LEFT_MARGIN=7]="SHAPE_ACTIVITY_LEFT_MARGIN",F[F.SHAPE_ACTIVITY_FROM_CENTER_MARGIN=7]="SHAPE_ACTIVITY_FROM_CENTER_MARGIN",F[F.SHAPE_ACTIVITY_MARKER_ICON_MARGIN=5]="SHAPE_ACTIVITY_MARKER_ICON_MARGIN",F[F.SHAPE_ACTIVITY_MARKER_ICON_SIZE=20]="SHAPE_ACTIVITY_MARKER_ICON_SIZE",F[F.POOL_LABEL_SIZE=30]="POOL_LABEL_SIZE",F.POOL_LABEL_FILL_COLOR="none",F[F.LANE_LABEL_SIZE=30]="LANE_LABEL_SIZE",F.LANE_LABEL_FILL_COLOR="none",F[F.TEXT_ANNOTATION_BORDER_LENGTH=10]="TEXT_ANNOTATION_BORDER_LENGTH",F.TEXT_ANNOTATION_FILL_COLOR="none",F.GROUP_FILL_COLOR="none",F.DEFAULT_FILL_COLOR="White",F.DEFAULT_STROKE_COLOR="Black",F.DEFAULT_FONT_FAMILY="Arial, Helvetica, sans-serif",F[F.DEFAULT_FONT_SIZE=11]="DEFAULT_FONT_SIZE",F.DEFAULT_FONT_COLOR="Black",F[F.DEFAULT_MARGIN=0]="DEFAULT_MARGIN",F[F.SHAPE_ARC_SIZE=20]="SHAPE_ARC_SIZE",F.DEFAULT_OVERLAY_FILL_COLOR="White",F[F.DEFAULT_OVERLAY_FILL_OPACITY=100]="DEFAULT_OVERLAY_FILL_OPACITY",F.DEFAULT_OVERLAY_STROKE_COLOR="Black",F[F.DEFAULT_OVERLAY_STROKE_WIDTH=1]="DEFAULT_OVERLAY_STROKE_WIDTH",F[F.DEFAULT_OVERLAY_FONT_SIZE=11]="DEFAULT_OVERLAY_FONT_SIZE",F.DEFAULT_OVERLAY_FONT_COLOR="Black",F.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR="White",F.MESSAGE_FLOW_MARKER_START_FILL_COLOR="White",F.MESSAGE_FLOW_MARKER_END_FILL_COLOR="White";class B{static getFillColor(e){return N.mxUtils.getValue(e,N.mxConstants.STYLE_FILLCOLOR,exports.StyleDefault.DEFAULT_FILL_COLOR)}static getStrokeColor(e){return N.mxUtils.getValue(e,N.mxConstants.STYLE_STROKECOLOR,exports.StyleDefault.DEFAULT_STROKE_COLOR)}static getStrokeWidth(e){return N.mxUtils.getValue(e,N.mxConstants.STYLE_STROKEWIDTH,exports.StyleDefault.STROKE_WIDTH_THIN)}static getMargin(e){return N.mxUtils.getValue(e,N.mxConstants.STYLE_MARGIN,exports.StyleDefault.DEFAULT_MARGIN)}static getBpmnEventDefinitionKind(e){return N.mxUtils.getValue(e,P.EVENT_DEFINITION_KIND,exports.ShapeBpmnEventDefinitionKind.NONE)}static getBpmnSubProcessKind(e){return N.mxUtils.getValue(e,P.SUB_PROCESS_KIND,void 0)}static getBpmnIsInterrupting(e){return N.mxUtils.getValue(e,P.IS_INTERRUPTING,void 0)}static getBpmnMarkers(e){return N.mxUtils.getValue(e,P.MARKERS,void 0)}static getBpmnIsInstantiating(e){return JSON.parse(N.mxUtils.getValue(e,P.IS_INSTANTIATING,!1))}static getBpmnIsInitiating(e){return N.mxUtils.getValue(e,P.IS_INITIATING,void 0)}static getBpmnIsParallelEventBasedGateway(e){return N.mxUtils.getValue(e,P.EVENT_BASED_GATEWAY_KIND,exports.ShapeBpmnEventBasedGatewayKind.Exclusive)==exports.ShapeBpmnEventBasedGatewayKind.Parallel}static getBpmnGlobalTaskKind(e){return N.mxUtils.getValue(e,P.GLOBAL_TASK_KIND,void 0)}}class D{constructor(e){Object.defineProperty(this,"graph",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"specificFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new K([[exports.FlowKind.SEQUENCE_FLOW,e=>{e[N.mxConstants.STYLE_ENDARROW]=N.mxConstants.ARROW_BLOCK_THIN}],[exports.FlowKind.MESSAGE_FLOW,e=>{e[N.mxConstants.STYLE_DASHED]=!0,e[N.mxConstants.STYLE_DASH_PATTERN]="8 5",e[N.mxConstants.STYLE_STARTARROW]=N.mxConstants.ARROW_OVAL,e[N.mxConstants.STYLE_STARTSIZE]=8,e[N.mxConstants.STYLE_STARTFILL]=!0,e[P.EDGE_START_FILL_COLOR]=exports.StyleDefault.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[N.mxConstants.STYLE_ENDARROW]=N.mxConstants.ARROW_BLOCK_THIN,e[N.mxConstants.STYLE_ENDFILL]=!0,e[P.EDGE_END_FILL_COLOR]=exports.StyleDefault.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[exports.FlowKind.ASSOCIATION_FLOW,e=>{e[N.mxConstants.STYLE_DASHED]=!0,e[N.mxConstants.STYLE_DASH_PATTERN]="1 2",e[N.mxConstants.STYLE_ENDARROW]=N.mxConstants.ARROW_OPEN_THIN,e[N.mxConstants.STYLE_STARTARROW]=N.mxConstants.ARROW_OPEN_THIN,e[N.mxConstants.STYLE_STARTSIZE]=12}]])}),Object.defineProperty(this,"specificSequenceFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new K([[exports.SequenceFlowKind.DEFAULT,e=>{e[N.mxConstants.STYLE_STARTARROW]=R.ARROW_DASH}],[exports.SequenceFlowKind.CONDITIONAL_FROM_ACTIVITY,e=>{e[N.mxConstants.STYLE_STARTARROW]=N.mxConstants.ARROW_DIAMOND_THIN,e[N.mxConstants.STYLE_STARTSIZE]=18,e[N.mxConstants.STYLE_STARTFILL]=!0,e[P.EDGE_START_FILL_COLOR]=exports.StyleDefault.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]])}),Object.defineProperty(this,"specificAssociationFlowStyles",{enumerable:!0,configurable:!0,writable:!0,value:new K([[exports.AssociationDirectionKind.NONE,e=>{e[N.mxConstants.STYLE_STARTARROW]=void 0,e[N.mxConstants.STYLE_ENDARROW]=void 0}],[exports.AssociationDirectionKind.ONE,e=>{e[N.mxConstants.STYLE_STARTARROW]=void 0}],[exports.AssociationDirectionKind.BOTH,e=>{}]])})}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(e,t){this.getStylesheet().putCellStyle(e,t)}configureDefaultVertexStyle(){D.configureCommonDefaultStyle(this.getStylesheet().getDefaultVertexStyle())}configurePoolStyle(){const e={};e[N.mxConstants.STYLE_SHAPE]=N.mxConstants.SHAPE_SWIMLANE,e[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_MIDDLE,e[N.mxConstants.STYLE_ALIGN]=N.mxConstants.ALIGN_CENTER,e[N.mxConstants.STYLE_STARTSIZE]=exports.StyleDefault.POOL_LABEL_SIZE,e[N.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.POOL,e)}configureLaneStyle(){const e={};e[N.mxConstants.STYLE_SHAPE]=N.mxConstants.SHAPE_SWIMLANE,e[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_MIDDLE,e[N.mxConstants.STYLE_ALIGN]=N.mxConstants.ALIGN_CENTER,e[N.mxConstants.STYLE_SWIMLANE_LINE]=0,e[N.mxConstants.STYLE_STARTSIZE]=exports.StyleDefault.LANE_LABEL_SIZE,e[N.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(exports.ShapeBpmnElementKind.LANE,e)}configureEventStyles(){S.eventKinds().forEach((e=>{const t={};t[N.mxConstants.STYLE_SHAPE]=e,t[N.mxConstants.STYLE_PERIMETER]=N.mxPerimeter.EllipsePerimeter,t[N.mxConstants.STYLE_STROKEWIDTH]=e==exports.ShapeBpmnElementKind.EVENT_END?exports.StyleDefault.STROKE_WIDTH_THICK:exports.StyleDefault.STROKE_WIDTH_THIN,t[N.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=N.mxConstants.ALIGN_BOTTOM,this.putCellStyle(e,t)}))}configureTextAnnotationStyle(){const e={};e[N.mxConstants.STYLE_SHAPE]=exports.ShapeBpmnElementKind.TEXT_ANNOTATION,e[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_MIDDLE,e[N.mxConstants.STYLE_ALIGN]=N.mxConstants.ALIGN_LEFT,e[N.mxConstants.STYLE_SPACING_LEFT]=5,e[N.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.TEXT_ANNOTATION_FILL_COLOR,e[N.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(exports.ShapeBpmnElementKind.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[N.mxConstants.STYLE_ROUNDED]=!0,e[N.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[N.mxConstants.STYLE_ARCSIZE]=exports.StyleDefault.SHAPE_ARC_SIZE,e[N.mxConstants.STYLE_DASHED]=!0,e[N.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",e[N.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,e[N.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.GROUP_FILL_COLOR,e[N.mxConstants.STYLE_ALIGN]=N.mxConstants.ALIGN_CENTER,e[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_TOP,this.putCellStyle(exports.ShapeBpmnElementKind.GROUP,e)}configureActivityStyles(){S.activityKinds().forEach((e=>{const t={};t[N.mxConstants.STYLE_SHAPE]=e,t[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_MIDDLE,t[N.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[N.mxConstants.STYLE_ARCSIZE]=exports.StyleDefault.SHAPE_ARC_SIZE,t[N.mxConstants.STYLE_STROKEWIDTH]=e==exports.ShapeBpmnElementKind.CALL_ACTIVITY?exports.StyleDefault.STROKE_WIDTH_THICK:exports.StyleDefault.STROKE_WIDTH_THIN,this.putCellStyle(e,t)}))}configureGatewayStyles(){S.gatewayKinds().forEach((e=>{const t={};t[N.mxConstants.STYLE_SHAPE]=e,t[N.mxConstants.STYLE_PERIMETER]=N.mxPerimeter.RhombusPerimeter,t[N.mxConstants.STYLE_STROKEWIDTH]=exports.StyleDefault.STROKE_WIDTH_THIN,t[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_TOP,t[N.mxConstants.STYLE_LABEL_POSITION]=N.mxConstants.ALIGN_LEFT,t[N.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=N.mxConstants.ALIGN_TOP,this.putCellStyle(e,t)}))}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();e[N.mxConstants.STYLE_SHAPE]=P.EDGE,e[N.mxConstants.STYLE_ENDSIZE]=12,e[N.mxConstants.STYLE_STROKEWIDTH]=1.5,e[N.mxConstants.STYLE_ROUNDED]=1,e[N.mxConstants.STYLE_ARCSIZE]=5,e[N.mxConstants.STYLE_VERTICAL_ALIGN]=N.mxConstants.ALIGN_BOTTOM,delete e[N.mxConstants.STYLE_ENDARROW],D.configureCommonDefaultStyle(e)}static configureCommonDefaultStyle(e){e[N.mxConstants.STYLE_FONTFAMILY]=exports.StyleDefault.DEFAULT_FONT_FAMILY,e[N.mxConstants.STYLE_FONTSIZE]=exports.StyleDefault.DEFAULT_FONT_SIZE,e[N.mxConstants.STYLE_FONTCOLOR]=exports.StyleDefault.DEFAULT_FONT_COLOR,e[N.mxConstants.STYLE_FILLCOLOR]=exports.StyleDefault.DEFAULT_FILL_COLOR,e[N.mxConstants.STYLE_STROKECOLOR]=exports.StyleDefault.DEFAULT_STROKE_COLOR,e[N.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=N.mxConstants.NONE,e[N.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(e,t){e.forEach((e=>{const n={};t.get(e)(n),this.graph.getStylesheet().putCellStyle(e.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)}}class K extends Map{get(e){var t;return null!==(t=super.get(e))&&void 0!==t?t:()=>{}}}class M{constructor({canvas:e,shapeConfig:t,iconConfig:n}){Object.defineProperty(this,"canvas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"iconOriginalSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scaleX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scaleY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"iconPaintingOriginX",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iconPaintingOriginY",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"shapeConfiguration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.canvas=e,this.shapeConfiguration=t,this.iconOriginalSize=n.originalSize;const i=n.ratioFromParent;if(i){const e=function(e,t,n,i){let s,o;e.height<e.width||e.height==e.width&&n.width<=n.height?(s=n.width,o=n.width*e.height/e.width):(s=n.height*e.width/e.height,o=n.height);const r=t.strokeWidth?2*(t.strokeWidth-1):0;return{width:s*i-r,height:o*i-r}}(this.iconOriginalSize,n.styleConfig,this.shapeConfiguration,i);this.scaleX=e.width/this.iconOriginalSize.width,this.scaleY=e.height/this.iconOriginalSize.height}else this.scaleX=1,this.scaleY=1;this.updateCanvasStyle(n.styleConfig),n.setIconOriginFunct(this)}setIconOriginToShapeTopLeftProportionally(e){const t=this.shapeConfiguration;this.iconPaintingOriginX=t.x+t.width/e,this.iconPaintingOriginY=t.y+t.height/e}setIconOriginToShapeTopLeft(e=exports.StyleDefault.SHAPE_ACTIVITY_TOP_MARGIN,t=exports.StyleDefault.SHAPE_ACTIVITY_LEFT_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+t,this.iconPaintingOriginY=n.y+e}setIconOriginForIconCentered(){const e=this.shapeConfiguration;this.iconPaintingOriginX=e.x+(e.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=e.y+(e.height-this.iconOriginalSize.height*this.scaleY)/2}setIconOriginForIconBottomCentered(e=exports.StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN){const t=this.shapeConfiguration;this.iconPaintingOriginX=t.x+(t.width-this.iconOriginalSize.width*this.scaleX)/2,this.iconPaintingOriginY=t.y+(t.height-this.iconOriginalSize.height*this.scaleY-e)}setIconOriginForIconOnBottomLeft(e=exports.StyleDefault.SHAPE_ACTIVITY_BOTTOM_MARGIN,t=exports.StyleDefault.SHAPE_ACTIVITY_FROM_CENTER_MARGIN){const n=this.shapeConfiguration;this.iconPaintingOriginX=n.x+(n.width-this.iconOriginalSize.width*this.scaleX)/3-t,this.iconPaintingOriginY=n.y+(n.height-this.iconOriginalSize.height*this.scaleY-e)}translateIconOrigin(e,t){this.iconPaintingOriginX+=this.scaleX*e,this.iconPaintingOriginY+=this.scaleY*t}computeScaleFromOriginX(e){return this.iconPaintingOriginX+e*this.scaleX}computeScaleFromOriginY(e){return this.iconPaintingOriginY+e*this.scaleY}updateCanvasStyle({isFilled:e,strokeColor:t,fillColor:n,strokeWidth:i}){e?this.canvas.setFillColor(t):this.canvas.setFillColor(n),this.canvas.setStrokeWidth(i)}arcTo(e,t,n,i,s,o,r){this.canvas.arcTo(e*this.scaleX,t*this.scaleY,n,i,s,this.computeScaleFromOriginX(o),this.computeScaleFromOriginY(r))}begin(){this.canvas.begin()}close(){this.canvas.close()}curveTo(e,t,n,i,s,o){this.canvas.curveTo(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),this.computeScaleFromOriginX(n),this.computeScaleFromOriginY(i),this.computeScaleFromOriginX(s),this.computeScaleFromOriginY(o))}fill(){this.canvas.fill()}fillAndStroke(){this.canvas.fillAndStroke()}setFillColor(e){this.canvas.setFillColor(e)}stroke(){this.canvas.stroke()}setStrokeColor(e){this.canvas.setStrokeColor(e)}setRoundLineJoin(){this.canvas.setLineJoin("round")}lineTo(e,t){this.canvas.lineTo(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t))}moveTo(e,t){this.canvas.moveTo(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t))}rect(e,t,n,i){this.canvas.rect(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),n*this.scaleX,i*this.scaleY)}roundrect(e,t,n,i,s,o){this.canvas.roundrect(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),n*this.scaleX,i*this.scaleY,s,o)}ellipse(e,t,n,i){this.canvas.ellipse(this.computeScaleFromOriginX(e),this.computeScaleFromOriginY(t),n*this.scaleX,i*this.scaleY)}rotateOnIconCenter(e){const t=this.iconPaintingOriginX+this.iconOriginalSize.width/2*this.scaleX,n=this.iconPaintingOriginY+this.iconOriginalSize.height/2*this.scaleY;this.canvas.rotate(e,!1,!1,t,n)}}function j({canvas:e,x:t,y:n,width:i,height:s,shape:o,ratioFromParent:r,isFilled:a,iconStrokeWidth:l}){return null!=r||(r=.25),null!=a||(a=!1),null!=l||(l=0),{canvas:e,ratioFromParent:r,setIconOriginFunct:e=>e.setIconOriginForIconCentered(),shapeConfig:{x:t,y:n,width:i,height:s,strokeWidth:o.strokewidth||B.getStrokeWidth(o.style)},iconStyleConfig:{isFilled:a,fillColor:o.fill||B.getFillColor(o.style),strokeColor:o.stroke||B.getStrokeColor(o.style),strokeWidth:l,margin:B.getMargin(o.style)}}}class k{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:n,shapeConfig:i,iconStyleConfig:s},o){return new M({canvas:e,shapeConfig:i,iconConfig:{originalSize:o,styleConfig:s,ratioFromParent:t,setIconOriginFunct:n}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},n=this.newBpmnCanvas(e,t),i=t.width,s=t.height;n.rect(0,0,i,s),n.fillAndStroke();const{iconStyleConfig:o}=e;o.isFilled&&n.setStrokeColor(o.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(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},n=this.newBpmnCanvas(e,t),i=t.width,s=t.height;i>0&&s>0&&n.ellipse(0,0,i,s),e.iconStyleConfig.isFilled?n.fillAndStroke():n.stroke()}paintClockIcon(e){const t=this.newBpmnCanvas(e,{height:152,width:152});t.begin(),t.moveTo(184,60),t.curveTo(188.4,60,192,56.4,192,52),t.lineTo(192,48),t.curveTo(192,40,188.4,40,184,40),t.curveTo(179.6,40,176,43.6,176,48),t.lineTo(176,52),t.curveTo(176,56.4,179.6,60,184,60),t.close(),t.moveTo(184,308),t.curveTo(179.6,308,176,311.6,176,316),t.lineTo(176,320),t.curveTo(176,324.4,179.6,328,184,328),t.curveTo(188.4,328,192,324.4,192,320),t.lineTo(192,316),t.curveTo(192,311.6,188.4,308,184,308),t.close(),t.moveTo(52,176),t.lineTo(48,176),t.curveTo(43.6,176,40,179.6,40,184),t.curveTo(40,188.4,43.6,192,48,192),t.lineTo(52,192),t.curveTo(56.4,192,69,188.4,60,184),t.curveTo(60,179.6,56.4,176,52,176),t.close(),t.moveTo(320,176),t.lineTo(316,176),t.curveTo(311.6,176,308,179.6,308,184),t.curveTo(308,188.4,311.6,192,316,192),t.lineTo(320,192),t.curveTo(324.4,192,328,188.4,328,184),t.curveTo(328,179.6,324.4,176,320,176),t.moveTo(93.6,82.4),t.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),t.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),t.lineTo(85.2,96.4),t.curveTo(86.8,98,88.8,98.8,90.8,98.8),t.curveTo(92.8,98.8,94.4,98,96.4,96.4),t.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),t.lineTo(93.6,82.4),t.moveTo(85.2,271.6),t.lineTo(82.4,274.4),t.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),t.curveTo(84,287.2,86,288,88,288),t.curveTo(90,288,92,287.2,93.6,285.6),t.lineTo(96.4,282.8),t.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),t.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),t.moveTo(274.4,82.4),t.lineTo(271.6,85.2),t.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),t.curveTo(273.298,98,275.2,98.8,277.2,98.8),t.curveTo(279.2,98.8,281.2,98,282.8,96.4),t.lineTo(285.6,93.6),t.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),t.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),t.moveTo(192,180.8),t.lineTo(192,108),t.curveTo(192,103.6,188.4,100,184,100),t.curveTo(179.6,100,176,103.6,176,108),t.lineTo(176,184),t.curveTo(176,186,176.8,188,178.4,189.6),t.lineTo(266,277.2),t.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),t.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),t.curveTo(280.4,274,280.4,269.2,277.2,266),t.lineTo(192,180.8),t.moveTo(184,0),t.curveTo(82.4,0,0,82.4,0,184),t.curveTo(0,285.6,82.4,368,184,368),t.curveTo(285.6,368,368,285.6,368,184),t.curveTo(368,82.4,285.6,0,184,0),t.moveTo(184,352),t.curveTo(91.2,352,16,276.8,16,184),t.curveTo(16,91.2,91.2,16,184,16),t.curveTo(276.8,16,352,91.2,352,184),t.curveTo(352,276.8,276.8,352,184,352),t.fillAndStroke()}paintTriangleIcon(e){const t=this.newBpmnCanvas(e,{height:735,width:849});t.begin(),t.moveTo(497,55),t.lineTo(817,609),t.curveTo(849,665,808,735,744,735),t.lineTo(105,735),t.curveTo(40,735,0,665,32,609),t.lineTo(352,55),t.curveTo(384,0,465,0,497,55),t.close(),t.fillAndStroke()}paintUpArrowheadIcon(e){const t=this.newBpmnCanvas(e,{height:50,width:40});t.begin(),t.moveTo(0,49.5),t.lineTo(19.5,1),t.curveTo(19.75,.25,20,0,20.25,.25),t.lineTo(40,49.5),t.curveTo(40,49.5,39.75,50,39.6,49.75),t.lineTo(20,30),t.lineTo(.4,49.75),t.curveTo(.4,49.75,.25,50,0,49.5),t.close(),t.fillAndStroke()}paintDoubleLeftArrowheadsIcon(e){const t=this.newBpmnCanvas(e,{height:53.5,width:105});t.begin(),t.moveTo(91.4,0),t.curveTo(91.4,0,91.2,0,91,.2),t.lineTo(50,25),t.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),t.lineTo(46.4,0),t.curveTo(46.4,0,46.2,0,46,.2),t.lineTo(4.9,25),t.curveTo(2,26.2,0,27.3,4.9,28.5),t.lineTo(45.8,53),t.curveTo(46,53.3,46.2,53.5,46.4,53.5),t.lineTo(46.4,27),t.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),t.lineTo(90.8,53.3),t.curveTo(91,53.3,91.2,53.5,91.4,53.5),t.lineTo(91.4,0),t.close(),t.fillAndStroke()}drawCrossIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});return t.begin(),t.moveTo(.38,0),t.lineTo(.62,0),t.lineTo(.62,.38),t.lineTo(1,.38),t.lineTo(1,.62),t.lineTo(.62,.62),t.lineTo(.62,1),t.lineTo(.38,1),t.lineTo(.38,.62),t.lineTo(0,.62),t.lineTo(0,.38),t.lineTo(.38,.38),t.close(),t}paintListIcon(e){const t=this.newBpmnCanvas(e,{height:60,width:60});t.begin(),t.moveTo(0,0),t.lineTo(60,0),t.lineTo(60,60),t.lineTo(0,60),t.lineTo(0,0),t.close(),t.moveTo(5,5),t.lineTo(55,5),t.close(),t.moveTo(5,21.6),t.lineTo(55,21.6),t.close(),t.moveTo(5,38.3),t.lineTo(55,38.3),t.close(),t.moveTo(5,55),t.lineTo(55,55),t.close(),t.fillAndStroke()}paintXCrossIcon(e){const t=this.drawCrossIcon(e);t.rotateOnIconCenter(45),t.fillAndStroke()}paintPlusCrossIcon(e){this.drawCrossIcon(e).fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas(Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!0})}),{height:239.68,width:143.61});t.begin(),t.moveTo(124.31,150.29),t.lineTo(99.66,141.03),t.arcTo(6.43,6.43,0,0,1,95.51,135.03),t.lineTo(95.51,130.66),t.arcTo(47.75,47.75,0,0,0,119.51,89.25),t.lineTo(119.51,71.25),t.arcTo(47.62,47.62,0,0,0,101.18,33.64),t.arcTo(29.35,29.35,0,0,0,101.52,29.14),t.arcTo(29.68,29.68,0,0,0,42.17,29.14),t.arcTo(29.24,29.24,0,0,0,42.53,33.63),t.arcTo(47.65,47.65,0,0,0,24.14,71.23),t.lineTo(24.14,89.23),t.arcTo(47.7,47.7,0,0,0,48.19,130.63),t.lineTo(48.19,135.03),t.arcTo(6.43,6.43,0,0,1,44.03,141.03),t.lineTo(19.31,150.29),t.arcTo(29.81,29.81,0,0,0,.09,178.03),t.lineTo(.09,233.51),t.arcTo(5.63,5.63,0,1,0,11.34,233.51),t.lineTo(11.34,178.03),t.arcTo(18.19,18.19,0,0,1,11.57,175.17),t.lineTo(20.5,184.11),t.arcTo(12.32,12.32,0,0,1,24.14,192.89),t.lineTo(24.14,233.51),t.arcTo(5.63,5.63,0,1,0,35.39,233.51),t.lineTo(35.39,192.93),t.arcTo(23.5,23.5,0,0,0,28.46,176.2),t.lineTo(17.04,164.78),t.arcTo(18.34,18.34,0,0,1,23.29,160.78),t.lineTo(43.65,153.15),t.lineTo(66.22,175.72),t.lineTo(66.22,233.51),t.arcTo(5.63,5.63,0,1,0,77.47,233.51),t.lineTo(77.47,175.76),t.lineTo(100.04,153.19),t.lineTo(120.4,160.82),t.arcTo(18.39,18.39,0,0,1,126.65,164.82),t.lineTo(115.24,176.24),t.arcTo(23.5,23.5,0,0,0,108.31,192.93),t.lineTo(108.31,233.55),t.arcTo(5.63,5.63,0,1,0,119.56,233.55),t.lineTo(119.56,192.93),t.arcTo(12.35,12.35,0,0,1,123.19,184.15),t.lineTo(132.13,175.22),t.arcTo(18,18,0,0,1,132.36,178.08),t.lineTo(132.36,233.56),t.arcTo(5.63,5.63,0,0,0,143.61,233.56),t.lineTo(143.61,178.03),t.arcTo(29.81,29.81,0,0,0,124.31,150.29),t.close(),t.moveTo(71.85,10.72),t.arcTo(18.46,18.46,0,0,1,90.17,27.18),t.arcTo(47.68,47.68,0,0,0,53.53,27.18),t.arcTo(18.44,18.44,0,0,1,71.85,10.72),t.close(),t.moveTo(35.39,71.23),t.arcTo(36.46,36.46,0,0,1,108.31,71.23),t.lineTo(108.31,77.4),t.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),t.arcTo(5.62,5.62,0,0,0,48.78,62.71),t.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),t.close(),t.moveTo(35.39,89.23),t.lineTo(35.39,87.08),t.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),t.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),t.lineTo(108.31,89.24),t.arcTo(36.46,36.46,0,1,1,35.39,89.24),t.close(),t.moveTo(71.85,165.45),t.lineTo(54.06,147.69),t.arcTo(17.7,17.7,0,0,0,59.43,135.32),t.arcTo(47.57,47.57,0,0,0,84.27,135.32),t.arcTo(17.7,17.7,0,0,0,89.64,147.69),t.close(),t.fill()}paintGearIcon(e){const t=this.newBpmnCanvas(e,{height:100,width:100});k.paintGearIconBackground(t),t.translateIconOrigin(14,14),k.paintGearIconForeground(t)}static paintGearIconBackground(e){e.begin(),e.moveTo(2.06,24.62),e.lineTo(10.17,30.95),e.lineTo(9.29,37.73),e.lineTo(0,41.42),e.lineTo(2.95,54.24),e.lineTo(13.41,52.92),e.lineTo(17.39,58.52),e.lineTo(13.56,67.66),e.lineTo(24.47,74.44),e.lineTo(30.81,66.33),e.lineTo(37.88,67.21),e.lineTo(41.57,76.5),e.lineTo(54.24,73.55),e.lineTo(53.06,62.94),e.lineTo(58.52,58.52),e.lineTo(67.21,63.09),e.lineTo(74.58,51.88),e.lineTo(66.03,45.25),e.lineTo(66.92,38.62),e.lineTo(76.5,34.93),e.lineTo(73.7,22.26),e.lineTo(62.64,23.44),e.lineTo(58.81,18.42),e.lineTo(62.79,8.7),e.lineTo(51.74,2.21),e.lineTo(44.81,10.47),e.lineTo(38.03,9.43),e.lineTo(33.75,0),e.lineTo(21.52,3.24),e.lineTo(22.7,13.56),e.lineTo(18.13,17.54),e.lineTo(8.7,13.56),e.close();k.paintGearInnerCircle(e,24.8,39)}static paintGearIconForeground(e){e.begin(),e.moveTo(16.46,41.42),e.lineTo(24.57,47.75),e.lineTo(23.69,54.53),e.lineTo(14.4,58.22),e.lineTo(17.35,71.04),e.lineTo(27.81,69.72),e.lineTo(31.79,75.32),e.lineTo(27.96,84.46),e.lineTo(38.87,91.24),e.lineTo(45.21,83.13),e.lineTo(52.28,84.01),e.lineTo(55.97,93.3),e.lineTo(68.64,90.35),e.lineTo(67.46,79.74),e.lineTo(72.92,75.32),e.lineTo(81.61,79.89),e.lineTo(88.98,68.68),e.lineTo(80.43,62.05),e.lineTo(81.32,55.42),e.lineTo(90.9,51.73),e.lineTo(88.1,39.06),e.lineTo(77.04,40.24),e.lineTo(73.21,35.22),e.lineTo(77.19,25.5),e.lineTo(66.14,19.01),e.lineTo(59.21,27.27),e.lineTo(52.43,26.23),e.lineTo(48.15,16.8),e.lineTo(35.92,20.04),e.lineTo(37.1,30.36),e.lineTo(32.53,34.34),e.lineTo(23.1,30.36),e.close();k.paintGearInnerCircle(e,39.2,55.8),e.begin(),k.paintGearInnerCircle(e,39.2,55.8)}static paintGearInnerCircle(e,t,n){const i=13.5;e.moveTo(t,n),e.arcTo(i,i,0,1,1,t+27,n),e.arcTo(i,i,0,0,1,t,n),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},n=this.newBpmnCanvas(e,t),i=t.width,s=t.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(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const n=this.newBpmnCanvas(e,{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(e){const t={width:16,height:16},n=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:s}=e;i.setFillColor(s.strokeColor);const o=t.width,r=t.height/5;n.rect(0,0,o,r),n.fill(),n.rect(0,2*r,o,r),n.fill(),n.rect(0,4*r,o,r),n.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},n=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:s}=e;i.setFillColor(s.strokeColor);const o=t.width/5,r=t.height;n.begin(),n.rect(0,0,o,r),n.fill(),n.rect(2*o,0,o,r),n.fill(),n.rect(4*o,0,o,r),n.fill()}paintRightArrowIcon(e){const t=this.newBpmnCanvas(e,{width:512,height:415.23});t.setRoundLineJoin(),t.begin(),t.moveTo(512,207.61),t.lineTo(304.38,0),t.lineTo(304.38,135.39),t.lineTo(0,135.39),t.lineTo(0,279.84),t.lineTo(304.38,279.84),t.lineTo(304.38,415.23),t.lineTo(512,207.61),t.close(),t.fillAndStroke()}paintErrorIcon(e){const t=this.newBpmnCanvas(e,{width:72.44,height:71.82});t.begin(),t.moveTo(0,53.32),t.lineTo(19.48,0),t.lineTo(19.48,0),t.lineTo(50.85,40.07),t.lineTo(72.44,18.21),t.lineTo(53.12,71.82),t.lineTo(22.5,31.37),t.close(),t.fillAndStroke()}paintHandIcon(e){const t=this.newBpmnCanvas(e,{width:343.65,height:354.12});t.begin(),t.moveTo(231.66,336.39),t.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),t.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),t.lineTo(146.33,248.39),t.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),t.curveTo(275.75,283.38,297.25,288,301.42,267.77),t.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),t.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),t.lineTo(165.2,194.8),t.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),t.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),t.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),t.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),t.lineTo(169.35,138.97),t.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),t.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),t.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),t.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),t.lineTo(127.61,81.87),t.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),t.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),t.curveTo(143.83,0,124.08,14.49,124.08,14.49),t.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),t.lineTo(0,251.94),t.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),t.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),t.fillAndStroke()}paintScriptIcon(e){e.iconStyleConfig.fillColor=e.iconStyleConfig.strokeColor;const t=this.newBpmnCanvas(e,{width:458.75,height:461.64});t.begin(),t.moveTo(67.85,.57),t.curveTo(50.73,0,33.26,8.86,22.35,18.84),t.curveTo(8.11,32.15,0,50.77,0,70.26),t.curveTo(0,73.15,0,87.59,0,113.6),t.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),t.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),t.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),t.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),t.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),t.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),t.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),t.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),t.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),t.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),t.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),t.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),t.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),t.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),t.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),t.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),t.curveTo(389.09,14.11,366.95,.59,341.75,.59),t.curveTo(286.97,.59,122.63,.57,67.85,.57),t.close(),t.moveTo(85.04,72.68),t.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),t.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),t.curveTo(55.8,44.28,59.84,41,73.82,41),t.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),t.close(),t.moveTo(364.94,52.9),t.curveTo(370,61.11,373.9,76.44,377.38,93.51),t.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),t.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),t.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),t.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),t.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),t.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),t.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),t.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),t.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),t.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),t.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),t.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),t.close(),t.moveTo(409.96,399.48),t.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),t.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),t.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),t.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),t.close(),t.fill(),t.begin(),t.moveTo(182.1,131.2),t.lineTo(182.1,151.68),t.lineTo(321.89,151.68),t.lineTo(321.89,131.2),t.lineTo(182.1,131.2),t.close(),t.moveTo(162.25,251.09),t.lineTo(162.25,271.49),t.lineTo(301.96,271.49),t.lineTo(301.96,251.09),t.lineTo(162.25,251.09),t.close(),t.fill()}paintTableIcon(e){const t=this.newBpmnCanvas(e,{width:640,height:640});t.begin(),t.moveTo(.19,.1),t.lineTo(298.78,.1),t.lineTo(298.78,198.88),t.lineTo(.19,198.88),t.lineTo(.19,.1),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(0,48.88),t.lineTo(98.78,48.88),t.lineTo(98.78,198.88),t.lineTo(0,198.88),t.lineTo(0,48.88),t.close(),t.fillAndStroke(),t.begin(),t.moveTo(1.09,122.69),t.lineTo(298.78,122.69),t.close(),t.fillAndStroke(),t.setFillColor(e.iconStyleConfig.strokeColor),t.begin(),t.moveTo(0,0),t.lineTo(298.78,0),t.lineTo(298.78,48.88),t.lineTo(0,48.88),t.lineTo(0,0),t.close(),t.fillAndStroke()}paintPentagon(e){const t=this.newBpmnCanvas(e,{width:16,height:16});t.begin(),t.moveTo(16,6.5),t.lineTo(8,0),t.lineTo(0,6.5),t.lineTo(3,16),t.lineTo(13,16),t.lineTo(16,6.5),t.lineTo(8,0),t.stroke()}}class G{static get(){return this.instance}static set(e){this.instance=e}}Object.defineProperty(G,"instance",{enumerable:!0,configurable:!0,writable:!0,value:new k});class Y extends N.mxEllipse{constructor(){super(void 0,void 0,void 0),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:G.get()}),Object.defineProperty(this,"iconPainters",{enumerable:!0,configurable:!0,writable:!0,value:new Map([[exports.ShapeBpmnEventDefinitionKind.MESSAGE,e=>this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},e),{ratioFromParent:.5}))],[exports.ShapeBpmnEventDefinitionKind.TERMINATE,e=>this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.6}))],[exports.ShapeBpmnEventDefinitionKind.TIMER,e=>this.iconPainter.paintClockIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(5)}))],[exports.ShapeBpmnEventDefinitionKind.SIGNAL,e=>this.iconPainter.paintTriangleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:exports.StyleDefault.STROKE_WIDTH_THIN.valueOf()}),setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(4)}))],[exports.ShapeBpmnEventDefinitionKind.LINK,e=>this.iconPainter.paintRightArrowIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.ERROR,e=>this.iconPainter.paintErrorIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.COMPENSATION,e=>this.iconPainter.paintDoubleLeftArrowheadsIcon(Object.assign(Object.assign({},e),{ratioFromParent:.7,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))],[exports.ShapeBpmnEventDefinitionKind.CANCEL,e=>this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},e),{ratioFromParent:.78}))],[exports.ShapeBpmnEventDefinitionKind.ESCALATION,e=>this.iconPainter.paintUpArrowheadIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:exports.StyleDefault.STROKE_WIDTH_THIN.valueOf()})}))],[exports.ShapeBpmnEventDefinitionKind.CONDITIONAL,e=>this.iconPainter.paintListIcon(Object.assign(Object.assign({},e),{ratioFromParent:.6,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1.5})}))]])}),Object.defineProperty(this,"withFilledIcon",{enumerable:!0,configurable:!0,writable:!0,value:!1})}paintVertexShape(e,t,n,i,s){const o=j({canvas:e,x:t,y:n,width:i,height:s,shape:this,isFilled:this.withFilledIcon});Y.setDashedOuterShapePattern(o,B.getBpmnIsInterrupting(this.style)),this.paintOuterShape(o),Y.restoreOriginalOuterShapePattern(o),this.paintInnerShape(o)}paintOuterShape({canvas:e,shapeConfig:{x:t,y:n,width:i,height:s}}){super.paintVertexShape(e,t,n,i,s)}paintInnerShape(e){(this.iconPainters.get(B.getBpmnEventDefinitionKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(e)}static setDashedOuterShapePattern(e,t){e.canvas.save(),"false"===t&&(e.canvas.setDashed(!0,!1),e.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(e){e.canvas.restore()}}class V extends Y{constructor(){super(),this.withFilledIcon=!0}}class U extends Y{paintOuterShape({canvas:e,shapeConfig:{x:t,y:n,width:i,height:s,strokeWidth:o}}){e.ellipse(t,n,i,s),e.fillAndStroke();const r=1.5*o;e.ellipse(.02*i+r+t,.02*s+r+n,.96*i-2*r,.96*s-2*r),e.stroke()}}class H extends U{constructor(){super(),this.withFilledIcon=!0}}class W extends N.mxRhombus{constructor(){super(...arguments),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:G.get()})}paintVertexShape(e,t,n,i,s){const o=j({canvas:e,x:t,y:n,width:i,height:s,shape:this});this.paintOuterShape(o),this.paintInnerShape(o)}paintOuterShape({canvas:e,shapeConfig:{x:t,y:n,width:i,height:s}}){super.paintVertexShape(e,t,n,i,s)}}class z extends W{paintInnerShape(e){this.iconPainter.paintXCrossIcon(Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class X extends W{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon(Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!0}),ratioFromParent:.5}))}}class Z extends W{paintInnerShape(e){this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.62,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!1,strokeWidth:exports.StyleDefault.STROKE_WIDTH_THICK.valueOf()})}))}}class q extends W{paintInnerShape(e){e=Object.assign(Object.assign({},e),{iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{strokeWidth:1})}),this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.55})),B.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon(Object.assign(Object.assign({},e),{ratioFromParent:.45}));const t=Object.assign(Object.assign({},e),{ratioFromParent:.3});B.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}const $=[exports.ShapeBpmnMarkerKind.LOOP,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL,exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL,exports.ShapeBpmnMarkerKind.COMPENSATION,exports.ShapeBpmnMarkerKind.EXPAND,exports.ShapeBpmnMarkerKind.ADHOC];function Q(e,t){G.get().paintEnvelopeIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:t})}))}class J extends N.mxRectangleShape{constructor(){super(void 0,void 0,void 0),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:G.get()}),this.isRounded=!0}paintForeground(e,t,n,i,s){super.paintForeground(e,t,n,i,s),this.paintMarkerIcons(j({canvas:e,x:t,y:n,width:i,height:s,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){const t=B.getBpmnMarkers(this.style);t&&function(e){const t=$.filter((t=>e.includes(t)));return e.filter((e=>!t.includes(e))).forEach((e=>t.push(e))),t}(t.split(",")).forEach(((t,n,i)=>{switch((e=Object.assign(Object.assign({},e),{setIconOriginFunct:this.getMarkerIconOriginFunction(i.length,n+1)})).canvas.save(),t){case exports.ShapeBpmnMarkerKind.LOOP:this.iconPainter.paintLoopIcon(e);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(e);break;case exports.ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(e);break;case exports.ShapeBpmnMarkerKind.EXPAND:this.iconPainter.paintExpandIcon(e)}e.canvas.restore()}))}getMarkerIconOriginFunction(e,t){let n;return n=1===e?e=>e.setIconOriginForIconBottomCentered():e=>{e.setIconOriginForIconBottomCentered();const n=Math.pow(-1,t)*(exports.StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+exports.StyleDefault.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);e.translateIconOrigin(n,0)},n}}class ee extends J{paintForeground(e,t,n,i,s){super.paintForeground(e,t,n,i,s),this.paintTaskIcon(j({canvas:e,x:t,y:n,width:i,height:s,shape:this}))}}class te extends ee{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class ne extends ee{paintTaskIcon(e){this.iconPainter.paintGearIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class ie extends ee{paintTaskIcon(e){this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},e),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class se extends ee{paintTaskIcon(e){if(!B.getBpmnIsInstantiating(this.style))return void Q(e,!1);const t=Object.assign(Object.assign({},e.shapeConfig),{width:20,height:20});this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:t,iconStyleConfig:Object.assign(Object.assign({},e.iconStyleConfig),{isFilled:!1}),ratioFromParent:void 0,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeft(4,4)}),t.x+=4,t.y+=4,this.iconPainter.paintEnvelopeIcon(Object.assign(Object.assign({},e),{shapeConfig:t,ratioFromParent:.65,setIconOriginFunct:e=>e.setIconOriginForIconCentered()}))}}class oe extends ee{paintTaskIcon(e){Q(e,!0)}}class re extends ee{paintTaskIcon(e){this.iconPainter.paintHandIcon(Object.assign(Object.assign({},e),{ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class ae extends ee{paintTaskIcon(e){this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},e),{ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}))}}class le extends J{paintForeground(e,t,n,i,s){super.paintForeground(e,t,n,i,s);const o=j({canvas:e,x:t,y:n,width:i,height:s,shape:this});switch(B.getBpmnGlobalTaskKind(this.style)){case exports.ShapeBpmnElementKind.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon(Object.assign(Object.assign({},o),{ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon(Object.assign(Object.assign({},o),{ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon(Object.assign(Object.assign({},o),{setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon(Object.assign(Object.assign({},o),{ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)}));break;case exports.ShapeBpmnElementKind.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class ce extends J{paintBackground(e,t,n,i,s){const o=B.getBpmnSubProcessKind(this.style);e.save(),o===exports.ShapeBpmnSubProcessKind.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,n,i,s),e.restore()}}class ue extends ee{paintTaskIcon(e){this.iconPainter.paintTableIcon(Object.assign(Object.assign({},e),{ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)}))}}class pe extends N.mxRectangleShape{paintForeground(e,t,n,i,s){e.begin(),e.moveTo(t+exports.StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n),e.lineTo(t,n),e.lineTo(t,n+s),e.lineTo(t+exports.StyleDefault.TEXT_ANNOTATION_BORDER_LENGTH,n+s),e.stroke()}paintBackground(e,t,n,i,s){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,n,i,s),e.restore()}}class he extends N.mxRectangleShape{constructor(e,t,n,i){super(e,t,n,i),Object.defineProperty(this,"iconPainter",{enumerable:!0,configurable:!0,writable:!0,value:G.get()})}paintVertexShape(e,t,n,i,s){const o=j({canvas:e,x:t,y:n,width:i,height:s,shape:this,ratioFromParent:1,isFilled:B.getBpmnIsInitiating(this.style)===exports.MessageVisibleKind.NON_INITIATING});this.iconPainter.paintEnvelopeIcon(o)}}function de(e,t){return function(e,t){const n=[],i=e.split(";"),s=i[0].replace(/shape=bpmn./g,""),o=new Map;o.set("bpmn-type-activity",S.isActivity(s)),o.set("bpmn-type-container",S.isPoolOrLane(s)),o.set("bpmn-type-event",S.isEvent(s)),o.set("bpmn-type-flow",function(e){return Object.values(exports.FlowKind).map((e=>e)).includes(e)}(s)),o.set("bpmn-type-gateway",S.isGateway(s)),o.set("bpmn-type-task",S.isTask(s)),[...o].filter((([,e])=>e)).f