diff --git a/demo/hacktoberfest-custom-themes/index.html b/demo/hacktoberfest-custom-themes/index.html index 954632e2..df2428b9 100644 --- a/demo/hacktoberfest-custom-themes/index.html +++ b/demo/hacktoberfest-custom-themes/index.html @@ -23,7 +23,7 @@ - + diff --git a/demo/load-and-navigation/assets/main.js b/demo/load-and-navigation/assets/main.js index a7b8685b..c6a04f0f 100644 --- a/demo/load-and-navigation/assets/main.js +++ b/demo/load-and-navigation/assets/main.js @@ -1,4 +1,4 @@ -var Pt=Object.defineProperty;var Mt=(n,t,e)=>t in n?Pt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var T=(n,t,e)=>(Mt(n,typeof t!="symbol"?t+"":t,e),e);import{f as kt,c as U}from"./mxgraph.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function e(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=e(i);fetch(i.href,o)}})();function ko(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function v(n,...t){Pe("[DEMO]",n,...t)}function Fe(n){return JSON.stringify(n,void 0,2)}function Pe(n,t,...e){console.info(n+" "+t,...e)}function Y(n,...t){Pe("[DEMO STARTUP]",n,...t)}function Me(n,t){console.error("[DEMO]",n),window.alert(t!=null?t:n)}function q(n,...t){Pe("[DEMO DOWNLOAD]",n,...t)}function Bt(n){return v(`Fetching BPMN content from url ${n}`),fetch(n).then(t=>{if(!t.ok)throw Error(String(t.status));return t.text()})}class Gt{constructor(t,e,s,i){T(this,"document");T(this,"head");T(this,"body");this.window=t,this.outerContainerId=e,this.containerToFadeId=s,this.dropCallback=i,this.document=t.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){const t=document.getElementById(this.containerToFadeId);this.addDomElements(t),this.addStyle();const e=document.getElementById(this.outerContainerId);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,t),this.addEventsOnDocument(this.outerContainerId,t)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){t.forEach(s=>e.addEventListener(s,this.preventDefaults,!1))}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.appendChild(e);const i=this.document.createElement("div");i.id=this.outerContainerId,i.appendChild(s),t.parentNode.prepend(i)}addStyle(){const t=` +var Pt=Object.defineProperty;var Mt=(n,t,e)=>t in n?Pt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var T=(n,t,e)=>(Mt(n,typeof t!="symbol"?t+"":t,e),e);import{f as kt,c as U}from"./mxgraph.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.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 e(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=e(i);fetch(i.href,o)}})();function ko(n){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(n,1):document.addEventListener("DOMContentLoaded",n)}function L(n,...t){Pe("[DEMO]",n,...t)}function Fe(n){return JSON.stringify(n,void 0,2)}function Pe(n,t,...e){console.info(n+" "+t,...e)}function Y(n,...t){Pe("[DEMO STARTUP]",n,...t)}function Me(n,t){console.error("[DEMO]",n),window.alert(t!=null?t:n)}function q(n,...t){Pe("[DEMO DOWNLOAD]",n,...t)}function Bt(n){return L(`Fetching BPMN content from url ${n}`),fetch(n).then(t=>{if(!t.ok)throw Error(String(t.status));return t.text()})}class Gt{constructor(t,e,s,i){T(this,"document");T(this,"head");T(this,"body");this.window=t,this.outerContainerId=e,this.containerToFadeId=s,this.dropCallback=i,this.document=t.document,this.head=document.head,this.body=document.body,this.initializeDragAndDrop()}initializeDragAndDrop(){const t=document.getElementById(this.containerToFadeId);this.addDomElements(t),this.addStyle();const e=document.getElementById(this.outerContainerId);this.preventDefaultsOnEvents(["dragover","drop"],this.window),this.preventDefaultsOnEvents(["dragover","dragleave","drop"],e),this.addEventsOnDropContainer(e,t),this.addEventsOnDocument(this.outerContainerId,t)}preventDefaults(t){t.preventDefault(),t.stopPropagation()}preventDefaultsOnEvents(t,e){t.forEach(s=>e.addEventListener(s,this.preventDefaults,!1))}addDomElements(t){const e=this.document.createElement("p");e.textContent="open BPMN diagram";const s=this.document.createElement("div");s.classList.add("drop-here-text"),s.appendChild(e);const i=this.document.createElement("div");i.id=this.outerContainerId,i.appendChild(s),t.parentNode.prepend(i)}addStyle(){const t=` #${this.containerToFadeId} { opacity: 1; } @@ -40,13 +40,13 @@ var Pt=Object.defineProperty;var Mt=(n,t,e)=>t in n?Pt(n,t,{enumerable:!0,config align-items: center; border: 2px dashed rgba(0,0,0,.2); border-radius: 7px; -}`,e=document.createElement("style");e.appendChild(document.createTextNode(t)),this.head.appendChild(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,s,i){return function(o){try{const r=o.dataTransfer.files;s(r[0])}catch(a){Me(a)}finally{e?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}const l=Vt();function Vt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",kt({})}class dt{constructor(t){this.graph=t}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const t=l.mxClient.IS_FF;return this.doSvgExport(t)}doSvgExport(t){const e=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:t});return` +}`,e=document.createElement("style");e.appendChild(document.createTextNode(t)),this.head.appendChild(e)}addEventsOnDropContainer(t,e){t.addEventListener("dragover",this.getAddClassCallback(e,!1),!1),t.addEventListener("mousedown",this.getRemoveClassCallback(e,!1),!1),t.addEventListener("drop",this.getDropCallbackForElement(e,!1,this.dropCallback),!1)}addEventsOnDocument(t,e){this.document.addEventListener("dragover",this.getAddClassCallback(e,!0,t),!1),this.document.addEventListener("dragleave",this.getRemoveClassCallback(e,!0,t),!1),this.document.addEventListener("drop",this.getDropCallbackForElement(e,!0,this.dropCallback,t),!1)}getAddClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.add("dragging"):this.classList.add("dragging"),t.classList.add("faded")}}getRemoveClassCallback(t,e,s){return function(){e?this.querySelector("#"+s).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}getDropCallbackForElement(t,e,s,i){return function(o){try{const a=o.dataTransfer.files;s(a[0])}catch(r){Me(r)}finally{e?this.querySelector("#"+i).classList.remove("dragging"):this.classList.remove("dragging"),t.classList.remove("faded")}}}}const l=Vt();function Vt(){return window.mxForceIncludes=!1,window.mxLoadResources=!1,window.mxLoadStylesheets=!1,window.mxResourceExtension=".txt",kt({})}class dt{constructor(t){this.graph=t}exportSvg(){return this.doSvgExport(!0)}exportSvgForPng(){const t=l.mxClient.IS_FF;return this.doSvgExport(t)}doSvgExport(t){const e=this.computeSvg({scale:1,border:25,enableForeignObjectForLabel:t});return` ${l.mxUtils.getXml(e)} -`}computeSvg(t){var M,F,V,Z;const e=(M=t.scale)!=null?M:1,s=(F=t.border)!=null?F:0,i=(V=t.crisp)!=null?V:!0,o=(Z=t.enableForeignObjectForLabel)!=null?Z:!0,a=this.graph.getGraphBounds(),r=this.graph.view.scale,c=l.mxUtils.createXmlDocument(),u=c.createElementNS(l.mxConstants.NS_SVG,"svg"),f=e/r,d=Math.max(1,Math.ceil(a.width*f)+2*s),g=Math.max(1,Math.ceil(a.height*f)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",d+"px"),u.setAttribute("height",g+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+d+" "+g),c.appendChild(u);const p=c.createElementNS(l.mxConstants.NS_SVG,"g");u.appendChild(p);const A=this.createSvgCanvas(p);A.foEnabled=o,A.foOffset=i?-.5:0,A.textOffset=i?-.5:0,A.imageOffset=i?-.5:0,A.translate(Math.floor((s/e-a.x)/r),Math.floor((s/e-a.y)/r)),A.scale(f);const N=new l.mxImageExport;return N.includeOverlays=!0,N.drawState(this.graph.getView().getState(this.graph.model.root),A),c}createSvgCanvas(t){const e=new Yt(t);return e.pointerEvents=!0,e}}class Yt extends l.mxSvgCanvas2D{constructor(e){super(e);T(this,"htmlConverter",document.createElement("div"))}getAlternateText(e,s,i,o,a,r,c,u,f,d,g,p,A){return this.computeTruncatedText(r,o)}plainText(e,s,i,o,a,r,c,u,f,d,g,p){a=this.computeTruncatedText(a,i),super.plainText(e,s,i,o,a,r,c,u,f,d,g,p)}computeTruncatedText(e,s){if(e==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=e,e=l.mxUtils.extractTextWithWhitespace(this.htmlConverter.childNodes);const i=Math.ceil(2*s/this.state.fontSize),o=[];let a=0,r=0;for(;(i==0||a0)break}else o.push(e.charAt(r)),c<255&&a++;r++}o.length1&&(e=l.mxUtils.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return e}}function ht(n,t,e){const s=document.createElement("a");t.startsWith("data:image/svg+xml")&&(e=encodeURIComponent(e),t+=","),s.setAttribute("href",t+e),s.setAttribute("download",n),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}function Ut(n){q("Start SVG download"),ht("diagram.svg","data:image/svg+xml",n),q("Download completed")}function Wt(n){q("Start PNG download");const t=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t),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 a=new Image;i.width=s.naturalWidth,i.height=s.naturalHeight,a.crossOrigin="Anonymous",a.onload=function(){o.drawImage(a,0,0),URL.revokeObjectURL(e);const r=i.toDataURL("image/png");document.body.removeChild(s),ht("diagram.png","",r),q("Download completed")},a.src=s.src},s.src=e}var re=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(re||{}),Ht=(n=>(n.In="in",n.Out="out",n))(Ht||{}),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.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||{}),le=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(le||{}),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||{}),y=(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))(y||{}),ge=(n=>(n.EMBEDDED="embedded",n.EVENT="event",n))(ge||{});function Kt(n,t){return n===""?t?{}:void 0:n}function I(n,t=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(e=>Kt(e,t)).filter(Boolean)}function Dt(n,t,e){let s="";return e!=null&&e.startingWith?s=s.concat(`^(${e.startingWith}).*`):e!=null&&e.notStartingWith&&(s=s.concat(`^(?!(${e.notStartingWith})).*`)),s=s.concat(`${t}$`),n.filter(i=>e!=null&&e.ignoreCase?new RegExp(s,"i").test(i):new RegExp(s).test(i))}class S{static isEvent(t){return he(Ze,t)}static eventKinds(){return[...Ze]}static isBoundaryEvent(t){return h.EVENT_BOUNDARY===t}static isStartEvent(t){return h.EVENT_START===t}static isCallActivity(t){return h.CALL_ACTIVITY===t}static isSubProcess(t){return h.SUB_PROCESS===t}static canHaveNoneEvent(t){return h.EVENT_INTERMEDIATE_THROW===t||h.EVENT_END===t||h.EVENT_START===t}static isActivity(t){return he(Oe,t)}static activityKinds(){return[...Oe]}static isWithDefaultSequenceFlow(t){return zt.includes(t)}static isTask(t){return he(ve,t)}static taskKinds(){return[...ve]}static gatewayKinds(){return[...je]}static isGateway(t){return he(je,t)}static flowNodeKinds(){return Object.values(h).filter(t=>!S.isPoolOrLane(t))}static isPoolOrLane(t){return t==h.POOL||t==h.LANE}}function ke(n,t){return Dt(Object.values(h),n,t)}function he(n,t){return Object.values(n).map(e=>e).includes(t)}const Ze=ke("Event"),je=ke("Gateway"),ve=ke("Task",{ignoreCase:!0,notStartingWith:"global"}),Oe=[...ve,h.CALL_ACTIVITY,h.SUB_PROCESS],zt=[...Oe,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE],ft=Object.values(b).filter(n=>n!=b.NONE);var j=(n=>(n.NONE="None",n.ONE="One",n.BOTH="Both",n))(j||{}),P=(n=>(n.SEQUENCE_FLOW="sequenceFlow",n.MESSAGE_FLOW="messageFlow",n.ASSOCIATION_FLOW="association",n))(P||{}),Q=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(Q||{}),B=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(B||{});class E{}T(E,"EDGE","bpmn.edge"),T(E,"EDGE_START_FILL_COLOR","bpmn.edge.startFillColor"),T(E,"EDGE_END_FILL_COLOR","bpmn.edge.endFillColor"),T(E,"EVENT_BASED_GATEWAY_KIND","bpmn.gatewayKind"),T(E,"EVENT_DEFINITION_KIND","bpmn.eventDefinitionKind"),T(E,"GLOBAL_TASK_KIND","bpmn.globalTaskKind"),T(E,"SUB_PROCESS_KIND","bpmn.subProcessKind"),T(E,"IS_INITIATING","bpmn.isInitiating"),T(E,"IS_INSTANTIATING","bpmn.isInstantiating"),T(E,"IS_INTERRUPTING","bpmn.isInterrupting"),T(E,"EXTRA_CSS_CLASSES","bpmn.extra.css.classes"),T(E,"MARKERS","bpmn.markers"),T(E,"MESSAGE_FLOW_ICON","bpmn.messageFlowIcon");class Be{}T(Be,"ARROW_DASH","bpmn.dash");var m=(n=>(n[n.STROKE_WIDTH_THIN=2]="STROKE_WIDTH_THIN",n[n.STROKE_WIDTH_THICK=5]="STROKE_WIDTH_THICK",n[n.SHAPE_ACTIVITY_BOTTOM_MARGIN=7]="SHAPE_ACTIVITY_BOTTOM_MARGIN",n[n.SHAPE_ACTIVITY_TOP_MARGIN=7]="SHAPE_ACTIVITY_TOP_MARGIN",n[n.SHAPE_ACTIVITY_LEFT_MARGIN=7]="SHAPE_ACTIVITY_LEFT_MARGIN",n[n.SHAPE_ACTIVITY_FROM_CENTER_MARGIN=7]="SHAPE_ACTIVITY_FROM_CENTER_MARGIN",n[n.SHAPE_ACTIVITY_MARKER_ICON_MARGIN=5]="SHAPE_ACTIVITY_MARKER_ICON_MARGIN",n[n.SHAPE_ACTIVITY_MARKER_ICON_SIZE=20]="SHAPE_ACTIVITY_MARKER_ICON_SIZE",n[n.POOL_LABEL_SIZE=30]="POOL_LABEL_SIZE",n.POOL_LABEL_FILL_COLOR="none",n[n.LANE_LABEL_SIZE=30]="LANE_LABEL_SIZE",n.LANE_LABEL_FILL_COLOR="none",n[n.TEXT_ANNOTATION_BORDER_LENGTH=10]="TEXT_ANNOTATION_BORDER_LENGTH",n.TEXT_ANNOTATION_FILL_COLOR="none",n.GROUP_FILL_COLOR="none",n.DEFAULT_FILL_COLOR="White",n.DEFAULT_STROKE_COLOR="Black",n.DEFAULT_FONT_FAMILY="Arial, Helvetica, sans-serif",n[n.DEFAULT_FONT_SIZE=11]="DEFAULT_FONT_SIZE",n.DEFAULT_FONT_COLOR="Black",n[n.DEFAULT_MARGIN=0]="DEFAULT_MARGIN",n[n.SHAPE_ARC_SIZE=20]="SHAPE_ARC_SIZE",n.DEFAULT_OVERLAY_FILL_COLOR="White",n[n.DEFAULT_OVERLAY_FILL_OPACITY=100]="DEFAULT_OVERLAY_FILL_OPACITY",n.DEFAULT_OVERLAY_STROKE_COLOR="Black",n[n.DEFAULT_OVERLAY_STROKE_WIDTH=1]="DEFAULT_OVERLAY_STROKE_WIDTH",n[n.DEFAULT_OVERLAY_FONT_SIZE=11]="DEFAULT_OVERLAY_FONT_SIZE",n.DEFAULT_OVERLAY_FONT_COLOR="Black",n.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR="White",n.MESSAGE_FLOW_MARKER_START_FILL_COLOR="White",n.MESSAGE_FLOW_MARKER_END_FILL_COLOR="White",n))(m||{});class x{static getFillColor(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_FILLCOLOR,"White")}static getStrokeColor(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_STROKECOLOR,"Black")}static getStrokeWidth(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_STROKEWIDTH,2)}static getMargin(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_MARGIN,0)}static getBpmnEventDefinitionKind(t){return l.mxUtils.getValue(t,E.EVENT_DEFINITION_KIND,b.NONE)}static getBpmnSubProcessKind(t){return l.mxUtils.getValue(t,E.SUB_PROCESS_KIND,void 0)}static getBpmnIsInterrupting(t){return l.mxUtils.getValue(t,E.IS_INTERRUPTING,void 0)}static getBpmnMarkers(t){return l.mxUtils.getValue(t,E.MARKERS,void 0)}static getBpmnIsInstantiating(t){return JSON.parse(l.mxUtils.getValue(t,E.IS_INSTANTIATING,!1))}static getBpmnIsInitiating(t){return l.mxUtils.getValue(t,E.IS_INITIATING,void 0)}static getBpmnIsParallelEventBasedGateway(t){return l.mxUtils.getValue(t,E.EVENT_BASED_GATEWAY_KIND,le.Exclusive)==le.Parallel}static getBpmnGlobalTaskKind(t){return l.mxUtils.getValue(t,E.GLOBAL_TASK_KIND,void 0)}}class ce{constructor(t){T(this,"specificFlowStyles",new Ie([[P.SEQUENCE_FLOW,t=>{t[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_BLOCK_THIN}],[P.MESSAGE_FLOW,t=>{t[l.mxConstants.STYLE_DASHED]=!0,t[l.mxConstants.STYLE_DASH_PATTERN]="8 5",t[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_OVAL,t[l.mxConstants.STYLE_STARTSIZE]=8,t[l.mxConstants.STYLE_STARTFILL]=!0,t[E.EDGE_START_FILL_COLOR]=m.MESSAGE_FLOW_MARKER_START_FILL_COLOR,t[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_BLOCK_THIN,t[l.mxConstants.STYLE_ENDFILL]=!0,t[E.EDGE_END_FILL_COLOR]=m.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[P.ASSOCIATION_FLOW,t=>{t[l.mxConstants.STYLE_DASHED]=!0,t[l.mxConstants.STYLE_DASH_PATTERN]="1 2",t[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_OPEN_THIN,t[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_OPEN_THIN,t[l.mxConstants.STYLE_STARTSIZE]=12}]]));T(this,"specificSequenceFlowStyles",new Ie([[B.DEFAULT,t=>{t[l.mxConstants.STYLE_STARTARROW]=Be.ARROW_DASH}],[B.CONDITIONAL_FROM_ACTIVITY,t=>{t[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_DIAMOND_THIN,t[l.mxConstants.STYLE_STARTSIZE]=18,t[l.mxConstants.STYLE_STARTFILL]=!0,t[E.EDGE_START_FILL_COLOR]=m.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));T(this,"specificAssociationFlowStyles",new Ie([[j.NONE,t=>{t[l.mxConstants.STYLE_STARTARROW]=void 0,t[l.mxConstants.STYLE_ENDARROW]=void 0}],[j.ONE,t=>{t[l.mxConstants.STYLE_STARTARROW]=void 0}],[j.BOTH,t=>{}]]));this.graph=t}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){ce.configureCommonDefaultStyle(this.getStylesheet().getDefaultVertexStyle())}configurePoolStyle(){const t={};t[l.mxConstants.STYLE_SHAPE]=l.mxConstants.SHAPE_SWIMLANE,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,t[l.mxConstants.STYLE_STARTSIZE]=m.POOL_LABEL_SIZE,t[l.mxConstants.STYLE_FILLCOLOR]=m.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,t)}configureLaneStyle(){const t={};t[l.mxConstants.STYLE_SHAPE]=l.mxConstants.SHAPE_SWIMLANE,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,t[l.mxConstants.STYLE_SWIMLANE_LINE]=0,t[l.mxConstants.STYLE_STARTSIZE]=m.LANE_LABEL_SIZE,t[l.mxConstants.STYLE_FILLCOLOR]=m.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,t)}configureEventStyles(){S.eventKinds().forEach(t=>{const e={};e[l.mxConstants.STYLE_SHAPE]=t,e[l.mxConstants.STYLE_PERIMETER]=l.mxPerimeter.EllipsePerimeter,e[l.mxConstants.STYLE_STROKEWIDTH]=t==h.EVENT_END?m.STROKE_WIDTH_THICK:m.STROKE_WIDTH_THIN,e[l.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=l.mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)})}configureTextAnnotationStyle(){const t={};t[l.mxConstants.STYLE_SHAPE]=h.TEXT_ANNOTATION,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_LEFT,t[l.mxConstants.STYLE_SPACING_LEFT]=5,t[l.mxConstants.STYLE_FILLCOLOR]=m.TEXT_ANNOTATION_FILL_COLOR,t[l.mxConstants.STYLE_STROKEWIDTH]=m.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[l.mxConstants.STYLE_ROUNDED]=!0,t[l.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[l.mxConstants.STYLE_ARCSIZE]=m.SHAPE_ARC_SIZE,t[l.mxConstants.STYLE_DASHED]=!0,t[l.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",t[l.mxConstants.STYLE_STROKEWIDTH]=m.STROKE_WIDTH_THIN,t[l.mxConstants.STYLE_FILLCOLOR]=m.GROUP_FILL_COLOR,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_TOP,this.putCellStyle(h.GROUP,t)}configureActivityStyles(){S.activityKinds().forEach(t=>{const e={};e[l.mxConstants.STYLE_SHAPE]=t,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,e[l.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[l.mxConstants.STYLE_ARCSIZE]=m.SHAPE_ARC_SIZE,e[l.mxConstants.STYLE_STROKEWIDTH]=t==h.CALL_ACTIVITY?m.STROKE_WIDTH_THICK:m.STROKE_WIDTH_THIN,this.putCellStyle(t,e)})}configureGatewayStyles(){S.gatewayKinds().forEach(t=>{const e={};e[l.mxConstants.STYLE_SHAPE]=t,e[l.mxConstants.STYLE_PERIMETER]=l.mxPerimeter.RhombusPerimeter,e[l.mxConstants.STYLE_STROKEWIDTH]=m.STROKE_WIDTH_THIN,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_TOP,e[l.mxConstants.STYLE_LABEL_POSITION]=l.mxConstants.ALIGN_LEFT,e[l.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=l.mxConstants.ALIGN_TOP,this.putCellStyle(t,e)})}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();t[l.mxConstants.STYLE_SHAPE]=E.EDGE,t[l.mxConstants.STYLE_ENDSIZE]=12,t[l.mxConstants.STYLE_STROKEWIDTH]=1.5,t[l.mxConstants.STYLE_ROUNDED]=1,t[l.mxConstants.STYLE_ARCSIZE]=5,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_BOTTOM,delete t[l.mxConstants.STYLE_ENDARROW],ce.configureCommonDefaultStyle(t)}static configureCommonDefaultStyle(t){t[l.mxConstants.STYLE_FONTFAMILY]=m.DEFAULT_FONT_FAMILY,t[l.mxConstants.STYLE_FONTSIZE]=m.DEFAULT_FONT_SIZE,t[l.mxConstants.STYLE_FONTCOLOR]=m.DEFAULT_FONT_COLOR,t[l.mxConstants.STYLE_FILLCOLOR]=m.DEFAULT_FILL_COLOR,t[l.mxConstants.STYLE_STROKECOLOR]=m.DEFAULT_STROKE_COLOR,t[l.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=l.mxConstants.NONE,t[l.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(t,e){t.forEach(s=>{const i={};e.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)})}configureFlowStyles(){this.configureEdgeStyles(Object.values(P),this.specificFlowStyles),this.configureEdgeStyles(Object.values(B),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(j),this.specificAssociationFlowStyles)}}class Ie extends Map{get(t){var e;return(e=super.get(t))!=null?e:()=>{}}}function $t(n,t,e,s){let i,o;n.heightp.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:r,fillColor:f,strokeColor:d,strokeWidth:c,margin:g}}}class D{paintEmptyIcon(){}newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},a){return new Xt({canvas:t,shapeConfig:i,iconConfig:{originalSize:a,styleConfig:o,ratioFromParent:e,setIconOriginFunct:s}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:a}=t;a.isFilled&&s.setStrokeColor(a.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(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;i>0&&o>0&&s.ellipse(0,0,i,o),t.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});D.paintGearIconBackground(e),e.translateIconOrigin(14,14),D.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();const e=24.8,s=39;D.paintGearInnerCircle(t,e,s)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();const e=39.2,s=55.8;D.paintGearInnerCircle(t,e,s),t.begin(),D.paintGearInnerCircle(t,e,s)}static paintGearInnerCircle(t,e,s){t.moveTo(e,s),t.arcTo(13.5,13.5,0,1,1,e+2*13.5,s),t.arcTo(13.5,13.5,0,0,1,e,s),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),i=e.width,o=e.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(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const s=this.newBpmnCanvas(t,{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(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const a=e.width,r=e.height/5;s.rect(0,0,a,r),s.fill(),s.rect(0,2*r,a,r),s.fill(),s.rect(0,4*r,a,r),s.fill()}paintParallelMultiInstanceIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const a=e.width/5,r=e.height;s.begin(),s.rect(0,0,a,r),s.fill(),s.rect(2*a,0,a,r),s.fill(),s.rect(4*a,0,a,r),s.fill()}paintRightArrowIcon(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}class te{static get(){return this.instance}static set(t){this.instance=t}}T(te,"instance",new D);class J extends l.mxEllipse{constructor(){super(void 0,void 0,void 0);T(this,"iconPainter",te.get());T(this,"iconPainters",new Map([[b.MESSAGE,e=>this.iconPainter.paintEnvelopeIcon({...e,ratioFromParent:.5})],[b.TERMINATE,e=>this.iconPainter.paintCircleIcon({...e,ratioFromParent:.6})],[b.TIMER,e=>this.iconPainter.paintClockIcon({...e,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[b.SIGNAL,e=>this.iconPainter.paintTriangleIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:m.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[b.LINK,e=>this.iconPainter.paintRightArrowIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[b.ERROR,e=>this.iconPainter.paintErrorIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[b.COMPENSATION,e=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...e,ratioFromParent:.7,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[b.CANCEL,e=>this.iconPainter.paintXCrossIcon({...e,ratioFromParent:.78})],[b.ESCALATION,e=>this.iconPainter.paintUpArrowheadIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:m.STROKE_WIDTH_THIN.valueOf()}})],[b.CONDITIONAL,e=>this.iconPainter.paintListIcon({...e,ratioFromParent:.6,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})]]));T(this,"withFilledIcon",!1)}paintVertexShape(e,s,i,o,a){const r=ee({canvas:e,x:s,y:i,width:o,height:a,shape:this,isFilled:this.withFilledIcon});J.setDashedOuterShapePattern(r,x.getBpmnIsInterrupting(this.style)),this.paintOuterShape(r),J.restoreOriginalOuterShapePattern(r),this.paintInnerShape(r)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:i,width:o,height:a}}){super.paintVertexShape(e,s,i,o,a)}paintInnerShape(e){(this.iconPainters.get(x.getBpmnEventDefinitionKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(e)}static setDashedOuterShapePattern(e,s){e.canvas.save(),s==="false"&&(e.canvas.setDashed(!0,!1),e.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(e){e.canvas.restore()}}class Zt extends J{constructor(){super(),this.withFilledIcon=!0}}class _e extends J{paintOuterShape({canvas:t,shapeConfig:{x:e,y:s,width:i,height:o,strokeWidth:a}}){t.ellipse(e,s,i,o),t.fillAndStroke();const r=a*1.5;t.ellipse(i*.02+r+e,o*.02+r+s,i*.96-2*r,o*.96-2*r),t.stroke()}}class jt extends _e{constructor(){super(),this.withFilledIcon=!0}}class me extends l.mxRhombus{constructor(){super(...arguments);T(this,"iconPainter",te.get())}paintVertexShape(e,s,i,o,a){const r=ee({canvas:e,x:s,y:i,width:o,height:a,shape:this});this.paintOuterShape(r),this.paintInnerShape(r)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:i,width:o,height:a}}){super.paintVertexShape(e,s,i,o,a)}}class qt extends me{paintInnerShape(t){this.iconPainter.paintXCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Jt extends me{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Qt extends me{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:m.STROKE_WIDTH_THICK.valueOf()}})}}class en extends me{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),x.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};x.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const tn=[y.LOOP,y.MULTI_INSTANCE_PARALLEL,y.MULTI_INSTANCE_SEQUENTIAL,y.COMPENSATION,y.EXPAND,y.ADHOC];function nn(n){const t=tn.filter(e=>n.includes(e));return n.filter(e=>!t.includes(e)).forEach(e=>t.push(e)),t}function gt(n,t){te.get().paintEnvelopeIcon({...n,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:t}})}class Ge extends l.mxRectangleShape{constructor(){super(void 0,void 0,void 0);T(this,"iconPainter",te.get());this.isRounded=!0}paintForeground(e,s,i,o,a){super.paintForeground(e,s,i,o,a),this.paintMarkerIcons(ee({canvas:e,x:s,y:i,width:o,height:a,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){const s=x.getBpmnMarkers(this.style);s&&nn(s.split(",")).forEach((i,o,a)=>{switch(e={...e,setIconOriginFunct:this.getMarkerIconOriginFunction(a.length,o+1)},e.canvas.save(),i){case y.LOOP:this.iconPainter.paintLoopIcon(e);break;case y.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(e);break;case y.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(e);break;case y.EXPAND:this.iconPainter.paintExpandIcon(e);break}e.canvas.restore()})}getMarkerIconOriginFunction(e,s){let i;return e===1?i=o=>o.setIconOriginForIconBottomCentered():i=o=>{o.setIconOriginForIconBottomCentered();const a=Math.pow(-1,s)*(m.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+m.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);o.translateIconOrigin(a,0)},i}}class H extends Ge{paintForeground(t,e,s,i,o){super.paintForeground(t,e,s,i,o),this.paintTaskIcon(ee({canvas:t,x:e,y:s,width:i,height:o,shape:this}))}}class sn extends H{paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class on extends H{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class rn extends H{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class an extends H{paintTaskIcon(t){if(!x.getBpmnIsInstantiating(this.style)){gt(t,!1);return}const e=4,s=4,i={...t.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:i,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,e)}),i.x+=e,i.y+=s,this.iconPainter.paintEnvelopeIcon({...t,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class ln extends H{paintTaskIcon(t){gt(t,!0)}}class cn extends H{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class un extends H{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class dn extends Ge{paintForeground(t,e,s,i,o){super.paintForeground(t,e,s,i,o);const a=ee({canvas:t,x:e,y:s,width:i,height:o,shape:this});switch(x.getBpmnGlobalTaskKind(this.style)){case h.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon({...a,ratioFromParent:.18,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon({...a,ratioFromParent:.22,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon({...a,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon({...a,ratioFromParent:.6,setIconOriginFunct:r=>r.setIconOriginToShapeTopLeftProportionally(15)});break;case h.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class hn extends Ge{paintBackground(t,e,s,i,o){const a=x.getBpmnSubProcessKind(this.style);t.save(),a===ge.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,s,i,o),t.restore()}}class fn extends H{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class gn extends l.mxRectangleShape{paintForeground(t,e,s,i,o){t.begin(),t.moveTo(e+m.TEXT_ANNOTATION_BORDER_LENGTH,s),t.lineTo(e,s),t.lineTo(e,s+o),t.lineTo(e+m.TEXT_ANNOTATION_BORDER_LENGTH,s+o),t.stroke()}paintBackground(t,e,s,i,o){t.save(),t.setStrokeColor("none"),super.paintBackground(t,e,s,i,o),t.restore()}}class Tn extends l.mxRectangleShape{constructor(e,s,i,o){super(e,s,i,o);T(this,"iconPainter",te.get())}paintVertexShape(e,s,i,o,a){const r=x.getBpmnIsInitiating(this.style)===Q.NON_INITIATING,c=ee({canvas:e,x:s,y:i,width:o,height:a,shape:this,ratioFromParent:1,isFilled:r});this.iconPainter.paintEnvelopeIcon(c)}}function pn(n,t){return En(n.style,t)}function En(n,t){const e=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),a=new Map;return a.set("bpmn-type-activity",S.isActivity(o)),a.set("bpmn-type-container",S.isPoolOrLane(o)),a.set("bpmn-type-event",S.isEvent(o)),a.set("bpmn-type-flow",mn(o)),a.set("bpmn-type-gateway",S.isGateway(o)),a.set("bpmn-type-task",S.isTask(o)),[...a].filter(([,r])=>r).forEach(([r])=>e.push(r)),e.push(ye(o)),s.map(r=>{const c=r.split("=");return[c[0],c[1]]}).forEach(([r,c])=>{switch(r){case E.EVENT_DEFINITION_KIND:e.push(`bpmn-event-def-${c}`);break;case E.EVENT_BASED_GATEWAY_KIND:e.push(`bpmn-gateway-kind-${c.toLowerCase()}`);break;case E.IS_INITIATING:e.push(c==Q.NON_INITIATING?"bpmn-icon-non-initiating":"bpmn-icon-initiating");break;case E.SUB_PROCESS_KIND:e.push(`bpmn-sub-process-${c.toLowerCase()}`);break;case E.GLOBAL_TASK_KIND:e.push(ye(c));break}}),t&&e.push("bpmn-label"),e}function mn(n){return Object.values(P).map(t=>t).includes(n)}function ye(n){return n?"bpmn-"+n.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}class Tt extends l.mxCellOverlay{constructor(e,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");T(this,"style");this.label=e,this.style=s.style}getBounds(e){const s=e.view.graph.getModel().isEdge(e.cell),i=e.view.scale;let o;const a=0,r=0;return s?o=this.computeEdgeBounds(e):(o=new l.mxPoint,this.align==l.mxConstants.ALIGN_LEFT?o.x=e.x:this.align==l.mxConstants.ALIGN_CENTER?o.x=e.x+e.width/2:o.x=e.x+e.width,this.verticalAlign==l.mxConstants.ALIGN_TOP?o.y=e.y:this.verticalAlign==l.mxConstants.ALIGN_MIDDLE?o.y=e.y+e.height/2:o.y=e.y+e.height),new l.mxRectangle(Math.round(o.x-(a*this.defaultOverlap-this.offset.x)*i),Math.round(o.y-(r*this.defaultOverlap-this.offset.y)*i),a*i,r*i)}computeEdgeBounds(e){const s=e.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],a=s[i];return new l.mxPoint(o.x+(a.x-o.x)/2,o.y+(a.y-o.y)/2)}}else return s[s.length-1]}}class qe extends l.mxText{constructor(t,e,s){super(t,e,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 Cn extends l.mxConnector{constructor(t,e,s){super(t,e,s)}paintEdgeShape(t,e){const s=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),s!=null&&(t.setFillColor(l.mxUtils.getValue(this.style,E.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(t.setFillColor(l.mxUtils.getValue(this.style,E.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const s=Sn(t);Je(t,"stroke"),this.paintLine(t,e,this.isRounded),Je(t,s)}}function Sn(n){return n instanceof l.mxSvgCanvas2D?n.pointerEventsValue:null}function Je(n,t){n instanceof l.mxSvgCanvas2D&&(n.pointerEventsValue=t)}class In{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){l.mxCellRenderer.registerShape(h.EVENT_END,Zt),l.mxCellRenderer.registerShape(h.EVENT_START,J),l.mxCellRenderer.registerShape(h.EVENT_INTERMEDIATE_THROW,jt),l.mxCellRenderer.registerShape(h.EVENT_INTERMEDIATE_CATCH,_e),l.mxCellRenderer.registerShape(h.EVENT_BOUNDARY,_e),l.mxCellRenderer.registerShape(h.GATEWAY_EVENT_BASED,en),l.mxCellRenderer.registerShape(h.GATEWAY_EXCLUSIVE,qt),l.mxCellRenderer.registerShape(h.GATEWAY_INCLUSIVE,Qt),l.mxCellRenderer.registerShape(h.GATEWAY_PARALLEL,Jt),l.mxCellRenderer.registerShape(h.SUB_PROCESS,hn),l.mxCellRenderer.registerShape(h.CALL_ACTIVITY,dn),l.mxCellRenderer.registerShape(h.TASK,sn),l.mxCellRenderer.registerShape(h.TASK_SERVICE,on),l.mxCellRenderer.registerShape(h.TASK_USER,rn),l.mxCellRenderer.registerShape(h.TASK_RECEIVE,an),l.mxCellRenderer.registerShape(h.TASK_SEND,ln),l.mxCellRenderer.registerShape(h.TASK_MANUAL,cn),l.mxCellRenderer.registerShape(h.TASK_SCRIPT,un),l.mxCellRenderer.registerShape(h.TASK_BUSINESS_RULE,fn),l.mxCellRenderer.registerShape(h.TEXT_ANNOTATION,gn),l.mxCellRenderer.registerShape(E.EDGE,Cn),l.mxCellRenderer.registerShape(E.MESSAGE_FLOW_ICON,Tn)}initMxSvgCanvasPrototype(){l.mxSvgCanvas2D.prototype.getTextCss=function(){const t=this.state,e=l.mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*l.mxConstants.LINE_HEIGHT+"px":l.mxConstants.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: none; ";(t.fontStyle&l.mxConstants.FONT_BOLD)==l.mxConstants.FONT_BOLD&&(s+="font-weight: bold; "),(t.fontStyle&l.mxConstants.FONT_ITALIC)==l.mxConstants.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(t.fontStyle&l.mxConstants.FONT_UNDERLINE)==l.mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.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(){const t=new l.mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;const e=this.getSvgScreenOffset();if(e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),this.state&&this.state.cell){const s=this.state.cell;let i=pn(s,this.dialect===l.mxConstants.DIALECT_STRICTHTML);const o=this.state.style[E.EXTRA_CSS_CLASSES];o&&(i=i.concat(o)),this.node.setAttribute("class",i.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(s){return Math.round(parseFloat(s))}),t}}initMxCellRendererCreateCellOverlays(){l.mxCellRenderer.prototype.createCellOverlays=function(t){const s=t.view.graph.getCellOverlays(t.cell);let i=null;if(s!=null){i=new l.mxDictionary;for(const o of s){const a=t.overlays!=null?t.overlays.remove(o):null;if(a!=null){i.put(o,a);continue}let r;o instanceof Tt?r=new qe(o.label,new l.mxRectangle(0,0,0,0),o.style):(r=new l.mxImageShape(new l.mxRectangle(0,0,0,0),o.image.src),r.preserveImageAspect=!1),r.dialect=t.view.graph.dialect,r.overlay=o,this.initializeOverlay(t,r),this.installCellOverlayListeners(t,o,r),o.cursor!=null&&(r.node.style.cursor=o.cursor),r instanceof qe&&(r.node.classList.add("overlay-badge"),r.node.setAttribute("data-bpmn-id",t.cell.id)),i.put(o,r)}}t.overlays!=null&&t.overlays.visit(function(o,a){a.destroy()}),t.overlays=i}}}class An{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const t=(e,s,i,o,a,r,c,u,f)=>{const d=a*(c+f+4),g=r*(c+f+4);return function(){e.begin(),e.moveTo(o.x-d/2-g/2,o.y-g/2+d/2),e.lineTo(o.x+g/2-3*d/2,o.y-3*g/2-d/2),e.stroke()}};l.mxMarker.addMarker(Be.ARROW_DASH,t)}}function Qe(n,t,e,s){let i=n==null?s:n;return i=Math.min(Math.max(i,t),e),i}function Nn(n){return Math.max(n||0,0)}function Ln(n){const t=n!=null?n:{};return t.debounceDelay=Qe(t.debounceDelay,0,100,50),t.throttleDelay=Qe(t.throttleDelay,0,100,50),t}var vn="Expected a function",et=0/0,On="[object Symbol]",_n=/^\s+|\s+$/g,yn=/^[-+]0x[0-9a-f]+$/i,bn=/^0b[01]+$/i,wn=/^0o[0-7]+$/i,Rn=parseInt,xn=typeof U=="object"&&U&&U.Object===Object&&U,Fn=typeof self=="object"&&self&&self.Object===Object&&self,Pn=xn||Fn||Function("return this")(),Mn=Object.prototype,kn=Mn.toString,Bn=Math.max,Gn=Math.min,Ae=function(){return Pn.Date.now()};function Vn(n,t,e){var s,i,o,a,r,c,u=0,f=!1,d=!1,g=!0;if(typeof n!="function")throw new TypeError(vn);t=tt(t)||0,be(e)&&(f=!!e.leading,d="maxWait"in e,o=d?Bn(tt(e.maxWait)||0,t):o,g="trailing"in e?!!e.trailing:g);function p(C){var _=s,k=i;return s=i=void 0,u=C,a=n.apply(k,_),a}function A(C){return u=C,r=setTimeout(F,t),f?p(C):a}function N(C){var _=C-c,k=C-u,se=t-_;return d?Gn(se,o-k):se}function M(C){var _=C-c,k=C-u;return c===void 0||_>=t||_<0||d&&k>=o}function F(){var C=Ae();if(M(C))return V(C);r=setTimeout(F,N(C))}function V(C){return r=void 0,g&&s?p(C):(s=i=void 0,a)}function Z(){r!==void 0&&clearTimeout(r),u=0,s=c=i=r=void 0}function Se(){return r===void 0?a:V(Ae())}function K(){var C=Ae(),_=M(C);if(s=arguments,i=this,c=C,_){if(r===void 0)return A(c);if(d)return r=setTimeout(F,t),p(c)}return r===void 0&&(r=setTimeout(F,t)),a}return K.cancel=Z,K.flush=Se,K}function be(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Yn(n){return!!n&&typeof n=="object"}function Un(n){return typeof n=="symbol"||Yn(n)&&kn.call(n)==On}function tt(n){if(typeof n=="number")return n;if(Un(n))return et;if(be(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=be(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(_n,"");var e=bn.test(n);return e||wn.test(n)?Rn(n.slice(2),e?2:8):yn.test(n)?et:+n}var Wn=Vn,pt="Expected a function",nt=0/0,Hn="[object Symbol]",Kn=/^\s+|\s+$/g,Dn=/^[-+]0x[0-9a-f]+$/i,zn=/^0b[01]+$/i,$n=/^0o[0-7]+$/i,Xn=parseInt,Zn=typeof U=="object"&&U&&U.Object===Object&&U,jn=typeof self=="object"&&self&&self.Object===Object&&self,qn=Zn||jn||Function("return this")(),Jn=Object.prototype,Qn=Jn.toString,es=Math.max,ts=Math.min,Ne=function(){return qn.Date.now()};function ns(n,t,e){var s,i,o,a,r,c,u=0,f=!1,d=!1,g=!0;if(typeof n!="function")throw new TypeError(pt);t=st(t)||0,Te(e)&&(f=!!e.leading,d="maxWait"in e,o=d?es(st(e.maxWait)||0,t):o,g="trailing"in e?!!e.trailing:g);function p(C){var _=s,k=i;return s=i=void 0,u=C,a=n.apply(k,_),a}function A(C){return u=C,r=setTimeout(F,t),f?p(C):a}function N(C){var _=C-c,k=C-u,se=t-_;return d?ts(se,o-k):se}function M(C){var _=C-c,k=C-u;return c===void 0||_>=t||_<0||d&&k>=o}function F(){var C=Ne();if(M(C))return V(C);r=setTimeout(F,N(C))}function V(C){return r=void 0,g&&s?p(C):(s=i=void 0,a)}function Z(){r!==void 0&&clearTimeout(r),u=0,s=c=i=r=void 0}function Se(){return r===void 0?a:V(Ne())}function K(){var C=Ne(),_=M(C);if(s=arguments,i=this,c=C,_){if(r===void 0)return A(c);if(d)return r=setTimeout(F,t),p(c)}return r===void 0&&(r=setTimeout(F,t)),a}return K.cancel=Z,K.flush=Se,K}function ss(n,t,e){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(pt);return Te(e)&&(s="leading"in e?!!e.leading:s,i="trailing"in e?!!e.trailing:i),ns(n,t,{leading:s,maxWait:t,trailing:i})}function Te(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function is(n){return!!n&&typeof n=="object"}function os(n){return typeof n=="symbol"||is(n)&&Qn.call(n)==Hn}function st(n){if(typeof n=="number")return n;if(os(n))return nt;if(Te(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Te(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(Kn,"");var e=zn.test(n);return e||$n.test(n)?Xn(n.slice(2),e?2:8):Dn.test(n)?nt:+n}var rs=ss;const we=1.25,as=1/we;class ls extends l.mxGraph{constructor(e){super(e);T(this,"currentZoomLevel",1);this.zoomFactor=we,this.container&&(this.container.style.cursor="default")}createGraphView(){return new cs(this)}fit(e,s,i,o,a,r,c){const u=super.fit(e,s,i,o,a,r,c);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(e){this.currentZoomLevel=e!=null?e:this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(e){this.zoomActual();const s=e==null?void 0:e.type;if(s==null||s==re.None)return;const i=Nn(e==null?void 0:e.margin);if(s!=re.Center){let o=!1,a=!1;switch(s){case re.Horizontal:a=!0;break;case re.Vertical:o=!0;break}this.fit(this.border,!1,i,!0,o,a)}else{const a=this.getGraphBounds(),r=this.container.clientWidth-i,c=this.container.clientHeight-i,u=a.width/this.view.scale,f=a.height/this.view.scale,d=Math.min(3,Math.min(r/u,c/f));this.setCurrentZoomLevel(d),this.view.scaleAndTranslate(d,(i+r-u*d)/(2*d)-a.x/this.view.scale,(i+c-f*d)/(2*d)-a.y/this.view.scale)}}registerMouseWheelZoomListeners(e){e=Ln(e),l.mxEvent.addMouseWheelListener(Wn(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.container),l.mxEvent.addMouseWheelListener(rs(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.container)}manageMouseWheelZoomEvent(e,s,i){if(!i)this.currentZoomLevel*=e?we:as;else{const[o,a]=this.getEventRelativeCoordinates(s),[r,c,u]=this.getScaleAndTranslationDeltas(o,a);this.view.scaleAndTranslate(r,this.view.translate.x+c,this.view.translate.y+u),l.mxEvent.consume(s)}}createMouseWheelZoomListener(e){return(s,i)=>{if(l.mxEvent.isConsumed(s))return;const o=s;o.ctrlKey&&!o.altKey&&!o.shiftKey&&!o.metaKey&&this.manageMouseWheelZoomEvent(i,o,e)}}getEventRelativeCoordinates(e){const s=this.container.getBoundingClientRect(),i=e.clientX-s.left,o=e.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(e,s){const[i,o]=this.calculateFactorAndScale(),[a,r]=this.calculateTranslationDeltas(i,o,e*2,s*2);return[o,a,r]}calculateTranslationDeltas(e,s,i,o){if(e>1){const a=(e-1)/(s*2);i*=-a,o*=-a}else{const a=(1/e-1)/(this.view.scale*2);i*=a,o*=a}return[i,o]}calculateFactorAndScale(){const e=Math.round(this.currentZoomLevel*100)/100;return[e/this.view.scale,e]}}class cs extends l.mxGraphView{getFloatingTerminalPoint(t,e,s,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,s,i);const r=t.absolutePoints;return i?r[1]:r[r.length-2]}}class us{constructor(t){T(this,"graph");this.container=t,this.graph=new ls(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new ce(this.graph).configureStyles(),new In().configureShapes(),new An().configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var s;const e=this.graph.panningHandler;(s=t==null?void 0:t.navigation)!=null&&s.enabled?(e.addListener(l.mxEvent.PAN_START,this.getPanningHandler("grab")),e.addListener(l.mxEvent.PAN_END,this.getPanningHandler("default")),this.graph.panningHandler.usePopupTrigger=!1,e.isForcePanningEvent=i=>l.mxEvent.isLeftMouseButton(i.getEvent())||l.mxEvent.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(t.navigation.zoom)):(this.graph.setPanning(!1),e.setPinchEnabled(!1),e.isForcePanningEvent=i=>!1)}getPanningHandler(t){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=t)}}}class Ve{constructor(t,e,s,i,o){this.id=t,this.name=e,this.kind=s,this.sourceRefId=i,this.targetRefId=o}}class Et extends Ve{constructor(t,e,s,i,o=B.NORMAL){super(t,e,P.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class mt extends Ve{constructor(t,e,s,i){super(t,e,P.MESSAGE_FLOW,s,i)}}class Ct extends Ve{constructor(t,e,s,i,o=j.NONE){super(t,e,P.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}class ds{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const s=this.getTranslateForRoot(t),i=e.x+s.x,o=e.y+s.y;return new l.mxPoint(i,o)}getTranslateForRoot(t){const e=this.graph.getModel(),s=new l.mxPoint(0,0);for(;t!=null;){const i=e.getGeometry(t);i!=null&&(s.x-=i.x,s.y-=i.y),t=e.getParent(t)}return s}computeEdgeCenter(t){const e=t.geometry.points,s=e[0],i=e[e.length-1];if(s!=null&&i!=null){const o=i.x-s.x,a=i.y-s.y;return new l.mxPoint(s.x+o/2,s.y+a/2)}}}class fe{constructor(t,e,s,i,o){this.id=t,this.bpmnElement=e,this.bounds=s,this.label=i,this.isHorizontal=o}}class G{constructor(t,e,s,i,o=!1){this.id=t,this.name=e,this.kind=s,this.parentId=i,this.instantiate=o}}class Ce extends G{constructor(t,e,s,i,o,a=[]){super(t,e,s,i,o),this.markers=a}}class ue extends Ce{constructor(t,e,s,i,o,a){super(t,e,h.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=a}}class pe extends Ce{constructor(t,e,s,i,o){super(t,e,h.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class de extends G{constructor(t,e,s,i,o){super(t,e,s,o),this.eventDefinitionKind=i}}class St extends de{constructor(t,e,s,i,o){super(t,e,h.EVENT_START,s,i),this.isInterrupting=o}}class It extends de{constructor(t,e,s,i,o=!0){super(t,e,h.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class At extends G{constructor(t,e,s,i,o=le.None){super(t,e,h.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}class z{computeStyle(t,e){const s=[t.bpmnElement.kind];let i;t instanceof fe?i=z.computeShapeStyle(t):(s.push(...z.computeEdgeStyle(t)),i=new Map);const o=z.computeFontStyleValues(t),a=z.computeLabelStyleValues(t,e);return[].concat([...s]).concat([...i,...o,...a].filter(([,r])=>r&&r!="undefined").map(([r,c])=>r+"="+c)).join(";")}static computeShapeStyle(t){const e=new Map,s=t.bpmnElement;return s instanceof de?this.computeEventShapeStyle(s,e):s instanceof Ce?this.computeActivityShapeStyle(s,e):S.isPoolOrLane(s.kind)?e.set(l.mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):s instanceof At&&(e.set(E.IS_INSTANTIATING,String(s.instantiate)),e.set(E.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),e}static computeEventShapeStyle(t,e){e.set(E.EVENT_DEFINITION_KIND,t.eventDefinitionKind),(t instanceof It||t instanceof St&&t.isInterrupting!==void 0)&&e.set(E.IS_INTERRUPTING,String(t.isInterrupting))}static computeActivityShapeStyle(t,e){t instanceof pe?e.set(E.SUB_PROCESS_KIND,t.subProcessKind):t.kind===h.TASK_RECEIVE?e.set(E.IS_INSTANTIATING,String(t.instantiate)):t instanceof ue&&e.set(E.GLOBAL_TASK_KIND,t.globalTaskKind);const s=t.markers;s.length>0&&e.set(E.MARKERS,s.join(","))}static computeEdgeStyle(t){const e=[],s=t.bpmnElement;return s instanceof Et&&e.push(s.sequenceFlowKind),s instanceof Ct&&e.push(s.associationDirectionKind),e}static computeFontStyleValues(t){var i;const e=new Map,s=(i=t.label)==null?void 0:i.font;return s&&(e.set(l.mxConstants.STYLE_FONTFAMILY,s.name),e.set(l.mxConstants.STYLE_FONTSIZE,s.size),e.set(l.mxConstants.STYLE_FONTSTYLE,z.getFontStyleValue(s))),e}static computeLabelStyleValues(t,e){const s=new Map,i=t.bpmnElement;return e?(s.set(l.mxConstants.STYLE_VERTICAL_ALIGN,l.mxConstants.ALIGN_TOP),t.bpmnElement.kind!=h.TEXT_ANNOTATION&&s.set(l.mxConstants.STYLE_ALIGN,l.mxConstants.ALIGN_CENTER),t instanceof fe&&(s.set(l.mxConstants.STYLE_LABEL_WIDTH,e.width+1),s.set(l.mxConstants.STYLE_LABEL_POSITION,l.mxConstants.ALIGN_TOP),s.set(l.mxConstants.STYLE_VERTICAL_LABEL_POSITION,l.mxConstants.ALIGN_LEFT))):t instanceof fe&&(i instanceof pe||i instanceof ue&&i.callActivityKind===ae.CALLING_PROCESS)&&!i.markers.includes(y.EXPAND)&&s.set(l.mxConstants.STYLE_VERTICAL_ALIGN,l.mxConstants.ALIGN_TOP),s}computeMessageFlowIconStyle(t){return`shape=${E.MESSAGE_FLOW_ICON};${E.IS_INITIATING}=${t.messageVisibleKind}`}static getFontStyleValue(t){let e=0;return t.isBold&&(e+=l.mxConstants.FONT_BOLD),t.isItalic&&(e+=l.mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=l.mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=l.mxConstants.FONT_UNDERLINE),e}}class hs{constructor(t,e,s){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=s}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(e)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:a}){const r=this.graph.getModel();r.clear(),r.beginUpdate();try{this.insertShapes(t),this.insertShapes(e),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(a)}finally{r.endUpdate()}}insertShapes(t){t.forEach(e=>this.insertShape(e))}getParent(t){const e=this.getCell(t.parentId);return e!=null?e:this.graph.getDefaultParent()}insertShape(t){var r;const e=t.bpmnElement,s=this.getParent(e),i=t.bounds;let o=(r=t.label)==null?void 0:r.bounds;o=S.isPoolOrLane(e.kind)?void 0:o;const a=this.styleComputer.computeStyle(t,o);this.insertVertex(s,e.id,e.name,i,o,a)}insertEdges(t){t.forEach(e=>{var f;const s=e.bpmnElement,i=this.graph.getDefaultParent(),o=this.getCell(s.sourceRefId),a=this.getCell(s.targetRefId),r=(f=e.label)==null?void 0:f.bounds,c=this.styleComputer.computeStyle(e,r),u=this.graph.insertEdge(i,s.id,s.name,o,a,c);if(this.insertWaypoints(e.waypoints,u),r){u.geometry.width=r.width,u.geometry.height=r.height;const d=this.coordinatesTranslator.computeEdgeCenter(u);if(d){u.geometry.relative=!1;const g=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new l.mxPoint(r.x,r.y)),p=g.x+r.width/2-d.x,A=g.y-d.y;u.geometry.offset=new l.mxPoint(p,A)}}this.insertMessageFlowIconIfNeeded(e,u)})}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof mt&&t.messageVisibleKind!==Q.NONE){const s=this.graph.insertVertex(e,Nt(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));s.geometry.relative=!0,s.geometry.offset=new l.mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new l.mxPoint(s.x,s.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,s,i,o,a){const r=this.coordinatesTranslator.computeRelativeCoordinates(t,new l.mxPoint(i.x,i.y)),c=this.graph.insertVertex(t,e,s,r.x,r.y,i.width,i.height,a);if(o){const u=o.x-i.x,f=o.y-i.y;c.geometry.offset=new l.mxPoint(u,f)}return c}}function fs(n){return new hs(n,new ds(n),new z)}function Nt(n){return`messageFlowIcon_of_${n}`}var Ye={},Ue={};(function(n){const t=":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",e=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+t+"]["+e+"]*",i=new RegExp("^"+s+"$"),o=function(r,c){const u=[];let f=c.exec(r);for(;f;){const d=[];d.startIndex=c.lastIndex-f[0].length;const g=f.length;for(let p=0;p"u")};n.isExist=function(r){return typeof r<"u"},n.isEmptyObject=function(r){return Object.keys(r).length===0},n.merge=function(r,c,u){if(c){const f=Object.keys(c),d=f.length;for(let g=0;g"&&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--),!As(c)){let d;return c.trim().length===0?d="Invalid space after '<'.":d="Tag '"+c+"' is an invalid name.",L("InvalidTag",d,w(n,o))}const u=Es(n,o);if(u===!1)return L("InvalidAttr","Attributes for '"+c+"' have open quote.",w(n,o));let f=u.value;if(o=u.index,f[f.length-1]==="/"){const d=o-f.length;f=f.substring(0,f.length-1);const g=at(f,t);if(g===!0)s=!0;else return L(g.err.code,g.err.msg,w(n,d+g.err.line))}else if(r)if(u.tagClosed){if(f.trim().length>0)return L("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",w(n,a));{const d=e.pop();if(c!==d.tagName){let g=w(n,d.tagStartPos);return L("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+g.line+", col "+g.col+") instead of closing tag '"+c+"'.",w(n,a))}e.length==0&&(i=!0)}}else return L("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",w(n,o));else{const d=at(f,t);if(d!==!0)return L(d.err.code,d.err.msg,w(n,o-f.length+d.err.line));if(i===!0)return L("InvalidXml","Multiple possible root nodes found.",w(n,o));t.unpairedTags.indexOf(c)!==-1||e.push({tagName:c,tagStartPos:a}),s=!0}for(o++;o0)return L("InvalidXml","Invalid '"+JSON.stringify(e.map(o=>o.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return L("InvalidXml","Start tag expected.",1);return!0};function it(n){return n===" "||n===" "||n===` -`||n==="\r"}function ot(n,t){const e=t;for(;t5&&s==="xml")return L("InvalidXml","XML declaration allowed only at the start of the document.",w(n,t));if(n[t]=="?"&&n[t+1]==">"){t++;break}else continue}return t}function rt(n,t){if(n.length>t+5&&n[t+1]==="-"&&n[t+2]==="-"){for(t+=3;t"){t+=2;break}}else if(n.length>t+8&&n[t+1]==="D"&&n[t+2]==="O"&&n[t+3]==="C"&&n[t+4]==="T"&&n[t+5]==="Y"&&n[t+6]==="P"&&n[t+7]==="E"){let e=1;for(t+=8;t"&&(e--,e===0))break}else if(n.length>t+9&&n[t+1]==="["&&n[t+2]==="C"&&n[t+3]==="D"&&n[t+4]==="A"&&n[t+5]==="T"&&n[t+6]==="A"&&n[t+7]==="["){for(t+=8;t"){t+=2;break}}return t}const Ts='"',ps="'";function Es(n,t){let e="",s="",i=!1;for(;t"&&s===""){i=!0;break}e+=n[t]}return s!==""?!1:{value:e,index:t,tagClosed:i}}const ms=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function at(n,t){const e=We.getAllMatches(n,ms),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1},Ns=function(n){return Object.assign({},Lt,n)};He.buildOptions=Ns;He.defaultOptions=Lt;class Ls{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){this.child.push({[t]:e})}addChild(t){t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,[":@"]:t[":@"]}):this.child.push({[t.tagname]:t.child})}}var vs=Ls;function Os(n,t){const e={};if(n[t+3]==="O"&&n[t+4]==="C"&&n[t+5]==="T"&&n[t+6]==="Y"&&n[t+7]==="P"&&n[t+8]==="E"){t=t+9;let s=1,i=!1,o=!1,a=!1,r="";for(;t"){if(a)if(n[t-1]==="-"&&n[t-2]==="-")a=!1;else throw new Error("Invalid XML comment in DOCTYPE");else o&&(ys(r,e),o=!1);if(s--,s===0)break}else n[t]==="["?i=!0:r+=n[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:e,i:t}}const _s=RegExp(`^\\s([a-zA-z0-0]+)[ ](['"])([^&]+)\\2`);function ys(n,t){const e=_s.exec(n);e&&(t[e[1]]={regx:RegExp(`&${e[1]};`,"g"),val:e[3]})}var bs=Os;const ws=/^[-+]?0x[a-fA-F0-9]+$/,Rs=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const xs={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Fs(n,t={}){if(t=Object.assign({},xs,t),!n||typeof n!="string")return n;let e=n.trim();if(t.skipLike!==void 0&&t.skipLike.test(e))return n;if(t.hex&&ws.test(e))return Number.parseInt(e,16);{const s=Rs.exec(e);if(s){const i=s[1],o=s[2];let a=Ps(s[3]);const r=s[4]||s[6];if(!t.leadingZeros&&o.length>0&&i&&e[2]!==".")return n;if(!t.leadingZeros&&o.length>0&&!i&&e[1]!==".")return n;{const c=Number(e),u=""+c;return u.search(/[eE]/)!==-1||r?t.eNotation?c:n:e.indexOf(".")!==-1?u==="0"&&a===""||u===a||i&&u==="-"+a?c:n:o?a===u||i+a===u?c:n:e===u||e===i+u?c:n}}else return n}}function Ps(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 Ms=Fs;const Ke=Ue,oe=vs,ks=bs,Bs=Ms;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Ke.nameRegexp);class Gs{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={amp:{regex:/&(amp|#38|#x26);/g,val:"&"},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.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=Vs,this.parseXml=Ks,this.parseTextData=Ys,this.resolveNameSpace=Us,this.buildAttributesMap=Hs,this.isItStopNode=$s,this.replaceEntitiesValue=Ds,this.readStopNodeData=Zs,this.saveTextToParentTag=zs}}function Vs(n){const t=Object.keys(n);for(let e=0;e0)){a||(n=this.replaceEntitiesValue(n));const r=this.options.tagValueProcessor(t,n,e,i,o);return r==null?n:typeof r!=typeof n||r!==n?r:this.options.trimValues?xe(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?xe(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Us(n){if(this.options.removeNSPrefix){const t=n.split(":"),e=n.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(n=e+t[1])}return n}const Ws=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Hs(n,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const e=Ke.getAllMatches(n,Ws),s=e.length,i={};for(let o=0;o",o,"Closing Tag is not closed.");let c=n.substring(o+2,r).trim();if(this.options.removeNSPrefix){const u=c.indexOf(":");u!==-1&&(c=c.substr(u+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),e&&(s=this.saveTextToParentTag(s,e,i)),i=i.substr(0,i.lastIndexOf(".")),e=this.tagsNodeStack.pop(),s="",o=r}else if(n[o+1]==="?"){let r=Re(n,o,!1,"?>");if(!r)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,e,i),!(this.options.ignoreDeclaration&&r.tagName==="?xml"||this.options.ignorePiTags)){const c=new oe(r.tagName);c.add(this.options.textNodeName,""),r.tagName!==r.tagExp&&r.attrExpPresent&&(c[":@"]=this.buildAttributesMap(r.tagExp,i)),e.addChild(c)}o=r.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const r=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const c=n.substring(o+4,r-2);s=this.saveTextToParentTag(s,e,i),e.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=r}else if(n.substr(o+1,2)==="!D"){const r=ks(n,o);this.docTypeEntities=r.entities,o=r.i}else if(n.substr(o+1,2)==="!["){const r=$(n,"]]>",o,"CDATA is not closed.")-2,c=n.substring(o+9,r);if(s=this.saveTextToParentTag(s,e,i),this.options.cdataPropName)e.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]);else{let u=this.parseTextData(c,e.tagname,i,!0,!1,!0);u==null&&(u=""),e.add(this.options.textNodeName,u)}o=r+2}else{let r=Re(n,o,this.options.removeNSPrefix),c=r.tagName,u=r.tagExp,f=r.attrExpPresent,d=r.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),e&&s&&e.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,e,i,!1)),c!==t.tagname&&(i+=i?"."+c:c);const g=e;if(g&&this.options.unpairedTags.indexOf(g.tagname)!==-1&&(e=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,i,c)){let p="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)o=r.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)o=r.closeIndex;else{const N=this.readStopNodeData(n,c,d+1);if(!N)throw new Error(`Unexpected end of ${c}`);o=N.i,p=N.tagContent}const A=new oe(c);c!==u&&f&&(A[":@"]=this.buildAttributesMap(u,i)),p&&(p=this.parseTextData(p,c,i,!0,f,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),A.add(this.options.textNodeName,p),e.addChild(A)}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 p=new oe(c);c!==u&&f&&(p[":@"]=this.buildAttributesMap(u,i)),i=i.substr(0,i.lastIndexOf(".")),e.addChild(p)}else{const p=new oe(c);this.tagsNodeStack.push(e),c!==u&&f&&(p[":@"]=this.buildAttributesMap(u,i)),e.addChild(p),e=p}s="",o=d}}else s+=n[o];return t.child},Ds=function(n){if(this.options.processEntities){for(let t in this.docTypeEntities){const e=this.docTypeEntities[t];n=n.replace(e.regx,e.val)}for(let t in this.lastEntities){const e=this.lastEntities[t];n=n.replace(e.regex,e.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const e=this.htmlEntities[t];n=n.replace(e.regex,e.val)}}return n};function zs(n,t,e,s){return n&&(s===void 0&&(s=Object.keys(t.child).length===0),n=this.parseTextData(n,t.tagname,e,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&t.add(this.options.textNodeName,n),n=""),n}function $s(n,t,e){const s="*."+e;for(const i in n){const o=n[i];if(s===o||t===o)return!0}return!1}function Xs(n,t,e=">"){let s,i="";for(let o=t;o",e,`${t} is not closed`);if(n.substring(e+2,o).trim()===t&&(i--,i===0))return{tagContent:n.substring(s,e),i:o};e=o}else if(n[e+1]==="?")e=$(n,"?>",e+1,"StopNode is not closed.");else if(n.substr(e+1,3)==="!--")e=$(n,"-->",e+3,"StopNode is not closed.");else if(n.substr(e+1,2)==="![")e=$(n,"]]>",e,"StopNode is not closed.")-2;else{const o=Re(n,e,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,e=o.closeIndex)}}function xe(n,t,e){if(t&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:Bs(n,e)}else return Ke.isExist(n)?n:""}var js=Gs,vt={};function qs(n,t){return Ot(n,t)}function Ot(n,t,e){let s;const i={};for(let o=0;o0&&(i[t.textNodeName]=s):s!==void 0&&(i[t.textNodeName]=s),i}function Js(n){const t=Object.keys(n);for(let e=0;e0&&(o=ai+""+t.indentBy.repeat(s));for(let a=0;a`;continue}else if(c===t.commentPropName){i+=o+``;continue}else if(c[0]==="?"){const p=lt(r[":@"],t),A=c==="?xml"?"":o;let N=r[c][0][t.textNodeName];N=N.length!==0?" "+N:"",i+=A+`<${c}${N}${p}?>`;continue}const f=lt(r[":@"],t);let d=o+`<${c}${f}`,g=_t(r[c],t,u,s+1);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?i+=d+">":i+=d+"/>":(!g||g.length===0)&&t.suppressEmptyNode?i+=d+"/>":i+=d+`>${g}${o}`}return i}function ci(n){const t=Object.keys(n);for(let e=0;e0&&t.processEntities)for(let e=0;e","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],transformTagName:!1};function De(n){this.options=Object.assign({},fi,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Si),this.processTextOrObjNode=Ti,this.options.format?(this.indentate=Ci,this.tagEndChar=`> +`}computeSvg(t){var P,F,V,Z;const e=(P=t.scale)!=null?P:1,s=(F=t.border)!=null?F:0,i=(V=t.crisp)!=null?V:!0,o=(Z=t.enableForeignObjectForLabel)!=null?Z:!0,r=this.graph.getGraphBounds(),a=this.graph.view.scale,c=l.mxUtils.createXmlDocument(),u=c.createElementNS(l.mxConstants.NS_SVG,"svg"),f=e/a,d=Math.max(1,Math.ceil(r.width*f)+2*s),p=Math.max(1,Math.ceil(r.height*f)+2*s);u.setAttribute("version","1.1"),u.setAttribute("width",d+"px"),u.setAttribute("height",p+"px"),u.setAttribute("viewBox",(i?"-0.5 -0.5":"0 0")+" "+d+" "+p),c.appendChild(u);const g=c.createElementNS(l.mxConstants.NS_SVG,"g");u.appendChild(g);const A=this.createSvgCanvas(g);A.foEnabled=o,A.foOffset=i?-.5:0,A.textOffset=i?-.5:0,A.imageOffset=i?-.5:0,A.translate(Math.floor((s/e-r.x)/a),Math.floor((s/e-r.y)/a)),A.scale(f);const N=new l.mxImageExport;return N.includeOverlays=!0,N.drawState(this.graph.getView().getState(this.graph.model.root),A),c}createSvgCanvas(t){const e=new Yt(t);return e.pointerEvents=!0,e}}class Yt extends l.mxSvgCanvas2D{constructor(e){super(e);T(this,"htmlConverter",document.createElement("div"))}getAlternateText(e,s,i,o,r,a,c,u,f,d,p,g,A){return this.computeTruncatedText(a,o)}plainText(e,s,i,o,r,a,c,u,f,d,p,g){r=this.computeTruncatedText(r,i),super.plainText(e,s,i,o,r,a,c,u,f,d,p,g)}computeTruncatedText(e,s){if(e==null||this.state.fontSize<=0)return"";try{this.htmlConverter.innerHTML=e,e=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(e.charAt(a)),c<255&&r++;a++}o.length1&&(e=l.mxUtils.trim(o.join(""))+"...")}catch(i){console.warn("Error while computing txt label",i)}return e}}function ht(n,t,e){const s=document.createElement("a");t.startsWith("data:image/svg+xml")&&(e=encodeURIComponent(e),t+=","),s.setAttribute("href",t+e),s.setAttribute("download",n),s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)}function Ut(n){q("Start SVG download"),ht("diagram.svg","data:image/svg+xml",n),q("Download completed")}function Wt(n){q("Start PNG download");const t=new Blob([n],{type:"image/svg+xml;charset=utf-8"}),e=URL.createObjectURL(t),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(e);const a=i.toDataURL("image/png");document.body.removeChild(s),ht("diagram.png","",a),q("Download completed")},r.src=s.src},s.src=e}var re=(n=>(n.None="None",n.HorizontalVertical="HorizontalVertical",n.Horizontal="Horizontal",n.Vertical="Vertical",n.Center="Center",n))(re||{}),Ht=(n=>(n.In="in",n.Out="out",n))(Ht||{}),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.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||{}),le=(n=>(n.Exclusive="Exclusive",n.None="None",n.Parallel="Parallel",n))(le||{}),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||{}),y=(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))(y||{}),ge=(n=>(n.EMBEDDED="embedded",n.EVENT="event",n))(ge||{});function Kt(n,t){return n===""?t?{}:void 0:n}function S(n,t=!1){return n==null?[]:(Array.isArray(n)?n:[n]).map(e=>Kt(e,t)).filter(Boolean)}function Dt(n,t,e){let s="";return e!=null&&e.startingWith?s=s.concat(`^(${e.startingWith}).*`):e!=null&&e.notStartingWith&&(s=s.concat(`^(?!(${e.notStartingWith})).*`)),s=s.concat(`${t}$`),n.filter(i=>e!=null&&e.ignoreCase?new RegExp(s,"i").test(i):new RegExp(s).test(i))}class I{static isEvent(t){return he(Ze,t)}static eventKinds(){return[...Ze]}static isBoundaryEvent(t){return h.EVENT_BOUNDARY===t}static isStartEvent(t){return h.EVENT_START===t}static isCallActivity(t){return h.CALL_ACTIVITY===t}static isSubProcess(t){return h.SUB_PROCESS===t}static canHaveNoneEvent(t){return h.EVENT_INTERMEDIATE_THROW===t||h.EVENT_END===t||h.EVENT_START===t}static isActivity(t){return he(Oe,t)}static activityKinds(){return[...Oe]}static isWithDefaultSequenceFlow(t){return zt.includes(t)}static isTask(t){return he(Le,t)}static taskKinds(){return[...Le]}static gatewayKinds(){return[...je]}static isGateway(t){return he(je,t)}static flowNodeKinds(){return Object.values(h).filter(t=>!I.isPoolOrLane(t))}static isPoolOrLane(t){return t==h.POOL||t==h.LANE}}function ke(n,t){return Dt(Object.values(h),n,t)}function he(n,t){return Object.values(n).map(e=>e).includes(t)}const Ze=ke("Event"),je=ke("Gateway"),Le=ke("Task",{ignoreCase:!0,notStartingWith:"global"}),Oe=[...Le,h.CALL_ACTIVITY,h.SUB_PROCESS],zt=[...Oe,h.GATEWAY_EXCLUSIVE,h.GATEWAY_INCLUSIVE],ft=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||{}),Q=(n=>(n.NONE="none",n.INITIATING="initiating",n.NON_INITIATING="non_initiating",n))(Q||{}),B=(n=>(n.NORMAL="normal",n.DEFAULT="default",n.CONDITIONAL_FROM_ACTIVITY="conditional_from_activity",n.CONDITIONAL_FROM_GATEWAY="conditional_from_gateway",n))(B||{});class E{}T(E,"EDGE","bpmn.edge"),T(E,"EDGE_START_FILL_COLOR","bpmn.edge.startFillColor"),T(E,"EDGE_END_FILL_COLOR","bpmn.edge.endFillColor"),T(E,"EVENT_BASED_GATEWAY_KIND","bpmn.gatewayKind"),T(E,"EVENT_DEFINITION_KIND","bpmn.eventDefinitionKind"),T(E,"GLOBAL_TASK_KIND","bpmn.globalTaskKind"),T(E,"SUB_PROCESS_KIND","bpmn.subProcessKind"),T(E,"IS_INITIATING","bpmn.isInitiating"),T(E,"IS_INSTANTIATING","bpmn.isInstantiating"),T(E,"IS_INTERRUPTING","bpmn.isInterrupting"),T(E,"EXTRA_CSS_CLASSES","bpmn.extra.css.classes"),T(E,"MARKERS","bpmn.markers"),T(E,"MESSAGE_FLOW_ICON","bpmn.messageFlowIcon");class Be{}T(Be,"ARROW_DASH","bpmn.dash");var m=(n=>(n[n.STROKE_WIDTH_THIN=2]="STROKE_WIDTH_THIN",n[n.STROKE_WIDTH_THICK=5]="STROKE_WIDTH_THICK",n[n.SHAPE_ACTIVITY_BOTTOM_MARGIN=7]="SHAPE_ACTIVITY_BOTTOM_MARGIN",n[n.SHAPE_ACTIVITY_TOP_MARGIN=7]="SHAPE_ACTIVITY_TOP_MARGIN",n[n.SHAPE_ACTIVITY_LEFT_MARGIN=7]="SHAPE_ACTIVITY_LEFT_MARGIN",n[n.SHAPE_ACTIVITY_FROM_CENTER_MARGIN=7]="SHAPE_ACTIVITY_FROM_CENTER_MARGIN",n[n.SHAPE_ACTIVITY_MARKER_ICON_MARGIN=5]="SHAPE_ACTIVITY_MARKER_ICON_MARGIN",n[n.SHAPE_ACTIVITY_MARKER_ICON_SIZE=20]="SHAPE_ACTIVITY_MARKER_ICON_SIZE",n[n.POOL_LABEL_SIZE=30]="POOL_LABEL_SIZE",n.POOL_LABEL_FILL_COLOR="none",n[n.LANE_LABEL_SIZE=30]="LANE_LABEL_SIZE",n.LANE_LABEL_FILL_COLOR="none",n[n.TEXT_ANNOTATION_BORDER_LENGTH=10]="TEXT_ANNOTATION_BORDER_LENGTH",n.TEXT_ANNOTATION_FILL_COLOR="none",n.GROUP_FILL_COLOR="none",n.DEFAULT_FILL_COLOR="White",n.DEFAULT_STROKE_COLOR="Black",n.DEFAULT_FONT_FAMILY="Arial, Helvetica, sans-serif",n[n.DEFAULT_FONT_SIZE=11]="DEFAULT_FONT_SIZE",n.DEFAULT_FONT_COLOR="Black",n[n.DEFAULT_MARGIN=0]="DEFAULT_MARGIN",n[n.SHAPE_ARC_SIZE=20]="SHAPE_ARC_SIZE",n.DEFAULT_OVERLAY_FILL_COLOR="White",n[n.DEFAULT_OVERLAY_FILL_OPACITY=100]="DEFAULT_OVERLAY_FILL_OPACITY",n.DEFAULT_OVERLAY_STROKE_COLOR="Black",n[n.DEFAULT_OVERLAY_STROKE_WIDTH=1]="DEFAULT_OVERLAY_STROKE_WIDTH",n[n.DEFAULT_OVERLAY_FONT_SIZE=11]="DEFAULT_OVERLAY_FONT_SIZE",n.DEFAULT_OVERLAY_FONT_COLOR="Black",n.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR="White",n.MESSAGE_FLOW_MARKER_START_FILL_COLOR="White",n.MESSAGE_FLOW_MARKER_END_FILL_COLOR="White",n))(m||{});class x{static getFillColor(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_FILLCOLOR,"White")}static getStrokeColor(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_STROKECOLOR,"Black")}static getStrokeWidth(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_STROKEWIDTH,2)}static getMargin(t){return l.mxUtils.getValue(t,l.mxConstants.STYLE_MARGIN,0)}static getBpmnEventDefinitionKind(t){return l.mxUtils.getValue(t,E.EVENT_DEFINITION_KIND,b.NONE)}static getBpmnSubProcessKind(t){return l.mxUtils.getValue(t,E.SUB_PROCESS_KIND,void 0)}static getBpmnIsInterrupting(t){return l.mxUtils.getValue(t,E.IS_INTERRUPTING,void 0)}static getBpmnMarkers(t){return l.mxUtils.getValue(t,E.MARKERS,void 0)}static getBpmnIsInstantiating(t){return JSON.parse(l.mxUtils.getValue(t,E.IS_INSTANTIATING,!1))}static getBpmnIsInitiating(t){return l.mxUtils.getValue(t,E.IS_INITIATING,void 0)}static getBpmnIsParallelEventBasedGateway(t){return l.mxUtils.getValue(t,E.EVENT_BASED_GATEWAY_KIND,le.Exclusive)==le.Parallel}static getBpmnGlobalTaskKind(t){return l.mxUtils.getValue(t,E.GLOBAL_TASK_KIND,void 0)}}class ce{constructor(t){T(this,"specificFlowStyles",new Ie([[k.SEQUENCE_FLOW,t=>{t[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_BLOCK_THIN}],[k.MESSAGE_FLOW,t=>{t[l.mxConstants.STYLE_DASHED]=!0,t[l.mxConstants.STYLE_DASH_PATTERN]="8 5",t[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_OVAL,t[l.mxConstants.STYLE_STARTSIZE]=8,t[l.mxConstants.STYLE_STARTFILL]=!0,t[E.EDGE_START_FILL_COLOR]=m.MESSAGE_FLOW_MARKER_START_FILL_COLOR,t[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_BLOCK_THIN,t[l.mxConstants.STYLE_ENDFILL]=!0,t[E.EDGE_END_FILL_COLOR]=m.MESSAGE_FLOW_MARKER_END_FILL_COLOR}],[k.ASSOCIATION_FLOW,t=>{t[l.mxConstants.STYLE_DASHED]=!0,t[l.mxConstants.STYLE_DASH_PATTERN]="1 2",t[l.mxConstants.STYLE_ENDARROW]=l.mxConstants.ARROW_OPEN_THIN,t[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_OPEN_THIN,t[l.mxConstants.STYLE_STARTSIZE]=12}]]));T(this,"specificSequenceFlowStyles",new Ie([[B.DEFAULT,t=>{t[l.mxConstants.STYLE_STARTARROW]=Be.ARROW_DASH}],[B.CONDITIONAL_FROM_ACTIVITY,t=>{t[l.mxConstants.STYLE_STARTARROW]=l.mxConstants.ARROW_DIAMOND_THIN,t[l.mxConstants.STYLE_STARTSIZE]=18,t[l.mxConstants.STYLE_STARTFILL]=!0,t[E.EDGE_START_FILL_COLOR]=m.SEQUENCE_FLOW_CONDITIONAL_FROM_ACTIVITY_MARKER_FILL_COLOR}]]));T(this,"specificAssociationFlowStyles",new Ie([[j.NONE,t=>{t[l.mxConstants.STYLE_STARTARROW]=void 0,t[l.mxConstants.STYLE_ENDARROW]=void 0}],[j.ONE,t=>{t[l.mxConstants.STYLE_STARTARROW]=void 0}],[j.BOTH,t=>{}]]));this.graph=t}configureStyles(){this.configureDefaultVertexStyle(),this.configurePoolStyle(),this.configureLaneStyle(),this.configureTextAnnotationStyle(),this.configureGroupStyle(),this.configureActivityStyles(),this.configureEventStyles(),this.configureGatewayStyles(),this.configureDefaultEdgeStyle(),this.configureFlowStyles()}getStylesheet(){return this.graph.getStylesheet()}putCellStyle(t,e){this.getStylesheet().putCellStyle(t,e)}configureDefaultVertexStyle(){ce.configureCommonDefaultStyle(this.getStylesheet().getDefaultVertexStyle())}configurePoolStyle(){const t={};t[l.mxConstants.STYLE_SHAPE]=l.mxConstants.SHAPE_SWIMLANE,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,t[l.mxConstants.STYLE_STARTSIZE]=m.POOL_LABEL_SIZE,t[l.mxConstants.STYLE_FILLCOLOR]=m.POOL_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.POOL,t)}configureLaneStyle(){const t={};t[l.mxConstants.STYLE_SHAPE]=l.mxConstants.SHAPE_SWIMLANE,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,t[l.mxConstants.STYLE_SWIMLANE_LINE]=0,t[l.mxConstants.STYLE_STARTSIZE]=m.LANE_LABEL_SIZE,t[l.mxConstants.STYLE_FILLCOLOR]=m.LANE_LABEL_FILL_COLOR,this.graph.getStylesheet().putCellStyle(h.LANE,t)}configureEventStyles(){I.eventKinds().forEach(t=>{const e={};e[l.mxConstants.STYLE_SHAPE]=t,e[l.mxConstants.STYLE_PERIMETER]=l.mxPerimeter.EllipsePerimeter,e[l.mxConstants.STYLE_STROKEWIDTH]=t==h.EVENT_END?m.STROKE_WIDTH_THICK:m.STROKE_WIDTH_THIN,e[l.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=l.mxConstants.ALIGN_BOTTOM,this.putCellStyle(t,e)})}configureTextAnnotationStyle(){const t={};t[l.mxConstants.STYLE_SHAPE]=h.TEXT_ANNOTATION,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_LEFT,t[l.mxConstants.STYLE_SPACING_LEFT]=5,t[l.mxConstants.STYLE_FILLCOLOR]=m.TEXT_ANNOTATION_FILL_COLOR,t[l.mxConstants.STYLE_STROKEWIDTH]=m.STROKE_WIDTH_THIN,this.putCellStyle(h.TEXT_ANNOTATION,t)}configureGroupStyle(){const t={};t[l.mxConstants.STYLE_ROUNDED]=!0,t[l.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,t[l.mxConstants.STYLE_ARCSIZE]=m.SHAPE_ARC_SIZE,t[l.mxConstants.STYLE_DASHED]=!0,t[l.mxConstants.STYLE_DASH_PATTERN]="7 4 1 4",t[l.mxConstants.STYLE_STROKEWIDTH]=m.STROKE_WIDTH_THIN,t[l.mxConstants.STYLE_FILLCOLOR]=m.GROUP_FILL_COLOR,t[l.mxConstants.STYLE_ALIGN]=l.mxConstants.ALIGN_CENTER,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_TOP,this.putCellStyle(h.GROUP,t)}configureActivityStyles(){I.activityKinds().forEach(t=>{const e={};e[l.mxConstants.STYLE_SHAPE]=t,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_MIDDLE,e[l.mxConstants.STYLE_ABSOLUTE_ARCSIZE]=!0,e[l.mxConstants.STYLE_ARCSIZE]=m.SHAPE_ARC_SIZE,e[l.mxConstants.STYLE_STROKEWIDTH]=t==h.CALL_ACTIVITY?m.STROKE_WIDTH_THICK:m.STROKE_WIDTH_THIN,this.putCellStyle(t,e)})}configureGatewayStyles(){I.gatewayKinds().forEach(t=>{const e={};e[l.mxConstants.STYLE_SHAPE]=t,e[l.mxConstants.STYLE_PERIMETER]=l.mxPerimeter.RhombusPerimeter,e[l.mxConstants.STYLE_STROKEWIDTH]=m.STROKE_WIDTH_THIN,e[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_TOP,e[l.mxConstants.STYLE_LABEL_POSITION]=l.mxConstants.ALIGN_LEFT,e[l.mxConstants.STYLE_VERTICAL_LABEL_POSITION]=l.mxConstants.ALIGN_TOP,this.putCellStyle(t,e)})}configureDefaultEdgeStyle(){const t=this.getStylesheet().getDefaultEdgeStyle();t[l.mxConstants.STYLE_SHAPE]=E.EDGE,t[l.mxConstants.STYLE_ENDSIZE]=12,t[l.mxConstants.STYLE_STROKEWIDTH]=1.5,t[l.mxConstants.STYLE_ROUNDED]=1,t[l.mxConstants.STYLE_ARCSIZE]=5,t[l.mxConstants.STYLE_VERTICAL_ALIGN]=l.mxConstants.ALIGN_BOTTOM,delete t[l.mxConstants.STYLE_ENDARROW],ce.configureCommonDefaultStyle(t)}static configureCommonDefaultStyle(t){t[l.mxConstants.STYLE_FONTFAMILY]=m.DEFAULT_FONT_FAMILY,t[l.mxConstants.STYLE_FONTSIZE]=m.DEFAULT_FONT_SIZE,t[l.mxConstants.STYLE_FONTCOLOR]=m.DEFAULT_FONT_COLOR,t[l.mxConstants.STYLE_FILLCOLOR]=m.DEFAULT_FILL_COLOR,t[l.mxConstants.STYLE_STROKECOLOR]=m.DEFAULT_STROKE_COLOR,t[l.mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=l.mxConstants.NONE,t[l.mxConstants.STYLE_WHITE_SPACE]="wrap"}configureEdgeStyles(t,e){t.forEach(s=>{const i={};e.get(s)(i),this.graph.getStylesheet().putCellStyle(s.toString(),i)})}configureFlowStyles(){this.configureEdgeStyles(Object.values(k),this.specificFlowStyles),this.configureEdgeStyles(Object.values(B),this.specificSequenceFlowStyles),this.configureEdgeStyles(Object.values(j),this.specificAssociationFlowStyles)}}class Ie extends Map{get(t){var e;return(e=super.get(t))!=null?e:()=>{}}}function $t(n,t,e,s){let i,o;n.heightg.setIconOriginForIconCentered(),shapeConfig:{x:t,y:e,width:s,height:i,strokeWidth:u},iconStyleConfig:{isFilled:a,fillColor:f,strokeColor:d,strokeWidth:c,margin:p}}}class D{paintEmptyIcon(){}newBpmnCanvas({canvas:t,ratioFromParent:e,setIconOriginFunct:s,shapeConfig:i,iconStyleConfig:o},r){return new Xt({canvas:t,shapeConfig:i,iconConfig:{originalSize:r,styleConfig:o,ratioFromParent:e,setIconOriginFunct:s}})}paintEnvelopeIcon(t){const e={width:485.41,height:321.76},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;s.rect(0,0,i,o),s.fillAndStroke();const{iconStyleConfig:r}=t;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(t){const e={width:t.shapeConfig.width,height:t.shapeConfig.height},s=this.newBpmnCanvas(t,e),i=e.width,o=e.height;i>0&&o>0&&s.ellipse(0,0,i,o),t.iconStyleConfig.isFilled?s.fillAndStroke():s.stroke()}paintClockIcon(t){const e=this.newBpmnCanvas(t,{height:152,width:152});e.begin(),e.moveTo(184,60),e.curveTo(188.4,60,192,56.4,192,52),e.lineTo(192,48),e.curveTo(192,40,188.4,40,184,40),e.curveTo(179.6,40,176,43.6,176,48),e.lineTo(176,52),e.curveTo(176,56.4,179.6,60,184,60),e.close(),e.moveTo(184,308),e.curveTo(179.6,308,176,311.6,176,316),e.lineTo(176,320),e.curveTo(176,324.4,179.6,328,184,328),e.curveTo(188.4,328,192,324.4,192,320),e.lineTo(192,316),e.curveTo(192,311.6,188.4,308,184,308),e.close(),e.moveTo(52,176),e.lineTo(48,176),e.curveTo(43.6,176,40,179.6,40,184),e.curveTo(40,188.4,43.6,192,48,192),e.lineTo(52,192),e.curveTo(56.4,192,69,188.4,60,184),e.curveTo(60,179.6,56.4,176,52,176),e.close(),e.moveTo(320,176),e.lineTo(316,176),e.curveTo(311.6,176,308,179.6,308,184),e.curveTo(308,188.4,311.6,192,316,192),e.lineTo(320,192),e.curveTo(324.4,192,328,188.4,328,184),e.curveTo(328,179.6,324.4,176,320,176),e.moveTo(93.6,82.4),e.curveTo(90.4,79.2,85.6,79.2,82.4,82.4),e.curveTo(79.2,85.6,79.2,90.4,82.4,93.6),e.lineTo(85.2,96.4),e.curveTo(86.8,98,88.8,98.8,90.8,98.8),e.curveTo(92.8,98.8,94.4,98,96.4,96.4),e.curveTo(99.6,93.2,99.6,88.4,96.4,85.2),e.lineTo(93.6,82.4),e.moveTo(85.2,271.6),e.lineTo(82.4,274.4),e.curveTo(79.2,277.6,79.2,282.4,82.4,285.6),e.curveTo(84,287.2,86,288,88,288),e.curveTo(90,288,92,287.2,93.6,285.6),e.lineTo(96.4,282.8),e.curveTo(99.6,279.6,99.6,274.8,96.4,271.6),e.curveTo(93.2,268.4,88.4,268.4,85.2,271.6),e.moveTo(274.4,82.4),e.lineTo(271.6,85.2),e.curveTo(268.4,88.4,268.4,93.2,271.6,96.4),e.curveTo(273.298,98,275.2,98.8,277.2,98.8),e.curveTo(279.2,98.8,281.2,98,282.8,96.4),e.lineTo(285.6,93.6),e.curveTo(288.8,90.4,288.8,85.6,285.6,82.4),e.curveTo(282.4,79.2,277.6,79.2,274.4,82.4),e.moveTo(192,180.8),e.lineTo(192,108),e.curveTo(192,103.6,188.4,100,184,100),e.curveTo(179.6,100,176,103.6,176,108),e.lineTo(176,184),e.curveTo(176,186,176.8,188,178.4,189.6),e.lineTo(266,277.2),e.curveTo(267.6,278.8,269.6,279.6,271.6,279.6),e.curveTo(273.6,279.6,275.6,278.8,277.2,277.2),e.curveTo(280.4,274,280.4,269.2,277.2,266),e.lineTo(192,180.8),e.moveTo(184,0),e.curveTo(82.4,0,0,82.4,0,184),e.curveTo(0,285.6,82.4,368,184,368),e.curveTo(285.6,368,368,285.6,368,184),e.curveTo(368,82.4,285.6,0,184,0),e.moveTo(184,352),e.curveTo(91.2,352,16,276.8,16,184),e.curveTo(16,91.2,91.2,16,184,16),e.curveTo(276.8,16,352,91.2,352,184),e.curveTo(352,276.8,276.8,352,184,352),e.fillAndStroke()}paintTriangleIcon(t){const e=this.newBpmnCanvas(t,{height:735,width:849});e.begin(),e.moveTo(497,55),e.lineTo(817,609),e.curveTo(849,665,808,735,744,735),e.lineTo(105,735),e.curveTo(40,735,0,665,32,609),e.lineTo(352,55),e.curveTo(384,0,465,0,497,55),e.close(),e.fillAndStroke()}paintUpArrowheadIcon(t){const e=this.newBpmnCanvas(t,{height:50,width:40});e.begin(),e.moveTo(0,49.5),e.lineTo(19.5,1),e.curveTo(19.75,.25,20,0,20.25,.25),e.lineTo(40,49.5),e.curveTo(40,49.5,39.75,50,39.6,49.75),e.lineTo(20,30),e.lineTo(.4,49.75),e.curveTo(.4,49.75,.25,50,0,49.5),e.close(),e.fillAndStroke()}paintDoubleLeftArrowheadsIcon(t){const e=this.newBpmnCanvas(t,{height:53.5,width:105});e.begin(),e.moveTo(91.4,0),e.curveTo(91.4,0,91.2,0,91,.2),e.lineTo(50,25),e.curveTo(47.9,25.8,46.7,26.6,46.4,27.3),e.lineTo(46.4,0),e.curveTo(46.4,0,46.2,0,46,.2),e.lineTo(4.9,25),e.curveTo(2,26.2,0,27.3,4.9,28.5),e.lineTo(45.8,53),e.curveTo(46,53.3,46.2,53.5,46.4,53.5),e.lineTo(46.4,27),e.curveTo(46.6,27.3,47.8,28.1,49.9,29.9),e.lineTo(90.8,53.3),e.curveTo(91,53.3,91.2,53.5,91.4,53.5),e.lineTo(91.4,0),e.close(),e.fillAndStroke()}drawCrossIcon(t){const e=this.newBpmnCanvas(t,{height:1,width:1});return e.begin(),e.moveTo(.38,0),e.lineTo(.62,0),e.lineTo(.62,.38),e.lineTo(1,.38),e.lineTo(1,.62),e.lineTo(.62,.62),e.lineTo(.62,1),e.lineTo(.38,1),e.lineTo(.38,.62),e.lineTo(0,.62),e.lineTo(0,.38),e.lineTo(.38,.38),e.close(),e}paintListIcon(t){const e=this.newBpmnCanvas(t,{height:60,width:60});e.begin(),e.moveTo(0,0),e.lineTo(60,0),e.lineTo(60,60),e.lineTo(0,60),e.lineTo(0,0),e.close(),e.moveTo(5,5),e.lineTo(55,5),e.close(),e.moveTo(5,21.6),e.lineTo(55,21.6),e.close(),e.moveTo(5,38.3),e.lineTo(55,38.3),e.close(),e.moveTo(5,55),e.lineTo(55,55),e.close(),e.fillAndStroke()}paintXCrossIcon(t){const e=this.drawCrossIcon(t);e.rotateOnIconCenter(45),e.fillAndStroke()}paintPlusCrossIcon(t){this.drawCrossIcon(t).fillAndStroke()}paintPersonIcon(t){const e=this.newBpmnCanvas({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0}},{height:239.68,width:143.61});e.begin(),e.moveTo(124.31,150.29),e.lineTo(99.66,141.03),e.arcTo(6.43,6.43,0,0,1,95.51,135.03),e.lineTo(95.51,130.66),e.arcTo(47.75,47.75,0,0,0,119.51,89.25),e.lineTo(119.51,71.25),e.arcTo(47.62,47.62,0,0,0,101.18,33.64),e.arcTo(29.35,29.35,0,0,0,101.52,29.14),e.arcTo(29.68,29.68,0,0,0,42.17,29.14),e.arcTo(29.24,29.24,0,0,0,42.53,33.63),e.arcTo(47.65,47.65,0,0,0,24.14,71.23),e.lineTo(24.14,89.23),e.arcTo(47.7,47.7,0,0,0,48.19,130.63),e.lineTo(48.19,135.03),e.arcTo(6.43,6.43,0,0,1,44.03,141.03),e.lineTo(19.31,150.29),e.arcTo(29.81,29.81,0,0,0,.09,178.03),e.lineTo(.09,233.51),e.arcTo(5.63,5.63,0,1,0,11.34,233.51),e.lineTo(11.34,178.03),e.arcTo(18.19,18.19,0,0,1,11.57,175.17),e.lineTo(20.5,184.11),e.arcTo(12.32,12.32,0,0,1,24.14,192.89),e.lineTo(24.14,233.51),e.arcTo(5.63,5.63,0,1,0,35.39,233.51),e.lineTo(35.39,192.93),e.arcTo(23.5,23.5,0,0,0,28.46,176.2),e.lineTo(17.04,164.78),e.arcTo(18.34,18.34,0,0,1,23.29,160.78),e.lineTo(43.65,153.15),e.lineTo(66.22,175.72),e.lineTo(66.22,233.51),e.arcTo(5.63,5.63,0,1,0,77.47,233.51),e.lineTo(77.47,175.76),e.lineTo(100.04,153.19),e.lineTo(120.4,160.82),e.arcTo(18.39,18.39,0,0,1,126.65,164.82),e.lineTo(115.24,176.24),e.arcTo(23.5,23.5,0,0,0,108.31,192.93),e.lineTo(108.31,233.55),e.arcTo(5.63,5.63,0,1,0,119.56,233.55),e.lineTo(119.56,192.93),e.arcTo(12.35,12.35,0,0,1,123.19,184.15),e.lineTo(132.13,175.22),e.arcTo(18,18,0,0,1,132.36,178.08),e.lineTo(132.36,233.56),e.arcTo(5.63,5.63,0,0,0,143.61,233.56),e.lineTo(143.61,178.03),e.arcTo(29.81,29.81,0,0,0,124.31,150.29),e.close(),e.moveTo(71.85,10.72),e.arcTo(18.46,18.46,0,0,1,90.17,27.18),e.arcTo(47.68,47.68,0,0,0,53.53,27.18),e.arcTo(18.44,18.44,0,0,1,71.85,10.72),e.close(),e.moveTo(35.39,71.23),e.arcTo(36.46,36.46,0,0,1,108.31,71.23),e.lineTo(108.31,77.4),e.curveTo(82.12,75.4,56.97,60.55,56.71,60.4),e.arcTo(5.62,5.62,0,0,0,48.78,62.71),e.curveTo(46.24,67.79,40.45,71.89,35.39,74.62),e.close(),e.moveTo(35.39,89.23),e.lineTo(35.39,87.08),e.curveTo(40.55,84.85,49.73,80.08,55.67,72.66),e.curveTo(64.83,77.46,85.92,87.21,108.31,88.66),e.lineTo(108.31,89.24),e.arcTo(36.46,36.46,0,1,1,35.39,89.24),e.close(),e.moveTo(71.85,165.45),e.lineTo(54.06,147.69),e.arcTo(17.7,17.7,0,0,0,59.43,135.32),e.arcTo(47.57,47.57,0,0,0,84.27,135.32),e.arcTo(17.7,17.7,0,0,0,89.64,147.69),e.close(),e.fill()}paintGearIcon(t){const e=this.newBpmnCanvas(t,{height:100,width:100});D.paintGearIconBackground(e),e.translateIconOrigin(14,14),D.paintGearIconForeground(e)}static paintGearIconBackground(t){t.begin(),t.moveTo(2.06,24.62),t.lineTo(10.17,30.95),t.lineTo(9.29,37.73),t.lineTo(0,41.42),t.lineTo(2.95,54.24),t.lineTo(13.41,52.92),t.lineTo(17.39,58.52),t.lineTo(13.56,67.66),t.lineTo(24.47,74.44),t.lineTo(30.81,66.33),t.lineTo(37.88,67.21),t.lineTo(41.57,76.5),t.lineTo(54.24,73.55),t.lineTo(53.06,62.94),t.lineTo(58.52,58.52),t.lineTo(67.21,63.09),t.lineTo(74.58,51.88),t.lineTo(66.03,45.25),t.lineTo(66.92,38.62),t.lineTo(76.5,34.93),t.lineTo(73.7,22.26),t.lineTo(62.64,23.44),t.lineTo(58.81,18.42),t.lineTo(62.79,8.7),t.lineTo(51.74,2.21),t.lineTo(44.81,10.47),t.lineTo(38.03,9.43),t.lineTo(33.75,0),t.lineTo(21.52,3.24),t.lineTo(22.7,13.56),t.lineTo(18.13,17.54),t.lineTo(8.7,13.56),t.close();const e=24.8,s=39;D.paintGearInnerCircle(t,e,s)}static paintGearIconForeground(t){t.begin(),t.moveTo(16.46,41.42),t.lineTo(24.57,47.75),t.lineTo(23.69,54.53),t.lineTo(14.4,58.22),t.lineTo(17.35,71.04),t.lineTo(27.81,69.72),t.lineTo(31.79,75.32),t.lineTo(27.96,84.46),t.lineTo(38.87,91.24),t.lineTo(45.21,83.13),t.lineTo(52.28,84.01),t.lineTo(55.97,93.3),t.lineTo(68.64,90.35),t.lineTo(67.46,79.74),t.lineTo(72.92,75.32),t.lineTo(81.61,79.89),t.lineTo(88.98,68.68),t.lineTo(80.43,62.05),t.lineTo(81.32,55.42),t.lineTo(90.9,51.73),t.lineTo(88.1,39.06),t.lineTo(77.04,40.24),t.lineTo(73.21,35.22),t.lineTo(77.19,25.5),t.lineTo(66.14,19.01),t.lineTo(59.21,27.27),t.lineTo(52.43,26.23),t.lineTo(48.15,16.8),t.lineTo(35.92,20.04),t.lineTo(37.1,30.36),t.lineTo(32.53,34.34),t.lineTo(23.1,30.36),t.close();const e=39.2,s=55.8;D.paintGearInnerCircle(t,e,s),t.begin(),D.paintGearInnerCircle(t,e,s)}static paintGearInnerCircle(t,e,s){t.moveTo(e,s),t.arcTo(13.5,13.5,0,1,1,e+2*13.5,s),t.arcTo(13.5,13.5,0,0,1,e,s),t.close(),t.fillAndStroke()}paintExpandIcon(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),i=e.width,o=e.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(t){const{iconStyleConfig:e}=t;e.fillColor=e.strokeColor;const s=this.newBpmnCanvas(t,{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(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const r=e.width,a=e.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(t){const e={width:16,height:16},s=this.newBpmnCanvas(t,e),{canvas:i,iconStyleConfig:o}=t;i.setFillColor(o.strokeColor);const r=e.width/5,a=e.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(t){const e=this.newBpmnCanvas(t,{width:512,height:415.23});e.setRoundLineJoin(),e.begin(),e.moveTo(512,207.61),e.lineTo(304.38,0),e.lineTo(304.38,135.39),e.lineTo(0,135.39),e.lineTo(0,279.84),e.lineTo(304.38,279.84),e.lineTo(304.38,415.23),e.lineTo(512,207.61),e.close(),e.fillAndStroke()}paintErrorIcon(t){const e=this.newBpmnCanvas(t,{width:72.44,height:71.82});e.begin(),e.moveTo(0,53.32),e.lineTo(19.48,0),e.lineTo(19.48,0),e.lineTo(50.85,40.07),e.lineTo(72.44,18.21),e.lineTo(53.12,71.82),e.lineTo(22.5,31.37),e.close(),e.fillAndStroke()}paintHandIcon(t){const e=this.newBpmnCanvas(t,{width:343.65,height:354.12});e.begin(),e.moveTo(231.66,336.39),e.curveTo(240.84,316.9,220.53,306.92,220.53,306.92),e.curveTo(215.2,303.67,188.58,287.43,140.67,258.19),e.lineTo(146.33,248.39),e.curveTo(223.98,269.38,267.12,281.04,275.75,283.38),e.curveTo(275.75,283.38,297.25,288,301.42,267.77),e.curveTo(306.34,245.29,288.32,238.63,288.32,238.63),e.curveTo(279.91,236.44,237.86,225.48,162.18,205.75),e.lineTo(165.2,194.8),e.curveTo(255.88,204.4,306.27,209.73,316.34,210.8),e.curveTo(316.34,210.8,339.89,212.16,341.76,189.55),e.curveTo(343.65,166.93,320.5,164.13,320.5,164.13),e.curveTo(310.43,163.1,260.04,157.99,169.35,148.77),e.lineTo(169.35,138.97),e.curveTo(253.41,132.12,300.11,128.32,309.45,127.56),e.curveTo(309.45,127.56,332.27,122.38,332.27,102.61),e.curveTo(332.27,82.85,305.48,81.87,305.48,81.87),e.curveTo(293.99,82.2,236.54,83.88,133.13,86.9),e.lineTo(127.61,81.87),e.curveTo(145.3,59.39,155.12,46.9,157.09,44.41),e.curveTo(157.09,44.41,171.12,26.8,156.78,12.72),e.curveTo(143.83,0,124.08,14.49,124.08,14.49),e.curveTo(116.45,19.41,78.35,44.06,9.77,88.43),e.lineTo(0,251.94),e.curveTo(122.84,308.79,191.09,340.37,204.74,346.69),e.curveTo(204.74,346.69,222.91,354.12,231.66,336.39),e.fillAndStroke()}paintScriptIcon(t){t.iconStyleConfig.fillColor=t.iconStyleConfig.strokeColor;const e=this.newBpmnCanvas(t,{width:458.75,height:461.64});e.begin(),e.moveTo(67.85,.57),e.curveTo(50.73,0,33.26,8.86,22.35,18.84),e.curveTo(8.11,32.15,0,50.77,0,70.26),e.curveTo(0,73.15,0,87.59,0,113.6),e.curveTo(55.4,113.6,86.18,113.6,92.33,113.6),e.curveTo(94.92,150.46,85.64,180.4,74.22,211.27),e.curveTo(40.16,298.07,30.77,339.83,55.56,410.87),e.curveTo(63.72,438.26,87.59,457.85,114.91,461.09),e.curveTo(216.96,460.85,294.9,461.64,388.41,461.2),e.curveTo(407.2,461.09,425.14,453.55,438.3,440.13),e.curveTo(451.46,426.71,458.75,403.06,458.46,384.26),e.curveTo(458.43,382.23,458.18,365.93,458.15,363.89),e.curveTo(432.12,364.24,406.09,364.04,380.06,364.04),e.curveTo(377.61,347.52,377.24,337.58,378.28,324.48),e.curveTo(380.5,296.47,389.08,273.36,398.59,247.1),e.curveTo(408.11,220.83,418.41,191.47,420.86,154.24),e.curveTo(422.11,135.34,421.4,110.24,417.77,86.75),e.curveTo(417.76,86.71,417.73,86.54,417.69,86.22),e.curveTo(417.64,85.95,417.61,85.79,417.6,85.76),e.curveTo(414.03,68.13,410.49,48.84,399.79,31.47),e.curveTo(389.09,14.11,366.95,.59,341.75,.59),e.curveTo(286.97,.59,122.63,.57,67.85,.57),e.close(),e.moveTo(85.04,72.68),e.curveTo(80.63,72.68,45.33,72.68,40.92,72.68),e.curveTo(40.46,58.4,47.15,51.87,50.27,48.75),e.curveTo(55.8,44.28,59.84,41,73.82,41),e.curveTo(78.45,52.13,82.23,62.71,85.04,72.68),e.close(),e.moveTo(364.94,52.9),e.curveTo(370,61.11,373.9,76.44,377.38,93.51),e.curveTo(380.35,113.1,381.01,136.42,380.02,151.57),e.curveTo(377.97,182.76,369.51,207.12,360.1,233.1),e.curveTo(350.69,259.09,340.27,286.77,337.53,321.27),e.curveTo(336.38,335.86,336.72,346.69,338.87,364.01),e.curveTo(326.35,364.01,263.75,364.01,151.06,364.01),e.curveTo(151.06,382.2,151.06,392.31,151.06,394.33),e.curveTo(147.77,404.8,138.9,418.2,127.43,419.94),e.curveTo(111.49,422.35,97.86,411.8,94.75,399.19),e.curveTo(65.14,321.99,94.93,275.54,112.57,225.47),e.curveTo(130.14,177.95,137.92,117.41,112.71,42.09),e.curveTo(192.88,41.9,274.33,42.21,342.89,41.98),e.curveTo(357.15,42.03,359.83,44.61,364.94,52.9),e.close(),e.moveTo(409.96,399.48),e.curveTo(409.96,408.42,398.54,425.67,392.02,425.67),e.curveTo(325.19,425.79,252.29,425.67,185.23,425.67),e.curveTo(189.88,424.43,194.66,405.64,194.66,399.48),e.curveTo(237.72,399.48,388.43,399.48,409.96,399.48),e.close(),e.fill(),e.begin(),e.moveTo(182.1,131.2),e.lineTo(182.1,151.68),e.lineTo(321.89,151.68),e.lineTo(321.89,131.2),e.lineTo(182.1,131.2),e.close(),e.moveTo(162.25,251.09),e.lineTo(162.25,271.49),e.lineTo(301.96,271.49),e.lineTo(301.96,251.09),e.lineTo(162.25,251.09),e.close(),e.fill()}paintTableIcon(t){const e=this.newBpmnCanvas(t,{width:640,height:640});e.begin(),e.moveTo(.19,.1),e.lineTo(298.78,.1),e.lineTo(298.78,198.88),e.lineTo(.19,198.88),e.lineTo(.19,.1),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(0,48.88),e.lineTo(98.78,48.88),e.lineTo(98.78,198.88),e.lineTo(0,198.88),e.lineTo(0,48.88),e.close(),e.fillAndStroke(),e.begin(),e.moveTo(1.09,122.69),e.lineTo(298.78,122.69),e.close(),e.fillAndStroke(),e.setFillColor(t.iconStyleConfig.strokeColor),e.begin(),e.moveTo(0,0),e.lineTo(298.78,0),e.lineTo(298.78,48.88),e.lineTo(0,48.88),e.lineTo(0,0),e.close(),e.fillAndStroke()}paintPentagon(t){const e=this.newBpmnCanvas(t,{width:16,height:16});e.begin(),e.moveTo(16,6.5),e.lineTo(8,0),e.lineTo(0,6.5),e.lineTo(3,16),e.lineTo(13,16),e.lineTo(16,6.5),e.lineTo(8,0),e.stroke()}}class te{static get(){return this.instance}static set(t){this.instance=t}}T(te,"instance",new D);class J extends l.mxEllipse{constructor(){super(void 0,void 0,void 0);T(this,"iconPainter",te.get());T(this,"iconPainters",new Map([[b.MESSAGE,e=>this.iconPainter.paintEnvelopeIcon({...e,ratioFromParent:.5})],[b.TERMINATE,e=>this.iconPainter.paintCircleIcon({...e,ratioFromParent:.6})],[b.TIMER,e=>this.iconPainter.paintClockIcon({...e,setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(5)})],[b.SIGNAL,e=>this.iconPainter.paintTriangleIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:m.STROKE_WIDTH_THIN.valueOf()},setIconOriginFunct:s=>s.setIconOriginToShapeTopLeftProportionally(4)})],[b.LINK,e=>this.iconPainter.paintRightArrowIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[b.ERROR,e=>this.iconPainter.paintErrorIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[b.COMPENSATION,e=>this.iconPainter.paintDoubleLeftArrowheadsIcon({...e,ratioFromParent:.7,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})],[b.CANCEL,e=>this.iconPainter.paintXCrossIcon({...e,ratioFromParent:.78})],[b.ESCALATION,e=>this.iconPainter.paintUpArrowheadIcon({...e,ratioFromParent:.55,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:m.STROKE_WIDTH_THIN.valueOf()}})],[b.CONDITIONAL,e=>this.iconPainter.paintListIcon({...e,ratioFromParent:.6,iconStyleConfig:{...e.iconStyleConfig,strokeWidth:1.5}})]]));T(this,"withFilledIcon",!1)}paintVertexShape(e,s,i,o,r){const a=ee({canvas:e,x:s,y:i,width:o,height:r,shape:this,isFilled:this.withFilledIcon});J.setDashedOuterShapePattern(a,x.getBpmnIsInterrupting(this.style)),this.paintOuterShape(a),J.restoreOriginalOuterShapePattern(a),this.paintInnerShape(a)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(e,s,i,o,r)}paintInnerShape(e){(this.iconPainters.get(x.getBpmnEventDefinitionKind(this.style))||(()=>this.iconPainter.paintEmptyIcon()))(e)}static setDashedOuterShapePattern(e,s){e.canvas.save(),s==="false"&&(e.canvas.setDashed(!0,!1),e.canvas.setDashPattern("3 2"))}static restoreOriginalOuterShapePattern(e){e.canvas.restore()}}class Zt extends J{constructor(){super(),this.withFilledIcon=!0}}class _e extends J{paintOuterShape({canvas:t,shapeConfig:{x:e,y:s,width:i,height:o,strokeWidth:r}}){t.ellipse(e,s,i,o),t.fillAndStroke();const a=r*1.5;t.ellipse(i*.02+a+e,o*.02+a+s,i*.96-2*a,o*.96-2*a),t.stroke()}}class jt extends _e{constructor(){super(),this.withFilledIcon=!0}}class me extends l.mxRhombus{constructor(){super(...arguments);T(this,"iconPainter",te.get())}paintVertexShape(e,s,i,o,r){const a=ee({canvas:e,x:s,y:i,width:o,height:r,shape:this});this.paintOuterShape(a),this.paintInnerShape(a)}paintOuterShape({canvas:e,shapeConfig:{x:s,y:i,width:o,height:r}}){super.paintVertexShape(e,s,i,o,r)}}class qt extends me{paintInnerShape(t){this.iconPainter.paintXCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Jt extends me{paintInnerShape(t){this.iconPainter.paintPlusCrossIcon({...t,iconStyleConfig:{...t.iconStyleConfig,isFilled:!0},ratioFromParent:.5})}}class Qt extends me{paintInnerShape(t){this.iconPainter.paintCircleIcon({...t,ratioFromParent:.62,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1,strokeWidth:m.STROKE_WIDTH_THICK.valueOf()}})}}class en extends me{paintInnerShape(t){t={...t,iconStyleConfig:{...t.iconStyleConfig,strokeWidth:1}},this.iconPainter.paintCircleIcon({...t,ratioFromParent:.55}),x.getBpmnIsInstantiating(this.style)||this.iconPainter.paintCircleIcon({...t,ratioFromParent:.45});const e={...t,ratioFromParent:.3};x.getBpmnIsParallelEventBasedGateway(this.style)?this.iconPainter.paintPlusCrossIcon(e):this.iconPainter.paintPentagon(e)}}const tn=[y.LOOP,y.MULTI_INSTANCE_PARALLEL,y.MULTI_INSTANCE_SEQUENTIAL,y.COMPENSATION,y.EXPAND,y.ADHOC];function nn(n){const t=tn.filter(e=>n.includes(e));return n.filter(e=>!t.includes(e)).forEach(e=>t.push(e)),t}function gt(n,t){te.get().paintEnvelopeIcon({...n,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeft(),ratioFromParent:.2,iconStyleConfig:{...n.iconStyleConfig,isFilled:t}})}class Ge extends l.mxRectangleShape{constructor(){super(void 0,void 0,void 0);T(this,"iconPainter",te.get());this.isRounded=!0}paintForeground(e,s,i,o,r){super.paintForeground(e,s,i,o,r),this.paintMarkerIcons(ee({canvas:e,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:0,iconStrokeWidth:1.5}))}paintMarkerIcons(e){const s=x.getBpmnMarkers(this.style);s&&nn(s.split(",")).forEach((i,o,r)=>{switch(e={...e,setIconOriginFunct:this.getMarkerIconOriginFunction(r.length,o+1)},e.canvas.save(),i){case y.LOOP:this.iconPainter.paintLoopIcon(e);break;case y.MULTI_INSTANCE_SEQUENTIAL:this.iconPainter.paintSequentialMultiInstanceIcon(e);break;case y.MULTI_INSTANCE_PARALLEL:this.iconPainter.paintParallelMultiInstanceIcon(e);break;case y.EXPAND:this.iconPainter.paintExpandIcon(e);break}e.canvas.restore()})}getMarkerIconOriginFunction(e,s){let i;return e===1?i=o=>o.setIconOriginForIconBottomCentered():i=o=>{o.setIconOriginForIconBottomCentered();const r=Math.pow(-1,s)*(m.SHAPE_ACTIVITY_MARKER_ICON_SIZE/2+m.SHAPE_ACTIVITY_MARKER_ICON_MARGIN);o.translateIconOrigin(r,0)},i}}class H extends Ge{paintForeground(t,e,s,i,o){super.paintForeground(t,e,s,i,o),this.paintTaskIcon(ee({canvas:t,x:e,y:s,width:i,height:o,shape:this}))}}class sn extends H{paintTaskIcon(t){this.iconPainter.paintEmptyIcon()}}class on extends H{paintTaskIcon(t){this.iconPainter.paintGearIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class rn extends H{paintTaskIcon(t){this.iconPainter.paintPersonIcon({...t,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class an extends H{paintTaskIcon(t){if(!x.getBpmnIsInstantiating(this.style)){gt(t,!1);return}const e=4,s=4,i={...t.shapeConfig,width:20,height:20};this.iconPainter.paintCircleIcon({canvas:t.canvas,shapeConfig:i,iconStyleConfig:{...t.iconStyleConfig,isFilled:!1},ratioFromParent:void 0,setIconOriginFunct:o=>o.setIconOriginToShapeTopLeft(s,e)}),i.x+=e,i.y+=s,this.iconPainter.paintEnvelopeIcon({...t,shapeConfig:i,ratioFromParent:.65,setIconOriginFunct:o=>o.setIconOriginForIconCentered()})}}class ln extends H{paintTaskIcon(t){gt(t,!0)}}class cn extends H{paintTaskIcon(t){this.iconPainter.paintHandIcon({...t,ratioFromParent:.18,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class un extends H{paintTaskIcon(t){this.iconPainter.paintScriptIcon({...t,ratioFromParent:.22,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(20)})}}class dn extends Ge{paintForeground(t,e,s,i,o){super.paintForeground(t,e,s,i,o);const r=ee({canvas:t,x:e,y:s,width:i,height:o,shape:this});switch(x.getBpmnGlobalTaskKind(this.style)){case h.GLOBAL_TASK_MANUAL:this.iconPainter.paintHandIcon({...r,ratioFromParent:.18,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_SCRIPT:this.iconPainter.paintScriptIcon({...r,ratioFromParent:.22,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_USER:this.iconPainter.paintPersonIcon({...r,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(20)});break;case h.GLOBAL_TASK_BUSINESS_RULE:this.iconPainter.paintTableIcon({...r,ratioFromParent:.6,setIconOriginFunct:a=>a.setIconOriginToShapeTopLeftProportionally(15)});break;case h.GLOBAL_TASK:default:this.iconPainter.paintEmptyIcon()}}}class hn extends Ge{paintBackground(t,e,s,i,o){const r=x.getBpmnSubProcessKind(this.style);t.save(),r===ge.EVENT&&(t.setDashed(!0,!1),t.setDashPattern("1 2")),super.paintBackground(t,e,s,i,o),t.restore()}}class fn extends H{paintTaskIcon(t){this.iconPainter.paintTableIcon({...t,ratioFromParent:.6,setIconOriginFunct:e=>e.setIconOriginToShapeTopLeftProportionally(15)})}}class gn extends l.mxRectangleShape{paintForeground(t,e,s,i,o){t.begin(),t.moveTo(e+m.TEXT_ANNOTATION_BORDER_LENGTH,s),t.lineTo(e,s),t.lineTo(e,s+o),t.lineTo(e+m.TEXT_ANNOTATION_BORDER_LENGTH,s+o),t.stroke()}paintBackground(t,e,s,i,o){t.save(),t.setStrokeColor("none"),super.paintBackground(t,e,s,i,o),t.restore()}}class Tn extends l.mxRectangleShape{constructor(e,s,i,o){super(e,s,i,o);T(this,"iconPainter",te.get())}paintVertexShape(e,s,i,o,r){const a=x.getBpmnIsInitiating(this.style)===Q.NON_INITIATING,c=ee({canvas:e,x:s,y:i,width:o,height:r,shape:this,ratioFromParent:1,isFilled:a});this.iconPainter.paintEnvelopeIcon(c)}}function pn(n,t){return En(n.style,t)}function En(n,t){const e=[],s=n.split(";"),o=s[0].replace(/shape=bpmn./g,""),r=new Map;return r.set("bpmn-type-activity",I.isActivity(o)),r.set("bpmn-type-container",I.isPoolOrLane(o)),r.set("bpmn-type-event",I.isEvent(o)),r.set("bpmn-type-flow",mn(o)),r.set("bpmn-type-gateway",I.isGateway(o)),r.set("bpmn-type-task",I.isTask(o)),[...r].filter(([,a])=>a).forEach(([a])=>e.push(a)),e.push(ye(o)),s.map(a=>{const c=a.split("=");return[c[0],c[1]]}).forEach(([a,c])=>{switch(a){case E.EVENT_DEFINITION_KIND:e.push(`bpmn-event-def-${c}`);break;case E.EVENT_BASED_GATEWAY_KIND:e.push(`bpmn-gateway-kind-${c.toLowerCase()}`);break;case E.IS_INITIATING:e.push(c==Q.NON_INITIATING?"bpmn-icon-non-initiating":"bpmn-icon-initiating");break;case E.SUB_PROCESS_KIND:e.push(`bpmn-sub-process-${c.toLowerCase()}`);break;case E.GLOBAL_TASK_KIND:e.push(ye(c));break}}),t&&e.push("bpmn-label"),e}function mn(n){return Object.values(k).map(t=>t).includes(n)}function ye(n){return n?"bpmn-"+n.replace(/([A-Z])/g,t=>"-"+t[0].toLowerCase()):""}class Tt extends l.mxCellOverlay{constructor(e,s){super(null,"",s.position.horizontalAlign,s.position.verticalAlign,null,"default");T(this,"style");this.label=e,this.style=s.style}getBounds(e){const s=e.view.graph.getModel().isEdge(e.cell),i=e.view.scale;let o;const r=0,a=0;return s?o=this.computeEdgeBounds(e):(o=new l.mxPoint,this.align==l.mxConstants.ALIGN_LEFT?o.x=e.x:this.align==l.mxConstants.ALIGN_CENTER?o.x=e.x+e.width/2:o.x=e.x+e.width,this.verticalAlign==l.mxConstants.ALIGN_TOP?o.y=e.y:this.verticalAlign==l.mxConstants.ALIGN_MIDDLE?o.y=e.y+e.height/2:o.y=e.y+e.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(e){const s=e.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 qe extends l.mxText{constructor(t,e,s){super(t,e,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 Cn extends l.mxConnector{constructor(t,e,s){super(t,e,s)}paintEdgeShape(t,e){const s=this.createMarker(t,e,!0),i=this.createMarker(t,e,!1);this.paintEdgeLine(t,e),t.setShadow(!1),t.setDashed(!1,!1),s!=null&&(t.setFillColor(l.mxUtils.getValue(this.style,E.EDGE_START_FILL_COLOR,this.stroke)),s()),i!=null&&(t.setFillColor(l.mxUtils.getValue(this.style,E.EDGE_END_FILL_COLOR,this.stroke)),i())}paintEdgeLine(t,e){const s=Sn(t);Je(t,"stroke"),this.paintLine(t,e,this.isRounded),Je(t,s)}}function Sn(n){return n instanceof l.mxSvgCanvas2D?n.pointerEventsValue:null}function Je(n,t){n instanceof l.mxSvgCanvas2D&&(n.pointerEventsValue=t)}class In{configureShapes(){this.initMxSvgCanvasPrototype(),this.initMxShapePrototype(),this.registerShapes(),this.initMxCellRendererCreateCellOverlays()}registerShapes(){l.mxCellRenderer.registerShape(h.EVENT_END,Zt),l.mxCellRenderer.registerShape(h.EVENT_START,J),l.mxCellRenderer.registerShape(h.EVENT_INTERMEDIATE_THROW,jt),l.mxCellRenderer.registerShape(h.EVENT_INTERMEDIATE_CATCH,_e),l.mxCellRenderer.registerShape(h.EVENT_BOUNDARY,_e),l.mxCellRenderer.registerShape(h.GATEWAY_EVENT_BASED,en),l.mxCellRenderer.registerShape(h.GATEWAY_EXCLUSIVE,qt),l.mxCellRenderer.registerShape(h.GATEWAY_INCLUSIVE,Qt),l.mxCellRenderer.registerShape(h.GATEWAY_PARALLEL,Jt),l.mxCellRenderer.registerShape(h.SUB_PROCESS,hn),l.mxCellRenderer.registerShape(h.CALL_ACTIVITY,dn),l.mxCellRenderer.registerShape(h.TASK,sn),l.mxCellRenderer.registerShape(h.TASK_SERVICE,on),l.mxCellRenderer.registerShape(h.TASK_USER,rn),l.mxCellRenderer.registerShape(h.TASK_RECEIVE,an),l.mxCellRenderer.registerShape(h.TASK_SEND,ln),l.mxCellRenderer.registerShape(h.TASK_MANUAL,cn),l.mxCellRenderer.registerShape(h.TASK_SCRIPT,un),l.mxCellRenderer.registerShape(h.TASK_BUSINESS_RULE,fn),l.mxCellRenderer.registerShape(h.TEXT_ANNOTATION,gn),l.mxCellRenderer.registerShape(E.EDGE,Cn),l.mxCellRenderer.registerShape(E.MESSAGE_FLOW_ICON,Tn)}initMxSvgCanvasPrototype(){l.mxSvgCanvas2D.prototype.getTextCss=function(){const t=this.state,e=l.mxConstants.ABSOLUTE_LINE_HEIGHT?t.fontSize*l.mxConstants.LINE_HEIGHT+"px":l.mxConstants.LINE_HEIGHT*this.lineHeightCorrection;let s="display: inline-block; font-size: "+t.fontSize+"px; font-family: "+t.fontFamily+"; color: "+t.fontColor+"; line-height: "+e+"; pointer-events: none; ";(t.fontStyle&l.mxConstants.FONT_BOLD)==l.mxConstants.FONT_BOLD&&(s+="font-weight: bold; "),(t.fontStyle&l.mxConstants.FONT_ITALIC)==l.mxConstants.FONT_ITALIC&&(s+="font-style: italic; ");const i=[];return(t.fontStyle&l.mxConstants.FONT_UNDERLINE)==l.mxConstants.FONT_UNDERLINE&&i.push("underline"),(t.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(){const t=new l.mxSvgCanvas2D(this.node,!1);t.strokeTolerance=this.pointerEvents?this.svgStrokeTolerance:0,t.pointerEventsValue=this.svgPointerEvents;const e=this.getSvgScreenOffset();if(e!=0?this.node.setAttribute("transform","translate("+e+","+e+")"):this.node.removeAttribute("transform"),this.state&&this.state.cell){const s=this.state.cell;let i=pn(s,this.dialect===l.mxConstants.DIALECT_STRICTHTML);const o=this.state.style[E.EXTRA_CSS_CLASSES];o&&(i=i.concat(o)),this.node.setAttribute("class",i.join(" ")),this.node.setAttribute("data-bpmn-id",this.state.cell.id)}return t.minStrokeWidth=this.minSvgStrokeWidth,this.antiAlias||(t.format=function(s){return Math.round(parseFloat(s))}),t}}initMxCellRendererCreateCellOverlays(){l.mxCellRenderer.prototype.createCellOverlays=function(t){const s=t.view.graph.getCellOverlays(t.cell);let i=null;if(s!=null){i=new l.mxDictionary;for(const o of s){const r=t.overlays!=null?t.overlays.remove(o):null;if(r!=null){i.put(o,r);continue}let a;o instanceof Tt?a=new qe(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=t.view.graph.dialect,a.overlay=o,this.initializeOverlay(t,a),this.installCellOverlayListeners(t,o,a),o.cursor!=null&&(a.node.style.cursor=o.cursor),a instanceof qe&&(a.node.classList.add("overlay-badge"),a.node.setAttribute("data-bpmn-id",t.cell.id)),i.put(o,a)}}t.overlays!=null&&t.overlays.visit(function(o,r){r.destroy()}),t.overlays=i}}}class An{configureMarkers(){this.registerArrowDashMarker()}registerArrowDashMarker(){const t=(e,s,i,o,r,a,c,u,f)=>{const d=r*(c+f+4),p=a*(c+f+4);return function(){e.begin(),e.moveTo(o.x-d/2-p/2,o.y-p/2+d/2),e.lineTo(o.x+p/2-3*d/2,o.y-3*p/2-d/2),e.stroke()}};l.mxMarker.addMarker(Be.ARROW_DASH,t)}}function Qe(n,t,e,s){let i=n==null?s:n;return i=Math.min(Math.max(i,t),e),i}function Nn(n){return Math.max(n||0,0)}function vn(n){const t=n!=null?n:{};return t.debounceDelay=Qe(t.debounceDelay,0,100,50),t.throttleDelay=Qe(t.throttleDelay,0,100,50),t}var Ln="Expected a function",et=0/0,On="[object Symbol]",_n=/^\s+|\s+$/g,yn=/^[-+]0x[0-9a-f]+$/i,bn=/^0b[01]+$/i,wn=/^0o[0-7]+$/i,Rn=parseInt,xn=typeof U=="object"&&U&&U.Object===Object&&U,Fn=typeof self=="object"&&self&&self.Object===Object&&self,Pn=xn||Fn||Function("return this")(),Mn=Object.prototype,kn=Mn.toString,Bn=Math.max,Gn=Math.min,Ae=function(){return Pn.Date.now()};function Vn(n,t,e){var s,i,o,r,a,c,u=0,f=!1,d=!1,p=!0;if(typeof n!="function")throw new TypeError(Ln);t=tt(t)||0,be(e)&&(f=!!e.leading,d="maxWait"in e,o=d?Bn(tt(e.maxWait)||0,t):o,p="trailing"in e?!!e.trailing:p);function g(C){var _=s,M=i;return s=i=void 0,u=C,r=n.apply(M,_),r}function A(C){return u=C,a=setTimeout(F,t),f?g(C):r}function N(C){var _=C-c,M=C-u,se=t-_;return d?Gn(se,o-M):se}function P(C){var _=C-c,M=C-u;return c===void 0||_>=t||_<0||d&&M>=o}function F(){var C=Ae();if(P(C))return V(C);a=setTimeout(F,N(C))}function V(C){return a=void 0,p&&s?g(C):(s=i=void 0,r)}function Z(){a!==void 0&&clearTimeout(a),u=0,s=c=i=a=void 0}function Se(){return a===void 0?r:V(Ae())}function K(){var C=Ae(),_=P(C);if(s=arguments,i=this,c=C,_){if(a===void 0)return A(c);if(d)return a=setTimeout(F,t),g(c)}return a===void 0&&(a=setTimeout(F,t)),r}return K.cancel=Z,K.flush=Se,K}function be(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Yn(n){return!!n&&typeof n=="object"}function Un(n){return typeof n=="symbol"||Yn(n)&&kn.call(n)==On}function tt(n){if(typeof n=="number")return n;if(Un(n))return et;if(be(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=be(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(_n,"");var e=bn.test(n);return e||wn.test(n)?Rn(n.slice(2),e?2:8):yn.test(n)?et:+n}var Wn=Vn,pt="Expected a function",nt=0/0,Hn="[object Symbol]",Kn=/^\s+|\s+$/g,Dn=/^[-+]0x[0-9a-f]+$/i,zn=/^0b[01]+$/i,$n=/^0o[0-7]+$/i,Xn=parseInt,Zn=typeof U=="object"&&U&&U.Object===Object&&U,jn=typeof self=="object"&&self&&self.Object===Object&&self,qn=Zn||jn||Function("return this")(),Jn=Object.prototype,Qn=Jn.toString,es=Math.max,ts=Math.min,Ne=function(){return qn.Date.now()};function ns(n,t,e){var s,i,o,r,a,c,u=0,f=!1,d=!1,p=!0;if(typeof n!="function")throw new TypeError(pt);t=st(t)||0,Te(e)&&(f=!!e.leading,d="maxWait"in e,o=d?es(st(e.maxWait)||0,t):o,p="trailing"in e?!!e.trailing:p);function g(C){var _=s,M=i;return s=i=void 0,u=C,r=n.apply(M,_),r}function A(C){return u=C,a=setTimeout(F,t),f?g(C):r}function N(C){var _=C-c,M=C-u,se=t-_;return d?ts(se,o-M):se}function P(C){var _=C-c,M=C-u;return c===void 0||_>=t||_<0||d&&M>=o}function F(){var C=Ne();if(P(C))return V(C);a=setTimeout(F,N(C))}function V(C){return a=void 0,p&&s?g(C):(s=i=void 0,r)}function Z(){a!==void 0&&clearTimeout(a),u=0,s=c=i=a=void 0}function Se(){return a===void 0?r:V(Ne())}function K(){var C=Ne(),_=P(C);if(s=arguments,i=this,c=C,_){if(a===void 0)return A(c);if(d)return a=setTimeout(F,t),g(c)}return a===void 0&&(a=setTimeout(F,t)),r}return K.cancel=Z,K.flush=Se,K}function ss(n,t,e){var s=!0,i=!0;if(typeof n!="function")throw new TypeError(pt);return Te(e)&&(s="leading"in e?!!e.leading:s,i="trailing"in e?!!e.trailing:i),ns(n,t,{leading:s,maxWait:t,trailing:i})}function Te(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function is(n){return!!n&&typeof n=="object"}function os(n){return typeof n=="symbol"||is(n)&&Qn.call(n)==Hn}function st(n){if(typeof n=="number")return n;if(os(n))return nt;if(Te(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Te(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(Kn,"");var e=zn.test(n);return e||$n.test(n)?Xn(n.slice(2),e?2:8):Dn.test(n)?nt:+n}var rs=ss;const we=1.25,as=1/we;class ls extends l.mxGraph{constructor(e){super(e);T(this,"currentZoomLevel",1);this.zoomFactor=we,this.container&&(this.container.style.cursor="default")}createGraphView(){return new cs(this)}fit(e,s,i,o,r,a,c){const u=super.fit(e,s,i,o,r,a,c);return this.setCurrentZoomLevel(u),u}setCurrentZoomLevel(e){this.currentZoomLevel=e!=null?e:this.view.scale}zoomActual(){super.zoomActual(),this.setCurrentZoomLevel()}zoomIn(){super.zoomIn(),this.setCurrentZoomLevel()}zoomOut(){super.zoomOut(),this.setCurrentZoomLevel()}customFit(e){this.zoomActual();const s=e==null?void 0:e.type;if(s==null||s==re.None)return;const i=Nn(e==null?void 0:e.margin);if(s!=re.Center){let o=!1,r=!1;switch(s){case re.Horizontal:r=!0;break;case re.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,f=r.height/this.view.scale,d=Math.min(3,Math.min(a/u,c/f));this.setCurrentZoomLevel(d),this.view.scaleAndTranslate(d,(i+a-u*d)/(2*d)-r.x/this.view.scale,(i+c-f*d)/(2*d)-r.y/this.view.scale)}}registerMouseWheelZoomListeners(e){e=vn(e),l.mxEvent.addMouseWheelListener(Wn(this.createMouseWheelZoomListener(!0),e.debounceDelay),this.container),l.mxEvent.addMouseWheelListener(rs(this.createMouseWheelZoomListener(!1),e.throttleDelay),this.container)}manageMouseWheelZoomEvent(e,s,i){if(!i)this.currentZoomLevel*=e?we:as;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(e){return(s,i)=>{if(l.mxEvent.isConsumed(s))return;const o=s;o.ctrlKey&&!o.altKey&&!o.shiftKey&&!o.metaKey&&this.manageMouseWheelZoomEvent(i,o,e)}}getEventRelativeCoordinates(e){const s=this.container.getBoundingClientRect(),i=e.clientX-s.left,o=e.clientY-s.top;return[i,o]}getScaleAndTranslationDeltas(e,s){const[i,o]=this.calculateFactorAndScale(),[r,a]=this.calculateTranslationDeltas(i,o,e*2,s*2);return[o,r,a]}calculateTranslationDeltas(e,s,i,o){if(e>1){const r=(e-1)/(s*2);i*=-r,o*=-r}else{const r=(1/e-1)/(this.view.scale*2);i*=r,o*=r}return[i,o]}calculateFactorAndScale(){const e=Math.round(this.currentZoomLevel*100)/100;return[e/this.view.scale,e]}}class cs extends l.mxGraphView{getFloatingTerminalPoint(t,e,s,i){if(t.absolutePoints.filter(Boolean).length<2)return super.getFloatingTerminalPoint(t,e,s,i);const a=t.absolutePoints;return i?a[1]:a[a.length-2]}}class us{constructor(t){T(this,"graph");this.container=t,this.graph=new ls(t)}configure(t){return this.configureGraph(),this.configureNavigationSupport(t),new ce(this.graph).configureStyles(),new In().configureShapes(),new An().configureMarkers(),this.graph}configureGraph(){this.graph.setCellsLocked(!0),this.graph.setCellsSelectable(!1),this.graph.setEdgeLabelsMovable(!1),this.graph.setHtmlLabels(!0),this.graph.setConstrainChildren(!1),this.graph.setExtendParents(!1),this.graph.foldingEnabled=!1}configureNavigationSupport(t){var s;const e=this.graph.panningHandler;(s=t==null?void 0:t.navigation)!=null&&s.enabled?(e.addListener(l.mxEvent.PAN_START,this.getPanningHandler("grab")),e.addListener(l.mxEvent.PAN_END,this.getPanningHandler("default")),this.graph.panningHandler.usePopupTrigger=!1,e.isForcePanningEvent=i=>l.mxEvent.isLeftMouseButton(i.getEvent())||l.mxEvent.isMultiTouchEvent(i.getEvent()),this.graph.setPanning(!0),this.graph.registerMouseWheelZoomListeners(t.navigation.zoom)):(this.graph.setPanning(!1),e.setPinchEnabled(!1),e.isForcePanningEvent=i=>!1)}getPanningHandler(t){return()=>{this.graph.isEnabled()&&(this.container.style.cursor=t)}}}class Ve{constructor(t,e,s,i,o){this.id=t,this.name=e,this.kind=s,this.sourceRefId=i,this.targetRefId=o}}class Et extends Ve{constructor(t,e,s,i,o=B.NORMAL){super(t,e,k.SEQUENCE_FLOW,s,i),this.sequenceFlowKind=o}}class mt extends Ve{constructor(t,e,s,i){super(t,e,k.MESSAGE_FLOW,s,i)}}class Ct extends Ve{constructor(t,e,s,i,o=j.NONE){super(t,e,k.ASSOCIATION_FLOW,s,i),this.associationDirectionKind=o}}class ds{constructor(t){this.graph=t}computeRelativeCoordinates(t,e){const s=this.getTranslateForRoot(t),i=e.x+s.x,o=e.y+s.y;return new l.mxPoint(i,o)}getTranslateForRoot(t){const e=this.graph.getModel(),s=new l.mxPoint(0,0);for(;t!=null;){const i=e.getGeometry(t);i!=null&&(s.x-=i.x,s.y-=i.y),t=e.getParent(t)}return s}computeEdgeCenter(t){const e=t.geometry.points,s=e[0],i=e[e.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 fe{constructor(t,e,s,i,o){this.id=t,this.bpmnElement=e,this.bounds=s,this.label=i,this.isHorizontal=o}}class G{constructor(t,e,s,i,o=!1){this.id=t,this.name=e,this.kind=s,this.parentId=i,this.instantiate=o}}class Ce extends G{constructor(t,e,s,i,o,r=[]){super(t,e,s,i,o),this.markers=r}}class ue extends Ce{constructor(t,e,s,i,o,r){super(t,e,h.CALL_ACTIVITY,i,void 0,o),this.callActivityKind=s,this.globalTaskKind=r}}class pe extends Ce{constructor(t,e,s,i,o){super(t,e,h.SUB_PROCESS,i,void 0,o),this.subProcessKind=s}}class de extends G{constructor(t,e,s,i,o){super(t,e,s,o),this.eventDefinitionKind=i}}class St extends de{constructor(t,e,s,i,o){super(t,e,h.EVENT_START,s,i),this.isInterrupting=o}}class It extends de{constructor(t,e,s,i,o=!0){super(t,e,h.EVENT_BOUNDARY,s,i),this.isInterrupting=o}}class At extends G{constructor(t,e,s,i,o=le.None){super(t,e,h.GATEWAY_EVENT_BASED,s,i),this.gatewayKind=o}}class z{computeStyle(t,e){const s=[t.bpmnElement.kind];let i;t instanceof fe?i=z.computeShapeStyle(t):(s.push(...z.computeEdgeStyle(t)),i=new Map);const o=z.computeFontStyleValues(t),r=z.computeLabelStyleValues(t,e);return[].concat([...s]).concat([...i,...o,...r].filter(([,a])=>a&&a!="undefined").map(([a,c])=>a+"="+c)).join(";")}static computeShapeStyle(t){const e=new Map,s=t.bpmnElement;return s instanceof de?this.computeEventShapeStyle(s,e):s instanceof Ce?this.computeActivityShapeStyle(s,e):I.isPoolOrLane(s.kind)?e.set(l.mxConstants.STYLE_HORIZONTAL,t.isHorizontal?"0":"1"):s instanceof At&&(e.set(E.IS_INSTANTIATING,String(s.instantiate)),e.set(E.EVENT_BASED_GATEWAY_KIND,String(s.gatewayKind))),e}static computeEventShapeStyle(t,e){e.set(E.EVENT_DEFINITION_KIND,t.eventDefinitionKind),(t instanceof It||t instanceof St&&t.isInterrupting!==void 0)&&e.set(E.IS_INTERRUPTING,String(t.isInterrupting))}static computeActivityShapeStyle(t,e){t instanceof pe?e.set(E.SUB_PROCESS_KIND,t.subProcessKind):t.kind===h.TASK_RECEIVE?e.set(E.IS_INSTANTIATING,String(t.instantiate)):t instanceof ue&&e.set(E.GLOBAL_TASK_KIND,t.globalTaskKind);const s=t.markers;s.length>0&&e.set(E.MARKERS,s.join(","))}static computeEdgeStyle(t){const e=[],s=t.bpmnElement;return s instanceof Et&&e.push(s.sequenceFlowKind),s instanceof Ct&&e.push(s.associationDirectionKind),e}static computeFontStyleValues(t){var i;const e=new Map,s=(i=t.label)==null?void 0:i.font;return s&&(e.set(l.mxConstants.STYLE_FONTFAMILY,s.name),e.set(l.mxConstants.STYLE_FONTSIZE,s.size),e.set(l.mxConstants.STYLE_FONTSTYLE,z.getFontStyleValue(s))),e}static computeLabelStyleValues(t,e){const s=new Map,i=t.bpmnElement;return e?(s.set(l.mxConstants.STYLE_VERTICAL_ALIGN,l.mxConstants.ALIGN_TOP),t.bpmnElement.kind!=h.TEXT_ANNOTATION&&s.set(l.mxConstants.STYLE_ALIGN,l.mxConstants.ALIGN_CENTER),t instanceof fe&&(s.set(l.mxConstants.STYLE_LABEL_WIDTH,e.width+1),s.set(l.mxConstants.STYLE_LABEL_POSITION,l.mxConstants.ALIGN_TOP),s.set(l.mxConstants.STYLE_VERTICAL_LABEL_POSITION,l.mxConstants.ALIGN_LEFT))):t instanceof fe&&(i instanceof pe||i instanceof ue&&i.callActivityKind===ae.CALLING_PROCESS)&&!i.markers.includes(y.EXPAND)&&s.set(l.mxConstants.STYLE_VERTICAL_ALIGN,l.mxConstants.ALIGN_TOP),s}computeMessageFlowIconStyle(t){return`shape=${E.MESSAGE_FLOW_ICON};${E.IS_INITIATING}=${t.messageVisibleKind}`}static getFontStyleValue(t){let e=0;return t.isBold&&(e+=l.mxConstants.FONT_BOLD),t.isItalic&&(e+=l.mxConstants.FONT_ITALIC),t.isStrikeThrough&&(e+=l.mxConstants.FONT_STRIKETHROUGH),t.isUnderline&&(e+=l.mxConstants.FONT_UNDERLINE),e}}class hs{constructor(t,e,s){this.graph=t,this.coordinatesTranslator=e,this.styleComputer=s}render(t,e){this.insertShapesAndEdges(t),this.graph.customFit(e)}insertShapesAndEdges({pools:t,lanes:e,subprocesses:s,otherFlowNodes:i,boundaryEvents:o,edges:r}){const a=this.graph.getModel();a.clear(),a.beginUpdate();try{this.insertShapes(t),this.insertShapes(e),this.insertShapes(s),this.insertShapes(i),this.insertShapes(o),this.insertEdges(r)}finally{a.endUpdate()}}insertShapes(t){t.forEach(e=>this.insertShape(e))}getParent(t){const e=this.getCell(t.parentId);return e!=null?e:this.graph.getDefaultParent()}insertShape(t){var a;const e=t.bpmnElement,s=this.getParent(e),i=t.bounds;let o=(a=t.label)==null?void 0:a.bounds;o=I.isPoolOrLane(e.kind)?void 0:o;const r=this.styleComputer.computeStyle(t,o);this.insertVertex(s,e.id,e.name,i,o,r)}insertEdges(t){t.forEach(e=>{var f;const s=e.bpmnElement,i=this.graph.getDefaultParent(),o=this.getCell(s.sourceRefId),r=this.getCell(s.targetRefId),a=(f=e.label)==null?void 0:f.bounds,c=this.styleComputer.computeStyle(e,a),u=this.graph.insertEdge(i,s.id,s.name,o,r,c);if(this.insertWaypoints(e.waypoints,u),a){u.geometry.width=a.width,u.geometry.height=a.height;const d=this.coordinatesTranslator.computeEdgeCenter(u);if(d){u.geometry.relative=!1;const p=this.coordinatesTranslator.computeRelativeCoordinates(u.parent,new l.mxPoint(a.x,a.y)),g=p.x+a.width/2-d.x,A=p.y-d.y;u.geometry.offset=new l.mxPoint(g,A)}}this.insertMessageFlowIconIfNeeded(e,u)})}insertMessageFlowIconIfNeeded(t,e){if(t.bpmnElement instanceof mt&&t.messageVisibleKind!==Q.NONE){const s=this.graph.insertVertex(e,Nt(e.id),void 0,0,0,20,14,this.styleComputer.computeMessageFlowIconStyle(t));s.geometry.relative=!0,s.geometry.offset=new l.mxPoint(-10,-7)}}insertWaypoints(t,e){t&&(e.geometry.points=t.map(s=>this.coordinatesTranslator.computeRelativeCoordinates(e.parent,new l.mxPoint(s.x,s.y))))}getCell(t){return this.graph.getModel().getCell(t)}insertVertex(t,e,s,i,o,r){const a=this.coordinatesTranslator.computeRelativeCoordinates(t,new l.mxPoint(i.x,i.y)),c=this.graph.insertVertex(t,e,s,a.x,a.y,i.width,i.height,r);if(o){const u=o.x-i.x,f=o.y-i.y;c.geometry.offset=new l.mxPoint(u,f)}return c}}function fs(n){return new hs(n,new ds(n),new z)}function Nt(n){return`messageFlowIcon_of_${n}`}var Ye={},Ue={};(function(n){const t=":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",e=t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+t+"]["+e+"]*",i=new RegExp("^"+s+"$"),o=function(a,c){const u=[];let f=c.exec(a);for(;f;){const d=[];d.startIndex=c.lastIndex-f[0].length;const p=f.length;for(let g=0;g"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 f=Object.keys(c),d=f.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--),!As(c)){let d;return c.trim().length===0?d="Invalid space after '<'.":d="Tag '"+c+"' is an invalid name.",v("InvalidTag",d,w(n,o))}const u=Es(n,o);if(u===!1)return v("InvalidAttr","Attributes for '"+c+"' have open quote.",w(n,o));let f=u.value;if(o=u.index,f[f.length-1]==="/"){const d=o-f.length;f=f.substring(0,f.length-1);const p=at(f,t);if(p===!0)s=!0;else return v(p.err.code,p.err.msg,w(n,d+p.err.line))}else if(a)if(u.tagClosed){if(f.trim().length>0)return v("InvalidTag","Closing tag '"+c+"' can't have attributes or invalid starting.",w(n,r));{const d=e.pop();if(c!==d.tagName){let p=w(n,d.tagStartPos);return v("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+c+"'.",w(n,r))}e.length==0&&(i=!0)}}else return v("InvalidTag","Closing tag '"+c+"' doesn't have proper closing.",w(n,o));else{const d=at(f,t);if(d!==!0)return v(d.err.code,d.err.msg,w(n,o-f.length+d.err.line));if(i===!0)return v("InvalidXml","Multiple possible root nodes found.",w(n,o));t.unpairedTags.indexOf(c)!==-1||e.push({tagName:c,tagStartPos:r}),s=!0}for(o++;o0)return v("InvalidXml","Invalid '"+JSON.stringify(e.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 it(n){return n===" "||n===" "||n===` +`||n==="\r"}function ot(n,t){const e=t;for(;t5&&s==="xml")return v("InvalidXml","XML declaration allowed only at the start of the document.",w(n,t));if(n[t]=="?"&&n[t+1]==">"){t++;break}else continue}return t}function rt(n,t){if(n.length>t+5&&n[t+1]==="-"&&n[t+2]==="-"){for(t+=3;t"){t+=2;break}}else if(n.length>t+8&&n[t+1]==="D"&&n[t+2]==="O"&&n[t+3]==="C"&&n[t+4]==="T"&&n[t+5]==="Y"&&n[t+6]==="P"&&n[t+7]==="E"){let e=1;for(t+=8;t"&&(e--,e===0))break}else if(n.length>t+9&&n[t+1]==="["&&n[t+2]==="C"&&n[t+3]==="D"&&n[t+4]==="A"&&n[t+5]==="T"&&n[t+6]==="A"&&n[t+7]==="["){for(t+=8;t"){t+=2;break}}return t}const Ts='"',ps="'";function Es(n,t){let e="",s="",i=!1;for(;t"&&s===""){i=!0;break}e+=n[t]}return s!==""?!1:{value:e,index:t,tagClosed:i}}const ms=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function at(n,t){const e=We.getAllMatches(n,ms),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1},Ns=function(n){return Object.assign({},vt,n)};He.buildOptions=Ns;He.defaultOptions=vt;class vs{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){this.child.push({[t]:e})}addChild(t){t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,[":@"]:t[":@"]}):this.child.push({[t.tagname]:t.child})}}var Ls=vs;function Os(n,t){const e={};if(n[t+3]==="O"&&n[t+4]==="C"&&n[t+5]==="T"&&n[t+6]==="Y"&&n[t+7]==="P"&&n[t+8]==="E"){t=t+9;let s=1,i=!1,o=!1,r=!1,a="";for(;t"){if(r)if(n[t-1]==="-"&&n[t-2]==="-")r=!1;else throw new Error("Invalid XML comment in DOCTYPE");else o&&(ys(a,e),o=!1);if(s--,s===0)break}else n[t]==="["?i=!0:a+=n[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:e,i:t}}const _s=RegExp(`^\\s([a-zA-z0-0]+)[ ](['"])([^&]+)\\2`);function ys(n,t){const e=_s.exec(n);e&&(t[e[1]]={regx:RegExp(`&${e[1]};`,"g"),val:e[3]})}var bs=Os;const ws=/^[-+]?0x[a-fA-F0-9]+$/,Rs=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const xs={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function Fs(n,t={}){if(t=Object.assign({},xs,t),!n||typeof n!="string")return n;let e=n.trim();if(t.skipLike!==void 0&&t.skipLike.test(e))return n;if(t.hex&&ws.test(e))return Number.parseInt(e,16);{const s=Rs.exec(e);if(s){const i=s[1],o=s[2];let r=Ps(s[3]);const a=s[4]||s[6];if(!t.leadingZeros&&o.length>0&&i&&e[2]!==".")return n;if(!t.leadingZeros&&o.length>0&&!i&&e[1]!==".")return n;{const c=Number(e),u=""+c;return u.search(/[eE]/)!==-1||a?t.eNotation?c:n:e.indexOf(".")!==-1?u==="0"&&r===""||u===r||i&&u==="-"+r?c:n:o?r===u||i+r===u?c:n:e===u||e===i+u?c:n}}else return n}}function Ps(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 Ms=Fs;const Ke=Ue,oe=Ls,ks=bs,Bs=Ms;"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,Ke.nameRegexp);class Gs{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={amp:{regex:/&(amp|#38|#x26);/g,val:"&"},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.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"}},this.addExternalEntities=Vs,this.parseXml=Ks,this.parseTextData=Ys,this.resolveNameSpace=Us,this.buildAttributesMap=Hs,this.isItStopNode=$s,this.replaceEntitiesValue=Ds,this.readStopNodeData=Zs,this.saveTextToParentTag=zs}}function Vs(n){const t=Object.keys(n);for(let e=0;e0)){r||(n=this.replaceEntitiesValue(n));const a=this.options.tagValueProcessor(t,n,e,i,o);return a==null?n:typeof a!=typeof n||a!==n?a:this.options.trimValues?xe(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?xe(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Us(n){if(this.options.removeNSPrefix){const t=n.split(":"),e=n.charAt(0)==="/"?"/":"";if(t[0]==="xmlns")return"";t.length===2&&(n=e+t[1])}return n}const Ws=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Hs(n,t){if(!this.options.ignoreAttributes&&typeof n=="string"){const e=Ke.getAllMatches(n,Ws),s=e.length,i={};for(let o=0;o",o,"Closing Tag is not closed.");let c=n.substring(o+2,a).trim();if(this.options.removeNSPrefix){const u=c.indexOf(":");u!==-1&&(c=c.substr(u+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),e&&(s=this.saveTextToParentTag(s,e,i)),i=i.substr(0,i.lastIndexOf(".")),e=this.tagsNodeStack.pop(),s="",o=a}else if(n[o+1]==="?"){let a=Re(n,o,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,e,i),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new oe(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,i)),e.addChild(c)}o=a.closeIndex+1}else if(n.substr(o+1,3)==="!--"){const a=$(n,"-->",o+4,"Comment is not closed.");if(this.options.commentPropName){const c=n.substring(o+4,a-2);s=this.saveTextToParentTag(s,e,i),e.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}o=a}else if(n.substr(o+1,2)==="!D"){const a=ks(n,o);this.docTypeEntities=a.entities,o=a.i}else if(n.substr(o+1,2)==="!["){const a=$(n,"]]>",o,"CDATA is not closed.")-2,c=n.substring(o+9,a);if(s=this.saveTextToParentTag(s,e,i),this.options.cdataPropName)e.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]);else{let u=this.parseTextData(c,e.tagname,i,!0,!1,!0);u==null&&(u=""),e.add(this.options.textNodeName,u)}o=a+2}else{let a=Re(n,o,this.options.removeNSPrefix),c=a.tagName,u=a.tagExp,f=a.attrExpPresent,d=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),e&&s&&e.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,e,i,!1)),c!==t.tagname&&(i+=i?"."+c:c);const p=e;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(e=this.tagsNodeStack.pop()),this.isItStopNode(this.options.stopNodes,i,c)){let g="";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 N=this.readStopNodeData(n,c,d+1);if(!N)throw new Error(`Unexpected end of ${c}`);o=N.i,g=N.tagContent}const A=new oe(c);c!==u&&f&&(A[":@"]=this.buildAttributesMap(u,i)),g&&(g=this.parseTextData(g,c,i,!0,f,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),A.add(this.options.textNodeName,g),e.addChild(A)}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 g=new oe(c);c!==u&&f&&(g[":@"]=this.buildAttributesMap(u,i)),i=i.substr(0,i.lastIndexOf(".")),e.addChild(g)}else{const g=new oe(c);this.tagsNodeStack.push(e),c!==u&&f&&(g[":@"]=this.buildAttributesMap(u,i)),e.addChild(g),e=g}s="",o=d}}else s+=n[o];return t.child},Ds=function(n){if(this.options.processEntities){for(let t in this.docTypeEntities){const e=this.docTypeEntities[t];n=n.replace(e.regx,e.val)}for(let t in this.lastEntities){const e=this.lastEntities[t];n=n.replace(e.regex,e.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const e=this.htmlEntities[t];n=n.replace(e.regex,e.val)}}return n};function zs(n,t,e,s){return n&&(s===void 0&&(s=Object.keys(t.child).length===0),n=this.parseTextData(n,t.tagname,e,!1,t[":@"]?Object.keys(t[":@"]).length!==0:!1,s),n!==void 0&&n!==""&&t.add(this.options.textNodeName,n),n=""),n}function $s(n,t,e){const s="*."+e;for(const i in n){const o=n[i];if(s===o||t===o)return!0}return!1}function Xs(n,t,e=">"){let s,i="";for(let o=t;o",e,`${t} is not closed`);if(n.substring(e+2,o).trim()===t&&(i--,i===0))return{tagContent:n.substring(s,e),i:o};e=o}else if(n[e+1]==="?")e=$(n,"?>",e+1,"StopNode is not closed.");else if(n.substr(e+1,3)==="!--")e=$(n,"-->",e+3,"StopNode is not closed.");else if(n.substr(e+1,2)==="![")e=$(n,"]]>",e,"StopNode is not closed.")-2;else{const o=Re(n,e,">");o&&((o&&o.tagName)===t&&o.tagExp[o.tagExp.length-1]!=="/"&&i++,e=o.closeIndex)}}function xe(n,t,e){if(t&&typeof n=="string"){const s=n.trim();return s==="true"?!0:s==="false"?!1:Bs(n,e)}else return Ke.isExist(n)?n:""}var js=Gs,Lt={};function qs(n,t){return Ot(n,t)}function Ot(n,t,e){let s;const i={};for(let o=0;o0&&(i[t.textNodeName]=s):s!==void 0&&(i[t.textNodeName]=s),i}function Js(n){const t=Object.keys(n);for(let e=0;e0&&(o=ai+""+t.indentBy.repeat(s));for(let r=0;r`;continue}else if(c===t.commentPropName){i+=o+``;continue}else if(c[0]==="?"){const g=lt(a[":@"],t),A=c==="?xml"?"":o;let N=a[c][0][t.textNodeName];N=N.length!==0?" "+N:"",i+=A+`<${c}${N}${g}?>`;continue}const f=lt(a[":@"],t);let d=o+`<${c}${f}`,p=_t(a[c],t,u,s+1);t.unpairedTags.indexOf(c)!==-1?t.suppressUnpairedNode?i+=d+">":i+=d+"/>":(!p||p.length===0)&&t.suppressEmptyNode?i+=d+"/>":i+=d+`>${p}${o}`}return i}function ci(n){const t=Object.keys(n);for(let e=0;e0&&t.processEntities)for(let e=0;e","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],transformTagName:!1};function De(n){this.options=Object.assign({},fi,n),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Si),this.processTextOrObjNode=Ti,this.options.format?(this.indentate=Ci,this.tagEndChar=`> `,this.newLine=` -`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=mi,this.buildObjNode=pi):(this.buildTextNode=ut,this.buildObjNode=ct),this.buildTextValNode=ut,this.buildObjectNode=ct,this.replaceEntitiesValue=Ei,this.buildAttrPairStr=gi}De.prototype.build=function(n){return this.options.preserveOrder?hi(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};De.prototype.j2x=function(n,t){let e="",s="";for(let i in n)if(!(typeof n[i]>"u"))if(n[i]===null)i[0]==="?"?s+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextNode(n[i],i,"",t);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)e+=this.buildAttrPairStr(o,""+n[i]);else if(i===this.options.textNodeName){let a=this.options.tagValueProcessor(i,""+n[i]);s+=this.replaceEntitiesValue(a)}else s+=this.buildTextNode(n[i],i,"",t)}else if(Array.isArray(n[i])){const o=n[i].length;for(let a=0;a"u"||(r===null?i[0]==="?"?s+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+i+"/"+this.tagEndChar:typeof r=="object"?s+=this.processTextOrObjNode(r,i,t):s+=this.buildTextNode(r,i,"",t))}}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const o=Object.keys(n[i]),a=o.length;for(let r=0;r"+n+i:this.options.commentPropName!==!1&&t===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+t+e+o+this.tagEndChar+n+this.indentate(s)+i}function pi(n,t,e,s){return n!==""?this.buildObjectNode(n,t,e,s):t[0]==="?"?this.indentate(s)+"<"+t+e+"?"+this.tagEndChar:this.indentate(s)+"<"+t+e+"/"+this.tagEndChar}function ut(n,t,e,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(s)+``+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+``+this.newLine;{let i=this.options.tagValueProcessor(t,n);return i=this.replaceEntitiesValue(i),i===""&&this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode?this.indentate(s)+"<"+t+this.tagEndChar:this.indentate(s)+"<"+t+"/"+this.tagEndChar:this.indentate(s)+"<"+t+e+">"+i+"0&&this.options.processEntities)for(let t=0;t65535&&(n-=65536,t+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),t+=String.fromCharCode(n),t};function bi(n){var t;return n>=55296&&n<=57343||n>1114111?65533:(t=_i.get(n))!==null&&t!==void 0?t:n}function wi(n){return yi(bi(n))}var R;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.To_LOWER_BIT=32]="To_LOWER_BIT"})(R||(R={}));var X;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(X||(X={}));function Ri(n){return function(e,s){let i="",o=0,a=0;for(;(a=e.indexOf("&",a))>=0;){if(i+=e.slice(o,a),o=a,a+=1,e.charCodeAt(a)===R.NUM){let d=a+1,g=10,p=e.charCodeAt(d);(p|R.To_LOWER_BIT)===R.LOWER_X&&(g=16,a+=1,d+=1);do p=e.charCodeAt(++a);while(p>=R.ZERO&&p<=R.NINE||g===16&&(p|R.To_LOWER_BIT)>=R.LOWER_A&&(p|R.To_LOWER_BIT)<=R.LOWER_F);if(d!==a){const A=e.substring(d,a),N=parseInt(A,g);if(e.charCodeAt(a)===R.SEMI)a+=1;else if(s)continue;i+=wi(N),o=a}continue}let r=0,c=1,u=0,f=n[u];for(;a>14)-1;if(g===0)break;u+=g}}if(r!==0){const d=(n[r]&X.VALUE_LENGTH)>>14;i+=d===1?String.fromCharCode(n[r]&~X.VALUE_LENGTH):d===2?String.fromCharCode(n[r+1]):String.fromCharCode(n[r+1],n[r+2]),o=a-c+1}}return i+e.slice(o)}}function xi(n,t,e,s){const i=(t&X.BRANCH_LENGTH)>>7,o=t&X.JUMP_TABLE;if(i===0)return o!==0&&s===o?e:-1;if(o){const c=s-o;return c<0||c>=i?-1:n[e+c]-1}let a=e,r=a+i-1;for(;a<=r;){const c=a+r>>>1,u=n[c];if(us)r=c-1;else return n[c+i]}return-1}const Fi=Ri(Oi);function Pi(n){return Fi(n,!0)}class Mi{constructor(){T(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e)=>Pi(e)});T(this,"xmlParser",new vi.XMLParser(this.x2jOptions))}parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}}class ne{}class ki{warning(t){const e=t.getMessage();console.warn(e.template,...e.arguments)}}class Bi extends ne{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueRef=e}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Vi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Yi extends ne{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Ui extends ne{constructor(t,e){super(),this.laneId=t,this.flowNodeRef=e}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Wi extends ne{constructor(t,e,s){super(),this.bpmnElementId=t,this.attachedToRef=e,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 Hi{constructor(){T(this,"poolsById",new Map);T(this,"poolsByProcessRef",new Map);T(this,"messageFlows",new Map);T(this,"flowNodes",new Map);T(this,"lanes",new Map);T(this,"sequenceFlows",new Map);T(this,"associationFlows",new Map);T(this,"eventDefinitionsOfDefinitions",new Map);T(this,"globalTasks",new Map);T(this,"categoryValues",new Map)}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const bt=(n,t,e,s)=>{const i=n.findCategoryValue(e.categoryValueRef);if(i)return new G(e.id,i.value,h.GROUP,s);t.warning(new Bi(e.id,e.categoryValueRef))};class Ki{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){I(t).forEach(e=>this.parseCollaboration(e))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){I(t).forEach(e=>this.convertedElements.registerPool(new G(e.id,e.name,h.POOL),e.processRef))}buildMessageFlows(t){I(t).forEach(e=>this.convertedElements.registerMessageFlow(new mt(e.id,e.name,e.sourceRef,e.targetRef)))}buildGroups(t){I(t).forEach(e=>{const s=bt(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)})}}class Di{constructor(t,e){T(this,"defaultSequenceFlowIds",[]);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){I(t).forEach(e=>this.parseProcess(e))}parseProcess(t){const e=t.id,s=this.convertedElements.findPoolByProcessRef(e);s&&!s.name&&this.convertedElements.registerPool(new G(s.id,t.name,h.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){S.flowNodeKinds().filter(s=>s!=h.EVENT_BOUNDARY).forEach(s=>this.buildFlowNodeBpmnElements(t[s],s,e)),this.buildFlowNodeBpmnElements(t.boundaryEvent,h.EVENT_BOUNDARY,e),this.buildLaneBpmnElements(t[h.LANE],e),this.buildLaneSetBpmnElements(t.laneSet,e),this.buildSequenceFlows(t[P.SEQUENCE_FLOW]),this.buildAssociationFlows(t[P.ASSOCIATION_FLOW])}buildFlowNodeBpmnElements(t,e,s){I(t).forEach(i=>{let o;if(S.isEvent(e))o=this.buildShapeBpmnEvent(i,e,s);else if(S.isActivity(e))o=this.buildShapeBpmnActivity(i,e,s);else if(e==h.GATEWAY_EVENT_BASED){const r=i;o=new At(i.id,r.name,s,r.instantiate,le[r.eventGatewayType])}else if(e==h.GROUP)o=bt(this.convertedElements,this.parsingMessageCollector,i,s);else{const r=e===h.TEXT_ANNOTATION?i.text:i.name;o=new G(i.id,r,e,s,i.instantiate)}const a=i.default;S.isWithDefaultSequenceFlow(e)&&a&&this.defaultSequenceFlowIds.push(a),o&&this.convertedElements.registerFlowNode(o)})}buildShapeBpmnActivity(t,e,s){const i=zi(t);return S.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,i):S.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,i):new Ce(t.id,t.name,e,s,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,s){const i=this.convertedElements.findGlobalTask(t.calledElement);return i?new ue(t.id,t.name,ae.CALLING_GLOBAL_TASK,e,s,i):new ue(t.id,t.name,ae.CALLING_PROCESS,e,s)}buildShapeBpmnEvent(t,e,s){const i=this.getEventDefinitions(t),o=i.map(a=>a.counter).reduce((a,r)=>a+r,0);if(o==0&&S.canHaveNoneEvent(e))return new de(t.id,t.name,e,b.NONE,s);if(o==1){const a=i[0].kind;return S.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,a):S.isStartEvent(e)?new St(t.id,t.name,a,s,t.isInterrupting):new de(t.id,t.name,e,a,s)}}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(S.isActivity(s==null?void 0:s.kind))return new It(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new Wi(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;return ft.forEach(s=>{const i=t[s+"EventDefinition"],o=I(i,!0).length;e.set(s,o)}),I(t.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);e.set(i,e.get(i)+1)}),Array.from(e.keys()).map(s=>({kind:s,counter:e.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(t,e,s){const i=t.triggeredByEvent?ge.EVENT:ge.EMBEDDED,o=new pe(t.id,t.name,i,e,s);return this.buildProcessInnerElements(t,t.id),o}buildLaneSetBpmnElements(t,e){I(t).forEach(s=>this.buildLaneBpmnElements(s.lane,e))}buildLaneBpmnElements(t,e){I(t).forEach(s=>{var i;this.convertedElements.registerLane(new G(s.id,s.name,h.LANE,e)),this.assignParentOfLaneFlowNodes(s),(i=s.childLaneSet)!=null&&i.lane&&this.buildLaneBpmnElements(s.childLaneSet.lane,s.id)})}assignParentOfLaneFlowNodes(t){I(t.flowNodeRef).forEach(e=>{const s=this.convertedElements.findFlowNode(e),i=t.id;s?S.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Ui(i,e))})}buildSequenceFlows(t){I(t).forEach(e=>{const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new Et(e.id,e.name,e.sourceRef,e.targetRef,s))})}buildAssociationFlows(t){I(t).forEach(e=>{const s=e.associationDirection;this.convertedElements.registerAssociationFlow(new Ct(e.id,void 0,e.sourceRef,e.targetRef,s))})}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return B.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&S.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return S.isActivity(e.kind)?B.CONDITIONAL_FROM_ACTIVITY:B.CONDITIONAL_FROM_GATEWAY}return B.NORMAL}}const zi=n=>{const t=[],e=n.standardLoopCharacteristics,s=I(n.multiInstanceLoopCharacteristics,!0)[0];return e||e===""?t.push(y.LOOP):s&&s.isSequential?t.push(y.MULTI_INSTANCE_SEQUENTIAL):(s&&!s.isSequential||s==="")&&t.push(y.MULTI_INSTANCE_PARALLEL),t};class $i{constructor(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}}class Xi{constructor(t,e,s,i,o=Q.NONE){this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Zi{constructor(t,e){this.x=t,this.y=e}}class ji{constructor(t,e){this.font=t,this.bounds=e}}class qi{constructor(t,e,s,i,o,a){this.name=t,this.size=e,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=a}}class Ee{constructor(t,e){T(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],i=[],o=[],a=I(t)[0];if(a){this.deserializeFonts(a.BPMNLabelStyle);const r=a.BPMNPlane,c=this.deserializeEdges(r.BPMNEdge),u=this.deserializeShapes(r.BPMNShape);e.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...c)}return{flowNodes:e,lanes:s,pools:i,edges:o}}deserializeFonts(t){this.convertedFonts=new Map,I(t).forEach(e=>I(e.Font).forEach(s=>this.convertedFonts.set(e.id,new qi(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return I(t).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,e.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,e.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,e.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gi(s.bpmnElement))}),e}deserializeShapeAndStoreIfFound(t,e,s){const i=this.deserializeShape(t,s);return i?(e.push(i),!0):!1}deserializeShape(t,e){const s=e(t.bpmnElement);if(s){const i=Ee.deserializeBounds(t);(s instanceof pe||s instanceof ue&&s.callActivityKind===ae.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(y.EXPAND);let o;S.isPoolOrLane(s.kind)&&(o=t.isHorizontal!==void 0?t.isHorizontal:!0);const a=this.deserializeLabel(t.BPMNLabel,t.id);return new fe(t.id,s,i,a,o)}}static deserializeBounds(t){const e=t.Bounds;if(e)return new $i(e.x,e.y,e.width,e.height)}deserializeEdges(t){return I(t).map(e=>{const s=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Vi(e.bpmnElement));return}const i=this.deserializeWaypoints(e.waypoint),o=this.deserializeLabel(e.BPMNLabel,e.id),a=e.messageVisibleKind?e.messageVisibleKind:Q.NONE;return new Xi(e.id,s,i,o,a)}).filter(Boolean)}deserializeWaypoints(t){return I(t).map(e=>new Zi(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),i=Ee.deserializeBounds(t);if(s||i)return new ji(s,i)}}findFont(t,e){let s;return t&&(s=this.convertedFonts.get(t),s||this.parsingMessageCollector.warning(new Yi(e,t))),s}}class Ji{constructor(t){this.convertedElements=t}deserialize(t){ft.forEach(e=>{const s=t[e+"EventDefinition"];I(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,e))})}}class Qi{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){I(t).forEach(s=>this.convertedElements.registerGlobalTask(s.id,e))}}class eo{constructor(t){this.convertedElements=t}deserialize(t){I(t.category).forEach(e=>I(e.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class to{constructor(t,e,s,i,o,a){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=a}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function no(n){const t=new Hi;return new to(new eo(t),new Ki(t,n),new Ji(t),new Qi(t),new Di(t,n),new Ee(t,n))}class so{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function io(){return new so(no(new ki),new Mi)}class oo{constructor(){T(this,"classNamesByBPMNId",new Map)}clear(){this.classNamesByBPMNId.clear()}getClassNames(t){var e;return Array.from((e=this.classNamesByBPMNId.get(t))!=null?e:[])}addClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.add(i))}removeClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.delete(i))}toggleClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.has(i)?s.delete(i):s.add(i)),e&&e.length>0}updateClassNames(t,e,s){const i=this.getOrInitializeClassNames(t),o=i.size;return I(e).forEach(a=>s(i,a)),i.size!=o}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return e==null&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class ze{constructor(){T(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(t){const e=this.convertPosition(t),s=ze.convertStyle(t);return{position:e,style:s}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:m.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:m.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:m.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:m.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:m.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:m.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=t.style,i={...e};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(t,e){var s,i;e&&(t.fill.color=(s=e.color)!=null?s:t.fill.color,t.fill.opacity=(i=e.opacity)!=null?i:t.fill.opacity)}static convertStroke(t,e){var s,i;e&&(t.stroke.color=(s=e.color)!=null?s:t.stroke.color,t.stroke.width=(i=e.width)!=null?i:t.stroke.width)}static convertFont(t,e){var s,i;e&&(t.font.color=(s=e.color)!=null?s:t.font.color,t.font.size=(i=e.size)!=null?i:t.font.size)}}function ro(n){return new ao(n,new ze)}class ao{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(Nt(t),e)}updateAndRefreshCssClassesOfElement(t,e){var a;const s=this.graph.getModel().getCell(t);if(!s)return;const o=this.graph.getView().getState(s);o.style[E.EXTRA_CSS_CLASSES]=e,o.shape.redraw(),(a=o.text)==null||a.redraw()}addOverlays(t,e){const s=this.graph.getModel().getCell(t);!s||I(e).forEach(i=>{const o=new Tt(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);!e||this.graph.removeCellOverlays(e)}}class lo{constructor(t){this.containerId=t}element(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function co(n,t){var e;return new uo(n,new ho(new lo((e=t.container)==null?void 0:e.id)),new oo,ro(t))}class uo{constructor(t,e,s,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=s,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear.bind(this.cssRegistry))}getElementsByIds(t){return I(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getElementsByKinds(t){return I(t).map(e=>this.htmlElementRegistry.getBpmnHtmlElements(e).map(s=>({htmlElement:s,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(s.getAttribute("data-bpmn-id"))}))).reduce((e,s)=>(e.push(...s),e),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,s){const i=I(e);I(t).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(t,e){if(t){const s=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,s)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}}class ho{constructor(t){this.querySelectors=t}getBpmnHtmlElement(t){return document.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(ye(t));return[...document.querySelectorAll(e)]}}class fo{filter(t,e){const s=[],i=[];if(I(e==null?void 0:e.pools).filter(g=>g&&Object.keys(g).length).forEach(g=>g.id?s.push(g.id):g.name&&i.push(g.name)),s.length==0&&i.length==0)return t;if(t.pools.length==0)throw new Error("It is not possible to filter pools of the BPMN model because it does not contain any pool");const{filteredPools:o,filteredPoolsIds:a}=go(t,s,i),{filteredLanes:r,filteredLaneIds:c,filteredFlowNodes:u,filteredFlowNodeIds:f}=wt(t.lanes,t.flowNodes,a),d=po(t.edges,[...a,...c,...f]);return{lanes:r,flowNodes:u,pools:o,edges:d}}}function go(n,t,e){const s=n.pools.filter(o=>t.includes(o.bpmnElement.id)||e.includes(o.bpmnElement.name));if(s.length==0){let o=t.length>0?` for ids [${t}]`:"";const a=o?" and":"";throw o+=e.length>0?`${a} for names [${e}]`:"",new Error("No matching pools"+o)}const i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolsIds:i}}function wt(n,t,e){const{filteredLanes:s,filteredLaneIds:i}=Rt(n,e),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:r,filteredFlowNodeIds:c}=To(t,[...e,...i],n);return s.push(...o),i.push(...a),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:r,filteredFlowNodeIds:c}}function Rt(n,t){const e=n.filter(i=>t.includes(i.bpmnElement.parentId)),s=e.map(i=>i.bpmnElement.id);if(e.length>0){const{filteredLanes:i,filteredLaneIds:o}=Rt(n,s);e.push(...i),s.push(...o)}return{filteredLanes:e,filteredLaneIds:s}}function To(n,t,e){const s=n.filter(u=>t.includes(u.bpmnElement.parentId));if(s.length===0)return{filteredLanes:[],filteredLaneIds:[],filteredFlowNodes:[],filteredFlowNodeIds:[]};const i=s.map(u=>u.bpmnElement.id),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:r,filteredFlowNodeIds:c}=wt(e,n,i);return s.push(...r),i.push(...c),{filteredLanes:o,filteredLaneIds:a,filteredFlowNodes:s,filteredFlowNodeIds:i}}function po(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceRefId)&&t.includes(e.bpmnElement.targetRefId))}class Eo{constructor(){T(this,"searchableModel");T(this,"onLoadCallback")}load(t,e){var i;const s=new fo().filter(t,e);return this.searchableModel=new Co(s),(i=this.onLoadCallback)==null||i.call(this),mo(s)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const s=e.bpmnElement,i=s instanceof G;return{id:t,name:s.name,isShape:i,kind:s.kind}}}function mo(n){const t=n.flowNodes.filter(o=>{const a=o.bpmnElement;return S.isSubProcess(a.kind)&&a.markers.includes(y.EXPAND)}).map(o=>o.bpmnElement.id),e=[],s=[],i=[];return n.flowNodes.forEach(o=>{const a=o.bpmnElement.kind;S.isSubProcess(a)?e.push(o):S.isBoundaryEvent(a)?s.push(o):t.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:e}}class Co{constructor(t){T(this,"elements",new Map);[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach(e=>this.elements.set(e.bpmnElement.id,e))}elementById(t){return this.elements.get(t)}}function So(n){return n instanceof HTMLElement?n:document.getElementById(n)}class Io{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const Ao="0.26.0",No=()=>({lib:Ao,dependencies:new Map([["mxGraph",l.mxClient.VERSION]])});class Lo{constructor(t){T(this,"graph");T(this,"navigation");T(this,"bpmnElementsRegistry");T(this,"bpmnModelRegistry");const e=new us(So(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new Io(this.graph),this.bpmnModelRegistry=new Eo,this.bpmnElementsRegistry=co(this.bpmnModelRegistry,this.graph)}load(t,e){const s=io().parse(t),i=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);fs(this.graph).render(i,e==null?void 0:e.fit)}fit(t){this.navigation.fit(t)}getVersion(){return No()}}const vo=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 Oo extends Lo{configureTheme(t){var f,d;if(t=="default")return new ce(this.graph).configureStyles(),!0;const e=vo.get(t);if(!e)return!1;const s=this.graph.getStylesheet();S.eventKinds().forEach(g=>{var M;let p,A;switch(g){case"endEvent":p=e.endEventFillColor,A=e.endEventStrokeColor;break;case"startEvent":p=e.startEventFillColor,A=e.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":p=e.defaultFillColor,A=(M=e.catchAndThrowEventStrokeColor)!=null?M:e.defaultStrokeColor;break;default:p=e.defaultFillColor,A=e.defaultStrokeColor;break}const N=s.styles[g];N.fillColor=p,N.strokeColor=A}),S.taskKinds().forEach(g=>{const p=s.styles[g];p.fillColor=e.taskAndCallActivityFillColor});const i=s.styles[h.CALL_ACTIVITY];i.fillColor=e.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=(f=e.textAnnotationFillColor)!=null?f:m.TEXT_ANNOTATION_FILL_COLOR;const a=s.styles[h.POOL];a.fillColor=e.poolFillColor,a.swimlaneFillColor=e.defaultFillColor;const r=s.styles[h.LANE];r.fillColor=e.laneFillColor;const c=s.getDefaultVertexStyle();c.fontColor=e.defaultFontColor,c.fillColor=e.defaultFillColor,c.strokeColor=e.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=e.defaultFontColor,u.fillColor=e.defaultFillColor,u.strokeColor=(d=e.flowColor)!=null?d:e.defaultStrokeColor,!0}configureSequenceFlowColor(t){Y(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[P.SEQUENCE_FLOW];s[l.mxConstants.STYLE_STROKECOLOR]=t,s[l.mxConstants.STYLE_FILLCOLOR]=t,Y("Sequence flows style updated")}}let O,W={},$e,Xe;function Bo(n){v("Updating load options",n),W.fit=n,v("Load options updated!",Fe(W))}function Go(){return{...W}}function Vo(){return Xe}function Yo(n){v("Switching theme from %s to %s",Xe,n),O.configureTheme(n)&&(O.graph.refresh(),v("Theme switch done"))}function xt(n){v("Loading bpmn...");try{O.load(n,W),v("BPMN loaded with configuration",Fe(W)),_o($e),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){Me(t,`Cannot load the BPMN diagram: ${t.message}`)}}function Uo(n){v("Fitting..."),O.navigation.fit(n),v("Fit done with configuration",Fe(n))}function Wo(n){v(`Zooming '${n}'...`),O.navigation.zoom(n),v("Zoom done")}function Ho(n){return O.bpmnElementsRegistry.getElementsByKinds(n)}function Ko(n,t){return O.bpmnElementsRegistry.addCssClasses(n,t)}function Do(n,t){return O.bpmnElementsRegistry.removeCssClasses(n,t)}function zo(n,t){return O.bpmnElementsRegistry.addOverlays(n,[t])}function $o(n){return O.bpmnElementsRegistry.removeAllOverlays(n)}function _o(n){if(!$e)return;v("Updating model, bpmnElement to collapse:",n);const t=O.graph.getModel(),e=t.getCell(n);if(!e)v("Element not found in the model, do nothing");else{t.beginUpdate();try{t.setCollapsed(e,!0)}finally{t.endUpdate()}v("Model updated")}}function Ft(n){const t=new FileReader;t.onload=()=>{xt(t.result)},t.readAsText(n)}function Xo(n){const t=n.target.files[0];Ft(t)}function yo(n,t){Bt(n).catch(e=>{const s=`Unable to fetch ${n}. ${e}`;throw t(s),new Error(s)}).then(e=>(v("BPMN content fetched"),e)).then(e=>{xt(e),v(`Bpmn loaded from url ${n}`)}).catch(()=>{})}function bo(n){Me(n)}function wo(n,t){var o;const e=((o=n.loadOptions)==null?void 0:o.fit)||{},s=t.get("fitTypeOnLoad");s&&(e.type=s);const i=t.get("fitMargin");return i&&(e.margin=Number(i)),e}function Ro(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";Y("Use alternative color for the bpmn container background, color",o);const a=O.graph.container;a.style.backgroundColor=o,Y("Bpmn container style updated")}const e=n.get("style.theme");Y(`Configuring the '${e}' BPMN theme`),O.configureTheme(e)?(Xe=e,Y(`'${e}' BPMN theme configured`)):Y(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&O.configureSequenceFlowColor("#E9E9E9")}function xo(n){$e=n.get("bpmn.element.id.collapsed")}function Fo(n){const t=n.get("bpmn.filter.pool.ids");if(!t)return;const e=t.split(",");return v("Configuring load options to only include pool id: ",e),{pools:e.map(s=>({id:s}))}}function Zo(n){const t=Y,e=n.globalOptions.container;t(`Initializing BpmnVisualization with container '${e}'...`),O=new Oo(n.globalOptions),t("Initialization completed"),new Gt(window,"drop-container",e,Ft),t("Drag&Drop support initialized");const s=new URLSearchParams(window.location.search);t("Configuring Load Options"),W=n.loadOptions||{},W.fit=wo(n,s),W.modelFilter=Fo(s),Ro(s),xo(s),t("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=s.get("url");if(i){const o=decodeURIComponent(i),a=n.statusFetchKoNotifier||bo;yo(o,a);return}t("No 'url to fetch BPMN content' provided")}function jo(){q("Trigger SVG Download"),Ut(new dt(O.graph).exportSvg())}function qo(){q("Trigger PNG Download"),Wt(new dt(O.graph).exportSvgForPng())}function Jo(){const n=O.getVersion();return v("Version:",n),n}export{re as F,S,Ht as Z,Yo as a,Jo as b,Vo as c,ko as d,$o as e,Uo as f,Go as g,Xo as h,jo as i,qo as j,Ho as k,v as l,Ko as m,zo as n,Do as r,Zo as s,Bo as u,Wo as z}; +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.suppressEmptyNode?(this.buildTextNode=mi,this.buildObjNode=pi):(this.buildTextNode=ut,this.buildObjNode=ct),this.buildTextValNode=ut,this.buildObjectNode=ct,this.replaceEntitiesValue=Ei,this.buildAttrPairStr=gi}De.prototype.build=function(n){return this.options.preserveOrder?hi(n,this.options):(Array.isArray(n)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(n={[this.options.arrayNodeName]:n}),this.j2x(n,0).val)};De.prototype.j2x=function(n,t){let e="",s="";for(let i in n)if(!(typeof n[i]>"u"))if(n[i]===null)i[0]==="?"?s+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(n[i]instanceof Date)s+=this.buildTextNode(n[i],i,"",t);else if(typeof n[i]!="object"){const o=this.isAttribute(i);if(o)e+=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.buildTextNode(n[i],i,"",t)}else if(Array.isArray(n[i])){const o=n[i].length;for(let r=0;r"u"||(a===null?i[0]==="?"?s+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+i+"/"+this.tagEndChar:typeof a=="object"?s+=this.processTextOrObjNode(a,i,t):s+=this.buildTextNode(a,i,"",t))}}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&&t===this.options.commentPropName&&o.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+t+e+o+this.tagEndChar+n+this.indentate(s)+i}function pi(n,t,e,s){return n!==""?this.buildObjectNode(n,t,e,s):t[0]==="?"?this.indentate(s)+"<"+t+e+"?"+this.tagEndChar:this.indentate(s)+"<"+t+e+"/"+this.tagEndChar}function ut(n,t,e,s){if(this.options.cdataPropName!==!1&&t===this.options.cdataPropName)return this.indentate(s)+``+this.newLine;if(this.options.commentPropName!==!1&&t===this.options.commentPropName)return this.indentate(s)+``+this.newLine;{let i=this.options.tagValueProcessor(t,n);return i=this.replaceEntitiesValue(i),i===""&&this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode?this.indentate(s)+"<"+t+this.tagEndChar:this.indentate(s)+"<"+t+"/"+this.tagEndChar:this.indentate(s)+"<"+t+e+">"+i+"0&&this.options.processEntities)for(let t=0;t65535&&(n-=65536,t+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),t+=String.fromCharCode(n),t};function bi(n){var t;return n>=55296&&n<=57343||n>1114111?65533:(t=_i.get(n))!==null&&t!==void 0?t:n}function wi(n){return yi(bi(n))}var R;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.To_LOWER_BIT=32]="To_LOWER_BIT"})(R||(R={}));var X;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(X||(X={}));function Ri(n){return function(e,s){let i="",o=0,r=0;for(;(r=e.indexOf("&",r))>=0;){if(i+=e.slice(o,r),o=r,r+=1,e.charCodeAt(r)===R.NUM){let d=r+1,p=10,g=e.charCodeAt(d);(g|R.To_LOWER_BIT)===R.LOWER_X&&(p=16,r+=1,d+=1);do g=e.charCodeAt(++r);while(g>=R.ZERO&&g<=R.NINE||p===16&&(g|R.To_LOWER_BIT)>=R.LOWER_A&&(g|R.To_LOWER_BIT)<=R.LOWER_F);if(d!==r){const A=e.substring(d,r),N=parseInt(A,p);if(e.charCodeAt(r)===R.SEMI)r+=1;else if(s)continue;i+=wi(N),o=r}continue}let a=0,c=1,u=0,f=n[u];for(;r>14)-1;if(p===0)break;u+=p}}if(a!==0){const d=(n[a]&X.VALUE_LENGTH)>>14;i+=d===1?String.fromCharCode(n[a]&~X.VALUE_LENGTH):d===2?String.fromCharCode(n[a+1]):String.fromCharCode(n[a+1],n[a+2]),o=r-c+1}}return i+e.slice(o)}}function xi(n,t,e,s){const i=(t&X.BRANCH_LENGTH)>>7,o=t&X.JUMP_TABLE;if(i===0)return o!==0&&s===o?e:-1;if(o){const c=s-o;return c<0||c>=i?-1:n[e+c]-1}let r=e,a=r+i-1;for(;r<=a;){const c=r+a>>>1,u=n[c];if(us)a=c-1;else return n[c+i]}return-1}const Fi=Ri(Oi);function Pi(n){return Fi(n,!0)}class Mi{constructor(){T(this,"x2jOptions",{attributeNamePrefix:"",removeNSPrefix:!0,ignoreAttributes:!1,parseAttributeValue:!0,processEntities:!1,attributeValueProcessor:(t,e)=>Pi(e)});T(this,"xmlParser",new Li.XMLParser(this.x2jOptions))}parse(t){let e;try{e=this.xmlParser.parse(t)}catch{throw new Error("XML parsing failed. Invalid BPMN source.")}if(!e.definitions)throw new Error("XML parsing failed. Unable to retrieve 'definitions' from the BPMN source.");return e}}class ne{}class ki{warning(t){const e=t.getMessage();console.warn(e.template,...e.arguments)}}class Bi extends ne{constructor(t,e){super(),this.groupBpmnElementId=t,this.categoryValueRef=e}getMessage(){return{arguments:[this.categoryValueRef,this.groupBpmnElementId],template:"Group json deserialization: unable to find category value ref %s for bpmn element %s"}}}class Gi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Shape json deserialization: unable to find bpmn element with id %s"}}}class Vi extends ne{constructor(t){super(),this.bpmnElementId=t}getMessage(){return{arguments:[this.bpmnElementId],template:"Edge json deserialization: unable to find bpmn element with id %s"}}}class Yi extends ne{constructor(t,e){super(),this.shapeOrEdgeId=t,this.labelStyleId=e}getMessage(){return{arguments:[this.labelStyleId,this.shapeOrEdgeId],template:"Unable to assign font from style %s to shape/edge %s"}}}class Ui extends ne{constructor(t,e){super(),this.laneId=t,this.flowNodeRef=e}getMessage(){return{arguments:[this.flowNodeRef,this.laneId],template:"Unable to assign lane %s as parent: flow node %s is not found"}}}class Wi extends ne{constructor(t,e,s){super(),this.bpmnElementId=t,this.attachedToRef=e,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 Hi{constructor(){T(this,"poolsById",new Map);T(this,"poolsByProcessRef",new Map);T(this,"messageFlows",new Map);T(this,"flowNodes",new Map);T(this,"lanes",new Map);T(this,"sequenceFlows",new Map);T(this,"associationFlows",new Map);T(this,"eventDefinitionsOfDefinitions",new Map);T(this,"globalTasks",new Map);T(this,"categoryValues",new Map)}findPoolById(t){return this.poolsById.get(t)}findPoolByProcessRef(t){return this.poolsByProcessRef.get(t)}registerPool(t,e){this.poolsById.set(t.id,t),e&&this.poolsByProcessRef.set(e,t)}findMessageFlow(t){return this.messageFlows.get(t)}registerMessageFlow(t){this.messageFlows.set(t.id,t)}findFlowNode(t){return this.flowNodes.get(t)}registerFlowNode(t){this.flowNodes.set(t.id,t)}findLane(t){return this.lanes.get(t)}registerLane(t){this.lanes.set(t.id,t)}findSequenceFlow(t){return this.sequenceFlows.get(t)}registerSequenceFlow(t){this.sequenceFlows.set(t.id,t)}findAssociationFlow(t){return this.associationFlows.get(t)}registerAssociationFlow(t){this.associationFlows.set(t.id,t)}findEventDefinitionOfDefinition(t){return this.eventDefinitionsOfDefinitions.get(t)}registerEventDefinitionsOfDefinition(t,e){this.eventDefinitionsOfDefinitions.set(t,e)}findGlobalTask(t){return this.globalTasks.get(t)}registerGlobalTask(t,e){this.globalTasks.set(t,e)}findCategoryValue(t){return this.categoryValues.get(t)}registerCategoryValue(t,e){this.categoryValues.set(t,{value:e})}}const bt=(n,t,e,s)=>{const i=n.findCategoryValue(e.categoryValueRef);if(i)return new G(e.id,i.value,h.GROUP,s);t.warning(new Bi(e.id,e.categoryValueRef))};class Ki{constructor(t,e){this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){S(t).forEach(e=>this.parseCollaboration(e))}parseCollaboration(t){this.buildParticipant(t.participant),this.buildMessageFlows(t.messageFlow),this.buildGroups(t.group)}buildParticipant(t){S(t).forEach(e=>this.convertedElements.registerPool(new G(e.id,e.name,h.POOL),e.processRef))}buildMessageFlows(t){S(t).forEach(e=>this.convertedElements.registerMessageFlow(new mt(e.id,e.name,e.sourceRef,e.targetRef)))}buildGroups(t){S(t).forEach(e=>{const s=bt(this.convertedElements,this.parsingMessageCollector,e);s&&this.convertedElements.registerFlowNode(s)})}}class Di{constructor(t,e){T(this,"defaultSequenceFlowIds",[]);T(this,"elementsWithoutParentByProcessId",new Map);T(this,"callActivitiesCallingProcess",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){S(t).forEach(e=>this.parseProcess(e)),S(t).forEach(e=>this.assignParentOfProcessElementsCalledByCallActivity(e.id))}assignParentOfProcessElementsCalledByCallActivity(t){const e=this.callActivitiesCallingProcess.get(t);if(e){const s=this.convertedElements.findPoolByProcessRef(t);s&&(s.parentId=e.id),this.elementsWithoutParentByProcessId.get(t).forEach(i=>{i.parentId=e.id})}}parseProcess(t){const e=t.id,s=this.convertedElements.findPoolByProcessRef(e);s&&!s.name&&this.convertedElements.registerPool(new G(s.id,t.name,h.POOL),e),this.buildProcessInnerElements(t,s==null?void 0:s.id)}buildProcessInnerElements(t,e){this.elementsWithoutParentByProcessId.set(t.id,[]),I.flowNodeKinds().filter(s=>s!=h.EVENT_BOUNDARY).forEach(s=>this.buildFlowNodeBpmnElements(t[s],s,e,t.id)),this.buildFlowNodeBpmnElements(t.boundaryEvent,h.EVENT_BOUNDARY,e,t.id),this.buildLaneBpmnElements(t[h.LANE],e,t.id),this.buildLaneSetBpmnElements(t.laneSet,e,t.id),this.buildSequenceFlows(t.sequenceFlow),this.buildAssociationFlows(t.association)}buildFlowNodeBpmnElements(t,e,s,i){S(t).forEach(o=>{let r;if(I.isEvent(e))r=this.buildShapeBpmnEvent(o,e,s);else if(I.isActivity(e))r=this.buildShapeBpmnActivity(o,e,s);else if(e==h.GATEWAY_EVENT_BASED){const c=o;r=new At(o.id,c.name,s,c.instantiate,le[c.eventGatewayType])}else if(e==h.GROUP)r=bt(this.convertedElements,this.parsingMessageCollector,o,s);else{const c=e===h.TEXT_ANNOTATION?o.text:o.name;r=new G(o.id,c,e,s,o.instantiate)}const a=o.default;I.isWithDefaultSequenceFlow(e)&&a&&this.defaultSequenceFlowIds.push(a),r&&(this.convertedElements.registerFlowNode(r),s||this.elementsWithoutParentByProcessId.get(i).push(r))})}buildShapeBpmnActivity(t,e,s){const i=zi(t);return I.isSubProcess(e)?this.buildShapeBpmnSubProcess(t,s,i):I.isCallActivity(e)?this.buildShapeBpmnCallActivity(t,s,i):new Ce(t.id,t.name,e,s,t.instantiate,i)}buildShapeBpmnCallActivity(t,e,s){const i=this.convertedElements.findGlobalTask(t.calledElement);if(!i){const o=new ue(t.id,t.name,ae.CALLING_PROCESS,e,s);return this.callActivitiesCallingProcess.set(t.calledElement,o),o}return new ue(t.id,t.name,ae.CALLING_GLOBAL_TASK,e,s,i)}buildShapeBpmnEvent(t,e,s){const i=this.getEventDefinitions(t),o=i.map(r=>r.counter).reduce((r,a)=>r+a,0);if(o==0&&I.canHaveNoneEvent(e))return new de(t.id,t.name,e,b.NONE,s);if(o==1){const r=i[0].kind;return I.isBoundaryEvent(e)?this.buildShapeBpmnBoundaryEvent(t,r):I.isStartEvent(e)?new St(t.id,t.name,r,s,t.isInterrupting):new de(t.id,t.name,e,r,s)}}buildShapeBpmnBoundaryEvent(t,e){const s=this.convertedElements.findFlowNode(t.attachedToRef);if(I.isActivity(s==null?void 0:s.kind))return new It(t.id,t.name,e,t.attachedToRef,t.cancelActivity);this.parsingMessageCollector.warning(new Wi(t.id,t.attachedToRef,s==null?void 0:s.kind))}getEventDefinitions(t){const e=new Map;return ft.forEach(s=>{const i=t[s+"EventDefinition"],o=S(i,!0).length;e.set(s,o)}),S(t.eventDefinitionRef).forEach(s=>{const i=this.convertedElements.findEventDefinitionOfDefinition(s);e.set(i,e.get(i)+1)}),Array.from(e.keys()).map(s=>({kind:s,counter:e.get(s)})).filter(s=>s.counter>0)}buildShapeBpmnSubProcess(t,e,s){const i=t.triggeredByEvent?ge.EVENT:ge.EMBEDDED,o=new pe(t.id,t.name,i,e,s);return this.buildProcessInnerElements(t,t.id),o}buildLaneSetBpmnElements(t,e,s){S(t).forEach(i=>this.buildLaneBpmnElements(i.lane,e,s))}buildLaneBpmnElements(t,e,s){S(t).forEach(i=>{var r;const o=new G(i.id,i.name,h.LANE,e);this.convertedElements.registerLane(o),e||this.elementsWithoutParentByProcessId.get(s).push(o),this.assignParentOfLaneFlowNodes(i),(r=i.childLaneSet)!=null&&r.lane&&this.buildLaneBpmnElements(i.childLaneSet.lane,i.id,s)})}assignParentOfLaneFlowNodes(t){S(t.flowNodeRef).forEach(e=>{const s=this.convertedElements.findFlowNode(e),i=t.id;s?I.isBoundaryEvent(s.kind)||(s.parentId=i):this.parsingMessageCollector.warning(new Ui(i,e))})}buildSequenceFlows(t){S(t).forEach(e=>{const s=this.getSequenceFlowKind(e);this.convertedElements.registerSequenceFlow(new Et(e.id,e.name,e.sourceRef,e.targetRef,s))})}buildAssociationFlows(t){S(t).forEach(e=>{const s=e.associationDirection;this.convertedElements.registerAssociationFlow(new Ct(e.id,void 0,e.sourceRef,e.targetRef,s))})}getSequenceFlowKind(t){if(this.defaultSequenceFlowIds.includes(t.id))return B.DEFAULT;{const e=this.convertedElements.findFlowNode(t.sourceRef);if(e&&I.isWithDefaultSequenceFlow(e.kind)&&t.conditionExpression)return I.isActivity(e.kind)?B.CONDITIONAL_FROM_ACTIVITY:B.CONDITIONAL_FROM_GATEWAY}return B.NORMAL}}const zi=n=>{const t=[],e=n.standardLoopCharacteristics,s=S(n.multiInstanceLoopCharacteristics,!0)[0];return e||e===""?t.push(y.LOOP):s&&s.isSequential?t.push(y.MULTI_INSTANCE_SEQUENTIAL):(s&&!s.isSequential||s==="")&&t.push(y.MULTI_INSTANCE_PARALLEL),t};class $i{constructor(t,e,s,i){this.x=t,this.y=e,this.width=s,this.height=i}}class Xi{constructor(t,e,s,i,o=Q.NONE){this.id=t,this.bpmnElement=e,this.waypoints=s,this.label=i,this.messageVisibleKind=o}}class Zi{constructor(t,e){this.x=t,this.y=e}}class ji{constructor(t,e){this.font=t,this.bounds=e}}class qi{constructor(t,e,s,i,o,r){this.name=t,this.size=e,this.isBold=s,this.isItalic=i,this.isUnderline=o,this.isStrikeThrough=r}}class Ee{constructor(t,e){T(this,"convertedFonts",new Map);this.convertedElements=t,this.parsingMessageCollector=e}deserialize(t){const e=[],s=[],i=[],o=[],r=S(t)[0];if(r){this.deserializeFonts(r.BPMNLabelStyle);const a=r.BPMNPlane,c=this.deserializeEdges(a.BPMNEdge),u=this.deserializeShapes(a.BPMNShape);e.push(...u.flowNodes),s.push(...u.lanes),i.push(...u.pools),o.push(...c)}return{flowNodes:e,lanes:s,pools:i,edges:o}}deserializeFonts(t){this.convertedFonts=new Map,S(t).forEach(e=>S(e.Font).forEach(s=>this.convertedFonts.set(e.id,new qi(s.name,s.size,s.isBold,s.isItalic,s.isUnderline,s.isStrikeThrough))))}deserializeShapes(t){const e={flowNodes:[],lanes:[],pools:[]};return S(t).forEach(s=>{this.deserializeShapeAndStoreIfFound(s,e.flowNodes,i=>this.convertedElements.findFlowNode(i))||this.deserializeShapeAndStoreIfFound(s,e.lanes,i=>this.convertedElements.findLane(i))||this.deserializeShapeAndStoreIfFound(s,e.pools,i=>this.convertedElements.findPoolById(i))||this.parsingMessageCollector.warning(new Gi(s.bpmnElement))}),e}deserializeShapeAndStoreIfFound(t,e,s){const i=this.deserializeShape(t,s);return i?(e.push(i),!0):!1}deserializeShape(t,e){const s=e(t.bpmnElement);if(s){const i=Ee.deserializeBounds(t);(s instanceof pe||s instanceof ue&&s.callActivityKind===ae.CALLING_PROCESS)&&!t.isExpanded&&s.markers.push(y.EXPAND);let o;I.isPoolOrLane(s.kind)&&(o=t.isHorizontal!==void 0?t.isHorizontal:!0);const r=this.deserializeLabel(t.BPMNLabel,t.id);return new fe(t.id,s,i,r,o)}}static deserializeBounds(t){const e=t.Bounds;if(e)return new $i(e.x,e.y,e.width,e.height)}deserializeEdges(t){return S(t).map(e=>{const s=this.convertedElements.findSequenceFlow(e.bpmnElement)||this.convertedElements.findMessageFlow(e.bpmnElement)||this.convertedElements.findAssociationFlow(e.bpmnElement);if(!s){this.parsingMessageCollector.warning(new Vi(e.bpmnElement));return}const i=this.deserializeWaypoints(e.waypoint),o=this.deserializeLabel(e.BPMNLabel,e.id),r=e.messageVisibleKind?e.messageVisibleKind:Q.NONE;return new Xi(e.id,s,i,o,r)}).filter(Boolean)}deserializeWaypoints(t){return S(t).map(e=>new Zi(e.x,e.y))}deserializeLabel(t,e){if(t&&typeof t=="object"){const s=this.findFont(t.labelStyle,e),i=Ee.deserializeBounds(t);if(s||i)return new ji(s,i)}}findFont(t,e){let s;return t&&(s=this.convertedFonts.get(t),s||this.parsingMessageCollector.warning(new Yi(e,t))),s}}class Ji{constructor(t){this.convertedElements=t}deserialize(t){ft.forEach(e=>{const s=t[e+"EventDefinition"];S(s,!0).forEach(i=>this.convertedElements.registerEventDefinitionsOfDefinition(i.id,e))})}}class Qi{constructor(t){this.convertedElements=t}deserialize(t){this.parseGlobalTasks(t.globalTask,h.GLOBAL_TASK),this.parseGlobalTasks(t.globalBusinessRuleTask,h.GLOBAL_TASK_BUSINESS_RULE),this.parseGlobalTasks(t.globalManualTask,h.GLOBAL_TASK_MANUAL),this.parseGlobalTasks(t.globalScriptTask,h.GLOBAL_TASK_SCRIPT),this.parseGlobalTasks(t.globalUserTask,h.GLOBAL_TASK_USER)}parseGlobalTasks(t,e){S(t).forEach(s=>this.convertedElements.registerGlobalTask(s.id,e))}}class eo{constructor(t){this.convertedElements=t}deserialize(t){S(t.category).forEach(e=>S(e.categoryValue).forEach(s=>this.convertedElements.registerCategoryValue(s.id,s.value)))}}class to{constructor(t,e,s,i,o,r){this.categoryConverter=t,this.collaborationConverter=e,this.eventDefinitionConverter=s,this.globalTaskConverter=i,this.processConverter=o,this.diagramConverter=r}parse(t){const e=t.definitions;return this.categoryConverter.deserialize(e),this.collaborationConverter.deserialize(e.collaboration),this.eventDefinitionConverter.deserialize(e),this.globalTaskConverter.deserialize(e),this.processConverter.deserialize(e.process),this.diagramConverter.deserialize(e.BPMNDiagram)}}function no(n){const t=new Hi;return new to(new eo(t),new Ki(t,n),new Ji(t),new Qi(t),new Di(t,n),new Ee(t,n))}class so{constructor(t,e){this.jsonParser=t,this.xmlParser=e}parse(t){const e=this.xmlParser.parse(t);return this.jsonParser.parse(e)}}function io(){return new so(no(new ki),new Mi)}class oo{constructor(){T(this,"classNamesByBPMNId",new Map)}clear(){this.classNamesByBPMNId.clear()}getClassNames(t){var e;return Array.from((e=this.classNamesByBPMNId.get(t))!=null?e:[])}addClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.add(i))}removeClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.delete(i))}toggleClassNames(t,e){return this.updateClassNames(t,e,(s,i)=>s.has(i)?s.delete(i):s.add(i)),e&&e.length>0}updateClassNames(t,e,s){const i=this.getOrInitializeClassNames(t),o=i.size;return S(e).forEach(r=>s(i,r)),i.size!=o}getOrInitializeClassNames(t){let e=this.classNamesByBPMNId.get(t);return e==null&&(e=new Set,this.classNamesByBPMNId.set(t,e)),e}}class ze{constructor(){T(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(t){const e=this.convertPosition(t),s=ze.convertStyle(t);return{position:e,style:s}}convertPosition(t){return this.overlayPositions.get(t.position)}static convertStyle(t){const e={fill:{color:m.DEFAULT_OVERLAY_FILL_COLOR.valueOf(),opacity:m.DEFAULT_OVERLAY_FILL_OPACITY.valueOf()},stroke:{color:m.DEFAULT_OVERLAY_STROKE_COLOR.valueOf(),width:m.DEFAULT_OVERLAY_STROKE_WIDTH.valueOf()},font:{color:m.DEFAULT_OVERLAY_FONT_COLOR.valueOf(),size:m.DEFAULT_OVERLAY_FONT_SIZE.valueOf()}},s=t.style,i={...e};return s&&(this.convertFill(i,s.fill),this.convertStroke(i,s.stroke),this.convertFont(i,s.font)),i}static convertFill(t,e){var s,i;e&&(t.fill.color=(s=e.color)!=null?s:t.fill.color,t.fill.opacity=(i=e.opacity)!=null?i:t.fill.opacity)}static convertStroke(t,e){var s,i;e&&(t.stroke.color=(s=e.color)!=null?s:t.stroke.color,t.stroke.width=(i=e.width)!=null?i:t.stroke.width)}static convertFont(t,e){var s,i;e&&(t.font.color=(s=e.color)!=null?s:t.font.color,t.font.size=(i=e.size)!=null?i:t.font.size)}}function ro(n){return new ao(n,new ze)}class ao{constructor(t,e){this.graph=t,this.overlayConverter=e}updateAndRefreshCssClassesOfCell(t,e){this.updateAndRefreshCssClassesOfElement(t,e),this.updateAndRefreshCssClassesOfElement(Nt(t),e)}updateAndRefreshCssClassesOfElement(t,e){var r;const s=this.graph.getModel().getCell(t);if(!s)return;const o=this.graph.getView().getState(s);o.style[E.EXTRA_CSS_CLASSES]=e,o.shape.redraw(),(r=o.text)==null||r.redraw()}addOverlays(t,e){const s=this.graph.getModel().getCell(t);!s||S(e).forEach(i=>{const o=new Tt(i.label,this.overlayConverter.convert(i));this.graph.addCellOverlay(s,o)})}removeAllOverlays(t){const e=this.graph.getModel().getCell(t);!e||this.graph.removeCellOverlays(e)}}class lo{constructor(t){this.containerId=t}element(t){return`#${this.containerId} > svg > g > g > g[data-bpmn-id="${t}"]`}elementsOfKind(t){return`#${this.containerId} > svg > g > g > g.${t}:not(.bpmn-label)`}}function co(n,t){var e;return new uo(n,new ho(new lo((e=t.container)==null?void 0:e.id)),new oo,ro(t))}class uo{constructor(t,e,s,i){this.bpmnModelRegistry=t,this.htmlElementRegistry=e,this.cssRegistry=s,this.graphCellUpdater=i,this.bpmnModelRegistry.registerOnLoadCallback(this.cssRegistry.clear.bind(this.cssRegistry))}getElementsByIds(t){return S(t).map(e=>this.bpmnModelRegistry.getBpmnSemantic(e)).filter(Boolean).map(e=>({bpmnSemantic:e,htmlElement:this.htmlElementRegistry.getBpmnHtmlElement(e.id)}))}getElementsByKinds(t){return S(t).map(e=>this.htmlElementRegistry.getBpmnHtmlElements(e).map(s=>({htmlElement:s,bpmnSemantic:this.bpmnModelRegistry.getBpmnSemantic(s.getAttribute("data-bpmn-id"))}))).reduce((e,s)=>(e.push(...s),e),[])}addCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.addClassNames.bind(this.cssRegistry))}removeCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.removeClassNames.bind(this.cssRegistry))}toggleCssClasses(t,e){this.updateCssClasses(t,e,this.cssRegistry.toggleClassNames.bind(this.cssRegistry))}updateCssClasses(t,e,s){const i=S(e);S(t).forEach(o=>this.updateCellIfChanged(s(o,i),o))}updateCellIfChanged(t,e){if(t){const s=this.cssRegistry.getClassNames(e);this.graphCellUpdater.updateAndRefreshCssClassesOfCell(e,s)}}addOverlays(t,e){this.graphCellUpdater.addOverlays(t,e)}removeAllOverlays(t){this.graphCellUpdater.removeAllOverlays(t)}}class ho{constructor(t){this.querySelectors=t}getBpmnHtmlElement(t){return document.querySelector(this.querySelectors.element(t))}getBpmnHtmlElements(t){const e=this.querySelectors.elementsOfKind(ye(t));return[...document.querySelectorAll(e)]}}class fo{filter(t,e){const s=[],i=[];if(S(e==null?void 0:e.pools).filter(g=>g&&Object.keys(g).length).forEach(g=>g.id?s.push(g.id):g.name&&i.push(g.name)),s.length==0&&i.length==0)return t;const{filteredPools:o,filteredPoolIds:r}=go(t,s,i),a=[...s,...r],{filteredLanes:c,filteredLaneIds:u,filteredFlowNodes:f,filteredFlowNodeIds:d}=wt(t.lanes,t.flowNodes,a),p=po(t.edges,[...a,...u,...d]);if(o.length==0&&c.length==0&&f.length==0&&p.length==0){let g=s.length>0?` for ids [${s}]`:"";const A=g?" and":"";throw g+=i.length>0?`${A} for names [${i}]`:"",new Error("No matching pools"+g)}return{lanes:c,flowNodes:f,pools:o,edges:p}}}function go(n,t,e){const s=n.pools.filter(o=>t.includes(o.bpmnElement.id)||e.includes(o.bpmnElement.name)),i=s.map(o=>o.bpmnElement.id);return{filteredPools:s,filteredPoolIds:i}}function wt(n,t,e){const{filteredLanes:s,filteredLaneIds:i}=Rt(n,e),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:a,filteredFlowNodeIds:c}=To(t,[...e,...i],n);return s.push(...o),i.push(...r),{filteredLanes:s,filteredLaneIds:i,filteredFlowNodes:a,filteredFlowNodeIds:c}}function Rt(n,t){const e=n.filter(i=>t.includes(i.bpmnElement.parentId)),s=e.map(i=>i.bpmnElement.id);if(e.length>0){const{filteredLanes:i,filteredLaneIds:o}=Rt(n,s);e.push(...i),s.push(...o)}return{filteredLanes:e,filteredLaneIds:s}}function To(n,t,e){const s=n.filter(u=>t.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}=wt(e,n,i);return s.push(...a),i.push(...c),{filteredLanes:o,filteredLaneIds:r,filteredFlowNodes:s,filteredFlowNodeIds:i}}function po(n,t){return n.filter(e=>t.includes(e.bpmnElement.sourceRefId)&&t.includes(e.bpmnElement.targetRefId))}class Eo{constructor(){T(this,"searchableModel");T(this,"onLoadCallback")}load(t,e){var i;const s=new fo().filter(t,e);return this.searchableModel=new Co(s),(i=this.onLoadCallback)==null||i.call(this),mo(s)}registerOnLoadCallback(t){this.onLoadCallback=t}getBpmnSemantic(t){const e=this.searchableModel.elementById(t);if(!e)return;const s=e.bpmnElement,i=s instanceof G;return{id:t,name:s.name,isShape:i,kind:s.kind}}}function mo(n){const t=n.flowNodes.filter(o=>{const r=o.bpmnElement;return I.isSubProcess(r.kind)&&r.markers.includes(y.EXPAND)}).map(o=>o.bpmnElement.id),e=[],s=[],i=[];return n.flowNodes.forEach(o=>{const r=o.bpmnElement.kind;I.isSubProcess(r)?e.push(o):I.isBoundaryEvent(r)?s.push(o):t.includes(o.bpmnElement.parentId)||i.push(o)}),{boundaryEvents:s,edges:n.edges,lanes:n.lanes,otherFlowNodes:i,pools:n.pools,subprocesses:e}}class Co{constructor(t){T(this,"elements",new Map);[].concat(t.pools,t.lanes,t.flowNodes,t.edges).forEach(e=>this.elements.set(e.bpmnElement.id,e))}elementById(t){return this.elements.get(t)}}function So(n){return n instanceof HTMLElement?n:document.getElementById(n)}class Io{constructor(t){this.graph=t}fit(t){this.graph.customFit(t)}zoom(t){t=="in"?this.graph.zoomIn():this.graph.zoomOut()}}const Ao="0.26.1",No=()=>({lib:Ao,dependencies:new Map([["mxGraph",l.mxClient.VERSION]])});class vo{constructor(t){T(this,"graph");T(this,"navigation");T(this,"bpmnElementsRegistry");T(this,"bpmnModelRegistry");const e=new us(So(t==null?void 0:t.container));this.graph=e.configure(t),this.navigation=new Io(this.graph),this.bpmnModelRegistry=new Eo,this.bpmnElementsRegistry=co(this.bpmnModelRegistry,this.graph)}load(t,e){const s=io().parse(t),i=this.bpmnModelRegistry.load(s,e==null?void 0:e.modelFilter);fs(this.graph).render(i,e==null?void 0:e.fit)}fit(t){this.navigation.fit(t)}getVersion(){return No()}}const Lo=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 Oo extends vo{configureTheme(t){var f,d;if(t=="default")return new ce(this.graph).configureStyles(),!0;const e=Lo.get(t);if(!e)return!1;const s=this.graph.getStylesheet();I.eventKinds().forEach(p=>{var P;let g,A;switch(p){case"endEvent":g=e.endEventFillColor,A=e.endEventStrokeColor;break;case"startEvent":g=e.startEventFillColor,A=e.startEventStrokeColor;break;case"intermediateCatchEvent":case"intermediateThrowEvent":case"boundaryEvent":g=e.defaultFillColor,A=(P=e.catchAndThrowEventStrokeColor)!=null?P:e.defaultStrokeColor;break;default:g=e.defaultFillColor,A=e.defaultStrokeColor;break}const N=s.styles[p];N.fillColor=g,N.strokeColor=A}),I.taskKinds().forEach(p=>{const g=s.styles[p];g.fillColor=e.taskAndCallActivityFillColor});const i=s.styles[h.CALL_ACTIVITY];i.fillColor=e.taskAndCallActivityFillColor;const o=s.styles[h.TEXT_ANNOTATION];o.fillColor=(f=e.textAnnotationFillColor)!=null?f:m.TEXT_ANNOTATION_FILL_COLOR;const r=s.styles[h.POOL];r.fillColor=e.poolFillColor,r.swimlaneFillColor=e.defaultFillColor;const a=s.styles[h.LANE];a.fillColor=e.laneFillColor;const c=s.getDefaultVertexStyle();c.fontColor=e.defaultFontColor,c.fillColor=e.defaultFillColor,c.strokeColor=e.defaultStrokeColor;const u=s.getDefaultEdgeStyle();return u.fontColor=e.defaultFontColor,u.fillColor=e.defaultFillColor,u.strokeColor=(d=e.flowColor)!=null?d:e.defaultStrokeColor,!0}configureSequenceFlowColor(t){Y(`Use dedicated ${t} color for sequence flows`);const s=this.graph.getStylesheet().styles[k.SEQUENCE_FLOW];s[l.mxConstants.STYLE_STROKECOLOR]=t,s[l.mxConstants.STYLE_FILLCOLOR]=t,Y("Sequence flows style updated")}}let O,W={},$e,Xe;function Bo(n){L("Updating load options",n),W.fit=n,L("Load options updated!",Fe(W))}function Go(){return{...W}}function Vo(){return Xe}function Yo(n){L("Switching theme from %s to %s",Xe,n),O.configureTheme(n)&&(O.graph.refresh(),L("Theme switch done"))}function xt(n){L("Loading bpmn...");try{O.load(n,W),L("BPMN loaded with configuration",Fe(W)),_o($e),document.dispatchEvent(new CustomEvent("diagramLoaded"))}catch(t){Me(t,`Cannot load the BPMN diagram: ${t.message}`)}}function Uo(n){L("Fitting..."),O.navigation.fit(n),L("Fit done with configuration",Fe(n))}function Wo(n){L(`Zooming '${n}'...`),O.navigation.zoom(n),L("Zoom done")}function Ho(n){return O.bpmnElementsRegistry.getElementsByKinds(n)}function Ko(n,t){return O.bpmnElementsRegistry.addCssClasses(n,t)}function Do(n,t){return O.bpmnElementsRegistry.removeCssClasses(n,t)}function zo(n,t){return O.bpmnElementsRegistry.addOverlays(n,[t])}function $o(n){return O.bpmnElementsRegistry.removeAllOverlays(n)}function _o(n){if(!$e)return;L("Updating model, bpmnElement to collapse:",n);const t=O.graph.getModel(),e=t.getCell(n);if(!e)L("Element not found in the model, do nothing");else{t.beginUpdate();try{t.setCollapsed(e,!0)}finally{t.endUpdate()}L("Model updated")}}function Ft(n){const t=new FileReader;t.onload=()=>{xt(t.result)},t.readAsText(n)}function Xo(n){const t=n.target.files[0];Ft(t)}function yo(n,t){Bt(n).catch(e=>{const s=`Unable to fetch ${n}. ${e}`;throw t(s),new Error(s)}).then(e=>(L("BPMN content fetched"),e)).then(e=>{xt(e),L(`Bpmn loaded from url ${n}`)}).catch(()=>{})}function bo(n){Me(n)}function wo(n,t){var o;const e=((o=n.loadOptions)==null?void 0:o.fit)||{},s=t.get("fitTypeOnLoad");s&&(e.type=s);const i=t.get("fitMargin");return i&&(e.margin=Number(i)),e}function Ro(n){if(n.get("style.container.alternative.background.color")=="true"){const o="yellow";Y("Use alternative color for the bpmn container background, color",o);const r=O.graph.container;r.style.backgroundColor=o,Y("Bpmn container style updated")}const e=n.get("style.theme");Y(`Configuring the '${e}' BPMN theme`),O.configureTheme(e)?(Xe=e,Y(`'${e}' BPMN theme configured`)):Y(`Unknown '${e}' BPMN theme, skipping configuration`),n.get("style.seqFlow.light.colors")=="true"&&O.configureSequenceFlowColor("#E9E9E9")}function xo(n){$e=n.get("bpmn.element.id.collapsed")}function Fo(n){const t=n.get("bpmn.filter.pool.ids");if(!t)return;const e=t.split(",");return L("Configuring load options to only include pool id: ",e),{pools:e.map(s=>({id:s}))}}function Zo(n){const t=Y,e=n.globalOptions.container;t(`Initializing BpmnVisualization with container '${e}'...`),O=new Oo(n.globalOptions),t("Initialization completed"),new Gt(window,"drop-container",e,Ft),t("Drag&Drop support initialized");const s=new URLSearchParams(window.location.search);t("Configuring Load Options"),W=n.loadOptions||{},W.fit=wo(n,s),W.modelFilter=Fo(s),Ro(s),xo(s),t("Checking if an 'url to fetch BPMN content' is provided as query parameter");const i=s.get("url");if(i){const o=decodeURIComponent(i),r=n.statusFetchKoNotifier||bo;yo(o,r);return}t("No 'url to fetch BPMN content' provided")}function jo(){q("Trigger SVG Download"),Ut(new dt(O.graph).exportSvg())}function qo(){q("Trigger PNG Download"),Wt(new dt(O.graph).exportSvgForPng())}function Jo(){const n=O.getVersion();return L("Version:",n),n}export{re as F,I as S,Ht as Z,Yo as a,Jo as b,Vo as c,ko as d,$o as e,Uo as f,Go as g,Xo as h,jo as i,qo as j,Ho as k,L as l,Ko as m,zo as n,Do as r,Zo as s,Bo as u,Wo as z}; diff --git a/demo/monitoring-all-process-instances/index.html b/demo/monitoring-all-process-instances/index.html index fc87854b..dd871218 100644 --- a/demo/monitoring-all-process-instances/index.html +++ b/demo/monitoring-all-process-instances/index.html @@ -25,7 +25,7 @@ - + diff --git a/demo/predictions/index.html b/demo/predictions/index.html index 61da41ed..c66238a6 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 dab0371f..b22070a7 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 25e6691e..ef930ae6 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 b9f2dfb0..48fa6a8e 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 54992e3d..f99716ac 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 cb392b9d..2e124b3d 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 d2c40d09..f5f1d7ba 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 e329e459..cb558b2d 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 233bf235..996c8d35 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 9fedfef2..a6da073f 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 d185e97d..4301800b 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 6972ecfd..62b4a08a 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 861a27bb..aa2615a9 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 7fedc168..cc004d1f 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 fe7f88b2..714f2017 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 28d34387..f4c6e363 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/01-getting-started/README.md b/examples/display-bpmn-diagram/01-getting-started/README.md index 7c52ffd6..5d454fe0 100644 --- a/examples/display-bpmn-diagram/01-getting-started/README.md +++ b/examples/display-bpmn-diagram/01-getting-started/README.md @@ -10,12 +10,12 @@ Javascript example to demonstrate how to integrate `bpmn-visualization` in an ht Load the browser bundle from [jsdelivr](https://www.jsdelivr.com/package/npm/bpmn-visualization), [unpkg](https://unpkg.com/browse/bpmn-visualization) or any other location: ```html - + ``` 💡 During the development step, you can use the non-minified version: ```html - + ``` ### Use the library diff --git a/examples/display-bpmn-diagram/01-getting-started/index.html b/examples/display-bpmn-diagram/01-getting-started/index.html index b33db549..08965ccf 100644 --- a/examples/display-bpmn-diagram/01-getting-started/index.html +++ b/examples/display-bpmn-diagram/01-getting-started/index.html @@ -22,9 +22,9 @@ - + - + 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 4a81656c..45769d36 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 c68b52ba..a1ecf37f 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 9d43e079..7409fc7c 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 ff25cbaf..8cbdcab6 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 6d4b17c2..b22c04af 100644 --- a/examples/misc/compare-with-kie-editors-standalone/index.html +++ b/examples/misc/compare-with-kie-editors-standalone/index.html @@ -60,7 +60,7 @@ - + diff --git a/examples/overlays/add-remove/index.html b/examples/overlays/add-remove/index.html index 2664f8b8..db978966 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 a4abae2a..4df5e358 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 27c292aa..a9d70a5b 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 60da28d9..4c7dc5e4 100644 --- a/projects/javascript-vanilla-with-webpack/package.json +++ b/projects/javascript-vanilla-with-webpack/package.json @@ -11,7 +11,7 @@ "serve": "webpack serve" }, "dependencies": { - "bpmn-visualization": "0.26.0" + "bpmn-visualization": "0.26.1" }, "devDependencies": { "html-webpack-plugin": "~5.5.0", diff --git a/projects/typescript-vanilla-with-parcel/package.json b/projects/typescript-vanilla-with-parcel/package.json index 0ebcd876..f74b660e 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 index.html" }, "dependencies": { - "bpmn-visualization": "0.26.0" + "bpmn-visualization": "0.26.1" }, "devDependencies": { "@parcel/transformer-inline-string": "~2.7.0", diff --git a/projects/typescript-vanilla-with-rollup/package.json b/projects/typescript-vanilla-with-rollup/package.json index 4252d928..f46f6071 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.26.0" + "bpmn-visualization": "0.26.1" }, "devDependencies": { "@rollup/plugin-commonjs": "~22.0.2", diff --git a/projects/typescript-vanilla-with-vitejs/package.json b/projects/typescript-vanilla-with-vitejs/package.json index 8f1f2bdb..4d3514ef 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.26.0" + "bpmn-visualization": "0.26.1" }, "devDependencies": { "typescript": "~4.7.4",