bpmn-js 18.30.0 → 18.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! bpmn-js - bpmn-modeler v18.30.0 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
1
+ /*! bpmn-js - bpmn-modeler v18.30.1 | Copyright (c) 2014-present, camunda Services GmbH | bpmn.io/license */
2
2
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).BpmnJS=t()}(this,function(){"use strict";function e(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,i={exports:{}};var r=function(){if(n)return i.exports;n=1;var e=i.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var i=Math.log(Math.pow(2,t))/Math.log(n),r=2;i===1/0;r*=2)i=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var o=i-Math.floor(i),a="";for(r=0;r<Math.floor(i);r++){a=Math.floor(Math.random()*n).toString(n)+a}if(o){var s=Math.pow(n,o);a=Math.floor(Math.random()*s).toString(n)+a}var c=parseInt(a,n);return c!==1/0&&c>=Math.pow(2,t)?e(t,n):a};return e.rack=function(t,n,i){var r=function(r){var a=0;do{if(a++>10){if(!i)throw new Error("too many ID collisions, use more bits");t+=i}var s=e(t,n)}while(Object.hasOwnProperty.call(o,s));return o[s]=r,s},o=r.hats={};return r.get=function(e){return r.hats[e]},r.set=function(e,t){return r.hats[e]=t,r},r.bits=t||128,r.base=n||16,r},i.exports}(),o=t(r);function a(e){if(!(this instanceof a))return new a(e);e=e||[128,36,1],this._seed=e.length?o.rack(e[0],e[1],e[2]):e}function s(e){return Array.prototype.concat.apply([],e)}a.prototype.next=function(e){return this._seed(e||!0)},a.prototype.nextPrefixed=function(e,t){var n;do{n=e+this.next(!0)}while(this.assigned(n));return this.claim(n,t),n},a.prototype.claim=function(e,t){this._seed.set(e,t||!0)},a.prototype.assigned=function(e){return this._seed.get(e)||!1},a.prototype.unclaim=function(e){delete this._seed.hats[e]},a.prototype.clear=function(){var e,t=this._seed.hats;for(e in t)this.unclaim(e)};const c=Object.prototype.toString,l=Object.prototype.hasOwnProperty;function p(e){return void 0===e}function u(e){return void 0!==e}function h(e){return null==e}function d(e){return"[object Array]"===c.call(e)}function f(e){return"[object Object]"===c.call(e)}function m(e){return"[object Number]"===c.call(e)}function g(e){const t=c.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t||"[object Proxy]"===t}function y(e){return"[object String]"===c.call(e)}function v(e,t){return!h(e)&&l.call(e,t)}function b(e,t){const n=N(t);let i;return w(e,function(e,t){if(n(e,t))return i=e,!1}),i}function _(e,t){const n=N(t);let i=d(e)?-1:void 0;return w(e,function(e,t){if(n(e,t))return i=t,!1}),i}function x(e,t){const n=N(t);let i=[];return w(e,function(e,t){n(e,t)&&i.push(e)}),i}function w(e,t){let n,i;if(p(e))return;const r=d(e)?$:L;for(let o in e)if(v(e,o)&&(n=e[o],i=t(n,r(o)),!1===i))return n}function E(e,t){if(p(e))return[];!function(e){if(!d(e))throw new Error("must supply array")}(e);const n=N(t);return e.filter(function(e,t){return!n(e,t)})}function S(e,t,n){return w(e,function(e,i){n=t(n,e,i)}),n}function k(e,t){return!!S(e,function(e,n,i){return e&&t(n,i)},!0)}function C(e,t){return!!b(e,t)}function R(e,t){let n=[];return w(e,function(e,i){n.push(t(e,i))}),n}function P(e){return e&&Object.keys(e)||[]}function A(e){return R(e,e=>e)}function M(e,t,n={}){return t=O(t),w(e,function(e){let i=t(e)||"_",r=n[i];r||(r=n[i]=[]),r.push(e)}),n}function T(e,...t){e=O(e);let n={};return w(t,t=>M(t,e,n)),R(n,function(e,t){return e[0]})}const B=T;function D(e,t){t=O(t);let n=[];return w(e,function(e,i){let r=t(e,i),o={d:r,v:e};for(var a=0;a<n.length;a++){let{d:e}=n[a];if(r<e)return void n.splice(a,0,o)}n.push(o)}),R(n,e=>e.v)}function j(e){return function(t){return k(e,function(e,n){return t[n]===e})}}function O(e){return g(e)?e:t=>t[e]}function N(e){return g(e)?e:t=>t===e}function L(e){return e}function $(e){return Number(e)}function I(e,t){let n,i,r,o;function a(n){let a=Date.now(),l=n?0:o+t-a;if(l>0)return s(l);e.apply(r,i),c()}function s(e){n=setTimeout(a,e)}function c(){n&&clearTimeout(n),n=o=i=r=void 0}function l(...e){o=Date.now(),i=e,r=this,n||s(t)}return l.flush=function(){n&&a(!0),c()},l.cancel=c,l}function F(e,t){return e.bind(t)}function z(e,...t){return Object.assign(e,...t)}function H(e,t){let n={},i=Object(e);return w(t,function(t){t in i&&(n[t]=e[t])}),n}function V(e,t){let n={};return w(Object(e),function(e,i){-1===t.indexOf(i)&&(n[i]=e)}),n}const G={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:[0,"",""]};function W(e,t=globalThis.document){if("string"!=typeof e)throw new TypeError("String expected");const n=/^<!--(.*?)-->$/s.exec(e);if(n)return t.createComment(n[1]);const i=/<([\w:]+)/.exec(e)?.[1];if(!i)return t.createTextNode(e);if(e=e.trim(),"body"===i){const n=t.createElement("html");n.innerHTML=e;const{lastChild:i}=n;return i.remove(),i}let[r,o,a]=Object.hasOwn(G,i)?G[i]:G._default,s=t.createElement("div");for(s.innerHTML=o+e+a;r--;)s=s.lastChild;if(s.firstChild===s.lastChild){const{firstChild:e}=s;return e.remove(),e}const c=t.createDocumentFragment();return c.append(...s.childNodes),c}function U(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function q(e,...t){const n=e.style;return w(t,function(e){e&&w(e,function(e,t){n[t]=e})}),e}function K(e,t,n){return 2==arguments.length?e.getAttribute(t):null===n?e.removeAttribute(t):(e.setAttribute(t,n),e)}G.td=G.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],G.option=G.optgroup=[1,'<select multiple="multiple">',"</select>"],G.thead=G.tbody=G.colgroup=G.caption=G.tfoot=[1,"<table>","</table>"],G.polyline=G.ellipse=G.polygon=G.circle=G.text=G.line=G.path=G.rect=G.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"];const Y=Object.prototype.toString;function X(e){return new Z(e)}function Z(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function Q(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function J(e,t,n){var i=n?e:e.parentNode;return i&&"function"==typeof i.closest&&i.closest(t)||null}function ee(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Z.prototype.add=function(e){return this.list.add(e),this},Z.prototype.remove=function(e){return"[object RegExp]"==Y.call(e)?this.removeMatching(e):(this.list.remove(e),this)},Z.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},Z.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},Z.prototype.array=function(){return Array.from(this.list)},Z.prototype.has=Z.prototype.contains=function(e){return this.list.contains(e)};var te,ne={};var ie=function(){if(te)return ne;var e,t,n;function i(){e=window.addEventListener?"addEventListener":"attachEvent",t=window.removeEventListener?"removeEventListener":"detachEvent",n="addEventListener"!==e?"on":""}return te=1,ne.bind=function(t,r,o,a){return e||i(),t[e](n+r,o,a||!1),o},ne.unbind=function(e,r,o,a){return t||i(),e[t](n+r,o,a||!1),o},ne}(),re=U({__proto__:null,default:ee(ie)},[ie]),oe=["focus","blur"];var ae={bind:function(e,t,n,i,r){return-1!==oe.indexOf(n)&&(r=!0),re.bind(e,n,function(n){var r=n.target||n.srcElement;n.delegateTarget=J(r,t,!0),n.delegateTarget&&i.call(e,n)},r)},unbind:function(e,t,n,i){return-1!==oe.indexOf(t)&&(i=!0),re.unbind(e,t,n,i)}};function se(e,t){return e&&"function"==typeof e.matches&&e.matches(t)||!1}function ce(e,t){return(t=t||document).querySelector(e)}function le(e,t){return(t=t||document).querySelectorAll(e)}function pe(e){e.parentNode&&e.parentNode.removeChild(e)}function ue(e,t){return function(e,t){t.appendChild(function(e,t){if(e.ownerDocument!==t.ownerDocument)try{return t.ownerDocument.importNode(e,!0)}catch(e){}return e}(e,t))}(t,e),e}var he={"alignment-baseline":1,"baseline-shift":1,clip:1,"clip-path":1,"clip-rule":1,color:1,"color-interpolation":1,"color-interpolation-filters":1,"color-profile":1,"color-rendering":1,cursor:1,direction:1,display:1,"dominant-baseline":1,"enable-background":1,fill:1,"fill-opacity":1,"fill-rule":1,filter:1,"flood-color":1,"flood-opacity":1,font:1,"font-family":1,"font-size":2,"font-size-adjust":1,"font-stretch":1,"font-style":1,"font-variant":1,"font-weight":1,"glyph-orientation-horizontal":1,"glyph-orientation-vertical":1,"image-rendering":1,kerning:1,"letter-spacing":1,"lighting-color":1,marker:1,"marker-end":1,"marker-mid":1,"marker-start":1,mask:1,opacity:1,overflow:1,"pointer-events":1,"shape-rendering":1,"stop-color":1,"stop-opacity":1,stroke:1,"stroke-dasharray":1,"stroke-dashoffset":1,"stroke-linecap":1,"stroke-linejoin":1,"stroke-miterlimit":1,"stroke-opacity":1,"stroke-width":2,"text-anchor":1,"text-decoration":1,"text-rendering":1,"unicode-bidi":1,visibility:1,"word-spacing":1,"writing-mode":1};function de(e,t,n){var i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=he[i];r?(2===r&&"number"==typeof n&&(n=String(n)+"px"),e.style[i]=n):e.setAttributeNS(null,t,n)}function fe(e,t,n){if("string"==typeof t){if(void 0===n)return function(e,t){return he[t]?e.style[t]:e.getAttributeNS(null,t)}(e,t);de(e,t,n)}else!function(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)de(e,i,t[i])}(e,t);return e}const me=Object.prototype.toString;function ge(e){return new ye(e)}function ye(e){if(!e||!e.nodeType)throw new Error("A DOM element reference is required");this.el=e,this.list=e.classList}function ve(e){for(var t;t=e.firstChild;)e.removeChild(t);return e}function be(e){return e.cloneNode(!0)}ye.prototype.add=function(e){return this.list.add(e),this},ye.prototype.remove=function(e){return"[object RegExp]"==me.call(e)?this.removeMatching(e):(this.list.remove(e),this)},ye.prototype.removeMatching=function(e){const t=this.array();for(let n=0;n<t.length;n++)e.test(t[n])&&this.remove(t[n]);return this},ye.prototype.toggle=function(e,t){return void 0!==t?t!==this.list.toggle(e,t)&&this.list.toggle(e):this.list.toggle(e),this},ye.prototype.array=function(){return Array.from(this.list)},ye.prototype.has=ye.prototype.contains=function(e){return this.list.contains(e)};var _e="http://www.w3.org/2000/svg",xe='<svg xmlns="'+_e+'"';function we(e){var t=!1;"<svg"===e.substring(0,4)?-1===e.indexOf(_e)&&(e=xe+e.substring(4)):(e=xe+">"+e+"</svg>",t=!0);var n=function(e){var t;return(t=new DOMParser).async=!1,t.parseFromString(e,"text/xml")}(e);if(!t)return n;for(var i=document.createDocumentFragment(),r=n.firstChild;r.firstChild;)i.appendChild(r.firstChild);return i}function Ee(e,t){var n;return"<"===(e=e.trim()).charAt(0)?(n=we(e).firstChild,n=document.importNode(n,!0)):n=document.createElementNS(_e,e),t&&fe(n,t),n}var Se=null;function ke(){return null===Se&&(Se=Ee("svg")),Se}function Ce(e,t){var n,i,r=Object.keys(t);for(n=0;i=r[n];n++)e[i]=t[i];return e}function Re(e){return ke().createSVGTransform()}var Pe=/([&<>]{1})/g,Ae=/([&<>\n\r"]{1})/g,Me={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"'"};function Te(e,t){return e.replace(t,function(e,t){return Me[t]||t})}function Be(e,t){var n,i,r,o,a;switch(e.nodeType){case 3:t.push(Te(e.textContent,Pe));break;case 1:if(t.push("<",e.tagName),e.hasAttributes())for(n=0,i=(r=e.attributes).length;n<i;++n)o=r.item(n),t.push(" ",o.name,'="',Te(o.value,Ae),'"');if(e.hasChildNodes()){for(t.push(">"),n=0,i=(a=e.childNodes).length;n<i;++n)Be(a.item(n),t);t.push("</",e.tagName,">")}else t.push("/>");break;case 8:t.push("\x3c!--",Te(e.nodeValue,Pe),"--\x3e");break;case 4:t.push("<![CDATA[",e.nodeValue,"]]>");break;default:throw new Error("unable to handle node "+e.nodeType)}return t}function De(e,t){return function(e){for(var t=e.firstChild,n=[];t;)Be(t,n),t=t.nextSibling;return n.join("")}(e)}function je(e){var t=e.parentNode;return t&&t.removeChild(e),e}function Oe(e,t){return t instanceof SVGMatrix?e.createSVGTransformFromMatrix(t):t}function Ne(e,t){var n=e.transform.baseVal;return t&&(Array.isArray(t)||(t=[t]),function(e,t){var n,i;for(e.clear(),n=0;i=t[n];n++)e.appendItem(Oe(e,i))}(n,t)),n.consolidate()}const Le=/^class[ {]/;function $e(e){return Array.isArray(e)}function Ie(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Fe(...e){1===e.length&&$e(e[0])&&(e=e[0]);const t=(e=[...e]).pop();return t.$inject=e,t}const ze=/constructor\s*[^(]*\(\s*([^)]*)\)/m,He=/^(?:async\s+)?(?:function\s*[^(]*)?(?:\(\s*([^)]*)\)|(\w+))/m,Ve=/\/\*([^*]*)\*\//m;function Ge(e){if("function"!=typeof e)throw new Error(`Cannot annotate "${e}". Expected a function!`);const t=e.toString().match(function(e){return Le.test(e.toString())}(e)?ze:He);if(!t)return[];const n=t[1]||t[2];return n&&n.split(",").map(e=>{const t=e.match(Ve);return(t&&t[1]||e).trim()})||[]}function We(e,t){const n=t||{get:function(e,t){if(i.push(e),!1===t)return null;throw s(`No provider for "${e}"!`)}},i=[],r=this._providers=Object.create(n._providers||null),o=this._instances=Object.create(null),a=o.injector=this,s=function(e){const t=i.join(" -> ");return i.length=0,new Error(t?`${e} (Resolving: ${t})`:e)};function c(e,t){if(!r[e]&&e.includes(".")){const t=e.split(".");let n=c(t.shift());for(;t.length;)n=n[t.shift()];return n}if(Ie(o,e))return o[e];if(Ie(r,e)){if(-1!==i.indexOf(e))throw i.push(e),s("Cannot resolve circular dependency!");return i.push(e),o[e]=r[e][0](r[e][1]),i.pop(),o[e]}return n.get(e,t)}function l(e,t){if(void 0===t&&(t={}),"function"!=typeof e){if(!$e(e))throw s(`Cannot invoke "${e}". Expected a function!`);e=Fe(e.slice())}return{fn:e,dependencies:(e.$inject||Ge(e)).map(e=>Ie(t,e)?t[e]:c(e))}}function p(e){const{fn:t,dependencies:n}=l(e);return new(Function.prototype.bind.call(t,null,...n))}function u(e,t,n){const{fn:i,dependencies:r}=l(e,n);return i.apply(t,r)}function h(e){return Fe(t=>e.get(t))}function d(e,t){if(t&&t.length){const n=Object.create(null),i=Object.create(null),o=[],a=[],s=[];let c,l,p,u;for(let e in r)c=r[e],-1!==t.indexOf(e)&&("private"===c[2]?(l=o.indexOf(c[3]),-1===l?(p=c[3].createChild([],t),u=h(p),o.push(c[3]),a.push(p),s.push(u),n[e]=[u,e,"private",p]):n[e]=[s[l],e,"private",a[l]]):n[e]=[c[2],c[1]],i[e]=!0),"factory"!==c[2]&&"type"!==c[2]||!c[1].$scope||t.forEach(t=>{-1!==c[1].$scope.indexOf(t)&&(n[e]=[c[2],c[1]],i[t]=!0)});t.forEach(e=>{if(!i[e])throw new Error('No provider for "'+e+'". Cannot use provider from the parent!')}),e.unshift(n)}return new We(e,a)}const f={factory:u,type:p,value:function(e){return e}};function m(e,t){const n=e.__init__||[];return function(){n.forEach(e=>{"string"==typeof e?t.get(e):t.invoke(e)})}}function g(e){const t=e.__exports__;if(t){const n=e.__modules__,i=Object.keys(e).reduce((t,n)=>("__exports__"!==n&&"__modules__"!==n&&"__init__"!==n&&"__depends__"!==n&&(t[n]=e[n]),t),Object.create(null)),o=d((n||[]).concat(i)),a=Fe(function(e){return o.get(e)});t.forEach(function(e){r[e]=[a,e,"private",o]});const s=(e.__init__||[]).slice();return s.unshift(function(){o.init()}),m(e=Object.assign({},e,{__init__:s}),o)}return Object.keys(e).forEach(function(t){if("__init__"===t||"__depends__"===t)return;const n=e[t];if("private"===n[2])return void(r[t]=n);const i=n[0],o=n[1];r[t]=[f[i],Ue(i,o),i]}),m(e,a)}function y(e,t){return-1!==e.indexOf(t)||-1!==(e=(t.__depends__||[]).reduce(y,e)).indexOf(t)?e:e.concat(t)}this.get=c,this.invoke=u,this.instantiate=p,this.createChild=d,this.init=function(e){const t=e.reduce(y,[]).map(g);let n=!1;return function(){n||(n=!0,t.forEach(e=>e()))}}(e)}function Ue(e,t){return"value"!==e&&$e(t)&&(t=Fe(t.slice())),t}function qe(e,t){var n=this;t=t||1e3,e.on(["render.shape","render.connection"],t,function(e,t){var i=e.type,r=t.element,o=t.gfx,a=t.attrs;if(n.canRender(r))return"render.shape"===i?n.drawShape(o,r,a):n.drawConnection(o,r,a)}),e.on(["render.getShapePath","render.getConnectionPath"],t,function(e,t){if(n.canRender(t))return"render.getShapePath"===e.type?n.getShapePath(t):n.getConnectionPath(t)})}function Ke(e){return e.flat().join(",").replace(/,?([A-Za-z]),?/g,"$1")}function Ye(e){return["L",e.x,e.y]}function Xe(e,t,n){return["C",e.x,e.y,t.x,t.y,n.x,n.y]}function Ze(e,t){const n=e.length,i=[(r=e[0],["M",r.x,r.y])];var r;for(let r=1;r<n;r++){const n=e[r-1],o=e[r],a=e[r+1];if(!a||!t){i.push(Ye(o));continue}const s=Math.min(t,Je(o.x-n.x,o.y-n.y),Je(a.x-o.x,a.y-o.y));if(!s){i.push(Ye(o));continue}const c=Qe(o,n,s),l=Qe(o,n,.5*s),p=Qe(o,a,s),u=Qe(o,a,.5*s);i.push(Ye(c)),i.push(Xe(l,u,p))}return i}function Qe(e,t,n){const i=t.x-e.x,r=t.y-e.y,o=n/Je(i,r);return{x:e.x+i*o,y:e.y+r*o}}function Je(e,t){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2))}function et(e,t,n){m(t)&&(n=t,t=null),t||(t={});const i=Ee("path",t);return m(n)&&(i.dataset.cornerRadius=String(n)),tt(i,e)}function tt(e,t){return fe(e,{d:Ke(Ze(t,parseInt(e.dataset.cornerRadius,10)||0))}),e}function nt(e){var t=new Set(e);return x(e,function(e){for(var n=e.parent;n;){if(t.has(n))return!1;n=n.parent}return!0})}function it(e,t,n){n=n||0,d(e)||(e=[e]),w(e,function(e,i){var r=t(e,i,n);d(r)&&r.length&&it(r,t,n+1)})}function rt(e,t,n){var i=new Set,r=new Set;return it(e,function(e,t,n){i.add(e);var o=e.children;if(o&&!r.has(o))return r.add(o),o}),Array.from(i)}function ot(e,t){return rt(e)}function at(e,t){var n,i,r,o;return t=!!t,d(e)||(e=[e]),w(e,function(e){var a=e;e.waypoints&&!t&&(a=at(e.waypoints,!0));var s=a.x,c=a.y,l=a.height||0,p=a.width||0;(s<n||void 0===n)&&(n=s),(c<i||void 0===i)&&(i=c),(s+p>r||void 0===r)&&(r=s+p),(c+l>o||void 0===o)&&(o=c+l)}),{x:n,y:i,height:o-i,width:r-n}}function st(e,t){var n={};return w(e,function(e){var i=e;i.waypoints&&(i=at(i)),!m(t.y)&&i.x>t.x&&(n[e.id]=e),!m(t.x)&&i.y>t.y&&(n[e.id]=e),i.x>t.x&&i.y>t.y&&(m(t.width)&&m(t.height)&&i.width+i.x<t.width+t.x&&i.height+i.y<t.height+t.y?n[e.id]=e:m(t.width)&&m(t.height)||(n[e.id]=e))}),n}function ct(e){return"waypoints"in e?"connection":"x"in e?"shape":"root"}function lt(e){return!(!e||!e.isFrame)}function pt(e,t){return z({},e||{},t||{})}qe.prototype.canRender=function(e){},qe.prototype.drawShape=function(e,t){},qe.prototype.drawConnection=function(e,t){},qe.prototype.getShapePath=function(e){},qe.prototype.getConnectionPath=function(e){};function ut(e,t){qe.call(this,e,1),this.CONNECTION_STYLE=t.style(["no-fill"],{strokeWidth:5,stroke:"fuchsia"}),this.SHAPE_STYLE=t.style({fill:"white",stroke:"fuchsia",strokeWidth:2}),this.FRAME_STYLE=t.style(["no-fill"],{stroke:"fuchsia",strokeDasharray:4,strokeWidth:2})}e(ut,qe),ut.prototype.canRender=function(){return!0},ut.prototype.drawShape=function(e,t,n){var i=Ee("rect");return fe(i,{x:0,y:0,width:t.width||0,height:t.height||0}),lt(t)?fe(i,z({},this.FRAME_STYLE,n||{})):fe(i,z({},this.SHAPE_STYLE,n||{})),ue(e,i),i},ut.prototype.drawConnection=function(e,t,n){var i=et(t.waypoints,z({},this.CONNECTION_STYLE,n||{}));return ue(e,i),i},ut.prototype.getShapePath=function(e){var t=e.x,n=e.y,i=e.width;return Ke([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])},ut.prototype.getConnectionPath=function(e){var t,n,i=e.waypoints,r=[];for(t=0;n=i[t];t++)n=n.original||n,r.push([0===t?"M":"L",n.x,n.y]);return Ke(r)},ut.$inject=["eventBus","styles"];var ht={__init__:["defaultRenderer"],defaultRenderer:["type",ut],styles:["type",function(){var e={"no-fill":{fill:"none"},"no-border":{strokeOpacity:0},"no-events":{pointerEvents:"none"}},t=this;this.cls=function(e,t,n){return z(this.style(t,n),{class:e})},this.style=function(t,n){d(t)||n||(n=t,t=[]);var i=S(t,function(t,n){return z(t,e[n]||{})},{});return n?z(i,n):i},this.computeStyle=function(e,n,i){return d(n)||(i=n,n=[]),t.style(n||[],z({},i,e||{}))}}]};function dt(e,t){if(!e||!t)return-1;var n=e.indexOf(t);return-1!==n&&e.splice(n,1),n}function ft(e,t,n){if(e&&t){"number"!=typeof n&&(n=-1);var i=e.indexOf(t);if(-1!==i){if(i===n)return;if(-1===n)return;e.splice(i,1)}-1!==n?e.splice(n,0,t):e.push(t)}}function mt(e,t){return e&&t?e.indexOf(t):-1}function gt(e,t){return e&&t?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):-1}function yt(e,t,n,i){if(void 0===i&&(i=5),!e||!t||!n)return!1;var r=(t.x-e.x)*(n.y-e.y)-(t.y-e.y)*(n.x-e.x),o=gt(e,t);return Math.abs(r/o)<=i}function vt(e,t){var n=Array.from(arguments).flat();const i={x:"v",y:"h"};for(const[e,t]of Object.entries(i))if(bt(e,n))return t;return!1}function bt(e,t){const n=t[0];return k(t,function(t){return Math.abs(n[e]-t[e])<=2})}function _t(e,t,n){return n=n||0,e.x>t.x-n&&e.y>t.y-n&&e.x<t.x+t.width+n&&e.y<t.y+t.height+n}function xt(e,t){return{x:Math.round(e.x+(t.x-e.x)/2),y:Math.round(e.y+(t.y-e.y)/2)}}
3
3
  /**
4
4
  * This file contains source code adapted from Snap.svg (licensed Apache-2.0).
@@ -24,7 +24,7 @@
24
24
  *
25
25
  * @param {Element} container
26
26
  */
27
- function(e){const t=W('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+dr+"</a>");q(ce("svg",t),fr),q(t,mr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),re.bind(t,"click",function(e){_r(),e.preventDefault()})}(this._container)}function Er(e,t){return e.warnings=t,e}e(wr,Hn),wr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let a=o.rootElement;const s=o.references,c=o.warnings,l=o.elementsById;i=i.concat(c),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:l,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const p=await this.importDefinitions(a,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Er(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},wr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},wr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Er(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return b(e.diagrams,function(e){return e.id===t})||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Er(t,[]),t}try{this.clear()}catch(e){throw Er(e,[]),e}const{warnings:i}=await pr(this,t,n);return{warnings:i}},wr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},wr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=ce(":scope > defs",t._svg),r=De(n),o=i?"<defs>"+De(i)+"</defs>":"",a=t.getContainer();let s;X(a).add(xr);try{s=n.getBBox()}finally{X(a).remove(xr)}const c=s.x-5,l=s.y-5,p=s.width+10,u=s.height+10;e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+p+'" height="'+u+'" viewBox="'+c+" "+l+" "+p+" "+u+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},wr.prototype._setDefinitions=function(e){this._definitions=e},wr.prototype.getModules=function(){return this._modules},wr.prototype.clear=function(){this.getDefinitions()&&Hn.prototype.clear.call(this)},wr.prototype.destroy=function(){Hn.prototype.destroy.call(this),pe(this._container)},wr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},wr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},wr.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=ce(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},wr.prototype.getDefinitions=function(){return this._definitions},wr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},wr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=z(V(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Hn.call(this,a),n&&n.container&&this.attachTo(n.container)},wr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},wr.prototype._createContainer=function(e){const t=W('<div class="bjs-container bio-theme-parent"></div>');return q(t,{width:kr(e.width),height:kr(e.height),position:e.position}),t},wr.prototype._createModdle=function(e){return new nr(z({},this._moddleExtensions,e.moddleExtensions))},wr.prototype._modules=[];const Sr={width:"100%",height:"100%",position:"relative"};function kr(e){return e+(m(e)?"px":"")}function Cr(e){wr.call(this,e),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}function Rr(e,t){return!ar(e,"bpmn:CallActivity")&&(ar(e,"bpmn:SubProcess")?!(!(t=t||lr(e))||!ar(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!ar(e,"bpmn:Participant")||!!cr(e).processRef)}function Pr(e){if(ar(e,"bpmn:Participant")||ar(e,"bpmn:Lane")){var t=lr(e).isHorizontal;return void 0===t||t}}function Ar(e){return e&&!!cr(e).triggeredByEvent}function Mr(e,t){return C(cr(e).eventDefinitions,function(e){return ar(e,t)})}e(Cr,wr),Cr.prototype._createModdle=function(e){var t=wr.prototype._createModdle.call(this,e);return t.ids=new a([32,36,1]),t},Cr.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Tr={width:90,height:20};function Br(e){return ar(e,"bpmn:Event")||ar(e,"bpmn:Gateway")||ar(e,"bpmn:DataStoreReference")||ar(e,"bpmn:DataObjectReference")||ar(e,"bpmn:DataInput")||ar(e,"bpmn:DataOutput")||ar(e,"bpmn:SequenceFlow")||ar(e,"bpmn:MessageFlow")||ar(e,"bpmn:Group")}function Dr(e){return Qt(e.label)}function jr(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=15:a+=15,{x:a,y:s}}function Or(e){return e.waypoints?jr(e.waypoints):ar(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Tr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Tr.height/2}}function Nr(e){return ar(e,"bpmn:FlowElement")||ar(e,"bpmn:Participant")||ar(e,"bpmn:Lane")||ar(e,"bpmn:SequenceFlow")||ar(e,"bpmn:MessageFlow")||ar(e,"bpmn:DataInput")||ar(e,"bpmn:DataOutput")?"name":ar(e,"bpmn:TextAnnotation")?"text":ar(e,"bpmn:Group")?"categoryValueRef":void 0}function Lr(e){var t=e.businessObject,n=Nr(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function $r(e){let t=[];return w(e.incoming,e=>{ar(e,"bpmn:Association")&&ar(e.source,"bpmn:TextAnnotation")&&t.push({annotation:e.source,association:e})}),w(e.outgoing,e=>{ar(e,"bpmn:Association")&&ar(e.target,"bpmn:TextAnnotation")&&t.push({annotation:e.target,association:e})}),t}function Ir(e){const t=new Map;return w(rt(e),e=>{w($r(e),e=>{t.has(e.annotation)||t.set(e.annotation,{annotation:e.annotation,associations:[]}),t.get(e.annotation).associations.push(e.association)})}),[...t.values()]}var Fr="hsl(225, 10%, 15%)";function zr(e,t){return C(e.eventDefinitions,function(e){return e.$type===t})}function Hr(e,t,n){var i=lr(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||"white"}function Vr(e,t,n){var i=lr(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||Fr}function Gr(e,t,n,i){var r=lr(e).get("label");return i||r&&r.get("color:color")||t||Vr(e,n)}function Wr(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return Ke([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])}function Ur(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return Ke([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}function qr(e,t={}){return{width:Kr(e,t),height:Yr(e,t)}}function Kr(e,t={}){return v(t,"width")?t.width:e.width}function Yr(e,t={}){return v(t,"height")?t.height:e.height}var Xr=new a,Zr=.95;function Qr(e,t,n,i,r,o,a){qe.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function p(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Fr,strokeWidth:2,fill:"white"})}function u(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Fr,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o,parentGfx:a=r._svg}=t,s=Ee("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ue(s,o);var c=ce(":scope > defs",a);c||ue(a,c=Ee("defs")),ue(c,s)}function d(e,t,n,i){var r=Xr.nextPrefixed("marker-");return function(e,t,n,i,r){if("sequenceflow-end"===n){h(t,{element:Ee("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:r,stroke:r,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){h(t,{element:Ee("circle",{cx:6,cy:6,r:3.5,...p({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){h(t,{element:Ee("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){h(t,{element:Ee("path",{d:"M 11 5 L 1 10 L 11 15",...u({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){h(t,{element:Ee("path",{d:"M 1 5 L 11 10 L 1 15",...u({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){h(t,{element:Ee("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:i,stroke:r})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){h(t,{element:Ee("path",{d:"M 6 4 L 10 16",...p({stroke:r,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,r,t,n,i),"url(#"+r+")"}function m(e,t,n,i,r={}){f(i)&&(r=i,i=0),i=i||0,r=p(r);var o=Ee("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ue(e,o),o}function g(e,t,n,i,r,o){f(r)&&(o=r,r=0),r=r||0,o=p(o);var a=Ee("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ue(e,a),a}function y(e,t,n,i){var r=et(t,n=u(n),i);return ue(e,r),r}function v(e,t,n){return y(e,t,n,5)}function b(e,t,n){n=u(n);var i=Ee("path",{...n,d:t});return ue(e,i),i}function _(e,t,n,i){return b(t,n,z({"data-marker":e},i))}function x(e){return Q[e]}function E(e){return function(t,n,i){return x(e)(t,n,i)}}var S=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:r?Hr(t,s,n.fill):Vr(t,c,n.stroke),strokeWidth:1})},k=function(e,t,n={}){var r=n.width||t.width,o=n.height||t.height,a=n.width?1:2,l=m(e,r,o,.2*o,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:a});b(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:Vr(t,c,n.stroke),strokeWidth:a});for(var p=0;p<12;p++){var u=r/2,h=o/2;b(e,i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{strokeWidth:1,stroke:Vr(t,c,n.stroke),transform:"rotate("+30*p+","+h+","+u+")"})}return l},C=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},R=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},P=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},A=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},M=function(e,t,n={},r){var o=b(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?Vr(t,c,n.stroke):"none",stroke:Vr(t,c,n.stroke),strokeWidth:1});return $n(o,45),o},T=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},B=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},D=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},j=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},O=function(e,t,n={}){return m(e,t.width,t.height,8,{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:4})};function N(e,t,n={},i){var r=cr(e),o=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(r),a=i||e;return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?j(t,a,n,o):D(t,a,n,o):zr(r,"bpmn:MessageEventDefinition")?S(t,a,n,o):zr(r,"bpmn:TimerEventDefinition")?k(t,a,n,o):zr(r,"bpmn:ConditionalEventDefinition")?R(t,a,n,o):zr(r,"bpmn:SignalEventDefinition")?B(t,a,n,o):zr(r,"bpmn:EscalationEventDefinition")?C(t,a,n,o):zr(r,"bpmn:LinkEventDefinition")?P(t,a,n,o):zr(r,"bpmn:ErrorEventDefinition")?A(t,a,n,o):zr(r,"bpmn:CancelEventDefinition")?M(t,a,n,o):zr(r,"bpmn:CompensateEventDefinition")?T(t,a,n,o):zr(r,"bpmn:TerminateEventDefinition")?O(t,a,n,o):null}var L={ParticipantMultiplicityMarker:function(e,t,n={}){var r=Kr(t,n),o=Yr(t,n);_("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},SubProcessMarker:function(e,t,n={}){Ln(g(e,14,14,0,{strokeWidth:1,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)}),t.width/2-7.5,t.height-20),_("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},ParallelMarker:function(e,t,n){var r=Kr(t,n),o=Yr(t,n);_("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},SequentialMarker:function(e,t,n){_("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},CompensationMarker:function(e,t,n){_("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},LoopMarker:function(e,t,n){var r=Kr(t,n),o=Yr(t,n);_("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:Vr(t,c,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=Kr(t,n),o=Yr(t,n);_("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke)})}};function $(e,t,n,i){L[e](t,n,i)}function I(e,t,n=[],i={}){i={fill:i.fill,stroke:i.stroke,width:Kr(t,i),height:Yr(t,i)};var r=cr(t),o=n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},r.get("isForCompensation")&&n.push("CompensationMarker"),ar(r,"bpmn:AdHocSubProcess")&&(n.push("AdhocMarker"),o||z(i,{compensation:i.compensation-18}));var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(z(i,{compensation:i.compensation-18}),n.includes("AdhocMarker")&&z(i,{seq:-23,loop:-18,parallel:-24}),void 0===s&&n.push("LoopMarker"),!1===s&&n.push("ParallelMarker"),!0===s&&n.push("SequentialMarker")),n.includes("CompensationMarker")&&1===n.length&&z(i,{compensation:-8}),w(n,function(n){$(n,e,t,i)})}function F(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return ge(i).add("djs-label"),ue(e,i),i}function H(e,t,n,i={}){var r=cr(t),o=qr({x:t.x,y:t.y,width:t.width,height:t.height},i);return F(e,r.name,{align:n,box:o,padding:7,style:{fill:Gr(t,l,c,i.stroke)}})}function V(e,t,n,i={}){var r=Pr(n),o=F(e,t,{box:{height:30,width:r?Yr(n,i):Kr(n,i)},align:"center-middle",style:{fill:Gr(n,l,c,i.stroke)}});r&&Nn(o,0,-(-1*Yr(n,i)),270)}function G(e,t,n={}){var{width:i,height:r}=qr(t,n);return g(e,i,r,10,{...n,fill:Hr(t,s,n.fill),fillOpacity:Zr,stroke:Vr(t,c,n.stroke)})}function W(e,t,n={}){var i=cr(t),r=Hr(t,s,n.fill),o=Vr(t,c,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=d(e,"association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=d(e,"association-start",r,o)),n=Jr(n,["markerStart","markerEnd"]),v(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function U(e,t,n={}){var r=Hr(t,s,n.fill),o=Vr(t,c,n.stroke),a=b(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:Zr,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(cr(t))&&b(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return a}function q(e,t,n={}){return m(e,t.width,t.height,{fillOpacity:Zr,...n,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})}function K(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");i=p(i);var s=Ee("polygon",{...i,points:a});return ue(e,s),s}(e,t.width,t.height,{fill:Hr(t,s,n.fill),fillOpacity:Zr,stroke:Vr(t,c,n.stroke)})}function Y(e,t,n={}){var i=g(e,Kr(t,n),Yr(t,n),0,{fill:Hr(t,s,n.fill),fillOpacity:n.fillOpacity||Zr,stroke:Vr(t,c,n.stroke),strokeWidth:1.5}),r=cr(t);ar(r,"bpmn:Lane")&&V(e,r.get("name"),t,n);return i}function X(e,t,n={}){var i=G(e,t,n),r=Rr(t);if(Ar(t)&&(fe(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!r)){var o=(cr(t).flowElements||[]).filter(e=>ar(e,"bpmn:StartEvent"));1===o.length&&function(e,t,n,i){var r=22,o={fill:Hr(i,s,n.fill),stroke:Vr(i,c,n.stroke),width:r,height:r},a=cr(e).isInterrupting,l=a?0:3,p=a?1:1.2,u=20,h=(r-u)/2,d="translate("+h+","+h+")";m(t,u,u,{fill:o.fill,stroke:o.stroke,strokeWidth:p,strokeDasharray:l,transform:d}),N(e,t,o,i)}(o[0],e,n,t)}return H(e,t,r?"center-top":"center-middle",n),I(e,t,r?void 0:["SubProcessMarker"],n),i}function Z(e,t,n={}){var i=G(e,t,n);return H(e,t,"center-middle",n),I(e,t,void 0,n),i}var Q=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return X(e,t,n=Rr(t)?Jr(n,["fill","stroke","width","height"]):Jr(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return W(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]);var r=cr(t).get("cancelActivity");n={strokeWidth:1.5,fill:Hr(t,s,n.fill),fillOpacity:1,stroke:Vr(t,c,n.stroke)},r||(n.strokeDasharray="6");var o=q(e,t,n);return m(e,t.width,t.height,3,{...n,fill:"none"}),i&&N(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return fe(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),fe(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),X(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=K(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return b(e,r,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",Hr(t,s,n.fill),Vr(t,c,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return U(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:DataObjectReference":E("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return b(e,r,{strokeWidth:1,fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",Hr(t,s,n.fill),Vr(t,c,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),b(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:Hr(t,s,n.fill),fillOpacity:Zr,stroke:Vr(t,c,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]);var r=q(e,t,{...n,strokeWidth:4});return i&&N(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=cr(t),o=K(e,t,n);m(e,t.width,t.height,.2*t.height,{fill:Hr(t,"none",n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});b(e,l,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||m(e,t.width,t.height,.26*t.height,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});b(e,r,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=K(e,t,n=Jr(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return lr(t).get("isMarkerVisible")&&b(e,o,{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return K(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=Jr(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:Vr(t,c,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Kr(t,n),height:Yr(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=K(e,t,n=Jr(n,["fill","stroke"]));return m(e,t.width,t.height,.24*t.height,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]);var r=q(e,t,{...n,strokeWidth:1.5});return m(e,t.width,t.height,3,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1.5}),i&&N(t,e,n),r},"bpmn:IntermediateCatchEvent":E("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":E("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=Jr(n,["fill","stroke","width","height"]),Y(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=cr(t),o=lr(t),a=Hr(t,s,n.fill),l=Vr(t,c,n.stroke),p=v(e,t.waypoints,{markerEnd:d(e,"messageflow-end",a,l),markerStart:d(e,"messageflow-start",a,l),stroke:l,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),f={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(f.fill=a,f.stroke=l):(f.fill=l,f.stroke=a);var m=b(e,h,f),g=F(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:l}}),y=m.getBBox(),_=g.getBBox();Nn(g,u.x-_.width/2,u.y+y.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=K(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=Y(e,t,n=Jr(n,["fill","stroke","width","height"])),r=Rr(t),o=Pr(t),a=cr(t),s=a.get("name");if(r){y(e,o?[{x:30,y:0},{x:30,y:Yr(t,n)}]:[{x:0,y:30},{x:Kr(t,n),y:30}],{stroke:Vr(t,c,n.stroke),strokeWidth:1.5}),V(e,s,t,n)}else{var p=qr(t,n);o||(p.height=Kr(t,n),p.width=Yr(t,n));var u=F(e,s,{box:p,align:"center-middle",style:{fill:Gr(t,l,c,n.stroke)}});if(!o)Nn(u,0,-(-1*Yr(t,n)),270)}return a.get("participantMultiplicity")&&$("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r,o=cr(t),a=Z(e,t,n);return o.get("instantiate")?(m(e,28,28,4.4,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(e,r,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:Vr(t,c,n.stroke),stroke:Hr(t,s,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var i=Hr(t,s,n.fill),r=Vr(t,c,n.stroke),o=v(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",i,r),stroke:r}),a=cr(t),{source:l}=t;if(l){var p=cr(l);a.get("conditionExpression")&&ar(p,"bpmn:Activity")&&fe(o,{markerStart:d(e,"conditional-flow-marker",i,r)}),p.get("default")&&(ar(p,"bpmn:Gateway")||ar(p,"bpmn:Activity"))&&p.get("default")===a&&fe(o,{markerStart:d(e,"conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return m(e,10,10,{fill:Hr(t,s,n.fill),stroke:"none",transform:"translate(6, 6)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),m(e,10,10,{fill:Hr(t,s,n.fill),stroke:"none",transform:"translate(11, 10)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]),cr(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=q(e,t,n);return i&&N(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return X(e,t,n=Rr(t)?Jr(n,["fill","stroke","width","height"]):Jr(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return Z(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var{width:r,height:o}=qr(t,n),a=g(e,r,o,0,0,{fill:"none",stroke:"none"});return b(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:Vr(t,c,n.stroke)}),F(e,cr(t).get("text")||"",{align:"left-top",box:qr(t,n),padding:7,style:{fill:Gr(t,l,c,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=Rr(t)?Jr(i,["fill","stroke","width","height"]):Jr(i,["fill","stroke"]);var r=X(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:Vr(t,c,i.stroke),strokeWidth:1.5});return Rr(t)||(i={}),g(e,Kr(t,i),Yr(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return F(e,Lr(t),{box:i,style:z({},o.getExternalStyle(),{fill:Gr(t,l,c,n.stroke)})})}(e,t,n)}};this._drawPath=b,this._renderer=x}function Jr(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}e(Qr,qe),Qr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Qr.prototype.canRender=function(e){return ar(e,"bpmn:BaseElement")},Qr.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Qr.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Qr.prototype.getShapePath=function(e){return Qt(e)?Ur(e,4):ar(e,"bpmn:Event")?Wr(e):ar(e,"bpmn:Activity")?Ur(e,10):ar(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return Ke([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return Ke([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e)};var eo={width:150,height:50};var to=null;function no(e){if(null!=e)return"number"==typeof e||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function io(e,t){var n=(to||(to=document.createElement("canvas").getContext("2d")),to);if(!n)return{width:0,height:0};n.font=function(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(no(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}(t),"letterSpacing"in n&&(n.letterSpacing=no(t.letterSpacing)||"0px");var i=""===e,r=i?"dummy":e.replace(/\s+$/,""),o=n.measureText(r);return{width:i?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function ro(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=io(o,n)).width=o?i.width:0," "===o||""===o||i.width<Math.round(t)||o.length<2)return oo(e,o,r,i);o=so(o,i.width,t)}}function oo(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var ao="­";function so(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&n!==ao||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&a===ao&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function co(e){this._config=z({},{size:eo,padding:0,style:{},align:"center-top"},e||{})}co.prototype.createText=function(e,t){return this.layoutText(e,t).element},co.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},co.prototype.layoutText=function(e,t){for(var n=z({},this._config.size,t.box),i=z({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return f(e)?z({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),c=e.split(/\u00AD?\r?\n/),l=[],p=n.width-o.left-o.right;c.length;)l.push(ro(c,p,i));"middle"===r.vertical&&(o.top=o.bottom=0);var u=S(l,function(e,t,n){return e+(s||t.height)},0)+o.top+o.bottom,h=S(l,function(e,t,n){return t.width>e?t.width:e},0),d=o.top;"middle"===r.vertical&&(d+=(n.height-u)/2),d-=(s||l[0].height)/4;var m=Ee("text");return fe(m,i),w(l,function(e){var t;switch(d+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?h:p)-o.right-e.width;break;default:t=Math.max(((a?h:p)-e.width)/2+o.left,0)}var n=Ee("tspan");fe(n,{x:t,y:d}),n.textContent=e.text,ue(m,n)}),{dimensions:{width:h,height:u},element:m}};function lo(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new co({style:t});function o(e,t,n){return r.getDimensions(e,z({box:t},n))}this.getExternalLabelBounds=function(e,t){var n=o(t,{width:Math.max(e.width,Tr.width),height:30},{style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=o(n,e,{style:t,align:"left-top",padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(40,Math.round(i.height))}},this.getDimensions=function(e,t){return r.getDimensions(e,t||{})},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}lo.$inject=["config.textRenderer"];var po=/\{([^{}]+)\}/g,uo=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ho={__init__:["bpmnRenderer"],bpmnRenderer:["type",Qr],textRenderer:["type",lo],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)o["y"+c]=r.heightElements[c]*a;for(var l=0;l<r.widthElements.length;l++)o["x"+l]=r.widthElements[l]*s}var p,u,h=(p=r.d,u={mx:n,my:i,e:o},String(p).replace(po,function(e,t){return function(e,t,n){var i=n;return t.replace(uo,function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,u)}));return h}}]};var fo={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]};function mo(e,t,n){return z({id:e.id,type:e.$type,businessObject:e,di:t},n)}function go(e,t,n){var i=e.waypoint;return!i||i.length<2?[on(t),on(n)]:i.map(function(e){return{x:e.x,y:e.y}})}function yo(e,t,n){return new Error(`element ${ir(t)} referenced by ${ir(e)}#${n} not yet drawn`)}function vo(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}vo.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],vo.prototype.add=function(e,t,n){var i,r,o;if(ar(t,"bpmndi:BPMNPlane")){var a=ar(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(mo(e,t,a)),this._canvas.addRootElement(i)}else if(ar(t,"bpmndi:BPMNShape")){var s=!Rr(e,t),c=function(e){return ar(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(mo(e,t,{collapsed:s,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),ar(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),ar(e,"bpmn:Lane")&&(o=0),ar(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,on(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!ar(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${ir(t)} for element ${ir(e)}`);var p=this._getSource(e),u=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(mo(e,t,{hidden:r,source:p,target:u,waypoints:go(t,p,u)})),ar(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Br(e)&&Lr(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},vo.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${ir(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw yo(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},vo.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Tr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Or(t),i=Tr),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=Lr(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(mo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Lr(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},vo.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?yo(e,i,t+"Ref"):new Error(`${ir(e)}#${t} Ref not specified`)},vo.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},vo.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},vo.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var bo={__depends__:[ho,{__depends__:[fo],bpmnImporter:["type",vo]}]};function _o(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}_o.prototype.next=function(){return this._prefix+ ++this._counter};var xo=new _o("ov");function wo(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=xo,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),q(o=W('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Eo(e,t,n){q(e,{left:t+"px",top:n+"px"})}function So(e,t){e.style.display=!1===t?"none":""}function ko(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}wo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],wo.prototype.get=function(e){if(y(e)&&(e={id:e}),y(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?x(t.overlays,j({type:e.type})):t.overlays.slice():[]}return e.type?x(this._overlays,j({type:e.type})):e.id?this._overlays[e.id]:null},wo.prototype.add=function(e,t,n){if(f(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},wo.prototype.remove=function(e){var t=this.get(e)||[];d(t)||(t=[t]);var n=this;w(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(pe(e.html),pe(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}})},wo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},wo.prototype.show=function(){So(this._overlayRoot)},wo.prototype.hide=function(){So(this._overlayRoot,!1)},wo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Q(this._overlayRoot)},wo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=at(t);i=o.x,r=o.y}Eo(n,i,r),K(e.html,"data-container-id",t.id)},wo.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?at(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?at(o).height:o.height,s=-1*i.bottom+n);Eo(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},wo.prototype._createOverlayContainer=function(e){var t=W('<div class="djs-overlays" />');q(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},wo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ko(this._overlayRoot,n)},wo.prototype._getOverlayContainer=function(e,t){var n=b(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},wo.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),y(o)&&(o=W(o)),n=this._getOverlayContainer(r),q(t=W('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&X(t).add("djs-overlay-"+e.type),So(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},wo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=!0;(i!==this._canvas.getRootElement()||n&&(u(r)&&r>t.scale||u(o)&&o<t.scale))&&(s=!1),So(a,s),this._updateOverlayScale(e,t)},wo.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),u(n)&&t.scale<n&&(r=(1/t.scale||1)*n),u(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),u(r)&&(s="scale("+r+","+r+")"),ko(a,s)},wo.prototype._updateOverlaysVisibilty=function(e){var t=this;w(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},wo.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element;w(t.get({element:n}),function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){pe(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(w(i.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&X(n.html)[e.add?"add":"remove"](e.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};var Co={__init__:["overlays"],overlays:["type",wo]};function Ro(e,t,n,i){e.on("element.changed",function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(ct(r)+".changed",i)}),e.on("elements.changed",function(t){var n=t.elements;n.forEach(function(t){e.fire("element.changed",{element:t})}),i.updateContainments(n)}),e.on("shape.changed",function(e){i.update("shape",e.element,e.gfx)}),e.on("connection.changed",function(e){i.update("connection",e.element,e.gfx)})}Ro.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Po={__init__:["changeSupport"],changeSupport:["type",Ro]};function Ao(e){this._eventBus=e}function Mo(e){return function(t,n,i,r,o){(g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function To(e,t){t.invoke(Ao,this),this.executed(function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)})}Ao.$inject=["eventBus"],Ao.prototype.on=function(e,t,n,i,r,o){if((g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),g(n)&&(o=r,r=i,i=n,n=1e3),f(r)&&(o=r,r=!1),!g(i))throw new Error("handlerFn must be a function");d(e)||(e=[e]);var a=this._eventBus;w(e,function(e){var s=["commandStack",e,t].filter(function(e){return e}).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)})},Ao.prototype.canExecute=Mo("canExecute"),Ao.prototype.preExecute=Mo("preExecute"),Ao.prototype.preExecuted=Mo("preExecuted"),Ao.prototype.execute=Mo("execute"),Ao.prototype.executed=Mo("executed"),Ao.prototype.postExecute=Mo("postExecute"),Ao.prototype.postExecuted=Mo("postExecuted"),Ao.prototype.revert=Mo("revert"),Ao.prototype.reverted=Mo("reverted"),e(To,Ao),To.$inject=["canvas","injector"];var Bo={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",To]};function Do(e){return CSS.escape(e)}var jo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Oo(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(e){return jo[e]})}var No="_plane";function Lo(e){return function(e){return e.replace(new RegExp(No+"$"),"")}(e.id)}function $o(e){var t=e.id;return ar(e,"bpmn:SubProcess")?zo(t):t}function Io(e){return zo(e)}function Fo(e){return ar(lr(e),"bpmndi:BPMNPlane")}function zo(e){return e+No}function Ho(e,t,n){var i=W('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=X(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=cr(e),n=[],i=t;i;i=i.$parent)(ar(i,"bpmn:SubProcess")||ar(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.flatMap(function(e){var i=n.findRoot($o(e))||n.findRoot(e.id);if(!i&&ar(e,"bpmn:Process")){var r=t.find(function(t){var n=cr(t);return n&&n.get("processRef")===e});i=r&&n.findRoot(r.id)}return i?[{parent:e,parentPlane:i}]:[]});i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach(function(e,t){var o,a=e.parent,s=e.parentPlane,c=Oo(a.name||a.id);t===r.length-1?o=W('<li><span class="bjs-crumb" title="'+c+'">'+c+"</span></li>"):(o=W('<li><a class="bjs-crumb" href="'+("#"+Oo(a.id))+'" title="'+c+'">'+c+"</a></li>")).addEventListener("click",function(e){e.preventDefault(),n.setRootElement(s)});i.appendChild(o)})}e.on("element.changed",function(e){var t=cr(e.element);b(a,function(e){return e===t})&&s()}),e.on("root.set",function(e){s(e.element)})}function Vo(e,t){var n=null,i=new Go;e.on("root.set",function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,ar(r,"bpmn:SubProcess")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;0===s&&0===c||t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}function Go(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Ho.$inject=["eventBus","elementRegistry","canvas"],Vo.$inject=["eventBus","canvas"];var Wo=180,Uo=160;function qo(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(e,t){n._handleImport(t.definitions)})}function Ko(e){return ar(e,"bpmndi:BPMNDiagram")?e:Ko(e.$parent)}qo.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},qo.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(t){var r=t.bpmnElement;if(r){var o=r.$parent;ar(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!ar(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(sr(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}});var r=[];return n.forEach(function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}}),i.forEach(function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}}),r},qo.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(e){if(e.bounds){var n=tn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),nn(t)}(e),i=n.x-Wo,r=n.y-Uo;t.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x=e.x-i,e.y=e.y-r}):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)})},qo.prototype._moveToDiPlane=function(e,t){var n=Ko(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},qo.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},qo.$inject=["eventBus","moddle"];var Yo=250;function Xo(e,t,n,i,r){Ao.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i,this._translate=r;var o=this;this.executed("shape.toggleCollapse",Yo,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.reverted("shape.toggleCollapse",Yo,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.executed(["shape.create","shape.move","shape.delete"],Yo,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Yo,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),t.on("import.render.complete",function(){n.filter(function(e){return o._canDrillDown(e)}).map(function(e){o._addOverlay(e)})})}e(Xo,Ao),Xo.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Xo.prototype._canDrillDown=function(e){var t=this._canvas;return ar(e,"bpmn:SubProcess")&&t.findRoot($o(e))},Xo.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=cr(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;X(i.html).toggle("bjs-drilldown-empty",!r)}},Xo.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=cr(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var r=W('<button type="button" class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>'),o=i.get("name")||i.get("id"),a=this._translate("Open {element}",{element:o});r.setAttribute("title",a),r.addEventListener("click",function(){t.setRootElement(t.findRoot($o(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(e)},Xo.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Xo.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var Zo={__depends__:[Co,Po,Bo],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ho],drilldownCentering:["type",Vo],drilldownOverlayBehavior:["type",Xo],subprocessCompatibility:["type",qo]};function Qo(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Jo(e){return e.originalEvent||e.srcEvent}function ea(e){Qo(e),Qo(Jo(e))}function ta(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function na(){return/mac/i.test(navigator.platform)}function ia(e,t){return(Jo(e)||e).button===t}function ra(e){return ia(e,0)}function oa(e){var t=Jo(e)||e;return!!ra(e)&&(na()?t.metaKey:t.ctrlKey)}function aa(e){var t=Jo(e)||e;return ra(e)&&t.shiftKey}function sa(e){return!0}function ca(e){return ra(e)||function(e){return ia(e,1)}(e)}function la(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){var n=c[e]||ra;return!n(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":sa,"element.mousedown":ca,"element.mouseup":ca,"element.click":ca,"element.dblclick":ca};function l(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(c[n]=i),a.$delegate=ae.bind(e,"svg, .djs-element",t,a)}function p(e,t,n){var i=a(n);i&&ae.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,w(s,function(e,n){p(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,w(s,function(e,n){l(t,n,e)})}),e.on(["shape.added","connection.added"],function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})}),e.on(["shape.changed","connection.changed"],500,function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})}),e.on("interactionEvents.createHit",500,function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)}),e.on("interactionEvents.updateHit",function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)});var u=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),d={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return fe(e,n),e}function g(e,t){ue(e,t)}this.removeHits=function(e){w(le(".djs-hit",e),je)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=et(t);return m(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Ee("rect");return m(i,t),fe(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=ce(".djs-hit",t);if(n)return e.waypoints?tt(n,e.waypoints):fe(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=a,this.registerEvent=l,this.unregisterEvent=p}la.$inject=["eventBus","elementRegistry","styles"];var pa={__init__:["interactionEvents"],interactionEvents:["type",la]};function ua(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on(["shape.remove","connection.remove"],function(e){var t=e.element;n.deselect(t)}),e.on(["diagram.clear","root.set"],function(e){n.select(null)})}ua.$inject=["eventBus","canvas"],ua.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:this.get()})}},ua.prototype.get=function(){return Array.from(this._selectedElements)},ua.prototype.isSelected=function(e){return this._selectedElements.has(e)},ua.prototype.select=function(e,t){var n=this.get();d(e)||(e=e?[e]:[]);var i=this._canvas,r=i.getRootElement();e=e.filter(function(e){var t=i.findRoot(e);return r===t}),t?w(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:this.get()})};var ha="hover",da="selected";function fa(e,t){function n(t,n){e.addMarker(t,n)}function i(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",function(e){n(e.element,ha)}),t.on("element.out",function(e){i(e.element,ha)}),t.on("selection.changed",function(e){function t(e){i(e,da)}function r(e){n(e,da)}var o=new Set(e.oldSelection),a=new Set(e.newSelection);for(let e of o)a.has(e)||t(e);for(let e of a)o.has(e)||r(e)})}function ma(e,t,n,i){e.on("create.end",500,function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;d(o)?t.select(o):t.select(r.filter(ga))}}),e.on("connect.end",500,function(e){var n=e.context.connection;n&&t.select(n)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);b(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){if(ra(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=aa(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}})}function ga(e){return!e.hidden}fa.$inject=["canvas","eventBus"],ma.$inject=["eventBus","selection","canvas","elementRegistry"];var ya={__init__:["selectionVisuals","selectionBehavior"],__depends__:[pa],selection:["type",ua],selectionVisuals:["type",fa],selectionBehavior:["type",ma]};function va(e){wr.call(this,e)}e(va,wr),va.prototype._modules=[bo,Zo,Co,ya,fo],va.prototype._moddleExtensions={};function ba(e,t,n){this._selectionWasVisible=!1;const i=I(()=>{this._selectionWasVisible=r()},300);function r(){var e=n.get();if(!e.length)return!1;var i=at(e),r=t.viewbox(),o=tn(i),a=tn(r);return o.left>=a.left&&o.right<=a.right&&o.top>=a.top&&o.bottom<=a.bottom}e.on("canvas.viewbox.changed",i),e.on("selection.changed",i),e.on("diagram.destroy",()=>{i.cancel()}),e.on("canvas.resized",()=>{var e=n.get();if(e.length&&this._selectionWasVisible&&!r()){var i=t.getRootElement();t.scrollToElement(e.concat(i))}}),this._flush=i.flush}ba.$inject=["eventBus","canvas","selection"];var _a={__init__:["keepSelectionVisible"],__depends__:[ya],keepSelectionVisible:["type",ba]},xa=["c","C"],wa=["v","V"],Ea=["d","D"],Sa=["x","X"],ka=["y","Y"],Ca=["z","Z"];function Ra(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Pa(e,t){return-1!==(e=d(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Aa(e){return e.shiftKey}var Ma="keyboard.keydown",Ta="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Ba(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Ta));var i=e&&!1!==e.bind;t.on("canvas.init",function(e){n._target=e.svg,i&&n.bind(),n._fire("init")})}Ba.$inject=["config.keyboard","eventBus"],Ba.prototype._keydownHandler=function(e){this._keyHandler(e,Ma)},Ba.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Ba.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ma,n)&&e.preventDefault()}},Ba.prototype._isEventIgnored=function(e){return!1},Ba.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Ta)),this.unbind(),e=this._node=this._target,re.bind(e,"keydown",this._keydownHandler),re.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Ba.prototype.getBinding=function(){return this._node},Ba.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),re.unbind(e,"keydown",this._keydownHandler),re.unbind(e,"keyup",this._keyupHandler)),this._node=null},Ba.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Ba.prototype.addListener=function(e,t,n){g(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ma,e,t)},Ba.prototype.removeListener=function(e,t){this._eventBus.off(t||Ma,e)},Ba.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Ba.prototype.isCmd=Ra,Ba.prototype.isShift=Aa,Ba.prototype.isKey=Pa;function Da(e,t){var n=this;e.on("editorActions.init",500,function(e){var i=e.editorActions;n.registerBindings(t,i)})}Da.$inject=["eventBus","keyboard"],Da.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",function(e){if(function(e){return Ra(e)&&!Aa(e)&&Pa(Ca,e)}(e.keyEvent))return t.trigger("undo"),!0}),n("redo",function(e){if(function(e){return Ra(e)&&(Pa(ka,e)||Pa(Ca,e)&&Aa(e))}(e.keyEvent))return t.trigger("redo"),!0}),n("copy",function(e){if(function(e){return Ra(e)&&Pa(xa,e)}(e.keyEvent))return t.trigger("copy"),!0}),n("paste",function(e){if(function(e){return Ra(e)&&Pa(wa,e)}(e.keyEvent))return t.trigger("paste"),!0}),n("duplicate",function(e){if(function(e){return Ra(e)&&Pa(Ea,e)}(e.keyEvent))return t.trigger("duplicate"),!0}),n("cut",function(e){if(function(e){return Ra(e)&&Pa(Sa,e)}(e.keyEvent))return t.trigger("cut"),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(Pa(["+","Add","="],n)&&Ra(n))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(Pa(["-","Subtract"],n)&&Ra(n))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(e){var n=e.keyEvent;if(Pa("0",n)&&Ra(n))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(e){if(Pa(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0})};var ja={__init__:["keyboard","keyboardBindings"],keyboard:["type",Ba],keyboardBindings:["type",Da]},Oa={moveSpeed:50,moveSpeedAccelerated:200};function Na(e,t,n){var i=this;this._config=z({},Oa,e||{}),t.addListener(function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}}),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Na.$inject=["config.keyboardMove","keyboard","canvas"];var La={__depends__:[ja],__init__:["keyboardMove"],keyboardMove:["type",Na]},$a=/^djs-cursor-.*$/;function Ia(e){var t=X(document.body);t.removeMatching($a),e&&t.add("djs-cursor-"+e)}function Fa(){Ia(null)}function za(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Ha(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Va(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ga(e,t){var n;function i(e){return a(e.originalEvent)}function r(i){var r,o=n.start,a=n.button,s=ta(i),c=Va(s,o);(!n.dragging&&(r=c,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&za(e),Ia("grab")),n.dragging)&&(c=Va(s,n.last||n.start),t.scroll({dx:c.x,dy:c.y}),n.last=s);i.preventDefault()}function o(e){re.unbind(document,"mousemove",r),re.unbind(document,"mouseup",o),n=null,Fa()}function a(e){if(!J(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:ta(e)},re.bind(document,"mousemove",r),re.bind(document,"mouseup",o),!0}}e.on("canvas.focus.changed",function(t){t.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)}),this.isActive=function(){return!!n}}Ga.$inject=["eventBus","canvas"];var Wa={__init__:["moveCanvas"],moveCanvas:["type",Ga]};function Ua(e){return Math.log(e)/Math.log(10)}function qa(e,t){var n=Ua(e.min),i=Ua(e.max);return(Math.abs(n)+Math.abs(i))/t}var Ka=Math.sign||function(e){return e>=0?1:-1},Ya={min:.2,max:4};function Xa(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=F(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.mouseover",function(){i._init(!1!==e.enabled)}),t.on("canvas.mouseout",function(){i._init(!1)})}Xa.$inject=["config.zoomScroll","eventBus","canvas"],Xa.prototype.scroll=function(e){this._canvas.scroll(e)},Xa.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Xa.prototype.zoom=function(e,t){var n=qa(Ya,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Xa.prototype._handleWheel=function(e){if(this._enabled){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||na()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Ka(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Xa.prototype.stepZoom=function(e,t){var n=qa(Ya,10);this._zoom(e,t,n)},Xa.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Ua(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,c,l=Math.pow(10,a);i.zoom((s=Ya,c=l,Math.max(s.min,Math.min(s.max,c))),t)},Xa.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&re[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Xa.prototype._init=function(e){this.toggle(e)};var Za={__init__:["zoomScroll"],zoomScroll:["type",Xa]};function Qa(e){va.call(this,e)}function Ja(e){return e&&e[e.length-1]}function es(e){return e.y}function ts(e){return e.x}e(Qa,va),Qa.prototype._navigationModules=[_a,La,Wa,Za],Qa.prototype._modules=[].concat(va.prototype._modules,Qa.prototype._navigationModules);var ns={left:ts,center:ts,right:function(e){return e.x+e.width},top:es,middle:es,bottom:function(e){return e.y+e.height}};function is(e,t){this._modeling=e,this._rules=t}is.$inject=["modeling","rules"],is.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},is.prototype._isType=function(e,t){return-1!==t.indexOf(e)},is.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},l={},p=!1;if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=Ja(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if(w(t,function(e){var t=e[a]+Math.round(e[s]/2);l[t]?l[t].elements.push(e):l[t]={elements:[e],center:t}}),n=D(l,function(e){return e.elements.length>1&&(p=!0),e.elements.length}),p)return c[e]=Ja(n).center,c;i=t[0],r=Ja(t=D(t,function(e){return e[a]+e[s]})),c[e]=function(e,t){return Math.round((e[a]+t[a]+t[s])/2)}(i,r)}return c},is.prototype.trigger=function(e,t){var n,i=this._modeling,r=x(e,function(e){return!(e.waypoints||e.host||e.labelTarget)});if(d(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=D(r,ns[t]),a=this._alignmentPosition(t,o);i.alignElements(o,a)}};var rs={__init__:["alignElements"],alignElements:["type",is]};const os=new _o;function as(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(e=>{this.cancel(e)})})}as.$inject=["eventBus"],as.prototype.schedule=function(e,t=os.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},as.prototype._schedule=function(e,t){const n=function(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}(),i=setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(e){n.reject(e)}}catch(e){console.error("Scheduler#_schedule execution failed",e)}});return{executionId:i,promise:n.promise}},as.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},as.prototype._cancel=function(e){clearTimeout(e.executionId)};var ss={scheduler:["type",as]},cs=".entry";function ls(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}ls.$inject=["canvas","elementRegistry","eventBus","scheduler"],ls.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=d(r)?r:[r];if(o.filter(function(e){return n.includes(e)}).length){e.close();var a=o.filter(function(t){return e._elementRegistry.get(t.id)});a.length&&e._updateAndOpen(a.length>1?a:a[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,i=e._current;(d(i.target)?i.target:[i.target]).includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},ls.prototype._createContainer=function(){var e=W('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ls.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(e){e.providers.push(t)})},ls.prototype.getEntries=function(e){var t=this._getProviders(),n=d(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return w(t,function(t){if(g(t[n])){var r=t[n](e);g(r)?i=r(i):w(r,function(e,t){i[t]=e})}}),i},ls.prototype.trigger=function(e,t,n){var i,r,o=this,a=t.delegateTarget||t.target;return a?(i=K(a,"data-action"),r=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(i,e,r,n):void(this._timeout=setTimeout(function(){o._mouseout=o.triggerEntry(i,"hover",r,n)},300))):t.preventDefault()},ls.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var a=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(g(a)){if("click"===t)return a(n,r,i)}else if(a[t])return a[t](n,r,i);n.preventDefault()}}}},ls.prototype.open=function(e,t){!t&&this.isOpen(e)||!1!==this._eventBus.fire("contextPad.open.allowed",{target:e})&&(this.close(),this._updateAndOpen(e))},ls.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ls.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);w(n,function(e,n){var r,o=e.group||"default",a=W(e.html||'<div class="entry" draggable="true"></div>');K(a,"data-action",n),(r=ce("[data-group="+Do(o)+"]",i))||(K(r=W('<div class="group"></div>'),"data-group",o),i.appendChild(r)),r.appendChild(a),e.className&&function(e,t){var n=X(e);(t=d(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})}(a,e.className),e.title&&K(a,"title",e.title),e.imageUrl&&(K(t=W("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",a.appendChild(t))}),X(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},ls.prototype._createHtml=function(e){var t=this,n=W('<div class="djs-context-pad"></div>');return ae.bind(n,cs,"click",function(e){t.trigger("click",e)}),ae.bind(n,cs,"dragstart",function(e){t.trigger("dragstart",e)}),ae.bind(n,cs,"mouseover",function(e){t.trigger("mouseover",e)}),ae.bind(n,cs,"mouseout",function(e){t.trigger("mouseout",e)}),re.bind(n,"mousedown",function(e){e.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ls.prototype.getPad=function(e){let t;return console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888")),t=this.isOpen()&&function(e,t){return e=d(e)?e:[e],t=d(t)?t:[t],e.length===t.length&&k(e,function(e){return t.includes(e)})}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ls.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ls.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return d(e)===d(n)&&(d(e)?e.length===n.length&&k(e,function(e){return n.includes(e)}):n===e)},ls.prototype.isShown=function(){return this.isOpen()&&X(this._current.html).has("open")},ls.prototype.show=function(){this.isOpen()&&(X(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},ls.prototype.hide=function(){this.isOpen()&&(X(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ls.prototype._getPosition=function(e){if(!d(e)&&Zt(e)){var t=this._canvas.viewbox(),n=(o=e).waypoints[o.waypoints.length-1],i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+8*this._canvas.zoom(),top:r}}var o,a=this._canvas.getContainer().getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+8*this._canvas.zoom(),top:s.top-a.top}},ls.prototype._updatePosition=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach(function(n){n in t&&(e.style[n]=t[n]+"px")})}},"ContextPad#_updatePosition")},ls.prototype._updateVisibility=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this,t=this._current.target;(d(t)?t:[t]).some(function(t){return e._canvas.hasMarker(t,"djs-element-hidden")})?e.hide():e.show()}},"ContextPad#_updateVisibility")},ls.prototype._getTargetBounds=function(e){var t=this;return(d(e)?e:[e]).map(function(e){return t._canvas.getGraphics(e)}).reduce(function(e,t){const n=t.getBoundingClientRect();return e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom),e.left=Math.min(e.left,n.left),e.x=e.left,e.y=e.top,e.width=e.right-e.left,e.height=e.bottom-e.top,e},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};var ps,us,hs,ds,fs,ms,gs,ys,vs,bs,_s,xs,ws,Es,Ss={__depends__:[pa,ss,Co],contextPad:["type",ls]},ks={},Cs=[],Rs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ps=Array.isArray;function As(e,t){for(var n in t)e[n]=t[n];return e}function Ms(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ts(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ps.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Bs(e,a,i,r,null)}function Bs(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++hs:r,__i:-1,__u:0};return null==r&&null!=us.vnode&&us.vnode(o),o}function Ds(e){return e.children}function js(e,t){this.props=e,this.context=t}function Os(e,t){if(null==t)return e.__?Os(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Os(e):null}function Ns(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],o=As({},t);o.__v=t.__v+1,us.vnode&&us.vnode(o),qs(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?Os(t):n,!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,Ys(i,o,r),t.__e=t.__=null,o.__e!=n&&Ls(o)}}function Ls(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Ls(e)}function $s(e){(!e.__d&&(e.__d=!0)&&ds.push(e)&&!Is.__r++||fs!=us.debounceRendering)&&((fs=us.debounceRendering)||ms)(Is)}function Is(){try{for(var e,t=1;ds.length;)ds.length>t&&ds.sort(gs),e=ds.shift(),t=ds.length,Ns(e)}finally{ds.length=Is.__r=0}}function Fs(e,t,n,i,r,o,a,s,c,l,p){var u,h,d,f,m,g,y,v=i&&i.__k||Cs,b=t.length;for(c=zs(n,t,v,c,b),u=0;u<b;u++)null!=(d=n.__k[u])&&(h=-1!=d.__i&&v[d.__i]||ks,d.__i=u,g=qs(e,d,h,r,o,a,s,c,l,p),f=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&Qs(h.ref,null,d),p.push(d.ref,d.__c||f,d)),null==m&&null!=f&&(m=f),(y=!!(4&d.__u))||h.__k===d.__k?(c=Hs(d,c,e,y),y&&h.__e&&(h.__e=null)):"function"==typeof d.type&&void 0!==g?c=g:f&&(c=f.nextSibling),d.__u&=-7);return n.__e=m,c}function zs(e,t,n,i,r){var o,a,s,c,l,p=n.length,u=p,h=0;for(e.__k=new Array(r),o=0;o<r;o++)null!=(a=t[o])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[o]=Bs(null,a,null,null,null):Ps(a)?a=e.__k[o]=Bs(Ds,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[o]=Bs(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=Vs(a,n,c,u))&&(u--,(s=n[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(r>p?h--:r<p&&h++),"function"!=typeof a.type&&(a.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,a.__u|=4))):e.__k[o]=null;if(u)for(o=0;o<p;o++)null!=(s=n[o])&&!(2&s.__u)&&(s.__e==i&&(i=Os(s)),Js(s,s));return i}function Hs(e,t,n,i){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Hs(r[o],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Os(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Vs(e,t,n,i){var r,o,a,s=e.key,c=e.type,l=t[n],p=null!=l&&!(2&l.__u);if(null===l&&null==s||p&&s==l.key&&c==l.type)return n;if(i>(p?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;)if(null!=(l=t[a=r>=0?r--:o++])&&!(2&l.__u)&&s==l.key&&c==l.type)return a;return-1}function Gs(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Rs.test(t)?n:n+"px"}function Ws(e,t,n,i,r){var o,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Gs(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||Gs(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(_s,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n[bs]=i[bs]:(n[bs]=xs,e.addEventListener(t,o?Es:ws,o)):e.removeEventListener(t,o?Es:ws,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Us(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[vs])t[vs]=xs++;else if(t[vs]<n[bs])return;return n(us.event?us.event(t):t)}}}function qs(e,t,n,i,r,o,a,s,c,l){var p,u,h,d,f,m,g,y,v,b,_,x,w,E,S,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(p=us.__b)&&p(t);e:if("function"==typeof k)try{if(y=t.props,v=k.prototype&&k.prototype.render,b=(p=k.contextType)&&i[p.__c],_=p?b?b.props.value:p.__:i,n.__c?g=(u=t.__c=n.__c).__=u.__E:(v?t.__c=u=new k(y,_):(t.__c=u=new js(y,_),u.constructor=k,u.render=ec),b&&b.sub(u),u.state||(u.state={}),u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),v&&null==u.__s&&(u.__s=u.state),v&&null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=As({},u.__s)),As(u.__s,k.getDerivedStateFromProps(y,u.__s))),d=u.props,f=u.state,u.__v=t,h)v&&null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),v&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(v&&null==k.getDerivedStateFromProps&&y!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(y,_),t.__v==n.__v||!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(y,u.__s,_)){t.__v!=n.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Cs.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(y,u.__s,_),v&&null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,m)})}if(u.context=_,u.props=y,u.__P=e,u.__e=!1,x=us.__r,w=0,v)u.state=u.__s,u.__d=!1,x&&x(t),p=u.render(u.props,u.state,u.context),Cs.push.apply(u.__h,u._sb),u._sb=[];else do{u.__d=!1,x&&x(t),p=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=As(As({},i),u.getChildContext())),v&&!h&&null!=u.getSnapshotBeforeUpdate&&(m=u.getSnapshotBeforeUpdate(d,f)),E=null!=p&&p.type===Ds&&null==p.key?Xs(p.props.children):p,s=Fs(e,Ps(E)?E:[E],t,n,i,r,o,a,s,c,l),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),g&&(u.__E=u.__=null)}catch(e){if(t.__v=null,c||null!=o)if(e.then){for(t.__u|=c?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(S=o.length;S--;)Ms(o[S]);Ks(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ks(t);us.__e(e,t,n)}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Zs(n.__e,t,n,i,r,o,a,c,l);return(p=us.diffed)&&p(t),128&t.__u?void 0:s}function Ks(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ks))}function Ys(e,t,n){for(var i=0;i<n.length;i++)Qs(n[i],n[++i],n[++i]);us.__c&&us.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){us.__e(e,t.__v)}})}function Xs(e){return"object"!=typeof e||null==e||e.__b>0?e:Ps(e)?e.map(Xs):void 0!==e.constructor?null:As({},e)}function Zs(e,t,n,i,r,o,a,s,c){var l,p,u,h,d,f,m,g=n.props||ks,y=t.props,v=t.type;if("svg"==v?r="http://www.w3.org/2000/svg":"math"==v?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;l<o.length;l++)if((d=o[l])&&"setAttribute"in d==!!v&&(v?d.localName==v:3==d.nodeType)){e=d,o[l]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(r,v,y.is&&y),s&&(us.__m&&us.__m(t,o),s=!1),o=null}if(null==v)g===y||s&&e.data==y||(e.data=y);else{if(o="textarea"==v&&null!=y.defaultValue?null:o&&ps.call(e.childNodes),!s&&null!=o)for(g={},l=0;l<e.attributes.length;l++)g[(d=e.attributes[l]).name]=d.value;for(l in g)d=g[l],"dangerouslySetInnerHTML"==l?u=d:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||Ws(e,l,null,d,r);for(l in y)d=y[l],"children"==l?h=d:"dangerouslySetInnerHTML"==l?p=d:"value"==l?f=d:"checked"==l?m=d:s&&"function"!=typeof d||g[l]===d||Ws(e,l,d,g[l],r);if(p)s||u&&(p.__html==u.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(u&&(e.innerHTML=""),Fs("template"==t.type?e.content:e,Ps(h)?h:[h],t,n,i,"foreignObject"==v?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&Os(n,0),s,c),null!=o)for(l=o.length;l--;)Ms(o[l]);s&&"textarea"!=v||(l="value","progress"==v&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==v&&!f||"option"==v&&f!=g[l])&&Ws(e,l,f,g[l],r),l="checked",null!=m&&m!=e[l]&&Ws(e,l,m,g[l],r))}return e}function Qs(e,t,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){us.__e(e,n)}}function Js(e,t,n){var i,r;if(us.unmount&&us.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Qs(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){us.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Js(i[r],t,n||"function"!=typeof e.type);n||Ms(e.__e),e.__c=e.__=e.__e=void 0}function ec(e,t,n){return this.constructor(e,n)}function tc(e,t,n){var i,r,o;t==document&&(t=document.documentElement),us.__&&us.__(e,t),i=!1?null:t.__k,r=[],o=[],qs(t,e=t.__k=Ts(Ds,null,[e]),i||ks,ks,t.namespaceURI,i?null:t.firstChild?ps.call(t.childNodes):null,r,i?i.__e:t.firstChild,false,o),Ys(r,e,o)}ps=Cs.slice,us={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},hs=0,js.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=As({},this.state),"function"==typeof e&&(e=e(As({},n),this.props)),e&&As(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$s(this))},js.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$s(this))},js.prototype.render=Ds,ds=[],ms="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gs=function(e,t){return e.__v.__b-t.__v.__b},Is.__r=0,ys=Math.random().toString(8),vs="__d"+ys,bs="__a"+ys,_s=/(PointerCapture)$|Capture$/i,xs=0,ws=Us(!1),Es=Us(!0);var nc=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];3===a?i[0]=s:4===a?i[1]=Object.assign(i[1]||{},s):5===a?(i[1]=i[1]||{})[t[++o]]=s:6===a?i[1][t[++o]]+=s+"":a?(r=e.apply(s,nc(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},ic=new Map;var rc,oc,ac,sc,cc=function(e){var t=ic.get(this);return t||(t=new Map,ic.set(this,t)),(t=nc(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,i=1,r="",o="",a=[0],s=function(e){1===i&&(e||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(0,e,r):3===i&&(e||r)?(a.push(3,e,r),i=2):2===i&&"..."===r&&e?a.push(4,e,0):2===i&&r&&!e?a.push(5,0,!0,r):i>=5&&((r||!e&&5===i)&&(a.push(i,0,r,n),i=6),e&&(a.push(i,e,0,n),i=6)),r=""},c=0;c<e.length;c++){c&&(1===i&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],1===i?"<"===t?(s(),a=[a],i=3):r+=t:4===i?"--"===r&&">"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(s(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[c][l+1])?(s(),3===i&&(a=a[0]),i=a,(a=a[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),i=2):r+=t),3===i&&"!--"===r&&(i=4,a=a[0])}return s(),a}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Ts),lc=0,pc=[],uc=us,hc=uc.__b,dc=uc.__r,fc=uc.diffed,mc=uc.__c,gc=uc.unmount,yc=uc.__;function vc(e,t){uc.__h&&uc.__h(oc,e,lc||t),lc=0;var n=oc.__H||(oc.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function bc(e){return lc=1,function(e,t){var n=vc(rc++,2);if(n.t=e,!n.__c&&(n.__=[Tc(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=oc,!oc.__f)){var i=function(e,t,i){if(!n.__c.__H)return!0;var o=n.__c.__H.__.filter(function(e){return e.__c});if(o.every(function(e){return!e.__N}))return!r||r.call(this,e,t,i);var a=n.__c.props!==e;return o.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),r&&r.call(this,e,t,i)||a};oc.__f=!0;var r=oc.shouldComponentUpdate,o=oc.componentWillUpdate;oc.componentWillUpdate=function(e,t,n){if(this.__e){var a=r;r=void 0,i(e,t,n),r=a}o&&o.call(this,e,t,n)},oc.shouldComponentUpdate=i}return n.__N||n.__}(Tc,e)}function _c(e,t){var n=vc(rc++,3);!uc.__s&&Mc(n.__H,t)&&(n.__=e,n.u=t,oc.__H.__h.push(n))}function xc(e,t){var n=vc(rc++,4);!uc.__s&&Mc(n.__H,t)&&(n.__=e,n.u=t,oc.__h.push(n))}function wc(e){return lc=5,Ec(function(){return{current:e}},[])}function Ec(e,t){var n=vc(rc++,7);return Mc(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Sc(e,t){return lc=8,Ec(function(){return e},t)}function kc(){for(var e;e=pc.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Pc),t.__h.some(Ac),t.__h=[]}catch(n){t.__h=[],uc.__e(n,e.__v)}}}uc.__b=function(e){oc=null,hc&&hc(e)},uc.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),yc&&yc(e,t)},uc.__r=function(e){dc&&dc(e),rc=0;var t=(oc=e.__c).__H;t&&(ac===oc?(t.__h=[],oc.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Pc),t.__h.some(Ac),t.__h=[],rc=0)),ac=oc},uc.diffed=function(e){fc&&fc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==pc.push(t)&&sc===uc.requestAnimationFrame||((sc=uc.requestAnimationFrame)||Rc)(kc)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),ac=oc=null},uc.__c=function(e,t){t.some(function(e){try{e.__h.some(Pc),e.__h=e.__h.filter(function(e){return!e.__||Ac(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],uc.__e(n,e.__v)}}),mc&&mc(e,t)},uc.unmount=function(e){gc&&gc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Pc(e)}catch(e){t=e}}),n.__H=void 0,t&&uc.__e(t,n.__v))};var Cc="function"==typeof requestAnimationFrame;function Rc(e){var t,n=function(){clearTimeout(i),Cc&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);Cc&&(t=requestAnimationFrame(n))}function Pc(e){var t=oc,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),oc=t}function Ac(e){var t=oc;e.__c=e.__(),oc=t}function Mc(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Tc(e,t){return"function"==typeof t?t(e):t}function Bc(e){const{navigationStack:t,setNavigationStack:n}=e,i=Ec(()=>t.length<=1?[]:t.slice(0,-1).map((e,t)=>({label:e.label,onClick:()=>n(e=>e.slice(0,t+1))})),[t,n]),r=t.length>0?()=>n([]):null,o=t.length>0?t[t.length-1].label:null;return cc`
27
+ function(e){const t=W('<a href="http://bpmn.io" target="_blank" class="bjs-powered-by" title="Powered by bpmn.io" >'+dr+"</a>");q(ce("svg",t),fr),q(t,mr,{position:"absolute",bottom:"15px",right:"15px",zIndex:"100"}),e.appendChild(t),re.bind(t,"click",function(e){_r(),e.preventDefault()})}(this._container)}function Er(e,t){return e.warnings=t,e}e(wr,Hn),wr.prototype.importXML=async function(e,t){const n=this;let i=[];try{let o;e=this._emit("import.parse.start",{xml:e})||e;try{o=await this._moddle.fromXML(e,"bpmn:Definitions")}catch(e){throw this._emit("import.parse.complete",{error:e}),e}let a=o.rootElement;const s=o.references,c=o.warnings,l=o.elementsById;i=i.concat(c),a=this._emit("import.parse.complete",(r={error:null,definitions:a,elementsById:l,references:s,warnings:i},n.get("eventBus").createEvent(r)))||a;const p=await this.importDefinitions(a,t);return i=i.concat(p.warnings),this._emit("import.done",{error:null,warnings:i}),{warnings:i}}catch(e){let t=e;throw i=i.concat(t.warnings||[]),Er(t,i),t=function(e){const t=/unparsable content <([^>]+)> detected([\s\S]*)$/.exec(e.message);t&&(e.message="unparsable content <"+t[1]+"> detected; this may indicate an invalid BPMN 2.0 diagram file"+t[2]);return e}(t),this._emit("import.done",{error:t,warnings:t.warnings}),t}var r},wr.prototype.importDefinitions=async function(e,t){this._setDefinitions(e);return{warnings:(await this.open(t)).warnings}},wr.prototype.open=async function(e){const t=this._definitions;let n=e;if(!t){const e=new Error("no XML imported");throw Er(e,[]),e}if("string"==typeof e&&(n=function(e,t){if(!t)return null;return b(e.diagrams,function(e){return e.id===t})||null}(t,e),!n)){const t=new Error("BPMNDiagram <"+e+"> not found");throw Er(t,[]),t}try{this.clear()}catch(e){throw Er(e,[]),e}const{warnings:i}=await pr(this,t,n);return{warnings:i}},wr.prototype.saveXML=async function(e){e=e||{};let t,n,i=this._definitions;try{if(!i)throw new Error("no definitions loaded");i=this._emit("saveXML.start",{definitions:i})||i;n=(await this._moddle.toXML(i,e)).xml,n=this._emit("saveXML.serialized",{xml:n})||n}catch(e){t=e}const r=t?{error:t}:{xml:n};if(this._emit("saveXML.done",r),t)throw t;return r},wr.prototype.saveSVG=async function(){let e,t;this._emit("saveSVG.start");try{const t=this.get("canvas"),n=t.getActiveLayer(),i=ce(":scope > defs",t._svg),r=De(n),o=i?"<defs>"+De(i)+"</defs>":"",a=t.getContainer();let s;X(a).add(xr);try{s=n.getBBox()}finally{X(a).remove(xr)}const c=s.x-5,l=s.y-5,p=s.width+10,u=s.height+10;e='<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- created with bpmn-js / http://bpmn.io --\x3e\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+p+'" height="'+u+'" viewBox="'+c+" "+l+" "+p+" "+u+'" version="1.1">'+o+r+"</svg>"}catch(e){t=e}if(this._emit("saveSVG.done",{error:t,svg:e}),t)throw t;return{svg:e}},wr.prototype._setDefinitions=function(e){this._definitions=e},wr.prototype.getModules=function(){return this._modules},wr.prototype.clear=function(){this.getDefinitions()&&Hn.prototype.clear.call(this)},wr.prototype.destroy=function(){Hn.prototype.destroy.call(this),pe(this._container)},wr.prototype.on=function(e,t,n,i){return this.get("eventBus").on(e,t,n,i)},wr.prototype.off=function(e,t){this.get("eventBus").off(e,t)},wr.prototype.attachTo=function(e){if(!e)throw new Error("parentNode required");this.detach(),e.get&&e.constructor.prototype.jquery&&(e=e.get(0)),"string"==typeof e&&(e=ce(e)),e.appendChild(this._container),this._emit("attach",{}),this.get("canvas").resized()},wr.prototype.getDefinitions=function(){return this._definitions},wr.prototype.detach=function(){const e=this._container,t=e.parentNode;t&&(this._emit("detach",{}),t.removeChild(e))},wr.prototype._init=function(e,t,n){const i=n.modules||this.getModules(n),r=n.additionalModules||[],o=[].concat([{bpmnjs:["value",this],moddle:["value",t]}],i,r),a=z(V(n,["additionalModules"]),{canvas:z({},n.canvas,{container:e}),modules:o});Hn.call(this,a),n&&n.container&&this.attachTo(n.container)},wr.prototype._emit=function(e,t){return this.get("eventBus").fire(e,t)},wr.prototype._createContainer=function(e){const t=W('<div class="bjs-container bio-theme-parent"></div>');return q(t,{width:kr(e.width),height:kr(e.height),position:e.position}),t},wr.prototype._createModdle=function(e){return new nr(z({},this._moddleExtensions,e.moddleExtensions))},wr.prototype._modules=[];const Sr={width:"100%",height:"100%",position:"relative"};function kr(e){return e+(m(e)?"px":"")}function Cr(e){wr.call(this,e),this.on("import.parse.complete",function(e){e.error||this._collectIds(e.definitions,e.elementsById)},this),this.on("diagram.destroy",function(){this.get("moddle").ids.clear()},this)}function Rr(e,t){return!ar(e,"bpmn:CallActivity")&&(ar(e,"bpmn:SubProcess")?!(!(t=t||lr(e))||!ar(t,"bpmndi:BPMNPlane"))||t&&!!t.isExpanded:!ar(e,"bpmn:Participant")||!!cr(e).processRef)}function Pr(e){if(ar(e,"bpmn:Participant")||ar(e,"bpmn:Lane")){var t=lr(e).isHorizontal;return void 0===t||t}}function Ar(e){return e&&!!cr(e).triggeredByEvent}function Mr(e,t){return C(cr(e).eventDefinitions,function(e){return ar(e,t)})}e(Cr,wr),Cr.prototype._createModdle=function(e){var t=wr.prototype._createModdle.call(this,e);return t.ids=new a([32,36,1]),t},Cr.prototype._collectIds=function(e,t){var n,i=e.$model.ids;for(n in i.clear(),t)i.claim(n,t[n])};var Tr={width:90,height:20};function Br(e){return ar(e,"bpmn:Event")||ar(e,"bpmn:Gateway")||ar(e,"bpmn:DataStoreReference")||ar(e,"bpmn:DataObjectReference")||ar(e,"bpmn:DataInput")||ar(e,"bpmn:DataOutput")||ar(e,"bpmn:SequenceFlow")||ar(e,"bpmn:MessageFlow")||ar(e,"bpmn:Group")}function Dr(e){return Qt(e.label)}function jr(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)],r=function(e){var t=e.length/2-1,n=e[Math.floor(t)],i=e[Math.ceil(t+.01)];return{x:n.x+(i.x-n.x)/2,y:n.y+(i.y-n.y)/2}}(e),o=Math.atan((i.y-n.y)/(i.x-n.x)),a=r.x,s=r.y;return Math.abs(o)<Math.PI/2?s-=15:a+=15,{x:a,y:s}}function Or(e){return e.waypoints?jr(e.waypoints):ar(e,"bpmn:Group")?{x:e.x+e.width/2,y:e.y+Tr.height/2}:{x:e.x+e.width/2,y:e.y+e.height+Tr.height/2}}function Nr(e){return ar(e,"bpmn:FlowElement")||ar(e,"bpmn:Participant")||ar(e,"bpmn:Lane")||ar(e,"bpmn:SequenceFlow")||ar(e,"bpmn:MessageFlow")||ar(e,"bpmn:DataInput")||ar(e,"bpmn:DataOutput")?"name":ar(e,"bpmn:TextAnnotation")?"text":ar(e,"bpmn:Group")?"categoryValueRef":void 0}function Lr(e){var t=e.businessObject,n=Nr(t);if(n)return"categoryValueRef"===n?function(e){var t=e.categoryValueRef;return t&&t.value||""}(t):t[n]||""}function $r(e){let t=[];return w(e.incoming,e=>{ar(e,"bpmn:Association")&&ar(e.source,"bpmn:TextAnnotation")&&t.push({annotation:e.source,association:e})}),w(e.outgoing,e=>{ar(e,"bpmn:Association")&&ar(e.target,"bpmn:TextAnnotation")&&t.push({annotation:e.target,association:e})}),t}function Ir(e){const t=new Map;return w(rt(e),e=>{w($r(e),e=>{t.has(e.annotation)||t.set(e.annotation,{annotation:e.annotation,associations:[]}),t.get(e.annotation).associations.push(e.association)})}),[...t.values()]}var Fr="hsl(225, 10%, 15%)";function zr(e,t){return C(e.eventDefinitions,function(e){return e.$type===t})}function Hr(e,t,n){var i=lr(e);return n||i.get("color:background-color")||i.get("bioc:fill")||t||"white"}function Vr(e,t,n){var i=lr(e);return n||i.get("color:border-color")||i.get("bioc:stroke")||t||Fr}function Gr(e,t,n,i){var r=lr(e).get("label");return i||r&&r.get("color:color")||t||Vr(e,n)}function Wr(e){var t=e.x+e.width/2,n=e.y+e.height/2,i=e.width/2;return Ke([["M",t,n],["m",0,-i],["a",i,i,0,1,1,0,2*i],["a",i,i,0,1,1,0,-2*i],["z"]])}function Ur(e,t){var n=e.x,i=e.y,r=e.width,o=e.height;return Ke([["M",n+t,i],["l",r-2*t,0],["a",t,t,0,0,1,t,t],["l",0,o-2*t],["a",t,t,0,0,1,-t,t],["l",2*t-r,0],["a",t,t,0,0,1,-t,-t],["l",0,2*t-o],["a",t,t,0,0,1,t,-t],["z"]])}function qr(e,t={}){return{width:Kr(e,t),height:Yr(e,t)}}function Kr(e,t={}){return v(t,"width")?t.width:e.width}function Yr(e,t={}){return v(t,"height")?t.height:e.height}var Xr=new a,Zr=.95;function Qr(e,t,n,i,r,o,a){qe.call(this,t,a);var s=e&&e.defaultFillColor,c=e&&e.defaultStrokeColor,l=e&&e.defaultLabelColor;function p(e){return n.computeStyle(e,{strokeLinecap:"round",strokeLinejoin:"round",stroke:Fr,strokeWidth:2,fill:"white"})}function u(e){return n.computeStyle(e,["no-fill"],{strokeLinecap:"round",strokeLinejoin:"round",stroke:Fr,strokeWidth:2})}function h(e,t){var{ref:n={x:0,y:0},scale:i=1,element:o,parentGfx:a=r._svg}=t,s=Ee("marker",{id:e,viewBox:"0 0 20 20",refX:n.x,refY:n.y,markerWidth:20*i,markerHeight:20*i,orient:"auto"});ue(s,o);var c=ce(":scope > defs",a);c||ue(a,c=Ee("defs")),ue(c,s)}function d(e,t,n,i){var r=Xr.nextPrefixed("marker-");return function(e,t,n,i,r){if("sequenceflow-end"===n){h(t,{element:Ee("path",{d:"M 1 5 L 11 10 L 1 15 Z",...p({fill:r,stroke:r,strokeWidth:1})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("messageflow-start"===n){h(t,{element:Ee("circle",{cx:6,cy:6,r:3.5,...p({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:6,y:6},parentGfx:e})}if("messageflow-end"===n){h(t,{element:Ee("path",{d:"m 1 5 l 0 -3 l 7 3 l -7 3 z",...p({fill:i,stroke:r,strokeWidth:1,strokeDasharray:[1e4,1]})}),ref:{x:8.5,y:5},parentGfx:e})}if("association-start"===n){h(t,{element:Ee("path",{d:"M 11 5 L 1 10 L 11 15",...u({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:1,y:10},scale:.5,parentGfx:e})}if("association-end"===n){h(t,{element:Ee("path",{d:"M 1 5 L 11 10 L 1 15",...u({fill:"none",stroke:r,strokeWidth:1.5,strokeDasharray:[1e4,1]})}),ref:{x:11,y:10},scale:.5,parentGfx:e})}if("conditional-flow-marker"===n){h(t,{element:Ee("path",{d:"M 0 10 L 8 6 L 16 10 L 8 14 Z",...p({fill:i,stroke:r})}),ref:{x:-1,y:10},scale:.5,parentGfx:e})}if("conditional-default-flow-marker"===n){h(t,{element:Ee("path",{d:"M 6 4 L 10 16",...p({stroke:r,fill:"none"})}),ref:{x:0,y:10},scale:.5,parentGfx:e})}}(e,r,t,n,i),"url(#"+r+")"}function m(e,t,n,i,r={}){f(i)&&(r=i,i=0),i=i||0,r=p(r);var o=Ee("circle",{cx:t/2,cy:n/2,r:Math.round((t+n)/4-i),...r});return ue(e,o),o}function g(e,t,n,i,r,o){f(r)&&(o=r,r=0),r=r||0,o=p(o);var a=Ee("rect",{x:r,y:r,width:t-2*r,height:n-2*r,rx:i,ry:i,...o});return ue(e,a),a}function y(e,t,n,i){var r=et(t,n=u(n),i);return ue(e,r),r}function v(e,t,n){return y(e,t,n,5)}function b(e,t,n){n=u(n);var i=Ee("path",{...n,d:t});return ue(e,i),i}function _(e,t,n,i){return b(t,n,z({"data-marker":e},i))}function x(e){return Q[e]}function E(e){return function(t,n,i){return x(e)(t,n,i)}}var S=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MESSAGE",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.235,my:.315}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:r?Hr(t,s,n.fill):Vr(t,c,n.stroke),strokeWidth:1})},k=function(e,t,n={}){var r=n.width||t.width,o=n.height||t.height,a=n.width?1:2,l=m(e,r,o,.2*o,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:a});b(e,i.getScaledPath("EVENT_TIMER_WH",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{stroke:Vr(t,c,n.stroke),strokeWidth:a});for(var p=0;p<12;p++){var u=r/2,h=o/2;b(e,i.getScaledPath("EVENT_TIMER_LINE",{xScaleFactor:.75,yScaleFactor:.75,containerWidth:r,containerHeight:o,position:{mx:.5,my:.5}}),{strokeWidth:1,stroke:Vr(t,c,n.stroke),transform:"rotate("+30*p+","+h+","+u+")"})}return l},C=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ESCALATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},R=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_CONDITIONAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.222}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},P=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_LINK",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.57,my:.263}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},A=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_ERROR",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.2,my:.722}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},M=function(e,t,n={},r){var o=b(e,i.getScaledPath("EVENT_CANCEL_45",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.638,my:-.055}}),{fill:r?Vr(t,c,n.stroke):"none",stroke:Vr(t,c,n.stroke),strokeWidth:1});return $n(o,45),o},T=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.22,my:.5}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},B=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_SIGNAL",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.5,my:.2}}),{strokeWidth:1,fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},D=function(e,t,n={},r){return b(e,i.getScaledPath("EVENT_MULTIPLE",{xScaleFactor:1.1,yScaleFactor:1.1,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.211,my:.36}}),{fill:r?Vr(t,c,n.stroke):Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},j=function(e,t,n={}){return b(e,i.getScaledPath("EVENT_PARALLEL_MULTIPLE",{xScaleFactor:1.2,yScaleFactor:1.2,containerWidth:n.width||t.width,containerHeight:n.height||t.height,position:{mx:.458,my:.194}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1})},O=function(e,t,n={}){return m(e,t.width,t.height,8,{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:4})};function N(e,t,n={},i){var r=cr(e),o=function(e){return"bpmn:IntermediateThrowEvent"===e.$type||"bpmn:EndEvent"===e.$type}(r),a=i||e;return r.get("eventDefinitions")&&r.get("eventDefinitions").length>1?r.get("parallelMultiple")?j(t,a,n,o):D(t,a,n,o):zr(r,"bpmn:MessageEventDefinition")?S(t,a,n,o):zr(r,"bpmn:TimerEventDefinition")?k(t,a,n,o):zr(r,"bpmn:ConditionalEventDefinition")?R(t,a,n,o):zr(r,"bpmn:SignalEventDefinition")?B(t,a,n,o):zr(r,"bpmn:EscalationEventDefinition")?C(t,a,n,o):zr(r,"bpmn:LinkEventDefinition")?P(t,a,n,o):zr(r,"bpmn:ErrorEventDefinition")?A(t,a,n,o):zr(r,"bpmn:CancelEventDefinition")?M(t,a,n,o):zr(r,"bpmn:CompensateEventDefinition")?T(t,a,n,o):zr(r,"bpmn:TerminateEventDefinition")?O(t,a,n,o):null}var L={ParticipantMultiplicityMarker:function(e,t,n={}){var r=Kr(t,n),o=Yr(t,n);_("participant-multiplicity",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2-6)/r,my:(o-15)/o}}),{strokeWidth:2,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},SubProcessMarker:function(e,t,n={}){Ln(g(e,14,14,0,{strokeWidth:1,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)}),t.width/2-7.5,t.height-20),_("sub-process",e,i.getScaledPath("MARKER_SUB_PROCESS",{xScaleFactor:1.5,yScaleFactor:1.5,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2-7.5)/t.width,my:(t.height-20)/t.height}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},ParallelMarker:function(e,t,n){var r=Kr(t,n),o=Yr(t,n);_("parallel",e,i.getScaledPath("MARKER_PARALLEL",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.parallel)/r,my:(o-20)/o}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},SequentialMarker:function(e,t,n){_("sequential",e,i.getScaledPath("MARKER_SEQUENTIAL",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.seq)/t.width,my:(t.height-19)/t.height}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},CompensationMarker:function(e,t,n){_("compensation",e,i.getScaledPath("MARKER_COMPENSATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:(t.width/2+n.compensation)/t.width,my:(t.height-13)/t.height}}),{strokeWidth:1,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})},LoopMarker:function(e,t,n){var r=Kr(t,n),o=Yr(t,n);_("loop",e,i.getScaledPath("MARKER_LOOP",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.loop)/r,my:(o-7)/o}}),{strokeWidth:1.5,fill:"none",stroke:Vr(t,c,n.stroke),strokeMiterlimit:.5})},AdhocMarker:function(e,t,n){var r=Kr(t,n),o=Yr(t,n);_("adhoc",e,i.getScaledPath("MARKER_ADHOC",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:(r/2+n.adhoc)/r,my:(o-15)/o}}),{strokeWidth:1,fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke)})}};function $(e,t,n,i){L[e](t,n,i)}function I(e,t,n=[],i={}){i={fill:i.fill,stroke:i.stroke,width:Kr(t,i),height:Yr(t,i)};var r=cr(t),o=n.includes("SubProcessMarker");i=o?{...i,seq:-21,parallel:-22,compensation:-25,loop:-18,adhoc:10}:{...i,seq:-5,parallel:-6,compensation:-7,loop:0,adhoc:-8},r.get("isForCompensation")&&n.push("CompensationMarker"),ar(r,"bpmn:AdHocSubProcess")&&(n.push("AdhocMarker"),o||z(i,{compensation:i.compensation-18}));var a=r.get("loopCharacteristics"),s=a&&a.get("isSequential");a&&(z(i,{compensation:i.compensation-18}),n.includes("AdhocMarker")&&z(i,{seq:-23,loop:-18,parallel:-24}),void 0===s&&n.push("LoopMarker"),!1===s&&n.push("ParallelMarker"),!0===s&&n.push("SequentialMarker")),n.includes("CompensationMarker")&&1===n.length&&z(i,{compensation:-8}),w(n,function(n){$(n,e,t,i)})}function F(e,t,n={}){n=z({size:{width:100}},n);var i=o.createText(t||"",n);return ge(i).add("djs-label"),ue(e,i),i}function H(e,t,n,i={}){var r=cr(t),o=qr({x:t.x,y:t.y,width:t.width,height:t.height},i);return F(e,r.name,{align:n,box:o,padding:7,style:{fill:Gr(t,l,c,i.stroke)}})}function V(e,t,n,i={}){var r=Pr(n),o=F(e,t,{box:{height:30,width:r?Yr(n,i):Kr(n,i)},align:"center-middle",style:{fill:Gr(n,l,c,i.stroke)}});r&&Nn(o,0,-(-1*Yr(n,i)),270)}function G(e,t,n={}){var{width:i,height:r}=qr(t,n);return g(e,i,r,10,{...n,fill:Hr(t,s,n.fill),fillOpacity:Zr,stroke:Vr(t,c,n.stroke)})}function W(e,t,n={}){var i=cr(t),r=Hr(t,s,n.fill),o=Vr(t,c,n.stroke);return"One"!==i.get("associationDirection")&&"Both"!==i.get("associationDirection")||(n.markerEnd=d(e,"association-end",r,o)),"Both"===i.get("associationDirection")&&(n.markerStart=d(e,"association-start",r,o)),n=Jr(n,["markerStart","markerEnd"]),v(e,t.waypoints,{...n,stroke:o,strokeDasharray:"0, 5"})}function U(e,t,n={}){var r=Hr(t,s,n.fill),o=Vr(t,c,n.stroke),a=b(e,i.getScaledPath("DATA_OBJECT_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}}),{fill:r,fillOpacity:Zr,stroke:o});(function(e){var t=e.dataObjectRef;return e.isCollection||t&&t.isCollection})(cr(t))&&b(e,i.getScaledPath("DATA_OBJECT_COLLECTION_PATH",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:.33,my:(t.height-18)/t.height}}),{strokeWidth:2,fill:r,stroke:o});return a}function q(e,t,n={}){return m(e,t.width,t.height,{fillOpacity:Zr,...n,fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke)})}function K(e,t,n={}){return function(e,t,n,i){var r=t/2,o=n/2,a=[{x:r,y:0},{x:t,y:o},{x:r,y:n},{x:0,y:o}].map(function(e){return e.x+","+e.y}).join(" ");i=p(i);var s=Ee("polygon",{...i,points:a});return ue(e,s),s}(e,t.width,t.height,{fill:Hr(t,s,n.fill),fillOpacity:Zr,stroke:Vr(t,c,n.stroke)})}function Y(e,t,n={}){var i=g(e,Kr(t,n),Yr(t,n),0,{fill:Hr(t,s,n.fill),fillOpacity:n.fillOpacity||Zr,stroke:Vr(t,c,n.stroke),strokeWidth:1.5}),r=cr(t);ar(r,"bpmn:Lane")&&V(e,r.get("name"),t,n);return i}function X(e,t,n={}){var i=G(e,t,n),r=Rr(t);if(Ar(t)&&(fe(i,{strokeDasharray:"0, 5.5",strokeWidth:2.5}),!r)){var o=(cr(t).flowElements||[]).filter(e=>ar(e,"bpmn:StartEvent"));1===o.length&&function(e,t,n,i){var r=22,o={fill:Hr(i,s,n.fill),stroke:Vr(i,c,n.stroke),width:r,height:r},a=cr(e).isInterrupting,l=a?0:3,p=a?1:1.2,u=20,h=(r-u)/2,d="translate("+h+","+h+")";m(t,u,u,{fill:o.fill,stroke:o.stroke,strokeWidth:p,strokeDasharray:l,transform:d}),N(e,t,o,i)}(o[0],e,n,t)}return H(e,t,r?"center-top":"center-middle",n),I(e,t,r?void 0:["SubProcessMarker"],n),i}function Z(e,t,n={}){var i=G(e,t,n);return H(e,t,"center-middle",n),I(e,t,void 0,n),i}var Q=this.handlers={"bpmn:AdHocSubProcess":function(e,t,n={}){return X(e,t,n=Rr(t)?Jr(n,["fill","stroke","width","height"]):Jr(n,["fill","stroke"]))},"bpmn:Association":function(e,t,n={}){return W(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:BoundaryEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]);var r=cr(t).get("cancelActivity");n={strokeWidth:1.5,fill:Hr(t,s,n.fill),fillOpacity:1,stroke:Vr(t,c,n.stroke)},r||(n.strokeDasharray="6");var o=q(e,t,n);return m(e,t.width,t.height,3,{...n,fill:"none"}),i&&N(t,e,n),o},"bpmn:BusinessRuleTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return fe(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_MAIN",{abspos:{x:8,y:8}})),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),fe(b(e,i.getScaledPath("TASK_TYPE_BUSINESS_RULE_HEADER",{abspos:{x:8,y:8}})),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:CallActivity":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),X(e,t,{strokeWidth:5,...n})},"bpmn:ComplexGateway":function(e,t,n={}){var r=K(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_COMPLEX",{xScaleFactor:.5,yScaleFactor:.5,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.26}}),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:DataInput":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return b(e,r,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1}),o},"bpmn:DataInputAssociation":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",Hr(t,s,n.fill),Vr(t,c,n.stroke))})},"bpmn:DataObject":function(e,t,n={}){return U(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:DataObjectReference":E("bpmn:DataObject"),"bpmn:DataOutput":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=i.getRawPath("DATA_ARROW"),o=U(e,t,n);return b(e,r,{strokeWidth:1,fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke)}),o},"bpmn:DataOutputAssociation":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),W(e,t,{...n,markerEnd:d(e,"association-end",Hr(t,s,n.fill),Vr(t,c,n.stroke))})},"bpmn:DataStoreReference":function(e,t,n={}){return n=Jr(n,["fill","stroke"]),b(e,i.getScaledPath("DATA_STORE",{xScaleFactor:1,yScaleFactor:1,containerWidth:t.width,containerHeight:t.height,position:{mx:0,my:.133}}),{fill:Hr(t,s,n.fill),fillOpacity:Zr,stroke:Vr(t,c,n.stroke),strokeWidth:2})},"bpmn:EndEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]);var r=q(e,t,{...n,strokeWidth:4});return i&&N(t,e,n),r},"bpmn:EventBasedGateway":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=cr(t),o=K(e,t,n);m(e,t.width,t.height,.2*t.height,{fill:Hr(t,"none",n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1});var a=r.get("eventGatewayType"),s=!!r.get("instantiate");if("Parallel"===a){var l=i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.474,my:.296}});b(e,l,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1})}else"Exclusive"===a&&(s||m(e,t.width,t.height,.26*t.height,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1}),function(){var r=i.getScaledPath("GATEWAY_EVENT_BASED",{xScaleFactor:.18,yScaleFactor:.18,containerWidth:t.width,containerHeight:t.height,position:{mx:.36,my:.44}});b(e,r,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:2})}());return o},"bpmn:ExclusiveGateway":function(e,t,n={}){var r=K(e,t,n=Jr(n,["fill","stroke"])),o=i.getScaledPath("GATEWAY_EXCLUSIVE",{xScaleFactor:.4,yScaleFactor:.4,containerWidth:t.width,containerHeight:t.height,position:{mx:.32,my:.3}});return lr(t).get("isMarkerVisible")&&b(e,o,{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Gateway":function(e,t,n={}){return K(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:Group":function(e,t,n={}){return n=Jr(n,["fill","stroke","width","height"]),g(e,t.width,t.height,10,{stroke:Vr(t,c,n.stroke),strokeWidth:1.5,strokeDasharray:"10, 6, 0, 6",fill:"none",pointerEvents:"none",width:Kr(t,n),height:Yr(t,n)})},"bpmn:InclusiveGateway":function(e,t,n={}){var i=K(e,t,n=Jr(n,["fill","stroke"]));return m(e,t.width,t.height,.24*t.height,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:2.5}),i},"bpmn:IntermediateEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]);var r=q(e,t,{...n,strokeWidth:1.5});return m(e,t.width,t.height,3,{fill:"none",stroke:Vr(t,c,n.stroke),strokeWidth:1.5}),i&&N(t,e,n),r},"bpmn:IntermediateCatchEvent":E("bpmn:IntermediateEvent"),"bpmn:IntermediateThrowEvent":E("bpmn:IntermediateEvent"),"bpmn:Lane":function(e,t,n={}){return n=Jr(n,["fill","stroke","width","height"]),Y(e,t,{...n,fillOpacity:.25})},"bpmn:ManualTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_MANUAL",{abspos:{x:17,y:15}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),r},"bpmn:MessageFlow":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r=cr(t),o=lr(t),a=Hr(t,s,n.fill),l=Vr(t,c,n.stroke),p=v(e,t.waypoints,{markerEnd:d(e,"messageflow-end",a,l),markerStart:d(e,"messageflow-start",a,l),stroke:l,strokeDasharray:"10, 11",strokeWidth:1.5});if(r.get("messageRef")){var u=p.getPointAtLength(p.getTotalLength()/2),h=i.getScaledPath("MESSAGE_FLOW_MARKER",{abspos:{x:u.x,y:u.y}}),f={strokeWidth:1};"initiating"===o.get("messageVisibleKind")?(f.fill=a,f.stroke=l):(f.fill=l,f.stroke=a);var m=b(e,h,f),g=F(e,r.get("messageRef").get("name"),{align:"center-top",fitBox:!0,style:{fill:l}}),y=m.getBBox(),_=g.getBBox();Nn(g,u.x-_.width/2,u.y+y.height/2+10,0)}return p},"bpmn:ParallelGateway":function(e,t,n={}){var r=K(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("GATEWAY_PARALLEL",{xScaleFactor:.6,yScaleFactor:.6,containerWidth:t.width,containerHeight:t.height,position:{mx:.46,my:.2}}),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:Participant":function(e,t,n={}){var i=Y(e,t,n=Jr(n,["fill","stroke","width","height"])),r=Rr(t),o=Pr(t),a=cr(t),s=a.get("name");if(r){y(e,o?[{x:30,y:0},{x:30,y:Yr(t,n)}]:[{x:0,y:30},{x:Kr(t,n),y:30}],{stroke:Vr(t,c,n.stroke),strokeWidth:1.5}),V(e,s,t,n)}else{var p=qr(t,n);o||(p.height=Kr(t,n),p.width=Yr(t,n));var u=F(e,s,{box:p,align:"center-middle",style:{fill:Gr(t,l,c,n.stroke)}});if(!o)Nn(u,0,-(-1*Yr(t,n)),270)}return a.get("participantMultiplicity")&&$("ParticipantMultiplicityMarker",e,t,n),i},"bpmn:ReceiveTask":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var r,o=cr(t),a=Z(e,t,n);return o.get("instantiate")?(m(e,28,28,4.4,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r=i.getScaledPath("TASK_TYPE_INSTANTIATING_SEND",{abspos:{x:7.77,y:9.52}})):r=i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:.9,yScaleFactor:.9,containerWidth:21,containerHeight:14,position:{mx:.3,my:.4}}),b(e,r,{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),a},"bpmn:ScriptTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SCRIPT",{abspos:{x:15,y:20}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:SendTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_SEND",{xScaleFactor:1,yScaleFactor:1,containerWidth:21,containerHeight:14,position:{mx:.285,my:.357}}),{fill:Vr(t,c,n.stroke),stroke:Hr(t,s,n.fill),strokeWidth:1}),r},"bpmn:SequenceFlow":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var i=Hr(t,s,n.fill),r=Vr(t,c,n.stroke),o=v(e,t.waypoints,{markerEnd:d(e,"sequenceflow-end",i,r),stroke:r}),a=cr(t),{source:l}=t;if(l){var p=cr(l);a.get("conditionExpression")&&ar(p,"bpmn:Activity")&&fe(o,{markerStart:d(e,"conditional-flow-marker",i,r)}),p.get("default")&&(ar(p,"bpmn:Gateway")||ar(p,"bpmn:Activity"))&&p.get("default")===a&&fe(o,{markerStart:d(e,"conditional-default-flow-marker",i,r)})}return o},"bpmn:ServiceTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return m(e,10,10,{fill:Hr(t,s,n.fill),stroke:"none",transform:"translate(6, 6)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:12,y:18}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),m(e,10,10,{fill:Hr(t,s,n.fill),stroke:"none",transform:"translate(11, 10)"}),b(e,i.getScaledPath("TASK_TYPE_SERVICE",{abspos:{x:17,y:22}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:1}),r},"bpmn:StartEvent":function(e,t,n={}){var{renderIcon:i=!0}=n;n=Jr(n,["fill","stroke"]),cr(t).get("isInterrupting")||(n={...n,strokeDasharray:"6"});var r=q(e,t,n);return i&&N(t,e,n),r},"bpmn:SubProcess":function(e,t,n={}){return X(e,t,n=Rr(t)?Jr(n,["fill","stroke","width","height"]):Jr(n,["fill","stroke"]))},"bpmn:Task":function(e,t,n={}){return Z(e,t,n=Jr(n,["fill","stroke"]))},"bpmn:TextAnnotation":function(e,t,n={}){n=Jr(n,["fill","stroke"]);var{width:r,height:o}=qr(t,n),a=g(e,r,o,0,0,{fill:"none",stroke:"none"});return b(e,i.getScaledPath("TEXT_ANNOTATION",{xScaleFactor:1,yScaleFactor:1,containerWidth:r,containerHeight:o,position:{mx:0,my:0}}),{stroke:Vr(t,c,n.stroke)}),F(e,cr(t).get("text")||"",{align:"left-top",box:qr(t,n),padding:7,style:{fill:Gr(t,l,c,n.stroke)}}),a},"bpmn:Transaction":function(e,t,i={}){i=Rr(t)?Jr(i,["fill","stroke","width","height"]):Jr(i,["fill","stroke"]);var r=X(e,t,{strokeWidth:1.5,...i}),o=n.style(["no-fill","no-events"],{stroke:Vr(t,c,i.stroke),strokeWidth:1.5});return Rr(t)||(i={}),g(e,Kr(t,i),Yr(t,i),7,3,o),r},"bpmn:UserTask":function(e,t,n={}){var r=Z(e,t,n=Jr(n,["fill","stroke"]));return b(e,i.getScaledPath("TASK_TYPE_USER_1",{abspos:{x:15,y:12}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_2",{abspos:{x:15,y:12}}),{fill:Hr(t,s,n.fill),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),b(e,i.getScaledPath("TASK_TYPE_USER_3",{abspos:{x:15,y:12}}),{fill:Vr(t,c,n.stroke),stroke:Vr(t,c,n.stroke),strokeWidth:.5}),r},label:function(e,t,n={}){return function(e,t,n={}){var i={width:t.width,height:t.height,x:t.width/2+t.x,y:t.height/2+t.y};return F(e,Lr(t),{box:i,style:z({},o.getExternalStyle(),{fill:Gr(t,l,c,n.stroke)})})}(e,t,n)}};this._drawPath=b,this._renderer=x}function Jr(e,t=[]){return t.reduce((t,n)=>(e[n]&&(t[n]=e[n]),t),{})}e(Qr,qe),Qr.$inject=["config.bpmnRenderer","eventBus","styles","pathMap","canvas","textRenderer"],Qr.prototype.canRender=function(e){return ar(e,"bpmn:BaseElement")},Qr.prototype.drawShape=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Qr.prototype.drawConnection=function(e,t,n={}){var{type:i}=t;return this._renderer(i)(e,t,n)},Qr.prototype.getShapePath=function(e){return Qt(e)?Ur(e,4):ar(e,"bpmn:Event")?Wr(e):ar(e,"bpmn:Activity")?Ur(e,10):ar(e,"bpmn:Gateway")?function(e){var t=e.width/2,n=e.height/2;return Ke([["M",e.x+t,e.y],["l",t,n],["l",-t,n],["l",-t,-n],["z"]])}(e):function(e){var t=e.x,n=e.y,i=e.width;return Ke([["M",t,n],["l",i,0],["l",0,e.height],["l",-i,0],["z"]])}(e)};var eo={width:150,height:50};var to=null;function no(e){if(null!=e)return"number"==typeof e||/^-?\d+(\.\d+)?$/.test(e)?e+"px":e}function io(e,t){var n=(to||(to=document.createElement("canvas").getContext("2d")),to);if(!n)return{width:0,height:0};n.font=function(e){var t=[];return e.fontStyle&&t.push(e.fontStyle),e.fontVariant&&t.push(e.fontVariant),e.fontWeight&&t.push(e.fontWeight),e.fontStretch&&t.push(e.fontStretch),t.push(no(e.fontSize)||"12px"),t.push(e.fontFamily||"sans-serif"),t.join(" ")}(t),"letterSpacing"in n&&(n.letterSpacing=no(t.letterSpacing)||"0px");var i=""===e,r=i?"dummy":e.replace(/\s+$/,""),o=n.measureText(r);return{width:i?0:o.width,height:"fontBoundingBoxAscent"in o?o.fontBoundingBoxAscent+o.fontBoundingBoxDescent:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function ro(e,t,n){for(var i,r=e.shift(),o=r;;){if((i=io(o,n)).width=o?i.width:0," "===o||""===o||i.width<=t||o.length<2)return oo(e,o,r,i);o=so(o,i.width,t)}}function oo(e,t,n,i){if(t.length<n.length){var r=n.slice(t.length).trim();e.unshift(r)}return{width:i.width,height:i.height,text:t}}var ao="­";function so(e,t,n){var i=Math.max(e.length*(n/t),1),r=function(e,t){var n,i=e.split(/(\s|-|\u00AD)/g),r=[],o=0;if(i.length>1)for(;n=i.shift();){if(!(n.length+o<t)){"-"!==n&&n!==ao||r.pop();break}r.push(n),o+=n.length}var a=r[r.length-1];return a&&a===ao&&(r[r.length-1]="-"),r.join("")}(e,i);return r||(r=e.slice(0,Math.max(Math.round(i-1),1))),r}function co(e){this._config=z({},{size:eo,padding:0,style:{},align:"center-top"},e||{})}co.prototype.createText=function(e,t){return this.layoutText(e,t).element},co.prototype.getDimensions=function(e,t){return this.layoutText(e,t).dimensions},co.prototype.layoutText=function(e,t){for(var n=z({},this._config.size,t.box),i=z({},this._config.style,t.style),r=function(e){var t=e.split("-");return{horizontal:t[0]||"center",vertical:t[1]||"top"}}(t.align||this._config.align),o=function(e){return f(e)?z({top:0,left:0,right:0,bottom:0},e):{top:e,left:e,right:e,bottom:e}}(void 0!==t.padding?t.padding:this._config.padding),a=t.fitBox||!1,s=function(e){if("fontSize"in e&&"lineHeight"in e)return e.lineHeight*parseInt(e.fontSize,10)}(i),c=e.split(/\u00AD?\r?\n/),l=[],p=n.width-o.left-o.right;c.length;)l.push(ro(c,p,i));"middle"===r.vertical&&(o.top=o.bottom=0);var u=S(l,function(e,t,n){return e+(s||t.height)},0)+o.top+o.bottom,h=S(l,function(e,t,n){return t.width>e?t.width:e},0),d=o.top;"middle"===r.vertical&&(d+=(n.height-u)/2),d-=(s||l[0].height)/4;var m=Ee("text");return fe(m,i),w(l,function(e){var t;switch(d+=s||e.height,r.horizontal){case"left":t=o.left;break;case"right":t=(a?h:p)-o.right-e.width;break;default:t=Math.max(((a?h:p)-e.width)/2+o.left,0)}var n=Ee("tspan");fe(n,{x:t,y:d}),n.textContent=e.text,ue(m,n)}),{dimensions:{width:h,height:u},element:m}};function lo(e){var t=z({fontFamily:"Arial, sans-serif",fontSize:12,fontWeight:"normal",lineHeight:1.2},e&&e.defaultStyle||{}),n=parseInt(t.fontSize,10)-1,i=z({},t,{fontSize:n},e&&e.externalStyle||{}),r=new co({style:t});function o(e,t,n){return r.getDimensions(e,z({box:t},n))}this.getExternalLabelBounds=function(e,t){var n=o(t,{width:Math.max(e.width,Tr.width),height:30},{style:i});return{x:Math.round(e.x+e.width/2-n.width/2),y:e.y,width:Math.ceil(n.width),height:Math.ceil(n.height)}},this.getTextAnnotationBounds=function(e,n){var i=o(n,e,{style:t,align:"left-top",padding:7});return{x:e.x,y:e.y,width:e.width,height:Math.max(40,Math.round(i.height))}},this.getDimensions=function(e,t){return r.getDimensions(e,t||{})},this.createText=function(e,t){return r.createText(e,t||{})},this.getDefaultStyle=function(){return t},this.getExternalStyle=function(){return i}}lo.$inject=["config.textRenderer"];var po=/\{([^{}]+)\}/g,uo=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g;var ho={__init__:["bpmnRenderer"],bpmnRenderer:["type",Qr],textRenderer:["type",lo],pathMap:["type",function(){this.pathMap={EVENT_MESSAGE:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:36,width:36,heightElements:[6,14],widthElements:[10.5,21]},EVENT_SIGNAL:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x1},0 Z",height:36,width:36,heightElements:[18],widthElements:[10,20]},EVENT_ESCALATION:{d:"M {mx},{my} l {e.x0},{e.y0} l -{e.x0},-{e.y1} l -{e.x0},{e.y1} Z",height:36,width:36,heightElements:[20,7],widthElements:[8]},EVENT_CONDITIONAL:{d:"M {e.x0},{e.y0} l {e.x1},0 l 0,{e.y2} l -{e.x1},0 Z M {e.x2},{e.y3} l {e.x0},0 M {e.x2},{e.y4} l {e.x0},0 M {e.x2},{e.y5} l {e.x0},0 M {e.x2},{e.y6} l {e.x0},0 M {e.x2},{e.y7} l {e.x0},0 M {e.x2},{e.y8} l {e.x0},0 ",height:36,width:36,heightElements:[8.5,14.5,18,11.5,14.5,17.5,20.5,23.5,26.5],widthElements:[10.5,14.5,12.5]},EVENT_LINK:{d:"m {mx},{my} 0,{e.y0} -{e.x1},0 0,{e.y1} {e.x1},0 0,{e.y0} {e.x0},-{e.y2} -{e.x0},-{e.y2} z",height:36,width:36,heightElements:[4.4375,6.75,7.8125],widthElements:[9.84375,13.5]},EVENT_ERROR:{d:"m {mx},{my} {e.x0},-{e.y0} {e.x1},-{e.y1} {e.x2},{e.y2} {e.x3},-{e.y3} -{e.x4},{e.y4} -{e.x5},-{e.y5} z",height:36,width:36,heightElements:[.023,8.737,8.151,16.564,10.591,8.714],widthElements:[.085,6.672,6.97,4.273,5.337,6.636]},EVENT_CANCEL_45:{d:"m {mx},{my} -{e.x1},0 0,{e.x0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:36,width:36,heightElements:[4.75,8.5],widthElements:[4.75,8.5]},EVENT_COMPENSATION:{d:"m {mx},{my} {e.x0},-{e.y0} 0,{e.y1} z m {e.x1},-{e.y2} {e.x2},-{e.y3} 0,{e.y1} -{e.x2},-{e.y3} z",height:36,width:36,heightElements:[6.5,13,.4,6.1],widthElements:[9,9.3,8.7]},EVENT_TIMER_WH:{d:"M {mx},{my} l {e.x0},-{e.y0} m -{e.x0},{e.y0} l {e.x1},{e.y1} ",height:36,width:36,heightElements:[10,2],widthElements:[3,7]},EVENT_TIMER_LINE:{d:"M {mx},{my} m {e.x0},{e.y0} l -{e.x1},{e.y1} ",height:36,width:36,heightElements:[10,3],widthElements:[0,0]},EVENT_MULTIPLE:{d:"m {mx},{my} {e.x1},-{e.y0} {e.x1},{e.y0} -{e.x0},{e.y1} -{e.x2},0 z",height:36,width:36,heightElements:[6.28099,12.56199],widthElements:[3.1405,9.42149,12.56198]},EVENT_PARALLEL_MULTIPLE:{d:"m {mx},{my} {e.x0},0 0,{e.y1} {e.x1},0 0,{e.y0} -{e.x1},0 0,{e.y1} -{e.x0},0 0,-{e.y1} -{e.x1},0 0,-{e.y0} {e.x1},0 z",height:36,width:36,heightElements:[2.56228,7.68683],widthElements:[2.56228,7.68683]},GATEWAY_EXCLUSIVE:{d:"m {mx},{my} {e.x0},{e.y0} {e.x1},{e.y0} {e.x2},0 {e.x4},{e.y2} {e.x4},{e.y1} {e.x2},0 {e.x1},{e.y3} {e.x0},{e.y3} {e.x3},0 {e.x5},{e.y1} {e.x5},{e.y2} {e.x3},0 z",height:17.5,width:17.5,heightElements:[8.5,6.5312,-6.5312,-8.5],widthElements:[6.5,-6.5,3,-3,5,-5]},GATEWAY_PARALLEL:{d:"m {mx},{my} 0,{e.y1} -{e.x1},0 0,{e.y0} {e.x1},0 0,{e.y1} {e.x0},0 0,-{e.y1} {e.x1},0 0,-{e.y0} -{e.x1},0 0,-{e.y1} -{e.x0},0 z",height:30,width:30,heightElements:[5,12.5],widthElements:[5,12.5]},GATEWAY_EVENT_BASED:{d:"m {mx},{my} {e.x0},{e.y0} {e.x0},{e.y1} {e.x1},{e.y2} {e.x2},0 z",height:11,width:11,heightElements:[-6,6,12,-12],widthElements:[9,-3,-12]},GATEWAY_COMPLEX:{d:"m {mx},{my} 0,{e.y0} -{e.x0},-{e.y1} -{e.x1},{e.y2} {e.x0},{e.y1} -{e.x2},0 0,{e.y3} {e.x2},0 -{e.x0},{e.y1} l {e.x1},{e.y2} {e.x0},-{e.y1} 0,{e.y0} {e.x3},0 0,-{e.y0} {e.x0},{e.y1} {e.x1},-{e.y2} -{e.x0},-{e.y1} {e.x2},0 0,-{e.y3} -{e.x2},0 {e.x0},-{e.y1} -{e.x1},-{e.y2} -{e.x0},{e.y1} 0,-{e.y0} -{e.x3},0 z",height:17.125,width:17.125,heightElements:[4.875,3.4375,2.125,3],widthElements:[3.4375,2.125,4.875,3]},DATA_OBJECT_PATH:{d:"m 0,0 {e.x1},0 {e.x0},{e.y0} 0,{e.y1} -{e.x2},0 0,-{e.y2} {e.x1},0 0,{e.y0} {e.x0},0",height:61,width:51,heightElements:[10,50,60],widthElements:[10,40,50,60]},DATA_OBJECT_COLLECTION_PATH:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},DATA_ARROW:{d:"m 5,9 9,0 0,-3 5,5 -5,5 0,-3 -9,0 z",height:61,width:51,heightElements:[],widthElements:[]},DATA_STORE:{d:"m {mx},{my} l 0,{e.y2} c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 l 0,-{e.y2} c -{e.x0},-{e.y1} -{e.x1},-{e.y1} -{e.x2},0c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0 m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0m -{e.x2},{e.y0}c {e.x0},{e.y1} {e.x1},{e.y1} {e.x2},0",height:61,width:61,heightElements:[7,10,45],widthElements:[2,58,60]},TEXT_ANNOTATION:{d:"m {mx}, {my} m 10,0 l -10,0 l 0,{e.y0} l 10,0",height:30,width:10,heightElements:[30],widthElements:[10]},MARKER_SUB_PROCESS:{d:"m{mx},{my} m 7,2 l 0,10 m -5,-5 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_PARALLEL:{d:"m{mx},{my} m 3,2 l 0,10 m 3,-10 l 0,10 m 3,-10 l 0,10",height:10,width:10,heightElements:[],widthElements:[]},MARKER_SEQUENTIAL:{d:"m{mx},{my} m 0,3 l 10,0 m -10,3 l 10,0 m -10,3 l 10,0",height:10,width:10,heightElements:[],widthElements:[]},MARKER_COMPENSATION:{d:"m {mx},{my} 7,-5 0,10 z m 7.1,-0.3 6.9,-4.7 0,10 -6.9,-4.7 z",height:10,width:21,heightElements:[],widthElements:[]},MARKER_LOOP:{d:"m {mx},{my} c 3.526979,0 6.386161,-2.829858 6.386161,-6.320661 0,-3.490806 -2.859182,-6.320661 -6.386161,-6.320661 -3.526978,0 -6.38616,2.829855 -6.38616,6.320661 0,1.745402 0.714797,3.325567 1.870463,4.469381 0.577834,0.571908 1.265885,1.034728 2.029916,1.35457 l -0.718163,-3.909793 m 0.718163,3.909793 -3.885211,0.802902",height:13.9,width:13.7,heightElements:[],widthElements:[]},MARKER_ADHOC:{d:"m {mx},{my} m 0.84461,2.64411 c 1.05533,-1.23780996 2.64337,-2.07882 4.29653,-1.97997996 2.05163,0.0805 3.85579,1.15803 5.76082,1.79107 1.06385,0.34139996 2.24454,0.1438 3.18759,-0.43767 0.61743,-0.33642 1.2775,-0.64078 1.7542,-1.17511 0,0.56023 0,1.12046 0,1.6807 -0.98706,0.96237996 -2.29792,1.62393996 -3.6918,1.66181996 -1.24459,0.0927 -2.46671,-0.2491 -3.59505,-0.74812 -1.35789,-0.55965 -2.75133,-1.33436996 -4.27027,-1.18121996 -1.37741,0.14601 -2.41842,1.13685996 -3.44288,1.96782996 z",height:4,width:15,heightElements:[],widthElements:[]},TASK_TYPE_SEND:{d:"m {mx},{my} l 0,{e.y1} l {e.x1},0 l 0,-{e.y1} z l {e.x0},{e.y0} l {e.x0},-{e.y0}",height:14,width:21,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_SCRIPT:{d:"m {mx},{my} c 9.966553,-6.27276 -8.000926,-7.91932 2.968968,-14.938 l -8.802728,0 c -10.969894,7.01868 6.997585,8.66524 -2.968967,14.938 z m -7,-12 l 5,0 m -4.5,3 l 4.5,0 m -3,3 l 5,0m -4,3 l 5,0",height:15,width:12.6,heightElements:[6,14],widthElements:[10.5,21]},TASK_TYPE_USER_1:{d:"m {mx},{my} c 0.909,-0.845 1.594,-2.049 1.594,-3.385 0,-2.554 -1.805,-4.62199999 -4.357,-4.62199999 -2.55199998,0 -4.28799998,2.06799999 -4.28799998,4.62199999 0,1.348 0.974,2.562 1.89599998,3.405 -0.52899998,0.187 -5.669,2.097 -5.794,4.7560005 v 6.718 h 17 v -6.718 c 0,-2.2980005 -5.5279996,-4.5950005 -6.0509996,-4.7760005 zm -8,6 l 0,5.5 m 11,0 l 0,-5"},TASK_TYPE_USER_2:{d:"m {mx},{my} m 2.162,1.009 c 0,2.4470005 -2.158,4.4310005 -4.821,4.4310005 -2.66499998,0 -4.822,-1.981 -4.822,-4.4310005 "},TASK_TYPE_USER_3:{d:"m {mx},{my} m -6.9,-3.80 c 0,0 2.25099998,-2.358 4.27399998,-1.177 2.024,1.181 4.221,1.537 4.124,0.965 -0.098,-0.57 -0.117,-3.79099999 -4.191,-4.13599999 -3.57499998,0.001 -4.20799998,3.36699999 -4.20699998,4.34799999 z"},TASK_TYPE_MANUAL:{d:"m {mx},{my} c 0.234,-0.01 5.604,0.008 8.029,0.004 0.808,0 1.271,-0.172 1.417,-0.752 0.227,-0.898 -0.334,-1.314 -1.338,-1.316 -2.467,-0.01 -7.886,-0.004 -8.108,-0.004 -0.014,-0.079 0.016,-0.533 0,-0.61 0.195,-0.042 8.507,0.006 9.616,0.002 0.877,-0.007 1.35,-0.438 1.353,-1.208 0.003,-0.768 -0.479,-1.09 -1.35,-1.091 -2.968,-0.002 -9.619,-0.013 -9.619,-0.013 v -0.591 c 0,0 5.052,-0.016 7.225,-0.016 0.888,-0.002 1.354,-0.416 1.351,-1.193 -0.006,-0.761 -0.492,-1.196 -1.361,-1.196 -3.473,-0.005 -10.86,-0.003 -11.0829995,-0.003 -0.022,-0.047 -0.045,-0.094 -0.069,-0.139 0.3939995,-0.319 2.0409995,-1.626 2.4149995,-2.017 0.469,-0.4870005 0.519,-1.1650005 0.162,-1.6040005 -0.414,-0.511 -0.973,-0.5 -1.48,-0.236 -1.4609995,0.764 -6.5999995,3.6430005 -7.7329995,4.2710005 -0.9,0.499 -1.516,1.253 -1.882,2.19 -0.37000002,0.95 -0.17,2.01 -0.166,2.979 0.004,0.718 -0.27300002,1.345 -0.055,2.063 0.629,2.087 2.425,3.312 4.859,3.318 4.6179995,0.014 9.2379995,-0.139 13.8569995,-0.158 0.755,-0.004 1.171,-0.301 1.182,-1.033 0.012,-0.754 -0.423,-0.969 -1.183,-0.973 -1.778,-0.01 -5.824,-0.004 -6.04,-0.004 10e-4,-0.084 0.003,-0.586 10e-4,-0.67 z"},TASK_TYPE_INSTANTIATING_SEND:{d:"m {mx},{my} l 0,8.4 l 12.6,0 l 0,-8.4 z l 6.3,3.6 l 6.3,-3.6"},TASK_TYPE_SERVICE:{d:"m {mx},{my} v -1.71335 c 0.352326,-0.0705 0.703932,-0.17838 1.047628,-0.32133 0.344416,-0.14465 0.665822,-0.32133 0.966377,-0.52145 l 1.19431,1.18005 1.567487,-1.57688 -1.195028,-1.18014 c 0.403376,-0.61394 0.683079,-1.29908 0.825447,-2.01824 l 1.622133,-0.01 v -2.2196 l -1.636514,0.01 c -0.07333,-0.35153 -0.178319,-0.70024 -0.323564,-1.04372 -0.145244,-0.34406 -0.321407,-0.6644 -0.522735,-0.96217 l 1.131035,-1.13631 -1.583305,-1.56293 -1.129598,1.13589 c -0.614052,-0.40108 -1.302883,-0.68093 -2.022633,-0.82247 l 0.0093,-1.61852 h -2.241173 l 0.0042,1.63124 c -0.353763,0.0736 -0.705369,0.17977 -1.049785,0.32371 -0.344415,0.14437 -0.665102,0.32092 -0.9635006,0.52046 l -1.1698628,-1.15823 -1.5667691,1.5792 1.1684265,1.15669 c -0.4026573,0.61283 -0.68308,1.29797 -0.8247287,2.01713 l -1.6588041,0.003 v 2.22174 l 1.6724648,-0.006 c 0.073327,0.35077 0.1797598,0.70243 0.3242851,1.04472 0.1452428,0.34448 0.3214064,0.6644 0.5227339,0.96066 l -1.1993431,1.19723 1.5840256,1.56011 1.1964668,-1.19348 c 0.6140517,0.40346 1.3028827,0.68232 2.0233517,0.82331 l 7.19e-4,1.69892 h 2.226848 z m 0.221462,-3.9957 c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_SERVICE_FILL:{d:"m {mx},{my} c -1.788948,0.7502 -3.8576,-0.0928 -4.6097055,-1.87438 -0.7521065,-1.78321 0.090598,-3.84627 1.8802645,-4.59604 1.78823,-0.74936 3.856881,0.0929 4.608987,1.87437 0.752106,1.78165 -0.0906,3.84612 -1.879546,4.59605 z"},TASK_TYPE_BUSINESS_RULE_HEADER:{d:"m {mx},{my} 0,4 20,0 0,-4 z"},TASK_TYPE_BUSINESS_RULE_MAIN:{d:"m {mx},{my} 0,12 20,0 0,-12 zm 0,8 l 20,0 m -13,-4 l 0,8"},MESSAGE_FLOW_MARKER:{d:"m {mx},{my} m -10.5 ,-7 l 0,14 l 21,0 l 0,-14 z l 10.5,6 l 10.5,-6"}},this.getRawPath=function(e){return this.pathMap[e].d},this.getScaledPath=function(e,t){var n,i,r=this.pathMap[e];t.abspos?(n=t.abspos.x,i=t.abspos.y):(n=t.containerWidth*t.position.mx,i=t.containerHeight*t.position.my);var o={};if(t.position){for(var a=t.containerHeight/r.height*t.yScaleFactor,s=t.containerWidth/r.width*t.xScaleFactor,c=0;c<r.heightElements.length;c++)o["y"+c]=r.heightElements[c]*a;for(var l=0;l<r.widthElements.length;l++)o["x"+l]=r.widthElements[l]*s}var p,u,h=(p=r.d,u={mx:n,my:i,e:o},String(p).replace(po,function(e,t){return function(e,t,n){var i=n;return t.replace(uo,function(e,t,n,r,o){t=t||r,i&&(t in i&&(i=i[t]),"function"==typeof i&&o&&(i=i()))}),i=(null==i||i==n?e:i)+""}(e,t,u)}));return h}}]};var fo={translate:["value",function(e,t){return t=t||{},e.replace(/{([^}]+)}/g,function(e,n){return t[n]||"{"+n+"}"})}]};function mo(e,t,n){return z({id:e.id,type:e.$type,businessObject:e,di:t},n)}function go(e,t,n){var i=e.waypoint;return!i||i.length<2?[on(t),on(n)]:i.map(function(e){return{x:e.x,y:e.y}})}function yo(e,t,n){return new Error(`element ${ir(t)} referenced by ${ir(e)}#${n} not yet drawn`)}function vo(e,t,n,i,r){this._eventBus=e,this._canvas=t,this._elementFactory=n,this._elementRegistry=i,this._textRenderer=r}vo.$inject=["eventBus","canvas","elementFactory","elementRegistry","textRenderer"],vo.prototype.add=function(e,t,n){var i,r,o;if(ar(t,"bpmndi:BPMNPlane")){var a=ar(e,"bpmn:SubProcess")?{id:e.id+"_plane"}:{};i=this._elementFactory.createRoot(mo(e,t,a)),this._canvas.addRootElement(i)}else if(ar(t,"bpmndi:BPMNShape")){var s=!Rr(e,t),c=function(e){return ar(e,"bpmn:Group")}(e);r=n&&(n.hidden||n.collapsed);var l=t.bounds;i=this._elementFactory.createShape(mo(e,t,{collapsed:s,hidden:r,x:Math.round(l.x),y:Math.round(l.y),width:Math.round(l.width),height:Math.round(l.height),isFrame:c})),ar(e,"bpmn:BoundaryEvent")&&this._attachBoundary(e,i),ar(e,"bpmn:Lane")&&(o=0),ar(e,"bpmn:DataStoreReference")&&(function(e,t){var n=t.x,i=t.y;return n>=e.x&&n<=e.x+e.width&&i>=e.y&&i<=e.y+e.height}(n,on(l))||(n=this._canvas.findRoot(n))),this._canvas.addShape(i,n,o)}else{if(!ar(t,"bpmndi:BPMNEdge"))throw new Error(`unknown di ${ir(t)} for element ${ir(e)}`);var p=this._getSource(e),u=this._getTarget(e);r=n&&(n.hidden||n.collapsed),i=this._elementFactory.createConnection(mo(e,t,{hidden:r,source:p,target:u,waypoints:go(t,p,u)})),ar(e,"bpmn:DataAssociation")&&(n=this._canvas.findRoot(n)),this._canvas.addConnection(i,n,o)}return Br(e)&&Lr(i)&&this.addLabel(e,t,i),this._eventBus.fire("bpmnElement.added",{element:i}),i},vo.prototype._attachBoundary=function(e,t){var n=e.attachedToRef;if(!n)throw new Error(`missing ${ir(e)}#attachedToRef`);var i=this._elementRegistry.get(n.id),r=i&&i.attachers;if(!i)throw yo(e,n,"attachedToRef");t.host=i,r||(i.attachers=r=[]),-1===r.indexOf(t)&&r.push(t)},vo.prototype.addLabel=function(e,t,n){var i,r,o;return i=function(e,t){var n,i,r,o=e.label;return o&&o.bounds?(r=o.bounds,i={width:Math.max(Tr.width,r.width),height:r.height},n={x:r.x+r.width/2,y:r.y+r.height/2}):(n=Or(t),i=Tr),z({x:n.x-i.width/2,y:n.y-i.height/2},i)}(t,n),(r=Lr(n))&&(i=this._textRenderer.getExternalLabelBounds(i,r)),o=this._elementFactory.createLabel(mo(e,t,{id:e.id+"_label",labelTarget:n,type:"label",hidden:n.hidden||!Lr(n),x:Math.round(i.x),y:Math.round(i.y),width:Math.round(i.width),height:Math.round(i.height)})),this._canvas.addShape(o,n.parent)},vo.prototype._getConnectedElement=function(e,t){var n,i,r=e.$type;if(i=e[t+"Ref"],"source"===t&&"bpmn:DataInputAssociation"===r&&(i=i&&i[0]),("source"===t&&"bpmn:DataOutputAssociation"===r||"target"===t&&"bpmn:DataInputAssociation"===r)&&(i=e.$parent),n=i&&this._getElement(i))return n;throw i?yo(e,i,t+"Ref"):new Error(`${ir(e)}#${t} Ref not specified`)},vo.prototype._getSource=function(e){return this._getConnectedElement(e,"source")},vo.prototype._getTarget=function(e){return this._getConnectedElement(e,"target")},vo.prototype._getElement=function(e){return this._elementRegistry.get(e.id)};var bo={__depends__:[ho,{__depends__:[fo],bpmnImporter:["type",vo]}]};function _o(e){this._counter=0,this._prefix=(e?e+"-":"")+Math.floor(1e9*Math.random())+"-"}_o.prototype.next=function(){return this._prefix+ ++this._counter};var xo=new _o("ov");function wo(e,t,n,i){var r,o;this._eventBus=t,this._canvas=n,this._elementRegistry=i,this._ids=xo,this._overlayDefaults=z({show:null,scale:!0},e&&e.defaults),this._overlays={},this._overlayContainers=[],this._overlayRoot=(r=n.getContainer(),q(o=W('<div class="djs-overlay-container" />'),{position:"absolute",width:0,height:0}),r.insertBefore(o,r.firstChild),o),this._init()}function Eo(e,t,n){q(e,{left:t+"px",top:n+"px"})}function So(e,t){e.style.display=!1===t?"none":""}function ko(e,t){e.style["transform-origin"]="top left",["","-ms-","-webkit-"].forEach(function(n){e.style[n+"transform"]=t})}wo.$inject=["config.overlays","eventBus","canvas","elementRegistry"],wo.prototype.get=function(e){if(y(e)&&(e={id:e}),y(e.element)&&(e.element=this._elementRegistry.get(e.element)),e.element){var t=this._getOverlayContainer(e.element,!0);return t?e.type?x(t.overlays,j({type:e.type})):t.overlays.slice():[]}return e.type?x(this._overlays,j({type:e.type})):e.id?this._overlays[e.id]:null},wo.prototype.add=function(e,t,n){if(f(t)&&(n=t,t=null),e.id||(e=this._elementRegistry.get(e)),!n.position)throw new Error("must specifiy overlay position");if(!n.html)throw new Error("must specifiy overlay html");if(!e)throw new Error("invalid element specified");var i=this._ids.next();return n=z({},this._overlayDefaults,n,{id:i,type:t,element:e,html:n.html}),this._addOverlay(n),i},wo.prototype.remove=function(e){var t=this.get(e)||[];d(t)||(t=[t]);var n=this;w(t,function(e){var t=n._getOverlayContainer(e.element,!0);if(e&&(pe(e.html),pe(e.htmlContainer),delete e.htmlContainer,delete e.element,delete n._overlays[e.id]),t){var i=t.overlays.indexOf(e);-1!==i&&t.overlays.splice(i,1)}})},wo.prototype.isShown=function(){return"none"!==this._overlayRoot.style.display},wo.prototype.show=function(){So(this._overlayRoot)},wo.prototype.hide=function(){So(this._overlayRoot,!1)},wo.prototype.clear=function(){this._overlays={},this._overlayContainers=[],Q(this._overlayRoot)},wo.prototype._updateOverlayContainer=function(e){var t=e.element,n=e.html,i=t.x,r=t.y;if(t.waypoints){var o=at(t);i=o.x,r=o.y}Eo(n,i,r),K(e.html,"data-container-id",t.id)},wo.prototype._updateOverlay=function(e){var t,n,i=e.position,r=e.htmlContainer,o=e.element,a=i.left,s=i.top;void 0!==i.right&&(t=o.waypoints?at(o).width:o.width,a=-1*i.right+t);void 0!==i.bottom&&(n=o.waypoints?at(o).height:o.height,s=-1*i.bottom+n);Eo(r,a||0,s||0),this._updateOverlayVisibilty(e,this._canvas.viewbox())},wo.prototype._createOverlayContainer=function(e){var t=W('<div class="djs-overlays" />');q(t,{position:"absolute"}),this._overlayRoot.appendChild(t);var n={html:t,element:e,overlays:[]};return this._updateOverlayContainer(n),this._overlayContainers.push(n),n},wo.prototype._updateRoot=function(e){var t=e.scale||1,n="matrix("+[t,0,0,t,-1*e.x*t,-1*e.y*t].join(",")+")";ko(this._overlayRoot,n)},wo.prototype._getOverlayContainer=function(e,t){var n=b(this._overlayContainers,function(t){return t.element===e});return n||t?n:this._createOverlayContainer(e)},wo.prototype._addOverlay=function(e){var t,n,i=e.id,r=e.element,o=e.html;o.get&&o.constructor.prototype.jquery&&(o=o.get(0)),y(o)&&(o=W(o)),n=this._getOverlayContainer(r),q(t=W('<div class="djs-overlay" data-overlay-id="'+i+'">'),{position:"absolute"}),t.appendChild(o),e.type&&X(t).add("djs-overlay-"+e.type),So(t,this._canvas.findRoot(r)===this._canvas.getRootElement()),e.htmlContainer=t,n.overlays.push(e),n.html.appendChild(t),this._overlays[i]=e,this._updateOverlay(e),this._updateOverlayVisibilty(e,this._canvas.viewbox())},wo.prototype._updateOverlayVisibilty=function(e,t){var n=e.show,i=this._canvas.findRoot(e.element),r=n&&n.minZoom,o=n&&n.maxZoom,a=e.htmlContainer,s=!0;(i!==this._canvas.getRootElement()||n&&(u(r)&&r>t.scale||u(o)&&o<t.scale))&&(s=!1),So(a,s),this._updateOverlayScale(e,t)},wo.prototype._updateOverlayScale=function(e,t){var n,i,r,o=e.scale,a=e.htmlContainer,s="";!0!==o&&(!1===o?(n=1,i=1):(n=o.min,i=o.max),u(n)&&t.scale<n&&(r=(1/t.scale||1)*n),u(i)&&t.scale>i&&(r=(1/t.scale||1)*i)),u(r)&&(s="scale("+r+","+r+")"),ko(a,s)},wo.prototype._updateOverlaysVisibilty=function(e){var t=this;w(this._overlays,function(n){t._updateOverlayVisibilty(n,e)})},wo.prototype._init=function(){var e=this._eventBus,t=this;e.on("canvas.viewbox.changing",function(e){t.hide()}),e.on("canvas.viewbox.changed",function(e){var n;n=e.viewbox,t._updateRoot(n),t._updateOverlaysVisibilty(n),t.show()}),e.on(["shape.remove","connection.remove"],function(e){var n=e.element;w(t.get({element:n}),function(e){t.remove(e.id)});var i=t._getOverlayContainer(n);if(i){pe(i.html);var r=t._overlayContainers.indexOf(i);-1!==r&&t._overlayContainers.splice(r,1)}}),e.on("element.changed",500,function(e){var n=e.element,i=t._getOverlayContainer(n,!0);i&&(w(i.overlays,function(e){t._updateOverlay(e)}),t._updateOverlayContainer(i))}),e.on("element.marker.update",function(e){var n=t._getOverlayContainer(e.element,!0);n&&X(n.html)[e.add?"add":"remove"](e.marker)}),e.on("root.set",function(){t._updateOverlaysVisibilty(t._canvas.viewbox())}),e.on("diagram.clear",this.clear,this)};var Co={__init__:["overlays"],overlays:["type",wo]};function Ro(e,t,n,i){e.on("element.changed",function(i){var r=i.element;(r.parent||r===t.getRootElement())&&(i.gfx=n.getGraphics(r)),i.gfx&&e.fire(ct(r)+".changed",i)}),e.on("elements.changed",function(t){var n=t.elements;n.forEach(function(t){e.fire("element.changed",{element:t})}),i.updateContainments(n)}),e.on("shape.changed",function(e){i.update("shape",e.element,e.gfx)}),e.on("connection.changed",function(e){i.update("connection",e.element,e.gfx)})}Ro.$inject=["eventBus","canvas","elementRegistry","graphicsFactory"];var Po={__init__:["changeSupport"],changeSupport:["type",Ro]};function Ao(e){this._eventBus=e}function Mo(e){return function(t,n,i,r,o){(g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),this.on(t,e,n,i,r,o)}}function To(e,t){t.invoke(Ao,this),this.executed(function(t){var n=t.context;n.rootElement?e.setRootElement(n.rootElement):n.rootElement=e.getRootElement()}),this.revert(function(t){var n=t.context;n.rootElement&&e.setRootElement(n.rootElement)})}Ao.$inject=["eventBus"],Ao.prototype.on=function(e,t,n,i,r,o){if((g(t)||m(t))&&(o=r,r=i,i=n,n=t,t=null),g(n)&&(o=r,r=i,i=n,n=1e3),f(r)&&(o=r,r=!1),!g(i))throw new Error("handlerFn must be a function");d(e)||(e=[e]);var a=this._eventBus;w(e,function(e){var s=["commandStack",e,t].filter(function(e){return e}).join(".");a.on(s,n,r?function(e,t){return function(n){return e.call(t||null,n.context,n.command,n)}}(i,o):i,o)})},Ao.prototype.canExecute=Mo("canExecute"),Ao.prototype.preExecute=Mo("preExecute"),Ao.prototype.preExecuted=Mo("preExecuted"),Ao.prototype.execute=Mo("execute"),Ao.prototype.executed=Mo("executed"),Ao.prototype.postExecute=Mo("postExecute"),Ao.prototype.postExecuted=Mo("postExecuted"),Ao.prototype.revert=Mo("revert"),Ao.prototype.reverted=Mo("reverted"),e(To,Ao),To.$inject=["canvas","injector"];var Bo={__init__:["rootElementsBehavior"],rootElementsBehavior:["type",To]};function Do(e){return CSS.escape(e)}var jo={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Oo(e){return(e=""+e)&&e.replace(/[&<>"']/g,function(e){return jo[e]})}var No="_plane";function Lo(e){return function(e){return e.replace(new RegExp(No+"$"),"")}(e.id)}function $o(e){var t=e.id;return ar(e,"bpmn:SubProcess")?zo(t):t}function Io(e){return zo(e)}function Fo(e){return ar(lr(e),"bpmndi:BPMNPlane")}function zo(e){return e+No}function Ho(e,t,n){var i=W('<ul class="bjs-breadcrumbs"></ul>'),r=n.getContainer(),o=X(r);r.appendChild(i);var a=[];function s(e){e&&(a=function(e){for(var t=cr(e),n=[],i=t;i;i=i.$parent)(ar(i,"bpmn:SubProcess")||ar(i,"bpmn:Process"))&&n.push(i);return n.reverse()}(e));var r=a.flatMap(function(e){var i=n.findRoot($o(e))||n.findRoot(e.id);if(!i&&ar(e,"bpmn:Process")){var r=t.find(function(t){var n=cr(t);return n&&n.get("processRef")===e});i=r&&n.findRoot(r.id)}return i?[{parent:e,parentPlane:i}]:[]});i.innerHTML="";var s=r.length>1;o.toggle("bjs-breadcrumbs-shown",s),r.forEach(function(e,t){var o,a=e.parent,s=e.parentPlane,c=Oo(a.name||a.id);t===r.length-1?o=W('<li><span class="bjs-crumb" title="'+c+'">'+c+"</span></li>"):(o=W('<li><a class="bjs-crumb" href="'+("#"+Oo(a.id))+'" title="'+c+'">'+c+"</a></li>")).addEventListener("click",function(e){e.preventDefault(),n.setRootElement(s)});i.appendChild(o)})}e.on("element.changed",function(e){var t=cr(e.element);b(a,function(e){return e===t})&&s()}),e.on("root.set",function(e){s(e.element)})}function Vo(e,t){var n=null,i=new Go;e.on("root.set",function(e){var r=e.element,o=t.viewbox(),a=i.get(r);if(i.set(n,{x:o.x,y:o.y,zoom:o.scale}),n=r,ar(r,"bpmn:SubProcess")||a){a=a||{x:0,y:0,zoom:1};var s=(o.x-a.x)*o.scale,c=(o.y-a.y)*o.scale;0===s&&0===c||t.scroll({dx:s,dy:c}),a.zoom!==o.scale&&t.zoom(a.zoom,{x:0,y:0})}}),e.on("diagram.clear",function(){i.clear(),n=null})}function Go(){this._entries=[],this.set=function(e,t){var n=!1;for(var i in this._entries)if(this._entries[i][0]===e){this._entries[i][1]=t,n=!0;break}n||this._entries.push([e,t])},this.get=function(e){for(var t in this._entries)if(this._entries[t][0]===e)return this._entries[t][1];return null},this.clear=function(){this._entries.length=0},this.remove=function(e){var t=-1;for(var n in this._entries)if(this._entries[n][0]===e){t=n;break}-1!==t&&this._entries.splice(t,1)}}Ho.$inject=["eventBus","elementRegistry","canvas"],Vo.$inject=["eventBus","canvas"];var Wo=180,Uo=160;function qo(e,t){this._eventBus=e,this._moddle=t;var n=this;e.on("import.render.start",1500,function(e,t){n._handleImport(t.definitions)})}function Ko(e){return ar(e,"bpmndi:BPMNDiagram")?e:Ko(e.$parent)}qo.prototype._handleImport=function(e){if(e.diagrams){var t=this;this._definitions=e,this._processToDiagramMap={},e.diagrams.forEach(function(e){e.plane&&e.plane.bpmnElement&&(t._processToDiagramMap[e.plane.bpmnElement.id]=e)}),e.diagrams.filter(e=>e.plane).flatMap(e=>t._createNewDiagrams(e.plane)).forEach(function(e){t._movePlaneElementsToOrigin(e.plane)})}},qo.prototype._createNewDiagrams=function(e){var t=this,n=[],i=[];e.get("planeElement").forEach(function(t){var r=t.bpmnElement;if(r){var o=r.$parent;ar(r,"bpmn:SubProcess")&&!t.isExpanded&&n.push(r),function(e,t){var n=e.$parent;if(!ar(n,"bpmn:SubProcess")||n===t.bpmnElement)return!1;if(sr(e,["bpmn:DataInputAssociation","bpmn:DataOutputAssociation"]))return!1;return!0}(r,e)&&i.push({diElement:t,parent:o})}});var r=[];return n.forEach(function(e){if(!t._processToDiagramMap[e.id]){var n=t._createDiagram(e);t._processToDiagramMap[e.id]=n,r.push(n)}}),i.forEach(function(e){for(var i=e.diElement,r=e.parent;r&&-1===n.indexOf(r);)r=r.$parent;if(r){var o=t._processToDiagramMap[r.id];t._moveToDiPlane(i,o.plane)}}),r},qo.prototype._movePlaneElementsToOrigin=function(e){var t=e.get("planeElement"),n=function(e){var t={top:1/0,right:-1/0,bottom:-1/0,left:1/0};return e.planeElement.forEach(function(e){if(e.bounds){var n=tn(e.bounds);t.top=Math.min(n.top,t.top),t.left=Math.min(n.left,t.left)}}),nn(t)}(e),i=n.x-Wo,r=n.y-Uo;t.forEach(function(e){e.waypoint?e.waypoint.forEach(function(e){e.x=e.x-i,e.y=e.y-r}):e.bounds&&(e.bounds.x=e.bounds.x-i,e.bounds.y=e.bounds.y-r)})},qo.prototype._moveToDiPlane=function(e,t){var n=Ko(e).plane.get("planeElement");n.splice(n.indexOf(e),1),t.get("planeElement").push(e)},qo.prototype._createDiagram=function(e){var t=this._moddle.create("bpmndi:BPMNPlane",{bpmnElement:e}),n=this._moddle.create("bpmndi:BPMNDiagram",{plane:t});return t.$parent=n,t.bpmnElement=e,n.$parent=this._definitions,this._definitions.diagrams.push(n),n},qo.$inject=["eventBus","moddle"];var Yo=250;function Xo(e,t,n,i,r){Ao.call(this,t),this._canvas=e,this._eventBus=t,this._elementRegistry=n,this._overlays=i,this._translate=r;var o=this;this.executed("shape.toggleCollapse",Yo,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.reverted("shape.toggleCollapse",Yo,function(e){var t=e.shape;o._canDrillDown(t)?o._addOverlay(t):o._removeOverlay(t)},!0),this.executed(["shape.create","shape.move","shape.delete"],Yo,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),this.reverted(["shape.create","shape.move","shape.delete"],Yo,function(e){var t=e.oldParent,n=e.newParent||e.parent,i=e.shape;o._canDrillDown(i)&&o._addOverlay(i),o._updateDrilldownOverlay(t),o._updateDrilldownOverlay(n),o._updateDrilldownOverlay(i)},!0),t.on("import.render.complete",function(){n.filter(function(e){return o._canDrillDown(e)}).map(function(e){o._addOverlay(e)})})}e(Xo,Ao),Xo.prototype._updateDrilldownOverlay=function(e){var t=this._canvas;if(e){var n=t.findRoot(e);n&&this._updateOverlayVisibility(n)}},Xo.prototype._canDrillDown=function(e){var t=this._canvas;return ar(e,"bpmn:SubProcess")&&t.findRoot($o(e))},Xo.prototype._updateOverlayVisibility=function(e){var t=this._overlays,n=cr(e),i=t.get({element:n.id,type:"drilldown"})[0];if(i){var r=n&&n.get("flowElements")&&n.get("flowElements").length;X(i.html).toggle("bjs-drilldown-empty",!r)}},Xo.prototype._addOverlay=function(e){var t=this._canvas,n=this._overlays,i=cr(e);n.get({element:e,type:"drilldown"}).length&&this._removeOverlay(e);var r=W('<button type="button" class="bjs-drilldown"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4.81801948,3.50735931 L10.4996894,9.1896894 L10.5,4 L12,4 L12,12 L4,12 L4,10.5 L9.6896894,10.4996894 L3.75735931,4.56801948 C3.46446609,4.27512627 3.46446609,3.80025253 3.75735931,3.50735931 C4.05025253,3.21446609 4.52512627,3.21446609 4.81801948,3.50735931 Z"/></svg></button>'),o=i.get("name")||i.get("id"),a=this._translate("Open {element}",{element:o});r.setAttribute("title",a),r.addEventListener("click",function(){t.setRootElement(t.findRoot($o(e)))}),n.add(e,"drilldown",{position:{bottom:-7,right:-8},html:r}),this._updateOverlayVisibility(e)},Xo.prototype._removeOverlay=function(e){this._overlays.remove({element:e,type:"drilldown"})},Xo.$inject=["canvas","eventBus","elementRegistry","overlays","translate"];var Zo={__depends__:[Co,Po,Bo],__init__:["drilldownBreadcrumbs","drilldownOverlayBehavior","drilldownCentering","subprocessCompatibility"],drilldownBreadcrumbs:["type",Ho],drilldownCentering:["type",Vo],drilldownOverlayBehavior:["type",Xo],subprocessCompatibility:["type",qo]};function Qo(e){e&&"function"==typeof e.stopPropagation&&e.stopPropagation()}function Jo(e){return e.originalEvent||e.srcEvent}function ea(e){Qo(e),Qo(Jo(e))}function ta(e){return e.pointers&&e.pointers.length&&(e=e.pointers[0]),e.touches&&e.touches.length&&(e=e.touches[0]),e?{x:e.clientX,y:e.clientY}:null}function na(){return/mac/i.test(navigator.platform)}function ia(e,t){return(Jo(e)||e).button===t}function ra(e){return ia(e,0)}function oa(e){var t=Jo(e)||e;return!!ra(e)&&(na()?t.metaKey:t.ctrlKey)}function aa(e){var t=Jo(e)||e;return ra(e)&&t.shiftKey}function sa(e){return!0}function ca(e){return ra(e)||function(e){return ia(e,1)}(e)}function la(e,t,n){var i=this;function r(n,i,r){var o,a;(function(e,t){var n=c[e]||ra;return!n(t)})(n,i)||(r?a=t.getGraphics(r):(o=i.delegateTarget||i.target)&&(a=o,r=t.get(a)),a&&r&&!1===e.fire(n,{element:r,gfx:a,originalEvent:i})&&(i.stopPropagation(),i.preventDefault()))}var o={};function a(e){return o[e]}var s={click:"element.click",contextmenu:"element.contextmenu",dblclick:"element.dblclick",mousedown:"element.mousedown",mousemove:"element.mousemove",mouseover:"element.hover",mouseout:"element.out",mouseup:"element.mouseup"},c={"element.contextmenu":sa,"element.mousedown":ca,"element.mouseup":ca,"element.click":ca,"element.dblclick":ca};function l(e,t,n,i){var a=o[n]=function(e){r(n,e)};i&&(c[n]=i),a.$delegate=ae.bind(e,"svg, .djs-element",t,a)}function p(e,t,n){var i=a(n);i&&ae.unbind(e,t,i.$delegate)}e.on("canvas.destroy",function(e){var t;t=e.svg,w(s,function(e,n){p(t,n,e)})}),e.on("canvas.init",function(e){var t;t=e.svg,w(s,function(e,n){l(t,n,e)})}),e.on(["shape.added","connection.added"],function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.createHit",{element:n,gfx:i})}),e.on(["shape.changed","connection.changed"],500,function(t){var n=t.element,i=t.gfx;e.fire("interactionEvents.updateHit",{element:n,gfx:i})}),e.on("interactionEvents.createHit",500,function(e){var t=e.element,n=e.gfx;i.createDefaultHit(t,n)}),e.on("interactionEvents.updateHit",function(e){var t=e.element,n=e.gfx;i.updateDefaultHit(t,n)});var u=f("djs-hit djs-hit-stroke"),h=f("djs-hit djs-hit-click-stroke"),d={all:f("djs-hit djs-hit-all"),"click-stroke":h,stroke:u,"no-move":f("djs-hit djs-hit-no-move")};function f(e,t){return t=z({stroke:"white",strokeWidth:15},t||{}),n.cls(e,["no-fill","no-border"],t)}function m(e,t){var n=d[t];if(!n)throw new Error("invalid hit type <"+t+">");return fe(e,n),e}function g(e,t){ue(e,t)}this.removeHits=function(e){w(le(".djs-hit",e),je)},this.createDefaultHit=function(e,t){var n,i=e.waypoints,r=e.isFrame;return i?this.createWaypointsHit(t,i):(n=r?"stroke":"all",this.createBoxHit(t,n,{width:e.width,height:e.height}))},this.createWaypointsHit=function(e,t){var n=et(t);return m(n,"stroke"),g(e,n),n},this.createBoxHit=function(e,t,n){n=z({x:0,y:0},n);var i=Ee("rect");return m(i,t),fe(i,n),g(e,i),i},this.updateDefaultHit=function(e,t){var n=ce(".djs-hit",t);if(n)return e.waypoints?tt(n,e.waypoints):fe(n,{width:e.width,height:e.height}),n},this.fire=r,this.triggerMouseEvent=function(e,t,n){var i=s[e];if(!i)throw new Error("unmapped DOM event name <"+e+">");return r(i,t,n)},this.mouseHandler=a,this.registerEvent=l,this.unregisterEvent=p}la.$inject=["eventBus","elementRegistry","styles"];var pa={__init__:["interactionEvents"],interactionEvents:["type",la]};function ua(e,t){this._eventBus=e,this._canvas=t,this._selectedElements=new Set;var n=this;e.on(["shape.remove","connection.remove"],function(e){var t=e.element;n.deselect(t)}),e.on(["diagram.clear","root.set"],function(e){n.select(null)})}ua.$inject=["eventBus","canvas"],ua.prototype.deselect=function(e){if(this._selectedElements.has(e)){var t=this.get();this._selectedElements.delete(e),this._eventBus.fire("selection.changed",{oldSelection:t,newSelection:this.get()})}},ua.prototype.get=function(){return Array.from(this._selectedElements)},ua.prototype.isSelected=function(e){return this._selectedElements.has(e)},ua.prototype.select=function(e,t){var n=this.get();d(e)||(e=e?[e]:[]);var i=this._canvas,r=i.getRootElement();e=e.filter(function(e){var t=i.findRoot(e);return r===t}),t?w(e,e=>{this._selectedElements.add(e)}):this._selectedElements=new Set(e),this._eventBus.fire("selection.changed",{oldSelection:n,newSelection:this.get()})};var ha="hover",da="selected";function fa(e,t){function n(t,n){e.addMarker(t,n)}function i(t,n){e.removeMarker(t,n)}this._canvas=e,t.on("element.hover",function(e){n(e.element,ha)}),t.on("element.out",function(e){i(e.element,ha)}),t.on("selection.changed",function(e){function t(e){i(e,da)}function r(e){n(e,da)}var o=new Set(e.oldSelection),a=new Set(e.newSelection);for(let e of o)a.has(e)||t(e);for(let e of a)o.has(e)||r(e)})}function ma(e,t,n,i){e.on("create.end",500,function(e){var n=e.context,i=n.canExecute,r=n.elements,o=(n.hints||{}).autoSelect;if(i){if(!1===o)return;d(o)?t.select(o):t.select(r.filter(ga))}}),e.on("connect.end",500,function(e){var n=e.context.connection;n&&t.select(n)}),e.on("shape.move.end",500,function(e){var n=e.previousSelection||[],r=i.get(e.context.shape.id);b(n,function(e){return r.id===e.id})||t.select(r)}),e.on("element.click",function(e){if(ra(e)){var i=e.element;i===n.getRootElement()&&(i=null);var r=t.isSelected(i),o=t.get().length>1,a=aa(e);if(r&&o)return a?t.deselect(i):t.select(i);r?t.deselect(i):t.select(i,a)}})}function ga(e){return!e.hidden}fa.$inject=["canvas","eventBus"],ma.$inject=["eventBus","selection","canvas","elementRegistry"];var ya={__init__:["selectionVisuals","selectionBehavior"],__depends__:[pa],selection:["type",ua],selectionVisuals:["type",fa],selectionBehavior:["type",ma]};function va(e){wr.call(this,e)}e(va,wr),va.prototype._modules=[bo,Zo,Co,ya,fo],va.prototype._moddleExtensions={};function ba(e,t,n){this._selectionWasVisible=!1;const i=I(()=>{this._selectionWasVisible=r()},300);function r(){var e=n.get();if(!e.length)return!1;var i=at(e),r=t.viewbox(),o=tn(i),a=tn(r);return o.left>=a.left&&o.right<=a.right&&o.top>=a.top&&o.bottom<=a.bottom}e.on("canvas.viewbox.changed",i),e.on("selection.changed",i),e.on("diagram.destroy",()=>{i.cancel()}),e.on("canvas.resized",()=>{var e=n.get();if(e.length&&this._selectionWasVisible&&!r()){var i=t.getRootElement();t.scrollToElement(e.concat(i))}}),this._flush=i.flush}ba.$inject=["eventBus","canvas","selection"];var _a={__init__:["keepSelectionVisible"],__depends__:[ya],keepSelectionVisible:["type",ba]},xa=["c","C"],wa=["v","V"],Ea=["d","D"],Sa=["x","X"],ka=["y","Y"],Ca=["z","Z"];function Ra(e){return!e.altKey&&(e.ctrlKey||e.metaKey)}function Pa(e,t){return-1!==(e=d(e)?e:[e]).indexOf(t.key)||-1!==e.indexOf(t.code)}function Aa(e){return e.shiftKey}var Ma="keyboard.keydown",Ta="Keyboard binding is now implicit; explicit binding to an element got removed. For more information, see https://github.com/bpmn-io/diagram-js/issues/661";function Ba(e,t){var n=this;this._config=e=e||{},this._eventBus=t,this._keydownHandler=this._keydownHandler.bind(this),this._keyupHandler=this._keyupHandler.bind(this),t.on("diagram.destroy",function(){n._fire("destroy"),n.unbind()}),e.bindTo&&console.error("unsupported configuration <keyboard.bindTo>",new Error(Ta));var i=e&&!1!==e.bind;t.on("canvas.init",function(e){n._target=e.svg,i&&n.bind(),n._fire("init")})}Ba.$inject=["config.keyboard","eventBus"],Ba.prototype._keydownHandler=function(e){this._keyHandler(e,Ma)},Ba.prototype._keyupHandler=function(e){this._keyHandler(e,"keyboard.keyup")},Ba.prototype._keyHandler=function(e,t){if(!this._isEventIgnored(e)){var n={keyEvent:e};this._eventBus.fire(t||Ma,n)&&e.preventDefault()}},Ba.prototype._isEventIgnored=function(e){return!1},Ba.prototype.bind=function(e){e&&console.error("unsupported argument <node>",new Error(Ta)),this.unbind(),e=this._node=this._target,re.bind(e,"keydown",this._keydownHandler),re.bind(e,"keyup",this._keyupHandler),this._fire("bind")},Ba.prototype.getBinding=function(){return this._node},Ba.prototype.unbind=function(){var e=this._node;e&&(this._fire("unbind"),re.unbind(e,"keydown",this._keydownHandler),re.unbind(e,"keyup",this._keyupHandler)),this._node=null},Ba.prototype._fire=function(e){this._eventBus.fire("keyboard."+e,{node:this._node})},Ba.prototype.addListener=function(e,t,n){g(e)&&(n=t,t=e,e=1e3),this._eventBus.on(n||Ma,e,t)},Ba.prototype.removeListener=function(e,t){this._eventBus.off(t||Ma,e)},Ba.prototype.hasModifier=function(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey},Ba.prototype.isCmd=Ra,Ba.prototype.isShift=Aa,Ba.prototype.isKey=Pa;function Da(e,t){var n=this;e.on("editorActions.init",500,function(e){var i=e.editorActions;n.registerBindings(t,i)})}Da.$inject=["eventBus","keyboard"],Da.prototype.registerBindings=function(e,t){function n(n,i){t.isRegistered(n)&&e.addListener(i)}n("undo",function(e){if(function(e){return Ra(e)&&!Aa(e)&&Pa(Ca,e)}(e.keyEvent))return t.trigger("undo"),!0}),n("redo",function(e){if(function(e){return Ra(e)&&(Pa(ka,e)||Pa(Ca,e)&&Aa(e))}(e.keyEvent))return t.trigger("redo"),!0}),n("copy",function(e){if(function(e){return Ra(e)&&Pa(xa,e)}(e.keyEvent))return t.trigger("copy"),!0}),n("paste",function(e){if(function(e){return Ra(e)&&Pa(wa,e)}(e.keyEvent))return t.trigger("paste"),!0}),n("duplicate",function(e){if(function(e){return Ra(e)&&Pa(Ea,e)}(e.keyEvent))return t.trigger("duplicate"),!0}),n("cut",function(e){if(function(e){return Ra(e)&&Pa(Sa,e)}(e.keyEvent))return t.trigger("cut"),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(Pa(["+","Add","="],n)&&Ra(n))return t.trigger("stepZoom",{value:1}),!0}),n("stepZoom",function(e){var n=e.keyEvent;if(Pa(["-","Subtract"],n)&&Ra(n))return t.trigger("stepZoom",{value:-1}),!0}),n("zoom",function(e){var n=e.keyEvent;if(Pa("0",n)&&Ra(n))return t.trigger("zoom",{value:1}),!0}),n("removeSelection",function(e){if(Pa(["Backspace","Delete","Del"],e.keyEvent))return t.trigger("removeSelection"),!0})};var ja={__init__:["keyboard","keyboardBindings"],keyboard:["type",Ba],keyboardBindings:["type",Da]},Oa={moveSpeed:50,moveSpeedAccelerated:200};function Na(e,t,n){var i=this;this._config=z({},Oa,e||{}),t.addListener(function(e){var n=e.keyEvent,r=i._config;if(!t.isCmd(n))return;if(t.isKey(["ArrowLeft","Left","ArrowUp","Up","ArrowDown","Down","ArrowRight","Right"],n)){var o,a=t.isShift(n)?r.moveSpeedAccelerated:r.moveSpeed;switch(n.key){case"ArrowLeft":case"Left":o="left";break;case"ArrowUp":case"Up":o="up";break;case"ArrowRight":case"Right":o="right";break;case"ArrowDown":case"Down":o="down"}return i.moveCanvas({speed:a,direction:o}),!0}}),this.moveCanvas=function(e){var t=0,i=0,r=e.speed/Math.min(Math.sqrt(n.viewbox().scale),1);switch(e.direction){case"left":t=r;break;case"up":i=r;break;case"right":t=-r;break;case"down":i=-r}n.scroll({dx:t,dy:i})}}Na.$inject=["config.keyboardMove","keyboard","canvas"];var La={__depends__:[ja],__init__:["keyboardMove"],keyboardMove:["type",Na]},$a=/^djs-cursor-.*$/;function Ia(e){var t=X(document.body);t.removeMatching($a),e&&t.add("djs-cursor-"+e)}function Fa(){Ia(null)}function za(e,t){function n(){return!1}return t=t||"element.click",e.once(t,5e3,n),function(){e.off(t,n)}}function Ha(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Va(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Ga(e,t){var n;function i(e){return a(e.originalEvent)}function r(i){var r,o=n.start,a=n.button,s=ta(i),c=Va(s,o);(!n.dragging&&(r=c,Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2))>15)&&(n.dragging=!0,0===a&&za(e),Ia("grab")),n.dragging)&&(c=Va(s,n.last||n.start),t.scroll({dx:c.x,dy:c.y}),n.last=s);i.preventDefault()}function o(e){re.unbind(document,"mousemove",r),re.unbind(document,"mouseup",o),n=null,Fa()}function a(e){if(!J(e.target,".djs-draggable")){var t=e.button;if(!(t>=2||e.ctrlKey||e.shiftKey||e.altKey))return n={button:t,start:ta(e)},re.bind(document,"mousemove",r),re.bind(document,"mouseup",o),!0}}e.on("canvas.focus.changed",function(t){t.focused?e.on("element.mousedown",500,i):e.off("element.mousedown",i)}),this.isActive=function(){return!!n}}Ga.$inject=["eventBus","canvas"];var Wa={__init__:["moveCanvas"],moveCanvas:["type",Ga]};function Ua(e){return Math.log(e)/Math.log(10)}function qa(e,t){var n=Ua(e.min),i=Ua(e.max);return(Math.abs(n)+Math.abs(i))/t}var Ka=Math.sign||function(e){return e>=0?1:-1},Ya={min:.2,max:4};function Xa(e,t,n){e=e||{},this._enabled=!1,this._canvas=n,this._container=n._container,this._handleWheel=F(this._handleWheel,this),this._totalDelta=0,this._scale=e.scale||.75;var i=this;t.on("canvas.mouseover",function(){i._init(!1!==e.enabled)}),t.on("canvas.mouseout",function(){i._init(!1)})}Xa.$inject=["config.zoomScroll","eventBus","canvas"],Xa.prototype.scroll=function(e){this._canvas.scroll(e)},Xa.prototype.reset=function(){this._canvas.zoom("fit-viewport")},Xa.prototype.zoom=function(e,t){var n=qa(Ya,20);this._totalDelta+=e,Math.abs(this._totalDelta)>.1&&(this._zoom(e,t,n),this._totalDelta=0)},Xa.prototype._handleWheel=function(e){if(this._enabled){var t=this._container;e.preventDefault();var n,i=e.ctrlKey||na()&&e.metaKey,r=e.shiftKey,o=-1*this._scale;if(o*=i?0===e.deltaMode?.02:.32:0===e.deltaMode?1:16,i){var a=t.getBoundingClientRect(),s={x:e.clientX-a.left,y:e.clientY-a.top};n=Math.sqrt(Math.pow(e.deltaY,2)+Math.pow(e.deltaX,2))*Ka(e.deltaY)*o,this.zoom(n,s)}else n=r?{dx:o*e.deltaY,dy:0}:{dx:o*e.deltaX,dy:o*e.deltaY},this.scroll(n)}},Xa.prototype.stepZoom=function(e,t){var n=qa(Ya,10);this._zoom(e,t,n)},Xa.prototype._zoom=function(e,t,n){var i=this._canvas,r=e>0?1:-1,o=Ua(i.zoom()),a=Math.round(o/n)*n;a+=n*r;var s,c,l=Math.pow(10,a);i.zoom((s=Ya,c=l,Math.max(s.min,Math.min(s.max,c))),t)},Xa.prototype.toggle=function(e){var t=this._container,n=this._handleWheel,i=this._enabled;return void 0===e&&(e=!i),i!==e&&re[e?"bind":"unbind"](t,"wheel",n,!1),this._enabled=e,e},Xa.prototype._init=function(e){this.toggle(e)};var Za={__init__:["zoomScroll"],zoomScroll:["type",Xa]};function Qa(e){va.call(this,e)}function Ja(e){return e&&e[e.length-1]}function es(e){return e.y}function ts(e){return e.x}e(Qa,va),Qa.prototype._navigationModules=[_a,La,Wa,Za],Qa.prototype._modules=[].concat(va.prototype._modules,Qa.prototype._navigationModules);var ns={left:ts,center:ts,right:function(e){return e.x+e.width},top:es,middle:es,bottom:function(e){return e.y+e.height}};function is(e,t){this._modeling=e,this._rules=t}is.$inject=["modeling","rules"],is.prototype._getOrientationDetails=function(e){var t="x",n="width";return-1!==["top","bottom","middle"].indexOf(e)&&(t="y",n="height"),{axis:t,dimension:n}},is.prototype._isType=function(e,t){return-1!==t.indexOf(e)},is.prototype._alignmentPosition=function(e,t){var n,i,r,o=this._getOrientationDetails(e),a=o.axis,s=o.dimension,c={},l={},p=!1;if(this._isType(e,["left","top"]))c[e]=t[0][a];else if(this._isType(e,["right","bottom"]))r=Ja(t),c[e]=r[a]+r[s];else if(this._isType(e,["center","middle"])){if(w(t,function(e){var t=e[a]+Math.round(e[s]/2);l[t]?l[t].elements.push(e):l[t]={elements:[e],center:t}}),n=D(l,function(e){return e.elements.length>1&&(p=!0),e.elements.length}),p)return c[e]=Ja(n).center,c;i=t[0],r=Ja(t=D(t,function(e){return e[a]+e[s]})),c[e]=function(e,t){return Math.round((e[a]+t[a]+t[s])/2)}(i,r)}return c},is.prototype.trigger=function(e,t){var n,i=this._modeling,r=x(e,function(e){return!(e.waypoints||e.host||e.labelTarget)});if(d(n=this._rules.allowed("elements.align",{elements:r}))&&(r=n),!(r.length<2)&&n){var o=D(r,ns[t]),a=this._alignmentPosition(t,o);i.alignElements(o,a)}};var rs={__init__:["alignElements"],alignElements:["type",is]};const os=new _o;function as(e){this._scheduled={},e.on("diagram.destroy",()=>{Object.keys(this._scheduled).forEach(e=>{this.cancel(e)})})}as.$inject=["eventBus"],as.prototype.schedule=function(e,t=os.next()){this.cancel(t);const n=this._schedule(e,t);return this._scheduled[t]=n,n.promise},as.prototype._schedule=function(e,t){const n=function(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}(),i=setTimeout(()=>{try{this._scheduled[t]=null;try{n.resolve(e())}catch(e){n.reject(e)}}catch(e){console.error("Scheduler#_schedule execution failed",e)}});return{executionId:i,promise:n.promise}},as.prototype.cancel=function(e){const t=this._scheduled[e];t&&(this._cancel(t),this._scheduled[e]=null)},as.prototype._cancel=function(e){clearTimeout(e.executionId)};var ss={scheduler:["type",as]},cs=".entry";function ls(e,t,n,i){this._canvas=e,this._elementRegistry=t,this._eventBus=n,this._scheduler=i,this._current=null,this._init()}ls.$inject=["canvas","elementRegistry","eventBus","scheduler"],ls.prototype._init=function(){var e=this;this._eventBus.on("selection.changed",function(t){var n=t.newSelection,i=n.length?1===n.length?n[0]:n:null;i?e.open(i,!0):e.close()}),this._eventBus.on("elements.changed",function(t){var n=t.elements,i=e._current;if(i){var r=i.target,o=d(r)?r:[r];if(o.filter(function(e){return n.includes(e)}).length){e.close();var a=o.filter(function(t){return e._elementRegistry.get(t.id)});a.length&&e._updateAndOpen(a.length>1?a:a[0])}}}),this._eventBus.on("canvas.viewbox.changed",function(){e._updatePosition()}),this._eventBus.on("element.marker.update",function(t){if(e.isOpen()){var n=t.element,i=e._current;(d(i.target)?i.target:[i.target]).includes(n)&&e._updateVisibility()}}),this._container=this._createContainer()},ls.prototype._createContainer=function(){var e=W('<div class="djs-context-pad-parent"></div>');return this._canvas.getContainer().appendChild(e),e},ls.prototype.registerProvider=function(e,t){t||(t=e,e=1e3),this._eventBus.on("contextPad.getProviders",e,function(e){e.providers.push(t)})},ls.prototype.getEntries=function(e){var t=this._getProviders(),n=d(e)?"getMultiElementContextPadEntries":"getContextPadEntries",i={};return w(t,function(t){if(g(t[n])){var r=t[n](e);g(r)?i=r(i):w(r,function(e,t){i[t]=e})}}),i},ls.prototype.trigger=function(e,t,n){var i,r,o=this,a=t.delegateTarget||t.target;return a?(i=K(a,"data-action"),r=t.originalEvent||t,"mouseover"!==e?"mouseout"===e?(clearTimeout(this._timeout),void(this._mouseout&&(this._mouseout(),this._mouseout=null))):this.triggerEntry(i,e,r,n):void(this._timeout=setTimeout(function(){o._mouseout=o.triggerEntry(i,"hover",r,n)},300))):t.preventDefault()},ls.prototype.triggerEntry=function(e,t,n,i){if(this.isShown()){var r=this._current.target,o=this._current.entries[e];if(o){var a=o.action;if(!1!==this._eventBus.fire("contextPad.trigger",{entry:o,event:n})){if(g(a)){if("click"===t)return a(n,r,i)}else if(a[t])return a[t](n,r,i);n.preventDefault()}}}},ls.prototype.open=function(e,t){!t&&this.isOpen(e)||!1!==this._eventBus.fire("contextPad.open.allowed",{target:e})&&(this.close(),this._updateAndOpen(e))},ls.prototype._getProviders=function(){var e=this._eventBus.createEvent({type:"contextPad.getProviders",providers:[]});return this._eventBus.fire(e),e.providers},ls.prototype._updateAndOpen=function(e){var t,n=this.getEntries(e),i=this._createHtml(e);w(n,function(e,n){var r,o=e.group||"default",a=W(e.html||'<div class="entry" draggable="true"></div>');K(a,"data-action",n),(r=ce("[data-group="+Do(o)+"]",i))||(K(r=W('<div class="group"></div>'),"data-group",o),i.appendChild(r)),r.appendChild(a),e.className&&function(e,t){var n=X(e);(t=d(t)?t:t.split(/\s+/g)).forEach(function(e){n.add(e)})}(a,e.className),e.title&&K(a,"title",e.title),e.imageUrl&&(K(t=W("<img>"),"src",e.imageUrl),t.style.width="100%",t.style.height="100%",a.appendChild(t))}),X(i).add("open"),this._current={entries:n,html:i,target:e},this._updatePosition(),this._updateVisibility(),this._eventBus.fire("contextPad.open",{current:this._current})},ls.prototype._createHtml=function(e){var t=this,n=W('<div class="djs-context-pad"></div>');return ae.bind(n,cs,"click",function(e){t.trigger("click",e)}),ae.bind(n,cs,"dragstart",function(e){t.trigger("dragstart",e)}),ae.bind(n,cs,"mouseover",function(e){t.trigger("mouseover",e)}),ae.bind(n,cs,"mouseout",function(e){t.trigger("mouseout",e)}),re.bind(n,"mousedown",function(e){e.stopPropagation()}),this._container.appendChild(n),this._eventBus.fire("contextPad.create",{target:e,pad:n}),n},ls.prototype.getPad=function(e){let t;return console.warn(new Error("ContextPad#getPad is deprecated and will be removed in future library versions, cf. https://github.com/bpmn-io/diagram-js/pull/888")),t=this.isOpen()&&function(e,t){return e=d(e)?e:[e],t=d(t)?t:[t],e.length===t.length&&k(e,function(e){return t.includes(e)})}(this._current.target,e)?this._current.html:this._createHtml(e),{html:t}},ls.prototype.close=function(){this.isOpen()&&(clearTimeout(this._timeout),this._container.innerHTML="",this._eventBus.fire("contextPad.close",{current:this._current}),this._current=null)},ls.prototype.isOpen=function(e){var t=this._current;if(!t)return!1;if(!e)return!0;var n=t.target;return d(e)===d(n)&&(d(e)?e.length===n.length&&k(e,function(e){return n.includes(e)}):n===e)},ls.prototype.isShown=function(){return this.isOpen()&&X(this._current.html).has("open")},ls.prototype.show=function(){this.isOpen()&&(X(this._current.html).add("open"),this._updatePosition(),this._eventBus.fire("contextPad.show",{current:this._current}))},ls.prototype.hide=function(){this.isOpen()&&(X(this._current.html).remove("open"),this._eventBus.fire("contextPad.hide",{current:this._current}))},ls.prototype._getPosition=function(e){if(!d(e)&&Zt(e)){var t=this._canvas.viewbox(),n=(o=e).waypoints[o.waypoints.length-1],i=n.x*t.scale-t.x*t.scale,r=n.y*t.scale-t.y*t.scale;return{left:i+8*this._canvas.zoom(),top:r}}var o,a=this._canvas.getContainer().getBoundingClientRect(),s=this._getTargetBounds(e);return{left:s.right-a.left+8*this._canvas.zoom(),top:s.top-a.top}},ls.prototype._updatePosition=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this._current.html,t=this._getPosition(this._current.target);"x"in t&&"y"in t?(e.style.left=t.x+"px",e.style.top=t.y+"px"):["top","right","bottom","left"].forEach(function(n){n in t&&(e.style[n]=t[n]+"px")})}},"ContextPad#_updatePosition")},ls.prototype._updateVisibility=function(){this._scheduler.schedule(()=>{if(this.isOpen()){var e=this,t=this._current.target;(d(t)?t:[t]).some(function(t){return e._canvas.hasMarker(t,"djs-element-hidden")})?e.hide():e.show()}},"ContextPad#_updateVisibility")},ls.prototype._getTargetBounds=function(e){var t=this;return(d(e)?e:[e]).map(function(e){return t._canvas.getGraphics(e)}).reduce(function(e,t){const n=t.getBoundingClientRect();return e.top=Math.min(e.top,n.top),e.right=Math.max(e.right,n.right),e.bottom=Math.max(e.bottom,n.bottom),e.left=Math.min(e.left,n.left),e.x=e.left,e.y=e.top,e.width=e.right-e.left,e.height=e.bottom-e.top,e},{top:1/0,right:-1/0,bottom:-1/0,left:1/0})};var ps,us,hs,ds,fs,ms,gs,ys,vs,bs,_s,xs,ws,Es,Ss={__depends__:[pa,ss,Co],contextPad:["type",ls]},ks={},Cs=[],Rs=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ps=Array.isArray;function As(e,t){for(var n in t)e[n]=t[n];return e}function Ms(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ts(e,t,n){var i,r,o,a={};for(o in t)"key"==o?i=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?ps.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return Bs(e,a,i,r,null)}function Bs(e,t,n,i,r){var o={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++hs:r,__i:-1,__u:0};return null==r&&null!=us.vnode&&us.vnode(o),o}function Ds(e){return e.children}function js(e,t){this.props=e,this.context=t}function Os(e,t){if(null==t)return e.__?Os(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Os(e):null}function Ns(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,i=[],r=[],o=As({},t);o.__v=t.__v+1,us.vnode&&us.vnode(o),qs(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,i,null==n?Os(t):n,!!(32&t.__u),r),o.__v=t.__v,o.__.__k[o.__i]=o,Ys(i,o,r),t.__e=t.__=null,o.__e!=n&&Ls(o)}}function Ls(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Ls(e)}function $s(e){(!e.__d&&(e.__d=!0)&&ds.push(e)&&!Is.__r++||fs!=us.debounceRendering)&&((fs=us.debounceRendering)||ms)(Is)}function Is(){try{for(var e,t=1;ds.length;)ds.length>t&&ds.sort(gs),e=ds.shift(),t=ds.length,Ns(e)}finally{ds.length=Is.__r=0}}function Fs(e,t,n,i,r,o,a,s,c,l,p){var u,h,d,f,m,g,y,v=i&&i.__k||Cs,b=t.length;for(c=zs(n,t,v,c,b),u=0;u<b;u++)null!=(d=n.__k[u])&&(h=-1!=d.__i&&v[d.__i]||ks,d.__i=u,g=qs(e,d,h,r,o,a,s,c,l,p),f=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&Qs(h.ref,null,d),p.push(d.ref,d.__c||f,d)),null==m&&null!=f&&(m=f),(y=!!(4&d.__u))||h.__k===d.__k?(c=Hs(d,c,e,y),y&&h.__e&&(h.__e=null)):"function"==typeof d.type&&void 0!==g?c=g:f&&(c=f.nextSibling),d.__u&=-7);return n.__e=m,c}function zs(e,t,n,i,r){var o,a,s,c,l,p=n.length,u=p,h=0;for(e.__k=new Array(r),o=0;o<r;o++)null!=(a=t[o])&&"boolean"!=typeof a&&"function"!=typeof a?("string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?a=e.__k[o]=Bs(null,a,null,null,null):Ps(a)?a=e.__k[o]=Bs(Ds,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[o]=Bs(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[o]=a,c=o+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(l=a.__i=Vs(a,n,c,u))&&(u--,(s=n[l])&&(s.__u|=2)),null==s||null==s.__v?(-1==l&&(r>p?h--:r<p&&h++),"function"!=typeof a.type&&(a.__u|=4)):l!=c&&(l==c-1?h--:l==c+1?h++:(l>c?h--:h++,a.__u|=4))):e.__k[o]=null;if(u)for(o=0;o<p;o++)null!=(s=n[o])&&!(2&s.__u)&&(s.__e==i&&(i=Os(s)),Js(s,s));return i}function Hs(e,t,n,i){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Hs(r[o],t,n,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=Os(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Vs(e,t,n,i){var r,o,a,s=e.key,c=e.type,l=t[n],p=null!=l&&!(2&l.__u);if(null===l&&null==s||p&&s==l.key&&c==l.type)return n;if(i>(p?1:0))for(r=n-1,o=n+1;r>=0||o<t.length;)if(null!=(l=t[a=r>=0?r--:o++])&&!(2&l.__u)&&s==l.key&&c==l.type)return a;return-1}function Gs(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||Rs.test(t)?n:n+"px"}function Ws(e,t,n,i,r){var o,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||Gs(e.style,t,"");if(n)for(t in n)i&&n[t]==i[t]||Gs(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(_s,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?i?n[bs]=i[bs]:(n[bs]=xs,e.addEventListener(t,o?Es:ws,o)):e.removeEventListener(t,o?Es:ws,o);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function Us(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[vs])t[vs]=xs++;else if(t[vs]<n[bs])return;return n(us.event?us.event(t):t)}}}function qs(e,t,n,i,r,o,a,s,c,l){var p,u,h,d,f,m,g,y,v,b,_,x,w,E,S,k=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),o=[s=t.__e=n.__e]),(p=us.__b)&&p(t);e:if("function"==typeof k)try{if(y=t.props,v=k.prototype&&k.prototype.render,b=(p=k.contextType)&&i[p.__c],_=p?b?b.props.value:p.__:i,n.__c?g=(u=t.__c=n.__c).__=u.__E:(v?t.__c=u=new k(y,_):(t.__c=u=new js(y,_),u.constructor=k,u.render=ec),b&&b.sub(u),u.state||(u.state={}),u.__n=i,h=u.__d=!0,u.__h=[],u._sb=[]),v&&null==u.__s&&(u.__s=u.state),v&&null!=k.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=As({},u.__s)),As(u.__s,k.getDerivedStateFromProps(y,u.__s))),d=u.props,f=u.state,u.__v=t,h)v&&null==k.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),v&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(v&&null==k.getDerivedStateFromProps&&y!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(y,_),t.__v==n.__v||!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(y,u.__s,_)){t.__v!=n.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),Cs.push.apply(u.__h,u._sb),u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(y,u.__s,_),v&&null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(d,f,m)})}if(u.context=_,u.props=y,u.__P=e,u.__e=!1,x=us.__r,w=0,v)u.state=u.__s,u.__d=!1,x&&x(t),p=u.render(u.props,u.state,u.context),Cs.push.apply(u.__h,u._sb),u._sb=[];else do{u.__d=!1,x&&x(t),p=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(i=As(As({},i),u.getChildContext())),v&&!h&&null!=u.getSnapshotBeforeUpdate&&(m=u.getSnapshotBeforeUpdate(d,f)),E=null!=p&&p.type===Ds&&null==p.key?Xs(p.props.children):p,s=Fs(e,Ps(E)?E:[E],t,n,i,r,o,a,s,c,l),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),g&&(u.__E=u.__=null)}catch(e){if(t.__v=null,c||null!=o)if(e.then){for(t.__u|=c?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else{for(S=o.length;S--;)Ms(o[S]);Ks(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ks(t);us.__e(e,t,n)}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=Zs(n.__e,t,n,i,r,o,a,c,l);return(p=us.diffed)&&p(t),128&t.__u?void 0:s}function Ks(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(Ks))}function Ys(e,t,n){for(var i=0;i<n.length;i++)Qs(n[i],n[++i],n[++i]);us.__c&&us.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){us.__e(e,t.__v)}})}function Xs(e){return"object"!=typeof e||null==e||e.__b>0?e:Ps(e)?e.map(Xs):void 0!==e.constructor?null:As({},e)}function Zs(e,t,n,i,r,o,a,s,c){var l,p,u,h,d,f,m,g=n.props||ks,y=t.props,v=t.type;if("svg"==v?r="http://www.w3.org/2000/svg":"math"==v?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=o)for(l=0;l<o.length;l++)if((d=o[l])&&"setAttribute"in d==!!v&&(v?d.localName==v:3==d.nodeType)){e=d,o[l]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(r,v,y.is&&y),s&&(us.__m&&us.__m(t,o),s=!1),o=null}if(null==v)g===y||s&&e.data==y||(e.data=y);else{if(o="textarea"==v&&null!=y.defaultValue?null:o&&ps.call(e.childNodes),!s&&null!=o)for(g={},l=0;l<e.attributes.length;l++)g[(d=e.attributes[l]).name]=d.value;for(l in g)d=g[l],"dangerouslySetInnerHTML"==l?u=d:"children"==l||l in y||"value"==l&&"defaultValue"in y||"checked"==l&&"defaultChecked"in y||Ws(e,l,null,d,r);for(l in y)d=y[l],"children"==l?h=d:"dangerouslySetInnerHTML"==l?p=d:"value"==l?f=d:"checked"==l?m=d:s&&"function"!=typeof d||g[l]===d||Ws(e,l,d,g[l],r);if(p)s||u&&(p.__html==u.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(u&&(e.innerHTML=""),Fs("template"==t.type?e.content:e,Ps(h)?h:[h],t,n,i,"foreignObject"==v?"http://www.w3.org/1999/xhtml":r,o,a,o?o[0]:n.__k&&Os(n,0),s,c),null!=o)for(l=o.length;l--;)Ms(o[l]);s&&"textarea"!=v||(l="value","progress"==v&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[l]||"progress"==v&&!f||"option"==v&&f!=g[l])&&Ws(e,l,f,g[l],r),l="checked",null!=m&&m!=e[l]&&Ws(e,l,m,g[l],r))}return e}function Qs(e,t,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){us.__e(e,n)}}function Js(e,t,n){var i,r;if(us.unmount&&us.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||Qs(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){us.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(r=0;r<i.length;r++)i[r]&&Js(i[r],t,n||"function"!=typeof e.type);n||Ms(e.__e),e.__c=e.__=e.__e=void 0}function ec(e,t,n){return this.constructor(e,n)}function tc(e,t,n){var i,r,o;t==document&&(t=document.documentElement),us.__&&us.__(e,t),i=!1?null:t.__k,r=[],o=[],qs(t,e=t.__k=Ts(Ds,null,[e]),i||ks,ks,t.namespaceURI,i?null:t.firstChild?ps.call(t.childNodes):null,r,i?i.__e:t.firstChild,false,o),Ys(r,e,o)}ps=Cs.slice,us={__e:function(e,t,n,i){for(var r,o,a;t=t.__;)if((r=t.__c)&&!r.__)try{if((o=r.constructor)&&null!=o.getDerivedStateFromError&&(r.setState(o.getDerivedStateFromError(e)),a=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,i||{}),a=r.__d),a)return r.__E=r}catch(t){e=t}throw e}},hs=0,js.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=As({},this.state),"function"==typeof e&&(e=e(As({},n),this.props)),e&&As(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),$s(this))},js.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$s(this))},js.prototype.render=Ds,ds=[],ms="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gs=function(e,t){return e.__v.__b-t.__v.__b},Is.__r=0,ys=Math.random().toString(8),vs="__d"+ys,bs="__a"+ys,_s=/(PointerCapture)$|Capture$/i,xs=0,ws=Us(!1),Es=Us(!0);var nc=function(e,t,n,i){var r;t[0]=0;for(var o=1;o<t.length;o++){var a=t[o++],s=t[o]?(t[0]|=a?1:2,n[t[o++]]):t[++o];3===a?i[0]=s:4===a?i[1]=Object.assign(i[1]||{},s):5===a?(i[1]=i[1]||{})[t[++o]]=s:6===a?i[1][t[++o]]+=s+"":a?(r=e.apply(s,nc(e,s,n,["",null])),i.push(r),s[0]?t[0]|=2:(t[o-2]=0,t[o]=r)):i.push(s)}return i},ic=new Map;var rc,oc,ac,sc,cc=function(e){var t=ic.get(this);return t||(t=new Map,ic.set(this,t)),(t=nc(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,i=1,r="",o="",a=[0],s=function(e){1===i&&(e||(r=r.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?a.push(0,e,r):3===i&&(e||r)?(a.push(3,e,r),i=2):2===i&&"..."===r&&e?a.push(4,e,0):2===i&&r&&!e?a.push(5,0,!0,r):i>=5&&((r||!e&&5===i)&&(a.push(i,0,r,n),i=6),e&&(a.push(i,e,0,n),i=6)),r=""},c=0;c<e.length;c++){c&&(1===i&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],1===i?"<"===t?(s(),a=[a],i=3):r+=t:4===i?"--"===r&&">"===t?(i=1,r=""):r=t+r[0]:o?t===o?o="":r+=t:'"'===t||"'"===t?o=t:">"===t?(s(),i=1):i&&("="===t?(i=5,n=r,r=""):"/"===t&&(i<5||">"===e[c][l+1])?(s(),3===i&&(a=a[0]),i=a,(a=a[0]).push(2,0,i),i=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(s(),i=2):r+=t),3===i&&"!--"===r&&(i=4,a=a[0])}return s(),a}(e)),t),arguments,[])).length>1?t:t[0]}.bind(Ts),lc=0,pc=[],uc=us,hc=uc.__b,dc=uc.__r,fc=uc.diffed,mc=uc.__c,gc=uc.unmount,yc=uc.__;function vc(e,t){uc.__h&&uc.__h(oc,e,lc||t),lc=0;var n=oc.__H||(oc.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function bc(e){return lc=1,function(e,t){var n=vc(rc++,2);if(n.t=e,!n.__c&&(n.__=[Tc(void 0,t),function(e){var t=n.__N?n.__N[0]:n.__[0],i=n.t(t,e);t!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=oc,!oc.__f)){var i=function(e,t,i){if(!n.__c.__H)return!0;var o=n.__c.__H.__.filter(function(e){return e.__c});if(o.every(function(e){return!e.__N}))return!r||r.call(this,e,t,i);var a=n.__c.props!==e;return o.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),r&&r.call(this,e,t,i)||a};oc.__f=!0;var r=oc.shouldComponentUpdate,o=oc.componentWillUpdate;oc.componentWillUpdate=function(e,t,n){if(this.__e){var a=r;r=void 0,i(e,t,n),r=a}o&&o.call(this,e,t,n)},oc.shouldComponentUpdate=i}return n.__N||n.__}(Tc,e)}function _c(e,t){var n=vc(rc++,3);!uc.__s&&Mc(n.__H,t)&&(n.__=e,n.u=t,oc.__H.__h.push(n))}function xc(e,t){var n=vc(rc++,4);!uc.__s&&Mc(n.__H,t)&&(n.__=e,n.u=t,oc.__h.push(n))}function wc(e){return lc=5,Ec(function(){return{current:e}},[])}function Ec(e,t){var n=vc(rc++,7);return Mc(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Sc(e,t){return lc=8,Ec(function(){return e},t)}function kc(){for(var e;e=pc.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Pc),t.__h.some(Ac),t.__h=[]}catch(n){t.__h=[],uc.__e(n,e.__v)}}}uc.__b=function(e){oc=null,hc&&hc(e)},uc.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),yc&&yc(e,t)},uc.__r=function(e){dc&&dc(e),rc=0;var t=(oc=e.__c).__H;t&&(ac===oc?(t.__h=[],oc.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Pc),t.__h.some(Ac),t.__h=[],rc=0)),ac=oc},uc.diffed=function(e){fc&&fc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==pc.push(t)&&sc===uc.requestAnimationFrame||((sc=uc.requestAnimationFrame)||Rc)(kc)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),ac=oc=null},uc.__c=function(e,t){t.some(function(e){try{e.__h.some(Pc),e.__h=e.__h.filter(function(e){return!e.__||Ac(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],uc.__e(n,e.__v)}}),mc&&mc(e,t)},uc.unmount=function(e){gc&&gc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Pc(e)}catch(e){t=e}}),n.__H=void 0,t&&uc.__e(t,n.__v))};var Cc="function"==typeof requestAnimationFrame;function Rc(e){var t,n=function(){clearTimeout(i),Cc&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(n,35);Cc&&(t=requestAnimationFrame(n))}function Pc(e){var t=oc,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),oc=t}function Ac(e){var t=oc;e.__c=e.__(),oc=t}function Mc(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Tc(e,t){return"function"==typeof t?t(e):t}function Bc(e){const{navigationStack:t,setNavigationStack:n}=e,i=Ec(()=>t.length<=1?[]:t.slice(0,-1).map((e,t)=>({label:e.label,onClick:()=>n(e=>e.slice(0,t+1))})),[t,n]),r=t.length>0?()=>n([]):null,o=t.length>0?t[t.length-1].label:null;return cc`
28
28
  <div class="djs-popup-breadcrumbs">
29
29
  ${r&&cc`
30
30
  <button