From e55650d43d6467a484b15f41d77eb2c4935c8133 Mon Sep 17 00:00:00 2001 From: Process Analytics Bot <62586190+process-analytics-bot@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:59:45 +0200 Subject: [PATCH] chore(deps): bump bpmn-visualization to 0.37.0 (#516) --- demo/draw-path/index.html | 2 +- demo/hacktoberfest-custom-themes/index.html | 2 +- .../assets/elements-identification.js | 6 +++--- demo/load-and-navigation/assets/main.js | 20 +++++++++---------- .../index.html | 2 +- demo/predictions/index.html | 2 +- .../apply-css-classes/index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../index.html | 2 +- .../growing-sequence-flow/index.html | 2 +- .../javascript-tooltip-and-popover/index.html | 2 +- .../running-dashed-message-flow/index.html | 2 +- .../select-elements-by-bpmn-kind/index.html | 2 +- .../custom-colors/index.html | 2 +- .../custom-edge-marker-colors/index.html | 2 +- .../custom-bpmn-theme/custom-fonts/index.html | 2 +- .../custom-user-task-icon/index.html | 2 +- .../diagram-fit-after-load/index.html | 2 +- .../diagram-fit-on-load/index.html | 2 +- .../diagram-navigation/index.html | 2 +- .../load-local-bpmn-diagrams/index.html | 2 +- .../load-remote-bpmn-diagrams/index.html | 2 +- .../pools-filter-on-load/index.html | 2 +- examples/misc/compare-with-bpmn-js/index.html | 2 +- .../index.html | 2 +- examples/overlays/add-remove/index.html | 2 +- examples/overlays/add-stylized/index.html | 2 +- .../custom-overlay-default-style/index.html | 2 +- .../package.json | 2 +- projects/typescript-angular/package.json | 2 +- projects/typescript-lit-element/package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- projects/typescript-vue/package.json | 2 +- 36 files changed, 47 insertions(+), 47 deletions(-) diff --git a/demo/draw-path/index.html b/demo/draw-path/index.html index bae1ef8f..541ce8bd 100644 --- a/demo/draw-path/index.html +++ b/demo/draw-path/index.html @@ -26,7 +26,7 @@ - + diff --git a/demo/hacktoberfest-custom-themes/index.html b/demo/hacktoberfest-custom-themes/index.html index ecf1c271..e14c6083 100644 --- a/demo/hacktoberfest-custom-themes/index.html +++ b/demo/hacktoberfest-custom-themes/index.html @@ -35,7 +35,7 @@ - + diff --git a/demo/load-and-navigation/assets/elements-identification.js b/demo/load-and-navigation/assets/elements-identification.js index 96fd1d1d..e8877635 100644 --- a/demo/load-and-navigation/assets/elements-identification.js +++ b/demo/load-and-navigation/assets/elements-identification.js @@ -1,4 +1,4 @@ -import{d as S,s as w,w as B,u as E,F as C,r as m,e as g,l as c,i as p,j as I,k as b,S as i,m as k,n as T,o as L}from"./main.js";import"./mxgraph.js";let l=[];const d="detection";let u=!0,n=!0;function v(t,o){const e={font:{spacing:{}},fill:{},stroke:{},gradient:{},label:{}};if(i.isTask(o))e.font.color="Indigo",e.fill.color="gold",e.font.size=14,e.fill.opacity=20;else if(i.isEvent(o))e.font.color="MediumTurquoise",e.stroke.color="MediumTurquoise";else if(i.isGateway(o))e.font.color="CadetBlue",e.font.opacity=85,e.stroke.color="OrangeRed",e.stroke.width=4;else if(i.isPoolOrLane(o))e.font.color="white !important",e.fill.color="deeppink",e.stroke.opacity=80;else if(i.isCallActivity(o))e.font.color="white",e.font.family="Times New Roman",e.font.isItalic=!0,e.font.isStrikeThrough=!0,e.fill.color="LimeGreen";else if(i.isSubProcess(o))e.font.color="white",e.font.size=14,e.font.family="Dialog",e.font.isBold=!0,e.font.isItalic=!0,e.font.isUnderline=!0,e.font.isStrikeThrough=!0,e.fill.color="MidnightBlue",e.opacity=60;else switch(o){case"group":case"textAnnotation":e.font.color="Crimson",e.font.size=18,e.font.family="Verdana",e.font.isBold=!0,e.font.isUnderline=!0,e.stroke.color="Chartreuse",e.stroke.width=6;break;case"messageFlow":case"sequenceFlow":case"association":e.font.color="Chocolate",e.stroke.color="Chocolate",e.stroke.width=4;break}k(t,e)}function h(){k(l,{font:{color:"default",size:10,family:"Arial",isBold:!1,isItalic:!1,isUnderline:!1,isStrikeThrough:!1,opacity:"default"},fill:{color:"default",opacity:"default"},stroke:{color:"default",opacity:"default",width:"default"},opacity:"default"})}function y(t,o){c(`Searching for Bpmn elements of '${o}' kind`);const e=T(o),a=`Found ${e.length} ${o}(s)`;c(a);const r=e.map(s=>` - ${s.bpmnSemantic.id}: '${s.bpmnSemantic.name}'`).join(` -`);t.value+=[a,r].join(` +import{d as v,s as S,w as E,u as w,F as B,r as m,e as h,l as c,i as p,j as C,k as I,S as i,m as b,n as L,o as O,p as T}from"./main.js";import"./mxgraph.js";let l=[];const d="detection";let f=!0,n=!0;function k(o,t){const e={font:{spacing:{}},fill:{},stroke:{},gradient:{},label:{}};if(i.isTask(t))e.font.color="Indigo",e.fill.color="gold",e.font.size=14,e.fill.opacity=20;else if(i.isEvent(t))e.font.color="MediumTurquoise",e.stroke.color="MediumTurquoise";else if(i.isGateway(t))e.font.color="CadetBlue",e.font.opacity=85,e.stroke.color="OrangeRed",e.stroke.width=4;else if(i.isPoolOrLane(t))e.font.color="white !important",e.fill.color="deeppink",e.stroke.opacity=80;else if(i.isCallActivity(t))e.font.color="white",e.font.family="Times New Roman",e.font.isItalic=!0,e.font.isStrikeThrough=!0,e.fill.color="LimeGreen";else if(i.isSubProcess(t))e.font.color="white",e.font.size=14,e.font.family="Dialog",e.font.isBold=!0,e.font.isItalic=!0,e.font.isUnderline=!0,e.font.isStrikeThrough=!0,e.fill.color="MidnightBlue",e.opacity=60;else switch(t){case"group":case"textAnnotation":e.font.color="Crimson",e.font.size=18,e.font.family="Verdana",e.font.isBold=!0,e.font.isUnderline=!0,e.stroke.color="Chartreuse",e.stroke.width=6;break;case"messageFlow":case"sequenceFlow":case"association":e.font.color="Chocolate",e.stroke.color="Chocolate",e.stroke.width=4;break}b(o,e)}function g(){L(l)}function y(o,t){c(`Searching for Bpmn elements of '${t}' kind`);const e=O(t),a=`Found ${e.length} ${t}(s)`;c(a);const r=e.map(s=>` - ${s.bpmnSemantic.id}: '${s.bpmnSemantic.name}'`).join(` +`);o.value+=[a,r].join(` `)+` -`,t.scrollTop=t.scrollHeight;const f=e.map(s=>s.bpmnSemantic.id);n?(m(l,d),p(f,d)):(h(),v(f,o)),l.forEach(s=>g(s)),u?f.forEach(s=>L(s,P(o))):c("Do not display overlays"),l=f}function O(){const t=document.getElementById("elements-result"),o=document.getElementById("bpmn-kinds-select");o.onchange=r=>y(t,r.target.value),document.addEventListener("diagramLoaded",()=>y(t,o.value),!1),document.getElementById("clear-btn").onclick=function(){t.value="",n?m(l,d):h(),l.forEach(r=>g(r)),l=[]};const e=document.getElementById("checkbox-display-overlays");e.addEventListener("change",function(){u=this.checked,c("Request overlays display:",u),y(t,o.value)}),e.checked=u;const a=document.getElementById("checkbox-css-style");a.addEventListener("change",function(){n=this.checked,c("Request CSS style feature:",n),n?(h(),p(l,d)):(m(l,d),v(l,o.value))}),a.checked=n}function P(t){return i.isActivity(t)?{position:"top-right",label:"30",style:{font:{color:"Chartreuse",size:20},fill:{color:"DimGray"}}}:t.includes("Gateway")?{position:"top-left",label:"3",style:{stroke:{color:"HotPink",width:4}}}:t.includes("Event")?{position:"bottom-left",label:"15"}:t.includes("lane")||t.includes("pool")?{position:"bottom-right",label:"100"}:t.includes("Flow")?{position:"middle",label:"999",style:{fill:{color:"PaleTurquoise",opacity:25}}}:{position:"top-left",label:"40"}}function q(){document.getElementById("btn-dl-svg").addEventListener("click",I,!1),document.getElementById("btn-dl-png").addEventListener("click",b,!1)}S(()=>{w({globalOptions:{container:document.querySelector(".bpmn-container"),navigation:{enabled:!0}},statusKoNotifier:B}),E({type:C.Center,margin:20}),O(),q()}); +`,o.scrollTop=o.scrollHeight;const u=e.map(s=>s.bpmnSemantic.id);n?(m(l,d),p(u,d)):(g(),k(u,t)),l.forEach(s=>h(s)),f?u.forEach(s=>T(s,q(t))):c("Do not display overlays"),l=u}function P(){const o=document.getElementById("elements-result"),t=document.getElementById("bpmn-kinds-select");t.onchange=r=>y(o,r.target.value),document.addEventListener("diagramLoaded",()=>y(o,t.value),!1),document.getElementById("clear-btn").onclick=function(){o.value="",n?m(l,d):g(),l.forEach(r=>h(r)),l=[]};const e=document.getElementById("checkbox-display-overlays");e.addEventListener("change",function(){f=this.checked,c("Request overlays display:",f),y(o,t.value)}),e.checked=f;const a=document.getElementById("checkbox-css-style");a.addEventListener("change",function(){n=this.checked,c("Request CSS style feature:",n),n?(g(),p(l,d)):(m(l,d),k(l,t.value))}),a.checked=n}function q(o){return i.isActivity(o)?{position:"top-right",label:"30",style:{font:{color:"Chartreuse",size:20},fill:{color:"DimGray"}}}:o.includes("Gateway")?{position:"top-left",label:"3",style:{stroke:{color:"HotPink",width:4}}}:o.includes("Event")?{position:"bottom-left",label:"15"}:o.includes("lane")||o.includes("pool")?{position:"bottom-right",label:"100"}:o.includes("Flow")?{position:"middle",label:"999",style:{fill:{color:"PaleTurquoise",opacity:25}}}:{position:"top-left",label:"40"}}function A(){document.getElementById("btn-dl-svg").addEventListener("click",C,!1),document.getElementById("btn-dl-png").addEventListener("click",I,!1)}v(()=>{S({globalOptions:{container:document.querySelector(".bpmn-container"),navigation:{enabled:!0}},statusKoNotifier:E}),w({type:B.Center,margin:20}),P(),A()}); diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js index 64513906..91237076 100644 --- a/demo/load-and-navigation/assets/main.js +++ b/demo/load-and-navigation/assets/main.js @@ -1,11 +1,11 @@ -var Yt=Object.defineProperty;var Ut=(n,e,t)=>e in n?Yt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(Ut(n,typeof e!="symbol"?e+"":e,t),t);import{f as Wt}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var ne=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(ne||{}),Dt=(n=>(n.In="in",n.Out="out",n))(Dt||{}),d=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(d||{}),se=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(se||{}),ie=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(ie||{}),_=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(_||{}),v=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(v||{}),B=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(B||{});function Ht(n,e){return n===""?e?{}:void 0:n}function m(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>Ht(t,e)).filter(Boolean)}function Kt(n,e,t){let s="";return t!=null&&t.startingWith?s=s.concat(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&(s=s.concat(`^(?!(${t.notStartingWith})).*`)),s=s.concat(`${e}$`),n.filter(i=>t!=null&&t.ignoreCase?new RegExp(s,"i").test(i):new RegExp(s).test(i))}class S{static isEvent(e){return ue(ze,e)}static eventKinds(){return[...ze]}static isBoundaryEvent(e){return d.EVENT_BOUNDARY===e}static isStartEvent(e){return d.EVENT_START===e}static isCallActivity(e){return d.CALL_ACTIVITY===e}static isSubProcess(e){return d.SUB_PROCESS===e}static canHaveNoneEvent(e){return d.EVENT_INTERMEDIATE_THROW===e||d.EVENT_END===e||d.EVENT_START===e}static isActivity(e){return ue(_e,e)}static activityKinds(){return[..._e]}static isWithDefaultSequenceFlow(e){return zt.includes(e)}static isTask(e){return ue(ve,e)}static taskKinds(){return[...ve]}static gatewayKinds(){return[...Xe]}static isGateway(e){return ue(Xe,e)}static flowNodeKinds(){return Object.values(d).filter(e=>!S.isPoolOrLane(e))}static isPoolOrLane(e){return e==d.POOL||e==d.LANE}}function Fe(n,e){return Kt(Object.values(d),n,e)}function ue(n,e){return Object.values(n).map(t=>t).includes(e)}const ze=Fe("Event"),Xe=Fe("Gateway"),ve=Fe("Task",{ignoreCase:!0,notStartingWith:"global"}),_e=[...ve,d.CALL_ACTIVITY,d.SUB_PROCESS],zt=[..._e,d.GATEWAY_EXCLUSIVE,d.GATEWAY_INCLUSIVE,d.GATEWAY_COMPLEX],lt=Object.values(_).filter(n=>n!=_.NONE);var H=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(H||{}),x=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(x||{}),ae=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(ae||{}),P=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(P||{});const l=Xt();function Xt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",Wt({})}const C={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},ct={ARROW_DASH:"bpmn.dash"},E={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_FROM_CENTER_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},ut=n=>l.mxUtils.getValue(n,C.IS_INSTANTIATING,"false")=="true",$e=12;class dt{constructor(e){g(this,"specificFlowStyles",new Oe([[x.SEQUENCE_FLOW,e=>{e[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_BLOCK_THIN}],[x.MESSAGE_FLOW,e=>{e[l.mxConstants.STYLE_DASHED]=!0,e[l.mxConstants.STYLE_DASH_PATTERN]="8 5",e[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_OVAL,e[l.mxConstants.STYLE_STARTSIZE]=8,e[l.mxConstants.STYLE_STARTFILL]=!0,e[C.EDGE_START_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_BLOCK_THIN,e[l.mxConstants.STYLE_ENDFILL]=!0,e[C.EDGE_END_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[x.ASSOCIATION_FLOW,e=>{e[l.mxConstants.STYLE_DASHED]=!0,e[l.mxConstants.STYLE_DASH_PATTERN]="1 2",e[l.mxConstants.STYLE_STARTSIZE]=$e}]]));g(this,"specificSequenceFlowStyles",new Oe([[P.DEFAULT,e=>{e[l.mxConstants.STYLE_STARTARROW]=ct.ARROW_DASH}],[P.CONDITIONAL_FROM_ACTIVITY,e=>{e[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_DIAMOND_THIN,e[l.mxConstants.STYLE_STARTSIZE]=18,e[l.mxConstants.STYLE_STARTFILL]=!0,e[C.EDGE_START_FILL_COLOR]=E.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new Oe([[H.NONE,e=>{}],[H.ONE,e=>{e[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_OPEN_THIN}],[H.BOTH,e=>{e[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_OPEN_THIN,e[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_OPEN_THIN}]]));this.graph=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(){const e=this.getStylesheet().getDefaultVertexStyle();Ze(e),e[l.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[l.mxConstants.STYLE_ARCSIZE]=E.SHAPE_ARC_SIZE}configurePoolStyle(){const e={};e[l.mxConstants.STYLE_SHAPE]=l.mxConstants.SHAPE_SWIMLANE,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,e[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,e[l.mxConstants.STYLE_STARTSIZE]=E.POOL_LABEL_SIZE,e[l.mxConstants.STYLE_FILLCOLOR]=E.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.POOL,e)}configureLaneStyle(){const e={};e[l.mxConstants.STYLE_SHAPE]=l.mxConstants.SHAPE_SWIMLANE,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,e[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,e[l.mxConstants.STYLE_SWIMLANE_LINE]=0,e[l.mxConstants.STYLE_STARTSIZE]=E.LANE_LABEL_SIZE,e[l.mxConstants.STYLE_FILLCOLOR]=E.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(d.LANE,e)}configureEventStyles(){S.eventKinds().forEach(e=>{const t={};t[l.mxConstants.STYLE_SHAPE]=e,t[l.mxConstants.STYLE_PERIMETER]=l.mxPerimeter.EllipsePerimeter,t[l.mxConstants.STYLE_STROKEWIDTH]=e==d.EVENT_END?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,t[l.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=l.mxConstants.ALIGN_BOTTOM,this.putCellStyle(e,t)})}configureTextAnnotationStyle(){const e={};e[l.mxConstants.STYLE_SHAPE]=d.TEXT_ANNOTATION,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,e[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_LEFT,e[l.mxConstants.STYLE_SPACING_LEFT]=5,e[l.mxConstants.STYLE_FILLCOLOR]=E.TEXT_ANNOTATION_FILL_COLOR,e[l.mxConstants.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,this.putCellStyle(d.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[l.mxConstants.STYLE_ROUNDED]=!0,e[l.mxConstants.STYLE_DASHED]=!0,e[l.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",e[l.mxConstants.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,e[l.mxConstants.STYLE_FILLCOLOR]=E.GROUP_FILL_COLOR,e[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_TOP,this.putCellStyle(d.GROUP,e)}configureActivityStyles(){S.activityKinds().forEach(e=>{const t={};t[l.mxConstants.STYLE_SHAPE]=e,t[l.mxConstants.STYLE_ROUNDED]=!0,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_STROKEWIDTH]=e==d.CALL_ACTIVITY?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,this.putCellStyle(e,t)})}configureGatewayStyles(){S.gatewayKinds().forEach(e=>{const t={};t[l.mxConstants.STYLE_SHAPE]=e,t[l.mxConstants.STYLE_PERIMETER]=l.mxPerimeter.RhombusPerimeter,t[l.mxConstants.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_TOP,t[l.mxConstants.STYLE_LABEL_POSITION]=l.mxConstants.ALIGN_LEFT,t[l.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=l.mxConstants.ALIGN_TOP,this.putCellStyle(e,t)})}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();Ze(e),e[l.mxConstants.STYLE_SHAPE]=C.EDGE,e[l.mxConstants.STYLE_ENDSIZE]=$e,e[l.mxConstants.STYLE_STROKEWIDTH]=1.5,e[l.mxConstants.STYLE_ROUNDED]=!0,e[l.mxConstants.STYLE_ARCSIZE]=5,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_BOTTOM,delete e[l.mxConstants.STYLE_ENDARROW]}configureEdgeStyles(e,t){e.forEach(s=>{const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)})}configureFlowStyles(){this.configureEdgeStyles(Object.values(x),this.specificFlowStyles),this.configureEdgeStyles(Object.values(P),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(H),this.specificAssociationFlowStyles)}}function Ze(n){n[l.mxConstants.STYLE_FONTFAMILY]=E.DEFAULT_FONT_FAMILY,n[l.mxConstants.STYLE_FONTSIZE]=E.DEFAULT_FONT_SIZE,n[l.mxConstants.STYLE_FONTCOLOR]=E.DEFAULT_FONT_COLOR,n[l.mxConstants.STYLE_FILLCOLOR]=E.DEFAULT_FILL_COLOR,n[l.mxConstants.STYLE_STROKECOLOR]=E.DEFAULT_STROKE_COLOR,n[l.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=l.mxConstants.NONE,n[l.mxConstants.STYLE_WHITE_SPACE]="wrap"}class Oe extends Map{get(e){return super.get(e)??(()=>{})}}function $t(n,e,t,s){let i,o;n.heightT.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:a,fillColor:h,strokeColor:f,strokeWidth:c,margin:p}}}class W{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new Zt({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),e.iconStyleConfig.isFilled?s.fillAndStroke():s.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()}paintAsteriskIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});Ne(e,t),t.fillAndStroke(),Ne(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),Ne(e,t),t.rotateOnIconCenter(240),t.fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas({...e,iconStyleConfig:{...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});W.paintGearIconBackground(t),t.translateIconOrigin(14,14),W.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();const t=24.8,s=39;W.paintGearInnerCircle(e,t,s)}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();const t=39.2,s=55.8;W.paintGearInnerCircle(e,t,s),e.begin(),W.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/2),s.close(),s.fillAndStroke()}paintLoopIcon(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const s=this.newBpmnCanvas(e,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width,a=t.height/5;s.rect(0,0,r,a),s.fill(),s.rect(0,2*a,r,a),s.fill(),s.rect(0,4*a,r,a),s.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width/5,a=t.height;s.begin(),s.rect(0,0,r,a),s.fill(),s.rect(2*r,0,r,a),s.fill(),s.rect(4*r,0,r,a),s.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()}}function Ne(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class j{static get(){return this.instance}static set(e){this.instance=e}}g(j,"instance",new W);class X extends l.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",j.get());g(this,"iconPainters",new Map([[_.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[_.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[_.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[_.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[_.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[_.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[_.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[_.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[_.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()}})],[_.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const a=Z({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});X.setDashedOuterShapePattern(a,l.mxUtils.getValue(this.style,C.IS_INTERRUPTING,void 0)),this.paintOuterShape(a),X.restoreOriginalOuterShapePattern(a),this.paintInnerShape(a)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(l.mxUtils.getValue(this.style,C.EVENT_DEFINITION_KIND,_.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class jt extends X{constructor(){super(),this.withFilledIcon=!0}}class ye extends X{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const a=r*1.5;e.ellipse(i*.02+a+t,o*.02+a+s,i*.96-2*a,o*.96-2*a),e.stroke()}}class qt extends ye{constructor(){super(),this.withFilledIcon=!0}}class le extends l.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",j.get())}paintVertexShape(t,s,i,o,r){const a=Z({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(a),this.paintInnerShape(a)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class Qt extends le{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Jt extends le{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class en extends le{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:E.STROKE_WIDTH_THICK.valueOf()}})}}class tn extends le{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class nn extends le{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),ut(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};l.mxUtils.getValue(this.style,C.EVENT_BASED_GATEWAY_KIND,ie.Exclusive)==ie.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}const sn=[v.LOOP,v.MULTI_INSTANCE_PARALLEL,v.MULTI_INSTANCE_SEQUENTIAL,v.COMPENSATION,v.EXPAND,v.ADHOC];function on(n){const e=sn.filter(t=>n.includes(t));return n.filter(t=>!e.includes(t)).forEach(t=>e.push(t)),e}function ht(n,e){j.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class Pe extends l.mxRectangleShape{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",j.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(Z({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=l.mxUtils.getValue(this.style,C.MARKERS,void 0);s&&on(s.split(",")).forEach((i,o,r)=>{switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(r.length,o+1)},t.canvas.save(),i){case v.LOOP:this.iconPainter.paintLoopIcon(t);break;case v.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case v.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case v.EXPAND:this.iconPainter.paintExpandIcon(t);break}t.canvas.restore()})}getMarkerIconOriginFunction(t,s){let i;return t===1?i=o=>o.setIconOriginForIconBottomCentered():i=o=>{o.setIconOriginForIconBottomCentered();const r=Math.pow(-1,s)*(E.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+E.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);o.translateIconOrigin(r,0)},i}}class V extends Pe{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(Z({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class rn extends V{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class an extends V{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class ln extends V{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class cn extends V{paintTaskIcon(e){if(!ut(this.style)){ht(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class un extends V{paintTaskIcon(e){ht(e,!0)}}class dn extends V{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class hn extends V{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class fn extends Pe{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=Z({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(l.mxUtils.getValue(this.style,C.GLOBAL_TASK_KIND,void 0)){case d.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(20)});break;case d.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(15)});break;case d.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class gn extends Pe{paintBackground(e,t,s,i,o){const r=l.mxUtils.getValue(this.style,C.SUB_PROCESS_KIND,void 0);if(e.save(),r===B.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===B.TRANSACTION){const a=E.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,c=E.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+a,s+a,i-2*a,o-2*a,c,c),e.stroke()}e.restore()}}class Tn extends V{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class pn extends l.mxRectangleShape{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class En extends l.mxRectangleShape{constructor(t,s,i,o){super(t,s,i,o);g(this,"iconPainter",j.get())}paintVertexShape(t,s,i,o,r){const a=Z({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:l.mxUtils.getValue(this.style,C.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(a)}}function mn(n,e){return Cn(n.style,e)}function Cn(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",S.isActivity(o)),r.set("bpmn-type-container",S.isPoolOrLane(o)),r.set("bpmn-type-event",S.isEvent(o)),r.set("bpmn-type-flow",Sn(o)),r.set("bpmn-type-gateway",S.isGateway(o)),r.set("bpmn-type-task",S.isTask(o)),[...r].filter(([,a])=>a).forEach(([a])=>t.push(a)),t.push(we(o)),s.map(a=>{const c=a.split("=");return[c[0],c[1]]}).forEach(([a,c])=>{switch(a){case C.EVENT_DEFINITION_KIND:t.push(`bpmn-event-def-${c}`);break;case C.EVENT_BASED_GATEWAY_KIND:t.push(`bpmn-gateway-kind-${c.toLowerCase()}`);break;case C.IS_INITIATING:t.push(c=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break;case C.SUB_PROCESS_KIND:t.push(`bpmn-sub-process-${c.toLowerCase()}`);break;case C.GLOBAL_TASK_KIND:t.push(we(c));break}}),e&&t.push("bpmn-label"),t}function Sn(n){return Object.values(x).map(e=>e).includes(n)}function we(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}class ft extends l.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,a=0;return s?o=this.computeEdgeBounds(t):(o=new l.mxPoint,this.align==l.mxConstants.ALIGN_LEFT?o.x=t.x:this.align==l.mxConstants.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==l.mxConstants.ALIGN_TOP?o.y=t.y:this.verticalAlign==l.mxConstants.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new l.mxRectangle(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(a*this.defaultOverlap-this.offset.y)*i),r*i,a*i)}computeEdgeBounds(t){const s=t.absolutePoints;if(this.align==l.mxConstants.ALIGN_LEFT)return s[0];if(this.align==l.mxConstants.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const i=s.length/2,o=s[i-1],r=s[i];return new l.mxPoint(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s[s.length-1]}}class je extends l.mxText{constructor(e,t,s){super(e,t,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}class In extends l.mxConnector{constructor(e,t,s){super(e,t,s)}paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(l.mxUtils.getValue(this.style,C.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(l.mxUtils.getValue(this.style,C.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=An(e);qe(e,"stroke"),this.paintLine(e,t,this.isRounded),qe(e,s)}}function An(n){return n instanceof l.mxSvgCanvas2D?n.pointerEventsValue:null}function qe(n,e){n instanceof l.mxSvgCanvas2D&&(n.pointerEventsValue=e)}class On{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){l.mxCellRenderer.registerShape(d.EVENT_END,jt),l.mxCellRenderer.registerShape(d.EVENT_START,X),l.mxCellRenderer.registerShape(d.EVENT_INTERMEDIATE_THROW,qt),l.mxCellRenderer.registerShape(d.EVENT_INTERMEDIATE_CATCH,ye),l.mxCellRenderer.registerShape(d.EVENT_BOUNDARY,ye),l.mxCellRenderer.registerShape(d.GATEWAY_COMPLEX,tn),l.mxCellRenderer.registerShape(d.GATEWAY_EVENT_BASED,nn),l.mxCellRenderer.registerShape(d.GATEWAY_EXCLUSIVE,Qt),l.mxCellRenderer.registerShape(d.GATEWAY_INCLUSIVE,en),l.mxCellRenderer.registerShape(d.GATEWAY_PARALLEL,Jt),l.mxCellRenderer.registerShape(d.SUB_PROCESS,gn),l.mxCellRenderer.registerShape(d.CALL_ACTIVITY,fn),l.mxCellRenderer.registerShape(d.TASK,rn),l.mxCellRenderer.registerShape(d.TASK_SERVICE,an),l.mxCellRenderer.registerShape(d.TASK_USER,ln),l.mxCellRenderer.registerShape(d.TASK_RECEIVE,cn),l.mxCellRenderer.registerShape(d.TASK_SEND,un),l.mxCellRenderer.registerShape(d.TASK_MANUAL,dn),l.mxCellRenderer.registerShape(d.TASK_SCRIPT,hn),l.mxCellRenderer.registerShape(d.TASK_BUSINESS_RULE,Tn),l.mxCellRenderer.registerShape(d.TEXT_ANNOTATION,pn),l.mxCellRenderer.registerShape(C.EDGE,In),l.mxCellRenderer.registerShape(C.MESSAGE_FLOW_ICON,En)}initMxSvgCanvasPrototype(){l.mxSvgCanvas2D.prototype.getTextCss=function(){const e=this.state,t=l.mxConstants.ABSOLUTE_LINE_HEIGHT?e.fontSize*l.mxConstants.LINE_HEIGHT+"px":l.mxConstants.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&l.mxConstants.FONT_BOLD)==l.mxConstants.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&l.mxConstants.FONT_ITALIC)==l.mxConstants.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&l.mxConstants.FONT_UNDERLINE)==l.mxConstants.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&l.mxConstants.FONT_STRIKETHROUGH)==l.mxConstants.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){l.mxShape.prototype.createSvgCanvas=function(){var s;const e=new l.mxSvgCanvas2D(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t!=0?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform"),(s=this.state)!=null&&s.cell){const i=this.state.cell;let o=mn(i,this.dialect===l.mxConstants.DIALECT_STRICTHTML);const r=this.state.style[C.EXTRA_CSS_CLASSES];typeof r=="string"&&(o=o.concat(r.split(","))),this.node.setAttribute("class",o.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}initMxCellRendererCreateCellOverlays(){l.mxCellRenderer.prototype.createCellOverlays=function(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new l.mxDictionary;for(const o of s){const r=e.overlays!=null?e.overlays.remove(o):null;if(r!=null){i.put(o,r);continue}let a;o instanceof ft?a=new je(o.label,new l.mxRectangle(0,0,0,0),o.style):(a=new l.mxImageShape(new l.mxRectangle(0,0,0,0),o.image.src),a.preserveImageAspect=!1),a.dialect=e.view.graph.dialect,a.overlay=o,this.initializeOverlay(e,a),this.installCellOverlayListeners(e,o,a),o.cursor!=null&&(a.node.style.cursor=o.cursor),a instanceof je&&(a.node.classList.add("overlay-badge"),a.node.setAttribute("data-bpmn-id",e.cell.id)),i.put(o,a)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}}class Nn{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,a,c,u,h)=>{const f=r*(c+h+4),p=a*(c+h+4);return function(){t.begin(),t.moveTo(o.x-f/2-p/2,o.y-p/2+f/2),t.lineTo(o.x+p/2-3*f/2,o.y-3*p/2-f/2),t.stroke()}};l.mxMarker.addMarker(ct.ARROW_DASH,e)}}function fe(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function Ln(n){return Math.max(n||0,0)}function vn(n){const e=n??{};return e.debounceDelay=fe(e.debounceDelay,0,100,50),e.throttleDelay=fe(e.throttleDelay,0,100,50),e}function Ce(n){return n=="default"?void 0:fe(n,0,100,100)}function _n(n){return n=="default"?void 0:fe(n,1,50,1)}var yn=typeof global=="object"&&global&&global.Object===Object&&global;const wn=yn;var Rn=typeof self=="object"&&self&&self.Object===Object&&self,xn=wn||Rn||Function("return this")();const gt=xn;var bn=gt.Symbol;const ge=bn;var Tt=Object.prototype,Fn=Tt.hasOwnProperty,Pn=Tt.toString,J=ge?ge.toStringTag:void 0;function kn(n){var e=Fn.call(n,J),t=n[J];try{n[J]=void 0;var s=!0}catch{}var i=Pn.call(n);return s&&(e?n[J]=t:delete n[J]),i}var Mn=Object.prototype,Bn=Mn.toString;function Gn(n){return Bn.call(n)}var Vn="[object Null]",Yn="[object Undefined]",Qe=ge?ge.toStringTag:void 0;function Un(n){return n==null?n===void 0?Yn:Vn:Qe&&Qe in Object(n)?kn(n):Gn(n)}function Wn(n){return n!=null&&typeof n=="object"}var Dn="[object Symbol]";function Hn(n){return typeof n=="symbol"||Wn(n)&&Un(n)==Dn}var Kn=/\s/;function zn(n){for(var e=n.length;e--&&Kn.test(n.charAt(e)););return e}var Xn=/^\s+/;function $n(n){return n&&n.slice(0,zn(n)+1).replace(Xn,"")}function Te(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var Je=0/0,Zn=/^[-+]0x[0-9a-f]+$/i,jn=/^0b[01]+$/i,qn=/^0o[0-7]+$/i,Qn=parseInt;function et(n){if(typeof n=="number")return n;if(Hn(n))return Je;if(Te(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Te(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=$n(n);var t=jn.test(n);return t||qn.test(n)?Qn(n.slice(2),t?2:8):Zn.test(n)?Je:+n}var Jn=function(){return gt.Date.now()};const Le=Jn;var es="Expected a function",ts=Math.max,ns=Math.min;function pt(n,e,t){var s,i,o,r,a,c,u=0,h=!1,f=!1,p=!0;if(typeof n!="function")throw new TypeError(es);e=et(e)||0,Te(t)&&(h=!!t.leading,f="maxWait"in t,o=f?ts(et(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function T(L){var M=s,Q=i;return s=i=void 0,u=L,r=n.apply(Q,M),r}function I(L){return u=L,a=setTimeout(ce,e),h?T(L):r}function b(L){var M=L-c,Q=L-u,Ke=e-M;return f?ns(Ke,o-Q):Ke}function U(L){var M=L-c,Q=L-u;return c===void 0||M>=e||M<0||f&&Q>=o}function ce(){var L=Le();if(U(L))return He(L);a=setTimeout(ce,b(L))}function He(L){return a=void 0,p&&s?T(L):(s=i=void 0,r)}function Gt(){a!==void 0&&clearTimeout(a),u=0,s=c=i=a=void 0}function Vt(){return a===void 0?r:He(Le())}function Ae(){var L=Le(),M=U(L);if(s=arguments,i=this,c=L,M){if(a===void 0)return I(c);if(f)return clearTimeout(a),a=setTimeout(ce,e),T(c)}return a===void 0&&(a=setTimeout(ce,e)),r}return Ae.cancel=Gt,Ae.flush=Vt,Ae}var ss="Expected a function";function is(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(ss);return Te(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),pt(n,e,{leading:s,maxWait:e,trailing:i})}const Re=1.25,os=1/Re;class rs extends l.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Re,this.container&&(this.container.style.cursor="default")}createGraphView(){return new as(this)}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,a,c){const u=super.fit(t,s,i,o,r,a,c);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==ne.None)return;const i=Ln(t==null?void 0:t.margin);if(s!=ne.Center){let o=!1,r=!1;switch(s){case ne.Horizontal:r=!0;break;case ne.Vertical:o=!0;break}this.fit(this.border,!1,i,!0,o,r)}else{const r=this.getGraphBounds(),a=this.container.clientWidth-i,c=this.container.clientHeight-i,u=r.width/this.view.scale,h=r.height/this.view.scale,f=Math.min(3,Math.min(a/u,c/h));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+a-u*f)/(2*f)-r.x/this.view.scale,(i+c-h*f)/(2*f)-r.y/this.view.scale)}}registerMouseWheelZoomListeners(t){t=vn(t),l.mxEvent.addMouseWheelListener(pt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),l.mxEvent.addMouseWheelListener(is(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(!i)this.currentZoomLevel*=t?Re:os;else{const[o,r]=this.getEventRelativeCoordinates(s),[a,c,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(a,this.view.translate.x+c,this.view.translate.y+u),l.mxEvent.consume(s)}}createMouseWheelZoomListener(t){return(s,i)=>{if(l.mxEvent.isConsumed(s))return;const o=s;o.ctrlKey&&!o.altKey&&!o.shiftKey&&!o.metaKey&&this.manageMouseWheelZoomEvent(i,o,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,a]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,a]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class as extends l.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const a=e.absolutePoints;return i?a[1]:a[a.length-2]}}class ls{constructor(e){g(this,"graph");this.container=e,this.graph=new rs(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new dt(this.graph).configureStyles(),new On().configureShapes(),new Nn().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(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(l.mxEvent.PAN_START,this.getPanningHandler("grab")),t.addListener(l.mxEvent.PAN_END,this.getPanningHandler("default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>l.mxEvent.isLeftMouseButton(i.getEvent())||l.mxEvent.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}getPanningHandler(e){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=e)}}}class Se{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceRefId=i,this.targetRefId=o}}class Et extends Se{constructor(e,t,s,i,o=P.NORMAL){super(e,t,x.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class mt extends Se{constructor(e,t,s,i){super(e,t,x.MESSAGE_FLOW,s,i)}}class Ct extends Se{constructor(e,t,s,i,o=H.NONE){super(e,t,x.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}class cs{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new l.mxPoint(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new l.mxPoint(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t[t.length-1];if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new l.mxPoint(s.x+o/2,s.y+r/2)}}}class he{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class k{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class Ie extends k{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class oe extends Ie{constructor(e,t,s,i,o,r){super(e,t,d.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class pe extends Ie{constructor(e,t,s,i,o){s==B.AD_HOC&&!o.includes(v.ADHOC)&&o.push(v.ADHOC),super(e,t,d.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class re extends k{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class St extends re{constructor(e,t,s,i,o){super(e,t,d.EVENT_START,s,i),this.isInterrupting=o}}class It extends re{constructor(e,t,s,i,o=!0){super(e,t,d.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class At extends k{constructor(e,t,s,i,o=ie.None){super(e,t,d.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}class K{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof he?i=this.computeShapeStyleValues(e):(s.push(...K.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=K.computeLabelStyleValues(e,t);return s.concat(tt([...i,...o,...r])).join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof re?K.computeEventShapeStyle(s,t):s instanceof Ie?K.computeActivityShapeStyle(s,t):S.isPoolOrLane(s.kind)?t.set(l.mxConstants.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof At&&(t.set(C.IS_INSTANTIATING,String(s.instantiate)),t.set(C.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(l.mxConstants.STYLE_FILLCOLOR,o),S.isPoolOrLane(s.kind)&&t.set(l.mxConstants.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(l.mxConstants.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(C.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof It||e instanceof St&&e.isInterrupting!==void 0)&&t.set(C.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof pe?t.set(C.SUB_PROCESS_KIND,e.subProcessKind):e.kind===d.TASK_RECEIVE?t.set(C.IS_INSTANTIATING,String(e.instantiate)):e instanceof oe&&t.set(C.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(C.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof Et&&t.push(s.sequenceFlowKind),s instanceof Ct&&t.push(s.associationDirectionKind),t}computeEdgeStyleValues(e){const t=new Map;if(!this.ignoreBpmnColors){const s=e.extensions;s.strokeColor&&t.set(l.mxConstants.STYLE_STROKECOLOR,s.strokeColor)}return t}computeFontStyleValues(e){var i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(l.mxConstants.STYLE_FONTFAMILY,s.name),t.set(l.mxConstants.STYLE_FONTSIZE,s.size),t.set(l.mxConstants.STYLE_FONTSTYLE,us(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(l.mxConstants.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(l.mxConstants.STYLE_VERTICAL_ALIGN,l.mxConstants.ALIGN_TOP),e.bpmnElement.kind!=d.TEXT_ANNOTATION&&s.set(l.mxConstants.STYLE_ALIGN,l.mxConstants.ALIGN_CENTER),e instanceof he&&(s.set(l.mxConstants.STYLE_LABEL_WIDTH,t.width+1),s.set(l.mxConstants.STYLE_LABEL_POSITION,"ignore"),s.set(l.mxConstants.STYLE_VERTICAL_LABEL_POSITION,l.mxConstants.ALIGN_MIDDLE))):e instanceof he&&(i instanceof pe||i instanceof oe&&i.callActivityKind===se.CALLING_PROCESS)&&!i.markers.includes(v.EXPAND)&&s.set(l.mxConstants.STYLE_VERTICAL_ALIGN,l.mxConstants.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",C.MESSAGE_FLOW_ICON]),t.push([C.IS_INITIATING,String(e.messageVisibleKind===ae.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([l.mxConstants.STYLE_STROKECOLOR,e.extensions.strokeColor]),tt(t).join(";")}}function us(n){let e=0;return n.isBold&&(e+=l.mxConstants.FONT_BOLD),n.isItalic&&(e+=l.mxConstants.FONT_ITALIC),n.isStrikeThrough&&(e+=l.mxConstants.FONT_STRIKETHROUGH),n.isUnderline&&(e+=l.mxConstants.FONT_UNDERLINE),e}function tt(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class ds{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){e.forEach(t=>this.insertShape(t))}getParent(e){return this.getCell(e.parentId)??this.graph.getDefaultParent()}insertShape(e){var a;const t=e.bpmnElement,s=this.getParent(t),i=e.bounds;let o=(a=e.label)==null?void 0:a.bounds;o=S.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){e.forEach(t=>{var h;const s=t.bpmnElement,i=this.graph.getDefaultParent(),o=this.getCell(s.sourceRefId),r=this.getCell(s.targetRefId),a=(h=t.label)==null?void 0:h.bounds,c=this.styleComputer.computeStyle(t,a),u=this.graph.insertEdge(i,s.id,s.name,o,r,c);if(this.insertWaypoints(t.waypoints,u),a){u.geometry.width=a.width,u.geometry.height=a.height;const f=this.coordinatesTranslator.computeEdgeCenter(u);if(f){u.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new l.mxPoint(a.x,a.y)),T=p.x+a.width/2-f.x,I=p.y-f.y;u.geometry.offset=new l.mxPoint(T,I)}}this.insertMessageFlowIconIfNeeded(t,u)})}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof mt&&e.messageVisibleKind!==ae.NONE){const s=this.graph.insertVertex(t,Ot(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new l.mxPoint(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new l.mxPoint(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const a=this.coordinatesTranslator.computeRelativeCoordinates(e,new l.mxPoint(i.x,i.y)),c=this.graph.insertVertex(e,t,s,a.x,a.y,i.width,i.height,r);if(o){const u=o.x-i.x,h=o.y-i.y;c.geometry.offset=new l.mxPoint(u,h)}return c}}function hs(n,e){return new ds(n,new cs(n),new K(e))}function Ot(n){return`messageFlowIcon_of_${n}`}var ke={},Me={};(function(n){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",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(a,c){const u=[];let h=c.exec(a);for(;h;){const f=[];f.startIndex=c.lastIndex-h[0].length;const p=h.length;for(let T=0;T"u")};n.isExist=function(a){return typeof a<"u"},n.isEmptyObject=function(a){return Object.keys(a).length===0},n.merge=function(a,c,u){if(c){const h=Object.keys(c),f=h.length;for(let p=0;p"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` -`&&n[o]!=="\r";o++)c+=n[o];if(c=c.trim(),c[c.length-1]==="/"&&(c=c.substring(0,c.length-1),o--),!Is(c)){let f;return c.trim().length===0?f="Invalid space after '<'.":f="Tag '"+c+"' is an invalid name.",N("InvalidTag",f,y(n,o))}const u=ps(n,o);if(u===!1)return N("InvalidAttr","Attributes for '"+c+"' have open quote.",y(n,o));let h=u.value;if(o=u.index,h[h.length-1]==="/"){const f=o-h.length;h=h.substring(0,h.length-1);const p=ot(h,e);if(p===!0)s=!0;else return N(p.err.code,p.err.msg,y(n,f+p.err.line))}else if(a)if(u.tagClosed){if(h.trim().length>0)return N("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",y(n,r));{const f=t.pop();if(c!==f.tagName){let p=y(n,f.tagStartPos);return N("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+c+"'.",y(n,r))}t.length==0&&(i=!0)}}else return N("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",y(n,o));else{const f=ot(h,e);if(f!==!0)return N(f.err.code,f.err.msg,y(n,o-h.length+f.err.line));if(i===!0)return N("InvalidXml","Multiple possible root nodes found.",y(n,o));e.unpairedTags.indexOf(c)!==-1||t.push({tagName:c,tagStartPos:r}),s=!0}for(o++;o0)return N("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return N("InvalidXml","Start tag expected.",1);return!0};function nt(n){return n===" "||n===" "||n===` -`||n==="\r"}function st(n,e){const t=e;for(;e5&&s==="xml")return N("InvalidXml","XML declaration allowed only at the start of the document.",y(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function it(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const gs='"',Ts="'";function ps(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const Es=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function ot(n,e){const t=Be.getAllMatches(n,Es),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},As=function(n){return Object.assign({},Nt,n)};Ge.buildOptions=As;Ge.defaultOptions=Nt;class Os{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,[":@"]:e[":@"]}):this.child.push({[e.tagname]:e.child})}}var Ns=Os;function Ls(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let s=1,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!0:r+=n[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function vs(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const c=Number(t),u=""+c;return u.search(/[eE]/)!==-1||a?e.eNotation?c:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?c:n:o?r===u||i+r===u?c:n:t===u||t===i+u?c:n}}else return n}}function Gs(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var Vs=Bs;const Ve=Me,te=Ns,Ys=Fs,Us=Vs;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Ve.nameRegexp);let Ws=class{constructor(e){this.options=e,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=Ds,this.parseXml=$s,this.parseTextData=Hs,this.resolveNameSpace=Ks,this.buildAttributesMap=Xs,this.isItStopNode=Qs,this.replaceEntitiesValue=js,this.readStopNodeData=ei,this.saveTextToParentTag=qs,this.addChild=Zs}};function Ds(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const a=this.options.tagValueProcessor(e,n,t,i,o);return a==null?n:typeof a!=typeof n||a!==n?a:this.options.trimValues?be(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?be(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Ks(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const zs=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Xs(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=Ve.getAllMatches(n,zs),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let c=n.substring(o+2,a).trim();if(this.options.removeNSPrefix){const f=c.indexOf(":");f!==-1&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&(s=this.saveTextToParentTag(s,t,i));const u=i.substring(i.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let h=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),t=this.tagsNodeStack.pop(),s="",o=a}else if(n[o+1]==="?"){let a=xe(n,o,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new te(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,i,a.tagName)),this.addChild(t,c,i)}o=a.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const a=D(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const c=n.substring(o+4,a-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=a}else if(n.substr(o+1,2)==="!D"){const a=Ys(n,o);this.docTypeEntities=a.entities,o=a.i}else if(n.substr(o+1,2)==="!["){const a=D(n,"]]>",o,"CDATA is not closed.")-2,c=n.substring(o+9,a);if(s=this.saveTextToParentTag(s,t,i),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]);else{let u=this.parseTextData(c,t.tagname,i,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}o=a+2}else{let a=xe(n,o,this.options.removeNSPrefix),c=a.tagName,u=a.tagExp,h=a.attrExpPresent,f=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const p=t;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),c!==e.tagname&&(i+=i?"."+c:c),this.isItStopNode(this.options.stopNodes,i,c)){let T="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=a.closeIndex;else{const b=this.readStopNodeData(n,c,f+1);if(!b)throw new Error(`Unexpected end of ${c}`);o=b.i,T=b.tagContent}const I=new te(c);c!==u&&h&&(I[":@"]=this.buildAttributesMap(u,i,c)),T&&(T=this.parseTextData(T,c,i,!0,h,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),I.add(this.options.textNodeName,T),this.addChild(t,I,i)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const T=new te(c);c!==u&&h&&(T[":@"]=this.buildAttributesMap(u,i,c)),this.addChild(t,T,i),i=i.substr(0,i.lastIndexOf("."))}else{const T=new te(c);this.tagsNodeStack.push(t),c!==u&&h&&(T[":@"]=this.buildAttributesMap(u,i,c)),this.addChild(t,T,i),t=T}s="",o=f}}else s+=n[o];return e.child};function Zs(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const js=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function qs(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function Qs(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function Js(n,e,t=">"){let s,i="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=D(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=D(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=D(n,"]]>",t,"StopNode is not closed.")-2;else{const o=xe(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function be(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:Us(n,t)}else return Ve.isExist(n)?n:""}var ti=Ws,Lt={};function ni(n,e){return vt(n,e)}function vt(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function si(n){const e=Object.keys(n);for(let t=0;t0&&(t=hi),_t(n,e,"",t)}function _t(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(c===e.commentPropName){i+=s+``,o=!0;continue}else if(c[0]==="?"){const I=at(a[":@"],e),b=c==="?xml"?"":s;let U=a[c][0][e.textNodeName];U=U.length!==0?" "+U:"",i+=b+`<${c}${U}${I}?>`,o=!0;continue}let h=s;h!==""&&(h+=e.indentBy);const f=at(a[":@"],e),p=s+`<${c}${f}`,T=_t(a[c],e,u,h);e.unpairedTags.indexOf(c)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!T||T.length===0)&&e.suppressEmptyNode?i+=p+"/>":T&&T.endsWith(">")?i+=p+`>${T}${s}`:(i+=p+">",T&&s!==""&&(T.includes("/>")||T.includes("`),o=!0}return i}function gi(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Y(n){this.options=Object.assign({},mi,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ii),this.processTextOrObjNode=Ci,this.options.format?(this.indentate=Si,this.tagEndChar=`> +var Zt=Object.defineProperty;var qt=(n,e,t)=>e in n?Zt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var g=(n,e,t)=>(qt(n,typeof e!="symbol"?e+"":e,t),t);import{f as Qt}from"./mxgraph.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var le=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(le||{}),Jt=(n=>(n.In="in",n.Out="out",n))(Jt||{}),h=(n=>(n.LANE="lane",n.POOL="pool",n.CALL_ACTIVITY="callActivity",n.SUB_PROCESS="subProcess",n.TASK="task",n.TASK_USER="userTask",n.TASK_SERVICE="serviceTask",n.TASK_RECEIVE="receiveTask",n.TASK_SEND="sendTask",n.TASK_MANUAL="manualTask",n.TASK_SCRIPT="scriptTask",n.TASK_BUSINESS_RULE="businessRuleTask",n.GLOBAL_TASK="globalTask",n.GLOBAL_TASK_USER="globalUserTask",n.GLOBAL_TASK_MANUAL="globalManualTask",n.GLOBAL_TASK_SCRIPT="globalScriptTask",n.GLOBAL_TASK_BUSINESS_RULE="globalBusinessRuleTask",n.GROUP="group",n.TEXT_ANNOTATION="textAnnotation",n.GATEWAY_PARALLEL="parallelGateway",n.GATEWAY_EXCLUSIVE="exclusiveGateway",n.GATEWAY_INCLUSIVE="inclusiveGateway",n.GATEWAY_EVENT_BASED="eventBasedGateway",n.GATEWAY_COMPLEX="complexGateway",n.EVENT_START="startEvent",n.EVENT_END="endEvent",n.EVENT_INTERMEDIATE_CATCH="intermediateCatchEvent",n.EVENT_INTERMEDIATE_THROW="intermediateThrowEvent",n.EVENT_BOUNDARY="boundaryEvent",n))(h||{}),ae=(n=>(n.CALLING_PROCESS="process",n.CALLING_GLOBAL_TASK="global task",n))(ae||{}),ce=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(ce||{}),b=(n=>(n.NONE="none",n.TERMINATE="terminate",n.CANCEL="cancel",n.COMPENSATION="compensate",n.CONDITIONAL="conditional",n.ERROR="error",n.ESCALATION="escalation",n.LINK="link",n.MESSAGE="message",n.SIGNAL="signal",n.TIMER="timer",n))(b||{}),w=(n=>(n.ADHOC="adhoc",n.COMPENSATION="compensation",n.EXPAND="expand",n.LOOP="loop",n.MULTI_INSTANCE_PARALLEL="parallel multi instance",n.MULTI_INSTANCE_SEQUENTIAL="sequential multi instance",n))(w||{}),U=(n=>(n.AD_HOC="ad_hoc",n.EMBEDDED="embedded",n.EVENT="event",n.TRANSACTION="transaction",n))(U||{});function en(n,e){return n===""?e?{}:void 0:n}function S(n,e=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(t=>en(t,e)).filter(Boolean)}function tn(n,e,t){let s="";return t!=null&&t.startingWith?s=s.concat(`^(${t.startingWith}).*`):t!=null&&t.notStartingWith&&(s=s.concat(`^(?!(${t.notStartingWith})).*`)),s=s.concat(`${e}$`),n.filter(i=>t!=null&&t.ignoreCase?new RegExp(s,"i").test(i):new RegExp(s).test(i))}class m{static isEvent(e){return pe(tt,e)}static eventKinds(){return[...tt]}static isBoundaryEvent(e){return h.EVENT_BOUNDARY===e}static isStartEvent(e){return h.EVENT_START===e}static isCallActivity(e){return h.CALL_ACTIVITY===e}static isSubProcess(e){return h.SUB_PROCESS===e}static canHaveNoneEvent(e){return h.EVENT_INTERMEDIATE_THROW===e||h.EVENT_END===e||h.EVENT_START===e}static isActivity(e){return pe(xe,e)}static activityKinds(){return[...xe]}static isWithDefaultSequenceFlow(e){return nn.includes(e)}static isTask(e){return pe(Pe,e)}static taskKinds(){return[...Pe]}static gatewayKinds(){return[...nt]}static isGateway(e){return pe(nt,e)}static flowNodeKinds(){return Object.values(h).filter(e=>!m.isPoolOrLane(e))}static isPoolOrLane(e){return e==h.POOL||e==h.LANE}}function Ue(n,e){return tn(Object.values(h),n,e)}function pe(n,e){return Object.values(n).map(t=>t).includes(e)}const tt=Ue("Event"),nt=Ue("Gateway"),Pe=Ue("Task",{ignoreCase:!0,notStartingWith:"global"}),xe=[...Pe,h.CALL_ACTIVITY,h.SUB_PROCESS],nn=[...xe,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE,h.GATEWAY_COMPLEX],St=Object.values(b).filter(n=>n!=b.NONE);var j=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(j||{}),k=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(k||{}),fe=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(fe||{}),G=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(G||{});function Ie(n,e,t,s){return Math.min(Math.max(n??s,e),t)}function sn(n){return Math.max(n||0,0)}function on(n){const e=n??{};return e.debounceDelay=Ie(e.debounceDelay,0,100,50),e.throttleDelay=Ie(e.throttleDelay,0,100,50),e}function Le(n){return n=="default"?void 0:Ie(n,0,100,100)}function rn(n){return n=="default"?void 0:Ie(n,1,50,1)}const N=ln(),O=N.mxCellRenderer,It=N.mxClient,c=N.mxConstants,W=N.mxEvent,st=N.mxPerimeter,x=N.mxPoint,ke=N.mxRectangle,We=N.mxRectangleShape,ue=N.mxSvgCanvas2D,y=N.mxUtils;function ln(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",Qt({})}const I={EDGE:"bpmn.edge",EDGE_START_FILL_COLOR:"bpmn.edge.startFillColor",EDGE_END_FILL_COLOR:"bpmn.edge.endFillColor",EVENT_BASED_GATEWAY_KIND:"bpmn.gatewayKind",EVENT_DEFINITION_KIND:"bpmn.eventDefinitionKind",GLOBAL_TASK_KIND:"bpmn.globalTaskKind",SUB_PROCESS_KIND:"bpmn.subProcessKind",IS_INITIATING:"bpmn.isInitiating",IS_INSTANTIATING:"bpmn.isInstantiating",IS_INTERRUPTING:"bpmn.isInterrupting",EXTRA_CSS_CLASSES:"bpmn.extra.css.classes",MARKERS:"bpmn.markers",MESSAGE_FLOW_ICON:"bpmn.messageFlowIcon"},mt={ARROW_DASH:"bpmn.dash"},E={STROKE_WIDTH_THIN:2,STROKE_WIDTH_THICK:5,SHAPE_ACTIVITY_BOTTOM_MARGIN:7,SHAPE_ACTIVITY_TOP_MARGIN:7,SHAPE_ACTIVITY_LEFT_MARGIN:7,SHAPE_ACTIVITY_FROM_CENTER_MARGIN:7,SHAPE_ACTIVITY_MARKER_ICON_MARGIN:5,SHAPE_ACTIVITY_MARKER_ICON_SIZE:20,POOL_LABEL_SIZE:30,POOL_LABEL_FILL_COLOR:"none",LANE_LABEL_SIZE:30,LANE_LABEL_FILL_COLOR:"none",SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET:4,SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE:6,TEXT_ANNOTATION_BORDER_LENGTH:10,TEXT_ANNOTATION_FILL_COLOR:"none",GROUP_FILL_COLOR:"none",DEFAULT_FILL_COLOR:"White",DEFAULT_STROKE_COLOR:"Black",DEFAULT_FONT_FAMILY:"Arial, Helvetica, sans-serif",DEFAULT_FONT_SIZE:11,DEFAULT_FONT_COLOR:"Black",DEFAULT_MARGIN:0,SHAPE_ARC_SIZE:20,DEFAULT_OVERLAY_FILL_COLOR:"White",DEFAULT_OVERLAY_FILL_OPACITY:100,DEFAULT_OVERLAY_STROKE_COLOR:"Black",DEFAULT_OVERLAY_STROKE_WIDTH:1,DEFAULT_OVERLAY_FONT_SIZE:11,DEFAULT_OVERLAY_FONT_COLOR:"Black",SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_START_FILL_COLOR:"White",MESSAGE_FLOW_MARKER_END_FILL_COLOR:"White"},At=n=>y.getValue(n,I.IS_INSTANTIATING,"false")=="true",me=n=>n=="default"?void 0:n,an=(n,e)=>(e&&(n=F(n,c.STYLE_STROKECOLOR,e.color,me),n=F(n,c.STYLE_STROKE_OPACITY,e.opacity,Le),n=F(n,c.STYLE_STROKEWIDTH,e.width,rn)),n),F=(n,e,t,s=i=>i)=>t==null?n:y.setStyle(n,e,s(t)),Ee=(n,e,t,s)=>s==null?n:y.setStyleFlag(n,e,t,s),cn=(n,e)=>(e&&(n=F(n,c.STYLE_FONTCOLOR,e.color,me),n=F(n,c.STYLE_FONTSIZE,e.size),n=F(n,c.STYLE_FONTFAMILY,e.family),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_BOLD,e.isBold),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_ITALIC,e.isItalic),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_UNDERLINE,e.isUnderline),n=Ee(n,c.STYLE_FONTSTYLE,c.FONT_STRIKETHROUGH,e.isStrikeThrough),n=F(n,c.STYLE_TEXT_OPACITY,e.opacity,Le)),n),un=(n,e)=>(e.color&&(n=F(n,c.STYLE_FILLCOLOR,e.color,me),(n.includes(h.POOL)||n.includes(h.LANE))&&(n=F(n,c.STYLE_SWIMLANE_FILLCOLOR,e.color,me))),n=F(n,c.STYLE_FILL_OPACITY,e.opacity,Le),n),hn=n=>n&&typeof n=="object"&&"fill"in n,it=12;class Ct{constructor(e){g(this,"specificFlowStyles",new be([[k.SEQUENCE_FLOW,e=>{e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN}],[k.MESSAGE_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="8 5",e[c.STYLE_STARTARROW]=c.ARROW_OVAL,e[c.STYLE_STARTSIZE]=8,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_START_FILL_COLOR,e[c.STYLE_ENDARROW]=c.ARROW_BLOCK_THIN,e[c.STYLE_ENDFILL]=!0,e[I.EDGE_END_FILL_COLOR]=E.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[k.ASSOCIATION_FLOW,e=>{e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="1 2",e[c.STYLE_STARTSIZE]=it}]]));g(this,"specificSequenceFlowStyles",new be([[G.DEFAULT,e=>{e[c.STYLE_STARTARROW]=mt.ARROW_DASH}],[G.CONDITIONAL_FROM_ACTIVITY,e=>{e[c.STYLE_STARTARROW]=c.ARROW_DIAMOND_THIN,e[c.STYLE_STARTSIZE]=18,e[c.STYLE_STARTFILL]=!0,e[I.EDGE_START_FILL_COLOR]=E.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));g(this,"specificAssociationFlowStyles",new be([[j.NONE,e=>{}],[j.ONE,e=>{e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}],[j.BOTH,e=>{e[c.STYLE_STARTARROW]=c.ARROW_OPEN_THIN,e[c.STYLE_ENDARROW]=c.ARROW_OPEN_THIN}]]));this.graph=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(){const e=this.getStylesheet().getDefaultVertexStyle();ot(e),e[c.STYLE_ABSOLUTE_ARCSIZE]=!0,e[c.STYLE_ARCSIZE]=E.SHAPE_ARC_SIZE}configurePoolStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_STARTSIZE]=E.POOL_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=E.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,e)}configureLaneStyle(){const e={};e[c.STYLE_SHAPE]=c.SHAPE_SWIMLANE,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_SWIMLANE_LINE]=0,e[c.STYLE_STARTSIZE]=E.LANE_LABEL_SIZE,e[c.STYLE_FILLCOLOR]=E.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,e)}configureEventStyles(){m.eventKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.EllipsePerimeter,t[c.STYLE_STROKEWIDTH]=e==h.EVENT_END?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_BOTTOM,this.putCellStyle(e,t)})}configureTextAnnotationStyle(){const e={};e[c.STYLE_SHAPE]=h.TEXT_ANNOTATION,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,e[c.STYLE_ALIGN]=c.ALIGN_LEFT,e[c.STYLE_SPACING_LEFT]=5,e[c.STYLE_FILLCOLOR]=E.TEXT_ANNOTATION_FILL_COLOR,e[c.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,e)}configureGroupStyle(){const e={};e[c.STYLE_ROUNDED]=!0,e[c.STYLE_DASHED]=!0,e[c.STYLE_DASH_PATTERN]="7 4 1 4",e[c.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,e[c.STYLE_FILLCOLOR]=E.GROUP_FILL_COLOR,e[c.STYLE_ALIGN]=c.ALIGN_CENTER,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,this.putCellStyle(h.GROUP,e)}configureActivityStyles(){m.activityKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_ROUNDED]=!0,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_MIDDLE,t[c.STYLE_STROKEWIDTH]=e==h.CALL_ACTIVITY?E.STROKE_WIDTH_THICK:E.STROKE_WIDTH_THIN,this.putCellStyle(e,t)})}configureGatewayStyles(){m.gatewayKinds().forEach(e=>{const t={};t[c.STYLE_SHAPE]=e,t[c.STYLE_PERIMETER]=st.RhombusPerimeter,t[c.STYLE_STROKEWIDTH]=E.STROKE_WIDTH_THIN,t[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_TOP,t[c.STYLE_LABEL_POSITION]=c.ALIGN_LEFT,t[c.STYLE_VERTICAL_LABEL_POSITION]=c.ALIGN_TOP,this.putCellStyle(e,t)})}configureDefaultEdgeStyle(){const e=this.getStylesheet().getDefaultEdgeStyle();ot(e),e[c.STYLE_SHAPE]=I.EDGE,e[c.STYLE_ENDSIZE]=it,e[c.STYLE_STROKEWIDTH]=1.5,e[c.STYLE_ROUNDED]=!0,e[c.STYLE_ARCSIZE]=5,e[c.STYLE_VERTICAL_ALIGN]=c.ALIGN_BOTTOM,delete e[c.STYLE_ENDARROW]}configureEdgeStyles(e,t){e.forEach(s=>{const i={};t.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)})}configureFlowStyles(){this.configureEdgeStyles(Object.values(k),this.specificFlowStyles),this.configureEdgeStyles(Object.values(G),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(j),this.specificAssociationFlowStyles)}}function ot(n){n[c.STYLE_FONTFAMILY]=E.DEFAULT_FONT_FAMILY,n[c.STYLE_FONTSIZE]=E.DEFAULT_FONT_SIZE,n[c.STYLE_FONTCOLOR]=E.DEFAULT_FONT_COLOR,n[c.STYLE_FILLCOLOR]=E.DEFAULT_FILL_COLOR,n[c.STYLE_STROKECOLOR]=E.DEFAULT_STROKE_COLOR,n[c.STYLE_LABEL_BACKGROUNDCOLOR]=c.NONE,n[c.STYLE_WHITE_SPACE]="wrap"}class be extends Map{get(e){return super.get(e)??(()=>{})}}function dn(n,e,t,s){let i,o;n.heightT.setIconOriginForIconCentered(),shapeConfig:{x:e,y:t,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:l,fillColor:d,strokeColor:f,strokeWidth:a,margin:p}}}class X{paintEmptyIcon(){}newBpmnCanvas({canvas:e,ratioFromParent:t,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new fn({canvas:e,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:t,setIconOriginFunct:s}})}paintEnvelopeIcon(e){const t={width:485.41,height:321.76},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=e;r.isFilled&&s.setStrokeColor(r.fillColor),s.begin(),s.moveTo(0,0),s.lineTo(i*.5,o*.6),s.lineTo(i,0),s.moveTo(0,o),s.lineTo(i/3,o*.45),s.moveTo(i,o),s.lineTo(i*2/3,o*.45),s.stroke()}paintCircleIcon(e){const t={width:e.shapeConfig.width,height:e.shapeConfig.height},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;i>0&&o>0&&s.ellipse(0,0,i,o),e.iconStyleConfig.isFilled?s.fillAndStroke():s.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()}paintAsteriskIcon(e){const t=this.newBpmnCanvas(e,{height:1,width:1});Re(e,t),t.fillAndStroke(),Re(e,t),t.rotateOnIconCenter(60),t.fillAndStroke(),Re(e,t),t.rotateOnIconCenter(240),t.fillAndStroke()}paintPersonIcon(e){const t=this.newBpmnCanvas({...e,iconStyleConfig:{...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});X.paintGearIconBackground(t),t.translateIconOrigin(14,14),X.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();const t=24.8,s=39;X.paintGearInnerCircle(e,t,s)}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();const t=39.2,s=55.8;X.paintGearInnerCircle(e,t,s),e.begin(),X.paintGearInnerCircle(e,t,s)}static paintGearInnerCircle(e,t,s){e.moveTo(t,s),e.arcTo(13.5,13.5,0,1,1,t+2*13.5,s),e.arcTo(13.5,13.5,0,0,1,t,s),e.close(),e.fillAndStroke()}paintExpandIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),i=t.width,o=t.height;s.roundrect(0,0,i,o,2,2),s.stroke(),s.begin(),s.moveTo(i/2,o/4),s.lineTo(i/2,o*3/4),s.close(),s.moveTo(i/4,o/2),s.lineTo(i*3/4,o/2),s.close(),s.fillAndStroke()}paintLoopIcon(e){const{iconStyleConfig:t}=e;t.fillColor=t.strokeColor;const s=this.newBpmnCanvas(e,{width:22.49,height:21.62});s.begin(),s.moveTo(5.5,19.08),s.arcTo(8,8,0,1,1,10.5,21.08),s.stroke(),s.begin(),s.moveTo(7.5,14.08),s.lineTo(5.75,19.08),s.lineTo(0,17.08),s.close(),s.fillAndStroke()}paintSequentialMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width,l=t.height/5;s.rect(0,0,r,l),s.fill(),s.rect(0,2*l,r,l),s.fill(),s.rect(0,4*l,r,l),s.fill()}paintParallelMultiInstanceIcon(e){const t={width:16,height:16},s=this.newBpmnCanvas(e,t),{canvas:i,iconStyleConfig:o}=e;i.setFillColor(o.strokeColor);const r=t.width/5,l=t.height;s.begin(),s.rect(0,0,r,l),s.fill(),s.rect(2*r,0,r,l),s.fill(),s.rect(4*r,0,r,l),s.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()}}function Re(n,e){e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,1),e.lineTo(.38,1),e.close()}class te{static get(){return this.instance}static set(e){this.instance=e}}g(te,"instance",new X);class Q extends N.mxEllipse{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",te.get());g(this,"iconPainters",new Map([[b.MESSAGE,t=>this.iconPainter.paintEnvelopeIcon({...t,ratioFromParent:.5})],[b.TERMINATE,t=>this.iconPainter.paintCircleIcon({...t,ratioFromParent:.6})],[b.TIMER,t=>this.iconPainter.paintClockIcon({...t,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[b.SIGNAL,t=>this.iconPainter.paintTriangleIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[b.LINK,t=>this.iconPainter.paintRightArrowIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[b.ERROR,t=>this.iconPainter.paintErrorIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[b.COMPENSATION,t=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...t,ratioFromParent:.7,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})],[b.CANCEL,t=>this.iconPainter.paintXCrossIcon({...t,ratioFromParent:.78})],[b.ESCALATION,t=>this.iconPainter.paintUpArrowheadIcon({...t,ratioFromParent:.55,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:E.STROKE_WIDTH_THIN.valueOf()}})],[b.CONDITIONAL,t=>this.iconPainter.paintListIcon({...t,ratioFromParent:.6,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1.5}})]]));g(this,"withFilledIcon",!1)}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});Q.setDashedOuterShapePattern(l,y.getValue(this.style,I.IS_INTERRUPTING,void 0)),this.paintOuterShape(l),Q.restoreOriginalOuterShapePattern(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}paintInnerShape(t){(this.iconPainters.get(y.getValue(this.style,I.EVENT_DEFINITION_KIND,b.NONE))??(()=>this.iconPainter.paintEmptyIcon()))(t)}static setDashedOuterShapePattern(t,s){t.canvas.save(),s==="false"&&(t.canvas.setDashed(!0,!1),t.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(t){t.canvas.restore()}}class gn extends Q{constructor(){super(),this.withFilledIcon=!0}}class Me extends Q{paintOuterShape({canvas:e,shapeConfig:{x:t,y:s,width:i,height:o,strokeWidth:r}}){e.ellipse(t,s,i,o),e.fillAndStroke();const l=r*1.5;e.ellipse(i*.02+l+t,o*.02+l+s,i*.96-2*l,o*.96-2*l),e.stroke()}}class Tn extends Me{constructor(){super(),this.withFilledIcon=!0}}class ge extends N.mxRhombus{constructor(){super(...arguments);g(this,"iconPainter",te.get())}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(l),this.paintInnerShape(l)}paintOuterShape({canvas:t,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(t,s,i,o,r)}}class pn extends ge{paintInnerShape(e){this.iconPainter.paintXCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class En extends ge{paintInnerShape(e){this.iconPainter.paintPlusCrossIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Sn extends ge{paintInnerShape(e){this.iconPainter.paintCircleIcon({...e,ratioFromParent:.62,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1,strokeWidth:E.STROKE_WIDTH_THICK.valueOf()}})}}class In extends ge{paintInnerShape(e){this.iconPainter.paintAsteriskIcon({...e,iconStyleConfig:{...e.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class mn extends ge{paintInnerShape(e){e={...e,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...e,ratioFromParent:.55}),At(this.style)||this.iconPainter.paintCircleIcon({...e,ratioFromParent:.45});const t={...e,ratioFromParent:.3};y.getValue(this.style,I.EVENT_BASED_GATEWAY_KIND,ce.Exclusive)==ce.Parallel?this.iconPainter.paintPlusCrossIcon(t):this.iconPainter.paintPentagon(t)}}const An=[w.LOOP,w.MULTI_INSTANCE_PARALLEL,w.MULTI_INSTANCE_SEQUENTIAL,w.COMPENSATION,w.EXPAND,w.ADHOC];function Cn(n){const e=An.filter(t=>n.includes(t));return n.filter(t=>!e.includes(t)).forEach(t=>e.push(t)),e}function Ot(n,e){te.get().paintEnvelopeIcon({...n,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:e}})}class De extends We{constructor(){super(void 0,void 0,void 0);g(this,"iconPainter",te.get())}paintForeground(t,s,i,o,r){super.paintForeground(t,s,i,o,r),this.paintMarkerIcons(ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(t){const s=y.getValue(this.style,I.MARKERS,void 0);s&&Cn(s.split(",")).forEach((i,o,r)=>{switch(t={...t,setIconOriginFunct:this.getMarkerIconOriginFunction(r.length,o+1)},t.canvas.save(),i){case w.LOOP:this.iconPainter.paintLoopIcon(t);break;case w.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(t);break;case w.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(t);break;case w.EXPAND:this.iconPainter.paintExpandIcon(t);break}t.canvas.restore()})}getMarkerIconOriginFunction(t,s){let i;return t===1?i=o=>o.setIconOriginForIconBottomCentered():i=o=>{o.setIconOriginForIconBottomCentered();const r=Math.pow(-1,s)*(E.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+E.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);o.translateIconOrigin(r,0)},i}}class H extends De{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o),this.paintTaskIcon(ee({canvas:e,x:t,y:s,width:i,height:o,shape:this}))}}class On extends H{paintTaskIcon(e){this.iconPainter.paintEmptyIcon()}}class Nn extends H{paintTaskIcon(e){this.iconPainter.paintGearIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class Ln extends H{paintTaskIcon(e){this.iconPainter.paintPersonIcon({...e,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class vn extends H{paintTaskIcon(e){if(!At(this.style)){Ot(e,!1);return}const t=4,s=4,i={...e.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:e.canvas,shapeConfig:i,iconStyleConfig:{...e.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,t)}),i.x+=t,i.y+=s,this.iconPainter.paintEnvelopeIcon({...e,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class yn extends H{paintTaskIcon(e){Ot(e,!0)}}class _n extends H{paintTaskIcon(e){this.iconPainter.paintHandIcon({...e,ratioFromParent:.18,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class wn extends H{paintTaskIcon(e){this.iconPainter.paintScriptIcon({...e,ratioFromParent:.22,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(20)})}}class bn extends De{paintForeground(e,t,s,i,o){super.paintForeground(e,t,s,i,o);const r=ee({canvas:e,x:t,y:s,width:i,height:o,shape:this});switch(y.getValue(this.style,I.GLOBAL_TASK_KIND,void 0)){case h.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:l=>l.setIconOriginToShapeTopLeftProportionally(15)});break;case h.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class Rn extends De{paintBackground(e,t,s,i,o){const r=y.getValue(this.style,I.SUB_PROCESS_KIND,void 0);if(e.save(),r===U.EVENT&&(e.setDashed(!0,!1),e.setDashPattern("1 2")),super.paintBackground(e,t,s,i,o),r===U.TRANSACTION){const l=E.SUB_PROCESS_TRANSACTION_INNER_RECT_OFFSET,a=E.SUB_PROCESS_TRANSACTION_INNER_RECT_ARC_SIZE;e.roundrect(t+l,s+l,i-2*l,o-2*l,a,a),e.stroke()}e.restore()}}class Fn extends H{paintTaskIcon(e){this.iconPainter.paintTableIcon({...e,ratioFromParent:.6,setIconOriginFunct:t=>t.setIconOriginToShapeTopLeftProportionally(15)})}}class Pn extends We{paintForeground(e,t,s,i,o){e.begin(),e.moveTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s),e.lineTo(t,s),e.lineTo(t,s+o),e.lineTo(t+E.TEXT_ANNOTATION_BORDER_LENGTH,s+o),e.stroke()}paintBackground(e,t,s,i,o){e.save(),e.setStrokeColor("none"),super.paintBackground(e,t,s,i,o),e.restore()}}class xn extends We{constructor(t,s,i,o){super(t,s,i,o);g(this,"iconPainter",te.get())}paintVertexShape(t,s,i,o,r){const l=ee({canvas:t,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:y.getValue(this.style,I.IS_INITIATING,"true")=="false"});this.iconPainter.paintEnvelopeIcon(l)}}function kn(n,e){return Mn(n.style,e)}function Mn(n,e){const t=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",m.isActivity(o)),r.set("bpmn-type-container",m.isPoolOrLane(o)),r.set("bpmn-type-event",m.isEvent(o)),r.set("bpmn-type-flow",Bn(o)),r.set("bpmn-type-gateway",m.isGateway(o)),r.set("bpmn-type-task",m.isTask(o)),[...r].filter(([,l])=>l).forEach(([l])=>t.push(l)),t.push(Be(o)),s.map(l=>{const a=l.split("=");return[a[0],a[1]]}).forEach(([l,a])=>{switch(l){case I.EVENT_DEFINITION_KIND:t.push(`bpmn-event-def-${a}`);break;case I.EVENT_BASED_GATEWAY_KIND:t.push(`bpmn-gateway-kind-${a.toLowerCase()}`);break;case I.IS_INITIATING:t.push(a=="true"?"bpmn-icon-initiating":"bpmn-icon-non-initiating");break;case I.SUB_PROCESS_KIND:t.push(`bpmn-sub-process-${a.toLowerCase()}`);break;case I.GLOBAL_TASK_KIND:t.push(Be(a));break}}),e&&t.push("bpmn-label"),t}function Bn(n){return Object.values(k).map(e=>e).includes(n)}function Be(n){return n?"bpmn-"+n.replace(/([A-Z])/g,e=>"-"+e[0].toLowerCase()):""}class Nt extends N.mxCellOverlay{constructor(t,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");g(this,"style");this.label=t,this.style=s.style}getBounds(t){const s=t.view.graph.getModel().isEdge(t.cell),i=t.view.scale;let o;const r=0,l=0;return s?o=this.computeEdgeBounds(t):(o=new x,this.align==c.ALIGN_LEFT?o.x=t.x:this.align==c.ALIGN_CENTER?o.x=t.x+t.width/2:o.x=t.x+t.width,this.verticalAlign==c.ALIGN_TOP?o.y=t.y:this.verticalAlign==c.ALIGN_MIDDLE?o.y=t.y+t.height/2:o.y=t.y+t.height),new ke(Math.round(o.x-(r*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(l*this.defaultOverlap-this.offset.y)*i),r*i,l*i)}computeEdgeBounds(t){const s=t.absolutePoints;if(this.align==c.ALIGN_LEFT)return s[0];if(this.align==c.ALIGN_CENTER){if(s.length%2==1)return s[Math.floor(s.length/2)];{const i=s.length/2,o=s[i-1],r=s[i];return new x(o.x+(r.x-o.x)/2,o.y+(r.y-o.y)/2)}}else return s[s.length-1]}}class rt extends N.mxText{constructor(e,t,s){super(e,t,void 0,void 0,s.font.color,void 0,s.font.size,void 0,void 0,void 0,void 0,void 0,void 0,void 0,s.fill.color,s.stroke.color),this.fillOpacity=s.fill.opacity,this.strokewidth=s.stroke.width}}class Gn extends N.mxConnector{constructor(e,t,s){super(e,t,s)}paintEdgeShape(e,t){const s=this.createMarker(e,t,!0),i=this.createMarker(e,t,!1);this.paintEdgeLine(e,t),e.setShadow(!1),e.setDashed(!1,!1),s!=null&&(e.setFillColor(y.getValue(this.style,I.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(e.setFillColor(y.getValue(this.style,I.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(e,t){const s=Vn(e);lt(e,"stroke"),this.paintLine(e,t,this.isRounded),lt(e,s)}}function Vn(n){return n instanceof ue?n.pointerEventsValue:null}function lt(n,e){n instanceof ue&&(n.pointerEventsValue=e)}class Yn{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){O.registerShape(h.EVENT_END,gn),O.registerShape(h.EVENT_START,Q),O.registerShape(h.EVENT_INTERMEDIATE_THROW,Tn),O.registerShape(h.EVENT_INTERMEDIATE_CATCH,Me),O.registerShape(h.EVENT_BOUNDARY,Me),O.registerShape(h.GATEWAY_COMPLEX,In),O.registerShape(h.GATEWAY_EVENT_BASED,mn),O.registerShape(h.GATEWAY_EXCLUSIVE,pn),O.registerShape(h.GATEWAY_INCLUSIVE,Sn),O.registerShape(h.GATEWAY_PARALLEL,En),O.registerShape(h.SUB_PROCESS,Rn),O.registerShape(h.CALL_ACTIVITY,bn),O.registerShape(h.TASK,On),O.registerShape(h.TASK_SERVICE,Nn),O.registerShape(h.TASK_USER,Ln),O.registerShape(h.TASK_RECEIVE,vn),O.registerShape(h.TASK_SEND,yn),O.registerShape(h.TASK_MANUAL,_n),O.registerShape(h.TASK_SCRIPT,wn),O.registerShape(h.TASK_BUSINESS_RULE,Fn),O.registerShape(h.TEXT_ANNOTATION,Pn),O.registerShape(I.EDGE,Gn),O.registerShape(I.MESSAGE_FLOW_ICON,xn)}initMxSvgCanvasPrototype(){ue.prototype.getTextCss=function(){const e=this.state,t=c.ABSOLUTE_LINE_HEIGHT?e.fontSize*c.LINE_HEIGHT+"px":c.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+e.fontSize+"px; font-family: "+e.fontFamily+"; color: "+e.fontColor+"; line-height: "+t+"; pointer-events: none; ";(e.fontStyle&c.FONT_BOLD)==c.FONT_BOLD&&(s+="font-weight: bold; "),(e.fontStyle&c.FONT_ITALIC)==c.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(e.fontStyle&c.FONT_UNDERLINE)==c.FONT_UNDERLINE&&i.push("underline"),(e.fontStyle&c.FONT_STRIKETHROUGH)==c.FONT_STRIKETHROUGH&&i.push("line-through"),i.length>0&&(s+="text-decoration: "+i.join(" ")+"; "),s}}initMxShapePrototype(){N.mxShape.prototype.createSvgCanvas=function(){var s;const e=new ue(this.node,!1);e.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,e.pointerEventsValue=this.svgPointerEvents;const t=this.getSvgScreenOffset();if(t!=0?this.node.setAttribute("transform","translate("+t+","+t+")"):this.node.removeAttribute("transform"),(s=this.state)!=null&&s.cell){const i=this.state.cell;let o=kn(i,this.dialect===c.DIALECT_STRICTHTML);const r=this.state.style[I.EXTRA_CSS_CLASSES];typeof r=="string"&&(o=o.concat(r.split(","))),this.node.setAttribute("class",o.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return e.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(e.format=function(i){return Math.round(parseFloat(i))}),e}}initMxCellRendererCreateCellOverlays(){O.prototype.createCellOverlays=function(e){const s=e.view.graph.getCellOverlays(e.cell);let i=null;if(s!=null){i=new N.mxDictionary;for(const o of s){const r=e.overlays!=null?e.overlays.remove(o):null;if(r!=null){i.put(o,r);continue}let l;o instanceof Nt?l=new rt(o.label,new ke(0,0,0,0),o.style):(l=new N.mxImageShape(new ke(0,0,0,0),o.image.src),l.preserveImageAspect=!1),l.dialect=e.view.graph.dialect,l.overlay=o,this.initializeOverlay(e,l),this.installCellOverlayListeners(e,o,l),o.cursor!=null&&(l.node.style.cursor=o.cursor),l instanceof rt&&(l.node.classList.add("overlay-badge"),l.node.setAttribute("data-bpmn-id",e.cell.id)),i.put(o,l)}}e.overlays!=null&&e.overlays.visit(function(o,r){r.destroy()}),e.overlays=i}}}class Un{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const e=(t,s,i,o,r,l,a,u,d)=>{const f=r*(a+d+4),p=l*(a+d+4);return function(){t.begin(),t.moveTo(o.x-f/2-p/2,o.y-p/2+f/2),t.lineTo(o.x+p/2-3*f/2,o.y-3*p/2-f/2),t.stroke()}};N.mxMarker.addMarker(mt.ARROW_DASH,e)}}var Wn=typeof global=="object"&&global&&global.Object===Object&&global;const Dn=Wn;var Hn=typeof self=="object"&&self&&self.Object===Object&&self,Kn=Dn||Hn||Function("return this")();const Lt=Kn;var zn=Lt.Symbol;const Ae=zn;var vt=Object.prototype,Xn=vt.hasOwnProperty,$n=vt.toString,ie=Ae?Ae.toStringTag:void 0;function jn(n){var e=Xn.call(n,ie),t=n[ie];try{n[ie]=void 0;var s=!0}catch{}var i=$n.call(n);return s&&(e?n[ie]=t:delete n[ie]),i}var Zn=Object.prototype,qn=Zn.toString;function Qn(n){return qn.call(n)}var Jn="[object Null]",es="[object Undefined]",at=Ae?Ae.toStringTag:void 0;function ts(n){return n==null?n===void 0?es:Jn:at&&at in Object(n)?jn(n):Qn(n)}function ns(n){return n!=null&&typeof n=="object"}var ss="[object Symbol]";function is(n){return typeof n=="symbol"||ns(n)&&ts(n)==ss}var os=/\s/;function rs(n){for(var e=n.length;e--&&os.test(n.charAt(e)););return e}var ls=/^\s+/;function as(n){return n&&n.slice(0,rs(n)+1).replace(ls,"")}function Ce(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var ct=0/0,cs=/^[-+]0x[0-9a-f]+$/i,us=/^0b[01]+$/i,hs=/^0o[0-7]+$/i,ds=parseInt;function ut(n){if(typeof n=="number")return n;if(is(n))return ct;if(Ce(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=Ce(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=as(n);var t=us.test(n);return t||hs.test(n)?ds(n.slice(2),t?2:8):cs.test(n)?ct:+n}var fs=function(){return Lt.Date.now()};const Fe=fs;var gs="Expected a function",Ts=Math.max,ps=Math.min;function yt(n,e,t){var s,i,o,r,l,a,u=0,d=!1,f=!1,p=!0;if(typeof n!="function")throw new TypeError(gs);e=ut(e)||0,Ce(t)&&(d=!!t.leading,f="maxWait"in t,o=f?Ts(ut(t.maxWait)||0,e):o,p="trailing"in t?!!t.trailing:p);function T(_){var Y=s,se=i;return s=i=void 0,u=_,r=n.apply(se,Y),r}function A(_){return u=_,l=setTimeout(Te,e),d?T(_):r}function M(_){var Y=_-a,se=_-u,et=e-Y;return f?ps(et,o-se):et}function z(_){var Y=_-a,se=_-u;return a===void 0||Y>=e||Y<0||f&&se>=o}function Te(){var _=Fe();if(z(_))return Je(_);l=setTimeout(Te,M(_))}function Je(_){return l=void 0,p&&s?T(_):(s=i=void 0,r)}function $t(){l!==void 0&&clearTimeout(l),u=0,s=a=i=l=void 0}function jt(){return l===void 0?r:Je(Fe())}function we(){var _=Fe(),Y=z(_);if(s=arguments,i=this,a=_,Y){if(l===void 0)return A(a);if(f)return clearTimeout(l),l=setTimeout(Te,e),T(a)}return l===void 0&&(l=setTimeout(Te,e)),r}return we.cancel=$t,we.flush=jt,we}var Es="Expected a function";function Ss(n,e,t){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(Es);return Ce(t)&&(s="leading"in t?!!t.leading:s,i="trailing"in t?!!t.trailing:i),yt(n,e,{leading:s,maxWait:e,trailing:i})}const Ge=1.25,Is=1/Ge;class ms extends N.mxGraph{constructor(t){super(t);g(this,"currentZoomLevel",1);this.zoomFactor=Ge,this.container&&(this.container.style.cursor="default")}createGraphView(){return new As(this)}batchUpdate(t){this.model.beginUpdate();try{t()}finally{this.model.endUpdate()}}fit(t,s,i,o,r,l,a){const u=super.fit(t,s,i,o,r,l,a);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(t){this.currentZoomLevel=t??this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(t){this.zoomActual();const s=t==null?void 0:t.type;if(s==null||s==le.None)return;const i=sn(t==null?void 0:t.margin);if(s!=le.Center){let o=!1,r=!1;switch(s){case le.Horizontal:r=!0;break;case le.Vertical:o=!0;break}this.fit(this.border,!1,i,!0,o,r)}else{const r=this.getGraphBounds(),l=this.container.clientWidth-i,a=this.container.clientHeight-i,u=r.width/this.view.scale,d=r.height/this.view.scale,f=Math.min(3,Math.min(l/u,a/d));this.setCurrentZoomLevel(f),this.view.scaleAndTranslate(f,(i+l-u*f)/(2*f)-r.x/this.view.scale,(i+a-d*f)/(2*f)-r.y/this.view.scale)}}registerMouseWheelZoomListeners(t){t=on(t),W.addMouseWheelListener(yt(this.createMouseWheelZoomListener(!0),t.debounceDelay),this.container),W.addMouseWheelListener(Ss(this.createMouseWheelZoomListener(!1),t.throttleDelay),this.container)}manageMouseWheelZoomEvent(t,s,i){if(!i)this.currentZoomLevel*=t?Ge:Is;else{const[o,r]=this.getEventRelativeCoordinates(s),[l,a,u]=this.getScaleAndTranslationDeltas(o,r);this.view.scaleAndTranslate(l,this.view.translate.x+a,this.view.translate.y+u),W.consume(s)}}createMouseWheelZoomListener(t){return(s,i)=>{if(W.isConsumed(s))return;const o=s;o.ctrlKey&&!o.altKey&&!o.shiftKey&&!o.metaKey&&this.manageMouseWheelZoomEvent(i,o,t)}}getEventRelativeCoordinates(t){const s=this.container.getBoundingClientRect(),i=t.clientX-s.left,o=t.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(t,s){const[i,o]=this.calculateFactorAndScale(),[r,l]=this.calculateTranslationDeltas(i,o,t*2,s*2);return[o,r,l]}calculateTranslationDeltas(t,s,i,o){if(t>1){const r=(t-1)/(s*2);i*=-r,o*=-r}else{const r=(1/t-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const t=Math.round(this.currentZoomLevel*100)/100;return[t/this.view.scale,t]}}class As extends N.mxGraphView{getFloatingTerminalPoint(e,t,s,i){if(e.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(e,t,s,i);const l=e.absolutePoints;return i?l[1]:l[l.length-2]}}class Cs{constructor(e){g(this,"graph");this.container=e,this.graph=new ms(e)}configure(e){return this.configureGraph(),this.configureNavigationSupport(e),new Ct(this.graph).configureStyles(),new Yn().configureShapes(),new Un().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(e){var s;const t=this.graph.panningHandler;(s=e==null?void 0:e.navigation)!=null&&s.enabled?(t.addListener(W.PAN_START,this.getPanningHandler("grab")),t.addListener(W.PAN_END,this.getPanningHandler("default")),t.usePopupTrigger=!1,t.isForcePanningEvent=i=>W.isLeftMouseButton(i.getEvent())||W.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(e.navigation.zoom)):(this.graph.setPanning(!1),t.setPinchEnabled(!1),t.isForcePanningEvent=i=>!1)}getPanningHandler(e){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=e)}}}class ve{constructor(e,t,s,i,o){this.id=e,this.name=t,this.kind=s,this.sourceRefId=i,this.targetRefId=o}}class _t extends ve{constructor(e,t,s,i,o=G.NORMAL){super(e,t,k.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class wt extends ve{constructor(e,t,s,i){super(e,t,k.MESSAGE_FLOW,s,i)}}class bt extends ve{constructor(e,t,s,i,o=j.NONE){super(e,t,k.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}class Os{constructor(e){this.graph=e}computeRelativeCoordinates(e,t){const s=this.getTranslateForRoot(e),i=t.x+s.x,o=t.y+s.y;return new x(i,o)}getTranslateForRoot(e){const t=this.graph.getModel(),s=new x(0,0);for(;e!=null;){const i=t.getGeometry(e);i!=null&&(s.x-=i.x,s.y-=i.y),e=t.getParent(e)}return s}computeEdgeCenter(e){const t=e.geometry.points,s=t[0],i=t[t.length-1];if(s!=null&&i!=null){const o=i.x-s.x,r=i.y-s.y;return new x(s.x+o/2,s.y+r/2)}}}class Se{constructor(e,t,s,i,o){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.bounds=s,this.label=i,this.isHorizontal=o}}class V{constructor(e,t,s,i,o=!1){g(this,"incomingIds",[]);g(this,"outgoingIds",[]);this.id=e,this.name=t,this.kind=s,this.parentId=i,this.instantiate=o}}class ye extends V{constructor(e,t,s,i,o,r=[]){super(e,t,s,i,o),this.markers=r}}class he extends ye{constructor(e,t,s,i,o,r){super(e,t,h.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class Oe extends ye{constructor(e,t,s,i,o){s==U.AD_HOC&&!o.includes(w.ADHOC)&&o.push(w.ADHOC),super(e,t,h.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class de extends V{constructor(e,t,s,i,o){super(e,t,s,o),this.eventDefinitionKind=i}}class Rt extends de{constructor(e,t,s,i,o){super(e,t,h.EVENT_START,s,i),this.isInterrupting=o}}class Ft extends de{constructor(e,t,s,i,o=!0){super(e,t,h.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class Pt extends V{constructor(e,t,s,i,o=ce.None){super(e,t,h.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}class Z{constructor(e){g(this,"ignoreBpmnColors");this.ignoreBpmnColors=(e==null?void 0:e.ignoreBpmnColors)??!0}computeStyle(e,t){const s=[e.bpmnElement.kind];let i;e instanceof Se?i=this.computeShapeStyleValues(e):(s.push(...Z.computeEdgeBaseStyles(e)),i=this.computeEdgeStyleValues(e));const o=this.computeFontStyleValues(e),r=Z.computeLabelStyleValues(e,t);return s.concat(ht([...i,...o,...r])).join(";")}computeShapeStyleValues(e){const t=new Map,s=e.bpmnElement;if(s instanceof de?Z.computeEventShapeStyle(s,t):s instanceof ye?Z.computeActivityShapeStyle(s,t):m.isPoolOrLane(s.kind)?t.set(c.STYLE_HORIZONTAL,e.isHorizontal?"0":"1"):s instanceof Pt&&(t.set(I.IS_INSTANTIATING,String(s.instantiate)),t.set(I.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),!this.ignoreBpmnColors){const i=e.extensions,o=i.fillColor;o&&(t.set(c.STYLE_FILLCOLOR,o),m.isPoolOrLane(s.kind)&&t.set(c.STYLE_SWIMLANE_FILLCOLOR,o)),i.strokeColor&&t.set(c.STYLE_STROKECOLOR,i.strokeColor)}return t}static computeEventShapeStyle(e,t){t.set(I.EVENT_DEFINITION_KIND,e.eventDefinitionKind),(e instanceof Ft||e instanceof Rt&&e.isInterrupting!==void 0)&&t.set(I.IS_INTERRUPTING,String(e.isInterrupting))}static computeActivityShapeStyle(e,t){e instanceof Oe?t.set(I.SUB_PROCESS_KIND,e.subProcessKind):e.kind===h.TASK_RECEIVE?t.set(I.IS_INSTANTIATING,String(e.instantiate)):e instanceof he&&t.set(I.GLOBAL_TASK_KIND,e.globalTaskKind);const s=e.markers;s.length>0&&t.set(I.MARKERS,s.join(","))}static computeEdgeBaseStyles(e){const t=[],s=e.bpmnElement;return s instanceof _t&&t.push(s.sequenceFlowKind),s instanceof bt&&t.push(s.associationDirectionKind),t}computeEdgeStyleValues(e){const t=new Map;if(!this.ignoreBpmnColors){const s=e.extensions;s.strokeColor&&t.set(c.STYLE_STROKECOLOR,s.strokeColor)}return t}computeFontStyleValues(e){var i,o;const t=new Map,s=(i=e.label)==null?void 0:i.font;if(s&&(t.set(c.STYLE_FONTFAMILY,s.name),t.set(c.STYLE_FONTSIZE,s.size),t.set(c.STYLE_FONTSTYLE,Ns(s))),!this.ignoreBpmnColors){const r=(o=e.label)==null?void 0:o.extensions;r!=null&&r.color&&t.set(c.STYLE_FONTCOLOR,r.color)}return t}static computeLabelStyleValues(e,t){const s=new Map,i=e.bpmnElement;return t?(s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),e.bpmnElement.kind!=h.TEXT_ANNOTATION&&s.set(c.STYLE_ALIGN,c.ALIGN_CENTER),e instanceof Se&&(s.set(c.STYLE_LABEL_WIDTH,t.width+1),s.set(c.STYLE_LABEL_POSITION,"ignore"),s.set(c.STYLE_VERTICAL_LABEL_POSITION,c.ALIGN_MIDDLE))):e instanceof Se&&(i instanceof Oe||i instanceof he&&i.callActivityKind===ae.CALLING_PROCESS)&&!i.markers.includes(w.EXPAND)&&s.set(c.STYLE_VERTICAL_ALIGN,c.ALIGN_TOP),s}computeMessageFlowIconStyle(e){const t=[];return t.push(["shape",I.MESSAGE_FLOW_ICON]),t.push([I.IS_INITIATING,String(e.messageVisibleKind===fe.INITIATING)]),this.ignoreBpmnColors||e.extensions.strokeColor&&t.push([c.STYLE_STROKECOLOR,e.extensions.strokeColor]),ht(t).join(";")}}function Ns(n){let e=0;return n.isBold&&(e+=c.FONT_BOLD),n.isItalic&&(e+=c.FONT_ITALIC),n.isStrikeThrough&&(e+=c.FONT_STRIKETHROUGH),n.isUnderline&&(e+=c.FONT_UNDERLINE),e}function ht(n){return n.filter(([,e])=>e&&e!="undefined").map(([e,t])=>`${e}=${t}`)}class Ls{constructor(e,t,s){this.graph=e,this.coordinatesTranslator=t,this.styleComputer=s}render(e,t){this.insertShapesAndEdges(e),this.graph.customFit(t)}insertShapesAndEdges({pools:e,lanes:t,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){this.graph.batchUpdate(()=>{this.graph.getModel().clear(),this.insertShapes(e),this.insertShapes(t),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)})}insertShapes(e){e.forEach(t=>this.insertShape(t))}getParent(e){return this.getCell(e.parentId)??this.graph.getDefaultParent()}insertShape(e){var l;const t=e.bpmnElement,s=this.getParent(t),i=e.bounds;let o=(l=e.label)==null?void 0:l.bounds;o=m.isPoolOrLane(t.kind)?void 0:o;const r=this.styleComputer.computeStyle(e,o);this.insertVertex(s,t.id,t.name,i,o,r)}insertEdges(e){e.forEach(t=>{var d;const s=t.bpmnElement,i=this.graph.getDefaultParent(),o=this.getCell(s.sourceRefId),r=this.getCell(s.targetRefId),l=(d=t.label)==null?void 0:d.bounds,a=this.styleComputer.computeStyle(t,l),u=this.graph.insertEdge(i,s.id,s.name,o,r,a);if(this.insertWaypoints(t.waypoints,u),l){u.geometry.width=l.width,u.geometry.height=l.height;const f=this.coordinatesTranslator.computeEdgeCenter(u);if(f){u.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new x(l.x,l.y)),T=p.x+l.width/2-f.x,A=p.y-f.y;u.geometry.offset=new x(T,A)}}this.insertMessageFlowIconIfNeeded(t,u)})}insertMessageFlowIconIfNeeded(e,t){if(e.bpmnElement instanceof wt&&e.messageVisibleKind!==fe.NONE){const s=this.graph.insertVertex(t,He(t.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(e));s.geometry.relative=!0,s.geometry.offset=new x(-10,-7)}}insertWaypoints(e,t){e&&(t.geometry.points=e.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(t.parent,new x(s.x,s.y))))}getCell(e){return this.graph.getModel().getCell(e)}insertVertex(e,t,s,i,o,r){const l=this.coordinatesTranslator.computeRelativeCoordinates(e,new x(i.x,i.y)),a=this.graph.insertVertex(e,t,s,l.x,l.y,i.width,i.height,r);if(o){const u=o.x-i.x,d=o.y-i.y;a.geometry.offset=new x(u,d)}return a}}function vs(n,e){return new Ls(n,new Os(n),new Z(e))}function He(n){return`messageFlowIcon_of_${n}`}var Ke={},_e={};(function(n){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",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),o=function(l,a){const u=[];let d=a.exec(l);for(;d;){const f=[];f.startIndex=a.lastIndex-d[0].length;const p=d.length;for(let T=0;T"u")};n.isExist=function(l){return typeof l<"u"},n.isEmptyObject=function(l){return Object.keys(l).length===0},n.merge=function(l,a,u){if(a){const d=Object.keys(a),f=d.length;for(let p=0;p"&&n[o]!==" "&&n[o]!==" "&&n[o]!==` +`&&n[o]!=="\r";o++)a+=n[o];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),o--),!ks(a)){let f;return a.trim().length===0?f="Invalid space after '<'.":f="Tag '"+a+"' is an invalid name.",v("InvalidTag",f,R(n,o))}const u=bs(n,o);if(u===!1)return v("InvalidAttr","Attributes for '"+a+"' have open quote.",R(n,o));let d=u.value;if(o=u.index,d[d.length-1]==="/"){const f=o-d.length;d=d.substring(0,d.length-1);const p=Tt(d,e);if(p===!0)s=!0;else return v(p.err.code,p.err.msg,R(n,f+p.err.line))}else if(l)if(u.tagClosed){if(d.trim().length>0)return v("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",R(n,r));{const f=t.pop();if(a!==f.tagName){let p=R(n,f.tagStartPos);return v("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+a+"'.",R(n,r))}t.length==0&&(i=!0)}}else return v("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",R(n,o));else{const f=Tt(d,e);if(f!==!0)return v(f.err.code,f.err.msg,R(n,o-d.length+f.err.line));if(i===!0)return v("InvalidXml","Multiple possible root nodes found.",R(n,o));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(o++;o0)return v("InvalidXml","Invalid '"+JSON.stringify(t.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return v("InvalidXml","Start tag expected.",1);return!0};function dt(n){return n===" "||n===" "||n===` +`||n==="\r"}function ft(n,e){const t=e;for(;e5&&s==="xml")return v("InvalidXml","XML declaration allowed only at the start of the document.",R(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function gt(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const _s='"',ws="'";function bs(n,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=n[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const Rs=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function Tt(n,e){const t=ze.getAllMatches(n,Rs),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n}},Ms=function(n){return Object.assign({},xt,n)};Xe.buildOptions=Ms;Xe.defaultOptions=xt;class Bs{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,[":@"]:e[":@"]}):this.child.push({[e.tagname]:e.child})}}var Gs=Bs;const Vs=_e;function Ys(n,e){const t={};if(n[e+3]==="O"&&n[e+4]==="C"&&n[e+5]==="T"&&n[e+6]==="Y"&&n[e+7]==="P"&&n[e+8]==="E"){e=e+9;let s=1,i=!1,o=!1,r="";for(;e"){if(o?n[e-1]==="-"&&n[e-2]==="-"&&(o=!1,s--):s--,s===0)break}else n[e]==="["?i=!0:r+=n[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function Us(n,e){let t="";for(;e0&&i&&t[2]!==".")return n;if(!e.leadingZeros&&o.length>0&&!i&&t[1]!==".")return n;{const a=Number(t),u=""+a;return u.search(/[eE]/)!==-1||l?e.eNotation?a:n:t.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?a:n:o?r===u||i+r===u?a:n:t===u||t===i+u?a:n}}else return n}}function Js(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substr(0,n.length-1))),n}var ei=Qs;const $e=_e,re=Gs,ti=$s,ni=ei;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,$e.nameRegexp);let si=class{constructor(e){this.options=e,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=ii,this.parseXml=ci,this.parseTextData=oi,this.resolveNameSpace=ri,this.buildAttributesMap=ai,this.isItStopNode=fi,this.replaceEntitiesValue=hi,this.readStopNodeData=Ti,this.saveTextToParentTag=di,this.addChild=ui}};function ii(n){const e=Object.keys(n);for(let t=0;t0)){r||(n=this.replaceEntitiesValue(n));const l=this.options.tagValueProcessor(e,n,t,i,o);return l==null?n:typeof l!=typeof n||l!==n?l:this.options.trimValues?Ye(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?Ye(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function ri(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const li=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function ai(n,e,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const s=$e.getAllMatches(n,li),i=s.length,o={};for(let r=0;r",o,"Closing Tag is not closed.");let a=n.substring(o+2,l).trim();if(this.options.removeNSPrefix){const f=a.indexOf(":");f!==-1&&(a=a.substr(f+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const u=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let d=0;u&&this.options.unpairedTags.indexOf(u)!==-1?(d=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):d=i.lastIndexOf("."),i=i.substring(0,d),t=this.tagsNodeStack.pop(),s="",o=l}else if(n[o+1]==="?"){let l=Ve(n,o,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const a=new re(l.tagName);a.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(a[":@"]=this.buildAttributesMap(l.tagExp,i,l.tagName)),this.addChild(t,a,i)}o=l.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const l=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const a=n.substring(o+4,l-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}o=l}else if(n.substr(o+1,2)==="!D"){const l=ti(n,o);this.docTypeEntities=l.entities,o=l.i}else if(n.substr(o+1,2)==="!["){const l=$(n,"]]>",o,"CDATA is not closed.")-2,a=n.substring(o+9,l);if(s=this.saveTextToParentTag(s,t,i),this.options.cdataPropName)t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]);else{let u=this.parseTextData(a,t.tagname,i,!0,!1,!0);u==null&&(u=""),t.add(this.options.textNodeName,u)}o=l+2}else{let l=Ve(n,o,this.options.removeNSPrefix),a=l.tagName,u=l.tagExp,d=l.attrExpPresent,f=l.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const p=t;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let T="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=l.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)o=l.closeIndex;else{const M=this.readStopNodeData(n,a,f+1);if(!M)throw new Error(`Unexpected end of ${a}`);o=M.i,T=M.tagContent}const A=new re(a);a!==u&&d&&(A[":@"]=this.buildAttributesMap(u,i,a)),T&&(T=this.parseTextData(T,a,i,!0,d,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),A.add(this.options.textNodeName,T),this.addChild(t,A,i)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const T=new re(a);a!==u&&d&&(T[":@"]=this.buildAttributesMap(u,i,a)),this.addChild(t,T,i),i=i.substr(0,i.lastIndexOf("."))}else{const T=new re(a);this.tagsNodeStack.push(t),a!==u&&d&&(T[":@"]=this.buildAttributesMap(u,i,a)),this.addChild(t,T,i),t=T}s="",o=f}}else s+=n[o];return e.child};function ui(n,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e))}const hi=function(n){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];n=n.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];n=n.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];n=n.replace(t.regex,t.val)}n=n.replace(this.ampEntity.regex,this.ampEntity.val)}return n};function di(n,e,t,s){return n&&(s===void 0&&(s=Object.keys(e.child).length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function fi(n,e,t){const s="*."+t;for(const i in n){const o=n[i];if(s===o||e===o)return!0}return!1}function gi(n,e,t=">"){let s,i="";for(let o=e;o",t,`${e} is not closed`);if(n.substring(t+2,o).trim()===e&&(i--,i===0))return{tagContent:n.substring(s,t),i:o};t=o}else if(n[t+1]==="?")t=$(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=$(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=$(n,"]]>",t,"StopNode is not closed.")-2;else{const o=Ve(n,t,">");o&&((o&&o.tagName)===e&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,t=o.closeIndex)}}function Ye(n,e,t){if(e&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:ni(n,t)}else return $e.isExist(n)?n:""}var pi=si,kt={};function Ei(n,e){return Mt(n,e)}function Mt(n,e,t){let s;const i={};for(let o=0;o0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function Si(n){const e=Object.keys(n);for(let t=0;t0&&(t=yi),Bt(n,e,"",t)}function Bt(n,e,t,s){let i="",o=!1;for(let r=0;r`,o=!1;continue}else if(a===e.commentPropName){i+=s+``,o=!0;continue}else if(a[0]==="?"){const A=pt(l[":@"],e),M=a==="?xml"?"":s;let z=l[a][0][e.textNodeName];z=z.length!==0?" "+z:"",i+=M+`<${a}${z}${A}?>`,o=!0;continue}let d=s;d!==""&&(d+=e.indentBy);const f=pt(l[":@"],e),p=s+`<${a}${f}`,T=Bt(l[a],e,u,d);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!T||T.length===0)&&e.suppressEmptyNode?i+=p+"/>":T&&T.endsWith(">")?i+=p+`>${T}${s}`:(i+=p+">",T&&s!==""&&(T.includes("/>")||T.includes("`),o=!0}return i}function wi(n){const e=Object.keys(n);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function K(n){this.options=Object.assign({},Pi,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Mi),this.processTextOrObjNode=xi,this.options.format?(this.indentate=ki,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}Y.prototype.build=function(n){return this.options.preserveOrder?Ei(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};Y.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(!(typeof n[i]>"u"))if(n[i]===null)i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let a=0;a"u"||(c===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof c=="object"?this.options.oneListGroup?r+=this.j2x(c,e+1).val:r+=this.processTextOrObjNode(c,i,e):r+=this.buildTextValNode(c,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let a=0;a"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};Y.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class yi{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t)=>this.processAttribute(t)});g(this,"xmlParser",new vi.XMLParser(this.x2jOptions));this.options=e}parse(e){let t;try{t=this.xmlParser.parse(e)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!t.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return t}processAttribute(e){var t;for(const s of _i)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class q{}class wi{warning(e){const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class Ri extends q{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueRef=t}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class xi extends q{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class bi extends q{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Fi extends q{constructor(e,t){super(),this.shapeOrEdgeId=e,this.labelStyleId=t}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Pi extends q{constructor(e,t){super(),this.laneId=e,this.flowNodeRef=t}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class ki extends q{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToRef=t,this.attachedToKind=s}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 Mi{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(e){return this.poolsById.get(e)}findPoolByProcessRef(e){return this.poolsByProcessRef.get(e)}registerPool(e,t){this.poolsById.set(e.id,e),t&&this.poolsByProcessRef.set(t,e)}findMessageFlow(e){return this.messageFlows.get(e)}registerMessageFlow(e){this.messageFlows.set(e.id,e)}findFlowNode(e){return this.flowNodes.get(e)}registerFlowNode(e){this.flowNodes.set(e.id,e)}findLane(e){return this.lanes.get(e)}registerLane(e){this.lanes.set(e.id,e)}findSequenceFlow(e){return this.sequenceFlows.get(e)}registerSequenceFlow(e){this.sequenceFlows.set(e.id,e)}findAssociationFlow(e){return this.associationFlows.get(e)}registerAssociationFlow(e){this.associationFlows.set(e.id,e)}findEventDefinitionOfDefinition(e){return this.eventDefinitionsOfDefinitions.get(e)}registerEventDefinitionsOfDefinition(e,t){this.eventDefinitionsOfDefinitions.set(e,t)}findGlobalTask(e){return this.globalTasks.get(e)}registerGlobalTask(e,t){this.globalTasks.set(e,t)}findCategoryValue(e){return this.categoryValues.get(e)}registerCategoryValue(e,t){this.categoryValues.set(e,{value:t})}}const wt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new k(t.id,i.value,d.GROUP,s);e.warning(new Ri(t.id,t.categoryValueRef))};class Bi{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){m(e).forEach(t=>this.parseCollaboration(t))}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){m(e).forEach(t=>this.convertedElements.registerPool(new k(t.id,t.name,d.POOL),t.processRef))}buildMessageFlows(e){m(e).forEach(t=>this.convertedElements.registerMessageFlow(new mt(t.id,t.name,t.sourceRef,t.targetRef)))}buildGroups(e){m(e).forEach(t=>{const s=wt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)})}}const Gi=(n,e)=>{switch(n){case"adHocSubProcess":return B.AD_HOC;case"transaction":return B.TRANSACTION;default:return e.triggeredByEvent?B.EVENT:B.EMBEDDED}},Vi=["adHocSubProcess","transaction"].concat(S.flowNodeKinds().filter(n=>n!=d.EVENT_BOUNDARY)).concat([d.EVENT_BOUNDARY]);function Yi(n){return["adHocSubProcess","transaction"].includes(n)?d.SUB_PROCESS:n}class Ui{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){m(e).forEach(t=>this.parseProcess(t)),m(e).forEach(t=>this.assignParentOfProcessElementsCalledByCallActivity(t.id)),this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id),this.elementsWithoutParentByProcessId.get(e).forEach(i=>{i.parentId=t.id})}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};this.convertedElements.getFlows().forEach(t=>{e(t.sourceRefId,"outgoingIds",t.id),e(t.targetRefId,"incomingIds",t.id)})}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new k(s.id,e.name,d.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]),Vi.forEach(s=>this.buildFlowNodeBpmnElements(e[s],Yi(s),t,e.id,s)),this.buildLaneBpmnElements(e[d.LANE],t,e.id),this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){m(e).forEach(r=>{let a;if(S.isEvent(t))a=this.buildShapeBpmnEvent(r,t,s);else if(S.isActivity(t))a=this.buildShapeBpmnActivity(r,t,s,o);else if(t==d.GATEWAY_EVENT_BASED){const u=r;a=new At(r.id,u.name,s,u.instantiate,ie[u.eventGatewayType])}else if(t==d.GROUP)a=wt(this.convertedElements,this.parsingMessageCollector,r,s);else{const u=t===d.TEXT_ANNOTATION?r.text:r.name;a=new k(r.id,u,t,s,r.instantiate)}const c=r.default;S.isWithDefaultSequenceFlow(t)&&c&&this.defaultSequenceFlowIds.push(c),a&&(this.convertedElements.registerFlowNode(a),s||this.elementsWithoutParentByProcessId.get(i).push(a),a.incomingIds=m(r.incoming),a.outgoingIds=m(r.outgoing))})}buildShapeBpmnActivity(e,t,s,i){const o=Wi(e);return S.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,Gi(i,e),o):S.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new Ie(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new oe(e.id,e.name,se.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new oe(e.id,e.name,se.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=i.map(r=>r.counter).reduce((r,a)=>r+a,0);if(o==0&&S.canHaveNoneEvent(t))return new re(e.id,e.name,t,_.NONE,s);if(o==1){const r=i[0].kind;return S.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,r):S.isStartEvent(t)?new St(e.id,e.name,r,s,e.isInterrupting):new re(e.id,e.name,t,r,s)}}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(S.isActivity(s==null?void 0:s.kind))return new It(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new ki(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;return lt.forEach(s=>{const i=e[s+"EventDefinition"],o=m(i,!0).length;t.set(s,o)}),m(e.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);t.set(i,t.get(i)+1)}),Array.from(t.keys()).map(s=>({kind:s,counter:t.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(e,t,s,i){const o=new pe(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){m(e).forEach(i=>this.buildLaneBpmnElements(i.lane,t,s))}buildLaneBpmnElements(e,t,s){m(e).forEach(i=>{var r;const o=new k(i.id,i.name,d.LANE,t);this.convertedElements.registerLane(o),t||this.elementsWithoutParentByProcessId.get(s).push(o),this.assignParentOfLaneFlowNodes(i),(r=i.childLaneSet)!=null&&r.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)})}assignParentOfLaneFlowNodes(e){m(e.flowNodeRef).forEach(t=>{const s=this.convertedElements.findFlowNode(t),i=e.id;s?S.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Pi(i,t))})}buildSequenceFlows(e){m(e).forEach(t=>{const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new Et(t.id,t.name,t.sourceRef,t.targetRef,s))})}buildAssociationFlows(e){m(e).forEach(t=>{const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new Ct(t.id,void 0,t.sourceRef,t.targetRef,s))})}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return P.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&S.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return S.isActivity(t.kind)?P.CONDITIONAL_FROM_ACTIVITY:P.CONDITIONAL_FROM_GATEWAY}return P.NORMAL}}const Wi=n=>{const e=[],t=n.standardLoopCharacteristics,s=m(n.multiInstanceLoopCharacteristics,!0)[0];return t||t===""?e.push(v.LOOP):s&&e.push(s.isSequential?v.MULTI_INSTANCE_SEQUENTIAL:v.MULTI_INSTANCE_PARALLEL),e};class Di{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class Hi{constructor(e,t,s,i,o=ae.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Ki{constructor(e,t){this.x=e,this.y=t}}class zi{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class Xi{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class z{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=m(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const a=r.BPMNPlane,c=this.deserializeEdges(a.BPMNEdge),u=this.deserializeShapes(a.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...c)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map,m(e).forEach(t=>m(t.Font).forEach(s=>this.convertedFonts.set(t.id,new Xi(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};return m(e).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new xi(s.bpmnElement))}),t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=z.deserializeBounds(e);(s instanceof pe||s instanceof oe&&s.callActivityKind===se.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(v.EXPAND);let o;S.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,a=this.deserializeLabel(r,e.id),c=new he(e.id,s,i,a,o);return z.setColorExtensionsOnShape(c,e),c}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new Di(t.x,t.y,t.width,t.height)}deserializeEdges(e){return m(e).map(t=>{const s=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!s){this.parsingMessageCollector.warning(new bi(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:ae.NONE,a=new Hi(t.id,s,i,o,r);return z.setColorExtensionsOnEdge(a,t),a}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return m(e).map(t=>new Ki(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=z.deserializeBounds(e),o=new zi(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new Fi(t,e))),s}}class $i{constructor(e){this.convertedElements=e}deserialize(e){lt.forEach(t=>{const s=e[t+"EventDefinition"];m(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,t))})}}class Zi{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,d.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,d.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,d.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,d.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,d.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){m(e).forEach(s=>this.convertedElements.registerGlobalTask(s.id,t))}}class ji{constructor(e){this.convertedElements=e}deserialize(e){m(e.category).forEach(t=>m(t.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class qi{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(e){const t=e.definitions;return this.categoryConverter.deserialize(t),this.collaborationConverter.deserialize(t.collaboration),this.eventDefinitionConverter.deserialize(t),this.globalTaskConverter.deserialize(t),this.processConverter.deserialize(t.process),this.diagramConverter.deserialize(t.BPMNDiagram)}}function Qi(n){const e=new Mi;return new qi(new ji(e),new Bi(e,n),new $i(e),new Zi(e),new Ui(e,n),new z(e,n))}class Ji{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function eo(n){return new Ji(Qi(new wi),new yi(n))}class to{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return Array.from(this.classNamesByBpmnId.get(e)??[])}getBpmnIds(){return Array.from(this.classNamesByBpmnId.keys())}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.sizes(i,r)),i.size!=o}getOrInitializeClassNames(e){let t=this.classNamesByBpmnId.get(e);return t==null&&(t=new Set,this.classNamesByBpmnId.set(e,t)),t}}class Ye{constructor(){g(this,"overlayPositions",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(e){const t=this.convertPosition(e),s=Ye.convertStyle(e);return{position:t,style:s}}convertPosition(e){return this.overlayPositions.get(e.position)}static convertStyle(e){const t={fill:{color:E.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:E.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:E.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:E.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:E.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:E.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=e.style,i={...t};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(e,t){t&&(e.fill.color=t.color??e.fill.color,e.fill.opacity=t.opacity??e.fill.opacity)}static convertStroke(e,t){t&&(e.stroke.color=t.color??e.stroke.color,e.stroke.width=t.width??e.stroke.width)}static convertFont(e,t){t&&(e.font.color=t.color??e.font.color,e.font.size=t.size??e.font.size)}}function no(n){return new so(n,new Ye)}class so{constructor(e,t){this.graph=e,this.overlayConverter=t}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(Ot(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel().getCell(e);if(!s)return;let i=s.getStyle();i=w(i,C.EXTRA_CSS_CLASSES,t.join(",")),this.graph.model.setStyle(s,i)}addOverlays(e,t){const s=this.graph.getModel().getCell(e);s&&m(t).forEach(i=>{const o=new ft(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(e){const t=this.graph.getModel().getCell(e);t&&this.graph.removeCellOverlays(t)}updateStyle(e,t){if(!t)return;const s=m(e).map(i=>this.graph.getModel().getCell(i)).filter(Boolean);s.length!=0&&this.graph.batchUpdate(()=>{for(const i of s){let o=i.getStyle();o=w(o,l.mxConstants.STYLE_OPACITY,t.opacity,Ce),o=io(o,t.stroke),o=oo(o,t.font),ao(t)&&(o=ro(o,t.fill)),this.graph.model.setStyle(i,o)}})}}const Ee=n=>n=="default"?void 0:n,io=(n,e)=>(e&&(n=w(n,l.mxConstants.STYLE_STROKECOLOR,e.color,Ee),n=w(n,l.mxConstants.STYLE_STROKE_OPACITY,e.opacity,Ce),n=w(n,l.mxConstants.STYLE_STROKEWIDTH,e.width,_n)),n),w=(n,e,t,s=i=>i)=>t==null?n:l.mxUtils.setStyle(n,e,s(t)),de=(n,e,t,s)=>s==null?n:l.mxUtils.setStyleFlag(n,e,t,s),oo=(n,e)=>(e&&(n=w(n,l.mxConstants.STYLE_FONTCOLOR,e.color,Ee),n=w(n,l.mxConstants.STYLE_FONTSIZE,e.size),n=w(n,l.mxConstants.STYLE_FONTFAMILY,e.family),n=de(n,l.mxConstants.STYLE_FONTSTYLE,l.mxConstants.FONT_BOLD,e.isBold),n=de(n,l.mxConstants.STYLE_FONTSTYLE,l.mxConstants.FONT_ITALIC,e.isItalic),n=de(n,l.mxConstants.STYLE_FONTSTYLE,l.mxConstants.FONT_UNDERLINE,e.isUnderline),n=de(n,l.mxConstants.STYLE_FONTSTYLE,l.mxConstants.FONT_STRIKETHROUGH,e.isStrikeThrough),n=w(n,l.mxConstants.STYLE_TEXT_OPACITY,e.opacity,Ce)),n),ro=(n,e)=>(e.color&&(n=w(n,l.mxConstants.STYLE_FILLCOLOR,e.color,Ee),(n.includes(d.POOL)||n.includes(d.LANE))&&(n=w(n,l.mxConstants.STYLE_SWIMLANE_FILLCOLOR,e.color,Ee))),n=w(n,l.mxConstants.STYLE_FILL_OPACITY,e.opacity,Ce),n),ao=n=>n&&typeof n=="object"&&"fill"in n;class lo{element(e){return`svg > g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function co(n,e){return new uo(n,new ho(e.container,new lo),new to,no(e))}class uo{constructor(e,t,s,i){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssRegistry=s,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear)}getElementsByIds(e){return m(e).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(Boolean).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getElementsByKinds(e){return m(e).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map(s=>({htmlElement:s,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(s.getAttribute("data-bpmn-id"))}))).reduce((t,s)=>(t.push(...s),t),[])}addCssClasses(e,t){this.updateCssClasses(e,t,this.cssRegistry.addClassNames)}removeCssClasses(e,t){this.updateCssClasses(e,t,this.cssRegistry.removeClassNames)}removeAllCssClasses(e){if(e)m(e).forEach(t=>{const s=this.cssRegistry.removeAllClassNames(t);this.updateCellIfChanged(s,t)});else{const t=this.cssRegistry.getBpmnIds();this.cssRegistry.clear(),t.forEach(s=>this.updateCellIfChanged(!0,s))}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssRegistry.toggleClassNames)}updateCssClasses(e,t,s){const i=m(t);m(e).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(e,t){if(e){const s=this.cssRegistry.getClassNames(t);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(t,s)}}addOverlays(e,t){this.graphCellUpdater.addOverlays(e,t)}removeAllOverlays(e){this.graphCellUpdater.removeAllOverlays(e)}updateStyle(e,t){this.graphCellUpdater.updateStyle(e,t)}}class ho{constructor(e,t){this.container=e,this.querySelectors=t}getBpmnHtmlElement(e){return this.container.querySelector(this.querySelectors.element(e))}getBpmnHtmlElements(e){const t=this.querySelectors.elementsOfKind(we(e));return[...this.container.querySelectorAll(t)]}}class fo{filter(e,t){const s=[],i=[];if(m(t==null?void 0:t.pools).filter(T=>T&&Object.keys(T).length).forEach(T=>T.id?s.push(T.id):T.name&&i.push(T.name)),s.length==0&&i.length==0)return e;const{filteredPools:o,filteredPoolIds:r}=go(e,s,i),a=[...s,...r],{filteredLanes:c,filteredLaneIds:u,filteredFlowNodes:h,filteredFlowNodeIds:f}=Rt(e.lanes,e.flowNodes,a),p=po(e.edges,[...a,...u,...f]);if(o.length==0&&c.length==0&&h.length==0&&p.length==0){let T=s.length>0?` for ids [${s}]`:"";const I=T?" and":"";throw T+=i.length>0?`${I} for names [${i}]`:"",new Error("No matching pools"+T)}return{lanes:c,flowNodes:h,pools:o,edges:p}}}function go(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Rt(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=xt(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:a,filteredFlowNodeIds:c}=To(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:a,filteredFlowNodeIds:c}}function xt(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=xt(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function To(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:a,filteredFlowNodeIds:c}=Rt(t,n,i);return s.push(...a),i.push(...c),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function po(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceRefId)&&e.includes(t.bpmnElement.targetRefId))}class Eo{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new fo().filter(e,t);return this.searchableModel=new Co(s),(i=this.onLoadCallback)==null||i.call(this),mo(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var r;const t=(r=this.searchableModel)==null?void 0:r.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof k,o={id:e,name:s.name,isShape:i,kind:s.kind};return s instanceof Se?(o.sourceRefId=s.sourceRefId,o.targetRefId=s.targetRefId):(o.incomingIds=s.incomingIds,o.outgoingIds=s.outgoingIds),o}}function mo(n){const e=n.flowNodes.filter(o=>{const r=o.bpmnElement;return S.isSubProcess(r.kind)&&r.markers.includes(v.EXPAND)}).map(o=>o.bpmnElement.id),t=[],s=[],i=[];return n.flowNodes.forEach(o=>{const r=o.bpmnElement.kind;S.isSubProcess(r)?t.push(o):S.isBoundaryEvent(r)?s.push(o):e.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class Co{constructor(e){g(this,"elements",new Map);[].concat(e.pools,e.lanes,e.flowNodes,e.edges).forEach(t=>this.elements.set(t.bpmnElement.id,t))}elementById(e){return this.elements.get(e)}}function So(n){return n instanceof HTMLElement?n:document.getElementById(n)}class Io{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const Ao="0.36.0",Oo=()=>({lib:Ao,dependencies:new Map([["mxGraph",l.mxClient.VERSION]])});class No{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new ls(So(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new Io(this.graph),this.bpmnModelRegistry=new Eo,this.bpmnElementsRegistry=co(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=eo(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);hs(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return Oo()}}function zo(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function A(n,...e){Ue("[DEMO]",n,...e)}function Ue(n,e,...t){console.info(n+" "+e,...t)}function R(n,...e){Ue("[DEMO STARTUP]",n,...e)}function bt(n,e){Ft(n),window.alert(e??n)}function Ft(n){console.error("[DEMO]",n)}function $(n,...e){Ue("[DEMO DOWNLOAD]",n,...e)}function Lo(n){return A(`Fetching BPMN content from url ${n}`),fetch(n).then(e=>{if(!e.ok)throw Error(`HTTP status ${e.status}`);return e.text()})}class vo{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.getElementById(this.outerContainerId);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){e.forEach(s=>t.addEventListener(s,this.preventDefaults,!1))}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.appendChild(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.appendChild(s),e.parentNode.prepend(i)}addStyle(){const e=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}K.prototype.build=function(n){return this.options.preserveOrder?Fi(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};K.prototype.j2x=function(n,e){let t="",s="";for(let i in n)if(!(typeof n[i]>"u"))if(n[i]===null)i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextValNode(n[i],i,"",e);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)t+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(n[i],i,"",e)}else if(Array.isArray(n[i])){const o=n[i].length;let r="";for(let l=0;l"u"||(a===null?i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?this.options.oneListGroup?r+=this.j2x(a,e+1).val:r+=this.processTextOrObjNode(a,i,e):r+=this.buildTextValNode(a,i,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,"",e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),r=o.length;for(let l=0;l"+n+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+o+this.tagEndChar+n+this.indentate(s)+i}};K.prototype.closeTag=function(n){let e="";return this.options.unpairedTags.indexOf(n)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,n);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e"},{regex:/&(lt|#60|#x3c|#x3C);/g,val:"<"},{regex:/&(quot|#34|#x22);/g,val:'"'}];class Di{constructor(e){g(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(e,t)=>this.processAttribute(t)});g(this,"xmlParser",new Ui.XMLParser(this.x2jOptions));this.options=e}parse(e){let t;try{t=this.xmlParser.parse(e)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!t.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return t}processAttribute(e){var t;for(const s of Wi)e=e.replace(s.regex,s.val);return(t=this.options)!=null&&t.additionalXmlAttributeProcessor&&(e=this.options.additionalXmlAttributeProcessor(e)),e}}class ne{}class Hi{warning(e){const t=e.getMessage();console.warn(`[bv-parser] ${t.template}`,...t.arguments)}}class Ki extends ne{constructor(e,t){super(),this.groupBpmnElementId=e,this.categoryValueRef=t}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class zi extends ne{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Xi extends ne{constructor(e){super(),this.bpmnElementId=e}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class $i extends ne{constructor(e,t){super(),this.shapeOrEdgeId=e,this.labelStyleId=t}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class ji extends ne{constructor(e,t){super(),this.laneId=e,this.flowNodeRef=t}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Zi extends ne{constructor(e,t,s){super(),this.bpmnElementId=e,this.attachedToRef=t,this.attachedToKind=s}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 qi{constructor(){g(this,"poolsById",new Map);g(this,"poolsByProcessRef",new Map);g(this,"messageFlows",new Map);g(this,"flowNodes",new Map);g(this,"lanes",new Map);g(this,"sequenceFlows",new Map);g(this,"associationFlows",new Map);g(this,"eventDefinitionsOfDefinitions",new Map);g(this,"globalTasks",new Map);g(this,"categoryValues",new Map)}getFlows(){return[...this.messageFlows.values(),...this.sequenceFlows.values(),...this.associationFlows.values()]}findPoolById(e){return this.poolsById.get(e)}findPoolByProcessRef(e){return this.poolsByProcessRef.get(e)}registerPool(e,t){this.poolsById.set(e.id,e),t&&this.poolsByProcessRef.set(t,e)}findMessageFlow(e){return this.messageFlows.get(e)}registerMessageFlow(e){this.messageFlows.set(e.id,e)}findFlowNode(e){return this.flowNodes.get(e)}registerFlowNode(e){this.flowNodes.set(e.id,e)}findLane(e){return this.lanes.get(e)}registerLane(e){this.lanes.set(e.id,e)}findSequenceFlow(e){return this.sequenceFlows.get(e)}registerSequenceFlow(e){this.sequenceFlows.set(e.id,e)}findAssociationFlow(e){return this.associationFlows.get(e)}registerAssociationFlow(e){this.associationFlows.set(e.id,e)}findEventDefinitionOfDefinition(e){return this.eventDefinitionsOfDefinitions.get(e)}registerEventDefinitionsOfDefinition(e,t){this.eventDefinitionsOfDefinitions.set(e,t)}findGlobalTask(e){return this.globalTasks.get(e)}registerGlobalTask(e,t){this.globalTasks.set(e,t)}findCategoryValue(e){return this.categoryValues.get(e)}registerCategoryValue(e,t){this.categoryValues.set(e,{value:t})}}const Vt=(n,e,t,s)=>{const i=n.findCategoryValue(t.categoryValueRef);if(i)return new V(t.id,i.value,h.GROUP,s);e.warning(new Ki(t.id,t.categoryValueRef))};class Qi{constructor(e,t){this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){S(e).forEach(t=>this.parseCollaboration(t))}parseCollaboration(e){this.buildParticipant(e.participant),this.buildMessageFlows(e.messageFlow),this.buildGroups(e.group)}buildParticipant(e){S(e).forEach(t=>this.convertedElements.registerPool(new V(t.id,t.name,h.POOL),t.processRef))}buildMessageFlows(e){S(e).forEach(t=>this.convertedElements.registerMessageFlow(new wt(t.id,t.name,t.sourceRef,t.targetRef)))}buildGroups(e){S(e).forEach(t=>{const s=Vt(this.convertedElements,this.parsingMessageCollector,t);s&&this.convertedElements.registerFlowNode(s)})}}const Ji=(n,e)=>{switch(n){case"adHocSubProcess":return U.AD_HOC;case"transaction":return U.TRANSACTION;default:return e.triggeredByEvent?U.EVENT:U.EMBEDDED}},eo=["adHocSubProcess","transaction"].concat(m.flowNodeKinds().filter(n=>n!=h.EVENT_BOUNDARY)).concat([h.EVENT_BOUNDARY]);function to(n){return["adHocSubProcess","transaction"].includes(n)?h.SUB_PROCESS:n}class no{constructor(e,t){g(this,"defaultSequenceFlowIds",[]);g(this,"elementsWithoutParentByProcessId",new Map);g(this,"callActivitiesCallingProcess",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){S(e).forEach(t=>this.parseProcess(t)),S(e).forEach(t=>this.assignParentOfProcessElementsCalledByCallActivity(t.id)),this.assignIncomingAndOutgoingIdsFromFlows()}assignParentOfProcessElementsCalledByCallActivity(e){const t=this.callActivitiesCallingProcess.get(e);if(t){const s=this.convertedElements.findPoolByProcessRef(e);s&&(s.parentId=t.id),this.elementsWithoutParentByProcessId.get(e).forEach(i=>{i.parentId=t.id})}}assignIncomingAndOutgoingIdsFromFlows(){const e=(t,s,i)=>{const o=this.convertedElements.findFlowNode(t)??this.convertedElements.findLane(t)??this.convertedElements.findPoolById(t);o&&!o[s].includes(i)&&o[s].push(i)};this.convertedElements.getFlows().forEach(t=>{e(t.sourceRefId,"outgoingIds",t.id),e(t.targetRefId,"incomingIds",t.id)})}parseProcess(e){const t=e.id,s=this.convertedElements.findPoolByProcessRef(t);s&&!s.name&&this.convertedElements.registerPool(new V(s.id,e.name,h.POOL),t),this.buildProcessInnerElements(e,s==null?void 0:s.id)}buildProcessInnerElements(e,t){this.elementsWithoutParentByProcessId.set(e.id,[]),eo.forEach(s=>this.buildFlowNodeBpmnElements(e[s],to(s),t,e.id,s)),this.buildLaneBpmnElements(e[h.LANE],t,e.id),this.buildLaneSetBpmnElements(e.laneSet,t,e.id),this.buildSequenceFlows(e.sequenceFlow),this.buildAssociationFlows(e.association)}buildFlowNodeBpmnElements(e,t,s,i,o){S(e).forEach(r=>{let l;if(m.isEvent(t))l=this.buildShapeBpmnEvent(r,t,s);else if(m.isActivity(t))l=this.buildShapeBpmnActivity(r,t,s,o);else if(t==h.GATEWAY_EVENT_BASED){const u=r;l=new Pt(r.id,u.name,s,u.instantiate,ce[u.eventGatewayType])}else if(t==h.GROUP)l=Vt(this.convertedElements,this.parsingMessageCollector,r,s);else{const u=t===h.TEXT_ANNOTATION?r.text:r.name;l=new V(r.id,u,t,s,r.instantiate)}const a=r.default;m.isWithDefaultSequenceFlow(t)&&a&&this.defaultSequenceFlowIds.push(a),l&&(this.convertedElements.registerFlowNode(l),s||this.elementsWithoutParentByProcessId.get(i).push(l),l.incomingIds=S(r.incoming),l.outgoingIds=S(r.outgoing))})}buildShapeBpmnActivity(e,t,s,i){const o=so(e);return m.isSubProcess(t)?this.buildShapeBpmnSubProcess(e,s,Ji(i,e),o):m.isCallActivity(t)?this.buildShapeBpmnCallActivity(e,s,o):new ye(e.id,e.name,t,s,e.instantiate,o)}buildShapeBpmnCallActivity(e,t,s){const i=this.convertedElements.findGlobalTask(e.calledElement);if(!i){const o=new he(e.id,e.name,ae.CALLING_PROCESS,t,s);return this.callActivitiesCallingProcess.set(e.calledElement,o),o}return new he(e.id,e.name,ae.CALLING_GLOBAL_TASK,t,s,i)}buildShapeBpmnEvent(e,t,s){const i=this.getEventDefinitions(e),o=i.map(r=>r.counter).reduce((r,l)=>r+l,0);if(o==0&&m.canHaveNoneEvent(t))return new de(e.id,e.name,t,b.NONE,s);if(o==1){const r=i[0].kind;return m.isBoundaryEvent(t)?this.buildShapeBpmnBoundaryEvent(e,r):m.isStartEvent(t)?new Rt(e.id,e.name,r,s,e.isInterrupting):new de(e.id,e.name,t,r,s)}}buildShapeBpmnBoundaryEvent(e,t){const s=this.convertedElements.findFlowNode(e.attachedToRef);if(m.isActivity(s==null?void 0:s.kind))return new Ft(e.id,e.name,t,e.attachedToRef,e.cancelActivity);this.parsingMessageCollector.warning(new Zi(e.id,e.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(e){const t=new Map;return St.forEach(s=>{const i=e[s+"EventDefinition"],o=S(i,!0).length;t.set(s,o)}),S(e.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);t.set(i,t.get(i)+1)}),Array.from(t.keys()).map(s=>({kind:s,counter:t.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(e,t,s,i){const o=new Oe(e.id,e.name,s,t,i);return this.buildProcessInnerElements(e,e.id),o}buildLaneSetBpmnElements(e,t,s){S(e).forEach(i=>this.buildLaneBpmnElements(i.lane,t,s))}buildLaneBpmnElements(e,t,s){S(e).forEach(i=>{var r;const o=new V(i.id,i.name,h.LANE,t);this.convertedElements.registerLane(o),t||this.elementsWithoutParentByProcessId.get(s).push(o),this.assignParentOfLaneFlowNodes(i),(r=i.childLaneSet)!=null&&r.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)})}assignParentOfLaneFlowNodes(e){S(e.flowNodeRef).forEach(t=>{const s=this.convertedElements.findFlowNode(t),i=e.id;s?m.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new ji(i,t))})}buildSequenceFlows(e){S(e).forEach(t=>{const s=this.getSequenceFlowKind(t);this.convertedElements.registerSequenceFlow(new _t(t.id,t.name,t.sourceRef,t.targetRef,s))})}buildAssociationFlows(e){S(e).forEach(t=>{const s=t.associationDirection;this.convertedElements.registerAssociationFlow(new bt(t.id,void 0,t.sourceRef,t.targetRef,s))})}getSequenceFlowKind(e){if(this.defaultSequenceFlowIds.includes(e.id))return G.DEFAULT;{const t=this.convertedElements.findFlowNode(e.sourceRef);if(t&&m.isWithDefaultSequenceFlow(t.kind)&&e.conditionExpression)return m.isActivity(t.kind)?G.CONDITIONAL_FROM_ACTIVITY:G.CONDITIONAL_FROM_GATEWAY}return G.NORMAL}}const so=n=>{const e=[],t=n.standardLoopCharacteristics,s=S(n.multiInstanceLoopCharacteristics,!0)[0];return t||t===""?e.push(w.LOOP):s&&e.push(s.isSequential?w.MULTI_INSTANCE_SEQUENTIAL:w.MULTI_INSTANCE_PARALLEL),e};class io{constructor(e,t,s,i){this.x=e,this.y=t,this.width=s,this.height=i}}class oo{constructor(e,t,s,i,o=fe.NONE){g(this,"extensions",{});this.id=e,this.bpmnElement=t,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class ro{constructor(e,t){this.x=e,this.y=t}}class lo{constructor(e,t){g(this,"extensions",{});this.font=e,this.bounds=t}}class ao{constructor(e,t,s,i,o,r){this.name=e,this.size=t,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class q{constructor(e,t){g(this,"convertedFonts",new Map);this.convertedElements=e,this.parsingMessageCollector=t}deserialize(e){const t=[],s=[],i=[],o=[],r=S(e)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const l=r.BPMNPlane,a=this.deserializeEdges(l.BPMNEdge),u=this.deserializeShapes(l.BPMNShape);t.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...a)}return{flowNodes:t,lanes:s,pools:i,edges:o}}deserializeFonts(e){this.convertedFonts=new Map,S(e).forEach(t=>S(t.Font).forEach(s=>this.convertedFonts.set(t.id,new ao(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(e){const t={flowNodes:[],lanes:[],pools:[]};return S(e).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,t.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,t.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,t.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new zi(s.bpmnElement))}),t}deserializeShapeAndStoreIfFound(e,t,s){const i=this.deserializeShape(e,s);return i?(t.push(i),!0):!1}deserializeShape(e,t){const s=t(e.bpmnElement);if(s){const i=q.deserializeBounds(e);(s instanceof Oe||s instanceof he&&s.callActivityKind===ae.CALLING_PROCESS)&&!e.isExpanded&&s.markers.push(w.EXPAND);let o;m.isPoolOrLane(s.kind)&&(o=e.isHorizontal??!0);const r=e.BPMNLabel,l=this.deserializeLabel(r,e.id),a=new Se(e.id,s,i,l,o);return q.setColorExtensionsOnShape(a,e),a}}static setColorExtensionsOnShape(e,t){"background-color"in t?e.extensions.fillColor=t["background-color"]:"fill"in t&&(e.extensions.fillColor=t.fill),"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}static deserializeBounds(e){const t=e.Bounds;if(t)return new io(t.x,t.y,t.width,t.height)}deserializeEdges(e){return S(e).map(t=>{const s=this.convertedElements.findSequenceFlow(t.bpmnElement)||this.convertedElements.findMessageFlow(t.bpmnElement)||this.convertedElements.findAssociationFlow(t.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Xi(t.bpmnElement));return}const i=this.deserializeWaypoints(t.waypoint),o=this.deserializeLabel(t.BPMNLabel,t.id),r=t.messageVisibleKind?t.messageVisibleKind:fe.NONE,l=new oo(t.id,s,i,o,r);return q.setColorExtensionsOnEdge(l,t),l}).filter(Boolean)}static setColorExtensionsOnEdge(e,t){"border-color"in t?e.extensions.strokeColor=t["border-color"]:"stroke"in t&&(e.extensions.strokeColor=t.stroke)}deserializeWaypoints(e){return S(e).map(t=>new ro(t.x,t.y))}deserializeLabel(e,t){if(e&&typeof e=="object"){const s=this.findFont(e.labelStyle,t),i=q.deserializeBounds(e),o=new lo(s,i);if("color"in e)return o.extensions.color=e.color,o;if(s||i)return o}}findFont(e,t){let s;return e&&(s=this.convertedFonts.get(e),s||this.parsingMessageCollector.warning(new $i(t,e))),s}}class co{constructor(e){this.convertedElements=e}deserialize(e){St.forEach(t=>{const s=e[t+"EventDefinition"];S(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,t))})}}class uo{constructor(e){this.convertedElements=e}deserialize(e){this.parseGlobalTasks(e.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(e.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(e.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(e.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(e.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(e,t){S(e).forEach(s=>this.convertedElements.registerGlobalTask(s.id,t))}}class ho{constructor(e){this.convertedElements=e}deserialize(e){S(e.category).forEach(t=>S(t.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class fo{constructor(e,t,s,i,o,r){this.categoryConverter=e,this.collaborationConverter=t,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(e){const t=e.definitions;return this.categoryConverter.deserialize(t),this.collaborationConverter.deserialize(t.collaboration),this.eventDefinitionConverter.deserialize(t),this.globalTaskConverter.deserialize(t),this.processConverter.deserialize(t.process),this.diagramConverter.deserialize(t.BPMNDiagram)}}function go(n){const e=new qi;return new fo(new ho(e),new Qi(e,n),new co(e),new uo(e),new no(e,n),new q(e,n))}class To{constructor(e,t){this.jsonParser=e,this.xmlParser=t}parse(e){const t=this.xmlParser.parse(e);return this.jsonParser.parse(t)}}function po(n){return new To(go(new Hi),new Di(n))}class Eo{constructor(){g(this,"classNamesByBpmnId",new Map);g(this,"clear",()=>{this.classNamesByBpmnId.clear()});g(this,"addClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.add(i)));g(this,"removeClassNames",(e,t)=>this.updateClassNames(e,t,(s,i)=>s.delete(i)));g(this,"toggleClassNames",(e,t)=>(this.updateClassNames(e,t,(s,i)=>s.has(i)?s.delete(i):s.add(i)),t&&t.length>0))}getClassNames(e){return Array.from(this.classNamesByBpmnId.get(e)??[])}getBpmnIds(){return Array.from(this.classNamesByBpmnId.keys())}removeAllClassNames(e){const t=this.getOrInitializeClassNames(e),s=t.size;return t.clear(),t.sizes(i,r)),i.size!=o}getOrInitializeClassNames(e){let t=this.classNamesByBpmnId.get(e);return t==null&&(t=new Set,this.classNamesByBpmnId.set(e,t)),t}}class So{constructor(e,t){g(this,"stylesCache",new Map);this.cssRegistry=e,this.model=t}clear(){this.stylesCache.clear()}resetAllStyles(){for(const e of this.stylesCache.keys()){const t=this.stylesCache.get(e);this.resetStyle(e,t)}}resetStyleIfIsStored(e){const t=this.stylesCache.get(e);t&&this.resetStyle(e,t)}resetStyle(e,t){const s=this.model.getCell(e),i=this.cssRegistry.getClassNames(e),o=F(t,I.EXTRA_CSS_CLASSES,i.join(","));this.model.setStyle(s,o),this.stylesCache.delete(e)}ensureStyleIsStored(e){const t=e.getId();this.stylesCache.has(t)||this.stylesCache.set(t,e.getStyle())}}class je{constructor(){g(this,"overlayPositions",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(e){const t=this.convertPosition(e),s=je.convertStyle(e);return{position:t,style:s}}convertPosition(e){return this.overlayPositions.get(e.position)}static convertStyle(e){const t={fill:{color:E.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:E.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:E.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:E.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:E.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:E.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=e.style,i={...t};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(e,t){t&&(e.fill.color=t.color??e.fill.color,e.fill.opacity=t.opacity??e.fill.opacity)}static convertStroke(e,t){t&&(e.stroke.color=t.color??e.stroke.color,e.stroke.width=t.width??e.stroke.width)}static convertFont(e,t){t&&(e.font.color=t.color??e.font.color,e.font.size=t.size??e.font.size)}}function Io(n,e){return new mo(n,new je,new So(e,n.getModel()))}class mo{constructor(e,t,s){this.graph=e,this.overlayConverter=t,this.styleManager=s}clear(){this.styleManager.clear()}updateAndRefreshCssClassesOfCell(e,t){this.updateAndRefreshCssClassesOfElement(e,t),this.updateAndRefreshCssClassesOfElement(He(e),t)}updateAndRefreshCssClassesOfElement(e,t){const s=this.graph.getModel(),i=s.getCell(e);if(!i)return;this.styleManager.ensureStyleIsStored(i);let o=i.getStyle();o=F(o,I.EXTRA_CSS_CLASSES,t.join(",")),s.setStyle(i,o)}addOverlays(e,t){const s=this.graph.getModel().getCell(e);s&&S(t).forEach(i=>{const o=new Nt(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(e){const t=this.graph.getModel().getCell(e);t&&this.graph.removeCellOverlays(t)}updateStyle(e,t){if(!t)return;const s=this.graph.getModel(),i=Et(e).map(o=>s.getCell(o)).filter(Boolean);i.length!=0&&this.graph.batchUpdate(()=>{for(const o of i){this.styleManager.ensureStyleIsStored(o);let r=o.getStyle();r=F(r,c.STYLE_OPACITY,t.opacity,Le),r=an(r,t.stroke),r=cn(r,t.font),hn(t)&&(r=un(r,t.fill)),this.graph.model.setStyle(o,r)}})}resetStyle(e){this.graph.batchUpdate(()=>{if(e.length==0)this.styleManager.resetAllStyles();else for(const t of Et(e))this.styleManager.resetStyleIfIsStored(t)})}}function Et(n){const e=S(n);return e.concat(e.map(t=>He(t)))}class Ao{element(e){return`svg > g > g > g[data-bpmn-id="${e}"]`}elementsOfKind(e){return`svg > g > g > g.${e}:not(.bpmn-label)`}}function Co(n,e){const t=new Eo;return new Oo(n,new No(e.container,new Ao),t,Io(e,t))}class Oo{constructor(e,t,s,i){this.bpmnModelRegistry=e,this.htmlElementRegistry=t,this.cssRegistry=s,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(()=>{this.cssRegistry.clear(),this.graphCellUpdater.clear()})}getElementsByIds(e){return S(e).map(t=>this.bpmnModelRegistry.getBpmnSemantic(t)).filter(Boolean).map(t=>({bpmnSemantic:t,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(t.id)}))}getElementsByKinds(e){return S(e).map(t=>this.htmlElementRegistry.getBpmnHtmlElements(t).map(s=>({htmlElement:s,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(s.getAttribute("data-bpmn-id"))}))).reduce((t,s)=>(t.push(...s),t),[])}addCssClasses(e,t){this.updateCssClasses(e,t,this.cssRegistry.addClassNames)}removeCssClasses(e,t){this.updateCssClasses(e,t,this.cssRegistry.removeClassNames)}removeAllCssClasses(e){if(e)S(e).forEach(t=>{const s=this.cssRegistry.removeAllClassNames(t);this.updateCellIfChanged(s,t)});else{const t=this.cssRegistry.getBpmnIds();this.cssRegistry.clear(),t.forEach(s=>this.updateCellIfChanged(!0,s))}}toggleCssClasses(e,t){this.updateCssClasses(e,t,this.cssRegistry.toggleClassNames)}updateCssClasses(e,t,s){const i=S(t);S(e).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(e,t){if(e){const s=this.cssRegistry.getClassNames(t);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(t,s)}}addOverlays(e,t){this.graphCellUpdater.addOverlays(e,t)}removeAllOverlays(e){this.graphCellUpdater.removeAllOverlays(e)}updateStyle(e,t){this.graphCellUpdater.updateStyle(e,t)}resetStyle(e){this.graphCellUpdater.resetStyle(S(e))}}class No{constructor(e,t){this.container=e,this.querySelectors=t}getBpmnHtmlElement(e){return this.container.querySelector(this.querySelectors.element(e))}getBpmnHtmlElements(e){const t=this.querySelectors.elementsOfKind(Be(e));return[...this.container.querySelectorAll(t)]}}class Lo{filter(e,t){const s=[],i=[];if(S(t==null?void 0:t.pools).filter(T=>T&&Object.keys(T).length).forEach(T=>T.id?s.push(T.id):T.name&&i.push(T.name)),s.length==0&&i.length==0)return e;const{filteredPools:o,filteredPoolIds:r}=vo(e,s,i),l=[...s,...r],{filteredLanes:a,filteredLaneIds:u,filteredFlowNodes:d,filteredFlowNodeIds:f}=Yt(e.lanes,e.flowNodes,l),p=_o(e.edges,[...l,...u,...f]);if(o.length==0&&a.length==0&&d.length==0&&p.length==0){let T=s.length>0?` for ids [${s}]`:"";const A=T?" and":"";throw T+=i.length>0?`${A} for names [${i}]`:"",new Error("No matching pools"+T)}return{lanes:a,flowNodes:d,pools:o,edges:p}}}function vo(n,e,t){const s=n.pools.filter(o=>e.includes(o.bpmnElement.id)||t.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function Yt(n,e,t){const{filteredLanes:s,filteredLaneIds:i}=Ut(n,t),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=yo(e,[...t,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:l,filteredFlowNodeIds:a}}function Ut(n,e){const t=n.filter(i=>e.includes(i.bpmnElement.parentId)),s=t.map(i=>i.bpmnElement.id);if(t.length>0){const{filteredLanes:i,filteredLaneIds:o}=Ut(n,s);t.push(...i),s.push(...o)}return{filteredLanes:t,filteredLaneIds:s}}function yo(n,e,t){const s=n.filter(u=>e.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:l,filteredFlowNodeIds:a}=Yt(t,n,i);return s.push(...l),i.push(...a),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function _o(n,e){return n.filter(t=>e.includes(t.bpmnElement.sourceRefId)&&e.includes(t.bpmnElement.targetRefId))}class wo{constructor(){g(this,"searchableModel");g(this,"onLoadCallback")}load(e,t){var i;const s=new Lo().filter(e,t);return this.searchableModel=new Ro(s),(i=this.onLoadCallback)==null||i.call(this),bo(s)}registerOnLoadCallback(e){this.onLoadCallback=e}getBpmnSemantic(e){var r;const t=(r=this.searchableModel)==null?void 0:r.elementById(e);if(!t)return;const s=t.bpmnElement,i=s instanceof V,o={id:e,name:s.name,isShape:i,kind:s.kind};return s instanceof ve?(o.sourceRefId=s.sourceRefId,o.targetRefId=s.targetRefId):(o.incomingIds=s.incomingIds,o.outgoingIds=s.outgoingIds),o}}function bo(n){const e=n.flowNodes.filter(o=>{const r=o.bpmnElement;return m.isSubProcess(r.kind)&&r.markers.includes(w.EXPAND)}).map(o=>o.bpmnElement.id),t=[],s=[],i=[];return n.flowNodes.forEach(o=>{const r=o.bpmnElement.kind;m.isSubProcess(r)?t.push(o):m.isBoundaryEvent(r)?s.push(o):e.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:t}}class Ro{constructor(e){g(this,"elements",new Map);[].concat(e.pools,e.lanes,e.flowNodes,e.edges).forEach(t=>this.elements.set(t.bpmnElement.id,t))}elementById(e){return this.elements.get(e)}}function Fo(n){return n instanceof HTMLElement?n:document.getElementById(n)}class Po{constructor(e){this.graph=e}fit(e){this.graph.customFit(e)}zoom(e){e=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const xo="0.37.0",ko=()=>({lib:xo,dependencies:new Map([["mxGraph",It.VERSION]])});class Mo{constructor(e){g(this,"graph");g(this,"navigation");g(this,"bpmnElementsRegistry");g(this,"bpmnModelRegistry");g(this,"parserOptions");g(this,"rendererOptions");this.rendererOptions=e==null?void 0:e.renderer;const t=new Cs(Fo(e==null?void 0:e.container));this.graph=t.configure(e),this.navigation=new Po(this.graph),this.bpmnModelRegistry=new wo,this.bpmnElementsRegistry=Co(this.bpmnModelRegistry,this.graph),this.parserOptions=e==null?void 0:e.parser}load(e,t){const s=po(this.parserOptions).parse(e),i=this.bpmnModelRegistry.load(s,t==null?void 0:t.modelFilter);vs(this.graph,this.rendererOptions).render(i,t==null?void 0:t.fit)}getVersion(){return ko()}}function ir(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function C(n,...e){Ze("[DEMO]",n,...e)}function Ze(n,e,...t){console.info(n+" "+e,...t)}function P(n,...e){Ze("[DEMO STARTUP]",n,...e)}function Wt(n,e){Dt(n),window.alert(e??n)}function Dt(n){console.error("[DEMO]",n)}function J(n,...e){Ze("[DEMO DOWNLOAD]",n,...e)}function Bo(n){return C(`Fetching BPMN content from url ${n}`),fetch(n).then(e=>{if(!e.ok)throw Error(`HTTP status ${e.status}`);return e.text()})}class Go{constructor(e,t,s,i){g(this,"document");g(this,"head");g(this,"body");this.window=e,this.outerContainerId=t,this.containerToFade=s,this.dropCallback=i,this.document=e.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){this.containerToFade.classList.add("faded-container"),this.addDomElements(this.containerToFade),this.addStyle();const e=document.getElementById(this.outerContainerId);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,this.containerToFade),this.addEventsOnDocument(this.outerContainerId,this.containerToFade)}preventDefaults(e){e.preventDefault(),e.stopPropagation()}preventDefaultsOnEvents(e,t){e.forEach(s=>t.addEventListener(s,this.preventDefaults,!1))}addDomElements(e){const t=this.document.createElement("p");t.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.appendChild(t);const i=this.document.createElement("div");i.id=this.outerContainerId,i.appendChild(s),e.parentNode.prepend(i)}addStyle(){const e=` .faded-container { opacity: 1; } @@ -47,7 +47,7 @@ var Yt=Object.defineProperty;var Ut=(n,e,t)=>e in n?Yt(n,e,{enumerable:!0,config align-items: center; border: 2px dashed rgba(0,0,0,.2); border-radius: 7px; -}`,t=document.createElement("style");t.appendChild(document.createTextNode(e)),this.head.appendChild(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,s,i){return function(o){try{const a=o.dataTransfer.files;s(a[0])}catch(r){bt(r)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class Pt{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=l.mxClient.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` +}`,t=document.createElement("style");t.appendChild(document.createTextNode(e)),this.head.appendChild(t)}addEventsOnDropContainer(e,t){e.addEventListener("dragover",this.getAddClassCallback(t,!1),!1),e.addEventListener("mousedown",this.getRemoveClassCallback(t,!1),!1),e.addEventListener("drop",this.getDropCallbackForElement(t,!1,this.dropCallback),!1)}addEventsOnDocument(e,t){this.document.addEventListener("dragover",this.getAddClassCallback(t,!0,e),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(t,!0,e),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(t,!0,this.dropCallback,e),!1)}getAddClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),e.classList.add("faded")}}getRemoveClassCallback(e,t,s){return function(){t?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}getDropCallbackForElement(e,t,s,i){return function(o){try{const l=o.dataTransfer.files;s(l[0])}catch(r){Wt(r)}finally{t?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),e.classList.remove("faded")}}}}class Ht{constructor(e){this.graph=e}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const e=It.IS_FF;return this.doSvgExport(e)}doSvgExport(e){const t=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:e});return` -${l.mxUtils.getXml(t)} -`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),a=this.graph.view.scale,c=l.mxUtils.createXmlDocument(),u=c.createElementNS(l.mxConstants.NS_SVG,"svg"),h=t/a,f=Math.max(1,Math.ceil(r.width*h)+2*s),p=Math.max(1,Math.ceil(r.height*h)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",p+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+p),c.appendChild(u);const T=c.createElementNS(l.mxConstants.NS_SVG,"g");u.appendChild(T);const I=this.createSvgCanvas(T);I.foEnabled=o,I.foOffset=i?-.5:0,I.textOffset=i?-.5:0,I.imageOffset=i?-.5:0,I.translate(Math.floor((s/t-r.x)/a),Math.floor((s/t-r.y)/a)),I.scale(h);const b=new l.mxImageExport;return b.includeOverlays=!0,b.drawState(this.graph.getView().getState(this.graph.model.root),I),c}createSvgCanvas(e){const t=new _o(e);return t.pointerEvents=!0,t}}class _o extends l.mxSvgCanvas2D{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,a,c,u,h,f,p,T,I){return this.computeTruncatedText(a,o)}plainText(t,s,i,o,r,a,c,u,h,f,p,T){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,a,c,u,h,f,p,T)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=l.mxUtils.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,a=0;for(;(i==0||r0)break}else o.push(t.charAt(a)),c<255&&r++;a++}o.length1&&(t=l.mxUtils.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}function kt(n,e,t){const s=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),s.setAttribute("href",e+t),s.setAttribute("download",n),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}function yo(n){$("Start SVG download"),kt("diagram.svg","data:image/svg+xml",n),$("Download completed")}function wo(n){$("Start PNG download");const e=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.appendChild(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.onload=function(){const r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.onload=function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const a=i.toDataURL("image/png");document.body.removeChild(s),kt("diagram.png","",a),$("Download completed")},r.src=s.src},s.src=t}const Ro=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class xo extends No{configureTheme(e){if(e=="default")return new dt(this.graph).configureStyles(),!0;const t=Ro.get(e);if(!t)return!1;const s=this.graph.getStylesheet();S.eventKinds().forEach(h=>{let f,p;switch(h){case"endEvent":f=t.endEventFillColor,p=t.endEventStrokeColor;break;case"startEvent":f=t.startEventFillColor,p=t.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":f=t.defaultFillColor,p=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break;default:f=t.defaultFillColor,p=t.defaultStrokeColor;break}const T=s.styles[h];T.fillColor=f,T.strokeColor=p}),S.taskKinds().forEach(h=>{const f=s.styles[h];f.fillColor=t.taskAndCallActivityFillColor});const i=s.styles[d.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[d.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??E.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[d.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const a=s.styles[d.LANE];a.fillColor=t.laneFillColor;const c=s.getDefaultVertexStyle();c.fontColor=t.defaultFontColor,c.fillColor=t.defaultFillColor,c.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){R(`Use dedicated ${e} color for sequence flows`);const s=this.graph.getStylesheet().styles[x.SEQUENCE_FLOW];s[l.mxConstants.STYLE_STROKECOLOR]=e,s[l.mxConstants.STYLE_FILLCOLOR]=e,R("Sequence flows style updated")}}let O,G={},We,De,me,F;function Xo(n){A("Updating load options"),G.fit=n,A("Load options updated",G)}function $o(){return{...G}}function Zo(){return me}function jo(n){A("Switching theme from %s to %s",me,n),O.configureTheme(n)?(O.graph.refresh(),A("Theme switch done"),me=n):A("Unknown theme, do nothing")}function Mt(n,e=!0){A("Loading bpmn...");try{O.load(n,G),A("BPMN loaded with configuration",G),bo(De),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)We(`Cannot load the BPMN diagram: ${t.message}`);else throw t}}function qo(n){A("Fitting..."),O.navigation.fit(n),A("Fit done with configuration",n)}function Qo(n){A(`Zooming '${n}'...`),O.navigation.zoom(n),A("Zoom done")}function Jo(n){return O.bpmnElementsRegistry.getElementsByKinds(n)}function er(n,e){return O.bpmnElementsRegistry.addCssClasses(n,e)}function tr(n,e){return O.bpmnElementsRegistry.removeCssClasses(n,e)}function nr(n,e){return O.bpmnElementsRegistry.addOverlays(n,[e])}function sr(n){return O.bpmnElementsRegistry.removeAllOverlays(n)}function bo(n){if(!De)return;A("Updating model, bpmnElement to collapse:",n);const e=O.graph.getModel(),t=e.getCell(n);if(!t)A("Element not found in the model, do nothing");else{e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}A("Model updated")}}function Bt(n){const e=new FileReader;e.onload=()=>{Mt(e.result)},e.readAsText(n)}function ir(n){const e=n.target.files[0];Bt(e)}function Fo(n){Lo(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(A("BPMN content fetched"),e)).then(e=>{Mt(e,!1),A(`BPMN content loaded from url ${n}`)}).then(()=>{Yo()}).catch(e=>{We(e.message)})}function or(n){bt(n)}function Po(n){Ft(n)}function ko(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)||{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function Mo(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";R("Use alternative color for the bpmn container background, color",o);const r=O.graph.container;r.style.backgroundColor=o,R("Bpmn container style updated")}const t=n.get("style.theme");R(`Configuring the '${t}' BPMN theme`),O.configureTheme(t)?(me=t,R(`'${t}' BPMN theme configured`)):R(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&O.configureSequenceFlowColor("#E9E9E9"),R('Configuring the "Update Style" API from query parameters'),Array.from(n.keys()).filter(o=>o.startsWith("style.api.")).length>0?(F={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(F.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(F.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(F.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")&&(F.fill.color=n.get("style.api.fill.color")),n.get("style.api.fill.opacity")&&(F.fill.opacity=Number(n.get("style.api.fill.opacity"))),R('Prepared "Update Style" API object',F)):R('No query parameters, do not set the "Update Style" API object')}function Bo(n){De=n.get("bpmn.element.id.collapsed")}function Go(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return A("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function rr(n){const e=R;e(`Initializing BpmnVisualization with container '${n.globalOptions.container}'...`);const t=new URLSearchParams(window.location.search),s=t.get("renderer.ignore.bpmn.colors");if(s){const o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}O=new xo(n.globalOptions),e("Initialization completed"),new vo(window,"drop-container",O.graph.container,Bt),e("Drag&Drop support initialized"),We=n.statusKoNotifier??Po,e("Configuring Load Options"),G=n.loadOptions||{},G.fit=ko(n,t),G.modelFilter=Go(t),Mo(t),Bo(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);Fo(o);return}e("No 'url to fetch BPMN content' provided")}function ar(){$("Trigger SVG Download"),yo(new Pt(O.graph).exportSvg())}function lr(){$("Trigger PNG Download"),wo(new Pt(O.graph).exportSvgForPng())}function cr(){const n=O.getVersion();return A("Version:",n),n}function Vo(n,e){A("Applying style using the style API: %O",e),O.bpmnElementsRegistry.updateStyle(n,e),A("New style applied")}function Yo(){if(F){const n=Uo();A("Number of elements whose style is to be updated",n.length),Vo(n,F)}}function Uo(){A("Retrieving ids of all BPMN elements");const n=[...Object.values(d),...Object.values(x)],t=O.bpmnElementsRegistry.getElementsByKinds(n).map(s=>s.bpmnSemantic.id);return A("All BPMN elements ids retrieved:",t.length),t}export{ne as F,S,Dt as Z,jo as a,cr as b,Zo as c,zo as d,sr as e,qo as f,$o as g,ir as h,er as i,ar as j,lr as k,A as l,Vo as m,Jo as n,nr as o,tr as r,rr as s,Xo as u,or as w,Qo as z}; +${y.getXml(t)} +`}computeSvg(e){const t=e.scale??1,s=e.border??0,i=e.crisp??!0,o=e.enableForeignObjectForLabel??!0,r=this.graph.getGraphBounds(),l=this.graph.view.scale,a=y.createXmlDocument(),u=a.createElementNS(c.NS_SVG,"svg"),d=t/l,f=Math.max(1,Math.ceil(r.width*d)+2*s),p=Math.max(1,Math.ceil(r.height*d)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",f+"px"),u.setAttribute("height",p+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+f+" "+p),a.appendChild(u);const T=a.createElementNS(c.NS_SVG,"g");u.appendChild(T);const A=this.createSvgCanvas(T);A.foEnabled=o,A.foOffset=i?-.5:0,A.textOffset=i?-.5:0,A.imageOffset=i?-.5:0,A.translate(Math.floor((s/t-r.x)/l),Math.floor((s/t-r.y)/l)),A.scale(d);const M=new N.mxImageExport;return M.includeOverlays=!0,M.drawState(this.graph.getView().getState(this.graph.model.root),A),a}createSvgCanvas(e){const t=new Vo(e);return t.pointerEvents=!0,t}}class Vo extends ue{constructor(t){super(t);g(this,"htmlConverter",document.createElement("div"))}getAlternateText(t,s,i,o,r,l,a,u,d,f,p,T,A){return this.computeTruncatedText(l,o)}plainText(t,s,i,o,r,l,a,u,d,f,p,T){r=this.computeTruncatedText(r,i),super.plainText(t,s,i,o,r,l,a,u,d,f,p,T)}computeTruncatedText(t,s){if(t==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=t,t=y.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let r=0,l=0;for(;(i==0||r0)break}else o.push(t.charAt(l)),a<255&&r++;l++}o.length1&&(t=y.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return t}}function Kt(n,e,t){const s=document.createElement("a");e.startsWith("data:image/svg+xml")&&(t=encodeURIComponent(t),e+=","),s.setAttribute("href",e+t),s.setAttribute("download",n),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}function Yo(n){J("Start SVG download"),Kt("diagram.svg","data:image/svg+xml",n),J("Download completed")}function Uo(n){J("Start PNG download");const e=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),t=URL.createObjectURL(e),s=document.createElement("img");s.setAttribute("style","position: absolute; top: -9999px"),s.crossOrigin="anonymous",document.body.appendChild(s);const i=document.createElement("canvas"),o=i.getContext("2d");s.onload=function(){const r=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,r.crossOrigin="Anonymous",r.onload=function(){o.drawImage(r,0,0),URL.revokeObjectURL(t);const l=i.toDataURL("image/png");document.body.removeChild(s),Kt("diagram.png","",l),J("Download completed")},r.src=s.src},s.src=t}const Wo=new Map([["dark",{defaultFillColor:"#334352",defaultFontColor:"white",defaultStrokeColor:"#c0ddeb",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#5c8599",laneFillColor:"#2b3742",poolFillColor:"#232b33"}],["brown",{defaultFillColor:"#ede7e1",defaultFontColor:"#414666",defaultStrokeColor:"#414666",flowColor:"#666666",catchAndThrowEventStrokeColor:"#377f87",endEventFillColor:"pink",endEventStrokeColor:"FireBrick",startEventFillColor:"DarkSeaGreen",startEventStrokeColor:"DarkGreen",taskAndCallActivityFillColor:"#dadce8",laneFillColor:"#d4c3b2",poolFillColor:"#d1b9a1"}],["light-blue",{defaultFillColor:"#ffffff",defaultFontColor:"#002395",defaultStrokeColor:"#002395",endEventFillColor:"#f9dadc",endEventStrokeColor:"#e20613",startEventFillColor:"#ffffff",startEventStrokeColor:"#05d99e",taskAndCallActivityFillColor:"rgba(132,158,253,0.1)",textAnnotationFillColor:"rgba(237,237,245,0.5)",laneFillColor:"#edeef5",poolFillColor:"#dbefff"}]]);class Do extends Mo{configureTheme(e){if(e=="default")return new Ct(this.graph).configureStyles(),!0;const t=Wo.get(e);if(!t)return!1;const s=this.graph.getStylesheet();m.eventKinds().forEach(d=>{let f,p;switch(d){case"endEvent":f=t.endEventFillColor,p=t.endEventStrokeColor;break;case"startEvent":f=t.startEventFillColor,p=t.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":f=t.defaultFillColor,p=t.catchAndThrowEventStrokeColor??t.defaultStrokeColor;break;default:f=t.defaultFillColor,p=t.defaultStrokeColor;break}const T=s.styles[d];T.fillColor=f,T.strokeColor=p}),m.taskKinds().forEach(d=>{const f=s.styles[d];f.fillColor=t.taskAndCallActivityFillColor});const i=s.styles[h.CALL_ACTIVITY];i.fillColor=t.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=t.textAnnotationFillColor??E.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=t.poolFillColor,r.swimlaneFillColor=t.defaultFillColor;const l=s.styles[h.LANE];l.fillColor=t.laneFillColor;const a=s.getDefaultVertexStyle();a.fontColor=t.defaultFontColor,a.fillColor=t.defaultFillColor,a.strokeColor=t.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=t.defaultFontColor,u.fillColor=t.defaultFillColor,u.strokeColor=t.flowColor??t.defaultStrokeColor,!0}configureSequenceFlowColor(e){P(`Use dedicated ${e} color for sequence flows`);const s=this.graph.getStylesheet().styles[k.SEQUENCE_FLOW];s[c.STYLE_STROKECOLOR]=e,s[c.STYLE_FILLCOLOR]=e,P("Sequence flows style updated")}}let L,D={},qe,Qe,Ne,B;function or(n){C("Updating load options"),D.fit=n,C("Load options updated",D)}function rr(){return{...D}}function lr(){return Ne}function ar(n){C("Switching theme from %s to %s",Ne,n),L.configureTheme(n)?(L.graph.refresh(),C("Theme switch done"),Ne=n):C("Unknown theme, do nothing")}function zt(n,e=!0){C("Loading bpmn...");try{L.load(n,D),C("BPMN loaded with configuration",D),Ho(Qe),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){if(e)qe(`Cannot load the BPMN diagram: ${t.message}`);else throw t}}function cr(n){C("Fitting..."),L.navigation.fit(n),C("Fit done with configuration",n)}function ur(n){C(`Zooming '${n}'...`),L.navigation.zoom(n),C("Zoom done")}function hr(n){return L.bpmnElementsRegistry.getElementsByKinds(n)}function dr(n,e){return L.bpmnElementsRegistry.addCssClasses(n,e)}function fr(n,e){return L.bpmnElementsRegistry.removeCssClasses(n,e)}function gr(n,e){return L.bpmnElementsRegistry.addOverlays(n,[e])}function Tr(n){return L.bpmnElementsRegistry.removeAllOverlays(n)}function Ho(n){if(!Qe)return;C("Updating model, bpmnElement to collapse:",n);const e=L.graph.getModel(),t=e.getCell(n);if(!t)C("Element not found in the model, do nothing");else{e.beginUpdate();try{e.setCollapsed(t,!0)}finally{e.endUpdate()}C("Model updated")}}function Xt(n){const e=new FileReader;e.onload=()=>{zt(e.result)},e.readAsText(n)}function pr(n){const e=n.target.files[0];Xt(e)}function Ko(n){Bo(n).catch(e=>{throw new Error(`Unable to fetch ${n}. ${e}`)}).then(e=>(C("BPMN content fetched"),e)).then(e=>{zt(e,!1),C(`BPMN content loaded from url ${n}`)}).then(()=>{Qo()}).catch(e=>{qe(e.message)})}function Er(n){Wt(n)}function zo(n){Dt(n)}function Xo(n,e){var o;const t=((o=n.loadOptions)==null?void 0:o.fit)||{},s=e.get("fitTypeOnLoad");s&&(t.type=s);const i=e.get("fitMargin");return i&&(t.margin=Number(i)),t}function $o(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";P("Use alternative color for the bpmn container background, color",o);const r=L.graph.container;r.style.backgroundColor=o,P("Bpmn container style updated")}const t=n.get("style.theme");P(`Configuring the '${t}' BPMN theme`),L.configureTheme(t)?(Ne=t,P(`'${t}' BPMN theme configured`)):P(`Unknown '${t}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&L.configureSequenceFlowColor("#E9E9E9"),P('Configuring the "Update Style" API from query parameters'),Array.from(n.keys()).filter(o=>o.startsWith("style.api.")).length>0?(B={stroke:{},font:{},fill:{}},n.get("style.api.stroke.color")&&(B.stroke.color=n.get("style.api.stroke.color")),n.get("style.api.font.color")&&(B.font.color=n.get("style.api.font.color")),n.get("style.api.font.opacity")&&(B.font.opacity=Number(n.get("style.api.font.opacity"))),n.get("style.api.fill.color")&&(B.fill.color=n.get("style.api.fill.color")),n.get("style.api.fill.opacity")&&(B.fill.opacity=Number(n.get("style.api.fill.opacity"))),P('Prepared "Update Style" API object',B)):P('No query parameters, do not set the "Update Style" API object')}function jo(n){Qe=n.get("bpmn.element.id.collapsed")}function Zo(n){const e=n.get("bpmn.filter.pool.ids");if(!e)return;const t=e.split(",");return C("Configuring load options to only include pool id: ",t),{pools:t.map(s=>({id:s}))}}function Sr(n){const e=P;e(`Initializing BpmnVisualization with container '${n.globalOptions.container}'...`);const t=new URLSearchParams(window.location.search),s=t.get("renderer.ignore.bpmn.colors");if(s){const o=s==="true";e('Ignore support for "BPMN in Color"?',o),!n.globalOptions.renderer&&(n.globalOptions.renderer={}),n.globalOptions.renderer.ignoreBpmnColors=o}L=new Do(n.globalOptions),e("Initialization completed"),new Go(window,"drop-container",L.graph.container,Xt),e("Drag&Drop support initialized"),qe=n.statusKoNotifier??zo,e("Configuring Load Options"),D=n.loadOptions||{},D.fit=Xo(n,t),D.modelFilter=Zo(t),$o(t),jo(t),e("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=t.get("url");if(i){const o=decodeURIComponent(i);Ko(o);return}e("No 'url to fetch BPMN content' provided")}function Ir(){J("Trigger SVG Download"),Yo(new Ht(L.graph).exportSvg())}function mr(){J("Trigger PNG Download"),Uo(new Ht(L.graph).exportSvgForPng())}function Ar(){const n=L.getVersion();return C("Version:",n),n}function qo(n,e){C("Applying style using the style API: %O",e),L.bpmnElementsRegistry.updateStyle(n,e),C("New style applied")}function Cr(n){C("Resetting styles using the style API!"),L.bpmnElementsRegistry.resetStyle(n),C("Styles reset")}function Qo(){if(B){const n=Jo();C("Number of elements whose style is to be updated",n.length),qo(n,B)}}function Jo(){C("Retrieving ids of all BPMN elements");const n=[...Object.values(h),...Object.values(k)],t=L.bpmnElementsRegistry.getElementsByKinds(n).map(s=>s.bpmnSemantic.id);return C("All BPMN elements ids retrieved:",t.length),t}export{le as F,m as S,Jt as Z,ar as a,Ar as b,lr as c,ir as d,Tr as e,cr as f,rr as g,pr as h,dr as i,Ir as j,mr as k,C as l,qo as m,Cr as n,hr as o,gr as p,fr as r,Sr as s,or as u,Er as w,ur as z}; diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html index 9adc7324..7cc7a99b 100644 --- a/demo/monitoring-all-process-instances/index.html +++ b/demo/monitoring-all-process-instances/index.html @@ -24,7 +24,7 @@ - + diff --git a/demo/predictions/index.html b/demo/predictions/index.html index 8ba1c21e..daa26ad6 100644 --- a/demo/predictions/index.html +++ b/demo/predictions/index.html @@ -24,7 +24,7 @@ - + diff --git a/examples/custom-behavior/apply-css-classes/index.html b/examples/custom-behavior/apply-css-classes/index.html index 732b68d2..fe8a5f8c 100644 --- a/examples/custom-behavior/apply-css-classes/index.html +++ b/examples/custom-behavior/apply-css-classes/index.html @@ -86,7 +86,7 @@ } - + diff --git a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html index c656d007..90e9654e 100644 --- a/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html +++ b/examples/custom-behavior/call-activity-with-modal-on-mouse-over/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html index 68ea2695..c41f8e11 100644 --- a/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html +++ b/examples/custom-behavior/call-activity-with-reload-on-dblclick/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html index 59e9ff02..2bd8ee9a 100644 --- a/examples/custom-behavior/call-activity-with-tabs-on-click/index.html +++ b/examples/custom-behavior/call-activity-with-tabs-on-click/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-behavior/growing-sequence-flow/index.html b/examples/custom-behavior/growing-sequence-flow/index.html index 379b1130..8a33df34 100644 --- a/examples/custom-behavior/growing-sequence-flow/index.html +++ b/examples/custom-behavior/growing-sequence-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/javascript-tooltip-and-popover/index.html b/examples/custom-behavior/javascript-tooltip-and-popover/index.html index ac890b1e..3a829690 100644 --- a/examples/custom-behavior/javascript-tooltip-and-popover/index.html +++ b/examples/custom-behavior/javascript-tooltip-and-popover/index.html @@ -50,7 +50,7 @@ - + diff --git a/examples/custom-behavior/running-dashed-message-flow/index.html b/examples/custom-behavior/running-dashed-message-flow/index.html index 2e88e92e..5a5c4ca4 100644 --- a/examples/custom-behavior/running-dashed-message-flow/index.html +++ b/examples/custom-behavior/running-dashed-message-flow/index.html @@ -57,7 +57,7 @@ - + diff --git a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html index 116b2cd3..daadee9a 100644 --- a/examples/custom-behavior/select-elements-by-bpmn-kind/index.html +++ b/examples/custom-behavior/select-elements-by-bpmn-kind/index.html @@ -55,7 +55,7 @@ } - + diff --git a/examples/custom-bpmn-theme/custom-colors/index.html b/examples/custom-bpmn-theme/custom-colors/index.html index c6f67a5d..e5cc9946 100644 --- a/examples/custom-bpmn-theme/custom-colors/index.html +++ b/examples/custom-bpmn-theme/custom-colors/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html index f8050505..9f4f54c3 100644 --- a/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html +++ b/examples/custom-bpmn-theme/custom-edge-marker-colors/index.html @@ -36,7 +36,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-fonts/index.html b/examples/custom-bpmn-theme/custom-fonts/index.html index 59eda844..fc144bf1 100644 --- a/examples/custom-bpmn-theme/custom-fonts/index.html +++ b/examples/custom-bpmn-theme/custom-fonts/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/custom-bpmn-theme/custom-user-task-icon/index.html b/examples/custom-bpmn-theme/custom-user-task-icon/index.html index 7f11bc5c..76f1264c 100644 --- a/examples/custom-bpmn-theme/custom-user-task-icon/index.html +++ b/examples/custom-bpmn-theme/custom-user-task-icon/index.html @@ -22,7 +22,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-after-load/index.html b/examples/diagram-navigation/diagram-fit-after-load/index.html index 0bbdf005..fd1c97d1 100644 --- a/examples/diagram-navigation/diagram-fit-after-load/index.html +++ b/examples/diagram-navigation/diagram-fit-after-load/index.html @@ -53,7 +53,7 @@ - + diff --git a/examples/diagram-navigation/diagram-fit-on-load/index.html b/examples/diagram-navigation/diagram-fit-on-load/index.html index 2d61101a..adad77dd 100644 --- a/examples/diagram-navigation/diagram-fit-on-load/index.html +++ b/examples/diagram-navigation/diagram-fit-on-load/index.html @@ -40,7 +40,7 @@ - + diff --git a/examples/diagram-navigation/diagram-navigation/index.html b/examples/diagram-navigation/diagram-navigation/index.html index 1b22a701..2f19c316 100644 --- a/examples/diagram-navigation/diagram-navigation/index.html +++ b/examples/diagram-navigation/diagram-navigation/index.html @@ -34,7 +34,7 @@ } - + diff --git a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html index 26a9af79..01e5011e 100644 --- a/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-local-bpmn-diagrams/index.html @@ -50,7 +50,7 @@ - + diff --git a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html index 44550ae5..fdd17f56 100644 --- a/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html +++ b/examples/display-bpmn-diagram/load-remote-bpmn-diagrams/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/display-bpmn-diagram/pools-filter-on-load/index.html b/examples/display-bpmn-diagram/pools-filter-on-load/index.html index d39c318b..761de98a 100644 --- a/examples/display-bpmn-diagram/pools-filter-on-load/index.html +++ b/examples/display-bpmn-diagram/pools-filter-on-load/index.html @@ -34,7 +34,7 @@ - + diff --git a/examples/misc/compare-with-bpmn-js/index.html b/examples/misc/compare-with-bpmn-js/index.html index 4f18686d..6c2f04cc 100644 --- a/examples/misc/compare-with-bpmn-js/index.html +++ b/examples/misc/compare-with-bpmn-js/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/misc/compare-with-kie-editors-standalone/index.html b/examples/misc/compare-with-kie-editors-standalone/index.html index 9b75e69e..7f9b70a3 100644 --- a/examples/misc/compare-with-kie-editors-standalone/index.html +++ b/examples/misc/compare-with-kie-editors-standalone/index.html @@ -59,7 +59,7 @@ - + diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html index 0116caf8..754a54e7 100644 --- a/examples/overlays/add-remove/index.html +++ b/examples/overlays/add-remove/index.html @@ -48,7 +48,7 @@ - + diff --git a/examples/overlays/add-stylized/index.html b/examples/overlays/add-stylized/index.html index 673d89be..2647f9e4 100644 --- a/examples/overlays/add-stylized/index.html +++ b/examples/overlays/add-stylized/index.html @@ -43,7 +43,7 @@ - + diff --git a/examples/overlays/custom-overlay-default-style/index.html b/examples/overlays/custom-overlay-default-style/index.html index d436a921..df7dda56 100644 --- a/examples/overlays/custom-overlay-default-style/index.html +++ b/examples/overlays/custom-overlay-default-style/index.html @@ -29,7 +29,7 @@ - + diff --git a/projects/javascript-vanilla-with-webpack/package.json b/projects/javascript-vanilla-with-webpack/package.json index 330c11cb..35380bf5 100644 --- a/projects/javascript-vanilla-with-webpack/package.json +++ b/projects/javascript-vanilla-with-webpack/package.json @@ -9,7 +9,7 @@ "serve": "webpack serve" }, "dependencies": { - "bpmn-visualization": "0.36.0" + "bpmn-visualization": "0.37.0" }, "devDependencies": { "html-webpack-plugin": "~5.5.1", diff --git a/projects/typescript-angular/package.json b/projects/typescript-angular/package.json index bfe6d547..d0d57a24 100644 --- a/projects/typescript-angular/package.json +++ b/projects/typescript-angular/package.json @@ -19,7 +19,7 @@ "@angular/platform-browser": "~15.2.0", "@angular/platform-browser-dynamic": "~15.2.0", "@angular/router": "~15.2.0", - "bpmn-visualization": "0.36.0", + "bpmn-visualization": "0.37.0", "rxjs": "~7.8.0", "tslib": "~2.5.0", "zone.js": "~0.12.0" diff --git a/projects/typescript-lit-element/package.json b/projects/typescript-lit-element/package.json index 9a5e536f..879fb6bd 100644 --- a/projects/typescript-lit-element/package.json +++ b/projects/typescript-lit-element/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "lit": "~2.7.5", - "bpmn-visualization": "0.36.0" + "bpmn-visualization": "0.37.0" }, "devDependencies": { "patch-package": "~7.0.0", diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json index 040c3183..8e8a9ac3 100644 --- a/projects/typescript-vanilla-with-parcel/package.json +++ b/projects/typescript-vanilla-with-parcel/package.json @@ -8,7 +8,7 @@ "build": "tsc && parcel build --public-url ./ index.html" }, "dependencies": { - "bpmn-visualization": "0.36.0" + "bpmn-visualization": "0.37.0" }, "devDependencies": { "@parcel/core": "~2.9.0", diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json index c4958b53..ba19f58b 100644 --- a/projects/typescript-vanilla-with-rollup/package.json +++ b/projects/typescript-vanilla-with-rollup/package.json @@ -10,7 +10,7 @@ "start": "rollup -cw --environment devMode:true" }, "dependencies": { - "bpmn-visualization": "0.36.0" + "bpmn-visualization": "0.37.0" }, "devDependencies": { "@rollup/plugin-commonjs": "~24.1.0", diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json index 3bf8323e..59e1581b 100644 --- a/projects/typescript-vanilla-with-vitejs/package.json +++ b/projects/typescript-vanilla-with-vitejs/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "bpmn-visualization": "0.36.0" + "bpmn-visualization": "0.37.0" }, "devDependencies": { "typescript": "~4.5.5", diff --git a/projects/typescript-vue/package.json b/projects/typescript-vue/package.json index 07a4353c..88331b5e 100644 --- a/projects/typescript-vue/package.json +++ b/projects/typescript-vue/package.json @@ -9,7 +9,7 @@ "preview": "vite preview" }, "dependencies": { - "bpmn-visualization": "0.36.0", + "bpmn-visualization": "0.37.0", "spectre.css": "^0.5.9", "vue": "^3.3.4" },